/** * * SmartEarth WebSDK - https://websdk.terra-it.cn * Version 5.1.6 * **/ var W0t=Object.create;var Pce=Object.defineProperty;var j0t=Object.getOwnPropertyDescriptor;var Y0t=Object.getOwnPropertyNames;var q0t=Object.getPrototypeOf,X0t=Object.prototype.hasOwnProperty;var Kb=(o=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(o,{get:(f,m)=>(typeof require<"u"?require:f)[m]}):o)(function(o){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')});var r9=(o,f)=>()=>(f||o((f={exports:{}}).exports,f),f.exports),Ice=(o,f)=>{for(var m in f)Pce(o,m,{get:f[m],enumerable:!0})},J0t=(o,f,m,v)=>{if(f&&typeof f=="object"||typeof f=="function")for(let y of Y0t(f))!X0t.call(o,y)&&y!==m&&Pce(o,y,{get:()=>f[y],enumerable:!(v=j0t(f,y))||v.enumerable});return o};var qK=(o,f,m)=>(m=o!=null?W0t(q0t(o)):{},J0t(f||!o||!o.__esModule?Pce(m,"default",{value:o,enumerable:!0}):m,o));var Iut=r9((Put,Ose)=>{(function(o,f,m){typeof Ose<"u"&&Ose.exports?Ose.exports=m():typeof define=="function"&&define.amd?define(m):f[o]=m()})("h337",Put,function(){var o={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}},f=function(){var A=function(S){this._coordinator={},this._data=[],this._radi=[],this._min=10,this._max=1,this._xField=S.xField||S.defaultXField,this._yField=S.yField||S.defaultYField,this._valueField=S.valueField||S.defaultValueField,S.radius&&(this._cfgRadius=S.radius)},E=o.defaultRadius;return A.prototype={_organiseData:function(T,S){var M=T[this._xField],I=T[this._yField],P=this._radi,D=this._data,L=this._max,R=this._min,O=T[this._valueField]||1,F=T.radius||this._cfgRadius||E;D[M]||(D[M]=[],P[M]=[]),D[M][I]?D[M][I]+=O:(D[M][I]=O,P[M][I]=F);var k=D[M][I];return k>L?(S?this.setDataMax(k):this._max=k,!1):k0)for(var T=arguments[0],S=T.length;S--;)this.addData.call(this,T[S]);else{var M=this._organiseData(arguments[0],!0);M&&(this._data.length===0&&(this._min=this._max=M.value),this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[M]}))}return this},setData:function(T){var S=T.data,M=S.length;this._data=[],this._radi=[];for(var I=0;I0&&(this._drawAlpha(M),this._colorize())},renderAll:function(M){this._clear(),M.data.length>0&&(this._drawAlpha(T(M)),this._colorize())},_updateGradient:function(M){this._palette=A(M)},updateConfig:function(M){M.gradient&&this._updateGradient(M),this._setStyles(M)},setDimensions:function(M,I){this._width=M,this._height=I,this.canvas.width=this.shadowCanvas.width=M,this.canvas.height=this.shadowCanvas.height=I},_clear:function(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)},_setStyles:function(M){this._blur=M.blur==0?0:M.blur||M.defaultBlur,M.backgroundColor&&(this.canvas.style.backgroundColor=M.backgroundColor),this._width=this.canvas.width=this.shadowCanvas.width=M.width||this._width,this._height=this.canvas.height=this.shadowCanvas.height=M.height||this._height,this._opacity=(M.opacity||0)*255,this._maxOpacity=(M.maxOpacity||M.defaultMaxOpacity)*255,this._minOpacity=(M.minOpacity||M.defaultMinOpacity)*255,this._useGradientOpacity=!!M.useGradientOpacity},_drawAlpha:function(D){for(var I=this._min=D.min,P=this._max=D.max,D=D.data||[],L=D.length,R=1-this._blur;L--;){var O=D[L],F=O.x,k=O.y,U=O.radius,G=Math.min(O.value,P),j=F-U,q=k-U,J=this.shadowCtx,X;this._templates[U]?X=this._templates[U]:this._templates[U]=X=E(U,R);var Y=(G-I)/(P-I);J.globalAlpha=Y<.01?.01:Y,J.drawImage(X,j,q),jthis._renderBoundaries[2]&&(this._renderBoundaries[2]=j+2*U),q+2*U>this._renderBoundaries[3]&&(this._renderBoundaries[3]=q+2*U)}},_colorize:function(){var M=this._renderBoundaries[0],I=this._renderBoundaries[1],P=this._renderBoundaries[2]-M,D=this._renderBoundaries[3]-I,L=this._width,R=this._height,O=this._opacity,F=this._maxOpacity,k=this._minOpacity,U=this._useGradientOpacity;M<0&&(M=0),I<0&&(I=0),M+P>L&&(P=L-M),I+D>R&&(D=R-I);for(var G=this.shadowCtx.getImageData(M,I,P,D),j=G.data,q=j.length,J=this._palette,X=3;X0?ee=O:Y>0,I},getDataURL:function(){return this.canvas.toDataURL()}},S}(),v=function(){var A=!1;return o.defaultRenderer==="canvas2d"&&(A=m),A}(),y={merge:function(){for(var w={},A=arguments.length,E=0;E{/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */sRe.read=function(o,f,m,v,y){var x,C,w=y*8-v-1,A=(1<>1,T=-7,S=m?y-1:0,M=m?-1:1,I=o[f+S];for(S+=M,x=I&(1<<-T)-1,I>>=-T,T+=w;T>0;x=x*256+o[f+S],S+=M,T-=8);for(C=x&(1<<-T)-1,x>>=-T,T+=v;T>0;C=C*256+o[f+S],S+=M,T-=8);if(x===0)x=1-E;else{if(x===A)return C?NaN:(I?-1:1)*(1/0);C=C+Math.pow(2,v),x=x-E}return(I?-1:1)*C*Math.pow(2,x-v)};sRe.write=function(o,f,m,v,y,x){var C,w,A,E=x*8-y-1,T=(1<>1,M=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=v?0:x-1,P=v?1:-1,D=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(w=isNaN(f)?1:0,C=T):(C=Math.floor(Math.log(f)/Math.LN2),f*(A=Math.pow(2,-C))<1&&(C--,A*=2),C+S>=1?f+=M/A:f+=M*Math.pow(2,1-S),f*A>=2&&(C++,A/=2),C+S>=T?(w=0,C=T):C+S>=1?(w=(f*A-1)*Math.pow(2,y),C=C+S):(w=f*Math.pow(2,S-1)*Math.pow(2,y),C=0));y>=8;o[m+I]=w&255,I+=P,w/=256,y-=8);for(C=C<0;o[m+I]=C&255,I+=P,C/=256,E-=8);o[m+I-P]|=D*128}});var ift=r9((Gsr,tft)=>{"use strict";tft.exports=Eh;var sue=Kdt();function Eh(o){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(o)?o:new Uint8Array(o||0),this.pos=0,this.type=0,this.length=this.buf.length}Eh.Varint=0;Eh.Fixed64=1;Eh.Bytes=2;Eh.Fixed32=5;var lRe=(1<<16)*(1<<16),Qdt=1/lRe,WVi=12,eft=typeof TextDecoder>"u"?null:new TextDecoder("utf8");Eh.prototype={destroy:function(){this.buf=null},readFields:function(o,f,m){for(m=m||this.length;this.pos>3,x=this.pos;this.type=v&7,o(y,f,this),this.pos===x&&this.skip(v)}return f},readMessage:function(o,f){return this.readFields(o,f,this.readVarint()+this.pos)},readFixed32:function(){var o=lue(this.buf,this.pos);return this.pos+=4,o},readSFixed32:function(){var o=$dt(this.buf,this.pos);return this.pos+=4,o},readFixed64:function(){var o=lue(this.buf,this.pos)+lue(this.buf,this.pos+4)*lRe;return this.pos+=8,o},readSFixed64:function(){var o=lue(this.buf,this.pos)+$dt(this.buf,this.pos+4)*lRe;return this.pos+=8,o},readFloat:function(){var o=sue.read(this.buf,this.pos,!0,23,4);return this.pos+=4,o},readDouble:function(){var o=sue.read(this.buf,this.pos,!0,52,8);return this.pos+=8,o},readVarint:function(o){var f=this.buf,m,v;return v=f[this.pos++],m=v&127,v<128||(v=f[this.pos++],m|=(v&127)<<7,v<128)||(v=f[this.pos++],m|=(v&127)<<14,v<128)||(v=f[this.pos++],m|=(v&127)<<21,v<128)?m:(v=f[this.pos],m|=(v&15)<<28,jVi(m,o,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var o=this.readVarint();return o%2===1?(o+1)/-2:o/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var o=this.readVarint()+this.pos,f=this.pos;return this.pos=o,o-f>=WVi&&eft?ozi(this.buf,f,o):nzi(this.buf,f,o)},readBytes:function(){var o=this.readVarint()+this.pos,f=this.buf.subarray(this.pos,o);return this.pos=o,f},readPackedVarint:function(o,f){if(this.type!==Eh.Bytes)return o.push(this.readVarint(f));var m=QD(this);for(o=o||[];this.pos127;);else if(f===Eh.Bytes)this.pos=this.readVarint()+this.pos;else if(f===Eh.Fixed32)this.pos+=4;else if(f===Eh.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+f)},writeTag:function(o,f){this.writeVarint(o<<3|f)},realloc:function(o){for(var f=this.length||16;f268435455||o<0){YVi(o,this);return}this.realloc(4),this.buf[this.pos++]=o&127|(o>127?128:0),!(o<=127)&&(this.buf[this.pos++]=(o>>>=7)&127|(o>127?128:0),!(o<=127)&&(this.buf[this.pos++]=(o>>>=7)&127|(o>127?128:0),!(o<=127)&&(this.buf[this.pos++]=o>>>7&127)))},writeSVarint:function(o){this.writeVarint(o<0?-o*2-1:o*2)},writeBoolean:function(o){this.writeVarint(Boolean(o))},writeString:function(o){o=String(o),this.realloc(o.length*4),this.pos++;var f=this.pos;this.pos=azi(this.buf,o,this.pos);var m=this.pos-f;m>=128&&Zdt(f,m,this),this.pos=f-1,this.writeVarint(m),this.pos+=m},writeFloat:function(o){this.realloc(4),sue.write(this.buf,o,this.pos,!0,23,4),this.pos+=4},writeDouble:function(o){this.realloc(8),sue.write(this.buf,o,this.pos,!0,52,8),this.pos+=8},writeBytes:function(o){var f=o.length;this.writeVarint(f),this.realloc(f);for(var m=0;m=128&&Zdt(m,v,this),this.pos=m-1,this.writeVarint(v),this.pos+=v},writeMessage:function(o,f,m){this.writeTag(o,Eh.Bytes),this.writeRawMessage(f,m)},writePackedVarint:function(o,f){f.length&&this.writeMessage(o,JVi,f)},writePackedSVarint:function(o,f){f.length&&this.writeMessage(o,KVi,f)},writePackedBoolean:function(o,f){f.length&&this.writeMessage(o,$Vi,f)},writePackedFloat:function(o,f){f.length&&this.writeMessage(o,QVi,f)},writePackedDouble:function(o,f){f.length&&this.writeMessage(o,ZVi,f)},writePackedFixed32:function(o,f){f.length&&this.writeMessage(o,ezi,f)},writePackedSFixed32:function(o,f){f.length&&this.writeMessage(o,tzi,f)},writePackedFixed64:function(o,f){f.length&&this.writeMessage(o,izi,f)},writePackedSFixed64:function(o,f){f.length&&this.writeMessage(o,rzi,f)},writeBytesField:function(o,f){this.writeTag(o,Eh.Bytes),this.writeBytes(f)},writeFixed32Field:function(o,f){this.writeTag(o,Eh.Fixed32),this.writeFixed32(f)},writeSFixed32Field:function(o,f){this.writeTag(o,Eh.Fixed32),this.writeSFixed32(f)},writeFixed64Field:function(o,f){this.writeTag(o,Eh.Fixed64),this.writeFixed64(f)},writeSFixed64Field:function(o,f){this.writeTag(o,Eh.Fixed64),this.writeSFixed64(f)},writeVarintField:function(o,f){this.writeTag(o,Eh.Varint),this.writeVarint(f)},writeSVarintField:function(o,f){this.writeTag(o,Eh.Varint),this.writeSVarint(f)},writeStringField:function(o,f){this.writeTag(o,Eh.Bytes),this.writeString(f)},writeFloatField:function(o,f){this.writeTag(o,Eh.Fixed32),this.writeFloat(f)},writeDoubleField:function(o,f){this.writeTag(o,Eh.Fixed64),this.writeDouble(f)},writeBooleanField:function(o,f){this.writeVarintField(o,Boolean(f))}};function jVi(o,f,m){var v=m.buf,y,x;if(x=v[m.pos++],y=(x&112)>>4,x<128||(x=v[m.pos++],y|=(x&127)<<3,x<128)||(x=v[m.pos++],y|=(x&127)<<10,x<128)||(x=v[m.pos++],y|=(x&127)<<17,x<128)||(x=v[m.pos++],y|=(x&127)<<24,x<128)||(x=v[m.pos++],y|=(x&1)<<31,x<128))return q8(o,y,f);throw new Error("Expected varint not more than 10 bytes")}function QD(o){return o.type===Eh.Bytes?o.readVarint()+o.pos:o.pos+1}function q8(o,f,m){return m?f*4294967296+(o>>>0):(f>>>0)*4294967296+(o>>>0)}function YVi(o,f){var m,v;if(o>=0?(m=o%4294967296|0,v=o/4294967296|0):(m=~(-o%4294967296),v=~(-o/4294967296),m^4294967295?m=m+1|0:(m=0,v=v+1|0)),o>=18446744073709552e3||o<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");f.realloc(10),qVi(m,v,f),XVi(v,f)}function qVi(o,f,m){m.buf[m.pos++]=o&127|128,o>>>=7,m.buf[m.pos++]=o&127|128,o>>>=7,m.buf[m.pos++]=o&127|128,o>>>=7,m.buf[m.pos++]=o&127|128,o>>>=7,m.buf[m.pos]=o&127}function XVi(o,f){var m=(o&7)<<4;f.buf[f.pos++]|=m|((o>>>=3)?128:0),o&&(f.buf[f.pos++]=o&127|((o>>>=7)?128:0),o&&(f.buf[f.pos++]=o&127|((o>>>=7)?128:0),o&&(f.buf[f.pos++]=o&127|((o>>>=7)?128:0),o&&(f.buf[f.pos++]=o&127|((o>>>=7)?128:0),o&&(f.buf[f.pos++]=o&127)))))}function Zdt(o,f,m){var v=f<=16383?1:f<=2097151?2:f<=268435455?3:Math.floor(Math.log(f)/(Math.LN2*7));m.realloc(v);for(var y=m.pos-1;y>=o;y--)m.buf[y+v]=m.buf[y]}function JVi(o,f){for(var m=0;m>>8,o[m+2]=f>>>16,o[m+3]=f>>>24}function $dt(o,f){return(o[f]|o[f+1]<<8|o[f+2]<<16)+(o[f+3]<<24)}function nzi(o,f,m){for(var v="",y=f;y239?4:x>223?3:x>191?2:1;if(y+w>m)break;var A,E,T;w===1?x<128&&(C=x):w===2?(A=o[y+1],(A&192)===128&&(C=(x&31)<<6|A&63,C<=127&&(C=null))):w===3?(A=o[y+1],E=o[y+2],(A&192)===128&&(E&192)===128&&(C=(x&15)<<12|(A&63)<<6|E&63,(C<=2047||C>=55296&&C<=57343)&&(C=null))):w===4&&(A=o[y+1],E=o[y+2],T=o[y+3],(A&192)===128&&(E&192)===128&&(T&192)===128&&(C=(x&15)<<18|(A&63)<<12|(E&63)<<6|T&63,(C<=65535||C>=1114112)&&(C=null))),C===null?(C=65533,w=1):C>65535&&(C-=65536,v+=String.fromCharCode(C>>>10&1023|55296),C=56320|C&1023),v+=String.fromCharCode(C),y+=w}return v}function ozi(o,f,m){return eft.decode(o.subarray(f,m))}function azi(o,f,m){for(var v=0,y,x;v55295&&y<57344)if(x)if(y<56320){o[m++]=239,o[m++]=191,o[m++]=189,x=y;continue}else y=x-55296<<10|y-56320|65536,x=null;else{y>56319||v+1===f.length?(o[m++]=239,o[m++]=191,o[m++]=189):x=y;continue}else x&&(o[m++]=239,o[m++]=191,o[m++]=189,x=null);y<128?o[m++]=y:(y<2048?o[m++]=y>>6|192:(y<65536?o[m++]=y>>12|224:(o[m++]=y>>18|240,o[m++]=y>>12&63|128),o[m++]=y>>6&63|128),o[m++]=y&63|128)}return m}});var amt=r9((uG,HJ)=>{/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */(function(){var o,f="4.17.21",m=200,v="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",y="Expected a function",x="Invalid `variable` option passed into `_.template`",C="__lodash_hash_undefined__",w=500,A="__lodash_placeholder__",E=1,T=2,S=4,M=1,I=2,P=1,D=2,L=4,R=8,O=16,F=32,k=64,U=128,G=256,j=512,q=30,J="...",X=800,Y=16,Q=1,ee=2,z=3,ie=1/0,re=9007199254740991,ne=17976931348623157e292,oe=0/0,se=4294967295,ae=se-1,fe=se>>>1,de=[["ary",U],["bind",P],["bindKey",D],["curry",R],["curryRight",O],["flip",j],["partial",F],["partialRight",k],["rearg",G]],ve="[object Arguments]",pe="[object Array]",ce="[object AsyncFunction]",he="[object Boolean]",Ce="[object Date]",Se="[object DOMException]",De="[object Error]",Oe="[object Function]",Ue="[object GeneratorFunction]",Xe="[object Map]",it="[object Number]",ut="[object Null]",at="[object Object]",Pt="[object Promise]",Qe="[object Proxy]",ft="[object RegExp]",Ot="[object Set]",Xt="[object String]",At="[object Symbol]",bt="[object Undefined]",gt="[object WeakMap]",It="[object WeakSet]",Jt="[object ArrayBuffer]",bi="[object DataView]",Yi="[object Float32Array]",ii="[object Float64Array]",ei="[object Int8Array]",Li="[object Int16Array]",Je="[object Int32Array]",Nt="[object Uint8Array]",yi="[object Uint8ClampedArray]",ai="[object Uint16Array]",wi="[object Uint32Array]",ji=/\b__p \+= '';/g,hi=/\b(__p \+=) '' \+/g,Ri=/(__e\(.*?\)|\b__t\)) \+\n'';/g,pt=/&(?:amp|lt|gt|quot|#39);/g,wr=/[&<>"']/g,zi=RegExp(pt.source),Ui=RegExp(wr.source),Gt=/<%-([\s\S]+?)%>/g,$t=/<%([\s\S]+?)%>/g,jt=/<%=([\s\S]+?)%>/g,ct=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Pe=/^\w*$/,Ht=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,si=/[\\^$.*+?()[\]{}|]/g,_t=RegExp(si.source),Yt=/^\s+/,Fi=/\s/,Dt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Si=/,? & /,nt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wt=/[()=,{}\[\]\/\s]/,yt=/\\(\\)?/g,Tt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Et=/\w*$/,ti=/^[-+]0x[0-9a-f]+$/i,ir=/^0b[01]+$/i,or=/^\[object .+?Constructor\]$/,xr=/^0o[0-7]+$/i,Tn=/^(?:0|[1-9]\d*)$/,Ii=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,pr=/($^)/,yn=/['\n\r\u2028\u2029\\]/g,dn="\\ud800-\\udfff",fn="\\u0300-\\u036f",Or="\\ufe20-\\ufe2f",On="\\u20d0-\\u20ff",eo=fn+Or+On,Cn="\\u2700-\\u27bf",Sa="a-z\\xdf-\\xf6\\xf8-\\xff",Va="\\xac\\xb1\\xd7\\xf7",za="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",zr="\\u2000-\\u206f",Ci=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ni="A-Z\\xc0-\\xd6\\xd8-\\xde",cr="\\ufe0e\\ufe0f",Bi=Va+za+zr+Ci,Ct="['\u2019]",Mi="["+dn+"]",$i="["+Bi+"]",ur="["+eo+"]",Nr="\\d+",qe="["+Cn+"]",tt="["+Sa+"]",$e="[^"+dn+Bi+Nr+Cn+Sa+Ni+"]",St="\\ud83c[\\udffb-\\udfff]",Zt="(?:"+ur+"|"+St+")",ui="[^"+dn+"]",hr="(?:\\ud83c[\\udde6-\\uddff]){2}",Yr="[\\ud800-\\udbff][\\udc00-\\udfff]",ln="["+Ni+"]",Kn="\\u200d",Un="(?:"+tt+"|"+$e+")",Qn="(?:"+ln+"|"+$e+")",Pa="(?:"+Ct+"(?:d|ll|m|re|s|t|ve))?",Gn="(?:"+Ct+"(?:D|LL|M|RE|S|T|VE))?",Ja=Zt+"?",fl="["+cr+"]?",Ul="(?:"+Kn+"(?:"+[ui,hr,Yr].join("|")+")"+fl+Ja+")*",hu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Ys="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Wd=fl+Ja+Ul,Pc="(?:"+[qe,hr,Yr].join("|")+")"+Wd,So="(?:"+[ui+ur+"?",ur,hr,Yr,Mi].join("|")+")",Kh=RegExp(Ct,"g"),mf=RegExp(ur,"g"),Gl=RegExp(St+"(?="+St+")|"+So+Wd,"g"),Wl=RegExp([ln+"?"+tt+"+"+Pa+"(?="+[$i,ln,"$"].join("|")+")",Qn+"+"+Gn+"(?="+[$i,ln+Un,"$"].join("|")+")",ln+"?"+Un+"+"+Pa,ln+"+"+Gn,Ys,hu,Nr,Pc].join("|"),"g"),Th=RegExp("["+Kn+dn+eo+cr+"]"),rr=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,mo=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Wn=-1,yo={};yo[Yi]=yo[ii]=yo[ei]=yo[Li]=yo[Je]=yo[Nt]=yo[yi]=yo[ai]=yo[wi]=!0,yo[ve]=yo[pe]=yo[Jt]=yo[he]=yo[bi]=yo[Ce]=yo[De]=yo[Oe]=yo[Xe]=yo[it]=yo[at]=yo[ft]=yo[Ot]=yo[Xt]=yo[gt]=!1;var Ga={};Ga[ve]=Ga[pe]=Ga[Jt]=Ga[bi]=Ga[he]=Ga[Ce]=Ga[Yi]=Ga[ii]=Ga[ei]=Ga[Li]=Ga[Je]=Ga[Xe]=Ga[it]=Ga[at]=Ga[ft]=Ga[Ot]=Ga[Xt]=Ga[At]=Ga[Nt]=Ga[yi]=Ga[ai]=Ga[wi]=!0,Ga[De]=Ga[Oe]=Ga[gt]=!1;var xu={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},qs={"&":"&","<":"<",">":">",'"':""","'":"'"},Cu={"&":"&","<":"<",">":">",""":'"',"'":"'"},na={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},gf=parseFloat,Xi=parseInt,ke=typeof global=="object"&&global&&global.Object===Object&&global,Ie=typeof self=="object"&&self&&self.Object===Object&&self,He=ke||Ie||Function("return this")(),dt=typeof uG=="object"&&uG&&!uG.nodeType&&uG,Vt=dt&&typeof HJ=="object"&&HJ&&!HJ.nodeType&&HJ,ni=Vt&&Vt.exports===dt,_r=ni&&ke.process,Ir=function(){try{var pi=Vt&&Vt.require&&Vt.require("util").types;return pi||_r&&_r.binding&&_r.binding("util")}catch{}}(),Pn=Ir&&Ir.isArrayBuffer,An=Ir&&Ir.isDate,Wr=Ir&&Ir.isMap,Ho=Ir&&Ir.isRegExp,ma=Ir&&Ir.isSet,Zo=Ir&&Ir.isTypedArray;function $o(pi,Qi,dr){switch(dr.length){case 0:return pi.call(Qi);case 1:return pi.call(Qi,dr[0]);case 2:return pi.call(Qi,dr[0],dr[1]);case 3:return pi.call(Qi,dr[0],dr[1],dr[2])}return pi.apply(Qi,dr)}function du(pi,Qi,dr,bn){for(var go=-1,Uo=pi==null?0:pi.length;++go-1}function Ic(pi,Qi,dr){for(var bn=-1,go=pi==null?0:pi.length;++bn-1;);return dr}function Vm(pi,Qi){for(var dr=pi.length;dr--&&Hf(Qi,pi[dr],0)>-1;);return dr}function dy(pi,Qi){for(var dr=pi.length,bn=0;dr--;)pi[dr]===Qi&&++bn;return bn}var ah=bg(xu),G_=bg(qs);function _x(pi){return"\\"+na[pi]}function eS(pi,Qi){return pi==null?o:pi[Qi]}function fy(pi){return Th.test(pi)}function tS(pi){return rr.test(pi)}function iS(pi){for(var Qi,dr=[];!(Qi=pi.next()).done;)dr.push(Qi.value);return dr}function py(pi){var Qi=-1,dr=Array(pi.size);return pi.forEach(function(bn,go){dr[++Qi]=[go,bn]}),dr}function WC(pi,Qi){return function(dr){return pi(Qi(dr))}}function vx(pi,Qi){for(var dr=-1,bn=pi.length,go=0,Uo=[];++dr-1}function pm(ge,Ae){var ze=this.__data__,lt=ml(ze,ge);return lt<0?(++this.size,ze.push([ge,Ae])):ze[lt][1]=Ae,this}Cx.prototype.clear=CG,Cx.prototype.delete=$0,Cx.prototype.get=UA,Cx.prototype.has=bG,Cx.prototype.set=pm;function jf(ge){var Ae=-1,ze=ge==null?0:ge.length;for(this.clear();++Ae=Ae?ge:Ae)),ge}function c0(ge,Ae,ze,lt,Qt,Ai){var Ki,gr=Ae&E,Er=Ae&T,vn=Ae&S;if(ze&&(Ki=Qt?ze(ge,lt,Qt,Ai):ze(ge)),Ki!==o)return Ki;if(!ks(ge))return ge;var Vn=Ro(ge);if(Vn){if(Ki=DG(ge),!gr)return qd(ge,Ki)}else{var Zn=Yf(ge),Wo=Zn==Oe||Zn==Ue;if(Dg(ge))return i_(ge,gr);if(Zn==at||Zn==ve||Wo&&!Qt){if(Ki=Er||Wo?{}:QC(ge),!gr)return Er?zk(ge,ou(Ki,ge)):Ad(ge,Ol(Ki,ge))}else{if(!Ga[Zn])return Qt?ge:{};Ki=qf(ge,Zn,gr)}}Ai||(Ai=new Xs);var Ha=Ai.get(ge);if(Ha)return Ha;Ai.set(ge,Ki),Ih(ge)?ge.forEach(function(oa){Ki.add(c0(oa,Ae,ze,oa,ge,Ai))}):Id(ge)&&ge.forEach(function(oa,Ea){Ki.set(Ea,c0(oa,Ae,ze,Ea,ge,Ai))});var Vs=vn?Er?SL:JA:Er?Gp:hs,au=Vn?o:Vs(ge);return rs(au||ge,function(oa,Ea){au&&(Ea=oa,oa=ge[Ea]),pl(Ki,Ea,c0(oa,Ae,ze,Ea,ge,Ai))}),Ki}function gN(ge){var Ae=hs(ge);return function(ze){return hL(ze,ge,Ae)}}function hL(ge,Ae,ze){var lt=ze.length;if(ge==null)return!lt;for(ge=nc(ge);lt--;){var Qt=ze[lt],Ai=Ae[Qt],Ki=ge[Qt];if(Ki===o&&!(Qt in ge)||!Ai(Ki))return!1}return!0}function dL(ge,Ae,ze){if(typeof ge!="function")throw new l0(y);return fI(function(){ge.apply(o,ze)},Ae)}function WA(ge,Ae,ze,lt){var Qt=-1,Ai=Wu,Ki=!0,gr=ge.length,Er=[],vn=Ae.length;if(!gr)return Er;ze&&(Ae=Os(Ae,Uf(ze))),lt?(Ai=Ic,Ki=!1):Ae.length>=m&&(Ai=gx,Ki=!1,Ae=new sl(Ae));e:for(;++QtQt?0:Qt+ze),lt=lt===o||lt>Qt?Qt:qa(lt),lt<0&&(lt+=Qt),lt=ze>lt?0:ZN(lt);ze0&&ze(gr)?Ae>1?ys(gr,Ae-1,ze,lt,Qt):Ns(Qt,gr):lt||(Qt[Qt.length]=gr)}return Qt}var Nl=Uk(),Fo=Uk(!0);function ri(ge,Ae){return ge&&Nl(ge,Ae,hs)}function eI(ge,Ae){return ge&&Fo(ge,Ae,hs)}function fL(ge,Ae){return Hs(Ae,function(ze){return Wm(ge[ze])})}function jA(ge,Ae){Ae=q_(Ae,ge);for(var ze=0,lt=Ae.length;ge!=null&&zeAe}function wG(ge,Ae){return ge!=null&&vc.call(ge,Ae)}function AG(ge,Ae){return ge!=null&&Ae in nc(ge)}function Ek(ge,Ae,ze){return ge>=Wf(Ae,ze)&&ge=120&&Vn.length>=120)?new sl(Ki&&Vn):o}Vn=ge[0];var Zn=-1,Wo=gr[0];e:for(;++Zn-1;)gr!==ge&&Z0.call(gr,Er,1),Z0.call(ge,Er,1);return ge}function _L(ge,Ae){for(var ze=ge?Ae.length:0,lt=ze-1;ze--;){var Qt=Ae[ze];if(ze==lt||Qt!==Ai){var Ai=Qt;xy(Qt)?Z0.call(ge,Qt,1):pS(ge,Qt)}}return ge}function EN(ge,Ae){return ge+aS(Db()*(Ae-ge+1))}function TG(ge,Ae,ze,lt){for(var Qt=-1,Ai=xf(oS((Ae-ge)/(ze||1)),0),Ki=dr(Ai);Ai--;)Ki[lt?Ai:++Qt]=ge,ge+=ze;return Ki}function vL(ge,Ae){var ze="";if(!ge||Ae<1||Ae>re)return ze;do Ae%2&&(ze+=ge),Ae=aS(Ae/2),Ae&&(ge+=ge);while(Ae);return ze}function gl(ge,Ae){return OL(vS(ge,Ae,y0),ge+"")}function yL(ge){return Rl(jp(ge))}function Fk(ge,Ae){var ze=jp(ge);return pI(ze,bx(Ae,0,ze.length))}function nI(ge,Ae,ze,lt){if(!ks(ge))return ge;Ae=q_(Ae,ge);for(var Qt=-1,Ai=Ae.length,Ki=Ai-1,gr=ge;gr!=null&&++QtQt?0:Qt+Ae),ze=ze>Qt?Qt:ze,ze<0&&(ze+=Qt),Qt=Ae>ze?0:ze-Ae>>>0,Ae>>>=0;for(var Ai=dr(Qt);++lt>>1,Ki=ge[Ai];Ki!==null&&!jm(Ki)&&(ze?Ki<=Ae:Ki=m){var vn=Ae?null:Sl(ge);if(vn)return BA(vn);Ki=!1,Qt=gx,Er=new sl}else Er=Ae?[]:gr;e:for(;++lt=lt?ge:j_(ge,Ae,ze)}var mS=_k||function(ge){return He.clearTimeout(ge)};function i_(ge,Ae){if(Ae)return ge.slice();var ze=ge.length,lt=JP?JP(ze):new ge.constructor(ze);return ge.copy(lt),lt}function gS(ge){var Ae=new ge.constructor(ge.byteLength);return new nS(Ae).set(new nS(ge)),Ae}function PG(ge,Ae){var ze=Ae?gS(ge.buffer):ge.buffer;return new ge.constructor(ze,ge.byteOffset,ge.byteLength)}function IG(ge){var Ae=new ge.constructor(ge.source,Et.exec(ge));return Ae.lastIndex=ge.lastIndex,Ae}function MG(ge){return hS?nc(hS.call(ge)):{}}function DN(ge,Ae){var ze=Ae?gS(ge.buffer):ge.buffer;return new ge.constructor(ze,ge.byteOffset,ge.length)}function wL(ge,Ae){if(ge!==Ae){var ze=ge!==o,lt=ge===null,Qt=ge===ge,Ai=jm(ge),Ki=Ae!==o,gr=Ae===null,Er=Ae===Ae,vn=jm(Ae);if(!gr&&!vn&&!Ai&&ge>Ae||Ai&&Ki&&Er&&!gr&&!vn||lt&&Ki&&Er||!ze&&Er||!Qt)return 1;if(!lt&&!Ai&&!vn&&ge=gr)return Er;var vn=ze[lt];return Er*(vn=="desc"?-1:1)}}return ge.index-Ae.index}function _y(ge,Ae,ze,lt){for(var Qt=-1,Ai=ge.length,Ki=ze.length,gr=-1,Er=Ae.length,vn=xf(Ai-Ki,0),Vn=dr(Er+vn),Zn=!lt;++gr1?ze[Qt-1]:o,Ki=Qt>2?ze[2]:o;for(Ai=ge.length>3&&typeof Ai=="function"?(Qt--,Ai):o,Ki&&gm(ze[0],ze[1],Ki)&&(Ai=Qt<3?o:Ai,Qt=1),Ae=nc(Ae);++lt-1?Qt[Ai?Ae[Ki]:Ki]:o}}function kc(ge){return XC(function(Ae){var ze=Ae.length,lt=ze,Qt=u0.prototype.thru;for(ge&&Ae.reverse();lt--;){var Ai=Ae[lt];if(typeof Ai!="function")throw new l0(y);if(Qt&&!Ki&&uI(Ai)=="wrapper")var Ki=new u0([],!0)}for(lt=Ki?lt:ze;++lt1&&vl.reverse(),Vn&&Ergr))return!1;var vn=Ai.get(ge),Vn=Ai.get(Ae);if(vn&&Vn)return vn==Ae&&Vn==ge;var Zn=-1,Wo=!0,Ha=ze&I?new sl:o;for(Ai.set(ge,Ae),Ai.set(Ae,ge);++Zn1?"& ":"")+Ae[lt],Ae=Ae.join(ze>2?", ":" "),ge.replace(Dt,`{ /* [wrapped with `+Ae+`] */ `)}function zN(ge){return Ro(ge)||oE(ge)||!!(fm&&ge&&ge[fm])}function xy(ge,Ae){var ze=typeof ge;return Ae=Ae??re,!!Ae&&(ze=="number"||ze!="symbol"&&Tn.test(ge))&&ge>-1&&ge%1==0&&ge0){if(++Ae>=X)return arguments[0]}else Ae=0;return ge.apply(o,arguments)}}function pI(ge,Ae){var ze=-1,lt=ge.length,Qt=lt-1;for(Ae=Ae===o?lt:Ae;++ze1?ge[Ae-1]:o;return ze=typeof ze=="function"?(ge.pop(),ze):o,Gb(ge,ze)});function rE(ge){var Ae=vi(ge);return Ae.__chain__=!0,Ae}function TS(ge,Ae){return Ae(ge),ge}function t1(ge,Ae){return Ae(ge)}var Ed=XC(function(ge){var Ae=ge.length,ze=Ae?ge[0]:0,lt=this.__wrapped__,Qt=function(Ai){return GA(Ai,ge)};return Ae>1||this.__actions__.length||!(lt instanceof pu)||!xy(ze)?this.thru(Qt):(lt=lt.slice(ze,+ze+(Ae?1:0)),lt.__actions__.push({func:t1,args:[Qt],thisArg:o}),new u0(lt,this.__chain__).thru(function(Ai){return Ae&&!Ai.length&&Ai.push(o),Ai}))});function jN(){return rE(this)}function SS(){return new u0(this.value(),this.__chain__)}function me(){this.__values__===o&&(this.__values__=ov(this.value()));var ge=this.__index__>=this.__values__.length,Ae=ge?o:this.__values__[this.__index__++];return{done:ge,value:Ae}}function we(){return this}function Be(ge){for(var Ae,ze=this;ze instanceof ZP;){var lt=Zk(ze);lt.__index__=0,lt.__values__=o,Ae?Qt.__wrapped__=lt:Ae=lt;var Qt=lt;ze=ze.__wrapped__}return Qt.__wrapped__=ge,Ae}function ht(){var ge=this.__wrapped__;if(ge instanceof pu){var Ae=ge;return this.__actions__.length&&(Ae=new pu(this)),Ae=Ae.reverse(),Ae.__actions__.push({func:t1,args:[_l],thisArg:o}),new u0(Ae,this.__chain__)}return this.thru(_l)}function Kt(){return t_(this.__wrapped__,this.__actions__)}var di=oI(function(ge,Ae,ze){vc.call(ge,ze)?++ge[ze]:gy(ge,ze,1)});function tr(ge,Ae,ze){var lt=Ro(ge)?fu:Ya;return ze&&gm(ge,Ae,ze)&&(Ae=o),lt(ge,Is(Ae,3))}function mr(ge,Ae){var ze=Ro(ge)?Hs:Ka;return ze(ge,Is(Ae,3))}var Mr=mm(Ts),Ln=mm(GN);function Bn(ge,Ae){return ys(_m(ge,Ae),1)}function Xn(ge,Ae){return ys(_m(ge,Ae),ie)}function Jo(ge,Ae,ze){return ze=ze===o?1:qa(ze),ys(_m(ge,Ae),ze)}function Ma(ge,Ae){var ze=Ro(ge)?rs:Yo;return ze(ge,Is(Ae,3))}function Bs(ge,Ae){var ze=Ro(ge)?Wa:Qo;return ze(ge,Is(Ae,3))}var Pl=oI(function(ge,Ae,ze){vc.call(ge,ze)?ge[ze].push(Ae):gy(ge,ze,[Ae])});function Go(ge,Ae,ze,lt){ge=rv(ge)?ge:jp(ge),ze=ze&&!lt?qa(ze):0;var Qt=ge.length;return ze<0&&(ze=xf(Qt+ze,0)),ym(ge)?ze<=Qt&&ge.indexOf(Ae,ze)>-1:!!Qt&&Hf(ge,Ae,ze)>-1}var rl=gl(function(ge,Ae,ze){var lt=-1,Qt=typeof Ae=="function",Ai=rv(ge)?dr(ge.length):[];return Yo(ge,function(Ki){Ai[++lt]=Qt?$o(Ae,Ki,ze):Bb(Ki,Ae,ze)}),Ai}),Au=oI(function(ge,Ae,ze){gy(ge,ze,Ae)});function _m(ge,Ae){var ze=Ro(ge)?Os:Ok;return ze(ge,Is(Ae,3))}function oc(ge,Ae,ze,lt){return ge==null?[]:(Ro(Ae)||(Ae=Ae==null?[]:[Ae]),ze=lt?o:ze,Ro(ze)||(ze=ze==null?[]:[ze]),mL(ge,Ae,ze))}var vm=oI(function(ge,Ae,ze){ge[ze?0:1].push(Ae)},function(){return[[],[]]});function Xd(ge,Ae,ze){var lt=Ro(ge)?_c:Qh,Qt=arguments.length<3;return lt(ge,Is(Ae,4),ze,Qt,Yo)}function Jd(ge,Ae,ze){var lt=Ro(ge)?_f:Qh,Qt=arguments.length<3;return lt(ge,Is(Ae,4),ze,Qt,Qo)}function $_(ge,Ae){var ze=Ro(ge)?Hs:Ka;return ze(ge,PS(Is(Ae,3)))}function i1(ge){var Ae=Ro(ge)?Rl:yL;return Ae(ge)}function ku(ge,Ae,ze){(ze?gm(ge,Ae,ze):Ae===o)?Ae=1:Ae=qa(Ae);var lt=Ro(ge)?iu:Fk;return lt(ge,Ae)}function Ey(ge){var Ae=Ro(ge)?ru:SG;return Ae(ge)}function Px(ge){if(ge==null)return 0;if(rv(ge))return ym(ge)?Ve(ge):ge.length;var Ae=Yf(ge);return Ae==Xe||Ae==Ot?ge.size:xN(ge).length}function Ty(ge,Ae,ze){var lt=Ro(ge)?wd:kk;return ze&&gm(ge,Ae,ze)&&(Ae=o),lt(ge,Is(Ae,3))}var Gm=gl(function(ge,Ae){if(ge==null)return[];var ze=Ae.length;return ze>1&&gm(ge,Ae[0],Ae[1])?Ae=[]:ze>2&&gm(Ae[0],Ae[1],Ae[2])&&(Ae=[Ae[0]]),mL(ge,ys(Ae,1),[])}),r1=vG||function(){return He.Date.now()};function ev(ge,Ae){if(typeof Ae!="function")throw new l0(y);return ge=qa(ge),function(){if(--ge<1)return Ae.apply(this,arguments)}}function YN(ge,Ae,ze){return Ae=ze?o:Ae,Ae=ge&&Ae==null?ge.length:Ae,bf(ge,U,o,o,o,o,Ae)}function cK(ge,Ae){var ze;if(typeof Ae!="function")throw new l0(y);return ge=qa(ge),function(){return--ge>0&&(ze=Ae.apply(this,arguments)),ge<=1&&(Ae=o),ze}}var VG=gl(function(ge,Ae,ze){var lt=P;if(ze.length){var Qt=vx(ze,KA(VG));lt|=F}return bf(ge,lt,Ae,ze,Qt)}),hK=gl(function(ge,Ae,ze){var lt=P|D;if(ze.length){var Qt=vx(ze,KA(hK));lt|=F}return bf(Ae,lt,ge,ze,Qt)});function dK(ge,Ae,ze){Ae=ze?o:Ae;var lt=bf(ge,R,o,o,o,o,o,Ae);return lt.placeholder=dK.placeholder,lt}function fK(ge,Ae,ze){Ae=ze?o:Ae;var lt=bf(ge,O,o,o,o,o,o,Ae);return lt.placeholder=fK.placeholder,lt}function pK(ge,Ae,ze){var lt,Qt,Ai,Ki,gr,Er,vn=0,Vn=!1,Zn=!1,Wo=!0;if(typeof ge!="function")throw new l0(y);Ae=Rx(Ae)||0,ks(ze)&&(Vn=!!ze.leading,Zn="maxWait"in ze,Ai=Zn?xf(Rx(ze.maxWait)||0,Ae):Ai,Wo="trailing"in ze?!!ze.trailing:Wo);function Ha(zc){var Dh=lt,pE=Qt;return lt=Qt=o,vn=zc,Ki=ge.apply(pE,Dh),Ki}function Vs(zc){return vn=zc,gr=fI(Ea,Ae),Vn?Ha(zc):Ki}function au(zc){var Dh=zc-Er,pE=zc-vn,TI=Ae-Dh;return Zn?Wf(TI,Ai-pE):TI}function oa(zc){var Dh=zc-Er,pE=zc-vn;return Er===o||Dh>=Ae||Dh<0||Zn&&pE>=Ai}function Ea(){var zc=r1();if(oa(zc))return vl(zc);gr=fI(Ea,au(zc))}function vl(zc){return gr=o,Wo&<?Ha(zc):(lt=Qt=o,Ki)}function lv(){gr!==o&&mS(gr),vn=0,lt=Er=Qt=gr=o}function Qd(){return gr===o?Ki:vl(r1())}function Kp(){var zc=r1(),Dh=oa(zc);if(lt=arguments,Qt=this,Er=zc,Dh){if(gr===o)return Vs(Er);if(Zn)return mS(gr),gr=fI(Ea,Ae),Ha(Er)}return gr===o&&(gr=fI(Ea,Ae)),Ki}return Kp.cancel=lv,Kp.flush=Qd,Kp}var tv=gl(function(ge,Ae){return dL(ge,1,Ae)}),zG=gl(function(ge,Ae,ze){return dL(ge,Rx(Ae)||0,ze)});function Td(ge){return bf(ge,j)}function fh(ge,Ae){if(typeof ge!="function"||Ae!=null&&typeof Ae!="function")throw new l0(y);var ze=function(){var lt=arguments,Qt=Ae?Ae.apply(this,lt):lt[0],Ai=ze.cache;if(Ai.has(Qt))return Ai.get(Qt);var Ki=ge.apply(this,lt);return ze.cache=Ai.set(Qt,Ki)||Ai,Ki};return ze.cache=new(fh.Cache||jf),ze}fh.Cache=jf;function PS(ge){if(typeof ge!="function")throw new l0(y);return function(){var Ae=arguments;switch(Ae.length){case 0:return!ge.call(this);case 1:return!ge.call(this,Ae[0]);case 2:return!ge.call(this,Ae[0],Ae[1]);case 3:return!ge.call(this,Ae[0],Ae[1],Ae[2])}return!ge.apply(this,Ae)}}function g0(ge){return cK(2,ge)}var nE=Hp(function(ge,Ae){Ae=Ae.length==1&&Ro(Ae[0])?Os(Ae[0],Uf(Is())):Os(ys(Ae,1),Uf(Is()));var ze=Ae.length;return gl(function(lt){for(var Qt=-1,Ai=Wf(lt.length,ze);++Qt=Ae}),oE=tI(function(){return arguments}())?tI:function(ge){return ws(ge)&&vc.call(ge,"callee")&&!gk.call(ge,"callee")},Ro=dr.isArray,_K=Pn?Uf(Pn):Sk;function rv(ge){return ge!=null&&fp(ge.length)&&!Wm(ge)}function Kd(ge){return ws(ge)&&rv(ge)}function Mx(ge){return ge===!0||ge===!1||ws(ge)&&Sg(ge)==he}var Dg=yG||dE,GG=An?Uf(An):Pk;function vK(ge){return ws(ge)&&ge.nodeType===1&&!wf(ge)}function ao(ge){if(ge==null)return!0;if(rv(ge)&&(Ro(ge)||typeof ge=="string"||typeof ge.splice=="function"||Dg(ge)||Ym(ge)||oE(ge)))return!ge.length;var Ae=Yf(ge);if(Ae==Xe||Ae==Ot)return!ge.size;if(ZC(ge))return!xN(ge).length;for(var ze in ge)if(vc.call(ge,ze))return!1;return!0}function aV(ge,Ae){return YA(ge,Ae)}function sV(ge,Ae,ze){ze=typeof ze=="function"?ze:o;var lt=ze?ze(ge,Ae):o;return lt===o?YA(ge,Ae,o,ze):!!lt}function nv(ge){if(!ws(ge))return!1;var Ae=Sg(ge);return Ae==De||Ae==Se||typeof ge.message=="string"&&typeof ge.name=="string"&&!wf(ge)}function Dx(ge){return typeof ge=="number"&&lS(ge)}function Wm(ge){if(!ks(ge))return!1;var Ae=Sg(ge);return Ae==Oe||Ae==Ue||Ae==ce||Ae==Qe}function KN(ge){return typeof ge=="number"&&ge==qa(ge)}function fp(ge){return typeof ge=="number"&&ge>-1&&ge%1==0&&ge<=re}function ks(ge){var Ae=typeof ge;return ge!=null&&(Ae=="object"||Ae=="function")}function ws(ge){return ge!=null&&typeof ge=="object"}var Id=Wr?Uf(Wr):Mk;function pce(ge,Ae){return ge===Ae||fS(ge,Ae,ML(Ae))}function mce(ge,Ae,ze){return ze=typeof ze=="function"?ze:o,fS(ge,Ae,ML(Ae),ze)}function n_(ge){return BL(ge)&&ge!=+ge}function lV(ge){if(Um(ge))throw new go(v);return vN(ge)}function Lx(ge){return ge===null}function Dc(ge){return ge==null}function BL(ge){return typeof ge=="number"||ws(ge)&&Sg(ge)==it}function wf(ge){if(!ws(ge)||Sg(ge)!=at)return!1;var Ae=KP(ge);if(Ae===null)return!0;var ze=vc.call(Ae,"constructor")&&Ae.constructor;return typeof ze=="function"&&ze instanceof ze&&Ib.call(ze)==hN}var QN=Ho?Uf(Ho):EG;function kL(ge){return KN(ge)&&ge>=-re&&ge<=re}var Ih=ma?Uf(ma):Dk;function ym(ge){return typeof ge=="string"||!Ro(ge)&&ws(ge)&&Sg(ge)==Xt}function jm(ge){return typeof ge=="symbol"||ws(ge)&&Sg(ge)==At}var Ym=Zo?Uf(Zo):Lk;function Wb(ge){return ge===o}function aE(ge){return ws(ge)&&Yf(ge)==gt}function vI(ge){return ws(ge)&&Sg(ge)==It}var Af=sI(iI),yK=sI(function(ge,Ae){return ge<=Ae});function ov(ge){if(!ge)return[];if(rv(ge))return ym(ge)?_e(ge):qd(ge);if(Mb&&ge[Mb])return iS(ge[Mb]());var Ae=Yf(ge),ze=Ae==Xe?py:Ae==Ot?BA:jp;return ze(ge)}function Vc(ge){if(!ge)return ge===0?ge:0;if(ge=Rx(ge),ge===ie||ge===-ie){var Ae=ge<0?-1:1;return Ae*ne}return ge===ge?ge:0}function qa(ge){var Ae=Vc(ge),ze=Ae%1;return Ae===Ae?ze?Ae-ze:Ae:0}function ZN(ge){return ge?bx(qa(ge),0,se):0}function Rx(ge){if(typeof ge=="number")return ge;if(jm(ge))return oe;if(ks(ge)){var Ae=typeof ge.valueOf=="function"?ge.valueOf():ge;ge=ks(Ae)?Ae+"":Ae}if(typeof ge!="string")return ge===0?ge:+ge;ge=$T(ge);var ze=ir.test(ge);return ze||xr.test(ge)?Xi(ge.slice(2),ze?2:8):ti.test(ge)?oe:+ge}function yI(ge){return wu(ge,Gp(ge))}function xK(ge){return ge?bx(qa(ge),-re,re):ge===0?ge:0}function Xc(ge){return ge==null?"":Hm(ge)}var Lg=Vb(function(ge,Ae){if(ZC(Ae)||rv(Ae)){wu(Ae,hs(Ae),ge);return}for(var ze in Ae)vc.call(Ae,ze)&&pl(ge,ze,Ae[ze])}),jb=Vb(function(ge,Ae){wu(Ae,Gp(Ae),ge)}),pp=Vb(function(ge,Ae,ze,lt){wu(Ae,Gp(Ae),ge,lt)}),xI=Vb(function(ge,Ae,ze,lt){wu(Ae,hs(Ae),ge,lt)}),s1=XC(GA);function $N(ge,Ae){var ze=my(ge);return Ae==null?ze:Ol(ze,Ae)}var Md=gl(function(ge,Ae){ge=nc(ge);var ze=-1,lt=Ae.length,Qt=lt>2?Ae[2]:o;for(Qt&&gm(Ae[0],Ae[1],Qt)&&(lt=1);++ze1),Ai}),wu(ge,SL(ge),ze),lt&&(ze=c0(ze,E|T|S,Mc));for(var Qt=Ae.length;Qt--;)pS(ze,Ae[Qt]);return ze});function DS(ge,Ae){return a_(ge,PS(Is(Ae)))}var Vu=XC(function(ge,Ae){return ge==null?{}:gL(ge,Ae)});function a_(ge,Ae){if(ge==null)return{};var ze=Os(SL(ge),function(lt){return[lt]});return Ae=Is(Ae),wN(ge,ze,function(lt,Qt){return Ae(lt,Qt[0])})}function VL(ge,Ae,ze){Ae=q_(Ae,ge);var lt=-1,Qt=Ae.length;for(Qt||(Qt=1,ge=o);++ltAe){var lt=ge;ge=Ae,Ae=lt}if(ze||ge%1||Ae%1){var Qt=Db();return Wf(ge+Qt*(Ae-ge+gf("1e-"+((Qt+"").length-1))),Ae)}return EN(ge,Ae)}var Yp=X_(function(ge,Ae,ze){return Ae=Ae.toLowerCase(),ge+(ze?jG(Ae):Ae)});function jG(ge){return d1(Xc(ge).toLowerCase())}function nF(ge){return ge=Xc(ge),ge&&ge.replace(Ii,ah).replace(mf,"")}function qm(ge,Ae,ze){ge=Xc(ge),Ae=Hm(Ae);var lt=ge.length;ze=ze===o?lt:bx(qa(ze),0,lt);var Qt=ze;return ze-=Ae.length,ze>=0&&ge.slice(ze,Qt)==Ae}function lE(ge){return ge=Xc(ge),ge&&Ui.test(ge)?ge.replace(wr,G_):ge}function Fx(ge){return ge=Xc(ge),ge&&_t.test(ge)?ge.replace(si,"\\$&"):ge}var SK=X_(function(ge,Ae,ze){return ge+(ze?"-":"")+Ae.toLowerCase()}),Og=X_(function(ge,Ae,ze){return ge+(ze?" ":"")+Ae.toLowerCase()}),PK=Wk("toLowerCase");function oF(ge,Ae,ze){ge=Xc(ge),Ae=qa(Ae);var lt=Ae?Ve(ge):0;if(!Ae||lt>=Ae)return ge;var Qt=(Ae-lt)/2;return aI(aS(Qt),ze)+ge+aI(oS(Qt),ze)}function zL(ge,Ae,ze){ge=Xc(ge),Ae=qa(Ae);var lt=Ae?Ve(ge):0;return Ae&<>>0,ze?(ge=Xc(ge),ge&&(typeof Ae=="string"||Ae!=null&&!QN(Ae))&&(Ae=Hm(Ae),!Ae&&fy(ge))?qc(_e(ge),0,ze):ge.split(Ae,ze)):[]}var Xm=X_(function(ge,Ae,ze){return ge+(ze?" ":"")+d1(Ae)});function h1(ge,Ae,ze){return ge=Xc(ge),ze=ze==null?0:bx(qa(ze),0,ge.length),Ae=Hm(Ae),ge.slice(ze,ze+Ae.length)==Ae}function OS(ge,Ae,ze){var lt=vi.templateSettings;ze&&gm(ge,Ae,ze)&&(Ae=o),ge=Xc(ge),Ae=pp({},Ae,lt,TL);var Qt=pp({},Ae.imports,lt.imports,TL),Ai=hs(Qt),Ki=mx(Qt,Ai),gr,Er,vn=0,Vn=Ae.interpolate||pr,Zn="__p += '",Wo=zm((Ae.escape||pr).source+"|"+Vn.source+"|"+(Vn===jt?Tt:pr).source+"|"+(Ae.evaluate||pr).source+"|$","g"),Ha="//# sourceURL="+(vc.call(Ae,"sourceURL")?(Ae.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Wn+"]")+` `;ge.replace(Wo,function(oa,Ea,vl,lv,Qd,Kp){return vl||(vl=lv),Zn+=ge.slice(vn,Kp).replace(yn,_x),Ea&&(gr=!0,Zn+=`' + __e(`+Ea+`) + '`),Qd&&(Er=!0,Zn+=`'; `+Qd+`; __p += '`),vl&&(Zn+=`' + ((__t = (`+vl+`)) == null ? '' : __t) + '`),vn=Kp+oa.length,oa}),Zn+=`'; `;var Vs=vc.call(Ae,"variable")&&Ae.variable;if(!Vs)Zn=`with (obj) { `+Zn+` } `;else if(wt.test(Vs))throw new go(x);Zn=(Er?Zn.replace(ji,""):Zn).replace(hi,"$1").replace(Ri,"$1;"),Zn="function("+(Vs||"obj")+`) { `+(Vs?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(gr?", __e = _.escape":"")+(Er?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Zn+`return __p }`;var au=mp(function(){return Uo(Ai,Ha+"return "+Zn).apply(o,Ki)});if(au.source=Zn,nv(au))throw au;return au}function YG(ge){return Xc(ge).toLowerCase()}function bI(ge){return Xc(ge).toUpperCase()}function uE(ge,Ae,ze){if(ge=Xc(ge),ge&&(ze||Ae===o))return $T(ge);if(!ge||!(Ae=Hm(Ae)))return ge;var lt=_e(ge),Qt=_e(Ae),Ai=Gf(lt,Qt),Ki=Vm(lt,Qt)+1;return qc(lt,Ai,Ki).join("")}function Xb(ge,Ae,ze){if(ge=Xc(ge),ge&&(ze||Ae===o))return ge.slice(0,Me(ge)+1);if(!ge||!(Ae=Hm(Ae)))return ge;var lt=_e(ge),Qt=Vm(lt,_e(Ae))+1;return qc(lt,0,Qt).join("")}function Xp(ge,Ae,ze){if(ge=Xc(ge),ge&&(ze||Ae===o))return ge.replace(Yt,"");if(!ge||!(Ae=Hm(Ae)))return ge;var lt=_e(ge),Qt=Gf(lt,_e(Ae));return qc(lt,Qt).join("")}function Py(ge,Ae){var ze=q,lt=J;if(ks(Ae)){var Qt="separator"in Ae?Ae.separator:Qt;ze="length"in Ae?qa(Ae.length):ze,lt="omission"in Ae?Hm(Ae.omission):lt}ge=Xc(ge);var Ai=ge.length;if(fy(ge)){var Ki=_e(ge);Ai=Ki.length}if(ze>=Ai)return ge;var gr=ze-Ve(lt);if(gr<1)return lt;var Er=Ki?qc(Ki,0,gr).join(""):ge.slice(0,gr);if(Qt===o)return Er+lt;if(Ki&&(gr+=Er.length-gr),QN(Qt)){if(ge.slice(gr).search(Qt)){var vn,Vn=Er;for(Qt.global||(Qt=zm(Qt.source,Xc(Et.exec(Qt))+"g")),Qt.lastIndex=0;vn=Qt.exec(Vn);)var Zn=vn.index;Er=Er.slice(0,Zn===o?gr:Zn)}}else if(ge.indexOf(Hm(Qt),gr)!=gr){var Wo=Er.lastIndexOf(Qt);Wo>-1&&(Er=Er.slice(0,Wo))}return Er+lt}function Jm(ge){return ge=Xc(ge),ge&&zi.test(ge)?ge.replace(pt,Ge):ge}var DK=X_(function(ge,Ae,ze){return ge+(ze?" ":"")+Ae.toUpperCase()}),d1=Wk("toUpperCase");function NS(ge,Ae,ze){return ge=Xc(ge),Ae=ze?o:Ae,Ae===o?tS(ge)?Ti(ge):cp(ge):ge.match(Ae)||[]}var mp=gl(function(ge,Ae){try{return $o(ge,o,Ae)}catch(ze){return nv(ze)?ze:new go(ze)}}),xm=XC(function(ge,Ae){return rs(Ae,function(ze){ze=Cy(ze),gy(ge,ze,VG(ge[ze],ge))}),ge});function Bx(ge){var Ae=ge==null?0:ge.length,ze=Is();return ge=Ae?Os(ge,function(lt){if(typeof lt[1]!="function")throw new l0(y);return[ze(lt[0]),lt[1]]}):[],gl(function(lt){for(var Qt=-1;++Qtre)return[];var ze=se,lt=Wf(ge,se);Ae=Is(Ae),ge-=se;for(var Qt=jd(lt,Ae);++ze0||Ae<0)?new pu(ze):(ge<0?ze=ze.takeRight(-ge):ge&&(ze=ze.drop(ge)),Ae!==o&&(Ae=qa(Ae),ze=Ae<0?ze.dropRight(-Ae):ze.take(Ae-ge)),ze)},pu.prototype.takeRightWhile=function(ge){return this.reverse().takeWhile(ge).reverse()},pu.prototype.toArray=function(){return this.take(se)},ri(pu.prototype,function(ge,Ae){var ze=/^(?:filter|find|map|reject)|While$/.test(Ae),lt=/^(?:head|last)$/.test(Ae),Qt=vi[lt?"take"+(Ae=="last"?"Right":""):Ae],Ai=lt||/^find/.test(Ae);!Qt||(vi.prototype[Ae]=function(){var Ki=this.__wrapped__,gr=lt?[1]:arguments,Er=Ki instanceof pu,vn=gr[0],Vn=Er||Ro(Ki),Zn=function(Ea){var vl=Qt.apply(vi,Ns([Ea],gr));return lt&&Wo?vl[0]:vl};Vn&&ze&&typeof vn=="function"&&vn.length!=1&&(Er=Vn=!1);var Wo=this.__chain__,Ha=!!this.__actions__.length,Vs=Ai&&!Wo,au=Er&&!Ha;if(!Ai&&Vn){Ki=au?Ki:new pu(this);var oa=ge.apply(Ki,gr);return oa.__actions__.push({func:t1,args:[Zn],thisArg:o}),new u0(oa,Wo)}return Vs&&au?ge.apply(this,gr):(oa=this.thru(Zn),Vs?lt?oa.value()[0]:oa.value():oa)})}),rs(["pop","push","shift","sort","splice","unshift"],function(ge){var Ae=wg[ge],ze=/^(?:push|sort|unshift)$/.test(ge)?"tap":"thru",lt=/^(?:pop|shift)$/.test(ge);vi.prototype[ge]=function(){var Qt=arguments;if(lt&&!this.__chain__){var Ai=this.value();return Ae.apply(Ro(Ai)?Ai:[],Qt)}return this[ze](function(Ki){return Ae.apply(Ro(Ki)?Ki:[],Qt)})}}),ri(pu.prototype,function(ge,Ae){var ze=vi[Ae];if(ze){var lt=ze.name+"";vc.call(Ob,lt)||(Ob[lt]=[]),Ob[lt].push({name:Ae,func:ze})}}),Ob[XA(o,D).name]=[{name:"wrapper",func:o}],pu.prototype.clone=Nb,pu.prototype.reverse=Ck,pu.prototype.value=dS,vi.prototype.at=Ed,vi.prototype.chain=jN,vi.prototype.commit=SS,vi.prototype.next=me,vi.prototype.plant=Be,vi.prototype.reverse=ht,vi.prototype.toJSON=vi.prototype.valueOf=vi.prototype.value=Kt,vi.prototype.first=vi.prototype.head,Mb&&(vi.prototype[Mb]=we),vi},Hi=Vi();typeof define=="function"&&typeof define.amd=="object"&&define.amd?(He._=Hi,define(function(){return Hi})):Vt?((Vt.exports=Hi)._=Hi,dt._=Hi):He._=Hi}).call(uG)});var smt=r9((exports,module)=>{/* @preserve * The MIT License (MIT) * * Copyright (c) 2013-2018 Petka Antonov * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * */(function(o){if(typeof exports=="object"&&typeof module<"u")module.exports=o();else if(typeof define=="function"&&define.amd)define([],o);else{var f;typeof window<"u"?f=window:typeof global<"u"?f=global:typeof self<"u"&&(f=self),f.Promise=o()}})(function(){var define,module,exports;return function o(f,m,v){function y(w,A){if(!m[w]){if(!f[w]){var E=typeof _dereq_=="function"&&_dereq_;if(!A&&E)return E(w,!0);if(x)return x(w,!0);var T=new Error("Cannot find module '"+w+"'");throw T.code="MODULE_NOT_FOUND",T}var S=m[w]={exports:{}};f[w][0].call(S.exports,function(M){var I=f[w][1][M];return y(I||M)},S,S.exports,o,f,m,v)}return m[w].exports}for(var x=typeof _dereq_=="function"&&_dereq_,C=0;C0;)S(M)}function S(M){var I=M.shift();if(typeof I!="function")I._settlePromises();else{var P=M.shift(),D=M.shift();I.call(P,D)}}C.prototype._drainQueues=function(){T(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,T(this._lateQueue)},C.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},C.prototype._reset=function(){this._isTickUsed=!1},f.exports=C,f.exports.firstLineError=v},{"./queue":26,"./schedule":29}],3:[function(o,f,m){"use strict";f.exports=function(v,y,x,C){var w=!1,A=function(M,I){this._reject(I)},E=function(M,I){I.promiseRejectionQueued=!0,I.bindingPromise._then(A,A,null,this,M)},T=function(M,I){(this._bitField&50397184)===0&&this._resolveCallback(I.target)},S=function(M,I){I.promiseRejectionQueued||this._reject(M)};v.prototype.bind=function(M){w||(w=!0,v.prototype._propagateFrom=C.propagateFromFunction(),v.prototype._boundValue=C.boundValueFunction());var I=x(M),P=new v(y);P._propagateFrom(this,1);var D=this._target();if(P._setBoundTo(I),I instanceof v){var L={promiseRejectionQueued:!1,promise:P,target:D,bindingPromise:I};D._then(y,E,void 0,P,L),I._then(T,S,void 0,P,L),P._setOnCancel(I)}else P._resolveCallback(D);return P},v.prototype._setBoundTo=function(M){M!==void 0?(this._bitField=this._bitField|2097152,this._boundTo=M):this._bitField=this._bitField&-2097153},v.prototype._isBound=function(){return(this._bitField&2097152)===2097152},v.bind=function(M,I){return v.resolve(I).bind(M)}}},{}],4:[function(o,f,m){"use strict";var v;typeof Promise<"u"&&(v=Promise);function y(){try{Promise===x&&(Promise=v)}catch{}return x}var x=o("./promise")();x.noConflict=y,f.exports=x},{"./promise":22}],5:[function(o,f,m){"use strict";var v=Object.create;if(v){var y=v(null),x=v(null);y[" size"]=x[" size"]=0}f.exports=function(C){var w=o("./util"),A=w.canEvaluate,E=w.isIdentifier,T,S;if(!1)var M,I,P;function D(F,k){var U;if(F!=null&&(U=F[k]),typeof U!="function"){var G="Object "+w.classString(F)+" has no method '"+w.toString(k)+"'";throw new C.TypeError(G)}return U}function L(F){var k=this.pop(),U=D(F,k);return U.apply(F,this)}C.prototype.call=function(F){var k=[].slice.call(arguments,1);if(!1&&A)var U;return k.push(F),this._then(L,void 0,void 0,k,void 0)};function R(F){return F[this]}function O(F){var k=+this;return k<0&&(k=Math.max(0,k+F.length)),F[k]}C.prototype.get=function(F){var k=typeof F=="number",U;if(k)U=O;else if(A){var G=S(F);U=G!==null?G:R}else U=R;return this._then(U,void 0,void 0,F,void 0)}}},{"./util":36}],6:[function(o,f,m){"use strict";f.exports=function(v,y,x,C){var w=o("./util"),A=w.tryCatch,E=w.errorObj,T=v._async;v.prototype.break=v.prototype.cancel=function(){if(!C.cancellation())return this._warn("cancellation is disabled");for(var S=this,M=S;S._isCancellable();){if(!S._cancelBy(M)){M._isFollowing()?M._followee().cancel():M._cancelBranched();break}var I=S._cancellationParent;if(I==null||!I._isCancellable()){S._isFollowing()?S._followee().cancel():S._cancelBranched();break}else S._isFollowing()&&S._followee().cancel(),S._setWillBeCancelled(),M=S,S=I}},v.prototype._branchHasCancelled=function(){this._branchesRemainingToCancel--},v.prototype._enoughBranchesHaveCancelled=function(){return this._branchesRemainingToCancel===void 0||this._branchesRemainingToCancel<=0},v.prototype._cancelBy=function(S){return S===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),this._enoughBranchesHaveCancelled()?(this._invokeOnCancel(),!0):!1)},v.prototype._cancelBranched=function(){this._enoughBranchesHaveCancelled()&&this._cancel()},v.prototype._cancel=function(){!this._isCancellable()||(this._setCancelled(),T.invoke(this._cancelPromises,this,void 0))},v.prototype._cancelPromises=function(){this._length()>0&&this._settlePromises()},v.prototype._unsetOnCancel=function(){this._onCancelField=void 0},v.prototype._isCancellable=function(){return this.isPending()&&!this._isCancelled()},v.prototype.isCancellable=function(){return this.isPending()&&!this.isCancelled()},v.prototype._doInvokeOnCancel=function(S,M){if(w.isArray(S))for(var I=0;I=0)return x[E]}return C.CapturedTrace=null,C.create=w,C.deactivateLongStackTraces=function(){},C.activateLongStackTraces=function(){var E=v.prototype._pushContext,T=v.prototype._popContext,S=v._peekContext,M=v.prototype._peekContext,I=v.prototype._promiseCreated;C.deactivateLongStackTraces=function(){v.prototype._pushContext=E,v.prototype._popContext=T,v._peekContext=S,v.prototype._peekContext=M,v.prototype._promiseCreated=I,y=!1},y=!0,v.prototype._pushContext=C.prototype._pushContext,v.prototype._popContext=C.prototype._popContext,v._peekContext=v.prototype._peekContext=A,v.prototype._promiseCreated=function(){var P=this._peekContext();P&&P._promiseCreated==null&&(P._promiseCreated=this)}},C}},{}],9:[function(o,f,m){"use strict";f.exports=function(v,y,x,C){var w=v._async,A=o("./errors").Warning,E=o("./util"),T=o("./es5"),S=E.canAttachTrace,M,I,P=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,D=/\((?:timers\.js):\d+:\d+\)/,L=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,R=null,O=null,F=!1,k,U=E.env("BLUEBIRD_DEBUG")!=0,G=!!(E.env("BLUEBIRD_WARNINGS")!=0&&(U||E.env("BLUEBIRD_WARNINGS"))),j=!!(E.env("BLUEBIRD_LONG_STACK_TRACES")!=0&&(U||E.env("BLUEBIRD_LONG_STACK_TRACES"))),q=E.env("BLUEBIRD_W_FORGOTTEN_RETURN")!=0&&(G||!!E.env("BLUEBIRD_W_FORGOTTEN_RETURN")),J;(function(){var Je=[];function Nt(){for(var ai=0;ai0},v.prototype._setRejectionIsUnhandled=function(){this._bitField=this._bitField|1048576},v.prototype._unsetRejectionIsUnhandled=function(){this._bitField=this._bitField&-1048577,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},v.prototype._isRejectionUnhandled=function(){return(this._bitField&1048576)>0},v.prototype._warn=function(Je,Nt,yi){return Xe(Je,Nt,yi||this)},v.onPossiblyUnhandledRejection=function(Je){var Nt=v._getContext();I=E.contextBind(Nt,Je)},v.onUnhandledRejectionHandled=function(Je){var Nt=v._getContext();M=E.contextBind(Nt,Je)};var X=function(){};v.longStackTraces=function(){if(w.haveItemsQueued()&&!Li.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created See http://goo.gl/MqrFmX `);if(!Li.longStackTraces&>()){var Je=v.prototype._captureStackTrace,Nt=v.prototype._attachExtraTrace,yi=v.prototype._dereferenceTrace;Li.longStackTraces=!0,X=function(){if(w.haveItemsQueued()&&!Li.longStackTraces)throw new Error(`cannot enable long stack traces after promises have been created See http://goo.gl/MqrFmX `);v.prototype._captureStackTrace=Je,v.prototype._attachExtraTrace=Nt,v.prototype._dereferenceTrace=yi,y.deactivateLongStackTraces(),Li.longStackTraces=!1},v.prototype._captureStackTrace=Ce,v.prototype._attachExtraTrace=Se,v.prototype._dereferenceTrace=De,y.activateLongStackTraces()}},v.hasLongStackTraces=function(){return Li.longStackTraces&>()};var Y={unhandledrejection:{before:function(){var Je=E.global.onunhandledrejection;return E.global.onunhandledrejection=null,Je},after:function(Je){E.global.onunhandledrejection=Je}},rejectionhandled:{before:function(){var Je=E.global.onrejectionhandled;return E.global.onrejectionhandled=null,Je},after:function(Je){E.global.onrejectionhandled=Je}}},Q=function(){var Je=function(yi,ai){if(yi){var wi;try{return wi=yi.before(),!E.global.dispatchEvent(ai)}finally{yi.after(wi)}}else return!E.global.dispatchEvent(ai)};try{if(typeof CustomEvent=="function"){var Nt=new CustomEvent("CustomEvent");return E.global.dispatchEvent(Nt),function(yi,ai){yi=yi.toLowerCase();var wi={detail:ai,cancelable:!0},ji=new CustomEvent(yi,wi);return T.defineProperty(ji,"promise",{value:ai.promise}),T.defineProperty(ji,"reason",{value:ai.reason}),Je(Y[yi],ji)}}else if(typeof Event=="function"){var Nt=new Event("CustomEvent");return E.global.dispatchEvent(Nt),function(ai,wi){ai=ai.toLowerCase();var ji=new Event(ai,{cancelable:!0});return ji.detail=wi,T.defineProperty(ji,"promise",{value:wi.promise}),T.defineProperty(ji,"reason",{value:wi.reason}),Je(Y[ai],ji)}}else{var Nt=document.createEvent("CustomEvent");return Nt.initCustomEvent("testingtheevent",!1,!0,{}),E.global.dispatchEvent(Nt),function(ai,wi){ai=ai.toLowerCase();var ji=document.createEvent("CustomEvent");return ji.initCustomEvent(ai,!1,!0,wi),Je(Y[ai],ji)}}}catch{}return function(){return!1}}(),ee=function(){return E.isNode?function(){return process.emit.apply(process,arguments)}:E.global?function(Je){var Nt="on"+Je.toLowerCase(),yi=E.global[Nt];return yi?(yi.apply(E.global,[].slice.call(arguments,1)),!0):!1}:function(){return!1}}();function z(Je,Nt){return{promise:Nt}}var ie={promiseCreated:z,promiseFulfilled:z,promiseRejected:z,promiseResolved:z,promiseCancelled:z,promiseChained:function(Je,Nt,yi){return{promise:Nt,child:yi}},warning:function(Je,Nt){return{warning:Nt}},unhandledRejection:function(Je,Nt,yi){return{reason:Nt,promise:yi}},rejectionHandled:z},re=function(Je){var Nt=!1;try{Nt=ee.apply(null,arguments)}catch(ai){w.throwLater(ai),Nt=!0}var yi=!1;try{yi=Q(Je,ie[Je].apply(null,arguments))}catch(ai){w.throwLater(ai),yi=!0}return yi||Nt};v.config=function(Je){if(Je=Object(Je),"longStackTraces"in Je&&(Je.longStackTraces?v.longStackTraces():!Je.longStackTraces&&v.hasLongStackTraces()&&X()),"warnings"in Je){var Nt=Je.warnings;Li.warnings=!!Nt,q=Li.warnings,E.isObject(Nt)&&"wForgottenReturn"in Nt&&(q=!!Nt.wForgottenReturn)}if("cancellation"in Je&&Je.cancellation&&!Li.cancellation){if(w.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use");v.prototype._clearCancellationData=de,v.prototype._propagateFrom=ve,v.prototype._onCancel=ae,v.prototype._setOnCancel=fe,v.prototype._attachCancellationCallback=se,v.prototype._execute=oe,ce=ve,Li.cancellation=!0}if("monitoring"in Je&&(Je.monitoring&&!Li.monitoring?(Li.monitoring=!0,v.prototype._fireEvent=re):!Je.monitoring&&Li.monitoring&&(Li.monitoring=!1,v.prototype._fireEvent=ne)),"asyncHooks"in Je&&E.nodeSupportsAsyncResource){var yi=Li.asyncHooks,ai=!!Je.asyncHooks;yi!==ai&&(Li.asyncHooks=ai,ai?x():C())}return v};function ne(){return!1}v.prototype._fireEvent=ne,v.prototype._execute=function(Je,Nt,yi){try{Je(Nt,yi)}catch(ai){return ai}},v.prototype._onCancel=function(){},v.prototype._setOnCancel=function(Je){},v.prototype._attachCancellationCallback=function(Je){},v.prototype._captureStackTrace=function(){},v.prototype._attachExtraTrace=function(){},v.prototype._dereferenceTrace=function(){},v.prototype._clearCancellationData=function(){},v.prototype._propagateFrom=function(Je,Nt){};function oe(Je,Nt,yi){var ai=this;try{Je(Nt,yi,function(wi){if(typeof wi!="function")throw new TypeError("onCancel must be a function, got: "+E.toString(wi));ai._attachCancellationCallback(wi)})}catch(wi){return wi}}function se(Je){if(!this._isCancellable())return this;var Nt=this._onCancel();Nt!==void 0?E.isArray(Nt)?Nt.push(Je):this._setOnCancel([Nt,Je]):this._setOnCancel(Je)}function ae(){return this._onCancelField}function fe(Je){this._onCancelField=Je}function de(){this._cancellationParent=void 0,this._onCancelField=void 0}function ve(Je,Nt){if((Nt&1)!==0){this._cancellationParent=Je;var yi=Je._branchesRemainingToCancel;yi===void 0&&(yi=0),Je._branchesRemainingToCancel=yi+1}(Nt&2)!==0&&Je._isBound()&&this._setBoundTo(Je._boundTo)}function pe(Je,Nt){(Nt&2)!==0&&Je._isBound()&&this._setBoundTo(Je._boundTo)}var ce=pe;function he(){var Je=this._boundTo;return Je!==void 0&&Je instanceof v?Je.isFulfilled()?Je.value():void 0:Je}function Ce(){this._trace=new ii(this._peekContext())}function Se(Je,Nt){if(S(Je)){var yi=this._trace;if(yi!==void 0&&Nt&&(yi=yi._parent),yi!==void 0)yi.attachExtraTrace(Je);else if(!Je.__stackCleaned__){var ai=ft(Je);E.notEnumerableProp(Je,"stack",ai.message+` `+ai.stack.join(` `)),E.notEnumerableProp(Je,"__stackCleaned__",!0)}}}function De(){this._trace=void 0}function Oe(Je,Nt,yi,ai,wi){if(Je===void 0&&Nt!==null&&q){if(wi!==void 0&&wi._returnedNonUndefined()||(ai._bitField&65535)===0)return;yi&&(yi=yi+" ");var ji="",hi="";if(Nt._trace){for(var Ri=Nt._trace.stack.split(` `),pt=Pt(Ri),wr=pt.length-1;wr>=0;--wr){var zi=pt[wr];if(!D.test(zi)){var Ui=zi.match(L);Ui&&(ji="at "+Ui[1]+":"+Ui[2]+":"+Ui[3]+" ");break}}if(pt.length>0){for(var Gt=pt[0],wr=0;wr0&&(hi=` `+Ri[wr-1]);break}}}var $t="a promise was created in a "+yi+"handler "+ji+"but was not returned from it, see http://goo.gl/rRqMUw"+hi;ai._warn($t,!0,Nt)}}function Ue(Je,Nt){var yi=Je+" is deprecated and will be removed in a future version.";return Nt&&(yi+=" Use "+Nt+" instead."),Xe(yi)}function Xe(Je,Nt,yi){if(!!Li.warnings){var ai=new A(Je),wi;if(Nt)yi._attachExtraTrace(ai);else if(Li.longStackTraces&&(wi=v._peekContext()))wi.attachExtraTrace(ai);else{var ji=ft(ai);ai.stack=ji.message+` `+ji.stack.join(` `)}re("warning",ai)||Ot(ai,"",!0)}}function it(Je,Nt){for(var yi=0;yi=0;--Ri)if(ai[Ri]===ji){hi=Ri;break}for(var Ri=hi;Ri>=0;--Ri){var pt=ai[Ri];if(Nt[wi]===pt)Nt.pop(),wi--;else break}Nt=ai}}function Pt(Je){for(var Nt=[],yi=0;yi0&&Je.name!="SyntaxError"&&(Nt=Nt.slice(yi)),Nt}function ft(Je){var Nt=Je.stack,yi=Je.toString();return Nt=typeof Nt=="string"&&Nt.length>0?Qe(Je):[" (No stack trace)"],{message:yi,stack:Je.name=="SyntaxError"?Nt:Pt(Nt)}}function Ot(Je,Nt,yi){if(typeof console<"u"){var ai;if(E.isObject(Je)){var wi=Je.stack;ai=Nt+O(wi,Je)}else ai=Nt+String(Je);typeof k=="function"?k(ai,yi):(typeof console.log=="function"||typeof console.log=="object")&&console.log(ai)}}function Xt(Je,Nt,yi,ai){var wi=!1;try{typeof Nt=="function"&&(wi=!0,Je==="rejectionHandled"?Nt(ai):Nt(yi,ai))}catch(ji){w.throwLater(ji)}Je==="unhandledRejection"?!re(Je,yi,ai)&&!wi&&Ot(yi,"Unhandled rejection "):re(Je,ai)}function At(Je){var Nt;if(typeof Je=="function")Nt="[function "+(Je.name||"anonymous")+"]";else{Nt=Je&&typeof Je.toString=="function"?Je.toString():E.toString(Je);var yi=/\[object [a-zA-Z0-9$_]+\]/;if(yi.test(Nt))try{var ai=JSON.stringify(Je);Nt=ai}catch{}Nt.length===0&&(Nt="(empty array)")}return"(<"+bt(Nt)+">, no stack trace)"}function bt(Je){var Nt=41;return Je.length=ji||(It=function(zi){if(P.test(zi))return!0;var Ui=bi(zi);return!!(Ui&&Ui.fileName===hi&&wi<=Ui.line&&Ui.line<=ji)})}}function ii(Je){this._parent=Je,this._promisesCreated=0;var Nt=this._length=1+(Je===void 0?0:Je._length);ei(this,ii),Nt>32&&this.uncycle()}E.inherits(ii,Error),y.CapturedTrace=ii,ii.prototype.uncycle=function(){var Je=this._length;if(!(Je<2)){for(var Nt=[],yi={},ai=0,wi=this;wi!==void 0;++ai)Nt.push(wi),wi=wi._parent;Je=this._length=ai;for(var ai=Je-1;ai>=0;--ai){var ji=Nt[ai].stack;yi[ji]===void 0&&(yi[ji]=ai)}for(var ai=0;ai0&&(Nt[Ri-1]._parent=void 0,Nt[Ri-1]._length=1),Nt[ai]._parent=void 0,Nt[ai]._length=1;var pt=ai>0?Nt[ai-1]:this;Ri=0;--zi)Nt[zi]._length=wr,wr++;return}}}},ii.prototype.attachExtraTrace=function(Je){if(!Je.__stackCleaned__){this.uncycle();for(var Nt=ft(Je),yi=Nt.message,ai=[Nt.stack],wi=this;wi!==void 0;)ai.push(Pt(wi.stack.split(` `))),wi=wi._parent;at(ai),ut(ai),E.notEnumerableProp(Je,"stack",it(yi,ai)),E.notEnumerableProp(Je,"__stackCleaned__",!0)}};var ei=function(){var Nt=/^\s*at\s*/,yi=function(hi,Ri){return typeof hi=="string"?hi:Ri.name!==void 0&&Ri.message!==void 0?Ri.toString():At(Ri)};if(typeof Error.stackTraceLimit=="number"&&typeof Error.captureStackTrace=="function"){Error.stackTraceLimit+=6,R=Nt,O=yi;var ai=Error.captureStackTrace;return It=function(hi){return P.test(hi)},function(hi,Ri){Error.stackTraceLimit+=6,ai(hi,Ri),Error.stackTraceLimit-=6}}var wi=new Error;if(typeof wi.stack=="string"&&wi.stack.split(` `)[0].indexOf("stackDetection@")>=0)return R=/@/,O=yi,F=!0,function(Ri){Ri.stack=new Error().stack};var ji;try{throw new Error}catch(hi){ji="stack"in hi}return!("stack"in wi)&&ji&&typeof Error.stackTraceLimit=="number"?(R=Nt,O=yi,function(Ri){Error.stackTraceLimit+=6;try{throw new Error}catch(pt){Ri.stack=pt.stack}Error.stackTraceLimit-=6}):(O=function(hi,Ri){return typeof hi=="string"?hi:(typeof Ri=="object"||typeof Ri=="function")&&Ri.name!==void 0&&Ri.message!==void 0?Ri.toString():At(Ri)},null)}([]);typeof console<"u"&&typeof console.warn<"u"&&(k=function(Je){console.warn(Je)},E.isNode&&process.stderr.isTTY?k=function(Je,Nt){var yi=Nt?"\x1B[33m":"\x1B[31m";console.warn(yi+Je+`\x1B[0m `)}:!E.isNode&&typeof new Error().stack=="string"&&(k=function(Je,Nt){console.warn("%c"+Je,Nt?"color: darkorange":"color: red")}));var Li={warnings:G,longStackTraces:!1,cancellation:!1,monitoring:!1,asyncHooks:!1};return j&&v.longStackTraces(),{asyncHooks:function(){return Li.asyncHooks},longStackTraces:function(){return Li.longStackTraces},warnings:function(){return Li.warnings},cancellation:function(){return Li.cancellation},monitoring:function(){return Li.monitoring},propagateFromFunction:function(){return ce},boundValueFunction:function(){return he},checkForgottenReturns:Oe,setBounds:Yi,warn:Xe,deprecated:Ue,CapturedTrace:ii,fireDomEvent:Q,fireGlobalEvent:ee}}},{"./errors":12,"./es5":13,"./util":36}],10:[function(o,f,m){"use strict";f.exports=function(v){function y(){return this.value}function x(){throw this.reason}v.prototype.return=v.prototype.thenReturn=function(C){return C instanceof v&&C.suppressUnhandledRejections(),this._then(y,void 0,void 0,{value:C},void 0)},v.prototype.throw=v.prototype.thenThrow=function(C){return this._then(x,void 0,void 0,{reason:C},void 0)},v.prototype.catchThrow=function(C){if(arguments.length<=1)return this._then(void 0,x,void 0,{reason:C},void 0);var w=arguments[1],A=function(){throw w};return this.caught(C,A)},v.prototype.catchReturn=function(C){if(arguments.length<=1)return C instanceof v&&C.suppressUnhandledRejections(),this._then(void 0,y,void 0,{value:C},void 0);var w=arguments[1];w instanceof v&&w.suppressUnhandledRejections();var A=function(){return w};return this.caught(C,A)}}},{}],11:[function(o,f,m){"use strict";f.exports=function(v,y){var x=v.reduce,C=v.all;function w(){return C(this)}function A(E,T){return x(E,T,y,y)}v.prototype.each=function(E){return x(this,E,y,0)._then(w,void 0,void 0,this,void 0)},v.prototype.mapSeries=function(E){return x(this,E,y,y)},v.each=function(E,T){return x(E,T,y,0)._then(w,void 0,void 0,E,void 0)},v.mapSeries=A}},{}],12:[function(o,f,m){"use strict";var v=o("./es5"),y=v.freeze,x=o("./util"),C=x.inherits,w=x.notEnumerableProp;function A(k,U){function G(j){if(!(this instanceof G))return new G(j);w(this,"message",typeof j=="string"?j:U),w(this,"name",k),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return C(G,Error),G}var E,T,S=A("Warning","warning"),M=A("CancellationError","cancellation error"),I=A("TimeoutError","timeout error"),P=A("AggregateError","aggregate error");try{E=TypeError,T=RangeError}catch{E=A("TypeError","type error"),T=A("RangeError","range error")}for(var D="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),L=0;L1?L.cancelPromise._reject(R):L.cancelPromise._cancel(),L.cancelPromise=null,!0):!1}function I(){return D.call(this,this.promise._target()._settledValue())}function P(L){if(!M(this,L))return A.e=L,A}function D(L){var R=this.promise,O=this.handler;if(!this.called){this.called=!0;var F=this.isFinallyHandler()?O.call(R._boundValue()):O.call(R._boundValue(),L);if(F===x)return F;if(F!==void 0){R._setReturnedNonUndefined();var k=y(F,R);if(k instanceof v){if(this.cancelPromise!=null)if(k._isCancelled()){var U=new w("late cancellation observer");return R._attachExtraTrace(U),A.e=U,A}else k.isPending()&&k._attachCancellationCallback(new S(this));return k._then(I,P,void 0,this,void 0)}}}return R.isRejected()?(M(this),A.e=L,A):(M(this),L)}return v.prototype._passThrough=function(L,R,O,F){return typeof L!="function"?this.then():this._then(O,F,void 0,new T(this,R,L),void 0)},v.prototype.lastly=v.prototype.finally=function(L){return this._passThrough(L,0,D,D)},v.prototype.tap=function(L){return this._passThrough(L,1,D)},v.prototype.tapCatch=function(L){var R=arguments.length;if(R===1)return this._passThrough(L,1,void 0,D);var O=new Array(R-1),F=0,k;for(k=0;k0&&typeof arguments[k]=="function"&&(U=arguments[k],!1&&k<=8&&E)){var z,G,j,q;for(var J;J=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return!0}else{if(k>=1&&this._inFlight>=k)return R[L]=D,this._queue.push(L),!1;F!==null&&(F[L]=D);var U=this._promise,G=this._callback,j=U._boundValue();U._pushContext();var q=T(G).call(j,D,L,O),J=U._popContext();if(A.checkForgottenReturns(q,J,F!==null?"Promise.filter":"Promise.map",U),q===S)return this._reject(q.e),!0;var X=C(q,this._promise);if(X instanceof v){X=X._target();var Y=X._bitField;if((Y&50397184)===0)return k>=1&&this._inFlight++,R[L]=X,X._proxy(this,(L+1)*-1),!1;if((Y&33554432)!==0)q=X._value();else return(Y&16777216)!==0?(this._reject(X._reason()),!0):(this._cancel(),!0)}R[L]=q}var Q=++this._totalResolved;return Q>=O?(F!==null?this._filter(R,F):this._resolve(R),!0):!1},I.prototype._drainQueue=function(){for(var D=this._queue,L=this._limit,R=this._values;D.length>0&&this._inFlight=1?F:0,new I(D,L,F,O).promise()}v.prototype.map=function(D,L){return P(this,D,L,null)},v.map=function(D,L,R,O){return P(D,L,R,O)}}},{"./util":36}],19:[function(o,f,m){"use strict";f.exports=function(v,y,x,C,w){var A=o("./util"),E=A.tryCatch;v.method=function(T){if(typeof T!="function")throw new v.TypeError("expecting a function but got "+A.classString(T));return function(){var S=new v(y);S._captureStackTrace(),S._pushContext();var M=E(T).apply(this,arguments),I=S._popContext();return w.checkForgottenReturns(M,I,"Promise.method",S),S._resolveFromSyncValue(M),S}},v.attempt=v.try=function(T){if(typeof T!="function")return C("expecting a function but got "+A.classString(T));var S=new v(y);S._captureStackTrace(),S._pushContext();var M;if(arguments.length>1){w.deprecated("calling Promise.try with more than 1 argument");var I=arguments[1],P=arguments[2];M=A.isArray(I)?E(T).apply(P,I):E(T).call(P,I)}else M=E(T)();var D=S._popContext();return w.checkForgottenReturns(M,D,"Promise.try",S),S._resolveFromSyncValue(M),S},v.prototype._resolveFromSyncValue=function(T){T===A.errorObj?this._rejectCallback(T.e,!1):this._resolveCallback(T,!0)}}},{"./util":36}],20:[function(o,f,m){"use strict";var v=o("./util"),y=v.maybeWrapAsError,x=o("./errors"),C=x.OperationalError,w=o("./es5");function A(M){return M instanceof Error&&w.getPrototypeOf(M)===Error.prototype}var E=/^(?:name|message|stack|cause)$/;function T(M){var I;if(A(M)){I=new C(M),I.name=M.name,I.message=M.message,I.stack=M.stack;for(var P=w.keys(M),D=0;D1){var Se=new Array(Ce-1),De=0,Oe;for(Oe=0;Oe0&&typeof he!="function"&&typeof Ce!="function"){var Se=".then() only accepts functions but was passed: "+A.classString(he);arguments.length>1&&(Se+=", "+A.classString(Ce)),this._warn(Se)}return this._then(he,Ce,void 0,void 0,void 0)},de.prototype.done=function(he,Ce){var Se=this._then(he,Ce,void 0,void 0,void 0);Se._setIsFinal()},de.prototype.spread=function(he){return typeof he!="function"?x("expecting a function but got "+A.classString(he)):this.all()._then(he,void 0,void 0,q,void 0)},de.prototype.toJSON=function(){var he={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(he.fulfillmentValue=this.value(),he.isFulfilled=!0):this.isRejected()&&(he.rejectionReason=this.reason(),he.isRejected=!0),he},de.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new Y(this).promise()},de.prototype.error=function(he){return this.caught(A.originatesFromRejection,he)},de.getNewLibraryCopy=f.exports,de.is=function(he){return he instanceof de},de.fromNode=de.fromCallback=function(he){var Ce=new de(j);Ce._captureStackTrace();var Se=arguments.length>1?!!Object(arguments[1]).multiArgs:!1,De=ae(he)(oe(Ce,Se));return De===se&&Ce._rejectCallback(De.e,!0),Ce._isFateSealed()||Ce._setAsyncGuaranteed(),Ce},de.all=function(he){return new Y(he).promise()},de.cast=function(he){var Ce=X(he);return Ce instanceof de||(Ce=new de(j),Ce._captureStackTrace(),Ce._setFulfilled(),Ce._rejectionHandler0=he),Ce},de.resolve=de.fulfilled=de.cast,de.reject=de.rejected=function(he){var Ce=new de(j);return Ce._captureStackTrace(),Ce._rejectCallback(he,!0),Ce},de.setScheduler=function(he){if(typeof he!="function")throw new U("expecting a function but got "+A.classString(he));return F.setScheduler(he)},de.prototype._then=function(he,Ce,Se,De,Oe){var Ue=Oe!==void 0,Xe=Ue?Oe:new de(j),it=this._target(),ut=it._bitField;Ue||(Xe._propagateFrom(this,3),Xe._captureStackTrace(),De===void 0&&(this._bitField&2097152)!==0&&((ut&50397184)!==0?De=this._boundValue():De=it===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,Xe));var at=P();if((ut&50397184)!==0){var Pt,Qe,ft=it._settlePromiseCtx;(ut&33554432)!==0?(Qe=it._rejectionHandler0,Pt=he):(ut&16777216)!==0?(Qe=it._fulfillmentHandler0,Pt=Ce,it._unsetRejectionIsUnhandled()):(ft=it._settlePromiseLateCancellationObserver,Qe=new G("late cancellation observer"),it._attachExtraTrace(Qe),Pt=Ce),F.invoke(ft,it,{handler:A.contextBind(at,Pt),promise:Xe,receiver:De,value:Qe})}else it._addCallbacks(he,Ce,Xe,De,at);return Xe},de.prototype._length=function(){return this._bitField&65535},de.prototype._isFateSealed=function(){return(this._bitField&117506048)!==0},de.prototype._isFollowing=function(){return(this._bitField&67108864)===67108864},de.prototype._setLength=function(he){this._bitField=this._bitField&-65536|he&65535},de.prototype._setFulfilled=function(){this._bitField=this._bitField|33554432,this._fireEvent("promiseFulfilled",this)},de.prototype._setRejected=function(){this._bitField=this._bitField|16777216,this._fireEvent("promiseRejected",this)},de.prototype._setFollowing=function(){this._bitField=this._bitField|67108864,this._fireEvent("promiseResolved",this)},de.prototype._setIsFinal=function(){this._bitField=this._bitField|4194304},de.prototype._isFinal=function(){return(this._bitField&4194304)>0},de.prototype._unsetCancelled=function(){this._bitField=this._bitField&-65537},de.prototype._setCancelled=function(){this._bitField=this._bitField|65536,this._fireEvent("promiseCancelled",this)},de.prototype._setWillBeCancelled=function(){this._bitField=this._bitField|8388608},de.prototype._setAsyncGuaranteed=function(){if(!F.hasCustomScheduler()){var he=this._bitField;this._bitField=he|(he&536870912)>>2^134217728}},de.prototype._setNoAsyncGuarantee=function(){this._bitField=(this._bitField|536870912)&-134217729},de.prototype._receiverAt=function(he){var Ce=he===0?this._receiver0:this[he*4-4+3];if(Ce!==w)return Ce===void 0&&this._isBound()?this._boundValue():Ce},de.prototype._promiseAt=function(he){return this[he*4-4+2]},de.prototype._fulfillmentHandlerAt=function(he){return this[he*4-4+0]},de.prototype._rejectionHandlerAt=function(he){return this[he*4-4+1]},de.prototype._boundValue=function(){},de.prototype._migrateCallback0=function(he){var Ce=he._bitField,Se=he._fulfillmentHandler0,De=he._rejectionHandler0,Oe=he._promise0,Ue=he._receiverAt(0);Ue===void 0&&(Ue=w),this._addCallbacks(Se,De,Oe,Ue,null)},de.prototype._migrateCallbackAt=function(he,Ce){var Se=he._fulfillmentHandlerAt(Ce),De=he._rejectionHandlerAt(Ce),Oe=he._promiseAt(Ce),Ue=he._receiverAt(Ce);Ue===void 0&&(Ue=w),this._addCallbacks(Se,De,Oe,Ue,null)},de.prototype._addCallbacks=function(he,Ce,Se,De,Oe){var Ue=this._length();if(Ue>=65535-4&&(Ue=0,this._setLength(0)),Ue===0)this._promise0=Se,this._receiver0=De,typeof he=="function"&&(this._fulfillmentHandler0=A.contextBind(Oe,he)),typeof Ce=="function"&&(this._rejectionHandler0=A.contextBind(Oe,Ce));else{var Xe=Ue*4-4;this[Xe+2]=Se,this[Xe+3]=De,typeof he=="function"&&(this[Xe+0]=A.contextBind(Oe,he)),typeof Ce=="function"&&(this[Xe+1]=A.contextBind(Oe,Ce))}return this._setLength(Ue+1),Ue},de.prototype._proxy=function(he,Ce){this._addCallbacks(void 0,void 0,Ce,he,null)},de.prototype._resolveCallback=function(he,Ce){if((this._bitField&117506048)===0){if(he===this)return this._rejectCallback(v(),!1);var Se=X(he,this);if(!(Se instanceof de))return this._fulfill(he);Ce&&this._propagateFrom(Se,2);var De=Se._target();if(De===this){this._reject(v());return}var Oe=De._bitField;if((Oe&50397184)===0){var Ue=this._length();Ue>0&&De._migrateCallback0(this);for(var Xe=1;Xe>>16)){if(he===this){var Se=v();return this._attachExtraTrace(Se),this._reject(Se)}this._setFulfilled(),this._rejectionHandler0=he,(Ce&65535)>0&&((Ce&134217728)!==0?this._settlePromises():F.settlePromises(this),this._dereferenceTrace())}},de.prototype._reject=function(he){var Ce=this._bitField;if(!((Ce&117506048)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=he,this._isFinal())return F.fatalError(he,A.isNode);(Ce&65535)>0?F.settlePromises(this):this._ensurePossibleRejectionHandled()}},de.prototype._fulfillPromises=function(he,Ce){for(var Se=1;Se0){if((he&16842752)!==0){var Se=this._fulfillmentHandler0;this._settlePromise0(this._rejectionHandler0,Se,he),this._rejectPromises(Ce,Se)}else{var De=this._rejectionHandler0;this._settlePromise0(this._fulfillmentHandler0,De,he),this._fulfillPromises(Ce,De)}this._setLength(0)}this._clearCancellationData()},de.prototype._settledValue=function(){var he=this._bitField;if((he&33554432)!==0)return this._rejectionHandler0;if((he&16777216)!==0)return this._fulfillmentHandler0},typeof Symbol<"u"&&Symbol.toStringTag&&R.defineProperty(de.prototype,Symbol.toStringTag,{get:function(){return"Object"}});function ve(he){this.promise._resolveCallback(he)}function pe(he){this.promise._rejectCallback(he,!1)}de.defer=de.pending=function(){z.deprecated("Promise.defer","new Promise");var he=new de(j);return{promise:he,resolve:ve,reject:pe}},A.notEnumerableProp(de,"_makeSelfResolutionError",v),o("./method")(de,j,X,x,z),o("./bind")(de,j,X,z),o("./cancel")(de,Y,x,z),o("./direct_resolve")(de),o("./synchronous_inspection")(de),o("./join")(de,Y,X,j,F),de.Promise=de,de.version="3.7.2",o("./call_get.js")(de),o("./generators.js")(de,x,j,X,C,z),o("./map.js")(de,Y,x,X,j,z),o("./nodeify.js")(de),o("./promisify.js")(de,j),o("./props.js")(de,Y,X,x),o("./race.js")(de,j,X,x),o("./reduce.js")(de,Y,x,X,j,z),o("./settle.js")(de,Y,z),o("./some.js")(de,Y,x),o("./timers.js")(de,j,z),o("./using.js")(de,x,X,ee,j,z),o("./any.js")(de),o("./each.js")(de,j),o("./filter.js")(de,j),A.toFastProperties(de),A.toFastProperties(de.prototype);function ce(he){var Ce=new de(j);Ce._fulfillmentHandler0=he,Ce._rejectionHandler0=he,Ce._promise0=he,Ce._receiver0=he}return ce({a:1}),ce({b:2}),ce({c:3}),ce(1),ce(function(){}),ce(void 0),ce(!1),ce(new de(j)),z.setBounds(O.firstLineError,A.lastLineError),de}},{"./any.js":1,"./async":2,"./bind":3,"./call_get.js":5,"./cancel":6,"./catch_filter":7,"./context":8,"./debuggability":9,"./direct_resolve":10,"./each.js":11,"./errors":12,"./es5":13,"./filter.js":14,"./finally":15,"./generators.js":16,"./join":17,"./map.js":18,"./method":19,"./nodeback":20,"./nodeify.js":21,"./promise_array":23,"./promisify.js":24,"./props.js":25,"./race.js":27,"./reduce.js":28,"./settle.js":30,"./some.js":31,"./synchronous_inspection":32,"./thenables":33,"./timers.js":34,"./using.js":35,"./util":36,async_hooks:void 0}],23:[function(o,f,m){"use strict";f.exports=function(v,y,x,C,w){var A=o("./util"),E=A.isArray;function T(M){switch(M){case-2:return[];case-3:return{};case-6:return new Map}}function S(M){var I=this._promise=new v(y);M instanceof v&&(I._propagateFrom(M,3),M.suppressUnhandledRejections()),I._setOnCancel(this),this._values=M,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return A.inherits(S,w),S.prototype.length=function(){return this._length},S.prototype.promise=function(){return this._promise},S.prototype._init=function M(I,P){var D=x(this._values,this._promise);if(D instanceof v){D=D._target();var L=D._bitField;if(this._values=D,(L&50397184)===0)return this._promise._setAsyncGuaranteed(),D._then(M,this._reject,void 0,this,P);if((L&33554432)!==0)D=D._value();else return(L&16777216)!==0?this._reject(D._reason()):this._cancel()}if(D=A.asArray(D),D===null){var R=C("expecting an array or an iterable object but got "+A.classString(D)).reason();this._promise._rejectCallback(R,!1);return}if(D.length===0){P===-5?this._resolveEmptyArray():this._resolve(T(P));return}this._iterate(D)},S.prototype._iterate=function(M){var I=this.getActualLength(M.length);this._length=I,this._values=this.shouldCopyValues()?new Array(I):this._values;for(var P=this._promise,D=!1,L=null,R=0;R=this._length?(this._resolve(this._values),!0):!1},S.prototype._promiseCancelled=function(){return this._cancel(),!0},S.prototype._promiseRejected=function(M){return this._totalResolved++,this._reject(M),!0},S.prototype._resultCancelled=function(){if(!this._isResolved()){var M=this._values;if(this._cancel(),M instanceof v)M.cancel();else for(var I=0;I=this._length){var O;if(this._isMap)O=M(this._values);else{O={};for(var F=this.length(),k=0,U=this.length();k>1};function P(D){var L,R=x(D);if(A(R))R instanceof v?L=R._then(v.props,void 0,void 0,void 0,void 0):L=new I(R).promise();else return C(`cannot await properties of a non-object See http://goo.gl/MqrFmX `);return R instanceof v&&L._propagateFrom(R,2),L}v.prototype.props=function(){return P(this)},v.props=function(D){return P(D)}}},{"./es5":13,"./util":36}],26:[function(o,f,m){"use strict";function v(x,C,w,A,E){for(var T=0;T"u"){var w=global.setImmediate,A=process.nextTick;y=v.isRecentNode?function(T){w.call(global,T)}:function(T){A.call(process,T)}}else if(typeof C=="function"&&typeof C.resolve=="function"){var E=C.resolve();y=function(T){E.then(T)}}else typeof MutationObserver<"u"&&!(typeof window<"u"&&window.navigator&&(window.navigator.standalone||window.cordova))&&"classList"in document.documentElement?y=function(){var T=document.createElement("div"),S={attributes:!0},M=!1,I=document.createElement("div"),P=new MutationObserver(function(){T.classList.toggle("foo"),M=!1});P.observe(I,S);var D=function(){M||(M=!0,I.classList.toggle("foo"))};return function(R){var O=new MutationObserver(function(){O.disconnect(),R()});O.observe(T,S),D()}}():typeof setImmediate<"u"?y=function(T){setImmediate(T)}:typeof setTimeout<"u"?y=function(T){setTimeout(T,0)}:y=x;f.exports=y},{"./util":36}],30:[function(o,f,m){"use strict";f.exports=function(v,y,x){var C=v.PromiseInspection,w=o("./util");function A(E){this.constructor$(E)}w.inherits(A,y),A.prototype._promiseResolved=function(E,T){this._values[E]=T;var S=++this._totalResolved;return S>=this._length?(this._resolve(this._values),!0):!1},A.prototype._promiseFulfilled=function(E,T){var S=new C;return S._bitField=33554432,S._settledValueField=E,this._promiseResolved(T,S)},A.prototype._promiseRejected=function(E,T){var S=new C;return S._bitField=16777216,S._settledValueField=E,this._promiseResolved(T,S)},v.settle=function(E){return x.deprecated(".settle()",".reflect()"),new A(E).promise()},v.allSettled=function(E){return new A(E).promise()},v.prototype.settle=function(){return v.settle(this)}}},{"./util":36}],31:[function(o,f,m){"use strict";f.exports=function(v,y,x){var C=o("./util"),w=o("./errors").RangeError,A=o("./errors").AggregateError,E=C.isArray,T={};function S(I){this.constructor$(I),this._howMany=0,this._unwrap=!1,this._initialized=!1}C.inherits(S,y),S.prototype._init=function(){if(!!this._initialized){if(this._howMany===0){this._resolve([]);return}this._init$(void 0,-5);var I=E(this._values);!this._isResolved()&&I&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},S.prototype.init=function(){this._initialized=!0,this._init()},S.prototype.setUnwrap=function(){this._unwrap=!0},S.prototype.howMany=function(){return this._howMany},S.prototype.setHowMany=function(I){this._howMany=I},S.prototype._promiseFulfilled=function(I){return this._addFulfilled(I),this._fulfilled()===this.howMany()?(this._values.length=this.howMany(),this.howMany()===1&&this._unwrap?this._resolve(this._values[0]):this._resolve(this._values),!0):!1},S.prototype._promiseRejected=function(I){return this._addRejected(I),this._checkOutcome()},S.prototype._promiseCancelled=function(){return this._values instanceof v||this._values==null?this._cancel():(this._addRejected(T),this._checkOutcome())},S.prototype._checkOutcome=function(){if(this.howMany()>this._canPossiblyFulfill()){for(var I=new A,P=this.length();P0?this._reject(I):this._cancel(),!0}return!1},S.prototype._fulfilled=function(){return this._totalResolved},S.prototype._rejected=function(){return this._values.length-this.length()},S.prototype._addRejected=function(I){this._values.push(I)},S.prototype._addFulfilled=function(I){this._values[this._totalResolved++]=I},S.prototype._canPossiblyFulfill=function(){return this.length()-this._rejected()},S.prototype._getRangeError=function(I){var P="Input array must contain at least "+this._howMany+" items but contains only "+I+" items";return new w(P)},S.prototype._resolveEmptyArray=function(){this._reject(this._getRangeError(0))};function M(I,P){if((P|0)!==P||P<0)return x(`expecting a positive integer See http://goo.gl/MqrFmX `);var D=new S(I),L=D.promise();return D.setHowMany(P),D.init(),L}v.some=function(I,P){return M(I,P)},v.prototype.some=function(I){return M(this,I)},v._SomePromiseArray=S}},{"./errors":12,"./util":36}],32:[function(o,f,m){"use strict";f.exports=function(v){function y(S){S!==void 0?(S=S._target(),this._bitField=S._bitField,this._settledValueField=S._isFateSealed()?S._settledValue():void 0):(this._bitField=0,this._settledValueField=void 0)}y.prototype._settledValue=function(){return this._settledValueField};var x=y.prototype.value=function(){if(!this.isFulfilled())throw new TypeError(`cannot get fulfillment value of a non-fulfilled promise See http://goo.gl/MqrFmX `);return this._settledValue()},C=y.prototype.error=y.prototype.reason=function(){if(!this.isRejected())throw new TypeError(`cannot get rejection reason of a non-rejected promise See http://goo.gl/MqrFmX `);return this._settledValue()},w=y.prototype.isFulfilled=function(){return(this._bitField&33554432)!==0},A=y.prototype.isRejected=function(){return(this._bitField&16777216)!==0},E=y.prototype.isPending=function(){return(this._bitField&50397184)===0},T=y.prototype.isResolved=function(){return(this._bitField&50331648)!==0};y.prototype.isCancelled=function(){return(this._bitField&8454144)!==0},v.prototype.__isCancelled=function(){return(this._bitField&65536)===65536},v.prototype._isCancelled=function(){return this._target().__isCancelled()},v.prototype.isCancelled=function(){return(this._target()._bitField&8454144)!==0},v.prototype.isPending=function(){return E.call(this._target())},v.prototype.isRejected=function(){return A.call(this._target())},v.prototype.isFulfilled=function(){return w.call(this._target())},v.prototype.isResolved=function(){return T.call(this._target())},v.prototype.value=function(){return x.call(this._target())},v.prototype.reason=function(){var S=this._target();return S._unsetRejectionIsUnhandled(),C.call(S)},v.prototype._value=function(){return this._settledValue()},v.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue()},v.PromiseInspection=y}},{}],33:[function(o,f,m){"use strict";f.exports=function(v,y){var x=o("./util"),C=x.errorObj,w=x.isObject;function A(P,D){if(w(P)){if(P instanceof v)return P;var L=T(P);if(L===C){D&&D._pushContext();var R=v.reject(L.e);return D&&D._popContext(),R}else if(typeof L=="function"){if(M(P)){var R=new v(y);return P._then(R._fulfill,R._reject,void 0,R,null),R}return I(P,L,D)}}return P}function E(P){return P.then}function T(P){try{return E(P)}catch(D){return C.e=D,C}}var S={}.hasOwnProperty;function M(P){try{return S.call(P,"_promise0")}catch{return!1}}function I(P,D,L){var R=new v(y),O=R;L&&L._pushContext(),R._captureStackTrace(),L&&L._popContext();var F=!0,k=x.tryCatch(D).call(P,U,G);F=!1,R&&k===C&&(R._rejectCallback(k.e,!0,!0),R=null);function U(j){!R||(R._resolveCallback(j),R=null)}function G(j){!R||(R._rejectCallback(j,F,!0),R=null)}return O}return A}},{"./util":36}],34:[function(o,f,m){"use strict";f.exports=function(v,y,x){var C=o("./util"),w=v.TimeoutError;function A(P){this.handle=P}A.prototype._resultCancelled=function(){clearTimeout(this.handle)};var E=function(P){return T(+this).thenReturn(P)},T=v.delay=function(P,D){var L,R;return D!==void 0?(L=v.resolve(D)._then(E,null,null,P,void 0),x.cancellation()&&D instanceof v&&L._setOnCancel(D)):(L=new v(y),R=setTimeout(function(){L._fulfill()},+P),x.cancellation()&&L._setOnCancel(new A(R)),L._captureStackTrace()),L._setAsyncGuaranteed(),L};v.prototype.delay=function(P){return T(P,this)};var S=function(P,D,L){var R;typeof D!="string"?D instanceof Error?R=D:R=new w("operation timed out"):R=new w(D),C.markAsOriginatingFromRejection(R),P._attachExtraTrace(R),P._reject(R),L?.cancel()};function M(P){return clearTimeout(this.handle),P}function I(P){throw clearTimeout(this.handle),P}v.prototype.timeout=function(P,D){P=+P;var L,R,O=new A(setTimeout(function(){L.isPending()&&S(L,D,R)},P));return x.cancellation()?(R=this.then(),L=R._then(M,I,void 0,O,void 0),L._setOnCancel(O)):L=this._then(M,I,void 0,O,void 0),L}}},{"./util":36}],35:[function(o,f,m){"use strict";f.exports=function(v,y,x,C,w,A){var E=o("./util"),T=o("./errors").TypeError,S=o("./util").inherits,M=E.errorObj,I=E.tryCatch,P={};function D(G){setTimeout(function(){throw G},0)}function L(G){var j=x(G);return j!==G&&typeof G._isDisposable=="function"&&typeof G._getDisposer=="function"&&G._isDisposable()&&j._setDisposable(G._getDisposer()),j}function R(G,j){var q=0,J=G.length,X=new v(w);function Y(){if(q>=J)return X._fulfill();var Q=L(G[q++]);if(Q instanceof v&&Q._isDisposable()){try{Q=x(Q._getDisposer().tryDispose(j),G.promise)}catch(ee){return D(ee)}if(Q instanceof v)return Q._then(Y,D,null,null,null)}Y()}return Y(),X}function O(G,j,q){this._data=G,this._promise=j,this._context=q}O.prototype.data=function(){return this._data},O.prototype.promise=function(){return this._promise},O.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():P},O.prototype.tryDispose=function(G){var j=this.resource(),q=this._context;q!==void 0&&q._pushContext();var J=j!==P?this.doDispose(j,G):null;return q!==void 0&&q._popContext(),this._promise._unsetDisposable(),this._data=null,J},O.isDisposer=function(G){return G!=null&&typeof G.resource=="function"&&typeof G.tryDispose=="function"};function F(G,j,q){this.constructor$(G,j,q)}S(F,O),F.prototype.doDispose=function(G,j){var q=this.data();return q.call(G,G,j)};function k(G){return O.isDisposer(G)?(this.resources[this.index]._setDisposable(G),G.promise()):G}function U(G){this.length=G,this.promise=null,this[G-1]=null}U.prototype._resultCancelled=function(){for(var G=this.length,j=0;j0},v.prototype._getDisposer=function(){return this._disposer},v.prototype._unsetDisposable=function(){this._bitField=this._bitField&-131073,this._disposer=void 0},v.prototype.disposer=function(G){if(typeof G=="function")return new F(G,this,C());throw new T}}},{"./errors":12,"./util":36}],36:[function(_dereq_,module,exports){"use strict";var es5=_dereq_("./es5"),canEvaluate=typeof navigator>"u",errorObj={e:{}},tryCatchTarget,globalObject=typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:this!==void 0?this:null;function tryCatcher(){try{var o=tryCatchTarget;return tryCatchTarget=null,o.apply(this,arguments)}catch(f){return errorObj.e=f,errorObj}}function tryCatch(o){return tryCatchTarget=o,tryCatcher}var inherits=function(o,f){var m={}.hasOwnProperty;function v(){this.constructor=o,this.constructor$=f;for(var y in f.prototype)m.call(f.prototype,y)&&y.charAt(y.length-1)!=="$"&&(this[y+"$"]=f.prototype[y])}return v.prototype=f.prototype,o.prototype=new v,o.prototype};function isPrimitive(o){return o==null||o===!0||o===!1||typeof o=="string"||typeof o=="number"}function isObject(o){return typeof o=="function"||typeof o=="object"&&o!==null}function maybeWrapAsError(o){return isPrimitive(o)?new Error(safeToString(o)):o}function withAppended(o,f){var m=o.length,v=new Array(m+1),y;for(y=0;y1,v=f.length>0&&!(f.length===1&&f[0]==="constructor"),y=thisAssignmentPattern.test(o+"")&&es5.names(o).length>0;if(m||v||y)return!0}return!1}catch{return!1}}function toFastProperties(obj){function FakeConstructor(){}FakeConstructor.prototype=obj;var receiver=new FakeConstructor;function ic(){return typeof receiver.foo}return ic(),ic(),obj;eval(obj)}var rident=/^[a-z$_][a-z$_0-9]*$/i;function isIdentifier(o){return rident.test(o)}function filledRange(o,f,m){for(var v=new Array(o),y=0;y10||o[0]>0}(),ret.nodeSupportsAsyncResource=ret.isNode&&function(){var o=!1;try{var f=_dereq_("async_hooks").AsyncResource;o=typeof f.prototype.runInAsyncScope=="function"}catch{o=!1}return o}(),ret.isNode&&ret.toFastProperties(process);try{throw new Error}catch(o){ret.lastLineError=o}module.exports=ret},{"./es5":13,async_hooks:void 0}]},{},[4])(4)});typeof window<"u"&&window!==null?window.P=window.Promise:typeof self<"u"&&self!==null&&(self.P=self.Promise)});var JOe="CIM SDK v5.1.6",KOe="Cesium v1.106",QOe="BIM V20240410",ZOe="2024.4.12",K0t="WebSDKV5.1",Q0t={VERSION:JOe,CesiumVERSION:KOe,BIMVERSION:QOe,CompileTime:ZOe},Z0t=typeof window<"u"?window:typeof self<"u"?self:{};Z0t.logSmartEarth=()=>{let o=` %c${K0t} %c \u7248 \u672C \u53F7\uFF1A${JOe} ${KOe} ${QOe} \u7F16\u8BD1\u65F6\u95F4\uFF1A${ZOe} `;setTimeout(console.log.bind(console,o,"color:#018aff;font-size:30px;font-wight:bold;font-family:\u5FAE\u8F6F\u96C5\u9ED1","color:#018aff;font-size:13px;font-family:\u5FAE\u8F6F\u96C5\u9ED1"),0)};var $0t=Q0t;var Iat={};Ice(Iat,{AlphaMode:()=>PH,AlphaPipelineStage:()=>qbe,Animation:()=>tIe,AnimationViewModel:()=>iIe,Appearance:()=>md,ApproximateTerrainHeights:()=>zh,ArcGISTiledElevationTerrainProvider:()=>Goe,ArcGisBaseMapType:()=>d3,ArcGisMapServerImageryProvider:()=>hC,ArcGisMapService:()=>EE,ArcType:()=>fs,ArticulationStageType:()=>b1,AssociativeArray:()=>wa,AttributeCompression:()=>Ku,AttributeType:()=>Ks,AutoExposure:()=>ASe,AutomaticUniforms:()=>Mz,Axis:()=>Df,AxisAlignedBoundingBox:()=>_Y,B3dmLoader:()=>sbe,B3dmParser:()=>abe,Base64Encoder:()=>gee,BaseLayerPicker:()=>aIe,BaseLayerPickerViewModel:()=>oIe,BatchTable:()=>cre,BatchTableHierarchy:()=>$re,BatchTexture:()=>mw,BatchTexturePipelineStage:()=>Xbe,Billboard:()=>kd,BillboardCollection:()=>XE,BillboardGraphics:()=>jM,BillboardVisualizer:()=>lEe,BingMapsGeocoderService:()=>yrt,BingMapsImageryProvider:()=>xO,BingMapsStyle:()=>goe,BlendEquation:()=>Cv,BlendFunction:()=>Bh,BlendOption:()=>If,BlendTexture:()=>pU,BlendingState:()=>Mu,BoundingRectangle:()=>Xr,BoundingSphere:()=>Pi,BoundingSphereState:()=>Vo,BoxEmitter:()=>eae,BoxGeometry:()=>MM,BoxGeometryUpdater:()=>uEe,BoxGraphics:()=>fre,BoxOutlineGeometry:()=>X2,BrdfLutGenerator:()=>NTe,Buffer:()=>Ao,BufferLoader:()=>jY,BufferUsage:()=>gn,CPUStylingPipelineStage:()=>Zbe,CallbackProperty:()=>xn,Camera:()=>Vl,CameraEventAggregator:()=>BSe,CameraEventType:()=>Hc,CameraFlightPath:()=>KCe,Cartesian2:()=>Ye,Cartesian3:()=>H,Cartesian4:()=>Wt,Cartographic:()=>Mt,CartographicGeocoderService:()=>c2e,CatmullRomSpline:()=>xrt,CatmullRomSplineExtend:()=>Crt,Cesium3DContentGroup:()=>Zre,Cesium3DTile:()=>xC,Cesium3DTileBatchTable:()=>UY,Cesium3DTileColorBlendMode:()=>d2,Cesium3DTileContent:()=>unt,Cesium3DTileContentFactory:()=>Nne,Cesium3DTileContentState:()=>ud,Cesium3DTileContentType:()=>Ev,Cesium3DTileFeature:()=>Qs,Cesium3DTileFeatureTable:()=>qU,Cesium3DTileOptimizationHint:()=>WR,Cesium3DTileOptimizations:()=>gAe,Cesium3DTilePass:()=>ep,Cesium3DTilePassState:()=>ET,Cesium3DTilePointFeature:()=>i5,Cesium3DTileRefine:()=>Ug,Cesium3DTileStyle:()=>G2,Cesium3DTileStyleEngine:()=>yAe,Cesium3DTilesInspector:()=>nIe,Cesium3DTilesInspectorViewModel:()=>rIe,Cesium3DTilesVoxelProvider:()=>ynt,Cesium3DTileset:()=>pg,Cesium3DTilesetBaseTraversal:()=>CAe,Cesium3DTilesetCache:()=>_Ae,Cesium3DTilesetGraphics:()=>vre,Cesium3DTilesetHeatmap:()=>vAe,Cesium3DTilesetMetadata:()=>fq,Cesium3DTilesetMostDetailedTraversal:()=>xAe,Cesium3DTilesetSkipTraversal:()=>bAe,Cesium3DTilesetStatistics:()=>v5,Cesium3DTilesetTraversal:()=>Xy,Cesium3DTilesetVisualizer:()=>cEe,CesiumInspector:()=>cIe,CesiumInspectorViewModel:()=>uIe,CesiumNavigation:()=>SPe,CesiumRenderPass:()=>FPe,CesiumTerrainProvider:()=>K5,CesiumWidget:()=>Xq,Check:()=>kh,CheckerboardMaterialProperty:()=>bte,CircleEmitter:()=>Y2e,CircleGeometry:()=>Srt,CircleOutlineGeometry:()=>Prt,CircleWaveMaterialProperty:()=>mU,ClassificationModelDrawCommand:()=>Tbe,ClassificationPipelineStage:()=>Jbe,ClassificationPrimitive:()=>AU,ClassificationType:()=>uc,ClearCommand:()=>Gc,ClippingPlane:()=>zv,ClippingPlaneCollection:()=>Uv,Clock:()=>MU,ClockRange:()=>L0,ClockStep:()=>Od,ClockViewModel:()=>eIe,CloudCollection:()=>Tnt,CloudType:()=>$te,CollectionSource:()=>BWe,Color:()=>Re,ColorBlendMode:()=>T2,ColorGeometryInstanceAttribute:()=>ea,ColorMaterialProperty:()=>xs,Command:()=>nat,CommandLoader:()=>PPe,ComponentDatatype:()=>Rt,Composite3DTileContent:()=>_1e,CompositeEntityCollection:()=>KZe,CompositeMaterialProperty:()=>Ate,CompositePositionProperty:()=>O1,CompositeProperty:()=>bw,CompressedTextureBuffer:()=>iY,ComputeCommand:()=>B5,ComputeEngine:()=>SAe,ComputeRegionBox:()=>kZe,ConditionsExpression:()=>Bxe,ConeEmitter:()=>R6,ConicArcSensor:()=>die,ConicArcSensorCollection:()=>Zot,ConicArcSensorGeometry:()=>pie,ConicArcSensorGraphics:()=>hie,ConicArcSensorOutlineGeometry:()=>mie,ConstantPositionProperty:()=>c2,ConstantProperty:()=>Uc,ConstantSpline:()=>fbe,ConstructionWorker:()=>VWe,ContentMetadata:()=>aAe,ContentState:()=>a2,Context:()=>NAe,ContextLimits:()=>Bo,CoplanarPolygonGeometry:()=>UB,CoplanarPolygonGeometryLibrary:()=>Hz,CoplanarPolygonOutlineGeometry:()=>YI,CornerType:()=>ed,CorridorGeometry:()=>xq,CorridorGeometryLibrary:()=>Kc,CorridorGeometryUpdater:()=>fEe,CorridorGraphics:()=>pre,CorridorOutlineGeometry:()=>dEe,Credit:()=>Cs,CreditDisplay:()=>FTe,CubeMap:()=>lT,CubeMapFace:()=>wR,CubicRealPolynomial:()=>gY,CullFace:()=>uh,CullingVolume:()=>hg,CumulusCloud:()=>IT,CustomDataSource:()=>Cre,CustomHeightmapTerrainProvider:()=>Mrt,CustomMercatorProjection:()=>vU,CustomShader:()=>Kw,CustomShaderManagerEx:()=>are,CustomShaderMode:()=>hY,CustomShaderPipelineStage:()=>owe,CustomShaderTranslucencyMode:()=>C3,CustomTilingScheme:()=>xje,CylinderGeometry:()=>pEe,CylinderGeometryLibrary:()=>toe,CylinderGeometryUpdater:()=>gEe,CylinderGraphics:()=>mre,CylinderOutlineGeometry:()=>mEe,CzmlDataSource:()=>bq,DDSTexture:()=>zPe,DataSource:()=>C_,DataSourceClock:()=>D5,DataSourceCollection:()=>EEe,DataSourceDisplay:()=>Sq,DebugAppearance:()=>Ont,DebugCameraPrimitive:()=>Ap,DebugInspector:()=>qSe,DebugModelMatrixPrimitive:()=>Q2e,DefaultProxy:()=>Lrt,DepthFunction:()=>mC,DepthPlane:()=>BTe,DequantizationPipelineStage:()=>awe,DerivedCommand:()=>Iv,DeveloperError:()=>li,DeviceOrientationCameraController:()=>kTe,DirectionalLight:()=>rae,DiscardEmptyTileImagePolicy:()=>_oe,DiscardMissingTileImagePolicy:()=>gTe,DistanceDisplayCondition:()=>ia,DistanceDisplayConditionGeometryInstanceAttribute:()=>th,DistanceLegendViewModel:()=>vPe,DoubleEndedPriorityQueue:()=>Xoe,DoublyLinkedList:()=>Vne,DracoLoader:()=>YY,DrawCommand:()=>Jn,DynamicGeometryBatch:()=>loe,DynamicGeometryUpdater:()=>wh,ECharts:()=>fY,EarthOrientationParameters:()=>k_e,EarthOrientationParametersSample:()=>nY,EasingFunction:()=>Bv,EllipseGeometry:()=>Vw,EllipseGeometryLibrary:()=>tb,EllipseGeometryUpdater:()=>SEe,EllipseGraphics:()=>gre,EllipseOutlineGeometry:()=>I2,Ellipsoid:()=>ki,EllipsoidGeodesic:()=>Im,EllipsoidGeometry:()=>V0,EllipsoidGeometryUpdater:()=>DEe,EllipsoidGraphics:()=>TU,EllipsoidOutlineGeometry:()=>Bw,EllipsoidPrimitive:()=>RTe,EllipsoidRhumbLine:()=>Sw,EllipsoidSurfaceAppearance:()=>MY,EllipsoidTangentPlane:()=>KE,EllipsoidTerrainProvider:()=>AT,EllipsoidalOccluder:()=>pB,Empty3DTileContent:()=>uj,EncodedCartesian3:()=>Qu,Entity:()=>Wh,EntityCluster:()=>iO,EntityCollection:()=>$w,EntityView:()=>nTe,Event:()=>Br,EventHelper:()=>AC,ExpandBySmartEarth:()=>qx,ExpandByTerra:()=>Cje,Expression:()=>b3,ExpressionNodeType:()=>Co,ExternalParameter:()=>Hy,ExtrapolationType:()=>n2,FBXLoader:()=>LPe,FBXPrimitive:()=>mae,FBXTreeParser:()=>DPe,FeatureDataProvider:()=>Nre,FeatureDetection:()=>pa,FeatureIdPipelineStage:()=>uq,FeatureJsonData:()=>RU,FisheyeProjectionMap:()=>OY,FisheyeProjectionMapShader:()=>K7,FlattenVS:()=>jot,FlowEcharts:()=>Qne,Fog:()=>VTe,ForEach:()=>an,FrameRateMonitor:()=>Z2e,FrameState:()=>zTe,Framebuffer:()=>dg,FramebufferManager:()=>$h,FrustumCommands:()=>jTe,FrustumGeometry:()=>OU,FrustumOutlineGeometry:()=>RY,Fullscreen:()=>ng,FullscreenButton:()=>dIe,FullscreenButtonViewModel:()=>hIe,GWBaiduImageryProvider:()=>FU,GeoJsonDataSource:()=>ZW,GeoJsonLoader:()=>cbe,GeocodeType:()=>Jq,Geocoder:()=>gIe,GeocoderService:()=>Koe,GeocoderViewModel:()=>mIe,GeographicProjection:()=>Mp,GeographicTilingScheme:()=>Bd,Geometry:()=>ga,Geometry3DTileContent:()=>v1e,GeometryAttribute:()=>en,GeometryAttributes:()=>Oc,GeometryFactory:()=>Frt,GeometryInstance:()=>co,GeometryInstanceAttribute:()=>L1,GeometryOffsetAttribute:()=>yl,GeometryPipeline:()=>Ju,GeometryPipelineStage:()=>uwe,GeometryType:()=>NR,GeometryUpdater:()=>nd,GeometryVisualizer:()=>KEe,GetFeatureInfoFormat:()=>uW,GifImageProperty:()=>OXe,Globe:()=>ITe,GlobeDepth:()=>YTe,GlobeSurfaceShaderSet:()=>pTe,GlobeSurfaceTile:()=>OM,GlobeSurfaceTileProvider:()=>STe,GlobeTranslucency:()=>Rq,GlobeTranslucencyFramebuffer:()=>qTe,GlobeTranslucencyState:()=>UTe,GltfBufferViewLoader:()=>ine,GltfDracoLoader:()=>rne,GltfImageLoader:()=>one,GltfIndexBufferLoader:()=>ane,GltfInstanceLoader:()=>bne,GltfJsonLoader:()=>une,GltfLoader:()=>RB,GltfLoaderUtil:()=>IM,GltfStructuralMetadataLoader:()=>tbe,GltfTextureLoader:()=>hne,GltfVertexBufferLoader:()=>dne,GoogleEarthEnterpriseImageryProvider:()=>Nnt,GoogleEarthEnterpriseMapsProvider:()=>Coe,GoogleEarthEnterpriseMetadata:()=>TO,GoogleEarthEnterpriseTerrainData:()=>Qte,GoogleEarthEnterpriseTerrainProvider:()=>Urt,GoogleEarthEnterpriseTileInformation:()=>g2e,GoogleMaps:()=>pW,GpxDataSource:()=>dTe,Graticules:()=>Gre,GregorianDate:()=>gU,GridImageryProvider:()=>Fnt,GridMaterialProperty:()=>Pte,GroundGeometryUpdater:()=>uu,GroundPolylineGeometry:()=>bU,GroundPolylinePrimitive:()=>aO,GroundPrimitive:()=>Zw,GroupMetadata:()=>dte,GwBufferAnalysis:()=>Wre,HeadingPitchRange:()=>gC,HeadingPitchRoll:()=>dl,Heap:()=>t_e,HeightReference:()=>qn,HeightmapEncoding:()=>U3,HeightmapTerrainData:()=>wT,HeightmapTessellator:()=>moe,HermitePolynomialApproximation:()=>vEe,HermiteSpline:()=>aj,HilbertOrder:()=>Qee,HomeButton:()=>vIe,HomeButtonViewModel:()=>_Ie,HorizontalOrigin:()=>Zc,HugeAdapter:()=>lq,I3SDataProvider:()=>nae,I3SFeature:()=>iPe,I3SField:()=>rPe,I3SGeometry:()=>eie,I3SLayer:()=>iU,I3SNode:()=>tie,I3dmLoader:()=>dbe,I3dmParser:()=>hbe,Iau2000Orientation:()=>DTe,Iau2006XysData:()=>z_e,Iau2006XysSample:()=>Jie,IauOrientationAxes:()=>LTe,IauOrientationParameters:()=>MTe,ImageBasedLighting:()=>zY,ImageBasedLightingPipelineStage:()=>Dbe,ImageCombine:()=>rre,ImageMaterialProperty:()=>Pp,Imagery:()=>Aoe,ImageryLayer:()=>x_,ImageryLayerCollection:()=>PTe,ImageryLayerFeatureInfo:()=>yO,ImageryProvider:()=>Q2,ImageryState:()=>kl,Implicit3DTileContent:()=>ote,ImplicitAvailabilityBitstream:()=>$ee,ImplicitMetadataView:()=>tne,ImplicitSubdivisionScheme:()=>N0,ImplicitSubtree:()=>mne,ImplicitSubtreeCache:()=>U2e,ImplicitSubtreeMetadata:()=>b1e,ImplicitTileCoordinates:()=>Une,ImplicitTileset:()=>gq,IndexDatatype:()=>ro,InfoBox:()=>CIe,InfoBoxViewModel:()=>xIe,InspectorShared:()=>k1,InstanceAttributeSemantic:()=>ag,InstancingPipelineStage:()=>Ube,InterpolationAlgorithm:()=>Wrt,InterpolationType:()=>o3,Intersect:()=>La,IntersectionTests:()=>Hh,Intersections2D:()=>M6,Interval:()=>t2,InvertClassification:()=>Doe,Ion:()=>ZR,IonGeocoderService:()=>C2e,IonImageryProvider:()=>p2,IonResource:()=>Pw,IonWorldImageryStyle:()=>x5,Iso8601:()=>Hn,JobScheduler:()=>GTe,JobType:()=>Zx,JsonMetadataTable:()=>eq,JulianDate:()=>ci,KTX2Transcoder:()=>r_e,KeyboardEventModifier:()=>dC,KeyframeNode:()=>_h,KmlCamera:()=>gCe,KmlDataSource:()=>Ore,KmlLookAt:()=>_Ce,KmlTour:()=>vCe,KmlTourFlyTo:()=>yCe,KmlTourWait:()=>CCe,Label:()=>TW,LabelCollection:()=>UM,LabelGraphics:()=>SU,LabelStyle:()=>of,LabelVisualizer:()=>QEe,LagrangePolynomialApproximation:()=>xEe,LeapSecond:()=>lh,Light:()=>Vnt,LightingModel:()=>pC,LightingPipelineStage:()=>hwe,LinearApproximation:()=>Ire,LinearSampler:()=>Z2,LinearSpline:()=>sq,MTLLoader:()=>RPe,ManagedArray:()=>E2,MapMode2D:()=>$E,MapProjection:()=>Yrt,MapboxImageryProvider:()=>CO,MapboxStyleImageryProvider:()=>Hnt,Material:()=>zo,MaterialAppearance:()=>Nd,MaterialPass:()=>UPe,MaterialPipelineStage:()=>fwe,MaterialProperty:()=>O0,Math:()=>xe,Matrix2:()=>im,Matrix3:()=>Ut,Matrix4:()=>Ee,Megatexture:()=>aae,MeshParser:()=>MPe,MeshPhongMaterial:()=>vW,MetadataClass:()=>UU,MetadataClassProperty:()=>GY,MetadataComponentType:()=>ds,MetadataEntity:()=>yu,MetadataEnum:()=>j1e,MetadataEnumValue:()=>W1e,MetadataPipelineStage:()=>hM,MetadataSchema:()=>LB,MetadataSchemaLoader:()=>fne,MetadataSemantic:()=>gne,MetadataTable:()=>hO,MetadataTableProperty:()=>A1e,MetadataType:()=>Fa,MipmapHint:()=>hB,Model:()=>S_,Model3DTileContent:()=>PR,ModelAlphaOptions:()=>Dwe,ModelAnimation:()=>ybe,ModelAnimationChannel:()=>_be,ModelAnimationCollection:()=>xbe,ModelAnimationLoop:()=>RE,ModelAnimationState:()=>OR,ModelArticulation:()=>Obe,ModelArticulationStage:()=>Rbe,ModelClippingPlanesPipelineStage:()=>Bbe,ModelColorPipelineStage:()=>sj,ModelComponents:()=>Ta,ModelDrawCommand:()=>Sbe,ModelFeature:()=>Cbe,ModelFeatureTable:()=>bbe,ModelFlattenPipelineStage:()=>qwe,ModelGraphics:()=>yY,ModelLightingOptions:()=>Gwe,ModelMatrixUpdateStage:()=>Wbe,ModelNode:()=>kbe,ModelRenderResources:()=>Fwe,ModelRuntimeNode:()=>Ybe,ModelRuntimePrimitive:()=>Pwe,ModelSceneGraph:()=>Xwe,ModelSilhouettePipelineStage:()=>Vwe,ModelSkin:()=>Mwe,ModelSplitterPipelineStage:()=>Hwe,ModelStatistics:()=>Jwe,ModelType:()=>Lf,ModelUtility:()=>xl,ModelVisualizer:()=>ZEe,Moon:()=>OTe,MorphTargetsPipelineStage:()=>mwe,MorphWeightSpline:()=>qrt,MortonOrder:()=>DH,MultiResourceImageryProvider:()=>BU,MultiResourceTerrainProvider:()=>jre,Multiple3DTileContent:()=>hAe,MultisampleFramebuffer:()=>nbe,NavigationControl:()=>z6,NavigationHelpButton:()=>wIe,NavigationHelpButtonViewModel:()=>bIe,NavigationUtils:()=>H6,NavigationViewModel:()=>gW,NearFarScalar:()=>sa,NeverTileDiscardPolicy:()=>Unt,NodeRenderResources:()=>Uwe,NodeStatisticsPipelineStage:()=>jbe,NodeTransformationProperty:()=>_re,OBJLoader:()=>NPe,OBJPrimitive:()=>gae,OIT:()=>KTe,Occluder:()=>Ure,OctahedralProjectedCubeMap:()=>V5,OffsetGeometryInstanceAttribute:()=>nm,OlMVTImageryProvider:()=>kU,OpenCageGeocoderService:()=>Xrt,OpenStreetMapImageryProvider:()=>pM,OrderedGroundPrimitiveCollection:()=>TEe,OrientedBoundingBox:()=>fc,OrthographicFrustum:()=>Gs,OrthographicOffCenterFrustum:()=>Pm,Packable:()=>Jrt,PackableForInterpolation:()=>Krt,Particle:()=>sae,ParticleBurst:()=>F6,ParticleEmitter:()=>jnt,ParticleSystem:()=>sA,Pass:()=>vr,PassState:()=>Kg,PathGraphics:()=>xY,PathVisualizer:()=>$Ee,PeliasGeocoderService:()=>y2e,PerInstanceColorAppearance:()=>ms,PerformanceDisplay:()=>kq,PerformanceWatchdog:()=>TIe,PerformanceWatchdogViewModel:()=>EIe,PerspectiveFrustum:()=>pc,PerspectiveOffCenterFrustum:()=>J2,PerspectiveProjectionMap:()=>NY,PerspectiveProjectionMapShader:()=>Q7,PerspectiveProjectionMapWithDepth:()=>FY,PerspectiveProjectionMapWithDepthShader:()=>QR,PickDepth:()=>WTe,PickDepthFramebuffer:()=>QTe,PickFramebuffer:()=>ZTe,Picking:()=>aSe,PickingPipelineStage:()=>gwe,PinBuilder:()=>AY,PixelDatatype:()=>Rn,PixelFormat:()=>Nn,Plane:()=>$a,PlaneGeometry:()=>LEe,PlaneGeometryUpdater:()=>NEe,PlaneGraphics:()=>oCe,PlaneOutlineGeometry:()=>REe,PntsLoader:()=>Lne,PntsParser:()=>Dne,PointCloud:()=>aPe,PointCloudEyeDomeLighting:()=>oq,PointCloudShading:()=>YU,PointCloudStylingPipelineStage:()=>vwe,PointGraphics:()=>yre,PointLight:()=>BY,PointPrimitive:()=>jv,PointPrimitiveCollection:()=>_B,PointVisualizer:()=>eTe,PolygonDepth:()=>H5,PolygonDepthFS:()=>Ene,PolygonDepthVS:()=>Tne,PolygonGeometry:()=>Ec,PolygonGeometryLibrary:()=>lu,PolygonGeometryUpdater:()=>BEe,PolygonGraphics:()=>bl,PolygonHierarchy:()=>ho,PolygonOutlineGeometry:()=>FEe,PolygonPipeline:()=>xh,Polyline:()=>Y2,PolylineArrowMaterialProperty:()=>_C,PolylineCollection:()=>lO,PolylineColorAppearance:()=>tm,PolylineDashMaterialProperty:()=>Hl,PolylineGeometry:()=>b_,PolylineGeometryUpdater:()=>tTe,PolylineGlowMaterialProperty:()=>Ite,PolylineGraphics:()=>b2,PolylineMaterialAppearance:()=>M0,PolylineOutlineMaterialProperty:()=>SM,PolylinePipeline:()=>Zh,PolylineTrailLinkMaterialProperty:()=>JXe,PolylineVisualizer:()=>rTe,PolylineVolumeGeometry:()=>kEe,PolylineVolumeGeometryLibrary:()=>G5,PolylineVolumeGeometryUpdater:()=>zEe,PolylineVolumeGraphics:()=>xre,PolylineVolumeOutlineGeometry:()=>VEe,PositionProperty:()=>vY,PositionPropertyArray:()=>xH,PostProcessStage:()=>as,PostProcessStageCollection:()=>MSe,PostProcessStageComposite:()=>z0,PostProcessStageLibrary:()=>D0,PostProcessStageSampleMode:()=>zy,PostProcessStageTextureCache:()=>koe,Primitive:()=>Ia,PrimitiveCollection:()=>w_,PrimitiveLoadPlan:()=>rq,PrimitiveOutlineGenerator:()=>xne,PrimitiveOutlinePipelineStage:()=>Cwe,PrimitivePipeline:()=>S5,PrimitiveRenderResources:()=>Wwe,PrimitiveState:()=>Zp,PrimitiveStatisticsPipelineStage:()=>bwe,PrimitiveType:()=>Fn,ProjectionPicker:()=>LIe,ProjectionPickerViewModel:()=>DIe,Property:()=>vt,PropertyArray:()=>noe,PropertyAttribute:()=>vne,PropertyAttributeProperty:()=>Q1e,PropertyBag:()=>C2,PropertyTable:()=>pO,PropertyTexture:()=>_ne,PropertyTextureProperty:()=>J1e,ProviderViewModel:()=>$m,Proxy:()=>$rt,QuadraticRealPolynomial:()=>FE,QuadtreeOccluders:()=>Xre,QuadtreePrimitive:()=>hb,QuadtreePrimitivezh:()=>tJe,QuadtreeTile:()=>kY,QuadtreeTileLoadState:()=>Ch,QuadtreeTileProvider:()=>s4,QuantizedMeshTerrainData:()=>joe,QuarticRealPolynomial:()=>Uxe,Quaternion:()=>Gr,QuaternionSpline:()=>mbe,Queue:()=>R5,RasterizeHtml:()=>VU,Ray:()=>_s,Rectangle:()=>Di,RectangleCollisionChecker:()=>hoe,RectangleGeometry:()=>GB,RectangleGeometryLibrary:()=>y_,RectangleGeometryUpdater:()=>jEe,RectangleGraphics:()=>PU,RectangleOutlineGeometry:()=>kne,RectangularSensor:()=>Lj,RectangularSensorFS:()=>lie,RectangularSensorGraphics:()=>$ot,RectangularSensorPrimitive:()=>KPe,RectangularSensorScanPlaneFS:()=>JPe,RectangularSensorVS:()=>yae,RectangularSensorVisualizer:()=>QPe,ReferenceFrame:()=>om,ReferenceProperty:()=>PY,RegionPolygonTexture:()=>pPe,RegionTexture:()=>mPe,RegionWeather:()=>_ae,RenderEntity:()=>Wq,RenderObjectFactory:()=>ec,RenderState:()=>Mn,Renderbuffer:()=>N1,RenderbufferFormat:()=>aC,Request:()=>cg,RequestErrorEvent:()=>A5,RequestScheduler:()=>Rw,RequestState:()=>bc,RequestType:()=>Qy,ResetViewNavigationControl:()=>CPe,Resource:()=>Jr,ResourceCache:()=>id,ResourceCacheKey:()=>tA,ResourceCacheStatistics:()=>q1e,ResourceLoader:()=>W0,ResourceLoaderState:()=>la,Rotation:()=>S2,RuntimeError:()=>sr,S2Cell:()=>zz,S3MCacheFileRenderEntity:()=>Tj,S3MCompressType:()=>Jot,S3MContentFactory:()=>GPe,S3MContentParser:()=>WPe,S3MCreateIndexJob:()=>$Se,S3MCreateVertexJob:()=>QSe,S3MDataSource:()=>_Ze,S3MLayerCache:()=>jPe,S3MLayerScheduler:()=>YPe,S3MPixelFormat:()=>Kot,S3MTile:()=>XPe,S3MTilesFS:()=>JSe,S3MTilesLayer:()=>vae,S3MTilesVS:()=>XSe,S3ModelParser:()=>qPe,SDFSettings:()=>By,SampledPositionProperty:()=>ww,SampledProperty:()=>ZI,Sampler:()=>gs,ScaledPositionProperty:()=>DU,Scene:()=>r2e,SceneFramebuffer:()=>Roe,SceneMode:()=>_i,SceneMode2DPipelineStage:()=>wwe,SceneModePicker:()=>PIe,SceneModePickerViewModel:()=>SIe,SceneTransforms:()=>nl,SceneTransitioner:()=>FSe,ScreenSpaceCameraController:()=>GSe,ScreenSpaceEventHandler:()=>Ur,ScreenSpaceEventType:()=>Ei,SelectedFeatureIdPipelineStage:()=>lj,SelectionIndicator:()=>MIe,SelectionIndicatorViewModel:()=>IIe,Sensor:()=>Vot,ShaderBuilder:()=>Ine,ShaderCache:()=>IAe,ShaderDestination:()=>yr,ShaderFunction:()=>Nwe,ShaderProgram:()=>Rs,ShaderSource:()=>Zr,ShaderStruct:()=>Rwe,ShadowMap:()=>mD,ShadowMapShader:()=>p3,ShadowMode:()=>Cl,ShadowVolumeAppearance:()=>nM,ShowGeometryInstanceAttribute:()=>zu,Simon1994PlanetaryPositions:()=>cj,SimplePolylineGeometry:()=>ent,SingleTileImageryProvider:()=>EC,SkinningPipelineStage:()=>Ewe,SkyAtmosphere:()=>Yq,SkyBox:()=>r4,SlopeArrow:()=>Cae,SpatialNode:()=>sPe,SphereEmitter:()=>B6,SphereGeometry:()=>tnt,SphereOutlineGeometry:()=>YM,Spherical:()=>CEe,Spline:()=>gd,SplitDirection:()=>eD,Splitter:()=>lae,SpotLight:()=>yZe,StaticGeometryColorBatch:()=>eM,StaticGeometryPerMaterialBatch:()=>tM,StaticGroundGeometryColorBatch:()=>Nte,StaticGroundGeometryPerMaterialBatch:()=>YEe,StaticGroundPolylinePerMaterialBatch:()=>iTe,StaticOutlineGeometryBatch:()=>Fte,StencilConstants:()=>Ua,StencilFunction:()=>dc,StencilOperation:()=>No,SteppedSpline:()=>pbe,StripeMaterialProperty:()=>Mte,StripeOrientation:()=>F3,StructuralMetadata:()=>$M,StyleCommandsNeeded:()=>z5,StyleExpression:()=>Xnt,Sun:()=>n2e,SunLight:()=>l6,SunPostProcess:()=>YSe,SupportedImageFormats:()=>ibe,SvgPathBindingHandler:()=>$Pe,TaskProcessor:()=>tp,Terrain:()=>uPe,TerrainData:()=>WB,TerrainEncoding:()=>Hw,TerrainExaggeration:()=>V1,TerrainFillMesh:()=>Soe,TerrainFlatten:()=>xD,TerrainFlattenPolygonTexture:()=>gPe,TerrainMesh:()=>jB,TerrainOffsetProperty:()=>$ne,TerrainProvider:()=>Rv,TerrainQuantization:()=>Wy,TerrainRegionWeather:()=>VPe,TerrainState:()=>Ls,Texture:()=>_o,Texture3D:()=>BAe,TextureAtlas:()=>EW,TextureCache:()=>MAe,TextureMagnificationFilter:()=>Zu,TextureManager:()=>Nxe,TextureMinificationFilter:()=>Xa,TextureUniform:()=>Rxe,TextureWrap:()=>ha,TileAvailability:()=>m3,TileBoundingRegion:()=>rT,TileBoundingS2Cell:()=>fAe,TileBoundingSphere:()=>lD,TileBoundingVolume:()=>Jnt,TileCoordinatesImageryProvider:()=>oX,TileDiscardPolicy:()=>Knt,TileEdge:()=>Ss,TileImagery:()=>Eoe,TileMapServiceImageryProvider:()=>cb,TileMetadata:()=>lAe,TileOrientedBoundingBox:()=>M3,TileProviderError:()=>ld,TileReplacementQueue:()=>Kre,TileSelectionResult:()=>ba,TileState:()=>Qnt,Tileset3DTileContent:()=>Kwe,TilesetMetadata:()=>mAe,TilesetPipelineStage:()=>Ibe,TilesetRegionWeather:()=>kPe,TilingScheme:()=>int,TimeConstants:()=>lc,TimeDynamicImagery:()=>woe,TimeDynamicPointCloud:()=>uae,TimeInterval:()=>hl,TimeIntervalCollection:()=>Lv,TimeIntervalCollectionPositionProperty:()=>HH,TimeIntervalCollectionProperty:()=>CH,TimeStandard:()=>gu,Timeline:()=>NIe,TimelineHighlightRange:()=>RIe,TimelineTrack:()=>OIe,Tipsify:()=>Zxe,ToggleButtonViewModel:()=>Sz,Tonemapper:()=>oH,Transforms:()=>tn,TranslationRotationScale:()=>ob,TranslucentTileClassification:()=>iSe,TridiagonalSystemSolver:()=>wne,TrustedServers:()=>Gie,TweenCollection:()=>Hoe,UniformState:()=>LAe,UniformType:()=>Ra,UrlTemplateGeojsonProvider:()=>bZe,UrlTemplateImageryProvider:()=>Xv,UserInterfaceControl:()=>pae,Utils:()=>fT,VERSION:()=>Pat,VRButton:()=>VIe,VRButtonViewModel:()=>kIe,VRTheWorldTerrainProvider:()=>ant,VaryingType:()=>Nv,Vector3DTileBatch:()=>SH,Vector3DTileClampedPolylines:()=>iAe,Vector3DTileContent:()=>oAe,Vector3DTileGeometry:()=>YF,Vector3DTilePoints:()=>Qwe,Vector3DTilePolygons:()=>Zwe,Vector3DTilePolylines:()=>One,Vector3DTilePrimitive:()=>ene,VelocityOrientationProperty:()=>bEe,VelocityVectorProperty:()=>ooe,VertexArray:()=>Du,VertexArrayFacade:()=>oY,VertexAttributeSemantic:()=>fa,VertexCompressOption:()=>dw,VertexFormat:()=>un,VerticalOrigin:()=>so,VideoSynchronizer:()=>rnt,View:()=>E6,ViewShed:()=>Xot,ViewShedMap:()=>s6,ViewShedMapShader:()=>h3,Viewer:()=>Uae,ViewportQuad:()=>hae,Visibility:()=>Bl,Visualizer:()=>Jet,VolumeCloud:()=>bae,VoxelBoxShape:()=>Z5,VoxelContent:()=>G2e,VoxelCylinderShape:()=>$5,VoxelEllipsoidShape:()=>Zq,VoxelInspector:()=>BIe,VoxelInspectorViewModel:()=>FIe,VoxelPrimitive:()=>dae,VoxelProvider:()=>oot,VoxelRenderResources:()=>V2e,VoxelShape:()=>aot,VoxelShapeType:()=>Rh,VoxelTraversal:()=>nie,VulkanConstants:()=>snt,WallGeometry:()=>qEe,WallGeometryLibrary:()=>doe,WallGeometryUpdater:()=>JEe,WallGraphics:()=>CY,WallOutlineGeometry:()=>XEe,WaterFS:()=>qCe,WaterMaterialProperty:()=>IZe,WebGLConstants:()=>xi,WebMapServiceImageryProvider:()=>bO,WebMapTileServiceImageryProvider:()=>hP,WebMercatorProjection:()=>hd,WebMercatorTilingScheme:()=>Mm,WindingOrder:()=>K1,WireframeIndexGenerator:()=>Pne,WireframePipelineStage:()=>Swe,ZoomNavigationControl:()=>oie,_shadersAcesTonemappingStage:()=>sSe,_shadersAdditiveBlend:()=>WSe,_shadersAdjustTranslucentFS:()=>_te,_shadersAllMaterialAppearanceFS:()=>FCe,_shadersAllMaterialAppearanceVS:()=>BCe,_shadersAmbientOcclusionGenerate:()=>lSe,_shadersAmbientOcclusionModulate:()=>uSe,_shadersAspectRampMaterial:()=>o_e,_shadersAtmosphereCommon:()=>OH,_shadersBasicMaterialAppearanceFS:()=>kCe,_shadersBasicMaterialAppearanceVS:()=>VCe,_shadersBillboardCollectionFS:()=>_xe,_shadersBillboardCollectionVS:()=>vxe,_shadersBlackAndWhite:()=>cSe,_shadersBloomComposite:()=>hSe,_shadersBrdfLutGeneratorFS:()=>kAe,_shadersBrightPass:()=>jSe,_shadersBrightness:()=>dSe,_shadersBumpMapMaterial:()=>a_e,_shadersCPUStylingStageFS:()=>Qbe,_shadersCPUStylingStageVS:()=>Kbe,_shadersCheckFloatTexturePrecisionFS:()=>FZe,_shadersCheckerboardMaterial:()=>s_e,_shadersCloudCollectionFS:()=>VAe,_shadersCloudCollectionVS:()=>zAe,_shadersCloudNoiseFS:()=>HAe,_shadersCloudNoiseVS:()=>UAe,_shadersCompareAndPackTranslucentDepth:()=>GAe,_shadersCompositeOITFS:()=>WAe,_shadersCompositeTranslucentClassification:()=>cW,_shadersContrastBias:()=>fSe,_shadersCustomShaderStageFS:()=>ewe,_shadersCustomShaderStageVS:()=>$be,_shadersCzmBuiltins:()=>V7,_shadersDepthOfField:()=>pSe,_shadersDepthPlaneFS:()=>jAe,_shadersDepthPlaneVS:()=>YAe,_shadersDepthView:()=>mSe,_shadersDepthViewPacked:()=>zot,_shadersDotMaterial:()=>l_e,_shadersEdgeDetection:()=>gSe,_shadersElevationBandMaterial:()=>u_e,_shadersElevationContourMaterial:()=>c_e,_shadersElevationRampMaterial:()=>h_e,_shadersEllipsoidFS:()=>vte,_shadersEllipsoidSurfaceAppearanceFS:()=>UCe,_shadersEllipsoidSurfaceAppearanceVS:()=>GCe,_shadersEllipsoidVS:()=>yte,_shadersFXAA:()=>vSe,_shadersFXAA3_11:()=>qAe,_shadersFadeMaterial:()=>d_e,_shadersFeatureIdStageFS:()=>twe,_shadersFeatureIdStageVS:()=>iwe,_shadersFilmicTonemapping:()=>_Se,_shadersGaussianBlur1D:()=>Ej,_shadersGaussianBlur1DSun:()=>TSe,_shadersGeometryStageFS:()=>swe,_shadersGeometryStageVS:()=>lwe,_shadersGlobeFS:()=>XAe,_shadersGlobeVS:()=>JAe,_shadersGridMaterial:()=>f_e,_shadersGroundAtmosphere:()=>xte,_shadersHSBToRGB:()=>pye,_shadersHSLToRGB:()=>mye,_shadersImageBasedLightingStageFS:()=>Mbe,_shadersInstancingStageCommon:()=>Vbe,_shadersInstancingStageVS:()=>zbe,_shadersIntersectBox:()=>D2e,_shadersIntersectClippingPlanes:()=>M2e,_shadersIntersectCylinder:()=>L2e,_shadersIntersectDepth:()=>I2e,_shadersIntersectEllipsoid:()=>R2e,_shadersIntersection:()=>mW,_shadersIntersectionUtils:()=>P2e,_shadersLegacyInstancingStageVS:()=>Hbe,_shadersLensFlare:()=>ySe,_shadersLightingStageFS:()=>cwe,_shadersMaterialStageFS:()=>dwe,_shadersMegatexture:()=>k2e,_shadersMetadataStageFS:()=>rwe,_shadersMetadataStageVS:()=>nwe,_shadersModelClippingPlanesStageFS:()=>Fbe,_shadersModelColorStageFS:()=>Nbe,_shadersModelFS:()=>wbe,_shadersModelFlattenStageFS:()=>Ywe,_shadersModelFlattenStageVS:()=>jwe,_shadersModelSilhouetteStageFS:()=>Bwe,_shadersModelSilhouetteStageVS:()=>kwe,_shadersModelSplitterStageFS:()=>zwe,_shadersModelVS:()=>Abe,_shadersModifiedReinhardTonemapping:()=>xSe,_shadersMorphTargetsStageVS:()=>pwe,_shadersNightVision:()=>CSe,_shadersNormalMapMaterial:()=>p_e,_shadersOctahedralProjectionAtlasFS:()=>p1e,_shadersOctahedralProjectionFS:()=>m1e,_shadersOctahedralProjectionVS:()=>g1e,_shadersOctree:()=>B2e,_shadersPassThrough:()=>NM,_shadersPassThroughDepth:()=>Aj,_shadersPerInstanceColorAppearanceFS:()=>iCe,_shadersPerInstanceColorAppearanceVS:()=>rCe,_shadersPerInstanceFlatColorAppearanceFS:()=>lre,_shadersPerInstanceFlatColorAppearanceVS:()=>nCe,_shadersPointCloudEyeDomeLighting:()=>obe,_shadersPointCloudStylingStageVS:()=>_we,_shadersPointPrimitiveCollectionFS:()=>mz,_shadersPointPrimitiveCollectionVS:()=>Cxe,_shadersPolylineArrowMaterial:()=>m_e,_shadersPolylineColorAppearanceVS:()=>Xxe,_shadersPolylineCommon:()=>xB,_shadersPolylineDashMaterial:()=>g_e,_shadersPolylineFS:()=>ure,_shadersPolylineGlowMaterial:()=>__e,_shadersPolylineMaterialAppearanceVS:()=>Jxe,_shadersPolylineOutlineMaterial:()=>v_e,_shadersPolylineShadowVolumeFS:()=>Wxe,_shadersPolylineShadowVolumeMorphFS:()=>jxe,_shadersPolylineShadowVolumeMorphVS:()=>Yxe,_shadersPolylineShadowVolumeVS:()=>qxe,_shadersPolylineVS:()=>WCe,_shadersPostProcessRain:()=>Hot,_shadersPostProcessSnow:()=>Uot,_shadersPrimitiveOutlineStageFS:()=>xwe,_shadersPrimitiveOutlineStageVS:()=>ywe,_shadersRGBToHSB:()=>Hye,_shadersRGBToHSL:()=>Uye,_shadersRGBToXYZ:()=>Gye,_shadersReinhardTonemapping:()=>bSe,_shadersReprojectWebMercatorFS:()=>KAe,_shadersReprojectWebMercatorVS:()=>QAe,_shadersRimLightingMaterial:()=>y_e,_shadersSelectedFeatureIdStageCommon:()=>ute,_shadersShadowVolumeAppearanceFS:()=>dre,_shadersShadowVolumeAppearanceVS:()=>tCe,_shadersShadowVolumeFS:()=>RW,_shadersSilhouette:()=>wSe,_shadersSkinningStageVS:()=>Awe,_shadersSkyAtmosphereCommon:()=>Cte,_shadersSkyAtmosphereFS:()=>ZAe,_shadersSkyAtmosphereVS:()=>$Ae,_shadersSkyBoxFS:()=>eEe,_shadersSkyBoxVS:()=>tEe,_shadersSlopeRampMaterial:()=>x_e,_shadersStripeMaterial:()=>C_e,_shadersSunFS:()=>iEe,_shadersSunShaft:()=>Got,_shadersSunShaftHdr:()=>Wot,_shadersSunShaftModulate:()=>ESe,_shadersSunTextureFS:()=>rEe,_shadersSunTextureFS_v2:()=>BZe,_shadersSunVS:()=>aEe,_shadersSunVisibleFS:()=>nEe,_shadersSunVisibleShaft:()=>SSe,_shadersSunVisibleVS:()=>oEe,_shadersTexturedMaterialAppearanceFS:()=>zCe,_shadersTexturedMaterialAppearanceVS:()=>HCe,_shadersVector3DTileClampedPolylinesFS:()=>tAe,_shadersVector3DTileClampedPolylinesVS:()=>eAe,_shadersVector3DTilePolylinesVS:()=>$we,_shadersVectorTileVS:()=>Kee,_shadersViewportQuadFS:()=>sEe,_shadersViewportQuadVS:()=>Jne,_shadersVoxelFS:()=>T2e,_shadersVoxelVS:()=>S2e,_shadersWater:()=>b_e,_shadersXYZToRGB:()=>fxe,_shadersacesTonemapping:()=>kve,_shadersalphaWeight:()=>Vve,_shadersantialias:()=>zve,_shadersapproximateSphericalCoordinates:()=>Hve,_shadersbackFacing:()=>Uve,_shadersbranchFreeTernary:()=>Gve,_shaderscascadeColor:()=>Wve,_shaderscascadeDistance:()=>jve,_shaderscascadeMatrix:()=>Yve,_shaderscascadeWeights:()=>qve,_shaderscolumbusViewMorph:()=>Xve,_shaderscomputePosition:()=>Jve,_shadersconvertUvToBox:()=>O2e,_shadersconvertUvToCylinder:()=>N2e,_shadersconvertUvToEllipsoid:()=>F2e,_shaderscosineAndSine:()=>Kve,_shadersdecompressTextureCoordinates:()=>Qve,_shadersdefaultPbrMaterial:()=>Zve,_shadersdegreesPerRadian:()=>j_e,_shadersdepthClamp:()=>$ve,_shadersdepthRange:()=>Y_e,_shadersdepthRangeStruct:()=>Ive,_shaderseastNorthUpToEyeCoordinates:()=>eye,_shadersellipsoidContainsPoint:()=>tye,_shadersellipsoidWgs84TextureCoordinates:()=>iye,_shadersepsilon1:()=>q_e,_shadersepsilon2:()=>X_e,_shadersepsilon3:()=>J_e,_shadersepsilon4:()=>K_e,_shadersepsilon5:()=>Q_e,_shadersepsilon6:()=>Z_e,_shadersepsilon7:()=>$_e,_shadersequalsEpsilon:()=>rye,_shaderseyeOffset:()=>nye,_shaderseyeToWindowCoordinates:()=>oye,_shadersfastApproximateAtan:()=>aye,_shadersfog:()=>sye,_shadersgammaCorrect:()=>lye,_shadersgeodeticSurfaceNormal:()=>uye,_shadersgetDefaultMaterial:()=>cye,_shadersgetLambertDiffuse:()=>hye,_shadersgetSpecular:()=>dye,_shadersgetWaterNoise:()=>fye,_shadershue:()=>gye,_shadersinfinity:()=>eve,_shadersinverseGamma:()=>_ye,_shadersisEmpty:()=>vye,_shadersisFull:()=>yye,_shaderslatitudeToWebMercatorFraction:()=>xye,_shaderslineDistance:()=>bye,_shaderslinearToSrgb:()=>Cye,_shadersluminance:()=>wye,_shadersmaterial:()=>Mve,_shadersmaterialInput:()=>Dve,_shadersmetersPerPixel:()=>Aye,_shadersmodelMaterial:()=>Lve,_shadersmodelToWindowCoordinates:()=>Eye,_shadersmodelVertexOutput:()=>Rve,_shadersmultiplyWithColorBalance:()=>Tye,_shadersnearFarScalar:()=>Sye,_shadersoctDecode:()=>Pye,_shadersoneOverPi:()=>tve,_shadersoneOverTwoPi:()=>ive,_shaderspackDepth:()=>Iye,_shaderspassCesium3DTile:()=>rve,_shaderspassCesium3DTileClassification:()=>nve,_shaderspassCesium3DTileClassificationIgnoreShow:()=>ove,_shaderspassClassification:()=>ave,_shaderspassCompute:()=>sve,_shaderspassEnvironment:()=>lve,_shaderspassGlobe:()=>uve,_shaderspassOpaque:()=>cve,_shaderspassOverlay:()=>hve,_shaderspassTerrainClassification:()=>dve,_shaderspassTranslucent:()=>fve,_shaderspassVoxels:()=>pve,_shaderspbrLighting:()=>Mye,_shaderspbrMetallicRoughnessMaterial:()=>Dye,_shaderspbrParameters:()=>Ove,_shaderspbrSpecularGlossinessMaterial:()=>Lye,_shadersphong:()=>Rye,_shaderspi:()=>mve,_shaderspiOverFour:()=>gve,_shaderspiOverSix:()=>_ve,_shaderspiOverThree:()=>vve,_shaderspiOverTwo:()=>yve,_shadersplaneDistance:()=>Oye,_shaderspointAlongRay:()=>Nye,_shadersradiansPerDegree:()=>xve,_shadersray:()=>Nve,_shadersrayEllipsoidIntersectionInterval:()=>Fye,_shadersraySegment:()=>Fve,_shadersraySphereIntersectionInterval:()=>Bye,_shadersreadDepth:()=>kye,_shadersreadNonPerspective:()=>Vye,_shadersreverseLogDepth:()=>zye,_shadersround:()=>Wye,_shaderssampleOctahedralProjection:()=>jye,_shaderssaturation:()=>Yye,_shaderssceneMode2D:()=>Cve,_shaderssceneMode3D:()=>bve,_shaderssceneModeColumbusView:()=>wve,_shaderssceneModeMorphing:()=>Ave,_shadersshadowDepthCompare:()=>qye,_shadersshadowParameters:()=>Bve,_shadersshadowVisibility:()=>Xye,_shaderssignNotZero:()=>Jye,_shaderssolarRadius:()=>Eve,_shaderssphericalHarmonics:()=>Kye,_shaderssrgbToLinear:()=>Qye,_shaderstangentToEyeSpaceMatrix:()=>Zye,_shaderstextureCube:()=>$ye,_shadersthreePiOver2:()=>Tve,_shaderstransformPlane:()=>exe,_shaderstranslateRelativeToEye:()=>txe,_shaderstranslucentPhong:()=>ixe,_shaderstranspose:()=>rxe,_shaderstwoPi:()=>Sve,_shadersunpackDepth:()=>nxe,_shadersunpackFloat:()=>oxe,_shadersunpackUint:()=>axe,_shadersvalueTransform:()=>sxe,_shadersvertexLogDepth:()=>lxe,_shaderswebMercatorMaxLatitude:()=>Pve,_shaderswindowToEyeCoordinates:()=>uxe,_shaderswriteDepthClamp:()=>cxe,_shaderswriteLogDepth:()=>hxe,_shaderswriteNonPerspective:()=>dxe,addBuffer:()=>N1e,addDefaults:()=>S1e,addExtensionsRequired:()=>L1e,addExtensionsUsed:()=>DB,addPipelineExtras:()=>qY,addToArray:()=>F1,appendForwardSlash:()=>K0e,arrayRemoveDuplicates:()=>F0,barycentricCoordinates:()=>hre,binarySearch:()=>Wg,buildDrawCommand:()=>Pbe,buildModuleUrl:()=>Ms,buildVoxelDrawCommands:()=>H2e,clipper2lib:()=>MR,clone:()=>uo,combine:()=>va,computeFlyToLocationForRectangle:()=>tae,createBillboardPointCallback:()=>Rne,createBlurStage:()=>sie,createCommand:()=>Fl,createDefaultImageryProviderViewModels:()=>sIe,createDefaultTerrainProviderViewModels:()=>lIe,createEdgeStage:()=>U6,createElevationBandMaterial:()=>Pnt,createFragmentFromTemplate:()=>_Pe,createGooglePhotorealistic3DTileset:()=>Int,createGuid:()=>zl,createMaterialPropertyDescriptor:()=>A_,createOsmBuildings:()=>Mnt,createOsmBuildingsAsync:()=>Dnt,createPropertyDescriptor:()=>Oi,createRawPropertyDescriptor:()=>S1,createTangentSpaceDebugPrimitive:()=>Lnt,createTaskProcessorWorker:()=>eat,createUniform:()=>U_e,createUniformArray:()=>W_e,createWorldImagery:()=>Rnt,createWorldImageryAsync:()=>rH,createWorldTerrain:()=>Irt,createWorldTerrainAsync:()=>qoe,decodeGoogleEarthEnterpriseData:()=>p2e,decodeVectorPolylinePositions:()=>rAe,defaultValue:()=>Z,defer:()=>pd,defined:()=>N,demodernizeShader:()=>pxe,deprecationWarning:()=>mi,destroyObject:()=>kr,exportKml:()=>Get,fflate_module:()=>IPe,findAccessorMinMax:()=>JY,findContentMetadata:()=>Fne,findGroupMetadata:()=>Bne,findTileMetadata:()=>cAe,forEachTextureInMaterial:()=>lne,formatError:()=>XH,fragment:()=>Yot,freezeRenderState:()=>i7e,getAbsoluteUri:()=>$j,getAccessorByteStride:()=>fO,getBaseUri:()=>Z0e,getBinaryAccessor:()=>oM,getClipAndStyleCode:()=>$2e,getClippingFunction:()=>Iq,getComponentReader:()=>XY,getElement:()=>Uh,getExtensionFromUri:()=>Bie,getFilenameFromUri:()=>wY,getImageFromTypedArray:()=>Oxe,getImagePixels:()=>w5,getJsonFromTypedArray:()=>E_,getMagic:()=>HU,getStringFromTypedArray:()=>nP,getTimestamp:()=>$c,hasExtension:()=>Gh,heightReferenceOnEntityPropertyChanged:()=>yq,isBitSet:()=>X1,isBlobUri:()=>kie,isCrossOriginUrl:()=>Vie,isDataUri:()=>eY,isLeapYear:()=>cH,knockout:()=>br,knockout_3_5_1:()=>CD,knockout_es5:()=>ZPe,libgif:()=>r1e,loadAndExecuteScript:()=>zie,loadCRN:()=>jrt,loadCubeMap:()=>FAe,loadDDS:()=>Wie,loadImageFromTypedArray:()=>nne,loadKTX2:()=>$3,loadView:()=>fae,mergeSort:()=>A6,moveTechniqueRenderStates:()=>D1e,moveTechniquesToExtension:()=>R1e,numberOfComponentsForType:()=>MB,objFS:()=>OPe,objectToQuery:()=>Hie,oneTimeWarning:()=>Ba,packer:()=>kxe,parseBatchTable:()=>GU,parseBoundingVolumeSemantics:()=>X1e,parseDefines:()=>BPe,parseFeatureMetadataLegacy:()=>ebe,parseGlb:()=>I1e,parseResponseHeaders:()=>$0e,parseStructuralMetadata:()=>$1e,pointInsideTriangle:()=>Qrt,preprocess3DTileContent:()=>t6,processVoxelProperties:()=>z2e,queryToObject:()=>s2,rasterizeHTML_allinone:()=>f1e,readAccessorPacked:()=>F1e,removeExtension:()=>nj,removeExtensionsRequired:()=>P1e,removeExtensionsUsed:()=>sne,removePipelineExtras:()=>M1e,removeUnusedElements:()=>O1e,remove_primitive:()=>Dj,resizeImageToNextPowerOfTwo:()=>DW,sampleTerrain:()=>Aq,sampleTerrainMostDetailed:()=>xT,scaleToGeodeticSurface:()=>Yie,subdivideArray:()=>Kxe,subscribeAndEvaluate:()=>oC,svgCompassGyro:()=>wPe,svgCompassOuterRing:()=>bPe,svgCompassRotationMarker:()=>APe,svgReset:()=>yPe,turf:()=>ra,updateAccessorComponentTypes:()=>B1e,updateVersion:()=>k1e,usesExtension:()=>ug,vertex:()=>qot,viewerCesium3DTilesInspectorMixin:()=>wat,viewerCesiumInspectorMixin:()=>Aat,viewerCesiumNavigationMixin:()=>fot,viewerDragDropMixin:()=>Eat,viewerPerformanceWatchdogMixin:()=>Tat,viewerVoxelInspectorMixin:()=>Sat,webGLConstantToGlslType:()=>lnt,wrapFunction:()=>A2e,writeTextToCanvas:()=>gB});var e_t=Object.create,C8e=Object.defineProperty,t_t=Object.getOwnPropertyDescriptor,i_t=Object.getOwnPropertyNames,r_t=Object.getPrototypeOf,n_t=Object.prototype.hasOwnProperty,ZF=(o=>typeof Kb<"u"?Kb:typeof Proxy<"u"?new Proxy(o,{get:(f,m)=>(typeof Kb<"u"?Kb:f)[m]}):o)(function(o){if(typeof Kb<"u")return Kb.apply(this,arguments);throw new Error('Dynamic require of "'+o+'" is not supported')}),xt=(o,f)=>()=>(f||o((f={exports:{}}).exports,f),f.exports),o_t=(o,f,m,v)=>{if(f&&typeof f=="object"||typeof f=="function")for(let y of i_t(f))!n_t.call(o,y)&&y!==m&&C8e(o,y,{get:()=>f[y],enumerable:!(v=t_t(f,y))||v.enumerable});return o},dd=(o,f,m)=>(m=o!=null?e_t(r_t(o)):{},o_t(f||!o||!o.__esModule?C8e(m,"default",{value:o,enumerable:!0}):m,o)),d0e=xt((o,f)=>{var m=function(v){v==null&&(v=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,v.constructor==Array?this.init_by_array(v,v.length):this.init_seed(v)};m.prototype.init_seed=function(v){for(this.mt[0]=v>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((v&4294901760)>>>16)*1812433253<<16)+(v&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}},m.prototype.init_by_array=function(v,y){var x,C,w;for(this.init_seed(19650218),x=1,C=0,w=this.N>y?this.N:y;w;w--){var A=this.mt[x-1]^this.mt[x-1]>>>30;this.mt[x]=(this.mt[x]^(((A&4294901760)>>>16)*1664525<<16)+(A&65535)*1664525)+v[C]+C,this.mt[x]>>>=0,x++,C++,x>=this.N&&(this.mt[0]=this.mt[this.N-1],x=1),C>=y&&(C=0)}for(w=this.N-1;w;w--){var A=this.mt[x-1]^this.mt[x-1]>>>30;this.mt[x]=(this.mt[x]^(((A&4294901760)>>>16)*1566083941<<16)+(A&65535)*1566083941)-x,this.mt[x]>>>=0,x++,x>=this.N&&(this.mt[0]=this.mt[this.N-1],x=1)}this.mt[0]=2147483648},m.prototype.random_int=function(){var v,y=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var x;for(this.mti==this.N+1&&this.init_seed(5489),x=0;x>>1^y[v&1];for(;x>>1^y[v&1];v=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^v>>>1^y[v&1],this.mti=0}return v=this.mt[this.mti++],v^=v>>>11,v^=v<<7&2636928640,v^=v<<15&4022730752,v^=v>>>18,v>>>0},m.prototype.random_int31=function(){return this.random_int()>>>1},m.prototype.random_incl=function(){return this.random_int()*(1/4294967295)},m.prototype.random=function(){return this.random_int()*(1/4294967296)},m.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)},m.prototype.random_long=function(){var v=this.random_int()>>>5,y=this.random_int()>>>6;return(v*67108864+y)*(1/9007199254740992)},f.exports=m}),a_t=xt((o,f)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(m){var v=typeof o=="object"&&o&&!o.nodeType&&o,y=typeof f=="object"&&f&&!f.nodeType&&f,x=typeof global=="object"&&global;(x.global===x||x.window===x||x.self===x)&&(m=x);var C,w=2147483647,A=36,E=1,T=26,S=38,M=700,I=72,P=128,D="-",L=/^xn--/,R=/[^\x20-\x7E]/,O=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},k=A-E,U=Math.floor,G=String.fromCharCode,j;function q(ae){throw new RangeError(F[ae])}function J(ae,fe){for(var de=ae.length,ve=[];de--;)ve[de]=fe(ae[de]);return ve}function X(ae,fe){var de=ae.split("@"),ve="";de.length>1&&(ve=de[0]+"@",ae=de[1]),ae=ae.replace(O,".");var pe=ae.split("."),ce=J(pe,fe).join(".");return ve+ce}function Y(ae){for(var fe=[],de=0,ve=ae.length,pe,ce;de=55296&&pe<=56319&&de65535&&(fe-=65536,de+=G(fe>>>10&1023|55296),fe=56320|fe&1023),de+=G(fe),de}).join("")}function ee(ae){return ae-48<10?ae-22:ae-65<26?ae-65:ae-97<26?ae-97:A}function z(ae,fe){return ae+22+75*(ae<26)-((fe!=0)<<5)}function ie(ae,fe,de){var ve=0;for(ae=de?U(ae/M):ae>>1,ae+=U(ae/fe);ae>k*T>>1;ve+=A)ae=U(ae/k);return U(ve+(k+1)*ae/(ae+S))}function re(ae){var fe=[],de=ae.length,ve,pe=0,ce=P,he=I,Ce,Se,De,Oe,Ue,Xe,it,ut,at;for(Ce=ae.lastIndexOf(D),Ce<0&&(Ce=0),Se=0;Se=128&&q("not-basic"),fe.push(ae.charCodeAt(Se));for(De=Ce>0?Ce+1:0;De=de&&q("invalid-input"),it=ee(ae.charCodeAt(De++)),(it>=A||it>U((w-pe)/Ue))&&q("overflow"),pe+=it*Ue,ut=Xe<=he?E:Xe>=he+T?T:Xe-he,!(itU(w/at)&&q("overflow"),Ue*=at;ve=fe.length+1,he=ie(pe-Oe,ve,Oe==0),U(pe/ve)>w-ce&&q("overflow"),ce+=U(pe/ve),pe%=ve,fe.splice(pe++,0,ce)}return Q(fe)}function ne(ae){var fe,de,ve,pe,ce,he,Ce,Se,De,Oe,Ue,Xe=[],it,ut,at,Pt;for(ae=Y(ae),it=ae.length,fe=P,de=0,ce=I,he=0;he=fe&&UeU((w-de)/ut)&&q("overflow"),de+=(Ce-fe)*ut,fe=Ce,he=0;hew&&q("overflow"),Ue==fe){for(Se=de,De=A;Oe=De<=ce?E:De>=ce+T?T:De-ce,!(Se{/*! * URI.js - Mutating URLs * IPv6 Support * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */(function(m,v){"use strict";typeof f=="object"&&f.exports?f.exports=v():typeof define=="function"&&define.amd?define(v):m.IPv6=v(m)})(o,function(m){"use strict";var v=m&&m.IPv6;function y(C){var w=C.toLowerCase(),A=w.split(":"),E=A.length,T=8;A[0]===""&&A[1]===""&&A[2]===""?(A.shift(),A.shift()):A[0]===""&&A[1]===""?A.shift():A[E-1]===""&&A[E-2]===""&&A.pop(),E=A.length,A[E-1].indexOf(".")!==-1&&(T=7);var S;for(S=0;S1;P++)M.splice(0,1);A[I]=M.join("")}var D=-1,L=0,R=0,O=-1,F=!1;for(I=0;IL&&(D=O,L=R)):A[I]==="0"&&(F=!0,O=I,R=1);R>L&&(D=O,L=R),L>1&&A.splice(D,L,""),E=A.length;var k="";for(A[0]===""&&(k=":"),I=0;I{/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */(function(m,v){"use strict";typeof f=="object"&&f.exports?f.exports=v():typeof define=="function"&&define.amd?define(v):m.SecondLevelDomains=v(m)})(o,function(m){"use strict";var v=m&&m.SecondLevelDomains,y={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(x){var C=x.lastIndexOf(".");if(C<=0||C>=x.length-1)return!1;var w=x.lastIndexOf(".",C-1);if(w<=0||w>=C-1)return!1;var A=y.list[x.slice(C+1)];return A?A.indexOf(" "+x.slice(w+1,C)+" ")>=0:!1},is:function(x){var C=x.lastIndexOf(".");if(C<=0||C>=x.length-1)return!1;var w=x.lastIndexOf(".",C-1);if(w>=0)return!1;var A=y.list[x.slice(C+1)];return A?A.indexOf(" "+x.slice(0,C)+" ")>=0:!1},get:function(x){var C=x.lastIndexOf(".");if(C<=0||C>=x.length-1)return null;var w=x.lastIndexOf(".",C-1);if(w<=0||w>=C-1)return null;var A=y.list[x.slice(C+1)];return!A||A.indexOf(" "+x.slice(w+1,C)+" ")<0?null:x.slice(w+1)},noConflict:function(){return m.SecondLevelDomains===this&&(m.SecondLevelDomains=v),this}};return y})}),jw=xt((o,f)=>{/*! * URI.js - Mutating URLs * * Version: 1.19.11 * * Author: Rodney Rehm * Web: http://medialize.github.io/URI.js/ * * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * */(function(m,v){"use strict";typeof f=="object"&&f.exports?f.exports=v(a_t(),s_t(),l_t()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],v):m.URI=v(m.punycode,m.IPv6,m.SecondLevelDomains,m)})(o,function(m,v,y,x){"use strict";var C=x&&x.URI;function w(z,ie){var re=arguments.length>=1,ne=arguments.length>=2;if(!(this instanceof w))return re?ne?new w(z,ie):new w(z):new w;if(z===void 0){if(re)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?z=location.href+"":z=""}if(z===null&&re)throw new TypeError("null is not a valid argument for URI");return this.href(z),ie!==void 0?this.absoluteTo(ie):this}function A(z){return/^[0-9]+$/.test(z)}w.version="1.19.11";var E=w.prototype,T=Object.prototype.hasOwnProperty;function S(z){return z.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function M(z){return z===void 0?"Undefined":String(Object.prototype.toString.call(z)).slice(8,-1)}function I(z){return M(z)==="Array"}function P(z,ie){var re={},ne,oe;if(M(ie)==="RegExp")re=null;else if(I(ie))for(ne=0,oe=ie.length;ne]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,w.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},w.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,w.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,w.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},w.hostProtocols=["http","https"],w.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,w.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},w.getDomAttribute=function(z){if(!(!z||!z.nodeName)){var ie=z.nodeName.toLowerCase();if(!(ie==="input"&&z.type!=="image"))return w.domAttributes[ie]}};function O(z){return escape(z)}function F(z){return encodeURIComponent(z).replace(/[!'()*]/g,O).replace(/\*/g,"%2A")}w.encode=F,w.decode=decodeURIComponent,w.iso8859=function(){w.encode=escape,w.decode=unescape},w.unicode=function(){w.encode=F,w.decode=decodeURIComponent},w.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},w.encodeQuery=function(z,ie){var re=w.encode(z+"");return ie===void 0&&(ie=w.escapeQuerySpace),ie?re.replace(/%20/g,"+"):re},w.decodeQuery=function(z,ie){z+="",ie===void 0&&(ie=w.escapeQuerySpace);try{return w.decode(ie?z.replace(/\+/g,"%20"):z)}catch{return z}};var k={encode:"encode",decode:"decode"},U,G=function(z,ie){return function(re){try{return w[ie](re+"").replace(w.characters[z][ie].expression,function(ne){return w.characters[z][ie].map[ne]})}catch{return re}}};for(U in k)w[U+"PathSegment"]=G("pathname",k[U]),w[U+"UrnPathSegment"]=G("urnpath",k[U]);var j=function(z,ie,re){return function(ne){var oe;re?oe=function(de){return w[ie](w[re](de))}:oe=w[ie];for(var se=(ne+"").split(z),ae=0,fe=se.length;ae-1&&(ie.fragment=z.substring(re+1)||null,z=z.substring(0,re)),re=z.indexOf("?"),re>-1&&(ie.query=z.substring(re+1)||null,z=z.substring(0,re)),z=z.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),z=z.replace(/^[/\\]{2,}/i,"//"),z.substring(0,2)==="//"?(ie.protocol=null,z=z.substring(2),z=w.parseAuthority(z,ie)):(re=z.indexOf(":"),re>-1&&(ie.protocol=z.substring(0,re)||null,ie.protocol&&!ie.protocol.match(w.protocol_expression)?ie.protocol=void 0:z.substring(re+1,re+3).replace(/\\/g,"/")==="//"?(z=z.substring(re+3),z=w.parseAuthority(z,ie)):(z=z.substring(re+1),ie.urn=!0))),ie.path=z,ie},w.parseHost=function(z,ie){z||(z=""),z=z.replace(/\\/g,"/");var re=z.indexOf("/"),ne,oe;if(re===-1&&(re=z.length),z.charAt(0)==="[")ne=z.indexOf("]"),ie.hostname=z.substring(1,ne)||null,ie.port=z.substring(ne+2,re)||null,ie.port==="/"&&(ie.port=null);else{var se=z.indexOf(":"),ae=z.indexOf("/"),fe=z.indexOf(":",se+1);fe!==-1&&(ae===-1||fe-1?oe:z.length-1),ae;return se>-1&&(oe===-1||se-1?he=he.slice(0,Ce)+he.slice(Ce).replace(se,""):he=he.replace(se,""),!(he.length<=de[0].length)&&!(re.ignore&&re.ignore.test(he))){ce=ve+he.length;var Oe=ie(he,ve,ce,z);if(Oe===void 0){ne.lastIndex=ce;continue}Oe=String(Oe),z=z.slice(0,ve)+Oe+z.slice(ce),ne.lastIndex=ve+Oe.length}}return ne.lastIndex=0,z},w.ensureValidHostname=function(z,ie){var re=!!z,ne=!!ie,oe=!1;if(ne&&(oe=D(w.hostProtocols,ie)),oe&&!re)throw new TypeError("Hostname cannot be empty, if protocol is "+ie);if(z&&z.match(w.invalid_hostname_characters)){if(!m)throw new TypeError('Hostname "'+z+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(m.toASCII(z).match(w.invalid_hostname_characters))throw new TypeError('Hostname "'+z+'" contains characters other than [A-Z0-9.-:_]')}},w.ensureValidPort=function(z){if(z){var ie=Number(z);if(!(A(ie)&&ie>0&&ie<65536))throw new TypeError('Port "'+z+'" is not a valid port')}},w.noConflict=function(z){if(z){var ie={URI:this.noConflict()};return x.URITemplate&&typeof x.URITemplate.noConflict=="function"&&(ie.URITemplate=x.URITemplate.noConflict()),x.IPv6&&typeof x.IPv6.noConflict=="function"&&(ie.IPv6=x.IPv6.noConflict()),x.SecondLevelDomains&&typeof x.SecondLevelDomains.noConflict=="function"&&(ie.SecondLevelDomains=x.SecondLevelDomains.noConflict()),ie}else x.URI===this&&(x.URI=C);return this},E.build=function(z){return z===!0?this._deferred_build=!0:(z===void 0||this._deferred_build)&&(this._string=w.build(this._parts),this._deferred_build=!1),this},E.clone=function(){return new w(this)},E.valueOf=E.toString=function(){return this.build(!1)._string};function q(z){return function(ie,re){return ie===void 0?this._parts[z]||"":(this._parts[z]=ie||null,this.build(!re),this)}}function J(z,ie){return function(re,ne){return re===void 0?this._parts[z]||"":(re!==null&&(re=re+"",re.charAt(0)===ie&&(re=re.substring(1))),this._parts[z]=re,this.build(!ne),this)}}E.protocol=q("protocol"),E.username=q("username"),E.password=q("password"),E.hostname=q("hostname"),E.port=q("port"),E.query=J("query","?"),E.fragment=J("fragment","#"),E.search=function(z,ie){var re=this.query(z,ie);return typeof re=="string"&&re.length?"?"+re:re},E.hash=function(z,ie){var re=this.fragment(z,ie);return typeof re=="string"&&re.length?"#"+re:re},E.pathname=function(z,ie){if(z===void 0||z===!0){var re=this._parts.path||(this._parts.hostname?"/":"");return z?(this._parts.urn?w.decodeUrnPath:w.decodePath)(re):re}else return this._parts.urn?this._parts.path=z?w.recodeUrnPath(z):"":this._parts.path=z?w.recodePath(z):"/",this.build(!ie),this},E.path=E.pathname,E.href=function(z,ie){var re;if(z===void 0)return this.toString();this._string="",this._parts=w._parts();var ne=z instanceof w,oe=typeof z=="object"&&(z.hostname||z.path||z.pathname);if(z.nodeName){var se=w.getDomAttribute(z);z=z[se]||"",oe=!1}if(!ne&&oe&&z.pathname!==void 0&&(z=z.toString()),typeof z=="string"||z instanceof String)this._parts=w.parse(String(z),this._parts);else if(ne||oe){var ae=ne?z._parts:z;for(re in ae)re!=="query"&&T.call(this._parts,re)&&(this._parts[re]=ae[re]);ae.query&&this.query(ae.query,!1)}else throw new TypeError("invalid input");return this.build(!ie),this},E.is=function(z){var ie=!1,re=!1,ne=!1,oe=!1,se=!1,ae=!1,fe=!1,de=!this._parts.urn;switch(this._parts.hostname&&(de=!1,re=w.ip4_expression.test(this._parts.hostname),ne=w.ip6_expression.test(this._parts.hostname),ie=re||ne,oe=!ie,se=oe&&y&&y.has(this._parts.hostname),ae=oe&&w.idn_expression.test(this._parts.hostname),fe=oe&&w.punycode_expression.test(this._parts.hostname)),z.toLowerCase()){case"relative":return de;case"absolute":return!de;case"domain":case"name":return oe;case"sld":return se;case"ip":return ie;case"ip4":case"ipv4":case"inet4":return re;case"ip6":case"ipv6":case"inet6":return ne;case"idn":return ae;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return fe}return null};var X=E.protocol,Y=E.port,Q=E.hostname;E.protocol=function(z,ie){if(z&&(z=z.replace(/:(\/\/)?$/,""),!z.match(w.protocol_expression)))throw new TypeError('Protocol "'+z+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return X.call(this,z,ie)},E.scheme=E.protocol,E.port=function(z,ie){return this._parts.urn?z===void 0?"":this:(z!==void 0&&(z===0&&(z=null),z&&(z+="",z.charAt(0)===":"&&(z=z.substring(1)),w.ensureValidPort(z))),Y.call(this,z,ie))},E.hostname=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(z!==void 0){var re={preventInvalidHostname:this._parts.preventInvalidHostname},ne=w.parseHost(z,re);if(ne!=="/")throw new TypeError('Hostname "'+z+'" contains characters other than [A-Z0-9.-]');z=re.hostname,this._parts.preventInvalidHostname&&w.ensureValidHostname(z,this._parts.protocol)}return Q.call(this,z,ie)},E.origin=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(z===void 0){var re=this.protocol(),ne=this.authority();return ne?(re?re+"://":"")+this.authority():""}else{var oe=w(z);return this.protocol(oe.protocol()).authority(oe.authority()).build(!ie),this}},E.host=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(z===void 0)return this._parts.hostname?w.buildHost(this._parts):"";var re=w.parseHost(z,this._parts);if(re!=="/")throw new TypeError('Hostname "'+z+'" contains characters other than [A-Z0-9.-]');return this.build(!ie),this},E.authority=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(z===void 0)return this._parts.hostname?w.buildAuthority(this._parts):"";var re=w.parseAuthority(z,this._parts);if(re!=="/")throw new TypeError('Hostname "'+z+'" contains characters other than [A-Z0-9.-]');return this.build(!ie),this},E.userinfo=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(z===void 0){var re=w.buildUserinfo(this._parts);return re&&re.substring(0,re.length-1)}else return z[z.length-1]!=="@"&&(z+="@"),w.parseUserinfo(z,this._parts),this.build(!ie),this},E.resource=function(z,ie){var re;return z===void 0?this.path()+this.search()+this.hash():(re=w.parse(z),this._parts.path=re.path,this._parts.query=re.query,this._parts.fragment=re.fragment,this.build(!ie),this)},E.subdomain=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(z===void 0){if(!this._parts.hostname||this.is("IP"))return"";var re=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,re)||""}else{var ne=this._parts.hostname.length-this.domain().length,oe=this._parts.hostname.substring(0,ne),se=new RegExp("^"+S(oe));if(z&&z.charAt(z.length-1)!=="."&&(z+="."),z.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return z&&w.ensureValidHostname(z,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(se,z),this.build(!ie),this}},E.domain=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(typeof z=="boolean"&&(ie=z,z=void 0),z===void 0){if(!this._parts.hostname||this.is("IP"))return"";var re=this._parts.hostname.match(/\./g);if(re&&re.length<2)return this._parts.hostname;var ne=this._parts.hostname.length-this.tld(ie).length-1;return ne=this._parts.hostname.lastIndexOf(".",ne-1)+1,this._parts.hostname.substring(ne)||""}else{if(!z)throw new TypeError("cannot set domain empty");if(z.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(w.ensureValidHostname(z,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=z;else{var oe=new RegExp(S(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(oe,z)}return this.build(!ie),this}},E.tld=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(typeof z=="boolean"&&(ie=z,z=void 0),z===void 0){if(!this._parts.hostname||this.is("IP"))return"";var re=this._parts.hostname.lastIndexOf("."),ne=this._parts.hostname.substring(re+1);return ie!==!0&&y&&y.list[ne.toLowerCase()]&&y.get(this._parts.hostname)||ne}else{var oe;if(z)if(z.match(/[^a-zA-Z0-9-]/))if(y&&y.is(z))oe=new RegExp(S(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(oe,z);else throw new TypeError('TLD "'+z+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");oe=new RegExp(S(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(oe,z)}else throw new TypeError("cannot set TLD empty");return this.build(!ie),this}},E.directory=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(z===void 0||z===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var re=this._parts.path.length-this.filename().length-1,ne=this._parts.path.substring(0,re)||(this._parts.hostname?"/":"");return z?w.decodePath(ne):ne}else{var oe=this._parts.path.length-this.filename().length,se=this._parts.path.substring(0,oe),ae=new RegExp("^"+S(se));return this.is("relative")||(z||(z="/"),z.charAt(0)!=="/"&&(z="/"+z)),z&&z.charAt(z.length-1)!=="/"&&(z+="/"),z=w.recodePath(z),this._parts.path=this._parts.path.replace(ae,z),this.build(!ie),this}},E.filename=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(typeof z!="string"){if(!this._parts.path||this._parts.path==="/")return"";var re=this._parts.path.lastIndexOf("/"),ne=this._parts.path.substring(re+1);return z?w.decodePathSegment(ne):ne}else{var oe=!1;z.charAt(0)==="/"&&(z=z.substring(1)),z.match(/\.?\//)&&(oe=!0);var se=new RegExp(S(this.filename())+"$");return z=w.recodePath(z),this._parts.path=this._parts.path.replace(se,z),oe?this.normalizePath(ie):this.build(!ie),this}},E.suffix=function(z,ie){if(this._parts.urn)return z===void 0?"":this;if(z===void 0||z===!0){if(!this._parts.path||this._parts.path==="/")return"";var re=this.filename(),ne=re.lastIndexOf("."),oe,se;return ne===-1?"":(oe=re.substring(ne+1),se=/^[a-z0-9%]+$/i.test(oe)?oe:"",z?w.decodePathSegment(se):se)}else{z.charAt(0)==="."&&(z=z.substring(1));var ae=this.suffix(),fe;if(ae)z?fe=new RegExp(S(ae)+"$"):fe=new RegExp(S("."+ae)+"$");else{if(!z)return this;this._parts.path+="."+w.recodePath(z)}return fe&&(z=w.recodePath(z),this._parts.path=this._parts.path.replace(fe,z)),this.build(!ie),this}},E.segment=function(z,ie,re){var ne=this._parts.urn?":":"/",oe=this.path(),se=oe.substring(0,1)==="/",ae=oe.split(ne);if(z!==void 0&&typeof z!="number"&&(re=ie,ie=z,z=void 0),z!==void 0&&typeof z!="number")throw new Error('Bad segment "'+z+'", must be 0-based integer');if(se&&ae.shift(),z<0&&(z=Math.max(ae.length+z,0)),ie===void 0)return z===void 0?ae:ae[z];if(z===null||ae[z]===void 0)if(I(ie)){ae=[];for(var fe=0,de=ie.length;fe{"use strict";f.exports=v;var m=1e20;function v(C,w){w||(w={});var A=w.cutoff==null?.25:w.cutoff,E=w.radius==null?8:w.radius,T=w.channel||0,S,M,I,P,D,L,R,O,F,k,U;if(ArrayBuffer.isView(C)||Array.isArray(C)){if(!w.width||!w.height)throw Error("For raw data width and height should be provided by options");S=w.width,M=w.height,P=C,w.stride?L=w.stride:L=Math.floor(C.length/S/M)}else window.HTMLCanvasElement&&C instanceof window.HTMLCanvasElement?(O=C,R=O.getContext("2d"),S=O.width,M=O.height,F=R.getImageData(0,0,S,M),P=F.data,L=4):window.CanvasRenderingContext2D&&C instanceof window.CanvasRenderingContext2D?(O=C.canvas,R=C,S=O.width,M=O.height,F=R.getImageData(0,0,S,M),P=F.data,L=4):window.ImageData&&C instanceof window.ImageData&&(F=C,S=C.width,M=C.height,P=F.data,L=4);if(I=Math.max(S,M),window.Uint8ClampedArray&&P instanceof window.Uint8ClampedArray||window.Uint8Array&&P instanceof window.Uint8Array)for(D=P,P=Array(S*M),k=0,U=Math.floor(D.length/L);k{function m(){var v=0,y=1,x=2,C=3,w=4,A=5,E=6,T=7,S=8,M=9,I=10,P=11,D=12,L=13,R=14,O=15,F=16,k=17,U=0,G=1,j=2,q=3,J=4;function X(z,ie){return 55296<=z.charCodeAt(ie)&&z.charCodeAt(ie)<=56319&&56320<=z.charCodeAt(ie+1)&&z.charCodeAt(ie+1)<=57343}function Y(z,ie){ie===void 0&&(ie=0);var re=z.charCodeAt(ie);if(55296<=re&&re<=56319&&ie=1){var ne=z.charCodeAt(ie-1),oe=re;return 55296<=ne&&ne<=56319?(ne-55296)*1024+(oe-56320)+65536:oe}return re}function Q(z,ie,re){var ne=[z].concat(ie).concat([re]),oe=ne[ne.length-2],se=re,ae=ne.lastIndexOf(R);if(ae>1&&ne.slice(1,ae).every(function(ve){return ve==C})&&[C,L,k].indexOf(z)==-1)return j;var fe=ne.lastIndexOf(w);if(fe>0&&ne.slice(1,fe).every(function(ve){return ve==w})&&[D,w].indexOf(oe)==-1)return ne.filter(function(ve){return ve==w}).length%2==1?q:J;if(oe==v&&se==y)return U;if(oe==x||oe==v||oe==y)return se==R&&ie.every(function(ve){return ve==C})?j:G;if(se==x||se==v||se==y)return G;if(oe==E&&(se==E||se==T||se==M||se==I)||(oe==M||oe==T)&&(se==T||se==S)||(oe==I||oe==S)&&se==S||se==C||se==O||se==A||oe==D)return U;var de=ne.indexOf(C)!=-1?ne.lastIndexOf(C)-1:ne.length-2;return[L,k].indexOf(ne[de])!=-1&&ne.slice(de+1,-1).every(function(ve){return ve==C})&&se==R||oe==O&&[F,k].indexOf(se)!=-1?U:ie.indexOf(w)!=-1?j:oe==w&&se==w?U:G}this.nextBreak=function(z,ie){if(ie===void 0&&(ie=0),ie<0)return 0;if(ie>=z.length-1)return z.length;for(var re=ee(Y(z,ie)),ne=[],oe=ie+1;oe{var f;typeof window<"u"?f=window.__DEV__:typeof global<"u"&&(f=global.__DEV__),typeof f>"u"&&(f=!0);var m=f;o.__DEV__=m}),b8e=xt((o,f)=>{var m=2311;function v(){return m++}f.exports=v}),Tm=xt((o,f)=>{var m={};typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?m={browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:typeof document>"u"&&typeof self<"u"?m={browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:typeof navigator>"u"?m={browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:m=y(navigator.userAgent);var v=m;function y(x){var C={},w={},A=x.match(/Firefox\/([\d.]+)/),E=x.match(/MSIE\s([\d.]+)/)||x.match(/Trident\/.+?rv:(([\d.]+))/),T=x.match(/Edge\/([\d.]+)/),S=/micromessenger/i.test(x);return A&&(w.firefox=!0,w.version=A[1]),E&&(w.ie=!0,w.version=E[1]),T&&(w.edge=!0,w.version=T[1]),S&&(w.weChat=!0),{browser:w,os:C,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:typeof SVGRect<"u",touchEventsSupported:"ontouchstart"in window&&!w.ie&&!w.edge,pointerEventsSupported:"onpointerdown"in window&&(w.edge||w.ie&&w.version>=11),domSupported:typeof document<"u"}}f.exports=v}),Wi=xt(o=>{var f={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},m={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},v=Object.prototype.toString,y=Array.prototype,x=y.forEach,C=y.filter,w=y.slice,A=y.map,E=y.reduce,T={};function S(Qe,ft){Qe==="createCanvas"&&(O=null),T[Qe]=ft}function M(Qe){if(Qe==null||typeof Qe!="object")return Qe;var ft=Qe,Ot=v.call(Qe);if(Ot==="[object Array]"){if(!Xe(Qe)){ft=[];for(var Xt=0,At=Qe.length;Xt{var f=typeof Float32Array>"u"?Array:Float32Array;function m(Y,Q){var ee=new f(2);return Y==null&&(Y=0),Q==null&&(Q=0),ee[0]=Y,ee[1]=Q,ee}function v(Y,Q){return Y[0]=Q[0],Y[1]=Q[1],Y}function y(Y){var Q=new f(2);return Q[0]=Y[0],Q[1]=Y[1],Q}function x(Y,Q,ee){return Y[0]=Q,Y[1]=ee,Y}function C(Y,Q,ee){return Y[0]=Q[0]+ee[0],Y[1]=Q[1]+ee[1],Y}function w(Y,Q,ee,z){return Y[0]=Q[0]+ee[0]*z,Y[1]=Q[1]+ee[1]*z,Y}function A(Y,Q,ee){return Y[0]=Q[0]-ee[0],Y[1]=Q[1]-ee[1],Y}function E(Y){return Math.sqrt(S(Y))}var T=E;function S(Y){return Y[0]*Y[0]+Y[1]*Y[1]}var M=S;function I(Y,Q,ee){return Y[0]=Q[0]*ee[0],Y[1]=Q[1]*ee[1],Y}function P(Y,Q,ee){return Y[0]=Q[0]/ee[0],Y[1]=Q[1]/ee[1],Y}function D(Y,Q){return Y[0]*Q[0]+Y[1]*Q[1]}function L(Y,Q,ee){return Y[0]=Q[0]*ee,Y[1]=Q[1]*ee,Y}function R(Y,Q){var ee=E(Q);return ee===0?(Y[0]=0,Y[1]=0):(Y[0]=Q[0]/ee,Y[1]=Q[1]/ee),Y}function O(Y,Q){return Math.sqrt((Y[0]-Q[0])*(Y[0]-Q[0])+(Y[1]-Q[1])*(Y[1]-Q[1]))}var F=O;function k(Y,Q){return(Y[0]-Q[0])*(Y[0]-Q[0])+(Y[1]-Q[1])*(Y[1]-Q[1])}var U=k;function G(Y,Q){return Y[0]=-Q[0],Y[1]=-Q[1],Y}function j(Y,Q,ee,z){return Y[0]=Q[0]+z*(ee[0]-Q[0]),Y[1]=Q[1]+z*(ee[1]-Q[1]),Y}function q(Y,Q,ee){var z=Q[0],ie=Q[1];return Y[0]=ee[0]*z+ee[2]*ie+ee[4],Y[1]=ee[1]*z+ee[3]*ie+ee[5],Y}function J(Y,Q,ee){return Y[0]=Math.min(Q[0],ee[0]),Y[1]=Math.min(Q[1],ee[1]),Y}function X(Y,Q,ee){return Y[0]=Math.max(Q[0],ee[0]),Y[1]=Math.max(Q[1],ee[1]),Y}o.create=m,o.copy=v,o.clone=y,o.set=x,o.add=C,o.scaleAndAdd=w,o.sub=A,o.len=E,o.length=T,o.lenSquare=S,o.lengthSquare=M,o.mul=I,o.div=P,o.dot=D,o.scale=L,o.normalize=R,o.distance=O,o.dist=F,o.distanceSquare=k,o.distSquare=U,o.negate=G,o.lerp=j,o.applyTransform=q,o.min=J,o.max=X}),h_t=xt((o,f)=>{function m(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}m.prototype={constructor:m,_dragStart:function(x){for(var C=x.target;C&&!C.draggable;)C=C.parent;C&&(this._draggingTarget=C,C.dragging=!0,this._x=x.offsetX,this._y=x.offsetY,this.dispatchToElement(v(C,x),"dragstart",x.event))},_drag:function(x){var C=this._draggingTarget;if(C){var w=x.offsetX,A=x.offsetY,E=w-this._x,T=A-this._y;this._x=w,this._y=A,C.drift(E,T,x),this.dispatchToElement(v(C,x),"drag",x.event);var S=this.findHover(w,A,C).target,M=this._dropTarget;this._dropTarget=S,C!==S&&(M&&S!==M&&this.dispatchToElement(v(M,x),"dragleave",x.event),S&&S!==M&&this.dispatchToElement(v(S,x),"dragenter",x.event))}},_dragEnd:function(x){var C=this._draggingTarget;C&&(C.dragging=!1),this.dispatchToElement(v(C,x),"dragend",x.event),this._dropTarget&&this.dispatchToElement(v(this._dropTarget,x),"drop",x.event),this._draggingTarget=null,this._dropTarget=null}};function v(x,C){return{target:x,topTarget:C&&C.topTarget}}var y=m;f.exports=y}),iB=xt((o,f)=>{var m=Array.prototype.slice,v=function(w){this._$handlers={},this._$eventProcessor=w};v.prototype={constructor:v,one:function(w,A,E,T){return x(this,w,A,E,T,!0)},on:function(w,A,E,T){return x(this,w,A,E,T,!1)},isSilent:function(w){var A=this._$handlers;return!A[w]||!A[w].length},off:function(w,A){var E=this._$handlers;if(!w)return this._$handlers={},this;if(A){if(E[w]){for(var T=[],S=0,M=E[w].length;S3&&(T=m.call(T,1));for(var M=A.length,I=0;I4&&(T=m.call(T,1,T.length-1));for(var M=T[T.length-1],I=A.length,P=0;P{var f=Math.log(2);function m(y,x,C,w,A,E){var T=w+"-"+A,S=y.length;if(E.hasOwnProperty(T))return E[T];if(x===1){var M=Math.round(Math.log((1<{var f=Tm(),m=d_t(),v=m.buildTransformer,y="___zrEVENTSAVED",x=[];function C(S,M,I,P,D){return w(x,M,P,D,!0)&&w(S,I,x[0],x[1])}function w(S,M,I,P,D){if(M.getBoundingClientRect&&f.domSupported&&!T(M)){var L=M[y]||(M[y]={}),R=A(M,L),O=E(R,L,D);if(O)return O(S,I,P),!0}return!1}function A(S,M){var I=M.markers;if(I)return I;I=M.markers=[];for(var P=["left","right"],D=["top","bottom"],L=0;L<4;L++){var R=document.createElement("div"),O=R.style,F=L%2,k=(L>>1)%2;O.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",P[F]+":0",D[k]+":0",P[1-F]+":auto",D[1-k]+":auto",""].join("!important;"),S.appendChild(R),I.push(R)}return I}function E(S,M,I){for(var P=I?"invTrans":"trans",D=M[P],L=M.srcCoords,R=!0,O=[],F=[],k=0;k<4;k++){var U=S[k].getBoundingClientRect(),G=2*k,j=U.left,q=U.top;O.push(j,q),R=R&&L&&j===L[G]&&q===L[G+1],F.push(S[k].offsetLeft,S[k].offsetTop)}return R&&D?D:(M.srcCoords=O,M[P]=I?v(F,O):v(O,F))}function T(S){return S.nodeName.toUpperCase()==="CANVAS"}o.transformLocalCoord=C,o.transformCoordWithViewport=w,o.isCanvasEl=T}),B2=xt(o=>{var f=iB();o.Dispatcher=f;var m=Tm(),v=w8e(),y=v.isCanvasEl,x=v.transformCoordWithViewport,C=typeof window<"u"&&!!window.addEventListener,w=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,A=[];function E(O,F,k,U){return k=k||{},U||!m.canvasSupported?T(O,F,k):m.browser.firefox&&F.layerX!=null&&F.layerX!==F.offsetX?(k.zrX=F.layerX,k.zrY=F.layerY):F.offsetX!=null?(k.zrX=F.offsetX,k.zrY=F.offsetY):T(O,F,k),k}function T(O,F,k){if(m.domSupported&&O.getBoundingClientRect){var U=F.clientX,G=F.clientY;if(y(O)){var j=O.getBoundingClientRect();k.zrX=U-j.left,k.zrY=G-j.top;return}else if(x(A,O,U,G)){k.zrX=A[0],k.zrY=A[1];return}}k.zrX=k.zrY=0}function S(O){return O||window.event}function M(O,F,k){if(F=S(F),F.zrX!=null)return F;var U=F.type,G=U&&U.indexOf("touch")>=0;if(!G)E(O,F,F,k),F.zrDelta=F.wheelDelta?F.wheelDelta/120:-(F.detail||0)/3;else{var j=U!=="touchend"?F.targetTouches[0]:F.changedTouches[0];j&&E(O,j,F,k)}var q=F.button;return F.which==null&&q!==void 0&&w.test(F.type)&&(F.which=q&1?1:q&2?3:q&4?2:0),F}function I(O,F,k,U){C?O.addEventListener(F,k,U):O.attachEvent("on"+F,k)}function P(O,F,k,U){C?O.removeEventListener(F,k,U):O.detachEvent("on"+F,k)}var D=C?function(O){O.preventDefault(),O.stopPropagation(),O.cancelBubble=!0}:function(O){O.returnValue=!1,O.cancelBubble=!0};function L(O){return O.which===2||O.which===3}function R(O){return O.which>1}o.clientToLocal=E,o.getNativeEvent=S,o.normalizeEvent=M,o.addEventListener=I,o.removeEventListener=P,o.stop=D,o.isMiddleOrRightButtonOnMouseUpDown=L,o.notLeftMouse=R}),f_t=xt((o,f)=>{var m=B2(),v=function(){this._track=[]};v.prototype={constructor:v,recognize:function(A,E,T){return this._doTrack(A,E,T),this._recognize(A)},clear:function(){return this._track.length=0,this},_doTrack:function(A,E,T){var S=A.touches;if(S){for(var M={points:[],touches:[],target:E,event:A},I=0,P=S.length;I1&&S&&S.length>1){var I=y(S)/y(M);!isFinite(I)&&(I=1),E.pinchScale=I;var P=x(S);return E.pinchX=P[0],E.pinchY=P[1],{type:"pinch",target:A[0].target,event:E}}}}},w=v;f.exports=w}),p_t=xt((o,f)=>{var m=Wi(),v=lf(),y=h_t(),x=iB(),C=B2(),w=f_t(),A="silent";function E(R,O,F){return{type:R,event:F,target:O.target,topTarget:O.topTarget,cancelBubble:!1,offsetX:F.zrX,offsetY:F.zrY,gestureEvent:F.gestureEvent,pinchX:F.pinchX,pinchY:F.pinchY,pinchScale:F.pinchScale,wheelDelta:F.zrDelta,zrByTouch:F.zrByTouch,which:F.which,stop:T}}function T(){C.stop(this.event)}function S(){}S.prototype.dispose=function(){};var M=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],I=function(R,O,F,k){x.call(this),this.storage=R,this.painter=O,this.painterRoot=k,F=F||new S,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,y.call(this),this.setHandlerProxy(F)};I.prototype={constructor:I,setHandlerProxy:function(R){this.proxy&&this.proxy.dispose(),R&&(m.each(M,function(O){R.on&&R.on(O,this[O],this)},this),R.handler=this),this.proxy=R},mousemove:function(R){var O=R.zrX,F=R.zrY,k=D(this,O,F),U=this._hovered,G=U.target;G&&!G.__zr&&(U=this.findHover(U.x,U.y),G=U.target);var j=this._hovered=k?{x:O,y:F}:this.findHover(O,F),q=j.target,J=this.proxy;J.setCursor&&J.setCursor(q?q.cursor:"default"),G&&q!==G&&this.dispatchToElement(U,"mouseout",R),this.dispatchToElement(j,"mousemove",R),q&&q!==G&&this.dispatchToElement(j,"mouseover",R)},mouseout:function(R){var O=R.zrEventControl,F=R.zrIsToLocalDOM;O!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",R),O!=="no_globalout"&&!F&&this.trigger("globalout",{type:"globalout",event:R})},resize:function(R){this._hovered={}},dispatch:function(R,O){var F=this[R];F&&F.call(this,O)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(R){var O=this.proxy;O.setCursor&&O.setCursor(R)},dispatchToElement:function(R,O,F){R=R||{};var k=R.target;if(!(k&&k.silent)){for(var U="on"+O,G=E(O,R,F);k&&(k[U]&&(G.cancelBubble=k[U].call(k,G)),k.trigger(O,G),k=k.parent,!G.cancelBubble););G.cancelBubble||(this.trigger(O,G),this.painter&&this.painter.eachOtherLayer(function(j){typeof j[U]=="function"&&j[U].call(j,G),j.trigger&&j.trigger(O,G)}))}},findHover:function(R,O,F){for(var k=this.storage.getDisplayList(),U={x:R,y:O},G=k.length-1;G>=0;G--){var j;if(k[G]!==F&&!k[G].ignore&&(j=P(k[G],R,O))&&(!U.topTarget&&(U.topTarget=k[G]),j!==A)){U.target=k[G];break}}return U},processGesture:function(R,O){this._gestureMgr||(this._gestureMgr=new w);var F=this._gestureMgr;O==="start"&&F.clear();var k=F.recognize(R,this.findHover(R.zrX,R.zrY,null).target,this.proxy.dom);if(O==="end"&&F.clear(),k){var U=k.type;R.gestureEvent=U,this.dispatchToElement({target:k.target},U,k.event)}}},m.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(R){I.prototype[R]=function(O){var F=O.zrX,k=O.zrY,U=D(this,F,k),G,j;if((R!=="mouseup"||!U)&&(G=this.findHover(F,k),j=G.target),R==="mousedown")this._downEl=j,this._downPoint=[O.zrX,O.zrY],this._upEl=j;else if(R==="mouseup")this._upEl=j;else if(R==="click"){if(this._downEl!==this._upEl||!this._downPoint||v.dist(this._downPoint,[O.zrX,O.zrY])>4)return;this._downPoint=null}this.dispatchToElement(G,R,O)}});function P(R,O,F){if(R[R.rectHover?"rectContain":"contain"](O,F)){for(var k=R,U;k;){if(k.clipPath&&!k.clipPath.contain(O,F))return!1;k.silent&&(U=!0),k=k.parent}return U?A:!0}return!1}function D(R,O,F){var k=R.painter;return O<0||O>k.getWidth()||F<0||F>k.getHeight()}m.mixin(I,x),m.mixin(I,y);var L=I;f.exports=L}),Ky=xt(o=>{var f=typeof Float32Array>"u"?Array:Float32Array;function m(){var S=new f(6);return v(S),S}function v(S){return S[0]=1,S[1]=0,S[2]=0,S[3]=1,S[4]=0,S[5]=0,S}function y(S,M){return S[0]=M[0],S[1]=M[1],S[2]=M[2],S[3]=M[3],S[4]=M[4],S[5]=M[5],S}function x(S,M,I){var P=M[0]*I[0]+M[2]*I[1],D=M[1]*I[0]+M[3]*I[1],L=M[0]*I[2]+M[2]*I[3],R=M[1]*I[2]+M[3]*I[3],O=M[0]*I[4]+M[2]*I[5]+M[4],F=M[1]*I[4]+M[3]*I[5]+M[5];return S[0]=P,S[1]=D,S[2]=L,S[3]=R,S[4]=O,S[5]=F,S}function C(S,M,I){return S[0]=M[0],S[1]=M[1],S[2]=M[2],S[3]=M[3],S[4]=M[4]+I[0],S[5]=M[5]+I[1],S}function w(S,M,I){var P=M[0],D=M[2],L=M[4],R=M[1],O=M[3],F=M[5],k=Math.sin(I),U=Math.cos(I);return S[0]=P*U+R*k,S[1]=-P*k+R*U,S[2]=D*U+O*k,S[3]=-D*k+U*O,S[4]=U*L+k*F,S[5]=U*F-k*L,S}function A(S,M,I){var P=I[0],D=I[1];return S[0]=M[0]*P,S[1]=M[1]*D,S[2]=M[2]*P,S[3]=M[3]*D,S[4]=M[4]*P,S[5]=M[5]*D,S}function E(S,M){var I=M[0],P=M[2],D=M[4],L=M[1],R=M[3],O=M[5],F=I*R-L*P;return F?(F=1/F,S[0]=R*F,S[1]=-L*F,S[2]=-P*F,S[3]=I*F,S[4]=(P*O-R*D)*F,S[5]=(L*D-I*O)*F,S):null}function T(S){var M=m();return y(M,S),M}o.create=m,o.identity=v,o.copy=y,o.mul=x,o.translate=C,o.rotate=w,o.scale=A,o.invert=E,o.clone=T}),vie=xt((o,f)=>{var m=Ky(),v=lf(),y=m.identity,x=5e-5;function C(I){return I>x||I<-x}var w=function(I){I=I||{},I.position||(this.position=[0,0]),I.rotation==null&&(this.rotation=0),I.scale||(this.scale=[1,1]),this.origin=this.origin||null},A=w.prototype;A.transform=null,A.needLocalTransform=function(){return C(this.rotation)||C(this.position[0])||C(this.position[1])||C(this.scale[0]-1)||C(this.scale[1]-1)};var E=[];A.updateTransform=function(){var I=this.parent,P=I&&I.transform,D=this.needLocalTransform(),L=this.transform;if(!(D||P)){L&&y(L);return}L=L||m.create(),D?this.getLocalTransform(L):y(L),P&&(D?m.mul(L,I.transform,L):m.copy(L,I.transform)),this.transform=L;var R=this.globalScaleRatio;if(R!=null&&R!==1){this.getGlobalScale(E);var O=E[0]<0?-1:1,F=E[1]<0?-1:1,k=((E[0]-O)*R+O)/E[0]||0,U=((E[1]-F)*R+F)/E[1]||0;L[0]*=k,L[1]*=k,L[2]*=U,L[3]*=U}this.invTransform=this.invTransform||m.create(),m.invert(this.invTransform,L)},A.getLocalTransform=function(I){return w.getLocalTransform(this,I)},A.setTransform=function(I){var P=this.transform,D=I.dpr||1;P?I.setTransform(D*P[0],D*P[1],D*P[2],D*P[3],D*P[4],D*P[5]):I.setTransform(D,0,0,D,0,0)},A.restoreTransform=function(I){var P=I.dpr||1;I.setTransform(P,0,0,P,0,0)};var T=[],S=m.create();A.setLocalTransform=function(I){if(I){var P=I[0]*I[0]+I[1]*I[1],D=I[2]*I[2]+I[3]*I[3],L=this.position,R=this.scale;C(P-1)&&(P=Math.sqrt(P)),C(D-1)&&(D=Math.sqrt(D)),I[0]<0&&(P=-P),I[3]<0&&(D=-D),L[0]=I[4],L[1]=I[5],R[0]=P,R[1]=D,this.rotation=Math.atan2(-I[1]/D,I[0]/P)}},A.decomposeTransform=function(){if(this.transform){var I=this.parent,P=this.transform;I&&I.transform&&(m.mul(T,I.invTransform,P),P=T);var D=this.origin;D&&(D[0]||D[1])&&(S[4]=D[0],S[5]=D[1],m.mul(T,P,S),T[4]-=D[0],T[5]-=D[1],P=T),this.setLocalTransform(P)}},A.getGlobalScale=function(I){var P=this.transform;return I=I||[],P?(I[0]=Math.sqrt(P[0]*P[0]+P[1]*P[1]),I[1]=Math.sqrt(P[2]*P[2]+P[3]*P[3]),P[0]<0&&(I[0]=-I[0]),P[3]<0&&(I[1]=-I[1]),I):(I[0]=1,I[1]=1,I)},A.transformCoordToLocal=function(I,P){var D=[I,P],L=this.invTransform;return L&&v.applyTransform(D,D,L),D},A.transformCoordToGlobal=function(I,P){var D=[I,P],L=this.transform;return L&&v.applyTransform(D,D,L),D},w.getLocalTransform=function(I,P){P=P||[],y(P);var D=I.origin,L=I.scale||[1,1],R=I.rotation||0,O=I.position||[0,0];return D&&(P[4]-=D[0],P[5]-=D[1]),m.scale(P,P,L),R&&m.rotate(P,P,R),D&&(P[4]+=D[0],P[5]+=D[1]),P[4]+=O[0],P[5]+=O[1],P};var M=w;f.exports=M}),m_t=xt((o,f)=>{var m={linear:function(y){return y},quadraticIn:function(y){return y*y},quadraticOut:function(y){return y*(2-y)},quadraticInOut:function(y){return(y*=2)<1?.5*y*y:-.5*(--y*(y-2)-1)},cubicIn:function(y){return y*y*y},cubicOut:function(y){return--y*y*y+1},cubicInOut:function(y){return(y*=2)<1?.5*y*y*y:.5*((y-=2)*y*y+2)},quarticIn:function(y){return y*y*y*y},quarticOut:function(y){return 1- --y*y*y*y},quarticInOut:function(y){return(y*=2)<1?.5*y*y*y*y:-.5*((y-=2)*y*y*y-2)},quinticIn:function(y){return y*y*y*y*y},quinticOut:function(y){return--y*y*y*y*y+1},quinticInOut:function(y){return(y*=2)<1?.5*y*y*y*y*y:.5*((y-=2)*y*y*y*y+2)},sinusoidalIn:function(y){return 1-Math.cos(y*Math.PI/2)},sinusoidalOut:function(y){return Math.sin(y*Math.PI/2)},sinusoidalInOut:function(y){return .5*(1-Math.cos(Math.PI*y))},exponentialIn:function(y){return y===0?0:Math.pow(1024,y-1)},exponentialOut:function(y){return y===1?1:1-Math.pow(2,-10*y)},exponentialInOut:function(y){return y===0?0:y===1?1:(y*=2)<1?.5*Math.pow(1024,y-1):.5*(-Math.pow(2,-10*(y-1))+2)},circularIn:function(y){return 1-Math.sqrt(1-y*y)},circularOut:function(y){return Math.sqrt(1- --y*y)},circularInOut:function(y){return(y*=2)<1?-.5*(Math.sqrt(1-y*y)-1):.5*(Math.sqrt(1-(y-=2)*y)+1)},elasticIn:function(y){var x,C=.1,w=.4;return y===0?0:y===1?1:(!C||C<1?(C=1,x=w/4):x=w*Math.asin(1/C)/(2*Math.PI),-(C*Math.pow(2,10*(y-=1))*Math.sin((y-x)*(2*Math.PI)/w)))},elasticOut:function(y){var x,C=.1,w=.4;return y===0?0:y===1?1:(!C||C<1?(C=1,x=w/4):x=w*Math.asin(1/C)/(2*Math.PI),C*Math.pow(2,-10*y)*Math.sin((y-x)*(2*Math.PI)/w)+1)},elasticInOut:function(y){var x,C=.1,w=.4;return y===0?0:y===1?1:(!C||C<1?(C=1,x=w/4):x=w*Math.asin(1/C)/(2*Math.PI),(y*=2)<1?-.5*(C*Math.pow(2,10*(y-=1))*Math.sin((y-x)*(2*Math.PI)/w)):C*Math.pow(2,-10*(y-=1))*Math.sin((y-x)*(2*Math.PI)/w)*.5+1)},backIn:function(y){var x=1.70158;return y*y*((x+1)*y-x)},backOut:function(y){var x=1.70158;return--y*y*((x+1)*y+x)+1},backInOut:function(y){var x=2.5949095;return(y*=2)<1?.5*(y*y*((x+1)*y-x)):.5*((y-=2)*y*((x+1)*y+x)+2)},bounceIn:function(y){return 1-m.bounceOut(1-y)},bounceOut:function(y){return y<.36363636363636365?7.5625*y*y:y<.7272727272727273?7.5625*(y-=.5454545454545454)*y+.75:y<.9090909090909091?7.5625*(y-=.8181818181818182)*y+.9375:7.5625*(y-=.9545454545454546)*y+.984375},bounceInOut:function(y){return y<.5?m.bounceIn(y*2)*.5:m.bounceOut(y*2-1)*.5+.5}},v=m;f.exports=v}),g_t=xt((o,f)=>{var m=m_t();function v(x){this._target=x.target,this._life=x.life||1e3,this._delay=x.delay||0,this._initialized=!1,this.loop=x.loop==null?!1:x.loop,this.gap=x.gap||0,this.easing=x.easing||"Linear",this.onframe=x.onframe,this.ondestroy=x.ondestroy,this.onrestart=x.onrestart,this._pausedTime=0,this._paused=!1}v.prototype={constructor:v,step:function(x,C){if(this._initialized||(this._startTime=x+this._delay,this._initialized=!0),this._paused){this._pausedTime+=C;return}var w=(x-this._startTime-this._pausedTime)/this._life;if(!(w<0)){w=Math.min(w,1);var A=this.easing,E=typeof A=="string"?m[A]:A,T=typeof E=="function"?E(w):w;return this.fire("frame",T),w===1?this.loop?(this.restart(x),"restart"):(this._needsRemove=!0,"destroy"):null}},restart:function(x){var C=(x-this._startTime-this._pausedTime)%this._life;this._startTime=x-C+this.gap,this._pausedTime=0,this._needsRemove=!1},fire:function(x,C){x="on"+x,this[x]&&this[x](this._target,C)},pause:function(){this._paused=!0},resume:function(){this._paused=!1}};var y=v;f.exports=y}),A8e=xt((o,f)=>{var m=function(){this.head=null,this.tail=null,this._len=0},v=m.prototype;v.insert=function(A){var E=new y(A);return this.insertEntry(E),E},v.insertEntry=function(A){this.head?(this.tail.next=A,A.prev=this.tail,A.next=null,this.tail=A):this.head=this.tail=A,this._len++},v.remove=function(A){var E=A.prev,T=A.next;E?E.next=T:this.head=T,T?T.prev=E:this.tail=E,A.next=A.prev=null,this._len--},v.len=function(){return this._len},v.clear=function(){this.head=this.tail=null,this._len=0};var y=function(A){this.value=A,this.next,this.prev},x=function(A){this._list=new m,this._map={},this._maxSize=A||10,this._lastRemovedEntry=null},C=x.prototype;C.put=function(A,E){var T=this._list,S=this._map,M=null;if(S[A]==null){var I=T.len(),P=this._lastRemovedEntry;if(I>=this._maxSize&&I>0){var D=T.head;T.remove(D),delete S[D.key],M=D.value,this._lastRemovedEntry=D}P?P.value=E:P=new y(E),P.key=A,T.insertEntry(P),S[A]=P}return M},C.get=function(A){var E=this._map[A],T=this._list;if(E!=null)return E!==T.tail&&(T.remove(E),T.insertEntry(E)),E.value},C.clear=function(){this._list.clear(),this._map={}};var w=x;f.exports=w}),k2=xt(o=>{var f=A8e(),m={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function v(Y){return Y=Math.round(Y),Y<0?0:Y>255?255:Y}function y(Y){return Y=Math.round(Y),Y<0?0:Y>360?360:Y}function x(Y){return Y<0?0:Y>1?1:Y}function C(Y){return Y.length&&Y.charAt(Y.length-1)==="%"?v(parseFloat(Y)/100*255):v(parseInt(Y,10))}function w(Y){return Y.length&&Y.charAt(Y.length-1)==="%"?x(parseFloat(Y)/100):x(parseFloat(Y))}function A(Y,Q,ee){return ee<0?ee+=1:ee>1&&(ee-=1),ee*6<1?Y+(Q-Y)*ee*6:ee*2<1?Q:ee*3<2?Y+(Q-Y)*(2/3-ee)*6:Y}function E(Y,Q,ee){return Y+(Q-Y)*ee}function T(Y,Q,ee,z,ie){return Y[0]=Q,Y[1]=ee,Y[2]=z,Y[3]=ie,Y}function S(Y,Q){return Y[0]=Q[0],Y[1]=Q[1],Y[2]=Q[2],Y[3]=Q[3],Y}var M=new f(20),I=null;function P(Y,Q){I&&S(I,Q),I=M.put(Y,I||Q.slice())}function D(Y,Q){if(Y){Q=Q||[];var ee=M.get(Y);if(ee)return S(Q,ee);Y=Y+"";var z=Y.replace(/ /g,"").toLowerCase();if(z in m)return S(Q,m[z]),P(Y,Q),Q;if(z.charAt(0)==="#"){if(z.length===4){var ie=parseInt(z.substr(1),16);if(!(ie>=0&&ie<=4095)){T(Q,0,0,0,1);return}return T(Q,(ie&3840)>>4|(ie&3840)>>8,ie&240|(ie&240)>>4,ie&15|(ie&15)<<4,1),P(Y,Q),Q}else if(z.length===7){var ie=parseInt(z.substr(1),16);if(!(ie>=0&&ie<=16777215)){T(Q,0,0,0,1);return}return T(Q,(ie&16711680)>>16,(ie&65280)>>8,ie&255,1),P(Y,Q),Q}return}var re=z.indexOf("("),ne=z.indexOf(")");if(re!==-1&&ne+1===z.length){var oe=z.substr(0,re),se=z.substr(re+1,ne-(re+1)).split(","),ae=1;switch(oe){case"rgba":if(se.length!==4){T(Q,0,0,0,1);return}ae=w(se.pop());case"rgb":if(se.length!==3){T(Q,0,0,0,1);return}return T(Q,C(se[0]),C(se[1]),C(se[2]),ae),P(Y,Q),Q;case"hsla":if(se.length!==4){T(Q,0,0,0,1);return}return se[3]=w(se[3]),L(se,Q),P(Y,Q),Q;case"hsl":if(se.length!==3){T(Q,0,0,0,1);return}return L(se,Q),P(Y,Q),Q;default:return}}T(Q,0,0,0,1)}}function L(Y,Q){var ee=(parseFloat(Y[0])%360+360)%360/360,z=w(Y[1]),ie=w(Y[2]),re=ie<=.5?ie*(z+1):ie+z-ie*z,ne=ie*2-re;return Q=Q||[],T(Q,v(A(ne,re,ee+1/3)*255),v(A(ne,re,ee)*255),v(A(ne,re,ee-1/3)*255),1),Y.length===4&&(Q[3]=Y[3]),Q}function R(Y){if(Y){var Q=Y[0]/255,ee=Y[1]/255,z=Y[2]/255,ie=Math.min(Q,ee,z),re=Math.max(Q,ee,z),ne=re-ie,oe=(re+ie)/2,se,ae;if(ne===0)se=0,ae=0;else{oe<.5?ae=ne/(re+ie):ae=ne/(2-re-ie);var fe=((re-Q)/6+ne/2)/ne,de=((re-ee)/6+ne/2)/ne,ve=((re-z)/6+ne/2)/ne;Q===re?se=ve-de:ee===re?se=1/3+fe-ve:z===re&&(se=2/3+de-fe),se<0&&(se+=1),se>1&&(se-=1)}var pe=[se*360,ae,oe];return Y[3]!=null&&pe.push(Y[3]),pe}}function O(Y,Q){var ee=D(Y);if(ee){for(var z=0;z<3;z++)Q<0?ee[z]=ee[z]*(1-Q)|0:ee[z]=(255-ee[z])*Q+ee[z]|0,ee[z]>255?ee[z]=255:Y[z]<0&&(ee[z]=0);return X(ee,ee.length===4?"rgba":"rgb")}}function F(Y){var Q=D(Y);if(Q)return((1<<24)+(Q[0]<<16)+(Q[1]<<8)+ +Q[2]).toString(16).slice(1)}function k(Y,Q,ee){if(!(!(Q&&Q.length)||!(Y>=0&&Y<=1))){ee=ee||[];var z=Y*(Q.length-1),ie=Math.floor(z),re=Math.ceil(z),ne=Q[ie],oe=Q[re],se=z-ie;return ee[0]=v(E(ne[0],oe[0],se)),ee[1]=v(E(ne[1],oe[1],se)),ee[2]=v(E(ne[2],oe[2],se)),ee[3]=x(E(ne[3],oe[3],se)),ee}}var U=k;function G(Y,Q,ee){if(!(!(Q&&Q.length)||!(Y>=0&&Y<=1))){var z=Y*(Q.length-1),ie=Math.floor(z),re=Math.ceil(z),ne=D(Q[ie]),oe=D(Q[re]),se=z-ie,ae=X([v(E(ne[0],oe[0],se)),v(E(ne[1],oe[1],se)),v(E(ne[2],oe[2],se)),x(E(ne[3],oe[3],se))],"rgba");return ee?{color:ae,leftIndex:ie,rightIndex:re,value:z}:ae}}var j=G;function q(Y,Q,ee,z){if(Y=D(Y),Y)return Y=R(Y),Q!=null&&(Y[0]=y(Q)),ee!=null&&(Y[1]=w(ee)),z!=null&&(Y[2]=w(z)),X(L(Y),"rgba")}function J(Y,Q){if(Y=D(Y),Y&&Q!=null)return Y[3]=x(Q),X(Y,"rgba")}function X(Y,Q){if(!(!Y||!Y.length)){var ee=Y[0]+","+Y[1]+","+Y[2];return(Q==="rgba"||Q==="hsva"||Q==="hsla")&&(ee+=","+Y[3]),Q+"("+ee+")"}}o.parse=D,o.lift=O,o.toHex=F,o.fastLerp=k,o.fastMapToColor=U,o.lerp=G,o.mapToColor=j,o.modifyHSL=q,o.modifyAlpha=J,o.stringify=X}),E8e=xt((o,f)=>{var m=g_t(),v=k2(),y=Wi(),x=y.isArrayLike,C=Array.prototype.slice;function w(G,j){return G[j]}function A(G,j,q){G[j]=q}function E(G,j,q){return(j-G)*q+G}function T(G,j,q){return q>.5?j:G}function S(G,j,q,J,X){var Y=G.length;if(X===1)for(var Q=0;QX;if(Y)G.length=X;else for(var Q=J;Q=0&&!(de[gt]<=bt);gt--);gt=Math.min(gt,ie-2)}else{for(gt=Oe;gtbt);gt++);gt=Math.min(gt-1,ie-2)}Oe=gt,Ue=bt;var It=de[gt+1]-de[gt];if(It!==0)if(it=(bt-de[gt])/It,z)if(at=ve[gt],ut=ve[gt===0?gt:gt-1],Pt=ve[gt>ie-2?ie-1:gt+1],Qe=ve[gt>ie-3?ie-1:gt+2],ne)P(ut,at,Pt,Qe,it,it*it,it*it*it,Q(At,X),ae);else{var Jt;if(oe)Jt=P(ut,at,Pt,Qe,it,it*it,it*it*it,ft,1),Jt=R(ft);else{if(se)return T(at,Pt,it);Jt=D(ut,at,Pt,Qe,it,it*it,it*it*it)}ee(At,X,Jt)}else if(ne)S(ve[gt],ve[gt+1],it,Q(At,X),ae);else{var Jt;if(oe)S(ve[gt],ve[gt+1],it,ft,1),Jt=R(ft);else{if(se)return T(ve[gt],ve[gt+1],it);Jt=E(ve[gt],ve[gt+1],it)}ee(At,X,Jt)}},Xt=new m({target:G._target,life:fe,loop:G._loop,delay:G._delay,onframe:Ot,ondestroy:q});return j&&j!=="spline"&&(Xt.easing=j),Xt}}}var k=function(G,j,q,J){this._tracks={},this._target=G,this._loop=j||!1,this._getter=q||w,this._setter=J||A,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};k.prototype={when:function(G,j){var q=this._tracks;for(var J in j)if(j.hasOwnProperty(J)){if(!q[J]){q[J]=[];var X=this._getter(this._target,J);if(X==null)continue;G!==0&&q[J].push({time:0,value:L(X)})}q[J].push({time:G,value:j[J]})}return this},during:function(G){return this._onframeList.push(G),this},pause:function(){for(var G=0;G{var f=1;typeof window<"u"&&(f=Math.max(window.devicePixelRatio||1,1));var m=0,v=f;o.debugMode=m,o.devicePixelRatio=v}),Bj=xt((o,f)=>{var m=yie(),v=m.debugMode,y=function(){};v===1&&(y=console.error);var x=y;f.exports=x}),__t=xt((o,f)=>{var m=E8e(),v=Bj(),y=Wi(),x=y.isString,C=y.isFunction,w=y.isObject,A=y.isArrayLike,E=y.indexOf,T=function(){this.animators=[]};T.prototype={constructor:T,animate:function(D,L){var R,O=!1,F=this,k=this.__zr;if(D){var U=D.split("."),G=F;O=U[0]==="shape";for(var j=0,q=U.length;j0&&D.animate(L,!1).when(F??500,G).delay(k||0)}function I(D,L,R,O){if(!L)D.attr(R,O);else{var F={};F[L]={},F[L][R]=O,D.attr(F)}}var P=T;f.exports=P}),T8e=xt((o,f)=>{var m=b8e(),v=iB(),y=vie(),x=__t(),C=Wi(),w=function(E){y.call(this,E),v.call(this,E),x.call(this,E),this.id=E.id||m()};w.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(E,T){switch(this.draggable){case"horizontal":T=0;break;case"vertical":E=0;break}var S=this.transform;S||(S=this.transform=[1,0,0,1,0,0]),S[4]+=E,S[5]+=T,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(E,T){},attrKV:function(E,T){if(E==="position"||E==="scale"||E==="origin"){if(T){var S=this[E];S||(S=this[E]=[]),S[0]=T[0],S[1]=T[1]}}else this[E]=T},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(E,T){if(typeof E=="string")this.attrKV(E,T);else if(C.isObject(E))for(var S in E)E.hasOwnProperty(S)&&this.attrKV(S,E[S]);return this.dirty(!1),this},setClipPath:function(E){var T=this.__zr;T&&E.addSelfToZr(T),this.clipPath&&this.clipPath!==E&&this.removeClipPath(),this.clipPath=E,E.__zr=T,E.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var E=this.clipPath;E&&(E.__zr&&E.removeSelfFromZr(E.__zr),E.__zr=null,E.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(E){this.__zr=E;var T=this.animators;if(T)for(var S=0;S{var m=lf(),v=Ky(),y=m.applyTransform,x=Math.min,C=Math.max;function w(E,T,S,M){S<0&&(E=E+S,S=-S),M<0&&(T=T+M,M=-M),this.x=E,this.y=T,this.width=S,this.height=M}w.prototype={constructor:w,union:function(E){var T=x(E.x,this.x),S=x(E.y,this.y);this.width=C(E.x+E.width,this.x+this.width)-T,this.height=C(E.y+E.height,this.y+this.height)-S,this.x=T,this.y=S},applyTransform:function(){var E=[],T=[],S=[],M=[];return function(I){if(I){E[0]=S[0]=this.x,E[1]=M[1]=this.y,T[0]=M[0]=this.x+this.width,T[1]=S[1]=this.y+this.height,y(E,E,I),y(T,T,I),y(S,S,I),y(M,M,I),this.x=x(E[0],T[0],S[0],M[0]),this.y=x(E[1],T[1],S[1],M[1]);var P=C(E[0],T[0],S[0],M[0]),D=C(E[1],T[1],S[1],M[1]);this.width=P-this.x,this.height=D-this.y}}}(),calculateTransform:function(E){var T=this,S=E.width/T.width,M=E.height/T.height,I=v.create();return v.translate(I,I,[-T.x,-T.y]),v.scale(I,I,[S,M]),v.translate(I,I,[E.x,E.y]),I},intersect:function(E){if(!E)return!1;E instanceof w||(E=w.create(E));var T=this,S=T.x,M=T.x+T.width,I=T.y,P=T.y+T.height,D=E.x,L=E.x+E.width,R=E.y,O=E.y+E.height;return!(M=S.x&&E<=S.x+S.width&&T>=S.y&&T<=S.y+S.height},clone:function(){return new w(this.x,this.y,this.width,this.height)},copy:function(E){this.x=E.x,this.y=E.y,this.width=E.width,this.height=E.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},w.create=function(E){return new w(E.x,E.y,E.width,E.height)};var A=w;f.exports=A}),rB=xt((o,f)=>{var m=Wi(),v=T8e(),y=Of(),x=function(w){w=w||{},v.call(this,w);for(var A in w)w.hasOwnProperty(A)&&(this[A]=w[A]);this._children=[],this.__storage=null,this.__dirty=!0};x.prototype={constructor:x,isGroup:!0,type:"group",silent:!1,children:function(){return this._children.slice()},childAt:function(w){return this._children[w]},childOfName:function(w){for(var A=this._children,E=0;E=0&&(E.splice(T,0,w),this._doAdd(w))}return this},_doAdd:function(w){w.parent&&w.parent.remove(w),w.parent=this;var A=this.__storage,E=this.__zr;A&&A!==w.__storage&&(A.addToStorage(w),w instanceof x&&w.addChildrenToStorage(A)),E&&E.refresh()},remove:function(w){var A=this.__zr,E=this.__storage,T=this._children,S=m.indexOf(T,w);return S<0?this:(T.splice(S,1),w.parent=null,E&&(E.delFromStorage(w),w instanceof x&&w.delChildrenFromStorage(E)),A&&A.refresh(),this)},removeAll:function(){var w=this._children,A=this.__storage,E,T;for(T=0;T{var m=32,v=7,y=256;function x(I){for(var P=0;I>=m;)P|=I&1,I>>=1;return I+P}function C(I,P,D,L){var R=P+1;if(R===D)return 1;if(L(I[R++],I[P])<0){for(;R=0;)R++;return R-P}function w(I,P,D){for(D--;P>>1,R(O,I[U])<0?k=U:F=U+1;var G=L-F;switch(G){case 3:I[F+3]=I[F+2];case 2:I[F+2]=I[F+1];case 1:I[F+1]=I[F];break;default:for(;G>0;)I[F+G]=I[F+G-1],G--}I[F]=O}}function E(I,P,D,L,R,O){var F=0,k=0,U=1;if(O(I,P[D+R])>0){for(k=L-R;U0;)F=U,U=(U<<1)+1,U<=0&&(U=k);U>k&&(U=k),F+=R,U+=R}else{for(k=R+1;Uk&&(U=k);var G=F;F=R-U,U=R-G}for(F++;F>>1);O(I,P[D+j])>0?F=j+1:U=j}return U}function T(I,P,D,L,R,O){var F=0,k=0,U=1;if(O(I,P[D+R])<0){for(k=R+1;Uk&&(U=k);var G=F;F=R-U,U=R-G}else{for(k=L-R;U=0;)F=U,U=(U<<1)+1,U<=0&&(U=k);U>k&&(U=k),F+=R,U+=R}for(F++;F>>1);O(I,P[D+j])<0?U=j:F=j+1}return U}function S(I,P){var D=v,L=0,R=y,O=0,F,k,U=0;L=I.length,L<2*y&&(R=L>>>1);var G=[];O=L<120?5:L<1542?10:L<119151?19:40,F=[],k=[];function j(ee,z){F[U]=ee,k[U]=z,U+=1}function q(){for(;U>1;){var ee=U-2;if(ee>=1&&k[ee-1]<=k[ee]+k[ee+1]||ee>=2&&k[ee-2]<=k[ee]+k[ee-1])k[ee-1]k[ee+1])break;X(ee)}}function J(){for(;U>1;){var ee=U-2;ee>0&&k[ee-1]=v||ve>=v);if(pe)break;fe<0&&(fe=0),fe+=2}if(D=fe,D<1&&(D=1),z===1){for(ne=0;ne=0;ne--)I[de+ne]=I[fe+ne];I[ae]=G[se];return}for(var ve=D;;){var pe=0,ce=0,he=!1;do if(P(G[se],I[oe])<0){if(I[ae--]=I[oe--],pe++,ce=0,--z===0){he=!0;break}}else if(I[ae--]=G[se--],ce++,pe=0,--re===1){he=!0;break}while((pe|ce)=0;ne--)I[de+ne]=I[fe+ne];if(z===0){he=!0;break}}if(I[ae--]=G[se--],--re===1){he=!0;break}if(ce=re-E(I[oe],G,0,re,re-1,P),ce!==0){for(ae-=ce,se-=ce,re-=ce,de=ae+1,fe=se+1,ne=0;ne=v||ce>=v);if(he)break;ve<0&&(ve=0),ve+=2}if(D=ve,D<1&&(D=1),re===1){for(ae-=z,oe-=z,de=ae+1,fe=oe+1,ne=z-1;ne>=0;ne--)I[de+ne]=I[fe+ne];I[ae]=G[se]}else{if(re===0)throw new Error;for(fe=ae-(re-1),ne=0;nek&&(U=k),A(I,D,D+U,D+O,P),O=U}F.pushRun(D,O),F.mergeRuns(),R-=O,D+=O}while(R!==0);F.forceMergeRuns()}}f.exports=M}),v_t=xt((o,f)=>{var m=Wi(),v=Tm(),y=rB(),x=f0e();function C(E,T){return E.zlevel===T.zlevel?E.z===T.z?E.z2-T.z2:E.z-T.z:E.zlevel-T.zlevel}var w=function(){this._roots=[],this._displayList=[],this._displayListLen=0};w.prototype={constructor:w,traverse:function(E,T){for(var S=0;S=0&&(this.delFromStorage(E),this._roots.splice(I,1),E instanceof y&&E.delChildrenFromStorage(this))},addToStorage:function(E){return E&&(E.__storage=this,E.dirty(!1)),this},delFromStorage:function(E){return E&&(E.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:C};var A=w;f.exports=A}),S8e=xt((o,f)=>{var m={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};function v(y,x,C){return m.hasOwnProperty(x)?C*=y.dpr:C}f.exports=v}),xie=xt(o=>{var f={NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},m=9;o.ContextCachedBy=f,o.WILL_BE_RESTORED=m}),p0e=xt((o,f)=>{var m=S8e(),v=xie(),y=v.ContextCachedBy,x=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],C=function(I){this.extendFrom(I,!1)};function w(I,P,D){var L=P.x==null?0:P.x,R=P.x2==null?1:P.x2,O=P.y==null?0:P.y,F=P.y2==null?0:P.y2;P.global||(L=L*D.width+D.x,R=R*D.width+D.x,O=O*D.height+D.y,F=F*D.height+D.y),L=isNaN(L)?0:L,R=isNaN(R)?1:R,O=isNaN(O)?0:O,F=isNaN(F)?0:F;var k=I.createLinearGradient(L,O,R,F);return k}function A(I,P,D){var L=D.width,R=D.height,O=Math.min(L,R),F=P.x==null?.5:P.x,k=P.y==null?.5:P.y,U=P.r==null?.5:P.r;P.global||(F=F*L+D.x,k=k*R+D.y,U=U*O);var G=I.createRadialGradient(F,k,0,F,k,U);return G}C.prototype={constructor:C,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(I,P,D){var L=this,R=D&&D.style,O=!R||I.__attrCachedBy!==y.STYLE_BIND;I.__attrCachedBy=y.STYLE_BIND;for(var F=0;F0},extendFrom:function(I,P){if(I)for(var D in I)I.hasOwnProperty(D)&&(P===!0||(P===!1?!this.hasOwnProperty(D):I[D]!=null))&&(this[D]=I[D])},set:function(I,P){typeof I=="string"?this[I]=P:this.extendFrom(I,!0)},clone:function(){var I=new this.constructor;return I.extendFrom(this,!0),I},getGradient:function(I,P,D){for(var L=P.type==="radial"?A:w,R=L(I,P,D),O=P.colorStops,F=0;F{var m=function(y,x){this.image=y,this.repeat=x,this.type="pattern"};m.prototype.getCanvasPattern=function(y){return y.createPattern(this.image,this.repeat||"repeat")};var v=m;f.exports=v}),y_t=xt((o,f)=>{var m=Wi(),v=yie(),y=v.devicePixelRatio,x=p0e(),C=P8e();function w(){return!1}function A(S,M,I){var P=m.createCanvas(),D=M.getWidth(),L=M.getHeight(),R=P.style;return R&&(R.position="absolute",R.left=0,R.top=0,R.width=D+"px",R.height=L+"px",P.setAttribute("data-zr-dom-id",S)),P.width=D*I,P.height=L*I,P}var E=function(S,M,I){var P;I=I||y,typeof S=="string"?P=A(S,M,I):m.isObject(S)&&(P=S,S=P.id),this.id=S,this.dom=P;var D=P.style;D&&(P.onselectstart=w,D["-webkit-user-select"]="none",D["user-select"]="none",D["-webkit-touch-callout"]="none",D["-webkit-tap-highlight-color"]="rgba(0,0,0,0)",D.padding=0,D.margin=0,D["border-width"]=0),this.domBack=null,this.ctxBack=null,this.painter=M,this.config=null,this.clearColor=0,this.motionBlur=!1,this.lastFrameAlpha=.7,this.dpr=I};E.prototype={constructor:E,__dirty:!0,__used:!1,__drawIndex:0,__startIndex:0,__endIndex:0,incremental:!1,getElementCount:function(){return this.__endIndex-this.__startIndex},initContext:function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},createBackBuffer:function(){var S=this.dpr;this.domBack=A("back-"+this.id,this.painter,S),this.ctxBack=this.domBack.getContext("2d"),S!==1&&this.ctxBack.scale(S,S)},resize:function(S,M){var I=this.dpr,P=this.dom,D=P.style,L=this.domBack;D&&(D.width=S+"px",D.height=M+"px"),P.width=S*I,P.height=M*I,L&&(L.width=S*I,L.height=M*I,I!==1&&this.ctxBack.scale(I,I))},clear:function(S,R){var I=this.dom,P=this.ctx,D=I.width,L=I.height,R=R||this.clearColor,O=this.motionBlur&&!S,F=this.lastFrameAlpha,k=this.dpr;if(O&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(I,0,0,D/k,L/k)),P.clearRect(0,0,D,L),R&&R!=="transparent"){var U;R.colorStops?(U=R.__canvasGradient||x.getGradient(P,R,{x:0,y:0,width:D,height:L}),R.__canvasGradient=U):R.image&&(U=C.prototype.getCanvasPattern.call(R,P)),P.save(),P.fillStyle=U||R,P.fillRect(0,0,D,L),P.restore()}if(O){var G=this.domBack;P.save(),P.globalAlpha=F,P.drawImage(G,0,0,D,L),P.restore()}}};var T=E;f.exports=T}),I8e=xt((o,f)=>{var m=typeof window<"u"&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(v){setTimeout(v,16)};f.exports=m}),m0e=xt(o=>{var f=A8e(),m=new f(50);function v(w){if(typeof w=="string"){var A=m.get(w);return A&&A.image}else return w}function y(w,A,E,T,S){if(w)if(typeof w=="string"){if(A&&A.__zrImageSrc===w||!E)return A;var M=m.get(w),I={hostEl:E,cb:T,cbPayload:S};return M?(A=M.image,!C(A)&&M.pending.push(I)):(A=new Image,A.onload=A.onerror=x,m.put(w,A.__cachedImgObj={image:A,pending:[I]}),A.src=A.__zrImageSrc=w),A}else return w;else return A}function x(){var w=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var A=0;A{var f=Of(),m=m0e(),v=Wi(),y=v.getContext,x=v.extend,C=v.retrieve2,w=v.retrieve3,A=v.trim,E={},T=0,S=5e3,M=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g,I="12px sans-serif",P={};function D(oe,se){P[oe]=se}function L(oe,se){se=se||I;var ae=oe+":"+se;if(E[ae])return E[ae];for(var fe=(oe+"").split(` `),de=0,ve=0,pe=fe.length;veS&&(T=0,E={}),T++,E[ae]=de,de}function R(oe,se,ae,fe,de,ve,pe,ce){return pe?F(oe,se,ae,fe,de,ve,pe,ce):O(oe,se,ae,fe,de,ve,ce)}function O(oe,se,ae,fe,de,ve,pe){var ce=z(oe,se,de,ve,pe),he=L(oe,se);de&&(he+=de[1]+de[3]);var Ce=ce.outerHeight,Se=k(0,he,ae),De=U(0,Ce,fe),Oe=new f(Se,De,he,Ce);return Oe.lineHeight=ce.lineHeight,Oe}function F(oe,se,ae,fe,de,ve,pe,ce){var he=ie(oe,{rich:pe,truncate:ce,font:se,textAlign:ae,textPadding:de,textLineHeight:ve}),Ce=he.outerWidth,Se=he.outerHeight,De=k(0,Ce,ae),Oe=U(0,Se,fe);return new f(De,Oe,Ce,Se)}function k(oe,se,ae){return ae==="right"?oe-=se:ae==="center"&&(oe-=se/2),oe}function U(oe,se,ae){return ae==="middle"?oe-=se/2:ae==="bottom"&&(oe-=se),oe}function G(oe,se,ae){var fe=se.textPosition,de=se.textDistance,ve=ae.x,pe=ae.y;de=de||0;var ce=ae.height,he=ae.width,Ce=ce/2,Se="left",De="top";switch(fe){case"left":ve-=de,pe+=Ce,Se="right",De="middle";break;case"right":ve+=de+he,pe+=Ce,De="middle";break;case"top":ve+=he/2,pe-=de,Se="center",De="bottom";break;case"bottom":ve+=he/2,pe+=ce+de,Se="center";break;case"inside":ve+=he/2,pe+=Ce,Se="center",De="middle";break;case"insideLeft":ve+=de,pe+=Ce,De="middle";break;case"insideRight":ve+=he-de,pe+=Ce,Se="right",De="middle";break;case"insideTop":ve+=he/2,pe+=de,Se="center";break;case"insideBottom":ve+=he/2,pe+=ce-de,Se="center",De="bottom";break;case"insideTopLeft":ve+=de,pe+=de;break;case"insideTopRight":ve+=he-de,pe+=de,Se="right";break;case"insideBottomLeft":ve+=de,pe+=ce-de,De="bottom";break;case"insideBottomRight":ve+=he-de,pe+=ce-de,Se="right",De="bottom";break}return oe=oe||{},oe.x=ve,oe.y=pe,oe.textAlign=Se,oe.textVerticalAlign=De,oe}function j(oe,se,ae){var fe={textPosition:oe,textDistance:ae};return G({},fe,se)}function q(oe,se,ae,fe,de){if(!se)return"";var ve=(oe+"").split(` `);de=J(se,ae,fe,de);for(var pe=0,ce=ve.length;pe=pe;he++)ce-=pe;var Ce=L(de,se);return Ce>ce&&(de="",Ce=0),ce=oe-Ce,fe.ellipsis=de,fe.ellipsisWidth=Ce,fe.contentWidth=ce,fe.containerWidth=oe,fe}function X(oe,se){var ae=se.containerWidth,fe=se.font,de=se.contentWidth;if(!ae)return"";var ve=L(oe,fe);if(ve<=ae)return oe;for(var pe=0;;pe++){if(ve<=de||pe>=se.maxIterations){oe+=se.ellipsis;break}var ce=pe===0?Y(oe,de,se.ascCharWidth,se.cnCharWidth):ve>0?Math.floor(oe.length*de/ve):0;oe=oe.substr(0,ce),ve=L(oe,fe)}return oe===""&&(oe=se.placeholder),oe}function Y(oe,se,ae,fe){for(var de=0,ve=0,pe=oe.length;veSe)oe="",pe=[];else if(De!=null)for(var Oe=J(De-(ae?ae[1]+ae[3]:0),se,de.ellipsis,{minChar:de.minChar,placeholder:de.placeholder}),Ue=0,Xe=pe.length;Uefe&&re(ae,oe.substring(fe,ve)),re(ae,de[2],de[1]),fe=M.lastIndex}feUe)return{lines:[],width:0,height:0};Qe.textWidth=L(Qe.text,Xt);var bt=ft.textWidth,gt=bt==null||bt==="auto";if(typeof bt=="string"&&bt.charAt(bt.length-1)==="%")Qe.percentWidth=bt,Ce.push(Qe),bt=0;else{if(gt){bt=Qe.textWidth;var It=ft.textBackgroundColor,Jt=It&&It.image;Jt&&(Jt=m.findExistImage(Jt),m.isImageReady(Jt)&&(bt=Math.max(bt,Jt.width*At/Jt.height)))}var bi=Ot?Ot[1]+Ot[3]:0;bt+=bi;var Yi=Oe!=null?Oe-at:null;Yi!=null&&Yi{function f(m,v){var y=v.x,x=v.y,C=v.width,w=v.height,A=v.r,E,T,S,M;C<0&&(y=y+C,C=-C),w<0&&(x=x+w,w=-w),typeof A=="number"?E=T=S=M=A:A instanceof Array?A.length===1?E=T=S=M=A[0]:A.length===2?(E=S=A[0],T=M=A[1]):A.length===3?(E=A[0],T=M=A[1],S=A[2]):(E=A[0],T=A[1],S=A[2],M=A[3]):E=T=S=M=0;var I;E+T>C&&(I=E+T,E*=C/I,T*=C/I),S+M>C&&(I=S+M,S*=C/I,M*=C/I),T+S>w&&(I=T+S,T*=w/I,S*=w/I),E+M>w&&(I=E+M,E*=w/I,M*=w/I),m.moveTo(y+E,x),m.lineTo(y+C-T,x),T!==0&&m.arc(y+C-T,x+T,T,-Math.PI/2,0),m.lineTo(y+C,x+w-S),S!==0&&m.arc(y+C-S,x+w-S,S,0,Math.PI/2),m.lineTo(y+M,x+w),M!==0&&m.arc(y+M,x+w-M,M,Math.PI/2,Math.PI),m.lineTo(y,x+E),E!==0&&m.arc(y+E,x+E,E,Math.PI,Math.PI*1.5)}o.buildPath=f}),Cie=xt(o=>{var f=Wi(),m=f.retrieve2,v=f.retrieve3,y=f.each,x=f.normalizeCssArray,C=f.isString,w=f.isObject,A=nb(),E=M8e(),T=m0e(),S=S8e(),M=xie(),I=M.ContextCachedBy,P=M.WILL_BE_RESTORED,D=A.DEFAULT_FONT,L={left:1,right:1,center:1},R={top:1,bottom:1,middle:1},O=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],F={},k={};function U(ve){return G(ve),y(ve.rich,G),ve}function G(ve){if(ve){ve.font=A.makeFont(ve);var pe=ve.textAlign;pe==="middle"&&(pe="center"),ve.textAlign=pe==null||L[pe]?pe:"left";var ce=ve.textVerticalAlign||ve.textBaseline;ce==="center"&&(ce="middle"),ve.textVerticalAlign=ce==null||R[ce]?ce:"top";var he=ve.textPadding;he&&(ve.textPadding=x(ve.textPadding))}}function j(ve,pe,ce,he,Ce,Se){he.rich?J(ve,pe,ce,he,Ce,Se):q(ve,pe,ce,he,Ce,Se)}function q(ve,pe,ce,he,Ce,Se){"use strict";var De=ee(he),Oe,Ue=!1,Xe=pe.__attrCachedBy===I.PLAIN_TEXT;Se!==P?(Se&&(Oe=Se.style,Ue=!De&&Xe&&Oe),pe.__attrCachedBy=De?I.NONE:I.PLAIN_TEXT):Xe&&(pe.__attrCachedBy=I.NONE);var it=he.font||D;(!Ue||it!==(Oe.font||D))&&(pe.font=it);var ut=ve.__computedFont;ve.__styleFont!==it&&(ve.__styleFont=it,ut=ve.__computedFont=pe.font);var at=he.textPadding,Pt=he.textLineHeight,Qe=ve.__textCotentBlock;(!Qe||ve.__dirtyText)&&(Qe=ve.__textCotentBlock=A.parsePlainText(ce,ut,at,Pt,he.truncate));var ft=Qe.outerHeight,Ot=Qe.lines,Xt=Qe.lineHeight,At=re(k,ve,he,Ce),bt=At.baseX,gt=At.baseY,It=At.textAlign||"left",Jt=At.textVerticalAlign;Y(pe,he,Ce,bt,gt);var bi=A.adjustTextY(gt,ft,Jt),Yi=bt,ii=bi;if(De||at){var ei=A.getWidth(ce,ut),Li=ei;at&&(Li+=at[1]+at[3]);var Je=A.adjustTextX(bt,Li,It);De&&z(ve,pe,he,Je,bi,Li,ft),at&&(Yi=fe(bt,It,at),ii+=at[0])}pe.textAlign=It,pe.textBaseline="middle",pe.globalAlpha=he.opacity||1;for(var Nt=0;Nt=0&&(Nt=It[Je],Nt.textAlign==="right");)Q(ve,pe,Nt,he,bi,Xt,Li,"right"),Yi-=Nt.width,Li-=Nt.width,Je--;for(ei+=(Se-(ei-Ot)-(At-Li)-Yi)/2;ii<=Je;)Nt=It[ii],Q(ve,pe,Nt,he,bi,Xt,ei+Nt.width/2,"center"),ei+=Nt.width,ii++;Xt+=bi}}function Y(ve,pe,ce,he,Ce){if(ce&&pe.textRotation){var Se=pe.textOrigin;Se==="center"?(he=ce.width/2+ce.x,Ce=ce.height/2+ce.y):Se&&(he=Se[0]+ce.x,Ce=Se[1]+ce.y),ve.translate(he,Ce),ve.rotate(-pe.textRotation),ve.translate(-he,-Ce)}}function Q(ve,pe,ce,he,Ce,Se,De,Oe){var Ue=he.rich[ce.styleName]||{};Ue.text=ce.text;var Xe=ce.textVerticalAlign,it=Se+Ce/2;Xe==="top"?it=Se+ce.height/2:Xe==="bottom"&&(it=Se+Ce-ce.height/2),!ce.isLineHolder&&ee(Ue)&&z(ve,pe,Ue,Oe==="right"?De-ce.width:Oe==="center"?De-ce.width/2:De,it-ce.height/2,ce.width,ce.height);var ut=ce.textPadding;ut&&(De=fe(De,Oe,ut),it-=ce.height/2-ut[2]-ce.textHeight/2),ne(pe,"shadowBlur",v(Ue.textShadowBlur,he.textShadowBlur,0)),ne(pe,"shadowColor",Ue.textShadowColor||he.textShadowColor||"transparent"),ne(pe,"shadowOffsetX",v(Ue.textShadowOffsetX,he.textShadowOffsetX,0)),ne(pe,"shadowOffsetY",v(Ue.textShadowOffsetY,he.textShadowOffsetY,0)),ne(pe,"textAlign",Oe),ne(pe,"textBaseline","middle"),ne(pe,"font",ce.font||D);var at=oe(Ue.textStroke||he.textStroke,Qe),Pt=se(Ue.textFill||he.textFill),Qe=m(Ue.textStrokeWidth,he.textStrokeWidth);at&&(ne(pe,"lineWidth",Qe),ne(pe,"strokeStyle",at),pe.strokeText(ce.text,De,it)),Pt&&(ne(pe,"fillStyle",Pt),pe.fillText(ce.text,De,it))}function ee(ve){return!!(ve.textBackgroundColor||ve.textBorderWidth&&ve.textBorderColor)}function z(ve,pe,ce,he,Ce,Se,De){var Oe=ce.textBackgroundColor,Ue=ce.textBorderWidth,Xe=ce.textBorderColor,it=C(Oe);if(ne(pe,"shadowBlur",ce.textBoxShadowBlur||0),ne(pe,"shadowColor",ce.textBoxShadowColor||"transparent"),ne(pe,"shadowOffsetX",ce.textBoxShadowOffsetX||0),ne(pe,"shadowOffsetY",ce.textBoxShadowOffsetY||0),it||Ue&&Xe){pe.beginPath();var ut=ce.textBorderRadius;ut?E.buildPath(pe,{x:he,y:Ce,width:Se,height:De,r:ut}):pe.rect(he,Ce,Se,De),pe.closePath()}if(it)if(ne(pe,"fillStyle",Oe),ce.fillOpacity!=null){var at=pe.globalAlpha;pe.globalAlpha=ce.fillOpacity*ce.opacity,pe.fill(),pe.globalAlpha=at}else pe.fill();else if(w(Oe)){var Pt=Oe.image;Pt=T.createOrUpdateImage(Pt,null,ve,ie,Oe),Pt&&T.isImageReady(Pt)&&pe.drawImage(Pt,he,Ce,Se,De)}if(Ue&&Xe)if(ne(pe,"lineWidth",Ue),ne(pe,"strokeStyle",Xe),ce.strokeOpacity!=null){var at=pe.globalAlpha;pe.globalAlpha=ce.strokeOpacity*ce.opacity,pe.stroke(),pe.globalAlpha=at}else pe.stroke()}function ie(ve,pe){pe.image=ve}function re(ve,pe,ce,he){var Ce=ce.x||0,Se=ce.y||0,De=ce.textAlign,Oe=ce.textVerticalAlign;if(he){var Ue=ce.textPosition;if(Ue instanceof Array)Ce=he.x+ae(Ue[0],he.width),Se=he.y+ae(Ue[1],he.height);else{var Xe=pe&&pe.calculateTextPosition?pe.calculateTextPosition(F,ce,he):A.calculateTextPosition(F,ce,he);Ce=Xe.x,Se=Xe.y,De=De||Xe.textAlign,Oe=Oe||Xe.textVerticalAlign}var it=ce.textOffset;it&&(Ce+=it[0],Se+=it[1])}return ve=ve||{},ve.baseX=Ce,ve.baseY=Se,ve.textAlign=De,ve.textVerticalAlign=Oe,ve}function ne(ve,pe,ce){return ve[pe]=S(ve,pe,ce),ve[pe]}function oe(ve,pe){return ve==null||pe<=0||ve==="transparent"||ve==="none"?null:ve.image||ve.colorStops?"#000":ve}function se(ve){return ve==null||ve==="none"?null:ve.image||ve.colorStops?"#000":ve}function ae(ve,pe){return typeof ve=="string"?ve.lastIndexOf("%")>=0?parseFloat(ve)/100*pe:parseFloat(ve):ve}function fe(ve,pe,ce){return pe==="right"?ve-ce[1]:pe==="center"?ve+ce[3]/2-ce[1]/2:ve+ce[3]}function de(ve,pe){return ve!=null&&(ve||pe.textBackgroundColor||pe.textBorderWidth&&pe.textBorderColor||pe.textPadding)}o.normalizeTextStyle=U,o.renderText=j,o.getBoxPosition=re,o.getStroke=oe,o.getFill=se,o.parsePercent=ae,o.needDrawText=de}),D8e=xt((o,f)=>{var m=Cie(),v=Of(),y=xie(),x=y.WILL_BE_RESTORED,C=new v,w=function(){};w.prototype={constructor:w,drawRectText:function(E,T){var S=this.style;T=S.textRect||T,this.__dirty&&m.normalizeTextStyle(S,!0);var M=S.text;if(M!=null&&(M+=""),!!m.needDrawText(M,S)){E.save();var I=this.transform;S.transformText?this.setTransform(E):I&&(C.copy(T),C.applyTransform(I),T=C),m.renderText(this,E,M,S,T,x),E.restore()}}};var A=w;f.exports=A}),kj=xt((o,f)=>{var m=Wi(),v=p0e(),y=T8e(),x=D8e();function C(A){A=A||{},y.call(this,A);for(var E in A)A.hasOwnProperty(E)&&E!=="style"&&(this[E]=A[E]);this.style=new v(A.style,this),this._rect=null,this.__clipPaths=null}C.prototype={constructor:C,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(A){},afterBrush:function(A){},brush:function(A,E){},getBoundingRect:function(){},contain:function(A,E){return this.rectContain(A,E)},traverse:function(A,E){A.call(E,this)},rectContain:function(A,E){var T=this.transformCoordToLocal(A,E),S=this.getBoundingRect();return S.contain(T[0],T[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(A){return this.animate("style",A)},attrKV:function(A,E){A!=="style"?y.prototype.attrKV.call(this,A,E):this.style.set(E)},setStyle:function(A,E){return this.style.set(A,E),this.dirty(!1),this},useStyle:function(A){return this.style=new v(A,this),this.dirty(!1),this},calculateTextPosition:null},m.inherits(C,y),m.mixin(C,x);var w=C;f.exports=w}),rU=xt((o,f)=>{var m=kj(),v=Of(),y=Wi(),x=m0e();function C(A){m.call(this,A)}C.prototype={constructor:C,type:"image",brush:function(A,E){var T=this.style,S=T.image;T.bind(A,this,E);var M=this._image=x.createOrUpdateImage(S,this._image,this,this.onload);if(!(!M||!x.isImageReady(M))){var I=T.x||0,P=T.y||0,D=T.width,L=T.height,R=M.width/M.height;if(D==null&&L!=null?D=L*R:L==null&&D!=null?L=D/R:D==null&&L==null&&(D=M.width,L=M.height),this.setTransform(A),T.sWidth&&T.sHeight){var O=T.sx||0,F=T.sy||0;A.drawImage(M,O,F,T.sWidth,T.sHeight,I,P,D,L)}else if(T.sx&&T.sy){var O=T.sx,F=T.sy,k=D-O,U=L-F;A.drawImage(M,O,F,k,U,I,P,D,L)}else A.drawImage(M,I,P,D,L);T.text!=null&&(this.restoreTransform(A),this.drawRectText(A,this.getBoundingRect()))}},getBoundingRect:function(){var A=this.style;return this._rect||(this._rect=new v(A.x||0,A.y||0,A.width||0,A.height||0)),this._rect}},y.inherits(C,m);var w=C;f.exports=w}),x_t=xt((o,f)=>{var m=yie(),v=m.devicePixelRatio,y=Wi(),x=Bj(),C=Of(),w=f0e(),A=y_t(),E=I8e(),T=rU(),S=Tm(),M=1e5,I=314159,P=.01,D=.001;function L(X){return parseInt(X,10)}function R(X){return X?X.__builtin__?!0:!(typeof X.resize!="function"||typeof X.refresh!="function"):!1}var O=new C(0,0,0,0),F=new C(0,0,0,0);function k(X,Y,Q){return O.copy(X.getBoundingRect()),X.transform&&O.applyTransform(X.transform),F.width=Y,F.height=Q,!O.intersect(F)}function U(X,Y){if(X===Y)return!1;if(!X||!Y||X.length!==Y.length)return!0;for(var Q=0;Q=0&&Q.splice(ee,1),X.__hoverMir=null},clearHover:function(X){for(var Y=this._hoverElements,Q=0;Q15)break}}ie.__drawIndex=ce,ie.__drawIndex0&&X>ee[0]){for(re=0;reX);re++);ie=Q[ee[re]]}if(ee.splice(re+1,0,X),Q[X]=Y,!Y.virtual)if(ie){var oe=ie.dom;oe.nextSibling?ne.insertBefore(Y.dom,oe.nextSibling):ne.appendChild(Y.dom)}else ne.firstChild?ne.insertBefore(Y.dom,ne.firstChild):ne.appendChild(Y.dom)},eachLayer:function(X,Y){var Q=this._zlevelList,ee,z;for(z=0;z0?P:0),this._needsManuallyCompositing),oe.__builtin__||x("ZLevel "+ne+" has been used by unkown layer "+oe.id),oe!==z&&(oe.__used=!0,oe.__startIndex!==Q&&(oe.__dirty=!0),oe.__startIndex=Q,oe.incremental?oe.__drawIndex=-1:oe.__drawIndex=Q,Y(Q),z=oe),ee.__dirty&&(oe.__dirty=!0,oe.incremental&&oe.__drawIndex<0&&(oe.__drawIndex=Q))}Y(Q),this.eachBuiltinLayer(function(se,ae){!se.__used&&se.getElementCount()>0&&(se.__dirty=!0,se.__startIndex=se.__endIndex=se.__drawIndex=0),se.__dirty&&se.__drawIndex<0&&(se.__drawIndex=se.__startIndex)})},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(X){X.clear()},setBackgroundColor:function(X){this._backgroundColor=X},configLayer:function(X,Y){if(Y){var Q=this._layerConfig;Q[X]?y.merge(Q[X],Y,!0):Q[X]=Y;for(var ee=0;ee{var m=Wi(),v=B2(),y=v.Dispatcher,x=I8e(),C=E8e(),w=function(E){E=E||{},this.stage=E.stage||{},this.onframe=E.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,y.call(this)};w.prototype={constructor:w,addClip:function(E){this._clips.push(E)},addAnimator:function(E){E.animation=this;for(var T=E.getClips(),S=0;S=0&&this._clips.splice(T,1)},removeAnimator:function(E){for(var T=E.getClips(),S=0;S{var m=B2(),v=m.addEventListener,y=m.removeEventListener,x=m.normalizeEvent,C=m.getNativeEvent,w=Wi(),A=iB(),E=Tm(),T=300,S=E.domSupported,M=function(){var ne=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],oe=["touchstart","touchend","touchmove"],se={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},ae=w.map(ne,function(fe){var de=fe.replace("mouse","pointer");return se.hasOwnProperty(de)?de:fe});return{mouse:ne,touch:oe,pointer:ae}}(),I={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]};function P(ne){return ne==="mousewheel"&&E.browser.firefox?"DOMMouseScroll":ne}function D(ne){var oe=ne.pointerType;return oe==="pen"||oe==="touch"}function L(ne){ne.touching=!0,ne.touchTimer!=null&&(clearTimeout(ne.touchTimer),ne.touchTimer=null),ne.touchTimer=setTimeout(function(){ne.touching=!1,ne.touchTimer=null},700)}function R(ne){ne&&(ne.zrByTouch=!0)}function O(ne,oe){return x(ne.dom,new k(ne,oe),!0)}function F(ne,oe){for(var se=oe,ae=!1;se&&se.nodeType!==9&&!(ae=se.domBelongToZr||se!==oe&&se===ne.painterRoot);)se=se.parentNode;return ae}function k(ne,oe){this.type=oe.type,this.target=this.currentTarget=ne.dom,this.pointerType=oe.pointerType,this.clientX=oe.clientX,this.clientY=oe.clientY}var U=k.prototype;U.stopPropagation=U.stopImmediatePropagation=U.preventDefault=w.noop;var G={mousedown:function(ne){ne=x(this.dom,ne),this._mayPointerCapture=[ne.zrX,ne.zrY],this.trigger("mousedown",ne)},mousemove:function(ne){ne=x(this.dom,ne);var oe=this._mayPointerCapture;oe&&(ne.zrX!==oe[0]||ne.zrY!==oe[1])&&Q(this,!0),this.trigger("mousemove",ne)},mouseup:function(ne){ne=x(this.dom,ne),Q(this,!1),this.trigger("mouseup",ne)},mouseout:function(ne){ne=x(this.dom,ne),this._pointerCapturing&&(ne.zrEventControl="no_globalout");var oe=ne.toElement||ne.relatedTarget;ne.zrIsToLocalDOM=F(this,oe),this.trigger("mouseout",ne)},touchstart:function(ne){ne=x(this.dom,ne),R(ne),this._lastTouchMoment=new Date,this.handler.processGesture(ne,"start"),G.mousemove.call(this,ne),G.mousedown.call(this,ne)},touchmove:function(ne){ne=x(this.dom,ne),R(ne),this.handler.processGesture(ne,"change"),G.mousemove.call(this,ne)},touchend:function(ne){ne=x(this.dom,ne),R(ne),this.handler.processGesture(ne,"end"),G.mouseup.call(this,ne),+new Date-this._lastTouchMoment{var f=b8e(),m=Tm(),v=Wi(),y=p_t(),x=v_t(),C=x_t(),w=C_t(),A=b_t();/*! * ZRender, a high performance 2d drawing library. * * Copyright (c) 2013, Baidu Inc. * All rights reserved. * * LICENSE * https://github.com/ecomfe/zrender/blob/master/LICENSE.txt */var E=!m.canvasSupported,T={canvas:C},S={},M="4.3.1";function I(F,k){var U=new O(f(),F,k);return S[U.id]=U,U}function P(F){if(F)F.dispose();else{for(var k in S)S.hasOwnProperty(k)&&S[k].dispose();S={}}return this}function D(F){return S[F]}function L(F,k){T[F]=k}function R(F){delete S[F]}var O=function(F,k,U){U=U||{},this.dom=k,this.id=F;var G=this,j=new x,q=U.renderer;if(E){if(!T.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");q="vml"}else(!q||!T[q])&&(q="canvas");var J=new T[q](k,j,U,F);this.storage=j,this.painter=J;var X=!m.node&&!m.worker?new A(J.getViewportRoot(),J.root):null;this.handler=new y(j,J,X,J.root),this.animation=new w({stage:{update:v.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var Y=j.delFromStorage,Q=j.addToStorage;j.delFromStorage=function(ee){Y.call(j,ee),ee&&ee.removeSelfFromZr(G)},j.addToStorage=function(ee){Q.call(j,ee),ee.addSelfToZr(G)}};O.prototype={constructor:O,getId:function(){return this.id},add:function(F){this.storage.addRoot(F),this._needsRefresh=!0},remove:function(F){this.storage.delRoot(F),this._needsRefresh=!0},configLayer:function(F,k){this.painter.configLayer&&this.painter.configLayer(F,k),this._needsRefresh=!0},setBackgroundColor:function(F){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(F),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var F;this._needsRefresh&&(F=!0,this.refreshImmediately()),this._needsRefreshHover&&(F=!0,this.refreshHoverImmediately()),F&&this.trigger("rendered")},addHover:function(F,k){if(this.painter.addHover){var U=this.painter.addHover(F,k);return this.refreshHover(),U}},removeHover:function(F){this.painter.removeHover&&(this.painter.removeHover(F),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(F){F=F||{},this.painter.resize(F.width,F.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(F,k){return this.painter.pathToImage(F,k)},setCursorStyle:function(F){this.handler.setCursorStyle(F)},findHover:function(F,k){return this.handler.findHover(F,k)},on:function(F,k,U){this.handler.on(F,k,U)},off:function(F,k){this.handler.off(F,k)},trigger:function(F,k){this.handler.trigger(F,k)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,R(this.id)}},o.version=M,o.init=I,o.dispose=P,o.getInstance=D,o.registerPainter=L}),vu=xt(o=>{var f=Wi(),m=Tm(),v=f.each,y=f.isObject,x=f.isArray,C="series\0";function w(X){return X instanceof Array?X:X==null?[]:[X]}function A(X,Y,Q){if(X){X[Y]=X[Y]||{},X.emphasis=X.emphasis||{},X.emphasis[Y]=X.emphasis[Y]||{};for(var ee=0,z=Q.length;ee=Q.length&&Q.push({option:ee})}}),Q}function I(X){var Y=f.createHashMap();v(X,function(Q,ee){var z=Q.exist;z&&Y.set(z.id,Q)}),v(X,function(Q,ee){var z=Q.option;f.assert(!z||z.id==null||!Y.get(z.id)||Y.get(z.id)===Q,"id duplicates: "+(z&&z.id)),z&&z.id!=null&&Y.set(z.id,Q),!Q.keyInfo&&(Q.keyInfo={})}),v(X,function(Q,ee){var z=Q.exist,ie=Q.option,re=Q.keyInfo;if(y(ie)){if(re.name=ie.name!=null?ie.name+"":z?z.name:C+ee,z)re.id=z.id;else if(ie.id!=null)re.id=ie.id+"";else{var ne=0;do re.id="\0"+re.name+"\0"+ne++;while(Y.get(re.id))}Y.set(re.id,Q)}})}function P(X){var Y=X.name;return!!(Y&&Y.indexOf(C))}function D(X){return y(X)&&X.id&&(X.id+"").indexOf("\0_ec_\0")===0}function L(X,Y){var Q={},ee={};return z(X||[],Q),z(Y||[],ee,Q),[ie(Q),ie(ee)];function z(re,ne,oe){for(var se=0,ae=re.length;se{var f=Ac(),m=f.__DEV__,v=Wi(),y=".",x="___EC__COMPONENT__CONTAINER___";function C(D){var L={main:"",sub:""};return D&&(D=D.split(y),L.main=D[0]||"",L.sub=D[1]||""),L}function w(D){v.assert(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(D),'componentType "'+D+'" illegal')}function A(D,L){D.$constructor=D,D.extend=function(R){var O=this,F=function(){R.$constructor?R.$constructor.apply(this,arguments):O.apply(this,arguments)};return v.extend(F.prototype,R),F.extend=this.extend,F.superCall=S,F.superApply=M,v.inherits(F,this),F.superClass=O,F}}var E=0;function T(D){var L=["__\0is_clz",E++,Math.random().toFixed(3)].join("_");D.prototype[L]=!0,D.isInstance=function(R){return!!(R&&R[L])}}function S(D,L){var R=v.slice(arguments,2);return this.superClass.prototype[L].apply(D,R)}function M(D,L,R){return this.superClass.prototype[L].apply(D,R)}function I(D,L){L=L||{};var R={};D.registerClass=function(k,U){if(U){if(w(U),U=C(U),!U.sub)R[U.main]=k;else if(U.sub!==x){var G=O(U);G[U.sub]=k}}return k},D.getClass=function(k,U,G){var j=R[k];if(j&&j[x]&&(j=U?j[U]:null),G&&!j)throw new Error(U?"Component "+k+"."+(U||"")+" not exists. Load it first.":k+".type should be specified.");return j},D.getClassesByMainType=function(k){k=C(k);var U=[],G=R[k.main];return G&&G[x]?v.each(G,function(j,q){q!==x&&U.push(j)}):U.push(G),U},D.hasClass=function(k){return k=C(k),!!R[k.main]},D.getAllClassMainTypes=function(){var k=[];return v.each(R,function(U,G){k.push(G)}),k},D.hasSubTypes=function(k){k=C(k);var U=R[k.main];return U&&U[x]},D.parseClassType=C;function O(k){var U=R[k.main];return(!U||!U[x])&&(U=R[k.main]={},U[x]=!0),U}if(L.registerWhenExtend){var F=D.extend;F&&(D.extend=function(k){var U=F.call(this,k);return D.registerClass(U,k.type)})}return D}function P(D,L){}o.parseClassType=C,o.enableClassExtend=A,o.enableClassCheck=T,o.enableClassManagement=I,o.setReadOnly=P}),nU=xt((o,f)=>{var m=Wi();function v(y){for(var x=0;x=0||A&&m.indexOf(A,S)<0)){var M=C.getShallow(S);M!=null&&(E[y[T][0]]=M)}}return E}}f.exports=v}),w_t=xt((o,f)=>{var m=nU(),v=m([["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),y={getLineStyle:function(x){var C=v(this,x);return C.lineDash=this.getLineDash(C.lineWidth),C},getLineDash:function(x){x==null&&(x=1);var C=this.get("type"),w=Math.max(x,2),A=x*4;return C==="solid"||C==null?!1:C==="dashed"?[A,A]:[w,w]}};f.exports=y}),A_t=xt((o,f)=>{var m=nU(),v=m([["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]]),y={getAreaStyle:function(x,C){return v(this,x,C)}};f.exports=y}),q3=xt(o=>{var f=lf(),m=f.create,v=f.distSquare,y=Math.pow,x=Math.sqrt,C=1e-8,w=1e-4,A=x(3),E=1/3,T=m(),S=m(),M=m();function I(Y){return Y>-C&&YC||Y<-C}function D(Y,Q,ee,z,ie){var re=1-ie;return re*re*(re*Y+3*ie*Q)+ie*ie*(ie*z+3*re*ee)}function L(Y,Q,ee,z,ie){var re=1-ie;return 3*(((Q-Y)*re+2*(ee-Q)*ie)*re+(z-ee)*ie*ie)}function R(Y,Q,ee,z,ie,re){var ne=z+3*(Q-ee)-Y,oe=3*(ee-Q*2+Y),se=3*(Q-Y),ae=Y-ie,fe=oe*oe-3*ne*se,de=oe*se-9*ne*ae,ve=se*se-3*oe*ae,pe=0;if(I(fe)&&I(de))if(I(oe))re[0]=0;else{var ce=-se/oe;ce>=0&&ce<=1&&(re[pe++]=ce)}else{var he=de*de-4*fe*ve;if(I(he)){var Ce=de/fe,ce=-oe/ne+Ce,Se=-Ce/2;ce>=0&&ce<=1&&(re[pe++]=ce),Se>=0&&Se<=1&&(re[pe++]=Se)}else if(he>0){var De=x(he),Oe=fe*oe+1.5*ne*(-de+De),Ue=fe*oe+1.5*ne*(-de-De);Oe<0?Oe=-y(-Oe,E):Oe=y(Oe,E),Ue<0?Ue=-y(-Ue,E):Ue=y(Ue,E);var ce=(-oe-(Oe+Ue))/(3*ne);ce>=0&&ce<=1&&(re[pe++]=ce)}else{var Xe=(2*fe*oe-3*ne*de)/(2*x(fe*fe*fe)),it=Math.acos(Xe)/3,ut=x(fe),at=Math.cos(it),ce=(-oe-2*ut*at)/(3*ne),Se=(-oe+ut*(at+A*Math.sin(it)))/(3*ne),Pt=(-oe+ut*(at-A*Math.sin(it)))/(3*ne);ce>=0&&ce<=1&&(re[pe++]=ce),Se>=0&&Se<=1&&(re[pe++]=Se),Pt>=0&&Pt<=1&&(re[pe++]=Pt)}}return pe}function O(Y,Q,ee,z,ie){var re=6*ee-12*Q+6*Y,ne=9*Q+3*z-3*Y-9*ee,oe=3*Q-3*Y,se=0;if(I(ne)){if(P(re)){var ae=-oe/re;ae>=0&&ae<=1&&(ie[se++]=ae)}}else{var fe=re*re-4*ne*oe;if(I(fe))ie[0]=-re/(2*ne);else if(fe>0){var de=x(fe),ae=(-re+de)/(2*ne),ve=(-re-de)/(2*ne);ae>=0&&ae<=1&&(ie[se++]=ae),ve>=0&&ve<=1&&(ie[se++]=ve)}}return se}function F(Y,Q,ee,z,ie,re){var ne=(Q-Y)*ie+Y,oe=(ee-Q)*ie+Q,se=(z-ee)*ie+ee,ae=(oe-ne)*ie+ne,fe=(se-oe)*ie+oe,de=(fe-ae)*ie+ae;re[0]=Y,re[1]=ne,re[2]=ae,re[3]=de,re[4]=de,re[5]=fe,re[6]=se,re[7]=z}function k(Y,Q,ee,z,ie,re,ne,oe,se,ae,fe){var de,ve=.005,pe=1/0,ce,he,Ce,Se;T[0]=se,T[1]=ae;for(var De=0;De<1;De+=.05)S[0]=D(Y,ee,ie,ne,De),S[1]=D(Q,z,re,oe,De),Ce=v(T,S),Ce=0&&Ce=0&&ae<=1&&(ie[se++]=ae)}}else{var fe=ne*ne-4*re*oe;if(I(fe)){var ae=-ne/(2*re);ae>=0&&ae<=1&&(ie[se++]=ae)}else if(fe>0){var de=x(fe),ae=(-ne+de)/(2*re),ve=(-ne-de)/(2*re);ae>=0&&ae<=1&&(ie[se++]=ae),ve>=0&&ve<=1&&(ie[se++]=ve)}}return se}function q(Y,Q,ee){var z=Y+ee-2*Q;return z===0?.5:(Y-Q)/z}function J(Y,Q,ee,z,ie){var re=(Q-Y)*z+Y,ne=(ee-Q)*z+Q,oe=(ne-re)*z+re;ie[0]=Y,ie[1]=re,ie[2]=oe,ie[3]=oe,ie[4]=ne,ie[5]=ee}function X(Y,Q,ee,z,ie,re,ne,oe,se){var ae,fe=.005,de=1/0;T[0]=ne,T[1]=oe;for(var ve=0;ve<1;ve+=.05){S[0]=U(Y,ee,ie,ve),S[1]=U(Q,z,re,ve);var pe=v(T,S);pe=0&&pe{var f=lf(),m=q3(),v=Math.min,y=Math.max,x=Math.sin,C=Math.cos,w=Math.PI*2,A=f.create(),E=f.create(),T=f.create();function S(O,F,k){if(O.length!==0){var U=O[0],G=U[0],j=U[0],q=U[1],J=U[1],X;for(X=1;X1e-4){J[0]=O-k,J[1]=F-U,X[0]=O+k,X[1]=F+U;return}if(A[0]=C(G)*k+O,A[1]=x(G)*U+F,E[0]=C(j)*k+O,E[1]=x(j)*U+F,Y(J,A,E),Q(X,A,E),G=G%w,G<0&&(G=G+w),j=j%w,j<0&&(j=j+w),G>j&&!q?j+=w:GG&&(T[0]=C(ie)*k+O,T[1]=x(ie)*U+F,Y(J,T,J),Q(X,T,X))}o.fromPoints=S,o.fromLine=M,o.fromCubic=D,o.fromQuadratic=L,o.fromArc=R}),oU=xt((o,f)=>{var m=q3(),v=lf(),y=Vj(),x=Of(),C=yie(),w=C.devicePixelRatio,A={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},E=[],T=[],S=[],M=[],I=Math.min,P=Math.max,D=Math.cos,L=Math.sin,R=Math.sqrt,O=Math.abs,F=typeof Float32Array<"u",k=function(G){this._saveData=!G,this._saveData&&(this.data=[]),this._ctx=null};k.prototype={constructor:k,_xi:0,_yi:0,_x0:0,_y0:0,_ux:0,_uy:0,_len:0,_lineDash:null,_dashOffset:0,_dashIdx:0,_dashSum:0,setScale:function(G,j,q){q=q||0,this._ux=O(q/w/G)||0,this._uy=O(q/w/j)||0},getContext:function(){return this._ctx},beginPath:function(G){return this._ctx=G,G&&G.beginPath(),G&&(this.dpr=G.dpr),this._saveData&&(this._len=0),this._lineDash&&(this._lineDash=null,this._dashOffset=0),this},moveTo:function(G,j){return this.addData(A.M,G,j),this._ctx&&this._ctx.moveTo(G,j),this._x0=G,this._y0=j,this._xi=G,this._yi=j,this},lineTo:function(G,j){var q=O(G-this._xi)>this._ux||O(j-this._yi)>this._uy||this._len<5;return this.addData(A.L,G,j),this._ctx&&q&&(this._needsDash()?this._dashedLineTo(G,j):this._ctx.lineTo(G,j)),q&&(this._xi=G,this._yi=j),this},bezierCurveTo:function(G,j,q,J,X,Y){return this.addData(A.C,G,j,q,J,X,Y),this._ctx&&(this._needsDash()?this._dashedBezierTo(G,j,q,J,X,Y):this._ctx.bezierCurveTo(G,j,q,J,X,Y)),this._xi=X,this._yi=Y,this},quadraticCurveTo:function(G,j,q,J){return this.addData(A.Q,G,j,q,J),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(G,j,q,J):this._ctx.quadraticCurveTo(G,j,q,J)),this._xi=q,this._yi=J,this},arc:function(G,j,q,J,X,Y){return this.addData(A.A,G,j,q,q,J,X-J,0,Y?0:1),this._ctx&&this._ctx.arc(G,j,q,J,X,Y),this._xi=D(X)*q+G,this._yi=L(X)*q+j,this},arcTo:function(G,j,q,J,X){return this._ctx&&this._ctx.arcTo(G,j,q,J,X),this},rect:function(G,j,q,J){return this._ctx&&this._ctx.rect(G,j,q,J),this.addData(A.R,G,j,q,J),this},closePath:function(){this.addData(A.Z);var G=this._ctx,j=this._x0,q=this._y0;return G&&(this._needsDash()&&this._dashedLineTo(j,q),G.closePath()),this._xi=j,this._yi=q,this},fill:function(G){G&&G.fill(),this.toStatic()},stroke:function(G){G&&G.stroke(),this.toStatic()},setLineDash:function(G){if(G instanceof Array){this._lineDash=G,this._dashIdx=0;for(var j=0,q=0;qj.length&&(this._expandData(),j=this.data);for(var q=0;q0&&ne<=G||z<0&&ne>=G||z===0&&(ie>0&&oe<=j||ie<0&&oe>=j);)fe=this._dashIdx,se=X[fe],ne+=z*se,oe+=ie*se,this._dashIdx=(fe+1)%ae,!(z>0&&neQ||ie>0&&oeee)&&Y[fe%2?"moveTo":"lineTo"](z>=0?I(ne,G):P(ne,G),ie>=0?I(oe,j):P(oe,j));z=ne-G,ie=oe-j,this._dashOffset=-R(z*z+ie*ie)},_dashedBezierTo:function(G,j,q,J,X,Y){var Q=this._dashSum,ee=this._dashOffset,z=this._lineDash,ie=this._ctx,re=this._xi,ne=this._yi,oe,se,ae,fe=m.cubicAt,de=0,ve=this._dashIdx,pe=z.length,ce,he,Ce=0;for(ee<0&&(ee=Q+ee),ee%=Q,oe=0;oe<1;oe+=.1)se=fe(re,G,q,X,oe+.1)-fe(re,G,q,X,oe),ae=fe(ne,j,J,Y,oe+.1)-fe(ne,j,J,Y,oe),de+=R(se*se+ae*ae);for(;veee));ve++);for(oe=(Ce-ee)/de;oe<=1;)ce=fe(re,G,q,X,oe),he=fe(ne,j,J,Y,oe),ve%2?ie.moveTo(ce,he):ie.lineTo(ce,he),oe+=z[ve]/de,ve=(ve+1)%pe;ve%2!==0&&ie.lineTo(X,Y),se=X-ce,ae=Y-he,this._dashOffset=-R(se*se+ae*ae)},_dashedQuadraticTo:function(G,j,q,J){var X=q,Y=J;q=(q+2*G)/3,J=(J+2*j)/3,G=(this._xi+2*G)/3,j=(this._yi+2*j)/3,this._dashedBezierTo(G,j,q,J,X,Y)},toStatic:function(){var G=this.data;G instanceof Array&&(G.length=this._len,F&&(this.data=new Float32Array(G)))},getBoundingRect:function(){E[0]=E[1]=S[0]=S[1]=Number.MAX_VALUE,T[0]=T[1]=M[0]=M[1]=-Number.MAX_VALUE;for(var G=this.data,j=0,q=0,J=0,X=0,Y=0;Yz||O(ee-Y)>ie||ne===re-1)&&(G.lineTo(Q,ee),X=Q,Y=ee);break;case A.C:G.bezierCurveTo(j[ne++],j[ne++],j[ne++],j[ne++],j[ne++],j[ne++]),X=j[ne-2],Y=j[ne-1];break;case A.Q:G.quadraticCurveTo(j[ne++],j[ne++],j[ne++],j[ne++]),X=j[ne-2],Y=j[ne-1];break;case A.A:var se=j[ne++],ae=j[ne++],fe=j[ne++],de=j[ne++],ve=j[ne++],pe=j[ne++],ce=j[ne++],he=j[ne++],Ce=fe>de?fe:de,Se=fe>de?1:fe/de,De=fe>de?de/fe:1,Oe=Math.abs(fe-de)>.001,Ue=ve+pe;Oe?(G.translate(se,ae),G.rotate(ce),G.scale(Se,De),G.arc(0,0,Ce,ve,Ue,1-he),G.scale(1/Se,1/De),G.rotate(-ce),G.translate(-se,-ae)):G.arc(se,ae,Ce,ve,Ue,1-he),ne===1&&(q=D(ve)*fe+se,J=L(ve)*de+ae),X=D(Ue)*fe+se,Y=L(Ue)*de+ae;break;case A.R:q=X=j[ne],J=Y=j[ne+1],G.rect(j[ne++],j[ne++],j[ne++],j[ne++]);break;case A.Z:G.closePath(),X=q,Y=J}}}},k.CMD=A;var U=k;f.exports=U}),L8e=xt(o=>{function f(m,v,y,x,C,w,A){if(C===0)return!1;var E=C,T=0,S=m;if(A>v+E&&A>x+E||Am+E&&w>y+E||w{var f=q3();function m(v,y,x,C,w,A,E,T,S,M,I){if(S===0)return!1;var P=S;if(I>y+P&&I>C+P&&I>A+P&&I>T+P||Iv+P&&M>x+P&&M>w+P&&M>E+P||M{var f=q3(),m=f.quadraticProjectPoint;function v(y,x,C,w,A,E,T,S,M){if(T===0)return!1;var I=T;if(M>x+I&&M>w+I&&M>E+I||My+I&&S>C+I&&S>A+I||S{var f=Math.PI*2;function m(v){return v%=f,v<0&&(v+=f),v}o.normalizeRadian=m}),T_t=xt(o=>{var f=O8e(),m=f.normalizeRadian,v=Math.PI*2;function y(x,C,w,A,E,T,S,M,I){if(S===0)return!1;var P=S;M-=x,I-=C;var D=Math.sqrt(M*M+I*I);if(D-P>w||D+PE&&(E+=v);var R=Math.atan2(I,M);return R<0&&(R+=v),R>=A&&R<=E||R+v>=A&&R+v<=E}o.containStroke=y}),N8e=xt((o,f)=>{function m(v,y,x,C,w,A){if(A>y&&A>C||Aw?E:0}f.exports=m}),S_t=xt(o=>{var f=oU(),m=L8e(),v=E_t(),y=R8e(),x=T_t(),C=O8e(),w=C.normalizeRadian,A=q3(),E=N8e(),T=f.CMD,S=Math.PI*2,M=1e-4;function I(j,q){return Math.abs(j-q)q&&re>X&&re>Q&&re>z||re1&&L(),ae=A.cubicAt(q,X,Q,z,D[0]),se>1&&(fe=A.cubicAt(q,X,Q,z,D[1]))),se===2?veq&&z>X&&z>Q||z=0&&re<=1){for(var ne=0,oe=A.quadraticAt(q,X,Q,re),se=0;seJ||z<-J)return 0;var ie=Math.sqrt(J*J-z*z);P[0]=-ie,P[1]=ie;var re=Math.abs(X-Y);if(re<1e-4)return 0;if(re%S<1e-4){X=0,Y=S;var ne=Q?1:-1;return ee>=P[0]+j&&ee<=P[1]+j?ne:0}if(Q){var ie=X;X=w(Y),Y=w(ie)}else X=w(X),Y=w(Y);X>Y&&(Y+=S);for(var oe=0,se=0;se<2;se++){var ae=P[se];if(ae+j>ee){var fe=Math.atan2(z,ae),ne=Q?1:-1;fe<0&&(fe=S+fe),(fe>=X&&fe<=Y||fe+S>=X&&fe+S<=Y)&&(fe>Math.PI/2&&fe1&&(J||(Q+=E(ee,z,ie,re,X,Y))),ne===1&&(ee=j[ne],z=j[ne+1],ie=ee,re=z),oe){case T.M:ie=j[ne++],re=j[ne++],ee=ie,z=re;break;case T.L:if(J){if(m.containStroke(ee,z,j[ne],j[ne+1],q,X,Y))return!0}else Q+=E(ee,z,j[ne],j[ne+1],X,Y)||0;ee=j[ne++],z=j[ne++];break;case T.C:if(J){if(v.containStroke(ee,z,j[ne++],j[ne++],j[ne++],j[ne++],j[ne],j[ne+1],q,X,Y))return!0}else Q+=R(ee,z,j[ne++],j[ne++],j[ne++],j[ne++],j[ne],j[ne+1],X,Y)||0;ee=j[ne++],z=j[ne++];break;case T.Q:if(J){if(y.containStroke(ee,z,j[ne++],j[ne++],j[ne],j[ne+1],q,X,Y))return!0}else Q+=O(ee,z,j[ne++],j[ne++],j[ne],j[ne+1],X,Y)||0;ee=j[ne++],z=j[ne++];break;case T.A:var se=j[ne++],ae=j[ne++],fe=j[ne++],de=j[ne++],ve=j[ne++],pe=j[ne++];ne+=1;var ce=1-j[ne++],De=Math.cos(ve)*fe+se,Oe=Math.sin(ve)*de+ae;ne>1?Q+=E(ee,z,De,Oe,X,Y):(ie=De,re=Oe);var he=(X-se)*de/fe+se;if(J){if(x.containStroke(se,ae,de,ve,ve+pe,ce,q,he,Y))return!0}else Q+=F(se,ae,de,ve,ve+pe,ce,he,Y);ee=Math.cos(ve+pe)*fe+se,z=Math.sin(ve+pe)*de+ae;break;case T.R:ie=ee=j[ne++],re=z=j[ne++];var Ce=j[ne++],Se=j[ne++],De=ie+Ce,Oe=re+Se;if(J){if(m.containStroke(ie,re,De,re,q,X,Y)||m.containStroke(De,re,De,Oe,q,X,Y)||m.containStroke(De,Oe,ie,Oe,q,X,Y)||m.containStroke(ie,Oe,ie,re,q,X,Y))return!0}else Q+=E(De,re,De,Oe,X,Y),Q+=E(ie,Oe,ie,re,X,Y);break;case T.Z:if(J){if(m.containStroke(ee,z,ie,re,q,X,Y))return!0}else Q+=E(ee,z,ie,re,X,Y);ee=ie,z=re;break}}return!J&&!I(z,re)&&(Q+=E(ee,z,ie,re,X,Y)||0),Q!==0}function U(j,q,J){return k(j,0,!1,q,J)}function G(j,q,J,X){return k(j,q,!0,J,X)}o.contain=U,o.containStroke=G}),am=xt((o,f)=>{var m=kj(),v=Wi(),y=oU(),x=S_t(),C=P8e(),w=C.prototype.getCanvasPattern,A=Math.abs,E=new y(!0);function T(M){m.call(this,M),this.path=null}T.prototype={constructor:T,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(M,I){var P=this.style,D=this.path||E,L=P.hasStroke(),R=P.hasFill(),O=P.fill,F=P.stroke,k=R&&!!O.colorStops,U=L&&!!F.colorStops,G=R&&!!O.image,j=L&&!!F.image;if(P.bind(M,this,I),this.setTransform(M),this.__dirty){var q;k&&(q=q||this.getBoundingRect(),this._fillGradient=P.getGradient(M,O,q)),U&&(q=q||this.getBoundingRect(),this._strokeGradient=P.getGradient(M,F,q))}k?M.fillStyle=this._fillGradient:G&&(M.fillStyle=w.call(O,M)),U?M.strokeStyle=this._strokeGradient:j&&(M.strokeStyle=w.call(F,M));var J=P.lineDash,X=P.lineDashOffset,Y=!!M.setLineDash,Q=this.getGlobalScale();if(D.setScale(Q[0],Q[1],this.segmentIgnoreThreshold),this.__dirtyPath||J&&!Y&&L?(D.beginPath(M),J&&!Y&&(D.setLineDash(J),D.setLineDashOffset(X)),this.buildPath(D,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(M.beginPath(),this.path.rebuildPath(M)),R)if(P.fillOpacity!=null){var ee=M.globalAlpha;M.globalAlpha=P.fillOpacity*P.opacity,D.fill(M),M.globalAlpha=ee}else D.fill(M);if(J&&Y&&(M.setLineDash(J),M.lineDashOffset=X),L)if(P.strokeOpacity!=null){var ee=M.globalAlpha;M.globalAlpha=P.strokeOpacity*P.opacity,D.stroke(M),M.globalAlpha=ee}else D.stroke(M);J&&Y&&M.setLineDash([]),P.text!=null&&(this.restoreTransform(M),this.drawRectText(M,this.getBoundingRect()))},buildPath:function(M,I,P){},createPathProxy:function(){this.path=new y},getBoundingRect:function(){var M=this._rect,I=this.style,P=!M;if(P){var D=this.path;D||(D=this.path=new y),this.__dirtyPath&&(D.beginPath(),this.buildPath(D,this.shape,!1)),M=D.getBoundingRect()}if(this._rect=M,I.hasStroke()){var L=this._rectWithStroke||(this._rectWithStroke=M.clone());if(this.__dirty||P){L.copy(M);var R=I.lineWidth,O=I.strokeNoScale?this.getLineScale():1;I.hasFill()||(R=Math.max(R,this.strokeContainThreshold||4)),O>1e-10&&(L.width+=R/O,L.height+=R/O,L.x-=R/O/2,L.y-=R/O/2)}return L}return M},contain:function(M,I){var P=this.transformCoordToLocal(M,I),D=this.getBoundingRect(),L=this.style;if(M=P[0],I=P[1],D.contain(M,I)){var R=this.path.data;if(L.hasStroke()){var O=L.lineWidth,F=L.strokeNoScale?this.getLineScale():1;if(F>1e-10&&(L.hasFill()||(O=Math.max(O,this.strokeContainThreshold)),x.containStroke(R,O/F,M,I)))return!0}if(L.hasFill())return x.contain(R,M,I)}return!1},dirty:function(M){M==null&&(M=!0),M&&(this.__dirtyPath=M,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(M){return this.animate("shape",M)},attrKV:function(M,I){M==="shape"?(this.setShape(I),this.__dirtyPath=!0,this._rect=null):m.prototype.attrKV.call(this,M,I)},setShape:function(M,I){var P=this.shape;if(P){if(v.isObject(M))for(var D in M)M.hasOwnProperty(D)&&(P[D]=M[D]);else P[M]=I;this.dirty(!0)}return this},getLineScale:function(){var M=this.transform;return M&&A(M[0]-1)>1e-10&&A(M[3]-1)>1e-10?Math.sqrt(A(M[0]*M[3]-M[2]*M[1])):1}},T.extend=function(M){var I=function(D){T.call(this,D),M.style&&this.style.extendFrom(M.style,!1);var L=M.shape;if(L){this.shape=this.shape||{};var R=this.shape;for(var O in L)!R.hasOwnProperty(O)&&L.hasOwnProperty(O)&&(R[O]=L[O])}M.init&&M.init.call(this,D)};v.inherits(I,T);for(var P in M)P!=="style"&&P!=="shape"&&(I.prototype[P]=M[P]);return I},v.inherits(T,m);var S=T;f.exports=S}),P_t=xt((o,f)=>{var m=oU(),v=lf(),y=v.applyTransform,x=m.CMD,C=[[],[],[]],w=Math.sqrt,A=Math.atan2;function E(T,S){var M=T.data,I,P,D,L,R,O,F=x.M,k=x.C,U=x.L,G=x.R,j=x.A,q=x.Q;for(D=0,L=0;D{var f=am(),m=oU(),v=P_t(),y=Math.sqrt,x=Math.sin,C=Math.cos,w=Math.PI,A=function(F){return Math.sqrt(F[0]*F[0]+F[1]*F[1])},E=function(F,k){return(F[0]*k[0]+F[1]*k[1])/(A(F)*A(k))},T=function(F,k){return(F[0]*k[1]1&&(J*=y(ne),X*=y(ne));var oe=(j===q?-1:1)*y((J*J*(X*X)-J*J*(re*re)-X*X*(ie*ie))/(J*J*(re*re)+X*X*(ie*ie)))||0,se=oe*J*re/X,ae=oe*-X*ie/J,fe=(F+U)/2+C(z)*se-x(z)*ae,de=(k+G)/2+x(z)*se+C(z)*ae,ve=T([1,0],[(ie-se)/J,(re-ae)/X]),pe=[(ie-se)/J,(re-ae)/X],ce=[(-1*ie-se)/J,(-1*re-ae)/X],he=T(pe,ce);E(pe,ce)<=-1&&(he=w),E(pe,ce)>=1&&(he=0),q===0&&he>0&&(he=he-2*w),q===1&&he<0&&(he=he+2*w),ee.addData(Q,fe,de,J,X,ve,he,z,q)}var M=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,I=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function P(F){if(!F)return new m;for(var k=0,U=0,G=k,j=U,q,J=new m,X=m.CMD,Y=F.match(M),Q=0;Q{var m=kj(),v=Wi(),y=nb(),x=Cie(),C=xie(),w=C.ContextCachedBy,A=function(T){m.call(this,T)};A.prototype={constructor:A,type:"text",brush:function(T,S){var M=this.style;this.__dirty&&x.normalizeTextStyle(M,!0),M.fill=M.stroke=M.shadowBlur=M.shadowColor=M.shadowOffsetX=M.shadowOffsetY=null;var I=M.text;if(I!=null&&(I+=""),!x.needDrawText(I,M)){T.__attrCachedBy=w.NONE;return}this.setTransform(T),x.renderText(this,T,I,M,null,S),this.restoreTransform(T)},getBoundingRect:function(){var T=this.style;if(this.__dirty&&x.normalizeTextStyle(T,!0),!this._rect){var S=T.text;S!=null?S+="":S="";var M=y.getBoundingRect(T.text+"",T.font,T.textAlign,T.textVerticalAlign,T.textPadding,T.textLineHeight,T.rich);if(M.x+=T.x||0,M.y+=T.y||0,x.getStroke(T.textStroke,T.textStrokeWidth)){var I=T.textStrokeWidth;M.x-=I/2,M.y-=I/2,M.width+=I,M.height+=I}this._rect=M}return this._rect}},v.inherits(A,m);var E=A;f.exports=E}),B8e=xt((o,f)=>{var m=am(),v=m.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(y,x,C){C&&y.moveTo(x.cx+x.r,x.cy),y.arc(x.cx,x.cy,x.r,0,Math.PI*2,!0)}});f.exports=v}),k8e=xt((o,f)=>{var m=Tm(),v=[["shadowBlur",0],["shadowColor","#000"],["shadowOffsetX",0],["shadowOffsetY",0]];function y(x){return m.browser.ie&&m.browser.version>=11?function(){var C=this.__clipPaths,w=this.style,A;if(C)for(var E=0;E{var m=am(),v=k8e(),y=m.extend({type:"sector",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:Math.PI*2,clockwise:!0},brush:v(m.prototype.brush),buildPath:function(x,C){var w=C.cx,A=C.cy,E=Math.max(C.r0||0,0),T=Math.max(C.r,0),S=C.startAngle,M=C.endAngle,I=C.clockwise,P=Math.cos(S),D=Math.sin(S);x.moveTo(P*E+w,D*E+A),x.lineTo(P*T+w,D*T+A),x.arc(w,A,T,S,M,!I),x.lineTo(Math.cos(M)*E+w,Math.sin(M)*E+A),E!==0&&x.arc(w,A,E,M,S,I),x.closePath()}});f.exports=y}),M_t=xt((o,f)=>{var m=am(),v=m.extend({type:"ring",shape:{cx:0,cy:0,r:0,r0:0},buildPath:function(y,x){var C=x.cx,w=x.cy,A=Math.PI*2;y.moveTo(C+x.r,w),y.arc(C,w,x.r,0,A,!1),y.moveTo(C+x.r0,w),y.arc(C,w,x.r0,0,A,!0)}});f.exports=v}),D_t=xt((o,f)=>{var m=lf(),v=m.distance;function y(C,w,A,E,T,S,M){var I=(A-C)*.5,P=(E-w)*.5;return(2*(w-A)+I+P)*M+(-3*(w-A)-2*I-P)*S+I*T+w}function x(C,w){for(var A=C.length,E=[],T=0,S=1;SA-2?A-1:P+1],F=C[P>A-3?A-1:P+2]);var k=D*D,U=D*k;E.push([y(L[0],R[0],O[0],F[0],D,k,U),y(L[1],R[1],O[1],F[1],D,k,U)])}return E}f.exports=x}),L_t=xt((o,f)=>{var m=lf(),v=m.min,y=m.max,x=m.scale,C=m.distance,w=m.add,A=m.clone,E=m.sub;function T(S,M,I,P){var D=[],L=[],R=[],O=[],F,k,U,G;if(P){U=[1/0,1/0],G=[-1/0,-1/0];for(var j=0,q=S.length;j{var f=D_t(),m=L_t();function v(y,x,C){var w=x.points,A=x.smooth;if(w&&w.length>=2){if(A&&A!=="spline"){var E=m(w,A,C,x.smoothConstraint);y.moveTo(w[0][0],w[0][1]);for(var T=w.length,S=0;S<(C?T:T-1);S++){var M=E[S*2],I=E[S*2+1],P=w[(S+1)%T];y.bezierCurveTo(M[0],M[1],I[0],I[1],P[0],P[1])}}else{A==="spline"&&(w=f(w,C)),y.moveTo(w[0][0],w[0][1]);for(var S=1,D=w.length;S{var m=am(),v=V8e(),y=m.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(x,C){v.buildPath(x,C,!0)}});f.exports=y}),H8e=xt((o,f)=>{var m=am(),v=V8e(),y=m.extend({type:"polyline",shape:{points:null,smooth:!1,smoothConstraint:null},style:{stroke:"#000",fill:null},buildPath:function(x,C){v.buildPath(x,C,!1)}});f.exports=y}),g0e=xt(o=>{var f=Math.round;function m(x,C,w){if(C){var A=C.x1,E=C.x2,T=C.y1,S=C.y2;x.x1=A,x.x2=E,x.y1=T,x.y2=S;var M=w&&w.lineWidth;M&&(f(A*2)===f(E*2)&&(x.x1=x.x2=y(A,M,!0)),f(T*2)===f(S*2)&&(x.y1=x.y2=y(T,M,!0)))}}function v(x,C,w){if(C){var A=C.x,E=C.y,T=C.width,S=C.height;x.x=A,x.y=E,x.width=T,x.height=S;var M=w&&w.lineWidth;M&&(x.x=y(A,M,!0),x.y=y(E,M,!0),x.width=Math.max(y(A+T,M,!1)-x.x,T===0?0:1),x.height=Math.max(y(E+S,M,!1)-x.y,S===0?0:1))}}function y(x,C,w){if(!C)return x;var A=f(x*2);return(A+f(C))%2===0?A/2:(A+(w?1:-1))/2}o.subPixelOptimizeLine=m,o.subPixelOptimizeRect=v,o.subPixelOptimize=y}),_0e=xt((o,f)=>{var m=am(),v=M8e(),y=g0e(),x=y.subPixelOptimizeRect,C={},w=m.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(A,E){var T,S,M,I;this.subPixelOptimize?(x(C,E,this.style),T=C.x,S=C.y,M=C.width,I=C.height,C.r=E.r,E=C):(T=E.x,S=E.y,M=E.width,I=E.height),E.r?v.buildPath(A,E):A.rect(T,S,M,I),A.closePath()}});f.exports=w}),U8e=xt((o,f)=>{var m=am(),v=g0e(),y=v.subPixelOptimizeLine,x={},C=m.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(w,A){var E,T,S,M;this.subPixelOptimize?(y(x,A,this.style),E=x.x1,T=x.y1,S=x.x2,M=x.y2):(E=A.x1,T=A.y1,S=A.x2,M=A.y2);var I=A.percent;I!==0&&(w.moveTo(E,T),I<1&&(S=E*(1-I)+S*I,M=T*(1-I)+M*I),w.lineTo(S,M))},pointAt:function(w){var A=this.shape;return[A.x1*(1-w)+A.x2*w,A.y1*(1-w)+A.y2*w]}});f.exports=C}),R_t=xt((o,f)=>{var m=am(),v=lf(),y=q3(),x=y.quadraticSubdivide,C=y.cubicSubdivide,w=y.quadraticAt,A=y.cubicAt,E=y.quadraticDerivativeAt,T=y.cubicDerivativeAt,S=[];function M(P,D,L){var R=P.cpx2,O=P.cpy2;return R===null||O===null?[(L?T:A)(P.x1,P.cpx1,P.cpx2,P.x2,D),(L?T:A)(P.y1,P.cpy1,P.cpy2,P.y2,D)]:[(L?E:w)(P.x1,P.cpx1,P.x2,D),(L?E:w)(P.y1,P.cpy1,P.y2,D)]}var I=m.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(P,D){var L=D.x1,R=D.y1,O=D.x2,F=D.y2,k=D.cpx1,U=D.cpy1,G=D.cpx2,j=D.cpy2,q=D.percent;q!==0&&(P.moveTo(L,R),G==null||j==null?(q<1&&(x(L,k,O,q,S),k=S[1],O=S[2],x(R,U,F,q,S),U=S[1],F=S[2]),P.quadraticCurveTo(k,U,O,F)):(q<1&&(C(L,k,G,O,q,S),k=S[1],G=S[2],O=S[3],C(R,U,j,F,q,S),U=S[1],j=S[2],F=S[3]),P.bezierCurveTo(k,U,G,j,O,F)))},pointAt:function(P){return M(this.shape,P,!1)},tangentAt:function(P){var D=M(this.shape,P,!0);return v.normalize(D,D)}});f.exports=I}),O_t=xt((o,f)=>{var m=am(),v=m.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:Math.PI*2,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(y,x){var C=x.cx,w=x.cy,A=Math.max(x.r,0),E=x.startAngle,T=x.endAngle,S=x.clockwise,M=Math.cos(E),I=Math.sin(E);y.moveTo(M*A+C,I*A+w),y.arc(C,w,A,E,T,!S)}});f.exports=v}),N_t=xt((o,f)=>{var m=am(),v=m.extend({type:"compound",shape:{paths:null},_updatePathDirty:function(){for(var y=this.__dirtyPath,x=this.shape.paths,C=0;C{var m=function(y){this.colorStops=y||[]};m.prototype={constructor:m,addColorStop:function(y,x){this.colorStops.push({offset:y,color:x})}};var v=m;f.exports=v}),v0e=xt((o,f)=>{var m=Wi(),v=wie(),y=function(C,w,A,E,T,S){this.x=C??0,this.y=w??0,this.x2=A??1,this.y2=E??0,this.type="linear",this.global=S||!1,v.call(this,T)};y.prototype={constructor:y},m.inherits(y,v);var x=y;f.exports=x}),F_t=xt((o,f)=>{var m=Wi(),v=wie(),y=function(C,w,A,E,T){this.x=C??.5,this.y=w??.5,this.r=A??.5,this.type="radial",this.global=T||!1,v.call(this,E)};y.prototype={constructor:y},m.inherits(y,v);var x=y;f.exports=x}),y0e=xt((o,f)=>{var m=Wi(),v=m.inherits,y=kj(),x=Of();function C(E){y.call(this,E),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}C.prototype.incremental=!0,C.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},C.prototype.addDisplayable=function(E,T){T?this._temporaryDisplayables.push(E):this._displayables.push(E),this.dirty()},C.prototype.addDisplayables=function(E,T){T=T||!1;for(var S=0;S{var f=Wi(),m=F8e(),v=k2(),y=Ky(),x=lf(),C=am(),w=vie(),A=rU();o.Image=A;var E=rB();o.Group=E;var T=nB();o.Text=T;var S=B8e();o.Circle=S;var M=I_t();o.Sector=M;var I=M_t();o.Ring=I;var P=z8e();o.Polygon=P;var D=H8e();o.Polyline=D;var L=_0e();o.Rect=L;var R=U8e();o.Line=R;var O=R_t();o.BezierCurve=O;var F=O_t();o.Arc=F;var k=N_t();o.CompoundPath=k;var U=v0e();o.LinearGradient=U;var G=F_t();o.RadialGradient=G;var j=Of();o.BoundingRect=j;var q=y0e();o.IncrementalDisplayable=q;var J=g0e(),X=Math.max,Y=Math.min,Q={},ee=1,z={color:"textFill",textBorderColor:"textStroke",textBorderWidth:"textStrokeWidth"},ie="emphasis",re="normal",ne=1,oe={},se={};function ae(nt){return C.extend(nt)}function fe(nt,wt){return m.extendFromString(nt,wt)}function de(nt,wt){se[nt]=wt}function ve(nt){if(se.hasOwnProperty(nt))return se[nt]}function pe(nt,wt,yt,Tt){var Et=m.createFromString(nt,wt);return yt&&(Tt==="center"&&(yt=he(yt,Et.getBoundingRect())),Se(Et,yt)),Et}function ce(nt,wt,yt){var Tt=new A({style:{image:nt,x:wt.x,y:wt.y,width:wt.width,height:wt.height},onload:function(Et){if(yt==="center"){var ti={width:Et.width,height:Et.height};Tt.setStyle(he(wt,ti))}}});return Tt}function he(nt,wt){var yt=wt.width/wt.height,Tt=nt.height*yt,Et;Tt<=nt.width?Et=nt.height:(Tt=nt.width,Et=Tt/yt);var ti=nt.x+nt.width/2,ir=nt.y+nt.height/2;return{x:ti-Tt/2,y:ir-Et/2,width:Tt,height:Et}}var Ce=m.mergePath;function Se(nt,wt){if(nt.applyTransform){var yt=nt.getBoundingRect(),Tt=yt.calculateTransform(wt);nt.applyTransform(Tt)}}function De(nt){return J.subPixelOptimizeLine(nt.shape,nt.shape,nt.style),nt}function Oe(nt){return J.subPixelOptimizeRect(nt.shape,nt.shape,nt.style),nt}var Ue=J.subPixelOptimize;function Xe(nt){return nt!=null&&nt!=="none"}var it=f.createHashMap(),ut=0;function at(nt){if(typeof nt!="string")return nt;var wt=it.get(nt);return wt||(wt=v.lift(nt,-.1),ut<1e4&&(it.set(nt,wt),ut++)),wt}function Pt(nt){if(nt.__hoverStlDirty){nt.__hoverStlDirty=!1;var wt=nt.__hoverStl;if(!wt){nt.__cachedNormalStl=nt.__cachedNormalZ2=null;return}var yt=nt.__cachedNormalStl={};nt.__cachedNormalZ2=nt.z2;var Tt=nt.style;for(var Et in wt)wt[Et]!=null&&(yt[Et]=Tt[Et]);yt.fill=Tt.fill,yt.stroke=Tt.stroke}}function Qe(nt){var wt=nt.__hoverStl;if(!(!wt||nt.__highlighted)){var yt=nt.__zr,Tt=nt.useHoverLayer&&yt&&yt.painter.type==="canvas";if(nt.__highlighted=Tt?"layer":"plain",!(nt.isGroup||!yt&&nt.useHoverLayer)){var Et=nt,ti=nt.style;Tt&&(Et=yt.addHover(nt),ti=Et.style),wr(ti),Tt||Pt(Et),ti.extendFrom(wt),ft(ti,wt,"fill"),ft(ti,wt,"stroke"),pt(ti),Tt||(nt.dirty(!1),nt.z2+=ee)}}}function ft(nt,wt,yt){!Xe(wt[yt])&&Xe(nt[yt])&&(nt[yt]=at(nt[yt]))}function Ot(nt){var wt=nt.__highlighted;if(wt&&(nt.__highlighted=!1,!nt.isGroup))if(wt==="layer")nt.__zr&&nt.__zr.removeHover(nt);else{var yt=nt.style,Tt=nt.__cachedNormalStl;Tt&&(wr(yt),nt.setStyle(Tt),pt(yt));var Et=nt.__cachedNormalZ2;Et!=null&&nt.z2-Et===ee&&(nt.z2=Et)}}function Xt(nt,wt,yt){var Tt=re,Et=re,ti;nt.__highlighted&&(Tt=ie,ti=!0),wt(nt,yt),nt.__highlighted&&(Et=ie,ti=!0),nt.isGroup&&nt.traverse(function(ir){!ir.isGroup&&wt(ir,yt)}),ti&&nt.__highDownOnUpdate&&nt.__highDownOnUpdate(Tt,Et)}function At(nt,wt){wt=nt.__hoverStl=wt!==!1&&(nt.hoverStyle||wt||{}),nt.__hoverStlDirty=!0,nt.__highlighted&&(nt.__cachedNormalStl=null,Ot(nt),Qe(nt))}function bt(nt){!bi(this,nt)&&!this.__highByOuter&&Xt(this,Qe)}function gt(nt){!bi(this,nt)&&!this.__highByOuter&&Xt(this,Ot)}function It(nt){this.__highByOuter|=1<<(nt||0),Xt(this,Qe)}function Jt(nt){!(this.__highByOuter&=~(1<<(nt||0)))&&Xt(this,Ot)}function bi(nt,wt){return nt.__highDownSilentOnTouch&&wt.zrByTouch}function Yi(nt,wt){ii(nt,!0),Xt(nt,At,wt)}function ii(nt,wt){var yt=wt===!1;if(nt.__highDownSilentOnTouch=nt.highDownSilentOnTouch,nt.__highDownOnUpdate=nt.highDownOnUpdate,!yt||nt.__highDownDispatcher){var Tt=yt?"off":"on";nt[Tt]("mouseover",bt)[Tt]("mouseout",gt),nt[Tt]("emphasis",It)[Tt]("normal",Jt),nt.__highByOuter=nt.__highByOuter||0,nt.__highDownDispatcher=!yt}}function ei(nt){return!!(nt&&nt.__highDownDispatcher)}function Li(nt){var wt=oe[nt];return wt==null&&ne<=32&&(wt=oe[nt]=ne++),wt}function Je(nt,wt,yt,Tt,Et,ti,ir){Et=Et||Q;var or=Et.labelFetcher,xr=Et.labelDataIndex,Tn=Et.labelDimIndex,Ii=Et.labelProp,pr=yt.getShallow("show"),yn=Tt.getShallow("show"),dn;(pr||yn)&&(or&&(dn=or.getFormattedLabel(xr,"normal",null,Tn,Ii)),dn==null&&(dn=f.isFunction(Et.defaultText)?Et.defaultText(xr,Et):Et.defaultText));var fn=pr?dn:null,Or=yn?f.retrieve2(or?or.getFormattedLabel(xr,"emphasis",null,Tn,Ii):null,dn):null;(fn!=null||Or!=null)&&(yi(nt,yt,ti,Et),yi(wt,Tt,ir,Et,!0)),nt.text=fn,wt.text=Or}function Nt(nt,wt,yt){var Tt=nt.style;wt&&(wr(Tt),nt.setStyle(wt),pt(Tt)),Tt=nt.__hoverStl,yt&&Tt&&(wr(Tt),f.extend(Tt,yt),pt(Tt))}function yi(nt,wt,yt,Tt,Et){return wi(nt,wt,Tt,Et),yt&&f.extend(nt,yt),nt}function ai(nt,wt,yt){var Tt={isRectText:!0},Et;yt===!1?Et=!0:Tt.autoColor=yt,wi(nt,wt,Tt,Et)}function wi(nt,wt,yt,Tt){if(yt=yt||Q,yt.isRectText){var Et;yt.getTextPosition?Et=yt.getTextPosition(wt,Tt):(Et=wt.getShallow("position")||(Tt?null:"inside"),Et==="outside"&&(Et="top")),nt.textPosition=Et,nt.textOffset=wt.getShallow("offset");var ti=wt.getShallow("rotate");ti!=null&&(ti*=Math.PI/180),nt.textRotation=ti,nt.textDistance=f.retrieve2(wt.getShallow("distance"),Tt?null:5)}var ir=wt.ecModel,or=ir&&ir.option.textStyle,xr=ji(wt),Tn;if(xr){Tn={};for(var Ii in xr)if(xr.hasOwnProperty(Ii)){var pr=wt.getModel(["rich",Ii]);hi(Tn[Ii]={},pr,or,yt,Tt)}}return nt.rich=Tn,hi(nt,wt,or,yt,Tt,!0),yt.forceRich&&!yt.textStyle&&(yt.textStyle={}),nt}function ji(nt){for(var wt;nt&&nt!==nt.ecModel;){var yt=(nt.option||Q).rich;if(yt){wt=wt||{};for(var Tt in yt)yt.hasOwnProperty(Tt)&&(wt[Tt]=1)}nt=nt.parentModel}return wt}function hi(nt,wt,yt,Tt,Et,ti){yt=!Et&&yt||Q,nt.textFill=Ri(wt.getShallow("color"),Tt)||yt.color,nt.textStroke=Ri(wt.getShallow("textBorderColor"),Tt)||yt.textBorderColor,nt.textStrokeWidth=f.retrieve2(wt.getShallow("textBorderWidth"),yt.textBorderWidth),Et||(ti&&(nt.insideRollbackOpt=Tt,pt(nt)),nt.textFill==null&&(nt.textFill=Tt.autoColor)),nt.fontStyle=wt.getShallow("fontStyle")||yt.fontStyle,nt.fontWeight=wt.getShallow("fontWeight")||yt.fontWeight,nt.fontSize=wt.getShallow("fontSize")||yt.fontSize,nt.fontFamily=wt.getShallow("fontFamily")||yt.fontFamily,nt.textAlign=wt.getShallow("align"),nt.textVerticalAlign=wt.getShallow("verticalAlign")||wt.getShallow("baseline"),nt.textLineHeight=wt.getShallow("lineHeight"),nt.textWidth=wt.getShallow("width"),nt.textHeight=wt.getShallow("height"),nt.textTag=wt.getShallow("tag"),(!ti||!Tt.disableBox)&&(nt.textBackgroundColor=Ri(wt.getShallow("backgroundColor"),Tt),nt.textPadding=wt.getShallow("padding"),nt.textBorderColor=Ri(wt.getShallow("borderColor"),Tt),nt.textBorderWidth=wt.getShallow("borderWidth"),nt.textBorderRadius=wt.getShallow("borderRadius"),nt.textBoxShadowColor=wt.getShallow("shadowColor"),nt.textBoxShadowBlur=wt.getShallow("shadowBlur"),nt.textBoxShadowOffsetX=wt.getShallow("shadowOffsetX"),nt.textBoxShadowOffsetY=wt.getShallow("shadowOffsetY")),nt.textShadowColor=wt.getShallow("textShadowColor")||yt.textShadowColor,nt.textShadowBlur=wt.getShallow("textShadowBlur")||yt.textShadowBlur,nt.textShadowOffsetX=wt.getShallow("textShadowOffsetX")||yt.textShadowOffsetX,nt.textShadowOffsetY=wt.getShallow("textShadowOffsetY")||yt.textShadowOffsetY}function Ri(nt,wt){return nt!=="auto"?nt:wt&&wt.autoColor?wt.autoColor:null}function pt(nt){var wt=nt.textPosition,yt=nt.insideRollbackOpt,Tt;if(yt&&nt.textFill==null){var Et=yt.autoColor,ti=yt.isRectText,ir=yt.useInsideStyle,or=ir!==!1&&(ir===!0||ti&&wt&&typeof wt=="string"&&wt.indexOf("inside")>=0),xr=!or&&Et!=null;(or||xr)&&(Tt={textFill:nt.textFill,textStroke:nt.textStroke,textStrokeWidth:nt.textStrokeWidth}),or&&(nt.textFill="#fff",nt.textStroke==null&&(nt.textStroke=Et,nt.textStrokeWidth==null&&(nt.textStrokeWidth=2))),xr&&(nt.textFill=Et)}nt.insideRollback=Tt}function wr(nt){var wt=nt.insideRollback;wt&&(nt.textFill=wt.textFill,nt.textStroke=wt.textStroke,nt.textStrokeWidth=wt.textStrokeWidth,nt.insideRollback=null)}function zi(nt,wt){var yt=wt&&wt.getModel("textStyle");return f.trim([nt.fontStyle||yt&&yt.getShallow("fontStyle")||"",nt.fontWeight||yt&&yt.getShallow("fontWeight")||"",(nt.fontSize||yt&&yt.getShallow("fontSize")||12)+"px",nt.fontFamily||yt&&yt.getShallow("fontFamily")||"sans-serif"].join(" "))}function Ui(nt,wt,yt,Tt,Et,ti){typeof Et=="function"&&(ti=Et,Et=null);var ir=Tt&&Tt.isAnimationEnabled();if(ir){var or=nt?"Update":"",xr=Tt.getShallow("animationDuration"+or),Tn=Tt.getShallow("animationEasing"+or),Ii=Tt.getShallow("animationDelay"+or);typeof Ii=="function"&&(Ii=Ii(Et,Tt.getAnimationDelayParams?Tt.getAnimationDelayParams(wt,Et):null)),typeof xr=="function"&&(xr=xr(Et)),xr>0?wt.animateTo(yt,xr,Ii||0,Tn,ti,!!ti):(wt.stopAnimation(),wt.attr(yt),ti&&ti())}else wt.stopAnimation(),wt.attr(yt),ti&&ti()}function Gt(nt,wt,yt,Tt,Et){Ui(!0,nt,wt,yt,Tt,Et)}function $t(nt,wt,yt,Tt,Et){Ui(!1,nt,wt,yt,Tt,Et)}function jt(nt,wt){for(var yt=y.identity([]);nt&&nt!==wt;)y.mul(yt,nt.getLocalTransform(),yt),nt=nt.parent;return yt}function ct(nt,wt,yt){return wt&&!f.isArrayLike(wt)&&(wt=w.getLocalTransform(wt)),yt&&(wt=y.invert([],wt)),x.applyTransform([],nt,wt)}function Pe(nt,wt,yt){var Tt=wt[4]===0||wt[5]===0||wt[0]===0?1:Math.abs(2*wt[4]/wt[0]),Et=wt[4]===0||wt[5]===0||wt[2]===0?1:Math.abs(2*wt[4]/wt[2]),ti=[nt==="left"?-Tt:nt==="right"?Tt:0,nt==="top"?-Et:nt==="bottom"?Et:0];return ti=ct(ti,wt,yt),Math.abs(ti[0])>Math.abs(ti[1])?ti[0]>0?"right":"left":ti[1]>0?"bottom":"top"}function Ht(nt,wt,yt,Tt){if(!nt||!wt)return;function Et(or){var xr={};return or.traverse(function(Tn){!Tn.isGroup&&Tn.anid&&(xr[Tn.anid]=Tn)}),xr}function ti(or){var xr={position:x.clone(or.position),rotation:or.rotation};return or.shape&&(xr.shape=f.extend({},or.shape)),xr}var ir=Et(nt);wt.traverse(function(or){if(!or.isGroup&&or.anid){var xr=ir[or.anid];if(xr){var Tn=ti(or);or.attr(ti(xr)),Gt(or,Tn,yt,or.dataIndex)}}})}function si(nt,wt){return f.map(nt,function(yt){var Tt=yt[0];Tt=X(Tt,wt.x),Tt=Y(Tt,wt.x+wt.width);var Et=yt[1];return Et=X(Et,wt.y),Et=Y(Et,wt.y+wt.height),[Tt,Et]})}function _t(nt,wt){var yt=X(nt.x,wt.x),Tt=Y(nt.x+nt.width,wt.x+wt.width),Et=X(nt.y,wt.y),ti=Y(nt.y+nt.height,wt.y+wt.height);if(Tt>=yt&&ti>=Et)return{x:yt,y:Et,width:Tt-yt,height:ti-Et}}function Yt(nt,wt,yt){wt=f.extend({rectHover:!0},wt);var Tt=wt.style={strokeNoScale:!0};if(yt=yt||{x:-1,y:-1,width:2,height:2},nt)return nt.indexOf("image://")===0?(Tt.image=nt.slice(8),f.defaults(Tt,yt),new A(wt)):pe(nt.replace("path://",""),wt,yt,"center")}function Fi(nt,wt,yt,Tt,Et){for(var ti=0,ir=Et[Et.length-1];ti1)return!1;var On=Lt(dn,fn,Ii,pr)/yn;return!(On<0||On>1)}function Lt(nt,wt,yt,Tt){return nt*Tt-yt*wt}function Si(nt){return nt<=1e-6&&nt>=-1e-6}de("circle",S),de("sector",M),de("ring",I),de("polygon",P),de("polyline",D),de("rect",L),de("line",R),de("bezierCurve",O),de("arc",F),o.Z2_EMPHASIS_LIFT=ee,o.CACHED_LABEL_STYLE_PROPERTIES=z,o.extendShape=ae,o.extendPath=fe,o.registerShape=de,o.getShapeClass=ve,o.makePath=pe,o.makeImage=ce,o.mergePath=Ce,o.resizePath=Se,o.subPixelOptimizeLine=De,o.subPixelOptimizeRect=Oe,o.subPixelOptimize=Ue,o.setElementHoverStyle=At,o.setHoverStyle=Yi,o.setAsHighDownDispatcher=ii,o.isHighDownDispatcher=ei,o.getHighlightDigit=Li,o.setLabelStyle=Je,o.modifyLabelStyle=Nt,o.setTextStyle=yi,o.setText=ai,o.getFont=zi,o.updateProps=Gt,o.initProps=$t,o.getTransform=jt,o.applyTransform=ct,o.transformDirection=Pe,o.groupTransition=Ht,o.clipPointsByRect=si,o.clipRectByRect=_t,o.createIcon=Yt,o.linePolygonIntersect=Fi,o.lineLineIntersect=Dt}),B_t=xt((o,f)=>{var m=nb(),v=xa(),y=["textStyle","color"],x={getTextColor:function(C){var w=this.ecModel;return this.getShallow("color")||(!C&&w?w.get(y):null)},getFont:function(){return v.getFont({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},getTextRect:function(C){return m.getBoundingRect(C,this.getFont(),this.getShallow("align"),this.getShallow("verticalAlign")||this.getShallow("baseline"),this.getShallow("padding"),this.getShallow("lineHeight"),this.getShallow("rich"),this.getShallow("truncateText"))}};f.exports=x}),k_t=xt((o,f)=>{var m=nU(),v=m([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["textPosition"],["textAlign"]]),y={getItemStyle:function(x,C){var w=v(this,x,C),A=this.getBorderLineDash();return A&&(w.lineDash=A),w},getBorderLineDash:function(){var x=this.get("borderType");return x==="solid"||x==null?null:x==="dashed"?[5,5]:[1,1]}};f.exports=y}),Sm=xt((o,f)=>{var m=Wi(),v=Tm(),y=vu(),x=y.makeInner,C=kM(),w=C.enableClassExtend,A=C.enableClassCheck,E=w_t(),T=A_t(),S=B_t(),M=k_t(),I=m.mixin,P=x();function D(F,k,U){this.parentModel=k,this.ecModel=U,this.option=F}D.prototype={constructor:D,init:null,mergeOption:function(F){m.merge(this.option,F,!0)},get:function(F,k){return F==null?this.option:L(this.option,this.parsePath(F),!k&&R(this,F))},getShallow:function(F,k){var U=this.option,G=U==null?U:U[F],j=!k&&R(this,F);return G==null&&j&&(G=j.getShallow(F)),G},getModel:function(F,k){var U=F==null?this.option:L(this.option,F=this.parsePath(F)),G;return k=k||(G=R(this,F))&&G.getModel(F),new D(U,k,this.ecModel)},isEmpty:function(){return this.option==null},restoreData:function(){},clone:function(){var F=this.constructor;return new F(m.clone(this.option))},setReadOnly:function(F){},parsePath:function(F){return typeof F=="string"&&(F=F.split(".")),F},customizeGetParent:function(F){P(this).getParent=F},isAnimationEnabled:function(){if(!v.node){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}}};function L(F,k,U){for(var G=0;G{var f=Wi(),m=kM(),v=m.parseClassType,y=0;function x(A){return[A||"",y++,Math.random().toFixed(5)].join("_")}function C(A){var E={};return A.registerSubTypeDefaulter=function(T,S){T=v(T),E[T.main]=S},A.determineSubType=function(T,S){var M=S.type;if(!M){var I=v(T).main;A.hasSubTypes(T)&&E[I]&&(M=E[I](S))}return M},A}function w(A,E){A.topologicalTravel=function(I,P,D,L){if(!I.length)return;var R=T(P),O=R.graph,F=R.noEntryList,k={};for(f.each(I,function(X){k[X]=!0});F.length;){var U=F.pop(),G=O[U],j=!!k[U];j&&(D.call(L,U,G.originalDeps.slice()),delete k[U]),f.each(G.successor,j?J:q)}f.each(k,function(){throw new Error("Circle dependency may exists")});function q(X){O[X].entryCount--,O[X].entryCount===0&&F.push(X)}function J(X){k[X]=!0,q(X)}};function T(I){var P={},D=[];return f.each(I,function(L){var R=S(P,L),O=R.originalDeps=E(L),F=M(O,I);R.entryCount=F.length,R.entryCount===0&&D.push(L),f.each(F,function(k){f.indexOf(R.predecessor,k)<0&&R.predecessor.push(k);var U=S(P,k);f.indexOf(U.successor,k)<0&&U.successor.push(L)})}),{graph:P,noEntryList:D}}function S(I,P){return I[P]||(I[P]={predecessor:[],successor:[]}),I[P]}function M(I,P){var D=[];return f.each(I,function(L){f.indexOf(P,L)>=0&&D.push(L)}),D}}o.getUID=x,o.enableSubTypeDefaulter=C,o.enableTopologicalTravel=w}),il=xt(o=>{var f=Wi(),m=1e-4;function v(j){return j.replace(/^\s+|\s+$/g,"")}function y(j,q,J,X){var Y=q[1]-q[0],Q=J[1]-J[0];if(Y===0)return Q===0?J[0]:(J[0]+J[1])/2;if(X)if(Y>0){if(j<=q[0])return J[0];if(j>=q[1])return J[1]}else{if(j>=q[0])return J[0];if(j<=q[1])return J[1]}else{if(j===q[0])return J[0];if(j===q[1])return J[1]}return(j-q[0])/Y*Q+J[0]}function x(j,q){switch(j){case"center":case"middle":j="50%";break;case"left":case"top":j="0%";break;case"right":case"bottom":j="100%";break}return typeof j=="string"?v(j).match(/%$/)?parseFloat(j)/100*q:parseFloat(j):j==null?NaN:+j}function C(j,q,J){return q==null&&(q=10),q=Math.min(Math.max(0,q),20),j=(+j).toFixed(q),J?j:+j}function w(j){return j.sort(function(q,J){return q-J}),j}function A(j){if(j=+j,isNaN(j))return 0;for(var q=1,J=0;Math.round(j*q)/q!==j;)q*=10,J++;return J}function E(j){var q=j.toString(),J=q.indexOf("e");if(J>0){var X=+q.slice(J+1);return X<0?-X:0}else{var Y=q.indexOf(".");return Y<0?0:q.length-1-Y}}function T(j,q){var J=Math.log,X=Math.LN10,Y=Math.floor(J(j[1]-j[0])/X),Q=Math.round(J(Math.abs(q[1]-q[0]))/X),ee=Math.min(Math.max(-Y+Q,0),20);return isFinite(ee)?ee:20}function S(j,q,J){if(!j[q])return 0;var X=f.reduce(j,function(fe,de){return fe+(isNaN(de)?0:de)},0);if(X===0)return 0;for(var Y=Math.pow(10,J),Q=f.map(j,function(fe){return(isNaN(fe)?0:fe)/X*Y*100}),ee=Y*100,z=f.map(Q,function(fe){return Math.floor(fe)}),ie=f.reduce(z,function(fe,de){return fe+de},0),re=f.map(Q,function(fe,de){return fe-z[de]});iene&&(ne=re[se],oe=se);++z[oe],re[oe]=0,++ie}return z[q]/Y}var M=9007199254740991;function I(j){var q=Math.PI*2;return(j%q+q)%q}function P(j){return j>-m&&j=10&&q++,q}function F(j,q){var J=O(j),X=Math.pow(10,J),Y=j/X,Q;return q?Y<1.5?Q=1:Y<2.5?Q=2:Y<4?Q=3:Y<7?Q=5:Q=10:Y<1?Q=1:Y<2?Q=2:Y<3?Q=3:Y<5?Q=5:Q=10,j=Q*X,J>=-20?+j.toFixed(J<0?-J:0):j}function k(j,q){var J=(j.length-1)*q+1,X=Math.floor(J),Y=+j[X-1],Q=J-X;return Q?Y+Q*(j[X]-Y):Y}function U(j){j.sort(function(ie,re){return z(ie,re,0)?-1:1});for(var q=-1/0,J=1,X=0;X=0}o.linearMap=y,o.parsePercent=x,o.round=C,o.asc=w,o.getPrecision=A,o.getPrecisionSafe=E,o.getPixelPrecision=T,o.getPercentWithPrecision=S,o.MAX_SAFE_INTEGER=M,o.remRadian=I,o.isRadianAroundZero=P,o.parseDate=L,o.quantity=R,o.quantityExponent=O,o.nice=F,o.quantile=k,o.reformIntervals=U,o.isNumeric=G}),fd=xt(o=>{var f=Wi(),m=nb(),v=il();function y(G){return isNaN(G)?"-":(G=(G+"").split("."),G[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(G.length>1?"."+G[1]:""))}function x(G,j){return G=(G||"").toLowerCase().replace(/-(.)/g,function(q,J){return J.toUpperCase()}),j&&G&&(G=G.charAt(0).toUpperCase()+G.slice(1)),G}var C=f.normalizeCssArray,w=/([&<>"'])/g,A={"&":"&","<":"<",">":">",'"':""","'":"'"};function E(G){return G==null?"":(G+"").replace(w,function(j,q){return A[q]})}var T=["a","b","c","d","e","f","g"],S=function(G,j){return"{"+G+(j??"")+"}"};function M(G,j,q){f.isArray(j)||(j=[j]);var J=j.length;if(!J)return"";for(var X=j[0].$vars||[],Y=0;Y':'':{renderMode:Y,content:"{marker"+Q+"|} ",style:{color:q}}:""}function D(G,j){return G+="","0000".substr(0,j-G.length)+G}function L(G,j,q){(G==="week"||G==="month"||G==="quarter"||G==="half-year"||G==="year")&&(G=`MM-dd yyyy`);var J=v.parseDate(j),X=q?"UTC":"",Y=J["get"+X+"FullYear"](),Q=J["get"+X+"Month"]()+1,ee=J["get"+X+"Date"](),z=J["get"+X+"Hours"](),ie=J["get"+X+"Minutes"](),re=J["get"+X+"Seconds"](),ne=J["get"+X+"Milliseconds"]();return G=G.replace("MM",D(Q,2)).replace("M",Q).replace("yyyy",Y).replace("yy",Y%100).replace("dd",D(ee,2)).replace("d",ee).replace("hh",D(z,2)).replace("h",z).replace("mm",D(ie,2)).replace("m",ie).replace("ss",D(re,2)).replace("s",re).replace("SSS",D(ne,3)),G}function R(G){return G&&G.charAt(0).toUpperCase()+G.substr(1)}var O=m.truncateText;function F(G){return m.getBoundingRect(G.text,G.font,G.textAlign,G.textVerticalAlign,G.textPadding,G.textLineHeight,G.rich,G.truncate)}function k(G,j,q,J,X,Y,Q,ee){return m.getBoundingRect(G,j,q,J,X,ee,Y,Q)}function U(G,j){if(j==="_blank"||j==="blank"){var q=window.open();q.opener=null,q.location=G}else window.open(G,j)}o.addCommas=y,o.toCamelCase=x,o.normalizeCssArray=C,o.encodeHTML=E,o.formatTpl=M,o.formatTplSimple=I,o.getTooltipMarker=P,o.formatTime=L,o.capitalFirst=R,o.truncateText=O,o.getTextBoundingRect=F,o.getTextRect=k,o.windowOpen=U}),rd=xt(o=>{var f=Wi(),m=Of(),v=il(),y=v.parsePercent,x=fd(),C=f.each,w=["left","right","top","bottom","width","height"],A=[["width","left","right"],["height","top","bottom"]];function E(k,U,G,j,q){var J=0,X=0;j==null&&(j=1/0),q==null&&(q=1/0);var Y=0;U.eachChild(function(Q,ee){var z=Q.position,ie=Q.getBoundingRect(),re=U.childAt(ee+1),ne=re&&re.getBoundingRect(),oe,se;if(k==="horizontal"){var ae=ie.width+(ne?-ne.x+ie.x:0);oe=J+ae,oe>j||Q.newline?(J=0,oe=ae,X+=Y+G,Y=ie.height):Y=Math.max(Y,ie.height)}else{var fe=ie.height+(ne?-ne.y+ie.y:0);se=X+fe,se>q||Q.newline?(J+=Y+G,X=0,se=fe,Y=ie.width):Y=Math.max(Y,ie.width)}Q.newline||(z[0]=J,z[1]=X,k==="horizontal"?J=oe+G:X=se+G)})}var T=E,S=f.curry(E,"vertical"),M=f.curry(E,"horizontal");function I(k,U,G){var j=U.width,q=U.height,J=y(k.x,j),X=y(k.y,q),Y=y(k.x2,j),Q=y(k.y2,q);return(isNaN(J)||isNaN(parseFloat(k.x)))&&(J=0),(isNaN(Y)||isNaN(parseFloat(k.x2)))&&(Y=j),(isNaN(X)||isNaN(parseFloat(k.y)))&&(X=0),(isNaN(Q)||isNaN(parseFloat(k.y2)))&&(Q=q),G=x.normalizeCssArray(G||0),{width:Math.max(Y-J-G[1]-G[3],0),height:Math.max(Q-X-G[0]-G[2],0)}}function P(k,U,G){G=x.normalizeCssArray(G||0);var j=U.width,q=U.height,J=y(k.left,j),X=y(k.top,q),Y=y(k.right,j),Q=y(k.bottom,q),ee=y(k.width,j),z=y(k.height,q),ie=G[2]+G[0],re=G[1]+G[3],ne=k.aspect;switch(isNaN(ee)&&(ee=j-Y-re-J),isNaN(z)&&(z=q-Q-ie-X),ne!=null&&(isNaN(ee)&&isNaN(z)&&(ne>j/q?ee=j*.8:z=q*.8),isNaN(ee)&&(ee=ne*z),isNaN(z)&&(z=ee/ne)),isNaN(J)&&(J=j-Y-ee-re),isNaN(X)&&(X=q-Q-z-ie),k.left||k.right){case"center":J=j/2-ee/2-G[3];break;case"right":J=j-ee-re;break}switch(k.top||k.bottom){case"middle":case"center":X=q/2-z/2-G[0];break;case"bottom":X=q-z-ie;break}J=J||0,X=X||0,isNaN(ee)&&(ee=j-re-J-(Y||0)),isNaN(z)&&(z=q-ie-X-(Q||0));var oe=new m(J+G[3],X+G[0],ee,z);return oe.margin=G,oe}function D(k,U,G,j,q){var J=!q||!q.hv||q.hv[0],X=!q||!q.hv||q.hv[1],Y=q&&q.boundingMode||"all";if(!(!J&&!X)){var Q;if(Y==="raw")Q=k.type==="group"?new m(0,0,+U.width||0,+U.height||0):k.getBoundingRect();else if(Q=k.getBoundingRect(),k.needLocalTransform()){var ee=k.getLocalTransform();Q=Q.clone(),Q.applyTransform(ee)}U=P(f.defaults({width:Q.width,height:Q.height},U),G,j);var z=k.position,ie=J?U.x-Q.x:0,re=X?U.y-Q.y:0;k.attr("position",Y==="raw"?[ie,re]:[z[0]+ie,z[1]+re])}}function L(k,U){return k[A[U][0]]!=null||k[A[U][1]]!=null&&k[A[U][2]]!=null}function R(k,U,G){!f.isObject(G)&&(G={});var j=G.ignoreSize;!f.isArray(j)&&(j=[j,j]);var q=X(A[0],0),J=X(A[1],1);ee(A[0],k,q),ee(A[1],k,J);function X(z,ie){var re={},ne=0,oe={},se=0,ae=2;if(C(z,function(ve){oe[ve]=k[ve]}),C(z,function(ve){Y(U,ve)&&(re[ve]=oe[ve]=U[ve]),Q(re,ve)&&ne++,Q(oe,ve)&&se++}),j[ie])return Q(U,z[1])?oe[z[2]]=null:Q(U,z[2])&&(oe[z[1]]=null),oe;if(se===ae||!ne)return oe;if(ne>=ae)return re;for(var fe=0;fe{var m={getBoxLayoutParams:function(){return{left:this.get("left"),top:this.get("top"),right:this.get("right"),bottom:this.get("bottom"),width:this.get("width"),height:this.get("height")}}};f.exports=m}),Xg=xt((o,f)=>{var m=Wi(),v=Sm(),y=zj(),x=kM(),C=x.enableClassManagement,w=x.parseClassType,A=vu(),E=A.makeInner,T=rd(),S=V_t(),M=E(),I=v.extend({type:"component",id:"",name:"",mainType:"",subType:"",componentIndex:0,defaultOption:null,ecModel:null,dependentModels:[],uid:null,layoutMode:null,$constructor:function(L,R,O,F){v.call(this,L,R,O,F),this.uid=y.getUID("ec_cpt_model")},init:function(L,R,O,F){this.mergeDefaultAndTheme(L,O)},mergeDefaultAndTheme:function(L,R){var O=this.layoutMode,F=O?T.getLayoutParams(L):{},k=R.getTheme();m.merge(L,k.get(this.mainType)),m.merge(L,this.getDefaultOption()),O&&T.mergeLayoutParam(L,F,O)},mergeOption:function(L,R){m.merge(this.option,L,!0);var O=this.layoutMode;O&&T.mergeLayoutParam(this.option,L,O)},optionUpdated:function(L,R){},getDefaultOption:function(){var L=M(this);if(!L.defaultOption){for(var R=[],O=this.constructor;O;){var F=O.prototype.defaultOption;F&&R.push(F),O=O.superClass}for(var k={},U=R.length-1;U>=0;U--)k=m.merge(k,R[U],!0);L.defaultOption=k}return L.defaultOption},getReferringComponents:function(L){return this.ecModel.queryComponents({mainType:L,index:this.get(L+"Index",!0),id:this.get(L+"Id",!0)})}});C(I,{registerWhenExtend:!0}),y.enableSubTypeDefaulter(I),y.enableTopologicalTravel(I,P);function P(L){var R=[];return m.each(I.getClassesByMainType(L),function(O){R=R.concat(O.prototype.dependencies||[])}),R=m.map(R,function(O){return w(O).main}),L!=="dataset"&&m.indexOf(R,"dataset")<=0&&R.unshift("dataset"),R}m.mixin(I,S);var D=I;f.exports=D}),z_t=xt((o,f)=>{var m="";typeof navigator<"u"&&(m=navigator.platform||"");var v={color:["#c23531","#2f4554","#61a0a8","#d48265","#91c7ae","#749f83","#ca8622","#bda29a","#6e7074","#546570","#c4ccd3"],gradientColor:["#f6efa6","#d88273","#bf444c"],textStyle:{fontFamily:m.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,animation:"auto",animationDuration:1e3,animationDurationUpdate:300,animationEasing:"exponentialOut",animationEasingUpdate:"cubicOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};f.exports=v}),G8e=xt((o,f)=>{var m=vu(),v=m.makeInner,y=m.normalizeToArray,x=v();function C(A,E){for(var T=A.length,S=0;SE)return A[S];return A[T-1]}var w={clearColorPalette:function(){x(this).colorIdx=0,x(this).colorNameMap={}},getColorFromPalette:function(A,E,T){E=E||this;var S=x(E),M=S.colorIdx||0,I=S.colorNameMap=S.colorNameMap||{};if(I.hasOwnProperty(A))return I[A];var P=y(this.get("color",!0)),D=this.get("colorLayer",!0),L=T==null||!D?P:C(D,T);if(L=L||P,!(!L||!L.length)){var R=L[M];return A&&(I[A]=R),S.colorIdx=(M+1)%L.length,R}}};f.exports=w}),Hj=xt(o=>{var f="original",m="arrayRows",v="objectRows",y="keyedColumns",x="unknown",C="typedArray",w="column",A="row";o.SOURCE_FORMAT_ORIGINAL=f,o.SOURCE_FORMAT_ARRAY_ROWS=m,o.SOURCE_FORMAT_OBJECT_ROWS=v,o.SOURCE_FORMAT_KEYED_COLUMNS=y,o.SOURCE_FORMAT_UNKNOWN=x,o.SOURCE_FORMAT_TYPED_ARRAY=C,o.SERIES_LAYOUT_BY_COLUMN=w,o.SERIES_LAYOUT_BY_ROW=A}),Uj=xt((o,f)=>{var m=Wi(),v=m.createHashMap,y=m.isTypedArray,x=kM(),C=x.enableClassCheck,w=Hj(),A=w.SOURCE_FORMAT_ORIGINAL,E=w.SERIES_LAYOUT_BY_COLUMN,T=w.SOURCE_FORMAT_UNKNOWN,S=w.SOURCE_FORMAT_TYPED_ARRAY,M=w.SOURCE_FORMAT_KEYED_COLUMNS;function I(D){this.fromDataset=D.fromDataset,this.data=D.data||(D.sourceFormat===M?{}:[]),this.sourceFormat=D.sourceFormat||T,this.seriesLayoutBy=D.seriesLayoutBy||E,this.dimensionsDefine=D.dimensionsDefine,this.encodeDefine=D.encodeDefine&&v(D.encodeDefine),this.startIndex=D.startIndex||0,this.dimensionsDetectCount=D.dimensionsDetectCount}I.seriesDataToSource=function(D){return new I({data:D,sourceFormat:y(D)?S:A,fromDataset:!1})},C(I);var P=I;f.exports=P}),VM=xt(o=>{var f=Ac(),m=f.__DEV__,v=vu(),y=v.makeInner,x=v.getDataItemValue,C=Wi(),w=C.createHashMap,A=C.each,E=C.map,T=C.isArray,S=C.isString,M=C.isObject,I=C.isTypedArray,P=C.isArrayLike,D=C.extend,L=C.assert,R=Uj(),O=Hj(),F=O.SOURCE_FORMAT_ORIGINAL,k=O.SOURCE_FORMAT_ARRAY_ROWS,U=O.SOURCE_FORMAT_OBJECT_ROWS,G=O.SOURCE_FORMAT_KEYED_COLUMNS,j=O.SOURCE_FORMAT_UNKNOWN,q=O.SOURCE_FORMAT_TYPED_ARRAY,J=O.SERIES_LAYOUT_BY_ROW,X={Must:1,Might:2,Not:3},Y=y();function Q(ce){var he=ce.option.source,Ce=j;if(I(he))Ce=q;else if(T(he)){he.length===0&&(Ce=k);for(var Se=0,De=he.length;Se{var m=Ac(),v=m.__DEV__,y=Wi(),x=y.each,C=y.filter,w=y.map,A=y.isArray,E=y.indexOf,T=y.isObject,S=y.isString,M=y.createHashMap,I=y.assert,P=y.clone,D=y.merge,L=y.extend,R=y.mixin,O=vu(),F=Sm(),k=Xg(),U=z_t(),G=G8e(),j=VM(),q=j.resetSourceDefaulter,J="\0_ec_inner",X=F.extend({init:function(se,ae,fe,de){fe=fe||{},this.option=null,this._theme=new F(fe),this._optionManager=de},setOption:function(se,ae){I(!(J in se),"please use chart.getOption()"),this._optionManager.setOption(se,ae),this.resetOption(null)},resetOption:function(se){var ae=!1,fe=this._optionManager;if(!se||se==="recreate"){var de=fe.mountOption(se==="recreate");!this.option||se==="recreate"?ee.call(this,de):(this.restoreData(),this.mergeOption(de)),ae=!0}if((se==="timeline"||se==="media")&&this.restoreData(),!se||se==="recreate"||se==="timeline"){var ve=fe.getTimelineOption(this);ve&&(this.mergeOption(ve),ae=!0)}if(!se||se==="recreate"||se==="media"){var pe=fe.getMediaOption(this,this._api);pe.length&&x(pe,function(ce){this.mergeOption(ce,ae=!0)},this)}return ae},mergeOption:function(se){var ae=this.option,fe=this._componentsMap,de=[];q(this),x(se,function(pe,ce){pe!=null&&(k.hasClass(ce)?ce&&de.push(ce):ae[ce]=ae[ce]==null?P(pe):D(ae[ce],pe,!0))}),k.topologicalTravel(de,k.getAllClassMainTypes(),ve,this);function ve(pe,ce){var he=O.normalizeToArray(se[pe]),Ce=O.mappingToExists(fe.get(pe),he);O.makeIdAndName(Ce),x(Ce,function(De,Oe){var Ue=De.option;T(Ue)&&(De.keyInfo.mainType=pe,De.keyInfo.subType=ie(pe,Ue,De.exist))});var Se=z(fe,ce);ae[pe]=[],fe.set(pe,[]),x(Ce,function(De,Oe){var Ue=De.exist,Xe=De.option;if(I(T(Xe)||Ue,"Empty component definition"),!Xe)Ue.mergeOption({},this),Ue.optionUpdated({},!1);else{var it=k.getClass(pe,De.keyInfo.subType,!0);if(Ue&&Ue.constructor===it)Ue.name=De.keyInfo.name,Ue.mergeOption(Xe,this),Ue.optionUpdated(Xe,!1);else{var ut=L({dependentModels:Se,componentIndex:Oe},De.keyInfo);Ue=new it(Xe,this,this,ut),L(Ue,ut),Ue.init(Xe,this,this,ut),Ue.optionUpdated(null,!0)}}fe.get(pe)[Oe]=Ue,ae[pe][Oe]=Ue.option},this),pe==="series"&&re(this,fe.get("series"))}this._seriesIndicesMap=M(this._seriesIndices=this._seriesIndices||[])},getOption:function(){var se=P(this.option);return x(se,function(ae,fe){if(k.hasClass(fe)){for(var ae=O.normalizeToArray(ae),de=ae.length-1;de>=0;de--)O.isIdInner(ae[de])&&ae.splice(de,1);se[fe]=ae}}),delete se[J],se},getTheme:function(){return this._theme},getComponent:function(se,ae){var fe=this._componentsMap.get(se);if(fe)return fe[ae||0]},queryComponents:function(se){var ae=se.mainType;if(!ae)return[];var fe=se.index,de=se.id,ve=se.name,pe=this._componentsMap.get(ae);if(!pe||!pe.length)return[];var ce;if(fe!=null)A(fe)||(fe=[fe]),ce=C(w(fe,function(Se){return pe[Se]}),function(Se){return!!Se});else if(de!=null){var he=A(de);ce=C(pe,function(Se){return he&&E(de,Se.id)>=0||!he&&Se.id===de})}else if(ve!=null){var Ce=A(ve);ce=C(pe,function(Se){return Ce&&E(ve,Se.name)>=0||!Ce&&Se.name===ve})}else ce=pe.slice();return ne(ce,se)},findComponents:function(se){var ae=se.query,fe=se.mainType,de=pe(ae),ve=de?this.queryComponents(de):this._componentsMap.get(fe);return ce(ne(ve,se));function pe(he){var Ce=fe+"Index",Se=fe+"Id",De=fe+"Name";return he&&(he[Ce]!=null||he[Se]!=null||he[De]!=null)?{mainType:fe,index:he[Ce],id:he[Se],name:he[De]}:null}function ce(he){return se.filter?C(he,se.filter):he}},eachComponent:function(se,ae,fe){var de=this._componentsMap;if(typeof se=="function")fe=ae,ae=se,de.each(function(pe,ce){x(pe,function(he,Ce){ae.call(fe,ce,he,Ce)})});else if(S(se))x(de.get(se),ae,fe);else if(T(se)){var ve=this.findComponents(se);x(ve,ae,fe)}},getSeriesByName:function(se){var ae=this._componentsMap.get("series");return C(ae,function(fe){return fe.name===se})},getSeriesByIndex:function(se){return this._componentsMap.get("series")[se]},getSeriesByType:function(se){var ae=this._componentsMap.get("series");return C(ae,function(fe){return fe.subType===se})},getSeries:function(){return this._componentsMap.get("series").slice()},getSeriesCount:function(){return this._componentsMap.get("series").length},eachSeries:function(se,ae){x(this._seriesIndices,function(fe){var de=this._componentsMap.get("series")[fe];se.call(ae,de,fe)},this)},eachRawSeries:function(se,ae){x(this._componentsMap.get("series"),se,ae)},eachSeriesByType:function(se,ae,fe){x(this._seriesIndices,function(de){var ve=this._componentsMap.get("series")[de];ve.subType===se&&ae.call(fe,ve,de)},this)},eachRawSeriesByType:function(se,ae,fe){return x(this.getSeriesByType(se),ae,fe)},isSeriesFiltered:function(se){return this._seriesIndicesMap.get(se.componentIndex)==null},getCurrentSeriesIndices:function(){return(this._seriesIndices||[]).slice()},filterSeries:function(se,ae){var fe=C(this._componentsMap.get("series"),se,ae);re(this,fe)},restoreData:function(se){var ae=this._componentsMap;re(this,ae.get("series"));var fe=[];ae.each(function(de,ve){fe.push(ve)}),k.topologicalTravel(fe,k.getAllClassMainTypes(),function(de,ve){x(ae.get(de),function(pe){(de!=="series"||!Y(pe,se))&&pe.restoreData()})})}});function Y(se,ae){if(ae){var fe=ae.seiresIndex,de=ae.seriesId,ve=ae.seriesName;return fe!=null&&se.componentIndex!==fe||de!=null&&se.id!==de||ve!=null&&se.name!==ve}}function Q(se,ae){var fe=se.color&&!se.colorLayer;x(ae,function(de,ve){ve==="colorLayer"&&fe||k.hasClass(ve)||(typeof de=="object"?se[ve]=se[ve]?D(se[ve],de,!1):P(de):se[ve]==null&&(se[ve]=de))})}function ee(se){se=se,this.option={},this.option[J]=1,this._componentsMap=M({series:[]}),this._seriesIndices,this._seriesIndicesMap,Q(se,this._theme.option),D(se,U,!1),this.mergeOption(se)}function z(se,ae){A(ae)||(ae=ae?[ae]:[]);var fe={};return x(ae,function(de){fe[de]=(se.get(de)||[]).slice()}),fe}function ie(se,ae,fe){var de=ae.type?ae.type:fe?fe.subType:k.determineSubType(se,ae);return de}function re(se,ae){se._seriesIndicesMap=M(se._seriesIndices=w(ae,function(fe){return fe.componentIndex})||[])}function ne(se,ae){return ae.hasOwnProperty("subType")?C(se,function(fe){return fe.subType===ae.subType}):se}R(X,G);var oe=X;f.exports=oe}),j8e=xt((o,f)=>{var m=Wi(),v=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isDisposed","on","off","getDataURL","getConnectedDataURL","getModel","getOption","getViewOfComponentModel","getViewOfSeriesModel"];function y(C){m.each(v,function(w){this[w]=m.bind(C[w],C)},this)}var x=y;f.exports=x}),aT=xt((o,f)=>{var m=Wi(),v={};function y(){this._coordinateSystems=[]}y.prototype={constructor:y,create:function(C,w){var A=[];m.each(v,function(E,T){var S=E.create(C,w);A=A.concat(S||[])}),this._coordinateSystems=A},update:function(C,w){m.each(this._coordinateSystems,function(A){A.update&&A.update(C,w)})},getCoordinateSystems:function(){return this._coordinateSystems.slice()}},y.register=function(C,w){v[C]=w},y.get=function(C){return v[C]};var x=y;f.exports=x}),H_t=xt((o,f)=>{var m=Wi(),v=vu(),y=Xg(),x=m.each,C=m.clone,w=m.map,A=m.merge,E=/^(min|max)?(.+)$/;function T(R){this._api=R,this._timelineOptions=[],this._mediaList=[],this._mediaDefault,this._currentMediaIndices=[],this._optionBackup,this._newBaseOption}T.prototype={constructor:T,setOption:function(R,O){R&&m.each(v.normalizeToArray(R.series),function(U){U&&U.data&&m.isTypedArray(U.data)&&m.setAsPrimitive(U.data)}),R=C(R);var F=this._optionBackup,k=S.call(this,R,O,!F);this._newBaseOption=k.baseOption,F?(D(F.baseOption,k.baseOption),k.timelineOptions.length&&(F.timelineOptions=k.timelineOptions),k.mediaList.length&&(F.mediaList=k.mediaList),k.mediaDefault&&(F.mediaDefault=k.mediaDefault)):this._optionBackup=k},mountOption:function(R){var O=this._optionBackup;return this._timelineOptions=w(O.timelineOptions,C),this._mediaList=w(O.mediaList,C),this._mediaDefault=C(O.mediaDefault),this._currentMediaIndices=[],C(R?O.baseOption:this._newBaseOption)},getTimelineOption:function(R){var O,F=this._timelineOptions;if(F.length){var k=R.getComponent("timeline");k&&(O=C(F[k.getCurrentIndex()],!0))}return O},getMediaOption:function(R){var O=this._api.getWidth(),F=this._api.getHeight(),k=this._mediaList,U=this._mediaDefault,G=[],j=[];if(!k.length&&!U)return j;for(var q=0,J=k.length;q=O:F==="max"?R<=O:R===O}function P(R,O){return R.join(",")===O.join(",")}function D(R,O){O=O||{},x(O,function(F,k){if(F!=null){var U=R[k];if(!y.hasClass(k))R[k]=A(U,F,!0);else{F=v.normalizeToArray(F),U=v.normalizeToArray(U);var G=v.mappingToExists(U,F);R[k]=w(G,function(j){return j.option&&j.exist?A(j.exist,j.option,!0):j.exist||j.option})}}})}var L=T;f.exports=L}),U_t=xt((o,f)=>{var m=Wi(),v=vu(),y=m.each,x=m.isObject,C=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function w(L){var R=L&&L.itemStyle;if(R)for(var O=0,F=C.length;O{var m=Wi(),v=m.each,y=m.isArray,x=m.isObject,C=U_t(),w=vu(),A=w.normalizeToArray;function E(D,L){L=L.split(",");for(var R=D,O=0;O{var m=Wi(),v=m.createHashMap,y=m.each;function x(w){var A=v();w.eachSeries(function(E){var T=E.get("stack");if(T){var S=A.get(T)||A.set(T,[]),M=E.getData(),I={stackResultDimension:M.getCalculationInfo("stackResultDimension"),stackedOverDimension:M.getCalculationInfo("stackedOverDimension"),stackedDimension:M.getCalculationInfo("stackedDimension"),stackedByDimension:M.getCalculationInfo("stackedByDimension"),isStackedByIndex:M.getCalculationInfo("isStackedByIndex"),data:M,seriesModel:E};if(!I.stackedDimension||!(I.isStackedByIndex||I.stackedByDimension))return;S.length&&M.setCalculationInfo("stackedOnSeries",S[S.length-1].seriesModel),S.push(I)}}),A.each(C)}function C(w){y(w,function(A,E){var T=[],S=[NaN,NaN],M=[A.stackResultDimension,A.stackedOverDimension],I=A.data,P=A.isStackedByIndex,D=I.map(M,function(L,R,O){var F=I.get(A.stackedDimension,O);if(isNaN(F))return S;var k,U;P?U=I.getRawIndex(O):k=I.get(A.stackedByDimension,O);for(var G=NaN,j=E-1;j>=0;j--){var q=w[j];if(P||(U=q.data.rawIndexOf(q.stackedByDimension,k)),U>=0){var J=q.data.getByRawIndex(q.stackResultDimension,U);if(F>=0&&J>0||F<=0&&J<0){F+=J,G=J;break}}}return T[0]=F,T[1]=G,T});I.hostModel.setData(D),A.data=D})}f.exports=x}),oB=xt(o=>{var f=Ac(),m=f.__DEV__,v=Wi(),y=v.isTypedArray,x=v.extend,C=v.assert,w=v.each,A=v.isObject,E=vu(),T=E.getDataItemValue,S=E.isDataItemOption,M=il(),I=M.parseDate,P=Uj(),D=Hj(),L=D.SOURCE_FORMAT_TYPED_ARRAY,R=D.SOURCE_FORMAT_ARRAY_ROWS,O=D.SOURCE_FORMAT_ORIGINAL,F=D.SOURCE_FORMAT_OBJECT_ROWS;function k(ne,oe){P.isInstance(ne)||(ne=P.seriesDataToSource(ne)),this._source=ne;var se=this._data=ne.data,ae=ne.sourceFormat;ae===L&&(this._offset=0,this._dimSize=oe,this._data=se);var fe=G[ae===R?ae+"_"+ne.seriesLayoutBy:ae];x(this,fe)}var U=k.prototype;U.pure=!1,U.persistent=!0,U.getSource=function(){return this._source};var G={arrayRows_column:{pure:!0,count:function(){return Math.max(0,this._data.length-this._source.startIndex)},getItem:function(ne){return this._data[ne+this._source.startIndex]},appendData:J},arrayRows_row:{pure:!0,count:function(){var ne=this._data[0];return ne?Math.max(0,ne.length-this._source.startIndex):0},getItem:function(ne){ne+=this._source.startIndex;for(var oe=[],se=this._data,ae=0;ae{var m=oB(),v=m.retrieveRawValue,y=fd(),x=y.getTooltipMarker,C=y.formatTpl,w=vu(),A=w.getTooltipRenderMode,E=/\{@(.+?)\}/g,T={getDataParams:function(S,M){var I=this.getData(M),P=this.getRawValue(S,M),D=I.getRawIndex(S),L=I.getName(S),R=I.getRawDataItem(S),O=I.getItemVisual(S,"color"),F=I.getItemVisual(S,"borderColor"),k=this.ecModel.getComponent("tooltip"),U=k&&k.get("renderMode"),G=A(U),j=this.mainType,q=j==="series",J=I.userOutput;return{componentType:j,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:q?this.subType:null,seriesIndex:this.seriesIndex,seriesId:q?this.id:null,seriesName:q?this.name:null,name:L,dataIndex:D,data:R,dataType:M,value:P,color:O,borderColor:F,dimensionNames:J?J.dimensionNames:null,encode:J?J.encode:null,marker:x({color:O,renderMode:G}),$vars:["seriesName","name","value"]}},getFormattedLabel:function(S,M,I,P,D){M=M||"normal";var L=this.getData(I),R=L.getItemModel(S),O=this.getDataParams(S,I);P!=null&&O.value instanceof Array&&(O.value=O.value[P]);var F=R.get(M==="normal"?[D||"label","formatter"]:[M,D||"label","formatter"]);if(typeof F=="function")return O.status=M,O.dimensionIndex=P,F(O);if(typeof F=="string"){var k=C(F,O);return k.replace(E,function(U,G){var j=G.length;return G.charAt(0)==="["&&G.charAt(j-1)==="]"&&(G=+G.slice(1,j-1)),v(L,S,G)})}},getRawValue:function(S,M){return v(this.getData(M),S)},formatTooltip:function(){}};f.exports=T}),C0e=xt(o=>{var f=Wi(),m=f.assert,v=f.isArray,y=Ac(),x=y.__DEV__;function C(M){return new w(M)}function w(M){M=M||{},this._reset=M.reset,this._plan=M.plan,this._count=M.count,this._onDirty=M.onDirty,this._dirty=!0,this.context}var A=w.prototype;A.perform=function(M){var I=this._upstream,P=M&&M.skip;if(this._dirty&&I){var D=this.context;D.data=D.outputData=I.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var L;this._plan&&!P&&(L=this._plan(this.context));var R=U(this._modBy),O=this._modDataCount||0,F=U(M&&M.modBy),k=M&&M.modDataCount||0;(R!==F||O!==k)&&(L="reset");function U(ee){return!(ee>=1)&&(ee=1),ee}var G;(this._dirty||L==="reset")&&(this._dirty=!1,G=S(this,P)),this._modBy=F,this._modDataCount=k;var j=M&&M.step;if(I?this._dueEnd=I._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var q=this._dueIndex,J=Math.min(j!=null?this._dueIndex+j:1/0,this._dueEnd);if(!P&&(G||q1&&D>0?F:O}};return R;function O(){return I=M?null:k{var m=Ac(),v=m.__DEV__,y=Wi(),x=Tm(),C=fd(),w=C.formatTime,A=C.encodeHTML,E=C.addCommas,T=C.getTooltipMarker,S=vu(),M=Xg(),I=G8e(),P=x0e(),D=rd(),L=D.getLayoutParams,R=D.mergeLayoutParam,O=C0e(),F=O.createTask,k=VM(),U=k.prepareSource,G=k.getSource,j=oB(),q=j.retrieveRawValue,J=S.makeInner(),X=M.extend({type:"series.__base__",seriesIndex:0,coordinateSystem:null,defaultOption:null,legendVisualProvider:null,visualColorAccessPath:"itemStyle.color",visualBorderColorAccessPath:"itemStyle.borderColor",layoutMode:null,init:function(ae,fe,de,ve){this.seriesIndex=this.componentIndex,this.dataTask=F({count:ee,reset:z}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(ae,de),U(this);var pe=this.getInitialData(ae,de);re(pe,this),this.dataTask.context.data=pe,J(this).dataBeforeProcessed=pe,Y(this)},mergeDefaultAndTheme:function(ae,fe){var de=this.layoutMode,ve=de?L(ae):{},pe=this.subType;M.hasClass(pe)&&(pe+="Series"),y.merge(ae,fe.getTheme().get(this.subType)),y.merge(ae,this.getDefaultOption()),S.defaultEmphasis(ae,"label",["show"]),this.fillDataTextStyle(ae.data),de&&R(ae,ve,de)},mergeOption:function(ae,fe){ae=y.merge(this.option,ae,!0),this.fillDataTextStyle(ae.data);var de=this.layoutMode;de&&R(this.option,ae,de),U(this);var ve=this.getInitialData(ae,fe);re(ve,this),this.dataTask.dirty(),this.dataTask.context.data=ve,J(this).dataBeforeProcessed=ve,Y(this)},fillDataTextStyle:function(ae){if(ae&&!y.isTypedArray(ae))for(var fe=["show"],de=0;de":` `,he=ve==="richText",Ce={},Se=0;function De(Jt){var bi=y.reduce(Jt,function(Je,Nt,yi){var ai=Ue.getDimensionInfo(yi);return Je|=ai&&ai.tooltip!==!1&&ai.displayName!=null},0),Yi=[];Xe.length?y.each(Xe,function(Je){ii(q(Ue,ae,Je),Je)}):y.each(Jt,ii);function ii(Je,Nt){var yi=Ue.getDimensionInfo(Nt);if(!(!yi||yi.otherDims.tooltip===!1)){var ai=yi.type,wi="sub"+pe.seriesIndex+"at"+Se,ji=T({color:Pt,type:"subItem",renderMode:ve,markerId:wi}),hi=typeof ji=="string"?ji:ji.content,Ri=(bi?hi+A(yi.displayName||"-")+": ":"")+A(ai==="ordinal"?Je+"":ai==="time"?fe?"":w("yyyy/MM/dd hh:mm:ss",Je):E(Je));Ri&&Yi.push(Ri),he&&(Ce[wi]=Pt,++Se)}}var ei=bi?he?` `:"
":"",Li=ei+Yi.join(ei||", ");return{renderMode:ve,content:Li,style:Ce}}function Oe(Jt){return{renderMode:ve,content:A(E(Jt)),style:Ce}}var Ue=this.getData(),Xe=Ue.mapDimension("defaultedTooltip",!0),it=Xe.length,ut=this.getRawValue(ae),at=y.isArray(ut),Pt=Ue.getItemVisual(ae,"color");y.isObject(Pt)&&Pt.colorStops&&(Pt=(Pt.colorStops[0]||{}).color),Pt=Pt||"transparent";var Qe=it>1||at&&!it?De(ut):Oe(it?q(Ue,ae,Xe[0]):at?ut[0]:ut),ft=Qe.content,Ot=pe.seriesIndex+"at"+Se,Xt=T({color:Pt,type:"item",renderMode:ve,markerId:Ot});Ce[Ot]=Pt,++Se;var At=Ue.getName(ae),bt=this.name;S.isNameSpecified(this)||(bt=""),bt=bt?A(bt)+(fe?": ":ce):"";var gt=typeof Xt=="string"?Xt:Xt.content,It=fe?gt+bt+ft:bt+gt+(At?A(At)+": "+ft:ft);return{html:It,markers:Ce}},isAnimationEnabled:function(){if(x.node)return!1;var ae=this.getShallow("animation");return ae&&this.getData().count()>this.getShallow("animationThreshold")&&(ae=!1),ae},restoreData:function(){this.dataTask.dirty()},getColorFromPalette:function(ae,fe,de){var ve=this.ecModel,pe=I.getColorFromPalette.call(this,ae,fe,de);return pe||(pe=ve.getColorFromPalette(ae,fe,de)),pe},coordDimToDataDim:function(ae){return this.getRawData().mapDimension(ae,!0)},getProgressive:function(){return this.get("progressive")},getProgressiveThreshold:function(){return this.get("progressiveThreshold")},getAxisTooltipData:null,getTooltipPosition:null,pipeTask:null,preventIncremental:null,pipelineContext:null});y.mixin(X,P),y.mixin(X,I);function Y(ae){var fe=ae.name;S.isNameSpecified(ae)||(ae.name=Q(ae)||fe)}function Q(ae){var fe=ae.getRawData(),de=fe.mapDimension("seriesName",!0),ve=[];return y.each(de,function(pe){var ce=fe.getDimensionInfo(pe);ce.displayName&&ve.push(ce.displayName)}),ve.join(" ")}function ee(ae){return ae.model.getRawData().count()}function z(ae){var fe=ae.model;return fe.setData(fe.getRawData().cloneShallow()),ie}function ie(ae,fe){fe.outputData&&ae.end>fe.outputData.count()&&fe.model.getRawData().cloneShallow(fe.outputData)}function re(ae,fe){y.each(ae.CHANGABLE_METHODS,function(de){ae.wrapMethod(de,y.curry(ne,fe))})}function ne(ae){var fe=oe(ae);fe&&fe.setOutputEnd(this.count())}function oe(ae){var fe=(ae.ecModel||{}).scheduler,de=fe&&fe.getPipeline(ae.uid);if(de){var ve=de.currentTask;if(ve){var pe=ve.agentStubMap;pe&&(ve=pe.get(ae.uid))}return ve}}var se=X;f.exports=se}),Aie=xt((o,f)=>{var m=rB(),v=zj(),y=kM(),x=function(){this.group=new m,this.uid=v.getUID("viewComponent")};x.prototype={constructor:x,init:function(A,E){},render:function(A,E,T,S){},dispose:function(){},filterForExposedEvent:null};var C=x.prototype;C.updateView=C.updateLayout=C.updateVisual=function(A,E,T,S){},y.enableClassExtend(x),y.enableClassManagement(x,{registerWhenExtend:!0});var w=x;f.exports=w}),aU=xt((o,f)=>{var m=vu(),v=m.makeInner;function y(){var x=v();return function(C){var w=x(C),A=C.pipelineContext,E=w.large,T=w.progressiveRender,S=w.large=A&&A.large,M=w.progressiveRender=A&&A.progressiveRender;return!!(E^S||T^M)&&"reset"}}f.exports=y}),V2=xt((o,f)=>{var m=Wi(),v=m.each,y=rB(),x=zj(),C=kM(),w=vu(),A=xa(),E=C0e(),T=E.createTask,S=aU(),M=w.makeInner(),I=S();function P(){this.group=new y,this.uid=x.getUID("viewChart"),this.renderTask=T({plan:O,reset:F}),this.renderTask.context={view:this}}P.prototype={type:"chart",init:function(G,j){},render:function(G,j,q,J){},highlight:function(G,j,q,J){R(G.getData(),J,"emphasis")},downplay:function(G,j,q,J){R(G.getData(),J,"normal")},remove:function(G,j){this.group.removeAll()},dispose:function(){},incrementalPrepareRender:null,incrementalRender:null,updateTransform:null,filterForExposedEvent:null};var D=P.prototype;D.updateView=D.updateLayout=D.updateVisual=function(G,j,q,J){this.render(G,j,q,J)};function L(G,j,q){if(G&&(G.trigger(j,q),G.isGroup&&!A.isHighDownDispatcher(G)))for(var J=0,X=G.childCount();J{var f="\0__throttleOriginMethod",m="\0__throttleRate",v="\0__throttleType";function y(w,A,E){var T,S=0,M=0,I=null,P,D,L,R;A=A||0;function O(){M=new Date().getTime(),I=null,w.apply(D,L||[])}var F=function(){T=new Date().getTime(),D=this,L=arguments;var k=R||A,U=R||E;R=null,P=T-(U?S:M)-k,clearTimeout(I),U?I=setTimeout(O,k):P>=0?O():I=setTimeout(O,-P),S=T};return F.clear=function(){I&&(clearTimeout(I),I=null)},F.debounceNextCall=function(k){R=k},F}function x(w,A,E,T){var S=w[A];if(S){var M=S[f]||S,I=S[v],P=S[m];if(P!==E||I!==T){if(E==null||!T)return w[A]=M;S=w[A]=y(M,E,T==="debounce"),S[f]=M,S[v]=T,S[m]=E}return S}}function C(w,A){var E=w[A];E&&E[f]&&(w[A]=E[f])}o.throttle=y,o.createOrUpdate=x,o.clear=C}),j_t=xt((o,f)=>{var m=wie(),v=Wi(),y=v.isFunction,x={createOnAllSeries:!0,performRawSeries:!0,reset:function(C,w){var A=C.getData(),E=(C.visualColorAccessPath||"itemStyle.color").split("."),T=C.get(E),S=y(T)&&!(T instanceof m)?T:null;(!T||S)&&(T=C.getColorFromPalette(C.name,null,w.getSeriesCount())),A.setVisual("color",T);var M=(C.visualBorderColorAccessPath||"itemStyle.borderColor").split("."),I=C.get(M);if(A.setVisual("borderColor",I),!w.isSeriesFiltered(C)){S&&A.each(function(D){A.setItemVisual(D,"color",S(C.getDataParams(D)))});var P=function(D,L){var R=D.getItemModel(L),O=R.get(E,!0),F=R.get(M,!0);O!=null&&D.setItemVisual(L,"color",O),F!=null&&D.setItemVisual(L,"borderColor",F)};return{dataEach:A.hasItemOption?P:null}}}};f.exports=x}),J3=xt((o,f)=>{var m={legend:{selector:{all:"\u5168\u9009",inverse:"\u53CD\u9009"}},toolbox:{brush:{title:{rect:"\u77E9\u5F62\u9009\u62E9",polygon:"\u5708\u9009",lineX:"\u6A2A\u5411\u9009\u62E9",lineY:"\u7EB5\u5411\u9009\u62E9",keep:"\u4FDD\u6301\u9009\u62E9",clear:"\u6E05\u9664\u9009\u62E9"}},dataView:{title:"\u6570\u636E\u89C6\u56FE",lang:["\u6570\u636E\u89C6\u56FE","\u5173\u95ED","\u5237\u65B0"]},dataZoom:{title:{zoom:"\u533A\u57DF\u7F29\u653E",back:"\u533A\u57DF\u7F29\u653E\u8FD8\u539F"}},magicType:{title:{line:"\u5207\u6362\u4E3A\u6298\u7EBF\u56FE",bar:"\u5207\u6362\u4E3A\u67F1\u72B6\u56FE",stack:"\u5207\u6362\u4E3A\u5806\u53E0",tiled:"\u5207\u6362\u4E3A\u5E73\u94FA"}},restore:{title:"\u8FD8\u539F"},saveAsImage:{title:"\u4FDD\u5B58\u4E3A\u56FE\u7247",lang:["\u53F3\u952E\u53E6\u5B58\u4E3A\u56FE\u7247"]}},series:{typeNames:{pie:"\u997C\u56FE",bar:"\u67F1\u72B6\u56FE",line:"\u6298\u7EBF\u56FE",scatter:"\u6563\u70B9\u56FE",effectScatter:"\u6D9F\u6F2A\u6563\u70B9\u56FE",radar:"\u96F7\u8FBE\u56FE",tree:"\u6811\u56FE",treemap:"\u77E9\u5F62\u6811\u56FE",boxplot:"\u7BB1\u578B\u56FE",candlestick:"K\u7EBF\u56FE",k:"K\u7EBF\u56FE",heatmap:"\u70ED\u529B\u56FE",map:"\u5730\u56FE",parallel:"\u5E73\u884C\u5750\u6807\u56FE",lines:"\u7EBF\u56FE",graph:"\u5173\u7CFB\u56FE",sankey:"\u6851\u57FA\u56FE",funnel:"\u6F0F\u6597\u56FE",gauge:"\u4EEA\u8868\u76D8\u56FE",pictorialBar:"\u8C61\u5F62\u67F1\u56FE",themeRiver:"\u4E3B\u9898\u6CB3\u6D41\u56FE",sunburst:"\u65ED\u65E5\u56FE"}},aria:{general:{withTitle:"\u8FD9\u662F\u4E00\u4E2A\u5173\u4E8E\u201C{title}\u201D\u7684\u56FE\u8868\u3002",withoutTitle:"\u8FD9\u662F\u4E00\u4E2A\u56FE\u8868\uFF0C"},series:{single:{prefix:"",withName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\uFF0C\u8868\u793A{seriesName}\u3002",withoutName:"\u56FE\u8868\u7C7B\u578B\u662F{seriesType}\u3002"},multiple:{prefix:"\u5B83\u7531{seriesCount}\u4E2A\u56FE\u8868\u7CFB\u5217\u7EC4\u6210\u3002",withName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A\u8868\u793A{seriesName}\u7684{seriesType}\uFF0C",withoutName:"\u7B2C{seriesId}\u4E2A\u7CFB\u5217\u662F\u4E00\u4E2A{seriesType}\uFF0C",separator:{middle:"\uFF1B",end:"\u3002"}}},data:{allData:"\u5176\u6570\u636E\u662F\u2014\u2014",partialData:"\u5176\u4E2D\uFF0C\u524D{displayCnt}\u9879\u662F\u2014\u2014",withName:"{name}\u7684\u6570\u636E\u662F{value}",withoutName:"{value}",separator:{middle:"\uFF0C",end:""}}}};f.exports=m}),Y_t=xt((o,f)=>{var m=Wi(),v=J3(),y=oB(),x=y.retrieveRawValue;function C(w,A){var E=A.getModel("aria");if(E.get("show")){if(E.get("description")){w.setAttribute("aria-label",E.get("description"));return}}else return;var T=0;A.eachSeries(function(G,j){++T},this);var S=E.get("data.maxCount")||10,M=E.get("series.maxCount")||10,I=Math.min(T,M),P;if(T<1)return;var D=k();D?P=O(F("general.withTitle"),{title:D}):P=F("general.withoutTitle");var L=[],R=T>1?"series.multiple.prefix":"series.single.prefix";P+=O(F(R),{seriesCount:T}),A.eachSeries(function(G,j){if(j1?"multiple":"single")+".";q=F(J?X+"withName":X+"withoutName"),q=O(q,{seriesId:G.seriesIndex,seriesName:G.get("name"),seriesType:U(G.subType)});var Y=G.getData();window.data=Y,Y.count()>S?q+=O(F("data.partialData"),{displayCnt:S}):q+=F("data.allData");for(var Q=[],ee=0;ee{var m=Wi(),v=xa(),y=nb(),x=Math.PI;function C(w,A){A=A||{},m.defaults(A,{text:"loading",textColor:"#000",fontSize:"12px",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#c23531",spinnerRadius:10,lineWidth:5,zlevel:0});var E=new v.Group,T=new v.Rect({style:{fill:A.maskColor},zlevel:A.zlevel,z:1e4});E.add(T);var S=A.fontSize+" sans-serif",M=new v.Rect({style:{fill:"none",text:A.text,font:S,textPosition:"right",textDistance:10,textFill:A.textColor},zlevel:A.zlevel,z:10001});if(E.add(M),A.showSpinner){var I=new v.Arc({shape:{startAngle:-x/2,endAngle:-x/2+.1,r:A.spinnerRadius},style:{stroke:A.color,lineCap:"round",lineWidth:A.lineWidth},zlevel:A.zlevel,z:10001});I.animateShape(!0).when(1e3,{endAngle:x*3/2}).start("circularInOut"),I.animateShape(!0).when(1e3,{startAngle:x*3/2}).delay(300).start("circularInOut"),E.add(I)}return E.resize=function(){var P=y.getWidth(A.text,S),D=A.showSpinner?A.spinnerRadius:0,L=(w.getWidth()-D*2-(A.showSpinner&&P?10:0)-P)/2-(A.showSpinner?0:P/2),R=w.getHeight()/2;A.showSpinner&&I.setShape({cx:L,cy:R}),M.setShape({x:L-D,y:R-D,width:D*2,height:D*2}),T.setShape({x:0,y:0,width:w.getWidth(),height:w.getHeight()})},E.resize(),E}f.exports=C}),X_t=xt((o,f)=>{var m=Wi(),v=m.each,y=m.map,x=m.isFunction,C=m.createHashMap,w=m.noop,A=C0e(),E=A.createTask,T=zj(),S=T.getUID,M=W8e(),I=j8e(),P=vu(),D=P.normalizeToArray;function L(de,ve,he,Ce){this.ecInstance=de,this.api=ve,this.unfinished;var he=this._dataProcessorHandlers=he.slice(),Ce=this._visualHandlers=Ce.slice();this._allHandlers=he.concat(Ce),this._stageTaskMap=C()}var R=L.prototype;R.restoreData=function(de,ve){de.restoreData(ve),this._stageTaskMap.each(function(pe){var ce=pe.overallTask;ce&&ce.dirty()})},R.getPerformArgs=function(de,ve){if(de.__pipeline){var pe=this._pipelineMap.get(de.__pipeline.id),ce=pe.context,he=!ve&&pe.progressiveEnabled&&(!ce||ce.progressiveRender)&&de.__idxInPipeline>pe.blockIndex,Ce=he?pe.step:null,Se=ce&&ce.modDataCount,De=Se!=null?Math.ceil(Se/Ce):null;return{step:Ce,modBy:De,modDataCount:Se}}},R.getPipeline=function(de){return this._pipelineMap.get(de)},R.updateStreamModes=function(de,ve){var pe=this._pipelineMap.get(de.uid),ce=de.getData(),he=ce.count(),Ce=pe.progressiveEnabled&&ve.incrementalPrepareRender&&he>=pe.threshold,Se=de.get("large")&&he>=de.get("largeThreshold"),De=de.get("progressiveChunkMode")==="mod"?he:null;de.pipelineContext=pe.context={progressiveRender:Ce,modDataCount:De,large:Se}},R.restorePipelines=function(de){var ve=this,pe=ve._pipelineMap=C();de.eachSeries(function(ce){var he=ce.getProgressive(),Ce=ce.uid;pe.set(Ce,{id:Ce,head:null,tail:null,threshold:ce.getProgressiveThreshold(),progressiveEnabled:he&&!(ce.preventIncremental&&ce.preventIncremental()),blockIndex:-1,step:Math.round(he||700),count:0}),ie(ve,ce,ce.dataTask)})},R.prepareStageTasks=function(){var de=this._stageTaskMap,ve=this.ecInstance.getModel(),pe=this.api;v(this._allHandlers,function(ce){var he=de.get(ce.uid)||de.set(ce.uid,[]);ce.reset&&k(this,ce,he,ve,pe),ce.overallReset&&U(this,ce,he,ve,pe)},this)},R.prepareView=function(de,ve,pe,ce){var he=de.renderTask,Ce=he.context;Ce.model=ve,Ce.ecModel=pe,Ce.api=ce,he.__block=!de.incrementalPrepareRender,ie(this,ve,he)},R.performDataProcessorTasks=function(de,ve){O(this,this._dataProcessorHandlers,de,ve,{block:!0})},R.performVisualTasks=function(de,ve,pe){O(this,this._visualHandlers,de,ve,pe)};function O(de,ve,pe,ce,he){he=he||{};var Ce;v(ve,function(De,Oe){if(!(he.visualType&&he.visualType!==De.visualType)){var Ue=de._stageTaskMap.get(De.uid),Xe=Ue.seriesTaskMap,it=Ue.overallTask;if(it){var ut,at=it.agentStubMap;at.each(function(Qe){Se(he,Qe)&&(Qe.dirty(),ut=!0)}),ut&&it.dirty(),F(it,ce);var Pt=de.getPerformArgs(it,he.block);at.each(function(Qe){Qe.perform(Pt)}),Ce|=it.perform(Pt)}else Xe&&Xe.each(function(Qe,ft){Se(he,Qe)&&Qe.dirty();var Ot=de.getPerformArgs(Qe,he.block);Ot.skip=!De.performRawSeries&&pe.isSeriesFiltered(Qe.context.model),F(Qe,ce),Ce|=Qe.perform(Ot)})}});function Se(De,Oe){return De.setDirty&&(!De.dirtyMap||De.dirtyMap.get(Oe.__pipeline.id))}de.unfinished|=Ce}R.performSeriesTasks=function(de){var ve;de.eachSeries(function(pe){ve|=pe.dataTask.perform()}),this.unfinished|=ve},R.plan=function(){this._pipelineMap.each(function(de){var ve=de.tail;do{if(ve.__block){de.blockIndex=ve.__idxInPipeline;break}ve=ve.getUpstream()}while(ve)})};var F=R.updatePayload=function(de,ve){ve!=="remain"&&(de.context.payload=ve)};function k(de,ve,pe,ce,he){var Ce=pe.seriesTaskMap||(pe.seriesTaskMap=C()),Se=ve.seriesType,De=ve.getTargetSeries;ve.createOnAllSeries?ce.eachRawSeries(Oe):Se?ce.eachRawSeriesByType(Se,Oe):De&&De(ce,he).each(Oe);function Oe(Xe){var it=Xe.uid,ut=Ce.get(it)||Ce.set(it,E({plan:X,reset:Y,count:z}));ut.context={model:Xe,ecModel:ce,api:he,useClearVisual:ve.isVisual&&!ve.isLayout,plan:ve.plan,reset:ve.reset,scheduler:de},ie(de,Xe,ut)}var Ue=de._pipelineMap;Ce.each(function(Xe,it){Ue.get(it)||(Xe.dispose(),Ce.removeKey(it))})}function U(de,ve,pe,ce,he){var Ce=pe.overallTask=pe.overallTask||E({reset:G});Ce.context={ecModel:ce,api:he,overallReset:ve.overallReset,scheduler:de};var Se=Ce.agentStubMap=Ce.agentStubMap||C(),De=ve.seriesType,Oe=ve.getTargetSeries,Ue=!0,Xe=ve.modifyOutputEnd;De?ce.eachRawSeriesByType(De,it):Oe?Oe(ce,he).each(it):(Ue=!1,v(ce.getSeries(),it));function it(at){var Pt=at.uid,Qe=Se.get(Pt);Qe||(Qe=Se.set(Pt,E({reset:j,onDirty:J})),Ce.dirty()),Qe.context={model:at,overallProgress:Ue,modifyOutputEnd:Xe},Qe.agent=Ce,Qe.__block=Ue,ie(de,at,Qe)}var ut=de._pipelineMap;Se.each(function(at,Pt){ut.get(Pt)||(at.dispose(),Ce.dirty(),Se.removeKey(Pt))})}function G(de){de.overallReset(de.ecModel,de.api,de.payload)}function j(de,ve){return de.overallProgress&&q}function q(){this.agent.dirty(),this.getDownstream().dirty()}function J(){this.agent&&this.agent.dirty()}function X(de){return de.plan&&de.plan(de.model,de.ecModel,de.api,de.payload)}function Y(de){de.useClearVisual&&de.data.clearAllVisual();var ve=de.resetDefines=D(de.reset(de.model,de.ecModel,de.api,de.payload));return ve.length>1?y(ve,function(pe,ce){return ee(ce)}):Q}var Q=ee(0);function ee(de){return function(ve,pe){var ce=pe.data,he=pe.resetDefines[de];if(he&&he.dataEach)for(var Ce=ve.start;Ce{var m=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"],v={color:m,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],m]};f.exports=v}),K_t=xt((o,f)=>{var m="#eee",v=function(){return{axisLine:{lineStyle:{color:m}},axisTick:{lineStyle:{color:m}},axisLabel:{textStyle:{color:m}},splitLine:{lineStyle:{type:"dashed",color:"#aaa"}},splitArea:{areaStyle:{color:m}}}},y=["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78","#73a373","#73b9bc","#7289ab","#91ca8c","#f49f42"],x={color:y,backgroundColor:"#333",tooltip:{axisPointer:{lineStyle:{color:m},crossStyle:{color:m},label:{color:"#000"}}},legend:{textStyle:{color:m}},textStyle:{color:m},title:{textStyle:{color:m}},toolbox:{iconStyle:{normal:{borderColor:m}}},dataZoom:{textStyle:{color:m}},visualMap:{textStyle:{color:m}},timeline:{lineStyle:{color:m},itemStyle:{normal:{color:y[1]}},label:{normal:{textStyle:{color:m}}},controlStyle:{normal:{color:m,borderColor:m}}},timeAxis:v(),logAxis:v(),valueAxis:v(),categoryAxis:v(),line:{symbol:"circle"},graph:{color:y},gauge:{title:{textStyle:{color:m}}},candlestick:{itemStyle:{normal:{color:"#FD1050",color0:"#0CF49B",borderColor:"#FD1050",borderColor0:"#0CF49B"}}}};x.categoryAxis.splitLine.show=!1;var C=x;f.exports=C}),Y8e=xt(()=>{var o=Xg(),f=Aie(),m=VM(),v=m.detectSourceFormat,y=Hj(),x=y.SERIES_LAYOUT_BY_COLUMN;o.extend({type:"dataset",defaultOption:{seriesLayoutBy:x,sourceHeader:null,dimensions:null,source:null},optionUpdated:function(){v(this)}}),f.extend({type:"dataset"})}),Q_t=xt((o,f)=>{var m=am(),v=m.extend({type:"ellipse",shape:{cx:0,cy:0,rx:0,ry:0},buildPath:function(y,x){var C=.5522848,w=x.cx,A=x.cy,E=x.rx,T=x.ry,S=E*C,M=T*C;y.moveTo(w-E,A),y.bezierCurveTo(w-E,A-M,w-S,A-T,w,A-T),y.bezierCurveTo(w+S,A-T,w+E,A-M,w+E,A),y.bezierCurveTo(w+E,A+M,w+S,A+T,w,A+T),y.bezierCurveTo(w-S,A+T,w-E,A+M,w-E,A),y.closePath()}});f.exports=v}),q8e=xt(o=>{var f=rB(),m=rU(),v=nB(),y=B8e(),x=_0e(),C=Q_t(),w=U8e(),A=am(),E=z8e(),T=H8e(),S=v0e(),M=p0e(),I=Ky(),P=F8e(),D=P.createFromString,L=Wi(),R=L.isString,O=L.extend,F=L.defaults,k=L.trim,U=L.each,G=/[\s,]+/;function j(pe){if(R(pe)){var ce=new DOMParser;pe=ce.parseFromString(pe,"text/xml")}for(pe.nodeType===9&&(pe=pe.firstChild);pe.nodeName.toLowerCase()!=="svg"||pe.nodeType!==1;)pe=pe.nextSibling;return pe}function q(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}q.prototype.parse=function(pe,ce){ce=ce||{};var he=j(pe);if(!he)throw new Error("Illegal svg");var Ce=new f;this._root=Ce;var Se=he.getAttribute("viewBox")||"",De=parseFloat(he.getAttribute("width")||ce.width),Oe=parseFloat(he.getAttribute("height")||ce.height);isNaN(De)&&(De=null),isNaN(Oe)&&(Oe=null),ie(he,Ce,null,!0);for(var Ue=he.firstChild;Ue;)this._parseNode(Ue,Ce),Ue=Ue.nextSibling;var Xe,it;if(Se){var ut=k(Se).split(G);ut.length>=4&&(Xe={x:parseFloat(ut[0]||0),y:parseFloat(ut[1]||0),width:parseFloat(ut[2]),height:parseFloat(ut[3])})}if(Xe&&De!=null&&Oe!=null&&(it=de(Xe,De,Oe),!ce.ignoreViewBox)){var at=Ce;Ce=new f,Ce.add(at),at.scale=it.scale.slice(),at.position=it.position.slice()}return!ce.ignoreRootClip&&De!=null&&Oe!=null&&Ce.setClipPath(new x({shape:{x:0,y:0,width:De,height:Oe}})),{root:Ce,width:De,height:Oe,viewBoxRect:Xe,viewBoxTransform:it}},q.prototype._parseNode=function(pe,ce){var he=pe.nodeName.toLowerCase();he==="defs"?this._isDefine=!0:he==="text"&&(this._isText=!0);var Ce;if(this._isDefine){var Se=X[he];if(Se){var De=Se.call(this,pe),Oe=pe.getAttribute("id");Oe&&(this._defs[Oe]=De)}}else{var Se=J[he];Se&&(Ce=Se.call(this,pe,ce),ce.add(Ce))}for(var Ue=pe.firstChild;Ue;)Ue.nodeType===1&&this._parseNode(Ue,Ce),Ue.nodeType===3&&this._isText&&this._parseText(Ue,Ce),Ue=Ue.nextSibling;he==="defs"?this._isDefine=!1:he==="text"&&(this._isText=!1)},q.prototype._parseText=function(pe,ce){if(pe.nodeType===1){var he=pe.getAttribute("dx")||0,Ce=pe.getAttribute("dy")||0;this._textX+=parseFloat(he),this._textY+=parseFloat(Ce)}var Se=new v({style:{text:pe.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});Q(ce,Se),ie(pe,Se,this._defs);var De=Se.style.fontSize;De&&De<9&&(Se.style.fontSize=9,Se.scale=Se.scale||[1,1],Se.scale[0]*=De/9,Se.scale[1]*=De/9);var Oe=Se.getBoundingRect();return this._textX+=Oe.width,ce.add(Se),Se};var J={g:function(pe,ce){var he=new f;return Q(ce,he),ie(pe,he,this._defs),he},rect:function(pe,ce){var he=new x;return Q(ce,he),ie(pe,he,this._defs),he.setShape({x:parseFloat(pe.getAttribute("x")||0),y:parseFloat(pe.getAttribute("y")||0),width:parseFloat(pe.getAttribute("width")||0),height:parseFloat(pe.getAttribute("height")||0)}),he},circle:function(pe,ce){var he=new y;return Q(ce,he),ie(pe,he,this._defs),he.setShape({cx:parseFloat(pe.getAttribute("cx")||0),cy:parseFloat(pe.getAttribute("cy")||0),r:parseFloat(pe.getAttribute("r")||0)}),he},line:function(pe,ce){var he=new w;return Q(ce,he),ie(pe,he,this._defs),he.setShape({x1:parseFloat(pe.getAttribute("x1")||0),y1:parseFloat(pe.getAttribute("y1")||0),x2:parseFloat(pe.getAttribute("x2")||0),y2:parseFloat(pe.getAttribute("y2")||0)}),he},ellipse:function(pe,ce){var he=new C;return Q(ce,he),ie(pe,he,this._defs),he.setShape({cx:parseFloat(pe.getAttribute("cx")||0),cy:parseFloat(pe.getAttribute("cy")||0),rx:parseFloat(pe.getAttribute("rx")||0),ry:parseFloat(pe.getAttribute("ry")||0)}),he},polygon:function(pe,ce){var he=pe.getAttribute("points");he&&(he=ee(he));var Ce=new E({shape:{points:he||[]}});return Q(ce,Ce),ie(pe,Ce,this._defs),Ce},polyline:function(pe,ce){var he=new A;Q(ce,he),ie(pe,he,this._defs);var Ce=pe.getAttribute("points");Ce&&(Ce=ee(Ce));var Se=new T({shape:{points:Ce||[]}});return Se},image:function(pe,ce){var he=new m;return Q(ce,he),ie(pe,he,this._defs),he.setStyle({image:pe.getAttribute("xlink:href"),x:pe.getAttribute("x"),y:pe.getAttribute("y"),width:pe.getAttribute("width"),height:pe.getAttribute("height")}),he},text:function(pe,ce){var he=pe.getAttribute("x")||0,Ce=pe.getAttribute("y")||0,Se=pe.getAttribute("dx")||0,De=pe.getAttribute("dy")||0;this._textX=parseFloat(he)+parseFloat(Se),this._textY=parseFloat(Ce)+parseFloat(De);var Oe=new f;return Q(ce,Oe),ie(pe,Oe,this._defs),Oe},tspan:function(pe,ce){var he=pe.getAttribute("x"),Ce=pe.getAttribute("y");he!=null&&(this._textX=parseFloat(he)),Ce!=null&&(this._textY=parseFloat(Ce));var Se=pe.getAttribute("dx")||0,De=pe.getAttribute("dy")||0,Oe=new f;return Q(ce,Oe),ie(pe,Oe,this._defs),this._textX+=Se,this._textY+=De,Oe},path:function(pe,ce){var he=pe.getAttribute("d")||"",Ce=D(he);return Q(ce,Ce),ie(pe,Ce,this._defs),Ce}},X={lineargradient:function(pe){var ce=parseInt(pe.getAttribute("x1")||0,10),he=parseInt(pe.getAttribute("y1")||0,10),Ce=parseInt(pe.getAttribute("x2")||10,10),Se=parseInt(pe.getAttribute("y2")||0,10),De=new S(ce,he,Ce,Se);return Y(pe,De),De},radialgradient:function(pe){}};function Y(pe,ce){for(var he=pe.firstChild;he;){if(he.nodeType===1){var Ce=he.getAttribute("offset");Ce.indexOf("%")>0?Ce=parseInt(Ce,10)/100:Ce?Ce=parseFloat(Ce):Ce=0;var Se=he.getAttribute("stop-color")||"#000000";ce.addColorStop(Ce,Se)}he=he.nextSibling}}function Q(pe,ce){pe&&pe.__inheritedStyle&&(ce.__inheritedStyle||(ce.__inheritedStyle={}),F(ce.__inheritedStyle,pe.__inheritedStyle))}function ee(pe){for(var ce=k(pe).split(G),he=[],Ce=0;Ce0;De-=2){var Oe=Se[De],Ue=Se[De-1];switch(Ce=Ce||I.create(),Ue){case"translate":Oe=k(Oe).split(G),I.translate(Ce,Ce,[parseFloat(Oe[0]),parseFloat(Oe[1]||0)]);break;case"scale":Oe=k(Oe).split(G),I.scale(Ce,Ce,[parseFloat(Oe[0]),parseFloat(Oe[1]||Oe[0])]);break;case"rotate":Oe=k(Oe).split(G),I.rotate(Ce,Ce,parseFloat(Oe[0]));break;case"skew":Oe=k(Oe).split(G),console.warn("Skew transform is not supported yet");break;case"matrix":var Oe=k(Oe).split(G);Ce[0]=parseFloat(Oe[0]),Ce[1]=parseFloat(Oe[1]),Ce[2]=parseFloat(Oe[2]),Ce[3]=parseFloat(Oe[3]),Ce[4]=parseFloat(Oe[4]),Ce[5]=parseFloat(Oe[5]);break}}ce.setLocalTransform(Ce)}}var ae=/([^\s:;]+)\s*:\s*([^:;]+)/g;function fe(pe){var ce=pe.getAttribute("style"),he={};if(!ce)return he;var Ce={};ae.lastIndex=0;for(var Se;(Se=ae.exec(ce))!=null;)Ce[Se[1]]=Se[2];for(var De in z)z.hasOwnProperty(De)&&Ce[De]!=null&&(he[z[De]]=Ce[De]);return he}function de(pe,ce,he){var Ce=ce/pe.width,Se=he/pe.height,De=Math.min(Ce,Se),Oe=[De,De],Ue=[-(pe.x+pe.width/2)*De+ce/2,-(pe.y+pe.height/2)*De+he/2];return{scale:Oe,position:Ue}}function ve(pe,ce){var he=new q;return he.parse(pe,ce)}o.parseXML=j,o.makeViewBoxTransform=de,o.parseSVG=ve}),b0e=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Wi(),x=y.createHashMap,C=y.isString,w=y.isArray,A=y.each,E=y.assert,T=q8e(),S=T.parseXML,M=x(),I={registerMap:function(D,L,R){var O;return w(L)?O=L:L.svg?O=[{type:"svg",source:L.svg,specialAreas:L.specialAreas}]:(L.geoJson&&!L.features&&(R=L.specialAreas,L=L.geoJson),O=[{type:"geoJSON",source:L,specialAreas:R}]),A(O,function(F){var k=F.type;k==="geoJson"&&(k=F.type="geoJSON");var U=P[k];U(F)}),M.set(D,O)},retrieveMap:function(D){return M.get(D)}},P={geoJSON:function(D){var L=D.source;D.geoJSON=C(L)?typeof JSON<"u"&&JSON.parse?JSON.parse(L):new Function("return ("+L+");")():L},svg:function(D){D.svgXML=S(D.source)}};f.exports=I}),aB=xt((o,f)=>{function m(C){return C}function v(C,w,A,E,T){this._old=C,this._new=w,this._oldKeyGetter=A||m,this._newKeyGetter=E||m,this.context=T}v.prototype={constructor:v,add:function(C){return this._add=C,this},update:function(C){return this._update=C,this},remove:function(C){return this._remove=C,this},execute:function(){var C=this._old,w=this._new,A={},E={},T=[],S=[],M;for(y(C,A,T,"_oldKeyGetter",this),y(w,E,S,"_newKeyGetter",this),M=0;M{var f=Wi(),m=f.each,v=f.createHashMap,y=f.assert,x=Ac(),C=x.__DEV__,w=v(["tooltip","label","itemName","itemId","seriesName"]);function A(M){var I={},P=I.encode={},D=v(),L=[],R=[],O=I.userOutput={dimensionNames:M.dimensions.slice(),encode:{}};m(M.dimensions,function(j){var q=M.getDimensionInfo(j),J=q.coordDim;if(J){var X=q.coordDimIndex;E(P,J)[X]=j,q.isExtraCoord||(D.set(J,1),S(q.type)&&(L[0]=j),E(O.encode,J)[X]=q.index),q.defaultTooltip&&R.push(j)}w.each(function(Y,Q){var ee=E(P,Q),z=q.otherDims[Q];z!=null&&z!==!1&&(ee[z]=q.name)})});var F=[],k={};D.each(function(j,q){var J=P[q];k[q]=J[0],F=F.concat(J)}),I.dataDimsOnCoord=F,I.encodeFirstDimNotExtra=k;var U=P.label;U&&U.length&&(L=U.slice());var G=P.tooltip;return G&&G.length?R=G.slice():R.length||(R=L.slice()),P.defaultedLabel=L,P.defaultedTooltip=R,I}function E(M,I){return M.hasOwnProperty(I)||(M[I]=[]),M[I]}function T(M){return M==="category"?"ordinal":M==="time"?"time":"float"}function S(M){return!(M==="ordinal"||M==="time")}o.OTHER_DIMENSIONS=w,o.summarizeDimensions=A,o.getDimensionTypeByAxis=T}),X8e=xt((o,f)=>{var m=Wi();function v(x){x!=null&&m.extend(this,x),this.otherDims={}}var y=v;f.exports=y}),Yw=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Wi(),x=Sm(),C=aB(),w=Uj(),A=oB(),E=A.defaultDimValueGetters,T=A.DefaultDataProvider,S=Gj(),M=S.summarizeDimensions,I=X8e(),P=y.isObject,D="undefined",L=-1,R="e\0\0",O={float:typeof Float64Array===D?Array:Float64Array,int:typeof Int32Array===D?Array:Int32Array,ordinal:Array,number:Array,time:Array},F=typeof Uint32Array===D?Array:Uint32Array,k=typeof Int32Array===D?Array:Int32Array,U=typeof Uint16Array===D?Array:Uint16Array;function G(ce){return ce._rawCount>65535?F:U}function j(ce){var he=ce.constructor;return he===Array?ce.slice():new he(ce)}var q=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_rawData","_chunkSize","_chunkCount","_dimValueGetter","_count","_rawCount","_nameDimIdx","_idDimIdx"],J=["_extent","_approximateExtent","_rawExtent"];function X(ce,he){y.each(q.concat(he.__wrappedMethods||[]),function(Ce){he.hasOwnProperty(Ce)&&(ce[Ce]=he[Ce])}),ce.__wrappedMethods=he.__wrappedMethods,y.each(J,function(Ce){ce[Ce]=y.clone(he[Ce])}),ce._calculationInfo=y.extend(he._calculationInfo)}var Y=function(ce,he){ce=ce||["x","y"];for(var Ce={},Se=[],De={},Oe=0;OeIt[1]&&(It[1]=gt)}he&&(this._nameList[ft]=he[Ot])}this._rawCount=this._count=it,this._extent={},z(this)},Q._initDataFromProvider=function(ce,he){if(!(ce>=he)){for(var Ce=this._chunkSize,Se=this._rawData,De=this._storage,Oe=this.dimensions,Ue=Oe.length,Xe=this._dimensionInfos,it=this._nameList,ut=this._idList,at=this._rawExtent,Pt=this._nameRepeatCount={},Qe,ft=this._chunkCount,Ot=0;Otei[1]&&(ei[1]=ii)}if(!Se.pure){var Li=it[gt];if(bt&&Li==null){if(bt.name!=null)it[gt]=Li=bt.name;else if(Qe!=null){var Je=Oe[Qe],Nt=De[Je][It];if(Nt){Li=Nt[Jt];var yi=Xe[Je].ordinalMeta;yi&&yi.categories.length&&(Li=yi.categories[Li])}}}var ai=bt==null?null:bt.id;ai==null&&Li!=null&&(Pt[Li]=Pt[Li]||0,ai=Li,Pt[Li]>0&&(ai+="__ec__"+Pt[Li]),Pt[Li]++),ai!=null&&(ut[gt]=ai)}}!Se.persistent&&Se.clean&&Se.clean(),this._rawCount=this._count=he,this._extent={},z(this)}};function ee(ce,he,Ce,Se,De){var Oe=O[he.type],Ue=Se-1,Xe=he.name,it=ce[Xe][Ue];if(it&&it.length=0&&he=0&&heXe&&(Xe=ut)}return Oe=[Ue,Xe],this._extent[ce]=Oe,Oe},Q.getApproximateExtent=function(ce){return ce=this.getDimension(ce),this._approximateExtent[ce]||this.getDataExtent(ce)},Q.setApproximateExtent=function(ce,he){he=this.getDimension(he),this._approximateExtent[he]=ce.slice()},Q.getCalculationInfo=function(ce){return this._calculationInfo[ce]},Q.setCalculationInfo=function(ce,he){P(ce)?y.extend(this._calculationInfo,ce):this._calculationInfo[ce]=he},Q.getSum=function(ce){var he=this._storage[ce],Ce=0;if(he)for(var Se=0,De=this.count();Se=this._rawCount||ce<0)return-1;if(!this._indices)return ce;var he=this._indices,Ce=he[ce];if(Ce!=null&&Cece)De=Oe-1;else return Oe}return-1},Q.indicesOfNearest=function(ce,he,Ce){var Se=this._storage,De=Se[ce],Oe=[];if(!De)return Oe;Ce==null&&(Ce=1/0);for(var Ue=1/0,Xe=-1,it=0,ut=0,at=this.count();ut=0&&Xe<0)&&(Ue=Qe,Xe=Pt,it=0),Pt===Xe&&(Oe[it++]=ut))}return Oe.length=it,Oe},Q.getRawIndex=re;function re(ce){return ce}function ne(ce){return ce=0?this._indices[ce]:-1}Q.getRawDataItem=function(ce){if(this._rawData.persistent)return this._rawData.getItem(this.getRawIndex(ce));for(var he=[],Ce=0;Ce=ut&><=at||isNaN(gt))&&(Ue[Xe++]=Qe),Qe++}Pt=!0}else if(Se===2){for(var ft=this._storage[it],It=this._storage[he[1]],Jt=ce[he[1]][0],bi=ce[he[1]][1],Ot=0;Ot=ut&><=at||isNaN(gt))&&(ii>=Jt&&ii<=bi||isNaN(ii))&&(Ue[Xe++]=Qe),Qe++}Pt=!0}}if(!Pt)if(Se===1)for(var bt=0;bt=ut&><=at||isNaN(gt))&&(Ue[Xe++]=ei)}else for(var bt=0;btce[Je][1])&&(Li=!1)}Li&&(Ue[Xe++]=this.getRawIndex(bt))}return Xe=0?(De[Xe]=fe(Oe[Xe]),Se._rawExtent[Xe]=de(),Se._extent[Xe]=null):De[Xe]=Oe[Xe])}return Se}function fe(ce){for(var he=new Array(ce.length),Ce=0;Cebi[1]&&(bi[1]=Jt)}}}return De},Q.downSample=function(ce,he,Ce,Se){for(var De=ae(this,[ce]),Oe=De._storage,Ue=[],Xe=Math.floor(1/he),it=Oe[ce],ut=this.count(),at=this._chunkSize,Pt=De._rawExtent[ce],Qe=new(G(this))(ut),ft=0,Ot=0;Otut-Ot&&(Xe=ut-Ot,Ue.length=Xe);for(var Xt=0;XtPt[1]&&(Pt[1]=It),Qe[ft++]=Jt}return De._count=ft,De._indices=Qe,De.getRawIndex=ne,De},Q.getItemModel=function(ce){var he=this.hostModel;return new x(this.getRawDataItem(ce),he,he&&he.ecModel)},Q.diff=function(ce){var he=this;return new C(ce?ce.getIndices():[],this.getIndices(),function(Ce){return oe(ce,Ce)},function(Ce){return oe(he,Ce)})},Q.getVisual=function(ce){var he=this._visual;return he&&he[ce]},Q.setVisual=function(ce,he){if(P(ce)){for(var Ce in ce)ce.hasOwnProperty(Ce)&&this.setVisual(Ce,ce[Ce]);return}this._visual=this._visual||{},this._visual[ce]=he},Q.setLayout=function(ce,he){if(P(ce)){for(var Ce in ce)ce.hasOwnProperty(Ce)&&this.setLayout(Ce,ce[Ce]);return}this._layout[ce]=he},Q.getLayout=function(ce){return this._layout[ce]},Q.getItemLayout=function(ce){return this._itemLayouts[ce]},Q.setItemLayout=function(ce,he,Ce){this._itemLayouts[ce]=Ce?y.extend(this._itemLayouts[ce]||{},he):he},Q.clearItemLayouts=function(){this._itemLayouts.length=0},Q.getItemVisual=function(ce,he,Ce){var Se=this._itemVisuals[ce],De=Se&&Se[he];return De==null&&!Ce?this.getVisual(he):De},Q.setItemVisual=function(ce,he,Ce){var Se=this._itemVisuals[ce]||{},De=this.hasItemVisual;if(this._itemVisuals[ce]=Se,P(he)){for(var Oe in he)he.hasOwnProperty(Oe)&&(Se[Oe]=he[Oe],De[Oe]=!0);return}Se[he]=Ce,De[he]=!0},Q.clearAllVisual=function(){this._visual={},this._itemVisuals=[],this.hasItemVisual={}};var ve=function(ce){ce.seriesIndex=this.seriesIndex,ce.dataIndex=this.dataIndex,ce.dataType=this.dataType};Q.setItemGraphicEl=function(ce,he){var Ce=this.hostModel;he&&(he.dataIndex=ce,he.dataType=this.dataType,he.seriesIndex=Ce&&Ce.seriesIndex,he.type==="group"&&he.traverse(ve,he)),this._graphicEls[ce]=he},Q.getItemGraphicEl=function(ce){return this._graphicEls[ce]},Q.eachItemGraphicEl=function(ce,he){y.each(this._graphicEls,function(Ce,Se){Ce&&ce&&ce.call(he,Ce,Se)})},Q.cloneShallow=function(ce){if(!ce){var he=y.map(this.dimensions,this.getDimensionInfo,this);ce=new Y(he,this.hostModel)}if(ce._storage=this._storage,X(ce,this),this._indices){var Ce=this._indices.constructor;ce._indices=new Ce(this._indices)}else ce._indices=null;return ce.getRawIndex=ce._indices?ne:re,ce},Q.wrapMethod=function(ce,he){var Ce=this[ce];typeof Ce=="function"&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(ce),this[ce]=function(){var Se=Ce.apply(this,arguments);return he.apply(this,[Se].concat(y.slice(arguments)))})},Q.TRANSFERABLE_METHODS=["cloneShallow","downSample","map"],Q.CHANGABLE_METHODS=["filterSelf","selectRange"];var pe=Y;f.exports=pe}),J8e=xt((o,f)=>{var m=Wi(),v=m.createHashMap,y=m.each,x=m.isString,C=m.defaults,w=m.extend,A=m.isObject,E=m.clone,T=vu(),S=T.normalizeToArray,M=VM(),I=M.guessOrdinal,P=M.BE_ORDINAL,D=Uj(),L=Gj(),R=L.OTHER_DIMENSIONS,O=X8e();function F(j,q,J){D.isInstance(q)||(q=D.seriesDataToSource(q)),J=J||{},j=(j||[]).slice();for(var X=(J.dimsDef||[]).slice(),Y=v(),Q=v(),ee=[],z=k(q,j,X,J.dimCount),ie=0;ie{var m=J8e();function v(y,x){return x=x||{},m(x.coordDimensions||[],y,{dimsDef:x.dimensionsDefine||y.dimensionsDefine,encodeDef:x.encodeDefine||y.encodeDefine,dimCount:x.dimensionsCount,encodeDefaulter:x.encodeDefaulter,generateCoord:x.generateCoord,generateCoordCount:x.generateCoordCount})}f.exports=v}),Z_t=xt(o=>{var f=Ac(),m=f.__DEV__,v=Wi(),y=v.createHashMap,x=v.retrieve,C=v.each;function w(S){this.coordSysName=S,this.coordSysDims=[],this.axisMap=y(),this.categoryAxisMap=y(),this.firstCategoryDimIndex=null}function A(S){var M=S.get("coordinateSystem"),I=new w(M),P=E[M];if(P)return P(S,I,I.axisMap,I.categoryAxisMap),I}var E={cartesian2d:function(S,M,I,P){var D=S.getReferringComponents("xAxis")[0],L=S.getReferringComponents("yAxis")[0];M.coordSysDims=["x","y"],I.set("x",D),I.set("y",L),T(D)&&(P.set("x",D),M.firstCategoryDimIndex=0),T(L)&&(P.set("y",L),M.firstCategoryDimIndex==null&(M.firstCategoryDimIndex=1))},singleAxis:function(S,M,I,P){var D=S.getReferringComponents("singleAxis")[0];M.coordSysDims=["single"],I.set("single",D),T(D)&&(P.set("single",D),M.firstCategoryDimIndex=0)},polar:function(S,M,I,P){var D=S.getReferringComponents("polar")[0],L=D.findAxisModel("radiusAxis"),R=D.findAxisModel("angleAxis");M.coordSysDims=["radius","angle"],I.set("radius",L),I.set("angle",R),T(L)&&(P.set("radius",L),M.firstCategoryDimIndex=0),T(R)&&(P.set("angle",R),M.firstCategoryDimIndex==null&&(M.firstCategoryDimIndex=1))},geo:function(S,M,I,P){M.coordSysDims=["lng","lat"]},parallel:function(S,M,I,P){var D=S.ecModel,L=D.getComponent("parallel",S.get("parallelIndex")),R=M.coordSysDims=L.dimensions.slice();C(L.parallelAxisIndex,function(O,F){var k=D.getComponent("parallelAxis",O),U=R[F];I.set(U,k),T(k)&&M.firstCategoryDimIndex==null&&(P.set(U,k),M.firstCategoryDimIndex=F)})}};function T(S){return S.get("type")==="category"}o.getCoordSysInfoBySeries=A}),z2=xt(o=>{var f=Wi(),m=f.each,v=f.isString;function y(w,A,E){E=E||{};var T=E.byIndex,S=E.stackedCoordDimension,M=!!(w&&w.get("stack")),I,P,D,L;if(m(A,function(k,U){v(k)&&(A[U]=k={name:k}),M&&!k.isExtraCoord&&(!T&&!I&&k.ordinalMeta&&(I=k),!P&&k.type!=="ordinal"&&k.type!=="time"&&(!S||S===k.coordDim)&&(P=k))}),P&&!T&&!I&&(T=!0),P){D="__\0ecstackresult",L="__\0ecstackedover",I&&(I.createInvertedIndices=!0);var R=P.coordDim,O=P.type,F=0;m(A,function(k){k.coordDim===R&&F++}),A.push({name:D,coordDim:R,coordDimIndex:F,type:O,isExtraCoord:!0,isCalculationCoord:!0}),F++,A.push({name:L,coordDim:L,coordDimIndex:F,type:O,isExtraCoord:!0,isCalculationCoord:!0})}return{stackedDimension:P&&P.name,stackedByDimension:I&&I.name,isStackedByIndex:T,stackedOverDimension:L,stackResultDimension:D}}function x(w,A){return!!A&&A===w.getCalculationInfo("stackedDimension")}function C(w,A){return x(w,A)?w.getCalculationInfo("stackResultDimension"):A}o.enableDataStack=y,o.isDimensionStacked=x,o.getStackedDimension=C}),zM=xt((o,f)=>{var m=Wi(),v=Yw(),y=sU(),x=Hj(),C=x.SOURCE_FORMAT_ORIGINAL,w=Gj(),A=w.getDimensionTypeByAxis,E=vu(),T=E.getDataItemValue,S=aT(),M=Z_t(),I=M.getCoordSysInfoBySeries,P=Uj(),D=z2(),L=D.enableDataStack,R=VM(),O=R.makeSeriesEncodeForAxisCoordSys;function F(j,q,J){J=J||{},P.isInstance(j)||(j=P.seriesDataToSource(j));var X=q.get("coordinateSystem"),Y=S.get(X),Q=I(q),ee;Q&&(ee=m.map(Q.coordSysDims,function(ae){var fe={name:ae},de=Q.axisMap.get(ae);if(de){var ve=de.get("type");fe.type=A(ve)}return fe})),ee||(ee=Y&&(Y.getDimensionsInfo?Y.getDimensionsInfo():Y.dimensions.slice())||["x","y"]);var z=y(j,{coordDimensions:ee,generateCoord:J.generateCoord,encodeDefaulter:J.useEncodeDefaulter?m.curry(O,ee,q):null}),ie,re;Q&&m.each(z,function(ae,fe){var de=ae.coordDim,ve=Q.categoryAxisMap.get(de);ve&&(ie==null&&(ie=fe),ae.ordinalMeta=ve.getOrdinalMeta()),ae.otherDims.itemName!=null&&(re=!0)}),!re&&ie!=null&&(z[ie].otherDims.itemName=0);var ne=L(q,z),oe=new v(z,q);oe.setCalculationInfo(ne);var se=ie!=null&&k(j)?function(ae,fe,de,ve){return ve===ie?de:this.defaultDimValueGetter(ae,fe,de,ve)}:null;return oe.hasItemOption=!1,oe.initData(j,null,se),oe}function k(j){if(j.sourceFormat===C){var q=U(j.data||[]);return q!=null&&!m.isArray(T(q))}}function U(j){for(var q=0;q{var m=kM();function v(x){this._setting=x||{},this._extent=[1/0,-1/0],this._interval=0,this.init&&this.init.apply(this,arguments)}v.prototype.parse=function(x){return x},v.prototype.getSetting=function(x){return this._setting[x]},v.prototype.contain=function(x){var C=this._extent;return x>=C[0]&&x<=C[1]},v.prototype.normalize=function(x){var C=this._extent;return C[1]===C[0]?.5:(x-C[0])/(C[1]-C[0])},v.prototype.scale=function(x){var C=this._extent;return x*(C[1]-C[0])+C[0]},v.prototype.unionExtent=function(x){var C=this._extent;x[0]C[1]&&(C[1]=x[1])},v.prototype.unionExtentFromData=function(x,C){this.unionExtent(x.getApproximateExtent(C))},v.prototype.getExtent=function(){return this._extent.slice()},v.prototype.setExtent=function(x,C){var w=this._extent;isNaN(x)||(w[0]=x),isNaN(C)||(w[1]=C)},v.prototype.isBlank=function(){return this._isBlank},v.prototype.setBlank=function(x){this._isBlank=x},v.prototype.getLabel=null,m.enableClassExtend(v),m.enableClassManagement(v,{registerWhenExtend:!0});var y=v;f.exports=y}),K8e=xt((o,f)=>{var m=Wi(),v=m.createHashMap,y=m.isObject,x=m.map;function C(S){this.categories=S.categories||[],this._needCollect=S.needCollect,this._deduplication=S.deduplication,this._map}C.createByAxisModel=function(S){var M=S.option,I=M.data,P=I&&x(I,E);return new C({categories:P,needCollect:!P,deduplication:M.dedplication!==!1})};var w=C.prototype;w.getOrdinal=function(S){return A(this).get(S)},w.parseAndCollect=function(S){var M,I=this._needCollect;if(typeof S!="string"&&!I)return S;if(I&&!this._deduplication)return M=this.categories.length,this.categories[M]=S,M;var P=A(this);return M=P.get(S),M==null&&(I?(M=this.categories.length,this.categories[M]=S,P.set(S,M)):M=NaN),M};function A(S){return S._map||(S._map=v(S.categories))}function E(S){return y(S)&&S.value!=null?S.value:S+""}var T=C;f.exports=T}),$_t=xt((o,f)=>{var m=Wi(),v=Eie(),y=K8e(),x=v.prototype,C=v.extend({type:"ordinal",init:function(A,E){(!A||m.isArray(A))&&(A=new y({categories:A})),this._ordinalMeta=A,this._extent=E||[0,A.categories.length-1]},parse:function(A){return typeof A=="string"?this._ordinalMeta.getOrdinal(A):Math.round(A)},contain:function(A){return A=this.parse(A),x.contain.call(this,A)&&this._ordinalMeta.categories[A]!=null},normalize:function(A){return x.normalize.call(this,this.parse(A))},scale:function(A){return Math.round(x.scale.call(this,A))},getTicks:function(){for(var A=[],E=this._extent,T=E[0];T<=E[1];)A.push(T),T++;return A},getLabel:function(A){if(!this.isBlank())return this._ordinalMeta.categories[A]},count:function(){return this._extent[1]-this._extent[0]+1},unionExtentFromData:function(A,E){this.unionExtent(A.getApproximateExtent(E))},getOrdinalMeta:function(){return this._ordinalMeta},niceTicks:m.noop,niceExtent:m.noop});C.create=function(){return new C};var w=C;f.exports=w}),Q8e=xt(o=>{var f=il(),m=f.round;function v(w,A,E,T){var S={},M=w[1]-w[0],I=S.interval=f.nice(M/A,!0);E!=null&&IT&&(I=S.interval=T);var P=S.intervalPrecision=y(I),D=S.niceTickExtent=[m(Math.ceil(w[0]/I)*I,P),m(Math.floor(w[1]/I)*I,P)];return C(D,w),S}function y(w){return f.getPrecisionSafe(w)+2}function x(w,A,E){w[A]=Math.max(Math.min(w[A],E[1]),E[0])}function C(w,A){!isFinite(w[0])&&(w[0]=A[0]),!isFinite(w[1])&&(w[1]=A[1]),x(w,0,A),x(w,1,A),w[0]>w[1]&&(w[0]=w[1])}o.intervalScaleNiceTicks=v,o.getIntervalPrecision=y,o.fixExtent=C}),Tie=xt((o,f)=>{var m=il(),v=fd(),y=Eie(),x=Q8e(),C=m.round,w=y.extend({type:"interval",_interval:0,_intervalPrecision:2,setExtent:function(E,T){var S=this._extent;isNaN(E)||(S[0]=parseFloat(E)),isNaN(T)||(S[1]=parseFloat(T))},unionExtent:function(E){var T=this._extent;E[0]T[1]&&(T[1]=E[1]),w.prototype.setExtent.call(this,T[0],T[1])},getInterval:function(){return this._interval},setInterval:function(E){this._interval=E,this._niceExtent=this._extent.slice(),this._intervalPrecision=x.getIntervalPrecision(E)},getTicks:function(E){var T=this._interval,S=this._extent,M=this._niceExtent,I=this._intervalPrecision,P=[];if(!T)return P;var D=1e4;S[0]D)return[];var R=P.length?P[P.length-1]:M[1];return S[1]>R&&(E?P.push(C(R+T,I)):P.push(S[1])),P},getMinorTicks:function(E){for(var T=this.getTicks(!0),S=[],M=this.getExtent(),I=1;IM[0]&&k{var f=Wi(),m=il(),v=m.parsePercent,y=z2(),x=y.isDimensionStacked,C=aU(),w="__ec_stack_",A=.5,E=typeof Float32Array<"u"?Float32Array:Array;function T(j){return j.get("stack")||w+j.seriesIndex}function S(j){return j.dim+j.index}function M(j){var q=[],J=j.axis,X="axis0";if(J.type==="category"){for(var Y=J.getBandWidth(),Q=0;Q0&&(Q=Q===null?z:Math.min(Q,z))}J[X]=Q}}return J}function D(j){var q=P(j),J=[];return f.each(j,function(X){var Y=X.coordinateSystem,Q=Y.getBaseAxis(),ee=Q.getExtent(),z;if(Q.type==="category")z=Q.getBandWidth();else if(Q.type==="value"||Q.type==="time"){var ie=Q.dim+"_"+Q.index,re=q[ie],ne=Math.abs(ee[1]-ee[0]),oe=Q.scale.getExtent(),se=Math.abs(oe[1]-oe[0]);z=re?ne/se*re:ne}else{var ae=X.getData();z=Math.abs(ee[1]-ee[0])/ae.count()}var fe=v(X.get("barWidth"),z),de=v(X.get("barMaxWidth"),z),ve=v(X.get("barMinWidth")||1,z),pe=X.get("barGap"),ce=X.get("barCategoryGap");J.push({bandWidth:z,barWidth:fe,barMaxWidth:de,barMinWidth:ve,barGap:pe,barCategoryGap:ce,axisKey:S(Q),stackId:T(X)})}),L(J)}function L(j){var q={};f.each(j,function(X,Y){var Q=X.axisKey,ee=X.bandWidth,z=q[Q]||{bandWidth:ee,remainedWidth:ee,autoWidthCount:0,categoryGap:"20%",gap:"30%",stacks:{}},ie=z.stacks;q[Q]=z;var re=X.stackId;ie[re]||z.autoWidthCount++,ie[re]=ie[re]||{width:0,maxWidth:0};var ne=X.barWidth;ne&&!ie[re].width&&(ie[re].width=ne,ne=Math.min(z.remainedWidth,ne),z.remainedWidth-=ne);var oe=X.barMaxWidth;oe&&(ie[re].maxWidth=oe);var se=X.barMinWidth;se&&(ie[re].minWidth=se);var ae=X.barGap;ae!=null&&(z.gap=ae);var fe=X.barCategoryGap;fe!=null&&(z.categoryGap=fe)});var J={};return f.each(q,function(X,Y){J[Y]={};var Q=X.stacks,ee=X.bandWidth,z=v(X.categoryGap,ee),ie=v(X.gap,1),re=X.remainedWidth,ne=X.autoWidthCount,oe=(re-z)/(ne+(ne-1)*ie);oe=Math.max(oe,0),f.each(Q,function(de){var ve=de.maxWidth,pe=de.minWidth;if(de.width){var ce=de.width;ve&&(ce=Math.min(ce,ve)),pe&&(ce=Math.max(ce,pe)),de.width=ce,re-=ce+ie*ce,ne--}else{var ce=oe;ve&&vece&&(ce=pe),ce!==oe&&(de.width=ce,re-=ce+ie*ce,ne--)}}),oe=(re-z)/(ne+(ne-1)*ie),oe=Math.max(oe,0);var se=0,ae;f.each(Q,function(de,ve){de.width||(de.width=oe),ae=de,se+=de.width*(1+ie)}),ae&&(se-=ae.width*ie);var fe=-se/2;f.each(Q,function(de,ve){J[Y][ve]=J[Y][ve]||{bandWidth:ee,offset:fe,width:de.width},fe+=de.width*(1+ie)})}),J}function R(j,q,J){if(j&&q){var X=j[S(q)];return X!=null&&J!=null&&(X=X[T(J)]),X}}function O(j,q){var J=I(j,q),X=D(J),Y={},Q={};f.each(J,function(ee){var z=ee.getData(),ie=ee.coordinateSystem,re=ie.getBaseAxis(),ne=T(ee),oe=X[S(re)][ne],se=oe.offset,ae=oe.width,fe=ie.getOtherAxis(re),de=ee.get("barMinHeight")||0;Y[ne]=Y[ne]||[],Q[ne]=Q[ne]||[],z.setLayout({bandWidth:oe.bandWidth,offset:se,size:ae});for(var ve=z.mapDimension(fe.dim),pe=z.mapDimension(re.dim),ce=x(z,ve),he=fe.isHorizontal(),Ce=G(re,fe,ce),Se=0,De=z.count();Se=0?"p":"n",it=Ce;ce&&(Y[ne][Ue]||(Y[ne][Ue]={p:Ce,n:Ce}),it=Y[ne][Ue][Xe]);var ut,at,Pt,Qe;if(he){var ft=ie.dataToPoint([Oe,Ue]);ut=it,at=ft[1]+se,Pt=ft[0]-Ce,Qe=ae,Math.abs(Pt)A||(ne=A),{progress:oe};function oe(se,ae){for(var fe=se.count,de=new E(fe*2),ve=new E(fe*2),pe=new E(fe),ce,he=[],Ce=[],Se=0,De=0;(ce=se.next())!=null;)Ce[re]=ae.get(ee,ce),Ce[1-re]=ae.get(z,ce),he=J.dataToPoint(Ce,null,he),ve[Se]=ie?X.x+X.width:he[0],de[Se++]=he[0],ve[Se]=ie?he[1]:X.y+X.height,de[Se++]=he[1],pe[De++]=ce;ae.setLayout({largePoints:de,largeDataIndices:pe,largeBackgroundPoints:ve,barWidth:ne,valueAxisStart:G(Y,Q,!1),backgroundStart:ie?X.x:X.y,valueAxisHorizontal:ie})}}};function k(j){return j.coordinateSystem&&j.coordinateSystem.type==="cartesian2d"}function U(j){return j.pipelineContext&&j.pipelineContext.large}function G(j,q,J){return q.toGlobalCoord(q.dataToCoord(q.type==="log"?1:0))}o.getLayoutOnAxis=M,o.prepareLayoutBarSeries=I,o.makeColumnLayout=D,o.retrieveColumnLayout=R,o.layout=O,o.largeLayout=F}),evt=xt((o,f)=>{var m=Wi(),v=il(),y=fd(),x=Q8e(),C=Tie(),w=C.prototype,A=Math.ceil,E=Math.floor,T=1e3,S=T*60,M=S*60,I=M*24,P=function(O,F,k,U){for(;k>>1;O[G][1]k&&(j=k);var q=L.length,J=P(L,j,0,q),X=L[Math.min(J,q-1)],Y=X[1];if(X[0]==="year"){var Q=G/Y,ee=v.nice(Q/O,!0);Y*=ee}var z=this.getSetting("useUTC")?0:new Date(+U[0]||+U[1]).getTimezoneOffset()*60*1e3,ie=[Math.round(A((U[0]-z)/Y)*Y+z),Math.round(E((U[1]-z)/Y)*Y+z)];x.fixExtent(ie,U),this._stepLvl=X,this._interval=Y,this._niceExtent=ie},parse:function(O){return+v.parseDate(O)}});m.each(["contain","normalize"],function(O){D.prototype[O]=function(F){return w[O].call(this,this.parse(F))}});var L=[["hh:mm:ss",T],["hh:mm:ss",T*5],["hh:mm:ss",T*10],["hh:mm:ss",T*15],["hh:mm:ss",T*30],[`hh:mm MM-dd`,S],[`hh:mm MM-dd`,S*5],[`hh:mm MM-dd`,S*10],[`hh:mm MM-dd`,S*15],[`hh:mm MM-dd`,S*30],[`hh:mm MM-dd`,M],[`hh:mm MM-dd`,M*2],[`hh:mm MM-dd`,M*6],[`hh:mm MM-dd`,M*12],[`MM-dd yyyy`,I],[`MM-dd yyyy`,I*2],[`MM-dd yyyy`,I*3],[`MM-dd yyyy`,I*4],[`MM-dd yyyy`,I*5],[`MM-dd yyyy`,I*6],["week",I*7],[`MM-dd yyyy`,I*10],["week",I*14],["week",I*21],["month",I*31],["week",I*42],["month",I*62],["week",I*70],["quarter",I*95],["month",I*31*4],["month",I*31*5],["half-year",I*380/2],["month",I*31*8],["month",I*31*10],["year",I*380]];D.create=function(O){return new D({useUTC:O.ecModel.get("useUTC")})};var R=D;f.exports=R}),Z8e=xt((o,f)=>{var m=Wi(),v=Eie(),y=il(),x=Tie(),C=v.prototype,w=x.prototype,A=y.getPrecisionSafe,E=y.round,T=Math.floor,S=Math.ceil,M=Math.pow,I=Math.log,P=v.extend({type:"log",base:10,$constructor:function(){v.apply(this,arguments),this._originalScale=new x},getTicks:function(R){var O=this._originalScale,F=this._extent,k=O.getExtent();return m.map(w.getTicks.call(this,R),function(U){var G=y.round(M(this.base,U));return G=U===F[0]&&O.__fixMin?D(G,k[0]):G,G=U===F[1]&&O.__fixMax?D(G,k[1]):G,G},this)},getMinorTicks:w.getMinorTicks,getLabel:w.getLabel,scale:function(R){return R=C.scale.call(this,R),M(this.base,R)},setExtent:function(R,O){var F=this.base;R=I(R)/I(F),O=I(O)/I(F),w.setExtent.call(this,R,O)},getExtent:function(){var R=this.base,O=C.getExtent.call(this);O[0]=M(R,O[0]),O[1]=M(R,O[1]);var F=this._originalScale,k=F.getExtent();return F.__fixMin&&(O[0]=D(O[0],k[0])),F.__fixMax&&(O[1]=D(O[1],k[1])),O},unionExtent:function(R){this._originalScale.unionExtent(R);var O=this.base;R[0]=I(R[0])/I(O),R[1]=I(R[1])/I(O),C.unionExtent.call(this,R)},unionExtentFromData:function(R,O){this.unionExtent(R.getApproximateExtent(O))},niceTicks:function(R){R=R||10;var O=this._extent,F=O[1]-O[0];if(!(F===1/0||F<=0)){var k=y.quantity(F),U=R/F*k;for(U<=.5&&(k*=10);!isNaN(k)&&Math.abs(k)<1&&Math.abs(k)>0;)k*=10;var G=[y.round(S(O[0]/k)*k),y.round(T(O[1]/k)*k)];this._interval=k,this._niceExtent=G}},niceExtent:function(R){w.niceExtent.call(this,R);var O=this._originalScale;O.__fixMin=R.fixMin,O.__fixMax=R.fixMax}});m.each(["contain","normalize"],function(R){P.prototype[R]=function(O){return O=I(O)/I(this.base),C[R].call(this,O)}}),P.create=function(){return new P};function D(R,O){return E(R,A(O))}var L=P;f.exports=L}),sT=xt(o=>{var f=Ac(),m=f.__DEV__,v=Wi(),y=$_t(),x=Tie(),C=Eie(),w=il(),A=Sie(),E=A.prepareLayoutBarSeries,T=A.makeColumnLayout,S=A.retrieveColumnLayout,M=Of();evt(),Z8e();function I(q,J){var X=q.type,Y=J.getMin(),Q=J.getMax(),ee=q.getExtent(),z,ie,re;X==="ordinal"?z=J.getCategories().length:(ie=J.get("boundaryGap"),v.isArray(ie)||(ie=[ie||0,ie||0]),typeof ie[0]=="boolean"&&(ie=[0,0]),ie[0]=w.parsePercent(ie[0],1),ie[1]=w.parsePercent(ie[1],1),re=ee[1]-ee[0]||Math.abs(ee[0])),Y==="dataMin"?Y=ee[0]:typeof Y=="function"&&(Y=Y({min:ee[0],max:ee[1]})),Q==="dataMax"?Q=ee[1]:typeof Q=="function"&&(Q=Q({min:ee[0],max:ee[1]}));var ne=Y!=null,oe=Q!=null;Y==null&&(Y=X==="ordinal"?z?0:NaN:ee[0]-ie[0]*re),Q==null&&(Q=X==="ordinal"?z?z-1:NaN:ee[1]+ie[1]*re),(Y==null||!isFinite(Y))&&(Y=NaN),(Q==null||!isFinite(Q))&&(Q=NaN),q.setBlank(v.eqNaN(Y)||v.eqNaN(Q)||X==="ordinal"&&!q.getOrdinalMeta().categories.length),J.getNeedCrossZero()&&(Y>0&&Q>0&&!ne&&(Y=0),Y<0&&Q<0&&!oe&&(Q=0));var se=J.ecModel;if(se&&X==="time"){var ae=E("bar",se),fe;if(v.each(ae,function(pe){fe|=pe.getBaseAxis()===J.axis}),fe){var de=T(ae),ve=P(Y,Q,J,de);Y=ve.min,Q=ve.max}}return{extent:[Y,Q],fixMin:ne,fixMax:oe}}function P(q,J,X,Y){var Q=X.axis.getExtent(),ee=Q[1]-Q[0],z=S(Y,X.axis);if(z===void 0)return{min:q,max:J};var ie=1/0;v.each(z,function(fe){ie=Math.min(fe.offset,ie)});var re=-1/0;v.each(z,function(fe){re=Math.max(fe.offset+fe.width,re)}),ie=Math.abs(ie),re=Math.abs(re);var ne=ie+re,oe=J-q,se=1-(ie+re)/ee,ae=oe/se-oe;return J+=ae*(re/ne),q-=ae*(ie/ne),{min:q,max:J}}function D(q,J){var X=I(q,J),Y=X.extent,Q=J.get("splitNumber");q.type==="log"&&(q.base=J.get("logBase"));var ee=q.type;q.setExtent(Y[0],Y[1]),q.niceExtent({splitNumber:Q,fixMin:X.fixMin,fixMax:X.fixMax,minInterval:ee==="interval"||ee==="time"?J.get("minInterval"):null,maxInterval:ee==="interval"||ee==="time"?J.get("maxInterval"):null});var z=J.get("interval");z!=null&&q.setInterval&&q.setInterval(z)}function L(q,J){if(J=J||q.get("type"),J)switch(J){case"category":return new y(q.getOrdinalMeta?q.getOrdinalMeta():q.getCategories(),[1/0,-1/0]);case"value":return new x;default:return(C.getClass(J)||x).create(q)}}function R(q){var J=q.scale.getExtent(),X=J[0],Y=J[1];return!(X>0&&Y>0||X<0&&Y<0)}function O(q){var J=q.getLabelModel().get("formatter"),X=q.type==="category"?q.scale.getExtent()[0]:null;return typeof J=="string"?(J=function(Y){return function(Q){return Q=q.scale.getLabel(Q),Y.replace("{value}",Q??"")}}(J),J):typeof J=="function"?function(Y,Q){return X!=null&&(Q=Y-X),J(F(q,Y),Q)}:function(Y){return q.scale.getLabel(Y)}}function F(q,J){return q.type==="category"?q.scale.getLabel(J):J}function k(q){var J=q.model,X=q.scale;if(!(!J.get("axisLabel.show")||X.isBlank())){var Y=q.type==="category",Q,ee,z=X.getExtent();Y?ee=X.count():(Q=X.getTicks(),ee=Q.length);var ie=q.getLabelModel(),re=O(q),ne,oe=1;ee>40&&(oe=Math.ceil(ee/40));for(var se=0;se{var m=Wi(),v={getMin:function(y){var x=this.option,C=!y&&x.rangeStart!=null?x.rangeStart:x.min;return this.axis&&C!=null&&C!=="dataMin"&&typeof C!="function"&&!m.eqNaN(C)&&(C=this.axis.scale.parse(C)),C},getMax:function(y){var x=this.option,C=!y&&x.rangeEnd!=null?x.rangeEnd:x.max;return this.axis&&C!=null&&C!=="dataMax"&&typeof C!="function"&&!m.eqNaN(C)&&(C=this.axis.scale.parse(C)),C},getNeedCrossZero:function(){var y=this.option;return y.rangeStart!=null||y.rangeEnd!=null?!1:!y.scale},getCoordSysModel:m.noop,setRange:function(y,x){this.option.rangeStart=y,this.option.rangeEnd=x},resetRange:function(){this.option.rangeStart=this.option.rangeEnd=null}};f.exports=v}),qw=xt(o=>{var f=Wi(),m=xa(),v=Of(),y=nb(),x=y.calculateTextPosition,C=m.extendShape({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(L,R){var O=R.cx,F=R.cy,k=R.width/2,U=R.height/2;L.moveTo(O,F-U),L.lineTo(O+k,F+U),L.lineTo(O-k,F+U),L.closePath()}}),w=m.extendShape({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(L,R){var O=R.cx,F=R.cy,k=R.width/2,U=R.height/2;L.moveTo(O,F-U),L.lineTo(O+k,F),L.lineTo(O,F+U),L.lineTo(O-k,F),L.closePath()}}),A=m.extendShape({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(L,R){var O=R.x,F=R.y,k=R.width/5*3,U=Math.max(k,R.height),G=k/2,j=G*G/(U-G),q=F-U+G+j,J=Math.asin(j/G),X=Math.cos(J)*G,Y=Math.sin(J),Q=Math.cos(J),ee=G*.6,z=G*.7;L.moveTo(O-X,q+j),L.arc(O,q,G,Math.PI-J,Math.PI*2+J),L.bezierCurveTo(O+X-Y*ee,q+j+Q*ee,O,F-z,O,F),L.bezierCurveTo(O,F-z,O-X+Y*ee,q+j+Q*ee,O-X,q+j),L.closePath()}}),E=m.extendShape({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(L,R){var O=R.height,F=R.width,k=R.x,U=R.y,G=F/3*2;L.moveTo(k,U),L.lineTo(k+G,U+O),L.lineTo(k,U+O/4*3),L.lineTo(k-G,U+O),L.lineTo(k,U),L.closePath()}}),T={line:m.Line,rect:m.Rect,roundRect:m.Rect,square:m.Rect,circle:m.Circle,diamond:w,pin:A,arrow:E,triangle:C},S={line:function(L,R,O,F,k){k.x1=L,k.y1=R+F/2,k.x2=L+O,k.y2=R+F/2},rect:function(L,R,O,F,k){k.x=L,k.y=R,k.width=O,k.height=F},roundRect:function(L,R,O,F,k){k.x=L,k.y=R,k.width=O,k.height=F,k.r=Math.min(O,F)/4},square:function(L,R,O,F,k){var U=Math.min(O,F);k.x=L,k.y=R,k.width=U,k.height=U},circle:function(L,R,O,F,k){k.cx=L+O/2,k.cy=R+F/2,k.r=Math.min(O,F)/2},diamond:function(L,R,O,F,k){k.cx=L+O/2,k.cy=R+F/2,k.width=O,k.height=F},pin:function(L,R,O,F,k){k.x=L+O/2,k.y=R+F/2,k.width=O,k.height=F},arrow:function(L,R,O,F,k){k.x=L+O/2,k.y=R+F/2,k.width=O,k.height=F},triangle:function(L,R,O,F,k){k.cx=L+O/2,k.cy=R+F/2,k.width=O,k.height=F}},M={};f.each(T,function(L,R){M[R]=new L});var I=m.extendShape({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(L,R,O){var F=x(L,R,O),k=this.shape;return k&&k.symbolType==="pin"&&R.textPosition==="inside"&&(F.y=O.y+O.height*.4),F},buildPath:function(L,R,O){var F=R.symbolType;if(F!=="none"){var k=M[F];k||(F="rect",k=M[F]),S[F](R.x,R.y,R.width,R.height,k.shape),k.buildPath(L,k.shape,O)}}});function P(L,R){if(this.type!=="image"){var O=this.style,F=this.shape;F&&F.symbolType==="line"?O.stroke=L:this.__isEmptyBrush?(O.stroke=L,O.fill=R||"#fff"):(O.fill&&(O.fill=L),O.stroke&&(O.stroke=L)),this.dirty(!1)}}function D(L,R,O,F,k,U,G){var j=L.indexOf("empty")===0;j&&(L=L.substr(5,1).toLowerCase()+L.substr(6));var q;return L.indexOf("image://")===0?q=m.makeImage(L.slice(8),new v(R,O,F,k),G?"center":"cover"):L.indexOf("path://")===0?q=m.makePath(L.slice(7),{},new v(R,O,F,k),G?"center":"cover"):q=new I({shape:{symbolType:L,x:R,y:O,width:F,height:k}}),q.__isEmptyBrush=j,q.setColor=P,q.setColor(U),q}o.createSymbol=D}),tvt=xt(o=>{var f=Wi(),m=zM(),v=sT(),y=lU(),x=Sm(),C=rd(),w=C.getLayoutRect;o.getLayoutRect=C.getLayoutRect;var A=z2(),E=A.enableDataStack,T=A.isDimensionStacked,S=A.getStackedDimension,M=J8e();o.completeDimensions=M;var I=sU();o.createDimensions=I;var P=qw();o.createSymbol=P.createSymbol;function D(F){return m(F.getSource(),F)}var L={isDimensionStacked:T,enableDataStack:E,getStackedDimension:S};function R(F,k){var U=k;x.isInstance(k)||(U=new x(k),f.mixin(U,y));var G=v.createScaleByModel(U);return G.setExtent(F[0],F[1]),v.niceScaleExtent(G,U),G}function O(F){f.mixin(F,y)}o.createList=D,o.dataStack=L,o.createScale=R,o.mixinAxisModelCommonMethods=O}),$8e=xt(o=>{var f=N8e(),m=1e-8;function v(x,C){return Math.abs(x-C){var m=Of(),v=Vj(),y=lf(),x=$8e();function C(A,E,T){if(this.name=A,this.geometries=E,T)T=[T[0],T[1]];else{var S=this.getBoundingRect();T=[S.x+S.width/2,S.y+S.height/2]}this.center=T}C.prototype={constructor:C,properties:null,getBoundingRect:function(){var A=this._rect;if(A)return A;for(var E=Number.MAX_VALUE,T=[E,E],S=[-E,-E],M=[],I=[],P=this.geometries,D=0;D{var m=Wi(),v=eGe();function y(w){if(!w.UTF8Encoding)return w;var A=w.UTF8Scale;A==null&&(A=1024);for(var E=w.features,T=0;T>1^-(P&1),D=D>>1^-(D&1),P+=S,D+=M,S=P,M=D,T.push([P/E,D/E])}return T}function C(w,A){return y(w),m.map(m.filter(w.features,function(E){return E.geometry&&E.properties&&E.geometry.coordinates.length>0}),function(E){var T=E.properties,S=E.geometry,M=S.coordinates,I=[];S.type==="Polygon"&&I.push({type:"polygon",exterior:M[0],interiors:M.slice(1)}),S.type==="MultiPolygon"&&m.each(M,function(D){D[0]&&I.push({type:"polygon",exterior:D[0],interiors:D.slice(1)})});var P=new v(T[A||"name"],I,T.cp);return P.properties=T,P})}f.exports=C}),ivt=xt(o=>{var f=Wi(),m=nb(),v=vu(),y=v.makeInner,x=sT(),C=x.makeLabelFormatter,w=x.getOptionCategoryInterval,A=x.shouldShowAllLabels,E=y();function T(q){return q.type==="category"?M(q):D(q)}function S(q,J){return q.type==="category"?P(q,J):{ticks:q.scale.getTicks()}}function M(q){var J=q.getLabelModel(),X=I(q,J);return!J.get("show")||q.scale.isBlank()?{labels:[],labelCategoryInterval:X.labelCategoryInterval}:X}function I(q,J){var X=L(q,"labels"),Y=w(J),Q=R(X,Y);if(Q)return Q;var ee,z;return f.isFunction(Y)?ee=j(q,Y):(z=Y==="auto"?F(q):Y,ee=G(q,z)),O(X,Y,{labels:ee,labelCategoryInterval:z})}function P(q,J){var X=L(q,"ticks"),Y=w(J),Q=R(X,Y);if(Q)return Q;var ee,z;if((!J.get("show")||q.scale.isBlank())&&(ee=[]),f.isFunction(Y))ee=j(q,Y,!0);else if(Y==="auto"){var ie=I(q,q.getLabelModel());z=ie.labelCategoryInterval,ee=f.map(ie.labels,function(re){return re.tickValue})}else z=Y,ee=G(q,z,!0);return O(X,Y,{ticks:ee,tickCategoryInterval:z})}function D(q){var J=q.scale.getTicks(),X=C(q);return{labels:f.map(J,function(Y,Q){return{formattedLabel:X(Y,Q),rawLabel:q.scale.getLabel(Y),tickValue:Y}})}}function L(q,J){return E(q)[J]||(E(q)[J]=[])}function R(q,J){for(var X=0;X40&&(ie=Math.max(1,Math.floor(z/40)));for(var re=ee[0],ne=q.dataToCoord(re+1)-q.dataToCoord(re),oe=Math.abs(ne*Math.cos(Y)),se=Math.abs(ne*Math.sin(Y)),ae=0,fe=0;re<=ee[1];re+=ie){var de=0,ve=0,pe=m.getBoundingRect(X(re),J.font,"center","top");de=pe.width*1.3,ve=pe.height*1.3,ae=Math.max(ae,de,7),fe=Math.max(fe,ve,7)}var ce=ae/oe,he=fe/se;isNaN(ce)&&(ce=1/0),isNaN(he)&&(he=1/0);var Ce=Math.max(0,Math.floor(Math.min(ce,he))),Se=E(q.model),De=q.getExtent(),Oe=Se.lastAutoInterval,Ue=Se.lastTickCount;return Oe!=null&&Ue!=null&&Math.abs(Oe-Ce)<=1&&Math.abs(Ue-z)<=1&&Oe>Ce&&Se.axisExtend0===De[0]&&Se.axisExtend1===De[1]?Ce=Oe:(Se.lastTickCount=z,Se.lastAutoInterval=Ce,Se.axisExtend0=De[0],Se.axisExtend1=De[1]),Ce}function U(q){var J=q.getLabelModel();return{axisRotate:q.getRotate?q.getRotate():q.isHorizontal&&!q.isHorizontal()?90:0,labelRotate:J.get("rotate")||0,font:J.getFont()}}function G(q,J,X){var Y=C(q),Q=q.scale,ee=Q.getExtent(),z=q.getLabelModel(),ie=[],re=Math.max((J||0)+1,1),ne=ee[0],oe=Q.count();ne!==0&&re>1&&oe/re>2&&(ne=Math.round(Math.ceil(ne/re)*re));var se=A(q),ae=z.get("showMinLabel")||se,fe=z.get("showMaxLabel")||se;ae&&ne!==ee[0]&&ve(ee[0]);for(var de=ne;de<=ee[1];de+=re)ve(de);fe&&de-re!==ee[1]&&ve(ee[1]);function ve(pe){ie.push(X?pe:{formattedLabel:Y(pe),rawLabel:Q.getLabel(pe),tickValue:pe})}return ie}function j(q,J,X){var Y=q.scale,Q=C(q),ee=[];return f.each(Y.getTicks(),function(z){var ie=Y.getLabel(z);J(z,ie)&&ee.push(X?z:{formattedLabel:Q(z),rawLabel:ie,tickValue:z})}),ee}o.createAxisLabels=T,o.createAxisTicks=S,o.calculateCategoryInterval=k}),K3=xt((o,f)=>{var m=Wi(),v=m.each,y=m.map,x=il(),C=x.linearMap,w=x.getPixelPrecision,A=x.round,E=ivt(),T=E.createAxisTicks,S=E.createAxisLabels,M=E.calculateCategoryInterval,I=[0,1],P=function(O,F,k){this.dim=O,this.scale=F,this._extent=k||[0,0],this.inverse=!1,this.onBand=!1};P.prototype={constructor:P,contain:function(O){var F=this._extent,k=Math.min(F[0],F[1]),U=Math.max(F[0],F[1]);return O>=k&&O<=U},containData:function(O){return this.scale.contain(O)},getExtent:function(){return this._extent.slice()},getPixelPrecision:function(O){return w(O||this.scale.getExtent(),this._extent)},setExtent:function(O,F){var k=this._extent;k[0]=O,k[1]=F},dataToCoord:function(O,F){var k=this._extent,U=this.scale;return O=U.normalize(O),this.onBand&&U.type==="ordinal"&&(k=k.slice(),D(k,U.count())),C(O,I,k,F)},coordToData:function(O,F){var k=this._extent,U=this.scale;this.onBand&&U.type==="ordinal"&&(k=k.slice(),D(k,U.count()));var G=C(O,k,I,F);return this.scale.scale(G)},pointToData:function(O,F){},getTicksCoords:function(O){O=O||{};var F=O.tickModel||this.getTickModel(),k=T(this,F),U=k.ticks,G=y(U,function(q){return{coord:this.dataToCoord(q),tickValue:q}},this),j=F.get("alignWithLabel");return L(this,G,j,O.clamp),G},getMinorTicksCoords:function(){if(this.scale.type==="ordinal")return[];var O=this.model.getModel("minorTick"),F=O.get("splitNumber");F>0&&F<100||(F=5);var k=this.scale.getMinorTicks(F),U=y(k,function(G){return y(G,function(j){return{coord:this.dataToCoord(j),tickValue:j}},this)},this);return U},getViewLabels:function(){return S(this).labels},getLabelModel:function(){return this.model.getModel("axisLabel")},getTickModel:function(){return this.model.getModel("axisTick")},getBandWidth:function(){var O=this._extent,F=this.scale.getExtent(),k=F[1]-F[0]+(this.onBand?1:0);k===0&&(k=1);var U=Math.abs(O[1]-O[0]);return Math.abs(U)/k},isHorizontal:null,getRotate:null,calculateCategoryInterval:function(){return M(this)}};function D(O,F){var k=O[1]-O[0],U=F,G=k/U/2;O[0]+=G,O[1]-=G}function L(O,F,k,U){var G=F.length;if(!O.onBand||k||!G)return;var j=O.getExtent(),q,J;if(G===1)F[0].coord=j[0],q=F[1]={coord:j[0]};else{var X=F[G-1].tickValue-F[0].tickValue,Y=(F[G-1].coord-F[0].coord)/X;v(F,function(ie){ie.coord-=Y/2});var Q=O.scale.getExtent();J=1+Q[1]-F[G-1].tickValue,q={coord:F[G-1].coord+Y*J},F.push(q)}var ee=j[0]>j[1];z(F[0].coord,j[0])&&(U?F[0].coord=j[0]:F.shift()),U&&z(j[0],F[0].coord)&&F.unshift({coord:j[0]}),z(j[1],q.coord)&&(U?q.coord=j[1]:F.pop()),U&&z(q.coord,j[1])&&F.push({coord:j[1]});function z(ie,re){return ie=A(ie),re=A(re),ee?ie>re:ie{var f=bie();o.zrender=f;var m=Ky();o.matrix=m;var v=lf();o.vector=v;var y=Wi(),x=k2();o.color=x;var C=xa(),w=il();o.number=w;var A=fd();o.format=A;var E=X3(),T=E.throttle;o.throttle=E.throttle;var S=tvt();o.helper=S;var M=tGe();o.parseGeoJSON=M;var I=Yw();o.List=I;var P=Sm();o.Model=P;var D=K3();o.Axis=D;var L=Tm();o.env=L;var R=M,O={};y.each(["map","each","filter","indexOf","inherits","reduce","filter","bind","curry","isArray","isString","isObject","isFunction","extend","defaults","clone","merge"],function(k){O[k]=y[k]});var F={};y.each(["extendShape","extendPath","makePath","makeImage","mergePath","resizePath","createIcon","setHoverStyle","setLabelStyle","setTextStyle","setText","getFont","updateProps","initProps","getTransform","clipPointsByRect","clipRectByRect","registerShape","getShapeClass","Group","Image","Text","Circle","Sector","Ring","Polygon","Polyline","Rect","Line","BezierCurve","Arc","IncrementalDisplayable","CompoundPath","LinearGradient","RadialGradient","BoundingRect"],function(k){F[k]=C[k]}),o.parseGeoJson=R,o.util=O,o.graphic=F}),fo=xt(o=>{var f=Ac(),m=f.__DEV__,v=bie(),y=Wi(),x=k2(),C=Tm(),w=f0e(),A=iB(),E=W8e(),T=j8e(),S=aT(),M=H_t(),I=G_t(),P=W_t(),D=Xg(),L=Jg(),R=Aie(),O=V2(),F=xa(),k=vu(),U=X3(),G=U.throttle,j=j_t(),q=Y_t(),J=q_t(),X=X_t(),Y=J_t(),Q=K_t();Y8e();var ee=b0e(),z=y.assert,ie=y.each,re=y.isFunction,ne=y.isObject,oe=D.parseClassType,se="4.8.0",ae={zrender:"4.3.1"},fe=1,de=1e3,ve=800,pe=900,ce=5e3,he=1e3,Ce=1100,Se=2e3,De=3e3,Oe=3500,Ue=4e3,Xe=5e3,it={PROCESSOR:{FILTER:de,SERIES_FILTER:ve,STATISTIC:ce},VISUAL:{LAYOUT:he,PROGRESSIVE_LAYOUT:Ce,GLOBAL:Se,CHART:De,POST_CHART_LAYOUT:Oe,COMPONENT:Ue,BRUSH:Xe}},ut="__flagInMainProcess",at="__optionUpdated",Pt=/^[a-zA-Z0-9_]+$/;function Qe(Ct,Mi){return function($i,ur,Nr){if(!Mi&&this._disposed){this.id;return}$i=$i&&$i.toLowerCase(),A.prototype[Ct].call(this,$i,ur,Nr)}}function ft(){A.call(this)}ft.prototype.on=Qe("on",!0),ft.prototype.off=Qe("off",!0),ft.prototype.one=Qe("one",!0),y.mixin(ft,A);function Ot(Ct,qe,$i){$i=$i||{},typeof qe=="string"&&(qe=Ht[qe]),this.id,this.group,this._dom=Ct;var ur="canvas",Nr=this._zr=v.init(Ct,{renderer:$i.renderer||ur,devicePixelRatio:$i.devicePixelRatio,width:$i.width,height:$i.height});this._throttledZrFlush=G(y.bind(Nr.flush,Nr),17);var qe=y.clone(qe);qe&&I(qe,!0),this._theme=qe,this._chartsViews=[],this._chartsMap={},this._componentsViews=[],this._componentsMap={},this._coordSysMgr=new S;var tt=this._api=wr(this);function $e(St,Zt){return St.__prio-Zt.__prio}w(Pe,$e),w($t,$e),this._scheduler=new X(this,tt,$t,Pe),A.call(this,this._ecEventProcessor=new zi),this._messageCenter=new ft,this._initEvents(),this.resize=y.bind(this.resize,this),this._pendingActions=[],Nr.animation.on("frame",this._onframe,this),ei(Nr,this),y.setAsPrimitive(this)}var Xt=Ot.prototype;Xt._onframe=function(){if(!this._disposed){var Ct=this._scheduler;if(this[at]){var Mi=this[at].silent;this[ut]=!0,gt(this),bt.update.call(this),this[ut]=!1,this[at]=!1,Yi.call(this,Mi),ii.call(this,Mi)}else if(Ct.unfinished){var $i=fe,ur=this._model,Nr=this._api;Ct.unfinished=!1;do{var qe=+new Date;Ct.performSeriesTasks(ur),Ct.performDataProcessorTasks(ur),Jt(this,ur),Ct.performVisualTasks(ur),ai(this,this._model,Nr,"remain"),$i-=+new Date-qe}while($i>0&&Ct.unfinished);Ct.unfinished||this._zr.flush()}}},Xt.getDom=function(){return this._dom},Xt.getZr=function(){return this._zr},Xt.setOption=function(Ct,Mi,$i){if(this._disposed){this.id;return}var ur;if(ne(Mi)&&($i=Mi.lazyUpdate,ur=Mi.silent,Mi=Mi.notMerge),this[ut]=!0,!this._model||Mi){var Nr=new M(this._api),qe=this._theme,tt=this._model=new E;tt.scheduler=this._scheduler,tt.init(null,null,qe,Nr)}this._model.setOption(Ct,jt),$i?(this[at]={silent:ur},this[ut]=!1):(gt(this),bt.update.call(this),this._zr.flush(),this[at]=!1,this[ut]=!1,Yi.call(this,ur),ii.call(this,ur))},Xt.setTheme=function(){console.error("ECharts#setTheme() is DEPRECATED in ECharts 3.0")},Xt.getModel=function(){return this._model},Xt.getOption=function(){return this._model&&this._model.getOption()},Xt.getWidth=function(){return this._zr.getWidth()},Xt.getHeight=function(){return this._zr.getHeight()},Xt.getDevicePixelRatio=function(){return this._zr.painter.dpr||window.devicePixelRatio||1},Xt.getRenderedCanvas=function(Ct){if(C.canvasSupported){Ct=Ct||{},Ct.pixelRatio=Ct.pixelRatio||1,Ct.backgroundColor=Ct.backgroundColor||this._model.get("backgroundColor");var Mi=this._zr;return Mi.painter.getRenderedCanvas(Ct)}},Xt.getSvgDataURL=function(){if(C.svgSupported){var Ct=this._zr,Mi=Ct.storage.getDisplayList();return y.each(Mi,function($i){$i.stopAnimation(!0)}),Ct.painter.toDataURL()}},Xt.getDataURL=function(Ct){if(this._disposed){this.id;return}Ct=Ct||{};var Mi=Ct.excludeComponents,$i=this._model,ur=[],Nr=this;ie(Mi,function(tt){$i.eachComponent({mainType:tt},function($e){var St=Nr._componentsMap[$e.__viewId];St.group.ignore||(ur.push(St),St.group.ignore=!0)})});var qe=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.getRenderedCanvas(Ct).toDataURL("image/"+(Ct&&Ct.type||"png"));return ie(ur,function(tt){tt.group.ignore=!1}),qe},Xt.getConnectedDataURL=function(Ct){if(this._disposed){this.id;return}if(C.canvasSupported){var Mi=Ct.type==="svg",$i=this.group,ur=Math.min,Nr=Math.max,qe=1/0;if(Yt[$i]){var tt=qe,$e=qe,St=-qe,Zt=-qe,ui=[],hr=Ct&&Ct.pixelRatio||1;y.each(_t,function(Pa,Gn){if(Pa.group===$i){var Ja=Mi?Pa.getZr().painter.getSvgDom().innerHTML:Pa.getRenderedCanvas(y.clone(Ct)),fl=Pa.getDom().getBoundingClientRect();tt=ur(fl.left,tt),$e=ur(fl.top,$e),St=Nr(fl.right,St),Zt=Nr(fl.bottom,Zt),ui.push({dom:Ja,left:fl.left,top:fl.top})}}),tt*=hr,$e*=hr,St*=hr,Zt*=hr;var Yr=St-tt,ln=Zt-$e,Kn=y.createCanvas(),Un=v.init(Kn,{renderer:Mi?"svg":"canvas"});if(Un.resize({width:Yr,height:ln}),Mi){var Qn="";return ie(ui,function(Pa){var Gn=Pa.left-tt,Ja=Pa.top-$e;Qn+=''+Pa.dom+""}),Un.painter.getSvgRoot().innerHTML=Qn,Ct.connectedBackgroundColor&&Un.painter.setBackgroundColor(Ct.connectedBackgroundColor),Un.refreshImmediately(),Un.painter.toDataURL()}else return Ct.connectedBackgroundColor&&Un.add(new F.Rect({shape:{x:0,y:0,width:Yr,height:ln},style:{fill:Ct.connectedBackgroundColor}})),ie(ui,function(Pa){var Gn=new F.Image({style:{x:Pa.left*hr-tt,y:Pa.top*hr-$e,image:Pa.dom}});Un.add(Gn)}),Un.refreshImmediately(),Kn.toDataURL("image/"+(Ct&&Ct.type||"png"))}else return this.getDataURL(Ct)}},Xt.convertToPixel=y.curry(At,"convertToPixel"),Xt.convertFromPixel=y.curry(At,"convertFromPixel");function At(Ct,Mi,$i){if(this._disposed){this.id;return}var ur=this._model,Nr=this._coordSysMgr.getCoordinateSystems(),qe;Mi=k.parseFinder(ur,Mi);for(var tt=0;tt=0&&y.each(Nr,function(tt){var $e=tt.coordinateSystem;if($e&&$e.containPoint)ur|=!!$e.containPoint(Mi);else if(qe==="seriesModels"){var St=this._chartsMap[tt.__viewId];St&&St.containPoint&&(ur|=St.containPoint(Mi,tt))}},this)},this),!!ur},Xt.getVisual=function(Ct,Mi){var $i=this._model;Ct=k.parseFinder($i,Ct,{defaultMainType:"series"});var ur=Ct.seriesModel,Nr=ur.getData(),qe=Ct.hasOwnProperty("dataIndexInside")?Ct.dataIndexInside:Ct.hasOwnProperty("dataIndex")?Nr.indexOfRawIndex(Ct.dataIndex):null;return qe!=null?Nr.getItemVisual(qe,Mi):Nr.getVisual(Mi)},Xt.getViewOfComponentModel=function(Ct){return this._componentsMap[Ct.__viewId]},Xt.getViewOfSeriesModel=function(Ct){return this._chartsMap[Ct.__viewId]};var bt={prepareAndUpdate:function(Ct){gt(this),bt.update.call(this,Ct)},update:function(Ct){var Mi=this._model,$i=this._api,ur=this._zr,Nr=this._coordSysMgr,qe=this._scheduler;if(Mi){qe.restoreData(Mi,Ct),qe.performSeriesTasks(Mi),Nr.create(Mi,$i),qe.performDataProcessorTasks(Mi,Ct),Jt(this,Mi),Nr.update(Mi,$i),Je(Mi),qe.performVisualTasks(Mi,Ct),Nt(this,Mi,$i,Ct);var tt=Mi.get("backgroundColor")||"transparent";if(C.canvasSupported)ur.setBackgroundColor(tt);else{var $e=x.parse(tt);tt=x.stringify($e,"rgb"),$e[3]===0&&(tt="transparent")}wi(Mi,$i)}},updateTransform:function(Ct){var Mi=this._model,$i=this,ur=this._api;if(Mi){var Nr=[];Mi.eachComponent(function(tt,$e){var St=$i.getViewOfComponentModel($e);if(St&&St.__alive)if(St.updateTransform){var Zt=St.updateTransform($e,Mi,ur,Ct);Zt&&Zt.update&&Nr.push(St)}else Nr.push(St)});var qe=y.createHashMap();Mi.eachSeries(function(tt){var $e=$i._chartsMap[tt.__viewId];if($e.updateTransform){var St=$e.updateTransform(tt,Mi,ur,Ct);St&&St.update&&qe.set(tt.uid,1)}else qe.set(tt.uid,1)}),Je(Mi),this._scheduler.performVisualTasks(Mi,Ct,{setDirty:!0,dirtyMap:qe}),ai($i,Mi,ur,Ct,qe),wi(Mi,this._api)}},updateView:function(Ct){var Mi=this._model;Mi&&(O.markUpdateMethod(Ct,"updateView"),Je(Mi),this._scheduler.performVisualTasks(Mi,Ct,{setDirty:!0}),Nt(this,this._model,this._api,Ct),wi(Mi,this._api))},updateVisual:function(Ct){bt.update.call(this,Ct)},updateLayout:function(Ct){bt.update.call(this,Ct)}};function gt(Ct){var Mi=Ct._model,$i=Ct._scheduler;$i.restorePipelines(Mi),$i.prepareStageTasks(),Li(Ct,"component",Mi,$i),Li(Ct,"chart",Mi,$i),$i.plan()}function It(Ct,Mi,$i,ur,Nr){var qe=Ct._model;if(!ur){ie(Ct._componentsViews.concat(Ct._chartsViews),Zt);return}var tt={};tt[ur+"Id"]=$i[ur+"Id"],tt[ur+"Index"]=$i[ur+"Index"],tt[ur+"Name"]=$i[ur+"Name"];var $e={mainType:ur,query:tt};Nr&&($e.subType=Nr);var St=$i.excludeSeriesId;St!=null&&(St=y.createHashMap(k.normalizeToArray(St))),qe&&qe.eachComponent($e,function(ui){(!St||St.get(ui.id)==null)&&Zt(Ct[ur==="series"?"_chartsMap":"_componentsMap"][ui.__viewId])},Ct);function Zt(ui){ui&&ui.__alive&&ui[Mi]&&ui[Mi](ui.__model,qe,Ct._api,$i)}}Xt.resize=function(Ct){if(this._disposed){this.id;return}this._zr.resize(Ct);var Mi=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!Mi){var $i=Mi.resetOption("media"),ur=Ct&&Ct.silent;this[ut]=!0,$i&>(this),bt.update.call(this),this[ut]=!1,Yi.call(this,ur),ii.call(this,ur)}};function Jt(Ct,Mi){var $i=Ct._chartsMap,ur=Ct._scheduler;Mi.eachSeries(function(Nr){ur.updateStreamModes(Nr,$i[Nr.__viewId])})}Xt.showLoading=function(Ct,Mi){if(this._disposed){this.id;return}if(ne(Ct)&&(Mi=Ct,Ct=""),Ct=Ct||"default",this.hideLoading(),!!si[Ct]){var $i=si[Ct](this._api,Mi),ur=this._zr;this._loadingFX=$i,ur.add($i)}},Xt.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},Xt.makeActionFromEvent=function(Ct){var Mi=y.extend({},Ct);return Mi.type=Gt[Ct.type],Mi},Xt.dispatchAction=function(Ct,Mi){if(this._disposed){this.id;return}if(ne(Mi)||(Mi={silent:!!Mi}),!!Ui[Ct.type]&&this._model){if(this[ut]){this._pendingActions.push(Ct);return}bi.call(this,Ct,Mi.silent),Mi.flush?this._zr.flush(!0):Mi.flush!==!1&&C.browser.weChat&&this._throttledZrFlush(),Yi.call(this,Mi.silent),ii.call(this,Mi.silent)}};function bi(Ct,Mi){var $i=Ct.type,ur=Ct.escapeConnect,Nr=Ui[$i],qe=Nr.actionInfo,tt=(qe.update||"update").split(":"),$e=tt.pop();tt=tt[0]!=null&&oe(tt[0]),this[ut]=!0;var St=[Ct],Zt=!1;Ct.batch&&(Zt=!0,St=y.map(Ct.batch,function(ln){return ln=y.defaults(y.extend({},ln),Ct),ln.batch=null,ln}));var ui=[],hr,Yr=$i==="highlight"||$i==="downplay";ie(St,function(ln){hr=Nr.action(ln,this._model,this._api),hr=hr||y.extend({},ln),hr.type=qe.event||hr.type,ui.push(hr),Yr?It(this,$e,ln,"series"):tt&&It(this,$e,ln,tt.main,tt.sub)},this),$e!=="none"&&!Yr&&!tt&&(this[at]?(gt(this),bt.update.call(this,Ct),this[at]=!1):bt[$e].call(this,Ct)),Zt?hr={type:qe.event||$i,escapeConnect:ur,batch:ui}:hr=ui[0],this[ut]=!1,!Mi&&this._messageCenter.trigger(hr.type,hr)}function Yi(Ct){for(var Mi=this._pendingActions;Mi.length;){var $i=Mi.shift();bi.call(this,$i,Ct)}}function ii(Ct){!Ct&&this.trigger("updated")}function ei(Ct,Mi){Ct.on("rendered",function(){Mi.trigger("rendered"),Ct.animation.isFinished()&&!Mi[at]&&!Mi._scheduler.unfinished&&!Mi._pendingActions.length&&Mi.trigger("finished")})}Xt.appendData=function(Ct){if(this._disposed){this.id;return}var Mi=Ct.seriesIndex,$i=this.getModel(),ur=$i.getSeriesByIndex(Mi);ur.appendData(Ct),this._scheduler.unfinished=!0},Xt.on=Qe("on",!1),Xt.off=Qe("off",!1),Xt.one=Qe("one",!1);function Li(Ct,Mi,$i,ur){for(var Nr=Mi==="component",qe=Nr?Ct._componentsViews:Ct._chartsViews,tt=Nr?Ct._componentsMap:Ct._chartsMap,$e=Ct._zr,St=Ct._api,Zt=0;ZtMi.get("hoverLayerThreshold")&&!C.node&&Mi.eachSeries(function(qe){if(!qe.preventUsingHoverLayer){var tt=Ct._chartsMap[qe.__viewId];tt.__alive&&tt.group.traverse(function($e){$e.useHoverLayer=!0})}})}function Ri(Ct,Mi){var $i=Ct.get("blendMode")||null;Mi.group.traverse(function(ur){ur.isGroup||ur.style.blend!==$i&&ur.setStyle("blend",$i),ur.eachPendingDisplayable&&ur.eachPendingDisplayable(function(Nr){Nr.setStyle("blend",$i)})})}function pt(Ct,Mi){var $i=Ct.get("z"),ur=Ct.get("zlevel");Mi.group.traverse(function(Nr){Nr.type!=="group"&&($i!=null&&(Nr.z=$i),ur!=null&&(Nr.zlevel=ur))})}function wr(Ct){var Mi=Ct._coordSysMgr;return y.extend(new T(Ct),{getCoordinateSystems:y.bind(Mi.getCoordinateSystems,Mi),getComponentByElement:function($i){for(;$i;){var ur=$i.__ecComponentInfo;if(ur!=null)return Ct._model.getComponent(ur.mainType,ur.index);$i=$i.parent}}})}function zi(){this.eventInfo}zi.prototype={constructor:zi,normalizeQuery:function(Ct){var Mi={},$i={},ur={};if(y.isString(Ct)){var Nr=oe(Ct);Mi.mainType=Nr.main||null,Mi.subType=Nr.sub||null}else{var qe=["Index","Name","Id"],tt={name:1,dataIndex:1,dataType:1};y.each(Ct,function($e,St){for(var Zt=!1,ui=0;ui0&&Yr===St.length-hr.length){var ln=St.slice(0,Yr);ln!=="data"&&(Mi.mainType=ln,Mi[hr.toLowerCase()]=$e,Zt=!0)}}tt.hasOwnProperty(St)&&($i[St]=$e,Zt=!0),Zt||(ur[St]=$e)})}return{cptQuery:Mi,dataQuery:$i,otherQuery:ur}},filter:function(Ct,Mi,$i){var ur=this.eventInfo;if(!ur)return!0;var Nr=ur.targetEl,qe=ur.packedEvent,tt=ur.model,$e=ur.view;if(!tt||!$e)return!0;var St=Mi.cptQuery,Zt=Mi.dataQuery;return ui(St,tt,"mainType")&&ui(St,tt,"subType")&&ui(St,tt,"index","componentIndex")&&ui(St,tt,"name")&&ui(St,tt,"id")&&ui(Zt,qe,"name")&&ui(Zt,qe,"dataIndex")&&ui(Zt,qe,"dataType")&&(!$e.filterForExposedEvent||$e.filterForExposedEvent(Ct,Mi.otherQuery,Nr,qe));function ui(hr,Yr,ln,Kn){return hr[ln]==null||Yr[Kn||ln]===hr[ln]}},afterTrigger:function(){this.eventInfo=null}};var Ui={},Gt={},$t=[],jt=[],ct=[],Pe=[],Ht={},si={},_t={},Yt={},Fi=new Date-0,Dt=new Date-0,Lt="_echarts_instance_";function Si(Ct){var Mi=0,$i=1,ur=2,Nr="__connectUpdateStatus";function qe(tt,$e){for(var St=0;St{var m=Ac(),v=m.__DEV__,y=zM(),x=Jg(),C=x.extend({type:"series.line",dependencies:["grid","polar"],getInitialData:function(w,A){return y(this.getSource(),this,{useEncodeDefaulter:!0})},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,clip:!0,label:{position:"top"},lineStyle:{width:2,type:"solid"},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0}});f.exports=C}),w0e=xt(o=>{var f=oB(),m=f.retrieveRawValue;function v(y,x){var C=y.mapDimension("defaultedLabel",!0),w=C.length;if(w===1)return m(y,x,C[0]);if(w){for(var A=[],E=0;E{var m=Wi(),v=qw(),y=v.createSymbol,x=xa(),C=il(),w=C.parsePercent,A=w0e(),E=A.getDefaultLabel;function T(U,G,j){x.Group.call(this),this.updateData(U,G,j)}var S=T.prototype,M=T.getSymbolSize=function(U,G){var j=U.getItemVisual(G,"symbolSize");return j instanceof Array?j.slice():[+j,+j]};function I(U){return[U[0]/2,U[1]/2]}function P(U,G){this.parent.drift(U,G)}S._createSymbol=function(U,G,j,q,J){this.removeAll();var X=G.getItemVisual(j,"color"),Y=y(U,-1,-1,2,2,X,J);Y.attr({z2:100,culling:!0,scale:I(q)}),Y.drift=P,this._symbolType=U,this.add(Y)},S.stopSymbolAnimation=function(U){this.childAt(0).stopAnimation(U)},S.getSymbolPath=function(){return this.childAt(0)},S.getScale=function(){return this.childAt(0).scale},S.highlight=function(){this.childAt(0).trigger("emphasis")},S.downplay=function(){this.childAt(0).trigger("normal")},S.setZ=function(U,G){var j=this.childAt(0);j.zlevel=U,j.z=G},S.setDraggable=function(U){var G=this.childAt(0);G.draggable=U,G.cursor=U?"move":G.cursor},S.updateData=function(U,G,j){this.silent=!1;var q=U.getItemVisual(G,"symbol")||"circle",J=U.hostModel,X=M(U,G),Y=q!==this._symbolType;if(Y){var Q=U.getItemVisual(G,"symbolKeepAspect");this._createSymbol(q,U,G,X,Q)}else{var ee=this.childAt(0);ee.silent=!1,x.updateProps(ee,{scale:I(X)},J,G)}if(this._updateCommon(U,G,X,j),Y){var ee=this.childAt(0),z=j&&j.fadeIn,ie={scale:ee.scale.slice()};z&&(ie.style={opacity:ee.style.opacity}),ee.scale=[0,0],z&&(ee.style.opacity=0),x.initProps(ee,ie,J,G)}this._seriesModel=J};var D=["itemStyle"],L=["emphasis","itemStyle"],R=["label"],O=["emphasis","label"];S._updateCommon=function(U,G,j,q){var J=this.childAt(0),X=U.hostModel,Y=U.getItemVisual(G,"color");J.type!=="image"?J.useStyle({strokeNoScale:!0}):J.setStyle({opacity:null,shadowBlur:null,shadowOffsetX:null,shadowOffsetY:null,shadowColor:null});var Q=q&&q.itemStyle,ee=q&&q.hoverItemStyle,z=q&&q.symbolOffset,ie=q&&q.labelModel,re=q&&q.hoverLabelModel,ne=q&&q.hoverAnimation,oe=q&&q.cursorStyle;if(!q||U.hasItemOption){var se=q&&q.itemModel?q.itemModel:U.getItemModel(G);Q=se.getModel(D).getItemStyle(["color"]),ee=se.getModel(L).getItemStyle(),z=se.getShallow("symbolOffset"),ie=se.getModel(R),re=se.getModel(O),ne=se.getShallow("hoverAnimation"),oe=se.getShallow("cursor")}else ee=m.extend({},ee);var ae=J.style,fe=U.getItemVisual(G,"symbolRotate");J.attr("rotation",(fe||0)*Math.PI/180||0),z&&J.attr("position",[w(z[0],j[0]),w(z[1],j[1])]),oe&&J.attr("cursor",oe),J.setColor(Y,q&&q.symbolInnerColor),J.setStyle(Q);var de=U.getItemVisual(G,"opacity");de!=null&&(ae.opacity=de);var ve=U.getItemVisual(G,"liftZ"),pe=J.__z2Origin;ve!=null?pe==null&&(J.__z2Origin=J.z2,J.z2+=ve):pe!=null&&(J.z2=pe,J.__z2Origin=null);var ce=q&&q.useNameLabel;x.setLabelStyle(ae,ee,ie,re,{labelFetcher:X,labelDataIndex:G,defaultText:he,isRectText:!0,autoColor:Y});function he(Ce,Se){return ce?U.getName(Ce):E(U,Ce)}J.__symbolOriginalScale=I(j),J.hoverStyle=ee,J.highDownOnUpdate=ne&&X.isAnimationEnabled()?F:null,x.setHoverStyle(J)};function F(U,G){if(!(this.incremental||this.useHoverLayer))if(G==="emphasis"){var j=this.__symbolOriginalScale,q=j[1]/j[0],J={scale:[Math.max(j[0]*1.1,j[0]+3),Math.max(j[1]*1.1,j[1]+3*q)]};this.animateTo(J,400,"elasticOut")}else G==="normal"&&this.animateTo({scale:this.__symbolOriginalScale},400,"elasticOut")}S.fadeOut=function(U,G){var j=this.childAt(0);this.silent=j.silent=!0,!(G&&G.keepLabel)&&(j.style.text=null),x.updateProps(j,{style:{opacity:0},scale:[0,0]},this._seriesModel,this.dataIndex,U)},m.inherits(T,x.Group);var k=T;f.exports=k}),Wj=xt((o,f)=>{var m=xa(),v=Pie(),y=Wi(),x=y.isObject;function C(M){this.group=new m.Group,this._symbolCtor=M||v}var w=C.prototype;function A(M,I,P,D){return I&&!isNaN(I[0])&&!isNaN(I[1])&&!(D.isIgnore&&D.isIgnore(P))&&!(D.clipShape&&!D.clipShape.contain(I[0],I[1]))&&M.getItemVisual(P,"symbol")!=="none"}w.updateData=function(M,I){I=E(I);var P=this.group,D=M.hostModel,L=this._data,R=this._symbolCtor,O=T(M);L||P.removeAll(),M.diff(L).add(function(F){var k=M.getItemLayout(F);if(A(M,k,F,I)){var U=new R(M,F,O);U.attr("position",k),M.setItemGraphicEl(F,U),P.add(U)}}).update(function(F,k){var U=L.getItemGraphicEl(k),G=M.getItemLayout(F);if(!A(M,G,F,I)){P.remove(U);return}U?(U.updateData(M,F,O),m.updateProps(U,{position:G},D)):(U=new R(M,F),U.attr("position",G)),P.add(U),M.setItemGraphicEl(F,U)}).remove(function(F){var k=L.getItemGraphicEl(F);k&&k.fadeOut(function(){P.remove(k)})}).execute(),this._data=M},w.isPersistent=function(){return!0},w.updateLayout=function(){var M=this._data;M&&M.eachItemGraphicEl(function(I,P){var D=M.getItemLayout(P);I.attr("position",D)})},w.incrementalPrepareUpdate=function(M){this._seriesScope=T(M),this._data=null,this.group.removeAll()},w.incrementalUpdate=function(M,I,P){P=E(P);function D(F){F.isGroup||(F.incremental=F.useHoverLayer=!0)}for(var L=M.start;L{var f=z2(),m=f.isDimensionStacked,v=Wi(),y=v.map;function x(A,E,T){var S=A.getBaseAxis(),M=A.getOtherAxis(S),I=C(M,T),P=S.dim,D=M.dim,L=E.mapDimension(D),R=E.mapDimension(P),O=D==="x"||D==="radius"?1:0,F=y(A.dimensions,function(G){return E.mapDimension(G)}),k,U=E.getCalculationInfo("stackResultDimension");return(k|=m(E,F[0]))&&(F[0]=U),(k|=m(E,F[1]))&&(F[1]=U),{dataDimsForPoint:F,valueStart:I,valueAxisDim:D,baseAxisDim:P,stacked:!!k,valueDim:L,baseDim:R,baseDataOffset:O,stackedOverDimension:E.getCalculationInfo("stackedOverDimension")}}function C(A,E){var T=0,S=A.scale.getExtent();return E==="start"?T=S[0]:E==="end"?T=S[1]:S[0]>0?T=S[0]:S[1]<0&&(T=S[1]),T}function w(A,E,T,S){var M=NaN;A.stacked&&(M=T.get(T.getCalculationInfo("stackedOverDimension"),S)),isNaN(M)&&(M=A.valueStart);var I=A.baseDataOffset,P=[];return P[I]=T.get(A.baseDim,S),P[1-I]=M,E.dataToPoint(P)}o.prepareDataCoordInfo=x,o.getStackedOnPoint=w}),nvt=xt((o,f)=>{var m=rGe(),v=m.prepareDataCoordInfo,y=m.getStackedOnPoint;function x(w,A){var E=[];return A.diff(w).add(function(T){E.push({cmd:"+",idx:T})}).update(function(T,S){E.push({cmd:"=",idx:S,idx1:T})}).remove(function(T){E.push({cmd:"-",idx:T})}).execute(),E}function C(w,A,E,T,S,M,I,P){for(var D=x(w,A),L=[],R=[],O=[],F=[],k=[],U=[],G=[],j=v(S,A,I),q=v(M,w,P),J=0;J{var f=am(),m=lf(),v=k8e(),y=m.min,x=m.max,C=m.scaleAndAdd,w=m.copy,A=[],E=[],T=[];function S(O){return isNaN(O[0])||isNaN(O[1])}function M(O,F,k,U,G,j,q,J,X,Y,Q){return Y==="none"||!Y?P.apply(this,arguments):I.apply(this,arguments)}function I(O,F,k,U,G,j,q,J,X,Y,Q){for(var ee=0,z=k,ie=0;ie=G||z<0)break;if(S(re)){if(Q){z+=j;continue}break}if(z===k)O[j>0?"moveTo":"lineTo"](re[0],re[1]);else if(X>0){var ne=F[ee],oe=Y==="y"?1:0,se=(re[oe]-ne[oe])*X;w(E,ne),E[oe]=ne[oe]+se,w(T,re),T[oe]=re[oe]-se,O.bezierCurveTo(E[0],E[1],T[0],T[1],re[0],re[1])}else O.lineTo(re[0],re[1]);ee=z,z+=j}return ie}function P(O,F,k,U,G,j,q,J,X,Y,Q){for(var ee=0,z=k,ie=0;ie=G||z<0)break;if(S(re)){if(Q){z+=j;continue}break}if(z===k)O[j>0?"moveTo":"lineTo"](re[0],re[1]),w(E,re);else if(X>0){var ne=z+j,ae=F[ne];if(Q)for(;ae&&S(F[ne]);)ne+=j,ae=F[ne];var oe=.5,se=F[ee],ae=F[ne];if(!ae||S(ae))w(T,re);else{S(ae)&&!Q&&(ae=re),m.sub(A,ae,se);var fe,de;if(Y==="x"||Y==="y"){var ve=Y==="x"?0:1;fe=Math.abs(re[ve]-se[ve]),de=Math.abs(re[ve]-ae[ve])}else fe=m.dist(re,se),de=m.dist(re,ae);oe=de/(de+fe),C(T,re,A,-X*(1-oe))}y(E,E,J),x(E,E,q),y(T,T,J),x(T,T,q),O.bezierCurveTo(E[0],E[1],T[0],T[1],re[0],re[1]),C(E,re,A,X*oe)}else O.lineTo(re[0],re[1]);ee=z,z+=j}return ie}function D(O,F){var k=[1/0,1/0],U=[-1/0,-1/0];if(F)for(var G=0;GU[0]&&(U[0]=j[0]),j[1]>U[1]&&(U[1]=j[1])}return{min:F?k:U,max:F?U:k}}var L=f.extend({type:"ec-polyline",shape:{points:[],smooth:0,smoothConstraint:!0,smoothMonotone:null,connectNulls:!1},style:{fill:null,stroke:"#000"},brush:v(f.prototype.brush),buildPath:function(O,F){var k=F.points,U=0,G=k.length,j=D(k,F.smoothConstraint);if(F.connectNulls){for(;G>0&&S(k[G-1]);G--);for(;U0&&S(k[j-1]);j--);for(;G{var f=xa(),m=il(),v=m.round;function y(w,A,E){var T=w.getArea(),S=w.getBaseAxis().isHorizontal(),M=T.x,I=T.y,P=T.width,D=T.height,L=E.get("lineStyle.width")||2;M-=L/2,I-=L/2,P+=L,D+=L,M=Math.floor(M),P=Math.round(P);var R=new f.Rect({shape:{x:M,y:I,width:P,height:D}});return A&&(R.shape[S?"width":"height"]=0,f.initProps(R,{shape:{width:P,height:D}},E)),R}function x(w,A,E){var T=w.getArea(),S=new f.Sector({shape:{cx:v(w.cx,1),cy:v(w.cy,1),r0:v(T.r0,1),r:v(T.r,1),startAngle:T.startAngle,endAngle:T.endAngle,clockwise:T.clockwise}});return A&&(S.shape.endAngle=T.startAngle,f.initProps(S,{shape:{endAngle:T.endAngle}},E)),S}function C(w,A,E){if(w){if(w.type==="polar")return x(w,A,E);if(w.type==="cartesian2d")return y(w,A,E)}else return null;return null}o.createGridClipPath=y,o.createPolarClipPath=x,o.createClipPath=C}),ovt=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Wi(),x=Vj(),C=x.fromPoints,w=Wj(),A=Pie(),E=nvt(),T=xa(),S=vu(),M=nGe(),I=M.Polyline,P=M.Polygon,D=V2(),L=rGe(),R=L.prepareDataCoordInfo,O=L.getStackedOnPoint,F=jj(),k=F.createGridClipPath,U=F.createPolarClipPath;function G(re,ne){if(re.length===ne.length){for(var oe=0;oe=0;fe--){var de=oe[fe].dimension,ve=re.dimensions[de],pe=re.getDimensionInfo(ve);if(se=pe&&pe.coordDim,se==="x"||se==="y"){ae=oe[fe];break}}if(ae){var ce=ne.getAxis(se),he=y.map(ae.stops,function(ut){return{coord:ce.toGlobalCoord(ce.dataToCoord(ut.value)),color:ut.color}}),Ce=he.length,Se=ae.outerColors.slice();Ce&&he[0].coord>he[Ce-1].coord&&(he.reverse(),Se.reverse());var De=10,Oe=he[0].coord-De,Ue=he[Ce-1].coord+De,Xe=Ue-Oe;if(Xe<.001)return"transparent";y.each(he,function(ut){ut.offset=(ut.coord-Oe)/Xe}),he.push({offset:Ce?he[Ce-1].offset:.5,color:Se[1]||"transparent"}),he.unshift({offset:Ce?he[0].offset:.5,color:Se[0]||"transparent"});var it=new T.LinearGradient(0,0,0,0,he,!0);return it[se]=Oe,it[se+"2"]=Ue,it}}}function Q(re,ne,oe){var se=re.get("showAllSymbol"),ae=se==="auto";if(!(se&&!ae)){var fe=oe.getAxesByScale("ordinal")[0];if(fe&&!(ae&&ee(fe,ne))){var de=ne.mapDimension(fe.dim),ve={};return y.each(fe.getViewLabels(),function(pe){ve[pe.tickValue]=1}),function(pe){return!ve.hasOwnProperty(ne.get(de,pe))}}}}function ee(re,ne){var oe=re.getExtent(),se=Math.abs(oe[1]-oe[0])/re.scale.count();isNaN(se)&&(se=0);for(var ae=ne.count(),fe=Math.max(1,Math.round(ae/5)),de=0;dese)return!1;return!0}function z(re,ne,oe){if(re.type==="cartesian2d"){var se=re.getBaseAxis().isHorizontal(),ae=k(re,ne,oe);if(!oe.get("clip",!0)){var fe=ae.shape,de=Math.max(fe.width,fe.height);se?(fe.y-=de,fe.height+=de*2):(fe.x-=de,fe.width+=de*2)}return ae}else return U(re,ne,oe)}var ie=D.extend({type:"line",init:function(){var re=new T.Group,ne=new w;this.group.add(ne.group),this._symbolDraw=ne,this._lineGroup=re},render:function(re,ne,oe){var se=re.coordinateSystem,ae=this.group,fe=re.getData(),de=re.getModel("lineStyle"),ve=re.getModel("areaStyle"),pe=fe.mapArray(fe.getItemLayout),ce=se.type==="polar",he=this._coordSys,Ce=this._symbolDraw,Se=this._polyline,De=this._polygon,Oe=this._lineGroup,Ue=re.get("animation"),Xe=!ve.isEmpty(),it=ve.get("origin"),ut=R(se,fe,it),at=J(se,fe,ut),Pt=re.get("showSymbol"),Qe=Pt&&!ce&&Q(re,fe,se),ft=this._data;ft&&ft.eachItemGraphicEl(function(Jt,bi){Jt.__temp&&(ae.remove(Jt),ft.setItemGraphicEl(bi,null))}),Pt||Ce.remove(),ae.add(Oe);var Ot=!ce&&re.get("step"),Xt;se&&se.getArea&&re.get("clip",!0)&&(Xt=se.getArea(),Xt.width!=null?(Xt.x-=.1,Xt.y-=.1,Xt.width+=.2,Xt.height+=.2):Xt.r0&&(Xt.r0-=.5,Xt.r1+=.5)),this._clipShapeForSymbol=Xt,Se&&he.type===se.type&&Ot===this._step?(Xe&&!De?De=this._newPolygon(pe,at,se,Ue):De&&!Xe&&(Oe.remove(De),De=this._polygon=null),Oe.setClipPath(z(se,!1,re)),Pt&&Ce.updateData(fe,{isIgnore:Qe,clipShape:Xt}),fe.eachItemGraphicEl(function(Jt){Jt.stopAnimation(!0)}),(!G(this._stackedOnPoints,at)||!G(this._points,pe))&&(Ue?this._updateAnimation(fe,at,se,oe,Ot,it):(Ot&&(pe=X(pe,se,Ot),at=X(at,se,Ot)),Se.setShape({points:pe}),De&&De.setShape({points:pe,stackedOnPoints:at})))):(Pt&&Ce.updateData(fe,{isIgnore:Qe,clipShape:Xt}),Ot&&(pe=X(pe,se,Ot),at=X(at,se,Ot)),Se=this._newPolyline(pe,se,Ue),Xe&&(De=this._newPolygon(pe,at,se,Ue)),Oe.setClipPath(z(se,!0,re)));var At=Y(fe,se)||fe.getVisual("color");Se.useStyle(y.defaults(de.getLineStyle(),{fill:"none",stroke:At,lineJoin:"bevel"}));var bt=re.get("smooth");if(bt=q(re.get("smooth")),Se.setShape({smooth:bt,smoothMonotone:re.get("smoothMonotone"),connectNulls:re.get("connectNulls")}),De){var gt=fe.getCalculationInfo("stackedOnSeries"),It=0;De.useStyle(y.defaults(ve.getAreaStyle(),{fill:At,opacity:.7,lineJoin:"bevel"})),gt&&(It=q(gt.get("smooth"))),De.setShape({smooth:bt,stackedOnSmooth:It,smoothMonotone:re.get("smoothMonotone"),connectNulls:re.get("connectNulls")})}this._data=fe,this._coordSys=se,this._stackedOnPoints=at,this._points=pe,this._step=Ot,this._valueOrigin=it},dispose:function(){},highlight:function(re,ne,oe,se){var ae=re.getData(),fe=S.queryDataIndex(ae,se);if(!(fe instanceof Array)&&fe!=null&&fe>=0){var de=ae.getItemGraphicEl(fe);if(!de){var ve=ae.getItemLayout(fe);if(!ve||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(ve[0],ve[1]))return;de=new A(ae,fe),de.position=ve,de.setZ(re.get("zlevel"),re.get("z")),de.ignore=isNaN(ve[0])||isNaN(ve[1]),de.__temp=!0,ae.setItemGraphicEl(fe,de),de.stopSymbolAnimation(!0),this.group.add(de)}de.highlight()}else D.prototype.highlight.call(this,re,ne,oe,se)},downplay:function(re,ne,oe,se){var ae=re.getData(),fe=S.queryDataIndex(ae,se);if(fe!=null&&fe>=0){var de=ae.getItemGraphicEl(fe);de&&(de.__temp?(ae.setItemGraphicEl(fe,null),this.group.remove(de)):de.downplay())}else D.prototype.downplay.call(this,re,ne,oe,se)},_newPolyline:function(re){var ne=this._polyline;return ne&&this._lineGroup.remove(ne),ne=new I({shape:{points:re},silent:!0,z2:10}),this._lineGroup.add(ne),this._polyline=ne,ne},_newPolygon:function(re,ne){var oe=this._polygon;return oe&&this._lineGroup.remove(oe),oe=new P({shape:{points:re,stackedOnPoints:ne},silent:!0}),this._lineGroup.add(oe),this._polygon=oe,oe},_updateAnimation:function(re,ne,oe,se,ae,fe){var de=this._polyline,ve=this._polygon,pe=re.hostModel,ce=E(this._data,re,this._stackedOnPoints,ne,this._coordSys,oe,this._valueOrigin,fe),he=ce.current,Ce=ce.stackedOnCurrent,Se=ce.next,De=ce.stackedOnNext;if(ae&&(he=X(ce.current,oe,ae),Ce=X(ce.stackedOnCurrent,oe,ae),Se=X(ce.next,oe,ae),De=X(ce.stackedOnNext,oe,ae)),j(he,Se)>3e3||ve&&j(Ce,De)>3e3){de.setShape({points:Se}),ve&&ve.setShape({points:Se,stackedOnPoints:De});return}de.shape.__points=ce.current,de.shape.points=he,T.updateProps(de,{shape:{points:Se}},pe),ve&&(ve.setShape({points:he,stackedOnPoints:Ce}),T.updateProps(ve,{shape:{points:Se,stackedOnPoints:De}},pe));for(var Oe=[],Ue=ce.status,Xe=0;Xe{var m=Wi(),v=m.isFunction;function y(x,C,w){return{seriesType:x,performRawSeries:!0,reset:function(A,E,T){var S=A.getData(),M=A.get("symbol"),I=A.get("symbolSize"),P=A.get("symbolKeepAspect"),D=A.get("symbolRotate"),L=v(M),R=v(I),O=v(D),F=L||R||O,k=!L&&M?M:C,U=R?null:I,G=O?null:G;if(S.setVisual({legendSymbol:w||k,symbol:k,symbolSize:U,symbolKeepAspect:P,symbolRotate:D}),E.isSeriesFiltered(A))return;function j(q,J){if(F){var X=A.getRawValue(J),Y=A.getDataParams(J);L&&q.setItemVisual(J,"symbol",M(X,Y)),R&&q.setItemVisual(J,"symbolSize",I(X,Y)),O&&q.setItemVisual(J,"symbolRotate",D(X,Y))}if(q.hasItemOption){var Q=q.getItemModel(J),ee=Q.getShallow("symbol",!0),z=Q.getShallow("symbolSize",!0),ie=Q.getShallow("symbolRotate",!0),re=Q.getShallow("symbolKeepAspect",!0);ee!=null&&q.setItemVisual(J,"symbol",ee),z!=null&&q.setItemVisual(J,"symbolSize",z),ie!=null&&q.setItemVisual(J,"symbolRotate",ie),re!=null&&q.setItemVisual(J,"symbolKeepAspect",re)}}return{dataEach:S.hasItemOption||F?j:null}}}}f.exports=y}),Yj=xt((o,f)=>{var m=Wi(),v=m.map,y=aU(),x=z2(),C=x.isDimensionStacked;function w(A){return{seriesType:A,plan:y(),reset:function(E){var T=E.getData(),S=E.coordinateSystem,M=E.pipelineContext,I=M.large;if(!S)return;var P=v(S.dimensions,function(O){return T.mapDimension(O)}).slice(0,2),D=P.length,L=T.getCalculationInfo("stackResultDimension");C(T,P[0])&&(P[0]=L),C(T,P[1])&&(P[1]=L);function R(O,F){for(var k=O.end-O.start,U=I&&new Float32Array(k*D),G=O.start,j=0,q=[],J=[];G{var m={average:function(x){for(var C=0,w=0,A=0;AC&&(C=x[w]);return isFinite(C)?C:NaN},min:function(x){for(var C=1/0,w=0;w1){var R;typeof T=="string"?R=m[T]:typeof T=="function"&&(R=T),R&&C.setData(E.downSample(E.mapDimension(I.dim),1/L,R,v))}}}}}f.exports=y}),svt=xt((o,f)=>{var m=Wi();function v(C){return this._axes[C]}var y=function(C){this._axes={},this._dimList=[],this.name=C||""};y.prototype={constructor:y,type:"cartesian",getAxis:function(C){return this._axes[C]},getAxes:function(){return m.map(this._dimList,v,this)},getAxesByScale:function(C){return C=C.toLowerCase(),m.filter(this.getAxes(),function(w){return w.scale.type===C})},addAxis:function(C){var w=C.dim;this._axes[w]=C,this._dimList.push(w)},dataToCoord:function(C){return this._dataCoordConvert(C,"dataToCoord")},coordToData:function(C){return this._dataCoordConvert(C,"coordToData")},_dataCoordConvert:function(C,w){for(var A=this._dimList,E=C instanceof Array?[]:{},T=0;T{var m=Wi(),v=Of(),y=svt();function x(w){y.call(this,w)}x.prototype={constructor:x,type:"cartesian2d",dimensions:["x","y"],getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},containPoint:function(w){var A=this.getAxis("x"),E=this.getAxis("y");return A.contain(A.toLocalCoord(w[0]))&&E.contain(E.toLocalCoord(w[1]))},containData:function(w){return this.getAxis("x").containData(w[0])&&this.getAxis("y").containData(w[1])},dataToPoint:function(w,A,E){var T=this.getAxis("x"),S=this.getAxis("y");return E=E||[],E[0]=T.toGlobalCoord(T.dataToCoord(w[0])),E[1]=S.toGlobalCoord(S.dataToCoord(w[1])),E},clampData:function(w,A){var E=this.getAxis("x").scale,T=this.getAxis("y").scale,S=E.getExtent(),M=T.getExtent(),I=E.parse(w[0]),P=T.parse(w[1]);return A=A||[],A[0]=Math.min(Math.max(Math.min(S[0],S[1]),I),Math.max(S[0],S[1])),A[1]=Math.min(Math.max(Math.min(M[0],M[1]),P),Math.max(M[0],M[1])),A},pointToData:function(w,A){var E=this.getAxis("x"),T=this.getAxis("y");return A=A||[],A[0]=E.coordToData(E.toLocalCoord(w[0])),A[1]=T.coordToData(T.toLocalCoord(w[1])),A},getOtherAxis:function(w){return this.getAxis(w.dim==="x"?"y":"x")},getArea:function(){var w=this.getAxis("x").getGlobalExtent(),A=this.getAxis("y").getGlobalExtent(),E=Math.min(w[0],w[1]),T=Math.min(A[0],A[1]),S=Math.max(w[0],w[1])-E,M=Math.max(A[0],A[1])-T,I=new v(E,T,S,M);return I}},m.inherits(x,y);var C=x;f.exports=C}),uvt=xt((o,f)=>{var m=Wi(),v=K3(),y=function(C,w,A,E,T){v.call(this,C,w,A),this.type=E||"value",this.position=T||"bottom"};y.prototype={constructor:y,index:0,getAxesOnZeroOf:null,model:null,isHorizontal:function(){var C=this.position;return C==="top"||C==="bottom"},getGlobalExtent:function(C){var w=this.getExtent();return w[0]=this.toGlobalCoord(w[0]),w[1]=this.toGlobalCoord(w[1]),C&&w[0]>w[1]&&w.reverse(),w},getOtherAxis:function(){this.grid.getOtherAxis()},pointToData:function(C,w){return this.coordToData(this.toLocalCoord(C[this.dim==="x"?0:1]),w)},toLocalCoord:null,toGlobalCoord:null},m.inherits(y,v);var x=y;f.exports=x}),oGe=xt((o,f)=>{var m=Wi(),v={show:!0,zlevel:0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#333",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,lineStyle:{color:["#ccc"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.3)","rgba(200,200,200,0.3)"]}}},y={};y.categoryAxis=m.merge({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},v),y.valueAxis=m.merge({boundaryGap:[0,0],splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#eee",width:1}}},v),y.timeAxis=m.defaults({scale:!0,min:"dataMin",max:"dataMax"},y.valueAxis),y.logAxis=m.defaults({scale:!0,logBase:10},y.valueAxis);var x=y;f.exports=x}),Iie=xt((o,f)=>{var m=Wi(),v=oGe(),y=Xg(),x=rd(),C=x.getLayoutParams,w=x.mergeLayoutParam,A=K8e(),E=["value","category","time","log"];function T(S,M,I,P){m.each(E,function(D){M.extend({type:S+"Axis."+D,mergeDefaultAndTheme:function(L,R){var O=this.layoutMode,F=O?C(L):{},k=R.getTheme();m.merge(L,k.get(D+"Axis")),m.merge(L,this.getDefaultOption()),L.type=I(S,L),O&&w(L,F,O)},optionUpdated:function(){var L=this.option;L.type==="category"&&(this.__ordinalMeta=A.createByAxisModel(this))},getCategories:function(L){var R=this.option;if(R.type==="category")return L?R.data:this.__ordinalMeta.categories},getOrdinalMeta:function(){return this.__ordinalMeta},defaultOption:m.mergeAll([{},v[D+"Axis"],P],!0)})}),y.registerSubTypeDefaulter(S+"Axis",m.curry(I,S))}f.exports=T}),aGe=xt((o,f)=>{var m=Wi(),v=Xg(),y=Iie(),x=lU(),C=v.extend({type:"cartesian2dAxis",axis:null,init:function(){C.superApply(this,"init",arguments),this.resetRange()},mergeOption:function(){C.superApply(this,"mergeOption",arguments),this.resetRange()},restoreData:function(){C.superApply(this,"restoreData",arguments),this.resetRange()},getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"grid",index:this.option.gridIndex,id:this.option.gridId})[0]}});function w(T,S){return S.type||(S.data?"category":"value")}m.merge(C.prototype,x);var A={offset:0};y("x",C,w,A),y("y",C,w,A);var E=C;f.exports=E}),cvt=xt((o,f)=>{aGe();var m=Xg(),v=m.extend({type:"grid",dependencies:["xAxis","yAxis"],layoutMode:"box",coordinateSystem:null,defaultOption:{show:!1,zlevel:0,z:0,left:"10%",top:60,right:"10%",bottom:60,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"}});f.exports=v}),A0e=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Wi(),x=y.isObject,C=y.each,w=y.map,A=y.indexOf,E=y.retrieve,T=rd(),S=T.getLayoutRect,M=sT(),I=M.createScaleByModel,P=M.ifAxisCrossZero,D=M.niceScaleExtent,L=M.estimateLabelUnionRect,R=lvt(),O=uvt(),F=aT(),k=z2(),U=k.getStackedDimension;cvt();function G(re,ne,oe){return re.getCoordSysModel()===ne}function j(re,ne,oe){this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this._initCartesian(re,ne,oe),this.model=re}var q=j.prototype;q.type="grid",q.axisPointerEnabled=!0,q.getRect=function(){return this._rect},q.update=function(re,ne){var oe=this._axesMap;this._updateScale(re,this.model),C(oe.x,function(ae){D(ae.scale,ae.model)}),C(oe.y,function(ae){D(ae.scale,ae.model)});var se={};C(oe.x,function(ae){J(oe,"y",ae,se)}),C(oe.y,function(ae){J(oe,"x",ae,se)}),this.resize(this.model,ne)};function J(re,ne,oe,se){oe.getAxesOnZeroOf=function(){return fe?[fe]:[]};var ae=re[ne],fe,de=oe.model,ve=de.get("axisLine.onZero"),pe=de.get("axisLine.onZeroAxisIndex");if(!ve)return;if(pe!=null)X(ae[pe])&&(fe=ae[pe]);else for(var ce in ae)if(ae.hasOwnProperty(ce)&&X(ae[ce])&&!se[he(ae[ce])]){fe=ae[ce];break}fe&&(se[he(fe)]=!0);function he(Ce){return Ce.dim+"_"+Ce.index}}function X(re){return re&&re.type!=="category"&&re.type!=="time"&&P(re)}q.resize=function(re,ne,oe){var se=S(re.getBoxLayoutParams(),{width:ne.getWidth(),height:ne.getHeight()});this._rect=se;var ae=this._axesList;fe(),!oe&&re.get("containLabel")&&(C(ae,function(de){if(!de.model.get("axisLabel.inside")){var ve=L(de);if(ve){var pe=de.isHorizontal()?"height":"width",ce=de.model.get("axisLabel.margin");se[pe]-=ve[pe]+ce,de.position==="top"?se.y+=ve.height+ce:de.position==="left"&&(se.x+=ve.width+ce)}}}),fe());function fe(){C(ae,function(de){var ve=de.isHorizontal(),pe=ve?[0,se.width]:[0,se.height],ce=de.inverse?1:0;de.setExtent(pe[ce],pe[1-ce]),Y(de,ve?se.x:se.y)})}},q.getAxis=function(re,ne){var oe=this._axesMap[re];if(oe!=null){if(ne==null){for(var se in oe)if(oe.hasOwnProperty(se))return oe[se]}return oe[ne]}},q.getAxes=function(){return this._axesList.slice()},q.getCartesian=function(re,ne){if(re!=null&&ne!=null){var oe="x"+re+"y"+ne;return this._coordsMap[oe]}x(re)&&(ne=re.yAxisIndex,re=re.xAxisIndex);for(var se=0,ae=this._coordsList;se{var m=Wi(),v=m.retrieve,y=m.defaults,x=m.extend,C=m.each,w=fd(),A=xa(),E=Sm(),T=il(),S=T.isRadianAroundZero,M=T.remRadian,I=qw(),P=I.createSymbol,D=Ky(),L=lf(),R=L.applyTransform,O=sT(),F=O.shouldShowAllLabels,k=Math.PI,U=function(ae,fe){this.opt=fe,this.axisModel=ae,y(fe,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0}),this.group=new A.Group;var de=new A.Group({position:fe.position.slice(),rotation:fe.rotation});de.updateTransform(),this._transform=de.transform,this._dumbGroup=de};U.prototype={constructor:U,hasBuilder:function(ae){return!!G[ae]},add:function(ae){G[ae].call(this)},getGroup:function(){return this.group}};var G={axisLine:function(){var ae=this.opt,fe=this.axisModel;if(fe.get("axisLine.show")){var de=this.axisModel.axis.getExtent(),ve=this._transform,pe=[de[0],0],ce=[de[1],0];ve&&(R(pe,pe,ve),R(ce,ce,ve));var he=x({lineCap:"round"},fe.getModel("axisLine.lineStyle").getLineStyle());this.group.add(new A.Line({anid:"line",subPixelOptimize:!0,shape:{x1:pe[0],y1:pe[1],x2:ce[0],y2:ce[1]},style:he,strokeContainThreshold:ae.strokeContainThreshold||5,silent:!0,z2:1}));var Ce=fe.get("axisLine.symbol"),Se=fe.get("axisLine.symbolSize"),De=fe.get("axisLine.symbolOffset")||0;if(typeof De=="number"&&(De=[De,De]),Ce!=null){typeof Ce=="string"&&(Ce=[Ce,Ce]),(typeof Se=="string"||typeof Se=="number")&&(Se=[Se,Se]);var Oe=Se[0],Ue=Se[1];C([{rotate:ae.rotation+Math.PI/2,offset:De[0],r:0},{rotate:ae.rotation-Math.PI/2,offset:De[1],r:Math.sqrt((pe[0]-ce[0])*(pe[0]-ce[0])+(pe[1]-ce[1])*(pe[1]-ce[1]))}],function(Xe,it){if(Ce[it]!=="none"&&Ce[it]!=null){var ut=P(Ce[it],-Oe/2,-Ue/2,Oe,Ue,he.stroke,!0),at=Xe.r+Xe.offset,Pt=[pe[0]+at*Math.cos(ae.rotation),pe[1]-at*Math.sin(ae.rotation)];ut.attr({rotation:Xe.rotate,position:Pt,silent:!0,z2:11}),this.group.add(ut)}},this)}}},axisTickLabel:function(){var ae=this.axisModel,fe=this.opt,de=re(this,ae,fe),ve=oe(this,ae,fe);Y(ae,ve,de),ne(this,ae,fe)},axisName:function(){var ae=this.opt,fe=this.axisModel,de=v(ae.axisName,fe.get("name"));if(de){var ve=fe.get("nameLocation"),pe=ae.nameDirection,ce=fe.getModel("nameTextStyle"),he=fe.get("nameGap")||0,Ce=this.axisModel.axis.getExtent(),Se=Ce[0]>Ce[1]?-1:1,De=[ve==="start"?Ce[0]-Se*he:ve==="end"?Ce[1]+Se*he:(Ce[0]+Ce[1])/2,z(ve)?ae.labelOffset+pe*he:0],Oe,Ue=fe.get("nameRotate");Ue!=null&&(Ue=Ue*k/180);var Xe;z(ve)?Oe=q(ae.rotation,Ue??ae.rotation,pe):(Oe=J(ae,ve,Ue||0,Ce),Xe=ae.axisNameAvailableWidth,Xe!=null&&(Xe=Math.abs(Xe/Math.sin(Oe.rotation)),!isFinite(Xe)&&(Xe=null)));var it=ce.getFont(),ut=fe.get("nameTruncate",!0)||{},at=ut.ellipsis,Pt=v(ae.nameTruncateMaxWidth,ut.maxWidth,Xe),Qe=at!=null&&Pt!=null?w.truncateText(de,Pt,it,at,{minChar:2,placeholder:ut.placeholder}):de,ft=fe.get("tooltip",!0),Ot=fe.mainType,Xt={componentType:Ot,name:de,$vars:["name"]};Xt[Ot+"Index"]=fe.componentIndex;var At=new A.Text({anid:"name",__fullText:de,__truncatedText:Qe,position:De,rotation:Oe.rotation,silent:X(fe),z2:1,tooltip:ft&&ft.show?x({content:de,formatter:function(){return de},formatterParams:Xt},ft):null});A.setTextStyle(At.style,ce,{text:Qe,textFont:it,textFill:ce.getTextColor()||fe.get("axisLine.lineStyle.color"),textAlign:ce.get("align")||Oe.textAlign,textVerticalAlign:ce.get("verticalAlign")||Oe.textVerticalAlign}),fe.get("triggerEvent")&&(At.eventData=j(fe),At.eventData.targetType="axisName",At.eventData.name=de),this._dumbGroup.add(At),At.updateTransform(),this.group.add(At),At.decomposeTransform()}}},j=U.makeAxisEventDataBase=function(ae){var fe={componentType:ae.mainType,componentIndex:ae.componentIndex};return fe[ae.mainType+"Index"]=ae.componentIndex,fe},q=U.innerTextLayout=function(ae,fe,de){var ve=M(fe-ae),pe,ce;return S(ve)?(ce=de>0?"top":"bottom",pe="center"):S(ve-k)?(ce=de>0?"bottom":"top",pe="center"):(ce="middle",ve>0&&ve0?"right":"left":pe=de>0?"left":"right"),{rotation:ve,textAlign:pe,textVerticalAlign:ce}};function J(ae,fe,de,ve){var pe=M(de-ae.rotation),ce,he,Ce=ve[0]>ve[1],Se=fe==="start"&&!Ce||fe!=="start"&&Ce;return S(pe-k/2)?(he=Se?"bottom":"top",ce="center"):S(pe-k*1.5)?(he=Se?"top":"bottom",ce="center"):(he="middle",pek/2?ce=Se?"left":"right":ce=Se?"right":"left"),{rotation:pe,textAlign:ce,textVerticalAlign:he}}var X=U.isLabelSilent=function(ae){var fe=ae.get("tooltip");return ae.get("silent")||!(ae.get("triggerEvent")||fe&&fe.show)};function Y(ae,fe,de){if(!F(ae.axis)){var ve=ae.get("axisLabel.showMinLabel"),pe=ae.get("axisLabel.showMaxLabel");fe=fe||[],de=de||[];var ce=fe[0],he=fe[1],Ce=fe[fe.length-1],Se=fe[fe.length-2],De=de[0],Oe=de[1],Ue=de[de.length-1],Xe=de[de.length-2];ve===!1?(Q(ce),Q(De)):ee(ce,he)&&(ve?(Q(he),Q(Oe)):(Q(ce),Q(De))),pe===!1?(Q(Ce),Q(Ue)):ee(Se,Ce)&&(pe?(Q(Se),Q(Xe)):(Q(Ce),Q(Ue)))}}function Q(ae){ae&&(ae.ignore=!0)}function ee(ae,fe,de){var ve=ae&&ae.getBoundingRect().clone(),pe=fe&&fe.getBoundingRect().clone();if(!(!ve||!pe)){var ce=D.identity([]);return D.rotate(ce,ce,-ae.rotation),ve.applyTransform(D.mul([],ce,ae.getLocalTransform())),pe.applyTransform(D.mul([],ce,fe.getLocalTransform())),ve.intersect(pe)}}function z(ae){return ae==="middle"||ae==="center"}function ie(ae,fe,de,ve,pe){for(var ce=[],he=[],Ce=[],Se=0;Se{var f=Wi(),m=Sm(),v=f.each,y=f.curry;function x(L,R){var O={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return C(O,L,R),O.seriesInvolved&&A(O,L),O}function C(L,R,O){var F=R.getComponent("tooltip"),k=R.getComponent("axisPointer"),U=k.get("link",!0)||[],G=[];v(O.getCoordinateSystems(),function(j){if(!j.axisPointerEnabled)return;var q=D(j.model),J=L.coordSysAxesInfo[q]={};L.coordSysMap[q]=j;var X=j.model,Y=X.getModel("tooltip",F);if(v(j.getAxes(),y(ie,!1,null)),j.getTooltipAxes&&F&&Y.get("show")){var Q=Y.get("trigger")==="axis",ee=Y.get("axisPointer.type")==="cross",z=j.getTooltipAxes(Y.get("axisPointer.axis"));(Q||ee)&&v(z.baseAxes,y(ie,ee?"cross":!0,Q)),ee&&v(z.otherAxes,y(ie,"cross",!1))}function ie(re,ne,oe){var se=oe.model.getModel("axisPointer",k),ae=se.get("show");if(!(!ae||ae==="auto"&&!re&&!P(se))){ne==null&&(ne=se.get("triggerTooltip")),se=re?w(oe,Y,k,R,re,ne):se;var fe=se.get("snap"),de=D(oe.model),ve=ne||fe||oe.type==="category",pe=L.axesInfo[de]={key:de,axis:oe,coordSys:j,axisPointerModel:se,triggerTooltip:ne,involveSeries:ve,snap:fe,useHandle:P(se),seriesModels:[]};J[de]=pe,L.seriesInvolved|=ve;var ce=E(U,oe);if(ce!=null){var he=G[ce]||(G[ce]={axesInfo:{}});he.axesInfo[de]=pe,he.mapper=U[ce].mapper,pe.linkGroup=he}}}})}function w(L,R,O,F,k,U){var G=R.getModel("axisPointer"),j={};v(["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],function(Y){j[Y]=f.clone(G.get(Y))}),j.snap=L.type!=="category"&&!!U,G.get("type")==="cross"&&(j.type="line");var q=j.label||(j.label={});if(q.show==null&&(q.show=!1),k==="cross"){var J=G.get("label.show");if(q.show=J??!0,!U){var X=j.lineStyle=G.get("crossStyle");X&&f.defaults(q,X.textStyle)}}return L.model.getModel("axisPointer",new m(j,O,F))}function A(L,R){R.eachSeries(function(O){var F=O.coordinateSystem,k=O.get("tooltip.trigger",!0),U=O.get("tooltip.show",!0);!F||k==="none"||k===!1||k==="item"||U===!1||O.get("axisPointer.show",!0)===!1||v(L.coordSysAxesInfo[D(F.model)],function(G){var j=G.axis;F.getAxis(j.dim)===j&&(G.seriesModels.push(O),G.seriesDataCount==null&&(G.seriesDataCount=0),G.seriesDataCount+=O.getData().count())})},this)}function E(L,R){for(var O=R.model,F=R.dim,k=0;k=0||L===R}function S(L){var R=M(L);if(R){var O=R.axisPointerModel,F=R.axis.scale,k=O.option,U=O.get("status"),G=O.get("value");G!=null&&(G=F.parse(G));var j=P(O);U==null&&(k.status=j?"show":"hide");var q=F.getExtent().slice();q[0]>q[1]&&q.reverse(),(G==null||G>q[1])&&(G=q[1]),G{var m=Ac(),v=m.__DEV__,y=fo(),x=Mie(),C=y.extendComponentView({type:"axis",_axisPointer:null,axisPointerClass:null,render:function(S,M,I,P){this.axisPointerClass&&x.fixValue(S),C.superApply(this,"render",arguments),w(this,S,M,I,P,!0)},updateAxisPointer:function(S,M,I,P,D){w(this,S,M,I,P,!1)},remove:function(S,M){var I=this._axisPointer;I&&I.remove(M),C.superApply(this,"remove",arguments)},dispose:function(S,M){A(this,M),C.superApply(this,"dispose",arguments)}});function w(S,M,I,P,D,L){var R=C.getAxisPointerClass(S.axisPointerClass);if(R){var O=x.getAxisPointerModel(M);O?(S._axisPointer||(S._axisPointer=new R)).render(M,O,P,L):A(S,P)}}function A(S,M,I){var P=S._axisPointer;P&&P.dispose(M,I),S._axisPointer=null}var E=[];C.registerAxisPointerClass=function(S,M){E[S]=M},C.getAxisPointerClass=function(S){return S&&E[S]};var T=C;f.exports=T}),sGe=xt(o=>{var f=Wi();function m(v,y,x){x=x||{};var C=v.coordinateSystem,w=y.axis,A={},E=w.getAxesOnZeroOf()[0],T=w.position,S=E?"onZero":T,M=w.dim,I=C.getRect(),P=[I.x,I.x+I.width,I.y,I.y+I.height],D={left:0,right:1,top:0,bottom:1,onZero:2},L=y.get("offset")||0,R=M==="x"?[P[2]-L,P[3]+L]:[P[0]-L,P[1]+L];if(E){var O=E.toGlobalCoord(E.dataToCoord(0));R[D.onZero]=Math.max(Math.min(O,R[1]),R[0])}A.position=[M==="y"?R[D[S]]:P[0],M==="x"?R[D[S]]:P[3]],A.rotation=Math.PI/2*(M==="x"?0:1);var F={top:-1,bottom:1,left:-1,right:1};A.labelDirection=A.tickDirection=A.nameDirection=F[T],A.labelOffset=E?R[D[T]]-R[D.onZero]:0,y.get("axisTick.inside")&&(A.tickDirection=-A.tickDirection),f.retrieve(x.labelInside,y.get("axisLabel.inside"))&&(A.labelDirection=-A.labelDirection);var k=y.get("axisLabel.rotate");return A.labelRotate=S==="top"?-k:k,A.z2=1,A}o.layout=m}),lGe=xt(o=>{var f=Wi(),m=xa();function v(x,C,w,A){var E=w.axis;if(!E.scale.isBlank()){var T=w.getModel("splitArea"),S=T.getModel("areaStyle"),M=S.get("color"),I=A.coordinateSystem.getRect(),P=E.getTicksCoords({tickModel:T,clamp:!0});if(P.length){var D=M.length,L=x.__splitAreaColors,R=f.createHashMap(),O=0;if(L)for(var F=0;F{var o=Wi(),f=xa(),m=Q3(),v=lB(),y=sGe(),x=lGe(),C=x.rectCoordAxisBuildSplitArea,w=x.rectCoordAxisHandleRemove,A=["axisLine","axisTickLabel","axisName"],E=["splitArea","splitLine","minorSplitLine"],T=v.extend({type:"cartesianAxis",axisPointerClass:"CartesianAxisPointer",render:function(S,M,I,P){this.group.removeAll();var D=this._axisGroup;if(this._axisGroup=new f.Group,this.group.add(this._axisGroup),!!S.get("show")){var L=S.getCoordSysModel(),R=y.layout(L,S),O=new m(S,R);o.each(A,O.add,O),this._axisGroup.add(O.getGroup()),o.each(E,function(F){S.get(F+".show")&&this["_"+F](S,L)},this),f.groupTransition(D,this._axisGroup,S),T.superCall(this,"render",S,M,I,P)}},remove:function(){w(this)},_splitLine:function(S,M){var I=S.axis;if(!I.scale.isBlank()){var P=S.getModel("splitLine"),D=P.getModel("lineStyle"),L=D.get("color");L=o.isArray(L)?L:[L];for(var R=M.coordinateSystem.getRect(),O=I.isHorizontal(),F=0,k=I.getTicksCoords({tickModel:P}),U=[],G=[],j=D.getLineStyle(),q=0;q{aGe(),hvt()}),qj=xt(()=>{var o=fo(),f=Wi(),m=xa();A0e(),dvt(),o.extendComponentView({type:"grid",render:function(v,y){this.group.removeAll(),v.get("show")&&this.group.add(new m.Rect({shape:v.coordinateSystem.getRect(),style:f.defaults({fill:v.get("backgroundColor")},v.getItemStyle()),silent:!0,z2:-1}))}}),o.registerPreprocessor(function(v){v.xAxis&&v.yAxis&&!v.grid&&(v.grid={})})}),fvt=xt(()=>{var o=fo();rvt(),ovt();var f=sB(),m=Yj(),v=avt();qj(),o.registerVisual(f("line","circle","line")),o.registerLayout(m("line")),o.registerProcessor(o.PRIORITY.PROCESSOR.STATISTIC,v("line"))}),uGe=xt((o,f)=>{var m=Jg(),v=zM(),y=m.extend({type:"series.__base_bar__",getInitialData:function(x,C){return v(this.getSource(),this,{useEncodeDefaulter:!0})},getMarkerPosition:function(x){var C=this.coordinateSystem;if(C){var w=C.dataToPoint(C.clampData(x)),A=this.getData(),E=A.getLayout("offset"),T=A.getLayout("size"),S=C.getBaseAxis().isHorizontal()?0:1;return w[S]+=E+T/2,w}return[NaN,NaN]},defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod",itemStyle:{},emphasis:{}}});f.exports=y}),pvt=xt((o,f)=>{var m=uGe(),v=m.extend({type:"series.bar",dependencies:["grid","polar"],brushSelector:"rect",getProgressive:function(){return this.get("large")?this.get("progressive"):!1},getProgressiveThreshold:function(){var y=this.get("progressiveThreshold"),x=this.get("largeThreshold");return x>y&&(y=x),y},defaultOption:{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1}}});f.exports=v}),cGe=xt(o=>{var f=xa(),m=w0e(),v=m.getDefaultLabel;function y(C,w,A,E,T,S,M){var I=A.getModel("label"),P=A.getModel("emphasis.label");f.setLabelStyle(C,w,I,P,{labelFetcher:T,labelDataIndex:S,defaultText:v(T.getData(),S),isRectText:!0,autoColor:E}),x(C),x(w)}function x(C,w){C.textPosition==="outside"&&(C.textPosition=w)}o.setLabel=y}),mvt=xt((o,f)=>{var m=nU(),v=m([["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["stroke","barBorderColor"],["lineWidth","barBorderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),y={getBarItemStyle:function(x){var C=v(this,x);if(this.getBorderLineDash){var w=this.getBorderLineDash();w&&(C.lineDash=w)}return C}};f.exports=y}),gvt=xt((o,f)=>{var m=xa(),v=m.extendShape,y=v({type:"sausage",shape:{cx:0,cy:0,r0:0,r:0,startAngle:0,endAngle:Math.PI*2,clockwise:!0},buildPath:function(x,C){var w=C.cx,A=C.cy,E=Math.max(C.r0||0,0),T=Math.max(C.r,0),S=(T-E)*.5,M=E+S,I=C.startAngle,P=C.endAngle,D=C.clockwise,L=Math.cos(I),R=Math.sin(I),O=Math.cos(P),F=Math.sin(P),k=D?P-I{var m=Ac(),v=m.__DEV__,y=fo(),x=Wi(),C=xa(),w=cGe(),A=w.setLabel,E=Sm(),T=mvt(),S=am(),M=rB(),I=X3(),P=I.throttle,D=jj(),L=D.createClipPath,R=gvt(),O=["itemStyle","barBorderWidth"],F=[0,0];x.extend(E.prototype,T);function k(pe,ce){var he=pe.getArea&&pe.getArea();if(pe.type==="cartesian2d"){var Ce=pe.getBaseAxis();if(Ce.type!=="category"||!Ce.onBand){var Se=ce.getLayout("bandWidth");Ce.isHorizontal()?(he.x-=Se,he.width+=Se*2):(he.y-=Se,he.height+=Se*2)}}return he}var U=y.extendChartView({type:"bar",render:function(pe,ce,he){this._updateDrawMode(pe);var Ce=pe.get("coordinateSystem");return(Ce==="cartesian2d"||Ce==="polar")&&(this._isLargeDraw?this._renderLarge(pe,ce,he):this._renderNormal(pe,ce,he)),this.group},incrementalPrepareRender:function(pe,ce,he){this._clear(),this._updateDrawMode(pe)},incrementalRender:function(pe,ce,he,Ce){this._incrementalRenderLarge(pe,ce)},_updateDrawMode:function(pe){var ce=pe.pipelineContext.large;(this._isLargeDraw==null||ce^this._isLargeDraw)&&(this._isLargeDraw=ce,this._clear())},_renderNormal:function(pe,ce,he){var Ce=this.group,Se=pe.getData(),De=this._data,Oe=pe.coordinateSystem,Ue=Oe.getBaseAxis(),Xe;Oe.type==="cartesian2d"?Xe=Ue.isHorizontal():Oe.type==="polar"&&(Xe=Ue.dim==="angle");var it=pe.isAnimationEnabled()?pe:null,ut=pe.get("clip",!0),at=k(Oe,Se);Ce.removeClipPath();var Pt=pe.get("roundCap",!0),Qe=pe.get("showBackground",!0),ft=pe.getModel("backgroundStyle"),Ot=ft.get("barBorderRadius")||0,Xt=[],At=this._backgroundEls||[];Se.diff(De).add(function(It){var Jt=Se.getItemModel(It),bi=Q[Oe.type](Se,It,Jt);if(Qe){var Yi=Q[Oe.type](Se,It),ii=ve(Oe,Xe,Yi);ii.useStyle(ft.getBarItemStyle()),Oe.type==="cartesian2d"&&ii.setShape("r",Ot),Xt[It]=ii}if(Se.hasValue(It)){if(ut){var ei=q[Oe.type](at,bi);if(ei){Ce.remove(Li);return}}var Li=J[Oe.type](It,bi,Xe,it,!1,Pt);Se.setItemGraphicEl(It,Li),Ce.add(Li),z(Li,Se,It,Jt,bi,pe,Xe,Oe.type==="polar")}}).update(function(It,Jt){var bi=Se.getItemModel(It),Yi=Q[Oe.type](Se,It,bi);if(Qe){var ii=At[Jt];ii.useStyle(ft.getBarItemStyle()),Oe.type==="cartesian2d"&&ii.setShape("r",Ot),Xt[It]=ii;var ei=Q[Oe.type](Se,It),Li=de(Xe,ei,Oe);C.updateProps(ii,{shape:Li},it,It)}var Je=De.getItemGraphicEl(Jt);if(!Se.hasValue(It)){Ce.remove(Je);return}if(ut){var Nt=q[Oe.type](at,Yi);if(Nt){Ce.remove(Je);return}}Je?C.updateProps(Je,{shape:Yi},it,It):Je=J[Oe.type](It,Yi,Xe,it,!0,Pt),Se.setItemGraphicEl(It,Je),Ce.add(Je),z(Je,Se,It,bi,Yi,pe,Xe,Oe.type==="polar")}).remove(function(It){var Jt=De.getItemGraphicEl(It);Oe.type==="cartesian2d"?Jt&&X(It,it,Jt):Jt&&Y(It,it,Jt)}).execute();var bt=this._backgroundGroup||(this._backgroundGroup=new M);bt.removeAll();for(var gt=0;gt0?1:-1,Oe=Ce.height>0?1:-1;return{x:Ce.x+De*Se/2,y:Ce.y+Oe*Se/2,width:Ce.width-De*Se,height:Ce.height-Oe*Se}},polar:function(pe,ce,he){var Ce=pe.getItemLayout(ce);return{cx:Ce.cx,cy:Ce.cy,r0:Ce.r0,r:Ce.r,startAngle:Ce.startAngle,endAngle:Ce.endAngle}}};function ee(pe){return pe.startAngle!=null&&pe.endAngle!=null&&pe.startAngle===pe.endAngle}function z(pe,ce,he,Ce,Se,De,Oe,Ue){var Xe=ce.getItemVisual(he,"color"),it=ce.getItemVisual(he,"opacity"),ut=ce.getVisual("borderColor"),at=Ce.getModel("itemStyle"),Pt=Ce.getModel("emphasis.itemStyle").getBarItemStyle();Ue||pe.setShape("r",at.get("barBorderRadius")||0),pe.useStyle(x.defaults({stroke:ee(Se)?"none":ut,fill:ee(Se)?"none":Xe,opacity:it},at.getBarItemStyle()));var Qe=Ce.getShallow("cursor");Qe&&pe.attr("cursor",Qe);var ft=Oe?Se.height>0?"bottom":"top":Se.width>0?"left":"right";Ue||A(pe.style,Pt,Ce,Xe,De,he,ft),ee(Se)&&(Pt.fill=Pt.stroke="none"),C.setHoverStyle(pe,Pt)}function ie(pe,ce){var he=pe.get(O)||0,Ce=isNaN(ce.width)?Number.MAX_VALUE:Math.abs(ce.width),Se=isNaN(ce.height)?Number.MAX_VALUE:Math.abs(ce.height);return Math.min(he,Ce,Se)}var re=S.extend({type:"largeBar",shape:{points:[]},buildPath:function(pe,ce){for(var he=ce.points,Ce=this.__startPoint,Se=this.__baseDimIdx,De=0;De=0?he:null},30,!1);function se(pe,ce,he){var Ce=pe.__baseDimIdx,Se=1-Ce,De=pe.shape.points,Oe=pe.__largeDataIndices,Ue=Math.abs(pe.__barWidth/2),Xe=pe.__startPoint[Se];F[0]=ce,F[1]=he;for(var it=F[Ce],ut=F[1-Ce],at=it-Ue,Pt=it+Ue,Qe=0,ft=De.length/2;Qe=at&&Xt<=Pt&&(Xe<=At?ut>=Xe&&ut<=At:ut>=At&&ut<=Xe))return Oe[Qe]}return-1}function ae(pe,ce,he){var Ce=he.getVisual("borderColor")||he.getVisual("color"),Se=ce.getModel("itemStyle").getItemStyle(["color","borderColor"]);pe.useStyle(Se),pe.style.fill=null,pe.style.stroke=Ce,pe.style.lineWidth=he.getLayout("barWidth")}function fe(pe,ce,he){var Ce=ce.get("borderColor")||ce.get("color"),Se=ce.getItemStyle(["color","borderColor"]);pe.useStyle(Se),pe.style.fill=null,pe.style.stroke=Ce,pe.style.lineWidth=he.getLayout("barWidth")}function de(pe,ce,he){var Ce,Se=he.type==="polar";return Se?Ce=he.getArea():Ce=he.grid.getRect(),Se?{cx:Ce.cx,cy:Ce.cy,r0:pe?Ce.r0:ce.r0,r:pe?Ce.r:ce.r,startAngle:pe?ce.startAngle:0,endAngle:pe?ce.endAngle:Math.PI*2}:{x:pe?ce.x:Ce.x,y:pe?Ce.y:ce.y,width:pe?ce.width:Ce.width,height:pe?Ce.height:ce.height}}function ve(pe,ce,he){var Ce=pe.type==="polar"?C.Sector:C.Rect;return new Ce({shape:de(ce,he,pe),silent:!0,z2:0})}f.exports=U}),vvt=xt(()=>{var o=fo(),f=Wi(),m=Sie(),v=m.layout,y=m.largeLayout;A0e(),pvt(),_vt(),qj(),o.registerLayout(o.PRIORITY.VISUAL.LAYOUT,f.curry(v,"bar")),o.registerLayout(o.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,y),o.registerVisual({seriesType:"bar",reset:function(x){x.getData().setVisual("legendSymbol","roundRect")}})}),uU=xt((o,f)=>{var m=sU(),v=Yw(),y=Wi(),x=y.extend,C=y.isArray;function w(A,E,T){E=C(E)&&{coordDimensions:E}||x({},E);var S=A.getSource(),M=m(S,E),I=new v(M,A);return I.initData(S,T),I}f.exports=w}),E0e=xt((o,f)=>{var m=Wi(),v={updateSelectedMap:function(y){this._targetList=m.isArray(y)?y.slice():[],this._selectTargetMap=m.reduce(y||[],function(x,C){return x.set(C.name,C),x},m.createHashMap())},select:function(y,x){var C=x!=null?this._targetList[x]:this._selectTargetMap.get(y),w=this.get("selectedMode");w==="single"&&this._selectTargetMap.each(function(A){A.selected=!1}),C&&(C.selected=!0)},unSelect:function(y,x){var C=x!=null?this._targetList[x]:this._selectTargetMap.get(y);C&&(C.selected=!1)},toggleSelected:function(y,x){var C=x!=null?this._targetList[x]:this._selectTargetMap.get(y);if(C!=null)return this[C.selected?"unSelect":"select"](y,x),C.selected},isSelected:function(y,x){var C=x!=null?this._targetList[x]:this._selectTargetMap.get(y);return C&&C.selected}};f.exports=v}),Xj=xt((o,f)=>{function m(y,x){this.getAllNames=function(){var C=x();return C.mapArray(C.getName)},this.containName=function(C){var w=x();return w.indexOfName(C)>=0},this.indexOfName=function(C){var w=y();return w.indexOfName(C)},this.getItemVisual=function(C,w){var A=y();return A.getItemVisual(C,w)}}var v=m;f.exports=v}),yvt=xt((o,f)=>{var m=fo(),v=uU(),y=Wi(),x=vu(),C=il(),w=C.getPercentWithPrecision,A=E0e(),E=oB(),T=E.retrieveRawAttr,S=VM(),M=S.makeSeriesEncodeForNameBased,I=Xj(),P=m.extendSeriesModel({type:"series.pie",init:function(L){P.superApply(this,"init",arguments),this.legendVisualProvider=new I(y.bind(this.getData,this),y.bind(this.getRawData,this)),this.updateSelectedMap(this._createSelectableList()),this._defaultLabelLine(L)},mergeOption:function(L){P.superCall(this,"mergeOption",L),this.updateSelectedMap(this._createSelectableList())},getInitialData:function(L,R){return v(this,{coordDimensions:["value"],encodeDefaulter:y.curry(M,this)})},_createSelectableList:function(){for(var L=this.getRawData(),R=L.mapDimension("value"),O=[],F=0,k=L.count();F{var m=Wi(),v=xa(),y=V2();function x(S,M,I,P){var D=M.getData(),L=this.dataIndex,R=D.getName(L),O=M.get("selectedOffset");P.dispatchAction({type:"pieToggleSelect",from:S,name:R,seriesId:M.id}),D.each(function(F){C(D.getItemGraphicEl(F),D.getItemLayout(F),M.isSelected(D.getName(F)),O,I)})}function C(S,M,I,P,D){var L=(M.startAngle+M.endAngle)/2,R=Math.cos(L),O=Math.sin(L),F=I?P:0,k=[R*F,O*F];D?S.animate().when(200,{position:k}).start("bounceOut"):S.attr("position",k)}function w(S,M){v.Group.call(this);var I=new v.Sector({z2:2}),P=new v.Polyline,D=new v.Text;this.add(I),this.add(P),this.add(D),this.updateData(S,M,!0)}var A=w.prototype;A.updateData=function(S,M,I){var P=this.childAt(0),D=this.childAt(1),L=this.childAt(2),R=S.hostModel,O=S.getItemModel(M),F=S.getItemLayout(M),k=m.extend({},F);k.label=null;var U=R.getShallow("animationTypeUpdate");if(I){P.setShape(k);var G=R.getShallow("animationType");G==="scale"?(P.shape.r=F.r0,v.initProps(P,{shape:{r:F.r}},R,M)):(P.shape.endAngle=F.startAngle,v.updateProps(P,{shape:{endAngle:F.endAngle}},R,M))}else U==="expansion"?P.setShape(k):v.updateProps(P,{shape:k},R,M);var j=S.getItemVisual(M,"color");P.useStyle(m.defaults({lineJoin:"bevel",fill:j},O.getModel("itemStyle").getItemStyle())),P.hoverStyle=O.getModel("emphasis.itemStyle").getItemStyle();var q=O.getShallow("cursor");q&&P.attr("cursor",q),C(this,S.getItemLayout(M),R.isSelected(S.getName(M)),R.get("selectedOffset"),R.get("animation"));var J=!I&&U==="transition";this._updateLabel(S,M,J),this.highDownOnUpdate=R.get("silent")?null:function(X,Y){var Q=R.isAnimationEnabled()&&O.get("hoverAnimation");Y==="emphasis"?(D.ignore=D.hoverIgnore,L.ignore=L.hoverIgnore,Q&&(P.stopAnimation(!0),P.animateTo({shape:{r:F.r+R.get("hoverOffset")}},300,"elasticOut"))):(D.ignore=D.normalIgnore,L.ignore=L.normalIgnore,Q&&(P.stopAnimation(!0),P.animateTo({shape:{r:F.r}},300,"elasticOut")))},v.setHoverStyle(this)},A._updateLabel=function(S,M,I){var P=this.childAt(1),D=this.childAt(2),L=S.hostModel,R=S.getItemModel(M),O=S.getItemLayout(M),F=O.label,X=S.getItemVisual(M,"color");if(!F||isNaN(F.x)||isNaN(F.y)){D.ignore=D.normalIgnore=D.hoverIgnore=P.ignore=P.normalIgnore=P.hoverIgnore=!0;return}var k={points:F.linePoints||[[F.x,F.y],[F.x,F.y],[F.x,F.y]]},U={x:F.x,y:F.y};I?(v.updateProps(P,{shape:k},L,M),v.updateProps(D,{style:U},L,M)):(P.attr({shape:k}),D.attr({style:U})),D.attr({rotation:F.rotation,origin:[F.x,F.y],z2:10});var G=R.getModel("label"),j=R.getModel("emphasis.label"),q=R.getModel("labelLine"),J=R.getModel("emphasis.labelLine"),X=S.getItemVisual(M,"color");v.setLabelStyle(D.style,D.hoverStyle={},G,j,{labelFetcher:S.hostModel,labelDataIndex:M,defaultText:F.text,autoColor:X,useInsideStyle:!!F.inside},{textAlign:F.textAlign,textVerticalAlign:F.verticalAlign,opacity:S.getItemVisual(M,"opacity")}),D.ignore=D.normalIgnore=!G.get("show"),D.hoverIgnore=!j.get("show"),P.ignore=P.normalIgnore=!q.get("show"),P.hoverIgnore=!J.get("show"),P.setStyle({stroke:X,opacity:S.getItemVisual(M,"opacity")}),P.setStyle(q.getModel("lineStyle").getLineStyle()),P.hoverStyle=J.getModel("lineStyle").getLineStyle();var Y=q.get("smooth");Y&&Y===!0&&(Y=.4),P.setShape({smooth:Y})},m.inherits(w,v.Group);var E=y.extend({type:"pie",init:function(){var S=new v.Group;this._sectorGroup=S},render:function(S,M,I,P){if(!(P&&P.from===this.uid)){var D=S.getData(),L=this._data,R=this.group,O=M.get("animation"),F=!L,k=S.get("animationType"),U=S.get("animationTypeUpdate"),G=m.curry(x,this.uid,S,O,I),j=S.get("selectedMode");if(D.diff(L).add(function(Q){var ee=new w(D,Q);F&&k!=="scale"&&ee.eachChild(function(z){z.stopAnimation(!0)}),j&&ee.on("click",G),D.setItemGraphicEl(Q,ee),R.add(ee)}).update(function(Q,ee){var z=L.getItemGraphicEl(ee);!F&&U!=="transition"&&z.eachChild(function(ie){ie.stopAnimation(!0)}),z.updateData(D,Q),z.off("click"),j&&z.on("click",G),R.add(z),D.setItemGraphicEl(Q,z)}).remove(function(Q){var ee=L.getItemGraphicEl(Q);R.remove(ee)}).execute(),O&&D.count()>0&&(F?k!=="scale":U!=="transition")){for(var q=D.getItemLayout(0),J=1;isNaN(q.startAngle)&&J=P.r0}}}),T=E;f.exports=T}),hGe=xt((o,f)=>{var m=fo(),v=Wi();function y(x,C){v.each(C,function(w){w.update="updateView",m.registerAction(w,function(A,E){var T={};return E.eachComponent({mainType:"series",subType:x,query:A},function(S){S[w.method]&&S[w.method](A.name,A.dataIndex);var M=S.getData();M.each(function(I){var P=M.getName(I);T[P]=S.isSelected(P)||!1})}),{name:A.name,selected:T,seriesId:A.seriesId}})})}f.exports=y}),Die=xt((o,f)=>{var m=Wi(),v=m.createHashMap;function y(x){return{getTargetSeries:function(C){var w={},A=v();return C.eachSeriesByType(x,function(E){E.__paletteScope=w,A.set(E.uid,E)}),A},reset:function(C,w){var A=C.getRawData(),E={},T=C.getData();T.each(function(S){var M=T.getRawIndex(S);E[M]=S}),A.each(function(S){var M=E[S],I=M!=null&&T.getItemVisual(M,"color",!0),P=M!=null&&T.getItemVisual(M,"borderColor",!0),D;if((!I||!P)&&(D=A.getItemModel(S)),!I){var L=D.get("itemStyle.color")||C.getColorFromPalette(A.getName(S)||S+"",C.__paletteScope,A.count());M!=null&&T.setItemVisual(M,"color",L)}if(!P){var R=D.get("itemStyle.borderColor");M!=null&&T.setItemVisual(M,"borderColor",R)}})}}}f.exports=y}),Cvt=xt((o,f)=>{var m=nb(),v=il(),y=v.parsePercent,x=Math.PI/180;function C(T,S,M,I,P,D,L,R,O,F){T.sort(function(z,ie){return z.y-ie.y});function k(z,ie,re,ne){for(var oe=z;oeO+L);oe++)if(T[oe].y+=re,oe>z&&oe+1T[oe].y+T[oe].height){U(oe,re/2);return}U(ie-1,re/2)}function U(z,ie){for(var re=z;re>=0&&!(T[re].y-ie0&&T[re].y>T[re-1].y+T[re-1].height));re--);}function G(z,ie,re,ne,oe,se){for(var ae=(se>0,ie?Number.MAX_VALUE:0),fe=0,de=z.length;fe=ae&&(he=ae-10),!ie&&he<=ae&&(he=ae+10),z[fe].x=re+he*se,ae=he}}for(var j=0,q,J=T.length,X=[],Y=[],Q=0;Q=M?Y.push(T[Q]):X.push(T[Q]);G(X,!1,S,M,I,P),G(Y,!0,S,M,I,P)}function w(T,S,M,I,P,D,L,R){for(var O=[],F=[],k=Number.MAX_VALUE,U=-Number.MAX_VALUE,G=0;G0?"right":"left":ae>0?"left":"right"}var at,Pt=J.get("rotate");typeof Pt=="number"?at=Pt*(Math.PI/180):at=Pt?ae<0?-se+Math.PI:-se:0,k=!!at,j.label={x:de,y:ve,position:X,height:Ce.height,len:ne,len2:oe,linePoints:pe,textAlign:ce,verticalAlign:"middle",rotation:at,inside:Se,labelDistance:Y,labelAlignTo:Q,labelMargin:ee,bleedMargin:z,textRect:Ce,text:he,font:ie},Se||R.push(j.label)}}),!k&&T.get("avoidLabelOverlap")&&w(R,O,F,S,M,I,P,D)}f.exports=E}),bvt=xt((o,f)=>{var m=il(),v=m.parsePercent,y=m.linearMap,x=rd(),C=Cvt(),w=Wi(),A=Math.PI*2,E=Math.PI/180;function T(M,I){return x.getLayoutRect(M.getBoxLayoutParams(),{width:I.getWidth(),height:I.getHeight()})}function S(M,I,P,D){I.eachSeriesByType(M,function(L){var R=L.getData(),O=R.mapDimension("value"),F=T(L,P),k=L.get("center"),U=L.get("radius");w.isArray(U)||(U=[0,U]),w.isArray(k)||(k=[k,k]);var G=v(F.width,P.getWidth()),j=v(F.height,P.getHeight()),q=Math.min(G,j),J=v(k[0],G)+F.x,X=v(k[1],j)+F.y,Y=v(U[0],q/2),Q=v(U[1],q/2),ee=-L.get("startAngle")*E,z=L.get("minAngle")*E,ie=0;R.each(O,function(Ce){!isNaN(Ce)&&ie++});var re=R.getSum(O),ne=Math.PI/(re||ie)*2,oe=L.get("clockwise"),se=L.get("roseType"),ae=L.get("stillShowZeroSum"),fe=R.getDataExtent(O);fe[0]=0;var de=A,ve=0,pe=ee,ce=oe?1:-1;if(R.each(O,function(Ce,Se){var De;if(isNaN(Ce)){R.setItemLayout(Se,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:oe,cx:J,cy:X,r0:Y,r:se?NaN:Q,viewRect:F});return}se!=="area"?De=re===0&&ae?ne:Ce*ne:De=A/ie,De{function m(v){return{seriesType:v,reset:function(y,x){var C=x.findComponents({mainType:"legend"});if(!(!C||!C.length)){var w=y.getData();w.filterSelf(function(A){for(var E=w.getName(A),T=0;T{var o=fo(),f=Wi();yvt(),xvt();var m=hGe(),v=Die(),y=bvt(),x=Jj();m("pie",[{type:"pieToggleSelect",event:"pieselectchanged",method:"toggleSelected"},{type:"pieSelect",event:"pieselected",method:"select"},{type:"pieUnSelect",event:"pieunselected",method:"unSelect"}]),o.registerVisual(v("pie")),o.registerLayout(f.curry(y,"pie")),o.registerProcessor(x("pie"))}),Avt=xt((o,f)=>{var m=zM(),v=Jg(),y=v.extend({type:"series.scatter",dependencies:["grid","polar","geo","singleAxis","calendar"],getInitialData:function(x,C){return m(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",getProgressive:function(){var x=this.option.progressive;return x??(this.option.large?5e3:this.get("progressive"))},getProgressiveThreshold:function(){var x=this.option.progressiveThreshold;return x??(this.option.large?1e4:this.get("progressiveThreshold"))},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},clip:!0}});f.exports=y}),Evt=xt((o,f)=>{var m=xa(),v=qw(),y=v.createSymbol,x=y0e(),C=4,w=m.extendShape({shape:{points:null},symbolProxy:null,softClipShape:null,buildPath:function(S,M){var I=M.points,P=M.size,D=this.symbolProxy,L=D.shape,R=S.getContext?S.getContext():S,O=R&&P[0]=0;O--){var F=O*2,k=P[F]-L/2,U=P[F+1]-R/2;if(S>=k&&M>=U&&S<=k+L&&M<=U+R)return O}return-1}});function A(){this.group=new m.Group}var E=A.prototype;E.isPersistent=function(){return!this._incremental},E.updateData=function(S,M){this.group.removeAll();var I=new w({rectHover:!0,cursor:"default"});I.setShape({points:S.getLayout("symbolPoints")}),this._setCommon(I,S,!1,M),this.group.add(I),this._incremental=null},E.updateLayout=function(S){if(!this._incremental){var M=S.getLayout("symbolPoints");this.group.eachChild(function(I){if(I.startIndex!=null){var P=(I.endIndex-I.startIndex)*2,D=I.startIndex*4*2;M=new Float32Array(M.buffer,D,P)}I.setShape("points",M)})}},E.incrementalPrepareUpdate=function(S){this.group.removeAll(),this._clearIncremental(),S.count()>2e6?(this._incremental||(this._incremental=new x({silent:!0})),this.group.add(this._incremental)):this._incremental=null},E.incrementalUpdate=function(S,M,I){var P;this._incremental?(P=new w,this._incremental.addDisplayable(P,!0)):(P=new w({rectHover:!0,cursor:"default",startIndex:S.start,endIndex:S.end}),P.incremental=!0,this.group.add(P)),P.setShape({points:M.getLayout("symbolPoints")}),this._setCommon(P,M,!!this._incremental,I)},E._setCommon=function(S,M,I,P){var D=M.hostModel;P=P||{};var L=M.getVisual("symbolSize");S.setShape("size",L instanceof Array?L:[L,L]),S.softClipShape=P.clipShape||null,S.symbolProxy=y(M.getVisual("symbol"),0,0,0,0),S.setColor=S.symbolProxy.setColor;var R=S.shape.size[0]=0&&(S.dataIndex=k+(S.startIndex||0))}))},E.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},E._clearIncremental=function(){var S=this._incremental;S&&S.clearDisplaybles()};var T=A;f.exports=T}),Tvt=xt(()=>{var o=fo(),f=Wj(),m=Evt(),v=Yj();o.extendChartView({type:"scatter",render:function(y,x,C){var w=y.getData(),A=this._updateSymbolDraw(w,y);A.updateData(w,{clipShape:this._getClipShape(y)}),this._finished=!0},incrementalPrepareRender:function(y,x,C){var w=y.getData(),A=this._updateSymbolDraw(w,y);A.incrementalPrepareUpdate(w),this._finished=!1},incrementalRender:function(y,x,C){this._symbolDraw.incrementalUpdate(y,x.getData(),{clipShape:this._getClipShape(x)}),this._finished=y.end===x.getData().count()},updateTransform:function(y,x,C){var w=y.getData();if(this.group.dirty(),!this._finished||w.count()>1e4||!this._symbolDraw.isPersistent())return{update:!0};var A=v().reset(y);A.progress&&A.progress({start:0,end:w.count()},w),this._symbolDraw.updateLayout(w)},_getClipShape:function(y){var x=y.coordinateSystem,C=x&&x.getArea&&x.getArea();return y.get("clip",!0)?C:null},_updateSymbolDraw:function(y,x){var C=this._symbolDraw,w=x.pipelineContext,A=w.large;return(!C||A!==this._isLargeDraw)&&(C&&C.remove(),C=this._symbolDraw=A?new m:new f,this._isLargeDraw=A,this.group.removeAll()),this.group.add(C.group),C},remove:function(y,x){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},dispose:function(){}})}),Svt=xt(()=>{var o=fo();Avt(),Tvt();var f=sB(),m=Yj();qj(),o.registerVisual(f("scatter","circle")),o.registerLayout(m("scatter"))}),Pvt=xt((o,f)=>{var m=Wi(),v=K3();function y(C,w,A){v.call(this,C,w,A),this.type="value",this.angle=0,this.name="",this.model}m.inherits(y,v);var x=y;f.exports=x}),Ivt=xt((o,f)=>{var m=Wi(),v=Pvt(),y=Tie(),x=il(),C=sT(),w=C.getScaleExtent,A=C.niceScaleExtent,E=aT(),T=Z8e();function S(I,P,D){this._model=I,this.dimensions=[],this._indicatorAxes=m.map(I.getIndicatorModels(),function(L,R){var O="indicator_"+R,F=new v(O,L.get("axisType")==="log"?new T:new y);return F.name=L.get("name"),F.model=L,L.axis=F,this.dimensions.push(O),F},this),this.resize(I,D),this.cx,this.cy,this.r,this.r0,this.startAngle}S.prototype.getIndicatorAxes=function(){return this._indicatorAxes},S.prototype.dataToPoint=function(I,P){var D=this._indicatorAxes[P];return this.coordToPoint(D.dataToCoord(I),P)},S.prototype.coordToPoint=function(I,P){var D=this._indicatorAxes[P],L=D.angle,R=this.cx+I*Math.cos(L),O=this.cy-I*Math.sin(L);return[R,O]},S.prototype.pointToData=function(I){var P=I[0]-this.cx,D=I[1]-this.cy,L=Math.sqrt(P*P+D*D);P/=L,D/=L;for(var R=Math.atan2(-D,P),O=1/0,F,k=-1,U=0;UU[0]&&isFinite(Q)&&isFinite(U[0]))}else{var ee=j.getTicks().length-1;ee>R&&(X=O(X));var Y=Math.ceil(U[1]/X)*X,Q=x.round(Y-X*R);j.setExtent(Q,Y),j.setInterval(X)}})},S.dimensions=[],S.create=function(I,P){var D=[];return I.eachComponent("radar",function(L){var R=new S(L,I,P);D.push(R),L.coordinateSystem=R}),I.eachSeriesByType("radar",function(L){L.get("coordinateSystem")==="radar"&&(L.coordinateSystem=D[L.get("radarIndex")||0])}),D},E.register("radar",S);var M=S;f.exports=M}),Mvt=xt((o,f)=>{var m=fo(),v=Wi(),y=oGe(),x=Sm(),C=lU(),w=y.valueAxis;function A(S,M){return v.defaults({show:M},S)}var E=m.extendComponentModel({type:"radar",optionUpdated:function(){var S=this.get("boundaryGap"),M=this.get("splitNumber"),I=this.get("scale"),P=this.get("axisLine"),D=this.get("axisTick"),L=this.get("axisType"),R=this.get("axisLabel"),O=this.get("name"),F=this.get("name.show"),k=this.get("name.formatter"),U=this.get("nameGap"),G=this.get("triggerEvent"),j=v.map(this.get("indicator")||[],function(q){q.max!=null&&q.max>0&&!q.min?q.min=0:q.min!=null&&q.min<0&&!q.max&&(q.max=0);var J=O;if(q.color!=null&&(J=v.defaults({color:q.color},O)),q=v.merge(v.clone(q),{boundaryGap:S,splitNumber:M,scale:I,axisLine:P,axisTick:D,axisType:L,axisLabel:R,name:q.text,nameLocation:"end",nameGap:U,nameTextStyle:J,triggerEvent:G},!1),F||(q.name=""),typeof k=="string"){var X=q.name;q.name=k.replace("{value}",X??"")}else typeof k=="function"&&(q.name=k(q.name,q));var Y=v.extend(new x(q,null,this.ecModel),C);return Y.mainType="radar",Y.componentIndex=this.componentIndex,Y},this);this.getIndicatorModels=function(){return j}},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"75%",startAngle:90,name:{show:!0},boundaryGap:[0,0],splitNumber:5,nameGap:15,scale:!1,shape:"polygon",axisLine:v.merge({lineStyle:{color:"#bbb"}},w.axisLine),axisLabel:A(w.axisLabel,!1),axisTick:A(w.axisTick,!1),axisType:"interval",splitLine:A(w.splitLine,!0),splitArea:A(w.splitArea,!0),indicator:[]}}),T=E;f.exports=T}),Dvt=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=fo(),x=Wi(),C=Q3(),w=xa(),A=["axisLine","axisTickLabel","axisName"],E=y.extendComponentView({type:"radar",render:function(T,S,M){var I=this.group;I.removeAll(),this._buildAxes(T),this._buildSplitLineAndArea(T)},_buildAxes:function(T){var S=T.coordinateSystem,M=S.getIndicatorAxes(),I=x.map(M,function(P){var D=new C(P.model,{position:[S.cx,S.cy],rotation:P.angle,labelDirection:-1,tickDirection:-1,nameDirection:1});return D});x.each(I,function(P){x.each(A,P.add,P),this.group.add(P.getGroup())},this)},_buildSplitLineAndArea:function(T){var S=T.coordinateSystem,M=S.getIndicatorAxes();if(!M.length)return;var I=T.get("shape"),P=T.getModel("splitLine"),D=T.getModel("splitArea"),L=P.getModel("lineStyle"),R=D.getModel("areaStyle"),O=P.get("show"),F=D.get("show"),k=L.get("color"),U=R.get("color");k=x.isArray(k)?k:[k],U=x.isArray(U)?U:[U];var G=[],j=[];function q(fe,de,ve){var pe=ve%de.length;return fe[pe]=fe[pe]||[],pe}if(I==="circle")for(var J=M[0].getTicksCoords(),X=S.cx,Y=S.cy,Q=0;Q{Ivt(),Mvt(),Dvt()}),Rvt=xt((o,f)=>{var m=Jg(),v=uU(),y=Wi(),x=fd(),C=x.encodeHTML,w=Xj(),A=m.extend({type:"series.radar",dependencies:["radar"],init:function(T){A.superApply(this,"init",arguments),this.legendVisualProvider=new w(y.bind(this.getData,this),y.bind(this.getRawData,this))},getInitialData:function(T,S){return v(this,{generateCoord:"indicator_",generateCoordCount:1/0})},formatTooltip:function(T){var S=this.getData(),M=this.coordinateSystem,I=M.getIndicatorAxes(),P=this.getData().getName(T);return C(P===""?this.name:P)+"
"+y.map(I,function(D,L){var R=S.get(S.mapDimension(D.dim),T);return C(D.name+" : "+R)}).join("
")},getTooltipPosition:function(T){if(T!=null){for(var S=this.getData(),M=this.coordinateSystem,I=S.getValues(y.map(M.dimensions,function(R){return S.mapDimension(R)}),T,!0),P=0,D=I.length;P{var m=fo(),v=xa(),y=Wi(),x=qw();function C(A){return y.isArray(A)||(A=[+A,+A]),A}var w=m.extendChartView({type:"radar",render:function(A,E,T){var S=A.coordinateSystem,M=this.group,I=A.getData(),P=this._data;function D(O,F){var k=O.getItemVisual(F,"symbol")||"circle",U=O.getItemVisual(F,"color");if(k!=="none"){var G=C(O.getItemVisual(F,"symbolSize")),j=x.createSymbol(k,-1,-1,2,2,U);return j.attr({style:{strokeNoScale:!0},z2:100,scale:[G[0]/2,G[1]/2]}),j}}function L(O,F,k,U,G,j){k.removeAll();for(var q=0;q{var m=Wi();function v(C){C.eachSeriesByType("radar",function(w){var A=w.getData(),E=[],T=w.coordinateSystem;if(T){var S=T.getIndicatorAxes();m.each(S,function(M,I){A.each(A.mapDimension(S[I].dim),function(P,D){E[D]=E[D]||[];var L=T.dataToPoint(P,I);E[D][I]=y(L)?L:x(T)})}),A.each(function(M){var I=m.find(E[M],function(P){return y(P)})||x(T);E[M].push(I.slice()),A.setItemLayout(M,E[M])})}})}function y(C){return!isNaN(C[0])&&!isNaN(C[1])}function x(C){return[C.cx,C.cy]}f.exports=v}),Fvt=xt((o,f)=>{var m=Wi();function v(y){var x=y.polar;if(x){m.isArray(x)||(x=[x]);var C=[];m.each(x,function(w,A){w.indicator?(w.type&&!w.shape&&(w.shape=w.type),y.radar=y.radar||[],m.isArray(y.radar)||(y.radar=[y.radar]),y.radar.push(w)):C.push(w)}),y.polar=C}m.each(y.series,function(w){w&&w.type==="radar"&&w.polarIndex&&(w.radarIndex=w.polarIndex)})}f.exports=v}),Bvt=xt(()=>{var o=fo();Lvt(),Rvt(),Ovt();var f=Die(),m=sB(),v=Nvt(),y=Jj(),x=Fvt();o.registerVisual(f("radar")),o.registerVisual(m("radar","circle")),o.registerLayout(v),o.registerProcessor(y("radar")),o.registerPreprocessor(x)}),kvt=xt((o,f)=>{var m=Wi(),v=eGe(),y=[126,25],x=[[[0,3.5],[7,11.2],[15,11.9],[30,7],[42,.7],[52,.7],[56,7.7],[59,.7],[64,.7],[64,0],[5,0],[0,3.5]],[[13,16.1],[19,14.7],[16,21.7],[11,23.1],[13,16.1]],[[12,32.2],[14,38.5],[15,38.5],[13,32.2],[12,32.2]],[[16,47.6],[12,53.2],[13,53.2],[18,47.6],[16,47.6]],[[6,64.4],[8,70],[9,70],[8,64.4],[6,64.4]],[[23,82.6],[29,79.8],[30,79.8],[25,82.6],[23,82.6]],[[37,70.7],[43,62.3],[44,62.3],[39,70.7],[37,70.7]],[[48,51.1],[51,45.5],[53,45.5],[50,51.1],[48,51.1]],[[51,35],[51,28.7],[53,28.7],[53,35],[51,35]],[[52,22.4],[55,17.5],[56,17.5],[53,22.4],[52,22.4]],[[58,12.6],[62,7],[63,7],[60,12.6],[58,12.6]],[[0,3.5],[0,93.1],[64,93.1],[64,0],[63,0],[63,92.4],[1,92.4],[1,3.5],[0,3.5]]];for(w=0;w{var m={\u5357\u6D77\u8BF8\u5C9B:[32,80],\u5E7F\u4E1C:[0,-10],\u9999\u6E2F:[10,5],\u6FB3\u95E8:[-10,10],\u5929\u6D25:[5,5]};function v(y,x){if(y==="china"){var C=m[x.name];if(C){var w=x.center;w[0]+=C[0]/10.5,w[1]+=-C[1]/(10.5/.75)}}}f.exports=v}),zvt=xt((o,f)=>{var m={Russia:[100,60],"United States":[-99,38],"United States of America":[-99,38]};function v(y,x){if(y==="world"){var C=m[x.name];if(C){var w=x.center;w[0]=C[0],w[1]=C[1]}}}f.exports=v}),Hvt=xt((o,f)=>{var m=[[[123.45165252685547,25.73527164402261],[123.49731445312499,25.73527164402261],[123.49731445312499,25.750734064600884],[123.45165252685547,25.750734064600884],[123.45165252685547,25.73527164402261]]];function v(y,x){y==="china"&&x.name==="\u53F0\u6E7E"&&x.geometries.push({type:"polygon",exterior:m[0]})}f.exports=v}),Uvt=xt((o,f)=>{var m=Wi(),v=m.each,y=tGe(),x=vu(),C=x.makeInner,w=kvt(),A=Vvt(),E=zvt(),T=Hvt(),S=C(),M={load:function(P,D,L){var R=S(D).parsed;if(R)return R;var O=D.specialAreas||{},F=D.geoJSON,k;try{k=F?y(F,L):[]}catch(U){throw new Error(`Invalid geoJson format `+U.message)}return w(P,k),v(k,function(U){var G=U.name;A(P,U),E(P,U),T(P,U);var j=O[G];j&&U.transformTo(j.left,j.top,j.width,j.height)}),S(D).parsed={regions:k,boundingRect:I(k)}}};function I(P){for(var D,L=0;L{var m=q8e(),v=m.parseSVG,y=m.makeViewBoxTransform,x=rB(),C=_0e(),w=Wi(),A=w.assert,E=w.createHashMap,T=Of(),S=vu(),M=S.makeInner,I=M(),P={load:function(L,R){var O=I(R).originRoot;if(O)return{root:O,boundingRect:I(R).boundingRect};var F=D(R);return I(R).originRoot=F.root,I(R).boundingRect=F.boundingRect,F},makeGraphic:function(L,R,O){var F=I(R),k=F.rootMap||(F.rootMap=E()),U=k.get(O);if(U)return U;var G=F.originRoot,j=F.boundingRect;return F.originRootHostKey?U=D(R,j).root:(F.originRootHostKey=O,U=G),k.set(O,U)},removeGraphic:function(L,R,O){var F=I(R),k=F.rootMap;k&&k.removeKey(O),O===F.originRootHostKey&&(F.originRootHostKey=null)}};function D(L,R){var O=L.svgXML,F,k;try{F=O&&v(O,{ignoreViewBox:!0,ignoreRootClip:!0})||{},k=F.root,A(k!=null)}catch(X){throw new Error(`Invalid svg format `+X.message)}var U=F.width,G=F.height,j=F.viewBoxRect;if(R||(R=U==null||G==null?k.getBoundingRect():new T(0,0,0,0),U!=null&&(R.width=U),G!=null&&(R.height=G)),j){var q=y(j,R.width,R.height),J=k;k=new x,k.add(J),J.scale=q.scale,J.position=q.position}return k.setClipPath(new C({shape:R.plain()})),{root:k,boundingRect:R}}f.exports=P}),Lie=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Wi(),x=y.each,C=y.createHashMap,w=b0e(),A=Uvt(),E=Gvt(),T=Of(),S={geoJSON:A,svg:E},M={load:function(D,L,R){var O=[],F=C(),k=C(),U,G=P(D);return x(G,function(j){var q=S[j.type].load(D,j,R);x(q.regions,function(X){var Y=X.name;L&&L.hasOwnProperty(Y)&&(X=X.cloneShallow(Y=L[Y])),O.push(X),F.set(Y,X),k.set(Y,X.center)});var J=q.boundingRect;J&&(U?U.union(J):U=J.clone())}),{regions:O,regionsMap:F,nameCoordMap:k,boundingRect:U||new T(0,0,0,0)}},makeGraphic:I("makeGraphic"),removeGraphic:I("removeGraphic")};function I(D){return function(L,R){var O=P(L),F=[];return x(O,function(k){var U=S[k.type][D];U&&F.push(U(L,k,R))}),F}}function P(D){var L=w.retrieveMap(D)||[];return L}f.exports=M}),Wvt=xt((o,f)=>{var m=Wi(),v=uU(),y=Jg(),x=fd(),C=x.encodeHTML,w=x.addCommas,A=E0e(),E=oB(),T=E.retrieveRawAttr,S=Lie(),M=VM(),I=M.makeSeriesEncodeForNameBased,P=y.extend({type:"series.map",dependencies:["geo"],layoutMode:"box",needsDrawMap:!1,seriesGroup:[],getInitialData:function(L){for(var R=v(this,{coordDimensions:["value"],encodeDefaulter:m.curry(I,this)}),O=R.mapDimension("value"),F=m.createHashMap(),k=[],U=[],G=0,j=R.count();G"+C(F+" : "+O)},getTooltipPosition:function(L){if(L!=null){var R=this.getData().getName(L),O=this.coordinateSystem,F=O.getRegion(R);return F&&O.dataToPoint(F.center)}},setZoom:function(L){this.option.zoom=L},setCenter:function(L){this.option.center=L},defaultOption:{zlevel:0,z:2,coordinateSystem:"geo",map:"",left:"center",top:"center",aspectScale:.75,showLegendSymbol:!0,dataRangeHoverLink:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",areaColor:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{areaColor:"rgba(255,215,0,0.8)"}},nameProperty:"name"}});m.mixin(P,A);var D=P;f.exports=D}),dGe=xt(o=>{var f=fo(),m="\0_ec_interaction_mutex";function v(w,A,E){var T=C(w);T[A]=E}function y(w,A,E){var T=C(w),S=T[A];S===E&&(T[A]=null)}function x(w,A){return!!C(w)[A]}function C(w){return w[m]||(w[m]={})}f.registerAction({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},function(){}),o.take=v,o.release=y,o.isTaken=x}),Kj=xt((o,f)=>{var m=Wi(),v=iB(),y=B2(),x=dGe();function C(L){this.pointerChecker,this._zr=L,this._opt={};var R=m.bind,O=R(w,this),F=R(A,this),k=R(E,this),U=R(T,this),G=R(S,this);v.call(this),this.setPointerChecker=function(j){this.pointerChecker=j},this.enable=function(j,q){this.disable(),this._opt=m.defaults(m.clone(q)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),j==null&&(j=!0),(j===!0||j==="move"||j==="pan")&&(L.on("mousedown",O),L.on("mousemove",F),L.on("mouseup",k)),(j===!0||j==="scale"||j==="zoom")&&(L.on("mousewheel",U),L.on("pinch",G))},this.disable=function(){L.off("mousedown",O),L.off("mousemove",F),L.off("mouseup",k),L.off("mousewheel",U),L.off("pinch",G)},this.dispose=this.disable,this.isDragging=function(){return this._dragging},this.isPinching=function(){return this._pinching}}m.mixin(C,v);function w(L){if(!(y.isMiddleOrRightButtonOnMouseUpDown(L)||L.target&&L.target.draggable)){var R=L.offsetX,O=L.offsetY;this.pointerChecker&&this.pointerChecker(L,R,O)&&(this._x=R,this._y=O,this._dragging=!0)}}function A(L){if(!(!this._dragging||!P("moveOnMouseMove",L,this._opt)||L.gestureEvent==="pinch"||x.isTaken(this._zr,"globalPan"))){var R=L.offsetX,O=L.offsetY,F=this._x,k=this._y,U=R-F,G=O-k;this._x=R,this._y=O,this._opt.preventDefaultMouseMove&&y.stop(L.event),I(this,"pan","moveOnMouseMove",L,{dx:U,dy:G,oldX:F,oldY:k,newX:R,newY:O})}}function E(L){y.isMiddleOrRightButtonOnMouseUpDown(L)||(this._dragging=!1)}function T(L){var R=P("zoomOnMouseWheel",L,this._opt),O=P("moveOnMouseWheel",L,this._opt),F=L.wheelDelta,k=Math.abs(F),U=L.offsetX,G=L.offsetY;if(!(F===0||!R&&!O)){if(R){var j=k>3?1.4:k>1?1.2:1.1,q=F>0?j:1/j;M(this,"zoom","zoomOnMouseWheel",L,{scale:q,originX:U,originY:G})}if(O){var J=Math.abs(F),X=(F>0?1:-1)*(J>3?.4:J>1?.15:.05);M(this,"scrollMove","moveOnMouseWheel",L,{scrollDelta:X,originX:U,originY:G})}}}function S(L){if(!x.isTaken(this._zr,"globalPan")){var R=L.pinchScale>1?1.1:.9090909090909091;M(this,"zoom",null,L,{scale:R,originX:L.pinchX,originY:L.pinchY})}}function M(L,R,O,F,k){L.pointerChecker&&L.pointerChecker(F,k.originX,k.originY)&&(y.stop(F.event),I(L,R,O,F,k))}function I(L,R,O,F,k){k.isAvailableBehavior=m.bind(P,null,O,F),L.trigger(R,k)}function P(L,R,O){var F=O[L];return!L||F&&(!m.isString(F)||R.event[F+"Key"])}var D=C;f.exports=D}),T0e=xt(o=>{function f(v,y,x){var C=v.target,w=C.position;w[0]+=y,w[1]+=x,C.dirty()}function m(v,y,x,C){var w=v.target,A=v.zoomLimit,E=w.position,T=w.scale,S=v.zoom=v.zoom||1;if(S*=y,A){var M=A.min||0,I=A.max||1/0;S=Math.max(Math.min(I,S),M)}var P=S/v.zoom;v.zoom=S,E[0]-=(x-E[0])*(P-1),E[1]-=(C-E[1])*(P-1),T[0]*=P,T[1]*=P,w.dirty()}o.updateViewOnPan=f,o.updateViewOnZoom=m}),Rie=xt(o=>{var f={axisPointer:1,tooltip:1,brush:1};function m(v,y,x){var C=y.getComponentByElement(v.topTarget),w=C&&C.coordinateSystem;return C&&C!==x&&!f[C.mainType]&&w&&w.model!==x}o.onIrrelevantElement=m}),fGe=xt((o,f)=>{var m=Wi(),v=Kj(),y=T0e(),x=Rie(),C=x.onIrrelevantElement,w=xa(),A=Lie(),E=zj(),T=E.getUID,S=vie();function M(R){var O=R.getItemStyle(),F=R.get("areaColor");return F!=null&&(O.fill=F),O}function I(R,O,F,k,U){F.off("click"),F.off("mousedown"),O.get("selectedMode")&&(F.on("mousedown",function(){R._mouseDownFlag=!0}),F.on("click",function(G){if(R._mouseDownFlag){R._mouseDownFlag=!1;for(var j=G.target;!j.__regions;)j=j.parent;if(j){var q={type:(O.mainType==="geo"?"geo":"map")+"ToggleSelect",batch:m.map(j.__regions,function(J){return{name:J.name,from:U.uid}})};q[O.mainType+"Id"]=O.id,k.dispatchAction(q),P(O,F)}}}))}function P(R,O){O.eachChild(function(F){m.each(F.__regions,function(k){F.trigger(R.isSelected(k.name)?"emphasis":"normal")})})}function D(R,O){var F=new w.Group;this.uid=T("ec_map_draw"),this._controller=new v(R.getZr()),this._controllerHost={target:O?F:null},this.group=F,this._updateGroup=O,this._mouseDownFlag,this._mapName,this._initialized,F.add(this._regionsGroup=new w.Group),F.add(this._backgroundGroup=new w.Group)}D.prototype={constructor:D,draw:function(R,O,F,k,U){var G=R.mainType==="geo",j=R.getData&&R.getData();G&&O.eachComponent({mainType:"series",subType:"map"},function(ve){!j&&ve.getHostGeoModel()===R&&(j=ve.getData())});var q=R.coordinateSystem;this._updateBackground(q);var J=this._regionsGroup,X=this.group,Y=q.getTransformInfo(),Q=!J.childAt(0)||U,ee;if(Q)X.transform=Y.roamTransform,X.decomposeTransform(),X.dirty();else{var z=new S;z.transform=Y.roamTransform,z.decomposeTransform();var ie={scale:z.scale,position:z.position};ee=z.scale,w.updateProps(X,ie,R)}var re=Y.rawScale,ne=Y.rawPosition;J.removeAll();var oe=["itemStyle"],se=["emphasis","itemStyle"],ae=["label"],fe=["emphasis","label"],de=m.createHashMap();m.each(q.regions,function(ve){var pe=de.get(ve.name)||de.set(ve.name,new w.Group),ce=new w.CompoundPath({segmentIgnoreThreshold:1,shape:{paths:[]}});pe.add(ce);var he=R.getRegionModel(ve.name)||R,Ce=he.getModel(oe),Se=he.getModel(se),De=M(Ce),Oe=M(Se),Ue=he.getModel(ae),Xe=he.getModel(fe),it;if(j){it=j.indexOfName(ve.name);var ut=j.getItemVisual(it,"color",!0);ut&&(De.fill=ut)}var at=function(Jt){return[Jt[0]*re[0]+ne[0],Jt[1]*re[1]+ne[1]]};m.each(ve.geometries,function(Jt){if(Jt.type==="polygon"){for(var bi=[],Yi=0;Yi=0)&&(At=R);var bt=new w.Text({position:at(ve.center.slice()),scale:[1/X.scale[0],1/X.scale[1]],z2:10,silent:!0});if(w.setLabelStyle(bt.style,bt.hoverStyle={},Ue,Xe,{labelFetcher:At,labelDataIndex:Xt,defaultText:ve.name,useInsideStyle:!1},{textAlign:"center",textVerticalAlign:"middle"}),!Q){var gt=[1/ee[0],1/ee[1]];w.updateProps(bt,{scale:gt},R)}pe.add(bt)}if(j)j.setItemGraphicEl(it,pe);else{var he=R.getRegionModel(ve.name);ce.eventData={componentType:"geo",componentIndex:R.componentIndex,geoIndex:R.componentIndex,name:ve.name,region:he&&he.option||{}}}var It=pe.__regions||(pe.__regions=[]);It.push(ve),pe.highDownSilentOnTouch=!!R.get("selectedMode"),w.setHoverStyle(pe,Oe),J.add(pe)}),this._updateController(R,O,F),I(this,R,J,F,k),P(R,J)},remove:function(){this._regionsGroup.removeAll(),this._backgroundGroup.removeAll(),this._controller.dispose(),this._mapName&&A.removeGraphic(this._mapName,this.uid),this._mapName=null,this._controllerHost={}},_updateBackground:function(R){var O=R.map;this._mapName!==O&&m.each(A.makeGraphic(O,this.uid),function(F){this._backgroundGroup.add(F)},this),this._mapName=O},_updateController:function(R,O,F){var k=R.coordinateSystem,U=this._controller,G=this._controllerHost;G.zoomLimit=R.get("scaleLimit"),G.zoom=k.getZoom(),U.enable(R.get("roam")||!1);var j=R.mainType;function q(){var J={type:"geoRoam",componentType:j};return J[j+"Id"]=R.id,J}U.off("pan").on("pan",function(J){this._mouseDownFlag=!1,y.updateViewOnPan(G,J.dx,J.dy),F.dispatchAction(m.extend(q(),{dx:J.dx,dy:J.dy}))},this),U.off("zoom").on("zoom",function(J){if(this._mouseDownFlag=!1,y.updateViewOnZoom(G,J.scale,J.originX,J.originY),F.dispatchAction(m.extend(q(),{zoom:J.scale,originX:J.originX,originY:J.originY})),this._updateGroup){var X=this.group.scale;this._regionsGroup.traverse(function(Y){Y.type==="text"&&Y.attr("scale",[1/X[0],1/X[1]])})}},this),U.setPointerChecker(function(J,X,Y){return k.getViewRectAfterRoam().contain(X,Y)&&!C(J,F,R)})}};var L=D;f.exports=L}),jvt=xt((o,f)=>{var m=fo(),v=Wi(),y=xa(),x=fGe(),C="__seriesMapHighDown",w="__seriesMapCallKey",A=m.extendChartView({type:"map",render:function(S,M,I,P){if(!(P&&P.type==="mapToggleSelect"&&P.from===this.uid)){var D=this.group;if(D.removeAll(),!S.getHostGeoModel()){if(P&&P.type==="geoRoam"&&P.componentType==="series"&&P.seriesId===S.id){var L=this._mapDraw;L&&D.add(L.group)}else if(S.needsDrawMap){var L=this._mapDraw||new x(I,!0);D.add(L.group),L.draw(S,M,I,this,P),this._mapDraw=L}else this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null;S.get("showLegendSymbol")&&M.getComponent("legend")&&this._renderSymbols(S,M,I)}}},remove:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null,this.group.removeAll()},dispose:function(){this._mapDraw&&this._mapDraw.remove(),this._mapDraw=null},_renderSymbols:function(S,M,I){var P=S.originalData,D=this.group;P.each(P.mapDimension("value"),function(L,R){if(!isNaN(L)){var O=P.getItemLayout(R);if(!(!O||!O.point)){var F=O.point,k=O.offset,U=new y.Circle({style:{fill:S.getData().getVisual("color")},shape:{cx:F[0]+k*9,cy:F[1],r:3},silent:!0,z2:8+(k?0:y.Z2_EMPHASIS_LIFT+1)});if(!k){var G=S.mainSeries.getData(),j=P.getName(R),q=G.indexOfName(j),J=P.getItemModel(R),X=J.getModel("label"),Y=J.getModel("emphasis.label"),Q=G.getItemGraphicEl(q),ee=v.retrieve2(S.getFormattedLabel(q,"normal"),j),z=v.retrieve2(S.getFormattedLabel(q,"emphasis"),ee),ie=Q[C],re=Math.random();if(!ie){ie=Q[C]={};var ne=v.curry(E,!0),oe=v.curry(E,!1);Q.on("mouseover",ne).on("mouseout",oe).on("emphasis",ne).on("normal",oe)}Q[w]=re,v.extend(ie,{recordVersion:re,circle:U,labelModel:X,hoverLabelModel:Y,emphasisText:z,normalText:ee}),T(ie,!1)}D.add(U)}}})}});function E(S){var M=this[C];M&&M.recordVersion===this[w]&&T(M,S)}function T(S,M){var I=S.circle,P=S.labelModel,D=S.hoverLabelModel,L=S.emphasisText,R=S.normalText;M?(I.style.extendFrom(y.setTextStyle({},D,{text:D.get("show")?L:null},{isRectText:!0,useInsideStyle:!1},!0)),I.__mapOriginalZ2=I.z2,I.z2+=y.Z2_EMPHASIS_LIFT):(y.setTextStyle(I.style,P,{text:P.get("show")?R:null,textPosition:P.getShallow("position")||"bottom"},{isRectText:!0,useInsideStyle:!1}),I.dirty(!1),I.__mapOriginalZ2!=null&&(I.z2=I.__mapOriginalZ2,I.__mapOriginalZ2=null))}f.exports=A}),S0e=xt(o=>{function f(m,v,y){var x=m.getZoom(),C=m.getCenter(),w=v.zoom,A=m.dataToPoint(C);if(v.dx!=null&&v.dy!=null){A[0]-=v.dx,A[1]-=v.dy;var C=m.pointToData(A);m.setCenter(C)}if(w!=null){if(y){var E=y.min||0,T=y.max||1/0;w=Math.max(Math.min(x*w,T),E)/x}m.scale[0]*=w,m.scale[1]*=w;var S=m.position,M=(v.originX-S[0])*(w-1),I=(v.originY-S[1])*(w-1);S[0]-=M,S[1]-=I,m.updateTransform();var C=m.pointToData(A);m.setCenter(C),m.setZoom(w*x)}return{center:m.getCenter(),zoom:m.getZoom()}}o.updateCenterAndZoom=f}),pGe=xt(()=>{var o=fo(),f=Wi(),m=S0e(),v=m.updateCenterAndZoom;o.registerAction({type:"geoRoam",event:"geoRoam",update:"updateTransform"},function(y,x){var C=y.componentType||"series";x.eachComponent({mainType:C,query:y},function(w){var A=w.coordinateSystem;if(A.type==="geo"){var E=v(A,y,w.get("scaleLimit"));w.setCenter&&w.setCenter(E.center),w.setZoom&&w.setZoom(E.zoom),C==="series"&&f.each(w.seriesGroup,function(T){T.setCenter(E.center),T.setZoom(E.zoom)})}})})}),P0e=xt((o,f)=>{var m=Wi(),v=lf(),y=Ky(),x=Of(),C=vie(),w=v.applyTransform;function A(){C.call(this)}m.mixin(A,C);function E(M){this.name=M,this.zoomLimit,C.call(this),this._roamTransformable=new A,this._rawTransformable=new A,this._center,this._zoom}E.prototype={constructor:E,type:"view",dimensions:["x","y"],setBoundingRect:function(M,I,P,D){return this._rect=new x(M,I,P,D),this._rect},getBoundingRect:function(){return this._rect},setViewRect:function(M,I,P,D){this.transformTo(M,I,P,D),this._viewRect=new x(M,I,P,D)},transformTo:function(M,I,P,D){var L=this.getBoundingRect(),R=this._rawTransformable;R.transform=L.calculateTransform(new x(M,I,P,D)),R.decomposeTransform(),this._updateTransform()},setCenter:function(M){M&&(this._center=M,this._updateCenterAndZoom())},setZoom:function(M){M=M||1;var I=this.zoomLimit;I&&(I.max!=null&&(M=Math.min(I.max,M)),I.min!=null&&(M=Math.max(I.min,M))),this._zoom=M,this._updateCenterAndZoom()},getDefaultCenter:function(){var M=this.getBoundingRect(),I=M.x+M.width/2,P=M.y+M.height/2;return[I,P]},getCenter:function(){return this._center||this.getDefaultCenter()},getZoom:function(){return this._zoom||1},getRoamTransform:function(){return this._roamTransformable.getLocalTransform()},_updateCenterAndZoom:function(){var M=this._rawTransformable.getLocalTransform(),I=this._roamTransformable,P=this.getDefaultCenter(),D=this.getCenter(),L=this.getZoom();D=v.applyTransform([],D,M),P=v.applyTransform([],P,M),I.origin=D,I.position=[P[0]-D[0],P[1]-D[1]],I.scale=[L,L],this._updateTransform()},_updateTransform:function(){var M=this._roamTransformable,I=this._rawTransformable;I.parent=M,M.updateTransform(),I.updateTransform(),y.copy(this.transform||(this.transform=[]),I.transform||y.create()),this._rawTransform=I.getLocalTransform(),this.invTransform=this.invTransform||[],y.invert(this.invTransform,this.transform),this.decomposeTransform()},getTransformInfo:function(){var M=this._roamTransformable.transform,I=this._rawTransformable;return{roamTransform:M?m.slice(M):y.create(),rawScale:m.slice(I.scale),rawPosition:m.slice(I.position)}},getViewRect:function(){return this._viewRect},getViewRectAfterRoam:function(){var M=this.getBoundingRect().clone();return M.applyTransform(this.transform),M},dataToPoint:function(M,I,P){var D=I?this._rawTransform:this.transform;return P=P||[],D?w(P,M,D):v.copy(P,M)},pointToData:function(M){var I=this.invTransform;return I?w([],M,I):[M[0],M[1]]},convertToPixel:m.curry(T,"dataToPoint"),convertFromPixel:m.curry(T,"pointToData"),containPoint:function(M){return this.getViewRectAfterRoam().contain(M[0],M[1])}},m.mixin(E,C);function T(M,I,P,D){var L=P.seriesModel,R=L?L.coordinateSystem:null;return R===this?R[M](D):null}var S=E;f.exports=S}),Yvt=xt((o,f)=>{var m=Wi(),v=Of(),y=P0e(),x=Lie();function C(E,T,S,M){y.call(this,E),this.map=T;var I=x.load(T,S);this._nameCoordMap=I.nameCoordMap,this._regionsMap=I.regionsMap,this._invertLongitute=M??!0,this.regions=I.regions,this._rect=I.boundingRect}C.prototype={constructor:C,type:"geo",dimensions:["lng","lat"],containCoord:function(E){for(var T=this.regions,S=0;S{var m=Ac(),v=m.__DEV__,y=fo(),x=Wi(),C=Yvt(),w=rd(),A=il(),E=Lie(),T=b0e();function S(D,L){var R=D.get("boundingCoords");if(R!=null){var O=R[0],F=R[1];isNaN(O[0])||isNaN(O[1])||isNaN(F[0])||isNaN(F[1])||this.setBoundingRect(O[0],O[1],F[0]-O[0],F[1]-O[1])}var k=this.getBoundingRect(),U,G=D.get("layoutCenter"),j=D.get("layoutSize"),q=L.getWidth(),J=L.getHeight(),X=k.width/k.height*this.aspectScale,Y=!1;G&&j&&(G=[A.parsePercent(G[0],q),A.parsePercent(G[1],J)],j=A.parsePercent(j,Math.min(q,J)),!isNaN(G[0])&&!isNaN(G[1])&&!isNaN(j)&&(Y=!0));var Q;if(Y){var Q={};X>1?(Q.width=j,Q.height=j/X):(Q.height=j,Q.width=j*X),Q.y=G[1]-Q.height/2,Q.x=G[0]-Q.width/2}else U=D.getBoxLayoutParams(),U.aspect=X,Q=w.getLayoutRect(U,{width:q,height:J});this.setViewRect(Q.x,Q.y,Q.width,Q.height),this.setCenter(D.get("center")),this.setZoom(D.get("zoom"))}function M(D,L){x.each(L.get("geoCoord"),function(R,O){D.addGeoCoord(O,R)})}var I={dimensions:C.prototype.dimensions,create:function(D,L){var R=[];D.eachComponent("geo",function(F,k){var U=F.get("map"),G=F.get("aspectScale"),j=!0,q=T.retrieveMap(U);q&&q[0]&&q[0].type==="svg"?(G==null&&(G=1),j=!1):G==null&&(G=.75);var J=new C(U+k,U,F.get("nameMap"),j);J.aspectScale=G,J.zoomLimit=F.get("scaleLimit"),R.push(J),M(J,F),F.coordinateSystem=J,J.model=F,J.resize=S,J.resize(F,L)}),D.eachSeries(function(F){var k=F.get("coordinateSystem");if(k==="geo"){var U=F.get("geoIndex")||0;F.coordinateSystem=R[U]}});var O={};return D.eachSeriesByType("map",function(F){if(!F.getHostGeoModel()){var k=F.getMapType();O[k]=O[k]||[],O[k].push(F)}}),x.each(O,function(F,k){var U=x.map(F,function(j){return j.get("nameMap")}),G=new C(k,k,x.mergeAll(U));G.zoomLimit=x.retrieve.apply(null,x.map(F,function(j){return j.get("scaleLimit")})),R.push(G),G.resize=S,G.aspectScale=F[0].get("aspectScale"),G.resize(F[0],L),x.each(F,function(j){j.coordinateSystem=G,M(G,j)})}),R},getFilledRegions:function(D,L,R){for(var O=(D||[]).slice(),F=x.createHashMap(),k=0;k{var m=Wi();function v(y){var x={};y.eachSeriesByType("map",function(C){var w=C.getMapType();if(!(C.getHostGeoModel()||x[w])){var A={};m.each(C.seriesGroup,function(T){var S=T.coordinateSystem,M=T.originalData;T.get("showLegendSymbol")&&y.getComponent("legend")&&M.each(M.mapDimension("value"),function(I,P){var D=M.getName(P),L=S.getRegion(D);if(!(!L||isNaN(I))){var R=A[D]||0,O=S.dataToPoint(L.center);A[D]=R+1,M.setItemLayout(P,{point:O,offset:R})}})});var E=C.getData();E.each(function(T){var S=E.getName(T),M=E.getItemLayout(T)||{};M.showLabel=!A[S],E.setItemLayout(T,M)}),x[w]=!0}})}f.exports=v}),Xvt=xt((o,f)=>{function m(v){v.eachSeriesByType("map",function(y){var x=y.get("color"),C=y.getModel("itemStyle"),w=C.get("areaColor"),A=C.get("color")||x[y.seriesIndex%x.length];y.getData().setVisual({areaColor:w,color:A})})}f.exports=m}),Jvt=xt((o,f)=>{var m=Wi();function v(x,C){var w={};return m.each(x,function(A){A.each(A.mapDimension("value"),function(E,T){var S="ec-"+A.getName(T);w[S]=w[S]||[],isNaN(E)||w[S].push(E)})}),x[0].map(x[0].mapDimension("value"),function(A,E){for(var T="ec-"+x[0].getName(E),S=0,M=1/0,I=-1/0,P=w[T].length,D=0;D{var m=Wi();function v(y){var x=[];m.each(y.series,function(C){C&&C.type==="map"&&(x.push(C),C.map=C.map||C.mapType,m.defaults(C,C.mapLocation))})}f.exports=v}),Qvt=xt(()=>{var o=fo();Wvt(),jvt(),pGe(),I0e();var f=qvt(),m=Xvt(),v=Jvt(),y=Kvt(),x=hGe();o.registerLayout(f),o.registerVisual(m),o.registerProcessor(o.PRIORITY.PROCESSOR.STATISTIC,v),o.registerPreprocessor(y),x("map",[{type:"mapToggleSelect",event:"mapselectchanged",method:"toggleSelected"},{type:"mapSelect",event:"mapselected",method:"select"},{type:"mapUnSelect",event:"mapunselected",method:"unSelect"}])}),mGe=xt((o,f)=>{var m=Wi(),v=m.each,y="\0__link_datas",x="\0__link_mainData";function C(D){var L=D.mainData,R=D.datas;R||(R={main:L},D.datasAttr={main:"data"}),D.datas=D.mainData=null,M(L,R,D),v(R,function(O){v(L.TRANSFERABLE_METHODS,function(F){O.wrapMethod(F,m.curry(w,D))})}),L.wrapMethod("cloneShallow",m.curry(E,D)),v(L.CHANGABLE_METHODS,function(O){L.wrapMethod(O,m.curry(A,D))}),m.assert(R[L.dataType]===L)}function w(D,L){if(S(this)){var R=m.extend({},this[y]);R[this.dataType]=L,M(L,R,D)}else I(L,this.dataType,this[x],D);return L}function A(D,L){return D.struct&&D.struct.update(this),L}function E(D,L){return v(L[y],function(R,O){R!==L&&I(R.cloneShallow(),O,L,D)}),L}function T(D){var L=this[x];return D==null||L==null?L:L[y][D]}function S(D){return D[x]===D}function M(D,L,R){D[y]={},v(L,function(O,F){I(O,F,D,R)})}function I(D,L,R,O){R[y][L]=D,D[x]=R,D.dataType=L,O.struct&&(D[O.structAttr]=O.struct,O.struct[O.datasAttr[L]]=D),D.getLinkedData=T}var P=C;f.exports=P}),M0e=xt((o,f)=>{var m=Wi(),v=Sm(),y=mGe(),x=Yw(),C=sU(),w=function(S,M){this.name=S||"",this.depth=0,this.height=0,this.parentNode=null,this.dataIndex=-1,this.children=[],this.viewChildren=[],this.hostTree=M};w.prototype={constructor:w,isRemoved:function(){return this.dataIndex<0},eachNode:function(S,M,I){typeof S=="function"&&(I=M,M=S,S=null),S=S||{},m.isString(S)&&(S={order:S});var P=S.order||"preorder",D=this[S.attr||"children"],L;P==="preorder"&&(L=M.call(I,this));for(var R=0;!L&&RM&&(M=P.height)}this.height=M+1},getNodeById:function(S){if(this.getId()===S)return this;for(var M=0,I=this.children,P=I.length;M=0&&this.hostTree.data.setItemLayout(this.dataIndex,S,M)},getLayout:function(){return this.hostTree.data.getItemLayout(this.dataIndex)},getModel:function(S){if(!(this.dataIndex<0)){var M=this.hostTree,I=M.data.getItemModel(this.dataIndex),P=this.getLevelModel();return P?I.getModel(S,P.getModel(S)):I.getModel(S)}},getLevelModel:function(){return(this.hostTree.levelModels||[])[this.depth]},setVisual:function(S,M){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,S,M)},getVisual:function(S,M){return this.hostTree.data.getItemVisual(this.dataIndex,S,M)},getRawIndex:function(){return this.hostTree.data.getRawIndex(this.dataIndex)},getId:function(){return this.hostTree.data.getId(this.dataIndex)},isAncestorOf:function(S){for(var M=S.parentNode;M;){if(M===this)return!0;M=M.parentNode}return!1},isDescendantOf:function(S){return S!==this&&S.isAncestorOf(this)}};function A(S,M){this.root,this.data,this._nodes=[],this.hostModel=S,this.levelModels=m.map(M||[],function(I){return new v(I,S,S.ecModel)})}A.prototype={constructor:A,type:"tree",eachNode:function(S,M,I){this.root.eachNode(S,M,I)},getNodeByDataIndex:function(S){var M=this.data.getRawIndex(S);return this._nodes[M]},getNodeByName:function(S){return this.root.getNodeByName(S)},update:function(){for(var S=this.data,M=this._nodes,I=0,P=M.length;I{var m=Jg(),v=M0e(),y=fd(),x=y.encodeHTML,C=Sm(),w=m.extend({type:"series.tree",layoutInfo:null,layoutMode:"box",getInitialData:function(A){var E={name:A.name,children:A.data},T=A.leaves||{},S=new C(T,this,this.ecModel),M=v.createTree(E,this,{},I);function I(R){R.wrapMethod("getItemModel",function(O,F){var k=M.getNodeByDataIndex(F);return(!k.children.length||!k.isExpand)&&(O.parentModel=S),O})}var P=0;M.eachNode("preorder",function(R){R.depth>P&&(P=R.depth)});var D=A.expandAndCollapse,L=D&&A.initialTreeDepth>=0?A.initialTreeDepth:P;return M.root.eachNode("preorder",function(R){var O=R.hostTree.data.getRawDataItem(R.dataIndex);R.isExpand=O&&O.collapsed!=null?!O.collapsed:R.depth<=L}),M.data},getOrient:function(){var A=this.get("orient");return A==="horizontal"?A="LR":A==="vertical"&&(A="TB"),A},setZoom:function(A){this.option.zoom=A},setCenter:function(A){this.option.center=A},formatTooltip:function(A){for(var E=this.getData().tree,T=E.root.children[0],S=E.getNodeByDataIndex(A),M=S.getValue(),I=S.name;S&&S!==T;)I=S.parentNode.name+"."+I,S=S.parentNode;return x(I+(isNaN(M)||M==null?"":" : "+M))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",left:"12%",top:"12%",right:"12%",bottom:"12%",layout:"orthogonal",edgeShape:"curve",edgeForkPosition:"50%",roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:"LR",symbol:"emptyCircle",symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:"#ccc",width:1.5,curveness:.5},itemStyle:{color:"lightsteelblue",borderColor:"#c23531",borderWidth:1.5},label:{show:!0,color:"#555"},leaves:{label:{show:!0}},animationEasing:"linear",animationDuration:700,animationDurationUpdate:1e3}});f.exports=w}),gGe=xt(o=>{var f=rd();function m(D){D.hierNode={defaultAncestor:null,ancestor:D,prelim:0,modifier:0,change:0,shift:0,i:0,thread:null};for(var L=[D],R,O;R=L.pop();)if(O=R.children,R.isExpand&&O.length)for(var F=O.length,k=F-1;k>=0;k--){var U=O[k];U.hierNode={defaultAncestor:null,ancestor:U,prelim:0,modifier:0,change:0,shift:0,i:k,thread:null},L.push(U)}}function v(D,L){var R=D.isExpand?D.children:[],O=D.parentNode.children,F=D.hierNode.i?O[D.hierNode.i-1]:null;if(R.length){A(D);var k=(R[0].hierNode.prelim+R[R.length-1].hierNode.prelim)/2;F?(D.hierNode.prelim=F.hierNode.prelim+L(D,F),D.hierNode.modifier=D.hierNode.prelim-k):D.hierNode.prelim=k}else F&&(D.hierNode.prelim=F.hierNode.prelim+L(D,F));D.parentNode.hierNode.defaultAncestor=E(D,F,D.parentNode.hierNode.defaultAncestor||O[0],L)}function y(D){var L=D.hierNode.prelim+D.parentNode.hierNode.modifier;D.setLayout({x:L},!0),D.hierNode.modifier+=D.parentNode.hierNode.modifier}function x(D){return arguments.length?D:P}function C(D,L){var R={};return D-=Math.PI/2,R.x=L*Math.cos(D),R.y=L*Math.sin(D),R}function w(D,L){return f.getLayoutRect(D.getBoxLayoutParams(),{width:L.getWidth(),height:L.getHeight()})}function A(D){for(var L=D.children,R=L.length,O=0,F=0;--R>=0;){var k=L[R];k.hierNode.prelim+=O,k.hierNode.modifier+=O,F+=k.hierNode.change,O+=k.hierNode.shift+F}}function E(D,L,R,O){if(L){for(var F=D,k=D,U=k.parentNode.children[0],G=L,j=F.hierNode.modifier,q=k.hierNode.modifier,J=U.hierNode.modifier,X=G.hierNode.modifier;G=T(G),k=S(k),G&&k;){F=T(F),U=S(U),F.hierNode.ancestor=D;var Y=G.hierNode.prelim+X-k.hierNode.prelim-q+O(G,k);Y>0&&(I(M(G,D,R),D,Y),q+=Y,j+=Y),X+=G.hierNode.modifier,q+=k.hierNode.modifier,j+=F.hierNode.modifier,J+=U.hierNode.modifier}G&&!T(F)&&(F.hierNode.thread=G,F.hierNode.modifier+=X-j),k&&!S(U)&&(U.hierNode.thread=k,U.hierNode.modifier+=q-J,R=D)}return R}function T(D){var L=D.children;return L.length&&D.isExpand?L[L.length-1]:D.hierNode.thread}function S(D){var L=D.children;return L.length&&D.isExpand?L[0]:D.hierNode.thread}function M(D,L,R){return D.hierNode.ancestor.parentNode===L.parentNode?D.hierNode.ancestor:R}function I(D,L,R){var O=R/(L.hierNode.i-D.hierNode.i);L.hierNode.change-=O,L.hierNode.shift+=R,L.hierNode.modifier+=R,L.hierNode.prelim+=R,D.hierNode.change+=O}function P(D,L){return D.parentNode===L.parentNode?1:2}o.init=m,o.firstWalk=v,o.secondWalk=y,o.separation=x,o.radialCoordinate=C,o.getViewRect=w}),$vt=xt((o,f)=>{var m=Wi(),v=xa(),y=Pie(),x=gGe(),C=x.radialCoordinate,w=fo(),A=Vj(),E=P0e(),T=T0e(),S=Kj(),M=Rie(),I=M.onIrrelevantElement,P=Ac(),D=P.__DEV__,L=il(),R=L.parsePercent,O=v.extendShape({shape:{parentPoint:[],childPoints:[],orient:"",forkPosition:""},style:{stroke:"#000",fill:null},buildPath:function(X,Y){var Q=Y.childPoints,ee=Q.length,z=Y.parentPoint,ie=Q[0],re=Q[ee-1];if(ee===1){X.moveTo(z[0],z[1]),X.lineTo(ie[0],ie[1]);return}var ne=Y.orient,oe=ne==="TB"||ne==="BT"?0:1,se=1-oe,ae=R(Y.forkPosition,1),fe=[];fe[oe]=z[oe],fe[se]=z[se]+(re[se]-z[se])*ae,X.moveTo(z[0],z[1]),X.lineTo(fe[0],fe[1]),X.moveTo(ie[0],ie[1]),fe[oe]=ie[oe],X.lineTo(fe[0],fe[1]),fe[oe]=re[oe],X.lineTo(fe[0],fe[1]),X.lineTo(re[0],re[1]);for(var de=1;deSe.x,Ue||(Oe=Oe-Math.PI));var it=Ue?"left":"right",ut=se.labelModel.get("rotate"),at=ut*(Math.PI/180);he.setStyle({textPosition:se.labelModel.get("position")||it,textRotation:ut==null?-Oe:at,textOrigin:"center",verticalAlign:"middle"})}j(z,ne,ae,Q,pe,ve,ce,ee,se)}function j(X,Y,Q,ee,z,ie,re,ne,oe){var se=oe.edgeShape,ae=ee.__edge;if(se==="curve")Y.parentNode&&Y.parentNode!==Q&&(ae||(ae=ee.__edge=new v.BezierCurve({shape:J(oe,z,z),style:m.defaults({opacity:0,strokeNoScale:!0},oe.lineStyle)})),v.updateProps(ae,{shape:J(oe,ie,re),style:{opacity:1}},X));else if(se==="polyline"&&oe.layout==="orthogonal"&&Y!==Q&&Y.children&&Y.children.length!==0&&Y.isExpand===!0){for(var fe=Y.children,de=[],ve=0;ve{var o=fo(),f=S0e(),m=f.updateCenterAndZoom;o.registerAction({type:"treeExpandAndCollapse",event:"treeExpandAndCollapse",update:"update"},function(v,y){y.eachComponent({mainType:"series",subType:"tree",query:v},function(x){var C=v.dataIndex,w=x.getData().tree,A=w.getNodeByDataIndex(C);A.isExpand=!A.isExpand})}),o.registerAction({type:"treeRoam",event:"treeRoam",update:"none"},function(v,y){y.eachComponent({mainType:"series",subType:"tree",query:v},function(x){var C=x.coordinateSystem,w=m(C,v);x.setCenter&&x.setCenter(w.center),x.setZoom&&x.setZoom(w.zoom)})})}),tyt=xt(o=>{function f(v,y,x){for(var C=[v],w=[],A;A=C.pop();)if(w.push(A),A.isExpand){var E=A.children;if(E.length)for(var T=0;T=0;A--)x.push(w[A])}}o.eachAfter=f,o.eachBefore=m}),iyt=xt((o,f)=>{var m=tyt(),v=m.eachAfter,y=m.eachBefore,x=gGe(),C=x.init,w=x.firstWalk,A=x.secondWalk,E=x.separation,T=x.radialCoordinate,S=x.getViewRect;function M(P,D){P.eachSeriesByType("tree",function(L){I(L,D)})}function I(P,D){var L=S(P,D);P.layoutInfo=L;var R=P.get("layout"),O=0,F=0,k=null;R==="radial"?(O=2*Math.PI,F=Math.min(L.height,L.width)/2,k=E(function(ne,oe){return(ne.parentNode===oe.parentNode?1:2)/ne.depth})):(O=L.width,F=L.height,k=E());var U=P.getData().tree.root,G=U.children[0];if(G){C(U),v(G,w,k),U.hierNode.modifier=-G.hierNode.prelim,y(G,A);var j=G,q=G,J=G;y(G,function(ne){var oe=ne.getLayout().x;oeq.getLayout().x&&(q=ne),ne.depth>J.depth&&(J=ne)});var X=j===q?1:k(j,q)/2,Y=X-j.getLayout().x,Q=0,ee=0,z=0,ie=0;if(R==="radial")Q=O/(q.getLayout().x+X+Y),ee=F/(J.depth-1||1),y(G,function(ne){z=(ne.getLayout().x+Y)*Q,ie=(ne.depth-1)*ee;var oe=T(z,ie);ne.setLayout({x:oe.x,y:oe.y,rawX:z,rawY:ie},!0)});else{var re=P.getOrient();re==="RL"||re==="LR"?(ee=F/(q.getLayout().x+X+Y),Q=O/(J.depth-1||1),y(G,function(ne){ie=(ne.getLayout().x+Y)*ee,z=re==="LR"?(ne.depth-1)*Q:O-(ne.depth-1)*Q,ne.setLayout({x:z,y:ie},!0)})):(re==="TB"||re==="BT")&&(Q=O/(q.getLayout().x+X+Y),ee=F/(J.depth-1||1),y(G,function(ne){z=(ne.getLayout().x+Y)*Q,ie=re==="TB"?(ne.depth-1)*ee:F-(ne.depth-1)*ee,ne.setLayout({x:z,y:ie},!0)}))}}}f.exports=M}),ryt=xt(()=>{var o=fo();Zvt(),$vt(),eyt();var f=sB(),m=iyt();o.registerVisual(f("tree","circle")),o.registerLayout(m)}),uB=xt(o=>{var f=Wi();function m(C,w,A){if(C&&f.indexOf(w,C.type)>=0){var E=A.getData().tree.root,T=C.targetNode;if(typeof T=="string"&&(T=E.getNodeById(T)),T&&E.contains(T))return{node:T};var S=C.targetNodeId;if(S!=null&&(T=E.getNodeById(S)))return{node:T}}}function v(C){for(var w=[];C;)C=C.parentNode,C&&w.push(C);return w.reverse()}function y(C,w){var A=v(C);return f.indexOf(A,w)>=0}function x(C,w){for(var A=[];C;){var E=C.dataIndex;A.push({name:C.name,dataIndex:E,value:w.getRawValue(E)}),C=C.parentNode}return A.reverse(),A}o.retrieveTargetInfo=m,o.getPathToRoot=v,o.aboveViewRoot=y,o.wrapTreePathInfo=x}),nyt=xt((o,f)=>{var m=Wi(),v=Jg(),y=M0e(),x=Sm(),C=fd(),w=C.encodeHTML,A=C.addCommas,E=uB(),T=E.wrapTreePathInfo,S=v.extend({type:"series.treemap",layoutMode:"box",dependencies:["grid","polar"],preventUsingHoverLayer:!0,_viewRoot:null,defaultOption:{progressive:0,left:"center",top:"middle",right:null,bottom:null,width:"80%",height:"80%",sort:!0,clipWindow:"origin",squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:"\u25B6",zoomToNodeRatio:.32*.32,roam:!0,nodeClick:"zoomToNode",animation:!0,animationDurationUpdate:900,animationEasing:"quinticInOut",breadcrumb:{show:!0,height:22,left:"center",top:"bottom",emptyItemWidth:25,itemStyle:{color:"rgba(0,0,0,0.7)",borderColor:"rgba(255,255,255,0.7)",borderWidth:1,shadowColor:"rgba(150,150,150,1)",shadowBlur:3,shadowOffsetX:0,shadowOffsetY:0,textStyle:{color:"#fff"}},emphasis:{textStyle:{}}},label:{show:!0,distance:0,padding:5,position:"inside",color:"#fff",ellipsis:!0},upperLabel:{show:!1,position:[0,"50%"],height:20,color:"#fff",ellipsis:!0,verticalAlign:"middle"},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:"#fff",borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,"50%"],color:"#fff",ellipsis:!0,verticalAlign:"middle"}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:"index",visibleMin:10,childrenVisibleMin:null,levels:[]},getInitialData:function(P,D){var L={name:P.name,children:P.data};M(L);var R=P.levels||[];R=P.levels=I(R,D);var O=m.map(R||[],function(U){return new x(U,this,D)},this),F=y.createTree(L,this,null,k);function k(U){U.wrapMethod("getItemModel",function(G,j){var q=F.getNodeByDataIndex(j),J=O[q.depth];return J&&(G.parentModel=J),G})}return F.data},optionUpdated:function(){this.resetViewRoot()},formatTooltip:function(P){var D=this.getData(),L=this.getRawValue(P),R=m.isArray(L)?A(L[0]):A(L),O=D.getName(P);return w(O+": "+R)},getDataParams:function(P){var D=v.prototype.getDataParams.apply(this,arguments),L=this.getData().tree.getNodeByDataIndex(P);return D.treePathInfo=T(L,this),D},setLayoutInfo:function(P){this.layoutInfo=this.layoutInfo||{},m.extend(this.layoutInfo,P)},mapIdToIndex:function(P){var D=this._idIndexMap;D||(D=this._idIndexMap=m.createHashMap(),this._idIndexMapCount=0);var L=D.get(P);return L==null&&D.set(P,L=this._idIndexMapCount++),L},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(P){P?this._viewRoot=P:P=this._viewRoot;var D=this.getRawData().tree.root;(!P||P!==D&&!D.contains(P))&&(this._viewRoot=D)}});function M(P){var D=0;m.each(P.children,function(R){M(R);var O=R.value;m.isArray(O)&&(O=O[0]),D+=O});var L=P.value;m.isArray(L)&&(L=L[0]),(L==null||isNaN(L))&&(L=D),L<0&&(L=0),m.isArray(P.value)?P.value[0]=L:P.value=L}function I(P,D){var L=D.get("color");if(L){P=P||[];var R;if(m.each(P,function(F){var k=new x(F),U=k.get("color");(k.get("itemStyle.color")||U&&U!=="none")&&(R=!0)}),!R){var O=P[0]||(P[0]={});O.color=L.slice()}return P}}f.exports=S}),oyt=xt((o,f)=>{var m=xa(),v=rd(),y=Wi(),x=uB(),C=x.wrapTreePathInfo,w=8,A=8,E=5;function T(P){this.group=new m.Group,P.add(this.group)}T.prototype={constructor:T,render:function(P,D,L,R){var O=P.getModel("breadcrumb"),F=this.group;if(F.removeAll(),!(!O.get("show")||!L)){var k=O.getModel("itemStyle"),U=k.getModel("textStyle"),G={pos:{left:O.get("left"),right:O.get("right"),top:O.get("top"),bottom:O.get("bottom")},box:{width:D.getWidth(),height:D.getHeight()},emptyItemWidth:O.get("emptyItemWidth"),totalWidth:0,renderList:[]};this._prepare(L,G,U),this._renderContent(P,G,k,U,R),v.positionElement(F,G.pos,G.box)}},_prepare:function(P,D,L){for(var R=P;R;R=R.parentNode){var O=R.getModel().get("name"),F=L.getTextRect(O),k=Math.max(F.width+w*2,D.emptyItemWidth);D.totalWidth+=k+A,D.renderList.push({node:R,text:O,width:k})}},_renderContent:function(P,D,L,R,O){for(var F=0,k=D.emptyItemWidth,U=P.get("breadcrumb.height"),G=v.getAvailableSize(D.pos,D.box),j=D.totalWidth,q=D.renderList,J=q.length-1;J>=0;J--){var X=q[J],Y=X.node,Q=X.width,ee=X.text;j>G.width&&(j-=Q-k,Q=k,ee=null);var z=new m.Polygon({shape:{points:S(F,0,Q,U,J===q.length-1,J===0)},style:y.defaults(L.getItemStyle(),{lineJoin:"bevel",text:ee,textFill:R.getTextColor(),textFont:R.getFont()}),z:10,onclick:y.curry(O,Y)});this.group.add(z),M(z,P,Y),F+=Q+A}},remove:function(){this.group.removeAll()}};function S(P,D,L,R,O,F){var k=[[O?P:P-E,D],[P+L,D],[P+L,D+R],[O?P:P-E,D+R]];return!F&&k.splice(2,0,[P+L+E,D+R/2]),!O&&k.push([P,D+R/2]),k}function M(P,D,L){P.eventData={componentType:"series",componentSubType:"treemap",componentIndex:D.componentIndex,seriesIndex:D.componentIndex,seriesName:D.name,seriesType:"treemap",selfType:"breadcrumb",nodeData:{dataIndex:L&&L.dataIndex,name:L&&L.name},treePathInfo:L&&C(L,D)}}var I=T;f.exports=I}),ayt=xt(o=>{var f=Wi();function m(){var v=[],y={},x;return{add:function(C,w,A,E,T){return f.isString(E)&&(T=E,E=0),y[C.id]?!1:(y[C.id]=1,v.push({el:C,target:w,time:A,delay:E,easing:T}),!0)},done:function(C){return x=C,this},start:function(){for(var C=v.length,w=0,A=v.length;w{var m=fo(),v=Wi(),y=xa(),x=aB(),C=uB(),w=oyt(),A=Kj(),E=Of(),T=Ky(),S=ayt(),M=nU(),I=fd(),P=I.windowOpen,D=v.bind,L=y.Group,R=y.Rect,O=v.each,F=3,k=["label"],U=["emphasis","label"],G=["upperLabel"],j=["emphasis","upperLabel"],q=10,J=1,X=2,Y=M([["fill","color"],["stroke","strokeColor"],["lineWidth","strokeWidth"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"]]),Q=function(ne){var oe=Y(ne);return oe.stroke=oe.fill=oe.lineWidth=null,oe},ee=m.extendChartView({type:"treemap",init:function(ne,oe){this._containerGroup,this._storage=z(),this._oldTree,this._breadcrumb,this._controller,this._state="ready"},render:function(ne,oe,se,ae){var fe=oe.findComponents({mainType:"series",subType:"treemap",query:ae});if(!(v.indexOf(fe,ne)<0)){this.seriesModel=ne,this.api=se,this.ecModel=oe;var de=["treemapZoomToNode","treemapRootToNode"],ve=C.retrieveTargetInfo(ae,de,ne),pe=ae&&ae.type,ce=ne.layoutInfo,he=!this._oldTree,Ce=this._storage,Se=pe==="treemapRootToNode"&&ve&&Ce?{rootNodeGroup:Ce.nodeGroup[ve.node.getRawIndex()],direction:ae.direction}:null,De=this._giveContainerGroup(ce),Oe=this._doRender(De,ne,Se);!he&&(!pe||pe==="treemapZoomToNode"||pe==="treemapRootToNode")?this._doAnimation(De,Oe,ne,Se):Oe.renderFinally(),this._resetController(se),this._renderBreadcrumb(ne,se,ve)}},_giveContainerGroup:function(ne){var oe=this._containerGroup;return oe||(oe=this._containerGroup=new L,this._initEvents(oe),this.group.add(oe)),oe.attr("position",[ne.x,ne.y]),oe},_doRender:function(ne,oe,se){var ae=oe.getData().tree,fe=this._oldTree,de=z(),ve=z(),pe=this._storage,ce=[],he=v.curry(ie,oe,ve,pe,se,de,ce);Se(ae.root?[ae.root]:[],fe&&fe.root?[fe.root]:[],ne,ae===fe||!fe,0);var Ce=De(pe);return this._oldTree=ae,this._storage=ve,{lastsForAnimation:de,willDeleteEls:Ce,renderFinally:Oe};function Se(Ue,Xe,it,ut,at){ut?(Xe=Ue,O(Ue,function(ft,Ot){!ft.isRemoved()&&Qe(Ot,Ot)})):new x(Xe,Ue,Pt,Pt).add(Qe).update(Qe).remove(v.curry(Qe,null)).execute();function Pt(ft){return ft.getId()}function Qe(ft,Ot){var Xt=ft!=null?Ue[ft]:null,At=Ot!=null?Xe[Ot]:null,bt=he(Xt,At,it,at);bt&&Se(Xt&&Xt.viewChildren||[],At&&At.viewChildren||[],bt,ut,at+1)}}function De(Ue){var Xe=z();return Ue&&O(Ue,function(it,ut){var at=Xe[ut];O(it,function(Pt){Pt&&(at.push(Pt),Pt.__tmWillDelete=1)})}),Xe}function Oe(){O(Ce,function(Ue){O(Ue,function(Xe){Xe.parent&&Xe.parent.remove(Xe)})}),O(ce,function(Ue){Ue.invisible=!0,Ue.dirty()})}},_doAnimation:function(ne,oe,se,ae){if(se.get("animation")){var fe=se.get("animationDurationUpdate"),de=se.get("animationEasing"),ve=S.createWrap();O(oe.willDeleteEls,function(pe,ce){O(pe,function(he,Ce){if(!he.invisible){var Se=he.parent,De;if(ae&&ae.direction==="drillDown")De=Se===ae.rootNodeGroup?{shape:{x:0,y:0,width:Se.__tmNodeWidth,height:Se.__tmNodeHeight},style:{opacity:0}}:{style:{opacity:0}};else{var Oe=0,Ue=0;Se.__tmWillDelete||(Oe=Se.__tmNodeWidth/2,Ue=Se.__tmNodeHeight/2),De=ce==="nodeGroup"?{position:[Oe,Ue],style:{opacity:0}}:{shape:{x:Oe,y:Ue,width:0,height:0},style:{opacity:0}}}De&&ve.add(he,De,fe,de)}})}),O(this._storage,function(pe,ce){O(pe,function(he,Ce){var Se=oe.lastsForAnimation[ce][Ce],De={};Se&&(ce==="nodeGroup"?Se.old&&(De.position=he.position.slice(),he.attr("position",Se.old)):(Se.old&&(De.shape=v.extend({},he.shape),he.setShape(Se.old)),Se.fadein?(he.setStyle("opacity",0),De.style={opacity:1}):he.style.opacity!==1&&(De.style={opacity:1})),ve.add(he,De,fe,de))})},this),this._state="animating",ve.done(D(function(){this._state="ready",oe.renderFinally()},this)).start()}},_resetController:function(ne){var oe=this._controller;oe||(oe=this._controller=new A(ne.getZr()),oe.enable(this.seriesModel.get("roam")),oe.on("pan",D(this._onPan,this)),oe.on("zoom",D(this._onZoom,this)));var se=new E(0,0,ne.getWidth(),ne.getHeight());oe.setPointerChecker(function(ae,fe,de){return se.contain(fe,de)})},_clearController:function(){var ne=this._controller;ne&&(ne.dispose(),ne=null)},_onPan:function(ne){if(this._state!=="animating"&&(Math.abs(ne.dx)>F||Math.abs(ne.dy)>F)){var oe=this.seriesModel.getData().tree.root;if(!oe)return;var se=oe.getLayout();if(!se)return;this.api.dispatchAction({type:"treemapMove",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:se.x+ne.dx,y:se.y+ne.dy,width:se.width,height:se.height}})}},_onZoom:function(ne){var oe=ne.originX,se=ne.originY;if(this._state!=="animating"){var ae=this.seriesModel.getData().tree.root;if(!ae)return;var fe=ae.getLayout();if(!fe)return;var de=new E(fe.x,fe.y,fe.width,fe.height),ve=this.seriesModel.layoutInfo;oe-=ve.x,se-=ve.y;var pe=T.create();T.translate(pe,pe,[-oe,-se]),T.scale(pe,pe,[ne.scale,ne.scale]),T.translate(pe,pe,[oe,se]),de.applyTransform(pe),this.api.dispatchAction({type:"treemapRender",from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:de.x,y:de.y,width:de.width,height:de.height}})}},_initEvents:function(ne){ne.on("click",function(oe){if(this._state==="ready"){var se=this.seriesModel.get("nodeClick",!0);if(se){var ae=this.findTarget(oe.offsetX,oe.offsetY);if(ae){var fe=ae.node;if(fe.getLayout().isLeafRoot)this._rootToNode(ae);else if(se==="zoomToNode")this._zoomToNode(ae);else if(se==="link"){var de=fe.hostTree.data.getItemModel(fe.dataIndex),ve=de.get("link",!0),pe=de.get("target",!0)||"blank";ve&&P(ve,pe)}}}}},this)},_renderBreadcrumb:function(ne,oe,se){se||(se=ne.get("leafDepth",!0)!=null?{node:ne.getViewRoot()}:this.findTarget(oe.getWidth()/2,oe.getHeight()/2),se||(se={node:ne.getData().tree.root})),(this._breadcrumb||(this._breadcrumb=new w(this.group))).render(ne,oe,se.node,D(ae,this));function ae(fe){this._state!=="animating"&&(C.aboveViewRoot(ne.getViewRoot(),fe)?this._rootToNode({node:fe}):this._zoomToNode({node:fe}))}},remove:function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=z(),this._state="ready",this._breadcrumb&&this._breadcrumb.remove()},dispose:function(){this._clearController()},_zoomToNode:function(ne){this.api.dispatchAction({type:"treemapZoomToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:ne.node})},_rootToNode:function(ne){this.api.dispatchAction({type:"treemapRootToNode",from:this.uid,seriesId:this.seriesModel.id,targetNode:ne.node})},findTarget:function(ne,oe){var se,ae=this.seriesModel.getViewRoot();return ae.eachNode({attr:"viewChildren",order:"preorder"},function(fe){var de=this._storage.background[fe.getRawIndex()];if(de){var ve=de.transformCoordToLocal(ne,oe),pe=de.shape;if(pe.x<=ve[0]&&ve[0]<=pe.x+pe.width&&pe.y<=ve[1]&&ve[1]<=pe.y+pe.height)se={node:fe,offsetX:ve[0],offsetY:ve[1]};else return!1}},this),se}});function z(){return{nodeGroup:[],background:[],content:[]}}function ie(ne,oe,se,ae,fe,de,ve,pe,ce,he){if(!ve)return;var Ce=ve.getLayout(),Se=ne.getData();if(Se.setItemGraphicEl(ve.dataIndex,null),!Ce||!Ce.isInView)return;var De=Ce.width,Oe=Ce.height,Ue=Ce.borderWidth,Xe=Ce.invisible,it=ve.getRawIndex(),ut=pe&&pe.getRawIndex(),at=ve.viewChildren,Pt=Ce.upperHeight,Qe=at&&at.length,ft=ve.getModel("itemStyle"),Ot=ve.getModel("emphasis.itemStyle"),Xt=ei("nodeGroup",L);if(!Xt)return;if(ce.add(Xt),Xt.attr("position",[Ce.x||0,Ce.y||0]),Xt.__tmNodeWidth=De,Xt.__tmNodeHeight=Oe,Ce.isAboveViewRoot)return Xt;var At=ve.getModel(),bt=ei("background",R,he,J);if(bt&&It(Xt,bt,Qe&&Ce.upperLabelHeight),Qe)y.isHighDownDispatcher(Xt)&&y.setAsHighDownDispatcher(Xt,!1),bt&&(y.setAsHighDownDispatcher(bt,!0),Se.setItemGraphicEl(ve.dataIndex,bt));else{var gt=ei("content",R,he,X);gt&&Jt(Xt,gt),bt&&y.isHighDownDispatcher(bt)&&y.setAsHighDownDispatcher(bt,!1),y.setAsHighDownDispatcher(Xt,!0),Se.setItemGraphicEl(ve.dataIndex,Xt)}return Xt;function It(Nt,yi,ai){if(yi.dataIndex=ve.dataIndex,yi.seriesIndex=ne.seriesIndex,yi.setShape({x:0,y:0,width:De,height:Oe}),Xe)bi(yi);else{yi.invisible=!1;var wi=ve.getVisual("borderColor",!0),ji=Ot.get("borderColor"),hi=Q(ft);hi.fill=wi;var Ri=Y(Ot);if(Ri.fill=ji,ai){var pt=De-2*Ue;Yi(hi,Ri,wi,pt,Pt,{x:Ue,y:0,width:pt,height:Pt})}else hi.text=Ri.text=null;yi.setStyle(hi),y.setElementHoverStyle(yi,Ri)}Nt.add(yi)}function Jt(Nt,yi){yi.dataIndex=ve.dataIndex,yi.seriesIndex=ne.seriesIndex;var ai=Math.max(De-2*Ue,0),wi=Math.max(Oe-2*Ue,0);if(yi.culling=!0,yi.setShape({x:Ue,y:Ue,width:ai,height:wi}),Xe)bi(yi);else{yi.invisible=!1;var ji=ve.getVisual("color",!0),hi=Q(ft);hi.fill=ji;var Ri=Y(Ot);Yi(hi,Ri,ji,ai,wi),yi.setStyle(hi),y.setElementHoverStyle(yi,Ri)}Nt.add(yi)}function bi(Nt){!Nt.invisible&&de.push(Nt)}function Yi(Nt,yi,ai,wi,ji,hi){var Ri=At.get("name"),pt=At.getModel(hi?G:k),wr=At.getModel(hi?j:U),zi=pt.getShallow("show");y.setLabelStyle(Nt,yi,pt,wr,{defaultText:zi?Ri:null,autoColor:ai,isRectText:!0,labelFetcher:ne,labelDataIndex:ve.dataIndex,labelProp:hi?"upperLabel":"label"}),ii(Nt,hi,Ce),ii(yi,hi,Ce),hi&&(Nt.textRect=v.clone(hi)),Nt.truncate=zi&&pt.get("ellipsis")?{outerWidth:wi,outerHeight:ji,minChar:2}:null}function ii(Nt,yi,ai){var wi=Nt.text;if(!yi&&ai.isLeafRoot&&wi!=null){var ji=ne.get("drillDownIcon",!0);Nt.text=ji?ji+" "+wi:wi}}function ei(Nt,yi,ai,wi){var ji=ut!=null&&se[Nt][ut],hi=fe[Nt];return ji?(se[Nt][ut]=null,Li(hi,ji,Nt)):Xe||(ji=new yi({z:re(ai,wi)}),ji.__tmDepth=ai,ji.__tmStorageName=Nt,Je(hi,ji,Nt)),oe[Nt][it]=ji}function Li(Nt,yi,ai){var wi=Nt[it]={};wi.old=ai==="nodeGroup"?yi.position.slice():v.extend({},yi.shape)}function Je(Nt,yi,ai){var wi=Nt[it]={},ji=ve.parentNode;if(ji&&(!ae||ae.direction==="drillDown")){var hi=0,Ri=0,pt=fe.background[ji.getRawIndex()];!ae&&pt&&pt.old&&(hi=pt.old.width,Ri=pt.old.height),wi.old=ai==="nodeGroup"?[0,Ri]:{x:hi,y:Ri,width:0,height:0}}wi.fadein=ai!=="nodeGroup"}}function re(ne,oe){var se=ne*q+oe;return(se-1)/se}f.exports=ee}),lyt=xt(()=>{var o=fo(),f=uB(),m=function(){},v=["treemapZoomToNode","treemapRender","treemapMove"];for(y=0;y{var m=Wi(),v=k2(),y=il(),x=y.linearMap,C=m.each,w=m.isObject,A=-1,E=function(J){var X=J.mappingMethod,Y=J.type,Q=this.option=m.clone(J);this.type=Y,this.mappingMethod=X,this._normalizeData=G[X];var ee=T[Y];this.applyVisual=ee.applyVisual,this.getColorMapper=ee.getColorMapper,this._doMap=ee._doMap[X],X==="piecewise"?(I(Q),S(Q)):X==="category"?Q.categories?M(Q):I(Q,!0):(m.assert(X!=="linear"||Q.dataExtent),I(Q))};E.prototype={constructor:E,mapValueToVisual:function(J){var X=this._normalizeData(J);return this._doMap(X,J)},getNormalizer:function(){return m.bind(this._normalizeData,this)}};var T=E.visualHandlers={color:{applyVisual:L("color"),getColorMapper:function(){var J=this.option;return m.bind(J.mappingMethod==="category"?function(X,Y){return!Y&&(X=this._normalizeData(X)),R.call(this,X)}:function(X,Y,Q){var ee=!!Q;return!Y&&(X=this._normalizeData(X)),Q=v.fastLerp(X,J.parsedVisual,Q),ee?Q:v.stringify(Q,"rgba")},this)},_doMap:{linear:function(J){return v.stringify(v.fastLerp(J,this.option.parsedVisual),"rgba")},category:R,piecewise:function(J,X){var Y=k.call(this,X);return Y==null&&(Y=v.stringify(v.fastLerp(J,this.option.parsedVisual),"rgba")),Y},fixed:O}},colorHue:P(function(J,X){return v.modifyHSL(J,X)}),colorSaturation:P(function(J,X){return v.modifyHSL(J,null,X)}),colorLightness:P(function(J,X){return v.modifyHSL(J,null,null,X)}),colorAlpha:P(function(J,X){return v.modifyAlpha(J,X)}),opacity:{applyVisual:L("opacity"),_doMap:F([0,1])},liftZ:{applyVisual:L("liftZ"),_doMap:{linear:O,category:O,piecewise:O,fixed:O}},symbol:{applyVisual:function(J,X,Y){var Q=this.mapValueToVisual(J);if(m.isString(Q))Y("symbol",Q);else if(w(Q))for(var ee in Q)Q.hasOwnProperty(ee)&&Y(ee,Q[ee])},_doMap:{linear:D,category:R,piecewise:function(J,X){var Y=k.call(this,X);return Y==null&&(Y=D.call(this,J)),Y},fixed:O}},symbolSize:{applyVisual:L("symbolSize"),_doMap:F([0,1])}};function S(J){var X=J.pieceList;J.hasSpecialVisual=!1,m.each(X,function(Y,Q){Y.originIndex=Q,Y.visual!=null&&(J.hasSpecialVisual=!0)})}function M(J){var X=J.categories,Y=J.visual,Q=J.categoryMap={};if(C(X,function(ie,re){Q[ie]=re}),!m.isArray(Y)){var ee=[];m.isObject(Y)?C(Y,function(ie,re){var ne=Q[re];ee[ne??A]=ie}):ee[A]=Y,Y=U(J,ee)}for(var z=X.length-1;z>=0;z--)Y[z]==null&&(delete Q[X[z]],X.pop())}function I(J,X){var Y=J.visual,Q=[];m.isObject(Y)?C(Y,function(z){Q.push(z)}):Y!=null&&Q.push(Y);var ee={color:1,symbol:1};!X&&Q.length===1&&!ee.hasOwnProperty(J.type)&&(Q[1]=Q[0]),U(J,Q)}function P(J){return{applyVisual:function(X,Y,Q){X=this.mapValueToVisual(X),Q("color",J(Y("color"),X))},_doMap:F([0,1])}}function D(J){var X=this.option.visual;return X[Math.round(x(J,[0,1],[0,X.length-1],!0))]||{}}function L(J){return function(X,Y,Q){Q(J,this.mapValueToVisual(X))}}function R(J){var X=this.option.visual;return X[this.option.loop&&J!==A?J%X.length:J]}function O(){return this.option.visual[0]}function F(J){return{linear:function(X){return x(X,J,this.option.visual,!0)},category:R,piecewise:function(X,Y){var Q=k.call(this,Y);return Q==null&&(Q=x(X,J,this.option.visual,!0)),Q},fixed:O}}function k(J){var X=this.option,Y=X.pieceList;if(X.hasSpecialVisual){var Q=E.findPieceIndex(J,Y),ee=Y[Q];if(ee&&ee.visual)return ee.visual[this.type]}}function U(J,X){return J.visual=X,J.type==="color"&&(J.parsedVisual=m.map(X,function(Y){return v.parse(Y)})),X}var G={linear:function(J){return x(J,this.option.dataExtent,[0,1],!0)},piecewise:function(J){var X=this.option.pieceList,Y=E.findPieceIndex(J,X,!0);if(Y!=null)return x(Y,[0,X.length-1],[0,1],!0)},category:function(J){var X=this.option.categories?this.option.categoryMap[J]:J;return X??A},fixed:m.noop};E.listVisualTypes=function(){var J=[];return m.each(T,function(X,Y){J.push(Y)}),J},E.addVisualHandler=function(J,X){T[J]=X},E.isValidType=function(J){return T.hasOwnProperty(J)},E.eachVisual=function(J,X,Y){m.isObject(J)?m.each(J,X,Y):X.call(Y,J)},E.mapVisual=function(J,X,Y){var Q,ee=m.isArray(J)?[]:m.isObject(J)?{}:(Q=!0,null);return E.eachVisual(J,function(z,ie){var re=X.call(Y,z,ie);Q?ee=re:ee[ie]=re}),ee},E.retrieveVisuals=function(J){var X={},Y;return J&&C(T,function(Q,ee){J.hasOwnProperty(ee)&&(X[ee]=J[ee],Y=!0)}),Y?X:null},E.prepareVisualTypes=function(J){if(w(J)){var X=[];C(J,function(Y,Q){X.push(Q)}),J=X}else if(m.isArray(J))J=J.slice();else return[];return J.sort(function(Y,Q){return Q==="color"&&Y!=="color"&&Y.indexOf("color")===0?1:-1}),J},E.dependsOn=function(J,X){return X==="color"?!!(J&&J.indexOf(X)===0):J===X},E.findPieceIndex=function(J,X,Y){for(var Q,ee=1/0,z=0,ie=X.length;z{var m=cB(),v=k2(),y=Wi(),x=y.isArray,C="itemStyle",w={seriesType:"treemap",reset:function(L,R,O,F){var k=L.getData().tree,U=k.root,G=L.getModel(C);if(!U.isRemoved()){var j=y.map(k.levelModels,function(q){return q?q.get(C):null});A(U,{},j,G,L.getViewRoot().getAncestors(),L)}}};function A(L,R,O,F,k,U){var G=L.getModel(),j=L.getLayout();if(!(!j||j.invisible||!j.isInView)){var q=L.getModel(C),J=O[L.depth],X=E(q,R,J,F),Y=q.get("borderColor"),Q=q.get("borderColorSaturation"),ee;Q!=null&&(ee=T(X,L),Y=S(Q,ee)),L.setVisual("borderColor",Y);var z=L.viewChildren;if(!z||!z.length)ee=T(X,L),L.setVisual("color",ee);else{var ie=I(L,G,j,q,X,z);y.each(z,function(re,ne){if(re.depth>=k.length||re===k[re.depth]){var oe=D(G,X,re,ne,ie,U);A(re,oe,O,F,k,U)}})}}}function E(L,R,O,F){var k=y.extend({},R);return y.each(["color","colorAlpha","colorSaturation"],function(U){var G=L.get(U,!0);G==null&&O&&(G=O[U]),G==null&&(G=R[U]),G==null&&(G=F.get(U)),G!=null&&(k[U]=G)}),k}function T(L){var R=M(L,"color");if(R){var O=M(L,"colorAlpha"),F=M(L,"colorSaturation");return F&&(R=v.modifyHSL(R,null,null,F)),O&&(R=v.modifyAlpha(R,O)),R}}function S(L,R){return R!=null?v.modifyHSL(R,null,null,L):null}function M(L,R){var O=L[R];if(O!=null&&O!=="none")return O}function I(L,R,O,F,k,U){if(!(!U||!U.length)){var G=P(R,"color")||k.color!=null&&k.color!=="none"&&(P(R,"colorAlpha")||P(R,"colorSaturation"));if(G){var j=R.get("visualMin"),q=R.get("visualMax"),J=O.dataExtent.slice();j!=null&&jJ[1]&&(J[1]=q);var X=R.get("colorMappingBy"),Y={type:G.name,dataExtent:J,visual:G.range};Y.type==="color"&&(X==="index"||X==="id")?(Y.mappingMethod="category",Y.loop=!0):Y.mappingMethod="linear";var Q=new m(Y);return Q.__drColorMappingBy=X,Q}}}function P(L,R){var O=L.get(R);return x(O)&&O.length?{name:R,range:O}:null}function D(L,R,O,F,k,U){var G=y.extend({},R);if(k){var j=k.type,q=j==="color"&&k.__drColorMappingBy,J=q==="index"?F:q==="id"?U.mapIdToIndex(O.getId()):O.getValue(L.get("visualDimension"));G[j]=k.mapValueToVisual(J)}return G}f.exports=w}),cyt=xt((o,f)=>{var m=Wi(),v=Of(),y=il(),x=y.parsePercent,C=y.MAX_SAFE_INTEGER,w=rd(),A=uB(),E=Math.max,T=Math.min,S=m.retrieve,M=m.each,I=["itemStyle","borderWidth"],P=["itemStyle","gapWidth"],D=["upperLabel","show"],L=["upperLabel","height"],R={seriesType:"treemap",reset:function(ee,z,ie,re){var ne=ie.getWidth(),oe=ie.getHeight(),se=ee.option,ae=w.getLayoutRect(ee.getBoxLayoutParams(),{width:ie.getWidth(),height:ie.getHeight()}),fe=se.size||[],de=x(S(ae.width,fe[0]),ne),ve=x(S(ae.height,fe[1]),oe),pe=re&&re.type,ce=["treemapZoomToNode","treemapRootToNode"],he=A.retrieveTargetInfo(re,ce,ee),Ce=pe==="treemapRender"||pe==="treemapMove"?re.rootRect:null,Se=ee.getViewRoot(),De=A.getPathToRoot(Se);if(pe!=="treemapMove"){var Oe=pe==="treemapZoomToNode"?J(ee,he,Se,de,ve):Ce?[Ce.width,Ce.height]:[de,ve],Ue=se.sort;Ue&&Ue!=="asc"&&Ue!=="desc"&&(Ue="desc");var Xe={squareRatio:se.squareRatio,sort:Ue,leafDepth:se.leafDepth};Se.hostTree.clearLayouts();var it={x:0,y:0,width:Oe[0],height:Oe[1],area:Oe[0]*Oe[1]};Se.setLayout(it),O(Se,Xe,!1,0);var it=Se.getLayout();M(De,function(at,Pt){var Qe=(De[Pt+1]||Se).getValue();at.setLayout(m.extend({dataExtent:[Qe,Qe],borderWidth:0,upperHeight:0},it))})}var ut=ee.getData().tree.root;ut.setLayout(X(ae,Ce,he),!0),ee.setLayoutInfo(ae),Y(ut,new v(-ae.x,-ae.y,ne,oe),De,Se,0)}};function O(ee,z,ie,re){var ne,oe;if(!ee.isRemoved()){var se=ee.getLayout();ne=se.width,oe=se.height;var he=ee.getModel(),ae=he.get(I),fe=he.get(P)/2,de=Q(he),ve=Math.max(ae,de),pe=ae-fe,ce=ve-fe,he=ee.getModel();ee.setLayout({borderWidth:ae,upperHeight:ve,upperLabelHeight:de},!0),ne=E(ne-2*pe,0),oe=E(oe-pe-ce,0);var Ce=ne*oe,Se=F(ee,he,Ce,z,ie,re);if(Se.length){var De={x:pe,y:ce,width:ne,height:oe},Oe=T(ne,oe),Ue=1/0,Xe=[];Xe.area=0;for(var it=0,ut=Se.length;it=0;fe--){var de=ne[re==="asc"?se-fe-1:fe].getValue();de/ie*zae[1]&&(ae[1]=ve)})}return{sum:re,dataExtent:ae}}function j(ee,z,ie){for(var re=0,ne=1/0,oe=0,se,ae=ee.length;oere&&(re=se));var fe=ee.area*ee.area,de=z*z*ie;return fe?E(de*re/fe,fe/(de*ne)):1/0}function q(ee,z,ie,re,ne){var oe=z===ie.width?0:1,se=1-oe,ae=["x","y"],fe=["width","height"],de=ie[ae[oe]],ve=z?ee.area/z:0;(ne||ve>ie[fe[se]])&&(ve=ie[fe[se]]);for(var pe=0,ce=ee.length;peC&&(de=C),oe=ae}de{var o=fo();nyt(),syt(),lyt();var f=uyt(),m=cyt();o.registerVisual(f),o.registerLayout(m)}),dyt=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Wi(),x=kM(),C=x.enableClassCheck;function w(P){return"_EC_"+P}var A=function(P){this._directed=P||!1,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this.data,this.edgeData},E=A.prototype;E.type="graph",E.isDirected=function(){return this._directed},E.addNode=function(P,D){P=P==null?""+D:""+P;var L=this._nodesMap;if(!L[w(P)]){var R=new T(P,D);return R.hostGraph=this,this.nodes.push(R),L[w(P)]=R,R}},E.getNodeByIndex=function(P){var D=this.data.getRawIndex(P);return this.nodes[D]},E.getNodeById=function(P){return this._nodesMap[w(P)]},E.addEdge=function(P,D,L){var R=this._nodesMap,O=this._edgesMap;if(typeof P=="number"&&(P=this.nodes[P]),typeof D=="number"&&(D=this.nodes[D]),T.isInstance(P)||(P=R[w(P)]),T.isInstance(D)||(D=R[w(D)]),!(!P||!D)){var F=P.id+"-"+D.id;if(!O[F]){var k=new S(P,D,L);return k.hostGraph=this,this._directed&&(P.outEdges.push(k),D.inEdges.push(k)),P.edges.push(k),P!==D&&D.edges.push(k),this.edges.push(k),O[F]=k,k}}},E.getEdgeByIndex=function(P){var D=this.edgeData.getRawIndex(P);return this.edges[D]},E.getEdge=function(P,D){T.isInstance(P)&&(P=P.id),T.isInstance(D)&&(D=D.id);var L=this._edgesMap;return this._directed?L[P+"-"+D]:L[P+"-"+D]||L[D+"-"+P]},E.eachNode=function(P,D){for(var L=this.nodes,R=L.length,O=0;O=0&&P.call(D,L[O],O)},E.eachEdge=function(P,D){for(var L=this.edges,R=L.length,O=0;O=0&&L[O].node1.dataIndex>=0&&L[O].node2.dataIndex>=0&&P.call(D,L[O],O)},E.breadthFirstTraverse=function(P,D,L,R){if(T.isInstance(D)||(D=this._nodesMap[w(D)]),!!D){for(var O=L==="out"?"outEdges":L==="in"?"inEdges":"edges",F=0;F=0&&U.node2.dataIndex>=0});for(var O=0,F=R.length;O=0&&this[P][D].setItemVisual(this.dataIndex,L,R)},getVisual:function(L,R){return this[P][D].getItemVisual(this.dataIndex,L,R)},setLayout:function(L,R){this.dataIndex>=0&&this[P][D].setItemLayout(this.dataIndex,L,R)},getLayout:function(){return this[P][D].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[P][D].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[P][D].getRawIndex(this.dataIndex)}}};y.mixin(T,M("hostGraph","data")),y.mixin(S,M("hostGraph","edgeData")),A.Node=T,A.Edge=S,C(T),C(S);var I=A;f.exports=I}),_Ge=xt((o,f)=>{var m=Wi(),v=Yw(),y=dyt(),x=mGe(),C=sU(),w=aT(),A=zM();function E(T,S,M,I,P){for(var D=new y(I),L=0;L "+G)),F++)}var j=M.get("coordinateSystem"),q;if(j==="cartesian2d"||j==="polar")q=A(T,M);else{var J=w.get(j),X=J&&J.type!=="view"?J.dimensions||[]:[];m.indexOf(X,"value")<0&&X.concat(["value"]);var Y=C(T,{coordDimensions:X});q=new v(Y,M),q.initData(T)}var Q=new v(["value"],M);return Q.initData(O,R),P&&P(q,Q),x({mainData:q,struct:D,structAttr:"graph",datas:{node:q,edge:Q},datasAttr:{node:"data",edge:"edgeData"}}),D.update(),D}f.exports=E}),fyt=xt((o,f)=>{var m=fo(),v=Yw(),y=Wi(),x=vu(),C=x.defaultEmphasis,w=Sm(),A=fd(),E=A.encodeHTML,T=_Ge(),S=Xj(),M=m.extendSeriesModel({type:"series.graph",init:function(P){M.superApply(this,"init",arguments);var D=this;function L(){return D._categoriesData}this.legendVisualProvider=new S(L,L),this.fillDataTextStyle(P.edges||P.links),this._updateCategoriesData()},mergeOption:function(P){M.superApply(this,"mergeOption",arguments),this.fillDataTextStyle(P.edges||P.links),this._updateCategoriesData()},mergeDefaultAndTheme:function(P){M.superApply(this,"mergeDefaultAndTheme",arguments),C(P,["edgeLabel"],["show"])},getInitialData:function(P,D){var L=P.edges||P.links||[],R=P.data||P.nodes||[],O=this;if(R&&L)return T(R,L,this,!0,F).data;function F(k,U){k.wrapMethod("getItemModel",function(Y){var Q=O._categoriesModels,ee=Y.getShallow("category"),z=Q[ee];return z&&(z.parentModel=Y.parentModel,Y.parentModel=z),Y});var G=O.getModel("edgeLabel"),j=new w({label:G.option},G.parentModel,D),q=O.getModel("emphasis.edgeLabel"),J=new w({emphasis:{label:q.option}},q.parentModel,D);U.wrapMethod("getItemModel",function(Y){return Y.customizeGetParent(X),Y});function X(Y){return Y=this.parsePath(Y),Y&&Y[0]==="label"?j:Y&&Y[0]==="emphasis"&&Y[1]==="label"?J:this.parentModel}}},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},getCategoriesData:function(){return this._categoriesData},formatTooltip:function(P,D,L){if(L==="edge"){var R=this.getData(),O=this.getDataParams(P,L),F=R.graph.getEdgeByIndex(P),k=R.getName(F.node1.dataIndex),U=R.getName(F.node2.dataIndex),G=[];return k!=null&&G.push(k),U!=null&&G.push(U),G=E(G.join(" > ")),O.value&&(G+=" : "+E(O.value)),G}else return M.superApply(this,"formatTooltip",arguments)},_updateCategoriesData:function(){var P=y.map(this.option.categories||[],function(L){return L.value!=null?L:y.extend({value:0},L)}),D=new v(["value"],this);D.initData(P),this._categoriesData=D,this._categoriesModels=D.mapArray(function(L){return D.getItemModel(L,!0)})},setZoom:function(P){this.option.zoom=P},setCenter:function(P){this.option.center=P},isAnimationEnabled:function(){return M.superCall(this,"isAnimationEnabled")&&!(this.get("layout")==="force"&&this.get("force.layoutAnimation"))},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",legendHoverLink:!0,hoverAnimation:!0,layout:null,focusNodeAdjacency:!1,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:"center",top:"center",symbol:"circle",symbolSize:10,edgeSymbol:["none","none"],edgeSymbolSize:10,edgeLabel:{position:"middle",distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:"{b}"},itemStyle:{},lineStyle:{color:"#aaa",width:1,curveness:0,opacity:.5},emphasis:{label:{show:!0}}}}),I=M;f.exports=I}),pyt=xt((o,f)=>{var m=xa(),v=lf(),y=m.Line.prototype,x=m.BezierCurve.prototype;function C(A){return isNaN(+A.cpx1)||isNaN(+A.cpy1)}var w=m.extendShape({type:"ec-line",style:{stroke:"#000",fill:null},shape:{x1:0,y1:0,x2:0,y2:0,percent:1,cpx1:null,cpy1:null},buildPath:function(A,E){this[C(E)?"_buildPathLine":"_buildPathCurve"](A,E)},_buildPathLine:y.buildPath,_buildPathCurve:x.buildPath,pointAt:function(A){return this[C(this.shape)?"_pointAtLine":"_pointAtCurve"](A)},_pointAtLine:y.pointAt,_pointAtCurve:x.pointAt,tangentAt:function(A){var E=this.shape,T=C(E)?[E.x2-E.x1,E.y2-E.y1]:this._tangentAtCurve(A);return v.normalize(T,T)},_tangentAtCurve:x.tangentAt});f.exports=w}),D0e=xt((o,f)=>{var m=Wi(),v=lf(),y=qw(),x=pyt(),C=xa(),w=il(),A=w.round,E=["fromSymbol","toSymbol"];function T(O){return"_"+O+"Type"}function S(O,F,k){var U=F.getItemVisual(k,"color"),G=F.getItemVisual(k,O),j=F.getItemVisual(k,O+"Size");if(!(!G||G==="none")){m.isArray(j)||(j=[j,j]);var q=y.createSymbol(G,-j[0]/2,-j[1]/2,j[0],j[1],U);return q.name=O,q}}function M(O){var F=new x({name:"line",subPixelOptimize:!0});return I(F.shape,O),F}function I(O,F){O.x1=F[0][0],O.y1=F[0][1],O.x2=F[1][0],O.y2=F[1][1],O.percent=1;var k=F[2];k?(O.cpx1=k[0],O.cpy1=k[1]):(O.cpx1=NaN,O.cpy1=NaN)}function P(){var O=this,F=O.childOfName("fromSymbol"),k=O.childOfName("toSymbol"),U=O.childOfName("label");if(!(!F&&!k&&U.ignore)){for(var G=1,j=this.parent;j;)j.scale&&(G/=j.scale[0]),j=j.parent;var q=O.childOfName("line");if(!(!this.__dirty&&!q.__dirty)){var J=q.shape.percent,X=q.pointAt(0),Y=q.pointAt(J),Q=v.sub([],Y,X);if(v.normalize(Q,Q),F){F.attr("position",X);var ee=q.tangentAt(0);F.attr("rotation",Math.PI/2-Math.atan2(ee[1],ee[0])),F.attr("scale",[G*J,G*J])}if(k){k.attr("position",Y);var ee=q.tangentAt(1);k.attr("rotation",-Math.PI/2-Math.atan2(ee[1],ee[0])),k.attr("scale",[G*J,G*J])}if(!U.ignore){U.attr("position",Y);var z,ie,re,ne,oe=U.__labelDistance,se=oe[0]*G,ae=oe[1]*G,fe=J/2,ee=q.tangentAt(fe),de=[ee[1],-ee[0]],ve=q.pointAt(fe);de[1]>0&&(de[0]=-de[0],de[1]=-de[1]);var pe=ee[0]<0?-1:1;if(U.__position!=="start"&&U.__position!=="end"){var ce=-Math.atan2(ee[1],ee[0]);Y[0].8?"left":Q[0]<-.8?"right":"center",re=Q[1]>.8?"top":Q[1]<-.8?"bottom":"middle";break;case"start":z=[-Q[0]*se+X[0],-Q[1]*ae+X[1]],ie=Q[0]>.8?"right":Q[0]<-.8?"left":"center",re=Q[1]>.8?"bottom":Q[1]<-.8?"top":"middle";break;case"insideStartTop":case"insideStart":case"insideStartBottom":z=[se*pe+X[0],X[1]+he],ie=ee[0]<0?"right":"left",ne=[-se*pe,-he];break;case"insideMiddleTop":case"insideMiddle":case"insideMiddleBottom":case"middle":z=[ve[0],ve[1]+he],ie="center",ne=[0,-he];break;case"insideEndTop":case"insideEnd":case"insideEndBottom":z=[-se*pe+Y[0],Y[1]+he],ie=ee[0]>=0?"right":"left",ne=[se*pe,-he];break}U.attr({style:{textVerticalAlign:U.__verticalAlign||re,textAlign:U.__textAlign||ie},position:z,scale:[G,G],origin:ne})}}}}function D(O,F,k){C.Group.call(this),this._createLine(O,F,k)}var L=D.prototype;L.beforeUpdate=P,L._createLine=function(O,F,k){var U=O.hostModel,G=O.getItemLayout(F),j=M(G);j.shape.percent=0,C.initProps(j,{shape:{percent:1}},U,F),this.add(j);var q=new C.Text({name:"label",lineLabelOriginalOpacity:1});this.add(q),m.each(E,function(J){var X=S(J,O,F);this.add(X),this[T(J)]=O.getItemVisual(F,J)},this),this._updateCommonStl(O,F,k)},L.updateData=function(O,F,k){var U=O.hostModel,G=this.childOfName("line"),j=O.getItemLayout(F),q={shape:{}};I(q.shape,j),C.updateProps(G,q,U,F),m.each(E,function(J){var X=O.getItemVisual(F,J),Y=T(J);if(this[Y]!==X){this.remove(this.childOfName(J));var Q=S(J,O,F);this.add(Q)}this[Y]=X},this),this._updateCommonStl(O,F,k)},L._updateCommonStl=function(O,F,k){var U=O.hostModel,G=this.childOfName("line"),j=k&&k.lineStyle,q=k&&k.hoverLineStyle,J=k&&k.labelModel,X=k&&k.hoverLabelModel;if(!k||O.hasItemOption){var Y=O.getItemModel(F);j=Y.getModel("lineStyle").getLineStyle(),q=Y.getModel("emphasis.lineStyle").getLineStyle(),J=Y.getModel("label"),X=Y.getModel("emphasis.label")}var Q=O.getItemVisual(F,"color"),ee=m.retrieve3(O.getItemVisual(F,"opacity"),j.opacity,1);G.useStyle(m.defaults({strokeNoScale:!0,fill:"none",stroke:Q,opacity:ee},j)),G.hoverStyle=q,m.each(E,function(pe){var ce=this.childOfName(pe);ce&&(ce.setColor(Q),ce.setStyle({opacity:ee}))},this);var z=J.getShallow("show"),ie=X.getShallow("show"),re=this.childOfName("label"),ne,oe;if((z||ie)&&(ne=Q||"#000",oe=U.getFormattedLabel(F,"normal",O.dataType),oe==null)){var se=U.getRawValue(F);oe=se==null?O.getName(F):isFinite(se)?A(se):se}var ae=z?oe:null,fe=ie?m.retrieve2(U.getFormattedLabel(F,"emphasis",O.dataType),oe):null,de=re.style;if(ae!=null||fe!=null){C.setTextStyle(re.style,J,{text:ae},{autoColor:ne}),re.__textAlign=de.textAlign,re.__verticalAlign=de.textVerticalAlign,re.__position=J.get("position")||"middle";var ve=J.get("distance");m.isArray(ve)||(ve=[ve,ve]),re.__labelDistance=ve}fe!=null?re.hoverStyle={text:fe,textFill:X.getTextColor(!0),fontStyle:X.getShallow("fontStyle"),fontWeight:X.getShallow("fontWeight"),fontSize:X.getShallow("fontSize"),fontFamily:X.getShallow("fontFamily")}:re.hoverStyle={text:null},re.ignore=!z&&!ie,C.setHoverStyle(this)},L.highlight=function(){this.trigger("emphasis")},L.downplay=function(){this.trigger("normal")},L.updateLayout=function(O,F){this.setLinePoints(O.getItemLayout(F))},L.setLinePoints=function(O){var F=this.childOfName("line");I(F.shape,O),F.dirty()},m.inherits(D,C.Group);var R=D;f.exports=R}),L0e=xt((o,f)=>{var m=xa(),v=D0e();function y(I){this._ctor=I||v,this.group=new m.Group}var x=y.prototype;x.isPersistent=function(){return!0},x.updateData=function(I){var P=this,D=P.group,L=P._lineData;P._lineData=I,L||D.removeAll();var R=E(I);I.diff(L).add(function(O){C(P,I,O,R)}).update(function(O,F){w(P,L,I,F,O,R)}).remove(function(O){D.remove(L.getItemGraphicEl(O))}).execute()};function C(I,P,D,L){var R=P.getItemLayout(D);if(S(R)){var O=new I._ctor(P,D,L);P.setItemGraphicEl(D,O),I.group.add(O)}}function w(I,P,D,L,R,O){var F=P.getItemGraphicEl(L);if(!S(D.getItemLayout(R))){I.group.remove(F);return}F?F.updateData(D,R,O):F=new I._ctor(D,R,O),D.setItemGraphicEl(R,F),I.group.add(F)}x.updateLayout=function(){var I=this._lineData;I&&I.eachItemGraphicEl(function(P,D){P.updateLayout(I,D)},this)},x.incrementalPrepareUpdate=function(I){this._seriesScope=E(I),this._lineData=null,this.group.removeAll()};function A(I){return I.animators&&I.animators.length>0}x.incrementalUpdate=function(I,P){function D(F){!F.isGroup&&!A(F)&&(F.incremental=F.useHoverLayer=!0)}for(var L=I.start;L{function f(v){var y=v.coordinateSystem;if(y.type!=="view")return 1;var x=v.option.nodeScaleRatio,C=y.scale,w=C&&C[0]||1,A=y.getZoom(),E=(A-1)*x+1;return E/w}function m(v){var y=v.getVisual("symbolSize");return y instanceof Array&&(y=(y[0]+y[1])/2),+y}o.getNodeGlobalScale=f,o.getSymbolSize=m}),myt=xt((o,f)=>{var m=q3(),v=lf(),y=R0e(),x=y.getSymbolSize,C=[],w=[],A=[],E=m.quadraticAt,T=v.distSquare,S=Math.abs;function M(P,D,L){for(var R=P[0],O=P[1],F=P[2],k=1/0,U,G=L*L,j=.1,q=.1;q<=.9;q+=.1){C[0]=E(R[0],O[0],F[0],q),C[1]=E(R[1],O[1],F[1],q);var J=S(T(C,D)-G);J=0?U=U+j:U=U-j:Q>=0?U=U-j:U=U+j}return U}function I(P,D){var L=[],R=m.quadraticSubdivide,O=[[],[],[]],F=[[],[]],k=[];D/=2,P.eachEdge(function(U,G){var j=U.getLayout(),q=U.getVisual("fromSymbol"),J=U.getVisual("toSymbol");j.__original||(j.__original=[v.clone(j[0]),v.clone(j[1])],j[2]&&j.__original.push(v.clone(j[2])));var X=j.__original;if(j[2]!=null){if(v.copy(O[0],X[0]),v.copy(O[1],X[2]),v.copy(O[2],X[1]),q&&q!=="none"){var Y=x(U.node1),Q=M(O,X[0],Y*D);R(O[0][0],O[1][0],O[2][0],Q,L),O[0][0]=L[3],O[1][0]=L[4],R(O[0][1],O[1][1],O[2][1],Q,L),O[0][1]=L[3],O[1][1]=L[4]}if(J&&J!=="none"){var Y=x(U.node2),Q=M(O,X[1],Y*D);R(O[0][0],O[1][0],O[2][0],Q,L),O[1][0]=L[1],O[2][0]=L[2],R(O[0][1],O[1][1],O[2][1],Q,L),O[1][1]=L[1],O[2][1]=L[2]}v.copy(j[0],O[0]),v.copy(j[1],O[2]),v.copy(j[2],O[1])}else{if(v.copy(F[0],X[0]),v.copy(F[1],X[1]),v.sub(k,F[1],F[0]),v.normalize(k,k),q&&q!=="none"){var Y=x(U.node1);v.scaleAndAdd(F[0],F[0],k,Y*D)}if(J&&J!=="none"){var Y=x(U.node2);v.scaleAndAdd(F[1],F[1],k,-Y*D)}v.copy(j[0],F[0]),v.copy(j[1],F[1])}})}f.exports=I}),gyt=xt((o,f)=>{var m=fo(),v=Wi(),y=Wj(),x=L0e(),C=Kj(),w=T0e(),A=Rie(),E=A.onIrrelevantElement,T=xa(),S=myt(),M=R0e(),I=M.getNodeGlobalScale,P="__focusNodeAdjacency",D="__unfocusNodeAdjacency",L=["itemStyle","opacity"],R=["lineStyle","opacity"];function O(G,j){var q=G.getVisual("opacity");return q??G.getModel().get(j)}function F(G,j,q){var J=G.getGraphicEl(),X=O(G,j);q!=null&&(X==null&&(X=1),X*=q),J.downplay&&J.downplay(),J.traverse(function(Y){if(!Y.isGroup){var Q=Y.lineLabelOriginalOpacity;(Q==null||q!=null)&&(Q=X),Y.setStyle("opacity",Q)}})}function k(G,j){var q=O(G,j),J=G.getGraphicEl();J.traverse(function(X){!X.isGroup&&X.setStyle("opacity",q)}),J.highlight&&J.highlight()}var U=m.extendChartView({type:"graph",init:function(G,j){var q=new y,J=new x,X=this.group;this._controller=new C(j.getZr()),this._controllerHost={target:X},X.add(q.group),X.add(J.group),this._symbolDraw=q,this._lineDraw=J,this._firstRender=!0},render:function(G,j,q){var J=this,X=G.coordinateSystem;this._model=G;var Y=this._symbolDraw,Q=this._lineDraw,ee=this.group;if(X.type==="view"){var z={position:X.position,scale:X.scale};this._firstRender?ee.attr(z):T.updateProps(ee,z,G)}S(G.getGraph(),I(G));var ie=G.getData();Y.updateData(ie);var re=G.getEdgeData();Q.updateData(re),this._updateNodeAndLinkScale(),this._updateController(G,j,q),clearTimeout(this._layoutTimeout);var ne=G.forceLayout,oe=G.get("force.layoutAnimation");ne&&this._startForceLayoutIteration(ne,oe),ie.eachItemGraphicEl(function(de,ve){var pe=ie.getItemModel(ve);de.off("drag").off("dragend");var ce=pe.get("draggable");ce&&de.on("drag",function(){ne&&(ne.warmUp(),!this._layouting&&this._startForceLayoutIteration(ne,oe),ne.setFixed(ve),ie.setItemLayout(ve,de.position))},this).on("dragend",function(){ne&&ne.setUnfixed(ve)},this),de.setDraggable(ce&&ne),de[P]&&de.off("mouseover",de[P]),de[D]&&de.off("mouseout",de[D]),pe.get("focusNodeAdjacency")&&(de.on("mouseover",de[P]=function(){J._clearTimer(),q.dispatchAction({type:"focusNodeAdjacency",seriesId:G.id,dataIndex:de.dataIndex})}),de.on("mouseout",de[D]=function(){J._dispatchUnfocus(q)}))},this),ie.graph.eachEdge(function(de){var ve=de.getGraphicEl();ve[P]&&ve.off("mouseover",ve[P]),ve[D]&&ve.off("mouseout",ve[D]),de.getModel().get("focusNodeAdjacency")&&(ve.on("mouseover",ve[P]=function(){J._clearTimer(),q.dispatchAction({type:"focusNodeAdjacency",seriesId:G.id,edgeDataIndex:de.dataIndex})}),ve.on("mouseout",ve[D]=function(){J._dispatchUnfocus(q)}))});var se=G.get("layout")==="circular"&&G.get("circular.rotateLabel"),ae=ie.getLayout("cx"),fe=ie.getLayout("cy");ie.eachItemGraphicEl(function(de,ve){var pe=ie.getItemModel(ve),ce=pe.get("label.rotate")||0,he=de.getSymbolPath();if(se){var Ce=ie.getItemLayout(ve),Se=Math.atan2(Ce[1]-fe,Ce[0]-ae);Se<0&&(Se=Math.PI*2+Se);var De=Ce[0]{var o=fo();o.registerAction({type:"focusNodeAdjacency",event:"focusNodeAdjacency",update:"series:focusNodeAdjacency"},function(){}),o.registerAction({type:"unfocusNodeAdjacency",event:"unfocusNodeAdjacency",update:"series:unfocusNodeAdjacency"},function(){})}),_yt=xt(()=>{var o=fo(),f=S0e(),m=f.updateCenterAndZoom;vGe();var v={type:"graphRoam",event:"graphRoam",update:"none"};o.registerAction(v,function(y,x){x.eachComponent({mainType:"series",query:y},function(C){var w=C.coordinateSystem,A=m(w,y);C.setCenter&&C.setCenter(A.center),C.setZoom&&C.setZoom(A.zoom)})})}),vyt=xt((o,f)=>{function m(v){var y=v.findComponents({mainType:"legend"});!y||!y.length||v.eachSeriesByType("graph",function(x){var C=x.getCategoriesData(),w=x.getGraph(),A=w.data,E=C.mapArray(C.getName);A.filterSelf(function(T){var S=A.getItemModel(T),M=S.getShallow("category");if(M!=null){typeof M=="number"&&(M=E[M]);for(var I=0;I{function m(v){var y={};v.eachSeriesByType("graph",function(x){var C=x.getCategoriesData(),w=x.getData(),A={};C.each(function(E){var T=C.getName(E);A["ec-"+T]=E;var S=C.getItemModel(E),M=S.get("itemStyle.color")||x.getColorFromPalette(T,y);C.setItemVisual(E,"color",M);for(var I=["opacity","symbol","symbolSize","symbolKeepAspect"],P=0;P{function m(y){return y instanceof Array||(y=[y,y]),y}function v(y){y.eachSeriesByType("graph",function(x){var C=x.getGraph(),w=x.getEdgeData(),A=m(x.get("edgeSymbol")),E=m(x.get("edgeSymbolSize")),T="lineStyle.color".split("."),S="lineStyle.opacity".split(".");w.setVisual("fromSymbol",A&&A[0]),w.setVisual("toSymbol",A&&A[1]),w.setVisual("fromSymbolSize",E&&E[0]),w.setVisual("toSymbolSize",E&&E[1]),w.setVisual("color",x.get(T)),w.setVisual("opacity",x.get(S)),w.each(function(M){var I=w.getItemModel(M),P=C.getEdgeByIndex(M),D=m(I.getShallow("symbol",!0)),L=m(I.getShallow("symbolSize",!0)),R=I.get(T),O=I.get(S);switch(R){case"source":R=P.node1.getVisual("color");break;case"target":R=P.node2.getVisual("color");break}D[0]&&P.setVisual("fromSymbol",D[0]),D[1]&&P.setVisual("toSymbol",D[1]),L[0]&&P.setVisual("fromSymbolSize",L[0]),L[1]&&P.setVisual("toSymbolSize",L[1]),P.setVisual("color",R),P.setVisual("opacity",O)})})}f.exports=v}),yGe=xt(o=>{var f=lf();function m(y){var x=y.coordinateSystem;if(!(x&&x.type!=="view")){var C=y.getGraph();C.eachNode(function(w){var A=w.getModel();w.setLayout([+A.get("x"),+A.get("y")])}),v(C)}}function v(y){y.eachEdge(function(x){var C=x.getModel().get("lineStyle.curveness")||0,w=f.clone(x.node1.getLayout()),A=f.clone(x.node2.getLayout()),E=[w,A];+C&&E.push([(w[0]+A[0])/2-(w[1]-A[1])*C,(w[1]+A[1])/2-(A[0]-w[0])*C]),x.setLayout(E)})}o.simpleLayout=m,o.simpleLayoutEdge=v}),Cyt=xt((o,f)=>{var m=Wi(),v=m.each,y=yGe(),x=y.simpleLayout,C=y.simpleLayoutEdge;function w(A,E){A.eachSeriesByType("graph",function(T){var S=T.get("layout"),M=T.coordinateSystem;if(M&&M.type!=="view"){var I=T.getData(),P=[];v(M.dimensions,function(k){P=P.concat(I.mapDimension(k,!0))});for(var D=0;D{var f=lf(),m=R0e(),v=m.getSymbolSize,y=m.getNodeGlobalScale,x=Math.PI,C=[];function w(E,T){var S=E.coordinateSystem;if(!(S&&S.type!=="view")){var M=S.getBoundingRect(),I=E.getData(),P=I.graph,D=M.width/2+M.x,L=M.height/2+M.y,R=Math.min(M.width,M.height)/2,O=I.count();I.setLayout({cx:D,cy:L}),O&&(A[T](E,S,P,I,R,D,L,O),P.eachEdge(function(F){var k=F.getModel().get("lineStyle.curveness")||0,U=f.clone(F.node1.getLayout()),G=f.clone(F.node2.getLayout()),j,q=(U[0]+G[0])/2,J=(U[1]+G[1])/2;+k&&(k*=3,j=[D*k+q*(1-k),L*k+J*(1-k)]),F.setLayout([U,G,j])}))}}var A={value:function(E,T,S,M,I,P,D,L){var R=0,O=M.getSum("value"),F=Math.PI*2/(O||L);S.eachNode(function(k){var U=k.getValue("value"),G=F*(O?U:1)/2;R+=G,k.setLayout([I*Math.cos(R)+P,I*Math.sin(R)+D]),R+=G})},symbolSize:function(E,T,S,M,I,P,D,L){var R=0;C.length=L;var O=y(E);S.eachNode(function(U){var G=v(U);isNaN(G)&&(G=2),G<0&&(G=0),G*=O;var j=Math.asin(G/2/I);isNaN(j)&&(j=x/2),C[U.dataIndex]=j,R+=j*2});var F=(2*x-R)/L/2,k=0;S.eachNode(function(U){var G=F+C[U.dataIndex];k+=G,U.setLayout([I*Math.cos(k)+P,I*Math.sin(k)+D]),k+=G})}};o.circularLayout=w}),byt=xt((o,f)=>{var m=xGe(),v=m.circularLayout;function y(x){x.eachSeriesByType("graph",function(C){C.get("layout")==="circular"&&v(C,"symbolSize")})}f.exports=y}),wyt=xt(o=>{var f=lf(),m=f.scaleAndAdd;function v(y,x,C){for(var w=C.rect,A=w.width,E=w.height,T=[w.x+A/2,w.y+E/2],S=C.gravity==null?.1:C.gravity,M=0;M{var m=wyt(),v=m.forceLayout,y=yGe(),x=y.simpleLayout,C=xGe(),w=C.circularLayout,A=il(),E=A.linearMap,T=lf(),S=Wi();function M(I){I.eachSeriesByType("graph",function(P){var D=P.coordinateSystem;if(!(D&&D.type!=="view"))if(P.get("layout")==="force"){var L=P.preservedPoints||{},R=P.getGraph(),O=R.data,F=R.edgeData,k=P.getModel("force"),U=k.get("initLayout");P.preservedPoints?O.each(function(re){var ne=O.getId(re);O.setItemLayout(re,L[ne]||[NaN,NaN])}):!U||U==="none"?x(P):U==="circular"&&w(P,"value");var G=O.getDataExtent("value"),j=F.getDataExtent("value"),q=k.get("repulsion"),J=k.get("edgeLength");S.isArray(q)||(q=[q,q]),S.isArray(J)||(J=[J,J]),J=[J[1],J[0]];var X=O.mapArray("value",function(re,ne){var oe=O.getItemLayout(ne),se=E(re,G,q);return isNaN(se)&&(se=(q[0]+q[1])/2),{w:se,rep:se,fixed:O.getItemModel(ne).get("fixed"),p:!oe||isNaN(oe[0])||isNaN(oe[1])?null:oe}}),Y=F.mapArray("value",function(re,ne){var oe=R.getEdgeByIndex(ne),se=E(re,j,J);isNaN(se)&&(se=(J[0]+J[1])/2);var ae=oe.getModel();return{n1:X[oe.node1.dataIndex],n2:X[oe.node2.dataIndex],d:se,curveness:ae.get("lineStyle.curveness")||0,ignoreForceLayout:ae.get("ignoreForceLayout")}}),D=P.coordinateSystem,Q=D.getBoundingRect(),ee=v(X,Y,{rect:Q,gravity:k.get("gravity"),friction:k.get("friction")}),z=ee.step;ee.step=function(re){for(var ne=0,oe=X.length;ne{var m=P0e(),v=rd(),y=v.getLayoutRect,x=Vj();function C(A,E,T){var S=A.getBoxLayoutParams();return S.aspect=T,y(S,{width:E.getWidth(),height:E.getHeight()})}function w(A,E){var T=[];return A.eachSeriesByType("graph",function(S){var M=S.get("coordinateSystem");if(!M||M==="view"){var I=S.getData(),P=I.mapArray(function(q){var J=I.getItemModel(q);return[+J.get("x"),+J.get("y")]}),D=[],L=[];x.fromPoints(P,D,L),L[0]-D[0]===0&&(L[0]+=1,D[0]-=1),L[1]-D[1]===0&&(L[1]+=1,D[1]-=1);var R=(L[0]-D[0])/(L[1]-D[1]),O=C(S,E,R);isNaN(R)&&(D=[O.x,O.y],L=[O.x+O.width,O.y+O.height]);var F=L[0]-D[0],k=L[1]-D[1],U=O.width,G=O.height,j=S.coordinateSystem=new m;j.zoomLimit=S.get("scaleLimit"),j.setBoundingRect(D[0],D[1],F,k),j.setViewRect(O.x,O.y,U,G),j.setCenter(S.get("center")),j.setZoom(S.get("zoom")),T.push(j)}}),T}f.exports=w}),Tyt=xt(()=>{var o=fo();fyt(),gyt(),_yt();var f=vyt(),m=sB(),v=yyt(),y=xyt(),x=Cyt(),C=byt(),w=Ayt(),A=Eyt();o.registerProcessor(f),o.registerVisual(m("graph","circle",null)),o.registerVisual(v),o.registerVisual(y),o.registerLayout(x),o.registerLayout(o.PRIORITY.VISUAL.POST_CHART_LAYOUT,C),o.registerLayout(w),o.registerCoordinateSystem("graphView",{create:A})}),Syt=xt((o,f)=>{var m=uU(),v=Jg(),y=v.extend({type:"series.gauge",getInitialData:function(C,w){return m(this,["value"])},defaultOption:{zlevel:0,z:2,center:["50%","50%"],legendHoverLink:!0,radius:"75%",startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,lineStyle:{color:[[.2,"#91c7ae"],[.8,"#63869e"],[1,"#c23531"]],width:30}},splitLine:{show:!0,length:30,lineStyle:{color:"#eee",width:2,type:"solid"}},axisTick:{show:!0,splitNumber:5,length:8,lineStyle:{color:"#eee",width:1,type:"solid"}},axisLabel:{show:!0,distance:5,color:"auto"},pointer:{show:!0,length:"80%",width:8},itemStyle:{color:"auto"},title:{show:!0,offsetCenter:[0,"-40%"],color:"#333",fontSize:15},detail:{show:!0,backgroundColor:"rgba(0,0,0,0)",borderWidth:0,borderColor:"#ccc",width:100,height:null,padding:[5,10],offsetCenter:[0,"40%"],color:"auto",fontSize:30}}}),x=y;f.exports=x}),Pyt=xt((o,f)=>{var m=am(),v=m.extend({type:"echartsGaugePointer",shape:{angle:0,width:10,r:10,x:0,y:0},buildPath:function(y,x){var C=Math.cos,w=Math.sin,A=x.r,E=x.width,T=x.angle,S=x.x-C(T)*E*(E>=A/3?1:2),M=x.y-w(T)*E*(E>=A/3?1:2);T=x.angle-Math.PI/2,y.moveTo(S,M),y.lineTo(x.x+C(T)*E,x.y+w(T)*E),y.lineTo(x.x+C(x.angle)*A,x.y+w(x.angle)*A),y.lineTo(x.x-C(T)*E,x.y-w(T)*E),y.lineTo(S,M)}});f.exports=v}),Iyt=xt((o,f)=>{var m=Pyt(),v=xa(),y=V2(),x=il(),C=x.parsePercent,w=x.round,A=x.linearMap;function E(P,D){var L=P.get("center"),R=D.getWidth(),O=D.getHeight(),F=Math.min(R,O),k=C(L[0],D.getWidth()),U=C(L[1],D.getHeight()),G=C(P.get("radius"),F/2);return{cx:k,cy:U,r:G}}function T(P,D){return D&&(typeof D=="string"?P=D.replace("{value}",P??""):typeof D=="function"&&(P=D(P))),P}var S=Math.PI*2,M=y.extend({type:"gauge",render:function(P,D,L){this.group.removeAll();var R=P.get("axisLine.lineStyle.color"),O=E(P,L);this._renderMain(P,D,L,R,O)},dispose:function(){},_renderMain:function(P,D,L,R,O){for(var F=this.group,k=P.getModel("axisLine"),U=k.getModel("lineStyle"),G=P.get("clockwise"),j=-P.get("startAngle")/180*Math.PI,q=-P.get("endAngle")/180*Math.PI,J=(q-j)%S,X=j,Y=U.get("width"),Q=k.get("show"),ee=0;Q&&ee=oe&&(se===0?0:R[se-1][0]).4?"bottom":"middle",textAlign:ce<-.4?"left":ce>.4?"right":"center"},{autoColor:Oe}),silent:!0}))}if(ee.get("show")&&pe!==ie){for(var Ue=0;Ue<=re;Ue++){var ce=Math.cos(se),he=Math.sin(se),Xe=new v.Line({shape:{x1:ce*J+j,y1:he*J+q,x2:ce*(J-oe)+j,y2:he*(J-oe)+q},silent:!0,style:ve});ve.stroke==="auto"&&Xe.setStyle({stroke:R((pe+Ue/re)/ie)}),G.add(Xe),se+=fe}se-=fe}else se+=ae}},_renderPointer:function(P,D,L,R,O,F,k,U){var G=this.group,j=this._data;if(!P.get("pointer.show")){j&&j.eachItemGraphicEl(function(Q){G.remove(Q)});return}var q=[+P.get("min"),+P.get("max")],J=[F,k],X=P.getData(),Y=X.mapDimension("value");X.diff(j).add(function(Q){var ee=new m({shape:{angle:F}});v.initProps(ee,{shape:{angle:A(X.get(Y,Q),q,J,!0)}},P),G.add(ee),X.setItemGraphicEl(Q,ee)}).update(function(Q,ee){var z=j.getItemGraphicEl(ee);v.updateProps(z,{shape:{angle:A(X.get(Y,Q),q,J,!0)}},P),G.add(z),X.setItemGraphicEl(Q,z)}).remove(function(Q){var ee=j.getItemGraphicEl(Q);G.remove(ee)}).execute(),X.eachItemGraphicEl(function(Q,ee){var z=X.getItemModel(ee),ie=z.getModel("pointer");Q.setShape({x:O.cx,y:O.cy,width:C(ie.get("width"),O.r),r:C(ie.get("length"),O.r)}),Q.useStyle(z.getModel("itemStyle").getItemStyle()),Q.style.fill==="auto"&&Q.setStyle("fill",R(A(X.get(Y,ee),q,[0,1],!0))),v.setHoverStyle(Q,z.getModel("emphasis.itemStyle").getItemStyle())}),this._data=X},_renderTitle:function(P,D,L,R,O){var F=P.getData(),k=F.mapDimension("value"),U=P.getModel("title");if(U.get("show")){var G=U.get("offsetCenter"),j=O.cx+C(G[0],O.r),q=O.cy+C(G[1],O.r),J=+P.get("min"),X=+P.get("max"),Y=P.getData().get(k,0),Q=R(A(Y,[J,X],[0,1],!0));this.group.add(new v.Text({silent:!0,style:v.setTextStyle({},U,{x:j,y:q,text:F.getName(0),textAlign:"center",textVerticalAlign:"middle"},{autoColor:Q,forceRich:!0})}))}},_renderDetail:function(P,D,L,R,O){var F=P.getModel("detail"),k=+P.get("min"),U=+P.get("max");if(F.get("show")){var G=F.get("offsetCenter"),j=O.cx+C(G[0],O.r),q=O.cy+C(G[1],O.r),J=C(F.get("width"),O.r),X=C(F.get("height"),O.r),Y=P.getData(),Q=Y.get(Y.mapDimension("value"),0),ee=R(A(Q,[k,U],[0,1],!0));this.group.add(new v.Text({silent:!0,style:v.setTextStyle({},F,{x:j,y:q,text:T(Q,F.get("formatter")),textWidth:isNaN(J)?null:J,textHeight:isNaN(X)?null:X,textAlign:"center",textVerticalAlign:"middle"},{autoColor:ee,forceRich:!0})}))}}}),I=M;f.exports=I}),Myt=xt(()=>{Syt(),Iyt()}),Dyt=xt((o,f)=>{var m=fo(),v=Wi(),y=uU(),x=vu(),C=x.defaultEmphasis,w=VM(),A=w.makeSeriesEncodeForNameBased,E=Xj(),T=m.extendSeriesModel({type:"series.funnel",init:function(M){T.superApply(this,"init",arguments),this.legendVisualProvider=new E(v.bind(this.getData,this),v.bind(this.getRawData,this)),this._defaultLabelLine(M)},getInitialData:function(M,I){return y(this,{coordDimensions:["value"],encodeDefaulter:v.curry(A,this)})},_defaultLabelLine:function(M){C(M,"labelLine",["show"]);var I=M.labelLine,P=M.emphasis.labelLine;I.show=I.show&&M.label.show,P.show=P.show&&M.emphasis.label.show},getDataParams:function(M){var I=this.getData(),P=T.superCall(this,"getDataParams",M),D=I.mapDimension("value"),L=I.getSum(D);return P.percent=L?+(I.get(D,M)/L*100).toFixed(2):0,P.$vars.push("percent"),P},defaultOption:{zlevel:0,z:2,legendHoverLink:!0,left:80,top:60,right:80,bottom:60,minSize:"0%",maxSize:"100%",sort:"descending",gap:0,funnelAlign:"center",label:{show:!0,position:"outer"},labelLine:{show:!0,length:20,lineStyle:{width:1,type:"solid"}},itemStyle:{borderColor:"#fff",borderWidth:1},emphasis:{label:{show:!0}}}}),S=T;f.exports=S}),Lyt=xt((o,f)=>{var m=xa(),v=Wi(),y=V2();function x(T,S){m.Group.call(this);var M=new m.Polygon,I=new m.Polyline,P=new m.Text;this.add(M),this.add(I),this.add(P),this.highDownOnUpdate=function(D,L){L==="emphasis"?(I.ignore=I.hoverIgnore,P.ignore=P.hoverIgnore):(I.ignore=I.normalIgnore,P.ignore=P.normalIgnore)},this.updateData(T,S,!0)}var C=x.prototype,w=["itemStyle","opacity"];C.updateData=function(T,S,M){var I=this.childAt(0),P=T.hostModel,D=T.getItemModel(S),L=T.getItemLayout(S),R=T.getItemModel(S).get(w);R=R??1,I.useStyle({}),M?(I.setShape({points:L.points}),I.setStyle({opacity:0}),m.initProps(I,{style:{opacity:R}},P,S)):m.updateProps(I,{style:{opacity:R},shape:{points:L.points}},P,S);var O=D.getModel("itemStyle"),F=T.getItemVisual(S,"color");I.setStyle(v.defaults({lineJoin:"round",fill:F},O.getItemStyle(["opacity"]))),I.hoverStyle=O.getModel("emphasis").getItemStyle(),this._updateLabel(T,S),m.setHoverStyle(this)},C._updateLabel=function(T,S){var M=this.childAt(1),I=this.childAt(2),P=T.hostModel,D=T.getItemModel(S),L=T.getItemLayout(S),R=L.label,G=T.getItemVisual(S,"color");m.updateProps(M,{shape:{points:R.linePoints||R.linePoints}},P,S),m.updateProps(I,{style:{x:R.x,y:R.y}},P,S),I.attr({rotation:R.rotation,origin:[R.x,R.y],z2:10});var O=D.getModel("label"),F=D.getModel("emphasis.label"),k=D.getModel("labelLine"),U=D.getModel("emphasis.labelLine"),G=T.getItemVisual(S,"color");m.setLabelStyle(I.style,I.hoverStyle={},O,F,{labelFetcher:T.hostModel,labelDataIndex:S,defaultText:T.getName(S),autoColor:G,useInsideStyle:!!R.inside},{textAlign:R.textAlign,textVerticalAlign:R.verticalAlign}),I.ignore=I.normalIgnore=!O.get("show"),I.hoverIgnore=!F.get("show"),M.ignore=M.normalIgnore=!k.get("show"),M.hoverIgnore=!U.get("show"),M.setStyle({stroke:G}),M.setStyle(k.getModel("lineStyle").getLineStyle()),M.hoverStyle=U.getModel("lineStyle").getLineStyle()},v.inherits(x,m.Group);var A=y.extend({type:"funnel",render:function(T,S,M){var I=T.getData(),P=this._data,D=this.group;I.diff(P).add(function(L){var R=new x(I,L);I.setItemGraphicEl(L,R),D.add(R)}).update(function(L,R){var O=P.getItemGraphicEl(R);O.updateData(I,L),D.add(O),I.setItemGraphicEl(L,O)}).remove(function(L){var R=P.getItemGraphicEl(L);D.remove(R)}).execute(),this._data=I},remove:function(){this.group.removeAll(),this._data=null},dispose:function(){}}),E=A;f.exports=E}),Ryt=xt((o,f)=>{var m=rd(),v=il(),y=v.parsePercent,x=v.linearMap;function C(T,S){return m.getLayoutRect(T.getBoxLayoutParams(),{width:S.getWidth(),height:S.getHeight()})}function w(T,S){for(var M=T.mapDimension("value"),I=T.mapArray(M,function(O){return O}),P=[],D=S==="ascending",L=0,R=T.count();L{var o=fo();Dyt(),Lyt();var f=Die(),m=Ryt(),v=Jj();o.registerVisual(f("funnel")),o.registerLayout(m),o.registerProcessor(v("funnel"))}),Nyt=xt((o,f)=>{var m=Wi(),v=vu();function y(w){x(w),C(w)}function x(w){if(!w.parallel){var A=!1;m.each(w.series,function(E){E&&E.type==="parallel"&&(A=!0)}),A&&(w.parallel=[{}])}}function C(w){var A=v.normalizeToArray(w.parallelAxis);m.each(A,function(E){if(m.isObject(E)){var T=E.parallelIndex||0,S=v.normalizeToArray(w.parallel)[T];S&&S.parallelAxisDefault&&m.merge(E,S.parallelAxisDefault,!1)}})}f.exports=y}),Fyt=xt((o,f)=>{var m=Wi(),v=K3(),y=function(C,w,A,E,T){v.call(this,C,w,A),this.type=E||"value",this.axisIndex=T};y.prototype={constructor:y,model:null,isHorizontal:function(){return this.coordinateSystem.getModel().get("layout")!=="horizontal"}},m.inherits(y,v);var x=y;f.exports=x}),cU=xt((o,f)=>{function m(x,C,w,A,E,T){x=x||0;var S=w[1]-w[0];if(E!=null&&(E=y(E,[0,S])),T!=null&&(T=Math.max(T,E??0)),A==="all"){var M=Math.abs(C[1]-C[0]);M=y(M,[0,S]),E=T=y(M,[E,T]),A=0}C[0]=y(C[0],w),C[1]=y(C[1],w);var I=v(C,A);C[A]+=x;var P=E||0,D=w.slice();I.sign<0?D[0]+=P:D[1]-=P,C[A]=y(C[A],D);var L=v(C,A);E!=null&&(L.sign!==I.sign||L.spanT&&(C[1-A]=C[A]+L.sign*T),C}function v(x,C){var w=x[C]-x[1-C];return{span:Math.abs(w),sign:w>0?-1:w<0?1:C?-1:1}}function y(x,C){return Math.min(C[1]!=null?C[1]:1/0,Math.max(C[0]!=null?C[0]:-1/0,x))}f.exports=m}),Byt=xt((o,f)=>{var m=Wi(),v=Ky(),y=rd(),x=sT(),C=Fyt(),w=xa(),A=il(),E=cU(),T=m.each,S=Math.min,M=Math.max,I=Math.floor,P=Math.ceil,D=A.round,L=Math.PI;function R(G,j,q){this._axesMap=m.createHashMap(),this._axesLayout={},this.dimensions=G.dimensions,this._rect,this._model=G,this._init(G,j,q)}R.prototype={type:"parallel",constructor:R,_init:function(G,j,q){var J=G.dimensions,X=G.parallelAxisIndex;T(J,function(Y,Q){var ee=X[Q],z=j.getComponent("parallelAxis",ee),ie=this._axesMap.set(Y,new C(Y,x.createScaleByModel(z),[0,0],z.get("type"),ee)),re=ie.type==="category";ie.onBand=re&&z.get("boundaryGap"),ie.inverse=z.get("inverse"),z.axis=ie,ie.model=z,ie.coordinateSystem=z.coordinateSystem=this},this)},update:function(G,j){this._updateAxesFromSeries(this._model,G)},containPoint:function(G){var j=this._makeLayoutInfo(),q=j.axisBase,J=j.layoutBase,X=j.pixelDimIndex,Y=G[1-X],Q=G[X];return Y>=q&&Y<=q+j.axisLength&&Q>=J&&Q<=J+j.layoutLength},getModel:function(){return this._model},_updateAxesFromSeries:function(G,j){j.eachSeries(function(q){if(G.contains(q,j)){var J=q.getData();T(this.dimensions,function(X){var Y=this._axesMap.get(X);Y.scale.unionExtentFromData(J,J.mapDimension(X)),x.niceScaleExtent(Y.scale,Y.model)},this)}},this)},resize:function(G,j){this._rect=y.getLayoutRect(G.getBoxLayoutParams(),{width:j.getWidth(),height:j.getHeight()}),this._layoutAxes()},getRect:function(){return this._rect},_makeLayoutInfo:function(){var G=this._model,j=this._rect,q=["x","y"],J=["width","height"],X=G.get("layout"),Y=X==="horizontal"?0:1,Q=j[J[Y]],ee=[0,Q],z=this.dimensions.length,ie=O(G.get("axisExpandWidth"),ee),re=O(G.get("axisExpandCount")||0,[0,z]),ne=G.get("axisExpandable")&&z>3&&z>re&&re>1&&ie>0&&Q>0,oe=G.get("axisExpandWindow"),se;if(oe)se=O(oe[1]-oe[0],ee),oe[1]=oe[0]+se;else{se=O(ie*(re-1),ee);var ae=G.get("axisExpandCenter")||I(z/2);oe=[ie*ae-se/2],oe[1]=oe[0]+se}var fe=(Q-se)/(z-re);fe<3&&(fe=0);var de=[I(D(oe[0]/ie,1))+1,P(D(oe[1]/ie,1))-1],ve=fe/ie*oe[0];return{layout:X,pixelDimIndex:Y,layoutBase:j[q[Y]],layoutLength:Q,axisBase:j[q[1-Y]],axisLength:j[J[1-Y]],axisExpandable:ne,axisExpandWidth:ie,axisCollapseWidth:fe,axisExpandWindow:oe,axisCount:z,winInnerIndices:de,axisExpandWindow0Pos:ve}},_layoutAxes:function(){var G=this._rect,j=this._axesMap,q=this.dimensions,J=this._makeLayoutInfo(),X=J.layout;j.each(function(Y){var Q=[0,J.axisLength],ee=Y.inverse?1:0;Y.setExtent(Q[ee],Q[1-ee])}),T(q,function(Y,Q){var ee=(J.axisExpandable?k:F)(Q,J),z={horizontal:{x:ee.position,y:J.axisLength},vertical:{x:0,y:ee.position}},ie={horizontal:L/2,vertical:0},re=[z[X].x+G.x,z[X].y+G.y],ne=ie[X],oe=v.create();v.rotate(oe,oe,ne),v.translate(oe,oe,re),this._axesLayout[Y]={position:re,rotation:ne,transform:oe,axisNameAvailableWidth:ee.axisNameAvailableWidth,axisLabelShow:ee.axisLabelShow,nameTruncateMaxWidth:ee.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},getAxis:function(G){return this._axesMap.get(G)},dataToPoint:function(G,j){return this.axisCoordToPoint(this._axesMap.get(j).dataToCoord(G),j)},eachActiveState:function(G,j,q,J){q==null&&(q=0),J==null&&(J=G.count());var X=this._axesMap,Y=this.dimensions,Q=[],ee=[];m.each(Y,function(fe){Q.push(G.mapDimension(fe)),ee.push(X.get(fe).model)});for(var z=this.hasAxisBrushed(),ie=q;ieX*(1-re[0])?(z="jump",ee=Q-X*(1-re[2])):(ee=Q-X*re[1])>=0&&(ee=Q-X*(1-re[1]))<=0&&(ee=0),ee*=j.axisExpandWidth/ie,ee?E(ee,J,Y,"all"):z="none";else{var X=J[1]-J[0],oe=Y[1]*Q/X;J=[M(0,oe-X/2)],J[1]=S(Y[1],J[0]+X),J[0]=J[1]-X}return{axisExpandWindow:J,behavior:z}}};function O(G,j){return S(M(G,j[0]),j[1])}function F(G,j){var q=j.layoutLength/(j.axisCount-1);return{position:q*G,axisNameAvailableWidth:q,axisLabelShow:!0}}function k(G,j){var q=j.layoutLength,J=j.axisExpandWidth,X=j.axisCount,Y=j.axisCollapseWidth,Q=j.winInnerIndices,ee,z=Y,ie=!1,re;return G{var o=Byt(),f=aT();function m(v,y){var x=[];return v.eachComponent("parallel",function(C,w){var A=new o(C,v,y);A.name="parallel_"+w,A.resize(C,y),C.coordinateSystem=A,A.model=C,x.push(A)}),v.eachSeries(function(C){if(C.get("coordinateSystem")==="parallel"){var w=v.queryComponents({mainType:"parallel",index:C.get("parallelIndex"),id:C.get("parallelId")})[0];C.coordinateSystem=w.coordinateSystem}}),x}f.register("parallel",{create:m})}),kyt=xt((o,f)=>{var m=Wi(),v=Xg(),y=nU(),x=Iie(),C=il(),w=lU(),A=v.extend({type:"baseParallelAxis",axis:null,activeIntervals:[],getAreaSelectStyle:function(){return y([["fill","color"],["lineWidth","borderWidth"],["stroke","borderColor"],["width","width"],["opacity","opacity"]])(this.getModel("areaSelectStyle"))},setActiveIntervals:function(M){var I=this.activeIntervals=m.clone(M);if(I)for(var P=I.length-1;P>=0;P--)C.asc(I[P])},getActiveState:function(M){var I=this.activeIntervals;if(!I.length)return"normal";if(M==null||isNaN(M))return"inactive";if(I.length===1){var P=I[0];if(P[0]<=M&&M<=P[1])return"active"}else for(var D=0,L=I.length;D{var m=Wi(),v=Xg();kyt();var y=v.extend({type:"parallel",dependencies:["parallelAxis"],coordinateSystem:null,dimensions:null,parallelAxisIndex:null,layoutMode:"box",defaultOption:{zlevel:0,z:0,left:80,top:60,right:80,bottom:60,layout:"horizontal",axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:"click",parallelAxisDefault:null},init:function(){v.prototype.init.apply(this,arguments),this.mergeOption({})},mergeOption:function(x){var C=this.option;x&&m.merge(C,x,!0),this._initDimensions()},contains:function(x,C){var w=x.get("parallelIndex");return w!=null&&C.getComponent("parallel",w)===this},setAxisExpand:function(x){m.each(["axisExpandable","axisExpandCenter","axisExpandCount","axisExpandWidth","axisExpandWindow"],function(C){x.hasOwnProperty(C)&&(this.option[C]=x[C])},this)},_initDimensions:function(){var x=this.dimensions=[],C=this.parallelAxisIndex=[],w=m.filter(this.dependentModels.parallelAxis,function(A){return(A.get("parallelIndex")||0)===this.componentIndex},this);m.each(w,function(A){x.push("dim"+A.get("dim")),C.push(A.componentIndex)})}});f.exports=y}),zyt=xt(()=>{var o=fo(),f={type:"axisAreaSelect",event:"axisAreaSelected"};o.registerAction(f,function(m,v){v.eachComponent({mainType:"parallelAxis",query:m},function(y){y.axis.model.setActiveIntervals(m.intervals)})}),o.registerAction("parallelAxisExpand",function(m,v){v.eachComponent({mainType:"parallel",query:m},function(y){y.setAxisExpand(m)})})}),O0e=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Wi(),x=iB(),C=xa(),w=dGe(),A=aB(),E=y.curry,T=y.each,S=y.map,M=Math.min,I=Math.max,P=Math.pow,D=1e4,L=6,R=6,O="globalPan",F={w:[0,0],e:[0,1],n:[1,0],s:[1,1]},k={w:"ew",e:"ew",n:"ns",s:"ns",ne:"nesw",sw:"nesw",nw:"nwse",se:"nwse"},U={brushStyle:{lineWidth:2,stroke:"rgba(0,0,0,0.3)",fill:"rgba(0,0,0,0.1)"},transformable:!0,brushMode:"single",removeOnClick:!1},G=0;function j(ii){x.call(this),this._zr=ii,this.group=new C.Group,this._brushType,this._brushOption,this._panels,this._track=[],this._dragging,this._covers=[],this._creatingCover,this._creatingPanel,this._enableGlobalPan,this._uid="brushController_"+G++,this._handlers={},T(bt,function(ei,Li){this._handlers[Li]=y.bind(ei,this)},this)}j.prototype={constructor:j,enableBrush:function(ii){return this._brushType&&J(this),ii.brushType&&q(this,ii),this},setPanels:function(ii){if(ii&&ii.length){var ei=this._panels={};y.each(ii,function(Li){ei[Li.panelId]=y.clone(Li)})}else this._panels=null;return this},mount:function(ii){ii=ii||{},this._enableGlobalPan=ii.enableGlobalPan;var ei=this.group;return this._zr.add(ei),ei.attr({position:ii.position||[0,0],rotation:ii.rotation||0,scale:ii.scale||[1,1]}),this._transform=ei.getLocalTransform(),this},eachCover:function(ii,ei){T(this._covers,ii,ei)},updateCovers:function(ii){ii=y.map(ii,function(Ri){return y.merge(y.clone(U),Ri,!0)});var ei="\0-brush-index-",Li=this._covers,Je=this._covers=[],Nt=this,yi=this._creatingCover;return new A(Li,ii,wi,ai).add(ji).update(ji).remove(hi).execute(),this;function ai(Ri,pt){return(Ri.id!=null?Ri.id:ei+pt)+"-"+Ri.brushType}function wi(Ri,pt){return ai(Ri.__brushOption,pt)}function ji(Ri,pt){var wr=ii[Ri];if(pt!=null&&Li[pt]===yi)Je[Ri]=Li[pt];else{var zi=Je[Ri]=pt!=null?(Li[pt].__brushOption=wr,Li[pt]):ee(Nt,Q(Nt,wr));re(Nt,zi)}}function hi(Ri){Li[Ri]!==yi&&Nt.group.remove(Li[Ri])}},unmount:function(){return this.enableBrush(!1),ae(this),this._zr.remove(this.group),this},dispose:function(){this.unmount(),this.off()}},y.mixin(j,x);function q(ii,ei){var Li=ii._zr;ii._enableGlobalPan||w.take(Li,O,ii._uid),X(Li,ii._handlers),ii._brushType=ei.brushType,ii._brushOption=y.merge(y.clone(U),ei,!0)}function J(ii){var ei=ii._zr;w.release(ei,O,ii._uid),Y(ei,ii._handlers),ii._brushType=ii._brushOption=null}function X(ii,ei){T(ei,function(Li,Je){ii.on(Je,Li)})}function Y(ii,ei){T(ei,function(Li,Je){ii.off(Je,Li)})}function Q(ii,ei){var Li=Jt[ei.brushType].createCover(ii,ei);return Li.__brushOption=ei,ie(Li,ei),ii.group.add(Li),Li}function ee(ii,ei){var Li=ne(ei);return Li.endCreating&&(Li.endCreating(ii,ei),ie(ei,ei.__brushOption)),ei}function z(ii,ei){var Li=ei.__brushOption;ne(ei).updateCoverShape(ii,ei,Li.range,Li)}function ie(ii,ei){var Li=ei.z;Li==null&&(Li=D),ii.traverse(function(Je){Je.z=Li,Je.z2=Li})}function re(ii,ei){ne(ei).updateCommon(ii,ei),z(ii,ei)}function ne(ii){return Jt[ii.__brushOption.brushType]}function oe(ii,ei,Li){var Je=ii._panels;if(!Je)return!0;var Nt,yi=ii._transform;return T(Je,function(ai){ai.isTargetByCursor(ei,Li,yi)&&(Nt=ai)}),Nt}function se(ii,ei){var Li=ii._panels;if(!Li)return!0;var Je=ei.__brushOption.panelId;return Je!=null?Li[Je]:!0}function ae(ii){var ei=ii._covers,Li=ei.length;return T(ei,function(Je){ii.group.remove(Je)},ii),ei.length=0,!!Li}function fe(ii,ei){var Li=S(ii._covers,function(Je){var Nt=Je.__brushOption,yi=y.clone(Nt.range);return{brushType:Nt.brushType,panelId:Nt.panelId,range:yi}});ii.trigger("brush",Li,{isEnd:!!ei.isEnd,removeOnClick:!!ei.removeOnClick})}function de(ii){var ei=ii._track;if(!ei.length)return!1;var Li=ei[ei.length-1],Je=ei[0],Nt=Li[0]-Je[0],yi=Li[1]-Je[1],ai=P(Nt*Nt+yi*yi,.5);return ai>L}function ve(ii){var ei=ii.length-1;return ei<0&&(ei=0),[ii[0],ii[ei]]}function pe(ii,ei,Li,Je){var Nt=new C.Group;return Nt.add(new C.Rect({name:"main",style:Se(Li),silent:!0,draggable:!0,cursor:"move",drift:E(ii,ei,Nt,"nswe"),ondragend:E(fe,ei,{isEnd:!0})})),T(Je,function(yi){Nt.add(new C.Rect({name:yi,style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:E(ii,ei,Nt,yi),ondragend:E(fe,ei,{isEnd:!0})}))}),Nt}function ce(ii,ei,Li,Je){var Nt=Je.brushStyle.lineWidth||0,yi=I(Nt,R),ai=Li[0][0],wi=Li[1][0],ji=ai-Nt/2,hi=wi-Nt/2,Ri=Li[0][1],pt=Li[1][1],wr=Ri-yi+Nt/2,zi=pt-yi+Nt/2,Ui=Ri-ai,Gt=pt-wi,$t=Ui+Nt,jt=Gt+Nt;Ce(ii,ei,"main",ai,wi,Ui,Gt),Je.transformable&&(Ce(ii,ei,"w",ji,hi,yi,jt),Ce(ii,ei,"e",wr,hi,yi,jt),Ce(ii,ei,"n",ji,hi,$t,yi),Ce(ii,ei,"s",ji,zi,$t,yi),Ce(ii,ei,"nw",ji,hi,yi,yi),Ce(ii,ei,"ne",wr,hi,yi,yi),Ce(ii,ei,"sw",ji,zi,yi,yi),Ce(ii,ei,"se",wr,zi,yi,yi))}function he(ii,ei){var Li=ei.__brushOption,Je=Li.transformable,Nt=ei.childAt(0);Nt.useStyle(Se(Li)),Nt.attr({silent:!Je,cursor:Je?"move":"default"}),T(["w","e","n","s","se","sw","ne","nw"],function(yi){var ai=ei.childOfName(yi),wi=Ue(ii,yi);ai&&ai.attr({silent:!Je,invisible:!Je,cursor:Je?k[wi]+"-resize":null})})}function Ce(ii,ei,Li,Je,Nt,yi,ai){var wi=ei.childOfName(Li);wi&&wi.setShape(Pt(at(ii,ei,[[Je,Nt],[Je+yi,Nt+ai]])))}function Se(ii){return y.defaults({strokeNoScale:!0},ii.brushStyle)}function De(ii,ei,Li,Je){var Nt=[M(ii,Li),M(ei,Je)],yi=[I(ii,Li),I(ei,Je)];return[[Nt[0],yi[0]],[Nt[1],yi[1]]]}function Oe(ii){return C.getTransform(ii.group)}function Ue(ii,ei){if(ei.length>1){ei=ei.split("");var Li=[Ue(ii,ei[0]),Ue(ii,ei[1])];return(Li[0]==="e"||Li[0]==="w")&&Li.reverse(),Li.join("")}else{var Je={w:"left",e:"right",n:"top",s:"bottom"},Nt={left:"w",right:"e",top:"n",bottom:"s"},Li=C.transformDirection(Je[ei],Oe(ii));return Nt[Li]}}function Xe(ii,ei,Li,Je,Nt,yi,ai,wi){var ji=Je.__brushOption,hi=ii(ji.range),Ri=ut(Li,yi,ai);T(Nt.split(""),function(pt){var wr=F[pt];hi[wr[0]][wr[1]]+=Ri[wr[0]]}),ji.range=ei(De(hi[0][0],hi[1][0],hi[0][1],hi[1][1])),re(Li,Je),fe(Li,{isEnd:!1})}function it(ii,ei,Li,Je,Nt){var yi=ei.__brushOption.range,ai=ut(ii,Li,Je);T(yi,function(wi){wi[0]+=ai[0],wi[1]+=ai[1]}),re(ii,ei),fe(ii,{isEnd:!1})}function ut(ii,ei,Li){var Je=ii.group,Nt=Je.transformCoordToLocal(ei,Li),yi=Je.transformCoordToLocal(0,0);return[Nt[0]-yi[0],Nt[1]-yi[1]]}function at(ii,ei,Li){var Je=se(ii,ei);return Je&&Je!==!0?Je.clipPath(Li,ii._transform):y.clone(Li)}function Pt(ii){var ei=M(ii[0][0],ii[1][0]),Li=M(ii[0][1],ii[1][1]),Je=I(ii[0][0],ii[1][0]),Nt=I(ii[0][1],ii[1][1]);return{x:ei,y:Li,width:Je-ei,height:Nt-Li}}function Qe(ii,ei,Li){if(!(!ii._brushType||It(ii,ei))){var Je=ii._zr,Nt=ii._covers,yi=oe(ii,ei,Li);if(!ii._dragging)for(var ai=0;aiJe.getWidth()||Li<0||Li>Je.getHeight()}var Jt={lineX:bi(0),lineY:bi(1),rect:{createCover:function(ii,ei){return pe(E(Xe,function(Li){return Li},function(Li){return Li}),ii,ei,["w","e","n","s","se","sw","ne","nw"])},getCreatingRange:function(ii){var ei=ve(ii);return De(ei[1][0],ei[1][1],ei[0][0],ei[0][1])},updateCoverShape:function(ii,ei,Li,Je){ce(ii,ei,Li,Je)},updateCommon:he,contain:Ot},polygon:{createCover:function(ii,ei){var Li=new C.Group;return Li.add(new C.Polyline({name:"main",style:Se(ei),silent:!0})),Li},getCreatingRange:function(ii){return ii},endCreating:function(ii,ei){ei.remove(ei.childAt(0)),ei.add(new C.Polygon({name:"main",draggable:!0,drift:E(it,ii,ei),ondragend:E(fe,ii,{isEnd:!0})}))},updateCoverShape:function(ii,ei,Li,Je){ei.childAt(0).setShape({points:at(ii,ei,Li)})},updateCommon:he,contain:Ot}};function bi(ii){return{createCover:function(ei,Li){return pe(E(Xe,function(Je){var Nt=[Je,[0,100]];return ii&&Nt.reverse(),Nt},function(Je){return Je[ii]}),ei,Li,[["w","e"],["n","s"]][ii])},getCreatingRange:function(ei){var Li=ve(ei),Je=M(Li[0][ii],Li[1][ii]),Nt=I(Li[0][ii],Li[1][ii]);return[Je,Nt]},updateCoverShape:function(ei,Li,Je,Nt){var yi,ai=se(ei,Li);if(ai!==!0&&ai.getLinearBrushOtherExtent)yi=ai.getLinearBrushOtherExtent(ii,ei._transform);else{var wi=ei._zr;yi=[0,[wi.getWidth(),wi.getHeight()][1-ii]]}var ji=[Je,yi];ii&&ji.reverse(),ce(ei,Li,ji,Nt)},updateCommon:he,contain:Ot}}var Yi=j;f.exports=Yi}),bGe=xt(o=>{var f=Of(),m=Rie(),v=m.onIrrelevantElement,y=xa();function x(E){return E=A(E),function(T,S){return y.clipPointsByRect(T,E)}}function C(E,T){return E=A(E),function(S){var M=T??S,I=M?E.width:E.height,P=M?E.x:E.y;return[P,P+(I||0)]}}function w(E,T,S){return E=A(E),function(M,I,P){return E.contain(I[0],I[1])&&!v(M,T,S)}}function A(E){return f.create(E)}o.makeRectPanelClipPath=x,o.makeLinearBrushOtherExtent=C,o.makeRectIsTargetByCursor=w}),Hyt=xt((o,f)=>{var m=fo(),v=Wi(),y=Q3(),x=O0e(),C=bGe(),w=xa(),A=["axisLine","axisTickLabel","axisName"],E=m.extendComponentView({type:"parallelAxis",init:function(P,D){E.superApply(this,"init",arguments),(this._brushController=new x(D.getZr())).on("brush",v.bind(this._onBrush,this))},render:function(P,D,L,R){if(!T(P,D,R)){this.axisModel=P,this.api=L,this.group.removeAll();var O=this._axisGroup;if(this._axisGroup=new w.Group,this.group.add(this._axisGroup),!!P.get("show")){var F=M(P,D),k=F.coordinateSystem,U=P.getAreaSelectStyle(),G=U.width,j=P.axis.dim,q=k.getAxisLayout(j),J=v.extend({strokeContainThreshold:G},q),X=new y(P,J);v.each(A,X.add,X),this._axisGroup.add(X.getGroup()),this._refreshBrushController(J,U,P,F,G,L);var Y=R&&R.animation===!1?null:P;w.groupTransition(O,this._axisGroup,Y)}}},_refreshBrushController:function(P,D,L,R,O,F){var k=L.axis.getExtent(),U=k[1]-k[0],G=Math.min(30,Math.abs(U)*.1),j=w.BoundingRect.create({x:k[0],y:-O/2,width:U,height:O});j.x-=G,j.width+=2*G,this._brushController.mount({enableGlobalPan:!0,rotation:P.rotation,position:P.position}).setPanels([{panelId:"pl",clipPath:C.makeRectPanelClipPath(j),isTargetByCursor:C.makeRectIsTargetByCursor(j,F,R),getLinearBrushOtherExtent:C.makeLinearBrushOtherExtent(j,0)}]).enableBrush({brushType:"lineX",brushStyle:D,removeOnClick:!0}).updateCovers(S(L))},_onBrush:function(P,D){var L=this.axisModel,R=L.axis,O=v.map(P,function(F){return[R.coordToData(F.range[0],!0),R.coordToData(F.range[1],!0)]});(!L.option.realtime===D.isEnd||D.removeOnClick)&&this.api.dispatchAction({type:"axisAreaSelect",parallelAxisId:L.id,intervals:O})},dispose:function(){this._brushController.dispose()}});function T(P,D,L){return L&&L.type==="axisAreaSelect"&&D.findComponents({mainType:"parallelAxis",query:L})[0]===P}function S(P){var D=P.axis;return v.map(P.activeIntervals,function(L){return{brushType:"lineX",panelId:"pl",range:[D.dataToCoord(L[0],!0),D.dataToCoord(L[1],!0)]}})}function M(P,D){return D.getComponent("parallel",P.get("parallelIndex"))}var I=E;f.exports=I}),Uyt=xt(()=>{CGe(),zyt(),Hyt()}),wGe=xt(()=>{var o=fo(),f=Wi(),m=X3(),v=Nyt();CGe(),Vyt(),Uyt();var y=5;o.extendComponentView({type:"parallel",render:function(w,A,E){this._model=w,this._api=E,this._handlers||(this._handlers={},f.each(x,function(T,S){E.getZr().on(S,this._handlers[S]=f.bind(T,this))},this)),m.createOrUpdate(this,"_throttledDispatchExpand",w.get("axisExpandRate"),"fixRate")},dispose:function(w,A){f.each(this._handlers,function(E,T){A.getZr().off(T,E)}),this._handlers=null},_throttledDispatchExpand:function(w){this._dispatchExpand(w)},_dispatchExpand:function(w){w&&this._api.dispatchAction(f.extend({type:"parallelAxisExpand"},w))}});var x={mousedown:function(w){C(this,"click")&&(this._mouseDownPoint=[w.offsetX,w.offsetY])},mouseup:function(w){var A=this._mouseDownPoint;if(C(this,"click")&&A){var E=[w.offsetX,w.offsetY],T=Math.pow(A[0]-E[0],2)+Math.pow(A[1]-E[1],2);if(T>y)return;var S=this._model.coordinateSystem.getSlidedAxisExpandWindow([w.offsetX,w.offsetY]);S.behavior!=="none"&&this._dispatchExpand({axisExpandWindow:S.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(w){if(!(this._mouseDownPoint||!C(this,"mousemove"))){var A=this._model,E=A.coordinateSystem.getSlidedAxisExpandWindow([w.offsetX,w.offsetY]),T=E.behavior;T==="jump"&&this._throttledDispatchExpand.debounceNextCall(A.get("axisExpandDebounce")),this._throttledDispatchExpand(T==="none"?null:{axisExpandWindow:E.axisExpandWindow,animation:T==="jump"?null:!1})}}};function C(w,A){var E=w._model;return E.get("axisExpandable")&&E.get("axisExpandTriggerOn")===A}o.registerPreprocessor(v)}),Gyt=xt((o,f)=>{var m=Wi(),v=m.each,y=m.createHashMap,x=Jg(),C=zM(),w=x.extend({type:"series.parallel",dependencies:["parallel"],visualColorAccessPath:"lineStyle.color",getInitialData:function(T,S){var M=this.getSource();return A(M,this),C(M,this)},getRawIndicesByActiveState:function(T){var S=this.coordinateSystem,M=this.getData(),I=[];return S.eachActiveState(M,function(P,D){T===P&&I.push(M.getRawIndex(D))}),I},defaultOption:{zlevel:0,z:2,coordinateSystem:"parallel",parallelIndex:0,label:{show:!1},inactiveOpacity:.05,activeOpacity:1,lineStyle:{width:1,opacity:.45,type:"solid"},emphasis:{label:{show:!1}},progressive:500,smooth:!1,animationEasing:"linear"}});function A(T,S){if(!T.encodeDefine){var M=S.ecModel.getComponent("parallel",S.get("parallelIndex"));if(M){var I=T.encodeDefine=y();v(M.dimensions,function(P){var D=E(P);I.set(P,D)})}}}function E(T){return+T.replace("dim","")}f.exports=w}),Wyt=xt((o,f)=>{var m=xa(),v=V2(),y=.3,x=v.extend({type:"parallel",init:function(){this._dataGroup=new m.Group,this.group.add(this._dataGroup),this._data,this._initialized},render:function(I,P,D,L){var R=this._dataGroup,O=I.getData(),F=this._data,k=I.coordinateSystem,U=k.dimensions,G=E(I);O.diff(F).add(j).update(q).remove(J).execute();function j(Y){var Q=A(O,R,Y,U,k);T(Q,O,Y,G)}function q(Y,Q){var ee=F.getItemGraphicEl(Q),z=w(O,Y,U,k);O.setItemGraphicEl(Y,ee);var ie=L&&L.animation===!1?null:I;m.updateProps(ee,{shape:{points:z}},ie,Y),T(ee,O,Y,G)}function J(Y){var Q=F.getItemGraphicEl(Y);R.remove(Q)}if(!this._initialized){this._initialized=!0;var X=C(k,I,function(){setTimeout(function(){R.removeClipPath()})});R.setClipPath(X)}this._data=O},incrementalPrepareRender:function(I,P,D){this._initialized=!0,this._data=null,this._dataGroup.removeAll()},incrementalRender:function(I,P,D){for(var L=P.getData(),R=P.coordinateSystem,O=R.dimensions,F=E(P),k=I.start;k{var m=["lineStyle","normal","opacity"],v={seriesType:"parallel",reset:function(y,x,C){var w=y.getModel("itemStyle"),A=y.getModel("lineStyle"),E=x.get("color"),T=A.get("color")||w.get("color")||E[y.seriesIndex%E.length],S=y.get("inactiveOpacity"),M=y.get("activeOpacity"),I=y.getModel("lineStyle").getLineStyle(),P=y.coordinateSystem,D=y.getData(),L={normal:I.opacity,active:M,inactive:S};D.setVisual("color",T);function R(O,F){P.eachActiveState(F,function(k,U){var G=L[k];if(k==="normal"&&F.hasItemOption){var j=F.getItemModel(U).get(m,!0);j!=null&&(G=j)}F.setItemVisual(U,"opacity",G)},O.start,O.end)}return{progress:R}}};f.exports=v}),Yyt=xt(()=>{var o=fo();wGe(),Gyt(),Wyt();var f=jyt();o.registerVisual(f)}),qyt=xt((o,f)=>{var m=Jg(),v=_Ge(),y=fd(),x=y.encodeHTML,C=Sm(),w=Ac(),A=w.__DEV__,E=m.extend({type:"series.sankey",layoutInfo:null,levelModels:null,getInitialData:function(S,M){for(var I=S.edges||S.links,P=S.data||S.nodes,D=S.levels,L=this.levelModels={},R=0;R=0&&(L[D[R].depth]=new C(D[R],this,M));if(P&&I){var O=v(P,I,this,!0,F);return O.data}function F(k,U){k.wrapMethod("getItemModel",function(G,j){return G.customizeGetParent(function(q){var J=this.parentModel,X=J.getData().getItemLayout(j).depth,Y=J.levelModels[X];return Y||this.parentModel}),G}),U.wrapMethod("getItemModel",function(G,j){return G.customizeGetParent(function(q){var J=this.parentModel,X=J.getGraph().getEdgeByIndex(j),Y=X.node1.getLayout().depth,Q=J.levelModels[Y];return Q||this.parentModel}),G})}},setNodePosition:function(S,M){var I=this.option.data[S];I.localX=M[0],I.localY=M[1]},getGraph:function(){return this.getData().graph},getEdgeData:function(){return this.getGraph().edgeData},formatTooltip:function(S,M,I){if(I==="edge"){var P=this.getDataParams(S,I),D=P.data,L=D.source+" -- "+D.target;return P.value&&(L+=" : "+P.value),x(L)}else if(I==="node"){var R=this.getGraph().getNodeByIndex(S),O=R.getLayout().value,F=this.getDataParams(S,I).data.name;if(O)var L=F+" : "+O;return x(L)}return E.superCall(this,"formatTooltip",S,M)},optionUpdated:function(){var S=this.option;S.focusNodeAdjacency===!0&&(S.focusNodeAdjacency="allEdges")},getDataParams:function(S,M){var I=E.superCall(this,"getDataParams",S,M);if(I.value==null&&M==="node"){var P=this.getGraph().getNodeByIndex(S),D=P.getLayout().value;I.value=D}return I},defaultOption:{zlevel:0,z:2,coordinateSystem:"view",layout:null,left:"5%",top:"5%",right:"20%",bottom:"5%",orient:"horizontal",nodeWidth:20,nodeGap:8,draggable:!0,focusNodeAdjacency:!1,layoutIterations:32,label:{show:!0,position:"right",color:"#000",fontSize:12},levels:[],nodeAlign:"justify",itemStyle:{borderWidth:1,borderColor:"#333"},lineStyle:{color:"#314656",opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},animationEasing:"linear",animationDuration:1e3}}),T=E;f.exports=T}),Xyt=xt((o,f)=>{var m=xa(),v=fo(),y=Wi(),x=["itemStyle","opacity"],C=["emphasis","itemStyle","opacity"],w=["lineStyle","opacity"],A=["emphasis","lineStyle","opacity"];function E(D,L){return D.getVisual("opacity")||D.getModel().get(L)}function T(D,L,R){var O=D.getGraphicEl(),F=E(D,L);R!=null&&(F==null&&(F=1),F*=R),O.downplay&&O.downplay(),O.traverse(function(k){k.type!=="group"&&k.setStyle("opacity",F)})}function S(D,L){var R=E(D,L),O=D.getGraphicEl();O.traverse(function(F){F.type!=="group"&&F.setStyle("opacity",R)}),O.highlight&&O.highlight()}var M=m.extendShape({shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,cpx2:0,cpy2:0,extent:0,orient:""},buildPath:function(D,L){var R=L.extent;D.moveTo(L.x1,L.y1),D.bezierCurveTo(L.cpx1,L.cpy1,L.cpx2,L.cpy2,L.x2,L.y2),L.orient==="vertical"?(D.lineTo(L.x2+R,L.y2),D.bezierCurveTo(L.cpx2+R,L.cpy2,L.cpx1+R,L.cpy1,L.x1+R,L.y1)):(D.lineTo(L.x2,L.y2+R),D.bezierCurveTo(L.cpx2,L.cpy2+R,L.cpx1,L.cpy1+R,L.x1,L.y1+R)),D.closePath()},highlight:function(){this.trigger("emphasis")},downplay:function(){this.trigger("normal")}}),I=v.extendChartView({type:"sankey",_model:null,_focusAdjacencyDisabled:!1,render:function(D,L,R){var O=this,F=D.getGraph(),k=this.group,U=D.layoutInfo,G=U.width,j=U.height,q=D.getData(),J=D.getData("edge"),X=D.get("orient");this._model=D,k.removeAll(),k.attr("position",[U.x,U.y]),F.eachEdge(function(Y){var Q=new M;Q.dataIndex=Y.dataIndex,Q.seriesIndex=D.seriesIndex,Q.dataType="edge";var ee=Y.getModel("lineStyle"),z=ee.get("curveness"),ie=Y.node1.getLayout(),re=Y.node1.getModel(),ne=re.get("localX"),oe=re.get("localY"),se=Y.node2.getLayout(),ae=Y.node2.getModel(),fe=ae.get("localX"),de=ae.get("localY"),ve=Y.getLayout(),pe,ce,he,Ce,Se,De,Oe,Ue;switch(Q.shape.extent=Math.max(1,ve.dy),Q.shape.orient=X,X==="vertical"?(pe=(ne!=null?ne*G:ie.x)+ve.sy,ce=(oe!=null?oe*j:ie.y)+ie.dy,he=(fe!=null?fe*G:se.x)+ve.ty,Ce=de!=null?de*j:se.y,Se=pe,De=ce*(1-z)+Ce*z,Oe=he,Ue=ce*z+Ce*(1-z)):(pe=(ne!=null?ne*G:ie.x)+ie.dx,ce=(oe!=null?oe*j:ie.y)+ve.sy,he=fe!=null?fe*G:se.x,Ce=(de!=null?de*j:se.y)+ve.ty,Se=pe*(1-z)+he*z,De=ce,Oe=pe*z+he*(1-z),Ue=Ce),Q.setShape({x1:pe,y1:ce,x2:he,y2:Ce,cpx1:Se,cpy1:De,cpx2:Oe,cpy2:Ue}),Q.setStyle(ee.getItemStyle()),Q.style.fill){case"source":Q.style.fill=Y.node1.getVisual("color");break;case"target":Q.style.fill=Y.node2.getVisual("color");break}m.setHoverStyle(Q,Y.getModel("emphasis.lineStyle").getItemStyle()),k.add(Q),J.setItemGraphicEl(Y.dataIndex,Q)}),F.eachNode(function(Y){var Q=Y.getLayout(),ee=Y.getModel(),z=ee.get("localX"),ie=ee.get("localY"),re=ee.getModel("label"),ne=ee.getModel("emphasis.label"),oe=new m.Rect({shape:{x:z!=null?z*G:Q.x,y:ie!=null?ie*j:Q.y,width:Q.dx,height:Q.dy},style:ee.getModel("itemStyle").getItemStyle()}),se=Y.getModel("emphasis.itemStyle").getItemStyle();m.setLabelStyle(oe.style,se,re,ne,{labelFetcher:D,labelDataIndex:Y.dataIndex,defaultText:Y.id,isRectText:!0}),oe.setStyle("fill",Y.getVisual("color")),m.setHoverStyle(oe,se),k.add(oe),q.setItemGraphicEl(Y.dataIndex,oe),oe.dataType="node"}),q.eachItemGraphicEl(function(Y,Q){var ee=q.getItemModel(Q);ee.get("draggable")&&(Y.drift=function(z,ie){O._focusAdjacencyDisabled=!0,this.shape.x+=z,this.shape.y+=ie,this.dirty(),R.dispatchAction({type:"dragNode",seriesId:D.id,dataIndex:q.getRawIndex(Q),localX:this.shape.x/G,localY:this.shape.y/j})},Y.ondragend=function(){O._focusAdjacencyDisabled=!1},Y.draggable=!0,Y.cursor="move"),Y.highlight=function(){this.trigger("emphasis")},Y.downplay=function(){this.trigger("normal")},Y.focusNodeAdjHandler&&Y.off("mouseover",Y.focusNodeAdjHandler),Y.unfocusNodeAdjHandler&&Y.off("mouseout",Y.unfocusNodeAdjHandler),ee.get("focusNodeAdjacency")&&(Y.on("mouseover",Y.focusNodeAdjHandler=function(){O._focusAdjacencyDisabled||(O._clearTimer(),R.dispatchAction({type:"focusNodeAdjacency",seriesId:D.id,dataIndex:Y.dataIndex}))}),Y.on("mouseout",Y.unfocusNodeAdjHandler=function(){O._focusAdjacencyDisabled||O._dispatchUnfocus(R)}))}),J.eachItemGraphicEl(function(Y,Q){var ee=J.getItemModel(Q);Y.focusNodeAdjHandler&&Y.off("mouseover",Y.focusNodeAdjHandler),Y.unfocusNodeAdjHandler&&Y.off("mouseout",Y.unfocusNodeAdjHandler),ee.get("focusNodeAdjacency")&&(Y.on("mouseover",Y.focusNodeAdjHandler=function(){O._focusAdjacencyDisabled||(O._clearTimer(),R.dispatchAction({type:"focusNodeAdjacency",seriesId:D.id,edgeDataIndex:Y.dataIndex}))}),Y.on("mouseout",Y.unfocusNodeAdjHandler=function(){O._focusAdjacencyDisabled||O._dispatchUnfocus(R)}))}),!this._data&&D.get("animation")&&k.setClipPath(P(k.getBoundingRect(),D,function(){k.removeClipPath()})),this._data=D.getData()},dispose:function(){this._clearTimer()},_dispatchUnfocus:function(D){var L=this;this._clearTimer(),this._unfocusDelayTimer=setTimeout(function(){L._unfocusDelayTimer=null,D.dispatchAction({type:"unfocusNodeAdjacency",seriesId:L._model.id})},500)},_clearTimer:function(){this._unfocusDelayTimer&&(clearTimeout(this._unfocusDelayTimer),this._unfocusDelayTimer=null)},focusNodeAdjacency:function(D,L,R,O){var F=D.getData(),k=F.graph,U=O.dataIndex,G=F.getItemModel(U),j=O.edgeDataIndex;if(!(U==null&&j==null)){var q=k.getNodeByIndex(U),J=k.getEdgeByIndex(j);if(k.eachNode(function(Y){T(Y,x,.1)}),k.eachEdge(function(Y){T(Y,w,.1)}),q){S(q,C);var X=G.get("focusNodeAdjacency");X==="outEdges"?y.each(q.outEdges,function(Y){Y.dataIndex<0||(S(Y,A),S(Y.node2,C))}):X==="inEdges"?y.each(q.inEdges,function(Y){Y.dataIndex<0||(S(Y,A),S(Y.node1,C))}):X==="allEdges"&&y.each(q.edges,function(Y){Y.dataIndex<0||(S(Y,A),Y.node1!==q&&S(Y.node1,C),Y.node2!==q&&S(Y.node2,C))})}J&&(S(J,A),S(J.node1,C),S(J.node2,C))}},unfocusNodeAdjacency:function(D,L,R,O){var F=D.getGraph();F.eachNode(function(k){T(k,x)}),F.eachEdge(function(k){T(k,w)})}});function P(D,L,R){var O=new m.Rect({shape:{x:D.x-10,y:D.y-10,width:0,height:D.height+20}});return m.initProps(O,{shape:{width:D.width+20}},L,R),O}f.exports=I}),Jyt=xt(()=>{var o=fo();vGe(),o.registerAction({type:"dragNode",event:"dragnode",update:"update"},function(f,m){m.eachComponent({mainType:"series",subType:"sankey",query:f},function(v){v.setNodePosition(f.dataIndex,[f.localX,f.localY])})})}),Kyt=xt((o,f)=>{var m=rd(),v=Wi(),y=vu(),x=y.groupData;function C(ee,z,ie){ee.eachSeriesByType("sankey",function(re){var ne=re.get("nodeWidth"),oe=re.get("nodeGap"),se=w(re,z);re.layoutInfo=se;var ae=se.width,fe=se.height,de=re.getGraph(),ve=de.nodes,pe=de.edges;E(ve);var ce=v.filter(ve,function(De){return De.getLayout().value===0}),he=ce.length!==0?0:re.get("layoutIterations"),Ce=re.get("orient"),Se=re.get("nodeAlign");A(ve,pe,ne,oe,ae,fe,he,Ce,Se)})}function w(ee,z){return m.getLayoutRect(ee.getBoxLayoutParams(),{width:z.getWidth(),height:z.getHeight()})}function A(ee,z,ie,re,ne,oe,se,ae,fe){T(ee,z,ie,ne,oe,ae,fe),D(ee,z,oe,ne,re,se,ae),Q(ee,ae)}function E(ee){v.each(ee,function(z){var ie=X(z.outEdges,J),re=X(z.inEdges,J),ne=z.getValue()||0,oe=Math.max(ie,re,ne);z.setLayout({value:oe},!0)})}function T(ee,z,ie,re,ne,oe,se){for(var ae=[],fe=[],de=[],ve=[],pe=0,Qe=0,ce=0;ce=0;Oe&&De.depth>he&&(he=De.depth),Se.setLayout({depth:Oe?De.depth:pe},!0),oe==="vertical"?Se.setLayout({dy:ie},!0):Se.setLayout({dx:ie},!0);for(var Ue=0;Uepe-1?he:pe-1;se&&se!=="left"&&M(ee,se,oe,Pt);var Qe=oe==="vertical"?(ne-ie)/Pt:(re-ie)/Pt;P(ee,Qe,oe)}function S(ee){var z=ee.hostGraph.data.getRawDataItem(ee.dataIndex);return z.depth!=null&&z.depth>=0}function M(ee,z,ie,re){if(z==="right"){for(var ne=[],oe=ee,se=0;oe.length;){for(var ae=0;ae0;oe--)fe*=.99,F(ae,fe,se),O(ae,ne,ie,re,se),Y(ae,fe,se),O(ae,ne,ie,re,se)}function L(ee,z){var ie=[],re=z==="vertical"?"y":"x",ne=x(ee,function(oe){return oe.getLayout()[re]});return ne.keys.sort(function(oe,se){return oe-se}),v.each(ne.keys,function(oe){ie.push(ne.buckets.get(oe))}),ie}function R(ee,z,ie,re,ne,oe){var se=1/0;v.each(ee,function(ae){var fe=ae.length,de=0;v.each(ae,function(pe){de+=pe.getLayout().value});var ve=oe==="vertical"?(re-(fe-1)*ne)/de:(ie-(fe-1)*ne)/de;ve0&&(ae=fe.getLayout()[oe]+de,ne==="vertical"?fe.setLayout({x:ae},!0):fe.setLayout({y:ae},!0)),ve=fe.getLayout()[oe]+fe.getLayout()[ce]+z;var Ce=ne==="vertical"?re:ie;if(de=ve-z-Ce,de>0)for(ae=fe.getLayout()[oe]-de,ne==="vertical"?fe.setLayout({x:ae},!0):fe.setLayout({y:ae},!0),ve=ae,he=pe-2;he>=0;--he)fe=se[he],de=fe.getLayout()[oe]+fe.getLayout()[ce]+z-ve,de>0&&(ae=fe.getLayout()[oe]-de,ne==="vertical"?fe.setLayout({x:ae},!0):fe.setLayout({y:ae},!0)),ve=fe.getLayout()[oe]})}function F(ee,z,ie){v.each(ee.slice().reverse(),function(re){v.each(re,function(ne){if(ne.outEdges.length){var oe=X(ne.outEdges,k,ie)/X(ne.outEdges,J,ie);if(isNaN(oe)){var se=ne.outEdges.length;oe=se?X(ne.outEdges,U,ie)/se:0}if(ie==="vertical"){var ae=ne.getLayout().x+(oe-q(ne,ie))*z;ne.setLayout({x:ae},!0)}else{var fe=ne.getLayout().y+(oe-q(ne,ie))*z;ne.setLayout({y:fe},!0)}}})})}function k(ee,z){return q(ee.node2,z)*ee.getValue()}function U(ee,z){return q(ee.node2,z)}function G(ee,z){return q(ee.node1,z)*ee.getValue()}function j(ee,z){return q(ee.node1,z)}function q(ee,z){return z==="vertical"?ee.getLayout().x+ee.getLayout().dx/2:ee.getLayout().y+ee.getLayout().dy/2}function J(ee){return ee.getValue()}function X(ee,z,ie){for(var re=0,ne=ee.length,oe=-1;++oe{var m=cB(),v=Wi();function y(x,C){x.eachSeriesByType("sankey",function(w){var A=w.getGraph(),E=A.nodes;if(E.length){var T=1/0,S=-1/0;v.each(E,function(M){var I=M.getLayout().value;IS&&(S=I)}),v.each(E,function(M){var I=new m({type:"color",mappingMethod:"linear",dataExtent:[T,S],visual:w.get("color")}),P=I.mapValueToVisual(M.getLayout().value),D=M.getModel().get("itemStyle.color");D!=null?M.setVisual("color",D):M.setVisual("color",P)})}})}f.exports=y}),Zyt=xt(()=>{var o=fo();qyt(),Xyt(),Jyt();var f=Kyt(),m=Qyt();o.registerLayout(f),o.registerVisual(m)}),AGe=xt(o=>{var f=uU(),m=Wi(),v=Gj(),y=v.getDimensionTypeByAxis,x=VM(),C=x.makeSeriesEncodeForAxisCoordSys,w={_baseAxisDim:null,getInitialData:function(A,E){var T,S=E.getComponent("xAxis",this.get("xAxisIndex")),M=E.getComponent("yAxis",this.get("yAxisIndex")),I=S.get("type"),P=M.get("type"),D;I==="category"?(A.layout="horizontal",T=S.getOrdinalMeta(),D=!0):P==="category"?(A.layout="vertical",T=M.getOrdinalMeta(),D=!0):A.layout=A.layout||"horizontal";var L=["x","y"],R=A.layout==="horizontal"?0:1,O=this._baseAxisDim=L[R],F=L[1-R],k=[S,M],U=k[R].get("type"),G=k[1-R].get("type"),j=A.data;if(j&&D){var q=[];m.each(j,function(Y,Q){var ee;Y.value&&m.isArray(Y.value)?(ee=Y.value.slice(),Y.value.unshift(Q)):m.isArray(Y)?(ee=Y.slice(),Y.unshift(Q)):ee=Y,q.push(ee)}),A.data=q}var J=this.defaultValueDimensions,X=[{name:O,type:y(U),ordinalMeta:T,otherDims:{tooltip:!1,itemName:0},dimsDef:["base"]},{name:F,type:y(G),dimsDef:J.slice()}];return f(this,{coordDimensions:X,dimensionsCount:J.length+1,encodeDefaulter:m.curry(C,X,this)})},getBaseAxis:function(){var A=this._baseAxisDim;return this.ecModel.getComponent(A+"Axis",this.get(A+"AxisIndex")).axis}};o.seriesModelMixin=w}),$yt=xt((o,f)=>{var m=Wi(),v=Jg(),y=AGe(),x=y.seriesModelMixin,C=v.extend({type:"series.boxplot",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"min",defaultTooltip:!0},{name:"Q1",defaultTooltip:!0},{name:"median",defaultTooltip:!0},{name:"Q3",defaultTooltip:!0},{name:"max",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,boxWidth:[7,50],itemStyle:{color:"#fff",borderWidth:1},emphasis:{itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:2,shadowOffsetY:2,shadowColor:"rgba(0,0,0,0.4)"}},animationEasing:"elasticOut",animationDuration:800}});m.mixin(C,x,!0);var w=C;f.exports=w}),ext=xt((o,f)=>{var m=Wi(),v=V2(),y=xa(),x=am(),C=["itemStyle"],w=["emphasis","itemStyle"],A=v.extend({type:"boxplot",render:function(P,D,L){var R=P.getData(),O=this.group,F=this._data;this._data||O.removeAll();var k=P.get("layout")==="horizontal"?1:0;R.diff(F).add(function(U){if(R.hasValue(U)){var G=R.getItemLayout(U),j=T(G,R,U,k,!0);R.setItemGraphicEl(U,j),O.add(j)}}).update(function(U,G){var j=F.getItemGraphicEl(G);if(!R.hasValue(U)){O.remove(j);return}var q=R.getItemLayout(U);j?S(q,j,R,U):j=T(q,R,U,k),O.add(j),R.setItemGraphicEl(U,j)}).remove(function(U){var G=F.getItemGraphicEl(U);G&&O.remove(G)}).execute(),this._data=R},remove:function(P){var D=this.group,L=this._data;this._data=null,L&&L.eachItemGraphicEl(function(R){R&&D.remove(R)})},dispose:m.noop}),E=x.extend({type:"boxplotBoxPath",shape:{},buildPath:function(P,D){var L=D.points,R=0;for(P.moveTo(L[R][0],L[R][1]),R++;R<4;R++)P.lineTo(L[R][0],L[R][1]);for(P.closePath();R{var m=["itemStyle","borderColor"];function v(y,x){var C=y.get("color");y.eachRawSeriesByType("boxplot",function(w){var A=C[w.seriesIndex%C.length],E=w.getData();E.setVisual({legendSymbol:"roundRect",color:w.get(m)||A}),y.isSeriesFiltered(w)||E.each(function(T){var S=E.getItemModel(T);E.setItemVisual(T,{color:S.get(m,!0)})})})}f.exports=v}),ixt=xt((o,f)=>{var m=Wi(),v=il(),y=v.parsePercent,x=m.each;function C(T){var S=w(T);x(S,function(M){var I=M.seriesModels;I.length&&(A(M),x(I,function(P,D){E(P,M.boxOffsetList[D],M.boxWidthList[D])}))})}function w(T){var S=[],M=[];return T.eachSeriesByType("boxplot",function(I){var P=I.getBaseAxis(),D=m.indexOf(M,P);D<0&&(D=M.length,M[D]=P,S[D]={axis:P,seriesModels:[]}),S[D].seriesModels.push(I)}),S}function A(T){var S,M=T.axis,I=T.seriesModels,P=I.length,D=T.boxWidthList=[],L=T.boxOffsetList=[],R=[],O;if(M.type==="category")O=M.getBandWidth();else{var F=0;x(I,function(q){F=Math.max(F,q.getData().count())}),S=M.getExtent(),Math.abs(S[1]-S[0])/F}x(I,function(q){var J=q.get("boxWidth");m.isArray(J)||(J=[J,J]),R.push([y(J[0],O)||0,y(J[1],O)||0])});var k=O*.8-2,U=k/P*.3,G=(k-U*(P-1))/P,j=G/2-k/2;x(I,function(q,J){L.push(j),j+=U+G,D.push(Math.min(Math.max(G,R[J][0]),R[J][1]))})}function E(T,S,M){var I=T.coordinateSystem,P=T.getData(),D=M/2,L=T.get("layout")==="horizontal"?0:1,R=1-L,O=["x","y"],F=P.mapDimension(O[L]),k=P.mapDimension(O[R],!0);if(F==null||k.length<5)return;for(var U=0;U{var o=fo();$yt(),ext();var f=txt(),m=ixt();o.registerVisual(f),o.registerLayout(m)}),nxt=xt((o,f)=>{var m=Wi(),v=Jg(),y=AGe(),x=y.seriesModelMixin,C=v.extend({type:"series.candlestick",dependencies:["xAxis","yAxis","grid"],defaultValueDimensions:[{name:"open",defaultTooltip:!0},{name:"close",defaultTooltip:!0},{name:"lowest",defaultTooltip:!0},{name:"highest",defaultTooltip:!0}],dimensions:null,defaultOption:{zlevel:0,z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,hoverAnimation:!0,layout:null,clip:!0,itemStyle:{color:"#c23531",color0:"#314656",borderWidth:1,borderColor:"#c23531",borderColor0:"#314656"},emphasis:{itemStyle:{borderWidth:2}},barMaxWidth:null,barMinWidth:null,barWidth:null,large:!0,largeThreshold:600,progressive:3e3,progressiveThreshold:1e4,progressiveChunkMode:"mod",animationUpdate:!1,animationEasing:"linear",animationDuration:300},getShadowDim:function(){return"open"},brushSelector:function(A,E,T){var S=E.getItemLayout(A);return S&&T.rect(S.brushRect)}});m.mixin(C,x,!0);var w=C;f.exports=w}),oxt=xt((o,f)=>{var m=Wi(),v=V2(),y=xa(),x=am(),C=jj(),w=C.createClipPath,A=["itemStyle"],E=["emphasis","itemStyle"],T=["color","color0","borderColor","borderColor0"],S=v.extend({type:"candlestick",render:function(U,G,j){this.group.removeClipPath(),this._updateDrawMode(U),this._isLargeDraw?this._renderLarge(U):this._renderNormal(U)},incrementalPrepareRender:function(U,G,j){this._clear(),this._updateDrawMode(U)},incrementalRender:function(U,G,j,q){this._isLargeDraw?this._incrementalRenderLarge(U,G):this._incrementalRenderNormal(U,G)},_updateDrawMode:function(U){var G=U.pipelineContext.large;(this._isLargeDraw==null||G^this._isLargeDraw)&&(this._isLargeDraw=G,this._clear())},_renderNormal:function(U){var G=U.getData(),j=this._data,q=this.group,J=G.getLayout("isSimpleBox"),X=U.get("clip",!0),Y=U.coordinateSystem,Q=Y.getArea&&Y.getArea();this._data||q.removeAll(),G.diff(j).add(function(ee){if(G.hasValue(ee)){var z,ie=G.getItemLayout(ee);if(X&&P(Q,ie))return;z=I(ie,ee,!0),y.initProps(z,{shape:{points:ie.ends}},U,ee),D(z,G,ee,J),q.add(z),G.setItemGraphicEl(ee,z)}}).update(function(ee,z){var ie=j.getItemGraphicEl(z);if(!G.hasValue(ee)){q.remove(ie);return}var re=G.getItemLayout(ee);if(X&&P(Q,re)){q.remove(ie);return}ie?y.updateProps(ie,{shape:{points:re.ends}},U,ee):ie=I(re,ee),D(ie,G,ee,J),q.add(ie),G.setItemGraphicEl(ee,ie)}).remove(function(ee){var z=j.getItemGraphicEl(ee);z&&q.remove(z)}).execute(),this._data=G},_renderLarge:function(U){this._clear(),O(U,this.group);var G=U.get("clip",!0)?w(U.coordinateSystem,!1,U):null;G?this.group.setClipPath(G):this.group.removeClipPath()},_incrementalRenderNormal:function(U,G){for(var j=G.getData(),q=j.getLayout("isSimpleBox"),J;(J=U.next())!=null;){var X,Y=j.getItemLayout(J);X=I(Y,J),D(X,j,J,q),X.incremental=!0,this.group.add(X)}},_incrementalRenderLarge:function(U,G){O(G,this.group,!0)},remove:function(U){this._clear()},_clear:function(){this.group.removeAll(),this._data=null},dispose:m.noop}),M=x.extend({type:"normalCandlestickBox",shape:{},buildPath:function(U,G){var j=G.points;this.__simpleBox?(U.moveTo(j[4][0],j[4][1]),U.lineTo(j[6][0],j[6][1])):(U.moveTo(j[0][0],j[0][1]),U.lineTo(j[1][0],j[1][1]),U.lineTo(j[2][0],j[2][1]),U.lineTo(j[3][0],j[3][1]),U.closePath(),U.moveTo(j[4][0],j[4][1]),U.lineTo(j[5][0],j[5][1]),U.moveTo(j[6][0],j[6][1]),U.lineTo(j[7][0],j[7][1]))}});function I(U,G,j){var q=U.ends;return new M({shape:{points:j?L(q,U):q},z2:100})}function P(U,G){for(var j=!0,q=0;q0?"P":"N",X=q.getVisual("borderColor"+J)||q.getVisual("color"+J),Y=j.getModel(A).getItemStyle(T);G.useStyle(Y),G.style.fill=null,G.style.stroke=X}var k=S;f.exports=k}),axt=xt((o,f)=>{var m=Wi();function v(y){!y||!m.isArray(y.series)||m.each(y.series,function(x){m.isObject(x)&&x.type==="k"&&(x.type="candlestick")})}f.exports=v}),sxt=xt((o,f)=>{var m=aU(),v=["itemStyle","borderColor"],y=["itemStyle","borderColor0"],x=["itemStyle","color"],C=["itemStyle","color0"],w={seriesType:"candlestick",plan:m(),performRawSeries:!0,reset:function(A,E){var T=A.getData();if(T.setVisual({legendSymbol:"roundRect",colorP:I(1,A),colorN:I(-1,A),borderColorP:P(1,A),borderColorN:P(-1,A)}),E.isSeriesFiltered(A))return;var S=A.pipelineContext.large;return!S&&{progress:M};function M(D,L){for(var R;(R=D.next())!=null;){var O=L.getItemModel(R),F=L.getItemLayout(R).sign;L.setItemVisual(R,{color:I(F,O),borderColor:P(F,O)})}}function I(D,L){return L.get(D>0?x:C)}function P(D,L){return L.get(D>0?v:y)}}};f.exports=w}),lxt=xt((o,f)=>{var m=xa(),v=m.subPixelOptimize,y=aU(),x=il(),C=x.parsePercent,w=Wi(),A=w.retrieve2,E=typeof Float32Array<"u"?Float32Array:Array,T={seriesType:"candlestick",plan:y(),reset:function(I){var P=I.coordinateSystem,D=I.getData(),L=M(I,D),R=0,O=1,F=["x","y"],k=D.mapDimension(F[R]),U=D.mapDimension(F[O],!0),G=U[0],j=U[1],q=U[2],J=U[3];if(D.setLayout({candleWidth:L,isSimpleBox:L<=1.3}),k==null||U.length<4)return;return{progress:I.pipelineContext.large?Y:X};function X(Q,ee){for(var z;(z=Q.next())!=null;){var ie=ee.get(k,z),re=ee.get(G,z),ne=ee.get(j,z),oe=ee.get(q,z),se=ee.get(J,z),ae=Math.min(re,ne),fe=Math.max(re,ne),de=Ce(ae,ie),ve=Ce(fe,ie),pe=Ce(oe,ie),ce=Ce(se,ie),he=[];Se(he,ve,0),Se(he,de,1),he.push(Oe(ce),Oe(ve),Oe(pe),Oe(de)),ee.setItemLayout(z,{sign:S(ee,z,re,ne,j),initBaseline:re>ne?ve[O]:de[O],ends:he,brushRect:De(oe,se,ie)})}function Ce(Ue,Xe){var it=[];return it[R]=Xe,it[O]=Ue,isNaN(Xe)||isNaN(Ue)?[NaN,NaN]:P.dataToPoint(it)}function Se(Ue,Xe,it){var ut=Xe.slice(),at=Xe.slice();ut[R]=v(ut[R]+L/2,1,!1),at[R]=v(at[R]-L/2,1,!0),it?Ue.push(ut,at):Ue.push(at,ut)}function De(Ue,Xe,it){var ut=Ce(Ue,it),at=Ce(Xe,it);return ut[R]-=L/2,at[R]-=L/2,{x:ut[0],y:ut[1],width:O?L:at[0]-ut[0],height:O?at[1]-ut[1]:L}}function Oe(Ue){return Ue[R]=v(Ue[R],1),Ue}}function Y(Q,ee){for(var z=new E(Q.count*4),ie=0,re,ne=[],oe=[],se;(se=Q.next())!=null;){var ae=ee.get(k,se),fe=ee.get(G,se),de=ee.get(j,se),ve=ee.get(q,se),pe=ee.get(J,se);if(isNaN(ae)||isNaN(ve)||isNaN(pe)){z[ie++]=NaN,ie+=3;continue}z[ie++]=S(ee,se,fe,de,j),ne[R]=ae,ne[O]=ve,re=P.dataToPoint(ne,null,oe),z[ie++]=re?re[0]:NaN,z[ie++]=re?re[1]:NaN,ne[O]=pe,re=P.dataToPoint(ne,null,oe),z[ie++]=re?re[1]:NaN}ee.setLayout("largePoints",z)}}};function S(I,P,D,L,R){var O;return D>L?O=-1:D0?I.get(R,P-1)<=L?1:-1:1,O}function M(I,P){var D=I.getBaseAxis(),L,R=D.type==="category"?D.getBandWidth():(L=D.getExtent(),Math.abs(L[1]-L[0])/P.count()),O=C(A(I.get("barMaxWidth"),R),R),F=C(A(I.get("barMinWidth"),1),R),k=I.get("barWidth");return k!=null?C(k,R):Math.max(Math.min(R/2,O),F)}f.exports=T}),uxt=xt(()=>{var o=fo();nxt(),oxt();var f=axt(),m=sxt(),v=lxt();o.registerPreprocessor(f),o.registerVisual(m),o.registerLayout(v)}),cxt=xt((o,f)=>{var m=zM(),v=Jg(),y=v.extend({type:"series.effectScatter",dependencies:["grid","polar"],getInitialData:function(x,C){return m(this.getSource(),this,{useEncodeDefaulter:!0})},brushSelector:"point",defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,effectType:"ripple",progressive:0,showEffectOn:"render",rippleEffect:{period:4,scale:2.5,brushType:"fill"},symbolSize:10}});f.exports=y}),hxt=xt((o,f)=>{var m=Wi(),v=qw(),y=v.createSymbol,x=xa(),C=x.Group,w=il(),A=w.parsePercent,E=Pie(),T=3;function S(L){return m.isArray(L)||(L=[+L,+L]),L}function M(L,R){var O=R.rippleEffectColor||R.color;L.eachChild(function(F){F.attr({z:R.z,zlevel:R.zlevel,style:{stroke:R.brushType==="stroke"?O:null,fill:R.brushType==="fill"?O:null}})})}function I(L,R){C.call(this);var O=new E(L,R),F=new C;this.add(O),this.add(F),F.beforeUpdate=function(){this.attr(O.getScale())},this.updateData(L,R)}var P=I.prototype;P.stopEffectAnimation=function(){this.childAt(1).removeAll()},P.startEffectAnimation=function(L){for(var R=L.symbolType,O=L.color,F=this.childAt(1),k=0;k{var m=fo(),v=Wj(),y=hxt(),x=Ky(),C=Yj(),w=m.extendChartView({type:"effectScatter",init:function(){this._symbolDraw=new v(y)},render:function(A,E,T){var S=A.getData(),M=this._symbolDraw;M.updateData(S),this.group.add(M.group)},updateTransform:function(A,E,T){var S=A.getData();this.group.dirty();var M=C().reset(A);M.progress&&M.progress({start:0,end:S.count()},S),this._symbolDraw.updateLayout(S)},_updateGroupTransform:function(A){var E=A.coordinateSystem;E&&E.getRoamTransform&&(this.group.transform=x.clone(E.getRoamTransform()),this.group.decomposeTransform())},remove:function(A,E){this._symbolDraw&&this._symbolDraw.remove(E)},dispose:function(){}});f.exports=w}),fxt=xt(()=>{var o=fo();cxt(),dxt();var f=sB(),m=Yj();o.registerVisual(f("effectScatter","circle")),o.registerLayout(m("effectScatter"))}),pxt=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Jg(),x=Yw(),C=Wi(),w=C.concatArray,A=C.mergeAll,E=C.map,T=fd(),S=T.encodeHTML,M=aT(),I=typeof Uint32Array>"u"?Array:Uint32Array,P=typeof Float64Array>"u"?Array:Float64Array;function D(O){var F=O.data;F&&F[0]&&F[0][0]&&F[0][0].coord&&(O.data=E(F,function(k){var U=[k[0].coord,k[1].coord],G={coords:U};return k[0].name&&(G.fromName=k[0].name),k[1].name&&(G.toName=k[1].name),A([G,k[0],k[1]])}))}var L=y.extend({type:"series.lines",dependencies:["grid","polar"],visualColorAccessPath:"lineStyle.color",init:function(O){O.data=O.data||[],D(O);var F=this._processFlatCoordsArray(O.data);this._flatCoords=F.flatCoords,this._flatCoordsOffset=F.flatCoordsOffset,F.flatCoords&&(O.data=new Float32Array(F.count)),L.superApply(this,"init",arguments)},mergeOption:function(O){if(O.data=O.data||[],D(O),O.data){var F=this._processFlatCoordsArray(O.data);this._flatCoords=F.flatCoords,this._flatCoordsOffset=F.flatCoordsOffset,F.flatCoords&&(O.data=new Float32Array(F.count))}L.superApply(this,"mergeOption",arguments)},appendData:function(O){var F=this._processFlatCoordsArray(O.data);F.flatCoords&&(this._flatCoords?(this._flatCoords=w(this._flatCoords,F.flatCoords),this._flatCoordsOffset=w(this._flatCoordsOffset,F.flatCoordsOffset)):(this._flatCoords=F.flatCoords,this._flatCoordsOffset=F.flatCoordsOffset),O.data=new Float32Array(F.count)),this.getRawData().appendData(O.data)},_getCoordsFromItemModel:function(O){var F=this.getData().getItemModel(O),k=F.option instanceof Array?F.option:F.getShallow("coords");return k},getLineCoordsCount:function(O){return this._flatCoordsOffset?this._flatCoordsOffset[O*2+1]:this._getCoordsFromItemModel(O).length},getLineCoords:function(O,F){if(this._flatCoordsOffset){for(var k=this._flatCoordsOffset[O*2],U=this._flatCoordsOffset[O*2+1],G=0;Gk}}return{flatCoordsOffset:new Uint32Array(U.buffer,0,q),flatCoords:G,count:J}}return{flatCoordsOffset:null,flatCoords:null,count:O.length}},getInitialData:function(O,F){var k=new x(["value"],this);return k.hasItemOption=!1,k.initData(O.data,[],function(U,G,j,q){if(U instanceof Array)return NaN;k.hasItemOption=!0;var J=U.value;if(J!=null)return J instanceof Array?J[q]:J}),k},formatTooltip:function(O){var F=this.getData(),k=F.getItemModel(O),U=k.get("name");if(U)return U;var G=k.get("fromName"),j=k.get("toName"),q=[];return G!=null&&q.push(G),j!=null&&q.push(j),S(q.join(" > "))},preventIncremental:function(){return!!this.get("effect.show")},getProgressive:function(){var O=this.option.progressive;return O??(this.option.large?1e4:this.get("progressive"))},getProgressiveThreshold:function(){var O=this.option.progressiveThreshold;return O??(this.option.large?2e4:this.get("progressiveThreshold"))},defaultOption:{coordinateSystem:"geo",zlevel:0,z:2,legendHoverLink:!0,hoverAnimation:!0,xAxisIndex:0,yAxisIndex:0,symbol:["none","none"],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:"circle",symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:"end"},lineStyle:{opacity:.5}}}),R=L;f.exports=R}),EGe=xt((o,f)=>{var m=xa(),v=D0e(),y=Wi(),x=qw(),C=x.createSymbol,w=lf(),A=q3();function E(M,I,P){m.Group.call(this),this.add(this.createLine(M,I,P)),this._updateEffectSymbol(M,I)}var T=E.prototype;T.createLine=function(M,I,P){return new v(M,I,P)},T._updateEffectSymbol=function(M,I){var P=M.getItemModel(I),D=P.getModel("effect"),L=D.get("symbolSize"),R=D.get("symbol");y.isArray(L)||(L=[L,L]);var O=D.get("color")||M.getItemVisual(I,"color"),F=this.childAt(1);this._symbolType!==R&&(this.remove(F),F=C(R,-.5,-.5,1,1,O),F.z2=100,F.culling=!0,this.add(F)),F&&(F.setStyle("shadowColor",O),F.setStyle(D.getItemStyle(["color"])),F.attr("scale",L),F.setColor(O),F.attr("scale",L),this._symbolType=R,this._symbolScale=L,this._updateEffectAnimation(M,D,I))},T._updateEffectAnimation=function(M,I,P){var D=this.childAt(1);if(D){var L=this,R=M.getItemLayout(P),O=I.get("period")*1e3,F=I.get("loop"),k=I.get("constantSpeed"),U=y.retrieve(I.get("delay"),function(J){return J/M.count()*O/3}),G=typeof U=="function";if(D.ignore=!0,this.updateAnimationPoints(D,R),k>0&&(O=this.getLineLength(D)/k*1e3),O!==this._period||F!==this._loop){D.stopAnimation();var j=U;G&&(j=U(P)),D.__t>0&&(j=-O*D.__t),D.__t=0;var q=D.animate("",F).when(O,{__t:1}).delay(j).during(function(){L.updateSymbolPosition(D)});F||q.done(function(){L.remove(D)}),q.start()}this._period=O,this._loop=F}},T.getLineLength=function(M){return w.dist(M.__p1,M.__cp1)+w.dist(M.__cp1,M.__p2)},T.updateAnimationPoints=function(M,I){M.__p1=I[0],M.__p2=I[1],M.__cp1=I[2]||[(I[0][0]+I[1][0])/2,(I[0][1]+I[1][1])/2]},T.updateData=function(M,I,P){this.childAt(0).updateData(M,I,P),this._updateEffectSymbol(M,I)},T.updateSymbolPosition=function(M){var I=M.__p1,P=M.__p2,D=M.__cp1,L=M.__t,R=M.position,O=[R[0],R[1]],F=A.quadraticAt,k=A.quadraticDerivativeAt;R[0]=F(I[0],D[0],P[0],L),R[1]=F(I[1],D[1],P[1],L);var U=k(I[0],D[0],P[0],L),G=k(I[1],D[1],P[1],L);if(M.rotation=-Math.atan2(G,U)-Math.PI/2,this._symbolType==="line"||this._symbolType==="rect"||this._symbolType==="roundRect")if(M.__lastT!==void 0&&M.__lastT{var m=xa(),v=Wi();function y(w,A,E){m.Group.call(this),this._createPolyline(w,A,E)}var x=y.prototype;x._createPolyline=function(w,A,E){var T=w.getItemLayout(A),S=new m.Polyline({shape:{points:T}});this.add(S),this._updateCommonStl(w,A,E)},x.updateData=function(w,A,E){var T=w.hostModel,S=this.childAt(0),M={shape:{points:w.getItemLayout(A)}};m.updateProps(S,M,T,A),this._updateCommonStl(w,A,E)},x._updateCommonStl=function(w,A,E){var T=this.childAt(0),S=w.getItemModel(A),M=w.getItemVisual(A,"color"),I=E&&E.lineStyle,P=E&&E.hoverLineStyle;(!E||w.hasItemOption)&&(I=S.getModel("lineStyle").getLineStyle(),P=S.getModel("emphasis.lineStyle").getLineStyle()),T.useStyle(v.defaults({strokeNoScale:!0,fill:"none",stroke:M},I)),T.hoverStyle=P,m.setHoverStyle(this)},x.updateLayout=function(w,A){var E=this.childAt(0);E.setShape("points",w.getItemLayout(A))},v.inherits(y,m.Group);var C=y;f.exports=C}),mxt=xt((o,f)=>{var m=TGe(),v=Wi(),y=EGe(),x=lf();function C(E,T,S){y.call(this,E,T,S),this._lastFrame=0,this._lastFramePercent=0}var w=C.prototype;w.createLine=function(E,T,S){return new m(E,T,S)},w.updateAnimationPoints=function(E,T){this._points=T;for(var S=[0],M=0,I=1;I=0&&!(M[D]<=T);D--);D=Math.min(D,I-2)}else{for(var D=P;DT);D++);D=Math.min(D-1,I-2)}x.lerp(E.position,S[D],S[D+1],(T-M[D])/(M[D+1]-M[D]));var R=S[D+1][0]-S[D][0],O=S[D+1][1]-S[D][1];E.rotation=-Math.atan2(O,R)-Math.PI/2,this._lastFrame=D,this._lastFramePercent=T,E.ignore=!1}},v.inherits(C,y);var A=C;f.exports=A}),gxt=xt((o,f)=>{var m=xa(),v=y0e(),y=L8e(),x=R8e(),C=m.extendShape({shape:{polyline:!1,curveness:0,segs:[]},buildPath:function(T,S){var M=S.segs,I=S.curveness;if(S.polyline)for(var P=0;P0){T.moveTo(M[P++],M[P++]);for(var L=1;L0){var U=(R+F)/2-(O-k)*I,G=(O+k)/2-(F-R)*I;T.quadraticCurveTo(U,G,F,k)}else T.lineTo(F,k)}},findDataIndex:function(T,S){var M=this.shape,I=M.segs,P=M.curveness;if(M.polyline)for(var D=0,L=0;L0)for(var O=I[L++],F=I[L++],k=1;k0){var j=(O+U)/2-(F-G)*P,q=(F+G)/2-(U-O)*P;if(x.containStroke(O,F,j,q,U,G))return D}else if(y.containStroke(O,F,U,G))return D;D++}return-1}});function w(){this.group=new m.Group}var A=w.prototype;A.isPersistent=function(){return!this._incremental},A.updateData=function(T){this.group.removeAll();var S=new C({rectHover:!0,cursor:"default"});S.setShape({segs:T.getLayout("linesPoints")}),this._setCommon(S,T),this.group.add(S),this._incremental=null},A.incrementalPrepareUpdate=function(T){this.group.removeAll(),this._clearIncremental(),T.count()>5e5?(this._incremental||(this._incremental=new v({silent:!0})),this.group.add(this._incremental)):this._incremental=null},A.incrementalUpdate=function(T,S){var M=new C;M.setShape({segs:S.getLayout("linesPoints")}),this._setCommon(M,S,!!this._incremental),this._incremental?this._incremental.addDisplayable(M,!0):(M.rectHover=!0,M.cursor="default",M.__startIndex=T.start,this.group.add(M))},A.remove=function(){this._clearIncremental(),this._incremental=null,this.group.removeAll()},A._setCommon=function(T,S,M){var I=S.hostModel;T.setShape({polyline:I.get("polyline"),curveness:I.get("lineStyle.curveness")}),T.useStyle(I.getModel("lineStyle").getLineStyle()),T.style.strokeNoScale=!0;var P=S.getVisual("color");P&&T.setStyle("stroke",P),T.setStyle("fill"),M||(T.seriesIndex=I.seriesIndex,T.on("mousemove",function(D){T.dataIndex=null;var L=T.findDataIndex(D.offsetX,D.offsetY);L>0&&(T.dataIndex=L+T.__startIndex)}))},A._clearIncremental=function(){var T=this._incremental;T&&T.clearDisplaybles()};var E=w;f.exports=E}),SGe=xt((o,f)=>{var m=aU(),v={seriesType:"lines",plan:m(),reset:function(y){var x=y.coordinateSystem,C=y.get("polyline"),w=y.pipelineContext.large;function A(E,T){var S=[];if(w){var M,I=E.end-E.start;if(C){for(var P=0,D=E.start;D{var m=Ac(),v=m.__DEV__,y=fo(),x=L0e(),C=EGe(),w=D0e(),A=TGe(),E=mxt(),T=gxt(),S=SGe(),M=jj(),I=M.createClipPath,P=y.extendChartView({type:"lines",init:function(){},render:function(D,L,R){var O=D.getData(),F=this._updateLineDraw(O,D),k=D.get("zlevel"),U=D.get("effect.trailLength"),G=R.getZr(),j=G.painter.getType()==="svg";j||G.painter.getLayer(k).clear(!0),this._lastZlevel!=null&&!j&&G.configLayer(this._lastZlevel,{motionBlur:!1}),this._showEffect(D)&&U&&(j||G.configLayer(k,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(U/10+.9,1),0)})),F.updateData(O);var q=D.get("clip",!0)&&I(D.coordinateSystem,!1,D);q?this.group.setClipPath(q):this.group.removeClipPath(),this._lastZlevel=k,this._finished=!0},incrementalPrepareRender:function(D,L,R){var O=D.getData(),F=this._updateLineDraw(O,D);F.incrementalPrepareUpdate(O),this._clearLayer(R),this._finished=!1},incrementalRender:function(D,L,R){this._lineDraw.incrementalUpdate(D,L.getData()),this._finished=D.end===L.getData().count()},updateTransform:function(D,L,R){var O=D.getData(),F=D.pipelineContext;if(!this._finished||F.large||F.progressiveRender)return{update:!0};var k=S.reset(D);k.progress&&k.progress({start:0,end:O.count()},O),this._lineDraw.updateLayout(),this._clearLayer(R)},_updateLineDraw:function(D,L){var R=this._lineDraw,O=this._showEffect(L),F=!!L.get("polyline"),k=L.pipelineContext,U=k.large;return(!R||O!==this._hasEffet||F!==this._isPolyline||U!==this._isLargeDraw)&&(R&&R.remove(),R=this._lineDraw=U?new T:new x(F?O?E:A:O?C:w),this._hasEffet=O,this._isPolyline=F,this._isLargeDraw=U,this.group.removeAll()),this.group.add(R.group),R},_showEffect:function(D){return!!D.get("effect.show")},_clearLayer:function(D){var L=D.getZr(),R=L.painter.getType()==="svg";!R&&this._lastZlevel!=null&&L.painter.getLayer(this._lastZlevel).clear(!0)},remove:function(D,L){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(L)},dispose:function(){}});f.exports=P}),vxt=xt((o,f)=>{function m(x){return x instanceof Array||(x=[x,x]),x}var v="lineStyle.opacity".split("."),y={seriesType:"lines",reset:function(x,C,w){var A=m(x.get("symbol")),E=m(x.get("symbolSize")),T=x.getData();T.setVisual("fromSymbol",A&&A[0]),T.setVisual("toSymbol",A&&A[1]),T.setVisual("fromSymbolSize",E&&E[0]),T.setVisual("toSymbolSize",E&&E[1]),T.setVisual("opacity",x.get(v));function S(M,I){var P=M.getItemModel(I),D=m(P.getShallow("symbol",!0)),L=m(P.getShallow("symbolSize",!0)),R=P.get(v);D[0]&&M.setItemVisual(I,"fromSymbol",D[0]),D[1]&&M.setItemVisual(I,"toSymbol",D[1]),L[0]&&M.setItemVisual(I,"fromSymbolSize",L[0]),L[1]&&M.setItemVisual(I,"toSymbolSize",L[1]),M.setItemVisual(I,"opacity",R)}return{dataEach:T.hasItemOption?S:null}}};f.exports=y}),yxt=xt(()=>{var o=fo();pxt(),_xt();var f=SGe(),m=vxt();o.registerLayout(f),o.registerVisual(m)}),xxt=xt((o,f)=>{var m=Jg(),v=zM(),y=aT(),x=m.extend({type:"series.heatmap",getInitialData:function(C,w){return v(this.getSource(),this,{generateCoord:"value"})},preventIncremental:function(){var C=y.get(this.get("coordinateSystem"));if(C&&C.dimensions)return C.dimensions[0]==="lng"&&C.dimensions[1]==="lat"},defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0}});f.exports=x}),Cxt=xt((o,f)=>{var m=Wi(),v=256;function y(){var C=m.createCanvas();this.canvas=C,this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={}}y.prototype={update:function(C,w,A,E,T,S){var M=this._getBrush(),I=this._getGradient(C,T,"inRange"),P=this._getGradient(C,T,"outOfRange"),D=this.pointSize+this.blurSize,L=this.canvas,R=L.getContext("2d"),O=C.length;L.width=w,L.height=A;for(var F=0;F0){var ne=S(q)?I:P;q>0&&(q=q*ie+ee),X[Y++]=ne[re],X[Y++]=ne[re+1],X[Y++]=ne[re+2],X[Y++]=ne[re+3]*q*256}else Y+=4}return R.putImageData(J,0,0),L},_getBrush:function(){var C=this._brushCanvas||(this._brushCanvas=m.createCanvas()),w=this.pointSize+this.blurSize,A=w*2;C.width=A,C.height=A;var E=C.getContext("2d");return E.clearRect(0,0,A,A),E.shadowOffsetX=A,E.shadowBlur=this.blurSize,E.shadowColor="#000",E.beginPath(),E.arc(-w,w,this.pointSize,0,Math.PI*2,!0),E.closePath(),E.fill(),C},_getGradient:function(C,w,A){for(var E=this._gradientPixels,T=E[A]||(E[A]=new Uint8ClampedArray(256*4)),S=[0,0,0,0],M=0,I=0;I<256;I++)w[A](I/255,!0,S),T[M++]=S[0],T[M++]=S[1],T[M++]=S[2],T[M++]=S[3];return T}};var x=y;f.exports=x}),bxt=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=fo(),x=xa(),C=Cxt(),w=Wi();function A(M,I,P){var D=M[1]-M[0];I=w.map(I,function(O){return{interval:[(O.interval[0]-M[0])/D,(O.interval[1]-M[0])/D]}});var L=I.length,R=0;return function(O){for(var F=R;F=0;F--){var k=I[F].interval;if(k[0]<=O&&O<=k[1]){R=F;break}}return F>=0&&F=I[0]&&D<=I[1]}}function T(M){var I=M.dimensions;return I[0]==="lng"&&I[1]==="lat"}var S=y.extendChartView({type:"heatmap",render:function(M,I,P){var D;I.eachComponent("visualMap",function(R){R.eachTargetSeries(function(O){O===M&&(D=R)})}),this.group.removeAll(),this._incrementalDisplayable=null;var L=M.coordinateSystem;L.type==="cartesian2d"||L.type==="calendar"?this._renderOnCartesianAndCalendar(M,P,0,M.getData().count()):T(L)&&this._renderOnGeo(L,M,D,P)},incrementalPrepareRender:function(M,I,P){this.group.removeAll()},incrementalRender:function(M,I,P,D){var L=I.coordinateSystem;L&&this._renderOnCartesianAndCalendar(I,D,M.start,M.end,!0)},_renderOnCartesianAndCalendar:function(M,I,P,D,L){var R=M.coordinateSystem,O,F;if(R.type==="cartesian2d"){var k=R.getAxis("x"),U=R.getAxis("y");O=k.getBandWidth(),F=U.getBandWidth()}for(var G=this.group,j=M.getData(),q="itemStyle",J="emphasis.itemStyle",X="label",Y="emphasis.label",Q=M.getModel(q).getItemStyle(["color"]),ee=M.getModel(J).getItemStyle(),z=M.getModel(X),ie=M.getModel(Y),re=R.type,ne=re==="cartesian2d"?[j.mapDimension("x"),j.mapDimension("y"),j.mapDimension("value")]:[j.mapDimension("time"),j.mapDimension("value")],oe=P;oe{xxt(),bxt()}),Axt=xt((o,f)=>{var m=uGe(),v=m.extend({type:"series.pictorialBar",dependencies:["grid"],defaultOption:{symbol:"circle",symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:"end",symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:"-100%",progressive:0,hoverAnimation:!1},getInitialData:function(x){return x.stack=null,v.superApply(this,"getInitialData",arguments)}}),y=v;f.exports=y}),Ext=xt((o,f)=>{var m=fo(),v=Wi(),y=xa(),x=qw(),C=x.createSymbol,w=il(),A=w.parsePercent,E=w.isNumeric,T=cGe(),S=T.setLabel,M=["itemStyle","borderWidth"],I=[{xy:"x",wh:"width",index:0,posDesc:["left","right"]},{xy:"y",wh:"height",index:1,posDesc:["top","bottom"]}],P=new y.Circle,D=m.extendChartView({type:"pictorialBar",render:function(pe,ce,he){var Ce=this.group,Se=pe.getData(),De=this._data,Oe=pe.coordinateSystem,Ue=Oe.getBaseAxis(),Xe=!!Ue.isHorizontal(),it=Oe.grid.getRect(),ut={ecSize:{width:he.getWidth(),height:he.getHeight()},seriesModel:pe,coordSys:Oe,coordSysExtent:[[it.x,it.x+it.width],[it.y,it.y+it.height]],isHorizontal:Xe,valueDim:I[+Xe],categoryDim:I[1-Xe]};return Se.diff(De).add(function(at){if(Se.hasValue(at)){var Pt=Y(Se,at),Qe=L(Se,at,Pt,ut),ft=ie(Se,ut,Qe);Se.setItemGraphicEl(at,ft),Ce.add(ft),fe(ft,ut,Qe)}}).update(function(at,Pt){var Qe=De.getItemGraphicEl(Pt);if(!Se.hasValue(at)){Ce.remove(Qe);return}var ft=Y(Se,at),Ot=L(Se,at,ft,ut),Xt=oe(Se,Ot);Qe&&Xt!==Qe.__pictorialShapeStr&&(Ce.remove(Qe),Se.setItemGraphicEl(at,null),Qe=null),Qe?re(Qe,ut,Ot):Qe=ie(Se,ut,Ot,!0),Se.setItemGraphicEl(at,Qe),Qe.__pictorialSymbolMeta=Ot,Ce.add(Qe),fe(Qe,ut,Ot)}).remove(function(at){var Pt=De.getItemGraphicEl(at);Pt&&ne(De,at,Pt.__pictorialSymbolMeta.animationModel,Pt)}).execute(),this._data=Se,this.group},dispose:v.noop,remove:function(pe,ce){var he=this.group,Ce=this._data;pe.get("animation")?Ce&&Ce.eachItemGraphicEl(function(Se){ne(Ce,Se.dataIndex,pe,Se)}):he.removeAll()}});function L(pe,ce,he,Ce){var Se=pe.getItemLayout(ce),De=he.get("symbolRepeat"),Oe=he.get("symbolClip"),Ue=he.get("symbolPosition")||"start",Xe=he.get("symbolRotate"),it=(Xe||0)*Math.PI/180||0,ut=he.get("symbolPatternSize")||2,at=he.isAnimationEnabled(),Pt={dataIndex:ce,layout:Se,itemModel:he,symbolType:pe.getItemVisual(ce,"symbol")||"circle",color:pe.getItemVisual(ce,"color"),symbolClip:Oe,symbolRepeat:De,symbolRepeatDirection:he.get("symbolRepeatDirection"),symbolPatternSize:ut,rotation:it,animationModel:at?he:null,hoverAnimation:at&&he.get("hoverAnimation"),z2:he.getShallow("z",!0)||0};R(he,De,Se,Ce,Pt),F(pe,ce,Se,De,Oe,Pt.boundingLength,Pt.pxSign,ut,Ce,Pt),k(he,Pt.symbolScale,it,Ce,Pt);var Qe=Pt.symbolSize,ft=he.get("symbolOffset");return v.isArray(ft)&&(ft=[A(ft[0],Qe[0]),A(ft[1],Qe[1])]),U(he,Qe,Se,De,Oe,ft,Ue,Pt.valueLineWidth,Pt.boundingLength,Pt.repeatCutLength,Ce,Pt),Pt}function R(pe,ce,he,Ce,Se){var De=Ce.valueDim,Oe=pe.get("symbolBoundingData"),Ue=Ce.coordSys.getOtherAxis(Ce.coordSys.getBaseAxis()),Xe=Ue.toGlobalCoord(Ue.dataToCoord(0)),it=1-+(he[De.wh]<=0),ut;if(v.isArray(Oe)){var at=[O(Ue,Oe[0])-Xe,O(Ue,Oe[1])-Xe];at[1]0?1:ut<0?-1:0}function O(pe,ce){return pe.toGlobalCoord(pe.dataToCoord(pe.scale.parse(ce)))}function F(pe,ce,he,Ce,Se,De,Oe,Ue,Xe,it){var ut=Xe.valueDim,at=Xe.categoryDim,Pt=Math.abs(he[at.wh]),Qe=pe.getItemVisual(ce,"symbolSize");v.isArray(Qe)?Qe=Qe.slice():(Qe==null&&(Qe="100%"),Qe=[Qe,Qe]),Qe[at.index]=A(Qe[at.index],Pt),Qe[ut.index]=A(Qe[ut.index],Ce?Pt:Math.abs(De)),it.symbolSize=Qe;var ft=it.symbolScale=[Qe[0]/Ue,Qe[1]/Ue];ft[ut.index]*=(Xe.isHorizontal?-1:1)*Oe}function k(pe,ce,he,Ce,Se){var De=pe.get(M)||0;De&&(P.attr({scale:ce.slice(),rotation:he}),P.updateTransform(),De/=P.getLineScale(),De*=ce[Ce.valueDim.index]),Se.valueLineWidth=De}function U(pe,ce,he,Ce,Se,De,Oe,Ue,Xe,it,ut,at){var Pt=ut.categoryDim,Qe=ut.valueDim,ft=at.pxSign,Ot=Math.max(ce[Qe.index]+Ue,0),Xt=Ot;if(Ce){var At=Math.abs(Xe),bt=v.retrieve(pe.get("symbolMargin"),"15%")+"",gt=!1;bt.lastIndexOf("!")===bt.length-1&&(gt=!0,bt=bt.slice(0,bt.length-1)),bt=A(bt,ce[Qe.index]);var It=Math.max(Ot+bt*2,0),Jt=gt?0:bt*2,bi=E(Ce),Yi=bi?Ce:de((At+Jt)/It),ii=At-Yi*Ot;bt=ii/2/(gt?Yi:Yi-1),It=Ot+bt*2,Jt=gt?0:bt*2,!bi&&Ce!=="fixed"&&(Yi=it?de((Math.abs(it)+Jt)/It):0),Xt=Yi*It-Jt,at.repeatTimes=Yi,at.symbolMargin=bt}var ei=ft*(Xt/2),Li=at.pathPosition=[];Li[Pt.index]=he[Pt.wh]/2,Li[Qe.index]=Oe==="start"?ei:Oe==="end"?Xe-ei:Xe/2,De&&(Li[0]+=De[0],Li[1]+=De[1]);var Je=at.bundlePosition=[];Je[Pt.index]=he[Pt.xy],Je[Qe.index]=he[Qe.xy];var Nt=at.barRectShape=v.extend({},he);Nt[Qe.wh]=ft*Math.max(Math.abs(he[Qe.wh]),Math.abs(Li[Qe.index]+ei)),Nt[Pt.wh]=he[Pt.wh];var yi=at.clipShape={};yi[Pt.xy]=-he[Pt.xy],yi[Pt.wh]=ut.ecSize[Pt.wh],yi[Qe.xy]=0,yi[Qe.wh]=he[Qe.wh]}function G(pe){var ce=pe.symbolPatternSize,he=C(pe.symbolType,-ce/2,-ce/2,ce,ce,pe.color);return he.attr({culling:!0}),he.type!=="image"&&he.setStyle({strokeNoScale:!0}),he}function j(pe,ce,he,Ce){var Se=pe.__pictorialBundle,De=he.symbolSize,Oe=he.valueLineWidth,Ue=he.pathPosition,Xe=ce.valueDim,it=he.repeatTimes||0,ut=0,at=De[ce.valueDim.index]+Oe+he.symbolMargin*2;for(se(pe,function(At){At.__pictorialAnimationIndex=ut,At.__pictorialRepeatTimes=it,ut0:gt<0)&&(It=it-1-At),bt[Xe.index]=at*(It-it/2+.5)+Ue[Xe.index],{position:bt,scale:he.symbolScale.slice(),rotation:he.rotation}}function Ot(){se(pe,function(At){At.trigger("emphasis")})}function Xt(){se(pe,function(At){At.trigger("normal")})}}function q(pe,ce,he,Ce){var Se=pe.__pictorialBundle,De=pe.__pictorialMainPath;De?ae(De,null,{position:he.pathPosition.slice(),scale:he.symbolScale.slice(),rotation:he.rotation},he,Ce):(De=pe.__pictorialMainPath=G(he),Se.add(De),ae(De,{position:he.pathPosition.slice(),scale:[0,0],rotation:he.rotation},{scale:he.symbolScale.slice()},he,Ce),De.on("mouseover",Oe).on("mouseout",Ue)),z(De,he);function Oe(){this.trigger("emphasis")}function Ue(){this.trigger("normal")}}function J(pe,ce,he){var Ce=v.extend({},ce.barRectShape),Se=pe.__pictorialBarRect;Se?ae(Se,null,{shape:Ce},ce,he):(Se=pe.__pictorialBarRect=new y.Rect({z2:2,shape:Ce,silent:!0,style:{stroke:"transparent",fill:"transparent",lineWidth:0}}),pe.add(Se))}function X(pe,ce,he,Ce){if(he.symbolClip){var Se=pe.__pictorialClipPath,De=v.extend({},he.clipShape),Oe=ce.valueDim,Ue=he.animationModel,Xe=he.dataIndex;if(Se)y.updateProps(Se,{shape:De},Ue,Xe);else{De[Oe.wh]=0,Se=new y.Rect({shape:De}),pe.__pictorialBundle.setClipPath(Se),pe.__pictorialClipPath=Se;var it={};it[Oe.wh]=he.clipShape[Oe.wh],y[Ce?"updateProps":"initProps"](Se,{shape:it},Ue,Xe)}}}function Y(pe,ce){var he=pe.getItemModel(ce);return he.getAnimationDelayParams=Q,he.isAnimationEnabled=ee,he}function Q(pe){return{index:pe.__pictorialAnimationIndex,count:pe.__pictorialRepeatTimes}}function ee(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow("animation")}function z(pe,ce){pe.off("emphasis").off("normal");var he=ce.symbolScale.slice();ce.hoverAnimation&&pe.on("emphasis",function(){this.animateTo({scale:[he[0]*1.1,he[1]*1.1]},400,"elasticOut")}).on("normal",function(){this.animateTo({scale:he.slice()},400,"elasticOut")})}function ie(pe,ce,he,Ce){var Se=new y.Group,De=new y.Group;return Se.add(De),Se.__pictorialBundle=De,De.attr("position",he.bundlePosition.slice()),he.symbolRepeat?j(Se,ce,he):q(Se,ce,he),J(Se,he,Ce),X(Se,ce,he,Ce),Se.__pictorialShapeStr=oe(pe,he),Se.__pictorialSymbolMeta=he,Se}function re(pe,ce,he){var Ce=he.animationModel,Se=he.dataIndex,De=pe.__pictorialBundle;y.updateProps(De,{position:he.bundlePosition.slice()},Ce,Se),he.symbolRepeat?j(pe,ce,he,!0):q(pe,ce,he,!0),J(pe,he,!0),X(pe,ce,he,!0)}function ne(pe,ce,he,Ce){var Se=Ce.__pictorialBarRect;Se&&(Se.style.text=null);var De=[];se(Ce,function(Oe){De.push(Oe)}),Ce.__pictorialMainPath&&De.push(Ce.__pictorialMainPath),Ce.__pictorialClipPath&&(he=null),v.each(De,function(Oe){y.updateProps(Oe,{scale:[0,0]},he,ce,function(){Ce.parent&&Ce.parent.remove(Ce)})}),pe.setItemGraphicEl(ce,null)}function oe(pe,ce){return[pe.getItemVisual(ce.dataIndex,"symbol")||"none",!!ce.symbolRepeat,!!ce.symbolClip].join(":")}function se(pe,ce,he){v.each(pe.__pictorialBundle.children(),function(Ce){Ce!==pe.__pictorialBarRect&&ce.call(he,Ce)})}function ae(pe,ce,he,Ce,Se,De){ce&&pe.attr(ce),Ce.symbolClip&&!Se?he&&pe.attr(he):he&&y[Se?"updateProps":"initProps"](pe,he,Ce.animationModel,Ce.dataIndex,De)}function fe(pe,ce,he){var Ce=he.color,Se=he.dataIndex,De=he.itemModel,Oe=De.getModel("itemStyle").getItemStyle(["color"]),Ue=De.getModel("emphasis.itemStyle").getItemStyle(),Xe=De.getShallow("cursor");se(pe,function(Pt){Pt.setColor(Ce),Pt.setStyle(v.defaults({fill:Ce,opacity:he.opacity},Oe)),y.setHoverStyle(Pt,Ue),Xe&&(Pt.cursor=Xe),Pt.z2=he.z2});var it={},ut=ce.valueDim.posDesc[+(he.boundingLength>0)],at=pe.__pictorialBarRect;S(at.style,it,De,Ce,ce.seriesModel,Se,ut),y.setHoverStyle(at,it)}function de(pe){var ce=Math.round(pe);return Math.abs(pe-ce)<1e-4?ce:Math.ceil(pe)}var ve=D;f.exports=ve}),Txt=xt(()=>{var o=fo(),f=Wi();A0e(),Axt(),Ext();var m=Sie(),v=m.layout,y=sB();qj(),o.registerLayout(f.curry(v,"pictorialBar")),o.registerVisual(y("pictorialBar","roundRect"))}),Sxt=xt((o,f)=>{var m=Wi(),v=K3(),y=function(C,w,A,E,T){v.call(this,C,w,A),this.type=E||"value",this.position=T||"bottom",this.orient=null};y.prototype={constructor:y,model:null,isHorizontal:function(){var C=this.position;return C==="top"||C==="bottom"},pointToData:function(C,w){return this.coordinateSystem.pointToData(C,w)[0]},toGlobalCoord:null,toLocalCoord:null},m.inherits(y,v);var x=y;f.exports=x}),Pxt=xt((o,f)=>{var m=Sxt(),v=sT(),y=rd(),x=y.getLayoutRect,C=Wi(),w=C.each;function A(T,S,M){this.dimension="single",this.dimensions=["single"],this._axis=null,this._rect,this._init(T,S,M),this.model=T}A.prototype={type:"singleAxis",axisPointerEnabled:!0,constructor:A,_init:function(T,S,M){var I=this.dimension,P=new m(I,v.createScaleByModel(T),[0,0],T.get("type"),T.get("position")),D=P.type==="category";P.onBand=D&&T.get("boundaryGap"),P.inverse=T.get("inverse"),P.orient=T.get("orient"),T.axis=P,P.model=T,P.coordinateSystem=this,this._axis=P},update:function(T,S){T.eachSeries(function(M){if(M.coordinateSystem===this){var I=M.getData();w(I.mapDimension(this.dimension,!0),function(P){this._axis.scale.unionExtentFromData(I,P)},this),v.niceScaleExtent(this._axis.scale,this._axis.model)}},this)},resize:function(T,S){this._rect=x({left:T.get("left"),top:T.get("top"),right:T.get("right"),bottom:T.get("bottom"),width:T.get("width"),height:T.get("height")},{width:S.getWidth(),height:S.getHeight()}),this._adjustAxis()},getRect:function(){return this._rect},_adjustAxis:function(){var T=this._rect,S=this._axis,M=S.isHorizontal(),I=M?[0,T.width]:[0,T.height],P=S.reverse?1:0;S.setExtent(I[P],I[1-P]),this._updateAxisTransform(S,M?T.x:T.y)},_updateAxisTransform:function(T,S){var M=T.getExtent(),I=M[0]+M[1],P=T.isHorizontal();T.toGlobalCoord=P?function(D){return D+S}:function(D){return I-D+S},T.toLocalCoord=P?function(D){return D-S}:function(D){return I-D+S}},getAxis:function(){return this._axis},getBaseAxis:function(){return this._axis},getAxes:function(){return[this._axis]},getTooltipAxes:function(){return{baseAxes:[this.getAxis()]}},containPoint:function(T){var S=this.getRect(),M=this.getAxis(),I=M.orient;return I==="horizontal"?M.contain(M.toLocalCoord(T[0]))&&T[1]>=S.y&&T[1]<=S.y+S.height:M.contain(M.toLocalCoord(T[1]))&&T[0]>=S.y&&T[0]<=S.y+S.height},pointToData:function(T){var S=this.getAxis();return[S.coordToData(S.toLocalCoord(T[S.orient==="horizontal"?0:1]))]},dataToPoint:function(T){var S=this.getAxis(),M=this.getRect(),I=[],P=S.orient==="horizontal"?0:1;return T instanceof Array&&(T=T[0]),I[P]=S.toGlobalCoord(S.dataToCoord(+T)),I[1-P]=P===0?M.y+M.height/2:M.x+M.width/2,I}};var E=A;f.exports=E}),Ixt=xt(()=>{var o=Pxt(),f=aT();function m(v,y){var x=[];return v.eachComponent("singleAxis",function(C,w){var A=new o(C,v,y);A.name="single_"+w,A.resize(C,y),C.coordinateSystem=A,x.push(A)}),v.eachSeries(function(C){if(C.get("coordinateSystem")==="singleAxis"){var w=v.queryComponents({mainType:"singleAxis",index:C.get("singleAxisIndex"),id:C.get("singleAxisId")})[0];C.coordinateSystem=w&&w.coordinateSystem}}),x}f.register("single",{create:m,dimensions:o.prototype.dimensions})}),PGe=xt(o=>{var f=Wi();function m(v,y){y=y||{};var x=v.coordinateSystem,C=v.axis,w={},A=C.position,E=C.orient,T=x.getRect(),S=[T.x,T.x+T.width,T.y,T.y+T.height],M={horizontal:{top:S[2],bottom:S[3]},vertical:{left:S[0],right:S[1]}};w.position=[E==="vertical"?M.vertical[A]:S[0],E==="horizontal"?M.horizontal[A]:S[3]];var I={horizontal:0,vertical:1};w.rotation=Math.PI/2*I[E];var P={top:-1,bottom:1,right:1,left:-1};w.labelDirection=w.tickDirection=w.nameDirection=P[A],v.get("axisTick.inside")&&(w.tickDirection=-w.tickDirection),f.retrieve(y.labelInside,v.get("axisLabel.inside"))&&(w.labelDirection=-w.labelDirection);var D=y.rotate;return D==null&&(D=v.get("axisLabel.rotate")),w.labelRotation=A==="top"?-D:D,w.z2=1,w}o.layout=m}),Mxt=xt((o,f)=>{var m=Wi(),v=Q3(),y=xa(),x=PGe(),C=lB(),w=lGe(),A=w.rectCoordAxisBuildSplitArea,E=w.rectCoordAxisHandleRemove,T=["axisLine","axisTickLabel","axisName"],S=["splitArea","splitLine"],M=C.extend({type:"singleAxis",axisPointerClass:"SingleAxisPointer",render:function(P,D,L,R){var O=this.group;O.removeAll();var F=this._axisGroup;this._axisGroup=new y.Group;var k=x.layout(P),U=new v(P,k);m.each(T,U.add,U),O.add(this._axisGroup),O.add(U.getGroup()),m.each(S,function(G){P.get(G+".show")&&this["_"+G](P)},this),y.groupTransition(F,this._axisGroup,P),M.superCall(this,"render",P,D,L,R)},remove:function(){E(this)},_splitLine:function(P){var D=P.axis;if(!D.scale.isBlank()){var L=P.getModel("splitLine"),R=L.getModel("lineStyle"),O=R.get("width"),F=R.get("color");F=F instanceof Array?F:[F];for(var k=P.coordinateSystem.getRect(),U=D.isHorizontal(),G=[],j=0,q=D.getTicksCoords({tickModel:L}),J=[],X=[],Y=0;Y{var m=Wi(),v=Xg(),y=Iie(),x=lU(),C=v.extend({type:"singleAxis",layoutMode:"box",axis:null,coordinateSystem:null,getCoordSysModel:function(){return this}}),w={left:"5%",top:"5%",right:"5%",bottom:"5%",type:"value",position:"bottom",orient:"horizontal",axisLine:{show:!0,lineStyle:{width:1,type:"solid"}},tooltip:{show:!0},axisTick:{show:!0,length:6,lineStyle:{width:1}},axisLabel:{show:!0,interval:"auto"},splitLine:{show:!0,lineStyle:{type:"dashed",opacity:.2}}};function A(T,S){return S.type||(S.data?"category":"value")}m.merge(C.prototype,x),y("single",C,A,w);var E=C;f.exports=E}),IGe=xt((o,f)=>{var m=Wi(),v=vu();function y(x,C){var w=[],A=x.seriesIndex,E;if(A==null||!(E=C.getSeriesByIndex(A)))return{point:[]};var T=E.getData(),S=v.queryDataIndex(T,x);if(S==null||S<0||m.isArray(S))return{point:[]};var M=T.getItemGraphicEl(S),I=E.coordinateSystem;if(E.getTooltipPosition)w=E.getTooltipPosition(S)||[];else if(I&&I.dataToPoint)w=I.dataToPoint(T.getValues(m.map(I.dimensions,function(D){return T.mapDimension(D)}),S,!0))||[];else if(M){var P=M.getBoundingRect().clone();P.applyTransform(M.transform),w=[P.x+P.width/2,P.y+P.height/2]}return{point:w,el:M}}f.exports=y}),Lxt=xt((o,f)=>{var m=Wi(),v=vu(),y=v.makeInner,x=Mie(),C=IGe(),w=m.each,A=m.curry,E=y();function T(U,G,j){var q=U.currTrigger,J=[U.x,U.y],X=U,Y=U.dispatchAction||m.bind(j.dispatchAction,j),Q=G.getComponent("axisPointer").coordSysAxesInfo;if(Q){k(J)&&(J=C({seriesIndex:X.seriesIndex,dataIndex:X.dataIndex},G).point);var ee=k(J),z=X.axesInfo,ie=Q.axesInfo,re=q==="leave"||k(J),ne={},oe={},se={list:[],map:{}},ae={showPointer:A(I,oe),showTooltip:A(P,se)};w(Q.coordSysMap,function(de,ve){var pe=ee||de.containPoint(J);w(Q.coordSysAxesInfo[ve],function(ce,he){var Ce=ce.axis,Se=O(z,ce);if(!re&&pe&&(!z||Se)){var De=Se&&Se.value;De==null&&!ee&&(De=Ce.pointToData(J)),De!=null&&S(ce,De,ae,!1,ne)}})});var fe={};return w(ie,function(de,ve){var pe=de.linkGroup;pe&&!oe[ve]&&w(pe.axesInfo,function(ce,he){var Ce=oe[he];if(ce!==de&&Ce){var Se=Ce.value;pe.mapper&&(Se=de.axis.scale.parse(pe.mapper(Se,F(ce),F(de)))),fe[de.key]=Se}})}),w(fe,function(de,ve){S(ie[ve],de,ae,!0,ne)}),D(oe,ie,ne),L(se,J,U,Y),R(ie,Y,j),ne}}function S(U,G,j,q,J){var X=U.axis;if(!(X.scale.isBlank()||!X.containData(G))){if(!U.involveSeries){j.showPointer(U,G);return}var Y=M(G,U),Q=Y.payloadBatch,ee=Y.snapToValue;Q[0]&&J.seriesIndex==null&&m.extend(J,Q[0]),!q&&U.snap&&X.containData(ee)&&ee!=null&&(G=ee),j.showPointer(U,G,Q,J),j.showTooltip(U,Y,ee)}}function M(U,G){var j=G.axis,q=j.dim,J=U,X=[],Y=Number.MAX_VALUE,Q=-1;return w(G.seriesModels,function(ee,z){var ie=ee.getData().mapDimension(q,!0),re,ne;if(ee.getAxisTooltipData){var oe=ee.getAxisTooltipData(ie,U,j);ne=oe.dataIndices,re=oe.nestestValue}else{if(ne=ee.getData().indicesOfNearest(ie[0],U,j.type==="category"?.5:null),!ne.length)return;re=ee.getData().get(ie[0],ne[0])}if(!(re==null||!isFinite(re))){var se=U-re,ae=Math.abs(se);ae<=Y&&((ae=0&&Q<0)&&(Y=ae,Q=se,J=re,X.length=0),w(ne,function(fe){X.push({seriesIndex:ee.seriesIndex,dataIndexInside:fe,dataIndex:ee.getData().getRawIndex(fe)})}))}}),{payloadBatch:X,snapToValue:J}}function I(U,G,j,q){U[G.key]={value:j,payloadBatch:q}}function P(U,G,j,q){var J=j.payloadBatch,X=G.axis,Y=X.model,Q=G.axisPointerModel;if(!(!G.triggerTooltip||!J.length)){var ee=G.coordSys.model,z=x.makeKey(ee),ie=U.map[z];ie||(ie=U.map[z]={coordSysId:ee.id,coordSysIndex:ee.componentIndex,coordSysType:ee.type,coordSysMainType:ee.mainType,dataByAxis:[]},U.list.push(ie)),ie.dataByAxis.push({axisDim:X.dim,axisIndex:Y.componentIndex,axisType:Y.type,axisId:Y.id,value:q,valueLabelOpt:{precision:Q.get("label.precision"),formatter:Q.get("label.formatter")},seriesDataIndices:J.slice()})}}function D(U,G,j){var q=j.axesInfo=[];w(G,function(J,X){var Y=J.axisPointerModel.option,Q=U[X];Q?(!J.useHandle&&(Y.status="show"),Y.value=Q.value,Y.seriesDataIndices=(Q.payloadBatch||[]).slice()):!J.useHandle&&(Y.status="hide"),Y.status==="show"&&q.push({axisDim:J.axis.dim,axisIndex:J.axis.model.componentIndex,value:Y.value})})}function L(U,G,j,q){if(k(G)||!U.list.length){q({type:"hideTip"});return}var J=((U.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};q({type:"showTip",escapeConnect:!0,x:G[0],y:G[1],tooltipOption:j.tooltipOption,position:j.position,dataIndexInside:J.dataIndexInside,dataIndex:J.dataIndex,seriesIndex:J.seriesIndex,dataByCoordSys:U.list})}function R(U,G,j){var q=j.getZr(),J="axisPointerLastHighlights",X=E(q)[J]||{},Y=E(q)[J]={};w(U,function(z,ie){var re=z.axisPointerModel.option;re.status==="show"&&w(re.seriesDataIndices,function(ne){var oe=ne.seriesIndex+" | "+ne.dataIndex;Y[oe]=ne})});var Q=[],ee=[];m.each(X,function(z,ie){!Y[ie]&&ee.push(z)}),m.each(Y,function(z,ie){!X[ie]&&Q.push(z)}),ee.length&&j.dispatchAction({type:"downplay",escapeConnect:!0,batch:ee}),Q.length&&j.dispatchAction({type:"highlight",escapeConnect:!0,batch:Q})}function O(U,G){for(var j=0;j<(U||[]).length;j++){var q=U[j];if(G.axis.dim===q.axisDim&&G.axis.model.componentIndex===q.axisIndex)return q}}function F(U){var G=U.axis.model,j={},q=j.axisDim=U.axis.dim;return j.axisIndex=j[q+"AxisIndex"]=G.componentIndex,j.axisName=j[q+"AxisName"]=G.name,j.axisId=j[q+"AxisId"]=G.id,j}function k(U){return!U||U[0]==null||isNaN(U[0])||U[1]==null||isNaN(U[1])}f.exports=T}),Rxt=xt((o,f)=>{var m=fo(),v=m.extendComponentModel({type:"axisPointer",coordSysAxesInfo:null,defaultOption:{show:"auto",triggerOn:null,zlevel:0,z:50,type:"line",snap:!1,triggerTooltip:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#aaa",width:1,type:"solid"},shadowStyle:{color:"rgba(150,150,150,0.3)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,shadowBlur:3,shadowColor:"#aaa"},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}}}),y=v;f.exports=y}),MGe=xt(o=>{var f=Wi(),m=Tm(),v=vu(),y=v.makeInner,x=y(),C=f.each;function w(P,D,L){if(!m.node){var R=D.getZr();x(R).records||(x(R).records={}),A(R,D);var O=x(R).records[P]||(x(R).records[P]={});O.handler=L}}function A(P,D){if(x(P).initialized)return;x(P).initialized=!0,L("click",f.curry(S,"click")),L("mousemove",f.curry(S,"mousemove")),L("globalout",T);function L(R,O){P.on(R,function(F){var k=M(D);C(x(P).records,function(U){U&&O(U,F,k.dispatchAction)}),E(k.pendings,D)})}}function E(P,D){var L=P.showTip.length,R=P.hideTip.length,O;L?O=P.showTip[L-1]:R&&(O=P.hideTip[R-1]),O&&(O.dispatchAction=null,D.dispatchAction(O))}function T(P,D,L){P.handler("leave",null,L)}function S(P,D,L,R){D.handler(P,L,R)}function M(P){var D={showTip:[],hideTip:[]},L=function(R){var O=D[R.type];O?O.push(R):(R.dispatchAction=L,P.dispatchAction(R))};return{dispatchAction:L,pendings:D}}function I(P,D){if(!m.node){var L=D.getZr(),R=(x(L).records||{})[P];R&&(x(L).records[P]=null)}}o.register=w,o.unregister=I}),Oxt=xt((o,f)=>{var m=fo(),v=MGe(),y=m.extendComponentView({type:"axisPointer",render:function(C,w,A){var E=w.getComponent("tooltip"),T=C.get("triggerOn")||E&&E.get("triggerOn")||"mousemove|click";v.register("axisPointer",A,function(S,M,I){T!=="none"&&(S==="leave"||T.indexOf(S)>=0)&&I({type:"updateAxisPointer",currTrigger:S,x:M&&M.offsetX,y:M&&M.offsetY})})},remove:function(C,w){v.unregister(w.getZr(),"axisPointer"),y.superApply(this._model,"remove",arguments)},dispose:function(C,w){v.unregister("axisPointer",w),y.superApply(this._model,"dispose",arguments)}}),x=y;f.exports=x}),N0e=xt((o,f)=>{var m=Wi(),v=kM(),y=xa(),x=Mie(),C=B2(),w=X3(),A=vu(),E=A.makeInner,T=E(),S=m.clone,M=m.bind;function I(){}I.prototype={_group:null,_lastGraphicKey:null,_handle:null,_dragging:!1,_lastValue:null,_lastStatus:null,_payloadInfo:null,animationThreshold:15,render:function(k,U,G,j){var q=U.get("value"),J=U.get("status");if(this._axisModel=k,this._axisPointerModel=U,this._api=G,!(!j&&this._lastValue===q&&this._lastStatus===J)){this._lastValue=q,this._lastStatus=J;var X=this._group,Y=this._handle;if(!J||J==="hide"){X&&X.hide(),Y&&Y.hide();return}X&&X.show(),Y&&Y.show();var Q={};this.makeElOption(Q,q,k,U,G);var ee=Q.graphicKey;ee!==this._lastGraphicKey&&this.clear(G),this._lastGraphicKey=ee;var z=this._moveAnimation=this.determineAnimation(k,U);if(!X)X=this._group=new y.Group,this.createPointerEl(X,Q,k,U),this.createLabelEl(X,Q,k,U),G.getZr().add(X);else{var ie=m.curry(P,U,z);this.updatePointerEl(X,Q,ie,U),this.updateLabelEl(X,Q,ie,U)}O(X,U,!0),this._renderHandle(q)}},remove:function(k){this.clear(k)},dispose:function(k){this.clear(k)},determineAnimation:function(k,U){var G=U.get("animation"),j=k.axis,q=j.type==="category",J=U.get("snap");if(!J&&!q)return!1;if(G==="auto"||G==null){var X=this.animationThreshold;if(q&&j.getBandWidth()>X)return!0;if(J){var Y=x.getAxisInfo(k).seriesDataCount,Q=j.getExtent();return Math.abs(Q[0]-Q[1])/Y>X}return!1}return G===!0},makeElOption:function(k,U,G,j,q){},createPointerEl:function(k,U,G,j){var q=U.pointer;if(q){var J=T(k).pointerEl=new y[q.type](S(U.pointer));k.add(J)}},createLabelEl:function(k,U,G,j){if(U.label){var q=T(k).labelEl=new y.Rect(S(U.label));k.add(q),L(q,j)}},updatePointerEl:function(k,U,G){var j=T(k).pointerEl;j&&U.pointer&&(j.setStyle(U.pointer.style),G(j,{shape:U.pointer.shape}))},updateLabelEl:function(k,U,G,j){var q=T(k).labelEl;q&&(q.setStyle(U.label.style),G(q,{shape:U.label.shape,position:U.label.position}),L(q,j))},_renderHandle:function(k){if(!(this._dragging||!this.updateHandleTransform)){var U=this._axisPointerModel,G=this._api.getZr(),j=this._handle,q=U.getModel("handle"),J=U.get("status");if(!q.get("show")||!J||J==="hide"){j&&G.remove(j),this._handle=null;return}var X;this._handle||(X=!0,j=this._handle=y.createIcon(q.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(ee){C.stop(ee.event)},onmousedown:M(this._onHandleDragMove,this,0,0),drift:M(this._onHandleDragMove,this),ondragend:M(this._onHandleDragEnd,this)}),G.add(j)),O(j,U,!1);var Y=["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];j.setStyle(q.getItemStyle(null,Y));var Q=q.get("size");m.isArray(Q)||(Q=[Q,Q]),j.attr("scale",[Q[0]/2,Q[1]/2]),w.createOrUpdate(this,"_doDispatchAxisPointer",q.get("throttle")||0,"fixRate"),this._moveHandleToValue(k,X)}},_moveHandleToValue:function(k,U){P(this._axisPointerModel,!U&&this._moveAnimation,this._handle,R(this.getHandleTransform(k,this._axisModel,this._axisPointerModel)))},_onHandleDragMove:function(k,U){var G=this._handle;if(G){this._dragging=!0;var j=this.updateHandleTransform(R(G),[k,U],this._axisModel,this._axisPointerModel);this._payloadInfo=j,G.stopAnimation(),G.attr(R(j)),T(G).lastProp=null,this._doDispatchAxisPointer()}},_doDispatchAxisPointer:function(){var k=this._handle;if(k){var U=this._payloadInfo,G=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:U.cursorPoint[0],y:U.cursorPoint[1],tooltipOption:U.tooltipOption,axesInfo:[{axisDim:G.axis.dim,axisIndex:G.componentIndex}]})}},_onHandleDragEnd:function(k){this._dragging=!1;var U=this._handle;if(U){var G=this._axisPointerModel.get("value");this._moveHandleToValue(G),this._api.dispatchAction({type:"hideTip"})}},getHandleTransform:null,updateHandleTransform:null,clear:function(k){this._lastValue=null,this._lastStatus=null;var U=k.getZr(),G=this._group,j=this._handle;U&&G&&(this._lastGraphicKey=null,G&&U.remove(G),j&&U.remove(j),this._group=null,this._handle=null,this._payloadInfo=null)},doClear:function(){},buildLabel:function(k,U,G){return G=G||0,{x:k[G],y:k[1-G],width:U[G],height:U[1-G]}}},I.prototype.constructor=I;function P(k,U,G,j){D(T(G).lastProp,j)||(T(G).lastProp=j,U?y.updateProps(G,j,k):(G.stopAnimation(),G.attr(j)))}function D(k,U){if(m.isObject(k)&&m.isObject(U)){var G=!0;return m.each(U,function(j,q){G=G&&D(k[q],j)}),!!G}else return k===U}function L(k,U){k[U.get("label.show")?"show":"hide"]()}function R(k){return{position:k.position.slice(),rotation:k.rotation||0}}function O(k,U,G){var j=U.get("z"),q=U.get("zlevel");k&&k.traverse(function(J){J.type!=="group"&&(j!=null&&(J.z=j),q!=null&&(J.zlevel=q),J.silent=G)})}v.enableClassExtend(I);var F=I;f.exports=F}),Oie=xt(o=>{var f=Wi(),m=xa(),v=nb(),y=fd(),x=Ky(),C=sT(),w=Q3();function A(R){var O=R.get("type"),F=R.getModel(O+"Style"),k;return O==="line"?(k=F.getLineStyle(),k.fill=null):O==="shadow"&&(k=F.getAreaStyle(),k.stroke=null),k}function E(R,O,F,k,U){var G=F.get("value"),j=S(G,O.axis,O.ecModel,F.get("seriesDataIndices"),{precision:F.get("label.precision"),formatter:F.get("label.formatter")}),q=F.getModel("label"),J=y.normalizeCssArray(q.get("padding")||0),X=q.getFont(),Y=v.getBoundingRect(j,X),Q=U.position,ee=Y.width+J[1]+J[3],z=Y.height+J[0]+J[2],ie=U.align;ie==="right"&&(Q[0]-=ee),ie==="center"&&(Q[0]-=ee/2);var re=U.verticalAlign;re==="bottom"&&(Q[1]-=z),re==="middle"&&(Q[1]-=z/2),T(Q,ee,z,k);var ne=q.get("backgroundColor");(!ne||ne==="auto")&&(ne=O.get("axisLine.lineStyle.color")),R.label={shape:{x:0,y:0,width:ee,height:z,r:q.get("borderRadius")},position:Q.slice(),style:{text:j,textFont:X,textFill:q.getTextColor(),textPosition:"inside",textPadding:J,fill:ne,stroke:q.get("borderColor")||"transparent",lineWidth:q.get("borderWidth")||0,shadowBlur:q.get("shadowBlur"),shadowColor:q.get("shadowColor"),shadowOffsetX:q.get("shadowOffsetX"),shadowOffsetY:q.get("shadowOffsetY")},z2:10}}function T(R,O,F,k){var U=k.getWidth(),G=k.getHeight();R[0]=Math.min(R[0]+O,U)-O,R[1]=Math.min(R[1]+F,G)-F,R[0]=Math.max(R[0],0),R[1]=Math.max(R[1],0)}function S(R,O,F,k,U){R=O.scale.parse(R);var G=O.scale.getLabel(R,{precision:U.precision}),j=U.formatter;if(j){var q={value:C.getAxisRawValue(O,R),axisDimension:O.dim,axisIndex:O.index,seriesData:[]};f.each(k,function(J){var X=F.getSeriesByIndex(J.seriesIndex),Y=J.dataIndexInside,Q=X&&X.getDataParams(Y);Q&&q.seriesData.push(Q)}),f.isString(j)?G=j.replace("{value}",G):f.isFunction(j)&&(G=j(q))}return G}function M(R,O,F){var k=x.create();return x.rotate(k,k,F.rotation),x.translate(k,k,F.position),m.applyTransform([R.dataToCoord(O),(F.labelOffset||0)+(F.labelDirection||1)*(F.labelMargin||0)],k)}function I(R,O,F,k,U,G){var j=w.innerTextLayout(F.rotation,0,F.labelDirection);F.labelMargin=U.get("label.margin"),E(O,k,U,G,{position:M(k.axis,R,F),align:j.textAlign,verticalAlign:j.textVerticalAlign})}function P(R,O,F){return F=F||0,{x1:R[F],y1:R[1-F],x2:O[F],y2:O[1-F]}}function D(R,O,F){return F=F||0,{x:R[F],y:R[1-F],width:O[F],height:O[1-F]}}function L(R,O,F,k,U,G){return{cx:R,cy:O,r0:F,r:k,startAngle:U,endAngle:G,clockwise:!0}}o.buildElStyle=A,o.buildLabelElOption=E,o.getValueLabel=S,o.getTransformedPosition=M,o.buildCartesianSingleLabelElOption=I,o.makeLineShape=P,o.makeRectShape=D,o.makeSectorShape=L}),DGe=xt((o,f)=>{var m=N0e(),v=Oie(),y=sGe(),x=lB(),C=m.extend({makeElOption:function(S,M,I,P,D){var L=I.axis,R=L.grid,O=P.get("type"),F=w(R,L).getOtherAxis(L).getGlobalExtent(),k=L.toGlobalCoord(L.dataToCoord(M,!0));if(O&&O!=="none"){var U=v.buildElStyle(P),G=A[O](L,k,F);G.style=U,S.graphicKey=G.type,S.pointer=G}var j=y.layout(R.model,I);v.buildCartesianSingleLabelElOption(M,S,j,I,P,D)},getHandleTransform:function(S,M,I){var P=y.layout(M.axis.grid.model,M,{labelInside:!1});return P.labelMargin=I.get("handle.margin"),{position:v.getTransformedPosition(M.axis,S,P),rotation:P.rotation+(P.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(S,M,I,P){var D=I.axis,L=D.grid,R=D.getGlobalExtent(!0),O=w(L,D).getOtherAxis(D).getGlobalExtent(),F=D.dim==="x"?0:1,k=S.position;k[F]+=M[F],k[F]=Math.min(R[1],k[F]),k[F]=Math.max(R[0],k[F]);var U=(O[1]+O[0])/2,G=[U,U];G[F]=k[F];var j=[{verticalAlign:"middle"},{align:"center"}];return{position:k,rotation:S.rotation,cursorPoint:G,tooltipOption:j[F]}}});function w(S,M){var I={};return I[M.dim+"AxisIndex"]=M.index,S.getCartesian(I)}var A={line:function(S,M,I){var P=v.makeLineShape([M,I[0]],[M,I[1]],E(S));return{type:"Line",subPixelOptimize:!0,shape:P}},shadow:function(S,M,I){var P=Math.max(1,S.getBandWidth()),D=I[1]-I[0];return{type:"Rect",shape:v.makeRectShape([M-P/2,I[0]],[P,D],E(S))}}};function E(S){return S.dim==="x"?0:1}x.registerAxisPointerClass("CartesianAxisPointer",C);var T=C;f.exports=T}),Qj=xt(()=>{var o=fo(),f=Wi(),m=Mie(),v=Lxt();Rxt(),Oxt(),DGe(),o.registerPreprocessor(function(y){if(y){(!y.axisPointer||y.axisPointer.length===0)&&(y.axisPointer={});var x=y.axisPointer.link;x&&!f.isArray(x)&&(y.axisPointer.link=[x])}}),o.registerProcessor(o.PRIORITY.PROCESSOR.STATISTIC,function(y,x){y.getComponent("axisPointer").coordSysAxesInfo=m.collect(y,x)}),o.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},v)}),Nxt=xt((o,f)=>{var m=N0e(),v=Oie(),y=PGe(),x=lB(),C=["x","y"],w=["width","height"],A=m.extend({makeElOption:function(I,P,D,L,R){var O=D.axis,F=O.coordinateSystem,k=S(F,1-T(O)),U=F.dataToPoint(P)[0],G=L.get("type");if(G&&G!=="none"){var j=v.buildElStyle(L),q=E[G](O,U,k);q.style=j,I.graphicKey=q.type,I.pointer=q}var J=y.layout(D);v.buildCartesianSingleLabelElOption(P,I,J,D,L,R)},getHandleTransform:function(I,P,D){var L=y.layout(P,{labelInside:!1});return L.labelMargin=D.get("handle.margin"),{position:v.getTransformedPosition(P.axis,I,L),rotation:L.rotation+(L.labelDirection<0?Math.PI:0)}},updateHandleTransform:function(I,P,D,L){var R=D.axis,O=R.coordinateSystem,F=T(R),k=S(O,F),U=I.position;U[F]+=P[F],U[F]=Math.min(k[1],U[F]),U[F]=Math.max(k[0],U[F]);var G=S(O,1-F),j=(G[1]+G[0])/2,q=[j,j];return q[F]=U[F],{position:U,rotation:I.rotation,cursorPoint:q,tooltipOption:{verticalAlign:"middle"}}}}),E={line:function(I,P,D){var L=v.makeLineShape([P,D[0]],[P,D[1]],T(I));return{type:"Line",subPixelOptimize:!0,shape:L}},shadow:function(I,P,D){var L=I.getBandWidth(),R=D[1]-D[0];return{type:"Rect",shape:v.makeRectShape([P-L/2,D[0]],[L,R],T(I))}}};function T(I){return I.isHorizontal()?0:1}function S(I,P){var D=I.getRect();return[D[C[P]],D[C[P]]+D[w[P]]]}x.registerAxisPointerClass("SingleAxisPointer",A);var M=A;f.exports=M}),LGe=xt(()=>{var o=fo();Ixt(),Mxt(),Dxt(),Qj(),Nxt(),o.extendComponentView({type:"single"})}),Fxt=xt((o,f)=>{var m=Jg(),v=sU(),y=Gj(),x=y.getDimensionTypeByAxis,C=Yw(),w=Wi(),A=vu(),E=A.groupData,T=fd(),S=T.encodeHTML,M=Xj(),I=2,P=m.extend({type:"series.themeRiver",dependencies:["singleAxis"],nameMap:null,init:function(L){P.superApply(this,"init",arguments),this.legendVisualProvider=new M(w.bind(this.getData,this),w.bind(this.getRawData,this))},fixData:function(L){var R=L.length,O=E(L,function(ne){return ne[2]}),F=[];O.buckets.each(function(ne,oe){F.push({name:oe,dataList:ne})});for(var k=F.length,U=-1,G=-1,j=0;jU&&(U=q,G=j)}for(var J=0;J{var m=fo(),v=nGe(),y=v.Polygon,x=xa(),C=Wi(),w=C.bind,A=C.extend,E=aB(),T=m.extendChartView({type:"themeRiver",init:function(){this._layers=[]},render:function(M,I,P){var D=M.getData(),L=this.group,R=M.getLayerSeries(),O=D.getLayout("layoutInfo"),F=O.rect,k=O.boundaryGap;L.attr("position",[0,F.y+k[0]]);function U(J){return J.name}var G=new E(this._layersSeries||[],R,U,U),j={};G.add(w(q,this,"add")).update(w(q,this,"update")).remove(w(q,this,"remove")).execute();function q(J,X,Y){var Q=this._layers;if(J==="remove"){L.remove(Q[X]);return}for(var ee=[],z=[],ie,re=R[X].indices,ne=0;ne{var m=Wi(),v=il();function y(w,A){w.eachSeriesByType("themeRiver",function(E){var T=E.getData(),S=E.coordinateSystem,M={},I=S.getRect();M.rect=I;var P=E.get("boundaryGap"),D=S.getAxis();if(M.boundaryGap=P,D.orient==="horizontal"){P[0]=v.parsePercent(P[0],I.height),P[1]=v.parsePercent(P[1],I.height);var L=I.height-P[0]-P[1];x(T,E,L)}else{P[0]=v.parsePercent(P[0],I.width),P[1]=v.parsePercent(P[1],I.width);var R=I.width-P[0]-P[1];x(T,E,R)}T.setLayout("layoutInfo",M)})}function x(w,A,E){if(w.count())for(var T=A.coordinateSystem,S=A.getLayerSeries(),M=w.mapDimension("single"),I=w.mapDimension("value"),P=m.map(S,function(j){return m.map(j.indices,function(q){var J=T.dataToPoint(w.get(M,q));return J[1]=w.get(I,q),J})}),D=C(P),L=D.y0,R=E/D.max,O=S.length,F=S[0].indices.length,k,U=0;UM&&(M=I),T.push(I)}for(var R=0;RM&&(M=F)}return P.y0=S,P.max=M,P}f.exports=y}),Vxt=xt((o,f)=>{var m=Wi(),v=m.createHashMap;function y(x){x.eachSeriesByType("themeRiver",function(C){var w=C.getData(),A=C.getRawData(),E=C.get("color"),T=v();w.each(function(S){T.set(w.getRawIndex(S),S)}),A.each(function(S){var M=A.getName(S),I=E[(C.nameMap.get(M)-1)%E.length];A.setItemVisual(S,"color",I);var P=T.get(S);P!=null&&w.setItemVisual(P,"color",I)})})}f.exports=y}),zxt=xt(()=>{var o=fo();LGe(),Fxt(),Bxt();var f=kxt(),m=Vxt(),v=Jj();o.registerLayout(f),o.registerVisual(m),o.registerProcessor(v("themeRiver"))}),Hxt=xt((o,f)=>{var m=Wi(),v=Jg(),y=M0e(),x=uB(),C=x.wrapTreePathInfo,w=v.extend({type:"series.sunburst",_viewRoot:null,getInitialData:function(E,T){var S={name:E.name,children:E.data};A(S);var M=E.levels||[],I={};return I.levels=M,y.createTree(S,this,I).data},optionUpdated:function(){this.resetViewRoot()},getDataParams:function(E){var T=v.prototype.getDataParams.apply(this,arguments),S=this.getData().tree.getNodeByDataIndex(E);return T.treePathInfo=C(S,this),T},defaultOption:{zlevel:0,z:2,center:["50%","50%"],radius:[0,"75%"],clockwise:!0,startAngle:90,minAngle:0,percentPrecision:2,stillShowZeroSum:!0,highlightPolicy:"descendant",nodeClick:"rootToNode",renderLabelForZeroData:!1,label:{rotate:"radial",show:!0,opacity:1,align:"center",position:"inside",distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:"white",borderType:"solid",shadowBlur:0,shadowColor:"rgba(0, 0, 0, 0.2)",shadowOffsetX:0,shadowOffsetY:0,opacity:1},highlight:{itemStyle:{opacity:1}},downplay:{itemStyle:{opacity:.5},label:{opacity:.6}},animationType:"expansion",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicOut",data:[],levels:[],sort:"desc"},getViewRoot:function(){return this._viewRoot},resetViewRoot:function(E){E?this._viewRoot=E:E=this._viewRoot;var T=this.getRawData().tree.root;(!E||E!==T&&!T.contains(E))&&(this._viewRoot=T)}});function A(E){var T=0;m.each(E.children,function(M){A(M);var I=M.value;m.isArray(I)&&(I=I[0]),T+=I});var S=E.value;m.isArray(S)&&(S=S[0]),(S==null||isNaN(S))&&(S=T),S<0&&(S=0),m.isArray(E.value)?E.value[0]=S:E.value=S}f.exports=w}),Uxt=xt((o,f)=>{var m=Wi(),v=xa(),y={NONE:"none",DESCENDANT:"descendant",ANCESTOR:"ancestor",SELF:"self"},x=2,C=4;function w(P,D,L){v.Group.call(this);var R=new v.Sector({z2:x});R.seriesIndex=D.seriesIndex;var O=new v.Text({z2:C,silent:P.getModel("label").get("silent")});this.add(R),this.add(O),this.updateData(!0,P,"normal",D,L);function F(){O.ignore=O.hoverIgnore}function k(){O.ignore=O.normalIgnore}this.on("emphasis",F).on("normal",k).on("mouseover",F).on("mouseout",k)}var A=w.prototype;A.updateData=function(P,D,L,R,O){this.node=D,D.piece=this,R=R||this._seriesModel,O=O||this._ecModel;var F=this.childAt(0);F.dataIndex=D.dataIndex;var k=D.getModel(),U=D.getLayout(),G=m.extend({},U);G.label=null;var j=T(D,R,O);I(D,R,j);var q=k.getModel("itemStyle").getItemStyle(),J;if(L==="normal")J=q;else{var X=k.getModel(L+".itemStyle").getItemStyle();J=m.merge(X,q)}J=m.defaults({lineJoin:"bevel",fill:J.fill||j},J),P?(F.setShape(G),F.shape.r=U.r0,v.updateProps(F,{shape:{r:U.r}},R,D.dataIndex),F.useStyle(J)):typeof J.fill=="object"&&J.fill.type||typeof F.style.fill=="object"&&F.style.fill.type?(v.updateProps(F,{shape:G},R),F.useStyle(J)):v.updateProps(F,{shape:G,style:J},R),this._updateLabel(R,j,L);var Y=k.getShallow("cursor");if(Y&&F.attr("cursor",Y),P){var Q=R.getShallow("highlightPolicy");this._initEvents(F,D,R,Q)}this._seriesModel=R||this._seriesModel,this._ecModel=O||this._ecModel,v.setHoverStyle(this)},A.onEmphasis=function(P){var D=this;this.node.hostTree.root.eachNode(function(L){L.piece&&(D.node===L?L.piece.updateData(!1,L,"emphasis"):M(L,D.node,P)?L.piece.childAt(0).trigger("highlight"):P!==y.NONE&&L.piece.childAt(0).trigger("downplay"))})},A.onNormal=function(){this.node.hostTree.root.eachNode(function(P){P.piece&&P.piece.updateData(!1,P,"normal")})},A.onHighlight=function(){this.updateData(!1,this.node,"highlight")},A.onDownplay=function(){this.updateData(!1,this.node,"downplay")},A._updateLabel=function(P,D,L){var R=this.node.getModel(),O=R.getModel("label"),F=L==="normal"||L==="emphasis"?O:R.getModel(L+".label"),k=R.getModel("emphasis.label"),U=m.retrieve(P.getFormattedLabel(this.node.dataIndex,L,null,null,"label"),this.node.name);fe("show")===!1&&(U="");var G=this.node.getLayout(),j=F.get("minAngle");j==null&&(j=O.get("minAngle")),j=j/180*Math.PI;var q=G.endAngle-G.startAngle;j!=null&&Math.abs(q)Math.PI/2?"right":"left"):!re||re==="center"?(ee=(G.r+G.r0)/2,re="center"):re==="left"?(ee=G.r0+ie,X>Math.PI/2&&(re="right")):re==="right"&&(ee=G.r-ie,X>Math.PI/2&&(re="left")),J.attr("style",{text:U,textAlign:re,textVerticalAlign:fe("verticalAlign")||"middle",opacity:fe("opacity")});var ne=ee*Y+G.cx,oe=ee*Q+G.cy;J.attr("position",[ne,oe]);var se=fe("rotate"),ae=0;se==="radial"?(ae=-X,ae<-Math.PI/2&&(ae+=Math.PI)):se==="tangential"?(ae=Math.PI/2-X,ae>Math.PI/2?ae-=Math.PI:ae<-Math.PI/2&&(ae+=Math.PI)):typeof se=="number"&&(ae=se*Math.PI/180),J.attr("rotation",ae);function fe(de){var ve=F.get(de);return ve??O.get(de)}},A._initEvents=function(P,D,L,R){P.off("mouseover").off("mouseout").off("emphasis").off("normal");var O=this,F=function(){O.onEmphasis(R)},k=function(){O.onNormal()},U=function(){O.onDownplay()},G=function(){O.onHighlight()};L.isAnimationEnabled()&&P.on("mouseover",F).on("mouseout",k).on("emphasis",F).on("normal",k).on("downplay",U).on("highlight",G)},m.inherits(w,v.Group);var E=w;function T(P,D,L){var R=P.getVisual("color"),O=P.getVisual("visualMeta");(!O||O.length===0)&&(R=null);var F=P.getModel("itemStyle").get("color");if(F)return F;if(R)return R;if(P.depth===0)return L.option.color[0];var k=L.option.color.length;return F=L.option.color[S(P)%k],F}function S(P){for(var D=P;D.depth>1;)D=D.parentNode;var L=P.getAncestors()[0];return m.indexOf(L.children,D)}function M(P,D,L){return L===y.NONE?!1:L===y.SELF?P===D:L===y.ANCESTOR?P===D||P.isAncestorOf(D):P===D||P.isDescendantOf(D)}function I(P,D,L){var R=D.getData();R.setItemVisual(P.dataIndex,"color",L)}f.exports=E}),Gxt=xt((o,f)=>{var m=Wi(),v=V2(),y=Uxt(),x=aB(),C=fd(),w=C.windowOpen,A="sunburstRootToNode",E=v.extend({type:"sunburst",init:function(){},render:function(S,M,I,P){var D=this;this.seriesModel=S,this.api=I,this.ecModel=M;var L=S.getData(),R=L.tree.root,O=S.getViewRoot(),F=this.group,k=S.get("renderLabelForZeroData"),U=[];O.eachNode(function(ee){U.push(ee)});var G=this._oldChildren||[];if(J(U,G),Q(R,O),P&&P.highlight&&P.highlight.piece){var j=S.getShallow("highlightPolicy");P.highlight.piece.onEmphasis(j)}else if(P&&P.unhighlight){var q=this.virtualPiece;!q&&R.children.length&&(q=R.children[0].piece),q&&q.onNormal()}this._initEvents(),this._oldChildren=U;function J(ee,z){if(ee.length===0&&z.length===0)return;new x(z,ee,ie,ie).add(re).update(re).remove(m.curry(re,null)).execute();function ie(ne){return ne.getId()}function re(ne,oe){var se=ne==null?null:ee[ne],ae=oe==null?null:z[oe];X(se,ae)}}function X(ee,z){if(!k&&ee&&!ee.getValue()&&(ee=null),ee!==R&&z!==R){if(z&&z.piece)ee?(z.piece.updateData(!1,ee,"normal",S,M),L.setItemGraphicEl(ee.dataIndex,z.piece)):Y(z);else if(ee){var ie=new y(ee,S,M);F.add(ie),L.setItemGraphicEl(ee.dataIndex,ie)}}}function Y(ee){ee&&ee.piece&&(F.remove(ee.piece),ee.piece=null)}function Q(ee,z){if(z.depth>0){D.virtualPiece?D.virtualPiece.updateData(!1,ee,"normal",S,M):(D.virtualPiece=new y(ee,S,M),F.add(D.virtualPiece)),z.piece._onclickEvent&&z.piece.off("click",z.piece._onclickEvent);var ie=function(re){D._rootToNode(z.parentNode)};z.piece._onclickEvent=ie,D.virtualPiece.on("click",ie)}else D.virtualPiece&&(F.remove(D.virtualPiece),D.virtualPiece=null)}},dispose:function(){},_initEvents:function(){var S=this,M=function(I){var P=!1,D=S.seriesModel.getViewRoot();D.eachNode(function(L){if(!P&&L.piece&&L.piece.childAt(0)===I.target){var R=L.getModel().get("nodeClick");if(R==="rootToNode")S._rootToNode(L);else if(R==="link"){var O=L.getModel(),F=O.get("link");if(F){var k=O.get("target",!0)||"_blank";w(F,k)}}P=!0}})};this.group._onclickEvent&&this.group.off("click",this.group._onclickEvent),this.group.on("click",M),this.group._onclickEvent=M},_rootToNode:function(S){S!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:A,from:this.uid,seriesId:this.seriesModel.id,targetNode:S})},containPoint:function(S,M){var I=M.getData(),P=I.getItemLayout(0);if(P){var D=S[0]-P.cx,L=S[1]-P.cy,R=Math.sqrt(D*D+L*L);return R<=P.r&&R>=P.r0}}}),T=E;f.exports=T}),Wxt=xt(()=>{var o=fo(),f=uB(),m="sunburstRootToNode";o.registerAction({type:m,update:"updateView"},function(x,C){C.eachComponent({mainType:"series",subType:"sunburst",query:x},w);function w(A,E){var T=f.retrieveTargetInfo(x,[m],A);if(T){var S=A.getViewRoot();S&&(x.direction=f.aboveViewRoot(S,T.node)?"rollUp":"drillDown"),A.resetViewRoot(T.node)}}});var v="sunburstHighlight";o.registerAction({type:v,update:"updateView"},function(x,C){C.eachComponent({mainType:"series",subType:"sunburst",query:x},w);function w(A,E){var T=f.retrieveTargetInfo(x,[v],A);T&&(x.highlight=T.node)}});var y="sunburstUnhighlight";o.registerAction({type:y,update:"updateView"},function(x,C){C.eachComponent({mainType:"series",subType:"sunburst",query:x},w);function w(A,E){x.unhighlight=!0}})}),jxt=xt((o,f)=>{var m=il(),v=m.parsePercent,y=Wi(),x=Math.PI/180;function C(E,T,S,M){T.eachSeriesByType(E,function(I){var P=I.get("center"),D=I.get("radius");y.isArray(D)||(D=[0,D]),y.isArray(P)||(P=[P,P]);var L=S.getWidth(),R=S.getHeight(),O=Math.min(L,R),F=v(P[0],L),k=v(P[1],R),U=v(D[0],O/2),G=v(D[1],O/2),j=-I.get("startAngle")*x,q=I.get("minAngle")*x,J=I.getData().tree.root,X=I.getViewRoot(),Y=X.depth,Q=I.get("sort");Q!=null&&w(X,Q);var ee=0;y.each(X.children,function(he){!isNaN(he.getValue())&&ee++});var z=X.getValue(),ie=Math.PI/(z||ee)*2,re=X.depth>0,ne=X.height-(re?-1:1),oe=(G-U)/(ne||1),se=I.get("clockwise"),ae=I.get("stillShowZeroSum"),fe=se?1:-1,de=function(he,Ce){if(he){var Se=Ce;if(he!==J){var De=he.getValue(),Oe=z===0&&ae?ie:De*ie;Oe{var o=fo(),f=Wi();Hxt(),Gxt(),Wxt();var m=Die(),v=jxt(),y=Jj();o.registerVisual(f.curry(m,"sunburst")),o.registerLayout(f.curry(v,"sunburst")),o.registerProcessor(f.curry(y,"sunburst"))}),qxt=xt((o,f)=>{var m=Wi();function v(x,C){return C=C||[0,0],m.map(["x","y"],function(w,A){var E=this.getAxis(w),T=C[A],S=x[A]/2;return E.type==="category"?E.getBandWidth():Math.abs(E.dataToCoord(T-S)-E.dataToCoord(T+S))},this)}function y(x){var C=x.grid.getRect();return{coordSys:{type:"cartesian2d",x:C.x,y:C.y,width:C.width,height:C.height},api:{coord:function(w){return x.dataToPoint(w)},size:m.bind(v,x)}}}f.exports=y}),Xxt=xt((o,f)=>{var m=Wi();function v(x,C){return C=C||[0,0],m.map([0,1],function(w){var A=C[w],E=x[w]/2,T=[],S=[];return T[w]=A-E,S[w]=A+E,T[1-w]=S[1-w]=C[1-w],Math.abs(this.dataToPoint(T)[w]-this.dataToPoint(S)[w])},this)}function y(x){var C=x.getBoundingRect();return{coordSys:{type:"geo",x:C.x,y:C.y,width:C.width,height:C.height,zoom:x.getZoom()},api:{coord:function(w){return x.dataToPoint(w)},size:m.bind(v,x)}}}f.exports=y}),Jxt=xt((o,f)=>{var m=Wi();function v(x,C){var w=this.getAxis(),A=C instanceof Array?C[0]:C,E=(x instanceof Array?x[0]:x)/2;return w.type==="category"?w.getBandWidth():Math.abs(w.dataToCoord(A-E)-w.dataToCoord(A+E))}function y(x){var C=x.getRect();return{coordSys:{type:"singleAxis",x:C.x,y:C.y,width:C.width,height:C.height},api:{coord:function(w){return x.dataToPoint(w)},size:m.bind(v,x)}}}f.exports=y}),Kxt=xt((o,f)=>{var m=Wi();function v(x,C){return m.map(["Radius","Angle"],function(w,A){var E=this["get"+w+"Axis"](),T=C[A],S=x[A]/2,M="dataTo"+w,I=E.type==="category"?E.getBandWidth():Math.abs(E[M](T-S)-E[M](T+S));return w==="Angle"&&(I=I*Math.PI/180),I},this)}function y(x){var C=x.getRadiusAxis(),w=x.getAngleAxis(),A=C.getExtent();return A[0]>A[1]&&A.reverse(),{coordSys:{type:"polar",cx:x.cx,cy:x.cy,r:A[1],r0:A[0]},api:{coord:m.bind(function(E){var T=C.dataToRadius(E[0]),S=w.dataToAngle(E[1]),M=x.coordToPoint([T,S]);return M.push(T,S*Math.PI/180),M}),size:m.bind(v,x)}}}f.exports=y}),Qxt=xt((o,f)=>{function m(v){var y=v.getRect(),x=v.getRangeInfo();return{coordSys:{type:"calendar",x:y.x,y:y.y,width:y.width,height:y.height,cellWidth:v.getCellWidth(),cellHeight:v.getCellHeight(),rangeInfo:{start:x.start,end:x.end,weeks:x.weeks,dayCount:x.allDay}},api:{coord:function(C,w){return v.dataToPoint(C,w)}}}}f.exports=m}),Zxt=xt(()=>{var o=Ac(),f=o.__DEV__,m=Wi(),v=xa(),y=w0e(),x=y.getDefaultLabel,C=zM(),w=Sie(),A=w.getLayoutOnAxis,E=aB(),T=Jg(),S=Sm(),M=V2(),I=jj(),P=I.createClipPath,D=qxt(),L=Xxt(),R=Jxt(),O=Kxt(),F=Qxt(),k=v.CACHED_LABEL_STYLE_PROPERTIES,U=["itemStyle"],G=["emphasis","itemStyle"],j=["label"],q=["emphasis","label"],J="e\0\0",X={cartesian2d:D,geo:L,singleAxis:R,polar:O,calendar:F};T.extend({type:"series.custom",dependencies:["grid","polar","geo","singleAxis","calendar"],defaultOption:{coordinateSystem:"cartesian2d",zlevel:0,z:2,legendHoverLink:!0,useTransform:!0,clip:!1},getInitialData:function(Se,De){return C(this.getSource(),this)},getDataParams:function(Se,De,Oe){var Ue=T.prototype.getDataParams.apply(this,arguments);return Oe&&(Ue.info=Oe.info),Ue}}),M.extend({type:"custom",_data:null,render:function(Se,De,Oe,Ue){var Xe=this._data,it=Se.getData(),ut=this.group,at=z(Se,it,De,Oe);it.diff(Xe).add(function(Qe){re(null,Qe,at(Qe,Ue),Se,ut,it)}).update(function(Qe,ft){var Ot=Xe.getItemGraphicEl(ft);re(Ot,Qe,at(Qe,Ue),Se,ut,it)}).remove(function(Qe){var ft=Xe.getItemGraphicEl(Qe);ft&&ut.remove(ft)}).execute();var Pt=Se.get("clip",!0)?P(Se.coordinateSystem,!1,Se):null;Pt?ut.setClipPath(Pt):ut.removeClipPath(),this._data=it},incrementalPrepareRender:function(Se,De,Oe){this.group.removeAll(),this._data=null},incrementalRender:function(Se,De,Oe,Ue,Xe){var it=De.getData(),ut=z(De,it,Oe,Ue);function at(ft){ft.isGroup||(ft.incremental=!0,ft.useHoverLayer=!0)}for(var Pt=Se.start;Pt{qj(),DGe(),Qj()}),eCt=xt((o,f)=>{var m=Wi(),v=il(),y=v.parsePercent,x=z2(),C=x.isDimensionStacked;function w(M){return M.get("stack")||"__ec_stack_"+M.seriesIndex}function A(M,I){return I.dim+M.model.componentIndex}function E(M,I,P){var D={},L=T(m.filter(I.getSeriesByType(M),function(R){return!I.isSeriesFiltered(R)&&R.coordinateSystem&&R.coordinateSystem.type==="polar"}));I.eachSeriesByType(M,function(R){if(R.coordinateSystem.type==="polar"){var O=R.getData(),F=R.coordinateSystem,k=F.getBaseAxis(),U=A(F,k),G=w(R),j=L[U][G],q=j.offset,J=j.width,X=F.getOtherAxis(k),Y=R.coordinateSystem.cx,Q=R.coordinateSystem.cy,ee=R.get("barMinHeight")||0,z=R.get("barMinAngle")||0;D[G]=D[G]||[];for(var ie=O.mapDimension(X.dim),re=O.mapDimension(k.dim),ne=C(O,ie),oe=k.dim!=="radius"||!R.get("roundCap",!0),se=X.getExtent()[0],ae=0,fe=O.count();ae=0?"p":"n",ce=se;ne&&(D[G][ve]||(D[G][ve]={p:se,n:se}),ce=D[G][ve][pe]);var he,Ce,Se,De;if(X.dim==="radius"){var Oe=X.dataToRadius(de)-se,Ue=k.dataToAngle(ve);Math.abs(Oe){var m=Wi(),v=K3();function y(C,w){v.call(this,"radius",C,w),this.type="category"}y.prototype={constructor:y,pointToData:function(C,w){return this.polar.pointToData(C,w)[this.dim==="radius"?0:1]},dataToRadius:v.prototype.dataToCoord,radiusToData:v.prototype.coordToData},m.inherits(y,v);var x=y;f.exports=x}),iCt=xt((o,f)=>{var m=Wi(),v=nb(),y=K3(),x=vu(),C=x.makeInner,w=C();function A(T,S){S=S||[0,360],y.call(this,"angle",T,S),this.type="category"}A.prototype={constructor:A,pointToData:function(T,S){return this.polar.pointToData(T,S)[this.dim==="radius"?0:1]},dataToAngle:y.prototype.dataToCoord,angleToData:y.prototype.coordToData,calculateCategoryInterval:function(){var T=this,S=T.getLabelModel(),M=T.scale,I=M.getExtent(),P=M.count();if(I[1]-I[0]<1)return 0;var D=I[0],L=T.dataToCoord(D+1)-T.dataToCoord(D),R=Math.abs(L),O=v.getBoundingRect(D,S.getFont(),"center","top"),F=Math.max(O.height,7),k=F/R;isNaN(k)&&(k=1/0);var U=Math.max(0,Math.floor(k)),G=w(T.model),j=G.lastAutoInterval,q=G.lastTickCount;return j!=null&&q!=null&&Math.abs(j-U)<=1&&Math.abs(q-P)<=1&&j>U?U=j:(G.lastTickCount=P,G.lastAutoInterval=U),U}},m.inherits(A,y);var E=A;f.exports=E}),rCt=xt((o,f)=>{var m=tCt(),v=iCt(),y=function(C){this.name=C||"",this.cx=0,this.cy=0,this._radiusAxis=new m,this._angleAxis=new v,this._radiusAxis.polar=this._angleAxis.polar=this};y.prototype={type:"polar",axisPointerEnabled:!0,constructor:y,dimensions:["radius","angle"],model:null,containPoint:function(C){var w=this.pointToCoord(C);return this._radiusAxis.contain(w[0])&&this._angleAxis.contain(w[1])},containData:function(C){return this._radiusAxis.containData(C[0])&&this._angleAxis.containData(C[1])},getAxis:function(C){return this["_"+C+"Axis"]},getAxes:function(){return[this._radiusAxis,this._angleAxis]},getAxesByScale:function(C){var w=[],A=this._angleAxis,E=this._radiusAxis;return A.scale.type===C&&w.push(A),E.scale.type===C&&w.push(E),w},getAngleAxis:function(){return this._angleAxis},getRadiusAxis:function(){return this._radiusAxis},getOtherAxis:function(C){var w=this._angleAxis;return C===w?this._radiusAxis:w},getBaseAxis:function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAngleAxis()},getTooltipAxes:function(C){var w=C!=null&&C!=="auto"?this.getAxis(C):this.getBaseAxis();return{baseAxes:[w],otherAxes:[this.getOtherAxis(w)]}},dataToPoint:function(C,w){return this.coordToPoint([this._radiusAxis.dataToRadius(C[0],w),this._angleAxis.dataToAngle(C[1],w)])},pointToData:function(C,w){var A=this.pointToCoord(C);return[this._radiusAxis.radiusToData(A[0],w),this._angleAxis.angleToData(A[1],w)]},pointToCoord:function(C){var w=C[0]-this.cx,A=C[1]-this.cy,E=this.getAngleAxis(),T=E.getExtent(),S=Math.min(T[0],T[1]),M=Math.max(T[0],T[1]);E.inverse?S=M-360:M=S+360;var I=Math.sqrt(w*w+A*A);w/=I,A/=I;for(var P=Math.atan2(-A,w)/Math.PI*180,D=PM;)P+=D*360;return[I,P]},coordToPoint:function(C){var w=C[0],A=C[1]/180*Math.PI,E=Math.cos(A)*w+this.cx,T=-Math.sin(A)*w+this.cy;return[E,T]},getArea:function(){var C=this.getAngleAxis(),w=this.getRadiusAxis(),A=w.getExtent().slice();A[0]>A[1]&&A.reverse();var E=C.getExtent(),T=Math.PI/180;return{cx:this.cx,cy:this.cy,r0:A[0],r:A[1],startAngle:-E[0]*T,endAngle:-E[1]*T,clockwise:C.inverse,contain:function(S,M){var I=S-this.cx,P=M-this.cy,D=I*I+P*P,L=this.r,R=this.r0;return D<=L*L&&D>=R*R}}}};var x=y;f.exports=x}),nCt=xt(()=>{var o=Wi(),f=Xg(),m=Iie(),v=lU(),y=f.extend({type:"polarAxis",axis:null,getCoordSysModel:function(){return this.ecModel.queryComponents({mainType:"polar",index:this.option.polarIndex,id:this.option.polarId})[0]}});o.merge(y.prototype,v);var x={angle:{startAngle:90,clockwise:!0,splitNumber:12,axisLabel:{rotate:!1}},radius:{splitNumber:5}};function C(w,A){return A.type||(A.data?"category":"value")}m("angle",y,C,x.angle),m("radius",y,C,x.radius)}),oCt=xt((o,f)=>{var m=fo();nCt();var v=m.extendComponentModel({type:"polar",dependencies:["polarAxis","angleAxis"],coordinateSystem:null,findAxisModel:function(y){var x,C=this.ecModel;return C.eachComponent(y,function(w){w.getCoordSysModel()===this&&(x=w)},this),x},defaultOption:{zlevel:0,z:0,center:["50%","50%"],radius:"80%"}});f.exports=v}),F0e=xt(()=>{var o=Ac(),f=o.__DEV__,m=Wi(),v=rCt(),y=il(),x=y.parsePercent,C=sT(),w=C.createScaleByModel,A=C.niceScaleExtent,E=aT(),T=z2(),S=T.getStackedDimension;oCt();function M(L,R,O){var F=R.get("center"),k=O.getWidth(),U=O.getHeight();L.cx=x(F[0],k),L.cy=x(F[1],U);var G=L.getRadiusAxis(),j=Math.min(k,U)/2,q=R.get("radius");q==null?q=[0,"100%"]:m.isArray(q)||(q=[0,q]),q=[x(q[0],j),x(q[1],j)],G.inverse?G.setExtent(q[1],q[0]):G.setExtent(q[0],q[1])}function I(L,R){var O=this,F=O.getAngleAxis(),k=O.getRadiusAxis();if(F.scale.setExtent(1/0,-1/0),k.scale.setExtent(1/0,-1/0),L.eachSeries(function(j){if(j.coordinateSystem===O){var q=j.getData();m.each(q.mapDimension("radius",!0),function(J){k.scale.unionExtentFromData(q,S(q,J))}),m.each(q.mapDimension("angle",!0),function(J){F.scale.unionExtentFromData(q,S(q,J))})}}),A(F.scale,F.model),A(k.scale,k.model),F.type==="category"&&!F.onBand){var U=F.getExtent(),G=360/F.scale.count();F.inverse?U[1]+=G:U[1]-=G,F.setExtent(U[0],U[1])}}function P(L,R){if(L.type=R.get("type"),L.scale=w(R),L.onBand=R.get("boundaryGap")&&L.type==="category",L.inverse=R.get("inverse"),R.mainType==="angleAxis"){L.inverse^=R.get("clockwise");var O=R.get("startAngle");L.setExtent(O,O+(L.inverse?-360:360))}R.axis=L,L.model=R}var D={dimensions:v.prototype.dimensions,create:function(L,R){var O=[];return L.eachComponent("polar",function(F,k){var U=new v(k);U.update=I;var G=U.getRadiusAxis(),j=U.getAngleAxis(),q=F.findAxisModel("radiusAxis"),J=F.findAxisModel("angleAxis");P(G,q),P(j,J),M(U,F,R),O.push(U),F.coordinateSystem=U,U.model=F}),L.eachSeries(function(F){if(F.get("coordinateSystem")==="polar"){var k=L.queryComponents({mainType:"polar",index:F.get("polarIndex"),id:F.get("polarId")})[0];F.coordinateSystem=k.coordinateSystem}}),O}};E.register("polar",D)}),aCt=xt((o,f)=>{var m=Wi(),v=xa(),y=Sm(),x=lB(),C=Q3(),w=["axisLine","axisLabel","axisTick","minorTick","splitLine","minorSplitLine","splitArea"];function A(M,I,P){I[1]>I[0]&&(I=I.slice().reverse());var D=M.coordToPoint([I[0],P]),L=M.coordToPoint([I[1],P]);return{x1:D[0],y1:D[1],x2:L[0],y2:L[1]}}function E(M){var I=M.getRadiusAxis();return I.inverse?0:1}function T(M){var I=M[0],P=M[M.length-1];I&&P&&Math.abs(Math.abs(I.coord-P.coord)-360)<1e-4&&M.pop()}var S=x.extend({type:"angleAxis",axisPointerClass:"PolarAxisPointer",render:function(M,I){if(this.group.removeAll(),!!M.get("show")){var P=M.axis,D=P.polar,L=D.getRadiusAxis().getExtent(),R=P.getTicksCoords(),O=P.getMinorTicksCoords(),F=m.map(P.getViewLabels(),function(U){var U=m.clone(U);return U.coord=P.dataToCoord(U.tickValue),U});T(F),T(R),m.each(w,function(k){M.get(k+".show")&&(!P.scale.isBlank()||k==="axisLine")&&this["_"+k](M,D,R,O,L,F)},this)}},_axisLine:function(M,I,P,D,L){var R=M.getModel("axisLine.lineStyle"),O=E(I),F=O?0:1,k;L[F]===0?k=new v.Circle({shape:{cx:I.cx,cy:I.cy,r:L[O]},style:R.getLineStyle(),z2:1,silent:!0}):k=new v.Ring({shape:{cx:I.cx,cy:I.cy,r:L[O],r0:L[F]},style:R.getLineStyle(),z2:1,silent:!0}),k.style.fill=null,this.group.add(k)},_axisTick:function(M,I,P,D,L){var R=M.getModel("axisTick"),O=(R.get("inside")?-1:1)*R.get("length"),F=L[E(I)],k=m.map(P,function(U){return new v.Line({shape:A(I,[F,F+O],U.coord)})});this.group.add(v.mergePath(k,{style:m.defaults(R.getModel("lineStyle").getLineStyle(),{stroke:M.get("axisLine.lineStyle.color")})}))},_minorTick:function(M,I,P,D,L){if(D.length){for(var R=M.getModel("axisTick"),O=M.getModel("minorTick"),F=(R.get("inside")?-1:1)*O.get("length"),k=L[E(I)],U=[],G=0;GQ?"left":"right",ie=Math.abs(Y[1]-ee)/X<.3?"middle":Y[1]>ee?"top":"bottom";O&&O[J]&&O[J].textStyle&&(q=new y(O[J].textStyle,F,F.ecModel));var re=new v.Text({silent:C.isLabelSilent(M)});this.group.add(re),v.setTextStyle(re.style,q,{x:Y[0],y:Y[1],textFill:q.getTextColor()||M.get("axisLine.lineStyle.color"),text:G.formattedLabel,textAlign:z,textVerticalAlign:ie}),U&&(re.eventData=C.makeAxisEventDataBase(M),re.eventData.targetType="axisLabel",re.eventData.value=G.rawLabel)},this)},_splitLine:function(M,I,P,D,L){var R=M.getModel("splitLine"),O=R.getModel("lineStyle"),F=O.get("color"),k=0;F=F instanceof Array?F:[F];for(var U=[],G=0;G{F0e(),aCt()}),lCt=xt((o,f)=>{var m=Wi(),v=xa(),y=Q3(),x=lB(),C=["axisLine","axisTickLabel","axisName"],w=["splitLine","splitArea","minorSplitLine"],A=x.extend({type:"radiusAxis",axisPointerClass:"PolarAxisPointer",render:function(T,S){if(this.group.removeAll(),!!T.get("show")){var M=T.axis,I=M.polar,P=I.getAngleAxis(),D=M.getTicksCoords(),L=M.getMinorTicksCoords(),R=P.getExtent()[0],O=M.getExtent(),F=E(I,T,R),k=new y(T,F);m.each(C,k.add,k),this.group.add(k.getGroup()),m.each(w,function(U){T.get(U+".show")&&!M.scale.isBlank()&&this["_"+U](T,I,R,O,D,L)},this)}},_splitLine:function(T,S,M,I,P){var D=T.getModel("splitLine"),L=D.getModel("lineStyle"),R=L.get("color"),O=0;R=R instanceof Array?R:[R];for(var F=[],k=0;k{F0e(),lCt()}),cCt=xt((o,f)=>{var m=fd(),v=N0e(),y=xa(),x=Oie(),C=Ky(),w=Q3(),A=lB(),E=v.extend({makeElOption:function(I,P,D,L,R){var O=D.axis;O.dim==="angle"&&(this.animationThreshold=Math.PI/18);var F=O.polar,k=F.getOtherAxis(O),U=k.getExtent(),G;G=O["dataTo"+m.capitalFirst(O.dim)](P);var j=L.get("type");if(j&&j!=="none"){var q=x.buildElStyle(L),J=S[j](O,F,G,U,q);J.style=q,I.graphicKey=J.type,I.pointer=J}var X=L.get("label.margin"),Y=T(P,D,L,F,X);x.buildLabelElOption(I,D,L,R,Y)}});function T(I,P,D,L,R){var O=P.axis,F=O.dataToCoord(I),k=L.getAngleAxis().getExtent()[0];k=k/180*Math.PI;var U=L.getRadiusAxis().getExtent(),G,j,q;if(O.dim==="radius"){var J=C.create();C.rotate(J,J,k),C.translate(J,J,[L.cx,L.cy]),G=y.applyTransform([F,-R],J);var X=P.getModel("axisLabel").get("rotate")||0,Y=w.innerTextLayout(k,X*Math.PI/180,-1);j=Y.textAlign,q=Y.textVerticalAlign}else{var Q=U[1];G=L.coordToPoint([Q+R,F]);var ee=L.cx,z=L.cy;j=Math.abs(G[0]-ee)/Q<.3?"center":G[0]>ee?"left":"right",q=Math.abs(G[1]-z)/Q<.3?"middle":G[1]>z?"top":"bottom"}return{position:G,align:j,verticalAlign:q}}var S={line:function(I,P,D,L,R){return I.dim==="angle"?{type:"Line",shape:x.makeLineShape(P.coordToPoint([L[0],D]),P.coordToPoint([L[1],D]))}:{type:"Circle",shape:{cx:P.cx,cy:P.cy,r:D}}},shadow:function(I,P,D,L,R){var O=Math.max(1,I.getBandWidth()),F=Math.PI/180;return I.dim==="angle"?{type:"Sector",shape:x.makeSectorShape(P.cx,P.cy,L[0],L[1],(-D-O/2)*F,(-D+O/2)*F)}:{type:"Sector",shape:x.makeSectorShape(P.cx,P.cy,D-O/2,D+O/2,0,Math.PI*2)}}};A.registerAxisPointerClass("PolarAxisPointer",E);var M=E;f.exports=M}),hCt=xt(()=>{var o=fo(),f=Wi(),m=eCt();F0e(),sCt(),uCt(),Qj(),cCt(),o.registerLayout(f.curry(m,"bar")),o.extendComponentView({type:"polar"})}),dCt=xt((o,f)=>{var m=Wi(),v=vu(),y=Xg(),x=Sm(),C=E0e(),w=I0e(),A=y.extend({type:"geo",coordinateSystem:null,layoutMode:"box",init:function(T){y.prototype.init.apply(this,arguments),v.defaultEmphasis(T,"label",["show"])},optionUpdated:function(){var T=this.option,S=this;T.regions=w.getFilledRegions(T.regions,T.map,T.nameMap),this._optionModelMap=m.reduce(T.regions||[],function(M,I){return I.name&&M.set(I.name,new x(I,S)),M},m.createHashMap()),this.updateSelectedMap(T.regions)},defaultOption:{zlevel:0,z:0,show:!0,left:"center",top:"center",aspectScale:null,silent:!1,map:"",boundingCoords:null,center:null,zoom:1,scaleLimit:null,label:{show:!1,color:"#000"},itemStyle:{borderWidth:.5,borderColor:"#444",color:"#eee"},emphasis:{label:{show:!0,color:"rgb(100,0,0)"},itemStyle:{color:"rgba(255,215,0,0.8)"}},regions:[]},getRegionModel:function(T){return this._optionModelMap.get(T)||new x(null,this,this.ecModel)},getFormattedLabel:function(T,S){var M=this.getRegionModel(T),I=M.get("label"+(S==="normal"?".":S+".")+"formatter"),P={name:T};if(typeof I=="function")return P.status=S,I(P);if(typeof I=="string")return I.replace("{a}",T??"")},setZoom:function(T){this.option.zoom=T},setCenter:function(T){this.option.center=T}});m.mixin(A,C);var E=A;f.exports=E}),fCt=xt((o,f)=>{var m=fGe(),v=fo(),y=v.extendComponentView({type:"geo",init:function(x,C){var w=new m(C,!0);this._mapDraw=w,this.group.add(w.group)},render:function(x,C,w,A){if(!(A&&A.type==="geoToggleSelect"&&A.from===this.uid)){var E=this._mapDraw;x.get("show")?E.draw(x,C,w,this,A):this._mapDraw.group.removeAll(),this.group.silent=x.get("silent")}},dispose:function(){this._mapDraw&&this._mapDraw.remove()}});f.exports=y}),pCt=xt(()=>{var o=fo(),f=Wi();dCt(),I0e(),fCt(),pGe();function m(v,y){y.update="updateView",o.registerAction(y,function(x,C){var w={};return C.eachComponent({mainType:"geo",query:x},function(A){A[v](x.name);var E=A.coordinateSystem;f.each(E.regions,function(T){w[T.name]=A.isSelected(T.name)||!1})}),{selected:w,name:x.name}})}m("toggleSelected",{type:"geoToggleSelect",event:"geoselectchanged"}),m("select",{type:"geoSelect",event:"geoselected"}),m("unSelect",{type:"geoUnSelect",event:"geounselected"})}),mCt=xt((o,f)=>{var m=Wi(),v=rd(),y=il(),x=aT(),C=864e5;function w(T,S,M){this._model=T}w.prototype={constructor:w,type:"calendar",dimensions:["time","value"],getDimensionsInfo:function(){return[{name:"time",type:"time"},"value"]},getRangeInfo:function(){return this._rangeInfo},getModel:function(){return this._model},getRect:function(){return this._rect},getCellWidth:function(){return this._sw},getCellHeight:function(){return this._sh},getOrient:function(){return this._orient},getFirstDayOfWeek:function(){return this._firstDayOfWeek},getDateInfo:function(T){T=y.parseDate(T);var S=T.getFullYear(),M=T.getMonth()+1;M=M<10?"0"+M:M;var I=T.getDate();I=I<10?"0"+I:I;var P=T.getDay();return P=Math.abs((P+7-this.getFirstDayOfWeek())%7),{y:S,m:M,d:I,day:P,time:T.getTime(),formatedDate:S+"-"+M+"-"+I,date:T}},getNextNDay:function(T,S){return S=S||0,S===0?this.getDateInfo(T):(T=new Date(this.getDateInfo(T).time),T.setDate(T.getDate()+S),this.getDateInfo(T))},update:function(T,S){this._firstDayOfWeek=+this._model.getModel("dayLabel").get("firstDay"),this._orient=this._model.get("orient"),this._lineWidth=this._model.getModel("itemStyle").getItemStyle().lineWidth||0,this._rangeInfo=this._getRangeInfo(this._initRangeOption());var M=this._rangeInfo.weeks||1,I=["width","height"],P=this._model.get("cellSize").slice(),D=this._model.getBoxLayoutParams(),L=this._orient==="horizontal"?[M,7]:[7,M];m.each([0,1],function(k){F(P,k)&&(D[I[k]]=P[k]*L[k])});var R={width:S.getWidth(),height:S.getHeight()},O=this._rect=v.getLayoutRect(D,R);m.each([0,1],function(k){F(P,k)||(P[k]=O[I[k]]/L[k])});function F(k,U){return k[U]!=null&&k[U]!=="auto"}this._sw=P[0],this._sh=P[1]},dataToPoint:function(T,S){m.isArray(T)&&(T=T[0]),S==null&&(S=!0);var M=this.getDateInfo(T),I=this._rangeInfo,P=M.formatedDate;if(S&&!(M.time>=I.start.time&&M.timeD.end.time&&T.reverse(),T},_getRangeInfo:function(T){T=[this.getDateInfo(T[0]),this.getDateInfo(T[1])];var S;T[0].time>T[1].time&&(S=!0,T.reverse());var M=Math.floor(T[1].time/C)-Math.floor(T[0].time/C)+1,I=new Date(T[0].time),P=I.getDate(),D=T[1].date.getDate();I.setDate(P+M-1);var L=I.getDate();if(L!==D)for(var R=I.getTime()-T[1].time>0?1:-1;(L=I.getDate())!==D&&(I.getTime()-T[1].time)*R>0;)M-=R,I.setDate(L-R);var O=Math.floor((M+T[0].day+6)/7),F=S?-O+1:O-1;return S&&T.reverse(),{range:[T[0].formatedDate,T[1].formatedDate],start:T[0],end:T[1],allDay:M,weeks:O,nthWeek:F,fweek:T[0].day,lweek:T[1].day}},_getDateByWeeksAndDay:function(T,S,M){var I=this._getRangeInfo(M);if(T>I.weeks||T===0&&SI.lweek)return!1;var P=(T-1)*7-I.fweek+S,D=new Date(I.start.time);return D.setDate(I.start.d+P),this.getDateInfo(D)}},w.dimensions=w.prototype.dimensions,w.getDimensionsInfo=w.prototype.getDimensionsInfo,w.create=function(T,S){var M=[];return T.eachComponent("calendar",function(I){var P=new w(I,T,S);M.push(P),I.coordinateSystem=P}),T.eachSeries(function(I){I.get("coordinateSystem")==="calendar"&&(I.coordinateSystem=M[I.get("calendarIndex")||0])}),M};function A(T,S,M,I){var P=M.calendarModel,D=M.seriesModel,L=P?P.coordinateSystem:D?D.coordinateSystem:null;return L===this?L[T](I):null}x.register("calendar",w);var E=w;f.exports=E}),gCt=xt((o,f)=>{var m=Wi(),v=Xg(),y=rd(),x=y.getLayoutParams,C=y.sizeCalculable,w=y.mergeLayoutParam,A=v.extend({type:"calendar",coordinateSystem:null,defaultOption:{zlevel:0,z:2,left:80,top:60,cellSize:20,orient:"horizontal",splitLine:{show:!0,lineStyle:{color:"#000",width:1,type:"solid"}},itemStyle:{color:"#fff",borderWidth:1,borderColor:"#ccc"},dayLabel:{show:!0,firstDay:0,position:"start",margin:"50%",nameMap:"en",color:"#000"},monthLabel:{show:!0,position:"start",margin:5,align:"center",nameMap:"en",formatter:null,color:"#000"},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:"#ccc",fontFamily:"sans-serif",fontWeight:"bolder",fontSize:20}},init:function(S,M,I,P){var D=x(S);A.superApply(this,"init",arguments),E(S,D)},mergeOption:function(S,M){A.superApply(this,"mergeOption",arguments),E(this.option,S)}});function E(S,M){var I=S.cellSize;m.isArray(I)?I.length===1&&(I[1]=I[0]):I=S.cellSize=[I,I];var P=m.map([0,1],function(D){return C(M,D)&&(I[D]="auto"),I[D]!=null&&I[D]!=="auto"});w(S,M,{type:"box",ignoreSize:P})}var T=A;f.exports=T}),_Ct=xt((o,f)=>{var m=fo(),v=Wi(),y=xa(),x=fd(),C=il(),w={EN:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],CN:["\u4E00\u6708","\u4E8C\u6708","\u4E09\u6708","\u56DB\u6708","\u4E94\u6708","\u516D\u6708","\u4E03\u6708","\u516B\u6708","\u4E5D\u6708","\u5341\u6708","\u5341\u4E00\u6708","\u5341\u4E8C\u6708"]},A={EN:["S","M","T","W","T","F","S"],CN:["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},E=m.extendComponentView({type:"calendar",_tlpoints:null,_blpoints:null,_firstDayOfMonth:null,_firstDayPoints:null,render:function(T,S,M){var I=this.group;I.removeAll();var P=T.coordinateSystem,D=P.getRangeInfo(),L=P.getOrient();this._renderDayRect(T,D,I),this._renderLines(T,D,L,I),this._renderYearText(T,D,L,I),this._renderMonthText(T,L,I),this._renderWeekText(T,D,L,I)},_renderDayRect:function(T,S,M){for(var I=T.coordinateSystem,P=T.getModel("itemStyle").getItemStyle(),D=I.getCellWidth(),L=I.getCellHeight(),R=S.start.time;R<=S.end.time;R=I.getNextNDay(R,1).time){var O=I.dataToRect([R],!1).tl,F=new y.Rect({shape:{x:O[0],y:O[1],width:D,height:L},cursor:"default",style:P});M.add(F)}},_renderLines:function(T,S,M,I){var P=this,D=T.coordinateSystem,L=T.getModel("splitLine.lineStyle").getLineStyle(),R=T.get("splitLine.show"),O=L.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var F=S.start,k=0;F.time<=S.end.time;k++){G(F.formatedDate),k===0&&(F=D.getDateInfo(S.start.y+"-"+S.start.m));var U=F.date;U.setMonth(U.getMonth()+1),F=D.getDateInfo(U)}G(D.getNextNDay(S.end.time,1).formatedDate);function G(j){P._firstDayOfMonth.push(D.getDateInfo(j)),P._firstDayPoints.push(D.dataToRect([j],!1).tl);var q=P._getLinePointsOfOneWeek(T,j,M);P._tlpoints.push(q[0]),P._blpoints.push(q[q.length-1]),R&&P._drawSplitline(q,L,I)}R&&this._drawSplitline(P._getEdgesPoints(P._tlpoints,O,M),L,I),R&&this._drawSplitline(P._getEdgesPoints(P._blpoints,O,M),L,I)},_getEdgesPoints:function(T,S,M){var I=[T[0].slice(),T[T.length-1].slice()],P=M==="horizontal"?0:1;return I[0][P]=I[0][P]-S/2,I[1][P]=I[1][P]+S/2,I},_drawSplitline:function(T,S,M){var I=new y.Polyline({z2:20,shape:{points:T},style:S});M.add(I)},_getLinePointsOfOneWeek:function(T,S,M){var I=T.coordinateSystem;S=I.getDateInfo(S);for(var P=[],D=0;D<7;D++){var L=I.getNextNDay(S.time,D),R=I.dataToRect([L.time],!1);P[2*L.day]=R.tl,P[2*L.day+1]=R[M==="horizontal"?"bl":"tr"]}return P},_formatterLabel:function(T,S){return typeof T=="string"&&T?x.formatTplSimple(T,S):typeof T=="function"?T(S):S.nameMap},_yearTextPositionControl:function(T,S,M,I,P){S=S.slice();var D=["center","bottom"];I==="bottom"?(S[1]+=P,D=["center","top"]):I==="left"?S[0]-=P:I==="right"?(S[0]+=P,D=["center","top"]):S[1]-=P;var L=0;return(I==="left"||I==="right")&&(L=Math.PI/2),{rotation:L,position:S,style:{textAlign:D[0],textVerticalAlign:D[1]}}},_renderYearText:function(T,S,M,I){var P=T.getModel("yearLabel");if(P.get("show")){var D=P.get("margin"),L=P.get("position");L||(L=M!=="horizontal"?"top":"left");var R=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],O=(R[0][0]+R[1][0])/2,F=(R[0][1]+R[1][1])/2,k=M==="horizontal"?0:1,U={top:[O,R[k][1]],bottom:[O,R[1-k][1]],left:[R[1-k][0],F],right:[R[k][0],F]},G=S.start.y;+S.end.y>+S.start.y&&(G=G+"-"+S.end.y);var j=P.get("formatter"),q={start:S.start.y,end:S.end.y,nameMap:G},J=this._formatterLabel(j,q),X=new y.Text({z2:30});y.setTextStyle(X.style,P,{text:J}),X.attr(this._yearTextPositionControl(X,U[L],M,L,D)),I.add(X)}},_monthTextPositionControl:function(T,S,M,I,P){var D="left",L="top",R=T[0],O=T[1];return M==="horizontal"?(O=O+P,S&&(D="center"),I==="start"&&(L="bottom")):(R=R+P,S&&(L="middle"),I==="start"&&(D="right")),{x:R,y:O,textAlign:D,textVerticalAlign:L}},_renderMonthText:function(T,S,M){var I=T.getModel("monthLabel");if(I.get("show")){var P=I.get("nameMap"),D=I.get("margin"),L=I.get("position"),R=I.get("align"),O=[this._tlpoints,this._blpoints];v.isString(P)&&(P=w[P.toUpperCase()]||[]);var F=L==="start"?0:1,k=S==="horizontal"?0:1;D=L==="start"?-D:D;for(var U=R==="center",G=0;G{mCt(),gCt(),_Ct()}),yCt=xt(()=>{var o=Ac(),f=o.__DEV__,m=fo(),v=Wi(),y=vu(),x=xa(),C=rd(),w=il(),A=w.parsePercent,E={path:null,compoundPath:null,group:x.Group,image:x.Image,text:x.Text};m.registerPreprocessor(function(F){var k=F.graphic;v.isArray(k)?!k[0]||!k[0].elements?F.graphic=[{elements:k}]:F.graphic=[F.graphic[0]]:k&&!k.elements&&(F.graphic=[{elements:[k]}])});var T=m.extendComponentModel({type:"graphic",defaultOption:{elements:[],parentId:null},_elOptionsToUpdate:null,mergeOption:function(F){var k=this.option.elements;this.option.elements=null,T.superApply(this,"mergeOption",arguments),this.option.elements=k},optionUpdated:function(F,k){var U=this.option,G=(k?U:F).elements,j=U.elements=k?[]:U.elements,q=[];this._flatten(G,q);var J=y.mappingToExists(j,q);y.makeIdAndName(J);var X=this._elOptionsToUpdate=[];v.each(J,function(Q,ee){var z=Q.option;z&&(X.push(z),D(Q,z),L(j,ee,z),R(j[ee],z))},this);for(var Y=j.length-1;Y>=0;Y--)j[Y]==null?j.splice(Y,1):delete j[Y].$action},_flatten:function(F,k,U){v.each(F,function(G){if(G){U&&(G.parentOption=U),k.push(G);var j=G.children;G.type==="group"&&j&&this._flatten(j,k,G),delete G.children}},this)},useElOptionsToUpdate:function(){var F=this._elOptionsToUpdate;return this._elOptionsToUpdate=null,F}});m.extendComponentView({type:"graphic",init:function(F,k){this._elMap=v.createHashMap(),this._lastGraphicModel},render:function(F,k,U){F!==this._lastGraphicModel&&this._clear(),this._lastGraphicModel=F,this._updateElements(F),this._relocate(F,U)},_updateElements:function(F){var k=F.useElOptionsToUpdate();if(k){var U=this._elMap,G=this.group;v.each(k,function(j){var q=j.$action,J=j.id,X=U.get(J),Y=j.parentId,Q=Y!=null?U.get(Y):G,ee=j.style;j.type==="text"&&ee&&(j.hv&&j.hv[1]&&(ee.textVerticalAlign=ee.textBaseline=null),!ee.hasOwnProperty("textFill")&&ee.fill&&(ee.textFill=ee.fill),!ee.hasOwnProperty("textStroke")&&ee.stroke&&(ee.textStroke=ee.stroke));var z=I(j);!q||q==="merge"?X?X.attr(z):S(J,Q,z,U):q==="replace"?(M(X,U),S(J,Q,z,U)):q==="remove"&&M(X,U);var ie=U.get(J);ie&&(ie.__ecGraphicWidthOption=j.width,ie.__ecGraphicHeightOption=j.height,O(ie,F,j))})}},_relocate:function(F,k){for(var U=F.option.elements,G=this.group,j=this._elMap,q=k.getWidth(),J=k.getHeight(),X=0;X=0;X--){var Y=U[X],Q=j.get(Y.id);if(Q){var ee=Q.parent,ie=ee===G?{width:q,height:J}:{width:ee.__ecGraphicWidth,height:ee.__ecGraphicHeight};C.positionElement(Q,Y,ie,null,{hv:Y.hv,boundingMode:Y.bounding})}}},_clear:function(){var F=this._elMap;F.each(function(k){M(k,F)}),this._elMap=v.createHashMap()},dispose:function(){this._clear()}});function S(F,k,U,G){var j=U.type,q=E.hasOwnProperty(j)?E[j]:x.getShapeClass(j),J=new q(U);k.add(J),G.set(F,J),J.__ecGraphicId=F}function M(F,k){var U=F&&F.parent;U&&(F.type==="group"&&F.traverse(function(G){M(G,k)}),k.removeKey(F.__ecGraphicId),U.remove(F))}function I(F){return F=v.extend({},F),v.each(["id","parentId","$action","hv","bounding"].concat(C.LOCATION_PARAMS),function(k){delete F[k]}),F}function P(F,k){var U;return v.each(k,function(G){F[G]!=null&&F[G]!=="auto"&&(U=!0)}),U}function D(F,k){var U=F.exist;if(k.id=F.keyInfo.id,!k.type&&U&&(k.type=U.type),k.parentId==null){var G=k.parentOption;G?k.parentId=G.id:U&&(k.parentId=U.parentId)}k.parentOption=null}function L(F,k,U){var G=v.extend({},U),j=F[k],q=U.$action||"merge";q==="merge"?j?(v.merge(j,G,!0),C.mergeLayoutParam(j,G,{ignoreSize:!0}),C.copyLayoutParams(U,j)):F[k]=G:q==="replace"?F[k]=G:q==="remove"&&j&&(F[k]=null)}function R(F,k){F&&(F.hv=k.hv=[P(k,["left","right"]),P(k,["top","bottom"])],F.type==="group"&&(F.width==null&&(F.width=k.width=0),F.height==null&&(F.height=k.height=0)))}function O(F,k,U){var G=F.eventData;!F.silent&&!F.ignore&&!G&&(G=F.eventData={componentType:"graphic",componentIndex:k.componentIndex,name:F.name}),G&&(G.info=F.info)}}),Z3=xt(o=>{var f={};function m(y,x){f[y]=x}function v(y){return f[y]}o.register=m,o.get=v}),xCt=xt((o,f)=>{var m=fo(),v=Wi(),y=Z3(),x=m.extendComponentModel({type:"toolbox",layoutMode:{type:"box",ignoreSize:!0},optionUpdated:function(){x.superApply(this,"optionUpdated",arguments),v.each(this.option.feature,function(w,A){var E=y.get(A);E&&v.merge(w,E.defaultOption)})},defaultOption:{show:!0,z:6,zlevel:0,orient:"horizontal",left:"right",top:"top",backgroundColor:"transparent",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:"#666",color:"none"},emphasis:{iconStyle:{borderColor:"#3E98C5"}},tooltip:{show:!1}}}),C=x;f.exports=C}),RGe=xt(o=>{var f=rd(),m=f.getLayoutRect,v=f.box,y=f.positionElement,x=fd(),C=xa();function w(E,T,S){var M=T.getBoxLayoutParams(),I=T.get("padding"),P={width:S.getWidth(),height:S.getHeight()},D=m(M,P,I);v(T.get("orient"),E,T.get("itemGap"),D.width,D.height),y(E,M,P,I)}function A(I,T){var S=x.normalizeCssArray(T.get("padding")),M=T.getItemStyle(["color","opacity"]);M.fill=T.get("backgroundColor");var I=new C.Rect({shape:{x:I.x-S[3],y:I.y-S[0],width:I.width+S[1]+S[3],height:I.height+S[0]+S[2],r:T.get("borderRadius")},style:M,silent:!0,z2:-1});return I}o.layout=w,o.makeBackground=A}),CCt=xt((o,f)=>{var m=fo(),v=Wi(),y=nb(),x=Z3(),C=xa(),w=Sm(),A=aB(),E=RGe(),T=m.extendComponentView({type:"toolbox",render:function(M,I,P,D){var L=this.group;if(L.removeAll(),!M.get("show"))return;var R=+M.get("itemSize"),O=M.get("feature")||{},F=this._features||(this._features={}),k=[];v.each(O,function(j,q){k.push(q)}),new A(this._featureNames||[],k).add(U).update(U).remove(v.curry(U,null)).execute(),this._featureNames=k;function U(j,q){var J=k[j],X=k[q],Y=O[J],Q=new w(Y,M,M.ecModel),ee;if(D&&D.newTitle!=null&&D.featureName===J&&(Y.title=D.newTitle),J&&!X){if(S(J))ee={model:Q,onclick:Q.option.onclick,featureName:J};else{var z=x.get(J);if(!z)return;ee=new z(Q,I,P)}F[J]=ee}else{if(ee=F[X],!ee)return;ee.model=Q,ee.ecModel=I,ee.api=P}if(!J&&X){ee.dispose&&ee.dispose(I,P);return}if(!Q.get("show")||ee.unusable){ee.remove&&ee.remove(I,P);return}G(Q,ee,J),Q.setIconStatus=function(ie,re){var ne=this.option,oe=this.iconPaths;ne.iconStatus=ne.iconStatus||{},ne.iconStatus[ie]=re,oe[ie]&&oe[ie].trigger(re)},ee.render&&ee.render(Q,I,P,D)}function G(j,q,J){var X=j.getModel("iconStyle"),Y=j.getModel("emphasis.iconStyle"),Q=q.getIcons?q.getIcons():j.get("icon"),ee=j.get("title")||{};if(typeof Q=="string"){var z=Q,ie=ee;Q={},ee={},Q[J]=z,ee[J]=ie}var re=j.iconPaths={};v.each(Q,function(ne,oe){var se=C.createIcon(ne,{},{x:-R/2,y:-R/2,width:R,height:R});se.setStyle(X.getItemStyle()),se.hoverStyle=Y.getItemStyle(),se.setStyle({text:ee[oe],textAlign:Y.get("textAlign"),textBorderRadius:Y.get("textBorderRadius"),textPadding:Y.get("textPadding"),textFill:null});var ae=M.getModel("tooltip");ae&&ae.get("show")&&se.attr("tooltip",v.extend({content:ee[oe],formatter:ae.get("formatter",!0)||function(){return ee[oe]},formatterParams:{componentType:"toolbox",name:oe,title:ee[oe],$vars:["name","title"]},position:ae.get("position",!0)||"bottom"},ae.option)),C.setHoverStyle(se),M.get("showTitle")&&(se.__title=ee[oe],se.on("mouseover",function(){var fe=Y.getItemStyle(),de=M.get("orient")==="vertical"?M.get("right")==null?"right":"left":M.get("bottom")==null?"bottom":"top";se.setStyle({textFill:Y.get("textFill")||fe.fill||fe.stroke||"#000",textBackgroundColor:Y.get("textBackgroundColor"),textPosition:Y.get("textPosition")||de})}).on("mouseout",function(){se.setStyle({textFill:null,textBackgroundColor:null})})),se.trigger(j.get("iconStatus."+oe)||"normal"),L.add(se),se.on("click",v.bind(q.onclick,q,I,P,oe)),re[oe]=se})}E.layout(L,M,P),L.add(E.makeBackground(L.getBoundingRect(),M)),L.eachChild(function(j){var q=j.__title,J=j.hoverStyle;if(J&&q){var X=y.getBoundingRect(q,y.makeFont(J)),Y=j.position[0]+L.position[0],Q=j.position[1]+L.position[1]+R,ee=!1;Q+X.height>P.getHeight()&&(J.textPosition="top",ee=!0);var z=ee?-5-X.height:R+8;Y+X.width/2>P.getWidth()?(J.textPosition=["100%",z],J.textAlign="right"):Y-X.width/2<0&&(J.textPosition=[0,z],J.textAlign="left")}})},updateView:function(M,I,P,D){v.each(this._features,function(L){L.updateView&&L.updateView(L.model,I,P,D)})},remove:function(M,I){v.each(this._features,function(P){P.remove&&P.remove(M,I)}),this.group.removeAll()},dispose:function(M,I){v.each(this._features,function(P){P.dispose&&P.dispose(M,I)})}});function S(M){return M.indexOf("my")===0}f.exports=T}),bCt=xt((o,f)=>{var m=Tm(),v=J3(),y=Z3(),x=v.toolbox.saveAsImage;function C(E){this.model=E}C.defaultOption={show:!0,icon:"M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0",title:x.title,type:"png",connectedBackgroundColor:"#fff",name:"",excludeComponents:["toolbox"],pixelRatio:1,lang:x.lang.slice()},C.prototype.unusable=!m.canvasSupported;var w=C.prototype;w.onclick=function(E,T){var S=this.model,M=S.get("name")||E.get("title.0.text")||"echarts",I=T.getZr().painter.getType()==="svg",P=I?"svg":S.get("type",!0)||"png",D=T.getConnectedDataURL({type:P,backgroundColor:S.get("backgroundColor",!0)||E.get("backgroundColor")||"#fff",connectedBackgroundColor:S.get("connectedBackgroundColor"),excludeComponents:S.get("excludeComponents"),pixelRatio:S.get("pixelRatio")});if(typeof MouseEvent=="function"&&!m.browser.ie&&!m.browser.edge){var L=document.createElement("a");L.download=M+"."+P,L.target="_blank",L.href=D;var R=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1});L.dispatchEvent(R)}else if(window.navigator.msSaveOrOpenBlob){for(var O=atob(D.split(",")[1]),F=O.length,k=new Uint8Array(F);F--;)k[F]=O.charCodeAt(F);var U=new Blob([k]);window.navigator.msSaveOrOpenBlob(U,M+"."+P)}else{var G=S.get("lang"),j='',q=window.open();q.document.write(j)}},y.register("saveAsImage",C);var A=C;f.exports=A}),wCt=xt((o,f)=>{var m=fo(),v=Wi(),y=J3(),x=Z3(),C=y.toolbox.magicType,w="__ec_magicType_stack__";function A(I){this.model=I}A.defaultOption={show:!0,type:[],icon:{line:"M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4",bar:"M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7",stack:"M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z"},title:v.clone(C.title),option:{},seriesIndex:{}};var E=A.prototype;E.getIcons=function(){var I=this.model,P=I.get("icon"),D={};return v.each(I.get("type"),function(L){P[L]&&(D[L]=P[L])}),D};var T={line:function(I,P,D,L){if(I==="bar")return v.merge({id:P,type:"line",data:D.get("data"),stack:D.get("stack"),markPoint:D.get("markPoint"),markLine:D.get("markLine")},L.get("option.line")||{},!0)},bar:function(I,P,D,L){if(I==="line")return v.merge({id:P,type:"bar",data:D.get("data"),stack:D.get("stack"),markPoint:D.get("markPoint"),markLine:D.get("markLine")},L.get("option.bar")||{},!0)},stack:function(I,P,D,L){var R=D.get("stack")===w;if(I==="line"||I==="bar")return L.setIconStatus("stack",R?"normal":"emphasis"),v.merge({id:P,stack:R?"":w},L.get("option.stack")||{},!0)}},S=[["line","bar"],["stack"]];E.onclick=function(I,P,D){var L=this.model,R=L.get("seriesIndex."+D);if(T[D]){var O={series:[]},F=function(G){var j=G.subType,q=G.id,J=T[D](j,q,G,L);J&&(v.defaults(J,G.option),O.series.push(J));var X=G.coordinateSystem;if(X&&X.type==="cartesian2d"&&(D==="line"||D==="bar")){var Y=X.getAxesByScale("ordinal")[0];if(Y){var Q=Y.dim,ee=Q+"Axis",z=I.queryComponents({mainType:ee,index:G.get(name+"Index"),id:G.get(name+"Id")})[0],ie=z.componentIndex;O[ee]=O[ee]||[];for(var re=0;re<=ie;re++)O[ee][ie]=O[ee][ie]||{};O[ee][ie].boundaryGap=D==="bar"}}};v.each(S,function(G){v.indexOf(G,D)>=0&&v.each(G,function(j){L.setIconStatus(j,"normal")})}),L.setIconStatus(D,"emphasis"),I.eachComponent({mainType:"series",query:R==null?null:{seriesIndex:R}},F);var k;if(D==="stack"){var U=O.series&&O.series[0]&&O.series[0].stack===w;k=U?v.merge({stack:C.title.tiled},C.title):v.clone(C.title)}P.dispatchAction({type:"changeMagicType",currentType:D,newOption:O,newTitle:k,featureName:"magicType"})}},m.registerAction({type:"changeMagicType",event:"magicTypeChanged",update:"prepareAndUpdate"},function(I,P){P.mergeOption(I.newOption)}),x.register("magicType",A);var M=A;f.exports=M}),ACt=xt((o,f)=>{var m=fo(),v=Wi(),y=B2(),x=J3(),C=Z3(),w=x.toolbox.dataView,A=new Array(60).join("-"),E=" ";function T(j){var q={},J=[],X=[];return j.eachRawSeries(function(Y){var Q=Y.coordinateSystem;if(Q&&(Q.type==="cartesian2d"||Q.type==="polar")){var ee=Q.getBaseAxis();if(ee.type==="category"){var z=ee.dim+"_"+ee.index;q[z]||(q[z]={categoryAxis:ee,valueAxis:Q.getOtherAxis(ee),series:[]},X.push({axisDim:ee.dim,axisIndex:ee.index})),q[z].series.push(Y)}else J.push(Y)}else J.push(Y)}),{seriesGroupByCategoryAxis:q,other:J,meta:X}}function S(j){var q=[];return v.each(j,function(J,X){var Y=J.categoryAxis,Q=J.valueAxis,ee=Q.dim,z=[" "].concat(v.map(J.series,function(ae){return ae.name})),ie=[Y.model.getCategories()];v.each(J.series,function(ae){ie.push(ae.getRawData().mapArray(ee,function(fe){return fe}))});for(var re=[z.join(E)],ne=0;ne=0)return!0}var L=new RegExp("["+E+"]+","g");function R(j){for(var q=j.split(/\n+/g),J=P(q.shift()).split(L),X=[],Y=v.map(J,function(ie){return{name:ie,data:[]}}),Q=0;Q{var m=Ac(),v=m.__DEV__,y=Wi(),x=xa(),C=vu(),w=bGe(),A=y.each,E=y.indexOf,T=y.curry,S=["dataToPoint","pointToData"],M=["grid","xAxis","yAxis","geo","graph","polar","radiusAxis","angleAxis","bmap"];function I(Y,Q,ee){var z=this._targetInfoList=[],ie={},re=L(Q,Y);A(R,function(ne,oe){(!ee||!ee.include||E(ee.include,oe)>=0)&&ne(re,z,ie)})}var P=I.prototype;P.setOutputRanges=function(Y,Q){this.matchOutputRanges(Y,Q,function(ee,z,ie){if((ee.coordRanges||(ee.coordRanges=[])).push(z),!ee.coordRange){ee.coordRange=z;var re=k[ee.brushType](0,ie,z);ee.__rangeOffset={offset:G[ee.brushType](re.values,ee.range,[1,1]),xyMinMax:re.xyMinMax}}})},P.matchOutputRanges=function(Y,Q,ee){A(Y,function(z){var ie=this.findTargetInfo(z,Q);ie&&ie!==!0&&y.each(ie.coordSyses,function(re){var ne=k[z.brushType](1,re,z.range);ee(z,ne.values,re,Q)})},this)},P.setInputRanges=function(Y,Q){A(Y,function(ee){var z=this.findTargetInfo(ee,Q);if(ee.range=ee.range||[],z&&z!==!0){ee.panelId=z.panelId;var ie=k[ee.brushType](0,z.coordSys,ee.coordRange),re=ee.__rangeOffset;ee.range=re?G[ee.brushType](ie.values,re.offset,q(ie.xyMinMax,re.xyMinMax)):ie.values}},this)},P.makePanelOpts=function(Y,Q){return y.map(this._targetInfoList,function(ee){var z=ee.getPanelRect();return{panelId:ee.panelId,defaultBrushType:Q&&Q(ee),clipPath:w.makeRectPanelClipPath(z),isTargetByCursor:w.makeRectIsTargetByCursor(z,Y,ee.coordSysModel),getLinearBrushOtherExtent:w.makeLinearBrushOtherExtent(z)}})},P.controlSeries=function(Y,Q,ee){var z=this.findTargetInfo(Y,ee);return z===!0||z&&E(z.coordSyses,Q.coordinateSystem)>=0},P.findTargetInfo=function(Y,Q){for(var ee=this._targetInfoList,z=L(Q,Y),ie=0;ieY[1]&&Y.reverse(),Y}function L(Y,Q){return C.parseFinder(Y,Q,{includeMainTypes:M})}var R={grid:function(Y,Q){var ee=Y.xAxisModels,z=Y.yAxisModels,ie=Y.gridModels,re=y.createHashMap(),ne={},oe={};!ee&&!z&&!ie||(A(ee,function(se){var ae=se.axis.grid.model;re.set(ae.id,ae),ne[ae.id]=!0}),A(z,function(se){var ae=se.axis.grid.model;re.set(ae.id,ae),oe[ae.id]=!0}),A(ie,function(se){re.set(se.id,se),ne[se.id]=!0,oe[se.id]=!0}),re.each(function(se){var ae=se.coordinateSystem,fe=[];A(ae.getCartesians(),function(de,ve){(E(ee,de.getAxis("x").model)>=0||E(z,de.getAxis("y").model)>=0)&&fe.push(de)}),Q.push({panelId:"grid--"+se.id,gridModel:se,coordSysModel:se,coordSys:fe[0],coordSyses:fe,getPanelRect:F.grid,xAxisDeclared:ne[se.id],yAxisDeclared:oe[se.id]})}))},geo:function(Y,Q){A(Y.geoModels,function(ee){var z=ee.coordinateSystem;Q.push({panelId:"geo--"+ee.id,geoModel:ee,coordSysModel:ee,coordSys:z,coordSyses:[z],getPanelRect:F.geo})})}},O=[function(Y,Q){var ee=Y.xAxisModel,z=Y.yAxisModel,ie=Y.gridModel;return!ie&&ee&&(ie=ee.axis.grid.model),!ie&&z&&(ie=z.axis.grid.model),ie&&ie===Q.gridModel},function(Y,Q){var ee=Y.geoModel;return ee&&ee===Q.geoModel}],F={grid:function(){return this.coordSys.grid.getRect().clone()},geo:function(){var Y=this.coordSys,Q=Y.getBoundingRect().clone();return Q.applyTransform(x.getTransform(Y)),Q}},k={lineX:T(U,0),lineY:T(U,1),rect:function(Y,Q,ee){var z=Q[S[Y]]([ee[0][0],ee[1][0]]),ie=Q[S[Y]]([ee[0][1],ee[1][1]]),re=[D([z[0],ie[0]]),D([z[1],ie[1]])];return{values:re,xyMinMax:re}},polygon:function(Y,Q,ee){var z=[[1/0,-1/0],[1/0,-1/0]],ie=y.map(ee,function(re){var ne=Q[S[Y]](re);return z[0][0]=Math.min(z[0][0],ne[0]),z[1][0]=Math.min(z[1][0],ne[1]),z[0][1]=Math.max(z[0][1],ne[0]),z[1][1]=Math.max(z[1][1],ne[1]),ne});return{values:ie,xyMinMax:z}}};function U(Y,Q,ee,z){var ie=ee.getAxis(["x","y"][Y]),re=D(y.map([0,1],function(oe){return Q?ie.coordToData(ie.toLocalCoord(z[oe])):ie.toGlobalCoord(ie.dataToCoord(z[oe]))})),ne=[];return ne[Y]=re,ne[1-Y]=[NaN,NaN],{values:re,xyMinMax:ne}}var G={lineX:T(j,0),lineY:T(j,1),rect:function(Y,Q,ee){return[[Y[0][0]-ee[0]*Q[0][0],Y[0][1]-ee[0]*Q[0][1]],[Y[1][0]-ee[1]*Q[1][0],Y[1][1]-ee[1]*Q[1][1]]]},polygon:function(Y,Q,ee){return y.map(Y,function(z,ie){return[z[0]-ee[0]*Q[ie][0],z[1]-ee[1]*Q[ie][1]]})}};function j(Y,Q,ee,z){return[Q[0]-z[Y]*ee[0],Q[1]-z[Y]*ee[1]]}function q(Y,Q){var ee=J(Y),z=J(Q),ie=[ee[0]/z[0],ee[1]/z[1]];return isNaN(ie[0])&&(ie[0]=1),isNaN(ie[1])&&(ie[1]=1),ie}function J(Y){return Y?[Y[0][1]-Y[0][0],Y[1][1]-Y[1][0]]:[NaN,NaN]}var X=I;f.exports=X}),NGe=xt(o=>{var f=Wi(),m=f.each,v="\0_ec_hist_store";function y(E,T){var S=A(E);m(T,function(M,I){for(var P=S.length-1;P>=0;P--){var D=S[P];if(D[I])break}if(P<0){var L=E.queryComponents({mainType:"dataZoom",subType:"select",id:I})[0];if(L){var R=L.getPercentRange();S[0][I]={dataZoomId:I,start:R[0],end:R[1]}}}}),S.push(T)}function x(E){var T=A(E),S=T[T.length-1];T.length>1&&T.pop();var M={};return m(S,function(I,P){for(var D=T.length-1;D>=0;D--){var I=T[D][P];if(I){M[P]=I;break}}}),M}function C(E){E[v]=null}function w(E){return A(E).length}function A(E){var T=E[v];return T||(T=E[v]=[{}]),T}o.push=y,o.pop=x,o.clear=C,o.count=w}),B0e=xt(()=>{var o=Xg();o.registerSubTypeDefaulter("dataZoom",function(){return"slider"})}),k0e=xt(o=>{var f=Wi(),m=fd(),v=["x","y","z","radius","angle","single"],y=["cartesian2d","polar","singleAxis"];function x(E){return f.indexOf(y,E)>=0}function C(E,T){E=E.slice();var S=f.map(E,m.capitalFirst);T=(T||[]).slice();var M=f.map(T,m.capitalFirst);return function(I,P){f.each(E,function(D,L){for(var R={name:D,capital:S[L]},O=0;O=0}function I(D,L){var R=!1;return T(function(O){f.each(S(D,O)||[],function(F){L.records[O.name][F]&&(R=!0)})}),R}function P(D,L){L.nodes.push(D),T(function(R){f.each(S(D,R)||[],function(O){L.records[R.name][O]=!0})})}}o.isCoordSupported=x,o.createNameEach=C,o.eachAxisDim=w,o.createLinkedNodesFinder=A}),ECt=xt((o,f)=>{var m=Wi(),v=il(),y=k0e(),x=cU(),C=m.each,w=v.asc,A=function(P,D,L,R){this._dimName=P,this._axisIndex=D,this._valueWindow,this._percentWindow,this._dataExtent,this._minMaxSpan,this.ecModel=R,this._dataZoomModel=L};A.prototype={constructor:A,hostedBy:function(P){return this._dataZoomModel===P},getDataValueWindow:function(){return this._valueWindow.slice()},getDataPercentWindow:function(){return this._percentWindow.slice()},getTargetSeriesModels:function(){var P=[],D=this.ecModel;return D.eachSeries(function(L){if(y.isCoordSupported(L.get("coordinateSystem"))){var R=this._dimName,O=D.queryComponents({mainType:R+"Axis",index:L.get(R+"AxisIndex"),id:L.get(R+"AxisId")})[0];this._axisIndex===(O&&O.componentIndex)&&P.push(L)}},this),P},getAxisModel:function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},getOtherAxisModel:function(){var P=this._dimName,D=this.ecModel,L=this.getAxisModel(),R=P==="x"||P==="y",O,F;R?(F="gridIndex",O=P==="x"?"y":"x"):(F="polarIndex",O=P==="angle"?"radius":"angle");var k;return D.eachComponent(O+"Axis",function(U){(U.get(F)||0)===(L.get(F)||0)&&(k=U)}),k},getMinMaxSpan:function(){return m.clone(this._minMaxSpan)},calculateDataWindow:function(P){var D=this._dataExtent,L=this.getAxisModel(),R=L.axis.scale,O=this._dataZoomModel.getRangePropMode(),F=[0,100],k=[],U=[],G;C(["start","end"],function(J,X){var Y=P[J],Q=P[J+"Value"];O[X]==="percent"?(Y==null&&(Y=F[X]),Q=R.parse(v.linearMap(Y,F,D))):(G=!0,Q=Q==null?D[X]:R.parse(Q),Y=v.linearMap(Q,D,F)),U[X]=Q,k[X]=Y}),w(U),w(k);var j=this._minMaxSpan;G?q(U,k,D,F,!1):q(k,U,F,D,!0);function q(J,X,Y,Q,ee){var z=ee?"Span":"ValueSpan";x(0,J,Y,"all",j["min"+z],j["max"+z]);for(var ie=0;ie<2;ie++)X[ie]=v.linearMap(J[ie],Y,Q,!0),ee&&(X[ie]=R.parse(X[ie]))}return{valueWindow:U,percentWindow:k}},reset:function(P){if(P===this._dataZoomModel){var D=this.getTargetSeriesModels();this._dataExtent=E(this,this._dimName,D),M(this);var L=this.calculateDataWindow(P.settledOption);this._valueWindow=L.valueWindow,this._percentWindow=L.percentWindow,S(this)}},restore:function(P){P===this._dataZoomModel&&(this._valueWindow=this._percentWindow=null,S(this,!0))},filterData:function(P,D){if(P!==this._dataZoomModel)return;var L=this._dimName,R=this.getTargetSeriesModels(),O=P.get("filterMode"),F=this._valueWindow;if(O==="none")return;C(R,function(U){var G=U.getData(),j=G.mapDimension(L,!0);j.length&&(O==="weakFilter"?G.filterSelf(function(q){for(var J,X,Y,Q=0;QF[1];if(z&&!ie&&!re)return!0;z&&(Y=!0),ie&&(J=!0),re&&(X=!0)}return Y&&J&&X}):C(j,function(q){if(O==="empty")U.setData(G=G.map(q,function(X){return k(X)?X:NaN}));else{var J={};J[q]=F,G.selectRange(J)}}),C(j,function(q){G.setApproximateExtent(F,q)}))});function k(U){return U>=F[0]&&U<=F[1]}}};function E(P,D,L){var R=[1/0,-1/0];return C(L,function(O){var F=O.getData();F&&C(F.mapDimension(D,!0),function(k){var U=F.getApproximateExtent(k);U[0]R[1]&&(R[1]=U[1])})}),R[1]0?0:NaN);var k=L.getMax(!0);return k!=null&&k!=="dataMax"&&typeof k!="function"?D[1]=k:O&&(D[1]=F>0?F-1:NaN),L.get("scale",!0)||(D[0]>0&&(D[0]=0),D[1]<0&&(D[1]=0)),D}function S(P,D){var L=P.getAxisModel(),R=P._percentWindow,O=P._valueWindow;if(R){var F=v.getPixelPrecision(O,[0,500]);F=Math.min(F,20);var k=D||R[0]===0&&R[1]===100;L.setRange(k?null:+O[0].toFixed(F),k?null:+O[1].toFixed(F))}}function M(P){var D=P._minMaxSpan={},L=P._dataZoomModel,R=P._dataExtent;C(["min","max"],function(O){var F=L.get(O+"Span"),k=L.get(O+"ValueSpan");k!=null&&(k=P.getAxisModel().axis.scale.parse(k)),k!=null?F=v.linearMap(R[0]+k,R,[0,100],!0):F!=null&&(k=v.linearMap(F,[0,100],R,!0)-R[0]),D[O+"Span"]=F,D[O+"ValueSpan"]=k})}var I=A;f.exports=I}),hU=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=fo(),x=Wi(),C=Tm(),w=vu(),A=k0e(),E=ECt(),T=x.each,S=A.eachAxisDim,M=y.extendComponentModel({type:"dataZoom",dependencies:["xAxis","yAxis","zAxis","radiusAxis","angleAxis","singleAxis","series"],defaultOption:{zlevel:0,z:4,orient:null,xAxisIndex:null,yAxisIndex:null,filterMode:"filter",throttle:null,start:0,end:100,startValue:null,endValue:null,minSpan:null,maxSpan:null,minValueSpan:null,maxValueSpan:null,rangeMode:null},init:function(L,R,O){this._dataIntervalByAxis={},this._dataInfo={},this._axisProxies={},this.textStyleModel,this._autoThrottle=!0,this._rangePropMode=["percent","percent"];var F=I(L);this.settledOption=F,this.mergeDefaultAndTheme(L,O),this.doInit(F)},mergeOption:function(L){var R=I(L);x.merge(this.option,L,!0),x.merge(this.settledOption,R,!0),this.doInit(R)},doInit:function(L){var R=this.option;C.canvasSupported||(R.realtime=!1),this._setDefaultThrottle(L),P(this,L);var O=this.settledOption;T([["start","startValue"],["end","endValue"]],function(F,k){this._rangePropMode[k]==="value"&&(R[F[0]]=O[F[0]]=null)},this),this.textStyleModel=this.getModel("textStyle"),this._resetTarget(),this._giveAxisProxies()},_giveAxisProxies:function(){var L=this._axisProxies;this.eachTargetAxis(function(R,O,F,k){var U=this.dependentModels[R.axis][O],G=U.__dzAxisProxy||(U.__dzAxisProxy=new E(R.name,O,this,k));L[R.name+"_"+O]=G},this)},_resetTarget:function(){var L=this.option,R=this._judgeAutoMode();S(function(O){var F=O.axisIndex;L[F]=w.normalizeToArray(L[F])},this),R==="axisIndex"?this._autoSetAxisIndex():R==="orient"&&this._autoSetOrient()},_judgeAutoMode:function(){var L=this.option,R=!1;S(function(F){L[F.axisIndex]!=null&&(R=!0)},this);var O=L.orient;if(O==null&&R)return"orient";if(!R)return O==null&&(L.orient="horizontal"),"axisIndex"},_autoSetAxisIndex:function(){var L=!0,R=this.get("orient",!0),O=this.option,F=this.dependentModels;if(L){var k=R==="vertical"?"y":"x";F[k+"Axis"].length?(O[k+"AxisIndex"]=[0],L=!1):T(F.singleAxis,function(U){L&&U.get("orient",!0)===R&&(O.singleAxisIndex=[U.componentIndex],L=!1)})}L&&S(function(U){if(L){var G=[],j=this.dependentModels[U.axis];if(j.length&&!G.length)for(var q=0,J=j.length;q0?100:20}},getFirstTargetAxisModel:function(){var L;return S(function(R){if(L==null){var O=this.get(R.axisIndex);O.length&&(L=this.dependentModels[R.axis][O[0]])}},this),L},eachTargetAxis:function(L,R){var O=this.ecModel;S(function(F){T(this.get(F.axisIndex),function(k){L.call(R,F,k,this,O)},this)},this)},getAxisProxy:function(L,R){return this._axisProxies[L+"_"+R]},getAxisModel:function(L,R){var O=this.getAxisProxy(L,R);return O&&O.getAxisModel()},setRawRange:function(L){var R=this.option,O=this.settledOption;T([["start","startValue"],["end","endValue"]],function(F){(L[F[0]]!=null||L[F[1]]!=null)&&(R[F[0]]=O[F[0]]=L[F[0]],R[F[1]]=O[F[1]]=L[F[1]])},this),P(this,L)},setCalculatedRange:function(L){var R=this.option;T(["start","startValue","end","endValue"],function(O){R[O]=L[O]})},getPercentRange:function(){var L=this.findRepresentativeAxisProxy();if(L)return L.getDataPercentWindow()},getValueRange:function(L,R){if(L==null&&R==null){var O=this.findRepresentativeAxisProxy();if(O)return O.getDataValueWindow()}else return this.getAxisProxy(L,R).getDataValueWindow()},findRepresentativeAxisProxy:function(L){if(L)return L.__dzAxisProxy;var R=this._axisProxies;for(var O in R)if(R.hasOwnProperty(O)&&R[O].hostedBy(this))return R[O];for(var O in R)if(R.hasOwnProperty(O)&&!R[O].hostedBy(this))return R[O]},getRangePropMode:function(){return this._rangePropMode.slice()}});function I(L){var R={};return T(["start","end","startValue","endValue","throttle"],function(O){L.hasOwnProperty(O)&&(R[O]=L[O])}),R}function P(L,R){var O=L._rangePropMode,F=L.get("rangeMode");T([["start","startValue"],["end","endValue"]],function(k,U){var G=R[k[0]]!=null,j=R[k[1]]!=null;G&&!j?O[U]="percent":!G&&j?O[U]="value":F?O[U]=F[U]:G&&(O[U]="percent")})}var D=M;f.exports=D}),dU=xt((o,f)=>{var m=Aie(),v=m.extend({type:"dataZoom",render:function(y,x,C,w){this.dataZoomModel=y,this.ecModel=x,this.api=C},getTargetCoordInfo:function(){var y=this.dataZoomModel,x=this.ecModel,C={};y.eachTargetAxis(function(A,E){var T=x.getComponent(A.axis,E);if(T){var S=T.getCoordSysModel();S&&w(S,T,C[S.mainType]||(C[S.mainType]=[]),S.componentIndex)}},this);function w(A,E,T,S){for(var M,I=0;I{var m=hU(),v=m.extend({type:"dataZoom.select"});f.exports=v}),SCt=xt((o,f)=>{var m=dU(),v=m.extend({type:"dataZoom.select"});f.exports=v}),V0e=xt(()=>{var o=fo(),f=Wi(),m=f.createHashMap,v=f.each;o.registerProcessor({getTargetSeries:function(y){var x=m();return y.eachComponent("dataZoom",function(C){C.eachTargetAxis(function(w,A,E){var T=E.getAxisProxy(w.name,A);v(T.getTargetSeriesModels(),function(S){x.set(S.uid,S)})})}),x},modifyOutputEnd:!0,overallReset:function(y,x){y.eachComponent("dataZoom",function(C){C.eachTargetAxis(function(w,A,E){E.getAxisProxy(w.name,A).reset(E,x)}),C.eachTargetAxis(function(w,A,E){E.getAxisProxy(w.name,A).filterData(E,x)})}),y.eachComponent("dataZoom",function(C){var w=C.findRepresentativeAxisProxy(),A=w.getDataPercentWindow(),E=w.getDataValueWindow();C.setCalculatedRange({start:A[0],end:A[1],startValue:E[0],endValue:E[1]})})}})}),z0e=xt(()=>{var o=fo(),f=Wi(),m=k0e();o.registerAction("dataZoom",function(v,y){var x=m.createLinkedNodesFinder(f.bind(y.eachComponent,y,"dataZoom"),m.eachAxisDim,function(w,A){return w.get(A.axisIndex)}),C=[];y.eachComponent({mainType:"dataZoom",query:v},function(w,A){C.push.apply(C,x(w).nodes)}),f.each(C,function(w,A){w.setRawRange({start:v.start,end:v.end,startValue:v.startValue,endValue:v.endValue})})})}),PCt=xt(()=>{B0e(),hU(),dU(),TCt(),SCt(),V0e(),z0e()}),ICt=xt((o,f)=>{var m=fo(),v=Wi(),y=O0e(),x=OGe(),C=NGe(),w=cU(),A=J3(),E=Z3();PCt();var T=A.toolbox.dataZoom,S=v.each,M="\0_ec_\0toolbox-dataZoom_";function I(k,U,G){(this._brushController=new y(G.getZr())).on("brush",v.bind(this._onBrush,this)).mount(),this._isZoomActive}I.defaultOption={show:!0,filterMode:"filter",icon:{zoom:"M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1",back:"M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26"},title:v.clone(T.title)};var P=I.prototype;P.render=function(k,U,G,j){this.model=k,this.ecModel=U,this.api=G,O(k,U,this,j,G),R(k,U)},P.onclick=function(k,U,G){D[G].call(this)},P.remove=function(k,U){this._brushController.unmount()},P.dispose=function(k,U){this._brushController.dispose()};var D={zoom:function(){var k=!this._isZoomActive;this.api.dispatchAction({type:"takeGlobalCursor",key:"dataZoomSelect",dataZoomSelectActive:k})},back:function(){this._dispatchZoomAction(C.pop(this.ecModel))}};P._onBrush=function(k,U){if(!U.isEnd||!k.length)return;var G={},j=this.ecModel;this._brushController.updateCovers([]);var q=new x(L(this.model.option),j,{include:["grid"]});q.matchOutputRanges(k,j,function(Y,Q,ee){if(ee.type==="cartesian2d"){var z=Y.brushType;z==="rect"?(J("x",ee,Q[0]),J("y",ee,Q[1])):J({lineX:"x",lineY:"y"}[z],ee,Q)}}),C.push(j,G),this._dispatchZoomAction(G);function J(Y,Q,ee){var z=Q.getAxis(Y),ie=z.model,re=X(Y,ie,j),ne=re.findRepresentativeAxisProxy(ie).getMinMaxSpan();(ne.minValueSpan!=null||ne.maxValueSpan!=null)&&(ee=w(0,ee.slice(),z.scale.getExtent(),0,ne.minValueSpan,ne.maxValueSpan)),re&&(G[re.id]={dataZoomId:re.id,startValue:ee[0],endValue:ee[1]})}function X(Y,Q,ee){var z;return ee.eachComponent({mainType:"dataZoom",subType:"select"},function(ie){var re=ie.getAxisModel(Y,Q.componentIndex);re&&(z=ie)}),z}},P._dispatchZoomAction=function(k){var U=[];S(k,function(G,j){U.push(v.clone(G))}),U.length&&this.api.dispatchAction({type:"dataZoom",from:this.uid,batch:U})};function L(k){var U={};return v.each(["xAxisIndex","yAxisIndex"],function(G){U[G]=k[G],U[G]==null&&(U[G]="all"),(U[G]===!1||U[G]==="none")&&(U[G]=[])}),U}function R(k,U){k.setIconStatus("back",C.count(U)>1?"emphasis":"normal")}function O(k,U,G,j,q){var J=G._isZoomActive;j&&j.type==="takeGlobalCursor"&&(J=j.key==="dataZoomSelect"?j.dataZoomSelectActive:!1),G._isZoomActive=J,k.setIconStatus("zoom",J?"emphasis":"normal");var X=new x(L(k.option),U,{include:["grid"]});G._brushController.setPanels(X.makePanelOpts(q,function(Y){return Y.xAxisDeclared&&!Y.yAxisDeclared?"lineX":!Y.xAxisDeclared&&Y.yAxisDeclared?"lineY":"rect"})).enableBrush(J?{brushType:"auto",brushStyle:{lineWidth:0,fill:"rgba(0,0,0,0.2)"}}:!1)}E.register("dataZoom",I),m.registerPreprocessor(function(k){if(!k)return;var U=k.dataZoom||(k.dataZoom=[]);v.isArray(U)||(k.dataZoom=U=[U]);var G=k.toolbox;if(G&&(v.isArray(G)&&(G=G[0]),G&&G.feature)){var j=G.feature.dataZoom;q("xAxis",j),q("yAxis",j)}function q(X,Y){if(Y){var Q=X+"Index",ee=Y[Q];ee!=null&&ee!=="all"&&!v.isArray(ee)&&(ee=ee===!1||ee==="none"?[]:[ee]),J(X,function(z,ie){if(!(ee!=null&&ee!=="all"&&v.indexOf(ee,ie)===-1)){var re={type:"select",$fromToolbox:!0,filterMode:Y.filterMode||"filter",id:M+X+ie};re[Q]=ie,U.push(re)}})}}function J(X,Y){var Q=k[X];v.isArray(Q)||(Q=Q?[Q]:[]),S(Q,Y)}});var F=I;f.exports=F}),MCt=xt((o,f)=>{var m=fo(),v=NGe(),y=J3(),x=Z3(),C=y.toolbox.restore;function w(T){this.model=T}w.defaultOption={show:!0,icon:"M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5",title:C.title};var A=w.prototype;A.onclick=function(T,S,M){v.clear(T),S.dispatchAction({type:"restore",from:this.uid})},x.register("restore",w),m.registerAction({type:"restore",event:"restore",update:"prepareAndUpdate"},function(T,S){S.resetOption("recreate")});var E=w;f.exports=E}),DCt=xt(()=>{xCt(),CCt(),bCt(),wCt(),ACt(),ICt(),MCt()}),LCt=xt((o,f)=>{var m=fo(),v=m.extendComponentModel({type:"tooltip",dependencies:["axisPointer"],defaultOption:{zlevel:0,z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:!1,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"rgba(50,50,50,0.7)",borderColor:"#333",borderRadius:4,borderWidth:0,padding:5,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#fff",fontSize:14}}});f.exports=v}),RCt=xt((o,f)=>{var m=Wi(),v=k2(),y=B2(),x=w8e(),C=Tm(),w=fd(),A=m.each,E=w.toCamelCase,T=["","-webkit-","-moz-","-o-"],S="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;";function M(O){var F="cubic-bezier(0.23, 1, 0.32, 1)",k="left "+O+"s "+F+",top "+O+"s "+F;return m.map(T,function(U){return U+"transition:"+k}).join(";")}function I(O){var F=[],k=O.get("fontSize"),U=O.getTextColor();return U&&F.push("color:"+U),F.push("font:"+O.getFont()),k&&F.push("line-height:"+Math.round(k*3/2)+"px"),A(["decoration","align"],function(G){var j=O.get(G);j&&F.push("text-"+G+":"+j)}),F.join(";")}function P(O){var F=[],k=O.get("transitionDuration"),U=O.get("backgroundColor"),G=O.getModel("textStyle"),j=O.get("padding");return k&&F.push(M(k)),U&&(C.canvasSupported?F.push("background-Color:"+U):(F.push("background-Color:#"+v.toHex(U)),F.push("filter:alpha(opacity=70)"))),A(["width","color","radius"],function(q){var J="border-"+q,X=E(J),Y=O.get(X);Y!=null&&F.push(J+":"+Y+(q==="color"?"":"px"))}),F.push(I(G)),j!=null&&F.push("padding:"+w.normalizeCssArray(j).join("px ")+"px"),F.join(";")+";"}function D(O,F,k,U,G){var j=F&&F.painter;if(k){var q=j&&j.getViewportRoot();q&&x.transformLocalCoord(O,q,document.body,U,G)}else{O[0]=U,O[1]=G;var J=j&&j.getViewportRootOffset();J&&(O[0]+=J.offsetLeft,O[1]+=J.offsetTop)}}function L(O,F,k){if(C.wxa)return null;var U=document.createElement("div");U.domBelongToZr=!0,this.el=U;var G=this._zr=F.getZr(),j=this._appendToBody=k&&k.appendToBody;this._styleCoord=[0,0],D(this._styleCoord,G,j,F.getWidth()/2,F.getHeight()/2),j?document.body.appendChild(U):O.appendChild(U),this._container=O,this._show=!1,this._hideTimeout;var q=this;U.onmouseenter=function(){q._enterable&&(clearTimeout(q._hideTimeout),q._show=!0),q._inContent=!0},U.onmousemove=function(J){if(J=J||window.event,!q._enterable){var X=G.handler,Y=G.painter.getViewportRoot();y.normalizeEvent(Y,J,!0),X.dispatch("mousemove",J)}},U.onmouseleave=function(){q._enterable&&q._show&&q.hideLater(q._hideDelay),q._inContent=!1}}L.prototype={constructor:L,_enterable:!0,update:function(){var O=this._container,F=O.currentStyle||document.defaultView.getComputedStyle(O),k=O.style;k.position!=="absolute"&&F.position!=="absolute"&&(k.position="relative")},show:function(O){clearTimeout(this._hideTimeout);var F=this.el,k=this._styleCoord;F.style.cssText=S+P(O)+";left:"+k[0]+"px;top:"+k[1]+"px;"+(O.get("extraCssText")||""),F.style.display=F.innerHTML?"block":"none",F.style.pointerEvents=this._enterable?"auto":"none",this._show=!0},setContent:function(O){this.el.innerHTML=O??""},setEnterable:function(O){this._enterable=O},getSize:function(){var O=this.el;return[O.clientWidth,O.clientHeight]},moveTo:function(O,F){var k=this._styleCoord;D(k,this._zr,this._appendToBody,O,F);var U=this.el.style;U.left=k[0]+"px",U.top=k[1]+"px"},hide:function(){this.el.style.display="none",this._show=!1},hideLater:function(O){this._show&&!(this._inContent&&this._enterable)&&(O?(this._hideDelay=O,this._show=!1,this._hideTimeout=setTimeout(m.bind(this.hide,this),O)):this.hide())},isShow:function(){return this._show},dispose:function(){this.el.parentNode.removeChild(this.el)},getOuterSize:function(){var O=this.el.clientWidth,F=this.el.clientHeight;if(document.defaultView&&document.defaultView.getComputedStyle){var k=document.defaultView.getComputedStyle(this.el);k&&(O+=parseInt(k.borderLeftWidth,10)+parseInt(k.borderRightWidth,10),F+=parseInt(k.borderTopWidth,10)+parseInt(k.borderBottomWidth,10))}return{width:O,height:F}}};var R=L;f.exports=R}),OCt=xt((o,f)=>{var m=Wi(),v=nB();function y(C){this._zr=C.getZr(),this._show=!1,this._hideTimeout}y.prototype={constructor:y,_enterable:!0,update:function(){},show:function(C){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.attr("show",!0),this._show=!0},setContent:function(C,w,A){this.el&&this._zr.remove(this.el);for(var E={},T=C,S="{marker",M="|}",I=T.indexOf(S);I>=0;){var P=T.indexOf(M),D=T.substr(I+S.length,P-I-S.length);D.indexOf("sub")>-1?E["marker"+D]={textWidth:4,textHeight:4,textBorderRadius:2,textBackgroundColor:w[D],textOffset:[3,0]}:E["marker"+D]={textWidth:10,textHeight:10,textBorderRadius:5,textBackgroundColor:w[D]},T=T.substr(P+1),I=T.indexOf("{marker")}this.el=new v({style:{rich:E,text:C,textLineHeight:20,textBackgroundColor:A.get("backgroundColor"),textBorderRadius:A.get("borderRadius"),textFill:A.get("textStyle.color"),textPadding:A.get("padding")},z:A.get("z")}),this._zr.add(this.el);var L=this;this.el.on("mouseover",function(){L._enterable&&(clearTimeout(L._hideTimeout),L._show=!0),L._inContent=!0}),this.el.on("mouseout",function(){L._enterable&&L._show&&L.hideLater(L._hideDelay),L._inContent=!1})},setEnterable:function(C){this._enterable=C},getSize:function(){var C=this.el.getBoundingRect();return[C.width,C.height]},moveTo:function(C,w){this.el&&this.el.attr("position",[C,w])},hide:function(){this.el&&this.el.hide(),this._show=!1},hideLater:function(C){this._show&&!(this._inContent&&this._enterable)&&(C?(this._hideDelay=C,this._show=!1,this._hideTimeout=setTimeout(m.bind(this.hide,this),C)):this.hide())},isShow:function(){return this._show},getOuterSize:function(){var C=this.getSize();return{width:C[0],height:C[1]}}};var x=y;f.exports=x}),NCt=xt((o,f)=>{var m=fo(),v=Wi(),y=Tm(),x=RCt(),C=OCt(),w=fd(),A=il(),E=xa(),T=IGe(),S=rd(),M=Sm(),I=MGe(),P=sT(),D=Oie(),L=vu(),R=L.getTooltipRenderMode,O=v.bind,F=v.each,k=A.parsePercent,U=new E.Rect({shape:{x:-1,y:-1,width:2,height:2}}),G=m.extendComponentView({type:"tooltip",init:function(ee,z){if(!y.node){var ie=ee.getComponent("tooltip"),re=ie.get("renderMode");this._renderMode=R(re);var ne;this._renderMode==="html"?(ne=new x(z.getDom(),z,{appendToBody:ie.get("appendToBody",!0)}),this._newLine="
"):(ne=new C(z),this._newLine=` `),this._tooltipContent=ne}},render:function(ee,z,ie){if(!y.node){this.group.removeAll(),this._tooltipModel=ee,this._ecModel=z,this._api=ie,this._lastDataByCoordSys=null,this._alwaysShowContent=ee.get("alwaysShowContent");var re=this._tooltipContent;re.update(),re.setEnterable(ee.get("enterable")),this._initGlobalListener(),this._keepShow()}},_initGlobalListener:function(){var ee=this._tooltipModel,z=ee.get("triggerOn");I.register("itemTooltip",this._api,O(function(ie,re,ne){z!=="none"&&(z.indexOf(ie)>=0?this._tryShow(re,ne):ie==="leave"&&this._hide(ne))},this))},_keepShow:function(){var ee=this._tooltipModel,z=this._ecModel,ie=this._api;if(this._lastX!=null&&this._lastY!=null&&ee.get("triggerOn")!=="none"){var re=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!ie.isDisposed()&&re.manuallyShowTip(ee,z,ie,{x:re._lastX,y:re._lastY})})}},manuallyShowTip:function(ee,z,ie,re){if(!(re.from===this.uid||y.node)){var ne=q(re,ie);this._ticket="";var oe=re.dataByCoordSys;if(re.tooltip&&re.x!=null&&re.y!=null){var se=U;se.position=[re.x,re.y],se.update(),se.tooltip=re.tooltip,this._tryShow({offsetX:re.x,offsetY:re.y,target:se},ne)}else if(oe)this._tryShow({offsetX:re.x,offsetY:re.y,position:re.position,dataByCoordSys:re.dataByCoordSys,tooltipOption:re.tooltipOption},ne);else if(re.seriesIndex!=null){if(this._manuallyAxisShowTip(ee,z,ie,re))return;var ae=T(re,z),fe=ae.point[0],de=ae.point[1];fe!=null&&de!=null&&this._tryShow({offsetX:fe,offsetY:de,position:re.position,target:ae.el},ne)}else re.x!=null&&re.y!=null&&(ie.dispatchAction({type:"updateAxisPointer",x:re.x,y:re.y}),this._tryShow({offsetX:re.x,offsetY:re.y,position:re.position,target:ie.getZr().findHover(re.x,re.y).target},ne))}},manuallyHideTip:function(ee,z,ie,re){var ne=this._tooltipContent;!this._alwaysShowContent&&this._tooltipModel&&ne.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=null,re.from!==this.uid&&this._hide(q(re,ie))},_manuallyAxisShowTip:function(ee,z,ie,re){var ne=re.seriesIndex,oe=re.dataIndex,se=z.getComponent("axisPointer").coordSysAxesInfo;if(!(ne==null||oe==null||se==null)){var ae=z.getSeriesByIndex(ne);if(ae){var fe=ae.getData(),ee=j([fe.getItemModel(oe),ae,(ae.coordinateSystem||{}).model,ee]);if(ee.get("trigger")==="axis")return ie.dispatchAction({type:"updateAxisPointer",seriesIndex:ne,dataIndex:oe,position:re.position}),!0}}},_tryShow:function(ee,z){var ie=ee.target,re=this._tooltipModel;if(re){this._lastX=ee.offsetX,this._lastY=ee.offsetY;var ne=ee.dataByCoordSys;ne&&ne.length?this._showAxisTooltip(ne,ee):ie&&ie.dataIndex!=null?(this._lastDataByCoordSys=null,this._showSeriesItemTooltip(ee,ie,z)):ie&&ie.tooltip?(this._lastDataByCoordSys=null,this._showComponentItemTooltip(ee,ie,z)):(this._lastDataByCoordSys=null,this._hide(z))}},_showOrMove:function(ee,z){var ie=ee.get("showDelay");z=v.bind(z,this),clearTimeout(this._showTimout),ie>0?this._showTimout=setTimeout(z,ie):z()},_showAxisTooltip:function(ee,z){var ie=this._ecModel,re=this._tooltipModel,ne=[z.offsetX,z.offsetY],oe=[],se=[],ae=j([z.tooltipOption,re]),fe=this._renderMode,de=this._newLine,ve={};F(ee,function(ce){F(ce.dataByAxis,function(he){var Ce=ie.getComponent(he.axisDim+"Axis",he.axisIndex),Se=he.value,De=[];if(!(!Ce||Se==null)){var Oe=D.getValueLabel(Se,Ce.axis,ie,he.seriesDataIndices,he.valueLabelOpt);v.each(he.seriesDataIndices,function(Xe){var it=ie.getSeriesByIndex(Xe.seriesIndex),ut=Xe.dataIndexInside,at=it&&it.getDataParams(ut);if(at.axisDim=he.axisDim,at.axisIndex=he.axisIndex,at.axisType=he.axisType,at.axisId=he.axisId,at.axisValue=P.getAxisRawValue(Ce.axis,Se),at.axisValueLabel=Oe,at){se.push(at);var Pt=it.formatTooltip(ut,!0,null,fe),Qe;if(v.isObject(Pt)){Qe=Pt.html;var ft=Pt.markers;v.merge(ve,ft)}else Qe=Pt;De.push(Qe)}});var Ue=Oe;fe!=="html"?oe.push(De.join(de)):oe.push((Ue?w.encodeHTML(Ue)+de:"")+De.join(de))}})},this),oe.reverse(),oe=oe.join(this._newLine+this._newLine);var pe=z.position;this._showOrMove(ae,function(){this._updateContentNotChangedOnAxis(ee)?this._updatePosition(ae,pe,ne[0],ne[1],this._tooltipContent,se):this._showTooltipContent(ae,oe,se,Math.random(),ne[0],ne[1],pe,void 0,ve)})},_showSeriesItemTooltip:function(ee,z,ie){var re=this._ecModel,ne=z.seriesIndex,oe=re.getSeriesByIndex(ne),se=z.dataModel||oe,ae=z.dataIndex,fe=z.dataType,de=se.getData(fe),ve=j([de.getItemModel(ae),se,oe&&(oe.coordinateSystem||{}).model,this._tooltipModel]),pe=ve.get("trigger");if(!(pe!=null&&pe!=="item")){var ce=se.getDataParams(ae,fe),he=se.formatTooltip(ae,!1,fe,this._renderMode),Ce,Se;v.isObject(he)?(Ce=he.html,Se=he.markers):(Ce=he,Se=null);var De="item_"+se.name+"_"+ae;this._showOrMove(ve,function(){this._showTooltipContent(ve,Ce,ce,De,ee.offsetX,ee.offsetY,ee.position,ee.target,Se)}),ie({type:"showTip",dataIndexInside:ae,dataIndex:de.getRawIndex(ae),seriesIndex:ne,from:this.uid})}},_showComponentItemTooltip:function(ee,z,ie){var re=z.tooltip;if(typeof re=="string"){var ne=re;re={content:ne,formatter:ne}}var oe=new M(re,this._tooltipModel,this._ecModel),se=oe.get("content"),ae=Math.random();this._showOrMove(oe,function(){this._showTooltipContent(oe,se,oe.get("formatterParams")||{},ae,ee.offsetX,ee.offsetY,ee.position,z)}),ie({type:"showTip",from:this.uid})},_showTooltipContent:function(ee,z,ie,re,ne,oe,se,ae,fe){if(this._ticket="",!(!ee.get("showContent")||!ee.get("show"))){var de=this._tooltipContent,ve=ee.get("formatter");se=se||ee.get("position");var pe=z;if(ve&&typeof ve=="string")pe=w.formatTpl(ve,ie,!0);else if(typeof ve=="function"){var ce=O(function(he,Ce){he===this._ticket&&(de.setContent(Ce,fe,ee),this._updatePosition(ee,se,ne,oe,de,ie,ae))},this);this._ticket=re,pe=ve(ie,re,ce)}de.setContent(pe,fe,ee),de.show(ee),this._updatePosition(ee,se,ne,oe,de,ie,ae)}},_updatePosition:function(ee,z,ie,re,ne,oe,se){var ae=this._api.getWidth(),fe=this._api.getHeight();z=z||ee.get("position");var de=ne.getSize(),ve=ee.get("align"),pe=ee.get("verticalAlign"),ce=se&&se.getBoundingRect().clone();if(se&&ce.applyTransform(se.transform),typeof z=="function"&&(z=z([ie,re],oe,ne.el,ce,{viewSize:[ae,fe],contentSize:de.slice()})),v.isArray(z))ie=k(z[0],ae),re=k(z[1],fe);else if(v.isObject(z)){z.width=de[0],z.height=de[1];var he=S.getLayoutRect(z,{width:ae,height:fe});ie=he.x,re=he.y,ve=null,pe=null}else if(typeof z=="string"&&se){var Ce=Y(z,ce,de);ie=Ce[0],re=Ce[1]}else{var Ce=J(ie,re,ne,ae,fe,ve?null:20,pe?null:20);ie=Ce[0],re=Ce[1]}if(ve&&(ie-=Q(ve)?de[0]/2:ve==="right"?de[0]:0),pe&&(re-=Q(pe)?de[1]/2:pe==="bottom"?de[1]:0),ee.get("confine")){var Ce=X(ie,re,ne,ae,fe);ie=Ce[0],re=Ce[1]}ne.moveTo(ie,re)},_updateContentNotChangedOnAxis:function(ee){var z=this._lastDataByCoordSys,ie=!!z&&z.length===ee.length;return ie&&F(z,function(re,ne){var oe=re.dataByAxis||{},se=ee[ne]||{},ae=se.dataByAxis||[];ie&=oe.length===ae.length,ie&&F(oe,function(fe,de){var ve=ae[de]||{},pe=fe.seriesDataIndices||[],ce=ve.seriesDataIndices||[];ie&=fe.value===ve.value&&fe.axisType===ve.axisType&&fe.axisId===ve.axisId&&pe.length===ce.length,ie&&F(pe,function(he,Ce){var Se=ce[Ce];ie&=he.seriesIndex===Se.seriesIndex&&he.dataIndex===Se.dataIndex})})}),this._lastDataByCoordSys=ee,!!ie},_hide:function(ee){this._lastDataByCoordSys=null,ee({type:"hideTip",from:this.uid})},dispose:function(ee,z){y.node||(this._tooltipContent.dispose(),I.unregister("itemTooltip",z))}});function j(ee){for(var z=ee.pop();ee.length;){var ie=ee.pop();ie&&(M.isInstance(ie)&&(ie=ie.get("tooltip",!0)),typeof ie=="string"&&(ie={formatter:ie}),z=new M(ie,z,z.ecModel))}return z}function q(ee,z){return ee.dispatchAction||v.bind(z.dispatchAction,z)}function J(ee,z,ie,re,ne,oe,se){var ae=ie.getOuterSize(),fe=ae.width,de=ae.height;return oe!=null&&(ee+fe+oe>re?ee-=fe+oe:ee+=oe),se!=null&&(z+de+se>ne?z-=de+se:z+=se),[ee,z]}function X(ee,z,ie,re,ne){var oe=ie.getOuterSize(),se=oe.width,ae=oe.height;return ee=Math.min(ee+se,re)-se,z=Math.min(z+ae,ne)-ae,ee=Math.max(ee,0),z=Math.max(z,0),[ee,z]}function Y(ee,z,ie){var re=ie[0],ne=ie[1],oe=5,se=0,ae=0,fe=z.width,de=z.height;switch(ee){case"inside":se=z.x+fe/2-re/2,ae=z.y+de/2-ne/2;break;case"top":se=z.x+fe/2-re/2,ae=z.y-ne-oe;break;case"bottom":se=z.x+fe/2-re/2,ae=z.y+de+oe;break;case"left":se=z.x-re-oe,ae=z.y+de/2-ne/2;break;case"right":se=z.x+fe+oe,ae=z.y+de/2-ne/2}return[se,ae]}function Q(ee){return ee==="center"||ee==="middle"}f.exports=G}),FCt=xt(()=>{var o=fo();Qj(),LCt(),NCt(),o.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},function(){}),o.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},function(){})}),BCt=xt((o,f)=>{var m=Wi(),v=["rect","polygon","keep","clear"];function y(C,w){var A=C&&C.brush;if(m.isArray(A)||(A=A?[A]:[]),!!A.length){var E=[];m.each(A,function(P){var D=P.hasOwnProperty("toolbox")?P.toolbox:[];D instanceof Array&&(E=E.concat(D))});var T=C&&C.toolbox;m.isArray(T)&&(T=T[0]),T||(T={feature:{}},C.toolbox=[T]);var S=T.feature||(T.feature={}),M=S.brush||(S.brush={}),I=M.type||(M.type=[]);I.push.apply(I,E),x(I),w&&!I.length&&I.push.apply(I,v)}}function x(C){var w={};m.each(C,function(A){w[A]=1}),C.length=0,m.each(w,function(A,E){C.push(E)})}f.exports=y}),Nie=xt(o=>{var f=Wi(),m=cB(),v=f.each;function y(E){if(E){for(var T in E)if(E.hasOwnProperty(T))return!0}}function x(E,T,S){var M={};return v(T,function(P){var D=M[P]=I();v(E[P],function(L,R){if(m.isValidType(R)){var O={type:R,visual:L};S&&S(O,P),D[R]=new m(O),R==="opacity"&&(O=f.clone(O),O.type="colorAlpha",D.__hidden.__alphaForOpacity=new m(O))}})}),M;function I(){var P=function(){};P.prototype.__hidden=P.prototype;var D=new P;return D}}function C(E,T,S){var M;f.each(S,function(I){T.hasOwnProperty(I)&&y(T[I])&&(M=!0)}),M&&f.each(S,function(I){T.hasOwnProperty(I)&&y(T[I])?E[I]=f.clone(T[I]):delete E[I]})}function w(E,T,S,M,I,P){var D={};f.each(E,function(k){var U=m.prepareVisualTypes(T[k]);D[k]=U});var L;function R(k){return S.getItemVisual(L,k)}function O(k,U){S.setItemVisual(L,k,U)}P==null?S.each(F):S.each([P],F);function F(k,U){L=P==null?k:U;var G=S.getRawDataItem(L);if(!(G&&G.visualMap===!1))for(var j=M.call(I,k),q=T[j],J=D[j],X=0,Y=J.length;X{var m=$8e(),v=Of(),y=xa(),x=y.linePolygonIntersect,C={lineX:w(0),lineY:w(1),rect:{point:function(T,S,M){return T&&M.boundingRect.contain(T[0],T[1])},rect:function(T,S,M){return T&&M.boundingRect.intersect(T)}},polygon:{point:function(T,S,M){return T&&M.boundingRect.contain(T[0],T[1])&&m.contain(M.range,T[0],T[1])},rect:function(T,S,M){var I=M.range;if(!T||I.length<=1)return!1;var P=T.x,D=T.y,L=T.width,R=T.height,O=I[0];if(m.contain(I,P,D)||m.contain(I,P+L,D)||m.contain(I,P,D+R)||m.contain(I,P+L,D+R)||v.create(T).contain(O[0],O[1])||x(P,D,P+L,D,I)||x(P,D,P,D+R,I)||x(P+L,D,P+L,D+R,I)||x(P,D+R,P+L,D+R,I))return!0}}};function w(T){var S=["x","y"],M=["width","height"];return{point:function(I,P,D){if(I){var L=D.range,R=I[T];return A(R,L)}},rect:function(I,P,D){if(I){var L=D.range,R=[I[S[T]],I[S[T]]+I[M[T]]];return R[1]{var f=fo(),m=Wi(),v=Of(),y=Nie(),x=kCt(),C=X3(),w=OGe(),A=["inBrush","outOfBrush"],E="__ecBrushSelect",T="__ecInBrushSelectEvent",S=f.PRIORITY.VISUAL.BRUSH;f.registerLayout(S,function(U,G,j){U.eachComponent({mainType:"brush"},function(q){j&&j.type==="takeGlobalCursor"&&q.setBrushOption(j.key==="brush"?j.brushOption:{brushType:!1})}),M(U)});function M(U){U.eachComponent({mainType:"brush"},function(G){var j=G.brushTargetManager=new w(G.option,U);j.setInputRanges(G.areas,U)})}f.registerVisual(S,function(U,G,j){var q=[],J,X;U.eachComponent({mainType:"brush"},function(Y,Q){var ee={brushId:Y.id,brushIndex:Q,brushName:Y.name,areas:m.clone(Y.areas),selected:[]};q.push(ee);var z=Y.option,ie=z.brushLink,re=[],ne=[],oe=[],se=0;Q||(J=z.throttleType,X=z.throttleDelay);var ae=m.map(Y.areas,function(he){return O(m.defaults({boundingRect:F[he.brushType](he)},he))}),fe=y.createVisualMappings(Y.option,A,function(he){he.mappingMethod="fixed"});m.isArray(ie)&&m.each(ie,function(he){re[he]=1});function de(he){return ie==="all"||re[he]}function ve(he){return!!he.length}U.eachSeries(function(he,Ce){var Se=oe[Ce]=[];he.subType==="parallel"?pe(he,Ce,Se):ce(he,Ce,Se)});function pe(he,Ce){var Se=he.coordinateSystem;se|=Se.hasAxisBrushed(),de(Ce)&&Se.eachActiveState(he.getData(),function(De,Oe){De==="active"&&(ne[Oe]=1)})}function ce(he,Ce,Se){var De=L(he);if(!(!De||R(Y,Ce))&&(m.each(ae,function(Ue){De[Ue.brushType]&&Y.brushTargetManager.controlSeries(Ue,he,U)&&Se.push(Ue),se|=ve(Se)}),de(Ce)&&ve(Se))){var Oe=he.getData();Oe.each(function(Ue){D(De,Se,Oe,Ue)&&(ne[Ue]=1)})}}U.eachSeries(function(he,Ce){var Se={seriesId:he.id,seriesIndex:Ce,seriesName:he.name,dataIndex:[]};ee.selected.push(Se);var De=L(he),Oe=oe[Ce],Ue=he.getData(),Xe=de(Ce)?function(it){return ne[it]?(Se.dataIndex.push(Ue.getRawIndex(it)),"inBrush"):"outOfBrush"}:function(it){return D(De,Oe,Ue,it)?(Se.dataIndex.push(Ue.getRawIndex(it)),"inBrush"):"outOfBrush"};(de(Ce)?se:ve(Oe))&&y.applyVisual(A,fe,Ue,Xe)})}),I(G,J,X,q,j)});function I(U,G,j,q,J){if(J){var X=U.getZr();if(!X[T]){X[E]||(X[E]=P);var Y=C.createOrUpdate(X,E,j,G);Y(U,q)}}}function P(U,G){if(!U.isDisposed()){var j=U.getZr();j[T]=!0,U.dispatchAction({type:"brushSelect",batch:G}),j[T]=!1}}function D(U,G,j,q){for(var J=0,X=G.length;JG[0][1]&&(G[0][1]=X[0]),X[1]G[1][1]&&(G[1][1]=X[1])}return G&&k(G)}};function k(U){return new v(U[0][0],U[1][0],U[0][1]-U[0][0],U[1][1]-U[1][0])}o.layoutCovers=M}),VCt=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=fo(),x=Wi(),C=Nie(),w=Sm(),A=["#ddd"],E=y.extendComponentModel({type:"brush",dependencies:["geo","grid","xAxis","yAxis","parallel","series"],defaultOption:{toolbox:null,brushLink:null,seriesIndex:"all",geoIndex:null,xAxisIndex:null,yAxisIndex:null,brushType:"rect",brushMode:"single",transformable:!0,brushStyle:{borderWidth:1,color:"rgba(120,140,180,0.3)",borderColor:"rgba(120,140,180,0.8)"},throttleType:"fixRate",throttleDelay:0,removeOnClick:!0,z:1e4},areas:[],brushType:null,brushOption:{},coordInfoList:[],optionUpdated:function(M,I){var P=this.option;!I&&C.replaceVisualOption(P,M,["inBrush","outOfBrush"]);var D=P.inBrush=P.inBrush||{};P.outOfBrush=P.outOfBrush||{color:A},D.hasOwnProperty("liftZ")||(D.liftZ=5)},setAreas:function(M){M&&(this.areas=x.map(M,function(I){return T(this.option,I)},this))},setBrushOption:function(M){this.brushOption=T(this.option,M),this.brushType=this.brushOption.brushType}});function T(M,I){return x.merge({brushType:M.brushType,brushMode:M.brushMode,transformable:M.transformable,brushStyle:new w(M.brushStyle).getItemStyle(),removeOnClick:M.removeOnClick,z:M.z},I,!0)}var S=E;f.exports=S}),zCt=xt((o,f)=>{var m=fo(),v=Wi(),y=O0e(),x=FGe(),C=x.layoutCovers,w=m.extendComponentView({type:"brush",init:function(E,T){this.ecModel=E,this.api=T,this.model,(this._brushController=new y(T.getZr())).on("brush",v.bind(this._onBrush,this)).mount()},render:function(E){return this.model=E,A.apply(this,arguments)},updateTransform:function(E,T){return C(T),A.apply(this,arguments)},updateView:A,dispose:function(){this._brushController.dispose()},_onBrush:function(E,T){var S=this.model.id;this.model.brushTargetManager.setOutputRanges(E,this.ecModel),(!T.isEnd||T.removeOnClick)&&this.api.dispatchAction({type:"brush",brushId:S,areas:v.clone(E),$from:S}),T.isEnd&&this.api.dispatchAction({type:"brushEnd",brushId:S,areas:v.clone(E),$from:S})}});function A(E,T,S,M){(!M||M.$from!==E.id)&&this._brushController.setPanels(E.brushTargetManager.makePanelOpts(S)).enableBrush(E.brushOption).updateCovers(E.areas.slice())}f.exports=w}),HCt=xt(()=>{var o=fo();o.registerAction({type:"brush",event:"brush"},function(f,m){m.eachComponent({mainType:"brush",query:f},function(v){v.setAreas(f.areas)})}),o.registerAction({type:"brushSelect",event:"brushSelected",update:"none"},function(){}),o.registerAction({type:"brushEnd",event:"brushEnd",update:"none"},function(){})}),UCt=xt((o,f)=>{var m=Wi(),v=Z3(),y=J3(),x=y.toolbox.brush;function C(E,T,S){this.model=E,this.ecModel=T,this.api=S,this._brushType,this._brushMode}C.defaultOption={show:!0,type:["rect","polygon","lineX","lineY","keep","clear"],icon:{rect:"M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13",polygon:"M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2",lineX:"M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4",lineY:"M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4",keep:"M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z",clear:"M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2"},title:m.clone(x.title)};var w=C.prototype;w.render=w.updateView=function(E,T,S){var M,I,P;T.eachComponent({mainType:"brush"},function(D){M=D.brushType,I=D.brushOption.brushMode||"single",P|=D.areas.length}),this._brushType=M,this._brushMode=I,m.each(E.get("type",!0),function(D){E.setIconStatus(D,(D==="keep"?I==="multiple":D==="clear"?P:D===M)?"emphasis":"normal")})},w.getIcons=function(){var E=this.model,T=E.get("icon",!0),S={};return m.each(E.get("type",!0),function(M){T[M]&&(S[M]=T[M])}),S},w.onclick=function(E,T,S){var M=this._brushType,I=this._brushMode;S==="clear"?(T.dispatchAction({type:"axisAreaSelect",intervals:[]}),T.dispatchAction({type:"brush",command:"clear",areas:[]})):T.dispatchAction({type:"takeGlobalCursor",key:"brush",brushOption:{brushType:S==="keep"?M:M===S?!1:S,brushMode:S==="keep"?I==="multiple"?"single":"multiple":I}})},v.register("brush",C);var A=C;f.exports=A}),GCt=xt(()=>{var o=fo(),f=BCt();FGe(),VCt(),zCt(),HCt(),UCt(),o.registerPreprocessor(f)}),WCt=xt(()=>{var o=Wi(),f=fo(),m=xa(),v=rd(),y=v.getLayoutRect,x=fd(),C=x.windowOpen;f.extendComponentModel({type:"title",layoutMode:{type:"box",ignoreSize:!0},defaultOption:{zlevel:0,z:6,show:!0,text:"",target:"blank",subtext:"",subtarget:"blank",left:0,top:0,backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:"bolder",color:"#333"},subtextStyle:{color:"#aaa"}}}),f.extendComponentView({type:"title",render:function(w,A,E){if(this.group.removeAll(),!!w.get("show")){var T=this.group,S=w.getModel("textStyle"),M=w.getModel("subtextStyle"),I=w.get("textAlign"),P=o.retrieve2(w.get("textBaseline"),w.get("textVerticalAlign")),D=new m.Text({style:m.setTextStyle({},S,{text:w.get("text"),textFill:S.getTextColor()},{disableBox:!0}),z2:10}),L=D.getBoundingRect(),R=w.get("subtext"),O=new m.Text({style:m.setTextStyle({},M,{text:R,textFill:M.getTextColor(),y:L.height+w.get("itemGap"),textVerticalAlign:"top"},{disableBox:!0}),z2:10}),F=w.get("link"),k=w.get("sublink"),U=w.get("triggerEvent",!0);D.silent=!F&&!U,O.silent=!k&&!U,F&&D.on("click",function(){C(F,"_"+w.get("target"))}),k&&O.on("click",function(){C(F,"_"+w.get("subtarget"))}),D.eventData=O.eventData=U?{componentType:"title",componentIndex:w.componentIndex}:null,T.add(D),R&&T.add(O);var G=T.getBoundingRect(),j=w.getBoxLayoutParams();j.width=G.width,j.height=G.height;var q=y(j,{width:E.getWidth(),height:E.getHeight()},w.get("padding"));I||(I=w.get("left")||w.get("right"),I==="middle"&&(I="center"),I==="right"?q.x+=q.width:I==="center"&&(q.x+=q.width/2)),P||(P=w.get("top")||w.get("bottom"),P==="center"&&(P="middle"),P==="bottom"?q.y+=q.height:P==="middle"&&(q.y+=q.height/2),P=P||"top"),T.attr("position",[q.x,q.y]);var J={textAlign:I,textVerticalAlign:P};D.setStyle(J),O.setStyle(J),G=T.getBoundingRect();var X=q.margin,Y=w.getItemStyle(["color","opacity"]);Y.fill=w.get("backgroundColor");var Q=new m.Rect({shape:{x:G.x-X[3],y:G.y-X[0],width:G.width+X[1]+X[3],height:G.height+X[0]+X[2],r:w.get("borderRadius")},style:Y,subPixelOptimize:!0,silent:!0});T.add(Q)}}})}),jCt=xt((o,f)=>{var m=Wi();function v(w){var A=w&&w.timeline;m.isArray(A)||(A=A?[A]:[]),m.each(A,function(E){E&&y(E)})}function y(w){var A=w.type,E={number:"value",time:"time"};if(E[A]&&(w.axisType=E[A],delete w.type),x(w),C(w,"controlPosition")){var T=w.controlStyle||(w.controlStyle={});C(T,"position")||(T.position=w.controlPosition),T.position==="none"&&!C(T,"show")&&(T.show=!1,delete T.position),delete w.controlPosition}m.each(w.data||[],function(S){m.isObject(S)&&!m.isArray(S)&&(!C(S,"value")&&C(S,"name")&&(S.value=S.name),x(S))})}function x(w){var A=w.itemStyle||(w.itemStyle={}),E=A.emphasis||(A.emphasis={}),T=w.label||w.label||{},S=T.normal||(T.normal={}),M={normal:1,emphasis:1};m.each(T,function(I,P){!M[P]&&!C(S,P)&&(S[P]=I)}),E.label&&!C(T,"emphasis")&&(T.emphasis=E.label,delete E.label)}function C(w,A){return w.hasOwnProperty(A)}f.exports=v}),YCt=xt(()=>{var o=Xg();o.registerSubTypeDefaulter("timeline",function(){return"slider"})}),qCt=xt(()=>{var o=fo(),f=Wi();o.registerAction({type:"timelineChange",event:"timelineChanged",update:"prepareAndUpdate"},function(m,v){var y=v.getComponent("timeline");return y&&m.currentIndex!=null&&(y.setCurrentIndex(m.currentIndex),!y.get("loop",!0)&&y.isIndexMax()&&y.setPlayState(!1)),v.resetOption("timeline"),f.defaults({currentIndex:y.option.currentIndex},m)}),o.registerAction({type:"timelinePlayChange",event:"timelinePlayChanged",update:"update"},function(m,v){var y=v.getComponent("timeline");y&&m.playState!=null&&y.setPlayState(m.playState)})}),XCt=xt((o,f)=>{var m=Wi(),v=Xg(),y=Yw(),x=vu(),C=v.extend({type:"timeline",layoutMode:"box",defaultOption:{zlevel:0,z:4,show:!0,axisType:"time",realtime:!0,left:"20%",top:null,right:"20%",bottom:0,width:null,height:40,padding:5,controlPosition:"left",autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:"#000"},data:[]},init:function(A,E,T){this._data,this._names,this.mergeDefaultAndTheme(A,T),this._initData()},mergeOption:function(A){C.superApply(this,"mergeOption",arguments),this._initData()},setCurrentIndex:function(A){A==null&&(A=this.option.currentIndex);var E=this._data.count();this.option.loop?A=(A%E+E)%E:(A>=E&&(A=E-1),A<0&&(A=0)),this.option.currentIndex=A},getCurrentIndex:function(){return this.option.currentIndex},isIndexMax:function(){return this.getCurrentIndex()>=this._data.count()-1},setPlayState:function(A){this.option.autoPlay=!!A},getPlayState:function(){return!!this.option.autoPlay},_initData:function(){var A=this.option,E=A.data||[],T=A.axisType,S=this._names=[];if(T==="category"){var M=[];m.each(E,function(D,L){var R=x.getDataItemValue(D),O;m.isObject(D)?(O=m.clone(D),O.value=L):O=L,M.push(O),!m.isString(R)&&(R==null||isNaN(R))&&(R=""),S.push(R+"")}),E=M}var I={category:"ordinal",time:"time"}[T]||"number",P=this._data=new y([{name:"value",type:I}],this);P.initData(E,S)},getData:function(){return this._data},getCategories:function(){if(this.get("axisType")==="category")return this._names.slice()}}),w=C;f.exports=w}),JCt=xt((o,f)=>{var m=Wi(),v=XCt(),y=x0e(),x=v.extend({type:"timeline.slider",defaultOption:{backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderWidth:0,orient:"horizontal",inverse:!1,tooltip:{trigger:"item"},symbol:"emptyCircle",symbolSize:10,lineStyle:{show:!0,width:2,color:"#304654"},label:{position:"auto",show:!0,interval:"auto",rotate:0,color:"#304654"},itemStyle:{color:"#304654",borderWidth:1},checkpointStyle:{symbol:"circle",symbolSize:13,color:"#c23531",borderWidth:5,borderColor:"rgba(194,53,49, 0.5)",animation:!0,animationDuration:300,animationEasing:"quinticInOut"},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:22,itemGap:12,position:"left",playIcon:"path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z",stopIcon:"path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z",nextIcon:"path://M18.6,50.8l22.5-22.5c0.2-0.2,0.3-0.4,0.3-0.7c0-0.3-0.1-0.5-0.3-0.7L18.7,4.4c-0.1-0.1-0.2-0.3-0.2-0.5 c0-0.4,0.3-0.8,0.8-0.8c0.2,0,0.5,0.1,0.6,0.3l23.5,23.5l0,0c0.2,0.2,0.3,0.4,0.3,0.7c0,0.3-0.1,0.5-0.3,0.7l-0.1,0.1L19.7,52 c-0.1,0.1-0.3,0.2-0.5,0.2c-0.4,0-0.8-0.3-0.8-0.8C18.4,51.2,18.5,51,18.6,50.8z",prevIcon:"path://M43,52.8L20.4,30.3c-0.2-0.2-0.3-0.4-0.3-0.7c0-0.3,0.1-0.5,0.3-0.7L42.9,6.4c0.1-0.1,0.2-0.3,0.2-0.5 c0-0.4-0.3-0.8-0.8-0.8c-0.2,0-0.5,0.1-0.6,0.3L18.3,28.8l0,0c-0.2,0.2-0.3,0.4-0.3,0.7c0,0.3,0.1,0.5,0.3,0.7l0.1,0.1L41.9,54 c0.1,0.1,0.3,0.2,0.5,0.2c0.4,0,0.8-0.3,0.8-0.8C43.2,53.2,43.1,53,43,52.8z",color:"#304654",borderColor:"#304654",borderWidth:1},emphasis:{label:{show:!0,color:"#c23531"},itemStyle:{color:"#c23531"},controlStyle:{color:"#c23531",borderColor:"#c23531",borderWidth:2}},data:[]}});m.mixin(x,y);var C=x;f.exports=C}),KCt=xt((o,f)=>{var m=Aie(),v=m.extend({type:"timeline"});f.exports=v}),QCt=xt((o,f)=>{var m=Wi(),v=K3(),y=function(C,w,A,E){v.call(this,C,w,A),this.type=E||"value",this.model=null};y.prototype={constructor:y,getLabelModel:function(){return this.model.getModel("label")},isHorizontal:function(){return this.model.get("orient")==="horizontal"}},m.inherits(y,v);var x=y;f.exports=x}),ZCt=xt((o,f)=>{var m=Wi(),v=Of(),y=Ky(),x=xa(),C=rd(),w=KCt(),A=QCt(),E=qw(),T=E.createSymbol,S=sT(),M=il(),I=fd(),P=I.encodeHTML,D=m.bind,L=m.each,R=Math.PI,O=w.extend({type:"timeline.slider",init:function(j,q){this.api=q,this._axis,this._viewRect,this._timer,this._currentPointer,this._mainGroup,this._labelGroup},render:function(j,q,J,X){if(this.model=j,this.api=J,this.ecModel=q,this.group.removeAll(),j.get("show",!0)){var Y=this._layout(j,J),Q=this._createGroup("mainGroup"),ee=this._createGroup("labelGroup"),z=this._axis=this._createAxis(Y,j);j.formatTooltip=function(ie){return P(z.scale.getLabel(ie))},L(["AxisLine","AxisTick","Control","CurrentPointer"],function(ie){this["_render"+ie](Y,Q,z,j)},this),this._renderAxisLabel(Y,ee,z,j),this._position(Y,j)}this._doPlayStop()},remove:function(){this._clearTimer(),this.group.removeAll()},dispose:function(){this._clearTimer()},_layout:function(j,q){var J=j.get("label.position"),X=j.get("orient"),Y=F(j,q);J==null||J==="auto"?J=X==="horizontal"?Y.y+Y.height/2=0||J==="+"?"left":"right"},ee={horizontal:J>=0||J==="+"?"top":"bottom",vertical:"middle"},z={horizontal:0,vertical:R/2},ie=X==="vertical"?Y.height:Y.width,re=j.getModel("controlStyle"),ne=re.get("show",!0),oe=ne?re.get("itemSize"):0,se=ne?re.get("itemGap"):0,ae=oe+se,fe=j.get("label.rotate")||0;fe=fe*R/180;var de,ve,pe,ce,he=re.get("position",!0),Ce=ne&&re.get("showPlayBtn",!0),Se=ne&&re.get("showPrevBtn",!0),De=ne&&re.get("showNextBtn",!0),Oe=0,Ue=ie;return he==="left"||he==="bottom"?(Ce&&(de=[0,0],Oe+=ae),Se&&(ve=[Oe,0],Oe+=ae),De&&(pe=[Ue-oe,0],Ue-=ae)):(Ce&&(de=[Ue-oe,0],Ue-=ae),Se&&(ve=[0,0],Oe+=ae),De&&(pe=[Ue-oe,0],Ue-=ae)),ce=[Oe,Ue],j.get("inverse")&&ce.reverse(),{viewRect:Y,mainLength:ie,orient:X,rotation:z[X],labelRotation:fe,labelPosOpt:J,labelAlign:j.get("label.align")||Q[X],labelBaseline:j.get("label.verticalAlign")||j.get("label.baseline")||ee[X],playPosition:de,prevBtnPosition:ve,nextBtnPosition:pe,axisExtent:ce,controlSize:oe,controlGap:se}},_position:function(j,q){var J=this._mainGroup,X=this._labelGroup,Y=j.viewRect;if(j.orient==="vertical"){var Q=y.create(),ee=Y.x,z=Y.y+Y.height;y.translate(Q,Q,[-ee,-z]),y.rotate(Q,Q,-R/2),y.translate(Q,Q,[ee,z]),Y=Y.clone(),Y.applyTransform(Q)}var ie=ve(Y),re=ve(J.getBoundingRect()),ne=ve(X.getBoundingRect()),oe=J.position,se=X.position;se[0]=oe[0]=ie[0][0];var ae=j.labelPosOpt;if(isNaN(ae)){var fe=ae==="+"?0:1;pe(oe,re,ie,1,fe),pe(se,ne,ie,1,1-fe)}else{var fe=ae>=0?0:1;pe(oe,re,ie,1,fe),se[1]=oe[1]+ae}J.attr("position",oe),X.attr("position",se),J.rotation=X.rotation=j.rotation,de(J),de(X);function de(ce){var he=ce.position;ce.origin=[ie[0][0]-he[0],ie[1][0]-he[1]]}function ve(ce){return[[ce.x,ce.x+ce.width],[ce.y,ce.y+ce.height]]}function pe(ce,he,Ce,Se,De){ce[Se]+=Ce[Se][De]-he[Se][De]}},_createAxis:function(j,q){var J=q.getData(),X=q.get("axisType"),Y=S.createScaleByModel(q,X);Y.getTicks=function(){return J.mapArray(["value"],function(z){return z})};var Q=J.getDataExtent("value");Y.setExtent(Q[0],Q[1]),Y.niceTicks();var ee=new A("value",Y,j.axisExtent,X);return ee.model=q,ee},_createGroup:function(j){var q=this["_"+j]=new x.Group;return this.group.add(q),q},_renderAxisLine:function(j,q,J,X){var Y=J.getExtent();X.get("lineStyle.show")&&q.add(new x.Line({shape:{x1:Y[0],y1:0,x2:Y[1],y2:0},style:m.extend({lineCap:"round"},X.getModel("lineStyle").getLineStyle()),silent:!0,z2:1}))},_renderAxisTick:function(j,q,J,X){var Y=X.getData(),Q=J.scale.getTicks();L(Q,function(ee){var z=J.dataToCoord(ee),ie=Y.getItemModel(ee),re=ie.getModel("itemStyle"),ne=ie.getModel("emphasis.itemStyle"),oe={position:[z,0],onclick:D(this._changeTimeline,this,ee)},se=U(ie,re,q,oe);x.setHoverStyle(se,ne.getItemStyle()),ie.get("tooltip")?(se.dataIndex=ee,se.dataModel=X):se.dataIndex=se.dataModel=null},this)},_renderAxisLabel:function(j,q,J,X){var Y=J.getLabelModel();if(Y.get("show")){var Q=X.getData(),ee=J.getViewLabels();L(ee,function(z){var ie=z.tickValue,re=Q.getItemModel(ie),ne=re.getModel("label"),oe=re.getModel("emphasis.label"),se=J.dataToCoord(z.tickValue),ae=new x.Text({position:[se,0],rotation:j.labelRotation-j.rotation,onclick:D(this._changeTimeline,this,ie),silent:!1});x.setTextStyle(ae.style,ne,{text:z.formattedLabel,textAlign:j.labelAlign,textVerticalAlign:j.labelBaseline}),q.add(ae),x.setHoverStyle(ae,x.setTextStyle({},oe))},this)}},_renderControl:function(j,q,J,X){var Y=j.controlSize,Q=j.rotation,ee=X.getModel("controlStyle").getItemStyle(),z=X.getModel("emphasis.controlStyle").getItemStyle(),ie=[0,-Y/2,Y,Y],re=X.getPlayState(),ne=X.get("inverse",!0);oe(j.nextBtnPosition,"controlStyle.nextIcon",D(this._changeTimeline,this,ne?"-":"+")),oe(j.prevBtnPosition,"controlStyle.prevIcon",D(this._changeTimeline,this,ne?"+":"-")),oe(j.playPosition,"controlStyle."+(re?"stopIcon":"playIcon"),D(this._handlePlayClick,this,!re),!0);function oe(se,ae,fe,de){if(se){var ve={position:se,origin:[Y/2,0],rotation:de?-Q:0,rectHover:!0,style:ee,onclick:fe},pe=k(X,ae,ie,ve);q.add(pe),x.setHoverStyle(pe,z)}}},_renderCurrentPointer:function(j,q,J,X){var Y=X.getData(),Q=X.getCurrentIndex(),ee=Y.getItemModel(Q).getModel("checkpointStyle"),z=this,ie={onCreate:function(re){re.draggable=!0,re.drift=D(z._handlePointerDrag,z),re.ondragend=D(z._handlePointerDragend,z),G(re,Q,J,X,!0)},onUpdate:function(re){G(re,Q,J,X)}};this._currentPointer=U(ee,ee,this._mainGroup,{},this._currentPointer,ie)},_handlePlayClick:function(j){this._clearTimer(),this.api.dispatchAction({type:"timelinePlayChange",playState:j,from:this.uid})},_handlePointerDrag:function(j,q,J){this._clearTimer(),this._pointerChangeTimeline([J.offsetX,J.offsetY])},_handlePointerDragend:function(j){this._pointerChangeTimeline([j.offsetX,j.offsetY],!0)},_pointerChangeTimeline:function(j,q){var J=this._toAxisCoord(j)[0],X=this._axis,Y=M.asc(X.getExtent().slice());J>Y[1]&&(J=Y[1]),J{var o=fo(),f=jCt();YCt(),qCt(),JCt(),ZCt(),o.registerPreprocessor(f)}),H0e=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=fo(),x=Wi(),C=Tm(),w=vu(),A=fd(),E=x0e(),T=A.addCommas,S=A.encodeHTML;function M(D){w.defaultEmphasis(D,"label",["show"])}var I=y.extendComponentModel({type:"marker",dependencies:["series","grid","polar","geo"],init:function(D,L,R){this.mergeDefaultAndTheme(D,R),this._mergeOption(D,R,!1,!0)},isAnimationEnabled:function(){if(C.node)return!1;var D=this.__hostSeries;return this.getShallow("animation")&&D&&D.isAnimationEnabled()},mergeOption:function(D,L){this._mergeOption(D,L,!1,!1)},_mergeOption:function(D,L,R,O){var F=this.constructor,k=this.mainType+"Model";R||L.eachSeries(function(U){var G=U.get(this.mainType,!0),j=U[k];if(!G||!G.data){U[k]=null;return}j?j._mergeOption(G,L,!0):(O&&M(G),x.each(G.data,function(q){q instanceof Array?(M(q[0]),M(q[1])):M(q)}),j=new F(G,this,L),x.extend(j,{mainType:this.mainType,seriesIndex:U.seriesIndex,name:U.name,createdBySelf:!0}),j.__hostSeries=U),U[k]=j},this)},formatTooltip:function(D){var L=this.getData(),R=this.getRawValue(D),O=x.isArray(R)?x.map(R,T).join(", "):T(R),F=L.getName(D),k=S(this.name);return(R!=null||F)&&(k+="
"),F&&(k+=S(F),R!=null&&(k+=" : ")),R!=null&&(k+=S(O)),k},getData:function(){return this._data},setData:function(D){this._data=D}});x.mixin(I,E);var P=I;f.exports=P}),e1t=xt((o,f)=>{var m=H0e(),v=m.extend({type:"markPoint",defaultOption:{zlevel:0,z:5,symbol:"pin",symbolSize:50,tooltip:{trigger:"item"},label:{show:!0,position:"inside"},itemStyle:{borderWidth:2},emphasis:{label:{show:!0}}}});f.exports=v}),U0e=xt(o=>{var f=Wi(),m=il(),v=z2(),y=v.isDimensionStacked,x=f.indexOf;function C(R){return!(isNaN(parseFloat(R.x))&&isNaN(parseFloat(R.y)))}function w(R){return!isNaN(parseFloat(R.x))&&!isNaN(parseFloat(R.y))}function A(R,O,F,k,U,G){var j=[],q=y(O,k),J=q?O.getCalculationInfo("stackResultDimension"):k,X=L(O,J,R),Y=O.indicesOfNearest(J,X)[0];j[U]=O.get(F,Y),j[G]=O.get(J,Y);var Q=O.get(k,Y),ee=m.getPrecision(O.get(k,Y));return ee=Math.min(ee,20),ee>=0&&(j[G]=+j[G].toFixed(ee)),[j,Q]}var E=f.curry,T={min:E(A,"min"),max:E(A,"max"),average:E(A,"average")};function S(R,O){var F=R.getData(),k=R.coordinateSystem;if(O&&!w(O)&&!f.isArray(O.coord)&&k){var U=k.dimensions,G=M(O,F,k,R);if(O=f.clone(O),O.type&&T[O.type]&&G.baseAxis&&G.valueAxis){var j=x(U,G.baseAxis.dim),q=x(U,G.valueAxis.dim),J=T[O.type](F,G.baseDataDim,G.valueDataDim,j,q);O.coord=J[0],O.value=J[1]}else{for(var X=[O.xAxis!=null?O.xAxis:O.radiusAxis,O.yAxis!=null?O.yAxis:O.angleAxis],Y=0;Y<2;Y++)T[X[Y]]&&(X[Y]=L(F,F.mapDimension(U[Y]),X[Y]));O.coord=X}}return O}function M(R,O,F,k){var U={};return R.valueIndex!=null||R.valueDim!=null?(U.valueDataDim=R.valueIndex!=null?O.getDimension(R.valueIndex):R.valueDim,U.valueAxis=F.getAxis(I(k,U.valueDataDim)),U.baseAxis=F.getOtherAxis(U.valueAxis),U.baseDataDim=O.mapDimension(U.baseAxis.dim)):(U.baseAxis=k.getBaseAxis(),U.valueAxis=F.getOtherAxis(U.baseAxis),U.baseDataDim=O.mapDimension(U.baseAxis.dim),U.valueDataDim=O.mapDimension(U.valueAxis.dim)),U}function I(R,O){var F=R.getData(),k=F.dimensions;O=F.getDimension(O);for(var U=0;U{var m=fo(),v=Wi(),y=m.extendComponentView({type:"marker",init:function(){this.markerGroupMap=v.createHashMap()},render:function(x,C,w){var A=this.markerGroupMap;A.each(function(T){T.__keep=!1});var E=this.type+"Model";C.eachSeries(function(T){var S=T[E];S&&this.renderSeries(T,S,C,w)},this),A.each(function(T){!T.__keep&&this.group.remove(T.group)},this)},renderSeries:function(){}});f.exports=y}),t1t=xt((o,f)=>{var m=Wi(),v=Wj(),y=il(),x=Yw(),C=U0e(),w=G0e();function A(S,M,I){var P=M.coordinateSystem;S.each(function(D){var L=S.getItemModel(D),R,O=y.parsePercent(L.get("x"),I.getWidth()),F=y.parsePercent(L.get("y"),I.getHeight());if(!isNaN(O)&&!isNaN(F))R=[O,F];else if(M.getMarkerPosition)R=M.getMarkerPosition(S.getValues(S.dimensions,D));else if(P){var k=S.get(P.dimensions[0],D),U=S.get(P.dimensions[1],D);R=P.dataToPoint([k,U])}isNaN(O)||(R[0]=O),isNaN(F)||(R[1]=F),S.setItemLayout(D,R)})}var E=w.extend({type:"markPoint",updateTransform:function(S,M,I){M.eachSeries(function(P){var D=P.markPointModel;D&&(A(D.getData(),P,I),this.markerGroupMap.get(P.id).updateLayout(D))},this)},renderSeries:function(S,M,I,P){var D=S.coordinateSystem,L=S.id,R=S.getData(),O=this.markerGroupMap,F=O.get(L)||O.set(L,new v),k=T(D,S,M);M.setData(k),A(M.getData(),S,P),k.each(function(U){var G=k.getItemModel(U),j=G.getShallow("symbol"),q=G.getShallow("symbolSize"),J=m.isFunction(j),X=m.isFunction(q);if(J||X){var Y=M.getRawValue(U),Q=M.getDataParams(U);J&&(j=j(Y,Q)),X&&(q=q(Y,Q))}k.setItemVisual(U,{symbol:j,symbolSize:q,color:G.get("itemStyle.color")||R.getVisual("color")})}),F.updateData(k),this.group.add(F.group),k.eachItemGraphicEl(function(U){U.traverse(function(G){G.dataModel=M})}),F.__keep=!0,F.group.silent=M.get("silent")||S.get("silent")}});function T(S,M,I){var P;S?P=m.map(S&&S.dimensions,function(R){var O=M.getData().getDimensionInfo(M.getData().mapDimension(R))||{};return m.defaults({name:R},O)}):P=[{name:"value",type:"float"}];var D=new x(P,I),L=m.map(I.get("data"),m.curry(C.dataTransform,M));return S&&(L=m.filter(L,m.curry(C.dataFilter,S))),D.initData(L,null,S?C.dimValueGetter:function(R){return R.value}),D}f.exports=E}),i1t=xt(()=>{var o=fo();e1t(),t1t(),o.registerPreprocessor(function(f){f.markPoint=f.markPoint||{}})}),r1t=xt((o,f)=>{var m=H0e(),v=m.extend({type:"markLine",defaultOption:{zlevel:0,z:5,symbol:["circle","arrow"],symbolSize:[8,16],precision:2,tooltip:{trigger:"item"},label:{show:!0,position:"end",distance:5},lineStyle:{type:"dashed"},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:"linear"}});f.exports=v}),n1t=xt((o,f)=>{var m=Wi(),v=Yw(),y=il(),x=U0e(),C=L0e(),w=G0e(),A=z2(),E=A.getStackedDimension,T=function(R,O,F,k){var U=R.getData(),G=k.type;if(!m.isArray(k)&&(G==="min"||G==="max"||G==="average"||G==="median"||k.xAxis!=null||k.yAxis!=null)){var j,q;if(k.yAxis!=null||k.xAxis!=null)j=O.getAxis(k.yAxis!=null?"y":"x"),q=m.retrieve(k.yAxis,k.xAxis);else{var J=x.getAxisInfo(k,U,O,R);j=J.valueAxis;var X=E(U,J.valueDataDim);q=x.numCalculate(U,X,G)}var Y=j.dim==="x"?0:1,Q=1-Y,ee=m.clone(k),z={};ee.type=null,ee.coord=[],z.coord=[],ee.coord[Q]=-1/0,z.coord[Q]=1/0;var ie=F.get("precision");ie>=0&&typeof q=="number"&&(q=+q.toFixed(Math.min(ie,20))),ee.coord[Y]=z.coord[Y]=q,k=[ee,z,{type:G,valueIndex:k.valueIndex,value:q}]}return k=[x.dataTransform(R,k[0]),x.dataTransform(R,k[1]),m.extend({},k[2])],k[2].type=k[2].type||"",m.merge(k[2],k[0]),m.merge(k[2],k[1]),k};function S(R){return!isNaN(R)&&!isFinite(R)}function M(R,O,F,k){var U=1-R,G=k.dimensions[R];return S(O[U])&&S(F[U])&&O[R]===F[R]&&k.getAxis(G).containData(O[R])}function I(R,O){if(R.type==="cartesian2d"){var F=O[0].coord,k=O[1].coord;if(F&&k&&(M(1,F,k,R)||M(0,F,k,R)))return!0}return x.dataFilter(R,O[0])&&x.dataFilter(R,O[1])}function P(R,O,F,k,U){var G=k.coordinateSystem,j=R.getItemModel(O),q,J=y.parsePercent(j.get("x"),U.getWidth()),X=y.parsePercent(j.get("y"),U.getHeight());if(!isNaN(J)&&!isNaN(X))q=[J,X];else{if(k.getMarkerPosition)q=k.getMarkerPosition(R.getValues(R.dimensions,O));else{var Y=G.dimensions,Q=R.get(Y[0],O),ee=R.get(Y[1],O);q=G.dataToPoint([Q,ee])}if(G.type==="cartesian2d"){var z=G.getAxis("x"),ie=G.getAxis("y"),Y=G.dimensions;S(R.get(Y[0],O))?q[0]=z.toGlobalCoord(z.getExtent()[F?0:1]):S(R.get(Y[1],O))&&(q[1]=ie.toGlobalCoord(ie.getExtent()[F?0:1]))}isNaN(J)||(q[0]=J),isNaN(X)||(q[1]=X)}R.setItemLayout(O,q)}var D=w.extend({type:"markLine",updateTransform:function(R,O,F){O.eachSeries(function(k){var U=k.markLineModel;if(U){var G=U.getData(),j=U.__from,q=U.__to;j.each(function(J){P(j,J,!0,k,F),P(q,J,!1,k,F)}),G.each(function(J){G.setItemLayout(J,[j.getItemLayout(J),q.getItemLayout(J)])}),this.markerGroupMap.get(k.id).updateLayout()}},this)},renderSeries:function(R,O,F,k){var U=R.coordinateSystem,G=R.id,j=R.getData(),q=this.markerGroupMap,J=q.get(G)||q.set(G,new C);this.group.add(J.group);var X=L(U,R,O),Y=X.from,Q=X.to,ee=X.line;O.__from=Y,O.__to=Q,O.setData(ee);var z=O.get("symbol"),ie=O.get("symbolSize");m.isArray(z)||(z=[z,z]),typeof ie=="number"&&(ie=[ie,ie]),X.from.each(function(ne){re(Y,ne,!0),re(Q,ne,!1)}),ee.each(function(ne){var oe=ee.getItemModel(ne).get("lineStyle.color");ee.setItemVisual(ne,{color:oe||Y.getItemVisual(ne,"color")}),ee.setItemLayout(ne,[Y.getItemLayout(ne),Q.getItemLayout(ne)]),ee.setItemVisual(ne,{fromSymbolSize:Y.getItemVisual(ne,"symbolSize"),fromSymbol:Y.getItemVisual(ne,"symbol"),toSymbolSize:Q.getItemVisual(ne,"symbolSize"),toSymbol:Q.getItemVisual(ne,"symbol")})}),J.updateData(ee),X.line.eachItemGraphicEl(function(ne,oe){ne.traverse(function(se){se.dataModel=O})});function re(ne,oe,se){var ae=ne.getItemModel(oe);P(ne,oe,se,R,k),ne.setItemVisual(oe,{symbolSize:ae.get("symbolSize")||ie[se?0:1],symbol:ae.get("symbol",!0)||z[se?0:1],color:ae.get("itemStyle.color")||j.getVisual("color")})}J.__keep=!0,J.group.silent=O.get("silent")||R.get("silent")}});function L(R,O,F){var k;R?k=m.map(R&&R.dimensions,function(X){var Y=O.getData().getDimensionInfo(O.getData().mapDimension(X))||{};return m.defaults({name:X},Y)}):k=[{name:"value",type:"float"}];var U=new v(k,F),G=new v(k,F),j=new v([],F),q=m.map(F.get("data"),m.curry(T,O,R,F));R&&(q=m.filter(q,m.curry(I,R)));var J=R?x.dimValueGetter:function(X){return X.value};return U.initData(m.map(q,function(X){return X[0]}),null,J),G.initData(m.map(q,function(X){return X[1]}),null,J),j.initData(m.map(q,function(X){return X[2]})),j.hasItemOption=!0,{from:U,to:G,line:j}}f.exports=D}),o1t=xt(()=>{var o=fo();r1t(),n1t(),o.registerPreprocessor(function(f){f.markLine=f.markLine||{}})}),a1t=xt((o,f)=>{var m=H0e(),v=m.extend({type:"markArea",defaultOption:{zlevel:0,z:1,tooltip:{trigger:"item"},animation:!1,label:{show:!0,position:"top"},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:"top"}}}});f.exports=v}),s1t=xt(()=>{var o=Wi(),f=k2(),m=Yw(),v=il(),y=xa(),x=U0e(),C=G0e(),w=function(P,D,L,R){var O=x.dataTransform(P,R[0]),F=x.dataTransform(P,R[1]),k=o.retrieve,U=O.coord,G=F.coord;U[0]=k(U[0],-1/0),U[1]=k(U[1],-1/0),G[0]=k(G[0],1/0),G[1]=k(G[1],1/0);var j=o.mergeAll([{},O,F]);return j.coord=[O.coord,F.coord],j.x0=O.x,j.y0=O.y,j.x1=F.x,j.y1=F.y,j};function A(P){return!isNaN(P)&&!isFinite(P)}function E(P,D,L,R){var O=1-P;return A(D[O])&&A(L[O])}function T(P,D){var L=D.coord[0],R=D.coord[1];return P.type==="cartesian2d"&&L&&R&&(E(1,L,R,P)||E(0,L,R,P))?!0:x.dataFilter(P,{coord:L,x:D.x0,y:D.y0})||x.dataFilter(P,{coord:R,x:D.x1,y:D.y1})}function S(P,D,L,R,O){var F=R.coordinateSystem,k=P.getItemModel(D),U,G=v.parsePercent(k.get(L[0]),O.getWidth()),j=v.parsePercent(k.get(L[1]),O.getHeight());if(!isNaN(G)&&!isNaN(j))U=[G,j];else{if(R.getMarkerPosition)U=R.getMarkerPosition(P.getValues(L,D));else{var q=P.get(L[0],D),J=P.get(L[1],D),X=[q,J];F.clampData&&F.clampData(X,X),U=F.dataToPoint(X,!0)}if(F.type==="cartesian2d"){var Y=F.getAxis("x"),Q=F.getAxis("y"),q=P.get(L[0],D),J=P.get(L[1],D);A(q)?U[0]=Y.toGlobalCoord(Y.getExtent()[L[0]==="x0"?0:1]):A(J)&&(U[1]=Q.toGlobalCoord(Q.getExtent()[L[1]==="y0"?0:1]))}isNaN(G)||(U[0]=G),isNaN(j)||(U[1]=j)}return U}var M=[["x0","y0"],["x1","y0"],["x1","y1"],["x0","y1"]];C.extend({type:"markArea",updateTransform:function(P,D,L){D.eachSeries(function(R){var O=R.markAreaModel;if(O){var F=O.getData();F.each(function(k){var U=o.map(M,function(j){return S(F,k,j,R,L)});F.setItemLayout(k,U);var G=F.getItemGraphicEl(k);G.setShape("points",U)})}},this)},renderSeries:function(P,D,L,R){var O=P.coordinateSystem,F=P.id,k=P.getData(),U=this.markerGroupMap,G=U.get(F)||U.set(F,{group:new y.Group});this.group.add(G.group),G.__keep=!0;var j=I(O,P,D);D.setData(j),j.each(function(q){j.setItemLayout(q,o.map(M,function(J){return S(j,q,J,P,R)})),j.setItemVisual(q,{color:k.getVisual("color")})}),j.diff(G.__data).add(function(q){var J=new y.Polygon({shape:{points:j.getItemLayout(q)}});j.setItemGraphicEl(q,J),G.group.add(J)}).update(function(q,J){var X=G.__data.getItemGraphicEl(J);y.updateProps(X,{shape:{points:j.getItemLayout(q)}},D,q),G.group.add(X),j.setItemGraphicEl(q,X)}).remove(function(q){var J=G.__data.getItemGraphicEl(q);G.group.remove(J)}).execute(),j.eachItemGraphicEl(function(q,J){var X=j.getItemModel(J),Y=X.getModel("label"),Q=X.getModel("emphasis.label"),ee=j.getItemVisual(J,"color");q.useStyle(o.defaults(X.getModel("itemStyle").getItemStyle(),{fill:f.modifyAlpha(ee,.4),stroke:ee})),q.hoverStyle=X.getModel("emphasis.itemStyle").getItemStyle(),y.setLabelStyle(q.style,q.hoverStyle,Y,Q,{labelFetcher:D,labelDataIndex:J,defaultText:j.getName(J)||"",isRectText:!0,autoColor:ee}),y.setHoverStyle(q,{}),q.dataModel=D}),G.__data=j,G.group.silent=D.get("silent")||P.get("silent")}});function I(P,D,L){var R,O,F=["x0","y0","x1","y1"];P?(R=o.map(P&&P.dimensions,function(G){var j=D.getData(),q=j.getDimensionInfo(j.mapDimension(G))||{};return o.defaults({name:G},q)}),O=new m(o.map(F,function(G,j){return{name:G,type:R[j%2].type}}),L)):(R=[{name:"value",type:"float"}],O=new m(R,L));var k=o.map(L.get("data"),o.curry(w,D,P,L));P&&(k=o.filter(k,o.curry(T,P)));var U=P?function(G,j,q,J){return G.coord[Math.floor(J/2)][J%2]}:function(G){return G.value};return O.initData(k,null,U),O.hasItemOption=!0,O}}),l1t=xt(()=>{var o=fo();a1t(),s1t(),o.registerPreprocessor(function(f){f.markArea=f.markArea||{}})}),BGe=xt((o,f)=>{var m=fo(),v=Wi(),y=Sm(),x=vu(),C=x.isNameSpecified,w=J3(),A=w.legend.selector,E={all:{type:"all",title:v.clone(A.all)},inverse:{type:"inverse",title:v.clone(A.inverse)}},T=m.extendComponentModel({type:"legend.plain",dependencies:["series"],layoutMode:{type:"box",ignoreSize:!0},init:function(M,I,P){this.mergeDefaultAndTheme(M,P),M.selected=M.selected||{},this._updateSelector(M)},mergeOption:function(M){T.superCall(this,"mergeOption",M),this._updateSelector(M)},_updateSelector:function(M){var I=M.selector;I===!0&&(I=M.selector=["all","inverse"]),v.isArray(I)&&v.each(I,function(P,D){v.isString(P)&&(P={type:P}),I[D]=v.merge(P,E[P.type])})},optionUpdated:function(){this._updateData(this.ecModel);var M=this._data;if(M[0]&&this.get("selectedMode")==="single"){for(var I=!1,P=0;P=0},getOrient:function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},defaultOption:{zlevel:0,z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",itemStyle:{borderWidth:0},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:" sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}}}),S=T;f.exports=S}),u1t=xt(()=>{var o=fo(),f=Wi();function m(v,y,x){var C={},w=v==="toggleSelected",A;return x.eachComponent("legend",function(E){w&&A!=null?E[A?"select":"unSelect"](y.name):v==="allSelect"||v==="inverseSelect"?E[v]():(E[v](y.name),A=E.isSelected(y.name));var T=E.getData();f.each(T,function(S){var M=S.get("name");if(!(M===` `||M==="")){var I=E.isSelected(M);C.hasOwnProperty(M)?C[M]=C[M]&&I:C[M]=I}})}),v==="allSelect"||v==="inverseSelect"?{selected:C}:{name:y.name,selected:C}}o.registerAction("legendToggleSelect","legendselectchanged",f.curry(m,"toggleSelected")),o.registerAction("legendAllSelect","legendselectall",f.curry(m,"allSelect")),o.registerAction("legendInverseSelect","legendinverseselect",f.curry(m,"inverseSelect")),o.registerAction("legendSelect","legendselected",f.curry(m,"select")),o.registerAction("legendUnSelect","legendunselected",f.curry(m,"unSelect"))}),kGe=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=fo(),x=Wi(),C=qw(),w=C.createSymbol,A=xa(),E=RGe(),T=E.makeBackground,S=rd(),M=x.curry,I=x.each,P=A.Group,D=y.extendComponentView({type:"legend.plain",newlineDisabled:!1,init:function(){this.group.add(this._contentGroup=new P),this._backgroundEl,this.group.add(this._selectorGroup=new P),this._isFirstRender=!0},getContentGroup:function(){return this._contentGroup},getSelectorGroup:function(){return this._selectorGroup},render:function(k,U,G){var j=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!k.get("show",!0)){var q=k.get("align"),J=k.get("orient");(!q||q==="auto")&&(q=k.get("left")==="right"&&J==="vertical"?"right":"left");var X=k.get("selector",!0),Y=k.get("selectorPosition",!0);X&&(!Y||Y==="auto")&&(Y=J==="horizontal"?"end":"start"),this.renderInner(q,k,U,G,X,J,Y);var Q=k.getBoxLayoutParams(),ee={width:G.getWidth(),height:G.getHeight()},z=k.get("padding"),ie=S.getLayoutRect(Q,ee,z),re=this.layoutInner(k,q,ie,j,X,Y),ne=S.getLayoutRect(x.defaults({width:re.width,height:re.height},Q),ee,z);this.group.attr("position",[ne.x-re.x,ne.y-re.y]),this.group.add(this._backgroundEl=T(re,k))}},resetInner:function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},renderInner:function(k,U,G,j,q,J,X){var Y=this.getContentGroup(),Q=x.createHashMap(),ee=U.get("selectedMode"),z=[];G.eachRawSeries(function(ie){!ie.get("legendHoverLink")&&z.push(ie.id)}),I(U.getData(),function(ie,re){var ne=ie.get("name");if(!this.newlineDisabled&&(ne===""||ne===` `)){Y.add(new P({newline:!0}));return}var oe=G.getSeriesByName(ne)[0];if(!Q.get(ne))if(oe){var se=oe.getData(),ae=se.getVisual("color"),fe=se.getVisual("borderColor");typeof ae=="function"&&(ae=ae(oe.getDataParams(0))),typeof fe=="function"&&(fe=fe(oe.getDataParams(0)));var de=se.getVisual("legendSymbol")||"roundRect",ve=se.getVisual("symbol"),pe=this._createItem(ne,re,ie,U,de,ve,k,ae,fe,ee);pe.on("click",M(R,ne,null,j,z)).on("mouseover",M(O,oe.name,null,j,z)).on("mouseout",M(F,oe.name,null,j,z)),Q.set(ne,!0)}else G.eachRawSeries(function(ce){if(!Q.get(ne)&&ce.legendVisualProvider){var he=ce.legendVisualProvider;if(!he.containName(ne))return;var Ce=he.indexOfName(ne),Se=he.getItemVisual(Ce,"color"),De=he.getItemVisual(Ce,"borderColor"),Oe="roundRect",Ue=this._createItem(ne,re,ie,U,Oe,null,k,Se,De,ee);Ue.on("click",M(R,null,ne,j,z)).on("mouseover",M(O,null,ne,j,z)).on("mouseout",M(F,null,ne,j,z)),Q.set(ne,!0)}},this)},this),q&&this._createSelector(q,U,j,J,X)},_createSelector:function(k,U,G,j,q){var J=this.getSelectorGroup();I(k,function(Y){X(Y)});function X(Y){var Q=Y.type,ee=new A.Text({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){G.dispatchAction({type:Q==="all"?"legendAllSelect":"legendInverseSelect"})}});J.add(ee);var z=U.getModel("selectorLabel"),ie=U.getModel("emphasis.selectorLabel");A.setLabelStyle(ee.style,ee.hoverStyle={},z,ie,{defaultText:Y.title,isRectText:!1}),A.setHoverStyle(ee)}},_createItem:function(k,U,G,j,q,J,X,Y,Q,ee){var z=j.get("itemWidth"),ie=j.get("itemHeight"),re=j.get("inactiveColor"),ne=j.get("inactiveBorderColor"),oe=j.get("symbolKeepAspect"),se=j.getModel("itemStyle"),ae=j.isSelected(k),fe=new P,de=G.getModel("textStyle"),ve=G.get("icon"),pe=G.getModel("tooltip"),ce=pe.parentModel;q=ve||q;var he=w(q,0,0,z,ie,ae?Y:re,oe??!0);if(fe.add(L(he,q,se,Q,ne,ae)),!ve&&J&&(J!==q||J==="none")){var Ce=ie*.8;J==="none"&&(J="circle");var Se=w(J,(z-Ce)/2,(ie-Ce)/2,Ce,Ce,ae?Y:re,oe??!0);fe.add(L(Se,J,se,Q,ne,ae))}var De=X==="left"?z+5:-5,Oe=X,Ue=j.get("formatter"),Xe=k;typeof Ue=="string"&&Ue?Xe=Ue.replace("{name}",k??""):typeof Ue=="function"&&(Xe=Ue(k)),fe.add(new A.Text({style:A.setTextStyle({},de,{text:Xe,x:De,y:ie/2,textFill:ae?de.getTextColor():re,textAlign:Oe,textVerticalAlign:"middle"})}));var it=new A.Rect({shape:fe.getBoundingRect(),invisible:!0,tooltip:pe.get("show")?x.extend({content:k,formatter:ce.get("formatter",!0)||function(){return k},formatterParams:{componentType:"legend",legendIndex:j.componentIndex,name:k,$vars:["name"]}},pe.option):null});return fe.add(it),fe.eachChild(function(ut){ut.silent=!0}),it.silent=!ee,this.getContentGroup().add(fe),A.setHoverStyle(fe),fe.__legendDataIndex=U,fe},layoutInner:function(k,U,G,j,q,J){var X=this.getContentGroup(),Y=this.getSelectorGroup();S.box(k.get("orient"),X,k.get("itemGap"),G.width,G.height);var Q=X.getBoundingRect(),ee=[-Q.x,-Q.y];if(q){S.box("horizontal",Y,k.get("selectorItemGap",!0));var z=Y.getBoundingRect(),ie=[-z.x,-z.y],re=k.get("selectorButtonGap",!0),ne=k.getOrient().index,oe=ne===0?"width":"height",se=ne===0?"height":"width",ae=ne===0?"y":"x";J==="end"?ie[ne]+=Q[oe]+re:ee[ne]+=z[oe]+re,ie[1-ne]+=Q[se]/2-z[se]/2,Y.attr("position",ie),X.attr("position",ee);var fe={x:0,y:0};return fe[oe]=Q[oe]+re+z[oe],fe[se]=Math.max(Q[se],z[se]),fe[ae]=Math.min(0,z[ae]+ie[1-ne]),fe}else return X.attr("position",ee),this.group.getBoundingRect()},remove:function(){this.getContentGroup().removeAll(),this._isFirstRender=!0}});function L(k,U,G,j,q,J){var X;return U!=="line"&&U.indexOf("empty")<0?(X=G.getItemStyle(),k.style.stroke=j,J||(X.stroke=q)):X=G.getItemStyle(["borderWidth","borderColor"]),k.setStyle(X)}function R(k,U,G,j){F(k,U,G,j),G.dispatchAction({type:"legendToggleSelect",name:k??U}),O(k,U,G,j)}function O(k,U,G,j){var q=G.getZr().storage.getDisplayList()[0];q&&q.useHoverLayer||G.dispatchAction({type:"highlight",seriesName:k,name:U,excludeSeriesId:j})}function F(k,U,G,j){var q=G.getZr().storage.getDisplayList()[0];q&&q.useHoverLayer||G.dispatchAction({type:"downplay",seriesName:k,name:U,excludeSeriesId:j})}f.exports=D}),c1t=xt((o,f)=>{function m(v){var y=v.findComponents({mainType:"legend"});y&&y.length&&v.filterSeries(function(x){for(var C=0;C{var o=fo();BGe(),u1t(),kGe();var f=c1t(),m=Xg();o.registerProcessor(o.PRIORITY.PROCESSOR.SERIES_FILTER,f),m.registerSubTypeDefaulter("legend",function(){return"plain"})}),h1t=xt((o,f)=>{var m=BGe(),v=rd(),y=v.mergeLayoutParam,x=v.getLayoutParams,C=m.extend({type:"legend.scroll",setScrollDataIndex:function(E){this.option.scrollDataIndex=E},defaultOption:{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800},init:function(E,T,S,M){var I=x(E);C.superCall(this,"init",E,T,S,M),w(this,E,I)},mergeOption:function(E,T){C.superCall(this,"mergeOption",E,T),w(this,this.option,E)}});function w(E,T,S){var M=E.getOrient(),I=[1,1];I[M.index]=0,y(T,S,{type:"box",ignoreSize:I})}var A=C;f.exports=A}),d1t=xt((o,f)=>{var m=Wi(),v=xa(),y=rd(),x=kGe(),C=v.Group,w=["width","height"],A=["x","y"],E=x.extend({type:"legend.scroll",newlineDisabled:!0,init:function(){E.superCall(this,"init"),this._currentIndex=0,this.group.add(this._containerGroup=new C),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new C),this._showController},resetInner:function(){E.superCall(this,"resetInner"),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},renderInner:function(S,M,I,P,D,L,R){var O=this;E.superCall(this,"renderInner",S,M,I,P,D,L,R);var F=this._controllerGroup,k=M.get("pageIconSize",!0);m.isArray(k)||(k=[k,k]),G("pagePrev",0);var U=M.getModel("pageTextStyle");F.add(new v.Text({name:"pageText",style:{textFill:U.getTextColor(),font:U.getFont(),textVerticalAlign:"middle",textAlign:"center"},silent:!0})),G("pageNext",1);function G(j,q){var J=j+"DataIndex",X=v.createIcon(M.get("pageIcons",!0)[M.getOrient().name][q],{onclick:m.bind(O._pageGo,O,J,M,P)},{x:-k[0]/2,y:-k[1]/2,width:k[0],height:k[1]});X.name=j,F.add(X)}},layoutInner:function(S,M,I,P,D,L){var R=this.getSelectorGroup(),O=S.getOrient().index,F=w[O],k=A[O],U=w[1-O],G=A[1-O];D&&y.box("horizontal",R,S.get("selectorItemGap",!0));var j=S.get("selectorButtonGap",!0),q=R.getBoundingRect(),J=[-q.x,-q.y],X=m.clone(I);D&&(X[F]=I[F]-q[F]-j);var Y=this._layoutContentAndController(S,P,X,O,F,U,G);if(D){if(L==="end")J[O]+=Y[F]+j;else{var Q=q[F]+j;J[O]-=Q,Y[k]-=Q}Y[F]+=q[F]+j,J[1-O]+=Y[G]+Y[U]/2-q[U]/2,Y[U]=Math.max(Y[U],q[U]),Y[G]=Math.min(Y[G],q[G]+J[1-O]),R.attr("position",J)}return Y},_layoutContentAndController:function(S,M,I,P,D,L,R){var O=this.getContentGroup(),F=this._containerGroup,k=this._controllerGroup;y.box(S.get("orient"),O,S.get("itemGap"),P?I.width:null,P?null:I.height),y.box("horizontal",k,S.get("pageButtonItemGap",!0));var U=O.getBoundingRect(),G=k.getBoundingRect(),j=this._showController=U[D]>I[D],q=[-U.x,-U.y];M||(q[P]=O.position[P]);var J=[0,0],X=[-G.x,-G.y],Y=m.retrieve2(S.get("pageButtonGap",!0),S.get("itemGap",!0));if(j){var Q=S.get("pageButtonPosition",!0);Q==="end"?X[P]+=I[D]-G[D]:J[P]+=G[D]+Y}X[1-P]+=U[L]/2-G[L]/2,O.attr("position",q),F.attr("position",J),k.attr("position",X);var ee={x:0,y:0};if(ee[D]=j?I[D]:U[D],ee[L]=Math.max(U[L],G[L]),ee[R]=Math.min(0,G[R]+X[1-P]),F.__rectSize=I[D],j){var z={x:0,y:0};z[D]=Math.max(I[D]-G[D]-Y,0),z[L]=ee[L],F.setClipPath(new v.Rect({shape:z})),F.__rectSize=z[D]}else k.eachChild(function(re){re.attr({invisible:!0,silent:!0})});var ie=this._getPageInfo(S);return ie.pageIndex!=null&&v.updateProps(O,{position:ie.contentPosition},j?S:!1),this._updatePageInfoView(S,ie),ee},_pageGo:function(S,M,I){var P=this._getPageInfo(M)[S];P!=null&&I.dispatchAction({type:"legendScroll",scrollDataIndex:P,legendId:M.id})},_updatePageInfoView:function(S,M){var I=this._controllerGroup;m.each(["pagePrev","pageNext"],function(F){var k=M[F+"DataIndex"]!=null,U=I.childOfName(F);U&&(U.setStyle("fill",k?S.get("pageIconColor",!0):S.get("pageIconInactiveColor",!0)),U.cursor=k?"pointer":"default")});var P=I.childOfName("pageText"),D=S.get("pageFormatter"),L=M.pageIndex,R=L!=null?L+1:0,O=M.pageCount;P&&D&&P.setStyle("text",m.isString(D)?D.replace("{current}",R).replace("{total}",O):D({current:R,total:O}))},_getPageInfo:function(S){var M=S.get("scrollDataIndex",!0),I=this.getContentGroup(),P=this._containerGroup.__rectSize,D=S.getOrient().index,L=w[D],R=A[D],O=this._findTargetItemIndex(M),F=I.children(),k=F[O],U=F.length,G=U?1:0,j={contentPosition:I.position.slice(),pageCount:G,pageIndex:G-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!k)return j;var q=ee(k);j.contentPosition[D]=-q.s;for(var J=O+1,X=q,Y=q,Q=null;J<=U;++J)Q=ee(F[J]),(!Q&&Y.e>X.s+P||Q&&!z(Q,X.s))&&(Y.i>X.i?X=Y:X=Q,X&&(j.pageNextDataIndex==null&&(j.pageNextDataIndex=X.i),++j.pageCount)),Y=Q;for(var J=O-1,X=q,Y=q,Q=null;J>=-1;--J)Q=ee(F[J]),(!Q||!z(Y,Q.s))&&X.i=re&&ie.s<=re+P}},_findTargetItemIndex:function(S){if(!this._showController)return 0;var M,I=this.getContentGroup(),P;return I.eachChild(function(D,L){var R=D.__legendDataIndex;P==null&&R!=null&&(P=L),R===S&&(M=L)}),M??P}}),T=E;f.exports=T}),f1t=xt(()=>{var o=fo();o.registerAction("legendScroll","legendscroll",function(f,m){var v=f.scrollDataIndex;v!=null&&m.eachComponent({mainType:"legend",subType:"scroll",query:f},function(y){y.setScrollDataIndex(v)})})}),p1t=xt(()=>{VGe(),h1t(),d1t(),f1t()}),m1t=xt((o,f)=>{var m=hU(),v=m.extend({type:"dataZoom.slider",layoutMode:"box",defaultOption:{show:!0,right:"ph",top:"ph",width:"ph",height:"ph",left:null,bottom:null,backgroundColor:"rgba(47,69,84,0)",dataBackground:{lineStyle:{color:"#2f4554",width:.5,opacity:.3},areaStyle:{color:"rgba(47,69,84,0.3)",opacity:.3}},borderColor:"#ddd",fillerColor:"rgba(167,183,204,0.4)",handleIcon:"M8.2,13.6V3.9H6.3v9.7H3.1v14.9h3.3v9.7h1.8v-9.7h3.3V13.6H8.2z M9.7,24.4H4.8v-1.4h4.9V24.4z M9.7,19.1H4.8v-1.4h4.9V19.1z",handleSize:"100%",handleStyle:{color:"#a7b7cc"},labelPrecision:null,labelFormatter:null,showDetail:!0,showDataShadow:"auto",realtime:!0,zoomLock:!1,textStyle:{color:"#333"}}}),y=v;f.exports=y}),g1t=xt((o,f)=>{var m=Wi(),v=B2(),y=xa(),x=X3(),C=dU(),w=il(),A=rd(),E=cU(),T=y.Rect,S=w.linearMap,M=w.asc,I=m.bind,P=m.each,D=7,L=1,R=30,O="horizontal",F="vertical",k=5,U=["line","bar","candlestick","scatter"],G=C.extend({type:"dataZoom.slider",init:function(X,Y){this._displayables={},this._orient,this._range,this._handleEnds,this._size,this._handleWidth,this._handleHeight,this._location,this._dragging,this._dataShadowInfo,this.api=Y},render:function(X,Y,Q,ee){if(G.superApply(this,"render",arguments),x.createOrUpdate(this,"_dispatchZoomAction",this.dataZoomModel.get("throttle"),"fixRate"),this._orient=X.get("orient"),this.dataZoomModel.get("show")===!1){this.group.removeAll();return}(!ee||ee.type!=="dataZoom"||ee.from!==this.uid)&&this._buildView(),this._updateView()},remove:function(){G.superApply(this,"remove",arguments),x.clear(this,"_dispatchZoomAction")},dispose:function(){G.superApply(this,"dispose",arguments),x.clear(this,"_dispatchZoomAction")},_buildView:function(){var X=this.group;X.removeAll(),this._resetLocation(),this._resetInterval();var Y=this._displayables.barGroup=new y.Group;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),X.add(Y),this._positionGroup()},_resetLocation:function(){var X=this.dataZoomModel,Y=this.api,Q=this._findCoordRect(),ee={width:Y.getWidth(),height:Y.getHeight()},z=this._orient===O?{right:ee.width-Q.x-Q.width,top:ee.height-R-D,width:Q.width,height:R}:{right:D,top:Q.y,width:R,height:Q.height},ie=A.getLayoutParams(X.option);m.each(["right","top","width","height"],function(ne){ie[ne]==="ph"&&(ie[ne]=z[ne])});var re=A.getLayoutRect(ie,ee,X.padding);this._location={x:re.x,y:re.y},this._size=[re.width,re.height],this._orient===F&&this._size.reverse()},_positionGroup:function(){var X=this.group,Y=this._location,Q=this._orient,ee=this.dataZoomModel.getFirstTargetAxisModel(),z=ee&&ee.get("inverse"),ie=this._displayables.barGroup,re=(this._dataShadowInfo||{}).otherAxisInverse;ie.attr(Q===O&&!z?{scale:re?[1,1]:[1,-1]}:Q===O&&z?{scale:re?[-1,1]:[-1,-1]}:Q===F&&!z?{scale:re?[1,-1]:[1,1],rotation:Math.PI/2}:{scale:re?[-1,-1]:[-1,1],rotation:Math.PI/2});var ne=X.getBoundingRect([ie]);X.attr("position",[Y.x-ne.x,Y.y-ne.y])},_getViewExtent:function(){return[0,this._size[0]]},_renderBackground:function(){var X=this.dataZoomModel,Y=this._size,Q=this._displayables.barGroup;Q.add(new T({silent:!0,shape:{x:0,y:0,width:Y[0],height:Y[1]},style:{fill:X.get("backgroundColor")},z2:-40})),Q.add(new T({shape:{x:0,y:0,width:Y[0],height:Y[1]},style:{fill:"transparent"},z2:0,onclick:m.bind(this._onClickPanelClick,this)}))},_renderDataShadow:function(){var X=this._dataShadowInfo=this._prepareDataShadowInfo();if(X){var Y=this._size,Q=X.series,ee=Q.getRawData(),z=Q.getShadowDim?Q.getShadowDim():X.otherDim;if(z!=null){var ie=ee.getDataExtent(z),re=(ie[1]-ie[0])*.3;ie=[ie[0]-re,ie[1]+re];var ne=[0,Y[1]],oe=[0,Y[0]],se=[[Y[0],0],[0,0]],ae=[],fe=oe[1]/(ee.count()-1),de=0,ve=Math.round(ee.count()/Y[0]),pe;ee.each([z],function(he,Ce){if(ve>0&&Ce%ve){de+=fe;return}var Se=he==null||isNaN(he)||he==="",De=Se?0:S(he,ie,ne,!0);Se&&!pe&&Ce?(se.push([se[se.length-1][0],0]),ae.push([ae[ae.length-1][0],0])):!Se&&pe&&(se.push([de,0]),ae.push([de,0])),se.push([de,De]),ae.push([de,De]),de+=fe,pe=Se});var ce=this.dataZoomModel;this._displayables.barGroup.add(new y.Polygon({shape:{points:se},style:m.defaults({fill:ce.get("dataBackgroundColor")},ce.getModel("dataBackground.areaStyle").getAreaStyle()),silent:!0,z2:-20})),this._displayables.barGroup.add(new y.Polyline({shape:{points:ae},style:ce.getModel("dataBackground.lineStyle").getLineStyle(),silent:!0,z2:-19}))}}},_prepareDataShadowInfo:function(){var X=this.dataZoomModel,Y=X.get("showDataShadow");if(Y!==!1){var Q,ee=this.ecModel;return X.eachTargetAxis(function(z,ie){var re=X.getAxisProxy(z.name,ie).getTargetSeriesModels();m.each(re,function(ne){if(!Q&&!(Y!==!0&&m.indexOf(U,ne.get("type"))<0)){var oe=ee.getComponent(z.axis,ie).axis,se=j(z.name),ae,fe=ne.coordinateSystem;se!=null&&fe.getOtherAxis&&(ae=fe.getOtherAxis(oe).inverse),se=ne.getData().mapDimension(se),Q={thisAxis:oe,series:ne,thisDim:z.name,otherDim:se,otherAxisInverse:ae}}},this)},this),Q}},_renderHandle:function(){var X=this._displayables,Y=X.handles=[],Q=X.handleLabels=[],ee=this._displayables.barGroup,z=this._size,ie=this.dataZoomModel;ee.add(X.filler=new T({draggable:!0,cursor:q(this._orient),drift:I(this._onDragMove,this,"all"),ondragstart:I(this._showDataInfo,this,!0),ondragend:I(this._onDragEnd,this),onmouseover:I(this._showDataInfo,this,!0),onmouseout:I(this._showDataInfo,this,!1),style:{fill:ie.get("fillerColor"),textPosition:"inside"}})),ee.add(new T({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:z[0],height:z[1]},style:{stroke:ie.get("dataBackgroundColor")||ie.get("borderColor"),lineWidth:L,fill:"rgba(0,0,0,0)"}})),P([0,1],function(re){var ne=y.createIcon(ie.get("handleIcon"),{cursor:q(this._orient),draggable:!0,drift:I(this._onDragMove,this,re),ondragend:I(this._onDragEnd,this),onmouseover:I(this._showDataInfo,this,!0),onmouseout:I(this._showDataInfo,this,!1)},{x:-1,y:0,width:2,height:2}),oe=ne.getBoundingRect();this._handleHeight=w.parsePercent(ie.get("handleSize"),this._size[1]),this._handleWidth=oe.width/oe.height*this._handleHeight,ne.setStyle(ie.getModel("handleStyle").getItemStyle());var se=ie.get("handleColor");se!=null&&(ne.style.fill=se),ee.add(Y[re]=ne);var ae=ie.textStyleModel;this.group.add(Q[re]=new y.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textVerticalAlign:"middle",textAlign:"center",textFill:ae.getTextColor(),textFont:ae.getFont()},z2:10}))},this)},_resetInterval:function(){var X=this._range=this.dataZoomModel.getPercentRange(),Y=this._getViewExtent();this._handleEnds=[S(X[0],[0,100],Y,!0),S(X[1],[0,100],Y,!0)]},_updateInterval:function(X,Y){var Q=this.dataZoomModel,ee=this._handleEnds,z=this._getViewExtent(),ie=Q.findRepresentativeAxisProxy().getMinMaxSpan(),re=[0,100];E(Y,ee,z,Q.get("zoomLock")?"all":X,ie.minSpan!=null?S(ie.minSpan,re,z,!0):null,ie.maxSpan!=null?S(ie.maxSpan,re,z,!0):null);var ne=this._range,oe=this._range=M([S(ee[0],z,re,!0),S(ee[1],z,re,!0)]);return!ne||ne[0]!==oe[0]||ne[1]!==oe[1]},_updateView:function(X){var Y=this._displayables,Q=this._handleEnds,ee=M(Q.slice()),z=this._size;P([0,1],function(ie){var re=Y.handles[ie],ne=this._handleHeight;re.attr({scale:[ne/2,ne/2],position:[Q[ie],z[1]/2-ne/2]})},this),Y.filler.setShape({x:ee[0],y:0,width:ee[1]-ee[0],height:z[1]}),this._updateDataInfo(X)},_updateDataInfo:function(X){var Y=this.dataZoomModel,Q=this._displayables,ee=Q.handleLabels,z=this._orient,ie=["",""];if(Y.get("showDetail")){var re=Y.findRepresentativeAxisProxy();if(re){var ne=re.getAxisModel().axis,oe=this._range,se=X?re.calculateDataWindow({start:oe[0],end:oe[1]}).valueWindow:re.getDataValueWindow();ie=[this._formatLabel(se[0],ne),this._formatLabel(se[1],ne)]}}var ae=M(this._handleEnds.slice());fe.call(this,0),fe.call(this,1);function fe(de){var ve=y.getTransform(Q.handles[de].parent,this.group),pe=y.transformDirection(de===0?"right":"left",ve),ce=this._handleWidth/2+k,he=y.applyTransform([ae[de]+(de===0?-ce:ce),this._size[1]/2],ve);ee[de].setStyle({x:he[0],y:he[1],textVerticalAlign:z===O?"middle":pe,textAlign:z===O?pe:"center",text:ie[de]})}},_formatLabel:function(X,Y){var Q=this.dataZoomModel,ee=Q.get("labelFormatter"),z=Q.get("labelPrecision");(z==null||z==="auto")&&(z=Y.getPixelPrecision());var ie=X==null||isNaN(X)?"":Y.type==="category"||Y.type==="time"?Y.scale.getLabel(Math.round(X)):X.toFixed(Math.min(z,20));return m.isFunction(ee)?ee(X,ie):m.isString(ee)?ee.replace("{value}",ie):ie},_showDataInfo:function(X){X=this._dragging||X;var Y=this._displayables.handleLabels;Y[0].attr("invisible",!X),Y[1].attr("invisible",!X)},_onDragMove:function(X,Y,Q,ee){this._dragging=!0,v.stop(ee.event);var z=this._displayables.barGroup.getLocalTransform(),ie=y.applyTransform([Y,Q],z,!0),re=this._updateInterval(X,ie[0]),ne=this.dataZoomModel.get("realtime");this._updateView(!ne),re&&ne&&this._dispatchZoomAction()},_onDragEnd:function(){this._dragging=!1,this._showDataInfo(!1);var X=this.dataZoomModel.get("realtime");!X&&this._dispatchZoomAction()},_onClickPanelClick:function(X){var Y=this._size,Q=this._displayables.barGroup.transformCoordToLocal(X.offsetX,X.offsetY);if(!(Q[0]<0||Q[0]>Y[0]||Q[1]<0||Q[1]>Y[1])){var ee=this._handleEnds,z=(ee[0]+ee[1])/2,ie=this._updateInterval("all",Q[0]-z);this._updateView(),ie&&this._dispatchZoomAction()}},_dispatchZoomAction:function(){var X=this._range;this.api.dispatchAction({type:"dataZoom",from:this.uid,dataZoomId:this.dataZoomModel.id,start:X[0],end:X[1]})},_findCoordRect:function(){var X;if(P(this.getTargetCoordInfo(),function(ee){if(!X&&ee.length){var z=ee[0].model.coordinateSystem;X=z.getRect&&z.getRect()}}),!X){var Y=this.api.getWidth(),Q=this.api.getHeight();X={x:Y*.2,y:Q*.2,width:Y*.6,height:Q*.6}}return X}});function j(X){var Y={x:"y",y:"x",radius:"angle",angle:"radius"};return Y[X]}function q(X){return X==="vertical"?"ns-resize":"ew-resize"}var J=G;f.exports=J}),zGe=xt(()=>{B0e(),hU(),dU(),m1t(),g1t(),V0e(),z0e()}),_1t=xt((o,f)=>{var m=hU(),v=m.extend({type:"dataZoom.inside",defaultOption:{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}});f.exports=v}),v1t=xt(o=>{var f=Wi(),m=Kj(),v=X3(),y="\0_ec_dataZoom_roams";function x(I,P){var D=A(I),L=P.dataZoomId,R=P.coordId;f.each(D,function(k,U){var G=k.dataZoomInfos;G[L]&&f.indexOf(P.allCoordIds,R)<0&&(delete G[L],k.count--)}),T(D);var O=D[R];O||(O=D[R]={coordId:R,dataZoomInfos:{},count:0},O.controller=E(I,O),O.dispatchAction=f.curry(S,I)),!O.dataZoomInfos[L]&&O.count++,O.dataZoomInfos[L]=P;var F=M(O.dataZoomInfos);O.controller.enable(F.controlType,F.opt),O.controller.setPointerChecker(P.containsPoint),v.createOrUpdate(O,"dispatchAction",P.dataZoomModel.get("throttle",!0),"fixRate")}function C(I,P){var D=A(I);f.each(D,function(L){L.controller.dispose();var R=L.dataZoomInfos;R[P]&&(delete R[P],L.count--)}),T(D)}function w(I){return I.type+"\0_"+I.id}function A(I){var P=I.getZr();return P[y]||(P[y]={})}function E(I,P){var D=new m(I.getZr());return f.each(["pan","zoom","scrollMove"],function(L){D.on(L,function(R){var O=[];f.each(P.dataZoomInfos,function(F){if(R.isAvailableBehavior(F.dataZoomModel.option)){var k=(F.getRange||{})[L],U=k&&k(P.controller,R);!F.dataZoomModel.get("disabled",!0)&&U&&O.push({dataZoomId:F.dataZoomId,start:U[0],end:U[1]})}}),O.length&&P.dispatchAction(O)})}),D}function T(I){f.each(I,function(P,D){P.count||(P.controller.dispose(),delete I[D])})}function S(I,P){I.dispatchAction({type:"dataZoom",batch:P})}function M(I){var P,D="type_",L={type_true:2,type_move:1,type_false:0,type_undefined:-1},R=!0;return f.each(I,function(O){var F=O.dataZoomModel,k=F.get("disabled",!0)?!1:F.get("zoomLock",!0)?"move":!0;L[D+k]>L[D+P]&&(P=k),R&=F.get("preventDefaultMouseMove",!0)}),{controlType:P,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!R}}}o.register=x,o.unregister=C,o.generateCoordId=w}),y1t=xt((o,f)=>{var m=Wi(),v=dU(),y=cU(),x=v1t(),C=m.bind,w=v.extend({type:"dataZoom.inside",init:function(M,I){this._range},render:function(M,I,P,D){w.superApply(this,"render",arguments),this._range=M.getPercentRange(),m.each(this.getTargetCoordInfo(),function(L,R){var O=m.map(L,function(F){return x.generateCoordId(F.model)});m.each(L,function(F){var k=F.model,U={};m.each(["pan","zoom","scrollMove"],function(G){U[G]=C(A[G],this,F,R)},this),x.register(P,{coordId:x.generateCoordId(k),allCoordIds:O,containsPoint:function(G,j,q){return k.coordinateSystem.containPoint([j,q])},dataZoomId:M.id,dataZoomModel:M,getRange:U})},this)},this)},dispose:function(){x.unregister(this.api,this.dataZoomModel.id),w.superApply(this,"dispose",arguments),this._range=null}}),A={zoom:function(M,I,P,D){var L=this._range,R=L.slice(),O=M.axisModels[0];if(O){var F=T[I](null,[D.originX,D.originY],O,P,M),k=(F.signal>0?F.pixelStart+F.pixelLength-F.pixel:F.pixel-F.pixelStart)/F.pixelLength*(R[1]-R[0])+R[0],U=Math.max(1/D.scale,0);R[0]=(R[0]-k)*U+k,R[1]=(R[1]-k)*U+k;var G=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(y(0,R,[0,100],0,G.minSpan,G.maxSpan),this._range=R,L[0]!==R[0]||L[1]!==R[1])return R}},pan:E(function(M,I,P,D,L,R){var O=T[D]([R.oldX,R.oldY],[R.newX,R.newY],I,L,P);return O.signal*(M[1]-M[0])*O.pixel/O.pixelLength}),scrollMove:E(function(M,I,P,D,L,R){var O=T[D]([0,0],[R.scrollDelta,R.scrollDelta],I,L,P);return O.signal*(M[1]-M[0])*R.scrollDelta})};function E(M){return function(I,P,D,L){var R=this._range,O=R.slice(),F=I.axisModels[0];if(F){var k=M(O,F,I,P,D,L);if(y(k,O,[0,100],"all"),this._range=O,R[0]!==O[0]||R[1]!==O[1])return O}}}var T={grid:function(M,I,P,D,L){var R=P.axis,O={},F=L.model.coordinateSystem.getRect();return M=M||[0,0],R.dim==="x"?(O.pixel=I[0]-M[0],O.pixelLength=F.width,O.pixelStart=F.x,O.signal=R.inverse?1:-1):(O.pixel=I[1]-M[1],O.pixelLength=F.height,O.pixelStart=F.y,O.signal=R.inverse?-1:1),O},polar:function(M,I,P,D,L){var R=P.axis,O={},F=L.model.coordinateSystem,k=F.getRadiusAxis().getExtent(),U=F.getAngleAxis().getExtent();return M=M?F.pointToCoord(M):[0,0],I=F.pointToCoord(I),P.mainType==="radiusAxis"?(O.pixel=I[0]-M[0],O.pixelLength=k[1]-k[0],O.pixelStart=k[0],O.signal=R.inverse?1:-1):(O.pixel=I[1]-M[1],O.pixelLength=U[1]-U[0],O.pixelStart=U[0],O.signal=R.inverse?-1:1),O},singleAxis:function(M,I,P,D,L){var R=P.axis,O=L.model.coordinateSystem.getRect(),F={};return M=M||[0,0],R.orient==="horizontal"?(F.pixel=I[0]-M[0],F.pixelLength=O.width,F.pixelStart=O.x,F.signal=R.inverse?1:-1):(F.pixel=I[1]-M[1],F.pixelLength=O.height,F.pixelStart=O.y,F.signal=R.inverse?-1:1),F}},S=w;f.exports=S}),HGe=xt(()=>{B0e(),hU(),dU(),_1t(),y1t(),V0e(),z0e()}),x1t=xt(()=>{zGe(),HGe()}),UGe=xt((o,f)=>{var m=Wi(),v=m.each;function y(C){var w=C&&C.visualMap;m.isArray(w)||(w=w?[w]:[]),v(w,function(A){if(A){x(A,"splitList")&&!x(A,"pieces")&&(A.pieces=A.splitList,delete A.splitList);var E=A.pieces;E&&m.isArray(E)&&v(E,function(T){m.isObject(T)&&(x(T,"start")&&!x(T,"min")&&(T.min=T.start),x(T,"end")&&!x(T,"max")&&(T.max=T.end))})}})}function x(C,w){return C&&C.hasOwnProperty&&C.hasOwnProperty(w)}f.exports=y}),GGe=xt(()=>{var o=Xg();o.registerSubTypeDefaulter("visualMap",function(f){return!f.categories&&(!(f.pieces?f.pieces.length>0:f.splitNumber>0)||f.calculable)?"continuous":"piecewise"})}),WGe=xt(()=>{var o=fo(),f=Wi(),m=Nie(),v=cB(),y=o.PRIORITY.VISUAL.COMPONENT;o.registerVisual(y,{createOnAllSeries:!0,reset:function(C,w){var A=[];return w.eachComponent("visualMap",function(E){var T=C.pipelineContext;!E.isTargetSeries(C)||T&&T.large||A.push(m.incrementalApplyVisual(E.stateList,E.targetVisuals,f.bind(E.getValueState,E),E.getDataDimension(C.getData())))}),A}}),o.registerVisual(y,{createOnAllSeries:!0,reset:function(C,w){var A=C.getData(),E=[];w.eachComponent("visualMap",function(T){if(T.isTargetSeries(C)){var S=T.getVisualMeta(f.bind(x,null,C,T))||{stops:[],outerColors:[]},M=T.getDataDimension(A),I=A.getDimensionInfo(M);I!=null&&(S.dimension=I.index,E.push(S))}}),C.getData().setVisual("visualMeta",E)}});function x(C,w,A,E){for(var T=w.targetVisuals[E],S=v.prepareVisualTypes(T),M={color:C.getData().getVisual("color")},I=0,P=S.length;I{var m=Wi(),v={get:function(C,w,A){var E=m.clone((y[C]||{})[w]);return A&&m.isArray(E)?E[E.length-1]:E}},y={color:{active:["#006edd","#e0ffff"],inactive:["rgba(0,0,0,0)"]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:["circle","roundRect","diamond"],inactive:["none"]},symbolSize:{active:[10,50],inactive:[0,0]}},x=v;f.exports=x}),YGe=xt((o,f)=>{var m=fo(),v=Wi(),y=Tm(),x=jGe(),C=cB(),w=Nie(),A=vu(),E=il(),T=C.mapVisual,S=C.eachVisual,M=v.isArray,I=v.each,P=E.asc,D=E.linearMap,L=v.noop,R=m.extendComponentModel({type:"visualMap",dependencies:["series"],stateList:["inRange","outOfRange"],replacableOptionKeys:["inRange","outOfRange","target","controller","color"],dataBound:[-1/0,1/0],layoutMode:{type:"box",ignoreSize:!0},defaultOption:{show:!0,zlevel:0,z:4,seriesIndex:"all",min:0,max:200,dimension:null,inRange:null,outOfRange:null,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:"vertical",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",contentColor:"#5793f3",inactiveColor:"#aaa",borderWidth:0,padding:5,textGap:10,precision:0,color:null,formatter:null,text:null,textStyle:{color:"#333"}},init:function(F,k,U){this._dataExtent,this.targetVisuals={},this.controllerVisuals={},this.textStyleModel,this.itemSize,this.mergeDefaultAndTheme(F,U)},optionUpdated:function(F,k){var U=this.option;y.canvasSupported||(U.realtime=!1),!k&&w.replaceVisualOption(U,F,this.replacableOptionKeys),this.textStyleModel=this.getModel("textStyle"),this.resetItemSize(),this.completeVisualOption()},resetVisual:function(F){var k=this.stateList;F=v.bind(F,this),this.controllerVisuals=w.createVisualMappings(this.option.controller,k,F),this.targetVisuals=w.createVisualMappings(this.option.target,k,F)},getTargetSeriesIndices:function(){var F=this.option.seriesIndex,k=[];return F==null||F==="all"?this.ecModel.eachSeries(function(U,G){k.push(G)}):k=A.normalizeToArray(F),k},eachTargetSeries:function(F,k){v.each(this.getTargetSeriesIndices(),function(U){F.call(k,this.ecModel.getSeriesByIndex(U))},this)},isTargetSeries:function(F){var k=!1;return this.eachTargetSeries(function(U){U===F&&(k=!0)}),k},formatValueText:function(F,k,U){var G=this.option,j=G.precision,q=this.dataBound,J=G.formatter,X,Y;if(U=U||["<",">"],v.isArray(F)&&(F=F.slice(),X=!0),Y=k?F:X?[Q(F[0]),Q(F[1])]:Q(F),v.isString(J))return J.replace("{value}",X?Y[0]:Y).replace("{value2}",X?Y[1]:Y);if(v.isFunction(J))return X?J(F[0],F[1]):J(F);if(X)return F[0]===q[0]?U[0]+" "+Y[1]:F[1]===q[1]?U[1]+" "+Y[0]:Y[0]+" - "+Y[1];return Y;function Q(ee){return ee===q[0]?"min":ee===q[1]?"max":(+ee).toFixed(Math.min(j,20))}},resetExtent:function(){var F=this.option,k=P([F.min,F.max]);this._dataExtent=k},getDataDimension:function(F){var k=this.option.dimension,U=F.dimensions;if(!(k==null&&!U.length)){if(k!=null)return F.getDimension(k);for(var G=F.dimensions,j=G.length-1;j>=0;j--){var q=G[j],J=F.getDimensionInfo(q);if(!J.isCalculationCoord)return q}}},getExtent:function(){return this._dataExtent.slice()},completeVisualOption:function(){var F=this.ecModel,k=this.option,U={inRange:k.inRange,outOfRange:k.outOfRange},G=k.target||(k.target={}),j=k.controller||(k.controller={});v.merge(G,U),v.merge(j,U);var q=this.isCategory();J.call(this,G),J.call(this,j),X.call(this,G,"inRange","outOfRange"),Y.call(this,j);function J(Q){M(k.color)&&!Q.inRange&&(Q.inRange={color:k.color.slice().reverse()}),Q.inRange=Q.inRange||{color:F.get("gradientColor")},I(this.stateList,function(ee){var z=Q[ee];if(v.isString(z)){var ie=x.get(z,"active",q);ie?(Q[ee]={},Q[ee][z]=ie):delete Q[ee]}},this)}function X(Q,ee,z){var ie=Q[ee],re=Q[z];ie&&!re&&(re=Q[z]={},I(ie,function(ne,oe){if(C.isValidType(oe)){var se=x.get(oe,"inactive",q);se!=null&&(re[oe]=se,oe==="color"&&!re.hasOwnProperty("opacity")&&!re.hasOwnProperty("colorAlpha")&&(re.opacity=[0,0]))}}))}function Y(Q){var ee=(Q.inRange||{}).symbol||(Q.outOfRange||{}).symbol,z=(Q.inRange||{}).symbolSize||(Q.outOfRange||{}).symbolSize,ie=this.get("inactiveColor");I(this.stateList,function(re){var ne=this.itemSize,oe=Q[re];oe||(oe=Q[re]={color:q?ie:[ie]}),oe.symbol==null&&(oe.symbol=ee&&v.clone(ee)||(q?"roundRect":["roundRect"])),oe.symbolSize==null&&(oe.symbolSize=z&&v.clone(z)||(q?ne[0]:[ne[0],ne[0]])),oe.symbol=T(oe.symbol,function(fe){return fe==="none"||fe==="square"?"roundRect":fe});var se=oe.symbolSize;if(se!=null){var ae=-1/0;S(se,function(fe){fe>ae&&(ae=fe)}),oe.symbolSize=T(se,function(fe){return D(fe,[0,ae],[0,ne[0]],!0)})}},this)}},resetItemSize:function(){this.itemSize=[parseFloat(this.get("itemWidth")),parseFloat(this.get("itemHeight"))]},isCategory:function(){return!!this.option.categories},setSelected:L,getValueState:L,getVisualMeta:L}),O=R;f.exports=O}),C1t=xt((o,f)=>{var m=Wi(),v=YGe(),y=il(),x=[20,140],C=v.extend({type:"visualMap.continuous",defaultOption:{align:"auto",calculable:!1,range:null,realtime:!0,itemHeight:null,itemWidth:null,hoverLink:!0,hoverLinkDataSize:null,hoverLinkOnHandle:null},optionUpdated:function(E,T){C.superApply(this,"optionUpdated",arguments),this.resetExtent(),this.resetVisual(function(S){S.mappingMethod="linear",S.dataExtent=this.getExtent()}),this._resetRange()},resetItemSize:function(){C.superApply(this,"resetItemSize",arguments);var E=this.itemSize;this._orient==="horizontal"&&E.reverse(),(E[0]==null||isNaN(E[0]))&&(E[0]=x[0]),(E[1]==null||isNaN(E[1]))&&(E[1]=x[1])},_resetRange:function(){var E=this.getExtent(),T=this.option.range;!T||T.auto?(E.auto=1,this.option.range=E):m.isArray(T)&&(T[0]>T[1]&&T.reverse(),T[0]=Math.max(T[0],E[0]),T[1]=Math.min(T[1],E[1]))},completeVisualOption:function(){v.prototype.completeVisualOption.apply(this,arguments),m.each(this.stateList,function(E){var T=this.option.controller[E].symbolSize;T&&T[0]!==T[1]&&(T[0]=0)},this)},setSelected:function(E){this.option.range=E.slice(),this._resetRange()},getSelected:function(){var E=this.getExtent(),T=y.asc((this.get("range")||[]).slice());return T[0]>E[1]&&(T[0]=E[1]),T[1]>E[1]&&(T[1]=E[1]),T[0]=S[1]||E<=T[1])?"inRange":"outOfRange"},findTargetDataIndices:function(E){var T=[];return this.eachTargetSeries(function(S){var M=[],I=S.getData();I.each(this.getDataDimension(I),function(P,D){E[0]<=P&&P<=E[1]&&M.push(D)},this),T.push({seriesId:S.id,dataIndex:M})},this),T},getVisualMeta:function(E){var T=w(this,"outOfRange",this.getExtent()),S=w(this,"inRange",this.option.range.slice()),M=[];function I(k,U){M.push({value:k,color:E(k,U)})}for(var P=0,D=0,L=S.length,R=T.length;D{var m=fo(),v=Wi(),y=xa(),x=fd(),C=rd(),w=cB(),A=m.extendComponentView({type:"visualMap",autoPositionValues:{left:1,right:1,top:1,bottom:1},init:function(E,T){this.ecModel=E,this.api=T,this.visualMapModel},render:function(E,T,S,M){if(this.visualMapModel=E,E.get("show")===!1){this.group.removeAll();return}this.doRender.apply(this,arguments)},renderBackground:function(E){var T=this.visualMapModel,S=x.normalizeCssArray(T.get("padding")||0),M=E.getBoundingRect();E.add(new y.Rect({z2:-1,silent:!0,shape:{x:M.x-S[3],y:M.y-S[0],width:M.width+S[3]+S[1],height:M.height+S[0]+S[2]},style:{fill:T.get("backgroundColor"),stroke:T.get("borderColor"),lineWidth:T.get("borderWidth")}}))},getControllerVisual:function(E,T,S){S=S||{};var M=S.forceState,I=this.visualMapModel,P={};if(T==="symbol"&&(P.symbol=I.get("itemSymbol")),T==="color"){var D=I.get("contentColor");P.color=D}function L(k){return P[k]}function R(k,U){P[k]=U}var O=I.controllerVisuals[M||I.getValueState(E)],F=w.prepareVisualTypes(O);return v.each(F,function(k){var U=O[k];S.convertOpacityToAlpha&&k==="opacity"&&(k="colorAlpha",U=O.__alphaForOpacity),w.dependsOn(k,T)&&U&&U.applyVisual(E,L,R)}),P[T]},positionGroup:function(E){var T=this.visualMapModel,S=this.api;C.positionElement(E,T.getBoxLayoutParams(),{width:S.getWidth(),height:S.getHeight()})},doRender:v.noop});f.exports=A}),XGe=xt(o=>{var f=Wi(),m=rd(),v=m.getLayoutRect;function y(C,w,A){var E=C.option,T=E.align;if(T!=null&&T!=="auto")return T;for(var S={width:w.getWidth(),height:w.getHeight()},M=E.orient==="horizontal"?1:0,I=[["left","right","width"],["top","bottom","height"]],P=I[M],D=[0,null,10],L={},R=0;R<3;R++)L[I[1-M][R]]=D[R],L[P[R]]=R===2?A[0]:E[P[R]];var O=[["x","width",3],["y","height",0]][M],F=v(L,S,E.padding);return P[(F.margin[O[2]]||0)+F[O[0]]+F[O[1]]*.5{var m=Wi(),v=v0e(),y=B2(),x=qGe(),C=xa(),w=il(),A=cU(),E=XGe(),T=vu(),S=w.linearMap,M=m.each,I=Math.min,P=Math.max,D=12,L=6,R=x.extend({type:"visualMap.continuous",init:function(){R.superApply(this,"init",arguments),this._shapes={},this._dataInterval=[],this._handleEnds=[],this._orient,this._useHandle,this._hoverLinkDataIndices=[],this._dragging,this._hovering},doRender:function(J,X,Y,Q){(!Q||Q.type!=="selectDataRange"||Q.from!==this.uid)&&this._buildView()},_buildView:function(){this.group.removeAll();var J=this.visualMapModel,X=this.group;this._orient=J.get("orient"),this._useHandle=J.get("calculable"),this._resetInterval(),this._renderBar(X);var Y=J.get("text");this._renderEndsText(X,Y,0),this._renderEndsText(X,Y,1),this._updateView(!0),this.renderBackground(X),this._updateView(),this._enableHoverLinkToSeries(),this._enableHoverLinkFromSeries(),this.positionGroup(X)},_renderEndsText:function(J,X,Y){if(X){var Q=X[1-Y];Q=Q!=null?Q+"":"";var ee=this.visualMapModel,z=ee.get("textGap"),ie=ee.itemSize,re=this._shapes.barGroup,ne=this._applyTransform([ie[0]/2,Y===0?-z:ie[1]+z],re),oe=this._applyTransform(Y===0?"bottom":"top",re),se=this._orient,ae=this.visualMapModel.textStyleModel;this.group.add(new C.Text({style:{x:ne[0],y:ne[1],textVerticalAlign:se==="horizontal"?"middle":oe,textAlign:se==="horizontal"?oe:"center",text:Q,textFont:ae.getFont(),textFill:ae.getTextColor()}}))}},_renderBar:function(J){var X=this.visualMapModel,Y=this._shapes,Q=X.itemSize,ee=this._orient,z=this._useHandle,ie=E.getItemAlign(X,this.api,Q),re=Y.barGroup=this._createBarGroup(ie);re.add(Y.outOfRange=O()),re.add(Y.inRange=O(null,z?j(this._orient):null,m.bind(this._dragHandle,this,"all",!1),m.bind(this._dragHandle,this,"all",!0)));var ne=X.textStyleModel.getTextRect("\u56FD"),oe=P(ne.width,ne.height);z&&(Y.handleThumbs=[],Y.handleLabels=[],Y.handleLabelPoints=[],this._createHandle(re,0,Q,oe,ee,ie),this._createHandle(re,1,Q,oe,ee,ie)),this._createIndicator(re,Q,oe,ee),J.add(re)},_createHandle:function(J,X,Y,Q,ee){var z=m.bind(this._dragHandle,this,X,!1),ie=m.bind(this._dragHandle,this,X,!0),re=O(F(X,Q),j(this._orient),z,ie);re.position[0]=Y[0],J.add(re);var ne=this.visualMapModel.textStyleModel,oe=new C.Text({draggable:!0,drift:z,onmousemove:function(fe){y.stop(fe.event)},ondragend:ie,style:{x:0,y:0,text:"",textFont:ne.getFont(),textFill:ne.getTextColor()}});this.group.add(oe);var se=[ee==="horizontal"?Q/2:Q*1.5,ee==="horizontal"?X===0?-(Q*1.5):Q*1.5:X===0?-Q/2:Q/2],ae=this._shapes;ae.handleThumbs[X]=re,ae.handleLabelPoints[X]=se,ae.handleLabels[X]=oe},_createIndicator:function(J,X,Y,Q){var ee=O([[0,0]],"move");ee.position[0]=X[0],ee.attr({invisible:!0,silent:!0}),J.add(ee);var z=this.visualMapModel.textStyleModel,ie=new C.Text({silent:!0,invisible:!0,style:{x:0,y:0,text:"",textFont:z.getFont(),textFill:z.getTextColor()}});this.group.add(ie);var re=[Q==="horizontal"?Y/2:L+3,0],ne=this._shapes;ne.indicator=ee,ne.indicatorLabel=ie,ne.indicatorLabelPoint=re},_dragHandle:function(J,X,Y,Q){if(this._useHandle){if(this._dragging=!X,!X){var ee=this._applyTransform([Y,Q],this._shapes.barGroup,!0);this._updateInterval(J,ee[1]),this._updateView()}X===!this.visualMapModel.get("realtime")&&this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:this._dataInterval.slice()}),X?!this._hovering&&this._clearHoverLinkToSeries():G(this.visualMapModel)&&this._doHoverLinkToSeries(this._handleEnds[J],!1)}},_resetInterval:function(){var J=this.visualMapModel,X=this._dataInterval=J.getSelected(),Y=J.getExtent(),Q=[0,J.itemSize[1]];this._handleEnds=[S(X[0],Y,Q,!0),S(X[1],Y,Q,!0)]},_updateInterval:function(J,X){X=X||0;var Y=this.visualMapModel,Q=this._handleEnds,ee=[0,Y.itemSize[1]];A(X,Q,ee,J,0);var z=Y.getExtent();this._dataInterval=[S(Q[0],ee,z,!0),S(Q[1],ee,z,!0)]},_updateView:function(J){var X=this.visualMapModel,Y=X.getExtent(),Q=this._shapes,ee=[0,X.itemSize[1]],z=J?ee:this._handleEnds,ie=this._createBarVisual(this._dataInterval,Y,z,"inRange"),re=this._createBarVisual(Y,Y,ee,"outOfRange");Q.inRange.setStyle({fill:ie.barColor,opacity:ie.opacity}).setShape("points",ie.barPoints),Q.outOfRange.setStyle({fill:re.barColor,opacity:re.opacity}).setShape("points",re.barPoints),this._updateHandle(z,ie)},_createBarVisual:function(J,X,Y,Q){var ee={forceState:Q,convertOpacityToAlpha:!0},z=this._makeColorGradient(J,ee),ie=[this.getControllerVisual(J[0],"symbolSize",ee),this.getControllerVisual(J[1],"symbolSize",ee)],re=this._createBarPoints(Y,ie);return{barColor:new v(0,0,0,1,z),barPoints:re,handlesColor:[z[0].color,z[z.length-1].color]}},_makeColorGradient:function(J,X){var Y=100,Q=[],ee=(J[1]-J[0])/Y;Q.push({color:this.getControllerVisual(J[0],"color",X),offset:0});for(var z=1;zJ[1])break;Q.push({color:this.getControllerVisual(ie,"color",X),offset:z/Y})}return Q.push({color:this.getControllerVisual(J[1],"color",X),offset:1}),Q},_createBarPoints:function(J,X){var Y=this.visualMapModel.itemSize;return[[Y[0]-X[0],J[0]],[Y[0],J[0]],[Y[0],J[1]],[Y[0]-X[1],J[1]]]},_createBarGroup:function(J){var X=this._orient,Y=this.visualMapModel.get("inverse");return new C.Group(X==="horizontal"&&!Y?{scale:J==="bottom"?[1,1]:[-1,1],rotation:Math.PI/2}:X==="horizontal"&&Y?{scale:J==="bottom"?[-1,1]:[1,1],rotation:-Math.PI/2}:X==="vertical"&&!Y?{scale:J==="left"?[1,-1]:[-1,-1]}:{scale:J==="left"?[1,1]:[-1,1]})},_updateHandle:function(J,X){if(this._useHandle){var Y=this._shapes,Q=this.visualMapModel,ee=Y.handleThumbs,z=Y.handleLabels;M([0,1],function(ie){var re=ee[ie];re.setStyle("fill",X.handlesColor[ie]),re.position[1]=J[ie];var ne=C.applyTransform(Y.handleLabelPoints[ie],C.getTransform(re,this.group));z[ie].setStyle({x:ne[0],y:ne[1],text:Q.formatValueText(this._dataInterval[ie]),textVerticalAlign:"middle",textAlign:this._applyTransform(this._orient==="horizontal"?ie===0?"bottom":"top":"left",Y.barGroup)})},this)}},_showIndicator:function(J,X,Y,Q){var ee=this.visualMapModel,z=ee.getExtent(),ie=ee.itemSize,re=[0,ie[1]],ne=S(J,z,re,!0),oe=this._shapes,se=oe.indicator;if(se){se.position[1]=ne,se.attr("invisible",!1),se.setShape("points",k(!!Y,Q,ne,ie[1]));var ae={convertOpacityToAlpha:!0},fe=this.getControllerVisual(J,"color",ae);se.setStyle("fill",fe);var de=C.applyTransform(oe.indicatorLabelPoint,C.getTransform(se,this.group)),ve=oe.indicatorLabel;ve.attr("invisible",!1);var pe=this._applyTransform("left",oe.barGroup),ce=this._orient;ve.setStyle({text:(Y||"")+ee.formatValueText(X),textVerticalAlign:ce==="horizontal"?pe:"middle",textAlign:ce==="horizontal"?"center":pe,x:de[0],y:de[1]})}},_enableHoverLinkToSeries:function(){var J=this;this._shapes.barGroup.on("mousemove",function(X){if(J._hovering=!0,!J._dragging){var Y=J.visualMapModel.itemSize,Q=J._applyTransform([X.offsetX,X.offsetY],J._shapes.barGroup,!0,!0);Q[1]=I(P(0,Q[1]),Y[1]),J._doHoverLinkToSeries(Q[1],0<=Q[0]&&Q[0]<=Y[0])}}).on("mouseout",function(){J._hovering=!1,!J._dragging&&J._clearHoverLinkToSeries()})},_enableHoverLinkFromSeries:function(){var J=this.api.getZr();this.visualMapModel.option.hoverLink?(J.on("mouseover",this._hoverLinkFromSeriesMouseOver,this),J.on("mouseout",this._hideIndicator,this)):this._clearHoverLinkFromSeries()},_doHoverLinkToSeries:function(J,X){var Y=this.visualMapModel,Q=Y.itemSize;if(Y.option.hoverLink){var ee=[0,Q[1]],z=Y.getExtent();J=I(P(ee[0],J),ee[1]);var ie=U(Y,z,ee),re=[J-ie,J+ie],ne=S(J,ee,z,!0),oe=[S(re[0],ee,z,!0),S(re[1],ee,z,!0)];re[0]ee[1]&&(oe[1]=1/0),X&&(oe[0]===-1/0?this._showIndicator(ne,oe[1],"< ",ie):oe[1]===1/0?this._showIndicator(ne,oe[0],"> ",ie):this._showIndicator(ne,ne,"\u2248 ",ie));var se=this._hoverLinkDataIndices,ae=[];(X||G(Y))&&(ae=this._hoverLinkDataIndices=Y.findTargetDataIndices(oe));var fe=T.compressBatches(se,ae);this._dispatchHighDown("downplay",E.makeHighDownBatch(fe[0],Y)),this._dispatchHighDown("highlight",E.makeHighDownBatch(fe[1],Y))}},_hoverLinkFromSeriesMouseOver:function(J){var X=J.target,Y=this.visualMapModel;if(!(!X||X.dataIndex==null)){var Q=this.ecModel.getSeriesByIndex(X.seriesIndex);if(Y.isTargetSeries(Q)){var ee=Q.getData(X.dataType),z=ee.get(Y.getDataDimension(ee),X.dataIndex,!0);isNaN(z)||this._showIndicator(z,z)}}},_hideIndicator:function(){var J=this._shapes;J.indicator&&J.indicator.attr("invisible",!0),J.indicatorLabel&&J.indicatorLabel.attr("invisible",!0)},_clearHoverLinkToSeries:function(){this._hideIndicator();var J=this._hoverLinkDataIndices;this._dispatchHighDown("downplay",E.makeHighDownBatch(J,this.visualMapModel)),J.length=0},_clearHoverLinkFromSeries:function(){this._hideIndicator();var J=this.api.getZr();J.off("mouseover",this._hoverLinkFromSeriesMouseOver),J.off("mouseout",this._hideIndicator)},_applyTransform:function(J,X,Y,Q){var ee=C.getTransform(X,Q?null:this.group);return C[m.isArray(J)?"applyTransform":"transformDirection"](J,ee,Y)},_dispatchHighDown:function(J,X){X&&X.length&&this.api.dispatchAction({type:J,batch:X})},dispose:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()},remove:function(){this._clearHoverLinkFromSeries(),this._clearHoverLinkToSeries()}});function O(J,X,Y,Q){return new C.Polygon({shape:{points:J},draggable:!!Y,cursor:X,drift:Y,onmousemove:function(ee){y.stop(ee.event)},ondragend:Q})}function F(J,X){return J===0?[[0,0],[X,0],[X,-X]]:[[0,0],[X,0],[X,X]]}function k(J,X,Y,Q){return J?[[0,-I(X,P(Y,0))],[L,0],[0,I(X,P(Q-Y,0))]]:[[0,0],[5,-5],[5,5]]}function U(J,X,Y){var Q=D/2,ee=J.get("hoverLinkDataSize");return ee&&(Q=S(ee,X,Y,!0)/2),Q}function G(J){var X=J.get("hoverLinkOnHandle");return!!(X??J.get("realtime"))}function j(J){return J==="vertical"?"ns-resize":"ew-resize"}var q=R;f.exports=q}),JGe=xt(()=>{var o=fo(),f={type:"selectDataRange",event:"dataRangeSelected",update:"update"};o.registerAction(f,function(m,v){v.eachComponent({mainType:"visualMap",query:m},function(y){y.setSelected(m.selected)})})}),KGe=xt(()=>{var o=fo(),f=UGe();GGe(),WGe(),C1t(),b1t(),JGe(),o.registerPreprocessor(f)}),w1t=xt((o,f)=>{var m=Ac(),v=m.__DEV__,y=Wi(),x=YGe(),C=cB(),w=jGe(),A=il(),E=A.reformIntervals,T=x.extend({type:"visualMap.piecewise",defaultOption:{selected:null,minOpen:!1,maxOpen:!1,align:"auto",itemWidth:20,itemHeight:14,itemSymbol:"roundRect",pieceList:null,categories:null,splitNumber:5,selectedMode:"multiple",itemGap:10,hoverLink:!0,showLabel:null},optionUpdated:function(P,D){T.superApply(this,"optionUpdated",arguments),this._pieceList=[],this.resetExtent();var L=this._mode=this._determineMode();S[this._mode].call(this),this._resetSelected(P,D);var R=this.option.categories;this.resetVisual(function(O,F){L==="categories"?(O.mappingMethod="category",O.categories=y.clone(R)):(O.dataExtent=this.getExtent(),O.mappingMethod="piecewise",O.pieceList=y.map(this._pieceList,function(U){var U=y.clone(U);return F!=="inRange"&&(U.visual=null),U}))})},completeVisualOption:function(){var P=this.option,D={},L=C.listVisualTypes(),R=this.isCategory();y.each(P.pieces,function(F){y.each(L,function(k){F.hasOwnProperty(k)&&(D[k]=1)})}),y.each(D,function(F,k){var U=0;y.each(this.stateList,function(G){U|=O(P,G,k)||O(P.target,G,k)},this),!U&&y.each(this.stateList,function(G){(P[G]||(P[G]={}))[k]=w.get(k,G==="inRange"?"active":"inactive",R)})},this);function O(F,k,U){return F&&F[k]&&(y.isObject(F[k])?F[k].hasOwnProperty(U):F[k]===U)}x.prototype.completeVisualOption.apply(this,arguments)},_resetSelected:function(P,D){var L=this.option,R=this._pieceList,O=(D?L:P).selected||{};if(L.selected=O,y.each(R,function(k,U){var G=this.getSelectedMapKey(k);O.hasOwnProperty(G)||(O[G]=!0)},this),L.selectedMode==="single"){var F=!1;y.each(R,function(k,U){var G=this.getSelectedMapKey(k);O[G]&&(F?O[G]=!1:F=!0)},this)}},getSelectedMapKey:function(P){return this._mode==="categories"?P.value+"":P.index+""},getPieceList:function(){return this._pieceList},_determineMode:function(){var P=this.option;return P.pieces&&P.pieces.length>0?"pieces":this.option.categories?"categories":"splitNumber"},setSelected:function(P){this.option.selected=y.clone(P)},getValueState:function(P){var D=C.findPieceIndex(P,this._pieceList);return D!=null&&this.option.selected[this.getSelectedMapKey(this._pieceList[D])]?"inRange":"outOfRange"},findTargetDataIndices:function(P){var D=[];return this.eachTargetSeries(function(L){var R=[],O=L.getData();O.each(this.getDataDimension(O),function(F,k){var U=C.findPieceIndex(F,this._pieceList);U===P&&R.push(k)},this),D.push({seriesId:L.id,dataIndex:R})},this),D},getRepresentValue:function(P){var D;if(this.isCategory())D=P.value;else if(P.value!=null)D=P.value;else{var L=P.interval||[];D=L[0]===-1/0&&L[1]===1/0?0:(L[0]+L[1])/2}return D},getVisualMeta:function(P){if(this.isCategory())return;var D=[],L=[],R=this;function O(G,j){var q=R.getRepresentValue({interval:G});j||(j=R.getValueState(q));var J=P(q,j);G[0]===-1/0?L[0]=J:G[1]===1/0?L[1]=J:D.push({value:G[0],color:J},{value:G[1],color:J})}var F=this._pieceList.slice();if(!F.length)F.push({interval:[-1/0,1/0]});else{var k=F[0].interval[0];k!==-1/0&&F.unshift({interval:[-1/0,k]}),k=F[F.length-1].interval[1],k!==1/0&&F.push({interval:[k,1/0]})}var U=-1/0;return y.each(F,function(G){var j=G.interval;j&&(j[0]>U&&O([U,j[0]],"outOfRange"),O(j.slice()),U=j[1])},this),{stops:D,outerColors:L}}}),S={splitNumber:function(){var P=this.option,D=this._pieceList,L=Math.min(P.precision,20),R=this.getExtent(),O=P.splitNumber;O=Math.max(parseInt(O,10),1),P.splitNumber=O;for(var F=(R[1]-R[0])/O;+F.toFixed(L)!==F&&L<5;)L++;P.precision=L,F=+F.toFixed(L),P.minOpen&&D.push({interval:[-1/0,R[0]],close:[0,0]});for(var k=0,U=R[0];k","\u2265"][R[0]]];L.text=L.text||this.formatValueText(L.value!=null?L.value:L.interval,!1,O)},this)}};function M(P,D){var L=P.inverse;(P.orient==="vertical"?!L:L)&&D.reverse()}var I=T;f.exports=I}),A1t=xt((o,f)=>{var m=Wi(),v=qGe(),y=xa(),x=qw(),C=x.createSymbol,w=rd(),A=XGe(),E=v.extend({type:"visualMap.piecewise",doRender:function(){var S=this.group;S.removeAll();var M=this.visualMapModel,I=M.get("textGap"),P=M.textStyleModel,D=P.getFont(),L=P.getTextColor(),R=this._getItemAlign(),O=M.itemSize,F=this._getViewData(),k=F.endsText,U=m.retrieve(M.get("showLabel",!0),!k);k&&this._renderEndsText(S,k[0],O,U,R),m.each(F.viewPieceList,G,this),k&&this._renderEndsText(S,k[1],O,U,R),w.box(M.get("orient"),S,M.get("itemGap")),this.renderBackground(S),this.positionGroup(S);function G(j){var q=j.piece,J=new y.Group;J.onclick=m.bind(this._onItemClick,this,q),this._enableHoverLink(J,j.indexInModelPieceList);var X=M.getRepresentValue(q);if(this._createItemSymbol(J,X,[0,0,O[0],O[1]]),U){var Y=this.visualMapModel.getValueState(X);J.add(new y.Text({style:{x:R==="right"?-I:O[0]+I,y:O[1]/2,text:q.text,textVerticalAlign:"middle",textAlign:R,textFont:D,textFill:L,opacity:Y==="outOfRange"?.5:1}}))}S.add(J)}},_enableHoverLink:function(S,M){S.on("mouseover",m.bind(I,this,"highlight")).on("mouseout",m.bind(I,this,"downplay"));function I(P){var D=this.visualMapModel;D.option.hoverLink&&this.api.dispatchAction({type:P,batch:A.makeHighDownBatch(D.findTargetDataIndices(M),D)})}},_getItemAlign:function(){var S=this.visualMapModel,M=S.option;if(M.orient==="vertical")return A.getItemAlign(S,this.api,S.itemSize);var I=M.align;return(!I||I==="auto")&&(I="left"),I},_renderEndsText:function(S,M,I,P,D){if(M){var L=new y.Group,R=this.visualMapModel.textStyleModel;L.add(new y.Text({style:{x:P?D==="right"?I[0]:0:I[0]/2,y:I[1]/2,textVerticalAlign:"middle",textAlign:P?D:"center",text:M,textFont:R.getFont(),textFill:R.getTextColor()}})),S.add(L)}},_getViewData:function(){var S=this.visualMapModel,M=m.map(S.getPieceList(),function(L,R){return{piece:L,indexInModelPieceList:R}}),I=S.get("text"),P=S.get("orient"),D=S.get("inverse");return(P==="horizontal"?D:!D)?M.reverse():I&&(I=I.slice().reverse()),{viewPieceList:M,endsText:I}},_createItemSymbol:function(S,M,I){S.add(C(this.getControllerVisual(M,"symbol"),I[0],I[1],I[2],I[3],this.getControllerVisual(M,"color")))},_onItemClick:function(S){var M=this.visualMapModel,I=M.option,P=m.clone(I.selected),D=M.getSelectedMapKey(S);I.selectedMode==="single"?(P[D]=!0,m.each(P,function(L,R){P[R]=R===D})):P[D]=!P[D],this.api.dispatchAction({type:"selectDataRange",from:this.uid,visualMapId:this.visualMapModel.id,selected:P})}}),T=E;f.exports=T}),QGe=xt(()=>{var o=fo(),f=UGe();GGe(),WGe(),w1t(),A1t(),JGe(),o.registerPreprocessor(f)}),E1t=xt(()=>{KGe(),QGe()}),ZGe=xt(o=>{var f=Tm(),m="urn:schemas-microsoft-com:vml",v=typeof window>"u"?null:window,y=!1,x=v&&v.document;function C(E){return w(E)}var w;if(x&&!f.canvasSupported)try{!x.namespaces.zrvml&&x.namespaces.add("zrvml",m),w=function(E){return x.createElement("')}}catch{w=function(E){return x.createElement("<"+E+' xmlns="'+m+'" class="zrvml">')}}function A(){if(!(y||!x)){y=!0;var E=x.styleSheets;E.length<31?x.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):E[0].addRule(".zrvml","behavior:url(#default#VML)")}}o.doc=x,o.createNode=C,o.initVML=A}),T1t=xt(()=>{var o=Tm(),f=lf(),m=f.applyTransform,v=Of(),y=k2(),x=nb(),C=Cie(),w=D8e(),A=kj(),E=rU(),T=nB(),S=am(),M=oU(),I=wie(),P=ZGe(),D=M.CMD,L=Math.round,R=Math.sqrt,O=Math.abs,F=Math.cos,k=Math.sin,U=Math.max;if(!o.canvasSupported){for(G=",",j="progid:DXImageTransform.Microsoft",q=21600,J=q/2,X=1e5,Y=1e3,Q=function(At){At.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",At.coordsize=q+","+q,At.coordorigin="0,0"},ee=function(At){return String(At).replace(/&/g,"&").replace(/"/g,""")},z=function(At,bt,gt){return"rgb("+[At,bt,gt].join(",")+")"},ie=function(At,bt){bt&&At&&bt.parentNode!==At&&At.appendChild(bt)},re=function(At,bt){bt&&At&&bt.parentNode===At&&At.removeChild(bt)},ne=function(At,bt,gt){return(parseFloat(At)||0)*X+(parseFloat(bt)||0)*Y+gt},oe=C.parsePercent,se=function(At,bt,gt){var It=y.parse(bt);gt=+gt,isNaN(gt)&&(gt=1),It&&(At.color=z(It[0],It[1],It[2]),At.opacity=gt*It[3])},ae=function(At){var bt=y.parse(At);return[z(bt[0],bt[1],bt[2]),bt[3]]},fe=function(At,bt,gt){var It=bt.fill;if(It!=null)if(It instanceof I){var Jt,bi=0,Yi=[0,0],ii=0,ei=1,Li=gt.getBoundingRect(),Je=Li.width,Nt=Li.height;if(It.type==="linear"){Jt="gradient";var yi=gt.transform,ai=[It.x*Je,It.y*Nt],wi=[It.x2*Je,It.y2*Nt];yi&&(m(ai,ai,yi),m(wi,wi,yi));var ji=wi[0]-ai[0],hi=wi[1]-ai[1];bi=Math.atan2(ji,hi)*180/Math.PI,bi<0&&(bi+=360),bi<1e-6&&(bi=0)}else{Jt="gradientradial";var ai=[It.x*Je,It.y*Nt],yi=gt.transform,Ri=gt.scale,pt=Je,wr=Nt;Yi=[(ai[0]-Li.x)/pt,(ai[1]-Li.y)/wr],yi&&m(ai,ai,yi),pt/=Ri[0]*q,wr/=Ri[1]*q;var zi=U(pt,wr);ii=2*0/zi,ei=2*It.r/zi-ii}var Ui=It.colorStops.slice();Ui.sort(function(Dt,Lt){return Dt.offset-Lt.offset});for(var Gt=Ui.length,$t=[],jt=[],ct=0;ct=2){var si=$t[0][0],_t=$t[1][0],Yt=$t[0][1]*bt.opacity,Fi=$t[1][1]*bt.opacity;At.type=Jt,At.method="none",At.focus="100%",At.angle=bi,At.color=si,At.color2=_t,At.colors=jt.join(","),At.opacity=Fi,At.opacity2=Yt}Jt==="radial"&&(At.focusposition=Yi.join(","))}else se(At,It,bt.opacity)},de=function(At,bt){bt.lineDash&&(At.dashstyle=bt.lineDash.join(" ")),bt.stroke!=null&&!(bt.stroke instanceof I)&&se(At,bt.stroke,bt.opacity)},ve=function(At,bt,gt,It){var Jt=bt==="fill",bi=At.getElementsByTagName(bt)[0];gt[bt]!=null&>[bt]!=="none"&&(Jt||!Jt&>.lineWidth)?(At[Jt?"filled":"stroked"]="true",gt[bt]instanceof I&&re(At,bi),bi||(bi=P.createNode(bt)),Jt?fe(bi,gt,It):de(bi,gt),ie(At,bi)):(At[Jt?"filled":"stroked"]="false",re(At,bi))},pe=[[],[],[]],ce=function(At,bt){var gt=D.M,It=D.C,Jt=D.L,bi=D.A,Yi=D.Q,ii=[],ei,Li,Je,Nt,yi,ai,wi=At.data,ji=At.len();for(Nt=0;Nt.01?Fi&&(Dt+=270/q):Math.abs(Lt-Pe)<1e-4?Fi&&Dtct?nt-=270/q:nt+=270/q:Fi&&LtPe?Si+=270/q:Si-=270/q),ii.push(wt,L(((ct-Ht)*Gt+zi)*q-J),G,L(((Pe-si)*$t+Ui)*q-J),G,L(((ct+Ht)*Gt+zi)*q-J),G,L(((Pe+si)*$t+Ui)*q-J),G,L((Dt*Gt+zi)*q-J),G,L((Lt*$t+Ui)*q-J),G,L((Si*Gt+zi)*q-J),G,L((nt*$t+Ui)*q-J)),yi=Si,ai=nt;break;case D.R:var yt=pe[0],Tt=pe[1];yt[0]=wi[Nt++],yt[1]=wi[Nt++],Tt[0]=yt[0]+wi[Nt++],Tt[1]=yt[1]+wi[Nt++],bt&&(m(yt,yt,bt),m(Tt,Tt,bt)),yt[0]=L(yt[0]*q-J),Tt[0]=L(Tt[0]*q-J),yt[1]=L(yt[1]*q-J),Tt[1]=L(Tt[1]*q-J),ii.push(" m ",yt[0],G,yt[1]," l ",Tt[0],G,yt[1]," l ",Tt[0],G,Tt[1]," l ",yt[0],G,Tt[1]);break;case D.Z:ii.push(" x ")}if(ei>0){ii.push(Li);for(var Et=0;EtOe&&(De=0,Se={});var gt=Ue.style,It;try{gt.font=At,It=gt.fontFamily.split(",")[0]}catch{}bt={style:gt.fontStyle||Ce,variant:gt.fontVariant||Ce,weight:gt.fontWeight||Ce,size:parseFloat(gt.fontSize||12)|0,family:It||"Microsoft YaHei"},Se[At]=bt,De++}return bt},x.$override("measureText",function(At,bt){var gt=P.doc;it||(it=gt.createElement("div"),it.style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",P.doc.body.appendChild(it));try{it.style.font=bt}catch{}return it.innerHTML="",it.appendChild(gt.createTextNode(At)),{width:it.offsetWidth}}),ut=new v,at=function(At,bt,gt,It){var Jt=this.style;this.__dirty&&C.normalizeTextStyle(Jt,!0);var bi=Jt.text;if(bi!=null&&(bi+=""),!!bi){if(Jt.rich){var Yi=x.parseRichText(bi,Jt);bi=[];for(var ii=0;ii{var m=Bj(),v=ZGe(),y=Wi(),x=y.each;function C(T){return parseInt(T,10)}function w(T,S){v.initVML(),this.root=T,this.storage=S;var M=document.createElement("div"),I=document.createElement("div");M.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",I.style.cssText="position:absolute;left:0;top:0;",T.appendChild(M),this._vmlRoot=I,this._vmlViewport=M,this.resize();var P=S.delFromStorage,D=S.addToStorage;S.delFromStorage=function(L){P.call(S,L),L&&L.onRemove&&L.onRemove(I)},S.addToStorage=function(L){L.onAdd&&L.onAdd(I),D.call(S,L)},this._firstPaint=!0}w.prototype={constructor:w,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var T=this.getViewportRoot();if(T)return{offsetLeft:T.offsetLeft||0,offsetTop:T.offsetTop||0}},refresh:function(){var T=this.storage.getDisplayList(!0,!0);this._paintList(T)},_paintList:function(T){for(var S=this._vmlRoot,M=0;M{T1t();var o=bie(),f=o.registerPainter,m=S1t();f("vml",m)}),W0e=xt(o=>{var f="http://www.w3.org/2000/svg";function m(v){return document.createElementNS(f,v)}o.createElement=m}),j0e=xt(o=>{var f=W0e(),m=f.createElement,v=oU(),y=Of(),x=Ky(),C=nb(),w=Cie(),A=nB(),E=v.CMD,T=Array.prototype.join,S="none",M=Math.round,I=Math.sin,P=Math.cos,D=Math.PI,L=Math.PI*2,R=180/D,O=1e-4;function F(pe){return M(pe*1e4)/1e4}function k(pe){return pe-O}function U(pe,ce){var he=ce?pe.textFill:pe.fill;return he!=null&&he!==S}function G(pe,ce){var he=ce?pe.textStroke:pe.stroke;return he!=null&&he!==S}function j(pe,ce){ce&&q(pe,"transform","matrix("+T.call(ce,",")+")")}function q(pe,ce,he){(!he||he.type!=="linear"&&he.type!=="radial")&&pe.setAttribute(ce,he)}function J(pe,ce,he){pe.setAttributeNS("http://www.w3.org/1999/xlink",ce,he)}function X(pe,ce,he,Ce){if(U(ce,he)){var Se=he?ce.textFill:ce.fill;Se=Se==="transparent"?S:Se,q(pe,"fill",Se),q(pe,"fill-opacity",ce.fillOpacity!=null?ce.fillOpacity*ce.opacity:ce.opacity)}else q(pe,"fill",S);if(G(ce,he)){var De=he?ce.textStroke:ce.stroke;De=De==="transparent"?S:De,q(pe,"stroke",De);var Oe=he?ce.textStrokeWidth:ce.lineWidth,Ue=!he&&ce.strokeNoScale?Ce.getLineScale():1;q(pe,"stroke-width",Oe/Ue),q(pe,"paint-order",he?"stroke":"fill"),q(pe,"stroke-opacity",ce.strokeOpacity!=null?ce.strokeOpacity:ce.opacity);var Xe=ce.lineDash;Xe?(q(pe,"stroke-dasharray",ce.lineDash.join(",")),q(pe,"stroke-dashoffset",M(ce.lineDashOffset||0))):q(pe,"stroke-dasharray",""),ce.lineCap&&q(pe,"stroke-linecap",ce.lineCap),ce.lineJoin&&q(pe,"stroke-linejoin",ce.lineJoin),ce.miterLimit&&q(pe,"stroke-miterlimit",ce.miterLimit)}else q(pe,"stroke",S)}function Y(pe){for(var ce=[],he=pe.data,Ce=pe.len(),Se=0;Se=L:-Qe>=L),bt=Qe>0?Qe%L:Qe%L+L,gt=!1;At?gt=!0:k(Xt)?gt=!1:gt=bt>=D==!!Ot;var It=F(Xe+ut*P(Pt)),Jt=F(it+at*I(Pt));At&&(Ot?Qe=L-1e-4:Qe=-L+1e-4,gt=!0,Se===9&&ce.push("M",It,Jt));var bi=F(Xe+ut*P(Pt+Qe)),Yi=F(it+at*I(Pt+Qe));ce.push("A",F(ut),F(at),M(ft*R),+gt,+Ot,bi,Yi);break;case E.Z:Oe="Z";break;case E.R:var bi=F(he[Se++]),Yi=F(he[Se++]),ii=F(he[Se++]),ei=F(he[Se++]);ce.push("M",bi,Yi,"L",bi+ii,Yi,"L",bi+ii,Yi+ei,"L",bi,Yi+ei,"L",bi,Yi);break}Oe&&ce.push(Oe);for(var Li=0;LiJe){for(;ei{function m(){}m.prototype={diff:function(w,A,E){E||(E=function(U,G){return U===G}),this.equals=E;var T=this;w=w.slice(),A=A.slice();var S=A.length,M=w.length,I=1,P=S+M,D=[{newPos:-1,components:[]}],L=this.extractCommon(D[0],A,w,0);if(D[0].newPos+1>=S&&L+1>=M){for(var R=[],O=0;O=S&&J+1>=M)return v(T,G.components,A,w);D[U]=G}I++}for(;I<=P;){var k=F();if(k)return k}},pushComponent:function(w,A,E){var T=w[w.length-1];T&&T.added===A&&T.removed===E?w[w.length-1]={count:T.count+1,added:A,removed:E}:w.push({count:1,added:A,removed:E})},extractCommon:function(w,A,E,T){for(var S=A.length,M=E.length,I=w.newPos,P=I-T,D=0;I+1{var m=W0e(),v=m.createElement,y=Wi(),x=am(),C=rU(),w=nB(),A=j0e(),E=A.path,T=A.image,S=A.text,M="0",I="1";function P(L,R,O,F,k){this._zrId=L,this._svgRoot=R,this._tagNames=typeof O=="string"?[O]:O,this._markLabel=F,this._domName=k||"_dom",this.nextId=0}P.prototype.createElement=v,P.prototype.getDefs=function(L){var R=this._svgRoot,O=this._svgRoot.getElementsByTagName("defs");return O.length===0?L?(O=R.insertBefore(this.createElement("defs"),R.firstChild),O.contains||(O.contains=function(F){var k=O.children;if(!k)return!1;for(var U=k.length-1;U>=0;--U)if(k[U]===F)return!0;return!1}),O):null:O[0]},P.prototype.update=function(L,R){if(L){var O=this.getDefs(!1);if(L[this._domName]&&O.contains(L[this._domName]))typeof R=="function"&&R(L);else{var F=this.add(L);F&&(L[this._domName]=F)}}},P.prototype.addDom=function(L){var R=this.getDefs(!0);R.appendChild(L)},P.prototype.removeDom=function(L){var R=this.getDefs(!1);R&&L[this._domName]&&(R.removeChild(L[this._domName]),L[this._domName]=null)},P.prototype.getDoms=function(){var L=this.getDefs(!1);if(!L)return[];var R=[];return y.each(this._tagNames,function(O){var F=L.getElementsByTagName(O);R=R.concat([].slice.call(F))}),R},P.prototype.markAllUnused=function(){var L=this.getDoms(),R=this;y.each(L,function(O){O[R._markLabel]=M})},P.prototype.markUsed=function(L){L&&(L[this._markLabel]=I)},P.prototype.removeUnused=function(){var L=this.getDefs(!1);if(L){var R=this.getDoms(),O=this;y.each(R,function(F){F[O._markLabel]!==I&&L.removeChild(F)})}},P.prototype.getSvgProxy=function(L){return L instanceof x?E:L instanceof C?T:L instanceof w?S:E},P.prototype.getTextSvgElement=function(L){return L.__textSvgEl},P.prototype.getSvgElement=function(L){return L.__svgEl};var D=P;f.exports=D}),M1t=xt((o,f)=>{var m=Y0e(),v=Wi(),y=Bj(),x=k2();function C(A,E){m.call(this,A,E,["linearGradient","radialGradient"],"__gradient_in_use__")}v.inherits(C,m),C.prototype.addWithoutUpdate=function(A,E){if(E&&E.style){var T=this;v.each(["fill","stroke"],function(S){if(E.style[S]&&(E.style[S].type==="linear"||E.style[S].type==="radial")){var M=E.style[S],I=T.getDefs(!0),P;M._dom?(P=M._dom,I.contains(M._dom)||T.addDom(P)):P=T.add(M),T.markUsed(E);var D=P.getAttribute("id");A.setAttribute(S,"url(#"+D+")")}})}},C.prototype.add=function(A){var E;if(A.type==="linear")E=this.createElement("linearGradient");else if(A.type==="radial")E=this.createElement("radialGradient");else return y("Illegal gradient type."),null;return A.id=A.id||this.nextId++,E.setAttribute("id","zr"+this._zrId+"-gradient-"+A.id),this.updateDom(A,E),this.addDom(E),E},C.prototype.update=function(A){var E=this;m.prototype.update.call(this,A,function(){var T=A.type,S=A._dom.tagName;T==="linear"&&S==="linearGradient"||T==="radial"&&S==="radialGradient"?E.updateDom(A,A._dom):(E.removeDom(A),E.add(A))})},C.prototype.updateDom=function(A,E){if(A.type==="linear")E.setAttribute("x1",A.x),E.setAttribute("y1",A.y),E.setAttribute("x2",A.x2),E.setAttribute("y2",A.y2);else if(A.type==="radial")E.setAttribute("cx",A.x),E.setAttribute("cy",A.y),E.setAttribute("r",A.r);else{y("Illegal gradient type.");return}A.global?E.setAttribute("gradientUnits","userSpaceOnUse"):E.setAttribute("gradientUnits","objectBoundingBox"),E.innerHTML="";for(var T=A.colorStops,S=0,M=T.length;S-1)){var D=x.parse(P)[3],L=x.toHex(P);I.setAttribute("stop-color","#"+L),I.setAttribute("stop-opacity",D)}else I.setAttribute("stop-color",T[S].color);E.appendChild(I)}A._dom=E},C.prototype.markUsed=function(A){if(A.style){var E=A.style.fill;E&&E._dom&&m.prototype.markUsed.call(this,E._dom),E=A.style.stroke,E&&E._dom&&m.prototype.markUsed.call(this,E._dom)}};var w=C;f.exports=w}),D1t=xt((o,f)=>{var m=Y0e(),v=Wi(),y=Ky();function x(w,A){m.call(this,w,A,"clipPath","__clippath_in_use__")}v.inherits(x,m),x.prototype.update=function(w){var A=this.getSvgElement(w);A&&this.updateDom(A,w.__clipPaths,!1);var E=this.getTextSvgElement(w);E&&this.updateDom(E,w.__clipPaths,!0),this.markUsed(w)},x.prototype.updateDom=function(w,A,E){if(A&&A.length>0){var T=this.getDefs(!0),S=A[0],M,I,P=E?"_textDom":"_dom";S[P]?(I=S[P].getAttribute("id"),M=S[P],T.contains(M)||T.appendChild(M)):(I="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,M=this.createElement("clipPath"),M.setAttribute("id",I),T.appendChild(M),S[P]=M);var D=this.getSvgProxy(S);if(S.transform&&S.parent.invTransform&&!E){var L=Array.prototype.slice.call(S.transform);y.mul(S.transform,S.parent.invTransform,S.transform),D.brush(S),S.transform=L}else D.brush(S);var R=this.getSvgElement(S);M.innerHTML="",M.appendChild(R.cloneNode()),w.setAttribute("clip-path","url(#"+I+")"),A.length>1&&this.updateDom(M,A.slice(1),E)}else w&&w.setAttribute("clip-path","none")},x.prototype.markUsed=function(w){var A=this;w.__clipPaths&&v.each(w.__clipPaths,function(E){E._dom&&m.prototype.markUsed.call(A,E._dom),E._textDom&&m.prototype.markUsed.call(A,E._textDom)})};var C=x;f.exports=C}),L1t=xt((o,f)=>{var m=Y0e(),v=Wi();function y(w,A){m.call(this,w,A,["filter"],"__filter_in_use__","_shadowDom")}v.inherits(y,m),y.prototype.addWithoutUpdate=function(w,A){if(A&&x(A.style)){var E;if(A._shadowDom){E=A._shadowDom;var T=this.getDefs(!0);T.contains(A._shadowDom)||this.addDom(E)}else E=this.add(A);this.markUsed(A);var S=E.getAttribute("id");w.style.filter="url(#"+S+")"}},y.prototype.add=function(w){var A=this.createElement("filter");return w._shadowDomId=w._shadowDomId||this.nextId++,A.setAttribute("id","zr"+this._zrId+"-shadow-"+w._shadowDomId),this.updateDom(w,A),this.addDom(A),A},y.prototype.update=function(w,A){var E=A.style;if(x(E)){var T=this;m.prototype.update.call(this,A,function(){T.updateDom(A,A._shadowDom)})}else this.remove(w,A)},y.prototype.remove=function(w,A){A._shadowDomId!=null&&(this.removeDom(w),w.style.filter="")},y.prototype.updateDom=function(w,A){var E=A.getElementsByTagName("feDropShadow");E.length===0?E=this.createElement("feDropShadow"):E=E[0];var T=w.style,S=w.scale&&w.scale[0]||1,M=w.scale&&w.scale[1]||1,I,P,D,L;if(T.shadowBlur||T.shadowOffsetX||T.shadowOffsetY)I=T.shadowOffsetX||0,P=T.shadowOffsetY||0,D=T.shadowBlur,L=T.shadowColor;else if(T.textShadowBlur)I=T.textShadowOffsetX||0,P=T.textShadowOffsetY||0,D=T.textShadowBlur,L=T.textShadowColor;else{this.removeDom(A,T);return}E.setAttribute("dx",I/S),E.setAttribute("dy",P/M),E.setAttribute("flood-color",L);var R=D/2/S,O=D/2/M,F=R+" "+O;E.setAttribute("stdDeviation",F),A.setAttribute("x","-100%"),A.setAttribute("y","-100%"),A.setAttribute("width",Math.ceil(D/2*200)+"%"),A.setAttribute("height",Math.ceil(D/2*200)+"%"),A.appendChild(E),w._shadowDom=A},y.prototype.markUsed=function(w){w._shadowDom&&m.prototype.markUsed.call(this,w._shadowDom)};function x(w){return w&&(w.shadowBlur||w.shadowOffsetX||w.shadowOffsetY||w.textShadowBlur||w.textShadowOffsetX||w.textShadowOffsetY)}var C=y;f.exports=C}),R1t=xt((o,f)=>{var m=W0e(),v=m.createElement,y=Wi(),x=Bj(),C=am(),w=rU(),A=nB(),E=I1t(),T=M1t(),S=D1t(),M=L1t(),I=j0e(),P=I.path,D=I.image,L=I.text;function R(Q){return parseInt(Q,10)}function O(Q){return Q instanceof C?P:Q instanceof w?D:Q instanceof A?L:P}function F(Q,ee){return ee&&Q&&ee.parentNode!==Q}function k(Q,ee,z){if(F(Q,ee)&&z){var ie=z.nextSibling;ie?Q.insertBefore(ee,ie):Q.appendChild(ee)}}function U(Q,ee){if(F(Q,ee)){var z=Q.firstChild;z?Q.insertBefore(ee,z):Q.appendChild(ee)}}function G(Q,ee){ee&&Q&&ee.parentNode===Q&&Q.removeChild(ee)}function j(Q){return Q.__textSvgEl}function q(Q){return Q.__svgEl}var J=function(Q,ee,z,ie){this.root=Q,this.storage=ee,this._opts=z=y.extend({},z||{});var re=v("svg");re.setAttribute("xmlns","http://www.w3.org/2000/svg"),re.setAttribute("version","1.1"),re.setAttribute("baseProfile","full"),re.style.cssText="user-select:none;position:absolute;left:0;top:0;";var ne=v("g");re.appendChild(ne);var oe=v("g");re.appendChild(oe),this.gradientManager=new T(ie,oe),this.clipPathManager=new S(ie,oe),this.shadowManager=new M(ie,oe);var se=document.createElement("div");se.style.cssText="overflow:hidden;position:relative",this._svgDom=re,this._svgRoot=oe,this._backgroundRoot=ne,this._viewport=se,Q.appendChild(se),se.appendChild(re),this.resize(z.width,z.height),this._visibleList=[]};J.prototype={constructor:J,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var Q=this.getViewportRoot();if(Q)return{offsetLeft:Q.offsetLeft||0,offsetTop:Q.offsetTop||0}},refresh:function(){var Q=this.storage.getDisplayList(!0);this._paintList(Q)},setBackgroundColor:function(Q){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var ee=v("rect");ee.setAttribute("width",this.getWidth()),ee.setAttribute("height",this.getHeight()),ee.setAttribute("x",0),ee.setAttribute("y",0),ee.setAttribute("id",0),ee.style.fill=Q,this._backgroundRoot.appendChild(ee),this._backgroundNode=ee},_paintList:function(Q){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var ee=this._svgRoot,z=this._visibleList,ie=Q.length,re=[],ne;for(ne=0;ne=0;--oe)if(ne[oe]===re)return!0;return!1}),z}else return null;else return z[0]},resize:function(Q,ee){var z=this._viewport;z.style.display="none";var ie=this._opts;if(Q!=null&&(ie.width=Q),ee!=null&&(ie.height=ee),Q=this._getSize(0),ee=this._getSize(1),z.style.display="",this._width!==Q||this._height!==ee){this._width=Q,this._height=ee;var re=z.style;re.width=Q+"px",re.height=ee+"px";var ne=this._svgDom;ne.setAttribute("width",Q),ne.setAttribute("height",ee)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",Q),this._backgroundNode.setAttribute("height",ee))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(Q){var ee=this._opts,z=["width","height"][Q],ie=["clientWidth","clientHeight"][Q],re=["paddingLeft","paddingTop"][Q],ne=["paddingRight","paddingBottom"][Q];if(ee[z]!=null&&ee[z]!=="auto")return parseFloat(ee[z]);var oe=this.root,se=document.defaultView.getComputedStyle(oe);return(oe[ie]||R(se[z])||R(oe.style[z]))-(R(se[re])||0)-(R(se[ne])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){this.refresh();var Q=encodeURIComponent(this._svgDom.outerHTML.replace(/> \r<`));return"data:image/svg+xml;charset=UTF-8,"+Q}};function X(Q){return function(){x('In SVG mode painter not support method "'+Q+'"')}}y.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],function(Q){J.prototype[Q]=X(Q)});var Y=J;f.exports=Y}),O1t=xt(()=>{j0e();var o=bie(),f=o.registerPainter,m=R1t();f("svg",m)}),$Ge=xt(o=>{var f=fo();(function(){for(var v in f){if(f==null||!f.hasOwnProperty(v)||v==="default"||v==="__esModule")return;o[v]=f[v]}})();var m=iGe();(function(){for(var v in m){if(m==null||!m.hasOwnProperty(v)||v==="default"||v==="__esModule")return;o[v]=m[v]}})(),Y8e(),fvt(),vvt(),wvt(),Svt(),Bvt(),Qvt(),ryt(),hyt(),Tyt(),Myt(),Oyt(),Yyt(),Zyt(),rxt(),uxt(),fxt(),yxt(),wxt(),Txt(),zxt(),Yxt(),Zxt(),$xt(),hCt(),pCt(),LGe(),wGe(),vCt(),yCt(),DCt(),FCt(),Qj(),GCt(),WCt(),$Ct(),i1t(),o1t(),l1t(),p1t(),VGe(),x1t(),HGe(),zGe(),E1t(),KGe(),QGe(),P1t(),O1t()}),N1t=xt((o,f)=>{/*! @license DOMPurify 3.0.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.3/LICENSE */(function(m,v){typeof o=="object"&&typeof f<"u"?f.exports=v():typeof define=="function"&&define.amd?define(v):(m=typeof globalThis<"u"?globalThis:m||self,m.DOMPurify=v())})(o,function(){"use strict";let{entries:m,setPrototypeOf:v,isFrozen:y,getPrototypeOf:x,getOwnPropertyDescriptor:C}=Object,{freeze:w,seal:A,create:E}=Object,{apply:T,construct:S}=typeof Reflect<"u"&&Reflect;T||(T=function(Qe,ft,Ot){return Qe.apply(ft,Ot)}),w||(w=function(Qe){return Qe}),A||(A=function(Qe){return Qe}),S||(S=function(Qe,ft){return new Qe(...ft)});let M=j(Array.prototype.forEach),I=j(Array.prototype.pop),P=j(Array.prototype.push),D=j(String.prototype.toLowerCase),L=j(String.prototype.toString),R=j(String.prototype.match),O=j(String.prototype.replace),F=j(String.prototype.indexOf),k=j(String.prototype.trim),U=j(RegExp.prototype.test),G=q(TypeError);function j(Qe){return function(ft){for(var Ot=arguments.length,Xt=new Array(Ot>1?Ot-1:0),At=1;At/gm),ce=A(/\${[\w\W]*}/gm),he=A(/^data-[\-\w.\u00B7-\uFFFF]/),Ce=A(/^aria-[\-\w]+$/),Se=A(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),De=A(/^(?:\w+script|data):/i),Oe=A(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ue=A(/^html$/i);var Xe=Object.freeze({__proto__:null,MUSTACHE_EXPR:ve,ERB_EXPR:pe,TMPLIT_EXPR:ce,DATA_ATTR:he,ARIA_ATTR:Ce,IS_ALLOWED_URI:Se,IS_SCRIPT_OR_DATA:De,ATTR_WHITESPACE:Oe,DOCTYPE_NAME:Ue});let it=()=>typeof window>"u"?null:window,ut=function(Qe,ft){if(typeof Qe!="object"||typeof Qe.createPolicy!="function")return null;let Ot=null,Xt="data-tt-policy-suffix";ft&&ft.hasAttribute(Xt)&&(Ot=ft.getAttribute(Xt));let At="dompurify"+(Ot?"#"+Ot:"");try{return Qe.createPolicy(At,{createHTML(bt){return bt},createScriptURL(bt){return bt}})}catch{return console.warn("TrustedTypes policy "+At+" could not be created."),null}};function at(){let Qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:it(),ft=rr=>at(rr);if(ft.version="3.0.3",ft.removed=[],!Qe||!Qe.document||Qe.document.nodeType!==9)return ft.isSupported=!1,ft;let Ot=Qe.document,Xt=Ot.currentScript,{document:At}=Qe,{DocumentFragment:bt,HTMLTemplateElement:gt,Node:It,Element:Jt,NodeFilter:bi,NamedNodeMap:Yi=Qe.NamedNodeMap||Qe.MozNamedAttrMap,HTMLFormElement:ii,DOMParser:ei,trustedTypes:Li}=Qe,Je=Jt.prototype,Nt=Y(Je,"cloneNode"),yi=Y(Je,"nextSibling"),ai=Y(Je,"childNodes"),wi=Y(Je,"parentNode");if(typeof gt=="function"){let rr=At.createElement("template");rr.content&&rr.content.ownerDocument&&(At=rr.content.ownerDocument)}let ji,hi="",{implementation:Ri,createNodeIterator:pt,createDocumentFragment:wr,getElementsByTagName:zi}=At,{importNode:Ui}=Ot,Gt={};ft.isSupported=typeof m=="function"&&typeof wi=="function"&&Ri&&Ri.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:$t,ERB_EXPR:jt,TMPLIT_EXPR:ct,DATA_ATTR:Pe,ARIA_ATTR:Ht,IS_SCRIPT_OR_DATA:si,ATTR_WHITESPACE:_t}=Xe,{IS_ALLOWED_URI:Yt}=Xe,Fi=null,Dt=J({},[...Q,...ee,...z,...re,...oe]),Lt=null,Si=J({},[...se,...ae,...fe,...de]),nt=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),wt=null,yt=null,Tt=!0,Et=!0,ti=!1,ir=!0,or=!1,xr=!1,Tn=!1,Ii=!1,pr=!1,yn=!1,dn=!1,fn=!0,Or=!1,On="user-content-",eo=!0,Cn=!1,Sa={},Va=null,za=J({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),zr=null,Ci=J({},["audio","video","img","source","image","track"]),Ni=null,cr=J({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Bi="http://www.w3.org/1998/Math/MathML",Ct="http://www.w3.org/2000/svg",Mi="http://www.w3.org/1999/xhtml",$i=Mi,ur=!1,Nr=null,qe=J({},[Bi,Ct,Mi],L),tt,$e=["application/xhtml+xml","text/html"],St="text/html",Zt,ui=null,hr=At.createElement("form"),Yr=function(rr){return rr instanceof RegExp||rr instanceof Function},ln=function(rr){if(!(ui&&ui===rr)){if((!rr||typeof rr!="object")&&(rr={}),rr=X(rr),tt=$e.indexOf(rr.PARSER_MEDIA_TYPE)===-1?tt=St:tt=rr.PARSER_MEDIA_TYPE,Zt=tt==="application/xhtml+xml"?L:D,Fi="ALLOWED_TAGS"in rr?J({},rr.ALLOWED_TAGS,Zt):Dt,Lt="ALLOWED_ATTR"in rr?J({},rr.ALLOWED_ATTR,Zt):Si,Nr="ALLOWED_NAMESPACES"in rr?J({},rr.ALLOWED_NAMESPACES,L):qe,Ni="ADD_URI_SAFE_ATTR"in rr?J(X(cr),rr.ADD_URI_SAFE_ATTR,Zt):cr,zr="ADD_DATA_URI_TAGS"in rr?J(X(Ci),rr.ADD_DATA_URI_TAGS,Zt):Ci,Va="FORBID_CONTENTS"in rr?J({},rr.FORBID_CONTENTS,Zt):za,wt="FORBID_TAGS"in rr?J({},rr.FORBID_TAGS,Zt):{},yt="FORBID_ATTR"in rr?J({},rr.FORBID_ATTR,Zt):{},Sa="USE_PROFILES"in rr?rr.USE_PROFILES:!1,Tt=rr.ALLOW_ARIA_ATTR!==!1,Et=rr.ALLOW_DATA_ATTR!==!1,ti=rr.ALLOW_UNKNOWN_PROTOCOLS||!1,ir=rr.ALLOW_SELF_CLOSE_IN_ATTR!==!1,or=rr.SAFE_FOR_TEMPLATES||!1,xr=rr.WHOLE_DOCUMENT||!1,pr=rr.RETURN_DOM||!1,yn=rr.RETURN_DOM_FRAGMENT||!1,dn=rr.RETURN_TRUSTED_TYPE||!1,Ii=rr.FORCE_BODY||!1,fn=rr.SANITIZE_DOM!==!1,Or=rr.SANITIZE_NAMED_PROPS||!1,eo=rr.KEEP_CONTENT!==!1,Cn=rr.IN_PLACE||!1,Yt=rr.ALLOWED_URI_REGEXP||Se,$i=rr.NAMESPACE||Mi,nt=rr.CUSTOM_ELEMENT_HANDLING||{},rr.CUSTOM_ELEMENT_HANDLING&&Yr(rr.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(nt.tagNameCheck=rr.CUSTOM_ELEMENT_HANDLING.tagNameCheck),rr.CUSTOM_ELEMENT_HANDLING&&Yr(rr.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(nt.attributeNameCheck=rr.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),rr.CUSTOM_ELEMENT_HANDLING&&typeof rr.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(nt.allowCustomizedBuiltInElements=rr.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),or&&(Et=!1),yn&&(pr=!0),Sa&&(Fi=J({},[...oe]),Lt=[],Sa.html===!0&&(J(Fi,Q),J(Lt,se)),Sa.svg===!0&&(J(Fi,ee),J(Lt,ae),J(Lt,de)),Sa.svgFilters===!0&&(J(Fi,z),J(Lt,ae),J(Lt,de)),Sa.mathMl===!0&&(J(Fi,re),J(Lt,fe),J(Lt,de))),rr.ADD_TAGS&&(Fi===Dt&&(Fi=X(Fi)),J(Fi,rr.ADD_TAGS,Zt)),rr.ADD_ATTR&&(Lt===Si&&(Lt=X(Lt)),J(Lt,rr.ADD_ATTR,Zt)),rr.ADD_URI_SAFE_ATTR&&J(Ni,rr.ADD_URI_SAFE_ATTR,Zt),rr.FORBID_CONTENTS&&(Va===za&&(Va=X(Va)),J(Va,rr.FORBID_CONTENTS,Zt)),eo&&(Fi["#text"]=!0),xr&&J(Fi,["html","head","body"]),Fi.table&&(J(Fi,["tbody"]),delete wt.tbody),rr.TRUSTED_TYPES_POLICY){if(typeof rr.TRUSTED_TYPES_POLICY.createHTML!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof rr.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw G('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');ji=rr.TRUSTED_TYPES_POLICY,hi=ji.createHTML("")}else ji===void 0&&(ji=ut(Li,Xt)),ji!==null&&typeof hi=="string"&&(hi=ji.createHTML(""));w&&w(rr),ui=rr}},Kn=J({},["mi","mo","mn","ms","mtext"]),Un=J({},["foreignobject","desc","title","annotation-xml"]),Qn=J({},["title","style","font","a","script"]),Pa=J({},ee);J(Pa,z),J(Pa,ie);let Gn=J({},re);J(Gn,ne);let Ja=function(rr){let mo=wi(rr);(!mo||!mo.tagName)&&(mo={namespaceURI:$i,tagName:"template"});let Wn=D(rr.tagName),yo=D(mo.tagName);return Nr[rr.namespaceURI]?rr.namespaceURI===Ct?mo.namespaceURI===Mi?Wn==="svg":mo.namespaceURI===Bi?Wn==="svg"&&(yo==="annotation-xml"||Kn[yo]):!!Pa[Wn]:rr.namespaceURI===Bi?mo.namespaceURI===Mi?Wn==="math":mo.namespaceURI===Ct?Wn==="math"&&Un[yo]:!!Gn[Wn]:rr.namespaceURI===Mi?mo.namespaceURI===Ct&&!Un[yo]||mo.namespaceURI===Bi&&!Kn[yo]?!1:!Gn[Wn]&&(Qn[Wn]||!Pa[Wn]):!!(tt==="application/xhtml+xml"&&Nr[rr.namespaceURI]):!1},fl=function(rr){P(ft.removed,{element:rr});try{rr.parentNode.removeChild(rr)}catch{rr.remove()}},Ul=function(rr,mo){try{P(ft.removed,{attribute:mo.getAttributeNode(rr),from:mo})}catch{P(ft.removed,{attribute:null,from:mo})}if(mo.removeAttribute(rr),rr==="is"&&!Lt[rr])if(pr||yn)try{fl(mo)}catch{}else try{mo.setAttribute(rr,"")}catch{}},hu=function(rr){let mo,Wn;if(Ii)rr=""+rr;else{let xu=R(rr,/^[\r\n\t ]+/);Wn=xu&&xu[0]}tt==="application/xhtml+xml"&&$i===Mi&&(rr=''+rr+"");let yo=ji?ji.createHTML(rr):rr;if($i===Mi)try{mo=new ei().parseFromString(yo,tt)}catch{}if(!mo||!mo.documentElement){mo=Ri.createDocument($i,"template",null);try{mo.documentElement.innerHTML=ur?hi:yo}catch{}}let Ga=mo.body||mo.documentElement;return rr&&Wn&&Ga.insertBefore(At.createTextNode(Wn),Ga.childNodes[0]||null),$i===Mi?zi.call(mo,xr?"html":"body")[0]:xr?mo.documentElement:Ga},Ys=function(rr){return pt.call(rr.ownerDocument||rr,rr,bi.SHOW_ELEMENT|bi.SHOW_COMMENT|bi.SHOW_TEXT,null,!1)},Wd=function(rr){return rr instanceof ii&&(typeof rr.nodeName!="string"||typeof rr.textContent!="string"||typeof rr.removeChild!="function"||!(rr.attributes instanceof Yi)||typeof rr.removeAttribute!="function"||typeof rr.setAttribute!="function"||typeof rr.namespaceURI!="string"||typeof rr.insertBefore!="function"||typeof rr.hasChildNodes!="function")},Pc=function(rr){return typeof It=="object"?rr instanceof It:rr&&typeof rr=="object"&&typeof rr.nodeType=="number"&&typeof rr.nodeName=="string"},So=function(rr,mo,Wn){Gt[rr]&&M(Gt[rr],yo=>{yo.call(ft,mo,Wn,ui)})},Kh=function(rr){let mo;if(So("beforeSanitizeElements",rr,null),Wd(rr))return fl(rr),!0;let Wn=Zt(rr.nodeName);if(So("uponSanitizeElement",rr,{tagName:Wn,allowedTags:Fi}),rr.hasChildNodes()&&!Pc(rr.firstElementChild)&&(!Pc(rr.content)||!Pc(rr.content.firstElementChild))&&U(/<[/\w]/g,rr.innerHTML)&&U(/<[/\w]/g,rr.textContent))return fl(rr),!0;if(!Fi[Wn]||wt[Wn]){if(!wt[Wn]&&Gl(Wn)&&(nt.tagNameCheck instanceof RegExp&&U(nt.tagNameCheck,Wn)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(Wn)))return!1;if(eo&&!Va[Wn]){let yo=wi(rr)||rr.parentNode,Ga=ai(rr)||rr.childNodes;if(Ga&&yo){let xu=Ga.length;for(let qs=xu-1;qs>=0;--qs)yo.insertBefore(Nt(Ga[qs],!0),yi(rr))}}return fl(rr),!0}return rr instanceof Jt&&!Ja(rr)||(Wn==="noscript"||Wn==="noembed")&&U(/<\/no(script|embed)/i,rr.innerHTML)?(fl(rr),!0):(or&&rr.nodeType===3&&(mo=rr.textContent,mo=O(mo,$t," "),mo=O(mo,jt," "),mo=O(mo,ct," "),rr.textContent!==mo&&(P(ft.removed,{element:rr.cloneNode()}),rr.textContent=mo)),So("afterSanitizeElements",rr,null),!1)},mf=function(rr,mo,Wn){if(fn&&(mo==="id"||mo==="name")&&(Wn in At||Wn in hr))return!1;if(!(Et&&!yt[mo]&&U(Pe,mo))&&!(Tt&&U(Ht,mo))){if(!Lt[mo]||yt[mo]){if(!(Gl(rr)&&(nt.tagNameCheck instanceof RegExp&&U(nt.tagNameCheck,rr)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(rr))&&(nt.attributeNameCheck instanceof RegExp&&U(nt.attributeNameCheck,mo)||nt.attributeNameCheck instanceof Function&&nt.attributeNameCheck(mo))||mo==="is"&&nt.allowCustomizedBuiltInElements&&(nt.tagNameCheck instanceof RegExp&&U(nt.tagNameCheck,Wn)||nt.tagNameCheck instanceof Function&&nt.tagNameCheck(Wn))))return!1}else if(!Ni[mo]&&!U(Yt,O(Wn,_t,""))&&!((mo==="src"||mo==="xlink:href"||mo==="href")&&rr!=="script"&&F(Wn,"data:")===0&&zr[rr])&&!(ti&&!U(si,O(Wn,_t,"")))&&Wn)return!1}return!0},Gl=function(rr){return rr.indexOf("-")>0},Wl=function(rr){let mo,Wn,yo,Ga;So("beforeSanitizeAttributes",rr,null);let{attributes:xu}=rr;if(!xu)return;let qs={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Lt};for(Ga=xu.length;Ga--;){mo=xu[Ga];let{name:Cu,namespaceURI:na}=mo;if(Wn=Cu==="value"?mo.value:k(mo.value),yo=Zt(Cu),qs.attrName=yo,qs.attrValue=Wn,qs.keepAttr=!0,qs.forceKeepAttr=void 0,So("uponSanitizeAttribute",rr,qs),Wn=qs.attrValue,qs.forceKeepAttr||(Ul(Cu,rr),!qs.keepAttr))continue;if(!ir&&U(/\/>/i,Wn)){Ul(Cu,rr);continue}or&&(Wn=O(Wn,$t," "),Wn=O(Wn,jt," "),Wn=O(Wn,ct," "));let gf=Zt(rr.nodeName);if(mf(gf,yo,Wn)){if(Or&&(yo==="id"||yo==="name")&&(Ul(Cu,rr),Wn=On+Wn),ji&&typeof Li=="object"&&typeof Li.getAttributeType=="function"&&!na)switch(Li.getAttributeType(gf,yo)){case"TrustedHTML":{Wn=ji.createHTML(Wn);break}case"TrustedScriptURL":{Wn=ji.createScriptURL(Wn);break}}try{na?rr.setAttributeNS(na,Cu,Wn):rr.setAttribute(Cu,Wn),I(ft.removed)}catch{}}}So("afterSanitizeAttributes",rr,null)},Th=function rr(mo){let Wn,yo=Ys(mo);for(So("beforeSanitizeShadowDOM",mo,null);Wn=yo.nextNode();)So("uponSanitizeShadowNode",Wn,null),!Kh(Wn)&&(Wn.content instanceof bt&&rr(Wn.content),Wl(Wn));So("afterSanitizeShadowDOM",mo,null)};return ft.sanitize=function(rr){let mo=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Wn,yo,Ga,xu;if(ur=!rr,ur&&(rr=""),typeof rr!="string"&&!Pc(rr))if(typeof rr.toString=="function"){if(rr=rr.toString(),typeof rr!="string")throw G("dirty is not a string, aborting")}else throw G("toString is not a function");if(!ft.isSupported)return rr;if(Tn||ln(mo),ft.removed=[],typeof rr=="string"&&(Cn=!1),Cn){if(rr.nodeName){let na=Zt(rr.nodeName);if(!Fi[na]||wt[na])throw G("root node is forbidden and cannot be sanitized in-place")}}else if(rr instanceof It)Wn=hu(""),yo=Wn.ownerDocument.importNode(rr,!0),yo.nodeType===1&&yo.nodeName==="BODY"||yo.nodeName==="HTML"?Wn=yo:Wn.appendChild(yo);else{if(!pr&&!or&&!xr&&rr.indexOf("<")===-1)return ji&&dn?ji.createHTML(rr):rr;if(Wn=hu(rr),!Wn)return pr?null:dn?hi:""}Wn&&Ii&&fl(Wn.firstChild);let qs=Ys(Cn?rr:Wn);for(;Ga=qs.nextNode();)Kh(Ga)||(Ga.content instanceof bt&&Th(Ga.content),Wl(Ga));if(Cn)return rr;if(pr){if(yn)for(xu=wr.call(Wn.ownerDocument);Wn.firstChild;)xu.appendChild(Wn.firstChild);else xu=Wn;return(Lt.shadowroot||Lt.shadowrootmod)&&(xu=Ui.call(Ot,xu,!0)),xu}let Cu=xr?Wn.outerHTML:Wn.innerHTML;return xr&&Fi["!doctype"]&&Wn.ownerDocument&&Wn.ownerDocument.doctype&&Wn.ownerDocument.doctype.name&&U(Ue,Wn.ownerDocument.doctype.name)&&(Cu=" `+Cu),or&&(Cu=O(Cu,$t," "),Cu=O(Cu,jt," "),Cu=O(Cu,ct," ")),ji&&dn?ji.createHTML(Cu):Cu},ft.setConfig=function(rr){ln(rr),Tn=!0},ft.clearConfig=function(){ui=null,Tn=!1},ft.isValidAttribute=function(rr,mo,Wn){ui||ln({});let yo=Zt(rr),Ga=Zt(mo);return mf(yo,Ga,Wn)},ft.addHook=function(rr,mo){typeof mo=="function"&&(Gt[rr]=Gt[rr]||[],P(Gt[rr],mo))},ft.removeHook=function(rr){if(Gt[rr])return I(Gt[rr])},ft.removeHooks=function(rr){Gt[rr]&&(Gt[rr]=[])},ft.removeAllHooks=function(){Gt={}},ft}var Pt=at();return Pt})}),F1t=xt((o,f)=>{"use strict";f.exports=m,f.exports.default=m;function m(oe,se,ae){ae=ae||2;var fe=se&&se.length,de=fe?se[0]*ae:oe.length,ve=v(oe,0,de,ae,!0),pe=[];if(!ve||ve.next===ve.prev)return pe;var ce,he,Ce,Se,De,Oe,Ue;if(fe&&(ve=T(oe,se,ve,ae)),oe.length>80*ae){ce=Ce=oe[0],he=Se=oe[1];for(var Xe=ae;XeCe&&(Ce=De),Oe>Se&&(Se=Oe);Ue=Math.max(Ce-ce,Se-he),Ue=Ue!==0?32767/Ue:0}return x(ve,pe,ae,ce,he,Ue,0),pe}function v(oe,se,ae,fe,de){var ve,pe;if(de===ne(oe,se,ae,fe)>0)for(ve=se;ve=se;ve-=fe)pe=z(ve,oe[ve],oe[ve+1],pe);return pe&&G(pe,pe.next)&&(ie(pe),pe=pe.next),pe}function y(oe,se){if(!oe)return oe;se||(se=oe);var ae=oe,fe;do if(fe=!1,!ae.steiner&&(G(ae,ae.next)||U(ae.prev,ae,ae.next)===0)){if(ie(ae),ae=se=ae.prev,ae===ae.next)break;fe=!0}else ae=ae.next;while(fe||ae!==se);return se}function x(oe,se,ae,fe,de,ve,pe){if(oe){!pe&&ve&&D(oe,fe,de,ve);for(var ce=oe,he,Ce;oe.prev!==oe.next;){if(he=oe.prev,Ce=oe.next,ve?w(oe,fe,de,ve):C(oe)){se.push(he.i/ae|0),se.push(oe.i/ae|0),se.push(Ce.i/ae|0),ie(oe),oe=Ce.next,ce=Ce.next;continue}if(oe=Ce,oe===ce){pe?pe===1?(oe=A(y(oe),se,ae),x(oe,se,ae,fe,de,ve,2)):pe===2&&E(oe,se,ae,fe,de,ve):x(y(oe),se,ae,fe,de,ve,1);break}}}}function C(oe){var se=oe.prev,ae=oe,fe=oe.next;if(U(se,ae,fe)>=0)return!1;for(var de=se.x,ve=ae.x,pe=fe.x,ce=se.y,he=ae.y,Ce=fe.y,Se=deve?de>pe?de:pe:ve>pe?ve:pe,Ue=ce>he?ce>Ce?ce:Ce:he>Ce?he:Ce,Xe=fe.next;Xe!==se;){if(Xe.x>=Se&&Xe.x<=Oe&&Xe.y>=De&&Xe.y<=Ue&&F(de,ce,ve,he,pe,Ce,Xe.x,Xe.y)&&U(Xe.prev,Xe,Xe.next)>=0)return!1;Xe=Xe.next}return!0}function w(oe,se,ae,fe){var de=oe.prev,ve=oe,pe=oe.next;if(U(de,ve,pe)>=0)return!1;for(var ce=de.x,he=ve.x,Ce=pe.x,Se=de.y,De=ve.y,Oe=pe.y,Ue=cehe?ce>Ce?ce:Ce:he>Ce?he:Ce,ut=Se>De?Se>Oe?Se:Oe:De>Oe?De:Oe,at=R(Ue,Xe,se,ae,fe),Pt=R(it,ut,se,ae,fe),Qe=oe.prevZ,ft=oe.nextZ;Qe&&Qe.z>=at&&ft&&ft.z<=Pt;){if(Qe.x>=Ue&&Qe.x<=it&&Qe.y>=Xe&&Qe.y<=ut&&Qe!==de&&Qe!==pe&&F(ce,Se,he,De,Ce,Oe,Qe.x,Qe.y)&&U(Qe.prev,Qe,Qe.next)>=0||(Qe=Qe.prevZ,ft.x>=Ue&&ft.x<=it&&ft.y>=Xe&&ft.y<=ut&&ft!==de&&ft!==pe&&F(ce,Se,he,De,Ce,Oe,ft.x,ft.y)&&U(ft.prev,ft,ft.next)>=0))return!1;ft=ft.nextZ}for(;Qe&&Qe.z>=at;){if(Qe.x>=Ue&&Qe.x<=it&&Qe.y>=Xe&&Qe.y<=ut&&Qe!==de&&Qe!==pe&&F(ce,Se,he,De,Ce,Oe,Qe.x,Qe.y)&&U(Qe.prev,Qe,Qe.next)>=0)return!1;Qe=Qe.prevZ}for(;ft&&ft.z<=Pt;){if(ft.x>=Ue&&ft.x<=it&&ft.y>=Xe&&ft.y<=ut&&ft!==de&&ft!==pe&&F(ce,Se,he,De,Ce,Oe,ft.x,ft.y)&&U(ft.prev,ft,ft.next)>=0)return!1;ft=ft.nextZ}return!0}function A(oe,se,ae){var fe=oe;do{var de=fe.prev,ve=fe.next.next;!G(de,ve)&&j(de,fe,fe.next,ve)&&Y(de,ve)&&Y(ve,de)&&(se.push(de.i/ae|0),se.push(fe.i/ae|0),se.push(ve.i/ae|0),ie(fe),ie(fe.next),fe=oe=ve),fe=fe.next}while(fe!==oe);return y(fe)}function E(oe,se,ae,fe,de,ve){var pe=oe;do{for(var ce=pe.next.next;ce!==pe.prev;){if(pe.i!==ce.i&&k(pe,ce)){var he=ee(pe,ce);pe=y(pe,pe.next),he=y(he,he.next),x(pe,se,ae,fe,de,ve,0),x(he,se,ae,fe,de,ve,0);return}ce=ce.next}pe=pe.next}while(pe!==oe)}function T(oe,se,ae,fe){var de=[],ve,pe,ce,he,Ce;for(ve=0,pe=se.length;ve=ae.next.y&&ae.next.y!==ae.y){var ce=ae.x+(de-ae.y)*(ae.next.x-ae.x)/(ae.next.y-ae.y);if(ce<=fe&&ce>ve&&(ve=ce,pe=ae.x=ae.x&&ae.x>=Ce&&fe!==ae.x&&F(depe.x||ae.x===pe.x&&P(pe,ae)))&&(pe=ae,De=Oe)),ae=ae.next;while(ae!==he);return pe}function P(oe,se){return U(oe.prev,oe,se.prev)<0&&U(se.next,oe,oe.next)<0}function D(oe,se,ae,fe){var de=oe;do de.z===0&&(de.z=R(de.x,de.y,se,ae,fe)),de.prevZ=de.prev,de.nextZ=de.next,de=de.next;while(de!==oe);de.prevZ.nextZ=null,de.prevZ=null,L(de)}function L(oe){var se,ae,fe,de,ve,pe,ce,he,Ce=1;do{for(ae=oe,oe=null,ve=null,pe=0;ae;){for(pe++,fe=ae,ce=0,se=0;se0||he>0&&fe;)ce!==0&&(he===0||!fe||ae.z<=fe.z)?(de=ae,ae=ae.nextZ,ce--):(de=fe,fe=fe.nextZ,he--),ve?ve.nextZ=de:oe=de,de.prevZ=ve,ve=de;ae=fe}ve.nextZ=null,Ce*=2}while(pe>1);return oe}function R(oe,se,ae,fe,de){return oe=(oe-ae)*de|0,se=(se-fe)*de|0,oe=(oe|oe<<8)&16711935,oe=(oe|oe<<4)&252645135,oe=(oe|oe<<2)&858993459,oe=(oe|oe<<1)&1431655765,se=(se|se<<8)&16711935,se=(se|se<<4)&252645135,se=(se|se<<2)&858993459,se=(se|se<<1)&1431655765,oe|se<<1}function O(oe){var se=oe,ae=oe;do(se.x=(oe-pe)*(ve-ce)&&(oe-pe)*(fe-ce)>=(ae-pe)*(se-ce)&&(ae-pe)*(ve-ce)>=(de-pe)*(fe-ce)}function k(oe,se){return oe.next.i!==se.i&&oe.prev.i!==se.i&&!X(oe,se)&&(Y(oe,se)&&Y(se,oe)&&Q(oe,se)&&(U(oe.prev,oe,se.prev)||U(oe,se.prev,se))||G(oe,se)&&U(oe.prev,oe,oe.next)>0&&U(se.prev,se,se.next)>0)}function U(oe,se,ae){return(se.y-oe.y)*(ae.x-se.x)-(se.x-oe.x)*(ae.y-se.y)}function G(oe,se){return oe.x===se.x&&oe.y===se.y}function j(oe,se,ae,fe){var de=J(U(oe,se,ae)),ve=J(U(oe,se,fe)),pe=J(U(ae,fe,oe)),ce=J(U(ae,fe,se));return!!(de!==ve&&pe!==ce||de===0&&q(oe,ae,se)||ve===0&&q(oe,fe,se)||pe===0&&q(ae,oe,fe)||ce===0&&q(ae,se,fe))}function q(oe,se,ae){return se.x<=Math.max(oe.x,ae.x)&&se.x>=Math.min(oe.x,ae.x)&&se.y<=Math.max(oe.y,ae.y)&&se.y>=Math.min(oe.y,ae.y)}function J(oe){return oe>0?1:oe<0?-1:0}function X(oe,se){var ae=oe;do{if(ae.i!==oe.i&&ae.next.i!==oe.i&&ae.i!==se.i&&ae.next.i!==se.i&&j(ae,ae.next,oe,se))return!0;ae=ae.next}while(ae!==oe);return!1}function Y(oe,se){return U(oe.prev,oe,oe.next)<0?U(oe,se,oe.next)>=0&&U(oe,oe.prev,se)>=0:U(oe,se,oe.prev)<0||U(oe,oe.next,se)<0}function Q(oe,se){var ae=oe,fe=!1,de=(oe.x+se.x)/2,ve=(oe.y+se.y)/2;do ae.y>ve!=ae.next.y>ve&&ae.next.y!==ae.y&&de<(ae.next.x-ae.x)*(ve-ae.y)/(ae.next.y-ae.y)+ae.x&&(fe=!fe),ae=ae.next;while(ae!==oe);return fe}function ee(oe,se){var ae=new re(oe.i,oe.x,oe.y),fe=new re(se.i,se.x,se.y),de=oe.next,ve=se.prev;return oe.next=se,se.prev=oe,ae.next=de,de.prev=ae,fe.next=ae,ae.prev=fe,ve.next=fe,fe.prev=ve,fe}function z(oe,se,ae,fe){var de=new re(oe,se,ae);return fe?(de.next=fe.next,de.prev=fe,fe.next.prev=de,fe.next=de):(de.prev=de,de.next=de),de}function ie(oe){oe.next.prev=oe.prev,oe.prev.next=oe.next,oe.prevZ&&(oe.prevZ.nextZ=oe.nextZ),oe.nextZ&&(oe.nextZ.prevZ=oe.prevZ)}function re(oe,se,ae){this.i=oe,this.x=se,this.y=ae,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}m.deviation=function(oe,se,ae,fe){var de=se&&se.length,ve=de?se[0]*ae:oe.length,pe=Math.abs(ne(oe,0,ve,ae));if(de)for(var ce=0,he=se.length;ce0&&(fe+=oe[de-1].length,ae.holes.push(fe))}return ae}}),B1t=xt((o,f)=>{"use strict";var m=(v,y,x,C)=>{let w=v&65535|0,A=v>>>16&65535|0,E=0;for(;x!==0;){E=x>2e3?2e3:x,x-=E;do w=w+y[C++]|0,A=A+w|0;while(--E);w%=65521,A%=65521}return w|A<<16|0};f.exports=m}),k1t=xt((o,f)=>{"use strict";var m=()=>{let x,C=[];for(var w=0;w<256;w++){x=w;for(var A=0;A<8;A++)x=x&1?3988292384^x>>>1:x>>>1;C[w]=x}return C},v=new Uint32Array(m()),y=(x,C,w,A)=>{let E=v,T=A+w;x^=-1;for(let S=A;S>>8^E[(x^C[S])&255];return x^-1};f.exports=y}),V1t=xt((o,f)=>{"use strict";f.exports=function(m,v){let y,x,C,w,A,E,T,S,M,I,P,D,L,R,O,F,k,U,G,j,q,J,X,Y,Q=m.state;y=m.next_in,X=m.input,x=y+(m.avail_in-5),C=m.next_out,Y=m.output,w=C-(v-m.avail_out),A=C+(m.avail_out-257),E=Q.dmax,T=Q.wsize,S=Q.whave,M=Q.wnext,I=Q.window,P=Q.hold,D=Q.bits,L=Q.lencode,R=Q.distcode,O=(1<>>24,P>>>=U,D-=U,U=k>>>16&255,U===0)Y[C++]=k&65535;else if(U&16){G=k&65535,U&=15,U&&(D>>=U,D-=U),D<15&&(P+=X[y++]<>>24,P>>>=U,D-=U,U=k>>>16&255,U&16){if(j=k&65535,U&=15,DE){m.msg="invalid distance too far back",Q.mode=16209;break e}if(P>>>=U,D-=U,U=C-w,j>U){if(U=j-U,U>S&&Q.sane){m.msg="invalid distance too far back",Q.mode=16209;break e}if(q=0,J=I,M===0){if(q+=T-U,U2;)Y[C++]=J[q++],Y[C++]=J[q++],Y[C++]=J[q++],G-=3;G&&(Y[C++]=J[q++],G>1&&(Y[C++]=J[q++]))}else{q=C-j;do Y[C++]=Y[q++],Y[C++]=Y[q++],Y[C++]=Y[q++],G-=3;while(G>2);G&&(Y[C++]=Y[q++],G>1&&(Y[C++]=Y[q++]))}}else if(U&64){m.msg="invalid distance code",Q.mode=16209;break e}else{k=R[(k&65535)+(P&(1<>3,y-=G,D-=G<<3,P&=(1<{"use strict";var m=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),v=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),y=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),x=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),C=(w,A,E,T,S,M,I,P)=>{let D=P.bits,L=0,R=0,O=0,F=0,k=0,U=0,G=0,j=0,q=0,J=0,X,Y,Q,ee,z,ie=null,re,ne=new Uint16Array(15+1),oe=new Uint16Array(15+1),se=null,ae,fe,de;for(L=0;L<=15;L++)ne[L]=0;for(R=0;R=1&&ne[F]===0;F--);if(k>F&&(k=F),F===0)return S[M++]=1<<24|64<<16|0,S[M++]=1<<24|64<<16|0,P.bits=1,0;for(O=1;O0&&(w===0||F!==1))return-1;for(oe[1]=0,L=1;L<15;L++)oe[L+1]=oe[L]+ne[L];for(R=0;R852||w===2&&q>592)return 1;for(;;){ae=L-G,I[R]+1=re?(fe=se[I[R]-re],de=ie[I[R]-re]):(fe=32+64,de=0),X=1<>G)+Y]=ae<<24|fe<<16|de|0;while(Y!==0);for(X=1<>=1;if(X!==0?(J&=X-1,J+=X):J=0,R++,--ne[L]===0){if(L===F)break;L=A[E+I[R]]}if(L>k&&(J&ee)!==Q){for(G===0&&(G=k),z+=O,U=L-G,j=1<852||w===2&&q>592)return 1;Q=J&ee,S[Q]=k<<24|U<<16|z-M|0}}return J!==0&&(S[z+J]=L-G<<24|64<<16|0),P.bits=k,0};f.exports=C}),qpe=xt((o,f)=>{"use strict";f.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}}),H1t=xt((o,f)=>{"use strict";var m=B1t(),v=k1t(),y=V1t(),x=z1t(),C=0,w=1,A=2,{Z_FINISH:E,Z_BLOCK:T,Z_TREES:S,Z_OK:M,Z_STREAM_END:I,Z_NEED_DICT:P,Z_STREAM_ERROR:D,Z_DATA_ERROR:L,Z_MEM_ERROR:R,Z_BUF_ERROR:O,Z_DEFLATED:F}=qpe(),k=16180,U=16181,G=16182,j=16183,q=16184,J=16185,X=16186,Y=16187,Q=16188,ee=16189,z=16190,ie=16191,re=16192,ne=16193,oe=16194,se=16195,ae=16196,fe=16197,de=16198,ve=16199,pe=16200,ce=16201,he=16202,Ce=16203,Se=16204,De=16205,Oe=16206,Ue=16207,Xe=16208,it=16209,ut=16210,at=16211,Pt=852,Qe=592,ft=15,Ot=ft,Xt=hi=>(hi>>>24&255)+(hi>>>8&65280)+((hi&65280)<<8)+((hi&255)<<24);function At(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}var bt=hi=>{if(!hi)return 1;let Ri=hi.state;return!Ri||Ri.strm!==hi||Ri.modeat?1:0},gt=hi=>{if(bt(hi))return D;let Ri=hi.state;return hi.total_in=hi.total_out=Ri.total=0,hi.msg="",Ri.wrap&&(hi.adler=Ri.wrap&1),Ri.mode=k,Ri.last=0,Ri.havedict=0,Ri.flags=-1,Ri.dmax=32768,Ri.head=null,Ri.hold=0,Ri.bits=0,Ri.lencode=Ri.lendyn=new Int32Array(Pt),Ri.distcode=Ri.distdyn=new Int32Array(Qe),Ri.sane=1,Ri.back=-1,M},It=hi=>{if(bt(hi))return D;let Ri=hi.state;return Ri.wsize=0,Ri.whave=0,Ri.wnext=0,gt(hi)},Jt=(hi,Ri)=>{let pt;if(bt(hi))return D;let wr=hi.state;return Ri<0?(pt=0,Ri=-Ri):(pt=(Ri>>4)+5,Ri<48&&(Ri&=15)),Ri&&(Ri<8||Ri>15)?D:(wr.window!==null&&wr.wbits!==Ri&&(wr.window=null),wr.wrap=pt,wr.wbits=Ri,It(hi))},bi=(hi,Ri)=>{if(!hi)return D;let pt=new At;hi.state=pt,pt.strm=hi,pt.window=null,pt.mode=k;let wr=Jt(hi,Ri);return wr!==M&&(hi.state=null),wr},Yi=hi=>bi(hi,Ot),ii=!0,ei,Li,Je=hi=>{if(ii){ei=new Int32Array(512),Li=new Int32Array(32);let Ri=0;for(;Ri<144;)hi.lens[Ri++]=8;for(;Ri<256;)hi.lens[Ri++]=9;for(;Ri<280;)hi.lens[Ri++]=7;for(;Ri<288;)hi.lens[Ri++]=8;for(x(w,hi.lens,0,288,ei,0,hi.work,{bits:9}),Ri=0;Ri<32;)hi.lens[Ri++]=5;x(A,hi.lens,0,32,Li,0,hi.work,{bits:5}),ii=!1}hi.lencode=ei,hi.lenbits=9,hi.distcode=Li,hi.distbits=5},Nt=(hi,Ri,pt,wr)=>{let zi,Ui=hi.state;return Ui.window===null&&(Ui.wsize=1<=Ui.wsize?(Ui.window.set(Ri.subarray(pt-Ui.wsize,pt),0),Ui.wnext=0,Ui.whave=Ui.wsize):(zi=Ui.wsize-Ui.wnext,zi>wr&&(zi=wr),Ui.window.set(Ri.subarray(pt-wr,pt-wr+zi),Ui.wnext),wr-=zi,wr?(Ui.window.set(Ri.subarray(pt-wr,pt),0),Ui.wnext=wr,Ui.whave=Ui.wsize):(Ui.wnext+=zi,Ui.wnext===Ui.wsize&&(Ui.wnext=0),Ui.whave{let pt,wr,zi,Ui,Gt,$t,jt,ct,Pe,Ht,si,_t,Yt,Fi,Dt=0,Lt,Si,nt,wt,yt,Tt,Et,ti,ir=new Uint8Array(4),or,xr,Tn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(bt(hi)||!hi.output||!hi.input&&hi.avail_in!==0)return D;pt=hi.state,pt.mode===ie&&(pt.mode=re),Gt=hi.next_out,zi=hi.output,jt=hi.avail_out,Ui=hi.next_in,wr=hi.input,$t=hi.avail_in,ct=pt.hold,Pe=pt.bits,Ht=$t,si=jt,ti=M;e:for(;;)switch(pt.mode){case k:if(pt.wrap===0){pt.mode=re;break}for(;Pe<16;){if($t===0)break e;$t--,ct+=wr[Ui++]<>>8&255,pt.check=v(pt.check,ir,2,0),ct=0,Pe=0,pt.mode=U;break}if(pt.head&&(pt.head.done=!1),!(pt.wrap&1)||(((ct&255)<<8)+(ct>>8))%31){hi.msg="incorrect header check",pt.mode=it;break}if((ct&15)!==F){hi.msg="unknown compression method",pt.mode=it;break}if(ct>>>=4,Pe-=4,Et=(ct&15)+8,pt.wbits===0&&(pt.wbits=Et),Et>15||Et>pt.wbits){hi.msg="invalid window size",pt.mode=it;break}pt.dmax=1<>8&1),pt.flags&512&&pt.wrap&4&&(ir[0]=ct&255,ir[1]=ct>>>8&255,pt.check=v(pt.check,ir,2,0)),ct=0,Pe=0,pt.mode=G;case G:for(;Pe<32;){if($t===0)break e;$t--,ct+=wr[Ui++]<>>8&255,ir[2]=ct>>>16&255,ir[3]=ct>>>24&255,pt.check=v(pt.check,ir,4,0)),ct=0,Pe=0,pt.mode=j;case j:for(;Pe<16;){if($t===0)break e;$t--,ct+=wr[Ui++]<>8),pt.flags&512&&pt.wrap&4&&(ir[0]=ct&255,ir[1]=ct>>>8&255,pt.check=v(pt.check,ir,2,0)),ct=0,Pe=0,pt.mode=q;case q:if(pt.flags&1024){for(;Pe<16;){if($t===0)break e;$t--,ct+=wr[Ui++]<>>8&255,pt.check=v(pt.check,ir,2,0)),ct=0,Pe=0}else pt.head&&(pt.head.extra=null);pt.mode=J;case J:if(pt.flags&1024&&(_t=pt.length,_t>$t&&(_t=$t),_t&&(pt.head&&(Et=pt.head.extra_len-pt.length,pt.head.extra||(pt.head.extra=new Uint8Array(pt.head.extra_len)),pt.head.extra.set(wr.subarray(Ui,Ui+_t),Et)),pt.flags&512&&pt.wrap&4&&(pt.check=v(pt.check,wr,_t,Ui)),$t-=_t,Ui+=_t,pt.length-=_t),pt.length))break e;pt.length=0,pt.mode=X;case X:if(pt.flags&2048){if($t===0)break e;_t=0;do Et=wr[Ui+_t++],pt.head&&Et&&pt.length<65536&&(pt.head.name+=String.fromCharCode(Et));while(Et&&_t<$t);if(pt.flags&512&&pt.wrap&4&&(pt.check=v(pt.check,wr,_t,Ui)),$t-=_t,Ui+=_t,Et)break e}else pt.head&&(pt.head.name=null);pt.length=0,pt.mode=Y;case Y:if(pt.flags&4096){if($t===0)break e;_t=0;do Et=wr[Ui+_t++],pt.head&&Et&&pt.length<65536&&(pt.head.comment+=String.fromCharCode(Et));while(Et&&_t<$t);if(pt.flags&512&&pt.wrap&4&&(pt.check=v(pt.check,wr,_t,Ui)),$t-=_t,Ui+=_t,Et)break e}else pt.head&&(pt.head.comment=null);pt.mode=Q;case Q:if(pt.flags&512){for(;Pe<16;){if($t===0)break e;$t--,ct+=wr[Ui++]<>9&1,pt.head.done=!0),hi.adler=pt.check=0,pt.mode=ie;break;case ee:for(;Pe<32;){if($t===0)break e;$t--,ct+=wr[Ui++]<>>=Pe&7,Pe-=Pe&7,pt.mode=Oe;break}for(;Pe<3;){if($t===0)break e;$t--,ct+=wr[Ui++]<>>=1,Pe-=1,ct&3){case 0:pt.mode=ne;break;case 1:if(Je(pt),pt.mode=ve,Ri===S){ct>>>=2,Pe-=2;break e}break;case 2:pt.mode=ae;break;case 3:hi.msg="invalid block type",pt.mode=it}ct>>>=2,Pe-=2;break;case ne:for(ct>>>=Pe&7,Pe-=Pe&7;Pe<32;){if($t===0)break e;$t--,ct+=wr[Ui++]<>>16^65535)){hi.msg="invalid stored block lengths",pt.mode=it;break}if(pt.length=ct&65535,ct=0,Pe=0,pt.mode=oe,Ri===S)break e;case oe:pt.mode=se;case se:if(_t=pt.length,_t){if(_t>$t&&(_t=$t),_t>jt&&(_t=jt),_t===0)break e;zi.set(wr.subarray(Ui,Ui+_t),Gt),$t-=_t,Ui+=_t,jt-=_t,Gt+=_t,pt.length-=_t;break}pt.mode=ie;break;case ae:for(;Pe<14;){if($t===0)break e;$t--,ct+=wr[Ui++]<>>=5,Pe-=5,pt.ndist=(ct&31)+1,ct>>>=5,Pe-=5,pt.ncode=(ct&15)+4,ct>>>=4,Pe-=4,pt.nlen>286||pt.ndist>30){hi.msg="too many length or distance symbols",pt.mode=it;break}pt.have=0,pt.mode=fe;case fe:for(;pt.have>>=3,Pe-=3}for(;pt.have<19;)pt.lens[Tn[pt.have++]]=0;if(pt.lencode=pt.lendyn,pt.lenbits=7,or={bits:pt.lenbits},ti=x(C,pt.lens,0,19,pt.lencode,0,pt.work,or),pt.lenbits=or.bits,ti){hi.msg="invalid code lengths set",pt.mode=it;break}pt.have=0,pt.mode=de;case de:for(;pt.have>>24,Si=Dt>>>16&255,nt=Dt&65535,!(Lt<=Pe);){if($t===0)break e;$t--,ct+=wr[Ui++]<>>=Lt,Pe-=Lt,pt.lens[pt.have++]=nt;else{if(nt===16){for(xr=Lt+2;Pe>>=Lt,Pe-=Lt,pt.have===0){hi.msg="invalid bit length repeat",pt.mode=it;break}Et=pt.lens[pt.have-1],_t=3+(ct&3),ct>>>=2,Pe-=2}else if(nt===17){for(xr=Lt+3;Pe>>=Lt,Pe-=Lt,Et=0,_t=3+(ct&7),ct>>>=3,Pe-=3}else{for(xr=Lt+7;Pe>>=Lt,Pe-=Lt,Et=0,_t=11+(ct&127),ct>>>=7,Pe-=7}if(pt.have+_t>pt.nlen+pt.ndist){hi.msg="invalid bit length repeat",pt.mode=it;break}for(;_t--;)pt.lens[pt.have++]=Et}}if(pt.mode===it)break;if(pt.lens[256]===0){hi.msg="invalid code -- missing end-of-block",pt.mode=it;break}if(pt.lenbits=9,or={bits:pt.lenbits},ti=x(w,pt.lens,0,pt.nlen,pt.lencode,0,pt.work,or),pt.lenbits=or.bits,ti){hi.msg="invalid literal/lengths set",pt.mode=it;break}if(pt.distbits=6,pt.distcode=pt.distdyn,or={bits:pt.distbits},ti=x(A,pt.lens,pt.nlen,pt.ndist,pt.distcode,0,pt.work,or),pt.distbits=or.bits,ti){hi.msg="invalid distances set",pt.mode=it;break}if(pt.mode=ve,Ri===S)break e;case ve:pt.mode=pe;case pe:if($t>=6&&jt>=258){hi.next_out=Gt,hi.avail_out=jt,hi.next_in=Ui,hi.avail_in=$t,pt.hold=ct,pt.bits=Pe,y(hi,si),Gt=hi.next_out,zi=hi.output,jt=hi.avail_out,Ui=hi.next_in,wr=hi.input,$t=hi.avail_in,ct=pt.hold,Pe=pt.bits,pt.mode===ie&&(pt.back=-1);break}for(pt.back=0;Dt=pt.lencode[ct&(1<>>24,Si=Dt>>>16&255,nt=Dt&65535,!(Lt<=Pe);){if($t===0)break e;$t--,ct+=wr[Ui++]<>wt)],Lt=Dt>>>24,Si=Dt>>>16&255,nt=Dt&65535,!(wt+Lt<=Pe);){if($t===0)break e;$t--,ct+=wr[Ui++]<>>=wt,Pe-=wt,pt.back+=wt}if(ct>>>=Lt,Pe-=Lt,pt.back+=Lt,pt.length=nt,Si===0){pt.mode=De;break}if(Si&32){pt.back=-1,pt.mode=ie;break}if(Si&64){hi.msg="invalid literal/length code",pt.mode=it;break}pt.extra=Si&15,pt.mode=ce;case ce:if(pt.extra){for(xr=pt.extra;Pe>>=pt.extra,Pe-=pt.extra,pt.back+=pt.extra}pt.was=pt.length,pt.mode=he;case he:for(;Dt=pt.distcode[ct&(1<>>24,Si=Dt>>>16&255,nt=Dt&65535,!(Lt<=Pe);){if($t===0)break e;$t--,ct+=wr[Ui++]<>wt)],Lt=Dt>>>24,Si=Dt>>>16&255,nt=Dt&65535,!(wt+Lt<=Pe);){if($t===0)break e;$t--,ct+=wr[Ui++]<>>=wt,Pe-=wt,pt.back+=wt}if(ct>>>=Lt,Pe-=Lt,pt.back+=Lt,Si&64){hi.msg="invalid distance code",pt.mode=it;break}pt.offset=nt,pt.extra=Si&15,pt.mode=Ce;case Ce:if(pt.extra){for(xr=pt.extra;Pe>>=pt.extra,Pe-=pt.extra,pt.back+=pt.extra}if(pt.offset>pt.dmax){hi.msg="invalid distance too far back",pt.mode=it;break}pt.mode=Se;case Se:if(jt===0)break e;if(_t=si-jt,pt.offset>_t){if(_t=pt.offset-_t,_t>pt.whave&&pt.sane){hi.msg="invalid distance too far back",pt.mode=it;break}_t>pt.wnext?(_t-=pt.wnext,Yt=pt.wsize-_t):Yt=pt.wnext-_t,_t>pt.length&&(_t=pt.length),Fi=pt.window}else Fi=zi,Yt=Gt-pt.offset,_t=pt.length;_t>jt&&(_t=jt),jt-=_t,pt.length-=_t;do zi[Gt++]=Fi[Yt++];while(--_t);pt.length===0&&(pt.mode=pe);break;case De:if(jt===0)break e;zi[Gt++]=pt.length,jt--,pt.mode=pe;break;case Oe:if(pt.wrap){for(;Pe<32;){if($t===0)break e;$t--,ct|=wr[Ui++]<{if(bt(hi))return D;let Ri=hi.state;return Ri.window&&(Ri.window=null),hi.state=null,M},wi=(hi,Ri)=>{if(bt(hi))return D;let pt=hi.state;return pt.wrap&2?(pt.head=Ri,Ri.done=!1,M):D},ji=(hi,Ri)=>{let pt=Ri.length,wr,zi,Ui;return bt(hi)||(wr=hi.state,wr.wrap!==0&&wr.mode!==z)?D:wr.mode===z&&(zi=1,zi=m(zi,Ri,pt,0),zi!==wr.check)?L:(Ui=Nt(hi,Ri,pt,pt),Ui?(wr.mode=ut,R):(wr.havedict=1,M))};f.exports.inflateReset=It,f.exports.inflateReset2=Jt,f.exports.inflateResetKeep=gt,f.exports.inflateInit=Yi,f.exports.inflateInit2=bi,f.exports.inflate=yi,f.exports.inflateEnd=ai,f.exports.inflateGetHeader=wi,f.exports.inflateSetDictionary=ji,f.exports.inflateInfo="pako inflate (from Nodeca project)"}),U1t=xt((o,f)=>{"use strict";var m=(v,y)=>Object.prototype.hasOwnProperty.call(v,y);f.exports.assign=function(v){let y=Array.prototype.slice.call(arguments,1);for(;y.length;){let x=y.shift();if(x){if(typeof x!="object")throw new TypeError(x+"must be non-object");for(let C in x)m(x,C)&&(v[C]=x[C])}}return v},f.exports.flattenChunks=v=>{let y=0;for(let C=0,w=v.length;C{"use strict";var m=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{m=!1}var v=new Uint8Array(256);for(let x=0;x<256;x++)v[x]=x>=252?6:x>=248?5:x>=240?4:x>=224?3:x>=192?2:1;v[254]=v[254]=1,f.exports.string2buf=x=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(x);let C,w,A,E,T,S=x.length,M=0;for(E=0;E>>6,C[T++]=128|w&63):w<65536?(C[T++]=224|w>>>12,C[T++]=128|w>>>6&63,C[T++]=128|w&63):(C[T++]=240|w>>>18,C[T++]=128|w>>>12&63,C[T++]=128|w>>>6&63,C[T++]=128|w&63);return C};var y=(x,C)=>{if(C<65534&&x.subarray&&m)return String.fromCharCode.apply(null,x.length===C?x:x.subarray(0,C));let w="";for(let A=0;A{let w=C||x.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(x.subarray(0,C));let A,E,T=new Array(w*2);for(E=0,A=0;A4){T[E++]=65533,A+=M-1;continue}for(S&=M===2?31:M===3?15:7;M>1&&A1){T[E++]=65533;continue}S<65536?T[E++]=S:(S-=65536,T[E++]=55296|S>>10&1023,T[E++]=56320|S&1023)}return y(T,E)},f.exports.utf8border=(x,C)=>{C=C||x.length,C>x.length&&(C=x.length);let w=C-1;for(;w>=0&&(x[w]&192)===128;)w--;return w<0||w===0?C:w+v[x[w]]>C?w:C}}),W1t=xt((o,f)=>{"use strict";f.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}}),j1t=xt((o,f)=>{"use strict";function m(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}f.exports=m}),Y1t=xt((o,f)=>{"use strict";function m(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}f.exports=m}),e9e=xt((o,f)=>{"use strict";var m=H1t(),v=U1t(),y=G1t(),x=W1t(),C=j1t(),w=Y1t(),A=Object.prototype.toString,{Z_NO_FLUSH:E,Z_FINISH:T,Z_OK:S,Z_STREAM_END:M,Z_NEED_DICT:I,Z_STREAM_ERROR:P,Z_DATA_ERROR:D,Z_MEM_ERROR:L}=qpe();function R(k){this.options=v.assign({chunkSize:1024*64,windowBits:15,to:""},k||{});let U=this.options;U.raw&&U.windowBits>=0&&U.windowBits<16&&(U.windowBits=-U.windowBits,U.windowBits===0&&(U.windowBits=-15)),U.windowBits>=0&&U.windowBits<16&&!(k&&k.windowBits)&&(U.windowBits+=32),U.windowBits>15&&U.windowBits<48&&(U.windowBits&15||(U.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new C,this.strm.avail_out=0;let G=m.inflateInit2(this.strm,U.windowBits);if(G!==S)throw new Error(x[G]);if(this.header=new w,m.inflateGetHeader(this.strm,this.header),U.dictionary&&(typeof U.dictionary=="string"?U.dictionary=y.string2buf(U.dictionary):A.call(U.dictionary)==="[object ArrayBuffer]"&&(U.dictionary=new Uint8Array(U.dictionary)),U.raw&&(G=m.inflateSetDictionary(this.strm,U.dictionary),G!==S)))throw new Error(x[G])}R.prototype.push=function(k,U){let G=this.strm,j=this.options.chunkSize,q=this.options.dictionary,J,X,Y;if(this.ended)return!1;for(U===~~U?X=U:X=U===!0?T:E,A.call(k)==="[object ArrayBuffer]"?G.input=new Uint8Array(k):G.input=k,G.next_in=0,G.avail_in=G.input.length;;){for(G.avail_out===0&&(G.output=new Uint8Array(j),G.next_out=0,G.avail_out=j),J=m.inflate(G,X),J===I&&q&&(J=m.inflateSetDictionary(G,q),J===S?J=m.inflate(G,X):J===D&&(J=I));G.avail_in>0&&J===M&&G.state.wrap>0&&k[G.next_in]!==0;)m.inflateReset(G),J=m.inflate(G,X);switch(J){case P:case D:case I:case L:return this.onEnd(J),this.ended=!0,!1}if(Y=G.avail_out,G.next_out&&(G.avail_out===0||J===M))if(this.options.to==="string"){let Q=y.utf8border(G.output,G.next_out),ee=G.next_out-Q,z=y.buf2string(G.output,Q);G.next_out=ee,G.avail_out=j-ee,ee&&G.output.set(G.output.subarray(Q,Q+ee),0),this.onData(z)}else this.onData(G.output.length===G.next_out?G.output:G.output.subarray(0,G.next_out));if(!(J===S&&Y===0)){if(J===M)return J=m.inflateEnd(this.strm),this.onEnd(J),this.ended=!0,!0;if(G.avail_in===0)break}}return!0},R.prototype.onData=function(k){this.chunks.push(k)},R.prototype.onEnd=function(k){k===S&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=v.flattenChunks(this.chunks)),this.chunks=[],this.err=k,this.msg=this.strm.msg};function O(k,U){let G=new R(U);if(G.push(k),G.err)throw G.msg||x[G.err];return G.result}function F(k,U){return U=U||{},U.raw=!0,O(k,U)}f.exports.Inflate=R,f.exports.inflate=O,f.exports.inflateRaw=F,f.exports.ungzip=O,f.exports.constants=qpe()}),q1t=xt((o,f)=>{(function(m,v){typeof o=="object"&&typeof f<"u"?f.exports=v():typeof define=="function"&&define.amd?define(v):(m=m||self).RBush=v()})(o,function(){"use strict";function m(O,F,k,U,G){(function j(q,J,X,Y,Q){for(;Y>X;){if(Y-X>600){var ee=Y-X+1,z=J-X+1,ie=Math.log(ee),re=.5*Math.exp(2*ie/3),ne=.5*Math.sqrt(ie*re*(ee-re)/ee)*(z-ee/2<0?-1:1),oe=Math.max(X,Math.floor(J-z*re/ee+ne)),se=Math.min(Y,Math.floor(J+(ee-z)*re/ee+ne));j(q,J,oe,se,Q)}var ae=q[J],fe=X,de=Y;for(v(q,X,J),Q(q[Y],ae)>0&&v(q,X,Y);fe0;)de--}Q(q[X],ae)===0?v(q,X,de):v(q,++de,Y),de<=J&&(X=de+1),J<=de&&(Y=de-1)}})(O,F,k||0,U||O.length-1,G||y)}function v(O,F,k){var U=O[F];O[F]=O[k],O[k]=U}function y(O,F){return OF?1:0}var x=function(O){O===void 0&&(O=9),this._maxEntries=Math.max(4,O),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function C(O,F,k){if(!k)return F.indexOf(O);for(var U=0;U=O.minX&&F.maxY>=O.minY}function L(O){return{children:O,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function R(O,F,k,U,G){for(var j=[F,k];j.length;)if(!((k=j.pop())-(F=j.pop())<=U)){var q=F+Math.ceil((k-F)/U/2)*U;m(O,q,F,k,G),j.push(F,q,q,k)}}return x.prototype.all=function(){return this._all(this.data,[])},x.prototype.search=function(O){var F=this.data,k=[];if(!D(O,F))return k;for(var U=this.toBBox,G=[];F;){for(var j=0;j=0&&G[F].children.length>this._maxEntries;)this._split(G,F),F--;this._adjustParentBBoxes(U,G,F)},x.prototype._split=function(O,F){var k=O[F],U=k.children.length,G=this._minEntries;this._chooseSplitAxis(k,G,U);var j=this._chooseSplitIndex(k,G,U),q=L(k.children.splice(j,k.children.length-j));q.height=k.height,q.leaf=k.leaf,w(k,this.toBBox),w(q,this.toBBox),F?O[F-1].children.push(q):this._splitRoot(k,q)},x.prototype._splitRoot=function(O,F){this.data=L([O,F]),this.data.height=O.height+1,this.data.leaf=!1,w(this.data,this.toBBox)},x.prototype._chooseSplitIndex=function(O,F,k){for(var U,G,j,q,J,X,Y,Q=1/0,ee=1/0,z=F;z<=k-F;z++){var ie=A(O,0,z,this.toBBox),re=A(O,z,k,this.toBBox),ne=(G=ie,j=re,q=void 0,J=void 0,X=void 0,Y=void 0,q=Math.max(G.minX,j.minX),J=Math.max(G.minY,j.minY),X=Math.min(G.maxX,j.maxX),Y=Math.min(G.maxY,j.maxY),Math.max(0,X-q)*Math.max(0,Y-J)),oe=M(ie)+M(re);ne=F;Q--){var ee=O.children[Q];E(q,O.leaf?G(ee):ee),J+=I(q)}return J},x.prototype._adjustParentBBoxes=function(O,F,k){for(var U=k;U>=0;U--)E(F[U],O)},x.prototype._condense=function(O){for(var F=O.length-1,k=void 0;F>=0;F--)O[F].children.length===0?F>0?(k=O[F-1].children).splice(k.indexOf(O[F]),1):this.clear():w(O[F],this.toBBox)},x})}),t9e=xt((exports,module)=>{/*! * protobuf.js v7.1.0 (c) 2016, daniel wirtz * compiled fri, 09 sep 2022 03:02:57 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details */(function(undefined){"use strict";(function(o,f,m){function v(x){var C=f[x];return C||o[x][0].call(C=f[x]={exports:{}},v,C,C.exports),C.exports}var y=v(m[0]);y.util.global.protobuf=y,typeof define=="function"&&define.amd&&define(["long"],function(x){return x&&x.isLong&&(y.util.Long=x,y.configure()),y}),typeof module=="object"&&module&&module.exports&&(module.exports=y)})({1:[function(o,f,m){"use strict";f.exports=v;function v(y,x){for(var C=new Array(arguments.length-1),w=0,A=2,E=!0;A1&&A.charAt(E)==="=";)++T;return Math.ceil(A.length*3)/4-T};for(var y=new Array(64),x=new Array(123),C=0;C<64;)x[y[C]=C<26?C+65:C<52?C+71:C<62?C-4:C-59|43]=C++;v.encode=function(A,E,T){for(var S=null,M=[],I=0,P=0,D;E>2],D=(L&3)<<4,P=1;break;case 1:M[I++]=y[D|L>>4],D=(L&15)<<2,P=2;break;case 2:M[I++]=y[D|L>>6],M[I++]=y[L&63],P=0;break}I>8191&&((S||(S=[])).push(String.fromCharCode.apply(String,M)),I=0)}return P&&(M[I++]=y[D],M[I++]=61,P===1&&(M[I++]=61)),S?(I&&S.push(String.fromCharCode.apply(String,M.slice(0,I))),S.join("")):String.fromCharCode.apply(String,M.slice(0,I))};var w="invalid encoding";v.decode=function(A,E,T){for(var S=T,M=0,I,P=0;P1)break;if((D=x[D])===undefined)throw Error(w);switch(M){case 0:I=D,M=1;break;case 1:E[T++]=I<<2|(D&48)>>4,I=D,M=2;break;case 2:E[T++]=(I&15)<<4|(D&60)>>2,I=D,M=3;break;case 3:E[T++]=(I&3)<<6|D,M=0;break}}if(M===1)throw Error(w);return T-S},v.test=function(A){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(A)}},{}],3:[function(o,f,m){"use strict";f.exports=v;function v(){this._listeners={}}v.prototype.on=function(y,x,C){return(this._listeners[y]||(this._listeners[y]=[])).push({fn:x,ctx:C||this}),this},v.prototype.off=function(y,x){if(y===undefined)this._listeners={};else if(x===undefined)this._listeners[y]=[];else for(var C=this._listeners[y],w=0;w0?0:2147483648,I,P);else if(isNaN(M))S(2143289344,I,P);else if(M>34028234663852886e22)S((D<<31|2139095040)>>>0,I,P);else if(M<11754943508222875e-54)S((D<<31|Math.round(M/1401298464324817e-60))>>>0,I,P);else{var L=Math.floor(Math.log(M)/Math.LN2),R=Math.round(M*Math.pow(2,-L)*8388608)&8388607;S((D<<31|L+127<<23|R)>>>0,I,P)}}A.writeFloatLE=E.bind(null,y),A.writeFloatBE=E.bind(null,x);function T(S,M,I){var P=S(M,I),D=(P>>31)*2+1,L=P>>>23&255,R=P&8388607;return L===255?R?NaN:D*(1/0):L===0?D*1401298464324817e-60*R:D*Math.pow(2,L-150)*(R+8388608)}A.readFloatLE=T.bind(null,C),A.readFloatBE=T.bind(null,w)}(),typeof Float64Array<"u"?function(){var E=new Float64Array([-0]),T=new Uint8Array(E.buffer),S=T[7]===128;function M(L,R,O){E[0]=L,R[O]=T[0],R[O+1]=T[1],R[O+2]=T[2],R[O+3]=T[3],R[O+4]=T[4],R[O+5]=T[5],R[O+6]=T[6],R[O+7]=T[7]}function I(L,R,O){E[0]=L,R[O]=T[7],R[O+1]=T[6],R[O+2]=T[5],R[O+3]=T[4],R[O+4]=T[3],R[O+5]=T[2],R[O+6]=T[1],R[O+7]=T[0]}A.writeDoubleLE=S?M:I,A.writeDoubleBE=S?I:M;function P(L,R){return T[0]=L[R],T[1]=L[R+1],T[2]=L[R+2],T[3]=L[R+3],T[4]=L[R+4],T[5]=L[R+5],T[6]=L[R+6],T[7]=L[R+7],E[0]}function D(L,R){return T[7]=L[R],T[6]=L[R+1],T[5]=L[R+2],T[4]=L[R+3],T[3]=L[R+4],T[2]=L[R+5],T[1]=L[R+6],T[0]=L[R+7],E[0]}A.readDoubleLE=S?P:D,A.readDoubleBE=S?D:P}():function(){function E(S,M,I,P,D,L){var R=P<0?1:0;if(R&&(P=-P),P===0)S(0,D,L+M),S(1/P>0?0:2147483648,D,L+I);else if(isNaN(P))S(0,D,L+M),S(2146959360,D,L+I);else if(P>17976931348623157e292)S(0,D,L+M),S((R<<31|2146435072)>>>0,D,L+I);else{var O;if(P<22250738585072014e-324)O=P/5e-324,S(O>>>0,D,L+M),S((R<<31|O/4294967296)>>>0,D,L+I);else{var F=Math.floor(Math.log(P)/Math.LN2);F===1024&&(F=1023),O=P*Math.pow(2,-F),S(O*4503599627370496>>>0,D,L+M),S((R<<31|F+1023<<20|O*1048576&1048575)>>>0,D,L+I)}}}A.writeDoubleLE=E.bind(null,y,0,4),A.writeDoubleBE=E.bind(null,x,4,0);function T(S,M,I,P,D){var L=S(P,D+M),R=S(P,D+I),O=(R>>31)*2+1,F=R>>>20&2047,k=4294967296*(R&1048575)+L;return F===2047?k?NaN:O*(1/0):F===0?O*5e-324*k:O*Math.pow(2,F-1075)*(k+4503599627370496)}A.readDoubleLE=T.bind(null,C,0,4),A.readDoubleBE=T.bind(null,w,4,0)}(),A}function y(A,E,T){E[T]=A&255,E[T+1]=A>>>8&255,E[T+2]=A>>>16&255,E[T+3]=A>>>24}function x(A,E,T){E[T]=A>>>24,E[T+1]=A>>>16&255,E[T+2]=A>>>8&255,E[T+3]=A&255}function C(A,E){return(A[E]|A[E+1]<<8|A[E+2]<<16|A[E+3]<<24)>>>0}function w(A,E){return(A[E]<<24|A[E+1]<<16|A[E+2]<<8|A[E+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(o){}return null}},{}],6:[function(o,f,m){"use strict";f.exports=v;function v(y,x,C){var w=C||8192,A=w>>>1,E=null,T=w;return function(S){if(S<1||S>A)return y(S);T+S>w&&(E=y(w),T=0);var M=x.call(E,T,T+=S);return T&7&&(T=(T|7)+1),M}}},{}],7:[function(o,f,m){"use strict";var v=m;v.length=function(y){for(var x=0,C=0,w=0;w191&&S<224?E[T++]=(S&31)<<6|y[x++]&63:S>239&&S<365?(S=((S&7)<<18|(y[x++]&63)<<12|(y[x++]&63)<<6|y[x++]&63)-65536,E[T++]=55296+(S>>10),E[T++]=56320+(S&1023)):E[T++]=(S&15)<<12|(y[x++]&63)<<6|y[x++]&63,T>8191&&((A||(A=[])).push(String.fromCharCode.apply(String,E)),T=0);return A?(T&&A.push(String.fromCharCode.apply(String,E.slice(0,T))),A.join("")):String.fromCharCode.apply(String,E.slice(0,T))},v.write=function(y,x,C){for(var w=C,A,E,T=0;T>6|192,x[C++]=A&63|128):(A&64512)===55296&&((E=y.charCodeAt(T+1))&64512)===56320?(A=65536+((A&1023)<<10)+(E&1023),++T,x[C++]=A>>18|240,x[C++]=A>>12&63|128,x[C++]=A>>6&63|128,x[C++]=A&63|128):(x[C++]=A>>12|224,x[C++]=A>>6&63|128,x[C++]=A&63|128);return C-w}},{}],8:[function(o,f,m){"use strict";var v=m;v.build="minimal",v.Writer=o(16),v.BufferWriter=o(17),v.Reader=o(9),v.BufferReader=o(10),v.util=o(15),v.rpc=o(12),v.roots=o(11),v.configure=y;function y(){v.util._configure(),v.Writer._configure(v.BufferWriter),v.Reader._configure(v.BufferReader)}y()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(o,f,m){"use strict";f.exports=A;var v=o(15),y,x=v.LongBits,C=v.utf8;function w(P,D){return RangeError("index out of range: "+P.pos+" + "+(D||1)+" > "+P.len)}function A(P){this.buf=P,this.pos=0,this.len=P.length}var E=typeof Uint8Array<"u"?function(P){if(P instanceof Uint8Array||Array.isArray(P))return new A(P);throw Error("illegal buffer")}:function(P){if(Array.isArray(P))return new A(P);throw Error("illegal buffer")},T=function(){return v.Buffer?function(P){return(A.create=function(D){return v.Buffer.isBuffer(D)?new y(D):E(D)})(P)}:E};A.create=T(),A.prototype._slice=v.Array.prototype.subarray||v.Array.prototype.slice,A.prototype.uint32=function(){var P=4294967295;return function(){if(P=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(P=(P|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(P=(P|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return P;if((this.pos+=5)>this.len)throw this.pos=this.len,w(this,10);return P}}(),A.prototype.int32=function(){return this.uint32()|0},A.prototype.sint32=function(){var P=this.uint32();return P>>>1^-(P&1)|0};function S(){var P=new x(0,0),D=0;if(this.len-this.pos>4){for(;D<4;++D)if(P.lo=(P.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return P;if(P.lo=(P.lo|(this.buf[this.pos]&127)<<28)>>>0,P.hi=(P.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return P;D=0}else{for(;D<3;++D){if(this.pos>=this.len)throw w(this);if(P.lo=(P.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return P}return P.lo=(P.lo|(this.buf[this.pos++]&127)<>>0,P}if(this.len-this.pos>4){for(;D<5;++D)if(P.hi=(P.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return P}else for(;D<5;++D){if(this.pos>=this.len)throw w(this);if(P.hi=(P.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return P}throw Error("invalid varint encoding")}A.prototype.bool=function(){return this.uint32()!==0};function M(P,D){return(P[D-4]|P[D-3]<<8|P[D-2]<<16|P[D-1]<<24)>>>0}A.prototype.fixed32=function(){if(this.pos+4>this.len)throw w(this,4);return M(this.buf,this.pos+=4)},A.prototype.sfixed32=function(){if(this.pos+4>this.len)throw w(this,4);return M(this.buf,this.pos+=4)|0};function I(){if(this.pos+8>this.len)throw w(this,8);return new x(M(this.buf,this.pos+=4),M(this.buf,this.pos+=4))}A.prototype.float=function(){if(this.pos+4>this.len)throw w(this,4);var P=v.float.readFloatLE(this.buf,this.pos);return this.pos+=4,P},A.prototype.double=function(){if(this.pos+8>this.len)throw w(this,4);var P=v.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,P},A.prototype.bytes=function(){var P=this.uint32(),D=this.pos,L=this.pos+P;if(L>this.len)throw w(this,P);return this.pos+=P,Array.isArray(this.buf)?this.buf.slice(D,L):D===L?new this.buf.constructor(0):this._slice.call(this.buf,D,L)},A.prototype.string=function(){var P=this.bytes();return C.read(P,0,P.length)},A.prototype.skip=function(P){if(typeof P=="number"){if(this.pos+P>this.len)throw w(this,P);this.pos+=P}else do if(this.pos>=this.len)throw w(this);while(this.buf[this.pos++]&128);return this},A.prototype.skipType=function(P){switch(P){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(P=this.uint32()&7)!==4;)this.skipType(P);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+P+" at offset "+this.pos)}return this},A._configure=function(P){y=P,A.create=T(),y._configure();var D=v.Long?"toLong":"toNumber";v.merge(A.prototype,{int64:function(){return S.call(this)[D](!1)},uint64:function(){return S.call(this)[D](!0)},sint64:function(){return S.call(this).zzDecode()[D](!1)},fixed64:function(){return I.call(this)[D](!0)},sfixed64:function(){return I.call(this)[D](!1)}})}},{15:15}],10:[function(o,f,m){"use strict";f.exports=x;var v=o(9);(x.prototype=Object.create(v.prototype)).constructor=x;var y=o(15);function x(C){v.call(this,C)}x._configure=function(){y.Buffer&&(x.prototype._slice=y.Buffer.prototype.slice)},x.prototype.string=function(){var C=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+C,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+C,this.len))},x._configure()},{15:15,9:9}],11:[function(o,f,m){"use strict";f.exports={}},{}],12:[function(o,f,m){"use strict";var v=m;v.Service=o(13)},{13:13}],13:[function(o,f,m){"use strict";f.exports=y;var v=o(15);(y.prototype=Object.create(v.EventEmitter.prototype)).constructor=y;function y(x,C,w){if(typeof x!="function")throw TypeError("rpcImpl must be a function");v.EventEmitter.call(this),this.rpcImpl=x,this.requestDelimited=!!C,this.responseDelimited=!!w}y.prototype.rpcCall=function x(C,w,A,E,T){if(!E)throw TypeError("request must be specified");var S=this;if(!T)return v.asPromise(x,S,C,w,A,E);if(!S.rpcImpl)return setTimeout(function(){T(Error("already ended"))},0),undefined;try{return S.rpcImpl(C,w[S.requestDelimited?"encodeDelimited":"encode"](E).finish(),function(M,I){if(M)return S.emit("error",M,C),T(M);if(I===null)return S.end(!0),undefined;if(!(I instanceof A))try{I=A[S.responseDelimited?"decodeDelimited":"decode"](I)}catch(P){return S.emit("error",P,C),T(P)}return S.emit("data",I,C),T(null,I)})}catch(M){return S.emit("error",M,C),setTimeout(function(){T(M)},0),undefined}},y.prototype.end=function(x){return this.rpcImpl&&(x||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(o,f,m){"use strict";f.exports=y;var v=o(15);function y(A,E){this.lo=A>>>0,this.hi=E>>>0}var x=y.zero=new y(0,0);x.toNumber=function(){return 0},x.zzEncode=x.zzDecode=function(){return this},x.length=function(){return 1};var C=y.zeroHash="\0\0\0\0\0\0\0\0";y.fromNumber=function(A){if(A===0)return x;var E=A<0;E&&(A=-A);var T=A>>>0,S=(A-T)/4294967296>>>0;return E&&(S=~S>>>0,T=~T>>>0,++T>4294967295&&(T=0,++S>4294967295&&(S=0))),new y(T,S)},y.from=function(A){if(typeof A=="number")return y.fromNumber(A);if(v.isString(A))if(v.Long)A=v.Long.fromString(A);else return y.fromNumber(parseInt(A,10));return A.low||A.high?new y(A.low>>>0,A.high>>>0):x},y.prototype.toNumber=function(A){if(!A&&this.hi>>>31){var E=~this.lo+1>>>0,T=~this.hi>>>0;return E||(T=T+1>>>0),-(E+T*4294967296)}return this.lo+this.hi*4294967296},y.prototype.toLong=function(A){return v.Long?new v.Long(this.lo|0,this.hi|0,!!A):{low:this.lo|0,high:this.hi|0,unsigned:!!A}};var w=String.prototype.charCodeAt;y.fromHash=function(A){return A===C?x:new y((w.call(A,0)|w.call(A,1)<<8|w.call(A,2)<<16|w.call(A,3)<<24)>>>0,(w.call(A,4)|w.call(A,5)<<8|w.call(A,6)<<16|w.call(A,7)<<24)>>>0)},y.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},y.prototype.zzEncode=function(){var A=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^A)>>>0,this.lo=(this.lo<<1^A)>>>0,this},y.prototype.zzDecode=function(){var A=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^A)>>>0,this.hi=(this.hi>>>1^A)>>>0,this},y.prototype.length=function(){var A=this.lo,E=(this.lo>>>28|this.hi<<4)>>>0,T=this.hi>>>24;return T===0?E===0?A<16384?A<128?1:2:A<2097152?3:4:E<16384?E<128?5:6:E<2097152?7:8:T<128?9:10}},{15:15}],15:[function(o,f,m){"use strict";var v=m;v.asPromise=o(1),v.base64=o(2),v.EventEmitter=o(3),v.float=o(4),v.inquire=o(5),v.utf8=o(7),v.pool=o(6),v.LongBits=o(14),v.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),v.global=v.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,v.emptyArray=Object.freeze?Object.freeze([]):[],v.emptyObject=Object.freeze?Object.freeze({}):{},v.isInteger=Number.isInteger||function(C){return typeof C=="number"&&isFinite(C)&&Math.floor(C)===C},v.isString=function(C){return typeof C=="string"||C instanceof String},v.isObject=function(C){return C&&typeof C=="object"},v.isset=v.isSet=function(C,w){var A=C[w];return A!=null&&C.hasOwnProperty(w)?typeof A!="object"||(Array.isArray(A)?A.length:Object.keys(A).length)>0:!1},v.Buffer=function(){try{var C=v.inquire("buffer").Buffer;return C.prototype.utf8Write?C:null}catch{return null}}(),v._Buffer_from=null,v._Buffer_allocUnsafe=null,v.newBuffer=function(C){return typeof C=="number"?v.Buffer?v._Buffer_allocUnsafe(C):new v.Array(C):v.Buffer?v._Buffer_from(C):typeof Uint8Array>"u"?C:new Uint8Array(C)},v.Array=typeof Uint8Array<"u"?Uint8Array:Array,v.Long=v.global.dcodeIO&&v.global.dcodeIO.Long||v.global.Long||v.inquire("long"),v.key2Re=/^true|false|0|1$/,v.key32Re=/^-?(?:0|[1-9][0-9]*)$/,v.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,v.longToHash=function(C){return C?v.LongBits.from(C).toHash():v.LongBits.zeroHash},v.longFromHash=function(C,w){var A=v.LongBits.fromHash(C);return v.Long?v.Long.fromBits(A.lo,A.hi,w):A.toNumber(!!w)};function y(C,w,A){for(var E=Object.keys(w),T=0;T-1;--T)if(w[E[T]]===1&&this[E[T]]!==undefined&&this[E[T]]!==null)return E[T]}},v.oneOfSetter=function(C){return function(w){for(var A=0;A127;)k[U++]=F&127|128,F>>>=7;k[U]=F}function D(F,k){this.len=F,this.next=undefined,this.val=k}D.prototype=Object.create(A.prototype),D.prototype.fn=P,S.prototype.uint32=function(F){return this.len+=(this.tail=this.tail.next=new D((F=F>>>0)<128?1:F<16384?2:F<2097152?3:F<268435456?4:5,F)).len,this},S.prototype.int32=function(F){return F<0?this._push(L,10,x.fromNumber(F)):this.uint32(F)},S.prototype.sint32=function(F){return this.uint32((F<<1^F>>31)>>>0)};function L(F,k,U){for(;F.hi;)k[U++]=F.lo&127|128,F.lo=(F.lo>>>7|F.hi<<25)>>>0,F.hi>>>=7;for(;F.lo>127;)k[U++]=F.lo&127|128,F.lo=F.lo>>>7;k[U++]=F.lo}S.prototype.uint64=function(F){var k=x.from(F);return this._push(L,k.length(),k)},S.prototype.int64=S.prototype.uint64,S.prototype.sint64=function(F){var k=x.from(F).zzEncode();return this._push(L,k.length(),k)},S.prototype.bool=function(F){return this._push(I,1,F?1:0)};function R(F,k,U){k[U]=F&255,k[U+1]=F>>>8&255,k[U+2]=F>>>16&255,k[U+3]=F>>>24}S.prototype.fixed32=function(F){return this._push(R,4,F>>>0)},S.prototype.sfixed32=S.prototype.fixed32,S.prototype.fixed64=function(F){var k=x.from(F);return this._push(R,4,k.lo)._push(R,4,k.hi)},S.prototype.sfixed64=S.prototype.fixed64,S.prototype.float=function(F){return this._push(v.float.writeFloatLE,4,F)},S.prototype.double=function(F){return this._push(v.float.writeDoubleLE,8,F)};var O=v.Array.prototype.set?function(F,k,U){k.set(F,U)}:function(F,k,U){for(var G=0;G>>0;if(!k)return this._push(I,1,0);if(v.isString(F)){var U=S.alloc(k=C.length(F));C.decode(F,U,0),F=U}return this.uint32(k)._push(O,k,F)},S.prototype.string=function(F){var k=w.length(F);return k?this.uint32(k)._push(w.write,k,F):this._push(I,1,0)},S.prototype.fork=function(){return this.states=new T(this),this.head=this.tail=new A(E,0,0),this.len=0,this},S.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new A(E,0,0),this.len=0),this},S.prototype.ldelim=function(){var F=this.head,k=this.tail,U=this.len;return this.reset().uint32(U),U&&(this.tail.next=F.next,this.tail=k,this.len+=U),this},S.prototype.finish=function(){for(var F=this.head.next,k=this.constructor.alloc(this.len),U=0;F;)F.fn(F.val,k,U),U+=F.len,F=F.next;return k},S._configure=function(F){y=F,S.create=M(),y._configure()}},{15:15}],17:[function(o,f,m){"use strict";f.exports=x;var v=o(16);(x.prototype=Object.create(v.prototype)).constructor=x;var y=o(15);function x(){v.call(this)}x._configure=function(){x.alloc=y._Buffer_allocUnsafe,x.writeBytesBuffer=y.Buffer&&y.Buffer.prototype instanceof Uint8Array&&y.Buffer.prototype.set.name==="set"?function(w,A,E){A.set(w,E)}:function(w,A,E){if(w.copy)w.copy(A,E,0,w.length);else for(var T=0;T>>0;return this.uint32(A),A&&this._push(x.writeBytesBuffer,A,w),this};function C(w,A,E){w.length<40?y.utf8.write(w,A,E):A.utf8Write?A.utf8Write(w,E):A.write(w,E)}x.prototype.string=function(w){var A=y.Buffer.byteLength(w);return this.uint32(A),A&&this._push(C,A,w),this},x._configure()},{15:15,16:16}]},{},[8])})()}),X1t=xt((o,f)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var m=function(){var C={};C.defaultNoDataValue=-34027999387901484e22,C.decode=function(M,I){I=I||{};var P=I.encodedMaskData||I.encodedMaskData===null,D=T(M,I.inputOffset||0,P),L=I.noDataValue!==null?I.noDataValue:C.defaultNoDataValue,R=w(D,I.pixelType||Float32Array,I.encodedMaskData,L,I.returnMask),O={width:D.width,height:D.height,pixelData:R.resultPixels,minValue:R.minValue,maxValue:D.pixels.maxValue,noDataValue:L};return R.resultMask&&(O.maskData=R.resultMask),I.returnEncodedMask&&D.mask&&(O.encodedMaskData=D.mask.bitset?D.mask.bitset:null),I.returnFileInfo&&(O.fileInfo=A(D),I.computeUsedBitDepths&&(O.fileInfo.bitDepths=E(D))),O};var w=function(M,I,P,D,L){var R=0,O=M.pixels.numBlocksX,F=M.pixels.numBlocksY,k=Math.floor(M.width/O),U=Math.floor(M.height/F),G=2*M.maxZError,j=Number.MAX_VALUE,q;P=P||(M.mask?M.mask.bitset:null);var J,X;J=new I(M.width*M.height),L&&P&&(X=new Uint8Array(M.width*M.height));for(var Y=new Float32Array(k*U),Q,ee,z=0;z<=F;z++){var ie=z!==F?U:M.height%F;if(ie!==0)for(var re=0;re<=O;re++){var ne=re!==O?k:M.width%O;if(ne!==0){var oe=z*M.width*U+re*k,se=M.width-ne,ae=M.pixels.blocks[R],fe,de,ve;ae.encoding<2?(ae.encoding===0?fe=ae.rawData:(S(ae.stuffedData,ae.bitsPerPixel,ae.numValidPixels,ae.offset,G,Y,M.pixels.maxValue),fe=Y),de=0):ae.encoding===2?ve=0:ve=ae.offset;var pe;if(P)for(ee=0;ee>3],pe<<=oe&7),Q=0;Q>3]),pe&128?(X&&(X[oe]=1),q=ae.encoding<2?fe[de++]:ve,j=j>q?q:j,J[oe++]=q):(X&&(X[oe]=0),J[oe++]=D),pe<<=1;oe+=se}else if(ae.encoding<2)for(ee=0;eeq?q:j,J[oe++]=q;oe+=se}else for(j=j>ve?ve:j,ee=0;ee0){var O=new Uint8Array(Math.ceil(D.width*D.height/8));R=new DataView(M,I,D.mask.numBytes);var F=R.getInt16(0,!0),k=2,U=0;do{if(F>0)for(;F--;)O[U++]=R.getUint8(k++);else{var G=R.getUint8(k++);for(F=-F;F--;)O[U++]=G}F=R.getInt16(k,!0),k+=2}while(k0?1:0),X=q+(D.height%q>0?1:0);D.pixels.blocks=new Array(J*X);for(var Y=0,Q=0;Q3)throw"Invalid block encoding ("+re.encoding+")";if(re.encoding===2){I++;continue}if(ne!==0&&ne!==2){if(ne>>=6,re.offsetType=ne,ne===2)re.offset=R.getInt8(1),z++;else if(ne===1)re.offset=R.getInt16(1,!0),z+=2;else if(ne===0)re.offset=R.getFloat32(1,!0),z+=4;else throw"Invalid block offset type";if(re.encoding===1)if(ne=R.getUint8(z),z++,re.bitsPerPixel=ne&63,ne>>=6,re.numValidPixelsType=ne,ne===2)re.numValidPixels=R.getUint8(z),z++;else if(ne===1)re.numValidPixels=R.getUint16(z,!0),z+=2;else if(ne===0)re.numValidPixels=R.getUint32(z,!0),z+=4;else throw"Invalid valid pixel count type"}if(I+=z,re.encoding!==3){var oe,se;if(re.encoding===0){var ae=(D.pixels.numBytes-1)/4;if(ae!==Math.floor(ae))throw"uncompressed block has invalid length";oe=new ArrayBuffer(ae*4),se=new Uint8Array(oe),se.set(new Uint8Array(M,I,ae*4));var fe=new Float32Array(oe);re.rawData=fe,I+=ae*4}else if(re.encoding===1){var de=Math.ceil(re.numValidPixels*re.bitsPerPixel/8),ve=Math.ceil(de/4);oe=new ArrayBuffer(ve*4),se=new Uint8Array(oe),se.set(new Uint8Array(M,I,de)),re.stuffedData=new Uint32Array(oe),I+=de}}}return D.eofOffset=I,D},S=function(M,I,P,D,L,R,O){var F=(1<=I)j=q>>>G-I&F,G-=I;else{var Y=I-G;j=(q&F)<>>G}R[U]=j=M?(G=j>>>U-M&O,U-=M):(q=M-U,G=(j&O)<>>U),S[k]=P[G];else for(J=Math.ceil((R-D)/L),k=0;k=M?(G=j>>>U-M&O,U-=M):(q=M-U,G=(j&O)<>>U),S[k]=G=S?(U=G>>>k-S&L,k-=S):(F=S-k,U=(G&L)<>>k),j[O]=U=M?(j=q>>>G&O,U-=M,G+=M):(J=M-U,j=q>>>G&O,q=T[F++],U=32-J,j|=(q&(1<=M?(j=q>>>G&O,U-=M,G+=M):(J=M-U,j=q>>>G&O,q=T[F++],U=32-J,j|=(q&(1<=S?(U=j>>>G&L,k-=S,G+=S):(F=S-k,U=j>>>G&L,j=T[R++],k=32-F,U|=(j&(1<=M?(O=F>>>R-M&P,R-=M):(k=M-R,O=(F&P)<>>R),S[L]=O;return S},originalUnstuff2:function(T,S,M,I){var P=(1<=M?(F=k>>>O&P,R-=M,O+=M):(U=M-R,F=k>>>O&P,k=T[D++],R=32-U,F|=(k&(1<=359?359:P;P-=L;do S+=T[D++]<<8,M+=S+=T[D++];while(--L);S=(S&65535)+(S>>>16),M=(M&65535)+(M>>>16)}return I&1&&(M+=S+=T[D]<<8),S=(S&65535)+(S>>>16),M=(M&65535)+(M>>>16),(M<<16|S)>>>0},readHeaderInfo:function(T,S){var M=S.ptr,I=new Uint8Array(T,M,6),P={};if(P.fileIdentifierString=String.fromCharCode.apply(null,I),P.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+P.fileIdentifierString;M+=6;var D=new DataView(T,M,8),L=D.getInt32(0,!0);P.fileVersion=L,M+=4,L>=3&&(P.checksum=D.getUint32(4,!0),M+=4),D=new DataView(T,M,12),P.height=D.getUint32(0,!0),P.width=D.getUint32(4,!0),M+=8,L>=4?(P.numDims=D.getUint32(8,!0),M+=4):P.numDims=1,D=new DataView(T,M,40),P.numValidPixel=D.getUint32(0,!0),P.microBlockSize=D.getInt32(4,!0),P.blobSize=D.getInt32(8,!0),P.imageType=D.getInt32(12,!0),P.maxZError=D.getFloat64(16,!0),P.zMin=D.getFloat64(24,!0),P.zMax=D.getFloat64(32,!0),M+=40,S.headerInfo=P,S.ptr=M;var R,O;if(L>=3&&(O=L>=4?52:48,R=this.computeChecksumFletcher32(new Uint8Array(T,M-O,P.blobSize-14)),R!==P.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(T,S){var M=S.headerInfo,I=this.getDataTypeArray(M.imageType),P=M.numDims*this.getDataTypeSize(M.imageType),D=this.readSubArray(T,S.ptr,I,P),L=this.readSubArray(T,S.ptr+P,I,P);S.ptr+=2*P;var R,O=!0;for(R=0;R0){O=new Uint8Array(Math.ceil(P/8)),L=new DataView(T,M,R.numBytes);var k=L.getInt16(0,!0),U=2,G=0,j=0;do{if(k>0)for(;k--;)O[G++]=L.getUint8(U++);else for(j=L.getUint8(U++),k=-k;k--;)O[G++]=j;k=L.getInt16(U,!0),U+=2}while(U>3],q<<=J&7):q=O[J>>3],q&128&&(F[J]=1);S.pixels.resultMask=F,R.bitset=O,M+=R.numBytes}return S.ptr=M,S.mask=R,!0},readDataOneSweep:function(T,S,M){var I=S.ptr,P=S.headerInfo,D=P.numDims,L=P.width*P.height,R=P.imageType,O=P.numValidPixel*w.getDataTypeSize(R)*D,F,k=S.pixels.resultMask;if(M===Uint8Array)F=new Uint8Array(T,I,O);else{var U=new ArrayBuffer(O),G=new Uint8Array(U);G.set(new Uint8Array(T,I,O)),F=new M(U)}if(F.length===L*D)S.pixels.resultPixels=F;else{S.pixels.resultPixels=new M(L*D);var j=0,q=0,J=0,X=0;if(D>1)for(J=0;J=R)return!1;var O=new Uint32Array(R-L);w.decodeBits(T,S,O);var F=[],k,U,G,j;for(k=L;k0&&(F[U].second=z<>>32-j,32-ee>=j?(ee+=j,ee===32&&(ee=0,ie++,z=Q[ie])):(ee+=j-32,ie++,z=Q[ie],F[U].second|=z>>>32-ee));var re=0,ne=0,oe=new A;for(k=0;k=M?ne=M:ne=re,re>=30&&console.log("WARning, large NUM LUT BITS IS "+re);var se=[],ae,fe,de,ve,pe,ce;for(k=L;k0)if(ae=[j,U],j<=ne)for(fe=F[U].second<=0;ve--)pe=fe>>>ve&1,pe?(ce.right||(ce.right=new A),ce=ce.right):(ce.left||(ce.left=new A),ce=ce.left),ve===0&&!ce.val&&(ce.val=ae[1]);return{decodeLut:se,numBitsLUTQick:ne,numBitsLUT:re,tree:oe,stuffedData:Q,srcPtr:ie,bitPos:ee}},readHuffman:function(T,S,M){var I=S.headerInfo,P=I.numDims,D=S.headerInfo.height,L=S.headerInfo.width,R=L*D,O=this.readHuffmanTree(T,S),F=O.decodeLut,k=O.tree,U=O.stuffedData,G=O.srcPtr,j=O.bitPos,q=O.numBitsLUTQick,J=O.numBitsLUT,X=S.headerInfo.imageType===0?128:0,Y,Q,ee,z=S.pixels.resultMask,ie,re,ne,oe,se,ae,fe,de=0;j>0&&(G++,j=0);var ve=U[G],pe=S.encodeMode===1,ce=new M(R*P),he=ce,Ce;for(Ce=0;Ce1&&(he=new M(ce.buffer,R*Ce,R),de=0),S.headerInfo.numValidPixel===L*D)for(ae=0,oe=0;oe>>32-q,re=ie,32-j>>64-j-q,re=ie),F[re])Q=F[re][1],j+=F[re][0];else for(ie=ve<>>32-J,re=ie,32-j>>64-j-J,re=ie),Y=k,fe=0;fe>>J-fe-1&1,Y=ne?Y.right:Y.left,!(Y.left||Y.right)){Q=Y.val,j=j+fe+1;break}j>=32&&(j-=32,G++,ve=U[G]),ee=Q-X,pe?(se>0?ee+=de:oe>0?ee+=he[ae-L]:ee+=de,ee&=255,he[ae]=ee,de=ee):he[ae]=ee}else for(ae=0,oe=0;oe>>32-q,re=ie,32-j>>64-j-q,re=ie),F[re])Q=F[re][1],j+=F[re][0];else for(ie=ve<>>32-J,re=ie,32-j>>64-j-J,re=ie),Y=k,fe=0;fe>>J-fe-1&1,Y=ne?Y.right:Y.left,!(Y.left||Y.right)){Q=Y.val,j=j+fe+1;break}j>=32&&(j-=32,G++,ve=U[G]),ee=Q-X,pe?(se>0&&z[ae-1]?ee+=de:oe>0&&z[ae-L]?ee+=he[ae-L]:ee+=de,ee&=255,he[ae]=ee,de=ee):he[ae]=ee}S.ptr=S.ptr+(G+1)*4+(j>0?4:0)}S.pixels.resultPixels=ce},decodeBits:function(T,S,M,I,P){{var D=S.headerInfo,L=D.fileVersion,R=0,O=new DataView(T,S.ptr,5),F=O.getUint8(0);R++;var k=F>>6,U=k===0?4:3-k,G=(F&32)>0,j=F&31,q=0;if(U===1)q=O.getUint8(R),R++;else if(U===2)q=O.getUint16(R,!0),R+=2;else if(U===4)q=O.getUint32(R,!0),R+=4;else throw"Invalid valid pixel count type";var J=2*D.maxZError,X,Y,Q,ee,z,ie,re,ne,oe,se,ae=D.numDims>1?D.maxValues[P]:D.zMax;if(G){for(S.counter.lut++,ne=O.getUint8(R),oe=j,R++,ee=Math.ceil((ne-1)*j/8),z=Math.ceil(ee/4),Y=new ArrayBuffer(z*4),Q=new Uint8Array(Y),S.ptr+=R,Q.set(new Uint8Array(T,S.ptr,ee)),re=new Uint32Array(Y),S.ptr+=ee,se=0;ne-1>>>se;)se++;ee=Math.ceil(q*se/8),z=Math.ceil(ee/4),Y=new ArrayBuffer(z*4),Q=new Uint8Array(Y),Q.set(new Uint8Array(T,S.ptr,ee)),X=new Uint32Array(Y),S.ptr+=ee,L>=3?ie=C.unstuffLUT2(re,j,ne-1,I,J,ae):ie=C.unstuffLUT(re,j,ne-1,I,J,ae),L>=3?C.unstuff2(X,M,se,q,ie):C.unstuff(X,M,se,q,ie)}else S.counter.bitstuffer++,se=j,S.ptr+=R,se>0&&(ee=Math.ceil(q*se/8),z=Math.ceil(ee/4),Y=new ArrayBuffer(z*4),Q=new Uint8Array(Y),Q.set(new Uint8Array(T,S.ptr,ee)),X=new Uint32Array(Y),S.ptr+=ee,L>=3?I==null?C.originalUnstuff2(X,M,se,q):C.unstuff2(X,M,se,q,!1,I,J,ae):I==null?C.originalUnstuff(X,M,se,q):C.unstuff(X,M,se,q,!1,I,J,ae))}},readTiles:function(T,S,M){var I=S.headerInfo,P=I.width,D=I.height,L=I.microBlockSize,R=I.imageType,O=w.getDataTypeSize(R),F=Math.ceil(P/L),k=Math.ceil(D/L);S.pixels.numBlocksY=k,S.pixels.numBlocksX=F,S.pixels.ptr=0;var U=0,G=0,j=0,q=0,J=0,X=0,Y=0,Q=0,ee=0,z=0,ie=0,re=0,ne=0,oe=0,se=0,ae=0,fe,de,ve,pe,ce,he,Ce=new M(L*L),Se=D%L||L,De=P%L||L,Oe,Ue,Xe=I.numDims,it,ut=S.pixels.resultMask,at=S.pixels.resultPixels;for(j=0;j1&&(at=new M(S.pixels.resultPixels.buffer,P*D*it*O,P*D)),Y=T.byteLength-S.ptr,fe=new DataView(T,S.ptr,Math.min(10,Y)),de={},ae=0,Q=fe.getUint8(0),ae++,ee=Q>>6&255,z=Q>>2&15,z!==(q*L>>3&15))throw"integrity issue";if(he=Q&3,he>3)throw S.ptr+=ae,"Invalid block encoding ("+he+")";if(he===2){S.counter.constant++,S.ptr+=ae;continue}else if(he===0){if(S.counter.uncompressed++,S.ptr+=ae,ne=J*X*O,oe=T.byteLength-S.ptr,ne=ne1)for(D=0;D=-128&&S<=127;break;case 1:M=S>=0&&S<=255;break;case 2:M=S>=-32768&&S<=32767;break;case 3:M=S>=0&&S<=65536;break;case 4:M=S>=-2147483648&&S<=2147483647;break;case 5:M=S>=0&&S<=4294967296;break;case 6:M=S>=-34027999387901484e22&&S<=34027999387901484e22;break;case 7:M=S>=5e-324&&S<=17976931348623157e292;break;default:M=!1}return M},getDataTypeSize:function(T){var S=0;switch(T){case 0:case 1:S=1;break;case 2:case 3:S=2;break;case 4:case 5:case 6:S=4;break;case 7:S=8;break;default:S=T}return S},getDataTypeUsed:function(T,S){var M=T;switch(T){case 2:case 4:M=T-S;break;case 3:case 5:M=T-2*S;break;case 6:S===0?M=T:S===1?M=2:M=1;break;case 7:S===0?M=T:M=T-2*S+1;break;default:M=T;break}return M},getOnePixel:function(T,S,M,I){var P=0;switch(M){case 0:P=I.getInt8(S);break;case 1:P=I.getUint8(S);break;case 2:P=I.getInt16(S,!0);break;case 3:P=I.getUint16(S,!0);break;case 4:P=I.getInt32(S,!0);break;case 5:P=I.getUInt32(S,!0);break;case 6:P=I.getFloat32(S,!0);break;case 7:P=I.getFloat64(S,!0);break;default:throw"the decoder does not understand this pixel type"}return P}},A=function(T,S,M){this.val=T,this.left=S,this.right=M},E={decode:function(T,S){S=S||{};var M=S.noDataValue,I=0,P={};if(P.ptr=S.inputOffset||0,P.pixels={},!!w.readHeaderInfo(T,P)){var D=P.headerInfo,L=D.fileVersion,R=w.getDataTypeArray(D.imageType);w.readMask(T,P),D.numValidPixel!==D.width*D.height&&!P.pixels.resultMask&&(P.pixels.resultMask=S.maskData);var O=D.width*D.height;if(P.pixels.resultPixels=new R(O*D.numDims),P.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},D.numValidPixel!==0)if(D.zMax===D.zMin)w.constructConstantSurface(P);else if(L>=4&&w.checkMinMaxRanges(T,P))w.constructConstantSurface(P);else{var F=new DataView(T,P.ptr,2),k=F.getUint8(0);if(P.ptr++,k)w.readDataOneSweep(T,P,R);else if(L>1&&D.imageType<=1&&Math.abs(D.maxZError-.5)<1e-5){var U=F.getUint8(1);if(P.ptr++,P.encodeMode=U,U>2||L<4&&U>1)throw"Invalid Huffman flag "+U;U?w.readHuffman(T,P,R):w.readTiles(T,P,R)}else w.readTiles(T,P,R)}P.eofOffset=P.ptr;var G;S.inputOffset?(G=P.headerInfo.blobSize+S.inputOffset-P.ptr,Math.abs(G)>=1&&(P.eofOffset=S.inputOffset+P.headerInfo.blobSize)):(G=P.headerInfo.blobSize-P.ptr,Math.abs(G)>=1&&(P.eofOffset=P.headerInfo.blobSize));var j={width:D.width,height:D.height,pixelData:P.pixels.resultPixels,minValue:D.zMin,maxValue:D.zMax,validPixelCount:D.numValidPixel,dimCount:D.numDims,dimStats:{minValues:D.minValues,maxValues:D.maxValues},maskData:P.pixels.resultMask};if(P.pixels.resultMask&&w.isValidPixelValue(D.imageType,M)){var q=P.pixels.resultMask;for(I=0;I1&&k.fileInfo.mask&&k.fileInfo.mask.numBytes>0&&L.push(k.maskData),I++,F.pixels.push(k.pixelData),F.statistics.push({minValue:k.minValue,maxValue:k.maxValue,noDataValue:k.noDataValue,dimStats:k.dimStats})}var U,G,j;if(M>1&&L.length>1){for(j=F.width*F.height,F.bandMasks=L,O=new Uint8Array(j),O.set(L[0]),U=1;U{f.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}),K1t=xt((o,f)=>{var{webm:m,mp4:v}=J1t(),y=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,x=()=>"wakeLock"in navigator,C=class{constructor(){if(this.enabled=!1,x()){this._wakeLock=null;let w=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",w),document.addEventListener("fullscreenchange",w)}else y()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",m),this._addSourceToVideo(this.noSleepVideo,"mp4",v),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(w,A,E){var T=document.createElement("source");T.src=E,T.type=`video/${A}`,w.appendChild(T)}get isEnabled(){return this.enabled}enable(){return x()?navigator.wakeLock.request("screen").then(w=>{this._wakeLock=w,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(w=>{throw this.enabled=!1,console.error(`${w.name}, ${w.message}`),w}):y()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(w=>(this.enabled=!0,w)).catch(w=>{throw this.enabled=!1,w})}disable(){x()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):y()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};f.exports=C}),Q1t=function(){let o=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","+","/"],f={base64:w},m={base64:A},v={"utf-8":x};function y(S,M,I){let P,D,L="";for(P=0,D=S.length;P=0&&S<=127)for(I=P,L=0,M=8;L=128&&S<=2047){for(I=P,L=0,M=11;L=2048&&S<=65535){for(I=P,L=0,M=16;L=65536&&S<=1114111){for(I=P,L=0,M=21;L0){for(M=0;M<24-P;M++)O=O+0;L=L+C(O,P)}return L}function A(S){let M,I,P,D=0,L,R=0,O=[{str:"0",len:8},{str:"110",len:11},{str:"1110",len:16},{str:"11110",len:21}],F="",k="";for(M=0,P=S.length;M=P-2&&S.charAt(M)==="="&&++D}for(D===0?P=F.length:P=F.length-(6-2*D);R=m)throw new li(`Expected ${o} to be less than ${m}, actual value was ${f}`)};lg.typeOf.number.lessThanOrEquals=function(o,f,m){if(lg.typeOf.number(o,f),f>m)throw new li(`Expected ${o} to be less than or equal to ${m}, actual value was ${f}`)};lg.typeOf.number.greaterThan=function(o,f,m){if(lg.typeOf.number(o,f),f<=m)throw new li(`Expected ${o} to be greater than ${m}, actual value was ${f}`)};lg.typeOf.number.greaterThanOrEquals=function(o,f,m){if(lg.typeOf.number(o,f),f0?1:-1});io.signNotZero=function(o){return o<0?-1:1};io.toSNorm=function(o,f){return f=Z(f,255),Math.round((io.clamp(o,-1,1)*.5+.5)*f)};io.fromSNorm=function(o,f){return f=Z(f,255),io.clamp(o,0,f)/f*2-1};io.normalize=function(o,f,m){return m=Math.max(m-f,0),m===0?0:io.clamp((o-f)/m,0,1)};io.sinh=Z(Math.sinh,function(o){return(Math.exp(o)-Math.exp(-o))/2});io.cosh=Z(Math.cosh,function(o){return(Math.exp(o)+Math.exp(-o))/2});io.lerp=function(o,f,m){return(1-m)*o+m*f};io.PI=Math.PI;io.ONE_OVER_PI=1/Math.PI;io.PI_OVER_TWO=Math.PI/2;io.PI_OVER_THREE=Math.PI/3;io.PI_OVER_FOUR=Math.PI/4;io.PI_OVER_SIX=Math.PI/6;io.THREE_PI_OVER_TWO=3*Math.PI/2;io.TWO_PI=2*Math.PI;io.ONE_OVER_TWO_PI=1/(2*Math.PI);io.RADIANS_PER_DEGREE=Math.PI/180;io.DEGREES_PER_RADIAN=180/Math.PI;io.RADIANS_PER_ARCSECOND=io.RADIANS_PER_DEGREE/3600;io.toRadians=function(o){return o*io.RADIANS_PER_DEGREE};io.toDegrees=function(o){return o*io.DEGREES_PER_RADIAN};io.convertLongitudeRange=function(o){let f=io.TWO_PI,m=o-Math.floor(o/f)*f;return m<-Math.PI?m+f:m>=Math.PI?m-f:m};io.clampToLatitudeRange=function(o){return io.clamp(o,-1*io.PI_OVER_TWO,io.PI_OVER_TWO)};io.negativePiToPi=function(o){return o>=-io.PI&&o<=io.PI?o:io.zeroToTwoPi(o+io.PI)-io.PI};io.zeroToTwoPi=function(o){if(o>=0&&o<=io.TWO_PI)return o;let f=io.mod(o,io.TWO_PI);return Math.abs(f)io.EPSILON14?io.TWO_PI:f};io.mod=function(o,f){return io.sign(o)===io.sign(f)&&Math.abs(o)m};io.greaterThanOrEquals=function(o,f,m){return o-f>-m};var XK=[1];io.factorial=function(o){let f=XK.length;if(o>=f){let m=XK[f-1];for(let v=f;v<=o;v++){let y=m*v;XK.push(y),m=y}}return XK[o]};io.incrementWrap=function(o,f,m){return m=Z(m,0),++o,o>f&&(o=m),o};io.isPowerOfTwo=function(o){return o!==0&&(o&o-1)===0};io.nextPowerOfTwo=function(o){return--o,o|=o>>1,o|=o>>2,o|=o>>4,o|=o>>8,o|=o>>16,++o,o};io.previousPowerOfTwo=function(o){return o|=o>>1,o|=o>>2,o|=o>>4,o|=o>>8,o|=o>>16,o|=o>>32,o=(o>>>0)-(o>>>1),o};io.clamp=function(o,f,m){return om?m:o};var n9e=new r9e.default;io.setRandomNumberSeed=function(o){n9e=new r9e.default(o)};io.nextRandomNumber=function(){return n9e.random()};io.randomBetween=function(o,f){return io.nextRandomNumber()*(f-o)+o};io.acosClamped=function(o){return Math.acos(io.clamp(o,-1,1))};io.asinClamped=function(o){return Math.asin(io.clamp(o,-1,1))};io.chordLength=function(o,f){return 2*f*Math.sin(o*.5)};io.logBase=function(o,f){return Math.log(o)/Math.log(f)};io.cbrt=Z(Math.cbrt,function(o){let f=Math.pow(Math.abs(o),.3333333333333333);return o<0?-f:f});io.log2=Z(Math.log2,function(o){return Math.log(o)*Math.LOG2E});io.fog=function(o,f){let m=o*f;return 1-Math.exp(-(m*m))};io.fastApproximateAtan=function(o){return o*(-.1784*Math.abs(o)-.0663*o*o+1.0301)};io.fastApproximateAtan2=function(o,f){let m,v=Math.abs(o);m=Math.abs(f);let y=Math.max(v,m);m=Math.min(v,m);let x=m/y;return v=io.fastApproximateAtan(x),v=Math.abs(f)>Math.abs(o)?io.PI_OVER_TWO-v:v,v=o<0?io.PI-v:v,v=f<0?-v:v,v};var xe=io;function qo(o,f){this.x=Z(o,0),this.y=Z(f,0)}qo.fromElements=function(o,f,m){return N(m)?(m.x=o,m.y=f,m):new qo(o,f)};qo.clone=function(o,f){if(N(o))return N(f)?(f.x=o.x,f.y=o.y,f):new qo(o.x,o.y)};qo.fromCartesian3=qo.clone;qo.fromCartesian4=qo.clone;qo.packedLength=2;qo.pack=function(o,f,m){return m=Z(m,0),f[m++]=o.x,f[m]=o.y,f};qo.unpack=function(o,f,m){return f=Z(f,0),N(m)||(m=new qo),m.x=o[f++],m.y=o[f],m};qo.packArray=function(o,f){let m=o.length,v=m*2;N(f)?!Array.isArray(f)&&f.length!==v||f.length!==v&&(f.length=v):f=new Array(v);for(let y=0;y{let f=new Image;f.onload=function(){Jx._result=f.width>0&&f.height>0,o(Jx._result)},f.onerror=function(){Jx._result=!1,o(Jx._result)},f.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Jx._promise};Object.defineProperties(Jx,{initialized:{get:function(){return N(Jx._result)}}});var tz=[];typeof ArrayBuffer<"u"&&(tz.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&tz.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&tz.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&tz.push(BigInt64Array),typeof BigUint64Array<"u"&&tz.push(BigUint64Array));var YE={isChrome:q0e,chromeVersion:obt,isSafari:s9e,safariVersion:abt,isWebkit:l9e,webkitVersion:sbt,isInternetExplorer:u9e,internetExplorerVersion:lbt,isEdge:Fie,edgeVersion:ubt,isFirefox:X0e,firefoxVersion:dbt,isWindows:cbt,isIPadOrIOS:hbt,hardwareConcurrency:Z(Sv.hardwareConcurrency,3),supportsPointerEvents:fbt,supportsImageRenderingPixelated:f9e,supportsWebP:Jx,imageRenderingValue:pbt,typedArrayTypes:tz};YE.supportsBasis=function(o){return YE.supportsWebAssembly()&&o.context.supportsBasis};YE.supportsFullscreen=function(){return ng.supportsFullscreen()};YE.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};YE.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};YE.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};YE.supportsBigInt=function(){return typeof BigInt<"u"};YE.supportsWebWorkers=function(){return typeof Worker<"u"};YE.supportsWebAssembly=function(){return typeof WebAssembly<"u"};YE.supportsWebgl2=function(o){return o.context.webgl2};var pa=YE;function Rce(o,f,m){return m<0&&(m+=1),m>1&&(m-=1),m*6<1?o+(f-o)*6*m:m*2<1?f:m*3<2?o+(f-o)*(2/3-m)*6:o}function fi(o,f,m,v){this.red=Z(o,1),this.green=Z(f,1),this.blue=Z(m,1),this.alpha=Z(v,1)}fi.fromCartesian4=function(o,f){return N(f)?(f.red=o.x,f.green=o.y,f.blue=o.z,f.alpha=o.w,f):new fi(o.x,o.y,o.z,o.w)};fi.fromBytes=function(o,f,m,v,y){return o=fi.byteToFloat(Z(o,255)),f=fi.byteToFloat(Z(f,255)),m=fi.byteToFloat(Z(m,255)),v=fi.byteToFloat(Z(v,255)),N(y)?(y.red=o,y.green=f,y.blue=m,y.alpha=v,y):new fi(o,f,m,v)};fi.fromAlpha=function(o,f,m){return N(m)?(m.red=o.red,m.green=o.green,m.blue=o.blue,m.alpha=f,m):new fi(o.red,o.green,o.blue,f)};var Oce,J0e,QI;pa.supportsTypedArrays()&&(Oce=new ArrayBuffer(4),J0e=new Uint32Array(Oce),QI=new Uint8Array(Oce));fi.fromRgba=function(o,f){return J0e[0]=o,fi.fromBytes(QI[0],QI[1],QI[2],QI[3],f)};fi.fromHsl=function(o,f,m,v,y){o=Z(o,0)%1,f=Z(f,0),m=Z(m,0),v=Z(v,1);let x=m,C=m,w=m;if(f!==0){let A;m<.5?A=m*(1+f):A=m+f-m*f;let E=2*m-A;x=Rce(E,A,o+1/3),C=Rce(E,A,o),w=Rce(E,A,o-1/3)}return N(y)?(y.red=x,y.green=C,y.blue=w,y.alpha=v,y):new fi(x,C,w,v)};fi.fromRandom=function(o,f){o=Z(o,Z.EMPTY_OBJECT);let m=o.red;if(!N(m)){let C=Z(o.minimumRed,0),w=Z(o.maximumRed,1);m=C+xe.nextRandomNumber()*(w-C)}let v=o.green;if(!N(v)){let C=Z(o.minimumGreen,0),w=Z(o.maximumGreen,1);v=C+xe.nextRandomNumber()*(w-C)}let y=o.blue;if(!N(y)){let C=Z(o.minimumBlue,0),w=Z(o.maximumBlue,1);y=C+xe.nextRandomNumber()*(w-C)}let x=o.alpha;if(!N(x)){let C=Z(o.minimumAlpha,0),w=Z(o.maximumAlpha,1);x=C+xe.nextRandomNumber()*(w-C)}return N(f)?(f.red=m,f.green=v,f.blue=y,f.alpha=x,f):new fi(m,v,y,x)};var mbt=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,gbt=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,_bt=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,vbt=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;fi.fromCssColorString=function(o,f){N(f)||(f=new fi),o=o.trim();let m=fi[o.toUpperCase()];if(N(m))return fi.clone(m,f),f;let v=mbt.exec(o);return v!==null?(f.red=parseInt(v[1],16)/15,f.green=parseInt(v[2],16)/15,f.blue=parseInt(v[3],16)/15,f.alpha=parseInt(Z(v[4],"f"),16)/15,f):(v=gbt.exec(o),v!==null?(f.red=parseInt(v[1],16)/255,f.green=parseInt(v[2],16)/255,f.blue=parseInt(v[3],16)/255,f.alpha=parseInt(Z(v[4],"ff"),16)/255,f):(v=_bt.exec(o),v!==null?(f.red=parseFloat(v[1])/(v[1].substr(-1)==="%"?100:255),f.green=parseFloat(v[2])/(v[2].substr(-1)==="%"?100:255),f.blue=parseFloat(v[3])/(v[3].substr(-1)==="%"?100:255),f.alpha=parseFloat(Z(v[4],"1.0")),f):(v=vbt.exec(o),v!==null?fi.fromHsl(parseFloat(v[1])/360,parseFloat(v[2])/100,parseFloat(v[3])/100,parseFloat(Z(v[4],"1.0")),f):(f=void 0,f))))};fi.packedLength=4;fi.pack=function(o,f,m){return m=Z(m,0),f[m++]=o.red,f[m++]=o.green,f[m++]=o.blue,f[m]=o.alpha,f};fi.unpack=function(o,f,m){return f=Z(f,0),N(m)||(m=new fi),m.red=o[f++],m.green=o[f++],m.blue=o[f++],m.alpha=o[f],m};fi.byteToFloat=function(o){return o/255};fi.floatToByte=function(o){return o===1?255:o*256|0};fi.clone=function(o,f){if(N(o))return N(f)?(f.red=o.red,f.green=o.green,f.blue=o.blue,f.alpha=o.alpha,f):new fi(o.red,o.green,o.blue,o.alpha)};fi.equals=function(o,f){return o===f||N(o)&&N(f)&&o.red===f.red&&o.green===f.green&&o.blue===f.blue&&o.alpha===f.alpha};fi.equalsArray=function(o,f,m){return o.red===f[m]&&o.green===f[m+1]&&o.blue===f[m+2]&&o.alpha===f[m+3]};fi.prototype.clone=function(o){return fi.clone(this,o)};fi.prototype.equals=function(o){return fi.equals(this,o)};fi.prototype.equalsEpsilon=function(o,f){return this===o||N(o)&&Math.abs(this.red-o.red)<=f&&Math.abs(this.green-o.green)<=f&&Math.abs(this.blue-o.blue)<=f&&Math.abs(this.alpha-o.alpha)<=f};fi.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};fi.prototype.toCssColorString=function(){let o=fi.floatToByte(this.red),f=fi.floatToByte(this.green),m=fi.floatToByte(this.blue);return this.alpha===1?`rgb(${o},${f},${m})`:`rgba(${o},${f},${m},${this.alpha})`};fi.prototype.toCssHexString=function(){let o=fi.floatToByte(this.red).toString(16);o.length<2&&(o=`0${o}`);let f=fi.floatToByte(this.green).toString(16);f.length<2&&(f=`0${f}`);let m=fi.floatToByte(this.blue).toString(16);if(m.length<2&&(m=`0${m}`),this.alpha<1){let v=fi.floatToByte(this.alpha).toString(16);return v.length<2&&(v=`0${v}`),`#${o}${f}${m}${v}`}return`#${o}${f}${m}`};fi.prototype.toBytes=function(o){let f=fi.floatToByte(this.red),m=fi.floatToByte(this.green),v=fi.floatToByte(this.blue),y=fi.floatToByte(this.alpha);return N(o)?(o[0]=f,o[1]=m,o[2]=v,o[3]=y,o):[f,m,v,y]};fi.prototype.toRgba=function(){return QI[0]=fi.floatToByte(this.red),QI[1]=fi.floatToByte(this.green),QI[2]=fi.floatToByte(this.blue),QI[3]=fi.floatToByte(this.alpha),J0e[0]};fi.prototype.brighten=function(o,f){return o=1-o,f.red=1-(1-this.red)*o,f.green=1-(1-this.green)*o,f.blue=1-(1-this.blue)*o,f.alpha=this.alpha,f};fi.prototype.darken=function(o,f){return o=1-o,f.red=this.red*o,f.green=this.green*o,f.blue=this.blue*o,f.alpha=this.alpha,f};fi.prototype.withAlpha=function(o,f){return fi.fromAlpha(this,o,f)};fi.add=function(o,f,m){return m.red=o.red+f.red,m.green=o.green+f.green,m.blue=o.blue+f.blue,m.alpha=o.alpha+f.alpha,m};fi.subtract=function(o,f,m){return m.red=o.red-f.red,m.green=o.green-f.green,m.blue=o.blue-f.blue,m.alpha=o.alpha-f.alpha,m};fi.multiply=function(o,f,m){return m.red=o.red*f.red,m.green=o.green*f.green,m.blue=o.blue*f.blue,m.alpha=o.alpha*f.alpha,m};fi.divide=function(o,f,m){return m.red=o.red/f.red,m.green=o.green/f.green,m.blue=o.blue/f.blue,m.alpha=o.alpha/f.alpha,m};fi.mod=function(o,f,m){return m.red=o.red%f.red,m.green=o.green%f.green,m.blue=o.blue%f.blue,m.alpha=o.alpha%f.alpha,m};fi.lerp=function(o,f,m,v){return v.red=xe.lerp(o.red,f.red,m),v.green=xe.lerp(o.green,f.green,m),v.blue=xe.lerp(o.blue,f.blue,m),v.alpha=xe.lerp(o.alpha,f.alpha,m),v};fi.multiplyByScalar=function(o,f,m){return m.red=o.red*f,m.green=o.green*f,m.blue=o.blue*f,m.alpha=o.alpha*f,m};fi.divideByScalar=function(o,f,m){return m.red=o.red/f,m.green=o.green/f,m.blue=o.blue/f,m.alpha=o.alpha/f,m};fi.ALICEBLUE=Object.freeze(fi.fromCssColorString("#F0F8FF"));fi.ANTIQUEWHITE=Object.freeze(fi.fromCssColorString("#FAEBD7"));fi.AQUA=Object.freeze(fi.fromCssColorString("#00FFFF"));fi.AQUAMARINE=Object.freeze(fi.fromCssColorString("#7FFFD4"));fi.AZURE=Object.freeze(fi.fromCssColorString("#F0FFFF"));fi.BEIGE=Object.freeze(fi.fromCssColorString("#F5F5DC"));fi.BISQUE=Object.freeze(fi.fromCssColorString("#FFE4C4"));fi.BLACK=Object.freeze(fi.fromCssColorString("#000000"));fi.BLANCHEDALMOND=Object.freeze(fi.fromCssColorString("#FFEBCD"));fi.BLUE=Object.freeze(fi.fromCssColorString("#0000FF"));fi.BLUEVIOLET=Object.freeze(fi.fromCssColorString("#8A2BE2"));fi.BROWN=Object.freeze(fi.fromCssColorString("#A52A2A"));fi.BURLYWOOD=Object.freeze(fi.fromCssColorString("#DEB887"));fi.CADETBLUE=Object.freeze(fi.fromCssColorString("#5F9EA0"));fi.CHARTREUSE=Object.freeze(fi.fromCssColorString("#7FFF00"));fi.CHOCOLATE=Object.freeze(fi.fromCssColorString("#D2691E"));fi.CORAL=Object.freeze(fi.fromCssColorString("#FF7F50"));fi.CORNFLOWERBLUE=Object.freeze(fi.fromCssColorString("#6495ED"));fi.CORNSILK=Object.freeze(fi.fromCssColorString("#FFF8DC"));fi.CRIMSON=Object.freeze(fi.fromCssColorString("#DC143C"));fi.CYAN=Object.freeze(fi.fromCssColorString("#00FFFF"));fi.DARKBLUE=Object.freeze(fi.fromCssColorString("#00008B"));fi.DARKCYAN=Object.freeze(fi.fromCssColorString("#008B8B"));fi.DARKGOLDENROD=Object.freeze(fi.fromCssColorString("#B8860B"));fi.DARKGRAY=Object.freeze(fi.fromCssColorString("#A9A9A9"));fi.DARKGREEN=Object.freeze(fi.fromCssColorString("#006400"));fi.DARKGREY=fi.DARKGRAY;fi.DARKKHAKI=Object.freeze(fi.fromCssColorString("#BDB76B"));fi.DARKMAGENTA=Object.freeze(fi.fromCssColorString("#8B008B"));fi.DARKOLIVEGREEN=Object.freeze(fi.fromCssColorString("#556B2F"));fi.DARKORANGE=Object.freeze(fi.fromCssColorString("#FF8C00"));fi.DARKORCHID=Object.freeze(fi.fromCssColorString("#9932CC"));fi.DARKRED=Object.freeze(fi.fromCssColorString("#8B0000"));fi.DARKSALMON=Object.freeze(fi.fromCssColorString("#E9967A"));fi.DARKSEAGREEN=Object.freeze(fi.fromCssColorString("#8FBC8F"));fi.DARKSLATEBLUE=Object.freeze(fi.fromCssColorString("#483D8B"));fi.DARKSLATEGRAY=Object.freeze(fi.fromCssColorString("#2F4F4F"));fi.DARKSLATEGREY=fi.DARKSLATEGRAY;fi.DARKTURQUOISE=Object.freeze(fi.fromCssColorString("#00CED1"));fi.DARKVIOLET=Object.freeze(fi.fromCssColorString("#9400D3"));fi.DEEPPINK=Object.freeze(fi.fromCssColorString("#FF1493"));fi.DEEPSKYBLUE=Object.freeze(fi.fromCssColorString("#00BFFF"));fi.DIMGRAY=Object.freeze(fi.fromCssColorString("#696969"));fi.DIMGREY=fi.DIMGRAY;fi.DODGERBLUE=Object.freeze(fi.fromCssColorString("#1E90FF"));fi.FIREBRICK=Object.freeze(fi.fromCssColorString("#B22222"));fi.FLORALWHITE=Object.freeze(fi.fromCssColorString("#FFFAF0"));fi.FORESTGREEN=Object.freeze(fi.fromCssColorString("#228B22"));fi.FUCHSIA=Object.freeze(fi.fromCssColorString("#FF00FF"));fi.GAINSBORO=Object.freeze(fi.fromCssColorString("#DCDCDC"));fi.GHOSTWHITE=Object.freeze(fi.fromCssColorString("#F8F8FF"));fi.GOLD=Object.freeze(fi.fromCssColorString("#FFD700"));fi.GOLDENROD=Object.freeze(fi.fromCssColorString("#DAA520"));fi.GRAY=Object.freeze(fi.fromCssColorString("#808080"));fi.GREEN=Object.freeze(fi.fromCssColorString("#008000"));fi.GREENYELLOW=Object.freeze(fi.fromCssColorString("#ADFF2F"));fi.GREY=fi.GRAY;fi.HONEYDEW=Object.freeze(fi.fromCssColorString("#F0FFF0"));fi.HOTPINK=Object.freeze(fi.fromCssColorString("#FF69B4"));fi.INDIANRED=Object.freeze(fi.fromCssColorString("#CD5C5C"));fi.INDIGO=Object.freeze(fi.fromCssColorString("#4B0082"));fi.IVORY=Object.freeze(fi.fromCssColorString("#FFFFF0"));fi.KHAKI=Object.freeze(fi.fromCssColorString("#F0E68C"));fi.LAVENDER=Object.freeze(fi.fromCssColorString("#E6E6FA"));fi.LAVENDAR_BLUSH=Object.freeze(fi.fromCssColorString("#FFF0F5"));fi.LAWNGREEN=Object.freeze(fi.fromCssColorString("#7CFC00"));fi.LEMONCHIFFON=Object.freeze(fi.fromCssColorString("#FFFACD"));fi.LIGHTBLUE=Object.freeze(fi.fromCssColorString("#ADD8E6"));fi.LIGHTCORAL=Object.freeze(fi.fromCssColorString("#F08080"));fi.LIGHTCYAN=Object.freeze(fi.fromCssColorString("#E0FFFF"));fi.LIGHTGOLDENRODYELLOW=Object.freeze(fi.fromCssColorString("#FAFAD2"));fi.LIGHTGRAY=Object.freeze(fi.fromCssColorString("#D3D3D3"));fi.LIGHTGREEN=Object.freeze(fi.fromCssColorString("#90EE90"));fi.LIGHTGREY=fi.LIGHTGRAY;fi.LIGHTPINK=Object.freeze(fi.fromCssColorString("#FFB6C1"));fi.LIGHTSEAGREEN=Object.freeze(fi.fromCssColorString("#20B2AA"));fi.LIGHTSKYBLUE=Object.freeze(fi.fromCssColorString("#87CEFA"));fi.LIGHTSLATEGRAY=Object.freeze(fi.fromCssColorString("#778899"));fi.LIGHTSLATEGREY=fi.LIGHTSLATEGRAY;fi.LIGHTSTEELBLUE=Object.freeze(fi.fromCssColorString("#B0C4DE"));fi.LIGHTYELLOW=Object.freeze(fi.fromCssColorString("#FFFFE0"));fi.LIME=Object.freeze(fi.fromCssColorString("#00FF00"));fi.LIMEGREEN=Object.freeze(fi.fromCssColorString("#32CD32"));fi.LINEN=Object.freeze(fi.fromCssColorString("#FAF0E6"));fi.MAGENTA=Object.freeze(fi.fromCssColorString("#FF00FF"));fi.MAROON=Object.freeze(fi.fromCssColorString("#800000"));fi.MEDIUMAQUAMARINE=Object.freeze(fi.fromCssColorString("#66CDAA"));fi.MEDIUMBLUE=Object.freeze(fi.fromCssColorString("#0000CD"));fi.MEDIUMORCHID=Object.freeze(fi.fromCssColorString("#BA55D3"));fi.MEDIUMPURPLE=Object.freeze(fi.fromCssColorString("#9370DB"));fi.MEDIUMSEAGREEN=Object.freeze(fi.fromCssColorString("#3CB371"));fi.MEDIUMSLATEBLUE=Object.freeze(fi.fromCssColorString("#7B68EE"));fi.MEDIUMSPRINGGREEN=Object.freeze(fi.fromCssColorString("#00FA9A"));fi.MEDIUMTURQUOISE=Object.freeze(fi.fromCssColorString("#48D1CC"));fi.MEDIUMVIOLETRED=Object.freeze(fi.fromCssColorString("#C71585"));fi.MIDNIGHTBLUE=Object.freeze(fi.fromCssColorString("#191970"));fi.MINTCREAM=Object.freeze(fi.fromCssColorString("#F5FFFA"));fi.MISTYROSE=Object.freeze(fi.fromCssColorString("#FFE4E1"));fi.MOCCASIN=Object.freeze(fi.fromCssColorString("#FFE4B5"));fi.NAVAJOWHITE=Object.freeze(fi.fromCssColorString("#FFDEAD"));fi.NAVY=Object.freeze(fi.fromCssColorString("#000080"));fi.OLDLACE=Object.freeze(fi.fromCssColorString("#FDF5E6"));fi.OLIVE=Object.freeze(fi.fromCssColorString("#808000"));fi.OLIVEDRAB=Object.freeze(fi.fromCssColorString("#6B8E23"));fi.ORANGE=Object.freeze(fi.fromCssColorString("#FFA500"));fi.ORANGERED=Object.freeze(fi.fromCssColorString("#FF4500"));fi.ORCHID=Object.freeze(fi.fromCssColorString("#DA70D6"));fi.PALEGOLDENROD=Object.freeze(fi.fromCssColorString("#EEE8AA"));fi.PALEGREEN=Object.freeze(fi.fromCssColorString("#98FB98"));fi.PALETURQUOISE=Object.freeze(fi.fromCssColorString("#AFEEEE"));fi.PALEVIOLETRED=Object.freeze(fi.fromCssColorString("#DB7093"));fi.PAPAYAWHIP=Object.freeze(fi.fromCssColorString("#FFEFD5"));fi.PEACHPUFF=Object.freeze(fi.fromCssColorString("#FFDAB9"));fi.PERU=Object.freeze(fi.fromCssColorString("#CD853F"));fi.PINK=Object.freeze(fi.fromCssColorString("#FFC0CB"));fi.PLUM=Object.freeze(fi.fromCssColorString("#DDA0DD"));fi.POWDERBLUE=Object.freeze(fi.fromCssColorString("#B0E0E6"));fi.PURPLE=Object.freeze(fi.fromCssColorString("#800080"));fi.RED=Object.freeze(fi.fromCssColorString("#FF0000"));fi.ROSYBROWN=Object.freeze(fi.fromCssColorString("#BC8F8F"));fi.ROYALBLUE=Object.freeze(fi.fromCssColorString("#4169E1"));fi.SADDLEBROWN=Object.freeze(fi.fromCssColorString("#8B4513"));fi.SALMON=Object.freeze(fi.fromCssColorString("#FA8072"));fi.SANDYBROWN=Object.freeze(fi.fromCssColorString("#F4A460"));fi.SEAGREEN=Object.freeze(fi.fromCssColorString("#2E8B57"));fi.SEASHELL=Object.freeze(fi.fromCssColorString("#FFF5EE"));fi.SIENNA=Object.freeze(fi.fromCssColorString("#A0522D"));fi.SILVER=Object.freeze(fi.fromCssColorString("#C0C0C0"));fi.SKYBLUE=Object.freeze(fi.fromCssColorString("#87CEEB"));fi.SLATEBLUE=Object.freeze(fi.fromCssColorString("#6A5ACD"));fi.SLATEGRAY=Object.freeze(fi.fromCssColorString("#708090"));fi.SLATEGREY=fi.SLATEGRAY;fi.SNOW=Object.freeze(fi.fromCssColorString("#FFFAFA"));fi.SPRINGGREEN=Object.freeze(fi.fromCssColorString("#00FF7F"));fi.STEELBLUE=Object.freeze(fi.fromCssColorString("#4682B4"));fi.TAN=Object.freeze(fi.fromCssColorString("#D2B48C"));fi.TEAL=Object.freeze(fi.fromCssColorString("#008080"));fi.THISTLE=Object.freeze(fi.fromCssColorString("#D8BFD8"));fi.TOMATO=Object.freeze(fi.fromCssColorString("#FF6347"));fi.TURQUOISE=Object.freeze(fi.fromCssColorString("#40E0D0"));fi.VIOLET=Object.freeze(fi.fromCssColorString("#EE82EE"));fi.WHEAT=Object.freeze(fi.fromCssColorString("#F5DEB3"));fi.WHITE=Object.freeze(fi.fromCssColorString("#FFFFFF"));fi.WHITESMOKE=Object.freeze(fi.fromCssColorString("#F5F5F5"));fi.YELLOW=Object.freeze(fi.fromCssColorString("#FFFF00"));fi.YELLOWGREEN=Object.freeze(fi.fromCssColorString("#9ACD32"));fi.TRANSPARENT=Object.freeze(new fi(0,0,0,0));var Re=fi;function Qb(o,f,m){if(f)for(let v=0;v=1&&(y=1);let x=m[v].color;o.addColorStop(y,x)}else{let v="rgba(255,255,255,0)";o.addColorStop(0,v),o.addColorStop(1,v)}}function ybt(o,f,m,v,y){let x=o.getContext("2d"),C=o.width,w=o.height,A=x.createLinearGradient(0,f.width,y.width,f.width);Qb(A,y.gradient&&f.gradient,y.colorRamp),x.fillStyle=A,x.beginPath(),x.moveTo(0,0),x.lineTo(y.width,f.width),x.lineTo(0,f.width),x.fill();let E=x.createLinearGradient(y.width,0,y.width,f.width);Qb(E,f.gradient&&y.gradient,f.colorRamp),x.fillStyle=E,x.beginPath(),x.moveTo(0,0),x.lineTo(y.width,f.width),x.lineTo(y.width,0),x.fill();let T=x.createLinearGradient(C/2,0,C/2,f.width);Qb(T,f.gradient,f.colorRamp),x.fillStyle=T,x.fillRect(y.width,0,C-m.width-y.width,f.width);let S=x.createLinearGradient(C-m.width,0,C-m.width,f.width);Qb(S,f.gradient&&m.gradient,f.colorRamp),x.fillStyle=S,x.beginPath(),x.moveTo(C-m.width,0),x.lineTo(C-m.width,f.width),x.lineTo(C,0),x.fill();let M=x.createLinearGradient(C,f.width,C-m.width,f.width);Qb(M,m.gradient&&f.gradient,m.colorRamp),x.fillStyle=M,x.beginPath(),x.moveTo(C,f.width),x.lineTo(C-m.width,f.width),x.lineTo(C,0),x.fill();let I=x.createLinearGradient(C,w/2,C-m.width,w/2);Qb(I,m.gradient,m.colorRamp),x.fillStyle=I,x.fillRect(C-m.width,f.width,C,w-v.width-f.width);let P=x.createLinearGradient(C,w-v.width,C-m.width,w-v.width);Qb(P,m.gradient&&v.gradient,m.colorRamp),x.fillStyle=P,x.beginPath(),x.moveTo(C,w),x.lineTo(C-m.width,w-v.width),x.lineTo(C,w-v.width),x.fill();let D=x.createLinearGradient(C-m.width,w,C-m.width,w-v.width);Qb(D,v.gradient&&m.gradient,v.colorRamp),x.fillStyle=D,x.beginPath(),x.moveTo(C,w),x.lineTo(C-m.width,w),x.lineTo(C-m.width,w-v.width),x.fill();let L=x.createLinearGradient(C/2,w,C/2,w-v.width);Qb(L,v.gradient,v.colorRamp),x.fillStyle=L,x.fillRect(y.width,w-v.width,C-m.width-y.width,w);let R=x.createLinearGradient(y.width,w,y.width,w-v.width);Qb(R,v.gradient&&y.gradient,v.colorRamp),x.fillStyle=R,x.beginPath(),x.moveTo(0,w),x.lineTo(y.width,w),x.lineTo(y.width,w-v.width),x.fill();let O=x.createLinearGradient(0,w-v.width,y.width,w-v.width);Qb(O,y.gradient&&v.gradient,y.colorRamp),x.fillStyle=O,x.beginPath(),x.moveTo(0,w),x.lineTo(0,w-v.width),x.lineTo(y.width,w-v.width),x.fill();let F=x.createLinearGradient(0,w/2,y.width,w/2);Qb(F,y.gradient,y.colorRamp),x.fillStyle=F,x.fillRect(0,f.width,y.width,w-f.width-v.width),x.fillStyle="rgba(255,255,255,1)",x.fillRect(y.width,f.width,C-m.width-y.width,w-v.width-f.width)}function xbt(o,f,m,v){let y=document.createElement("canvas");return y.width=256,y.height=256,ybt(y,o,f,m,v),y}function pU(o,f,m,v,y,x){let C=xbt(m,v,y,x);f._blendCanvas=C,f._blendCanvasDirty=!0,f._blendTextureWidth=C.width,f._blendTextureHeight=C.height}function Zj(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Zj.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});Zj.prototype.addEventListener=function(o,f){this._listeners.push(o),this._scopes.push(f);let m=this;return function(){m.removeEventListener(o,f)}};Zj.prototype.removeEventListener=function(o,f){let m=this._listeners,v=this._scopes,y=-1;for(let x=0;x0){for(y.sort(Cbt),o=0;o"u")return o;f=Z(m.baseURI,m.location.href)}let v=new Pbt.default(o);return v.scheme()!==""?v.toString():v.absoluteTo(f).toString()};var $j=Q0e,Ibt=dd(jw(),1);function Mbt(o,f){let m="",v=o.lastIndexOf("/");return v!==-1&&(m=o.substring(0,v+1)),f&&(o=new Ibt.default(o),o.query().length!==0&&(m+=`?${o.query()}`),o.fragment().length!==0&&(m+=`#${o.fragment()}`)),m}var Z0e=Mbt,Dbt=dd(jw(),1);function Lbt(o){let f=new Dbt.default(o);f.normalize();let m=f.path(),v=m.lastIndexOf("/");return v!==-1&&(m=m.substr(v+1)),v=m.lastIndexOf("."),v===-1?m="":m=m.substr(v+1),m}var Bie=Lbt,iNe={};function Rbt(o,f,m){N(f)||(f=o.width),N(m)||(m=o.height);let v=iNe[f];N(v)||(v={},iNe[f]=v);let y=v[m];if(!N(y)){let x=document.createElement("canvas");x.width=f,x.height=m,y=x.getContext("2d",{willReadFrequently:!0}),y.globalCompositeOperation="copy",v[m]=y}return y.drawImage(o,0,0,f,m),y.getImageData(0,0,f,m).data}var w5=Rbt,Obt=/^blob:/i;function Nbt(o){return Obt.test(o)}var kie=Nbt,BS;function Fbt(o){N(BS)||(BS=document.createElement("a")),BS.href=window.location.href;let f=BS.host,m=BS.protocol;return BS.href=o,BS.href=BS.href,m!==BS.protocol||f!==BS.host}var Vie=Fbt,Bbt=/^data:/i;function kbt(o){return Bbt.test(o)}var eY=kbt;function Vbt(o){let f=document.createElement("script");return f.async=!0,f.src=o,new Promise((m,v)=>{window.crossOriginIsolated&&f.setAttribute("crossorigin","anonymous");let y=document.getElementsByTagName("head")[0];f.onload=function(){f.onload=void 0,y.removeChild(f),m()},f.onerror=function(x){v(x)},y.appendChild(f)})}var zie=Vbt;function zbt(o){let f="";for(let m in o)if(o.hasOwnProperty(m)){let v=o[m],y=`${encodeURIComponent(m)}=`;if(Array.isArray(v))for(let x=0,C=v.length;x0){let C=y.substring(0,x),w=y.substring(x+2);f[C]=w}}return f}var $0e=Wbt;function g9e(o,f,m){this.statusCode=o,this.response=f,this.responseHeaders=m,typeof this.responseHeaders=="string"&&(this.responseHeaders=$0e(this.responseHeaders))}g9e.prototype.toString=function(){let o="Request has failed.";return N(this.statusCode)&&(o+=` Status Code: ${this.statusCode}`),o};var A5=g9e,Kpe=dd(jw(),1);function dB(o){this._comparator=o.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(dB.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(o){let f=this._length;if(o=0;--f)this.heapify(f)};dB.prototype.insert=function(o){let f=this._array,m=this._comparator,v=this._maximumLength,y=this._length++;for(yv&&(x=f[v],this._length=v),x};dB.prototype.pop=function(o){if(o=Z(o,0),this._length===0)return;let f=this._array,m=f[o];return e_e(f,o,--this._length),this.heapify(o),f[this._length]=void 0,m};var t_e=dB;function jbt(o,f){return o.priority-f.priority}var Jc={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},Pz=20,Tv=new t_e({comparator:jbt});Tv.maximumLength=Pz;Tv.reserve(Pz);var QS=[],mM={},Ybt=typeof document<"u"?new Kpe.default(document.location.href):new Kpe.default,Uie=new Br;function rf(){}rf.maximumRequests=50;rf.maximumRequestsPerServer=6;rf.requestsByServer={"api.cesium.com:443":18,"assets.ion.cesium.com:443":18,"ibasemaps-api.arcgis.com:443":18,"tile.googleapis.com:443":18};rf.throttleRequests=!0;rf.debugShowStatistics=!1;rf.requestCompletedEvent=Uie;Object.defineProperties(rf,{statistics:{get:function(){return Jc}},priorityHeapLength:{get:function(){return Pz},set:function(o){if(oo;){let f=Tv.pop();l5(f)}Pz=o,Tv.maximumLength=o,Tv.reserve(o)}}});function _9e(o){N(o.priorityFunction)&&(o.priority=o.priorityFunction())}rf.serverHasOpenSlots=function(o,f){f=Z(f,1);let m=Z(rf.requestsByServer[o],rf.maximumRequestsPerServer);return mM[o]+f<=m};rf.heapHasOpenSlots=function(o){return Tv.length+o<=Pz};function v9e(o){return o.state===bc.UNISSUED&&(o.state=bc.ISSUED,o.deferred=pd()),o.deferred.promise}function qbt(o){return function(f){if(o.state===bc.CANCELLED)return;let m=o.deferred;--Jc.numberOfActiveRequests,--mM[o.serverKey],Uie.raiseEvent(),o.state=bc.RECEIVED,o.deferred=void 0,m.resolve(f)}}function Xbt(o){return function(f){o.state!==bc.CANCELLED&&(++Jc.numberOfFailedRequests,--Jc.numberOfActiveRequests,--mM[o.serverKey],Uie.raiseEvent(f),o.state=bc.FAILED,o.deferred.reject(f))}}function y9e(o){let f=v9e(o);return o.state=bc.ACTIVE,QS.push(o),++Jc.numberOfActiveRequests,++Jc.numberOfActiveRequestsEver,++mM[o.serverKey],o.requestFunction().then(qbt(o)).catch(Xbt(o)),f}function l5(o){let f=o.state===bc.ACTIVE;if(o.state=bc.CANCELLED,++Jc.numberOfCancelledRequests,N(o.deferred)){let m=o.deferred;o.deferred=void 0,m.reject()}f&&(--Jc.numberOfActiveRequests,--mM[o.serverKey],++Jc.numberOfCancelledActiveRequests),N(o.cancelFunction)&&o.cancelFunction()}rf.update=function(){let o,f,m=0,v=QS.length;for(o=0;o0&&(QS[o-m]=f)}QS.length-=m;let y=Tv.internalArray,x=Tv.length;for(o=0;o0;){if(f=Tv.pop(),f.cancelled){l5(f);continue}if(f.throttleByServer&&!rf.serverHasOpenSlots(f.serverKey)){l5(f);continue}y9e(f),++w}Jbt()};rf.getServerKey=function(o){let f=new Kpe.default(o);f.scheme()===""&&(f=f.absoluteTo(Ybt),f.normalize());let m=f.authority();/:/.test(m)||(m=`${m}:${f.scheme()==="https"?"443":"80"}`);let v=mM[m];return N(v)||(mM[m]=0),m};rf.request=function(o){if(eY(o.url)||kie(o.url))return Uie.raiseEvent(),o.state=bc.RECEIVED,o.requestFunction();if(++Jc.numberOfAttemptedRequests,N(o.serverKey)||(o.serverKey=rf.getServerKey(o.url)),rf.throttleRequests&&o.throttleByServer&&!rf.serverHasOpenSlots(o.serverKey))return;if(!rf.throttleRequests||!o.throttle)return y9e(o);if(QS.length>=rf.maximumRequests)return;_9e(o);let f=Tv.insert(o);if(N(f)){if(f===o)return;l5(f)}return v9e(o)};function Jbt(){rf.debugShowStatistics&&(Jc.numberOfActiveRequests===0&&Jc.lastNumberOfActiveRequests>0&&(Jc.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Jc.numberOfAttemptedRequests}`),Jc.numberOfAttemptedRequests=0),Jc.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Jc.numberOfCancelledRequests}`),Jc.numberOfCancelledRequests=0),Jc.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Jc.numberOfCancelledActiveRequests}`),Jc.numberOfCancelledActiveRequests=0),Jc.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Jc.numberOfFailedRequests}`),Jc.numberOfFailedRequests=0)),Jc.lastNumberOfActiveRequests=Jc.numberOfActiveRequests)}rf.clearForSpecs=function(){for(;Tv.length>0;){let f=Tv.pop();l5(f)}let o=QS.length;for(let f=0;f0}},credits:{get:function(){return this._credits}}});Do.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Do.prototype.parseUrl=function(o,f,m,v){let y=new Ebt.default(o),x=Zbt(y.query());this._queryParameters=f?yee(x,this.queryParameters,m):x,y.search(""),y.fragment(""),N(v)&&y.scheme()===""&&(y=y.absoluteTo($j(v))),this._url=y.toString()};function Zbt(o){return o.length===0?{}:o.indexOf("=")===-1?{[o]:void 0}:s2(o)}function yee(o,f,m){if(!m)return va(o,f);let v=uo(o,!0);for(let y in f)if(f.hasOwnProperty(y)){let x=v[y],C=f[y];N(x)?(Array.isArray(x)||(x=v[y]=[x]),v[y]=x.concat(C)):v[y]=Array.isArray(C)?C.slice():C}return v}Do.prototype.getUrlComponent=function(o,f){if(this.isDataUri)return this._url;let m=this._url;o&&(m=`${m}${$bt(this.queryParameters)}`),m=m.replace(/%7B/g,"{").replace(/%7D/g,"}");let v=this._templateValues;return Object.keys(v).length>0&&(m=m.replace(/{(.*?)}/g,function(y,x){let C=v[x];return N(C)?encodeURIComponent(C):y})),f&&N(this.proxy)&&(m=this.proxy.getURL(m)),m};function $bt(o){let f=Object.keys(o);return f.length===0?"":f.length===1&&!N(o[f[0]])?`?${f[0]}`:`?${Hie(o)}`}Do.prototype.setQueryParameters=function(o,f){f?this._queryParameters=yee(this._queryParameters,o,!1):this._queryParameters=yee(o,this._queryParameters,!1)};Do.prototype.appendQueryParameters=function(o){this._queryParameters=yee(o,this._queryParameters,!0)};Do.prototype.setTemplateValues=function(o,f){f?this._templateValues=va(this._templateValues,o):this._templateValues=va(o,this._templateValues)};Do.prototype.getDerivedResource=function(o){let f=this.clone();if(f._retryCount=0,N(o.url)){let m=Z(o.preserveQueryParameters,!1);f.parseUrl(o.url,!0,m,this._url)}return N(o.queryParameters)&&(f._queryParameters=va(o.queryParameters,f.queryParameters)),N(o.templateValues)&&(f._templateValues=va(o.templateValues,f.templateValues)),N(o.headers)&&(f.headers=va(o.headers,f.headers)),N(o.proxy)&&(f.proxy=o.proxy),N(o.request)&&(f.request=o.request),N(o.retryCallback)&&(f.retryCallback=o.retryCallback),N(o.retryAttempts)&&(f.retryAttempts=o.retryAttempts),f};Do.prototype.retryOnError=function(o){let f=this.retryCallback;if(typeof f!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let m=this;return Promise.resolve(f(this,o)).then(function(v){return++m._retryCount,v})};Do.prototype.clone=function(o){return N(o)?(o._url=this._url,o._queryParameters=uo(this._queryParameters),o._templateValues=uo(this._templateValues),o.headers=uo(this.headers),o.proxy=this.proxy,o.retryCallback=this.retryCallback,o.retryAttempts=this.retryAttempts,o._retryCount=0,o.request=this.request.clone(),o):new Do({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:N(this.credits)?this.credits.slice():void 0})};Do.prototype.getBaseUri=function(o){return Z0e(this.getUrlComponent(o),o)};Do.prototype.appendForwardSlash=function(){this._url=K0e(this._url)};Do.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Do.fetchArrayBuffer=function(o){return new Do(o).fetchArrayBuffer()};Do.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Do.fetchBlob=function(o){return new Do(o).fetchBlob()};Do.prototype.fetchImage=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.preferImageBitmap,!1),m=Z(o.preferBlob,!1),v=Z(o.flipY,!1),y=Z(o.skipColorSpaceConversion,!1);if(i_e(this.request),!x9e||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!m)return Qpe({resource:this,flipY:v,skipColorSpaceConversion:y,preferImageBitmap:f});let x=this.fetchBlob();if(!N(x))return;let C,w,A,E;return Do.supportsImageBitmapOptions().then(function(T){return C=T,w=C&&f,x}).then(function(T){if(!N(T))return;if(E=T,w)return Do.createImageBitmapFromBlob(T,{flipY:v,premultiplyAlpha:!1,skipColorSpaceConversion:y});let S=window.URL.createObjectURL(T);return A=new Do({url:S}),Qpe({resource:A,flipY:v,skipColorSpaceConversion:y,preferImageBitmap:!1})}).then(function(T){if(N(T))return T.blob=E,w||window.URL.revokeObjectURL(A.url),T}).catch(function(T){return N(A)&&window.URL.revokeObjectURL(A.url),T.blob=E,Promise.reject(T)})};function Qpe(o){let f=o.resource,m=o.flipY,v=o.skipColorSpaceConversion,y=o.preferImageBitmap,x=f.request;x.url=f.url,x.requestFunction=function(){let w=!1;!f.isDataUri&&!f.isBlobUri&&(w=f.isCrossOriginUrl);let A=pd();return x.url.indexOf("nullvalue=")>-1?Do._Implementations.createImageSGS(x.url,w,A):Do._Implementations.createImage(x,w,A,m,v,y),A.promise};let C=Rw.request(x);if(N(C))return C.catch(function(w){return x.state!==bc.FAILED?Promise.reject(w):f.retryOnError(w).then(function(A){return A?(x.state=bc.UNISSUED,x.deferred=void 0,Qpe({resource:f,flipY:m,skipColorSpaceConversion:v,preferImageBitmap:y})):Promise.reject(w)})})}Do.fetchImage=function(o){return new Do(o).fetchImage({flipY:o.flipY,skipColorSpaceConversion:o.skipColorSpaceConversion,preferBlob:o.preferBlob,preferImageBitmap:o.preferImageBitmap})};Do.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Do.fetchText=function(o){return new Do(o).fetchText()};Do.prototype.fetchJson=function(){let o=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(N(o))return o.then(function(f){if(N(f))return JSON.parse(f)})};Do.fetchJson=function(o){return new Do(o).fetchJson()};Do.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Do.fetchXML=function(o){return new Do(o).fetchXML()};Do.prototype.fetchJsonp=function(o){o=Z(o,"callback"),i_e(this.request);let f;do f=`loadJsonp${xe.nextRandomNumber().toString().substring(2,8)}`;while(N(window[f]));return C9e(this,o,f)};function C9e(o,f,m){let v={};v[f]=m,o.setQueryParameters(v);let y=o.request,x=o.url;y.url=x,y.requestFunction=function(){let w=pd();return window[m]=function(A){w.resolve(A);try{delete window[m]}catch{window[m]=void 0}},Do._Implementations.loadAndExecuteScript(x,m,w),w.promise};let C=Rw.request(y);if(N(C))return C.catch(function(w){return y.state!==bc.FAILED?Promise.reject(w):o.retryOnError(w).then(function(A){return A?(y.state=bc.UNISSUED,y.deferred=void 0,C9e(o,f,m)):Promise.reject(w)})})}Do.fetchJsonp=function(o){return new Do(o).fetchJsonp(o.callbackParameterName)};Do.prototype._makeRequest=function(o){let f=this;i_e(f.request);let m=f.request,v=f.url;m.url=v,m.requestFunction=function(){let x=o.responseType,C=va(o.headers,f.headers),w=o.overrideMimeType,A=o.method,E=o.data,T=pd(),S=Do._Implementations.loadWithXhr(v,x,A,E,C,T,w);return N(S)&&N(S.abort)&&(m.cancelFunction=function(){S.abort()}),T.promise};let y=Rw.request(m);if(N(y))return y.then(function(x){return m.cancelFunction=void 0,x}).catch(function(x){return m.cancelFunction=void 0,m.state!==bc.FAILED?Promise.reject(x):f.retryOnError(x).then(function(C){return C?(m.state=bc.UNISSUED,m.deferred=void 0,f.fetch(o)):Promise.reject(x)})})};function i_e(o){if(o.state===bc.ISSUED||o.state===bc.ACTIVE)throw new sr("The Resource is already being fetched.");o.state=bc.UNISSUED,o.deferred=void 0}var ewt=/^data:(.*?)(;base64)?,(.*)$/;function A$(o,f){let m=decodeURIComponent(f);return o?atob(m):m}function rNe(o,f){let m=A$(o,f),v=new ArrayBuffer(m.length),y=new Uint8Array(v);for(let x=0;x(w=E.parse(o),A=T,w.protocol==="https:"?import("https"):import("http"))).then(E=>{let T={protocol:w.protocol,hostname:w.hostname,port:w.port,path:w.path,query:w.query,method:m,headers:y};E.request(T).on("response",function(S){if(S.statusCode<200||S.statusCode>=300){x.reject(new A5(S.statusCode,S,S.headers));return}let M=[];S.on("data",function(I){M.push(I)}),S.on("end",function(){let I=Buffer.concat(M);S.headers["content-encoding"]==="gzip"?A.gunzip(I,function(P,D){P?x.reject(new sr("Error decompressing response.")):x.resolve(nNe(D,f))}):x.resolve(nNe(I,f))})}).on("error",function(S){x.reject(new A5)}).end()})}var rwt=typeof XMLHttpRequest>"u";Do._Implementations.loadWithXhr=function(o,f,m,v,y,x,C){let w=ewt.exec(o);if(w!==null){x.resolve(twt(w,f));return}if(rwt){iwt(o,f,m,v,y,x,C);return}let A=new XMLHttpRequest;if(Gie.contains(o)&&(A.withCredentials=!0),A.open(m,o,!0),N(C)&&N(A.overrideMimeType)&&A.overrideMimeType(C),N(y))for(let T in y)y.hasOwnProperty(T)&&A.setRequestHeader(T,y[T]);N(f)&&(A.responseType=f);let E=!1;return typeof o=="string"&&(E=o.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),A.onload=function(){if((A.status<200||A.status>=300)&&!(E&&A.status===0)){x.reject(new A5(A.status,A.response,A.getAllResponseHeaders()));return}let T=A.response,S=A.responseType;if(m==="HEAD"||m==="OPTIONS"){let M=A.getAllResponseHeaders().trim().split(/[\r\n]+/),I={};M.forEach(function(P){let D=P.split(": "),L=D.shift();I[L]=D.join(": ")}),x.resolve(I);return}if(A.status===204)x.resolve();else if(N(T)&&(!N(f)||S===f))x.resolve(T);else if(f==="json"&&typeof T=="string")try{x.resolve(JSON.parse(T))}catch(M){x.reject(M)}else(S===""||S==="document")&&N(A.responseXML)&&A.responseXML.hasChildNodes()?x.resolve(A.responseXML):(S===""||S==="text")&&N(A.responseText)?x.resolve(A.responseText):x.reject(new sr("Invalid XMLHttpRequest response type."))},A.onerror=function(T){x.reject(new A5)},o.includes("gisserver")&&o.includes("tmsserver")&&o.includes(".json")||A.send(v),A};Do._Implementations.loadAndExecuteScript=function(o,f,m){return zie(o,f).catch(function(v){m.reject(v)})};Do._DefaultImplementations={};Do._DefaultImplementations.createImage=Do._Implementations.createImage;Do._DefaultImplementations.loadWithXhr=Do._Implementations.loadWithXhr;Do._DefaultImplementations.loadAndExecuteScript=Do._Implementations.loadAndExecuteScript;Do.DEFAULT=Object.freeze(new Do({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var Jr=Do;function lH(o,f,m,v,y){this._format=o,this._datatype=f,this._width=m,this._height=v,this._buffer=y}Object.defineProperties(lH.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}}});lH.clone=function(o){if(N(o))return new lH(o._format,o._datatype,o._width,o._height,o._buffer)};lH.prototype.clone=function(){return lH.clone(this)};var iY=lH,nwt=dd(jw(),1),b9e=/((?:.*\/)|^)WebSDK\.js(?:\?|\#|$)/;function owt(){let o=document.getElementsByTagName("script");for(let f=0,m=o.length;f"u"?o:(N(gV)||(gV=document.createElement("a")),gV.href=o,gV.href=gV.href,gV.href)}var jF;function A9e(){if(N(jF))return jF;let o;return typeof GEOWORLD_BASE_URL<"u"?o=GEOWORLD_BASE_URL:typeof define=="object"&&N(define.amd)&&!define.amd.toUrlUndefined&&N(ZF.toUrl)?o=$j("..",fB("Core/buildModuleUrl.js")):o=owt(),jF=new Jr({url:w9e(o)}),jF.appendForwardSlash(),jF}function awt(o){return w9e(ZF.toUrl(`../${o}`))}function E9e(o){return A9e().getDerivedResource({url:o}).url}var tQ;function fB(o){return N(tQ)||(typeof define=="object"&&N(define.amd)&&!define.amd.toUrlUndefined&&N(ZF.toUrl)?tQ=awt:tQ=E9e),tQ(o)}fB._cesiumScriptRegex=b9e;fB._buildModuleUrlFromBaseUrl=E9e;fB._clearBaseResource=function(){jF=void 0};fB.setBaseUrl=function(o){jF=Jr.DEFAULT.getDerivedResource({url:o})};fB.getCesiumBaseUrl=A9e;var Ms=fB;function T9e(){if(!N(v_._canTransferArrayBuffer)){let o=new Worker(P9e("Workers/transferTypedArrayTest.js"));o.postMessage=Z(o.webkitPostMessage,o.postMessage);let f=99,m=new Int8Array([f]);try{o.postMessage({array:m},[m.buffer])}catch{return v_._canTransferArrayBuffer=!1,v_._canTransferArrayBuffer}let v=pd();o.onmessage=function(y){let x=y.data.array,C=N(x)&&x[0]===f;v.resolve(C),o.terminate(),v_._canTransferArrayBuffer=C},v_._canTransferArrayBuffer=v.promise}return v_._canTransferArrayBuffer}var Zpe=new Br;function S9e(o,f){--o._activeTasks;let m=f.id;if(!N(m))return;let v=o._deferreds,y=v[m];if(N(f.error)){let x=f.error;x.name==="RuntimeError"?(x=new sr(f.error.message),x.stack=f.error.stack):x.name==="DeveloperError"&&(x=new li(f.error.message),x.stack=f.error.stack),Zpe.raiseEvent(x),y.reject(x)}else Zpe.raiseEvent(),y.resolve(f.result);delete v[m]}function P9e(o){let f=Ms(o);if(Vie(f)){let m=`importScripts("${f}");`,v;try{v=new Blob([m],{type:"application/javascript"})}catch{let y=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,x=new y;x.append(m),v=x.getBlob("application/javascript")}f=(window.URL||window.webkitURL).createObjectURL(v)}return f}var Nce;function swt(){return N(Nce)||(Nce=P9e("Workers/cesiumWorkerBootstrapper.js")),Nce}function I9e(o){let f=new Worker(swt());f.postMessage=Z(f.webkitPostMessage,f.postMessage);let m={loaderConfig:{paths:{Workers:Ms("Workers")},baseUrl:Ms.getCesiumBaseUrl().url},workerModule:o._workerPath};return f.postMessage(m),f.onmessage=function(v){S9e(o,v.data)},f}function lwt(o,f){let m={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!pa.supportsWebAssembly()){if(!N(f.fallbackModulePath))throw new sr(`This browser does not support Web Assembly, and no backup module was provided for ${o._workerPath}`);return m.modulePath=Ms(f.fallbackModulePath),Promise.resolve(m)}return m.modulePath=Ms(f.modulePath),m.wasmBinaryFile=Ms(f.wasmBinaryFile),Jr.fetchArrayBuffer({url:m.wasmBinaryFile}).then(function(v){return m.wasmBinary=v,m})}function v_(o,f){let m=new nwt.default(o);this._workerPath=m.scheme().length!==0&&m.fragment().length===0?o:v_._workerModulePrefix+o,this._maximumActiveTasks=Z(f,Number.POSITIVE_INFINITY),this._activeTasks=0,this._deferreds={},this._nextID=0}var uwt=[];v_.prototype.scheduleTask=function(o,f){if(N(this._worker)||(this._worker=I9e(this)),this._activeTasks>=this._maximumActiveTasks)return;++this._activeTasks;let m=this;return Promise.resolve(T9e()).then(function(v){N(f)?v||(f.length=0):f=uwt;let y=m._nextID++,x=pd();return m._deferreds[y]=x,m._worker.postMessage({id:y,parameters:o,canTransferArrayBuffer:v},f),x.promise})};v_.prototype.initWebAssemblyModule=function(o){N(this._worker)||(this._worker=I9e(this));let f=pd(),m=this,v=this._worker;return lwt(this,o).then(function(y){return Promise.resolve(T9e()).then(function(x){let C,w=y.wasmBinary;N(w)&&x&&(C=[w]),v.onmessage=function(A){v.onmessage=function(E){S9e(m,E.data)},f.resolve(A.data)},v.postMessage({webAssemblyConfig:y},C)})}),f.promise};v_.prototype.isDestroyed=function(){return!1};v_.prototype.destroy=function(){return N(this._worker)&&this._worker.terminate(),kr(this)};v_.taskCompletedEvent=Zpe;v_._defaultWorkerModulePrefix="Workers/";v_._workerModulePrefix=v_._defaultWorkerModulePrefix;v_._canTransferArrayBuffer=void 0;var tp=v_;function rM(){}rM._transcodeTaskProcessor=new tp("transcodeKTX2",Number.POSITIVE_INFINITY);rM._readyPromise=void 0;function cwt(){let o=rM._transcodeTaskProcessor.initWebAssemblyModule({modulePath:"ThirdParty/Workers/basis_transcoder.js",wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(){return rM._transcodeTaskProcessor});rM._readyPromise=o}rM.transcode=function(o,f){return N(rM._readyPromise)||cwt(),rM._readyPromise.then(function(m){let v;if(o instanceof ArrayBuffer){let y=new Uint8Array(o);return v={supportedTargetFormats:f,ktx2Buffer:y},m.scheduleTask(v,[o])}return v={supportedTargetFormats:f,ktx2Buffer:o},m.scheduleTask(v,[o.buffer])}).then(function(m){let v=m.length,y=Object.keys(m[0]),x=y.length,C;for(C=0;Cv&&(y=E,v=T)}let x=1,C=0,w=$pe[y],A=eme[y];if(Math.abs(o[zn.getElementIndex(A,w)])>m){let E=o[zn.getElementIndex(A,A)],T=o[zn.getElementIndex(w,w)],S=o[zn.getElementIndex(A,w)],M=(E-T)/2/S,I;M<0?I=-1/(-M+Math.sqrt(1+M*M)):I=1/(M+Math.sqrt(1+M*M)),x=1/Math.sqrt(1+I*I),C=I*x}return f=zn.clone(zn.IDENTITY,f),f[zn.getElementIndex(w,w)]=f[zn.getElementIndex(A,A)]=x,f[zn.getElementIndex(A,w)]=C,f[zn.getElementIndex(w,A)]=-C,f}var rQ=new zn,cNe=new zn;zn.computeEigenDecomposition=function(o,f){let m=xe.EPSILON20,v=10,y=0,x=0;N(f)||(f={});let C=f.unitary=zn.clone(zn.IDENTITY,f.unitary),w=f.diagonal=zn.clone(o,f.diagonal),A=m*Awt(w);for(;xA;)Twt(w,rQ),zn.transpose(rQ,cNe),zn.multiply(w,rQ,w),zn.multiply(cNe,w,w),zn.multiply(C,rQ,C),++y>2&&(++x,y=0);return f};zn.abs=function(o,f){return f[0]=Math.abs(o[0]),f[1]=Math.abs(o[1]),f[2]=Math.abs(o[2]),f[3]=Math.abs(o[3]),f[4]=Math.abs(o[4]),f[5]=Math.abs(o[5]),f[6]=Math.abs(o[6]),f[7]=Math.abs(o[7]),f[8]=Math.abs(o[8]),f};zn.determinant=function(o){let f=o[0],m=o[3],v=o[6],y=o[1],x=o[4],C=o[7],w=o[2],A=o[5],E=o[8];return f*(x*E-A*C)+y*(A*v-m*E)+w*(m*C-x*v)};zn.inverse=function(o,f){let m=o[0],v=o[1],y=o[2],x=o[3],C=o[4],w=o[5],A=o[6],E=o[7],T=o[8],S=zn.determinant(o);f[0]=C*T-E*w,f[1]=E*y-v*T,f[2]=v*w-C*y,f[3]=A*w-x*T,f[4]=m*T-A*y,f[5]=x*y-m*w,f[6]=x*E-A*C,f[7]=A*v-m*E,f[8]=m*C-x*v;let M=1/S;return zn.multiplyByScalar(f,M,f)};var Swt=new zn;zn.inverseTranspose=function(o,f){return zn.inverse(zn.transpose(o,Swt),f)};zn.equals=function(o,f){return o===f||N(o)&&N(f)&&o[0]===f[0]&&o[1]===f[1]&&o[2]===f[2]&&o[3]===f[3]&&o[4]===f[4]&&o[5]===f[5]&&o[6]===f[6]&&o[7]===f[7]&&o[8]===f[8]};zn.equalsEpsilon=function(o,f,m){return m=Z(m,0),o===f||N(o)&&N(f)&&Math.abs(o[0]-f[0])<=m&&Math.abs(o[1]-f[1])<=m&&Math.abs(o[2]-f[2])<=m&&Math.abs(o[3]-f[3])<=m&&Math.abs(o[4]-f[4])<=m&&Math.abs(o[5]-f[5])<=m&&Math.abs(o[6]-f[6])<=m&&Math.abs(o[7]-f[7])<=m&&Math.abs(o[8]-f[8])<=m};zn.IDENTITY=Object.freeze(new zn(1,0,0,0,1,0,0,0,1));zn.ZERO=Object.freeze(new zn(0,0,0,0,0,0,0,0,0));zn.COLUMN0ROW0=0;zn.COLUMN0ROW1=1;zn.COLUMN0ROW2=2;zn.COLUMN1ROW0=3;zn.COLUMN1ROW1=4;zn.COLUMN1ROW2=5;zn.COLUMN2ROW0=6;zn.COLUMN2ROW1=7;zn.COLUMN2ROW2=8;Object.defineProperties(zn.prototype,{length:{get:function(){return zn.packedLength}}});zn.prototype.clone=function(o){return zn.clone(this,o)};zn.prototype.equals=function(o){return zn.equals(this,o)};zn.equalsArray=function(o,f,m){return o[0]===f[m]&&o[1]===f[m+1]&&o[2]===f[m+2]&&o[3]===f[m+3]&&o[4]===f[m+4]&&o[5]===f[m+5]&&o[6]===f[m+6]&&o[7]===f[m+7]&&o[8]===f[m+8]};zn.prototype.equalsEpsilon=function(o,f){return zn.equalsEpsilon(this,o,f)};zn.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) (${this[2]}, ${this[5]}, ${this[8]})`};var Ut=zn;function bo(o,f,m,v){this.x=Z(o,0),this.y=Z(f,0),this.z=Z(m,0),this.w=Z(v,0)}bo.fromElements=function(o,f,m,v,y){return N(y)?(y.x=o,y.y=f,y.z=m,y.w=v,y):new bo(o,f,m,v)};bo.fromColor=function(o,f){return N(f)?(f.x=o.red,f.y=o.green,f.z=o.blue,f.w=o.alpha,f):new bo(o.red,o.green,o.blue,o.alpha)};bo.clone=function(o,f){if(N(o))return N(f)?(f.x=o.x,f.y=o.y,f.z=o.z,f.w=o.w,f):new bo(o.x,o.y,o.z,o.w)};bo.packedLength=4;bo.pack=function(o,f,m){return m=Z(m,0),f[m++]=o.x,f[m++]=o.y,f[m++]=o.z,f[m]=o.w,f};bo.unpack=function(o,f,m){return f=Z(f,0),N(m)||(m=new bo),m.x=o[f++],m.y=o[f++],m.z=o[f++],m.w=o[f],m};bo.packArray=function(o,f){let m=o.length,v=m*4;N(f)?!Array.isArray(f)&&f.length!==v||f.length!==v&&(f.length=v):f=new Array(v);for(let y=0;y maxHeight) { material.diffuse = vec3(0.0); material.alpha = 0.0; return material; } // Binary search to find heights above and below. int idxBelow = 0; int idxAbove = heightsDimensions.x; float heightBelow = minHeight; float heightAbove = maxHeight; // while loop not allowed, so use for loop with max iterations. // maxIterations of 16 supports a texture size up to 65536 (2^16). const int maxIterations = 16; for (int i = 0; i < maxIterations; i++) { if (idxBelow >= idxAbove - 1) { break; } int idxMid = (idxBelow + idxAbove) / 2; float heightTex = getHeight(idxMid, invTexSize); if (height > heightTex) { idxBelow = idxMid; heightBelow = heightTex; } else { idxAbove = idxMid; heightAbove = heightTex; } } float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow); vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5); vec4 color = texture(colors, colorUv); // undo preumultiplied alpha if (color.a > 0.0) { color.rgb /= color.a; } color.rgb = czm_gammaCorrect(color.rgb); material.diffuse = color.rgb; material.alpha = color.a; return material; } `,c_e=`uniform vec4 color; uniform float spacing; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); float distanceToContour = mod(materialInput.height, spacing); #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) float dxc = abs(dFdx(materialInput.height)); float dyc = abs(dFdy(materialInput.height)); float dF = max(dxc, dyc) * czm_pixelRatio * width; float alpha = (distanceToContour < dF) ? 1.0 : 0.0; #else // If no derivatives available (IE 10?), use pixel ratio float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0; #endif vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a)); material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } `,h_e=`uniform sampler2D image; uniform float minimumHeight; uniform float maximumHeight; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0); vec4 rampColor = texture(image, vec2(scaledHeight, 0.5)); rampColor = czm_gammaCorrect(rampColor); material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } `,d_e=`uniform vec4 fadeInColor; uniform vec4 fadeOutColor; uniform float maximumDistance; uniform bool repeat; uniform vec2 fadeDirection; uniform vec2 time; float getTime(float t, float coord) { float scalar = 1.0 / maximumDistance; float q = distance(t, coord) * scalar; if (repeat) { float r = distance(t, coord + 1.0) * scalar; float s = distance(t, coord - 1.0) * scalar; q = min(min(r, s), q); } return clamp(q, 0.0, 1.0); } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float s = getTime(time.x, st.s) * fadeDirection.s; float t = getTime(time.y, st.t) * fadeDirection.t; float u = length(vec2(s, t)); vec4 color = mix(fadeInColor, fadeOutColor, u); color = czm_gammaCorrect(color); material.emission = color.rgb; material.alpha = color.a; return material; } `,f_e=`uniform vec4 color; uniform float cellAlpha; uniform vec2 lineCount; uniform vec2 lineThickness; uniform vec2 lineOffset; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float scaledWidth = fract(lineCount.s * st.s - lineOffset.s); scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5)); float scaledHeight = fract(lineCount.t * st.t - lineOffset.t); scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5)); float value; // Fuzz Factor - Controls blurriness of lines #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) const float fuzz = 1.2; vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0; // From "3D Engine Design for Virtual Globes" by Cozzi and Ring, Listing 4.13. vec2 dx = abs(dFdx(st)); vec2 dy = abs(dFdy(st)); vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount; value = min( smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth), smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight)); #else // If no derivatives available (IE 10?), revert to view-dependent fuzz const float fuzz = 0.05; vec2 range = 0.5 - (lineThickness * 0.05); value = min( 1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth), 1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight)); #endif // Edges taken from RimLightingMaterial.glsl // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC))); float sRim = smoothstep(0.8, 1.0, dRim); value *= (1.0 - sRim); vec4 halfColor; halfColor.rgb = color.rgb * 0.5; halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value)); halfColor = czm_gammaCorrect(halfColor); material.diffuse = halfColor.rgb; material.emission = halfColor.rgb; material.alpha = halfColor.a; return material; } `,p_e=`uniform sampler2D image; uniform float strength; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec4 textureValue = texture(image, fract(repeat * materialInput.st)); vec3 normalTangentSpace = textureValue.channels; normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0; normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0); normalTangentSpace = normalize(normalTangentSpace); vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; material.normal = normalEC; return material; } `,m_e=`uniform vec4 color; float getPointOnLine(vec2 p0, vec2 p1, float x) { float slope = (p0.y - p1.y) / (p0.x - p1.x); return slope * (x - p0.x) + p0.y; } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio; #else // If no derivatives available (IE 10?), 2.5% of the line will be the arrow head float base = 0.975; #endif vec2 center = vec2(1.0, 0.5); float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s); float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s); float halfWidth = 0.15; float s = step(0.5 - halfWidth, st.t); s *= 1.0 - step(0.5 + halfWidth, st.t); s *= 1.0 - step(base, st.s); float t = step(base, materialInput.st.s); t *= 1.0 - step(ptOnUpperLine, st.t); t *= step(ptOnLowerLine, st.t); // Find the distance from the closest separator (region between two colors) float dist; if (st.s < base) { float d1 = abs(st.t - (0.5 - halfWidth)); float d2 = abs(st.t - (0.5 + halfWidth)); dist = min(d1, d2); } else { float d1 = czm_infinity; if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth) { d1 = abs(st.s - base); } float d2 = abs(st.t - ptOnUpperLine); float d3 = abs(st.t - ptOnLowerLine); dist = min(min(d1, d2), d3); } vec4 outsideColor = vec4(0.0); vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0)); vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist); outColor = czm_gammaCorrect(outColor); material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } `,g_e=`uniform vec4 color; uniform vec4 gapColor; uniform float dashLength; uniform float dashPattern; in float v_polylineAngle; const float maskLength = 16.0; mat2 rotate(float rad) { float c = cos(rad); float s = sin(rad); return mat2( c, s, -s, c ); } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy; // Get the relative position within the dash from 0 to 1 float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio)); // Figure out the mask index. float maskIndex = floor(dashPosition * maskLength); // Test the bit mask. float maskTest = floor(dashPattern / pow(2.0, maskIndex)); vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color; if (fragColor.a < 0.005) { // matches 0/255 and 1/255 discard; } fragColor = czm_gammaCorrect(fragColor); material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } `,__e=`uniform vec4 color; uniform float glowPower; uniform float taperPower; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5); if (taperPower <= 0.99999) { glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5)); } vec4 fragColor; fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb); fragColor.a = clamp(0.0, 1.0, glow) * color.a; fragColor = czm_gammaCorrect(fragColor); material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } `,v_e=`uniform vec4 color; uniform vec4 outlineColor; uniform float outlineWidth; in float v_width; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width; float b = step(0.5 - halfInteriorWidth, st.t); b *= 1.0 - step(0.5 + halfInteriorWidth, st.t); // Find the distance from the closest separator (region between two colors) float d1 = abs(st.t - (0.5 - halfInteriorWidth)); float d2 = abs(st.t - (0.5 + halfInteriorWidth)); float dist = min(d1, d2); vec4 currentColor = mix(outlineColor, color, b); vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist); outColor = czm_gammaCorrect(outColor); material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } `,y_e=`uniform vec4 color; uniform vec4 rimColor; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); // See http://www.fundza.com/rman_shaders/surface/fake_rim/fake_rim1.html float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)); float s = smoothstep(1.0 - width, 1.0, d); vec4 outColor = czm_gammaCorrect(color); vec4 outRimColor = czm_gammaCorrect(rimColor); material.diffuse = outColor.rgb; material.emission = outRimColor.rgb * s; material.alpha = mix(outColor.a, outRimColor.a, s); return material; } `,x_e=`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5)); rampColor = czm_gammaCorrect(rampColor); material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } `,C_e=`uniform vec4 evenColor; uniform vec4 oddColor; uniform float offset; uniform float repeat; uniform bool horizontal; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); // Based on the Stripes Fragment Shader in the Orange Book (11.1.2) float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal)); float value = fract((coord - offset) * (repeat * 0.5)); float dist = min(value, min(abs(value - 0.5), 1.0 - value)); vec4 currentColor = mix(evenColor, oddColor, step(0.5, value)); vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist); color = czm_gammaCorrect(color); material.diffuse = color.rgb; material.alpha = color.a; return material; } `,b_e=`// Thanks for the contribution Jonas // http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog uniform sampler2D specularMap; uniform sampler2D normalMap; uniform vec4 baseWaterColor; uniform vec4 blendColor; uniform float frequency; uniform float animationSpeed; uniform float amplitude; uniform float specularIntensity; uniform float fadeFactor; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); float time = czm_frameNumber * animationSpeed; // fade is a function of the distance from the fragment and the frequency of the waves float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); float specularMapValue = texture(specularMap, materialInput.st).r; // note: not using directional motion at this time, just set the angle to 0.0; vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0); vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); // fade out the normal perturbation as we move further from the water surface normalTangentSpace.xy /= fade; // attempt to fade out the normal perturbation as we approach non water areas (low specular map value) normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue); normalTangentSpace = normalize(normalTangentSpace); // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); // fade out water effect as specular map value decreases material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue; // base color is a blend of the water and non-water color based on the value from the specular map // may need a uniform blend factor to better control this material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue); // diffuse highlights are based on how perturbed the normal is material.diffuse += (0.1 * tsPerturbationRatio); material.diffuse = material.diffuse; material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); material.specular = specularIntensity; material.shininess = 10.0; return material; } `;function _n(o){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=Z(o.minificationFilter,Xa.LINEAR),this._magnificationFilter=Z(o.magnificationFilter,Zu.LINEAR),this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,zwt(o,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),N(_n._uniformList[this.type])||(_n._uniformList[this.type]=Object.keys(this._uniforms))}_n._uniformList={};_n.fromType=function(o,f){let m=new _n({fabric:{type:o}});if(N(f))for(let v in f)f.hasOwnProperty(v)&&(m.uniforms[v]=f[v]);return m};_n.prototype.isTranslucent=function(){if(N(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let o=!0,f=this._translucentFunctions,m=f.length;for(let v=0;v-1)return!0;return!1}function Ywt(o){let f=o._template.components,m=o._template.source;if(N(m))o.shaderSource+=`${m} `;else{if(o.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) { `,o.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); `,N(f)){let v=Object.keys(o._template.materials).length>0;for(let y in f)if(f.hasOwnProperty(y))if(y==="diffuse"||y==="emission"){let x=v&&jwt(f[y],o)?f[y]:`czm_gammaCorrect(${f[y]})`;o.shaderSource+=`material.${y} = ${x}; `}else y==="alpha"?o.shaderSource+=`material.alpha = ${f.alpha}; `:o.shaderSource+=`material.${y} = ${f[y]}; `}o.shaderSource+=`return material; } `}}var pNe={mat2:im,mat3:Ut,mat4:Ee},qwt=/\.ktx2$/i,Xwt=/\.dds$/i;function Jwt(o){let f;return function(m,v){let y=m.uniforms,x=y[o],C=f!==x,w=!N(x)||x===_n.DefaultImageId;f=x;let A=m._textures[o],E,T;if(x instanceof HTMLVideoElement){if(x.readyState>=2){if(C&&N(A)&&(A!==v.defaultTexture&&A.destroy(),A=void 0),!N(A)||A===v.defaultTexture){let M=new gs({minificationFilter:m._minificationFilter,magnificationFilter:m._magnificationFilter});A=new _o({context:v,source:x,sampler:M}),m._textures[o]=A;return}A.copyFrom({source:x})}else N(A)||(m._textures[o]=v.defaultTexture);return}if(x instanceof _o&&x!==A){m._texturePaths[o]=void 0;let M=m._textures[o];N(M)&&M!==m._defaultTexture&&M.destroy(),m._textures[o]=x,E=`${o}Dimensions`,y.hasOwnProperty(E)&&(T=y[E],T.x=x._width,T.y=x._height);return}if(C&&N(A)&&w&&(A!==m._defaultTexture&&A.destroy(),A=void 0),N(A)||(m._texturePaths[o]=void 0,A=m._textures[o]=m._defaultTexture,E=`${o}Dimensions`,y.hasOwnProperty(E)&&(T=y[E],T.x=A._width,T.y=A._height)),w)return;let S=x instanceof Jr;if(!N(m._texturePaths[o])||S&&x.url!==m._texturePaths[o].url||!S&&x!==m._texturePaths[o]){if(typeof x=="string"||S){let M=S?x:Jr.createIfNeeded(x),I;qwt.test(M.url)?I=$3(M.url):Xwt.test(M.url)?I=Wie(M):I=M.fetchImage(),Promise.resolve(I).then(function(P){m._loadedImages.push({id:o,image:P})}).catch(function(){N(A)&&A!==m._defaultTexture&&A.destroy(),m._textures[o]=m._defaultTexture})}else(x instanceof HTMLCanvasElement||x instanceof HTMLImageElement)&&m._loadedImages.push({id:o,image:x});m._texturePaths[o]=x}}}function Kwt(o){return function(f,m){let v=f.uniforms[o];if(v instanceof lT){let x=f._textures[o];x!==f._defaultTexture&&x.destroy(),f._texturePaths[o]=void 0,f._textures[o]=v;return}if(N(f._textures[o])||(f._texturePaths[o]=void 0,f._textures[o]=m.defaultCubeMap),v===_n.DefaultCubeMapId)return;let y=v.positiveX+v.negativeX+v.positiveY+v.negativeY+v.positiveZ+v.negativeZ;if(y!==f._texturePaths[o]){let x=[Jr.createIfNeeded(v.positiveX).fetchImage(),Jr.createIfNeeded(v.negativeX).fetchImage(),Jr.createIfNeeded(v.positiveY).fetchImage(),Jr.createIfNeeded(v.negativeY).fetchImage(),Jr.createIfNeeded(v.positiveZ).fetchImage(),Jr.createIfNeeded(v.negativeZ).fetchImage()];Promise.all(x).then(function(C){f._loadedCubeMaps.push({id:o,images:C})}),f._texturePaths[o]=y}}}function Qwt(o){let f=o._template.uniforms;for(let m in f)f.hasOwnProperty(m)&&O9e(o,m)}function O9e(o,f){let m=o._strict,v=o._template.uniforms,y=v[f],x=Zwt(y),C;if(x==="channels")C=CW(o,f,y,!1);else{if(x==="sampler2D"){let A=`${f}Dimensions`;eAt(o,A)>0&&(v[A]={type:"ivec3",x:1,y:1},O9e(o,A))}if(!new RegExp(`uniform\\s+${x}\\s+${f}\\s*;`).test(o.shaderSource)){let A=`uniform ${x} ${f};`;o.shaderSource=A+o.shaderSource}let w=`${f}_${o._count++}`;if(C=CW(o,f,w),o.uniforms[f]=y,x==="sampler2D")o._uniforms[w]=function(){return o._textures[f]},o._updateFunctions.push(Jwt(f));else if(x==="samplerCube")o._uniforms[w]=function(){return o._textures[f]},o._updateFunctions.push(Kwt(f));else if(x.indexOf("mat")!==-1){let A=new pNe[x];o._uniforms[w]=function(){return pNe[x].fromColumnMajorArray(o.uniforms[f],A)}}else o._uniforms[w]=function(){return o.uniforms[f]}}}function Zwt(o){let f=o.type;if(!N(f)){let m=typeof o;if(m==="number")f="float";else if(m==="boolean")f="bool";else if(m==="string"||o instanceof Jr||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(o)?f="channels":o===_n.DefaultCubeMapId?f="samplerCube":f="sampler2D";else if(m==="object")if(Array.isArray(o))(o.length===4||o.length===9||o.length===16)&&(f=`mat${Math.sqrt(o.length)}`);else{let v=0;for(let y in o)o.hasOwnProperty(y)&&(v+=1);v>=2&&v<=4?f=`vec${v}`:v===6&&(f="samplerCube")}}return f}function $wt(o){let f=o._strict,m=o._template.materials;for(let v in m)if(m.hasOwnProperty(v)){let y=new _n({strict:f,fabric:m[v],count:o._count});o._count=y._count,o._uniforms=va(o._uniforms,y._uniforms,!0),o.materials[v]=y,o._translucentFunctions=o._translucentFunctions.concat(y._translucentFunctions);let x="czm_getMaterial",C=`${x}_${o._count++}`;CW(y,x,C),o.shaderSource=y.shaderSource+o.shaderSource;let w=`${C}(materialInput)`,A=CW(o,v,w)}}function CW(o,f,m,v){v=Z(v,!0);let y=0,x="([\\w])?",C=`([\\w${v?".":""}])?`,w=new RegExp(C+f+x,"g");return o.shaderSource=o.shaderSource.replace(w,function(A,E,T){return E||T?A:(y+=1,m)}),y}function eAt(o,f,m){return CW(o,f,f,m)}_n._materialCache={_materials:{},addMaterial:function(o,f){this._materials[o]=f},getMaterial:function(o){return this._materials[o]}};_n.DefaultImageId="czm_defaultImage";_n.DefaultCubeMapId="czm_defaultCubeMap";_n.ColorType="Color";_n._materialCache.addMaterial(_n.ColorType,{fabric:{type:_n.ColorType,uniforms:{color:new Re(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(o){return o.uniforms.color.alpha<1}});_n.PolylineTrailLinkType="PolylineTrailLink";_n.PolylineTrailLinkSource=`uniform float time; uniform sampler2D image; uniform float repeat; uniform vec4 color; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float aa = st.s*st.t; vec4 colorImage = color*aa+(1.0-aa)*texture(image, vec2(fract(st.s-time*repeat), st.t)); material.alpha = colorImage.a; material.diffuse = colorImage.rgb; return material; }`;_n._materialCache.addMaterial(_n.PolylineTrailLinkType,{fabric:{type:_n.PolylineTrailLinkType,uniforms:{color:new Re(1,0,0,.5),image:_n.DefaultImageId,repeat:1,time:0},source:_n.PolylineTrailLinkSource},translucent:function(o){return!0}});_n.ModelColorType="ModelColor";_n._materialCache.addMaterial(_n.ModelColorType,{fabric:{type:_n.ModelColorType,uniforms:{color:new Re(0,0,1,1),image:_n.DefaultImageId,minimumHeight:0,maximumHeight:100},source:`uniform vec4 color;\r uniform sampler2D image;\r uniform float minimumHeight;\r uniform float maximumHeight;\r czm_material czm_getMaterial(czm_materialInput materialInput)\r {\r czm_material material = czm_getDefaultMaterial(materialInput);\r vec2 st = materialInput.st;\r float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);\r vec4 halfColor = texture(image, vec2(0.5,scaledHeight));\r halfColor *= 0.6;\r material.diffuse = halfColor.rgb;\r material.emission = halfColor.rgb;\r material.alpha = color.a;\r return material;\r }`},translucent:!1});_n.ImageType="Image";_n._materialCache.addMaterial(_n.ImageType,{fabric:{type:_n.ImageType,uniforms:{image:_n.DefaultImageId,repeat:new Ye(1,1),color:new Re(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(o){return o.uniforms.color.alpha<1}});_n.DiffuseMapType="DiffuseMap";_n._materialCache.addMaterial(_n.DiffuseMapType,{fabric:{type:_n.DiffuseMapType,uniforms:{image:_n.DefaultImageId,channels:"rgb",repeat:new Ye(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});_n.AlphaMapType="AlphaMap";_n._materialCache.addMaterial(_n.AlphaMapType,{fabric:{type:_n.AlphaMapType,uniforms:{image:_n.DefaultImageId,channel:"a",repeat:new Ye(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});_n.SpecularMapType="SpecularMap";_n._materialCache.addMaterial(_n.SpecularMapType,{fabric:{type:_n.SpecularMapType,uniforms:{image:_n.DefaultImageId,channel:"r",repeat:new Ye(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});_n.EmissionMapType="EmissionMap";_n._materialCache.addMaterial(_n.EmissionMapType,{fabric:{type:_n.EmissionMapType,uniforms:{image:_n.DefaultImageId,channels:"rgb",repeat:new Ye(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});_n.BumpMapType="BumpMap";_n._materialCache.addMaterial(_n.BumpMapType,{fabric:{type:_n.BumpMapType,uniforms:{image:_n.DefaultImageId,channel:"r",strength:.8,repeat:new Ye(1,1)},source:a_e},translucent:!1});_n.NormalMapType="NormalMap";_n._materialCache.addMaterial(_n.NormalMapType,{fabric:{type:_n.NormalMapType,uniforms:{image:_n.DefaultImageId,channels:"rgb",strength:.8,repeat:new Ye(1,1)},source:p_e},translucent:!1});_n.GridType="Grid";_n._materialCache.addMaterial(_n.GridType,{fabric:{type:_n.GridType,uniforms:{color:new Re(0,1,0,1),cellAlpha:.1,lineCount:new Ye(8,8),lineThickness:new Ye(1,1),lineOffset:new Ye(0,0)},source:f_e},translucent:function(o){let f=o.uniforms;return f.color.alpha<1||f.cellAlpha<1}});_n.StripeType="Stripe";_n._materialCache.addMaterial(_n.StripeType,{fabric:{type:_n.StripeType,uniforms:{horizontal:!0,evenColor:new Re(1,1,1,.5),oddColor:new Re(0,0,1,.5),offset:0,repeat:5},source:C_e},translucent:function(o){let f=o.uniforms;return f.evenColor.alpha<1||f.oddColor.alpha<1}});_n.CheckerboardType="Checkerboard";_n._materialCache.addMaterial(_n.CheckerboardType,{fabric:{type:_n.CheckerboardType,uniforms:{lightColor:new Re(1,1,1,.5),darkColor:new Re(0,0,0,.5),repeat:new Ye(5,5)},source:s_e},translucent:function(o){let f=o.uniforms;return f.lightColor.alpha<1||f.darkColor.alpha<1}});_n.DotType="Dot";_n._materialCache.addMaterial(_n.DotType,{fabric:{type:_n.DotType,uniforms:{lightColor:new Re(1,1,0,.75),darkColor:new Re(0,1,1,.75),repeat:new Ye(5,5)},source:l_e},translucent:function(o){let f=o.uniforms;return f.lightColor.alpha<1||f.darkColor.alpha<1}});_n.WaterType="Water";_n._materialCache.addMaterial(_n.WaterType,{fabric:{type:_n.WaterType,uniforms:{baseWaterColor:new Re(.2,.3,.6,1),blendColor:new Re(0,1,.699,1),specularMap:_n.DefaultImageId,normalMap:_n.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:b_e},translucent:function(o){let f=o.uniforms;return f.baseWaterColor.alpha<1||f.blendColor.alpha<1}});_n.RimLightingType="RimLighting";_n._materialCache.addMaterial(_n.RimLightingType,{fabric:{type:_n.RimLightingType,uniforms:{color:new Re(1,0,0,.7),rimColor:new Re(1,1,1,.4),width:.3},source:y_e},translucent:function(o){let f=o.uniforms;return f.color.alpha<1||f.rimColor.alpha<1}});_n.FadeType="Fade";_n._materialCache.addMaterial(_n.FadeType,{fabric:{type:_n.FadeType,uniforms:{fadeInColor:new Re(1,0,0,1),fadeOutColor:new Re(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new Ye(.5,.5)},source:d_e},translucent:function(o){let f=o.uniforms;return f.fadeInColor.alpha<1||f.fadeOutColor.alpha<1}});_n.PolylineArrowType="PolylineArrow";_n._materialCache.addMaterial(_n.PolylineArrowType,{fabric:{type:_n.PolylineArrowType,uniforms:{color:new Re(1,1,1,1)},source:m_e},translucent:!0});_n.PolylineDashType="PolylineDash";_n._materialCache.addMaterial(_n.PolylineDashType,{fabric:{type:_n.PolylineDashType,uniforms:{color:new Re(1,0,1,1),gapColor:new Re(0,0,0,0),dashLength:16,dashPattern:255},source:g_e},translucent:!0});_n.PolylineGlowType="PolylineGlow";_n._materialCache.addMaterial(_n.PolylineGlowType,{fabric:{type:_n.PolylineGlowType,uniforms:{color:new Re(0,.5,1,1),glowPower:.25,taperPower:1},source:__e},translucent:!0});_n.PolylineOutlineType="PolylineOutline";_n._materialCache.addMaterial(_n.PolylineOutlineType,{fabric:{type:_n.PolylineOutlineType,uniforms:{color:new Re(1,1,1,1),outlineColor:new Re(1,0,0,1),outlineWidth:1},source:v_e},translucent:function(o){let f=o.uniforms;return f.color.alpha<1||f.outlineColor.alpha<1}});_n.ElevationContourType="ElevationContour";_n._materialCache.addMaterial(_n.ElevationContourType,{fabric:{type:_n.ElevationContourType,uniforms:{spacing:100,color:new Re(1,0,0,1),width:1},source:c_e},translucent:!1});_n.ElevationRampType="ElevationRamp";_n._materialCache.addMaterial(_n.ElevationRampType,{fabric:{type:_n.ElevationRampType,uniforms:{image:_n.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:h_e},translucent:!1});_n.SlopeRampMaterialType="SlopeRamp";_n._materialCache.addMaterial(_n.SlopeRampMaterialType,{fabric:{type:_n.SlopeRampMaterialType,uniforms:{image:_n.DefaultImageId},source:x_e},translucent:!1});_n.AspectRampMaterialType="AspectRamp";_n._materialCache.addMaterial(_n.AspectRampMaterialType,{fabric:{type:_n.AspectRampMaterialType,uniforms:{image:_n.DefaultImageId},source:o_e},translucent:!1});_n.ElevationBandType="ElevationBand";_n._materialCache.addMaterial(_n.ElevationBandType,{fabric:{type:_n.ElevationBandType,uniforms:{heights:_n.DefaultImageId,colors:_n.DefaultImageId},source:u_e},translucent:!0});var zo=_n;function qE(){li.throwInstantiationError()}Object.defineProperties(qE.prototype,{isConstant:{get:li.throwInstantiationError},definitionChanged:{get:li.throwInstantiationError}});qE.prototype.getValue=li.throwInstantiationError;qE.prototype.equals=li.throwInstantiationError;qE.equals=function(o,f){return o===f||N(o)&&o.equals(f)};qE.arrayEquals=function(o,f){if(o===f)return!0;if(!N(o)||!N(f)||o.length!==f.length)return!1;let m=o.length;for(let v=0;v1&&(this.gradient=1),this._time=performance.now()}Object.defineProperties(uH.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:Oi("color")});uH.prototype.getType=function(o){return zo.CircleWaveMaterialType};uH.prototype.getValue=function(o,f){return N(f)||(f={}),f.color=vt.getValueOrClonedDefault(this._color,o,Re.WHITE,f.color),f.time=(performance.now()-this._time)/this.duration,f.count=this.count,f.gradient=1+10*(1-this.gradient),f};uH.prototype.equals=function(o){return this===o||o instanceof uH&&vt.equals(this._color,o._color)};zo.CircleWaveMaterialType="CircleWaveMaterial";zo.PolylineTrailSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = 1.5*color.rgb; vec2 st = materialInput.st; vec3 str = materialInput.str; float dis = distance(st, vec2(0.5, 0.5)); float per = fract(time); if (abs(str.z) > 0.01) { discard; } if ( dis > 0.5 ) { discard; } else { float perDis = 0.5 / count; float disNum; float bl = .0; for(int i=0;i<=999;i++){ if(float(i)<=count){ disNum = perDis*float(i)-dis + per/count; if(disNum > 0.0) { if(disNum < perDis){ bl=1.0-disNum/perDis; } else if(disNum-perDis < perDis){ bl = 1.0 - abs(1.0-disNum/perDis); } material.alpha = pow(bl, gradient); } } } } return material; } `;zo._materialCache.addMaterial(zo.CircleWaveMaterialType,{fabric:{type:zo.CircleWaveMaterialType,uniforms:{color:new Re(1,0,0,1),time:1,count:1,gradient:.1},source:zo.PolylineTrailSource},translucent:function(o){return!0}});var mU=uH,tAt=new H,iAt=new H;function rAt(o,f,m,v,y){let x=o.x,C=o.y,w=o.z,A=f.x,E=f.y,T=f.z,S=x*x*A*A,M=C*C*E*E,I=w*w*T*T,P=S+M+I,D=Math.sqrt(1/P),L=H.multiplyByScalar(o,D,tAt);if(Pxe.EPSILON12);return N(y)?(y.x=x*J,y.y=C*X,y.z=w*Y,y):new H(x*J,C*X,w*Y)}var Yie=rAt;function Am(o,f,m){this.longitude=Z(o,0),this.latitude=Z(f,0),this.height=Z(m,0)}Am.fromRadians=function(o,f,m,v){return m=Z(m,0),N(v)?(v.longitude=o,v.latitude=f,v.height=m,v):new Am(o,f,m)};Am.fromDegrees=function(o,f,m,v){return o=xe.toRadians(o),f=xe.toRadians(f),Am.fromRadians(o,f,m,v)};var nAt=new H,oAt=new H,aAt=new H,sAt=new H(1/6378137,1/6378137,1/6356752314245179e-9),lAt=new H(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9)),uAt=new H(1/1737400,1/1737400,1/1737400),cAt=new H(1/(1737400*1737400),1/(1737400*1737400),1/(1737400*1737400)),hAt=new H(1/6378137,1/6378137,1/6356752314140356e-9),dAt=new H(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314140356e-9*6356752314140356e-9)),fAt=xe.EPSILON1;Am.fromCartesian=function(o,f,m){let v=null,y=null,x=N(f)?f._centerToleranceSquared:fAt;Hy.ellipsoidCoordinates==="CGCS2000"?(v=hAt,y=dAt):Hy.ellipsoidCoordinates==="MOON"||Hy.ellipsoidCoordinates==="MOON2000"?(v=uAt,y=cAt):(v=N(f)?f.oneOverRadii:sAt,y=N(f)?f.oneOverRadiiSquared:lAt);let C=Yie(o,v,y,x,oAt);if(!N(C))return;let w=H.multiplyComponents(C,y,nAt);w=H.normalize(w,w);let A=H.subtract(o,C,aAt),E=Math.atan2(w.y,w.x),T=Math.asin(w.z),S=xe.sign(H.dot(A,o))*H.magnitude(A);return N(m)?(m.longitude=E,m.latitude=T,m.height=S,m):new Am(E,T,S)};Am.toCartesian=function(o,f,m){return H.fromRadians(o.longitude,o.latitude,o.height,f,m)};Am.clone=function(o,f){if(N(o))return N(f)?(f.longitude=o.longitude,f.latitude=o.latitude,f.height=o.height,f):new Am(o.longitude,o.latitude,o.height)};Am.equals=function(o,f){return o===f||N(o)&&N(f)&&o.longitude===f.longitude&&o.latitude===f.latitude&&o.height===f.height};Am.equalsEpsilon=function(o,f,m){return m=Z(m,0),o===f||N(o)&&N(f)&&Math.abs(o.longitude-f.longitude)<=m&&Math.abs(o.latitude-f.latitude)<=m&&Math.abs(o.height-f.height)<=m};Am.ZERO=Object.freeze(new Am(0,0,0));Am.prototype.clone=function(o){return Am.clone(this,o)};Am.prototype.equals=function(o){return Am.equals(this,o)};Am.prototype.equalsEpsilon=function(o,f){return Am.equalsEpsilon(this,o,f)};Am.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var Mt=Am;function N9e(o,f,m,v){f=Z(f,0),m=Z(m,0),v=Z(v,0),o._radii=new H(f,m,v),o._radiiSquared=new H(f*f,m*m,v*v),o._radiiToTheFourth=new H(f*f*f*f,m*m*m*m,v*v*v*v),o._oneOverRadii=new H(f===0?0:1/f,m===0?0:1/m,v===0?0:1/v),o._oneOverRadiiSquared=new H(f===0?0:1/(f*f),m===0?0:1/(m*m),v===0?0:1/(v*v)),o._minimumRadius=Math.min(f,m,v),o._maximumRadius=Math.max(f,m,v),o._centerToleranceSquared=xe.EPSILON1,o._radiiSquared.z!==0&&(o._squaredXOverSquaredZ=o._radiiSquared.x/o._radiiSquared.z)}function hc(o,f,m){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,N9e(this,o,f,m)}Object.defineProperties(hc.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});hc.clone=function(o,f){if(!N(o))return;let m=o._radii;return N(f)?(H.clone(m,f._radii),H.clone(o._radiiSquared,f._radiiSquared),H.clone(o._radiiToTheFourth,f._radiiToTheFourth),H.clone(o._oneOverRadii,f._oneOverRadii),H.clone(o._oneOverRadiiSquared,f._oneOverRadiiSquared),f._minimumRadius=o._minimumRadius,f._maximumRadius=o._maximumRadius,f._centerToleranceSquared=o._centerToleranceSquared,f):new hc(m.x,m.y,m.z)};hc.fromCartesian3=function(o,f){return N(f)||(f=new hc),N(o)&&N9e(f,o.x,o.y,o.z),f};hc.WGS84=Object.freeze(new hc(6378137,6378137,6356752314245179e-9));hc.CGCS2000=Object.freeze(new hc(6378137,6378137,6356752314140356e-9));hc.MOON2000=Object.freeze(new hc(1737400,1737400,1737400));hc.UNIT_SPHERE=Object.freeze(new hc(1,1,1));hc.MOON=Object.freeze(new hc(xe.LUNAR_RADIUS,xe.LUNAR_RADIUS,xe.LUNAR_RADIUS));hc.prototype.clone=function(o){return hc.clone(this,o)};hc.packedLength=H.packedLength;hc.pack=function(o,f,m){return m=Z(m,0),H.pack(o._radii,f,m),f};hc.unpack=function(o,f,m){f=Z(f,0);let v=H.unpack(o,f);return hc.fromCartesian3(v,m)};hc.prototype.geocentricSurfaceNormal=H.normalize;hc.prototype.geodeticSurfaceNormalCartographic=function(o,f){let m=o.longitude,v=o.latitude,y=Math.cos(v),x=y*Math.cos(m),C=y*Math.sin(m),w=Math.sin(v);return N(f)||(f=new H),f.x=x,f.y=C,f.z=w,H.normalize(f,f)};hc.prototype.geodeticSurfaceNormal=function(o,f){if(!H.equalsEpsilon(o,H.ZERO,xe.EPSILON14))return N(f)||(f=new H),f=H.multiplyComponents(o,this._oneOverRadiiSquared,f),H.normalize(f,f)};var pAt=new H,mAt=new H;hc.prototype.cartographicToCartesian=function(o,f){let m=pAt,v=mAt;this.geodeticSurfaceNormalCartographic(o,m),H.multiplyComponents(this._radiiSquared,m,v);let y=Math.sqrt(H.dot(m,v));return H.divideByScalar(v,y,v),H.multiplyByScalar(m,o.height,m),N(f)||(f=new H),H.add(v,m,f)};hc.prototype.cartographicArrayToCartesianArray=function(o,f){let m=o.length;N(f)?f.length=m:f=new Array(m);for(let v=0;v=this._radii.z-f))return m};var yAt=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],xAt=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function mNe(o,f,m){let v=.5*(f+o),y=.5*(f-o),x=0;for(let C=0;C<5;C++){let w=y*yAt[C];x+=xAt[C]*(m(v+w)+m(v-w))}return x*=y,x}hc.prototype.surfaceArea=function(o){let f=o.west,m=o.east,v=o.south,y=o.north;for(;m=0?T.longitude:T.longitude+xe.TWO_PI;y=Math.min(y,S),x=Math.max(x,S)}return v-m>x-y&&(m=y,v=x,v>xe.PI&&(v=v-xe.TWO_PI),m>xe.PI&&(m=m-xe.TWO_PI)),N(f)?(f.west=m,f.south=C,f.east=v,f.north=w,f):new ul(m,C,v,w)};ul.fromCartesianArray=function(o,f,m){f=Z(f,ki.WGS84);let v=Number.MAX_VALUE,y=-Number.MAX_VALUE,x=Number.MAX_VALUE,C=-Number.MAX_VALUE,w=Number.MAX_VALUE,A=-Number.MAX_VALUE;for(let E=0,T=o.length;E=0?S.longitude:S.longitude+xe.TWO_PI;x=Math.min(x,M),C=Math.max(C,M)}return y-v>C-x&&(v=x,y=C,y>xe.PI&&(y=y-xe.TWO_PI),v>xe.PI&&(v=v-xe.TWO_PI)),N(m)?(m.west=v,m.south=w,m.east=y,m.north=A,m):new ul(v,w,y,A)};ul.clone=function(o,f){if(N(o))return N(f)?(f.west=o.west,f.south=o.south,f.east=o.east,f.north=o.north,f):new ul(o.west,o.south,o.east,o.north)};ul.equalsEpsilon=function(o,f,m){return m=Z(m,0),o===f||N(o)&&N(f)&&Math.abs(o.west-f.west)<=m&&Math.abs(o.south-f.south)<=m&&Math.abs(o.east-f.east)<=m&&Math.abs(o.north-f.north)<=m};ul.prototype.clone=function(o){return ul.clone(this,o)};ul.prototype.equals=function(o){return ul.equals(this,o)};ul.equals=function(o,f){return o===f||N(o)&&N(f)&&o.west===f.west&&o.south===f.south&&o.east===f.east&&o.north===f.north};ul.prototype.equalsEpsilon=function(o,f){return ul.equalsEpsilon(this,o,f)};ul.validate=function(o){};ul.southwest=function(o,f){return N(f)?(f.longitude=o.west,f.latitude=o.south,f.height=0,f):new Mt(o.west,o.south)};ul.northwest=function(o,f){return N(f)?(f.longitude=o.west,f.latitude=o.north,f.height=0,f):new Mt(o.west,o.north)};ul.northeast=function(o,f){return N(f)?(f.longitude=o.east,f.latitude=o.north,f.height=0,f):new Mt(o.east,o.north)};ul.southeast=function(o,f){return N(f)?(f.longitude=o.east,f.latitude=o.south,f.height=0,f):new Mt(o.east,o.south)};ul.center=function(o,f){let m=o.east,v=o.west;m0?v+=xe.TWO_PI:x0&&(x+=xe.TWO_PI),v=T))return N(m)?(m.west=w,m.south=E,m.east=A,m.north=T,m):new ul(w,E,A,T)};ul.simpleIntersection=function(o,f,m){let v=Math.max(o.west,f.west),y=Math.max(o.south,f.south),x=Math.min(o.east,f.east),C=Math.min(o.north,f.north);if(!(y>=C||v>=x))return N(m)?(m.west=v,m.south=y,m.east=x,m.north=C,m):new ul(v,y,x,C)};ul.union=function(o,f,m){N(m)||(m=new ul);let v=o.east,y=o.west,x=f.east,C=f.west;v0?v+=xe.TWO_PI:x0&&(x+=xe.TWO_PI),vy||xe.equalsEpsilon(m,y,xe.EPSILON14))&&(m=o.south&&v<=o.north};var bAt=new Mt;ul.subsample=function(o,f,m,v){f=Z(f,ki.WGS84),m=Z(m,0),N(v)||(v=[]);let y=0,x=o.north,C=o.south,w=o.east,A=o.west,E=bAt;E.height=m,E.longitude=A,E.latitude=x,v[y]=f.cartographicToCartesian(E,v[y]),y++,E.longitude=w,v[y]=f.cartographicToCartesian(E,v[y]),y++,E.latitude=C,v[y]=f.cartographicToCartesian(E,v[y]),y++,E.longitude=A,v[y]=f.cartographicToCartesian(E,v[y]),y++,x<0?E.latitude=x:C>0?E.latitude=C:E.latitude=0;for(let T=1;T<8;++T)E.longitude=-Math.PI+T*xe.PI_OVER_TWO,ul.contains(o,E)&&(v[y]=f.cartographicToCartesian(E,v[y]),y++);return E.latitude===0&&(E.longitude=A,v[y]=f.cartographicToCartesian(E,v[y]),y++,E.longitude=w,v[y]=f.cartographicToCartesian(E,v[y]),y++),v.length=y,v};ul.subsection=function(o,f,m,v,y,x){if(N(x)||(x=new ul),o.west<=o.east){let w=o.east-o.west;x.west=o.west+f*w,x.east=o.west+v*w}else{let w=xe.TWO_PI+o.east-o.west;x.west=xe.negativePiToPi(o.west+f*w),x.east=xe.negativePiToPi(o.west+v*w)}let C=o.north-o.south;return x.south=o.south+m*C,x.north=o.south+y*C,f===1&&(x.west=o.east),v===1&&(x.east=o.east),m===1&&(x.south=o.north),y===1&&(x.north=o.north),x};ul.MAX_VALUE=Object.freeze(new ul(-Math.PI,-xe.PI_OVER_TWO,Math.PI,xe.PI_OVER_TWO));var Di=ul;function Ep(o,f,m,v){this.x=Z(o,0),this.y=Z(f,0),this.width=Z(m,0),this.height=Z(v,0)}Ep.packedLength=4;Ep.pack=function(o,f,m){return m=Z(m,0),f[m++]=o.x,f[m++]=o.y,f[m++]=o.width,f[m]=o.height,f};Ep.unpack=function(o,f,m){return f=Z(f,0),N(m)||(m=new Ep),m.x=o[f++],m.y=o[f++],m.width=o[f++],m.height=o[f],m};Ep.fromPoints=function(o,f){if(N(f)||(f=new Ep),!N(o)||o.length===0)return f.x=0,f.y=0,f.width=0,f.height=0,f;let m=o.length,v=o[0].x,y=o[0].y,x=o[0].x,C=o[0].y;for(let w=1;wm.width?m.width=v:v<0&&(m.width-=v,m.x=f.x),y>m.height?m.height=y:y<0&&(m.height-=y,m.y=f.y),m};Ep.intersect=function(o,f){let m=o.x,v=o.y,y=f.x,x=f.y;return m>y+f.width||m+o.widthx+f.height?La.OUTSIDE:La.INTERSECTING};Ep.equals=function(o,f){return o===f||N(o)&&N(f)&&o.x===f.x&&o.y===f.y&&o.width===f.width&&o.height===f.height};Ep.prototype.clone=function(o){return Ep.clone(this,o)};Ep.prototype.intersect=function(o){return Ep.intersect(this,o)};Ep.prototype.equals=function(o){return Ep.equals(this,o)};var Xr=Ep;function TAt(o,f){this.start=Z(o,0),this.stop=Z(f,0)}var t2=TAt;function ss(o,f){this.center=H.clone(Z(o,H.ZERO)),this.radius=Z(f,0)}var w_e=new H,A_e=new H,E_e=new H,T_e=new H,S_e=new H,P_e=new H,I_e=new H,I0=new H,M_e=new H,D_e=new H,L_e=new H,R_e=new H,SAt=4/3*xe.PI;ss.fromPoints=function(o,f){if(N(f)||(f=new ss),!N(o)||o.length===0)return f.center=H.clone(H.ZERO,f.center),f.radius=0,f;let m=H.clone(o[0],I_e),v=H.clone(m,w_e),y=H.clone(m,A_e),x=H.clone(m,E_e),C=H.clone(m,T_e),w=H.clone(m,S_e),A=H.clone(m,P_e),E=o.length,T;for(T=1;TC.x&&H.clone(m,C),Jw.y&&H.clone(m,w),XA.z&&H.clone(m,A)}let S=H.magnitudeSquared(H.subtract(C,v,I0)),M=H.magnitudeSquared(H.subtract(w,y,I0)),I=H.magnitudeSquared(H.subtract(A,x,I0)),P=v,D=C,L=S;M>L&&(L=M,P=y,D=w),I>L&&(L=I,P=x,D=A);let R=M_e;R.x=(P.x+D.x)*.5,R.y=(P.y+D.y)*.5,R.z=(P.z+D.z)*.5;let O=H.magnitudeSquared(H.subtract(D,R,I0)),F=Math.sqrt(O),k=D_e;k.x=v.x,k.y=y.y,k.z=x.z;let U=L_e;U.x=C.x,U.y=w.y,U.z=A.z;let G=H.midpoint(k,U,R_e),j=0;for(T=0;Tj&&(j=q);let J=H.magnitudeSquared(H.subtract(m,R,I0));if(J>O){let X=Math.sqrt(J);F=(F+X)*.5,O=F*F;let Y=X-F;R.x=(F*R.x+Y*m.x)/X,R.y=(F*R.y+Y*m.y)/X,R.z=(F*R.z+Y*m.z)/X}}return FA.x&&H.clone(y,A),YE.y&&H.clone(y,E),QT.z&&H.clone(y,T)}let I=H.magnitudeSquared(H.subtract(A,x,I0)),P=H.magnitudeSquared(H.subtract(E,C,I0)),D=H.magnitudeSquared(H.subtract(T,w,I0)),L=x,R=A,O=I;P>O&&(O=P,L=C,R=E),D>O&&(O=D,L=w,R=T);let F=M_e;F.x=(L.x+R.x)*.5,F.y=(L.y+R.y)*.5,F.z=(L.z+R.z)*.5;let k=H.magnitudeSquared(H.subtract(R,F,I0)),U=Math.sqrt(k),G=D_e;G.x=x.x,G.y=C.y,G.z=w.z;let j=L_e;j.x=A.x,j.y=E.y,j.z=T.z;let q=H.midpoint(G,j,R_e),J=0;for(M=0;MJ&&(J=X);let Y=H.magnitudeSquared(H.subtract(y,F,I0));if(Y>k){let Q=Math.sqrt(Y);U=(U+Q)*.5,k=U*U;let ee=Q-U;F.x=(U*F.x+ee*y.x)/Q,F.y=(U*F.y+ee*y.y)/Q,F.z=(U*F.z+ee*y.z)/Q}}return Uw.x&&H.clone(v,w),XA.y&&H.clone(v,A),YE.z&&H.clone(v,E)}let M=H.magnitudeSquared(H.subtract(w,y,I0)),I=H.magnitudeSquared(H.subtract(A,x,I0)),P=H.magnitudeSquared(H.subtract(E,C,I0)),D=y,L=w,R=M;I>R&&(R=I,D=x,L=A),P>R&&(R=P,D=C,L=E);let O=M_e;O.x=(D.x+L.x)*.5,O.y=(D.y+L.y)*.5,O.z=(D.z+L.z)*.5;let F=H.magnitudeSquared(H.subtract(L,O,I0)),k=Math.sqrt(F),U=D_e;U.x=y.x,U.y=x.y,U.z=C.z;let G=L_e;G.x=w.x,G.y=A.y,G.z=E.z;let j=H.midpoint(U,G,R_e),q=0;for(S=0;Sq&&(q=J);let X=H.magnitudeSquared(H.subtract(v,O,I0));if(X>F){let Y=Math.sqrt(X);k=(k+Y)*.5,F=k*k;let Q=Y-k;O.x=(k*O.x+Q*v.x)/Y,O.y=(k*O.y+Q*v.y)/Y,O.z=(k*O.z+Q*v.z)/Y}}return k=A+C)return o.clone(m),m;if(C>=A+y)return f.clone(m),m;let E=(y+A+C)*.5,T=H.multiplyByScalar(w,(-y+E)/A,VAt);return H.add(T,v,T),H.clone(T,m.center),m.radius=E,m};var zAt=new H;ss.expand=function(o,f,m){m=ss.clone(o,m);let v=H.magnitude(H.subtract(f,m.center,zAt));return v>m.radius&&(m.radius=v),m};ss.intersectPlane=function(o,f){let m=o.center,v=o.radius,y=f.normal,x=H.dot(y,m)+f.distance;return x<-v?La.OUTSIDE:x-f?(y=JAt,y.x=this._cameraPosition.x/(m.radii.x+f),y.y=this._cameraPosition.y/(m.radii.y+f),y.z=this._cameraPosition.z/(m.radii.z+f),v=y.x*y.x+y.y*y.y+y.z*y.z-1):(y=this._cameraPositionInScaledSpace,v=this._distanceToLimbInScaledSpaceSquared),O_e(o,y,v)};H2.prototype.computeHorizonCullingPoint=function(o,f,m){return z9e(this._ellipsoid,o,f,m)};var k9e=ki.clone(ki.UNIT_SPHERE);H2.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(o,f,m,v){let y=V9e(this._ellipsoid,m,k9e);return z9e(y,o,f,v)};H2.prototype.computeHorizonCullingPointFromVertices=function(o,f,m,v,y){return H9e(this._ellipsoid,o,f,m,v,y)};H2.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(o,f,m,v,y,x){let C=V9e(this._ellipsoid,y,k9e);return H9e(C,o,f,m,v,x)};var KAt=[];H2.prototype.computeHorizonCullingPointFromRectangle=function(o,f,m){let v=Di.subsample(o,f,0,KAt),y=Pi.fromPoints(v);if(!(H.magnitude(y.center)<.1*f.minimumRadius))return this.computeHorizonCullingPoint(y.center,v,m)};var QAt=new H;function V9e(o,f,m){if(N(f)&&f<0&&o.minimumRadius>-f){let v=H.fromElements(o.radii.x+f,o.radii.y+f,o.radii.z+f,QAt);o=ki.fromCartesian3(v,m)}return o}function z9e(o,f,m,v){N(v)||(v=new H);let y=W9e(o,f),x=0;for(let C=0,w=m.length;C0:C>y&&C*C/H.magnitudeSquared(x)>y)}var ZAt=new H,$At=new H;function U9e(o,f,m){let v=o.transformPositionToScaledSpace(f,ZAt),y=H.magnitudeSquared(v),x=Math.sqrt(y),C=H.divideByScalar(v,x,$At);y=Math.max(1,y),x=Math.max(1,x);let w=H.dot(C,m),A=H.magnitude(H.cross(C,m,C)),E=1/x,T=Math.sqrt(y-1)*E;return 1/(w*E-A*T)}function G9e(o,f,m){if(!(f<=0||f===1/0||f!==f))return H.multiplyByScalar(o,f,m)}var Uce=new H;function W9e(o,f){return H.equals(f,H.ZERO)?f:(o.transformPositionToScaledSpace(f,Uce),H.normalize(Uce,Uce))}var pB=H2;function J1(o,f){o=Z(o,0),this._near=o,f=Z(f,Number.MAX_VALUE),this._far=f}Object.defineProperties(J1.prototype,{near:{get:function(){return this._near},set:function(o){this._near=o}},far:{get:function(){return this._far},set:function(o){this._far=o}}});J1.packedLength=2;J1.pack=function(o,f,m){return m=Z(m,0),f[m++]=o.near,f[m]=o.far,f};J1.unpack=function(o,f,m){return f=Z(f,0),N(m)||(m=new J1),m.near=o[f++],m.far=o[f],m};J1.equals=function(o,f){return o===f||N(o)&&N(f)&&o.near===f.near&&o.far===f.far};J1.clone=function(o,f){if(N(o))return N(f)||(f=new J1),f.near=o.near,f.far=o.far,f};J1.prototype.clone=function(o){return J1.clone(this,o)};J1.prototype.equals=function(o){return J1.equals(this,o)};var ia=J1;function Ow(o,f,m,v){this.near=Z(o,0),this.nearValue=Z(f,0),this.far=Z(m,1),this.farValue=Z(v,0)}Ow.clone=function(o,f){if(N(o))return N(f)?(f.near=o.near,f.nearValue=o.nearValue,f.far=o.far,f.farValue=o.farValue,f):new Ow(o.near,o.nearValue,o.far,o.farValue)};Ow.packedLength=4;Ow.pack=function(o,f,m){return m=Z(m,0),f[m++]=o.near,f[m++]=o.nearValue,f[m++]=o.far,f[m]=o.farValue,f};Ow.unpack=function(o,f,m){return f=Z(f,0),N(m)||(m=new Ow),m.near=o[f++],m.nearValue=o[f++],m.far=o[f++],m.farValue=o[f],m};Ow.equals=function(o,f){return o===f||N(o)&&N(f)&&o.near===f.near&&o.nearValue===f.nearValue&&o.far===f.far&&o.farValue===f.farValue};Ow.prototype.clone=function(o){return Ow.clone(this,o)};Ow.prototype.equals=function(o){return Ow.equals(this,o)};var sa=Ow,eEt={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2},qn=Object.freeze(eEt),tEt={CENTER:0,LEFT:1,RIGHT:-1},Zc=Object.freeze(tEt),E$={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};E$.getMorphTime=function(o){return o===E$.SCENE3D?1:o===E$.MORPHING?void 0:0};var _i=Object.freeze(E$);function Gg(o,f){this.normal=H.clone(o),this.distance=f}Gg.fromPointNormal=function(o,f,m){let v=-H.dot(f,o);return N(m)?(H.clone(f,m.normal),m.distance=v,m):new Gg(f,v)};var iEt=new H;Gg.fromCartesian4=function(o,f){let m=H.fromCartesian4(o,iEt),v=o.w;return N(f)?(H.clone(m,f.normal),f.distance=v,f):new Gg(m,v)};Gg.getPointDistance=function(o,f){return H.dot(o.normal,f)+o.distance};var rEt=new H;Gg.projectPointOntoPlane=function(o,f,m){N(m)||(m=new H);let v=Gg.getPointDistance(o,f),y=H.multiplyByScalar(o.normal,v,rEt);return H.subtract(f,y,m)};var nEt=new Ee,oEt=new Wt,aEt=new H;Gg.transform=function(o,f,m){let v=o.normal,y=o.distance,x=Ee.inverseTranspose(f,nEt),C=Wt.fromElements(v.x,v.y,v.z,y,oEt);C=Ee.multiplyByVector(x,C,C);let w=H.fromCartesian4(C,aEt);return C=Wt.divideByScalar(C,H.magnitude(w),C),Gg.fromCartesian4(C,m)};Gg.clone=function(o,f){return N(f)?(H.clone(o.normal,f.normal),f.distance=o.distance,f):new Gg(o.normal,o.distance)};Gg.equals=function(o,f){return o.distance===f.distance&&H.equals(o.normal,f.normal)};Gg.ORIGIN_XY_PLANE=Object.freeze(new Gg(H.UNIT_Z,0));Gg.ORIGIN_YZ_PLANE=Object.freeze(new Gg(H.UNIT_X,0));Gg.ORIGIN_ZX_PLANE=Object.freeze(new Gg(H.UNIT_Y,0));var $a=Gg;function vw(o){this.planes=Z(o,[])}var bW=[new H,new H,new H];H.clone(H.UNIT_X,bW[0]);H.clone(H.UNIT_Y,bW[1]);H.clone(H.UNIT_Z,bW[2]);var YL=new H,sEt=new H,j9e=new $a(new H(1,0,0),0);vw.fromBoundingSphere=function(o,f){N(f)||(f=new vw);let m=bW.length,v=f.planes;v.length=2*m;let y=o.center,x=o.radius,C=0;for(let w=0;w0){y=x-1;continue}return x}return~(y+1)}var Wg=hEt;function dEt(o,f,m,v,y){this.xPoleWander=o,this.yPoleWander=f,this.xPoleOffset=m,this.yPoleOffset=v,this.ut1MinusUtc=y}var nY=dEt;function fEt(o,f,m,v,y,x,C,w){this.year=o,this.month=f,this.day=m,this.hour=v,this.minute=y,this.second=x,this.millisecond=C,this.isLeapSecond=w}var gU=fEt;function pEt(o){return o%4===0&&o%100!==0||o%400===0}var cH=pEt;function mEt(o,f){this.julianDate=o,this.offset=f}var lh=mEt,gEt={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},lc=Object.freeze(gEt),_Et={UTC:0,TAI:1},gu=Object.freeze(_Et),q9e=new gU,Wce=[31,28,31,30,31,30,31,31,30,31,30,31],jce=29;function N_e(o,f){return Oo.compare(o.julianDate,f.julianDate)}var hH=new lh;function Xie(o){hH.julianDate=o;let f=Oo.leapSeconds,m=Wg(f,hH,N_e);m<0&&(m=~m),m>=f.length&&(m=f.length-1);let v=f[m].offset;m>0&&Oo.secondsDifference(f[m].julianDate,o)>v&&(m--,v=f[m].offset),Oo.addSeconds(o,v,o)}function _Ne(o,f){hH.julianDate=o;let m=Oo.leapSeconds,v=Wg(m,hH,N_e);if(v<0&&(v=~v),v===0)return Oo.addSeconds(o,-m[0].offset,f);if(v>=m.length)return Oo.addSeconds(o,-m[v-1].offset,f);let y=Oo.secondsDifference(m[v].julianDate,o);if(y===0)return Oo.addSeconds(o,-m[v].offset,f);if(!(y<=1))return Oo.addSeconds(o,-m[--v].offset,f)}function eO(o,f,m){let v=f/lc.SECONDS_PER_DAY|0;return o+=v,f-=lc.SECONDS_PER_DAY*v,f<0&&(o--,f+=lc.SECONDS_PER_DAY),m.dayNumber=o,m.secondsOfDay=f,m}function F_e(o,f,m,v,y,x,C){let w=(f-14)/12|0,A=o+4800+w,E=(1461*A/4|0)+(367*(f-2-12*w)/12|0)-(3*((A+100)/100|0)/4|0)+m-32075;v=v-12,v<0&&(v+=24);let T=x+(v*lc.SECONDS_PER_HOUR+y*lc.SECONDS_PER_MINUTE+C*lc.SECONDS_PER_MILLISECOND);return T>=43200&&(E-=1),[E,T]}var vEt=/^(\d{4})$/,yEt=/^(\d{4})-(\d{2})$/,xEt=/^(\d{4})-?(\d{3})$/,CEt=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,bEt=/^(\d{4})-?(\d{2})-?(\d{2})$/,B_e=/([Z+\-])?(\d{2})?:?(\d{2})?$/,wEt=/^(\d{2})(\.\d+)?/.source+B_e.source,AEt=/^(\d{2}):?(\d{2})(\.\d+)?/.source+B_e.source,EEt=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+B_e.source;function Oo(o,f,m){this.dayNumber=void 0,this.secondsOfDay=void 0,o=Z(o,0),f=Z(f,0),m=Z(m,gu.UTC);let v=o|0;f=f+(o-v)*lc.SECONDS_PER_DAY,eO(v,f,this),m===gu.UTC&&Xie(this)}Oo.fromGregorianDate=function(o,f){let m=F_e(o.year,o.month,o.day,o.hour,o.minute,o.second,o.millisecond);return N(f)?(eO(m[0],m[1],f),Xie(f),f):new Oo(m[0],m[1],gu.UTC)};Oo.fromDate=function(o,f){let m=F_e(o.getUTCFullYear(),o.getUTCMonth()+1,o.getUTCDate(),o.getUTCHours(),o.getUTCMinutes(),o.getUTCSeconds(),o.getUTCMilliseconds());return N(f)?(eO(m[0],m[1],f),Xie(f),f):new Oo(m[0],m[1],gu.UTC)};Oo.fromIso8601=function(o,f){o=o.replace(",",".");let m=o.split("T"),v,y=1,x=1,C=0,w=0,A=0,E=0,T=m[0],S=m[1],M,I;if(m=T.match(bEt),m!==null)v=+m[1],y=+m[2],x=+m[3];else if(m=T.match(yEt),m!==null)v=+m[1],y=+m[2];else if(m=T.match(vEt),m!==null)v=+m[1];else{let R;if(m=T.match(xEt),m!==null)v=+m[1],R=+m[2],I=cH(v);else if(m=T.match(CEt),m!==null){v=+m[1];let O=+m[2],F=+m[3]||0,k=new Date(Date.UTC(v,0,4));R=O*7+F-k.getUTCDay()-3}M=new Date(Date.UTC(v,0,1)),M.setUTCDate(R),y=M.getUTCMonth()+1,x=M.getUTCDate()}I=cH(v);let P;if(N(S)){m=S.match(EEt),m!==null?(C=+m[1],w=+m[2],A=+m[3],E=+(m[4]||0)*1e3,P=5):(m=S.match(AEt),m!==null?(C=+m[1],w=+m[2],A=+(m[3]||0)*60,P=4):(m=S.match(wEt),m!==null&&(C=+m[1],w=+(m[2]||0)*60,P=3)));let R=m[P],O=+m[P+1],F=+(m[P+2]||0);switch(R){case"+":C=C-O,w=w-F;break;case"-":C=C+O,w=w+F;break;case"Z":break;default:w=w+new Date(Date.UTC(v,y-1,x,C,w)).getTimezoneOffset();break}}let D=A===60;for(D&&A--;w>=60;)w-=60,C++;for(;C>=24;)C-=24,x++;for(M=I&&y===2?jce:Wce[y-1];x>M;)x-=M,y++,y>12&&(y-=12,v++),M=I&&y===2?jce:Wce[y-1];for(;w<0;)w+=60,C--;for(;C<0;)C+=24,x--;for(;x<1;)y--,y<1&&(y+=12,v--),M=I&&y===2?jce:Wce[y-1],x+=M;let L=F_e(v,y,x,C,w,A,E);return N(f)?(eO(L[0],L[1],f),Xie(f)):f=new Oo(L[0],L[1],gu.UTC),D&&Oo.addSeconds(f,1,f),f};Oo.now=function(o){return Oo.fromDate(new Date,o)};var oQ=new Oo(0,0,gu.TAI);Oo.toGregorianDate=function(o,f){let m=!1,v=_Ne(o,oQ);N(v)||(Oo.addSeconds(o,-1,oQ),v=_Ne(oQ,oQ),m=!0);let y=v.dayNumber,x=v.secondsOfDay;x>=43200&&(y+=1);let C=y+68569|0,w=4*C/146097|0;C=C-((146097*w+3)/4|0)|0;let A=4e3*(C+1)/1461001|0;C=C-(1461*A/4|0)+31|0;let E=80*C/2447|0,T=C-(2447*E/80|0)|0;C=E/11|0;let S=E+2-12*C|0,M=100*(w-49)+A+C|0,I=x/lc.SECONDS_PER_HOUR|0,P=x-I*lc.SECONDS_PER_HOUR,D=P/lc.SECONDS_PER_MINUTE|0;P=P-D*lc.SECONDS_PER_MINUTE;let L=P|0,R=(P-L)/lc.SECONDS_PER_MILLISECOND;return I+=12,I>23&&(I-=24),m&&(L+=1),N(f)?(f.year=M,f.month=S,f.day=T,f.hour=I,f.minute=D,f.second=L,f.millisecond=R,f.isLeapSecond=m,f):new gU(M,S,T,I,D,L,R,m)};Oo.toDate=function(o){let f=Oo.toGregorianDate(o,q9e),m=f.second;return f.isLeapSecond&&(m-=1),new Date(Date.UTC(f.year,f.month-1,f.day,f.hour,f.minute,m,f.millisecond))};Oo.toIso8601=function(o,f){let m=Oo.toGregorianDate(o,q9e),v=m.year,y=m.month,x=m.day,C=m.hour,w=m.minute,A=m.second,E=m.millisecond;v===1e4&&y===1&&x===1&&C===0&&w===0&&A===0&&E===0&&(v=9999,y=12,x=31,C=24);let T;return!N(f)&&E!==0?(T=(E*.01).toString().replace(".",""),`${v.toString().padStart(4,"0")}-${y.toString().padStart(2,"0")}-${x.toString().padStart(2,"0")}T${C.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}:${A.toString().padStart(2,"0")}.${T}Z`):!N(f)||f===0?`${v.toString().padStart(4,"0")}-${y.toString().padStart(2,"0")}-${x.toString().padStart(2,"0")}T${C.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}:${A.toString().padStart(2,"0")}Z`:(T=(E*.01).toFixed(f).replace(".","").slice(0,f),`${v.toString().padStart(4,"0")}-${y.toString().padStart(2,"0")}-${x.toString().padStart(2,"0")}T${C.toString().padStart(2,"0")}:${w.toString().padStart(2,"0")}:${A.toString().padStart(2,"0")}.${T}Z`)};Oo.clone=function(o,f){if(N(o))return N(f)?(f.dayNumber=o.dayNumber,f.secondsOfDay=o.secondsOfDay,f):new Oo(o.dayNumber,o.secondsOfDay,gu.TAI)};Oo.compare=function(o,f){let m=o.dayNumber-f.dayNumber;return m!==0?m:o.secondsOfDay-f.secondsOfDay};Oo.equals=function(o,f){return o===f||N(o)&&N(f)&&o.dayNumber===f.dayNumber&&o.secondsOfDay===f.secondsOfDay};Oo.equalsEpsilon=function(o,f,m){return m=Z(m,0),o===f||N(o)&&N(f)&&Math.abs(Oo.secondsDifference(o,f))<=m};Oo.totalDays=function(o){return o.dayNumber+o.secondsOfDay/lc.SECONDS_PER_DAY};Oo.secondsDifference=function(o,f){return(o.dayNumber-f.dayNumber)*lc.SECONDS_PER_DAY+(o.secondsOfDay-f.secondsOfDay)};Oo.daysDifference=function(o,f){let m=o.dayNumber-f.dayNumber,v=(o.secondsOfDay-f.secondsOfDay)/lc.SECONDS_PER_DAY;return m+v};Oo.computeTaiMinusUtc=function(o){hH.julianDate=o;let f=Oo.leapSeconds,m=Wg(f,hH,N_e);return m<0&&(m=~m,--m,m<0&&(m=0)),f[m].offset};Oo.addSeconds=function(o,f,m){return eO(o.dayNumber,o.secondsOfDay+f,m)};Oo.addMinutes=function(o,f,m){let v=o.secondsOfDay+f*lc.SECONDS_PER_MINUTE;return eO(o.dayNumber,v,m)};Oo.addHours=function(o,f,m){let v=o.secondsOfDay+f*lc.SECONDS_PER_HOUR;return eO(o.dayNumber,v,m)};Oo.addDays=function(o,f,m){let v=o.dayNumber+f;return eO(v,o.secondsOfDay,m)};Oo.lessThan=function(o,f){return Oo.compare(o,f)<0};Oo.lessThanOrEquals=function(o,f){return Oo.compare(o,f)<=0};Oo.greaterThan=function(o,f){return Oo.compare(o,f)>0};Oo.greaterThanOrEquals=function(o,f){return Oo.compare(o,f)>=0};Oo.prototype.clone=function(o){return Oo.clone(this,o)};Oo.prototype.equals=function(o){return Oo.equals(this,o)};Oo.prototype.equalsEpsilon=function(o,f){return Oo.equalsEpsilon(this,o,f)};Oo.prototype.toString=function(){return Oo.toIso8601(this)};Oo.leapSeconds=[new lh(new Oo(2441317,43210,gu.TAI),10),new lh(new Oo(2441499,43211,gu.TAI),11),new lh(new Oo(2441683,43212,gu.TAI),12),new lh(new Oo(2442048,43213,gu.TAI),13),new lh(new Oo(2442413,43214,gu.TAI),14),new lh(new Oo(2442778,43215,gu.TAI),15),new lh(new Oo(2443144,43216,gu.TAI),16),new lh(new Oo(2443509,43217,gu.TAI),17),new lh(new Oo(2443874,43218,gu.TAI),18),new lh(new Oo(2444239,43219,gu.TAI),19),new lh(new Oo(2444786,43220,gu.TAI),20),new lh(new Oo(2445151,43221,gu.TAI),21),new lh(new Oo(2445516,43222,gu.TAI),22),new lh(new Oo(2446247,43223,gu.TAI),23),new lh(new Oo(2447161,43224,gu.TAI),24),new lh(new Oo(2447892,43225,gu.TAI),25),new lh(new Oo(2448257,43226,gu.TAI),26),new lh(new Oo(2448804,43227,gu.TAI),27),new lh(new Oo(2449169,43228,gu.TAI),28),new lh(new Oo(2449534,43229,gu.TAI),29),new lh(new Oo(2450083,43230,gu.TAI),30),new lh(new Oo(2450630,43231,gu.TAI),31),new lh(new Oo(2451179,43232,gu.TAI),32),new lh(new Oo(2453736,43233,gu.TAI),33),new lh(new Oo(2454832,43234,gu.TAI),34),new lh(new Oo(2456109,43235,gu.TAI),35),new lh(new Oo(2457204,43236,gu.TAI),36),new lh(new Oo(2457754,43237,gu.TAI),37)];var ci=Oo;function wW(o){o=Z(o,Z.EMPTY_OBJECT),this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=Z(o.addNewLeapSeconds,!0),N(o.data)?vNe(this,o.data):vNe(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}wW.fromUrl=async function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=Jr.createIfNeeded(o),v;try{v=await m.fetchJson()}catch{throw new sr(`An error occurred while retrieving the EOP data from the URL ${m.url}.`)}return new wW({addNewLeapSeconds:f.addNewLeapSeconds,data:v})};wW.NONE=Object.freeze({compute:function(o,f){return N(f)?(f.xPoleWander=0,f.yPoleWander=0,f.xPoleOffset=0,f.yPoleOffset=0,f.ut1MinusUtc=0):f=new nY(0,0,0,0,0),f}});wW.prototype.compute=function(o,f){if(!N(this._samples))return;if(N(f)||(f=new nY(0,0,0,0,0)),this._samples.length===0)return f.xPoleWander=0,f.yPoleWander=0,f.xPoleOffset=0,f.yPoleOffset=0,f.ut1MinusUtc=0,f;let m=this._dates,v=this._lastIndex,y=0,x=0;if(N(v)){let w=m[v],A=m[v+1],E=ci.lessThanOrEquals(w,o),T=!N(A),S=T||ci.greaterThanOrEquals(A,o);if(E&&S)return y=v,!T&&A.equals(o)&&++y,x=y+1,xNe(this,m,this._samples,o,y,x,f),f}let C=Wg(m,o,ci.compare,this._dateColumn);return C>=0?(Cf.length-1)return C.xPoleWander=0,C.yPoleWander=0,C.xPoleOffset=0,C.yPoleOffset=0,C.ut1MinusUtc=0,C;let A=f[y],E=f[x];if(A.equals(E)||v.equals(A))return yNe(o,m,y,w,C),C;if(v.equals(E))return yNe(o,m,x,w,C),C;let T=ci.secondsDifference(v,A)/ci.secondsDifference(E,A),S=y*w,M=x*w,I=m[S+o._ut1MinusUtcSecondsColumn],P=m[M+o._ut1MinusUtcSecondsColumn],D=P-I;if(D>.5||D<-.5){let L=m[S+o._taiMinusUtcSecondsColumn],R=m[M+o._taiMinusUtcSecondsColumn];L!==R&&(E.equals(v)?I=P:P-=R-L)}return C.xPoleWander=a9(T,m[S+o._xPoleWanderRadiansColumn],m[M+o._xPoleWanderRadiansColumn]),C.yPoleWander=a9(T,m[S+o._yPoleWanderRadiansColumn],m[M+o._yPoleWanderRadiansColumn]),C.xPoleOffset=a9(T,m[S+o._xCelestialPoleOffsetRadiansColumn],m[M+o._xCelestialPoleOffsetRadiansColumn]),C.yPoleOffset=a9(T,m[S+o._yCelestialPoleOffsetRadiansColumn],m[M+o._yCelestialPoleOffsetRadiansColumn]),C.ut1MinusUtc=a9(T,I,P),C}var k_e=wW;function Ov(o,f,m){this.heading=Z(o,0),this.pitch=Z(f,0),this.roll=Z(m,0)}Ov.fromQuaternion=function(o,f){N(f)||(f=new Ov);let m=2*(o.w*o.y-o.z*o.x),v=1-2*(o.x*o.x+o.y*o.y),y=2*(o.w*o.x+o.y*o.z),x=1-2*(o.y*o.y+o.z*o.z),C=2*(o.w*o.z+o.x*o.y);return f.heading=-Math.atan2(C,x),f.roll=Math.atan2(y,v),f.pitch=-xe.asinClamped(m),f};Ov.fromDegrees=function(o,f,m,v){return N(v)||(v=new Ov),v.heading=o*xe.RADIANS_PER_DEGREE,v.pitch=f*xe.RADIANS_PER_DEGREE,v.roll=m*xe.RADIANS_PER_DEGREE,v};Ov.clone=function(o,f){if(N(o))return N(f)?(f.heading=o.heading,f.pitch=o.pitch,f.roll=o.roll,f):new Ov(o.heading,o.pitch,o.roll)};Ov.equals=function(o,f){return o===f||N(o)&&N(f)&&o.heading===f.heading&&o.pitch===f.pitch&&o.roll===f.roll};Ov.equalsEpsilon=function(o,f,m,v){return o===f||N(o)&&N(f)&&xe.equalsEpsilon(o.heading,f.heading,m,v)&&xe.equalsEpsilon(o.pitch,f.pitch,m,v)&&xe.equalsEpsilon(o.roll,f.roll,m,v)};Ov.prototype.clone=function(o){return Ov.clone(this,o)};Ov.prototype.equals=function(o){return Ov.equals(this,o)};Ov.prototype.equalsEpsilon=function(o,f,m){return Ov.equalsEpsilon(this,o,f,m)};Ov.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var dl=Ov;function SEt(o,f,m){this.x=o,this.y=f,this.s=m}var Jie=SEt;function V_e(o){o=Z(o,Z.EMPTY_OBJECT),this._xysFileUrlTemplate=Jr.createIfNeeded(o.xysFileUrlTemplate),this._interpolationOrder=Z(o.interpolationOrder,9),this._sampleZeroJulianEphemerisDate=Z(o.sampleZeroJulianEphemerisDate,24423965e-1),this._sampleZeroDateTT=new ci(this._sampleZeroJulianEphemerisDate,0,gu.TAI),this._stepSizeDays=Z(o.stepSizeDays,1),this._samplesPerXysFile=Z(o.samplesPerXysFile,1e3),this._totalSamples=Z(o.totalSamples,27426),this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let f=this._interpolationOrder,m=this._denominators=new Array(f+1),v=this._xTable=new Array(f+1),y=Math.pow(this._stepSizeDays,f);for(let x=0;x<=f;++x){m[x]=y,v[x]=x*this._stepSizeDays;for(let C=0;C<=f;++C)C!==x&&(m[x]*=x-C);m[x]=1/m[x]}this._work=new Array(f+1),this._coef=new Array(f+1)}var PEt=new ci(0,0,gu.TAI);function tme(o,f,m){let v=PEt;return v.dayNumber=f,v.secondsOfDay=m,ci.daysDifference(v,o._sampleZeroDateTT)}V_e.prototype.preload=function(o,f,m,v){let y=tme(this,o,f),x=tme(this,m,v),C=y/this._stepSizeDays-this._interpolationOrder/2|0;C<0&&(C=0);let w=x/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;w>=this._totalSamples&&(w=this._totalSamples-1);let A=C/this._samplesPerXysFile|0,E=w/this._samplesPerXysFile|0,T=[];for(let S=A;S<=E;++S)T.push(ime(this,S));return Promise.all(T)};V_e.prototype.computeXysRadians=function(o,f,m){let v=tme(this,o,f);if(v<0)return;let y=v/this._stepSizeDays|0;if(y>=this._totalSamples)return;let x=this._interpolationOrder,C=y-(x/2|0);C<0&&(C=0);let w=C+x;w>=this._totalSamples&&(w=this._totalSamples-1,C=w-x,C<0&&(C=0));let A=!1,E=this._samples;if(N(E[C*3])||(ime(this,C/this._samplesPerXysFile|0),A=!0),N(E[w*3])||(ime(this,w/this._samplesPerXysFile|0),A=!0),A)return;N(m)?(m.x=0,m.y=0,m.s=0):m=new Jie(0,0,0);let T=v-C*this._stepSizeDays,S=this._work,M=this._denominators,I=this._coef,P=this._xTable,D,L;for(D=0;D<=x;++D)S[D]=T-P[D];for(D=0;D<=x;++D){for(I[D]=1,L=0;L<=x;++L)L!==D&&(I[D]*=S[L]);I[D]*=M[D];let R=(C+D)*3;m.x+=I[D]*E[R++],m.y+=I[D]*E[R++],m.s+=I[D]*E[R]}return m};function ime(o,f){if(o._chunkDownloadsInProgress[f])return o._chunkDownloadsInProgress[f];let m,v=o._xysFileUrlTemplate;N(v)?m=v.getDerivedResource({templateValues:{0:f}}):m=new Jr({url:Ms(`Assets/IAU2006_XYS/IAU2006_XYS_${f}.json`)});let y=m.fetchJson().then(function(x){o._chunkDownloadsInProgress[f]=!1;let C=o._samples,w=x.samples,A=f*o._samplesPerXysFile*3;for(let E=0,T=w.length;E0)m=Math.sqrt(T+1),C=.5*m,m=.5/m,v=(o[Ut.COLUMN1ROW2]-o[Ut.COLUMN2ROW1])*m,y=(o[Ut.COLUMN2ROW0]-o[Ut.COLUMN0ROW2])*m,x=(o[Ut.COLUMN0ROW1]-o[Ut.COLUMN1ROW0])*m;else{let S=IEt,M=0;A>w&&(M=1),E>w&&E>A&&(M=2);let I=S[M],P=S[I];m=Math.sqrt(o[Ut.getElementIndex(M,M)]-o[Ut.getElementIndex(I,I)]-o[Ut.getElementIndex(P,P)]+1);let D=MEt;D[M]=.5*m,m=.5/m,C=(o[Ut.getElementIndex(P,I)]-o[Ut.getElementIndex(I,P)])*m,D[I]=(o[Ut.getElementIndex(I,M)]+o[Ut.getElementIndex(M,I)])*m,D[P]=(o[Ut.getElementIndex(P,M)]+o[Ut.getElementIndex(M,P)])*m,v=-D[0],y=-D[1],x=-D[2]}return N(f)?(f.x=v,f.y=y,f.z=x,f.w=C,f):new jn(v,y,x,C)};var CNe=new jn,bNe=new jn,Yce=new jn,wNe=new jn;jn.fromHeadingPitchRoll=function(o,f){return wNe=jn.fromAxisAngle(H.UNIT_X,o.roll,CNe),Yce=jn.fromAxisAngle(H.UNIT_Y,-o.pitch,f),f=jn.multiply(Yce,wNe,Yce),bNe=jn.fromAxisAngle(H.UNIT_Z,-o.heading,CNe),jn.multiply(bNe,f,f)};var aQ=new H,qce=new H,TE=new jn,ANe=new jn,sQ=new jn;jn.packedLength=4;jn.pack=function(o,f,m){return m=Z(m,0),f[m++]=o.x,f[m++]=o.y,f[m++]=o.z,f[m]=o.w,f};jn.unpack=function(o,f,m){return f=Z(f,0),N(m)||(m=new jn),m.x=o[f],m.y=o[f+1],m.z=o[f+2],m.w=o[f+3],m};jn.packedInterpolationLength=3;jn.convertPackedArrayForInterpolation=function(o,f,m,v){jn.unpack(o,m*4,sQ),jn.conjugate(sQ,sQ);for(let y=0,x=m-f+1;y=0?x=1:(x=-1,y=-y);let C=y-1,w=1-m,A=m*m,E=w*w;for(let I=7;I>=0;--I)SI[I]=(bee[I]*A-wee[I])*C,PI[I]=(bee[I]*E-wee[I])*C;let T=x*m*(1+SI[0]*(1+SI[1]*(1+SI[2]*(1+SI[3]*(1+SI[4]*(1+SI[5]*(1+SI[6]*(1+SI[7])))))))),S=w*(1+PI[0]*(1+PI[1]*(1+PI[2]*(1+PI[3]*(1+PI[4]*(1+PI[5]*(1+PI[6]*(1+PI[7])))))))),M=jn.multiplyByScalar(o,S,REt);return jn.multiplyByScalar(f,T,v),jn.add(M,v,v)};jn.fastSquad=function(o,f,m,v,y,x){let C=jn.fastSlerp(o,f,y,k7),w=jn.fastSlerp(m,v,y,pz);return jn.fastSlerp(C,w,2*y*(1-y),x)};jn.equals=function(o,f){return o===f||N(o)&&N(f)&&o.x===f.x&&o.y===f.y&&o.z===f.z&&o.w===f.w};jn.equalsEpsilon=function(o,f,m){return m=Z(m,0),o===f||N(o)&&N(f)&&Math.abs(o.x-f.x)<=m&&Math.abs(o.y-f.y)<=m&&Math.abs(o.z-f.z)<=m&&Math.abs(o.w-f.w)<=m};jn.ZERO=Object.freeze(new jn(0,0,0,0));jn.IDENTITY=Object.freeze(new jn(0,0,0,1));jn.prototype.clone=function(o){return jn.clone(this,o)};jn.prototype.equals=function(o){return jn.equals(this,o)};jn.prototype.equalsEpsilon=function(o,f){return jn.equalsEpsilon(this,o,f)};jn.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Gr=jn,Wc={},Qce={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},yV={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Zce={},Vx={east:new H,north:new H,up:new H,west:new H,south:new H,down:new H},qL=new H,XL=new H,JL=new H;Wc.localFrameToFixedFrameGenerator=function(o,f){if(!Qce.hasOwnProperty(o)||!Qce[o].hasOwnProperty(f))throw new li("firstAxis and secondAxis must be east, north, up, west, south or down.");let m=Qce[o][f],v,y=o+f;return N(Zce[y])?v=Zce[y]:(v=function(x,C,w){if(N(w)||(w=new Ee),H.equalsEpsilon(x,H.ZERO,xe.EPSILON14))H.unpack(yV[o],0,qL),H.unpack(yV[f],0,XL),H.unpack(yV[m],0,JL);else if(xe.equalsEpsilon(x.x,0,xe.EPSILON14)&&xe.equalsEpsilon(x.y,0,xe.EPSILON14)){let A=xe.sign(x.z);H.unpack(yV[o],0,qL),o!=="east"&&o!=="west"&&H.multiplyByScalar(qL,A,qL),H.unpack(yV[f],0,XL),f!=="east"&&f!=="west"&&H.multiplyByScalar(XL,A,XL),H.unpack(yV[m],0,JL),m!=="east"&&m!=="west"&&H.multiplyByScalar(JL,A,JL)}else{C=Z(C,ki.WGS84),C.geodeticSurfaceNormal(x,Vx.up);let A=Vx.up,E=Vx.east;E.x=-x.y,E.y=x.x,E.z=0,H.normalize(E,Vx.east),H.cross(A,E,Vx.north),H.multiplyByScalar(Vx.up,-1,Vx.down),H.multiplyByScalar(Vx.east,-1,Vx.west),H.multiplyByScalar(Vx.north,-1,Vx.south),qL=Vx[o],XL=Vx[f],JL=Vx[m]}return w[0]=qL.x,w[1]=qL.y,w[2]=qL.z,w[3]=0,w[4]=XL.x,w[5]=XL.y,w[6]=XL.z,w[7]=0,w[8]=JL.x,w[9]=JL.y,w[10]=JL.z,w[11]=0,w[12]=x.x,w[13]=x.y,w[14]=x.z,w[15]=1,w},Zce[y]=v),v};Wc.eastNorthUpToFixedFrame=Wc.localFrameToFixedFrameGenerator("east","north");Wc.northEastDownToFixedFrame=Wc.localFrameToFixedFrameGenerator("north","east");Wc.northUpEastToFixedFrame=Wc.localFrameToFixedFrameGenerator("north","up");Wc.northWestUpToFixedFrame=Wc.localFrameToFixedFrameGenerator("north","west");var OEt=new Gr,NEt=new H(1,1,1),FEt=new Ee;Wc.headingPitchRollToFixedFrame=function(o,f,m,v,y){v=Z(v,Wc.eastNorthUpToFixedFrame);let x=Gr.fromHeadingPitchRoll(f,OEt),C=Ee.fromTranslationQuaternionRotationScale(H.ZERO,x,NEt,FEt);return y=v(o,m,y),Ee.multiply(y,C,y)};var BEt=new Ee,kEt=new Ut;Wc.headingPitchRollQuaternion=function(o,f,m,v,y){let x=Wc.headingPitchRollToFixedFrame(o,f,m,v,BEt),C=Ee.getMatrix3(x,kEt);return Gr.fromRotationMatrix(C,y)};var VEt=new H(1,1,1),zEt=new H,TNe=new Ee,HEt=new Ee,UEt=new Ut,GEt=new Gr;Wc.fixedFrameToHeadingPitchRoll=function(o,f,m,v){f=Z(f,ki.WGS84),m=Z(m,Wc.eastNorthUpToFixedFrame),N(v)||(v=new dl);let y=Ee.getTranslation(o,zEt);if(H.equals(y,H.ZERO))return v.heading=0,v.pitch=0,v.roll=0,v;let x=Ee.inverseTransformation(m(y,f,TNe),TNe),C=Ee.setScale(o,VEt,HEt);C=Ee.setTranslation(C,H.ZERO,C),x=Ee.multiply(x,C,x);let w=Gr.fromRotationMatrix(Ee.getMatrix3(x,UEt),GEt);return w=Gr.normalize(w,w),dl.fromQuaternion(w,v)};var WEt=6*3600+41*60+50.54841,jEt=8640184812866e-6,YEt=.093104,qEt=-62e-7,XEt=11772758384668e-32,JEt=72921158553e-15,KEt=xe.TWO_PI/86400,lQ=new ci;Wc.computeTemeToPseudoFixedMatrix=function(o,f){lQ=ci.addSeconds(o,-ci.computeTaiMinusUtc(o),lQ);let m=lQ.dayNumber,v=lQ.secondsOfDay,y,x=m-2451545;v>=43200?y=(x+.5)/lc.DAYS_PER_JULIAN_CENTURY:y=(x-.5)/lc.DAYS_PER_JULIAN_CENTURY;let C=(WEt+y*(jEt+y*(YEt+y*qEt)))*KEt%xe.TWO_PI,w=JEt+XEt*(m-24515455e-1),A=(v+lc.SECONDS_PER_DAY*.5)%lc.SECONDS_PER_DAY,E=C+w*A,T=Math.cos(E),S=Math.sin(E);return N(f)?(f[0]=T,f[1]=-S,f[2]=0,f[3]=S,f[4]=T,f[5]=0,f[6]=0,f[7]=0,f[8]=1,f):new Ut(T,S,0,-S,T,0,0,0,1)};Wc.iau2006XysData=new z_e;Wc.earthOrientationParameters=k_e.NONE;var rme=32.184,QEt=2451545;Wc.preloadIcrfFixed=function(o){let f=o.start.dayNumber,m=o.start.secondsOfDay+rme,v=o.stop.dayNumber,y=o.stop.secondsOfDay+rme;return Wc.iau2006XysData.preload(f,m,v,y)};Wc.computeIcrfToFixedMatrix=function(o,f){N(f)||(f=new Ut);let m=Wc.computeFixedToIcrfMatrix(o,f);if(N(m))return Ut.transpose(m,f)};var ZEt=new Jie(0,0,0),$Et=new nY(0,0,0,0,0,0),$ce=new Ut,ehe=new Ut;Wc.computeFixedToIcrfMatrix=function(o,f){N(f)||(f=new Ut);let m=Wc.earthOrientationParameters.compute(o,$Et);if(!N(m))return;let v=o.dayNumber,y=o.secondsOfDay+rme,x=Wc.iau2006XysData.computeXysRadians(v,y,ZEt);if(!N(x))return;let C=x.x+m.xPoleOffset,w=x.y+m.yPoleOffset,A=1/(1+Math.sqrt(1-C*C-w*w)),E=$ce;E[0]=1-A*C*C,E[3]=-A*C*w,E[6]=C,E[1]=-A*C*w,E[4]=1-A*w*w,E[7]=w,E[2]=-C,E[5]=-w,E[8]=1-A*(C*C+w*w);let T=Ut.fromRotationZ(-x.s,ehe),S=Ut.multiply(E,T,$ce),M=o.dayNumber,I=o.secondsOfDay-ci.computeTaiMinusUtc(o)+m.ut1MinusUtc,P=M-2451545,D=I/lc.SECONDS_PER_DAY,L=.779057273264+D+.00273781191135448*(P+D);L=L%1*xe.TWO_PI;let R=Ut.fromRotationZ(L,ehe),O=Ut.multiply(S,R,$ce),F=Math.cos(m.xPoleWander),k=Math.cos(m.yPoleWander),U=Math.sin(m.xPoleWander),G=Math.sin(m.yPoleWander),j=v-QEt+y/lc.SECONDS_PER_DAY;j/=36525;let q=-47e-6*j*xe.RADIANS_PER_DEGREE/3600,J=Math.cos(q),X=Math.sin(q),Y=ehe;return Y[0]=F*J,Y[1]=F*X,Y[2]=U,Y[3]=-k*X+G*U*J,Y[4]=k*J+G*U*X,Y[5]=-G*F,Y[6]=-G*X-k*U*J,Y[7]=G*J-k*U*X,Y[8]=k*F,Ut.multiply(O,Y,f)};var eTt=new Wt;Wc.pointToWindowCoordinates=function(o,f,m,v){return v=Wc.pointToGLWindowCoordinates(o,f,m,v),v.y=2*f[5]-v.y,v};Wc.pointToGLWindowCoordinates=function(o,f,m,v){N(v)||(v=new Ye);let y=eTt;return Ee.multiplyByVector(o,Wt.fromElements(m.x,m.y,m.z,1,y),y),Wt.multiplyByScalar(y,1/y.w,y),Ee.multiplyByVector(f,y,y),Ye.fromCartesian4(y,v)};var tTt=new H,iTt=new H,rTt=new H;Wc.rotationMatrixFromPositionVelocity=function(o,f,m,v){let y=Z(m,ki.WGS84).geodeticSurfaceNormal(o,tTt),x=H.cross(f,y,iTt);H.equalsEpsilon(x,H.ZERO,xe.EPSILON6)&&(x=H.clone(H.UNIT_X,x));let C=H.cross(x,f,rTt);return H.normalize(C,C),H.cross(f,C,x),H.negate(x,x),H.normalize(x,x),N(v)||(v=new Ut),v[0]=f.x,v[1]=f.y,v[2]=f.z,v[3]=x.x,v[4]=x.y,v[5]=x.z,v[6]=C.x,v[7]=C.y,v[8]=C.z,v};var J9e=new Ee(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),K9e=new Mt,Q9e=new H,nTt=new H,oTt=new Ut,nme=new Ee,Z9e=new Ee;Wc.basisTo2D=function(o,f,m){let v=Ee.getTranslation(f,nTt),y=o.ellipsoid,x=y.cartesianToCartographic(v,K9e),C=o.project(x,Q9e);H.fromElements(C.z,C.x,C.y,C);let w=Wc.eastNorthUpToFixedFrame(v,y,nme),A=Ee.inverseTransformation(w,Z9e),E=Ee.getMatrix3(f,oTt),T=Ee.multiplyByMatrix3(A,E,m);return Ee.multiply(J9e,T,m),Ee.setTranslation(m,C,m),m};Wc.wgs84To2DModelMatrix=function(o,f,m){let v=o.ellipsoid,y=Wc.eastNorthUpToFixedFrame(f,v,nme),x=Ee.inverseTransformation(y,Z9e),C=v.cartesianToCartographic(f,K9e),w=o.project(C,Q9e);H.fromElements(w.z,w.x,w.y,w);let A=Ee.fromTranslation(w,nme);return Ee.multiply(J9e,x,m),Ee.multiply(A,m,m),m};var tn=Wc,g_={},aTt=new Wt(0,0,0,1),uv=new Wt,sTt=new Xr,the=new Ye,ihe=new Ye;g_.wgs84ToWindowCoordinates=function(o,f,m){return g_.wgs84WithEyeOffsetToWindowCoordinates(o,f,H.ZERO,m)};var SNe=new Wt,PNe=new H;function l9(o,f,m,v){let y=m.viewMatrix,x=Ee.multiplyByVector(y,Wt.fromElements(o.x,o.y,o.z,1,SNe),SNe),C=H.multiplyComponents(f,H.normalize(x,PNe),PNe);return x.x+=f.x+C.x,x.y+=f.y+C.y,x.z+=C.z,Ee.multiplyByVector(m.frustum.projectionMatrix,x,v)}var lTt=new Mt(Math.PI,xe.PI_OVER_TWO),uTt=new H,cTt=new H;g_.wgs84WithEyeOffsetToWindowCoordinates=function(o,f,m,v){let y=o.frameState,x=g_.computeActualWgs84Position(y,f,aTt);if(!N(x))return;let C=o.canvas,w=sTt;w.x=0,w.y=0,w.width=C.clientWidth,w.height=C.clientHeight;let A=o.camera,E=!1;if(y.mode===_i.SCENE2D){let T=o.mapProjection,S=lTt,M=T.project(S,uTt),I=H.clone(A.position,cTt),P=A.frustum.clone(),D=Ee.computeViewportTransformation(w,0,1,new Ee),L=A.frustum.projectionMatrix,R=A.positionWC.y,O=H.fromElements(xe.sign(R)*M.x-R,0,-A.positionWC.x),F=tn.pointToGLWindowCoordinates(L,D,O);if(R===0||F.x<=0||F.x>=C.clientWidth)E=!0;else{if(F.x>C.clientWidth*.5){w.width=F.x,A.frustum.right=M.x-R,uv=l9(x,m,A,uv),g_.clipToGLWindowCoordinates(w,uv,the),w.x+=F.x,A.position.x=-A.position.x;let k=A.frustum.right;A.frustum.right=-A.frustum.left,A.frustum.left=-k,uv=l9(x,m,A,uv),g_.clipToGLWindowCoordinates(w,uv,ihe)}else{w.x+=F.x,w.width-=F.x,A.frustum.left=-M.x-R,uv=l9(x,m,A,uv),g_.clipToGLWindowCoordinates(w,uv,the),w.x=w.x-w.width,A.position.x=-A.position.x;let k=A.frustum.left;A.frustum.left=-A.frustum.right,A.frustum.right=-k,uv=l9(x,m,A,uv),g_.clipToGLWindowCoordinates(w,uv,ihe)}H.clone(I,A.position),A.frustum=P.clone(),v=Ye.clone(the,v),(v.x<0||v.x>C.clientWidth)&&(v.x=ihe.x)}}if(y.mode!==_i.SCENE2D||E){if(uv=l9(x,m,A,uv),uv.z<0&&!(A.frustum instanceof Gs)&&!(A.frustum instanceof Pm))return;v=g_.clipToGLWindowCoordinates(w,uv,v)}return v.y=C.clientHeight-v.y,v};g_.wgs84ToDrawingBufferCoordinates=function(o,f,m){if(m=g_.wgs84ToWindowCoordinates(o,f,m),!!N(m))return g_.transformWindowToDrawingBuffer(o,m,m)};var II=new H,hTt=new Mt;g_.computeActualWgs84Position=function(o,f,m){let v=o.mode;if(v===_i.SCENE3D)return H.clone(f,m);let y=o.mapProjection,x=y.ellipsoid.cartesianToCartographic(f,hTt);if(!N(x))return;if(y.project(x,II),v===_i.COLUMBUS_VIEW)return H.fromElements(II.z,II.x,II.y,m);if(v===_i.SCENE2D)return H.fromElements(0,II.x,II.y,m);let C=o.morphTime;return H.fromElements(xe.lerp(II.z,f.x,C),xe.lerp(II.x,f.y,C),xe.lerp(II.y,f.z,C),m)};var INe=new H,MNe=new H,DNe=new Ee;g_.clipToGLWindowCoordinates=function(o,f,m){return H.divideByScalar(f,f.w,INe),Ee.computeViewportTransformation(o,0,1,DNe),Ee.multiplyByPoint(DNe,INe,MNe),Ye.fromCartesian3(MNe,m)};g_.transformWindowToDrawingBuffer=function(o,f,m){let v=o.canvas,y=o.drawingBufferWidth/v.clientWidth,x=o.drawingBufferHeight/v.clientHeight;return Ye.fromElements(f.x*y,f.y*x,m)};var dTt=new Wt,LNe=new Wt;g_.drawingBufferToWgs84Coordinates=function(o,f,m,v){let y=o.context.uniformState,x=y.currentFrustum,C=x.x,w=x.y;if(o.frameState.useLogDepth){let M=m*y.log2FarDepthFromNearPlusOne,I=Math.pow(2,M)-1;m=w*(1-C/(I+C))/(w-C)}let A=o.view.passState.viewport,E=Wt.clone(Wt.UNIT_W,dTt);E.x=(f.x-A.x)/A.width*2-1,E.y=(f.y-A.y)/A.height*2-1,E.z=m*2-1,E.w=1;let T,S=o.camera.frustum;if(N(S.fovy)){T=Ee.multiplyByVector(y.inverseViewProjection,E,LNe);let M=1/T.w;H.multiplyByScalar(T,M,T)}else{let M=S.offCenterFrustum;N(M)&&(S=M),T=LNe,T.x=(E.x*(S.right-S.left)+S.left+S.right)*.5,T.y=(E.y*(S.top-S.bottom)+S.bottom+S.top)*.5,T.z=(E.z*(C-w)-C-w)*.5,T.w=1,T=Ee.multiplyByVector(y.inverseView,T,T)}return H.fromCartesian4(T,v)};var nl=g_,fTt={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},so=Object.freeze(fTt);function $u(o,f){o=Z(o,Z.EMPTY_OBJECT);let m=o.translucencyByDistance,v=o.pixelOffsetScaleByDistance,y=o.scaleByDistance,x=o.distanceDisplayCondition;N(m)&&(m=sa.clone(m)),N(v)&&(v=sa.clone(v)),N(y)&&(y=sa.clone(y)),N(x)&&(x=ia.clone(x)),this._show=Z(o.show,!0),this._position=H.clone(Z(o.position,H.ZERO)),this._actualPosition=H.clone(this._position),this._pixelOffset=Ye.clone(Z(o.pixelOffset,Ye.ZERO)),this._translate=new Ye(0,0),this._eyeOffset=H.clone(Z(o.eyeOffset,H.ZERO)),this._heightReference=Z(o.heightReference,qn.NONE),this._verticalOrigin=Z(o.verticalOrigin,so.CENTER),this._horizontalOrigin=Z(o.horizontalOrigin,Zc.CENTER),this._scale=Z(o.scale,1),this._color=Re.clone(Z(o.color,Re.WHITE)),this._rotation=Z(o.rotation,0),this._alignedAxis=H.clone(Z(o.alignedAxis,H.ZERO)),this._width=o.width,this._height=o.height,this._scaleByDistance=y,this._translucencyByDistance=m,this._pixelOffsetScaleByDistance=v,this._sizeInMeters=Z(o.sizeInMeters,!1),this._distanceDisplayCondition=x,this._disableDepthTestDistance=o.disableDepthTestDistance,this._id=o.id,this._collection=Z(o.collection,f),this._pickId=void 0,this._pickPrimitive=Z(o._pickPrimitive,this),this._billboardCollection=f,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageIndex=-1,this._imageIndexPromise=void 0,this._imageId=void 0,this._image=void 0,this._imageSubRegion=void 0,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let C=o.image,w=o.imageId;N(C)&&(N(w)||(typeof C=="string"?w=C:N(C.src)?w=C.src:w=zl()),this._imageId=w,this._image=C),N(o.imageSubRegion)&&(this._imageId=w,this._imageSubRegion=o.imageSubRegion),N(this._billboardCollection._textureAtlas)&&this._loadImage(),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=_i.SCENE3D,this._clusterShow=!0,this._outlineColor=Re.clone(Z(o.outlineColor,Re.BLACK)),this._outlineWidth=Z(o.outlineWidth,0),this._updateClamping()}var RNe=$u.SHOW_INDEX=0,T$=$u.POSITION_INDEX=1,$9e=$u.PIXEL_OFFSET_INDEX=2,pTt=$u.EYE_OFFSET_INDEX=3,mTt=$u.HORIZONTAL_ORIGIN_INDEX=4,gTt=$u.VERTICAL_ORIGIN_INDEX=5,_Tt=$u.SCALE_INDEX=6,S$=$u.IMAGE_INDEX_INDEX=7,ONe=$u.COLOR_INDEX=8,vTt=$u.ROTATION_INDEX=9,yTt=$u.ALIGNED_AXIS_INDEX=10,xTt=$u.SCALE_BY_DISTANCE_INDEX=11,CTt=$u.TRANSLUCENCY_BY_DISTANCE_INDEX=12,bTt=$u.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,wTt=$u.DISTANCE_DISPLAY_CONDITION=14,ATt=$u.DISABLE_DEPTH_DISTANCE=15;$u.TEXTURE_COORDINATE_BOUNDS=16;var NNe=$u.SDF_INDEX=17;$u.NUMBER_OF_PROPERTIES=18;function Ld(o,f){let m=o._billboardCollection;N(m)&&(m._updateBillboard(o,f),o._dirty=!0)}Object.defineProperties($u.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,Ld(this,RNe))}},position:{get:function(){return this._position},set:function(o){let f=this._position;H.equals(f,o)||(H.clone(o,f),H.clone(o,this._actualPosition),this._updateClamping(),Ld(this,T$))}},heightReference:{get:function(){return this._heightReference},set:function(o){let f=this._heightReference;o!==f&&(this._heightReference=o,this._updateClamping(),Ld(this,T$))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(o){let f=this._pixelOffset;Ye.equals(f,o)||(Ye.clone(o,f),Ld(this,$9e))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(o){let f=this._scaleByDistance;sa.equals(f,o)||(this._scaleByDistance=sa.clone(o,f),Ld(this,xTt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(o){let f=this._translucencyByDistance;sa.equals(f,o)||(this._translucencyByDistance=sa.clone(o,f),Ld(this,CTt))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(o){let f=this._pixelOffsetScaleByDistance;sa.equals(f,o)||(this._pixelOffsetScaleByDistance=sa.clone(o,f),Ld(this,bTt))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(o){let f=this._eyeOffset;H.equals(f,o)||(H.clone(o,f),Ld(this,pTt))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(o){this._horizontalOrigin!==o&&(this._horizontalOrigin=o,Ld(this,mTt))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(o){this._verticalOrigin!==o&&(this._verticalOrigin=o,Ld(this,gTt))}},scale:{get:function(){return this._scale},set:function(o){this._scale!==o&&(this._scale=o,Ld(this,_Tt))}},color:{get:function(){return this._color},set:function(o){let f=this._color;Re.equals(f,o)||(Re.clone(o,f),Ld(this,ONe))}},rotation:{get:function(){return this._rotation},set:function(o){this._rotation!==o&&(this._rotation=o,Ld(this,vTt))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(o){let f=this._alignedAxis;H.equals(f,o)||(H.clone(o,f),Ld(this,yTt))}},width:{get:function(){return Z(this._width,this._imageWidth)},set:function(o){this._width!==o&&(this._width=o,Ld(this,S$))}},height:{get:function(){return Z(this._height,this._imageHeight)},set:function(o){this._height!==o&&(this._height=o,Ld(this,S$))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(o){this._sizeInMeters!==o&&(this._sizeInMeters=o,Ld(this,ONe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(o){ia.equals(o,this._distanceDisplayCondition)||(this._distanceDisplayCondition=ia.clone(o,this._distanceDisplayCondition),Ld(this,wTt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(o){this._disableDepthTestDistance!==o&&(this._disableDepthTestDistance=o,Ld(this,ATt))}},id:{get:function(){return this._id},set:function(o){this._id=o,N(this._pickId)&&(this._pickId.object.id=o)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(o){this._pickPrimitive=o,N(this._pickId)&&(this._pickId.object.primitive=o)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageId},set:function(o){N(o)?typeof o=="string"?this.setImage(o,o):o instanceof Jr?this.setImage(o.url,o):N(o.src)?this.setImage(o.src,o):this.setImage(zl(),o):(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=void 0,this._image=void 0,this._imageIndexPromise=void 0,Ld(this,S$))}},ready:{get:function(){return this._imageIndex!==-1}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(o){this._actualClampedPosition=H.clone(o,this._actualClampedPosition),Ld(this,T$)}},clusterShow:{get:function(){return this._clusterShow},set:function(o){this._clusterShow!==o&&(this._clusterShow=o,Ld(this,RNe))}},outlineColor:{get:function(){return this._outlineColor},set:function(o){let f=this._outlineColor;Re.equals(f,o)||(Re.clone(o,f),Ld(this,NNe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(o){this._outlineWidth!==o&&(this._outlineWidth=o,Ld(this,NNe))}}});$u.prototype.getPickId=function(o){return N(this._pickId)||(this._pickId=o.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};$u.prototype._updateClamping=function(){$u._updateClamping(this._billboardCollection,this)};var h7=new Mt,FNe=new H;$u._updateClamping=function(o,f){let m=o._scene;if(!N(m)||!N(m.globe))return;let v=m.globe,y=v.ellipsoid,x=v._surface,C=m.frameState.mode,w=C!==f._mode;if(f._mode=C,(f._heightReference===qn.NONE||w)&&N(f._removeCallbackFunc)&&(f._removeCallbackFunc(),f._removeCallbackFunc=void 0,f._clampedPosition=void 0),f._heightReference===qn.NONE||!N(f._position))return;let A=y.cartesianToCartographic(f._position);if(!N(A)){f._actualClampedPosition=void 0;return}N(f._removeCallbackFunc)&&f._removeCallbackFunc();function E(S){if(f._heightReference===qn.RELATIVE_TO_GROUND)if(f._mode===_i.SCENE3D){let M=y.cartesianToCartographic(S,h7);M.height+=A.height,y.cartographicToCartesian(M,S)}else S.x+=A.height;f._clampedPosition=H.clone(S,f._clampedPosition)}f._removeCallbackFunc=x.updateHeight(A,E),Mt.clone(A,h7);let T=v.getHeight(A);N(T)&&(h7.height=T),y.cartographicToCartesian(h7,FNe),E(FNe)};$u.prototype._loadImage=function(){let o=this._billboardCollection._textureAtlas,f=this._imageId,m=this._image,v=this._imageSubRegion,y,x=this;function C(A){if(x._imageId!==f||x._image!==m||!Xr.equals(x._imageSubRegion,v))return;let E=o.textureCoordinates[A];x._imageWidth=o.texture.width*E.width,x._imageHeight=o.texture.height*E.height,x._imageIndex=A,x._ready=!0,x._image=void 0,x._imageIndexPromise=void 0,Ld(x,S$)}if(N(m)&&(y=o.addImage(f,m)),N(v)&&(y=o.addSubRegion(f,v)),this._imageIndexPromise=y,!N(y))return;let w=o.getImageIndex(f);if(N(w)&&!N(v)){C(w);return}y.then(C).catch(function(A){console.error(`Error loading image for billboard: ${A}`),x._imageIndexPromise=void 0})};$u.prototype.setImage=function(o,f){this._imageId!==o&&(this._imageIndex=-1,this._imageSubRegion=void 0,this._imageId=o,this._image=f,N(this._billboardCollection._textureAtlas)&&this._loadImage())};$u.prototype.setImageSubRegion=function(o,f){this._imageId===o&&Xr.equals(this._imageSubRegion,f)||(this._imageIndex=-1,this._imageId=o,this._imageSubRegion=Xr.clone(f),N(this._billboardCollection._textureAtlas)&&this._loadImage())};$u.prototype._setTranslate=function(o){let f=this._translate;Ye.equals(f,o)||(Ye.clone(o,f),Ld(this,$9e))};$u.prototype._getActualPosition=function(){return N(this._clampedPosition)?this._clampedPosition:this._actualPosition};$u.prototype._setActualPosition=function(o){N(this._clampedPosition)||H.clone(o,this._actualPosition),Ld(this,T$)};var BNe=new Wt;$u._computeActualPosition=function(o,f,m,v){return N(o._clampedPosition)?(m.mode!==o._mode&&o._updateClamping(),o._clampedPosition):m.mode===_i.SCENE3D?f:(Ee.multiplyByPoint(v,f,BNe),nl.computeActualWgs84Position(m,BNe))};var e7e=new H;$u._computeScreenSpacePosition=function(o,f,m,v,y,x){let C=Ee.multiplyByPoint(o,f,e7e),w=nl.wgs84WithEyeOffsetToWindowCoordinates(y,C,m,x);if(N(w))return Ye.add(w,v,w),w};var uQ=new Ye(0,0);$u.prototype.computeScreenSpacePosition=function(o,f){let m=this._billboardCollection;N(f)||(f=new Ye),Ye.clone(this._pixelOffset,uQ),Ye.add(uQ,this._translate,uQ);let v=m.modelMatrix,y=this._position;if(N(this._clampedPosition)&&(y=this._clampedPosition,o.mode!==_i.SCENE3D)){let x=o.mapProjection,C=x.ellipsoid,w=x.unproject(y,h7);y=C.cartographicToCartesian(w,e7e),v=Ee.IDENTITY}return $u._computeScreenSpacePosition(v,y,this._eyeOffset,uQ,o,f)};$u.getScreenSpaceBoundingBox=function(o,f,m){let v=o.width,y=o.height,x=o.scale;v*=x,y*=x;let C=f.x;o.horizontalOrigin===Zc.RIGHT?C-=v:o.horizontalOrigin===Zc.CENTER&&(C-=v*.5);let w=f.y;return o.verticalOrigin===so.BOTTOM||o.verticalOrigin===so.BASELINE?w-=y:o.verticalOrigin===so.CENTER&&(w-=y*.5),N(m)||(m=new Xr),m.x=C,m.y=w,m.width=v,m.height=y,m};$u.prototype.equals=function(o){return this===o||N(o)&&this._id===o._id&&H.equals(this._position,o._position)&&this._imageId===o._imageId&&this._show===o._show&&this._scale===o._scale&&this._verticalOrigin===o._verticalOrigin&&this._horizontalOrigin===o._horizontalOrigin&&this._heightReference===o._heightReference&&Xr.equals(this._imageSubRegion,o._imageSubRegion)&&Re.equals(this._color,o._color)&&Ye.equals(this._pixelOffset,o._pixelOffset)&&Ye.equals(this._translate,o._translate)&&H.equals(this._eyeOffset,o._eyeOffset)&&sa.equals(this._scaleByDistance,o._scaleByDistance)&&sa.equals(this._translucencyByDistance,o._translucencyByDistance)&&sa.equals(this._pixelOffsetScaleByDistance,o._pixelOffsetScaleByDistance)&&ia.equals(this._distanceDisplayCondition,o._distanceDisplayCondition)&&this._disableDepthTestDistance===o._disableDepthTestDistance};$u.prototype._destroy=function(){N(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),N(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var kd=$u,Ds={BYTE:xi.BYTE,UNSIGNED_BYTE:xi.UNSIGNED_BYTE,SHORT:xi.SHORT,UNSIGNED_SHORT:xi.UNSIGNED_SHORT,INT:xi.INT,UNSIGNED_INT:xi.UNSIGNED_INT,FLOAT:xi.FLOAT,DOUBLE:xi.DOUBLE};Ds.getSizeInBytes=function(o){switch(o){case Ds.BYTE:return Int8Array.BYTES_PER_ELEMENT;case Ds.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Ds.SHORT:return Int16Array.BYTES_PER_ELEMENT;case Ds.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Ds.INT:return Int32Array.BYTES_PER_ELEMENT;case Ds.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case Ds.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case Ds.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};Ds.fromTypedArray=function(o){if(o instanceof Int8Array)return Ds.BYTE;if(o instanceof Uint8Array)return Ds.UNSIGNED_BYTE;if(o instanceof Int16Array)return Ds.SHORT;if(o instanceof Uint16Array)return Ds.UNSIGNED_SHORT;if(o instanceof Int32Array)return Ds.INT;if(o instanceof Uint32Array)return Ds.UNSIGNED_INT;if(o instanceof Float32Array)return Ds.FLOAT;if(o instanceof Float64Array)return Ds.DOUBLE};Ds.validate=function(o){return N(o)&&(o===Ds.BYTE||o===Ds.UNSIGNED_BYTE||o===Ds.SHORT||o===Ds.UNSIGNED_SHORT||o===Ds.INT||o===Ds.UNSIGNED_INT||o===Ds.FLOAT||o===Ds.DOUBLE)};Ds.createTypedArray=function(o,f){switch(o){case Ds.BYTE:return new Int8Array(f);case Ds.UNSIGNED_BYTE:return new Uint8Array(f);case Ds.SHORT:return new Int16Array(f);case Ds.UNSIGNED_SHORT:return new Uint16Array(f);case Ds.INT:return new Int32Array(f);case Ds.UNSIGNED_INT:return new Uint32Array(f);case Ds.FLOAT:return new Float32Array(f);case Ds.DOUBLE:return new Float64Array(f)}};Ds.createArrayBufferView=function(o,f,m,v){switch(m=Z(m,0),v=Z(v,(f.byteLength-m)/Ds.getSizeInBytes(o)),o){case Ds.BYTE:return new Int8Array(f,m,v);case Ds.UNSIGNED_BYTE:return new Uint8Array(f,m,v);case Ds.SHORT:return new Int16Array(f,m,v);case Ds.UNSIGNED_SHORT:return new Uint16Array(f,m,v);case Ds.INT:return new Int32Array(f,m,v);case Ds.UNSIGNED_INT:return new Uint32Array(f,m,v);case Ds.FLOAT:return new Float32Array(f,m,v);case Ds.DOUBLE:return new Float64Array(f,m,v)}};Ds.fromName=function(o){switch(o){case"BYTE":return Ds.BYTE;case"UNSIGNED_BYTE":return Ds.UNSIGNED_BYTE;case"SHORT":return Ds.SHORT;case"UNSIGNED_SHORT":return Ds.UNSIGNED_SHORT;case"INT":return Ds.INT;case"UNSIGNED_INT":return Ds.UNSIGNED_INT;case"FLOAT":return Ds.FLOAT;case"DOUBLE":return Ds.DOUBLE}};var Rt=Object.freeze(Ds),Qc={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Qc.getMathType=function(o){switch(o){case Qc.SCALAR:return Number;case Qc.VEC2:return Ye;case Qc.VEC3:return H;case Qc.VEC4:return Wt;case Qc.MAT2:return im;case Qc.MAT3:return Ut;case Qc.MAT4:return Ee}};Qc.getNumberOfComponents=function(o){switch(o){case Qc.SCALAR:return 1;case Qc.VEC2:return 2;case Qc.VEC3:return 3;case Qc.VEC4:case Qc.MAT2:return 4;case Qc.MAT3:return 9;case Qc.MAT4:return 16}};Qc.getAttributeLocationCount=function(o){switch(o){case Qc.SCALAR:case Qc.VEC2:case Qc.VEC3:case Qc.VEC4:return 1;case Qc.MAT2:return 2;case Qc.MAT3:return 3;case Qc.MAT4:return 4}};Qc.getGlslType=function(o){switch(o){case Qc.SCALAR:return"float";case Qc.VEC2:return"vec2";case Qc.VEC3:return"vec3";case Qc.VEC4:return"vec4";case Qc.MAT2:return"mat2";case Qc.MAT3:return"mat3";case Qc.MAT4:return"mat4"}};var Ks=Object.freeze(Qc),kNe=1/256,VNe=256,Vh={};Vh.octEncodeInRange=function(o,f,m){if(m.x=o.x/(Math.abs(o.x)+Math.abs(o.y)+Math.abs(o.z)),m.y=o.y/(Math.abs(o.x)+Math.abs(o.y)+Math.abs(o.z)),o.z<0){let v=m.x,y=m.y;m.x=(1-Math.abs(y))*xe.signNotZero(v),m.y=(1-Math.abs(v))*xe.signNotZero(y)}return m.x=xe.toSNorm(m.x,f),m.y=xe.toSNorm(m.y,f),m};Vh.octEncode=function(o,f){return Vh.octEncodeInRange(o,255,f)};var u9=new Ye,zNe=new Uint8Array(1);function cQ(o){return zNe[0]=o,zNe[0]}Vh.octEncodeToCartesian4=function(o,f){return Vh.octEncodeInRange(o,65535,u9),f.x=cQ(u9.x*kNe),f.y=cQ(u9.x),f.z=cQ(u9.y*kNe),f.w=cQ(u9.y),f};Vh.octDecodeInRange=function(o,f,m,v){if(v.x=xe.fromSNorm(o,m),v.y=xe.fromSNorm(f,m),v.z=1-(Math.abs(v.x)+Math.abs(v.y)),v.z<0){let y=v.x;v.x=(1-Math.abs(v.y))*xe.signNotZero(y),v.y=(1-Math.abs(y))*xe.signNotZero(v.y)}return H.normalize(v,v)};Vh.octDecode=function(o,f,m){return Vh.octDecodeInRange(o,f,255,m)};Vh.octDecodeFromCartesian4=function(o,f){let m=o.x,v=o.y,y=o.z,x=o.w,C=m*VNe+v,w=y*VNe+x;return Vh.octDecodeInRange(C,w,65535,f)};Vh.octPackFloat=function(o){return 256*o.x+o.y};var ome=new Ye;Vh.octEncodeFloat=function(o){return Vh.octEncode(o,ome),Vh.octPackFloat(ome)};Vh.octDecodeFloat=function(o,f){let m=o/256,v=Math.floor(m),y=(m-v)*256;return Vh.octDecode(v,y,f)};Vh.octPack=function(o,f,m,v){let y=Vh.octEncodeFloat(o),x=Vh.octEncodeFloat(f),C=Vh.octEncode(m,ome);return v.x=65536*C.x+y,v.y=65536*C.y+x,v};Vh.octUnpack=function(o,f,m,v){let y=o.x/65536,x=Math.floor(y),C=(y-x)*65536;y=o.y/65536;let w=Math.floor(y),A=(y-w)*65536;Vh.octDecodeFloat(C,f),Vh.octDecodeFloat(A,m),Vh.octDecode(x,w,v)};Vh.compressTextureCoordinates=function(o){let f=o.x*4095|0,m=o.y*4095|0;return 4096*f+m};Vh.decompressTextureCoordinates=function(o,f){let m=o/4096,v=Math.floor(m);return f.x=v/4095,f.y=(o-v*4096)/4095,f};function rhe(o){return o>>1^-(o&1)}Vh.zigZagDeltaDecode=function(o,f,m){let v=o.length,y=0,x=0,C=0;for(let w=0;w>11,T=A>>5&y,S=A&v,M=3*w;f[M]=E*x,f[M+1]=T*C,f[M+2]=S*x}return f};var Ku=Vh;function ZS(){this.high=H.clone(H.ZERO),this.low=H.clone(H.ZERO)}ZS.encode=function(o,f){N(f)||(f={high:0,low:0});let m;return o>=0?(m=Math.floor(o/65536)*65536,f.high=m,f.low=o-m):(m=Math.floor(-o/65536)*65536,f.high=-m,f.low=o+m),f};var MI={high:0,low:0};ZS.fromCartesian=function(o,f){N(f)||(f=new ZS);let m=f.high,v=f.low;return ZS.encode(o.x,MI),m.x=MI.high,v.x=MI.low,ZS.encode(o.y,MI),m.y=MI.high,v.y=MI.low,ZS.encode(o.z,MI),m.z=MI.high,v.z=MI.low,f};var nhe=new ZS;ZS.writeElements=function(o,f,m){ZS.fromCartesian(o,nhe);let v=nhe.high,y=nhe.low;f[m]=v.x,f[m+1]=v.y,f[m+2]=v.z,f[m+3]=y.x,f[m+4]=y.y,f[m+5]=y.z};var Qu=ZS,zg={UNSIGNED_BYTE:xi.UNSIGNED_BYTE,UNSIGNED_SHORT:xi.UNSIGNED_SHORT,UNSIGNED_INT:xi.UNSIGNED_INT};zg.getSizeInBytes=function(o){switch(o){case zg.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case zg.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case zg.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};zg.fromSizeInBytes=function(o){switch(o){case 2:return zg.UNSIGNED_SHORT;case 4:return zg.UNSIGNED_INT;case 1:return zg.UNSIGNED_BYTE}};zg.validate=function(o){return N(o)&&(o===zg.UNSIGNED_BYTE||o===zg.UNSIGNED_SHORT||o===zg.UNSIGNED_INT)};zg.createTypedArray=function(o,f){return o>=xe.SIXTY_FOUR_KILOBYTES?new Uint32Array(f):new Uint16Array(f)};zg.createTypedArrayFromArrayBuffer=function(o,f,m,v){return o>=xe.SIXTY_FOUR_KILOBYTES?new Uint32Array(f,m,v):new Uint16Array(f,m,v)};zg.fromTypedArray=function(o){if(o instanceof Uint8Array)return zg.UNSIGNED_BYTE;if(o instanceof Uint16Array)return zg.UNSIGNED_SHORT;if(o instanceof Uint32Array)return zg.UNSIGNED_INT};var ro=Object.freeze(zg),P$={STREAM_DRAW:xi.STREAM_DRAW,STATIC_DRAW:xi.STATIC_DRAW,DYNAMIC_DRAW:xi.DYNAMIC_DRAW,validate:function(o){return o===P$.STREAM_DRAW||o===P$.STATIC_DRAW||o===P$.DYNAMIC_DRAW}},gn=Object.freeze(P$);function Nw(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.context._gl,m=o.bufferTarget,v=o.typedArray,y=o.sizeInBytes,x=o.usage,C=N(v);C&&(y=v.byteLength);let w=f.createBuffer();f.bindBuffer(m,w),f.bufferData(m,C?v:y,x),f.bindBuffer(m,null),this._id=zl(),this._gl=f,this._webgl2=o.context._webgl2,this._bufferTarget=m,this._sizeInBytes=y,this._usage=x,this._buffer=w,this.vertexArrayDestroyable=!0}Nw.createVertexBuffer=function(o){return new Nw({context:o.context,bufferTarget:xi.ARRAY_BUFFER,typedArray:o.typedArray,sizeInBytes:o.sizeInBytes,usage:o.usage})};Nw.createIndexBuffer=function(o){let f=o.context,m=o.indexDatatype,v=ro.getSizeInBytes(m),y=new Nw({context:f,bufferTarget:xi.ELEMENT_ARRAY_BUFFER,typedArray:o.typedArray,sizeInBytes:o.sizeInBytes,usage:o.usage}),x=y.sizeInBytes/v;return Object.defineProperties(y,{indexDatatype:{get:function(){return m}},bytesPerIndex:{get:function(){return v}},numberOfIndices:{get:function(){return x}}}),y};Object.defineProperties(Nw.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Nw.prototype._getBuffer=function(){return this._buffer};Nw.prototype.copyFromArrayView=function(o,f){f=Z(f,0);let m=this._gl,v=this._bufferTarget;m.bindBuffer(v,this._buffer),m.bufferSubData(v,f,o),m.bindBuffer(v,null)};Nw.prototype.copyFromBuffer=function(o,f,m,v){let y=xi.COPY_READ_BUFFER,x=xi.COPY_WRITE_BUFFER,C=this._gl;C.bindBuffer(x,this._buffer),C.bindBuffer(y,o._buffer),C.copyBufferSubData(y,x,f,m,v),C.bindBuffer(x,null),C.bindBuffer(y,null)};Nw.prototype.getBufferData=function(o,f,m,v){f=Z(f,0),m=Z(m,0);let y=this._gl,x=xi.COPY_READ_BUFFER;y.bindBuffer(x,this._buffer),y.getBufferSubData(x,f,o,m,v),y.bindBuffer(x,null)};Nw.prototype.isDestroyed=function(){return!1};Nw.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),kr(this)};var Ao=Nw,m_={POINTS:xi.POINTS,LINES:xi.LINES,LINE_LOOP:xi.LINE_LOOP,LINE_STRIP:xi.LINE_STRIP,TRIANGLES:xi.TRIANGLES,TRIANGLE_STRIP:xi.TRIANGLE_STRIP,TRIANGLE_FAN:xi.TRIANGLE_FAN};m_.isLines=function(o){return o===m_.LINES||o===m_.LINE_LOOP||o===m_.LINE_STRIP};m_.isTriangles=function(o){return o===m_.TRIANGLES||o===m_.TRIANGLE_STRIP||o===m_.TRIANGLE_FAN};m_.validate=function(o){return o===m_.POINTS||o===m_.LINES||o===m_.LINE_LOOP||o===m_.LINE_STRIP||o===m_.TRIANGLES||o===m_.TRIANGLE_STRIP||o===m_.TRIANGLE_FAN};var Fn=Object.freeze(m_),Kf={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function AW(o){o=Z(o,Z.EMPTY_OBJECT),this._boundingVolume=o.boundingVolume,this._orientedBoundingBox=o.orientedBoundingBox,this._modelMatrix=o.modelMatrix,this._primitiveType=Z(o.primitiveType,Fn.TRIANGLES),this._vertexArray=o.vertexArray,this._count=o.count,this._offset=Z(o.offset,0),this._instanceCount=Z(o.instanceCount,0),this._shaderProgram=o.shaderProgram,this._uniformMap=o.uniformMap,this._renderState=o.renderState,this._framebuffer=o.framebuffer,this._pass=o.pass,this._owner=o.owner,this._debugOverlappingFrustums=0,this._pickId=o.pickId,this._flags=0,this.cull=Z(o.cull,!0),this.occlude=Z(o.occlude,!0),this.executeInClosestFrustum=Z(o.executeInClosestFrustum,!1),this.debugShowBoundingVolume=Z(o.debugShowBoundingVolume,!1),this.castShadows=Z(o.castShadows,!1),this.receiveShadows=Z(o.receiveShadows,!1),this._receiveTextureProjectionList=Z(o.receiveTextureProjectionList,[]),this._receiveViewShed=Z(o.receiveViewShed,!1),this.pickOnly=Z(o.pickOnly,!1),this.depthForTranslucentClassification=Z(o.depthForTranslucentClassification,!1),this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={},this._customType=o.customType||-1}function cv(o,f){return(o._flags&f)===f}function KL(o,f,m){m?o._flags|=f:o._flags&=~f}Object.defineProperties(AW.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(o){this._boundingVolume!==o&&(this._boundingVolume=o,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(o){this._orientedBoundingBox!==o&&(this._orientedBoundingBox=o,this.dirty=!0)}},cull:{get:function(){return this._customType===-1?cv(this,Kf.CULL):!1},set:function(o){cv(this,Kf.CULL)!==o&&(KL(this,Kf.CULL,o),this.dirty=!0)}},occlude:{get:function(){return cv(this,Kf.OCCLUDE)},set:function(o){cv(this,Kf.OCCLUDE)!==o&&(KL(this,Kf.OCCLUDE,o),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(o){this._modelMatrix!==o&&(this._modelMatrix=o,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(o){this._primitiveType!==o&&(this._primitiveType=o,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(o){this._vertexArray!==o&&(this._vertexArray=o,this.dirty=!0)}},count:{get:function(){return this._count},set:function(o){this._count!==o&&(this._count=o,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(o){this._offset!==o&&(this._offset=o,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(o){this._instanceCount!==o&&(this._instanceCount=o,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(o){this._shaderProgram!==o&&(this._shaderProgram=o,this.dirty=!0)}},castShadows:{get:function(){return cv(this,Kf.CAST_SHADOWS)},set:function(o){cv(this,Kf.CAST_SHADOWS)!==o&&(KL(this,Kf.CAST_SHADOWS,o),this.dirty=!0)}},receiveShadows:{get:function(){return cv(this,Kf.RECEIVE_SHADOWS)},set:function(o){cv(this,Kf.RECEIVE_SHADOWS)!==o&&(KL(this,Kf.RECEIVE_SHADOWS,o),this.dirty=!0)}},receiveTextureProjectionList:{get:function(){return this._receiveTextureProjectionList},set:function(o){this._receiveTextureProjectionList!==o&&(this._receiveTextureProjectionList=o,this.dirty=!0)}},receiveViewShed:{get:function(){return this._receiveViewShed},set:function(o){this._receiveViewShed!==o&&(this._receiveViewShed=o,this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(o){this._uniformMap!==o&&(this._uniformMap=o,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(o){this._renderState!==o&&(this._renderState=o,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(o){this._framebuffer!==o&&(this._framebuffer=o,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(o){this._pass!==o&&(this._pass=o,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return cv(this,Kf.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(o){cv(this,Kf.EXECUTE_IN_CLOSEST_FRUSTUM)!==o&&(KL(this,Kf.EXECUTE_IN_CLOSEST_FRUSTUM,o),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(o){this._owner!==o&&(this._owner=o,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return cv(this,Kf.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(o){cv(this,Kf.DEBUG_SHOW_BOUNDING_VOLUME)!==o&&(KL(this,Kf.DEBUG_SHOW_BOUNDING_VOLUME,o),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(o){this._debugOverlappingFrustums!==o&&(this._debugOverlappingFrustums=o,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(o){this._pickId!==o&&(this._pickId=o,this.dirty=!0)}},pickOnly:{get:function(){return cv(this,Kf.PICK_ONLY)},set:function(o){cv(this,Kf.PICK_ONLY)!==o&&(KL(this,Kf.PICK_ONLY,o),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return cv(this,Kf.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(o){cv(this,Kf.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==o&&(KL(this,Kf.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,o),this.dirty=!0)}}});AW.shallowClone=function(o,f){if(N(o))return N(f)||(f=new AW),f._boundingVolume=o._boundingVolume,f._orientedBoundingBox=o._orientedBoundingBox,f._modelMatrix=o._modelMatrix,f._primitiveType=o._primitiveType,f._vertexArray=o._vertexArray,f._count=o._count,f._offset=o._offset,f._instanceCount=o._instanceCount,f._shaderProgram=o._shaderProgram,f._uniformMap=o._uniformMap,f._renderState=o._renderState,f._framebuffer=o._framebuffer,f._pass=o._pass,f._owner=o._owner,f._debugOverlappingFrustums=o._debugOverlappingFrustums,f._pickId=o._pickId,f._flags=o._flags,f._customType=o._customType,f._receiveTextureProjectionList=o._receiveTextureProjectionList,f._receiveViewShed=o._receiveViewShed,f.dirty=!0,f.lastDirtyTime=0,f};AW.prototype.execute=function(o,f){o.draw(this,f)};var Jn=AW,ETt={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},vr=Object.freeze(ETt),I$={CLOCKWISE:xi.CW,COUNTER_CLOCKWISE:xi.CCW};I$.validate=function(o){return o===I$.CLOCKWISE||o===I$.COUNTER_CLOCKWISE};var K1=Object.freeze(I$);function t7e(o){if(typeof o!="object"||o===null)return o;let f,m=Object.keys(o);for(let v=0;v0&&console.log(`${kS}Vertex shader compile log: ${A}`),A=o.getShaderInfoLog(x),N(A)&&A.length>0&&console.log(`${kS}Fragment shader compile log: ${A}`),A=o.getProgramInfoLog(C),N(A)&&A.length>0&&console.log(`${kS}Shader program link log: ${A}`)),o.deleteShader(y),o.deleteShader(x),C;let E,T=f._debugShaders;throw o.getShaderParameter(x,o.COMPILE_STATUS)?o.getShaderParameter(y,o.COMPILE_STATUS)?(A=o.getProgramInfoLog(C),console.error(`${kS}Shader program link log: ${A}`),S(y,"vertex"),S(x,"fragment"),E=`Program failed to link. Link log: ${A}`):(A=o.getShaderInfoLog(y),console.error(`${kS}Vertex shader compile log: ${A}`),console.error(`${kS} Vertex shader source: ${m}`),E=`Vertex shader failed to compile. Compile log: ${A}`):(A=o.getShaderInfoLog(x),console.error(`${kS}Fragment shader compile log: ${A}`),console.error(`${kS} Fragment shader source: ${v}`),E=`Fragment shader failed to compile. Compile log: ${A}`),o.deleteShader(y),o.deleteShader(x),o.deleteProgram(C),new sr(E);function S(M,I){if(!N(T))return;let P=T.getTranslatedShaderSource(M);if(P===""){console.error(`${kS}${I} shader translation failed.`);return}console.error(`${kS}Translated ${I} shaderSource: ${P}`)}}function zTt(o,f,m){let v={};for(let y=0;y=0){if(T=m[E.slice(0,P)],!N(T))continue;S=T._locations,S.length<=1&&(M=T.value,I=o.getUniformLocation(f,E),I!==null&&(S.push(I),M.push(o.getUniform(f,I))))}else{S=[];for(let D=0;D1/pi. * * @alias czm_oneOverPi * @glslConstant * * @see CesiumMath.ONE_OVER_PI * * @example * // GLSL declaration * const float czm_oneOverPi = ...; * * // Example * float pi = 1.0 / czm_oneOverPi; */ const float czm_oneOverPi = 0.3183098861837907; `,ive=`/** * A built-in GLSL floating-point constant for 1/2pi. * * @alias czm_oneOverTwoPi * @glslConstant * * @see CesiumMath.ONE_OVER_TWO_PI * * @example * // GLSL declaration * const float czm_oneOverTwoPi = ...; * * // Example * float pi = 2.0 * czm_oneOverTwoPi; */ const float czm_oneOverTwoPi = 0.15915494309189535; `,rve=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE} * * @name czm_passCesium3DTile * @glslConstant * * @see czm_pass */ const float czm_passCesium3DTile = 4.0; `,nve=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION} * * @name czm_passCesium3DTileClassification * @glslConstant * * @see czm_pass */ const float czm_passCesium3DTileClassification = 5.0; `,ove=`/** * The automatic GLSL constant for {@link Pass#CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW} * * @name czm_passCesium3DTileClassificationIgnoreShow * @glslConstant * * @see czm_pass */ const float czm_passCesium3DTileClassificationIgnoreShow = 6.0; `,ave=`/** * The automatic GLSL constant for {@link Pass#CLASSIFICATION} * * @name czm_passClassification * @glslConstant * * @see czm_pass */ const float czm_passClassification = 7.0; `,sve=`/** * The automatic GLSL constant for {@link Pass#COMPUTE} * * @name czm_passCompute * @glslConstant * * @see czm_pass */ const float czm_passCompute = 1.0; `,lve=`/** * The automatic GLSL constant for {@link Pass#ENVIRONMENT} * * @name czm_passEnvironment * @glslConstant * * @see czm_pass */ const float czm_passEnvironment = 0.0; `,uve=`/** * The automatic GLSL constant for {@link Pass#GLOBE} * * @name czm_passGlobe * @glslConstant * * @see czm_pass */ const float czm_passGlobe = 2.0; `,cve=`/** * The automatic GLSL constant for {@link Pass#OPAQUE} * * @name czm_passOpaque * @glslConstant * * @see czm_pass */ const float czm_passOpaque = 7.0; `,hve=`/** * The automatic GLSL constant for {@link Pass#OVERLAY} * * @name czm_passOverlay * @glslConstant * * @see czm_pass */ const float czm_passOverlay = 10.0; `,dve=`/** * The automatic GLSL constant for {@link Pass#TERRAIN_CLASSIFICATION} * * @name czm_passTerrainClassification * @glslConstant * * @see czm_pass */ const float czm_passTerrainClassification = 3.0; `,fve=`/** * The automatic GLSL constant for {@link Pass#TRANSLUCENT} * * @name czm_passTranslucent * @glslConstant * * @see czm_pass */ const float czm_passTranslucent = 8.0; `,pve=`/** * The automatic GLSL constant for {@link Pass#VOXELS} * * @name czm_passVoxels * @glslConstant * * @see czm_pass */ const float czm_passVoxels = 9.0; `,mve=`/** * A built-in GLSL floating-point constant for Math.PI. * * @alias czm_pi * @glslConstant * * @see CesiumMath.PI * * @example * // GLSL declaration * const float czm_pi = ...; * * // Example * float twoPi = 2.0 * czm_pi; */ const float czm_pi = 3.141592653589793; `,gve=`/** * A built-in GLSL floating-point constant for pi/4. * * @alias czm_piOverFour * @glslConstant * * @see CesiumMath.PI_OVER_FOUR * * @example * // GLSL declaration * const float czm_piOverFour = ...; * * // Example * float pi = 4.0 * czm_piOverFour; */ const float czm_piOverFour = 0.7853981633974483; `,_ve=`/** * A built-in GLSL floating-point constant for pi/6. * * @alias czm_piOverSix * @glslConstant * * @see CesiumMath.PI_OVER_SIX * * @example * // GLSL declaration * const float czm_piOverSix = ...; * * // Example * float pi = 6.0 * czm_piOverSix; */ const float czm_piOverSix = 0.5235987755982988; `,vve=`/** * A built-in GLSL floating-point constant for pi/3. * * @alias czm_piOverThree * @glslConstant * * @see CesiumMath.PI_OVER_THREE * * @example * // GLSL declaration * const float czm_piOverThree = ...; * * // Example * float pi = 3.0 * czm_piOverThree; */ const float czm_piOverThree = 1.0471975511965976; `,yve=`/** * A built-in GLSL floating-point constant for pi/2. * * @alias czm_piOverTwo * @glslConstant * * @see CesiumMath.PI_OVER_TWO * * @example * // GLSL declaration * const float czm_piOverTwo = ...; * * // Example * float pi = 2.0 * czm_piOverTwo; */ const float czm_piOverTwo = 1.5707963267948966; `,xve=`/** * A built-in GLSL floating-point constant for converting degrees to radians. * * @alias czm_radiansPerDegree * @glslConstant * * @see CesiumMath.RADIANS_PER_DEGREE * * @example * // GLSL declaration * const float czm_radiansPerDegree = ...; * * // Example * float rad = czm_radiansPerDegree * deg; */ const float czm_radiansPerDegree = 0.017453292519943295; `,Cve=`/** * The constant identifier for the 2D {@link SceneMode} * * @name czm_sceneMode2D * @glslConstant * @see czm_sceneMode * @see czm_sceneModeColumbusView * @see czm_sceneMode3D * @see czm_sceneModeMorphing */ const float czm_sceneMode2D = 2.0; `,bve=`/** * The constant identifier for the 3D {@link SceneMode} * * @name czm_sceneMode3D * @glslConstant * @see czm_sceneMode * @see czm_sceneMode2D * @see czm_sceneModeColumbusView * @see czm_sceneModeMorphing */ const float czm_sceneMode3D = 3.0; `,wve=`/** * The constant identifier for the Columbus View {@link SceneMode} * * @name czm_sceneModeColumbusView * @glslConstant * @see czm_sceneMode * @see czm_sceneMode2D * @see czm_sceneMode3D * @see czm_sceneModeMorphing */ const float czm_sceneModeColumbusView = 1.0; `,Ave=`/** * The constant identifier for the Morphing {@link SceneMode} * * @name czm_sceneModeMorphing * @glslConstant * @see czm_sceneMode * @see czm_sceneMode2D * @see czm_sceneModeColumbusView * @see czm_sceneMode3D */ const float czm_sceneModeMorphing = 0.0; `,Eve=`/** * A built-in GLSL floating-point constant for one solar radius. * * @alias czm_solarRadius * @glslConstant * * @see CesiumMath.SOLAR_RADIUS * * @example * // GLSL declaration * const float czm_solarRadius = ...; */ const float czm_solarRadius = 695500000.0; `,Tve=`/** * A built-in GLSL floating-point constant for 3pi/2. * * @alias czm_threePiOver2 * @glslConstant * * @see CesiumMath.THREE_PI_OVER_TWO * * @example * // GLSL declaration * const float czm_threePiOver2 = ...; * * // Example * float pi = (2.0 / 3.0) * czm_threePiOver2; */ const float czm_threePiOver2 = 4.71238898038469; `,Sve=`/** * A built-in GLSL floating-point constant for 2pi. * * @alias czm_twoPi * @glslConstant * * @see CesiumMath.TWO_PI * * @example * // GLSL declaration * const float czm_twoPi = ...; * * // Example * float pi = czm_twoPi / 2.0; */ const float czm_twoPi = 6.283185307179586; `,Pve=`/** * The maximum latitude, in radians, both North and South, supported by a Web Mercator * (EPSG:3857) projection. Technically, the Mercator projection is defined * for any latitude up to (but not including) 90 degrees, but it makes sense * to cut it off sooner because it grows exponentially with increasing latitude. * The logic behind this particular cutoff value, which is the one used by * Google Maps, Bing Maps, and Esri, is that it makes the projection * square. That is, the rectangle is equal in the X and Y directions. * * The constant value is computed as follows: * czm_pi * 0.5 - (2.0 * atan(exp(-czm_pi))) * * @name czm_webMercatorMaxLatitude * @glslConstant */ const float czm_webMercatorMaxLatitude = 1.4844222297453324; `,Ive=`/** * @name czm_depthRangeStruct * @glslStruct */ struct czm_depthRangeStruct { float near; float far; }; `,Mve=`/** * Holds material information that can be used for lighting. Returned by all czm_getMaterial functions. * * @name czm_material * @glslStruct * * @property {vec3} diffuse Incoming light that scatters evenly in all directions. * @property {float} specular Intensity of incoming light reflecting in a single direction. * @property {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. * @property {vec3} normal Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. * @property {vec3} emission Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. */ struct czm_material { vec3 diffuse; float specular; float shininess; vec3 normal; vec3 emission; float alpha; }; `,Dve=`/** * Used as input to every material's czm_getMaterial function. * * @name czm_materialInput * @glslStruct * * @property {float} s 1D texture coordinates. * @property {vec2} st 2D texture coordinates. * @property {vec3} str 3D texture coordinates. * @property {vec3} normalEC Unperturbed surface normal in eye coordinates. * @property {mat3} tangentToEyeMatrix Matrix for converting a tangent space normal to eye space. * @property {vec3} positionToEyeEC Vector from the fragment to the eye in eye coordinates. The magnitude is the distance in meters from the fragment to the eye. * @property {float} height The height of the terrain in meters above or below the WGS84 ellipsoid. Only available for globe materials. * @property {float} slope The slope of the terrain in radians. 0 is flat; pi/2 is vertical. Only available for globe materials. * @property {float} aspect The aspect of the terrain in radians. 0 is East, pi/2 is North, pi is West, 3pi/2 is South. Only available for globe materials. */ struct czm_materialInput { float s; vec2 st; vec3 str; vec3 normalEC; mat3 tangentToEyeMatrix; vec3 positionToEyeEC; float height; float slope; float aspect; }; `,Lve=`/** * Struct for representing a material for a {@link Model}. The model * rendering pipeline will pass this struct between material, custom shaders, * and lighting stages. This is not to be confused with {@link czm_material} * which is used by the older Fabric materials system, although they are similar. *

* All color values (diffuse, specular, emissive) are in linear color space. *

* * @name czm_modelMaterial * @glslStruct * * @property {vec3} diffuse Incoming light that scatters evenly in all directions. * @property {float} alpha Alpha of this material. 0.0 is completely transparent; 1.0 is completely opaque. * @property {vec3} specular Color of reflected light at normal incidence in PBR materials. This is sometimes referred to as f0 in the literature. * @property {float} roughness A number from 0.0 to 1.0 representing how rough the surface is. Values near 0.0 produce glossy surfaces, while values near 1.0 produce rough surfaces. * @property {vec3} normalEC Surface's normal in eye coordinates. It is used for effects such as normal mapping. The default is the surface's unmodified normal. * @property {float} occlusion Ambient occlusion recieved at this point on the material. 1.0 means fully lit, 0.0 means fully occluded. * @property {vec3} emissive Light emitted by the material equally in all directions. The default is vec3(0.0), which emits no light. */ struct czm_modelMaterial { vec3 diffuse; float alpha; vec3 specular; float roughness; vec3 normalEC; float occlusion; vec3 emissive; }; `,Rve=`/** * Struct for representing the output of a custom vertex shader. * * @name czm_modelVertexOutput * @glslStruct * * @see {@link CustomShader} * @see {@link Model} * * @property {vec3} positionMC The position of the vertex in model coordinates * @property {float} pointSize A custom value for gl_PointSize. This is only used for point primitives. */ struct czm_modelVertexOutput { vec3 positionMC; float pointSize; }; `,Ove=`/** * Parameters for {@link czm_pbrLighting} * * @name czm_material * @glslStruct * * @property {vec3} diffuseColor the diffuse color of the material for the lambert term of the rendering equation * @property {float} roughness a value from 0.0 to 1.0 that indicates how rough the surface of the material is. * @property {vec3} f0 The reflectance of the material at normal incidence */ struct czm_pbrParameters { vec3 diffuseColor; float roughness; vec3 f0; }; `,Nve=`/** * DOC_TBA * * @name czm_ray * @glslStruct */ struct czm_ray { vec3 origin; vec3 direction; }; `,Fve=`/** * DOC_TBA * * @name czm_raySegment * @glslStruct */ struct czm_raySegment { float start; float stop; }; /** * DOC_TBA * * @name czm_emptyRaySegment * @glslConstant */ const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity); /** * DOC_TBA * * @name czm_fullRaySegment * @glslConstant */ const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity); `,Bve=`struct czm_shadowParameters { #ifdef USE_CUBE_MAP_SHADOW vec3 texCoords; #else vec2 texCoords; #endif float depthBias; float depth; float nDotL; vec2 texelStepSize; float normalShadingSmooth; float darkness; }; `,kve=`// See: // https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/ vec3 czm_acesTonemapping(vec3 color) { float g = 0.985; float a = 0.065; float b = 0.0001; float c = 0.433; float d = 0.238; color = (color * (color + a) - b) / (color * (g * color + c) + d); color = clamp(color, 0.0, 1.0); return color; } `,Vve=`/** * @private */ float czm_alphaWeight(float a) { float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; // See Weighted Blended Order-Independent Transparency for examples of different weighting functions: // http://jcgt.org/published/0002/02/09/ return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0)))); } `,zve=`/** * Procedural anti-aliasing by blurring two colors that meet at a sharp edge. * * @name czm_antialias * @glslFunction * * @param {vec4} color1 The color on one side of the edge. * @param {vec4} color2 The color on the other side of the edge. * @param {vec4} currentcolor The current color, either color1 or color2. * @param {float} dist The distance to the edge in texture coordinates. * @param {float} [fuzzFactor=0.1] Controls the blurriness between the two colors. * @returns {vec4} The anti-aliased color. * * @example * // GLSL declarations * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor); * vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist); * * // get the color for a material that has a sharp edge at the line y = 0.5 in texture space * float dist = abs(textureCoordinates.t - 0.5); * vec4 currentColor = mix(bottomColor, topColor, step(0.5, textureCoordinates.t)); * vec4 color = czm_antialias(bottomColor, topColor, currentColor, dist, 0.1); */ vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor) { float val1 = clamp(dist / fuzzFactor, 0.0, 1.0); float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0); val1 = val1 * (1.0 - val2); val1 = val1 * val1 * (3.0 - (2.0 * val1)); val1 = pow(val1, 0.5); //makes the transition nicer vec4 midColor = (color1 + color2) * 0.5; return mix(midColor, currentColor, val1); } vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist) { return czm_antialias(color1, color2, currentColor, dist, 0.1); } `,Hve=`/** * Approximately computes spherical coordinates given a normal. * Uses approximate inverse trigonometry for speed and consistency, * since inverse trigonometry can differ from vendor-to-vendor and when compared with the CPU. * * @name czm_approximateSphericalCoordinates * @glslFunction * * @param {vec3} normal arbitrary-length normal. * * @returns {vec2} Approximate latitude and longitude spherical coordinates. */ vec2 czm_approximateSphericalCoordinates(vec3 normal) { // Project into plane with vertical for latitude float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z); float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y); return vec2(latitudeApproximation, longitudeApproximation); } `,Uve=`/** * Determines if the fragment is back facing * * @name czm_backFacing * @glslFunction * * @returns {bool} true if the fragment is back facing; otherwise, false. */ bool czm_backFacing() { // !gl_FrontFacing doesn't work as expected on Mac/Intel so use the more verbose form instead. See https://github.com/CesiumGS/cesium/pull/8494. return gl_FrontFacing == false; } `,Gve=`/** * Branchless ternary operator to be used when it's inexpensive to explicitly * evaluate both possibilities for a float expression. * * @name czm_branchFreeTernary * @glslFunction * * @param {bool} comparison A comparison statement * @param {float} a Value to return if the comparison is true. * @param {float} b Value to return if the comparison is false. * * @returns {float} equivalent of comparison ? a : b */ float czm_branchFreeTernary(bool comparison, float a, float b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } /** * Branchless ternary operator to be used when it's inexpensive to explicitly * evaluate both possibilities for a vec2 expression. * * @name czm_branchFreeTernary * @glslFunction * * @param {bool} comparison A comparison statement * @param {vec2} a Value to return if the comparison is true. * @param {vec2} b Value to return if the comparison is false. * * @returns {vec2} equivalent of comparison ? a : b */ vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } /** * Branchless ternary operator to be used when it's inexpensive to explicitly * evaluate both possibilities for a vec3 expression. * * @name czm_branchFreeTernary * @glslFunction * * @param {bool} comparison A comparison statement * @param {vec3} a Value to return if the comparison is true. * @param {vec3} b Value to return if the comparison is false. * * @returns {vec3} equivalent of comparison ? a : b */ vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } /** * Branchless ternary operator to be used when it's inexpensive to explicitly * evaluate both possibilities for a vec4 expression. * * @name czm_branchFreeTernary * @glslFunction * * @param {bool} comparison A comparison statement * @param {vec3} a Value to return if the comparison is true. * @param {vec3} b Value to return if the comparison is false. * * @returns {vec3} equivalent of comparison ? a : b */ vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) { float useA = float(comparison); return a * useA + b * (1.0 - useA); } `,Wve=` vec4 czm_cascadeColor(vec4 weights) { return vec4(1.0, 0.0, 0.0, 1.0) * weights.x + vec4(0.0, 1.0, 0.0, 1.0) * weights.y + vec4(0.0, 0.0, 1.0, 1.0) * weights.z + vec4(1.0, 0.0, 1.0, 1.0) * weights.w; } `,jve=` uniform vec4 shadowMap_cascadeDistances; float czm_cascadeDistance(vec4 weights) { return dot(shadowMap_cascadeDistances, weights); } `,Yve=` uniform mat4 shadowMap_cascadeMatrices[4]; mat4 czm_cascadeMatrix(vec4 weights) { return shadowMap_cascadeMatrices[0] * weights.x + shadowMap_cascadeMatrices[1] * weights.y + shadowMap_cascadeMatrices[2] * weights.z + shadowMap_cascadeMatrices[3] * weights.w; } `,qve=` uniform vec4 shadowMap_cascadeSplits[2]; vec4 czm_cascadeWeights(float depthEye) { // One component is set to 1.0 and all others set to 0.0. vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); return near * far; } `,Xve=`/** * DOC_TBA * * @name czm_columbusViewMorph * @glslFunction */ vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time) { // Just linear for now. vec3 p = mix(position2D.xyz, position3D.xyz, time); return vec4(p, 1.0); } `,Jve=`/** * Returns a position in model coordinates relative to eye taking into * account the current scene mode: 3D, 2D, or Columbus view. *

* This uses standard position attributes, position3DHigh, * position3DLow, position2DHigh, and position2DLow, * and should be used when writing a vertex shader for an {@link Appearance}. *

* * @name czm_computePosition * @glslFunction * * @returns {vec4} The position relative to eye. * * @example * vec4 p = czm_computePosition(); * v_positionEC = (czm_modelViewRelativeToEye * p).xyz; * gl_Position = czm_modelViewProjectionRelativeToEye * p; * * @see czm_translateRelativeToEye */ vec4 czm_computePosition(); `,Kve=`/** * @private */ vec2 cordic(float angle) { // Scale the vector by the appropriate factor for the 24 iterations to follow. vec2 vector = vec2(6.0725293500888267e-1, 0.0); // Iteration 1 float sense = (angle < 0.0) ? -1.0 : 1.0; // float factor = sense * 1.0; // 2^-0 mat2 rotation = mat2(1.0, sense, -sense, 1.0); vector = rotation * vector; angle -= sense * 7.8539816339744828e-1; // atan(2^-0) // Iteration 2 sense = (angle < 0.0) ? -1.0 : 1.0; float factor = sense * 5.0e-1; // 2^-1 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 4.6364760900080609e-1; // atan(2^-1) // Iteration 3 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 2.5e-1; // 2^-2 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 2.4497866312686414e-1; // atan(2^-2) // Iteration 4 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.25e-1; // 2^-3 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.2435499454676144e-1; // atan(2^-3) // Iteration 5 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 6.25e-2; // 2^-4 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 6.2418809995957350e-2; // atan(2^-4) // Iteration 6 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 3.125e-2; // 2^-5 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 3.1239833430268277e-2; // atan(2^-5) // Iteration 7 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.5625e-2; // 2^-6 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.5623728620476831e-2; // atan(2^-6) // Iteration 8 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 7.8125e-3; // 2^-7 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 7.8123410601011111e-3; // atan(2^-7) // Iteration 9 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 3.90625e-3; // 2^-8 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 3.9062301319669718e-3; // atan(2^-8) // Iteration 10 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.953125e-3; // 2^-9 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.9531225164788188e-3; // atan(2^-9) // Iteration 11 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 9.765625e-4; // 2^-10 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 9.7656218955931946e-4; // atan(2^-10) // Iteration 12 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 4.8828125e-4; // 2^-11 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 4.8828121119489829e-4; // atan(2^-11) // Iteration 13 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 2.44140625e-4; // 2^-12 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 2.4414062014936177e-4; // atan(2^-12) // Iteration 14 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.220703125e-4; // 2^-13 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.2207031189367021e-4; // atan(2^-13) // Iteration 15 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 6.103515625e-5; // 2^-14 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 6.1035156174208773e-5; // atan(2^-14) // Iteration 16 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 3.0517578125e-5; // 2^-15 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 3.0517578115526096e-5; // atan(2^-15) // Iteration 17 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.52587890625e-5; // 2^-16 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.5258789061315762e-5; // atan(2^-16) // Iteration 18 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 7.62939453125e-6; // 2^-17 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 7.6293945311019700e-6; // atan(2^-17) // Iteration 19 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 3.814697265625e-6; // 2^-18 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 3.8146972656064961e-6; // atan(2^-18) // Iteration 20 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.9073486328125e-6; // 2^-19 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 1.9073486328101870e-6; // atan(2^-19) // Iteration 21 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 9.5367431640625e-7; // 2^-20 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 9.5367431640596084e-7; // atan(2^-20) // Iteration 22 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 4.76837158203125e-7; // 2^-21 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 4.7683715820308884e-7; // atan(2^-21) // Iteration 23 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 2.384185791015625e-7; // 2^-22 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; angle -= sense * 2.3841857910155797e-7; // atan(2^-22) // Iteration 24 sense = (angle < 0.0) ? -1.0 : 1.0; factor = sense * 1.1920928955078125e-7; // 2^-23 rotation[0][1] = factor; rotation[1][0] = -factor; vector = rotation * vector; // angle -= sense * 1.1920928955078068e-7; // atan(2^-23) return vector; } /** * Computes the cosine and sine of the provided angle using the CORDIC algorithm. * * @name czm_cosineAndSine * @glslFunction * * @param {float} angle The angle in radians. * * @returns {vec2} The resulting cosine of the angle (as the x coordinate) and sine of the angle (as the y coordinate). * * @example * vec2 v = czm_cosineAndSine(czm_piOverSix); * float cosine = v.x; * float sine = v.y; */ vec2 czm_cosineAndSine(float angle) { if (angle < -czm_piOverTwo || angle > czm_piOverTwo) { if (angle < 0.0) { return -cordic(angle + czm_pi); } else { return -cordic(angle - czm_pi); } } else { return cordic(angle); } } `,Qve=`/** * Decompresses texture coordinates that were packed into a single float. * * @name czm_decompressTextureCoordinates * @glslFunction * * @param {float} encoded The compressed texture coordinates. * @returns {vec2} The decompressed texture coordinates. */ vec2 czm_decompressTextureCoordinates(float encoded) { float temp = encoded / 4096.0; float xZeroTo4095 = floor(temp); float stx = xZeroTo4095 / 4095.0; float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0; return vec2(stx, sty); } `,Zve=`/** * Get default parameters for physically based rendering. These defaults * describe a rough dielectric (non-metal) surface (e.g. rough plastic). * * @return {czm_pbrParameters} Default parameters for {@link czm_pbrLighting} */ czm_pbrParameters czm_defaultPbrMaterial() { czm_pbrParameters results; results.diffuseColor = vec3(1.0); results.roughness = 1.0; const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); results.f0 = REFLECTANCE_DIELECTRIC; return results; } `,$ve=`// emulated noperspective #if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH) out float v_WindowZ; #endif /** * Emulates GL_DEPTH_CLAMP, which is not available in WebGL 1 or 2. * GL_DEPTH_CLAMP clamps geometry that is outside the near and far planes, * capping the shadow volume. More information here: * https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_depth_clamp.txt. * * When GL_EXT_frag_depth is available we emulate GL_DEPTH_CLAMP by ensuring * no geometry gets clipped by setting the clip space z value to 0.0 and then * sending the unaltered screen space z value (using emulated noperspective * interpolation) to the frag shader where it is clamped to [0,1] and then * written with gl_FragDepth (see czm_writeDepthClamp). This technique is based on: * https://stackoverflow.com/questions/5960757/how-to-emulate-gl-depth-clamp-nv. * * When GL_EXT_frag_depth is not available, which is the case on some mobile * devices, we must attempt to fix this only in the vertex shader. * The approach is to clamp the z value to the far plane, which closes the * shadow volume but also distorts the geometry, so there can still be artifacts * on frustum seams. * * @name czm_depthClamp * @glslFunction * * @param {vec4} coords The vertex in clip coordinates. * @returns {vec4} The modified vertex. * * @example * gl_Position = czm_depthClamp(czm_modelViewProjection * vec4(position, 1.0)); * * @see czm_writeDepthClamp */ vec4 czm_depthClamp(vec4 coords) { #ifndef LOG_DEPTH #if __VERSION__ == 300 || defined(GL_EXT_frag_depth) v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w; coords.z = 0.0; #else coords.z = min(coords.z, coords.w); #endif #endif return coords; } `,eye=`/** * Computes a 3x3 rotation matrix that transforms vectors from an ellipsoid's east-north-up coordinate system * to eye coordinates. In east-north-up coordinates, x points east, y points north, and z points along the * surface normal. East-north-up can be used as an ellipsoid's tangent space for operations such as bump mapping. *

* The ellipsoid is assumed to be centered at the model coordinate's origin. * * @name czm_eastNorthUpToEyeCoordinates * @glslFunction * * @param {vec3} positionMC The position on the ellipsoid in model coordinates. * @param {vec3} normalEC The normalized ellipsoid surface normal, at positionMC, in eye coordinates. * * @returns {mat3} A 3x3 rotation matrix that transforms vectors from the east-north-up coordinate system to eye coordinates. * * @example * // Transform a vector defined in the east-north-up coordinate * // system, (0, 0, 1) which is the surface normal, to eye * // coordinates. * mat3 m = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); * vec3 normalEC = m * vec3(0.0, 0.0, 1.0); */ mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC) { vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0)); // normalized surface tangent in model coordinates vec3 tangentEC = normalize(czm_normal3D * tangentMC); // normalized surface tangent in eye coordiantes vec3 bitangentEC = normalize(cross(normalEC, tangentEC)); // normalized surface bitangent in eye coordinates return mat3( tangentEC.x, tangentEC.y, tangentEC.z, bitangentEC.x, bitangentEC.y, bitangentEC.z, normalEC.x, normalEC.y, normalEC.z); } `,tye=`/** * DOC_TBA * * @name czm_ellipsoidContainsPoint * @glslFunction * */ bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point) { vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz; return (dot(scaled, scaled) <= 1.0); } `,iye=`/** * DOC_TBA * * @name czm_ellipsoidWgs84TextureCoordinates * @glslFunction */ vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal) { return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5); } `,rye=`/** * Compares left and right componentwise. Returns true * if they are within epsilon and false otherwise. The inputs * left and right can be floats, vec2s, * vec3s, or vec4s. * * @name czm_equalsEpsilon * @glslFunction * * @param {} left The first vector. * @param {} right The second vector. * @param {float} epsilon The epsilon to use for equality testing. * @returns {bool} true if the components are within epsilon and false otherwise. * * @example * // GLSL declarations * bool czm_equalsEpsilon(float left, float right, float epsilon); * bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon); * bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon); * bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon); */ bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) { return all(lessThanEqual(abs(left - right), vec4(epsilon))); } bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) { return all(lessThanEqual(abs(left - right), vec3(epsilon))); } bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) { return all(lessThanEqual(abs(left - right), vec2(epsilon))); } bool czm_equalsEpsilon(float left, float right, float epsilon) { return (abs(left - right) <= epsilon); } `,nye=`/** * DOC_TBA * * @name czm_eyeOffset * @glslFunction * * @param {vec4} positionEC DOC_TBA. * @param {vec3} eyeOffset DOC_TBA. * * @returns {vec4} DOC_TBA. */ vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset) { // This equation is approximate in x and y. vec4 p = positionEC; vec4 zEyeOffset = normalize(p) * eyeOffset.z; p.xy += eyeOffset.xy + zEyeOffset.xy; p.z += zEyeOffset.z; return p; } `,oye=`/** * Transforms a position from eye to window coordinates. The transformation * from eye to clip coordinates is done using {@link czm_projection}. * The transform from normalized device coordinates to window coordinates is * done using {@link czm_viewportTransformation}, which assumes a depth range * of near = 0 and far = 1. *

* This transform is useful when there is a need to manipulate window coordinates * in a vertex shader as done by {@link BillboardCollection}. * * @name czm_eyeToWindowCoordinates * @glslFunction * * @param {vec4} position The position in eye coordinates to transform. * * @returns {vec4} The transformed position in window coordinates. * * @see czm_modelToWindowCoordinates * @see czm_projection * @see czm_viewportTransformation * @see BillboardCollection * * @example * vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); */ vec4 czm_eyeToWindowCoordinates(vec4 positionEC) { vec4 q = czm_projection * positionEC; // clip coordinates q.xyz /= q.w; // normalized device coordinates q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates return q; } `,aye=`/** * Approxiamtes atan over the range [0, 1]. Safe to flip output for negative input. * * Based on Michal Drobot's approximation from ShaderFastLibs, which in turn is based on * "Efficient approximations for the arctangent function," Rajan, S. Sichun Wang Inkol, R. Joyal, A., May 2006. * Adapted from ShaderFastLibs under MIT License. * * Chosen for the following characteristics over range [0, 1]: * - basically no error at 0 and 1, important for getting around range limit (naive atan2 via atan requires infinite range atan) * - no visible artifacts from first-derivative discontinuities, unlike latitude via range-reduced sqrt asin approximations (at equator) * * The original code is x * (-0.1784 * abs(x) - 0.0663 * x * x + 1.0301); * Removed the abs() in here because it isn't needed, the input range is guaranteed as [0, 1] by how we're approximating atan2. * * @name czm_fastApproximateAtan * @glslFunction * * @param {float} x Value between 0 and 1 inclusive. * * @returns {float} Approximation of atan(x) */ float czm_fastApproximateAtan(float x) { return x * (-0.1784 * x - 0.0663 * x * x + 1.0301); } /** * Approximation of atan2. * * Range reduction math based on nvidia's cg reference implementation for atan2: http://developer.download.nvidia.com/cg/atan2.html * However, we replaced their atan curve with Michael Drobot's (see above). * * @name czm_fastApproximateAtan * @glslFunction * * @param {float} x Value between -1 and 1 inclusive. * @param {float} y Value between -1 and 1 inclusive. * * @returns {float} Approximation of atan2(x, y) */ float czm_fastApproximateAtan(float x, float y) { // atan approximations are usually only reliable over [-1, 1], or, in our case, [0, 1] due to modifications. // So range-reduce using abs and by flipping whether x or y is on top. float t = abs(x); // t used as swap and atan result. float opposite = abs(y); float adjacent = max(t, opposite); opposite = min(t, opposite); t = czm_fastApproximateAtan(opposite / adjacent); // Undo range reduction t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t); t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t); t = czm_branchFreeTernary(y < 0.0, -t, t); return t; } `,sye=`/** * Gets the color with fog at a distance from the camera. * * @name czm_fog * @glslFunction * * @param {float} distanceToCamera The distance to the camera in meters. * @param {vec3} color The original color. * @param {vec3} fogColor The color of the fog. * * @returns {vec3} The color adjusted for fog at the distance from the camera. */ vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor) { float scalar = distanceToCamera * czm_fogDensity; float fog = 1.0 - exp(-(scalar * scalar)); return mix(color, fogColor, fog); } /** * Gets the color with fog at a distance from the camera. * * @name czm_fog * @glslFunction * * @param {float} distanceToCamera The distance to the camera in meters. * @param {vec3} color The original color. * @param {vec3} fogColor The color of the fog. * @param {float} fogModifierConstant A constant to modify the appearance of fog. * * @returns {vec3} The color adjusted for fog at the distance from the camera. */ vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant) { float scalar = distanceToCamera * czm_fogDensity; float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant)))); return mix(color, fogColor, fog); } `,lye=`/** * Converts a color from RGB space to linear space. * * @name czm_gammaCorrect * @glslFunction * * @param {vec3} color The color in RGB space. * @returns {vec3} The color in linear space. */ vec3 czm_gammaCorrect(vec3 color) { #ifdef HDR color = pow(color, vec3(czm_gamma)); #endif return color; } vec4 czm_gammaCorrect(vec4 color) { #ifdef HDR color.rgb = pow(color.rgb, vec3(czm_gamma)); #endif return color; } `,uye=`/** * DOC_TBA * * @name czm_geodeticSurfaceNormal * @glslFunction * * @param {vec3} positionOnEllipsoid DOC_TBA * @param {vec3} ellipsoidCenter DOC_TBA * @param {vec3} oneOverEllipsoidRadiiSquared DOC_TBA * * @returns {vec3} DOC_TBA. */ vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared) { return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared); } `,cye=`/** * An czm_material with default values. Every material's czm_getMaterial * should use this default material as a base for the material it returns. * The default normal value is given by materialInput.normalEC. * * @name czm_getDefaultMaterial * @glslFunction * * @param {czm_materialInput} input The input used to construct the default material. * * @returns {czm_material} The default material. * * @see czm_materialInput * @see czm_material * @see czm_getMaterial */ czm_material czm_getDefaultMaterial(czm_materialInput materialInput) { czm_material material; material.diffuse = vec3(0.0); material.specular = 0.0; material.shininess = 1.0; material.normal = materialInput.normalEC; material.emission = vec3(0.0); material.alpha = 1.0; return material; } `,hye=`/** * Calculates the intensity of diffusely reflected light. * * @name czm_getLambertDiffuse * @glslFunction * * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. * @param {vec3} normalEC The surface normal in eye coordinates. * * @returns {float} The intensity of the diffuse reflection. * * @see czm_phong * * @example * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); */ float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC) { return max(dot(lightDirectionEC, normalEC), 0.0); } `,dye=`/** * Calculates the specular intensity of reflected light. * * @name czm_getSpecular * @glslFunction * * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. * @param {vec3} toEyeEC Unit vector pointing to the eye position in eye coordinates. * @param {vec3} normalEC The surface normal in eye coordinates. * @param {float} shininess The sharpness of the specular reflection. Higher values create a smaller, more focused specular highlight. * * @returns {float} The intensity of the specular highlight. * * @see czm_phong * * @example * float diffuseIntensity = czm_getLambertDiffuse(lightDirectionEC, normalEC); * float specularIntensity = czm_getSpecular(lightDirectionEC, toEyeEC, normalEC, 200); * vec3 color = (diffuseColor * diffuseIntensity) + (specularColor * specularIntensity); */ float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess) { vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC); float specular = max(dot(toReflectedLight, toEyeEC), 0.0); // pow has undefined behavior if both parameters <= 0. // Prevent this by making sure shininess is at least czm_epsilon2. return pow(specular, max(shininess, czm_epsilon2)); } `,fye=`/** * @private */ vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians) { float cosAngle = cos(angleInRadians); float sinAngle = sin(angleInRadians); // time dependent sampling directions vec2 s0 = vec2(1.0/17.0, 0.0); vec2 s1 = vec2(-1.0/29.0, 0.0); vec2 s2 = vec2(1.0/101.0, 1.0/59.0); vec2 s3 = vec2(-1.0/109.0, -1.0/57.0); // rotate sampling direction by specified angle s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y)); s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y)); s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y)); s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y)); vec2 uv0 = (uv/103.0) + (time * s0); vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23); vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51); vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71); uv0 = fract(uv0); uv1 = fract(uv1); uv2 = fract(uv2); uv3 = fract(uv3); vec4 noise = (texture(normalMap, uv0)) + (texture(normalMap, uv1)) + (texture(normalMap, uv2)) + (texture(normalMap, uv3)); // average and scale to between -1 and 1 return ((noise / 4.0) - 0.5) * 2.0; } `,pye=`/** * Converts an HSB color (hue, saturation, brightness) to RGB * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} * * @name czm_HSBToRGB * @glslFunction * * @param {vec3} hsb The color in HSB. * * @returns {vec3} The color in RGB. * * @example * vec3 hsb = czm_RGBToHSB(rgb); * hsb.z *= 0.1; * rgb = czm_HSBToRGB(hsb); */ const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); vec3 czm_HSBToRGB(vec3 hsb) { vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www); return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y); } `,mye=`/** * Converts an HSL color (hue, saturation, lightness) to RGB * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} * * @name czm_HSLToRGB * @glslFunction * * @param {vec3} rgb The color in HSL. * * @returns {vec3} The color in RGB. * * @example * vec3 hsl = czm_RGBToHSL(rgb); * hsl.z *= 0.1; * rgb = czm_HSLToRGB(hsl); */ vec3 hueToRGB(float hue) { float r = abs(hue * 6.0 - 3.0) - 1.0; float g = 2.0 - abs(hue * 6.0 - 2.0); float b = 2.0 - abs(hue * 6.0 - 4.0); return clamp(vec3(r, g, b), 0.0, 1.0); } vec3 czm_HSLToRGB(vec3 hsl) { vec3 rgb = hueToRGB(hsl.x); float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y; return (rgb - 0.5) * c + hsl.z; } `,gye=`/** * Adjusts the hue of a color. * * @name czm_hue * @glslFunction * * @param {vec3} rgb The color. * @param {float} adjustment The amount to adjust the hue of the color in radians. * * @returns {float} The color with the hue adjusted. * * @example * vec3 adjustHue = czm_hue(color, czm_pi); // The same as czm_hue(color, -czm_pi) */ vec3 czm_hue(vec3 rgb, float adjustment) { const mat3 toYIQ = mat3(0.299, 0.587, 0.114, 0.595716, -0.274453, -0.321263, 0.211456, -0.522591, 0.311135); const mat3 toRGB = mat3(1.0, 0.9563, 0.6210, 1.0, -0.2721, -0.6474, 1.0, -1.107, 1.7046); vec3 yiq = toYIQ * rgb; float hue = atan(yiq.z, yiq.y) + adjustment; float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y); vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue)); return toRGB * color; } `,_ye=`/** * Converts a color in linear space to RGB space. * * @name czm_inverseGamma * @glslFunction * * @param {vec3} color The color in linear space. * @returns {vec3} The color in RGB space. */ vec3 czm_inverseGamma(vec3 color) { return pow(color, vec3(1.0 / czm_gamma)); } `,vye=`/** * Determines if a time interval is empty. * * @name czm_isEmpty * @glslFunction * * @param {czm_raySegment} interval The interval to test. * * @returns {bool} true if the time interval is empty; otherwise, false. * * @example * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. */ bool czm_isEmpty(czm_raySegment interval) { return (interval.stop < 0.0); } `,yye=`/** * Determines if a time interval is empty. * * @name czm_isFull * @glslFunction * * @param {czm_raySegment} interval The interval to test. * * @returns {bool} true if the time interval is empty; otherwise, false. * * @example * bool b0 = czm_isEmpty(czm_emptyRaySegment); // true * bool b1 = czm_isEmpty(czm_raySegment(0.0, 1.0)); // false * bool b2 = czm_isEmpty(czm_raySegment(1.0, 1.0)); // false, contains 1.0. */ bool czm_isFull(czm_raySegment interval) { return (interval.start == 0.0 && interval.stop == czm_infinity); } `,xye=`/** * Computes the fraction of a Web Wercator rectangle at which a given geodetic latitude is located. * * @name czm_latitudeToWebMercatorFraction * @glslFunction * * @param {float} latitude The geodetic latitude, in radians. * @param {float} southMercatorY The Web Mercator coordinate of the southern boundary of the rectangle. * @param {float} oneOverMercatorHeight The total height of the rectangle in Web Mercator coordinates. * * @returns {float} The fraction of the rectangle at which the latitude occurs. If the latitude is the southern * boundary of the rectangle, the return value will be zero. If it is the northern boundary, the return * value will be 1.0. Latitudes in between are mapped according to the Web Mercator projection. */ float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight) { float sinLatitude = sin(latitude); float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude)); return (mercatorY - southMercatorY) * oneOverMercatorHeight; } `,Cye=`/** * Converts a linear RGB color to an sRGB color. * * @param {vec3|vec4} linearIn The color in linear color space. * @returns {vec3|vec4} The color in sRGB color space. The vector type matches the input. */ vec3 czm_linearToSrgb(vec3 linearIn) { return pow(linearIn, vec3(1.0/2.2)); } vec4 czm_linearToSrgb(vec4 linearIn) { vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2)); return vec4(srgbOut, linearIn.a); } `,bye=`/** * Computes distance from an point in 2D to a line in 2D. * * @name czm_lineDistance * @glslFunction * * param {vec2} point1 A point along the line. * param {vec2} point2 A point along the line. * param {vec2} point A point that may or may not be on the line. * returns {float} The distance from the point to the line. */ float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) { return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1); } `,wye=`/** * Computes the luminance of a color. * * @name czm_luminance * @glslFunction * * @param {vec3} rgb The color. * * @returns {float} The luminance. * * @example * float light = czm_luminance(vec3(0.0)); // 0.0 * float dark = czm_luminance(vec3(1.0)); // ~1.0 */ float czm_luminance(vec3 rgb) { // Algorithm from Chapter 10 of Graphics Shaders. const vec3 W = vec3(0.2125, 0.7154, 0.0721); return dot(rgb, W); } `,Aye=`/** * Computes the size of a pixel in meters at a distance from the eye. *

* Use this version when passing in a custom pixel ratio. For example, passing in 1.0 will return meters per native device pixel. *

* @name czm_metersPerPixel * @glslFunction * * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. * @param {float} pixelRatio The scaling factor from pixel space to coordinate space * * @returns {float} The meters per pixel at positionEC. */ float czm_metersPerPixel(vec4 positionEC, float pixelRatio) { float width = czm_viewport.z; float height = czm_viewport.w; float pixelWidth; float pixelHeight; float top = czm_frustumPlanes.x; float bottom = czm_frustumPlanes.y; float left = czm_frustumPlanes.z; float right = czm_frustumPlanes.w; if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0) { float frustumWidth = right - left; float frustumHeight = top - bottom; pixelWidth = frustumWidth / width; pixelHeight = frustumHeight / height; } else { float distanceToPixel = -positionEC.z; float inverseNear = 1.0 / czm_currentFrustum.x; float tanTheta = top * inverseNear; pixelHeight = 2.0 * distanceToPixel * tanTheta / height; tanTheta = right * inverseNear; pixelWidth = 2.0 * distanceToPixel * tanTheta / width; } return max(pixelWidth, pixelHeight) * pixelRatio; } /** * Computes the size of a pixel in meters at a distance from the eye. *

* Use this version when scaling by pixel ratio. *

* @name czm_metersPerPixel * @glslFunction * * @param {vec3} positionEC The position to get the meters per pixel in eye coordinates. * * @returns {float} The meters per pixel at positionEC. */ float czm_metersPerPixel(vec4 positionEC) { return czm_metersPerPixel(positionEC, czm_pixelRatio); } `,Eye=`/** * Transforms a position from model to window coordinates. The transformation * from model to clip coordinates is done using {@link czm_modelViewProjection}. * The transform from normalized device coordinates to window coordinates is * done using {@link czm_viewportTransformation}, which assumes a depth range * of near = 0 and far = 1. *

* This transform is useful when there is a need to manipulate window coordinates * in a vertex shader as done by {@link BillboardCollection}. *

* This function should not be confused with {@link czm_viewportOrthographic}, * which is an orthographic projection matrix that transforms from window * coordinates to clip coordinates. * * @name czm_modelToWindowCoordinates * @glslFunction * * @param {vec4} position The position in model coordinates to transform. * * @returns {vec4} The transformed position in window coordinates. * * @see czm_eyeToWindowCoordinates * @see czm_modelViewProjection * @see czm_viewportTransformation * @see czm_viewportOrthographic * @see BillboardCollection * * @example * vec4 positionWC = czm_modelToWindowCoordinates(positionMC); */ vec4 czm_modelToWindowCoordinates(vec4 position) { vec4 q = czm_modelViewProjection * position; // clip coordinates q.xyz /= q.w; // normalized device coordinates q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz; // window coordinates return q; } `,Tye=`/** * DOC_TBA * * @name czm_multiplyWithColorBalance * @glslFunction */ vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right) { // Algorithm from Chapter 10 of Graphics Shaders. const vec3 W = vec3(0.2125, 0.7154, 0.0721); vec3 target = left * right; float leftLuminance = dot(left, W); float rightLuminance = dot(right, W); float targetLuminance = dot(target, W); return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target; } `,Sye=`/** * Computes a value that scales with distance. The scaling is clamped at the near and * far distances, and does not extrapolate. This function works with the * {@link NearFarScalar} JavaScript class. * * @name czm_nearFarScalar * @glslFunction * * @param {vec4} nearFarScalar A vector with 4 components: Near distance (x), Near value (y), Far distance (z), Far value (w). * @param {float} cameraDistSq The square of the current distance from the camera. * * @returns {float} The value at this distance. */ float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq) { float valueAtMin = nearFarScalar.y; float valueAtMax = nearFarScalar.w; float nearDistanceSq = nearFarScalar.x * nearFarScalar.x; float farDistanceSq = nearFarScalar.z * nearFarScalar.z; float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq); t = pow(clamp(t, 0.0, 1.0), 0.2); return mix(valueAtMin, valueAtMax, t); } `,Pye=` /** * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ * * @name czm_octDecode * @param {vec2} encoded The oct-encoded, unit-length vector * @param {float} range The maximum value of the SNORM range. The encoded vector is stored in log2(rangeMax+1) bits. * @returns {vec3} The decoded and normalized vector */ vec3 czm_octDecode(vec2 encoded, float range) { if (encoded.x == 0.0 && encoded.y == 0.0) { return vec3(0.0, 0.0, 0.0); } encoded = encoded / range * 2.0 - 1.0; vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y)); if (v.z < 0.0) { v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy); } return normalize(v); } /** * Decodes a unit-length vector in 'oct' encoding to a normalized 3-component Cartesian vector. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ * * @name czm_octDecode * @param {vec2} encoded The oct-encoded, unit-length vector * @returns {vec3} The decoded and normalized vector */ vec3 czm_octDecode(vec2 encoded) { return czm_octDecode(encoded, 255.0); } /** * Decodes a unit-length vector in 'oct' encoding packed into a floating-point number to a normalized 3-component Cartesian vector. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ * * @name czm_octDecode * @param {float} encoded The oct-encoded, unit-length vector * @returns {vec3} The decoded and normalized vector */ vec3 czm_octDecode(float encoded) { float temp = encoded / 256.0; float x = floor(temp); float y = (temp - x) * 256.0; return czm_octDecode(vec2(x, y)); } /** * Decodes three unit-length vectors in 'oct' encoding packed into two floating-point numbers to normalized 3-component Cartesian vectors. * The 'oct' encoding is described in "A Survey of Efficient Representations of Independent Unit Vectors", * Cigolle et al 2014: http://jcgt.org/published/0003/02/01/ * * @name czm_octDecode * @param {vec2} encoded The packed oct-encoded, unit-length vectors. * @param {vec3} vector1 One decoded and normalized vector. * @param {vec3} vector2 One decoded and normalized vector. * @param {vec3} vector3 One decoded and normalized vector. */ void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3) { float temp = encoded.x / 65536.0; float x = floor(temp); float encodedFloat1 = (temp - x) * 65536.0; temp = encoded.y / 65536.0; float y = floor(temp); float encodedFloat2 = (temp - y) * 65536.0; vector1 = czm_octDecode(encodedFloat1); vector2 = czm_octDecode(encodedFloat2); vector3 = czm_octDecode(vec2(x, y)); } `,Iye=`/** * Packs a depth value into a vec3 that can be represented by unsigned bytes. * * @name czm_packDepth * @glslFunction * * @param {float} depth The floating-point depth. * @returns {vec3} The packed depth. */ vec4 czm_packDepth(float depth) { // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth; enc = fract(enc); enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); return enc; } `,Mye=`vec3 lambertianDiffuse(vec3 diffuseColor) { return diffuseColor / czm_pi; } vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH) { return f0 + (f90 - f0) * pow(clamp(1.0 - VdotH, 0.0, 1.0), 5.0); } float smithVisibilityG1(float NdotV, float roughness) { // this is the k value for direct lighting. // for image based lighting it will be roughness^2 / 2 float k = (roughness + 1.0) * (roughness + 1.0) / 8.0; return NdotV / (NdotV * (1.0 - k) + k); } float smithVisibilityGGX(float roughness, float NdotL, float NdotV) { return ( smithVisibilityG1(NdotL, roughness) * smithVisibilityG1(NdotV, roughness) ); } float GGX(float roughness, float NdotH) { float roughnessSquared = roughness * roughness; float f = (NdotH * roughnessSquared - NdotH) * NdotH + 1.0; return roughnessSquared / (czm_pi * f * f); } /** * Compute the diffuse and specular contributions using physically based * rendering. This function only handles direct lighting. *

* This function only handles the lighting calculations. Metallic/roughness * and specular/glossy must be handled separately. See {@czm_pbrMetallicRoughnessMaterial}, {@czm_pbrSpecularGlossinessMaterial} and {@czm_defaultPbrMaterial} *

* * @name czm_pbrlighting * @glslFunction * * @param {vec3} positionEC The position of the fragment in eye coordinates * @param {vec3} normalEC The surface normal in eye coordinates * @param {vec3} lightDirectionEC Unit vector pointing to the light source in eye coordinates. * @param {vec3} lightColorHdr radiance of the light source. This is a HDR value. * @param {czm_pbrParameters} The computed PBR parameters. * @return {vec3} The computed HDR color * * @example * czm_pbrParameters pbrParameters = czm_pbrMetallicRoughnessMaterial( * baseColor, * metallic, * roughness * ); * vec3 color = czm_pbrlighting( * positionEC, * normalEC, * lightDirectionEC, * lightColorHdr, * pbrParameters); */ vec3 czm_pbrLighting( vec3 positionEC, vec3 normalEC, vec3 lightDirectionEC, vec3 lightColorHdr, czm_pbrParameters pbrParameters ) { vec3 v = -normalize(positionEC); vec3 l = normalize(lightDirectionEC); vec3 h = normalize(v + l); vec3 n = normalEC; float NdotL = clamp(dot(n, l), 0.001, 1.0); float NdotV = abs(dot(n, v)) + 0.001; float NdotH = clamp(dot(n, h), 0.0, 1.0); float LdotH = clamp(dot(l, h), 0.0, 1.0); float VdotH = clamp(dot(v, h), 0.0, 1.0); vec3 f0 = pbrParameters.f0; float reflectance = max(max(f0.r, f0.g), f0.b); vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); vec3 F = fresnelSchlick2(f0, f90, VdotH); float alpha = pbrParameters.roughness; float G = smithVisibilityGGX(alpha, NdotL, NdotV); float D = GGX(alpha, NdotH); vec3 specularContribution = F * G * D / (4.0 * NdotL * NdotV); vec3 diffuseColor = pbrParameters.diffuseColor; // F here represents the specular contribution vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor); // Lo = (diffuse + specular) * Li * NdotL return (diffuseContribution + specularContribution) * NdotL * lightColorHdr; } `,Dye=`/** * Compute parameters for physically based rendering using the * metallic/roughness workflow. All inputs are linear; sRGB texture values must * be decoded beforehand * * @name czm_pbrMetallicRoughnessMaterial * @glslFunction * * @param {vec3} baseColor For dielectrics, this is the base color. For metals, this is the f0 value (reflectance at normal incidence) * @param {float} metallic 0.0 indicates dielectric. 1.0 indicates metal. Values in between are allowed (e.g. to model rust or dirt); * @param {float} roughness A value between 0.0 and 1.0 * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} */ czm_pbrParameters czm_pbrMetallicRoughnessMaterial( vec3 baseColor, float metallic, float roughness ) { czm_pbrParameters results; // roughness is authored as perceptual roughness // square it to get material roughness roughness = clamp(roughness, 0.0, 1.0); results.roughness = roughness * roughness; // dielectrics use f0 = 0.04, metals use albedo as f0 metallic = clamp(metallic, 0.0, 1.0); const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04); vec3 f0 = mix(REFLECTANCE_DIELECTRIC, baseColor, metallic); results.f0 = f0; // diffuse only applies to dielectrics. results.diffuseColor = baseColor * (1.0 - f0) * (1.0 - metallic); return results; } `,Lye=`/** * Compute parameters for physically based rendering using the * specular/glossy workflow. All inputs are linear; sRGB texture values must * be decoded beforehand * * @name czm_pbrSpecularGlossinessMaterial * @glslFunction * * @param {vec3} diffuse The diffuse color for dielectrics (non-metals) * @param {vec3} specular The reflectance at normal incidence (f0) * @param {float} glossiness A number from 0.0 to 1.0 indicating how smooth the surface is. * @return {czm_pbrParameters} parameters to pass into {@link czm_pbrLighting} */ czm_pbrParameters czm_pbrSpecularGlossinessMaterial( vec3 diffuse, vec3 specular, float glossiness ) { czm_pbrParameters results; // glossiness is the opposite of roughness, but easier for artists to use. float roughness = 1.0 - glossiness; results.roughness = roughness * roughness; results.diffuseColor = diffuse * (1.0 - max(max(specular.r, specular.g), specular.b)); results.f0 = specular; return results; } `,Rye=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material) { return czm_getLambertDiffuse(lightDirectionEC, material.normal); } float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material) { return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess); } /** * Computes a color using the Phong lighting model. * * @name czm_phong * @glslFunction * * @param {vec3} toEye A normalized vector from the fragment to the eye in eye coordinates. * @param {czm_material} material The fragment's material. * * @returns {vec4} The computed color. * * @example * vec3 positionToEyeEC = // ... * czm_material material = // ... * vec3 lightDirectionEC = // ... * out_FragColor = czm_phong(normalize(positionToEyeEC), material, lightDirectionEC); * * @see czm_getMaterial */ vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { // Diffuse from directional light sources at eye (for top-down) float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material); if (czm_sceneMode == czm_sceneMode3D) { // (and horizon views in 3D) diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material); } float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); // Temporary workaround for adding ambient. vec3 materialDiffuse = material.diffuse * 0.5; vec3 ambient = materialDiffuse; vec3 color = ambient + material.emission; color += materialDiffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material); float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material); vec3 ambient = vec3(0.0); vec3 color = ambient + material.emission; color += material.diffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } `,Oye=`/** * Computes distance from a point to a plane. * * @name czm_planeDistance * @glslFunction * * param {vec4} plane A Plane in Hessian Normal Form. See Plane.js * param {vec3} point A point in the same space as the plane. * returns {float} The distance from the point to the plane. */ float czm_planeDistance(vec4 plane, vec3 point) { return (dot(plane.xyz, point) + plane.w); } /** * Computes distance from a point to a plane. * * @name czm_planeDistance * @glslFunction * * param {vec3} planeNormal Normal for a plane in Hessian Normal Form. See Plane.js * param {float} planeDistance Distance for a plane in Hessian Normal form. See Plane.js * param {vec3} point A point in the same space as the plane. * returns {float} The distance from the point to the plane. */ float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) { return (dot(planeNormal, point) + planeDistance); } `,Nye=`/** * Computes the point along a ray at the given time. time can be positive, negative, or zero. * * @name czm_pointAlongRay * @glslFunction * * @param {czm_ray} ray The ray to compute the point along. * @param {float} time The time along the ray. * * @returns {vec3} The point along the ray at the given time. * * @example * czm_ray ray = czm_ray(vec3(0.0), vec3(1.0, 0.0, 0.0)); // origin, direction * vec3 v = czm_pointAlongRay(ray, 2.0); // (2.0, 0.0, 0.0) */ vec3 czm_pointAlongRay(czm_ray ray, float time) { return ray.origin + (time * ray.direction); } `,Fye=`/** * DOC_TBA * * @name czm_rayEllipsoidIntersectionInterval * @glslFunction */ czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii) { // ray and ellipsoid center in eye coordinates. radii in model coordinates. vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz; vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz; q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz; float q2 = dot(q, q); float qw = dot(q, w); if (q2 > 1.0) // Outside ellipsoid. { if (qw >= 0.0) // Looking outward or tangent (0 intersections). { return czm_emptyRaySegment; } else // qw < 0.0. { float qw2 = qw * qw; float difference = q2 - 1.0; // Positively valued. float w2 = dot(w, w); float product = w2 * difference; if (qw2 < product) // Imaginary roots (0 intersections). { return czm_emptyRaySegment; } else if (qw2 > product) // Distinct roots (2 intersections). { float discriminant = qw * qw - product; float temp = -qw + sqrt(discriminant); // Avoid cancellation. float root0 = temp / w2; float root1 = difference / temp; if (root0 < root1) { czm_raySegment i = czm_raySegment(root0, root1); return i; } else { czm_raySegment i = czm_raySegment(root1, root0); return i; } } else // qw2 == product. Repeated roots (2 intersections). { float root = sqrt(difference / w2); czm_raySegment i = czm_raySegment(root, root); return i; } } } else if (q2 < 1.0) // Inside ellipsoid (2 intersections). { float difference = q2 - 1.0; // Negatively valued. float w2 = dot(w, w); float product = w2 * difference; // Negatively valued. float discriminant = qw * qw - product; float temp = -qw + sqrt(discriminant); // Positively valued. czm_raySegment i = czm_raySegment(0.0, temp / w2); return i; } else // q2 == 1.0. On ellipsoid. { if (qw < 0.0) // Looking inward. { float w2 = dot(w, w); czm_raySegment i = czm_raySegment(0.0, -qw / w2); return i; } else // qw >= 0.0. Looking outward or tangent. { return czm_emptyRaySegment; } } } `,Bye=`/** * Compute the intersection interval of a ray with a sphere. * * @name czm_raySphereIntersectionInterval * @glslFunction * * @param {czm_ray} ray The ray. * @param {vec3} center The center of the sphere. * @param {float} radius The radius of the sphere. * @return {czm_raySegment} The intersection interval of the ray with the sphere. */ czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius) { vec3 o = ray.origin; vec3 d = ray.direction; vec3 oc = o - center; float a = dot(d, d); float b = 2.0 * dot(d, oc); float c = dot(oc, oc) - (radius * radius); float det = (b * b) - (4.0 * a * c); if (det < 0.0) { return czm_emptyRaySegment; } float sqrtDet = sqrt(det); float t0 = (-b - sqrtDet) / (2.0 * a); float t1 = (-b + sqrtDet) / (2.0 * a); czm_raySegment result = czm_raySegment(t0, t1); return result; } `,kye=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords) { return czm_reverseLogDepth(texture(depthTexture, texCoords).r); } `,Vye=`/** * Reads a value previously transformed with {@link czm_writeNonPerspective} * by dividing it by \`w\`, the value used in the perspective divide. * This function is intended to be called in a fragment shader to access a * \`varying\` that should not be subject to perspective interpolation. * For example, screen-space texture coordinates. The value should have been * previously written in the vertex shader with a call to * {@link czm_writeNonPerspective}. * * @name czm_readNonPerspective * @glslFunction * * @param {float|vec2|vec3|vec4} value The non-perspective value to be read. * @param {float} oneOverW One over the perspective divide value, \`w\`. Usually this is simply \`gl_FragCoord.w\`. * @returns {float|vec2|vec3|vec4} The usable value. */ float czm_readNonPerspective(float value, float oneOverW) { return value * oneOverW; } vec2 czm_readNonPerspective(vec2 value, float oneOverW) { return value * oneOverW; } vec3 czm_readNonPerspective(vec3 value, float oneOverW) { return value * oneOverW; } vec4 czm_readNonPerspective(vec4 value, float oneOverW) { return value * oneOverW; } `,zye=`float czm_reverseLogDepth(float logZ) { #ifdef LOG_DEPTH float near = czm_currentFrustum.x; float far = czm_currentFrustum.y; float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne; float depthFromNear = pow(2.0, log2Depth) - 1.0; return far * (1.0 - near / (depthFromNear + near)) / (far - near); #endif return logZ; } `,Hye=`/** * Converts an RGB color to HSB (hue, saturation, brightness) * HSB <-> RGB conversion with minimal branching: {@link http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl} * * @name czm_RGBToHSB * @glslFunction * * @param {vec3} rgb The color in RGB. * * @returns {vec3} The color in HSB. * * @example * vec3 hsb = czm_RGBToHSB(rgb); * hsb.z *= 0.1; * rgb = czm_HSBToRGB(hsb); */ const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); vec3 czm_RGBToHSB(vec3 rgb) { vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g)); vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r)); float d = q.x - min(q.w, q.y); return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x); } `,Uye=`/** * Converts an RGB color to HSL (hue, saturation, lightness) * HSL <-> RGB conversion: {@link http://www.chilliant.com/rgb2hsv.html} * * @name czm_RGBToHSL * @glslFunction * * @param {vec3} rgb The color in RGB. * * @returns {vec3} The color in HSL. * * @example * vec3 hsl = czm_RGBToHSL(rgb); * hsl.z *= 0.1; * rgb = czm_HSLToRGB(hsl); */ vec3 RGBtoHCV(vec3 rgb) { // Based on work by Sam Hocevar and Emil Persson vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0); vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx); float c = q.x - min(q.w, q.y); float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z); return vec3(h, c, q.x); } vec3 czm_RGBToHSL(vec3 rgb) { vec3 hcv = RGBtoHCV(rgb); float l = hcv.z - hcv.y * 0.5; float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7); return vec3(hcv.x, s, l); } `,Gye=`/** * Converts an RGB color to CIE Yxy. *

The conversion is described in * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} *

* * @name czm_RGBToXYZ * @glslFunction * * @param {vec3} rgb The color in RGB. * * @returns {vec3} The color in CIE Yxy. * * @example * vec3 xyz = czm_RGBToXYZ(rgb); * xyz.x = max(xyz.x - luminanceThreshold, 0.0); * rgb = czm_XYZToRGB(xyz); */ vec3 czm_RGBToXYZ(vec3 rgb) { const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193, 0.3576, 0.7152, 0.1192, 0.1805, 0.0722, 0.9505); vec3 xyz = RGB2XYZ * rgb; vec3 Yxy; Yxy.r = xyz.g; float temp = dot(vec3(1.0), xyz); Yxy.gb = xyz.rg / temp; return Yxy; } `,Wye=`/** * Round a floating point value. This function exists because round() doesn't * exist in GLSL 1.00. * * @param {float|vec2|vec3|vec4} value The value to round * @param {float|vec2|vec3|vec3} The rounded value. The type matches the input. */ float czm_round(float value) { return floor(value + 0.5); } vec2 czm_round(vec2 value) { return floor(value + 0.5); } vec3 czm_round(vec3 value) { return floor(value + 0.5); } vec4 czm_round(vec4 value) { return floor(value + 0.5); } `,jye=`/** * Samples the 4 neighboring pixels and return the weighted average. * * @private */ vec3 czm_sampleOctahedralProjectionWithFiltering(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod) { direction /= dot(vec3(1.0), abs(direction)); vec2 rev = abs(direction.zx) - vec2(1.0); vec2 neg = vec2(direction.x < 0.0 ? rev.x : -rev.x, direction.z < 0.0 ? rev.y : -rev.y); vec2 uv = direction.y < 0.0 ? neg : direction.xz; vec2 coord = 0.5 * uv + vec2(0.5); vec2 pixel = 1.0 / textureSize; if (lod > 0.0) { // Each subseqeuent mip level is half the size float scale = 1.0 / pow(2.0, lod); float offset = ((textureSize.y + 1.0) / textureSize.x); coord.x *= offset; coord *= scale; coord.x += offset + pixel.x; coord.y += (1.0 - (1.0 / pow(2.0, lod - 1.0))) + pixel.y * (lod - 1.0) * 2.0; } else { coord.x *= (textureSize.y / textureSize.x); } // Do bilinear filtering #ifndef OES_texture_float_linear vec3 color1 = texture(projectedMap, coord + vec2(0.0, pixel.y)).rgb; vec3 color2 = texture(projectedMap, coord + vec2(pixel.x, 0.0)).rgb; vec3 color3 = texture(projectedMap, coord + pixel).rgb; vec3 color4 = texture(projectedMap, coord).rgb; vec2 texturePosition = coord * textureSize; float fu = fract(texturePosition.x); float fv = fract(texturePosition.y); vec3 average1 = mix(color4, color2, fu); vec3 average2 = mix(color1, color3, fu); vec3 color = mix(average1, average2, fv); #else vec3 color = texture(projectedMap, coord).rgb; #endif return color; } /** * Samples from a cube map that has been projected using an octahedral projection from the given direction. * * @name czm_sampleOctahedralProjection * @glslFunction * * @param {sampler2D} projectedMap The texture with the octahedral projected cube map. * @param {vec2} textureSize The width and height dimensions in pixels of the projected map. * @param {vec3} direction The normalized direction used to sample the cube map. * @param {float} lod The level of detail to sample. * @param {float} maxLod The maximum level of detail. * @returns {vec3} The color of the cube map at the direction. */ vec3 czm_sampleOctahedralProjection(sampler2D projectedMap, vec2 textureSize, vec3 direction, float lod, float maxLod) { float currentLod = floor(lod + 0.5); float nextLod = min(currentLod + 1.0, maxLod); vec3 colorCurrentLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, currentLod); vec3 colorNextLod = czm_sampleOctahedralProjectionWithFiltering(projectedMap, textureSize, direction, nextLod); return mix(colorNextLod, colorCurrentLod, nextLod - lod); } `,Yye=`/** * Adjusts the saturation of a color. * * @name czm_saturation * @glslFunction * * @param {vec3} rgb The color. * @param {float} adjustment The amount to adjust the saturation of the color. * * @returns {float} The color with the saturation adjusted. * * @example * vec3 greyScale = czm_saturation(color, 0.0); * vec3 doubleSaturation = czm_saturation(color, 2.0); */ vec3 czm_saturation(vec3 rgb, float adjustment) { // Algorithm from Chapter 16 of OpenGL Shading Language const vec3 W = vec3(0.2125, 0.7154, 0.0721); vec3 intensity = vec3(dot(rgb, W)); return mix(intensity, rgb, adjustment); } `,qye=` float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { return czm_unpackDepth(czm_textureCube(shadowMap, d)); } float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) { #ifdef USE_SHADOW_DEPTH_TEXTURE return texture(shadowMap, uv).r; #else return czm_unpackDepth(texture(shadowMap, uv)); #endif } float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) { return step(depth, czm_sampleShadowMap(shadowMap, uv)); } float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) { return step(depth, czm_sampleShadowMap(shadowMap, uv)); } `,Xye=` float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) { #ifdef USE_NORMAL_SHADING #ifdef USE_NORMAL_SHADING_SMOOTH float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0); #else float strength = step(0.0, nDotL); #endif visibility *= strength; #endif visibility = max(visibility, darkness); return visibility; } #ifdef USE_CUBE_MAP_SHADOW float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters) { float depthBias = shadowParameters.depthBias; float depth = shadowParameters.depth; float nDotL = shadowParameters.nDotL; float normalShadingSmooth = shadowParameters.normalShadingSmooth; float darkness = shadowParameters.darkness; vec3 uvw = shadowParameters.texCoords; depth -= depthBias; float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } #else float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters) { float depthBias = shadowParameters.depthBias; float depth = shadowParameters.depth; float nDotL = shadowParameters.nDotL; float normalShadingSmooth = shadowParameters.normalShadingSmooth; float darkness = shadowParameters.darkness; vec2 uv = shadowParameters.texCoords; depth -= depthBias; #ifdef USE_SOFT_SHADOWS vec2 texelStepSize = shadowParameters.texelStepSize; float radius = 1.0; float dx0 = -texelStepSize.x * radius; float dy0 = -texelStepSize.y * radius; float dx1 = texelStepSize.x * radius; float dy1 = texelStepSize.y * radius; float visibility = ( czm_shadowDepthCompare(shadowMap, uv, depth) + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) + czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) + czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) + czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) + czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth) ) * (1.0 / 9.0); #else float visibility = czm_shadowDepthCompare(shadowMap, uv, depth); #endif return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } #endif `,Jye=`/** * Returns 1.0 if the given value is positive or zero, and -1.0 if it is negative. This is similar to the GLSL * built-in function sign except that returns 1.0 instead of 0.0 when the input value is 0.0. * * @name czm_signNotZero * @glslFunction * * @param {} value The value for which to determine the sign. * @returns {} 1.0 if the value is positive or zero, -1.0 if the value is negative. */ float czm_signNotZero(float value) { return value >= 0.0 ? 1.0 : -1.0; } vec2 czm_signNotZero(vec2 value) { return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y)); } vec3 czm_signNotZero(vec3 value) { return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z)); } vec4 czm_signNotZero(vec4 value) { return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } `,Kye=`/** * Computes a color from the third order spherical harmonic coefficients and a normalized direction vector. *

* The order of the coefficients is [L00, L1_1, L10, L11, L2_2, L2_1, L20, L21, L22]. *

* * @name czm_sphericalHarmonics * @glslFunction * * @param {vec3} normal The normalized direction. * @param {vec3[9]} coefficients The third order spherical harmonic coefficients. * @returns {vec3} The color at the direction. * * @see https://graphics.stanford.edu/papers/envmap/envmap.pdf */ vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) { vec3 L00 = coefficients[0]; vec3 L1_1 = coefficients[1]; vec3 L10 = coefficients[2]; vec3 L11 = coefficients[3]; vec3 L2_2 = coefficients[4]; vec3 L2_1 = coefficients[5]; vec3 L20 = coefficients[6]; vec3 L21 = coefficients[7]; vec3 L22 = coefficients[8]; float x = normal.x; float y = normal.y; float z = normal.z; return L00 + L1_1 * y + L10 * z + L11 * x + L2_2 * (y * x) + L2_1 * (y * z) + L20 * (3.0 * z * z - 1.0) + L21 * (z * x) + L22 * (x * x - y * y); } `,Qye=`/** * Converts an sRGB color to a linear RGB color. * * @param {vec3|vec4} srgbIn The color in sRGB space * @returns {vec3|vec4} The color in linear color space. The vector type matches the input. */ vec3 czm_srgbToLinear(vec3 srgbIn) { return pow(srgbIn, vec3(2.2)); } vec4 czm_srgbToLinear(vec4 srgbIn) { vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); return vec4(linearOut, srgbIn.a); } `,Zye=`/** * Creates a matrix that transforms vectors from tangent space to eye space. * * @name czm_tangentToEyeSpaceMatrix * @glslFunction * * @param {vec3} normalEC The normal vector in eye coordinates. * @param {vec3} tangentEC The tangent vector in eye coordinates. * @param {vec3} bitangentEC The bitangent vector in eye coordinates. * * @returns {mat3} The matrix that transforms from tangent space to eye space. * * @example * mat3 tangentToEye = czm_tangentToEyeSpaceMatrix(normalEC, tangentEC, bitangentEC); * vec3 normal = tangentToEye * texture(normalMap, st).xyz; */ mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) { vec3 normal = normalize(normalEC); vec3 tangent = normalize(tangentEC); vec3 bitangent = normalize(bitangentEC); return mat3(tangent.x , tangent.y , tangent.z, bitangent.x, bitangent.y, bitangent.z, normal.x , normal.y , normal.z); } `,$ye=`/** * A wrapper around the texture (WebGL2) / textureCube (WebGL1) * function to allow for WebGL 1 support. * * @name czm_textureCube * @glslFunction * * @param {samplerCube} sampler The sampler. * @param {vec3} p The coordinates to sample the texture at. */ vec4 czm_textureCube(samplerCube sampler, vec3 p) { #if __VERSION__ == 300 return texture(sampler, p); #else return textureCube(sampler, p); #endif }`,exe=`/** * Transforms a plane. * * @name czm_transformPlane * @glslFunction * * @param {vec4} plane The plane in Hessian Normal Form. * @param {mat4} transform The inverse-transpose of a transformation matrix. */ vec4 czm_transformPlane(vec4 plane, mat4 transform) { vec4 transformedPlane = transform * plane; // Convert the transformed plane to Hessian Normal Form float normalMagnitude = length(transformedPlane.xyz); return transformedPlane / normalMagnitude; } `,txe=`/** * Translates a position (or any vec3) that was encoded with {@link EncodedCartesian3}, * and then provided to the shader as separate high and low bits to * be relative to the eye. As shown in the example, the position can then be transformed in eye * or clip coordinates using {@link czm_modelViewRelativeToEye} or {@link czm_modelViewProjectionRelativeToEye}, * respectively. *

* This technique, called GPU RTE, eliminates jittering artifacts when using large coordinates as * described in {@link http://help.agi.com/AGIComponents/html/BlogPrecisionsPrecisions.htm|Precisions, Precisions}. *

* * @name czm_translateRelativeToEye * @glslFunction * * @param {vec3} high The position's high bits. * @param {vec3} low The position's low bits. * @returns {vec3} The position translated to be relative to the camera's position. * * @example * in vec3 positionHigh; * in vec3 positionLow; * * void main() * { * vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); * gl_Position = czm_modelViewProjectionRelativeToEye * p; * } * * @see czm_modelViewRelativeToEye * @see czm_modelViewProjectionRelativeToEye * @see czm_computePosition * @see EncodedCartesian3 */ vec4 czm_translateRelativeToEye(vec3 high, vec3 low) { vec3 highDifference = high - czm_encodedCameraPositionMCHigh; vec3 lowDifference = low - czm_encodedCameraPositionMCLow; return vec4(highDifference + lowDifference, 1.0); } `,ixe=`/** * @private */ vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { // Diffuse from directional light sources at eye (for top-down and horizon views) float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); if (czm_sceneMode == czm_sceneMode3D) { // (and horizon views in 3D) diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal); } diffuse = clamp(diffuse, 0.0, 1.0); float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess); // Temporary workaround for adding ambient. vec3 materialDiffuse = material.diffuse * 0.5; vec3 ambient = materialDiffuse; vec3 color = ambient + material.emission; color += materialDiffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } `,rxe=`/** * Returns the transpose of the matrix. The input matrix can be * a mat2, mat3, or mat4. * * @name czm_transpose * @glslFunction * * @param {} matrix The matrix to transpose. * * @returns {} The transposed matrix. * * @example * // GLSL declarations * mat2 czm_transpose(mat2 matrix); * mat3 czm_transpose(mat3 matrix); * mat4 czm_transpose(mat4 matrix); * * // Transpose a 3x3 rotation matrix to find its inverse. * mat3 eastNorthUpToEye = czm_eastNorthUpToEyeCoordinates( * positionMC, normalEC); * mat3 eyeToEastNorthUp = czm_transpose(eastNorthUpToEye); */ mat2 czm_transpose(mat2 matrix) { return mat2( matrix[0][0], matrix[1][0], matrix[0][1], matrix[1][1]); } mat3 czm_transpose(mat3 matrix) { return mat3( matrix[0][0], matrix[1][0], matrix[2][0], matrix[0][1], matrix[1][1], matrix[2][1], matrix[0][2], matrix[1][2], matrix[2][2]); } mat4 czm_transpose(mat4 matrix) { return mat4( matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0], matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); } `,nxe=`/** * Unpacks a vec4 depth value to a float in [0, 1) range. * * @name czm_unpackDepth * @glslFunction * * @param {vec4} packedDepth The packed depth. * * @returns {float} The floating-point depth in [0, 1) range. */ float czm_unpackDepth(vec4 packedDepth) { // See Aras Pranckevi\u010Dius' post Encoding Floats to RGBA // http://aras-p.info/blog/2009/07/30/encoding-floats-to-rgba-the-final/ return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } `,oxe=`/** * Unpack an IEEE 754 single-precision float that is packed as a little-endian unsigned normalized vec4. * * @name czm_unpackFloat * @glslFunction * * @param {vec4} packedFloat The packed float. * * @returns {float} The floating-point depth in arbitrary range. */ float czm_unpackFloat(vec4 packedFloat) { // Convert to [0.0, 255.0] and round to integer packedFloat = floor(packedFloat * 255.0 + 0.5); float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0; if (exponent == -127.0) { return 0.0; } float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000); float result = sign * exp2(exponent - 23.0) * mantissa; return result; } `,axe=`/** * Unpack unsigned integers of 1-4 bytes. in WebGL 1, there is no uint type, * so the return value is an int. *

* There are also precision limitations in WebGL 1. highp int is still limited * to 24 bits. Above the value of 2^24 = 16777216, precision loss may occur. *

* * @param {float|vec2|vec3|vec4} packed The packed value. For vectors, the components are listed in little-endian order. * * @return {int} The unpacked value. */ int czm_unpackUint(float packedValue) { float rounded = czm_round(packedValue * 255.0); return int(rounded); } int czm_unpackUint(vec2 packedValue) { vec2 rounded = czm_round(packedValue * 255.0); return int(dot(rounded, vec2(1.0, 256.0))); } int czm_unpackUint(vec3 packedValue) { vec3 rounded = czm_round(packedValue * 255.0); return int(dot(rounded, vec3(1.0, 256.0, 65536.0))); } int czm_unpackUint(vec4 packedValue) { vec4 rounded = czm_round(packedValue * 255.0); return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); } `,sxe=`/** * Transform metadata values following the EXT_structural_metadata spec * by multiplying by scale and adding the offset. Operations are always * performed component-wise, even for matrices. * * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} offset The offset to add * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} scale The scale factor to multiply * @param {float|vec2|vec3|vec4|mat2|mat3|mat4} value The original value. * * @return {float|vec2|vec3|vec4|mat2|mat3|mat4} The transformed value of the same scalar/vector/matrix type as the input. */ float czm_valueTransform(float offset, float scale, float value) { return scale * value + offset; } vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { return scale * value + offset; } vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) { return scale * value + offset; } vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) { return scale * value + offset; } mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) { return matrixCompMult(scale, value) + offset; } mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) { return matrixCompMult(scale, value) + offset; } mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { return matrixCompMult(scale, value) + offset; } `,lxe=`#ifdef LOG_DEPTH // 1.0 at the near plane, increasing linearly from there. out float v_depthFromNearPlusOne; #if defined(SHADOW_MAP) || defined(VIDEO_SHADOW_MAP) out vec3 v_logPositionEC; #endif #endif vec4 czm_updatePositionDepth(vec4 coords) { #if defined(LOG_DEPTH) #if defined(SHADOW_MAP) || defined(VIDEO_SHADOW_MAP) vec3 logPositionEC = (czm_inverseProjection * coords).xyz; v_logPositionEC = logPositionEC; #endif // With the very high far/near ratios used with the logarithmic depth // buffer, floating point rounding errors can cause linear depth values // to end up on the wrong side of the far plane, even for vertices that // are really nowhere near it. Since we always write a correct logarithmic // depth value in the fragment shader anyway, we just need to make sure // such errors don't cause the primitive to be clipped entirely before // we even get to the fragment shader. coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w; #endif return coords; } /** * Writes the logarithmic depth to gl_Position using the already computed gl_Position. * * @name czm_vertexLogDepth * @glslFunction */ void czm_vertexLogDepth() { #ifdef LOG_DEPTH v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0; gl_Position = czm_updatePositionDepth(gl_Position); #endif } /** * Writes the logarithmic depth to gl_Position using the provided clip coordinates. *

* An example use case for this function would be moving the vertex in window coordinates * before converting back to clip coordinates. Use the original vertex clip coordinates. *

* @name czm_vertexLogDepth * @glslFunction * * @param {vec4} clipCoords The vertex in clip coordinates. * * @example * czm_vertexLogDepth(czm_projection * vec4(positionEyeCoordinates, 1.0)); */ void czm_vertexLogDepth(vec4 clipCoords) { #ifdef LOG_DEPTH v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; czm_updatePositionDepth(clipCoords); #endif } `,uxe=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { // Reconstruct NDC coordinates float x = 2.0 * screenCoordinate.x - 1.0; float y = 2.0 * screenCoordinate.y - 1.0; float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2]; vec4 q = vec4(x, y, z, 1.0); // Reverse the perspective division to obtain clip coordinates. q /= screenCoordinate.w; // Reverse the projection transformation to obtain eye coordinates. if (!(czm_inverseProjection == mat4(0.0))) // IE and Edge sometimes do something weird with != between mat4s { q = czm_inverseProjection * q; } else { float top = czm_frustumPlanes.x; float bottom = czm_frustumPlanes.y; float left = czm_frustumPlanes.z; float right = czm_frustumPlanes.w; float near = czm_currentFrustum.x; float far = czm_currentFrustum.y; q.x = (q.x * (right - left) + left + right) * 0.5; q.y = (q.y * (top - bottom) + bottom + top) * 0.5; q.z = (q.z * (near - far) - near - far) * 0.5; q.w = 1.0; } return q; } /** * Transforms a position from window to eye coordinates. * The transform from window to normalized device coordinates is done using components * of (@link czm_viewport} and {@link czm_viewportTransformation} instead of calculating * the inverse of czm_viewportTransformation. The transformation from * normalized device coordinates to clip coordinates is done using fragmentCoordinate.w, * which is expected to be the scalar used in the perspective divide. The transformation * from clip to eye coordinates is done using {@link czm_inverseProjection}. * * @name czm_windowToEyeCoordinates * @glslFunction * * @param {vec4} fragmentCoordinate The position in window coordinates to transform. * * @returns {vec4} The transformed position in eye coordinates. * * @see czm_modelToWindowCoordinates * @see czm_eyeToWindowCoordinates * @see czm_inverseProjection * @see czm_viewport * @see czm_viewportTransformation * * @example * vec4 positionEC = czm_windowToEyeCoordinates(gl_FragCoord); */ vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate) { vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw; return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw)); } vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth) { // See reverseLogDepth.glsl. This is separate to re-use the pow. #if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY) float near = czm_currentFrustum.x; float far = czm_currentFrustum.y; float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne; float depthFromNear = pow(2.0, log2Depth) - 1.0; float depthFromCamera = depthFromNear + near; vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0); vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); eyeCoordinate.w = 1.0 / depthFromCamera; // Better precision return eyeCoordinate; #else vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0); vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord); #endif return eyeCoordinate; } /** * Transforms a position given as window x/y and a depth or a log depth from window to eye coordinates. * This function produces more accurate results for window positions with log depth than * conventionally unpacking the log depth using czm_reverseLogDepth and using the standard version * of czm_windowToEyeCoordinates. * * @name czm_windowToEyeCoordinates * @glslFunction * * @param {vec2} fragmentCoordinateXY The XY position in window coordinates to transform. * @param {float} depthOrLogDepth A depth or log depth for the fragment. * * @see czm_modelToWindowCoordinates * @see czm_eyeToWindowCoordinates * @see czm_inverseProjection * @see czm_viewport * @see czm_viewportTransformation * * @returns {vec4} The transformed position in eye coordinates. */ vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth) { vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } `,cxe=`// emulated noperspective #if !defined(LOG_DEPTH) in float v_WindowZ; #endif /** * Emulates GL_DEPTH_CLAMP. Clamps a fragment to the near and far plane * by writing the fragment's depth. See czm_depthClamp for more details. * * @name czm_writeDepthClamp * @glslFunction * * @example * out_FragColor = color; * czm_writeDepthClamp(); * * @see czm_depthClamp */ void czm_writeDepthClamp() { #if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif } `,hxe=`#ifdef LOG_DEPTH in float v_depthFromNearPlusOne; #ifdef POLYGON_OFFSET uniform vec2 u_polygonOffset; #endif #endif /** * Writes the fragment depth to the logarithmic depth buffer. *

* Use this when the vertex shader does not call {@link czm_vertexlogDepth}, for example, when * ray-casting geometry using a full screen quad. *

* @name czm_writeLogDepth * @glslFunction * * @param {float} depth The depth coordinate, where 1.0 is on the near plane and * depth increases in eye-space units from there * * @example * czm_writeLogDepth((czm_projection * v_positionEyeCoordinates).w + 1.0); */ void czm_writeLogDepth(float depth) { #if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) // Discard the vertex if it's not between the near and far planes. // We allow a bit of epsilon on the near plane comparison because a 1.0 // from the vertex shader (indicating the vertex should be _on_ the near // plane) will not necessarily come here as exactly 1.0. if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) { discard; } #ifdef POLYGON_OFFSET // Polygon offset: m * factor + r * units float factor = u_polygonOffset[0]; float units = u_polygonOffset[1]; #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) // This factor doesn't work in IE 10 if (factor != 0.0) { // m = sqrt(dZdX^2 + dZdY^2); float x = dFdx(depth); float y = dFdy(depth); float m = sqrt(x * x + y * y); // Apply the factor before computing the log depth. depth += m * factor; } #endif #endif gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne; #ifdef POLYGON_OFFSET // Apply the units after the log depth. gl_FragDepth += czm_epsilon7 * units; #endif #endif } /** * Writes the fragment depth to the logarithmic depth buffer. *

* Use this when the vertex shader calls {@link czm_vertexlogDepth}. *

* * @name czm_writeLogDepth * @glslFunction */ void czm_writeLogDepth() { #ifdef LOG_DEPTH czm_writeLogDepth(v_depthFromNearPlusOne); #endif } `,dxe=`/** * Transforms a value for non-perspective interpolation by multiplying * it by w, the value used in the perspective divide. This function is * intended to be called in a vertex shader to compute the value of a * \`varying\` that should not be subject to perspective interpolation. * For example, screen-space texture coordinates. The fragment shader * must call {@link czm_readNonPerspective} to retrieve the final * non-perspective value. * * @name czm_writeNonPerspective * @glslFunction * * @param {float|vec2|vec3|vec4} value The value to be interpolated without accounting for perspective. * @param {float} w The perspective divide value. Usually this is the computed \`gl_Position.w\`. * @returns {float|vec2|vec3|vec4} The transformed value, intended to be stored in a \`varying\` and read in the * fragment shader with {@link czm_readNonPerspective}. */ float czm_writeNonPerspective(float value, float w) { return value * w; } vec2 czm_writeNonPerspective(vec2 value, float w) { return value * w; } vec3 czm_writeNonPerspective(vec3 value, float w) { return value * w; } vec4 czm_writeNonPerspective(vec4 value, float w) { return value * w; } `,fxe=`/** * Converts a CIE Yxy color to RGB. *

The conversion is described in * {@link http://content.gpwiki.org/index.php/D3DBook:High-Dynamic_Range_Rendering#Luminance_Transform|Luminance Transform} *

* * @name czm_XYZToRGB * @glslFunction * * @param {vec3} Yxy The color in CIE Yxy. * * @returns {vec3} The color in RGB. * * @example * vec3 xyz = czm_RGBToXYZ(rgb); * xyz.x = max(xyz.x - luminanceThreshold, 0.0); * rgb = czm_XYZToRGB(xyz); */ vec3 czm_XYZToRGB(vec3 Yxy) { const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, -1.5371, 1.8760, -0.2040, -0.4985, 0.0416, 1.0572); vec3 xyz; xyz.r = Yxy.r * Yxy.g / Yxy.b; xyz.g = Yxy.r; xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; return XYZ2RGB * xyz; } `,V7={czm_degreesPerRadian:j_e,czm_depthRange:Y_e,czm_epsilon1:q_e,czm_epsilon2:X_e,czm_epsilon3:J_e,czm_epsilon4:K_e,czm_epsilon5:Q_e,czm_epsilon6:Z_e,czm_epsilon7:$_e,czm_infinity:eve,czm_oneOverPi:tve,czm_oneOverTwoPi:ive,czm_passCesium3DTile:rve,czm_passCesium3DTileClassification:nve,czm_passCesium3DTileClassificationIgnoreShow:ove,czm_passClassification:ave,czm_passCompute:sve,czm_passEnvironment:lve,czm_passGlobe:uve,czm_passOpaque:cve,czm_passOverlay:hve,czm_passTerrainClassification:dve,czm_passTranslucent:fve,czm_passVoxels:pve,czm_pi:mve,czm_piOverFour:gve,czm_piOverSix:_ve,czm_piOverThree:vve,czm_piOverTwo:yve,czm_radiansPerDegree:xve,czm_sceneMode2D:Cve,czm_sceneMode3D:bve,czm_sceneModeColumbusView:wve,czm_sceneModeMorphing:Ave,czm_solarRadius:Eve,czm_threePiOver2:Tve,czm_twoPi:Sve,czm_webMercatorMaxLatitude:Pve,czm_depthRangeStruct:Ive,czm_material:Mve,czm_materialInput:Dve,czm_modelMaterial:Lve,czm_modelVertexOutput:Rve,czm_pbrParameters:Ove,czm_ray:Nve,czm_raySegment:Fve,czm_shadowParameters:Bve,czm_acesTonemapping:kve,czm_alphaWeight:Vve,czm_antialias:zve,czm_approximateSphericalCoordinates:Hve,czm_backFacing:Uve,czm_branchFreeTernary:Gve,czm_cascadeColor:Wve,czm_cascadeDistance:jve,czm_cascadeMatrix:Yve,czm_cascadeWeights:qve,czm_columbusViewMorph:Xve,czm_computePosition:Jve,czm_cosineAndSine:Kve,czm_decompressTextureCoordinates:Qve,czm_defaultPbrMaterial:Zve,czm_depthClamp:$ve,czm_eastNorthUpToEyeCoordinates:eye,czm_ellipsoidContainsPoint:tye,czm_ellipsoidWgs84TextureCoordinates:iye,czm_equalsEpsilon:rye,czm_eyeOffset:nye,czm_eyeToWindowCoordinates:oye,czm_fastApproximateAtan:aye,czm_fog:sye,czm_gammaCorrect:lye,czm_geodeticSurfaceNormal:uye,czm_getDefaultMaterial:cye,czm_getLambertDiffuse:hye,czm_getSpecular:dye,czm_getWaterNoise:fye,czm_HSBToRGB:pye,czm_HSLToRGB:mye,czm_hue:gye,czm_inverseGamma:_ye,czm_isEmpty:vye,czm_isFull:yye,czm_latitudeToWebMercatorFraction:xye,czm_linearToSrgb:Cye,czm_lineDistance:bye,czm_luminance:wye,czm_metersPerPixel:Aye,czm_modelToWindowCoordinates:Eye,czm_multiplyWithColorBalance:Tye,czm_nearFarScalar:Sye,czm_octDecode:Pye,czm_packDepth:Iye,czm_pbrLighting:Mye,czm_pbrMetallicRoughnessMaterial:Dye,czm_pbrSpecularGlossinessMaterial:Lye,czm_phong:Rye,czm_planeDistance:Oye,czm_pointAlongRay:Nye,czm_rayEllipsoidIntersectionInterval:Fye,czm_raySphereIntersectionInterval:Bye,czm_readDepth:kye,czm_readNonPerspective:Vye,czm_reverseLogDepth:zye,czm_RGBToHSB:Hye,czm_RGBToHSL:Uye,czm_RGBToXYZ:Gye,czm_round:Wye,czm_sampleOctahedralProjection:jye,czm_saturation:Yye,czm_shadowDepthCompare:qye,czm_shadowVisibility:Xye,czm_signNotZero:Jye,czm_sphericalHarmonics:Kye,czm_srgbToLinear:Qye,czm_tangentToEyeSpaceMatrix:Zye,czm_textureCube:$ye,czm_transformPlane:exe,czm_translateRelativeToEye:txe,czm_translucentPhong:ixe,czm_transpose:rxe,czm_unpackDepth:nxe,czm_unpackFloat:oxe,czm_unpackUint:axe,czm_valueTransform:sxe,czm_vertexLogDepth:lxe,czm_windowToEyeCoordinates:uxe,czm_writeDepthClamp:cxe,czm_writeLogDepth:hxe,czm_writeNonPerspective:dxe,czm_XYZToRGB:fxe};function WTt(o,f){let m=o;return m=m.replaceAll("version 300 es",""),m=m.replaceAll(/(texture\()/g,"texture2D("),f?(m=m.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"varying $2"),/out_FragData_(\d+)/.test(m)&&(m=`#extension GL_EXT_draw_buffers : enable ${m}`,m=m.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),m=m.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),m=m.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),m=m.replaceAll(/out_FragColor/g,"gl_FragColor"),m=m.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(m)&&(m=`#extension GL_EXT_frag_depth : enable ${m}`,m=m.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),m=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif ${m}`):(m=m.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),m=m.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),m=`#version 100 ${m}`,m}var pxe=WTt;function z7e(o){return o=o.replace(/\/\/.*/g,""),o.replace(/\/\*\*[\s\S]*?\*\//gm,function(f){let m=f.match(/\n/gm).length,v="";for(let y=0;y0;){let y=o.pop();m.push(y),y.requiredBy.length===0&&f.push(y)}for(;f.length>0;){let y=f.shift();o.push(y);for(let x=0;x=0;--y)v=`${v+f[y].glslSource} `;return v.replace(m.glslSource,"")}function G7e(o,f,m){let v,y,x="",C=o.sources;if(N(C))for(v=0,y=C.length;v0&&(v.glVertexAttribDivisor(E,this.instanceDivisor),v._vertexAttribDivisors[E]=this.instanceDivisor,v._previousDrawInstanced=!0)},w.disableVertexAttribArray=function(A){A.disableVertexAttribArray(this.index),this.instanceDivisor>0&&v.glVertexAttribDivisor(m,0)};else{switch(w.componentsPerAttribute){case 1:w.vertexAttrib=function(A){A.vertexAttrib1fv(this.index,this.value)};break;case 2:w.vertexAttrib=function(A){A.vertexAttrib2fv(this.index,this.value)};break;case 3:w.vertexAttrib=function(A){A.vertexAttrib3fv(this.index,this.value)};break;case 4:w.vertexAttrib=function(A){A.vertexAttrib4fv(this.index,this.value)};break}w.disableVertexAttribArray=function(A){}}o.push(w)}function Y7e(o,f,m){for(let v=0;v0&&(A=!0),N(C[x].value)&&(E=!0);let S;f.vertexArrayObject&&(S=f.glCreateVertexArray(),f.glBindVertexArray(S),Y7e(m,C,y),f.glBindVertexArray(null)),this._numberOfVertices=w,this._hasInstancedAttributes=A,this._hasConstantAttributes=E,this._context=f,this._gl=m,this._vao=S,this._attributes=C,this._indexBuffer=y}function GNe(o){return o.values.length/o.componentsPerAttribute}function sSt(o){return Rt.getSizeInBytes(o.componentDatatype)*o.componentsPerAttribute}function lSt(o){let f,m,v,y=[];for(m in o)o.hasOwnProperty(m)&&N(o[m])&&N(o[m].values)&&(y.push(m),o[m].componentDatatype===Rt.DOUBLE&&(o[m].componentDatatype=Rt.FLOAT,o[m].values=Rt.createTypedArray(Rt.FLOAT,o[m].values)));let x,C=y.length;if(C>0)for(x=GNe(o[y[0]]),f=1;f0){let E=Rt.getSizeInBytes(o[y[0]].componentDatatype),T=w%E;T!==0&&(w+=E-T);let S=x*w,M=new ArrayBuffer(S),I={};for(f=0;f=xe.SIXTY_FOUR_KILOBYTES&&f.elementIndexUint?M=Ao.createIndexBuffer({context:f,typedArray:new Uint32Array(I),usage:v,indexDatatype:ro.UNSIGNED_INT}):M=Ao.createIndexBuffer({context:f,typedArray:new Uint16Array(I),usage:v,indexDatatype:ro.UNSIGNED_SHORT})),new gM({context:f,attributes:T,indexBuffer:M})};Object.defineProperties(gM.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});gM.prototype.getAttribute=function(o){return this._attributes[o]};function uSt(o){let f=o._context,m=o._hasInstancedAttributes;if(!m&&!f._previousDrawInstanced)return;f._previousDrawInstanced=m;let v=f._vertexAttribDivisors,y=o._attributes,x=Bo.maximumVertexAttributes,C;if(m){let w=y.length;for(C=0;C0&&(f.glVertexAttribDivisor(C,0),v[C]=0)}function cSt(o,f){let m=o._attributes,v=m.length;for(let y=0;y0?Rt.getSizeInBytes(o[0].componentDatatype):0,y=v>0?f%v:0,x=y===0?0:v-y;return f+=x,f};Hg._createArrayViews=function(o,f){let m=[],v=0,y=o.length;for(let x=0;x0){let m=new ArrayBuffer(f*o.vertexSizeInBytes);if(N(o.arrayBuffer)){let x=new Uint8Array(m),C=new Uint8Array(o.arrayBuffer),w=C.length;for(let A=0;A0){f.needsCommit=!1;let m=f.vertexBuffer,v=o._size*f.vertexSizeInBytes,y=N(m);if(!y||m.sizeInBytes0){let v=o.vertexSizeInBytes*f,y=o.vertexSizeInBytes*m;o.vertexBuffer.copyFromArrayView(new Uint8Array(o.arrayBuffer,v,y),v)}}Hg.prototype.endSubCommits=function(){let o=this._allBuffers;for(let f=0,m=o.length;f 0.0) { // Don't get the outline edge exceed the SDF_EDGE float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE); float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); vec4 sdfColor = mix(outlineColor, v_color, outlineFactor); float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance); return vec4(sdfColor.rgb, sdfColor.a * alpha); } else { float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance); return vec4(v_color.rgb, v_color.a * alpha); } } #endif void main() { vec4 color = texture(u_atlas, v_textureCoordinates); #ifdef SDF float outlineWidth = v_outlineWidth; vec4 outlineColor = v_outlineColor; // Get the current distance float distance = getDistance(v_textureCoordinates); #if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives)) float smoothing = fwidth(distance); // Get an offset that is approximately half the distance to the neighbor pixels // 0.354 is approximately half of 1/sqrt(2) vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates)); // Sample the center point vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); // Sample the 4 neighbors vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing); vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing); // Equally weight the center sample and the 4 neighboring samples color = (center + color1 + color2 + color3 + color4)/5.0; #else // If no derivatives available (IE 10?), just do a single sample float smoothing = 1.0/32.0; color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing); #endif color = czm_gammaCorrect(color); #else color = czm_gammaCorrect(color); color *= czm_gammaCorrect(v_color); #endif // Fully transparent parts of the billboard are not pickable. #if !defined(OPAQUE) && !defined(TRANSLUCENT) if (color.a < 0.005) // matches 0/255 and 1/255 { discard; } #else // The billboard is rendered twice. The opaque pass discards translucent fragments // and the translucent pass discards opaque fragments. #ifdef OPAQUE if (color.a < 0.995) // matches < 254/255 { discard; } #else if (color.a >= 0.995) // matches 254/255 and 255/255 { discard; } #endif #endif #ifdef VECTOR_TILE color *= u_highlightColor; #endif out_FragColor = color; #ifdef LOG_DEPTH czm_writeLogDepth(); #endif #ifdef FRAGMENT_DEPTH_CHECK float temp = v_compressed.y; temp = temp * SHIFT_RIGHT1; float temp2 = (temp - floor(temp)) * SHIFT_LEFT1; bool enableDepthTest = temp2 != 0.0; bool applyTranslate = floor(temp) != 0.0; if (enableDepthTest) { temp = v_compressed.z; temp = temp * SHIFT_RIGHT12; vec2 dimensions; dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; dimensions.x = floor(temp); temp = v_compressed.w; temp = temp * SHIFT_RIGHT12; vec2 imageSize; imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12; imageSize.x = floor(temp); vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy; adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y); float epsilonEyeDepth = v_compressed.x + czm_epsilon1; float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize); // negative values go into the screen if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth) { float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize); // top left corner if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth) { float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize); // top right corner if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth) { discard; } } } } #endif } `,vxe=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScale; in vec4 positionLowAndRotation; in vec4 compressedAttribute0; // pixel offset, translate, horizontal origin, vertical origin, show, direction, texture coordinates (texture offset) in vec4 compressedAttribute1; // aligned axis, translucency by distance, image width in vec4 compressedAttribute2; // label horizontal origin, image height, color, pick color, size in meters, valid aligned axis, 13 bits free in vec4 eyeOffset; // eye offset in meters, 4 bytes free (texture range) in vec4 scaleByDistance; // near, nearScale, far, farScale in vec4 pixelOffsetScaleByDistance; // near, nearScale, far, farScale in vec4 compressedAttribute3; // distance display condition near, far, disableDepthTestDistance, dimensions in vec2 sdf; // sdf outline color (rgb) and width (w) #if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) in vec4 textureCoordinateBoundsOrLabelTranslate; // the min and max x and y values for the texture coordinates #endif #ifdef VECTOR_TILE in float a_batchId; #endif out vec2 v_textureCoordinates; #ifdef FRAGMENT_DEPTH_CHECK out vec4 v_textureCoordinateBounds; out vec4 v_originTextureCoordinateAndTranslate; out vec4 v_compressed; // x: eyeDepth, y: applyTranslate & enableDepthCheck, z: dimensions, w: imageSize out mat2 v_rotationMatrix; #endif out vec4 v_pickColor; out vec4 v_color; #ifdef SDF out vec4 v_outlineColor; out float v_outlineWidth; #endif const float UPPER_BOUND = 32768.0; const float SHIFT_LEFT16 = 65536.0; const float SHIFT_LEFT12 = 4096.0; const float SHIFT_LEFT8 = 256.0; const float SHIFT_LEFT7 = 128.0; const float SHIFT_LEFT5 = 32.0; const float SHIFT_LEFT3 = 8.0; const float SHIFT_LEFT2 = 4.0; const float SHIFT_LEFT1 = 2.0; const float SHIFT_RIGHT12 = 1.0 / 4096.0; const float SHIFT_RIGHT8 = 1.0 / 256.0; const float SHIFT_RIGHT7 = 1.0 / 128.0; const float SHIFT_RIGHT5 = 1.0 / 32.0; const float SHIFT_RIGHT3 = 1.0 / 8.0; const float SHIFT_RIGHT2 = 1.0 / 4.0; const float SHIFT_RIGHT1 = 1.0 / 2.0; vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp) { // Note the halfSize cannot be computed in JavaScript because it is sent via // compressed vertex attributes that coerce it to an integer. vec2 halfSize = imageSize * scale * 0.5; halfSize *= ((direction * 2.0) - 1.0); vec2 originTranslate = origin * abs(halfSize); #if defined(ROTATION) || defined(ALIGNED_AXIS) if (validAlignedAxis || rotation != 0.0) { float angle = rotation; if (validAlignedAxis) { vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0); angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) / (projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y)); } float cosTheta = cos(angle); float sinTheta = sin(angle); rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta); halfSize = rotationMatrix * halfSize; } else { rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); } #endif mpp = czm_metersPerPixel(positionEC); positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp); positionEC.xy += (translate + pixelOffset) * mpp; return positionEC; } #ifdef VERTEX_DEPTH_CHECK float getGlobeDepth(vec4 positionEC) { vec4 posWC = czm_eyeToWindowCoordinates(positionEC); float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw)); if (globeDepth == 0.0) { return 0.0; // not on the globe } vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth); return eyeCoordinate.z / eyeCoordinate.w; } #endif void main() { // Modifying this shader may also require modifications to Billboard._computeScreenSpacePosition // unpack attributes vec3 positionHigh = positionHighAndScale.xyz; vec3 positionLow = positionLowAndRotation.xyz; float scale = positionHighAndScale.w; #if defined(ROTATION) || defined(ALIGNED_AXIS) float rotation = positionLowAndRotation.w; #else float rotation = 0.0; #endif float compressed = compressedAttribute0.x; vec2 pixelOffset; pixelOffset.x = floor(compressed * SHIFT_RIGHT7); compressed -= pixelOffset.x * SHIFT_LEFT7; pixelOffset.x -= UPPER_BOUND; vec2 origin; origin.x = floor(compressed * SHIFT_RIGHT5); compressed -= origin.x * SHIFT_LEFT5; origin.y = floor(compressed * SHIFT_RIGHT3); compressed -= origin.y * SHIFT_LEFT3; #ifdef FRAGMENT_DEPTH_CHECK vec2 depthOrigin = origin.xy; #endif origin -= vec2(1.0); float show = floor(compressed * SHIFT_RIGHT2); compressed -= show * SHIFT_LEFT2; #ifdef INSTANCED vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w); vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w); vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange; #else vec2 direction; direction.x = floor(compressed * SHIFT_RIGHT1); direction.y = compressed - direction.x * SHIFT_LEFT1; vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w); #endif float temp = compressedAttribute0.y * SHIFT_RIGHT8; pixelOffset.y = -(floor(temp) - UPPER_BOUND); vec2 translate; translate.y = (temp - floor(temp)) * SHIFT_LEFT16; temp = compressedAttribute0.z * SHIFT_RIGHT8; translate.x = floor(temp) - UPPER_BOUND; translate.y += (temp - floor(temp)) * SHIFT_LEFT8; translate.y -= UPPER_BOUND; temp = compressedAttribute1.x * SHIFT_RIGHT8; float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2); vec2 imageSize = vec2(floor(temp), temp2); #ifdef FRAGMENT_DEPTH_CHECK float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2)); float applyTranslate = 0.0; if (labelHorizontalOrigin != 0.0) // is a billboard, so set apply translate to false { applyTranslate = 1.0; labelHorizontalOrigin -= 2.0; depthOrigin.x = labelHorizontalOrigin + 1.0; } depthOrigin = vec2(1.0) - (depthOrigin * 0.5); #endif #ifdef EYE_DISTANCE_TRANSLUCENCY vec4 translucencyByDistance; translucencyByDistance.x = compressedAttribute1.z; translucencyByDistance.z = compressedAttribute1.w; translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; temp = compressedAttribute1.y * SHIFT_RIGHT8; translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif #if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK) temp = compressedAttribute3.w; temp = temp * SHIFT_RIGHT12; vec2 dimensions; dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12; dimensions.x = floor(temp); #endif #ifdef ALIGNED_AXIS vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8)); temp = compressedAttribute2.z * SHIFT_RIGHT5; bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0; #else vec3 alignedAxis = vec3(0.0); bool validAlignedAxis = false; #endif vec4 pickColor; vec4 color; temp = compressedAttribute2.y; temp = temp * SHIFT_RIGHT8; pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; pickColor.r = floor(temp); temp = compressedAttribute2.x; temp = temp * SHIFT_RIGHT8; color.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; color.g = (temp - floor(temp)) * SHIFT_LEFT8; color.r = floor(temp); temp = compressedAttribute2.z * SHIFT_RIGHT8; bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0; temp = floor(temp) * SHIFT_RIGHT8; pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; pickColor /= 255.0; color.a = floor(temp); color /= 255.0; /////////////////////////////////////////////////////////////////////////// vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); vec4 positionEC = czm_modelViewRelativeToEye * p; #if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK) float eyeDepth = positionEC.z; #endif positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz); positionEC.xyz *= show; /////////////////////////////////////////////////////////////////////////// #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) float lengthSq; if (czm_sceneMode == czm_sceneMode2D) { // 2D camera distance is a special case // treat all billboards as flattened to the z=0.0 plane lengthSq = czm_eyeHeight2D.y; } else { lengthSq = dot(positionEC.xyz, positionEC.xyz); } #endif #ifdef EYE_DISTANCE_SCALING float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq); scale *= distanceScale; translate *= distanceScale; // push vertex behind near plane for clipping if (scale == 0.0) { positionEC.xyz = vec3(0.0); } #endif float translucency = 1.0; #ifdef EYE_DISTANCE_TRANSLUCENCY translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); // push vertex behind near plane for clipping if (translucency == 0.0) { positionEC.xyz = vec3(0.0); } #endif #ifdef EYE_DISTANCE_PIXEL_OFFSET float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq); pixelOffset *= pixelOffsetScale; #endif #ifdef DISTANCE_DISPLAY_CONDITION float nearSq = compressedAttribute3.x; float farSq = compressedAttribute3.y; if (lengthSq < nearSq || lengthSq > farSq) { positionEC.xyz = vec3(0.0); } #endif mat2 rotationMatrix; float mpp; #ifdef DISABLE_DEPTH_DISTANCE float disableDepthTestDistance = compressedAttribute3.z; #endif #ifdef VERTEX_DEPTH_CHECK if (lengthSq < disableDepthTestDistance) { float depthsilon = 10.0; vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy; vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth1 = getGlobeDepth(pEC1); if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1) { vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth2 = getGlobeDepth(pEC2); if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2) { vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); float globeDepth3 = getGlobeDepth(pEC3); if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3) { positionEC.xyz = vec3(0.0); } } } } #endif positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp); gl_Position = czm_projection * positionEC; v_textureCoordinates = textureCoordinates; #ifdef LOG_DEPTH czm_vertexLogDepth(); #endif #ifdef DISABLE_DEPTH_DISTANCE if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) { disableDepthTestDistance = czm_minimumDisableDepthTestDistance; } if (disableDepthTestDistance != 0.0) { // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. float zclip = gl_Position.z / gl_Position.w; bool clipped = (zclip < -1.0 || zclip > 1.0); if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) { // Position z on the near plane. gl_Position.z = -gl_Position.w; #ifdef LOG_DEPTH v_depthFromNearPlusOne = 1.0; #endif } } #endif #ifdef FRAGMENT_DEPTH_CHECK if (sizeInMeters) { translate /= mpp; dimensions /= mpp; imageSize /= mpp; } #if defined(ROTATION) || defined(ALIGNED_AXIS) v_rotationMatrix = rotationMatrix; #else v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0); #endif float enableDepthCheck = 0.0; if (lengthSq < disableDepthTestDistance) { enableDepthCheck = 1.0; } float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12)); float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12)); float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12)); float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12)); v_compressed.x = eyeDepth; v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck; v_compressed.z = dw * SHIFT_LEFT12 + dh; v_compressed.w = iw * SHIFT_LEFT12 + ih; v_originTextureCoordinateAndTranslate.xy = depthOrigin; v_originTextureCoordinateAndTranslate.zw = translate; v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate; #endif #ifdef SDF vec4 outlineColor; float outlineWidth; temp = sdf.x; temp = temp * SHIFT_RIGHT8; outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor.r = floor(temp); temp = sdf.y; temp = temp * SHIFT_RIGHT8; float temp3 = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor.a = floor(temp); outlineColor /= 255.0; v_outlineWidth = outlineWidth / 255.0; v_outlineColor = outlineColor; v_outlineColor.a *= translucency; #endif v_pickColor = pickColor; v_color = color; v_color.a *= translucency; } `,pSt={ADD:xi.FUNC_ADD,SUBTRACT:xi.FUNC_SUBTRACT,REVERSE_SUBTRACT:xi.FUNC_REVERSE_SUBTRACT,MIN:xi.MIN,MAX:xi.MAX},Cv=Object.freeze(pSt),mSt={ZERO:xi.ZERO,ONE:xi.ONE,SOURCE_COLOR:xi.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:xi.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:xi.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:xi.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:xi.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:xi.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:xi.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:xi.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:xi.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:xi.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:xi.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:xi.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:xi.SRC_ALPHA_SATURATE},Bh=Object.freeze(mSt),gSt={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Cv.ADD,equationAlpha:Cv.ADD,functionSourceRgb:Bh.SOURCE_ALPHA,functionSourceAlpha:Bh.ONE,functionDestinationRgb:Bh.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Bh.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Cv.ADD,equationAlpha:Cv.ADD,functionSourceRgb:Bh.ONE,functionSourceAlpha:Bh.ONE,functionDestinationRgb:Bh.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Bh.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Cv.ADD,equationAlpha:Cv.ADD,functionSourceRgb:Bh.SOURCE_ALPHA,functionSourceAlpha:Bh.ONE,functionDestinationRgb:Bh.ONE,functionDestinationAlpha:Bh.ONE})},Mu=Object.freeze(gSt),_St={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},If=Object.freeze(_St),vSt={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},By=Object.freeze(vSt);function D$(o,f,m){let v=o._gl;v.framebufferTexture2D(v.FRAMEBUFFER,f,m._target,m._texture,0)}function hQ(o,f,m){let v=o._gl;v.framebufferRenderbuffer(v.FRAMEBUFFER,f,v.RENDERBUFFER,m._getRenderbuffer())}function uT(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.context._gl,m=Bo.maximumColorAttachments;this._gl=f,this._framebuffer=f.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=Z(o.destroyAttachments,!0);let v=N(o.depthTexture)||N(o.depthRenderbuffer),y=N(o.depthStencilTexture)||N(o.depthStencilRenderbuffer);this._bind();let x,C,w,A,E;if(N(o.colorTextures)){let T=o.colorTextures;for(A=this._colorTextures.length=this._activeColorAttachments.length=T.length,w=0;w0){let C=o._texture.width,w=o._texture.height,A=y*(C+f.width+x),E=y*(w+f.height+x),T=C/A,S=w/E,M=new XI(new Ye(C+x,x),new Ye(A,w)),I=new XI(new Ye,new Ye(A,w),o._root,M),P=new XI(new Ye(x,w+x),new Ye(A,E)),D=new XI(new Ye,new Ye(A,E),I,P);for(let O=0;OC){f.childNode1=new XI(new Ye(f.bottomLeft.x,f.bottomLeft.y),new Ye(f.bottomLeft.x+m.width,f.topRight.y));let w=f.bottomLeft.x+m.width+o._borderWidthInPixels;w0)&&(o._shaderDisableDepthDistance=!0,T===Number.POSITIVE_INFINITY&&(T=-1));let M,I;if(N(y._labelDimensions))I=y._labelDimensions.x,M=y._labelDimensions.y;else{let R=0,O=0,F=y._imageIndex;if(F!==-1){let U=m[F];R=U.height,O=U.width}M=Math.round(Z(y.height,o._textureAtlas.texture.dimensions.y*R));let k=o._textureAtlas.texture.width;I=Math.round(Z(y.width,k*O))}let P=Math.floor(xe.clamp(I,0,she)),D=Math.floor(xe.clamp(M,0,she)),L=P*she+D;o._instanced?(x=y._index,C(x,w,A,T,L)):(x=y._index*4,C(x+0,w,A,T,L),C(x+1,w,A,T,L),C(x+2,w,A,T,L),C(x+3,w,A,T,L))}function mWe(o,f,m,v,y){if(y.heightReference===qn.CLAMP_TO_GROUND){let P=o._scene,D=f.context,L=f.globeTranslucencyState.translucent,R=N(P.globe)&&P.globe.depthTestAgainstTerrain;o._shaderClampToGround=D.depthTexture&&!L&&R}let x,C=v[Oh.textureCoordinateBoundsOrLabelTranslate];if(Bo.maximumVertexTextureImageUnits>0){let P=0,D=0;N(y._labelTranslate)&&(P=y._labelTranslate.x,D=y._labelTranslate.y),o._instanced?(x=y._index,C(x,P,D,0,0)):(x=y._index*4,C(x+0,P,D,0,0),C(x+1,P,D,0,0),C(x+2,P,D,0,0),C(x+3,P,D,0,0));return}let w=0,A=0,E=0,T=0,S=y._imageIndex;if(S!==-1){let P=m[S];w=P.x,A=P.y,E=P.width,T=P.height}let M=w+E,I=A+T;o._instanced?(x=y._index,C(x,w,A,M,I)):(x=y._index*4,C(x+0,w,A,M,I),C(x+1,w,A,M,I),C(x+2,w,A,M,I),C(x+3,w,A,M,I))}function VSt(o,f,m,v,y){if(!N(o._batchTable))return;let x=v[Oh.a_batchId],C=y._batchIndex,w;o._instanced?(w=y._index,x(w,C)):(w=y._index*4,x(w+0,C),x(w+1,C),x(w+2,C),x(w+3,C))}function gWe(o,f,m,v,y){if(!o._sdf)return;let x,C=v[Oh.sdf],w=y.outlineColor,A=y.outlineWidth,E=Re.floatToByte(w.red),T=Re.floatToByte(w.green),S=Re.floatToByte(w.blue),M=E*Dz+T*u2+S,I=A/By.RADIUS,P=Re.floatToByte(w.alpha)*Dz+Re.floatToByte(I)*u2;o._instanced?(x=y._index,C(x,M,P)):(x=y._index*4,C(x+0,M+aWe,P),C(x+1,M+sWe,P),C(x+2,M+lWe,P),C(x+3,M+uWe,P))}function zSt(o,f,m,v,y){nWe(o,f,m,v,y),cWe(o,f,m,v,y),hWe(o,f,m,v,y),ame(o,f,m,v,y),sme(o,f,m,v,y),dWe(o,f,m,v,y),fWe(o,f,m,v,y),pWe(o,f,m,v,y),mWe(o,f,m,v,y),VSt(o,f,m,v,y),gWe(o,f,m,v,y)}function lhe(o,f,m,v,y,x){let C;v.mode===_i.SCENE3D?(C=o._baseVolume,o._boundingVolumeDirty=!0):C=o._baseVolume2D;let w=[];for(let A=0;A0){this._vaf=OSt(v,m,this._buffersUsage,this._instanced,this._batchTable,this._sdf),S=this._vaf.writers;for(let q=0;q0){let q=WSt;q.length=0,(A[z7]||A[ESt]||A[ASt])&&q.push(nWe),(A[c9]||A[J7e]||A[bSt]||A[wSt]||A[CSt])&&(q.push(cWe),this._instanced&&q.push(sme)),(A[c9]||A[TSt]||A[$7e])&&(q.push(hWe),q.push(ame)),(A[c9]||A[Q7e])&&q.push(ame),A[K7e]&&q.push(sme),A[Z7e]&&q.push(dWe),A[eWe]&&q.push(fWe),(A[tWe]||A[SSt]||A[c9]||A[z7])&&q.push(pWe),(A[c9]||A[z7])&&q.push(mWe),A[iWe]&&q.push(gWe);let J=q.length;if(S=this._vaf.writers,w/m>.1){for(let X=0;Xm*1.5&&(C.length=m),!N(this._vaf)||!N(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,Pi.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let P,D=Ee.IDENTITY;o.mode===_i.SCENE3D?(D=this.modelMatrix,P=Pi.clone(this._baseVolumeWC,this._boundingVolume)):P=Pi.clone(this._baseVolume2D,this._boundingVolume),USt(this,o,P);let L=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,L){this._blendOption===If.OPAQUE||this._blendOption===If.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Mn.fromCache({depthTest:{enabled:!0,func:xi.LESS},depthMask:!0}):this._rsOpaque=void 0;let q=this._blendOption===If.TRANSLUCENT;this._blendOption===If.TRANSLUCENT||this._blendOption===If.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Mn.fromCache({depthTest:{enabled:!0,func:q?xi.LEQUAL:xi.LESS},depthMask:q,blending:Mu.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||o.minimumDisableDepthTestDistance!==0;let R,O,F,k,U,G=Bo.maximumVertexTextureImageUnits>0;if(L||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){R=vxe,O=_xe,U=[],N(this._batchTable)&&(U.push("VECTOR_TILE"),R=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(R),O=this._batchTable.getFragmentShaderCallback(!1,void 0)(O)),F=new Zr({defines:U,sources:[R]}),this._instanced&&F.defines.push("INSTANCED"),this._shaderRotation&&F.defines.push("ROTATION"),this._shaderAlignedAxis&&F.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&F.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&F.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&F.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&F.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&F.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(G?F.defines.push("VERTEX_DEPTH_CHECK"):F.defines.push("FRAGMENT_DEPTH_CHECK"));let q=1-By.CUTOFF;this._sdf&&F.defines.push("SDF");let J=N(this._batchTable)?"VECTOR_TILE":"";this._blendOption===If.OPAQUE_AND_TRANSLUCENT&&(k=new Zr({defines:["OPAQUE",J],sources:[O]}),this._shaderClampToGround&&(G?k.defines.push("VERTEX_DEPTH_CHECK"):k.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(k.defines.push("SDF"),k.defines.push(`SDF_EDGE ${q}`)),this._sp=Rs.replaceCache({context:v,shaderProgram:this._sp,vertexShaderSource:F,fragmentShaderSource:k,attributeLocations:Oh}),k=new Zr({defines:["TRANSLUCENT",J],sources:[O]}),this._shaderClampToGround&&(G?k.defines.push("VERTEX_DEPTH_CHECK"):k.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(k.defines.push("SDF"),k.defines.push(`SDF_EDGE ${q}`)),this._spTranslucent=Rs.replaceCache({context:v,shaderProgram:this._spTranslucent,vertexShaderSource:F,fragmentShaderSource:k,attributeLocations:Oh})),this._blendOption===If.OPAQUE&&(k=new Zr({defines:[J],sources:[O]}),this._shaderClampToGround&&(G?k.defines.push("VERTEX_DEPTH_CHECK"):k.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(k.defines.push("SDF"),k.defines.push(`SDF_EDGE ${q}`)),this._sp=Rs.replaceCache({context:v,shaderProgram:this._sp,vertexShaderSource:F,fragmentShaderSource:k,attributeLocations:Oh})),this._blendOption===If.TRANSLUCENT&&(k=new Zr({defines:[J],sources:[O]}),this._shaderClampToGround&&(G?k.defines.push("VERTEX_DEPTH_CHECK"):k.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(k.defines.push("SDF"),k.defines.push(`SDF_EDGE ${q}`)),this._spTranslucent=Rs.replaceCache({context:v,shaderProgram:this._spTranslucent,vertexShaderSource:F,fragmentShaderSource:k,attributeLocations:Oh})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let j=o.commandList;if(M.render||M.pick){let q=this._colorCommands,J=this._blendOption===If.OPAQUE,X=this._blendOption===If.OPAQUE_AND_TRANSLUCENT,Y=this._vaf.va,Q=Y.length,ee=this._uniforms,z;N(this._batchTable)?(ee=this._batchTable.getUniformMapCallback()(ee),z=this._batchTable.getPickId()):z="v_pickColor",q.length=Q;let ie=X?Q*2:Q;for(let re=0;re]/,y=[],x="",C=Cm.LTR,w="",A=o.length;for(let E=0;E";case">":return"<"}}var ZSt="\u05D0-\u05EA",$St="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",YNe=new RegExp(`[${ZSt}${$St}]`);function e2t(o){let f=o.split(` `),m="";for(let v=0;vE+1?C[E+1].Type===Cm.RTL?(A=S+A,w=0):(A=f9(A,w,T.Word),w+=T.Word.length):A=f9(A,0,S)):T.Type===Cm.RTL?A=f9(A,w,S):T.Type===Cm.LTR?(A+=T.Word,w=A.length):(T.Type===Cm.WEAK||T.Type===Cm.BRACKETS)&&(E>0&&C[E-1].Type===Cm.RTL?C.length>E+1?C[E+1].Type===Cm.RTL?A=f9(A,w,S):(A+=T.Word,w=A.length):A+=T.Word:(A+=T.Word,w=A.length))}m+=A,v=0;--L)if(I[L]!==255){F=L/D|0;break}let k=-1;for(L=0;L0,S=f._backgroundBillboard,M=o._backgroundBillboardCollection;T?(N(S)||(S=M.add({collection:o,image:vWe,imageSubRegion:l2t}),f._backgroundBillboard=S),S.color=f._backgroundColor,S.show=f._show,S.position=f._position,S.eyeOffset=f._eyeOffset,S.pixelOffset=f._pixelOffset,S.horizontalOrigin=Zc.LEFT,S.verticalOrigin=f._verticalOrigin,S.heightReference=f._heightReference,S.scale=f.totalScale,S.pickPrimitive=f,S.id=f._id,S.translucencyByDistance=f._translucencyByDistance,S.pixelOffsetScaleByDistance=f._pixelOffsetScaleByDistance,S.scaleByDistance=f._scaleByDistance,S.distanceDisplayCondition=f._distanceDisplayCondition,S.disableDepthTestDistance=f._disableDepthTestDistance):N(S)&&(M.remove(S),f._backgroundBillboard=S=void 0);let I=o._glyphTextureCache;for(E=0;E0&&F.height>0){let k=(0,r2t.default)(F,{cutoff:By.CUTOFF,radius:By.RADIUS}),U=F.getContext("2d"),G=F.width,j=F.height,q=U.getImageData(0,0,G,j);for(let J=0;J0?O=F.pop():(O=o._billboardCollection.add({collection:o}),O._labelDimensions=new Ye,O._labelTranslate=new Ye),w.billboard=O),O.show=f._show,O.position=f._position,O.eyeOffset=f._eyeOffset,O.pixelOffset=f._pixelOffset,O.horizontalOrigin=Zc.LEFT,O.verticalOrigin=f._verticalOrigin,O.heightReference=f._heightReference,O.scale=f.totalScale,O.pickPrimitive=f,O.id=f._id,O.image=L,O.translucencyByDistance=f._translucencyByDistance,O.pixelOffsetScaleByDistance=f._pixelOffsetScaleByDistance,O.scaleByDistance=f._scaleByDistance,O.distanceDisplayCondition=f._distanceDisplayCondition,O.disableDepthTestDistance=f._disableDepthTestDistance,O._batchIndex=f._batchIndex,O.outlineColor=f.outlineColor,f.style===of.FILL_AND_OUTLINE?(O.color=f._fillColor,O.outlineWidth=f.outlineWidth):f.style===of.FILL?(O.color=f._fillColor,O.outlineWidth=0):f.style===of.OUTLINE&&(O.color=Re.TRANSPARENT,O.outlineWidth=f.outlineWidth)}}f._repositionAllGlyphs=!0}function qNe(o,f,m){return f===Zc.CENTER?-o/2:f===Zc.RIGHT?-(o+m.x):m.x}var Ef=new Ye,p2t=new Ye;function m2t(o){let f=o._glyphs,m=o._renderedText,v,y,x=0,C=0,w=[],A=Number.NEGATIVE_INFINITY,E=0,T=1,S,M=f.length,I=o._backgroundBillboard,P=Ye.clone(N(I)?o._backgroundPadding:Ye.ZERO,p2t);for(P.x/=o._relativeSize,P.y/=o._relativeSize,S=0;S0&&(R===Zc.CENTER?U=-C/2-P.x:R===Zc.RIGHT?U=-(C+P.x*2):U=0,Ef.x=U*L,O===so.TOP?Ef.y=D-E-A:O===so.CENTER?Ef.y=(D-E)/2-A:O===so.BASELINE?Ef.y=-P.y-A:Ef.y=0,Ef.y=Ef.y*L,I.width=q,I.height=J,I._setTranslate(Ef),I._labelTranslate=Ye.clone(Ef,I._labelTranslate)),o.heightReference===qn.CLAMP_TO_GROUND)for(S=0;S0?If.TRANSLUCENT:this.blendOption;f.blendOption=x,m.blendOption=x,f._highlightColor=this._highlightColor,m._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,m.update(o),f.update(o)};U2.prototype.isDestroyed=function(){return!1};U2.prototype.destroy=function(){return this.removeAll(),this._billboardCollection=this._billboardCollection.destroy(),this._textureAtlas=this._textureAtlas&&this._textureAtlas.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),this._backgroundTextureAtlas=this._backgroundTextureAtlas&&this._backgroundTextureAtlas.destroy(),kr(this)};var UM=U2;function Tp(o,f){o=Z(o,Z.EMPTY_OBJECT);let m=o.translucencyByDistance,v=o.scaleByDistance,y=o.distanceDisplayCondition;N(m)&&(m=sa.clone(m)),N(v)&&(v=sa.clone(v)),N(y)&&(y=ia.clone(y)),this._show=Z(o.show,!0),this._position=H.clone(Z(o.position,H.ZERO)),this._actualPosition=H.clone(this._position),this._color=Re.clone(Z(o.color,Re.WHITE)),this._outlineColor=Re.clone(Z(o.outlineColor,Re.TRANSPARENT)),this._outlineWidth=Z(o.outlineWidth,0),this._pixelSize=Z(o.pixelSize,10),this._scaleByDistance=v,this._translucencyByDistance=m,this._distanceDisplayCondition=y,this._disableDepthTestDistance=Z(o.disableDepthTestDistance,0),this._id=o.id,this._collection=Z(o.collection,f),this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=f,this._dirty=!1,this._index=-1}var XNe=Tp.SHOW_INDEX=0,xWe=Tp.POSITION_INDEX=1,g2t=Tp.COLOR_INDEX=2,_2t=Tp.OUTLINE_COLOR_INDEX=3,v2t=Tp.OUTLINE_WIDTH_INDEX=4,y2t=Tp.PIXEL_SIZE_INDEX=5,x2t=Tp.SCALE_BY_DISTANCE_INDEX=6,C2t=Tp.TRANSLUCENCY_BY_DISTANCE_INDEX=7,b2t=Tp.DISTANCE_DISPLAY_CONDITION_INDEX=8,w2t=Tp.DISABLE_DEPTH_DISTANCE_INDEX=9;Tp.NUMBER_OF_PROPERTIES=10;function ow(o,f){let m=o._pointPrimitiveCollection;N(m)&&(m._updatePointPrimitive(o,f),o._dirty=!0)}Object.defineProperties(Tp.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,ow(this,XNe))}},position:{get:function(){return this._position},set:function(o){let f=this._position;H.equals(f,o)||(H.clone(o,f),H.clone(o,this._actualPosition),ow(this,xWe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(o){let f=this._scaleByDistance;sa.equals(f,o)||(this._scaleByDistance=sa.clone(o,f),ow(this,x2t))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(o){let f=this._translucencyByDistance;sa.equals(f,o)||(this._translucencyByDistance=sa.clone(o,f),ow(this,C2t))}},pixelSize:{get:function(){return this._pixelSize},set:function(o){this._pixelSize!==o&&(this._pixelSize=o,ow(this,y2t))}},color:{get:function(){return this._color},set:function(o){let f=this._color;Re.equals(f,o)||(Re.clone(o,f),ow(this,g2t))}},outlineColor:{get:function(){return this._outlineColor},set:function(o){let f=this._outlineColor;Re.equals(f,o)||(Re.clone(o,f),ow(this,_2t))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(o){this._outlineWidth!==o&&(this._outlineWidth=o,ow(this,v2t))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(o){ia.equals(this._distanceDisplayCondition,o)||(this._distanceDisplayCondition=ia.clone(o,this._distanceDisplayCondition),ow(this,b2t))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(o){this._disableDepthTestDistance!==o&&(this._disableDepthTestDistance=o,ow(this,w2t))}},id:{get:function(){return this._id},set:function(o){this._id=o,N(this._pickId)&&(this._pickId.object.id=o)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(o){this._clusterShow!==o&&(this._clusterShow=o,ow(this,XNe))}}});Tp.prototype.getPickId=function(o){return N(this._pickId)||(this._pickId=o.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Tp.prototype._getActualPosition=function(){return this._actualPosition};Tp.prototype._setActualPosition=function(o){H.clone(o,this._actualPosition),ow(this,xWe)};var JNe=new Wt;Tp._computeActualPosition=function(o,f,m){return f.mode===_i.SCENE3D?o:(Ee.multiplyByPoint(m,o,JNe),nl.computeActualWgs84Position(f,JNe))};var KNe=new Wt;Tp._computeScreenSpacePosition=function(o,f,m,v){let y=Ee.multiplyByVector(o,Wt.fromElements(f.x,f.y,f.z,1,KNe),KNe);return nl.wgs84ToWindowCoordinates(m,y,v)};Tp.prototype.computeScreenSpacePosition=function(o,f){let m=this._pointPrimitiveCollection;N(f)||(f=new Ye);let v=m.modelMatrix,y=Tp._computeScreenSpacePosition(v,this._actualPosition,o,f);if(N(y))return y.y=o.canvas.clientHeight-y.y,y};Tp.getScreenSpaceBoundingBox=function(o,f,m){let v=o.pixelSize,y=v*.5,x=f.x-y,C=f.y-y,w=v,A=v;return N(m)||(m=new Xr),m.x=x,m.y=C,m.width=w,m.height=A,m};Tp.prototype.equals=function(o){return this===o||N(o)&&this._id===o._id&&H.equals(this._position,o._position)&&Re.equals(this._color,o._color)&&this._pixelSize===o._pixelSize&&this._outlineWidth===o._outlineWidth&&this._show===o._show&&Re.equals(this._outlineColor,o._outlineColor)&&sa.equals(this._scaleByDistance,o._scaleByDistance)&&sa.equals(this._translucencyByDistance,o._translucencyByDistance)&&ia.equals(this._distanceDisplayCondition,o._distanceDisplayCondition)&&this._disableDepthTestDistance===o._disableDepthTestDistance};Tp.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var jv=Tp,mz=`in vec4 v_color; in vec4 v_outlineColor; in float v_innerPercent; in float v_pixelDistance; in vec4 v_pickColor; void main() { // The distance in UV space from this fragment to the center of the point, at most 0.5. float distanceToCenter = length(gl_PointCoord - vec2(0.5)); // The max distance stops one pixel shy of the edge to leave space for anti-aliasing. float maxDistance = max(0.0, 0.5 - v_pixelDistance); float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter); float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter); vec4 color = mix(v_outlineColor, v_color, innerAlpha); color.a *= wholeAlpha; // Fully transparent parts of the billboard are not pickable. #if !defined(OPAQUE) && !defined(TRANSLUCENT) if (color.a < 0.005) // matches 0/255 and 1/255 { discard; } #else // The billboard is rendered twice. The opaque pass discards translucent fragments // and the translucent pass discards opaque fragments. #ifdef OPAQUE if (color.a < 0.995) // matches < 254/255 { discard; } #else if (color.a >= 0.995) // matches 254/255 and 255/255 { discard; } #endif #endif out_FragColor = czm_gammaCorrect(color); czm_writeLogDepth(); } `,Cxe=`uniform float u_maxTotalPointSize; in vec4 positionHighAndSize; in vec4 positionLowAndOutline; in vec4 compressedAttribute0; // color, outlineColor, pick color in vec4 compressedAttribute1; // show, translucency by distance, some free space in vec4 scaleByDistance; // near, nearScale, far, farScale in vec3 distanceDisplayConditionAndDisableDepth; // near, far, disableDepthTestDistance out vec4 v_color; out vec4 v_outlineColor; out float v_innerPercent; out float v_pixelDistance; out vec4 v_pickColor; const float SHIFT_LEFT8 = 256.0; const float SHIFT_RIGHT8 = 1.0 / 256.0; void main() { // Modifying this shader may also require modifications to PointPrimitive._computeScreenSpacePosition // unpack attributes vec3 positionHigh = positionHighAndSize.xyz; vec3 positionLow = positionLowAndOutline.xyz; float outlineWidthBothSides = 2.0 * positionLowAndOutline.w; float totalSize = positionHighAndSize.w + outlineWidthBothSides; float outlinePercent = outlineWidthBothSides / totalSize; // Scale in response to browser-zoom. totalSize *= czm_pixelRatio; float temp = compressedAttribute1.x * SHIFT_RIGHT8; float show = floor(temp); #ifdef EYE_DISTANCE_TRANSLUCENCY vec4 translucencyByDistance; translucencyByDistance.x = compressedAttribute1.z; translucencyByDistance.z = compressedAttribute1.w; translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; temp = compressedAttribute1.y * SHIFT_RIGHT8; translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0; #endif /////////////////////////////////////////////////////////////////////////// vec4 color; vec4 outlineColor; vec4 pickColor; // compressedAttribute0.z => pickColor.rgb temp = compressedAttribute0.z * SHIFT_RIGHT8; pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8; pickColor.r = floor(temp); // compressedAttribute0.x => color.rgb temp = compressedAttribute0.x * SHIFT_RIGHT8; color.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; color.g = (temp - floor(temp)) * SHIFT_LEFT8; color.r = floor(temp); // compressedAttribute0.y => outlineColor.rgb temp = compressedAttribute0.y * SHIFT_RIGHT8; outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8; temp = floor(temp) * SHIFT_RIGHT8; outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor.r = floor(temp); // compressedAttribute0.w => color.a, outlineColor.a, pickColor.a temp = compressedAttribute0.w * SHIFT_RIGHT8; pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8; pickColor = pickColor / 255.0; temp = floor(temp) * SHIFT_RIGHT8; outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8; outlineColor /= 255.0; color.a = floor(temp); color /= 255.0; /////////////////////////////////////////////////////////////////////////// vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); vec4 positionEC = czm_modelViewRelativeToEye * p; /////////////////////////////////////////////////////////////////////////// #if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE) float lengthSq; if (czm_sceneMode == czm_sceneMode2D) { // 2D camera distance is a special case // treat all billboards as flattened to the z=0.0 plane lengthSq = czm_eyeHeight2D.y; } else { lengthSq = dot(positionEC.xyz, positionEC.xyz); } #endif #ifdef EYE_DISTANCE_SCALING totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq); #endif if (totalSize > 0.0) { // Add padding for anti-aliasing on both sides. totalSize += 3.0; } // Clamp to max point size. totalSize = min(totalSize, u_maxTotalPointSize); // If size is too small, push vertex behind near plane for clipping. // Note that context.minimumAliasedPointSize "will be at most 1.0". if (totalSize < 1.0) { positionEC.xyz = vec3(0.0); totalSize = 1.0; } float translucency = 1.0; #ifdef EYE_DISTANCE_TRANSLUCENCY translucency = czm_nearFarScalar(translucencyByDistance, lengthSq); // push vertex behind near plane for clipping if (translucency < 0.004) { positionEC.xyz = vec3(0.0); } #endif #ifdef DISTANCE_DISPLAY_CONDITION float nearSq = distanceDisplayConditionAndDisableDepth.x; float farSq = distanceDisplayConditionAndDisableDepth.y; if (lengthSq < nearSq || lengthSq > farSq) { // push vertex behind camera to force it to be clipped positionEC.xyz = vec3(0.0, 0.0, 1.0); } #endif gl_Position = czm_projection * positionEC; czm_vertexLogDepth(); #ifdef DISABLE_DEPTH_DISTANCE float disableDepthTestDistance = distanceDisplayConditionAndDisableDepth.z; if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0) { disableDepthTestDistance = czm_minimumDisableDepthTestDistance; } if (disableDepthTestDistance != 0.0) { // Don't try to "multiply both sides" by w. Greater/less-than comparisons won't work for negative values of w. float zclip = gl_Position.z / gl_Position.w; bool clipped = (zclip < -1.0 || zclip > 1.0); if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance))) { // Position z on the near plane. gl_Position.z = -gl_Position.w; #ifdef LOG_DEPTH czm_vertexLogDepth(vec4(czm_currentFrustum.x)); #endif } } #endif v_color = color; v_color.a *= translucency * show; v_outlineColor = outlineColor; v_outlineColor.a *= translucency * show; v_innerPercent = 1.0 - outlinePercent; v_pixelDistance = 2.0 / totalSize; gl_PointSize = totalSize * show; gl_Position *= show; v_pickColor = pickColor; } `,A2t=jv.SHOW_INDEX,cme=jv.POSITION_INDEX,CWe=jv.COLOR_INDEX,E2t=jv.OUTLINE_COLOR_INDEX,T2t=jv.OUTLINE_WIDTH_INDEX,S2t=jv.PIXEL_SIZE_INDEX,bWe=jv.SCALE_BY_DISTANCE_INDEX,wWe=jv.TRANSLUCENCY_BY_DISTANCE_INDEX,AWe=jv.DISTANCE_DISPLAY_CONDITION_INDEX,P2t=jv.DISABLE_DEPTH_DISTANCE_INDEX,bxe=jv.NUMBER_OF_PROPERTIES,bv={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepth:5};function Jw(o){o=Z(o,Z.EMPTY_OBJECT),this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(bxe),this._maxPixelSize=1,this._baseVolume=new Pi,this._baseVolumeWC=new Pi,this._baseVolume2D=new Pi,this._boundingVolume=new Pi,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=Z(o.show,!0),this.modelMatrix=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),this._modelMatrix=Ee.clone(Ee.IDENTITY),this.debugShowBoundingVolume=Z(o.debugShowBoundingVolume,!1),this.blendOption=Z(o.blendOption,If.OPAQUE_AND_TRANSLUCENT),this._blendOption=void 0,this._mode=_i.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[gn.STATIC_DRAW,gn.STATIC_DRAW,gn.STATIC_DRAW,gn.STATIC_DRAW,gn.STATIC_DRAW,gn.STATIC_DRAW,gn.STATIC_DRAW,gn.STATIC_DRAW,gn.STATIC_DRAW];let f=this;this._uniforms={u_maxTotalPointSize:function(){return f._maxTotalPointSize}}}Object.defineProperties(Jw.prototype,{length:{get:function(){return wxe(this),this._pointPrimitives.length}}});function EWe(o){let f=o.length;for(let m=0;m0&&(o._shaderDisableDepthDistance=!0,E===Number.POSITIVE_INFINITY&&(E=-1)),x(y,C,w,E)}function M2t(o,f,m,v){TWe(o,f,m,v),SWe(o,f,m,v),PWe(o,f,m,v),IWe(o,f,m,v),MWe(o,f,m,v)}function che(o,f,m,v,y,x){let C;v.mode===_i.SCENE3D?(C=o._baseVolume,o._boundingVolumeDirty=!0):C=o._baseVolume2D;let w=[];for(let A=0;A0){this._vaf=I2t(w,f,this._buffersUsage),C=this._vaf.writers;for(let k=0;k0){let k=R2t;k.length=0,(y[cme]||y[T2t]||y[S2t])&&k.push(TWe),(y[CWe]||y[E2t])&&k.push(SWe),(y[A2t]||y[wWe])&&k.push(PWe),y[bWe]&&k.push(IWe),(y[AWe]||y[P2t])&&k.push(MWe);let U=k.length;if(C=this._vaf.writers,v/f>.1){for(let G=0;Gf*1.5&&(m.length=f),!N(this._vaf)||!N(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,Pi.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let T,S=Ee.IDENTITY;o.mode===_i.SCENE3D?(S=this.modelMatrix,T=Pi.clone(this._baseVolumeWC,this._boundingVolume)):T=Pi.clone(this._baseVolume2D,this._boundingVolume),L2t(this,o,T);let M=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,M&&(this._blendOption===If.OPAQUE||this._blendOption===If.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Mn.fromCache({depthTest:{enabled:!0,func:xi.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===If.TRANSLUCENT||this._blendOption===If.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Mn.fromCache({depthTest:{enabled:!0,func:xi.LEQUAL},depthMask:!1,blending:Mu.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||o.minimumDisableDepthTestDistance!==0;let I,P;(M||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(I=new Zr({sources:[Cxe]}),this._shaderScaleByDistance&&I.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&I.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&I.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&I.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===If.OPAQUE_AND_TRANSLUCENT&&(P=new Zr({defines:["OPAQUE"],sources:[mz]}),this._sp=Rs.replaceCache({context:w,shaderProgram:this._sp,vertexShaderSource:I,fragmentShaderSource:P,attributeLocations:bv}),P=new Zr({defines:["TRANSLUCENT"],sources:[mz]}),this._spTranslucent=Rs.replaceCache({context:w,shaderProgram:this._spTranslucent,vertexShaderSource:I,fragmentShaderSource:P,attributeLocations:bv})),this._blendOption===If.OPAQUE&&(P=new Zr({sources:[mz]}),this._sp=Rs.replaceCache({context:w,shaderProgram:this._sp,vertexShaderSource:I,fragmentShaderSource:P,attributeLocations:bv})),this._blendOption===If.TRANSLUCENT&&(P=new Zr({sources:[mz]}),this._spTranslucent=Rs.replaceCache({context:w,shaderProgram:this._spTranslucent,vertexShaderSource:I,fragmentShaderSource:P,attributeLocations:bv})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let D,L,R,O,F=o.commandList;if(A.render||E){let k=this._colorCommands,U=this._blendOption===If.OPAQUE,G=this._blendOption===If.OPAQUE_AND_TRANSLUCENT;D=this._vaf.va,L=D.length,k.length=L;let j=G?L*2:L;for(O=0;O>4;if(v!==hhe)throw new Error(`Got v${v} data when expected v${hhe}.`);let y=QNe[m&15];if(!y)throw new Error("Unrecognized array type.");let[x]=new Uint16Array(o,2,1),[C]=new Uint32Array(o,4,1);return new DWe(C,x,y,o)}constructor(o,f=64,m=Float64Array,v){if(isNaN(o)||o<0)throw new Error(`Unpexpected numItems value: ${o}.`);this.numItems=+o,this.nodeSize=Math.min(Math.max(+f,2),65535),this.ArrayType=m,this.IndexArrayType=o<65536?Uint16Array:Uint32Array;let y=QNe.indexOf(this.ArrayType),x=o*2*this.ArrayType.BYTES_PER_ELEMENT,C=o*this.IndexArrayType.BYTES_PER_ELEMENT,w=(8-C%8)%8;if(y<0)throw new Error(`Unexpected typed array class: ${m}.`);v&&v instanceof ArrayBuffer?(this.data=v,this.ids=new this.IndexArrayType(this.data,p9,o),this.coords=new this.ArrayType(this.data,p9+C+w,o*2),this._pos=o*2,this._finished=!0):(this.data=new ArrayBuffer(p9+x+C+w),this.ids=new this.IndexArrayType(this.data,p9,o),this.coords=new this.ArrayType(this.data,p9+C+w,o*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(hhe<<4)+y]),new Uint16Array(this.data,2,1)[0]=f,new Uint32Array(this.data,4,1)[0]=o)}add(o,f){let m=this._pos>>1;return this.ids[m]=m,this.coords[this._pos++]=o,this.coords[this._pos++]=f,m}finish(){let o=this._pos>>1;if(o!==this.numItems)throw new Error(`Added ${o} items when expected ${this.numItems}.`);return hme(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(o,f,m,v){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:y,coords:x,nodeSize:C}=this,w=[0,y.length-1,0],A=[];for(;w.length;){let E=w.pop()||0,T=w.pop()||0,S=w.pop()||0;if(T-S<=C){for(let D=S;D<=T;D++){let L=x[2*D],R=x[2*D+1];L>=o&&L<=m&&R>=f&&R<=v&&A.push(y[D])}continue}let M=S+T>>1,I=x[2*M],P=x[2*M+1];I>=o&&I<=m&&P>=f&&P<=v&&A.push(y[M]),(E===0?o<=I:f<=P)&&(w.push(S),w.push(M-1),w.push(1-E)),(E===0?m>=I:v>=P)&&(w.push(M+1),w.push(T),w.push(1-E))}return A}within(o,f,m){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:v,coords:y,nodeSize:x}=this,C=[0,v.length-1,0],w=[],A=m*m;for(;C.length;){let E=C.pop()||0,T=C.pop()||0,S=C.pop()||0;if(T-S<=x){for(let D=S;D<=T;D++)ZNe(y[2*D],y[2*D+1],o,f)<=A&&w.push(v[D]);continue}let M=S+T>>1,I=y[2*M],P=y[2*M+1];ZNe(I,P,o,f)<=A&&w.push(v[M]),(E===0?o-m<=I:f-m<=P)&&(C.push(S),C.push(M-1),C.push(1-E)),(E===0?o+m>=I:f+m>=P)&&(C.push(M+1),C.push(T),C.push(1-E))}return w}};function hme(o,f,m,v,y,x){if(y-v<=m)return;let C=v+y>>1;LWe(o,f,C,v,y,x),hme(o,f,m,v,C-1,1-x),hme(o,f,m,C+1,y,1-x)}function LWe(o,f,m,v,y,x){for(;y>v;){if(y-v>600){let E=y-v+1,T=m-v+1,S=Math.log(E),M=.5*Math.exp(2*S/3),I=.5*Math.sqrt(S*M*(E-M)/E)*(T-E/2<0?-1:1),P=Math.max(v,Math.floor(m-T*M/E+I)),D=Math.min(y,Math.floor(m+(E-T)*M/E+I));LWe(o,f,m,P,D,x)}let C=f[2*m+x],w=v,A=y;for(m9(o,f,v,m),f[2*y+x]>C&&m9(o,f,v,y);wC;)A--}f[2*v+x]===C?m9(o,f,v,A):(A++,m9(o,f,A,y)),A<=m&&(v=A+1),m<=A&&(y=A-1)}}function m9(o,f,m,v){dhe(o,m,v),dhe(f,2*m,2*v),dhe(f,2*m+1,2*v+1)}function dhe(o,f,m){let v=o[f];o[f]=o[m],o[m]=v}function ZNe(o,f,m,v){let y=o-m,x=f-v;return y*y+x*x}function cT(o){o=Z(o,Z.EMPTY_OBJECT),this._enabled=Z(o.enabled,!1),this._pixelRange=Z(o.pixelRange,80),this._minimumClusterSize=Z(o.minimumClusterSize,2),this._clusterBillboards=Z(o.clusterBillboards,!0),this._clusterLabels=Z(o.clusterLabels,!0),this._clusterPoints=Z(o.clusterPoints,!0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new Br,this.show=Z(o.show,!0)}function $Ne(o,f){o.x-=f,o.y-=f,o.width+=f*2,o.height+=f*2}var O2t=new Xr;function eFe(o,f,m,v,y){if(N(o._labelCollection)&&v._clusterLabels?y=TW.getScreenSpaceBoundingBox(o,f,y):N(o._billboardCollection)&&v._clusterBillboards?y=kd.getScreenSpaceBoundingBox(o,f,y):N(o._pointPrimitiveCollection)&&v._clusterPoints&&(y=jv.getScreenSpaceBoundingBox(o,f,y)),$Ne(y,m),v._clusterLabels&&!N(o._labelCollection)&&N(o.id)&&RWe(v,o.id.id)&&N(o.id._label)){let x=v._collectionIndicesByEntity[o.id.id].labelIndex,C=v._labelCollection.get(x),w=TW.getScreenSpaceBoundingBox(C,f,O2t);$Ne(w,m),y=Xr.union(y,w,y)}return y}function N2t(o,f){if(o.clusterShow=!0,!N(o._labelCollection)&&N(o.id)&&RWe(f,o.id.id)&&N(o.id._label)){let m=f._collectionIndicesByEntity[o.id.id].labelIndex,v=f._labelCollection.get(m);v.clusterShow=!0}N(o.id)&&!o.id.clusterShow&&(o.id.clusterShow=!0)}function tFe(o,f,m,v){let y={billboard:v._clusterBillboardCollection.add(),label:v._clusterLabelCollection.add(),point:v._clusterPointCollection.add()};y.billboard.show=!1,y.point.show=!1,y.label.show=!0,y.label.text=f.toLocaleString(),y.label.id=m,y.billboard.position=y.label.position=y.point.position=o;for(let x=0;x0){let ie=new DWe(O.length,64,Uint32Array);for(let re=0;re=T)for(tFe(re.position,Q,Y,o),M.push(re),k=0;k=T){let ae=H.multiplyByScalar(se,1/Q,se);for(tFe(ae,Q,Y,o),M.push({position:ae,width:oe.width,height:oe.height,minimumWidth:G.width,minimumHeight:G.height}),k=0;k0?(w=E.pop(),A=x.get(w)):(A=x.add(),w=x.length-1),C[v]=w;let T=this;return Promise.resolve().then(function(){T._clusterDirty=!0}),A}}function Exe(o,f){let m=o._collectionIndicesByEntity[f];!N(m.billboardIndex)&&!N(m.labelIndex)&&!N(m.pointIndex)&&delete o._collectionIndicesByEntity[f]}cT.prototype.getLabel=Axe("_labelCollection",UM,"_unusedLabelIndices","labelIndex");cT.prototype.removeLabel=function(o){let f=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[o.id];if(!N(this._labelCollection)||!N(f)||!N(f.labelIndex))return;let m=f.labelIndex;f.labelIndex=void 0,Exe(this,o.id);let v=this._labelCollection.get(m);v.show=!1,v.text="",v.id=void 0,this._unusedLabelIndices.push(m),this._clusterDirty=!0};cT.prototype.getBillboard=Axe("_billboardCollection",XE,"_unusedBillboardIndices","billboardIndex");cT.prototype.removeBillboard=function(o){let f=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[o.id];if(!N(this._billboardCollection)||!N(f)||!N(f.billboardIndex))return;let m=f.billboardIndex;f.billboardIndex=void 0,Exe(this,o.id);let v=this._billboardCollection.get(m);v.id=void 0,v.show=!1,v.image=void 0,this._unusedBillboardIndices.push(m),this._clusterDirty=!0};cT.prototype.getPoint=Axe("_pointCollection",_B,"_unusedPointIndices","pointIndex");cT.prototype.removePoint=function(o){let f=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[o.id];if(!N(this._pointCollection)||!N(f)||!N(f.pointIndex))return;let m=f.pointIndex;f.pointIndex=void 0,Exe(this,o.id);let v=this._pointCollection.get(m);v.show=!1,v.id=void 0,this._unusedPointIndices.push(m),this._clusterDirty=!0};function phe(o){if(!N(o))return;let f=o.length;for(let m=0;m0&&this._labelCollection.get(0)._glyphs.length===0&&(f=o.commandList,o.commandList=[],this._labelCollection.update(o),o.commandList=f),N(this._billboardCollection)&&this._billboardCollection.length>0&&!N(this._billboardCollection.get(0).width)&&(f=o.commandList,o.commandList=[],this._billboardCollection.update(o),o.commandList=f),this._enabledDirty&&(this._enabledDirty=!1,z2t(this),this._clusterDirty=!0),this._clusterDirty&&(this._clusterDirty=!1,this._cluster()),N(this._clusterLabelCollection)&&this._clusterLabelCollection.update(o),N(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(o),N(this._clusterPointCollection)&&this._clusterPointCollection.update(o),N(this._labelCollection)&&this._labelCollection.update(o),N(this._billboardCollection)&&this._billboardCollection.update(o),N(this._pointCollection)&&this._pointCollection.update(o)};cT.prototype.destroy=function(){this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),N(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var iO=cT;function nf(o){o=Z(o,Z.EMPTY_OBJECT),this.start=N(o.start)?ci.clone(o.start):new ci,this.stop=N(o.stop)?ci.clone(o.stop):new ci,this.data=o.data,this.isStartIncluded=Z(o.isStartIncluded,!0),this.isStopIncluded=Z(o.isStopIncluded,!0)}Object.defineProperties(nf.prototype,{isEmpty:{get:function(){let o=ci.compare(this.stop,this.start);return o<0||o===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var xV={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};nf.fromIso8601=function(o,f){let m=o.iso8601.split("/");if(m.length!==2)throw new li("options.iso8601 is an invalid ISO 8601 interval.");let v=ci.fromIso8601(m[0]),y=ci.fromIso8601(m[1]),x=Z(o.isStartIncluded,!0),C=Z(o.isStopIncluded,!0),w=o.data;return N(f)?(f.start=v,f.stop=y,f.isStartIncluded=x,f.isStopIncluded=C,f.data=w,f):(xV.start=v,xV.stop=y,xV.isStartIncluded=x,xV.isStopIncluded=C,xV.data=w,new nf(xV))};nf.toIso8601=function(o,f){return`${ci.toIso8601(o.start,f)}/${ci.toIso8601(o.stop,f)}`};nf.clone=function(o,f){if(N(o))return N(f)?(f.start=o.start,f.stop=o.stop,f.isStartIncluded=o.isStartIncluded,f.isStopIncluded=o.isStopIncluded,f.data=o.data,f):new nf(o)};nf.equals=function(o,f,m){return o===f||N(o)&&N(f)&&(o.isEmpty&&f.isEmpty||o.isStartIncluded===f.isStartIncluded&&o.isStopIncluded===f.isStopIncluded&&ci.equals(o.start,f.start)&&ci.equals(o.stop,f.stop)&&(o.data===f.data||N(m)&&m(o.data,f.data)))};nf.equalsEpsilon=function(o,f,m,v){return m=Z(m,0),o===f||N(o)&&N(f)&&(o.isEmpty&&f.isEmpty||o.isStartIncluded===f.isStartIncluded&&o.isStopIncluded===f.isStopIncluded&&ci.equalsEpsilon(o.start,f.start,m)&&ci.equalsEpsilon(o.stop,f.stop,m)&&(o.data===f.data||N(v)&&v(o.data,f.data)))};nf.intersect=function(o,f,m,v){if(!N(f))return nf.clone(nf.EMPTY,m);let y=o.start,x=o.stop,C=f.start,w=f.stop,A=ci.greaterThanOrEquals(C,y)&&ci.greaterThanOrEquals(x,C),E=!A&&ci.lessThanOrEquals(C,y)&&ci.lessThanOrEquals(y,w);if(!A&&!E)return nf.clone(nf.EMPTY,m);let T=o.isStartIncluded,S=o.isStopIncluded,M=f.isStartIncluded,I=f.isStopIncluded,P=ci.lessThan(x,w);return N(m)||(m=new nf),m.start=A?C:y,m.isStartIncluded=T&&M||!ci.equals(C,y)&&(A&&M||E&&T),m.stop=P?x:w,m.isStopIncluded=P?S:S&&I||!ci.equals(w,x)&&I,m.data=N(v)?v(o.data,f.data):o.data,m};nf.contains=function(o,f){if(o.isEmpty)return!1;let m=ci.compare(o.start,f);if(m===0)return o.isStartIncluded;let v=ci.compare(f,o.stop);return v===0?o.isStopIncluded:m<0&&v<0};nf.prototype.clone=function(o){return nf.clone(this,o)};nf.prototype.equals=function(o,f){return nf.equals(this,o,f)};nf.prototype.equalsEpsilon=function(o,f,m){return nf.equalsEpsilon(this,o,f,m)};nf.prototype.toString=function(){return nf.toIso8601(this)};nf.EMPTY=Object.freeze(new nf({start:new ci,stop:new ci,isStartIncluded:!1,isStopIncluded:!1}));var hl=nf,OWe=Object.freeze(ci.fromIso8601("0000-01-01T00:00:00Z")),NWe=Object.freeze(ci.fromIso8601("9999-12-31T24:00:00Z")),H2t=Object.freeze(new hl({start:OWe,stop:NWe})),U2t={MINIMUM_VALUE:OWe,MAXIMUM_VALUE:NWe,MAXIMUM_INTERVAL:H2t},Hn=U2t;function Txe(o,f){return ci.compare(o.start,f.start)}function Sp(o){if(this._intervals=[],this._changedEvent=new Br,N(o)){let f=o.length;for(let m=0;m0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Sp.prototype.findIntervalContainingDate=function(o){let f=this.indexOf(o);return f>=0?this._intervals[f]:void 0};Sp.prototype.findDataForIntervalContainingDate=function(o){let f=this.indexOf(o);return f>=0?this._intervals[f].data:void 0};Sp.prototype.contains=function(o){return this.indexOf(o)>=0};var mhe=new hl;Sp.prototype.indexOf=function(o){let f=this._intervals;mhe.start=o,mhe.stop=o;let m=Wg(f,mhe,Txe);return m>=0?f[m].isStartIncluded?m:m>0&&f[m-1].stop.equals(o)&&f[m-1].isStopIncluded?m-1:~m:(m=~m,m>0&&m-10&&o.isStartIncluded&&m[v-1].isStartIncluded&&m[v-1].start.equals(o.start)?--v:v0&&(y=ci.compare(m[v-1].stop,o.start),(y>0||y===0&&(m[v-1].isStopIncluded||o.isStartIncluded))&&((N(f)?f(m[v-1].data,o.data):m[v-1].data===o.data)?(ci.greaterThan(o.stop,m[v-1].stop)?o=new hl({start:m[v-1].start,stop:o.stop,isStartIncluded:m[v-1].isStartIncluded,isStopIncluded:o.isStopIncluded,data:o.data}):o=new hl({start:m[v-1].start,stop:m[v-1].stop,isStartIncluded:m[v-1].isStartIncluded,isStopIncluded:m[v-1].isStopIncluded||o.stop.equals(m[v-1].stop)&&o.isStopIncluded,data:o.data}),m.splice(v-1,1),--v):(y=ci.compare(m[v-1].stop,o.stop),(y>0||y===0&&m[v-1].isStopIncluded&&!o.isStopIncluded)&&m.splice(v,0,new hl({start:o.stop,stop:m[v-1].stop,isStartIncluded:!o.isStopIncluded,isStopIncluded:m[v-1].isStopIncluded,data:m[v-1].data})),m[v-1]=new hl({start:m[v-1].start,stop:o.start,isStartIncluded:m[v-1].isStartIncluded,isStopIncluded:!o.isStartIncluded,data:m[v-1].data}))));v0||y===0&&(o.isStopIncluded||m[v].isStartIncluded));)if(N(f)?f(m[v].data,o.data):m[v].data===o.data)o=new hl({start:o.start,stop:ci.greaterThan(m[v].stop,o.stop)?m[v].stop:o.stop,isStartIncluded:o.isStartIncluded,isStopIncluded:ci.greaterThan(m[v].stop,o.stop)?m[v].isStopIncluded:o.isStopIncluded,data:o.data}),m.splice(v,1);else if(m[v]=new hl({start:o.stop,stop:m[v].stop,isStartIncluded:!o.isStopIncluded,isStopIncluded:m[v].isStopIncluded,data:m[v].data}),m[v].isEmpty)m.splice(v,1);else break;m.splice(v,0,o),this._changedEvent.raiseEvent(this)};Sp.prototype.removeInterval=function(o){if(o.isEmpty)return!1;let f=this._intervals,m=Wg(f,o,Txe);m<0&&(m=~m);let v=!1;for(m>0&&(ci.greaterThan(f[m-1].stop,o.start)||f[m-1].stop.equals(o.start)&&f[m-1].isStopIncluded&&o.isStartIncluded)&&(v=!0,(ci.greaterThan(f[m-1].stop,o.stop)||f[m-1].isStopIncluded&&!o.isStopIncluded&&f[m-1].stop.equals(o.stop))&&f.splice(m,0,new hl({start:o.stop,stop:f[m-1].stop,isStartIncluded:!o.isStopIncluded,isStopIncluded:f[m-1].isStopIncluded,data:f[m-1].data})),f[m-1]=new hl({start:f[m-1].start,stop:o.start,isStartIncluded:f[m-1].isStartIncluded,isStopIncluded:!o.isStartIncluded,data:f[m-1].data})),m=1e3&&(y+=Math.floor(v/1e3),v=v%1e3),y>=60&&(x+=Math.floor(y/60),y=y%60),x>=60&&(C+=Math.floor(x/60),x=x%60),C>=24&&(w+=Math.floor(C/24),C=C%24),g9[2]=cH(E)?29:28;w>g9[A]||A>=13;)w>g9[A]&&(w-=g9[A],++A),A>=13&&(--A,E+=Math.floor(A/12),A=A%12,++A),g9[2]=cH(E)?29:28;return hv.millisecond=v,hv.second=y,hv.minute=x,hv.hour=C,hv.day=w,hv.month=A,hv.year=E,ci.fromGregorianDate(hv,m)}var G2t=new ci,W2t=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function FWe(o,f){if(!N(o)||o.length===0)return!1;if(f.year=0,f.month=0,f.day=0,f.hour=0,f.minute=0,f.second=0,f.millisecond=0,o[0]==="P"){let m=o.match(W2t);if(!N(m))return!1;if(N(m[1])&&(f.year=Number(m[1].replace(",","."))),N(m[2])&&(f.month=Number(m[2].replace(",","."))),N(m[3])&&(f.day=Number(m[3].replace(",","."))*7),N(m[4])&&(f.day+=Number(m[4].replace(",","."))),N(m[5])&&(f.hour=Number(m[5].replace(",","."))),N(m[6])&&(f.minute=Number(m[6].replace(",","."))),N(m[7])){let v=Number(m[7].replace(",","."));f.second=Math.floor(v),f.millisecond=v%1*1e3}}else o[o.length-1]!=="Z"&&(o+="Z"),ci.toGregorianDate(ci.fromIso8601(o,G2t),f);return f.year||f.month||f.day||f.hour||f.minute||f.second||f.millisecond}var H7=new gU;Sp.fromIso8601=function(o,f){let m=o.iso8601.split("/"),v=ci.fromIso8601(m[0]),y=ci.fromIso8601(m[1]),x=[];if(!FWe(m[2],H7))x.push(v,y);else{let C=ci.clone(v);for(x.push(C);ci.compare(C,y)<0;)C=dme(C,H7),ci.compare(y,C)<=0&&ci.clone(y,C),x.push(C)}return Sp.fromJulianDateArray({julianDates:x,isStartIncluded:o.isStartIncluded,isStopIncluded:o.isStopIncluded,leadingInterval:o.leadingInterval,trailingInterval:o.trailingInterval,dataCallback:o.dataCallback},f)};Sp.fromIso8601DateArray=function(o,f){return Sp.fromJulianDateArray({julianDates:o.iso8601Dates.map(function(m){return ci.fromIso8601(m)}),isStartIncluded:o.isStartIncluded,isStopIncluded:o.isStopIncluded,leadingInterval:o.leadingInterval,trailingInterval:o.trailingInterval,dataCallback:o.dataCallback},f)};Sp.fromIso8601DurationArray=function(o,f){let m=o.epoch,v=o.iso8601Durations,y=Z(o.relativeToPrevious,!1),x=[],C,w,A=v.length;for(let E=0;E0&&(this._hash={},o.length=0)};var wa=vB,j2t=Re.WHITE,Y2t=H.ZERO,q2t=qn.NONE,X2t=Ye.ZERO,J2t=1,K2t=0,Q2t=H.ZERO,Z2t=Zc.CENTER,$2t=so.CENTER,ePt=!1,tPt=new H,iPt=new Re,rPt=new H,nPt=new Ye,oPt=new sa,aPt=new sa,sPt=new sa,lPt=new Xr,uPt=new ia;function iFe(o){this.entity=o,this.billboard=void 0,this.textureValue=void 0}function yB(o,f){f=Z(f,Z.EMPTY_OBJECT),this._earthCtrl=o,this._collectionCluster=new iO,this._billboardCollection=new XE,this._items=new wa,this._addToMap=Z(f.addToMap,!0),this._visualizers=[],this._addToMap&&(o.primitives.add(this._billboardCollection),this._primitives=o.primitives.add(new w_),this._collectionCluster._initialize(o.coreMap.scene),this._primitives.add(this._collectionCluster),this._earthCtrl.dataSources._dataSources.push(this))}yB.prototype.update=function(o){let f=this._items.values,m=this._collectionCluster;for(let v=0,y=f.length;v-1;v--)y=o[v],N(y._position)&&x.set(y.id,new iFe(y));for(v=m.length-1;v>-1;v--)y=m[v],N(y._position)?x.contains(y.id)||x.set(y.id,new iFe(y)):(fme(x.get(y.id),y,C),x.remove(y.id));for(v=f.length-1;v>-1;v--)y=f[v],fme(x.get(y.id),y,C),x.remove(y.id)};function fme(o,f,m){N(o)&&(o.billboard=void 0,m.removeBillboard(f))}yB.prototype.addToMap=function(){this._addToMap||(this._earthCtrl.primitives.add(this._billboardCollection),this._addToMap=!0)};yB.prototype.removeFromMap=function(){this._addToMap&&(this._billboardCollection.removeAll(),this._earthCtrl.primitives.remove(this._billboardCollection),this.clustering._billboardCollection.removeAll(),this.clustering._clusterBillboardCollection.destroy(),this.clustering._clusterBillboardCollection=void 0,this._addToMap=!1)};Object.defineProperties(yB.prototype,{show:{get:function(){return this._primitives.show},set:function(o){this._primitives.show=o}},clustering:{get:function(){return this._collectionCluster},set:function(o){this._collectionCluster=o}}});var BWe=yB,kWe={};kWe.Create=o=>{let f=o.toString();return f=f.substring(f.indexOf('"')+1,f.lastIndexOf('"')),new Worker(Ms(f))};var VWe={ConstructionWorker:kWe};function cPt(o){o("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),o("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),o("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),o.WGS84=o["EPSG:4326"],o["EPSG:3785"]=o["EPSG:3857"],o.GOOGLE=o["EPSG:3857"],o["EPSG:900913"]=o["EPSG:3857"],o["EPSG:102113"]=o["EPSG:3857"]}var E5=1,T5=2,Lz=3,hPt=4,pme=5,rFe=6378137,dPt=6356752314e-3,nFe=.0066943799901413165,U7=484813681109536e-20,wo=Math.PI/2,fPt=.16666666666666666,pPt=.04722222222222222,mPt=.022156084656084655,ca=1e-10,f_=.017453292519943295,r2=57.29577951308232,Nh=Math.PI/4,SW=Math.PI*2,bm=3.14159265359,wC={};wC.greenwich=0;wC.lisbon=-9.131906111111;wC.paris=2.337229166667;wC.bogota=-74.080916666667;wC.madrid=-3.687938888889;wC.rome=12.452333333333;wC.bern=7.439583333333;wC.jakarta=106.807719444444;wC.ferro=-17.666666666667;wC.brussels=4.367975;wC.stockholm=18.058277777778;wC.athens=23.7163375;wC.oslo=10.722916666667;var gPt={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}},oFe=/[\s_\-\/\(\)]/g;function y3(o,f){if(o[f])return o[f];for(var m=Object.keys(o),v=f.toLowerCase().replace(oFe,""),y=-1,x,C;++y=this.text.length)return;o=this.text[this.place++]}switch(this.state){case PW:return this.neutral(o);case zWe:return this.keyword(o);case Aee:return this.quoted(o);case UWe:return this.afterquote(o);case HWe:return this.number(o);case Sxe:return}};GM.prototype.afterquote=function(o){if(o==='"'){this.word+='"',this.state=Aee;return}if(Qie.test(o)){this.word=this.word.trim(),this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in afterquote yet, index '+this.place)};GM.prototype.afterItem=function(o){if(o===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=PW;return}if(o==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=PW,this.currentObject=this.stack.pop(),this.currentObject||(this.state=Sxe);return}};GM.prototype.number=function(o){if(GWe.test(o)){this.word+=o;return}if(Qie.test(o)){this.word=parseFloat(this.word),this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in number yet, index '+this.place)};GM.prototype.quoted=function(o){if(o==='"'){this.state=UWe;return}this.word+=o};GM.prototype.keyword=function(o){if(xPt.test(o)){this.word+=o;return}if(o==="["){var f=[];f.push(this.word),this.level++,this.root===null?this.root=f:this.currentObject.push(f),this.stack.push(this.currentObject),this.currentObject=f,this.state=PW;return}if(Qie.test(o)){this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in keyword yet, index '+this.place)};GM.prototype.neutral=function(o){if(yPt.test(o)){this.word=o,this.state=zWe;return}if(o==='"'){this.word="",this.state=Aee;return}if(GWe.test(o)){this.word=o,this.state=HWe;return}if(Qie.test(o)){this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in neutral yet, index '+this.place)};GM.prototype.output=function(){for(;this.place0?90:-90),o.lat_ts=o.lat1)}function WWe(o){var f=_Pt(o),m=f.shift(),v=f.shift();f.unshift(["name",v]),f.unshift(["type",m]);var y={};return gz(f,y),APt(y),y}function aw(o){var f=this;if(arguments.length===2){var m=arguments[1];typeof m=="string"?m.charAt(0)==="+"?aw[o]=mme(arguments[1]):aw[o]=WWe(arguments[1]):aw[o]=m}else if(arguments.length===1){if(Array.isArray(o))return o.map(function(v){Array.isArray(v)?aw.apply(f,v):aw(v)});if(typeof o=="string"){if(o in aw)return aw[o]}else"EPSG"in o?aw["EPSG:"+o.EPSG]=o:"ESRI"in o?aw["ESRI:"+o.ESRI]=o:"IAU2000"in o?aw["IAU2000:"+o.IAU2000]=o:console.log(o);return}}cPt(aw);var Eee=aw;function EPt(o){return typeof o=="string"}function TPt(o){return o in Eee}var SPt=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function PPt(o){return SPt.some(function(f){return o.indexOf(f)>-1})}var IPt=["3857","900913","3785","102113"];function MPt(o){var f=y3(o,"authority");if(f){var m=y3(f,"epsg");return m&&IPt.indexOf(m)>-1}}function DPt(o){var f=y3(o,"extension");if(f)return y3(f,"proj4")}function LPt(o){return o[0]==="+"}function RPt(o){if(EPt(o)){if(TPt(o))return Eee[o];if(PPt(o)){var f=WWe(o);if(MPt(f))return Eee["EPSG:3857"];var m=DPt(f);return m?mme(m):f}if(LPt(o))return mme(o)}else return o}var OPt=RPt;function sFe(o,f){o=o||{};var m,v;if(!f)return o;for(v in f)m=f[v],m!==void 0&&(o[v]=m);return o}function y2(o,f,m){var v=o*f;return m/Math.sqrt(1-v*v)}function aY(o){return o<0?-1:1}function Oa(o){return Math.abs(o)<=bm?o:o-aY(o)*SW}function NE(o,f,m){var v=o*m,y=.5*o;return v=Math.pow((1-v)/(1+v),y),Math.tan(.5*(wo-f))/v}function IW(o,f){for(var m=.5*o,v,y,x=wo-2*Math.atan(f),C=0;C<=15;C++)if(v=o*Math.sin(x),y=wo-2*Math.atan(f*Math.pow((1-v)/(1+v),m))-x,x+=y,Math.abs(y)<=1e-10)return x;return-9999}function NPt(){var o=this.b/this.a;this.es=1-o*o,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=y2(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function FPt(o){var f=o.x,m=o.y;if(m*r2>90&&m*r2<-90&&f*r2>180&&f*r2<-180)return null;var v,y;if(Math.abs(Math.abs(m)-wo)<=ca)return null;if(this.sphere)v=this.x0+this.a*this.k0*Oa(f-this.long0),y=this.y0+this.a*this.k0*Math.log(Math.tan(Nh+.5*m));else{var x=Math.sin(m),C=NE(this.e,m,x);v=this.x0+this.a*this.k0*Oa(f-this.long0),y=this.y0-this.a*this.k0*Math.log(C)}return o.x=v,o.y=y,o}function BPt(o){var f=o.x-this.x0,m=o.y-this.y0,v,y;if(this.sphere)y=wo-2*Math.atan(Math.exp(-m/(this.a*this.k0)));else{var x=Math.exp(-m/(this.a*this.k0));if(y=IW(this.e,x),y===-9999)return null}return v=Oa(this.long0+f/(this.a*this.k0)),o.x=v,o.y=y,o}var kPt=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],VPt={init:NPt,forward:FPt,inverse:BPt,names:kPt};function zPt(){}function lFe(o){return o}var HPt=["longlat","identity"],UPt={init:zPt,forward:lFe,inverse:lFe,names:HPt},GPt=[VPt,UPt],R$={},Tee=[];function jWe(o,f){var m=Tee.length;return o.names?(Tee[m]=o,o.names.forEach(function(v){R$[v.toLowerCase()]=m}),this):(console.log(f),!0)}function WPt(o){if(!o)return!1;var f=o.toLowerCase();if(typeof R$[f]<"u"&&Tee[R$[f]])return Tee[R$[f]]}function jPt(){GPt.forEach(jWe)}var YPt={start:jPt,add:jWe,get:WPt},Il={};Il.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};Il.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};Il.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};Il.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};Il.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};Il.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};Il.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};Il.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};Il.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};Il.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};Il.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};Il.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};Il.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};Il.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};Il.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};Il.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};Il.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};Il.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};Il.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};Il.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};Il.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};Il.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};Il.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};Il.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};Il.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};Il.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};Il.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};Il.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};Il.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};Il.hough={a:6378270,rf:297,ellipseName:"Hough"};Il.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};Il.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};Il.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};Il.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};Il.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};Il.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};Il.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};Il.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};Il.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};Il.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};Il.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};Il.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var qPt=Il.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};Il.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function XPt(o,f,m,v){var y=o*o,x=f*f,C=(y-x)/y,w=0;v?(o*=1-C*(fPt+C*(pPt+C*mPt)),y=o*o,C=0):w=Math.sqrt(C);var A=(y-x)/x;return{es:C,e:w,ep2:A}}function JPt(o,f,m,v,y){if(!o){var x=y3(Il,v);x||(x=qPt),o=x.a,f=x.b,m=x.rf}return m&&!f&&(f=(1-1/m)*o),(m===0||Math.abs(o-f)3&&(w.datum_params[3]!==0||w.datum_params[4]!==0||w.datum_params[5]!==0||w.datum_params[6]!==0)&&(w.datum_type=T5,w.datum_params[3]*=U7,w.datum_params[4]*=U7,w.datum_params[5]*=U7,w.datum_params[6]=w.datum_params[6]/1e6+1)),C&&(w.datum_type=Lz,w.grids=C),w.a=m,w.b=v,w.es=y,w.ep2=x,w}var QPt=KPt,YWe={};function ZPt(o,f){var m=new DataView(f),v=tIt(m),y=iIt(m,v);y.nSubgrids>1&&console.log("Only single NTv2 subgrids are currently supported, subsequent sub grids are ignored");var x=rIt(m,y,v),C={header:y,subgrids:x};return YWe[o]=C,C}function $Pt(o){if(o===void 0)return null;var f=o.split(",");return f.map(eIt)}function eIt(o){if(o.length===0)return null;var f=o[0]==="@";return f&&(o=o.slice(1)),o==="null"?{name:"null",mandatory:!f,grid:null,isNull:!0}:{name:o,mandatory:!f,grid:YWe[o]||null,isNull:!1}}function _z(o){return o/3600*Math.PI/180}function tIt(o){var f=o.getInt32(8,!1);return f===11?!1:(f=o.getInt32(8,!0),f!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function iIt(o,f){return{nFields:o.getInt32(8,f),nSubgridFields:o.getInt32(24,f),nSubgrids:o.getInt32(40,f),shiftType:gme(o,56,56+8).trim(),fromSemiMajorAxis:o.getFloat64(120,f),fromSemiMinorAxis:o.getFloat64(136,f),toSemiMajorAxis:o.getFloat64(152,f),toSemiMinorAxis:o.getFloat64(168,f)}}function gme(o,f,m){return String.fromCharCode.apply(null,new Uint8Array(o.buffer.slice(f,m)))}function rIt(o,f,m){for(var v=176,y=[],x=0;x5e-11?!1:o.datum_type===E5?o.datum_params[0]===f.datum_params[0]&&o.datum_params[1]===f.datum_params[1]&&o.datum_params[2]===f.datum_params[2]:o.datum_type===T5?o.datum_params[0]===f.datum_params[0]&&o.datum_params[1]===f.datum_params[1]&&o.datum_params[2]===f.datum_params[2]&&o.datum_params[3]===f.datum_params[3]&&o.datum_params[4]===f.datum_params[4]&&o.datum_params[5]===f.datum_params[5]&&o.datum_params[6]===f.datum_params[6]:!0}function qWe(o,f,m){var v=o.x,y=o.y,x=o.z?o.z:0,C,w,A,E;if(y<-wo&&y>-1.001*wo)y=-wo;else if(y>wo&&y<1.001*wo)y=wo;else{if(y<-wo)return{x:-1/0,y:-1/0,z:o.z};if(y>wo)return{x:1/0,y:1/0,z:o.z}}return v>Math.PI&&(v-=2*Math.PI),w=Math.sin(y),E=Math.cos(y),A=w*w,C=m/Math.sqrt(1-f*A),{x:(C+x)*E*Math.cos(v),y:(C+x)*E*Math.sin(v),z:(C*(1-f)+x)*w}}function XWe(o,f,m,v){var y=1e-12,x=y*y,C=30,w,A,E,T,S,M,I,P,D,L,R,O,F,k=o.x,U=o.y,G=o.z?o.z:0,j,q,J;if(w=Math.sqrt(k*k+U*U),A=Math.sqrt(k*k+U*U+G*G),w/mx&&Fv.y||S>v.x||Pw&&Math.abs(A.y)>w);if(C<0)return console.log("Inverse grid shift iterator failed to converge."),v;v.x=Oa(x.x+m.ll[0]),v.y=x.y+m.ll[1]}else isNaN(x.x)||(v.x=o.x+x.x,v.y=o.y+x.y);return v}function cFe(o,f){var m={x:o.x/f.del[0],y:o.y/f.del[1]},v={x:Math.floor(m.x),y:Math.floor(m.y)},y={x:m.x-1*v.x,y:m.y-1*v.y},x={x:Number.NaN,y:Number.NaN},C;if(v.x<0||v.x>=f.lim[0]||v.y<0||v.y>=f.lim[1])return x;C=v.y*f.lim[0]+v.x;var w={x:f.cvs[C][0],y:f.cvs[C][1]};C++;var A={x:f.cvs[C][0],y:f.cvs[C][1]};C+=f.lim[0];var E={x:f.cvs[C][0],y:f.cvs[C][1]};C--;var T={x:f.cvs[C][0],y:f.cvs[C][1]},S=y.x*y.y,M=y.x*(1-y.y),I=(1-y.x)*(1-y.y),P=(1-y.x)*y.y;return x.x=I*w.x+M*A.x+P*T.x+S*E.x,x.y=I*w.y+M*A.y+P*T.y+S*E.y,x}function hFe(o,f,m){var v=m.x,y=m.y,x=m.z||0,C,w,A,E={};for(A=0;A<3;A++)if(!(f&&A===2&&m.z===void 0))switch(A===0?(C=v,"ew".indexOf(o.axis[A])!==-1?w="x":w="y"):A===1?(C=y,"ns".indexOf(o.axis[A])!==-1?w="y":w="x"):(C=x,w="z"),o.axis[A]){case"e":E[w]=C;break;case"w":E[w]=-C;break;case"n":E[w]=C;break;case"s":E[w]=-C;break;case"u":m[w]!==void 0&&(E.z=C);break;case"d":m[w]!==void 0&&(E.z=-C);break;default:return null}return E}function JWe(o){var f={x:o[0],y:o[1]};return o.length>2&&(f.z=o[2]),o.length>3&&(f.m=o[3]),f}function dIt(o){dFe(o.x),dFe(o.y)}function dFe(o){if(typeof Number.isFinite=="function"){if(Number.isFinite(o))return;throw new TypeError("coordinates must be finite numbers")}if(typeof o!="number"||o!==o||!isFinite(o))throw new TypeError("coordinates must be finite numbers")}function fIt(o,f){return(o.datum.datum_type===E5||o.datum.datum_type===T5||o.datum.datum_type===Lz)&&f.datumCode!=="WGS84"||(f.datum.datum_type===E5||f.datum.datum_type===T5||f.datum.datum_type===Lz)&&o.datumCode!=="WGS84"}function See(o,f,m,v){var y;Array.isArray(m)?m=JWe(m):m={x:m.x,y:m.y,z:m.z,m:m.m};var x=m.z!==void 0;if(dIt(m),o.datum&&f.datum&&fIt(o,f)&&(y=new MW("WGS84"),m=See(o,y,m,v),o=y),v&&o.axis!=="enu"&&(m=hFe(o,!1,m)),o.projName==="longlat")m={x:m.x*f_,y:m.y*f_,z:m.z||0};else if(o.to_meter&&(m={x:m.x*o.to_meter,y:m.y*o.to_meter,z:m.z||0}),m=o.inverse(m),!m)return;if(o.from_greenwich&&(m.x+=o.from_greenwich),m=cIt(o.datum,f.datum,m),!!m)return f.from_greenwich&&(m={x:m.x-f.from_greenwich,y:m.y,z:m.z||0}),f.projName==="longlat"?m={x:m.x*r2,y:m.y*r2,z:m.z||0}:(m=f.forward(m),f.to_meter&&(m={x:m.x/f.to_meter,y:m.y/f.to_meter,z:m.z||0})),v&&f.axis!=="enu"?hFe(f,!0,m):(x||delete m.z,m)}var fFe=MW("WGS84");function ghe(o,f,m,v){var y,x,C;return Array.isArray(m)?(y=See(o,f,m,v)||{x:NaN,y:NaN},m.length>2?typeof o.name<"u"&&o.name==="geocent"||typeof f.name<"u"&&f.name==="geocent"?typeof y.z=="number"?[y.x,y.y,y.z].concat(m.splice(3)):[y.x,y.y,m[2]].concat(m.splice(3)):[y.x,y.y].concat(m.splice(2)):[y.x,y.y]):(x=See(o,f,m,v),C=Object.keys(m),C.length===2||C.forEach(function(w){if(typeof o.name<"u"&&o.name==="geocent"||typeof f.name<"u"&&f.name==="geocent"){if(w==="x"||w==="y"||w==="z")return}else if(w==="x"||w==="y")return;x[w]=m[w]}),x)}function pFe(o){return o instanceof MW?o:o.oProj?o.oProj:MW(o)}function pIt(o,f,m){o=pFe(o);var v=!1,y;return typeof f>"u"?(f=o,o=fFe,v=!0):(typeof f.x<"u"||Array.isArray(f))&&(m=f,f=o,o=fFe,v=!0),f=pFe(f),m?ghe(o,f,m):(y={forward:function(x,C){return ghe(o,f,x,C)},inverse:function(x,C){return ghe(f,o,x,C)}},v&&(y.oProj=f),y)}var Q1=pIt,mFe=6,KWe="AJSAJS",QWe="AFAFAF",vz=65,Yx=73,sw=79,f7=86,p7=90,mIt={forward:ZWe,inverse:gIt,toPoint:$We};function ZWe(o,f){return f=f||5,yIt(_It({lat:o[1],lon:o[0]}),f)}function gIt(o){var f=Pxe(tje(o.toUpperCase()));return f.lat&&f.lon?[f.lon,f.lat,f.lon,f.lat]:[f.left,f.bottom,f.right,f.top]}function $We(o){var f=Pxe(tje(o.toUpperCase()));return f.lat&&f.lon?[f.lon,f.lat]:[(f.left+f.right)/2,(f.top+f.bottom)/2]}function _he(o){return o*(Math.PI/180)}function gFe(o){return 180*(o/Math.PI)}function _It(o){var f=o.lat,m=o.lon,v=6378137,y=.00669438,x=.9996,C,w,A,E,T,S,M,I=_he(f),P=_he(m),D,L;L=Math.floor((m+180)/6)+1,m===180&&(L=60),f>=56&&f<64&&m>=3&&m<12&&(L=32),f>=72&&f<84&&(m>=0&&m<9?L=31:m>=9&&m<21?L=33:m>=21&&m<33?L=35:m>=33&&m<42&&(L=37)),C=(L-1)*6-180+3,D=_he(C),w=y/(1-y),A=v/Math.sqrt(1-y*Math.sin(I)*Math.sin(I)),E=Math.tan(I)*Math.tan(I),T=w*Math.cos(I)*Math.cos(I),S=Math.cos(I)*(P-D),M=v*((1-y/4-3*y*y/64-5*y*y*y/256)*I-(3*y/8+3*y*y/32+45*y*y*y/1024)*Math.sin(2*I)+(15*y*y/256+45*y*y*y/1024)*Math.sin(4*I)-35*y*y*y/3072*Math.sin(6*I));var R=x*A*(S+(1-E+T)*S*S*S/6+(5-18*E+E*E+72*T-58*w)*S*S*S*S*S/120)+5e5,O=x*(M+A*Math.tan(I)*(S*S/2+(5-E+9*T+4*T*T)*S*S*S*S/24+(61-58*E+E*E+600*T-330*w)*S*S*S*S*S*S/720));return f<0&&(O+=1e7),{northing:Math.round(O),easting:Math.round(R),zoneNumber:L,zoneLetter:vIt(f)}}function Pxe(o){var f=o.northing,m=o.easting,v=o.zoneLetter,y=o.zoneNumber;if(y<0||y>60)return null;var x=.9996,C=6378137,w=.00669438,A,E=(1-Math.sqrt(1-w))/(1+Math.sqrt(1-w)),T,S,M,I,P,D,L,R,O,F=m-5e5,k=f;v<"N"&&(k-=1e7),L=(y-1)*6-180+3,A=w/(1-w),D=k/x,R=D/(C*(1-w/4-3*w*w/64-5*w*w*w/256)),O=R+(3*E/2-27*E*E*E/32)*Math.sin(2*R)+(21*E*E/16-55*E*E*E*E/32)*Math.sin(4*R)+151*E*E*E/96*Math.sin(6*R),T=C/Math.sqrt(1-w*Math.sin(O)*Math.sin(O)),S=Math.tan(O)*Math.tan(O),M=A*Math.cos(O)*Math.cos(O),I=C*(1-w)/Math.pow(1-w*Math.sin(O)*Math.sin(O),1.5),P=F/(T*x);var U=O-T*Math.tan(O)/I*(P*P/2-(5+3*S+10*M-4*M*M-9*A)*P*P*P*P/24+(61+90*S+298*M+45*S*S-252*A-3*M*M)*P*P*P*P*P*P/720);U=gFe(U);var G=(P-(1+2*S+M)*P*P*P/6+(5-2*M+28*S-3*M*M+8*A+24*S*S)*P*P*P*P*P/120)/Math.cos(O);G=L+gFe(G);var j;if(o.accuracy){var q=Pxe({northing:o.northing+o.accuracy,easting:o.easting+o.accuracy,zoneLetter:o.zoneLetter,zoneNumber:o.zoneNumber});j={top:q.lat,right:q.lon,bottom:U,left:G}}else j={lat:U,lon:G};return j}function vIt(o){var f="Z";return 84>=o&&o>=72?f="X":72>o&&o>=64?f="W":64>o&&o>=56?f="V":56>o&&o>=48?f="U":48>o&&o>=40?f="T":40>o&&o>=32?f="S":32>o&&o>=24?f="R":24>o&&o>=16?f="Q":16>o&&o>=8?f="P":8>o&&o>=0?f="N":0>o&&o>=-8?f="M":-8>o&&o>=-16?f="L":-16>o&&o>=-24?f="K":-24>o&&o>=-32?f="J":-32>o&&o>=-40?f="H":-40>o&&o>=-48?f="G":-48>o&&o>=-56?f="F":-56>o&&o>=-64?f="E":-64>o&&o>=-72?f="D":-72>o&&o>=-80&&(f="C"),f}function yIt(o,f){var m="00000"+o.easting,v="00000"+o.northing;return o.zoneNumber+o.zoneLetter+xIt(o.easting,o.northing,o.zoneNumber)+m.substr(m.length-5,f)+v.substr(v.length-5,f)}function xIt(o,f,m){var v=eje(m),y=Math.floor(o/1e5),x=Math.floor(f/1e5)%20;return CIt(y,x,v)}function eje(o){var f=o%mFe;return f===0&&(f=mFe),f}function CIt(o,f,m){var v=m-1,y=KWe.charCodeAt(v),x=QWe.charCodeAt(v),C=y+o-1,w=x+f,A=!1;C>p7&&(C=C-p7+vz-1,A=!0),(C===Yx||yYx||(C>Yx||ysw||(C>sw||yp7&&(C=C-p7+vz-1),w>f7?(w=w-f7+vz-1,A=!0):A=!1,(w===Yx||xYx||(w>Yx||xsw||(w>sw||xf7&&(w=w-f7+vz-1);var E=String.fromCharCode(C)+String.fromCharCode(w);return E}function tje(o){if(o&&o.length===0)throw"MGRSPoint coverting from nothing";for(var f=o.length,m=null,v="",y,x=0;!/[A-Z]/.test(y=o.charAt(x));){if(x>=2)throw"MGRSPoint bad conversion from: "+o;v+=y,x++}var C=parseInt(v,10);if(x===0||x+3>f)throw"MGRSPoint bad conversion from: "+o;var w=o.charAt(x++);if(w<="A"||w==="B"||w==="Y"||w>="Z"||w==="I"||w==="O")throw"MGRSPoint zone letter "+w+" not handled: "+o;m=o.substring(x,x+=2);for(var A=eje(C),E=bIt(m.charAt(0),A),T=wIt(m.charAt(1),A);T0&&(D=1e5/Math.pow(10,M),L=o.substring(x,x+M),I=parseFloat(L)*D,R=o.substring(x+M),P=parseFloat(R)*D),O=I+E,F=P+T,{easting:O,northing:F,zoneLetter:w,zoneNumber:C,accuracy:D}}function bIt(o,f){for(var m=KWe.charCodeAt(f-1),v=1e5,y=!1;m!==o.charCodeAt(0);){if(m++,m===Yx&&m++,m===sw&&m++,m>p7){if(y)throw"Bad character: "+o;m=vz,y=!0}v+=1e5}return v}function wIt(o,f){if(o>"V")throw"MGRSPoint given invalid Northing "+o;for(var m=QWe.charCodeAt(f-1),v=0,y=!1;m!==o.charCodeAt(0);){if(m++,m===Yx&&m++,m===sw&&m++,m>f7){if(y)throw"Bad character: "+o;m=vz,y=!0}v+=1e5}return v}function AIt(o){var f;switch(o){case"C":f=11e5;break;case"D":f=2e6;break;case"E":f=28e5;break;case"F":f=37e5;break;case"G":f=46e5;break;case"H":f=55e5;break;case"J":f=64e5;break;case"K":f=73e5;break;case"L":f=82e5;break;case"M":f=91e5;break;case"N":f=0;break;case"P":f=8e5;break;case"Q":f=17e5;break;case"R":f=26e5;break;case"S":f=35e5;break;case"T":f=44e5;break;case"U":f=53e5;break;case"V":f=62e5;break;case"W":f=7e6;break;case"X":f=79e5;break;default:f=-1}if(f>=0)return f;throw"Invalid zone letter: "+o}function dH(o,f,m){if(!(this instanceof dH))return new dH(o,f,m);if(Array.isArray(o))this.x=o[0],this.y=o[1],this.z=o[2]||0;else if(typeof o=="object")this.x=o.x,this.y=o.y,this.z=o.z||0;else if(typeof o=="string"&&typeof f>"u"){var v=o.split(",");this.x=parseFloat(v[0],10),this.y=parseFloat(v[1],10),this.z=parseFloat(v[2],10)||0}else this.x=o,this.y=f,this.z=m||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}dH.fromMGRS=function(o){return new dH($We(o))};dH.prototype.toMGRS=function(o){return ZWe([this.x,this.y],o)};var EIt=dH,TIt=1,SIt=.25,_Fe=.046875,vFe=.01953125,yFe=.01068115234375,PIt=.75,IIt=.46875,MIt=.013020833333333334,DIt=.007120768229166667,LIt=.3645833333333333,RIt=.005696614583333333,OIt=.3076171875;function ije(o){var f=[];f[0]=TIt-o*(SIt+o*(_Fe+o*(vFe+o*yFe))),f[1]=o*(PIt-o*(_Fe+o*(vFe+o*yFe)));var m=o*o;return f[2]=m*(IIt-o*(MIt+o*DIt)),m*=o,f[3]=m*(LIt-o*RIt),f[4]=m*o*OIt,f}function Zie(o,f,m,v){return m*=f,f*=f,v[0]*o-m*(v[1]+f*(v[2]+f*(v[3]+f*v[4])))}var NIt=20;function rje(o,f,m){for(var v=1/(1-f),y=o,x=NIt;x;--x){var C=Math.sin(y),w=1-f*C*C;if(w=(Zie(y,C,Math.cos(y),m)-o)*(w*Math.sqrt(w))*v,y-=w,Math.abs(w)ca?Math.tan(m):0,P=Math.pow(I,2),D=Math.pow(P,2);y=1-this.es*Math.pow(w,2),E=E/Math.sqrt(y);var L=Zie(m,w,A,this.en);x=this.a*(this.k0*E*(1+T/6*(1-P+S+T/20*(5-18*P+D+14*S-58*P*S+T/42*(61+179*D-D*P-479*P)))))+this.x0,C=this.a*(this.k0*(L-this.ml0+w*v*E/2*(1+T/12*(5-P+9*S+4*M+T/30*(61+D-58*P+270*S-330*P*S+T/56*(1385+543*D-D*P-3111*P))))))+this.y0}else{var R=A*Math.sin(v);if(Math.abs(Math.abs(R)-1)=1){if(R-1>ca)return 93;C=0}else C=Math.acos(C);m<0&&(C=-C),C=this.a*this.k0*(C-this.lat0)+this.y0}return o.x=x,o.y=C,o}function kIt(o){var f,m,v,y,x=(o.x-this.x0)*(1/this.a),C=(o.y-this.y0)*(1/this.a);if(this.es)if(f=this.ml0+C/this.k0,m=rje(f,this.es,this.en),Math.abs(m)ca?Math.tan(m):0,T=this.ep2*Math.pow(A,2),S=Math.pow(T,2),M=Math.pow(E,2),I=Math.pow(M,2);f=1-this.es*Math.pow(w,2);var P=x*Math.sqrt(f)/this.k0,D=Math.pow(P,2);f=f*E,v=m-f*D/(1-this.es)*.5*(1-D/12*(5+3*M-9*T*M+T-4*S-D/30*(61+90*M-252*T*M+45*I+46*T-D/56*(1385+3633*M+4095*I+1574*I*M)))),y=Oa(this.long0+P*(1-D/6*(1+2*M+T-D/20*(5+28*M+24*I+8*T*M+6*T-D/42*(61+662*M+1320*I+720*I*M))))/A)}else v=wo*aY(C),y=0;else{var L=Math.exp(x/this.k0),R=.5*(L-1/L),O=this.lat0+C/this.k0,F=Math.cos(O);f=Math.sqrt((1-Math.pow(F,2))/(1+Math.pow(R,2))),v=Math.asin(f),C<0&&(v=-v),R===0&&F===0?y=0:y=Oa(Math.atan2(R,F)+this.long0)}return o.x=y,o.y=v,o}var VIt=["Fast_Transverse_Mercator","Fast Transverse Mercator"],O$={init:FIt,forward:BIt,inverse:kIt,names:VIt};function nje(o){var f=Math.exp(o);return f=(f-1/f)/2,f}function LE(o,f){o=Math.abs(o),f=Math.abs(f);var m=Math.max(o,f),v=Math.min(o,f)/(m||1);return m*Math.sqrt(1+Math.pow(v,2))}function zIt(o){var f=1+o,m=f-1;return m===0?o:o*Math.log(f)/m}function HIt(o){var f=Math.abs(o);return f=zIt(f*(1+f/(LE(1,f)+1))),o<0?-f:f}function Ixe(o,f){for(var m=2*Math.cos(2*f),v=o.length-1,y=o[v],x=0,C;--v>=0;)C=-x+m*y+o[v],x=y,y=C;return f+C*Math.sin(2*f)}function UIt(o,f){for(var m=2*Math.cos(f),v=o.length-1,y=o[v],x=0,C;--v>=0;)C=-x+m*y+o[v],x=y,y=C;return Math.sin(f)*C}function GIt(o){var f=Math.exp(o);return f=(f+1/f)/2,f}function oje(o,f,m){for(var v=Math.sin(f),y=Math.cos(f),x=nje(m),C=GIt(m),w=2*y*C,A=-2*v*x,E=o.length-1,T=o[E],S=0,M=0,I=0,P,D;--E>=0;)P=M,D=S,M=T,S=I,T=-P+w*M-A*S+o[E],I=-D+A*M+w*S;return w=v*C,A=y*x,[w*T-A*I,w*I+A*T]}function WIt(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(O$.init.apply(this),this.forward=O$.forward,this.inverse=O$.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var o=this.es/(1+Math.sqrt(1-this.es)),f=o/(2-o),m=f;this.cgb[0]=f*(2+f*(-2/3+f*(-2+f*(116/45+f*(26/45+f*(-2854/675)))))),this.cbg[0]=f*(-2+f*(2/3+f*(4/3+f*(-82/45+f*(32/45+f*(4642/4725)))))),m=m*f,this.cgb[1]=m*(7/3+f*(-8/5+f*(-227/45+f*(2704/315+f*(2323/945))))),this.cbg[1]=m*(5/3+f*(-16/15+f*(-13/9+f*(904/315+f*(-1522/945))))),m=m*f,this.cgb[2]=m*(56/15+f*(-136/35+f*(-1262/105+f*(73814/2835)))),this.cbg[2]=m*(-26/15+f*(34/21+f*(8/5+f*(-12686/2835)))),m=m*f,this.cgb[3]=m*(4279/630+f*(-332/35+f*(-399572/14175))),this.cbg[3]=m*(1237/630+f*(-12/5+f*(-24832/14175))),m=m*f,this.cgb[4]=m*(4174/315+f*(-144838/6237)),this.cbg[4]=m*(-734/315+f*(109598/31185)),m=m*f,this.cgb[5]=m*(601676/22275),this.cbg[5]=m*(444337/155925),m=Math.pow(f,2),this.Qn=this.k0/(1+f)*(1+m*(1/4+m*(1/64+m/256))),this.utg[0]=f*(-.5+f*(2/3+f*(-37/96+f*(1/360+f*(81/512+f*(-96199/604800)))))),this.gtu[0]=f*(.5+f*(-2/3+f*(5/16+f*(41/180+f*(-127/288+f*(7891/37800)))))),this.utg[1]=m*(-1/48+f*(-1/15+f*(437/1440+f*(-46/105+f*(1118711/3870720))))),this.gtu[1]=m*(13/48+f*(-3/5+f*(557/1440+f*(281/630+f*(-1983433/1935360))))),m=m*f,this.utg[2]=m*(-17/480+f*(37/840+f*(209/4480+f*(-5569/90720)))),this.gtu[2]=m*(61/240+f*(-103/140+f*(15061/26880+f*(167603/181440)))),m=m*f,this.utg[3]=m*(-4397/161280+f*(11/504+f*(830251/7257600))),this.gtu[3]=m*(49561/161280+f*(-179/168+f*(6601661/7257600))),m=m*f,this.utg[4]=m*(-4583/161280+f*(108847/3991680)),this.gtu[4]=m*(34729/80640+f*(-3418889/1995840)),m=m*f,this.utg[5]=m*(-20648693/638668800),this.gtu[5]=m*(212378941/319334400);var v=Ixe(this.cbg,this.lat0);this.Zb=-this.Qn*(v+UIt(this.gtu,2*v))}function jIt(o){var f=Oa(o.x-this.long0),m=o.y;m=Ixe(this.cbg,m);var v=Math.sin(m),y=Math.cos(m),x=Math.sin(f),C=Math.cos(f);m=Math.atan2(v,C*y),f=Math.atan2(x*y,LE(v,y*C)),f=HIt(Math.tan(f));var w=oje(this.gtu,2*m,2*f);m=m+w[0],f=f+w[1];var A,E;return Math.abs(f)<=2.623395162778?(A=this.a*(this.Qn*f)+this.x0,E=this.a*(this.Qn*m+this.Zb)+this.y0):(A=1/0,E=1/0),o.x=A,o.y=E,o}function YIt(o){var f=(o.x-this.x0)*(1/this.a),m=(o.y-this.y0)*(1/this.a);m=(m-this.Zb)/this.Qn,f=f/this.Qn;var v,y;if(Math.abs(f)<=2.623395162778){var x=oje(this.utg,2*m,2*f);m=m+x[0],f=f+x[1],f=Math.atan(nje(f));var C=Math.sin(m),w=Math.cos(m),A=Math.sin(f),E=Math.cos(f);m=Math.atan2(C*E,LE(A,E*w)),f=Math.atan2(A,E*w),v=Oa(f+this.long0),y=Ixe(this.cgb,m)}else v=1/0,y=1/0;return o.x=v,o.y=y,o}var qIt=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"],N$={init:WIt,forward:jIt,inverse:YIt,names:qIt};function XIt(o,f){if(o===void 0){if(o=Math.floor((Oa(f)+Math.PI)*30/Math.PI)+1,o<0)return 0;if(o>60)return 60}return o}var JIt="etmerc";function KIt(){var o=XIt(this.zone,this.long0);if(o===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(o)-183)*f_,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,N$.init.apply(this),this.forward=N$.forward,this.inverse=N$.inverse}var QIt=["Universal Transverse Mercator System","utm"],ZIt={init:KIt,names:QIt,dependsOn:JIt};function Mxe(o,f){return Math.pow((1-o)/(1+o),f)}var $It=20;function eMt(){var o=Math.sin(this.lat0),f=Math.cos(this.lat0);f*=f,this.rc=Math.sqrt(1-this.es)/(1-this.es*o*o),this.C=Math.sqrt(1+this.es*f*f/(1-this.es)),this.phic0=Math.asin(o/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Nh)/(Math.pow(Math.tan(.5*this.lat0+Nh),this.C)*Mxe(this.e*o,this.ratexp))}function tMt(o){var f=o.x,m=o.y;return o.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*m+Nh),this.C)*Mxe(this.e*Math.sin(m),this.ratexp))-wo,o.x=this.C*f,o}function iMt(o){for(var f=1e-14,m=o.x/this.C,v=o.y,y=Math.pow(Math.tan(.5*v+Nh)/this.K,1/this.C),x=$It;x>0&&(v=2*Math.atan(y*Mxe(this.e*Math.sin(o.y),-.5*this.e))-wo,!(Math.abs(v-o.y)0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=ca&&(this.k0=.5*this.cons*y2(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/NE(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=y2(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-wo,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function hMt(o){var f=o.x,m=o.y,v=Math.sin(m),y=Math.cos(m),x,C,w,A,E,T,S=Oa(f-this.long0);return Math.abs(Math.abs(f-this.long0)-Math.PI)<=ca&&Math.abs(m+this.lat0)<=ca?(o.x=NaN,o.y=NaN,o):this.sphere?(x=2*this.k0/(1+this.sinlat0*v+this.coslat0*y*Math.cos(S)),o.x=this.a*x*y*Math.sin(S)+this.x0,o.y=this.a*x*(this.coslat0*v-this.sinlat0*y*Math.cos(S))+this.y0,o):(C=2*Math.atan(this.ssfn_(m,v,this.e))-wo,A=Math.cos(C),w=Math.sin(C),Math.abs(this.coslat0)<=ca?(E=NE(this.e,m*this.con,this.con*v),T=2*this.a*this.k0*E/this.cons,o.x=this.x0+T*Math.sin(f-this.long0),o.y=this.y0-this.con*T*Math.cos(f-this.long0),o):(Math.abs(this.sinlat0)0?f=Oa(this.long0+Math.atan2(o.x,-1*o.y)):f=Oa(this.long0+Math.atan2(o.x,o.y)):f=Oa(this.long0+Math.atan2(o.x*Math.sin(w),C*this.coslat0*Math.cos(w)-o.y*this.sinlat0*Math.sin(w))),o.x=f,o.y=m,o)}else if(Math.abs(this.coslat0)<=ca){if(C<=ca)return m=this.lat0,f=this.long0,o.x=f,o.y=m,o;o.x*=this.con,o.y*=this.con,v=C*this.cons/(2*this.a*this.k0),m=this.con*IW(this.e,v),f=this.con*Oa(this.con*this.long0+Math.atan2(o.x,-1*o.y))}else y=2*Math.atan(C*this.cosX0/(2*this.a*this.k0*this.ms1)),f=this.long0,C<=ca?x=this.X0:(x=Math.asin(Math.cos(y)*this.sinX0+o.y*Math.sin(y)*this.cosX0/C),f=Oa(this.long0+Math.atan2(o.x*Math.sin(y),C*this.cosX0*Math.cos(y)-o.y*this.sinX0*Math.sin(y)))),m=-1*IW(this.e,Math.tan(.5*(wo+x)));return o.x=f,o.y=m,o}var fMt=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)"],pMt={init:cMt,forward:hMt,inverse:dMt,names:fMt,ssfn_:uMt};function mMt(){var o=this.lat0;this.lambda0=this.long0;var f=Math.sin(o),m=this.a,v=this.rf,y=1/v,x=2*y-Math.pow(y,2),C=this.e=Math.sqrt(x);this.R=this.k0*m*Math.sqrt(1-x)/(1-x*Math.pow(f,2)),this.alpha=Math.sqrt(1+x/(1-x)*Math.pow(Math.cos(o),4)),this.b0=Math.asin(f/this.alpha);var w=Math.log(Math.tan(Math.PI/4+this.b0/2)),A=Math.log(Math.tan(Math.PI/4+o/2)),E=Math.log((1+C*f)/(1-C*f));this.K=w-this.alpha*A+this.alpha*C/2*E}function gMt(o){var f=Math.log(Math.tan(Math.PI/4-o.y/2)),m=this.e/2*Math.log((1+this.e*Math.sin(o.y))/(1-this.e*Math.sin(o.y))),v=-this.alpha*(f+m)+this.K,y=2*(Math.atan(Math.exp(v))-Math.PI/4),x=this.alpha*(o.x-this.lambda0),C=Math.atan(Math.sin(x)/(Math.sin(this.b0)*Math.tan(y)+Math.cos(this.b0)*Math.cos(x))),w=Math.asin(Math.cos(this.b0)*Math.sin(y)-Math.sin(this.b0)*Math.cos(y)*Math.cos(x));return o.y=this.R/2*Math.log((1+Math.sin(w))/(1-Math.sin(w)))+this.y0,o.x=this.R*C+this.x0,o}function _Mt(o){for(var f=o.x-this.x0,m=o.y-this.y0,v=f/this.R,y=2*(Math.atan(Math.exp(m/this.R))-Math.PI/4),x=Math.asin(Math.cos(this.b0)*Math.sin(y)+Math.sin(this.b0)*Math.cos(y)*Math.cos(v)),C=Math.atan(Math.sin(v)/(Math.cos(this.b0)*Math.cos(v)-Math.sin(this.b0)*Math.tan(y))),w=this.lambda0+C/this.alpha,A=0,E=x,T=-1e3,S=0;Math.abs(E-T)>1e-7;){if(++S>20)return;A=1/this.alpha*(Math.log(Math.tan(Math.PI/4+x/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(E))/2)),T=E,E=2*Math.atan(Math.exp(A))-Math.PI/2}return o.x=w,o.y=E,o}var vMt=["somerc"],yMt={init:mMt,forward:gMt,inverse:_Mt,names:vMt},iz=1e-7;function xMt(o){var f=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],m=typeof o.PROJECTION=="object"?Object.keys(o.PROJECTION)[0]:o.PROJECTION;return"no_uoff"in o||"no_off"in o||f.indexOf(m)!==-1}function CMt(){var o,f,m,v,y,x,C,w,A,E,T=0,S,M=0,I=0,P=0,D=0,L=0,R=0,O;this.no_off=xMt(this),this.no_rot="no_rot"in this;var F=!1;"alpha"in this&&(F=!0);var k=!1;if("rectified_grid_angle"in this&&(k=!0),F&&(R=this.alpha),k&&(T=this.rectified_grid_angle*f_),F||k)M=this.longc;else if(I=this.long1,D=this.lat1,P=this.long2,L=this.lat2,Math.abs(D-L)<=iz||(o=Math.abs(D))<=iz||Math.abs(o-wo)<=iz||Math.abs(Math.abs(this.lat0)-wo)<=iz||Math.abs(Math.abs(L)-wo)<=iz)throw new Error;var U=1-this.es;f=Math.sqrt(U),Math.abs(this.lat0)>ca?(w=Math.sin(this.lat0),m=Math.cos(this.lat0),o=1-this.es*w*w,this.B=m*m,this.B=Math.sqrt(1+this.es*this.B*this.B/U),this.A=this.B*this.k0*f/o,v=this.B*f/(m*Math.sqrt(o)),y=v*v-1,y<=0?y=0:(y=Math.sqrt(y),this.lat0<0&&(y=-y)),this.E=y+=v,this.E*=Math.pow(NE(this.e,this.lat0,w),this.B)):(this.B=1/f,this.A=this.k0,this.E=v=y=1),F||k?(F?(S=Math.asin(Math.sin(R)/v),k||(T=R)):(S=T,R=Math.asin(v*Math.sin(S))),this.lam0=M-Math.asin(.5*(y-1/y)*Math.tan(S))/this.B):(x=Math.pow(NE(this.e,D,Math.sin(D)),this.B),C=Math.pow(NE(this.e,L,Math.sin(L)),this.B),y=this.E/x,A=(C-x)/(C+x),E=this.E*this.E,E=(E-C*x)/(E+C*x),o=I-P,o<-Math.pi?P-=SW:o>Math.pi&&(P+=SW),this.lam0=Oa(.5*(I+P)-Math.atan(E*Math.tan(.5*this.B*(I-P))/A)/this.B),S=Math.atan(2*Math.sin(this.B*Oa(I-this.lam0))/(y-1/y)),T=R=Math.asin(v*Math.sin(S))),this.singam=Math.sin(S),this.cosgam=Math.cos(S),this.sinrot=Math.sin(T),this.cosrot=Math.cos(T),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,O=this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(v*v-1)/Math.cos(R))),this.lat0<0&&(this.u_0=-this.u_0)),y=.5*S,this.v_pole_n=this.ArB*Math.log(Math.tan(Nh-y)),this.v_pole_s=this.ArB*Math.log(Math.tan(Nh+y))}function bMt(o){var f={},m,v,y,x,C,w,A,E;if(o.x=o.x-this.lam0,Math.abs(Math.abs(o.y)-wo)>ca){if(C=this.E/Math.pow(NE(this.e,o.y,Math.sin(o.y)),this.B),w=1/C,m=.5*(C-w),v=.5*(C+w),x=Math.sin(this.B*o.x),y=(m*this.singam-x*this.cosgam)/v,Math.abs(Math.abs(y)-1)0?this.v_pole_n:this.v_pole_s,A=this.ArB*o.y;return this.no_rot?(f.x=A,f.y=E):(A-=this.u_0,f.x=E*this.cosrot+A*this.sinrot,f.y=A*this.cosrot-E*this.sinrot),f.x=this.a*f.x+this.x0,f.y=this.a*f.y+this.y0,f}function wMt(o){var f,m,v,y,x,C,w,A={};if(o.x=(o.x-this.x0)*(1/this.a),o.y=(o.y-this.y0)*(1/this.a),this.no_rot?(m=o.y,f=o.x):(m=o.x*this.cosrot-o.y*this.sinrot,f=o.y*this.cosrot+o.x*this.sinrot+this.u_0),v=Math.exp(-this.BrA*m),y=.5*(v-1/v),x=.5*(v+1/v),C=Math.sin(this.BrA*f),w=(C*this.cosgam+y*this.singam)/x,Math.abs(Math.abs(w)-1)ca?this.ns=Math.log(v/w)/Math.log(y/A):this.ns=f,isNaN(this.ns)&&(this.ns=f),this.f0=v/(this.ns*Math.pow(y,this.ns)),this.rh=this.a*this.f0*Math.pow(E,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function SMt(o){var f=o.x,m=o.y;Math.abs(2*Math.abs(m)-Math.PI)<=ca&&(m=aY(m)*(wo-2*ca));var v=Math.abs(Math.abs(m)-wo),y,x;if(v>ca)y=NE(this.e,m,Math.sin(m)),x=this.a*this.f0*Math.pow(y,this.ns);else{if(v=m*this.ns,v<=0)return null;x=0}var C=this.ns*Oa(f-this.long0);return o.x=this.k0*(x*Math.sin(C))+this.x0,o.y=this.k0*(this.rh-x*Math.cos(C))+this.y0,o}function PMt(o){var f,m,v,y,x,C=(o.x-this.x0)/this.k0,w=this.rh-(o.y-this.y0)/this.k0;this.ns>0?(f=Math.sqrt(C*C+w*w),m=1):(f=-Math.sqrt(C*C+w*w),m=-1);var A=0;if(f!==0&&(A=Math.atan2(m*C,m*w)),f!==0||this.ns>0){if(m=1/this.ns,v=Math.pow(f/(this.a*this.f0),m),y=IW(this.e,v),y===-9999)return null}else y=-wo;return x=Oa(A/this.ns+this.long0),o.x=x,o.y=y,o}var IMt=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],MMt={init:TMt,forward:SMt,inverse:PMt,names:IMt};function DMt(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function LMt(o){var f,m,v,y,x,C,w,A=o.x,E=o.y,T=Oa(A-this.long0);return f=Math.pow((1+this.e*Math.sin(E))/(1-this.e*Math.sin(E)),this.alfa*this.e/2),m=2*(Math.atan(this.k*Math.pow(Math.tan(E/2+this.s45),this.alfa)/f)-this.s45),v=-T*this.alfa,y=Math.asin(Math.cos(this.ad)*Math.sin(m)+Math.sin(this.ad)*Math.cos(m)*Math.cos(v)),x=Math.asin(Math.cos(m)*Math.sin(v)/Math.cos(y)),C=this.n*x,w=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(y/2+this.s45),this.n),o.y=w*Math.cos(C)/1,o.x=w*Math.sin(C)/1,this.czech||(o.y*=-1,o.x*=-1),o}function RMt(o){var f,m,v,y,x,C,w,A,E=o.x;o.x=o.y,o.y=E,this.czech||(o.y*=-1,o.x*=-1),C=Math.sqrt(o.x*o.x+o.y*o.y),x=Math.atan2(o.y,o.x),y=x/Math.sin(this.s0),v=2*(Math.atan(Math.pow(this.ro0/C,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),f=Math.asin(Math.cos(this.ad)*Math.sin(v)-Math.sin(this.ad)*Math.cos(v)*Math.cos(y)),m=Math.asin(Math.cos(v)*Math.sin(y)/Math.cos(f)),o.x=this.long0-m/this.alfa,w=f,A=0;var T=0;do o.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(f/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(w))/(1-this.e*Math.sin(w)),this.e/2))-this.s45),Math.abs(w-o.y)<1e-10&&(A=1),w=o.y,T+=1;while(A===0&&T<15);return T>=15?null:o}var OMt=["Krovak","krovak"],NMt={init:DMt,forward:LMt,inverse:RMt,names:OMt};function ky(o,f,m,v,y){return o*y-f*Math.sin(2*y)+m*Math.sin(4*y)-v*Math.sin(6*y)}function sY(o){return 1-.25*o*(1+o/16*(3+1.25*o))}function lY(o){return .375*o*(1+.25*o*(1+.46875*o))}function uY(o){return .05859375*o*o*(1+.75*o)}function cY(o){return o*o*o*(35/3072)}function fH(o,f,m){var v=f*m;return o/Math.sqrt(1-v*v)}function _U(o){return Math.abs(o)1e-7?(m=o*f,(1-o*o)*(f/(1-m*m)-.5/o*Math.log((1-m)/(1+m)))):2*f}var HMt=1,UMt=2,GMt=3,WMt=4;function jMt(){var o=Math.abs(this.lat0);if(Math.abs(o-wo)0){var f;switch(this.qp=JR(this.e,1),this.mmf=.5/(1-this.es),this.apa=eDt(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),f=Math.sin(this.lat0),this.sinb1=JR(this.e,f)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*f*f)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function YMt(o){var f,m,v,y,x,C,w,A,E,T,S=o.x,M=o.y;if(S=Oa(S-this.long0),this.sphere){if(x=Math.sin(M),T=Math.cos(M),v=Math.cos(S),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(m=this.mode===this.EQUIT?1+T*v:1+this.sinph0*x+this.cosph0*T*v,m<=ca)return null;m=Math.sqrt(2/m),f=m*T*Math.sin(S),m*=this.mode===this.EQUIT?x:this.cosph0*x-this.sinph0*T*v}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(v=-v),Math.abs(M+this.lat0)=0?(f=(E=Math.sqrt(C))*y,m=v*(this.mode===this.S_POLE?E:-E)):f=m=0;break}}return o.x=this.a*f+this.x0,o.y=this.a*m+this.y0,o}function qMt(o){o.x-=this.x0,o.y-=this.y0;var f=o.x/this.a,m=o.y/this.a,v,y,x,C,w,A,E;if(this.sphere){var T=0,S,M=0;if(S=Math.sqrt(f*f+m*m),y=S*.5,y>1)return null;switch(y=2*Math.asin(y),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(M=Math.sin(y),T=Math.cos(y)),this.mode){case this.EQUIT:y=Math.abs(S)<=ca?0:Math.asin(m*M/S),f*=M,m=T*S;break;case this.OBLIQ:y=Math.abs(S)<=ca?this.lat0:Math.asin(T*this.sinph0+m*M*this.cosph0/S),f*=M*this.cosph0,m=(T-Math.sin(y)*this.sinph0)*S;break;case this.N_POLE:m=-m,y=wo-y;break;case this.S_POLE:y-=wo;break}v=m===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(f,m)}else{if(E=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,m*=this.dd,A=Math.sqrt(f*f+m*m),A1&&(o=o>1?1:-1),Math.asin(o)}function nDt(){Math.abs(this.lat1+this.lat2)ca?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function oDt(o){var f=o.x,m=o.y;this.sin_phi=Math.sin(m),this.cos_phi=Math.cos(m);var v=JR(this.e3,this.sin_phi),y=this.a*Math.sqrt(this.c-this.ns0*v)/this.ns0,x=this.ns0*Oa(f-this.long0),C=y*Math.sin(x)+this.x0,w=this.rh-y*Math.cos(x)+this.y0;return o.x=C,o.y=w,o}function aDt(o){var f,m,v,y,x,C;return o.x-=this.x0,o.y=this.rh-o.y+this.y0,this.ns0>=0?(f=Math.sqrt(o.x*o.x+o.y*o.y),v=1):(f=-Math.sqrt(o.x*o.x+o.y*o.y),v=-1),y=0,f!==0&&(y=Math.atan2(v*o.x,v*o.y)),v=f*this.ns0/this.a,this.sphere?C=Math.asin((this.c-v*v)/(2*this.ns0)):(m=(this.c-v*v)/this.ns0,C=this.phi1z(this.e3,m)),x=Oa(y/this.ns0+this.long0),o.x=x,o.y=C,o}function sDt(o,f){var m,v,y,x,C,w=x3(.5*f);if(o0||Math.abs(C)<=ca?(w=this.x0+this.a*x*m*Math.sin(v)/C,A=this.y0+this.a*x*(this.cos_p14*f-this.sin_p14*m*y)/C):(w=this.x0+this.infinity_dist*m*Math.sin(v),A=this.y0+this.infinity_dist*(this.cos_p14*f-this.sin_p14*m*y)),o.x=w,o.y=A,o}function dDt(o){var f,m,v,y,x,C;return o.x=(o.x-this.x0)/this.a,o.y=(o.y-this.y0)/this.a,o.x/=this.k0,o.y/=this.k0,(f=Math.sqrt(o.x*o.x+o.y*o.y))?(y=Math.atan2(f,this.rc),m=Math.sin(y),v=Math.cos(y),C=x3(v*this.sin_p14+o.y*m*this.cos_p14/f),x=Math.atan2(o.x*m,f*this.cos_p14*v-o.y*this.sin_p14*m),x=Oa(this.long0+x)):(C=this.phic0,x=0),o.x=x,o.y=C,o}var fDt=["gnom"],pDt={init:cDt,forward:hDt,inverse:dDt,names:fDt};function mDt(o,f){var m=1-(1-o*o)/(2*o)*Math.log((1-o)/(1+o));if(Math.abs(Math.abs(f)-m)<1e-6)return f<0?-1*wo:wo;for(var v=Math.asin(.5*f),y,x,C,w,A=0;A<30;A++)if(x=Math.sin(v),C=Math.cos(v),w=o*x,y=Math.pow(1-w*w,2)/(2*C)*(f/(1-o*o)-x/(1-w*w)+.5/o*Math.log((1-w)/(1+w))),v+=y,Math.abs(y)<=1e-10)return v;return NaN}function gDt(){this.sphere||(this.k0=y2(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function _Dt(o){var f=o.x,m=o.y,v,y,x=Oa(f-this.long0);if(this.sphere)v=this.x0+this.a*x*Math.cos(this.lat_ts),y=this.y0+this.a*Math.sin(m)/Math.cos(this.lat_ts);else{var C=JR(this.e,Math.sin(m));v=this.x0+this.a*this.k0*x,y=this.y0+this.a*C*.5/this.k0}return o.x=v,o.y=y,o}function vDt(o){o.x-=this.x0,o.y-=this.y0;var f,m;return this.sphere?(f=Oa(this.long0+o.x/this.a/Math.cos(this.lat_ts)),m=Math.asin(o.y/this.a*Math.cos(this.lat_ts))):(m=mDt(this.e,2*o.y*this.k0/this.a),f=Oa(this.long0+o.x/(this.a*this.k0))),o.x=f,o.y=m,o}var yDt=["cea"],xDt={init:gDt,forward:_Dt,inverse:vDt,names:yDt};function CDt(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function bDt(o){var f=o.x,m=o.y,v=Oa(f-this.long0),y=_U(m-this.lat0);return o.x=this.x0+this.a*v*this.rc,o.y=this.y0+this.a*y,o}function wDt(o){var f=o.x,m=o.y;return o.x=Oa(this.long0+(f-this.x0)/(this.a*this.rc)),o.y=_U(this.lat0+(m-this.y0)/this.a),o}var ADt=["Equirectangular","Equidistant_Cylindrical","eqc"],EDt={init:CDt,forward:bDt,inverse:wDt,names:ADt},xFe=20;function TDt(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=sY(this.es),this.e1=lY(this.es),this.e2=uY(this.es),this.e3=cY(this.es),this.ml0=this.a*ky(this.e0,this.e1,this.e2,this.e3,this.lat0)}function SDt(o){var f=o.x,m=o.y,v,y,x,C=Oa(f-this.long0);if(x=C*Math.sin(m),this.sphere)Math.abs(m)<=ca?(v=this.a*C,y=-1*this.a*this.lat0):(v=this.a*Math.sin(x)/Math.tan(m),y=this.a*(_U(m-this.lat0)+(1-Math.cos(x))/Math.tan(m)));else if(Math.abs(m)<=ca)v=this.a*C,y=-1*this.ml0;else{var w=fH(this.a,this.e,Math.sin(m))/Math.tan(m);v=w*Math.sin(x),y=this.a*ky(this.e0,this.e1,this.e2,this.e3,m)-this.ml0+w*(1-Math.cos(x))}return o.x=v+this.x0,o.y=y+this.y0,o}function PDt(o){var f,m,v,y,x,C,w,A,E;if(v=o.x-this.x0,y=o.y-this.y0,this.sphere)if(Math.abs(y+this.a*this.lat0)<=ca)f=Oa(v/this.a+this.long0),m=0;else{C=this.lat0+y/this.a,w=v*v/this.a/this.a+C*C,A=C;var T;for(x=xFe;x;--x)if(T=Math.tan(A),E=-1*(C*(A*T+1)-A-.5*(A*A+w)*T)/((A-C)/T-1),A+=E,Math.abs(E)<=ca){m=A;break}f=Oa(this.long0+Math.asin(v*Math.tan(A)/this.a)/Math.sin(m))}else if(Math.abs(y+this.ml0)<=ca)m=0,f=Oa(this.long0+v/this.a);else{C=(this.ml0+y)/this.a,w=v*v/this.a/this.a+C*C,A=C;var S,M,I,P,D;for(x=xFe;x;--x)if(D=this.e*Math.sin(A),S=Math.sqrt(1-D*D)*Math.tan(A),M=this.a*ky(this.e0,this.e1,this.e2,this.e3,A),I=this.e0-2*this.e1*Math.cos(2*A)+4*this.e2*Math.cos(4*A)-6*this.e3*Math.cos(6*A),P=M/this.a,E=(C*(S*P+1)-P-.5*S*(P*P+w))/(this.es*Math.sin(2*A)*(P*P+w-2*C*P)/(4*S)+(C-P)*(S*I-2/Math.sin(2*A))-I),A-=E,Math.abs(E)<=ca){m=A;break}S=Math.sqrt(1-this.es*Math.pow(Math.sin(m),2))*Math.tan(m),f=Oa(this.long0+Math.asin(v*S/this.a)/Math.sin(m))}return o.x=f,o.y=m,o}var IDt=["Polyconic","poly"],MDt={init:TDt,forward:SDt,inverse:PDt,names:IDt};function DDt(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function LDt(o){var f,m=o.x,v=o.y,y=v-this.lat0,x=m-this.long0,C=y/U7*1e-5,w=x,A=1,E=0;for(f=1;f<=10;f++)A=A*C,E=E+this.A[f]*A;var T=E,S=w,M=1,I=0,P,D,L=0,R=0;for(f=1;f<=6;f++)P=M*T-I*S,D=I*T+M*S,M=P,I=D,L=L+this.B_re[f]*M-this.B_im[f]*I,R=R+this.B_im[f]*M+this.B_re[f]*I;return o.x=R*this.a+this.x0,o.y=L*this.a+this.y0,o}function RDt(o){var f,m=o.x,v=o.y,y=m-this.x0,x=v-this.y0,C=x/this.a,w=y/this.a,A=1,E=0,T,S,M=0,I=0;for(f=1;f<=6;f++)T=A*C-E*w,S=E*C+A*w,A=T,E=S,M=M+this.C_re[f]*A-this.C_im[f]*E,I=I+this.C_im[f]*A+this.C_re[f]*E;for(var P=0;P.999999999999&&(m=.999999999999),f=Math.asin(m);var v=Oa(this.long0+o.x/(.900316316158*this.a*Math.cos(f)));v<-Math.PI&&(v=-Math.PI),v>Math.PI&&(v=Math.PI),m=(2*f+Math.sin(2*f))/Math.PI,Math.abs(m)>1&&(m=1);var y=Math.asin(m);return o.x=v,o.y=y,o}var KDt=["Mollweide","moll"],QDt={init:qDt,forward:XDt,inverse:JDt,names:KDt};function ZDt(){Math.abs(this.lat1+this.lat2)=0?(m=Math.sqrt(o.x*o.x+o.y*o.y),f=1):(m=-Math.sqrt(o.x*o.x+o.y*o.y),f=-1);var x=0;if(m!==0&&(x=Math.atan2(f*o.x,f*o.y)),this.sphere)return y=Oa(this.long0+x/this.ns),v=_U(this.g-m/this.a),o.x=y,o.y=v,o;var C=this.g-m/this.a;return v=Pee(C,this.e0,this.e1,this.e2,this.e3),y=Oa(this.long0+x/this.ns),o.x=y,o.y=v,o}var tLt=["Equidistant_Conic","eqdc"],iLt={init:ZDt,forward:$Dt,inverse:eLt,names:tLt};function rLt(){this.R=this.a}function nLt(o){var f=o.x,m=o.y,v=Oa(f-this.long0),y,x;Math.abs(m)<=ca&&(y=this.x0+this.R*v,x=this.y0);var C=x3(2*Math.abs(m/Math.PI));(Math.abs(v)<=ca||Math.abs(Math.abs(m)-wo)<=ca)&&(y=this.x0,m>=0?x=this.y0+Math.PI*this.R*Math.tan(.5*C):x=this.y0+Math.PI*this.R*-Math.tan(.5*C));var w=.5*Math.abs(Math.PI/v-v/Math.PI),A=w*w,E=Math.sin(C),T=Math.cos(C),S=T/(E+T-1),M=S*S,I=S*(2/E-1),P=I*I,D=Math.PI*this.R*(w*(S-P)+Math.sqrt(A*(S-P)*(S-P)-(P+A)*(M-P)))/(P+A);v<0&&(D=-D),y=this.x0+D;var L=A+S;return D=Math.PI*this.R*(I*L-w*Math.sqrt((P+A)*(A+1)-L*L))/(P+A),m>=0?x=this.y0+D:x=this.y0-D,o.x=y,o.y=x,o}function oLt(o){var f,m,v,y,x,C,w,A,E,T,S,M,I;return o.x-=this.x0,o.y-=this.y0,S=Math.PI*this.R,v=o.x/S,y=o.y/S,x=v*v+y*y,C=-Math.abs(y)*(1+x),w=C-2*y*y+v*v,A=-2*C+1+2*y*y+x*x,I=y*y/A+(2*w*w*w/A/A/A-9*C*w/A/A)/27,E=(C-w*w/3/A)/A,T=2*Math.sqrt(-E/3),S=3*I/E/T,Math.abs(S)>1&&(S>=0?S=1:S=-1),M=Math.acos(S)/3,o.y>=0?m=(-T*Math.cos(M+Math.PI/3)-w/3/A)*Math.PI:m=-(-T*Math.cos(M+Math.PI/3)-w/3/A)*Math.PI,Math.abs(v)2*wo*this.a?void 0:(m=f/this.a,v=Math.sin(m),y=Math.cos(m),x=this.long0,Math.abs(f)<=ca?C=this.lat0:(C=x3(y*this.sin_p12+o.y*v*this.cos_p12/f),w=Math.abs(this.lat0)-wo,Math.abs(w)<=ca?this.lat0>=0?x=Oa(this.long0+Math.atan2(o.x,-o.y)):x=Oa(this.long0-Math.atan2(-o.x,o.y)):x=Oa(this.long0+Math.atan2(o.x*v,f*this.cos_p12*y-o.y*this.sin_p12*v))),o.x=x,o.y=C,o)):(A=sY(this.es),E=lY(this.es),T=uY(this.es),S=cY(this.es),Math.abs(this.sin_p12-1)<=ca?(M=this.a*ky(A,E,T,S,wo),f=Math.sqrt(o.x*o.x+o.y*o.y),I=M-f,C=Pee(I/this.a,A,E,T,S),x=Oa(this.long0+Math.atan2(o.x,-1*o.y)),o.x=x,o.y=C,o):Math.abs(this.sin_p12+1)<=ca?(M=this.a*ky(A,E,T,S,wo),f=Math.sqrt(o.x*o.x+o.y*o.y),I=f-M,C=Pee(I/this.a,A,E,T,S),x=Oa(this.long0+Math.atan2(o.x,o.y)),o.x=x,o.y=C,o):(f=Math.sqrt(o.x*o.x+o.y*o.y),L=Math.atan2(o.x,o.y),P=fH(this.a,this.e,this.sin_p12),R=Math.cos(L),O=this.e*this.cos_p12*R,F=-O*O/(1-this.es),k=3*this.es*(1-F)*this.sin_p12*this.cos_p12*R/(1-this.es),U=f/P,G=U-F*(1+F)*Math.pow(U,3)/6-k*(1+3*F)*Math.pow(U,4)/24,j=1-F*G*G/2-U*G*G*G/6,D=Math.asin(this.sin_p12*Math.cos(G)+this.cos_p12*Math.sin(G)*R),x=Oa(this.long0+Math.asin(Math.sin(L)*Math.sin(G)/Math.cos(D))),q=Math.sin(D),C=Math.atan2((q-this.es*j*this.sin_p12)*Math.tan(D),q*(1-this.es)),o.x=x,o.y=C,o))}var hLt=["Azimuthal_Equidistant","aeqd"],dLt={init:lLt,forward:uLt,inverse:cLt,names:hLt};function fLt(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function pLt(o){var f,m,v,y,x,C,w,A,E=o.x,T=o.y;return v=Oa(E-this.long0),f=Math.sin(T),m=Math.cos(T),y=Math.cos(v),C=this.sin_p14*f+this.cos_p14*m*y,x=1,(C>0||Math.abs(C)<=ca)&&(w=this.a*x*m*Math.sin(v),A=this.y0+this.a*x*(this.cos_p14*f-this.sin_p14*m*y)),o.x=w,o.y=A,o}function mLt(o){var f,m,v,y,x,C,w;return o.x-=this.x0,o.y-=this.y0,f=Math.sqrt(o.x*o.x+o.y*o.y),m=x3(f/this.a),v=Math.sin(m),y=Math.cos(m),C=this.long0,Math.abs(f)<=ca?(w=this.lat0,o.x=C,o.y=w,o):(w=x3(y*this.sin_p14+o.y*v*this.cos_p14/f),x=Math.abs(this.lat0)-wo,Math.abs(x)<=ca?(this.lat0>=0?C=Oa(this.long0+Math.atan2(o.x,-o.y)):C=Oa(this.long0-Math.atan2(-o.x,o.y)),o.x=C,o.y=w,o):(C=Oa(this.long0+Math.atan2(o.x*v,f*this.cos_p14*y-o.y*this.sin_p14*v)),o.x=C,o.y=w,o))}var gLt=["ortho"],_Lt={init:fLt,forward:pLt,inverse:mLt,names:gLt},wp={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Fh={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function vLt(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=wo-Nh/2?this.face=wp.TOP:this.lat0<=-(wo-Nh/2)?this.face=wp.BOTTOM:Math.abs(this.long0)<=Nh?this.face=wp.FRONT:Math.abs(this.long0)<=wo+Nh?this.face=this.long0>0?wp.RIGHT:wp.LEFT:this.face=wp.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function yLt(o){var f={x:0,y:0},m,v,y,x,C,w,A={value:0};if(o.x-=this.long0,this.es!==0?m=Math.atan(this.one_minus_f_squared*Math.tan(o.y)):m=o.y,v=o.x,this.face===wp.TOP)x=wo-m,v>=Nh&&v<=wo+Nh?(A.value=Fh.AREA_0,y=v-wo):v>wo+Nh||v<=-(wo+Nh)?(A.value=Fh.AREA_1,y=v>0?v-bm:v+bm):v>-(wo+Nh)&&v<=-Nh?(A.value=Fh.AREA_2,y=v+wo):(A.value=Fh.AREA_3,y=v);else if(this.face===wp.BOTTOM)x=wo+m,v>=Nh&&v<=wo+Nh?(A.value=Fh.AREA_0,y=-v+wo):v=-Nh?(A.value=Fh.AREA_1,y=-v):v<-Nh&&v>=-(wo+Nh)?(A.value=Fh.AREA_2,y=-v-wo):(A.value=Fh.AREA_3,y=v>0?-v+bm:-v-bm);else{var E,T,S,M,I,P,D;this.face===wp.RIGHT?v=Oz(v,+wo):this.face===wp.BACK?v=Oz(v,+bm):this.face===wp.LEFT&&(v=Oz(v,-wo)),M=Math.sin(m),I=Math.cos(m),P=Math.sin(v),D=Math.cos(v),E=I*D,T=I*P,S=M,this.face===wp.FRONT?(x=Math.acos(E),y=pQ(x,S,T,A)):this.face===wp.RIGHT?(x=Math.acos(T),y=pQ(x,S,-E,A)):this.face===wp.BACK?(x=Math.acos(-E),y=pQ(x,S,-T,A)):this.face===wp.LEFT?(x=Math.acos(-T),y=pQ(x,S,E,A)):(x=y=0,A.value=Fh.AREA_0)}return w=Math.atan(12/bm*(y+Math.acos(Math.sin(y)*Math.cos(Nh))-wo)),C=Math.sqrt((1-Math.cos(x))/(Math.cos(w)*Math.cos(w))/(1-Math.cos(Math.atan(1/Math.cos(y))))),A.value===Fh.AREA_1?w+=wo:A.value===Fh.AREA_2?w+=bm:A.value===Fh.AREA_3&&(w+=1.5*bm),f.x=C*Math.cos(w),f.y=C*Math.sin(w),f.x=f.x*this.a+this.x0,f.y=f.y*this.a+this.y0,o.x=f.x,o.y=f.y,o}function xLt(o){var f={lam:0,phi:0},m,v,y,x,C,w,A,E,T,S={value:0};if(o.x=(o.x-this.x0)/this.a,o.y=(o.y-this.y0)/this.a,v=Math.atan(Math.sqrt(o.x*o.x+o.y*o.y)),m=Math.atan2(o.y,o.x),o.x>=0&&o.x>=Math.abs(o.y)?S.value=Fh.AREA_0:o.y>=0&&o.y>=Math.abs(o.x)?(S.value=Fh.AREA_1,m-=wo):o.x<0&&-o.x>=Math.abs(o.y)?(S.value=Fh.AREA_2,m=m<0?m+bm:m-bm):(S.value=Fh.AREA_3,m+=wo),T=bm/12*Math.tan(m),C=Math.sin(T)/(Math.cos(T)-1/Math.sqrt(2)),w=Math.atan(C),y=Math.cos(m),x=Math.tan(v),A=1-y*y*x*x*(1-Math.cos(Math.atan(1/Math.cos(w)))),A<-1?A=-1:A>1&&(A=1),this.face===wp.TOP)E=Math.acos(A),f.phi=wo-E,S.value===Fh.AREA_0?f.lam=w+wo:S.value===Fh.AREA_1?f.lam=w<0?w+bm:w-bm:S.value===Fh.AREA_2?f.lam=w-wo:f.lam=w;else if(this.face===wp.BOTTOM)E=Math.acos(A),f.phi=E-wo,S.value===Fh.AREA_0?f.lam=-w+wo:S.value===Fh.AREA_1?f.lam=-w:S.value===Fh.AREA_2?f.lam=-w-wo:f.lam=w<0?-w-bm:-w+bm;else{var M,I,P;M=A,T=M*M,T>=1?P=0:P=Math.sqrt(1-T)*Math.sin(w),T+=P*P,T>=1?I=0:I=Math.sqrt(1-T),S.value===Fh.AREA_1?(T=I,I=-P,P=T):S.value===Fh.AREA_2?(I=-I,P=-P):S.value===Fh.AREA_3&&(T=I,I=P,P=-T),this.face===wp.RIGHT?(T=M,M=-I,I=T):this.face===wp.BACK?(M=-M,I=-I):this.face===wp.LEFT&&(T=M,M=I,I=-T),f.phi=Math.acos(-P)-wo,f.lam=Math.atan2(I,M),this.face===wp.RIGHT?f.lam=Oz(f.lam,-wo):this.face===wp.BACK?f.lam=Oz(f.lam,-bm):this.face===wp.LEFT&&(f.lam=Oz(f.lam,+wo))}if(this.es!==0){var D,L,R;D=f.phi<0?1:0,L=Math.tan(f.phi),R=this.b/Math.sqrt(L*L+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-R*R)/(this.one_minus_f*R)),D&&(f.phi=-f.phi)}return f.lam+=this.long0,o.x=f.lam,o.y=f.phi,o}function pQ(o,f,m,v){var y;return oNh&&y<=wo+Nh?(v.value=Fh.AREA_1,y-=wo):y>wo+Nh||y<=-(wo+Nh)?(v.value=Fh.AREA_2,y=y>=0?y-bm:y+bm):(v.value=Fh.AREA_3,y+=wo)),y}function Oz(o,f){var m=o+f;return m<-bm?m+=SW:m>+bm&&(m-=SW),m}var CLt=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],bLt={init:vLt,forward:yLt,inverse:xLt,names:CLt},_me=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],m7=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],aje=.8487,sje=1.3523,lje=r2/5,wLt=1/lje,yz=18,Iee=function(o,f){return o[0]+f*(o[1]+f*(o[2]+f*o[3]))},ALt=function(o,f){return o[1]+f*(2*o[2]+f*3*o[3])};function ELt(o,f,m,v){for(var y=f;v;--v){var x=o(y);if(y-=x,Math.abs(x)=yz&&(v=yz-1),m=r2*(m-wLt*v);var y={x:Iee(_me[v],m)*f,y:Iee(m7[v],m)};return o.y<0&&(y.y=-y.y),y.x=y.x*this.a*aje+this.x0,y.y=y.y*this.a*sje+this.y0,y}function PLt(o){var f={x:(o.x-this.x0)/(this.a*aje),y:Math.abs(o.y-this.y0)/(this.a*sje)};if(f.y>=1)f.x/=_me[yz][0],f.y=o.y<0?-wo:wo;else{var m=Math.floor(f.y*yz);for(m<0?m=0:m>=yz&&(m=yz-1);;)if(m7[m][0]>f.y)--m;else if(m7[m+1][0]<=f.y)++m;else break;var v=m7[m],y=5*(f.y-v[0])/(m7[m+1][0]-v[0]);y=ELt(function(x){return(Iee(v,x)-f.y)/ALt(v,x)},y,ca,100),f.x/=Iee(_me[m],y),f.y=(5*m+y)*f_,o.y<0&&(f.y=-f.y)}return f.x=Oa(f.x+this.long0),f}var ILt=["Robinson","robin"],MLt={init:TLt,forward:SLt,inverse:PLt,names:ILt};function DLt(){this.name="geocent"}function LLt(o){var f=qWe(o,this.es,this.a);return f}function RLt(o){var f=XWe(o,this.es,this.a,this.b);return f}var OLt=["Geocentric","geocentric","geocent","Geocent"],NLt={init:DLt,forward:LLt,inverse:RLt,names:OLt},vv={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},_9={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function FLt(){if(Object.keys(_9).forEach(function(m){if(typeof this[m]>"u")this[m]=_9[m].def;else{if(_9[m].num&&isNaN(this[m]))throw new Error("Invalid parameter value, must be numeric "+m+" = "+this[m]);_9[m].num&&(this[m]=parseFloat(this[m]))}_9[m].degrees&&(this[m]=this[m]*f_)}.bind(this)),Math.abs(Math.abs(this.lat0)-wo)1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var o=this.tilt,f=this.azi;this.cg=Math.cos(f),this.sg=Math.sin(f),this.cw=Math.cos(o),this.sw=Math.sin(o)}function BLt(o){o.x-=this.long0;var f=Math.sin(o.y),m=Math.cos(o.y),v=Math.cos(o.x),y,x;switch(this.mode){case vv.OBLIQ:x=this.sinph0*f+this.cosph0*m*v;break;case vv.EQUIT:x=m*v;break;case vv.S_POLE:x=-f;break;case vv.N_POLE:x=f;break}switch(x=this.pn1/(this.p-x),y=x*m*Math.sin(o.x),this.mode){case vv.OBLIQ:x*=this.cosph0*f-this.sinph0*m*v;break;case vv.EQUIT:x*=f;break;case vv.N_POLE:x*=-(m*v);break;case vv.S_POLE:x*=m*v;break}var C,w;return C=x*this.cg+y*this.sg,w=1/(C*this.sw*this.h1+this.cw),y=(y*this.cg-x*this.sg)*this.cw*w,x=C*w,o.x=y*this.a,o.y=x*this.a,o}function kLt(o){o.x/=this.a,o.y/=this.a;var f={x:o.x,y:o.y},m,v,y;y=1/(this.pn1-o.y*this.sw),m=this.pn1*o.x*y,v=this.pn1*o.y*this.cw*y,o.x=m*this.cg+v*this.sg,o.y=v*this.cg-m*this.sg;var x=LE(o.x,o.y);if(Math.abs(x)1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var o=1-this.es,f=1/o;this.radius_p=Math.sqrt(o),this.radius_p2=o,this.radius_p_inv2=f,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function ULt(o){var f=o.x,m=o.y,v,y,x,C;if(f=f-this.long0,this.shape==="ellipse"){m=Math.atan(this.radius_p2*Math.tan(m));var w=this.radius_p/LE(this.radius_p*Math.cos(m),Math.sin(m));if(y=w*Math.cos(f)*Math.cos(m),x=w*Math.sin(f)*Math.cos(m),C=w*Math.sin(m),(this.radius_g-y)*y-x*x-C*C*this.radius_p_inv2<0)return o.x=Number.NaN,o.y=Number.NaN,o;v=this.radius_g-y,this.flip_axis?(o.x=this.radius_g_1*Math.atan(x/LE(C,v)),o.y=this.radius_g_1*Math.atan(C/v)):(o.x=this.radius_g_1*Math.atan(x/v),o.y=this.radius_g_1*Math.atan(C/LE(x,v)))}else this.shape==="sphere"&&(v=Math.cos(m),y=Math.cos(f)*v,x=Math.sin(f)*v,C=Math.sin(m),v=this.radius_g-y,this.flip_axis?(o.x=this.radius_g_1*Math.atan(x/LE(C,v)),o.y=this.radius_g_1*Math.atan(C/v)):(o.x=this.radius_g_1*Math.atan(x/v),o.y=this.radius_g_1*Math.atan(C/LE(x,v))));return o.x=o.x*this.a,o.y=o.y*this.a,o}function GLt(o){var f=-1,m=0,v=0,y,x,C,w;if(o.x=o.x/this.a,o.y=o.y/this.a,this.shape==="ellipse"){this.flip_axis?(v=Math.tan(o.y/this.radius_g_1),m=Math.tan(o.x/this.radius_g_1)*LE(1,v)):(m=Math.tan(o.x/this.radius_g_1),v=Math.tan(o.y/this.radius_g_1)*LE(1,m));var A=v/this.radius_p;if(y=m*m+A*A+f*f,x=2*this.radius_g*f,C=x*x-4*y*this.C,C<0)return o.x=Number.NaN,o.y=Number.NaN,o;w=(-x-Math.sqrt(C))/(2*y),f=this.radius_g+w*f,m*=w,v*=w,o.x=Math.atan2(m,f),o.y=Math.atan(v*Math.cos(o.x)/f),o.y=Math.atan(this.radius_p_inv2*Math.tan(o.y))}else if(this.shape==="sphere"){if(this.flip_axis?(v=Math.tan(o.y/this.radius_g_1),m=Math.tan(o.x/this.radius_g_1)*Math.sqrt(1+v*v)):(m=Math.tan(o.x/this.radius_g_1),v=Math.tan(o.y/this.radius_g_1)*Math.sqrt(1+m*m)),y=m*m+v*v+f*f,x=2*this.radius_g*f,C=x*x-4*y*this.C,C<0)return o.x=Number.NaN,o.y=Number.NaN,o;w=(-x-Math.sqrt(C))/(2*y),f=this.radius_g+w*f,m*=w,v*=w,o.x=Math.atan2(m,f),o.y=Math.atan(v*Math.cos(o.x)/f)}return o.x=o.x+this.long0,o}var WLt=["Geostationary Satellite View","Geostationary_Satellite","geos"],jLt={init:HLt,forward:ULt,inverse:GLt,names:WLt};function YLt(o){o.Proj.projections.add(O$),o.Proj.projections.add(N$),o.Proj.projections.add(ZIt),o.Proj.projections.add(lMt),o.Proj.projections.add(pMt),o.Proj.projections.add(yMt),o.Proj.projections.add(EMt),o.Proj.projections.add(MMt),o.Proj.projections.add(NMt),o.Proj.projections.add(zMt),o.Proj.projections.add(rDt),o.Proj.projections.add(uDt),o.Proj.projections.add(pDt),o.Proj.projections.add(xDt),o.Proj.projections.add(EDt),o.Proj.projections.add(MDt),o.Proj.projections.add(NDt),o.Proj.projections.add(zDt),o.Proj.projections.add(YDt),o.Proj.projections.add(QDt),o.Proj.projections.add(iLt),o.Proj.projections.add(sLt),o.Proj.projections.add(dLt),o.Proj.projections.add(_Lt),o.Proj.projections.add(bLt),o.Proj.projections.add(MLt),o.Proj.projections.add(NLt),o.Proj.projections.add(zLt),o.Proj.projections.add(jLt)}Q1.defaultDatum="WGS84";Q1.Proj=MW;Q1.WGS84=new Q1.Proj("WGS84");Q1.Point=EIt;Q1.toPoint=JWe;Q1.defs=Eee;Q1.nadgrid=ZPt;Q1.transform=See;Q1.mgrs=mIt;Q1.version="__VERSION__";YLt(Q1);var Lxe=Q1,uje=Lxe.defs("EPSG:3857");function eC(o,f){this._ellipsoid=Z(f,ki.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis,this._customEPSG=o}Object.defineProperties(eC.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});eC.mercatorAngleToGeodeticLatitude=function(o){return xe.PI_OVER_TWO-2*Math.atan(Math.exp(-o))};eC.geodeticLatitudeToMercatorAngle=function(o){o>eC.MaximumLatitude?o=eC.MaximumLatitude:o<-eC.MaximumLatitude&&(o=-eC.MaximumLatitude);let f=Math.sin(o);return .5*Math.log((1+f)/(1-f))};eC.MaximumLatitude=eC.mercatorAngleToGeodeticLatitude(Math.PI);eC.prototype.project=function(o,f){let m=this._semimajorAxis,v=o.longitude*m,y=eC.geodeticLatitudeToMercatorAngle(o.latitude)*m,x=o.height,C=Lxe(uje,this._customEPSG,[v,y]);return N(f)?(f.x=C[0],f.y=C[1],f.z=x,f):new H(C[0],C[1],x)};eC.prototype.unproject=function(o,f){let m=Lxe(this._customEPSG,uje,[o.x,o.y]),v=this._oneOverSemimajorAxis,y=m[0]*v,x=eC.mercatorAngleToGeodeticLatitude(m[1]*v),C=o.z;return N(f)?(f.longitude=y,f.latitude=x,f.height=C,f):new Mt(y,x,C)};var vU=eC,qLt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},Ra=Object.freeze(qLt),XLt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat2",MAT4:"mat4"},Nv=Object.freeze(XLt);function JLt(o){o=Z(o,Z.EMPTY_OBJECT),this.typedArray=o.typedArray,this.width=o.width,this.height=o.height,this.pixelFormat=Z(o.pixelFormat,Nn.RGBA),this.pixelDatatype=Z(o.pixelDatatype,Rn.UNSIGNED_BYTE);let f=o.url;typeof f=="string"&&(f=Jr.createIfNeeded(f)),this.resource=f;let m=Z(o.repeat,!0)?ha.REPEAT:ha.CLAMP_TO_EDGE;this.sampler=new gs({wrapS:m,wrapT:m,minificationFilter:o.minificationFilter,magnificationFilter:o.magnificationFilter,maximumAnisotropy:o.maximumAnisotropy})}var Rxe=JLt,KLt={UNLIT:0,PBR:1},pC=Object.freeze(KLt),cje={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};cje.getDefineName=function(o){return`CUSTOM_SHADER_${o}`};var hY=Object.freeze(cje);function QLt(o,f,m){let v=new Uint8ClampedArray(o.buffer),y=new ImageData(v,f,m),x=document.createElement("canvas");return x.width=f,x.height=m,x.getContext("2d").putImageData(y,0,0),x}var Oxe=QLt;function ZLt(o){let f=document.createElement("canvas");return f.width=xe.nextPowerOfTwo(o.width),f.height=xe.nextPowerOfTwo(o.height),f.getContext("2d").drawImage(o,0,0,o.width,o.height,0,0,f.width,f.height),f}var DW=ZLt;function yU(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}yU.prototype.getTexture=function(o){return this._textures[o]};function $Lt(o,f,m){m.resource=m.resource.clone(),m.resource.fetchImage().then(function(v){o._loadedImages.push({id:f,image:v,textureUniform:m})}).catch(function(){let v=o._textures[f];N(v)&&v!==o._defaultTexture&&v.destroy(),o._textures[f]=o._defaultTexture})}yU.prototype.loadTexture2D=function(o,f){N(f.typedArray)?this._loadedImages.push({id:o,textureUniform:f}):f instanceof _o?this._textures[o]=f:$Lt(this,o,f)};function eRt(o,f,m){let{id:v,textureUniform:y,image:x}=f,C=m.webgl2?F$(y,x,m):tRt(y,x,m),w=o._textures[v];N(w)&&w!==m.defaultTexture&&w.destroy(),o._textures[v]=C}function F$(o,f,m){let{typedArray:v,sampler:y}=o,x=N(v)?dje(o,m):new _o({context:m,source:f,sampler:y});return hje(y)&&x.generateMipmap(),x}function tRt(o,f,m){let{typedArray:v,sampler:y}=o,x=hje(y),C=y.wrapS===ha.REPEAT||y.wrapS===ha.MIRRORED_REPEAT||y.wrapT===ha.REPEAT||y.wrapT===ha.MIRRORED_REPEAT,{width:w,height:A}=N(v)?o:f,E=[w,A].every(xe.isPowerOfTwo);if((x||C)&&!E)if(N(v)){if(o.pixelDatatype===Rn.UNSIGNED_BYTE){let T=Oxe(v,w,A),S=DW(T);return F$({sampler:y},S,m)}}else{let T=DW(f);return F$(o,T,m)}else return F$(o,f,m);return x?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):C&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),dje(o,m)}function hje(o){return[Xa.NEAREST_MIPMAP_NEAREST,Xa.NEAREST_MIPMAP_LINEAR,Xa.LINEAR_MIPMAP_NEAREST,Xa.LINEAR_MIPMAP_LINEAR].includes(o.minificationFilter)}function dje(o,f){let{pixelFormat:m,pixelDatatype:v,width:y,height:x,typedArray:C,sampler:w}=o;return new _o({context:f,pixelFormat:m,pixelDatatype:v,source:{arrayBufferView:C,width:y,height:x},sampler:w,flipY:!1})}yU.prototype.update=function(o){if(o.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=o.frameNumber;let f=o.context;this._defaultTexture=f.defaultTexture;let m=this._loadedImages;for(let v=0;v{if(typeof f!="object"||!f.name||!f.init)throw new Error("Invalid JSEP plugin format");this.registered[f.name]||(f.init(this.jsep),this.registered[f.name]=f)})}},wn=class{static get version(){return"1.3.8"}static toString(){return"JavaScript Expression Parser (JSEP) v"+wn.version}static addUnaryOp(o){return wn.max_unop_len=Math.max(o.length,wn.max_unop_len),wn.unary_ops[o]=1,wn}static addBinaryOp(o,f,m){return wn.max_binop_len=Math.max(o.length,wn.max_binop_len),wn.binary_ops[o]=f,m?wn.right_associative.add(o):wn.right_associative.delete(o),wn}static addIdentifierChar(o){return wn.additional_identifier_chars.add(o),wn}static addLiteral(o,f){return wn.literals[o]=f,wn}static removeUnaryOp(o){return delete wn.unary_ops[o],o.length===wn.max_unop_len&&(wn.max_unop_len=wn.getMaxKeyLen(wn.unary_ops)),wn}static removeAllUnaryOps(){return wn.unary_ops={},wn.max_unop_len=0,wn}static removeIdentifierChar(o){return wn.additional_identifier_chars.delete(o),wn}static removeBinaryOp(o){return delete wn.binary_ops[o],o.length===wn.max_binop_len&&(wn.max_binop_len=wn.getMaxKeyLen(wn.binary_ops)),wn.right_associative.delete(o),wn}static removeAllBinaryOps(){return wn.binary_ops={},wn.max_binop_len=0,wn}static removeLiteral(o){return delete wn.literals[o],wn}static removeAllLiterals(){return wn.literals={},wn}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(o){this.expr=o,this.index=0}static parse(o){return new wn(o).parse()}static getMaxKeyLen(o){return Math.max(0,...Object.keys(o).map(f=>f.length))}static isDecimalDigit(o){return o>=48&&o<=57}static binaryPrecedence(o){return wn.binary_ops[o]||0}static isIdentifierStart(o){return o>=65&&o<=90||o>=97&&o<=122||o>=128&&!wn.binary_ops[String.fromCharCode(o)]||wn.additional_identifier_chars.has(String.fromCharCode(o))}static isIdentifierPart(o){return wn.isIdentifierStart(o)||wn.isDecimalDigit(o)}throwError(o){let f=new Error(o+" at character "+this.index);throw f.index=this.index,f.description=o,f}runHook(o,f){if(wn.hooks[o]){let m={context:this,node:f};return wn.hooks.run(o,m),m.node}return f}searchHook(o){if(wn.hooks[o]){let f={context:this};return wn.hooks[o].find(function(m){return m.call(f.context,f),f.node}),f.node}}gobbleSpaces(){let o=this.code;for(;o===wn.SPACE_CODE||o===wn.TAB_CODE||o===wn.LF_CODE||o===wn.CR_CODE;)o=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let o=this.gobbleExpressions(),f=o.length===1?o[0]:{type:wn.COMPOUND,body:o};return this.runHook("after-all",f)}gobbleExpressions(o){let f=[],m,v;for(;this.index0;){if(wn.binary_ops.hasOwnProperty(o)&&(!wn.isIdentifierStart(this.code)||this.index+o.lengthy.right_a&&T.right_a?m>T.prec:m<=T.prec;for(;v.length>2&&E(v[v.length-2]);)C=v.pop(),f=v.pop().value,x=v.pop(),o={type:wn.BINARY_EXP,operator:f,left:x,right:C},v.push(o);o=this.gobbleToken(),o||this.throwError("Expected expression after "+A),v.push(y,o)}for(w=v.length-1,o=v[w];w>1;)o={type:wn.BINARY_EXP,operator:v[w-1].value,left:v[w-2],right:o},w-=2;return o}gobbleToken(){let o,f,m,v;if(this.gobbleSpaces(),v=this.searchHook("gobble-token"),v)return this.runHook("after-token",v);if(o=this.code,wn.isDecimalDigit(o)||o===wn.PERIOD_CODE)return this.gobbleNumericLiteral();if(o===wn.SQUOTE_CODE||o===wn.DQUOTE_CODE)v=this.gobbleStringLiteral();else if(o===wn.OBRACK_CODE)v=this.gobbleArray();else{for(f=this.expr.substr(this.index,wn.max_unop_len),m=f.length;m>0;){if(wn.unary_ops.hasOwnProperty(f)&&(!wn.isIdentifierStart(this.code)||this.index+f.length=f.length&&this.throwError("Unexpected token "+String.fromCharCode(o));break}else if(y===wn.COMMA_CODE){if(this.index++,v++,v!==f.length){if(o===wn.CPAREN_CODE)this.throwError("Unexpected token ,");else if(o===wn.CBRACK_CODE)for(let x=f.length;x":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10},right_associative:new Set,additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});wn.max_unop_len=wn.getMaxKeyLen(wn.unary_ops);wn.max_binop_len=wn.getMaxKeyLen(wn.binary_ops);var u5=o=>new wn(o).parse(),hRt=Object.getOwnPropertyNames(wn);hRt.forEach(o=>{u5[o]===void 0&&o!=="prototype"&&(u5[o]=wn[o])});u5.Jsep=wn;var dRt="ConditionalExpression",fRt={name:"ternary",init(o){o.hooks.add("after-expression",function(f){if(f.node&&this.code===o.QUMARK_CODE){this.index++;let m=f.node,v=this.gobbleExpression();if(v||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===o.COLON_CODE){this.index++;let y=this.gobbleExpression();if(y||this.throwError("Expected expression"),f.node={type:dRt,test:m,consequent:v,alternate:y},m.operator&&o.binary_ops[m.operator]<=.9){let x=m;for(;x.right.operator&&o.binary_ops[x.right.operator]<=.9;)x=x.right;f.node.test=x.right,x.right=f.node,f.node=m}}else this.throwError("Expected :")}})}};u5.plugins.register(fRt);var pRt={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},Co=Object.freeze(pRt);function JE(o,f){this._expression=o,o=SRt(o,f),o=IRt(PRt(o)),u5.addBinaryOp("=~",0),u5.addBinaryOp("!~",0);let m;try{m=u5(o)}catch(v){throw new sr(v)}this._runtimeAst=Yu(this,m)}Object.defineProperties(JE.prototype,{expression:{get:function(){return this._expression}}});var Js={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new Ye],cartesian3Array:[new H],cartesian4Array:[new Wt],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let o=this.arrayArray[this.arrayIndex++];return o.length=0,o},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new Ye),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new H),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new Wt),this.cartesian4Array[this.cartesian4Index++]}};JE.prototype.evaluate=function(o,f){Js.reset();let m=this._runtimeAst.evaluate(o);return f instanceof Re&&m instanceof Wt?Re.fromCartesian4(m,f):m instanceof Ye||m instanceof H||m instanceof Wt?m.clone(f):m};JE.prototype.evaluateColor=function(o,f){Js.reset();let m=this._runtimeAst.evaluate(o);return Re.fromCartesian4(m,f)};JE.prototype.getShaderFunction=function(o,f,m,v){let y=this.getShaderExpression(f,m);return y=`${v} ${o} { return ${y}; } `,y};JE.prototype.getShaderExpression=function(o,f){return this._runtimeAst.getShaderExpression(o,f)};JE.prototype.getVariables=function(){let o=[];return this._runtimeAst.getVariables(o),o=o.filter(function(f,m,v){return v.indexOf(f)===m}),o};var mRt=["!","-","+"],bFe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],Mee=/\${(.*?)}/g,gRt=/\\/g,_Rt="@#%",vRt=/@#%/g,$ie=new Re,ere={abs:Fg(Math.abs),sqrt:Fg(Math.sqrt),cos:Fg(Math.cos),sin:Fg(Math.sin),tan:Fg(Math.tan),acos:Fg(Math.acos),asin:Fg(Math.asin),atan:Fg(Math.atan),radians:Fg(xe.toRadians),degrees:Fg(xe.toDegrees),sign:Fg(xe.sign),floor:Fg(Math.floor),ceil:Fg(Math.ceil),round:Fg(Math.round),exp:Fg(Math.exp),exp2:Fg(xRt),log:Fg(Math.log),log2:Fg(CRt),fract:Fg(yRt),length:bRt,normalize:wRt},tre={atan2:mQ(Math.atan2,!1),pow:mQ(Math.pow,!1),min:mQ(Math.min,!0),max:mQ(Math.max,!0),distance:ARt,dot:ERt,cross:TRt},Fxe={clamp:wFe(xe.clamp,!0),mix:wFe(xe.lerp,!0)};function yRt(o){return o-Math.floor(o)}function xRt(o){return Math.pow(2,o)}function CRt(o){return xe.log2(o)}function Fg(o){return function(f,m){if(typeof m=="number")return o(m);if(m instanceof Ye)return Ye.fromElements(o(m.x),o(m.y),Js.getCartesian2());if(m instanceof H)return H.fromElements(o(m.x),o(m.y),o(m.z),Js.getCartesian3());if(m instanceof Wt)return Wt.fromElements(o(m.x),o(m.y),o(m.z),o(m.w),Js.getCartesian4());throw new sr(`Function "${f}" requires a vector or number argument. Argument is ${m}.`)}}function mQ(o,f){return function(m,v,y){if(f&&typeof y=="number"){if(typeof v=="number")return o(v,y);if(v instanceof Ye)return Ye.fromElements(o(v.x,y),o(v.y,y),Js.getCartesian2());if(v instanceof H)return H.fromElements(o(v.x,y),o(v.y,y),o(v.z,y),Js.getCartesian3());if(v instanceof Wt)return Wt.fromElements(o(v.x,y),o(v.y,y),o(v.z,y),o(v.w,y),Js.getCartesian4())}if(typeof v=="number"&&typeof y=="number")return o(v,y);if(v instanceof Ye&&y instanceof Ye)return Ye.fromElements(o(v.x,y.x),o(v.y,y.y),Js.getCartesian2());if(v instanceof H&&y instanceof H)return H.fromElements(o(v.x,y.x),o(v.y,y.y),o(v.z,y.z),Js.getCartesian3());if(v instanceof Wt&&y instanceof Wt)return Wt.fromElements(o(v.x,y.x),o(v.y,y.y),o(v.z,y.z),o(v.w,y.w),Js.getCartesian4());throw new sr(`Function "${m}" requires vector or number arguments of matching types. Arguments are ${v} and ${y}.`)}}function wFe(o,f){return function(m,v,y,x){if(f&&typeof x=="number"){if(typeof v=="number"&&typeof y=="number")return o(v,y,x);if(v instanceof Ye&&y instanceof Ye)return Ye.fromElements(o(v.x,y.x,x),o(v.y,y.y,x),Js.getCartesian2());if(v instanceof H&&y instanceof H)return H.fromElements(o(v.x,y.x,x),o(v.y,y.y,x),o(v.z,y.z,x),Js.getCartesian3());if(v instanceof Wt&&y instanceof Wt)return Wt.fromElements(o(v.x,y.x,x),o(v.y,y.y,x),o(v.z,y.z,x),o(v.w,y.w,x),Js.getCartesian4())}if(typeof v=="number"&&typeof y=="number"&&typeof x=="number")return o(v,y,x);if(v instanceof Ye&&y instanceof Ye&&x instanceof Ye)return Ye.fromElements(o(v.x,y.x,x.x),o(v.y,y.y,x.y),Js.getCartesian2());if(v instanceof H&&y instanceof H&&x instanceof H)return H.fromElements(o(v.x,y.x,x.x),o(v.y,y.y,x.y),o(v.z,y.z,x.z),Js.getCartesian3());if(v instanceof Wt&&y instanceof Wt&&x instanceof Wt)return Wt.fromElements(o(v.x,y.x,x.x),o(v.y,y.y,x.y),o(v.z,y.z,x.z),o(v.w,y.w,x.w),Js.getCartesian4());throw new sr(`Function "${m}" requires vector or number arguments of matching types. Arguments are ${v}, ${y}, and ${x}.`)}}function bRt(o,f){if(typeof f=="number")return Math.abs(f);if(f instanceof Ye)return Ye.magnitude(f);if(f instanceof H)return H.magnitude(f);if(f instanceof Wt)return Wt.magnitude(f);throw new sr(`Function "${o}" requires a vector or number argument. Argument is ${f}.`)}function wRt(o,f){if(typeof f=="number")return 1;if(f instanceof Ye)return Ye.normalize(f,Js.getCartesian2());if(f instanceof H)return H.normalize(f,Js.getCartesian3());if(f instanceof Wt)return Wt.normalize(f,Js.getCartesian4());throw new sr(`Function "${o}" requires a vector or number argument. Argument is ${f}.`)}function ARt(o,f,m){if(typeof f=="number"&&typeof m=="number")return Math.abs(f-m);if(f instanceof Ye&&m instanceof Ye)return Ye.distance(f,m);if(f instanceof H&&m instanceof H)return H.distance(f,m);if(f instanceof Wt&&m instanceof Wt)return Wt.distance(f,m);throw new sr(`Function "${o}" requires vector or number arguments of matching types. Arguments are ${f} and ${m}.`)}function ERt(o,f,m){if(typeof f=="number"&&typeof m=="number")return f*m;if(f instanceof Ye&&m instanceof Ye)return Ye.dot(f,m);if(f instanceof H&&m instanceof H)return H.dot(f,m);if(f instanceof Wt&&m instanceof Wt)return Wt.dot(f,m);throw new sr(`Function "${o}" requires vector or number arguments of matching types. Arguments are ${f} and ${m}.`)}function TRt(o,f,m){if(f instanceof H&&m instanceof H)return H.cross(f,m,Js.getCartesian3());throw new sr(`Function "${o}" requires vec3 arguments. Arguments are ${f} and ${m}.`)}function Eo(o,f,m,v,y){this._type=o,this._value=f,this._left=m,this._right=v,this._test=y,this.evaluate=void 0,VRt(this)}function SRt(o,f){if(!N(f))return o;for(let m in f)if(f.hasOwnProperty(m)){let v=new RegExp(`\\$\\{${m}\\}`,"g"),y=`(${f[m]})`;N(y)&&(o=o.replace(v,y))}return o}function PRt(o){return o.replace(gRt,_Rt)}function vme(o){return o.replace(vRt,"\\")}function IRt(o){let f=o,m="",v=f.indexOf("${");for(;v>=0;){let y=f.indexOf("'"),x=f.indexOf('"'),C;if(y>=0&&y=0&&x=0?new Eo(Co.VARIABLE_IN_STRING,o.value):new Eo(Co.LITERAL_STRING,vme(o.value))}function DRt(o,f){let m=f.arguments,v=m.length,y,x,C,w;if(f.callee.type==="MemberExpression"){y=f.callee.property.name;let A=f.callee.object;if(y==="test"||y==="exec"){if(!N(A.callee)||A.callee.name!=="regExp")throw new sr(`${y} is not a function.`);return v===0?y==="test"?new Eo(Co.LITERAL_BOOLEAN,!1):new Eo(Co.LITERAL_NULL,null):(C=Yu(o,A),w=Yu(o,m[0]),new Eo(Co.FUNCTION_CALL,y,C,w))}else if(y==="toString")return x=Yu(o,A),new Eo(Co.FUNCTION_CALL,y,x);throw new sr(`Unexpected function call "${y}".`)}if(y=f.callee.name,y==="color"){if(v===0)return new Eo(Co.LITERAL_COLOR,y);if(x=Yu(o,m[0]),N(m[1])){let A=Yu(o,m[1]);return new Eo(Co.LITERAL_COLOR,y,[x,A])}return new Eo(Co.LITERAL_COLOR,y,[x])}else if(y==="rgb"||y==="hsl"){if(v<3)throw new sr(`${y} requires three arguments.`);return x=[Yu(o,m[0]),Yu(o,m[1]),Yu(o,m[2])],new Eo(Co.LITERAL_COLOR,y,x)}else if(y==="rgba"||y==="hsla"){if(v<4)throw new sr(`${y} requires four arguments.`);return x=[Yu(o,m[0]),Yu(o,m[1]),Yu(o,m[2]),Yu(o,m[3])],new Eo(Co.LITERAL_COLOR,y,x)}else if(y==="vec2"||y==="vec3"||y==="vec4"){x=new Array(v);for(let A=0;A1)throw new sr(`${y} requires exactly one argument.`);return x=Yu(o,m[0]),new Eo(Co.UNARY,y,x)}else if(y==="getExactClassName"){if(v>0)throw new sr(`${y} does not take any argument.`);return new Eo(Co.UNARY,y)}else if(N(ere[y])){if(v!==1)throw new sr(`${y} requires exactly one argument.`);return x=Yu(o,m[0]),new Eo(Co.UNARY,y,x)}else if(N(tre[y])){if(v!==2)throw new sr(`${y} requires exactly two arguments.`);return C=Yu(o,m[0]),w=Yu(o,m[1]),new Eo(Co.BINARY,y,C,w)}else if(N(Fxe[y])){if(v!==3)throw new sr(`${y} requires exactly three arguments.`);C=Yu(o,m[0]),w=Yu(o,m[1]);let A=Yu(o,m[2]);return new Eo(Co.TERNARY,y,C,w,A)}else{if(y==="Boolean")return v===0?new Eo(Co.LITERAL_BOOLEAN,!1):(x=Yu(o,m[0]),new Eo(Co.UNARY,y,x));if(y==="Number")return v===0?new Eo(Co.LITERAL_NUMBER,0):(x=Yu(o,m[0]),new Eo(Co.UNARY,y,x));if(y==="String")return v===0?new Eo(Co.LITERAL_STRING,""):(x=Yu(o,m[0]),new Eo(Co.UNARY,y,x));if(y==="regExp")return LRt(o,f)}}throw new sr(`Unexpected function call "${y}".`)}function LRt(o,f){let m=f.arguments;if(m.length===0)return new Eo(Co.LITERAL_REGEX,new RegExp);let v=Yu(o,m[0]),y;if(m.length>1){let x=Yu(o,m[1]);if(vhe(v)&&vhe(x)){try{y=new RegExp(vme(String(v._value)),x._value)}catch(C){throw new sr(C)}return new Eo(Co.LITERAL_REGEX,y)}return new Eo(Co.REGEX,v,x)}if(vhe(v)){try{y=new RegExp(vme(String(v._value)))}catch(x){throw new sr(x)}return new Eo(Co.LITERAL_REGEX,y)}return new Eo(Co.REGEX,v)}function RRt(o){if(BRt(o.name)){let f=kRt(o.name);return f.substr(0,8)==="tiles3d_"?new Eo(Co.BUILTIN_VARIABLE,f):new Eo(Co.VARIABLE,f)}else{if(o.name==="NaN")return new Eo(Co.LITERAL_NUMBER,NaN);if(o.name==="Infinity")return new Eo(Co.LITERAL_NUMBER,1/0);if(o.name==="undefined")return new Eo(Co.LITERAL_UNDEFINED,void 0)}throw new sr(`${o.name} is not defined.`)}function ORt(o){let f=o.property.name;if(f==="PI")return new Eo(Co.LITERAL_NUMBER,Math.PI);if(f==="E")return new Eo(Co.LITERAL_NUMBER,Math.E)}function NRt(o){if(o.property.name==="POSITIVE_INFINITY")return new Eo(Co.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function FRt(o,f){if(f.object.name==="Math")return ORt(f);if(f.object.name==="Number")return NRt(f);let m,v=Yu(o,f.object);return f.computed?(m=Yu(o,f.property),new Eo(Co.MEMBER,"brackets",v,m)):(m=new Eo(Co.LITERAL_STRING,f.property.name),new Eo(Co.MEMBER,"dot",v,m))}function vhe(o){return o._type>=Co.LITERAL_NULL}function BRt(o){return o.substr(0,4)==="czm_"}function kRt(o){return o.substr(4)}function Yu(o,f){let m,v,y,x;if(f.type==="Literal")m=MRt(f);else if(f.type==="CallExpression")m=DRt(o,f);else if(f.type==="Identifier")m=RRt(f);else if(f.type==="UnaryExpression"){v=f.operator;let C=Yu(o,f.argument);if(mRt.indexOf(v)>-1)m=new Eo(Co.UNARY,v,C);else throw new sr(`Unexpected operator "${v}".`)}else if(f.type==="BinaryExpression")if(v=f.operator,y=Yu(o,f.left),x=Yu(o,f.right),bFe.indexOf(v)>-1)m=new Eo(Co.BINARY,v,y,x);else throw new sr(`Unexpected operator "${v}".`);else if(f.type==="LogicalExpression")v=f.operator,y=Yu(o,f.left),x=Yu(o,f.right),bFe.indexOf(v)>-1&&(m=new Eo(Co.BINARY,v,y,x));else if(f.type==="ConditionalExpression"){let C=Yu(o,f.test);y=Yu(o,f.consequent),x=Yu(o,f.alternate),m=new Eo(Co.CONDITIONAL,"?",y,x,C)}else if(f.type==="MemberExpression")m=FRt(o,f);else if(f.type==="ArrayExpression"){let C=[];for(let w=0;w"?o.evaluate=o._evaluateGreaterThan:o._value===">="?o.evaluate=o._evaluateGreaterThanOrEquals:o._value==="&&"?o.evaluate=o._evaluateAnd:o._value==="||"?o.evaluate=o._evaluateOr:o._value==="=~"?o.evaluate=o._evaluateRegExpMatch:o._value==="!~"?o.evaluate=o._evaluateRegExpNotMatch:N(tre[o._value])&&(o.evaluate=URt(o._value)):o._type===Co.TERNARY?o.evaluate=GRt(o._value):o._type===Co.MEMBER?o._value==="brackets"?o.evaluate=o._evaluateMemberBrackets:o.evaluate=o._evaluateMemberDot:o._type===Co.ARRAY?o.evaluate=o._evaluateArray:o._type===Co.VARIABLE?o.evaluate=o._evaluateVariable:o._type===Co.VARIABLE_IN_STRING?o.evaluate=o._evaluateVariableString:o._type===Co.LITERAL_COLOR?o.evaluate=o._evaluateLiteralColor:o._type===Co.LITERAL_VECTOR?o.evaluate=o._evaluateLiteralVector:o._type===Co.LITERAL_STRING?o.evaluate=o._evaluateLiteralString:o._type===Co.REGEX?o.evaluate=o._evaluateRegExp:o._type===Co.BUILTIN_VARIABLE?o._value==="tiles3d_tileset_time"&&(o.evaluate=zRt):o.evaluate=o._evaluateLiteral}function zRt(o){return N(o)?o.content.tileset.timeSinceLoad:0}function HRt(o){let f=ere[o];return function(m){let v=this._left.evaluate(m);return f(o,v)}}function URt(o){let f=tre[o];return function(m){let v=this._left.evaluate(m),y=this._right.evaluate(m);return f(o,v,y)}}function GRt(o){let f=Fxe[o];return function(m){let v=this._left.evaluate(m),y=this._right.evaluate(m),x=this._test.evaluate(m);return f(o,v,y,x)}}function ire(o,f){if(N(o))return o.getPropertyInherited(f)}Eo.prototype._evaluateLiteral=function(){return this._value};Eo.prototype._evaluateLiteralColor=function(o){let f=$ie,m=this._left;if(this._value==="color")N(m)?m.length>1?(Re.fromCssColorString(m[0].evaluate(o),f),f.alpha=m[1].evaluate(o)):Re.fromCssColorString(m[0].evaluate(o),f):Re.fromBytes(255,255,255,255,f);else if(this._value==="rgb")Re.fromBytes(m[0].evaluate(o),m[1].evaluate(o),m[2].evaluate(o),255,f);else if(this._value==="rgba"){let v=m[3].evaluate(o)*255;Re.fromBytes(m[0].evaluate(o),m[1].evaluate(o),m[2].evaluate(o),v,f)}else this._value==="hsl"?Re.fromHsl(m[0].evaluate(o),m[1].evaluate(o),m[2].evaluate(o),1,f):this._value==="hsla"&&Re.fromHsl(m[0].evaluate(o),m[1].evaluate(o),m[2].evaluate(o),m[3].evaluate(o),f);return Wt.fromColor(f,Js.getCartesian4())};Eo.prototype._evaluateLiteralVector=function(o){let f=Js.getArray(),m=this._value,v=this._left,y=v.length;for(let w=0;w1)throw new sr(`Invalid ${m} constructor. Not enough arguments.`);if(x>C&&y>1)throw new sr(`Invalid ${m} constructor. Too many arguments.`);if(x===1){let w=f[0];f.push(w,w,w)}if(m==="vec2")return Ye.fromArray(f,0,Js.getCartesian2());if(m==="vec3")return H.fromArray(f,0,Js.getCartesian3());if(m==="vec4")return Wt.fromArray(f,0,Js.getCartesian4())};Eo.prototype._evaluateLiteralString=function(){return this._value};Eo.prototype._evaluateVariableString=function(o){let f=this._value,m=Mee.exec(f);for(;m!==null;){let v=m[0],y=m[1],x=ire(o,y);N(x)||(x=""),f=f.replace(v,x),m=Mee.exec(f)}return f};Eo.prototype._evaluateVariable=function(o){return ire(o,this._value)};function c5(o){return o._value==="feature"}Eo.prototype._evaluateMemberDot=function(o){if(c5(this._left))return ire(o,this._right.evaluate(o));let f=this._left.evaluate(o);if(!N(f))return;let m=this._right.evaluate(o);if(f instanceof Ye||f instanceof H||f instanceof Wt){if(m==="r")return f.x;if(m==="g")return f.y;if(m==="b")return f.z;if(m==="a")return f.w}return f[m]};Eo.prototype._evaluateMemberBrackets=function(o){if(c5(this._left))return ire(o,this._right.evaluate(o));let f=this._left.evaluate(o);if(!N(f))return;let m=this._right.evaluate(o);if(f instanceof Ye||f instanceof H||f instanceof Wt){if(m===0||m==="r")return f.x;if(m===1||m==="g")return f.y;if(m===2||m==="b")return f.z;if(m===3||m==="a")return f.w}return f[m]};Eo.prototype._evaluateArray=function(o){let f=[];for(let m=0;m" requires number arguments. Arguments are ${f} and ${m}.`);return f>m};Eo.prototype._evaluateGreaterThanOrEquals=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(typeof f!="number"||typeof m!="number")throw new sr(`Operator ">=" requires number arguments. Arguments are ${f} and ${m}.`);return f>=m};Eo.prototype._evaluateOr=function(o){let f=this._left.evaluate(o);if(typeof f!="boolean")throw new sr(`Operator "||" requires boolean arguments. First argument is ${f}.`);if(f)return!0;let m=this._right.evaluate(o);if(typeof m!="boolean")throw new sr(`Operator "||" requires boolean arguments. Second argument is ${m}.`);return f||m};Eo.prototype._evaluateAnd=function(o){let f=this._left.evaluate(o);if(typeof f!="boolean")throw new sr(`Operator "&&" requires boolean arguments. First argument is ${f}.`);if(!f)return!1;let m=this._right.evaluate(o);if(typeof m!="boolean")throw new sr(`Operator "&&" requires boolean arguments. Second argument is ${m}.`);return f&&m};Eo.prototype._evaluatePlus=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(m instanceof Ye&&f instanceof Ye)return Ye.add(f,m,Js.getCartesian2());if(m instanceof H&&f instanceof H)return H.add(f,m,Js.getCartesian3());if(m instanceof Wt&&f instanceof Wt)return Wt.add(f,m,Js.getCartesian4());if(typeof f=="string"||typeof m=="string"||typeof f=="number"&&typeof m=="number")return f+m;throw new sr(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${f} and ${m}.`)};Eo.prototype._evaluateMinus=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(m instanceof Ye&&f instanceof Ye)return Ye.subtract(f,m,Js.getCartesian2());if(m instanceof H&&f instanceof H)return H.subtract(f,m,Js.getCartesian3());if(m instanceof Wt&&f instanceof Wt)return Wt.subtract(f,m,Js.getCartesian4());if(typeof f=="number"&&typeof m=="number")return f-m;throw new sr(`Operator "-" requires vector or number arguments of matching types. Arguments are ${f} and ${m}.`)};Eo.prototype._evaluateTimes=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(m instanceof Ye&&f instanceof Ye)return Ye.multiplyComponents(f,m,Js.getCartesian2());if(m instanceof Ye&&typeof f=="number")return Ye.multiplyByScalar(m,f,Js.getCartesian2());if(f instanceof Ye&&typeof m=="number")return Ye.multiplyByScalar(f,m,Js.getCartesian2());if(m instanceof H&&f instanceof H)return H.multiplyComponents(f,m,Js.getCartesian3());if(m instanceof H&&typeof f=="number")return H.multiplyByScalar(m,f,Js.getCartesian3());if(f instanceof H&&typeof m=="number")return H.multiplyByScalar(f,m,Js.getCartesian3());if(m instanceof Wt&&f instanceof Wt)return Wt.multiplyComponents(f,m,Js.getCartesian4());if(m instanceof Wt&&typeof f=="number")return Wt.multiplyByScalar(m,f,Js.getCartesian4());if(f instanceof Wt&&typeof m=="number")return Wt.multiplyByScalar(f,m,Js.getCartesian4());if(typeof f=="number"&&typeof m=="number")return f*m;throw new sr(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${f} and ${m}.`)};Eo.prototype._evaluateDivide=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(m instanceof Ye&&f instanceof Ye)return Ye.divideComponents(f,m,Js.getCartesian2());if(f instanceof Ye&&typeof m=="number")return Ye.divideByScalar(f,m,Js.getCartesian2());if(m instanceof H&&f instanceof H)return H.divideComponents(f,m,Js.getCartesian3());if(f instanceof H&&typeof m=="number")return H.divideByScalar(f,m,Js.getCartesian3());if(m instanceof Wt&&f instanceof Wt)return Wt.divideComponents(f,m,Js.getCartesian4());if(f instanceof Wt&&typeof m=="number")return Wt.divideByScalar(f,m,Js.getCartesian4());if(typeof f=="number"&&typeof m=="number")return f/m;throw new sr(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${f} and ${m}.`)};Eo.prototype._evaluateMod=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(m instanceof Ye&&f instanceof Ye)return Ye.fromElements(f.x%m.x,f.y%m.y,Js.getCartesian2());if(m instanceof H&&f instanceof H)return H.fromElements(f.x%m.x,f.y%m.y,f.z%m.z,Js.getCartesian3());if(m instanceof Wt&&f instanceof Wt)return Wt.fromElements(f.x%m.x,f.y%m.y,f.z%m.z,f.w%m.w,Js.getCartesian4());if(typeof f=="number"&&typeof m=="number")return f%m;throw new sr(`Operator "%" requires vector or number arguments of matching types. Arguments are ${f} and ${m}.`)};Eo.prototype._evaluateEqualsStrict=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);return m instanceof Ye&&f instanceof Ye||m instanceof H&&f instanceof H||m instanceof Wt&&f instanceof Wt?f.equals(m):f===m};Eo.prototype._evaluateNotEqualsStrict=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);return m instanceof Ye&&f instanceof Ye||m instanceof H&&f instanceof H||m instanceof Wt&&f instanceof Wt?!f.equals(m):f!==m};Eo.prototype._evaluateConditional=function(o){let f=this._test.evaluate(o);if(typeof f!="boolean")throw new sr(`Conditional argument of conditional expression must be a boolean. Argument is ${f}.`);return f?this._left.evaluate(o):this._right.evaluate(o)};Eo.prototype._evaluateNaN=function(o){return isNaN(this._left.evaluate(o))};Eo.prototype._evaluateIsFinite=function(o){return isFinite(this._left.evaluate(o))};Eo.prototype._evaluateIsExactClass=function(o){return N(o)?o.isExactClass(this._left.evaluate(o)):!1};Eo.prototype._evaluateIsClass=function(o){return N(o)?o.isClass(this._left.evaluate(o)):!1};Eo.prototype._evaluateGetExactClassName=function(o){if(N(o))return o.getExactClassName()};Eo.prototype._evaluateBooleanConversion=function(o){return!!this._left.evaluate(o)};Eo.prototype._evaluateNumberConversion=function(o){return Number(this._left.evaluate(o))};Eo.prototype._evaluateStringConversion=function(o){return String(this._left.evaluate(o))};Eo.prototype._evaluateRegExp=function(o){let f=this._value.evaluate(o),m="";N(this._left)&&(m=this._left.evaluate(o));let v;try{v=new RegExp(f,m)}catch(y){throw new sr(y)}return v};Eo.prototype._evaluateRegExpTest=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(!(f instanceof RegExp&&typeof m=="string"))throw new sr(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${f} and ${m}.`);return f.test(m)};Eo.prototype._evaluateRegExpMatch=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(f instanceof RegExp&&typeof m=="string")return f.test(m);if(m instanceof RegExp&&typeof f=="string")return m.test(f);throw new sr(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${f} and ${m}.`)};Eo.prototype._evaluateRegExpNotMatch=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(f instanceof RegExp&&typeof m=="string")return!f.test(m);if(m instanceof RegExp&&typeof f=="string")return!m.test(f);throw new sr(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${f} and ${m}.`)};Eo.prototype._evaluateRegExpExec=function(o){let f=this._left.evaluate(o),m=this._right.evaluate(o);if(!(f instanceof RegExp&&typeof m=="string"))throw new sr(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${f} and ${m}.`);let v=f.exec(m);return N(v)?v[1]:null};Eo.prototype._evaluateToString=function(o){let f=this._left.evaluate(o);if(f instanceof RegExp||f instanceof Ye||f instanceof H||f instanceof Wt)return String(f);throw new sr(`Unexpected function call "${this._value}".`)};function AFe(o){let f=o._left,m=f.length;for(let w=0;w1){let M=E[0],I=E[1];return I!=="1.0"&&(f.translucent=!0),`vec4(${M}, ${I})`}}else return"vec4(1.0)";return`vec4(${E[0]}, 1.0)`}else{if(A==="rgb")return v=EFe(this),N(v)?gQ(v):`vec4(${E[0]} / 255.0, ${E[1]} / 255.0, ${E[2]} / 255.0, 1.0)`;if(A==="rgba")return E[3]!=="1.0"&&(f.translucent=!0),v=EFe(this),N(v)?gQ(v):`vec4(${E[0]} / 255.0, ${E[1]} / 255.0, ${E[2]} / 255.0, ${E[3]})`;if(A==="hsl")return v=AFe(this),N(v)?gQ(v):`vec4(czm_HSLToRGB(vec3(${E[0]}, ${E[1]}, ${E[2]})), 1.0)`;if(A==="hsla")return v=AFe(this),N(v)?(v.alpha!==1&&(f.translucent=!0),gQ(v)):(E[3]!=="1.0"&&(f.translucent=!0),`vec4(czm_HSLToRGB(vec3(${E[0]}, ${E[1]}, ${E[2]})), ${E[3]})`)}break;case Co.LITERAL_VECTOR:T=y.length,S=`${A}(`;for(let M=0;Mm.height>f.height)}function JRt(o){return Array.from(new Set(o))}function KRt(o,f){let m=new Uint8Array(o*f*4);for(let v=0;v{let E=A.url,T=A.data,S=A.width,M=A.height;w.push({url:E,tileData:T,w:S,h:M})}),w.sort(function(A,E){return E.h{let w=new Jr({url:C});x.push(w.fetchImage())}),Promise.all(x).then(function(C){let w=[];C.forEach(M=>{m.width=M.width,m.height=M.height;let I=QRt(M,v);w.push({url:M.src,data:I,width:M.width,height:M.height})}),XRt(w);let A=KRt(f.x,f.y),E=$Rt(w,A,f),T=[],S=E.mapInfos;return o.forEach(function(M){let I=M.lastIndexOf("/"),P=M.substring(I+1);S.forEach(function(D){let L=D.url,R=L.lastIndexOf("/"),O=L.substring(R+1);P===O&&T.push({imageName:O,offsetx:D.offsetx,offsety:D.offsety,width:D.width,height:D.height})})}),{data:E.data,indexInfos:T}}).catch(function(C){console.log(C)})}var t3t=e3t,rre=t3t,rO=0,$S=new Ye(4096,4096);function Tw(o,f,m){return new Ut(Math.cos(m)*o.x,-Math.sin(m)*o.x,f.x,Math.sin(m)*o.y,Math.cos(m)*o.y,f.y,0,0,1)}function pje(o){o=Z(o,{}),this.name="LineMaterialStage",this.filterType=Z(o.filterType,[]),this.bindFilterType=++rO,this.weight=Z(o.weight,1),this.alpha=Z(o.alpha,1),this._speed=Z(o.speed,1),this._width=Z(o.width,2),this._maxHeight=100,this.uniforms={u_height:{type:Ra.FLOAT,value:0},u_lineColor:{type:Ra.VEC3,value:new H(2,2,2)},u_rtcNormalize:{type:Ra.VEC3,value:new H(2,2,2)},u_rtcScale:{type:Ra.VEC3,value:new H},u_lineWidth:{type:Ra.FLOAT,value:this._width}};let f=this,m=this.uniforms.u_height;this.updateCallBack=function(){let y=m.value;y>f._maxHeight?y=0:y+=.4*f._speed,m.value=y},this.varyings={v_nor:Nv.VEC3,v_pos:Nv.VEC3},this.vertexShaderText=` void dealVSLineMaterialStage(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { v_nor = vsInput.attributes.normalMC; v_pos = getPosition(vsInput); } `,this.callVSFunction=`dealVSLineMaterialStage(vsInput, vsOutput); `;let v=1-this.weight;this.fragmentShaderText=` void dealFSLineMaterialStage(FragmentInput fsInput, inout czm_modelMaterial material){ vec3 faceNormalize = v_nor; vec3 upAxis = getAxis(faceNormalize); vec3 normalAxis = faceNormalize; float height = dot(v_pos, upAxis); if(dot(faceNormalize, upAxis) < 0.02) { if((height < u_height) && (u_height < height + u_lineWidth)){ vec3 diffuse = material.diffuse; material.diffuse = diffuse * ${v.toFixed(2)} + u_lineColor * ${this.weight.toFixed(2)}; } } } `,this.callFSFunction=`dealFSLineMaterialStage(fsInput, material); `,this.fsCallback=function(y,x){return""}}Object.defineProperties(pje.prototype,{lineColor:{get:function(){return this.uniforms.u_lineColor.value},set:function(o){this.uniforms.u_lineColor.value=o}},maxHeight:{get:function(){return this._maxHeight},set:function(o){this._maxHeight=o}},width:{get:function(){return this.uniforms.u_lineWidth.value},set:function(o){this.uniforms.u_lineWidth.value=o}},speed:{get:function(){return this._speed},set:function(o){this._speed=o}}});function mje(o){o=Z(o,{}),this.name="GradientMaterialStage",this.filterType=Z(o.filterType,[]),this.bindFilterType=++rO,this.weight=Z(o.weight,1),this.alpha=Z(o.alpha,1),this.uniforms={u_maxHeight:{type:Ra.FLOAT,value:100},u_gradientColor:{type:Ra.VEC3,value:new H(0,0,1)},u_rtcNormalize:{type:Ra.VEC3,value:new H},u_rtcScale:{type:Ra.VEC3,value:new H}},this.updateCallBack=function(){},this.varyings={v_pos:Nv.VEC3},this.vertexShaderText=` void dealVSGradientMaterialStage(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { v_pos = getPosition(vsInput); } `,this.callVSFunction=`dealVSGradientMaterialStage(vsInput, vsOutput); `;let f=1-this.weight;this.fragmentShaderText=` void dealFSGradientMaterialStage(FragmentInput fsInput, inout czm_modelMaterial material){ vec3 nor = vec3(0.0, 0.0, 0.0); vec3 upAxis = getAxis(nor); float height = dot(v_pos, upAxis); float rgb = height/u_maxHeight; material.diffuse = material.diffuse * ${f.toFixed(2)} + u_gradientColor * rgb * ${this.weight.toFixed(2)}; } `,this.callFSFunction=`dealFSGradientMaterialStage(fsInput, material); `,this.fsCallback=function(m,v){return""}}Object.defineProperties(mje.prototype,{gradientColor:{get:function(){return this.uniforms.u_gradientColor.value},set:function(o){this.uniforms.u_gradientColor.value=o}},maxHeight:{get:function(){return this.uniforms.u_maxHeight.value},set:function(o){this.uniforms.u_maxHeight.value=o}}});function gje(o){o=Z(o,{}),this.name="NormalizeMaterialStage",this.filterType=Z(o.filterType,[]),this.bindFilterType=++rO,this.alpha=Z(o.alpha,1),this.weight=Z(o.weight,1),this.uniforms={u_rtcNormalize:{type:Ra.VEC3,value:new H},u_rtcScale:{type:Ra.VEC3,value:new H},u_normalScale:{type:Ra.FLOAT,value:.3},u_lightScale:{type:Ra.FLOAT,value:.7}},this.updateCallBack=function(){},this.varyings={},this.vertexShaderText="",this.callVSFunction="",this.fragmentShaderText=` void dealFSNormalizeMaterialStage(FragmentInput fsInput, inout czm_modelMaterial material) { // \u53CD\u8F6C\u6CD5\u7EBF // vec3 normalScale = material.normalEC; // normalScale = normalize(normalScale); // float scaleFactor = dot(czm_lightDirectionEC, normalScale); // material.normalEC = (scaleFactor > 0.0 ? normalScale : -normalScale); vec3 normal = material.normalEC * u_normalScale + czm_lightDirectionEC * u_lightScale; material.normalEC = normalize(normal); } `,this.callFSFunction=`dealFSNormalizeMaterialStage(fsInput, material); `,this.fsCallback=function(f,m){return""}}Object.defineProperties(gje.prototype,{normalScale:{get:function(){return this.uniforms.u_normalScale.value},set:function(o){this.uniforms.u_normalScale.value=o}},lightScale:{get:function(){return this.uniforms.u_lightScale.value},set:function(o){this.uniforms.u_lightScale.value=o}}});function _je(o){o=Z(o,{}),this.name="DynamicColorMaterialStage",this.filterType=Z(o.filterType,[]),this.bindFilterType=++rO,this.alpha=Z(o.alpha,1),this._speed=Z(o.speed,1),this.weight=Z(o.weight,1),this.uniforms={u_timeIndex:{type:Ra.FLOAT,value:1},u_rtcNormalize:{type:Ra.VEC3,value:new H},u_rtcScale:{type:Ra.VEC3,value:new H}};let f=this,m=this.uniforms.u_timeIndex,v=.002;this.updateCallBack=function(){let x=m.value;(x>1||x<0)&&(v=-v),m.value+=v*f._speed},this.varyings={v_pos:Nv.VEC3,v_nor:Nv.VEC3},this.vertexShaderText=` void dealVSDynamicColorMaterialStage(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { v_pos = getPosition(vsInput); } `,this.callVSFunction=`dealVSDynamicColorMaterialStage(vsInput, vsOutput); `;let y=1-this.weight;this.fragmentShaderText=` void dealFSDynamicColorMaterialStage(FragmentInput fsInput, inout czm_modelMaterial material){ vec3 nor = vec3(0.0, 0.0, 0.0); vec3 upAxis = getAxis(nor); float height = dot(v_pos, upAxis); float step = height * u_timeIndex; vec3 color = vec3(step * 0.008, (100.0 - step) * 0.008, step * 0.008); vec3 diffuse = material.diffuse; material.diffuse = diffuse * ${y.toFixed(2)} + color * ${this.weight.toFixed(2)}; } `,this.callFSFunction=`dealFSDynamicColorMaterialStage(fsInput, material); `,this.fsCallback=function(x,C){return""}}Object.defineProperties(_je.prototype,{speed:{get:function(){return this._speed},set:function(o){this._speed=o}}});function vje(o){o=Z(o,{}),this.name="TextureMaterialStage",this.filterType=Z(o.filterType,[]),this.bindFilterType=++rO,this.alpha=Z(o.alpha,1),this.weight=Z(o.weight,1),this._uvScale=new Ye(1/64,1/64),this._uvTranslate=new Ye(0,0),this._uvRotate=0/180*3.14;let f=Tw(this._uvScale,this._uvTranslate,this._uvRotate);this.uniforms={u_TextureMap:{type:Ra.SAMPLER_2D,value:new Rxe({url:o.url})},u_TextureMapSize:{type:Ra.VEC2,value:new Ye(512,512)},u_changeIndex:{type:Ra.FLOAT,value:0},u_TextureMapMatrix:{type:Ra.MAT3,value:f},u_rtcNormalize:{type:Ra.VEC3,value:new H},u_rtcScale:{type:Ra.VEC3,value:new H}},this.updateCallBack=function(){},this.varyings={v_pos:Nv.VEC3,v_nor:Nv.VEC3},this.vertexShaderText=` void dealVSTextureMaterialStage(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { v_pos = getPosition(vsInput); v_nor = vsInput.attributes.normalMC; } `,this.callVSFunction=`dealVSTextureMaterialStage(vsInput, vsOutput); `;let m=1-this.weight;this.fragmentShaderText=`void dealTextureMaterialStage(FragmentInput fsInput, inout czm_modelMaterial material){ int mapWidth = int(u_TextureMapSize.x); int mapHeight = int(u_TextureMapSize.y); //\u4F7F\u7528\u7684\u662F\u9ED8\u8BA4\u56FE\u7247 if(mapWidth == 1 && mapHeight == 1) return; vec3 faceNormalize = v_nor; vec3 upAxis = getAxis(faceNormalize); vec3 normalAxis = faceNormalize; // \u4E16\u754C\u7A7A\u95F4\u8F6C\u6362\u4E3Auv\u7A7A\u95F4 vec3 uvPos = tranformUv(upAxis, normalAxis, v_pos); // \u9650\u5236\u4F4D\u7F6E if(dot(faceNormalize, upAxis) < 0.2) { //\u5E73\u79FB\u65CB\u8F6C\u548C\u7F29\u653E uvPos = u_TextureMapMatrix * uvPos; // [0~1]\u8F6C\u6362\u5230[0~mapWidth]\u4E4B\u95F4\u7684\u6574\u6570 ivec2 rUv = repeatUV(uvPos, mapWidth, mapHeight); int uvPosX = rUv.x; int uvPosY = rUv.y; vec3 textureColor = texture(u_TextureMap, vec2(float(uvPosX) / float(mapWidth) , float(uvPosY) / float(mapHeight))).rgb; // if(0.0 < u_changeIndex && u_changeIndex < 0.3) { // textureColor = vec3(textureColor.r) * u_changeIndex; // } else if(0.3 < u_changeIndex && u_changeIndex < 0.6) { // textureColor = vec3(textureColor.g) * u_changeIndex; // } else if(0.6 < u_changeIndex && u_changeIndex < 1.0) { // textureColor = vec3(textureColor.b) * u_changeIndex; // } material.diffuse = material.diffuse * ${m.toFixed(2)} + textureColor * ${this.weight.toFixed(2)}; // if(textureColor.r > 0.3) { // discard; // } } } `,this.callFSFunction=`dealTextureMaterialStage(fsInput, material); `,this.fsCallback=function(v,y){return""}}Object.defineProperties(vje.prototype,{uvScale:{get:function(){return this._uvScale},set:function(o){this._uvScale=new Ye(1/o.x,1/o.y),this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}},uvTranslate:{get:function(){return this._uvTranslate},set:function(o){this._uvTranslate=o,this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}},uvAngle:{get:function(){return this._uvRotate},set:function(o){this._uvRotate=o,this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}}});function nre(o){o=Z(o,{}),this.name="TextureMaterialStageEx",this.weight=Z(o.weight,1),this.alpha=Z(o.alpha,1),this.filterType=Z(o.filterType,[]),this.bindFilterType=[];let f=this.filterType.length;for(let C=0;C{m.push(C)}),this.uplaod=!1,this.imageData=null,this.reay=!1;let v=this;rre(m,$S).then(function(C){v.imageData=C,v.textureMap=new _o({context:o.context,source:{width:$S.x,height:$S.y,arrayBufferView:C.data},flipY:!1}),v.reay=!0}).catch(function(C){throw new li("image load fail")}),this._uvScale=new Ye(1/64,1/64),this._uvTranslate=new Ye(0,0),this._uvRotate=0/180*3.14;let y=Tw(this._uvScale,this._uvTranslate,this._uvRotate);this.uniforms={u_TextureMap:{type:Ra.SAMPLER_2D,value:this._defaultTexture},u_TextureMapSize:{type:Ra.INT_VEC2,value:$S},u_TextureMapMatrix:{type:Ra.MAT3,value:y},u_rtcNormalize:{type:Ra.VEC3,value:new H},u_rtcScale:{type:Ra.VEC3,value:new H}},this.updateCallBack=function(){!v.uplaod&&v.textureMap&&(v.uniforms.u_TextureMap.value=v.textureMap,v.uniforms.u_TextureMapSize.value=$S,v.uplaod=!0)},this.varyings={v_pos:Nv.VEC3,v_nor:Nv.VEC3},this.vertexShaderText=` void dealVSTextureMaterialStageEx(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { v_pos = getPosition(vsInput); v_nor = vsInput.attributes.normalMC; } `,this.callVSFunction=`dealVSTextureMaterialStageEx(vsInput, vsOutput); `;let x=1-this.weight;this.fragmentShaderText=` void dealTextureMaterialStageEx(FragmentInput fsInput, inout czm_modelMaterial material, ivec2 offset, ivec2 dimension){ int mapWidth = u_TextureMapSize.x; int mapHeight = u_TextureMapSize.y; //\u4F7F\u7528\u7684\u662F\u9ED8\u8BA4\u56FE\u7247 if(mapWidth == 1 && mapHeight == 1) return; vec3 faceNormalize = v_nor; vec3 upAxis = getAxis(faceNormalize); vec3 normalAxis = faceNormalize; // \u4E16\u754C\u7A7A\u95F4\u8F6C\u6362\u4E3Auv\u7A7A\u95F4 vec3 uvPos = tranformUv(upAxis, normalAxis, v_pos); // \u9650\u5236\u4F4D\u7F6E if(dot(faceNormalize, upAxis) < 0.2) { int offsetY = offset.y; int offsetX = offset.x; int tileWidth = dimension.x; int tileHeight = dimension.y; //\u5E73\u79FB\u65CB\u8F6C\u548C\u7F29\u653E uvPos = u_TextureMapMatrix * uvPos; // [0~1]\u8F6C\u6362\u5230[0~tileWidth]\u4E4B\u95F4\u7684\u6574\u6570 ivec2 rUv = repeatUV(uvPos, tileWidth, tileHeight); int uvPosX = rUv.x; int uvPosY = rUv.y; uvPosX += offsetX; uvPosY += offsetY; vec3 textureColor = texture(u_TextureMap, vec2(float(uvPosX) / float(mapWidth) , float(uvPosY) / float(mapHeight))).rgb; material.diffuse = material.diffuse * ${x.toFixed(2)} + textureColor * ${this.weight.toFixed(2)}; } } `,this.callFSFunction=`dealTextureMaterialStageEx(fsInput, material, offset, dimension); `,this.fsCallback=function(C,w){if(!v.uplaod)return"";let A=v.filterType.indexOf(C),E=v.imageData.indexInfos[A];return` offset = ivec2(${parseInt(E.offsetx)}, ${parseInt(E.offsety)}); dimension = ivec2(${parseInt(E.width)}, ${parseInt(E.height)}); `}}Object.defineProperties(nre.prototype,{uvScale:{get:function(){return this._uvScale},set:function(o){this._uvScale=new Ye(1/o.x,1/o.y),this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}},uvTranslate:{get:function(){return this._uvTranslate},set:function(o){this._uvTranslate=o,this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}},uvAngle:{get:function(){return this._uvRotate},set:function(o){this._uvRotate=o,this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}}});function yje(o){o=Z(o,{}),this.name="ReflectMaterialStage",this.filterType=Z(o.filterType,[]),this.bindFilterType=++rO,this.weight=Z(o.weight,1),this.uniforms={u_specular:{type:Ra.VEC3,value:new H(.2,.2,.2)},u_roughness:{type:Ra.FLOAT,value:.8},u_rtcNormalize:{type:Ra.VEC3,value:new H},u_rtcScale:{type:Ra.VEC3,value:new H}},this.updateCallBack=function(){},this.vertexShaderText="",this.callVSFunction="",this.fragmentShaderText=` void dealReflectMaterialStage(FragmentInput fsInput, inout czm_modelMaterial material){ material.roughness = u_roughness; material.specular = u_specular; } `,this.callFSFunction=`dealReflectMaterialStage(fsInput, material); `,this.fsCallback=function(f,m){return""}}Object.defineProperties(yje.prototype,{specular:{get:function(){return this.uniforms.u_specular.value},set:function(o){this.uniforms.u_specular.value=o}},roughness:{get:function(){return this.uniforms.u_roughness.value},set:function(o){this.uniforms.u_roughness.value=o}}});function ore(o){o=Z(o,{}),this.name="ReflectTextureMaterialStage",this.filterType=Z(o.filterType,[]),this.alpha=Z(o.alpha,1),this.weight=Z(o.weight,1),this.bindFilterType=[];let f=this.filterType.length;for(let x=0;x{m.push(x)}),this.uplaod=!1,this.imageData=null,this.reay=!1;let v=this;rre(m,$S).then(function(x){v.imageData=x,v.textureMap=new _o({context:o.context,source:{width:$S.x,height:$S.y,arrayBufferView:x.data},flipY:!1}),v.reay=!0}).catch(function(x){throw new li("image load fail")}),this._uvScale=new Ye(1/64,1/16),this._uvTranslate=new Ye(0,0),this._uvRotate=0/180*3.14;let y=Tw(this._uvScale,this._uvTranslate,this._uvRotate);this.uniforms={u_TextureMap:{type:Ra.SAMPLER_2D,value:this._defaultTexture},u_TextureMapSize:{type:Ra.INT_VEC2,value:$S},u_TextureMapMatrix:{type:Ra.MAT3,value:y},u_rtcNormalize:{type:Ra.VEC3,value:new H},u_rtcScale:{type:Ra.VEC3,value:new H},u_colorScale:{type:Ra.VEC3,value:new H(.5,.5,.5)},u_topColor:{type:Ra.VEC3,value:new H(.5,.5,.5)}},this.updateCallBack=function(){!v.uplaod&&v.textureMap&&(v.uniforms.u_TextureMap.value=v.textureMap,v.uniforms.u_TextureMapSize.value=$S,v.uplaod=!0)},this.varyings={v_pos:Nv.VEC3,v_nor:Nv.VEC3},this.vertexShaderText=` void dealVSReflectTextureMaterialStage(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { v_pos = getPosition(vsInput); v_nor = vsInput.attributes.normalMC; } `,this.callVSFunction=`dealVSReflectTextureMaterialStage(vsInput, vsOutput); `,this.fragmentShaderText=` void dealFsReflectTextureMaterialStage(FragmentInput fsInput, inout czm_modelMaterial material, ivec2 offset, ivec2 dimension){ int mapWidth = u_TextureMapSize.x; int mapHeight = u_TextureMapSize.y; //\u4F7F\u7528\u7684\u662F\u9ED8\u8BA4\u56FE\u7247 if(mapWidth == 1 && mapHeight == 1) return; vec3 faceNormalize = v_nor; vec3 upAxis = getAxis(faceNormalize); vec3 normalAxis = faceNormalize; // \u4E16\u754C\u7A7A\u95F4\u8F6C\u6362\u4E3Auv\u7A7A\u95F4 vec3 uvPos = tranformUv(upAxis, normalAxis, v_pos); // \u9650\u5236\u4F4D\u7F6E if(dot(faceNormalize, upAxis) < 0.2) { int offsetY = offset.y; int offsetX = offset.x; int tileWidth = dimension.x; int tileHeight = dimension.y; //\u5E73\u79FB\u65CB\u8F6C\u548C\u7F29\u653E uvPos = u_TextureMapMatrix * uvPos; // [0~1]\u8F6C\u6362\u5230[0~tileWidth]\u4E4B\u95F4\u7684\u6574\u6570 ivec2 rUv = repeatUV(uvPos, tileWidth, tileHeight); int uvPosX = rUv.x; int uvPosY = rUv.y; uvPosX += offsetX; uvPosY += offsetY; vec3 textureColor = texture(u_TextureMap, vec2(float(uvPosX) / float(mapWidth) , float(uvPosY) / float(mapHeight))).rgb; float height = dot(uvPos, upAxis); //if(height > 0.4) { if(textureColor.r > 0.99 && textureColor.g > 0.99) { material.roughness = 0.0; material.specular = vec3(1.0, 1.0, 1.0); material.diffuse = vec3(1.0, 1.0, 1.0); material.normalEC = normalize(czm_lightDirectionEC); } else { material.roughness = 1.0; material.specular = vec3(0.0, 0.0, 0.0); material.diffuse = textureColor * u_colorScale; } // } else { // material.roughness = 1.0; // material.specular = vec3(0.0, 0.0, 0.0); // material.diffuse = vec3(0.2,0.2,0.2); // } } else { material.diffuse = u_topColor; } } `,this.callFSFunction=`dealFsReflectTextureMaterialStage(fsInput, material, offset, dimension); `,this.fsCallback=function(x,C){if(!v.uplaod)return"";let w=v.filterType.indexOf(x),A=v.imageData.indexInfos[w];return` offset = ivec2(${parseInt(A.offsetx)}, ${parseInt(A.offsety)}); dimension = ivec2(${parseInt(A.width)}, ${parseInt(A.height)}); `}}Object.defineProperties(ore.prototype,{colorScale:{get:function(){return this.uniforms.u_colorScale.value},set:function(o){this.uniforms.u_colorScale.value=o}},topColor:{get:function(){return this.uniforms.u_topColor.value},set:function(o){this.uniforms.u_topColor.value=o}},uvScale:{get:function(){return this._uvScale},set:function(o){this._uvScale=new Ye(1/o.x,1/o.y),this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}},uvTranslate:{get:function(){return this._uvTranslate},set:function(o){this._uvTranslate=o,this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}},uvAngle:{get:function(){return this._uvRotate},set:function(o){this._uvRotate=o,this.uniforms.u_TextureMapMatrix.value=Tw(this._uvScale,this._uvTranslate,this._uvRotate)}}});function CU(o,f){f=Z(f,{}),this._names={},this._filterTypes={},this._bindFilterTypes={},this._alphas={},this._uniforms={},this._varyings={},this._vertexShaderTexts={},this._callVSFunctions={},this._fragmentShaderTexts={},this._callFSFunctions={},this._updateCallbacks={},this._fsCallbacks={},this._order=[],this._tileset=o,this._dirty=!1,this._lightingModel=Z(f.lightingModel,pC.PBR),this._GisServerModel=Z(f.GisServerModel,!1),this._upAxis=Z(f.upAxis,new H(0,0,1)),this._textureMaterialStageEx=null,this._reflectTextureMaterialStage=null}CU.prototype.addStage=function(o){if(!N(o))throw new li("materialStage is undefined");o instanceof nre&&(this._textureMaterialStageEx=o),o instanceof ore&&(this._reflectTextureMaterialStage=o);let f=o.name;if(this._names[f])throw new li("this materialStage is exist");let m=o.filterType,v=this._filterTypes;v[f]=m;let y=o.bindFilterType,x=this._bindFilterTypes;x[f]=y;let C=o.alpha,w=this._alphas;w[f]=C;let A=o.uniforms,E=this._uniforms;E[f]=A;let T=o.varyings,S=this._varyings;S[f]=T,this._vertexShaderTexts[f]=o.vertexShaderText,this._callVSFunctions[f]=o.callVSFunction,this._fragmentShaderTexts[f]=o.fragmentShaderText,this._callFSFunctions[f]=o.callFSFunction,this._updateCallbacks[f]=o.updateCallBack,this._fsCallbacks[f]=o.fsCallback,this._order.push(f),this._dirty=!0};CU.prototype.updateStage=function(o){if(!N(o))throw new li("materialStage is undefined");let f=o.name;this._names[f]&&this.removeStage(f),this.addStage(o),o instanceof nre&&(this._dirty=!1),o instanceof ore&&(this._dirty=!1)};function i3t(o,f){for(let m=0;m0){x=!0;break}let w=this._bindFilterTypes;for(let O in w)w.hasOwnProperty(O)&&(o[O]=w[O]);let A="",E=this._vertexShaderTexts;for(let O in E)if(E.hasOwnProperty(O)){let F=E[O];A+=F}A+="void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {";let T=this._callVSFunctions;for(let O in T)if(T.hasOwnProperty(O)){let F=T[O];A+=F}A+="}";let S="",M=this._fragmentShaderTexts;for(let O in M)if(M.hasOwnProperty(O)){let F=M[O];S+=F}x?S+=`void fragmentMainAndStyle(FragmentInput fsInput, inout czm_modelMaterial material, SelectedFeature selectedFeature) { ivec2 offset = ivec2(0, 0); ivec2 dimension = ivec2(0, 0); float type = selectedFeature.color.r * 255.0; `:S+=`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { ivec2 offset = ivec2(0, 0); ivec2 dimension = ivec2(0, 0); `;let I=this._fsCallbacks,P=this._callFSFunctions;for(let O in P)if(P.hasOwnProperty(O)){let F=P[O],k=I[O],U=C[O];if(U.length>0){let G=o[O];if(G instanceof Array)for(let j=0;j 0.99){ faceNormalize = ${L}; } upAxis = normalize(u_rtcNormalize); #endif return upAxis; } vec3 tranformUv(in vec3 upAxis, in vec3 normalAxis, in vec3 pos){ vec3 rightAxis = cross(upAxis, normalAxis); rightAxis = normalize(rightAxis); mat3 transformUv = mat3( rightAxis.x,rightAxis.y,rightAxis.z, upAxis.x,upAxis.y,upAxis.z, normalAxis.x,normalAxis.y,normalAxis.z ); mat3 inverseUv = inverse_mat3(transformUv); return inverseUv * pos; } ivec2 repeatUV(in vec3 uvPos, int tileWidth, int tileHeight){ // [0~1]\u8F6C\u6362\u5230[0~tileWidth]\u4E4B\u95F4\u7684\u6574\u6570 int uvPosX = int(uvPos.x * float(tileWidth)); int uvPosY = int(uvPos.y * float(tileHeight)); // \u7EB9\u7406\u91CD\u590D if(uvPosX < 0) { // \u8D1F\u6570\u8F6C\u6B63 uvPosX = uvPosX - (uvPosX / tileWidth) * tileWidth + tileWidth; } else { uvPosX = uvPosX - (uvPosX / tileWidth) * tileWidth; } if(uvPosY < 0) { // \u8D1F\u6570\u8F6C\u6B63 uvPosY = uvPosY - (uvPosY / tileHeight) * tileHeight + tileHeight; } else { uvPosY = uvPosY - (uvPosY / tileHeight) * tileHeight; } return ivec2(uvPosX, uvPosY); } `+S,this._GisServerModel||(S=` #define NO_GISSERVER ${S}`);let R=new Kw({lightingModel:this._lightingModel,uniforms:f,varyings:m,vertexShaderText:A,fragmentShaderText:S});return x&&(R.andStyle=!0),R};CU.prototype.update=function(){let o=this._tileset,f=this._updateCallbacks;for(let w in f)f.hasOwnProperty(w)&&f[w]();if(this._textureMaterialStageEx&&this._textureMaterialStageEx.reay&&(this._textureMaterialStageEx.reay=!1,this._dirty=!0),this._reflectTextureMaterialStage&&this._reflectTextureMaterialStage.reay&&(this._reflectTextureMaterialStage.reay=!1,this._dirty=!0),!this._dirty)return;this._dirty=!1;let m=this.combineStage();o.customShader=m;let v=[],y=this._filterTypes,x=this._bindFilterTypes,C=this._alphas;for(let w in x)if(x.hasOwnProperty(w)){let A=y[w],E=x[w],T=C[w];if(A.length>0)if(E instanceof Array)for(let S=0;S0&&(o.style=new G2({defines:{},color:{conditions:v}}))};var are={LineMaterialStage:pje,CustomShaderStage:CU,GradientMaterialStage:mje,NormalizeMaterialStage:gje,DynamicColorMaterialStage:_je,TextureMaterialStage:vje,TextureMaterialStageEx:nre,ReflectMaterialStage:yje,ReflectTextureMaterialStage:ore};function nO(o){if(o=Z(o,Z.EMPTY_OBJECT),this._ellipsoid=Z(o.ellipsoid,ki.WGS84),this._numberOfLevelZeroTilesX=Z(o.numberOfLevelZeroTilesX,1),this._numberOfLevelZeroTilesY=Z(o.numberOfLevelZeroTilesY,1),this._projection=new vU(o.customEPSG,this._ellipsoid),N(o.rectangleSouthwestInMeters)&&N(o.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=o.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=o.rectangleNortheastInMeters;else{let v=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new Ye(-v,-v),this._rectangleNortheastInMeters=new Ye(v,v)}let f=this._projection.unproject(this._rectangleSouthwestInMeters),m=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new Di(f.longitude,f.latitude,m.longitude,m.latitude)}Object.defineProperties(nO.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});nO.prototype.getNumberOfXTilesAtLevel=function(o){return this._numberOfLevelZeroTilesX<=y&&(S=y-1);let M=T/w|0;return M>=x&&(M=x-1),N(m)?(m.x=S,m.y=M,m):new Ye(S,M)};var xje=nO,r3t=dd($Ge(),1),fY=r3t;function n3t(o,f){return new _o({context:f.context,pixelFormat:Rn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,source:{width:1,height:1024,arrayBufferView:o},sampler:new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR})})}var o3t={trustGenerator:["fanfan"],_defaultFloodAnalysis:{floodVar:[0,0,0,500],ym_pos_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ym_pos_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ym_pos_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],rect_flood:[0,0,0,0,0,0,0,0,0],floodSpeed:1,ym_max_index:0,globe:!0,showElseArea:!0},floodAnalysis:{floodVar:[0,0,0,500],ym_pos_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ym_pos_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],ym_pos_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],rect_flood:[0,0,0,0,0,0,0,0,0],floodSpeed:1,ym_max_index:0,globe:!0,showElseArea:!0},resetFloodAnalysis:function(){this.floodAnalysis=uo(this._defaultFloodAnalysis)},_defaultExcavateAnalysis:{splitNum:30,showSelfOnly:!1,dig_pos_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dig_pos_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dig_pos_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],rect_dig:[0,0,0,0,0,0,0,0,0],dig_max_index:0,excavateHeight:0,excavateMinHeight:9999,excavatePerPoint:!1},excavateAnalysis:{splitNum:30,showSelfOnly:!1,dig_pos_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dig_pos_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],dig_pos_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],rect_dig:[0,0,0,0,0,0,0,0,0],dig_max_index:0,excavateHeight:0,excavateMinHeight:9999,excavatePerPoint:!1},resetExcavateAnalysis:function(){this.excavateAnalysis=uo(this._defaultExcavateAnalysis)},_defaultTilesEditor:{floodVar:[0,0,0,0],flatRect:[0,0,0,0,0,0,0,0,0],yp_mat_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_mat_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_mat_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_max_index:0,model_min_height:50,IsYaPing:[!1,!1,!1,!1],yp_show_InOrOut:[!1,!0,!0,!1],yp_black_texture:null,hm_dh_attr:[50,1,100],modelLight:2.2,times:new Date().getTime(),floodColor:[0,0,0,.5]},tilesEditor:{floodVar:[0,0,0,0],flatRect:[0,0,0,0,0,0,0,0,0],yp_mat_x:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_mat_y:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_mat_z:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],yp_max_index:0,model_min_height:50,IsYaPing:[!1,!1,!1,!1],yp_show_InOrOut:[!1,!0,!0,!1],yp_black_texture:null,hm_dh_attr:[50,1,100],modelLight:2.2,times:new Date().getTime(),floodColor:[0,0,0,.5]},resetTilesEditor:function(){this.tilesEditor=uo(this._defaultTilesEditor)},underEarth:{cullFace:void 0,enable:void 0,enableDepth:100,enableSkirt:!1},occlusionOpen:!0,Ellipsoid:{x:6378137,y:6378137,z:6356752314140356e-9},displaySlopeMap:!1,_smoothSlopeAtHigherAlt:!1,get smoothSlopeAtHigherAlt(){return this._smoothSlopeAtHigherAlt},set smoothSlopeAtHigherAlt(o){this._smoothSlopeAtHigherAlt=o},isSlopeDirty:!0,_sTex:[],get SlopeMapPallete(){return this._sTex.length<=0&&(this._sTex.push({val:100*Math.cos(xe.toRadians(90)),color:"#FF0000"}),this._sTex.push({val:100*Math.cos(xe.toRadians(70)),color:"#FF0000"}),this._sTex.push({val:100*Math.cos(xe.toRadians(45)),color:"#FF8000"}),this._sTex.push({val:100*Math.cos(xe.toRadians(31)),color:"#FFF000"}),this._sTex.push({val:100*Math.cos(xe.toRadians(17)),color:"#00FF00"}),this._sTex.push({val:100*Math.cos(xe.toRadians(6)),color:"#0000FF"}),this._sTex.push({val:100*Math.cos(xe.toRadians(0)),color:"#00FFFF"})),this._sTex},set SlopeMapPallete(o){this._sTex=o},createElevationTextureFromPallete:function(o,f){let m=new Uint8Array(4096),v=o[0].val,y=o[o.length-1].val,x=v-y,C=y,w=1024/x,A=0;A=o.length;for(let T=A-1;T>0;T--){let S=o[T].color.replace("#",""),M=o[T-1].color.replace("#",""),I=parseInt(S,16),P=parseInt(M,16),D=o[T].val,L=o[T-1].val,R=Math.floor((D-C)*w+.5),O=Math.floor((L-C)*w+.5),F=O-R;if(F===0)continue;let k=(I&16711680)>>16<<16,U=(I&65280)>>8<<16,G=(I&255)<<16,j=(P&16711680)>>16<<16,q=(P&65280)>>8<<16,J=(P&255)<<16,X=Math.floor((j-k)/F),Y=Math.floor((q-U)/F),Q=Math.floor((J-G)/F);for(let ee=R;ee>16,m[ee*4+1]=U>>16,m[ee*4+2]=G>>16,m[ee*4+3]=255}let E=n3t(m,f);return this._slopeTex=E,this.slopeMapTexture=this._slopeTex,E},setSlopeMapPallete:function(o){let f=[];if(o=Object.entries(o),o.length>0&&o.forEach(function(m){m.length===2&&m[0]>=0&&m[0]<=90&&f.push({val:100*Math.cos(xe.toRadians(m[0])),color:m[1]})}),f.length===0){console.log("Error setting new pallete for slope map");return}f.sort(function(m,v){return m.val=y&&(E=y-1);let T=(v.north-o.latitude)/w|0;return T>=x&&(T=x-1),N(m)?(m.x=E,m.y=T,m):new Ye(E,T)};var Bd=oO,PFe=new H,IFe=new H,MFe=new Mt,yhe=new H,s3t=new H,DFe=new Pi,l3t=new Bd,v9=[new Mt,new Mt,new Mt,new Mt],y9=new Ye,em={};em.initialize=function(){let o=em._initPromise;return N(o)||(o=Jr.fetchJson(Ms("Assets/approximateTerrainHeights.json")).then(function(f){if(Hy.changeApproximateTerrainHeights===!0)for(let m in f)f.hasOwnProperty(m)&&(f[m][0]=Hy.minTerrainHeight,f[m][1]=Hy.maxTerrainHeight);em._terrainHeights=f}),em._initPromise=o),o};em.getMinimumMaximumHeights=function(o,f){f=Z(f,ki.WGS84);let m=bje(o),v=em._defaultMinTerrainHeight,y=em._defaultMaxTerrainHeight;if(N(m)){let x=`${m.level}-${m.x}-${m.y}`,C=em._terrainHeights[x];N(C)&&(v=C[0],y=C[1]),f.cartographicToCartesian(Di.northeast(o,MFe),PFe),f.cartographicToCartesian(Di.southwest(o,MFe),IFe),H.midpoint(IFe,PFe,yhe);let w=f.scaleToGeodeticSurface(yhe,s3t);if(N(w)){let A=H.distance(yhe,w);v=Math.min(v,-A)}else v=em._defaultMinTerrainHeight}return v=Math.max(em._defaultMinTerrainHeight,v),{minimumTerrainHeight:v,maximumTerrainHeight:y}};em.getBoundingSphere=function(o,f){f=Z(f,ki.WGS84);let m=bje(o),v=em._defaultMaxTerrainHeight;if(N(m)){let x=`${m.level}-${m.x}-${m.y}`,C=em._terrainHeights[x];N(C)&&(v=C[1])}let y=Pi.fromRectangle3D(o,f,0);return Pi.fromRectangle3D(o,f,v,DFe),Pi.union(y,DFe,y)};function bje(o){Mt.fromRadians(o.east,o.north,0,v9[0]),Mt.fromRadians(o.west,o.north,0,v9[1]),Mt.fromRadians(o.east,o.south,0,v9[2]),Mt.fromRadians(o.west,o.south,0,v9[3]);let f=0,m=0,v=0,y=0,x=em._terrainHeightsMaxLevel,C;for(C=0;C<=x;++C){let w=!1;for(let A=0;A<4;++A){let E=v9[A];if(l3t.positionToTileXY(E,C,y9),A===0)v=y9.x,y=y9.y;else if(v!==y9.x||y!==y9.y){w=!0;break}}if(w)break;f=v,m=y}if(C!==0)return{x:f,y:m,level:C>x?x:C-1}}em._terrainHeightsMaxLevel=6;em._defaultMaxTerrainHeight=9e3;em._defaultMinTerrainHeight=-1e5;em._terrainHeights=void 0;em._initPromise=void 0;Object.defineProperties(em,{initialized:{get:function(){return N(em._terrainHeights)}}});var zh=em,LFe={};function pY(o,f){N(LFe[o])||(LFe[o]=!0,console.warn(Z(f,o)))}pY.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";pY.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";pY.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";pY.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var Ba=pY;function u3t(o,f){Ba(o,f)}var mi=u3t;function c3t(o){o=Z(o,Z.EMPTY_OBJECT),this.geometry=o.geometry,this.modelMatrix=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),this.id=o.id,this.pickPrimitive=o.pickPrimitive,this.attributes=Z(o.attributes,{}),this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var co=c3t;function h3t(o){o=Z(o,Z.EMPTY_OBJECT),this.componentDatatype=o.componentDatatype,this.componentsPerAttribute=o.componentsPerAttribute,this.normalize=Z(o.normalize,!1),this.value=o.value}var L1=h3t,d3t={NONE:0,GEODESIC:1,RHUMB:2},fs=Object.freeze(d3t),RFe=xe.EPSILON10;function f3t(o,f,m,v){if(!N(o))return;m=Z(m,!1);let y=N(v),x=o.length;if(x<2)return o;let C,w=o[0],A,E,T=0,S=-1;for(C=1;Cxe.EPSILON12);let Q=X*(f*f-m*m)/(m*m),ee=1+Q*(4096+Q*(Q*(320-175*Q)-768))/16384,z=Q*(256+Q*(Q*(74-47*Q)-128))/1024,ie=Y*Y,re=z*J*(Y+z*(q*(2*ie-1)-z*Y*(4*J*J-3)*(4*ie-3)/6)/4),ne=m*ee*(j-re),oe=Math.atan2(I*G,L-O*U),se=Math.atan2(S*G,L*U-O);o._distance=ne,o._startHeading=oe,o._endHeading=se,o._uSquared=Q}var _3t=new H,xhe=new H;function Aje(o,f,m,v){let y=H.normalize(v.cartographicToCartesian(f,xhe),_3t),x=H.normalize(v.cartographicToCartesian(m,xhe),xhe);g3t(o,v.maximumRadius,v.minimumRadius,f.longitude,f.latitude,m.longitude,m.latitude),o._start=Mt.clone(f,o._start),o._end=Mt.clone(m,o._end),o._start.height=0,o._end.height=0,p3t(o)}function mY(o,f,m){let v=Z(m,ki.WGS84);this._ellipsoid=v,this._start=new Mt,this._end=new Mt,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,N(o)&&N(f)&&Aje(this,o,f,v)}Object.defineProperties(mY.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});mY.prototype.setEndPoints=function(o,f){Aje(this,o,f,this._ellipsoid)};mY.prototype.interpolateUsingFraction=function(o,f){return this.interpolateUsingSurfaceDistance(this._distance*o,f)};mY.prototype.interpolateUsingSurfaceDistance=function(o,f){let m=this._constants,v=m.distanceRatio+o/m.b,y=Math.cos(2*v),x=Math.cos(4*v),C=Math.cos(6*v),w=Math.sin(2*v),A=Math.sin(4*v),E=Math.sin(6*v),T=Math.sin(8*v),S=v*v,M=v*S,I=m.u8Over256,P=m.u2Over4,D=m.u6Over64,L=m.u4Over16,R=2*M*I*y/3+v*(1-P+7*L/4-15*D/4+579*I/64-(L-15*D/4+187*I/16)*y-(5*D/4-115*I/16)*x-29*I*C/16)+(P/2-L+71*D/32-85*I/16)*w+(5*L/16-5*D/4+383*I/96)*A-S*((D-11*I/2)*w+5*I*A/2)+(29*D/96-29*I/16)*E+539*I*T/1536,O=Math.asin(Math.sin(R)*m.cosineAlpha),F=Math.atan(m.a/m.b*Math.tan(O));R=R-m.sigma;let k=Math.cos(2*m.sigma+R),U=Math.sin(R),G=Math.cos(R),j=m.cosineU*G,q=m.sineU*U,J=Math.atan2(U*m.sineHeading,j-q*m.cosineHeading)-wje(m.f,m.sineAlpha,m.cosineSquaredAlpha,R,U,G,k);return N(f)?(f.longitude=this._start.longitude+J,f.latitude=F,f.height=0,f):new Mt(this._start.longitude+J,F,0)};var Im=mY;function yme(o,f,m){if(o===0)return f*m;let v=o*o,y=v*v,x=y*v,C=x*v,w=C*v,A=w*v,E=m,T=Math.sin(2*E),S=Math.sin(4*E),M=Math.sin(6*E),I=Math.sin(8*E),P=Math.sin(10*E),D=Math.sin(12*E);return f*((1-v/4-3*y/64-5*x/256-175*C/16384-441*w/65536-4851*A/1048576)*E-(3*v/8+3*y/32+45*x/1024+105*C/4096+2205*w/131072+6237*A/524288)*T+(15*y/256+45*x/1024+525*C/16384+1575*w/65536+155925*A/8388608)*S-(35*x/3072+175*C/12288+3675*w/262144+13475*A/1048576)*M+(315*C/131072+2205*w/524288+43659*A/8388608)*I-(693*w/1310720+6237*A/5242880)*P+1001*A/8388608*D)}function v3t(o,f,m){let v=o/m;if(f===0)return v;let y=v*v,x=y*v,C=x*v,w=f,A=w*w,E=A*A,T=E*A,S=T*A,M=S*A,I=M*A,P=Math.sin(2*v),D=Math.cos(2*v),L=Math.sin(4*v),R=Math.cos(4*v),O=Math.sin(6*v),F=Math.cos(6*v),k=Math.sin(8*v),U=Math.cos(8*v),G=Math.sin(10*v),j=Math.cos(10*v),q=Math.sin(12*v);return v+v*A/4+7*v*E/64+15*v*T/256+579*v*S/16384+1515*v*M/65536+16837*v*I/1048576+(3*v*E/16+45*v*T/256-v*(32*y-561)*S/4096-v*(232*y-1677)*M/16384+v*(399985-90560*y+512*C)*I/5242880)*D+(21*v*T/256+483*v*S/4096-v*(224*y-1969)*M/16384-v*(33152*y-112599)*I/1048576)*R+(151*v*S/4096+4681*v*M/65536+1479*v*I/16384-453*x*I/32768)*F+(1097*v*M/65536+42783*v*I/1048576)*U+8011*v*I/1048576*j+(3*A/8+3*E/16+213*T/2048-3*y*T/64+255*S/4096-33*y*S/512+20861*M/524288-33*y*M/512+C*M/1024+28273*I/1048576-471*y*I/8192+9*C*I/4096)*P+(21*E/256+21*T/256+533*S/8192-21*y*S/512+197*M/4096-315*y*M/4096+584039*I/16777216-12517*y*I/131072+7*C*I/2048)*L+(151*T/6144+151*S/4096+5019*M/131072-453*y*M/16384+26965*I/786432-8607*y*I/131072)*O+(1097*S/131072+1097*M/65536+225797*I/10485760-1097*y*I/65536)*k+(8011*M/2621440+8011*I/1048576)*G+293393*I/251658240*q}function pH(o,f){if(o===0)return Math.log(Math.tan(.5*(xe.PI_OVER_TWO+f)));let m=o*Math.sin(f);return Math.log(Math.tan(.5*(xe.PI_OVER_TWO+f)))-o/2*Math.log((1+m)/(1-m))}function y3t(o,f,m,v,y){let x=pH(o._ellipticity,m),C=pH(o._ellipticity,y);return Math.atan2(xe.negativePiToPi(v-f),C-x)}function x3t(o,f,m,v,y,x,C){let w=o._heading,A=x-v,E=0;if(xe.equalsEpsilon(Math.abs(w),xe.PI_OVER_TWO,xe.EPSILON8))if(f===m)E=f*Math.cos(y)*xe.negativePiToPi(A);else{let T=Math.sin(y);E=f*Math.cos(y)*xe.negativePiToPi(A)/Math.sqrt(1-o._ellipticitySquared*T*T)}else{let T=yme(o._ellipticity,f,y);E=(yme(o._ellipticity,f,C)-T)/Math.cos(w)}return Math.abs(E)}var C3t=new H,Che=new H;function Eje(o,f,m,v){let y=H.normalize(v.cartographicToCartesian(f,Che),C3t),x=H.normalize(v.cartographicToCartesian(m,Che),Che),C=v.maximumRadius,w=v.minimumRadius,A=C*C,E=w*w;o._ellipticitySquared=(A-E)/A,o._ellipticity=Math.sqrt(o._ellipticitySquared),o._start=Mt.clone(f,o._start),o._start.height=0,o._end=Mt.clone(m,o._end),o._end.height=0,o._heading=y3t(o,f.longitude,f.latitude,m.longitude,m.latitude),o._distance=x3t(o,v.maximumRadius,v.minimumRadius,f.longitude,f.latitude,m.longitude,m.latitude)}function Tje(o,f,m,v,y,x){if(m===0)return Mt.clone(o,x);let C=y*y,w,A,E;if(Math.abs(xe.PI_OVER_TWO-Math.abs(f))>xe.EPSILON8){let T=yme(y,v,o.latitude),S=m*Math.cos(f),M=T+S;A=v3t(M,y,v);let I=pH(y,o.latitude),P=pH(y,A);E=Math.tan(f)*(P-I),w=xe.negativePiToPi(o.longitude+E)}else{A=o.latitude;let T;if(y===0)T=v*Math.cos(o.latitude);else{let S=Math.sin(o.latitude);T=v*Math.cos(o.latitude)/Math.sqrt(1-C*S*S)}E=m/T,f>0?w=xe.negativePiToPi(o.longitude+E):w=xe.negativePiToPi(o.longitude-E)}return N(x)?(x.longitude=w,x.latitude=A,x.height=0,x):new Mt(w,A,0)}function vM(o,f,m){let v=Z(m,ki.WGS84);this._ellipsoid=v,this._start=new Mt,this._end=new Mt,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,N(o)&&N(f)&&Eje(this,o,f,v)}Object.defineProperties(vM.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});vM.fromStartHeadingDistance=function(o,f,m,v,y){let x=Z(v,ki.WGS84),C=x.maximumRadius,w=x.minimumRadius,A=C*C,E=w*w,T=Math.sqrt((A-E)/A);f=xe.negativePiToPi(f);let S=Tje(o,f,m,x.maximumRadius,T);return!N(y)||N(v)&&!v.equals(y.ellipsoid)?new vM(o,S,x):(y.setEndPoints(o,S),y)};vM.prototype.setEndPoints=function(o,f){Eje(this,o,f,this._ellipsoid)};vM.prototype.interpolateUsingFraction=function(o,f){return this.interpolateUsingSurfaceDistance(o*this._distance,f)};vM.prototype.interpolateUsingSurfaceDistance=function(o,f){return Tje(this._start,this._heading,o,this._ellipsoid.maximumRadius,this._ellipticity,f)};vM.prototype.findIntersectionWithLongitude=function(o,f){let m=this._ellipticity,v=this._heading,y=Math.abs(v),x=this._start;if(o=xe.negativePiToPi(o),xe.equalsEpsilon(Math.abs(o),Math.PI,xe.EPSILON14)&&(o=xe.sign(x.longitude)*Math.PI),N(f)||(f=new Mt),Math.abs(xe.PI_OVER_TWO-y)<=xe.EPSILON8)return f.longitude=o,f.latitude=x.latitude,f.height=0,f;if(xe.equalsEpsilon(Math.abs(xe.PI_OVER_TWO-y),xe.PI_OVER_TWO,xe.EPSILON8))return xe.equalsEpsilon(o,x.longitude,xe.EPSILON12)?void 0:(f.longitude=o,f.latitude=xe.PI_OVER_TWO*xe.sign(xe.PI_OVER_TWO-v),f.height=0,f);let C=x.latitude,w=m*Math.sin(C),A=Math.tan(.5*(xe.PI_OVER_TWO+C))*Math.exp((o-x.longitude)/Math.tan(v)),E=(1+w)/(1-w),T=x.latitude,S;do{S=T;let M=m*Math.sin(S),I=(1+M)/(1-M);T=2*Math.atan(A*Math.pow(I/E,m/2))-xe.PI_OVER_TWO}while(!xe.equalsEpsilon(T,S,xe.EPSILON12));return f.longitude=o,f.latitude=T,f.height=0,f};vM.prototype.findIntersectionWithLatitude=function(o,f){let m=this._ellipticity,v=this._heading,y=this._start;if(xe.equalsEpsilon(Math.abs(v),xe.PI_OVER_TWO,xe.EPSILON8))return;let x=pH(m,y.latitude),C=pH(m,o),w=Math.tan(v)*(C-x),A=xe.negativePiToPi(y.longitude+w);return N(f)?(f.longitude=A,f.latitude=o,f.height=0,f):new Mt(A,o,0)};var Sw=vM;function b3t(o){o=Z(o,Z.EMPTY_OBJECT),this.componentDatatype=o.componentDatatype,this.componentsPerAttribute=o.componentsPerAttribute,this.normalize=Z(o.normalize,!1),this.values=o.values}var en=b3t,Vxe={};Vxe.computeDiscriminant=function(o,f,m){return f*f-4*o*m};function OFe(o,f,m){let v=o+f;return xe.sign(o)!==xe.sign(f)&&Math.abs(v/Math.max(Math.abs(o),Math.abs(f)))E&&E/A0?[w/o,m/w]:[m/w,w/o]};var FE=Vxe,zxe={};zxe.computeDiscriminant=function(o,f,m,v){let y=o*o,x=f*f,C=m*m,w=v*v;return 18*o*f*m*v+x*C-27*y*w-4*(o*C*m+x*f*v)};function bhe(o,f,m,v){let y=o,x=f/3,C=m/3,w=v,A=y*C,E=x*w,T=x*x,S=C*C,M=y*C-T,I=y*w-x*C,P=x*w-S,D=4*M*P-I*I,L,R;if(D<0){let fe,de,ve;T*E>=A*S?(fe=y,de=M,ve=-2*x*M+y*I):(fe=w,de=P,ve=-w*I+2*C*P);let pe=-(ve<0?-1:1)*Math.abs(fe)*Math.sqrt(-D);R=-ve+pe;let ce=R/2,he=ce<0?-Math.pow(-ce,1/3):Math.pow(ce,1/3),Ce=R===pe?-he:-de/he;return L=de<=0?he+Ce:-ve/(he*he+Ce*Ce+de),T*E>=A*S?[(L-x)/y]:[-w/(L+C)]}let O=M,F=-2*x*M+y*I,k=P,U=-w*I+2*C*P,G=Math.sqrt(D),j=Math.sqrt(3)/2,q=Math.abs(Math.atan2(y*G,-F)/3);L=2*Math.sqrt(-O);let J=Math.cos(q);R=L*J;let X=L*(-J/2-j*Math.sin(q)),Y=R+X>2*x?R-x:X-x,Q=y,ee=Y/Q;q=Math.abs(Math.atan2(w*G,-U)/3),L=2*Math.sqrt(-k),J=Math.cos(q),R=L*J,X=L*(-J/2-j*Math.sin(q));let z=-w,ie=R+X<2*C?R+C:X+C,re=z/ie,ne=Q*ie,oe=-Y*ie-Q*z,se=Y*z,ae=(C*oe-x*se)/(-x*oe+C*ne);return ee<=ae?ee<=re?ae<=re?[ee,ae,re]:[ee,re,ae]:[re,ee,ae]:ee<=re?[ae,ee,re]:ae<=re?[ae,re,ee]:[re,ae,ee]}zxe.computeRealRoots=function(o,f,m,v){let y,x;if(o===0)return FE.computeRealRoots(f,m,v);if(f===0){if(m===0){if(v===0)return[0,0,0];x=-v/o;let C=x<0?-Math.pow(-x,1/3):Math.pow(x,1/3);return[C,C,C]}else if(v===0)return y=FE.computeRealRoots(o,0,m),y.Length===0?[0]:[y[0],0,y[1]];return bhe(o,0,m,v)}else{if(m===0)return v===0?(x=-f/o,x<0?[x,0,0]:[0,0,x]):bhe(o,f,0,v);if(v===0)return y=FE.computeRealRoots(o,f,m),y.length===0?[0]:y[1]<=0?[y[0],y[1],0]:y[0]>=0?[0,y[0],y[1]]:[y[0],0,y[1]]}return bhe(o,f,m,v)};var gY=zxe,Hxe={};Hxe.computeDiscriminant=function(o,f,m,v,y){let x=o*o,C=x*o,w=f*f,A=w*f,E=m*m,T=E*m,S=v*v,M=S*v,I=y*y,P=I*y;return w*E*S-4*A*M-4*o*T*S+18*o*f*m*M-27*x*S*S+256*C*P+y*(18*A*m*v-4*w*T+16*o*E*E-80*o*f*E*v-6*o*w*S+144*x*m*S)+I*(144*o*w*m-27*w*w-128*x*E-192*x*f*v)};function mE(o,f,m,v){let y=o*o,x=f-3*y/8,C=m-f*o/2+y*o/8,w=v-m*o/4+f*y/16-3*y*y/256,A=gY.computeRealRoots(1,2*x,x*x-4*w,-C*C);if(A.length>0){let E=-o/4,T=A[A.length-1];if(Math.abs(T)=0&&I>=0){let D=Math.sqrt(M),L=Math.sqrt(I);return[E-L,E-D,E+D,E+L]}else{if(M>=0&&I<0)return P=Math.sqrt(M),[E-P,E+P];if(M<0&&I>=0)return P=Math.sqrt(I),[E-P,E+P]}}return[]}else if(T>0){let S=Math.sqrt(T),M=(x+T-C/S)/2,I=(x+T+C/S)/2,P=FE.computeRealRoots(1,S,M),D=FE.computeRealRoots(1,-S,I);return P.length!==0?(P[0]+=E,P[1]+=E,D.length!==0?(D[0]+=E,D[1]+=E,P[1]<=D[0]?[P[0],P[1],D[0],D[1]]:D[1]<=P[0]?[D[0],D[1],P[0],P[1]]:P[0]>=D[0]&&P[1]<=D[1]?[D[0],P[0],P[1],D[1]]:D[0]>=P[0]&&D[1]<=P[1]?[P[0],D[0],D[1],P[1]]:P[0]>D[0]&&P[0]0){let S=T[0],M=f-S,I=M*M,P=o/2,D=M/2,L=I-4*v,R=I+4*Math.abs(v),O=C-4*S,F=C+4*Math.abs(S),k,U;if(S<0||L*F=Y[0]&&X[1]<=Y[1]?[Y[0],X[0],X[1],Y[1]]:Y[0]>=X[0]&&Y[1]<=X[1]?[X[0],Y[0],Y[1],X[1]]:X[0]>Y[0]&&X[0]T)||(M=H.cross(S,w,FFe),P=H.dot(C,M),P<0||I+P>T))return;D=H.dot(A,M)/T}else{if(Math.abs(T)1||(M=H.cross(S,w,FFe),P=H.dot(C,M)*L,P<0||I+P>1))return;D=H.dot(A,M)*L}return D};Sf.rayTriangle=function(o,f,m,v,y,x){let C=Sf.rayTriangleParametric(o,f,m,v,y);if(!(!N(C)||C<0))return N(x)||(x=new H),H.multiplyByScalar(o.direction,C,x),H.add(o.origin,x,x)};var E3t=new _s;Sf.lineSegmentTriangle=function(o,f,m,v,y,x,C){let w=E3t;H.clone(o,w.origin),H.subtract(f,o,w.direction),H.normalize(w.direction,w.direction);let A=Sf.rayTriangleParametric(w,m,v,y,x);if(!(!N(A)||A<0||A>H.distance(o,f)))return N(C)||(C=new H),H.multiplyByScalar(w.direction,A,C),H.add(w.origin,C,C)};function T3t(o,f,m,v){let y=f*f-4*o*m;if(y<0)return;if(y>0){let C=1/(2*o),w=Math.sqrt(y),A=(-f+w)*C,E=(-f-w)*C;return AC))return v.start=Math.max(v.start,0),v.stop=Math.min(v.stop,C),v};var I3t=new H,M3t=new H;Sf.rayEllipsoid=function(o,f){let m=f.oneOverRadii,v=H.multiplyComponents(m,o.origin,I3t),y=H.multiplyComponents(m,o.direction,M3t),x=H.magnitudeSquared(v),C=H.dot(v,y),w,A,E,T,S;if(x>1){if(C>=0)return;let M=C*C;if(w=x-1,A=H.magnitudeSquared(y),E=A*w,ME){T=C*C-E,S=-C+Math.sqrt(T);let P=S/A,D=w/S;return P0?I.push(new H(v,y*J,y*-Q)):Q!==0?(I.push(new H(v,y*J,y*-Q)),I.push(new H(v,y*J,y*Q)),++q):I.push(new H(v,y*J,y*Q))}return I}var whe=new H,BFe=new H,kFe=new H,_Q=new H,L3t=new H,R3t=new Ut,O3t=new Ut,N3t=new Ut,F3t=new Ut,B3t=new Ut,VFe=new Ut,zFe=new Ut,HFe=new H,k3t=new H,V3t=new Mt;Sf.grazingAltitudeLocation=function(o,f){let m=o.origin,v=o.direction;if(!H.equals(m,H.ZERO)){let G=f.geodeticSurfaceNormal(m,whe);if(H.dot(v,G)>=0)return m}let y=N(this.rayEllipsoid(o,f)),x=f.transformPositionToScaledSpace(v,whe),C=H.normalize(x,x),w=H.mostOrthogonalAxis(x,_Q),A=H.normalize(H.cross(w,C,BFe),BFe),E=H.normalize(H.cross(C,A,kFe),kFe),T=R3t;T[0]=C.x,T[1]=C.y,T[2]=C.z,T[3]=A.x,T[4]=A.y,T[5]=A.z,T[6]=E.x,T[7]=E.y,T[8]=E.z;let S=Ut.transpose(T,O3t),M=Ut.fromScale(f.radii,N3t),I=Ut.fromScale(f.oneOverRadii,F3t),P=B3t;P[0]=0,P[1]=-v.z,P[2]=v.y,P[3]=v.z,P[4]=0,P[5]=-v.x,P[6]=-v.y,P[7]=v.x,P[8]=0;let D=Ut.multiply(Ut.multiply(S,I,VFe),P,VFe),L=Ut.multiply(Ut.multiply(D,M,zFe),T,zFe),R=Ut.multiplyByVector(D,m,L3t),O=D3t(L,H.negate(R,whe),0,0,1),F,k,U=O.length;if(U>0){let G=H.clone(H.ZERO,k3t),j=Number.NEGATIVE_INFINITY;for(let J=0;Jj&&(j=Y,G=H.clone(F,G))}let q=f.cartesianToCartographic(G,V3t);return j=xe.clamp(j,0,1),k=H.magnitude(H.subtract(G,m,_Q))*Math.sqrt(1-j*j),k=y?-k:k,q.height=k,f.cartographicToCartesian(q,new H)}};var z3t=new H;Sf.lineSegmentPlane=function(o,f,m,v){N(v)||(v=new H);let y=H.subtract(f,o,z3t),x=m.normal,C=H.dot(x,y);if(Math.abs(C)1))return H.multiplyByScalar(y,A,v),H.add(o,v,v),v};Sf.trianglePlaneIntersection=function(o,f,m,v){let y=v.normal,x=v.distance,C=H.dot(y,o)+x<0,w=H.dot(y,f)+x<0,A=H.dot(y,m)+x<0,E=0;E+=C?1:0,E+=w?1:0,E+=A?1:0;let T,S;if((E===1||E===2)&&(T=new H,S=new H),E===1){if(C)return Sf.lineSegmentPlane(o,f,v,T),Sf.lineSegmentPlane(o,m,v,S),{positions:[o,f,m,T,S],indices:[0,3,4,1,2,4,1,4,3]};if(w)return Sf.lineSegmentPlane(f,m,v,T),Sf.lineSegmentPlane(f,o,v,S),{positions:[o,f,m,T,S],indices:[1,3,4,2,0,4,2,4,3]};if(A)return Sf.lineSegmentPlane(m,o,v,T),Sf.lineSegmentPlane(m,f,v,S),{positions:[o,f,m,T,S],indices:[2,3,4,0,1,4,0,4,3]}}else if(E===2)if(C)if(w){if(!A)return Sf.lineSegmentPlane(o,m,v,T),Sf.lineSegmentPlane(f,m,v,S),{positions:[o,f,m,T,S],indices:[0,1,4,0,4,3,2,3,4]}}else return Sf.lineSegmentPlane(m,f,v,T),Sf.lineSegmentPlane(o,f,v,S),{positions:[o,f,m,T,S],indices:[2,0,4,2,4,3,1,3,4]};else return Sf.lineSegmentPlane(f,o,v,T),Sf.lineSegmentPlane(m,o,v,S),{positions:[o,f,m,T,S],indices:[1,2,4,1,4,3,0,3,4]}};var Hh=Sf;function tC(o){this._ellipsoid=Z(o,ki.WGS84),this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(tC.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});tC.mercatorAngleToGeodeticLatitude=function(o){return xe.PI_OVER_TWO-2*Math.atan(Math.exp(-o))};tC.geodeticLatitudeToMercatorAngle=function(o){o>tC.MaximumLatitude?o=tC.MaximumLatitude:o<-tC.MaximumLatitude&&(o=-tC.MaximumLatitude);let f=Math.sin(o);return .5*Math.log((1+f)/(1-f))};tC.MaximumLatitude=tC.mercatorAngleToGeodeticLatitude(Math.PI);tC.prototype.project=function(o,f){let m=this._semimajorAxis,v=o.longitude*m,y=tC.geodeticLatitudeToMercatorAngle(o.latitude)*m,x=o.height;return N(f)?(f.x=v,f.y=y,f.z=x,f):new H(v,y,x)};tC.prototype.unproject=function(o,f){let m=this._oneOverSemimajorAxis,v=o.x*m,y=tC.mercatorAngleToGeodeticLatitude(o.y*m),x=o.z;return N(f)?(f.longitude=v,f.latitude=y,f.height=x,f):new Mt(v,y,x)};var hd=tC,Gxe=[Mp,hd],H3t=Gxe.length,Ije=Math.cos(xe.toRadians(30)),UFe=Math.cos(xe.toRadians(150)),Mje=0,Dje=1e3;function A3(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.positions;this.width=Z(o.width,1),this._positions=f,this.granularity=Z(o.granularity,9999),this.loop=Z(o.loop,!1),this.arcType=Z(o.arcType,fs.GEODESIC),this._ellipsoid=ki.WGS84,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(A3.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ki.packedLength+1+1}}});A3.setProjectionAndEllipsoid=function(o,f){let m=0;for(let v=0;vIje||xxe.PI_OVER_TWO&&(w=!0,C=H.subtract(x,m,KFe),E=A.cartesianToCartographic(C,JFe)),E.height=0;let T=o.project(E,y);return y=H.subtract(T,v,y),y.z=0,y=H.normalize(y,y),w&&H.negate(y,y),y}var sOt=new H,QFe=new H;function ZFe(o,f,m,v,y,x){let C=H.subtract(f,o,sOt);H.normalize(C,C);let w=m-Mje,A=H.multiplyByScalar(C,w,QFe);H.add(o,A,y);let E=v-Dje;A=H.multiplyByScalar(C,E,QFe),H.add(f,A,x)}var lOt=new H;function xQ(o,f){let m=$a.getPointDistance(Lee,o),v=$a.getPointDistance(Lee,f),y=lOt;xe.equalsEpsilon(m,0,xe.EPSILON2)?(y=yM(f,o,y),H.multiplyByScalar(y,xe.EPSILON2,y),H.add(o,y,o)):xe.equalsEpsilon(v,0,xe.EPSILON2)&&(y=yM(o,f,y),H.multiplyByScalar(y,xe.EPSILON2,y),H.add(f,y,f))}function uOt(o,f){let m=Math.abs(o.longitude),v=Math.abs(f.longitude);if(xe.equalsEpsilon(m,xe.PI,xe.EPSILON11)){let y=xe.sign(f.longitude);return o.longitude=y*(m-xe.EPSILON11),1}else if(xe.equalsEpsilon(v,xe.PI,xe.EPSILON11)){let y=xe.sign(o.longitude);return f.longitude=y*(v-xe.EPSILON11),2}return 0}var Rje=new Mt,Oje=new Mt,$Fe=new H,She=new H,e5e=new H,t5e=new H,cOt=new H,i5e=new H,hOt=[Rje,Oje],dOt=new Di,fOt=new H,pOt=new H,mOt=new H,gOt=new H,_Ot=new H,vOt=new H,Phe=new H,Ihe=new H,yOt=new H,xOt=new H,COt=new H,r5e=new H,bOt=new H,wOt=new H,AOt=new Qu,EOt=new Qu,n5e=new H,TOt=new H,o5e=new H,SOt=[new Pi,new Pi],Nje=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],a5e=Nje.length;function POt(o,f,m,v,y,x,C){let w,A,E=f._ellipsoid,T=m.length/3-1,S=T*8,M=S*4,I=T*36,P=S>65535?new Uint32Array(I):new Uint16Array(I),D=new Float64Array(S*3),L=new Float32Array(M),R=new Float32Array(M),O=new Float32Array(M),F=new Float32Array(M),k=new Float32Array(M),U,G,j,q;C&&(U=new Float32Array(M),G=new Float32Array(M),j=new Float32Array(M),q=new Float32Array(S*2));let J=x.length/2,X=0,Y=Rje;Y.height=0;let Q=Oje;Q.height=0;let ee=$Fe,z=She;if(C)for(A=0,w=1;wIje?(ft=g7(f,Y,at,Pt,Phe),Ot=g7(f,Q,ce,Qe,Ihe)):ct===1?(Ot=g7(f,Q,ce,Qe,Ihe),ft.x=0,ft.y=xe.sign(Y.longitude-Math.abs(Q.longitude)),ft.z=0):(ft=g7(f,Y,at,Pt,Phe),Ot.x=0,Ot.y=xe.sign(Y.longitude-Q.longitude),Ot.z=0)}let Xt=H.distance(ut,pe),At=Qu.fromCartesian(it,AOt),bt=H.subtract(ve,it,yOt),gt=H.normalize(bt,r5e),It=H.subtract(ut,it,xOt);It=H.normalize(It,It);let Jt=H.cross(gt,It,r5e);Jt=H.normalize(Jt,Jt);let bi=H.cross(It,at,bOt);bi=H.normalize(bi,bi);let Yi=H.subtract(pe,ve,COt);Yi=H.normalize(Yi,Yi);let ii=H.cross(ce,Yi,wOt);ii=H.normalize(ii,ii);let ei=Xt/re,Li=he/re,Je=0,Nt,yi,ai,wi=0,ji=0;if(C){Je=H.distance(Pt,Qe),Nt=Qu.fromCartesian(Pt,EOt),yi=H.subtract(Qe,Pt,n5e),ai=H.normalize(yi,TOt);let ct=ai.x;ai.x=ai.y,ai.y=-ct,wi=Je/X,ji=Ce/X}for(ne=0;ne<8;ne++){let ct=fe+ne*4,Pe=se+ne*2,Ht=ct+3,si=ne<4?1:-1,_t=ne===2||ne===3||ne===6||ne===7?1:-1;H.pack(At.high,L,ct),L[Ht]=bt.x,H.pack(At.low,R,ct),R[Ht]=bt.y,H.pack(bi,O,ct),O[Ht]=bt.z,H.pack(ii,F,ct),F[Ht]=ei*si,H.pack(Jt,k,ct);let Yt=Li*_t;Yt===0&&_t<0&&(Yt=9),k[Ht]=Yt,C&&(U[ct]=Nt.high.x,U[ct+1]=Nt.high.y,U[ct+2]=Nt.low.x,U[ct+3]=Nt.low.y,j[ct]=-ft.y,j[ct+1]=ft.x,j[ct+2]=Ot.y,j[ct+3]=-Ot.x,G[ct]=yi.x,G[ct+1]=yi.y,G[ct+2]=ai.x,G[ct+3]=ai.y,q[Pe]=wi*si,Yt=ji*_t,Yt===0&&_t<0&&(Yt=9),q[Pe+1]=Yt)}let hi=mOt,Ri=gOt,pt=fOt,wr=pOt,zi=Di.fromCartographicArray(hOt,dOt),Ui=zh.getMinimumMaximumHeights(zi,E),Gt=Ui.minimumTerrainHeight,$t=Ui.maximumTerrainHeight;Se+=Gt,Se+=$t,ZFe(it,ut,Gt,$t,hi,pt),ZFe(ve,pe,Gt,$t,Ri,wr);let jt=H.multiplyByScalar(Jt,xe.EPSILON5,o5e);H.add(hi,jt,hi),H.add(Ri,jt,Ri),H.add(pt,jt,pt),H.add(wr,jt,wr),xQ(hi,Ri),xQ(pt,wr),H.pack(hi,D,ae),H.pack(Ri,D,ae+3),H.pack(wr,D,ae+6),H.pack(pt,D,ae+9),jt=H.multiplyByScalar(Jt,-2*xe.EPSILON5,o5e),H.add(hi,jt,hi),H.add(Ri,jt,Ri),H.add(pt,jt,pt),H.add(wr,jt,wr),xQ(hi,Ri),xQ(pt,wr),H.pack(hi,D,ae+12),H.pack(Ri,D,ae+15),H.pack(wr,D,ae+18),H.pack(pt,D,ae+21),oe+=2,A+=3,se+=16,ae+=24,fe+=32,he+=Xt,Ce+=Je}A=0;let De=0;for(w=0;w halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { #ifdef DEBUG_SHOW_VOLUME out_FragColor = vec4(1.0, 0.0, 0.0, 0.5); return; #else // DEBUG_SHOW_VOLUME discard; #endif // DEBUG_SHOW_VOLUME } // Check distance of the eye coordinate against start and end planes with normals in the right plane. // For computing unskewed lengthwise texture coordinate. // Can also be used for clipping extremely pointy miters, but in practice unnecessary because of miter breaking. // aligned plane: cross the right plane normal with miter plane normal, then cross the result with right again to point it more "forward" vec3 alignedPlaneNormal; // start aligned plane alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz); alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz); // end aligned plane alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz); alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz)); distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz); #ifdef PER_INSTANCE_COLOR out_FragColor = czm_gammaCorrect(v_color); #else // PER_INSTANCE_COLOR // Clamp - distance to aligned planes may be negative due to mitering, // so fragment texture coordinate might be out-of-bounds. float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0); s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y; float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth); czm_materialInput materialInput; materialInput.s = s; materialInput.st = vec2(s, t); materialInput.str = vec3(s, t, 0.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); #endif // PER_INSTANCE_COLOR // Premultiply alpha. Required for classification primitives on translucent globe. out_FragColor.rgb *= out_FragColor.a; czm_writeDepthClamp(); } `,jxe=`in vec3 v_forwardDirectionEC; in vec3 v_texcoordNormalizationAndHalfWidth; in float v_batchId; #ifdef PER_INSTANCE_COLOR in vec4 v_color; #else in vec2 v_alignedPlaneDistances; in float v_texcoordT; #endif float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) { // We don't expect the ray to ever be parallel to the plane return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction); } void main(void) { vec4 eyeCoordinate = gl_FragCoord; eyeCoordinate /= eyeCoordinate.w; #ifdef PER_INSTANCE_COLOR out_FragColor = czm_gammaCorrect(v_color); #else // PER_INSTANCE_COLOR // Use distances for planes aligned with segment to prevent skew in dashing float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x); float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y); // Clamp - distance to aligned planes may be negative due to mitering distanceFromStart = max(0.0, distanceFromStart); distanceFromEnd = max(0.0, distanceFromEnd); float s = distanceFromStart / (distanceFromStart + distanceFromEnd); s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y; czm_materialInput materialInput; materialInput.s = s; materialInput.st = vec2(s, v_texcoordT); materialInput.str = vec3(s, v_texcoordT, 0.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); #endif // PER_INSTANCE_COLOR } `,Yxe=`in vec3 position3DHigh; in vec3 position3DLow; in vec4 startHiAndForwardOffsetX; in vec4 startLoAndForwardOffsetY; in vec4 startNormalAndForwardOffsetZ; in vec4 endNormalAndTextureCoordinateNormalizationX; in vec4 rightNormalAndTextureCoordinateNormalizationY; in vec4 startHiLo2D; in vec4 offsetAndRight2D; in vec4 startEndNormals2D; in vec2 texcoordNormalization2D; in float batchId; out vec3 v_forwardDirectionEC; out vec3 v_texcoordNormalizationAndHalfWidth; out float v_batchId; // For materials #ifdef WIDTH_VARYING out float v_width; #endif #ifdef ANGLE_VARYING out float v_polylineAngle; #endif #ifdef PER_INSTANCE_COLOR out vec4 v_color; #else out vec2 v_alignedPlaneDistances; out float v_texcoordT; #endif // Morphing planes using SLERP or NLERP doesn't seem to work, so instead draw the material directly on the shadow volume. // Morph views are from very far away and aren't meant to be used precisely, so this should be sufficient. void main() { v_batchId = batchId; // Start position vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw)); vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz); vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; // Start plane vec4 startPlane2D; vec4 startPlane3D; startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; startPlane2D.w = -dot(startPlane2D.xyz, posEc2D); startPlane3D.w = -dot(startPlane3D.xyz, posEc3D); // Right plane vec4 rightPlane2D; vec4 rightPlane3D; rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D); rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D); // End position posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0); posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0); posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime); posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz; posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz; vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz; vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w)); vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy)); // End plane vec4 endPlane2D; vec4 endPlane3D; endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; endPlane2D.w = -dot(endPlane2D.xyz, posEc2D); endPlane3D.w = -dot(endPlane3D.xyz, posEc3D); // Forward direction v_forwardDirectionEC = normalize(endEC - startEC); vec2 cleanTexcoordNormalization2D; cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x); cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y)); vec2 cleanTexcoordNormalization3D; cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w); cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w; cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y)); v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime); #ifdef PER_INSTANCE_COLOR v_color = czm_batchTable_color(batchId); #else // PER_INSTANCE_COLOR // For computing texture coordinates v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC); v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC); #endif // PER_INSTANCE_COLOR #ifdef WIDTH_VARYING float width = czm_batchTable_width(batchId); float halfWidth = width * 0.5; v_width = width; v_texcoordNormalizationAndHalfWidth.z = halfWidth; #else float halfWidth = 0.5 * czm_batchTable_width(batchId); v_texcoordNormalizationAndHalfWidth.z = halfWidth; #endif // Compute a normal along which to "push" the position out, extending the miter depending on view distance. // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. // Since this is morphing, compute both 3D and 2D positions and then blend. // ****** 3D ****** // Check distance to the end plane and start plane, pick the plane that is closer vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow); // w = 1.0, see czm_computePosition float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz)); float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz)); vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz); vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. // Nudge the top vertex upwards to prevent flickering vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D)); geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0); geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; positionEc3D.xyz += geodeticSurfaceNormal; // Determine if this vertex is on the "left" or "right" normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); // A "perfect" implementation would push along normals according to the angle against forward. // In practice, just pushing the normal out by halfWidth is sufficient for morph views. positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) // ****** 2D ****** // Check distance to the end plane and start plane, pick the plane that is closer vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy); // w = 1.0, see czm_computePosition absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz)); absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz)); planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz); upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. // Nudge the top vertex upwards to prevent flickering geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D)); geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0); geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT; positionEc2D.xyz += geodeticSurfaceNormal; // Determine if this vertex is on the "left" or "right" normalEC *= sign(texcoordNormalization2D.x); #ifndef PER_INSTANCE_COLOR // Use vertex's sidedness to compute its texture coordinate. v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0); #endif // A "perfect" implementation would push along normals according to the angle against forward. // In practice, just pushing the normal out by halfWidth is sufficient for morph views. positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC; // prevent artifacts when czm_metersPerPixel is negative (behind camera) // Blend for actual position gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime); #ifdef ANGLE_VARYING // Approximate relative screen space direction of the line. vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y)); approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } `,qxe=`in vec3 position3DHigh; in vec3 position3DLow; // In 2D and in 3D, texture coordinate normalization component signs encodes: // * X sign - sidedness relative to right plane // * Y sign - is negative OR magnitude is greater than 1.0 if vertex is on bottom of volume #ifndef COLUMBUS_VIEW_2D in vec4 startHiAndForwardOffsetX; in vec4 startLoAndForwardOffsetY; in vec4 startNormalAndForwardOffsetZ; in vec4 endNormalAndTextureCoordinateNormalizationX; in vec4 rightNormalAndTextureCoordinateNormalizationY; #else in vec4 startHiLo2D; in vec4 offsetAndRight2D; in vec4 startEndNormals2D; in vec2 texcoordNormalization2D; #endif in float batchId; out vec4 v_startPlaneNormalEcAndHalfWidth; out vec4 v_endPlaneNormalEcAndBatchId; out vec4 v_rightPlaneEC; out vec4 v_endEcAndStartEcX; out vec4 v_texcoordNormalizationAndStartEcYZ; // For materials #ifdef WIDTH_VARYING out float v_width; #endif #ifdef ANGLE_VARYING out float v_polylineAngle; #endif #ifdef PER_INSTANCE_COLOR out vec4 v_color; #endif void main() { #ifdef COLUMBUS_VIEW_2D vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz; vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy); vec3 ecEnd = forwardDirectionEC + ecStart; forwardDirectionEC = normalize(forwardDirectionEC); // Right plane v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw); v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); // start plane vec4 startPlaneEC; startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy); startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); // end plane vec4 endPlaneEC; endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw); endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x); v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y; #else // COLUMBUS_VIEW_2D vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz; vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w); vec3 ecEnd = ecStart + offset; vec3 forwardDirectionEC = normalize(offset); // start plane vec4 startPlaneEC; startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz; startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart); // end plane vec4 endPlaneEC; endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz; endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd); // Right plane v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz; v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart); v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w); v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w; #endif // COLUMBUS_VIEW_2D v_endEcAndStartEcX.xyz = ecEnd; v_endEcAndStartEcX.w = ecStart.x; v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz; #ifdef PER_INSTANCE_COLOR v_color = czm_batchTable_color(batchId); #endif // PER_INSTANCE_COLOR // Compute a normal along which to "push" the position out, extending the miter depending on view distance. // Position has already been "pushed" by unit length along miter normal, and miter normals are encoded in the planes. // Decode the normal to use at this specific vertex, push the position back, and then push to where it needs to be. vec4 positionRelativeToEye = czm_computePosition(); // Check distance to the end plane and start plane, pick the plane that is closer vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye; // w = 1.0, see czm_computePosition float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz)); float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz)); vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz); vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection)); // Points "up" for start plane, "down" at end plane. vec3 normalEC = normalize(cross(planeDirection, upOrDown)); // In practice, the opposite seems to work too. // Extrude bottom vertices downward for far view distances, like for GroundPrimitives upOrDown = cross(forwardDirectionEC, normalEC); upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown; upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown; upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown; positionEC.xyz += upOrDown; v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y)); // Determine distance along normalEC to push for a volume of appropriate width. // Make volumes about double pixel width for a conservative fit - in practice the // extra cost here is minimal compared to the loose volume heights. // // N = normalEC (guaranteed "right-facing") // R = rightEC // p = angle between N and R // w = distance to push along R if R == N // d = distance to push along N // // N R // { p| } * cos(p) = dot(N, R) = w / d // d | |w * d = w / dot(N, R) // { | } // o---------- polyline segment ----> // float width = czm_batchTable_width(batchId); #ifdef WIDTH_VARYING v_width = width; #endif v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz; v_startPlaneNormalEcAndHalfWidth.w = width * 0.5; v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz; v_endPlaneNormalEcAndBatchId.w = batchId; width = width * max(0.0, czm_metersPerPixel(positionEC)); // width = distance to push along R width = width / dot(normalEC, v_rightPlaneEC.xyz); // width = distance to push along N // Determine if this vertex is on the "left" or "right" #ifdef COLUMBUS_VIEW_2D normalEC *= sign(texcoordNormalization2D.x); #else normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w); #endif positionEC.xyz += width * normalEC; gl_Position = czm_depthClamp(czm_projection * positionEC); #ifdef ANGLE_VARYING // Approximate relative screen space direction of the line. vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y)); approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y); v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } `,Fje={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};Fje.NUMBER_OF_CLASSIFICATION_TYPES=3;var uc=Object.freeze(Fje),IOt={FRONT:xi.FRONT,BACK:xi.BACK,FRONT_AND_BACK:xi.FRONT_AND_BACK},uh=Object.freeze(IOt);function Em(o){o=Z(o,Z.EMPTY_OBJECT),this.position=Z(o.position,!1),this.normal=Z(o.normal,!1),this.st=Z(o.st,!1),this.bitangent=Z(o.bitangent,!1),this.tangent=Z(o.tangent,!1),this.color=Z(o.color,!1)}Em.POSITION_ONLY=Object.freeze(new Em({position:!0}));Em.POSITION_AND_NORMAL=Object.freeze(new Em({position:!0,normal:!0}));Em.POSITION_NORMAL_AND_ST=Object.freeze(new Em({position:!0,normal:!0,st:!0}));Em.POSITION_AND_ST=Object.freeze(new Em({position:!0,st:!0}));Em.POSITION_AND_COLOR=Object.freeze(new Em({position:!0,color:!0}));Em.ALL=Object.freeze(new Em({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Em.DEFAULT=Em.POSITION_NORMAL_AND_ST;Em.packedLength=6;Em.pack=function(o,f,m){return m=Z(m,0),f[m++]=o.position?1:0,f[m++]=o.normal?1:0,f[m++]=o.st?1:0,f[m++]=o.tangent?1:0,f[m++]=o.bitangent?1:0,f[m]=o.color?1:0,f};Em.unpack=function(o,f,m){return f=Z(f,0),N(m)||(m=new Em),m.position=o[f++]===1,m.normal=o[f++]===1,m.st=o[f++]===1,m.tangent=o[f++]===1,m.bitangent=o[f++]===1,m.color=o[f]===1,m};Em.clone=function(o,f){if(N(o))return N(f)||(f=new Em),f.position=o.position,f.normal=o.normal,f.st=o.st,f.tangent=o.tangent,f.bitangent=o.bitangent,f.color=o.color,f};var un=Em,lre=`in vec4 v_color; void main() { out_FragColor = czm_gammaCorrect(v_color); } `,Xxe=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 prevPosition3DHigh; in vec3 prevPosition3DLow; in vec3 nextPosition3DHigh; in vec3 nextPosition3DLow; in vec2 expandAndWidth; in vec4 color; in float batchId; out vec4 v_color; void main() { float expandDir = expandAndWidth.x; float width = abs(expandAndWidth.y) + 0.5; bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); vec4 prev = czm_computePrevPosition(); vec4 next = czm_computeNextPosition(); float angle; vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); gl_Position = czm_viewportOrthographic * positionWC; v_color = color; } `,xB=`void clipLineSegmentToNearPlane( vec3 p0, vec3 p1, out vec4 positionWC, out bool clipped, out bool culledByNearPlane, out vec4 clippedPositionEC) { culledByNearPlane = false; clipped = false; vec3 p0ToP1 = p1 - p0; float magnitude = length(p0ToP1); vec3 direction = normalize(p0ToP1); // Distance that p0 is behind the near plane. Negative means p0 is // in front of the near plane. float endPoint0Distance = czm_currentFrustum.x + p0.z; // Camera looks down -Z. // When moving a point along +Z: LESS VISIBLE // * Points in front of the camera move closer to the camera. // * Points behind the camrea move farther away from the camera. // When moving a point along -Z: MORE VISIBLE // * Points in front of the camera move farther away from the camera. // * Points behind the camera move closer to the camera. // Positive denominator: -Z, becoming more visible // Negative denominator: +Z, becoming less visible // Nearly zero: parallel to near plane float denominator = -direction.z; if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7) { // p0 is behind the near plane and the line to p1 is nearly parallel to // the near plane, so cull the segment completely. culledByNearPlane = true; } else if (endPoint0Distance > 0.0) { // p0 is behind the near plane, and the line to p1 is moving distinctly // toward or away from it. // t = (-plane distance - dot(plane normal, ray origin)) / dot(plane normal, ray direction) float t = endPoint0Distance / denominator; if (t < 0.0 || t > magnitude) { // Near plane intersection is not between the two points. // We already confirmed p0 is behind the naer plane, so now // we know the entire segment is behind it. culledByNearPlane = true; } else { // Segment crosses the near plane, update p0 to lie exactly on it. p0 = p0 + t * direction; // Numerical noise might put us a bit on the wrong side of the near plane. // Don't let that happen. p0.z = min(p0.z, -czm_currentFrustum.x); clipped = true; } } clippedPositionEC = vec4(p0, 1.0); positionWC = czm_eyeToWindowCoordinates(clippedPositionEC); } vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle) { // expandDirection +1 is to the _left_ when looking from positionEC toward nextEC. #ifdef POLYLINE_DASH // Compute the window coordinates of the points. vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC); vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC); vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC); // Determine the relative screen space direction of the line. vec2 lineDir; if (usePrevious) { lineDir = normalize(positionWindow.xy - previousWindow.xy); } else { lineDir = normalize(nextWindow.xy - positionWindow.xy); } angle = atan(lineDir.x, lineDir.y) - 1.570796327; // precomputed atan(1,0) // Quantize the angle so it doesn't change rapidly between segments. angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour; #endif vec4 clippedPrevWC, clippedPrevEC; bool prevSegmentClipped, prevSegmentCulled; clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC); vec4 clippedNextWC, clippedNextEC; bool nextSegmentClipped, nextSegmentCulled; clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC); bool segmentClipped, segmentCulled; vec4 clippedPositionWC, clippedPositionEC; clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC); if (segmentCulled) { return vec4(0.0, 0.0, 0.0, 1.0); } vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy); vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy); // If a segment was culled, we can't use the corresponding direction // computed above. We should never see both of these be true without // \`segmentCulled\` above also being true. if (prevSegmentCulled) { directionToPrevWC = -directionToNextWC; } else if (nextSegmentCulled) { directionToNextWC = -directionToPrevWC; } vec2 thisSegmentForwardWC, otherSegmentForwardWC; if (usePrevious) { thisSegmentForwardWC = -directionToPrevWC; otherSegmentForwardWC = directionToNextWC; } else { thisSegmentForwardWC = directionToNextWC; otherSegmentForwardWC = -directionToPrevWC; } vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x); vec2 leftWC = thisSegmentLeftWC; float expandWidth = width * 0.5; // When lines are split at the anti-meridian, the position may be at the // same location as the next or previous position, and we need to handle // that to avoid producing NaNs. if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1)) { vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x); vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC; float leftSumLength = length(leftSumWC); leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength); // The sine of the angle between the two vectors is given by the formula // |a x b| = |a||b|sin(theta) // which is // float sinAngle = length(cross(vec3(leftWC, 0.0), vec3(-thisSegmentForwardWC, 0.0))); // Because the z components of both vectors are zero, the x and y coordinate will be zero. // Therefore, the sine of the angle is just the z component of the cross product. vec2 u = -thisSegmentForwardWC; vec2 v = leftWC; float sinAngle = abs(u.x * v.y - u.y * v.x); expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0); } vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio; return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w; } vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle) { vec4 positionEC = czm_modelViewRelativeToEye * position; vec4 prevEC = czm_modelViewRelativeToEye * previous; vec4 nextEC = czm_modelViewRelativeToEye * next; return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); } `;function wU(o){o=Z(o,Z.EMPTY_OBJECT),this.material=o.material,this.translucent=Z(o.translucent,!0),this._vertexShaderSource=o.vertexShaderSource,this._fragmentShaderSource=o.fragmentShaderSource,this._renderState=o.renderState,this._closed=Z(o.closed,!1)}Object.defineProperties(wU.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});wU.prototype.getFragmentShaderSource=function(){let o=[];return this.flat&&o.push("#define FLAT"),this.faceForward&&o.push("#define FACE_FORWARD"),N(this.material)&&o.push(this.material.shaderSource),o.push(this.fragmentShaderSource),o.join(` `)};wU.prototype.isTranslucent=function(){return N(this.material)&&this.material.isTranslucent()||!N(this.material)&&this.translucent};wU.prototype.getRenderState=function(){let o=this.isTranslucent(),f=uo(this.renderState,!1);return o?(f.depthMask=!1,f.blending=Mu.ALPHA_BLEND):f.depthMask=!0,f};wU.getDefaultRenderState=function(o,f,m){let v={depthTest:{enabled:!0}};return o&&(v.depthMask=!1,v.blending=Mu.ALPHA_BLEND),f&&(v.cull={enabled:!0,face:uh.BACK}),N(m)&&(v=va(m,v,!0)),v};var md=wU,Cme=`${xB} ${Xxe}`,MOt=lre;pa.isInternetExplorer()||(Cme=`#define CLIP_POLYLINE ${Cme}`);function CB(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.translucent,!0),m=!1,v=CB.VERTEX_FORMAT;this.material=void 0,this.translucent=f,this._vertexShaderSource=Z(o.vertexShaderSource,Cme),this._fragmentShaderSource=Z(o.fragmentShaderSource,MOt),this._renderState=md.getDefaultRenderState(f,m,o.renderState),this._closed=m,this._vertexFormat=v}Object.defineProperties(CB.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});CB.VERTEX_FORMAT=un.POSITION_ONLY;CB.prototype.getFragmentShaderSource=md.prototype.getFragmentShaderSource;CB.prototype.isTranslucent=md.prototype.isTranslucent;CB.prototype.getRenderState=md.prototype.getRenderState;var tm=CB,Jxe=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 prevPosition3DHigh; in vec3 prevPosition3DLow; in vec3 nextPosition3DHigh; in vec3 nextPosition3DLow; in vec2 expandAndWidth; in vec2 st; in float batchId; out float v_width; out vec2 v_st; out float v_polylineAngle; void main() { float expandDir = expandAndWidth.x; float width = abs(expandAndWidth.y) + 0.5; bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); vec4 prev = czm_computePrevPosition(); vec4 next = czm_computeNextPosition(); float angle; vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); gl_Position = czm_viewportOrthographic * positionWC; v_width = width; v_st.s = st.s; v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); v_polylineAngle = angle; } `,ure=`#ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif in vec2 v_st; void main() { czm_materialInput materialInput; vec2 st = v_st; st.t = czm_readNonPerspective(st.t, gl_FragCoord.w); materialInput.s = st.s; materialInput.st = st; materialInput.str = vec3(st, 0.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); #ifdef VECTOR_TILE out_FragColor *= u_highlightColor; #endif czm_writeLogDepth(); } `,bme=`${xB} ${Jxe}`,DOt=ure;pa.isInternetExplorer()||(bme=`#define CLIP_POLYLINE ${bme}`);function bB(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.translucent,!0),m=!1,v=bB.VERTEX_FORMAT;this.material=N(o.material)?o.material:zo.fromType(zo.ColorType),this.translucent=f,this._vertexShaderSource=Z(o.vertexShaderSource,bme),this._fragmentShaderSource=Z(o.fragmentShaderSource,DOt),this._renderState=md.getDefaultRenderState(f,m,o.renderState),this._closed=m,this._vertexFormat=v}Object.defineProperties(bB.prototype,{vertexShaderSource:{get:function(){let o=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(o=`#define POLYLINE_DASH ${o}`),o}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});bB.VERTEX_FORMAT=un.POSITION_AND_ST;bB.prototype.getFragmentShaderSource=md.prototype.getFragmentShaderSource;bB.prototype.isTranslucent=md.prototype.isTranslucent;bB.prototype.getRenderState=md.prototype.getRenderState;var M0=bB;function LOt(o){o=Z(o,Z.EMPTY_OBJECT),this.position=o.position,this.normal=o.normal,this.st=o.st,this.bitangent=o.bitangent,this.tangent=o.tangent,this.color=o.color}var Oc=LOt,ROt={NONE:0,TOP:1,ALL:2},yl=Object.freeze(ROt);function OOt(o,f){let m=[],v=o.length,y=0;for(;ym&&(m=A),++w,A=f[w]}let x=[];for(let w=0;wv&&(x[f[w]]=C,++C);return(C-v+1)/(y/3)};Qxe.tipsify=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.indices,m=o.maximumIndex,v=Z(o.cacheSize,24),y;function x(Y,Q,ee,z){for(;Q.length>=1;){let ie=Q[Q.length-1];if(Q.splice(Q.length-1,1),Y[ie].numLiveTriangles>0)return ie}for(;y0)return++y,y-1;++y}return-1}function C(Y,Q,ee,z,ie,re,ne){let oe=-1,se,ae=-1,fe=0;for(;feae||ae===-1)&&(ae=se,oe=de)),++fe}return oe===-1?x(z,re,Y,ne):oe}let w=f.length,A=0,E=0,T=f[E],S=w;if(N(m))A=m+1;else{for(;EA&&(A=T),++E,T=f[E];if(A===-1)return 0;++A}let M=[],I;for(I=0;Iv&&(F.timeStamp=L,++L),++E}D=C(f,v,R,M,L,O,A)}return G};var Zxe=Qxe,Zy={};function Ree(o,f,m,v,y){o[f++]=m,o[f++]=v,o[f++]=v,o[f++]=y,o[f++]=y,o[f]=m}function KOt(o){let f=o.length,m=f/3*6,v=ro.createTypedArray(f,m),y=0;for(let x=0;x=3){let m=(f-2)*6,v=ro.createTypedArray(f,m);Ree(v,0,o[0],o[1],o[2]);let y=6;for(let x=3;x0){let f=o.length-1,m=(f-1)*6,v=ro.createTypedArray(f,m),y=o[0],x=0;for(let C=1;Cy&&(y=m[x]);o.indices=Zxe.tipsify({indices:m,maximumIndex:y,cacheSize:f})}return o};function h5e(o){let f={};for(let m in o)if(o.hasOwnProperty(m)&&N(o[m])&&N(o[m].values)){let v=o[m];f[m]=new en({componentDatatype:v.componentDatatype,componentsPerAttribute:v.componentsPerAttribute,normalize:v.normalize,values:[]})}return f}function $Ot(o,f,m){for(let v in f)if(f.hasOwnProperty(v)&&N(f[v])&&N(f[v].values)){let y=f[v];for(let x=0;x=xe.SIXTY_FOUR_KILOBYTES){let v=[],y=[],x=0,C=h5e(o.attributes),w=o.indices,A=w.length,E;o.primitiveType===Fn.TRIANGLES?E=3:o.primitiveType===Fn.LINES?E=2:o.primitiveType===Fn.POINTS&&(E=1);for(let T=0;T=xe.SIXTY_FOUR_KILOBYTES&&(f.push(new ga({attributes:C,indices:y,primitiveType:o.primitiveType,boundingSphere:o.boundingSphere,boundingSphereCV:o.boundingSphereCV})),v=[],y=[],x=0,C=h5e(o.attributes))}y.length!==0&&f.push(new ga({attributes:C,indices:y,primitiveType:o.primitiveType,boundingSphere:o.boundingSphere,boundingSphereCV:o.boundingSphereCV}))}else f.push(o);return f};var d5e=new H,eNt=new Mt;Zy.projectTo2D=function(o,f,m,v,y){let x=o.attributes[f];y=N(y)?y:new Mp;let C=y.ellipsoid,w=x.values,A=new Float64Array(w.length),E=0;for(let T=0;TL&&(L=O)}return new ga({attributes:T,indices:P,primitiveType:E,boundingSphere:N(D)?new Pi(D,L):void 0})}Zy.combineInstances=function(o){let f=[],m=[],v=o.length;for(let x=0;x0&&y.push(Rhe(f,"geometry")),m.length>0&&(y.push(Rhe(m,"westHemisphereGeometry")),y.push(Rhe(m,"eastHemisphereGeometry"))),y};var ew=new H,C9=new H,CV=new H,bV=new H;Zy.computeNormal=function(o){let f=o.indices,m=o.attributes,v=m.position.values,y=m.position.values.length/3,x=f.length,C=new Array(y),w=new Array(x/3),A=new Array(x),E;for(E=0;E0){for(T=0;T3&&(m[3]=0,m[4]=2,m[5]=3);let v=6;for(let y=3;yy?v>x?C=xe.sign(o.y):C=xe.sign(m.y):y>x?C=xe.sign(f.y):C=xe.sign(m.y);let w=C<0;AR(o,w),AR(f,w),AR(m,w)}var g5e=new H;function tw(o,f,m,v){H.add(o,H.multiplyByScalar(H.subtract(f,o,g5e),o.y/(o.y-f.y),g5e),m),H.clone(m,v),AR(m,!0),AR(v,!1)}var gF=new H,_F=new H,vF=new H,yF=new H,Ohe={positions:new Array(7),indices:new Array(3*3)};function fNt(o,f,m){if(o.x>=0||f.x>=0||m.x>=0)return;dNt(o,f,m);let v=o.y<0,y=f.y<0,x=m.y<0,C=0;C+=v?1:0,C+=y?1:0,C+=x?1:0;let w=Ohe.indices;C===1?(w[1]=3,w[2]=4,w[5]=6,w[7]=6,w[8]=5,v?(tw(o,f,gF,vF),tw(o,m,_F,yF),w[0]=0,w[3]=1,w[4]=2,w[6]=1):y?(tw(f,m,gF,vF),tw(f,o,_F,yF),w[0]=1,w[3]=2,w[4]=0,w[6]=2):x&&(tw(m,o,gF,vF),tw(m,f,_F,yF),w[0]=2,w[3]=0,w[4]=1,w[6]=0)):C===2&&(w[2]=4,w[4]=4,w[5]=3,w[7]=5,w[8]=6,v?y?x||(tw(m,o,gF,vF),tw(m,f,_F,yF),w[0]=0,w[1]=1,w[3]=0,w[6]=2):(tw(f,m,gF,vF),tw(f,o,_F,yF),w[0]=2,w[1]=0,w[3]=2,w[6]=1):(tw(o,f,gF,vF),tw(o,m,_F,yF),w[0]=1,w[1]=2,w[3]=1,w[6]=0));let A=Ohe.positions;return A[0]=o,A[1]=f,A[2]=m,A.length=3,(C===1||C===2)&&(A[3]=gF,A[4]=_F,A[5]=vF,A[6]=yF,A.length=7),Ohe}function _5e(o,f){let m=o.attributes;if(m.position.values.length===0)return;for(let y in m)if(m.hasOwnProperty(y)&&N(m[y])&&N(m[y].values)){let x=m[y];x.values=Rt.createTypedArray(x.componentDatatype,x.values)}let v=ga.computeNumberOfVertices(o);return o.indices=ro.createTypedArray(v,o.indices),f&&(o.boundingSphere=Pi.fromVertices(m.position.values)),o}function mH(o){let f=o.attributes,m={};for(let v in f)if(f.hasOwnProperty(v)&&N(f[v])&&N(f[v].values)){let y=f[v];m[v]=new en({componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize,values:[]})}return new ga({attributes:m,indices:[],primitiveType:o.primitiveType})}function $xe(o,f,m){let v=N(o.geometry.boundingSphere);f=_5e(f,v),m=_5e(m,v),N(m)&&!N(f)?o.geometry=m:!N(m)&&N(f)?o.geometry=f:(o.westHemisphereGeometry=f,o.eastHemisphereGeometry=m,o.geometry=void 0)}function eCe(o,f){let m=new o,v=new o,y=new o;return function(x,C,w,A,E,T,S,M){let I=o.fromArray(E,x*f,m),P=o.fromArray(E,C*f,v),D=o.fromArray(E,w*f,y);o.multiplyByScalar(I,A.x,I),o.multiplyByScalar(P,A.y,P),o.multiplyByScalar(D,A.z,D);let L=o.add(I,P,I);o.add(L,D,L),M&&o.normalize(L,L),o.pack(L,T,S*f)}}var pNt=eCe(Wt,4),B$=eCe(H,3),kje=eCe(Ye,2),mNt=function(o,f,m,v,y,x,C){let w=y[o]*v.x,A=y[f]*v.y,E=y[m]*v.z;x[C]=w+A+E>xe.EPSILON6?1:0},G7=new H,wme=new H,Ame=new H,gNt=new H;function AQ(o,f,m,v,y,x,C,w,A,E,T,S,M,I,P,D){if(!N(x)&&!N(C)&&!N(w)&&!N(A)&&!N(E)&&I===0)return;let L=H.fromArray(y,o*3,G7),R=H.fromArray(y,f*3,wme),O=H.fromArray(y,m*3,Ame),F=hre(v,L,R,O,gNt);if(N(F)){if(N(x)&&B$(o,f,m,F,x,S.normal.values,D,!0),N(E)){let k=H.fromArray(E,o*3,G7),U=H.fromArray(E,f*3,wme),G=H.fromArray(E,m*3,Ame);H.multiplyByScalar(k,F.x,k),H.multiplyByScalar(U,F.y,U),H.multiplyByScalar(G,F.z,G);let j;!H.equals(k,H.ZERO)||!H.equals(U,H.ZERO)||!H.equals(G,H.ZERO)?(j=H.add(k,U,k),H.add(j,G,j),H.normalize(j,j)):(j=G7,j.x=0,j.y=0,j.z=0),H.pack(j,S.extrudeDirection.values,D*3)}if(N(T)&&mNt(o,f,m,F,T,S.applyOffset.values,D),N(C)&&B$(o,f,m,F,C,S.tangent.values,D,!0),N(w)&&B$(o,f,m,F,w,S.bitangent.values,D,!0),N(A)&&kje(o,f,m,F,A,S.st.values,D),I>0)for(let k=0;k3){let z=ee.positions,ie=ee.indices,re=ie.length;for(let ne=0;ne0)continue;let A=H.unpack(v,C,Hje);(w.y<0&&A.y>0||w.y>0&&A.y<0)&&(C-3>0?(v[C]=m[C-3],v[C+1]=m[C-2],v[C+2]=m[C-1]):H.pack(w,v,C));let E=H.unpack(y,C,Eme);(w.y<0&&E.y>0||w.y>0&&E.y<0)&&(C+30||Pi.intersectPlane(m,$a.ORIGIN_ZX_PLANE)!==La.INTERSECTING))return o;if(f.geometryType!==NR.NONE)switch(f.geometryType){case NR.POLYLINES:TNt(o);break;case NR.TRIANGLES:v5e(o);break;case NR.LINES:y5e(o);break}else hNt(f),f.primitiveType===Fn.TRIANGLES?v5e(o):f.primitiveType===Fn.LINES&&y5e(o);return o};var Ju=Zy;function LW(o,f,m){o=Z(o,0),f=Z(f,0),m=Z(m,0),this.value=new Float32Array([o,f,m])}Object.defineProperties(LW.prototype,{componentDatatype:{get:function(){return Rt.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});LW.fromCartesian3=function(o){return new LW(o.x,o.y,o.z)};LW.toValue=function(o,f){return N(f)||(f=new Float32Array([o.x,o.y,o.z])),f[0]=o.x,f[1]=o.y,f[2]=o.z,f};var nm=LW;function SNt(o,f,m){let v=!m,y=o.length,x;if(!v&&y>1){let C=o[0].modelMatrix;for(x=1;x=0){let E=v[w];y=E.offset+E.count,C=E.index,x=m[C].indices.length}else y=0,C=0,x=m[C].indices.length;let A=o.length;for(let E=0;Ex&&(y=0,x=m[++C].indices.length),v.push({index:C,offset:y,count:S}),y+=S}}function MNt(o,f){let m=[];return Fhe(o,"geometry",f,m),Fhe(o,"westHemisphereGeometry",f,m),Fhe(o,"eastHemisphereGeometry",f,m),m}var xM={};xM.combineGeometry=function(o){let f,m,v=o.instances,y=v.length,x,C,w=!1;y>0&&(f=INt(o),f.length>0&&(m=Ju.createAttributeLocations(f[0]),o.createPickOffsets&&(x=MNt(v,f))),N(v[0].attributes)&&N(v[0].attributes.offset)&&(C=new Array(y),w=!0));let A=new Array(y),E=new Array(y);for(let T=0;T0&&(m.set(A.indices,C),C+=P)}return f.push(m.buffer),{stringTable:v,packedData:m}};xM.unpackCreateGeometryResults=function(o){let f=o.stringTable,m=o.packedData,v,y=new Array(m[0]),x=0,C=1;for(;C0){let O=I.length/P;for(R=ro.createTypedArray(O,M),v=0;v{f._completeLoad=(y,x,C)=>{this._error=C,this._state=x,y.afterRender.push(function(){if(f._ready=f._state===Zp.COMPLETE||f._state===Zp.FAILED,!N(C))return m(f),!0;v(C)})}}),this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0,this._heatMap=o.heatMap,this._scaleHeight=o.scaleHeight,this._frameBuffer=null,this._enableFrameBuffer=o.enableFrameBuffer}Object.defineProperties($f.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("Primitive.readyPromise","Primitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Primitive.ready to return true instead."),this._readyPromise}}});function VNt(o){let f=o.length,m=[],v=o[0].attributes,y;for(y in v)if(v.hasOwnProperty(y)&&N(v[y])){let x=v[y],C=!0;for(let w=1;w= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; gl_Position *= show; }`,`${v} ${y}`};function I5e(o,f){if(!o.compressVertices)return f;let m=f.search(/in\s+vec3\s+normal;/g)!==-1,v=f.search(/in\s+vec2\s+st;/g)!==-1;if(!m&&!v)return f;let y=f.search(/in\s+vec3\s+tangent;/g)!==-1,x=f.search(/in\s+vec3\s+bitangent;/g)!==-1,C=v&&m?2:1;C+=y||x?1:0;let w=C>1?`vec${C}`:"float",A="compressedAttributes",E=`in ${w} ${A};`,T="",S="";if(v){T+=`vec2 st; `;let P=C>1?`${A}.x`:A;S+=` st = czm_decompressTextureCoordinates(${P}); `}m&&y&&x?(T+=`vec3 normal; vec3 tangent; vec3 bitangent; `,S+=` czm_octDecode(${A}.${v?"yz":"xy"}, normal, tangent, bitangent); `):(m&&(T+=`vec3 normal; `,S+=` normal = czm_octDecode(${A}${C>1?`.${v?"y":"x"}`:""}); `),y&&(T+=`vec3 tangent; `,S+=` tangent = czm_octDecode(${A}.${v&&m?"z":"y"}); `),x&&(T+=`vec3 bitangent; `,S+=` bitangent = czm_octDecode(${A}.${v&&m?"z":"y"}); `));let M=f;M=M.replace(/in\s+vec3\s+normal;/g,""),M=M.replace(/in\s+vec2\s+st;/g,""),M=M.replace(/in\s+vec3\s+tangent;/g,""),M=M.replace(/in\s+vec3\s+bitangent;/g,""),M=Zr.replaceMain(M,"czm_non_compressed_main");let I=`void main() { ${S} czm_non_compressed_main(); }`;return[E,T,M,I].join(` `)}function qNt(o){let f=Zr.replaceMain(o,"czm_non_depth_clamp_main");return f+=`void main() { czm_non_depth_clamp_main(); gl_Position = czm_depthClamp(gl_Position);} `,f}function XNt(o){let f=Zr.replaceMain(o,"czm_non_depth_clamp_main");return f+=`void main() { czm_non_depth_clamp_main(); #if defined(LOG_DEPTH) czm_writeLogDepth(); #else czm_writeDepthClamp(); #endif } `,f}function M5e(o,f){let m=o.vertexAttributes}function JNt(o,f){return function(){return o[f]}}var Bhe=Math.max(pa.hardwareConcurrency-1,1),TQ,KNt=new tp("combineGeometry");function QNt(o,f){let m,v,y,x,C=o._instanceIds;if(o._state===Zp.READY){m=Array.isArray(o.geometryInstances)?o.geometryInstances:[o.geometryInstances];let w=o._numberOfInstances=m.length,A=[],E=[];for(y=0;y0){let D=new Float64Array(S);for(P=[D.buffer],x=0;x0?(o._recomputeBoundingSpheres=!0,o._state=Zp.COMBINED):W7(o,f,Zp.FAILED,void 0)}).catch(function(S){W7(o,f,Zp.FAILED,S)})}}function ZNt(o,f,m){if(N(o._heatMap)&&f.length===1){let v=[],y=S5.unpackCreateGeometryResults(f[0]),x=y[0].attributes;N(x.tangent)||delete x.tangent,N(x.bitangent)||delete x.bitangent,N(x.color)||delete x.color,y[0].attributes.position.values=tFt(o,y[0].attributes.position.values,m);let C=S5.packCreateGeometryResults(y,v);o._createGeometryResults=[C]}}var $Nt=new H,eFt=new H,ZL=new Mt;function tFt(o,f,m){let v=o._heatMap;m=Z(m,ki.WGS84);let y=$Nt,x=eFt;if(N(f)){let C=f.length,w=0;for(let A=0;A0?(o._recomputeBoundingSpheres=!0,o._state=Zp.COMBINED):W7(o,f,Zp.FAILED,void 0)}function rFt(o,f){let m=o._batchTableAttributeIndices.offset;if(!o._recomputeBoundingSpheres||!N(m)){o._recomputeBoundingSpheres=!1;return}let v,y=o._offsetInstanceExtend,x=o._instanceBoundingSpheres,C=x.length,w=o._tempBoundingSpheres;if(!N(w)){for(w=new Array(C),v=0;v0||Pi.intersectPlane(D,$a.ORIGIN_ZX_PLANE)!==La.INTERSECTING?A.push(D):(E.push(D),T.push(D))}let S=A[0],M=T[0],I=E[0];for(v=1;v0){if(Bo.maximumVertexTextureImageUnits===0)throw new sr("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(o)}if(this._state!==Zp.COMPLETE&&this._state!==Zp.COMBINED&&(this.asynchronous?QNt(this,o):iFt(this,o)),this._state===Zp.COMBINED&&(nFt(this,o),L5e(this,o),aFt(this,o)),!this.show||this._state!==Zp.COMPLETE)return;this._batchTableOffsetsUpdated||L5e(this,o),this._recomputeBoundingSpheres&&rFt(this,o);let m=this.appearance,v=m.material,y=!1,x=!1,C=!1;this._appearance!==m?(this._appearance=m,this._material=v,y=!0,x=!0):this._material!==v&&(this._material=v,x=!0);let w=this.depthFailAppearance,A=N(w)?w.material:void 0;this._depthFailAppearance!==w?(this._depthFailAppearance=w,this._depthFailMaterial=A,y=!0,x=!0):this._depthFailMaterial!==A&&(this._depthFailMaterial=A,x=!0);let E=this._appearance.isTranslucent();this._translucent!==E&&(this._translucent=E,y=!0),N(this._material)&&this._material.update(f);let T=m.closed&&E;if(y&&Z(this._createRenderStatesFunction,sFt)(this,f,m,T),x&&Z(this._createShaderProgramFunction,lFt)(this,o,m),this._enableFrameBuffer&&!N(this._frameBuffer)&&(y||x)){let S=o.context.canvas,M=S.clientWidth,I=S.clientHeight,P=E5e(o.context,M,I);this._frameBuffer=T5e(o.context,P.colorTexture,P.copyTexture),C=!0}if(this._enableFrameBuffer&&N(this._frameBuffer)){let S=o.context.canvas,M=S.clientWidth,I=S.clientHeight,P=this._frameBuffer.copyTexture;if(P.width!==M||P.height!==I){BNt(this._frameBuffer),kNt(this._frameBuffer);let D=E5e(o.context,M,I);this._frameBuffer=T5e(o.context,D.colorTexture,D.copyTexture),C=!0}}(y||x||C)&&Z(this._createCommandsFunction,uFt)(this,m,v,E,T,this._colorCommands,this._pickCommands,o),Z(this._updateAndQueueCommandsFunction,cFt)(this,o,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,T)};var hFt=new Pi,dFt=new Pi;function qje(o,f,m){if(m===yl.TOP){let v=Pi.clone(o,hFt),y=Pi.clone(o,dFt);y.center=H.add(y.center,f,y.center),o=Pi.union(v,y,o)}else m===yl.ALL&&(o.center=H.add(o.center,f,o.center));return o}function fFt(o,f,m){return function(){let v=o.getBatchedAttribute(f,m),y=o.attributes[m],x=y.componentsPerAttribute,C=Rt.createTypedArray(y.componentDatatype,x);return N(v.constructor.pack)?v.constructor.pack(v,C,0):C[0]=v,C}}function pFt(o,f,m,v,y){return function(x){let C=Gje(x);o.setBatchedAttribute(f,m,C),y==="offset"&&(v._recomputeBoundingSpheres=!0,v._batchTableOffsetsUpdated=!1)}}var mFt=new H;function gFt(o,f,m){f.boundingSphere={get:function(){let v=o._instanceBoundingSpheres[m];if(N(v)){v=v.clone();let y=o.modelMatrix,x=f.offset;N(x)&&qje(v,H.fromArray(x.get(),0,mFt),o._offsetInstanceExtend[m]),N(y)&&(v=Pi.transform(v,y))}return v}},f.boundingSphereCV={get:function(){return o._instanceBoundingSpheresCV[m]}}}function _Ft(o,f,m){f.pickId={get:function(){return o._pickIds[m]}}}$f.prototype.getGeometryInstanceAttributes=function(o){let f=this._perInstanceAttributeCache.get(o);if(N(f))return f;let m=-1,v=this._lastPerInstanceAttributeIndex,y=this._instanceIds,x=y.length;for(let E=0;E{m._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let x=this._error;N(x)?y(x):v(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=N5e(!1),this._renderState3DTiles=N5e(!0),this._renderStateMorph=Mn.fromCache({cull:{enabled:!0,face:uh.FRONT},depthTest:{enabled:!0},blending:Mu.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(CM.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});CM.initializeTerrainHeights=function(){return zh.initialize()};function xFt(o,f,m){let v=f.context,y=o._primitive,x=y._attributeLocations,C=y._batchTable.getVertexShaderCallback()(qxe);C=Ia._appendShowToShader(y,C),C=Ia._appendDistanceDisplayConditionToShader(y,C),C=Ia._modifyShaderPosition(o,C,f.scene3DOnly);let w=y._batchTable.getVertexShaderCallback()(Yxe);w=Ia._appendShowToShader(y,w),w=Ia._appendDistanceDisplayConditionToShader(y,w),w=Ia._modifyShaderPosition(o,w,f.scene3DOnly);let A=y._batchTable.getVertexShaderCallback()(Wxe),E=[`GLOBE_MINIMUM_ALTITUDE ${f.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],T="",S="";N(m.material)?(S=N(m.material)?m.material.shaderSource:"",S.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&E.push("ANGLE_VARYING"),S.search(/in\s+float\s+v_width;/g)!==-1&&E.push("WIDTH_VARYING")):T="PER_INSTANCE_COLOR",E.push(T);let M=o.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",T]:[T],I=new Zr({defines:E,sources:[C]}),P=new Zr({defines:M,sources:[S,A]});o._sp=Rs.replaceCache({context:v,shaderProgram:y._sp,vertexShaderSource:I,fragmentShaderSource:P,attributeLocations:x});let D=v.shaderCache.getDerivedShaderProgram(o._sp,"2dColor");if(!N(D)){let R=new Zr({defines:E.concat(["COLUMBUS_VIEW_2D"]),sources:[C]});D=v.shaderCache.createDerivedShaderProgram(o._sp,"2dColor",{context:v,shaderProgram:o._sp2D,vertexShaderSource:R,fragmentShaderSource:P,attributeLocations:x})}o._sp2D=D;let L=v.shaderCache.getDerivedShaderProgram(o._sp,"MorphColor");if(!N(L)){let R=new Zr({defines:E.concat([`MAX_TERRAIN_HEIGHT ${zh._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[w]});A=y._batchTable.getVertexShaderCallback()(jxe);let O=new Zr({defines:M,sources:[S,A]});L=v.shaderCache.createDerivedShaderProgram(o._sp,"MorphColor",{context:v,shaderProgram:o._spMorph,vertexShaderSource:R,fragmentShaderSource:O,attributeLocations:x})}o._spMorph=L}function N5e(o){return Mn.fromCache({cull:{enabled:!0},blending:Mu.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:o,frontFunction:dc.EQUAL,frontOperation:{fail:No.KEEP,zFail:No.KEEP,zPass:No.KEEP},backFunction:dc.EQUAL,backOperation:{fail:No.KEEP,zFail:No.KEEP,zPass:No.KEEP},reference:Ua.CESIUM_3D_TILE_MASK,mask:Ua.CESIUM_3D_TILE_MASK}})}function CFt(o,f,m,v,y,x){let C=o._primitive,w=C._va.length;y.length=w,x.length=w;let A=f instanceof tm?{}:m._uniforms,E=C._batchTable.getUniformMapCallback()(A);for(let T=0;T{!this._ready&&N(this._primitive)&&this._primitive.ready&&this._completeLoad()})};CM.prototype.getGeometryInstanceAttributes=function(o){return this._primitive.getGeometryInstanceAttributes(o)};CM.isSupported=function(o){return o.frameState.context.depthTexture};CM.prototype.isDestroyed=function(){return!1};CM.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,kr(this)};var aO=CM;function jy(o,f,m){this.minimum=H.clone(Z(o,H.ZERO)),this.maximum=H.clone(Z(f,H.ZERO)),N(m)?m=H.clone(m):m=H.midpoint(this.minimum,this.maximum,new H),this.center=m}jy.fromCorners=function(o,f,m){return N(m)||(m=new jy),m.minimum=H.clone(o,m.minimum),m.maximum=H.clone(f,m.maximum),m.center=H.midpoint(o,f,m.center),m};jy.fromPoints=function(o,f){if(N(f)||(f=new jy),!N(o)||o.length===0)return f.minimum=H.clone(H.ZERO,f.minimum),f.maximum=H.clone(H.ZERO,f.maximum),f.center=H.clone(H.ZERO,f.center),f;let m=o[0].x,v=o[0].y,y=o[0].z,x=o[0].x,C=o[0].y,w=o[0].z,A=o.length;for(let S=1;S0?La.INSIDE:x+y<0?La.OUTSIDE:La.INTERSECTING};jy.prototype.clone=function(o){return jy.clone(this,o)};jy.prototype.intersectPlane=function(o){return jy.intersectPlane(this,o)};jy.prototype.equals=function(o){return jy.equals(this,o)};var _Y=jy,Vhe=new Wt;function x2(o,f){f=Z(f,ki.WGS84),o=f.scaleToGeodeticSurface(o);let m=tn.eastNorthUpToFixedFrame(o,f);this._ellipsoid=f,this._origin=o,this._xAxis=H.fromCartesian4(Ee.getColumn(m,0,Vhe)),this._yAxis=H.fromCartesian4(Ee.getColumn(m,1,Vhe));let v=H.fromCartesian4(Ee.getColumn(m,2,Vhe));this._plane=$a.fromPointNormal(o,v)}Object.defineProperties(x2.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var wFt=new _Y;x2.fromPoints=function(o,f){let m=_Y.fromPoints(o,wFt);return new x2(m.center,f)};var Xje=new _s,Oee=new H;x2.prototype.projectPointOntoPlane=function(o,f){let m=Xje;m.origin=o,H.normalize(o,m.direction);let v=Hh.rayPlane(m,this._plane,Oee);if(N(v)||(H.negate(m.direction,m.direction),v=Hh.rayPlane(m,this._plane,Oee)),N(v)){let y=H.subtract(v,this._origin,v),x=H.dot(this._xAxis,y),C=H.dot(this._yAxis,y);return N(f)?(f.x=x,f.y=C,f):new Ye(x,C)}};x2.prototype.projectPointsOntoPlane=function(o,f){N(f)||(f=[]);let m=0,v=o.length;for(let y=0;y0?0:G.latitude,Y=Mt.fromRadians(J,o.north,m,NFt),Q=Mt.fromRadians(o.west,o.north,m,FFt),ee=Mt.fromRadians(o.west,X,m,BFt),z=Mt.fromRadians(o.west,o.south,m,kFt),ie=Mt.fromRadians(J,o.south,m,VFt),re=v.cartographicToCartesian(Y,zFt),ne=v.cartographicToCartesian(Q,V5e),oe=v.cartographicToCartesian(ee,HFt),se=v.cartographicToCartesian(z,z5e),ae=v.cartographicToCartesian(ie,UFt),fe=q.projectPointToNearestOnPlane(re,GFt),de=q.projectPointToNearestOnPlane(ne,WFt),ve=q.projectPointToNearestOnPlane(oe,jFt),pe=q.projectPointToNearestOnPlane(se,YFt),ce=q.projectPointToNearestOnPlane(ae,qFt);return x=Math.min(de.x,ve.x,pe.x),C=-x,A=Math.max(de.y,fe.y),w=Math.min(pe.y,ce.y),Q.height=z.height=f,ne=v.cartographicToCartesian(Q,V5e),se=v.cartographicToCartesian(z,z5e),E=Math.min($a.getPointDistance(S,ne),$a.getPointDistance(S,se)),T=m,B5e(q.origin,q.xAxis,q.yAxis,q.zAxis,x,C,w,A,E,T,y)}let M=o.south>0,I=o.north<0,P=M?o.south:I?o.north:0,D=Di.center(o,k5e).longitude,L=H.fromRadians(D,P,m,v,XFt);L.z=0;let R=Math.abs(L.x)=A?La.INSIDE:La.INTERSECTING};var Kje=new H,Qje=new H,Zje=new H,r5t=new H,H5e=new H,n5t=new H;wc.distanceSquaredTo=function(o,f){let m=H.subtract(f,o.center,Jje),v=o.halfAxes,y=Ut.getColumn(v,0,Kje),x=Ut.getColumn(v,1,Qje),C=Ut.getColumn(v,2,Zje),w=H.magnitude(y),A=H.magnitude(x),E=H.magnitude(C),T=!0,S=!0,M=!0;w>0?H.divideByScalar(y,w,y):T=!1,A>0?H.divideByScalar(x,A,x):S=!1,E>0?H.divideByScalar(C,E,C):M=!1;let I=!T+!S+!M,P,D,L;if(I===1){let k=y;P=x,D=C,S?M||(k=C,D=y):(k=x,P=y),L=H.cross(P,D,H5e),k===y?y=L:k===x?x=L:k===C&&(C=L)}else if(I===2){P=y,S?P=x:M&&(P=C);let k=H.UNIT_Y;k.equalsEpsilon(P,xe.EPSILON3)&&(k=H.UNIT_X),D=H.cross(P,k,r5t),H.normalize(D,D),L=H.cross(P,D,H5e),H.normalize(L,L),P===y?(x=D,C=L):P===x?(C=D,y=L):P===C&&(y=D,x=L)}else I===3&&(y=H.UNIT_X,x=H.UNIT_Y,C=H.UNIT_Z);let R=n5t;R.x=H.dot(m,y),R.y=H.dot(m,x),R.z=H.dot(m,C);let O=0,F;return R.x<-w?(F=R.x+w,O+=F*F):R.x>w&&(F=R.x-w,O+=F*F),R.y<-A?(F=R.y+A,O+=F*F):R.y>A&&(F=R.y-A,O+=F*F),R.z<-E?(F=R.z+E,O+=F*F):R.z>E&&(F=R.z-E,O+=F*F),O};var o5t=new H,a5t=new H;wc.computePlaneDistances=function(o,f,m,v){N(v)||(v=new t2);let y=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,C=o.center,w=o.halfAxes,A=Ut.getColumn(w,0,Kje),E=Ut.getColumn(w,1,Qje),T=Ut.getColumn(w,2,Zje),S=H.add(A,E,o5t);H.add(S,T,S),H.add(S,C,S);let M=H.subtract(S,f,a5t),I=H.dot(m,M);return y=Math.min(I,y),x=Math.max(I,x),H.add(C,A,S),H.add(S,E,S),H.subtract(S,T,S),H.subtract(S,f,M),I=H.dot(m,M),y=Math.min(I,y),x=Math.max(I,x),H.add(C,A,S),H.subtract(S,E,S),H.add(S,T,S),H.subtract(S,f,M),I=H.dot(m,M),y=Math.min(I,y),x=Math.max(I,x),H.add(C,A,S),H.subtract(S,E,S),H.subtract(S,T,S),H.subtract(S,f,M),I=H.dot(m,M),y=Math.min(I,y),x=Math.max(I,x),H.subtract(C,A,S),H.add(S,E,S),H.add(S,T,S),H.subtract(S,f,M),I=H.dot(m,M),y=Math.min(I,y),x=Math.max(I,x),H.subtract(C,A,S),H.add(S,E,S),H.subtract(S,T,S),H.subtract(S,f,M),I=H.dot(m,M),y=Math.min(I,y),x=Math.max(I,x),H.subtract(C,A,S),H.subtract(S,E,S),H.add(S,T,S),H.subtract(S,f,M),I=H.dot(m,M),y=Math.min(I,y),x=Math.max(I,x),H.subtract(C,A,S),H.subtract(S,E,S),H.subtract(S,T,S),H.subtract(S,f,M),I=H.dot(m,M),y=Math.min(I,y),x=Math.max(I,x),v.start=y,v.stop=x,v};var s5t=new H,l5t=new H,u5t=new H;wc.computeCorners=function(o,f){N(f)||(f=[new H,new H,new H,new H,new H,new H,new H,new H]);let m=o.center,v=o.halfAxes,y=Ut.getColumn(v,0,s5t),x=Ut.getColumn(v,1,l5t),C=Ut.getColumn(v,2,u5t);return H.clone(m,f[0]),H.subtract(f[0],y,f[0]),H.subtract(f[0],x,f[0]),H.subtract(f[0],C,f[0]),H.clone(m,f[1]),H.subtract(f[1],y,f[1]),H.subtract(f[1],x,f[1]),H.add(f[1],C,f[1]),H.clone(m,f[2]),H.subtract(f[2],y,f[2]),H.add(f[2],x,f[2]),H.subtract(f[2],C,f[2]),H.clone(m,f[3]),H.subtract(f[3],y,f[3]),H.add(f[3],x,f[3]),H.add(f[3],C,f[3]),H.clone(m,f[4]),H.add(f[4],y,f[4]),H.subtract(f[4],x,f[4]),H.subtract(f[4],C,f[4]),H.clone(m,f[5]),H.add(f[5],y,f[5]),H.subtract(f[5],x,f[5]),H.add(f[5],C,f[5]),H.clone(m,f[6]),H.add(f[6],y,f[6]),H.add(f[6],x,f[6]),H.subtract(f[6],C,f[6]),H.clone(m,f[7]),H.add(f[7],y,f[7]),H.add(f[7],x,f[7]),H.add(f[7],C,f[7]),f};var c5t=new Ut;wc.computeTransformation=function(o,f){N(f)||(f=new Ee);let m=o.center,v=Ut.multiplyByUniformScale(o.halfAxes,2,c5t);return Ee.fromRotationTranslation(v,m,f)};var h5t=new Pi;wc.isOccluded=function(o,f){let m=Pi.fromOrientedBoundingBox(o,h5t);return!f.isBoundingSphereVisible(m)};wc.prototype.intersectPlane=function(o){return wc.intersectPlane(this,o)};wc.prototype.distanceSquaredTo=function(o){return wc.distanceSquaredTo(this,o)};wc.prototype.computePlaneDistances=function(o,f,m){return wc.computePlaneDistances(this,o,f,m)};wc.prototype.computeCorners=function(o){return wc.computeCorners(this,o)};wc.prototype.computeTransformation=function(o){return wc.computeTransformation(this,o)};wc.prototype.isOccluded=function(o){return wc.isOccluded(this,o)};wc.equals=function(o,f){return o===f||N(o)&&N(f)&&H.equals(o.center,f.center)&&Ut.equals(o.halfAxes,f.halfAxes)};wc.prototype.clone=function(o){return wc.clone(this,o)};wc.prototype.equals=function(o){return wc.equals(this,o)};var fc=wc,Nee={};Nee.getHeight=function(o,f,m){return(o-m)*f+m};var d5t=new H;Nee.getPosition=function(o,f,m,v,y){let x=f.cartesianToCartographic(o,d5t),C=Nee.getHeight(x.height,m,v);return H.fromRadians(x.longitude,x.latitude,C,f,y)};var V1=Nee;function gH(o,f,m,v){o=Z(o,1),f=Z(f,1),m=Z(m,1),v=Z(v,1),this.value=new Uint8Array([Re.floatToByte(o),Re.floatToByte(f),Re.floatToByte(m),Re.floatToByte(v)])}Object.defineProperties(gH.prototype,{componentDatatype:{get:function(){return Rt.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});gH.fromColor=function(o){return new gH(o.red,o.green,o.blue,o.alpha)};gH.toValue=function(o,f){return N(f)?o.toBytes(f):new Uint8Array(o.toBytes())};gH.equals=function(o,f){return o===f||N(o)&&N(f)&&o.value[0]===f.value[0]&&o.value[1]===f.value[1]&&o.value[2]===f.value[2]&&o.value[3]===f.value[3]};var ea=gH,tCe=`in vec3 position3DHigh; in vec3 position3DLow; in float batchId; #ifdef EXTRUDED_GEOMETRY in vec3 extrudeDirection; uniform float u_globeMinimumAltitude; #endif // EXTRUDED_GEOMETRY #ifdef PER_INSTANCE_COLOR out vec4 v_color; #endif // PER_INSTANCE_COLOR #ifdef TEXTURE_COORDINATES #ifdef SPHERICAL out vec4 v_sphericalExtents; #else // SPHERICAL out vec2 v_inversePlaneExtents; out vec4 v_westPlane; out vec4 v_southPlane; #endif // SPHERICAL out vec3 v_uvMinAndSphericalLongitudeRotation; out vec3 v_uMaxAndInverseDistance; out vec3 v_vMaxAndInverseDistance; #endif // TEXTURE_COORDINATES void main() { vec4 position = czm_computePosition(); #ifdef EXTRUDED_GEOMETRY float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz)); delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0; //extrudeDirection is zero for the top layer position = position + vec4(extrudeDirection * delta, 0.0); #endif #ifdef TEXTURE_COORDINATES #ifdef SPHERICAL v_sphericalExtents = czm_batchTable_sphericalExtents(batchId); v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId); #else // SPHERICAL #ifdef COLUMBUS_VIEW_2D vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId); vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId); // If the primitive is split across the IDL (planes2D_high.x > planes2D_high.w): // - If this vertex is on the east side of the IDL (position3DLow.y > 0.0, comparison with position3DHigh may produce artifacts) // - existing "east" is on the wrong side of the world, far away (planes2D_high/low.w) // - so set "east" as beyond the eastmost extent of the projection (idlSplitNewPlaneHiLow) vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w)); bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0; planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w); planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w); // - else, if this vertex is on the west side of the IDL (position3DLow.y < 0.0) // - existing "west" is on the wrong side of the world, far away (planes2D_high/low.x) // - so set "west" as beyond the westmost extent of the projection (idlSplitNewPlaneHiLow) idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0; idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x)); planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x); planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x); vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz; vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz; vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz; #else // COLUMBUS_VIEW_2D // 3D case has smaller "plane extents," so planes encoded as a 64 bit position and 2 vec3s for distances/direction vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz; vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner; vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner; #endif // COLUMBUS_VIEW_2D vec3 eastWard = southEastCorner - southWestCorner; float eastExtent = length(eastWard); eastWard /= eastExtent; vec3 northWard = northWestCorner - southWestCorner; float northExtent = length(northWard); northWard /= northExtent; v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner)); v_southPlane = vec4(northWard, -dot(northWard, southWestCorner)); v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent); #endif // SPHERICAL vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId); vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId); v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z); v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w); v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy; #endif // TEXTURE_COORDINATES #ifdef PER_INSTANCE_COLOR v_color = czm_batchTable_color(batchId); #endif gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); } `,RW=`#ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif void main(void) { #ifdef VECTOR_TILE out_FragColor = czm_gammaCorrect(u_highlightColor); #else out_FragColor = vec4(1.0); #endif czm_writeDepthClamp(); } `,iCe=`in vec3 v_positionEC; in vec3 v_normalEC; in vec4 v_color; void main() { vec3 positionToEyeEC = -v_positionEC; vec3 normalEC = normalize(v_normalEC); #ifdef FACE_FORWARD normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); #endif vec4 color = czm_gammaCorrect(v_color); czm_materialInput materialInput; materialInput.normalEC = normalEC; materialInput.positionToEyeEC = positionToEyeEC; czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; material.alpha = color.a; out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); } `,rCe=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 normal; in vec4 color; in float batchId; out vec3 v_positionEC; out vec3 v_normalEC; out vec4 v_color; void main() { vec4 p = czm_computePosition(); v_positionEC = (czm_modelViewRelativeToEye * p).xyz; // position in eye coordinates v_normalEC = czm_normal * normal; // normal in eye coordinates v_color = color; gl_Position = czm_modelViewProjectionRelativeToEye * p; } `,nCe=`in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; in float batchId; out vec4 v_color; void main() { vec4 p = czm_computePosition(); v_color = color; gl_Position = czm_modelViewProjectionRelativeToEye * p; } `;function bM(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.translucent,!0),m=Z(o.closed,!1),v=Z(o.flat,!1),y=v?nCe:rCe,x=v?lre:iCe,C=v?bM.FLAT_VERTEX_FORMAT:bM.VERTEX_FORMAT;this.material=void 0,this.translucent=f,this._vertexShaderSource=Z(o.vertexShaderSource,y),this._fragmentShaderSource=Z(o.fragmentShaderSource,x),this._renderState=md.getDefaultRenderState(f,m,o.renderState),this._closed=m,this._vertexFormat=C,this._flat=v,this._faceForward=Z(o.faceForward,!m)}Object.defineProperties(bM.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});bM.VERTEX_FORMAT=un.POSITION_AND_NORMAL;bM.FLAT_VERTEX_FORMAT=un.POSITION_ONLY;bM.prototype.getFragmentShaderSource=md.prototype.getFragmentShaderSource;bM.prototype.isTranslucent=md.prototype.isTranslucent;bM.prototype.getRenderState=md.prototype.getRenderState;var ms=bM,dre=`#ifdef TEXTURE_COORDINATES #ifdef SPHERICAL in vec4 v_sphericalExtents; #else // SPHERICAL in vec2 v_inversePlaneExtents; in vec4 v_westPlane; in vec4 v_southPlane; #endif // SPHERICAL in vec3 v_uvMinAndSphericalLongitudeRotation; in vec3 v_uMaxAndInverseDistance; in vec3 v_vMaxAndInverseDistance; #endif // TEXTURE_COORDINATES #ifdef PER_INSTANCE_COLOR in vec4 v_color; #endif #ifdef NORMAL_EC vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) { vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth); return eyeCoordinate.xyz / eyeCoordinate.w; } vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) { vec2 glFragCoordXY = gl_FragCoord.xy; // Sample depths at both offset and negative offset float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw)); float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw)); // Explicitly evaluate both paths // Necessary for multifrustum and for edges of the screen bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw); float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y); float useDownOrLeft = float(useUpOrRight == 0.0); vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth); vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth); return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft; } #endif // NORMAL_EC void main(void) { #ifdef REQUIRES_EC float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)); vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); #endif #ifdef REQUIRES_WC vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate; vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w; #endif #ifdef TEXTURE_COORDINATES vec2 uv; #ifdef SPHERICAL // Treat world coords as a sphere normal for spherical coordinates vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate); sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z; sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi); uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w; uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z; #else // SPHERICAL // Unpack planes and transform to eye space uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x; uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y; #endif // SPHERICAL #endif // TEXTURE_COORDINATES #ifdef PICK #ifdef CULL_FRAGMENTS // When classifying translucent geometry, logDepthOrDepth == 0.0 // indicates a region that should not be classified, possibly due to there // being opaque pixels there in another buffer. // Check for logDepthOrDepth != 0.0 to make sure this should be classified. if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) { out_FragColor.a = 1.0; // 0.0 alpha leads to discard from ShaderSource.createPickFragmentShaderSource czm_writeDepthClamp(); } #else // CULL_FRAGMENTS out_FragColor.a = 1.0; #endif // CULL_FRAGMENTS #else // PICK #ifdef CULL_FRAGMENTS // When classifying translucent geometry, logDepthOrDepth == 0.0 // indicates a region that should not be classified, possibly due to there // being opaque pixels there in another buffer. if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) { discard; } #endif #ifdef NORMAL_EC // Compute normal by sampling adjacent pixels in 2x2 block in screen space vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0)); vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0)); vec3 normalEC = normalize(cross(leftRight, downUp)); #endif #ifdef PER_INSTANCE_COLOR vec4 color = czm_gammaCorrect(v_color); #ifdef FLAT out_FragColor = color; #else // FLAT czm_materialInput materialInput; materialInput.normalEC = normalEC; materialInput.positionToEyeEC = -eyeCoordinate.xyz; czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; material.alpha = color.a; out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); #endif // FLAT // Premultiply alpha. Required for classification primitives on translucent globe. out_FragColor.rgb *= out_FragColor.a; #else // PER_INSTANCE_COLOR // Material support. // USES_ is distinct from REQUIRES_, because some things are dependencies of each other or // dependencies for culling but might not actually be used by the material. czm_materialInput materialInput; #ifdef USES_NORMAL_EC materialInput.normalEC = normalEC; #endif #ifdef USES_POSITION_TO_EYE_EC materialInput.positionToEyeEC = -eyeCoordinate.xyz; #endif #ifdef USES_TANGENT_TO_EYE materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC); #endif #ifdef USES_ST // Remap texture coordinates from computed (approximately aligned with cartographic space) to the desired // texture coordinate system, which typically forms a tight oriented bounding box around the geometry. // Shader is provided a set of reference points for remapping. materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z; materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z; #endif czm_material material = czm_getMaterial(materialInput); #ifdef FLAT out_FragColor = vec4(material.diffuse + material.emission, material.alpha); #else // FLAT out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC); #endif // FLAT // Premultiply alpha. Required for classification primitives on translucent globe. out_FragColor.rgb *= out_FragColor.a; #endif // PER_INSTANCE_COLOR czm_writeDepthClamp(); #endif // PICK } `;function Qw(o,f,m){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let v=new Tme;v.requiresTextureCoordinates=o,v.requiresEC=!m.flat;let y=new Tme;if(y.requiresTextureCoordinates=o,m instanceof ms)v.requiresNormalEC=!m.flat;else{let x=`${m.material.shaderSource} ${m.fragmentShaderSource}`;v.normalEC=x.indexOf("materialInput.normalEC")!==-1||x.indexOf("czm_getDefaultMaterial")!==-1,v.positionToEyeEC=x.indexOf("materialInput.positionToEyeEC")!==-1,v.tangentToEyeMatrix=x.indexOf("materialInput.tangentToEyeMatrix")!==-1,v.st=x.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=v,this._pickShaderDependencies=y,this._appearance=m,this._extentsCulling=o,this._planarExtents=f}Qw.prototype.createFragmentShader=function(o){let f=this._appearance,m=this._colorShaderDependencies,v=[];!o&&!this._planarExtents&&v.push("SPHERICAL"),m.requiresEC&&v.push("REQUIRES_EC"),m.requiresWC&&v.push("REQUIRES_WC"),m.requiresTextureCoordinates&&v.push("TEXTURE_COORDINATES"),this._extentsCulling&&v.push("CULL_FRAGMENTS"),m.requiresNormalEC&&v.push("NORMAL_EC"),f instanceof ms&&v.push("PER_INSTANCE_COLOR"),m.normalEC&&v.push("USES_NORMAL_EC"),m.positionToEyeEC&&v.push("USES_POSITION_TO_EYE_EC"),m.tangentToEyeMatrix&&v.push("USES_TANGENT_TO_EYE"),m.st&&v.push("USES_ST"),f.flat&&v.push("FLAT");let y="";return f instanceof ms||(y=f.material.shaderSource),new Zr({defines:v,sources:[y,dre]})};Qw.prototype.createPickFragmentShader=function(o){let f=this._pickShaderDependencies,m=["PICK"];return!o&&!this._planarExtents&&m.push("SPHERICAL"),f.requiresEC&&m.push("REQUIRES_EC"),f.requiresWC&&m.push("REQUIRES_WC"),f.requiresTextureCoordinates&&m.push("TEXTURE_COORDINATES"),this._extentsCulling&&m.push("CULL_FRAGMENTS"),new Zr({defines:m,sources:[dre],pickColorQualifier:"in"})};Qw.prototype.createVertexShader=function(o,f,m,v){return $je(this._colorShaderDependencies,this._planarExtents,m,o,f,this._appearance,v,this._projectionExtentDefines)};Qw.prototype.createPickVertexShader=function(o,f,m,v){return $je(this._pickShaderDependencies,this._planarExtents,m,o,f,void 0,v,this._projectionExtentDefines)};var U5e=new H,G5e=new Mt,W5e={high:0,low:0};function $je(o,f,m,v,y,x,C,w){let A=v.slice();if(w.eastMostYhighDefine===""){let E=G5e;E.longitude=xe.PI,E.latitude=0,E.height=0;let T=C.project(E,U5e),S=Qu.encode(T.x,W5e);w.eastMostYhighDefine=`EAST_MOST_X_HIGH ${S.high.toFixed(`${S.high}`.length+1)}`,w.eastMostYlowDefine=`EAST_MOST_X_LOW ${S.low.toFixed(`${S.low}`.length+1)}`;let M=G5e;M.longitude=-xe.PI,M.latitude=0,M.height=0;let I=C.project(M,U5e);S=Qu.encode(I.x,W5e),w.westMostYhighDefine=`WEST_MOST_X_HIGH ${S.high.toFixed(`${S.high}`.length+1)}`,w.westMostYlowDefine=`WEST_MOST_X_LOW ${S.low.toFixed(`${S.low}`.length+1)}`}return m&&(A.push(w.eastMostYhighDefine),A.push(w.eastMostYlowDefine),A.push(w.westMostYhighDefine),A.push(w.westMostYlowDefine)),N(x)&&x instanceof ms&&A.push("PER_INSTANCE_COLOR"),o.requiresTextureCoordinates&&(A.push("TEXTURE_COORDINATES"),f||m||A.push("SPHERICAL"),m&&A.push("COLUMBUS_VIEW_2D")),new Zr({defines:A,sources:[y]})}function Tme(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(Tme.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(o){this._requiresEC=o||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(o){this._requiresWC=o||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(o){this._requiresNormalEC=o||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(o){this._requiresTextureCoordinates=o||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(o){this.requiresNormalEC=o,this._usesNormalEC=o},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(o){this.requiresWC=o,this.requiresNormalEC=o,this._usesTangentToEyeMat=o},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(o){this.requiresEC=o,this._usesPositionToEyeEC=o},get:function(){return this._usesPositionToEyeEC}},st:{set:function(o){this.requiresTextureCoordinates=o,this._usesSt=o},get:function(){return this._usesSt}}});function j5e(o,f,m){return Math.abs((f.y-o.y)*m.x-(f.x-o.x)*m.y+f.x*o.y-f.y*o.x)/Ye.distance(f,o)}var f5t=[new Ye,new Ye,new Ye,new Ye];function eYe(o,f){let m=f5t,v=Ye.unpack(f,0,m[0]),y=Ye.unpack(f,2,m[1]),x=Ye.unpack(f,4,m[2]);o.uMaxVmax=new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:4,normalize:!1,value:[y.x,y.y,x.x,x.y]});let C=1/j5e(v,y,x),w=1/j5e(v,x,y);o.uvMinAndExtents=new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:4,normalize:!1,value:[v.x,v.y,C,w]})}var tYe=new Mt,iYe=new H,p5t=new H,m5t=new H,PQ={high:0,low:0};function rYe(o,f,m){let v=tYe;v.height=0,v.longitude=o.west,v.latitude=o.south;let y=f.project(v,iYe);v.latitude=o.north;let x=f.project(v,p5t);v.longitude=o.east,v.latitude=o.south;let C=f.project(v,m5t),w=[0,0,0,0],A=[0,0,0,0],E=Qu.encode(y.x,PQ);w[0]=E.high,A[0]=E.low,E=Qu.encode(y.y,PQ),w[1]=E.high,A[1]=E.low,E=Qu.encode(x.y,PQ),w[2]=E.high,A[2]=E.low,E=Qu.encode(C.x,PQ),w[3]=E.high,A[3]=E.low,m.planes2D_HIGH=new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:4,normalize:!1,value:w}),m.planes2D_LOW=new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:4,normalize:!1,value:A})}var g5t=new Ee,_5t=new Ee,Y5e=new H,v5t=new Mt,y5t=[new Mt,new Mt,new Mt,new Mt,new Mt,new Mt,new Mt,new Mt];function x5t(o,f,m,v,y,x){let C=Di.center(o,v5t);C.height=m;let w=Mt.toCartesian(C,f,Y5e),A=tn.eastNorthUpToFixedFrame(w,f,g5t),E=Ee.inverse(A,_5t),T=o.west,S=o.east,M=o.north,I=o.south,P=y5t;P[0].latitude=I,P[0].longitude=T,P[1].latitude=M,P[1].longitude=T,P[2].latitude=M,P[2].longitude=S,P[3].latitude=I,P[3].longitude=S;let D=(T+S)*.5,L=(M+I)*.5;P[4].latitude=I,P[4].longitude=D,P[5].latitude=M,P[5].longitude=D,P[6].latitude=L,P[6].longitude=T,P[7].latitude=L,P[7].longitude=S;let R=Number.POSITIVE_INFINITY,O=Number.NEGATIVE_INFINITY,F=Number.POSITIVE_INFINITY,k=Number.NEGATIVE_INFINITY;for(let q=0;q<8;q++){P[q].height=m;let J=Mt.toCartesian(P[q],f,Y5e);Ee.multiplyByPoint(E,J,J),J.z=0,R=Math.min(R,J.x),O=Math.max(O,J.x),F=Math.min(F,J.y),k=Math.max(k,J.y)}let U=v;U.x=R,U.y=F,U.z=0,Ee.multiplyByPoint(A,U,U);let G=y;G.x=O,G.y=F,G.z=0,Ee.multiplyByPoint(A,G,G),H.subtract(G,U,y);let j=x;j.x=R,j.y=k,j.z=0,Ee.multiplyByPoint(A,j,j),H.subtract(j,U,x)}var C5t=new H,b5t=new H,w5t=new Qu;Qw.getPlanarTextureCoordinateAttributes=function(o,f,m,v,y){let x=iYe,C=C5t,w=b5t;x5t(o,m,Z(y,0),x,C,w);let A={};eYe(A,f);let E=Qu.fromCartesian(x,w5t);return A.southWest_HIGH=new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,normalize:!1,value:H.pack(E.high,[0,0,0])}),A.southWest_LOW=new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,normalize:!1,value:H.pack(E.low,[0,0,0])}),A.eastward=new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,normalize:!1,value:H.pack(C,[0,0,0])}),A.northward=new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,normalize:!1,value:H.pack(w,[0,0,0])}),rYe(o,v,A),A};var A5t=new H;function q5e(o,f,m,v){let y=tYe;y.latitude=o,y.longitude=f,y.height=0;let x=Mt.toCartesian(y,m,A5t),C=Math.sqrt(x.x*x.x+x.y*x.y),w=xe.fastApproximateAtan2(C,x.z),A=xe.fastApproximateAtan2(x.x,x.y);return v.x=w,v.y=A,v}var X5e=new Ye;Qw.getSphericalExtentGeometryInstanceAttributes=function(o,f,m,v){let y=q5e(o.south,o.west,m,X5e),x=y.x,C=y.y,w=q5e(o.north,o.east,m,X5e),A=w.x,E=w.y,T=0;C>E&&(T=xe.PI-C,C=-xe.PI,E+=T),x-=xe.EPSILON5,C-=xe.EPSILON5,A+=xe.EPSILON5,E+=xe.EPSILON5;let S=1/(E-C),M=1/(A-x),I={sphericalExtents:new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:4,normalize:!1,value:[x,C,M,S]}),longitudeRotation:new L1({componentDatatype:Rt.FLOAT,componentsPerAttribute:1,normalize:!1,value:[T]})};return eYe(I,f),rYe(o,v,I),I};Qw.hasAttributesForTextureCoordinatePlanes=function(o){return N(o.southWest_HIGH)&&N(o.southWest_LOW)&&N(o.northward)&&N(o.eastward)&&N(o.planes2D_HIGH)&&N(o.planes2D_LOW)&&N(o.uMaxVmax)&&N(o.uvMinAndExtents)};Qw.hasAttributesForSphericalExtents=function(o){return N(o.sphericalExtents)&&N(o.longitudeRotation)&&N(o.planes2D_HIGH)&&N(o.planes2D_LOW)&&N(o.uMaxVmax)&&N(o.uvMinAndExtents)};function E5t(o){return Math.max(o.width,o.height)>Qw.MAX_WIDTH_FOR_PLANAR_EXTENTS}Qw.shouldUseSphericalCoordinates=function(o){return E5t(o)};Qw.MAX_WIDTH_FOR_PLANAR_EXTENTS=xe.toRadians(1);var nM=Qw;function wB(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.geometryInstances;this.geometryInstances=f,this.show=Z(o.show,!0),this.classificationType=Z(o.classificationType,uc.BOTH),this.debugShowBoundingVolume=Z(o.debugShowBoundingVolume,!1),this.debugShowShadowVolume=Z(o.debugShowShadowVolume,!1),this._debugShowShadowVolume=!1,this._extruded=Z(o._extruded,!1),this._uniformMap=o._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1;let m=this;this._readyPromise=new Promise((v,y)=>{m._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let x=this._error;N(x)?y(x):v(this)}}),this._primitive=void 0,this._pickPrimitive=o._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=o.appearance,this._createBoundingVolumeFunction=o._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=o._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:Z(o.vertexCacheOptimize,!1),interleave:Z(o.interleave,!1),releaseGeometryInstances:Z(o.releaseGeometryInstances,!0),allowPicking:Z(o.allowPicking,!0),asynchronous:Z(o.asynchronous,!0),compressVertices:Z(o.compressVertices,!0),_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0,enableFrameBuffer:Z(o.enableFrameBuffer,!1)}}Object.defineProperties(wB.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("ClassificationPrimitive.readyPromise","ClassificationPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for ClassificationPrimitive.ready to return true instead."),this._readyPromise}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});wB.isSupported=function(o){return o.context.stencilBuffer};function xz(o,f){let m=f?dc.EQUAL:dc.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:o,frontFunction:m,frontOperation:{fail:No.KEEP,zFail:No.DECREMENT_WRAP,zPass:No.KEEP},backFunction:m,backOperation:{fail:No.KEEP,zFail:No.INCREMENT_WRAP,zPass:No.KEEP},reference:Ua.CESIUM_3D_TILE_MASK,mask:Ua.CESIUM_3D_TILE_MASK},stencilMask:Ua.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:mC.LESS_OR_EQUAL},depthMask:!1}}function Sme(o){return{stencilTest:{enabled:o,frontFunction:dc.NOT_EQUAL,frontOperation:{fail:No.ZERO,zFail:No.ZERO,zPass:No.ZERO},backFunction:dc.NOT_EQUAL,backOperation:{fail:No.ZERO,zFail:No.ZERO,zPass:No.ZERO},reference:0,mask:Ua.CLASSIFICATION_MASK},stencilMask:Ua.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:Mu.PRE_MULTIPLIED_ALPHA_BLEND}}var T5t={stencilTest:{enabled:!0,frontFunction:dc.NOT_EQUAL,frontOperation:{fail:No.ZERO,zFail:No.ZERO,zPass:No.ZERO},backFunction:dc.NOT_EQUAL,backOperation:{fail:No.ZERO,zFail:No.ZERO,zPass:No.ZERO},reference:0,mask:Ua.CLASSIFICATION_MASK},stencilMask:Ua.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function S5t(o,f,m,v){if(N(o._rsStencilDepthPass))return;let y=!o.debugShowShadowVolume;o._rsStencilDepthPass=Mn.fromCache(xz(y,!1)),o._rsStencilDepthPass3DTiles=Mn.fromCache(xz(y,!0)),o._rsColorPass=Mn.fromCache(Sme(y,!1)),o._rsPickPass=Mn.fromCache(T5t)}function P5t(o,f){if(!o.compressVertices)return f;if(f.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let m="compressedAttributes",v=`in vec2 ${m};`,y=`vec3 extrudeDirection; `,x=` extrudeDirection = czm_octDecode(${m}, 65535.0); `,C=f;C=C.replace(/in\s+vec3\s+extrudeDirection;/g,""),C=Zr.replaceMain(C,"czm_non_compressed_main");let w=`void main() { ${x} czm_non_compressed_main(); }`;return[v,y,C,w].join(` `)}}function I5t(o,f){let m=f.context,v=o._primitive,y=tCe;y=o._primitive._batchTable.getVertexShaderCallback()(y),y=Ia._appendDistanceDisplayConditionToShader(v,y),y=Ia._modifyShaderPosition(o,y,f.scene3DOnly),y=Ia._updateColorAttribute(v,y);let x=o._hasPlanarExtentsAttributes,C=x||o._hasSphericalExtentsAttribute;o._extruded&&(y=P5t(v,y));let w=o._extruded?"EXTRUDED_GEOMETRY":"",A=new Zr({defines:[w],sources:[y]}),E=new Zr({sources:[RW]}),T=o._primitive._attributeLocations,S=new nM(C,x,o.appearance);if(o._spStencil=Rs.replaceCache({context:m,shaderProgram:o._spStencil,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:T}),o._primitive.allowPicking){let P=Zr.createPickVertexShaderSource(y);P=Ia._appendShowToShader(v,P),P=Ia._updatePickColorAttribute(P);let D=S.createPickFragmentShader(!1),L=S.createPickVertexShader([w],P,!1,f.mapProjection);if(o._spPick=Rs.replaceCache({context:m,shaderProgram:o._spPick,vertexShaderSource:L,fragmentShaderSource:D,attributeLocations:T}),C){let R=m.shaderCache.getDerivedShaderProgram(o._spPick,"2dPick");if(!N(R)){let O=S.createPickFragmentShader(!0),F=S.createPickVertexShader([w],P,!0,f.mapProjection);R=m.shaderCache.createDerivedShaderProgram(o._spPick,"2dPick",{vertexShaderSource:F,fragmentShaderSource:O,attributeLocations:T})}o._spPick2D=R}}else o._spPick=Rs.fromCache({context:m,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:T});y=Ia._appendShowToShader(v,y),A=new Zr({defines:[w],sources:[y]}),o._sp=Rs.replaceCache({context:m,shaderProgram:o._sp,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:T});let M=S.createFragmentShader(!1),I=S.createVertexShader([w],y,!1,f.mapProjection);if(o._spColor=Rs.replaceCache({context:m,shaderProgram:o._spColor,vertexShaderSource:I,fragmentShaderSource:M,attributeLocations:T}),C){let P=m.shaderCache.getDerivedShaderProgram(o._spColor,"2dColor");if(!N(P)){let D=S.createFragmentShader(!0),L=S.createVertexShader([w],y,!0,f.mapProjection);P=m.shaderCache.createDerivedShaderProgram(o._spColor,"2dColor",{vertexShaderSource:L,fragmentShaderSource:D,attributeLocations:T})}o._spColor2D=P}}function M5t(o,f){let m=o._primitive,v=m._va.length*2;f.length=v;let y,x,C,w=0,A=m._batchTable.getUniformMapCallback()(o._uniformMap),E=o._needs2DShader;for(y=0;y0&&(A=y[0].attributes,M=nM.hasAttributesForSphericalExtents(A),I=nM.hasAttributesForTextureCoordinatePlanes(A),S=A.color),C=0;C{N(this._primitive)&&this._primitive.ready&&this._completeLoad()})};wB.prototype.getGeometryInstanceAttributes=function(o){return this._primitive.getGeometryInstanceAttributes(o)};wB.prototype.isDestroyed=function(){return!1};wB.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,kr(this)};var AU=wB,O5t={u_globeMinimumAltitude:function(){return 55e3}};function cC(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.appearance,m=o.geometryInstances;if(!N(f)&&N(m)){let x=Array.isArray(m)?m:[m],C=x.length;for(let w=0;w{v._completeLoad=()=>{if(this._ready)return;this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);let w=this._error;N(w)?C(w):x(this)}}),this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=zh._defaultMaxTerrainHeight,this._minTerrainHeight=zh._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let y=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:Z(o.vertexCacheOptimize,!1),interleave:Z(o.interleave,!1),releaseGeometryInstances:Z(o.releaseGeometryInstances,!0),allowPicking:Z(o.allowPicking,!0),asynchronous:Z(o.asynchronous,!0),compressVertices:Z(o.compressVertices,!0),_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:y,_extruded:!0,_uniformMap:O5t,enableFrameBuffer:Z(o.enableFrameBuffer,!1)},this.callbackTexture=Z(o.callbackTexture,null)}Object.defineProperties(cC.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("GroundPrimitive.readyPromise","GroundPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPrimitive.ready to return true instead."),this._readyPromise}}});cC.isSupported=AU.isSupported;function Q5e(o){return function(f,m){let v=m.maximumRadius,y=v/Math.cos(f*.5)-v;return o._maxHeight+y}}function Z5e(o){return function(f,m){return o._minHeight}}var N5t=new H,F5t=new H,B5t=new H,k5t=new Mt,V5t=new Di;function V$(o,f){let m=o.mapProjection.ellipsoid;if(!N(f.attributes)||!N(f.attributes.position3DHigh))return N(f.rectangle)?f.rectangle:void 0;let v=f.attributes.position3DHigh.values,y=f.attributes.position3DLow.values,x=v.length,C=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let S=0;S{!this._ready&&N(this._primitive)&&this._primitive.ready&&this._completeLoad()})};cC.prototype.getBoundingSphere=function(o){let f=this._boundingSpheresKeys.indexOf(o);if(f!==-1)return this._boundingSpheres[f]};cC.prototype.getGeometryInstanceAttributes=function(o){return this._primitive.getGeometryInstanceAttributes(o)};cC.prototype.isDestroyed=function(){return!1};cC.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),kr(this)};cC._supportsMaterials=function(o){return o.depthTexture};cC.supportsMaterials=function(o){return cC._supportsMaterials(o.frameState.context)};var Zw=cC;function OW(o){this._definitionChanged=new Br,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(OW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),image:Oi("image"),scale:Oi("scale"),pixelOffset:Oi("pixelOffset"),eyeOffset:Oi("eyeOffset"),horizontalOrigin:Oi("horizontalOrigin"),verticalOrigin:Oi("verticalOrigin"),heightReference:Oi("heightReference"),color:Oi("color"),rotation:Oi("rotation"),alignedAxis:Oi("alignedAxis"),sizeInMeters:Oi("sizeInMeters"),width:Oi("width"),height:Oi("height"),scaleByDistance:Oi("scaleByDistance"),translucencyByDistance:Oi("translucencyByDistance"),pixelOffsetScaleByDistance:Oi("pixelOffsetScaleByDistance"),imageSubRegion:Oi("imageSubRegion"),distanceDisplayCondition:Oi("distanceDisplayCondition"),disableDepthTestDistance:Oi("disableDepthTestDistance")});OW.prototype.clone=function(o){return N(o)?(o.show=this._show,o.image=this._image,o.scale=this._scale,o.pixelOffset=this._pixelOffset,o.eyeOffset=this._eyeOffset,o.horizontalOrigin=this._horizontalOrigin,o.verticalOrigin=this._verticalOrigin,o.heightReference=this._heightReference,o.color=this._color,o.rotation=this._rotation,o.alignedAxis=this._alignedAxis,o.sizeInMeters=this._sizeInMeters,o.width=this._width,o.height=this._height,o.scaleByDistance=this._scaleByDistance,o.translucencyByDistance=this._translucencyByDistance,o.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,o.imageSubRegion=this._imageSubRegion,o.distanceDisplayCondition=this._distanceDisplayCondition,o.disableDepthTestDistance=this._disableDepthTestDistance,o):new OW(this)};OW.prototype.merge=function(o){this.show=Z(this._show,o.show),this.image=Z(this._image,o.image),this.scale=Z(this._scale,o.scale),this.pixelOffset=Z(this._pixelOffset,o.pixelOffset),this.eyeOffset=Z(this._eyeOffset,o.eyeOffset),this.horizontalOrigin=Z(this._horizontalOrigin,o.horizontalOrigin),this.verticalOrigin=Z(this._verticalOrigin,o.verticalOrigin),this.heightReference=Z(this._heightReference,o.heightReference),this.color=Z(this._color,o.color),this.rotation=Z(this._rotation,o.rotation),this.alignedAxis=Z(this._alignedAxis,o.alignedAxis),this.sizeInMeters=Z(this._sizeInMeters,o.sizeInMeters),this.width=Z(this._width,o.width),this.height=Z(this._height,o.height),this.scaleByDistance=Z(this._scaleByDistance,o.scaleByDistance),this.translucencyByDistance=Z(this._translucencyByDistance,o.translucencyByDistance),this.pixelOffsetScaleByDistance=Z(this._pixelOffsetScaleByDistance,o.pixelOffsetScaleByDistance),this.imageSubRegion=Z(this._imageSubRegion,o.imageSubRegion),this.distanceDisplayCondition=Z(this._distanceDisplayCondition,o.distanceDisplayCondition),this.disableDepthTestDistance=Z(this._disableDepthTestDistance,o.disableDepthTestDistance)};var jM=OW;function _H(o){this._definitionChanged=new Br,this._color=void 0,this._colorSubscription=void 0,this.color=o}Object.defineProperties(_H.prototype,{isConstant:{get:function(){return vt.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Oi("color")});_H.prototype.getType=function(o){return"Color"};_H.prototype.getValue=function(o,f){return N(f)||(f={}),f.color=vt.getValueOrClonedDefault(this._color,o,Re.WHITE,f.color),f};_H.prototype.equals=function(o){return this===o||o instanceof _H&&vt.equals(this._color,o._color)};var xs=_H,G5t=new Ye(1,1),W5t=!1,j5t=Re.WHITE;function vH(o){o=Z(o,Z.EMPTY_OBJECT),this._definitionChanged=new Br,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=o.image,this.repeat=o.repeat,this.color=o.color,this.transparent=o.transparent}Object.defineProperties(vH.prototype,{isConstant:{get:function(){return vt.isConstant(this._image)&&vt.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:Oi("image"),repeat:Oi("repeat"),color:Oi("color"),transparent:Oi("transparent")});vH.prototype.getType=function(o){return"Image"};vH.prototype.getValue=function(o,f){return N(f)||(f={}),f.image=vt.getValueOrUndefined(this._image,o),f.repeat=vt.getValueOrClonedDefault(this._repeat,o,G5t,f.repeat),f.color=vt.getValueOrClonedDefault(this._color,o,j5t,f.color),vt.getValueOrDefault(this._transparent,o,W5t)&&(f.color.alpha=Math.min(.99,f.color.alpha)),f};vH.prototype.equals=function(o){return this===o||o instanceof vH&&vt.equals(this._image,o._image)&&vt.equals(this._repeat,o._repeat)&&vt.equals(this._color,o._color)&&vt.equals(this._transparent,o._transparent)};var Pp=vH;function Y5t(o){if(o instanceof Re)return new xs(o);if(typeof o=="string"||o instanceof Jr||o instanceof HTMLCanvasElement||o instanceof HTMLVideoElement){let f=new Pp;return f.image=o,f}}function q5t(o,f){return Oi(o,f,Y5t)}var A_=q5t;function NW(o){this._definitionChanged=new Br,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(NW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),dimensions:Oi("dimensions"),heightReference:Oi("heightReference"),fill:Oi("fill"),material:A_("material"),outline:Oi("outline"),outlineColor:Oi("outlineColor"),outlineWidth:Oi("outlineWidth"),shadows:Oi("shadows"),distanceDisplayCondition:Oi("distanceDisplayCondition")});NW.prototype.clone=function(o){return N(o)?(o.show=this.show,o.dimensions=this.dimensions,o.heightReference=this.heightReference,o.fill=this.fill,o.material=this.material,o.outline=this.outline,o.outlineColor=this.outlineColor,o.outlineWidth=this.outlineWidth,o.shadows=this.shadows,o.distanceDisplayCondition=this.distanceDisplayCondition,o):new NW(this)};NW.prototype.merge=function(o){this.show=Z(this.show,o.show),this.dimensions=Z(this.dimensions,o.dimensions),this.heightReference=Z(this.heightReference,o.heightReference),this.fill=Z(this.fill,o.fill),this.material=Z(this.material,o.material),this.outline=Z(this.outline,o.outline),this.outlineColor=Z(this.outlineColor,o.outlineColor),this.outlineWidth=Z(this.outlineWidth,o.outlineWidth),this.shadows=Z(this.shadows,o.shadows),this.distanceDisplayCondition=Z(this.distanceDisplayCondition,o.distanceDisplayCondition)};var fre=NW,X5t={FIXED:0,INERTIAL:1},om=Object.freeze(X5t);function EU(){li.throwInstantiationError()}Object.defineProperties(EU.prototype,{isConstant:{get:li.throwInstantiationError},definitionChanged:{get:li.throwInstantiationError},referenceFrame:{get:li.throwInstantiationError}});EU.prototype.getValue=li.throwInstantiationError;EU.prototype.getValueInReferenceFrame=li.throwInstantiationError;EU.prototype.equals=li.throwInstantiationError;var Ghe=new Ut;EU.convertToReferenceFrame=function(o,f,m,v,y){if(!N(f))return f;if(N(y)||(y=new H),m===v)return H.clone(f,y);let x=tn.computeIcrfToFixedMatrix(o,Ghe);if(N(x)||(x=tn.computeTemeToPseudoFixedMatrix(o,Ghe)),m===om.INERTIAL)return Ut.multiplyByVector(x,f,y);if(m===om.FIXED)return Ut.multiplyByVector(Ut.transpose(x,Ghe),f,y)};var vY=EU;function P5(o,f){this._definitionChanged=new Br,this._value=H.clone(o),this._referenceFrame=Z(f,om.FIXED)}Object.defineProperties(P5.prototype,{isConstant:{get:function(){return!N(this._value)||this._referenceFrame===om.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});P5.prototype.getValue=function(o,f){return this.getValueInReferenceFrame(o,om.FIXED,f)};P5.prototype.setValue=function(o,f){let m=!1;H.equals(this._value,o)||(m=!0,this._value=H.clone(o)),N(f)&&this._referenceFrame!==f&&(m=!0,this._referenceFrame=f),m&&this._definitionChanged.raiseEvent(this)};P5.prototype.getValueInReferenceFrame=function(o,f,m){return vY.convertToReferenceFrame(o,this._value,this._referenceFrame,f,m)};P5.prototype.equals=function(o){return this===o||o instanceof P5&&H.equals(this._value,o._value)&&this._referenceFrame===o._referenceFrame};var c2=P5;function FW(o){this._definitionChanged=new Br,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(FW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),positions:Oi("positions"),width:Oi("width"),height:Oi("height"),heightReference:Oi("heightReference"),extrudedHeight:Oi("extrudedHeight"),extrudedHeightReference:Oi("extrudedHeightReference"),cornerType:Oi("cornerType"),granularity:Oi("granularity"),fill:Oi("fill"),material:A_("material"),outline:Oi("outline"),outlineColor:Oi("outlineColor"),outlineWidth:Oi("outlineWidth"),shadows:Oi("shadows"),distanceDisplayCondition:Oi("distanceDisplayCondition"),classificationType:Oi("classificationType"),zIndex:Oi("zIndex")});FW.prototype.clone=function(o){return N(o)?(o.show=this.show,o.positions=this.positions,o.width=this.width,o.height=this.height,o.heightReference=this.heightReference,o.extrudedHeight=this.extrudedHeight,o.extrudedHeightReference=this.extrudedHeightReference,o.cornerType=this.cornerType,o.granularity=this.granularity,o.fill=this.fill,o.material=this.material,o.outline=this.outline,o.outlineColor=this.outlineColor,o.outlineWidth=this.outlineWidth,o.shadows=this.shadows,o.distanceDisplayCondition=this.distanceDisplayCondition,o.classificationType=this.classificationType,o.zIndex=this.zIndex,o):new FW(this)};FW.prototype.merge=function(o){this.show=Z(this.show,o.show),this.positions=Z(this.positions,o.positions),this.width=Z(this.width,o.width),this.height=Z(this.height,o.height),this.heightReference=Z(this.heightReference,o.heightReference),this.extrudedHeight=Z(this.extrudedHeight,o.extrudedHeight),this.extrudedHeightReference=Z(this.extrudedHeightReference,o.extrudedHeightReference),this.cornerType=Z(this.cornerType,o.cornerType),this.granularity=Z(this.granularity,o.granularity),this.fill=Z(this.fill,o.fill),this.material=Z(this.material,o.material),this.outline=Z(this.outline,o.outline),this.outlineColor=Z(this.outlineColor,o.outlineColor),this.outlineWidth=Z(this.outlineWidth,o.outlineWidth),this.shadows=Z(this.shadows,o.shadows),this.distanceDisplayCondition=Z(this.distanceDisplayCondition,o.distanceDisplayCondition),this.classificationType=Z(this.classificationType,o.classificationType),this.zIndex=Z(this.zIndex,o.zIndex)};var pre=FW;function J5t(o){return o}function K5t(o,f){return Oi(o,f,J5t)}var S1=K5t;function BW(o){this._definitionChanged=new Br,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(BW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),length:Oi("length"),topRadius:Oi("topRadius"),bottomRadius:Oi("bottomRadius"),heightReference:Oi("heightReference"),fill:Oi("fill"),material:A_("material"),outline:Oi("outline"),outlineColor:Oi("outlineColor"),outlineWidth:Oi("outlineWidth"),numberOfVerticalLines:Oi("numberOfVerticalLines"),slices:Oi("slices"),shadows:Oi("shadows"),distanceDisplayCondition:Oi("distanceDisplayCondition")});BW.prototype.clone=function(o){return N(o)?(o.show=this.show,o.length=this.length,o.topRadius=this.topRadius,o.bottomRadius=this.bottomRadius,o.heightReference=this.heightReference,o.fill=this.fill,o.material=this.material,o.outline=this.outline,o.outlineColor=this.outlineColor,o.outlineWidth=this.outlineWidth,o.numberOfVerticalLines=this.numberOfVerticalLines,o.slices=this.slices,o.shadows=this.shadows,o.distanceDisplayCondition=this.distanceDisplayCondition,o):new BW(this)};BW.prototype.merge=function(o){this.show=Z(this.show,o.show),this.length=Z(this.length,o.length),this.topRadius=Z(this.topRadius,o.topRadius),this.bottomRadius=Z(this.bottomRadius,o.bottomRadius),this.heightReference=Z(this.heightReference,o.heightReference),this.fill=Z(this.fill,o.fill),this.material=Z(this.material,o.material),this.outline=Z(this.outline,o.outline),this.outlineColor=Z(this.outlineColor,o.outlineColor),this.outlineWidth=Z(this.outlineWidth,o.outlineWidth),this.numberOfVerticalLines=Z(this.numberOfVerticalLines,o.numberOfVerticalLines),this.slices=Z(this.slices,o.slices),this.shadows=Z(this.shadows,o.shadows),this.distanceDisplayCondition=Z(this.distanceDisplayCondition,o.distanceDisplayCondition)};var mre=BW;function kW(o){this._definitionChanged=new Br,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(kW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),semiMajorAxis:Oi("semiMajorAxis"),semiMinorAxis:Oi("semiMinorAxis"),height:Oi("height"),heightReference:Oi("heightReference"),extrudedHeight:Oi("extrudedHeight"),extrudedHeightReference:Oi("extrudedHeightReference"),rotation:Oi("rotation"),stRotation:Oi("stRotation"),granularity:Oi("granularity"),fill:Oi("fill"),material:A_("material"),outline:Oi("outline"),outlineColor:Oi("outlineColor"),outlineWidth:Oi("outlineWidth"),numberOfVerticalLines:Oi("numberOfVerticalLines"),shadows:Oi("shadows"),distanceDisplayCondition:Oi("distanceDisplayCondition"),classificationType:Oi("classificationType"),zIndex:Oi("zIndex")});kW.prototype.clone=function(o){return N(o)?(o.show=this.show,o.semiMajorAxis=this.semiMajorAxis,o.semiMinorAxis=this.semiMinorAxis,o.height=this.height,o.heightReference=this.heightReference,o.extrudedHeight=this.extrudedHeight,o.extrudedHeightReference=this.extrudedHeightReference,o.rotation=this.rotation,o.stRotation=this.stRotation,o.granularity=this.granularity,o.fill=this.fill,o.material=this.material,o.outline=this.outline,o.outlineColor=this.outlineColor,o.outlineWidth=this.outlineWidth,o.numberOfVerticalLines=this.numberOfVerticalLines,o.shadows=this.shadows,o.distanceDisplayCondition=this.distanceDisplayCondition,o.classificationType=this.classificationType,o.zIndex=this.zIndex,o):new kW(this)};kW.prototype.merge=function(o){this.show=Z(this.show,o.show),this.semiMajorAxis=Z(this.semiMajorAxis,o.semiMajorAxis),this.semiMinorAxis=Z(this.semiMinorAxis,o.semiMinorAxis),this.height=Z(this.height,o.height),this.heightReference=Z(this.heightReference,o.heightReference),this.extrudedHeight=Z(this.extrudedHeight,o.extrudedHeight),this.extrudedHeightReference=Z(this.extrudedHeightReference,o.extrudedHeightReference),this.rotation=Z(this.rotation,o.rotation),this.stRotation=Z(this.stRotation,o.stRotation),this.granularity=Z(this.granularity,o.granularity),this.fill=Z(this.fill,o.fill),this.material=Z(this.material,o.material),this.outline=Z(this.outline,o.outline),this.outlineColor=Z(this.outlineColor,o.outlineColor),this.outlineWidth=Z(this.outlineWidth,o.outlineWidth),this.numberOfVerticalLines=Z(this.numberOfVerticalLines,o.numberOfVerticalLines),this.shadows=Z(this.shadows,o.shadows),this.distanceDisplayCondition=Z(this.distanceDisplayCondition,o.distanceDisplayCondition),this.classificationType=Z(this.classificationType,o.classificationType),this.zIndex=Z(this.zIndex,o.zIndex)};var gre=kW;function VW(o){this._definitionChanged=new Br,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(VW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),radii:Oi("radii"),innerRadii:Oi("innerRadii"),minimumClock:Oi("minimumClock"),maximumClock:Oi("maximumClock"),minimumCone:Oi("minimumCone"),maximumCone:Oi("maximumCone"),heightReference:Oi("heightReference"),fill:Oi("fill"),material:A_("material"),outline:Oi("outline"),outlineColor:Oi("outlineColor"),outlineWidth:Oi("outlineWidth"),stackPartitions:Oi("stackPartitions"),slicePartitions:Oi("slicePartitions"),subdivisions:Oi("subdivisions"),shadows:Oi("shadows"),distanceDisplayCondition:Oi("distanceDisplayCondition")});VW.prototype.clone=function(o){return N(o)?(o.show=this.show,o.radii=this.radii,o.innerRadii=this.innerRadii,o.minimumClock=this.minimumClock,o.maximumClock=this.maximumClock,o.minimumCone=this.minimumCone,o.maximumCone=this.maximumCone,o.heightReference=this.heightReference,o.fill=this.fill,o.material=this.material,o.outline=this.outline,o.outlineColor=this.outlineColor,o.outlineWidth=this.outlineWidth,o.stackPartitions=this.stackPartitions,o.slicePartitions=this.slicePartitions,o.subdivisions=this.subdivisions,o.shadows=this.shadows,o.distanceDisplayCondition=this.distanceDisplayCondition,o):new VW(this)};VW.prototype.merge=function(o){this.show=Z(this.show,o.show),this.radii=Z(this.radii,o.radii),this.innerRadii=Z(this.innerRadii,o.innerRadii),this.minimumClock=Z(this.minimumClock,o.minimumClock),this.maximumClock=Z(this.maximumClock,o.maximumClock),this.minimumCone=Z(this.minimumCone,o.minimumCone),this.maximumCone=Z(this.maximumCone,o.maximumCone),this.heightReference=Z(this.heightReference,o.heightReference),this.fill=Z(this.fill,o.fill),this.material=Z(this.material,o.material),this.outline=Z(this.outline,o.outline),this.outlineColor=Z(this.outlineColor,o.outlineColor),this.outlineWidth=Z(this.outlineWidth,o.outlineWidth),this.stackPartitions=Z(this.stackPartitions,o.stackPartitions),this.slicePartitions=Z(this.slicePartitions,o.slicePartitions),this.subdivisions=Z(this.subdivisions,o.subdivisions),this.shadows=Z(this.shadows,o.shadows),this.distanceDisplayCondition=Z(this.distanceDisplayCondition,o.distanceDisplayCondition)};var TU=VW;function zW(o){this._definitionChanged=new Br,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(zW.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),text:Oi("text"),font:Oi("font"),style:Oi("style"),scale:Oi("scale"),showBackground:Oi("showBackground"),backgroundColor:Oi("backgroundColor"),backgroundPadding:Oi("backgroundPadding"),pixelOffset:Oi("pixelOffset"),eyeOffset:Oi("eyeOffset"),horizontalOrigin:Oi("horizontalOrigin"),verticalOrigin:Oi("verticalOrigin"),heightReference:Oi("heightReference"),fillColor:Oi("fillColor"),outlineColor:Oi("outlineColor"),outlineWidth:Oi("outlineWidth"),translucencyByDistance:Oi("translucencyByDistance"),pixelOffsetScaleByDistance:Oi("pixelOffsetScaleByDistance"),scaleByDistance:Oi("scaleByDistance"),distanceDisplayCondition:Oi("distanceDisplayCondition"),disableDepthTestDistance:Oi("disableDepthTestDistance")});zW.prototype.clone=function(o){return N(o)?(o.show=this.show,o.text=this.text,o.font=this.font,o.style=this.style,o.scale=this.scale,o.showBackground=this.showBackground,o.backgroundColor=this.backgroundColor,o.backgroundPadding=this.backgroundPadding,o.pixelOffset=this.pixelOffset,o.eyeOffset=this.eyeOffset,o.horizontalOrigin=this.horizontalOrigin,o.verticalOrigin=this.verticalOrigin,o.heightReference=this.heightReference,o.fillColor=this.fillColor,o.outlineColor=this.outlineColor,o.outlineWidth=this.outlineWidth,o.translucencyByDistance=this.translucencyByDistance,o.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,o.scaleByDistance=this.scaleByDistance,o.distanceDisplayCondition=this.distanceDisplayCondition,o.disableDepthTestDistance=this.disableDepthTestDistance,o):new zW(this)};zW.prototype.merge=function(o){this.show=Z(this.show,o.show),this.text=Z(this.text,o.text),this.font=Z(this.font,o.font),this.style=Z(this.style,o.style),this.scale=Z(this.scale,o.scale),this.showBackground=Z(this.showBackground,o.showBackground),this.backgroundColor=Z(this.backgroundColor,o.backgroundColor),this.backgroundPadding=Z(this.backgroundPadding,o.backgroundPadding),this.pixelOffset=Z(this.pixelOffset,o.pixelOffset),this.eyeOffset=Z(this.eyeOffset,o.eyeOffset),this.horizontalOrigin=Z(this.horizontalOrigin,o.horizontalOrigin),this.verticalOrigin=Z(this.verticalOrigin,o.verticalOrigin),this.heightReference=Z(this.heightReference,o.heightReference),this.fillColor=Z(this.fillColor,o.fillColor),this.outlineColor=Z(this.outlineColor,o.outlineColor),this.outlineWidth=Z(this.outlineWidth,o.outlineWidth),this.translucencyByDistance=Z(this.translucencyByDistance,o.translucencyByDistance),this.pixelOffsetScaleByDistance=Z(this.pixelOffsetScaleByDistance,o.pixelOffsetScaleByDistance),this.scaleByDistance=Z(this.scaleByDistance,o.scaleByDistance),this.distanceDisplayCondition=Z(this.distanceDisplayCondition,o.distanceDisplayCondition),this.disableDepthTestDistance=Z(this.disableDepthTestDistance,o.disableDepthTestDistance)};var SU=zW,Q5t=new H(1,1,1),Z5t=H.ZERO,$5t=Gr.IDENTITY;function nYe(o,f,m){this.translation=H.clone(Z(o,Z5t)),this.rotation=Gr.clone(Z(f,$5t)),this.scale=H.clone(Z(m,Q5t))}nYe.prototype.equals=function(o){return this===o||N(o)&&H.equals(this.translation,o.translation)&&Gr.equals(this.rotation,o.rotation)&&H.equals(this.scale,o.scale)};var ob=nYe,Whe=new ob;function HW(o){o=Z(o,Z.EMPTY_OBJECT),this._definitionChanged=new Br,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=o.translation,this.rotation=o.rotation,this.scale=o.scale}Object.defineProperties(HW.prototype,{isConstant:{get:function(){return vt.isConstant(this._translation)&&vt.isConstant(this._rotation)&&vt.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:Oi("translation"),rotation:Oi("rotation"),scale:Oi("scale")});HW.prototype.getValue=function(o,f){return N(f)||(f=new ob),f.translation=vt.getValueOrClonedDefault(this._translation,o,Whe.translation,f.translation),f.rotation=vt.getValueOrClonedDefault(this._rotation,o,Whe.rotation,f.rotation),f.scale=vt.getValueOrClonedDefault(this._scale,o,Whe.scale,f.scale),f};HW.prototype.equals=function(o){return this===o||o instanceof HW&&vt.equals(this._translation,o._translation)&&vt.equals(this._rotation,o._rotation)&&vt.equals(this._scale,o._scale)};var _re=HW;function wM(o,f){this._propertyNames=[],this._definitionChanged=new Br,N(o)&&this.merge(o,f)}Object.defineProperties(wM.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let o=this._propertyNames;for(let f=0,m=o.length;ff.height?x=v*(f.height/f.width):f.widthf.height?x=v*(f.height/f.width):f.width${v}${dYe(y)}`:m+=`${v}${y}`)}return m.length>0&&(m=`${m}
`),m}function TBt(o,f,m){let v;return function(y,x){return N(v)||(v=o(f,m)),v}}function SBt(o,f){return new xn(TBt(dYe,o,f),!0)}function wre(o,f,m){let v=o.id;if(!N(v)||o.type!=="Feature")v=zl();else{let C=2,w=v;for(;N(f.getById(w));)w=`${v}_${C}`,C++;v=w}let y=f.getOrCreateEntity(v),x=o.properties;if(N(x)){y.properties=x;let C,w=x.title;if(N(w))y.name=w,C="title";else{let E=Number.MAX_VALUE;for(let T in x)if(x.hasOwnProperty(T)&&x[T]){let S=T.toLowerCase();if(E>1&&S==="title"){E=1,C=T;break}else E>2&&S==="name"?(E=2,C=T):E>3&&/title/i.test(T)?(E=3,C=T):E>4&&/name/i.test(T)&&(E=4,C=T)}N(C)&&(y.name=x[C])}let A=x.description;A!==null&&(y.description=N(A)?new Uc(A):m(x,C))}return y}function Bme(o,f){let m=new Array(o.length);for(let v=0;v2?E.perPositionHeight=new Uc(!0):y.clampToGround||(E.height=0);let M=wre(f,o._entityCollection,y.describe);M.polygon=E}function AYe(o,f,m,v,y){wYe(o,f,v,m.coordinates,y)}function EYe(o,f,m,v,y){let x=m.coordinates;for(let C=0;Cf&&(m==null?(m="…",v=3):v=m.length,o=o.substring(0,f-v)+m),o}function ef(o,f){for(var m=o.length-1;m>=0;m--)o[m]===f&&o.splice(m,1)}function xF(o,f){for(var m=o.length-1;m>=0;m--)f(o[m])===!0&&o.splice(m,1)}function j7(o){throw new Error("Unhandled case for value: '".concat(o,"'"))}var Nz=/[A-Za-z]/,gv=/[\d]/,ME=/\s/,Yhe=/['"]/,FBt=/[\x00-\x1F\x7F]/,PYe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,BBt=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,kBt=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,VBt=PYe+BBt+kBt,IYe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,W8i=new RegExp("[".concat(PYe+IYe,"]")),MYe=VBt+IYe,h5=new RegExp("[".concat(MYe,"]")),DYe=function(){function o(f){f===void 0&&(f={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=f.tagName||"",this.attrs=f.attrs||{},this.innerHTML=f.innerHtml||f.innerHTML||""}return o.prototype.setTagName=function(f){return this.tagName=f,this},o.prototype.getTagName=function(){return this.tagName||""},o.prototype.setAttr=function(f,m){var v=this.getAttrs();return v[f]=m,this},o.prototype.getAttr=function(f){return this.getAttrs()[f]},o.prototype.setAttrs=function(f){return Object.assign(this.getAttrs(),f),this},o.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},o.prototype.setClass=function(f){return this.setAttr("class",f)},o.prototype.addClass=function(f){for(var m=this.getClass(),v=m?m.split(ME):[],y=f.split(ME),x;x=y.shift();)v.indexOf(x)===-1&&v.push(x);return this.getAttrs().class=v.join(" "),this},o.prototype.removeClass=function(f){for(var m=this.getClass(),v=m?m.split(ME):[],y=f.split(ME),x;v.length&&(x=y.shift());){var C=v.indexOf(x);C!==-1&&v.splice(C,1)}return this.getAttrs().class=v.join(" "),this},o.prototype.getClass=function(){return this.getAttrs().class||""},o.prototype.hasClass=function(f){return(" "+this.getClass()+" ").indexOf(" "+f+" ")!==-1},o.prototype.setInnerHTML=function(f){return this.innerHTML=f,this},o.prototype.setInnerHtml=function(f){return this.setInnerHTML(f)},o.prototype.getInnerHTML=function(){return this.innerHTML||""},o.prototype.getInnerHtml=function(){return this.getInnerHTML()},o.prototype.toAnchorString=function(){var f=this.getTagName(),m=this.buildAttrsStr();return m=m?" "+m:"",["<",f,m,">",this.getInnerHtml(),""].join("")},o.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var f=this.getAttrs(),m=[];for(var v in f)f.hasOwnProperty(v)&&m.push(v+'="'+f[v]+'"');return m.join(" ")},o}();function zBt(o,f,m){var v,y;m==null?(m="…",y=3,v=8):(y=m.length,v=m.length);var x=function(O){var F={},k=O,U=k.match(/^([a-z]+):\/\//i);return U&&(F.scheme=U[1],k=k.substr(U[0].length)),U=k.match(/^(.*?)(?=(\?|#|\/|$))/i),U&&(F.host=U[1],k=k.substr(U[0].length)),U=k.match(/^\/(.*?)(?=(\?|#|$))/i),U&&(F.path=U[1],k=k.substr(U[0].length)),U=k.match(/^\?(.*?)(?=(#|$))/i),U&&(F.query=U[1],k=k.substr(U[0].length)),U=k.match(/^#(.*?)$/i),U&&(F.fragment=U[1]),F},C=function(O){var F="";return O.scheme&&O.host&&(F+=O.scheme+"://"),O.host&&(F+=O.host),O.path&&(F+="/"+O.path),O.query&&(F+="?"+O.query),O.fragment&&(F+="#"+O.fragment),F},w=function(O,F){var k=F/2,U=Math.ceil(k),G=-1*Math.floor(k),j="";return G<0&&(j=O.substr(G)),O.substr(0,U)+m+j};if(o.length<=f)return o;var A=f-y,E=x(o);if(E.query){var T=E.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);T&&(E.query=E.query.substr(0,T[1].length),o=C(E))}if(o.length<=f||(E.host&&(E.host=E.host.replace(/^www\./,""),o=C(E)),o.length<=f))return o;var S="";if(E.host&&(S+=E.host),S.length>=A)return E.host.length==f?(E.host.substr(0,f-y)+m).substr(0,A+v):w(S,A).substr(0,A+v);var M="";if(E.path&&(M+="/"+E.path),E.query&&(M+="?"+E.query),M)if((S+M).length>=A){if((S+M).length==f)return(S+M).substr(0,f);var I=A-S.length;return(S+w(M,I)).substr(0,A+v)}else S+=M;if(E.fragment){var P="#"+E.fragment;if((S+P).length>=A){if((S+P).length==f)return(S+P).substr(0,f);var D=A-S.length;return(S+w(P,D)).substr(0,A+v)}else S+=P}if(E.scheme&&E.host){var L=E.scheme+"://";if((S+L).length0&&(R=S.substr(-1*Math.floor(A/2))),(S.substr(0,Math.ceil(A/2))+m+R).substr(0,A+v)}function HBt(o,f,m){if(o.length<=f)return o;var v,y;m==null?(m="…",v=8,y=3):(v=m.length,y=m.length);var x=f-y,C="";return x>0&&(C=o.substr(-1*Math.floor(x/2))),(o.substr(0,Math.ceil(x/2))+m+C).substr(0,x+v)}function UBt(o,f,m){return NBt(o,f,m)}var GBt=function(){function o(f){f===void 0&&(f={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=f.newWindow||!1,this.truncate=f.truncate||{},this.className=f.className||""}return o.prototype.build=function(f){return new DYe({tagName:"a",attrs:this.createAttrs(f),innerHtml:this.processAnchorText(f.getAnchorText())})},o.prototype.createAttrs=function(f){var m={href:f.getAnchorHref()},v=this.createCssClass(f);return v&&(m.class=v),this.newWindow&&(m.target="_blank",m.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length=0;I--){var P=T[I];switch(P.state){case 11:G(P,M);break;case 12:j(P,M);break;case 0:R(P,M);break;case 1:O(P,M);break;case 2:F(P,M);break;case 3:k(P,M);break;case 4:U(P,M);break;case 5:q(P,M);break;case 6:J(P,M);break;case 7:X(P,M);break;case 13:Y(P,M);break;case 14:Q(P,M);break;case 8:ee(P,M);break;case 9:z(P,M);break;case 10:ie(P,M);break;case 15:re(P,M);break;case 16:ne(P,M);break;case 17:oe(P,M);break;case 18:se(P,M);break;case 19:ae(P,M);break;case 20:fe(P,M);break;case 21:de(P,M);break;case 22:ve(P,M);break;case 23:pe(P,M);break;case 24:ce(P,M);break;case 25:he(P,M);break;case 26:Ce(P,M);break;case 27:Se(P,M);break;case 28:De(P,M);break;case 29:Oe(P,M);break;case 30:Ue(P,M);break;case 31:Xe(P,M);break;case 32:ut(P,M);break;case 33:at(P,M);break;case 34:Pt(P,M);break;case 35:Qe(P,M);break;case 36:ft(P,M);break;case 37:it(P,M);break;case 38:Ot(P,M);break;case 39:Xt(P,M);break;case 40:At(P,M);break;case 41:bt(P,M);break;default:j7(P.state)}}}for(var D=T.length-1;D>=0;D--)T.forEach(function(It){return gt(It)});return A;function L(It){if(It==="#")T.push(k4t(S,28));else if(It==="@")T.push(V4t(S,30));else if(It==="/")T.push($he(S,11));else if(It==="+")T.push(ede(S,37));else if(It==="(")T.push(ede(S,32));else{if(gv.test(It)&&(T.push(ede(S,38)),T.push(F4t(S,13))),p4t(It)){var Jt=It.toLowerCase()==="m"?15:22;T.push(B4t(S,Jt))}qhe(It)&&T.push(Zhe(S,0)),h5.test(It)&&T.push($he(S,5))}}function R(It,Jt){Jt===":"?It.state=2:Jt==="-"?It.state=1:rBe(Jt)||ef(T,It)}function O(It,Jt){Jt==="-"||(Jt==="/"?(ef(T,It),T.push($he(S,11))):rBe(Jt)?It.state=0:ef(T,It))}function F(It,Jt){Jt==="/"?It.state=3:Jt==="."?ef(T,It):vR(Jt)?(It.state=5,qhe(Jt)&&T.push(Zhe(S,0))):ef(T,It)}function k(It,Jt){Jt==="/"?It.state=4:nBe(Jt)?(It.state=10,It.acceptStateReached=!0):gt(It)}function U(It,Jt){Jt==="/"?It.state=10:vR(Jt)?(It.state=5,It.acceptStateReached=!0):ef(T,It)}function G(It,Jt){Jt==="/"?It.state=12:ef(T,It)}function j(It,Jt){vR(Jt)?It.state=5:ef(T,It)}function q(It,Jt){Jt==="."?It.state=7:Jt==="-"?It.state=6:Jt===":"?It.state=8:Jhe(Jt)?It.state=10:Xhe(Jt)||gt(It)}function J(It,Jt){Jt==="-"||(Jt==="."?gt(It):vR(Jt)?It.state=5:gt(It))}function X(It,Jt){Jt==="."?gt(It):vR(Jt)?(It.state=5,It.acceptStateReached=!0):gt(It)}function Y(It,Jt){Jt==="."?It.state=14:Jt===":"?It.state=8:gv.test(Jt)||(Jhe(Jt)?It.state=10:h5.test(Jt)?ef(T,It):gt(It))}function Q(It,Jt){gv.test(Jt)?(It.octetsEncountered++,It.octetsEncountered===4&&(It.acceptStateReached=!0),It.state=13):gt(It)}function ee(It,Jt){gv.test(Jt)?It.state=9:gt(It)}function z(It,Jt){gv.test(Jt)||(Jhe(Jt)?It.state=10:gt(It))}function ie(It,Jt){nBe(Jt)||gt(It)}function re(It,Jt){Jt.toLowerCase()==="a"?It.state=16:ve(It,Jt)}function ne(It,Jt){Jt.toLowerCase()==="i"?It.state=17:ve(It,Jt)}function oe(It,Jt){Jt.toLowerCase()==="l"?It.state=18:ve(It,Jt)}function se(It,Jt){Jt.toLowerCase()==="t"?It.state=19:ve(It,Jt)}function ae(It,Jt){Jt.toLowerCase()==="o"?It.state=20:ve(It,Jt)}function fe(It,Jt){Jt.toLowerCase()===":"?It.state=21:ve(It,Jt)}function de(It,Jt){Khe(Jt)?It.state=22:ef(T,It)}function ve(It,Jt){Jt==="."?It.state=23:Jt==="@"?It.state=24:Khe(Jt)?It.state=22:ef(T,It)}function pe(It,Jt){Jt==="."||Jt==="@"?ef(T,It):Khe(Jt)?It.state=22:ef(T,It)}function ce(It,Jt){vR(Jt)?It.state=25:ef(T,It)}function he(It,Jt){Jt==="."?It.state=27:Jt==="-"?It.state=26:Xhe(Jt)||gt(It)}function Ce(It,Jt){Jt==="-"||Jt==="."?gt(It):Xhe(Jt)?It.state=25:gt(It)}function Se(It,Jt){Jt==="."||Jt==="-"?gt(It):vR(Jt)?(It.state=25,It.acceptStateReached=!0):gt(It)}function De(It,Jt){oBe(Jt)?(It.state=29,It.acceptStateReached=!0):ef(T,It)}function Oe(It,Jt){oBe(Jt)||gt(It)}function Ue(It,Jt){aBe(Jt)?(It.state=31,It.acceptStateReached=!0):ef(T,It)}function Xe(It,Jt){aBe(Jt)||(h5.test(Jt)?ef(T,It):gt(It))}function it(It,Jt){gv.test(Jt)?It.state=38:(ef(T,It),L(Jt))}function ut(It,Jt){gv.test(Jt)?It.state=33:ef(T,It),L(Jt)}function at(It,Jt){gv.test(Jt)?It.state=34:ef(T,It)}function Pt(It,Jt){gv.test(Jt)?It.state=35:ef(T,It)}function Qe(It,Jt){Jt===")"?It.state=36:ef(T,It)}function ft(It,Jt){gv.test(Jt)?It.state=38:sBe(Jt)?It.state=39:ef(T,It)}function Ot(It,Jt){It.acceptStateReached=!0,Qhe(Jt)?It.state=40:Jt==="#"?It.state=41:gv.test(Jt)||(Jt==="("?It.state=32:sBe(Jt)?It.state=39:(gt(It),qhe(Jt)&&T.push(Zhe(S,0))))}function Xt(It,Jt){gv.test(Jt)?It.state=38:Jt==="("?It.state=32:(gt(It),L(Jt))}function At(It,Jt){Qhe(Jt)||(Jt==="#"?It.state=41:gv.test(Jt)?It.state=38:gt(It))}function bt(It,Jt){Qhe(Jt)?It.state=40:gv.test(Jt)?ef(T,It):gt(It)}function gt(It){if(ef(T,It),!!It.acceptStateReached){var Jt=It.startIdx,bi=o.slice(It.startIdx,S);if(bi=N4t(bi),It.type==="url"){var Yi=o.charAt(It.startIdx-1);if(Yi==="@")return;var ii=It.matchType;if(ii==="scheme"){var ei=RYe.exec(bi);if(ei&&(Jt=Jt+ei.index,bi=bi.slice(ei.index)),!$Bt(bi))return}else if(ii==="tld"){if(!e4t(bi))return}else if(ii==="ipV4"){if(!r4t(bi))return}else j7(ii);A.push(new a4t({tagBuilder:m,matchedText:bi,offset:Jt,urlMatchType:ii,url:bi,protocolRelativeMatch:bi.slice(0,2)==="//",stripPrefix:v,stripTrailingSlash:y,decodePercentEncoding:x}))}else if(It.type==="email")m4t(bi)&&A.push(new g4t({tagBuilder:m,matchedText:bi,offset:Jt,email:bi.replace(d4t,"")}));else if(It.type==="hashtag")_4t(bi)&&A.push(new y4t({tagBuilder:m,matchedText:bi,offset:Jt,serviceName:C,hashtag:bi.slice(1)}));else if(It.type==="mention")b4t(bi,w)&&A.push(new A4t({tagBuilder:m,matchedText:bi,offset:Jt,serviceName:w,mention:bi.slice(1)}));else if(It.type==="phone"){if(bi=bi.replace(/ +$/g,""),D4t(bi)){var Li=bi.replace(/[^0-9,;#]/g,"");A.push(new L4t({tagBuilder:m,matchedText:bi,offset:Jt,number:Li,plusSign:bi.charAt(0)==="+"}))}}else j7(It)}}}var O4t=/[\(\{\[]/,lBe=/[\)\}\]]/,uBe={")":"(","}":"{","]":"["};function N4t(o){for(var f={"(":0,"{":0,"[":0},m=0;m=0;)if(x=o.charAt(y),lBe.test(x)){var C=uBe[x];if(f[C]<0)f[C]++,y--;else break}else if(JBt.test(x))y--;else break;return o.slice(0,y+1)}function Zhe(o,f){return{type:"url",startIdx:o,state:f,acceptStateReached:!1,matchType:"scheme"}}function $he(o,f){return{type:"url",startIdx:o,state:f,acceptStateReached:!1,matchType:"tld"}}function F4t(o,f){return{type:"url",startIdx:o,state:f,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function B4t(o,f){return{type:"email",startIdx:o,state:f,acceptStateReached:!1}}function k4t(o,f){return{type:"hashtag",startIdx:o,state:f,acceptStateReached:!1}}function V4t(o,f){return{type:"mention",startIdx:o,state:f,acceptStateReached:!1}}function ede(o,f){return{type:"phone",startIdx:o,state:f,acceptStateReached:!1}}function z4t(o,f){for(var m=f.onOpenTag,v=f.onCloseTag,y=f.onText,x=f.onComment,C=f.onDoctype,w=new VS,A=0,E=o.length,T=0,S=0,M=w;A"?(M=new VS(A0(A0({},M),{name:ve()})),fe()):!Nz.test(ce)&&!gv.test(ce)&&ce!==":"&&se()}function R(ce){ce===">"?se():Nz.test(ce)?T=3:se()}function O(ce){ME.test(ce)||(ce==="/"?T=12:ce===">"?fe():ce==="<"?ae():ce==="="||Yhe.test(ce)||FBt.test(ce)?se():T=5)}function F(ce){ME.test(ce)?T=6:ce==="/"?T=12:ce==="="?T=7:ce===">"?fe():ce==="<"?ae():Yhe.test(ce)&&se()}function k(ce){ME.test(ce)||(ce==="/"?T=12:ce==="="?T=7:ce===">"?fe():ce==="<"?ae():Yhe.test(ce)?se():T=5)}function U(ce){ME.test(ce)||(ce==='"'?T=8:ce==="'"?T=9:/[>=`]/.test(ce)?se():ce==="<"?ae():T=10)}function G(ce){ce==='"'&&(T=11)}function j(ce){ce==="'"&&(T=11)}function q(ce){ME.test(ce)?T=4:ce===">"?fe():ce==="<"&&ae()}function J(ce){ME.test(ce)?T=4:ce==="/"?T=12:ce===">"?fe():ce==="<"?ae():(T=4,pe())}function X(ce){ce===">"?(M=new VS(A0(A0({},M),{isClosing:!0})),fe()):T=4}function Y(ce){o.substr(A,2)==="--"?(A+=2,M=new VS(A0(A0({},M),{type:"comment"})),T=14):o.substr(A,7).toUpperCase()==="DOCTYPE"?(A+=7,M=new VS(A0(A0({},M),{type:"doctype"})),T=20):se()}function Q(ce){ce==="-"?T=15:ce===">"?se():T=16}function ee(ce){ce==="-"?T=18:ce===">"?se():T=16}function z(ce){ce==="-"&&(T=17)}function ie(ce){ce==="-"?T=18:T=16}function re(ce){ce===">"?fe():ce==="!"?T=19:ce==="-"||(T=16)}function ne(ce){ce==="-"?T=17:ce===">"?fe():T=16}function oe(ce){ce===">"?fe():ce==="<"&&ae()}function se(){T=0,M=w}function ae(){T=1,M=new VS({idx:A})}function fe(){var ce=o.slice(S,M.idx);ce&&y(ce,S),M.type==="comment"?x(M.idx):M.type==="doctype"?C(M.idx):(M.isOpening&&m(M.name,M.idx),M.isClosing&&v(M.name,M.idx)),se(),S=A+1}function de(){var ce=o.slice(S,A);y(ce,S),S=A+1}function ve(){var ce=M.idx+(M.isClosing?2:1);return o.slice(ce,A).toLowerCase()}function pe(){A--}}var VS=function(){function o(f){f===void 0&&(f={}),this.idx=f.idx!==void 0?f.idx:-1,this.type=f.type||"tag",this.name=f.name||"",this.isOpening=!!f.isOpening,this.isClosing=!!f.isClosing}return o}(),H4t=function(){function o(f){f===void 0&&(f={}),this.version=o.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=G4t(f.urls),this.email=yw(f.email)?f.email:this.email,this.phone=yw(f.phone)?f.phone:this.phone,this.hashtag=f.hashtag||this.hashtag,this.mention=f.mention||this.mention,this.newWindow=yw(f.newWindow)?f.newWindow:this.newWindow,this.stripPrefix=W4t(f.stripPrefix),this.stripTrailingSlash=yw(f.stripTrailingSlash)?f.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=yw(f.decodePercentEncoding)?f.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=f.sanitizeHtml||!1;var m=this.mention;if(m!==!1&&w4t.indexOf(m)===-1)throw new Error("invalid `mention` cfg '".concat(m,"' - see docs"));var v=this.hashtag;if(v!==!1&&v4t.indexOf(v)===-1)throw new Error("invalid `hashtag` cfg '".concat(v,"' - see docs"));this.truncate=j4t(f.truncate),this.className=f.className||this.className,this.replaceFn=f.replaceFn||this.replaceFn,this.context=f.context||this}return o.link=function(f,m){var v=new o(m);return v.link(f)},o.parse=function(f,m){var v=new o(m);return v.parse(f)},o.prototype.parse=function(f){var m=this,v=["a","style","script"],y=0,x=[];return z4t(f,{onOpenTag:function(C){v.indexOf(C)>=0&&y++},onText:function(C,w){if(y===0){var A=/( | |<|<|>|>|"|"|')/gi,E=C.split(A),T=w;E.forEach(function(S,M){if(M%2===0){var I=m.parseText(S,T);x.push.apply(x,I)}T+=S.length})}},onCloseTag:function(C){v.indexOf(C)>=0&&(y=Math.max(y-1,0))},onComment:function(C){},onDoctype:function(C){}}),x=this.compactMatches(x),x=this.removeUnwantedMatches(x),x},o.prototype.compactMatches=function(f){f.sort(function(A,E){return A.getOffset()-E.getOffset()});for(var m=0;mx?m:m+1;f.splice(w,1);continue}if(f[m+1].getOffset()/g,">"));for(var m=this.parse(f),v=[],y=0,x=0,C=m.length;xnew Array(f).fill(m,0,f)))}function Ere(o){return o.reduce((f,m)=>f.concat(Array.isArray(m)?Ere(m):m),[])}var cBe=[0,1,2,3].concat(...Are([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function Tf(){let o=this;function f(y){let x=o.dyn_tree,C=o.stat_desc.static_tree,w=o.stat_desc.extra_bits,A=o.stat_desc.extra_base,E=o.stat_desc.max_length,T,S,M,I,P,D,L=0;for(I=0;I<=15;I++)y.bl_count[I]=0;for(x[y.heap[y.heap_max]*2+1]=0,T=y.heap_max+1;T<573;T++)S=y.heap[T],I=x[x[S*2+1]*2+1]+1,I>E&&(I=E,L++),x[S*2+1]=I,!(S>o.max_code)&&(y.bl_count[I]++,P=0,S>=A&&(P=w[S-A]),D=x[S*2],y.opt_len+=D*(I+P),C&&(y.static_len+=D*(C[S*2+1]+P)));if(L!==0){do{for(I=E-1;y.bl_count[I]===0;)I--;y.bl_count[I]--,y.bl_count[I+1]+=2,y.bl_count[E]--,L-=2}while(L>0);for(I=E;I!==0;I--)for(S=y.bl_count[I];S!==0;)M=y.heap[--T],!(M>o.max_code)&&(x[M*2+1]!=I&&(y.opt_len+=(I-x[M*2+1])*x[M*2],x[M*2+1]=I),S--)}}function m(y,x){let C=0;do C|=y&1,y>>>=1,C<<=1;while(--x>0);return C>>>1}function v(y,x,C){let w=[],A=0,E,T,S;for(E=1;E<=15;E++)w[E]=A=A+C[E-1]<<1;for(T=0;T<=x;T++)S=y[T*2+1],S!==0&&(y[T*2]=m(w[S]++,S))}o.build_tree=function(y){let x=o.dyn_tree,C=o.stat_desc.static_tree,w=o.stat_desc.elems,A,E,T=-1,S;for(y.heap_len=0,y.heap_max=573,A=0;A=1;A--)y.pqdownheap(x,A);S=w;do A=y.heap[1],y.heap[1]=y.heap[y.heap_len--],y.pqdownheap(x,1),E=y.heap[1],y.heap[--y.heap_max]=A,y.heap[--y.heap_max]=E,x[S*2]=x[A*2]+x[E*2],y.depth[S]=Math.max(y.depth[A],y.depth[E])+1,x[A*2+1]=x[E*2+1]=S,y.heap[1]=S++,y.pqdownheap(x,1);while(y.heap_len>=2);y.heap[--y.heap_max]=y.heap[1],f(y),v(x,o.max_code,y.bl_count)}}Tf._length_code=[0,1,2,3,4,5,6,7].concat(...Are([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));Tf.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];Tf.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];Tf.d_code=function(o){return o<256?cBe[o]:cBe[256+(o>>>7)]};Tf.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];Tf.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];Tf.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];Tf.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function __(o,f,m,v,y){let x=this;x.static_tree=o,x.extra_bits=f,x.extra_base=m,x.elems=v,x.max_length=y}var Y4t=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],q4t=Are([[144,8],[112,9],[24,7],[8,8]]);__.static_ltree=Ere(Y4t.map((o,f)=>[o,q4t[f]]));var X4t=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],J4t=Are([[30,5]]);__.static_dtree=Ere(X4t.map((o,f)=>[o,J4t[f]]));__.static_l_desc=new __(__.static_ltree,Tf.extra_lbits,256+1,286,15);__.static_d_desc=new __(__.static_dtree,Tf.extra_dbits,0,30,15);__.static_bl_desc=new __(null,Tf.extra_blbits,0,19,7);var K4t=9,Q4t=8;function zS(o,f,m,v,y){let x=this;x.good_length=o,x.max_lazy=f,x.nice_length=m,x.max_chain=v,x.func=y}var FYe=0,H$=1,zF=2,_E=[new zS(0,0,0,0,FYe),new zS(4,4,8,4,H$),new zS(4,5,16,8,H$),new zS(4,6,32,32,H$),new zS(4,4,16,16,zF),new zS(8,16,32,32,zF),new zS(8,16,128,128,zF),new zS(8,32,128,256,zF),new zS(32,128,258,1024,zF),new zS(32,258,258,4096,zF)],IQ=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],vE=0,MQ=1,A9=2,DQ=3,Z4t=32,tde=42,LQ=113,E9=666,ide=8,$4t=0,rde=1,ekt=2,Zf=3,U$=258,g1=U$+Zf+1;function hBe(o,f,m,v){let y=o[f*2],x=o[m*2];return y=3&&ne[Tf.bl_order[ai]*2+1]===0;ai--);return o.opt_len+=3*(ai+1)+5+5+4,ai}function Xe(ai){o.pending_buf[o.pending++]=ai}function it(ai){Xe(ai&255),Xe(ai>>>8&255)}function ut(ai){Xe(ai>>8&255),Xe(ai&255&255)}function at(ai,wi){let ji,hi=wi;he>16-hi?(ji=ai,ce|=ji<>>16-he,he+=hi-16):(ce|=ai<=8&&(Xe(ce&255),ce>>>=8,he-=8)}function Xt(){at(rde<<1,3),Pt(256,__.static_ltree),Ot(),1+pe+10-he<9&&(at(rde<<1,3),Pt(256,__.static_ltree),Ot()),pe=7}function At(ai,wi){let ji,hi,Ri;if(o.dist_buf[de]=ai,o.lc_buf[de]=wi&255,de++,ai===0?ie[wi*2]++:(ve++,ai--,ie[(Tf._length_code[wi]+256+1)*2]++,re[Tf.d_code(ai)*2]++),!(de&8191)&&Y>2){for(ji=de*8,hi=U-R,Ri=0;Ri<30;Ri++)ji+=re[Ri*2]*(5+Tf.extra_dbits[Ri]);if(ji>>>=3,ve8?it(ce):he>0&&Xe(ce&255),ce=0,he=0}function It(ai,wi,ji){gt(),pe=8,ji&&(it(wi),it(~wi)),o.pending_buf.set(A.subarray(ai,ai+wi),o.pending),o.pending+=wi}function Jt(ai,wi,ji){at(($4t<<1)+(ji?1:0),3),It(ai,wi,!0)}function bi(ai,wi,ji){let hi,Ri,pt=0;Y>0?(oe.build_tree(o),se.build_tree(o),pt=Ue(),hi=o.opt_len+3+7>>>3,Ri=o.static_len+3+7>>>3,Ri<=hi&&(hi=Ri)):hi=Ri=wi+5,wi+4<=hi&&ai!=-1?Jt(ai,wi,ji):Ri==hi?(at((rde<<1)+(ji?1:0),3),bt(__.static_ltree,__.static_dtree)):(at((ekt<<1)+(ji?1:0),3),ft(oe.max_code+1,se.max_code+1,pt+1),bt(ie,re)),Se(),ji&>()}function Yi(ai){bi(R>=0?R:-1,U-R,ai),R=U,f.flush_pending()}function ii(){let ai,wi,ji,hi;do{if(hi=E-j-U,hi===0&&U===0&&j===0)hi=x;else if(hi==-1)hi--;else if(U>=x+x-g1){A.set(A.subarray(x,x+x),0),G-=x,U-=x,R-=x,ai=I,ji=ai;do wi=S[--ji]&65535,S[ji]=wi>=x?wi-x:0;while(--ai!==0);ai=x,ji=ai;do wi=T[--ji]&65535,T[ji]=wi>=x?wi-x:0;while(--ai!==0);hi+=x}if(f.avail_in===0)return;ai=f.read_buf(A,U+j,hi),j+=ai,j>=Zf&&(M=A[U]&255,M=(M<v-5&&(wi=v-5);;){if(j<=1){if(ii(),j===0&&ai==0)return vE;if(j===0)break}if(U+=j,j=0,ji=R+wi,(U===0||U>=ji)&&(j=U-ji,U=ji,Yi(!1),f.avail_out===0)||U-R>=x-g1&&(Yi(!1),f.avail_out===0))return vE}return Yi(ai==4),f.avail_out===0?ai==4?A9:vE:ai==4?DQ:MQ}function Li(ai){let wi=J,ji=U,hi,Ri,pt=q,wr=U>x-g1?U-(x-g1):0,zi=z,Ui=w,Gt=U+U$,$t=A[ji+pt-1],jt=A[ji+pt];q>=ee&&(wi>>=2),zi>j&&(zi=j);do if(hi=ai,!(A[hi+pt]!=jt||A[hi+pt-1]!=$t||A[hi]!=A[ji]||A[++hi]!=A[ji+1])){ji+=2,hi++;do;while(A[++ji]==A[++hi]&&A[++ji]==A[++hi]&&A[++ji]==A[++hi]&&A[++ji]==A[++hi]&&A[++ji]==A[++hi]&&A[++ji]==A[++hi]&&A[++ji]==A[++hi]&&A[++ji]==A[++hi]&&jipt){if(G=ai,pt=Ri,Ri>=zi)break;$t=A[ji+pt-1],jt=A[ji+pt]}}while((ai=T[ai&Ui]&65535)>wr&&--wi!==0);return pt<=j?pt:j}function Je(ai){let wi=0,ji;for(;;){if(j=Zf&&(M=(M<=Zf)if(ji=At(U-G,O-Zf),j-=O,O<=X&&j>=Zf){O--;do U++,M=(M<=Zf&&(M=(M<4096)&&(O=Zf-1)),q>=Zf&&O<=q){hi=U+j-Zf,ji=At(U-1-F,q-Zf),j-=q-1,q-=2;do++U<=hi&&(M=(M<K4t||hi!=ide||ji<9||ji>15||wi<0||wi>9||pt<0||pt>2?-2:(ai.dstate=o,C=ji,x=1<9||ji<0||ji>2?-2:(_E[Y].func!=_E[wi].func&&ai.total_in!==0&&(hi=ai.deflate(1)),Y!=wi&&(Y=wi,X=_E[Y].max_lazy,ee=_E[Y].good_length,z=_E[Y].nice_length,J=_E[Y].max_chain),Q=ji,hi)},o.deflateSetDictionary=function(ai,wi,ji){let hi=ji,Ri,pt=0;if(!wi||m!=tde)return-2;if(hix-g1&&(hi=x-g1,pt=ji-hi),A.set(wi.subarray(pt,pt+hi),0),U=hi,R=hi,M=A[0]&255,M=(M<4||wi<0)return-2;if(!ai.next_out||!ai.next_in&&ai.avail_in!==0||m==E9&&wi!=4)return ai.msg=IQ[2- -2],-2;if(ai.avail_out===0)return ai.msg=IQ[2- -5],-5;if(f=ai,pt=y,y=wi,m==tde&&(hi=ide+(C-8<<4)<<8,Ri=(Y-1&255)>>1,Ri>3&&(Ri=3),hi|=Ri<<6,U!==0&&(hi|=Z4t),hi+=31-hi%31,m=LQ,ut(hi)),o.pending!==0){if(f.flush_pending(),f.avail_out===0)return y=-1,0}else if(f.avail_in===0&&wi<=pt&&wi!=4)return f.msg=IQ[2- -5],-5;if(m==E9&&f.avail_in!==0)return ai.msg=IQ[2- -5],-5;if(f.avail_in!==0||j!==0||wi!=0&&m!=E9){switch(wr=-1,_E[Y].func){case FYe:wr=ei(wi);break;case H$:wr=Je(wi);break;case zF:wr=Nt(wi);break;default:}if((wr==A9||wr==DQ)&&(m=E9),wr==vE||wr==A9)return f.avail_out===0&&(y=-1),0;if(wr==MQ){if(wi==1)Xt();else if(Jt(0,0,!1),wi==3)for(ji=0;jim&&(y=m),y===0?0:(v.avail_in-=y,o.set(v.next_in.subarray(v.next_in_index,v.next_in_index+y),f),v.next_in_index+=y,v.total_in+=y,y)},flush_pending:function(){let o=this,f=o.dstate.pending;f>o.avail_out&&(f=o.avail_out),f!==0&&(o.next_out.set(o.dstate.pending_buf.subarray(o.dstate.pending_out,o.dstate.pending_out+f),o.next_out_index),o.next_out_index+=f,o.dstate.pending_out+=f,o.total_out+=f,o.avail_out-=f,o.dstate.pending-=f,o.dstate.pending===0&&(o.dstate.pending_out=0))}};function ikt(o){let f=this,m=new BYe,v=rkt(o&&o.chunkSize?o.chunkSize:64*1024),y=0,x=new Uint8Array(v),C=o?o.level:-1;typeof C>"u"&&(C=-1),m.deflateInit(C),m.next_out=x,f.append=function(w,A){let E,T,S=0,M=0,I=0,P=[];if(w.length){m.next_in_index=0,m.next_in=w,m.avail_in=w.length;do{if(m.next_out_index=0,m.avail_out=v,E=m.deflate(y),E!=0)throw new Error("deflating: "+m.msg);m.next_out_index&&(m.next_out_index==v?P.push(new Uint8Array(x)):P.push(x.slice(0,m.next_out_index))),I+=m.next_out_index,A&&m.next_in_index>0&&m.next_in_index!=S&&(A(m.next_in_index),S=m.next_in_index)}while(m.avail_in>0||m.avail_out===0);return P.length>1?(T=new Uint8Array(I),P.forEach(function(D){T.set(D,M),M+=D.length})):T=P[0]||new Uint8Array(0),T}},f.flush=function(){let w,A,E=0,T=0,S=[];do{if(m.next_out_index=0,m.avail_out=v,w=m.deflate(4),w!=1&&w!=0)throw new Error("deflating: "+m.msg);v-m.avail_out>0&&S.push(x.slice(0,m.next_out_index)),T+=m.next_out_index}while(m.avail_in>0||m.avail_out===0);return m.deflateEnd(),A=new Uint8Array(T),S.forEach(function(M){A.set(M,E),E+=M.length}),A}}function rkt(o){return o+5*(Math.floor(o/16383)+1)}var nkt=ikt,C1=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],kYe=1440,okt=0,akt=4,skt=9,lkt=5,ukt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ckt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],hkt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],dkt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],fkt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],pkt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],$L=15;function Hme(){let o=this,f,m,v,y,x,C;function w(E,T,S,M,I,P,D,L,R,O,F){let k,U,G,j,q,J,X,Y,Q,ee,z,ie,re,ne,oe;ee=0,q=S;do v[E[T+ee]]++,ee++,q--;while(q!==0);if(v[0]==S)return D[0]=-1,L[0]=0,0;for(Y=L[0],J=1;J<=$L&&v[J]===0;J++);for(X=J,Yq&&(Y=q),L[0]=Y,ne=1<ie+Y;){if(j++,ie+=Y,oe=G-ie,oe=oe>Y?Y:oe,(U=1<<(J=X-ie))>k+1&&(U-=k+1,re=X,JkYe)return-3;x[j]=z=O[0],O[0]+=oe,j!==0?(C[j]=q,y[0]=J,y[1]=Y,J=q>>>ie-Y,y[2]=z-x[j-1]-J,R.set(y,(x[j-1]+J)*3)):D[0]=z}for(y[1]=X-ie,ee>=S?y[0]=128+64:F[ee]>>ie;J>>=1)q^=J;for(q^=J,Q=(1<257?(O==-3?R.msg="oversubscribed distance tree":O==-5?(R.msg="incomplete distance tree",O=-3):O!=-4&&(R.msg="empty distance tree with lengths",O=-3),O):0)}}Hme.inflate_trees_fixed=function(o,f,m,v){return o[0]=skt,f[0]=lkt,m[0]=ukt,v[0]=ckt,0};var RQ=0,dBe=1,fBe=2,pBe=3,mBe=4,gBe=5,_Be=6,nde=7,vBe=8,OQ=9;function mkt(){let o=this,f,m=0,v,y=0,x=0,C=0,w=0,A=0,E=0,T=0,S,M=0,I,P=0;function D(L,R,O,F,k,U,G,j){let q,J,X,Y,Q,ee,z,ie,re,ne,oe,se,ae,fe,de,ve;z=j.next_in_index,ie=j.avail_in,Q=G.bitb,ee=G.bitk,re=G.write,ne=re>=J[ve+1],ee-=J[ve+1],G.win[re++]=J[ve+2],ne--;continue}do{if(Q>>=J[ve+1],ee-=J[ve+1],Y&16){for(Y&=15,ae=J[ve+2]+(Q&C1[Y]),Q>>=Y,ee-=Y;ee<15;)ie--,Q|=(j.read_byte(z++)&255)<>=J[ve+1],ee-=J[ve+1],Y&16){for(Y&=15;ee>=Y,ee-=Y,ne-=ae,re>=fe)de=re-fe,re-de>0&&2>re-de?(G.win[re++]=G.win[de++],G.win[re++]=G.win[de++],ae-=2):(G.win.set(G.win.subarray(de,de+2),re),re+=2,de+=2,ae-=2);else{de=re-fe;do de+=G.end;while(de<0);if(Y=G.end-de,ae>Y){if(ae-=Y,re-de>0&&Y>re-de)do G.win[re++]=G.win[de++];while(--Y!==0);else G.win.set(G.win.subarray(de,de+Y),re),re+=Y,de+=Y,Y=0;de=0}}if(re-de>0&&ae>re-de)do G.win[re++]=G.win[de++];while(--ae!==0);else G.win.set(G.win.subarray(de,de+ae),re),re+=ae,de+=ae,ae=0;break}else if(!(Y&64))q+=J[ve+2],q+=Q&C1[Y],ve=(X+q)*3,Y=J[ve];else return j.msg="invalid distance code",ae=j.avail_in-ie,ae=ee>>3>3:ae,ie+=ae,z-=ae,ee-=ae<<3,G.bitb=Q,G.bitk=ee,j.avail_in=ie,j.total_in+=z-j.next_in_index,j.next_in_index=z,G.write=re,-3;while(!0);break}if(Y&64)return Y&32?(ae=j.avail_in-ie,ae=ee>>3>3:ae,ie+=ae,z-=ae,ee-=ae<<3,G.bitb=Q,G.bitk=ee,j.avail_in=ie,j.total_in+=z-j.next_in_index,j.next_in_index=z,G.write=re,1):(j.msg="invalid literal/length code",ae=j.avail_in-ie,ae=ee>>3>3:ae,ie+=ae,z-=ae,ee-=ae<<3,G.bitb=Q,G.bitk=ee,j.avail_in=ie,j.total_in+=z-j.next_in_index,j.next_in_index=z,G.write=re,-3);if(q+=J[ve+2],q+=Q&C1[Y],ve=(X+q)*3,(Y=J[ve])===0){Q>>=J[ve+1],ee-=J[ve+1],G.win[re++]=J[ve+2],ne--;break}}while(!0)}while(ne>=258&&ie>=10);return ae=j.avail_in-ie,ae=ee>>3>3:ae,ie+=ae,z-=ae,ee-=ae<<3,G.bitb=Q,G.bitk=ee,j.avail_in=ie,j.total_in+=z-j.next_in_index,j.next_in_index=z,G.write=re,0}o.init=function(L,R,O,F,k,U){f=RQ,E=L,T=R,S=O,M=F,I=k,P=U,v=null},o.proc=function(L,R,O){let F,k,U,G=0,j=0,q=0,J,X,Y,Q;for(q=R.next_in_index,J=R.avail_in,G=L.bitb,j=L.bitk,X=L.write,Y=X=258&&J>=10&&(L.bitb=G,L.bitk=j,R.avail_in=J,R.total_in+=q-R.next_in_index,R.next_in_index=q,L.write=X,O=D(E,T,S,M,I,P,L,R),q=R.next_in_index,J=R.avail_in,G=L.bitb,j=L.bitk,X=L.write,Y=X>>=v[k+1],j-=v[k+1],U=v[k],U===0){C=v[k+2],f=_Be;break}if(U&16){w=U&15,m=v[k+2],f=fBe;break}if(!(U&64)){x=U,y=k/3+v[k+2];break}if(U&32){f=nde;break}return f=OQ,R.msg="invalid literal/length code",O=-3,L.bitb=G,L.bitk=j,R.avail_in=J,R.total_in+=q-R.next_in_index,R.next_in_index=q,L.write=X,L.inflate_flush(R,O);case fBe:for(F=w;j>=F,j-=F,x=T,v=I,y=P,f=pBe;case pBe:for(F=x;j>=v[k+1],j-=v[k+1],U=v[k],U&16){w=U&15,A=v[k+2],f=mBe;break}if(!(U&64)){x=U,y=k/3+v[k+2];break}return f=OQ,R.msg="invalid distance code",O=-3,L.bitb=G,L.bitk=j,R.avail_in=J,R.total_in+=q-R.next_in_index,R.next_in_index=q,L.write=X,L.inflate_flush(R,O);case mBe:for(F=w;j>=F,j-=F,f=gBe;case gBe:for(Q=X-A;Q<0;)Q+=L.end;for(;m!==0;){if(Y===0&&(X==L.end&&L.read!==0&&(X=0,Y=X7&&(j-=8,J++,q--),L.write=X,O=L.inflate_flush(R,O),X=L.write,Y=XD.avail_out&&(R=D.avail_out),R!==0&&L==-5&&(L=0),D.avail_out-=R,D.total_out+=R,D.next_out.set(m.win.subarray(F,F+R),O),O+=R,F+=R,F==m.end&&(F=0,m.write==m.end&&(m.write=0),R=m.write-F,R>D.avail_out&&(R=D.avail_out),R!==0&&L==-5&&(L=0),D.avail_out-=R,D.total_out+=R,D.next_out.set(m.win.subarray(F,F+R),O),O+=R,F+=R),D.next_out_index=O,m.read=F,L},m.proc=function(D,L){let R,O,F,k,U,G,j,q;for(k=D.next_in_index,U=D.avail_in,O=m.bitb,F=m.bitk,G=m.write,j=G>>1){case 0:O>>>=3,F-=3,R=F&7,O>>>=R,F-=R,v=ode;break;case 1:J=[],X=[],Y=[[]],Q=[[]],Hme.inflate_trees_fixed(J,X,Y,Q),T.init(J[0],X[0],Y[0],0,Q[0],0),O>>>=3,F-=3,v=NQ;break;case 2:O>>>=3,F-=3,v=CBe;break;case 3:return O>>>=3,F-=3,v=CF,D.msg="invalid block type",L=-3,m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L)}break;case ode:for(;F<32;){if(U!==0)L=0;else return m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L);U--,O|=(D.read_byte(k++)&255)<>>16&65535)!=(O&65535))return v=CF,D.msg="invalid stored block lengths",L=-3,m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L);y=O&65535,O=F=0,v=y!==0?xBe:S!==0?FQ:AV;break;case xBe:if(U===0||j===0&&(G==m.end&&m.read!==0&&(G=0,j=GU&&(R=U),R>j&&(R=j),m.win.set(D.read_buf(k,R),G),k+=R,U-=R,G+=R,j-=R,(y-=R)!==0)break;v=S!==0?FQ:AV;break;case CBe:for(;F<14;){if(U!==0)L=0;else return m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L);U--,O|=(D.read_byte(k++)&255)<29||(R>>5&31)>29)return v=CF,D.msg="too many length or distance symbols",L=-3,m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L);if(R=258+(R&31)+(R>>5&31),!w||w.length>>=14,F-=14,C=0,v=bBe;case bBe:for(;C<4+(x>>>10);){for(;F<3;){if(U!==0)L=0;else return m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L);U--,O|=(D.read_byte(k++)&255)<>>=3,F-=3}for(;C<19;)w[yBe[C++]]=0;if(A[0]=7,R=P.inflate_trees_bits(w,A,E,M,D),R!=0)return L=R,L==-3&&(w=null,v=CF),m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L);C=0,v=wBe;case wBe:for(;R=x,!(C>=258+(R&31)+(R>>5&31));){let ne,oe;for(R=A[0];F>>=R,F-=R,w[C++]=oe;else{for(q=oe==18?7:oe-14,ne=oe==18?11:3;F>>=R,F-=R,ne+=O&C1[q],O>>>=q,F-=q,q=C,R=x,q+ne>258+(R&31)+(R>>5&31)||oe==16&&q<1)return w=null,v=CF,D.msg="invalid bit length repeat",L=-3,m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L);oe=oe==16?w[q-1]:0;do w[q++]=oe;while(--ne!==0);C=q}}if(E[0]=-1,ee=[],z=[],ie=[],re=[],ee[0]=9,z[0]=6,R=x,R=P.inflate_trees_dynamic(257+(R&31),1+(R>>5&31),w,ee,z,ie,re,M,D),R!=0)return R==-3&&(w=null,v=CF),L=R,m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,m.inflate_flush(D,L);T.init(ee[0],z[0],M,ie[0],M,re[0]),v=NQ;case NQ:if(m.bitb=O,m.bitk=F,D.avail_in=U,D.total_in+=k-D.next_in_index,D.next_in_index=k,m.write=G,(L=T.proc(m,D,L))!=1)return m.inflate_flush(D,L);if(L=0,T.free(D),k=D.next_in_index,U=D.avail_in,O=m.bitb,F=m.bitk,G=m.write,j=G15?(o.inflateEnd(m),-2):(o.wbits=v,m.istate.blocks=new gkt(m,1<>4)+8>C.wbits){C.mode=eR,m.msg="invalid win size",C.marker=5;break}C.mode=EBe;case EBe:if(m.avail_in===0)return y;if(y=v,m.avail_in--,m.total_in++,x=m.read_byte(m.next_in_index++)&255,((C.method<<8)+x)%31!==0){C.mode=eR,m.msg="incorrect header check",C.marker=5;break}if(!(x&_kt)){C.mode=T9;break}C.mode=TBe;case TBe:if(m.avail_in===0)return y;y=v,m.avail_in--,m.total_in++,C.need=(m.read_byte(m.next_in_index++)&255)<<24&4278190080,C.mode=SBe;case SBe:if(m.avail_in===0)return y;y=v,m.avail_in--,m.total_in++,C.need+=(m.read_byte(m.next_in_index++)&255)<<16&16711680,C.mode=PBe;case PBe:if(m.avail_in===0)return y;y=v,m.avail_in--,m.total_in++,C.need+=(m.read_byte(m.next_in_index++)&255)<<8&65280,C.mode=IBe;case IBe:return m.avail_in===0?y:(y=v,m.avail_in--,m.total_in++,C.need+=m.read_byte(m.next_in_index++)&255,C.mode=ade,2);case ade:return C.mode=eR,m.msg="need dictionary",C.marker=0,-2;case T9:if(y=C.blocks.proc(m,y),y==-3){C.mode=eR,C.marker=0;break}if(y==0&&(y=v),y!=1)return y;y=v,C.blocks.reset(m,C.was),C.mode=MBe;case MBe:return m.avail_in=0,1;case eR:return-3;default:return-2}},o.inflateSetDictionary=function(m,v,y){let x=0,C=y;if(!m||!m.istate||m.istate.mode!=ade)return-2;let w=m.istate;return C>=1<0&&m.next_in_index!=M&&(A(m.next_in_index),M=m.next_in_index)}while(m.avail_in>0||m.avail_out===0);return E.length>1?(S=new Uint8Array(P),E.forEach(function(D){S.set(D,I),I+=D.length})):S=E[0]||new Uint8Array(0),S}},f.flush=function(){m.inflateEnd()}}var wkt=bkt,Akt={chunkSize:524288,maxWorkers:typeof navigator<"u"&&navigator.hardwareConcurrency||2,terminateWorkerTimeout:5e3,useWebWorkers:!0,workerScripts:void 0},Gx=Object.assign({},Akt);function zYe(){return Gx}function sCe(o){if(o.baseURL!==void 0&&(Gx.baseURL=o.baseURL),o.chunkSize!==void 0&&(Gx.chunkSize=o.chunkSize),o.maxWorkers!==void 0&&(Gx.maxWorkers=o.maxWorkers),o.terminateWorkerTimeout!==void 0&&(Gx.terminateWorkerTimeout=o.terminateWorkerTimeout),o.useWebWorkers!==void 0&&(Gx.useWebWorkers=o.useWebWorkers),o.Deflate!==void 0&&(Gx.Deflate=o.Deflate),o.Inflate!==void 0&&(Gx.Inflate=o.Inflate),o.workerScripts!==void 0){if(o.workerScripts.deflate){if(!Array.isArray(o.workerScripts.deflate))throw new Error("workerScripts.deflate must be an array");Gx.workerScripts||(Gx.workerScripts={}),Gx.workerScripts.deflate=o.workerScripts.deflate}if(o.workerScripts.inflate){if(!Array.isArray(o.workerScripts.inflate))throw new Error("workerScripts.inflate must be an array");Gx.workerScripts||(Gx.workerScripts={}),Gx.workerScripts.inflate=o.workerScripts.inflate}}}var HYe=[];for(let o=0;o<256;o++){let f=o;for(let m=0;m<8;m++)f&1?f=f>>>1^3988292384:f=f>>>1;HYe[o]=f}var Ekt=class{constructor(o){this.crc=o||-1}append(o){let f=this.crc|0;for(let m=0,v=o.length|0;m>>8^HYe[(f^o[m])&255];this.crc=f}get(){return~this.crc}},$W=Ekt,Ume=Tkt;function Tkt(o){if(typeof TextEncoder>"u"){o=unescape(encodeURIComponent(o));let f=new Uint8Array(o.length);for(let m=0;m0&&f&&(o[m-1]=Ry.partial(f,o[m-1]&2147483648>>f-1,1)),o},partial(o,f,m){return o===32?f:(m?f|0:f<<32-o)+o*1099511627776},getPartial(o){return Math.round(o/1099511627776)||32},_shiftRight(o,f,m,v){for(v===void 0&&(v=[]);f>=32;f-=32)v.push(m),m=0;if(f===0)return v.concat(o);for(let C=0;C>>f),m=o[C]<<32-f;let y=o.length?o[o.length-1]:0,x=Ry.getPartial(y);return v.push(Ry.partial(f+x&31,f+x>32?m:v.pop(),1)),v}},Bee={bytes:{fromBits(o){let f=Ry.bitLength(o)/8,m=new Uint8Array(f),v;for(let y=0;y>>24,v<<=8;return m},toBits(o){let f=[],m,v=0;for(m=0;m9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let x=new Uint32Array(m),C=0;for(let w=f.blockSize+v-(f.blockSize+v&f.blockSize-1);w<=y;w+=f.blockSize)f._block(x.subarray(16*C,16*(C+1))),C+=1;return m.splice(0,16*C),f},finalize:function(){let o=this,f=o._buffer,m=o._h;f=Ry.concat(f,[Ry.partial(1,1)]);for(let v=f.length+2;v&15;v++)f.push(0);for(f.push(Math.floor(o._length/4294967296)),f.push(o._length|0);f.length;)o._block(f.splice(0,16));return o.reset(),m},_init:[1732584193,4023233417,2562383102,271733878,3285377520],_key:[1518500249,1859775393,2400959708,3395469782],_f:function(o,f,m,v){if(o<=19)return f&m|~f&v;if(o<=39)return f^m^v;if(o<=59)return f&m|f&v|m&v;if(o<=79)return f^m^v},_S:function(o,f){return f<>>32-o},_block:function(o){let f=this,m=f._h,v=Array(80);for(let E=0;E<16;E++)v[E]=o[E];let y=m[0],x=m[1],C=m[2],w=m[3],A=m[4];for(let E=0;E<=79;E++){E>=16&&(v[E]=f._S(1,v[E-3]^v[E-8]^v[E-14]^v[E-16]));let T=f._S(5,y)+f._f(E,x,C,w)+A+v[E]+f._key[Math.floor(E/20)]|0;A=w,w=C,C=f._S(30,x),x=y,y=T}m[0]=m[0]+y|0,m[1]=m[1]+x|0,m[2]=m[2]+C|0,m[3]=m[3]+w|0,m[4]=m[4]+A|0}};var UYe={};UYe.aes=class{constructor(o){let f=this;f._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],f._tables[0][0][0]||f._precompute();let m=f._tables[0][4],v=f._tables[1],y=o.length,x,C,w,A=1;if(y!==4&&y!==6&&y!==8)throw new Error("invalid aes key size");for(f._key=[C=o.slice(0),w=[]],x=y;x<4*y+28;x++){let E=C[x-1];(x%y===0||y===8&&x%y===4)&&(E=m[E>>>24]<<24^m[E>>16&255]<<16^m[E>>8&255]<<8^m[E&255],x%y===0&&(E=E<<8^E>>>24^A<<24,A=A<<1^(A>>7)*283)),C[x]=C[x-y]^E}for(let E=0;x;E++,x--){let T=C[E&3?x:x-4];x<=4||E<4?w[E]=T:w[E]=v[0][m[T>>>24]]^v[1][m[T>>16&255]]^v[2][m[T>>8&255]]^v[3][m[T&255]]}}encrypt(o){return this._crypt(o,0)}decrypt(o){return this._crypt(o,1)}_precompute(){let o=this._tables[0],f=this._tables[1],m=o[4],v=f[4],y=[],x=[],C,w,A,E;for(let T=0;T<256;T++)x[(y[T]=T<<1^(T>>7)*283)^T]=T;for(let T=C=0;!m[T];T^=w||1,C=x[C]||1){let S=C^C<<1^C<<2^C<<3^C<<4;S=S>>8^S&255^99,m[T]=S,v[S]=T,E=y[A=y[w=y[T]]];let M=E*16843009^A*65537^w*257^T*16843008,I=y[S]*257^S*16843008;for(let P=0;P<4;P++)o[P][T]=I=I<<24^I>>>8,f[P][S]=M=M<<24^M>>>8}for(let T=0;T<5;T++)o[T]=o[T].slice(0),f[T]=f[T].slice(0)}_crypt(o,f){if(o.length!==4)throw new Error("invalid aes block size");let m=this._key[f],v=m.length/4-2,y=[0,0,0,0],x=this._tables[f],C=x[0],w=x[1],A=x[2],E=x[3],T=x[4],S=o[0]^m[0],M=o[f?3:1]^m[1],I=o[2]^m[2],P=o[f?1:3]^m[3],D=4,L,R,O;for(let F=0;F>>24]^w[M>>16&255]^A[I>>8&255]^E[P&255]^m[D],R=C[M>>>24]^w[I>>16&255]^A[P>>8&255]^E[S&255]^m[D+1],O=C[I>>>24]^w[P>>16&255]^A[S>>8&255]^E[M&255]^m[D+2],P=C[P>>>24]^w[S>>16&255]^A[M>>8&255]^E[I&255]^m[D+3],D+=4,S=L,M=R,I=O;for(let F=0;F<4;F++)y[f?3&-F:F]=T[S>>>24]<<24^T[M>>16&255]<<16^T[I>>8&255]<<8^T[P&255]^m[D++],L=S,S=M,M=I,I=P,P=L;return y}};var Skt={getRandomValues(o){let f=new Uint32Array(o.buffer),m=v=>{let y=987654321,x=4294967295;return function(){return y=36969*(y&65535)+(y>>16)&x,v=18e3*(v&65535)+(v>>16)&x,(((y<<16)+v&x)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let v=0,y;v>24&255)===255){let f=o>>16&255,m=o>>8&255,v=o&255;f===255?(f=0,m===255?(m=0,v===255?v=0:++v):++m):++f,o=0,o+=f<<16,o+=m<<8,o+=v}else o+=1<<24;return o}incCounter(o){(o[0]=this.incWord(o[0]))===0&&(o[1]=this.incWord(o[1]))}calculate(o,f,m){let v;if(!(v=f.length))return[];let y=Ry.bitLength(f);for(let x=0;x>5)+1<<2,x,C,w,A,E,T=new ArrayBuffer(y),S=new DataView(T),M=0,I=Ry;for(f=Bee.bytes.toBits(f),E=1;M<(y||1);E++){for(x=C=o.encrypt(I.concat(f,[E])),w=1;wy&&(o=m.hash(o));for(let x=0;xo.length){let m=o;o=new Uint8Array(f),o.set(m,0)}return o}function D1(o,f,m){return o.subarray(f,m)}var Fz=12,Hkt=class{constructor(o,f){let m=this;Object.assign(m,{password:o,passwordVerification:f}),eqe(m,o)}append(o){let f=this;if(f.password){let m=DBe(f,o.subarray(0,Fz));if(f.password=null,m[Fz-1]!=f.passwordVerification)throw new Error(WYe);o=o.subarray(Fz)}return DBe(f,o)}flush(){return{valid:!0,data:new Uint8Array(0)}}},Ukt=class{constructor(o,f){let m=this;Object.assign(m,{password:o,passwordVerification:f}),eqe(m,o)}append(o){let f=this,m,v;if(f.password){f.password=null;let y=crypto.getRandomValues(new Uint8Array(Fz));y[Fz-1]=f.passwordVerification,m=new Uint8Array(o.length+y.length),m.set(LBe(f,y),0),v=Fz}else m=new Uint8Array(o.length),v=0;return m.set(LBe(f,o),v),m}flush(){return{data:new Uint8Array(0)}}};function DBe(o,f){let m=new Uint8Array(f.length);for(let v=0;v>>24]),o.keys[2]=~o.crcKey2.get()}function tqe(o){let f=o.keys[2]|2;return iqe(Math.imul(f,f^1)>>>8)}function iqe(o){return o&255}function RBe(o){return o&4294967295}var rqe="deflate",nqe="inflate",OBe="Invalid signature",Gkt=class{constructor(o,{signature:f,password:m,signed:v,compressed:y,zipCrypto:x,passwordVerification:C,encryptionStrength:w},{chunkSize:A}){let E=!!m;Object.assign(this,{signature:f,encrypted:E,signed:v,compressed:y,inflate:y&&new o({chunkSize:A}),crc32:v&&new $W,zipCrypto:x,decrypt:E&&x?new Hkt(m,C):new Rkt(m,v,w)})}async append(o){let f=this;return f.encrypted&&o.length&&(o=await f.decrypt.append(o)),f.compressed&&o.length&&(o=await f.inflate.append(o)),(!f.encrypted||f.zipCrypto)&&f.signed&&o.length&&f.crc32.append(o),o}async flush(){let o=this,f,m=new Uint8Array(0);if(o.encrypted){let v=o.decrypt.flush();if(!v.valid)throw new Error(OBe);m=v.data}if((!o.encrypted||o.zipCrypto)&&o.signed){let v=new DataView(new Uint8Array(4).buffer);if(f=o.crc32.get(),v.setUint32(0,f),o.signature!=v.getUint32(0,!1))throw new Error(OBe)}return o.compressed&&(m=await o.inflate.append(m)||new Uint8Array(0),await o.inflate.flush()),{data:m,signature:f}}},Wkt=class{constructor(o,{encrypted:f,signed:m,compressed:v,level:y,zipCrypto:x,password:C,passwordVerification:w,encryptionStrength:A},{chunkSize:E}){Object.assign(this,{encrypted:f,signed:m,compressed:v,deflate:v&&new o({level:y||5,chunkSize:E}),crc32:m&&new $W,zipCrypto:x,encrypt:f&&x?new Ukt(C,w):new Okt(C,A)})}async append(o){let f=this,m=o;return f.compressed&&o.length&&(m=await f.deflate.append(o)),f.encrypted&&m.length&&(m=await f.encrypt.append(m)),(!f.encrypted||f.zipCrypto)&&f.signed&&o.length&&f.crc32.append(o),m}async flush(){let o=this,f,m=new Uint8Array(0);if(o.compressed&&(m=await o.deflate.flush()||new Uint8Array(0)),o.encrypted){m=await o.encrypt.append(m);let v=o.encrypt.flush();f=v.signature;let y=new Uint8Array(m.length+v.data.length);y.set(m,0),y.set(v.data,m.length),m=y}return(!o.encrypted||o.zipCrypto)&&o.signed&&(f=o.crc32.get()),{data:m,signature:f}}};function jkt(o,f,m){if(f.codecType.startsWith(rqe))return new Wkt(o,f,m);if(f.codecType.startsWith(nqe))return new Gkt(o,f,m)}var NBe="init",FBe="append",sde="flush",Ykt="message",BBe=!0,lde=(o,f,m,v,y,x,C)=>(Object.assign(o,{busy:!0,codecConstructor:f,options:Object.assign({},m),scripts:C,terminate(){o.worker&&!o.busy&&(o.worker.terminate(),o.interface=null)},onTaskFinished(){o.busy=!1,y(o)}}),x?Xkt(o,v):qkt(o,v));function qkt(o,f){let m=jkt(o.codecConstructor,o.options,f);return{async append(v){try{return await m.append(v)}catch(y){throw o.onTaskFinished(),y}},async flush(){try{return await m.flush()}finally{o.onTaskFinished()}},abort(){o.onTaskFinished()}}}function Xkt(o,f){let m,v={type:"module"};if(!o.interface){if(!BBe)o.worker=y(v,f.baseURL);else try{o.worker=y({},f.baseURL)}catch{BBe=!1,o.worker=y(v,f.baseURL)}o.worker.addEventListener(Ykt,w,!1),o.interface={append(A){return x({type:FBe,data:A})},flush(){return x({type:sde})},abort(){o.onTaskFinished()}}}return o.interface;function y(A,E){let T,S;T=o.scripts[0],typeof T=="function"&&(T=T());try{S=new URL(T,E)}catch{S=T}return new Worker(S,A)}async function x(A){if(!m){let E=o.options,T=o.scripts.slice(1);await C({scripts:T,type:NBe,options:E,config:{chunkSize:f.chunkSize}})}return C(A)}function C(A){let E=o.worker,T=new Promise((S,M)=>m={resolve:S,reject:M});try{if(A.data)try{A.data=A.data.buffer,E.postMessage(A,[A.data])}catch{E.postMessage(A)}else E.postMessage(A)}catch(S){m.reject(S),m=null,o.onTaskFinished()}return T}function w(A){let E=A.data;if(m){let T=E.error,S=E.type;if(T){let M=new Error(T.message);M.stack=T.stack,m.reject(M),m=null,o.onTaskFinished()}else if(S==NBe||S==sde||S==FBe){let M=E.data;S==sde?(m.resolve({data:new Uint8Array(M),signature:E.signature}),m=null,o.onTaskFinished()):m.resolve(M&&new Uint8Array(M))}}}}var bF=[],ude=[];function oqe(o,f,m){let v=!(!f.compressed&&!f.signed&&!f.encrypted)&&(f.useWebWorkers||f.useWebWorkers===void 0&&m.useWebWorkers),y=v&&m.workerScripts?m.workerScripts[f.codecType]:[];if(bF.length!w.busy);return C?(kBe(C),lde(C,o,f,m,x,v,y)):new Promise(w=>ude.push({resolve:w,codecConstructor:o,options:f,webWorker:v,scripts:y}))}function x(C){if(ude.length){let[{resolve:w,codecConstructor:A,options:E,webWorker:T,scripts:S}]=ude.splice(0,1);w(lde(C,A,E,m,x,T,S))}else C.worker?(kBe(C),Number.isFinite(m.terminateWorkerTimeout)&&m.terminateWorkerTimeout>=0&&(C.terminateTimeout=setTimeout(()=>{bF=bF.filter(w=>w!=C),C.terminate()},m.terminateWorkerTimeout))):bF=bF.filter(w=>w!=C)}}function kBe(o){o.terminateTimeout&&(clearTimeout(o.terminateTimeout),o.terminateTimeout=null)}var Jkt="Abort error";async function aqe(o,f,m,v,y,x,C){let w=Math.max(x.chunkSize,64);return A();async function A(E=0,T=0){let S=C.signal,M=y();if(E{o.onload=v=>f(v.target.result),o.onerror=()=>m(o.error),o.readAsText(this.blob,this.encoding)})}}},Zkt=class extends hCe{constructor(o){super(),this.data="data:"+(o||"")+";base64,",this.pending=[]}writeUint8Array(o){super.writeUint8Array(o);let f=0,m=this.pending,v=this.pending.length;for(this.pending="",f=0;f2?this.data+=btoa(m):this.pending=m}getData(){return this.data+btoa(this.pending)}},dCe=class extends lqe{constructor(o){super(),this.blob=o,this.size=o.size}async readUint8Array(o,f){if(this.blob.arrayBuffer)return new Uint8Array(await this.blob.slice(o,o+f).arrayBuffer());{let m=new FileReader;return new Promise((v,y)=>{m.onload=x=>v(new Uint8Array(x.target.result)),m.onerror=()=>y(m.error),m.readAsArrayBuffer(this.blob.slice(o,o+f))})}}},uqe=class extends hCe{constructor(o){super(),this.contentType=o,this.arrayBuffersMaxlength=8,zBe(this)}writeUint8Array(o){super.writeUint8Array(o),this.arrayBuffers.length==this.arrayBuffersMaxlength&&HBe(this),this.arrayBuffers.push(o.buffer)}getData(){return this.blob||(this.arrayBuffers.length&&HBe(this),this.blob=this.pendingBlob,zBe(this)),this.blob}};function zBe(o){o.pendingBlob=new Blob([],{type:o.contentType}),o.arrayBuffers=[]}function HBe(o){o.pendingBlob=new Blob([o.pendingBlob,...o.arrayBuffers],{type:o.contentType}),o.arrayBuffers=[]}var G$="/",UBe=new Date(2107,11,31),GBe=new Date(1980,0,1),$kt="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),eVt=o=>{let f="";for(let m=0;m"u"){let m=new FileReader;return new Promise((v,y)=>{m.onload=x=>v(x.target.result),m.onerror=()=>y(m.error),m.readAsText(new Blob([o]))})}else return new TextDecoder(f).decode(o)}var iVt=["filename","rawFilename","directory","encrypted","compressedSize","uncompressedSize","lastModDate","rawLastModDate","comment","rawComment","signature","extraField","rawExtraField","bitFlag","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","filenameUTF8","commentUTF8","offset","zip64","compressionMethod","extraFieldNTFS","lastAccessDate","creationDate","extraFieldExtendedTimestamp","version","versionMadeBy","msDosCompatible","internalFileAttribute","externalFileAttribute"],kee=class{constructor(o){iVt.forEach(f=>this[f]=o[f])}},hde="File format is not recognized",rVt="End of central directory not found",nVt="End of Zip64 central directory not found",oVt="End of Zip64 central directory locator not found",aVt="Central directory header not found",sVt="Local file header not found",lVt="Zip64 extra field not found",uVt="File contains encrypted entry",cVt="Encryption method not supported",WBe="Compression method not supported",jBe="utf-8",YBe="cp437",qBe=["uncompressedSize","compressedSize","offset"],hVt=class{constructor(o,f={}){Object.assign(this,{reader:o,options:f,config:zYe()})}async*getEntriesGenerator(o={}){let f=this,m=f.reader;if(m.initialized||await m.init(),m.size<22)throw new Error(hde);let v=await _Vt(m,101010256,m.size,22,65535*16);if(!v)throw new Error(rVt);let y=wv(v),x=T0(y,12),C=T0(y,16),w=R1(y,8),A=0;if(C==4294967295||x==4294967295||w==65535){let M=await LR(m,v.offset-20,20),I=wv(M);if(T0(I,0)!=117853008)throw new Error(nVt);C=W$(I,8);let P=await LR(m,C,56),D=wv(P),L=v.offset-20-56;if(T0(D,0)!=101075792&&C!=L){let R=C;C=L,A=C-R,P=await LR(m,C,56),D=wv(P)}if(T0(D,0)!=101075792)throw new Error(oVt);w=W$(D,32),x=W$(D,40),C-=x}if(C<0||C>=m.size)throw new Error(hde);let E=0,T=await LR(m,C,x),S=wv(T);if(x){let M=v.offset-x;if(T0(S,E)!=33639248&&C!=M){let I=C;C=M,A=C-I,T=await LR(m,C,x),S=wv(T)}}if(C<0||C>=m.size)throw new Error(hde);for(let M=0;MI.getData(X,J,Y),E=k,o.onprogress)try{o.onprogress(M+1,w,new kee(I))}catch{}yield J}return!0}async getEntries(o={}){let f=[],m=this.getEntriesGenerator(o),v=m.next();for(;!(await v).done;)f.push((await v).value),v=m.next();return f}async close(){}},dVt=class{constructor(o,f,m){Object.assign(this,{reader:o,config:f,options:m})}async getData(o,f,m={}){let v=this,{reader:y,offset:x,extraFieldAES:C,compressionMethod:w,config:A,bitFlag:E,signature:T,rawLastModDate:S,compressedSize:M}=v,I=v.localDirectory={};y.initialized||await y.init();let P=await LR(y,x,30),D=wv(P),L=bz(v,m,"password");if(L=L&&L.length&&L,C&&C.originalCompressionMethod!=99)throw new Error(WBe);if(w!=0&&w!=8)throw new Error(WBe);if(T0(D,0)!=67324752)throw new Error(sVt);cqe(I,D,4),P=await LR(y,x,30+I.filenameLength+I.extraFieldLength),I.rawExtraField=P.subarray(30+I.filenameLength),await hqe(v,I,D,4),f.lastAccessDate=I.lastAccessDate,f.creationDate=I.creationDate;let R=v.encrypted&&I.encrypted,O=R&&!C;if(R){if(!O&&C.strength===void 0)throw new Error(cVt);if(!L)throw new Error(uVt)}let F=await oqe(A.Inflate,{codecType:nqe,password:L,zipCrypto:O,encryptionStrength:C&&C.strength,signed:bz(v,m,"checkSignature"),passwordVerification:O&&(E.dataDescriptor?S>>>8&255:T>>>24&255),signature:T,compressed:w!=0,encrypted:R,useWebWorkers:bz(v,m,"useWebWorkers")},A);o.initialized||await o.init();let k=bz(v,m,"signal"),U=x+30+I.filenameLength+I.extraFieldLength;return await aqe(F,y,o,U,()=>M,A,{onprogress:m.onprogress,signal:k}),o.getData()}};function cqe(o,f,m){let v=o.rawBitFlag=R1(f,m+2),y=(v&1)==1,x=T0(f,m+6);Object.assign(o,{encrypted:y,version:R1(f,m),bitFlag:{level:(v&6)>>1,dataDescriptor:(v&8)==8,languageEncodingFlag:(v&2048)==2048},rawLastModDate:x,lastModDate:vVt(x),filenameLength:R1(f,m+22),extraFieldLength:R1(f,m+24)})}async function hqe(o,f,m,v){let y=f.rawExtraField,x=f.extraField=new Map,C=wv(new Uint8Array(y)),w=0;try{for(;wf[y]==4294967295);for(let y=0;y{if(f[y]==4294967295)if(o[y]!==void 0)f[y]=o[y];else throw new Error(lVt)})}async function XBe(o,f,m,v,y){let x=wv(o.data);o.version=Bz(x,0),o.signature=T0(x,1);let C=new $W;C.append(y[m]);let w=wv(new Uint8Array(4));w.setUint32(0,C.get(),!0),o[f]=await Wme(o.data.subarray(5)),o.valid=!y.bitFlag.languageEncodingFlag&&o.signature==T0(w,0),o.valid&&(v[f]=o[f],v[f+"UTF8"]=!0)}function pVt(o,f,m){let v=wv(o.data);o.vendorVersion=Bz(v,0),o.vendorId=Bz(v,2);let y=Bz(v,4);o.strength=y,o.originalCompressionMethod=m,f.compressionMethod=o.compressionMethod=R1(v,5)}function mVt(o,f){let m=wv(o.data),v=4,y;try{for(;v{if(o.data.length>=C+4){let E=T0(m,C);f[w]=o[w]=new Date(E*1e3);let T=x[A];o[T]=E}C+=4})}async function _Vt(o,f,m,v,y){let x=new Uint8Array(4),C=wv(x);yVt(C,0,f);let w=v+y;return await A(v)||await A(Math.min(w,m));async function A(E){let T=m-E,S=await LR(o,T,E);for(let M=S.length-v;M>=0;M--)if(S[M]==x[0]&&S[M+1]==x[1]&&S[M+2]==x[2]&&S[M+3]==x[3])return{offset:T+M,buffer:S.slice(M,M+v).buffer}}}function bz(o,f,m){return f[m]===void 0?o.options[m]:f[m]}function vVt(o){let f=(o&4294901760)>>16,m=o&65535;try{return new Date(1980+((f&65024)>>9),((f&480)>>5)-1,f&31,(m&63488)>>11,(m&2016)>>5,(m&31)*2,0)}catch{}}function dde(o){return new Date(Number(o/BigInt(1e4)-BigInt(116444736e5)))}function Bz(o,f){return o.getUint8(f)}function R1(o,f){return o.getUint16(f,!0)}function T0(o,f){return o.getUint32(f,!0)}function W$(o,f){return Number(o.getBigUint64(f,!0))}function yVt(o,f,m){o.setUint32(f,m,!0)}function wv(o){return new DataView(o.buffer)}function LR(o,f,m){return o.readUint8Array(f,m)}var xVt="File already exists",CVt="Zip file comment exceeds 64KB",bVt="File entry comment exceeds 64KB",wVt="File entry name exceeds 64KB",JBe="Version exceeds 65535",AVt="The strength must equal 1, 2, or 3",EVt="Extra field type exceeds 65535",TVt="Extra field data exceeds 64KB",fCe="Zip64 is not supported",KBe=new Uint8Array([7,0,2,0,65,69,3,0,0]),QBe=24,fde=0,SVt=class{constructor(o,f={}){Object.assign(this,{writer:o,options:f,config:zYe(),files:new Map,offset:o.size,pendingCompressedSize:0,pendingEntries:[],pendingAddFileCalls:new Set})}async add(o="",f,m={}){let v=this;if(fdev.pendingEntries.push({name:o,reader:f,options:m,resolve:y,reject:x}))}async close(o=new Uint8Array(0),f={}){for(;this.pendingAddFileCalls.size;)await Promise.all(Array.from(this.pendingAddFileCalls));return await DVt(this,o,f),this.writer.getData()}};async function PVt(o,f,m,v){if(f=f.trim(),v.directory&&!f.endsWith(G$)?f+=G$:v.directory=f.endsWith(G$),o.files.has(f))throw new Error(xVt);let y=Ume(f);if(y.length>65535)throw new Error(wVt);let x=v.comment||"",C=Ume(x);if(C.length>65535)throw new Error(bVt);let w=o.options.version||v.version||0;if(w>65535)throw new Error(JBe);let A=o.options.versionMadeBy||v.versionMadeBy||20;if(A>65535)throw new Error(JBe);let E=c_(o,v,"lastModDate")||new Date,T=c_(o,v,"lastAccessDate"),S=c_(o,v,"creationDate"),M=c_(o,v,"password"),I=c_(o,v,"encryptionStrength")||3,P=c_(o,v,"zipCrypto");if(M!==void 0&&I!==void 0&&(I<1||I>3))throw new Error(AVt);let D=new Uint8Array(0),L=v.extraField;if(L){let re=0,ne=0;L.forEach(oe=>re+=4+oe.length),D=new Uint8Array(re),L.forEach((oe,se)=>{if(se>65535)throw new Error(EVt);if(oe.length>65535)throw new Error(TVt);S0(D,new Uint16Array([se]),ne),S0(D,new Uint16Array([oe.length]),ne+2),S0(D,oe,ne+4),ne+=4+oe.length})}let R=c_(o,v,"extendedTimestamp");R===void 0&&(R=!0);let O=0,F=c_(o,v,"keepOrder");F===void 0&&(F=!0);let k=0,U=c_(o,v,"msDosCompatible");U===void 0&&(U=!0);let G=c_(o,v,"internalFileAttribute")||0,j=c_(o,v,"externalFileAttribute")||0;m&&(m.initialized||await m.init(),k=m.size,O=RVt(k));let q=v.zip64||o.options.zip64||!1;if(o.offset+o.pendingCompressedSize>=4294967295||k>=4294967295||O>=4294967295){if(v.zip64===!1||o.options.zip64===!1||!F)throw new Error(fCe);q=!0}o.pendingCompressedSize+=O,await Promise.resolve();let J=c_(o,v,"level"),X=c_(o,v,"useWebWorkers"),Y=c_(o,v,"bufferedWrite"),Q=c_(o,v,"dataDescriptor"),ee=c_(o,v,"dataDescriptorSignature"),z=c_(o,v,"signal");Q===void 0&&(Q=!0),Q&&ee===void 0&&(ee=!1);let ie=await IVt(o,f,m,Object.assign({},v,{rawFilename:y,rawComment:C,version:w,versionMadeBy:A,lastModDate:E,lastAccessDate:T,creationDate:S,rawExtraField:D,zip64:q,password:M,level:J,useWebWorkers:X,encryptionStrength:I,extendedTimestamp:R,zipCrypto:P,bufferedWrite:Y,keepOrder:F,dataDescriptor:Q,dataDescriptorSignature:ee,signal:z,msDosCompatible:U,internalFileAttribute:G,externalFileAttribute:j}));return O&&(o.pendingCompressedSize-=O),Object.assign(ie,{name:f,comment:x,extraField:L}),new kee(ie)}async function IVt(o,f,m,v){let y=o.files,x=o.writer,C=Array.from(y.values()).pop(),w={},A,E,T;y.set(f,w);try{let S,M,I;if(v.keepOrder&&(S=C&&C.lock),w.lock=I=new Promise(P=>T=P),v.bufferedWrite||o.lockWrite||!v.dataDescriptor?(M=new uqe,M.init(),A=!0):(o.lockWrite=new Promise(P=>E=P),x.initialized||await x.init(),M=x),w=await MVt(m,M,o.config,v),w.lock=I,y.set(f,w),w.filename=f,A){let P=0,D=M.getData();await Promise.all([o.lockWrite,S]);let L;do L=Array.from(y.values()).find(R=>R.writingBufferedData),L&&await L.lock;while(L&&L.lock);if(w.writingBufferedData=!0,!v.dataDescriptor){let R=await dqe(D,0,26),O=new DataView(R);(!w.encrypted||v.zipCrypto)&&gh(O,14,w.signature),w.zip64?(gh(O,18,4294967295),gh(O,22,4294967295)):(gh(O,18,w.compressedSize),gh(O,22,w.uncompressedSize)),await x.writeUint8Array(new Uint8Array(R)),P=26}await LVt(x,D,P),delete w.writingBufferedData}if(w.offset=o.offset,w.zip64){let P=SE(w.rawExtraFieldZip64);Qx(P,20,BigInt(w.offset))}else if(w.offset>=4294967295)throw new Error(fCe);return o.offset+=w.length,w}catch(S){throw(A&&w.writingBufferedData||!A&&w.dataWritten)&&(S.corruptedEntry=o.hasCorruptedEntries=!0,w.uncompressedSize&&(o.offset+=w.uncompressedSize)),y.delete(f),S}finally{T(),E&&E()}}async function MVt(o,f,m,v){let{rawFilename:y,lastAccessDate:x,creationDate:C,password:w,level:A,zip64:E,zipCrypto:T,dataDescriptor:S,dataDescriptorSignature:M,directory:I,version:P,versionMadeBy:D,rawComment:L,rawExtraField:R,useWebWorkers:O,onprogress:F,signal:k,encryptionStrength:U,extendedTimestamp:G,msDosCompatible:j,internalFileAttribute:q,externalFileAttribute:J}=v,X=!!(w&&w.length),Y=A!==0&&!I,Q;if(X&&!T){Q=new Uint8Array(KBe.length+2);let ut=SE(Q);tf(ut,0,39169),S0(Q,KBe,2),Vee(ut,8,U)}else Q=new Uint8Array(0);let ee,z;if(G){z=new Uint8Array(9+(x?4:0)+(C?4:0));let ut=SE(z);tf(ut,0,21589),tf(ut,2,z.length-4);let at=1+(x?2:0)+(C?4:0);Vee(ut,4,at),gh(ut,5,Math.floor(v.lastModDate.getTime()/1e3)),x&&gh(ut,9,Math.floor(x.getTime()/1e3)),C&&gh(ut,13,Math.floor(C.getTime()/1e3));try{ee=new Uint8Array(36);let Pt=SE(ee),Qe=pde(v.lastModDate);tf(Pt,0,10),tf(Pt,2,32),tf(Pt,8,1),tf(Pt,10,24),Qx(Pt,12,Qe),Qx(Pt,20,pde(x)||Qe),Qx(Pt,28,pde(C)||Qe)}catch{ee=new Uint8Array(0)}}else ee=z=new Uint8Array(0);let ie={version:P||20,versionMadeBy:D,zip64:E,directory:!!I,filenameUTF8:!0,rawFilename:y,commentUTF8:!0,rawComment:L,rawExtraFieldZip64:E?new Uint8Array(QBe+4):new Uint8Array(0),rawExtraFieldExtendedTimestamp:z,rawExtraFieldNTFS:ee,rawExtraFieldAES:Q,rawExtraField:R,extendedTimestamp:G,msDosCompatible:j,internalFileAttribute:q,externalFileAttribute:J},re=ie.uncompressedSize=0,ne=2048;S&&(ne=ne|8);let oe=0;Y&&(oe=8),E&&(ie.version=ie.version>45?ie.version:45),X&&(ne=ne|1,T||(ie.version=ie.version>51?ie.version:51,oe=99,Y&&(ie.rawExtraFieldAES[9]=8))),ie.compressionMethod=oe;let se=ie.headerArray=new Uint8Array(26),ae=SE(se);tf(ae,0,ie.version),tf(ae,2,ne),tf(ae,4,oe);let fe=new Uint32Array(1),de=SE(fe),ve;v.lastModDateUBe?ve=UBe:ve=v.lastModDate,tf(de,0,(ve.getHours()<<6|ve.getMinutes())<<5|ve.getSeconds()/2),tf(de,2,(ve.getFullYear()-1980<<4|ve.getMonth()+1)<<5|ve.getDate());let pe=fe[0];gh(ae,6,pe),tf(ae,22,y.length);let ce=Q.length+z.length+ee.length+ie.rawExtraField.length;tf(ae,24,ce);let he=new Uint8Array(30+y.length+ce),Ce=SE(he);gh(Ce,0,67324752),S0(he,se,4),S0(he,y,30),S0(he,Q,30+y.length),S0(he,z,30+y.length+Q.length),S0(he,ee,30+y.length+Q.length+z.length),S0(he,ie.rawExtraField,30+y.length+Q.length+z.length+ee.length);let Se,De=0;if(o){let ut=await oqe(m.Deflate,{codecType:rqe,level:A,password:w,encryptionStrength:U,zipCrypto:X&&T,passwordVerification:X&&T&&pe>>8&255,signed:!0,compressed:Y,encrypted:X,useWebWorkers:O},m);await f.writeUint8Array(he),ie.dataWritten=!0,Se=await aqe(ut,o,f,0,()=>o.size,m,{onprogress:F,signal:k}),re=ie.uncompressedSize=o.size,De=Se.length}else await f.writeUint8Array(he),ie.dataWritten=!0;let Oe=new Uint8Array(0),Ue,Xe=0;if(S&&(Oe=new Uint8Array(E?M?24:20:M?16:12),Ue=SE(Oe),M&&(Xe=4,gh(Ue,0,134695760))),o){let ut=Se.signature;if((!X||T)&&ut!==void 0&&(gh(ae,10,ut),ie.signature=ut,S&&gh(Ue,Xe,ut)),E){let at=SE(ie.rawExtraFieldZip64);tf(at,0,1),tf(at,2,QBe),gh(ae,14,4294967295),Qx(at,12,BigInt(De)),gh(ae,18,4294967295),Qx(at,4,BigInt(re)),S&&(Qx(Ue,Xe+4,BigInt(De)),Qx(Ue,Xe+12,BigInt(re)))}else gh(ae,14,De),gh(ae,18,re),S&&(gh(Ue,Xe+4,De),gh(Ue,Xe+8,re))}S&&await f.writeUint8Array(Oe);let it=he.length+De+Oe.length;return Object.assign(ie,{compressedSize:De,lastModDate:ve,rawLastModDate:pe,creationDate:C,lastAccessDate:x,encrypted:X,length:it}),ie}async function DVt(o,f,m){let v=o.writer,y=o.files,x=0,C=0,w=o.offset,A=y.size;for(let[,M]of y)C+=46+M.rawFilename.length+M.rawComment.length+M.rawExtraFieldZip64.length+M.rawExtraFieldAES.length+M.rawExtraFieldExtendedTimestamp.length+M.rawExtraFieldNTFS.length+M.rawExtraField.length;let E=m.zip64||o.options.zip64||!1;if(w>=4294967295||C>=4294967295||A>=65535){if(m.zip64===!1||o.options.zip64===!1)throw new Error(fCe);E=!0}let T=new Uint8Array(C+(E?98:22)),S=SE(T);if(f&&f.length)if(f.length<=65535)tf(S,x+20,f.length);else throw new Error(CVt);for(let[M,I]of Array.from(y.values()).entries()){let{rawFilename:P,rawExtraFieldZip64:D,rawExtraFieldAES:L,rawExtraField:R,rawComment:O,versionMadeBy:F,headerArray:k,directory:U,zip64:G,msDosCompatible:j,internalFileAttribute:q,externalFileAttribute:J}=I,X,Y;if(I.extendedTimestamp){Y=I.rawExtraFieldNTFS,X=new Uint8Array(9);let ee=SE(X);tf(ee,0,21589),tf(ee,2,X.length-4),Vee(ee,4,1),gh(ee,5,Math.floor(I.lastModDate.getTime()/1e3))}else Y=X=new Uint8Array(0);let Q=D.length+L.length+X.length+Y.length+R.length;if(gh(S,x,33639248),tf(S,x+4,F),S0(T,k,x+6),tf(S,x+30,Q),tf(S,x+32,O.length),gh(S,x+34,q),J?gh(S,x+38,J):U&&j&&Vee(S,x+38,16),G?gh(S,x+42,4294967295):gh(S,x+42,I.offset),S0(T,P,x+46),S0(T,D,x+46+P.length),S0(T,L,x+46+P.length+D.length),S0(T,X,x+46+P.length+D.length+L.length),S0(T,Y,x+46+P.length+D.length+L.length+X.length),S0(T,R,x+46+P.length+D.length+L.length+X.length+Y.length),S0(T,O,x+46+P.length+Q),x+=46+P.length+Q+O.length,m.onprogress)try{m.onprogress(M+1,y.size,new kee(I))}catch{}}E&&(gh(S,x,101075792),Qx(S,x+4,BigInt(44)),tf(S,x+12,45),tf(S,x+14,45),Qx(S,x+24,BigInt(A)),Qx(S,x+32,BigInt(A)),Qx(S,x+40,BigInt(C)),Qx(S,x+48,BigInt(w)),gh(S,x+56,117853008),Qx(S,x+64,BigInt(w)+BigInt(C)),gh(S,x+72,1),A=65535,w=4294967295,C=4294967295,x+=76),gh(S,x,101010256),tf(S,x+8,A),tf(S,x+10,A),gh(S,x+12,C),gh(S,x+16,w),await v.writeUint8Array(T),f&&f.length&&await v.writeUint8Array(f)}function dqe(o,f,m){if(o.arrayBuffer)return f||m?o.slice(f,m).arrayBuffer():o.arrayBuffer();{let v=new FileReader;return new Promise((y,x)=>{v.onload=C=>y(C.target.result),v.onerror=()=>x(v.error),v.readAsArrayBuffer(f||m?o.slice(f,m):o)})}}async function LVt(o,f,m=0){await v();async function v(){if(m=0&&x._activeEntries.splice(C,1)}),y(o,f,m)}}else N(m)&&m(!1)}function kVt(o,f,m,v){let y=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(y,v),v)m(v);else{let x=this._activeEntries.indexOf(y);x>=0&&this._activeEntries.splice(x,1),this.playlistIndex++,pqe.call(this,o,f,m)}}var vCe=Sre,Lc={Linear:{None:function(o){return o}},Quadratic:{In:function(o){return o*o},Out:function(o){return o*(2-o)},InOut:function(o){return(o*=2)<1?.5*o*o:-.5*(--o*(o-2)-1)}},Cubic:{In:function(o){return o*o*o},Out:function(o){return--o*o*o+1},InOut:function(o){return(o*=2)<1?.5*o*o*o:.5*((o-=2)*o*o+2)}},Quartic:{In:function(o){return o*o*o*o},Out:function(o){return 1- --o*o*o*o},InOut:function(o){return(o*=2)<1?.5*o*o*o*o:-.5*((o-=2)*o*o*o-2)}},Quintic:{In:function(o){return o*o*o*o*o},Out:function(o){return--o*o*o*o*o+1},InOut:function(o){return(o*=2)<1?.5*o*o*o*o*o:.5*((o-=2)*o*o*o*o+2)}},Sinusoidal:{In:function(o){return 1-Math.cos(o*Math.PI/2)},Out:function(o){return Math.sin(o*Math.PI/2)},InOut:function(o){return .5*(1-Math.cos(Math.PI*o))}},Exponential:{In:function(o){return o===0?0:Math.pow(1024,o-1)},Out:function(o){return o===1?1:1-Math.pow(2,-10*o)},InOut:function(o){return o===0?0:o===1?1:(o*=2)<1?.5*Math.pow(1024,o-1):.5*(-Math.pow(2,-10*(o-1))+2)}},Circular:{In:function(o){return 1-Math.sqrt(1-o*o)},Out:function(o){return Math.sqrt(1- --o*o)},InOut:function(o){return(o*=2)<1?-.5*(Math.sqrt(1-o*o)-1):.5*(Math.sqrt(1-(o-=2)*o)+1)}},Elastic:{In:function(o){return o===0?0:o===1?1:-Math.pow(2,10*(o-1))*Math.sin((o-1.1)*5*Math.PI)},Out:function(o){return o===0?0:o===1?1:Math.pow(2,-10*o)*Math.sin((o-.1)*5*Math.PI)+1},InOut:function(o){return o===0?0:o===1?1:(o*=2,o<1?-.5*Math.pow(2,10*(o-1))*Math.sin((o-1.1)*5*Math.PI):.5*Math.pow(2,-10*(o-1))*Math.sin((o-1.1)*5*Math.PI)+1)}},Back:{In:function(o){var f=1.70158;return o*o*((f+1)*o-f)},Out:function(o){var f=1.70158;return--o*o*((f+1)*o+f)+1},InOut:function(o){var f=2.5949095;return(o*=2)<1?.5*(o*o*((f+1)*o-f)):.5*((o-=2)*o*((f+1)*o+f)+2)}},Bounce:{In:function(o){return 1-Lc.Bounce.Out(1-o)},Out:function(o){return o<.36363636363636365?7.5625*o*o:o<.7272727272727273?7.5625*(o-=.5454545454545454)*o+.75:o<.9090909090909091?7.5625*(o-=.8181818181818182)*o+.9375:7.5625*(o-=.9545454545454546)*o+.984375},InOut:function(o){return o<.5?Lc.Bounce.In(o*2)*.5:Lc.Bounce.Out(o*2-1)*.5+.5}}},v7;typeof self>"u"&&typeof process<"u"&&process.hrtime?v7=function(){var o=process.hrtime();return o[0]*1e3+o[1]/1e6}:typeof self<"u"&&self.performance!==void 0&&self.performance.now!==void 0?v7=self.performance.now.bind(self.performance):Date.now!==void 0?v7=Date.now:v7=function(){return new Date().getTime()};var rz=v7,VVt=function(){function o(){this._tweens={},this._tweensAddedDuringUpdate={}}return o.prototype.getAll=function(){var f=this;return Object.keys(this._tweens).map(function(m){return f._tweens[m]})},o.prototype.removeAll=function(){this._tweens={}},o.prototype.add=function(f){this._tweens[f.getId()]=f,this._tweensAddedDuringUpdate[f.getId()]=f},o.prototype.remove=function(f){delete this._tweens[f.getId()],delete this._tweensAddedDuringUpdate[f.getId()]},o.prototype.update=function(f,m){f===void 0&&(f=rz()),m===void 0&&(m=!1);var v=Object.keys(this._tweens);if(v.length===0)return!1;for(;v.length>0;){this._tweensAddedDuringUpdate={};for(var y=0;y1?x(o[m],o[m-1],m-v):x(o[y],o[y+1>m?m:y+1],v-y)},Bezier:function(o,f){for(var m=0,v=o.length-1,y=Math.pow,x=y7.Utils.Bernstein,C=0;C<=v;C++)m+=y(1-f,v-C)*y(f,C)*o[C]*x(v,C);return m},CatmullRom:function(o,f){var m=o.length-1,v=m*f,y=Math.floor(v),x=y7.Utils.CatmullRom;return o[0]===o[m]?(f<0&&(y=Math.floor(v=m*(1+f))),x(o[(y-1+m)%m],o[y],o[(y+1)%m],o[(y+2)%m],v-y)):f<0?o[0]-(x(o[0],o[0],o[1],o[1],-v)-o[0]):f>1?o[m]-(x(o[m],o[m],o[m-1],o[m-1],v-m)-o[m]):x(o[y?y-1:0],o[y],o[m1;v--)m*=v;return o[f]=m,m}}(),CatmullRom:function(o,f,m,v,y){var x=(m-o)*.5,C=(v-f)*.5,w=y*y,A=y*w;return(2*f-2*m+x+C)*A+(-3*f+3*m-2*x-C)*w+x*y+f}}},mqe=function(){function o(){}return o.nextId=function(){return o._nextId++},o._nextId=0,o}(),gqe=new VVt,zVt=function(){function o(f,m){m===void 0&&(m=gqe),this._object=f,this._group=m,this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Lc.Linear.None,this._interpolationFunction=y7.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._id=mqe.nextId(),this._isChainStopped=!1,this._goToEnd=!1}return o.prototype.getId=function(){return this._id},o.prototype.isPlaying=function(){return this._isPlaying},o.prototype.isPaused=function(){return this._isPaused},o.prototype.to=function(f,m){return this._valuesEnd=Object.create(f),m!==void 0&&(this._duration=m),this},o.prototype.duration=function(f){return this._duration=f,this},o.prototype.start=function(f){if(this._isPlaying)return this;if(this._group&&this._group.add(this),this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var m in this._valuesStartRepeat)this._swapEndStartRepeatValues(m),this._valuesStart[m]=this._valuesStartRepeat[m]}return this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=f!==void 0?typeof f=="string"?rz()+parseFloat(f):f:rz(),this._startTime+=this._delayTime,this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat),this},o.prototype._setupProperties=function(f,m,v,y){for(var x in v){var C=f[x],w=Array.isArray(C),A=w?"array":typeof C,E=!w&&Array.isArray(v[x]);if(!(A==="undefined"||A==="function")){if(E){var T=v[x];if(T.length===0)continue;T=T.map(this._handleRelativeValue.bind(this,C)),v[x]=[C].concat(T)}if((A==="object"||w)&&C&&!E){m[x]=w?[]:{};for(var S in C)m[x][S]=C[S];y[x]=w?[]:{},this._setupProperties(C,m[x],v[x],y[x])}else typeof m[x]>"u"&&(m[x]=C),w||(m[x]*=1),E?y[x]=v[x].slice().reverse():y[x]=m[x]||0}}},o.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._group&&this._group.remove(this),this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},o.prototype.end=function(){return this._goToEnd=!0,this.update(1/0),this},o.prototype.pause=function(f){return f===void 0&&(f=rz()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=f,this._group&&this._group.remove(this),this)},o.prototype.resume=function(f){return f===void 0&&(f=rz()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=f-this._pauseStart,this._pauseStart=0,this._group&&this._group.add(this),this)},o.prototype.stopChainedTweens=function(){for(var f=0,m=this._chainedTweens.length;fx)return!1;m&&this.start(f)}if(this._goToEnd=!1,f1?1:y;var C=this._easingFunction(y);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,C),this._onUpdateCallback&&this._onUpdateCallback(this._object,y),y===1)if(this._repeat>0){isFinite(this._repeat)&&this._repeat--;for(v in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[v]=="string"&&(this._valuesStartRepeat[v]=this._valuesStartRepeat[v]+parseFloat(this._valuesEnd[v])),this._yoyo&&this._swapEndStartRepeatValues(v),this._valuesStart[v]=this._valuesStartRepeat[v];return this._yoyo&&(this._reversed=!this._reversed),this._repeatDelayTime!==void 0?this._startTime=f+this._repeatDelayTime:this._startTime=f+this._delayTime,this._onRepeatCallback&&this._onRepeatCallback(this._object),!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var w=0,A=this._chainedTweens.length;w=f;v--)o[v]=o[w--]}for(v=0;v=0||N(S)&&ci.compare(T,S)>=0));){for(mde[M++]=T,x=x+1,C=0;C0&&(gde.length=I,$Be(m,E,gde),mde.length=M,$Be(f,A,mde))}else{for(C=0;Cy)return;if(this._backwardExtrapolationType===n2.HOLD)return x.unpack(C,0,f)}if(w>=v){w=v-1;let F=m[w];if(y=this._forwardExtrapolationDuration,this._forwardExtrapolationType===n2.NONE||y!==0&&ci.secondsDifference(o,F)>y)return;if(this._forwardExtrapolationType===n2.HOLD)return w=v-1,x.unpack(C,w*x.packedLength,f)}let A=this._xTable,E=this._yTable,T=this._interpolationAlgorithm,S=this._packedInterpolationLength,M=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let F=Math.min(T.getRequiredDataPoints(this._interpolationDegree,M),v);F!==this._numberOfPoints&&(this._numberOfPoints=F,A.length=F,E.length=F*S)}let I=this._numberOfPoints-1;if(I<1)return;let P=0,D=v-1;if(D-P+1>=I+1){let F=w-(I/2|0)-1;FD&&(k=D,F=k-I,F0){m=new Array(f);for(let v=0;vthis._started+this._timeThreshold)){this._giveUpTime();return}v=this._nextNode()}this._pop()&&o&&this._process(!0)};function jVt(o){let f=o.slice(0,Math.min(4,o.size)),m=pd(),v=new FileReader;return v.addEventListener("load",function(){m.resolve(new DataView(v.result).getUint32(0,!1)===1347093252)}),v.addEventListener("error",function(){m.reject(v.error)}),v.readAsArrayBuffer(f),m.promise}function YVt(o){let f=pd(),m=new FileReader;return m.addEventListener("load",function(){f.resolve(m.result)}),m.addEventListener("error",function(){f.reject(m.error)}),m.readAsText(o),f.promise}function yqe(o){let f={xsi:"http://www.w3.org/2001/XMLSchema-instance"},m,v,y,x;for(let C in f)f.hasOwnProperty(C)&&(y=RegExp(`[< ]${C}:`),x=`xmlns:${C}=`,y.test(o)&&o.indexOf(x)===-1&&(N(m)||(m=o.substr(0,o.indexOf("",f),v,y,x;for(;f!==-1&&f0?(zx.maximumRed=x,zx.red=void 0):(zx.maximumRed=void 0,zx.red=0),y>0?(zx.maximumGreen=y,zx.green=void 0):(zx.maximumGreen=void 0,zx.green=0),v>0?(zx.maximumBlue=v,zx.blue=void 0):(zx.maximumBlue=void 0,zx.blue=0),zx.alpha=m,Re.fromRandom(zx)):new Re(x,y,v,m)}function $F(o,f,m){let v=Us(o,f,m);if(N(v))return jme(v,Us(o,"colorMode",m)==="random")}function XVt(o){let f=cc(o,"TimeStamp",jr.kmlgx),m=Us(f,"when",jr.kmlgx);if(!N(f)||!N(m)||m.length===0)return;let v=ci.fromIso8601(m),y=new Lv;return y.addInterval(new hl({start:v,stop:Hn.MAXIMUM_VALUE})),y}function JVt(o){let f=cc(o,"TimeSpan",jr.kmlgx);if(!N(f))return;let m,v=cc(f,"begin",jr.kmlgx),y=N(v)?ci.fromIso8601(v.textContent):void 0,x=cc(f,"end",jr.kmlgx),C=N(x)?ci.fromIso8601(x.textContent):void 0;if(N(y)&&N(C)){if(ci.lessThan(C,y)){let w=y;y=C,C=w}m=new Lv,m.addInterval(new hl({start:y,stop:C}))}else N(y)?(m=new Lv,m.addInterval(new hl({start:y,stop:Hn.MAXIMUM_VALUE}))):N(C)&&(m=new Lv,m.addInterval(new hl({start:Hn.MINIMUM_VALUE,stop:C})));return m}function bqe(){let o=new jM;return o.width=ER,o.height=ER,o.scaleByDistance=new sa(t4e,i4e,r4e,n4e),o.pixelOffsetScaleByDistance=new sa(t4e,i4e,r4e,n4e),o}function TCe(){let o=new bl;return o.outline=!0,o.outlineColor=Re.WHITE,o}function wqe(){let o=new SU;return o.translucencyByDistance=new sa(3e6,1,5e6,0),o.pixelOffset=new Ye(17,0),o.horizontalOrigin=Zc.LEFT,o.font="16px sans-serif",o.style=of.FILL_AND_OUTLINE,o}function SCe(o,f,m,v,y){let x=Us(o,"href",jr.kml);if(!N(x)||x.length===0)return;if(x.indexOf("root://icons/palette-")===0){let w=x.charAt(21),A=Z(su(o,"x",jr.gx),0),E=Z(su(o,"y",jr.gx),0);A=Math.min(A/32,7),E=7-Math.min(E/32,7);let T=8*E+A;x=`https://maps.google.com/mapfiles/kml/pal${w}/icon${T}.png`}let C=ECe(x,m,v);if(y){let w=Us(o,"refreshMode",jr.kml),A=Us(o,"viewRefreshMode",jr.kml);w==="onInterval"||w==="onExpire"?Ba(`kml-refreshMode-${w}`,`KML - Unsupported Icon refreshMode: ${w}`):(A==="onStop"||A==="onRegion")&&Ba(`kml-refreshMode-${A}`,`KML - Unsupported Icon viewRefreshMode: ${A}`);let E=Z(Us(o,"viewBoundScale",jr.kml),1),T=A==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",S=Z(Us(o,"viewFormat",jr.kml),T),M=Us(o,"httpQuery",jr.kml);N(S)&&C.setQueryParameters(s2(Uee(S))),N(M)&&C.setQueryParameters(s2(Uee(M)));let I=f._ellipsoid;return ICe(C,f.camera,f.canvas,E,f._lastCameraView.bbox,I),C}return C}function KVt(o,f,m,v,y){let x=su(f,"scale",jr.kml),C=su(f,"heading",jr.kml),w=$F(f,"color",jr.kml),A=cc(f,"Icon",jr.kml),E=SCe(A,o,v,y,!1);N(A)&&!N(E)&&(E=!1);let T=su(A,"x",jr.gx),S=su(A,"y",jr.gx),M=su(A,"w",jr.gx),I=su(A,"h",jr.gx),P=cc(f,"hotSpot",jr.kml),D=TR(P,"x"),L=TR(P,"y"),R=og(P,"xunits"),O=og(P,"yunits"),F=m.billboard;N(F)||(F=bqe(),m.billboard=F),F.image=E,F.scale=x,F.color=w,(N(T)||N(S)||N(M)||N(I))&&(F.imageSubRegion=new Xr(T,S,M,I)),N(C)&&C!==0&&(F.rotation=xe.toRadians(-C),F.alignedAxis=H.UNIT_Z),x=Z(x,1);let k,U;N(D)&&(R==="pixels"?k=-D*x:R==="insetPixels"?k=(D-ER)*x:R==="fraction"&&(k=-D*ER*x),k+=ER*.5*x),N(L)&&(O==="pixels"?U=L*x:O==="insetPixels"?U=(-L+ER)*x:O==="fraction"&&(U=L*ER*x),U-=ER*.5*x),(N(k)||N(U))&&(F.pixelOffset=new Ye(k,U))}function Hee(o,f,m,v,y){for(let x=0,C=f.childNodes.length;x:clampToSeaFloor is currently not supported, using :clampToGround."),qn.CLAMP_TO_GROUND):f==="relativeToSeaFloor"?(Ba("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),qn.RELATIVE_TO_GROUND):(N(o)?Ba("kml-altitudeMode-unknown",`KML - Unknown :${o}, using :CLAMP_TO_GROUND.`):Ba("kml-gx:altitudeMode-unknown",`KML - Unknown :${f}, using :CLAMP_TO_GROUND.`),qn.CLAMP_TO_GROUND)}function $Vt(o,f,m){return m==="relativeToSeaFloor"||f==="absolute"||f==="relativeToGround"?o:((N(f)&&f!=="clampToGround"||N(m)&&m!=="clampToSeaFloor")&&Ba("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${Z(f,m)}`),new DU(o))}function ezt(o,f,m,v){if(!N(o))return;if(m==="relativeToSeaFloor"||f==="absolute"||f==="relativeToGround")return o;(N(f)&&f!=="clampToGround"||N(m)&&m!=="clampToSeaFloor")&&Ba("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${Z(f,m)}`);let y=o.length;for(let x=0;x0&&Ba("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let I=Math.min(w.length,E.length),P=[],D=[];for(let R=0;R0&&v.availability.addInterval(new hl({start:D[0],stop:D[D.length-1]})),S&&T&&PCe(f,v,y),!0}function c4e(o,f,m,v,y,x,C,w,A){let E=o[0],T=o[o.length-1],S=new ww;S.addSamples(o,f),m.intervals.addInterval(new hl({start:E,stop:T,isStartIncluded:A,isStopIncluded:A,data:$Vt(S,C,w)})),v.addInterval(new hl({start:E,stop:T,isStartIncluded:A,isStopIncluded:A})),y.intervals.addInterval(new hl({start:E,stop:T,isStartIncluded:A,isStopIncluded:A,data:x}))}function nzt(o,f,m,v,y){let x=kE(m,"interpolate",jr.gx),C=BE(m,"Track",jr.gx),w,A,E,T=!1,S=new CH,M=new Lv,I=new O1,P=o._ellipsoid;for(let D=0,L=C.length;D0)){for(P='',x=0;x`;P+="
${Z(D.displayName,C)}${Z(D.value,"")}
"}if(!N(P))return;P=GVt.link(P),mh.innerHTML=P;let L=mh.querySelectorAll("a");for(x=0;x1&&(_1(mh,"a","href",v),_1(mh,"link","href",v),_1(mh,"area","href",v),_1(mh,"img","src",v),_1(mh,"iframe","src",v),_1(mh,"video","src",v),_1(mh,"audio","src",v),_1(mh,"source","src",v),_1(mh,"track","src",v),_1(mh,"input","src",v),_1(mh,"embed","src",v),_1(mh,"script","src",v),_1(mh,"video","poster",v)),v1(mh,"a","href",y),v1(mh,"link","href",y),v1(mh,"area","href",y),v1(mh,"img","src",y),v1(mh,"iframe","src",y),v1(mh,"video","src",y),v1(mh,"audio","src",y),v1(mh,"source","src",y),v1(mh,"track","src",y),v1(mh,"input","src",y),v1(mh,"embed","src",y),v1(mh,"script","src",y),v1(mh,"video","poster",y);let R='
',R+=`${mh.innerHTML}
`,mh.innerHTML="",f.description=R}function Rre(o,f,m){let v=m.entityCollection,y=m.parentEntity,x=m.sourceResource,C=m.uriResolver,w=Cqe(f,v,m.context),A=w.kml,E=QVt(o,f,m.styleCollection,x,C),T=Us(f,"name",jr.kml);w.name=T,w.parent=y;let S=JVt(f);N(S)||(S=XVt(f)),w.availability=S,DCe(w);function M(F){return F?F.show&&M(F.parent):!0}let I=kE(f,"visibility",jr.kml);w.show=M(y)&&Z(I,!0);let P=cc(f,"author",jr.atom),D=A.author;D.name=Us(P,"name",jr.atom),D.uri=Us(P,"uri",jr.atom),D.email=Us(P,"email",jr.atom);let L=cc(f,"link",jr.atom),R=A.link;R.href=og(L,"href"),R.hreflang=og(L,"hreflang"),R.rel=og(L,"rel"),R.type=og(L,"type"),R.title=og(L,"title"),R.length=og(L,"length"),A.address=Us(f,"address",jr.kml),A.phoneNumber=Us(f,"phoneNumber",jr.kml),A.snippet=Us(f,"Snippet",jr.kml),szt(f,w),lzt(f,w,E,C,x);let O=o._ellipsoid;return Mqe(f,w,O),Iqe(f,w,O),N(cc(f,"Region",jr.kml))&&Ba("kml-region","KML - Placemark Regions are unsupported"),{entity:w,styleEntity:E}}function Pqe(o,f,m,v){v.addNodes(f.childNodes,m),v.process()}function uzt(o,f,m,v){let y=Rre(o,f,m),x=uo(m);x.parentEntity=y.entity,Pqe(o,f,x,v)}function czt(o,f,m,v){let y=Rre(o,f,m),x=y.entity,C=y.styleEntity,w=!1,A=f.childNodes;for(let E=0,T=A.length;Exe.PI_OVER_TWO?xe.PI_OVER_TWO:E}function w(E){return E>xe.PI?E-xe.TWO_PI:E<-xe.PI?E+xe.TWO_PI:E}let A=Hie(o.queryParameters);if(A=A.replace(/%5B/g,"[").replace(/%5D/g,"]"),N(f)&&f._mode!==_i.MORPHING){let E,T;if(y=Z(y,_zt),N(m)&&(vde.x=m.clientWidth*.5,vde.y=m.clientHeight*.5,E=f.pickEllipsoid(vde,x,vzt)),N(E)?T=x.cartesianToCartographic(E,EV):(T=Di.center(y,EV),E=x.cartographicToCartesian(T)),N(v)&&!xe.equalsEpsilon(v,1,xe.EPSILON9)){let R=y.width*v*.5,O=y.height*v*.5;y=new Di(w(T.longitude-R),C(T.latitude-O),w(T.longitude+R),C(T.latitude+O))}A=A.replace("[bboxWest]",xe.toDegrees(y.west).toString()),A=A.replace("[bboxSouth]",xe.toDegrees(y.south).toString()),A=A.replace("[bboxEast]",xe.toDegrees(y.east).toString()),A=A.replace("[bboxNorth]",xe.toDegrees(y.north).toString());let S=xe.toDegrees(T.longitude).toString(),M=xe.toDegrees(T.latitude).toString();A=A.replace("[lookatLon]",S),A=A.replace("[lookatLat]",M),A=A.replace("[lookatTilt]",xe.toDegrees(f.pitch).toString()),A=A.replace("[lookatHeading]",xe.toDegrees(f.heading).toString()),A=A.replace("[lookatRange]",H.distance(f.positionWC,E)),A=A.replace("[lookatTerrainLon]",S),A=A.replace("[lookatTerrainLat]",M),A=A.replace("[lookatTerrainAlt]",T.height.toString()),x.cartesianToCartographic(f.positionWC,EV),A=A.replace("[cameraLon]",xe.toDegrees(EV.longitude).toString()),A=A.replace("[cameraLat]",xe.toDegrees(EV.latitude).toString()),A=A.replace("[cameraAlt]",xe.toDegrees(EV.height).toString());let I=f.frustum,P=I.aspectRatio,D="",L="";if(N(P)){let R=xe.toDegrees(I.fov);P>1?(D=R,L=R/P):(L=R,D=R*P)}A=A.replace("[horizFov]",D.toString()),A=A.replace("[vertFov]",L.toString())}else A=A.replace("[bboxWest]","-180"),A=A.replace("[bboxSouth]","-90"),A=A.replace("[bboxEast]","180"),A=A.replace("[bboxNorth]","90"),A=A.replace("[lookatLon]",""),A=A.replace("[lookatLat]",""),A=A.replace("[lookatRange]",""),A=A.replace("[lookatTilt]",""),A=A.replace("[lookatHeading]",""),A=A.replace("[lookatTerrainLon]",""),A=A.replace("[lookatTerrainLat]",""),A=A.replace("[lookatTerrainAlt]",""),A=A.replace("[cameraLon]",""),A=A.replace("[cameraLat]",""),A=A.replace("[cameraAlt]",""),A=A.replace("[horizFov]",""),A=A.replace("[vertFov]","");N(m)?(A=A.replace("[horizPixels]",m.clientWidth),A=A.replace("[vertPixels]",m.clientHeight)):(A=A.replace("[horizPixels]",""),A=A.replace("[vertPixels]","")),A=A.replace("[terrainEnabled]","1"),A=A.replace("[clientVersion]","1"),A=A.replace("[kmlVersion]","2.2"),A=A.replace("[clientName]","Cesium"),A=A.replace("[language]","English"),o.setQueryParameters(s2(A))}function yzt(o,f,m,v){let y=Rre(o,f,m).entity,x=m.sourceResource,C=m.uriResolver,w=cc(f,"Link",jr.kml);if(N(w)||(w=cc(f,"Url",jr.kml)),N(w)){let A=Us(w,"href",jr.kml),E,T;if(N(A)){let S=A;if(A=ECe(A,x,m.uriResolver),/^data:/.test(A.getUrlComponent()))/\.kmz/i.test(x.getUrlComponent())||(S=x.getDerivedResource({url:S}));else{if(S=A.clone(),E=Us(w,"viewRefreshMode",jr.kml),E==="onRegion"){Ba("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}T=Z(Us(w,"viewBoundScale",jr.kml),1);let D=E==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",L=Z(Us(w,"viewFormat",jr.kml),D),R=Us(w,"httpQuery",jr.kml);N(L)&&A.setQueryParameters(s2(Uee(L))),N(R)&&A.setQueryParameters(s2(Uee(R)));let O=o._ellipsoid;ICe(A,o.camera,o.canvas,T,o._lastCameraView.bbox,O)}let M={sourceUri:S,uriResolver:C,context:y.id,screenOverlayContainer:m.screenOverlayContainer},I=new $w,P=MCe(o,I,A,M).then(function(D){let L=o._entityCollection,R=I.values;L.suspendEvents();for(let k=0;k0||O==="onExpire"||E==="onStop"){let k=cc(D,"NetworkLinkControl",jr.kml),U=N(k),G=ci.now(),j={id:zl(),href:A,cookie:{},lastUpdated:G,updating:!1,entity:y,viewBoundScale:T,needsUpdate:!1,cameraUpdateTime:G},q=0;if(U&&(j.cookie=s2(Z(Us(k,"cookie",jr.kml),"")),q=Z(su(k,"minRefreshPeriod",jr.kml),0)),O==="onInterval")U&&(F=Math.max(q,F)),j.refreshMode=KR.INTERVAL,j.time=F;else if(O==="onExpire"){let J;if(U&&(J=Us(k,"expires",jr.kml)),N(J))try{let X=ci.fromIso8601(J),Y=ci.secondsDifference(X,G);Y>0&&Y0;)this._screenOverlays.pop().remove()};function DCe(o){let f=o.parent;if(N(f)){let m=f.availability;if(N(m)){let v=o.availability;N(v)?v.intersect(m):o.availability=m}}}function bzt(o,f,m,v,y){return function(x){if(!v.contains(f.id))return;let C=!1,w=cc(x,"NetworkLinkControl",jr.kml),A=N(w),E=0;if(A){if(N(cc(w,"Update",jr.kml))){Ba("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),f.updating=!1,v.remove(f.id);return}f.cookie=s2(Z(Us(w,"cookie",jr.kml),"")),E=Z(su(w,"minRefreshPeriod",jr.kml),0)}let T=ci.now(),S=f.refreshMode;if(S===KR.INTERVAL)N(w)&&(f.time=Math.max(E,f.time));else if(S===KR.EXPIRE){let j;if(N(w)&&(j=Us(w,"expires",jr.kml)),N(j))try{let q=ci.fromIso8601(j),J=ci.secondsDifference(q,T);J>0&&JT.time&&(M=!0):T.refreshMode===KR.EXPIRE?ci.greaterThan(m,T.time)&&(M=!0):T.refreshMode===KR.STOP&&(x&&(T.needsUpdate=!0,T.cameraUpdateTime=m),T.needsUpdate&&ci.secondsDifference(m,T.cameraUpdateTime)>=T.time&&(M=!0)),M){y(S),T.updating=!0;let I=new $w,P=T.href.clone();P.setQueryParameters(T.cookie);let D=Z(v._ellipsoid,ki.WGS84);ICe(P,v.camera,v.canvas,T.viewBoundScale,C.bbox,D),MCe(v,I,P,{context:S.id}).then(bzt(v,T,I,A,P)).catch(function(L){let R=`NetworkLink ${T.href} refresh failed: ${L}`;console.log(R),v._error.raiseEvent(v,R)}),E=!0}}A.set(T.id,T)}}),E&&(this._networkLinks=A,this._changed.raiseEvent(this)),!0};function wzt(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}$1._DeferredLoading=j2;$1._getTimestamp=$c;var Ore=$1;function LU(o,f){this._earthCtrl=o,this._id=f.id||"",this._name=f.id||"",this._coreMap=o.coreMap,this._options=f,this._dataSource=null,this._isAddToMap=!1,this._isShow=!0,this._dataSourceType="feature",this.initialize()}var Azt={esriGeometryPoint:"Point",esriGeometryPolyline:"MultiLineString",esriGeometryPolygon:"Polygon"};LU.prototype.initialize=function(){let o=this,f=Z(this._options.addToMap,!0),m=Z(o._options.sourceType,"geojson");function v(x){if(o._dataSource=x,f&&o.addToMap(),o._dataSourceType==="feature"){let C=x.entities.values;if(!o._options.style){o._options.success&&o._options.success(o);return}for(let w=0;ww)continue;let I=A.features[M],P={};P.type="Feature",P.properties=I.attributes,P.geometry={},S==="Point"?P.geometry.coordinates=[I.geometry.x,I.geometry.y]:S==="MultiLineString"?P.geometry.coordinates=I.geometry.paths:S==="Polygon"&&(P.geometry.coordinates=I.geometry.rings),P.geometry.type=S,E.features.push(P)}return N(C)&&(E.crs={type:"name",properties:{name:C}}),E.totalFeatures=E.features.length,E}if(m==="custom"){let x=new Cre;v(x)}else if(m==="kml")Ore.load(o._options.url,{camera:o._earthCtrl.coreMap.scene.camera,canvas:o._earthCtrl.coreMap.scene.canvas}).then(function(x){v(x)});else{let x=o._options.url;N(this._options.adapterUrl)&&(x=`${this._options.adapterUrl}?service=${gee.encode(o._options.url,"base64")}`,N(o._options.crs)&&(x+=`&crs=${gee.encode(o._options.crs,"base64")}`)),Jr.fetchJson({url:x}).then(C=>{let w=null;if(m==="geojson"){if(o._options.renderMode==="raster"){console.warn(`unsupport renderMode ${o._options.renderMode}`);return}w=ZW.load(C)}else if(m==="arcgis_json"){if(o._options.renderMode==="raster"){console.warn(`unsupport renderMode ${o._options.renderMode}`);return}w=ZW.load(y(C,o._options.crs,o._options.maxFeatureCount))}N(w)?w.then(function(A){v(A)}).catch(function(A){o._options.error&&o._options.error(A)}):o._options.error&&o._options.error("error")}).catch(C=>{console.log("error"),o._options.error&&o._options.error(C)})}};LU.prototype.addToMap=function(){N(this._earthCtrl)&&this._isAddToMap===!1&&(this._dataSourceType==="feature"?this._earthCtrl.dataSources.add(this._dataSource):this._dataSourceType==="raster"&&(this._dataSource=this._earthCtrl.imageryLayers.addImageryProvider(this._dataSource)),this._isAddToMap=!0)};LU.prototype.removeFromMap=function(o){N(this._earthCtrl)&&this._isAddToMap===!0&&(this._dataSourceType==="feature"?this._earthCtrl.dataSources.remove(this._dataSource,o):this._dataSourceType==="raster"&&this._earthCtrl.imageryLayers.remove(this._dataSource),this._isAddToMap=!1)};LU.prototype.destory=function(){this.removeFromMap(!0)};Object.defineProperties(LU.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name},set:function(o){this._name=o}},entities:{get:function(){return N(this._dataSource)?this._dataSource.entities:null}},dataSource:{get:function(){return this._dataSource}},isAddToMap:{get:function(){return this._isAddToMap}},show:{get:function(){return this._isShow},set:function(o){o?this.addToMap():this.removeFromMap(!1),this._isShow=o}}});var Nre=LU,Ezt=dd(F1t(),1),Tzt=new H,Szt=new H,P3={};P3.computeArea2D=function(o){let f=o.length,m=0;for(let v=f-1,y=0;y0?K1.COUNTER_CLOCKWISE:K1.CLOCKWISE};P3.triangulate=function(o,f){let m=Ye.packArray(o);return(0,Ezt.default)(m,f,2)};var Lqe=new H,Rqe=new H,Oqe=new H,h4e=new H,d4e=new H,f4e=new H,HI=new H,Nqe=new Ye,Fqe=new Ye,Bqe=new Ye,kz=new Ye;P3.computeSubdivision=function(o,f,m,v,y){y=Z(y,xe.RADIANS_PER_DEGREE);let x=N(v),C=m.slice(0),w,A=f.length,E=new Array(A*3),T=new Array(A*2),S=0,M=0;for(w=0;w0;){let F=C.pop(),k=C.pop(),U=C.pop(),G=H.fromArray(E,U*3,Lqe),j=H.fromArray(E,k*3,Rqe),q=H.fromArray(E,F*3,Oqe),J,X,Y;x&&(J=Ye.fromArray(T,U*2,Nqe),X=Ye.fromArray(T,k*2,Fqe),Y=Ye.fromArray(T,F*2,Bqe));let Q=H.multiplyByScalar(H.normalize(G,h4e),D,h4e),ee=H.multiplyByScalar(H.normalize(j,d4e),D,d4e),z=H.multiplyByScalar(H.normalize(q,f4e),D,f4e),ie=H.magnitudeSquared(H.subtract(Q,ee,HI)),re=H.magnitudeSquared(H.subtract(ee,z,HI)),ne=H.magnitudeSquared(H.subtract(z,Q,HI)),oe=Math.max(ie,re,ne),se,ae,fe;oe>R?ie===oe?(se=`${Math.min(U,k)} ${Math.max(U,k)}`,w=P[se],N(w)||(ae=H.add(G,j,HI),H.multiplyByScalar(ae,.5,ae),E.push(ae.x,ae.y,ae.z),w=E.length/3-1,P[se]=w,x&&(fe=Ye.add(J,X,kz),Ye.multiplyByScalar(fe,.5,fe),T.push(fe.x,fe.y))),C.push(U,w,F),C.push(w,k,F)):re===oe?(se=`${Math.min(k,F)} ${Math.max(k,F)}`,w=P[se],N(w)||(ae=H.add(j,q,HI),H.multiplyByScalar(ae,.5,ae),E.push(ae.x,ae.y,ae.z),w=E.length/3-1,P[se]=w,x&&(fe=Ye.add(X,Y,kz),Ye.multiplyByScalar(fe,.5,fe),T.push(fe.x,fe.y))),C.push(k,w,U),C.push(w,F,U)):ne===oe&&(se=`${Math.min(F,U)} ${Math.max(F,U)}`,w=P[se],N(w)||(ae=H.add(q,G,HI),H.multiplyByScalar(ae,.5,ae),E.push(ae.x,ae.y,ae.z),w=E.length/3-1,P[se]=w,x&&(fe=Ye.add(Y,J,kz),Ye.multiplyByScalar(fe,.5,fe),T.push(fe.x,fe.y))),C.push(F,w,k),C.push(w,U,k)):(I.push(U),I.push(k),I.push(F))}let O={attributes:{position:new en({componentDatatype:Rt.DOUBLE,componentsPerAttribute:3,values:E})},indices:I,primitiveType:Fn.TRIANGLES};return x&&(O.attributes.st=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:T})),new ga(O)};var Pzt=new Mt,Izt=new Mt,Mzt=new Mt,xde=new Mt;P3.computeRhumbLineSubdivision=function(o,f,m,v,y){y=Z(y,xe.RADIANS_PER_DEGREE);let x=N(v),C=m.slice(0),w,A=f.length,E=new Array(A*3),T=new Array(A*2),S=0,M=0;for(w=0;w0;){let U=C.pop(),G=C.pop(),j=C.pop(),q=H.fromArray(E,j*3,Lqe),J=H.fromArray(E,G*3,Rqe),X=H.fromArray(E,U*3,Oqe),Y,Q,ee;x&&(Y=Ye.fromArray(T,j*2,Nqe),Q=Ye.fromArray(T,G*2,Fqe),ee=Ye.fromArray(T,U*2,Bqe));let z=o.cartesianToCartographic(q,Pzt),ie=o.cartesianToCartographic(J,Izt),re=o.cartesianToCartographic(X,Mzt);R.setEndPoints(z,ie);let ne=R.surfaceDistance;O.setEndPoints(ie,re);let oe=O.surfaceDistance;F.setEndPoints(re,z);let se=F.surfaceDistance,ae=Math.max(ne,oe,se),fe,de,ve,pe,ce;ae>L?ne===ae?(fe=`${Math.min(j,G)} ${Math.max(j,G)}`,w=P[fe],N(w)||(de=R.interpolateUsingFraction(.5,xde),ve=(z.height+ie.height)*.5,pe=H.fromRadians(de.longitude,de.latitude,ve,o,HI),E.push(pe.x,pe.y,pe.z),w=E.length/3-1,P[fe]=w,x&&(ce=Ye.add(Y,Q,kz),Ye.multiplyByScalar(ce,.5,ce),T.push(ce.x,ce.y))),C.push(j,w,U),C.push(w,G,U)):oe===ae?(fe=`${Math.min(G,U)} ${Math.max(G,U)}`,w=P[fe],N(w)||(de=O.interpolateUsingFraction(.5,xde),ve=(ie.height+re.height)*.5,pe=H.fromRadians(de.longitude,de.latitude,ve,o,HI),E.push(pe.x,pe.y,pe.z),w=E.length/3-1,P[fe]=w,x&&(ce=Ye.add(Q,ee,kz),Ye.multiplyByScalar(ce,.5,ce),T.push(ce.x,ce.y))),C.push(G,w,j),C.push(w,U,j)):se===ae&&(fe=`${Math.min(U,j)} ${Math.max(U,j)}`,w=P[fe],N(w)||(de=F.interpolateUsingFraction(.5,xde),ve=(re.height+z.height)*.5,pe=H.fromRadians(de.longitude,de.latitude,ve,o,HI),E.push(pe.x,pe.y,pe.z),w=E.length/3-1,P[fe]=w,x&&(ce=Ye.add(ee,Y,kz),Ye.multiplyByScalar(ce,.5,ce),T.push(ce.x,ce.y))),C.push(U,w,G),C.push(w,j,G)):(I.push(j),I.push(G),I.push(U))}let k={attributes:{position:new en({componentDatatype:Rt.DOUBLE,componentsPerAttribute:3,values:E})},indices:I,primitiveType:Fn.TRIANGLES};return x&&(k.attributes.st=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:T})),new ga(k)};P3.scaleToGeodeticHeight=function(o,f,m,v){m=Z(m,ki.WGS84);let y=Tzt,x=Szt;if(f=Z(f,0),v=Z(v,!0),N(o)){let C=o.length;for(let w=0;w10&&f*2>o.length&&(this._array=o.slice(f),f=0),this._offset=f,this._length--,m};sO.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};sO.prototype.contains=function(o){return this._array.indexOf(o)!==-1};sO.prototype.clear=function(){this._array.length=this._offset=this._length=0};sO.prototype.sort=function(o){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(o)};var R5=sO,Mf={};Mf.computeHierarchyPackedLength=function(o,f){let m=0,v=[o];for(;v.length>0;){let y=v.pop();if(!N(y))continue;m+=2;let x=y.positions,C=y.holes;if(N(x)&&x.length>0&&(m+=x.length*f.packedLength),N(C)){let w=C.length;for(let A=0;A0;){let x=y.pop();if(!N(x))continue;let C=x.positions,w=x.holes;if(f[m++]=N(C)?C.length:0,f[m++]=N(w)?w.length:0,N(C)){let A=C.length;for(let E=0;E0?new Array(y):void 0;for(let w=0;wiR.eastOverIDL-iR.westOverIDL&&(y.west=iR.westOverIDL,y.east=iR.eastOverIDL,y.east>xe.PI&&(y.east=y.east-xe.TWO_PI),y.west>xe.PI&&(y.west=y.west-xe.TWO_PI)),y}var aHt=new Mt;function y4e(o,f,m,v){let y=o.surfaceDistance,x=Math.ceil(y*f),C=x>0?y/(x-1):Number.POSITIVE_INFINITY,w=0;for(let A=0;A=0?T:T+xe.TWO_PI;v.westOverIDL=Math.min(v.westOverIDL,M),v.eastOverIDL=Math.max(v.eastOverIDL,M)}}var x4e=[];function sHt(o,f,m,v,y,x,C,w,A,E){let T={walls:[]},S;if(C||w){let O=lu.createGeometryFromPositions(o,f,m,v,x,A,E),F=O.attributes.position.values,k=O.indices,U,G;if(C&&w){let j=F.concat(F);U=j.length/3,G=ro.createTypedArray(U,k.length*2),G.set(k);let q=k.length,J=U/2;for(S=0;S0){f=Z(f,Ee.IDENTITY);let y=Ee.inverseTransformation(f,fHt),x=Ee.multiplyByPoint(y,H.ZERO,pHt),C=H.normalize(Ee.multiplyByPointAsVector(y,H.UNIT_Y,C4e),C4e),w=$a.fromPointNormal(x,C,mHt),A=H.normalize(Ee.multiplyByPointAsVector(y,H.UNIT_X,b4e),b4e),E=$a.fromPointNormal(x,A,gHt),T=1;m.push(H.clone(o[0]));let S=m[0],M=o.length;for(let I=1;I0?new Array(y):void 0;for(v=0;v0){let ie=0,re=S[0];v=v.filter(function(ne,oe){let se=!1;return y?se=oe===re||oe===0&&re===1:se=oe+1===re,se?(ie++,re=S[ie],!1):!0})}let I=M.length;if(I<2||f<=0)return;if(x===fs.GEODESIC||x===fs.RHUMB){let ie,re;x===fs.GEODESIC?(ie=xe.chordLength(C,w.maximumRadius),re=Zh.numberOfPoints):(ie=C,re=Zh.numberOfPointsRhumbLine);let ne=Zh.extractHeights(M,w);if(N(v)){let oe=1;for(A=0;A farSq) { show = 0.0; } #endif float polylineAngle; vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle); gl_Position = czm_viewportOrthographic * positionWC * show; v_st.s = texCoord; v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w); v_width = width; v_pickColor = pickColor; v_polylineAngle = polylineAngle; } `;function ab(o,f){o=Z(o,Z.EMPTY_OBJECT),this._show=Z(o.show,!0),this._width=Z(o.width,1),this._loop=Z(o.loop,!1),this._distanceDisplayCondition=o.distanceDisplayCondition,this._material=o.material,N(this._material)||(this._material=zo.fromType(zo.ColorType,{color:new Re(1,1,1,1)}));let m=o.positions;N(m)||(m=[]),this._positions=m,this._actualPositions=F0(m,H.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=m.slice()),this._actualPositions.push(H.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=o.id;let v;N(f)&&(v=Ee.clone(f.modelMatrix)),this._modelMatrix=v,this._segments=Zh.wrapLongitude(this._actualPositions,v),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(jqe),this._polylineCollection=f,this._dirty=!1,this._pickId=void 0,this._boundingVolume=Pi.fromPoints(this._actualPositions),this._boundingVolumeWC=Pi.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new Pi}var Wqe=ab.POSITION_INDEX=0,AHt=ab.SHOW_INDEX=1,EHt=ab.WIDTH_INDEX=2,THt=ab.MATERIAL_INDEX=3,Y7=ab.POSITION_SIZE_INDEX=4,SHt=ab.DISTANCE_DISPLAY_CONDITION=5,jqe=ab.NUMBER_OF_PROPERTIES=6;function VI(o,f){++o._propertiesChanged[f];let m=o._polylineCollection;N(m)&&(m._updatePolyline(o,f),o._dirty=!0)}Object.defineProperties(ab.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,VI(this,AHt))}},positions:{get:function(){return this._positions},set:function(o){let f=F0(o,H.equalsEpsilon);this._loop&&f.length>2&&(f===o&&(f=o.slice()),f.push(H.clone(f[0]))),(this._actualPositions.length!==f.length||this._actualPositions.length!==this._length)&&VI(this,Y7),this._positions=o,this._actualPositions=f,this._length=f.length,this._boundingVolume=Pi.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=Pi.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),VI(this,Wqe),this.update()}},material:{get:function(){return this._material},set:function(o){this._material!==o&&(this._material=o,VI(this,THt))}},width:{get:function(){return this._width},set:function(o){let f=this._width;o!==f&&(this._width=o,VI(this,EHt))}},loop:{get:function(){return this._loop},set:function(o){if(o!==this._loop){let f=this._actualPositions;o?f.length>2&&!H.equals(f[0],f[f.length-1])&&(f.length===this._positions.length&&(this._actualPositions=f=this._positions.slice()),f.push(H.clone(f[0]))):f.length>2&&H.equals(f[0],f[f.length-1])&&(f.length-1===this._positions.length?this._actualPositions=this._positions:f.pop()),this._loop=o,VI(this,Y7)}}},id:{get:function(){return this._id},set:function(o){this._id=o,N(this._pickId)&&(this._pickId.object.id=o)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!N(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(o){ia.equals(o,this._distanceDisplayCondition)||(this._distanceDisplayCondition=ia.clone(o,this._distanceDisplayCondition),VI(this,SHt))}}});ab.prototype.update=function(){let o=Ee.IDENTITY;N(this._polylineCollection)&&(o=this._polylineCollection.modelMatrix);let f=this._segments.positions.length,m=this._segments.lengths,v=this._propertiesChanged[Wqe]>0||this._propertiesChanged[Y7]>0;if((!Ee.equals(o,this._modelMatrix)||v)&&(this._segments=Zh.wrapLongitude(this._actualPositions,o),this._boundingVolumeWC=Pi.transform(this._boundingVolume,o,this._boundingVolumeWC)),this._modelMatrix=Ee.clone(o,this._modelMatrix),this._segments.positions.length!==f)VI(this,Y7);else{let y=m.length;for(let x=0;x2){if(y[qme]||y[P4e]){let P=o.mode===_i.SCENE2D?v._boundingVolume2D:v._boundingVolumeWC,D=Qu.fromCartesian(P.center,qqe),L=Wt.fromElements(D.low.x,D.low.y,D.low.z,P.radius,Xqe);this._batchTable.setBatchedAttribute(v._index,2,D.high),this._batchTable.setBatchedAttribute(v._index,3,L)}if(y[DHt]){let P=Jqe;P.x=0,P.y=Number.MAX_VALUE;let D=v.distanceDisplayCondition;N(D)&&(P.x=D.near,P.y=D.far),this._batchTable.setBatchedAttribute(v._index,4,P)}}v._clean()}}A.length=0,this._polylinesUpdated=!1}y=this._propertiesChanged;for(let A=0;A0){let oe=q.isTranslucent();w>=C?(X=new Jn({owner:o}),m.push(X)):X=m[w],++w,Y=va(S(q._uniforms),o._uniformMap),X.boundingVolume=Pi.clone(I9,X.boundingVolume),X.modelMatrix=v,X.shaderProgram=k,X.vertexArray=P.va,X.renderState=oe?o._translucentRS:o._opaqueRS,X.pass=oe?vr.TRANSLUCENT:vr.OPAQUE,X.debugShowBoundingVolume=T,X.pickId="v_pickColor",X.uniformMap=Y,X.count=J,X.offset=F,F+=J,J=0,A=!0,x.push(X)}q=ee._material,q.update(y),j=z}let ie=ee._locatorBuckets,re=ie.length;for(let oe=0;oe0&&(w>=C?(X=new Jn({owner:o}),m.push(X)):X=m[w],++w,Y=va(S(q._uniforms),o._uniformMap),X.boundingVolume=Pi.clone(I9,X.boundingVolume),X.modelMatrix=v,X.shaderProgram=k,X.vertexArray=P.va,X.renderState=q.isTranslucent()?o._translucentRS:o._opaqueRS,X.pass=q.isTranslucent()?vr.TRANSLUCENT:vr.OPAQUE,X.debugShowBoundingVolume=T,X.pickId="v_pickColor",X.uniformMap=Y,X.count=J,X.offset=F,A=!0,x.push(X)),j=void 0}}m.length=w}dT.prototype.isDestroyed=function(){return!1};dT.prototype.destroy=function(){return Kqe(this),YCe(this),Qqe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),kr(this)};function OHt(o){let f=!1,m=o._propertiesChanged,v=o._positionBufferUsage;return m[qme]?(v.bufferUsage!==gn.STREAM_DRAW&&(f=!0,v.bufferUsage=gn.STREAM_DRAW),v.frameCount=100):v.bufferUsage!==gn.STATIC_DRAW&&(v.frameCount===0?(f=!0,v.bufferUsage=gn.STATIC_DRAW):v.frameCount--),f}var M4e=[0,0,0];function D4e(o,f,m){o._createVertexArray=!1,YCe(o),Kqe(o),BHt(o);let v=[[]],y=v[0],x=o._batchTable,C=o._useHighlightColor,w=o.disableDepthTestDistance,A=[0],E=0,T=[[]],S=0,M=o._polylineBuckets,I,P;for(I in M)M.hasOwnProperty(I)&&(P=M[I],P.updateShader(f,x,C,w),S+=P.lengthOfPositions);if(S>0){let D=o._mode,L=new Float32Array(6*S*3),R=new Float32Array(S*4),O,F=0,k=0,U=0;for(I in M)if(M.hasOwnProperty(I)){P=M[I],P.write(L,R,F,k,U,x,f,m),D===_i.MORPHING&&(N(O)||(O=new Float32Array(6*S*3)),P.writeForMorph(O,F));let ee=P.lengthOfPositions;F+=6*ee*3,k+=ee*4,U+=ee*4,E=P.updateIndices(v,A,T,E)}let G=o._positionBufferUsage.bufferUsage,j=gn.STATIC_DRAW;o._positionBuffer=Ao.createVertexBuffer({context:f,typedArray:L,usage:G});let q;N(O)&&(q=Ao.createVertexBuffer({context:f,typedArray:O,usage:G})),o._texCoordExpandAndBatchIndexBuffer=Ao.createVertexBuffer({context:f,typedArray:R,usage:j});let J=3*Float32Array.BYTES_PER_ELEMENT,X=4*Float32Array.BYTES_PER_ELEMENT,Y=0,Q=v.length;for(let ee=0;ee0){let z=new Uint16Array(y),ie=Ao.createIndexBuffer({context:f,typedArray:z,usage:gn.STATIC_DRAW,indexDatatype:ro.UNSIGNED_SHORT});Y+=A[ee];let re=6*(ee*(J*xe.SIXTY_FOUR_KILOBYTES)-Y*J),ne=J+re,oe=J+ne,se=J+oe,ae=J+se,fe=J+ae,de=ee*(X*xe.SIXTY_FOUR_KILOBYTES)-Y*X,ve=[{index:Wx.position3DHigh,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:re,strideInBytes:6*J},{index:Wx.position3DLow,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:ne,strideInBytes:6*J},{index:Wx.position2DHigh,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:re,strideInBytes:6*J},{index:Wx.position2DLow,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:ne,strideInBytes:6*J},{index:Wx.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:oe,strideInBytes:6*J},{index:Wx.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:se,strideInBytes:6*J},{index:Wx.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:oe,strideInBytes:6*J},{index:Wx.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:se,strideInBytes:6*J},{index:Wx.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:ae,strideInBytes:6*J},{index:Wx.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:fe,strideInBytes:6*J},{index:Wx.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:ae,strideInBytes:6*J},{index:Wx.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:fe,strideInBytes:6*J},{index:Wx.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,vertexBuffer:o._texCoordExpandAndBatchIndexBuffer,offsetInBytes:de}],pe,ce,he,Ce;D===_i.SCENE3D?(ce=o._positionBuffer,pe="vertexBuffer",he=M4e,Ce="value"):D===_i.SCENE2D||D===_i.COLUMBUS_VIEW?(ce=M4e,pe="value",he=o._positionBuffer,Ce="vertexBuffer"):(ce=q,pe="vertexBuffer",he=o._positionBuffer,Ce="vertexBuffer"),ve[0][pe]=ce,ve[1][pe]=ce,ve[2][Ce]=he,ve[3][Ce]=he,ve[4][pe]=ce,ve[5][pe]=ce,ve[6][Ce]=he,ve[7][Ce]=he,ve[8][pe]=ce,ve[9][pe]=ce,ve[10][Ce]=he,ve[11][Ce]=he;let Se=new Du({context:f,attributes:ve,indexBuffer:ie});o._vertexArrays.push({va:Se,buckets:T[ee]})}}}function NHt(o,f){return f instanceof _o?f.id:f}var kQ=[];function FHt(o){let f=zo._uniformList[o.type],m=f.length;kQ.length=2*m;let v=0;for(let y=0;y1){w.update();let A=w.material,E=v[A.type];N(E)||(E=v[A.type]=new q2(A,f,m)),E.addPolyline(w)}}}function kHt(o,f){let m=f.mode;(o._mode!==m||!Ee.equals(o._modelMatrix,o.modelMatrix))&&(o._mode=m,o._modelMatrix=Ee.clone(o.modelMatrix),o._createVertexArray=!0)}function jCe(o){if(o._polylinesRemoved){o._polylinesRemoved=!1;let f=[],m=[],v=0,y,x=o._polylines.length;for(let C=0;C0,L=I._index,R=this.getSegments(I,w),O=R.positions,F=R.lengths,k=O.length,U=I.getPickId(C).color,G=0,j=0,q;for(let ne=0;ne0||tg.x>0&&fw.x<0)&&H.clone(tg,fw),(tg.x<0&&pw.x>0||tg.x>0&&pw.x<0)&&H.clone(tg,pw));let fe=se?2:0,de=ae?2:4;for(let ve=fe;ve2&&(x.setBatchedAttribute(L,2,ee),x.setBatchedAttribute(L,3,z),x.setBatchedAttribute(L,4,ie))}};var HHt=new H,UHt=new H,GHt=new H,L4e=new H;q2.prototype.writeForMorph=function(o,f){let m=this.modelMatrix,v=this.polylines,y=v.length;for(let x=0;x0&&(A=w[w.length-1]+1);let E=this.polylines,T=E.length;for(let S=0;S0)I[0]=D;else continue}else I=M._segments.lengths;let P=I.length;if(P>0){let D=0;for(let L=0;Lxe.SIXTY_FOUR_KILOBYTES&&(M._locatorBuckets.push({locator:x,count:D}),D=0,f.push(4),w=[],o.push(w),A=0,x.count=C,C=0,v=0,x=new wde(0,0,this),m[++y]=[x]),w.push(A,A+2,A+1),w.push(A+1,A+2,A+3),D+=6,C+=6,v+=6,A+=4}M._locatorBuckets.push({locator:x,count:D}),A+4>xe.SIXTY_FOUR_KILOBYTES&&(f.push(0),w=[],o.push(w),A=0,x.count=C,v=0,C=0,x=new wde(0,0,this),m[++y]=[x])}M._clean()}return x.count=C,v};q2.prototype.getPolylineStartIndex=function(o){let f=this.polylines,m=0,v=f.length;for(let y=0;y0){o._boundingVolume2D=Pi.fromPoints(y,o._boundingVolume2D);let E=o._boundingVolume2D.center;o._boundingVolume2D.center=new H(E.z,E.x,E.y)}return PV.positions=y,PV.lengths=o._segments.lengths,PV};var O4e;q2.prototype.writeUpdate=function(o,f,m,v){let y=this.mode,x=v.ellipsoid.maximumRadius*xe.PI,C=f._actualLength;if(C){o+=this.getPolylineStartIndex(f);let w=O4e,A=6*C*3;!N(w)||w.lengthA&&(w=new Float32Array(w.buffer,0,A));let E=this.getSegments(f,v),T=E.positions,S=E.lengths,M=0,I=0,P=0,D;C=T.length;for(let L=0;L0||tg.x>0&&fw.x<0)&&H.clone(tg,fw),(tg.x<0&&pw.x>0||tg.x>0&&pw.x<0)&&H.clone(tg,pw));let k=O?2:0,U=F?2:4;for(let G=k;Gthis._primitiveSize&&this.savePrimitive(),this.instancesLabel.add(this._labelOptions)};Yv.prototype.createPolylineGeometryInstance2=function(o,f,m){let v={},y=this.convertCoordinates([f]);v.positions=H.fromDegreesArray(y),v.width=this._lineWidth,v.material=zo.fromType("Color"),v.material.uniforms.color=this._modelColor,v.id=m,v.disableDepthTestDistance=this.disableDepthTest,this.instancesPolylineCollection.length>this._primitiveSize&&this.savePrimitive(),this.instancesPolylineCollection.add(v)};Yv.prototype.createPolylineGeometryInstance=function(o,f,m){let v=ea.fromColor(this._modelColor),y=this.convertCoordinates([f]),x=H.fromDegreesArray(y),C=this;this.instancesPolyline.length>this._primitiveSize&&this.savePrimitive(),this.instancesPolyline.push(new co({geometry:new b_({width:C._lineWidth,positions:x}),id:m,attributes:{color:v}}))};Yv.prototype.createPolygonGeometryInstance=function(o,f,m){let v=this,y=ea.fromColor(v._modelColor),x=v.convertCoordinates(f),C=H.fromDegreesArray(x),w=o.properties[v._modelHeightKey];N(w)||(w=0),v.type===eXe&&(w=void 0),v.instancesPolygon.length>v._primitiveSize&&v.savePrimitive(),v.instancesPolygon.push(new co({geometry:new Ec({polygonHierarchy:new ho(C),extrudedHeight:w,height:v._groundHeight}),id:m,releaseGeometryInstances:!0,attributes:{color:y}}))};Yv.prototype.parse=function(o){if(Array.isArray(o)){let f=this;for(let m=0;m0){let f,m;if(o.type===$qe)N(o._image)?f=this.material:(f=zo.fromType(zo.ColorType),f.uniforms.color=o._modelColor),m=new Nd({material:f,translucent:!0,faceForward:!0,vertexShaderSource:qHt,fragmentShaderSource:XHt});else if(o.type===eXe){let v={};v.normalMap=Ms("Assets/Images/waterNormals.jpg"),v.baseWaterColor=o.baseWaterColor,v.frequency=o.waterFrequency,v.animationSpeed=o.animationSpeed,v.amplitude=o.amplitude,f=new zo({fabric:{type:"Water",uniforms:v}}),f.update(o._earthCtrl.coreMap.scene.context),m=new MY({material:f,fragmentShaderSource:qCe})}else m=new ms;o._primitive.push(o._earthCtrl.primitives.add(new Ia({geometryInstances:o.instancesPolygon,appearance:m}))),o.instancesPolygon=[]}if(o.instancesPolyline.length>0){let f,m;if(o.type===JHt){let v={duration:o.duration};N(o._image)&&(v.image=o._image),f=zo.fromType("PolylineTrailLink"),f.uniforms.image=o._image,f.uniforms.time=.8,m=new Nd({material:f,translucent:!0,faceForward:!0})}else m=new tm({});o._primitive.push(o._earthCtrl.primitives.add(new Ia({geometryInstances:o.instancesPolyline,appearance:m}))),o.instancesPolyline=[]}o.instancesLabel.length>0&&(o._primitive.push(o._earthCtrl.primitives.add(o.instancesLabel)),o.instancesLabel=new UM),o.instancesPolylineCollection.length>0&&(o._primitive.push(o._earthCtrl.primitives.add(o.instancesPolylineCollection)),o.instancesPolylineCollection=new lO)};Yv.prototype.convertCoordinates=function(o){let f=[];for(let m=0;m0&&(P=!0,S+=E),C1?f.renderbufferStorageMultisample(f.RENDERBUFFER,C,v,y,x):f.renderbufferStorage(f.RENDERBUFFER,v,y,x),f.bindRenderbuffer(f.RENDERBUFFER,null)}Object.defineProperties(DY.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});DY.prototype._getRenderbuffer=function(){return this._renderbuffer};DY.prototype.isDestroyed=function(){return!1};DY.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),kr(this)};var N1=DY,uXe={};function tUt(o,f,m){let v,y,x;if(o instanceof pc){let C=Math.tan(.5*o.fovy);return v=o.near,y=o.near*C,x=o.aspectRatio*y,Math.max(f*v/x,m*v/y)}else if(o instanceof J2)return v=o.near,y=o.top,x=o.right,Math.max(f*v/x,m*v/y);return Math.max(f,m)}var iUt=new H,k4e=new H;function cXe(o,f,m,v){if(N(v)&&m(.5)>v){let y=m(0),x=m(1),C=m(.5),w=C-y,A=C-x;return function(E){let T=m(E);if(E<=.5){let M=(T-y)/w;return xe.lerp(o,-xe.PI_OVER_TWO,M)}let S=(T-x)/A;return xe.lerp(-xe.PI_OVER_TWO,f,1-S)}}return function(y){return xe.lerp(o,f,y)}}function JCe(o,f,m,v,y){let x=y,C=Math.max(m,v);if(!N(x)){let w=o.position,A=f,E=o.up,T=o.right,S=o.frustum,M=H.subtract(w,A,iUt),I=H.magnitude(H.multiplyByScalar(E,H.dot(M,E),k4e)),P=H.magnitude(H.multiplyByScalar(T,H.dot(M,T),k4e));x=Math.min(tUt(S,I,P)*.2,1e9)}if(Co+Math.PI?o+=xe.TWO_PI:fxe.PI&&(f.longitude+=xe.TWO_PI)}var aUt=new Mt,sUt=new Mt;function lUt(o,f,m,v,y,x,C,w,A,E){let T=o.camera,S=o.mapProjection.ellipsoid,M=Mt.clone(T.positionCartographic,aUt),I=T.pitch,P=ij(T.heading,v),D=ij(T.roll,x),L=S.cartesianToCartographic(m,sUt);M.longitude=xe.zeroToTwoPi(M.longitude),L.longitude=xe.zeroToTwoPi(L.longitude);let R=!1;if(N(w)){let U=xe.zeroToTwoPi(w),G=Math.min(M.longitude,L.longitude),j=Math.max(M.longitude,L.longitude),q=U>=G&&U<=j;if(N(A)){let J=Math.abs(M.longitude-L.longitude),X=xe.TWO_PI-J;(q?J:X)<(q?X:J)*A&&!q&&(R=!0)}else q||(R=!0)}R?nUt(M,L):oUt(M,L);let O=JCe(T,m,M.height,L.height,C),F=cXe(I,y,O,E);function k(){let U=M.longitude,G=L.longitude,j=M.latitude,q=L.latitude;return function(J){let X=J.time/f,Y=H.fromRadians(xe.lerp(U,G,X),xe.lerp(j,q,X),O(X),S);T.setView({destination:Y,orientation:{heading:xe.lerp(P,v,X),pitch:F(X),roll:xe.lerp(D,x,X)}})}}return k()}function uUt(o,f,m,v,y,x,C){let w=o.camera,A=H.clone(w.position,hXe),E=ij(w.heading,v),T=w.frustum.right-w.frustum.left,S=JCe(w,m,T,m.z,C);function M(I){let P=I.time/f;w.setView({orientation:{heading:xe.lerp(E,v,P)}}),Ye.lerp(A,m,P,w.position);let D=S(P),L=w.frustum,R=L.top/L.right,O=(D-(L.right-L.left))*.5;L.right+=O,L.left-=O,L.top=R*L.right,L.bottom=-L.top}return M}var V4e=new Mt,cUt=new H;function Ade(o,f){return{startObject:{},stopObject:{},duration:0,complete:o,cancel:f}}function z4e(o,f){function m(){typeof f=="function"&&f(),o.enableInputs=!0}return m}uXe.createTween=function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=f.destination,v=o.mode;if(v===_i.MORPHING)return Ade();let y=Z(f.convert,!0),x=o.mapProjection,C=x.ellipsoid,w=f.maximumHeight,A=f.flyOverLongitude,E=f.flyOverLongitudeWeight,T=f.pitchAdjustHeight,S=f.easingFunction;y&&v!==_i.SCENE3D&&(C.cartesianToCartographic(m,V4e),m=x.project(V4e,cUt));let M=o.camera,I=f.endTransform;N(I)&&M._setTransform(I);let P=f.duration;N(P)||(P=Math.ceil(H.distance(M.position,m)/1e6)+2,P=Math.min(P,3));let D=Z(f.heading,0),L=Z(f.pitch,-xe.PI_OVER_TWO),R=Z(f.roll,0),O=o.screenSpaceCameraController;O.enableInputs=!1;let F=z4e(O,f.complete),k=z4e(O,f.cancel),U=M.frustum,G=o.mode===_i.SCENE2D;if(G=G&&Ye.equalsEpsilon(M.position,m,xe.EPSILON6),G=G&&xe.equalsEpsilon(Math.max(U.right-U.left,U.top-U.bottom),m.z,xe.EPSILON6),G=G||o.mode!==_i.SCENE2D&&H.equalsEpsilon(m,M.position,xe.EPSILON10),G=G&&xe.equalsEpsilon(xe.negativePiToPi(D),xe.negativePiToPi(M.heading),xe.EPSILON10)&&xe.equalsEpsilon(xe.negativePiToPi(L),xe.negativePiToPi(M.pitch),xe.EPSILON10)&&xe.equalsEpsilon(xe.negativePiToPi(R),xe.negativePiToPi(M.roll),xe.EPSILON10),G)return Ade(F,k);let j=new Array(4);if(j[_i.SCENE2D]=uUt,j[_i.SCENE3D]=lUt,j[_i.COLUMBUS_VIEW]=rUt,P<=0)return Ade(function(){j[v](o,1,m,D,L,R,w,A,E,T)({time:1}),typeof F=="function"&&F()},k);let q=j[v](o,P,m,D,L,R,w,A,E,T);if(!N(S)){let J=M.positionCartographic.height,X=v===_i.SCENE3D?C.cartesianToCartographic(m).height:m.z;J>X&&J>11500?S=Bv.CUBIC_OUT:S=Bv.QUINTIC_IN_OUT}return{duration:P,easingFunction:S,startObject:{time:0},stopObject:{time:P},update:q,complete:F,cancel:k}};var KCe=uXe,hUt={ROTATE:0,INFINITE_SCROLL:1},$E=Object.freeze(hUt);function _a(o){this._scene=o,this._transform=Ee.clone(Ee.IDENTITY),this._invTransform=Ee.clone(Ee.IDENTITY),this._actualTransform=Ee.clone(Ee.IDENTITY),this._actualInvTransform=Ee.clone(Ee.IDENTITY),this._transformChanged=!1,this.position=new H,this._position=new H,this._positionWC=new H,this._positionCartographic=new Mt,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new H,this._direction=new H,this._directionWC=new H,this.up=new H,this._up=new H,this._upWC=new H,this.right=new H,this._right=new H,this._rightWC=new H,this.frustum=new pc,this.frustum.aspectRatio=o.drawingBufferWidth/o.drawingBufferHeight,this.frustum.fov=xe.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new Br,this._moveEnd=new Br,this._changed=new Br,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this.percentageChanged=.5,this._viewMatrix=new Ee,this._invViewMatrix=new Ee,dXe(this),this._mode=_i.SCENE3D,this._modeChanged=!0;let f=o.mapProjection;this._projection=f,this._maxCoord=f.project(new Mt(Math.PI,xe.PI_OVER_TWO)),this._max2Dfrustum=void 0,wXe(this,_a.DEFAULT_VIEW_RECTANGLE,this.position,!0);let m=H.magnitude(this.position);m+=m*_a.DEFAULT_VIEW_FACTOR,H.normalize(this.position,this.position),H.multiplyByScalar(this.position,m,this.position)}_a.TRANSFORM_2D=new Ee(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);_a.TRANSFORM_2D_INVERSE=Ee.inverseTransformation(_a.TRANSFORM_2D,new Ee);_a.DEFAULT_VIEW_RECTANGLE=Di.fromDegrees(-95,-20,-70,90);_a.DEFAULT_VIEW_FACTOR=.5;_a.DEFAULT_OFFSET=new gC(0,-xe.PI_OVER_FOUR,0);function dXe(o){Ee.computeView(o._position,o._direction,o._up,o._right,o._viewMatrix),Ee.multiply(o._viewMatrix,o._actualInvTransform,o._viewMatrix),Ee.inverseTransformation(o._viewMatrix,o._invViewMatrix)}function dUt(o){if(!N(o._oldPositionWC))o._oldPositionWC=H.clone(o.positionWC,o._oldPositionWC);else{o.positionWCDeltaMagnitudeLastFrame=o.positionWCDeltaMagnitude;let f=H.subtract(o.positionWC,o._oldPositionWC,o._oldPositionWC);o.positionWCDeltaMagnitude=H.magnitude(f),o._oldPositionWC=H.clone(o.positionWC,o._oldPositionWC),o.positionWCDeltaMagnitude>0?(o.timeSinceMoved=0,o._lastMovedTimestamp=$c()):o.timeSinceMoved=Math.max($c()-o._lastMovedTimestamp,0)/1e3}}_a.prototype.canPreloadFlight=function(){return N(this._currentFlight)&&this._mode!==_i.SCENE2D};_a.prototype._updateCameraChanged=function(){let o=this;if(dUt(o),o._changed.numberOfListeners===0)return;let f=o.percentageChanged,m=o.heading;N(o._changedHeading)||(o._changedHeading=m);let v=Math.abs(o._changedHeading-m)%xe.TWO_PI;v=v>xe.PI?xe.TWO_PI-v:v;let y=v/Math.PI;if(y>f&&(o._changed.raiseEvent(y),o._changedHeading=m),o._mode===_i.SCENE2D){if(!N(o._changedFrustum)){o._changedPosition=H.clone(o.position,o._changedPosition),o._changedFrustum=o.frustum.clone();return}let A=o.position,E=o._changedPosition,T=o.frustum,S=o._changedFrustum,M=A.x+T.left,I=A.x+T.right,P=E.x+S.left,D=E.x+S.right,L=A.y+T.bottom,R=A.y+T.top,O=E.y+S.bottom,F=E.y+S.top,k=Math.max(M,P),U=Math.min(I,D),G=Math.max(L,O),j=Math.min(R,F),q;if(k>=U||G>=R)q=1;else{let J=S;MD&&LF&&(J=T),q=1-(U-k)*(j-G)/((J.right-J.left)*(J.top-J.bottom))}q>f&&(o._changed.raiseEvent(q),o._changedPosition=H.clone(o.position,o._changedPosition),o._changedFrustum=o.frustum.clone(o._changedFrustum));return}if(!N(o._changedDirection)){o._changedPosition=H.clone(o.positionWC,o._changedPosition),o._changedDirection=H.clone(o.directionWC,o._changedDirection);return}let x=xe.acosClamped(H.dot(o.directionWC,o._changedDirection)),C;N(o.frustum.fovy)?C=x/(o.frustum.fovy*.5):C=x;let w=H.distance(o.positionWC,o._changedPosition)/o.positionCartographic.height;(C>f||w>f)&&(o._changed.raiseEvent(Math.max(C,w)),o._changedPosition=H.clone(o.positionWC,o._changedPosition),o._changedDirection=H.clone(o.directionWC,o._changedDirection))};function fUt(o){tn.basisTo2D(o._projection,o._transform,o._actualTransform)}var pUt=new Mt,mUt=new H,HQ=new H,gUt=new Wt,_Ut=new Wt,vUt=new Wt,yUt=new Wt,xUt=new Wt;function CUt(o){let f=o._projection,m=f.ellipsoid,v=Ee.getColumn(o._transform,3,gUt),y=m.cartesianToCartographic(v,pUt),x=f.project(y,mUt),C=_Ut;C.x=x.z,C.y=x.x,C.z=x.y,C.w=1;let w=Wt.clone(Wt.UNIT_X,xUt),A=Wt.add(Ee.getColumn(o._transform,0,HQ),v,HQ);m.cartesianToCartographic(A,y),f.project(y,x);let E=vUt;E.x=x.z,E.y=x.x,E.z=x.y,E.w=0,H.subtract(E,C,E),E.x=0;let T=yUt;if(H.magnitudeSquared(E)>xe.EPSILON10)H.cross(w,E,T);else{let S=Wt.add(Ee.getColumn(o._transform,1,HQ),v,HQ);m.cartesianToCartographic(S,y),f.project(y,x),T.x=x.z,T.y=x.x,T.z=x.y,T.w=0,H.subtract(T,C,T),T.x=0,H.magnitudeSquared(T)xe.EPSILON2){let D=1/H.magnitudeSquared(A),L=H.dot(A,C)*D,R=H.multiplyByScalar(C,L,Ede);A=H.normalize(H.subtract(A,R,o._up),o._up),H.clone(A,o.up),T=H.cross(C,A,o._right),H.clone(T,o.right)}}(w||M)&&(o._directionWC=Ee.multiplyByPointAsVector(I,C,o._directionWC),H.normalize(o._directionWC,o._directionWC)),(E||M)&&(o._upWC=Ee.multiplyByPointAsVector(I,A,o._upWC),H.normalize(o._upWC,o._upWC)),(S||M)&&(o._rightWC=Ee.multiplyByPointAsVector(I,T,o._rightWC),H.normalize(o._rightWC,o._rightWC)),(x||w||E||S||M)&&dXe(o)}function QCe(o,f){let m;return xe.equalsEpsilon(Math.abs(o.z),1,xe.EPSILON3)?m=Math.atan2(f.y,f.x)-xe.PI_OVER_TWO:m=Math.atan2(o.y,o.x)-xe.PI_OVER_TWO,xe.TWO_PI-xe.zeroToTwoPi(m)}function fXe(o){return xe.PI_OVER_TWO-xe.acosClamped(o.z)}function pXe(o,f,m){let v=0;return xe.equalsEpsilon(Math.abs(o.z),1,xe.EPSILON3)||(v=Math.atan2(-m.z,f.z),v=xe.zeroToTwoPi(v+xe.TWO_PI)),v}var q7=new Ee,X7=new Ee;Object.defineProperties(_a.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return yv(this),this._invTransform}},viewMatrix:{get:function(){return yv(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return yv(this),this._invViewMatrix}},positionCartographic:{get:function(){return yv(this),this._positionCartographic}},positionWC:{get:function(){return yv(this),this._positionWC}},directionWC:{get:function(){return yv(this),this._directionWC}},upWC:{get:function(){return yv(this),this._upWC}},rightWC:{get:function(){return yv(this),this._rightWC}},heading:{get:function(){if(this._mode!==_i.MORPHING){let o=this._projection.ellipsoid,f=Ee.clone(this._transform,q7),m=tn.eastNorthUpToFixedFrame(this.positionWC,o,X7);this._setTransform(m);let v=QCe(this.direction,this.up);return this._setTransform(f),v}}},pitch:{get:function(){if(this._mode!==_i.MORPHING){let o=this._projection.ellipsoid,f=Ee.clone(this._transform,q7),m=tn.eastNorthUpToFixedFrame(this.positionWC,o,X7);this._setTransform(m);let v=fXe(this.direction);return this._setTransform(f),v}}},roll:{get:function(){if(this._mode!==_i.MORPHING){let o=this._projection.ellipsoid,f=Ee.clone(this._transform,q7),m=tn.eastNorthUpToFixedFrame(this.positionWC,o,X7);this._setTransform(m);let v=pXe(this.direction,this.up,this.right);return this._setTransform(f),v}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});_a.prototype.update=function(o){let f=!1;if(o!==this._mode&&(this._mode=o,this._modeChanged=o!==_i.MORPHING,f=this._mode===_i.SCENE2D),f){let m=this._max2Dfrustum=this.frustum.clone(),v=2,y=m.top/m.right;m.right=this._maxCoord.x*v,m.left=-m.right,m.top=y*m.right,m.bottom=-m.top}this._mode===_i.SCENE2D&&vXe(this,this.position)};var bUt=new H,wUt=new H,AUt=new H;_a.prototype._setTransform=function(o){let f=H.clone(this.positionWC,bUt),m=H.clone(this.upWC,wUt),v=H.clone(this.directionWC,AUt);Ee.clone(o,this._transform),this._transformChanged=!0,yv(this);let y=this._actualInvTransform;Ee.multiplyByPoint(y,f,this.position),Ee.multiplyByPointAsVector(y,v,this.direction),Ee.multiplyByPointAsVector(y,m,this.up),H.cross(this.direction,this.up,this.right),yv(this)};var EUt=new Ye,TUt=new _s,SUt=new H,PUt=new H;function mXe(o){if(!Ee.equals(Ee.IDENTITY,o.transform))return H.magnitude(o.position);let f=o._scene,m=f.globe,v=EUt;v.x=f.drawingBufferWidth/2,v.y=f.drawingBufferHeight/2;let y;if(N(m)){let w=o.getPickRay(v,TUt);y=m.pickWorldCoordinates(w,f,!0,SUt)}let x;f.pickPositionSupported&&(x=f.pickPositionWorldCoordinates(v,PUt));let C;if(N(y)||N(x)){let w=N(x)?H.distance(x,o.positionWC):Number.POSITIVE_INFINITY,A=N(y)?H.distance(y,o.positionWC):Number.POSITIVE_INFINITY;C=Math.min(w,A)}else C=Math.max(o.positionCartographic.height,0);return C}_a.prototype._adjustOrthographicFrustum=function(o){this.frustum instanceof Gs&&(!o&&this._positionCartographic.height<15e4||(this.frustum.width=mXe(this)))};var Yee=new H,ZCe=new Ee,IUt=new Ee,$Ce=new Gr,e1e=new Ut,gXe=new Mt;function MUt(o,f,m){let v=Ee.clone(o.transform,ZCe),y=tn.eastNorthUpToFixedFrame(f,o._projection.ellipsoid,IUt);o._setTransform(y),H.clone(H.ZERO,o.position),m.heading=m.heading-xe.PI_OVER_TWO;let x=Gr.fromHeadingPitchRoll(m,$Ce),C=Ut.fromQuaternion(x,e1e);Ut.getColumn(C,0,o.direction),Ut.getColumn(C,2,o.up),H.cross(o.direction,o.up,o.right),o._setTransform(v),o._adjustOrthographicFrustum(!0)}function DUt(o,f,m,v){let y=Ee.clone(o.transform,ZCe);if(o._setTransform(Ee.IDENTITY),!H.equals(f,o.positionWC)){if(v){let w=o._projection,A=w.ellipsoid.cartesianToCartographic(f,gXe);f=w.project(A,Yee)}H.clone(f,o.position)}m.heading=m.heading-xe.PI_OVER_TWO;let x=Gr.fromHeadingPitchRoll(m,$Ce),C=Ut.fromQuaternion(x,e1e);Ut.getColumn(C,0,o.direction),Ut.getColumn(C,2,o.up),H.cross(o.direction,o.up,o.right),o._setTransform(y),o._adjustOrthographicFrustum(!0)}function LUt(o,f,m,v){let y=Ee.clone(o.transform,ZCe);if(o._setTransform(Ee.IDENTITY),!H.equals(f,o.positionWC)){if(v){let A=o._projection,E=A.ellipsoid.cartesianToCartographic(f,gXe);f=A.project(E,Yee)}Ye.clone(f,o.position);let x=-f.z*.5,C=-x,w=o.frustum;if(C>x){let A=w.top/w.right;w.right=C,w.left=x,w.top=w.right*A,w.bottom=-w.top}}if(o._scene.mapMode2D===$E.ROTATE){m.heading=m.heading-xe.PI_OVER_TWO,m.pitch=-xe.PI_OVER_TWO,m.roll=0;let x=Gr.fromHeadingPitchRoll(m,$Ce),C=Ut.fromQuaternion(x,e1e);Ut.getColumn(C,2,o.up),H.cross(o.direction,o.up,o.right)}o._setTransform(y)}var RUt=new H,OUt=new H,NUt=new H;function _Xe(o,f,m,v){let y=H.clone(m.direction,RUt),x=H.clone(m.up,OUt);if(o._scene.mode===_i.SCENE3D){let w=o._projection.ellipsoid,A=tn.eastNorthUpToFixedFrame(f,w,q7),E=Ee.inverseTransformation(A,X7);Ee.multiplyByPointAsVector(E,y,y),Ee.multiplyByPointAsVector(E,x,x)}let C=H.cross(y,x,NUt);return v.heading=QCe(y,x),v.pitch=fXe(y),v.roll=pXe(y,x,C),v}var Jme={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},IV=new dl;_a.prototype.setView=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.orientation,Z.EMPTY_OBJECT),m=this._mode;if(m===_i.MORPHING)return;N(o.endTransform)&&this._setTransform(o.endTransform);let v=Z(o.convert,!0),y=Z(o.destination,H.clone(this.positionWC,Yee));N(y)&&N(y.west)&&(y=this.getRectangleCameraCoordinates(y,Yee),v=!1),N(f.direction)&&(f=_Xe(this,y,f,Jme.orientation)),IV.heading=Z(f.heading,0),IV.pitch=Z(f.pitch,-xe.PI_OVER_TWO),IV.roll=Z(f.roll,0),m===_i.SCENE3D?MUt(this,y,IV):m===_i.SCENE2D?LUt(this,y,IV,v):DUt(this,y,IV,v)};var FUt=new H;_a.prototype.flyHome=function(o){let f=this._mode;if(f===_i.MORPHING&&this._scene.completeMorph(),f===_i.SCENE2D)this.flyTo({destination:_a.DEFAULT_VIEW_RECTANGLE,duration:o,endTransform:Ee.IDENTITY});else if(f===_i.SCENE3D){let m=this.getRectangleCameraCoordinates(_a.DEFAULT_VIEW_RECTANGLE),v=H.magnitude(m);v+=v*_a.DEFAULT_VIEW_FACTOR,H.normalize(m,m),H.multiplyByScalar(m,v,m),this.flyTo({destination:m,duration:o,endTransform:Ee.IDENTITY})}else if(f===_i.COLUMBUS_VIEW){let m=this._projection.ellipsoid.maximumRadius,v=new H(0,-1,1);v=H.multiplyByScalar(H.normalize(v,v),5*m,v),this.flyTo({destination:v,duration:o,orientation:{heading:0,pitch:-Math.acos(H.normalize(v,FUt).z),roll:0},endTransform:Ee.IDENTITY,convert:!1})}};_a.prototype.worldToCameraCoordinates=function(o,f){return N(f)||(f=new Wt),yv(this),Ee.multiplyByVector(this._actualInvTransform,o,f)};_a.prototype.worldToCameraCoordinatesPoint=function(o,f){return N(f)||(f=new H),yv(this),Ee.multiplyByPoint(this._actualInvTransform,o,f)};_a.prototype.worldToCameraCoordinatesVector=function(o,f){return N(f)||(f=new H),yv(this),Ee.multiplyByPointAsVector(this._actualInvTransform,o,f)};_a.prototype.cameraToWorldCoordinates=function(o,f){return N(f)||(f=new Wt),yv(this),Ee.multiplyByVector(this._actualTransform,o,f)};_a.prototype.cameraToWorldCoordinatesPoint=function(o,f){return N(f)||(f=new H),yv(this),Ee.multiplyByPoint(this._actualTransform,o,f)};_a.prototype.cameraToWorldCoordinatesVector=function(o,f){return N(f)||(f=new H),yv(this),Ee.multiplyByPointAsVector(this._actualTransform,o,f)};function vXe(o,f){let m=o._scene.mapMode2D===$E.ROTATE,v=o._maxCoord.x,y=o._maxCoord.y,x,C;m?(C=v,x=-C):(C=f.x-v*2,x=f.x+v*2),f.x>v&&(f.x=C),f.x<-v&&(f.x=x),f.y>y&&(f.y=y),f.y<-y&&(f.y=-y)}var Tde=new H;_a.prototype.move=function(o,f){let m=this.position;H.multiplyByScalar(o,f,Tde);let v=this._scene.screenSpaceCameraController.defaultCollisionRayWidth,y=new H;H.clone(m,y),H.add(y,Tde,y),!this.modelColliDetection(y,void 0,v)&&(this.groundRoaming(y)||H.add(m,Tde,m),this._mode===_i.SCENE2D&&vXe(this,m),this._adjustOrthographicFrustum(!0))};_a.prototype.moveForward=function(o){o=Z(o,this.defaultMoveAmount),this._mode===_i.SCENE2D?Bre(this,o):this.move(this.direction,o)};_a.prototype.moveBackward=function(o){o=Z(o,this.defaultMoveAmount),this._mode===_i.SCENE2D?Bre(this,-o):this.move(this.direction,-o)};_a.prototype.moveUp=function(o){o=Z(o,this.defaultMoveAmount),this.move(this.up,o)};_a.prototype.moveDown=function(o){o=Z(o,this.defaultMoveAmount),this.move(this.up,-o)};_a.prototype.moveRight=function(o){o=Z(o,this.defaultMoveAmount),this.move(this.right,o)};_a.prototype.moveLeft=function(o){o=Z(o,this.defaultMoveAmount),this.move(this.right,-o)};_a.prototype.lookLeft=function(o){o=Z(o,this.defaultLookAmount),this._mode!==_i.SCENE2D&&this.look(this.up,-o)};_a.prototype.lookRight=function(o){o=Z(o,this.defaultLookAmount),this._mode!==_i.SCENE2D&&this.look(this.up,o)};_a.prototype.lookUp=function(o){o=Z(o,this.defaultLookAmount),this._mode!==_i.SCENE2D&&this.look(this.right,-o)};_a.prototype.lookDown=function(o){o=Z(o,this.defaultLookAmount),this._mode!==_i.SCENE2D&&this.look(this.right,o)};var BUt=new Gr,kUt=new Ut;_a.prototype.look=function(o,f){let m=Z(f,this.defaultLookAmount),v=Gr.fromAxisAngle(o,-m,BUt),y=Ut.fromQuaternion(v,kUt),x=this.direction,C=this.up,w=this.right;Ut.multiplyByVector(y,x,x),Ut.multiplyByVector(y,C,C),Ut.multiplyByVector(y,w,w)};_a.prototype.twistLeft=function(o){o=Z(o,this.defaultLookAmount),this.look(this.direction,o)};_a.prototype.twistRight=function(o){o=Z(o,this.defaultLookAmount),this.look(this.direction,-o)};var VUt=new Gr,zUt=new Ut;_a.prototype.rotate=function(o,f){let m=Z(f,this.defaultRotateAmount),v=Gr.fromAxisAngle(o,-m,VUt),y=Ut.fromQuaternion(v,zUt);Ut.multiplyByVector(y,this.position,this.position),Ut.multiplyByVector(y,this.direction,this.direction),Ut.multiplyByVector(y,this.up,this.up),H.cross(this.direction,this.up,this.right),H.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};_a.prototype.rotateDown=function(o){o=Z(o,this.defaultRotateAmount),yXe(this,o)};_a.prototype.rotateUp=function(o){o=Z(o,this.defaultRotateAmount),yXe(this,-o)};var HUt=new H,UUt=new H,GUt=new H,H4e=new H;function yXe(o,f){let m=o.position;if(N(o.constrainedAxis)&&!H.equalsEpsilon(o.position,H.ZERO,xe.EPSILON2)){let v=H.normalize(m,HUt),y=H.equalsEpsilon(v,o.constrainedAxis,xe.EPSILON2),x=H.equalsEpsilon(v,H.negate(o.constrainedAxis,H4e),xe.EPSILON2);if(!y&&!x){let C=H.normalize(o.constrainedAxis,UUt),w=H.dot(v,C),A=xe.acosClamped(w);f>0&&f>A&&(f=A-xe.EPSILON4),w=H.dot(v,H.negate(C,H4e)),A=xe.acosClamped(w),f<0&&-f>A&&(f=-A+xe.EPSILON4);let E=H.cross(C,v,GUt);o.rotate(E,f)}else(y&&f<0||x&&f>0)&&o.rotate(o.right,f)}else o.rotate(o.right,f)}_a.prototype.rotateRight=function(o){o=Z(o,this.defaultRotateAmount),xXe(this,-o)};_a.prototype.rotateLeft=function(o){o=Z(o,this.defaultRotateAmount),xXe(this,o)};function xXe(o,f){N(o.constrainedAxis)?o.rotate(o.constrainedAxis,f):o.rotate(o.up,f)}function Bre(o,f){let m=o.frustum,v;if(f=f*.5,Math.abs(m.top)+Math.abs(m.bottom)>Math.abs(m.left)+Math.abs(m.right)){let y=m.top-f,x=m.bottom+f,C=o._maxCoord.y;o._scene.mapMode2D===$E.ROTATE&&(C*=o.maximumZoomFactor),x>C&&(x=C,y=-C),y<=x&&(y=1,x=-1),v=m.right/m.top,m.top=y,m.bottom=x,m.right=m.top*v,m.left=-m.right}else{let y=m.right-f,x=m.left+f,C=o._maxCoord.x;o._scene.mapMode2D===$E.ROTATE&&(C*=o.maximumZoomFactor),y>C&&(y=C,x=-C),y<=x&&(y=1,x=-1),v=m.top/m.right,m.right=y,m.left=x,m.top=m.right*v,m.bottom=-m.top}}function CXe(o,f){o.move(o.direction,f)}_a.prototype.zoomIn=function(o){o=Z(o,this.defaultZoomAmount),this._mode===_i.SCENE2D?Bre(this,o):CXe(this,o)};_a.prototype.zoomOut=function(o){o=Z(o,this.defaultZoomAmount),this._mode===_i.SCENE2D?Bre(this,-o):CXe(this,-o)};_a.prototype.getMagnitude=function(){if(this._mode===_i.SCENE3D)return H.magnitude(this.position);if(this._mode===_i.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===_i.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var WUt=new Ee;_a.prototype.lookAt=function(o,f){let m=tn.eastNorthUpToFixedFrame(o,ki.WGS84,WUt);this.lookAtTransform(m,f)};var jUt=new H,YUt=new Gr,qUt=new Gr,XUt=new Ut;function bXe(o,f,m){f=xe.clamp(f,-xe.PI_OVER_TWO,xe.PI_OVER_TWO),o=xe.zeroToTwoPi(o)-xe.PI_OVER_TWO;let v=Gr.fromAxisAngle(H.UNIT_Y,-f,YUt),y=Gr.fromAxisAngle(H.UNIT_Z,-o,qUt),x=Gr.multiply(y,v,y),C=Ut.fromQuaternion(x,XUt),w=H.clone(H.UNIT_X,jUt);return Ut.multiplyByVector(C,w,w),H.negate(w,w),H.multiplyByScalar(w,m,w),w}_a.prototype.lookAtTransform=function(o,f){if(this._setTransform(o),!N(f))return;let m;if(N(f.heading)?m=bXe(f.heading,f.pitch,f.range):m=f,this._mode===_i.SCENE2D){Ye.clone(Ye.ZERO,this.position),H.negate(m,this.up),this.up.z=0,H.magnitudeSquared(this.up)A&&(A+=xe.TWO_PI);let T=(E+A)*.5,S;if(w<-xe.PI_OVER_TWO+xe.RADIANS_PER_DEGREE&&C>xe.PI_OVER_TWO-xe.RADIANS_PER_DEGREE)S=0;else{let J=D9;J.longitude=T,J.latitude=C,J.height=0;let X=JUt;X.longitude=T,X.latitude=w,X.height=0;let Y=U4e;(!N(Y)||Y.ellipsoid!==y)&&(U4e=Y=new Im(void 0,void 0,y)),Y.setEndPoints(J,X),S=Y.interpolateUsingFraction(.5,D9).latitude}let M=D9;M.longitude=T,M.latitude=S,M.height=0;let I=y.cartographicToCartesian(M,i6t),P=D9;P.longitude=A,P.latitude=C;let D=y.cartographicToCartesian(P,KUt);P.longitude=E;let L=y.cartographicToCartesian(P,ZUt);P.longitude=T;let R=y.cartographicToCartesian(P,e6t);P.latitude=w;let O=y.cartographicToCartesian(P,t6t);P.longitude=A;let F=y.cartographicToCartesian(P,$Ut);P.longitude=E;let k=y.cartographicToCartesian(P,QUt);H.subtract(L,I,L),H.subtract(F,I,F),H.subtract(D,I,D),H.subtract(k,I,k),H.subtract(R,I,R),H.subtract(O,I,O);let U=y.geodeticSurfaceNormal(I,x.direction);H.negate(U,U);let G=H.cross(U,H.UNIT_Z,x.right);H.normalize(G,G);let j=H.cross(G,U,x.up),q;if(o.frustum instanceof Gs){let J=Math.max(H.distance(D,L),H.distance(F,k)),X=Math.max(H.distance(D,F),H.distance(L,k)),Y,Q,ee=o.frustum._offCenterFrustum,z=ee.right/ee.top,ie=X*z;J>ie?(Y=J,Q=Y/z):(Q=X,Y=ie),q=Math.max(Y,Q)}else{let J=Math.tan(o.frustum.fovy*.5),X=o.frustum.aspectRatio*J;if(q=Math.max(fv(U,j,L,J),fv(U,j,F,J),fv(U,j,D,J),fv(U,j,k,J),fv(U,j,R,J),fv(U,j,O,J),fv(U,G,L,X),fv(U,G,F,X),fv(U,G,D,X),fv(U,G,k,X),fv(U,G,R,X),fv(U,G,O,X)),w<0&&C>0){let Y=D9;Y.longitude=E,Y.latitude=0,Y.height=0;let Q=y.cartographicToCartesian(Y,Sde);H.subtract(Q,I,Q),q=Math.max(q,fv(U,j,Q,J),fv(U,G,Q,X)),Y.longitude=A,Q=y.cartographicToCartesian(Y,Sde),H.subtract(Q,I,Q),q=Math.max(q,fv(U,j,Q,J),fv(U,G,Q,X))}}return H.add(I,H.multiplyByScalar(U,-q,Sde),m)}var n6t=new Mt,o6t=new H,a6t=new H;function s6t(o,f,m){let v=o._projection;f.west>f.east&&(f=Di.MAX_VALUE);let y=o._actualTransform,x=o._actualInvTransform,C=n6t;C.longitude=f.east,C.latitude=f.north;let w=v.project(C,o6t);Ee.multiplyByPoint(y,w,w),Ee.multiplyByPoint(x,w,w),C.longitude=f.west,C.latitude=f.south;let A=v.project(C,a6t);if(Ee.multiplyByPoint(y,A,A),Ee.multiplyByPoint(x,A,A),m.x=(w.x-A.x)*.5+A.x,m.y=(w.y-A.y)*.5+A.y,N(o.frustum.fovy)){let E=Math.tan(o.frustum.fovy*.5),T=o.frustum.aspectRatio*E;m.z=Math.max((w.x-A.x)/T,(w.y-A.y)/E)*.5}else{let E=w.x-A.x,T=w.y-A.y;m.z=Math.max(E,T)}return m}var l6t=new Mt,u6t=new H,c6t=new H;function h6t(o,f,m){let v=o._projection,y=f.east;f.west>f.east&&(o._scene.mapMode2D===$E.INFINITE_SCROLL?y+=xe.TWO_PI:(f=Di.MAX_VALUE,y=f.east));let x=l6t;x.longitude=y,x.latitude=f.north;let C=v.project(x,u6t);x.longitude=f.west,x.latitude=f.south;let w=v.project(x,c6t),A=Math.abs(C.x-w.x)*.5,E=Math.abs(C.y-w.y)*.5,T,S,M=o.frustum.right/o.frustum.top,I=E*M;return A>I?(T=A,S=T/M):(S=E,T=I),E=Math.max(2*T,2*S),m.x=(C.x-w.x)*.5+w.x,m.y=(C.y-w.y)*.5+w.y,x=v.unproject(m,x),x.height=E,m=v.project(x,m),m}_a.prototype.getRectangleCameraCoordinates=function(o,f){let m=this._mode;if(N(f)||(f=new H),m===_i.SCENE3D)return wXe(this,o,f);if(m===_i.COLUMBUS_VIEW)return s6t(this,o,f);if(m===_i.SCENE2D)return h6t(this,o,f)};var d6t=new _s;function f6t(o,f,m,v){m=Z(m,ki.WGS84);let y=o.getPickRay(f,d6t),x=Hh.rayEllipsoid(y,m);if(!x)return;let C=x.start>0?x.start:x.stop;return _s.getPoint(y,C,v)}var p6t=new _s;function m6t(o,f,m,v){let y=o.getPickRay(f,p6t).origin;y=H.fromElements(y.y,y.z,0,y);let x=m.unproject(y);if(!(x.latitude<-xe.PI_OVER_TWO||x.latitude>xe.PI_OVER_TWO))return m.ellipsoid.cartographicToCartesian(x,v)}var g6t=new _s;function _6t(o,f,m,v){let y=o.getPickRay(f,g6t),x=-y.origin.x/y.direction.x;_s.getPoint(y,x,v);let C=m.unproject(new H(v.y,v.z,0));if(!(C.latitude<-xe.PI_OVER_TWO||C.latitude>xe.PI_OVER_TWO||C.longitude<-Math.PI||C.longitude>Math.PI))return m.ellipsoid.cartographicToCartesian(C,v)}_a.prototype.pickEllipsoid=function(o,f,m){let v=this._scene.canvas;if(!(v.clientWidth===0||v.clientHeight===0)){if(N(m)||(m=new H),f=Z(f,ki.WGS84),this._mode===_i.SCENE3D)m=f6t(this,o,f,m);else if(this._mode===_i.SCENE2D)m=m6t(this,o,this._projection,m);else if(this._mode===_i.COLUMBUS_VIEW)m=_6t(this,o,this._projection,m);else return;return m}};var v6t=new H,y6t=new H,x6t=new H;function C6t(o,f,m){let v=o._scene.canvas,y=v.clientWidth,x=v.clientHeight,C=Math.tan(o.frustum.fovy*.5),w=o.frustum.aspectRatio*C,A=o.frustum.near,E=2/y*f.x-1,T=2/x*(x-f.y)-1,S=o.positionWC;H.clone(S,m.origin);let M=H.multiplyByScalar(o.directionWC,A,v6t);H.add(S,M,M);let I=H.multiplyByScalar(o.rightWC,E*A*w,y6t),P=H.multiplyByScalar(o.upWC,T*A*C,x6t),D=H.add(M,I,m.direction);return H.add(D,P,D),H.subtract(D,S,D),H.normalize(D,D),m}var UQ=new H;function b6t(o,f,m){let v=o._scene.canvas,y=v.clientWidth,x=v.clientHeight,C=o.frustum,w=C.offCenterFrustum;N(w)&&(C=w);let A=2/y*f.x-1;A*=(C.right-C.left)*.5;let E=2/x*(x-f.y)-1;E*=(C.top-C.bottom)*.5;let T=m.origin;return H.clone(o.position,T),H.multiplyByScalar(o.right,A,UQ),H.add(UQ,T,T),H.multiplyByScalar(o.up,E,UQ),H.add(UQ,T,T),H.clone(o.directionWC,m.direction),(o._mode===_i.COLUMBUS_VIEW||o._mode===_i.SCENE2D)&&H.fromElements(m.origin.z,m.origin.x,m.origin.y,m.origin),m}_a.prototype.getPickRay=function(o,f){N(f)||(f=new _s);let m=this._scene.canvas;if(m.clientWidth<=0||m.clientHeight<=0)return;let v=this.frustum;return N(v.aspectRatio)&&N(v.fov)&&N(v.near)?C6t(this,o,f):b6t(this,o,f)};var w6t=new H,A6t=new H;_a.prototype.distanceToBoundingSphere=function(o){let f=H.subtract(this.positionWC,o.center,w6t),m=H.multiplyByScalar(this.directionWC,H.dot(f,this.directionWC),A6t);return Math.max(0,H.magnitude(m)-o.radius)};var E6t=new Ye;_a.prototype.getPixelSize=function(o,f,m){let v=this.distanceToBoundingSphere(o),y=this.frustum.getPixelDimensions(f,m,v,this._scene.pixelRatio,E6t);return Math.max(y.x,y.y)};function T6t(o,f,m,v,y,x){let C=H.clone(f);m.y>v?C.y-=m.y-v:m.y<-v&&(C.y+=-v-m.y),m.z>y?C.z-=m.z-y:m.z<-y&&(C.z+=-y-m.z);function w(A){let E=H.lerp(f,C,A.time,new H);o.worldToCameraCoordinatesPoint(E,o.position)}return{easingFunction:Bv.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:x,update:w}}var S6t=new H,G4e=new H,P6t=new H,I6t=new H;function M6t(o,f){let m=o.position,v=o.direction,y=o.worldToCameraCoordinatesVector(H.UNIT_X,S6t),x=-H.dot(y,m)/H.dot(y,v),C=H.add(m,H.multiplyByScalar(v,x,G4e),G4e);o.cameraToWorldCoordinatesPoint(C,C),m=o.cameraToWorldCoordinatesPoint(o.position,P6t);let w=Math.tan(o.frustum.fovy*.5),A=o.frustum.aspectRatio*w,E=H.magnitude(H.subtract(m,C,I6t)),T=A*E,S=w*E,M=o._maxCoord.x,I=o._maxCoord.y,P=Math.max(T-M,M),D=Math.max(S-I,I);if(m.z<-P||m.z>P||m.y<-D||m.y>D){let L=C.y<-P||C.y>P,R=C.z<-D||C.z>D;if(L||R)return T6t(o,m,C,P,D,f)}}_a.prototype.createCorrectPositionTween=function(o){if(this._mode===_i.COLUMBUS_VIEW)return M6t(this,o)};var D6t=new H,kg={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};_a.prototype.cancelFlight=function(){N(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};_a.prototype.completeFlight=function(){if(N(this._currentFlight)){this._currentFlight.cancelTween();let o={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};o.destination=kg.destination,o.orientation.heading=kg.heading,o.orientation.pitch=kg.pitch,o.orientation.roll=kg.roll,this.setView(o),N(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};_a.prototype.flyTo=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.destination;if(this._mode===_i.MORPHING)return;this.cancelFlight();let m=f instanceof Di;m&&(f=this.getRectangleCameraCoordinates(f,D6t));let v=Z(o.orientation,Z.EMPTY_OBJECT);if(N(v.direction)&&(v=_Xe(this,f,v,Jme.orientation)),N(o.duration)&&o.duration<=0){let E=Jme;E.destination=o.destination,E.orientation.heading=v.heading,E.orientation.pitch=v.pitch,E.orientation.roll=v.roll,E.convert=o.convert,E.endTransform=o.endTransform,this.setView(E),typeof o.complete=="function"&&o.complete();return}let y=this,x;kg.destination=f,kg.heading=v.heading,kg.pitch=v.pitch,kg.roll=v.roll,kg.duration=o.duration,kg.complete=function(){x===y._currentFlight&&(y._currentFlight=void 0),N(o.complete)&&o.complete()},kg.cancel=o.cancel,kg.endTransform=o.endTransform,kg.convert=m?!1:o.convert,kg.maximumHeight=o.maximumHeight,kg.pitchAdjustHeight=o.pitchAdjustHeight,kg.flyOverLongitude=o.flyOverLongitude,kg.flyOverLongitudeWeight=o.flyOverLongitudeWeight,kg.easingFunction=o.easingFunction;let C=this._scene,w=KCe.createTween(C,kg);if(w.duration===0){typeof w.complete=="function"&&w.complete();return}x=C.tweens.add(w),this._currentFlight=x;let A=this._scene.preloadFlightCamera;this._mode!==_i.SCENE2D&&(N(A)||(A=_a.clone(this)),A.setView({destination:f,orientation:v}),this._scene.preloadFlightCullingVolume=A.frustum.computeCullingVolume(A.positionWC,A.directionWC,A.upWC))};function L6t(o,f){let m=o.frustum,v=Math.tan(m.fovy*.5),y=m.aspectRatio*v;return Math.max(f/y,f/v)}function R6t(o,f){let m=o.frustum,v=m.offCenterFrustum;N(v)&&(m=v);let y,x,C=m.right/m.top,w=f*C;return f>w?(y=f,x=y/C):(x=f,y=w),Math.max(y,x)*1.5}var O6t=100;function AXe(o,f,m){m=gC.clone(N(m)?m:_a.DEFAULT_OFFSET);let v=o._scene.screenSpaceCameraController.minimumZoomDistance,y=o._scene.screenSpaceCameraController.maximumZoomDistance,x=m.range;if(!N(x)||x===0){let C=f.radius;C===0?m.range=O6t:o.frustum instanceof Gs||o._mode===_i.SCENE2D?m.range=R6t(o,C):m.range=L6t(o,C),m.range=xe.clamp(m.range,v,y)}return m}_a.prototype.viewBoundingSphere=function(o,f){f=AXe(this,o,f),this.lookAt(o.center,f)};var N6t=new Ee,F6t=new H,B6t=new H,k6t=new H,V6t=new H,z6t=new Wt,H6t=new Gr,U6t=new Ut;_a.prototype.flyToBoundingSphere=function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=this._mode===_i.SCENE2D||this._mode===_i.COLUMBUS_VIEW;this._setTransform(Ee.IDENTITY);let v=AXe(this,o,f.offset),y;m?y=H.multiplyByScalar(H.UNIT_Z,v.range,F6t):y=bXe(v.heading,v.pitch,v.range);let x=tn.eastNorthUpToFixedFrame(o.center,ki.WGS84,N6t);Ee.multiplyByPoint(x,y,y);let C,w;if(!m){if(C=H.subtract(o.center,y,B6t),H.normalize(C,C),w=Ee.multiplyByPointAsVector(x,H.UNIT_Z,k6t),1-Math.abs(H.dot(C,w))xe.PI?E+=xe.TWO_PI-I:E+=I,T=M}return xe.equalsEpsilon(Math.abs(E),xe.TWO_PI,xe.EPSILON9)&&(f.west=-xe.PI,f.east=xe.PI,BR[0].latitude>=0?f.north=xe.PI_OVER_TWO:f.south=-xe.PI_OVER_TWO),f};_a.prototype.switchToPerspectiveFrustum=function(){if(this._mode===_i.SCENE2D||this.frustum instanceof pc)return;let o=this._scene;this.frustum=new pc,this.frustum.aspectRatio=o.drawingBufferWidth/o.drawingBufferHeight,this.frustum.fov=xe.toRadians(60)};_a.prototype.switchToOrthographicFrustum=function(){if(this._mode===_i.SCENE2D||this.frustum instanceof Gs)return;let o=mXe(this),f=this._scene;this.frustum=new Gs,this.frustum.aspectRatio=f.drawingBufferWidth/f.drawingBufferHeight,this.frustum.width=o};_a.prototype.changeHeading=function(o){let f=H.normalize(H.subtract(o,this.position,new H),new H),m=this._projection.ellipsoid,v=Ee.clone(this._transform,q7),y=tn.eastNorthUpToFixedFrame(this.positionWC,m,X7);this._setTransform(y);let x=QCe(f,this.up);return this._setTransform(v),x};_a.prototype.groundRoaming=function(o){if(this._mode===_i.SCENE2D)return!1;let f=this._scene;if(!f.screenSpaceCameraController.enableGroundRoaming)return!1;let m=f.screenSpaceCameraController.defaultCollisionRayWidth,v=J7(o),y=Kme(f,o,v,void 0,m);if(N(y)){let x=f.screenSpaceCameraController.defaultGroundRoamingHeight*-1,C={destination:J7(y,x),orientation:{heading:this.heading,pitch:this.pitch,roll:0}};return this.setView(C),!0}return!1};_a.prototype.modelColliDetection=function(o,f,m){if(this._mode===_i.SCENE2D)return!1;let v=this._scene;if(!v.screenSpaceCameraController.enableModelCollisionDetection)return!1;let y,x=v.screenSpaceCameraController.defaultGroundRoamingHeight/2;{let C=J7(this.position);if(y=Kme(v,this.position,C,f,m),N(y)){let w=J7(y,-1*x),A=H.distance(this.position,w),E=J7(o,A),T=Kme(v,w,E,f,m);if(N(T)&&j6t(w,E,T))return!0}}return!1};function j6t(o,f,m){let v=H.distance(o,f),y=H.distance(o,m);return v+1.5>=y,!1}function J7(o,f){f=Z(f,1);let m=Mt.fromCartesian(o),v=Mt.clone(m);return v.height-=f,v.longitude=xe.toDegrees(v.longitude),v.latitude=xe.toDegrees(v.latitude),H.fromDegrees(v.longitude,v.latitude,v.height)}function Kme(o,f,m,v,y){let x=H.normalize(H.subtract(m,f,new H),new H),C=new _s(f,x),w=o.pickFromRay(C,v,y);return N(w)?w.position:void 0}_a.clone=function(o,f){return N(f)||(f=new _a(o._scene)),H.clone(o.position,f.position),H.clone(o.direction,f.direction),H.clone(o.up,f.up),H.clone(o.right,f.right),Ee.clone(o._transform,f.transform),f._transformChanged=!0,f.frustum=o.frustum.clone(),f};var Vl=_a,kre=0,Y6t=1;function N5(o){let f=o.frustum,m=o.orientation,v=o.origin,y=Z(o.vertexFormat,un.DEFAULT),x=Z(o._drawNearPlane,!0),C,w;f instanceof pc?(C=kre,w=pc.packedLength):f instanceof Gs&&(C=Y6t,w=Gs.packedLength),this._frustumType=C,this._frustum=f.clone(),this._origin=H.clone(v),this._orientation=Gr.clone(m),this._drawNearPlane=x,this._vertexFormat=y,this._workerName="createFrustumGeometry",this.packedLength=2+w+H.packedLength+Gr.packedLength+un.packedLength}N5.pack=function(o,f,m){m=Z(m,0);let v=o._frustumType,y=o._frustum;return f[m++]=v,v===kre?(pc.pack(y,f,m),m+=pc.packedLength):(Gs.pack(y,f,m),m+=Gs.packedLength),H.pack(o._origin,f,m),m+=H.packedLength,Gr.pack(o._orientation,f,m),m+=Gr.packedLength,un.pack(o._vertexFormat,f,m),m+=un.packedLength,f[m]=o._drawNearPlane?1:0,f};var q6t=new pc,X6t=new Gs,J6t=new Gr,K6t=new H,Q6t=new un;N5.unpack=function(o,f,m){f=Z(f,0);let v=o[f++],y;v===kre?(y=pc.unpack(o,f,q6t),f+=pc.packedLength):(y=Gs.unpack(o,f,X6t),f+=Gs.packedLength);let x=H.unpack(o,f,K6t);f+=H.packedLength;let C=Gr.unpack(o,f,J6t);f+=Gr.packedLength;let w=un.unpack(o,f,Q6t);f+=un.packedLength;let A=o[f]===1;if(!N(m))return new N5({frustum:y,origin:x,orientation:C,vertexFormat:w,_drawNearPlane:A});let E=v===m._frustumType?m._frustum:void 0;return m._frustum=y.clone(E),m._frustumType=v,m._origin=H.clone(x,m._origin),m._orientation=Gr.clone(C,m._orientation),m._vertexFormat=un.clone(w,m._vertexFormat),m._drawNearPlane=A,m};function MV(o,f,m,v,y,x,C,w){let A=o/3*2;for(let E=0;E<4;++E)N(f)&&(f[o]=x.x,f[o+1]=x.y,f[o+2]=x.z),N(m)&&(m[o]=C.x,m[o+1]=C.y,m[o+2]=C.z),N(v)&&(v[o]=w.x,v[o+1]=w.y,v[o+2]=w.z),o+=3;y[A]=0,y[A+1]=0,y[A+2]=1,y[A+3]=0,y[A+4]=1,y[A+5]=1,y[A+6]=0,y[A+7]=1}var Z6t=new Ut,$6t=new Ee,Mde=new Ee,EXe=new H,TXe=new H,SXe=new H,e8t=new H,t8t=new H,i8t=new H,rR=new Array(3),LY=new Array(4);LY[0]=new Wt(-1,-1,1,1);LY[1]=new Wt(1,-1,1,1);LY[2]=new Wt(1,1,1,1);LY[3]=new Wt(-1,1,1,1);var PXe=new Array(4);for(let o=0;o<4;++o)PXe[o]=new Wt;N5._computeNearFarPlanes=function(o,f,m,v,y,x,C,w){let A=Ut.fromQuaternion(f,Z6t),E=Z(x,EXe),T=Z(C,TXe),S=Z(w,SXe);E=Ut.getColumn(A,0,E),T=Ut.getColumn(A,1,T),S=Ut.getColumn(A,2,S),H.normalize(E,E),H.normalize(T,T),H.normalize(S,S),H.negate(E,E);let M=Ee.computeView(o,S,T,E,$6t),I,P,D=v.projectionMatrix;if(m===kre){let L=Ee.multiply(D,M,Mde);P=Ee.inverse(L,Mde)}else I=Ee.inverseTransformation(M,Mde);N(P)?(rR[0]=v.near,rR[1]=v.far):(rR[0]=0,rR[1]=v.near,rR[2]=v.far);for(let L=0;L<2;++L)for(let R=0;R<4;++R){let O=Wt.clone(LY[R],PXe[R]);if(N(P)){O=Ee.multiplyByVector(P,O,O);let F=1/O.w;H.multiplyByScalar(O,F,O),H.subtract(O,o,O),H.normalize(O,O);let k=H.dot(S,O);H.multiplyByScalar(O,rR[L]/k,O),H.add(O,o,O)}else{let F=v.offCenterFrustum;N(F)&&(v=F);let k=rR[L],U=rR[L+1];O.x=(O.x*(v.right-v.left)+v.left+v.right)*.5,O.y=(O.y*(v.top-v.bottom)+v.bottom+v.top)*.5,O.z=(O.z*(k-U)-k-U)*.5,O.w=1,Ee.multiplyByVector(I,O,O)}y[12*L+R*3]=O.x,y[12*L+R*3+1]=O.y,y[12*L+R*3+2]=O.z}};N5.createGeometry=function(o){let f=o._frustumType,m=o._frustum,v=o._origin,y=o._orientation,x=o._drawNearPlane,C=o._vertexFormat,w=x?6:5,A=new Float64Array(3*4*6);N5._computeNearFarPlanes(v,y,f,m,A);let E=3*4*2;A[E]=A[3*4],A[E+1]=A[3*4+1],A[E+2]=A[3*4+2],A[E+3]=A[0],A[E+4]=A[1],A[E+5]=A[2],A[E+6]=A[3*3],A[E+7]=A[3*3+1],A[E+8]=A[3*3+2],A[E+9]=A[3*7],A[E+10]=A[3*7+1],A[E+11]=A[3*7+2],E+=3*4,A[E]=A[3*5],A[E+1]=A[3*5+1],A[E+2]=A[3*5+2],A[E+3]=A[3],A[E+4]=A[3+1],A[E+5]=A[3+2],A[E+6]=A[0],A[E+7]=A[1],A[E+8]=A[2],A[E+9]=A[3*4],A[E+10]=A[3*4+1],A[E+11]=A[3*4+2],E+=3*4,A[E]=A[3],A[E+1]=A[3+1],A[E+2]=A[3+2],A[E+3]=A[3*5],A[E+4]=A[3*5+1],A[E+5]=A[3*5+2],A[E+6]=A[3*6],A[E+7]=A[3*6+1],A[E+8]=A[3*6+2],A[E+9]=A[3*2],A[E+10]=A[3*2+1],A[E+11]=A[3*2+2],E+=3*4,A[E]=A[3*2],A[E+1]=A[3*2+1],A[E+2]=A[3*2+2],A[E+3]=A[3*6],A[E+4]=A[3*6+1],A[E+5]=A[3*6+2],A[E+6]=A[3*7],A[E+7]=A[3*7+1],A[E+8]=A[3*7+2],A[E+9]=A[3*3],A[E+10]=A[3*3+1],A[E+11]=A[3*3+2],x||(A=A.subarray(3*4));let T=new Oc({position:new en({componentDatatype:Rt.DOUBLE,componentsPerAttribute:3,values:A})});if(N(C.normal)||N(C.tangent)||N(C.bitangent)||N(C.st)){let M=N(C.normal)?new Float32Array(12*w):void 0,I=N(C.tangent)?new Float32Array(3*4*w):void 0,P=N(C.bitangent)?new Float32Array(3*4*w):void 0,D=N(C.st)?new Float32Array(2*4*w):void 0,L=EXe,R=TXe,O=SXe,F=H.negate(L,e8t),k=H.negate(R,t8t),U=H.negate(O,i8t);E=0,x&&(MV(E,M,I,P,D,U,L,R),E+=3*4),MV(E,M,I,P,D,O,F,R),E+=3*4,MV(E,M,I,P,D,F,U,R),E+=3*4,MV(E,M,I,P,D,k,U,F),E+=3*4,MV(E,M,I,P,D,L,O,R),E+=3*4,MV(E,M,I,P,D,R,O,F),N(M)&&(T.normal=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:M})),N(I)&&(T.tangent=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:I})),N(P)&&(T.bitangent=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:P})),N(D)&&(T.st=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:D}))}let S=new Uint16Array(6*w);for(let M=0;M1,E=o.debugCascadeColors,T=o.softShadows;return`receiveFisheyeProjection ${y}${x}${C}${w}${A}${E}${T}${f}${m}${v}`};zre.createReceiveVertexShader=function(o,f,m){let v=o.defines.slice(0),y=o.sources.slice(0);return f&&(m?v.push("GENERATE_POSITION_AND_NORMAL"):v.push("GENERATE_POSITION")),new Zr({defines:v,sources:y})};zre.createReceiveFragmentShader=function(o,f,m,v,y){let x=Zr.findNormalVarying(o),C=!v&&N(x)||v&&y,w=Zr.findPositionVarying(o),A=N(w),E=f._isPointLight?f._pointBias:v?f._terrainBias:f._primitiveBias,T=o.defines.slice(0),S=o.sources.slice(0),M=S.length;for(let D=0;D radius) { continue; } vec3 directionWC = czm_inverseViewRotation * directionEC; vec4 directionLight = shadowMap_matrixArr[i] * vec4(directionEC,0.0); vec3 shadowPosition = normalize(directionLight.xyz); shadowPosition = vec3( shadowPosition.xy, 0.0) * 0.5 + vec3(0.5,0.5, 0.0); if(i == 0){ out_FragColor *= texture(shadowMap_projectionTextureArr[0], shadowPosition.xy); }else if(i == 1){ out_FragColor *= texture(shadowMap_projectionTextureArr[1], shadowPosition.xy); }else if(i == 2){ out_FragColor *= texture(shadowMap_projectionTextureArr[2], shadowPosition.xy); }else { out_FragColor *= texture(shadowMap_projectionTextureArr[3], shadowPosition.xy); } }else{ break; } } } `,S.push(I),new Zr({defines:T,sources:S})};var K7=zre;function qM(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.context;this._enabled=Z(o.enabled,!0),this._softShadows=Z(o.softShadows,!1),this._normalOffset=Z(o.normalOffset,!0),this.dirty=!0,this._name=o.name||"",this._matchMaterials=o.matchMaterials||[],this._type="fisheye",this.fromLightSource=Z(o.fromLightSource,!0),this.darkness=Z(o.darkness,0),this._darkness=this.darkness,this.maximumDistance=Z(o.maximumDistance,2e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let m=!0;(pa.isInternetExplorer()||pa.isEdge()||(pa.isChrome()||pa.isFirefox())&&pa.isWindows()&&!f.depthTexture)&&(m=!1),this._polygonOffsetSupported=m,this._terrainBias={polygonOffset:m,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:m,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:o.depthBias||2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Ee,this._shadowMapTexture=void 0,this._shadowMapProjectionTexture=void 0,this._castImage=void 0,this._lightDirectionEC=new H,this._lightPositionEC=new Wt,this._distance=0,this._lightCamera=o.lightCamera,this._shadowMapCamera=new Hre,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new Pi,this._isPointLight=Z(o.isPointLight,!1),this._pointLightRadius=Z(o.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:Z(o.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?Z(o.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Ye,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pm:N(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Wt,new Wt],this._cascadeMatrices=[new Ee,new Ee,new Ee,new Ee],this._cascadeDistances=new Wt;let v;this._isPointLight?v=6:this._cascadesEnabled?v=this._numberOfCascades:v=1,this._passes=new Array(v);for(let y=0;y=f?f:Bo.maximumCubeMapSize,y.x=f,y.y=f;let x=new Xr(0,0,f,f);m[0].passState.viewport=x,m[1].passState.viewport=x,m[2].passState.viewport=x,m[3].passState.viewport=x,m[4].passState.viewport=x,m[5].passState.viewport=x}else v===1?(f=Bo.maximumTextureSize>=f?f:Bo.maximumTextureSize,y.x=f,y.y=f,m[0].passState.viewport=new Xr(0,0,f,f)):v===4&&(f=Bo.maximumTextureSize>=f*2?f:Bo.maximumTextureSize/2,y.x=f*2,y.y=f*2,m[0].passState.viewport=new Xr(0,0,f,f),m[1].passState.viewport=new Xr(f,0,f,f),m[2].passState.viewport=new Xr(0,f,f,f),m[3].passState.viewport=new Xr(f,f,f,f));o._clearPassState.viewport=new Xr(0,0,y.x,y.y);for(let x=0;x=o.maximumDistance){o._outOfView=!0,o._needsUpdate=!1;return}let x=f.mapProjection.ellipsoid.geodeticSurfaceNormal(m.positionWC,H8t),C=H.negate(v.directionWC,U8t),w=H.dot(x,C);if(o._darkness=0,w<0){o._outOfView=!0,o._needsUpdate=!1;return}o._needsUpdate=!0,o._outOfView=!1}else if(o._isPointLight){if(y.center=v.positionWC,y.radius=o._pointLightRadius,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,!o._outOfView){let x=H.distance(v.positionWC,m.positionWC);o._outOfView=x>=o.maximumDistance}o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere)}else{let x=v.frustum.far/2,C=H.add(v.positionWC,H.multiplyByScalar(v.directionWC,x,X4e),X4e);if(y.center=C,y.radius=x,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,!o._outOfView){let w=H.distance(v.positionWC,m.positionWC);o._outOfView=w>=o.maximumDistance}o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere)}}function W8t(o,f){let m=f.camera,v=o._lightCamera,y=o._sceneCamera,x=o._shadowMapCamera;o._cascadesEnabled?H.clone(v.directionWC,x.directionWC):o._isPointLight?H.clone(v.positionWC,x.positionWC):x.clone(v);let C=o._lightDirectionEC;Ee.multiplyByPointAsVector(m.viewMatrix,x.directionWC,C),H.normalize(C,C),H.negate(C,C),Ee.multiplyByPoint(m.viewMatrix,x.positionWC,o._lightPositionEC),o._lightPositionEC.w=o._pointLightRadius,Ee.multiply(v.viewMatrix,m.inverseViewMatrix,o._shadowMapMatrix);let w,A;o._fitNearFar?(w=Math.min(f.shadowState.nearPlane,o.maximumDistance),A=Math.min(f.shadowState.farPlane,o.maximumDistance+1)):(w=m.frustum.near,A=o.maximumDistance),o._sceneCamera=Vl.clone(m,y),m.frustum.clone(o._sceneCamera.frustum),o._sceneCamera.frustum.near=w,o._sceneCamera.frustum.far=A,o._distance=A-w,G8t(o,f),!o._outOfViewPrevious&&o._outOfView&&(o._needsUpdate=!0),o._outOfViewPrevious=o._outOfView}function j8t(o,f){if(o._isCastTextureDirty===!1||!N(o._castImage))return;let m=f.context,v=o._shadowMapProjectionTexture,y=o._castImage;if(y instanceof HTMLVideoElement)if(y.readyState>=2){if(N(v)){let x=new Date().getTime();v._lastCreateTextureTime===void 0&&(v._lastCreateTextureTime=0);let C=v._lastCreateTextureTime;if(x-C1&&L8t(this,o)),this._isPointLight)this._shadowMapCullingVolume=hg.fromBoundingSphere(this._boundingSphere);else{let f=this._shadowMapCamera,m=f.positionWC,v=f.directionWC,y=f.upWC;this._shadowMapCullingVolume=f.frustum.computeCullingVolume(m,v,y),this._passes.length===1&&this._passes[0].camera.clone(f)}this.debugShow&&S8t(this,o)};qM.prototype.updatePass=function(o,f){y8t(this,o,f)};var Y8t=new Ye;function q8t(o,f,m,v){let y=o._isPointLight?o._pointBias:m?o._terrainBias:o._primitiveBias,x={shadowMap_texture:function(){return o._shadowMapTexture},shadowMap_projectionTexture:function(){return o._shadowMapProjectionTexture},shadowMap_textureCube:function(){return o._shadowMapTexture},shadowMap_matrix:function(){return o._shadowMapMatrix},shadowMap_cascadeSplits:function(){return o._cascadeSplits},shadowMap_cascadeMatrices:function(){return o._cascadeMatrices},shadowMap_lightDirectionEC:function(){return o._lightDirectionEC},shadowMap_lightPositionEC:function(){return o._lightPositionEC},shadowMap_cascadeDistances:function(){return o._cascadeDistances},shadowMap_projectionTextureArr:function(){let C=[];for(let w=0;w<4;w++)C[w]=v._shadowMapProjectionTextureArr[w]._shadowMapProjectionTexture;return C},shadowMap_lightPositionECArr:function(){return v._lightPositionECArr},shadowMap_lightDirectionECArr:function(){return v._lightDirectionECArr},shadowMapCount:function(){return Wt.fromElements(v._shadowMapCount,0,0,0)},shadowMap_matrixArr:function(){return v._shadowMapMatrixArr},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let C=Y8t;return C.x=1/o._textureSize.x,C.y=1/o._textureSize.y,Wt.fromElements(C.x,C.y,y.depthBias,y.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Wt.fromElements(y.normalOffsetScale,o._distance,o.maximumDistance,o._darkness,this.combinedUniforms2)},combinedUniforms1:new Wt,combinedUniforms2:new Wt};return va(f,x,!1)}var X8t=function(){this._shadowMapProjectionTextureArr=new Array(4),this._shadowMapMatrixArr=new Array(4),this._lightPositionECArr=new Array(4),this._lightDirectionECArr=new Array(4);for(let o=0;o<4;o++)this._shadowMapMatrixArr[o]=new Ee,this._lightPositionECArr[o]=new Wt,this._lightDirectionECArr[o]=new H};function J8t(o,f,m){let v=!1;for(let y=0;y=0){w=!0;break}w&&(o.push(C),v=!0)}}return v}qM.createDerivedCommands=function(o,f,m,v,y,x,C){N(C)||(C={});let w=o.length>0,A=m.shaderProgram,E=A.vertexShaderSource,T=A.fragmentShaderSource,S=m.pass===vr.GLOBE,M=!1;if(w&&N(m.receiveTextureProjectionList)&&m.receiveTextureProjectionList.length>0){let I=m.ftpp;N(I)||(I=new X8t,m.ftpp=I);let P=[];J8t(P,m.receiveTextureProjectionList,o);let D=Math.min(P.length,4);if(D===0)return;I.textureProjectionArray=P,I._shadowMapCount=D;let L,R;N(C.receiveCommand)&&(L=C.receiveCommand.shaderProgram,R=C.receiveCommand.uniformMap);let O=Jn.shallowClone(m,C.receiveCommand);C.castShadows=!1,C.receiveShadows=!0;for(let F=0;F=0;A--)w.push(!!(C&1<=this.data.length)throw new Error("Attempted to read past end of stream.");return C instanceof Uint8Array?C[this.pos++]:C.charCodeAt(this.pos++)&255},this.readBytes=function(w){for(var A=[],E=0;E>3)&1<<(A&7)&&(F|=1<"u"&&(w.auto_play=!J.getAttribute("rel:auto_play")||J.getAttribute("rel:auto_play")=="1");var X=w.hasOwnProperty("on_end")?w.on_end:null,Y=w.hasOwnProperty("loop_delay")?w.loop_delay:0,Q=w.hasOwnProperty("loop_mode")?w.loop_mode:"auto",ee=w.hasOwnProperty("draw_while_loading")?w.draw_while_loading:!0,z=ee?w.hasOwnProperty("show_progress_bar")?w.show_progress_bar:!0:!1,ie=w.hasOwnProperty("progressbar_height")?w.progressbar_height:25,re=w.hasOwnProperty("progressbar_background_color")?w.progressbar_background_color:"rgba(255,255,255,0.4)",ne=w.hasOwnProperty("progressbar_foreground_color")?w.progressbar_foreground_color:"rgba(255,0,22,.8)",oe=function(){I=null,P=null,R=D,D=null,O=null},se=function(){try{y(E,it)}catch{pe("parse")}},ae=function(gt){ft.innerHTML=gt,ft.style.visibility="visible"},fe=function(gt,It){Pt.width=gt*at(),Pt.height=It*at(),ft.style.minWidth=gt*at()+"px",Ot.width=gt,Ot.height=It,Ot.style.width=gt+"px",Ot.style.height=It+"px",Ot.getContext("2d").setTransform(1,0,0,1,0,0)},de=function(gt,It){if(!q[gt]){q[gt]=It;return}typeof It.x<"u"&&(q[gt].x=It.x),typeof It.y<"u"&&(q[gt].y=It.y)},ve=function(gt,It,Jt){if(Jt&&z){var bi=ie,Yi,ii,ei,Li;if(w.is_vp){if(G?(ei=(w.vp_t+w.vp_h-bi)/at(),bi=bi/at(),Yi=w.vp_l/at(),ii=Yi+gt/It*(w.vp_w/at()),Li=Pt.width/at()):(ei=w.vp_t+w.vp_h-bi,bi=bi,Yi=w.vp_l,ii=Yi+gt/It*w.vp_w,Li=Pt.width),!1)if(G)var Je,Nt,yi,ai;else var Je,Nt,yi,ai}else ei=(Pt.height-bi)/(G?at():1),ii=gt/It*Pt.width/(G?at():1),Li=Pt.width/(G?at():1),bi/=G?at():1;Qe.fillStyle=re,Qe.fillRect(ii,ei,Li-ii,bi),Qe.fillStyle=ne,Qe.fillRect(0,ei,ii,bi)}},pe=function(gt){var It=function(){Qe.fillStyle="black",Qe.fillRect(0,0,w.c_w?w.c_w:T.width,w.c_h?w.c_h:T.height),Qe.strokeStyle="red",Qe.lineWidth=3,Qe.moveTo(0,0),Qe.lineTo(w.c_w?w.c_w:T.width,w.c_h?w.c_h:T.height),Qe.moveTo(0,w.c_h?w.c_h:T.height),Qe.lineTo(w.c_w?w.c_w:T.width,0),Qe.stroke()};S=gt,T={width:J.width,height:J.height},j=[],It()},ce=function(gt){T=gt,fe(T.width,T.height)},he=function(gt){Ce(),oe(),I=gt.transparencyGiven?gt.transparencyIndex:null,P=gt.delayTime,D=gt.disposalMethod},Ce=function(){O&&(j.push({data:O.getImageData(0,0,T.width,T.height),delay:P}),q.push({x:0,y:0}))},Se=function(gt){O||(O=Ot.getContext("2d"));var It=j.length,Jt=gt.lctFlag?gt.lct:T.gct;It>0&&(R===3?L!==null?O.putImageData(j[L].data,0,0):O.clearRect(F.leftPos,F.topPos,F.width,F.height):L=It-1,R===2&&O.clearRect(F.leftPos,F.topPos,F.width,F.height));var bi=O.getImageData(gt.leftPos,gt.topPos,gt.width,gt.height);gt.pixels.forEach(function(Yi,ii){Yi!==I&&(bi.data[ii*4+0]=Jt[Yi][0],bi.data[ii*4+1]=Jt[Yi][1],bi.data[ii*4+2]=Jt[Yi][2],bi.data[ii*4+3]=255)}),O.putImageData(bi,gt.leftPos,gt.topPos),G||(Qe.scale(at(),at()),G=!0),ee&&(Qe.drawImage(Ot,0,0),ee=w.auto_play),F=gt},De=function(){var gt=-1,It=0,Jt=!1,bi=!1,Yi=function(){var yi=U?1:-1;return(gt+yi+j.length)%j.length},ii=function(yi){gt=gt+yi,Li()},ei=function(){var yi=!1,ai=function(){X!==null&&X(J),It++,Q!==!1||It<0?wi():(yi=!1,k=!1)},wi=function(){if(yi=k,!!yi){ii(1);var ji=j[gt].delay*10;ji||(ji=100);var hi=Yi();hi===0?(ji+=Y,setTimeout(ai,ji)):setTimeout(wi,ji)}};return function(){yi||setTimeout(wi,0)}}(),Li=function(){var yi;gt=parseInt(gt,10),gt>j.length-1&&(gt=0),gt<0&&(gt=0),yi=q[gt],Ot.getContext("2d").putImageData(j[gt].data,yi.x,yi.y),Qe.globalCompositeOperation="copy",Qe.drawImage(Ot,0,0)},Je=function(){k=!0,ei()},Nt=function(){k=!1};return{init:function(){S||(w.c_w&&w.c_h||Qe.scale(at(),at()),w.auto_play?ei():(gt=0,Li()))},step:ei,play:Je,pause:Nt,playing:k,move_relative:ii,current_frame:function(){return gt},length:function(){return j.length},move_to:function(yi){gt=yi,Li()}}}(),Oe=function(gt){ve(E.pos,E.data.length,gt)},Ue=function(){},Xe=function(gt,It){return function(Jt){gt(Jt),Oe(It)}},it={hdr:Xe(ce),gce:Xe(he),com:Xe(Ue),app:{NETSCAPE:Xe(Ue)},img:Xe(Se,!0),eof:function(gt){Ce(),Oe(!1),w.c_w&&w.c_h||(Pt.width=T.width*at(),Pt.height=T.height*at()),De.init(),M=!1,At&&At(J)}},ut=function(){var gt=J.parentNode,It=document.createElement("div");Pt=document.createElement("canvas"),Qe=Pt.getContext("2d"),ft=document.createElement("div"),Ot=document.createElement("canvas"),It.width=Pt.width=J.width,It.height=Pt.height=J.height,ft.style.minWidth=J.width+"px",It.className="jsgif",ft.className="jsgif_toolbar",It.appendChild(Pt),It.appendChild(ft),gt.insertBefore(It,J),gt.removeChild(J),w.c_w&&w.c_h&&fe(w.c_w,w.c_h),Xt=!0},at=function(){var gt;return w.max_width&&T&&T.width>w.max_width?gt=w.max_width/T.width:gt=1,gt},Pt,Qe,ft,Ot,Xt=!1,At=!1,bt=function(gt){return M?!1:(gt?At=gt:At=!1,M=!0,j=[],oe(),L=null,R=null,O=null,F=null,!0)};return{play:De.play,pause:De.pause,move_relative:De.move_relative,move_to:De.move_to,get_playing:function(){return k},get_canvas:function(){return Pt},get_canvas_scale:function(){return at()},get_loading:function(){return M},get_auto_play:function(){return w.auto_play},get_length:function(){return De.length()},get_current_frame:function(){return De.current_frame()},load_url:function(gt,It){if(bt(It)){var Jt=new XMLHttpRequest;Jt.open("GET",gt,!0),"overrideMimeType"in Jt?Jt.overrideMimeType("text/plain; charset=x-user-defined"):"responseType"in Jt?Jt.responseType="arraybuffer":Jt.setRequestHeader("Accept-Charset","x-user-defined"),Jt.onloadstart=function(){Xt||ut()},Jt.onload=function(bi){this.status!=200&&pe("xhr - response"),"response"in this||(this.response=new VBArray(this.responseText).toArray().map(String.fromCharCode).join(""));var Yi=this.response;Yi.toString().indexOf("ArrayBuffer")>0&&(Yi=new Uint8Array(Yi)),E=new m(Yi),setTimeout(se,0)},Jt.onprogress=function(bi){bi.lengthComputable&&ve(bi.loaded,bi.total,!0)},Jt.onerror=function(){pe("xhr")},Jt.send()}},load:function(gt){this.load_url(J.getAttribute("rel:animated_src")||J.src,gt)},load_raw:function(gt,It){bt(It)&&(Xt||ut(),E=new m(gt),setTimeout(se,0))},set_frame_offset:de}};return x});var r1e=RXe.SuperGif;function F5(o){if(!N(o.gif))throw new li("gif property is needed.");this._definitionChanged=new Br,this._gif=o.gif,this._speed=Z(o.speed,1),this.parseGif(),this._step=0,this._imageArr=[]}Object.defineProperties(F5.prototype,{gif:{set:function(o){this._gif=o,this.parseGif()},get:function(){return this._gif}},speed:{get:function(){return this._speed},set:function(o){this._speed=o}},definitionChanged:{get:function(){return this._definitionChanged}}});F5.prototype.parseGif=function(){let o=this;o._imageArr=[];let f=document.createElement("img");f.src=o._gif,f.setAttribute("rel:animated_src",o.gif),f.setAttribute("rel:auto_play","1"),document.body.appendChild(f);let m=new r1e({gif:f});return new Promise(function(v){m.load(function(){for(let y=0;y0?(o._stepv){y=Math.sqrt(m-v),m=1/Math.sqrt(m),x=H.multiplyByScalar(f,m,WQ);let w=y*y*m;C=H.add(o,H.multiplyByScalar(x,w,WQ),WQ)}else y=Number.MAX_VALUE;this._horizonDistance=y,this._horizonPlaneNormal=x,this._horizonPlanePosition=C,this._cameraPosition=o}}});Pv.fromBoundingSphere=function(o,f,m){return N(m)?(H.clone(o.center,m._occluderPosition),m._occluderRadius=o.radius,m.cameraPosition=f,m):new Pv(o,f)};var NXe=new H;Pv.prototype.isPointVisible=function(o){if(this._horizonDistance!==Number.MAX_VALUE){let f=H.subtract(o,this._occluderPosition,NXe),m=this._occluderRadius;if(m=H.magnitudeSquared(f)-m*m,m>0)return m=Math.sqrt(m)+this._horizonDistance,f=H.subtract(o,this._cameraPosition,f),m*m>H.magnitudeSquared(f)}return!1};var Q8t=new H;Pv.prototype.isBoundingSphereVisible=function(o){let f=H.clone(o.center,Q8t),m=o.radius;if(this._horizonDistance!==Number.MAX_VALUE){let v=H.subtract(f,this._occluderPosition,NXe),y=this._occluderRadius-m;if(y=H.magnitudeSquared(v)-y*y,m0?(y=Math.sqrt(y)+this._horizonDistance,v=H.subtract(f,this._cameraPosition,v),y*y+m*m>H.magnitudeSquared(v)):!1;if(y>0){v=H.subtract(f,this._cameraPosition,v);let x=H.magnitudeSquared(v),C=this._occluderRadius*this._occluderRadius,w=m*m;return(this._horizonDistance*this._horizonDistance+C)*w>x*C?!0:(y=Math.sqrt(y)+this._horizonDistance,y*y+w>x)}return!0}return!1};var Z8t=new H;Pv.prototype.computeVisibility=function(o){let f=H.clone(o.center),m=o.radius;if(m>this._occluderRadius)return Bl.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let v=H.subtract(f,this._occluderPosition,Z8t),y=this._occluderRadius-m,x=H.magnitudeSquared(v);if(y=x-y*y,y>0){y=Math.sqrt(y)+this._horizonDistance,v=H.subtract(f,this._cameraPosition,v);let C=H.magnitudeSquared(v);return y*y+m*m0?(y=Math.sqrt(y)+this._horizonDistance,C-m?Bl.PARTIAL:Bl.FULL))}}return Bl.NONE};var jQ=new H;Pv.computeOccludeePoint=function(o,f,m){let v=H.clone(f),y=H.clone(o.center),x=o.radius,C=m.length,w=H.normalize(H.subtract(v,y,jQ),jQ),A=-H.dot(w,y),E=Pv._anyRotationVector(y,w,A),T=Pv._horizonToPlaneNormalDotProduct(o,w,A,E,m[0]);if(!T)return;let S;for(let I=1;Iv.y?0:1;(y===0&&v.z>v.x||y===1&&v.z>v.y)&&(y=2);let x=new H,C;y===0?(v.x=o.x,v.y=o.y+1,v.z=o.z+1,C=H.UNIT_X):y===1?(v.x=o.x+1,v.y=o.y,v.z=o.z+1,C=H.UNIT_Y):(v.x=o.x+1,v.y=o.y+1,v.z=o.z,C=H.UNIT_Z);let w=(H.dot(f,v)+m)/-H.dot(f,C);return H.normalize(H.subtract(H.add(v,H.multiplyByScalar(C,w,x),v),o,v),v)};var tGt=new H;Pv._rotationVector=function(o,f,m,v,y){let x=H.subtract(v,o,tGt);if(x=H.normalize(x,x),H.dot(f,x)<.9999999847691291){let C=H.cross(f,x,x);if(H.magnitude(C)>xe.EPSILON13)return H.normalize(C,new H)}return y};var Lde=new H,iGt=new H,YQ=new H,J4e=new H;Pv._horizonToPlaneNormalDotProduct=function(o,f,m,v,y){let x=H.clone(y,Lde),C=H.clone(o.center,iGt),w=o.radius,A=H.subtract(C,x,YQ),E=H.magnitudeSquared(A),T=w*w;if(E0?`${v}\u2032${y}\u2033`:v>0?`${v}\u2032`:"",x}return`'0\xB00'0"`}function qee(o,f){let m=o[f];return N(m)||(o[f]=[],m=o[f]),m}function rGt(o,f,m){let v=[],y=o._labelCollection;for(let x=0;xM?M:P;let L=Qme(Math.abs(this._screenCenterCartographic.latitude));L>60&&L<90&&(this._maxLevel-=Math.floor((L-60)/30*wz.length)),this._maxLevel<1&&(this._maxLevel=1)};var Z4e=new Pi,Ode;function oGt(o){let f=o.globe;if(o._mode===_i.SCENE3D&&N(f)&&f.show&&!o._cameraUnderground&&!o._globeTranslucencyState.translucent){let m=f.ellipsoid,v=o.frameState.minimumTerrainHeight;return Z4e.radius=m.minimumRadius+v,Ode=Ure.fromBoundingSphere(Z4e,o.camera.positionWC,Ode),Ode}}$y.prototype.setLabelVisible=function(o){this._allLable.forEach(function(f){f.show=o})};$y.prototype.hide=function(){this.setLabelVisible(!1)};$y.prototype.calcLabelVisible=function(o){let f=this._showLongitudeLabels;for(let v=0;vv.latitude:A=w.cartographic.longitude>v.longitude,A){x=C;break}}for(let C=0;C0){let w=o[x-C];y.push(w)}else{let w=o[x-C+o.length-1];y.push(w)}for(let C=0;C=y&&(S=y-1);let M=T/w|0;return M>=x&&(M=x-1),N(m)?(m.x=S,m.y=M,m):new Ye(S,M)};var Mm=uO;function NU(){li.throwInstantiationError()}Object.defineProperties(NU.prototype,{ready:{get:li.throwInstantiationError},readyPromise:{get:li.throwInstantiationError},rectangle:{get:li.throwInstantiationError},tileWidth:{get:li.throwInstantiationError},tileHeight:{get:li.throwInstantiationError},maximumLevel:{get:li.throwInstantiationError},minimumLevel:{get:li.throwInstantiationError},tilingScheme:{get:li.throwInstantiationError},tileDiscardPolicy:{get:li.throwInstantiationError},errorEvent:{get:li.throwInstantiationError},credit:{get:li.throwInstantiationError},proxy:{get:li.throwInstantiationError},hasAlphaChannel:{get:li.throwInstantiationError},defaultAlpha:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultNightAlpha:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultDayAlpha:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultBrightness:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultContrast:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultHue:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultSaturation:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultGamma:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultMinificationFilter:{get:li.throwInstantiationError,set:li.throwInstantiationError},defaultMagnificationFilter:{get:li.throwInstantiationError,set:li.throwInstantiationError}});NU.prototype.getTileCredits=function(o,f,m){li.throwInstantiationError()};NU.prototype.requestImage=function(o,f,m,v){li.throwInstantiationError()};NU.prototype.pickFeatures=function(o,f,m,v,y){li.throwInstantiationError()};var aGt=/\.ktx2$/i,sGt=/\.dds$/i,lGt=/\.json$/i;NU.loadImage=function(o,f){let m=Jr.createIfNeeded(f);return aGt.test(m.url)?$3(m):sGt.test(m)?Wie(m):lGt.test(m.url)?uGt(m):N(o)&&N(o.tileDiscardPolicy)?m.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):m.fetchImage({preferImageBitmap:!0,flipY:!0})};function uGt(o){let f=o.fetchJson();if(f!==void 0)return f.then(function(m){return m})}var Q2=NU;function o1e(o){this._errorEvent=new Br,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1;let f=new Ye(-33554054,-33746824),m=new Ye(33554054,33746824);this._tilingScheme=new Mm({rectangleSouthwestInMeters:f,rectangleNortheastInMeters:m}),this._rectangle=this._tilingScheme.rectangle,this._resource=Jr.createIfNeeded(o.url),this._tileDiscardPolicy=void 0,this._credit=void 0,this._readyPromise=void 0}Object.defineProperties(o1e.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){if(!this.ready)throw new li("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this.ready)throw new li("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this.ready)throw new li("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this.ready)throw new li("minimumLevel must not be called before the imagery provider is ready.");return this._minimumLevel}},tilingScheme:{get:function(){if(!this.ready)throw new li("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},tileDiscardPolicy:{get:function(){if(!this.ready)throw new li("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},rectangle:{get:function(){if(!this.ready)throw new li("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._resource}},readyPromise:{get:function(){return this._readyPromise}},credit:{get:function(){if(!this.ready)throw new li("credit must not be called before the imagery provider is ready.");return this._credit}}});o1e.prototype.requestImage=function(o,f,m,v){let y=this._tilingScheme.getNumberOfXTilesAtLevel(m),x=this._tilingScheme.getNumberOfYTilesAtLevel(m),C=this.url.replace("{x}",o-y/2).replace("{y}",x/2-f-1).replace("{z}",m).replace("{s}",Math.floor(10*Math.random()));return Q2.loadImage(this,C)};var FU=o1e,BXe={};(function(o,f){f(o.turf={})})(BXe,function(o){"use strict";var f=63710088e-1,m={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260511392e-6,inches:39.37*f,kilometers:6371.0088,kilometres:6371.0088,meters:f,metres:f,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:f/1852,radians:1,yards:6967335223679999e-9},v={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/f,yards:1.0936133},y={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function x(B,V,W){W===void 0&&(W={});var K={type:"Feature"};return(W.id===0||W.id)&&(K.id=W.id),W.bbox&&(K.bbox=W.bbox),K.properties=V||{},K.geometry=B,K}function C(B,V,W){switch(B){case"Point":return w(V).geometry;case"LineString":return S(V).geometry;case"Polygon":return E(V).geometry;case"MultiPoint":return D(V).geometry;case"MultiLineString":return P(V).geometry;case"MultiPolygon":return L(V).geometry;default:throw new Error(B+" is invalid")}}function w(B,V,W){if(W===void 0&&(W={}),!B)throw new Error("coordinates is required");if(!Array.isArray(B))throw new Error("coordinates must be an Array");if(B.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!Y(B[0])||!Y(B[1]))throw new Error("coordinates must contain numbers");return x({type:"Point",coordinates:B},V,W)}function A(B,V,W){return W===void 0&&(W={}),I(B.map(function(K){return w(K,V)}),W)}function E(B,V,W){W===void 0&&(W={});for(var K=0,te=B;K=0))throw new Error("precision must be a positive number");var W=Math.pow(10,V||0);return Math.round(B*W)/W}function F(B,V){V===void 0&&(V="kilometers");var W=m[V];if(!W)throw new Error(V+" units is invalid");return B*W}function k(B,V){V===void 0&&(V="kilometers");var W=m[V];if(!W)throw new Error(V+" units is invalid");return B/W}function U(B,V){return j(k(B,V))}function G(B){var V=B%360;return V<0&&(V+=360),V}function j(B){return 180*(B%(2*Math.PI))/Math.PI}function q(B){return B%360*Math.PI/180}function J(B,V,W){if(V===void 0&&(V="kilometers"),W===void 0&&(W="kilometers"),!(B>=0))throw new Error("length must be a positive number");return F(k(B,V),W)}function X(B,V,W){if(V===void 0&&(V="meters"),W===void 0&&(W="kilometers"),!(B>=0))throw new Error("area must be a positive number");var K=y[V];if(!K)throw new Error("invalid original units");var te=y[W];if(!te)throw new Error("invalid final units");return B/K*te}function Y(B){return!isNaN(B)&&B!==null&&!Array.isArray(B)}function Q(B){return!!B&&B.constructor===Object}function ee(B){if(!B)throw new Error("bbox is required");if(!Array.isArray(B))throw new Error("bbox must be an Array");if(B.length!==4&&B.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");B.forEach(function(V){if(!Y(V))throw new Error("bbox must only contain numbers")})}function z(B){if(!B)throw new Error("id is required");if(["string","number"].indexOf(typeof B)===-1)throw new Error("id must be a number or a string")}var ie=Object.freeze({__proto__:null,earthRadius:f,factors:m,unitsFactors:v,areaFactors:y,feature:x,geometry:C,point:w,points:A,polygon:E,polygons:T,lineString:S,lineStrings:M,featureCollection:I,multiLineString:P,multiPoint:D,multiPolygon:L,geometryCollection:R,round:O,radiansToLength:F,lengthToRadians:k,lengthToDegrees:U,bearingToAzimuth:G,radiansToDegrees:j,degreesToRadians:q,convertLength:J,convertArea:X,isNumber:Y,isObject:Q,validateBBox:ee,validateId:z});function re(B){if(!B)throw new Error("coord is required");if(!Array.isArray(B)){if(B.type==="Feature"&&B.geometry!==null&&B.geometry.type==="Point")return B.geometry.coordinates;if(B.type==="Point")return B.coordinates}if(Array.isArray(B)&&B.length>=2&&!Array.isArray(B[0])&&!Array.isArray(B[1]))return B;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function ne(B){if(Array.isArray(B))return B;if(B.type==="Feature"){if(B.geometry!==null)return B.geometry.coordinates}else if(B.coordinates)return B.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function oe(B){if(B.length>1&&Y(B[0])&&Y(B[1]))return!0;if(Array.isArray(B[0])&&B[0].length)return oe(B[0]);throw new Error("coordinates must only contain numbers")}function se(B,V,W){if(!V||!W)throw new Error("type and name required");if(!B||B.type!==V)throw new Error("Invalid input to "+W+": must be a "+V+", given "+B.type)}function ae(B,V,W){if(!B)throw new Error("No feature passed");if(!W)throw new Error(".featureOf() requires a name");if(!B||B.type!=="Feature"||!B.geometry)throw new Error("Invalid input to "+W+", Feature with geometry required");if(!B.geometry||B.geometry.type!==V)throw new Error("Invalid input to "+W+": must be a "+V+", given "+B.geometry.type)}function fe(B,V,W){if(!B)throw new Error("No featureCollection passed");if(!W)throw new Error(".collectionOf() requires a name");if(!B||B.type!=="FeatureCollection")throw new Error("Invalid input to "+W+", FeatureCollection required");for(var K=0,te=B.features;Kbe||Ze>Te||ot>Fe)return ye=Le,be=K,Te=Ze,Fe=ot,void(le=0);var Ke=S([ye,Le],W.properties);if(V(Ke,K,te,ot,le)===!1)return!1;le++,ye=Le})!==!1&&void 0}}})}function Qe(B,V,W){var K=W,te=!1;return Pt(B,function(le,ue,ye,be,Te){K=te===!1&&W===void 0?le:V(K,le,ue,ye,be,Te),te=!0}),K}function ft(B,V){if(!B)throw new Error("geojson is required");ut(B,function(W,K,te){if(W.geometry!==null){var le=W.geometry.type,ue=W.geometry.coordinates;switch(le){case"LineString":if(V(W,K,te,0,0)===!1)return!1;break;case"Polygon":for(var ye=0;yeW[0]&&(V[0]=W[0]),V[1]>W[1]&&(V[1]=W[1]),V[2] * v. 1.2.0 * https://github.com/RaumZeit/MarchingSquares.js * * MarchingSquaresJS is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * MarchingSquaresJS is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * As additional permission under GNU Affero General Public License version 3 * section 7, third-party projects (personal or commercial) may distribute, * include, or link against UNMODIFIED VERSIONS of MarchingSquaresJS without the * requirement that said third-party project for that reason alone becomes * subject to any requirement of the GNU Affero General Public License version 3. * Any modifications to MarchingSquaresJS, however, must be shared with the public * and made available. * * In summary this: * - allows you to use MarchingSquaresJS at no cost * - allows you to use MarchingSquaresJS for both personal and commercial purposes * - allows you to distribute UNMODIFIED VERSIONS of MarchingSquaresJS under any * license as long as this license notice is included * - enables you to keep the source code of your program that uses MarchingSquaresJS * undisclosed * - forces you to share any modifications you have made to MarchingSquaresJS, * e.g. bug-fixes * * You should have received a copy of the GNU Affero General Public License * along with MarchingSquaresJS. If not, see . */function Je(B,V,W){W=W||{};for(var K=Object.keys(ei),te=0;te=0&&el>=0&&el=0;Ft--)if(Math.abs(Te[Ft][0][0]-gi)<=Le&&Math.abs(Te[Ft][0][1]-rt)<=Le){for(var zt=Ke.path.length-2;zt>=0;--zt)Te[Ft].unshift(Ke.path[zt]);Bt=!0;break}}Bt||(Te[Fe++]=Ke.path)}var oi})}),Te}(function(be,Te){for(var Fe=be.length-1,Le=be[0].length-1,We={rows:Fe,cols:Le,cells:[]},et=0;et=Te?8:0,ot|=Bt>=Te?4:0,ot|=gi>=Te?2:0;var Ft,zt,oi,qt,Fr=!1;if((ot|=rt>=Te?1:0)===5||ot===10){var Cr=(Ke+Bt+gi+rt)/4;ot===5&&CrW;){if(K-W>600){var le=K-W+1,ue=V-W+1,ye=Math.log(le),be=.5*Math.exp(2*ye/3),Te=.5*Math.sqrt(ye*be*(le-be)/le)*(ue-le/2<0?-1:1);wr(B,V,Math.max(W,Math.floor(V-ue*be/le+Te)),Math.min(K,Math.floor(V+(le-ue)*be/le+Te)),te)}var Fe=B[V],Le=W,We=K;for(zi(B,W,V),te(B[K],Fe)>0&&zi(B,W,K);Le0;)We--}te(B[W],Fe)===0?zi(B,W,We):zi(B,++We,K),We<=V&&(W=We+1),V<=We&&(K=We-1)}}function zi(B,V,W){var K=B[V];B[V]=B[W],B[W]=K}function Ui(B,V){return BV?1:0}hi.default=Ri;var Gt=jt,$t=jt;function jt(B,V){if(!(this instanceof jt))return new jt(B,V);this._maxEntries=Math.max(4,B||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),V&&this._initFormat(V),this.clear()}function ct(B,V,W){if(!W)return V.indexOf(B);for(var K=0;K=B.minX&&V.maxY>=B.minY}function nt(B){return{children:B,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function wt(B,V,W,K,te){for(var le,ue=[V,W];ue.length;)(W=ue.pop())-(V=ue.pop())<=K||(le=V+Math.ceil((W-V)/K/2)*K,hi(B,le,V,W,te),ue.push(V,le,le,W))}function yt(B){var V={exports:{}};return B(V,V.exports),V.exports}jt.prototype={all:function(){return this._all(this.data,[])},search:function(B){var V=this.data,W=[],K=this.toBBox;if(!Si(B,V))return W;for(var te,le,ue,ye,be=[];V;){for(te=0,le=V.children.length;te=0&&le[V].children.length>this._maxEntries;)this._split(le,V),V--;this._adjustParentBBoxes(te,le,V)},_split:function(B,V){var W=B[V],K=W.children.length,te=this._minEntries;this._chooseSplitAxis(W,te,K);var le=this._chooseSplitIndex(W,te,K),ue=nt(W.children.splice(le,W.children.length-le));ue.height=W.height,ue.leaf=W.leaf,Pe(W,this.toBBox),Pe(ue,this.toBBox),V?B[V-1].children.push(ue):this._splitRoot(W,ue)},_splitRoot:function(B,V){this.data=nt([B,V]),this.data.height=B.height+1,this.data.leaf=!1,Pe(this.data,this.toBBox)},_chooseSplitIndex:function(B,V,W){var K,te,le,ue,ye,be,Te,Fe,Le,We,et,Ze,ot,Ke;for(be=Te=1/0,K=V;K<=W-V;K++)te=Ht(B,0,K,this.toBBox),le=Ht(B,K,W,this.toBBox),Le=te,We=le,et=void 0,Ze=void 0,ot=void 0,Ke=void 0,et=Math.max(Le.minX,We.minX),Ze=Math.max(Le.minY,We.minY),ot=Math.min(Le.maxX,We.maxX),Ke=Math.min(Le.maxY,We.maxY),ue=Math.max(0,ot-et)*Math.max(0,Ke-Ze),ye=Fi(te)+Fi(le),ue=V;te--)le=B.children[te],si(be,B.leaf?ue(le):le),Te+=Dt(be);return Te},_adjustParentBBoxes:function(B,V,W){for(var K=W;K>=0;K--)si(V[K],B)},_condense:function(B){for(var V,W=B.length-1;W>=0;W--)B[W].children.length===0?W>0?(V=B[W-1].children).splice(V.indexOf(B[W]),1):this.clear():Pe(B[W],this.toBBox)},_initFormat:function(B){var V=["return a"," - b",";"];this.compareMinX=new Function("a","b",V.join(B[0])),this.compareMinY=new Function("a","b",V.join(B[1])),this.toBBox=new Function("a","return {minX: a"+B[0]+", minY: a"+B[1]+", maxX: a"+B[2]+", maxY: a"+B[3]+"};")}},Gt.default=$t;var Tt=function(B,V,W){var K=B*V,te=Et*B,le=te-(te-B),ue=B-le,ye=Et*V,be=ye-(ye-V),Te=V-be,Fe=ue*Te-(K-le*be-ue*be-le*Te);return W?(W[0]=Fe,W[1]=K,W):[Fe,K]},Et=+(Math.pow(2,27)+1),ti=function(B,V){var W=0|B.length,K=0|V.length;if(W===1&&K===1)return function(oi,qt){var Fr=oi+qt,Cr=Fr-oi,rn=oi-(Fr-Cr)+(qt-Cr);return rn?[rn,Fr]:[Fr]}(B[0],V[0]);var te,le,ue=new Array(W+K),ye=0,be=0,Te=0,Fe=Math.abs,Le=B[be],We=Fe(Le),et=V[Te],Ze=Fe(et);We=K?(te=Le,(be+=1)=K?(te=Le,(be+=1)>1;return["sum(",W(Te.slice(0,Fe)),",",W(Te.slice(Fe)),")"].join("")}function K(Te){if(Te.length===2)return[["sum(prod(",Te[0][0],",",Te[1][1],"),prod(-",Te[0][1],",",Te[1][0],"))"].join("")];for(var Fe=[],Le=0;Le0){if(Ze<=0)return ot;We=et+Ze}else{if(!(et<0)||Ze>=0)return ot;We=-(et+Ze)}var Ke=33306690738754716e-32*We;return ot>=Ke||ot<=-Ke?ot:le(Te,Fe,Le)},function(Te,Fe,Le,We){var et=Te[0]-We[0],Ze=Fe[0]-We[0],ot=Le[0]-We[0],Ke=Te[1]-We[1],Bt=Fe[1]-We[1],gi=Le[1]-We[1],rt=Te[2]-We[2],Ft=Fe[2]-We[2],zt=Le[2]-We[2],oi=Ze*gi,qt=ot*Bt,Fr=ot*Ke,Cr=et*gi,rn=et*Bt,Dr=Ze*Ke,mn=rt*(oi-qt)+Ft*(Fr-Cr)+zt*(rn-Dr),Lr=7771561172376103e-31*((Math.abs(oi)+Math.abs(qt))*Math.abs(rt)+(Math.abs(Fr)+Math.abs(Cr))*Math.abs(Ft)+(Math.abs(rn)+Math.abs(Dr))*Math.abs(zt));return mn>Lr||-mn>Lr?mn:ue(Te,Fe,Le,We)}];function be(Te){var Fe=ye[Te.length];return Fe||(Fe=ye[Te.length]=te(Te.length)),Fe.apply(void 0,Te)}(function(){for(;ye.length<=5;)ye.push(te(ye.length));for(var Te=[],Fe=["slow"],Le=0;Le<=5;++Le)Te.push("a"+Le),Fe.push("o"+Le);var We=["function getOrientation(",Te.join(),"){switch(arguments.length){case 0:case 1:return 0;"];for(Le=2;Le<=5;++Le)We.push("case ",Le,":return o",Le,"(",Te.slice(0,Le).join(),");");We.push("}var s=new Array(arguments.length);for(var i=0;i1&&pr(B[le[Te-2]],B[le[Te-1]],be)<=0;)Te-=1,le.pop();for(le.push(ye),Te=ue.length;Te>1&&pr(B[ue[Te-2]],B[ue[Te-1]],be)>=0;)Te-=1,ue.pop();ue.push(ye)}W=new Array(ue.length+le.length-2);for(var Fe=0,Le=(K=0,le.length);K0;--We)W[Fe++]=ue[We];return W},pr=Tn[3],yn=fn,dn=fn;function fn(B,V){if(!(this instanceof fn))return new fn(B,V);if(this.data=B||[],this.length=this.data.length,this.compare=V||Or,this.length>0)for(var W=(this.length>>1)-1;W>=0;W--)this._down(W)}function Or(B,V){return BV?1:0}fn.prototype={push:function(B){this.data.push(B),this.length++,this._up(this.length-1)},pop:function(){if(this.length!==0){var B=this.data[0];return this.length--,this.length>0&&(this.data[0]=this.data[this.length],this._down(0)),this.data.pop(),B}},peek:function(){return this.data[0]},_up:function(B){for(var V=this.data,W=this.compare,K=V[B];B>0;){var te=B-1>>1,le=V[te];if(W(K,le)>=0)break;V[B]=le,B=te}V[B]=K},_down:function(B){for(var V=this.data,W=this.compare,K=this.length>>1,te=V[B];B=0)break;V[B]=ye,B=le}V[B]=te}},yn.default=dn;var On=function(B,V){for(var W=B[0],K=B[1],te=!1,le=0,ue=V.length-1;leK!=Fe>K&&W<(Te-ye)*(K-be)/(Fe-be)+ye&&(te=!te)}return te},eo=Tn[3],Cn=Va,Sa=Va;function Va(B,V,W){V=Math.max(0,V===void 0?2:V),W=W||0;for(var K,te=function(gi){for(var rt=gi[0],Ft=gi[0],zt=gi[0],oi=gi[0],qt=0;qtzt[0]&&(zt=Fr),Fr[1]oi[1]&&(oi=Fr)}var Cr=[rt,Ft,zt,oi],rn=Cr.slice();for(qt=0;qtle||ye.push({node:Fe,dist:Le})}for(;ye.length&&!ye.peek().node.children;){var We=ye.pop(),et=We.node,Ze=$i(et,V,W),ot=$i(et,K,te);if(We.dist=V.minX&&B[0]<=V.maxX&&B[1]>=V.minY&&B[1]<=V.maxY}function cr(B,V,W){for(var K,te,le,ue,ye=Math.min(B[0],V[0]),be=Math.min(B[1],V[1]),Te=Math.max(B[0],V[0]),Fe=Math.max(B[1],V[1]),Le=W.search({minX:ye,minY:be,maxX:Te,maxY:Fe}),We=0;We0!=eo(K,te,ue)>0&&eo(le,ue,K)>0!=eo(le,ue,te)>0)return!1;return!0}function Bi(B){var V=B.p,W=B.next.p;return B.minX=Math.min(V[0],W[0]),B.minY=Math.min(V[1],W[1]),B.maxX=Math.max(V[0],W[0]),B.maxY=Math.max(V[1],W[1]),B}function Ct(B,V){var W={p:B,prev:null,next:null,minX:0,minY:0,maxX:0,maxY:0};return V?(W.next=V.next,W.prev=V,V.next.prev=W,V.next=W):(W.prev=W,W.next=W),W}function Mi(B,V){var W=B[0]-V[0],K=B[1]-V[1];return W*W+K*K}function $i(B,V,W){var K=V[0],te=V[1],le=W[0]-K,ue=W[1]-te;if(le!==0||ue!==0){var ye=((B[0]-K)*le+(B[1]-te)*ue)/(le*le+ue*ue);ye>1?(K=W[0],te=W[1]):ye>0&&(K+=le*ye,te+=ue*ye)}return(le=B[0]-K)*le+(ue=B[1]-te)*ue}function ur(B,V,W,K,te,le,ue,ye){var be,Te,Fe,Le,We=W-B,et=K-V,Ze=ue-te,ot=ye-le,Ke=B-te,Bt=V-le,gi=We*We+et*et,rt=We*Ze+et*ot,Ft=Ze*Ze+ot*ot,zt=We*Ke+et*Bt,oi=Ze*Ke+ot*Bt,qt=gi*Ft-rt*rt,Fr=qt,Cr=qt;qt===0?(Te=0,Fr=1,Le=oi,Cr=Ft):(Le=gi*oi-rt*zt,(Te=rt*oi-Ft*zt)<0?(Te=0,Le=oi,Cr=Ft):Te>Fr&&(Te=Fr,Le=oi+rt,Cr=Ft)),Le<0?(Le=0,-zt<0?Te=0:-zt>gi?Te=Fr:(Te=-zt,Fr=gi)):Le>Cr&&(Le=Cr,-zt+rt<0?Te=0:-zt+rt>gi?Te=Fr:(Te=-zt+rt,Fr=gi));var rn=(1-(Fe=Le===0?0:Le/Cr))*te+Fe*ue-((1-(be=Te===0?0:Te/Fr))*B+be*W),Dr=(1-Fe)*le+Fe*ye-((1-be)*V+be*K);return rn*rn+Dr*Dr}function Nr(B,V){V===void 0&&(V={}),V.concavity=V.concavity||1/0;var W=[];if(ce(B,function(te){W.push([te[0],te[1]])}),!W.length)return null;var K=Cn(W,V.concavity);return K.length>3?E([K]):null}function qe(B,V,W){if(W===void 0&&(W={}),!B)throw new Error("point is required");if(!V)throw new Error("polygon is required");var K=re(B),te=de(V),le=te.type,ue=V.bbox,ye=te.coordinates;if(ue&&function(We,et){return et[0]<=We[0]&&et[1]<=We[1]&&et[2]>=We[0]&&et[3]>=We[1]}(K,ue)===!1)return!1;le==="Polygon"&&(ye=[ye]);for(var be=!1,Te=0;TeB[1]!=Te>B[1]&&B[0]<(be-ue)*(B[1]-ye)/(Te-ye)+ue&&(K=!K)}return K}function $e(B,V){var W=[];return De(B,function(K){var te=!1;Xe(V,function(le){qe(K,le)&&(te=!0)}),te&&W.push(K)}),I(W)}function St(B,V,W){W===void 0&&(W={});var K=re(B),te=re(V),le=q(te[1]-K[1]),ue=q(te[0]-K[0]),ye=q(K[1]),be=q(te[1]),Te=Math.pow(Math.sin(le/2),2)+Math.pow(Math.sin(ue/2),2)*Math.cos(ye)*Math.cos(be);return F(2*Math.atan2(Math.sqrt(Te),Math.sqrt(1-Te)),W.units)}function Zt(B,V){var W=!1;return I(function(K){if(K.length<3)return[];K.sort(hr);for(var te,le,ue,ye,be,Te,Fe=K.length-1,Le=K[Fe].x,We=K[0].x,et=K[Fe].y,Ze=et,ot=1e-12;Fe--;)K[Fe].yZe&&(Ze=K[Fe].y);var Ke,Bt=We-Le,gi=Ze-et,rt=Bt>gi?Bt:gi,Ft=.5*(We+Le),zt=.5*(Ze+et),oi=[new ui({__sentinel:!0,x:Ft-20*rt,y:zt-rt},{__sentinel:!0,x:Ft,y:zt+20*rt},{__sentinel:!0,x:Ft+20*rt,y:zt-rt})],qt=[],Fr=[];for(Fe=K.length;Fe--;){for(Fr.length=0,Ke=oi.length;Ke--;)(Bt=K[Fe].x-oi[Ke].x)>0&&Bt*Bt>oi[Ke].r?(qt.push(oi[Ke]),oi.splice(Ke,1)):Bt*Bt+(gi=K[Fe].y-oi[Ke].y)*gi>oi[Ke].r||(Fr.push(oi[Ke].a,oi[Ke].b,oi[Ke].b,oi[Ke].c,oi[Ke].c,oi[Ke].a),oi.splice(Ke,1));for(Yr(Fr),Ke=Fr.length;Ke;)le=Fr[--Ke],te=Fr[--Ke],ue=K[Fe],ye=le.x-te.x,be=le.y-te.y,Te=2*(ye*(ue.y-le.y)-be*(ue.x-le.x)),Math.abs(Te)>ot&&oi.push(new ui(te,le,ue))}for(Array.prototype.push.apply(qt,oi),Fe=qt.length;Fe--;)(qt[Fe].a.__sentinel||qt[Fe].b.__sentinel||qt[Fe].c.__sentinel)&&qt.splice(Fe,1);return qt}(B.features.map(function(K){var te={x:K.geometry.coordinates[0],y:K.geometry.coordinates[1]};return V?te.z=K.properties[V]:K.geometry.coordinates.length===3&&(W=!0,te.z=K.geometry.coordinates[2]),te})).map(function(K){var te=[K.a.x,K.a.y],le=[K.b.x,K.b.y],ue=[K.c.x,K.c.y],ye={};return W?(te.push(K.a.z),le.push(K.b.z),ue.push(K.c.z)):ye={a:K.a.z,b:K.b.z,c:K.c.z},E([[te,le,ue,te]],ye)}))}Cn.default=Sa;var ui=function(B,V,W){this.a=B,this.b=V,this.c=W;var K,te,le=V.x-B.x,ue=V.y-B.y,ye=W.x-B.x,be=W.y-B.y,Te=le*(B.x+V.x)+ue*(B.y+V.y),Fe=ye*(B.x+W.x)+be*(B.y+W.y),Le=2*(le*(W.y-V.y)-ue*(W.x-V.x));this.x=(be*Te-ue*Fe)/Le,this.y=(le*Fe-ye*Te)/Le,K=this.x-B.x,te=this.y-B.y,this.r=K*K+te*te};function hr(B,V){return V.x-B.x}function Yr(B){var V,W,K,te,le,ue=B.length;e:for(;ue;)for(W=B[--ue],V=B[--ue],K=ue;K;)if(le=B[--K],V===(te=B[--K])&&W===le||V===le&&W===te){B.splice(ue,2),B.splice(K,2),ue-=2;continue e}}function ln(B){if(!B)throw new Error("geojson is required");switch(B.type){case"Feature":return Kn(B);case"FeatureCollection":return function(V){var W={type:"FeatureCollection"};return Object.keys(V).forEach(function(K){switch(K){case"type":case"features":return;default:W[K]=V[K]}}),W.features=V.features.map(function(K){return Kn(K)}),W}(B);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Qn(B);default:throw new Error("unknown GeoJSON type")}}function Kn(B){var V={type:"Feature"};return Object.keys(B).forEach(function(W){switch(W){case"type":case"properties":case"geometry":return;default:V[W]=B[W]}}),V.properties=Un(B.properties),V.geometry=Qn(B.geometry),V}function Un(B){var V={};return B&&Object.keys(B).forEach(function(W){var K=B[W];typeof K=="object"?K===null?V[W]=null:Array.isArray(K)?V[W]=K.map(function(te){return te}):V[W]=Un(K):V[W]=K}),V}function Qn(B){var V={type:B.type};return B.bbox&&(V.bbox=B.bbox),B.type==="GeometryCollection"?(V.geometries=B.geometries.map(function(W){return Qn(W)}),V):(V.coordinates=Pa(B.coordinates),V)}function Pa(B){var V=B;return typeof V[0]!="object"?V.slice():V.map(function(W){return Pa(W)})}function Gn(B,V){if(V===void 0&&(V={}),!Q(V=V||{}))throw new Error("options is invalid");var W=V.mutate;if(ve(B)!=="FeatureCollection")throw new Error("geojson must be a FeatureCollection");if(!B.features.length)throw new Error("geojson is empty");W!==!1&&W!==void 0||(B=ln(B));var K=[],te=Ot(B,function(le,ue){var ye=function(be,Te){var Fe,Le=be.geometry.coordinates,We=Te.geometry.coordinates,et=Ja(Le[0]),Ze=Ja(Le[Le.length-1]),ot=Ja(We[0]),Ke=Ja(We[We.length-1]);if(et===Ke)Fe=We.concat(Le.slice(1));else if(ot===Ze)Fe=Le.concat(We.slice(1));else if(et===ot)Fe=Le.slice(1).reverse().concat(We);else{if(Ze!==Ke)return null;Fe=Le.concat(We.reverse().slice(1))}return S(Fe)}(le,ue);return ye||(K.push(le),ue)});return te&&K.push(te),K.length?K.length===1?K[0]:P(K.map(function(le){return le.coordinates})):null}function Ja(B){return B[0].toString()+","+B[1].toString()}function fl(B){return B}function Ul(B,V){var W=function(Te){if(Te==null)return fl;var Fe,Le,We=Te.scale[0],et=Te.scale[1],Ze=Te.translate[0],ot=Te.translate[1];return function(Ke,Bt){Bt||(Fe=Le=0);var gi=2,rt=Ke.length,Ft=new Array(rt);for(Ft[0]=(Fe+=Ke[0])*We+Ze,Ft[1]=(Le+=Ke[1])*et+ot;gi1)for(var Fe,Le,We=1,et=ue(Te[0]);Weet&&(Le=Te[0],Te[0]=Te[We],Te[We]=Le,et=Fe);return Te}).filter(function(ye){return ye.length>0})}}var Wd=Object.prototype.hasOwnProperty;function Pc(B,V,W,K,te,le){arguments.length===3&&(K=le=Array,te=null);for(var ue=new K(B=1<=B)throw new Error("full hashmap");Bt=ue[Ke=Ke+1&be]}return ue[Ke]=Ze,ye[Ke]=ot,ot}function Le(Ze,ot){for(var Ke=V(Ze)&be,Bt=ue[Ke],gi=0;Bt!=te;){if(W(Bt,Ze))return ye[Ke];if(++gi>=B)throw new Error("full hashmap");Bt=ue[Ke=Ke+1&be]}return ue[Ke]=Ze,ye[Ke]=ot,ot}function We(Ze,ot){for(var Ke=V(Ze)&be,Bt=ue[Ke],gi=0;Bt!=te;){if(W(Bt,Ze))return ye[Ke];if(++gi>=B)break;Bt=ue[Ke=Ke+1&be]}return ot}function et(){for(var Ze=[],ot=0,Ke=ue.length;ot>7^Gl[2]^Gl[3])}function Th(B){var V,W,K,te,le=B.coordinates,ue=B.lines,ye=B.rings,be=function(){for(var Cr=Pc(1.4*le.length,zt,oi,Int32Array,-1,Int32Array),rn=new Int32Array(le.length),Dr=0,mn=le.length;Dr=0){var Rr=Le[Dr];Lr===rn&&Rr===mn||Lr===mn&&Rr===rn||(++et,We[Dr]=1)}else Fe[Dr]=rn,Le[Dr]=mn}}function zt(Cr){return Wl(le[Cr])}function oi(Cr,rn){return So(le[Cr],le[rn])}Te=Fe=Le=null;var qt,Fr=function(Cr,rn,Dr,mn,Lr){arguments.length===3&&(mn=Array,Lr=null);for(var Rr=new mn(Cr=1<=Cr)throw new Error("full hashset");As=Rr[lo=lo+1&Tr]}return Rr[lo]=Io,!0}function hn(Io){for(var lo=rn(Io)&Tr,As=Rr[lo],el=0;As!=Lr;){if(Dr(As,Io))return!0;if(++el>=Cr)break;As=Rr[lo=lo+1&Tr]}return!1}function nr(){for(var Io=[],lo=0,As=Rr.length;lo>1);Vot&&(ot=Fr),CrKe&&(Ke=Cr)}function Ft(qt){qt.forEach(rt)}function zt(qt){qt.forEach(Ft)}for(var oi in We)Bt(We[oi]);return ot>=et&&Ke>=Ze?[et,Ze,ot,Ke]:void 0}(B=Wn(B)),K=V>0&&W&&function(We,et,Ze){var ot=et[0],Ke=et[1],Bt=et[2],gi=et[3],rt=Bt-ot?(Ze-1)/(Bt-ot):1,Ft=gi-Ke?(Ze-1)/(gi-Ke):1;function zt(Lr){return[Math.round((Lr[0]-ot)*rt),Math.round((Lr[1]-Ke)*Ft)]}function oi(Lr,Rr){for(var Tr,nn,on,hn,nr,Io=-1,lo=0,As=Lr.length,el=new Array(As);++Io2&&dt(W[te-3],W[te-1],W[te-2])&&W.splice(W.length-2,1))}if(W.push(V[V.length-1]),te=W.length,He(V[0],V[V.length-1])&&te<4)throw new Error("invalid polygon");return dt(W[te-3],W[te-1],W[te-2])&&W.splice(W.length-2,1),W}function He(B,V){return B[0]===V[0]&&B[1]===V[1]}function dt(B,V,W){var K=W[0],te=W[1],le=B[0],ue=B[1],ye=V[0],be=V[1],Te=ye-le,Fe=be-ue;return(K-le)*Fe-(te-ue)*Te===0&&(Math.abs(Te)>=Math.abs(Fe)?Te>0?le<=K&&K<=ye:ye<=K&&K<=le:Fe>0?ue<=te&&te<=be:be<=te&&te<=ue)}function Vt(B,V,W){var K=V.x,te=V.y,le=W.x-K,ue=W.y-te;if(le!==0||ue!==0){var ye=((B.x-K)*le+(B.y-te)*ue)/(le*le+ue*ue);ye>1?(K=W.x,te=W.y):ye>0&&(K+=le*ye,te+=ue*ye)}return(le=B.x-K)*le+(ue=B.y-te)*ue}function ni(B,V,W,K,te){for(var le,ue=K,ye=V+1;yeue&&(le=ye,ue=be)}ue>K&&(le-V>1&&ni(B,V,le,K,te),te.push(B[le]),W-le>1&&ni(B,le,W,K,te))}function _r(B,V){var W=B.length-1,K=[B[0]];return ni(B,0,W,V,K),K.push(B[W]),K}function Ir(B,V,W){if(B.length<=2)return B;var K=V!==void 0?V*V:1;return B=_r(B=W?B:function(te,le){for(var ue,ye,be,Te,Fe,Le=te[0],We=[Le],et=1,Ze=te.length;etle&&(We.push(ue),Le=ue);return Le!==ue&&We.push(ue),We}(B,K),K)}function Pn(B,V,W){return Ir(B.map(function(K){return{x:K[0],y:K[1],z:K[2]}}),V,W).map(function(K){return K.z?[K.x,K.y,K.z]:[K.x,K.y]})}function An(B,V,W){return B.map(function(K){var te=K.map(function(ue){return{x:ue[0],y:ue[1]}});if(te.length<4)throw new Error("invalid polygon");for(var le=Ir(te,V,W).map(function(ue){return[ue.x,ue.y]});!Wr(le);)le=Ir(te,V-=.01*V,W).map(function(ue){return[ue.x,ue.y]});return le[le.length-1][0]===le[0][0]&&le[le.length-1][1]===le[0][1]||le.push(le[0]),le})}function Wr(B){return!(B.length<3)&&!(B.length===3&&B[2][0]===B[0][0]&&B[2][1]===B[0][1])}var Ho=function(){function B(V){this.points=V.points||[],this.duration=V.duration||1e4,this.sharpness=V.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=V.stepLength||60,this.length=this.points.length,this.delay=0;for(var W=0;WV&&(W.push(te),K=le)}return W},B.prototype.vector=function(V){var W=this.pos(V+10),K=this.pos(V-10);return{angle:180*Math.atan2(W.y-K.y,W.x-K.x)/3.14,speed:Math.sqrt((K.x-W.x)*(K.x-W.x)+(K.y-W.y)*(K.y-W.y)+(K.z-W.z)*(K.z-W.z))}},B.prototype.pos=function(V){var W=V-this.delay;W<0&&(W=0),W>this.duration&&(W=this.duration-1);var K=W/this.duration;if(K>=1)return this.points[this.length-1];var te=Math.floor((this.points.length-1)*K);return function(le,ue,ye,be,Te){var Fe=function(Le){var We=Le*Le;return[We*Le,3*We*(1-Le),3*Le*(1-Le)*(1-Le),(1-Le)*(1-Le)*(1-Le)]}(le);return{x:Te.x*Fe[0]+be.x*Fe[1]+ye.x*Fe[2]+ue.x*Fe[3],y:Te.y*Fe[0]+be.y*Fe[1]+ye.y*Fe[2]+ue.y*Fe[3],z:Te.z*Fe[0]+be.z*Fe[1]+ye.z*Fe[2]+ue.z*Fe[3]}}((this.length-1)*K-te,this.points[te],this.controls[te][1],this.controls[te+1][0],this.points[te+1])},B}();function ma(B,V){V===void 0&&(V={});for(var W=V.resolution||1e4,K=V.sharpness||.85,te=[],le=de(B).coordinates.map(function(Te){return{x:Te[0],y:Te[1]}}),ue=new Ho({duration:W,points:le,sharpness:K}),ye=function(Te){var Fe=ue.pos(Te);Math.floor(Te/100)%2==0&&te.push([Fe.x,Fe.y])},be=0;be=St(B.slice(0,2),[V,te])){var le=(W+te)/2;return[V,le-(K-V)/2,K,le+(K-V)/2]}var ue=(V+K)/2;return[ue-(te-W)/2,W,ue+(te-W)/2,te]}function rs(B,V,W,K){K===void 0&&(K={});var te=re(B),le=q(te[0]),ue=q(te[1]),ye=q(W),be=k(V,K.units),Te=Math.asin(Math.sin(ue)*Math.cos(be)+Math.cos(ue)*Math.sin(be)*Math.cos(ye));return w([j(le+Math.atan2(Math.sin(ye)*Math.sin(be)*Math.cos(ue),Math.cos(be)-Math.sin(ue)*Math.sin(Te))),j(Te)],K.properties)}function Wa(B,V,W){W===void 0&&(W={});for(var K=W.steps||64,te=W.properties?W.properties:!Array.isArray(B)&&B.type==="Feature"&&B.properties?B.properties:{},le=[],ue=0;ue80*W){K=le=B[0],te=ue=B[1];for(var Ze=W;Zele&&(le=ye),be>ue&&(ue=be);Te=(Te=Math.max(le-K,ue-te))!==0?1/Te:0}return Bc(We,et,W,K,te,Te),et}function _f(B,V,W,K,te){var le,ue;if(te===gx(B,V,W,K)>0)for(le=V;le=V;le-=K)ue=$T(le,B[le],B[le+1],ue);return ue&&s0(ue,ue.next)&&(Uf(ue),ue=ue.next),ue}function wd(B,V){if(!B)return B;V||(V=B);var W,K=B;do if(W=!1,K.steiner||!s0(K,K.next)&&Qh(K.prev,K,K.next)!==0)K=K.next;else{if(Uf(K),(K=V=K.prev)===K.next)break;W=!0}while(W||K!==V);return V}function Bc(B,V,W,K,te,le,ue){if(B){!ue&&le&&function(Fe,Le,We,et){var Ze=Fe;do Ze.z===null&&(Ze.z=hy(Ze.x,Ze.y,Le,We,et)),Ze.prevZ=Ze.prev,Ze.nextZ=Ze.next,Ze=Ze.next;while(Ze!==Fe);Ze.prevZ.nextZ=null,Ze.prevZ=null,function(ot){var Ke,Bt,gi,rt,Ft,zt,oi,qt,Fr=1;do{for(Bt=ot,ot=null,Ft=null,zt=0;Bt;){for(zt++,gi=Bt,oi=0,Ke=0;Ke0||qt>0&&gi;)oi!==0&&(qt===0||!gi||Bt.z<=gi.z)?(rt=Bt,Bt=Bt.nextZ,oi--):(rt=gi,gi=gi.nextZ,qt--),Ft?Ft.nextZ=rt:ot=rt,rt.prevZ=Ft,Ft=rt;Bt=gi}Ft.nextZ=null,Fr*=2}while(zt>1)}(Ze)}(B,K,te,le);for(var ye,be,Te=B;B.prev!==B.next;)if(ye=B.prev,be=B.next,le?cp(B,K,te,le):vf(B))V.push(ye.i/W),V.push(B.i/W),V.push(be.i/W),Uf(B),B=be.next,Te=be.next;else if((B=be)===Te){ue?ue===1?Bc(B=yf(B,V,W),V,W,K,te,le,2):ue===2&&Vp(B,V,W,K,te,le):Bc(wd(B),V,W,K,te,le,1);break}}}function vf(B){var V=B.prev,W=B,K=B.next;if(Qh(V,W,K)>=0)return!1;for(var te=B.next.next;te!==B.prev;){if(km(V.x,V.y,W.x,W.y,K.x,K.y,te.x,te.y)&&Qh(te.prev,te,te.next)>=0)return!1;te=te.next}return!0}function cp(B,V,W,K){var te=B.prev,le=B,ue=B.next;if(Qh(te,le,ue)>=0)return!1;for(var ye=te.xle.x?te.x>ue.x?te.x:ue.x:le.x>ue.x?le.x:ue.x,Fe=te.y>le.y?te.y>ue.y?te.y:ue.y:le.y>ue.y?le.y:ue.y,Le=hy(ye,be,V,W,K),We=hy(Te,Fe,V,W,K),et=B.prevZ,Ze=B.nextZ;et&&et.z>=Le&&Ze&&Ze.z<=We;){if(et!==B.prev&&et!==B.next&&km(te.x,te.y,le.x,le.y,ue.x,ue.y,et.x,et.y)&&Qh(et.prev,et,et.next)>=0||(et=et.prevZ,Ze!==B.prev&&Ze!==B.next&&km(te.x,te.y,le.x,le.y,ue.x,ue.y,Ze.x,Ze.y)&&Qh(Ze.prev,Ze,Ze.next)>=0))return!1;Ze=Ze.nextZ}for(;et&&et.z>=Le;){if(et!==B.prev&&et!==B.next&&km(te.x,te.y,le.x,le.y,ue.x,ue.y,et.x,et.y)&&Qh(et.prev,et,et.next)>=0)return!1;et=et.prevZ}for(;Ze&&Ze.z<=We;){if(Ze!==B.prev&&Ze!==B.next&&km(te.x,te.y,le.x,le.y,ue.x,ue.y,Ze.x,Ze.y)&&Qh(Ze.prev,Ze,Ze.next)>=0)return!1;Ze=Ze.nextZ}return!0}function yf(B,V,W){var K=B;do{var te=K.prev,le=K.next.next;!s0(te,le)&&hp(te,K,K.next,le)&&jd(te,le)&&jd(le,te)&&(V.push(te.i/W),V.push(K.i/W),V.push(le.i/W),Uf(K),Uf(K.next),K=B=le),K=K.next}while(K!==B);return K}function Vp(B,V,W,K,te,le){var ue=B;do{for(var ye=ue.next.next;ye!==ue.prev;){if(ue.i!==ye.i&&bg(ue,ye)){var be=ju(ue,ye);return ue=wd(ue,ue.next),be=wd(be,be.next),Bc(ue,V,W,K,te,le),void Bc(be,V,W,K,te,le)}ye=ye.next}ue=ue.next}while(ue!==B)}function Hf(B,V){return B.x-V.x}function bu(B,V){if(V=function(K,te){var le,ue=te,ye=K.x,be=K.y,Te=-1/0;do{if(be<=ue.y&&be>=ue.next.y&&ue.next.y!==ue.y){var Fe=ue.x+(be-ue.y)*(ue.next.x-ue.x)/(ue.next.y-ue.y);if(Fe<=ye&&Fe>Te){if(Te=Fe,Fe===ye){if(be===ue.y)return ue;if(be===ue.next.y)return ue.next}le=ue.x=ue.x&&ue.x>=et&&ye!==ue.x&&km(bele.x)&&jd(ue,K)&&(le=ue,ot=Le),ue=ue.next;return le}(B,V)){var W=ju(V,B);wd(W,W.next)}}function hy(B,V,W,K,te){return(B=1431655765&((B=858993459&((B=252645135&((B=16711935&((B=32767*(B-W)*te)|B<<8))|B<<4))|B<<2))|B<<1))|(V=1431655765&((V=858993459&((V=252645135&((V=16711935&((V=32767*(V-K)*te)|V<<8))|V<<4))|V<<2))|V<<1))<<1}function zp(B){var V=B,W=B;do V.x=0&&(B-ue)*(K-ye)-(W-ue)*(V-ye)>=0&&(W-ue)*(le-ye)-(te-ue)*(K-ye)>=0}function bg(B,V){return B.next.i!==V.i&&B.prev.i!==V.i&&!function(W,K){var te=W;do{if(te.i!==W.i&&te.next.i!==W.i&&te.i!==K.i&&te.next.i!==K.i&&hp(te,te.next,W,K))return!0;te=te.next}while(te!==W);return!1}(B,V)&&jd(B,V)&&jd(V,B)&&function(W,K){var te=W,le=!1,ue=(W.x+K.x)/2,ye=(W.y+K.y)/2;do te.y>ye!=te.next.y>ye&&te.next.y!==te.y&&ue<(te.next.x-te.x)*(ye-te.y)/(te.next.y-te.y)+te.x&&(le=!le),te=te.next;while(te!==W);return le}(B,V)}function Qh(B,V,W){return(V.y-B.y)*(W.x-V.x)-(V.x-B.x)*(W.y-V.y)}function s0(B,V){return B.x===V.x&&B.y===V.y}function hp(B,V,W,K){return!!(s0(B,V)&&s0(W,K)||s0(B,K)&&s0(W,V))||Qh(B,V,W)>0!=Qh(B,V,K)>0&&Qh(W,K,B)>0!=Qh(W,K,V)>0}function jd(B,V){return Qh(B.prev,B,B.next)<0?Qh(B,V,B.next)>=0&&Qh(B,B.prev,V)>=0:Qh(B,V,B.prev)<0||Qh(B,B.next,V)<0}function ju(B,V){var W=new mx(B.i,B.x,B.y),K=new mx(V.i,V.x,V.y),te=B.next,le=V.prev;return B.next=V,V.prev=B,W.next=te,te.prev=W,K.next=W,W.prev=K,le.next=K,K.prev=le,K}function $T(B,V,W,K){var te=new mx(B,V,W);return K?(te.next=K.next,te.prev=K,K.next.prev=te,K.next=te):(te.prev=te,te.next=te),te}function Uf(B){B.next.prev=B.prev,B.prev.next=B.next,B.prevZ&&(B.prevZ.nextZ=B.nextZ),B.nextZ&&(B.nextZ.prevZ=B.prevZ)}function mx(B,V,W){this.i=B,this.x=V,this.y=W,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function gx(B,V,W,K){for(var te=0,le=V,ue=W-K;le0&&(Fe+=ye[Le-1].length,Te.holes.push(Fe))}return Te}(B),W=Os(V.vertices,V.holes,2),K=[],te=[];W.forEach(function(ye,be){var Te=W[be];te.push([V.vertices[2*Te],V.vertices[2*Te+1]])});for(var le=0;legi?Ke:gi,Bt>rt?Bt:rt]}(Le,We),Fe.push(et),We}),Fe})(ye,K.properties).forEach(function(be){be.id=te.length,te.push(be)})})}})(W,V)}),I(V)}_c.deviation=function(B,V,W,K){var te=V&&V.length,le=te?V[0]*W:B.length,ue=Math.abs(gx(B,0,le,W));if(te)for(var ye=0,be=V.length;ye0&&(K+=B[te-1].length,W.holes.push(K))}return W},Os.default=Ns;var ah=yt(function(B,V){function W(Ze,ot,Ke){Ke===void 0&&(Ke={});var Bt={type:"Feature"};return(Ke.id===0||Ke.id)&&(Bt.id=Ke.id),Ke.bbox&&(Bt.bbox=Ke.bbox),Bt.properties=ot||{},Bt.geometry=Ze,Bt}function K(Ze,ot,Ke){if(Ke===void 0&&(Ke={}),!Ze)throw new Error("coordinates is required");if(!Array.isArray(Ze))throw new Error("coordinates must be an Array");if(Ze.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!et(Ze[0])||!et(Ze[1]))throw new Error("coordinates must contain numbers");return W({type:"Point",coordinates:Ze},ot,Ke)}function te(Ze,ot,Ke){Ke===void 0&&(Ke={});for(var Bt=0,gi=Ze;Bt=0))throw new Error("precision must be a positive number");var Ke=Math.pow(10,ot||0);return Math.round(Ze*Ke)/Ke},V.radiansToLength=Fe,V.lengthToRadians=Le,V.lengthToDegrees=function(Ze,ot){return We(Le(Ze,ot))},V.bearingToAzimuth=function(Ze){var ot=Ze%360;return ot<0&&(ot+=360),ot},V.radiansToDegrees=We,V.degreesToRadians=function(Ze){return Ze%360*Math.PI/180},V.convertLength=function(Ze,ot,Ke){if(ot===void 0&&(ot="kilometers"),Ke===void 0&&(Ke="kilometers"),!(Ze>=0))throw new Error("length must be a positive number");return Fe(Le(Ze,ot),Ke)},V.convertArea=function(Ze,ot,Ke){if(ot===void 0&&(ot="meters"),Ke===void 0&&(Ke="kilometers"),!(Ze>=0))throw new Error("area must be a positive number");var Bt=V.areaFactors[ot];if(!Bt)throw new Error("invalid original units");var gi=V.areaFactors[Ke];if(!gi)throw new Error("invalid final units");return Ze/Bt*gi},V.isNumber=et,V.isObject=function(Ze){return!!Ze&&Ze.constructor===Object},V.validateBBox=function(Ze){if(!Ze)throw new Error("bbox is required");if(!Array.isArray(Ze))throw new Error("bbox must be an Array");if(Ze.length!==4&&Ze.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");Ze.forEach(function(ot){if(!et(ot))throw new Error("bbox must only contain numbers")})},V.validateId=function(Ze){if(!Ze)throw new Error("id is required");if(["string","number"].indexOf(typeof Ze)===-1)throw new Error("id must be a number or a string")}});function G_(B,V,W){if(B!==null)for(var K,te,le,ue,ye,be,Te,Fe,Le=0,We=0,et=B.type,Ze=et==="FeatureCollection",ot=et==="Feature",Ke=Ze?B.features.length:1,Bt=0;Btbe||Ze>Te||ot>Fe)return ye=Le,be=K,Te=Ze,Fe=ot,void(le=0);var Ke=ah.lineString([ye,Le],W.properties);if(V(Ke,K,te,ot,le)===!1)return!1;le++,ye=Le})!==!1&&void 0}}})}function py(B,V){if(!B)throw new Error("geojson is required");tS(B,function(W,K,te){if(W.geometry!==null){var le=W.geometry.type,ue=W.geometry.coordinates;switch(le){case"LineString":if(V(W,K,te,0,0)===!1)return!1;break;case"Polygon":for(var ye=0;yeW[0]&&(V[0]=W[0]),V[1]>W[1]&&(V[1]=W[1]),V[2] line1 must only contain 2 coordinates");if(K.length!==2)throw new Error(" line2 must only contain 2 coordinates");var te=W[0][0],le=W[0][1],ue=W[1][0],ye=W[1][1],be=K[0][0],Te=K[0][1],Fe=K[1][0],Le=K[1][1],We=(Le-Te)*(ue-te)-(Fe-be)*(ye-le),et=(Fe-be)*(le-Te)-(Le-Te)*(te-be),Ze=(ue-te)*(le-Te)-(ye-le)*(te-be);if(We===0)return null;var ot=et/We,Ke=Ze/We;return ot>=0&&ot<=1&&Ke>=0&&Ke<=1?w([te+ot*(ue-te),le+ot*(ye-le)]):null}function dp(B,V,W){W===void 0&&(W={});var K=w([1/0,1/0],{dist:1/0}),te=0;return ut(B,function(le){for(var ue=ne(le),ye=0;ye0&&((Ke=ot.features[0]).properties.dist=St(V,Ke,W),Ke.properties.location=te+St(be,Ke,W)),be.properties.dist180?-360:K[0]-te[0]>180?360:0,J(function(le,ue,ye){var be=ye=ye===void 0?f:Number(ye),Te=le[1]*Math.PI/180,Fe=ue[1]*Math.PI/180,Le=Fe-Te,We=Math.abs(ue[0]-le[0])*Math.PI/180;We>Math.PI&&(We-=2*Math.PI);var et=Math.log(Math.tan(Fe/2+Math.PI/4)/Math.tan(Te/2+Math.PI/4)),Ze=Math.abs(et)>1e-11?Le/et:Math.cos(Te);return Math.sqrt(Le*Le+Ze*Ze*We*We)*be}(K,te),"meters",W.units)}function Ib(B,V,W){if(W===void 0&&(W={}),W.method||(W.method="geodesic"),W.units||(W.units="kilometers"),!B)throw new Error("pt is required");if(Array.isArray(B)?B=w(B):B.type==="Point"?B=x(B):ae(B,"Point","point"),!V)throw new Error("line is required");Array.isArray(V)?V=S(V):V.type==="LineString"?V=x(V):ae(V,"LineString","line");var K=1/0,te=B.geometry.coordinates;return Pt(V,function(le){var ue=le.geometry.coordinates[0],ye=le.geometry.coordinates[1],be=function(Te,Fe,Le,We){var et=[Le[0]-Fe[0],Le[1]-Fe[1]],Ze=vc([Te[0]-Fe[0],Te[1]-Fe[1]],et);if(Ze<=0)return jC(Te,Fe,{method:We.method,units:"degrees"});var ot=vc(et,et);if(ot<=Ze)return jC(Te,Le,{method:We.method,units:"degrees"});var Ke=Ze/ot,Bt=[Fe[0]+Ke*et[0],Fe[1]+Ke*et[1]];return jC(Te,Bt,{method:We.method,units:"degrees"})}(te,ue,ye,W);be=0&&Te<=1&&(We.onLine1=!0),Fe>=0&&Fe<=1&&(We.onLine2=!0),!(!We.onLine1||!We.onLine2)&&[We.x,We.y])}function kA(B){for(var V=function(We){return We.type!=="FeatureCollection"?We.type!=="Feature"?I([x(We)]):I([We]):We}(B),W=Hs(V),K=!1,te=0;!K&&te0){V+=Math.abs(xx(B[0]));for(var W=1;W2){for(ue=0;ue=Fe&&Le===te.length-1);Le++){if(Fe>V&&le.length===0){if(!(ue=V-Fe))return le.push(te[Le]),S(le);ye=fu(te[Le],te[Le-1])-180,be=rs(te[Le],ue,ye,K),le.push(be.geometry.coordinates)}if(Fe>=W)return(ue=W-Fe)?(ye=fu(te[Le],te[Le-1])-180,be=rs(te[Le],ue,ye,K),le.push(be.geometry.coordinates),S(le)):(le.push(te[Le]),S(le));if(Fe>=V&&le.push(te[Le]),Le===te.length-1)return S(le);Fe+=St(te[Le],te[Le+1],K)}if(Fete)return!1}else if(et!==0)return!1;return K?K==="start"?Math.abs(Le)>=Math.abs(We)?Le>0?ye0?be=Math.abs(We)?Le>0?ye<=le&&le0?be<=ue&&ue=Math.abs(We)?Le>0?ye0?be=Math.abs(We)?Le>0?ye<=le&&le<=Te:Te<=le&&le<=ye:We>0?be<=ue&&ue<=Fe:Fe<=ue&&ue<=be}function Z0(B,V){var W=de(B),K=de(V),te=W.type,le=K.type;switch(te){case"Point":switch(le){case"MultiPoint":return function(ue,ye){var be,Te=!1;for(be=0;beV[0])&&!(B[2]V[1])&&!(B[3] is required");if(typeof W!="number")throw new Error(" must be a number");if(typeof K!="number")throw new Error(" must be a number");te!==!1&&te!==void 0||(B=JSON.parse(JSON.stringify(B)));var le=Math.pow(10,W);return ce(B,function(ue){(function(ye,be,Te){ye.length>Te&&ye.splice(Te,ye.length);for(var Fe=0;Fe=1||Ft<=0||zt>=1||zt<=0))){var Dr=rn,mn=!le[Dr];mn&&(le[Dr]=!0),V?te.push(V(rn,Ke,Bt,oi,qt,Ft,gi,rt,Fr,Cr,zt,mn)):te.push(rn)}}function ot(Ke,Bt){var gi,rt,Ft,zt,oi=K[Ke][Bt],qt=K[Ke][Bt+1];return oi[0]=0==V}function yG(B){for(var V=0,W=0;W1&&W.push(S(Te)),I(W)}function HA(B,V){if(!V.features.length)throw new Error("lines must contain features");if(V.features.length===1)return V.features[0];var W,K=1/0;return De(V,function(te){var le=dp(te,B).properties.dist;leFe&&We.push(rs(B,V,Fe,te).geometry.coordinates),S(We,be)}function Eg(B){var V=B%360;return V<0&&(V+=360),V}function Tg(B,V){V===void 0&&(V={});var W=de(B);switch(V.properties||B.type!=="Feature"||(V.properties=B.properties),W.type){case"Polygon":return QP(W,V);case"MultiPolygon":return function(K,te){te===void 0&&(te={});var le=de(K).coordinates,ue=te.properties?te.properties:K.type==="Feature"?K.properties:{},ye=[];return le.forEach(function(be){ye.push(Ob(be,ue))}),I(ye)}(W,V);default:throw new Error("invalid poly")}}function QP(B,V){return V===void 0&&(V={}),Ob(de(B).coordinates,V.properties?V.properties:B.type==="Feature"?B.properties:{})}function Ob(B,V){return B.length>1?P(B,V):S(B[0],V)}function vk(B,V){var W,K,te;V===void 0&&(V={});var le=V.properties,ue=(W=V.autoComplete)===null||W===void 0||W,ye=(K=V.orderCoords)===null||K===void 0||K;switch((te=V.mutate)!==null&&te!==void 0&&te||(B=ln(B)),B.type){case"FeatureCollection":var be=[];return B.features.forEach(function(Te){be.push(ne(yk(Te,{},ue,ye)))}),L(be,le);default:return yk(B,le,ue,ye)}}function yk(B,V,W,K){V=V||(B.type==="Feature"?B.properties:{});var te=de(B),le=te.coordinates,ue=te.type;if(!le.length)throw new Error("line must contain coordinates");switch(ue){case"LineString":return W&&(le=xk(le)),E([le],V);case"MultiLineString":var ye=[],be=0;return le.forEach(function(Te){if(W&&(Te=xk(Te)),K){var Fe=function(Le){var We=Le[0],et=Le[1],Ze=Le[2],ot=Le[3];return Math.abs(We-Ze)*Math.abs(et-ot)}(gt(S(Te)));Fe>be?(ye.unshift(Te),be=Fe):ye.push(Te)}else ye.push(Te)}),E(ye,V);default:throw new Error("geometry type "+ue+" is not supported")}}function xk(B){var V=B[0],W=V[0],K=V[1],te=B[B.length-1],le=te[0],ue=te[1];return W===le&&K===ue||B.push(V),B}function xG(B,V){var W,K,te,le,ue,ye,be;for(K=1;K<=8;K*=2){for(W=[],le=!(qC(te=B[B.length-1],V)&K),ue=0;ueV[2]&&(W|=2),B[1]V[3]&&(W|=8),W}function hS(B,V){for(var W=[],K=0,te=B;K0&&(le[0][0]===le[le.length-1][0]&&le[0][1]===le[le.length-1][1]||le.push(le[0]),le.length>=4&&W.push(le))}return W}Db.prototype.interpolate=function(B){var V=Math.sin((1-B)*this.g)/Math.sin(this.g),W=Math.sin(B*this.g)/Math.sin(this.g),K=V*Math.cos(this.start.y)*Math.cos(this.start.x)+W*Math.cos(this.end.y)*Math.cos(this.end.x),te=V*Math.cos(this.start.y)*Math.sin(this.start.x)+W*Math.cos(this.end.y)*Math.sin(this.end.x),le=V*Math.sin(this.start.y)+W*Math.sin(this.end.y),ue=xf*Math.atan2(le,Math.sqrt(Math.pow(K,2)+Math.pow(te,2)));return[xf*Math.atan2(te,K),ue]},Db.prototype.Arc=function(B,V){var W=[];if(!B||B<=2)W.push([this.start.lon,this.start.lat]),W.push([this.end.lon,this.end.lat]);else for(var K=1/(B-1),te=0;teWe&&(ot>Fe&&ZeFe&&otbe&&(be=Ke)}var Bt=[];if(ye&&be0&&Math.abs(Ft-W[rt-1][0])>We){var zt=parseFloat(W[rt-1][0]),oi=parseFloat(W[rt-1][1]),qt=parseFloat(W[rt][0]),Fr=parseFloat(W[rt][1]);if(zt>-180&&zt-180&&W[rt-1][0]Fe&&zt<180&&qt===-180&&rt+1Fe&&W[rt-1][0]<180){gi.push([180,W[rt][1]]),rt++,gi.push([W[rt][0],W[rt][1]]);continue}if(ztFe){var Cr=zt;zt=qt,qt=Cr;var rn=oi;oi=Fr,Fr=rn}if(zt>Fe&&qt=180&&ztFe?180:-180,mn]),(gi=[]).push([W[rt-1][0]>Fe?-180:180,mn]),Bt.push(gi)}else gi=[],Bt.push(gi);gi.push([Ft,W[rt][1]])}else gi.push([W[rt][0],W[rt][1]])}}else{var Lr=[];Bt.push(Lr);for(var Rr=0;Rr=0;Le--)if(et[Le]!=Ze[Le])return!1;for(Le=et.length-1;Le>=0;Le--)if(We=et[Le],!W(be[We],Te[We],Fe))return!1;return typeof be==typeof Te}(le,ue,ye))};function K(le){return le==null}function te(le){return!(!le||typeof le!="object"||typeof le.length!="number")&&typeof le.copy=="function"&&typeof le.slice=="function"&&!(le.length>0&&typeof le[0]!="number")}});function ZP(B,V,W){if(W===void 0&&(W={}),!Q(W=W||{}))throw new Error("options is invalid");var K,te=W.tolerance||0,le=[],ue=yx(),ye=dy(B);return ue.load(ye),Pt(V,function(be){var Te=!1;be&&(De(ue.search(be),function(Fe){if(Te===!1){var Le=ne(be).sort(),We=ne(Fe).sort();my(Le,We)||(te===0?Ag(Le[0],Fe)&&Ag(Le[1],Fe):dp(Fe,Le[0]).properties.dist<=te&&dp(Fe,Le[1]).properties.dist<=te)?(Te=!0,K=K?u0(K,be):be):(te===0?Ag(We[0],be)&&Ag(We[1],be):dp(be,We[0]).properties.dist<=te&&dp(be,We[1]).properties.dist<=te)&&(K=K?u0(K,Fe):Fe)}}),Te===!1&&K&&(le.push(K),K=void 0))}),K&&le.push(K),I(le)}function u0(B,V){var W=ne(V),K=ne(B),te=K[0],le=K[K.length-1],ue=B.geometry.coordinates;return my(W[0],te)?ue.unshift(W[1]):my(W[0],le)?ue.push(W[1]):my(W[1],te)?ue.unshift(W[0]):my(W[1],le)&&ue.push(W[0]),B}function pu(B){var V=B%360;return V<0&&(V+=360),V}function Nb(B,V,W){var K;return W===void 0&&(W={}),(K=W.final?Ck(re(V),re(B)):Ck(re(B),re(V)))>180?-(360-K):K}function Ck(B,V){var W=q(B[1]),K=q(V[1]),te=q(V[0]-B[0]);te>Math.PI&&(te-=2*Math.PI),te<-Math.PI&&(te+=2*Math.PI);var le=Math.log(Math.tan(K/2+Math.PI/4)/Math.tan(W/2+Math.PI/4));return(j(Math.atan2(te,le))+360)%360}function dS(B,V,W,K){K===void 0&&(K={});var te=V<0,le=J(Math.abs(V),K.units,"meters");te&&(le=-Math.abs(le));var ue=re(B),ye=function(be,Te,Fe,Le){Le=Le===void 0?f:Number(Le);var We=Te/Le,et=be[0]*Math.PI/180,Ze=q(be[1]),ot=q(Fe),Ke=We*Math.cos(ot),Bt=Ze+Ke;Math.abs(Bt)>Math.PI/2&&(Bt=Bt>0?Math.PI-Bt:-Math.PI-Bt);var gi=Math.log(Math.tan(Bt/2+Math.PI/4)/Math.tan(Ze/2+Math.PI/4)),rt=Math.abs(gi)>1e-11?Ke/gi:Math.cos(Ze),Ft=We*Math.sin(ot)/rt;return[(180*(et+Ft)/Math.PI+540)%360-180,180*Bt/Math.PI]}(ue,le,W);return ye[0]+=ye[0]-ue[0]>180?-360:ue[0]-ye[0]>180?360:0,w(ye,K.properties)}function Fb(B,V,W,K,te,le){for(var ue=0;ue0?$P(V,ye,te)<0||(te=ye):W>0&&K<=0&&(bk(V,ye,le)||(le=ye)),W=K}return[te,le]}function bk(B,V,W){return $P(B,V,W)>0}function $P(B,V,W){return(V[0]-B[0])*(W[1]-B[1])-(W[0]-B[0])*(V[1]-B[1])}function uL(B){for(var V,W,K=ne(B),te=0,le=1;le0}function cL(B,V){switch(B.type==="Feature"?B.geometry.type:B.type){case"GeometryCollection":return Xe(B,function(W){cL(W,V)}),B;case"LineString":return wk(ne(B),V),B;case"Polygon":return Cx(ne(B),V),B;case"MultiLineString":return ne(B).forEach(function(W){wk(W,V)}),B;case"MultiPolygon":return ne(B).forEach(function(W){Cx(W,V)}),B;case"Point":case"MultiPoint":return B}}function wk(B,V){uL(B)===V&&B.reverse()}function Cx(B,V){uL(B[0])!==V&&B[0].reverse();for(var W=1;WKe?128:64,rt|=ztKe?32:16,rt|=oiKe?8:4;var Fr=+(rt|=qtKe?2:1),Cr=0;if(rt===17||rt===18||rt===33||rt===34||rt===38||rt===68||rt===72||rt===98||rt===102||rt===132||rt===136||rt===137||rt===152||rt===153){var rn=(Ft+zt+oi+qt)/4;Cr=rn>Ke?2:rn0?(rt=156,Cr=4):rt=152:rt===33?Cr>0?(rt=139,Cr=4):rt=137:rt===72?Cr>0?(rt=99,Cr=4):rt=98:rt===132&&(Cr>0?(rt=39,Cr=4):rt=38)}if(rt!=0&&rt!=170){var Dr,mn,Lr,Rr,Tr,nn,on,hn;Dr=mn=Lr=Rr=Tr=nn=on=hn=.5;var nr=[];rt===1?(Lr=1-ri(Le,oi,qt),hn=1-ri(Le,Ft,qt),nr.push(Ca[rt])):rt===169?(Lr=ri(Ke,qt,oi),hn=ri(Ke,qt,Ft),nr.push(Ca[rt])):rt===4?(nn=1-ri(Le,zt,oi),Rr=ri(Le,qt,oi),nr.push(Qo[rt])):rt===166?(nn=ri(Ke,oi,zt),Rr=1-ri(Ke,oi,qt),nr.push(Qo[rt])):rt===16?(Tr=ri(Le,oi,zt),mn=ri(Le,Ft,zt),nr.push(Yo[rt])):rt===154?(Tr=1-ri(Ke,zt,oi),mn=1-ri(Ke,zt,Ft),nr.push(Yo[rt])):rt===64?(on=ri(Le,qt,Ft),Dr=1-ri(Le,zt,Ft),nr.push(Ka[rt])):rt===106?(on=1-ri(Ke,Ft,qt),Dr=ri(Ke,Ft,zt),nr.push(Ka[rt])):rt===168?(Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),nr.push(Ya[rt]),nr.push(Ca[rt])):rt===2?(Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),nr.push(Ya[rt]),nr.push(Ca[rt])):rt===162?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),nr.push(Ya[rt]),nr.push(Ca[rt])):rt===8?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===138?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===32?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===42?(hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt),nr.push(Es[rt]),nr.push(Ka[rt])):rt===128&&(hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft),nr.push(Es[rt]),nr.push(Ka[rt])),rt===5?(nn=1-ri(Le,zt,oi),hn=1-ri(Le,Ft,qt),nr.push(Qo[rt])):rt===165?(nn=ri(Ke,oi,zt),hn=ri(Ke,qt,Ft),nr.push(Qo[rt])):rt===20?(Rr=ri(Le,qt,oi),mn=ri(Le,Ft,zt),nr.push(Ya[rt])):rt===150?(Rr=1-ri(Ke,oi,qt),mn=1-ri(Ke,zt,Ft),nr.push(Ya[rt])):rt===80?(Tr=ri(Le,oi,zt),on=ri(Le,qt,Ft),nr.push(Yo[rt])):rt===90?(Tr=1-ri(Ke,zt,oi),on=1-ri(Ke,Ft,qt),nr.push(Yo[rt])):rt===65?(Lr=1-ri(Le,oi,qt),Dr=1-ri(Le,zt,Ft),nr.push(Ca[rt])):rt===105?(Lr=ri(Ke,qt,oi),Dr=ri(Ke,Ft,zt),nr.push(Ca[rt])):rt===160?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===10?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===130?(Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft),nr.push(Ya[rt]),nr.push(Ca[rt])):rt===40?(Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt),nr.push(Ya[rt]),nr.push(Ca[rt])):rt===101?(nn=ri(Ke,oi,zt),Dr=ri(Ke,Ft,zt),nr.push(Qo[rt])):rt===69?(nn=1-ri(Le,zt,oi),Dr=1-ri(Le,zt,Ft),nr.push(Qo[rt])):rt===149?(hn=ri(Ke,qt,Ft),mn=1-ri(Ke,zt,Ft),nr.push(Es[rt])):rt===21?(hn=1-ri(Le,Ft,qt),mn=ri(Le,Ft,zt),nr.push(Es[rt])):rt===86?(Rr=1-ri(Ke,oi,qt),on=1-ri(Ke,Ft,qt),nr.push(Ya[rt])):rt===84?(Rr=ri(Le,qt,oi),on=ri(Le,qt,Ft),nr.push(Ya[rt])):rt===89?(Tr=1-ri(Ke,zt,oi),Lr=ri(Ke,qt,oi),nr.push(Ca[rt])):rt===81?(Tr=ri(Le,oi,zt),Lr=1-ri(Le,oi,qt),nr.push(Ca[rt])):rt===96?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),on=ri(Le,qt,Ft),Dr=ri(Ke,Ft,zt),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===74?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),on=1-ri(Ke,Ft,qt),Dr=1-ri(Le,zt,Ft),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===24?(Tr=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),mn=ri(Le,Ft,zt),nr.push(Yo[rt]),nr.push(Ca[rt])):rt===146?(Tr=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),mn=1-ri(Ke,zt,Ft),nr.push(Yo[rt]),nr.push(Ca[rt])):rt===6?(nn=1-ri(Le,zt,oi),Rr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),nr.push(Qo[rt]),nr.push(Ya[rt])):rt===164?(nn=ri(Ke,oi,zt),Rr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),nr.push(Qo[rt]),nr.push(Ya[rt])):rt===129?(Lr=1-ri(Le,oi,qt),hn=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft),nr.push(Ca[rt]),nr.push(Es[rt])):rt===41?(Lr=ri(Ke,qt,oi),hn=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt),nr.push(Ca[rt]),nr.push(Es[rt])):rt===66?(Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),on=1-ri(Ke,Ft,qt),Dr=1-ri(Le,zt,Ft),nr.push(Ya[rt]),nr.push(Ca[rt])):rt===104?(Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),on=ri(Le,qt,Ft),Dr=ri(Ke,Ft,zt),nr.push(Ca[rt]),nr.push(ys[rt])):rt===144?(Tr=ri(Le,oi,zt),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),mn=1-ri(Ke,zt,Ft),nr.push(Yo[rt]),nr.push(Ka[rt])):rt===26?(Tr=1-ri(Ke,zt,oi),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),mn=ri(Le,Ft,zt),nr.push(Yo[rt]),nr.push(Ka[rt])):rt===36?(nn=ri(Ke,oi,zt),Rr=ri(Le,qt,oi),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt),nr.push(Qo[rt]),nr.push(Ya[rt])):rt===134?(nn=1-ri(Le,zt,oi),Rr=1-ri(Ke,oi,qt),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft),nr.push(Qo[rt]),nr.push(Ya[rt])):rt===9?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Lr=ri(Ke,qt,oi),hn=1-ri(Le,Ft,qt),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===161?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Lr=1-ri(Le,oi,qt),hn=ri(Ke,qt,Ft),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===37?(nn=ri(Ke,oi,zt),hn=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt),nr.push(Qo[rt]),nr.push(Es[rt])):rt===133?(nn=1-ri(Le,zt,oi),hn=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft),nr.push(Qo[rt]),nr.push(Es[rt])):rt===148?(Rr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),mn=1-ri(Ke,zt,Ft),nr.push(Ya[rt]),nr.push(Ka[rt])):rt===22?(Rr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),mn=ri(Le,Ft,zt),nr.push(Ya[rt]),nr.push(Ka[rt])):rt===82?(Tr=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),on=1-ri(Ke,Ft,qt),nr.push(Yo[rt]),nr.push(Ca[rt])):rt===88?(Tr=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),on=ri(Le,qt,Ft),nr.push(Yo[rt]),nr.push(Ca[rt])):rt===73?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Lr=ri(Ke,qt,oi),Dr=1-ri(Le,zt,Ft),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===97?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Lr=1-ri(Le,oi,qt),Dr=ri(Ke,Ft,zt),nr.push(Yo[rt]),nr.push(Qo[rt])):rt===145?(Tr=ri(Le,oi,zt),Lr=1-ri(Le,oi,qt),hn=ri(Ke,qt,Ft),mn=1-ri(Ke,zt,Ft),nr.push(Yo[rt]),nr.push(Es[rt])):rt===25?(Tr=1-ri(Ke,zt,oi),Lr=ri(Ke,qt,oi),hn=1-ri(Le,Ft,qt),mn=ri(Le,Ft,zt),nr.push(Yo[rt]),nr.push(Es[rt])):rt===70?(nn=1-ri(Le,zt,oi),Rr=1-ri(Ke,oi,qt),on=1-ri(Ke,Ft,qt),Dr=1-ri(Le,zt,Ft),nr.push(Qo[rt]),nr.push(Ya[rt])):rt===100?(nn=ri(Ke,oi,zt),Rr=ri(Le,qt,oi),on=ri(Le,qt,Ft),Dr=ri(Ke,Ft,zt),nr.push(Qo[rt]),nr.push(Ya[rt])):rt===34?(Cr===0?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft)):(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt)),nr.push(Yo[rt]),nr.push(Qo[rt]),nr.push(Es[rt]),nr.push(Ka[rt])):rt===35?(Cr===4?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft)):(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt)),nr.push(Yo[rt]),nr.push(Qo[rt]),nr.push(Ca[rt]),nr.push(Ka[rt])):rt===136?(Cr===0?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt)):(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft)),nr.push(Yo[rt]),nr.push(Qo[rt]),nr.push(Es[rt]),nr.push(Ka[rt])):rt===153?(Cr===0?(Tr=ri(Le,oi,zt),Lr=1-ri(Le,oi,qt),hn=1-ri(Le,Ft,qt),mn=ri(Le,Ft,zt)):(Tr=1-ri(Ke,zt,oi),Lr=ri(Ke,qt,oi),hn=ri(Ke,qt,Ft),mn=1-ri(Ke,zt,Ft)),nr.push(Yo[rt]),nr.push(Ca[rt])):rt===102?(Cr===0?(nn=1-ri(Le,zt,oi),Rr=ri(Le,qt,oi),on=ri(Le,qt,Ft),Dr=1-ri(Le,zt,Ft)):(nn=ri(Ke,oi,zt),Rr=1-ri(Ke,oi,qt),on=1-ri(Ke,Ft,qt),Dr=ri(Ke,Ft,zt)),nr.push(Qo[rt]),nr.push(Ka[rt])):rt===155?(Cr===4?(Tr=ri(Le,oi,zt),Lr=1-ri(Le,oi,qt),hn=1-ri(Le,Ft,qt),mn=ri(Le,Ft,zt)):(Tr=1-ri(Ke,zt,oi),Lr=ri(Ke,qt,oi),hn=ri(Ke,qt,Ft),mn=1-ri(Ke,zt,Ft)),nr.push(Yo[rt]),nr.push(Es[rt])):rt===103?(Cr===4?(nn=1-ri(Le,zt,oi),Rr=ri(Le,qt,oi),on=ri(Le,qt,Ft),Dr=1-ri(Le,zt,Ft)):(nn=ri(Ke,oi,zt),Rr=1-ri(Ke,oi,qt),on=1-ri(Ke,Ft,qt),Dr=ri(Ke,Ft,zt)),nr.push(Qo[rt]),nr.push(Ya[rt])):rt===152?(Cr===0?(Tr=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),mn=ri(Le,Ft,zt)):(Tr=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),mn=1-ri(Ke,zt,Ft)),nr.push(Yo[rt]),nr.push(Ya[rt]),nr.push(Ca[rt])):rt===156?(Cr===4?(Tr=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),mn=ri(Le,Ft,zt)):(Tr=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),mn=1-ri(Ke,zt,Ft)),nr.push(Yo[rt]),nr.push(Ca[rt]),nr.push(Ka[rt])):rt===137?(Cr===0?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Lr=1-ri(Le,oi,qt),hn=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt)):(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Lr=ri(Ke,qt,oi),hn=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft)),nr.push(Yo[rt]),nr.push(Qo[rt]),nr.push(Ca[rt])):rt===139?(Cr===4?(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Lr=1-ri(Le,oi,qt),hn=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt)):(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Lr=ri(Ke,qt,oi),hn=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft)),nr.push(Yo[rt]),nr.push(Qo[rt]),nr.push(Es[rt])):rt===98?(Cr===0?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),on=ri(Le,qt,Ft),Dr=1-ri(Le,zt,Ft)):(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),on=1-ri(Ke,Ft,qt),Dr=ri(Ke,Ft,zt)),nr.push(Yo[rt]),nr.push(Qo[rt]),nr.push(Ka[rt])):rt===99?(Cr===4?(Tr=1-ri(Le,zt,oi),nn=1-ri(Ke,zt,oi),Rr=ri(Ke,qt,oi),Lr=ri(Le,qt,oi),on=ri(Le,qt,Ft),Dr=1-ri(Le,zt,Ft)):(Tr=ri(Ke,oi,zt),nn=ri(Le,oi,zt),Rr=1-ri(Le,oi,qt),Lr=1-ri(Ke,oi,qt),on=1-ri(Ke,Ft,qt),Dr=ri(Ke,Ft,zt)),nr.push(Yo[rt]),nr.push(Qo[rt]),nr.push(Ca[rt])):rt===38?(Cr===0?(nn=1-ri(Le,zt,oi),Rr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft)):(nn=ri(Ke,oi,zt),Rr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt)),nr.push(Qo[rt]),nr.push(Es[rt]),nr.push(Ka[rt])):rt===39?(Cr===4?(nn=1-ri(Le,zt,oi),Rr=ri(Le,qt,oi),hn=ri(Le,qt,Ft),on=ri(Ke,qt,Ft),Dr=1-ri(Ke,zt,Ft),mn=1-ri(Le,zt,Ft)):(nn=ri(Ke,oi,zt),Rr=1-ri(Ke,oi,qt),hn=1-ri(Ke,Ft,qt),on=1-ri(Le,Ft,qt),Dr=ri(Le,Ft,zt),mn=ri(Ke,Ft,zt)),nr.push(Qo[rt]),nr.push(Ya[rt]),nr.push(Ka[rt])):rt===85&&(Tr=1,nn=0,Rr=1,Lr=0,hn=0,on=1,Dr=0,mn=1),(Dr<0||Dr>1||mn<0||mn>1||Tr<0||Tr>1||Rr<0||Rr>1||hn<0||hn>1||on<0||on>1)&&console.log("MarchingSquaresJS-isoBands: "+rt+" "+Fr+" "+Ft+","+zt+","+oi+","+qt+" "+Cr+" "+Dr+" "+mn+" "+Tr+" "+nn+" "+Rr+" "+Lr+" "+hn+" "+on),ot.cells[Bt][gi]={cval:rt,cval_real:Fr,flipped:Cr,topleft:Dr,topright:mn,righttop:Tr,rightbottom:nn,bottomright:Rr,bottomleft:Lr,leftbottom:hn,lefttop:on,edges:nr}}}}}return ot}(B,V,W);return UA.polygons?(UA.verbose&&console.log("MarchingSquaresJS-isoBands: returning single polygons for each grid cell"),be=function(Fe){var Le=[],We=0;return Fe.cells.forEach(function(et,Ze){et.forEach(function(ot,Ke){if(ot!==void 0){var Bt=Fo[ot.cval](ot);typeof Bt=="object"&&eI(Bt)?typeof Bt[0]=="object"&&eI(Bt[0])?typeof Bt[0][0]=="object"&&eI(Bt[0][0])?Bt.forEach(function(gi){gi.forEach(function(rt){rt[0]+=Ke,rt[1]+=Ze}),Le[We++]=gi}):(Bt.forEach(function(gi){gi[0]+=Ke,gi[1]+=Ze}),Le[We++]=Bt):console.log("MarchingSquaresJS-isoBands: bandcell polygon with malformed coordinates"):console.log("MarchingSquaresJS-isoBands: bandcell polygon with null coordinates")}})}),Le}(Te)):(UA.verbose&&console.log("MarchingSquaresJS-isoBands: returning polygon paths for entire data grid"),be=function(Fe){for(var Le=[],We=Fe.rows,et=Fe.cols,Ze=[],ot=0;ot0){var Bt=jA(Fe.cells[ot][Ke]),gi=null,rt=Ke,Ft=ot;Bt!==null&&Ze.push([Bt.p[0]+rt,Bt.p[1]+Ft]);do{if((gi=Ak(Fe.cells[Ft][rt],Bt.x,Bt.y,Bt.o))===null)break;if(Ze.push([gi.p[0]+rt,gi.p[1]+Ft]),rt+=gi.x,Bt=gi,(Ft+=gi.y)<0||Ft>=We||rt<0||rt>=et||Fe.cells[Ft][rt]===void 0){var zt=fL(Fe,rt-=gi.x,Ft-=gi.y,gi.x,gi.y,gi.o);if(zt===null)break;zt.path.forEach(function(oi){Ze.push(oi)}),rt=zt.i,Ft=zt.j,Bt=zt}}while(Fe.cells[Ft][rt]!==void 0&&Fe.cells[Ft][rt].edges.length>0);Le.push(Ze),Ze=[],Fe.cells[ot][Ke].edges.length>0&&Ke--}return Le}(Te)),typeof UA.successCallback=="function"&&UA.successCallback(be),be}var pm=64,jf=16,jl=[],Yl=[],ql=[],Xl=[],El=[],sl=[],Jl=[],Kl=[],Xs=[],Ql=[],Zl=[],$l=[],eu=[],tu=[],Ll=[],Rl=[],iu=[],ru=[],Tl=[],pl=[],ml=[],nu=[],Ol=[],ou=[];Jl[85]=Ql[85]=-1,Kl[85]=Zl[85]=0,Xs[85]=$l[85]=1,Tl[85]=nu[85]=1,pl[85]=Ol[85]=0,ml[85]=ou[85]=1,jl[85]=Xl[85]=0,Yl[85]=El[85]=-1,ql[85]=Ll[85]=0,Rl[85]=eu[85]=0,iu[85]=tu[85]=1,sl[85]=ru[85]=1,nu[1]=nu[169]=0,Ol[1]=Ol[169]=-1,ou[1]=ou[169]=0,eu[1]=eu[169]=-1,tu[1]=tu[169]=0,Ll[1]=Ll[169]=0,Ql[4]=Ql[166]=0,Zl[4]=Zl[166]=-1,$l[4]=$l[166]=1,Rl[4]=Rl[166]=1,iu[4]=iu[166]=0,ru[4]=ru[166]=0,Jl[16]=Jl[154]=0,Kl[16]=Kl[154]=1,Xs[16]=Xs[154]=1,Xl[16]=Xl[154]=1,El[16]=El[154]=0,sl[16]=sl[154]=1,Tl[64]=Tl[106]=0,pl[64]=pl[106]=1,ml[64]=ml[106]=0,jl[64]=jl[106]=-1,Yl[64]=Yl[106]=0,ql[64]=ql[106]=1,Tl[2]=Tl[168]=0,pl[2]=pl[168]=-1,ml[2]=ml[168]=1,nu[2]=nu[168]=0,Ol[2]=Ol[168]=-1,ou[2]=ou[168]=0,eu[2]=eu[168]=-1,tu[2]=tu[168]=0,Ll[2]=Ll[168]=0,Rl[2]=Rl[168]=-1,iu[2]=iu[168]=0,ru[2]=ru[168]=1,Jl[8]=Jl[162]=0,Kl[8]=Kl[162]=-1,Xs[8]=Xs[162]=0,Ql[8]=Ql[162]=0,Zl[8]=Zl[162]=-1,$l[8]=$l[162]=1,eu[8]=eu[162]=1,tu[8]=tu[162]=0,Ll[8]=Ll[162]=1,Rl[8]=Rl[162]=1,iu[8]=iu[162]=0,ru[8]=ru[162]=0,Jl[32]=Jl[138]=0,Kl[32]=Kl[138]=1,Xs[32]=Xs[138]=1,Ql[32]=Ql[138]=0,Zl[32]=Zl[138]=1,$l[32]=$l[138]=0,jl[32]=jl[138]=1,Yl[32]=Yl[138]=0,ql[32]=ql[138]=0,Xl[32]=Xl[138]=1,El[32]=El[138]=0,sl[32]=sl[138]=1,nu[128]=nu[42]=0,Ol[128]=Ol[42]=1,ou[128]=ou[42]=1,Tl[128]=Tl[42]=0,pl[128]=pl[42]=1,ml[128]=ml[42]=0,jl[128]=jl[42]=-1,Yl[128]=Yl[42]=0,ql[128]=ql[42]=1,Xl[128]=Xl[42]=-1,El[128]=El[42]=0,sl[128]=sl[42]=0,Ql[5]=Ql[165]=-1,Zl[5]=Zl[165]=0,$l[5]=$l[165]=0,nu[5]=nu[165]=1,Ol[5]=Ol[165]=0,ou[5]=ou[165]=0,Rl[20]=Rl[150]=0,iu[20]=iu[150]=1,ru[20]=ru[150]=1,Xl[20]=Xl[150]=0,El[20]=El[150]=-1,sl[20]=sl[150]=1,Jl[80]=Jl[90]=-1,Kl[80]=Kl[90]=0,Xs[80]=Xs[90]=1,Tl[80]=Tl[90]=1,pl[80]=pl[90]=0,ml[80]=ml[90]=1,eu[65]=eu[105]=0,tu[65]=tu[105]=1,Ll[65]=Ll[105]=0,jl[65]=jl[105]=0,Yl[65]=Yl[105]=-1,ql[65]=ql[105]=0,Jl[160]=Jl[10]=-1,Kl[160]=Kl[10]=0,Xs[160]=Xs[10]=1,Ql[160]=Ql[10]=-1,Zl[160]=Zl[10]=0,$l[160]=$l[10]=0,nu[160]=nu[10]=1,Ol[160]=Ol[10]=0,ou[160]=ou[10]=0,Tl[160]=Tl[10]=1,pl[160]=pl[10]=0,ml[160]=ml[10]=1,Rl[130]=Rl[40]=0,iu[130]=iu[40]=1,ru[130]=ru[40]=1,eu[130]=eu[40]=0,tu[130]=tu[40]=1,Ll[130]=Ll[40]=0,jl[130]=jl[40]=0,Yl[130]=Yl[40]=-1,ql[130]=ql[40]=0,Xl[130]=Xl[40]=0,El[130]=El[40]=-1,sl[130]=sl[40]=1,Ql[37]=Ql[133]=0,Zl[37]=Zl[133]=1,$l[37]=$l[133]=1,nu[37]=nu[133]=0,Ol[37]=Ol[133]=1,ou[37]=ou[133]=0,jl[37]=jl[133]=-1,Yl[37]=Yl[133]=0,ql[37]=ql[133]=0,Xl[37]=Xl[133]=1,El[37]=El[133]=0,sl[37]=sl[133]=0,Rl[148]=Rl[22]=-1,iu[148]=iu[22]=0,ru[148]=ru[22]=0,nu[148]=nu[22]=0,Ol[148]=Ol[22]=-1,ou[148]=ou[22]=1,Tl[148]=Tl[22]=0,pl[148]=pl[22]=1,ml[148]=ml[22]=1,Xl[148]=Xl[22]=-1,El[148]=El[22]=0,sl[148]=sl[22]=1,Jl[82]=Jl[88]=0,Kl[82]=Kl[88]=-1,Xs[82]=Xs[88]=1,Rl[82]=Rl[88]=1,iu[82]=iu[88]=0,ru[82]=ru[88]=1,eu[82]=eu[88]=-1,tu[82]=tu[88]=0,Ll[82]=Ll[88]=1,Tl[82]=Tl[88]=0,pl[82]=pl[88]=-1,ml[82]=ml[88]=0,Jl[73]=Jl[97]=0,Kl[73]=Kl[97]=1,Xs[73]=Xs[97]=0,Ql[73]=Ql[97]=0,Zl[73]=Zl[97]=-1,$l[73]=$l[97]=0,eu[73]=eu[97]=1,tu[73]=tu[97]=0,Ll[73]=Ll[97]=0,jl[73]=jl[97]=1,Yl[73]=Yl[97]=0,ql[73]=ql[97]=1,Jl[145]=Jl[25]=0,Kl[145]=Kl[25]=-1,Xs[145]=Xs[25]=0,eu[145]=eu[25]=1,tu[145]=tu[25]=0,Ll[145]=Ll[25]=1,nu[145]=nu[25]=0,Ol[145]=Ol[25]=1,ou[145]=ou[25]=1,Xl[145]=Xl[25]=-1,El[145]=El[25]=0,sl[145]=sl[25]=0,Ql[70]=Ql[100]=0,Zl[70]=Zl[100]=1,$l[70]=$l[100]=0,Rl[70]=Rl[100]=-1,iu[70]=iu[100]=0,ru[70]=ru[100]=1,Tl[70]=Tl[100]=0,pl[70]=pl[100]=-1,ml[70]=ml[100]=1,jl[70]=jl[100]=1,Yl[70]=Yl[100]=0,ql[70]=ql[100]=0,Ql[101]=Ql[69]=0,Zl[101]=Zl[69]=1,$l[101]=$l[69]=0,jl[101]=jl[69]=1,Yl[101]=Yl[69]=0,ql[101]=ql[69]=0,nu[149]=nu[21]=0,Ol[149]=Ol[21]=1,ou[149]=ou[21]=1,Xl[149]=Xl[21]=-1,El[149]=El[21]=0,sl[149]=sl[21]=0,Rl[86]=Rl[84]=-1,iu[86]=iu[84]=0,ru[86]=ru[84]=1,Tl[86]=Tl[84]=0,pl[86]=pl[84]=-1,ml[86]=ml[84]=1,Jl[89]=Jl[81]=0,Kl[89]=Kl[81]=-1,Xs[89]=Xs[81]=0,eu[89]=eu[81]=1,tu[89]=tu[81]=0,Ll[89]=Ll[81]=1,Jl[96]=Jl[74]=0,Kl[96]=Kl[74]=1,Xs[96]=Xs[74]=0,Ql[96]=Ql[74]=-1,Zl[96]=Zl[74]=0,$l[96]=$l[74]=1,Tl[96]=Tl[74]=1,pl[96]=pl[74]=0,ml[96]=ml[74]=0,jl[96]=jl[74]=1,Yl[96]=Yl[74]=0,ql[96]=ql[74]=1,Jl[24]=Jl[146]=0,Kl[24]=Kl[146]=-1,Xs[24]=Xs[146]=1,Rl[24]=Rl[146]=1,iu[24]=iu[146]=0,ru[24]=ru[146]=1,eu[24]=eu[146]=0,tu[24]=tu[146]=1,Ll[24]=Ll[146]=1,Xl[24]=Xl[146]=0,El[24]=El[146]=-1,sl[24]=sl[146]=0,Ql[6]=Ql[164]=-1,Zl[6]=Zl[164]=0,$l[6]=$l[164]=1,Rl[6]=Rl[164]=-1,iu[6]=iu[164]=0,ru[6]=ru[164]=0,nu[6]=nu[164]=0,Ol[6]=Ol[164]=-1,ou[6]=ou[164]=1,Tl[6]=Tl[164]=1,pl[6]=pl[164]=0,ml[6]=ml[164]=0,eu[129]=eu[41]=0,tu[129]=tu[41]=1,Ll[129]=Ll[41]=1,nu[129]=nu[41]=0,Ol[129]=Ol[41]=1,ou[129]=ou[41]=0,jl[129]=jl[41]=-1,Yl[129]=Yl[41]=0,ql[129]=ql[41]=0,Xl[129]=Xl[41]=0,El[129]=El[41]=-1,sl[129]=sl[41]=0,Rl[66]=Rl[104]=0,iu[66]=iu[104]=1,ru[66]=ru[104]=0,eu[66]=eu[104]=-1,tu[66]=tu[104]=0,Ll[66]=Ll[104]=1,Tl[66]=Tl[104]=0,pl[66]=pl[104]=-1,ml[66]=ml[104]=0,jl[66]=jl[104]=0,Yl[66]=Yl[104]=-1,ql[66]=ql[104]=1,Jl[144]=Jl[26]=-1,Kl[144]=Kl[26]=0,Xs[144]=Xs[26]=0,nu[144]=nu[26]=1,Ol[144]=Ol[26]=0,ou[144]=ou[26]=1,Tl[144]=Tl[26]=0,pl[144]=pl[26]=1,ml[144]=ml[26]=1,Xl[144]=Xl[26]=-1,El[144]=El[26]=0,sl[144]=sl[26]=1,Ql[36]=Ql[134]=0,Zl[36]=Zl[134]=1,$l[36]=$l[134]=1,Rl[36]=Rl[134]=0,iu[36]=iu[134]=1,ru[36]=ru[134]=0,jl[36]=jl[134]=0,Yl[36]=Yl[134]=-1,ql[36]=ql[134]=1,Xl[36]=Xl[134]=1,El[36]=El[134]=0,sl[36]=sl[134]=0,Jl[9]=Jl[161]=-1,Kl[9]=Kl[161]=0,Xs[9]=Xs[161]=0,Ql[9]=Ql[161]=0,Zl[9]=Zl[161]=-1,$l[9]=$l[161]=0,eu[9]=eu[161]=1,tu[9]=tu[161]=0,Ll[9]=Ll[161]=0,nu[9]=nu[161]=1,Ol[9]=Ol[161]=0,ou[9]=ou[161]=1,Jl[136]=0,Kl[136]=1,Xs[136]=1,Ql[136]=0,Zl[136]=1,$l[136]=0,Rl[136]=-1,iu[136]=0,ru[136]=1,eu[136]=-1,tu[136]=0,Ll[136]=0,nu[136]=0,Ol[136]=-1,ou[136]=0,Tl[136]=0,pl[136]=-1,ml[136]=1,jl[136]=1,Yl[136]=0,ql[136]=0,Xl[136]=1,El[136]=0,sl[136]=1,Jl[34]=0,Kl[34]=-1,Xs[34]=0,Ql[34]=0,Zl[34]=-1,$l[34]=1,Rl[34]=1,iu[34]=0,ru[34]=0,eu[34]=1,tu[34]=0,Ll[34]=1,nu[34]=0,Ol[34]=1,ou[34]=1,Tl[34]=0,pl[34]=1,ml[34]=0,jl[34]=-1,Yl[34]=0,ql[34]=1,Xl[34]=-1,El[34]=0,sl[34]=0,Jl[35]=0,Kl[35]=1,Xs[35]=1,Ql[35]=0,Zl[35]=-1,$l[35]=1,Rl[35]=1,iu[35]=0,ru[35]=0,eu[35]=-1,tu[35]=0,Ll[35]=0,nu[35]=0,Ol[35]=-1,ou[35]=0,Tl[35]=0,pl[35]=1,ml[35]=0,jl[35]=-1,Yl[35]=0,ql[35]=1,Xl[35]=1,El[35]=0,sl[35]=1,Jl[153]=0,Kl[153]=1,Xs[153]=1,eu[153]=-1,tu[153]=0,Ll[153]=0,nu[153]=0,Ol[153]=-1,ou[153]=0,Xl[153]=1,El[153]=0,sl[153]=1,Ql[102]=0,Zl[102]=-1,$l[102]=1,Rl[102]=1,iu[102]=0,ru[102]=0,Tl[102]=0,pl[102]=1,ml[102]=0,jl[102]=-1,Yl[102]=0,ql[102]=1,Jl[155]=0,Kl[155]=-1,Xs[155]=0,eu[155]=1,tu[155]=0,Ll[155]=1,nu[155]=0,Ol[155]=1,ou[155]=1,Xl[155]=-1,El[155]=0,sl[155]=0,Ql[103]=0,Zl[103]=1,$l[103]=0,Rl[103]=-1,iu[103]=0,ru[103]=1,Tl[103]=0,pl[103]=-1,ml[103]=1,jl[103]=1,Yl[103]=0,ql[103]=0,Jl[152]=0,Kl[152]=1,Xs[152]=1,Rl[152]=-1,iu[152]=0,ru[152]=1,eu[152]=-1,tu[152]=0,Ll[152]=0,nu[152]=0,Ol[152]=-1,ou[152]=0,Tl[152]=0,pl[152]=-1,ml[152]=1,Xl[152]=1,El[152]=0,sl[152]=1,Jl[156]=0,Kl[156]=-1,Xs[156]=1,Rl[156]=1,iu[156]=0,ru[156]=1,eu[156]=-1,tu[156]=0,Ll[156]=0,nu[156]=0,Ol[156]=-1,ou[156]=0,Tl[156]=0,pl[156]=1,ml[156]=1,Xl[156]=-1,El[156]=0,sl[156]=1,Jl[137]=0,Kl[137]=1,Xs[137]=1,Ql[137]=0,Zl[137]=1,$l[137]=0,eu[137]=-1,tu[137]=0,Ll[137]=0,nu[137]=0,Ol[137]=-1,ou[137]=0,jl[137]=1,Yl[137]=0,ql[137]=0,Xl[137]=1,El[137]=0,sl[137]=1,Jl[139]=0,Kl[139]=1,Xs[139]=1,Ql[139]=0,Zl[139]=-1,$l[139]=0,eu[139]=1,tu[139]=0,Ll[139]=0,nu[139]=0,Ol[139]=1,ou[139]=0,jl[139]=-1,Yl[139]=0,ql[139]=0,Xl[139]=1,El[139]=0,sl[139]=1,Jl[98]=0,Kl[98]=-1,Xs[98]=0,Ql[98]=0,Zl[98]=-1,$l[98]=1,Rl[98]=1,iu[98]=0,ru[98]=0,eu[98]=1,tu[98]=0,Ll[98]=1,Tl[98]=0,pl[98]=1,ml[98]=0,jl[98]=-1,Yl[98]=0,ql[98]=1,Jl[99]=0,Kl[99]=1,Xs[99]=0,Ql[99]=0,Zl[99]=-1,$l[99]=1,Rl[99]=1,iu[99]=0,ru[99]=0,eu[99]=-1,tu[99]=0,Ll[99]=1,Tl[99]=0,pl[99]=-1,ml[99]=0,jl[99]=1,Yl[99]=0,ql[99]=1,Ql[38]=0,Zl[38]=-1,$l[38]=1,Rl[38]=1,iu[38]=0,ru[38]=0,nu[38]=0,Ol[38]=1,ou[38]=1,Tl[38]=0,pl[38]=1,ml[38]=0,jl[38]=-1,Yl[38]=0,ql[38]=1,Xl[38]=-1,El[38]=0,sl[38]=0,Ql[39]=0,Zl[39]=1,$l[39]=1,Rl[39]=-1,iu[39]=0,ru[39]=0,nu[39]=0,Ol[39]=-1,ou[39]=1,Tl[39]=0,pl[39]=1,ml[39]=0,jl[39]=-1,Yl[39]=0,ql[39]=1,Xl[39]=1,El[39]=0,sl[39]=0;var gy=function(B){return[[B.bottomleft,0],[0,0],[0,B.leftbottom]]},GA=function(B){return[[1,B.rightbottom],[1,0],[B.bottomright,0]]},bx=function(B){return[[B.topright,1],[1,1],[1,B.righttop]]},c0=function(B){return[[0,B.lefttop],[0,1],[B.topleft,1]]},gN=function(B){return[[B.bottomright,0],[B.bottomleft,0],[0,B.leftbottom],[0,B.lefttop]]},hL=function(B){return[[B.bottomright,0],[B.bottomleft,0],[1,B.righttop],[1,B.rightbottom]]},dL=function(B){return[[1,B.righttop],[1,B.rightbottom],[B.topleft,1],[B.topright,1]]},WA=function(B){return[[0,B.leftbottom],[0,B.lefttop],[B.topleft,1],[B.topright,1]]},Yo=[],Qo=[],Ya=[],Ca=[],Es=[],Ka=[],ys=[],Nl=[];Ca[1]=Es[1]=18,Ca[169]=Es[169]=18,Ya[4]=Qo[4]=12,Ya[166]=Qo[166]=12,Yo[16]=Nl[16]=4,Yo[154]=Nl[154]=4,Ka[64]=ys[64]=22,Ka[106]=ys[106]=22,Ya[2]=Ka[2]=17,Ca[2]=Es[2]=18,Ya[168]=Ka[168]=17,Ca[168]=Es[168]=18,Yo[8]=Ca[8]=9,Qo[8]=Ya[8]=12,Yo[162]=Ca[162]=9,Qo[162]=Ya[162]=12,Yo[32]=Nl[32]=4,Qo[32]=ys[32]=1,Yo[138]=Nl[138]=4,Qo[138]=ys[138]=1,Es[128]=Nl[128]=21,Ka[128]=ys[128]=22,Es[42]=Nl[42]=21,Ka[42]=ys[42]=22,Qo[5]=Es[5]=14,Qo[165]=Es[165]=14,Ya[20]=Nl[20]=6,Ya[150]=Nl[150]=6,Yo[80]=Ka[80]=11,Yo[90]=Ka[90]=11,Ca[65]=ys[65]=3,Ca[105]=ys[105]=3,Yo[160]=Ka[160]=11,Qo[160]=Es[160]=14,Yo[10]=Ka[10]=11,Qo[10]=Es[10]=14,Ya[130]=Nl[130]=6,Ca[130]=ys[130]=3,Ya[40]=Nl[40]=6,Ca[40]=ys[40]=3,Qo[101]=ys[101]=1,Qo[69]=ys[69]=1,Es[149]=Nl[149]=21,Es[21]=Nl[21]=21,Ya[86]=Ka[86]=17,Ya[84]=Ka[84]=17,Yo[89]=Ca[89]=9,Yo[81]=Ca[81]=9,Yo[96]=ys[96]=0,Qo[96]=Ka[96]=15,Yo[74]=ys[74]=0,Qo[74]=Ka[74]=15,Yo[24]=Ya[24]=8,Ca[24]=Nl[24]=7,Yo[146]=Ya[146]=8,Ca[146]=Nl[146]=7,Qo[6]=Ka[6]=15,Ya[6]=Es[6]=16,Qo[164]=Ka[164]=15,Ya[164]=Es[164]=16,Ca[129]=Nl[129]=7,Es[129]=ys[129]=20,Ca[41]=Nl[41]=7,Es[41]=ys[41]=20,Ya[66]=ys[66]=2,Ca[66]=Ka[66]=19,Ya[104]=ys[104]=2,Ca[104]=Ka[104]=19,Yo[144]=Es[144]=10,Ka[144]=Nl[144]=23,Yo[26]=Es[26]=10,Ka[26]=Nl[26]=23,Qo[36]=Nl[36]=5,Ya[36]=ys[36]=2,Qo[134]=Nl[134]=5,Ya[134]=ys[134]=2,Yo[9]=Es[9]=10,Qo[9]=Ca[9]=13,Yo[161]=Es[161]=10,Qo[161]=Ca[161]=13,Qo[37]=Nl[37]=5,Es[37]=ys[37]=20,Qo[133]=Nl[133]=5,Es[133]=ys[133]=20,Ya[148]=Es[148]=16,Ka[148]=Nl[148]=23,Ya[22]=Es[22]=16,Ka[22]=Nl[22]=23,Yo[82]=Ya[82]=8,Ca[82]=Ka[82]=19,Yo[88]=Ya[88]=8,Ca[88]=Ka[88]=19,Yo[73]=ys[73]=0,Qo[73]=Ca[73]=13,Yo[97]=ys[97]=0,Qo[97]=Ca[97]=13,Yo[145]=Ca[145]=9,Es[145]=Nl[145]=21,Yo[25]=Ca[25]=9,Es[25]=Nl[25]=21,Qo[70]=ys[70]=1,Ya[70]=Ka[70]=17,Qo[100]=ys[100]=1,Ya[100]=Ka[100]=17,Yo[34]=Ca[34]=9,Qo[34]=Ya[34]=12,Es[34]=Nl[34]=21,Ka[34]=ys[34]=22,Yo[136]=Nl[136]=4,Qo[136]=ys[136]=1,Ya[136]=Ka[136]=17,Ca[136]=Es[136]=18,Yo[35]=Nl[35]=4,Qo[35]=Ya[35]=12,Ca[35]=Es[35]=18,Ka[35]=ys[35]=22,Yo[153]=Nl[153]=4,Ca[153]=Es[153]=18,Qo[102]=Ya[102]=12,Ka[102]=ys[102]=22,Yo[155]=Ca[155]=9,Es[155]=Nl[155]=23,Qo[103]=ys[103]=1,Ya[103]=Ka[103]=17,Yo[152]=Nl[152]=4,Ya[152]=Ka[152]=17,Ca[152]=Es[152]=18,Yo[156]=Ya[156]=8,Ca[156]=Es[156]=18,Ka[156]=Nl[156]=23,Yo[137]=Nl[137]=4,Qo[137]=ys[137]=1,Ca[137]=Es[137]=18,Yo[139]=Nl[139]=4,Qo[139]=Ca[139]=13,Es[139]=ys[139]=20,Yo[98]=Ca[98]=9,Qo[98]=Ya[98]=12,Ka[98]=ys[98]=22,Yo[99]=ys[99]=0,Qo[99]=Ya[99]=12,Ca[99]=Ka[99]=19,Qo[38]=Ya[38]=12,Es[38]=Nl[38]=21,Ka[38]=ys[38]=22,Qo[39]=Nl[39]=5,Ya[39]=Es[39]=16,Ka[39]=ys[39]=22;var Fo=[];function ri(B,V,W){return(B-V)/(W-V)}function eI(B){return B.constructor.toString().indexOf("Array")>-1}function fL(B,V,W,K,te,le){for(var ue=B.cells[W][V],ye=ue.cval_real,be=V+K,Te=W+te,Fe=[],Le=!1;!Le;){if(B.cells[Te]===void 0||B.cells[Te][be]===void 0)if(Te-=te,be-=K,ye=(ue=B.cells[Te][be]).cval_real,te===-1)if(le===0)if(1&ye)Fe.push([be,Te]),K=-1,te=0,le=0;else{if(!(4&ye)){Fe.push([be+ue.bottomright,Te]),K=0,te=1,le=1,Le=!0;break}Fe.push([be+1,Te]),K=1,te=0,le=0}else{if(!(1&ye)){if(4&ye){Fe.push([be+ue.bottomright,Te]),K=0,te=1,le=1,Le=!0;break}Fe.push([be+ue.bottomleft,Te]),K=0,te=1,le=0,Le=!0;break}Fe.push([be,Te]),K=-1,te=0,le=0}else if(te===1)if(le===0){if(!(ye&jf)){if(ye&pm){Fe.push([be+ue.topleft,Te+1]),K=0,te=-1,le=0,Le=!0;break}Fe.push([be+ue.topright,Te+1]),K=0,te=-1,le=1,Le=!0;break}Fe.push([be+1,Te+1]),K=1,te=0,le=1}else Fe.push([be+1,Te+1]),K=1,te=0,le=1;else if(K===-1)if(le===0){if(!(ye&pm)){if(1&ye){Fe.push([be,Te+ue.leftbottom]),K=1,te=0,le=0,Le=!0;break}Fe.push([be,Te+ue.lefttop]),K=1,te=0,le=1,Le=!0;break}Fe.push([be,Te+1]),K=0,te=1,le=0}else{if(!(ye&pm)){console.log("MarchingSquaresJS-isoBands: wtf");break}Fe.push([be,Te+1]),K=0,te=1,le=0}else{if(K!==1){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(le===0){if(!(4&ye)){Fe.push([be+1,Te+ue.rightbottom]),K=-1,te=0,le=0,Le=!0;break}Fe.push([be+1,Te]),K=0,te=-1,le=1}else{if(!(4&ye)){if(ye&jf){Fe.push([be+1,Te+ue.righttop]),K=-1,te=0,le=1;break}Fe.push([be+1,Te+ue.rightbottom]),K=-1,te=0,le=0,Le=!0;break}Fe.push([be+1,Te]),K=0,te=-1,le=1}}else if(ye=(ue=B.cells[Te][be]).cval_real,K===-1)if(le===0)if(B.cells[Te-1]!==void 0&&B.cells[Te-1][be]!==void 0)K=0,te=-1,le=1;else{if(!(1&ye)){Fe.push([be+ue.bottomright,Te]),K=0,te=1,le=1,Le=!0;break}Fe.push([be,Te])}else{if(!(ye&pm)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+be+","+Te);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(K===1){if(le===0){console.log("MarchingSquaresJS-isoBands: wtf");break}if(B.cells[Te+1]!==void 0&&B.cells[Te+1][be]!==void 0)K=0,te=1,le=0;else{if(!(ye&jf)){Fe.push([be+ue.topleft,Te+1]),K=0,te=-1,le=0,Le=!0;break}Fe.push([be+1,Te+1]),K=1,te=0,le=1}}else if(te===-1){if(le!==1){console.log("MarchingSquaresJS-isoBands: wtf");break}if(B.cells[Te][be+1]!==void 0)K=1,te=0,le=1;else{if(!(4&ye)){Fe.push([be+1,Te+ue.righttop]),K=-1,te=0,le=1,Le=!0;break}Fe.push([be+1,Te]),K=0,te=-1,le=1}}else{if(te!==1){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(le!==0){console.log("MarchingSquaresJS-isoBands: wtf");break}if(B.cells[Te][be-1]!==void 0)K=-1,te=0,le=0;else{if(!(ye&pm)){Fe.push([be,Te+ue.leftbottom]),K=1,te=0,le=0,Le=!0;break}Fe.push([be,Te+1]),K=0,te=1,le=0}}if(Te+=te,(be+=K)===V&&Te===W)break}return{path:Fe,i:be,j:Te,x:K,y:te,o:le}}function jA(B){if(B.edges.length>0){var V=B.edges[B.edges.length-1],W=B.cval_real;switch(V){case 0:return W&jf?{p:[1,B.righttop],x:-1,y:0,o:1}:{p:[B.topleft,1],x:0,y:-1,o:0};case 1:return 4&W?{p:[B.topleft,1],x:0,y:-1,o:0}:{p:[1,B.rightbottom],x:-1,y:0,o:0};case 2:return 4&W?{p:[B.bottomright,0],x:0,y:1,o:1}:{p:[B.topleft,1],x:0,y:-1,o:0};case 3:return 1&W?{p:[B.topleft,1],x:0,y:-1,o:0}:{p:[B.bottomleft,0],x:0,y:1,o:0};case 4:return W&jf?{p:[1,B.righttop],x:-1,y:0,o:1}:{p:[B.topright,1],x:0,y:-1,o:1};case 5:return 4&W?{p:[B.topright,1],x:0,y:-1,o:1}:{p:[1,B.rightbottom],x:-1,y:0,o:0};case 6:return 4&W?{p:[B.bottomright,0],x:0,y:1,o:1}:{p:[B.topright,1],x:0,y:-1,o:1};case 7:return 1&W?{p:[B.topright,1],x:0,y:-1,o:1}:{p:[B.bottomleft,0],x:0,y:1,o:0};case 8:return 4&W?{p:[B.bottomright,0],x:0,y:1,o:1}:{p:[1,B.righttop],x:-1,y:0,o:1};case 9:return 1&W?{p:[1,B.righttop],x:-1,y:0,o:1}:{p:[B.bottomleft,0],x:0,y:1,o:0};case 10:return 1&W?{p:[0,B.leftbottom],x:1,y:0,o:0}:{p:[1,B.righttop],x:-1,y:0,o:1};case 11:return W&pm?{p:[1,B.righttop],x:-1,y:0,o:1}:{p:[0,B.lefttop],x:1,y:0,o:1};case 12:return 4&W?{p:[B.bottomright,0],x:0,y:1,o:1}:{p:[1,B.rightbottom],x:-1,y:0,o:0};case 13:return 1&W?{p:[1,B.rightbottom],x:-1,y:0,o:0}:{p:[B.bottomleft,0],x:0,y:1,o:0};case 14:return 1&W?{p:[0,B.leftbottom],x:1,y:0,o:0}:{p:[1,B.rightbottom],x:-1,y:0,o:0};case 15:return W&pm?{p:[1,B.rightbottom],x:-1,y:0,o:0}:{p:[0,B.lefttop],x:1,y:0,o:1};case 16:return 4&W?{p:[B.bottomright,0],x:0,y:1,o:1}:{p:[0,B.leftbottom],x:1,y:0,o:0};case 17:return W&pm?{p:[B.bottomright,0],x:0,y:1,o:1}:{p:[0,B.lefttop],x:1,y:0,o:1};case 18:return 1&W?{p:[0,B.leftbottom],x:1,y:0,o:0}:{p:[B.bottomleft,0],x:0,y:1,o:0};case 19:return W&pm?{p:[B.bottomleft,0],x:0,y:1,o:0}:{p:[0,B.lefttop],x:1,y:0,o:1};case 20:return W&pm?{p:[B.topleft,1],x:0,y:-1,o:0}:{p:[0,B.leftbottom],x:1,y:0,o:0};case 21:return W&jf?{p:[0,B.leftbottom],x:1,y:0,o:0}:{p:[B.topright,1],x:0,y:-1,o:1};case 22:return W&pm?{p:[B.topleft,1],x:0,y:-1,o:0}:{p:[0,B.lefttop],x:1,y:0,o:1};case 23:return W&jf?{p:[0,B.lefttop],x:1,y:0,o:1}:{p:[B.topright,1],x:0,y:-1,o:1};default:console.log("MarchingSquaresJS-isoBands: edge index out of range!"),console.log(B)}}return null}function Ak(B,V,W,K){var te,le,ue,ye,be,Te=B.cval;switch(V){case-1:switch(K){case 0:te=Qo[Te],ue=Ql[Te],ye=Zl[Te],be=$l[Te];break;default:te=Yo[Te],ue=Jl[Te],ye=Kl[Te],be=Xs[Te]}break;case 1:switch(K){case 0:te=Es[Te],ue=nu[Te],ye=Ol[Te],be=ou[Te];break;default:te=Ka[Te],ue=Tl[Te],ye=pl[Te],be=ml[Te]}break;default:switch(W){case-1:switch(K){case 0:te=ys[Te],ue=jl[Te],ye=Yl[Te],be=ql[Te];break;default:te=Nl[Te],ue=Xl[Te],ye=El[Te],be=sl[Te]}break;case 1:switch(K){case 0:te=Ca[Te],ue=eu[Te],ye=tu[Te],be=Ll[Te];break;default:te=Ya[Te],ue=Rl[Te],ye=iu[Te],be=ru[Te]}}}if(le=B.edges.indexOf(te),B.edges[le]===void 0)return null;switch(function(Fe,Le){delete Fe.edges[Le];for(var We=Le+1;We0){var Fe=K[be-1],Le=Sk(Te,Fe);Le!==!1&&(Fe[1]=Le,Te[0]=Le),ue.push(Fe[0]),be===le.length-2&&(ue.push(Te[0]),ue.push(Te[1]))}le.length===2&&(ue.push(Te[0]),ue.push(Te[1]))}var We,et,Ze,ot,Ke,Bt,gi,rt}),S(ue,B.properties)}function YA(B,V,W){var K=V[0]-B[0],te=V[1]-B[1],le=W[0]-V[0];return function(ue){return(ue>0)-(ue<0)||+ue}(K*(W[1]-V[1])-le*te)}function Ik(B,V){return V.geometry.coordinates[0].every(function(W){return qe(w(W),B)})}Fo[1]=Fo[169]=gy,Fo[4]=Fo[166]=GA,Fo[16]=Fo[154]=bx,Fo[64]=Fo[106]=c0,Fo[168]=Fo[2]=gN,Fo[162]=Fo[8]=hL,Fo[138]=Fo[32]=dL,Fo[42]=Fo[128]=WA,Fo[5]=Fo[165]=function(B){return[[0,0],[0,B.leftbottom],[1,B.rightbottom],[1,0]]},Fo[20]=Fo[150]=function(B){return[[1,0],[B.bottomright,0],[B.topright,1],[1,1]]},Fo[80]=Fo[90]=function(B){return[[1,1],[1,B.righttop],[0,B.lefttop],[0,1]]},Fo[65]=Fo[105]=function(B){return[[B.bottomleft,0],[0,0],[0,1],[B.topleft,1]]},Fo[160]=Fo[10]=function(B){return[[1,B.righttop],[1,B.rightbottom],[0,B.leftbottom],[0,B.lefttop]]},Fo[130]=Fo[40]=function(B){return[[B.topleft,1],[B.topright,1],[B.bottomright,0],[B.bottomleft,0]]},Fo[85]=function(){return[[0,0],[0,1],[1,1],[1,0]]},Fo[101]=Fo[69]=function(B){return[[1,B.rightbottom],[1,0],[0,0],[0,1],[B.topleft,1]]},Fo[149]=Fo[21]=function(B){return[[B.topright,1],[1,1],[1,0],[0,0],[0,B.leftbottom]]},Fo[86]=Fo[84]=function(B){return[[1,0],[B.bottomright,0],[0,B.lefttop],[0,1],[1,1]]},Fo[89]=Fo[81]=function(B){return[[1,1],[1,B.righttop],[B.bottomleft,0],[0,0],[0,1]]},Fo[96]=Fo[74]=function(B){return[[1,B.righttop],[1,B.rightbottom],[0,B.lefttop],[0,1],[B.topleft,1]]},Fo[24]=Fo[146]=function(B){return[[1,1],[1,B.righttop],[B.bottomright,0],[B.bottomleft,0],[B.topright,1]]},Fo[6]=Fo[164]=function(B){return[[1,B.rightbottom],[1,0],[B.bottomright,0],[0,B.leftbottom],[0,B.lefttop]]},Fo[129]=Fo[41]=function(B){return[[B.topright,1],[B.bottomleft,0],[0,0],[0,B.leftbottom],[B.topleft,1]]},Fo[66]=Fo[104]=function(B){return[[B.bottomright,0],[B.bottomleft,0],[0,B.lefttop],[0,1],[B.topleft,1]]},Fo[144]=Fo[26]=function(B){return[[1,1],[1,B.righttop],[0,B.leftbottom],[0,B.lefttop],[B.topright,1]]},Fo[36]=Fo[134]=function(B){return[[1,B.rightbottom],[1,0],[B.bottomright,0],[B.topleft,1],[B.topright,1]]},Fo[9]=Fo[161]=function(B){return[[1,B.righttop],[1,B.rightbottom],[B.bottomleft,0],[0,0],[0,B.leftbottom]]},Fo[37]=Fo[133]=function(B){return[[1,B.rightbottom],[1,0],[0,0],[0,B.leftbottom],[B.topleft,1],[B.topright,1]]},Fo[148]=Fo[22]=function(B){return[[1,1],[1,0],[B.bottomright,0],[0,B.leftbottom],[0,B.lefttop],[B.topright,1]]},Fo[82]=Fo[88]=function(B){return[[1,1],[1,B.righttop],[B.bottomright,0],[B.bottomleft,0],[0,B.lefttop],[0,1]]},Fo[73]=Fo[97]=function(B){return[[1,B.righttop],[1,B.rightbottom],[B.bottomleft,0],[0,0],[0,1],[B.topleft,1]]},Fo[145]=Fo[25]=function(B){return[[1,1],[1,B.righttop],[B.bottomleft,0],[0,0],[0,B.leftbottom],[B.topright,1]]},Fo[70]=Fo[100]=function(B){return[[1,B.rightbottom],[1,0],[B.bottomright,0],[0,B.lefttop],[0,1],[B.topleft,1]]},Fo[34]=function(B){return[WA(B),hL(B)]},Fo[35]=function(B){return[[1,B.righttop],[1,B.rightbottom],[B.bottomright,0],[B.bottomleft,0],[0,B.leftbottom],[0,B.lefttop],[B.topleft,1],[B.topright,1]]},Fo[136]=function(B){return[dL(B),gN(B)]},Fo[153]=function(B){return[bx(B),gy(B)]},Fo[102]=function(B){return[GA(B),c0(B)]},Fo[155]=function(B){return[[1,1],[1,B.righttop],[B.bottomleft,0],[0,0],[0,B.leftbottom],[B.topright,1]]},Fo[103]=function(B){return[[1,B.rightbottom],[1,0],[B.bottomright,0],[0,B.lefttop],[0,1],[B.topleft,1]]},Fo[152]=function(B){return[bx(B),gN(B)]},Fo[156]=function(B){return[[1,1],[1,B.righttop],[B.bottomright,0],[B.bottomleft,0],[0,B.leftbottom],[0,B.lefttop],[B.topright,1]]},Fo[137]=function(B){return[dL(B),gy(B)]},Fo[139]=function(B){return[[1,B.righttop],[1,B.rightbottom],[B.bottomleft,0],[0,0],[0,B.leftbottom],[B.topleft,1],[B.topright,1]]},Fo[98]=function(B){return[hL(B),c0(B)]},Fo[99]=function(B){return[[1,B.righttop],[1,B.rightbottom],[B.bottomright,0],[B.bottomleft,0],[0,B.lefttop],[0,1],[B.topleft,1]]},Fo[38]=function(B){return[GA(B),WA(B)]},Fo[39]=function(B){return[[1,B.rightbottom],[1,0],[B.bottomright,0],[0,B.leftbottom],[0,B.lefttop],[B.topleft,1],[B.topright,1]]};var Mk=function(){function B(V){this.id=B.buildId(V),this.coordinates=V,this.innerEdges=[],this.outerEdges=[],this.outerEdgesSorted=!1}return B.buildId=function(V){return V.join(",")},B.prototype.removeInnerEdge=function(V){this.innerEdges=this.innerEdges.filter(function(W){return W.from.id!==V.from.id})},B.prototype.removeOuterEdge=function(V){this.outerEdges=this.outerEdges.filter(function(W){return W.to.id!==V.to.id})},B.prototype.addOuterEdge=function(V){this.outerEdges.push(V),this.outerEdgesSorted=!1},B.prototype.sortOuterEdges=function(){var V=this;this.outerEdgesSorted||(this.outerEdges.sort(function(W,K){var te=W.to,le=K.to;if(te.coordinates[0]-V.coordinates[0]>=0&&le.coordinates[0]-V.coordinates[0]<0)return 1;if(te.coordinates[0]-V.coordinates[0]<0&&le.coordinates[0]-V.coordinates[0]>=0)return-1;if(te.coordinates[0]-V.coordinates[0]==0&&le.coordinates[0]-V.coordinates[0]==0)return te.coordinates[1]-V.coordinates[1]>=0||le.coordinates[1]-V.coordinates[1]>=0?te.coordinates[1]-le.coordinates[1]:le.coordinates[1]-te.coordinates[1];var ue=YA(V.coordinates,te.coordinates,le.coordinates);return ue<0?1:ue>0?-1:Math.pow(te.coordinates[0]-V.coordinates[0],2)+Math.pow(te.coordinates[1]-V.coordinates[1],2)-(Math.pow(le.coordinates[0]-V.coordinates[0],2)+Math.pow(le.coordinates[1]-V.coordinates[1],2))}),this.outerEdgesSorted=!0)},B.prototype.getOuterEdges=function(){return this.sortOuterEdges(),this.outerEdges},B.prototype.getOuterEdge=function(V){return this.sortOuterEdges(),this.outerEdges[V]},B.prototype.addInnerEdge=function(V){this.innerEdges.push(V)},B}(),fS=function(){function B(V,W){this.from=V,this.to=W,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return B.prototype.getSymetric=function(){return this.symetric||(this.symetric=new B(this.to,this.from),this.symetric.symetric=this),this.symetric},B.prototype.deleteEdge=function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)},B.prototype.isEqual=function(V){return this.from.id===V.from.id&&this.to.id===V.to.id},B.prototype.toString=function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"},B.prototype.toLineString=function(){return S([this.from.coordinates,this.to.coordinates])},B.prototype.compareTo=function(V){return YA(V.from.coordinates,V.to.coordinates,this.to.coordinates)},B}(),vN=function(){function B(){this.edges=[],this.polygon=void 0,this.envelope=void 0}return B.prototype.push=function(V){this[this.edges.length]=V,this.edges.push(V),this.polygon=this.envelope=void 0},B.prototype.get=function(V){return this.edges[V]},Object.defineProperty(B.prototype,"length",{get:function(){return this.edges.length},enumerable:!0,configurable:!0}),B.prototype.forEach=function(V){this.edges.forEach(V)},B.prototype.map=function(V){return this.edges.map(V)},B.prototype.some=function(V){return this.edges.some(V)},B.prototype.isValid=function(){return!0},B.prototype.isHole=function(){var V=this,W=this.edges.reduce(function(ue,ye,be){return ye.from.coordinates[1]>V.edges[ue].from.coordinates[1]&&(ue=be),ue},0),K=(W===0?this.length:W)-1,te=(W+1)%this.length,le=YA(this.edges[K].from.coordinates,this.edges[W].from.coordinates,this.edges[te].from.coordinates);return le===0?this.edges[K].from.coordinates[0]>this.edges[te].from.coordinates[0]:le>0},B.prototype.toMultiPoint=function(){return D(this.edges.map(function(V){return V.from.coordinates}))},B.prototype.toPolygon=function(){if(this.polygon)return this.polygon;var V=this.edges.map(function(W){return W.from.coordinates});return V.push(this.edges[0].from.coordinates),this.polygon=E([V])},B.prototype.getEnvelope=function(){return this.envelope?this.envelope:this.envelope=$o(this.toPolygon())},B.findEdgeRingContaining=function(V,W){var K,te,le=V.getEnvelope();return W.forEach(function(ue){var ye,be,Te,Fe,Le,We,et=ue.getEnvelope();if(te&&(K=te.getEnvelope()),be=le,Te=(ye=et).geometry.coordinates.map(function(ot){return ot[0]}),Fe=ye.geometry.coordinates.map(function(ot){return ot[1]}),Le=be.geometry.coordinates.map(function(ot){return ot[0]}),We=be.geometry.coordinates.map(function(ot){return ot[1]}),(Math.max(null,Te)!==Math.max(null,Le)||Math.max(null,Fe)!==Math.max(null,We)||Math.min(null,Te)!==Math.min(null,Le)||Math.min(null,Fe)!==Math.min(null,We))&&Ik(et,le)){var Ze=V.map(function(ot){return ot.from.coordinates}).find(function(ot){return!ue.some(function(Ke){return Bt=ot,gi=Ke.from.coordinates,Bt[0]===gi[0]&&Bt[1]===gi[1];var Bt,gi})});Ze&&ue.inside(w(Ze))&&(te&&!Ik(K,et)||(te=ue))}}),te},B.prototype.inside=function(V){return qe(V,this.toPolygon())},B}(),EG=function(){function B(){this.edges=[],this.nodes={}}return B.fromGeoJson=function(V){(function(K){if(!K)throw new Error("No geojson passed");if(K.type!=="FeatureCollection"&&K.type!=="GeometryCollection"&&K.type!=="MultiLineString"&&K.type!=="LineString"&&K.type!=="Feature")throw new Error("Invalid input type '"+K.type+"'. Geojson must be FeatureCollection, GeometryCollection, LineString, MultiLineString or Feature")})(V);var W=new B;return ut(V,function(K){ae(K,"LineString","Graph::fromGeoJson"),he(K,function(te,le){if(te){var ue=W.getNode(te),ye=W.getNode(le);W.addEdge(ue,ye)}return le})}),W},B.prototype.getNode=function(V){var W=Mk.buildId(V),K=this.nodes[W];return K||(K=this.nodes[W]=new Mk(V)),K},B.prototype.addEdge=function(V,W){var K=new fS(V,W),te=K.getSymetric();this.edges.push(K),this.edges.push(te)},B.prototype.deleteDangles=function(){var V=this;Object.keys(this.nodes).map(function(W){return V.nodes[W]}).forEach(function(W){return V._removeIfDangle(W)})},B.prototype._removeIfDangle=function(V){var W=this;if(V.innerEdges.length<=1){var K=V.getOuterEdges().map(function(te){return te.to});this.removeNode(V),K.forEach(function(te){return W._removeIfDangle(te)})}},B.prototype.deleteCutEdges=function(){var V=this;this._computeNextCWEdges(),this._findLabeledEdgeRings(),this.edges.forEach(function(W){W.label===W.symetric.label&&(V.removeEdge(W.symetric),V.removeEdge(W))})},B.prototype._computeNextCWEdges=function(V){var W=this;V===void 0?Object.keys(this.nodes).forEach(function(K){return W._computeNextCWEdges(W.nodes[K])}):V.getOuterEdges().forEach(function(K,te){V.getOuterEdge((te===0?V.getOuterEdges().length:te)-1).symetric.next=K})},B.prototype._computeNextCCWEdges=function(V,W){for(var K,te,le=V.getOuterEdges(),ue=le.length-1;ue>=0;--ue){var ye=le[ue],be=ye.symetric,Te=void 0,Fe=void 0;ye.label===W&&(Te=ye),be.label===W&&(Fe=be),Te&&Fe&&(Fe&&(te=Fe),Te&&(te&&(te.next=Te,te=void 0),K||(K=Te)))}te&&(te.next=K)},B.prototype._findLabeledEdgeRings=function(){var V=[],W=0;return this.edges.forEach(function(K){if(!(K.label>=0)){V.push(K);var te=K;do te.label=W,te=te.next;while(!K.isEqual(te));W++}}),V},B.prototype.getEdgeRings=function(){var V=this;this._computeNextCWEdges(),this.edges.forEach(function(K){K.label=void 0}),this._findLabeledEdgeRings().forEach(function(K){V._findIntersectionNodes(K).forEach(function(te){V._computeNextCCWEdges(te,K.label)})});var W=[];return this.edges.forEach(function(K){K.ring||W.push(V._findEdgeRing(K))}),W},B.prototype._findIntersectionNodes=function(V){var W=[],K=V,te=function(){var le=0;K.from.getOuterEdges().forEach(function(ue){ue.label===V.label&&++le}),le>1&&W.push(K.from),K=K.next};do te();while(!V.isEqual(K));return W},B.prototype._findEdgeRing=function(V){var W=V,K=new vN;do K.push(W),W.ring=K,W=W.next;while(!V.isEqual(W));return K},B.prototype.removeNode=function(V){var W=this;V.getOuterEdges().forEach(function(K){return W.removeEdge(K)}),V.innerEdges.forEach(function(K){return W.removeEdge(K)}),delete this.nodes[V.id]},B.prototype.removeEdge=function(V){this.edges=this.edges.filter(function(W){return!W.isEqual(V)}),V.deleteEdge()},B}();function Dk(B,V){var W=!0;return ut(B,function(K){ut(V,function(te){if(W===!1)return!1;W=function(le,ue){switch(le.type){case"Point":switch(ue.type){case"Point":return ye=le.coordinates,be=ue.coordinates,!(ye[0]===be[0]&&ye[1]===be[1]);case"LineString":return!Lk(ue,le);case"Polygon":return!qe(le,ue)}break;case"LineString":switch(ue.type){case"Point":return!Lk(le,ue);case"LineString":return!function(Te,Fe){return wg(Te,Fe).features.length>0}(le,ue);case"Polygon":return!yN(ue,le)}break;case"Polygon":switch(ue.type){case"Point":return!qe(ue,le);case"LineString":return!yN(le,ue);case"Polygon":return!function(Te,Fe){for(var Le=0,We=Te.coordinates[0];Le0}(ue,le)}}var ye,be;return!1}(K.geometry,te.geometry)})}),W}function Lk(B,V){for(var W=0;W0}function xN(B,V,W){var K=W[0]-B[0],te=W[1]-B[1],le=V[0]-B[0],ue=V[1]-B[1];return K*ue-te*le==0&&(Math.abs(le)>=Math.abs(ue)?le>0?B[0]<=W[0]&&W[0]<=V[0]:V[0]<=W[0]&&W[0]<=B[0]:ue>0?B[1]<=W[1]&&W[1]<=V[1]:V[1]<=W[1]&&W[1]<=B[1])}function Rk(B,V){return!(B[0]>V[0])&&!(B[2]V[1])&&!(B[3]0}function kb(B,V){for(var W=!1,K=!1,te=B.coordinates.length,le=0;le=Math.abs(ye)?ue>0?B[0]<=W[0]&&W[0]<=V[0]:V[0]<=W[0]&&W[0]<=B[0]:ye>0?B[1]<=W[1]&&W[1]<=V[1]:V[1]<=W[1]&&W[1]<=B[1]:Math.abs(ue)>=Math.abs(ye)?ue>0?B[0]0?B[1]=0&&(W=[].concat(B.slice(K,B.length),B.slice(1,K+1))),W},W_.prototype.comparePath=function(B,V){var W=this;return B.every(function(K,te){return W.compareCoord(K,this[te])},V)},W_.prototype.comparePolygon=function(B,V){if(this.compareLine(B.coordinates[0],V.coordinates[0],1,!0)){var W=B.coordinates.slice(1,B.coordinates.length),K=V.coordinates.slice(1,V.coordinates.length),te=this;return W.every(function(le){return this.some(function(ue){return te.compareLine(le,ue,1,!0)})},K)}return!1},W_.prototype.compareFeature=function(B,V){return!(B.id!==V.id||!this.objectComparator(B.properties,V.properties)||!this.compareBBox(B,V))&&this.compare(B.geometry,V.geometry)},W_.prototype.compareBBox=function(B,V){return!!(!B.bbox&&!V.bbox||B.bbox&&V.bbox&&this.compareCoord(B.bbox,V.bbox))},W_.prototype.removePseudo=function(B){return B};var AN=W_;function rI(B,V){var W=de(B),K=de(V),te=W.type,le=K.type;if(te==="MultiPoint"&&le!=="MultiPoint"||(te==="LineString"||te==="MultiLineString")&&le!=="LineString"&&le!=="MultiLineString"||(te==="Polygon"||te==="MultiPolygon")&&le!=="Polygon"&&le!=="MultiPolygon")throw new Error("features must be of the same type");if(te==="Point")throw new Error("Point geometry not supported");if(new AN({precision:6}).compare(B,V))return!1;var ue=0;switch(te){case"MultiPoint":for(var ye=0;ye0}function _L(B,V){var W=!1;return ut(B,function(K){ut(V,function(te){if(W===!0)return!0;W=!Dk(K.geometry,te.geometry)})}),W}var EN=yt(function(B){function V(W,K,te,le){this.dataset=[],this.epsilon=1,this.minPts=2,this.distance=this._euclideanDistance,this.clusters=[],this.noise=[],this._visited=[],this._assigned=[],this._datasetLength=0,this._init(W,K,te,le)}V.prototype.run=function(W,K,te,le){this._init(W,K,te,le);for(var ue=0;ue=this.minPts&&(K=this._mergeArrays(K,ue))}this._assigned[le]!==1&&this._addToCluster(le,W)}},V.prototype._addToCluster=function(W,K){this.clusters[K].push(W),this._assigned[W]=1},V.prototype._regionQuery=function(W){for(var K=[],te=0;te0){for(Fe=0;Fe=0);return W},V.prototype.assign=function(){for(var W,K=!1,te=this.dataset.length,le=0;leue&&(te=le):K=this.minPts)return le},W.prototype._regionQuery=function(K,te){te=te||this.epsilon;for(var le=[],ue=0,ye=this.dataset.length;ue0;K.length0;){var ye=B[Math.floor(Math.random()*le)],be=ue?ye.join("_"):""+ye;W[be]||(W[be]=!0,K.push(ye))}if(K.length0,ue=B[Math.floor(Math.random()*te)];for(le&&ue.join("_"),K.push(ue);K.length0,et=[];if(W)te=W=="kmrand"?SG(B,V):W=="kmpp"?j_(B,V):W;else for(var Ze={};te.length0;){var be=ue.pop();if(be===W)return PN(be);be.closed=!0;for(var Te=B.neighbors(be),Fe=0,Le=Te.length;Fe0)){if(le/=We,We<0){if(le0){if(le>Le)return;le>Fe&&(Fe=le)}if(le=K-be,We||!(le<0)){if(le/=We,We<0){if(le>Le)return;le>Fe&&(Fe=le)}else if(We>0){if(le0)){if(le/=et,et<0){if(le0){if(le>Le)return;le>Fe&&(Fe=le)}if(le=te-Te,et||!(le<0)){if(le/=et,et<0){if(le>Le)return;le>Fe&&(Fe=le)}else if(et>0){if(le0||Le<1)||(Fe>0&&(B[0]=[be+Fe*We,Te+Fe*et]),Le<1&&(B[1]=[be+Le*We,Te+Le*et]),!0)}}}}}function IG(B,V,W,K,te){var le=B[1];if(le)return!0;var ue,ye,be=B[0],Te=B.left,Fe=B.right,Le=Te[0],We=Te[1],et=Fe[0],Ze=Fe[1],ot=(Le+et)/2,Ke=(We+Ze)/2;if(Ze===We){if(ot=K)return;if(Le>et){if(be){if(be[1]>=te)return}else be=[ot,W];le=[ot,te]}else{if(be){if(be[1]1)if(Le>et){if(be){if(be[1]>=te)return}else be=[(W-ye)/ue,W];le=[(te-ye)/ue,te]}else{if(be){if(be[1]=K)return}else be=[V,ue*V+ye];le=[K,ue*K+ye]}else{if(be){if(be[0]0&&(this.content[0]=V,this.bubbleUp(0)),B},remove:function(B){var V=this.content.indexOf(B),W=this.content.pop();V!==this.content.length-1&&(this.content[V]=W,this.scoreFunction(W)0;){var W=(B+1>>1)-1,K=this.content[W];if(!(this.scoreFunction(V)=-XA)){var et=be*be+Te*Te,Ze=Fe*Fe+Le*Le,ot=(Le*et-Te*Ze)/We,Ke=(be*Ze-Fe*et)/We,Bt=_y.pop()||new RN;Bt.arc=B,Bt.site=te,Bt.x=ot+ue,Bt.y=(Bt.cy=Ke+ye)+Math.sqrt(ot*ot+Ke*Ke),B.circle=Bt;for(var gi=null,rt=qA._;rt;)if(Bt.ykc)ye=ye.L;else{if(!((te=le-Wk(ye,ue))>kc)){K>-kc?(V=ye.P,W=ye):te>-kc?(V=ye,W=ye.N):V=W=ye;break}if(!ye.R){V=ye;break}ye=ye.R}(function(zt){Cf[zt.index]={site:zt,halfedges:[]}})(B);var be=oI(B);if(X_.insert(V,be),V||W){if(V===W)return wu(V),W=oI(V.site),X_.insert(be,W),be.edge=W.edge=mS(V.site,be.site),qd(V),void qd(W);if(W){wu(V),wu(W);var Te=V.site,Fe=Te[0],Le=Te[1],We=B[0]-Fe,et=B[1]-Le,Ze=W.site,ot=Ze[0]-Fe,Ke=Ze[1]-Le,Bt=2*(We*Ke-et*ot),gi=We*We+et*et,rt=ot*ot+Ke*Ke,Ft=[(Ke*gi-et*rt)/Bt+Fe,(We*rt-ot*gi)/Bt+Le];gS(W.edge,Te,Ze,Ft),be.edge=mS(Te,B,null,Ft),W.edge=mS(B,Ze,null,Ft),qd(V),qd(W)}else be.edge=mS(V.site,be.site)}}function Gk(B,V){var W=B.site,K=W[0],te=W[1],le=te-V;if(!le)return K;var ue=B.P;if(!ue)return-1/0;var ye=(W=ue.site)[0],be=W[1],Te=be-V;if(!Te)return ye;var Fe=ye-K,Le=1/le-1/Te,We=Fe/Te;return Le?(-We+Math.sqrt(We*We-2*Le*(Fe*Fe/(-2*Te)-be+Te/2+te-le/2)))/Le+K:(K+ye)/2}function Wk(B,V){var W=B.N;if(W)return Gk(W,V);var K=B.site;return K[1]===V?K[0]:1/0}var X_,Cf,qA,mm,kc=1e-6,XA=1e-12;function h0(B,V){return V[1]-B[1]||V[0]-B[0]}function vy(B,V){var W,K,te,le=B.sort(h0).pop();for(mm=[],Cf=new Array(B.length),X_=new Y_,qA=new Y_;;)if(te=LN,le&&(!te||le[1]kc||Math.abs(Ze[0][1]-Ze[1][1])>kc)||delete mm[ot]})(ue,ye,be,Te),function(Fe,Le,We,et){var Ze,ot,Ke,Bt,gi,rt,Ft,zt,oi,qt,Fr,Cr,rn=Cf.length,Dr=!0;for(Ze=0;Zekc||Math.abs(Cr-oi)>kc)&&(gi.splice(Bt,0,mm.push(i_(Ke,qt,Math.abs(Fr-Fe)kc?[Fe,Math.abs(zt-Fe)kc?[Math.abs(oi-et)kc?[We,Math.abs(zt-We)kc?[Math.abs(oi-Le)=-270&&(Ze=-Ze),et<-180&&et>=-360&&(ot=-ot),le==="degrees"){var Ke=Ze*Math.cos(Fe)+ot*Math.sin(Fe),Bt=ot*Math.cos(Fe)-Ze*Math.sin(Fe);Ze=Ke,ot=Bt}Le.push([Ze+Te[0],ot+Te[1]])}return Le.push(Le[0]),le==="degrees"?E([Le],be):Ek(E([Le],be),ue,{pivot:ye})}function jk(B){var V=B*Math.PI/180;return Math.tan(V)}function AL(B,V){V===void 0&&(V={});var W=0,K=0,te=0;return Xe(B,function(le,ue,ye){var be=V.weight?ye?.[V.weight]:void 0;if(!Y(be=be??1))throw new Error("weight value must be a number for feature index "+ue);(be=Number(be))>0&&ce(le,function(Te){W+=Te[0]*be,K+=Te[1]*be,te+=be})}),w([W/te,K/te],V.properties,V)}function sI(B,V,W,K,te){var le=K.tolerance||.001,ue=0,ye=0,be=0,Te=0;if(De(W,function(We){var et,Ze=(et=We.properties)===null||et===void 0?void 0:et.weight,ot=Ze??1;if(!Y(ot=Number(ot)))throw new Error("weight value must be a number");if(ot>0){Te+=1;var Ke=ot*St(We,B);Ke===0&&(Ke=1);var Bt=ot/Ke;ue+=We.geometry.coordinates[0]*Bt,ye+=We.geometry.coordinates[1]*Bt,be+=Bt}}),Te<1)throw new Error("no features to measure");var Fe=ue/be,Le=ye/be;return Te===1||te===0||Math.abs(Fe-V[0])W&&(W=be,K=le,V.push([]));var Te=le-K,Fe=B.coordinates[be][Te+1],Le=te[0],We=te[1],et=Fe[0],Ze=Fe[1];V[be].push([.75*Le+.25*et,.75*We+.25*Ze]),V[be].push([.25*Le+.75*et,.25*We+.75*Ze])},!0),V.forEach(function(te){te.push(te[0])})}function Sl(B,V){var W=0,K=0,te=0;ce(B,function(le,ue,ye,be,Te){be>te&&(te=be,K=ue,V.push([[]])),Te>W&&(W=Te,K=ue,V[be].push([]));var Fe=ue-K,Le=B.coordinates[be][Te][Fe+1],We=le[0],et=le[1],Ze=Le[0],ot=Le[1];V[be][Te].push([.75*We+.25*Ze,.75*et+.25*ot]),V[be][Te].push([.25*We+.75*Ze,.25*et+.75*ot])},!0),V.forEach(function(le){le.forEach(function(ue){ue.push(ue[0])})})}function NN(B,V,W){W===void 0&&(W=2);var K=re(B),te=re(V),le=K[0]-te[0],ue=K[1]-te[1];return W===1?Math.abs(le)+Math.abs(ue):Math.pow(Math.pow(le,W)+Math.pow(ue,W),1/W)}function bf(B,V){var W=(V=V||{}).threshold||1e4,K=V.p||2,te=V.binary||!1,le=V.alpha||-1,ue=V.standardization||!1,ye=[];De(B,function(et){ye.push(Wu(et))});for(var be=[],Te=0;Te0?1:0}(B[0]))*V,W*Math.log(Math.tan(.25*Math.PI+.5*B[1]*V))];return te[0]>K&&(te[0]=K),te[0]<-K&&(te[0]=-K),te[1]>K&&(te[1]=K),te[1]<-K&&(te[1]=-K),te}function lI(B){var V=180/Math.PI,W=6378137;return[B[0]*V/W,(.5*Math.PI-2*Math.atan(Math.exp(-B[1]/W)))*V]}vy.prototype={constructor:vy,polygons:function(){var B=this.edges;return this.cells.map(function(V){var W=V.halfedges.map(function(K){return DN(V,B[K])});return W.data=V.site.data,W})},triangles:function(){var B=[],V=this.edges;return this.cells.forEach(function(W,K){if(le=(te=W.halfedges).length)for(var te,le,ue,ye,be,Te,Fe=W.site,Le=-1,We=V[te[le-1]],et=We.left===Fe?We.right:We.left;++Le=ye)return null;var be=B-te.site[0],Te=V-te.site[1],Fe=be*be+Te*Te;do te=le.cells[K=ue],ue=null,te.halfedges.forEach(function(Le){var We=le.edges[Le],et=We.left;if(et!==te.site&&et||(et=We.right)){var Ze=B-et[0],ot=V-et[1],Ke=Ze*Ze+ot*ot;Ke0?Te+Le[Fe-1]:Te}),be.forEach(function(Te){Te=2*Te*Math.PI/be[be.length-1];var Fe=Math.random();ye.push([Fe*(V.max_radial_length||10)*Math.sin(Te),Fe*(V.max_radial_length||10)*Math.cos(Te)])}),ye[ye.length-1]=ye[0],ye=ye.map((ue=JA(V.bbox),function(Te){return[Te[0]+ue[0],Te[1]+ue[1]]})),W.push(E([ye]))},te=0;te * @license MIT * @preserve */function DG(B,V){return B>V?1:B0)||V.right===null||W(B,V.right.key)>0&&(ye=V.right,V.right=ye.left,ye.left=V,(V=ye).right===null))break;te.right=V,te=V,V=V.right}}return te.right=V.left,le.left=V.right,V.left=K.right,V.right=K.left,V}function qf(B,V,W,K){var te=new KC(B,V);if(W===null)return te.left=te.right=null,te;var le=K(B,(W=QC(B,W,K)).key);return le<0?(te.left=W.left,te.right=W,W.left=null):le>=0&&(te.right=W.right,te.left=W,W.right=null),te}function Pg(B,V,W){var K=null,te=null;if(V){var le=W((V=QC(B,V,W)).key,B);le===0?(K=V.left,te=V.right):le<0?(te=V.right,V.right=null,K=V):(K=V.left,V.left=null,te=V)}return{left:K,right:te}}function zN(B,V,W,K,te){if(B){K(V+(W?"\u2514\u2500\u2500 ":"\u251C\u2500\u2500 ")+te(B)+` `);var le=V+(W?" ":"\u2502 ");B.left&&zN(B.left,le,!1,K,te),B.right&&zN(B.right,le,!0,K,te)}}var xy=function(){function B(V){V===void 0&&(V=DG),this._root=null,this._size=0,this._comparator=V}return B.prototype.insert=function(V,W){return this._size++,this._root=qf(V,W,this._root,this._comparator)},B.prototype.add=function(V,W){var K=new KC(V,W);this._root===null&&(K.left=K.right=null,this._size++,this._root=K);var te=this._comparator,le=QC(V,this._root,te),ue=te(V,le.key);return ue===0?this._root=le:(ue<0?(K.left=le.left,K.right=le,le.left=null):ue>0&&(K.right=le.right,K.left=le,le.right=null),this._size++,this._root=K),this._root},B.prototype.remove=function(V){this._root=this._remove(V,this._root,this._comparator)},B.prototype._remove=function(V,W,K){var te;return W===null?null:K(V,(W=QC(V,W,K)).key)===0?(W.left===null?te=W.right:(te=QC(V,W.left,K)).right=W.right,this._size--,te):W},B.prototype.pop=function(){var V=this._root;if(V){for(;V.left;)V=V.left;return this._root=QC(V.key,this._root,this._comparator),this._root=this._remove(V.key,this._root,this._comparator),{key:V.key,data:V.data}}return null},B.prototype.findStatic=function(V){for(var W=this._root,K=this._comparator;W;){var te=K(V,W.key);if(te===0)return W;W=te<0?W.left:W.right}return null},B.prototype.find=function(V){return this._root&&(this._root=QC(V,this._root,this._comparator),this._comparator(V,this._root.key)!==0)?null:this._root},B.prototype.contains=function(V){for(var W=this._root,K=this._comparator;W;){var te=K(V,W.key);if(te===0)return!0;W=te<0?W.left:W.right}return!1},B.prototype.forEach=function(V,W){for(var K=this._root,te=[],le=!1;!le;)K!==null?(te.push(K),K=K.left):te.length!==0?(K=te.pop(),V.call(W,K),K=K.right):le=!0;return this},B.prototype.range=function(V,W,K,te){for(var le=[],ue=this._comparator,ye=this._root;le.length!==0||ye;)if(ye)le.push(ye),ye=ye.left;else{if(ue((ye=le.pop()).key,W)>0)break;if(ue(ye.key,V)>=0&&K.call(te,ye))return this;ye=ye.right}return this},B.prototype.keys=function(){var V=[];return this.forEach(function(W){var K=W.key;return V.push(K)}),V},B.prototype.values=function(){var V=[];return this.forEach(function(W){var K=W.data;return V.push(K)}),V},B.prototype.min=function(){return this._root?this.minNode(this._root).key:null},B.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},B.prototype.minNode=function(V){if(V===void 0&&(V=this._root),V)for(;V.left;)V=V.left;return V},B.prototype.maxNode=function(V){if(V===void 0&&(V=this._root),V)for(;V.right;)V=V.right;return V},B.prototype.at=function(V){for(var W=this._root,K=!1,te=0,le=[];!K;)if(W)le.push(W),W=W.left;else if(le.length>0){if(W=le.pop(),te===V)return W;te++,W=W.right}else K=!0;return null},B.prototype.next=function(V){var W=this._root,K=null;if(V.right){for(K=V.right;K.left;)K=K.left;return K}for(var te=this._comparator;W;){var le=te(V.key,W.key);if(le===0)break;le<0?(K=W,W=W.left):W=W.right}return K},B.prototype.prev=function(V){var W=this._root,K=null;if(V.left!==null){for(K=V.left;K.right;)K=K.right;return K}for(var te=this._comparator;W;){var le=te(V.key,W.key);if(le===0)break;le<0?W=W.left:(K=W,W=W.right)}return K},B.prototype.clear=function(){return this._root=null,this._size=0,this},B.prototype.toList=function(){return function(V){for(var W=V,K=[],te=!1,le=new KC(null,null),ue=le;!te;)W?(K.push(W),W=W.left):K.length>0?W=(W=ue=ue.next=K.pop()).right:te=!0;return ue.next=null,le.next}(this._root)},B.prototype.load=function(V,W,K){W===void 0&&(W=[]),K===void 0&&(K=!1);var te=V.length,le=this._comparator;if(K&&HN(V,W,0,te-1,le),this._root===null)this._root=gm(V,W,0,te),this._size=te;else{var ue=function(ye,be,Te){for(var Fe=new KC(null,null),Le=Fe,We=ye,et=be;We!==null&&et!==null;)Te(We.key,et.key)<0?(Le.next=We,We=We.next):(Le.next=et,et=et.next),Le=Le.next;return We!==null?Le.next=We:et!==null&&(Le.next=et),Fe.next}(this.toList(),function(ye,be){for(var Te=new KC(null,null),Fe=Te,Le=0;Le0){var le=W+Math.floor(te/2),ue=B[le],ye=V[le],be=new KC(ue,ye);return be.left=gm(B,V,W,le),be.right=gm(B,V,le+1,K),be}return null}function _S(B,V,W){var K=W-V;if(K>0){var te=V+Math.floor(K/2),le=_S(B,V,te),ue=B.head;return ue.left=le,B.head=B.head.next,ue.right=_S(B,te+1,W),ue}return null}function HN(B,V,W,K,te){if(!(W>=K)){for(var le=B[W+K>>1],ue=W-1,ye=K+1;;){do ue++;while(te(B[ue],le)<0);do ye--;while(te(B[ye],le)>0);if(ue>=ye)break;var be=B[ue];B[ue]=B[ye],B[ye]=be,be=V[ue],V[ue]=V[ye],V[ye]=be}HN(B,V,W,ye,te),HN(B,V,ye+1,K,te)}}function d0(B,V){if(!(B instanceof V))throw new TypeError("Cannot call a class as a function")}function Xk(B,V){for(var W=0;WW.x?1:V.yW.y?1:0}}]),Um(B,[{key:"link",value:function(V){if(V.point===this.point)throw new Error("Tried to link already linked events");for(var W=V.point.events,K=0,te=W.length;K=0&&Le>=0?TeWe?-1:0:be<0&&Le<0?TeWe?1:0:Lebe?1:0}}}]),B}(),pI=0,mI=function(){function B(V,W,K,te){d0(this,B),this.id=++pI,this.leftSE=V,V.segment=this,V.otherSE=W,this.rightSE=W,W.segment=this,W.otherSE=V,this.rings=K,this.windings=te}return Um(B,null,[{key:"compare",value:function(V,W){var K=V.leftSE.point.x,te=W.leftSE.point.x,le=V.rightSE.point.x,ue=W.rightSE.point.x;if(ueye&&be>Te)return-1;var Le=V.comparePoint(W.leftSE.point);if(Le<0)return 1;if(Le>0)return-1;var We=W.comparePoint(V.rightSE.point);return We!==0?We:-1}if(K>te){if(yebe&&ye>Fe)return 1;var et=W.comparePoint(V.leftSE.point);if(et!==0)return et;var Ze=V.comparePoint(W.rightSE.point);return Ze<0?1:Ze>0?-1:1}if(yebe)return 1;if(leue){var Ke=V.comparePoint(W.rightSE.point);if(Ke<0)return 1;if(Ke>0)return-1}if(le!==ue){var Bt=Te-ye,gi=le-K,rt=Fe-be,Ft=ue-te;if(Bt>gi&&rtFt)return-1}return le>ue?1:leFe?1:V.idW.id?1:0}}]),Um(B,[{key:"replaceRightSE",value:function(V){this.rightSE=V,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}},{key:"bbox",value:function(){var V=this.leftSE.point.y,W=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:VW?V:W}}}},{key:"vector",value:function(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}},{key:"isAnEndpoint",value:function(V){return V.x===this.leftSE.point.x&&V.y===this.leftSE.point.y||V.x===this.rightSE.point.x&&V.y===this.rightSE.point.y}},{key:"comparePoint",value:function(V){if(this.isAnEndpoint(V))return 0;var W=this.leftSE.point,K=this.rightSE.point,te=this.vector();if(W.x===K.x)return V.x===W.x?0:V.x0&&ye.swapEvents(),J_.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),K&&(te.checkForConsuming(),le.checkForConsuming()),W}},{key:"swapEvents",value:function(){var V=this.rightSE;this.rightSE=this.leftSE,this.leftSE=V,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(var W=0,K=this.windings.length;W0){var le=W;W=K,K=le}if(W.prev===K){var ue=W;W=K,K=ue}for(var ye=0,be=K.rings.length;ye0))throw new Error("Tried to create degenerate segment at [".concat(V.x,", ").concat(V.y,"]"));te=W,le=V,ue=-1}return new B(new J_(te,!0),new J_(le,!1),[K],[ue])}}]),B}(),Cy=function(){function B(V,W,K){if(d0(this,B),!Array.isArray(V)||V.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=W,this.isExterior=K,this.segments=[],typeof V[0][0]!="number"||typeof V[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");var te=vS.round(V[0][0],V[0][1]);this.bbox={ll:{x:te.x,y:te.y},ur:{x:te.x,y:te.y}};for(var le=te,ue=1,ye=V.length;uethis.bbox.ur.x&&(this.bbox.ur.x=be.x),be.y>this.bbox.ur.y&&(this.bbox.ur.y=be.y),le=be)}te.x===le.x&&te.y===le.y||this.segments.push(mI.fromRing(le,te,this))}return Um(B,[{key:"getSweepEvents",value:function(){for(var V=[],W=0,K=this.segments.length;Wthis.bbox.ur.x&&(this.bbox.ur.x=le.bbox.ur.x),le.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=le.bbox.ur.y),this.interiorRings.push(le)}this.multiPoly=W}return Um(B,[{key:"getSweepEvents",value:function(){for(var V=this.exteriorRing.getSweepEvents(),W=0,K=this.interiorRings.length;Wthis.bbox.ur.x&&(this.bbox.ur.x=le.bbox.ur.x),le.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=le.bbox.ur.y),this.polys.push(le)}this.isSubject=W}return Um(B,[{key:"getSweepEvents",value:function(){for(var V=[],W=0,K=this.polys.length;W0&&(V=te)}for(var le=V.segment.prevInResult(),ue=le?le.prevInResult():null;;){if(!le)return null;if(!ue)return le.ringOut;if(ue.ringOut!==le.ringOut)return ue.ringOut.enclosingRing()!==le.ringOut?le.ringOut:le.ringOut.enclosingRing();le=ue.prevInResult(),ue=le?le.prevInResult():null}}}]),B}(),$k=function(){function B(V){d0(this,B),this.exteriorRing=V,V.poly=this,this.interiorRings=[]}return Um(B,[{key:"addInterior",value:function(V){this.interiorRings.push(V),V.poly=this}},{key:"getGeom",value:function(){var V=[this.exteriorRing.getGeom()];if(V[0]===null)return null;for(var W=0,K=this.interiorRings.length;W1&&arguments[1]!==void 0?arguments[1]:mI.compare;d0(this,B),this.queue=V,this.tree=new xy(W),this.segments=[]}return Um(B,[{key:"process",value:function(V){var W=V.segment,K=[];if(V.consumedBy)return V.isLeft?this.queue.remove(V.otherSE):this.tree.remove(W),K;var te=V.isLeft?this.tree.insert(W):this.tree.find(W);if(!te)throw new Error("Unable to find segment #".concat(W.id," ")+"[".concat(W.leftSE.point.x,", ").concat(W.leftSE.point.y,"] -> ")+"[".concat(W.rightSE.point.x,", ").concat(W.rightSE.point.y,"] ")+"in SweepLine tree. Please submit a bug report.");for(var le=te,ue=te,ye=void 0,be=void 0;ye===void 0;)(le=this.tree.prev(le))===null?ye=null:le.key.consumedBy===void 0&&(ye=le.key);for(;be===void 0;)(ue=this.tree.next(ue))===null?be=null:ue.key.consumedBy===void 0&&(be=ue.key);if(V.isLeft){var Te=null;if(ye){var Fe=ye.getIntersection(W);if(Fe!==null&&(W.isAnEndpoint(Fe)||(Te=Fe),!ye.isAnEndpoint(Fe)))for(var Le=this._splitSafely(ye,Fe),We=0,et=Le.length;We0?(this.tree.remove(W),K.push(V)):(this.segments.push(W),W.prev=ye)}else{if(ye&&be){var qt=ye.getIntersection(be);if(qt!==null){if(!ye.isAnEndpoint(qt))for(var Fr=this._splitSafely(ye,qt),Cr=0,rn=Fr.length;CreV)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big). Please file a bug report.");for(var Ft=new OG(Ze),zt=Ze.size,oi=Ze.pop();oi;){var qt=oi.key;if(Ze.size===zt){var Fr=qt.segment;throw new Error("Unable to pop() ".concat(qt.isLeft?"left":"right"," SweepEvent ")+"[".concat(qt.point.x,", ").concat(qt.point.y,"] from segment #").concat(Fr.id," ")+"[".concat(Fr.leftSE.point.x,", ").concat(Fr.leftSE.point.y,"] -> ")+"[".concat(Fr.rightSE.point.x,", ").concat(Fr.rightSE.point.y,"] from queue. ")+"Please file a bug report.")}if(Ze.size>eV)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big). Please file a bug report.");if(Ft.segments.length>NG)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments). Please file a bug report.");for(var Cr=Ft.process(qt),rn=0,Dr=Cr.length;rn1?V-1:0),K=1;K1?V-1:0),K=1;K1?V-1:0),K=1;KV.x?1:this.yV.y?1:0},Pr.prototype.clone=function(){},Pr.prototype.copy=function(){return new Pr(this)},Pr.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},Pr.prototype.distance3D=function(B){var V=this.x-B.x,W=this.y-B.y,K=this.z-B.z;return Math.sqrt(V*V+W*W+K*K)},Pr.prototype.distance=function(B){var V=this.x-B.x,W=this.y-B.y;return Math.sqrt(V*V+W*W)},Pr.prototype.hashCode=function(){var B=17;return B=37*(B=37*B+Pr.hashCode(this.x))+Pr.hashCode(this.y)},Pr.prototype.setCoordinate=function(B){this.x=B.x,this.y=B.y,this.z=B.z},Pr.prototype.interfaces_=function(){return[Ig,NL,f0]},Pr.prototype.getClass=function(){return Pr},Pr.hashCode=function(){if(arguments.length===1){var B=arguments[0],V=Ts.doubleToLongBits(B);return Math.trunc((V^V)>>>32)}},eE.DimensionalComparator.get=function(){return e1},eE.serialVersionUID.get=function(){return 6683108902428367e3},eE.NULL_ORDINATE.get=function(){return Ts.NaN},eE.X.get=function(){return 0},eE.Y.get=function(){return 1},eE.Z.get=function(){return 2},Object.defineProperties(Pr,eE);var e1=function(B){if(this._dimensionsToTest=2,arguments.length!==0&&arguments.length===1){var V=arguments[0];if(V!==2&&V!==3)throw new sh("only 2 or 3 dimensions may be specified");this._dimensionsToTest=V}};e1.prototype.compare=function(B,V){var W=B,K=V,te=e1.compare(W.x,K.x);if(te!==0)return te;var le=e1.compare(W.y,K.y);return le!==0?le:this._dimensionsToTest<=2?0:e1.compare(W.z,K.z)},e1.prototype.interfaces_=function(){return[xS]},e1.prototype.getClass=function(){return e1},e1.compare=function(B,V){return BV?1:Ts.isNaN(B)?Ts.isNaN(V)?0:-1:Ts.isNaN(V)?1:0};var zb=function(){};zb.prototype.create=function(){},zb.prototype.interfaces_=function(){return[]},zb.prototype.getClass=function(){return zb};var Hr=function(){},CS={INTERIOR:{configurable:!0},BOUNDARY:{configurable:!0},EXTERIOR:{configurable:!0},NONE:{configurable:!0}};Hr.prototype.interfaces_=function(){return[]},Hr.prototype.getClass=function(){return Hr},Hr.toLocationSymbol=function(B){switch(B){case Hr.EXTERIOR:return"e";case Hr.BOUNDARY:return"b";case Hr.INTERIOR:return"i";case Hr.NONE:return"-"}throw new sh("Unknown location value: "+B)},CS.INTERIOR.get=function(){return 0},CS.BOUNDARY.get=function(){return 1},CS.EXTERIOR.get=function(){return 2},CS.NONE.get=function(){return-1},Object.defineProperties(Hr,CS);var os=function(B,V){return B.interfaces_&&B.interfaces_().indexOf(V)>-1},Sh=function(){},tV={LOG_10:{configurable:!0}};Sh.prototype.interfaces_=function(){return[]},Sh.prototype.getClass=function(){return Sh},Sh.log10=function(B){var V=Math.log(B);return Ts.isInfinite(V)||Ts.isNaN(V)?V:V/Sh.LOG_10},Sh.min=function(B,V,W,K){var te=B;return VW?W:B}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var K=arguments[0],te=arguments[1],le=arguments[2];return Kle?le:K}},Sh.wrap=function(B,V){return B<0?V- -B%V:B%V},Sh.max=function(){if(arguments.length===3){var B=arguments[0],V=arguments[1],W=arguments[2],K=B;return V>K&&(K=V),W>K&&(K=W),K}if(arguments.length===4){var te=arguments[0],le=arguments[1],ue=arguments[2],ye=arguments[3],be=te;return le>be&&(be=le),ue>be&&(be=ue),ye>be&&(be=ye),be}},Sh.average=function(B,V){return(B+V)/2},tV.LOG_10.get=function(){return Math.log(10)},Object.defineProperties(Sh,tV);var p0=function(B){this.str=B};p0.prototype.append=function(B){this.str+=B},p0.prototype.setCharAt=function(B,V){this.str=this.str.substr(0,B)+V+this.str.substr(B+1)},p0.prototype.toString=function(B){return this.str};var K_=function(B){this.value=B};K_.prototype.intValue=function(){return this.value},K_.prototype.compareTo=function(B){return this.valueB?1:0},K_.isNaN=function(B){return Number.isNaN(B)};var bS=function(){};bS.isWhitespace=function(B){return B<=32&&B>=0||B===127},bS.toUpperCase=function(B){return B.toUpperCase()};var Qr=function B(){if(this._hi=0,this._lo=0,arguments.length===0)this.init(0);else if(arguments.length===1){if(typeof arguments[0]=="number"){var V=arguments[0];this.init(V)}else if(arguments[0]instanceof B){var W=arguments[0];this.init(W)}else if(typeof arguments[0]=="string"){var K=arguments[0];B.call(this,B.parse(K))}}else if(arguments.length===2){var te=arguments[0],le=arguments[1];this.init(te,le)}},Ph={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Qr.prototype.le=function(B){return(this._hi9?(Fe=!0,Le="9"):Le="0"+Te,ue.append(Le),W=W.subtract(Qr.valueOf(Te)).multiply(Qr.TEN),Fe&&W.selfAdd(Qr.TEN);var We=!0,et=Qr.magnitude(W._hi);if(et<0&&Math.abs(et)>=ye-be&&(We=!1),!We)break}return V[0]=K,ue.toString()},Qr.prototype.sqr=function(){return this.multiply(this)},Qr.prototype.doubleValue=function(){return this._hi+this._lo},Qr.prototype.subtract=function(){if(arguments[0]instanceof Qr){var B=arguments[0];return this.add(B.negate())}if(typeof arguments[0]=="number"){var V=arguments[0];return this.add(-V)}},Qr.prototype.equals=function(){if(arguments.length===1){var B=arguments[0];return this._hi===B._hi&&this._lo===B._lo}},Qr.prototype.isZero=function(){return this._hi===0&&this._lo===0},Qr.prototype.selfSubtract=function(){if(arguments[0]instanceof Qr){var B=arguments[0];return this.isNaN()?this:this.selfAdd(-B._hi,-B._lo)}if(typeof arguments[0]=="number"){var V=arguments[0];return this.isNaN()?this:this.selfAdd(-V,0)}},Qr.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Qr.prototype.min=function(B){return this.le(B)?this:B},Qr.prototype.selfDivide=function(){if(arguments.length===1){if(arguments[0]instanceof Qr){var B=arguments[0];return this.selfDivide(B._hi,B._lo)}if(typeof arguments[0]=="number"){var V=arguments[0];return this.selfDivide(V,0)}}else if(arguments.length===2){var W=arguments[0],K=arguments[1],te=null,le=null,ue=null,ye=null,be=null,Te=null,Fe=null,Le=null;return be=this._hi/W,Le=(te=(Te=Qr.SPLIT*be)-(te=Te-be))*(ue=(Le=Qr.SPLIT*W)-(ue=Le-W))-(Fe=be*W)+te*(ye=W-ue)+(le=be-te)*ue+le*ye,Le=be+(Te=(this._hi-Fe-Le+this._lo-be*K)/W),this._hi=Le,this._lo=be-Le+Te,this}},Qr.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Qr.prototype.divide=function(){if(arguments[0]instanceof Qr){var B=arguments[0],V=null,W=null,K=null,te=null,le=null,ue=null,ye=null,be=null;W=(le=this._hi/B._hi)-(V=(ue=Qr.SPLIT*le)-(V=ue-le)),be=V*(K=(be=Qr.SPLIT*B._hi)-(K=be-B._hi))-(ye=le*B._hi)+V*(te=B._hi-K)+W*K+W*te;var Te=be=le+(ue=(this._hi-ye-be+this._lo-le*B._lo)/B._hi),Fe=le-be+ue;return new Qr(Te,Fe)}if(typeof arguments[0]=="number"){var Le=arguments[0];return Ts.isNaN(Le)?Qr.createNaN():Qr.copy(this).selfDivide(Le,0)}},Qr.prototype.ge=function(B){return(this._hi>B._hi||this._hi===B._hi)&&this._lo>=B._lo},Qr.prototype.pow=function(B){if(B===0)return Qr.valueOf(1);var V=new Qr(this),W=Qr.valueOf(1),K=Math.abs(B);if(K>1)for(;K>0;)K%2==1&&W.selfMultiply(V),(K/=2)>0&&(V=V.sqr());else W=V;return B<0?W.reciprocal():W},Qr.prototype.ceil=function(){if(this.isNaN())return Qr.NaN;var B=Math.ceil(this._hi),V=0;return B===this._hi&&(V=Math.ceil(this._lo)),new Qr(B,V)},Qr.prototype.compareTo=function(B){var V=B;return this._hiV._hi?1:this._loV._lo?1:0},Qr.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Qr.prototype.setValue=function(){if(arguments[0]instanceof Qr){var B=arguments[0];return this.init(B),this}if(typeof arguments[0]=="number"){var V=arguments[0];return this.init(V),this}},Qr.prototype.max=function(B){return this.ge(B)?this:B},Qr.prototype.sqrt=function(){if(this.isZero())return Qr.valueOf(0);if(this.isNegative())return Qr.NaN;var B=1/Math.sqrt(this._hi),V=this._hi*B,W=Qr.valueOf(V),K=this.subtract(W.sqr())._hi*(.5*B);return W.add(K)},Qr.prototype.selfAdd=function(){if(arguments.length===1){if(arguments[0]instanceof Qr){var B=arguments[0];return this.selfAdd(B._hi,B._lo)}if(typeof arguments[0]=="number"){var V=arguments[0],W=null,K=null,te=null,le=null,ue=null,ye=null;return le=(te=this._hi+V)-(ue=te-this._hi),K=(ye=(le=V-ue+(this._hi-le))+this._lo)+(te-(W=te+ye)),this._hi=W+K,this._lo=K+(W-this._hi),this}}else if(arguments.length===2){var be=arguments[0],Te=arguments[1],Fe=null,Le=null,We=null,et=null,Ze=null,ot=null,Ke=null;et=this._hi+be,Le=this._lo+Te,Ze=et-(ot=et-this._hi),We=Le-(Ke=Le-this._lo);var Bt=(Fe=et+(ot=(Ze=be-ot+(this._hi-Ze))+Le))+(ot=(We=Te-Ke+(this._lo-We))+(ot+(et-Fe))),gi=ot+(Fe-Bt);return this._hi=Bt,this._lo=gi,this}},Qr.prototype.selfMultiply=function(){if(arguments.length===1){if(arguments[0]instanceof Qr){var B=arguments[0];return this.selfMultiply(B._hi,B._lo)}if(typeof arguments[0]=="number"){var V=arguments[0];return this.selfMultiply(V,0)}}else if(arguments.length===2){var W=arguments[0],K=arguments[1],te=null,le=null,ue=null,ye=null,be=null,Te=null;te=(be=Qr.SPLIT*this._hi)-this._hi,Te=Qr.SPLIT*W,te=be-te,le=this._hi-te,ue=Te-W;var Fe=(be=this._hi*W)+(Te=te*(ue=Te-ue)-be+te*(ye=W-ue)+le*ue+le*ye+(this._hi*K+this._lo*W)),Le=Te+(te=be-Fe);return this._hi=Fe,this._lo=Le,this}},Qr.prototype.selfSqr=function(){return this.selfMultiply(this)},Qr.prototype.floor=function(){if(this.isNaN())return Qr.NaN;var B=Math.floor(this._hi),V=0;return B===this._hi&&(V=Math.floor(this._lo)),new Qr(B,V)},Qr.prototype.negate=function(){return this.isNaN()?this:new Qr(-this._hi,-this._lo)},Qr.prototype.clone=function(){},Qr.prototype.multiply=function(){if(arguments[0]instanceof Qr){var B=arguments[0];return B.isNaN()?Qr.createNaN():Qr.copy(this).selfMultiply(B)}if(typeof arguments[0]=="number"){var V=arguments[0];return Ts.isNaN(V)?Qr.createNaN():Qr.copy(this).selfMultiply(V,0)}},Qr.prototype.isNaN=function(){return Ts.isNaN(this._hi)},Qr.prototype.intValue=function(){return Math.trunc(this._hi)},Qr.prototype.toString=function(){var B=Qr.magnitude(this._hi);return B>=-3&&B<=20?this.toStandardNotation():this.toSciNotation()},Qr.prototype.toStandardNotation=function(){var B=this.getSpecialNumberString();if(B!==null)return B;var V=new Array(1).fill(null),W=this.extractSignificantDigits(!0,V),K=V[0]+1,te=W;if(W.charAt(0)===".")te="0"+W;else if(K<0)te="0."+Qr.stringOfChar("0",-K)+W;else if(W.indexOf(".")===-1){var le=K-W.length;te=W+Qr.stringOfChar("0",le)+".0"}return this.isNegative()?"-"+te:te},Qr.prototype.reciprocal=function(){var B,V,W,K,te=null,le=null,ue=null,ye=null;B=(W=1/this._hi)-(te=(ue=Qr.SPLIT*W)-(te=ue-W)),le=(ye=Qr.SPLIT*this._hi)-this._hi;var be=W+(ue=(1-(K=W*this._hi)-(ye=te*(le=ye-le)-K+te*(V=this._hi-le)+B*le+B*V)-W*this._lo)/this._hi);return new Qr(be,W-be+ue)},Qr.prototype.toSciNotation=function(){if(this.isZero())return Qr.SCI_NOT_ZERO;var B=this.getSpecialNumberString();if(B!==null)return B;var V=new Array(1).fill(null),W=this.extractSignificantDigits(!1,V),K=Qr.SCI_NOT_EXPONENT_CHAR+V[0];if(W.charAt(0)==="0")throw new Error("Found leading zero: "+W);var te="";W.length>1&&(te=W.substring(1));var le=W.charAt(0)+"."+te;return this.isNegative()?"-"+le+K:le+K},Qr.prototype.abs=function(){return this.isNaN()?Qr.NaN:this.isNegative()?this.negate():new Qr(this)},Qr.prototype.isPositive=function(){return(this._hi>0||this._hi===0)&&this._lo>0},Qr.prototype.lt=function(B){return(this._hiB._hi||this._hi===B._hi)&&this._lo>B._lo},Qr.prototype.isNegative=function(){return(this._hi<0||this._hi===0)&&this._lo<0},Qr.prototype.trunc=function(){return this.isNaN()?Qr.NaN:this.isPositive()?this.floor():this.ceil()},Qr.prototype.signum=function(){return this._hi>0?1:this._hi<0?-1:this._lo>0?1:this._lo<0?-1:0},Qr.prototype.interfaces_=function(){return[f0,Ig,NL]},Qr.prototype.getClass=function(){return Qr},Qr.sqr=function(B){return Qr.valueOf(B).selfMultiply(B)},Qr.valueOf=function(){if(typeof arguments[0]=="string"){var B=arguments[0];return Qr.parse(B)}if(typeof arguments[0]=="number"){var V=arguments[0];return new Qr(V)}},Qr.sqrt=function(B){return Qr.valueOf(B).sqrt()},Qr.parse=function(B){for(var V=0,W=B.length;bS.isWhitespace(B.charAt(V));)V++;var K=!1;if(V=W);){var Te=B.charAt(V);if(V++,bS.isDigit(Te)){var Fe=Te-"0";le.selfMultiply(Qr.TEN),le.selfAdd(Fe),ue++}else{if(Te!=="."){if(Te==="e"||Te==="E"){var Le=B.substring(V);try{be=K_.parseInt(Le)}catch(Ke){throw Ke instanceof Error?new Error("Invalid exponent "+Le+" in string "+B):Ke}break}throw new Error("Unexpected character '"+Te+"' at position "+V+" in string "+B)}ye=ue}}var We=le,et=ue-ye-be;if(et===0)We=le;else if(et>0){var Ze=Qr.TEN.pow(et);We=le.divide(Ze)}else if(et<0){var ot=Qr.TEN.pow(-et);We=le.multiply(ot)}return K?We.negate():We},Qr.createNaN=function(){return new Qr(Ts.NaN,Ts.NaN)},Qr.copy=function(B){return new Qr(B)},Qr.magnitude=function(B){var V=Math.abs(B),W=Math.log(V)/Math.log(10),K=Math.trunc(Math.floor(W));return 10*Math.pow(10,K)<=V&&(K+=1),K},Qr.stringOfChar=function(B,V){for(var W=new p0,K=0;K0){if(le<=0)return Up.signum(ue);K=te+le}else{if(!(te<0)||le>=0)return Up.signum(ue);K=-te-le}var ye=Up.DP_SAFE_EPSILON*K;return ue>=ye||-ue>=ye?Up.signum(ue):2},Up.signum=function(B){return B>0?1:B<0?-1:0},iV.DP_SAFE_EPSILON.get=function(){return 1e-15},Object.defineProperties(Up,iV);var _l=function(){},gI={X:{configurable:!0},Y:{configurable:!0},Z:{configurable:!0},M:{configurable:!0}};gI.X.get=function(){return 0},gI.Y.get=function(){return 1},gI.Z.get=function(){return 2},gI.M.get=function(){return 3},_l.prototype.setOrdinate=function(B,V,W){},_l.prototype.size=function(){},_l.prototype.getOrdinate=function(B,V){},_l.prototype.getCoordinate=function(){},_l.prototype.getCoordinateCopy=function(B){},_l.prototype.getDimension=function(){},_l.prototype.getX=function(B){},_l.prototype.clone=function(){},_l.prototype.expandEnvelope=function(B){},_l.prototype.copy=function(){},_l.prototype.getY=function(B){},_l.prototype.toCoordinateArray=function(){},_l.prototype.interfaces_=function(){return[NL]},_l.prototype.getClass=function(){return _l},Object.defineProperties(_l,gI);var rV=function(){},Hb=function(B){function V(){B.call(this,"Projective point not representable on the Cartesian plane.")}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(rV),Xf=function(){};Xf.arraycopy=function(B,V,W,K,te){for(var le=0,ue=V;ueB._minx?this._minx:B._minx,W=this._miny>B._miny?this._miny:B._miny,K=this._maxx=this._minx&&V.getMaxX()<=this._maxx&&V.getMinY()>=this._miny&&V.getMaxY()<=this._maxy}}else if(arguments.length===2){var W=arguments[0],K=arguments[1];return!this.isNull()&&W>=this._minx&&W<=this._maxx&&K>=this._miny&&K<=this._maxy}},Aa.prototype.intersects=function(){if(arguments.length===1){if(arguments[0]instanceof Aa){var B=arguments[0];return!this.isNull()&&!B.isNull()&&!(B._minx>this._maxx||B._maxxthis._maxy||B._maxythis._maxx||Wthis._maxy||Kthis._maxx&&(this._maxx=V._maxx),V._minythis._maxy&&(this._maxy=V._maxy))}}else if(arguments.length===2){var W=arguments[0],K=arguments[1];this.isNull()?(this._minx=W,this._maxx=W,this._miny=K,this._maxy=K):(Wthis._maxx&&(this._maxx=W),Kthis._maxy&&(this._maxy=K))}},Aa.prototype.minExtent=function(){if(this.isNull())return 0;var B=this.getWidth(),V=this.getHeight();return BV._minx?1:this._minyV._miny?1:this._maxxV._maxx?1:this._maxyV._maxy?1:0},Aa.prototype.translate=function(B,V){if(this.isNull())return null;this.init(this.getMinX()+B,this.getMaxX()+B,this.getMinY()+V,this.getMaxY()+V)},Aa.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Aa.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Aa.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Aa.prototype.maxExtent=function(){if(this.isNull())return 0;var B=this.getWidth(),V=this.getHeight();return B>V?B:V},Aa.prototype.expandBy=function(){if(arguments.length===1){var B=arguments[0];this.expandBy(B,B)}else if(arguments.length===2){var V=arguments[0],W=arguments[1];if(this.isNull())return null;this._minx-=V,this._maxx+=V,this._miny-=W,this._maxy+=W,(this._minx>this._maxx||this._miny>this._maxy)&&this.setToNull()}},Aa.prototype.contains=function(){if(arguments.length===1){if(arguments[0]instanceof Aa){var B=arguments[0];return this.covers(B)}if(arguments[0]instanceof Pr){var V=arguments[0];return this.covers(V)}}else if(arguments.length===2){var W=arguments[0],K=arguments[1];return this.covers(W,K)}},Aa.prototype.centre=function(){return this.isNull()?null:new Pr((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Aa.prototype.init=function(){if(arguments.length===0)this.setToNull();else if(arguments.length===1){if(arguments[0]instanceof Pr){var B=arguments[0];this.init(B.x,B.x,B.y,B.y)}else if(arguments[0]instanceof Aa){var V=arguments[0];this._minx=V._minx,this._maxx=V._maxx,this._miny=V._miny,this._maxy=V._maxy}}else if(arguments.length===2){var W=arguments[0],K=arguments[1];this.init(W.x,K.x,W.y,K.y)}else if(arguments.length===4){var te=arguments[0],le=arguments[1],ue=arguments[2],ye=arguments[3];teB._maxx&&(V=this._minx-B._maxx);var W=0;return this._maxyB._maxy&&(W=this._miny-B._maxy),V===0?W:W===0?V:Math.sqrt(V*V+W*W)},Aa.prototype.hashCode=function(){var B=17;return B=37*(B=37*(B=37*(B=37*B+Pr.hashCode(this._minx))+Pr.hashCode(this._maxx))+Pr.hashCode(this._miny))+Pr.hashCode(this._maxy)},Aa.prototype.interfaces_=function(){return[Ig,f0]},Aa.prototype.getClass=function(){return Aa},Aa.intersects=function(){if(arguments.length===3){var B=arguments[0],V=arguments[1],W=arguments[2];return W.x>=(B.xV.x?B.x:V.x)&&W.y>=(B.yV.y?B.y:V.y)}if(arguments.length===4){var K=arguments[0],te=arguments[1],le=arguments[2],ue=arguments[3],ye=Math.min(le.x,ue.x),be=Math.max(le.x,ue.x),Te=Math.min(K.x,te.x),Fe=Math.max(K.x,te.x);return!(Te>be)&&!(Febe)&&!(FeW?(this._intLineIndex[B][0]=0,this._intLineIndex[B][1]=1):(this._intLineIndex[B][0]=1,this._intLineIndex[B][1]=0)}},dh.prototype.isProper=function(){return this.hasIntersection()&&this._isProper},dh.prototype.setPrecisionModel=function(B){this._precisionModel=B},dh.prototype.isInteriorIntersection=function(){var B=this;if(arguments.length===0)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(arguments.length===1){for(var V=arguments[0],W=0;Wte?K:te;else{var ue=Math.abs(B.x-V.x),ye=Math.abs(B.y-V.y);(le=K>te?ue:ye)!==0||B.equals(V)||(le=Math.max(ue,ye))}return Fs.isTrue(!(le===0&&!B.equals(V)),"Bad distance calculation"),le},dh.nonRobustComputeEdgeDistance=function(B,V,W){var K=B.x-V.x,te=B.y-V.y,le=Math.sqrt(K*K+te*te);return Fs.isTrue(!(le===0&&!B.equals(V)),"Invalid distance calculation"),le},tE.DONT_INTERSECT.get=function(){return 0},tE.DO_INTERSECT.get=function(){return 1},tE.COLLINEAR.get=function(){return 2},tE.NO_INTERSECTION.get=function(){return 0},tE.POINT_INTERSECTION.get=function(){return 1},tE.COLLINEAR_INTERSECTION.get=function(){return 2},Object.defineProperties(dh,tE);var Ub=function(B){function V(){B.apply(this,arguments)}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.isInSegmentEnvelopes=function(W){var K=new Aa(this._inputLines[0][0],this._inputLines[0][1]),te=new Aa(this._inputLines[1][0],this._inputLines[1][1]);return K.contains(W)&&te.contains(W)},V.prototype.computeIntersection=function(){if(arguments.length!==3)return B.prototype.computeIntersection.apply(this,arguments);var W=arguments[0],K=arguments[1],te=arguments[2];if(this._isProper=!1,Aa.intersects(K,te,W)&&Po.orientationIndex(K,te,W)===0&&Po.orientationIndex(te,K,W)===0)return this._isProper=!0,(W.equals(K)||W.equals(te))&&(this._isProper=!1),this._result=B.POINT_INTERSECTION,null;this._result=B.NO_INTERSECTION},V.prototype.normalizeToMinimum=function(W,K,te,le,ue){ue.x=this.smallestInAbsValue(W.x,K.x,te.x,le.x),ue.y=this.smallestInAbsValue(W.y,K.y,te.y,le.y),W.x-=ue.x,W.y-=ue.y,K.x-=ue.x,K.y-=ue.y,te.x-=ue.x,te.y-=ue.y,le.x-=ue.x,le.y-=ue.y},V.prototype.safeHCoordinateIntersection=function(W,K,te,le){var ue=null;try{ue=Mg.intersection(W,K,te,le)}catch(ye){if(!(ye instanceof Hb))throw ye;ue=V.nearestEndpoint(W,K,te,le)}return ue},V.prototype.intersection=function(W,K,te,le){var ue=this.intersectionWithNormalization(W,K,te,le);return this.isInSegmentEnvelopes(ue)||(ue=new Pr(V.nearestEndpoint(W,K,te,le))),this._precisionModel!==null&&this._precisionModel.makePrecise(ue),ue},V.prototype.smallestInAbsValue=function(W,K,te,le){var ue=W,ye=Math.abs(ue);return Math.abs(K)1e-4&&Xf.out.println("Distance = "+ue.distance(ye))},V.prototype.intersectionWithNormalization=function(W,K,te,le){var ue=new Pr(W),ye=new Pr(K),be=new Pr(te),Te=new Pr(le),Fe=new Pr;this.normalizeToEnvCentre(ue,ye,be,Te,Fe);var Le=this.safeHCoordinateIntersection(ue,ye,be,Te);return Le.x+=Fe.x,Le.y+=Fe.y,Le},V.prototype.computeCollinearIntersection=function(W,K,te,le){var ue=Aa.intersects(W,K,te),ye=Aa.intersects(W,K,le),be=Aa.intersects(te,le,W),Te=Aa.intersects(te,le,K);return ue&&ye?(this._intPt[0]=te,this._intPt[1]=le,B.COLLINEAR_INTERSECTION):be&&Te?(this._intPt[0]=W,this._intPt[1]=K,B.COLLINEAR_INTERSECTION):ue&&be?(this._intPt[0]=te,this._intPt[1]=W,!te.equals(W)||ye||Te?B.COLLINEAR_INTERSECTION:B.POINT_INTERSECTION):ue&&Te?(this._intPt[0]=te,this._intPt[1]=K,!te.equals(K)||ye||be?B.COLLINEAR_INTERSECTION:B.POINT_INTERSECTION):ye&&be?(this._intPt[0]=le,this._intPt[1]=W,!le.equals(W)||ue||Te?B.COLLINEAR_INTERSECTION:B.POINT_INTERSECTION):ye&&Te?(this._intPt[0]=le,this._intPt[1]=K,!le.equals(K)||ue||be?B.COLLINEAR_INTERSECTION:B.POINT_INTERSECTION):B.NO_INTERSECTION},V.prototype.normalizeToEnvCentre=function(W,K,te,le,ue){var ye=W.xK.x?W.x:K.x,Fe=W.y>K.y?W.y:K.y,Le=te.xle.x?te.x:le.x,Ze=te.y>le.y?te.y:le.y,ot=((ye>Le?ye:Le)+(TeWe?be:We)+(Fe0&&ye>0||ue<0&&ye<0)return B.NO_INTERSECTION;var be=Po.orientationIndex(te,le,W),Te=Po.orientationIndex(te,le,K);return be>0&&Te>0||be<0&&Te<0?B.NO_INTERSECTION:ue===0&&ye===0&&be===0&&Te===0?this.computeCollinearIntersection(W,K,te,le):(ue===0||ye===0||be===0||Te===0?(this._isProper=!1,W.equals2D(te)||W.equals2D(le)?this._intPt[0]=W:K.equals2D(te)||K.equals2D(le)?this._intPt[0]=K:ue===0?this._intPt[0]=new Pr(te):ye===0?this._intPt[0]=new Pr(le):be===0?this._intPt[0]=new Pr(W):Te===0&&(this._intPt[0]=new Pr(K))):(this._isProper=!0,this._intPt[0]=this.intersection(W,K,te,le)),B.POINT_INTERSECTION)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.nearestEndpoint=function(W,K,te,le){var ue=W,ye=Po.distancePointLine(W,te,le),be=Po.distancePointLine(K,te,le);return be0?W>0?-te:te:W>0?te:-te;if(V===0||W===0)return K>0?B>0?te:-te:B>0?-te:te;if(V>0?K>0?V<=K||(te=-te,le=B,B=W,W=le,le=V,V=K,K=le):V<=-K?(te=-te,W=-W,K=-K):(le=B,B=-W,W=le,le=V,V=-K,K=le):K>0?-V<=K?(te=-te,B=-B,V=-V):(le=-B,B=W,W=le,le=-V,V=K,K=le):V>=K?(B=-B,V=-V,W=-W,K=-K):(te=-te,le=-B,B=-W,W=le,le=-V,V=-K,K=le),B>0){if(!(W>0)||!(B<=W))return te}else{if(W>0||!(B>=W))return-te;te=-te,B=-B,W=-W}for(;;){if((K-=(ue=Math.floor(W/B))*V)<0)return-te;if(K>V)return te;if(B>(W-=ue*B)+W){if(VK+K)return-te;W=B-W,K=V-K,te=-te}if(K===0)return W===0?0:-te;if(W===0||(V-=(ue=Math.floor(B/W))*K)<0)return te;if(V>K)return-te;if(W>(B-=ue*W)+B){if(KV+V)return te;B=W-B,V=K-V,te=-te}if(V===0)return B===0?0:te;if(B===0)return-te}};var Z_=function(){this._p=null,this._crossingCount=0,this._isPointOnSegment=!1;var B=arguments[0];this._p=B};Z_.prototype.countSegment=function(B,V){if(B.xK&&(W=V.x,K=B.x),this._p.x>=W&&this._p.x<=K&&(this._isPointOnSegment=!0),null}if(B.y>this._p.y&&V.y<=this._p.y||V.y>this._p.y&&B.y<=this._p.y){var te=B.x-this._p.x,le=B.y-this._p.y,ue=V.x-this._p.x,ye=V.y-this._p.y,be=iE.signOfDet2x2(te,le,ue,ye);if(be===0)return this._isPointOnSegment=!0,null;ye0&&this._crossingCount++}},Z_.prototype.isPointInPolygon=function(){return this.getLocation()!==Hr.EXTERIOR},Z_.prototype.getLocation=function(){return this._isPointOnSegment?Hr.BOUNDARY:this._crossingCount%2==1?Hr.INTERIOR:Hr.EXTERIOR},Z_.prototype.isOnSegment=function(){return this._isPointOnSegment},Z_.prototype.interfaces_=function(){return[]},Z_.prototype.getClass=function(){return Z_},Z_.locatePointInRing=function(){if(arguments[0]instanceof Pr&&os(arguments[1],_l)){for(var B=arguments[0],V=arguments[1],W=new Z_(B),K=new Pr,te=new Pr,le=1;le1||ye<0||ye>1)&&(te=!0)}}else te=!0;return te?Sh.min(Po.distancePointLine(B,W,K),Po.distancePointLine(V,W,K),Po.distancePointLine(W,B,V),Po.distancePointLine(K,B,V)):0},Po.isPointInRing=function(B,V){return Po.locatePointInRing(B,V)!==Hr.EXTERIOR},Po.computeLength=function(B){var V=B.size();if(V<=1)return 0;var W=0,K=new Pr;B.getCoordinate(0,K);for(var te=K.x,le=K.y,ue=1;ueW.y&&(W=le,K=te)}var ue=K;do(ue-=1)<0&&(ue=V);while(B[ue].equals2D(W)&&ue!==K);var ye=K;do ye=(ye+1)%V;while(B[ye].equals2D(W)&&ye!==K);var be=B[ue],Te=B[ye];if(be.equals2D(W)||Te.equals2D(W)||be.equals2D(Te))return!1;var Fe=Po.computeOrientation(be,W,Te),Le=!1;return Le=Fe===0?be.x>Te.x:Fe>0,Le},Po.locatePointInRing=function(B,V){return Z_.locatePointInRing(B,V)},Po.distancePointLinePerpendicular=function(B,V,W){var K=(W.x-V.x)*(W.x-V.x)+(W.y-V.y)*(W.y-V.y),te=((V.y-B.y)*(W.x-V.x)-(V.x-B.x)*(W.y-V.y))/K;return Math.abs(te)*Math.sqrt(K)},Po.computeOrientation=function(B,V,W){return Po.orientationIndex(B,V,W)},Po.distancePointLine=function(){if(arguments.length===2){var B=arguments[0],V=arguments[1];if(V.length===0)throw new sh("Line array must contain at least one vertex");for(var W=B.distance(V[0]),K=0;K=1)return le.distance(ye);var Fe=((ue.y-le.y)*(ye.x-ue.x)-(ue.x-le.x)*(ye.y-ue.y))/be;return Math.abs(Fe)*Math.sqrt(be)}},Po.isOnLine=function(B,V){for(var W=new Ub,K=1;K0},rE.prototype.interfaces_=function(){return[m0]},rE.prototype.getClass=function(){return rE};var TS=function(){};TS.prototype.isInBoundary=function(B){return B>1},TS.prototype.interfaces_=function(){return[m0]},TS.prototype.getClass=function(){return TS};var t1=function(){};t1.prototype.isInBoundary=function(B){return B===1},t1.prototype.interfaces_=function(){return[m0]},t1.prototype.getClass=function(){return t1};var Ed=function(){};function jN(B){this.message=B||""}Ed.prototype.add=function(){},Ed.prototype.addAll=function(){},Ed.prototype.isEmpty=function(){},Ed.prototype.iterator=function(){},Ed.prototype.size=function(){},Ed.prototype.toArray=function(){},Ed.prototype.remove=function(){},jN.prototype=new Error,jN.prototype.name="IndexOutOfBoundsException";var SS=function(){};SS.prototype.hasNext=function(){},SS.prototype.next=function(){},SS.prototype.remove=function(){};var me=function(B){function V(){B.apply(this,arguments)}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.get=function(){},V.prototype.set=function(){},V.prototype.isEmpty=function(){},V}(Ed);function we(B){this.message=B||""}we.prototype=new Error,we.prototype.name="NoSuchElementException";var Be=function(B){function V(){B.call(this),this.array_=[],arguments[0]instanceof Ed&&this.addAll(arguments[0])}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.ensureCapacity=function(){},V.prototype.interfaces_=function(){return[B,Ed]},V.prototype.add=function(W){return arguments.length===1?this.array_.push(W):this.array_.splice(arguments[0],arguments[1]),!0},V.prototype.clear=function(){this.array_=[]},V.prototype.addAll=function(W){for(var K=W.iterator();K.hasNext();)this.add(K.next());return!0},V.prototype.set=function(W,K){var te=this.array_[W];return this.array_[W]=K,te},V.prototype.iterator=function(){return new ht(this)},V.prototype.get=function(W){if(W<0||W>=this.size())throw new jN;return this.array_[W]},V.prototype.isEmpty=function(){return this.array_.length===0},V.prototype.size=function(){return this.array_.length},V.prototype.toArray=function(){for(var W=[],K=0,te=this.array_.length;K=1){var Te=this.get(this.size()-1);if(Te.equals2D(ye))return null}B.prototype.add.call(this,ye)}else if(arguments[0]instanceof Object&&typeof arguments[1]=="boolean"){var Fe=arguments[0],Le=arguments[1];return this.add(Fe,Le),!0}}else if(arguments.length===3){if(typeof arguments[2]=="boolean"&&arguments[0]instanceof Array&&typeof arguments[1]=="boolean"){var We=arguments[0],et=arguments[1],Ze=arguments[2];if(Ze)for(var ot=0;ot=0;Ke--)K.add(We[Ke],et);return!0}if(typeof arguments[2]=="boolean"&&Number.isInteger(arguments[0])&&arguments[1]instanceof Pr){var Bt=arguments[0],gi=arguments[1],rt=arguments[2];if(!rt){var Ft=this.size();if(Ft>0){if(Bt>0){var zt=this.get(Bt-1);if(zt.equals2D(gi))return null}if(Btrn&&(Dr=-1);for(var mn=Cr;mn!==rn;mn+=Dr)K.add(qt[mn],Fr);return!0}},V.prototype.closeRing=function(){this.size()>0&&this.add(new Pr(this.get(0)),!1)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},Object.defineProperties(V,W),V}(Be),di=function(){},tr={ForwardComparator:{configurable:!0},BidirectionalComparator:{configurable:!0},coordArrayType:{configurable:!0}};tr.ForwardComparator.get=function(){return mr},tr.BidirectionalComparator.get=function(){return Mr},tr.coordArrayType.get=function(){return new Array(0).fill(null)},di.prototype.interfaces_=function(){return[]},di.prototype.getClass=function(){return di},di.isRing=function(B){return!(B.length<4)&&!!B[0].equals2D(B[B.length-1])},di.ptNotInList=function(B,V){for(var W=0;W=B?V:[]},di.indexOf=function(B,V){for(var W=0;W0)&&(V=B[W]);return V},di.extract=function(B,V,W){V=Sh.clamp(V,0,B.length);var K=(W=Sh.clamp(W,-1,B.length))-V+1;W<0&&(K=0),V>=B.length&&(K=0),WK.length)return 1;if(W.length===0)return 0;var te=di.compare(W,K);return di.isEqualReversed(W,K)?0:te},Mr.prototype.OLDcompare=function(B,V){var W=B,K=V;if(W.lengthK.length)return 1;if(W.length===0)return 0;for(var te=di.increasingDirection(W),le=di.increasingDirection(K),ue=te>0?0:W.length-1,ye=le>0?0:W.length-1,be=0;be0))return V.value;V=V.right}}return null},oc.prototype.put=function(B,V){if(this.root_===null)return this.root_={key:B,value:V,left:null,right:null,parent:null,color:0,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var W,K,te=this.root_;do if(W=te,(K=B.compareTo(te.key))<0)te=te.left;else{if(!(K>0)){var le=te.value;return te.value=V,le}te=te.right}while(te!==null);var ue={key:B,left:null,right:null,value:V,parent:W,color:0,getValue:function(){return this.value},getKey:function(){return this.key}};return K<0?W.left=ue:W.right=ue,this.fixAfterInsertion(ue),this.size_++,null},oc.prototype.fixAfterInsertion=function(B){var V=this;for(B.color=1;B!=null&&B!==this.root_&&B.parent.color===1;)if(Go(B)===Au(Go(Go(B)))){var W=_m(Go(Go(B)));Pl(W)===1?(rl(Go(B),0),rl(W,0),rl(Go(Go(B)),1),B=Go(Go(B))):(B===_m(Go(B))&&(B=Go(B),V.rotateLeft(B)),rl(Go(B),0),rl(Go(Go(B)),1),V.rotateRight(Go(Go(B))))}else{var K=Au(Go(Go(B)));Pl(K)===1?(rl(Go(B),0),rl(K,0),rl(Go(Go(B)),1),B=Go(Go(B))):(B===Au(Go(B))&&(B=Go(B),V.rotateRight(B)),rl(Go(B),0),rl(Go(Go(B)),1),V.rotateLeft(Go(Go(B))))}this.root_.color=0},oc.prototype.values=function(){var B=new Be,V=this.getFirstEntry();if(V!==null)for(B.add(V.value);(V=oc.successor(V))!==null;)B.add(V.value);return B},oc.prototype.entrySet=function(){var B=new Ma,V=this.getFirstEntry();if(V!==null)for(B.add(V);(V=oc.successor(V))!==null;)B.add(V);return B},oc.prototype.rotateLeft=function(B){if(B!=null){var V=B.right;B.right=V.left,V.left!=null&&(V.left.parent=B),V.parent=B.parent,B.parent===null?this.root_=V:B.parent.left===B?B.parent.left=V:B.parent.right=V,V.left=B,B.parent=V}},oc.prototype.rotateRight=function(B){if(B!=null){var V=B.left;B.left=V.right,V.right!=null&&(V.right.parent=B),V.parent=B.parent,B.parent===null?this.root_=V:B.parent.right===B?B.parent.right=V:B.parent.left=V,V.right=B,B.parent=V}},oc.prototype.getFirstEntry=function(){var B=this.root_;if(B!=null)for(;B.left!=null;)B=B.left;return B},oc.successor=function(B){if(B===null)return null;if(B.right!==null){for(var V=B.right;V.left!==null;)V=V.left;return V}for(var W=B.parent,K=B;W!==null&&K===W.right;)K=W,W=W.parent;return W},oc.prototype.size=function(){return this.size_};var vm=function(){};function Xd(){}function Jd(){this.array_=[],arguments[0]instanceof Ed&&this.addAll(arguments[0])}vm.prototype.interfaces_=function(){return[]},vm.prototype.getClass=function(){return vm},Xd.prototype=new Jo,Jd.prototype=new Xd,Jd.prototype.contains=function(B){for(var V=0,W=this.array_.length;V=0;){var ue=te.substring(0,le);K.add(ue),le=(te=te.substring(le+W)).indexOf(V)}te.length>0&&K.add(te);for(var ye=new Array(K.size()).fill(null),be=0;be0)for(var le=te;le0&&K.append(" ");for(var le=0;le0&&K.append(","),K.append(tv.toString(B.getOrdinate(te,le)))}return K.append(")"),K.toString()}},Td.ensureValidRing=function(B,V){var W=V.size();return W===0?V:W<=3?Td.createClosedRing(B,V,4):V.getOrdinate(0,_l.X)===V.getOrdinate(W-1,_l.X)&&V.getOrdinate(0,_l.Y)===V.getOrdinate(W-1,_l.Y)?V:Td.createClosedRing(B,V,W+1)},Td.createClosedRing=function(B,V,W){var K=B.create(W,V.getDimension()),te=V.size();Td.copy(V,0,K,0,te);for(var le=te;le0&&Td.reverse(K._points),null}},V.prototype.getCoordinate=function(){return this.isEmpty()?null:this._points.getCoordinate(0)},V.prototype.getBoundaryDimension=function(){return this.isClosed()?ku.FALSE:0},V.prototype.isClosed=function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},V.prototype.getEndPoint=function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},V.prototype.getDimension=function(){return 1},V.prototype.getLength=function(){return Po.computeLength(this._points)},V.prototype.getNumPoints=function(){return this._points.size()},V.prototype.reverse=function(){var K=this._points.copy();return Td.reverse(K),this.getFactory().createLineString(K)},V.prototype.compareToSameClass=function(){var K=this;if(arguments.length===1){for(var te=arguments[0],le=te,ue=0,ye=0;ue= 2)");this._points=K},V.prototype.isCoordinate=function(K){for(var te=0;te=1&&this.getCoordinateSequence().size()= 4)")},V.prototype.getGeometryType=function(){return"LinearRing"},V.prototype.copy=function(){return new V(this._points.copy(),this._factory)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},W.MINIMUM_VALID_SIZE.get=function(){return 4},W.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(V,W),V}(fh),o1=function(B){function V(){B.apply(this,arguments)}B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V;var W={serialVersionUID:{configurable:!0}};return V.prototype.getSortIndex=function(){return Qa.SORTINDEX_MULTIPOLYGON},V.prototype.equalsExact=function(){if(arguments.length===2){var K=arguments[0],te=arguments[1];return!!this.isEquivalentClass(K)&&B.prototype.equalsExact.call(this,K,te)}return B.prototype.equalsExact.apply(this,arguments)},V.prototype.getBoundaryDimension=function(){return 1},V.prototype.getDimension=function(){return 2},V.prototype.reverse=function(){for(var K=this._geometries.length,te=new Array(K).fill(null),le=0;le0?V.createPoint(W[0]):V.createPoint():B},XN.prototype.interfaces_=function(){return[iv.GeometryEditorOperation]},XN.prototype.getClass=function(){return XN};var JN=function(){};JN.prototype.edit=function(B,V){return B instanceof n1?V.createLinearRing(this.edit(B.getCoordinateSequence(),B)):B instanceof fh?V.createLineString(this.edit(B.getCoordinateSequence(),B)):B instanceof g0?V.createPoint(this.edit(B.getCoordinateSequence(),B)):B},JN.prototype.interfaces_=function(){return[iv.GeometryEditorOperation]},JN.prototype.getClass=function(){return JN};var Pd=function(){var B=this;if(this._dimension=3,this._coordinates=null,arguments.length===1){if(arguments[0]instanceof Array)this._coordinates=arguments[0],this._dimension=3;else if(Number.isInteger(arguments[0])){var V=arguments[0];this._coordinates=new Array(V).fill(null);for(var W=0;W0){var B=new p0(17*this._coordinates.length);B.append("("),B.append(this._coordinates[0]);for(var V=1;V3&&(K=3),K<2?new Pd(W):new Pd(W,K)}},a1.prototype.interfaces_=function(){return[zb,f0]},a1.prototype.getClass=function(){return a1},a1.instance=function(){return a1.instanceObject},HG.serialVersionUID.get=function(){return-0x38e49fa6cf6f2e00},HG.instanceObject.get=function(){return new a1},Object.defineProperties(a1,HG);var gK=function(B){function V(){B.call(this),this.map_=new Map}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.get=function(W){return this.map_.get(W)||null},V.prototype.put=function(W,K){return this.map_.set(W,K),K},V.prototype.values=function(){for(var W=new Be,K=this.map_.values(),te=K.next();!te.done;)W.add(te.value),te=K.next();return W},V.prototype.entrySet=function(){var W=new Ma;return this.map_.entries().forEach(function(K){return W.add(K)}),W},V.prototype.size=function(){return this.map_.size()},V}(Ln),ll=function B(){if(this._modelType=null,this._scale=null,arguments.length===0)this._modelType=B.FLOATING;else if(arguments.length===1){if(arguments[0]instanceof Ix){var V=arguments[0];this._modelType=V,V===B.FIXED&&this.setScale(1)}else if(typeof arguments[0]=="number"){var W=arguments[0];this._modelType=B.FIXED,this.setScale(W)}else if(arguments[0]instanceof B){var K=arguments[0];this._modelType=K._modelType,this._scale=K._scale}}},UG={serialVersionUID:{configurable:!0},maximumPreciseValue:{configurable:!0}};ll.prototype.equals=function(B){if(!(B instanceof ll))return!1;var V=B;return this._modelType===V._modelType&&this._scale===V._scale},ll.prototype.compareTo=function(B){var V=B,W=this.getMaximumSignificantDigits(),K=V.getMaximumSignificantDigits();return new K_(W).compareTo(new K_(K))},ll.prototype.getScale=function(){return this._scale},ll.prototype.isFloating=function(){return this._modelType===ll.FLOATING||this._modelType===ll.FLOATING_SINGLE},ll.prototype.getType=function(){return this._modelType},ll.prototype.toString=function(){var B="UNKNOWN";return this._modelType===ll.FLOATING?B="Floating":this._modelType===ll.FLOATING_SINGLE?B="Floating-Single":this._modelType===ll.FIXED&&(B="Fixed (Scale="+this.getScale()+")"),B},ll.prototype.makePrecise=function(){if(typeof arguments[0]=="number"){var B=arguments[0];return Ts.isNaN(B)||this._modelType===ll.FLOATING_SINGLE?B:this._modelType===ll.FIXED?Math.round(B*this._scale)/this._scale:B}if(arguments[0]instanceof Pr){var V=arguments[0];if(this._modelType===ll.FLOATING)return null;V.x=this.makePrecise(V.x),V.y=this.makePrecise(V.y)}},ll.prototype.getMaximumSignificantDigits=function(){var B=16;return this._modelType===ll.FLOATING?B=16:this._modelType===ll.FLOATING_SINGLE?B=6:this._modelType===ll.FIXED&&(B=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),B},ll.prototype.setScale=function(B){this._scale=Math.abs(B)},ll.prototype.interfaces_=function(){return[f0,Ig]},ll.prototype.getClass=function(){return ll},ll.mostPrecise=function(B,V){return B.compareTo(V)>=0?B:V},UG.serialVersionUID.get=function(){return 7777263578777804e3},UG.maximumPreciseValue.get=function(){return 9007199254740992},Object.defineProperties(ll,UG);var Ix=function B(V){this._name=V||null,B.nameToTypeMap.put(V,this)},oE={serialVersionUID:{configurable:!0},nameToTypeMap:{configurable:!0}};Ix.prototype.readResolve=function(){return Ix.nameToTypeMap.get(this._name)},Ix.prototype.toString=function(){return this._name},Ix.prototype.interfaces_=function(){return[f0]},Ix.prototype.getClass=function(){return Ix},oE.serialVersionUID.get=function(){return-552860263173159e4},oE.nameToTypeMap.get=function(){return new gK},Object.defineProperties(Ix,oE),ll.Type=Ix,ll.FIXED=new Ix("FIXED"),ll.FLOATING=new Ix("FLOATING"),ll.FLOATING_SINGLE=new Ix("FLOATING SINGLE");var Ro=function B(){this._precisionModel=new ll,this._SRID=0,this._coordinateSequenceFactory=B.getDefaultCoordinateSequenceFactory(),arguments.length===0||(arguments.length===1?os(arguments[0],zb)?this._coordinateSequenceFactory=arguments[0]:arguments[0]instanceof ll&&(this._precisionModel=arguments[0]):arguments.length===2?(this._precisionModel=arguments[0],this._SRID=arguments[1]):arguments.length===3&&(this._precisionModel=arguments[0],this._SRID=arguments[1],this._coordinateSequenceFactory=arguments[2]))},_K={serialVersionUID:{configurable:!0}};Ro.prototype.toGeometry=function(B){return B.isNull()?this.createPoint(null):B.getMinX()===B.getMaxX()&&B.getMinY()===B.getMaxY()?this.createPoint(new Pr(B.getMinX(),B.getMinY())):B.getMinX()===B.getMaxX()||B.getMinY()===B.getMaxY()?this.createLineString([new Pr(B.getMinX(),B.getMinY()),new Pr(B.getMaxX(),B.getMaxY())]):this.createPolygon(this.createLinearRing([new Pr(B.getMinX(),B.getMinY()),new Pr(B.getMinX(),B.getMaxY()),new Pr(B.getMaxX(),B.getMaxY()),new Pr(B.getMaxX(),B.getMinY()),new Pr(B.getMinX(),B.getMinY())]),null)},Ro.prototype.createLineString=function(B){return B?B instanceof Array?new fh(this.getCoordinateSequenceFactory().create(B),this):os(B,_l)?new fh(B,this):void 0:new fh(this.getCoordinateSequenceFactory().create([]),this)},Ro.prototype.createMultiLineString=function(){if(arguments.length===0)return new r1(null,this);if(arguments.length===1){var B=arguments[0];return new r1(B,this)}},Ro.prototype.buildGeometry=function(B){for(var V=null,W=!1,K=!1,te=B.iterator();te.hasNext();){var le=te.next(),ue=le.getClass();V===null&&(V=ue),ue!==V&&(W=!0),le.isGeometryCollectionOrDerived()&&(K=!0)}if(V===null)return this.createGeometryCollection();if(W||K)return this.createGeometryCollection(Ro.toGeometryArray(B));var ye=B.iterator().next();if(B.size()>1){if(ye instanceof Sd)return this.createMultiPolygon(Ro.toPolygonArray(B));if(ye instanceof fh)return this.createMultiLineString(Ro.toLineStringArray(B));if(ye instanceof g0)return this.createMultiPoint(Ro.toPointArray(B));Fs.shouldNeverReachHere("Unhandled class: "+ye.getClass().getName())}return ye},Ro.prototype.createMultiPointFromCoords=function(B){return this.createMultiPoint(B!==null?this.getCoordinateSequenceFactory().create(B):null)},Ro.prototype.createPoint=function(){if(arguments.length===0)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Pr){var B=arguments[0];return this.createPoint(B!==null?this.getCoordinateSequenceFactory().create([B]):null)}if(os(arguments[0],_l)){var V=arguments[0];return new g0(V,this)}}},Ro.prototype.getCoordinateSequenceFactory=function(){return this._coordinateSequenceFactory},Ro.prototype.createPolygon=function(){if(arguments.length===0)return new Sd(null,null,this);if(arguments.length===1){if(os(arguments[0],_l)){var B=arguments[0];return this.createPolygon(this.createLinearRing(B))}if(arguments[0]instanceof Array){var V=arguments[0];return this.createPolygon(this.createLinearRing(V))}if(arguments[0]instanceof n1){var W=arguments[0];return this.createPolygon(W,null)}}else if(arguments.length===2){var K=arguments[0],te=arguments[1];return new Sd(K,te,this)}},Ro.prototype.getSRID=function(){return this._SRID},Ro.prototype.createGeometryCollection=function(){if(arguments.length===0)return new Gm(null,this);if(arguments.length===1){var B=arguments[0];return new Gm(B,this)}},Ro.prototype.createGeometry=function(B){return new iv(this).edit(B,{edit:function(){if(arguments.length===2){var V=arguments[0];return this._coordinateSequenceFactory.create(V)}}})},Ro.prototype.getPrecisionModel=function(){return this._precisionModel},Ro.prototype.createLinearRing=function(){if(arguments.length===0)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(arguments.length===1){if(arguments[0]instanceof Array){var B=arguments[0];return this.createLinearRing(B!==null?this.getCoordinateSequenceFactory().create(B):null)}if(os(arguments[0],_l)){var V=arguments[0];return new n1(V,this)}}},Ro.prototype.createMultiPolygon=function(){if(arguments.length===0)return new o1(null,this);if(arguments.length===1){var B=arguments[0];return new o1(B,this)}},Ro.prototype.createMultiPoint=function(){var B=this;if(arguments.length===0)return new _I(null,this);if(arguments.length===1){if(arguments[0]instanceof Array){var V=arguments[0];return new _I(V,this)}if(arguments[0]instanceof Array){var W=arguments[0];return this.createMultiPoint(W!==null?this.getCoordinateSequenceFactory().create(W):null)}if(os(arguments[0],_l)){var K=arguments[0];if(K===null)return this.createMultiPoint(new Array(0).fill(null));for(var te=new Array(K.size()).fill(null),le=0;le=this.size())throw new Error;return this.array_[B]},nv.prototype.push=function(B){return this.array_.push(B),B},nv.prototype.pop=function(B){if(this.array_.length===0)throw new sV;return this.array_.pop()},nv.prototype.peek=function(){if(this.array_.length===0)throw new sV;return this.array_[this.array_.length-1]},nv.prototype.empty=function(){return this.array_.length===0},nv.prototype.isEmpty=function(){return this.empty()},nv.prototype.search=function(B){return this.array_.indexOf(B)},nv.prototype.size=function(){return this.array_.length},nv.prototype.toArray=function(){for(var B=[],V=0,W=this.array_.length;V0&&this._minIndexthis._minCoord.y&&W.y>this._minCoord.y&&K===Po.CLOCKWISE)&&(te=!0),te&&(this._minIndex=this._minIndex-1)},Dx.prototype.getRightmostSideOfSegment=function(B,V){var W=B.getEdge().getCoordinates();if(V<0||V+1>=W.length||W[V].y===W[V+1].y)return-1;var K=ao.LEFT;return W[V].yV._minCoord.x)&&(V._minDe=B,V._minIndex=K,V._minCoord=W[K])},Dx.prototype.findRightmostEdgeAtNode=function(){var B=this._minDe.getNode().getEdges();this._minDe=B.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},Dx.prototype.findEdge=function(B){for(var V=B.iterator();V.hasNext();){var W=V.next();W.isForward()&&this.checkForRightmostCoordinate(W)}Fs.isTrue(this._minIndex!==0||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),this._minIndex===0?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===ao.LEFT&&(this._orientedDe=this._minDe.getSym())},Dx.prototype.interfaces_=function(){return[]},Dx.prototype.getClass=function(){return Dx};var Wm=function(B){function V(W,K){B.call(this,V.msgWithCoord(W,K)),this.pt=K?new Pr(K):null,this.name="TopologyException"}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.getCoordinate=function(){return this.pt},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.msgWithCoord=function(W,K){return K?W:W+" [ "+K+" ]"},V}(Ex),KN=function(){this.array_=[]};KN.prototype.addLast=function(B){this.array_.push(B)},KN.prototype.removeFirst=function(){return this.array_.shift()},KN.prototype.isEmpty=function(){return this.array_.length===0};var fp=function(){this._finder=null,this._dirEdgeList=new Be,this._nodes=new Be,this._rightMostCoord=null,this._env=null,this._finder=new Dx};fp.prototype.clearVisitedEdges=function(){for(var B=this._dirEdgeList.iterator();B.hasNext();)B.next().setVisited(!1)},fp.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},fp.prototype.computeNodeDepth=function(B){for(var V=null,W=B.getEdges().iterator();W.hasNext();){var K=W.next();if(K.isVisited()||K.getSym().isVisited()){V=K;break}}if(V===null)throw new Wm("unable to find edge to compute depths at "+B.getCoordinate());B.getEdges().computeDepths(V);for(var te=B.getEdges().iterator();te.hasNext();){var le=te.next();le.setVisited(!0),this.copySymDepths(le)}},fp.prototype.computeDepth=function(B){this.clearVisitedEdges();var V=this._finder.getEdge();V.setEdgeDepths(ao.RIGHT,B),this.copySymDepths(V),this.computeDepths(V)},fp.prototype.create=function(B){this.addReachable(B),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},fp.prototype.findResultEdges=function(){for(var B=this._dirEdgeList.iterator();B.hasNext();){var V=B.next();V.getDepth(ao.RIGHT)>=1&&V.getDepth(ao.LEFT)<=0&&!V.isInteriorAreaEdge()&&V.setInResult(!0)}},fp.prototype.computeDepths=function(B){var V=new Ma,W=new KN,K=B.getNode();for(W.addLast(K),V.add(K),B.setVisited(!0);!W.isEmpty();){var te=W.removeFirst();V.add(te),this.computeNodeDepth(te);for(var le=te.getEdges().iterator();le.hasNext();){var ue=le.next().getSym();if(!ue.isVisited()){var ye=ue.getNode();V.contains(ye)||(W.addLast(ye),V.add(ye))}}}},fp.prototype.compareTo=function(B){var V=B;return this._rightMostCoord.xV._rightMostCoord.x?1:0},fp.prototype.getEnvelope=function(){if(this._env===null){for(var B=new Aa,V=this._dirEdgeList.iterator();V.hasNext();)for(var W=V.next().getEdge().getCoordinates(),K=0;Kthis.location.length){var V=new Array(3).fill(null);V[ao.ON]=this.location[ao.ON],V[ao.LEFT]=Hr.NONE,V[ao.RIGHT]=Hr.NONE,this.location=V}for(var W=0;W1&&B.append(Hr.toLocationSymbol(this.location[ao.LEFT])),B.append(Hr.toLocationSymbol(this.location[ao.ON])),this.location.length>1&&B.append(Hr.toLocationSymbol(this.location[ao.RIGHT])),B.toString()},ks.prototype.setLocations=function(B,V,W){this.location[ao.ON]=B,this.location[ao.LEFT]=V,this.location[ao.RIGHT]=W},ks.prototype.get=function(B){return B1},ks.prototype.isAnyNull=function(){for(var B=0;BB._maxNodeDegree&&(B._maxNodeDegree=W),V=B.getNext(V)}while(V!==this._startDe);this._maxNodeDegree*=2},Id.prototype.addPoints=function(B,V,W){var K=B.getCoordinates();if(V){var te=1;W&&(te=0);for(var le=te;le=0;ye--)this._pts.add(K[ye])}},Id.prototype.isHole=function(){return this._isHole},Id.prototype.setInResult=function(){var B=this._startDe;do B.getEdge().setInResult(!0),B=B.getNext();while(B!==this._startDe)},Id.prototype.containsPoint=function(B){var V=this.getLinearRing();if(!V.getEnvelopeInternal().contains(B)||!Po.isPointInRing(B,V.getCoordinates()))return!1;for(var W=this._holes.iterator();W.hasNext();)if(W.next().containsPoint(B))return!1;return!0},Id.prototype.addHole=function(B){this._holes.add(B)},Id.prototype.isShell=function(){return this._shell===null},Id.prototype.getLabel=function(){return this._label},Id.prototype.getEdges=function(){return this._edges},Id.prototype.getMaxNodeDegree=function(){return this._maxNodeDegree<0&&this.computeMaxNodeDegree(),this._maxNodeDegree},Id.prototype.getShell=function(){return this._shell},Id.prototype.mergeLabel=function(){if(arguments.length===1){var B=arguments[0];this.mergeLabel(B,0),this.mergeLabel(B,1)}else if(arguments.length===2){var V=arguments[0],W=arguments[1],K=V.getLocation(W,ao.RIGHT);if(K===Hr.NONE)return null;if(this._label.getLocation(W)===Hr.NONE)return this._label.setLocation(W,K),null}},Id.prototype.setShell=function(B){this._shell=B,B!==null&&B.addHole(this)},Id.prototype.toPolygon=function(B){for(var V=new Array(this._holes.size()).fill(null),W=0;W=2,"found partial label"),this.computeIM(B)},n_.prototype.isInResult=function(){return this._isInResult},n_.prototype.isVisited=function(){return this._isVisited},n_.prototype.interfaces_=function(){return[]},n_.prototype.getClass=function(){return n_};var lV=function(B){function V(){B.call(this),this._coord=null,this._edges=null;var W=arguments[0],K=arguments[1];this._coord=W,this._edges=K,this._label=new ws(0,Hr.NONE)}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.isIncidentEdgeInResult=function(){for(var W=this.getEdges().getEdges().iterator();W.hasNext();)if(W.next().getEdge().isInResult())return!0;return!1},V.prototype.isIsolated=function(){return this._label.getGeometryCount()===1},V.prototype.getCoordinate=function(){return this._coord},V.prototype.print=function(W){W.println("node "+this._coord+" lbl: "+this._label)},V.prototype.computeIM=function(W){},V.prototype.computeMergedLocation=function(W,K){var te=Hr.NONE;if(te=this._label.getLocation(K),!W.isNull(K)){var le=W.getLocation(K);te!==Hr.BOUNDARY&&(te=le)}return te},V.prototype.setLabel=function(){if(arguments.length!==2)return B.prototype.setLabel.apply(this,arguments);var W=arguments[0],K=arguments[1];this._label===null?this._label=new ws(W,K):this._label.setLocation(W,K)},V.prototype.getEdges=function(){return this._edges},V.prototype.mergeLabel=function(){var W=this;if(arguments[0]instanceof V){var K=arguments[0];this.mergeLabel(K._label)}else if(arguments[0]instanceof ws)for(var te=arguments[0],le=0;le<2;le++){var ue=W.computeMergedLocation(te,le),ye=W._label.getLocation(le);ye===Hr.NONE&&W._label.setLocation(le,ue)}},V.prototype.add=function(W){this._edges.insert(W),W.setNode(this)},V.prototype.setLabelBoundary=function(W){if(this._label===null)return null;var K=Hr.NONE;this._label!==null&&(K=this._label.getLocation(W));var te=null;switch(K){case Hr.BOUNDARY:te=Hr.INTERIOR;break;case Hr.INTERIOR:default:te=Hr.BOUNDARY}this._label.setLocation(W,te)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(n_),Lx=function(){this.nodeMap=new oc,this.nodeFact=null;var B=arguments[0];this.nodeFact=B};Lx.prototype.find=function(B){return this.nodeMap.get(B)},Lx.prototype.addNode=function(){if(arguments[0]instanceof Pr){var B=arguments[0],V=this.nodeMap.get(B);return V===null&&(V=this.nodeFact.createNode(B),this.nodeMap.put(B,V)),V}if(arguments[0]instanceof lV){var W=arguments[0],K=this.nodeMap.get(W.getCoordinate());return K===null?(this.nodeMap.put(W.getCoordinate(),W),W):(K.mergeLabel(W),K)}},Lx.prototype.print=function(B){for(var V=this.iterator();V.hasNext();)V.next().print(B)},Lx.prototype.iterator=function(){return this.nodeMap.values().iterator()},Lx.prototype.values=function(){return this.nodeMap.values()},Lx.prototype.getBoundaryNodes=function(B){for(var V=new Be,W=this.iterator();W.hasNext();){var K=W.next();K.getLabel().getLocation(B)===Hr.BOUNDARY&&V.add(K)}return V},Lx.prototype.add=function(B){var V=B.getCoordinate();this.addNode(V).add(B)},Lx.prototype.interfaces_=function(){return[]},Lx.prototype.getClass=function(){return Lx};var Dc=function(){},BL={NE:{configurable:!0},NW:{configurable:!0},SW:{configurable:!0},SE:{configurable:!0}};Dc.prototype.interfaces_=function(){return[]},Dc.prototype.getClass=function(){return Dc},Dc.isNorthern=function(B){return B===Dc.NE||B===Dc.NW},Dc.isOpposite=function(B,V){return B!==V&&(B-V+4)%4===2},Dc.commonHalfPlane=function(B,V){if(B===V)return B;if((B-V+4)%4===2)return-1;var W=BV?B:V)===3?3:W},Dc.isInHalfPlane=function(B,V){return V===Dc.SE?B===Dc.SE||B===Dc.SW:B===V||B===V+1},Dc.quadrant=function(){if(typeof arguments[0]=="number"&&typeof arguments[1]=="number"){var B=arguments[0],V=arguments[1];if(B===0&&V===0)throw new sh("Cannot compute the quadrant for point ( "+B+", "+V+" )");return B>=0?V>=0?Dc.NE:Dc.SE:V>=0?Dc.NW:Dc.SW}if(arguments[0]instanceof Pr&&arguments[1]instanceof Pr){var W=arguments[0],K=arguments[1];if(K.x===W.x&&K.y===W.y)throw new sh("Cannot compute the quadrant for two identical points "+W);return K.x>=W.x?K.y>=W.y?Dc.NE:Dc.SE:K.y>=W.y?Dc.NW:Dc.SW}},BL.NE.get=function(){return 0},BL.NW.get=function(){return 1},BL.SW.get=function(){return 2},BL.SE.get=function(){return 3},Object.defineProperties(Dc,BL);var wf=function(){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,arguments.length===1){var B=arguments[0];this._edge=B}else if(arguments.length===3){var V=arguments[0],W=arguments[1],K=arguments[2],te=null;this._edge=V,this.init(W,K),this._label=te}else if(arguments.length===4){var le=arguments[0],ue=arguments[1],ye=arguments[2],be=arguments[3];this._edge=le,this.init(ue,ye),this._label=be}};wf.prototype.compareDirection=function(B){return this._dx===B._dx&&this._dy===B._dy?0:this._quadrant>B._quadrant?1:this._quadrant2){le.linkDirectedEdgesForMinimalEdgeRings();var ue=le.buildMinimalRings(),ye=this.findShell(ue);ye!==null?(this.placePolygonHoles(ye,ue),V.add(ye)):W.addAll(ue)}else K.add(le)}return K},ym.prototype.containsPoint=function(B){for(var V=this._shellList.iterator();V.hasNext();)if(V.next().containsPoint(B))return!0;return!1},ym.prototype.buildMaximalEdgeRings=function(B){for(var V=new Be,W=B.iterator();W.hasNext();){var K=W.next();if(K.isInResult()&&K.getLabel().isArea()&&K.getEdgeRing()===null){var te=new mce(K,this._geometryFactory);V.add(te),te.setInResult()}}return V},ym.prototype.placePolygonHoles=function(B,V){for(var W=V.iterator();W.hasNext();){var K=W.next();K.isHole()&&K.setShell(B)}},ym.prototype.getPolygons=function(){return this.computePolygons(this._shellList)},ym.prototype.findEdgeRingContaining=function(B,V){for(var W=B.getLinearRing(),K=W.getEnvelopeInternal(),te=W.getCoordinateN(0),le=null,ue=null,ye=V.iterator();ye.hasNext();){var be=ye.next(),Te=be.getLinearRing(),Fe=Te.getEnvelopeInternal();le!==null&&(ue=le.getLinearRing().getEnvelopeInternal());var Le=!1;Fe.contains(K)&&Po.isPointInRing(te,Te.getCoordinates())&&(Le=!0),Le&&(le===null||ue.contains(Fe))&&(le=be)}return le},ym.prototype.findShell=function(B){for(var V=0,W=null,K=B.iterator();K.hasNext();){var te=K.next();te.isHole()||(W=te,V++)}return Fs.isTrue(V<=1,"found two shells in MinimalEdgeRing list"),W},ym.prototype.add=function(){if(arguments.length===1){var B=arguments[0];this.add(B.getEdgeEnds(),B.getNodes())}else if(arguments.length===2){var V=arguments[0],W=arguments[1];Ih.linkResultDirectedEdges(W);var K=this.buildMaximalEdgeRings(V),te=new Be,le=this.buildMinimalEdgeRings(K,this._shellList,te);this.sortShellsAndHoles(le,this._shellList,te),this.placeFreeHoles(this._shellList,te)}},ym.prototype.interfaces_=function(){return[]},ym.prototype.getClass=function(){return ym};var jm=function(){};jm.prototype.getBounds=function(){},jm.prototype.interfaces_=function(){return[]},jm.prototype.getClass=function(){return jm};var Ym=function(){this._bounds=null,this._item=null;var B=arguments[0],V=arguments[1];this._bounds=B,this._item=V};Ym.prototype.getItem=function(){return this._item},Ym.prototype.getBounds=function(){return this._bounds},Ym.prototype.interfaces_=function(){return[jm,f0]},Ym.prototype.getClass=function(){return Ym};var Wb=function(){this._size=null,this._items=null,this._size=0,this._items=new Be,this._items.add(null)};Wb.prototype.poll=function(){if(this.isEmpty())return null;var B=this._items.get(1);return this._items.set(1,this._items.get(this._size)),this._size-=1,this.reorder(1),B},Wb.prototype.size=function(){return this._size},Wb.prototype.reorder=function(B){for(var V=this,W=null,K=this._items.get(B);2*B<=this._size&&((W=2*B)!==V._size&&V._items.get(W+1).compareTo(V._items.get(W))<0&&W++,V._items.get(W).compareTo(K)<0);B=W)V._items.set(B,V._items.get(W));this._items.set(B,K)},Wb.prototype.clear=function(){this._size=0,this._items.clear()},Wb.prototype.isEmpty=function(){return this._size===0},Wb.prototype.add=function(B){this._items.add(null),this._size+=1;var V=this._size;for(this._items.set(0,B);B.compareTo(this._items.get(Math.trunc(V/2)))<0;V/=2)this._items.set(V,this._items.get(Math.trunc(V/2)));this._items.set(V,B)},Wb.prototype.interfaces_=function(){return[]},Wb.prototype.getClass=function(){return Wb};var aE=function(){};aE.prototype.visitItem=function(B){},aE.prototype.interfaces_=function(){return[]},aE.prototype.getClass=function(){return aE};var vI=function(){};vI.prototype.insert=function(B,V){},vI.prototype.remove=function(B,V){},vI.prototype.query=function(){},vI.prototype.interfaces_=function(){return[]},vI.prototype.getClass=function(){return vI};var Af=function(){if(this._childBoundables=new Be,this._bounds=null,this._level=null,arguments.length!==0&&arguments.length===1){var B=arguments[0];this._level=B}},yK={serialVersionUID:{configurable:!0}};Af.prototype.getLevel=function(){return this._level},Af.prototype.size=function(){return this._childBoundables.size()},Af.prototype.getChildBoundables=function(){return this._childBoundables},Af.prototype.addChildBoundable=function(B){Fs.isTrue(this._bounds===null),this._childBoundables.add(B)},Af.prototype.isEmpty=function(){return this._childBoundables.isEmpty()},Af.prototype.getBounds=function(){return this._bounds===null&&(this._bounds=this.computeBounds()),this._bounds},Af.prototype.interfaces_=function(){return[jm,f0]},Af.prototype.getClass=function(){return Af},yK.serialVersionUID.get=function(){return 6493722185909574e3},Object.defineProperties(Af,yK);var ov=function(){};ov.reverseOrder=function(){return{compare:function(B,V){return V.compareTo(B)}}},ov.min=function(B){return ov.sort(B),B.get(0)},ov.sort=function(B,V){var W=B.toArray();V?i1.sort(W,V):i1.sort(W);for(var K=B.iterator(),te=0,le=W.length;teVc.area(this._boundable2)?(this.expand(this._boundable1,this._boundable2,B,V),null):(this.expand(this._boundable2,this._boundable1,B,V),null);if(W)return this.expand(this._boundable1,this._boundable2,B,V),null;if(K)return this.expand(this._boundable2,this._boundable1,B,V),null;throw new sh("neither boundable is composite")},Vc.prototype.isLeaves=function(){return!(Vc.isComposite(this._boundable1)||Vc.isComposite(this._boundable2))},Vc.prototype.compareTo=function(B){var V=B;return this._distanceV._distance?1:0},Vc.prototype.expand=function(B,V,W,K){for(var te=B.getChildBoundables().iterator();te.hasNext();){var le=te.next(),ue=new Vc(le,V,this._itemDistance);ue.getDistance()1,"Node capacity must be greater than 1"),this._nodeCapacity=W}},ZN={IntersectsOp:{configurable:!0},serialVersionUID:{configurable:!0},DEFAULT_NODE_CAPACITY:{configurable:!0}};qa.prototype.getNodeCapacity=function(){return this._nodeCapacity},qa.prototype.lastNode=function(B){return B.get(B.size()-1)},qa.prototype.size=function(){var B=this;if(arguments.length===0)return this.isEmpty()?0:(this.build(),this.size(this._root));if(arguments.length===1){for(var V=arguments[0],W=0,K=V.getChildBoundables().iterator();K.hasNext();){var te=K.next();te instanceof Af?W+=B.size(te):te instanceof Ym&&(W+=1)}return W}},qa.prototype.removeItem=function(B,V){for(var W=null,K=B.getChildBoundables().iterator();K.hasNext();){var te=K.next();te instanceof Ym&&te.getItem()===V&&(W=te)}return W!==null&&(B.getChildBoundables().remove(W),!0)},qa.prototype.itemsTree=function(){var B=this;if(arguments.length===0){this.build();var V=this.itemsTree(this._root);return V===null?new Be:V}if(arguments.length===1){for(var W=arguments[0],K=new Be,te=W.getChildBoundables().iterator();te.hasNext();){var le=te.next();if(le instanceof Af){var ue=B.itemsTree(le);ue!==null&&K.add(ue)}else le instanceof Ym?K.add(le.getItem()):Fs.shouldNeverReachHere()}return K.size()<=0?null:K}},qa.prototype.insert=function(B,V){Fs.isTrue(!this._built,"Cannot insert items into an STR packed R-tree after it has been built."),this._itemBoundables.add(new Ym(B,V))},qa.prototype.boundablesAtLevel=function(){var B=this;if(arguments.length===1){var V=arguments[0],W=new Be;return this.boundablesAtLevel(V,this._root,W),W}if(arguments.length===3){var K=arguments[0],te=arguments[1],le=arguments[2];if(Fs.isTrue(K>-2),te.getLevel()===K)return le.add(te),null;for(var ue=te.getChildBoundables().iterator();ue.hasNext();){var ye=ue.next();ye instanceof Af?B.boundablesAtLevel(K,ye,le):(Fs.isTrue(ye instanceof Ym),K===-1&&le.add(ye))}return null}},qa.prototype.query=function(){var B=this;if(arguments.length===1){var V=arguments[0];this.build();var W=new Be;return this.isEmpty()||this.getIntersectsOp().intersects(this._root.getBounds(),V)&&this.query(V,this._root,W),W}if(arguments.length===2){var K=arguments[0],te=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this._root.getBounds(),K)&&this.query(K,this._root,te)}else if(arguments.length===3){if(os(arguments[2],aE)&&arguments[0]instanceof Object&&arguments[1]instanceof Af)for(var le=arguments[0],ue=arguments[1],ye=arguments[2],be=ue.getChildBoundables(),Te=0;TeW&&(W=le)}}return W+1}},qa.prototype.createParentBoundables=function(B,V){var W=this;Fs.isTrue(!B.isEmpty());var K=new Be;K.add(this.createNode(V));var te=new Be(B);ov.sort(te,this.getComparator());for(var le=te.iterator();le.hasNext();){var ue=le.next();W.lastNode(K).getChildBoundables().size()===W.getNodeCapacity()&&K.add(W.createNode(V)),W.lastNode(K).addChildBoundable(ue)}return K},qa.prototype.isEmpty=function(){return this._built?this._root.isEmpty():this._itemBoundables.isEmpty()},qa.prototype.interfaces_=function(){return[f0]},qa.prototype.getClass=function(){return qa},qa.compareDoubles=function(B,V){return B>V?1:B0);for(var le=new Be,ue=0;ue0;){var Ze=et.poll(),ot=Ze.getDistance();if(ot>=Le)break;Ze.isLeaves()?(Le=ot,We=Ze):Ze.expandToQueue(et,Le)}return[We.getBoundable(0).getItem(),We.getBoundable(1).getItem()]}}else if(arguments.length===3){var Ke=arguments[0],Bt=arguments[1],gi=arguments[2],rt=new Ym(Ke,Bt),Ft=new Vc(this.getRoot(),rt,gi);return this.nearestNeighbour(Ft)[0]}},V.prototype.interfaces_=function(){return[vI,f0]},V.prototype.getClass=function(){return V},V.centreX=function(K){return V.avg(K.getMinX(),K.getMaxX())},V.avg=function(K,te){return(K+te)/2},V.centreY=function(K){return V.avg(K.getMinY(),K.getMaxY())},W.STRtreeNode.get=function(){return Xc},W.serialVersionUID.get=function(){return 0x39920f7d5f261e0},W.xComparator.get=function(){return{interfaces_:function(){return[xS]},compare:function(K,te){return B.compareDoubles(V.centreX(K.getBounds()),V.centreX(te.getBounds()))}}},W.yComparator.get=function(){return{interfaces_:function(){return[xS]},compare:function(K,te){return B.compareDoubles(V.centreY(K.getBounds()),V.centreY(te.getBounds()))}}},W.intersectsOp.get=function(){return{interfaces_:function(){return[B.IntersectsOp]},intersects:function(K,te){return K.intersects(te)}}},W.DEFAULT_NODE_CAPACITY.get=function(){return 10},Object.defineProperties(V,W),V}(qa),Xc=function(B){function V(){var W=arguments[0];B.call(this,W)}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.computeBounds=function(){for(var W=null,K=this.getChildBoundables().iterator();K.hasNext();){var te=K.next();W===null?W=new Aa(te.getBounds()):W.expandToInclude(te.getBounds())}return W},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(Af),Lg=function(){};Lg.prototype.interfaces_=function(){return[]},Lg.prototype.getClass=function(){return Lg},Lg.relativeSign=function(B,V){return BV?1:0},Lg.compare=function(B,V,W){if(V.equals2D(W))return 0;var K=Lg.relativeSign(V.x,W.x),te=Lg.relativeSign(V.y,W.y);switch(B){case 0:return Lg.compareValue(K,te);case 1:return Lg.compareValue(te,K);case 2:return Lg.compareValue(te,-K);case 3:return Lg.compareValue(-K,te);case 4:return Lg.compareValue(-K,-te);case 5:return Lg.compareValue(-te,-K);case 6:return Lg.compareValue(-te,K);case 7:return Lg.compareValue(K,-te)}return Fs.shouldNeverReachHere("invalid octant value"),0},Lg.compareValue=function(B,V){return B<0?-1:B>0?1:V<0?-1:V>0?1:0};var jb=function(){this._segString=null,this.coord=null,this.segmentIndex=null,this._segmentOctant=null,this._isInterior=null;var B=arguments[0],V=arguments[1],W=arguments[2],K=arguments[3];this._segString=B,this.coord=new Pr(V),this.segmentIndex=W,this._segmentOctant=K,this._isInterior=!V.equals2D(B.getCoordinate(W))};jb.prototype.getCoordinate=function(){return this.coord},jb.prototype.print=function(B){B.print(this.coord),B.print(" seg # = "+this.segmentIndex)},jb.prototype.compareTo=function(B){var V=B;return this.segmentIndexV.segmentIndex?1:this.coord.equals2D(V.coord)?0:Lg.compare(this._segmentOctant,this.coord,V.coord)},jb.prototype.isEndPoint=function(B){return this.segmentIndex===0&&!this._isInterior||this.segmentIndex===B},jb.prototype.isInterior=function(){return this._isInterior},jb.prototype.interfaces_=function(){return[Ig]},jb.prototype.getClass=function(){return jb};var pp=function(){this._nodeMap=new oc,this._edge=null;var B=arguments[0];this._edge=B};pp.prototype.getSplitCoordinates=function(){var B=new Kt;this.addEndpoints();for(var V=this.iterator(),W=V.next();V.hasNext();){var K=V.next();this.addEdgeCoordinates(W,K,B),W=K}return B.toCoordinateArray()},pp.prototype.addCollapsedNodes=function(){var B=new Be;this.findCollapsesFromInsertedNodes(B),this.findCollapsesFromExistingVertices(B);for(var V=B.iterator();V.hasNext();){var W=V.next().intValue();this.add(this._edge.getCoordinate(W),W)}},pp.prototype.print=function(B){B.println("Intersections:");for(var V=this.iterator();V.hasNext();)V.next().print(B)},pp.prototype.findCollapsesFromExistingVertices=function(B){for(var V=0;V=0?V>=0?W>=K?0:1:W>=K?7:6:V>=0?W>=K?3:2:W>=K?4:5}if(arguments[0]instanceof Pr&&arguments[1]instanceof Pr){var te=arguments[0],le=arguments[1],ue=le.x-te.x,ye=le.y-te.y;if(ue===0&&ye===0)throw new sh("Cannot compute the octant for two identical points "+te);return xI.octant(ue,ye)}};var s1=function(){};s1.prototype.getCoordinates=function(){},s1.prototype.size=function(){},s1.prototype.getCoordinate=function(B){},s1.prototype.isClosed=function(){},s1.prototype.setData=function(B){},s1.prototype.getData=function(){},s1.prototype.interfaces_=function(){return[]},s1.prototype.getClass=function(){return s1};var $N=function(){};$N.prototype.addIntersection=function(B,V){},$N.prototype.interfaces_=function(){return[s1]},$N.prototype.getClass=function(){return $N};var Md=function(){this._nodeList=new pp(this),this._pts=null,this._data=null;var B=arguments[0],V=arguments[1];this._pts=B,this._data=V};Md.prototype.getCoordinates=function(){return this._pts},Md.prototype.size=function(){return this._pts.length},Md.prototype.getCoordinate=function(B){return this._pts[B]},Md.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},Md.prototype.getSegmentOctant=function(B){return B===this._pts.length-1?-1:this.safeOctant(this.getCoordinate(B),this.getCoordinate(B+1))},Md.prototype.setData=function(B){this._data=B},Md.prototype.safeOctant=function(B,V){return B.equals2D(V)?0:xI.octant(B,V)},Md.prototype.getData=function(){return this._data},Md.prototype.addIntersection=function(){if(arguments.length===2){var B=arguments[0],V=arguments[1];this.addIntersectionNode(B,V)}else if(arguments.length===4){var W=arguments[0],K=arguments[1],te=arguments[3],le=new Pr(W.getIntersection(te));this.addIntersection(le,K)}},Md.prototype.toString=function(){return r_.toLineString(new Pd(this._pts))},Md.prototype.getNodeList=function(){return this._nodeList},Md.prototype.addIntersectionNode=function(B,V){var W=V,K=W+1;if(K=0&&W>=0||V<=0&&W<=0?Math.max(V,W):0}if(arguments[0]instanceof Pr){var K=arguments[0];return Po.orientationIndex(this.p0,this.p1,K)}},Da.prototype.toGeometry=function(B){return B.createLineString([this.p0,this.p1])},Da.prototype.isVertical=function(){return this.p0.x===this.p1.x},Da.prototype.equals=function(B){if(!(B instanceof Da))return!1;var V=B;return this.p0.equals(V.p0)&&this.p1.equals(V.p1)},Da.prototype.intersection=function(B){var V=new Ub;return V.computeIntersection(this.p0,this.p1,B.p0,B.p1),V.hasIntersection()?V.getIntersection(0):null},Da.prototype.project=function(){if(arguments[0]instanceof Pr){var B=arguments[0];if(B.equals(this.p0)||B.equals(this.p1))return new Pr(B);var V=this.projectionFactor(B),W=new Pr;return W.x=this.p0.x+V*(this.p1.x-this.p0.x),W.y=this.p0.y+V*(this.p1.y-this.p0.y),W}if(arguments[0]instanceof Da){var K=arguments[0],te=this.projectionFactor(K.p0),le=this.projectionFactor(K.p1);if(te>=1&&le>=1||te<=0&&le<=0)return null;var ue=this.project(K.p0);te<0&&(ue=this.p0),te>1&&(ue=this.p1);var ye=this.project(K.p1);return le<0&&(ye=this.p0),le>1&&(ye=this.p1),new Da(ue,ye)}},Da.prototype.normalize=function(){this.p1.compareTo(this.p0)<0&&this.reverse()},Da.prototype.angle=function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},Da.prototype.getCoordinate=function(B){return B===0?this.p0:this.p1},Da.prototype.distancePerpendicular=function(B){return Po.distancePointLinePerpendicular(B,this.p0,this.p1)},Da.prototype.minY=function(){return Math.min(this.p0.y,this.p1.y)},Da.prototype.midPoint=function(){return Da.midPoint(this.p0,this.p1)},Da.prototype.projectionFactor=function(B){if(B.equals(this.p0))return 0;if(B.equals(this.p1))return 1;var V=this.p1.x-this.p0.x,W=this.p1.y-this.p0.y,K=V*V+W*W;return K<=0?Ts.NaN:((B.x-this.p0.x)*V+(B.y-this.p0.y)*W)/K},Da.prototype.closestPoints=function(B){var V=this.intersection(B);if(V!==null)return[V,V];var W=new Array(2).fill(null),K=Ts.MAX_VALUE,te=null,le=this.closestPoint(B.p0);K=le.distance(B.p0),W[0]=le,W[1]=B.p0;var ue=this.closestPoint(B.p1);(te=ue.distance(B.p1))0&&V<1?this.project(B):this.p0.distance(B)1||Ts.isNaN(V))&&(V=1),V},Da.prototype.toString=function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},Da.prototype.isHorizontal=function(){return this.p0.y===this.p1.y},Da.prototype.distance=function(){if(arguments[0]instanceof Da){var B=arguments[0];return Po.distanceLineLine(this.p0,this.p1,B.p0,B.p1)}if(arguments[0]instanceof Pr){var V=arguments[0];return Po.distancePointLine(V,this.p0,this.p1)}},Da.prototype.pointAlong=function(B){var V=new Pr;return V.x=this.p0.x+B*(this.p1.x-this.p0.x),V.y=this.p0.y+B*(this.p1.y-this.p0.y),V},Da.prototype.hashCode=function(){var B=Ts.doubleToLongBits(this.p0.x);B^=31*Ts.doubleToLongBits(this.p0.y);var V=Math.trunc(B)^Math.trunc(B>>32),W=Ts.doubleToLongBits(this.p1.x);return W^=31*Ts.doubleToLongBits(this.p1.y),V^(Math.trunc(W)^Math.trunc(W>>32))},Da.prototype.interfaces_=function(){return[Ig,f0]},Da.prototype.getClass=function(){return Da},Da.midPoint=function(B,V){return new Pr((B.x+V.x)/2,(B.y+V.y)/2)},CK.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(Da,CK);var eF=function(){this.tempEnv1=new Aa,this.tempEnv2=new Aa,this._overlapSeg1=new Da,this._overlapSeg2=new Da};eF.prototype.overlap=function(){if(arguments.length!==2&&arguments.length===4){var B=arguments[0],V=arguments[1],W=arguments[2],K=arguments[3];B.getLineSegment(V,this._overlapSeg1),W.getLineSegment(K,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},eF.prototype.interfaces_=function(){return[]},eF.prototype.getClass=function(){return eF};var _0=function(){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var B=arguments[0],V=arguments[1],W=arguments[2],K=arguments[3];this._pts=B,this._start=V,this._end=W,this._context=K};_0.prototype.getLineSegment=function(B,V){V.p0=this._pts[B],V.p1=this._pts[B+1]},_0.prototype.computeSelect=function(B,V,W,K){var te=this._pts[V],le=this._pts[W];if(K.tempEnv1.init(te,le),W-V==1)return K.select(this,V),null;if(!B.intersects(K.tempEnv1))return null;var ue=Math.trunc((V+W)/2);V=B.length-1)return B.length-1;for(var K=Dc.quadrant(B[W],B[W+1]),te=V+1;teue.getId()&&(ue.computeOverlaps(be,te),K._nOverlaps++),K._segInt.isDone())return null}},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},W.SegmentOverlapAction.get=function(){return bK},Object.defineProperties(V,W),V}(tF),bK=function(B){function V(){B.call(this),this._si=null;var W=arguments[0];this._si=W}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.overlap=function(){if(arguments.length!==4)return B.prototype.overlap.apply(this,arguments);var W=arguments[0],K=arguments[1],te=arguments[2],le=arguments[3],ue=W.getContext(),ye=te.getContext();this._si.processIntersections(ue,K,ye,le)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(eF),Eu=function B(){if(this._quadrantSegments=B.DEFAULT_QUADRANT_SEGMENTS,this._endCapStyle=B.CAP_ROUND,this._joinStyle=B.JOIN_ROUND,this._mitreLimit=B.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this._simplifyFactor=B.DEFAULT_SIMPLIFY_FACTOR,arguments.length!==0){if(arguments.length===1){var V=arguments[0];this.setQuadrantSegments(V)}else if(arguments.length===2){var W=arguments[0],K=arguments[1];this.setQuadrantSegments(W),this.setEndCapStyle(K)}else if(arguments.length===4){var te=arguments[0],le=arguments[1],ue=arguments[2],ye=arguments[3];this.setQuadrantSegments(te),this.setEndCapStyle(le),this.setJoinStyle(ue),this.setMitreLimit(ye)}}},Yb={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};Eu.prototype.getEndCapStyle=function(){return this._endCapStyle},Eu.prototype.isSingleSided=function(){return this._isSingleSided},Eu.prototype.setQuadrantSegments=function(B){this._quadrantSegments=B,this._quadrantSegments===0&&(this._joinStyle=Eu.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=Eu.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),B<=0&&(this._quadrantSegments=1),this._joinStyle!==Eu.JOIN_ROUND&&(this._quadrantSegments=Eu.DEFAULT_QUADRANT_SEGMENTS)},Eu.prototype.getJoinStyle=function(){return this._joinStyle},Eu.prototype.setJoinStyle=function(B){this._joinStyle=B},Eu.prototype.setSimplifyFactor=function(B){this._simplifyFactor=B<0?0:B},Eu.prototype.getSimplifyFactor=function(){return this._simplifyFactor},Eu.prototype.getQuadrantSegments=function(){return this._quadrantSegments},Eu.prototype.setEndCapStyle=function(B){this._endCapStyle=B},Eu.prototype.getMitreLimit=function(){return this._mitreLimit},Eu.prototype.setMitreLimit=function(B){this._mitreLimit=B},Eu.prototype.setSingleSided=function(B){this._isSingleSided=B},Eu.prototype.interfaces_=function(){return[]},Eu.prototype.getClass=function(){return Eu},Eu.bufferDistanceError=function(B){var V=Math.PI/2/B;return 1-Math.cos(V/2)},Yb.CAP_ROUND.get=function(){return 1},Yb.CAP_FLAT.get=function(){return 2},Yb.CAP_SQUARE.get=function(){return 3},Yb.JOIN_ROUND.get=function(){return 1},Yb.JOIN_MITRE.get=function(){return 2},Yb.JOIN_BEVEL.get=function(){return 3},Yb.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},Yb.DEFAULT_MITRE_LIMIT.get=function(){return 5},Yb.DEFAULT_SIMPLIFY_FACTOR.get=function(){return .01},Object.defineProperties(Eu,Yb);var Mh=function(B){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=Po.COUNTERCLOCKWISE,this._inputLine=B||null},iF={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};Mh.prototype.isDeletable=function(B,V,W,K){var te=this._inputLine[B],le=this._inputLine[V],ue=this._inputLine[W];return!!this.isConcave(te,le,ue)&&!!this.isShallow(te,le,ue,K)&&this.isShallowSampled(te,le,B,W,K)},Mh.prototype.deleteShallowConcavities=function(){for(var B=this,V=1,W=this.findNextNonDeletedIndex(V),K=this.findNextNonDeletedIndex(W),te=!1;K=0;K--)this.addPt(B[K])},o_.prototype.isRedundant=function(B){if(this._ptList.size()<1)return!1;var V=this._ptList.get(this._ptList.size()-1);return B.distance(V)Math.PI;)B-=hs.PI_TIMES_2;for(;B<=-Math.PI;)B+=hs.PI_TIMES_2;return B},hs.angle=function(){if(arguments.length===1){var B=arguments[0];return Math.atan2(B.y,B.x)}if(arguments.length===2){var V=arguments[0],W=arguments[1],K=W.x-V.x,te=W.y-V.y;return Math.atan2(te,K)}},hs.isAcute=function(B,V,W){var K=B.x-V.x,te=B.y-V.y;return K*(W.x-V.x)+te*(W.y-V.y)>0},hs.isObtuse=function(B,V,W){var K=B.x-V.x,te=B.y-V.y;return K*(W.x-V.x)+te*(W.y-V.y)<0},hs.interiorAngle=function(B,V,W){var K=hs.angle(V,B),te=hs.angle(V,W);return Math.abs(te-K)},hs.normalizePositive=function(B){if(B<0){for(;B<0;)B+=hs.PI_TIMES_2;B>=hs.PI_TIMES_2&&(B=0)}else{for(;B>=hs.PI_TIMES_2;)B-=hs.PI_TIMES_2;B<0&&(B=0)}return B},hs.angleBetween=function(B,V,W){var K=hs.angle(V,B),te=hs.angle(V,W);return hs.diff(K,te)},hs.diff=function(B,V){var W=null;return(W=BMath.PI&&(W=2*Math.PI-W),W},hs.toRadians=function(B){return B*Math.PI/180},hs.getTurn=function(B,V){var W=Math.sin(V-B);return W>0?hs.COUNTERCLOCKWISE:W<0?hs.CLOCKWISE:hs.NONE},hs.angleBetweenOriented=function(B,V,W){var K=hs.angle(V,B),te=hs.angle(V,W)-K;return te<=-Math.PI?te+hs.PI_TIMES_2:te>Math.PI?te-hs.PI_TIMES_2:te},Gp.PI_TIMES_2.get=function(){return 2*Math.PI},Gp.PI_OVER_2.get=function(){return Math.PI/2},Gp.PI_OVER_4.get=function(){return Math.PI/4},Gp.COUNTERCLOCKWISE.get=function(){return Po.COUNTERCLOCKWISE},Gp.CLOCKWISE.get=function(){return Po.CLOCKWISE},Gp.NONE.get=function(){return Po.COLLINEAR},Object.defineProperties(hs,Gp);var ph=function B(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new Da,this._seg1=new Da,this._offset0=new Da,this._offset1=new Da,this._side=0,this._hasNarrowConcaveAngle=!1;var V=arguments[0],W=arguments[1],K=arguments[2];this._precisionModel=V,this._bufParams=W,this._li=new Ub,this._filletAngleQuantum=Math.PI/2/W.getQuadrantSegments(),W.getQuadrantSegments()>=8&&W.getJoinStyle()===Eu.JOIN_ROUND&&(this._closingSegLengthFactor=B.MAX_CLOSING_SEG_LEN_FACTOR),this.init(K)},rF={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};ph.prototype.addNextSegment=function(B,V){if(this._s0=this._s1,this._s1=this._s2,this._s2=B,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var W=Po.computeOrientation(this._s0,this._s1,this._s2),K=W===Po.CLOCKWISE&&this._side===ao.LEFT||W===Po.COUNTERCLOCKWISE&&this._side===ao.RIGHT;W===0?this.addCollinear(V):K?this.addOutsideTurn(W,V):this.addInsideTurn(W,V)},ph.prototype.addLineEndCap=function(B,V){var W=new Da(B,V),K=new Da;this.computeOffsetSegment(W,ao.LEFT,this._distance,K);var te=new Da;this.computeOffsetSegment(W,ao.RIGHT,this._distance,te);var le=V.x-B.x,ue=V.y-B.y,ye=Math.atan2(ue,le);switch(this._bufParams.getEndCapStyle()){case Eu.CAP_ROUND:this._segList.addPt(K.p1),this.addFilletArc(V,ye+Math.PI/2,ye-Math.PI/2,Po.CLOCKWISE,this._distance),this._segList.addPt(te.p1);break;case Eu.CAP_FLAT:this._segList.addPt(K.p1),this._segList.addPt(te.p1);break;case Eu.CAP_SQUARE:var be=new Pr;be.x=Math.abs(this._distance)*Math.cos(ye),be.y=Math.abs(this._distance)*Math.sin(ye);var Te=new Pr(K.p1.x+be.x,K.p1.y+be.y),Fe=new Pr(te.p1.x+be.x,te.p1.y+be.y);this._segList.addPt(Te),this._segList.addPt(Fe)}},ph.prototype.getCoordinates=function(){return this._segList.getCoordinates()},ph.prototype.addMitreJoin=function(B,V,W,K){var te=!0,le=null;try{le=Mg.intersection(V.p0,V.p1,W.p0,W.p1),(K<=0?1:le.distance(B)/Math.abs(K))>this._bufParams.getMitreLimit()&&(te=!1)}catch(ue){if(!(ue instanceof Hb))throw ue;le=new Pr(0,0),te=!1}te?this._segList.addPt(le):this.addLimitedMitreJoin(V,W,K,this._bufParams.getMitreLimit())},ph.prototype.addFilletCorner=function(B,V,W,K,te){var le=V.x-B.x,ue=V.y-B.y,ye=Math.atan2(ue,le),be=W.x-B.x,Te=W.y-B.y,Fe=Math.atan2(Te,be);K===Po.CLOCKWISE?ye<=Fe&&(ye+=2*Math.PI):ye>=Fe&&(ye-=2*Math.PI),this._segList.addPt(V),this.addFilletArc(B,ye,Fe,K,te),this._segList.addPt(W)},ph.prototype.addOutsideTurn=function(B,V){if(this._offset0.p1.distance(this._offset1.p0)0){var W=new Pr((this._closingSegLengthFactor*this._offset0.p1.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset0.p1.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(W);var K=new Pr((this._closingSegLengthFactor*this._offset1.p0.x+this._s1.x)/(this._closingSegLengthFactor+1),(this._closingSegLengthFactor*this._offset1.p0.y+this._s1.y)/(this._closingSegLengthFactor+1));this._segList.addPt(K)}else this._segList.addPt(this._s1);this._segList.addPt(this._offset1.p0)}},ph.prototype.createCircle=function(B){var V=new Pr(B.x+this._distance,B.y);this._segList.addPt(V),this.addFilletArc(B,0,2*Math.PI,-1,this._distance),this._segList.closeRing()},ph.prototype.addBevelJoin=function(B,V){this._segList.addPt(B.p1),this._segList.addPt(V.p0)},ph.prototype.init=function(B){this._distance=B,this._maxCurveSegmentError=B*(1-Math.cos(this._filletAngleQuantum/2)),this._segList=new o_,this._segList.setPrecisionModel(this._precisionModel),this._segList.setMinimumVertexDistance(B*ph.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},ph.prototype.addCollinear=function(B){this._li.computeIntersection(this._s0,this._s1,this._s1,this._s2),this._li.getIntersectionNum()>=2&&(this._bufParams.getJoinStyle()===Eu.JOIN_BEVEL||this._bufParams.getJoinStyle()===Eu.JOIN_MITRE?(B&&this._segList.addPt(this._offset0.p1),this._segList.addPt(this._offset1.p0)):this.addFilletCorner(this._s1,this._offset0.p1,this._offset1.p0,Po.CLOCKWISE,this._distance))},ph.prototype.closeRing=function(){this._segList.closeRing()},ph.prototype.hasNarrowConcaveAngle=function(){return this._hasNarrowConcaveAngle},ph.prototype.interfaces_=function(){return[]},ph.prototype.getClass=function(){return ph},rF.OFFSET_SEGMENT_SEPARATION_FACTOR.get=function(){return .001},rF.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return .001},rF.CURVE_VERTEX_SNAP_DISTANCE_FACTOR.get=function(){return 1e-6},rF.MAX_CLOSING_SEG_LEN_FACTOR.get=function(){return 80},Object.defineProperties(ph,rF);var Rg=function(){this._distance=0,this._precisionModel=null,this._bufParams=null;var B=arguments[0],V=arguments[1];this._precisionModel=B,this._bufParams=V};Rg.prototype.getOffsetCurve=function(B,V){if(this._distance=V,V===0)return null;var W=V<0,K=Math.abs(V),te=this.getSegGen(K);B.length<=1?this.computePointCurve(B[0],te):this.computeOffsetCurve(B,W,te);var le=te.getCoordinates();return W&&di.reverse(le),le},Rg.prototype.computeSingleSidedBufferCurve=function(B,V,W){var K=this.simplifyTolerance(this._distance);if(V){W.addSegments(B,!0);var te=Mh.simplify(B,-K),le=te.length-1;W.initSideSegments(te[le],te[le-1],ao.LEFT),W.addFirstSegment();for(var ue=le-2;ue>=0;ue--)W.addNextSegment(te[ue],!0)}else{W.addSegments(B,!1);var ye=Mh.simplify(B,K),be=ye.length-1;W.initSideSegments(ye[0],ye[1],ao.LEFT),W.addFirstSegment();for(var Te=2;Te<=be;Te++)W.addNextSegment(ye[Te],!0)}W.addLastSegment(),W.closeRing()},Rg.prototype.computeRingBufferCurve=function(B,V,W){var K=this.simplifyTolerance(this._distance);V===ao.RIGHT&&(K=-K);var te=Mh.simplify(B,K),le=te.length-1;W.initSideSegments(te[le-1],te[0],V);for(var ue=1;ue<=le;ue++){var ye=ue!==1;W.addNextSegment(te[ue],ye)}W.closeRing()},Rg.prototype.computeLineBufferCurve=function(B,V){var W=this.simplifyTolerance(this._distance),K=Mh.simplify(B,W),te=K.length-1;V.initSideSegments(K[0],K[1],ao.LEFT);for(var le=2;le<=te;le++)V.addNextSegment(K[le],!0);V.addLastSegment(),V.addLineEndCap(K[te-1],K[te]);var ue=Mh.simplify(B,-W),ye=ue.length-1;V.initSideSegments(ue[ye],ue[ye-1],ao.LEFT);for(var be=ye-2;be>=0;be--)V.addNextSegment(ue[be],!0);V.addLastSegment(),V.addLineEndCap(ue[1],ue[0]),V.closeRing()},Rg.prototype.computePointCurve=function(B,V){switch(this._bufParams.getEndCapStyle()){case Eu.CAP_ROUND:V.createCircle(B);break;case Eu.CAP_SQUARE:V.createSquare(B)}},Rg.prototype.getLineCurve=function(B,V){if(this._distance=V,V<0&&!this._bufParams.isSingleSided()||V===0)return null;var W=Math.abs(V),K=this.getSegGen(W);if(B.length<=1)this.computePointCurve(B[0],K);else if(this._bufParams.isSingleSided()){var te=V<0;this.computeSingleSidedBufferCurve(B,te,K)}else this.computeLineBufferCurve(B,K);return K.getCoordinates()},Rg.prototype.getBufferParameters=function(){return this._bufParams},Rg.prototype.simplifyTolerance=function(B){return B*this._bufParams.getSimplifyFactor()},Rg.prototype.getRingCurve=function(B,V,W){if(this._distance=W,B.length<=2)return this.getLineCurve(B,W);if(W===0)return Rg.copyCoordinates(B);var K=this.getSegGen(W);return this.computeRingBufferCurve(B,V,K),K.getCoordinates()},Rg.prototype.computeOffsetCurve=function(B,V,W){var K=this.simplifyTolerance(this._distance);if(V){var te=Mh.simplify(B,-K),le=te.length-1;W.initSideSegments(te[le],te[le-1],ao.LEFT),W.addFirstSegment();for(var ue=le-2;ue>=0;ue--)W.addNextSegment(te[ue],!0)}else{var ye=Mh.simplify(B,K),be=ye.length-1;W.initSideSegments(ye[0],ye[1],ao.LEFT),W.addFirstSegment();for(var Te=2;Te<=be;Te++)W.addNextSegment(ye[Te],!0)}W.addLastSegment()},Rg.prototype.getSegGen=function(B){return new ph(this._precisionModel,this._bufParams,B)},Rg.prototype.interfaces_=function(){return[]},Rg.prototype.getClass=function(){return Rg},Rg.copyCoordinates=function(B){for(var V=new Array(B.length).fill(null),W=0;Wle.getMaxY()||B.findStabbedSegments(V,te.getDirectedEdges(),W)}return W}if(arguments.length===3){if(os(arguments[2],me)&&arguments[0]instanceof Pr&&arguments[1]instanceof QN)for(var ue=arguments[0],ye=arguments[1],be=arguments[2],Te=ye.getEdge().getCoordinates(),Fe=0;FeB._seg.p1.y&&B._seg.reverse();var Le=Math.max(B._seg.p0.x,B._seg.p1.x);if(!(LeB._seg.p1.y||Po.computeOrientation(B._seg.p0,B._seg.p1,ue)===Po.RIGHT)){var We=ye.getDepth(ao.LEFT);B._seg.p0.equals(Te[Fe])||(We=ye.getDepth(ao.RIGHT));var et=new DS(B._seg,We);be.add(et)}}else if(os(arguments[2],me)&&arguments[0]instanceof Pr&&os(arguments[1],me))for(var Ze=arguments[0],ot=arguments[1],Ke=arguments[2],Bt=ot.iterator();Bt.hasNext();){var gi=Bt.next();gi.isForward()&&B.findStabbedSegments(Ze,gi,Ke)}}},MS.prototype.getDepth=function(B){var V=this.findStabbedSegments(B);return V.size()===0?0:ov.min(V)._leftDepth},MS.prototype.interfaces_=function(){return[]},MS.prototype.getClass=function(){return MS},AK.DepthSegment.get=function(){return DS},Object.defineProperties(MS,AK);var DS=function(){this._upwardSeg=null,this._leftDepth=null;var B=arguments[0],V=arguments[1];this._upwardSeg=new Da(B),this._leftDepth=V};DS.prototype.compareTo=function(B){var V=B;if(this._upwardSeg.minX()>=V._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=V._upwardSeg.minX())return-1;var W=this._upwardSeg.orientationIndex(V._upwardSeg);return W!==0||(W=-1*V._upwardSeg.orientationIndex(this._upwardSeg))!==0?W:this._upwardSeg.compareTo(V._upwardSeg)},DS.prototype.compareX=function(B,V){var W=B.p0.compareTo(V.p0);return W!==0?W:B.p1.compareTo(V.p1)},DS.prototype.toString=function(){return this._upwardSeg.toString()},DS.prototype.interfaces_=function(){return[Ig]},DS.prototype.getClass=function(){return DS};var Vu=function(B,V,W){this.p0=B||null,this.p1=V||null,this.p2=W||null};Vu.prototype.area=function(){return Vu.area(this.p0,this.p1,this.p2)},Vu.prototype.signedArea=function(){return Vu.signedArea(this.p0,this.p1,this.p2)},Vu.prototype.interpolateZ=function(B){if(B===null)throw new sh("Supplied point is null.");return Vu.interpolateZ(B,this.p0,this.p1,this.p2)},Vu.prototype.longestSideLength=function(){return Vu.longestSideLength(this.p0,this.p1,this.p2)},Vu.prototype.isAcute=function(){return Vu.isAcute(this.p0,this.p1,this.p2)},Vu.prototype.circumcentre=function(){return Vu.circumcentre(this.p0,this.p1,this.p2)},Vu.prototype.area3D=function(){return Vu.area3D(this.p0,this.p1,this.p2)},Vu.prototype.centroid=function(){return Vu.centroid(this.p0,this.p1,this.p2)},Vu.prototype.inCentre=function(){return Vu.inCentre(this.p0,this.p1,this.p2)},Vu.prototype.interfaces_=function(){return[]},Vu.prototype.getClass=function(){return Vu},Vu.area=function(B,V,W){return Math.abs(((W.x-B.x)*(V.y-B.y)-(V.x-B.x)*(W.y-B.y))/2)},Vu.signedArea=function(B,V,W){return((W.x-B.x)*(V.y-B.y)-(V.x-B.x)*(W.y-B.y))/2},Vu.det=function(B,V,W,K){return B*K-V*W},Vu.interpolateZ=function(B,V,W,K){var te=V.x,le=V.y,ue=W.x-te,ye=K.x-te,be=W.y-le,Te=K.y-le,Fe=ue*Te-ye*be,Le=B.x-te,We=B.y-le,et=(Te*Le-ye*We)/Fe,Ze=(-be*Le+ue*We)/Fe;return V.z+et*(W.z-V.z)+Ze*(K.z-V.z)},Vu.longestSideLength=function(B,V,W){var K=B.distance(V),te=V.distance(W),le=W.distance(B),ue=K;return te>ue&&(ue=te),le>ue&&(ue=le),ue},Vu.isAcute=function(B,V,W){return!!hs.isAcute(B,V,W)&&!!hs.isAcute(V,W,B)&&!!hs.isAcute(W,B,V)},Vu.circumcentre=function(B,V,W){var K=W.x,te=W.y,le=B.x-K,ue=B.y-te,ye=V.x-K,be=V.y-te,Te=2*Vu.det(le,ue,ye,be),Fe=Vu.det(ue,le*le+ue*ue,be,ye*ye+be*be),Le=Vu.det(le,le*le+ue*ue,ye,ye*ye+be*be);return new Pr(K-Fe/Te,te+Le/Te)},Vu.perpendicularBisector=function(B,V){var W=V.x-B.x,K=V.y-B.y,te=new Mg(B.x+W/2,B.y+K/2,1),le=new Mg(B.x-K+W/2,B.y+W+K/2,1);return new Mg(te,le)},Vu.angleBisector=function(B,V,W){var K=V.distance(B),te=K/(K+V.distance(W)),le=W.x-B.x,ue=W.y-B.y;return new Pr(B.x+te*le,B.y+te*ue)},Vu.area3D=function(B,V,W){var K=V.x-B.x,te=V.y-B.y,le=V.z-B.z,ue=W.x-B.x,ye=W.y-B.y,be=W.z-B.z,Te=te*be-le*ye,Fe=le*ue-K*be,Le=K*ye-te*ue,We=Te*Te+Fe*Fe+Le*Le,et=Math.sqrt(We)/2;return et},Vu.centroid=function(B,V,W){var K=(B.x+V.x+W.x)/3,te=(B.y+V.y+W.y)/3;return new Pr(K,te)},Vu.inCentre=function(B,V,W){var K=V.distance(W),te=B.distance(W),le=B.distance(V),ue=K+te+le,ye=(K*B.x+te*V.x+le*W.x)/ue,be=(K*B.y+te*V.y+le*W.y)/ue;return new Pr(ye,be)};var a_=function(){this._inputGeom=null,this._distance=null,this._curveBuilder=null,this._curveList=new Be;var B=arguments[0],V=arguments[1],W=arguments[2];this._inputGeom=B,this._distance=V,this._curveBuilder=W};a_.prototype.addPoint=function(B){if(this._distance<=0)return null;var V=B.getCoordinates(),W=this._curveBuilder.getLineCurve(V,this._distance);this.addCurve(W,Hr.EXTERIOR,Hr.INTERIOR)},a_.prototype.addPolygon=function(B){var V=this,W=this._distance,K=ao.LEFT;this._distance<0&&(W=-this._distance,K=ao.RIGHT);var te=B.getExteriorRing(),le=di.removeRepeatedPoints(te.getCoordinates());if(this._distance<0&&this.isErodedCompletely(te,this._distance)||this._distance<=0&&le.length<3)return null;this.addPolygonRing(le,W,K,Hr.EXTERIOR,Hr.INTERIOR);for(var ue=0;ue0&&V.isErodedCompletely(ye,-V._distance)||V.addPolygonRing(be,W,ao.opposite(K),Hr.INTERIOR,Hr.EXTERIOR)}},a_.prototype.isTriangleErodedCompletely=function(B,V){var W=new Vu(B[0],B[1],B[2]),K=W.inCentre();return Po.distancePointLine(K,W.p0,W.p1)=n1.MINIMUM_VALID_SIZE&&Po.isCCW(B)&&(le=te,ue=K,W=ao.opposite(W));var ye=this._curveBuilder.getRingCurve(B,W,V);this.addCurve(ye,le,ue)},a_.prototype.add=function(B){if(B.isEmpty())return null;B instanceof Sd?this.addPolygon(B):B instanceof fh?this.addLineString(B):B instanceof g0?this.addPoint(B):(B instanceof _I||B instanceof r1||B instanceof o1||B instanceof Gm)&&this.addCollection(B)},a_.prototype.isErodedCompletely=function(B,V){var W=B.getCoordinates();if(W.length<4)return V<0;if(W.length===4)return this.isTriangleErodedCompletely(W,V);var K=B.getEnvelopeInternal(),te=Math.min(K.getHeight(),K.getWidth());return V<0&&2*Math.abs(V)>te},a_.prototype.addCollection=function(B){for(var V=0;V=this._max)throw new we;var B=this._parent.getGeometryN(this._index++);return B instanceof Gm?(this._subcollectionIterator=new l1(B),this._subcollectionIterator.next()):B},l1.prototype.remove=function(){throw new Error(this.getClass().getName())},l1.prototype.hasNext=function(){if(this._atStart)return!0;if(this._subcollectionIterator!==null){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},l1.prototype.interfaces_=function(){return[SS]},l1.prototype.getClass=function(){return l1},l1.isAtomic=function(B){return!(B instanceof Gm)};var s_=function(){this._geom=null;var B=arguments[0];this._geom=B};s_.prototype.locate=function(B){return s_.locate(B,this._geom)},s_.prototype.interfaces_=function(){return[VL]},s_.prototype.getClass=function(){return s_},s_.isPointInRing=function(B,V){return!!V.getEnvelopeInternal().intersects(B)&&Po.isPointInRing(B,V.getCoordinates())},s_.containsPointInPolygon=function(B,V){if(V.isEmpty())return!1;var W=V.getExteriorRing();if(!s_.isPointInRing(B,W))return!1;for(var K=0;K=0;te--){var le=this._edgeList.get(te),ue=le.getSym();K===null&&(K=ue),W!==null&&ue.setNext(W),W=le}K.setNext(W)},V.prototype.computeDepths=function(){var W=this;if(arguments.length===1){var K=arguments[0],te=this.findIndex(K),le=K.getDepth(ao.LEFT),ue=K.getDepth(ao.RIGHT),ye=this.computeDepths(te+1,this._edgeList.size(),le),be=this.computeDepths(0,te,ye);if(be!==ue)throw new Wm("depth mismatch at "+K.getCoordinate())}else if(arguments.length===3){for(var Te=arguments[0],Fe=arguments[1],Le=arguments[2],We=Le,et=Te;et=0;ye--){var be=K._resultAreaEdgeList.get(ye),Te=be.getSym();switch(te===null&&be.getEdgeRing()===W&&(te=be),ue){case K._SCANNING_FOR_INCOMING:if(Te.getEdgeRing()!==W)continue;le=Te,ue=K._LINKING_TO_OUTGOING;break;case K._LINKING_TO_OUTGOING:if(be.getEdgeRing()!==W)continue;le.setNextMin(be),ue=K._SCANNING_FOR_INCOMING}}ue===this._LINKING_TO_OUTGOING&&(Fs.isTrue(te!==null,"found null for first outgoing dirEdge"),Fs.isTrue(te.getEdgeRing()===W,"unable to link last incoming dirEdge"),le.setNextMin(te))},V.prototype.getOutgoingDegree=function(){if(arguments.length===0){for(var W=0,K=this.iterator();K.hasNext();){var te=K.next();te.isInResult()&&W++}return W}if(arguments.length===1){for(var le=arguments[0],ue=0,ye=this.iterator();ye.hasNext();){var be=ye.next();be.getEdgeRing()===le&&ue++}return ue}},V.prototype.getLabel=function(){return this._label},V.prototype.findCoveredLineEdges=function(){for(var W=Hr.NONE,K=this.iterator();K.hasNext();){var te=K.next(),le=te.getSym();if(!te.isLineEdge()){if(te.isInResult()){W=Hr.INTERIOR;break}if(le.isInResult()){W=Hr.EXTERIOR;break}}}if(W===Hr.NONE)return null;for(var ue=W,ye=this.iterator();ye.hasNext();){var be=ye.next(),Te=be.getSym();be.isLineEdge()?be.getEdge().setCovered(ue===Hr.INTERIOR):(be.isInResult()&&(ue=Hr.EXTERIOR),Te.isInResult()&&(ue=Hr.INTERIOR))}},V.prototype.computeLabelling=function(W){B.prototype.computeLabelling.call(this,W),this._label=new ws(Hr.NONE);for(var K=this.iterator();K.hasNext();)for(var te=K.next().getEdge().getLabel(),le=0;le<2;le++){var ue=te.getLocation(le);ue!==Hr.INTERIOR&&ue!==Hr.BOUNDARY||this._label.setLocation(le,Hr.INTERIOR)}},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(Wp),TK=function(B){function V(){B.apply(this,arguments)}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.createNode=function(W){return new lV(W,new EK)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(kL),sE=function B(){this._pts=null,this._orientation=null;var V=arguments[0];this._pts=V,this._orientation=B.orientation(V)};sE.prototype.compareTo=function(B){var V=B;return sE.compareOriented(this._pts,this._orientation,V._pts,V._orientation)},sE.prototype.interfaces_=function(){return[Ig]},sE.prototype.getClass=function(){return sE},sE.orientation=function(B){return di.increasingDirection(B)===1},sE.compareOriented=function(B,V,W,K){for(var te=V?1:-1,le=K?1:-1,ue=V?B.length:-1,ye=K?W.length:-1,be=V?0:B.length-1,Te=K?0:W.length-1;;){var Fe=B[be].compareTo(W[Te]);if(Fe!==0)return Fe;var Le=(be+=te)===ue,We=(Te+=le)===ye;if(Le&&!We)return-1;if(!Le&&We)return 1;if(Le&&We)return 0}};var Sy=function(){this._edges=new Be,this._ocaMap=new oc};Sy.prototype.print=function(B){B.print("MULTILINESTRING ( ");for(var V=0;V0&&B.print(","),B.print("(");for(var K=W.getCoordinates(),te=0;te0&&B.print(","),B.print(K[te].x+" "+K[te].y);B.println(")")}B.print(") ")},Sy.prototype.addAll=function(B){for(var V=B.iterator();V.hasNext();)this.add(V.next())},Sy.prototype.findEdgeIndex=function(B){for(var V=0;V0||!V.coord.equals2D(K);te||W--;var le=new Array(W).fill(null),ue=0;le[ue++]=new Pr(B.coord);for(var ye=B.segmentIndex+1;ye<=V.segmentIndex;ye++)le[ue++]=this.edge.pts[ye];return te&&(le[ue]=V.coord),new nF(le,new ws(this.edge._label))},u1.prototype.add=function(B,V,W){var K=new Nx(B,V,W),te=this._nodeMap.get(K);return te!==null?te:(this._nodeMap.put(K,K),K)},u1.prototype.isIntersection=function(B){for(var V=this.iterator();V.hasNext();)if(V.next().coord.equals(B))return!0;return!1},u1.prototype.interfaces_=function(){return[]},u1.prototype.getClass=function(){return u1};var RS=function(){};RS.prototype.getChainStartIndices=function(B){var V=0,W=new Be;W.add(new K_(V));do{var K=this.findChainEnd(B,V);W.add(new K_(K)),V=K}while(VW?V:W},qb.prototype.getMinX=function(B){var V=this.pts[this.startIndex[B]].x,W=this.pts[this.startIndex[B+1]].x;return VW&&(te=1),B._depth[V][K]=te}}},Yp.prototype.getDelta=function(B){return this._depth[B][ao.RIGHT]-this._depth[B][ao.LEFT]},Yp.prototype.getLocation=function(B,V){return this._depth[B][V]<=0?Hr.EXTERIOR:Hr.INTERIOR},Yp.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Yp.prototype.add=function(){var B=this;if(arguments.length===1)for(var V=arguments[0],W=0;W<2;W++)for(var K=1;K<3;K++){var te=V.getLocation(W,K);te!==Hr.EXTERIOR&&te!==Hr.INTERIOR||(B.isNull(W,K)?B._depth[W][K]=Yp.depthAtLocation(te):B._depth[W][K]+=Yp.depthAtLocation(te))}else if(arguments.length===3){var le=arguments[0],ue=arguments[1],ye=arguments[2];ye===Hr.INTERIOR&&this._depth[le][ue]++}},Yp.prototype.interfaces_=function(){return[]},Yp.prototype.getClass=function(){return Yp},Yp.depthAtLocation=function(B){return B===Hr.EXTERIOR?0:B===Hr.INTERIOR?1:Yp.NULL_VALUE},jG.NULL_VALUE.get=function(){return-1},Object.defineProperties(Yp,jG);var nF=function(B){function V(){if(B.call(this),this.pts=null,this._env=null,this.eiList=new u1(this),this._name=null,this._mce=null,this._isIsolated=!0,this._depth=new Yp,this._depthDelta=0,arguments.length===1){var W=arguments[0];V.call(this,W,null)}else if(arguments.length===2){var K=arguments[0],te=arguments[1];this.pts=K,this._label=te}}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.getDepth=function(){return this._depth},V.prototype.getCollapsedEdge=function(){var W=new Array(2).fill(null);return W[0]=this.pts[0],W[1]=this.pts[1],new V(W,ws.toLineLabel(this._label))},V.prototype.isIsolated=function(){return this._isIsolated},V.prototype.getCoordinates=function(){return this.pts},V.prototype.setIsolated=function(W){this._isIsolated=W},V.prototype.setName=function(W){this._name=W},V.prototype.equals=function(W){if(!(W instanceof V))return!1;var K=W;if(this.pts.length!==K.pts.length)return!1;for(var te=!0,le=!0,ue=this.pts.length,ye=0;ye0?this.pts[0]:null;if(arguments.length===1){var W=arguments[0];return this.pts[W]}},V.prototype.print=function(W){W.print("edge "+this._name+": "),W.print("LINESTRING (");for(var K=0;K0&&W.print(","),W.print(this.pts[K].x+" "+this.pts[K].y);W.print(") "+this._label+" "+this._depthDelta)},V.prototype.computeIM=function(W){V.updateIM(this._label,W)},V.prototype.isCollapsed=function(){return!!this._label.isArea()&&this.pts.length===3&&!!this.pts[0].equals(this.pts[2])},V.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])},V.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1},V.prototype.getDepthDelta=function(){return this._depthDelta},V.prototype.getNumPoints=function(){return this.pts.length},V.prototype.printReverse=function(W){W.print("edge "+this._name+": ");for(var K=this.pts.length-1;K>=0;K--)W.print(this.pts[K]+" ");W.println("")},V.prototype.getMonotoneChainEdge=function(){return this._mce===null&&(this._mce=new qb(this)),this._mce},V.prototype.getEnvelope=function(){if(this._env===null){this._env=new Aa;for(var W=0;W0&&W.append(","),W.append(this.pts[K].x+" "+this.pts[K].y);return W.append(") "+this._label+" "+this._depthDelta),W.toString()},V.prototype.isPointwiseEqual=function(W){if(this.pts.length!==W.pts.length)return!1;for(var K=0;KK||this._maxyle;if(ue)return!1;var ye=this.intersectsToleranceSquare(B,V);return Fs.isTrue(!(ue&&ye),"Found bad envelope test"),ye},Og.prototype.initCorners=function(B){var V=.5;this._minx=B.x-V,this._maxx=B.x+V,this._miny=B.y-V,this._maxy=B.y+V,this._corner[0]=new Pr(this._maxx,this._maxy),this._corner[1]=new Pr(this._minx,this._maxy),this._corner[2]=new Pr(this._minx,this._miny),this._corner[3]=new Pr(this._maxx,this._miny)},Og.prototype.intersects=function(B,V){return this._scaleFactor===1?this.intersectsScaled(B,V):(this.copyScaled(B,this._p0Scaled),this.copyScaled(V,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},Og.prototype.scale=function(B){return Math.round(B*this._scaleFactor)},Og.prototype.getCoordinate=function(){return this._originalPt},Og.prototype.copyScaled=function(B,V){V.x=this.scale(B.x),V.y=this.scale(B.y)},Og.prototype.getSafeEnvelope=function(){if(this._safeEnv===null){var B=Og.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Aa(this._originalPt.x-B,this._originalPt.x+B,this._originalPt.y-B,this._originalPt.y+B)}return this._safeEnv},Og.prototype.intersectsPixelClosure=function(B,V){return this._li.computeIntersection(B,V,this._corner[0],this._corner[1]),!!this._li.hasIntersection()||(this._li.computeIntersection(B,V,this._corner[1],this._corner[2]),!!this._li.hasIntersection()||(this._li.computeIntersection(B,V,this._corner[2],this._corner[3]),!!this._li.hasIntersection()||(this._li.computeIntersection(B,V,this._corner[3],this._corner[0]),!!this._li.hasIntersection())))},Og.prototype.intersectsToleranceSquare=function(B,V){var W=!1,K=!1;return this._li.computeIntersection(B,V,this._corner[0],this._corner[1]),!!this._li.isProper()||(this._li.computeIntersection(B,V,this._corner[1],this._corner[2]),!!this._li.isProper()||(this._li.hasIntersection()&&(W=!0),this._li.computeIntersection(B,V,this._corner[2],this._corner[3]),!!this._li.isProper()||(this._li.hasIntersection()&&(K=!0),this._li.computeIntersection(B,V,this._corner[3],this._corner[0]),!!this._li.isProper()||!(!W||!K)||!!B.equals(this._pt)||!!V.equals(this._pt))))},Og.prototype.addSnappedNode=function(B,V){var W=B.getCoordinate(V),K=B.getCoordinate(V+1);return!!this.intersects(W,K)&&(B.addIntersection(this.getCoordinate(),V),!0)},Og.prototype.interfaces_=function(){return[]},Og.prototype.getClass=function(){return Og},PK.SAFE_ENV_EXPANSION_FACTOR.get=function(){return .75},Object.defineProperties(Og,PK);var oF=function(){this.tempEnv1=new Aa,this.selectedSegment=new Da};oF.prototype.select=function(){if(arguments.length!==1&&arguments.length===2){var B=arguments[0],V=arguments[1];B.getLineSegment(V,this.selectedSegment),this.select(this.selectedSegment)}},oF.prototype.interfaces_=function(){return[]},oF.prototype.getClass=function(){return oF};var zL=function(){this._index=null;var B=arguments[0];this._index=B},IK={HotPixelSnapAction:{configurable:!0}};zL.prototype.snap=function(){if(arguments.length===1){var B=arguments[0];return this.snap(B,null,-1)}if(arguments.length===3){var V=arguments[0],W=arguments[1],K=arguments[2],te=V.getSafeEnvelope(),le=new MK(V,W,K);return this._index.query(te,{interfaces_:function(){return[aE]},visitItem:function(ue){ue.select(te,le)}}),le.isNodeAdded()}},zL.prototype.interfaces_=function(){return[]},zL.prototype.getClass=function(){return zL},IK.HotPixelSnapAction.get=function(){return MK},Object.defineProperties(zL,IK);var MK=function(B){function V(){B.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var W=arguments[0],K=arguments[1],te=arguments[2];this._hotPixel=W,this._parentEdge=K,this._hotPixelVertexIndex=te}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.isNodeAdded=function(){return this._isNodeAdded},V.prototype.select=function(){if(arguments.length!==2)return B.prototype.select.apply(this,arguments);var W=arguments[0],K=arguments[1],te=W.getContext();if(this._parentEdge!==null&&te===this._parentEdge&&K===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(te,K)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(oF),CI=function(){this._li=null,this._interiorIntersections=null;var B=arguments[0];this._li=B,this._interiorIntersections=new Be};CI.prototype.processIntersections=function(B,V,W,K){if(B===W&&V===K)return null;var te=B.getCoordinates()[V],le=B.getCoordinates()[V+1],ue=W.getCoordinates()[K],ye=W.getCoordinates()[K+1];if(this._li.computeIntersection(te,le,ue,ye),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var be=0;be=0;V--){try{B.bufferReducedPrecision(V)}catch(le){if(!(le instanceof Wm))throw le;B._saveException=le}if(B._resultGeometry!==null)return null}throw this._saveException}if(arguments.length===1){var W=arguments[0],K=qp.precisionScaleFactor(this._argGeom,this._distance,W),te=new ll(K);this.bufferFixedPrecision(te)}},qp.prototype.computeGeometry=function(){if(this.bufferOriginalPrecision(),this._resultGeometry!==null)return null;var B=this._argGeom.getFactory().getPrecisionModel();B.getType()===ll.FIXED?this.bufferFixedPrecision(B):this.bufferReducedPrecision()},qp.prototype.setQuadrantSegments=function(B){this._bufParams.setQuadrantSegments(B)},qp.prototype.bufferOriginalPrecision=function(){try{var B=new qm(this._bufParams);this._resultGeometry=B.buffer(this._argGeom,this._distance)}catch(V){if(!(V instanceof Ex))throw V;this._saveException=V}},qp.prototype.getResultGeometry=function(B){return this._distance=B,this.computeGeometry(),this._resultGeometry},qp.prototype.setEndCapStyle=function(B){this._bufParams.setEndCapStyle(B)},qp.prototype.interfaces_=function(){return[]},qp.prototype.getClass=function(){return qp},qp.bufferOp=function(){if(arguments.length===2){var B=arguments[0],V=arguments[1],W=new qp(B),K=W.getResultGeometry(V);return K}if(arguments.length===3){if(Number.isInteger(arguments[2])&&arguments[0]instanceof Qa&&typeof arguments[1]=="number"){var te=arguments[0],le=arguments[1],ue=arguments[2],ye=new qp(te);ye.setQuadrantSegments(ue);var be=ye.getResultGeometry(le);return be}if(arguments[2]instanceof Eu&&arguments[0]instanceof Qa&&typeof arguments[1]=="number"){var Te=arguments[0],Fe=arguments[1],Le=arguments[2],We=new qp(Te,Le),et=We.getResultGeometry(Fe);return et}}else if(arguments.length===4){var Ze=arguments[0],ot=arguments[1],Ke=arguments[2],Bt=arguments[3],gi=new qp(Ze);gi.setQuadrantSegments(Ke),gi.setEndCapStyle(Bt);var rt=gi.getResultGeometry(ot);return rt}},qp.precisionScaleFactor=function(B,V,W){var K=B.getEnvelopeInternal(),te=Sh.max(Math.abs(K.getMaxX()),Math.abs(K.getMaxY()),Math.abs(K.getMinX()),Math.abs(K.getMinY()))+2*(V>0?V:0),le=W-Math.trunc(Math.log(te)/Math.log(10)+1);return Math.pow(10,le)},HL.CAP_ROUND.get=function(){return Eu.CAP_ROUND},HL.CAP_BUTT.get=function(){return Eu.CAP_FLAT},HL.CAP_FLAT.get=function(){return Eu.CAP_FLAT},HL.CAP_SQUARE.get=function(){return Eu.CAP_SQUARE},HL.MAX_PRECISION_DIGITS.get=function(){return 12},Object.defineProperties(qp,HL);var Xm=function(){this._pt=[new Pr,new Pr],this._distance=Ts.NaN,this._isNull=!0};Xm.prototype.getCoordinates=function(){return this._pt},Xm.prototype.getCoordinate=function(B){return this._pt[B]},Xm.prototype.setMinimum=function(){if(arguments.length===1){var B=arguments[0];this.setMinimum(B._pt[0],B._pt[1])}else if(arguments.length===2){var V=arguments[0],W=arguments[1];if(this._isNull)return this.initialize(V,W),null;var K=V.distance(W);Kthis._distance&&this.initialize(V,W,K)}},Xm.prototype.interfaces_=function(){return[]},Xm.prototype.getClass=function(){return Xm};var h1=function(){};h1.prototype.interfaces_=function(){return[]},h1.prototype.getClass=function(){return h1},h1.computeDistance=function(){if(arguments[2]instanceof Xm&&arguments[0]instanceof fh&&arguments[1]instanceof Pr)for(var B=arguments[0],V=arguments[1],W=arguments[2],K=B.getCoordinates(),te=new Da,le=0;le0||this._isIn?Hr.INTERIOR:Hr.EXTERIOR)},Py.prototype.interfaces_=function(){return[]},Py.prototype.getClass=function(){return Py};var Jm=function B(){if(this._component=null,this._segIndex=null,this._pt=null,arguments.length===2){var V=arguments[0],W=arguments[1];B.call(this,V,B.INSIDE_AREA,W)}else if(arguments.length===3){var K=arguments[0],te=arguments[1],le=arguments[2];this._component=K,this._segIndex=te,this._pt=le}},DK={INSIDE_AREA:{configurable:!0}};Jm.prototype.isInsideArea=function(){return this._segIndex===Jm.INSIDE_AREA},Jm.prototype.getCoordinate=function(){return this._pt},Jm.prototype.getGeometryComponent=function(){return this._component},Jm.prototype.getSegmentIndex=function(){return this._segIndex},Jm.prototype.interfaces_=function(){return[]},Jm.prototype.getClass=function(){return Jm},DK.INSIDE_AREA.get=function(){return-1},Object.defineProperties(Jm,DK);var d1=function(B){this._pts=B||null};d1.prototype.filter=function(B){B instanceof g0&&this._pts.add(B)},d1.prototype.interfaces_=function(){return[Px]},d1.prototype.getClass=function(){return d1},d1.getPoints=function(){if(arguments.length===1){var B=arguments[0];return B instanceof g0?ov.singletonList(B):d1.getPoints(B,new Be)}if(arguments.length===2){var V=arguments[0],W=arguments[1];return V instanceof g0?W.add(V):V instanceof Gm&&V.apply(new d1(W)),W}};var NS=function(){this._locations=null;var B=arguments[0];this._locations=B};NS.prototype.filter=function(B){(B instanceof g0||B instanceof fh||B instanceof Sd)&&this._locations.add(new Jm(B,0,B.getCoordinate()))},NS.prototype.interfaces_=function(){return[Px]},NS.prototype.getClass=function(){return NS},NS.getLocations=function(B){var V=new Be;return B.apply(new NS(V)),V};var mp=function(){if(this._geom=null,this._terminateDistance=0,this._ptLocator=new Py,this._minDistanceLocation=null,this._minDistance=Ts.MAX_VALUE,arguments.length===2){var B=arguments[0],V=arguments[1];this._geom=[B,V],this._terminateDistance=0}else if(arguments.length===3){var W=arguments[0],K=arguments[1],te=arguments[2];this._geom=new Array(2).fill(null),this._geom[0]=W,this._geom[1]=K,this._terminateDistance=te}};mp.prototype.computeContainmentDistance=function(){var B=this;if(arguments.length===0){var V=new Array(2).fill(null);if(this.computeContainmentDistance(0,V),this._minDistance<=this._terminateDistance)return null;this.computeContainmentDistance(1,V)}else if(arguments.length===2){var W=arguments[0],K=arguments[1],te=1-W,le=Xb.getPolygons(this._geom[W]);if(le.size()>0){var ue=NS.getLocations(this._geom[te]);if(this.computeContainmentDistance(ue,le,K),this._minDistance<=this._terminateDistance)return this._minDistanceLocation[te]=K[0],this._minDistanceLocation[W]=K[1],null}}else if(arguments.length===3){if(arguments[2]instanceof Array&&os(arguments[0],me)&&os(arguments[1],me)){for(var ye=arguments[0],be=arguments[1],Te=arguments[2],Fe=0;Fethis._minDistance)return null;for(var te=V.getCoordinates(),le=W.getCoordinate(),ue=0;uethis._minDistance)return null;for(var et=Fe.getCoordinates(),Ze=Le.getCoordinates(),ot=0;otthis._distance&&this.initialize(V,W,K)}},xm.prototype.interfaces_=function(){return[]},xm.prototype.getClass=function(){return xm};var Bx=function(){};Bx.prototype.interfaces_=function(){return[]},Bx.prototype.getClass=function(){return Bx},Bx.computeDistance=function(){if(arguments[2]instanceof xm&&arguments[0]instanceof fh&&arguments[1]instanceof Pr)for(var B=arguments[0],V=arguments[1],W=arguments[2],K=new Da,te=B.getCoordinates(),le=0;le1||B<=0)throw new sh("Fraction is not in range (0.0 - 1.0]");this._densifyFrac=B},av.prototype.compute=function(B,V){this.computeOrientedDistance(B,V,this._ptDist),this.computeOrientedDistance(V,B,this._ptDist)},av.prototype.distance=function(){return this.compute(this._g0,this._g1),this._ptDist.getDistance()},av.prototype.computeOrientedDistance=function(B,V,W){var K=new wI(V);if(B.apply(K),W.setMaximum(K.getMaxPointDistance()),this._densifyFrac>0){var te=new cE(V,this._densifyFrac);B.apply(te),W.setMaximum(te.getMaxPointDistance())}},av.prototype.orientedDistance=function(){return this.computeOrientedDistance(this._g0,this._g1,this._ptDist),this._ptDist.getDistance()},av.prototype.interfaces_=function(){return[]},av.prototype.getClass=function(){return av},av.distance=function(){if(arguments.length===2){var B=arguments[0],V=arguments[1],W=new av(B,V);return W.distance()}if(arguments.length===3){var K=arguments[0],te=arguments[1],le=arguments[2],ue=new av(K,te);return ue.setDensifyFraction(le),ue.distance()}},aF.MaxPointDistanceFilter.get=function(){return wI},aF.MaxDensifiedByFractionDistanceFilter.get=function(){return cE},Object.defineProperties(av,aF);var wI=function(){this._maxPtDist=new xm,this._minPtDist=new xm,this._euclideanDist=new Bx,this._geom=null;var B=arguments[0];this._geom=B};wI.prototype.filter=function(B){this._minPtDist.initialize(),Bx.computeDistance(this._geom,B,this._minPtDist),this._maxPtDist.setMaximum(this._minPtDist)},wI.prototype.getMaxPointDistance=function(){return this._maxPtDist},wI.prototype.interfaces_=function(){return[Ay]},wI.prototype.getClass=function(){return wI};var cE=function(){this._maxPtDist=new xm,this._minPtDist=new xm,this._geom=null,this._numSubSegs=0;var B=arguments[0],V=arguments[1];this._geom=B,this._numSubSegs=Math.trunc(Math.round(1/V))};cE.prototype.filter=function(B,V){var W=this;if(V===0)return null;for(var K=B.getCoordinate(V-1),te=B.getCoordinate(V),le=(te.x-K.x)/this._numSubSegs,ue=(te.y-K.y)/this._numSubSegs,ye=0;yeW){this._isValid=!1;var te=K.getCoordinates();this._errorLocation=te[1],this._errorIndicator=B.getFactory().createLineString(te),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+r_.toLineString(te[0],te[1])+")"}},v0.prototype.isValid=function(){var B=Math.abs(this._bufDistance),V=v0.MAX_DISTANCE_DIFF_FRAC*B;return this._minValidDistance=B-V,this._maxValidDistance=B+V,!(!this._input.isEmpty()&&!this._result.isEmpty())||(this._bufDistance>0?this.checkPositiveValid():this.checkNegativeValid(),v0.VERBOSE&&Xf.out.println("Min Dist= "+this._minDistanceFound+" err= "+(1-this._minDistanceFound/this._bufDistance)+" Max Dist= "+this._maxDistanceFound+" err= "+(this._maxDistanceFound/this._bufDistance-1)),this._isValid)},v0.prototype.checkNegativeValid=function(){if(!(this._input instanceof Sd||this._input instanceof o1||this._input instanceof Gm))return null;var B=this.getPolygonLines(this._input);if(this.checkMinimumDistance(B,this._result,this._minValidDistance),!this._isValid)return null;this.checkMaximumDistance(B,this._result,this._maxValidDistance)},v0.prototype.getErrorIndicator=function(){return this._errorIndicator},v0.prototype.checkMinimumDistance=function(B,V,W){var K=new mp(B,V,W);if(this._minDistanceFound=K.distance(),this._minDistanceFound0&&B>V&&(this._isValid=!1,this._errorMsg="Area of positive buffer is smaller than input",this._errorIndicator=this._result),this._distance<0&&B=2||this._distance>0?null:(this._result.isEmpty()||(this._isValid=!1,this._errorMsg="Result is non-empty",this._errorIndicator=this._result),void this.report("ExpectedEmpty"))},Jf.prototype.report=function(B){if(!Jf.VERBOSE)return null;Xf.out.println("Check "+B+": "+(this._isValid?"passed":"FAILED"))},Jf.prototype.getErrorMessage=function(){return this._errorMsg},Jf.prototype.interfaces_=function(){return[]},Jf.prototype.getClass=function(){return Jf},Jf.isValidMsg=function(B,V,W){var K=new Jf(B,V,W);return K.isValid()?null:K.getErrorMessage()},Jf.isValid=function(B,V,W){return!!new Jf(B,V,W).isValid()},qG.VERBOSE.get=function(){return!1},qG.MAX_ENV_DIFF_FRAC.get=function(){return .012},Object.defineProperties(Jf,qG);var kx=function(){this._pts=null,this._data=null;var B=arguments[0],V=arguments[1];this._pts=B,this._data=V};kx.prototype.getCoordinates=function(){return this._pts},kx.prototype.size=function(){return this._pts.length},kx.prototype.getCoordinate=function(B){return this._pts[B]},kx.prototype.isClosed=function(){return this._pts[0].equals(this._pts[this._pts.length-1])},kx.prototype.getSegmentOctant=function(B){return B===this._pts.length-1?-1:xI.octant(this.getCoordinate(B),this.getCoordinate(B+1))},kx.prototype.setData=function(B){this._data=B},kx.prototype.getData=function(){return this._data},kx.prototype.toString=function(){return r_.toLineString(new Pd(this._pts))},kx.prototype.interfaces_=function(){return[s1]},kx.prototype.getClass=function(){return kx};var gp=function(){this._findAllIntersections=!1,this._isCheckEndSegmentsOnly=!1,this._li=null,this._interiorIntersection=null,this._intSegments=null,this._intersections=new Be,this._intersectionCount=0,this._keepIntersections=!0;var B=arguments[0];this._li=B,this._interiorIntersection=null};gp.prototype.getInteriorIntersection=function(){return this._interiorIntersection},gp.prototype.setCheckEndSegmentsOnly=function(B){this._isCheckEndSegmentsOnly=B},gp.prototype.getIntersectionSegments=function(){return this._intSegments},gp.prototype.count=function(){return this._intersectionCount},gp.prototype.getIntersections=function(){return this._intersections},gp.prototype.setFindAllIntersections=function(B){this._findAllIntersections=B},gp.prototype.setKeepIntersections=function(B){this._keepIntersections=B},gp.prototype.processIntersections=function(B,V,W,K){if(!this._findAllIntersections&&this.hasIntersection()||B===W&&V===K||this._isCheckEndSegmentsOnly&&!(this.isEndSegment(B,V)||this.isEndSegment(W,K)))return null;var te=B.getCoordinates()[V],le=B.getCoordinates()[V+1],ue=W.getCoordinates()[K],ye=W.getCoordinates()[K+1];this._li.computeIntersection(te,le,ue,ye),this._li.hasIntersection()&&this._li.isInteriorIntersection()&&(this._intSegments=new Array(4).fill(null),this._intSegments[0]=te,this._intSegments[1]=le,this._intSegments[2]=ue,this._intSegments[3]=ye,this._interiorIntersection=this._li.getIntersection(0),this._keepIntersections&&this._intersections.add(this._interiorIntersection),this._intersectionCount++)},gp.prototype.isEndSegment=function(B,V){return V===0||V>=B.size()-2},gp.prototype.hasIntersection=function(){return this._interiorIntersection!==null},gp.prototype.isDone=function(){return!this._findAllIntersections&&this._interiorIntersection!==null},gp.prototype.interfaces_=function(){return[LS]},gp.prototype.getClass=function(){return gp},gp.createAllIntersectionsFinder=function(B){var V=new gp(B);return V.setFindAllIntersections(!0),V},gp.createAnyIntersectionFinder=function(B){return new gp(B)},gp.createIntersectionCounter=function(B){var V=new gp(B);return V.setFindAllIntersections(!0),V.setKeepIntersections(!1),V};var Iy=function(){this._li=new Ub,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var B=arguments[0];this._segStrings=B};Iy.prototype.execute=function(){if(this._segInt!==null)return null;this.checkInteriorIntersections()},Iy.prototype.getIntersections=function(){return this._segInt.getIntersections()},Iy.prototype.isValid=function(){return this.execute(),this._isValid},Iy.prototype.setFindAllIntersections=function(B){this._findAllIntersections=B},Iy.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new gp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var B=new WG;if(B.setSegmentIntersector(this._segInt),B.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},Iy.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new Wm(this.getErrorMessage(),this._segInt.getInteriorIntersection())},Iy.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var B=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+r_.toLineString(B[0],B[1])+" and "+r_.toLineString(B[2],B[3])},Iy.prototype.interfaces_=function(){return[]},Iy.prototype.getClass=function(){return Iy},Iy.computeIntersections=function(B){var V=new Iy(B);return V.setFindAllIntersections(!0),V.isValid(),V.getIntersections()};var Jb=function B(){this._nv=null;var V=arguments[0];this._nv=new Iy(B.toSegmentStrings(V))};Jb.prototype.checkValid=function(){this._nv.checkValid()},Jb.prototype.interfaces_=function(){return[]},Jb.prototype.getClass=function(){return Jb},Jb.toSegmentStrings=function(B){for(var V=new Be,W=B.iterator();W.hasNext();){var K=W.next();V.add(new kx(K.getCoordinates(),K))}return V},Jb.checkValid=function(B){new Jb(B).checkValid()};var AI=function(B){this._mapOp=B};AI.prototype.map=function(B){for(var V=new Be,W=0;W0&&K<4&&!this._preserveType?this._factory.createLineString(W):this._factory.createLinearRing(W)},Ng.prototype.interfaces_=function(){return[]},Ng.prototype.getClass=function(){return Ng};var f1=function B(){if(this._snapTolerance=0,this._srcPts=null,this._seg=new Da,this._allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof fh&&typeof arguments[1]=="number"){var V=arguments[0],W=arguments[1];B.call(this,V.getCoordinates(),W)}else if(arguments[0]instanceof Array&&typeof arguments[1]=="number"){var K=arguments[0],te=arguments[1];this._srcPts=K,this._isClosed=B.isClosed(K),this._snapTolerance=te}};f1.prototype.snapVertices=function(B,V){for(var W=this._isClosed?B.size()-1:B.size(),K=0;K=0&&B.add(le+1,new Pr(te),!1)}},f1.prototype.findSegmentIndexToSnap=function(B,V){for(var W=this,K=Ts.MAX_VALUE,te=-1,le=0;leV&&(V=K)}return V}if(arguments.length===2){var te=arguments[0],le=arguments[1];return Math.min(Dd.computeOverlaySnapTolerance(te),Dd.computeOverlaySnapTolerance(le))}},Dd.computeSizeBasedSnapTolerance=function(B){var V=B.getEnvelopeInternal();return Math.min(V.getHeight(),V.getWidth())*Dd.SNAP_PRECISION_FACTOR},Dd.snapToSelf=function(B,V,W){return new Dd(B).snapToSelf(V,W)},XG.SNAP_PRECISION_FACTOR.get=function(){return 1e-9},Object.defineProperties(Dd,XG);var LK=function(B){function V(W,K,te){B.call(this),this._snapTolerance=W||null,this._snapPts=K||null,this._isSelfSnap=te!==void 0&&te}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.snapLine=function(W,K){var te=new f1(W,this._snapTolerance);return te.setAllowSnappingToSourceVertices(this._isSelfSnap),te.snapTo(K)},V.prototype.transformCoordinates=function(W,K){var te=W.toCoordinateArray(),le=this.snapLine(te,this._snapPts);return this._factory.getCoordinateSequenceFactory().create(le)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(Ng),Km=function(){this._isFirst=!0,this._commonMantissaBitsCount=53,this._commonBits=0,this._commonSignExp=null};Km.prototype.getCommon=function(){return Ts.longBitsToDouble(this._commonBits)},Km.prototype.add=function(B){var V=Ts.doubleToLongBits(B);return this._isFirst?(this._commonBits=V,this._commonSignExp=Km.signExpBits(this._commonBits),this._isFirst=!1,null):Km.signExpBits(V)!==this._commonSignExp?(this._commonBits=0,null):(this._commonMantissaBitsCount=Km.numCommonMostSigMantissaBits(this._commonBits,V),void(this._commonBits=Km.zeroLowerBits(this._commonBits,64-(12+this._commonMantissaBitsCount))))},Km.prototype.toString=function(){if(arguments.length===1){var B=arguments[0],V=Ts.longBitsToDouble(B),W=Ts.toBinaryString(B),K="0000000000000000000000000000000000000000000000000000000000000000"+W,te=K.substring(K.length-64),le=te.substring(0,1)+" "+te.substring(1,12)+"(exp) "+te.substring(12)+" [ "+V+" ]";return le}},Km.prototype.interfaces_=function(){return[]},Km.prototype.getClass=function(){return Km},Km.getBit=function(B,V){return B&1<>52},Km.zeroLowerBits=function(B,V){return B&~((1<=0;K--){if(Km.getBit(B,K)!==Km.getBit(V,K))return W;W++}return 52};var hE=function(){this._commonCoord=null,this._ccFilter=new dE},sF={CommonCoordinateFilter:{configurable:!0},Translater:{configurable:!0}};hE.prototype.addCommonBits=function(B){var V=new fE(this._commonCoord);B.apply(V),B.geometryChanged()},hE.prototype.removeCommonBits=function(B){if(this._commonCoord.x===0&&this._commonCoord.y===0)return B;var V=new Pr(this._commonCoord);V.x=-V.x,V.y=-V.y;var W=new fE(V);return B.apply(W),B.geometryChanged(),B},hE.prototype.getCommonCoordinate=function(){return this._commonCoord},hE.prototype.add=function(B){B.apply(this._ccFilter),this._commonCoord=this._ccFilter.getCommonCoordinate()},hE.prototype.interfaces_=function(){return[]},hE.prototype.getClass=function(){return hE},sF.CommonCoordinateFilter.get=function(){return dE},sF.Translater.get=function(){return fE},Object.defineProperties(hE,sF);var dE=function(){this._commonBitsX=new Km,this._commonBitsY=new Km};dE.prototype.filter=function(B){this._commonBitsX.add(B.x),this._commonBitsY.add(B.y)},dE.prototype.getCommonCoordinate=function(){return new Pr(this._commonBitsX.getCommon(),this._commonBitsY.getCommon())},dE.prototype.interfaces_=function(){return[Ay]},dE.prototype.getClass=function(){return dE};var fE=function(){this.trans=null;var B=arguments[0];this.trans=B};fE.prototype.filter=function(B,V){var W=B.getOrdinate(V,0)+this.trans.x,K=B.getOrdinate(V,1)+this.trans.y;B.setOrdinate(V,0,W),B.setOrdinate(V,1,K)},fE.prototype.isDone=function(){return!1},fE.prototype.isGeometryChanged=function(){return!0},fE.prototype.interfaces_=function(){return[Ty]},fE.prototype.getClass=function(){return fE};var _p=function(B,V){this._geom=new Array(2).fill(null),this._snapTolerance=null,this._cbr=null,this._geom[0]=B,this._geom[1]=V,this.computeSnapTolerance()};_p.prototype.selfSnap=function(B){return new Dd(B).snapTo(B,this._snapTolerance)},_p.prototype.removeCommonBits=function(B){this._cbr=new hE,this._cbr.add(B[0]),this._cbr.add(B[1]);var V=new Array(2).fill(null);return V[0]=this._cbr.removeCommonBits(B[0].copy()),V[1]=this._cbr.removeCommonBits(B[1].copy()),V},_p.prototype.prepareResult=function(B){return this._cbr.addCommonBits(B),B},_p.prototype.getResultGeometry=function(B){var V=this.snap(this._geom),W=ze.overlayOp(V[0],V[1],B);return this.prepareResult(W)},_p.prototype.checkValid=function(B){B.isValid()||Xf.out.println("Snapped geometry is invalid")},_p.prototype.computeSnapTolerance=function(){this._snapTolerance=Dd.computeOverlaySnapTolerance(this._geom[0],this._geom[1])},_p.prototype.snap=function(B){var V=this.removeCommonBits(B);return Dd.snap(V[0],V[1],this._snapTolerance)},_p.prototype.interfaces_=function(){return[]},_p.prototype.getClass=function(){return _p},_p.overlayOp=function(B,V,W){return new _p(B,V).getResultGeometry(W)},_p.union=function(B,V){return _p.overlayOp(B,V,ze.UNION)},_p.intersection=function(B,V){return _p.overlayOp(B,V,ze.INTERSECTION)},_p.symDifference=function(B,V){return _p.overlayOp(B,V,ze.SYMDIFFERENCE)},_p.difference=function(B,V){return _p.overlayOp(B,V,ze.DIFFERENCE)};var Qm=function(B,V){this._geom=new Array(2).fill(null),this._geom[0]=B,this._geom[1]=V};Qm.prototype.getResultGeometry=function(B){var V=null,W=!1,K=null;try{V=ze.overlayOp(this._geom[0],this._geom[1],B),W=!0}catch(te){if(!(te instanceof Ex))throw te;K=te}if(!W)try{V=_p.overlayOp(this._geom[0],this._geom[1],B)}catch(te){throw te instanceof Ex?K:te}return V},Qm.prototype.interfaces_=function(){return[]},Qm.prototype.getClass=function(){return Qm},Qm.overlayOp=function(B,V,W){return new Qm(B,V).getResultGeometry(W)},Qm.union=function(B,V){return Qm.overlayOp(B,V,ze.UNION)},Qm.intersection=function(B,V){return Qm.overlayOp(B,V,ze.INTERSECTION)},Qm.symDifference=function(B,V){return Qm.overlayOp(B,V,ze.SYMDIFFERENCE)},Qm.difference=function(B,V){return Qm.overlayOp(B,V,ze.DIFFERENCE)};var lF=function(){this.mce=null,this.chainIndex=null;var B=arguments[0],V=arguments[1];this.mce=B,this.chainIndex=V};lF.prototype.computeIntersections=function(B,V){this.mce.computeIntersectsForChain(this.chainIndex,B.mce,B.chainIndex,V)},lF.prototype.interfaces_=function(){return[]},lF.prototype.getClass=function(){return lF};var x0=function B(){if(this._label=null,this._xValue=null,this._eventType=null,this._insertEvent=null,this._deleteEventIndex=null,this._obj=null,arguments.length===2){var V=arguments[0],W=arguments[1];this._eventType=B.DELETE,this._xValue=V,this._insertEvent=W}else if(arguments.length===3){var K=arguments[0],te=arguments[1],le=arguments[2];this._eventType=B.INSERT,this._label=K,this._xValue=te,this._obj=le}},JG={INSERT:{configurable:!0},DELETE:{configurable:!0}};x0.prototype.isDelete=function(){return this._eventType===x0.DELETE},x0.prototype.setDeleteEventIndex=function(B){this._deleteEventIndex=B},x0.prototype.getObject=function(){return this._obj},x0.prototype.compareTo=function(B){var V=B;return this._xValueV._xValue?1:this._eventTypeV._eventType?1:0},x0.prototype.getInsertEvent=function(){return this._insertEvent},x0.prototype.isInsert=function(){return this._eventType===x0.INSERT},x0.prototype.isSameLabel=function(B){return this._label!==null&&this._label===B._label},x0.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},x0.prototype.interfaces_=function(){return[Ig]},x0.prototype.getClass=function(){return x0},JG.INSERT.get=function(){return 1},JG.DELETE.get=function(){return 2},Object.defineProperties(x0,JG);var uV=function(){};uV.prototype.interfaces_=function(){return[]},uV.prototype.getClass=function(){return uV};var Jp=function(){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var B=arguments[0],V=arguments[1],W=arguments[2];this._li=B,this._includeProper=V,this._recordIsolated=W};Jp.prototype.isTrivialIntersection=function(B,V,W,K){if(B===W&&this._li.getIntersectionNum()===1){if(Jp.isAdjacentSegments(V,K))return!0;if(B.isClosed()){var te=B.getNumPoints()-1;if(V===0&&K===te||K===0&&V===te)return!0}}return!1},Jp.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},Jp.prototype.setIsDoneIfProperInt=function(B){this._isDoneWhenProperInt=B},Jp.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},Jp.prototype.isBoundaryPointInternal=function(B,V){for(var W=V.iterator();W.hasNext();){var K=W.next().getCoordinate();if(B.isIntersection(K))return!0}return!1},Jp.prototype.hasProperIntersection=function(){return this._hasProper},Jp.prototype.hasIntersection=function(){return this._hasIntersection},Jp.prototype.isDone=function(){return this._isDone},Jp.prototype.isBoundaryPoint=function(B,V){return V!==null&&(!!this.isBoundaryPointInternal(B,V[0])||!!this.isBoundaryPointInternal(B,V[1]))},Jp.prototype.setBoundaryNodes=function(B,V){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=B,this._bdyNodes[1]=V},Jp.prototype.addIntersections=function(B,V,W,K){if(B===W&&V===K)return null;this.numTests++;var te=B.getCoordinates()[V],le=B.getCoordinates()[V+1],ue=W.getCoordinates()[K],ye=W.getCoordinates()[K+1];this._li.computeIntersection(te,le,ue,ye),this._li.hasIntersection()&&(this._recordIsolated&&(B.setIsolated(!1),W.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(B,V,W,K)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(B.addIntersections(this._li,V,0),W.addIntersections(this._li,K,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},Jp.prototype.interfaces_=function(){return[]},Jp.prototype.getClass=function(){return Jp},Jp.isAdjacentSegments=function(B,V){return Math.abs(B-V)===1};var gce=function(B){function V(){B.call(this),this.events=new Be,this.nOverlaps=null}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.prepareEvents=function(){ov.sort(this.events);for(var W=0;WV||this._maxle?1:0},uF.prototype.interfaces_=function(){return[xS]},uF.prototype.getClass=function(){return uF};var _ce=function(B){function V(){B.call(this),this._item=null;var W=arguments[0],K=arguments[1],te=arguments[2];this._min=W,this._max=K,this._item=te}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.query=function(W,K,te){if(!this.intersects(W,K))return null;te.visitItem(this._item)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(p1),vce=function(B){function V(){B.call(this),this._node1=null,this._node2=null;var W=arguments[0],K=arguments[1];this._node1=W,this._node2=K,this.buildExtent(this._node1,this._node2)}return B&&(V.__proto__=B),V.prototype=Object.create(B&&B.prototype),V.prototype.constructor=V,V.prototype.buildExtent=function(W,K){this._min=Math.min(W._min,K._min),this._max=Math.max(W._max,K._max)},V.prototype.query=function(W,K,te){if(!this.intersects(W,K))return null;this._node1!==null&&this._node1.query(W,K,te),this._node2!==null&&this._node2.query(W,K,te)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V}(p1),m1=function(){this._leaves=new Be,this._root=null,this._level=0};m1.prototype.buildTree=function(){ov.sort(this._leaves,new p1.NodeComparator);for(var B=this._leaves,V=null,W=new Be;;){if(this.buildLevel(B,W),W.size()===1)return W.get(0);V=B,B=W,W=V}},m1.prototype.insert=function(B,V,W){if(this._root!==null)throw new Error("Index cannot be added to once it has been queried");this._leaves.add(new _ce(B,V,W))},m1.prototype.query=function(B,V,W){this.init(),this._root.query(B,V,W)},m1.prototype.buildRoot=function(){if(this._root!==null)return null;this._root=this.buildTree()},m1.prototype.printNode=function(B){Xf.out.println(r_.toLineString(new Pr(B._min,this._level),new Pr(B._max,this._level)))},m1.prototype.init=function(){if(this._root!==null)return null;this.buildRoot()},m1.prototype.buildLevel=function(B,V){this._level++,V.clear();for(var W=0;W=2,"found LineString with single point"),this.insertBoundaryPoint(this._argIndex,K[0]),this.insertBoundaryPoint(this._argIndex,K[K.length-1])},V.prototype.getInvalidPoint=function(){return this._invalidPoint},V.prototype.getBoundaryPoints=function(){for(var W=this.getBoundaryNodes(),K=new Array(W.size()).fill(null),te=0,le=W.iterator();le.hasNext();){var ue=le.next();K[te++]=ue.getCoordinate().copy()}return K},V.prototype.getBoundaryNodes=function(){return this._boundaryNodes===null&&(this._boundaryNodes=this._nodes.getBoundaryNodes(this._argIndex)),this._boundaryNodes},V.prototype.addSelfIntersectionNode=function(W,K,te){if(this.isBoundaryNode(W,K))return null;te===Hr.BOUNDARY&&this._useBoundaryDeterminationRule?this.insertBoundaryPoint(W,K):this.insertPoint(W,K,te)},V.prototype.addPolygonRing=function(W,K,te){if(W.isEmpty())return null;var le=di.removeRepeatedPoints(W.getCoordinates());if(le.length<4)return this._hasTooFewPoints=!0,this._invalidPoint=le[0],null;var ue=K,ye=te;Po.isCCW(le)&&(ue=te,ye=K);var be=new nF(le,new ws(this._argIndex,Hr.BOUNDARY,ue,ye));this._lineEdgeMap.put(W,be),this.insertEdge(be),this.insertPoint(this._argIndex,le[0],Hr.BOUNDARY)},V.prototype.insertPoint=function(W,K,te){var le=this._nodes.addNode(K),ue=le.getLabel();ue===null?le._label=new ws(W,te):ue.setLocation(W,te)},V.prototype.createEdgeSetIntersector=function(){return new gce},V.prototype.addSelfIntersectionNodes=function(W){for(var K=this._edges.iterator();K.hasNext();)for(var te=K.next(),le=te.getLabel().getLocation(W),ue=te.eiList.iterator();ue.hasNext();){var ye=ue.next();this.addSelfIntersectionNode(W,ye.coord,le)}},V.prototype.add=function(){if(arguments.length!==1)return B.prototype.add.apply(this,arguments);var W=arguments[0];if(W.isEmpty())return null;if(W instanceof o1&&(this._useBoundaryDeterminationRule=!1),W instanceof Sd)this.addPolygon(W);else if(W instanceof fh)this.addLineString(W);else if(W instanceof g0)this.addPoint(W);else if(W instanceof _I)this.addCollection(W);else if(W instanceof r1)this.addCollection(W);else if(W instanceof o1)this.addCollection(W);else{if(!(W instanceof Gm))throw new Error(W.getClass().getName());this.addCollection(W)}},V.prototype.addCollection=function(W){for(var K=0;K50?(this._areaPtLocator===null&&(this._areaPtLocator=new GL(this._parentGeom)),this._areaPtLocator.locate(W)):this._ptLocator.locate(W,this._parentGeom)},V.prototype.findEdge=function(){if(arguments.length===1){var W=arguments[0];return this._lineEdgeMap.get(W)}return B.prototype.findEdge.apply(this,arguments)},V.prototype.interfaces_=function(){return[]},V.prototype.getClass=function(){return V},V.determineBoundary=function(W,K){return W.isInBoundary(K)?Hr.BOUNDARY:Hr.INTERIOR},V}(Ih),ge=function(){if(this._li=new Ub,this._resultPrecisionModel=null,this._arg=null,arguments.length===1){var B=arguments[0];this.setComputationPrecision(B.getPrecisionModel()),this._arg=new Array(1).fill(null),this._arg[0]=new cF(0,B)}else if(arguments.length===2){var V=arguments[0],W=arguments[1],K=m0.OGC_SFS_BOUNDARY_RULE;V.getPrecisionModel().compareTo(W.getPrecisionModel())>=0?this.setComputationPrecision(V.getPrecisionModel()):this.setComputationPrecision(W.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new cF(0,V,K),this._arg[1]=new cF(1,W,K)}else if(arguments.length===3){var te=arguments[0],le=arguments[1],ue=arguments[2];te.getPrecisionModel().compareTo(le.getPrecisionModel())>=0?this.setComputationPrecision(te.getPrecisionModel()):this.setComputationPrecision(le.getPrecisionModel()),this._arg=new Array(2).fill(null),this._arg[0]=new cF(0,te,ue),this._arg[1]=new cF(1,le,ue)}};ge.prototype.getArgGeometry=function(B){return this._arg[B].getGeometry()},ge.prototype.setComputationPrecision=function(B){this._resultPrecisionModel=B,this._li.setPrecisionModel(this._resultPrecisionModel)},ge.prototype.interfaces_=function(){return[]},ge.prototype.getClass=function(){return ge};var Ae=function(){};Ae.prototype.interfaces_=function(){return[]},Ae.prototype.getClass=function(){return Ae},Ae.map=function(){if(arguments[0]instanceof Qa&&os(arguments[1],Ae.MapOp)){for(var B=arguments[0],V=arguments[1],W=new Be,K=0;K=B.size()?null:B.get(V)},vn.union=function(B){return new vn(B).union()},Vn.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(vn,Vn);var Zn=function(){};function Wo(){return new Ha}function Ha(){this.reset()}Zn.prototype.interfaces_=function(){return[]},Zn.prototype.getClass=function(){return Zn},Zn.union=function(B,V){if(B.isEmpty()||V.isEmpty()){if(B.isEmpty()&&V.isEmpty())return ze.createEmptyResult(ze.UNION,B,V,B.getFactory());if(B.isEmpty())return V.copy();if(V.isEmpty())return B.copy()}return B.checkNotGeometryCollection(B),B.checkNotGeometryCollection(V),Qm.overlayOp(B,V,ze.UNION)},Ha.prototype={constructor:Ha,reset:function(){this.s=this.t=0},add:function(B){au(Vs,B,this.t),au(this,Vs.s,this.s),this.s?this.t+=Vs.t:this.s=Vs.t},valueOf:function(){return this.s}};var Vs=new Ha;function au(B,V,W){var K=B.s=V+W,te=K-V,le=K-te;B.t=V-le+(W-te)}var oa=1e-6,Ea=Math.PI,vl=Ea/2,lv=Ea/4,Qd=2*Ea,Kp=180/Ea,zc=Ea/180,Dh=Math.abs,pE=Math.atan,TI=Math.atan2,vp=Math.cos,yp=Math.sin,QG=Math.sqrt;function vOe(B){return B>1?0:B<-1?Ea:Math.acos(B)}function cV(B){return B>1?vl:B<-1?-vl:Math.asin(B)}function ZG(){}function OK(B,V){B&&xOe.hasOwnProperty(B.type)&&xOe[B.type](B,V)}var yOe={Feature:function(B,V){OK(B.geometry,V)},FeatureCollection:function(B,V){for(var W=B.features,K=-1,te=W.length;++KEa?B-Qd:B<-Ea?B+Qd:B,V]}function wOe(B){return function(V,W){return[(V+=B)>Ea?V-Qd:V<-Ea?V+Qd:V,W]}}function AOe(B){var V=wOe(B);return V.invert=wOe(-B),V}function EOe(B,V){var W=vp(B),K=yp(B),te=vp(V),le=yp(V);function ue(ye,be){var Te=vp(be),Fe=vp(ye)*Te,Le=yp(ye)*Te,We=yp(be),et=We*W+Fe*K;return[TI(Le*te-et*le,Fe*W-We*K),cV(et*te+Le*le)]}return ue.invert=function(ye,be){var Te=vp(be),Fe=vp(ye)*Te,Le=yp(ye)*Te,We=yp(be),et=We*te-Le*le;return[TI(Le*te+We*le,Fe*W+et*K),cV(et*W-Fe*K)]},ue}function TOe(B,V){(V=hV(V))[0]-=B,bce(V);var W=vOe(-V[1]);return((-V[2]<0?-W:W)+Qd-oa)%Qd}function SOe(){var B,V=[];return{point:function(W,K){B.push([W,K])},lineStart:function(){V.push(B=[])},lineEnd:ZG,rejoin:function(){V.length>1&&V.push(V.pop().concat(V.shift()))},result:function(){var W=V;return V=[],B=null,W}}}function kK(B,V){return Dh(B[0]-V[0])=0;--le)te.point((Fe=Te[le])[0],Fe[1]);else K(We.x,We.p.x,-1,te);We=We.p}Te=(We=We.o).z,et=!et}while(!We.v);te.lineEnd()}}}function IOe(B){if(V=B.length){for(var V,W,K=0,te=B[0];++KV?1:B>=V?0:NaN}wce.invert=wce;var Ace,DOe;(Ace=MOe).length===1&&(DOe=Ace,Ace=function(B,V){return MOe(DOe(B),V)});function LOe(B){for(var V,W,K,te=B.length,le=-1,ue=0;++le=0;)for(V=(K=B[te]).length;--V>=0;)W[--ue]=K[V];return W}var $G=1e9,zK=-$G;function D0t(B,V,W,K){function te(Te,Fe){return B<=Te&&Te<=W&&V<=Fe&&Fe<=K}function le(Te,Fe,Le,We){var et=0,Ze=0;if(Te==null||(et=ue(Te,Le))!==(Ze=ue(Fe,Le))||be(Te,Fe)<0^Le>0)do We.point(et===0||et===3?B:W,et>1?K:V);while((et=(et+Le+4)%4)!==Ze);else We.point(Fe[0],Fe[1])}function ue(Te,Fe){return Dh(Te[0]-B)0?0:3:Dh(Te[0]-W)0?2:1:Dh(Te[1]-V)0?1:0:Fe>0?3:2}function ye(Te,Fe){return be(Te.x,Fe.x)}function be(Te,Fe){var Le=ue(Te,1),We=ue(Fe,1);return Le!==We?Le-We:Le===0?Fe[1]-Te[1]:Le===1?Te[0]-Fe[0]:Le===2?Te[1]-Fe[1]:Fe[0]-Te[0]}return function(Te){var Fe,Le,We,et,Ze,ot,Ke,Bt,gi,rt,Ft,zt=Te,oi=SOe(),qt={point:Fr,lineStart:function(){qt.point=Cr,Le&&Le.push(We=[]),rt=!0,gi=!1,Ke=Bt=NaN},lineEnd:function(){Fe&&(Cr(et,Ze),ot&&gi&&oi.rejoin(),Fe.push(oi.result())),qt.point=Fr,gi&&zt.lineEnd()},polygonStart:function(){zt=oi,Fe=[],Le=[],Ft=!0},polygonEnd:function(){var rn=function(){for(var Lr=0,Rr=0,Tr=Le.length;RrK&&(As-nn)*(K-on)>(el-on)*(B-nn)&&++Lr:el<=K&&(As-nn)*(K-on)<(el-on)*(B-nn)&&--Lr;return Lr}(),Dr=Ft&&rn,mn=(Fe=LOe(Fe)).length;(Dr||mn)&&(Te.polygonStart(),Dr&&(Te.lineStart(),le(null,null,1,Te),Te.lineEnd()),mn&&POe(Fe,ye,rn,le,Te),Te.polygonEnd()),zt=Te,Fe=Le=We=null}};function Fr(rn,Dr){te(rn,Dr)&&zt.point(rn,Dr)}function Cr(rn,Dr){var mn=te(rn,Dr);if(Le&&We.push([rn,Dr]),rt)et=rn,Ze=Dr,ot=mn,rt=!1,mn&&(zt.lineStart(),zt.point(rn,Dr));else if(mn&&gi)zt.point(rn,Dr);else{var Lr=[Ke=Math.max(zK,Math.min($G,Ke)),Bt=Math.max(zK,Math.min($G,Bt))],Rr=[rn=Math.max(zK,Math.min($G,rn)),Dr=Math.max(zK,Math.min($G,Dr))];(function(Tr,nn,on,hn,nr,Io){var lo,As=Tr[0],el=Tr[1],yc=0,Lh=1,mu=nn[0]-As,Tu=nn[1]-el;if(lo=on-As,mu||!(lo>0)){if(lo/=mu,mu<0){if(lo0){if(lo>Lh)return;lo>yc&&(yc=lo)}if(lo=nr-As,mu||!(lo<0)){if(lo/=mu,mu<0){if(lo>Lh)return;lo>yc&&(yc=lo)}else if(mu>0){if(lo0)){if(lo/=Tu,Tu<0){if(lo0){if(lo>Lh)return;lo>yc&&(yc=lo)}if(lo=Io-el,Tu||!(lo<0)){if(lo/=Tu,Tu<0){if(lo>Lh)return;lo>yc&&(yc=lo)}else if(Tu>0){if(lo0&&(Tr[0]=As+yc*mu,Tr[1]=el+yc*Tu),Lh<1&&(nn[0]=As+Lh*mu,nn[1]=el+Lh*Tu),!0}}}}})(Lr,Rr,B,V,W,K)?(gi||(zt.lineStart(),zt.point(Lr[0],Lr[1])),zt.point(Rr[0],Rr[1]),mn||zt.lineEnd(),Ft=!1):mn&&(zt.lineStart(),zt.point(rn,Dr),Ft=!1)}Ke=rn,Bt=Dr,gi=mn}return qt}}var Ece=Wo();Wo();function ROe(B){return B}Wo(),Wo();var dV=1/0,HK=dV,e9=-dV,UK=e9,OOe={point:function(B,V){Be9&&(e9=B),VUK&&(UK=V)},lineStart:ZG,lineEnd:ZG,polygonStart:ZG,polygonEnd:ZG,result:function(){var B=[[dV,HK],[e9,UK]];return e9=UK=-(HK=dV=1/0),B}};Wo();function NOe(B,V,W,K){return function(te,le){var ue,ye,be,Te=V(le),Fe=te.invert(K[0],K[1]),Le=SOe(),We=V(Le),et=!1,Ze={point:ot,lineStart:Bt,lineEnd:gi,polygonStart:function(){Ze.point=rt,Ze.lineStart=Ft,Ze.lineEnd=zt,ye=[],ue=[]},polygonEnd:function(){Ze.point=ot,Ze.lineStart=Bt,Ze.lineEnd=gi,ye=LOe(ye);var oi=function(qt,Fr){var Cr=Fr[0],rn=Fr[1],Dr=[yp(Cr),-vp(Cr),0],mn=0,Lr=0;Ece.reset();for(var Rr=0,Tr=qt.length;Rr=0?1:-1,i9=hF*xp,fV=i9>Ea,WK=lo*Tu;if(Ece.add(TI(WK*hF*yp(i9),As*l_+WK*vp(i9))),mn+=fV?xp+hF*Qd:xp,fV^nr>=Cr^Lh>=Cr){var pV=FK(hV(hn),hV(yc));bce(pV);var jK=FK(Dr,pV);bce(jK);var YK=(fV^xp>=0?-1:1)*cV(jK[2]);(rn>YK||rn===YK&&(pV[0]||pV[1]))&&(Lr+=fV^xp>=0?1:-1)}}return(mn<-1e-6||mn0){for(et||(le.polygonStart(),et=!0),le.lineStart(),oi=0;oi1&&2&rn&&Dr.push(Dr.pop().concat(Dr.shift())),ye.push(Dr.filter(L0t))}return Ze}}function L0t(B){return B.length>1}function R0t(B,V){return((B=B.x)[0]<0?B[1]-vl-oa:vl-B[1])-((V=V.x)[0]<0?V[1]-vl-oa:vl-V[1])}var FOe=NOe(function(){return!0},function(B){var V,W=NaN,K=NaN,te=NaN;return{lineStart:function(){B.lineStart(),V=1},point:function(le,ue){var ye=le>0?Ea:-Ea,be=Dh(le-W);Dh(be-Ea)0?vl:-vl),B.point(te,K),B.lineEnd(),B.lineStart(),B.point(ye,K),B.point(le,K),V=0):te!==ye&&be>=Ea&&(Dh(W-te)oa?pE((yp(Fe)*(Ze=vp(We))*yp(Le)-yp(We)*(et=vp(Fe))*yp(Te))/(et*Ze*ot)):(Fe+We)/2}(W,K,le,ue),B.point(te,K),B.lineEnd(),B.lineStart(),B.point(ye,K),V=0),B.point(W=le,K=ue),te=ye},lineEnd:function(){B.lineEnd(),W=K=NaN},clean:function(){return 2-V}}},function(B,V,W,K){var te;if(B==null)te=W*vl,K.point(-Ea,te),K.point(0,te),K.point(Ea,te),K.point(Ea,0),K.point(Ea,-te),K.point(0,-te),K.point(-Ea,-te),K.point(-Ea,0),K.point(-Ea,te);else if(Dh(B[0]-V[0])>oa){var le=B[0]0,te=Dh(W)>oa;function le(be,Te){return vp(be)*vp(Te)>W}function ue(be,Te,Fe){var Le=[1,0,0],We=FK(hV(be),hV(Te)),et=NK(We,We),Ze=We[0],ot=et-Ze*Ze;if(!ot)return!Fe&&be;var Ke=W*et/ot,Bt=-W*Ze/ot,gi=FK(Le,We),rt=BK(Le,Ke);Cce(rt,BK(We,Bt));var Ft=gi,zt=NK(rt,Ft),oi=NK(Ft,Ft),qt=zt*zt-oi*(NK(rt,rt)-1);if(!(qt<0)){var Fr=QG(qt),Cr=BK(Ft,(-zt-Fr)/oi);if(Cce(Cr,rt),Cr=xce(Cr),!Fe)return Cr;var rn,Dr=be[0],mn=Te[0],Lr=be[1],Rr=Te[1];mn0^Cr[1]<(Dh(Cr[0]-Dr)Ea^(Dr<=Cr[0]&&Cr[0]<=mn)){var on=BK(Ft,(-zt+Fr)/oi);return Cce(on,rt),[Cr,xce(on)]}}}function ye(be,Te){var Fe=K?B:Ea-B,Le=0;return be<-Fe?Le|=1:be>Fe&&(Le|=2),Te<-Fe?Le|=4:Te>Fe&&(Le|=8),Le}return NOe(le,function(be){var Te,Fe,Le,We,et;return{lineStart:function(){We=Le=!1,et=1},point:function(Ze,ot){var Ke,Bt=[Ze,ot],gi=le(Ze,ot),rt=K?gi?0:ye(Ze,ot):gi?ye(Ze+(Ze<0?Ea:-Ea),ot):0;if(!Te&&(We=Le=gi)&&be.lineStart(),gi!==Le&&(!(Ke=ue(Te,Bt))||kK(Te,Ke)||kK(Bt,Ke))&&(Bt[0]+=oa,Bt[1]+=oa,gi=le(Bt[0],Bt[1])),gi!==Le)et=0,gi?(be.lineStart(),Ke=ue(Bt,Te),be.point(Ke[0],Ke[1])):(Ke=ue(Te,Bt),be.point(Ke[0],Ke[1]),be.lineEnd()),Te=Ke;else if(te&&Te&&K^gi){var Ft;rt&Fe||!(Ft=ue(Bt,Te,!0))||(et=0,K?(be.lineStart(),be.point(Ft[0][0],Ft[0][1]),be.point(Ft[1][0],Ft[1][1]),be.lineEnd()):(be.point(Ft[1][0],Ft[1][1]),be.lineEnd(),be.lineStart(),be.point(Ft[0][0],Ft[0][1])))}!gi||Te&&kK(Te,Bt)||be.point(Bt[0],Bt[1]),Te=Bt,Le=gi,Fe=rt},lineEnd:function(){Le&&be.lineEnd(),Te=null},clean:function(){return et|(We&&Le)<<1}}},function(be,Te,Fe,Le){(function(We,et,Ze,ot,Ke,Bt){if(Ze){var gi=vp(et),rt=yp(et),Ft=ot*Ze;Ke==null?(Ke=et+ot*Qd,Bt=et-Ft/2):(Ke=TOe(gi,Ke),Bt=TOe(gi,Bt),(ot>0?KeBt)&&(Ke+=ot*Qd));for(var zt,oi=Ke;ot>0?oi>Bt:oi4*K&&Bt--){var oi=be+Ze,qt=Te+ot,Fr=Fe+Ke,Cr=QG(oi*oi+qt*qt+Fr*Fr),rn=cV(Fr/=Cr),Dr=Dh(Dh(Fr)-1)K||Dh((rt*Tr+Ft*nn)/zt-.5)>.3||be*Ze+Te*ot+Fe*Ke2?Tr[2]%360*zc:0,Lr()):[Bt*Kp,gi*Kp,rt*Kp]},rn.precision=function(Tr){return arguments.length?(Cr=VOe(mn,Fr=Tr*Tr),Rr()):QG(Fr)},rn.fitExtent=function(Tr,nn){return kOe(rn,Tr,nn)},rn.fitSize=function(Tr,nn){return function(on,hn,nr){return kOe(on,[[0,0],hn],nr)}(rn,Tr,nn)},function(){return W=V.apply(this,arguments),rn.invert=W.invert&&Dr,Lr()}}(function(){return B})()}var zOe=function(B){return function(V,W){var K=vp(V),te=vp(W),le=B(K*te);return[le*te*yp(V),le*yp(W)]}}(function(B){return(B=vOe(B))&&B/yp(B)});function k0t(){return B0t(zOe).scale(79.4188).clipAngle(179.999)}function GK(B,V,W,K){var te=B.properties||{},le=B.type==="Feature"?B.geometry:B;if(le.type==="GeometryCollection"){var ue=[];return Xe(B,function(We){var et=GK(We,V,W,K);et&&ue.push(et)}),I(ue)}var ye=function(We){var et=Hs(We).geometry.coordinates,Ze=[-et[0],-et[1]];return k0t().rotate(Ze).scale(f)}(le),be={type:le.type,coordinates:UOe(le.coordinates,ye)},Te=new GG().read(be),Fe=F(k(V,W),"meters"),Le=qp.bufferOp(Te,Fe,K);if(!HOe((Le=new vK().write(Le)).coordinates))return x({type:Le.type,coordinates:GOe(Le.coordinates,ye)},te)}function HOe(B){return Array.isArray(B[0])?HOe(B[0]):isNaN(B[0])}function UOe(B,V){return typeof B[0]!="object"?V(B):B.map(function(W){return UOe(W,V)})}function GOe(B,V){return typeof B[0]!="object"?V.invert(B):B.map(function(W){return GOe(W,V)})}function Sce(B,V,W){W===void 0&&(W={});var K=de(B),te=de(V),le=FG(K.coordinates,te.coordinates);return le.length===0?null:le.length===1?E(le[0],W.properties):L(le,W.properties)}function t9(B,V,W){W===void 0&&(W={});var K=de(B),te=de(V),le=BG(K.coordinates,te.coordinates);return le.length===0?null:le.length===1?E(le[0],W.properties):L(le,W.properties)}/** * @license get-closest https://github.com/cosmosio/get-closest * * The MIT License (MIT) * * Copyright (c) 2014-2017 Olivier Scherrer */function V0t(B,V){return function(W,K,te){var le,ue;if(!Array.isArray(K))throw new Error("Get closest expects an array as second argument");return K.forEach(function(ye,be){var Te=te(ye,W);Te>=0&&(ue===void 0||Te0}function WOe(B,V,W){W===void 0&&(W={});var K=JSON.stringify(W.properties||{}),te=B[0],le=B[1],ue=B[2],ye=B[3],be=(le+ye)/2,Te=(te+ue)/2,Fe=2*V/St([te,be],[ue,be],W)*(ue-te),Le=2*V/St([Te,le],[Te,ye],W)*(ye-le),We=Fe/2,et=2*We,Ze=Math.sqrt(3)/2*Le,ot=ue-te,Ke=ye-le,Bt=3/4*et,gi=Ze,rt=(ot-et)/(et-We/2),Ft=Math.floor(rt),zt=(Ft*Bt-We/2-ot)/2-We/2+Bt/2,oi=Math.floor((Ke-Ze)/Ze),qt=(Ke-oi*Ze)/2,Fr=oi*Ze-Ke>Ze/2;Fr&&(qt-=Ze/4);for(var Cr=[],rn=[],Dr=0;Dr<6;Dr++){var mn=2*Math.PI/6*Dr;Cr.push(Math.cos(mn)),rn.push(Math.sin(mn))}for(var Lr=[],Rr=0;Rr<=Ft;Rr++)for(var Tr=0;Tr<=oi;Tr++){var nn=Rr%2==1;if((Tr!==0||!nn)&&(Tr!==0||!Fr)){var on=Rr*Bt+te-zt,hn=Tr*gi+le+qt;if(nn&&(hn-=Ze/2),W.triangles===!0)U0t([on,hn],Fe/2,Le/2,JSON.parse(K),Cr,rn).forEach(function(Io){W.mask?t9(W.mask,Io)&&Lr.push(Io):Lr.push(Io)});else{var nr=H0t([on,hn],Fe/2,Le/2,JSON.parse(K),Cr,rn);W.mask?t9(W.mask,nr)&&Lr.push(nr):Lr.push(nr)}}}return I(Lr)}function H0t(B,V,W,K,te,le){for(var ue=[],ye=0;ye<6;ye++){var be=B[0]+V*te[ye],Te=B[1]+W*le[ye];ue.push([be,Te])}return ue.push(ue[0].slice()),E([ue],K)}function U0t(B,V,W,K,te,le){for(var ue=[],ye=0;ye<6;ye++){var be=[];be.push(B),be.push([B[0]+V*te[ye],B[1]+W*le[ye]]),be.push([B[0]+V*te[(ye+1)%6],B[1]+W*le[(ye+1)%6]]),be.push(B),ue.push(E([be],K))}return ue}function jOe(B){if(B.features.length<=1)return B;var V=function(te){var le=Gt(),ue=[];return ut(te,function(ye,be){var Te=gt(ye);ue.push({minX:Te[0],minY:Te[1],maxX:Te[2],maxY:Te[3],geojson:ye,index:be})}),le.load(ue),le}(B),W=[],K={};return ut(B,function(te,le){if(K[le])return!0;for(V.remove({index:le},YOe),K[le]=!0;;){var ue=gt(te),ye=V.search({minX:ue[0],minY:ue[1],maxX:ue[2],maxY:ue[3]});if(ye.length>0)for(var be=ye.map(function(Le){return K[Le.index]=!0,V.remove({index:Le.index},YOe),Le.geojson}),Te=0,Fe=be.length;Te=te&&le===K.length-1);le++){if(te>=V){var ue=V-te;if(ue){var ye=fu(K[le],K[le-1])-180;return rs(K[le],ue,ye,W)}return w(K[le])}te+=St(K[le],K[le+1],W)}return w(K[K.length-1])},o.angle=function(B,V,W,K){if(K===void 0&&(K={}),!Q(K))throw new Error("options is invalid");if(!B)throw new Error("startPoint is required");if(!V)throw new Error("midPoint is required");if(!W)throw new Error("endPoint is required");var te=B,le=V,ue=W,ye=G(K.mercator!==!0?fu(te,le):Nb(te,le)),be=G(K.mercator!==!0?fu(ue,le):Nb(ue,le)),Te=Math.abs(ye-be);return K.explementary===!0?360-Te:Te},o.applyFilter=hI,o.area=dN,o.areaFactors=y,o.bbox=gt,o.bboxClip=function(B,V){var W=de(B),K=W.type,te=B.type==="Feature"?B.properties:{},le=W.coordinates;switch(K){case"LineString":case"MultiLineString":var ue=[];return K==="LineString"&&(le=[le]),le.forEach(function(ye){(function(be,Te,Fe){var Le,We,et,Ze,ot,Ke=be.length,Bt=qC(be[0],Te),gi=[];for(Fe||(Fe=[]),Le=1;Le0)for(var be=0;beW&&(V.numberOfClusters=W),V.mutate!==!0&&(B=ln(B));var K=Ue(B),te=K.slice(0,V.numberOfClusters),le=CL(K,V.numberOfClusters,te),ue={};return le.centroids.forEach(function(ye,be){ue[be]=ye}),De(B,function(ye,be){var Te=le.idxs[be];ye.properties.cluster=Te,ye.properties.centroid=ue[Te]}),B},o.collect=function(B,V,W,K){var te=Gt(6),le=V.features.map(function(ue){var ye;return{minX:ue.geometry.coordinates[0],minY:ue.geometry.coordinates[1],maxX:ue.geometry.coordinates[0],maxY:ue.geometry.coordinates[1],property:(ye=ue.properties)===null||ye===void 0?void 0:ye[W]}});return te.load(le),B.features.forEach(function(ue){ue.properties||(ue.properties={});var ye=gt(ue),be=te.search({minX:ye[0],minY:ye[1],maxX:ye[2],maxY:ye[3]}),Te=[];be.forEach(function(Fe){qe([Fe.minX,Fe.minY],ue)&&Te.push(Fe.property)}),ue.properties[K]=Te}),B},o.collectionOf=fe,o.combine=function(B){var V={MultiPoint:{coordinates:[],properties:[]},MultiLineString:{coordinates:[],properties:[]},MultiPolygon:{coordinates:[],properties:[]}};return De(B,function(W){var K,te,le,ue;switch((ue=W.geometry)===null||ue===void 0?void 0:ue.type){case"Point":V.MultiPoint.coordinates.push(W.geometry.coordinates),V.MultiPoint.properties.push(W.properties);break;case"MultiPoint":(K=V.MultiPoint.coordinates).push.apply(K,W.geometry.coordinates),V.MultiPoint.properties.push(W.properties);break;case"LineString":V.MultiLineString.coordinates.push(W.geometry.coordinates),V.MultiLineString.properties.push(W.properties);break;case"MultiLineString":(te=V.MultiLineString.coordinates).push.apply(te,W.geometry.coordinates),V.MultiLineString.properties.push(W.properties);break;case"Polygon":V.MultiPolygon.coordinates.push(W.geometry.coordinates),V.MultiPolygon.properties.push(W.properties);break;case"MultiPolygon":(le=V.MultiPolygon.coordinates).push.apply(le,W.geometry.coordinates),V.MultiPolygon.properties.push(W.properties)}}),I(Object.keys(V).filter(function(W){return V[W].coordinates.length}).sort().map(function(W){return x({type:W,coordinates:V[W].coordinates},{collectedProperties:V[W].properties})}))},o.concave=function(B,V){V===void 0&&(V={});var W=V.maxEdge||1/0,K=Zt(function(le){var ue=[],ye={};return De(le,function(be){if(be.geometry){var Te=be.geometry.coordinates.join("-");ye.hasOwnProperty(Te)||(ue.push(be),ye[Te]=!0)}}),I(ue)}(B));if(K.features=K.features.filter(function(le){var ue=le.geometry.coordinates[0][0],ye=le.geometry.coordinates[0][1],be=le.geometry.coordinates[0][2],Te=St(ue,ye,V),Fe=St(ye,be,V),Le=St(ue,be,V);return Te<=W&&Fe<=W&&Le<=W}),K.features.length<1)return null;var te=Xi(K);return te.coordinates.length===1&&(te.coordinates=te.coordinates[0],te.type="Polygon"),x(te)},o.containsNumber=oe,o.convertArea=X,o.convertDistance=J,o.convertLength=J,o.convex=Nr,o.coordAll=Ue,o.coordEach=ce,o.coordReduce=he,o.createBins=cI,o.degrees2radians=q,o.degreesToRadians=q,o.destination=rs,o.difference=function(B,V){var W=de(B),K=de(V),te=B.properties||{},le=kG(W.coordinates,K.coordinates);return le.length===0?null:le.length===1?E(le[0],te):L(le,te)},o.dissolve=function(B,V){if(!Q(V=V||{}))throw new Error("options is invalid");var W=V.propertyName;fe(B,"Polygon","dissolve");var K=ln(B),te=K.features,le=[];te.forEach(function(Fe,Le){Fe.properties.origIndexPosition=Le});var ue=yx();for(var ye in ue.load(K),te){var be=te[ye],Te=!1;if(ue.search(be).features.forEach(function(Fe){be=te[ye];var Le=Fe.properties.origIndexPosition;if(le.length>0&&Le!==0)if(Le>le[le.length-1])Le-=le.length;else{var We=V0t(Le,le);We!==0&&(Le-=We)}if(Le!==+ye){var et=te[Le];et&&be&&(W!==void 0&&et.properties[W]!==be.properties[W]||rI(be,et)&&z0t(be,et)&&(te[ye]=Sce(be,et),le.push(Fe.properties.origIndexPosition),le.sort(function(Ze,ot){return Ze-ot}),ue.remove(Fe),te.splice(Le,1),be.properties.origIndexPosition=ye,ue.remove(be,function(Ze,ot){return Ze.properties.origIndexPosition===ot.properties.origIndexPosition}),Te=!0))}}),Te){if(!be)continue;be.properties.origIndexPosition=ye,ue.insert(be),ye--}}return te.forEach(function(Fe){delete Fe.properties.origIndexPosition,delete Fe.bbox}),K},o.distance=St,o.distanceToDegrees=U,o.distanceToRadians=k,o.distanceWeight=bf,o.earthRadius=f,o.ellipse=aI,o.envelope=$o,o.explode=Ic,o.factors=m,o.feature=x,o.featureCollection=I,o.featureEach=De,o.featureOf=ae,o.featureReduce=Oe,o.filterProperties=qk,o.findPoint=At,o.findSegment=Xt,o.flatten=function(B){if(!B)throw new Error("geojson is required");var V=[];return ut(B,function(W){V.push(W)}),I(V)},o.flattenEach=ut,o.flattenReduce=at,o.flip=function(B,V){if(!Q(V=V||{}))throw new Error("options is invalid");var W=V.mutate;if(!B)throw new Error("geojson is required");return W!==!1&&W!==void 0||(B=ln(B)),ce(B,function(K){var te=K[0],le=K[1];K[0]=le,K[1]=te}),B},o.geojsonType=se,o.geomEach=Xe,o.geomReduce=it,o.geometry=C,o.geometryCollection=R,o.getCluster=ML,o.getCoord=re,o.getCoords=ne,o.getGeom=de,o.getType=ve,o.greatCircle=function(B,V,W){if(typeof(W=W||{})!="object")throw new Error("options is invalid");var K=W.properties,te=W.npoints,le=W.offset;return B=re(B),V=re(V),K=K||{},te=te||100,le=le||10,new Db({x:B[0],y:B[1]},{x:V[0],y:V[1]},K).Arc(te,{offset:le}).json()},o.helpers=ie,o.hexGrid=WOe,o.inside=qe,o.interpolate=function(B,V,W){if(typeof(W=W||{})!="object")throw new Error("options is invalid");var K=W.gridType,te=W.property,le=W.weight;if(!B)throw new Error("points is required");if(fe(B,"Point","input must contain Points"),!V)throw new Error("cellSize is required");if(le!==void 0&&typeof le!="number")throw new Error("weight must be a number");te=te||"elevation",K=K||"square",le=le||1;var ue,ye=gt(B);switch(K){case"point":case"points":ue=zA(ye,V,W);break;case"square":case"squares":ue=qOe(ye,V,W);break;case"hex":case"hexes":ue=WOe(ye,V,W);break;case"triangle":case"triangles":ue=XOe(ye,V,W);break;default:throw new Error("invalid gridType")}var be=[];return De(ue,function(Te){var Fe=0,Le=0;De(B,function(et){var Ze,ot=St(K==="point"?Te:Wu(Te),et,W);if(te!==void 0&&(Ze=et.properties[te]),Ze===void 0&&(Ze=et.geometry.coordinates[2]),Ze===void 0)throw new Error("zValue is missing");ot===0&&(Fe=Ze);var Ke=1/Math.pow(ot,le);Le+=Ke,Fe+=Ke*Ze});var We=ln(Te);We.properties[te]=Fe/Le,be.push(We)}),I(be)},o.intersect=t9,o.invariant=pe,o.isNumber=Y,o.isObject=Q,o.isobands=function(B,V,W){if(!Q(W=W||{}))throw new Error("options is invalid");var K=W.zProperty||"elevation",te=W.commonProperties||{},le=W.breaksProperties||[];if(fe(B,"Point","Input must contain Points"),!V)throw new Error("breaks is required");if(!Array.isArray(V))throw new Error("breaks is not an Array");if(!Q(te))throw new Error("commonProperties is not an Object");if(!Array.isArray(le))throw new Error("breaksProperties is not an Array");var ue=CG(B,{zProperty:K,flip:!0}),ye=function(be,Te,Fe){for(var Le=[],We=1;We0&&(be=E(ye).geometry),yy(be,Te),ye=Te.slice(0);W.push(E(ye,ue));break;case"MultiPolygon":ye=[[[]]];for(var Le=0;Le0&&(be=L(ye).geometry),Sl(be,Te),ye=Te.slice(0);W.push(L(ye,ue));break;default:throw new Error("geometry is invalid, must be Polygon or MultiPolygon")}}),I(W)},o.polygonTangents=function(B,V){var W,K,te,le,ue=ne(B),ye=ne(V),be=gt(V),Te=0,Fe=null;switch(ue[0]>be[0]&&ue[0]be[1]&&ue[1] is required");if(typeof W!="boolean")throw new Error(" must be a boolean");if(typeof K!="boolean")throw new Error(" must be a boolean");K===!1&&(B=ln(B));var te=[];switch(B.type){case"GeometryCollection":return Xe(B,function(le){cL(le,W)}),B;case"FeatureCollection":return De(B,function(le){De(cL(le,W),function(ue){te.push(ue)})}),I(te)}return cL(B,W)},o.rhumbBearing=Nb,o.rhumbDestination=dS,o.rhumbDistance=ns,o.round=O,o.sample=function(B,V){if(!B)throw new Error("featurecollection is required");if(V==null)throw new Error("num is required");if(typeof V!="number")throw new Error("num must be a number");return I(function(W,K){for(var te,le,ue=W.slice(0),ye=W.length,be=ye-K;ye-- >be;)te=ue[le=Math.floor((ye+1)*Math.random())],ue[le]=ue[ye],ue[ye]=te;return ue.slice(be)}(B.features,V))},o.sector=function(B,V,W,K,te){if(!Q(te=te||{}))throw new Error("options is invalid");var le=te.properties;if(!B)throw new Error("center is required");if(W==null)throw new Error("bearing1 is required");if(K==null)throw new Error("bearing2 is required");if(!V)throw new Error("radius is required");if(typeof te!="object")throw new Error("options must be an object");if(pu(W)===pu(K))return Wa(B,V,te);var ue=ne(B),ye=Rb(B,V,W,K,te),be=[[ue]];return ce(ye,function(Te){be[0].push(Te)}),be[0].push(ue),E(be,le)},o.segmentEach=Pt,o.segmentReduce=Qe,o.shortestPath=function(B,V,W){if(!Q(W=W||{}))throw new Error("options is invalid");var K=W.resolution,te=W.minDistance,le=W.obstacles||I([]);if(!B)throw new Error("start is required");if(!V)throw new Error("end is required");if(K&&!Y(K)||K<=0)throw new Error("options.resolution must be a number, greater than 0");if(te)throw new Error("options.minDistance is not yet implemented");var ue=re(B),ye=re(V);switch(B=w(ue),V=w(ye),ve(le)){case"FeatureCollection":if(le.features.length===0)return S([ue,ye]);break;case"Polygon":le=I([x(de(le))]);break;default:throw new Error("invalid obstacles")}var be=le;be.features.push(B),be.features.push(V);var Te=gt(pL(Zo(gt(be)),1.15));K||(K=St([Te[0],Te[1]],[Te[2],Te[1]],W)/100),be.features.pop(),be.features.pop();for(var Fe=Te[0],Le=Te[1],We=Te[2],et=Te[3],Ze=K/St([Fe,Le],[We,Le],W)*(We-Fe),ot=K/St([Fe,Le],[Fe,et],W)*(et-Le),Ke=We-Fe,Bt=et-Le,gi=Math.floor(Ke/Ze),rt=Math.floor(Bt/ot),Ft=(Ke-gi*Ze)/2,zt=[],oi=[],qt=[],Fr=[],Cr=1/0,rn=1/0,Dr=et-(Bt-rt*ot)/2,mn=0;Dr>=Le;){for(var Lr=[],Rr=[],Tr=Fe+Ft,nn=0;Tr<=We;){var on=w([Tr,Dr]),hn=bL(on,le);Lr.push(hn?0:1),Rr.push(Tr+"|"+Dr);var nr=St(on,B);!hn&&nrZe[Tu.isect].coord?-1:1}),Le=[];qt.length>0;){var mn=qt.pop(),Lr=mn.isect,Rr=mn.parent,Tr=mn.winding,nn=Le.length,on=[Ze[Lr].coord],hn=Lr;if(Ze[Lr].ringAndEdge1Walkable)var nr=Ze[Lr].ringAndEdge1,Io=Ze[Lr].nxtIsectAlongRingAndEdge1;else nr=Ze[Lr].ringAndEdge2,Io=Ze[Lr].nxtIsectAlongRingAndEdge2;for(;!lS(Ze[Lr].coord,Ze[Io].coord);){on.push(Ze[Io].coord);var lo=void 0;for(ue=0;ue1)for(Tu=0;Tu= shadowMap_lightPositionEC.w) { discard; } distance /= shadowMap_lightPositionEC.w; // radius out_FragColor = czm_packDepth(distance); `:m?E+=` out_FragColor = vec4(1.0); `:E+=` out_FragColor = czm_packDepth(gl_FragCoord.z); `,E+=`} `,x.push(E),new Zr({defines:y,sources:x})};SB.getReceiveShaderKeyword=function(o,f,m,v){let y=o._usesDepthTexture,x=o._polygonOffsetSupported,C=o._isPointLight,w=o._isSpotLight,A=o._numberOfCascades>1,E=o.debugCascadeColors,T=o.softShadows;return`receivePerspectiveProjection ${y}${x}${C}${w}${A}${E}${T}${f}${m}${v}`};SB.createReceiveVertexShader=function(o,f,m){let v=o.defines.slice(0),y=o.sources.slice(0);return f&&(m?v.push("GENERATE_POSITION_AND_NORMAL"):v.push("GENERATE_POSITION")),new Zr({defines:v,sources:y})};SB.createReceiveFragmentShader=function(o,f,m,v,y){let x=Zr.findNormalVarying(o),C=!v&&N(x)||v&&y,w=Zr.findPositionVarying(o),A=N(w),E=f._usesDepthTexture,T=f._polygonOffsetSupported,S=f._isPointLight,M=f._isSpotLight,I=f._numberOfCascades>1,P=f.debugCascadeColors,D=f.softShadows,L=S?f._pointBias:v?f._terrainBias:f._primitiveBias,R=o.defines.slice(0),O=o.sources.slice(0),F=O.length;for(let G=0;G0&&R.push("USE_NORMAL_SHADING_SMOOTH"));let k="";S?k+=`uniform samplerCube shadowMap_textureCube; `:k+=`uniform sampler2D shadowMap_texture; `,k+="uniform sampler2D shadowMap_blendTextureArray[4];",k+=`uniform sampler2D shadowMap_projectionTextureArr[4]; `,k+=`uniform vec4 shadowMap_lightPositionECArr[4]; `,k+=`uniform mat4 shadowMap_matrixArr[4]; `,k+=`uniform mat4 shadowMap_calibrateParamArr[4]; `,k+=`uniform vec4 shadowMapCount; `;let U;return A?U=` return vec4(${w}, 1.0); `:U=`#ifndef LOG_DEPTH return czm_windowToEyeCoordinates(gl_FragCoord); #else return vec4(v_logPositionEC, 1.0); #endif `,k+=`uniform mat4 shadowMap_matrix; uniform vec3 shadowMap_lightDirectionEC; uniform vec4 shadowMap_lightPositionEC; uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; uniform vec4 shadowMap_opacityArr; #ifdef LOG_DEPTH in vec3 v_logPositionEC; #endif vec4 getPositionEC() { ${U}} vec3 getNormalEC() { ${C?` return normalize(${x}); `:` return vec3(1.0); `}} void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) { ${L.normalOffset&&C?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; float normalOffsetScale = 1.0 - nDotL; vec3 offset = normalOffset * normalOffsetScale * normalEC; positionEC.xyz += offset; `:""}} vec2 cameraDistortion(inout vec2 UV, mat4 calibParam) //imageSize, vec2 focalLength, vec2 opticalCenter, vec4 distortionCoeffs, vec2 tangentCoeffs) { vec2 imageSize = vec2(calibParam[0][0],calibParam[0][1]); vec2 focalLength = vec2(calibParam[0][2],calibParam[0][3]); vec2 opticalCenter = vec2(calibParam[1][0],calibParam[1][1]); vec2 tangentCoeffs = vec2(calibParam[1][2],calibParam[1][3]); vec4 distortionCoeffs = vec4(calibParam[2][0], calibParam[2][1],calibParam[2][2],calibParam[2][3]); vec2 opticalCenterUV = opticalCenter / imageSize; vec2 xy = (UV - opticalCenterUV ) * imageSize / focalLength; float x2 = xy.x * xy.x; float y2 = xy.y * xy.y; float r2 = x2 + y2; float _2xy = 2.0 * xy.x * xy.y; highp float kr = (1.0 + ((distortionCoeffs.z*r2 + distortionCoeffs.y)*r2 + distortionCoeffs.x)*r2); highp float dx = (xy.x*kr + tangentCoeffs.x*_2xy + tangentCoeffs.y*(r2 + 2.0*x2)); highp float dy = (xy.y*kr + tangentCoeffs.x*(r2 + 2.0*y2) + tangentCoeffs.y*_2xy); UV = vec2(dx,dy) * focalLength / imageSize + opticalCenterUV; return UV; } `,k+=`void main() { czm_shadow_receive_main(); vec4 positionEC = getPositionEC(); vec3 normalEC = getNormalEC(); float depth = -positionEC.z; `,M&&(k+=` for(int i = 0; i < 4; i++){ if(i < int(shadowMapCount.x)){ `),k+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionECArr[i].xyz); float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); vec4 shadowPosition = shadowMap_matrixArr[i] * positionEC; // Spot light uses a perspective projection, so perform the perspective divide shadowPosition /= shadowPosition.w; vec2 oldUV = shadowPosition.xy; if(shadowMap_calibrateParamArr[i][0].y > 0.0){ shadowPosition.xy = cameraDistortion(shadowPosition.xy, shadowMap_calibrateParamArr[i] ); //imageSize, focalLength, opticalCenter, distortionCoefficients, tangentCoeffs); } // Stop early if the fragment is not in the shadow bounds if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { continue; } if(i == 0){ vec4 tempColor = texture(shadowMap_blendTextureArray[0], oldUV.xy); if(tempColor.a < 0.14 ) continue; tempColor = texture(shadowMap_projectionTextureArr[0], shadowPosition.xy) * tempColor; out_FragColor = mix(out_FragColor,tempColor, shadowMap_opacityArr.x * tempColor.a); }else if(i == 1){ vec4 tempColor = texture(shadowMap_blendTextureArray[1], oldUV.xy); if(tempColor.a < 0.14 ) continue; tempColor = texture(shadowMap_projectionTextureArr[1], shadowPosition.xy) * tempColor; out_FragColor = mix(out_FragColor,tempColor, shadowMap_opacityArr.y * tempColor.a); }else if(i == 2){ vec4 tempColor = texture(shadowMap_blendTextureArray[2], oldUV.xy); if(tempColor.a < 0.14 ) continue; tempColor = texture(shadowMap_projectionTextureArr[2], shadowPosition.xy) * tempColor; out_FragColor = mix(out_FragColor,tempColor, shadowMap_opacityArr.z * tempColor.a); }else { vec4 tempColor = texture(shadowMap_blendTextureArray[3], oldUV.xy); if(tempColor.a < 0.14 ) continue; tempColor = texture(shadowMap_projectionTextureArr[3], shadowPosition.xy) * tempColor; out_FragColor = mix(out_FragColor,tempColor, shadowMap_opacityArr.w * tempColor.a); } }else{ break; } } `,k+=`} `,O.push(k),new Zr({defines:R,sources:O})};var Q7=SB,qQ={gradient:!0,width:13,colorRamp:[{value:0,color:"rgba(255,255,255,0)"},{value:1,color:"rgba(255,255,255,1)"}]};function $2(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.context;this._enabled=Z(o.enabled,!0),this._softShadows=Z(o.softShadows,!1),this._normalOffset=Z(o.normalOffset,!0),this.dirty=!0,this._name=o.name||"",this._matchMaterials=o.matchMaterials||[],this._type="perspective",this.fromLightSource=Z(o.fromLightSource,!0),this.darkness=Z(o.darkness,0),this._darkness=this.darkness,this.maximumDistance=Z(o.maximumDistance,2e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0,this._outOfAngle=!1,this._outOfAnglePrevious=!1,this._angleDiff=0;let m=!0;(pa.isInternetExplorer()||pa.isEdge()||(pa.isChrome()||pa.isFirefox())&&pa.isWindows()&&!f.depthTexture)&&(m=!0),this._polygonOffsetSupported=m,this._terrainBias={polygonOffset:m,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:m,polygonOffsetFactor:-1.1,polygonOffsetUnits:-4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:o.depthBias||-2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Ee,this._shadowMapTexture=void 0,this._shadowMapProjectionTexture=void 0,this._castImage=void 0,this._lightDirectionEC=new H,this._lightPositionEC=new Wt,this._distance=0,this._lightCamera=o.lightCamera,this._shadowMapCamera=new Yre,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new Pi,this._isPointLight=Z(o.isPointLight,!1),this._pointLightRadius=Z(o.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:Z(o.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?Z(o.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Ye,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pm:N(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Wt,new Wt],this._cascadeMatrices=[new Ee,new Ee,new Ee,new Ee],this._cascadeDistances=new Wt;let v;this._isPointLight?v=6:this._cascadesEnabled?v=this._numberOfCascades:v=1,this._passes=new Array(v);for(let C=0;C=f?f:Bo.maximumCubeMapSize,y.x=f,y.y=f;let x=new Xr(0,0,f,f);m[0].passState.viewport=x,m[1].passState.viewport=x,m[2].passState.viewport=x,m[3].passState.viewport=x,m[4].passState.viewport=x,m[5].passState.viewport=x}else v===1?(f=Bo.maximumTextureSize>=f?f:Bo.maximumTextureSize,y.x=f,y.y=f,m[0].passState.viewport=new Xr(0,0,f,f)):v===4&&(f=Bo.maximumTextureSize>=f*2?f:Bo.maximumTextureSize/2,y.x=f*2,y.y=f*2,m[0].passState.viewport=new Xr(0,0,f,f),m[1].passState.viewport=new Xr(f,0,f,f),m[2].passState.viewport=new Xr(0,f,f,f),m[3].passState.viewport=new Xr(f,f,f,f));o._clearPassState.viewport=new Xr(0,0,y.x,y.y);for(let x=0;x=o.maximumDistance){o._outOfView=!0,o._needsUpdate=!1;return}let x=f.mapProjection.ellipsoid.geodeticSurfaceNormal(m.positionWC,kGt),C=H.negate(v.directionWC,VGt),w=H.dot(x,C),A=xe.clamp(w/.1,0,1);if(o._darkness=0,w<0){o._outOfView=!0,o._needsUpdate=!1;return}o._needsUpdate=!0,o._outOfView=!1}else if(o._isPointLight){if(y.center=v.positionWC,y.radius=o._pointLightRadius,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,!o._outOfView){let x=H.distance(v.positionWC,m.positionWC);o._outOfView=x>=o.maximumDistance}o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere)}else{let x=v.frustum.far/2,C=H.add(v.positionWC,H.multiplyByScalar(v.directionWC,x,eke),eke);if(y.center=C,y.radius=x,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,!o._outOfView){let A=H.distance(v.positionWC,m.positionWC);o._outOfView=A>=o.maximumDistance}o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere);let w=Math.acos(H.dot(v.directionWC,m.direction));o._angleDiff=w,o._outOfAngle=w>o._maxDiffAngle}}function HGt(o,f){let m=f.camera,v=o._lightCamera,y=o._sceneCamera,x=o._shadowMapCamera;o._cascadesEnabled?H.clone(v.directionWC,x.directionWC):o._isPointLight?H.clone(v.positionWC,x.positionWC):x.clone(v);let C=o._lightDirectionEC;Ee.multiplyByPointAsVector(m.viewMatrix,x.directionWC,C),H.normalize(C,C),H.negate(C,C),Ee.multiplyByPoint(m.viewMatrix,x.positionWC,o._lightPositionEC),o._lightPositionEC.w=o._pointLightRadius;let w,A;o._fitNearFar?(w=Math.min(f.shadowState.nearPlane,o.maximumDistance),A=Math.min(f.shadowState.farPlane,o.maximumDistance+1)):(w=m.frustum.near,A=o.maximumDistance),o._sceneCamera=Vl.clone(m,y),m.frustum.clone(o._sceneCamera.frustum),o._sceneCamera.frustum.near=w,o._sceneCamera.frustum.far=A,o._distance=A-w,zGt(o,f);let E=f.frameNumber;!o._outOfViewPrevious&&o._outOfView&&(o._needsUpdate=!0),!o._outOfAnglePrevious&&o._outOfAngle?(fGt(o._linearSampler,E),o._outOfAnglePrevious=o._outOfAngle):o._outOfAnglePrevious&&!o._outOfAngle?(dGt(o._linearSampler,E),o._outOfAnglePrevious=o._outOfAngle):o._outOfAngle,Z2.getValueExp(o._linearSampler,E),o._outOfViewPrevious=o._outOfView}function UGt(o,f){if(o._outOfView||o._linearSampler[4]<.01||o._isCastTextureDirty===!1||!N(o._castImage))return;let m=f.context,v=o._shadowMapProjectionTexture,y=o._castImage;if(y instanceof HTMLVideoElement){if(y.readyState>=2){if(N(v)){let x=new Date().getTime();v._lastCreateTextureTime===void 0&&(v._lastCreateTextureTime=0);let C=v._lastCreateTextureTime;if(x-C1&&IGt(this,o)),this._isPointLight)this._shadowMapCullingVolume=hg.fromBoundingSphere(this._boundingSphere);else{let f=this._shadowMapCamera,m=f.positionWC,v=f.directionWC,y=f.upWC;this._shadowMapCullingVolume=f.frustum.computeCullingVolume(m,v,y),this._passes.length===1&&this._passes[0].camera.clone(f)}if(this._passes.length===1){let f=this._sceneCamera.inverseViewMatrix;Ee.multiply(this._shadowMapCamera.getViewProjection(),f,this._shadowMapMatrix)}this.debugShow&&AGt(this,o)};$2.prototype.updatePass=function(o,f){gGt(this,o,f)};var GGt=new Ye;function WGt(o,f,m,v){let y=o._isPointLight?o._pointBias:m?o._terrainBias:o._primitiveBias,x={shadowMap_texture:function(){return o._shadowMapTexture},shadowMap_blendTextureArray:function(){let C=[];for(let w=0;w<4;w++)C[w]=v._shadowMapProjectionTextureArr[w]._shadowMapBlendTexture;return C},shadowMap_textureCube:function(){return o._shadowMapTexture},shadowMap_matrix:function(){return o._shadowMapMatrix},shadowMap_cascadeSplits:function(){return o._cascadeSplits},shadowMap_cascadeMatrices:function(){return o._cascadeMatrices},shadowMap_lightDirectionEC:function(){return o._lightDirectionEC},shadowMap_lightPositionEC:function(){return o._lightPositionEC},shadowMap_cascadeDistances:function(){return o._cascadeDistances},shadowMap_projectionTextureArr:function(){let C=[];for(let w=0;w<4;w++)C[w]=v._shadowMapProjectionTextureArr[w]._shadowMapProjectionTexture;return C},shadowMap_lightPositionECArr:function(){return v._lightPositionECArr},shadowMap_opacityArr:function(){return Wt.fromElements(v._opacityArr[0],v._opacityArr[1],v._opacityArr[2],v._opacityArr[3])},shadowMapCount:function(){return Wt.fromElements(v._shadowMapCount,0,0,0)},shadowMap_matrixArr:function(){return v._shadowMapMatrixArr},shadowMap_calibrateParamArr:function(){return v._calibrateParamArr},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let C=GGt;return C.x=1/o._textureSize.x,C.y=1/o._textureSize.y,y.depthBias,Wt.fromElements(C.x,C.y,y.depthBias,y.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Wt.fromElements(y.normalOffsetScale,o._distance,o.maximumDistance,o._darkness,this.combinedUniforms2)},combinedUniforms1:new Wt,combinedUniforms2:new Wt};return va(f,x,!1)}var jGt=function(){let o={};o._shadowMapProjectionTextureArr=new Array(4),o._shadowMapMatrixArr=new Array(4),o._lightPositionECArr=new Array(4),o._lightDirectionECArr=new Array(4),o._calibrateParamArr=new Array(4),o._opacityArr=[1,1,1,1];for(let f=0;f<4;f++)o._shadowMapMatrixArr[f]=new Ee,o._calibrateParamArr[f]=new Ee,o._lightPositionECArr[f]=new Wt,o._lightDirectionECArr[f]=new H;return o};function YGt(o,f,m){let v=!1;for(let y=0;y=0){w=!0;break}w&&(o.push(C),v=!0)}}return o.sort(function(y,x){return y._angleDiff-x._angleDiff}),v}$2.createDerivedCommands=function(o,f,m,v,y,x,C,w){N(w)||(w={});let A=o.length>0,E=m.shaderProgram,T=E.vertexShaderSource,S=E.fragmentShaderSource,M=m.pass===vr.GLOBE,I=!1;if(A&&N(m.receiveTextureProjectionList)&&m.receiveTextureProjectionList.length>0){let P=m.tpp;N(P)||(P=jGt(),m.tpp=P);let D=[];YGt(D,m.receiveTextureProjectionList,o);let L=Math.min(D.length,4);if(L===0)return;P.textureProjectionArray=D,P._shadowMapCount=L;let R,O;N(w.receiveCommand)&&(R=w.receiveCommand.shaderProgram,O=w.receiveCommand.uniformMap);let F=Jn.shallowClone(m,w.receiveCommand);w.castShadows=!1,w.receiveShadows=!0;for(let k=0;k= shadowMap_lightPositionEC.w) { discard; } distance /= shadowMap_lightPositionEC.w; // radius out_FragColor = czm_packDepth(distance); `:m?E+=` out_FragColor = vec4(1.0); `:(E+=` czm_shadow_cast_main(); `,E+=` out_FragColor = czm_packDepth(gl_FragCoord.z); `),E+=`} `,x.push(E),new Zr({defines:y,sources:x})};PB.getReceiveShaderKeyword=function(o,f,m,v){let y=o._usesDepthTexture,x=o._polygonOffsetSupported,C=o._isPointLight,w=o._isSpotLight,A=o._numberOfCascades>1,E=o.debugCascadeColors,T=o.softShadows;return`receivePerspectiveProjectionWithDepth ${y}${x}${C}${w}${A}${E}${T}${f}${m}${v}`};PB.createReceiveVertexShader=function(o,f,m){let v=o.defines.slice(0),y=o.sources.slice(0);return v.push("VIDEO_SHADOW_MAP"),f&&(m?v.push("GENERATE_POSITION_AND_NORMAL"):v.push("GENERATE_POSITION")),new Zr({defines:v,sources:y})};function qGt(o,f){let m="";return o?m+=` if(i == 0){ `:m+=`else if(i == ${f}){ `,m+=` vec2 blendOrigin = blendTextureOriginArr[${f}]; vec2 blendSize = blendTextureSizeArr[${f}]; vec2 videoOrigin = videoTextureOriginArr[${f}]; vec2 videoSize = videoTextureSizeArr[${f}]; vec2 shadowOrigin = shadowTextureOriginArr[${f}]; vec2 shadowSize = shadowTextureSizeArr[${f}]; vec2 videoTextureOrigin = vec2(videoOrigin.x/totalTextureSize.x, videoOrigin.y/totalTextureSize.y); vec2 videoTextureSize = vec2(videoSize.x/totalTextureSize.x, videoSize.y/totalTextureSize.y); vec2 videoTextureUV = vec2((videoTextureOrigin.x + videoTextureSize.x*oldUV.x), (videoTextureOrigin.y+videoTextureSize.y*oldUV.y)); vec2 blendTextureOrigin = vec2(blendOrigin.x/totalTextureSize.z, blendOrigin.y/totalTextureSize.z); vec2 blendTextureSize = vec2(blendSize.x/totalTextureSize.z, blendSize.y/totalTextureSize.z); vec2 blendTextureUV = vec2((blendTextureOrigin.x + blendTextureSize.x*oldUV.x), (blendTextureOrigin.y+blendTextureSize.y*oldUV.y)); vec4 tempColor = texture(mergedBlendTexture, videoTextureUV.xy); if(tempColor.a < 0.14 ) continue; vec2 shadowTextureOrigin = vec2(shadowOrigin.x/totalTextureSize.w, shadowOrigin.y/totalTextureSize.w); vec2 shadowTextureSize = vec2(shadowSize.x/totalTextureSize.w, shadowSize.y/totalTextureSize.w); shadowParameters.texCoords = vec2((shadowTextureOrigin.x + shadowTextureSize.x*oldUV.x), (shadowTextureOrigin.y+shadowTextureSize.y*oldUV.y)); float visibility = czm_shadowVisibility(mergedShadowTexture, shadowParameters); tempColor = texture(mergedVideoTexture, blendTextureUV.xy) * tempColor * visibility; out_FragColor = mix(out_FragColor,tempColor, shadowMap_opacityArr[${f}] * tempColor.a); }`,m}PB.createReceiveFragmentShader=function(o,f,m,v,y,x){let C=Zr.findNormalVarying(o),w=!v&&N(C)||v&&y,A=Zr.findPositionVarying(o),E=N(A),T=f._usesDepthTexture,S=f._polygonOffsetSupported,M=f._isPointLight,I=f._isSpotLight,P=f._numberOfCascades>1,D=f.debugCascadeColors,L=f.softShadows,R=M?f._pointBias:v?f._terrainBias:f._primitiveBias,O=o.defines.slice(0),F=o.sources.slice(0),k=F.length;for(let j=0;j0&&O.push("USE_NORMAL_SHADING_SMOOTH"));let U="";U+=`uniform sampler2D mergedVideoTexture; `,U+=`uniform sampler2D mergedBlendTexture; `,U+=`uniform sampler2D mergedShadowTexture; `,U+=`uniform vec4 totalTextureSize; `,U+=`uniform vec2 blendTextureOriginArr[${x}]; `,U+=`uniform vec2 blendTextureSizeArr[${x}]; `,U+=`uniform vec2 videoTextureOriginArr[${x}]; `,U+=`uniform vec2 videoTextureSizeArr[${x}]; `,U+=`uniform vec2 shadowTextureOriginArr[${x}]; `,U+=`uniform vec2 shadowTextureSizeArr[${x}]; `,U+=`uniform vec4 shadowMap_lightPositionECArr[${x}]; `,U+=`uniform mat4 shadowMap_matrixArr[${x}]; `,U+=`uniform mat4 shadowMap_calibrateParamArr[${x}]; `,U+=`uniform vec4 shadowMapCount; `;let G;E?G=` return vec4(${A}, 1.0); `:G=`#ifndef LOG_DEPTH return czm_windowToEyeCoordinates(gl_FragCoord); #else return vec4(v_logPositionEC, 1.0); #endif `,U+=`uniform mat4 shadowMap_matrix; uniform vec3 shadowMap_lightDirectionEC; uniform vec4 shadowMap_lightPositionEC; uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; uniform float shadowMap_opacityArr[${x}]; #ifdef LOG_DEPTH in vec3 v_logPositionEC; #endif vec4 getPositionEC() { ${G}} vec3 getNormalEC() { ${w?` return normalize(${C}); `:` return vec3(1.0); `}} void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) { ${R.normalOffset&&w?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; float normalOffsetScale = 1.0 - nDotL; vec3 offset = normalOffset * normalOffsetScale * normalEC; positionEC.xyz += offset; `:""}} vec2 cameraDistortion(inout vec2 UV, mat4 calibParam) //imageSize, vec2 focalLength, vec2 opticalCenter, vec4 distortionCoeffs, vec2 tangentCoeffs) { vec2 imageSize = vec2(calibParam[0][0],calibParam[0][1]); vec2 focalLength = vec2(calibParam[0][2],calibParam[0][3]); vec2 opticalCenter = vec2(calibParam[1][0],calibParam[1][1]); vec2 tangentCoeffs = vec2(calibParam[1][2],calibParam[1][3]); vec4 distortionCoeffs = vec4(calibParam[2][0], calibParam[2][1],calibParam[2][2],calibParam[2][3]); vec2 opticalCenterUV = opticalCenter / imageSize; vec2 xy = (UV - opticalCenterUV ) * imageSize / focalLength; float x2 = xy.x * xy.x; float y2 = xy.y * xy.y; float r2 = x2 + y2; float _2xy = 2.0 * xy.x * xy.y; highp float kr = (1.0 + ((distortionCoeffs.z*r2 + distortionCoeffs.y)*r2 + distortionCoeffs.x)*r2); highp float dx = (xy.x*kr + tangentCoeffs.x*_2xy + tangentCoeffs.y*(r2 + 2.0*x2)); highp float dy = (xy.y*kr + tangentCoeffs.x*(r2 + 2.0*y2) + tangentCoeffs.y*_2xy); UV = vec2(dx,dy) * focalLength / imageSize + opticalCenterUV; return UV; } `,U+=`void main() { vec4 diffuseColor = out_FragColor; czm_shadow_receive_main(); vec4 positionEC = getPositionEC(); vec3 normalEC = getNormalEC(); float depth = -positionEC.z; `,U+=` czm_shadowParameters shadowParameters; shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; `,I&&(U+=` for(int i = 0; i < ${x}; i++){ if(i < int(shadowMapCount.x)){ `),U+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionECArr[i].xyz); float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); vec4 shadowPosition = shadowMap_matrixArr[i] * positionEC; shadowPosition /= shadowPosition.w; shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; // Spot light uses a perspective projection, so perform the perspective divide vec2 oldUV = shadowPosition.xy; if(shadowMap_calibrateParamArr[i][0].y > 0.0){ shadowPosition.xy = cameraDistortion(shadowPosition.xy, shadowMap_calibrateParamArr[i] ); //imageSize, focalLength, opticalCenter, distortionCoefficients, tangentCoeffs); } // Stop early if the fragment is not in the shadow bounds if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { continue; } `;for(let j=0;j=f?f:Bo.maximumCubeMapSize,y.x=f,y.y=f;let x=new Xr(0,0,f,f);m[0].passState.viewport=x,m[1].passState.viewport=x,m[2].passState.viewport=x,m[3].passState.viewport=x,m[4].passState.viewport=x,m[5].passState.viewport=x}else v===1?(f=Bo.maximumTextureSize>=f?f:Bo.maximumTextureSize,y.x=f,y.y=f,m[0].passState.viewport=new Xr(0,0,f,f)):v===4&&(f=Bo.maximumTextureSize>=f*2?f:Bo.maximumTextureSize/2,y.x=f*2,y.y=f*2,m[0].passState.viewport=new Xr(0,0,f,f),m[1].passState.viewport=new Xr(f,0,f,f),m[2].passState.viewport=new Xr(0,f,f,f),m[3].passState.viewport=new Xr(f,f,f,f));o._clearPassState.viewport=new Xr(0,0,y.x,y.y);for(let x=0;x=o.maximumDistance){o._outOfView=!0,o._needsUpdate=!1;return}let x=f.mapProjection.ellipsoid.geodeticSurfaceNormal(m.positionWC,w9t),C=H.negate(v.directionWC,A9t),w=H.dot(x,C),A=xe.clamp(w/.1,0,1);if(o._darkness=0,w<0){o._outOfView=!0,o._needsUpdate=!1;return}o._needsUpdate=!0,o._outOfView=!1}else if(o._isPointLight){if(y.center=v.positionWC,y.radius=o._pointLightRadius,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,!o._outOfView){let x=H.distance(v.positionWC,m.positionWC);o._outOfView=x>=o.maximumDistance}o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere)}else{let x=v.frustum.far/2,C=H.add(v.positionWC,H.multiplyByScalar(v.directionWC,x,rke),rke);if(y.center=C,y.radius=x,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,!o._outOfView){let A=H.distance(v.positionWC,m.positionWC);o._outOfView=A>=o.maximumDistance}o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere);let w=Math.acos(H.dot(v.directionWC,m.direction));o._angleDiff=w,o._outOfAngle=w>o._maxDiffAngle}}function T9t(o,f){let m=f.camera,v=o._lightCamera,y=o._sceneCamera,x=o._shadowMapCamera;o._cascadesEnabled?H.clone(v.directionWC,x.directionWC):o._isPointLight?H.clone(v.positionWC,x.positionWC):x.clone(v);let C=o._lightDirectionEC;Ee.multiplyByPointAsVector(m.viewMatrix,x.directionWC,C),H.normalize(C,C),H.negate(C,C),Ee.multiplyByPoint(m.viewMatrix,x.positionWC,o._lightPositionEC),o._lightPositionEC.w=o._pointLightRadius;let w,A;o._fitNearFar?(w=Math.min(f.shadowState.nearPlane,o.maximumDistance),A=Math.min(f.shadowState.farPlane,o.maximumDistance+1)):(w=m.frustum.near,A=o.maximumDistance),o._sceneCamera=Vl.clone(m,y),m.frustum.clone(o._sceneCamera.frustum),o._sceneCamera.frustum.near=w,o._sceneCamera.frustum.far=A,o._distance=A-w,E9t(o,f);let E=f.frameNumber;!o._outOfViewPrevious&&o._outOfView&&(o._needsUpdate=!0),!o._outOfAnglePrevious&&o._outOfAngle?(JGt(o._linearSampler,E),o._outOfAnglePrevious=o._outOfAngle):o._outOfAnglePrevious&&!o._outOfAngle?(XGt(o._linearSampler,E),o._outOfAnglePrevious=o._outOfAngle):o._outOfAngle,Z2.getValueExp(o._linearSampler,E),o._outOfViewPrevious=o._outOfView}function S9t(o){let f=o._passes;if(f.length>0&&N(Vz)){let m=f[0].framebuffer;m._bind(),Vz.copyFromFramebuffer(o._shadowMapTextureOrigin.x,o._shadowMapTextureOrigin.y,0,0,o._shadowMapTextureSize.x,o._shadowMapTextureSize.y),m._unBind()}}function P9t(o){if(o._outOfView||o._linearSampler[4]<.01||!o._isCastTextureDirty||!N(o._castImage)||!e5)return;o._blendCanvasDirty&&(Z7.copyFrom({source:o._blendCanvas,xOffset:o._blendTextureOrigin.x,yOffset:o._blendTextureOrigin.y}),o._blendCanvasDirty=!1);let f=new Date().getTime();N(o._lastCreateTextureTime)||(o._lastCreateTextureTime=0);let m=f-o._lastCreateTextureTime,v=o._castImage;v instanceof HTMLVideoElement&&v.readyState>=2&&m>o._videoFrameInterval&&(e5.copyFrom({source:v,xOffset:o._videoTextureOrigin.x,yOffset:o._videoTextureOrigin.y}),o._lastCreateTextureTime=new Date().getTime())}tP.prototype.update=function(o){if(T9t(this,o),this._needsUpdate)if(t9t(this,o.context),this._isPointLight&&b9t(this,o),this._cascadesEnabled&&(v9t(this,o),this._numberOfCascades>1&&p9t(this,o)),this._isPointLight)this._shadowMapCullingVolume=hg.fromBoundingSphere(this._boundingSphere);else{let f=this._shadowMapCamera,m=f.positionWC,v=f.directionWC,y=f.upWC;this._shadowMapCullingVolume=f.frustum.computeCullingVolume(m,v,y),this._passes.length===1&&this._passes[0].camera.clone(f)}if(this._passes.length===1){let f=this._sceneCamera.inverseViewMatrix;Ee.multiply(this._shadowMapCamera.getViewProjection(),f,this._shadowMapMatrix)}this.debugShow&&u9t(this,o)};tP.prototype.updatePass=function(o,f){WXe(this,o,f)};var I9t=new Ye;function XXe(o,f,m,v,y){let x=o._isPointLight?o._pointBias:m?o._terrainBias:o._primitiveBias,C={blendTextureOriginArr:function(){let w=[];for(let A=0;A=0){A=!0;break}A&&(o.push(w),v=!0)}}}return o.sort(function(y,x){return y._angleDiff-x._angleDiff}),v}function R9t(o,f,m){let v=f,y=m;if(tkew)throw new li("\u540C\u5C4F\u663E\u793A\u89C6\u9891\u6570\u91CF\u8D85\u8FC7\u673A\u5668\u627F\u8F7D\u4E0A\u9650\uFF0C\u8BF7\u8C03\u5C0F scene.maxProjectionCount \u7684\u503C");let A=Math.ceil(Math.sqrt(v)),E=Math.min(A,x,C);DV=new Map;for(let M=0;M=y)break;for(let P=0;P=y);P++){let D=f[I+P];N(D._castImage)&&(D._videoTextureOrigin.x=P*UI,D._videoTextureOrigin.y=M*GI,D._videoTextureSize.x=D._castImage.videoWidth,D._videoTextureSize.y=D._castImage.videoHeight,DV.set(D._id,{videoRowIdx:M,videoColIdx:P}))}}let T=E*E,S=E;if(T=y)break;for(let P=0;P=y);P++){let D=f[I+P];N(D._castImage)&&(D._videoTextureOrigin.x=P*UI,D._videoTextureOrigin.y=M*GI,D._videoTextureSize.x=D._castImage.videoWidth,D._videoTextureSize.y=D._castImage.videoHeight,DV.set(D._id,{videoRowIdx:M,videoColIdx:P}))}S++}Y$=E*UI,q$=S*GI,e5&&e5.destroy(),e5=new _o({context:o,width:Y$,height:q$}),x7=A*256;for(let M=0;M=y);M++)for(let I=0;I=y);I++){let P=f[M*A+I];P._blendTextureOrigin.x=I*256,P._blendTextureOrigin.y=M*256,P._blendTextureSize.x=P._blendCanvas.width,P._blendTextureSize.y=P._blendCanvas.height,P._blendCanvasDirty=!0,P._shadowMapTextureOrigin.x=I*P.size,P._shadowMapTextureOrigin.y=M*P.size,P._shadowMapTextureSize.x=P.size,P._shadowMapTextureSize.y=P.size;let D=DV.get(P._id);D.blendRowIdx=M,D.blendColIdx=I,D.shadowRowIdx=M,D.shadowColIdx=I}Z7&&Z7.destroy(),Z7=new _o({context:o,width:x7,height:x7}),C7=A*1024,Vz&&Vz.destroy(),Vz=new _o({context:o,width:C7,height:C7,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,sampler:gs.NEAREST})}else{let x=new Map,C=Y$/UI,w=q$/GI,A=x7/256,E=C7/1024,T=new Array(C*w),S=new Array(A*A),M=new Array(E*E),I=[];for(let D=0;D0){for(let D=0;D0,T=v.shaderProgram,S=T.vertexShaderSource,M=T.fragmentShaderSource,I=v.pass===vr.GLOBE,P=!1;if(v.castShadows){let D=A.castCommands;N(D)||(D=A.castCommands=[]);let L=A.castShaderProgramId,R=o.length;D.length=R;for(let O=0;O0)L9t(D,v.receiveTextureProjectionList,o);else for(let q in o){if(!o.hasOwnProperty(q))continue;let J=o[q];J._type==="perspective"&&!J._outOfView&&D.push(J)}let L=Math.min(o.length,w),R=v.tppd;N(R)||(R=D9t(w),v.tppd=R),D.length>L&&D.splice(L);let O=D.length;if(O===0)return;let F=R9t(o,UI,GI),k=F.maxWidth!==UI||F.maxHeight!==GI;k&&(GI=F.maxHeight,UI=F.maxWidth),O9t(x,D,k,w),R.textureProjectionArray=D,R._shadowMapCount=O;let U,G;N(A.receiveCommand)&&(U=A.receiveCommand.shaderProgram,G=A.receiveCommand.uniformMap);let j=Jn.shallowClone(v,A.receiveCommand);A.castShadows=!1,A.receiveShadows=!0;for(let q=0;q=QXe.RENDERED_AND_KICKED},originalResult:function(o){return o&3},kick:function(o){return o|4}},ba=QXe;function Fy(o){this._tilingScheme=o.tilingScheme,this._x=o.x,this._y=o.y,this._level=o.level,this._parent=o.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=ba.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this.state=Ch.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0,this.datazh=void 0}Fy.createLevelZeroTiles=function(o){let f=o.getNumberOfXTilesAtLevel(0),m=o.getNumberOfYTilesAtLevel(0),v=new Array(f*m),y=0;for(let x=0;x=v&&(f-=v),!(m<0||m>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return o.filter(function(y){return y.x===f&&y.y===m})[0]};Fy.prototype.findTileToWest=function(o){let f=this.parent;if(f===void 0)return this.findLevelZeroTile(o,this.x-1,this.y);if(f.southeastChild===this)return f.southwestChild;if(f.northeastChild===this)return f.northwestChild;let m=f.findTileToWest(o);if(m!==void 0)return f.southwestChild===this?m.southeastChild:m.northeastChild};Fy.prototype.findTileToEast=function(o){let f=this.parent;if(f===void 0)return this.findLevelZeroTile(o,this.x+1,this.y);if(f.southwestChild===this)return f.southeastChild;if(f.northwestChild===this)return f.northeastChild;let m=f.findTileToEast(o);if(m!==void 0)return f.southeastChild===this?m.southwestChild:m.northwestChild};Fy.prototype.findTileToSouth=function(o){let f=this.parent;if(f===void 0)return this.findLevelZeroTile(o,this.x,this.y+1);if(f.northwestChild===this)return f.southwestChild;if(f.northeastChild===this)return f.southeastChild;let m=f.findTileToSouth(o);if(m!==void 0)return f.southwestChild===this?m.northwestChild:m.northeastChild};Fy.prototype.findTileToNorth=function(o){let f=this.parent;if(f===void 0)return this.findLevelZeroTile(o,this.x,this.y-1);if(f.southwestChild===this)return f.northwestChild;if(f.southeastChild===this)return f.northeastChild;let m=f.findTileToNorth(o);if(m!==void 0)return f.northwestChild===this?m.southwestChild:m.southeastChild};Fy.prototype.freeResources=function(){this.state=Ch.START,this.renderable=!1,this.upsampledFromParent=!1,N(this.data)&&N(this.data.freeResources)&&this.data.freeResources(),N(this.data)&&N(this.data.geometryPrimitive)&&(this.data.geometryPrimitive.destroy(),this.data.geometryPrimitive=void 0),KQ(this._southwestChild),this._southwestChild=void 0,KQ(this._southeastChild),this._southeastChild=void 0,KQ(this._northwestChild),this._northwestChild=void 0,KQ(this._northeastChild),this._northeastChild=void 0};function KQ(o){N(o)&&o.freeResources()}var kY=Fy;function Jre(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}Jre.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};Jre.prototype.trimTiles=function(o){let f=this.tail,m=!0;for(;m&&N(this._lastBeforeStartOfFrame)&&this.count>o&&N(f);){m=f!==this._lastBeforeStartOfFrame;let v=f.replacementPrevious;f.eligibleForUnloading&&(f.freeResources(),ZXe(this,f)),f=v}};function ZXe(o,f){let m=f.replacementPrevious,v=f.replacementNext;f===o._lastBeforeStartOfFrame&&(o._lastBeforeStartOfFrame=v),f===o.head?o.head=v:m.replacementNext=v,f===o.tail?o.tail=m:v.replacementPrevious=m,f.replacementPrevious=void 0,f.replacementNext=void 0,--o.count}Jre.prototype.markTileRendered=function(o){let f=this.head;if(f===o){o===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=o.replacementNext);return}if(++this.count,!N(f)){o.replacementPrevious=void 0,o.replacementNext=void 0,this.head=o,this.tail=o;return}(N(o.replacementPrevious)||N(o.replacementNext))&&ZXe(this,o),o.replacementPrevious=void 0,o.replacementNext=f,f.replacementPrevious=o,this.head=o};var Kre=Jre;function eA(o){this._tileProvider=o.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let f=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new Kre,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=Z(o.maximumScreenSpaceError,2),this.tileCacheSize=Z(o.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new Xre({ellipsoid:f}),this._tileLoadProgressEvent=new Br,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(eA.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});eA.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function z9t(o){let f=o._tileReplacementQueue;f.head=void 0,f.tail=void 0,f.count=0,$Xe(o);let m=o._levelZeroTiles;if(N(m))for(let v=0;v0)try{m.updateForPick(o)}catch(v){console.error(v)}};function H9t(o,f){let m=o._tileLoadQueueHigh.length+o._tileLoadQueueMedium.length+o._tileLoadQueueLow.length;(m!==o._lastTileLoadQueueLength||o._tilesInvalidated)&&(f.afterRender.push(Br.prototype.raiseEvent.bind(o._tileLoadProgressEvent,m)),o._lastTileLoadQueueLength=m);let v=o._debug;v.enableDebugOutput&&!v.suspendLodUpdate&&(v.maxDepth=o._tilesToRender.reduce(function(y,x){return Math.max(y,x.level)},-1),v.tilesRendered=o._tilesToRender.length,(v.tilesVisited!==v.lastTilesVisited||v.tilesRendered!==v.lastTilesRendered||v.tilesCulled!==v.lastTilesCulled||v.maxDepth!==v.lastMaxDepth||v.tilesWaitingForChildren!==v.lastTilesWaitingForChildren||v.maxDepthVisited!==v.lastMaxDepthVisited)&&(console.log(`Visited ${v.tilesVisited}, Rendered: ${v.tilesRendered}, Culled: ${v.tilesCulled}, Max Depth Rendered: ${v.maxDepth}, Max Depth Visited: ${v.maxDepthVisited}, Waiting for children: ${v.tilesWaitingForChildren}`),v.lastTilesVisited=v.tilesVisited,v.lastTilesRendered=v.tilesRendered,v.lastTilesCulled=v.tilesCulled,v.lastMaxDepth=v.maxDepth,v.lastTilesWaitingForChildren=v.tilesWaitingForChildren,v.lastMaxDepthVisited=v.maxDepthVisited))}eA.prototype.endFrame=function(o){!o.passes.render||o.mode===_i.MORPHING||(K9t(this,o),$9t(this,o),H9t(this,o))};var b7,ake=new Mt;function U9t(o,f){let m=Di.center(o.rectangle,ake),v=m.longitude-b7.longitude,y=m.latitude-b7.latitude;m=Di.center(f.rectangle,ake);let x=m.longitude-b7.longitude,C=m.latitude-b7.latitude;return v*v+y*y-(x*x+C*C)}var G9t=new H,R9=[];function W9t(o,f){let m=o._debug;if(m.suspendLodUpdate)return;let v=o._tilesToRender;v.length=0;let y,x=o._tileProvider;if(!N(o._levelZeroTiles))if(x.ready){let D=x.tilingScheme;o._levelZeroTiles=kY.createLevelZeroTiles(D);let L=o._levelZeroTiles.length;if(R9.length1?o._occluders:void 0;b7=f.camera.positionCartographic,w.sort(U9t);let E=o._addHeightCallbacks,T=o._removeHeightCallbacks,S=f.frameNumber,M;if(E.length>0||T.length>0){for(y=0,M=w.length;yx.maxDepthVisited&&(x.maxDepthVisited=m.level);let C=X9t(o,f,m)o.loadingDescendantLimit&&(o._tileLoadQueueLow.length=D,o._tileLoadQueueMedium.length=L,o._tileLoadQueueHigh.length=R,WI(o,o._tileLoadQueueMedium,m,f),y.notYetRenderableCount=m.renderable?0:1,G=!0),y.allAreRenderable=m.renderable,y.anyWereRenderedLastFrame=q,q||o._tileToUpdateHeights.push(m),++x.tilesWaitingForChildren}o.preloadAncestors&&!G&&WI(o,o._tileLoadQueueLow,m,f)}return}m._lastSelectionResultFrame=f.frameNumber,m._lastSelectionResult=ba.RENDERED,QQ(o,m),WI(o,o._tileLoadQueueHigh,m,f),y.allAreRenderable=m.renderable,y.anyWereRenderedLastFrame=M===ba.RENDERED,y.notYetRenderableCount=m.renderable?0:1}function Y9t(o,f,m,v,y,x,C,w){let A=x.camera.positionCartographic,E=o._tileProvider,T=o._occluders,S=ege[f.level],M=S.southwest,I=S.southeast,P=S.northwest,D=S.northeast;A.longitude0;){let S=v[0];if(!N(S.data)||!N(S.data.mesh)){let D=S._lastSelectionResultFrame===o._lastSelectionFrameNumber?S._lastSelectionResult:ba.NONE;(D===ba.RENDERED||D===ba.CULLED_BUT_NEEDED)&&m.push(S),v.shift(),o._lastTileIndex=0;continue}let M=S.customData,I=M.length,P=!1;for(T=o._lastTileIndex;TD.level&&!R){if(N(D.positionOnEllipsoidSurface)||(D.positionOnEllipsoidSurface=H.fromRadians(D.positionCartographic.longitude,D.positionCartographic.latitude,0,E)),w===_i.SCENE3D){let F=E.geodeticSurfaceNormal(D.positionOnEllipsoidSurface,LV.direction),k=E.getSurfaceNormalIntersectionWithZAxis(D.positionOnEllipsoidSurface,11500,LV.origin);if(!N(k)){let U;N(S.data.tileBoundingRegion)&&(U=S.data.tileBoundingRegion.minimumHeight);let G=Math.min(Z(U,0),-11500),j=H.multiplyByScalar(F,Math.abs(G)+1,nR);H.subtract(D.positionOnEllipsoidSurface,j,LV.origin)}}else Mt.clone(D.positionCartographic,Vde),Vde.height=-11500,A.project(Vde,nR),H.fromElements(nR.z,nR.x,nR.y,nR),H.clone(nR,LV.origin),H.clone(H.UNIT_X,LV.direction);let O=S.data.pick(LV,w,A,!1,nR);N(O)&&(D.callback(O),D.level=S.level)}if($c()>=C){P=!0;break}}if(P){o._lastTileIndex=T;break}else o._lastTileIndex=0,v.shift()}for(T=0;T"),ie.contentDocument.write(re),ie.contentDocument.close()})};var F=function(j,q,J,X,Y){var Q,ee,z,ie,re,ne,oe,se,ae,fe,de,ve=Math.max(j.scrollWidth,j.clientWidth),pe=Math.max(j.scrollHeight,j.clientHeight);return q?(Q=(ne=function(ce,he){var Ce=ce.querySelector(he);if(Ce)return Ce;if(ce.ownerDocument.querySelector(he)===ce)return ce;throw{message:"Clipping selector not found"}}(j,q).getBoundingClientRect()).top,ee=ne.left,z=ne.width,ie=ne.height):(ee=Q=0,z=ve,ie=pe),se={width:z,height:ie},ae=J,fe=X,de=Y,oe={width:Math.max(se.width*de,ae),height:Math.max(se.height*de,fe)},re=R.getComputedStyle(j.ownerDocument.documentElement).fontSize,{left:ee,top:Q,width:oe.width,height:oe.height,viewportWidth:ve,viewportHeight:pe,rootFontSize:re}};O.calculateDocumentContentSize=function(j,q){return new Promise(function(J,X){var Y,Q,ee,z,ie,re,ne,oe,se,ae,fe,de,ve=q.zoom||1;Q=q.width,ee=q.height,z=ve,se=Math.floor(Q/z),ae=Math.floor(ee/z),ie=R.document,re=se,ne=ae,(oe=ie.createElement("iframe")).style.width=re+"px",oe.style.height=ne+"px",oe.style.visibility="hidden",oe.style.position="absolute",oe.style.top=-1e4-ne+"px",oe.style.left=-1e4-re+"px",oe.style.borderWidth=0,oe.sandbox="allow-same-origin",oe.scrolling="no",Y=oe,R.document.getElementsByTagName("body")[0].appendChild(Y),Y.onload=function(){var pe,ce,he,Ce=Y.contentDocument;try{pe=F((ce=Ce,he=j.tagName,ce.querySelector(he)),q.clip,q.width,q.height,ve),J(pe)}catch(Se){X(Se)}finally{R.document.getElementsByTagName("body")[0].removeChild(Y)}},Y.contentDocument.open(),Y.contentDocument.write(""),Y.contentDocument.write((de=(fe=j).tagName.toLowerCase())==="html"||de==="body"?fe.outerHTML:''+fe.outerHTML+""),Y.contentDocument.close()})},O.parseHtmlFragment=function(j){var q=R.document.implementation.createHTMLDocument("");q.documentElement.innerHTML=j;var J=q.querySelector("body").firstChild;if(!J)throw"Invalid source";return J},O.parseHTML=function(j){var q=R.document.implementation.createHTMLDocument("");return q.documentElement.innerHTML=j,function(J,X){var Y,Q,ee,z,ie=/]*)?)>/im.exec(X),re=R.document.implementation.createHTMLDocument("");if(ie)for(Y="",re.documentElement.innerHTML=Y,ee=re.querySelector("div"),Q=0;Q"],{type:"text/xml"}),!0}catch{}return!1})()&&P.URL?(J=R(F,!0),k(J).then(function(X){return O(J),!X&&k(R(F,!1)).then(function(Y){return Y})},function(){return!1})).then(function(X){j(!X)},function(){q()}):j(!1)})},G=function(j){return(D===void 0&&(D=U()),D).then(function(q){return R(j,q)})};return L.renderSvg=function(j){return new Promise(function(q,J){var X,Y,Q=function(){X&&O(X)};(Y=new Image).onload=function(){Y.onload=null,Y.onerror=null,Q(),q(Y)},Y.onerror=function(){Q(),J()},G(j).then(function(ee){X=ee,Y.src=X},J)})},L}(window);return function(P,D,L){"use strict";var R={};R.drawDocument=function(){var F,k,U,G,j,q,J,X=arguments[0],Y=Array.prototype.slice.call(arguments,1),Q=P.parseOptionalParameters(Y),ee=X.documentElement?X.documentElement:X;return L.rasterize(ee,Q.canvas,(U=(F=Q).canvas,G=F.options,j=U?U.width:300,q=U?U.height:200,J={width:G.width!==void 0?G.width:j,height:G.height!==void 0?G.height:q},(k=P.clone(F.options)).width=J.width,k.height=J.height,k))},R.drawHTML=function(){var F,k,U,G,j=arguments[0],q=Array.prototype.slice.call(arguments,1),J=P.parseOptionalParameters(q);return F=j,k=J.canvas,U=J.options,G=D.parseHTML(F),R.drawDocument(G,k,U)};var O=function(F,k,U){return D.loadDocument(F,U).then(function(G){var j=function(q,J,X){var Y=document.implementation.createHTMLDocument("");Y.replaceChild(q.documentElement,Y.documentElement);var Q=X?P.clone(X):{};return X.baseUrl||(Q.baseUrl=J),{document:Y,options:Q}}(G,F,U);return R.drawDocument(j.document,k,j.options)})};return R.drawURL=function(){var F=arguments[0],k=Array.prototype.slice.call(arguments,1),U=P.parseOptionalParameters(k);return O(F,U.canvas,U.options)},R}(E,M,function(P,D,L,R,O,F){"use strict";var k={},U=function(q){return{message:"Error rendering page",originalError:q}},G=function(q){return O.renderSvg(q).then(function(J){return{image:J,svg:q}},function(J){throw U(J)})},j=function(q,J,X){return R.drawDocumentAsSvg(q,X).then(G).then(function(Y){return J&&function(Q,ee){try{ee.getContext("2d").drawImage(Q,0,0)}catch(z){throw U(z)}}(Y.image,J),Y})};return k.rasterize=function(q,J,X){var Y;return(Y=P.clone(X)).inlineScripts=X.executeJs===!0,F.inlineReferences(q,Y).then(function(Q){return X.executeJs?(ee=q,z=X,D.executeJavascript(ee,z).then(function(ie){var re=ie.document;return L.persistInputValues(re),{document:re,errors:ie.errors}})).then(function(ie){return{element:ie.document.documentElement,errors:Q.concat(ie.errors)}}):{element:q,errors:Q};var ee,z}).then(function(Q){return j(Q.element,J,X).then(function(ee){return{image:ee.image,svg:ee.svg,errors:Q.errors}})})},k}(E,M,S,function(P,D,L,R){"use strict";var O={},F=function(U){var G=Object.keys(U);return G.length?" "+G.map(function(j){return j+'="'+U[j]+'"'}).join(" "):""},k=function(U,G,j){var q=R.serializeToString(U);D.validateXHTML(q);var J,X,Y,Q,ee,z,ie,re,ne=(J=G,X=Math.round(J.viewportWidth),Y=Math.round(J.viewportHeight),{x:-J.left,y:-J.top,width:X,height:Y});return ee=(Q=ne).style||"",Q.style=ee+"float: left;",ne.externalResourcesRequired=!0,'"+q+""};return O.getSvgForDocument=function(U,G,j){return L.rewriteTagNameSelectorsToLowerCase(U),k(U,G,j)},O.drawDocumentAsSvg=function(U,G){return["hover","active","focus","target"].forEach(function(j){G[j]&&L.fakeUserAction(U,G[j],j)}),D.calculateDocumentContentSize(U,G).then(function(j){return O.getSvgForDocument(U,j,G.zoom)})},O}(0,M,S,C),I,A))},(v=this)===void 0&&window!==void 0&&(v=window),typeof f=="object"&&f.exports?f.exports=y(o("url"),o("xmlserializer"),o("sane-domparser-error"),o("inlineresources")):v.rasterizeHTML=y(v.url,v.xmlserializer,v.sanedomparsererror,v.inlineresources)},{inlineresources:5,"sane-domparser-error":14,url:15,xmlserializer:17}],2:[function(o,f,m){(function(v){(function(y){typeof m=="object"&&f!==void 0?f.exports=y():(typeof window<"u"?window:v!==void 0?v:typeof self<"u"?self:this).cssFontFaceSrc=y()})(function(){return function y(x,C,w){function A(S,M){if(!C[S]){if(!x[S]){var I=typeof o=="function"&&o;if(!M&&I)return I(S,!0);if(E)return E(S,!0);var P=new Error("Cannot find module '"+S+"'");throw P.code="MODULE_NOT_FOUND",P}var D=C[S]={exports:{}};x[S][0].call(D.exports,function(L){var R=x[S][1][L];return A(R||L)},D,D.exports,y,x,C,w)}return C[S].exports}for(var E=typeof o=="function"&&o,T=0;T= 0x80 (not a basic code point)","invalid-input":"Invalid input"},j=S-M,q=Math.floor,J=String.fromCharCode;function X(se){throw RangeError(G[se])}function Y(se,ae){for(var fe=se.length,de=[];fe--;)de[fe]=ae(se[fe]);return de}function Q(se,ae){var fe=se.split("@"),de="";return 1>>10&1023|55296),ae=56320|1023&ae),fe+=J(ae)}).join("")}function ie(se,ae){return se+22+75*(se<26)-((ae!=0)<<5)}function re(se,ae,fe){var de=0;for(se=fe?q(se/D):se>>1,se+=q(se/ae);j*I>>1q((T-it)/ce))&&X("overflow"),it+=Ce*ce,!(Ce<(Se=he<=at?M:at+I<=he?I:he-at));he+=S)ce>q(T/(De=S-Se))&&X("overflow"),ce*=De;at=re(it-pe,ae=Ue.length+1,pe==0),q(it/ae)>T-ut&&X("overflow"),ut+=q(it/ae),it%=ae,Ue.splice(it++,0,ut)}return z(Ue)}function oe(se){var ae,fe,de,ve,pe,ce,he,Ce,Se,De,Oe,Ue,Xe,it,ut,at=[];for(Ue=(se=ee(se)).length,ae=R,pe=L,ce=fe=0;ceq((T-fe)/(Xe=de+1))&&X("overflow"),fe+=(he-ae)*Xe,ae=he,ce=0;ceT&&X("overflow"),Oe==ae){for(Ce=fe,Se=S;!(Ce<(De=Se<=pe?M:pe+I<=Se?I:Se-pe));Se+=S)ut=Ce-De,it=S-De,at.push(J(ie(De+ut%it,0))),Ce=q(ut/it);at.push(J(ie(Ce,0))),pe=re(fe,Xe,de==ve),fe=0,++de}++fe,++ae}return at.join("")}if(A={version:"1.3.2",ucs2:{decode:ee,encode:z},decode:ne,encode:oe,toASCII:function(se){return Q(se,function(ae){return k.test(ae)?"xn--"+oe(ae):ae})},toUnicode:function(se){return Q(se,function(ae){return F.test(ae)?ne(ae.slice(4).toLowerCase()):ae})}},x&&C)if(f.exports==x)C.exports=A;else for(E in A)A.hasOwnProperty(E)&&(x[E]=A[E]);else y.punycode=A})(this)}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],11:[function(o,f,m){"use strict";f.exports=function(y,x,C,w){x=x||"&",C=C||"=";var A={};if(typeof y!="string"||y.length===0)return A;var E=/\+/g;y=y.split(x);var T=1e3;w&&typeof w.maxKeys=="number"&&(T=w.maxKeys);var S,M,I=y.length;0]*>This page contains the following errors:]*>(.+?) ?`),new RegExp(`^(.+) `)],y=function(x){var C,w,A,E,T=(C=x,w=new XMLSerializer,Array.prototype.map.call(C.childNodes,function(S){return w.serializeToString(S)}).join(""));for(A=0;A",'"',"`"," ","\r",` `," "]),T=["'"].concat(E),S=["%","/","?",";","#"].concat(T),M=["/","?","#"],I=/^[+a-z0-9A-Z_-]{0,63}$/,P=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,D={javascript:!0,"javascript:":!0},L={javascript:!0,"javascript:":!0},R={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},O=o("querystring");function F(k,U,G){if(k&&y.isObject(k)&&k instanceof x)return k;var j=new x;return j.parse(k,U,G),j}x.prototype.parse=function(k,U,G){if(!y.isString(k))throw new TypeError("Parameter 'url' must be a string, not "+typeof k);var j=k.indexOf("?"),q=j!==-1&&j/g,">").replace(/"/g,""").replace(/'/g,"'")+'"')}),0",I+=C(E),I+=""):I+="/>",I},A=function(E,T){var S,M=T&&T.rootNode;return E.nodeName==="#document"||E.nodeName==="#document-fragment"?C(E):E.tagName?w(E,M):E.nodeName==="#text"?((S=E).nodeValue||S.value||"").replace(/&/g,"&").replace(//g,">"):E.nodeName==="#comment"?"":E.nodeName==="#cdata-section"?"":void 0};return{serializeToString:function(E){return A(E,{rootNode:!0}).replace(/[\x00-\x08\x0B\x0C\x0E-\x1F]/g,"")}}},typeof f=="object"&&f.exports?f.exports=y():v.xmlserializer=y()},{}]},{},[1])(1)});var f1e=iJe.rasterizeHTML,VU=f1e,t7t=Re.WHITE,i7t=Re.BLACK,r7t=1;function TH(o){o=Z(o,Z.EMPTY_OBJECT),this._definitionChanged=new Br,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=o.color,this.outlineColor=o.outlineColor,this.outlineWidth=o.outlineWidth}Object.defineProperties(TH.prototype,{isConstant:{get:function(){return vt.isConstant(this._color)&&vt.isConstant(this._outlineColor)&&vt.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:Oi("color"),outlineColor:Oi("outlineColor"),outlineWidth:Oi("outlineWidth")});TH.prototype.getType=function(o){return"PolylineOutline"};TH.prototype.getValue=function(o,f){return N(f)||(f={}),f.color=vt.getValueOrClonedDefault(this._color,o,t7t,f.color),f.outlineColor=vt.getValueOrClonedDefault(this._outlineColor,o,i7t,f.outlineColor),f.outlineWidth=vt.getValueOrDefault(this._outlineWidth,o,r7t),f};TH.prototype.equals=function(o){return this===o||o instanceof TH&&vt.equals(this._color,o._color)&&vt.equals(this._outlineColor,o._outlineColor)&&vt.equals(this._outlineWidth,o._outlineWidth)};var SM=TH,n7t=function(){function o(f,m){this.options={position:m.position,label:{text:m.labelText,font:"12pt monospace",style:of.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:so.BOTTOM,pixelOffset:new Ye(0,-9),disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=m.positions,this.earthCtrl=f,this._init()}return o.prototype._init=function(){this.entity=this.earthCtrl.entities.add(this.options)},o.prototype.destory=function(){N(this.entity)&&this.earthCtrl.entities.remove(this.entity)},Object.defineProperties(o.prototype,{text:{get:function(){return this.entity.label.text},set:function(f){this.entity.label.text=f}},position:{get:function(){return this.entity.position},set:function(f){this.entity.position=f}}}),o}(),o7t=function(){function o(f,m){this.primitive=new _B;for(let v in m.positions)m.positions.hasOwnProperty(v)&&this.primitive.add({show:!0,position:v,color:m.color,pixelSize:m.pixelSize,allowPicking:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY,outlineColor:Z(m.outlineColor,Re.WHITE),outlineWidth:Z(m.outlineWidth,2)});this.earthCtrl=f,this.options=m,this._init()}return o.prototype._init=function(){this.earthCtrl.coreMap.scene.primitives.add(this.primitive)},o.prototype.destory=function(){this.earthCtrl.coreMap.scene.primitives.remove(this.primitive)},o.prototype.add=function(f){this.primitive.add({show:!0,position:f,color:this.options.color,pixelSize:this.options.pixelSize,disableDepthTestDistance:Number.POSITIVE_INFINITY})},o.prototype.count=function(f){return this.primitive.length},o.prototype.get=function(f){return this.primitive.get(f)},o.prototype.set=function(f,m){this.primitive.get(f).position=m},o}(),a7t=function(){function o(f,m){this.options={polyline:{positions:[],arcType:fs.NONE,material:m.color,width:m.width}},this.positions=m.positions,this.earthCtrl=f,this._init()}return o.prototype._init=function(){let f=this,m=function(){return f.positions};this.options.polyline.positions=new xn(m,!1),this.entity=this.earthCtrl.entities.add(this.options)},o.prototype.destory=function(){N(this.entity)&&this.earthCtrl.entities.remove(this.entity)},o}(),s7t=function(){function o(f,m){this.options={polygon:{show:!0,hierarchy:{positions:m.positions},material:m.color,width:m.width,outline:!0,outlineColor:m.outlineColor,disableDepthTestDistance:1e4}},this.positions=m.positions,this.earthCtrl=f,this._init()}return o.prototype._init=function(){let f=this,m=function(){return{positions:f.positions}};this.options.polygon.hierarchy=new xn(m,!1),this.entity=this.earthCtrl.entities.add(this.options)},o.prototype.destory=function(){this.entity!==null&&this.earthCtrl.entities.remove(this.entity)},o}(),zU=function(){};zU.createPointPrimitive=function(o,f){return o.entities.add(f)};zU.createLabelPrimitive=function(o,f){return new n7t(o,f)};zU.createPointsPrimitive=function(o,f){return new o7t(o,f)};zU.createPolylinePrimitive=function(o,f){return new a7t(o,f)};zU.createPolygonPrimitive=function(o,f){return new s7t(o,f)};var ec=zU;function rJe(o){o=Z(o,Z.EMPTY_OBJECT),this.vertexArray=o.vertexArray,this.fragmentShaderSource=o.fragmentShaderSource,this.shaderProgram=o.shaderProgram,this.uniformMap=o.uniformMap,this.outputTexture=o.outputTexture,this.preExecute=o.preExecute,this.postExecute=o.postExecute,this.canceled=o.canceled,this.persists=Z(o.persists,!1),this.pass=vr.COMPUTE,this.owner=o.owner}rJe.prototype.execute=function(o){o.execute(this)};var B5=rJe,p1e=`in vec2 v_textureCoordinates; uniform float originalSize; uniform sampler2D texture0; uniform sampler2D texture1; uniform sampler2D texture2; uniform sampler2D texture3; uniform sampler2D texture4; uniform sampler2D texture5; const float yMipLevel1 = 1.0 - (1.0 / pow(2.0, 1.0)); const float yMipLevel2 = 1.0 - (1.0 / pow(2.0, 2.0)); const float yMipLevel3 = 1.0 - (1.0 / pow(2.0, 3.0)); const float yMipLevel4 = 1.0 - (1.0 / pow(2.0, 4.0)); void main() { vec2 uv = v_textureCoordinates; vec2 textureSize = vec2(originalSize * 1.5 + 2.0, originalSize); vec2 pixel = 1.0 / textureSize; float mipLevel = 0.0; if (uv.x - pixel.x > (textureSize.y / textureSize.x)) { mipLevel = 1.0; if (uv.y - pixel.y > yMipLevel1) { mipLevel = 2.0; if (uv.y - pixel.y * 3.0 > yMipLevel2) { mipLevel = 3.0; if (uv.y - pixel.y * 5.0 > yMipLevel3) { mipLevel = 4.0; if (uv.y - pixel.y * 7.0 > yMipLevel4) { mipLevel = 5.0; } } } } } if (mipLevel > 0.0) { float scale = pow(2.0, mipLevel); uv.y -= (pixel.y * (mipLevel - 1.0) * 2.0); uv.x *= ((textureSize.x - 2.0) / textureSize.y); uv.x -= 1.0 + pixel.x; uv.y -= (1.0 - (1.0 / pow(2.0, mipLevel - 1.0))); uv *= scale; } else { uv.x *= (textureSize.x / textureSize.y); } if(mipLevel == 0.0) { out_FragColor = texture(texture0, uv); } else if(mipLevel == 1.0) { out_FragColor = texture(texture1, uv); } else if(mipLevel == 2.0) { out_FragColor = texture(texture2, uv); } else if(mipLevel == 3.0) { out_FragColor = texture(texture3, uv); } else if(mipLevel == 4.0) { out_FragColor = texture(texture4, uv); } else if(mipLevel == 5.0) { out_FragColor = texture(texture5, uv); } else { out_FragColor = vec4(0.0); } } `,m1e=`in vec3 v_cubeMapCoordinates; uniform samplerCube cubeMap; void main() { vec4 rgba = czm_textureCube(cubeMap, v_cubeMapCoordinates); #ifdef RGBA_NORMALIZED out_FragColor = vec4(rgba.rgb, 1.0); #else float m = rgba.a * 16.0; vec3 r = rgba.rgb * m; out_FragColor = vec4(r * r, 1.0); #endif } `,g1e=`in vec4 position; in vec3 cubeMapCoordinates; out vec3 v_cubeMapCoordinates; void main() { gl_Position = position; v_cubeMapCoordinates = cubeMapCoordinates; } `;function k5(o){this._url=o,this._cubeMapBuffers=void 0,this._cubeMaps=void 0,this._texture=void 0,this._mipTextures=void 0,this._va=void 0,this._sp=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new Br}Object.defineProperties(k5.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});k5.isSupported=function(o){return o.colorBufferHalfFloat&&o.halfFloatingPointTexture||o.floatingPointTexture&&o.colorBufferFloat};var l7t=new H(1,0,0),u7t=new H(0,0,1),c7t=new H(-1,0,0),h7t=new H(0,0,-1),ZQ=new H(0,1,0),d7t=new H(0,-1,0),nJe=[ZQ,c7t,u7t,d7t,l7t,ZQ,h7t,ZQ,ZQ],oJe=nJe.length,aJe=new Float32Array(oJe*3),ske=0;for(let o=0;o0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useSphericalHarmonicCoefficients:{get:function(){return N(this._sphericalHarmonicCoefficients)||this._useDefaultSphericalHarmonics}},specularEnvironmentMapAtlas:{get:function(){return this._specularEnvironmentMapAtlas}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return N(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready||this._useDefaultSpecularMaps}}});function g7t(o,f){if(V5.isSupported(f)){if(o._specularEnvironmentMapAtlas=o._specularEnvironmentMapAtlas&&o._specularEnvironmentMapAtlas.destroy(),N(o._specularEnvironmentMaps)){let m=new V5(o._specularEnvironmentMaps);o._specularEnvironmentMapAtlas=m,o._removeErrorListener=m.errorEvent.addEventListener(v=>{console.error(`Error loading specularEnvironmentMaps: ${v}`)})}o._shouldRegenerateShaders=!0}}VY.prototype.update=function(o){if(o.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=o.frameNumber;let f=o.context;o.brdfLutGenerator.update(o),this._shouldRegenerateShaders=!1;let m=this._imageBasedLightingFactor,v=this._previousImageBasedLightingFactor;Ye.equals(m,v)||(this._shouldRegenerateShaders=m.x>0&&v.x===0||m.x===0&&v.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||m.y>0&&v.y===0||m.y===0&&v.y>0,this._previousImageBasedLightingFactor=Ye.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._luminanceAtZenith!==this._previousLuminanceAtZenith&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||N(this._luminanceAtZenith)!==N(this._previousLuminanceAtZenith),this._previousLuminanceAtZenith=this._luminanceAtZenith),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||N(this._previousSphericalHarmonicCoefficients)!==N(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentMapAtlasDirty&&(g7t(this,f),this._specularEnvironmentMapAtlasDirty=!1),N(this._specularEnvironmentMapAtlas)&&(this._specularEnvironmentMapAtlas.update(o),this._specularEnvironmentMapAtlas.ready&&(this._specularEnvironmentMapLoaded=!0));let y=!N(this._specularEnvironmentMapAtlas)&&N(o.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,x=!N(o.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,C=!N(this._sphericalHarmonicCoefficients)&&N(o.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,w=!N(o.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||y||x||C||w,this._useDefaultSpecularMaps=!N(this._specularEnvironmentMapAtlas)&&N(o.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!N(this._sphericalHarmonicCoefficients)&&N(o.sphericalHarmonicCoefficients)};VY.prototype.isDestroyed=function(){return!1};VY.prototype.destroy=function(){return this._specularEnvironmentMapAtlas=this._specularEnvironmentMapAtlas&&this._specularEnvironmentMapAtlas.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),kr(this)};var zY=VY,sJe=dd(jw(),1),$Q,lJe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYmE2YWEzOS1lZDUyLTQ0YWMtOTlkNS0wN2VhZWI3NTc4MmEiLCJpZCI6MjU5LCJpYXQiOjE2ODU2MzQ0Njl9.AswCMxsN03WYwuZL-r183OZicN64Ks9aPExWhA3fuLY",Qre={};Qre.defaultAccessToken=lJe;Qre.defaultServer=new Jr({url:"https://api.cesium.com/"});Qre.getDefaultTokenCredit=function(o){if(o===lJe){if(!N($Q)){let f=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;$Q=new Cs(f,!0),$Q._isDefaultToken=!0}return $Q}};var ZR=Qre;function Uy(o,f){let m,v=o.externalType,y=N(v);if(!y)m={url:o.url,retryAttempts:1,retryCallback:_7t};else if(v==="3DTILES"||v==="STK_TERRAIN_SERVER")m={url:o.options.url};else throw new sr("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");Jr.call(this,m),this._ionEndpoint=o,this._ionEndpointDomain=y?void 0:new sJe.default(o.url).authority(),this._ionEndpointResource=f,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=y}N(Object.create)&&(Uy.prototype=Object.create(Jr.prototype),Uy.prototype.constructor=Uy);Uy.fromAssetId=function(o,f){let m=Uy._createEndpointResource(o,f);return m.fetchJson().then(function(v){return new Uy(v,m)})};Object.defineProperties(Uy.prototype,{credits:{get:function(){return N(this._ionRoot)?this._ionRoot.credits:N(this._credits)?this._credits:(this._credits=Uy.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Uy.getCreditsFromEndpoint=function(o,f){let m=o.attributions.map(Cs.getIonCredit),v=ZR.getDefaultTokenCredit(f.queryParameters.access_token);return N(v)&&m.push(Cs.clone(v)),m};Uy.prototype.clone=function(o){let f=Z(this._ionRoot,this);return N(o)||(o=new Uy(f._ionEndpoint,f._ionEndpointResource)),o=Jr.prototype.clone.call(this,o),o._ionRoot=f,o._isExternal=this._isExternal,o};Uy.prototype.fetchImage=function(o){if(!this._isExternal){let f=o;o={preferBlob:!0},N(f)&&(o.flipY=f.flipY,o.preferImageBitmap=f.preferImageBitmap)}return Jr.prototype.fetchImage.call(this,o)};Uy.prototype._makeRequest=function(o){return this._isExternal||new sJe.default(this.url).authority()!==this._ionEndpointDomain?Jr.prototype._makeRequest.call(this,o):(N(o.headers)||(o.headers={}),o.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,o.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(o.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),Jr.prototype._makeRequest.call(this,o))};Uy._createEndpointResource=function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=Z(f.server,ZR.defaultServer),v=Z(f.accessToken,ZR.defaultAccessToken);m=Jr.createIfNeeded(m);let y={url:`v1/assets/${o}/endpoint`};return N(v)&&(y.queryParameters={access_token:v}),m.getDerivedResource(y)};function _7t(o,f){let m=Z(o._ionRoot,o),v=m._ionEndpointResource,y=typeof Image<"u";return!N(f)||f.statusCode!==401&&!(y&&f.target instanceof Image)?Promise.resolve(!1):(N(m._pendingPromise)||(m._pendingPromise=v.fetchJson().then(function(x){return m._ionEndpoint=x,x}).finally(function(x){return m._pendingPromise=void 0,x})),m._pendingPromise.then(function(x){return o._ionEndpoint=x,!0}))}var Pw=Uy;function rP(o){o=Z(o,0),this._array=new Array(o),this._length=o}Object.defineProperties(rP.prototype,{length:{get:function(){return this._length},set:function(o){let f=this._array,m=this._length;if(of.length&&(f.length=o);this._length=o}},values:{get:function(){return this._array}}});rP.prototype.get=function(o){return this._array[o]};rP.prototype.set=function(o,f){o>=this._length&&(this.length=o+1),this._array[o]=f};rP.prototype.peek=function(){return this._array[this._length-1]};rP.prototype.push=function(o){let f=this.length++;this._array[f]=o};rP.prototype.pop=function(){if(this._length===0)return;let o=this._array[this._length-1];return--this.length,o};rP.prototype.reserve=function(o){o>this._array.length&&(this._array.length=o)};rP.prototype.resize=function(o){this.length=o};rP.prototype.trim=function(o){o=Z(o,this._length),this._array.length=o};var E2=rP,PM={X:0,Y:1,Z:2};PM.Y_UP_TO_Z_UP=Ee.fromRotationTranslation(Ut.fromRotationX(xe.PI_OVER_TWO));PM.Z_UP_TO_Y_UP=Ee.fromRotationTranslation(Ut.fromRotationX(-xe.PI_OVER_TWO));PM.X_UP_TO_Z_UP=Ee.fromRotationTranslation(Ut.fromRotationY(-xe.PI_OVER_TWO));PM.Z_UP_TO_X_UP=Ee.fromRotationTranslation(Ut.fromRotationY(xe.PI_OVER_TWO));PM.X_UP_TO_Y_UP=Ee.fromRotationTranslation(Ut.fromRotationZ(xe.PI_OVER_TWO));PM.Y_UP_TO_X_UP=Ee.fromRotationTranslation(Ut.fromRotationZ(-xe.PI_OVER_TWO));PM.fromName=function(o){return PM[o]};var Df=Object.freeze(PM);function uJe(o){o=Z(o,Z.EMPTY_OBJECT),this._metadata=o.metadata}Object.defineProperties(uJe.prototype,{metadata:{get:function(){return this._metadata}}});var Zre=uJe;function HR(o,f,m){return f=Z(f,0),m=Z(m,o.byteLength-f),o=o.subarray(f,f+m),HR.decode(o)}HR.decodeWithTextDecoder=function(o){return new TextDecoder("utf-8").decode(o)};HR.decodeWithFromCharCode=function(o){let f="",m=v7t(o),v=m.length;for(let y=0;y>10)+55296,(x&1023)+56320))}return f};function O9(o,f,m){return f<=o&&o<=m}function v7t(o){let f=0,m=0,v=0,y=128,x=191,C=[],w=o.length;for(let A=0;A{this._resolveContent=y})}Object.defineProperties(eT.prototype,{featurePropertiesDirty:{get:function(){let o=this._contents,f=o.length;for(let m=0;m0){let y=Math.min(f,Bo.maximumTextureSize),x=Math.ceil(f/Bo.maximumTextureSize),C=1/y,w=C*.5,A=1/x,E=A*.5;m=new Ye(y,x),v=new Wt(C,w,A,E)}this._translucentFeaturesLength=0,this._featuresLength=f,this._textureDimensions=m,this._textureStep=v,this._owner=o.owner,this._statistics=o.statistics,this._colorChangedCallback=o.colorChangedCallback}Object.defineProperties(kv.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let o=0;return N(this._pickTexture)&&(o+=this._pickTexture.sizeInBytes),N(this._batchTexture)&&(o+=this._batchTexture.sizeInBytes),o}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});kv.DEFAULT_COLOR_VALUE=Re.WHITE;kv.DEFAULT_SHOW_VALUE=!0;function cJe(o){let f=o._textureDimensions;return f.x*f.y*4}function hJe(o){if(!N(o._batchValues)){let f=cJe(o),m=new Uint8Array(f).fill(255);o._batchValues=m}return o._batchValues}function dJe(o){if(!N(o._showAlphaProperties)){let f=2*o._featuresLength,m=new Uint8Array(f).fill(255);o._showAlphaProperties=m}return o._showAlphaProperties}kv.prototype.setShow=function(o,f){if(f&&!N(this._showAlphaProperties))return;let m=dJe(this),v=o*2,y=f?255:0;if(m[v]!==y){m[v]=y;let x=hJe(this),C=o*4+3;x[C]=f?m[v+1]:0,this._batchValuesDirty=!0}};kv.prototype.setAllShow=function(o){let f=this._featuresLength;for(let m=0;m0){let v=o._pickIds,y=cJe(o),x=new Uint8Array(y),C=o._owner,w=o._statistics;for(let A=0;A0;){if(f=T.pop(),A[f]===E)continue;A[f]=E;let S=m(o,f);if(N(S))return S;let M=y[f],I=C[f];for(let P=0;P0?(C="",o&&(C+=`uniform bool tile_translucentCommand; `),C+=`uniform sampler2D tile_batchTexture; out vec4 tile_featureColor; out vec2 tile_featureSt; out vec4 v_elevationPos;void main() { vec2 st = computeSt(${f}); vec4 featureProperties = texture(tile_batchTexture, st); tile_color(featureProperties); float show = ceil(featureProperties.a); gl_Position *= show; `,o&&(C+=` bool isStyleTranslucent = (featureProperties.a != 1.0); if (czm_pass == czm_passTranslucent) { if (!isStyleTranslucent && !tile_translucentCommand) { gl_Position *= 0.0; } } else { if (isStyleTranslucent) { gl_Position *= 0.0; } } `),C+=` tile_featureColor = featureProperties; tile_featureSt = st; v_elevationPos = czm_inverseModelViewProjection * gl_Position; }`):C=`out vec2 tile_featureSt; out vec4 v_elevationPos; void main() { tile_color(vec4(1.0)); tile_featureSt = computeSt(${f}); v_elevationPos = czm_inverseModelViewProjection * gl_Position; }`,`${x} ${W7t(v)}${C}`}};function uke(o,f){return o=Zr.replaceMain(o,"tile_main"),f?`${o}uniform float tile_colorBlend; void tile_color(vec4 tile_featureColor) { tile_main(); tile_featureColor = czm_gammaCorrect(tile_featureColor); out_FragColor.a *= tile_featureColor.a; float highlight = ceil(tile_colorBlend); out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); } `:`${o}void tile_color(vec4 tile_featureColor) { tile_main(); } `}function j7t(o,f){let m=`texture(${f}`,v=0,y=o.indexOf(m,v),x;for(;y>-1;){let C=0;for(let A=y;A0?(y+=`uniform sampler2D tile_pickTexture; in vec2 tile_featureSt; in vec4 tile_featureColor; in vec4 v_elevationPos;void main() { tile_color(tile_featureColor); `,N(v)&&(y+=v),m&&(y+=` out_FragColor.rgb *= out_FragColor.a; `),y+="}"):(o&&(y+=`uniform bool tile_translucentCommand; `),y+=`uniform sampler2D tile_pickTexture; uniform sampler2D tile_batchTexture; in vec2 tile_featureSt; void main() { vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); if (featureProperties.a == 0.0) { discard; } `,o&&(y+=` bool isStyleTranslucent = (featureProperties.a != 1.0); if (czm_pass == czm_passTranslucent) { if (!isStyleTranslucent && !tile_translucentCommand) { discard; } } else { if (isStyleTranslucent) { discard; } } `),y+=` tile_color(featureProperties); `,m&&(y+=` out_FragColor.rgb *= out_FragColor.a; `),y+=`} `),y}};bh.prototype.getClassificationFragmentShaderCallback=function(){if(this.featuresLength!==0)return function(o){return o=Zr.replaceMain(o,"tile_main"),Bo.maximumVertexTextureImageUnits>0?o+=`uniform sampler2D tile_pickTexture; in vec2 tile_featureSt; in vec4 tile_featureColor; void main() { tile_main(); out_FragColor = tile_featureColor; out_FragColor.rgb *= out_FragColor.a; }`:o+=`uniform sampler2D tile_batchTexture; uniform sampler2D tile_pickTexture; in vec2 tile_featureSt; void main() { tile_main(); vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); if (featureProperties.a == 0.0) { discard; } out_FragColor = featureProperties; out_FragColor.rgb *= out_FragColor.a; } `,o}};function Y7t(o){let f=o._content.tileset,m=f.colorBlendMode,v=f.colorBlendAmount;if(m===d2.HIGHLIGHT)return 0;if(m===d2.REPLACE)return 1;if(m===d2.MIX)return xe.clamp(v,xe.EPSILON4,1)}bh.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let o=this;return function(f){return va(f,{tile_batchTexture:function(){return Z(o._batchTexture.batchTexture,o._batchTexture.defaultTexture)},tile_textureDimensions:function(){return o._batchTexture.textureDimensions},tile_textureStep:function(){return o._batchTexture.textureStep},tile_colorBlend:function(){return Y7t(o)},tile_pickTexture:function(){return o._batchTexture.pickTexture}})}};bh.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var RR={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};bh.prototype.addDerivedCommands=function(o,f){let m=o.commandList,v=m.length,y=this._content._tile,x=y._finalResolution,C=y.tileset,w=C.isSkippingLevelOfDetail&&C.hasMixedContent&&o.context.stencilBuffer,A=q7t(this);for(let E=f;E>>Ua.SKIP_LOD_BIT_SHIFT}function tWt(o){let f=uo(o,!0);return f.cull.enabled=!1,f.depthTest.enabled=!0,f.depthMask=!1,f.blending=Mu.ALPHA_BLEND,f.stencilTest=Ua.setCesium3DTileBit(),f.stencilMask=Ua.CESIUM_3D_TILE_MASK,Mn.fromCache(f)}function iWt(o){let f=uo(o,!0);return f.stencilTest=Ua.setCesium3DTileBit(),f.stencilMask=Ua.CESIUM_3D_TILE_MASK,Mn.fromCache(f)}bh.prototype.update=function(o,f){this._batchTexture.update(o,f)};bh.prototype.isDestroyed=function(){return!1};bh.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),kr(this)};var UY=bh;function rWt(o){this.offset=o.offset,this.count=o.count,this.color=o.color,this.batchIds=o.batchIds}var SH=rWt,Kee=`in vec3 position; in float a_batchId; uniform mat4 u_modifiedModelViewProjection; void main() { gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } `;function kw(o,f){this._content=o,this._batchId=f,this._color=void 0}Object.defineProperties(kw.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(o){this._content.batchTable.setShow(this._batchId,o)}},color:{get:function(){return N(this._color)||(this._color=new Re),this._content.batchTable.getColor(this._batchId,this._color)},set:function(o){this._content.batchTable.setColor(this._batchId,o)}},polylinePositions:{get:function(){if(N(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});kw.prototype.hasProperty=function(o){return this._content.batchTable.hasProperty(this._batchId,o)};kw.prototype.getPropertyIds=function(o){return this._content.batchTable.getPropertyIds(this._batchId,o)};kw.prototype.getProperty=function(o){return this._content.batchTable.getProperty(this._batchId,o)};kw.getPropertyInherited=function(o,f,m){let v=o.batchTable;if(N(v)){if(v.hasPropertyBySemantic(f,m))return v.getPropertyBySemantic(f,m);if(v.hasProperty(f,m))return v.getProperty(f,m)}let y=o.metadata;if(N(y)){if(y.hasPropertyBySemantic(m))return y.getPropertyBySemantic(m);if(y.hasProperty(m))return y.getProperty(m)}let x=o.tile,C=x.metadata;if(N(C)){if(C.hasPropertyBySemantic(m))return C.getPropertyBySemantic(m);if(C.hasProperty(m))return C.getProperty(m)}let w;if(N(x.implicitSubtree)&&(w=x.implicitSubtree.metadata),N(w)){if(w.hasPropertyBySemantic(m))return w.getPropertyBySemantic(m);if(w.hasProperty(m))return w.getProperty(m)}let A=N(o.group)?o.group.metadata:void 0;if(N(A)){if(A.hasPropertyBySemantic(m))return A.getPropertyBySemantic(m);if(A.hasProperty(m))return A.getProperty(m)}let E=o.tileset.metadata;if(N(E)){if(E.hasPropertyBySemantic(m))return E.getPropertyBySemantic(m);if(E.hasProperty(m))return E.getProperty(m)}};kw.prototype.getPropertyInherited=function(o){return kw.getPropertyInherited(this._content,this._batchId,o)};kw.prototype.setProperty=function(o,f){this._content.batchTable.setProperty(this._batchId,o,f),this._content.featurePropertiesDirty=!0};kw.prototype.isExactClass=function(o){return this._content.batchTable.isExactClass(this._batchId,o)};kw.prototype.isClass=function(o){return this._content.batchTable.isClass(this._batchId,o)};kw.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var Qs=kw;function JM(o){o=Z(o,Z.EMPTY_OBJECT),this._batchTable=o.batchTable,this._batchIds=o.batchIds,this._positions=o.positions,this._vertexBatchIds=o.vertexBatchIds,this._indices=o.indices,this._indexCounts=o.indexCounts,this._indexOffsets=o.indexOffsets,this._batchedIndices=o.batchedIndices,this._boundingVolume=o.boundingVolume,this._boundingVolumes=o.boundingVolumes,this._center=Z(o.center,H.ZERO),this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=Re.clone(Re.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=Z(o.classificationType,uc.BOTH),this._vertexShaderSource=o._vertexShaderSource,this._fragmentShaderSource=o._fragmentShaderSource,this._attributeLocations=o._attributeLocations,this._uniformMap=o._uniformMap,this._pickId=o._pickId,this._modelMatrix=o._modelMatrix,this._boundingSphere=o._boundingSphere,this._batchIdLookUp={};let f=this._batchIds.length;for(let m=0;m0;){let T=f.pop();if(Re.equals(T.color,w.color))E=Ude(m,C,E,v,y,T.batchIds,x),w.batchIds=w.batchIds.concat(T.batchIds),w.count=E-w.offset;else{let S=E;E=Ude(m,C,E,v,y,T.batchIds,x),T.offset=S,T.count=E-S,A.push(T),w=T}}o._va.indexBuffer.copyFromArrayView(C),o._indices=C,o._batchedIndices=A}function Gde(o,f,m,v,y,x,C){let w=o.bytesPerIndex,A=x.length;for(let E=0;E0;){let S=f.pop();if(Re.equals(S.color,x.color))E=Gde(w,A,E,m,v,S.batchIds,y),x.batchIds=x.batchIds.concat(S.batchIds),x.count=E-x.offset;else{let M=E;E=Gde(w,A,E,m,v,S.batchIds,y),S.offset=M,S.count=E-M,C.push(S),x=S}}let T=o._va;o._va=o._vaSwap,o._vaSwap=T,o._batchedIndices=C}function fWt(o,f){return f.color.toRgba()-o.color.toRgba()}function pWt(o,f){if(!o._batchDirty)return!1;let m=o._batchedIndices,v=m.length,y=!1,x={};for(let C=0;C=D&&C{o.isDestroyed()||(o._error=P)}):void 0}}function MWt(o){N(o._primitive)||(o._primitive=new ene({batchTable:o._batchTable,positions:o._positions,batchIds:o._batchIds,vertexBatchIds:o._vertexBatchIds,indices:o._indices,indexOffsets:o._indexOffsets,indexCounts:o._indexCounts,batchedIndices:o._batchedIndices,boundingVolume:o._boundingVolume,boundingVolumes:o._boundingVolumes,center:o._center,pickObject:Z(o._pickObject,o)}),o._boxes=void 0,o._boxBatchIds=void 0,o._cylinders=void 0,o._cylinderBatchIds=void 0,o._ellipsoids=void 0,o._ellipsoidBatchIds=void 0,o._spheres=void 0,o._sphereBatchIds=void 0,o._center=void 0,o._modelMatrix=void 0,o._batchTable=void 0,o._boundingVolume=void 0,o._boundingVolumes=void 0,o._batchedIndices=void 0,o._indices=void 0,o._indexOffsets=void 0,o._indexCounts=void 0,o._positions=void 0,o._vertexBatchIds=void 0,o._batchIds=void 0,o._batchTableColors=void 0,o._packedBuffer=void 0,o._verticesPromise=void 0)}sb.prototype.createFeatures=function(o,f){this._primitive.createFeatures(o,f)};sb.prototype.applyDebugSettings=function(o,f){this._primitive.applyDebugSettings(o,f)};sb.prototype.applyStyle=function(o,f){this._primitive.applyStyle(o,f)};sb.prototype.updateCommands=function(o,f){this._primitive.updateCommands(o,f)};sb.prototype.update=function(o){if(!this._ready){if(N(this._promise)||(this._promise=IWt(this)),N(this._error)){let f=this._error;throw this._error=void 0,f}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(o)};sb.prototype.isDestroyed=function(){return!1};sb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),kr(this)};var YF=sb;function KM(o,f,m,v,y){this._tileset=o,this._tile=f,this._resource=m,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(x=>{this._resolveContent=x}),RWt(this,v,y)}Object.defineProperties(KM.prototype,{featuresLength:{get:function(){return N(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return N(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return N(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return N(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("Geometry3DTileContent.readyPromise","Geometry3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Geometry3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(o){this._metadata=o}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(o){this._group=o}}});function DWt(o){return function(f,m){N(o._geometries)&&o._geometries.updateCommands(f,m)}}function LWt(o,f){let m,v,y,x,C,w=Z(o.BOXES_LENGTH,0),A=Z(o.CYLINDERS_LENGTH,0),E=Z(o.ELLIPSOIDS_LENGTH,0),T=Z(o.SPHERES_LENGTH,0);if(w>0&&N(o.BOX_BATCH_IDS)){let I=f.byteOffset+o.BOX_BATCH_IDS.byteOffset;m=new Uint16Array(f.buffer,I,w)}if(A>0&&N(o.CYLINDER_BATCH_IDS)){let I=f.byteOffset+o.CYLINDER_BATCH_IDS.byteOffset;v=new Uint16Array(f.buffer,I,A)}if(E>0&&N(o.ELLIPSOID_BATCH_IDS)){let I=f.byteOffset+o.ELLIPSOID_BATCH_IDS.byteOffset;y=new Uint16Array(f.buffer,I,E)}if(T>0&&N(o.SPHERE_BATCH_IDS)){let I=f.byteOffset+o.SPHERE_BATCH_IDS.byteOffset;x=new Uint16Array(f.buffer,I,T)}let S=N(m)||N(v)||N(y)||N(x),M=w>0&&!N(m)||A>0&&!N(v)||E>0&&!N(y)||T>0&&!N(x);if(S&&M)throw new sr("If one group of batch ids is defined, then all batch ids must be defined");if(!N(m)&&!N(v)&&!N(y)&&!N(x)){let I=0;if(!N(m)&&w>0)for(m=new Uint16Array(w),C=0;C0)for(v=new Uint16Array(A),C=0;C0)for(y=new Uint16Array(E),C=0;C0)for(x=new Uint16Array(T),C=0;C0&&(I=E_(v,m,E),m+=E,T>0&&(P=new Uint8Array(f,m,T),P=new Uint8Array(P)));let D=Z(S.BOXES_LENGTH,0),L=Z(S.CYLINDERS_LENGTH,0),R=Z(S.ELLIPSOIDS_LENGTH,0),O=Z(S.SPHERES_LENGTH,0),F=D+L+R+O,k=new UY(o,F,I,P,DWt(o));if(o._batchTable=k,F===0)return;let U=o.tile.computedTransform,G;N(S.RTC_CENTER)&&(G=H.unpack(S.RTC_CENTER),Ee.multiplyByPoint(U,G,G));let j=LWt(S,M);if(D>0||L>0||R>0||O>0){let q,J,X,Y;if(D>0){let Q=M.byteOffset+S.BOXES.byteOffset;q=new Float32Array(M.buffer,Q,YF.packedBoxLength*D)}if(L>0){let Q=M.byteOffset+S.CYLINDERS.byteOffset;J=new Float32Array(M.buffer,Q,YF.packedCylinderLength*L)}if(R>0){let Q=M.byteOffset+S.ELLIPSOIDS.byteOffset;X=new Float32Array(M.buffer,Q,YF.packedEllipsoidLength*R)}if(O>0){let Q=M.byteOffset+S.SPHERES.byteOffset;Y=new Float32Array(M.buffer,Q,YF.packedSphereLength*O)}return o._geometries=new YF({boxes:q,boxBatchIds:j.boxes,cylinders:J,cylinderBatchIds:j.cylinders,ellipsoids:X,ellipsoidBatchIds:j.ellipsoids,spheres:Y,sphereBatchIds:j.spheres,center:G,modelMatrix:U,batchTable:k,boundingVolume:o.tile.boundingVolume.boundingVolume}),o}return Promise.resolve(o)}function gJe(o){let f=o.featuresLength;if(!N(o._features)&&f>0){let m=new Array(f);N(o._geometries)&&o._geometries.createFeatures(o,m),o._features=m}}KM.prototype.hasProperty=function(o,f){return this._batchTable.hasProperty(o,f)};KM.prototype.getFeature=function(o){return gJe(this),this._features[o]};KM.prototype.applyDebugSettings=function(o,f){N(this._geometries)&&this._geometries.applyDebugSettings(o,f)};KM.prototype.applyStyle=function(o){gJe(this),N(this._geometries)&&this._geometries.applyStyle(o,this._features)};KM.prototype.update=function(o,f){N(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(f)),N(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(o,f),this._ready=!0,this._resolveContent(this))};KM.prototype.isDestroyed=function(){return!1};KM.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),kr(this)};var v1e=KM,y1e={};y1e.encode2D=function(o,f,m){let v=Math.pow(2,o),y={x:f,y:m},x,C,w,A=BigInt(0);for(w=v/2;w>0;w/=2)x=(y.x&w)>0?1:0,C=(y.y&w)>0?1:0,A+=BigInt((3*x^C)*w*w),_Je(v,y,x,C);return A};y1e.decode2D=function(o,f){let m=Math.pow(2,o),v={x:0,y:0},y,x,C,w;for(C=1,w=f;C>>0,x1e=2*IB+1,SR=4,vJe=[],yJe=[],FWt=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],UR=1,Az=2,eZ=[UR,0,0,UR|Az];function rm(o){if(!pa.supportsBigInt())throw new sr("S2 required BigInt support");this._cellId=o,this._level=rm.getLevel(o)}rm.fromToken=function(o){return new rm(rm.getIdFromToken(o))};rm.isValidId=function(o){return!(o<=0||o>>BigInt(x1e)>5||!(o&~o+BigInt(1)&BigInt("0x1555555555555555")))};rm.isValidToken=function(o){return/^[0-9a-fA-F]{1,16}$/.test(o)?rm.isValidId(rm.getIdFromToken(o)):!1};rm.getIdFromToken=function(o){return BigInt("0x"+o+"0".repeat(16-o.length))};rm.getTokenFromId=function(o){let f=Math.floor(YWt(o)/4),m=o.toString(16).replace(/0*$/,"");return Array(17-f-m.length).join("0")+m};rm.getLevel=function(o){let f=0;for(;o!==BigInt(0)&&!(o&BigInt(1));)f++,o=o>>BigInt(1);return IB-(f>>1)};rm.prototype.getChild=function(o){let f=bJe(this._cellId)>>BigInt(2),m=this._cellId+BigInt(2*o+1-4)*f;return new rm(m)};rm.prototype.getParent=function(){let o=bJe(this._cellId)<>1&1;return CJe(v[0],y[0][x^m&1],y[1][x])}function VWt(o,f){let m=xJe(o),v=m[0],y=m[1],x=m[2],C=f===30,w=!C&&(BigInt(y)^o>>BigInt(2))&BigInt(1),A=C?1:w?2:0,E=(y<<1)+A,T=(x<<1)+A;return[v,E,T]}function xJe(o){vJe.length===0&&GWt();let f=Number(o>>BigInt(x1e)),m=f&UR,v=(1<=0;C--){let w=(1<<2*(C===7?IB-7*SR:SR))-1;m+=Number(o>>BigInt(C*2*SR+1)&BigInt(w))<<2,m=yJe[m];let A=C*SR;y+=m>>SR+2<>2&v)<=.5?1/3*(4*o*o-1):1/3*(1-4*(1-o)*(1-o))}function fke(o){return 1/NWt*o}function HWt(o,f){let m=[[],[]],v=UWt(f);for(let y=0;y<2;++y){let x=o[y]&-v,C=x+v;m[y][0]=Zee(pke(x)),m[y][1]=Zee(pke(C))}return m}function UWt(o){return 1<>>0}function pke(o){return 1/OWt*o}function GR(o,f,m,v,y,x){if(o===SR){let C=(f<>1),m+(C[0]&1),v,y,x^eZ[0]),GR(o,f+(C[1]>>1),m+(C[1]&1),v,y+1,x^eZ[1]),GR(o,f+(C[2]>>1),m+(C[2]&1),v,y+2,x^eZ[2]),GR(o,f+(C[3]>>1),m+(C[3]&1),v,y+3,x^eZ[3])}}function GWt(){GR(0,0,0,0,0,0),GR(0,0,0,UR,0,UR),GR(0,0,0,Az,0,Az),GR(0,0,0,UR|Az,0,UR|Az)}function bJe(o){return o&~o+BigInt(1)}function WWt(o){return BigInt(1)<>3,x=v%8;m+=o[y]>>x&1}return m}Object.defineProperties(C1e.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});C1e.prototype.getBit=function(o){if(N(this._constant))return this._constant;let f=o>>3,m=o%8;return(this._bitstream[f]>>m&1)===1};var $ee=C1e;function QM(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.metadataTable,m=o.class,v=o.entityId,y=o.propertyTableJson;this._class=m,this._metadataTable=f,this._entityId=v,this._extensions=y.extensions,this._extras=y.extras}Object.defineProperties(QM.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});QM.prototype.hasProperty=function(o){return this._metadataTable.hasProperty(o)};QM.prototype.hasPropertyBySemantic=function(o){return this._metadataTable.hasPropertyBySemantic(o)};QM.prototype.getPropertyIds=function(o){return this._metadataTable.getPropertyIds(o)};QM.prototype.getProperty=function(o){return this._metadataTable.getProperty(this._entityId,o)};QM.prototype.setProperty=function(o,f){return this._metadataTable.setProperty(this._entityId,o,f)};QM.prototype.getPropertyBySemantic=function(o){return this._metadataTable.getPropertyBySemantic(this._entityId,o)};QM.prototype.setPropertyBySemantic=function(o,f){return this._metadataTable.setPropertyBySemantic(this._entityId,o,f)};var tne=QM,X$={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};X$.getBranchingFactor=function(o){switch(o){case X$.OCTREE:return 8;case X$.QUADTREE:return 4}};var N0=Object.freeze(X$);function B0(){}Object.defineProperties(B0.prototype,{class:{get:function(){li.throwInstantiationError()}}});B0.prototype.hasProperty=function(o){li.throwInstantiationError()};B0.prototype.hasPropertyBySemantic=function(o){li.throwInstantiationError()};B0.prototype.getPropertyIds=function(o){li.throwInstantiationError()};B0.prototype.getProperty=function(o){li.throwInstantiationError()};B0.prototype.setProperty=function(o,f){li.throwInstantiationError()};B0.prototype.getPropertyBySemantic=function(o){li.throwInstantiationError()};B0.prototype.setPropertyBySemantic=function(o,f){li.throwInstantiationError()};B0.hasProperty=function(o,f,m){if(N(f[o]))return!0;let v=m.properties;if(!N(v))return!1;let y=v[o];return!!(N(y)&&N(y.default))};B0.hasPropertyBySemantic=function(o,f,m){let v=m.propertiesBySemantic;if(!N(v))return!1;let y=v[o];return N(y)};B0.getPropertyIds=function(o,f,m){m=N(m)?m:[],m.length=0;for(let y in o)o.hasOwnProperty(y)&&N(o[y])&&m.push(y);let v=f.properties;if(N(v))for(let y in v)v.hasOwnProperty(y)&&!N(o[y])&&N(v[y].default)&&m.push(y);return m};B0.getProperty=function(o,f,m){let v=m.properties[o],y=f[o];Array.isArray(y)&&(y=y.slice());let x=!0;if(y=v.handleNoData(y),!N(y)&&N(v.default))return y=uo(v.default,!0),v.unpackVectorAndMatrixTypes(y,x);if(N(y))return y=v.normalize(y),y=v.applyValueTransform(y),v.unpackVectorAndMatrixTypes(y,x)};B0.setProperty=function(o,f,m,v){if(!N(m[o]))return!1;Array.isArray(f)&&(f=f.slice());let y,x=v.properties;N(x)&&(y=x[o]);let C=!0;return N(y)&&(f=y.packVectorAndMatrixTypes(f,C),f=y.unapplyValueTransform(f),f=y.unnormalize(f)),m[o]=f,!0};B0.getPropertyBySemantic=function(o,f,m){let v=m.propertiesBySemantic;if(!N(v))return;let y=v[o];if(N(y))return B0.getProperty(y.id,f,m)};B0.setPropertyBySemantic=function(o,f,m,v){let y=v.propertiesBySemantic;if(!N(y))return!1;let x=v.propertiesBySemantic[o];return N(x)?B0.setProperty(x.id,f,m,v):!1};var yu=B0;function ZM(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.subtreeMetadata,m=o.class,v=N(f.properties)?f.properties:{};this._class=m,this._properties=v,this._extras=f.extras,this._extensions=f.extensions}Object.defineProperties(ZM.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});ZM.prototype.hasProperty=function(o){return yu.hasProperty(o,this._properties,this._class)};ZM.prototype.hasPropertyBySemantic=function(o){return yu.hasPropertyBySemantic(o,this._properties,this._class)};ZM.prototype.getPropertyIds=function(o){return yu.getPropertyIds(this._properties,this._class,o)};ZM.prototype.getProperty=function(o){return yu.getProperty(o,this._properties,this._class)};ZM.prototype.setProperty=function(o,f){return yu.setProperty(o,f,this._properties,this._class)};ZM.prototype.getPropertyBySemantic=function(o){return yu.getPropertyBySemantic(o,this._properties,this._class)};ZM.prototype.setPropertyBySemantic=function(o,f){return yu.setPropertyBySemantic(o,f,this._properties,this._class)};var b1e=ZM,jo={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};jo.getMinimum=function(o){switch(o){case jo.INT8:return-128;case jo.UINT8:return 0;case jo.INT16:return-32768;case jo.UINT16:return 0;case jo.INT32:return-2147483648;case jo.UINT32:return 0;case jo.INT64:return pa.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case jo.UINT64:return pa.supportsBigInt()?BigInt(0):0;case jo.FLOAT32:return-34028234663852886e22;case jo.FLOAT64:return-Number.MAX_VALUE}};jo.getMaximum=function(o){switch(o){case jo.INT8:return 127;case jo.UINT8:return 255;case jo.INT16:return 32767;case jo.UINT16:return 65535;case jo.INT32:return 2147483647;case jo.UINT32:return 4294967295;case jo.INT64:return pa.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case jo.UINT64:return pa.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case jo.FLOAT32:return 34028234663852886e22;case jo.FLOAT64:return Number.MAX_VALUE}};jo.isIntegerType=function(o){switch(o){case jo.INT8:case jo.UINT8:case jo.INT16:case jo.UINT16:case jo.INT32:case jo.UINT32:case jo.INT64:case jo.UINT64:return!0;default:return!1}};jo.isUnsignedIntegerType=function(o){switch(o){case jo.UINT8:case jo.UINT16:case jo.UINT32:case jo.UINT64:return!0;default:return!1}};jo.isVectorCompatible=function(o){switch(o){case jo.INT8:case jo.UINT8:case jo.INT16:case jo.UINT16:case jo.INT32:case jo.UINT32:case jo.FLOAT32:case jo.FLOAT64:return!0;default:return!1}};jo.normalize=function(o,f){return Math.max(Number(o)/Number(jo.getMaximum(f)),-1)};jo.unnormalize=function(o,f){let m=jo.getMaximum(f),v=jo.isUnsignedIntegerType(f)?0:-m;return o=xe.sign(o)*Math.round(Math.abs(o)*Number(m)),(f===jo.INT64||f===jo.UINT64)&&pa.supportsBigInt()&&(o=BigInt(o)),o>m?m:o1;if(!m&&y===1)return o;if(!m)return new Array(y).fill(o);if(!x)return new Array(v).fill(o);if(!f)return new Array(this._arrayLength*y).fill(o);let C=new Array(y).fill(o);return new Array(this._arrayLength).fill(C)};T_.prototype.handleNoData=function(o){let f=this._noData;if(!N(f)||!wJe(o,f))return o};function wJe(o,f){if(!Array.isArray(o))return o===f;if(!Array.isArray(f)||o.length!==f.length)return!1;for(let m=0;m1;return N(m)?f&&x?o.map(function(C){return m.unpack(C)}):v?m.unpackArray(o):m.unpack(o):o};T_.prototype.packVectorAndMatrixTypes=function(o,f){f=Z(f,!1);let m=Fa.getMathType(this._type),v=this._isArray,y=Fa.getComponentCount(this._type),x=v&&y>1;return N(m)?f&&x?o.map(function(C){return m.pack(C,[])}):v?m.packArray(o,[]):m.pack(o,[]):o};T_.prototype.validate=function(o){if(!(!N(o)&&N(this._default)))return this._required&&!N(o)?"required property must have a value":this._isArray?QWt(this,o):AJe(this,o)};function QWt(o,f){if(!Array.isArray(f))return`value ${f} must be an array`;let m=f.length;if(!o._isVariableLengthArray&&m!==o._arrayLength)return"Array length does not match property.arrayLength";for(let v=0;vy?mke(o,f,m):void 0}if(ods.getMaximum(f))return mke(o,f,m)}function _ke(o,f){return`value ${o} of type ${f} must be finite`}function w1e(o,f,m){if(!Array.isArray(o))return m(o,f);for(let v=0;v>3,v=o%8;return(f.typedArray[m]>>v&1)===1}function ljt(o,f,m){let v=o>>3,y=o%8;m?f.typedArray[v]|=1<0,C=!0;for(let w=0;w<8;++w){let A=m.getUint8(v+w);x&&(C?A!==0&&(A=~(A-1)&255,C=!1):A=~A&255),y+=A*Math.pow(256,w)}return x&&(y=-y),y}function cjt(o,f){let m=f.dataView,v=o*8,y=BigInt(0),x=(m.getUint8(v+7)&128)>0,C=!0;for(let w=0;w<8;++w){let A=m.getUint8(v+w);x&&(C?A!==0&&(A=~(A-1)&255,C=!1):A=~A&255),y+=BigInt(A)*(BigInt(1)<96?D-97:D>64?D-39:D+4}for(var L=0,P=0;P0&&P<=256),x(P%4==0);var D=m.exports.meshopt_encodeVertexBufferBound(I,P);return A(m.exports.meshopt_encodeVertexBuffer,D,M,I,P)},encodeIndexBuffer:function(M,I,P){x(P==2||P==4),x(I%3==0);var D=T(M,P),L=m.exports.meshopt_encodeIndexBufferBound(I,E(D)+1);return A(m.exports.meshopt_encodeIndexBuffer,L,D,I,4)},encodeIndexSequence:function(M,I,P){x(P==2||P==4);var D=T(M,P),L=m.exports.meshopt_encodeIndexSequenceBound(I,E(D)+1);return A(m.exports.meshopt_encodeIndexSequence,L,D,I,4)},encodeGltfBuffer:function(M,I,P,D){var L={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return x(L[D]),L[D](M,I,P)},encodeFilterOct:function(M,I,P,D){return x(P==4||P==8),x(D>=1&&D<=16),S(m.exports.meshopt_encodeFilterOct,M,I,P,D,16)},encodeFilterQuat:function(M,I,P,D){return x(P==8),x(D>=4&&D<=16),S(m.exports.meshopt_encodeFilterQuat,M,I,P,D,16)},encodeFilterExp:function(M,I,P,D,L){x(P>0&&P%4==0),x(D>=1&&D<=24);var R={Separate:0,SharedVector:1,SharedComponent:2};return S(m.exports.meshopt_encodeFilterExp,M,I,P,D,P,L?R[L]:1)}}}(),Cjt=function(){"use strict";var o="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q;iekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq:78Yqdbk:qzezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9UhlaicefhodnadTmbalc;WFbGglcjdalcjd6EhDcbhqinaqae9pmeaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxdndndndnalc9WGgmTmbcbhPcehsawcjdfhzaohHinaraH9Rax6midnaraHaxfgo9RcK6mbczhlinalgic9Wfglawcj;cbffhOdndndndndnaHalco4fRbbalci4coG4ciGPlbedibkaO9cb83ibaOcwf9cb83ibxikaOaoRblaoRbbgAco4glalciSgCE86bbawcj;cbfaifglcGfaoclfaCfgORbbaAcl4ciGgCaCciSgCE86bbalcVfaOaCfgORbbaAcd4ciGgCaCciSgCE86bbalc7faOaCfgORbbaAciGgAaAciSgAE86bbalctfaOaAfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkaOaoRbwaoRbbgAcl4glalcsSgCE86bbawcj;cbfaifglcGfaocwfaCfgORbbaAcsGgAaAcsSgAE86bbalcVfaOaAfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekaOao8Pbb83bbaOcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaiczfhlarao9RcL0mekkaiam6miaoTmidnakTmbawaPfRbbhOawcj;cbfhlazhiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkkazcefhzaPcefgPad6hsaohHaPad9hmexvkkcbhoasceGmdxikaoaxad2fhPdnakTmbcbhmcehsawcjdfhCinarao9Rax6miaoTmdaoaxfhoawamfRbbhOawcj;cbfhlaChiakhHinaialRbbgAce4cbaAceG9R7aOfgO86bbaiadfhialcefhlaHcufgHmbkaCcefhCamcefgmad6hsamad9hmbkaPhoxikcbhlcehsinarao9Rax6mdaoTmeaoaxfhoalcefglad6hsadal9hmbkaPhoxdkcbhoasceGTmekc9:hoxikabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekcbc99arao9Radcaadca0ESEhokavcj;ebf8Kjjjjbaok;xzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;siliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabavcefciGaiVcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:Ohkxekcjjjj94hkkabavcdfciGaiVcetfak87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:Ohqxekcjjjj94hqkabavcufciGaiVcetfaq87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohqxekcjjjj94hqkabavciGaiVcetfaq87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj;8ifcjjj98G::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklz9Kbb",f="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q;Aekr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq;a9tqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk;d8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhoaicefhldnadTmbaoc;WFbGgocjdaocjd6EhwcbhDinaDae9pmeawaeaD9RaDawfae6Egqcsfgoc9WGgkci2hxakcethmaocl4cifcd4hPabaDad2fhscbhzdnincehHalhOcbhAdninaraO9RaP6miavcj;cbfaAak2fhCaOaPfhlcbhidnakc;ab6mbaral9Rc;Gb6mbcbhoinaCaofhidndndndndnaOaoco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklbalczfhlkdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklzalczfhlkdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaialpbbbpklaalczfhlkdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaialpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalclfaYpQbfaXc:q:yjjbfRbbfhlxdkaialpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WalcwfaYpQbfaXc:q:yjjbfRbbfhlxekaialpbbbpkl8Walczfhlkaoc;abfhiaocjefak0meaihoaral9Rc;Fb0mbkkdndnaiak9pmbaici4hoinaral9RcK6mdaCaifhXdndndndndnaOaico4fRbbaocoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpklbxikaXalpbblalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalclfaYpQbfaKc:q:yjjbfRbbfhlxdkaXalpbbwalpbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbalcwfaYpQbfaKc:q:yjjbfRbbfhlxekaXalpbbbpklbalczfhlkaocdfhoaiczfgiak6mbkkalTmbaAci6hHalhOaAcefgAclSmdxekkcbhlaHceGmdkdnakTmbavcjdfazfhiavazfpbdbhYcbhXinaiavcj;cbfaXfgopblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLaoakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEaoamfpblbg3cep9Ta3aQp9op9Hp9rg3aoaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfgoaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaoadfgoaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaoadfgoaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaoadfgoaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaoadfhiaXczfgXak6mbkkazclfgzad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfhDc9:hoalmexikkc9:hoxekcbc99aral9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk;tzeHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhodnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhlindnaoaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfalaDcu7gPcl4fcsGcitfgsydlhzasydbhHdnaDcsGgDak9pmbavaiaPfcsGcdtfydbaxaDEhsaDThDdndnadcd9hmbabarcetfgPaH87ebaPcdfaz87ebaPclfas87ebxekabarcdtfgPaHBdbaPclfazBdbaPcwfasBdbkaxaDfhxavc;abfalcitfgPasBdbaPazBdlavaicdtfasBdbavc;abfalcefcsGglcitfgPaHBdbaPasBdlaiaDfhialcefhlxdkdndnaDcsSmbamaDfaDc987fcefhmxekaocefhDao8SbbgscFeGhPdndnascu9mmbaDhoxekaocvfhoaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhokaPce4cbaPceG9R7amfhmkdndnadcd9hmbabarcetfgDaH87ebaDcdfaz87ebaDclfam87ebxekabarcdtfgDaHBdbaDclfazBdbaDcwfamBdbkavc;abfalcitfgDamBdbaDazBdlavaicdtfamBdbavc;abfalcefcsGglcitfgDaHBdbaDamBdlaicefhialcefhlxekdnaDcpe0mbaxcefgOavaiaqaDcsGfRbbgscl49RcsGcdtfydbascz6gPEhDavaias9RcsGcdtfydbaOaPfgzascsGgOEhsaOThOdndnadcd9hmbabarcetfgHax87ebaHcdfaD87ebaHclfas87ebxekabarcdtfgHaxBdbaHclfaDBdbaHcwfasBdbkavaicdtfaxBdbavc;abfalcitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfalcefcsGcitfgHasBdbaHaDBdlavaiaPfcsGgicdtfasBdbavc;abfalcdfcsGglcitfgDaxBdbaDasBdlalcefhlaiaOfhiazaOfhxxekaxcbaoRbbgHEgAaDc;:eSgDfhzaHcsGhCaHcl4hXdndnaHcs0mbazcefhOxekazhOavaiaX9RcsGcdtfydbhzkdndnaCmbaOcefhxxekaOhxavaiaH9RcsGcdtfydbhOkdndnaDTmbaocefhDxekaocdfhDao8SbegPcFeGhsdnaPcu9kmbaocofhAascFbGhscrhodninaD8SbbgPcFbGaotasVhsaPcu9kmeaDcefhDaocrfgoc8J9hmbkaAhDxekaDcefhDkasce4cbasceG9R7amfgmhAkdndnaXcsSmbaDhsxekaDcefhsaD8SbbgocFeGhPdnaocu9kmbaDcvfhzaPcFbGhPcrhodninas8SbbgDcFbGaotaPVhPaDcu9kmeascefhsaocrfgoc8J9hmbkazhsxekascefhskaPce4cbaPceG9R7amfgmhzkdndnaCcsSmbashoxekascefhoas8SbbgDcFeGhPdnaDcu9kmbascvfhOaPcFbGhPcrhDdninao8SbbgscFbGaDtaPVhPascu9kmeaocefhoaDcrfgDc8J9hmbkaOhoxekaocefhokaPce4cbaPceG9R7amfgmhOkdndnadcd9hmbabarcetfgDaA87ebaDcdfaz87ebaDclfaO87ebxekabarcdtfgDaABdbaDclfazBdbaDcwfaOBdbkavc;abfalcitfgDazBdbaDaABdlavaicdtfaABdbavc;abfalcefcsGcitfgDaOBdbaDazBdlavaicefgicsGcdtfazBdbavc;abfalcdfcsGcitfgDaABdbaDaOBdlavaiaHcz6aXcsSVfgicsGcdtfaOBdbaiaCTaCcsSVfhialcifhlkawcefhwalcsGhlaicsGhiarcifgrae6mbkkcbc99aoaqSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalae9pmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oawaopmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalae9pmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eaDaopmbediwDqkzHOAKY8AEgoczp:Sep;6egrp;Geaoczp:Reczp:Sep;6egwp;Gep;Kep;Legopxb;:FSb;:FSb;:FSb;:FSawaopxbbbbbbbbbbbbbbbbp:2egqawpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegwawp;Meaoaop;Mearaqaramp9op9rp;Kegoaop;Mep;Kep;Kep;Jep;Negrp;Mepxbbn0bbn0bbn0bbn0gqp;Keczp:Reawarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9op9qgwaoarp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogopmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oawaopmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalae9pmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaqakp;Mearp;Keczp:ReaDakp;Mearp;Keamp9op9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepkbbadczfhdaeclfgeav6mbkkdnaval9pmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjZbbjZbbjZbbjZp:UepxbbjFbbjFbbjFbbjFp9op;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz9Tbb",m=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),v=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var y=WebAssembly.validate(m)?f:o,x,C=WebAssembly.instantiate(w(y),{}).then(function(R){x=R.instance,x.exports.__wasm_call_ctors()});function w(R){for(var O=new Uint8Array(R.length),F=0;F96?k-97:k>64?k-39:k+4}for(var U=0,F=0;F0?D(R,O,F,T[k],E[U]):C.then(function(){var G=new Uint8Array(R*O);return A(x.exports[T[k]],G,R,O,F,x.exports[E[U]]),G})}}}(),Z8i=function(){"use strict";var o="b9H79TebbbecD9Geueu9Geub9Gbb9Gquuuuuuu99uueu9Gvuuuuub9Gluuuue999Giuuue999Gluuuueu9Giuuueuimxdilvorbwwbewlve9Weiiviebeoweuecj;jekr7oo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95beX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbla9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbvl79IV9RboDwebcekdDqq:XJxdbkp8WiKuP99Hu8Jjjjjbcj;bb9Rgq8KjjjjbaqcKfcbc;Kbz1jjjb8AaqcualcdtgkalcFFFFi0Egxcbyd;S1jjbHjjjjbbgmBdKaqceBd94aqamBdwaqaxcbyd;S1jjbHjjjjbbgPBd3aqcdBd94aqaPBdxaqcuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbgsBdaaqciBd94aqasBdzaqcwfaeadalcbz:cjjjbaqaxcbyd;S1jjbHjjjjbbgzBd8KaqclBd94aqaxcbyd;S1jjbHjjjjbbgHBdyaqcvBd94alcd4alfhOcehAinaAgCcethAaCaO6mbkcbhXaqcuaCcdtgAaCcFFFFi0Ecbyd;S1jjbHjjjjbbgOBd8SaqcoBd94aOcFeaAz1jjjbhQdnalTmbavcd4hLaCcufhKinaiaXaL2cdtfgYydlgCcH4aC7c:F:b:DD2aYydbgCcH4aC7c;D;O:B8J27aYydwgCcH4aC7c:3F;N8N27hOcbhCdndninaQaOaKGgOcdtfg8AydbgAcuSmeaiaAaL2cdtfaYcxz:ljjjbTmdaCcefgCaOfhOaCaK9nmbxdkka8AaXBdbaXhAkazaXcdtfaABdbaXcefgXal9hmbkcbhCaHhAinaAaCBdbaAclfhAalaCcefgC9hmbkcbhCazhAaHhOindnaCaAydbgKSmbaOaHaKcdtfgKydbBdbaKaCBdbkaAclfhAaOclfhOalaCcefgC9hmbkkcbhOaqalcbyd;S1jjbHjjjjbbgYBd8WaqcrBd94aqaxcbyd;S1jjbHjjjjbbgCBd80aqcwBd94aqaxcbyd;S1jjbHjjjjbbgABdUaqcDBd94aCcFeakz1jjjbhEaAcFeakz1jjjbh3dnalTmbascwfh5indnamaOcdtgCfydbg8ETmbasaPaCfydbcitfh8Fa3aCfhaaEaCfhXcbhLindndna8FaLcitfydbgQaO9hmbaXaOBdbaaaOBdbxekdnamaQcdtgkfydbghTmbasaPakfydbcitgCfydbaOSmeahcufh8Aa5aCfhAcbhCina8AaCSmeaCcefhCaAydbhKaAcwfhAaKaO9hmbkaCah6meka3akfgCaOaQaCydbcuSEBdbaXaQaOaXydbcuSEBdbkaLcefgLa8E9hmbkkaOcefgOal9hmbkazhAaHhOa3hKaEhLcbhCindndnaCaAydbg8A9hmbdnaCaOydbg8A9hmbaLydbh8AdnaKydbgQcu9hmba8Acu9hmbaYaCfcb86bbxikaYaCfhXdnaCaQSmbaCa8ASmbaXce86bbxikaXcl86bbxdkdnaCaHa8AcdtgQfydb9hmbdnaKydbgXcuSmbaCaXSmbaLydbgkcuSmbaCakSmba3aQfydbg8EcuSmba8Ea8ASmbaEaQfydbgQcuSmbaQa8ASmbdnazaXcdtfydbazaQcdtfydb9hmbazakcdtfydbaza8Ecdtfydb9hmbaYaCfcd86bbxlkaYaCfcl86bbxikaYaCfcl86bbxdkaYaCfcl86bbxekaYaCfaYa8AfRbb86bbkaAclfhAaOclfhOaKclfhKaLclfhLalaCcefgC9hmbkawceGTmbaYhCalhAindnaCRbbce9hmbaCcl86bbkaCcefhCaAcufgAmbkkcbhLcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhmaqcKfaqyd94gCcdtfamBdbaqaCcefgABd94amaialavz:djjjb8AaqcKfaAcdtfcualc8S2gAalc;D;O;f8U0Ecbyd;S1jjbHjjjjbbgOBdbaqaCcdfBd94aOcbaAz1jjjbhsdnadTmbaehAindnamaAclfydbg8Acx2fgCIdbamaAydbgQcx2fgOIdbgg:tg8JamaAcwfydbgXcx2fgKIdlaOIdlg8K:tg8LNaKIdbag:tg8MaCIdla8K:tg8NN:tgyayNa8NaKIdwaOIdwg8P:tgINa8LaCIdwa8P:tg8NN:tg8La8LNa8Na8MNaIa8JN:tg8Ja8JNMM:rg8MJbbbb9ETmbaya8M:vhya8Ja8M:vh8Ja8La8M:vh8LkasazaQcdtfydbc8S2fgCa8La8M:rg8Ma8LNNg8NaCIdbMUdbaCa8Ja8Ma8JNg8RNgIaCIdlMUdlaCaya8MayNg8SNgRaCIdwMUdwaCa8Ra8LNg8RaCIdxMUdxaCa8Sa8LNg8UaCIdzMUdzaCa8Sa8JNg8SaCIdCMUdCaCa8La8Maya8PNa8LagNa8Ka8JNMM:mg8KNggNg8LaCIdKMUdKaCa8JagNg8JaCId3MUd3aCayagNgyaCIdaMUdaaCaga8KNggaCId8KMUd8KaCa8MaCIdyMUdyasaza8Acdtfydbc8S2fgCa8NaCIdbMUdbaCaIaCIdlMUdlaCaRaCIdwMUdwaCa8RaCIdxMUdxaCa8UaCIdzMUdzaCa8SaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCayaCIdaMUdaaCagaCId8KMUd8KaCa8MaCIdyMUdyasazaXcdtfydbc8S2fgCa8NaCIdbMUdbaCaIaCIdlMUdlaCaRaCIdwMUdwaCa8RaCIdxMUdxaCa8UaCIdzMUdzaCa8SaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCayaCIdaMUdaaCagaCId8KMUd8KaCa8MaCIdyMUdyaAcxfhAaLcifgLad6mbkcbh8AaehXincbhAinaYaeaAc:81jjbfydbgQa8AfcdtfydbgOfRbbhCdndnaYaXaAfydbgKfRbbgLc99fcFeGcpe0mbaCceSmbaCcd9hmekdnaLcufcFeGce0mbaEaKcdtfydbaO9hmekdnaCcufcFeGce0mba3aOcdtfydbaK9hmekdnaLcv2aCfc:G1jjbfRbbTmbazaOcdtfydbazaKcdtfydb0mekJbbacJbbjZaCceSEh8MaLceShkamaeaQcdtc:81jjbfydba8Afcdtfydbcx2fhCdnamaOcx2fgLIdwamaKcx2fgQIdwg8K:tg8La8LNaLIdbaQIdbg8P:tg8Ja8JNaLIdlaQIdlg8N:tgyayNMM:rggJbbbb9ETmba8Lag:vh8Layag:vhya8Jag:vh8JkJbbaca8MakEh8SdnaCIdwa8K:tg8Ma8La8Ma8LNaCIdba8P:tgRa8JNayaCIdla8N:tg8RNMMgIN:tg8Ma8MNaRa8JaIN:tg8La8LNa8RayaIN:tg8Ja8JNMM:rgyJbbbb9ETmba8May:vh8Ma8Jay:vh8Ja8Lay:vh8LkasazaKcdtfydbc8S2fgCa8La8SagNgya8LNNgIaCIdbMUdbaCa8Jaya8JNg8SNgRaCIdlMUdlaCa8Maya8MNggNg8RaCIdwMUdwaCa8Sa8LNg8SaCIdxMUdxaCaga8LNg8UaCIdzMUdzaCaga8JNg8VaCIdCMUdCaCa8Laya8Ma8KNa8La8PNa8Na8JNMM:mg8KNggNg8LaCIdKMUdKaCa8JagNg8JaCId3MUd3aCa8MagNg8MaCIdaMUdaaCaga8KNggaCId8KMUd8KaCayaCIdyMUdyasazaOcdtfydbc8S2fgCaIaCIdbMUdbaCaRaCIdlMUdlaCa8RaCIdwMUdwaCa8SaCIdxMUdxaCa8UaCIdzMUdzaCa8VaCIdCMUdCaCa8LaCIdKMUdKaCa8JaCId3MUd3aCa8MaCIdaMUdaaCagaCId8KMUd8KaCayaCIdyMUdykaAclfgAcx9hmbkaXcxfhXa8Acifg8Aad6mbkkdnabaeSmbabaeadcdtz:hjjjb8Akcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaaqcKfaqyd94gCcdtfaaBdbaqaCcefgABd94aqcKfaAcdtfcuadcdtadcFFFFi0Ecbyd;S1jjbHjjjjbbg5BdbaqaCcdfgABd94aqcKfaAcdtfaxcbyd;S1jjbHjjjjbbgiBdbaqaCcifgABd94aqcKfaAcdtfalcbyd;S1jjbHjjjjbbg8WBdbaqaCclfBd94JbbbbhRdnadao9nmbararNh8Saacwfh8Xaqydwh8Yaqydxh8Zaqydzh80JbbbbhRinaqcwfabadgPalazz:cjjjbcbhhabhXcbhkincbhCindnazaXaCfydbgOcdtgefydbgLazabaCc:81jjbfydbakfcdtfydbgAcdtfydbg8ASmbaYaAfRbbgQcv2aYaOfRbbgKfc;q1jjbfRbbg8FaKcv2aQfg8Ec;q1jjbfRbbgdVcFeGTmbdna8Ec:G1jjbfRbbTmba8AaL0mekdnaKaQ9hmbaKcufcFeGce0mbaEaefydbaA9hmekaaahcx2fgKaAaOadcFeGgLEBdlaKaOaAaLEBdbaKaLa8FGcb9hBdwahcefhhkaCclfgCcx9hmbkaXcxfhXakcifgkaP6mbkdndnahTmbaahAahh8AinaAcwfgQJbbbbJbbjZasazaAydbgOcdtfydbc8S2fgCIdyg8L:va8LJbbbb9BEaCIdwamaAclfgeydbgKcx2fgLIdwg8LNaCIdzaLIdbg8JNaCIdaMg8Ma8MMMa8LNaCIdlaLIdlg8MNaCIdCa8LNaCId3Mg8La8LMMa8MNaCIdba8JNaCIdxa8MNaCIdKMg8La8LMMa8JNaCId8KMMM:lNgyJbbbbJbbjZasazaKaOaQydbgLEgQcdtfydbc8S2fgCIdyg8L:va8LJbbbb9BEaCIdwamaOaKaLEgXcx2fgLIdwg8LNaCIdzaLIdbg8JNaCIdaMg8Ma8MMMa8LNaCIdlaLIdlg8MNaCIdCa8LNaCId3Mg8La8LMMa8MNaCIdba8JNaCIdxa8MNaCIdKMg8La8LMMa8JNaCId8KMMM:lNg8Laya8L9FgCEUdbaeaKaXaCEBdbaAaOaQaCEBdbaAcxfhAa8Acufg8Ambkaqcjefcbcj;abz1jjjb8Aa8XhCahhAinaqcjefaCydbcO4c;8ZGfgOaOydbcefBdbaCcxfhCaAcufgAmbkcbhCcbhAinaqcjefaCfgOydbhKaOaABdbaKaAfhAaCclfgCcj;ab9hmbkcbhCa8XhAinaqcjefaAydbcO4c;8ZGfgOaOydbgOcefBdba5aOcdtfaCBdbaAcxfhAahaCcefgC9hmbkaPao9RgOci9Uh81dnalTmbcbhCaihAinaAaCBdbaAclfhAalaCcefgC9hmbkkcbhBa8Wcbalz1jjjbh83aOcO9UhUa81ce4h85cbh86cbhkdninaaa5akcdtfydbcx2fgXIdwg8Ja8S9Emea86a819pmeJFFuuh8Ldna85ah9pmbaaa5a85cdtfydbcx2fIdwJbb;aZNh8Lkdna8Ja8L9ETmba86aU0mdkdna83azaXydlg87cdtg88fydbgOfg89Rbba83azaXydbgecdtg8:fydbgZfgnRbbVmbdna8YaZcdtgCfydbgKTmba80a8ZaCfydbcitfhCamaOcx2fg8Ecwfhda8EclfhxamaZcx2fg8Fcwfhva8FclfhwcbhAcehQdnindnaiaCydbcdtfydbgLaOSmbaiaCclfydbcdtfydbg8AaOSmbama8Acx2fg8AIdbamaLcx2fgLIdbg8M:tg8LawIdbaLIdlgy:tggNa8FIdba8M:tg8Ka8AIdlay:tg8JN:ta8LaxIdbay:tg8PNa8EIdba8M:tg8Na8JN:tNa8JavIdbaLIdwgy:tgINaga8AIdway:tg8MN:ta8JadIdbay:tgyNa8Pa8MN:tNa8Ma8KNaIa8LN:ta8Ma8NNaya8LN:tNMMJbbbb9DmdkaCcwfhCaAcefgAaK6hQaKaA9hmbkkaQceGTmba85cefh85xekaXcwfhKasaOc8S2fgCasaZc8S2fgAIdbaCIdbMUdbaCaAIdlaCIdlMUdlaCaAIdwaCIdwMUdwaCaAIdxaCIdxMUdxaCaAIdzaCIdzMUdzaCaAIdCaCIdCMUdCaCaAIdKaCIdKMUdKaCaAId3aCId3MUd3aCaAIdaaCIdaMUdaaCaAId8KaCId8KMUd8KaCaAIdyaCIdyMUdydndndndnaYaefgARbbc9:fPdebdkaehCinaiaCcdtgCfaOBdbaHaCfydbgCae9hmbxikkaHa88fydbhCaHa8:fydbheaia8:fa87BdbaCh87kaiaecdtfa87Bdbkance86bba89ce86bbaKIdbg8LaRaRa8L9DEhRaBcefhBcecdaARbbceSEa86fh86kakcefgkah9hmbkkaBTmbdnalTmbcbhAaEhCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmbaEaKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkcbhAa3hCindnaCydbgOcuSmbdnaAaiaOcdtgKfydbgO9hmba3aKfydbhOkaCaOBdbkaCclfhCalaAcefgA9hmbkkcbhdabhCcbhLindnaiaCydbcdtfydbgAaiaCclfydbcdtfydbgOSmbaAaiaCcwfydbcdtfydbgKSmbaOaKSmbabadcdtfg8AaABdba8AclfaOBdba8AcwfaKBdbadcifhdkaCcxfhCaLcifgLaP9pmdxbkkaPhdxdkadao0mbkkdnaDTmbaDaR:rUdbkaqyd94gCcdtaqcKffc98fhzdninaCTmeazydbcbyd;W1jjbH:bjjjbbazc98fhzaCcufhCxbkkaqcj;bbf8Kjjjjbadk;pleouabydbcbaicdtz1jjjb8Aadci9UhvdnadTmbabydbhodnalTmbaehradhwinaoalarydbcdtfydbcdtfgDaDydbcefBdbarclfhrawcufgwmbxdkkaehradhwinaoarydbcdtfgDaDydbcefBdbarclfhrawcufgwmbkkdnaiTmbabydbhrabydlhwcbhDaihoinawaDBdbawclfhwarydbaDfhDarclfhraocufgombkkdnadci6mbavceavce0EhqabydlhvabydwhrinaecwfydbhwaeclfydbhDaeydbhodnalTmbalawcdtfydbhwalaDcdtfydbhDalaocdtfydbhokaravaocdtfgdydbcitfaDBdbaradydbcitfawBdladadydbcefBdbaravaDcdtfgdydbcitfawBdbaradydbcitfaoBdladadydbcefBdbaravawcdtfgwydbcitfaoBdbarawydbcitfaDBdlawawydbcefBdbaecxfheaqcufgqmbkkdnaiTmbabydlhrabydbhwinararydbawydb9RBdbawclfhwarclfhraicufgimbkkk:3ldouv998Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdnadTmbaicd4hvdnabTmbavcdthocbhraehwinabarcx2fgiaearav2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinalczfaifgDawaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawaofhwarcefgrad9hmbxdkkavcdthrcbhwincbhiinalczfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbalaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbkkalIdbalIdzgk:tJbbbb:xgqalIdlalIdCgx:tgmamaq9DEgqalIdwalIdKgm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgiaqaiIdbax:tNUdbabcwfgiaqaiIdbam:tNUdbabcxfhbadcufgdmbkkaPk:Qdidui99ducbhi8Jjjjjbca9Rglczfcwfcbyd11jjbBdbalcb8Pdj1jjb83izalcwfcbydN1jjbBdbalcb8Pd:m1jjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgoaDIdbgrarao9EEUdbaladfgDaoaDIdbgrarao9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkavJbbbb:xgvaoaoav9DEgoararao9DEk9DeeuabcFeaicdtz1jjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;01jjbgeabcifc98GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;01jjbgeabcrfc94GfgbBd;01jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;01jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;01jjbfgdBd;01jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:cedbcjwk9PFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbeeebeebebbeeebebbbbbebebbbbbebbbdbbbbbbbbbbbbbbbeeeeebebbbbbebbbbbeebbbbbbc;Swkxebbbdbbbj9Kbb",f=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var m,v=WebAssembly.instantiate(y(o),{}).then(function(M){m=M.instance,m.exports.__wasm_call_ctors()});function y(M){for(var I=new Uint8Array(M.length),P=0;P96?D-97:D>64?D-39:D+4}for(var L=0,P=0;P=3),x(D%3==0),x(L>=0&&L<=1);for(var O=0,F=0;F<(R?R.length:0);++F)O|=S[R[F]];var k=M.BYTES_PER_ELEMENT==4?M:new Uint32Array(M),U=E(m.exports.meshopt_simplify,k,M.length,I,I.length/P,P*4,D,L,O);return U[0]=M instanceof Uint32Array?U[0]:new M.constructor(U[0]),U},getScale:function(M,I){return x(M instanceof Float32Array),x(M.length%I==0),T(m.exports.meshopt_simplifyScale,M,M.length/I,I*4)}}}();function f5(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.resourceCache,m=o.gltf,v=o.bufferViewId,y=o.gltfResource,x=o.baseResource,C=o.cacheKey,w=m.bufferViews[v],A=w.buffer,E=w.byteOffset,T=w.byteLength,S=!1,M,I,P,D;if(Gh(w,"EXT_meshopt_compression")){let R=w.extensions.EXT_meshopt_compression;A=R.buffer,E=Z(R.byteOffset,0),T=R.byteLength,S=!0,M=R.byteStride,I=R.count,P=R.mode,D=Z(R.filter,"NONE")}let L=m.buffers[A];this._hasMeshopt=S,this._meshoptByteStride=M,this._meshoptCount=I,this._meshoptMode=P,this._meshoptFilter=D,this._resourceCache=f,this._gltfResource=y,this._baseResource=x,this._buffer=L,this._bufferId=A,this._byteOffset=E,this._byteLength=T,this._cacheKey=C,this._bufferLoader=void 0,this._typedArray=void 0,this._state=la.UNLOADED,this._promise=void 0}N(Object.create)&&(f5.prototype=Object.create(W0.prototype),f5.prototype.constructor=f5);Object.defineProperties(f5.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function bjt(o){try{let f=wjt(o);if(o._bufferLoader=f,await f.load(),o.isDestroyed())return;let m=f.typedArray,v=new Uint8Array(m.buffer,m.byteOffset+o._byteOffset,o._byteLength);if(o.unload(),o._typedArray=v,o._hasMeshopt){let y=o._meshoptCount,x=o._meshoptByteStride,C=new Uint8Array(y*x);Cjt.decodeGltfBuffer(C,y,x,o._typedArray,o._meshoptMode,o._meshoptFilter),o._typedArray=C}return o._state=la.READY,o}catch(f){if(o.isDestroyed())return;o.unload(),o._state=la.FAILED;let m="Failed to load buffer view";throw o.getError(m,f)}}f5.prototype.load=async function(){return N(this._promise)?this._promise:(this._state=la.LOADING,this._promise=bjt(this),this._promise)};function wjt(o){let f=o._resourceCache,m=o._buffer;if(N(m.uri)){let v=o._baseResource.getDerivedResource({url:m.uri});return f.getExternalBufferLoader({resource:v})}return f.getEmbeddedBufferLoader({parentResource:o._gltfResource,bufferId:o._bufferId})}f5.prototype.unload=function(){N(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var ine=f5;function Av(){}Av._maxDecodingConcurrency=Math.max(pa.hardwareConcurrency-1,1);Av._decoderTaskProcessor=void 0;Av._taskProcessorReady=!1;Av._getDecoderTaskProcessor=function(){if(!N(Av._decoderTaskProcessor)){let o=new tp("decodeDraco",Av._maxDecodingConcurrency);o.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(){Av._taskProcessorReady=!0}),Av._decoderTaskProcessor=o}return Av._decoderTaskProcessor};Av.decodePointCloud=function(o){let f=Av._getDecoderTaskProcessor();if(Av._taskProcessorReady)return f.scheduleTask(o,[o.buffer.buffer])};Av.decodeBufferView=function(o){let f=Av._getDecoderTaskProcessor();if(Av._taskProcessorReady)return f.scheduleTask(o,[o.array.buffer])};var YY=Av;function $R(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.resourceCache,m=o.gltf,v=o.draco,y=o.gltfResource,x=o.baseResource,C=o.cacheKey;this._resourceCache=f,this._gltfResource=y,this._baseResource=x,this._gltf=m,this._draco=v,this._cacheKey=C,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=la.UNLOADED,this._promise=void 0,this._dracoError=void 0}N(Object.create)&&($R.prototype=Object.create(W0.prototype),$R.prototype.constructor=$R);Object.defineProperties($R.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function Ajt(o){let f=o._resourceCache;try{let m=f.getBufferViewLoader({gltf:o._gltf,bufferViewId:o._draco.bufferView,gltfResource:o._gltfResource,baseResource:o._baseResource});return o._bufferViewLoader=m,await m.load(),o.isDestroyed()?void 0:(o._bufferViewTypedArray=m.typedArray,o._state=la.PROCESSING,o)}catch(m){if(o.isDestroyed())return;PJe(o,m)}}$R.prototype.load=async function(){return N(this._promise)?this._promise:(this._state=la.LOADING,this._promise=Ajt(this),this._promise)};function PJe(o,f){o.unload(),o._state=la.FAILED;let m="Failed to load Draco";throw o.getError(m,f)}async function Ejt(o,f){try{let m=await f;return o.isDestroyed()?void 0:(o.unload(),o._decodedData={indices:m.indexArray,vertexAttributes:m.attributeData},o._state=la.READY,o._baseResource)}catch(m){if(o.isDestroyed())return;o._dracoError=m}}$R.prototype.process=function(o){if(this._state===la.READY)return!0;if(this._state!==la.PROCESSING||(N(this._dracoError)&&PJe(this,this._dracoError),!N(this._bufferViewTypedArray))||N(this._decodePromise))return!1;let f=this._draco,m=this._gltf.bufferViews,v=f.bufferView,y=m[v],x=f.attributes,C={array:new Uint8Array(this._bufferViewTypedArray),bufferView:y,compressedAttributes:x,dequantizeInShader:!0},w=YY.decodeBufferView(C);if(!N(w))return!1;this._decodePromise=Ejt(this,w)};$R.prototype.unload=function(){N(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0};var rne=$R;function Tjt(o){let f=o.uint8Array,m=o.format,v=o.request,y=Z(o.flipY,!1),x=Z(o.skipColorSpaceConversion,!1),C=new Blob([f],{type:m}),w;return Jr.supportsImageBitmapOptions().then(function(A){return A?Promise.resolve(Jr.createImageBitmapFromBlob(C,{flipY:y,premultiplyAlpha:!1,skipColorSpaceConversion:x})):(w=window.URL.createObjectURL(C),new Jr({url:w,request:v}).fetchImage({flipY:y,skipColorSpaceConversion:x}))}).then(function(A){return N(w)&&window.URL.revokeObjectURL(w),A}).catch(function(A){return N(w)&&window.URL.revokeObjectURL(w),Promise.reject(A)})}var nne=Tjt;function sM(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.resourceCache,m=o.gltf,v=o.imageId,y=o.gltfResource,x=o.baseResource,C=o.cacheKey,w=m.images[v],A=w.bufferView,E=w.uri;this._resourceCache=f,this._gltfResource=y,this._baseResource=x,this._gltf=m,this._bufferViewId=A,this._uri=E,this._cacheKey=C,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=la.UNLOADED,this._promise=void 0}N(Object.create)&&(sM.prototype=Object.create(W0.prototype),sM.prototype.constructor=sM);Object.defineProperties(sM.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});sM.prototype.load=function(){return N(this._promise)?this._promise:N(this._bufferViewId)?(this._promise=Sjt(this),this._promise):(this._promise=Pjt(this),this._promise)};function IJe(o){let f;return Array.isArray(o)&&(f=o.slice(1,o.length).map(function(m){return m.bufferView}),o=o[0]),{image:o,mipLevels:f}}async function Sjt(o){o._state=la.LOADING;let f=o._resourceCache;try{let m=f.getBufferViewLoader({gltf:o._gltf,bufferViewId:o._bufferViewId,gltfResource:o._gltfResource,baseResource:o._baseResource});if(o._bufferViewLoader=m,await m.load(),o.isDestroyed())return;let v=m.typedArray,y=await Mjt(v);if(o.isDestroyed())return;let x=IJe(y);return o.unload(),o._image=x.image,o._mipLevels=x.mipLevels,o._state=la.READY,o}catch(m){return o.isDestroyed()?void 0:MJe(o,m,"Failed to load embedded image")}}async function Pjt(o){o._state=la.LOADING;let f=o._baseResource,m=o._uri,v=f.getDerivedResource({url:m});try{let y=await Ljt(v);if(o.isDestroyed())return;let x=IJe(y);return o.unload(),o._image=x.image,o._mipLevels=x.mipLevels,o._state=la.READY,o}catch(y){return o.isDestroyed()?void 0:MJe(o,y,`Failed to load image: ${m}`)}}function MJe(o,f,m){return o.unload(),o._state=la.FAILED,Promise.reject(o.getError(m,f))}function Ijt(o){let f=o.subarray(0,2),m=o.subarray(0,4),v=o.subarray(8,12);if(f[0]===255&&f[1]===216)return"image/jpeg";if(f[0]===137&&f[1]===80)return"image/png";if(f[0]===171&&f[1]===75)return"image/ktx2";if(m[0]===82&&m[1]===73&&m[2]===70&&m[3]===70&&v[0]===87&&v[1]===69&&v[2]===66&&v[3]===80)return"image/webp";throw new sr("Image format is not recognized")}async function Mjt(o){let f=Ijt(o);if(f==="image/ktx2"){let m=new Uint8Array(o);return $3(m)}return sM._loadImageFromTypedArray({uint8Array:o,format:f,flipY:!1,skipColorSpaceConversion:!0})}var Djt=/(^data:image\/ktx2)|(\.ktx2$)/i;function Ljt(o){let f=o.getUrlComponent(!1,!0);return Djt.test(f)?$3(o):o.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}sM.prototype.unload=function(){N(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};sM._loadImageFromTypedArray=nne;var one=sM,Rjt={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},Zx=Object.freeze(Rjt);function e3(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.resourceCache,m=o.gltf,v=o.accessorId,y=o.gltfResource,x=o.baseResource,C=o.draco,w=o.cacheKey,A=Z(o.asynchronous,!0),E=Z(o.loadBuffer,!1),T=Z(o.loadTypedArray,!1),S=m.accessors[v].componentType;this._resourceCache=f,this._gltfResource=y,this._baseResource=x,this._gltf=m,this._accessorId=v,this._indexDatatype=S,this._draco=C,this._cacheKey=w,this._asynchronous=A,this._loadBuffer=E,this._loadTypedArray=T,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=la.UNLOADED,this._promise=void 0}N(Object.create)&&(e3.prototype=Object.create(W0.prototype),e3.prototype.constructor=e3);Object.defineProperties(e3.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var Ojt=new T1e;e3.prototype.load=async function(){return N(this._promise)?this._promise:N(this._draco)?(this._promise=Njt(this),this._promise):(this._promise=Fjt(this),this._promise)};async function Njt(o){o._state=la.LOADING;let f=o._resourceCache;try{let m=f.getDracoLoader({gltf:o._gltf,draco:o._draco,gltfResource:o._gltfResource,baseResource:o._baseResource});return o._dracoLoader=m,await m.load(),o.isDestroyed()?void 0:(o._state=la.LOADED,o)}catch(m){if(o.isDestroyed())return;E1e(o,m)}}async function Fjt(o){let f=o._gltf,m=o._accessorId,v=f.accessors[m].bufferView;o._state=la.LOADING;let y=o._resourceCache;try{let x=y.getBufferViewLoader({gltf:f,bufferViewId:v,gltfResource:o._gltfResource,baseResource:o._baseResource});if(o._bufferViewLoader=x,await x.load(),o.isDestroyed())return;let C=x.typedArray;return o._typedArray=Bjt(o,C),o._state=la.PROCESSING,o}catch(x){if(o.isDestroyed())return;E1e(o,x)}}function Bjt(o,f){let m=o._gltf,v=o._accessorId,y=m.accessors[v],x=y.count,C=y.componentType,w=ro.getSizeInBytes(C),A=f.buffer,E=f.byteOffset+y.byteOffset;if(E%w!==0){let S=x*w,M=new Uint8Array(A,E,S);A=new Uint8Array(M).buffer,E=0,mi("index-buffer-unaligned",`The index array is not aligned to a ${w}-byte boundary.`)}let T;return C===ro.UNSIGNED_BYTE?T=new Uint8Array(A,E,x):C===ro.UNSIGNED_SHORT?T=new Uint16Array(A,E,x):C===ro.UNSIGNED_INT&&(T=new Uint32Array(A,E,x)),T}function E1e(o,f){o.unload(),o._state=la.FAILED;let m="Failed to load index buffer";throw o.getError(m,f)}function T1e(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}T1e.prototype.set=function(o,f,m){this.typedArray=o,this.indexDatatype=f,this.context=m};T1e.prototype.execute=function(){this.buffer=DJe(this.typedArray,this.indexDatatype,this.context)};function DJe(o,f,m){let v=Ao.createIndexBuffer({typedArray:o,context:m,usage:gn.STATIC_DRAW,indexDatatype:f});return v.vertexArrayDestroyable=!1,v}e3.prototype.process=function(o){if(this._state===la.READY)return!0;if(this._state!==la.LOADED&&this._state!==la.PROCESSING)return!1;let f=this._typedArray,m=this._indexDatatype;if(N(this._dracoLoader))try{this._dracoLoader.process(o)&&(f=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=f,m=Rt.fromTypedArray(f),this._indexDatatype=m)}catch(y){E1e(this,y)}if(!N(f))return!1;let v;if(this._loadBuffer&&this._asynchronous){let y=Ojt;if(y.set(f,m,o.context),!o.jobScheduler.execute(y,Zx.BUFFER))return!1;v=y.buffer}else this._loadBuffer&&(v=DJe(f,m,o.context));return this.unload(),this._buffer=v,this._typedArray=this._loadTypedArray?f:void 0,this._state=la.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};e3.prototype.unload=function(){N(this._buffer)&&this._buffer.destroy();let o=this._resourceCache;N(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&o.unload(this._bufferViewLoader),N(this._dracoLoader)&&o.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0};var ane=e3;function kjt(o,f,m){if(m=Z(m,!1),m){let v=o.indexOf(f);if(v>-1)return v}return o.push(f),o.length-1}var F1=kjt;function Vjt(o,f){return N(o.extensionsUsed)&&o.extensionsUsed.indexOf(f)>=0}var ug=Vjt;function da(){}da.objectLegacy=function(o,f){if(N(o)){for(let m in o)if(Object.prototype.hasOwnProperty.call(o,m)){let v=o[m],y=f(v,m);if(N(y))return y}}};da.object=function(o,f){if(N(o)){let m=o.length;for(let v=0;v0)return v.byteStride}return Rt.getSizeInBytes(f.componentType)*MB(f.type)}var fO=Hjt;function Ujt(o){an.accessor(o,function(m){N(m.bufferView)&&(m.byteOffset=Z(m.byteOffset,0))}),an.bufferView(o,function(m){N(m.buffer)&&(m.byteOffset=Z(m.byteOffset,0))}),an.mesh(o,function(m){an.meshPrimitive(m,function(v){if(v.mode=Z(v.mode,xi.TRIANGLES),!N(v.material)){N(o.materials)||(o.materials=[]);let y={name:"default"};v.material=F1(o.materials,y)}})}),an.accessorContainingVertexAttributeData(o,function(m){let v=o.accessors[m],y=v.bufferView;if(v.normalized=Z(v.normalized,!1),N(y)){let x=o.bufferViews[y];x.byteStride=fO(o,v),x.target=xi.ARRAY_BUFFER}}),an.accessorContainingIndexData(o,function(m){let v=o.accessors[m].bufferView;if(N(v)){let y=o.bufferViews[v];y.target=xi.ELEMENT_ARRAY_BUFFER}}),an.material(o,function(m){let v=Z(m.extensions,Z.EMPTY_OBJECT),y=v.KHR_materials_common;if(N(y)){let A=y.technique,E=N(y.values)?y.values:{};y.values=E,E.ambient=N(E.ambient)?E.ambient:[0,0,0,1],E.emission=N(E.emission)?E.emission:[0,0,0,1],E.transparency=Z(E.transparency,1),A!=="CONSTANT"&&(E.diffuse=N(E.diffuse)?E.diffuse:[0,0,0,1],A!=="LAMBERT"&&(E.specular=N(E.specular)?E.specular:[0,0,0,1],E.shininess=Z(E.shininess,0))),y.transparent=Z(y.transparent,!1),y.doubleSided=Z(y.doubleSided,!1);return}m.emissiveFactor=Z(m.emissiveFactor,[0,0,0]),m.alphaMode=Z(m.alphaMode,"OPAQUE"),m.doubleSided=Z(m.doubleSided,!1),m.alphaMode==="MASK"&&(m.alphaCutoff=Z(m.alphaCutoff,.5));let x=v.KHR_techniques_webgl;N(x)&&an.materialValue(m,function(A){N(A.index)&&PF(A)}),PF(m.emissiveTexture),PF(m.normalTexture),PF(m.occlusionTexture);let C=m.pbrMetallicRoughness;N(C)&&(C.baseColorFactor=Z(C.baseColorFactor,[1,1,1,1]),C.metallicFactor=Z(C.metallicFactor,1),C.roughnessFactor=Z(C.roughnessFactor,1),PF(C.baseColorTexture),PF(C.metallicRoughnessTexture));let w=v.KHR_materials_pbrSpecularGlossiness;N(w)&&(w.diffuseFactor=Z(w.diffuseFactor,[1,1,1,1]),w.specularFactor=Z(w.specularFactor,[1,1,1]),w.glossinessFactor=Z(w.glossinessFactor,1),PF(w.specularGlossinessTexture))}),an.animation(o,function(m){an.animationSampler(m,function(v){v.interpolation=Z(v.interpolation,"LINEAR")})});let f=Gjt(o);return an.node(o,function(m,v){N(f[v])||N(m.translation)||N(m.rotation)||N(m.scale)?(m.translation=Z(m.translation,[0,0,0]),m.rotation=Z(m.rotation,[0,0,0,1]),m.scale=Z(m.scale,[1,1,1])):m.matrix=Z(m.matrix,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}),an.sampler(o,function(m){m.wrapS=Z(m.wrapS,xi.REPEAT),m.wrapT=Z(m.wrapT,xi.REPEAT)}),N(o.scenes)&&!N(o.scene)&&(o.scene=0),o}function Gjt(o){let f={};return an.animation(o,function(m){an.animationChannel(m,function(v){let y=v.target,x=y.node,C=y.path;(C==="translation"||C==="rotation"||C==="scale")&&(f[x]=!0)})}),f}function PF(o){N(o)&&(o.texCoord=Z(o.texCoord,0))}var S1e=Ujt;function Wjt(o){return an.shader(o,function(f){tZ(f)}),an.buffer(o,function(f){tZ(f)}),an.image(o,function(f){tZ(f)}),tZ(o),o}function tZ(o){o.extras=N(o.extras)?o.extras:{},o.extras._pipeline=N(o.extras._pipeline)?o.extras._pipeline:{}}var qY=Wjt;function jjt(o,f){let m=o.extensionsRequired;if(N(m)){let v=m.indexOf(f);v>=0&&m.splice(v,1),m.length===0&&delete o.extensionsRequired}}var P1e=jjt;function Yjt(o,f){let m=o.extensionsUsed;if(N(m)){let v=m.indexOf(f);v>=0&&m.splice(v,1),P1e(o,f),m.length===0&&delete o.extensionsUsed}}var sne=Yjt,qjt=4;function Xjt(o){if(HU(o)!=="glTF")throw new sr("File is not valid binary glTF");let f=LJe(o,0,5),m=f[1];if(m!==1&&m!==2)throw new sr("Binary glTF version is not 1 or 2");return m===1?Jjt(o,f):Kjt(o,f)}function LJe(o,f,m){let v=new DataView(o.buffer),y=new Array(m);for(let x=0;x0){let T=Z(E.binary_glTF,E.KHR_binary_glTF);N(T)&&(T.extras._pipeline.source=A,delete T.uri)}return sne(w,"KHR_binary_glTF"),w}function Kjt(o,f){let m=f[2],v=12,y,x;for(;v0){let w=C[0];w.extras._pipeline.source=x}}return y}var I1e=Xjt;function Qjt(o){return an.shader(o,function(f){iZ(f)}),an.buffer(o,function(f){iZ(f)}),an.image(o,function(f){iZ(f)}),iZ(o),o}function iZ(o){N(o.extras)&&(N(o.extras._pipeline)&&delete o.extras._pipeline,Object.keys(o.extras).length===0&&delete o.extras)}var M1e=Qjt;function Zjt(o,f){let m=o.extensionsUsed;N(m)||(m=[],o.extensionsUsed=m),F1(m,f,!0)}var DB=Zjt;function $jt(o){switch(o){case Rt.BYTE:return function(f,m,v,y,x){for(let C=0;C-1:!1}var rYt=[xi.ZERO,xi.ONE,xi.SRC_COLOR,xi.ONE_MINUS_SRC_COLOR,xi.SRC_ALPHA,xi.ONE_MINUS_SRC_ALPHA,xi.DST_ALPHA,xi.ONE_MINUS_DST_ALPHA,xi.DST_COLOR,xi.ONE_MINUS_DST_COLOR];function nYt(o,f){if(!N(o))return f;for(let m=0;m<4;m++)if(rYt.indexOf(o[m])===-1)return f;return o}function oYt(o){let f={},m={},v=o.techniques;return N(v)&&(an.technique(o,function(y,x){let C=y.states;if(N(C)){let w=m[x]={};if(yke(C,xi.BLEND)){w.alphaMode="BLEND";let A=C.functions;N(A)&&(N(A.blendEquationSeparate)||N(A.blendFuncSeparate))&&(f[x]={blendEquation:Z(A.blendEquationSeparate,tYt),blendFactors:nYt(A.blendFuncSeparate,iYt)})}yke(C,xi.CULL_FACE)||(w.doubleSided=!0),delete y.states}}),Object.keys(f).length>0&&(N(o.extensions)||(o.extensions={}),DB(o,"KHR_blend")),an.material(o,function(y){if(N(y.technique)){let x=m[y.technique];an.objectLegacy(x,function(w,A){y[A]=w});let C=f[y.technique];N(C)&&(N(y.extensions)||(y.extensions={}),y.extensions.KHR_blend=C)}})),o}var D1e=oYt;function aYt(o,f){let m=o.extensionsRequired;N(m)||(m=[],o.extensionsRequired=m),F1(m,f,!0),DB(o,f)}var L1e=aYt;function sYt(o){let f=o.techniques,m={},v={},y={};if(N(f)){let x={programs:[],shaders:[],techniques:[]},C=o.glExtensionsUsed;delete o.glExtensionsUsed,an.technique(o,function(w,A){let E={name:w.name,program:void 0,attributes:{},uniforms:{}},T;if(an.techniqueAttribute(w,function(S,M){T=w.parameters[S],E.attributes[M]={semantic:T.semantic}}),an.techniqueUniform(w,function(S,M){T=w.parameters[S],E.uniforms[M]={count:T.count,node:T.node,type:T.type,semantic:T.semantic,value:T.value},N(m[A])||(m[A]={}),m[A][S]=M}),N(y[w.program]))E.program=y[w.program];else{let S=o.programs[w.program],M={name:S.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:C},I=o.shaders[S.fragmentShader];M.fragmentShader=F1(x.shaders,I,!0);let P=o.shaders[S.vertexShader];M.vertexShader=F1(x.shaders,P,!0),E.program=F1(x.programs,M),y[w.program]=E.program}v[A]=F1(x.techniques,E)}),x.techniques.length>0&&(N(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=x,DB(o,"KHR_techniques_webgl"),L1e(o,"KHR_techniques_webgl"))}return an.material(o,function(x){if(N(x.technique)){let C={technique:v[x.technique]};an.objectLegacy(x.values,function(w,A){N(C.values)||(C.values={});let E=m[x.technique][A];N(E)&&(C.values[E]=w)}),N(x.extensions)||(x.extensions={}),x.extensions.KHR_techniques_webgl=C}delete x.technique,delete x.values}),delete o.techniques,delete o.programs,delete o.shaders,o}var R1e=sYt;function lYt(o,f){kh.typeOf.object("material",o),kh.defined("handler",f);let m=o.pbrMetallicRoughness;if(N(m)){if(N(m.baseColorTexture)){let y=m.baseColorTexture,x=f(y.index,y);if(N(x))return x}if(N(m.metallicRoughnessTexture)){let y=m.metallicRoughnessTexture,x=f(y.index,y);if(N(x))return x}}if(N(o.extensions)){let y=o.extensions.KHR_materials_pbrSpecularGlossiness;if(N(y)){if(N(y.diffuseTexture)){let C=y.diffuseTexture,w=f(C.index,C);if(N(w))return w}if(N(y.specularGlossinessTexture)){let C=y.specularGlossinessTexture,w=f(C.index,C);if(N(w))return w}}let x=o.extensions.KHR_materials_common;if(N(x)&&N(x.values)){let C=x.values.diffuse,w=x.values.ambient,A=x.values.emission,E=x.values.specular;if(N(C)&&N(C.index)){let T=f(C.index,C);if(N(T))return T}if(N(w)&&N(w.index)){let T=f(w.index,w);if(N(T))return T}if(N(A)&&N(A.index)){let T=f(A.index,A);if(N(T))return T}if(N(E)&&N(E.index)){let T=f(E.index,E);if(N(T))return T}}}let v=an.materialValue(o,function(y){if(N(y.index)){let x=f(y.index,y);if(N(x))return x}});if(N(v))return v;if(N(o.emissiveTexture)){let y=o.emissiveTexture,x=f(y.index,y);if(N(x))return x}if(N(o.normalTexture)){let y=o.normalTexture,x=f(y.index,y);if(N(x))return x}if(N(o.occlusionTexture)){let y=o.occlusionTexture,x=f(y.index,y);if(N(x))return x}}var lne=lYt,xke=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function uYt(o,f){return f=Z(f,xke),xke.forEach(function(m){f.indexOf(m)>-1&&hYt(o,m)}),o}var cYt={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function hYt(o,f){let m=cYt[f],v=o[m];if(N(v)){let y=0,x=aP[f](o),C=v.length;for(let w=0;wf&&v.attributes[C]--}),an.meshPrimitiveTarget(v,function(x){an.meshPrimitiveTargetAttribute(x,function(C,w){C>f&&x[w]--})});let y=v.indices;N(y)&&y>f&&v.indices--})}),an.skin(o,function(m){N(m.inverseBindMatrices)&&m.inverseBindMatrices>f&&m.inverseBindMatrices--}),an.animation(o,function(m){an.animationSampler(m,function(v){N(v.input)&&v.input>f&&v.input--,N(v.output)&&v.output>f&&v.output--})})};oP.buffer=function(o,f){o.buffers.splice(f,1),an.bufferView(o,function(m){N(m.buffer)&&m.buffer>f&&m.buffer--,N(m.extensions)&&N(m.extensions.EXT_meshopt_compression)&&m.extensions.EXT_meshopt_compression.buffer--})};oP.bufferView=function(o,f){if(o.bufferViews.splice(f,1),an.accessor(o,function(m){N(m.bufferView)&&m.bufferView>f&&m.bufferView--}),an.shader(o,function(m){N(m.bufferView)&&m.bufferView>f&&m.bufferView--}),an.image(o,function(m){N(m.bufferView)&&m.bufferView>f&&m.bufferView--}),ug(o,"KHR_draco_mesh_compression")&&an.mesh(o,function(m){an.meshPrimitive(m,function(v){N(v.extensions)&&N(v.extensions.KHR_draco_mesh_compression)&&v.extensions.KHR_draco_mesh_compression.bufferView>f&&v.extensions.KHR_draco_mesh_compression.bufferView--})}),ug(o,"EXT_feature_metadata")){let m=o.extensions.EXT_feature_metadata.featureTables;for(let v in m)if(m.hasOwnProperty(v)){let y=m[v].properties;if(N(y)){for(let x in y)if(y.hasOwnProperty(x)){let C=y[x];N(C.bufferView)&&C.bufferView>f&&C.bufferView--,N(C.arrayOffsetBufferView)&&C.arrayOffsetBufferView>f&&C.arrayOffsetBufferView--,N(C.stringOffsetBufferView)&&C.stringOffsetBufferView>f&&C.stringOffsetBufferView--}}}}if(ug(o,"EXT_structural_metadata")){let m=o.extensions.EXT_structural_metadata.propertyTables;if(N(m)){let v=m.length;for(let y=0;yf&&w.values--,N(w.arrayOffsets)&&w.arrayOffsets>f&&w.arrayOffsets--,N(w.stringOffsets)&&w.stringOffsets>f&&w.stringOffsets--}}}}};oP.image=function(o,f){o.images.splice(f,1),an.texture(o,function(m){N(m.source)&&m.source>f&&--m.source;let v=m.extensions;N(v)&&N(v.EXT_texture_webp)&&v.EXT_texture_webp.source>f?--m.extensions.EXT_texture_webp.source:N(v)&&N(v.KHR_texture_basisu)&&v.KHR_texture_basisu.source>f&&--m.extensions.KHR_texture_basisu.source})};oP.mesh=function(o,f){o.meshes.splice(f,1),an.node(o,function(m){N(m.mesh)&&(m.mesh>f?m.mesh--:m.mesh===f&&delete m.mesh)})};oP.node=function(o,f){o.nodes.splice(f,1),an.skin(o,function(m){N(m.skeleton)&&m.skeleton>f&&m.skeleton--,m.joints=m.joints.map(function(v){return v>f?v-1:v})}),an.animation(o,function(m){an.animationChannel(m,function(v){N(v.target)&&N(v.target.node)&&v.target.node>f&&v.target.node--})}),an.technique(o,function(m){an.techniqueUniform(m,function(v){N(v.node)&&v.node>f&&v.node--})}),an.node(o,function(m){N(m.children)&&(m.children=m.children.filter(function(v){return v!==f}).map(function(v){return v>f?v-1:v}))}),an.scene(o,function(m){m.nodes=m.nodes.filter(function(v){return v!==f}).map(function(v){return v>f?v-1:v})})};oP.material=function(o,f){o.materials.splice(f,1),an.mesh(o,function(m){an.meshPrimitive(m,function(v){N(v.material)&&v.material>f&&v.material--})})};oP.sampler=function(o,f){o.samplers.splice(f,1),an.texture(o,function(m){N(m.sampler)&&m.sampler>f&&--m.sampler})};oP.texture=function(o,f){if(o.textures.splice(f,1),an.material(o,function(m){lne(m,function(v,y){y.index>f&&--y.index})}),ug(o,"EXT_feature_metadata")){an.mesh(o,function(v){an.meshPrimitive(v,function(y){let x=y.extensions;if(N(x)&&N(x.EXT_feature_metadata)){let C=x.EXT_feature_metadata.featureIdTextures;if(N(C)){let w=C.length;for(let A=0;Af&&--E.index}}}})});let m=o.extensions.EXT_feature_metadata.featureTextures;for(let v in m)if(m.hasOwnProperty(v)){let y=m[v].properties;if(N(y)){for(let x in y)if(y.hasOwnProperty(x)){let C=y[x].texture;C.index>f&&--C.index}}}}if(ug(o,"EXT_mesh_features")&&an.mesh(o,function(m){an.meshPrimitive(m,function(v){let y=v.extensions;if(N(y)&&N(y.EXT_mesh_features)){let x=y.EXT_mesh_features.featureIds;if(N(x)){let C=x.length;for(let w=0;wf&&--A.texture.index}}}})}),ug(o,"EXT_structural_metadata")){let m=o.extensions.EXT_structural_metadata.propertyTextures;if(N(m)){let v=m.length;for(let y=0;yf&&--w.index}}}}};function aP(){}aP.accessor=function(o){let f={};return an.mesh(o,function(m){an.meshPrimitive(m,function(v){an.meshPrimitiveAttribute(v,function(x){f[x]=!0}),an.meshPrimitiveTarget(v,function(x){an.meshPrimitiveTargetAttribute(x,function(C){f[C]=!0})});let y=v.indices;N(y)&&(f[y]=!0)})}),an.skin(o,function(m){N(m.inverseBindMatrices)&&(f[m.inverseBindMatrices]=!0)}),an.animation(o,function(m){an.animationSampler(m,function(v){N(v.input)&&(f[v.input]=!0),N(v.output)&&(f[v.output]=!0)})}),ug(o,"EXT_mesh_gpu_instancing")&&an.node(o,function(m){N(m.extensions)&&N(m.extensions.EXT_mesh_gpu_instancing)&&Object.keys(m.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(v){let y=m.extensions.EXT_mesh_gpu_instancing.attributes[v];f[y]=!0})}),f};aP.buffer=function(o){let f={};return an.bufferView(o,function(m){N(m.buffer)&&(f[m.buffer]=!0),N(m.extensions)&&N(m.extensions.EXT_meshopt_compression)&&(f[m.extensions.EXT_meshopt_compression.buffer]=!0)}),f};aP.bufferView=function(o){let f={};if(an.accessor(o,function(m){N(m.bufferView)&&(f[m.bufferView]=!0)}),an.shader(o,function(m){N(m.bufferView)&&(f[m.bufferView]=!0)}),an.image(o,function(m){N(m.bufferView)&&(f[m.bufferView]=!0)}),ug(o,"KHR_draco_mesh_compression")&&an.mesh(o,function(m){an.meshPrimitive(m,function(v){N(v.extensions)&&N(v.extensions.KHR_draco_mesh_compression)&&(f[v.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),ug(o,"EXT_feature_metadata")){let m=o.extensions.EXT_feature_metadata.featureTables;for(let v in m)if(m.hasOwnProperty(v)){let y=m[v].properties;if(N(y)){for(let x in y)if(y.hasOwnProperty(x)){let C=y[x];N(C.bufferView)&&(f[C.bufferView]=!0),N(C.arrayOffsetBufferView)&&(f[C.arrayOffsetBufferView]=!0),N(C.stringOffsetBufferView)&&(f[C.stringOffsetBufferView]=!0)}}}}if(ug(o,"EXT_structural_metadata")){let m=o.extensions.EXT_structural_metadata.propertyTables;if(N(m)){let v=m.length;for(let y=0;y0&&(f[m.mesh]=!0)}}),f};function RJe(o,f,m){let v=o.nodes[f];return N(v.mesh)||N(v.camera)||N(v.skin)||N(v.weights)||N(v.extras)||N(v.extensions)&&Object.keys(v.extensions).length!==0||N(m[f])?!1:!N(v.children)||v.children.filter(function(y){return!RJe(o,y,m)}).length===0}aP.node=function(o){let f={};return an.skin(o,function(m){N(m.skeleton)&&(f[m.skeleton]=!0),an.skinJoint(m,function(v){f[v]=!0})}),an.animation(o,function(m){an.animationChannel(m,function(v){N(v.target)&&N(v.target.node)&&(f[v.target.node]=!0)})}),an.technique(o,function(m){an.techniqueUniform(m,function(v){N(v.node)&&(f[v.node]=!0)})}),an.node(o,function(m,v){RJe(o,v,f)||(f[v]=!0)}),f};aP.material=function(o){let f={};return an.mesh(o,function(m){an.meshPrimitive(m,function(v){N(v.material)&&(f[v.material]=!0)})}),f};aP.texture=function(o){let f={};if(an.material(o,function(m){lne(m,function(v){f[v]=!0})}),ug(o,"EXT_feature_metadata")){an.mesh(o,function(v){an.meshPrimitive(v,function(y){let x=y.extensions;if(N(x)&&N(x.EXT_feature_metadata)){let C=x.EXT_feature_metadata.featureIdTextures;if(N(C)){let w=C.length;for(let A=0;A0)for(C.mesh=m.meshes[A[0]],f=1;f0&&N(C.skin)){let E=o.skins[C.skin];E.skeleton=m.nodes[A[0]]}delete C.skeletons}N(C.jointName)&&delete C.jointName}),an.skin(o,function(C){N(C.inverseBindMatrices)&&(C.inverseBindMatrices=m.accessors[C.inverseBindMatrices]);let w=C.jointNames;if(N(w)){let A=[],E=w.length;for(f=0;f=0&&(w=x.substring(0,C),A=x.substring(C));let E,T=OYt[w];N(T)?(E=T+A,f[x]=E):N(RYt[w])||(E=`_${x}`,f[x]=E)}});for(let y in f)if(Object.prototype.hasOwnProperty.call(f,y)){let x=f[y],C=v.attributes[y];N(C)&&(delete v.attributes[y],v.attributes[x]=C)}})}),an.technique(o,function(m){an.techniqueParameter(m,function(v){let y=f[v.semantic];N(y)&&(v.semantic=y)})})}function FYt(o){an.camera(o,function(f){let m=f.perspective;if(N(m)){let v=m.aspectRatio;N(v)&&v===0&&delete m.aspectRatio;let y=m.yfov;N(y)&&y===0&&(m.yfov=1)}})}function rge(o,f){return N(f.byteStride)&&f.byteStride!==0?f.byteStride:fO(o,f)}function BYt(o){an.buffer(o,function(f){N(f.byteLength)||(f.byteLength=f.extras._pipeline.source.length)}),an.accessor(o,function(f){let m=f.bufferView;if(N(m)){let v=o.bufferViews[m],y=rge(o,f),x=f.byteOffset+f.count*y;v.byteLength=Math.max(Z(v.byteLength,0),x)}})}function kYt(o){let f,m,v,y=o.bufferViews,x={};an.accessorContainingVertexAttributeData(o,function(w){let A=o.accessors[w];N(A.bufferView)&&(x[A.bufferView]=!0)});let C={};an.accessor(o,function(w){N(w.bufferView)&&(C[w.bufferView]=Z(C[w.bufferView],[]),C[w.bufferView].push(w))});for(let w in C)if(Object.prototype.hasOwnProperty.call(C,w)){v=y[w];let A=C[w];A.sort(function(M,I){return M.byteOffset-I.byteOffset});let E=0,T=0,S=A.length;for(f=0;f=0;--x)if(v[x]===f){v.splice(x,1);return}}}),an.node(o,function(m,v){if(N(m.children)){let y=m.children.indexOf(f);y>-1&&(m.children.splice(y,1),NJe(m)&&FJe(o,v))}}),delete o.nodes[f]}function zYt(o){return an.node(o,function(f,m){NJe(f)&&FJe(o,m)}),o}function HYt(o){an.animation(o,function(f){an.animationSampler(f,function(m){let v=o.accessors[m.input];if(!N(v.min)||!N(v.max)){let y=JY(o,v);v.min=y.min,v.max=y.max}})})}function UYt(o){an.accessor(o,function(f){if(N(f.min)||N(f.max)){let m=JY(o,f);N(f.min)&&(f.min=m.min),N(f.max)&&(f.max=m.max)}})}function GYt(o){o.asset=Z(o.asset,{}),o.asset.version="2.0",OJe(o),wYt(o),zYt(o),AYt(o),EYt(o),SYt(o),IYt(o),BYt(o),kYt(o),VYt(o),HYt(o),UYt(o),MYt(o),DYt(o),LYt(o),NYt(o),B1e(o),FYt(o),D1e(o),R1e(o),TYt(o)}var WYt=["u_tex","u_diffuse","u_emission"],jYt=["u_diffuse"];function nge(o){o.pbrMetallicRoughness=N(o.pbrMetallicRoughness)?o.pbrMetallicRoughness:{},o.pbrMetallicRoughness.roughnessFactor=1,o.pbrMetallicRoughness.metallicFactor=0}function J$(o){return N(o.index)}function K$(o){return Array.isArray(o)&&o.length===4}function BJe(o){let f=new Array(4);f[3]=o[3];for(let m=0;m<3;m++){let v=o[m];v<=.04045?f[m]=o[m]*.07739938080495357:f[m]=Math.pow((v+.055)*.9478672985781991,2.4)}return f}function YYt(o){an.material(o,function(f){an.materialValue(f,function(m,v){WYt.indexOf(v)!==-1&&J$(m)?(nge(f),f.pbrMetallicRoughness.baseColorTexture=m):jYt.indexOf(v)!==-1&&K$(m)&&(nge(f),f.pbrMetallicRoughness.baseColorFactor=BJe(m))})}),nj(o,"KHR_techniques_webgl"),nj(o,"KHR_blend")}function qYt(o){an.material(o,function(f){let m=Z(f.extensions,Z.EMPTY_OBJECT).KHR_materials_common;if(N(m)){m.technique==="CONSTANT"&&(DB(o,"KHR_materials_unlit"),f.extensions=N(f.extensions)?f.extensions:{},f.extensions.KHR_materials_unlit={});let v=N(m.values)?m.values:{},y=v.ambient,x=v.diffuse,C=v.emission,w=v.transparency,A=m.doubleSided,E=m.transparent;nge(f),N(y)&&(K$(y)?f.emissiveFactor=y.slice(0,3):J$(y)&&(f.emissiveTexture=y)),N(x)&&(K$(x)?f.pbrMetallicRoughness.baseColorFactor=BJe(x):J$(x)&&(f.pbrMetallicRoughness.baseColorTexture=x)),N(A)&&(f.doubleSided=A),N(C)&&(K$(C)?f.emissiveFactor=C.slice(0,3):J$(C)&&(f.emissiveTexture=C)),N(w)&&(N(f.pbrMetallicRoughness.baseColorFactor)?f.pbrMetallicRoughness.baseColorFactor[3]*=w:f.pbrMetallicRoughness.baseColorFactor=[1,1,1,w]),N(E)&&(f.alphaMode=E?"BLEND":"OPAQUE")}}),nj(o,"KHR_materials_common")}var k1e=_Yt,_u={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function XYt(o){switch(o){case _u.POSITION:return"positionMC";case _u.NORMAL:return"normalMC";case _u.TANGENT:return"tangentMC";case _u.TEXCOORD:return"texCoord";case _u.COLOR:return"color";case _u.JOINTS:return"joints";case _u.WEIGHTS:return"weights";case _u.FEATURE_ID:return"featureId"}}_u.hasSetIndex=function(o){switch(o){case _u.POSITION:case _u.NORMAL:case _u.TANGENT:return!1;case _u.TEXCOORD:case _u.COLOR:case _u.JOINTS:case _u.WEIGHTS:case _u.FEATURE_ID:return!0}};_u.fromGltfSemantic=function(o){let f=o,m=/^(\w+)_\d+$/.exec(o);switch(m!==null&&(f=m[1]),f){case"POSITION":return _u.POSITION;case"NORMAL":return _u.NORMAL;case"TANGENT":return _u.TANGENT;case"TEXCOORD":return _u.TEXCOORD;case"COLOR":return _u.COLOR;case"JOINTS":return _u.JOINTS;case"WEIGHTS":return _u.WEIGHTS;case"_FEATURE_ID":return _u.FEATURE_ID}};_u.fromPntsSemantic=function(o){switch(o){case"POSITION":case"POSITION_QUANTIZED":return _u.POSITION;case"RGBA":case"RGB":case"RGB565":return _u.COLOR;case"NORMAL":case"NORMAL_OCT16P":return _u.NORMAL;case"BATCH_ID":return _u.FEATURE_ID}};_u.getGlslType=function(o){switch(o){case _u.POSITION:case _u.NORMAL:case _u.TANGENT:return"vec3";case _u.TEXCOORD:return"vec2";case _u.COLOR:return"vec4";case _u.JOINTS:return"ivec4";case _u.WEIGHTS:return"vec4";case _u.FEATURE_ID:return"int"}};_u.getVariableName=function(o,f){let m=XYt(o);return N(f)&&(m+=`_${f}`),m};var fa=Object.freeze(_u);function Vv(){}Vv.getError=function(o,f,m){let v=`Failed to load ${o}: ${f}`;N(m)&&N(m.message)&&(v+=` ${m.message}`);let y=new sr(v);return N(m)&&(y.stack=`Original stack: ${m.stack} Handler stack: ${y.stack}`),y};Vv.getNodeTransform=function(o){return N(o.matrix)?o.matrix:Ee.fromTranslationQuaternionRotationScale(N(o.translation)?o.translation:H.ZERO,N(o.rotation)?o.rotation:Gr.IDENTITY,N(o.scale)?o.scale:H.ONE)};Vv.getAttributeBySemantic=function(o,f,m){let v=o.attributes,y=v.length;for(let x=0;x>f};k0.fromSubtreeJson=async function(o,f,m,v,y){let x=new k0(o,v,y),C;N(f)?C={json:f,binary:void 0}:C=Bqt(m);let w=C.json;x._subtreeJson=w;let A;if(Gh(w,"3DTILES_metadata"))A=w.extensions["3DTILES_metadata"];else if(N(w.tileMetadata)){let O=w.tileMetadata;A=w.propertyTables[O]}let E=[];if(N(w.contentMetadata)){let O=w.contentMetadata.length;for(let F=0;F0;T=T||S;for(let M=0;M>BigInt(61)),E=A%2===0?Qee.encode2D(v,y,x):Qee.encode2D(v,x,y),T=zz.fromFacePositionLevel(A,BigInt(E),v),S,M;if(N(C)){let I=(w.maximumHeight+w.minimumHeight)/2;S=m<4?w.minimumHeight:I,M=m<4?I:w.maximumHeight}else S=w.minimumHeight,M=w.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:zz.getTokenFromId(T._cellId),minimumHeight:S,maximumHeight:M}}}}var aXt=new H,sXt=new H,Yde=new H,lXt=new Ut;function KJe(o,f,m,v,y){if(f===0)return o;let x=H.unpack(o,0,sXt),C=Ut.unpack(o,3,lXt),w=Math.pow(2,-f),A=-1+(2*m+1)*w,E=-1+(2*v+1)*w,T=0,S=H.fromElements(w,w,1,aXt);N(y)&&(T=-1+(2*y+1)*w,S.z=w);let M=H.fromElements(A,E,T,Yde);M=Ut.multiplyByVector(C,M,Yde),M=H.add(M,x,Yde);let I=Ut.clone(C);I=Ut.multiplyByScale(I,S,I);let P=new Array(12);return H.pack(M,P),Ut.pack(I,P,3),P}var uXt=new Di;function QJe(o,f,m,v,y){if(f===0)return o.slice();let x=Di.unpack(o,0,uXt),C=o[4],w=o[5],A=Math.pow(2,-f),E=A*x.width,T=xe.negativePiToPi(x.west+m*E),S=xe.negativePiToPi(T+E),M=A*x.height,I=xe.negativePiToPi(x.south+v*M),P=xe.negativePiToPi(I+M),D=C,L=w;if(N(y)){let R=A*(w-C);D+=y*R,L=D+R}return[T,I,S,P,D,L]}function cXt(o,f,m){let v=o._implicitTileset,y=f.implicitCoordinates.getChildCoordinates(m),x=XJe(v,y,m,!1,f),C=qJe(void 0,v,y),w=v.subtreeUriTemplate.getDerivedResource({templateValues:y.getTemplateValues()}).url,A={boundingVolume:x,geometricError:C,refine:v.refine,contents:[{uri:w}]},E=ZJe(o,v.baseResource,A,f);return E.implicitTileset=v,E.implicitCoordinates=y,E}function ZJe(o,f,m,v){let y=o._tile.constructor;return new y(o._tileset,f,m,v)}vC.prototype.hasProperty=function(o,f){return!1};vC.prototype.getFeature=function(o){};vC.prototype.applyDebugSettings=function(o,f){};vC.prototype.applyStyle=function(o){};vC.prototype.update=function(o,f){};vC.prototype.isDestroyed=function(){return!1};vC.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),kr(this)};vC._deriveBoundingBox=KJe;vC._deriveBoundingRegion=QJe;vC._deriveBoundingVolumeS2=JJe;var ote=vC,hXt={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},RE=Object.freeze(hXt);function IH(o,f){this._distance=f,this._normal=new $Je(o,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(IH.prototype,{distance:{get:function(){return this._distance},set:function(o){N(this.onChangeCallback)&&o!==this._distance&&this.onChangeCallback(this.index),this._distance=o}},normal:{get:function(){return this._normal},set:function(o){N(this.onChangeCallback)&&!H.equals(this._normal._cartesian3,o)&&this.onChangeCallback(this.index),H.clone(o,this._normal._cartesian3)}}});IH.fromPlane=function(o,f){return N(f)?(f.normal=o.normal,f.distance=o.distance):f=new IH(o.normal,o.distance),f};IH.clone=function(o,f){return N(f)?(f.normal=o.normal,f.distance=o.distance,f):new IH(o.normal,o.distance)};function $Je(o,f){this._clippingPlane=f,this._cartesian3=H.clone(o)}Object.defineProperties($Je.prototype,{x:{get:function(){return this._cartesian3.x},set:function(o){N(this._clippingPlane.onChangeCallback)&&o!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=o}},y:{get:function(){return this._cartesian3.y},set:function(o){N(this._clippingPlane.onChangeCallback)&&o!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=o}},z:{get:function(){return this._cartesian3.z},set:function(o){N(this._clippingPlane.onChangeCallback)&&o!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=o}}});var zv=IH;function Hv(o){o=Z(o,Z.EMPTY_OBJECT),this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=Z(o.enabled,!0),this.modelMatrix=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),this.edgeColor=Re.clone(Z(o.edgeColor,Re.WHITE)),this.edgeWidth=Z(o.edgeWidth,0),this.planeAdded=new Br,this.planeRemoved=new Br,this._owner=void 0;let f=Z(o.unionClippingRegions,!1);this._unionClippingRegions=f,this._testIntersection=f?eKe:tKe,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let m=o.planes;if(N(m)){let v=m.length;for(let y=0;y0&&(x=La.OUTSIDE);for(let C=0;C=x;)R=y[R-x];y.push(R),C[D]=L}L>kXt&&(f instanceof Uint16Array||f instanceof Uint8Array)?f=new Uint32Array(f):L>VXt&&f instanceof Uint8Array&&(f=new Uint16Array(f)),D===A?(A=L,f[w]=L):D===E?(E=L,f[w+1]=L):(T=L,f[w+2]=L),D=Dke(v,A,E,T,M,I,P)}}o._triangleIndices=f,o._outlineCoordinatesTypedArray=new Float32Array(v)}function Dke(o,f,m,v,y,x,C){let w=C?1:0,A=y?1:0,E=0,T=Xde(o,f,w,A,E);if(T===0)return f;let S=0,M=y?1:0,I=x?1:0,P=Xde(o,m,S,M,I);if(P===0)return m;let D=C?1:0,L=0,R=x?1:0,O=Xde(o,v,D,L,R);if(O===0)return v;let F=T&P&O,k,U,G;if(F&1)k=0,U=1,G=2;else if(F&2)k=0,G=1,U=2;else if(F&4)U=0,k=1,G=2;else if(F&8)U=0,G=1,k=2;else if(F&16)G=0,k=1,U=2;else if(F&32)G=0,U=1,k=2;else{let X=Jde(T),Y=Jde(P),Q=Jde(O);return X>1&1)+(o>>2&1)+(o>>3&1)+(o>>4&1)+(o>>5&1)}yne.prototype.updateAttribute=function(o){let f=this._extraVertices,m=o.length,v=m/this._originalVertexCount,y=f.length,x=o.constructor,C=new x(o.length+y*v);C.set(o);for(let w=0;w1;)v>>=1,x.push(Lke(v));let C=new _o({context:o,source:{arrayBufferView:y,mipLevels:x},width:m,height:1,pixelFormat:Nn.LUMINANCE,sampler:new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.LINEAR_MIPMAP_LINEAR,magnificationFilter:Zu.LINEAR})});return f.outlineTexture=C,C};function Lke(o){let f=new Uint8Array(o);return f[o-1]=192,o===8?f[o-1]=96:o===4?f[o-1]=48:o===2?f[o-1]=24:o===1&&(f[o-1]=12),f}function sKe(o,f){this._originalVertexCount=f,this._edges=new Set;for(let m=0;m{this._resourcesLoaded=!0}).catch(y=>{this._processError=y})),N(this._processError)){this._state=sd.FAILED;let y=this._processError;this._processError=void 0,Q$(this,y)}let f=this._textureErrors.pop();if(N(f)){let y=this.getError("Failed to load glTF texture",f);throw y.name="TextureError",y}if(this._state===sd.FAILED)return!1;let m=!1;try{m=this._process(o)}catch(y){this._state=sd.FAILED,Q$(this,y)}let v=!1;try{v=this._processTextures(o)}catch(y){this._textureState=sd.FAILED,Q$(this,y)}return this._incrementallyLoadTextures?m:m&&v};function yJt(o,f,m,v,y,x,C,w){let A=f.accessors[m].bufferView;return id.getVertexBufferLoader({gltf:f,gltfResource:o._gltfResource,baseResource:o._baseResource,frameState:w,bufferViewId:A,draco:y,attributeSemantic:v,accessorId:m,asynchronous:o._asynchronous,loadBuffer:x,loadTypedArray:C})}function xJt(o,f,m,v,y,x,C){return id.getIndexBufferLoader({gltf:f,accessorId:m,gltfResource:o._gltfResource,baseResource:o._baseResource,frameState:C,draco:v,asynchronous:o._asynchronous,loadBuffer:y,loadTypedArray:x})}function CJt(o,f,m){let v=id.getBufferViewLoader({gltf:f,bufferViewId:m,gltfResource:o._gltfResource,baseResource:o._baseResource});return o._bufferViewLoaders.push(v),v}function dKe(o,f,m){let v=f.byteOffset,y=fO(o,f),x=f.count,C=MB(f.type),w=f.componentType,A=Rt.getSizeInBytes(w),E=A*C,T=x*C;if(y===E)return m=new Uint8Array(m),Rt.createArrayBufferView(w,m.buffer,m.byteOffset+v,T);let S=Rt.createTypedArray(w,T),M=new DataView(m.buffer),I=new Array(C),P=XY(f.componentType);v=m.byteOffset+v;for(let D=0;D{N(y)&&N(y.attributes)&&N(y.attributes[T])?RJt(P,D,x,C):OJt(f,A,P,D,x,C)},P}function mKe(o,f,m,v,y,x,C,w){let A=v.modelSemantic,E=A===fa.POSITION,T=A===fa.FEATURE_ID,S=E&&!x&&o._loadAttributesFor2D&&!w.scene3DOnly,M=o._loadForClassification&&T,I=o._loadAttributesAsTypedArray,P=!I,D=I||S||M,L=pKe(o,f,m,v,y,C?!1:P,C?!0:D,w),R=new rq.AttributeLoadPlan(L);return R.loadBuffer=P,R.loadTypedArray=D,R}function NJt(o,f,m,v,y,x){let C=N(v.ROTATION),w=N(v.TRANSLATION)&&N(f.accessors[v.TRANSLATION].min)&&N(f.accessors[v.TRANSLATION].max),A=rbe(o,ag,y),E=A.modelSemantic,T=E===ag.TRANSLATION||E===ag.ROTATION||E===ag.SCALE,S=E===ag.TRANSLATION,M=o._loadAttributesAsTypedArray||C&&T||!x.context.instancedArrays,I=!M,P=o._loadAttributesFor2D&&!x.scene3DOnly;return pKe(o,f,m,A,void 0,I,M||S&&(!w||P),x)}function FJt(o,f,m,v,y,x,C){let w=f.accessors[m],A=w.bufferView;if(!N(v)&&!N(A))return;let E=new JXt;E.count=w.count;let T=o._loadAttributesAsTypedArray,S=o._loadIndicesForWireframe&&!C.context.webgl2,M=o._loadForClassification&&y,I=!T,P=T||S||M,D=xJt(o,f,m,v,x?!1:I,x?!0:P,C),L=o._geometryLoaders.length;o._geometryLoaders.push(D);let R=D.load();o._loaderPromises.push(R),o._geometryCallbacks[L]=()=>{E.indexDatatype=D.indexDatatype,E.buffer=D.buffer,E.typedArray=D.typedArray};let O=new rq.IndicesLoadPlan(E);return O.loadBuffer=I,O.loadTypedArray=P,O}function zI(o,f,m,v,y,x){let C=IM.getImageIdFromTexture({gltf:f,textureId:m.index,supportedImageFormats:v});if(!N(C))return;let w=id.getTextureLoader({gltf:f,textureInfo:m,gltfResource:o._gltfResource,baseResource:o._baseResource,supportedImageFormats:v,frameState:y,asynchronous:o._asynchronous}),A=IM.createModelTextureReader({textureInfo:m}),E=o._textureLoaders.length;o._textureLoaders.push(w);let T=w.load().catch(S=>{if(!o.isDestroyed()){if(!o._incrementallyLoadTextures)throw S;o._textureState=sd.FAILED,o._textureErrors.push(S)}});return o._texturesPromises.push(T),o._textureCallbacks[E]=()=>{A.texture=w.texture,N(x)&&(A.texture.sampler=x)},A}function BJt(o,f,m,v,y){let x=new fJt,C=Z(m.extensions,Z.EMPTY_OBJECT),w=C.KHR_materials_pbrSpecularGlossiness,A=m.pbrMetallicRoughness;if(x.unlit=N(C.KHR_materials_unlit),N(w)){let E=new dJt;x.specularGlossiness=E,N(w.diffuseTexture)&&(E.diffuseTexture=zI(o,f,w.diffuseTexture,v,y)),N(w.specularGlossinessTexture)&&N(w.specularGlossinessTexture)&&(E.specularGlossinessTexture=zI(o,f,w.specularGlossinessTexture,v,y)),E.diffuseFactor=Aw(Wt,w.diffuseFactor),E.specularFactor=Aw(H,w.specularFactor),E.glossinessFactor=w.glossinessFactor,x.pbrSpecularGlossiness=w}else if(N(A)){let E=new hJt;N(A.baseColorTexture)&&(E.baseColorTexture=zI(o,f,A.baseColorTexture,v,y)),N(A.metallicRoughnessTexture)&&(E.metallicRoughnessTexture=zI(o,f,A.metallicRoughnessTexture,v,y)),E.baseColorFactor=Aw(Wt,A.baseColorFactor),E.metallicFactor=A.metallicFactor,E.roughnessFactor=A.roughnessFactor,x.metallicRoughness=E}return N(m.emissiveTexture)&&(x.emissiveTexture=zI(o,f,m.emissiveTexture,v,y)),N(m.normalTexture)&&!o._loadForClassification&&(x.normalTexture=zI(o,f,m.normalTexture,v,y)),N(m.occlusionTexture)&&(x.occlusionTexture=zI(o,f,m.occlusionTexture,v,y)),x.emissiveFactor=Aw(H,m.emissiveFactor),x.alphaMode=m.alphaMode,x.alphaCutoff=m.alphaCutoff,x.doubleSided=m.doubleSided,x}function gKe(o,f){let m=new uKe;return m.featureCount=o.featureCount,m.nullFeatureId=o.nullFeatureId,m.propertyTableId=o.propertyTable,m.setIndex=o.attribute,m.label=o.label,m.positionalLabel=f,m}function _Ke(o,f,m,v){let y=new uKe,x=o.featureIds;return y.featureCount=m,y.propertyTableId=f,y.setIndex=fKe(x.attribute),y.positionalLabel=v,y}function vKe(o,f){let m=new hKe;return m.propertyTableId=o.propertyTable,m.featureCount=o.featureCount,m.nullFeatureId=o.nullFeatureId,m.label=o.label,m.positionalLabel=f,m.offset=0,m.repeat=1,m}function yKe(o,f,m,v){let y=new hKe,x=o.featureIds;y.propertyTableId=f,y.featureCount=m,y.offset=Z(x.constant,0);let C=Z(x.divisor,0);return y.repeat=C===0?void 0:C,y.positionalLabel=v,y}function kJt(o,f,m,v,y,x){let C=new cKe;C.featureCount=m.featureCount,C.nullFeatureId=m.nullFeatureId,C.propertyTableId=m.propertyTable,C.label=m.label,C.positionalLabel=x;let w=m.texture;C.textureReader=zI(o,f,w,v,y,gs.NEAREST);let A=(N(w.channels)?w.channels:[0]).map(function(E){return"rgba".charAt(E)}).join("");return C.textureReader.channels=A,C}function VJt(o,f,m,v,y,x,C,w){let A=new cKe,E=m.featureIds,T=E.texture;return A.featureCount=C,A.propertyTableId=v,A.textureReader=zI(o,f,T,y,x,gs.NEAREST),A.textureReader.channels=E.channels,A.positionalLabel=w,A}function zJt(o,f,m,v,y,x){let C=new KXt,w,A=!1;for(let E in m)if(m.hasOwnProperty(E)){let T=m[E],S=rbe(o,fa,E),M=mKe(o,f,T,S,w,A,v,x);C.attributes.push(M.attribute),y.attributePlans.push(M)}return C}function HJt(o,f,m,v,y,x){let C=new QXt,w=new rq(C);o._primitiveLoadPlans.push(w);let A=m.material;N(A)&&(C.material=BJt(o,f,f.materials[A],y,x));let E=Z(m.extensions,Z.EMPTY_OBJECT),T=!1,S=E.CESIUM_primitive_outline;o._loadPrimitiveOutline&&N(S)&&(T=!0,w.needsOutlines=!0,w.outlineIndices=UJt(o,f,S,w));let M=o._loadForClassification,I=E.KHR_draco_mesh_compression,P=!1,D=m.attributes;if(N(D)){for(let j in D)if(D.hasOwnProperty(j)){let q=D[j],J=rbe(o,fa,j),X=J.modelSemantic;if(M&&!LJt(X))continue;X===fa.FEATURE_ID&&(P=!0);let Y=mKe(o,f,q,J,I,v,T,x);w.attributePlans.push(Y),C.attributes.push(Y.attribute)}}let L=m.targets;if(N(L)&&!M){let j=L.length;for(let q=0;q=0&&R.receiveTextureProjectionList.push(F.name)}}let I=Z(m.weights,T.weights),P=x.primitives[0].morphTargets.length;x.morphWeights=N(I)?I.slice():new Array(P).fill(0)}return x}function QJt(o,f,m,v){if(!N(f.nodes))return[];let y,x,C=f.nodes.length,w=new Array(C);for(y=0;y{if(!this.isDestroyed())return this._state=lM.PROCESSING,this}).catch(v=>{if(!this.isDestroyed())throw wKt(this,v)}),this._promise};function wKt(o,f){o.unload(),o._state=lM.FAILED;let m="Failed to load i3dm";return o.getError(m,f)}zE.prototype.process=function(o){if(this._state===lM.READY)return!0;let f=this._gltfLoader,m=!1;if(this._state===lM.PROCESSING&&(m=f.process(o)),!m)return!1;let v=f.components;return AKt(this,v,o),EKt(this,v),this._components=v,this._state=lM.READY,!0};function AKt(o,f,m){let v=o._instancesLength;if(v===0)return;let y=o._positions,x=new Float32Array(y),C=new Float32Array(v);for(let L=0;L0&&(R.instances=D?TKt(w):w,D=!0)}}function EKt(o,f){let m=o._instancesLength;if(m===0)return;let v;{let y={heights:[]};for(let x=0;x0&&(v|=m.COLOR_BUFFER_BIT),N(this._colorFramebuffer.depthStencilTexture)&&(v|=m.DEPTH_BUFFER_BIT|(f?m.STENCIL_BUFFER_BIT:0)),m.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,v,m.NEAREST),m.bindFramebuffer(m.READ_FRAMEBUFFER,null),m.bindFramebuffer(m.DRAW_FRAMEBUFFER,null)};WU.prototype.isDestroyed=function(){return!1};WU.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),kr(this)};var nbe=WU;function fg(o){o=Z(o,Z.EMPTY_OBJECT),this._numSamples=Z(o.numSamples,1),this._colorAttachmentsLength=Z(o.colorAttachmentsLength,1),this._color=Z(o.color,!0),this._depth=Z(o.depth,!1),this._depthStencil=Z(o.depthStencil,!1),this._supportsDepthTexture=Z(o.supportsDepthTexture,!1),this._createColorAttachments=Z(o.createColorAttachments,!0),this._createDepthAttachments=Z(o.createDepthAttachments,!0),this._pixelDatatype=o.pixelDatatype,this._pixelFormat=o.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(fg.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});fg.prototype.isDirty=function(o,f,m,v,y){m=Z(m,1);let x=this._width!==o||this._height!==f,C=this._numSamples!==m,w=N(v)&&this._pixelDatatype!==v||N(y)&&this._pixelFormat!==y,A=N(m===1?this._framebuffer:this._multisampleFramebuffer);return this._attachmentsDirty||x||C||w||!A||this._color&&!N(this._colorTextures[0])};fg.prototype.update=function(o,f,m,v,y,x){if(v=o.msaa?Z(v,1):1,y=Z(y,this._color?Z(this._pixelDatatype,Rn.UNSIGNED_BYTE):void 0),x=Z(x,this._color?Z(this._pixelFormat,Nn.RGBA):void 0),this.isDirty(f,m,v,y,x)){if(this.destroy(),this._width=f,this._height=m,this._numSamples=v,this._pixelDatatype=y,this._pixelFormat=x,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let C=0;C1){let w=aC.getColorFormat(y);this._colorRenderbuffers[C]=new N1({context:o,width:f,height:m,format:w,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&o.depthTexture?(this._depthStencilTexture=new _o({context:o,width:f,height:m,pixelFormat:Nn.DEPTH_STENCIL,pixelDatatype:Rn.UNSIGNED_INT_24_8,sampler:gs.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new N1({context:o,width:f,height:m,format:aC.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new N1({context:o,width:f,height:m,format:aC.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&o.depthTexture?this._depthTexture=new _o({context:o,width:f,height:m,pixelFormat:Nn.DEPTH_COMPONENT,pixelDatatype:Rn.UNSIGNED_INT,sampler:gs.NEAREST}):this._depthRenderbuffer=new N1({context:o,width:f,height:m,format:aC.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new nbe({context:o,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new dg({context:o,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};fg.prototype.getColorTexture=function(o){return o=Z(o,0),this._colorTextures[o]};fg.prototype.setColorTexture=function(o,f){f=Z(f,0),this._attachmentsDirty=o!==this._colorTextures[f],this._colorTextures[f]=o};fg.prototype.getColorRenderbuffer=function(o){return o=Z(o,0),this._colorRenderbuffers[o]};fg.prototype.setColorRenderbuffer=function(o,f){f=Z(f,0),this._attachmentsDirty=o!==this._colorRenderbuffers[f],this._colorRenderbuffers[f]=o};fg.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};fg.prototype.setDepthRenderbuffer=function(o){this._attachmentsDirty=o!==this._depthRenderbuffer,this._depthRenderbuffer=o};fg.prototype.getDepthTexture=function(){return this._depthTexture};fg.prototype.setDepthTexture=function(o){this._attachmentsDirty=o!==this._depthTexture,this._depthTexture=o};fg.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};fg.prototype.setDepthStencilRenderbuffer=function(o){this._attachmentsDirty=o!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=o};fg.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};fg.prototype.setDepthStencilTexture=function(o){this._attachmentsDirty=o!==this._depthStencilTexture,this._depthStencilTexture=o};fg.prototype.prepareTextures=function(o,f){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(o,f)};fg.prototype.clear=function(o,f,m){let v=f.framebuffer;f.framebuffer=this.framebuffer,f.execute(o,m),f.framebuffer=v};fg.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};fg.prototype.destroy=function(){if(this._color){let o,f=this._colorTextures.length;for(o=0;o=570425344?(f-=RI*2,S=w,E=A,T=0,w=0,A=0,Ez._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):T>=570425344&&(f-=RI,S=E,E=w,T=A,w=0,A=0,Ez._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let M;w===0?M={BATCH_LENGTH:Z(S,0)}:(M=E_(v,f,w),f+=w);let I=new Uint8Array(o,f,A);f+=A;let P,D;E>0&&(P=E_(v,f,E),f+=E,T>0&&(D=new Uint8Array(o,f,T),D=new Uint8Array(D),f+=T));let L=m+C-f;if(L===0)throw new sr("glTF byte length must be greater than 0.");let R;return f%4===0?R=new Uint8Array(o,f,L):(Ez._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),R=new Uint8Array(v.subarray(f,f+L))),{batchLength:S,featureTableJson:M,featureTableBinary:I,batchTableJson:P,batchTableBinary:D,gltf:R}};var abe=Ez;function aq(o,f){this.json=o,this.buffer=f,this._cachedTypedArrays={},this.featuresLength=0}function EKe(o,f,m,v,y,x){let C=o._cachedTypedArrays,w=C[f];return N(w)||(w=Rt.createArrayBufferView(m,o.buffer.buffer,o.buffer.byteOffset+x,y*v),C[f]=w),w}function kKt(o,f,m,v){let y=o._cachedTypedArrays,x=y[f];return N(x)||(x=Rt.createTypedArray(m,v),y[f]=x),x}aq.prototype.getGlobalProperty=function(o,f,m){let v=this.json[o];if(N(v))return N(v.byteOffset)?(f=Z(f,Rt.UNSIGNED_INT),m=Z(m,1),EKe(this,o,f,m,1,v.byteOffset)):v};aq.prototype.hasProperty=function(o){return N(this.json[o])};aq.prototype.getPropertyArray=function(o,f,m){let v=this.json[o];if(N(v))return N(v.byteOffset)?(N(v.componentType)&&(f=Rt.fromName(v.componentType)),EKe(this,o,f,m,this.featuresLength,v.byteOffset)):kKt(this,o,f,v)};aq.prototype.getProperty=function(o,f,m,v,y){let x=this.json[o];if(!N(x))return;let C=this.getPropertyArray(o,f,m);if(m===1)return C[v];for(let w=0;w0&&(P=E_(v,f,E),f+=E,T>0&&(D=new Uint8Array(o,f,T),D=new Uint8Array(D),f+=T));let L=m+C-f;if(L===0)throw new sr("glTF byte length must be greater than 0.");let R;return f%4===0?R=new Uint8Array(o,f,L):(lte._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),R=new Uint8Array(v.subarray(f,f+L))),{gltfFormat:S,featureTableJson:M,featureTableBinary:I,batchTableJson:P,batchTableBinary:D,gltf:R}};var hbe=lte,uM={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},aZ=Ta.Attribute,tQt=Ta.FeatureIdAttribute,IKe=Ta.Instances;function cM(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.i3dmResource,m=o.arrayBuffer,v=o.baseResource,y=Z(o.byteOffset,0),x=Z(o.releaseGltfJson,!1),C=Z(o.asynchronous,!0),w=Z(o.incrementallyLoadTextures,!0),A=Z(o.upAxis,Df.Y),E=Z(o.forwardAxis,Df.X),T=Z(o.loadAttributesAsTypedArray,!1),S=Z(o.loadIndicesForWireframe,!1),M=Z(o.loadPrimitiveOutline,!0);v=N(v)?v:f.clone(),this._i3dmResource=f,this._baseResource=v,this._arrayBuffer=m,this._byteOffset=y,this._releaseGltfJson=x,this._asynchronous=C,this._incrementallyLoadTextures=w,this._upAxis=A,this._forwardAxis=E,this._loadAttributesAsTypedArray=T,this._loadIndicesForWireframe=S,this._loadPrimitiveOutline=M,this._state=uM.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=Ee.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}N(Object.create)&&(cM.prototype=Object.create(W0.prototype),cM.prototype.constructor=cM);Object.defineProperties(cM.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});cM.prototype.load=function(){if(N(this._promise))return this._promise;let o=hbe.parse(this._arrayBuffer,this._byteOffset),f=o.featureTableJson,m=o.featureTableBinary,v=o.batchTableJson,y=o.batchTableBinary,x=o.gltfFormat,C=new qU(f,m);this._featureTable=C;let w=C.getGlobalProperty("INSTANCES_LENGTH");if(C.featuresLength=w,!N(w))throw new sr("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=w;let A=C.getGlobalProperty("RTC_CENTER",Rt.FLOAT,3);N(A)&&(this._transform=Ee.fromTranslation(H.fromArray(A))),this._batchTable={json:v,binary:y};let E={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(x===0){let S=nP(o.gltf);S=S.replace(/[\s\0]+$/,"");let M=this._baseResource.getDerivedResource({url:S});E.gltfResource=M,E.baseResource=M}else E.gltfResource=this._i3dmResource,E.typedArray=o.gltf;let T=new RB(E);return this._gltfLoader=T,this._state=uM.LOADING,this._promise=T.load().then(()=>{if(!this.isDestroyed())return this._state=uM.PROCESSING,this}).catch(S=>{if(!this.isDestroyed())throw iQt(this,S)}),this._promise};function iQt(o,f){o.unload(),o._state=uM.FAILED;let m="Failed to load i3dm";return o.getError(m,f)}cM.prototype.process=function(o){if(this._state===uM.READY)return!0;let f=this._gltfLoader,m=!1;if(this._state===uM.PROCESSING&&(m=f.process(o)),!m)return!1;let v=f.components;return v.transform=Ee.multiplyTransformation(this._transform,v.transform,v.transform),oQt(this,v,o),rQt(this,v),this._components=v,this._arrayBuffer=void 0,this._state=uM.READY,!0};function rQt(o,f){let m=o._batchTable,v=o._instancesLength;if(v===0)return;let y;if(N(m.json))y=GU({count:v,batchTable:m.json,binaryBody:m.binary});else{let x=new pO({name:UU.BATCH_TABLE_CLASS_NAME,count:v});y=new $M({schema:{},propertyTables:[x]})}f.structuralMetadata=y}var sZ=new H,age=new Array(4),nQt=new Ee;function oQt(o,f,m){let v,y=o._featureTable,x=o._instancesLength;if(x===0)return;let C=y.getGlobalProperty("RTC_CENTER",Rt.FLOAT,3),w=y.getGlobalProperty("EAST_NORTH_UP"),A=y.hasProperty("NORMAL_UP")||y.hasProperty("NORMAL_UP_OCT32P")||w,E=y.hasProperty("SCALE")||y.hasProperty("SCALE_NON_UNIFORM"),T=sQt(y,x),S;A&&(S=new Float32Array(4*x));let M;E&&(M=new Float32Array(3*x));let I=new Float32Array(x),P=H.unpackArray(T),D=new H,L=new H,R=new H,O=new H,F=new Ut,k=new Gr,U=new Array(4),G=new H,j=new Array(3),q=new Ee;if(!N(C)){let oe=Pi.fromPoints(P);for(v=0;v0&&(oe.instances=ne?aQt(J):J,ne=!0)}}function aQt(o){let f=new IKe;f.transformInWorldSpace=o.transformInWorldSpace;let m=o.attributes,v=m.length;for(let y=0;y=m[f]){if(f+1=0&&o>=m[f-1])return f-1;let y;if(o>m[f])for(y=f;y=m[y]&&o=0&&!(o>=m[y]&&om&&(x=Math.floor((o-m)/y)+1,o-=x*y),o};XU.prototype.clampTime=function(o){let f=this.times;return xe.clamp(o,f[0],f[f.length-1])};var gd=XU;function JU(o){this._value=o,this._valueType=gd.getPointType(o)}Object.defineProperties(JU.prototype,{value:{get:function(){return this._value}}});JU.prototype.findTimeInterval=function(o){};JU.prototype.wrapTime=function(o){return 0};JU.prototype.clampTime=function(o){return 0};JU.prototype.evaluate=function(o,f){let m=this._value,v=this._valueType;return v===Number?m:v.clone(m,f)};var fbe=JU;function KU(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.points,m=o.times;this._times=m,this._points=f,this._pointType=gd.getPointType(f[0]),this._lastTimeIndex=0}Object.defineProperties(KU.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});KU.prototype.findTimeInterval=gd.prototype.findTimeInterval;KU.prototype.wrapTime=gd.prototype.wrapTime;KU.prototype.clampTime=gd.prototype.clampTime;KU.prototype.evaluate=function(o,f){let m=this.points,v=this.times,y=this._lastTimeIndex=this.findTimeInterval(o,this._lastTimeIndex),x=(o-v[y])/(v[y+1]-v[y]);return this._pointType===Number?(1-x)*m[y]+x*m[y+1]:(N(f)||(f=new H),H.lerp(m[y],m[y+1],x,f))};var sq=KU,MKe={};MKe.solve=function(o,f,m,v){let y=new Array(m.length),x=new Array(v.length),C=new Array(v.length),w;for(w=0;w=0;--w)C[w]=H.subtract(x[w],H.multiplyByScalar(C[w+1],y[w],C[w]),C[w]);return C};var wne=MKe,DKe=[],LKe=[],RKe=[],OKe=[];function dQt(o,f,m){let v=DKe,y=RKe,x=LKe,C=OKe;v.length=y.length=o.length-1,x.length=C.length=o.length;let w;v[0]=x[0]=1,y[0]=0;let A=C[0];for(N(A)||(A=C[0]=new H),H.clone(f,A),w=1;w0&&o.afterRender.push(w._raiseStartEvent)),w.loop===RE.REPEAT)I=I-Math.floor(I);else if(w.loop===RE.MIRRORED_REPEAT){let R=Math.floor(I),O=I-R;I=R%2===1?1-O:O}w.reverse&&(I=1-I);let L=I*E*w.multiplier;L=xe.clamp(L,w.localStartTime,w.localStopTime),w.animate(L),w.update.numberOfListeners>0&&(w._updateEventTime=L,o.afterRender.push(w._raiseUpdateEvent)),v=!0,D||(w._state=OR.STOPPED,w.stop.numberOfListeners>0&&o.afterRender.push(w._raiseStopEvent),w.removeOnStop&&lZ.push(w))}}m=lZ.length;for(let C=0;Cx||v<-x&&y>-x}function OV(o,f){if(!N(f))return;let m=jI.clone(f),v=Jn.shallowClone(f.command);return v.modelMatrix=o._modelMatrix2D,v.boundingVolume=o._boundingVolume2D,m.command=v,m.updateShadows=!1,m.is2D=!0,f.derivedCommand2D=m,o._derivedCommands.push(m),m}function OQt(o){OV(o,o._originalCommand),OV(o,o._translucentCommand),OV(o,o._skipLodBackfaceCommand),OV(o,o._skipLodStencilCommand),OV(o,o._silhouetteModelCommand),OV(o,o._silhouetteColorCommand)}function NQt(o){let f=Jn.shallowClone(o);f.pass=vr.TRANSLUCENT;let m=uo(o.renderState,!0);return m.cull.enabled=!1,m.depthMask=!1,m.blending=Mu.ALPHA_BLEND,f.renderState=Mn.fromCache(m),f}function FQt(o,f){let m=f._silhouetteId%255,v=Jn.shallowClone(o),y=uo(o.renderState,!0);return y.stencilTest={enabled:!0,frontFunction:xi.ALWAYS,backFunction:xi.ALWAYS,reference:m,mask:-1,frontOperation:{fail:xi.KEEP,zFail:xi.KEEP,zPass:xi.REPLACE},backOperation:{fail:xi.KEEP,zFail:xi.KEEP,zPass:xi.REPLACE}},f.isInvisible()&&(y.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),v.renderState=Mn.fromCache(y),v}function BQt(o,f){let m=f._silhouetteId%255,v=Jn.shallowClone(o),y=uo(o.renderState,!0);y.cull.enabled=!1,(o.pass===vr.TRANSLUCENT||f.silhouetteColor.alpha<1)&&(v.pass=vr.TRANSLUCENT,y.depthMask=!1,y.blending=Mu.ALPHA_BLEND),y.stencilTest={enabled:!0,frontFunction:xi.NOTEQUAL,backFunction:xi.NOTEQUAL,reference:m,mask:-1,frontOperation:{fail:xi.KEEP,zFail:xi.KEEP,zPass:xi.KEEP},backOperation:{fail:xi.KEEP,zFail:xi.KEEP,zPass:xi.KEEP}};let x=uo(o.uniformMap);return x.model_silhouettePass=function(){return!0},v.renderState=Mn.fromCache(y),v.uniformMap=x,v.castShadows=!1,v.receiveShadows=!1,v}function kQt(o,f,m){let v=o._skipLodStencilCommand,y=v.command,x=f._selectionDepth,C=VQt(y);if(x!==C){let w=zQt(x),A=uo(y.renderState,!0);A.stencilTest.reference=w,y.renderState=Mn.fromCache(A),m&&(v.derivedCommand2D.renderState=A)}}function VQt(o){return(o.renderState.stencilTest.reference&Ua.SKIP_LOD_MASK)>>>Ua.SKIP_LOD_BIT_SHIFT}function zQt(o){return Ua.CESIUM_3D_TILE_MASK|o<0){N(o._polygonDepth)||(o._polygonDepth=new H5),o._polygonDepth._flattenPolygonDrawCommands=[];let m={position:0};if(N(o._offsetPos)){let C=H.fromRadians(o._flattenOriginPoint.longitude,o._flattenOriginPoint.latitude,0);o.localViewMatrix=tn.eastNorthUpToFixedFrame(C);let w=new Wt;Ee.getRow(o.localViewMatrix,2,w);let A=1e3;o._offsetPos=new H(o._offsetPos.x-A*w.x,o._offsetPos.y-A*w.y,o._offsetPos.z-A*w.z),o.localViewMatrix=Ee.setTranslation(o.localViewMatrix,o._offsetPos,new Ee)}else{let C=H.fromRadians(o._flattenOriginPoint.longitude,o._flattenOriginPoint.latitude,-1e3);o.localViewMatrix=tn.eastNorthUpToFixedFrame(C)}let v=new Ee;Ee.inverse(o.localViewMatrix,v);let y=new Xr,x=[];for(let C=0;C0&&(o._updateFlattenInternal===!0&&(N(o._polygonDepth)&&(o._polygonDepth.destroy(),o._polygonDepth=void 0),o.initFlattenPolygon(f)),N(o._polygonDepth)&&o._polygonDepth.update(f),o._updateFlattenInternal=!1)}},lq=XQt,kke=new Ee;function JQt(o,f,m,v){let y=o.shaderBuilder;y.addVertexLines(Abe),y.addFragmentLines(wbe);let x=KQt(o),C=new Du({context:f.context,indexBuffer:x,attributes:o.attributes}),w=o.model;w._pipelineResources.push(C);let A=y.buildShaderProgram(f.context);w._pipelineResources.push(A);let E=o.alphaOptions.pass,T=w.sceneGraph,S=f.mode===_i.SCENE3D,M,I;if(!S&&!f.scene3DOnly&&w._projectTo2D)M=Ee.multiplyTransformation(T._computedModelMatrix,o.runtimeNode.computedTransform,new Ee),I=o.runtimePrimitive.boundingSphere2D;else{let k=S?T._computedModelMatrix:T._computedModelMatrix2D;M=Ee.multiplyTransformation(k,o.runtimeNode.computedTransform,new Ee),I=Pi.transform(o.boundingSphere,M,o.boundingSphere)}let P=uo(Mn.fromCache(o.renderStateOptions),!0);P.cull.face=xl.getCullFace(M,o.primitiveType),P=Mn.fromCache(P);let D=N(w.classificationType),L=D?!1:Cl.castShadows(w.shadows),R=D?!1:Cl.receiveShadows(w.shadows),O=D?void 0:o.pickId;if(Lf.is3DTiles(w.type)&&w.flattenEnabled){let k=Ee.IDENTITY,U=Ee.IDENTITY,G=v.root.boundingSphere.center;if(G){let q=f.scene.globe.ellipsoid,J=Mt.fromCartesian(G,q,new Mt),X=H.fromRadians(J.longitude,J.latitude,0,q,new H);k=tn.eastNorthUpToFixedFrame(X,q,new Ee),U=Ee.inverseTransformation(k,new Ee)}let j={u_r_eastNorthUpToFixedFrame:function(){let q=w.flatUniformMap.u_r_eastNorthUpToFixedFrameA(),J=new Ee;return Ee.multiply(q,M,J),J},u_eastNorthUpToFixedFrame:function(){let q=new Ee;Ee.inverse(M,q);let J=w.flatUniformMap.u_eastNorthUpToFixedFrameA(),X=new Ee;return Ee.multiply(q,J,X),X}};o.uniformMap=va(o.uniformMap,j)}if(o.uniformMap.u_rtcNormalize){let k=new H;Ee.getTranslation(M,k);let U=new H;Ee.getScale(M,U);let G=new H(0,0,0),j=k,q=f.mapProjection.ellipsoid;j=q.cartesianToCartographic(j),j.height=0,j=q.cartographicToCartesian(j),q.geodeticSurfaceNormal(j,G),o.uniformMap.u_rtcNormalize=function(){return G},o.uniformMap.u_rtcScale=function(){return U}}w.underGroundMode.enabled&&(o.uniformMap.u_underGroundModeMatrix=function(){let k=f.context.uniformState.view;return Ee.multiply(k,w.referenceMatrix,kke),kke});let F=new Jn({boundingVolume:I,modelMatrix:M,uniformMap:o.uniformMap,renderState:P,vertexArray:C,shaderProgram:A,cull:w.cull,pass:E,count:o.count,owner:w,pickId:O,instanceCount:o.instanceCount,primitiveType:o.primitiveType,debugShowBoundingVolume:w.debugShowBoundingVolume,castShadows:L,receiveShadows:R,customType:w.type,receiveTextureProjectionList:m});return D?new Tbe({primitiveRenderResources:o,command:F}):new Sbe({primitiveRenderResources:o,command:F})}function KQt(o){let f=o.wireframeIndexBuffer;if(N(f))return f;let m=o.indices;if(N(m))return m.buffer}var Pbe=JQt,_5={VERTEX:0,FRAGMENT:1,BOTH:2};_5.includesVertexShader=function(o){return o===_5.VERTEX||o===_5.BOTH};_5.includesFragmentShader=function(o){return o===_5.FRAGMENT||o===_5.BOTH};var yr=Object.freeze(_5),zKe={name:"TilesetPipelineStage"};zKe.process=function(o,f,m){if(f.hasSkipLevelOfDetail(m)){o.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,yr.FRAGMENT);let y={u_polygonOffset:function(){return Ye.ZERO}};o.uniformMap=va(y,o.uniformMap),o.hasSkipLevelOfDetail=!0}let v=o.renderStateOptions;v.stencilTest=Ua.setCesium3DTileBit(),v.stencilMask=Ua.CESIUM_3D_TILE_MASK};var Ibe=zKe,Mbe=`vec3 proceduralIBL( vec3 positionEC, vec3 normalEC, vec3 lightDirectionEC, vec3 lightColorHdr, czm_pbrParameters pbrParameters ) { vec3 v = -positionEC; vec3 positionWC = vec3(czm_inverseView * vec4(positionEC, 1.0)); vec3 vWC = -normalize(positionWC); vec3 l = normalize(lightDirectionEC); vec3 n = normalEC; vec3 r = normalize(czm_inverseViewRotation * normalize(reflect(v, n))); float NdotL = clamp(dot(n, l), 0.001, 1.0); float NdotV = abs(dot(n, v)) + 0.001; // Figure out if the reflection vector hits the ellipsoid float vertexRadius = length(positionWC); float horizonDotNadir = 1.0 - min(1.0, czm_ellipsoidRadii.x / vertexRadius); float reflectionDotNadir = dot(r, normalize(positionWC)); // Flipping the X vector is a cheap way to get the inverse of czm_temeToPseudoFixed, since that's a rotation about Z. r.x = -r.x; r = -normalize(czm_temeToPseudoFixed * r); r.x = -r.x; vec3 diffuseColor = pbrParameters.diffuseColor; float roughness = pbrParameters.roughness; vec3 specularColor = pbrParameters.f0; float inverseRoughness = 1.04 - roughness; inverseRoughness *= inverseRoughness; vec3 sceneSkyBox = czm_textureCube(czm_environmentMap, r).rgb * inverseRoughness; float atmosphereHeight = 0.05; float blendRegionSize = 0.1 * ((1.0 - inverseRoughness) * 8.0 + 1.1 - horizonDotNadir); float blendRegionOffset = roughness * -1.0; float farAboveHorizon = clamp(horizonDotNadir - blendRegionSize * 0.5 + blendRegionOffset, 1.0e-10 - blendRegionSize, 0.99999); float aroundHorizon = clamp(horizonDotNadir + blendRegionSize * 0.5, 1.0e-10 - blendRegionSize, 0.99999); float farBelowHorizon = clamp(horizonDotNadir + blendRegionSize * 1.5, 1.0e-10 - blendRegionSize, 0.99999); float smoothstepHeight = smoothstep(0.0, atmosphereHeight, horizonDotNadir); vec3 belowHorizonColor = mix(vec3(0.1, 0.15, 0.25), vec3(0.4, 0.7, 0.9), smoothstepHeight); vec3 nadirColor = belowHorizonColor * 0.5; vec3 aboveHorizonColor = mix(vec3(0.9, 1.0, 1.2), belowHorizonColor, roughness * 0.5); vec3 blueSkyColor = mix(vec3(0.18, 0.26, 0.48), aboveHorizonColor, reflectionDotNadir * inverseRoughness * 0.5 + 0.75); vec3 zenithColor = mix(blueSkyColor, sceneSkyBox, smoothstepHeight); vec3 blueSkyDiffuseColor = vec3(0.7, 0.85, 0.9); float diffuseIrradianceFromEarth = (1.0 - horizonDotNadir) * (reflectionDotNadir * 0.25 + 0.75) * smoothstepHeight; float diffuseIrradianceFromSky = (1.0 - smoothstepHeight) * (1.0 - (reflectionDotNadir * 0.25 + 0.25)); vec3 diffuseIrradiance = blueSkyDiffuseColor * clamp(diffuseIrradianceFromEarth + diffuseIrradianceFromSky, 0.0, 1.0); float notDistantRough = (1.0 - horizonDotNadir * roughness * 0.8); vec3 specularIrradiance = mix(zenithColor, aboveHorizonColor, smoothstep(farAboveHorizon, aroundHorizon, reflectionDotNadir) * notDistantRough); specularIrradiance = mix(specularIrradiance, belowHorizonColor, smoothstep(aroundHorizon, farBelowHorizon, reflectionDotNadir) * inverseRoughness); specularIrradiance = mix(specularIrradiance, nadirColor, smoothstep(farBelowHorizon, 1.0, reflectionDotNadir) * inverseRoughness); // Luminance model from page 40 of http://silviojemma.com/public/papers/lighting/spherical-harmonic-lighting.pdf #ifdef USE_SUN_LUMINANCE // Angle between sun and zenith float LdotZenith = clamp(dot(normalize(czm_inverseViewRotation * l), vWC), 0.001, 1.0); float S = acos(LdotZenith); // Angle between zenith and current pixel float NdotZenith = clamp(dot(normalize(czm_inverseViewRotation * n), vWC), 0.001, 1.0); // Angle between sun and current pixel float gamma = acos(NdotL); float numerator = ((0.91 + 10.0 * exp(-3.0 * gamma) + 0.45 * pow(NdotL, 2.0)) * (1.0 - exp(-0.32 / NdotZenith))); float denominator = (0.91 + 10.0 * exp(-3.0 * S) + 0.45 * pow(LdotZenith,2.0)) * (1.0 - exp(-0.32)); float luminance = model_luminanceAtZenith * (numerator / denominator); #endif vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; vec3 iblColor = (diffuseIrradiance * diffuseColor * model_iblFactor.x) + (specularIrradiance * czm_srgbToLinear(specularColor * brdfLut.x + brdfLut.y) * model_iblFactor.y); float maximumComponent = max(max(lightColorHdr.x, lightColorHdr.y), lightColorHdr.z); vec3 lightColor = lightColorHdr / max(maximumComponent, 1.0); iblColor *= lightColor; #ifdef USE_SUN_LUMINANCE iblColor *= luminance; #endif return iblColor; } #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) vec3 textureIBL( vec3 positionEC, vec3 normalEC, vec3 lightDirectionEC, czm_pbrParameters pbrParameters ) { vec3 diffuseColor = pbrParameters.diffuseColor; float roughness = pbrParameters.roughness; vec3 specularColor = pbrParameters.f0; vec3 v = -positionEC; vec3 n = normalEC; vec3 l = normalize(lightDirectionEC); vec3 h = normalize(v + l); float NdotV = abs(dot(n, v)) + 0.001; float VdotH = clamp(dot(v, h), 0.0, 1.0); const mat3 yUpToZUp = mat3( -1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 ); vec3 cubeDir = normalize(yUpToZUp * model_iblReferenceFrameMatrix * normalize(reflect(-v, n))); #ifdef DIFFUSE_IBL #ifdef CUSTOM_SPHERICAL_HARMONICS vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients); #else vec3 diffuseIrradiance = czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients); #endif #else vec3 diffuseIrradiance = vec3(0.0); #endif #ifdef SPECULAR_IBL vec3 r0 = specularColor.rgb; float reflectance = max(max(r0.r, r0.g), r0.b); vec3 r90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0)); vec3 F = fresnelSchlick2(r0, r90, VdotH); vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg; #ifdef CUSTOM_SPECULAR_IBL vec3 specularIBL = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD); #else vec3 specularIBL = czm_sampleOctahedralProjection(czm_specularEnvironmentMaps, czm_specularEnvironmentMapSize, cubeDir, roughness * czm_specularEnvironmentMapsMaximumLOD, czm_specularEnvironmentMapsMaximumLOD); #endif specularIBL *= F * brdfLut.x + brdfLut.y; #else vec3 specularIBL = vec3(0.0); #endif return diffuseColor * diffuseIrradiance + specularColor * specularIBL; } #endif vec3 imageBasedLightingStage( vec3 positionEC, vec3 normalEC, vec3 lightDirectionEC, vec3 lightColorHdr, czm_pbrParameters pbrParameters ) { #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) // Environment maps were provided, use them for IBL return textureIBL( positionEC, normalEC, lightDirectionEC, pbrParameters ); #else // Use the procedural IBL if there are no environment maps return proceduralIBL( positionEC, normalEC, lightDirectionEC, lightColorHdr, pbrParameters ); #endif }`,HKe={name:"ImageBasedLightingPipelineStage"};HKe.process=function(o,f,m){let v=f.imageBasedLighting,y=o.shaderBuilder;y.addDefine("USE_IBL_LIGHTING",void 0,yr.FRAGMENT),y.addUniform("vec2","model_iblFactor",yr.FRAGMENT),V5.isSupported(m.context)&&((v.useSphericalHarmonics||v.useSpecularEnvironmentMaps||v.enabled)&&y.addUniform("mat3","model_iblReferenceFrameMatrix",yr.FRAGMENT),N(v.sphericalHarmonicCoefficients)?(y.addDefine("DIFFUSE_IBL",void 0,yr.FRAGMENT),y.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,yr.FRAGMENT),y.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",yr.FRAGMENT)):v.useDefaultSphericalHarmonics&&y.addDefine("DIFFUSE_IBL",void 0,yr.FRAGMENT),N(v.specularEnvironmentMapAtlas)&&v.specularEnvironmentMapAtlas.ready?(y.addDefine("SPECULAR_IBL",void 0,yr.FRAGMENT),y.addDefine("CUSTOM_SPECULAR_IBL",void 0,yr.FRAGMENT),y.addUniform("sampler2D","model_specularEnvironmentMaps",yr.FRAGMENT),y.addUniform("vec2","model_specularEnvironmentMapsSize",yr.FRAGMENT),y.addUniform("float","model_specularEnvironmentMapsMaximumLOD",yr.FRAGMENT)):f.useDefaultSpecularMaps&&y.addDefine("SPECULAR_IBL",void 0,yr.FRAGMENT)),N(v.luminanceAtZenith)&&(y.addDefine("USE_SUN_LUMINANCE",void 0,yr.FRAGMENT),y.addUniform("float","model_luminanceAtZenith",yr.FRAGMENT)),y.addFragmentLines(Mbe);let x={model_iblFactor:function(){return v.imageBasedLightingFactor},model_iblReferenceFrameMatrix:function(){return f._iblReferenceFrameMatrix},model_luminanceAtZenith:function(){return v.luminanceAtZenith},model_sphericalHarmonicCoefficients:function(){return v.sphericalHarmonicCoefficients},model_specularEnvironmentMaps:function(){return v.specularEnvironmentMapAtlas.texture},model_specularEnvironmentMapsSize:function(){return v.specularEnvironmentMapAtlas.texture.dimensions},model_specularEnvironmentMapsMaximumLOD:function(){return v.specularEnvironmentMapAtlas.maximumMipmapLevel}};o.uniformMap=va(x,o.uniformMap)};var Dbe=HKe,QQt=xe.EPSILON16;function Lbe(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.stage,m=o.runtimeArticulation;this._stage=f,this._runtimeArticulation=m,this._name=f.name,this._type=f.type,this._minimumValue=f.minimumValue,this._maximumValue=f.maximumValue,this._currentValue=f.initialValue}Object.defineProperties(Lbe.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(o){o=xe.clamp(o,this.minimumValue,this.maximumValue),xe.equalsEpsilon(this._currentValue,o,QQt)||(this._currentValue=o,this.runtimeArticulation._dirty=!0)}}});var ZQt=new H,Qde=new Ut;Lbe.prototype.applyStageToMatrix=function(o){let f=this.type,m=this.currentValue,v=ZQt,y;switch(f){case b1.XROTATE:y=Ut.fromRotationX(xe.toRadians(m),Qde),o=Ee.multiplyByMatrix3(o,y,o);break;case b1.YROTATE:y=Ut.fromRotationY(xe.toRadians(m),Qde),o=Ee.multiplyByMatrix3(o,y,o);break;case b1.ZROTATE:y=Ut.fromRotationZ(xe.toRadians(m),Qde),o=Ee.multiplyByMatrix3(o,y,o);break;case b1.XTRANSLATE:v.x=m,v.y=0,v.z=0,o=Ee.multiplyByTranslation(o,v,o);break;case b1.YTRANSLATE:v.x=0,v.y=m,v.z=0,o=Ee.multiplyByTranslation(o,v,o);break;case b1.ZTRANSLATE:v.x=0,v.y=0,v.z=m,o=Ee.multiplyByTranslation(o,v,o);break;case b1.XSCALE:v.x=m,v.y=1,v.z=1,o=Ee.multiplyByScale(o,v,o);break;case b1.YSCALE:v.x=1,v.y=m,v.z=1,o=Ee.multiplyByScale(o,v,o);break;case b1.ZSCALE:v.x=1,v.y=1,v.z=m,o=Ee.multiplyByScale(o,v,o);break;case b1.UNIFORMSCALE:o=Ee.multiplyByUniformScale(o,m,o);break;default:break}return o};var Rbe=Lbe;function Sne(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.articulation,m=o.sceneGraph;this._articulation=f,this._sceneGraph=m,this._name=f.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,$Qt(this)}Object.defineProperties(Sne.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function $Qt(o){let f=o.articulation.stages,m=f.length,v=o._runtimeStages,y=o._runtimeStagesByName;for(let x=0;x 0.0 && clipDistance < clippingPlanesEdgeWidth) { color = clippingPlanesEdgeColor; } } `,UKe={name:"ModelClippingPlanesPipelineStage"},iZt=new Ye;UKe.process=function(o,f,m){let v=f.clippingPlanes,y=m.context,x=o.shaderBuilder;x.addDefine("HAS_CLIPPING_PLANES",void 0,yr.FRAGMENT),x.addDefine("CLIPPING_PLANES_LENGTH",v.length,yr.FRAGMENT),v.unionClippingRegions&&x.addDefine("UNION_CLIPPING_REGIONS",void 0,yr.FRAGMENT),Uv.useFloatTexture(y)&&x.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,yr.FRAGMENT);let C=Uv.getTextureResolution(v,y,iZt);x.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",C.x,yr.FRAGMENT),x.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",C.y,yr.FRAGMENT),x.addUniform("sampler2D","model_clippingPlanes",yr.FRAGMENT),x.addUniform("vec4","model_clippingPlanesEdgeStyle",yr.FRAGMENT),x.addUniform("mat4","model_clippingPlanesMatrix",yr.FRAGMENT),x.addFragmentLines(Fbe);let w={model_clippingPlanes:function(){return v.texture},model_clippingPlanesEdgeStyle:function(){let A=Re.clone(v.edgeColor);return A.alpha=v.edgeWidth,A},model_clippingPlanesMatrix:function(){return f._clippingPlanesMatrix}};o.uniformMap=va(w,o.uniformMap)};var Bbe=UKe;function GKe(o,f){this._model=o,this._runtimeNode=f}Object.defineProperties(GKe.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(o){this._runtimeNode.show=o}},matrix:{get:function(){return this._runtimeNode.transform},set:function(o){N(o)?(this._runtimeNode.transform=o,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var kbe=GKe,Vbe=`mat4 getInstancingTransform() { mat4 instancingTransform; #ifdef HAS_INSTANCE_MATRICES instancingTransform = mat4( a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0, // Column 1 a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0, // Column 2 a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0, // Column 3 a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0 // Column 4 ); #else vec3 translation = vec3(0.0, 0.0, 0.0); vec3 scale = vec3(1.0, 1.0, 1.0); #ifdef HAS_INSTANCE_TRANSLATION translation = a_instanceTranslation; #endif #ifdef HAS_INSTANCE_SCALE scale = a_instanceScale; #endif instancingTransform = mat4( scale.x, 0.0, 0.0, 0.0, 0.0, scale.y, 0.0, 0.0, 0.0, 0.0, scale.z, 0.0, translation.x, translation.y, translation.z, 1.0 ); #endif return instancingTransform; } #ifdef USE_2D_INSTANCING mat4 getInstancingTransform2D() { mat4 instancingTransform2D; #ifdef HAS_INSTANCE_MATRICES instancingTransform2D = mat4( a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0, // Column 1 a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0, // Column 2 a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0, // Column 3 a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0 // Column 4 ); #else vec3 translation2D = vec3(0.0, 0.0, 0.0); vec3 scale = vec3(1.0, 1.0, 1.0); #ifdef HAS_INSTANCE_TRANSLATION translation2D = a_instanceTranslation2D; #endif #ifdef HAS_INSTANCE_SCALE scale = a_instanceScale; #endif instancingTransform2D = mat4( scale.x, 0.0, 0.0, 0.0, 0.0, scale.y, 0.0, 0.0, 0.0, 0.0, scale.z, 0.0, translation2D.x, translation2D.y, translation2D.z, 1.0 ); #endif return instancingTransform2D; } #endif `,zbe=`void instancingStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; mat4 instancingTransform = getInstancingTransform(); attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz; #ifdef HAS_NORMALS vec3 normalMC = attributes.normalMC; attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz; #endif #ifdef USE_2D_INSTANCING mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } `,Hbe=`void legacyInstancingStage( inout ProcessedAttributes attributes, out mat4 instanceModelView, out mat3 instanceModelViewInverseTranspose) { vec3 positionMC = attributes.positionMC; mat4 instancingTransform = getInstancingTransform(); mat4 instanceModel = instancingTransform * u_instance_nodeTransform; instanceModelView = u_instance_modifiedModelView; instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel); attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz; #ifdef USE_2D_INSTANCING mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } `,uZ=new Ee,rZt=new Ee,nZt=new Ee,oZt=new Ee,aZt=new Ee,WKe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:JKe,_transformsToTypedArray:cge};WKe.process=function(o,f,m){let v=f.instances,y=v.attributes[0].count,x=o.shaderBuilder;x.addDefine("HAS_INSTANCING"),x.addVertexLines(Vbe);let C=o.model,w=C._loader,A=C.sceneGraph,E=o.runtimeNode,T=m.mode!==_i.SCENE3D&&!m.scene3DOnly&&C._projectTo2D,S=[];CZt(o,m,v,S,T),AZt(o,m,v,S);let M={};if(v.transformInWorldSpace?(x.addDefine("USE_LEGACY_INSTANCING",void 0,yr.VERTEX),x.addUniform("mat4","u_instance_modifiedModelView",yr.VERTEX),x.addUniform("mat4","u_instance_nodeTransform",yr.VERTEX),M.u_instance_modifiedModelView=function(){let I=Ee.multiplyTransformation(C.modelMatrix,A.components.transform,uZ);return T?Ee.multiplyTransformation(m.context.uniformState.view3D,I,uZ):(m.mode!==_i.SCENE3D&&(I=tn.basisTo2D(m.mapProjection,I,uZ)),Ee.multiplyTransformation(m.context.uniformState.view,I,uZ))},M.u_instance_nodeTransform=function(){return Ee.multiplyTransformation(A.axisCorrectionMatrix,E.computedTransform,rZt)},x.addVertexLines(Hbe)):(w instanceof bne&&(x.addDefine("GLTF_INSTANCING",void 0,yr.VERTEX),x.addUniform("mat4","u_instanceModelViewInvers",yr.VERTEX),x.addUniform("mat4","u_instanceModelView",yr.VERTEX),M.u_instanceModelViewInvers=function(){let I=new Ee;return Ee.multiplyTransformation(m.camera.viewMatrix,C._modelMatrix,I),Ee.inverse(I,oZt)},M.u_instanceModelView=function(){return Ee.multiplyTransformation(m.camera.viewMatrix,C._modelMatrix,aZt)},x.addUniform("sampler2D","u_instanceModelViewTexture",yr.VERTEX),x.addDefine("INSTANCE_TEXTURE_WIDTH",w.textureResolution.x,yr.VERTEX),x.addDefine("INSTANCE_TEXTURE_HEIGHT",w.textureResolution.y,yr.VERTEX),M.u_instanceModelViewTexture=function(){return w.instanceModelViewMatrixsTexture}),x.addVertexLines(zbe)),T){x.addDefine("USE_2D_INSTANCING",void 0,yr.VERTEX),x.addUniform("mat4","u_modelView2D",yr.VERTEX);let I=m.context,P=Ee.fromTranslation(E.instancingReferencePoint2D,new Ee);M.u_modelView2D=function(){return Ee.multiplyTransformation(I.uniformState.view,P,nZt)}}o.uniformMap=va(M,o.uniformMap),o.instanceCount=y,o.attributes.push.apply(o.attributes,S)};var eW=new Ee,sZt=new H;function lZt(o,f,m,v,y){let x=Ee.multiplyTransformation(f,o,eW);return x=Ee.multiplyTransformation(x,m,eW),y=tn.basisTo2D(v.mapProjection,x,y),y}function uZt(o,f,m,v,y){let x=Ee.fromTranslation(o,eW),C=Ee.multiplyTransformation(f,x,eW);C=Ee.multiplyTransformation(C,m,eW);let w=Ee.getTranslation(C,sZt);return y=nl.computeActualWgs84Position(v,w,y),y}function jKe(o,f,m){let v=o.model,y=v.sceneGraph;o.runtimeNode.node.instances.transformInWorldSpace?(f=Ee.multiplyTransformation(v.modelMatrix,y.components.transform,f),m=Ee.multiplyTransformation(y.axisCorrectionMatrix,o.runtimeNode.computedTransform,m)):(f=Ee.clone(y.computedModelMatrix,f),f=Ee.multiplyTransformation(f,o.runtimeNode.computedTransform,f),m=Ee.clone(Ee.IDENTITY,m))}var YKe=new Ee,qKe=new Ee,cZt=new Ee,hZt=new H;function dZt(o,f,m,v){let y=YKe,x=qKe;jKe(f,y,x);let C=f.runtimeNode.instancingReferencePoint2D,w=o.length;for(let A=0;A=o.featureIdVertexAttributeSetIndex&&(o.featureIdVertexAttributeSetIndex=w.setIndex+1),v.push({index:o.attributeIndex++,vertexBuffer:w.buffer,componentsPerAttribute:Ks.getNumberOfComponents(w.type),componentDatatype:w.componentDatatype,normalize:!1,offsetInBytes:w.byteOffset,strideInBytes:w.byteStride,instanceDivisor:1}),x.addAttribute("float",`a_instanceFeatureId_${w.setIndex}`))}}var Ube=WKe,Gbe={};Gbe.name="ModelMatrixUpdateStage";Gbe.update=function(o,f,m){let v=m.mode!==_i.SCENE3D;if(!(v&&f._model._projectTo2D)&&o._transformDirty){let y=v?f._computedModelMatrix2D:f._computedModelMatrix;KKe(o,f,y,o.transformToRoot),o._transformDirty=!1}};function KKe(o,f,m,v){let y;v=Ee.multiplyTransformation(v,o.transform,new Ee),o.updateComputedTransform();let x=o.runtimePrimitives.length;for(y=0;y1&&(v.addDefine("MULTILINE_BATCH_TEXTURE"),v.addUniform("vec2","model_textureDimensions"),y.model_textureDimensions=function(){return A.textureDimensions}),o.uniformMap=va(y,o.uniformMap)};var Xbe=tQe,iQe={name:"ClassificationPipelineStage"};iQe.process=function(o,f,m){o.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,yr.BOTH);let v=o.runtimePrimitive;N(v.batchLengths)||TZt(f,v)};function TZt(o,f){let m=xl.getAttributeBySemantic(o,fa.POSITION);if(!N(m))throw new sr("Primitives must have a position attribute to be used for classification.");let v,y=o.indices,x=N(y);x&&(v=y.typedArray,y.typedArray=void 0);let C=x?y.count:m.count,w=xl.getAttributeBySemantic(o,fa.FEATURE_ID,0);if(!N(w)){f.batchLengths=[C],f.batchOffsets=[0];return}let A=w.typedArray;w.typedArray=void 0;let E=[],T=[0],S=x?v[0]:0,M=A[S],I=0;for(let D=1;DFZt(v,f,m)):[]}function FZt(o,f,m){let{getAttributeByName:v,getAttributeInfo:y,sanitizeGlslIdentifier:x}=xl,C=o.class.id,w=m?.classes[C],A=Object.entries(o.properties),E=new Array(A.length);for(let T=0;TkZt(m,f)):[]}function kZt(o,f){let{sanitizeGlslIdentifier:m}=xl,v=o.class.id,y=f?.classes[v],x=Object.entries(o.properties).filter(([w,A])=>A.isGpuCompatible()),C=new Array(x.length);for(let w=0;wT),m.addStructField(qu.STRUCT_ID_METADATA_FS,x,y);let M=`attributes.texCoord_${w}`,I=`texture(${S}, ${M}).${A}`,P=C.unpackInShader(I),D=uQe({valueExpression:P,renderResources:o,glslType:x,metadataVariable:y,shaderDestination:yr.FRAGMENT,property:C}),L=`metadata.${y} = ${D};`;m.addFunctionLines(qu.FUNCTION_ID_INITIALIZE_METADATA_FS,[L])}function aQe(o,f){let{classProperty:m}=f.property,{metadataVariable:v,glslType:y,shaderDestination:x}=f,C=lQe(qu.METADATA_CLASS_FIELDS,m,`metadataClass.${v}`,y),w=`${y}MetadataClass`;o.addStructField(qu.STRUCT_ID_METADATA_CLASS_FS,w,v),o.addFunctionLines(qu.FUNCTION_ID_INITIALIZE_METADATA_FS,C),yr.includesVertexShader(x)&&(o.addStructField(qu.STRUCT_ID_METADATA_CLASS_VS,w,v),o.addFunctionLines(qu.FUNCTION_ID_INITIALIZE_METADATA_VS,C))}function sQe(o,f){let{propertyStatistics:m}=f;if(!N(m))return;let{metadataVariable:v,type:y,glslType:x}=f;if(y===Fa.ENUM)return;let C=qu.METADATA_STATISTICS_FIELDS,w=`metadataStatistics.${v}`,A=lQe(C,m,w,x),E=`${x}MetadataStatistics`;o.addStructField(qu.STRUCT_ID_METADATA_STATISTICS_FS,E,v),o.addFunctionLines(qu.FUNCTION_ID_INITIALIZE_METADATA_FS,A),yr.includesVertexShader(f.shaderDestination)&&(o.addStructField(qu.STRUCT_ID_METADATA_STATISTICS_VS,E,v),o.addFunctionLines(qu.FUNCTION_ID_INITIALIZE_METADATA_VS,A))}function lQe(o,f,m,v){function y(x){let C=f[x.specName];if(N(C))return`${m}.${x.shaderName} = ${v}(${C});`}return N(f)?o.map(y).filter(N):[]}function uQe(o){let{valueExpression:f,property:m}=o;if(!m.hasValueTransform)return f;let v=o.metadataVariable,y=`u_${v}_offset`,x=`u_${v}_scale`,{shaderBuilder:C,uniformMap:w}=o.renderResources,{glslType:A,shaderDestination:E}=o;C.addUniform(A,y,E),C.addUniform(A,x,E);let{offset:T,scale:S}=m;return w[y]=()=>T,w[x]=()=>S,`czm_valueTransform(${y}, ${x}, ${f})`}var hM=qu,P0={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:Ba};P0.process=function(o,f,m){let v=o.shaderBuilder,y=o.model.customShader;N(y.lightingModel)&&(o.lightingOptions.lightingModel=y.lightingModel);let x=o.alphaOptions;y.translucencyMode===C3.TRANSLUCENT?x.pass=vr.TRANSLUCENT:y.translucencyMode===C3.OPAQUE&&(x.pass=void 0);let C=e$t(y,f);if(!C.customShaderEnabled)return;if(n$t(v,y,C),N(y.andStyle)&&v.addDefine("HAS_CUSTOM_FRAGMENT_SHADER_AND_STYLE",void 0,yr.BOTH),C.shouldComputePositionWC&&v.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,yr.BOTH),N(y.vertexShaderText)&&v.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,yr.VERTEX),N(y.fragmentShaderText)){v.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,yr.FRAGMENT);let E=hY.getDefineName(y.mode);v.addDefine(E,void 0,yr.FRAGMENT)}let w=y.uniforms;for(let E in w)if(w.hasOwnProperty(E)){let T=w[E];v.addUniform(T.type,E)}let A=y.varyings;for(let E in A)if(A.hasOwnProperty(E)){let T=A[E];v.addVarying(T,E)}o.uniformMap=va(o.uniformMap,y.uniformMap)};function qZt(o){let f={};for(let m=0;m1?(I=o.attributeIndex,o.attributeIndex+=S):M&&!w?I=0:I=o.attributeIndex++,h$t(o,T,I,S,x,C)}x$t(v,f.attributes),f.primitiveType===Fn.POINTS&&v.addDefine("PRIMITIVE_TYPE_POINTS"),v.addVertexLines(lwe),v.addFragmentLines(swe)};function h$t(o,f,m,v,y,x){let C=o.shaderBuilder,w=xl.getAttributeInfo(f),A=y&&!x;v>1?p$t(o,f,m,v):f$t(o,f,m,A),g$t(C,w,A),m$t(C,w),N(f.semantic)&&d$t(C,f),_$t(C,w,y),v$t(C,w,A),y$t(C,w)}function d$t(o,f){let m=f.semantic,v=f.setIndex;switch(m){case fa.NORMAL:o.addDefine("HAS_NORMALS");break;case fa.TANGENT:o.addDefine("HAS_TANGENTS");break;case fa.FEATURE_ID:o.addDefine(`HAS${m}_${v}`);break;case fa.TEXCOORD:case fa.COLOR:o.addDefine(`HAS_${m}_${v}`)}}function f$t(o,f,m,v){let y=f.quantization,x,C;N(y)?(x=y.type,C=y.componentDatatype):(x=f.type,C=f.componentDatatype);let w=f.semantic,A=f.setIndex;w===fa.FEATURE_ID&&A>=o.featureIdVertexAttributeSetIndex&&(o.featureIdVertexAttributeSetIndex=A+1);let E=w===fa.POSITION,T=E?0:m,S=Ks.getNumberOfComponents(x),M={index:T,value:N(f.buffer)?void 0:f.constant,vertexBuffer:f.buffer,count:f.count,componentsPerAttribute:S,componentDatatype:C,offsetInBytes:f.byteOffset,strideInBytes:f.byteStride,normalize:f.normalized};if(o.attributes.push(M),!E||!v)return;let I=o.runtimePrimitive.positionBuffer2D,P={index:m,vertexBuffer:I,count:f.count,componentsPerAttribute:S,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:f.normalized};o.attributes.push(P)}function p$t(o,f,m,v){let y=f.quantization,x,C;N(y)?(x=y.type,C=y.componentDatatype):(x=f.type,C=f.componentDatatype);let w=f.normalized,A=Ks.getNumberOfComponents(x)/v,E=Rt.getSizeInBytes(C),T=A*E,S=f.byteStride;for(let M=0;M0,E=!N(w)&&A;if(N(x)&&!E){let D=V$t(w),L=z$t(x,D);H$t(v,L);let R=U$t(L).indexOf("normalMC")>=0,O=xl.getAttributeBySemantic(f,fa.NORMAL);if(R&&!O)throw new sr("Style references the NORMAL semantic but the point cloud does not have normals");v.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,yr.VERTEX),L.styleTranslucent&&(o.alphaOptions.pass=vr.TRANSLUCENT)}let T=y.pointCloudShading;T.attenuation&&v.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,yr.VERTEX),T.backFaceCulling&&v.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,yr.VERTEX);let S,M,I;Lf.is3DTiles(y.type)&&(M=!0,S=y.content,I=S.tile.refine===Ug.ADD),v.addUniform("vec4","model_pointCloudParameters",yr.VERTEX),v.addVertexLines(_we);let P=o.uniformMap;P.model_pointCloudParameters=function(){let D=N$t,L=1;M&&(L=I?5:S.tileset.maximumScreenSpaceError),D.x=Z(T.maximumAttenuation,L),D.x*=m.pixelRatio;let R=F$t(o,f,T,S);D.y=R*T.geometricErrorScale;let O=m.context,F=m.camera.frustum,k;return m.mode===_i.SCENE2D||F instanceof Gs?k=Number.POSITIVE_INFINITY:k=O.drawingBufferHeight/m.camera.frustum.sseDenominator,D.z=k,M&&(D.w=S.tileset.timeSinceLoad),D}};var Gke=new H;function F$t(o,f,m,v){if(N(v)){let E=v.tile.geometricError;if(E>0)return E}if(N(m.baseResolution))return m.baseResolution;let y=xl.getAttributeBySemantic(f,fa.POSITION),x=y.count,C=o.runtimeNode.transform,w=H.subtract(y.max,y.min,Gke);w=Ee.multiplyByPointAsVector(C,w,Gke);let A=w.x*w.y*w.z;return xe.cbrt(A/x)}var B$t={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},k$t={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function V$t(o){let f=uo(k$t);if(!N(o))return f;for(let m=0;m0,T=N(v.skin),S=N(x),M=!(S&&N(x.fragmentShaderText))||x.mode!==hY.REPLACE_MATERIAL,I=xl.hasQuantizedAttributes(m.attributes),P=y.debugWireframe&&Fn.isTriangles(m.primitiveType)&&(y._enableDebugWireframe||w),D=y.pointCloudShading,L=N(D)&&D.attenuation,R=N(D)&&D.backFaceCulling,O=m.primitiveType===Fn.POINTS&&(N(C)||L||R),F=y._enableShowOutline&&N(m.outlineCoordinates),k=uei(y,v,m),U=N(y.classificationType);A&&f.push(wwe),f.push(uwe),P&&f.push(Swe),U&&f.push(Jbe),E&&f.push(mwe),T&&f.push(Ewe),O&&f.push(vwe),I&&f.push(awe),M&&f.push(fwe),f.push(uq),f.push(hM),k.hasPropertyTable&&(f.push(lj),f.push(Xbe),f.push(Zbe)),S&&f.push(owe),f.push(hwe),y.allowPicking&&f.push(gwe),F&&f.push(Cwe),f.push(qbe),f.push(bwe)};function uei(o,f,m){let v;return N(f.instances)&&(v=xl.getFeatureIdsByLabel(f.instances.featureIds,o.instanceFeatureIdLabel),N(v))?{hasFeatureIds:!0,hasPropertyTable:N(v.propertyTableId)}:(v=xl.getFeatureIdsByLabel(m.featureIds,o.featureIdLabel),N(v)?{hasFeatureIds:!0,hasPropertyTable:N(v.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var Pwe=IQe;function Iwe(o){o=Z(o,Z.EMPTY_OBJECT),this._sceneGraph=o.sceneGraph;let f=o.skin;this._skin=f,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],cei(this)}Object.defineProperties(Iwe.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function cei(o){let f=o.skin,m=f.inverseBindMatrices;o._inverseBindMatrices=m;let v=f.joints,y=v.length,x=o.sceneGraph._runtimeNodes,C=o.joints,w=o._jointMatrices;for(let A=0;A czm_splitPosition) discard; if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; #endif } `,Z$={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};Z$.process=function(o,f,m){let v=o.shaderBuilder;v.addDefine("HAS_MODEL_SPLITTER",void 0,yr.FRAGMENT),v.addFragmentLines(zwe);let y={};v.addUniform("float",Z$.SPLIT_DIRECTION_UNIFORM_NAME,yr.FRAGMENT),y[Z$.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return f.splitDirection},o.uniformMap=va(y,o.uniformMap)};var Hwe=Z$;function gei(o,f){this.model=o.model,this.shaderBuilder=o.shaderBuilder.clone(),this.uniformMap=uo(o.uniformMap),this.alphaOptions=uo(o.alphaOptions),this.renderStateOptions=uo(o.renderStateOptions,!0),this.hasSilhouette=o.hasSilhouette,this.hasSkipLevelOfDetail=o.hasSkipLevelOfDetail,this.runtimeNode=f,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var Uwe=gei;function _ei(o){o=Z(o,Z.EMPTY_OBJECT),this.lightingModel=Z(o.lightingModel,pC.UNLIT)}var Gwe=_ei;function vei(o,f){this.model=o.model,this.runtimeNode=o.runtimeNode,this.attributes=o.attributes.slice(),this.attributeIndex=o.attributeIndex,this.featureIdVertexAttributeSetIndex=o.featureIdVertexAttributeSetIndex,this.uniformMap=uo(o.uniformMap),this.alphaOptions=uo(o.alphaOptions),this.renderStateOptions=uo(o.renderStateOptions,!0),this.hasSilhouette=o.hasSilhouette,this.hasSkipLevelOfDetail=o.hasSkipLevelOfDetail,this.shaderBuilder=o.shaderBuilder.clone(),this.instanceCount=o.instanceCount,this.runtimePrimitive=f;let m=f.primitive;this.count=N(m.indices)?m.indices.count:xl.getAttributeBySemantic(m,"POSITION").count,this.hasPropertyTable=!1,this.indices=m.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=m.primitiveType;let v=xl.getPositionMinMax(m,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=H.clone(v.min,new H),this.positionMax=H.clone(v.max,new H),this.boundingSphere=Pi.fromCornerPoints(this.positionMin,this.positionMax,new Pi),this.lightingOptions=new Gwe,this.pickId=void 0}var Wwe=vei,jwe=`#ifdef MODEL_FLATTEN // \u5728\u8303\u56F4\u5185 bool isPointInBound(vec4 point, vec4 bounds) { return (point.x>bounds.x && point.xbounds.w); } float unpackDepth(const in vec4 rgba_depth) { // \u89E3\u7801\u6DF1\u5EA6 const vec4 bitShifts = vec4(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0), 1.0 / (255.0 * 255.0 * 255.0)); float depth=dot(rgba_depth, bitShifts); return depth; } void modelFlatten(out vec3 vPosition) { if (u_bFlatten && !u_clipPlaneOfFlatten && !u_ripple && !u_regionSnow && !u_heightFog) { // \u53D8\u6362\u5230\u4E16\u754C\u4F4D\u7F6E\uFF0C\u7136\u540E\u53C8\u5230 vec4 m_position = u_r_eastNorthUpToFixedFrame * vec4(vPosition, 1.0); // \u662F\u5426\u5728\u8303\u56F4\u5185 if (isPointInBound(m_position, u_polygonBounds)) { vec2 texCoord; // texCoord.x = (m_position.x-u_polygonBounds.x)/(u_polygonBounds.z-u_polygonBounds.x); texCoord.y = (m_position.y-u_polygonBounds.w)/(u_polygonBounds.y-u_polygonBounds.w); // \u56FE\u7247\u5927\u5C0F\u662F float texelSize = 1.0/4096.0; // \u89E3\u7801\u6DF1\u5EA6 float depth0 = unpackDepth(texture(u_polygonTexture, texCoord.xy)); float depth1 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(-texelSize, 0.0))); float depth2 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(texelSize, 0.0))); float depth3 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, -texelSize))); float depth4 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, texelSize))); // \u83B7\u53D6\u6700\u5C0F\u7684\u6DF1\u5EA6 float minDepth = min(min(min(min(depth0, depth1), depth2), depth3), depth4); if (minDepth*5000.0 > 1.0) { float depth = max(max(max(max(depth0, depth1), depth2), depth3), depth4); m_position.z = depth*5000.0 + m_position.z * 0.01; } vPosition = (u_eastNorthUpToFixedFrame * m_position).xyz; } } if (u_bFlatten && u_clipPlaneOfFlatten) { v_position = vPosition; } if (u_bFlatten && (u_ripple || u_regionSnow || u_heightFog)) { v_position = vPosition ; } } #endif `,Ywe=`#ifdef MODEL_FLATTEN // \u5728\u8303\u56F4\u5185 bool isPointInBound(vec4 point, vec4 bounds) { return (point.x>bounds.x && point.xbounds.w); } float unpackDepth(const in vec4 rgba_depth) { // \u89E3\u7801\u6DF1\u5EA6 const vec4 bitShifts = vec4(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0), 1.0 / (255.0 * 255.0 * 255.0)); float depth=dot(rgba_depth, bitShifts); return depth; } float regionGradient(vec4 point, vec4 bounds, float distance) { float rate1 = min((point.x - bounds.x) / distance, (bounds.z - point.x) / distance); float rate2 = min((point.y - bounds.w) / distance, (bounds.y - point.y) / distance); float rate = smoothstep(0.0, 1.0, rate1 * rate2); return rate; } #define MAX_RADIUS 2 #define DOUBLE_HASH 0 #define HASHSCALE1 .1031 #define HASHSCALE3 vec3(.1031, .1030, .0973) float hash12(vec2 p) { vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1); p3 += dot(p3, p3.yzx + 19.19); return fract((p3.x + p3.y) * p3.z); } vec2 hash22(vec2 p) { vec3 p3 = fract(vec3(p.xyx) * HASHSCALE3); p3 += dot(p3, p3.yzx+19.19); return fract((p3.xx+p3.yz)*p3.zy); } void rippleImage( out vec4 fragColor, in vec2 fragCoord ) { float iTime = czm_frameNumber / 30.0; vec2 uv = fragCoord.xy * 10.0; vec2 p0 = floor(uv); vec2 circles = vec2(0.); for (int j = -MAX_RADIUS; j <= MAX_RADIUS; ++j) { for (int i = -MAX_RADIUS; i <= MAX_RADIUS; ++i) { vec2 pi = p0 + vec2(i, j); #if DOUBLE_HASH vec2 hsh = hash22(pi); #else vec2 hsh = pi; #endif vec2 p = pi + hash22(hsh); float t = fract(0.8*iTime + hash12(hsh)); vec2 v = p - uv; float d = length(v) - (float(MAX_RADIUS) + 1.)*t; float h = 1e-3; float d1 = d - h; float d2 = d + h; float p1 = sin(31.*d1) * smoothstep(-0.6, -0.3, d1) * smoothstep(0., -0.3, d1); float p2 = sin(31.*d2) * smoothstep(-0.6, -0.3, d2) * smoothstep(0., -0.3, d2); circles += 0.5 * normalize(v) * ((p2 - p1) / (2. * h) * (1. - t) * (1. - t)); } } circles /= float((MAX_RADIUS*2+1)*(MAX_RADIUS*2+1)); float intensity = mix(0.01, 0.15, smoothstep(0.1, 0.6, abs(fract(0.05*iTime + 0.5)*2.-1.))); vec3 n = vec3(circles, sqrt(1. - dot(circles, circles))); vec3 color = vec3(0.0) + 5.*pow(clamp(dot(n, normalize(vec3(1., 0.7, 0.5))), 0., 1.), 6.); fragColor = vec4(color, 1.0); } vec4 modelFlatten(ProcessedAttributes attributes, czm_modelMaterial material){ vec4 rippleColor = vec4(0.0); if (u_bFlatten) { if(u_clipPlaneOfFlatten){ // \u53D8\u6362\u5230\u4E16\u754C\u4F4D\u7F6E\uFF0C\u7136\u540E\u53C8\u5230 vec4 m_position = u_r_eastNorthUpToFixedFrame *vec4(v_position, 1.0); // \u662F\u5426\u5728\u8303\u56F4\u5185 if (isPointInBound(m_position, u_polygonBounds)) { vec2 texCoord; texCoord.x = (m_position.x-u_polygonBounds.x)/(u_polygonBounds.z-u_polygonBounds.x); texCoord.y = (m_position.y-u_polygonBounds.w)/(u_polygonBounds.y-u_polygonBounds.w); // \u56FE\u7247\u5927\u5C0F\u662F float texelSize = 1.0/4096.0; // \u89E3\u7801\u6DF1\u5EA6 float depth0 = unpackDepth(texture(u_polygonTexture, texCoord.xy)); float depth1 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(-texelSize, 0.0))); float depth2 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(texelSize, 0.0))); float depth3 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, -texelSize))); float depth4 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, texelSize))); // \u83B7\u53D6\u6700\u5C0F\u7684\u6DF1\u5EA6 float minDepth = min(min(min(min(depth0, depth1), depth2), depth3), depth4); // if (minDepth*5000.0 > 1.0) { //if(m_position.z > minDepth*5000.0) { discard; //} } } } if(u_ripple || u_regionSnow || u_heightFog) { // \u53D8\u6362\u5230\u4E16\u754C\u4F4D\u7F6E\uFF0C\u7136\u540E\u53C8\u5230 vec4 m_position = u_r_eastNorthUpToFixedFrame *vec4(v_position, 1.0); // \u662F\u5426\u5728\u8303\u56F4\u5185 if (isPointInBound(m_position, u_polygonBounds)) { vec2 texCoord; texCoord.x = (m_position.x-u_polygonBounds.x)/(u_polygonBounds.z-u_polygonBounds.x); texCoord.y = (m_position.y-u_polygonBounds.w)/(u_polygonBounds.y-u_polygonBounds.w); // \u56FE\u7247\u5927\u5C0F\u662F float texelSize = 1.0/4096.0; // \u89E3\u7801\u6DF1\u5EA6 float depth0 = unpackDepth(texture(u_polygonTexture, texCoord.xy)); float depth1 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(-texelSize, 0.0))); float depth2 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(texelSize, 0.0))); float depth3 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, -texelSize))); float depth4 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, texelSize))); // \u83B7\u53D6\u6700\u5C0F\u7684\u6DF1\u5EA6 float minDepth = min(min(min(min(depth0, depth1), depth2), depth3), depth4); // if (minDepth*5000.0 > 1.0) { float rate = regionGradient(m_position, u_polygonBounds, u_regionGradientDistance); if(u_ripple || u_regionSnow){ vec3 surfaceNormal = vec3(0.0); #ifdef HAS_NORMALS surfaceNormal = material.normalEC; #else vec3 positionEC = attributes.positionEC; vec3 pos_dx = dFdx(positionEC); vec3 pos_dy = dFdy(positionEC); surfaceNormal = normalize(cross(normalize(pos_dx),normalize(pos_dy))); #endif //float angle = acos(dot(surfaceNormal, normalize((u_tilesetMatrix[1]).xyz))); float angle = dot(surfaceNormal, normalize(u_tilesetNormal)); if(u_ripple){ if(angle > 0.2) { vec4 enuPos = u_tilesetMatrix * vec4(attributes.positionEC, 1.0); vec4 fragColor; rippleImage(fragColor, enuPos.xy); rippleColor.rgb = fragColor.rgb; rippleColor.a = u_regionAlpha * rate; } } else { angle = pow(angle, 5.0); rippleColor = vec4(0.8,0.8,0.8,clamp(angle, 0.0, 1.0) * u_regionAlpha * rate); } } if(u_heightFog){ vec4 localPos = u_tilesetMatrix * vec4(attributes.positionEC, 1.0); if(localPos.z < u_fogHeight){ rippleColor = vec4(0.8,0.8,0.8, 1.0-clamp(localPos.z / u_fogHeight, 0.2, 1.0) * u_regionAlpha); } rippleColor.a *= rate; } } } } } return rippleColor; } vec3 blendWeather(in vec4 color, in vec4 rippleColor){ if (u_bFlatten && (u_ripple || u_regionSnow || u_heightFog)) { color.rgb = mix(color.rgb, rippleColor.rgb, rippleColor.a); } return color.rgb; } #endif `,DQe={name:"ModelFlattenPipelineStage"};DQe.process=function(o,f,m){let v=f._content.tileset,y=o.shaderBuilder;y.addDefine("MODEL_FLATTEN",void 0,yr.BOTH),y.addVarying("vec3","v_position");let x=["mat4","u_eastNorthUpToFixedFrame","mat4","u_r_eastNorthUpToFixedFrame","bool","u_bFlatten","vec4","u_polygonBounds","sampler2D","u_polygonTexture","bool","u_clipPlaneOfFlatten","bool","u_ripple","bool","u_regionSnow","bool","u_heightFog","float","u_regionAlpha","float","u_regionGradientDistance","float","u_fogHeight","mat4","u_tilesetMatrix","vec3","u_tilesetNormal"];for(let T=0;T0&&(S=E_(m,f,w),f+=w,A>0&&(M=new Uint8Array(o,f,A),f+=A));let I=new qU(E,T),P=I.getGlobalProperty("POINTS_LENGTH");if(I.featuresLength=P,!N(P))throw new sr("Feature table global property: POINTS_LENGTH must be defined");let D=I.getGlobalProperty("RTC_CENTER",Rt.FLOAT,3);N(D)&&(D=H.unpack(D));let L=Nei(I,S);if(L.rtcCenter=D,L.pointsLength=P,!L.hasPositions){let R=Fei(I);L.positions=R,L.hasPositions=L.hasPositions||N(R)}if(!L.hasPositions)throw new sr("Either POSITION or POSITION_QUANTIZED must be defined.");if(!L.hasNormals){let R=kei(I);L.normals=R,L.hasNormals=L.hasNormals||N(R)}if(!L.hasColors){let R=Bei(I);L.colors=R,L.hasColors=L.hasColors||N(R),L.hasConstantColor=N(L.constantColor),L.isTranslucent=N(R)&&R.isTranslucent}if(!L.hasBatchIds){let R=Vei(I);L.batchIds=R,L.hasBatchIds=L.hasBatchIds||N(R)}if(L.hasBatchIds){let R=I.getGlobalProperty("BATCH_LENGTH");if(!N(R))throw new sr("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");L.batchLength=R}return N(M)&&(M=new Uint8Array(M),L.batchTableJson=S,L.batchTableBinary=M),L};function Nei(o,f){let m=o.json,v,y,x,C=N(m.extensions)?m.extensions["3DTILES_draco_point_compression"]:void 0,w=N(f)&&N(f.extensions)?f.extensions["3DTILES_draco_point_compression"]:void 0;N(w)&&(x=w.properties);let A,E,T,S,M;if(N(C)){y=C.properties;let P=C.byteOffset,D=C.byteLength;if(!N(y)||!N(P)||!N(D))throw new sr("Draco properties, byteOffset, and byteLength must be defined");v=o.buffer.slice(P,P+D),A=N(y.POSITION),E=N(y.RGB)||N(y.RGBA),T=N(y.NORMAL),S=N(y.BATCH_ID),M=N(y.RGBA)}let I;return N(v)&&(I={buffer:v,featureTableProperties:y,batchTableProperties:x,properties:va(y,x),dequantizeInShader:!0}),{draco:I,hasPositions:A,hasColors:E,isTranslucent:M,hasNormals:T,hasBatchIds:S}}function Fei(o){let f=o.json,m;if(N(f.POSITION))return m=o.getPropertyArray("POSITION",Rt.FLOAT,3),{name:fa.POSITION,semantic:fa.POSITION,typedArray:m,isQuantized:!1,componentDatatype:Rt.FLOAT,type:Ks.VEC3};if(N(f.POSITION_QUANTIZED)){m=o.getPropertyArray("POSITION_QUANTIZED",Rt.UNSIGNED_SHORT,3);let v=o.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Rt.FLOAT,3);if(!N(v))throw new sr("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let y=65536-1,x=o.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Rt.FLOAT,3);if(!N(x))throw new sr("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:fa.POSITION,semantic:fa.POSITION,typedArray:m,isQuantized:!0,componentDatatype:Rt.FLOAT,type:Ks.VEC3,quantizedRange:y,quantizedVolumeOffset:H.unpack(x),quantizedVolumeScale:H.unpack(v),quantizedComponentDatatype:Rt.UNSIGNED_SHORT,quantizedType:Ks.VEC3}}}function Bei(o){let f=o.json,m;if(N(f.RGBA))return m=o.getPropertyArray("RGBA",Rt.UNSIGNED_BYTE,4),{name:fa.COLOR,semantic:fa.COLOR,setIndex:0,typedArray:m,componentDatatype:Rt.UNSIGNED_BYTE,type:Ks.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(N(f.RGB))return m=o.getPropertyArray("RGB",Rt.UNSIGNED_BYTE,3),{name:"COLOR",semantic:fa.COLOR,setIndex:0,typedArray:m,componentDatatype:Rt.UNSIGNED_BYTE,type:Ks.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(N(f.RGB565))return m=o.getPropertyArray("RGB565",Rt.UNSIGNED_SHORT,1),{name:"COLOR",semantic:fa.COLOR,setIndex:0,typedArray:m,componentDatatype:Rt.FLOAT,type:Ks.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(N(f.CONSTANT_RGBA)){let v=o.getGlobalProperty("CONSTANT_RGBA",Rt.UNSIGNED_BYTE,4),y=v[3],x=Re.fromBytes(v[0],v[1],v[2],y),C=y<255;return{name:fa.COLOR,semantic:fa.COLOR,setIndex:0,constantColor:x,componentDatatype:Rt.FLOAT,type:Ks.VEC4,isQuantized:!1,isTranslucent:C}}}function kei(o){let f=o.json,m;if(N(f.NORMAL))return m=o.getPropertyArray("NORMAL",Rt.FLOAT,3),{name:fa.NORMAL,semantic:fa.NORMAL,typedArray:m,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Rt.FLOAT,type:Ks.VEC3};if(N(f.NORMAL_OCT16P)){m=o.getPropertyArray("NORMAL_OCT16P",Rt.UNSIGNED_BYTE,2);let v=8;return{name:fa.NORMAL,semantic:fa.NORMAL,typedArray:m,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<0&&sti(o,w,S,f),N(m.rtcCenter)&&(T.transform=Ee.multiplyByTranslation(T.transform,m.rtcCenter,T.transform));let M=m.positions;N(M)&&M.isQuantized&&(T.transform=Ee.multiplyByTranslation(T.transform,M.quantizedVolumeOffset,T.transform)),o._components=T,o._parsedContent=void 0,o._arrayBuffer=void 0}function sti(o,f,m,v){let y=f.attributes,x=m.length;for(let C=0;C{this._completeLoad=()=>(A(this),!1),this._rejectLoad=T=>(E(T),!1)}),this._loader instanceof Lne?this._texturesLoadedPromise=Promise.resolve(this):this._texturesLoadedPromise=new Promise((A,E)=>{this._completeTexturesLoad=()=>(A(this),!1),this._rejectTexturesLoad=T=>(E(T),!1)}),this._loader.load().catch(A=>{this.isDestroyed()||!N(this._loader)||this._loader.isDestroyed()||(this._rejectLoad=this._rejectLoad(xl.getError("model",this._resource,A)))})),this._errorEvent=new Br,this._readyEvent=new Br,this._texturesReadyEvent=new Br,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=o.pickObject,this.underGroundMode={enabled:!1},this.flattenEnabled=!1}function hZ(o,f){if(o._errorEvent.numberOfListeners>0){o._errorEvent.raiseEvent(f);return}console.log(f)}function lti(o,f){let m=o._featureTables,v=f.propertyTables,y=v.length;for(let x=0;x0&&f===0||o===0&&f>0;this._silhouetteDirty=this._silhouetteDirty||m,this._backFaceCullingDirty=this._backFaceCullingDirty||m}this._silhouetteSize=o}},boundingSphere:{get:function(){let o=N(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return kQe(this,o),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(o){this._debugShowBoundingVolume!==o&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=o}},debugWireframe:{get:function(){return this._debugWireframe},set:function(o){this._debugWireframe!==o&&this.resetDrawCommands(),this._debugWireframe=o,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Lf.GLTF&&Ba("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(o){this._show=o}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(o){typeof o=="number"&&(o=`featureId_${o}`),o!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=o}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(o){typeof o=="number"&&(o=`instanceFeatureId_${o}`),o!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=o}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(o){o!==this._clippingPlanes&&(Uv.setOwner(o,this,"_clippingPlanes"),this.resetDrawCommands())}},lightColor:{get:function(){return this._lightColor},set:function(o){N(o)!==N(this._lightColor)&&this.resetDrawCommands(),this._lightColor=H.clone(o,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(o){o!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=o,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(o){o!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=o}},scale:{get:function(){return this._scale},set:function(o){o!==this._scale&&(this._updateModelMatrix=!0),this._scale=o}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(o){o!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=o}},maximumScale:{get:function(){return this._maximumScale},set:function(o){o!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=o}},shadows:{get:function(){return this._shadows},set:function(o){o!==this._shadows&&(this._shadowsDirty=!0),this._shadows=o}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(o){this._showCreditsOnScreen!==o&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=o}},splitDirection:{get:function(){return this._splitDirection},set:function(o){this._splitDirection!==o&&this.resetDrawCommands(),this._splitDirection=o}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});eh.prototype.getNode=function(o){return this._nodesByName[o]};eh.prototype.setArticulationStage=function(o,f){this._sceneGraph.setArticulationStage(o,f)};eh.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};eh.prototype.makeStyleDirty=function(){this._styleDirty=!0};eh.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var cti=new Ee,hti=new Ut,dti=new Ee;eh.prototype.update=function(o){let f=!1;try{f=fti(this,o)}catch(m){if(this._loader.incrementallyLoadTextures)if(m.name==="TextureError")hZ(this,m),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(m);else{let v=xl.getError("model",this._resource,m);hZ(this,v),this._rejectLoad=this._rejectLoad&&this._rejectLoad(v)}else{let v=xl.getError("model",this._resource,m);hZ(this,v),this._rejectLoad=this._rejectLoad&&this._rejectLoad(v),this._rejectTexturesLoad=this._rejectTexturesLoad&&this._rejectTexturesLoad(v)}}if(this._loader.update&&this._loader.update(o),pti(this,o),mti(this,o),!this._resourcesLoaded&&f){this._resourcesLoaded=!0;let m=this._loader.components;if(!N(m)){if(this._loader.isUnloaded())return;let x=xl.getError("model",this._resource,new sr("Failed to load model."));hZ(x),this._rejectLoad=this._rejectLoad&&this._rejectLoad(x)}let v=m.structuralMetadata;N(v)&&v.propertyTableCount>0&<i(this,v);let y=new Xwe({model:this,modelComponents:m});this._sceneGraph=y,this._gltfCredits=y.components.asset.credits}if(!(!this._resourcesLoaded||o.mode===_i.MORPHING)){if(gti(this),_ti(this),vti(this,o),yti(this),xti(this,o),Cti(this,o),bti(this,o),Lf.is3DTiles(this.type)&&wti(this,o),Ati(this,o),this._defaultTexture=o.context.defaultTexture,!Lf.is3DTiles(this.type))Yke(this,o);else{let m=this._content.tileset;Yke(this,o,m)}if(Eti(this,o),Tti(this),Sti(this,o),Mti(this,o),!this._ready){o.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this),this._completeLoad=this._completeLoad&&this._completeLoad(),this._loader.incrementallyLoadTextures||(this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad())});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this),this._completeTexturesLoad=this._completeTexturesLoad&&this._completeTexturesLoad()),Iti(this),Dti(this,o),Lti(this),Rti(this,o)}};function fti(o,f){return!o._resourcesLoaded||!o._texturesLoaded?(f.afterRender.push(()=>!0),o._loader.process(f)):!0}function pti(o,f){N(o._customShader)&&o._customShader.update(f)}function mti(o,f){o._imageBasedLighting.update(f),o._imageBasedLighting.shouldRegenerateShaders&&o.resetDrawCommands()}function gti(o){if(!o._featureTableIdDirty)return;o._featureTableIdDirty=!1;let f=o._sceneGraph.components,m=f.structuralMetadata;N(m)&&m.propertyTableCount>0&&(o.featureTableId=uti(f,o),o._styleDirty=!0,o.resetDrawCommands())}function _ti(o){o._styleDirty&&(o.applyStyle(o._style),o._styleDirty=!1)}function vti(o,f){let m=o._featureTables,v=m.length,y=!1;for(let x=0;x=v&&x<=y}function Bti(o,f){let m=f.creditDisplay,v=o._credit;N(v)&&m.addCreditToNextFrame(v);let y=o._resourceCredits,x=y.length;for(let A=0;A0&&o.alpha<1};eh.prototype.isInvisible=function(){let o=this.color;return N(o)&&o.alpha===0};function VQe(o){return o.context.stencilBuffer}eh.prototype.hasSilhouette=function(o){return VQe(o)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!N(this._classificationType)};eh.prototype.hasSkipLevelOfDetail=function(o){if(!Lf.is3DTiles(this.type))return!1;let f=o.context.stencilBuffer,m=this._content.tileset;return f&&m.isSkippingLevelOfDetail};eh.prototype.isClippingEnabled=function(){let o=this._clippingPlanes;return N(o)&&o.enabled&&o.length!==0};eh.prototype.isDestroyed=function(){return!1};eh.prototype.destroy=function(){let o=this._loader;N(o)&&o.destroy();let f=this._featureTables;if(N(f)){let v=f.length;for(let y=0;y0,v=N(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,y=N(v)&&N(v[0]);if(f&&(!m||y)){this.resetDrawCommands();return}m?(this.featureTables[this.featureTableId].applyStyle(o),BQe(this,o)):(this.applyColorAndShow(o),this._styleCommandsNeeded=void 0)};function NB(o,f,m){return{loader:o,type:f,resource:m.resource,show:m.show,modelMatrix:m.modelMatrix,scale:m.scale,minimumPixelSize:m.minimumPixelSize,maximumScale:m.maximumScale,id:m.id,allowPicking:m.allowPicking,clampAnimations:m.clampAnimations,shadows:m.shadows,debugShowBoundingVolume:m.debugShowBoundingVolume,enableDebugWireframe:m.enableDebugWireframe,debugWireframe:m.debugWireframe,cull:m.cull,opaquePass:m.opaquePass,customShader:m.customShader,content:m.content,heightReference:m.heightReference,scene:m.scene,distanceDisplayCondition:m.distanceDisplayCondition,color:m.color,colorBlendAmount:m.colorBlendAmount,colorBlendMode:m.colorBlendMode,silhouetteColor:m.silhouetteColor,silhouetteSize:m.silhouetteSize,enableShowOutline:m.enableShowOutline,showOutline:m.showOutline,outlineColor:m.outlineColor,clippingPlanes:m.clippingPlanes,lightColor:m.lightColor,imageBasedLighting:m.imageBasedLighting,backFaceCulling:m.backFaceCulling,credit:m.credit,showCreditsOnScreen:m.showCreditsOnScreen,splitDirection:m.splitDirection,projectTo2D:m.projectTo2D,featureIdLabel:m.featureIdLabel,instanceFeatureIdLabel:m.instanceFeatureIdLabel,pointCloudShading:m.pointCloudShading,classificationType:m.classificationType,pickObject:m.pickObject}}var S_=eh;function Yg(o,f,m){this._tileset=o,this._tile=f,this._resource=m,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1,this._resolveContent=void 0,this._readyPromise=void 0}Object.defineProperties(Yg.prototype,{featuresLength:{get:function(){let o=this._model,f=o.featureTables,m=o.featureTableId;return N(f)&&N(f[m])?f[m].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let o=this._model.statistics;return o.propertyTablesByteLength+o.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("Model3DTileContent.readyPromise","Model3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Model3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let o=this._model,f=o.featureTables,m=o.featureTableId;if(N(f)&&N(f[m]))return f[m]}},metadata:{get:function(){return this._metadata},set:function(o){this._metadata=o}},group:{get:function(){return this._group},set:function(o){this._group=o}}});Yg.prototype.getFeature=function(o){let f=this._model,m=f.featureTableId;return f.featureTables[m].getFeature(o)};Yg.prototype.hasProperty=function(o,f){let m=this._model,v=m.featureTableId;return N(v)?m.featureTables[v].hasProperty(o,f):!1};Yg.prototype.applyDebugSettings=function(o,f){f=o?f:Re.WHITE,this.featuresLength===0?this._model.color=f:N(this.batchTable)&&this.batchTable.setAllColor(f)};Yg.prototype.applyStyle=function(o){this._model.style=o};Yg.prototype.update=function(o,f){let m=this._model,v=this._tile;m.colorBlendAmount=o.colorBlendAmount,m.colorBlendMode=o.colorBlendMode,m.modelMatrix=v.computedTransform,m.customShader=o.customShader,m.featureIdLabel=o.featureIdLabel,m.instanceFeatureIdLabel=o.instanceFeatureIdLabel,m.lightColor=o.lightColor,m.imageBasedLighting=o.imageBasedLighting,m.backFaceCulling=o.backFaceCulling,m.shadows=o.shadows,m.showCreditsOnScreen=o.showCreditsOnScreen,m.splitDirection=o.splitDirection,m.debugWireframe=o.debugWireframe,m.showOutline=o.showOutline,m.outlineColor=o.outlineColor,m.pointCloudShading=o.pointCloudShading;let y=o.clippingPlanes;m.referenceMatrix=o.clippingPlanesOriginMatrix,N(y)&&v.clippingPlanesDirty&&(m._clippingPlanes=y.enabled&&v._isClipped?y:void 0),N(m._clippingPlanes)&&m._clippingPlanes!==y&&(m._clippingPlanes=y,m._clippingPlanesState=0),m.update(f),!this._ready&&m.ready&&(m.activeAnimations.addAll({loop:RE.REPEAT}),this._ready=!0,this._resolveContent=this._resolveContent&&this._resolveContent(this))};Yg.prototype.isDestroyed=function(){return!1};Yg.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),kr(this)};Yg.fromGltf=async function(o,f,m,v){let y=new Yg(o,f,m),x=cq(o,f,y,{gltf:v,basePath:m}),C=o.vectorClassificationOnly?void 0:o.classificationType;x.classificationType=C;let w=await S_.fromGltfAsync(x);return y._model=w,y._readyPromise=new Promise(A=>{y._resolveContent=A}),y};Yg.fromB3dm=async function(o,f,m,v,y){let x=new Yg(o,f,m),C=cq(o,f,x,{arrayBuffer:v,byteOffset:y,resource:m}),w=o.vectorClassificationOnly?void 0:o.classificationType;C.classificationType=w;let A=await S_.fromB3dm(C);return A.underGroundMode=o._underGroundMode,x._model=A,x._readyPromise=new Promise(E=>{x._resolveContent=E}),x};Yg.fromI3dm=async function(o,f,m,v,y){let x=new Yg(o,f,m),C=cq(o,f,x,{arrayBuffer:v,byteOffset:y,resource:m}),w=await S_.fromI3dm(C);return x._model=w,x._readyPromise=new Promise(A=>{x._resolveContent=A}),x};Yg.fromPnts=async function(o,f,m,v,y){let x=new Yg(o,f,m),C=cq(o,f,x,{arrayBuffer:v,byteOffset:y,resource:m}),w=await S_.fromPnts(C);return x._model=w,x._readyPromise=new Promise(A=>{x._resolveContent=A}),x};Yg.fromGeoJson=async function(o,f,m,v){let y=new Yg(o,f,m),x=cq(o,f,y,{geoJson:v,resource:m}),C=await S_.fromGeoJson(x);return y._model=C,y._readyPromise=new Promise(w=>{y._resolveContent=w}),y};function cq(o,f,m,v){let y={cull:!1,releaseGltfJson:!0,opaquePass:vr.CESIUM_3D_TILE,modelMatrix:f.computedTransform,upAxis:o._modelUpAxis,forwardAxis:o._modelForwardAxis,incrementallyLoadTextures:!1,customShader:o.customShader,content:m,colorBlendMode:o.colorBlendMode,colorBlendAmount:o.colorBlendAmount,lightColor:o.lightColor,imageBasedLighting:o.imageBasedLighting,featureIdLabel:o.featureIdLabel,instanceFeatureIdLabel:o.instanceFeatureIdLabel,pointCloudShading:o.pointCloudShading,clippingPlanes:o.clippingPlanes,backFaceCulling:o.backFaceCulling,shadows:o.shadows,showCreditsOnScreen:o.showCreditsOnScreen,splitDirection:o.splitDirection,enableDebugWireframe:o._enableDebugWireframe,debugWireframe:o.debugWireframe,projectTo2D:o._projectTo2D,enableShowOutline:o._enableShowOutline,showOutline:o.showOutline,outlineColor:o.outlineColor};return va(v,y)}var PR=Yg;function tT(o,f,m){this._tileset=o,this._tile=f,this._resource=m,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._readyPromise=Promise.resolve(this)}Object.defineProperties(tT.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("Tileset3DTileContent.readyPromise","Tileset3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Tileset3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(o){this._metadata=o}},group:{get:function(){return this._group},set:function(o){this._group=o}}});tT.fromJson=function(o,f,m,v){let y=new tT(o,f,m);return y._tileset.loadTileset(y._resource,v,y._tile),y._ready=!0,y};tT.prototype.hasProperty=function(o,f){return!1};tT.prototype.getFeature=function(o){};tT.prototype.applyDebugSettings=function(o,f){};tT.prototype.applyStyle=function(o){};tT.prototype.update=function(o,f){};tT.prototype.isDestroyed=function(){return!1};tT.prototype.destroy=function(){return kr(this)};var Kwe=tT;function kti(o,f,m,v,y){return function(){let x=document.createElement("canvas"),C=y+2*v;x.height=x.width=C;let w=x.getContext("2d");return w.clearRect(0,0,C,C),v!==0&&(w.beginPath(),w.arc(C/2,C/2,C/2,0,2*Math.PI,!0),w.closePath(),w.fillStyle=m,w.fill(),o<1&&(w.save(),w.globalCompositeOperation="destination-out",w.beginPath(),w.arc(C/2,C/2,y/2,0,2*Math.PI,!0),w.closePath(),w.fillStyle="black",w.fill(),w.restore())),w.beginPath(),w.arc(C/2,C/2,y/2,0,2*Math.PI,!0),w.closePath(),w.fillStyle=f,w.fill(),x}}var Rne=kti;function R0(o,f,m,v,y){this._content=o,this._billboard=m,this._label=v,this._polyline=y,this._batchId=f,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),az(this)}var Vti=new Mt;Object.defineProperties(R0.prototype,{show:{get:function(){return this._label.show},set:function(o){this._label.show=o,this._billboard.show=o,this._polyline.show=o}},color:{get:function(){return this._color},set:function(o){this._color=Re.clone(o,this._color),az(this)}},pointSize:{get:function(){return this._pointSize},set:function(o){this._pointSize=o,az(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(o){this._pointOutlineColor=Re.clone(o,this._pointOutlineColor),az(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(o){this._pointOutlineWidth=o,az(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(o){this._label.fillColor=o,this._polyline.show=this._label.show&&o.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(o){this._label.outlineColor=o}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(o){this._label.outlineWidth=o}},font:{get:function(){return this._label.font},set:function(o){this._label.font=o}},labelStyle:{get:function(){return this._label.style},set:function(o){this._label.style=o}},labelText:{get:function(){return this._label.text},set:function(o){N(o)||(o=""),this._label.text=o}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(o){this._label.backgroundColor=o}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(o){this._label.backgroundPadding=o}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(o){this._label.showBackground=o}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(o){this._label.scaleByDistance=o,this._billboard.scaleByDistance=o}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(o){this._label.translucencyByDistance=o,this._billboard.translucencyByDistance=o}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(o){this._label.distanceDisplayCondition=o,this._polyline.distanceDisplayCondition=o,this._billboard.distanceDisplayCondition=o}},heightOffset:{get:function(){return this._heightOffset},set:function(o){let f=Z(this._heightOffset,0),m=this._content.tileset.ellipsoid,v=m.cartesianToCartographic(this._billboard.position,Vti);v.height=v.height-f+o;let y=m.cartographicToCartesian(v);this._billboard.position=y,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],y],this._heightOffset=o}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(o){this._polyline.show=o}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(o){this._polyline.material.uniforms.color=Re.clone(o,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(o){let f=this._billboardImage!==o;this._billboardImage=o,f&&az(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(o){this._label.disableDepthTestDistance=o,this._billboard.disableDepthTestDistance=o}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(o){this._billboard.horizontalOrigin=o}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(o){this._billboard.verticalOrigin=o}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(o){this._label.horizontalOrigin=o}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(o){this._label.verticalOrigin=o}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let o=this._pickIds;return o[0]=this._billboard.pickId,o[1]=this._label.pickId,o[2]=this._polyline.pickId,o}}});R0.defaultColor=Re.WHITE;R0.defaultPointOutlineColor=Re.BLACK;R0.defaultPointOutlineWidth=0;R0.defaultPointSize=8;function az(o){let f=o._billboard;if(N(o._billboardImage)&&o._billboardImage!==f.image){f.image=o._billboardImage;return}if(N(o._billboardImage))return;let m=Z(o._color,R0.defaultColor),v=Z(o._pointOutlineColor,R0.defaultPointOutlineColor),y=Z(o._pointOutlineWidth,R0.defaultPointOutlineWidth),x=Z(o._pointSize,R0.defaultPointSize),C=o._billboardColor,w=o._billboardOutlineColor,A=o._billboardOutlineWidth,E=o._billboardSize;if(Re.equals(m,C)&&Re.equals(v,w)&&y===A&&x===E)return;o._billboardColor=Re.clone(m,o._billboardColor),o._billboardOutlineColor=Re.clone(v,o._billboardOutlineColor),o._billboardOutlineWidth=y,o._billboardSize=x;let T=m.alpha,S=m.toCssColorString(),M=v.toCssColorString(),I=JSON.stringify([S,x,M,y]);f.setImage(I,Rne(T,S,M,y,x))}R0.prototype.hasProperty=function(o){return this._content.batchTable.hasProperty(this._batchId,o)};R0.prototype.getPropertyIds=function(o){return this._content.batchTable.getPropertyIds(this._batchId,o)};R0.prototype.getProperty=function(o){return this._content.batchTable.getProperty(this._batchId,o)};R0.prototype.getPropertyInherited=function(o){return Qs.getPropertyInherited(this._content,this._batchId,o)};R0.prototype.setProperty=function(o,f){this._content.batchTable.setProperty(this._batchId,o,f),this._content.featurePropertiesDirty=!0};R0.prototype.isExactClass=function(o){return this._content.batchTable.isExactClass(this._batchId,o)};R0.prototype.isClass=function(o){return this._content.batchTable.isClass(this._batchId,o)};R0.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var i5=R0;function mO(o){this._positions=o.positions,this._batchTable=o.batchTable,this._batchIds=o.batchIds,this._rectangle=o.rectangle,this._minHeight=o.minimumHeight,this._maxHeight=o.maximumHeight,this._billboardCollection=new XE({batchTable:o.batchTable}),this._labelCollection=new UM({batchTable:o.batchTable}),this._polylineCollection=new lO,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(mO.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let o=this._billboardCollection.textureAtlas.texture.sizeInBytes,f=this._labelCollection._textureAtlas.texture.sizeInBytes;return o+f}}});function zti(o,f){let m=o._rectangle,v=o._minHeight,y=o._maxHeight,x=2+Di.packedLength+ki.packedLength,C=new Float64Array(x),w=0;return C[w++]=v,C[w++]=y,Di.pack(m,C,w),w+=Di.packedLength,ki.pack(f,C,w),C}var Hti=new tp("createVectorTilePoints",5),Uti=new H;function Gti(o,f){let m=o._positions,v=o._packedBuffer;N(v)||(m=o._positions=m.slice(),o._batchIds=o._batchIds.slice(),v=o._packedBuffer=zti(o,f));let y=[m.buffer,v.buffer],x={positions:m.buffer,packedBuffer:v.buffer},C=Hti.scheduleTask(x,y);if(N(C))return C.then(w=>{if(o.isDestroyed())return;o._positions=new Float64Array(w.positions);let A=o._billboardCollection,E=o._labelCollection,T=o._polylineCollection;m=o._positions;let S=o._batchIds,M=m.length/3;for(let I=0;I{o.isDestroyed()||(o._error=w)})}mO.prototype.createFeatures=function(o,f){let m=this._billboardCollection,v=this._labelCollection,y=this._polylineCollection,x=this._batchIds,C=x.length;for(let w=0;w{if(o.isDestroyed())return;o._positions=void 0,o._counts=void 0,o._polygonMinimumHeights=void 0,o._polygonMaximumHeights=void 0;let P=new Float64Array(I.packedBuffer),D=P[0];Zti(o,P),o._indices=ro.getSizeInBytes(D)===2?new Uint16Array(I.indices):new Uint32Array(I.indices),o._indexOffsets=new Uint32Array(I.indexOffsets),o._indexCounts=new Uint32Array(I.indexCounts),o._batchedPositions=new Float32Array(I.positions),o._vertexBatchIds=new Uint16Array(I.batchIds),iii(o),o._ready=!0}).catch(I=>{o.isDestroyed()||(o._error=I)})}function iii(o){N(o._primitive)||(o._primitive=new ene({batchTable:o._batchTable,positions:o._batchedPositions,batchIds:o._batchIds,vertexBatchIds:o._vertexBatchIds,indices:o._indices,indexOffsets:o._indexOffsets,indexCounts:o._indexCounts,batchedIndices:o._batchedIndices,boundingVolume:o._boundingVolume,boundingVolumes:o._boundingVolumes,center:o._center}),o._batchTable=void 0,o._batchIds=void 0,o._positions=void 0,o._counts=void 0,o._indices=void 0,o._indexCounts=void 0,o._indexOffsets=void 0,o._batchTableColors=void 0,o._packedBuffer=void 0,o._batchedPositions=void 0,o._transferrableBatchIds=void 0,o._vertexBatchIds=void 0,o._ellipsoid=void 0,o._minimumHeight=void 0,o._maximumHeight=void 0,o._polygonMinimumHeights=void 0,o._polygonMaximumHeights=void 0,o._center=void 0,o._rectangle=void 0,o._boundingVolume=void 0,o._boundingVolumes=void 0,o._batchedIndices=void 0)}iD.prototype.createFeatures=function(o,f){this._primitive.createFeatures(o,f)};iD.prototype.applyDebugSettings=function(o,f){this._primitive.applyDebugSettings(o,f)};iD.prototype.applyStyle=function(o,f){this._primitive.applyStyle(o,f)};iD.prototype.updateCommands=function(o,f){this._primitive.updateCommands(o,f)};iD.prototype.update=function(o){if(!this._ready){if(N(this._promise)||(this._promise=tii(this)),N(this._error)){let f=this._error;throw this._error=void 0,f}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(o)};iD.prototype.isDestroyed=function(){return!1};iD.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),kr(this)};var Zwe=iD,$we=`in vec4 currentPosition; in vec4 previousPosition; in vec4 nextPosition; in vec2 expandAndWidth; in float a_batchId; uniform mat4 u_modifiedModelView; void main() { float expandDir = expandAndWidth.x; float width = abs(expandAndWidth.y) + 0.5; bool usePrev = expandAndWidth.y < 0.0; vec4 p = u_modifiedModelView * currentPosition; vec4 prev = u_modifiedModelView * previousPosition; vec4 next = u_modifiedModelView * nextPosition; float angle; vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); gl_Position = czm_viewportOrthographic * positionWC; } `;function iT(o){this._positions=o.positions,this._widths=o.widths,this._counts=o.counts,this._batchIds=o.batchIds,this._ellipsoid=Z(o.ellipsoid,ki.WGS84),this._minimumHeight=o.minimumHeight,this._maximumHeight=o.maximumHeight,this._center=o.center,this._rectangle=o.rectangle,this._boundingVolume=o.boundingVolume,this._batchTable=o.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=o.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=Re.clone(Re.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(iT.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function rii(o){let f=o._rectangle,m=o._minimumHeight,v=o._maximumHeight,y=o._ellipsoid,x=o._center,C=2+Di.packedLength+ki.packedLength+H.packedLength,w=new Float64Array(C),A=0;return w[A++]=m,w[A++]=v,Di.pack(f,w,A),A+=Di.packedLength,ki.pack(y,w,A),A+=ki.packedLength,H.pack(x,w,A),w}var nii=new tp("createVectorTilePolylines",5),sz={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function oii(o,f){if(N(o._va))return;let m=o._positions,v=o._widths,y=o._counts,x=o._transferrableBatchIds,C=o._packedBuffer;N(C)||(m=o._positions=m.slice(),v=o._widths=v.slice(),y=o._counts=y.slice(),x=o._transferrableBatchIds=o._batchIds.slice(),C=o._packedBuffer=rii(o));let w=[m.buffer,v.buffer,y.buffer,x.buffer,C.buffer],A={positions:m.buffer,widths:v.buffer,counts:y.buffer,batchIds:x.buffer,packedBuffer:C.buffer,keepDecodedPositions:o._keepDecodedPositions},E=nii.scheduleTask(A,w);if(N(E))return E.then(function(T){if(o.isDestroyed())return;o._keepDecodedPositions&&(o._decodedPositions=new Float64Array(T.decodedPositions),o._decodedPositionOffsets=new Uint32Array(T.decodedPositionOffsets)),o._currentPositions=new Float32Array(T.currentPositions),o._previousPositions=new Float32Array(T.previousPositions),o._nextPositions=new Float32Array(T.nextPositions),o._expandAndWidth=new Float32Array(T.expandAndWidth),o._vertexBatchIds=new Uint16Array(T.batchIds);let S=T.indexDatatype;o._indices=S===ro.UNSIGNED_SHORT?new Uint16Array(T.indices):new Uint32Array(T.indices),aii(o,f),o._ready=!0}).catch(T=>{o.isDestroyed()||(o._error=T)})}function aii(o,f){if(!N(o._va)){let m=o._currentPositions,v=o._previousPositions,y=o._nextPositions,x=o._expandAndWidth,C=o._vertexBatchIds,w=o._indices,A=v.byteLength+m.byteLength+y.byteLength;A+=x.byteLength+C.byteLength+w.byteLength,o._trianglesLength=w.length/3,o._geometryByteLength=A;let E=Ao.createVertexBuffer({context:f,typedArray:v,usage:gn.STATIC_DRAW}),T=Ao.createVertexBuffer({context:f,typedArray:m,usage:gn.STATIC_DRAW}),S=Ao.createVertexBuffer({context:f,typedArray:y,usage:gn.STATIC_DRAW}),M=Ao.createVertexBuffer({context:f,typedArray:x,usage:gn.STATIC_DRAW}),I=Ao.createVertexBuffer({context:f,typedArray:C,usage:gn.STATIC_DRAW}),P=Ao.createIndexBuffer({context:f,typedArray:w,usage:gn.STATIC_DRAW,indexDatatype:w.BYTES_PER_ELEMENT===2?ro.UNSIGNED_SHORT:ro.UNSIGNED_INT}),D=[{index:sz.previousPosition,vertexBuffer:E,componentDatatype:Rt.FLOAT,componentsPerAttribute:3},{index:sz.currentPosition,vertexBuffer:T,componentDatatype:Rt.FLOAT,componentsPerAttribute:3},{index:sz.nextPosition,vertexBuffer:S,componentDatatype:Rt.FLOAT,componentsPerAttribute:3},{index:sz.expandAndWidth,vertexBuffer:M,componentDatatype:Rt.FLOAT,componentsPerAttribute:2},{index:sz.a_batchId,vertexBuffer:I,componentDatatype:Rt.UNSIGNED_SHORT,componentsPerAttribute:1}];o._va=new Du({context:f,attributes:D,indexBuffer:P}),o._positions=void 0,o._widths=void 0,o._counts=void 0,o._ellipsoid=void 0,o._minimumHeight=void 0,o._maximumHeight=void 0,o._rectangle=void 0,o._transferrableBatchIds=void 0,o._packedBuffer=void 0,o._currentPositions=void 0,o._previousPositions=void 0,o._nextPositions=void 0,o._expandAndWidth=void 0,o._vertexBatchIds=void 0,o._indices=void 0}}var V9=new Ee,Xke=new H;function sii(o,f){N(o._uniformMap)||(o._uniformMap={u_modifiedModelView:function(){let m=f.uniformState.view;return Ee.clone(m,V9),Ee.multiplyByPoint(V9,o._center,Xke),Ee.setTranslation(V9,Xke,V9),V9},u_highlightColor:function(){return o._highlightColor}})}function lii(o){if(N(o._rs))return;let f={enabled:!0,factor:-5,units:-5};o._rs=Mn.fromCache({blending:Mu.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:f})}var uii=`uniform vec4 u_highlightColor; void main() { out_FragColor = u_highlightColor; } `;function cii(o,f){if(N(o._sp))return;let m=o._batchTable,v=m.getVertexShaderCallback(!1,"a_batchId",void 0)($we),y=m.getFragmentShaderCallback(!1,void 0,!1)(uii),x=new Zr({defines:["VECTOR_TILE",pa.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[xB,v]}),C=new Zr({defines:["VECTOR_TILE"],sources:[y]});o._sp=Rs.fromCache({context:f,vertexShaderSource:x,fragmentShaderSource:C,attributeLocations:sz})}function hii(o,f){if(!N(o._command)){let m=o._batchTable.getUniformMapCallback()(o._uniformMap);o._command=new Jn({owner:o,vertexArray:o._va,renderState:o._rs,shaderProgram:o._sp,uniformMap:m,boundingVolume:o._boundingVolume,pass:vr.TRANSLUCENT,pickId:o._batchTable.getPickId()})}f.commandList.push(o._command)}iT.getPolylinePositions=function(o,f){let m=o._batchIds,v=o._decodedPositions,y=o._decodedPositionOffsets;if(!N(m)||!N(v))return;let x,C,w=m.length,A=0,E=0;for(x=0;x // vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd); scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd)); vec3 miterPushNormal = czm_normal * normalize(scratchNormal); offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position)); // offset = widthEC offset = offset / dot(miterPushNormal, right); position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0))); gl_Position = czm_depthClamp(czm_projection * position); position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0); vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz; v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz)); v_rightPlaneEC = vec4(right, -dot(right, position.xyz)); position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0); vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); v_halfWidth = endFaceNormalAndHalfWidth.w; } `,tAe=`in vec4 v_startPlaneEC; in vec4 v_endPlaneEC; in vec4 v_rightPlaneEC; in float v_halfWidth; in vec3 v_volumeUpEC; uniform vec4 u_highlightColor; void main() { float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw))); // Discard for sky if (logDepthOrDepth == 0.0) { #ifdef DEBUG_SHOW_VOLUME out_FragColor = vec4(0.0, 0.0, 1.0, 0.5); return; #else // DEBUG_SHOW_VOLUME discard; #endif // DEBUG_SHOW_VOLUME } vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); eyeCoordinate /= eyeCoordinate.w; float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate); // Expand halfMaxWidth if direction to camera is almost perpendicular with the volume's up direction halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC)); // Check distance of the eye coordinate against the right-facing plane float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz); // Check eye coordinate against the mitering planes float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz); float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz); if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) { #ifdef DEBUG_SHOW_VOLUME out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5); return; #else // DEBUG_SHOW_VOLUME discard; #endif // DEBUG_SHOW_VOLUME } out_FragColor = u_highlightColor; czm_writeDepthClamp(); } `;function rD(o){this._positions=o.positions,this._widths=o.widths,this._counts=o.counts,this._batchIds=o.batchIds,this._ellipsoid=Z(o.ellipsoid,ki.WGS84),this._minimumHeight=o.minimumHeight,this._maximumHeight=o.maximumHeight,this._center=o.center,this._rectangle=o.rectangle,this._batchTable=o.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new Ye(zh._defaultMinTerrainHeight,zh._defaultMaxTerrainHeight),this._boundingVolume=fc.fromRectangle(o.rectangle,zh._defaultMinTerrainHeight,zh._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=o.classificationType,this._keepDecodedPositions=o.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=Re.clone(Re.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(rD.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function gii(o,f,m){let v=zh.getMinimumMaximumHeights(f,m),y=v.minimumTerrainHeight,x=v.maximumTerrainHeight,C=o._minimumMaximumVectorHeights;C.x=y,C.y=x;let w=o._boundingVolume,A=o._rectangle;fc.fromRectangle(A,y,x,m,w)}function _ii(o){let f=o._rectangle,m=o._minimumHeight,v=o._maximumHeight,y=o._ellipsoid,x=o._center,C=2+Di.packedLength+ki.packedLength+H.packedLength,w=new Float64Array(C),A=0;return w[A++]=m,w[A++]=v,Di.pack(f,w,A),A+=Di.packedLength,ki.pack(y,w,A),A+=ki.packedLength,H.pack(x,w,A),w}var vii=new tp("createVectorTileClampedPolylines"),xR={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function yii(o,f){if(N(o._va))return;let m=o._positions,v=o._widths,y=o._counts,x=o._transferrableBatchIds,C=o._packedBuffer;N(C)||(m=o._positions=m.slice(),v=o._widths=v.slice(),y=o._counts=y.slice(),x=o._transferrableBatchIds=o._batchIds.slice(),C=o._packedBuffer=_ii(o));let w=[m.buffer,v.buffer,y.buffer,x.buffer,C.buffer],A={positions:m.buffer,widths:v.buffer,counts:y.buffer,batchIds:x.buffer,packedBuffer:C.buffer,keepDecodedPositions:o._keepDecodedPositions},E=vii.scheduleTask(A,w);if(N(E))return E.then(function(T){if(o.isDestroyed())return;o._keepDecodedPositions&&(o._decodedPositions=new Float64Array(T.decodedPositions),o._decodedPositionOffsets=new Uint32Array(T.decodedPositionOffsets)),o._startEllipsoidNormals=new Float32Array(T.startEllipsoidNormals),o._endEllipsoidNormals=new Float32Array(T.endEllipsoidNormals),o._startPositionAndHeights=new Float32Array(T.startPositionAndHeights),o._startFaceNormalAndVertexCornerIds=new Float32Array(T.startFaceNormalAndVertexCornerIds),o._endPositionAndHeights=new Float32Array(T.endPositionAndHeights),o._endFaceNormalAndHalfWidths=new Float32Array(T.endFaceNormalAndHalfWidths),o._vertexBatchIds=new Uint16Array(T.vertexBatchIds);let S=T.indexDatatype;o._indices=S===ro.UNSIGNED_SHORT?new Uint16Array(T.indices):new Uint32Array(T.indices),xii(o,f),o._ready=!0}).catch(T=>{o.isDestroyed()||(o._error=T)})}function xii(o,f){if(!N(o._va)){let m=o._startEllipsoidNormals,v=o._endEllipsoidNormals,y=o._startPositionAndHeights,x=o._endPositionAndHeights,C=o._startFaceNormalAndVertexCornerIds,w=o._endFaceNormalAndHalfWidths,A=o._vertexBatchIds,E=o._indices,T=m.byteLength+v.byteLength;T+=y.byteLength+x.byteLength,T+=C.byteLength+w.byteLength,T+=A.byteLength+E.byteLength,o._trianglesLength=E.length/3,o._geometryByteLength=T;let S=Ao.createVertexBuffer({context:f,typedArray:m,usage:gn.STATIC_DRAW}),M=Ao.createVertexBuffer({context:f,typedArray:v,usage:gn.STATIC_DRAW}),I=Ao.createVertexBuffer({context:f,typedArray:y,usage:gn.STATIC_DRAW}),P=Ao.createVertexBuffer({context:f,typedArray:x,usage:gn.STATIC_DRAW}),D=Ao.createVertexBuffer({context:f,typedArray:C,usage:gn.STATIC_DRAW}),L=Ao.createVertexBuffer({context:f,typedArray:w,usage:gn.STATIC_DRAW}),R=Ao.createVertexBuffer({context:f,typedArray:A,usage:gn.STATIC_DRAW}),O=Ao.createIndexBuffer({context:f,typedArray:E,usage:gn.STATIC_DRAW,indexDatatype:E.BYTES_PER_ELEMENT===2?ro.UNSIGNED_SHORT:ro.UNSIGNED_INT}),F=[{index:xR.startEllipsoidNormal,vertexBuffer:S,componentDatatype:Rt.FLOAT,componentsPerAttribute:3},{index:xR.endEllipsoidNormal,vertexBuffer:M,componentDatatype:Rt.FLOAT,componentsPerAttribute:3},{index:xR.startPositionAndHeight,vertexBuffer:I,componentDatatype:Rt.FLOAT,componentsPerAttribute:4},{index:xR.endPositionAndHeight,vertexBuffer:P,componentDatatype:Rt.FLOAT,componentsPerAttribute:4},{index:xR.startFaceNormalAndVertexCorner,vertexBuffer:D,componentDatatype:Rt.FLOAT,componentsPerAttribute:4},{index:xR.endFaceNormalAndHalfWidth,vertexBuffer:L,componentDatatype:Rt.FLOAT,componentsPerAttribute:4},{index:xR.a_batchId,vertexBuffer:R,componentDatatype:Rt.UNSIGNED_SHORT,componentsPerAttribute:1}];o._va=new Du({context:f,attributes:F,indexBuffer:O}),o._positions=void 0,o._widths=void 0,o._counts=void 0,o._ellipsoid=void 0,o._minimumHeight=void 0,o._maximumHeight=void 0,o._rectangle=void 0,o._transferrableBatchIds=void 0,o._packedBuffer=void 0,o._startEllipsoidNormals=void 0,o._endEllipsoidNormals=void 0,o._startPositionAndHeights=void 0,o._startFaceNormalAndVertexCornerIds=void 0,o._endPositionAndHeights=void 0,o._endFaceNormalAndHalfWidths=void 0,o._vertexBatchIds=void 0,o._indices=void 0}}var z9=new Ee,Jke=new H;function Cii(o,f){N(o._uniformMap)||(o._uniformMap={u_modifiedModelView:function(){let m=f.uniformState.view;return Ee.clone(m,z9),Ee.multiplyByPoint(z9,o._center,Jke),Ee.setTranslation(z9,Jke,z9),z9},u_highlightColor:function(){return o._highlightColor},u_minimumMaximumVectorHeights:function(){return o._minimumMaximumVectorHeights}})}function Kke(o){return Mn.fromCache({cull:{enabled:!0,face:uh.FRONT},blending:Mu.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:o,frontFunction:dc.EQUAL,frontOperation:{fail:No.KEEP,zFail:No.KEEP,zPass:No.KEEP},backFunction:dc.EQUAL,backOperation:{fail:No.KEEP,zFail:No.KEEP,zPass:No.KEEP},reference:Ua.CESIUM_3D_TILE_MASK,mask:Ua.CESIUM_3D_TILE_MASK}})}function bii(o){N(o._rs)||(o._rs=Kke(!1),o._rs3DTiles=Kke(!0))}function wii(o,f){if(N(o._sp))return;let m=o._batchTable,v=m.getVertexShaderCallback(!1,"a_batchId",void 0)(eAe),y=m.getFragmentShaderCallback(!1,void 0,!0)(tAe),x=new Zr({defines:["VECTOR_TILE",pa.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[xB,v]}),C=new Zr({defines:["VECTOR_TILE"],sources:[y]});o._sp=Rs.fromCache({context:f,vertexShaderSource:x,fragmentShaderSource:C,attributeLocations:xR})}function Aii(o,f){let m=o._command;if(!N(o._command)){let y=o._batchTable.getUniformMapCallback()(o._uniformMap);m=o._command=new Jn({owner:o,vertexArray:o._va,renderState:o._rs,shaderProgram:o._sp,uniformMap:y,boundingVolume:o._boundingVolume,pass:vr.TERRAIN_CLASSIFICATION,pickId:o._batchTable.getPickId()});let x=Jn.shallowClone(m,m.derivedCommands.tileset);x.renderState=o._rs3DTiles,x.pass=vr.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=x}let v=o._classificationType;(v===uc.TERRAIN||v===uc.BOTH)&&f.commandList.push(m),(v===uc.CESIUM_3D_TILE||v===uc.BOTH)&&f.commandList.push(m.derivedCommands.tileset)}rD.prototype.getPositions=function(o){return One.getPolylinePositions(this,o)};rD.prototype.createFeatures=function(o,f){let m=this._batchIds,v=m.length;for(let y=0;y{o.isDestroyed()||(o._error=f)})}rD.prototype.update=function(o){let f=o.context;if(!this._ready){if(N(this._promise)||(this._promise=Iii(this).then(yii(this,f))),N(this._error)){let v=this._error;throw this._error=void 0,v}return}Cii(this,f),wii(this,f),bii(this);let m=o.passes;(m.render||m.pick)&&Aii(this,o)};rD.prototype.isDestroyed=function(){return!1};rD.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),kr(this)};var iAe=rD,afe=32767,Mii=new Mt,Dii=new H;function Lii(o,f,m,v,y){let x=o.length/3,C=o.subarray(0,x),w=o.subarray(x,2*x),A=o.subarray(2*x,3*x);Ku.zigZagDeltaDecode(C,w,A);let E=new Float64Array(o.length);for(let T=0;T{this._resolveContent=x}),Bii(this,v,y)}Object.defineProperties(sP.prototype,{featuresLength:{get:function(){return N(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return N(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let o=0;return N(this._polygons)&&(o+=this._polygons.trianglesLength),N(this._polylines)&&(o+=this._polylines.trianglesLength),o}},geometryByteLength:{get:function(){let o=0;return N(this._polygons)&&(o+=this._polygons.geometryByteLength),N(this._polylines)&&(o+=this._polylines.geometryByteLength),o}},texturesByteLength:{get:function(){return N(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return N(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("Vector3DTileContent.readyPromise","Vector3DTileContent.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for Vector3DTileContent.ready to return true instead."),this._readyPromise}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(o){this._metadata=o}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(o){this._group=o}}});function Rii(o){return function(f,m){N(o._polygons)&&o._polygons.updateCommands(f,m)}}function Oii(o,f){let m,v,y,x,C=Z(o.POLYGONS_LENGTH,0),w=Z(o.POLYLINES_LENGTH,0),A=Z(o.POINTS_LENGTH,0);if(C>0&&N(o.POLYGON_BATCH_IDS)){let S=f.byteOffset+o.POLYGON_BATCH_IDS.byteOffset;m=new Uint16Array(f.buffer,S,C)}if(w>0&&N(o.POLYLINE_BATCH_IDS)){let S=f.byteOffset+o.POLYLINE_BATCH_IDS.byteOffset;v=new Uint16Array(f.buffer,S,w)}if(A>0&&N(o.POINT_BATCH_IDS)){let S=f.byteOffset+o.POINT_BATCH_IDS.byteOffset;y=new Uint16Array(f.buffer,S,A)}let E=N(m)||N(v)||N(y),T=C>0&&!N(m)||w>0&&!N(v)||A>0&&!N(y);if(E&&T)throw new sr("If one group of batch ids is defined, then all batch ids must be defined");if(!N(m)&&!N(v)&&!N(y)){let S=0;if(!N(m)&&C>0)for(m=new Uint16Array(C),x=0;x0)for(v=new Uint16Array(w),x=0;x0)for(y=new Uint16Array(A),x=0;x0&&(R=E_(v,m,E),m+=E,T>0&&(O=new Uint8Array(f,m,T),O=new Uint8Array(O),m+=T));let F=Z(D.POLYGONS_LENGTH,0),k=Z(D.POLYLINES_LENGTH,0),U=Z(D.POINTS_LENGTH,0),G=F+k+U,j=new UY(o,G,R,O,Rii(o));if(o._batchTable=j,G===0)return;let q=new qU(D,L),J=q.getGlobalProperty("REGION");if(!N(J))throw new sr("Feature table global property: REGION must be defined");let X=Di.unpack(J),Y=J[4],Q=J[5],ee=o._tile.computedTransform,z=q.getGlobalProperty("RTC_CENTER",Rt.FLOAT,3);N(z)?(z=H.unpack(z),Ee.multiplyByPoint(ee,z,z)):(z=Di.center(X),z.height=xe.lerp(Y,Q,.5),z=ki.WGS84.cartographicToCartesian(z));let ie=Oii(D,L);if(m+=(4-m%4)%4,F>0){q.featuresLength=F;let re=Z(q.getPropertyArray("POLYGON_COUNTS",Rt.UNSIGNED_INT,1),q.getPropertyArray("POLYGON_COUNT",Rt.UNSIGNED_INT,1));if(!N(re))throw new sr("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let ne=Z(q.getPropertyArray("POLYGON_INDEX_COUNTS",Rt.UNSIGNED_INT,1),q.getPropertyArray("POLYGON_INDEX_COUNT",Rt.UNSIGNED_INT,1));if(!N(ne))throw new sr("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let oe=re.reduce(function(pe,ce){return pe+ce*2},0),se=ne.reduce(function(pe,ce){return pe+ce},0),ae=new Uint32Array(f,m,se);m+=S;let fe=new Uint16Array(f,m,oe);m+=M;let de,ve;N(D.POLYGON_MINIMUM_HEIGHTS)&&N(D.POLYGON_MAXIMUM_HEIGHTS)&&(de=q.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Rt.FLOAT,1),ve=q.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Rt.FLOAT,1)),o._polygons=new Zwe({positions:fe,counts:re,indexCounts:ne,indices:ae,minimumHeight:Y,maximumHeight:Q,polygonMinimumHeights:de,polygonMaximumHeights:ve,center:z,rectangle:X,boundingVolume:o.tile.boundingVolume.boundingVolume,batchTable:j,batchIds:ie.polygons,modelMatrix:ee})}if(k>0){q.featuresLength=k;let re=Z(q.getPropertyArray("POLYLINE_COUNTS",Rt.UNSIGNED_INT,1),q.getPropertyArray("POLYLINE_COUNT",Rt.UNSIGNED_INT,1));if(!N(re))throw new sr("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let ne=q.getPropertyArray("POLYLINE_WIDTHS",Rt.UNSIGNED_SHORT,1);if(!N(ne)){ne=new Uint16Array(k);for(let ve=0;ve0){let re=new Uint16Array(f,m,U*3);m+=P,o._points=new Qwe({positions:re,batchIds:ie.points,minimumHeight:Y,maximumHeight:Q,rectangle:X,batchTable:j})}}function nAe(o){let f=o.featuresLength;if(!N(o._features)&&f>0){let m=new Array(f);N(o._polygons)&&o._polygons.createFeatures(o,m),N(o._polylines)&&o._polylines.createFeatures(o,m),N(o._points)&&o._points.createFeatures(o,m),o._features=m}}sP.prototype.hasProperty=function(o,f){return this._batchTable.hasProperty(o,f)};sP.prototype.getFeature=function(o){return N(this._features)||nAe(this),this._features[o]};sP.prototype.applyDebugSettings=function(o,f){N(this._polygons)&&this._polygons.applyDebugSettings(o,f),N(this._polylines)&&this._polylines.applyDebugSettings(o,f),N(this._points)&&this._points.applyDebugSettings(o,f)};sP.prototype.applyStyle=function(o){N(this._features)||nAe(this),N(this._polygons)&&this._polygons.applyStyle(o,this._features),N(this._polylines)&&this._polylines.applyStyle(o,this._features),N(this._points)&&this._points.applyStyle(o,this._features)};sP.prototype.update=function(o,f){let m=!0;N(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(f),m=m&&this._polygons.ready),N(this._polylines)&&(this._polylines.update(f),m=m&&this._polylines.ready),N(this._points)&&(this._points.update(f),m=m&&this._points.ready),N(this._batchTable)&&m&&(N(this._features)||nAe(this),this._batchTable.update(o,f),this._ready=!0,this._resolveContent(this))};sP.prototype.getPolylinePositions=function(o){let f=this._polylines;if(N(f))return f.getPositions(o)};sP.prototype.isDestroyed=function(){return!1};sP.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),kr(this)};function kii(o,f,m,v,y,x){let C=f.length,w=0;for(let A=0;A=0?v[x]:void 0}var Bne=Hii;function sD(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.tile,m=o.class;this._class=m,this._properties=f.properties,this._extensions=f.extensions,this._extras=f.extras}Object.defineProperties(sD.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});sD.prototype.hasProperty=function(o){return yu.hasProperty(o,this._properties,this._class)};sD.prototype.hasPropertyBySemantic=function(o){return yu.hasPropertyBySemantic(o,this._properties,this._class)};sD.prototype.getPropertyIds=function(o){return yu.getPropertyIds(this._properties,this._class,o)};sD.prototype.getProperty=function(o){return yu.getProperty(o,this._properties,this._class)};sD.prototype.setProperty=function(o,f){return yu.setProperty(o,f,this._properties,this._class)};sD.prototype.getPropertyBySemantic=function(o){return yu.getPropertyBySemantic(o,this._properties,this._class)};sD.prototype.setPropertyBySemantic=function(o,f){return yu.setPropertyBySemantic(o,f,this._properties,this._class)};var lAe=sD;function uAe(o,f){let m=Gh(f,"3DTILES_metadata")?f.extensions["3DTILES_metadata"]:f.metadata;if(!N(m))return;if(!N(o.schema)){uAe._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let v=Z(o.schema.classes,Z.EMPTY_OBJECT);if(N(m.class)){let y=v[m.class];return new lAe({tile:m,class:y})}}uAe._oneTimeWarning=Ba;var cAe=uAe;function Uii(o){let f=new Uint8Array(o),m=HU(f);if(m==="glTF"&&(m="glb"),Ev.isBinaryFormat(m))return{contentType:m,binaryPayload:f};let v=Gii(f);if(N(v.root))return{contentType:Ev.EXTERNAL_TILESET,jsonPayload:v};if(N(v.asset))return{contentType:Ev.GLTF,jsonPayload:v};if(N(v.tileAvailability))return{contentType:Ev.IMPLICIT_SUBTREE_JSON,jsonPayload:v};if(N(v.type))return{contentType:Ev.GEOJSON,jsonPayload:v};if(N(v.voxelTable))return{contentType:Ev.VOXEL_JSON,jsonPayload:v};throw new sr("Invalid tile content.")}function Gii(o){let f;try{f=E_(o)}catch{throw new sr("Invalid tile content.")}return f}var t6=Uii;function gT(o,f,m,v){this._tileset=o,this._tile=f,this._tilesetResource=m,this._contents=[],this._contentsCreated=!1;let y=N(v.contents)?v.contents:v.content;this._innerContentHeaders=y,this._requestsInFlight=0,this._cancelCount=0;let x=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(x),this._requests=new Array(x),this._ready=!1,this._resolveContent=void 0,this._readyPromise=new Promise(C=>{this._resolveContent=C}),this._innerContentResources=new Array(x),this._serverKeys=new Array(x);for(let C=0;Cqii(o,x,C)),y=await Promise.all(v);return o._contentsCreated=!0,o._contents=y.filter(N),y}async function qii(o,f,m){if(N(f))try{let v=t6(f);if(v.contentType===Ev.EXTERNAL_TILESET)throw new sr("External tilesets are disallowed inside multiple contents");o._disableSkipLevelOfDetail=o._disableSkipLevelOfDetail||v.contentType===Ev.GEOMETRY||v.contentType===Ev.VECTOR;let y=o._tileset,x=o._innerContentResources[m],C=o._tile,w,A=Nne[v.contentType];N(v.binaryPayload)?w=await Promise.resolve(A(y,C,x,v.binaryPayload.buffer,0)):w=await Promise.resolve(A(y,C,x,v.jsonPayload));let E=o._innerContentHeaders[m];if(C.hasImplicitContentMetadata){let S=C.implicitSubtree,M=C.implicitCoordinates;w.metadata=S.getContentMetadataView(M,m)}else C.hasImplicitContent||(w.metadata=Fne(y,E));let T=Bne(y,E);return N(T)&&(w.group=new Zre({metadata:T})),w}catch(v){HQe(o,m,v)}}function HQe(o,f,m){let v=o._tileset,y=o._innerContentResources[f].url,x=N(m.message)?m.message:m.toString();v.tileFailed.numberOfListeners>0?v.tileFailed.raiseEvent({url:y,message:x}):(console.log(`A content failed to load: ${y}`),console.log(`Error: ${x}`))}gT.prototype.cancelRequests=function(){for(let o=0;ow?I=xe.TWO_PI-A+w:I=w-A;let D=Math.ceil(I/f)+1,L=Math.ceil(P/f)+1,R=I/(D-1),O=P/(L-1),F=Di.northwest(o,x),k=Di.center(o,Kii);(m!==0||v!==0)&&(k.longitude=0;P--)y_.computePosition(f,m,!1,I,P,D),S[M++]=D.x,S[M++]=D.y,S[M++]=D.z;for(P=0,I=v-2;I>0;I--)y_.computePosition(f,m,!1,I,P,D),S[M++]=D.x,S[M++]=D.y,S[M++]=D.z;let L=S.length/3*2,R=ro.createTypedArray(S.length/3,L),O=0;for(let k=0;k0){rw.longitude=(f.west+f.east)*.5,rw.latitude=E;let D=m.cartographicToCartesian(rw,FV.origin);H.clone(A,FV.direction);let L=$a.fromPointNormal(o.southwestCornerCartesian,o.westNormal,rVe);Hh.rayPlane(FV,L,o.southwestCornerCartesian),T=m.geodeticSurfaceNormal(D,dZ)}else T=m.geodeticSurfaceNormalCartographic(Di.southeast(f),dZ);let S=H.cross(T,w,iVe);H.normalize(S,o.southNormal);let M=f.north,I;if(M<0){rw.longitude=(f.west+f.east)*.5,rw.latitude=M;let D=m.cartographicToCartesian(rw,FV.origin);H.negate(A,FV.direction);let L=$a.fromPointNormal(o.northeastCornerCartesian,o.eastNormal,rVe);Hh.rayPlane(FV,L,o.northeastCornerCartesian),I=m.geodeticSurfaceNormal(D,dZ)}else I=m.geodeticSurfaceNormalCartographic(Di.northwest(f),dZ);let P=H.cross(w,I,iVe);H.normalize(P,o.northNormal)}var lri=new H,uri=new H,cri=new H(0,-1,0),hri=new H(0,0,-1),nVe=new H;function dri(o,f){let m=f.camera,v=m.positionWC,y=m.positionCartographic,x=0;if(!Di.contains(o.rectangle,y)){let E=o.southwestCornerCartesian,T=o.northeastCornerCartesian,S=o.westNormal,M=o.southNormal,I=o.eastNormal,P=o.northNormal;f.mode!==_i.SCENE3D&&(E=f.mapProjection.project(Di.southwest(o.rectangle),lri),E.z=E.y,E.y=E.x,E.x=0,T=f.mapProjection.project(Di.northeast(o.rectangle),uri),T.z=T.y,T.y=T.x,T.x=0,S=cri,I=H.UNIT_Y,M=hri,P=H.UNIT_Z);let D=H.subtract(v,E,nVe),L=H.dot(D,S),R=H.dot(D,M),O=H.subtract(v,T,nVe),F=H.dot(O,I),k=H.dot(O,P);L>0?x+=L*L:F>0&&(x+=F*F),R>0?x+=R*R:k>0&&(x+=k*k)}let C,w,A;if(f.mode===_i.SCENE3D?(C=y.height,w=o.minimumHeight,A=o.maximumHeight):(C=v.x,w=0,A=0),C>A){let E=C-A;x+=E*E}else if(C0?(m.push(0),v.push(this._planeVertices[0]),y=this._edgeNormals[0]):$a.getPointDistance(this._boundingPlanes[1],f)>0&&(m.push(1),v.push(this._planeVertices[1]),y=this._edgeNormals[1]);let x,C;for(x=0;x<4;x++)C=2+x,$a.getPointDistance(this._boundingPlanes[C],f)>0&&(m.push(C),v.push(this._planeVertices[C]),y=this._edgeNormals[C]);if(m.length===0)return 0;let w,A;if(m.length===1)return A=this._boundingPlanes[m[0]],w=gfe($a.projectPointOntoPlane(A,f,mfe),v[0],A,y),H.distance(w,f);if(m.length===2){if(m[0]===0){let M=[this._vertices[4*m[0]+(m[1]-2)],this._vertices[4*m[0]+(m[1]-2+1)%4]];return w=KQe(f,M[0],M[1]),H.distance(w,f)}let T=Number.MAX_VALUE,S;for(x=0;x<2;x++)A=this._boundingPlanes[m[x]],w=gfe($a.projectPointOntoPlane(A,f,mfe),v[x],A,this._edgeNormals[m[x]]),S=H.distanceSquared(w,f),S3)return w=gfe($a.projectPointOntoPlane(this._boundingPlanes[1],f,mfe),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),H.distance(w,f);let E=m[1]===2&&m[2]===5?0:1;return m[0]===0?H.distance(f,this._vertices[(m[1]-2+E)%4]):H.distance(f,this._vertices[4+(m[1]-2+E)%4])};var Iri=new H,Mri=new H;function KQe(o,f,m){let v=H.subtract(m,f,Iri),y=H.subtract(o,f,Mri),x=H.dot(v,y);if(x<=0)return f;let C=H.dot(v,v);return x>=C?m:(x=x/C,new H((1-x)*f.x+x*m.x,(1-x)*f.y+x*m.y,(1-x)*f.z+x*m.z))}var Dri=new $a(H.UNIT_X,0);function gfe(o,f,m,v){let y=Number.MAX_VALUE,x,C,w;for(let A=0;A1||Gh(m,"3DTILES_multiple_contents"),C=y&&!x?m.contents[0]:m.content;this._contentHeader=C,this.transform=N(m.transform)?Ee.unpack(m.transform):Ee.clone(Ee.IDENTITY);let w=N(v)?v.computedTransform:o.modelMatrix,A=Ee.multiply(w,this.transform,new Ee),E=N(v)?v._initialTransform:Ee.IDENTITY;this._initialTransform=Ee.multiply(E,this.transform,new Ee),this.computedTransform=A,this._boundingVolume=this.createBoundingVolume(m.boundingVolume,A),this._boundingVolume2D=void 0;let T;this._contentBoundingVolume=T,this._contentBoundingVolume2D=void 0;let S;N(m.viewerRequestVolume)&&(S=this.createBoundingVolume(m.viewerRequestVolume,A)),this._viewerRequestVolume=S,this.geometricError=m.geometricError,this._geometricError=m.geometricError,N(this._geometricError)||(this._geometricError=N(v)?v._geometricError:o._geometricError,af._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let M;N(m.refine)?((m.refine==="replace"||m.refine==="add")&&af._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${m.refine}". Instead use "${m.refine.toUpperCase()}".`),M=m.refine.toUpperCase()==="REPLACE"?Ug.REPLACE:Ug.ADD):N(v)?M=v.refine:M=Ug.REPLACE,this.refine=M,this.children=[],this.parent=v;let I,P=!1,D,L,R;if(f=Jr.createIfNeeded(f),x)D=ud.UNLOADED,L=f.clone();else if(N(C)){let U=C.uri;N(C.url)&&(af._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),U=C.url),U===""?(af._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),I=new uj(o,this),P=!0,D=ud.READY):(D=ud.UNLOADED,L=f.getDerivedResource({url:U}),R=Rw.getServerKey(L.getUrlComponent()))}else I=new uj(o,this),P=!0,D=ud.READY;this._content=I,this._contentResource=L,this._contentState=D,this._expiredContent=void 0,this._serverKey=R,this.hasEmptyContent=P,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=x,this.metadata=cAe(o,m),this.cacheNode=void 0;let O=m.expire,F,k;N(O)&&(F=O.duration,N(O.date)&&(k=ci.fromIso8601(O.date))),this.expireDuration=F,this.expireDate=k,this.lastStyleTime=0,this._optimChildrenWithinParent=WR.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._clippingPlanesState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=Re.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new ci,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}af._deprecationWarning=mi;Object.defineProperties(af.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return Z(this._contentBoundingVolume,this._boundingVolume)}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return N(this._color)||(this._color=new Re),Re.clone(this._color)},set:function(o){this._color=Re.clone(o,this._color),this._colorDirty=!0}},hasRenderableContent:{get:function(){return!this.hasEmptyContent&&!this.hasTilesetContent&&!this.hasImplicitContent}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||N(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===ud.READY}},contentUnloaded:{get:function(){return this._contentState===ud.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===ud.EXPIRED}},contentFailed:{get:function(){return this._contentState===ud.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var lR=new H;function Fri(o,f){let{tileset:m,boundingSphere:v}=o,{radius:y,center:x}=v,{camera:C}=f,w=H.multiplyByScalar(C.directionWC,o._centerZDepth,lR),A=H.add(C.positionWC,w,lR),E=H.subtract(A,x,lR);if(H.magnitude(E)>y){let O=H.normalize(E,lR),F=H.multiplyByScalar(O,y,lR),k=H.add(x,F,lR),U=H.subtract(k,C.positionWC,lR),G=H.normalize(U,lR);o._foveatedFactor=1-Math.abs(H.dot(C.directionWC,G))}else o._foveatedFactor=0;let T=o.refine===Ug.REPLACE,S=m.isSkippingLevelOfDetail;if(T&&!S||!m.foveatedScreenSpaceError||m.foveatedConeSize===1||o._priorityProgressiveResolution&&T&&S||m._pass===ep.PRELOAD_FLIGHT||m._pass===ep.PRELOAD)return!1;let M=1-Math.cos(C.frustum.fov*.5),I=m.foveatedConeSize*M;if(o._foveatedFactor<=I)return!1;let P=M-I,D=xe.clamp((o._foveatedFactor-I)/P,0,1),L=m.foveatedInterpolationCallback(m.foveatedMinimumScreenSpaceErrorRelaxation,m.maximumScreenSpaceError,D),R=o._screenSpaceError===0&&N(o.parent)?o.parent._screenSpaceError*.5:o._screenSpaceError;return m.maximumScreenSpaceError-L<=R}var ZQe=new ci;af.prototype.getScreenSpaceError=function(o,f,m){let v=this._tileset,y=Z(m,1),x=N(this.parent)?this.parent.geometricError:v._scaledGeometricError,C=f?x:this.geometricError;if(C===0)return 0;let{camera:w,context:A}=o,E=w.frustum,T=A.drawingBufferWidth,S=A.drawingBufferHeight*y,M;if(o.mode===_i.SCENE2D||E instanceof Gs){let I=E.offCenterFrustum;N(I)&&(E=I);let P=Math.max(E.top-E.bottom,E.right-E.left)/Math.max(T,S);M=C/P}else{let I=Math.max(this._distanceToCamera,xe.EPSILON7),P=E.sseDenominator;if(M=C*S/(I*P),v.dynamicScreenSpaceError){let D=v._dynamicScreenSpaceErrorComputedDensity,L=v.dynamicScreenSpaceErrorFactor,R=xe.fog(I,D)*L;M-=R}}return M/=o.pixelRatio,M};function Bri(o,f){if(o.progressiveResolutionHeightFraction<=0||o.progressiveResolutionHeightFraction>.5)return!1;let m=f._screenSpaceErrorProgressiveResolution>o._maximumScreenSpaceError;f._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let v=f.parent,y=o._maximumScreenSpaceError,x=f._screenSpaceErrorProgressiveResolution<=y,C=N(v)&&v._screenSpaceErrorProgressiveResolution>y;return x&&C&&(f._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,m=!0),m}function kri(o,f){let m=f.parent,v=N(m)&&(!o.isSkippingLevelOfDetail||f._screenSpaceError===0||m.hasTilesetContent||m.hasImplicitContent)?m._screenSpaceError:f._screenSpaceError;return o.root._screenSpaceError-v}af.prototype.updateVisibility=function(o){let{parent:f,tileset:m}=this;if(this._updatedVisibilityFrame===m._updatedVisibilityFrame)return;let v=N(f)?f.computedTransform:m.modelMatrix,y=N(f)?f._visibilityPlaneMask:hg.MASK_INDETERMINATE;this.updateTransform(v),this._distanceToCamera=this.distanceToTile(o),this._centerZDepth=this.distanceToTileCenter(o),this._screenSpaceError=this.getScreenSpaceError(o,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(o,!1,m.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(o,y),this._visible=this._visibilityPlaneMask!==hg.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(o),this._priorityReverseScreenSpaceError=kri(m,this),this._priorityProgressiveResolution=Bri(m,this),this.priorityDeferred=Fri(this,o),this._updatedVisibilityFrame=m._updatedVisibilityFrame};af.prototype.updateExpiration=function(){if(N(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let o=ci.now(ZQe);ci.lessThan(this.expireDate,o)&&(this._contentState=ud.EXPIRED,this._expiredContent=this._content)}};function Vri(o){if(!N(o.expireDuration))return;let f=ci.now(ZQe);ci.addSeconds(f,o.expireDuration,f),N(o.expireDate)?ci.lessThan(o.expireDate,f)&&ci.clone(f,o.expireDate):o.expireDate=ci.clone(f)}function zri(o){return function(){return o._priority}}af.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Hri(this):Gri(this)};function Hri(o){let f=o._content,m=o._tileset;if(!N(f)){let y=Gh(o._header,"3DTILES_multiple_contents")?o._header.extensions["3DTILES_multiple_contents"]:o._header;f=new hAe(m,o,o._contentResource.clone(),y),o._content=f}let v=f.requestInnerContents();if(N(v))return o._contentState=ud.LOADING,v.then(y=>{if(!o.isDestroyed()&&N(y))return o._contentState=ud.PROCESSING,f}).catch(y=>{if(!o.isDestroyed())throw o._contentState=ud.FAILED,y})}async function Uri(o,f,m,v,y){let x=o._contentState;o._contentState=ud.LOADING,++f.statistics.numberOfPendingRequests;let C;try{C=await y}catch(w){if(--f.statistics.numberOfPendingRequests,o.isDestroyed())return;if(m.cancelled||m.state===bc.CANCELLED){o._contentState=x,++f.statistics.numberOfAttemptedRequests;return}throw o._contentState=ud.FAILED,w}if(o.isDestroyed()){--f.statistics.numberOfPendingRequests;return}if(m.cancelled||m.state===bc.CANCELLED){o._contentState=x,--f.statistics.numberOfPendingRequests,++f.statistics.numberOfAttemptedRequests;return}try{let w=await Wri(o,C);return--f.statistics.numberOfPendingRequests,o.isDestroyed()?void 0:(v&&(o.expireDate=void 0),o._content=w,o._contentState=ud.PROCESSING,w)}catch(w){if(--f.statistics.numberOfPendingRequests,o.isDestroyed())return;throw o._contentState=ud.FAILED,w}}function Gri(o){let f=o._contentResource.clone(),m=o.contentExpired;m&&f.setQueryParameters({expired:o.expireDate.toString()});let v=new cg({throttle:!0,throttleByServer:!0,type:Qy.TILES3D,priorityFunction:zri(o),serverKey:o._serverKey});o._request=v,f.request=v;let y=o._tileset,x=f.fetchArrayBuffer();if(!N(x)){++y.statistics.numberOfAttemptedRequests;return}return Uri(o,y,v,m,x)}async function Wri(o,f){let m=t6(f),v=o._tileset;v._disableSkipLevelOfDetail=v._disableSkipLevelOfDetail||m.contentType===Ev.GEOMETRY||m.contentType===Ev.VECTOR,(m.contentType===Ev.IMPLICIT_SUBTREE||m.contentType===Ev.IMPLICIT_SUBTREE_JSON)&&(o.hasImplicitContent=!0),m.contentType===Ev.EXTERNAL_TILESET&&(o.hasTilesetContent=!0);let y,x=Nne[m.contentType];if(o.isDestroyed())return;N(m.binaryPayload)?y=await Promise.resolve(x(v,o,o._contentResource,m.binaryPayload.buffer,0)):y=await Promise.resolve(x(v,o,o._contentResource,m.jsonPayload));let C=o._contentHeader;if(o.hasImplicitContentMetadata){let A=o.implicitSubtree,E=o.implicitCoordinates;y.metadata=A.getContentMetadataView(E,0)}else o.hasImplicitContent||(y.metadata=Fne(v,C));let w=Bne(v,C);return N(w)&&(y.group=new Zre({metadata:w})),y}af.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};af.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=ud.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var $Qe=new Pi;function pAe(o,f){if(f.mode!==_i.SCENE3D&&!N(o._boundingVolume2D)){let m=o._boundingVolume.boundingSphere,v=Pi.projectTo2D(m,f.mapProjection,$Qe);o._boundingVolume2D=new lD(v.center,v.radius)}return f.mode!==_i.SCENE3D?o._boundingVolume2D:o._boundingVolume}function jri(o,f){if(f.mode!==_i.SCENE3D&&!N(o._contentBoundingVolume2D)){let m=o._contentBoundingVolume.boundingSphere,v=Pi.projectTo2D(m,f.mapProjection,$Qe);o._contentBoundingVolume2D=new lD(v.center,v.radius)}return f.mode!==_i.SCENE3D?o._contentBoundingVolume2D:o._contentBoundingVolume}af.prototype.visibility=function(o,f){let m=o.cullingVolume,v=pAe(this,o),y=this._tileset,x=y.clippingPlanes;if(N(x)&&x.enabled){let C=x.computeIntersectionWithBoundingVolume(v,y.clippingPlanesOriginMatrix);if(this._isClipped=C!==La.INSIDE,C===La.OUTSIDE)return hg.MASK_OUTSIDE}return m.computeVisibilityWithPlaneMask(v,f)};af.prototype.contentVisibility=function(o){if(!N(this._contentBoundingVolume)||this._visibilityPlaneMask===hg.MASK_INSIDE)return La.INSIDE;let f=o.cullingVolume,m=jri(this,o),v=this._tileset,y=v.clippingPlanes;if(N(y)&&y.enabled){let x=y.computeIntersectionWithBoundingVolume(m,v.clippingPlanesOriginMatrix);if(this._isClipped=x!==La.INSIDE,x===La.OUTSIDE)return La.OUTSIDE}return f.computeVisibility(m)};af.prototype.distanceToTile=function(o){return pAe(this,o).distanceToCamera(o)};var Yri=new H;af.prototype.distanceToTileCenter=function(o){let f=pAe(this,o).boundingVolume,m=H.subtract(f.center,o.camera.positionWC,Yri);return H.dot(o.camera.directionWC,m)};af.prototype.insideViewerRequestVolume=function(o){let f=this._viewerRequestVolume;return!N(f)||f.distanceToCamera(o)===0};var eZe=new Ut,tZe=new H,qri=new Ut,iZe=new H,rZe=new Di,Xri=new fc,mge=new Ee;function Jri(o,f,m){let v=H.fromElements(o[0],o[1],o[2],iZe),y=Ut.fromArray(o,3,qri);v=Ee.multiplyByPoint(f,v,v);let x=Ee.getMatrix3(f,eZe);return y=Ut.multiply(x,y,y),N(m)?(m.update(v,y),m):new M3(v,y)}function Kri(o,f,m,v){let y=Di.unpack(o,0,rZe),x=o[4],C=o[5],w=fc.fromRectangle(y,x,C,ki.WGS84,Xri),A=w.center,E=w.halfAxes;f=Ee.multiplyTransformation(f,Ee.inverseTransformation(m,mge),mge),A=Ee.multiplyByPoint(f,A,A);let T=Ee.getMatrix3(f,eZe);return E=Ut.multiply(T,E,E),N(v)&&v instanceof M3?(v.update(A,E),v):new M3(A,E)}function Qri(o,f,m,v){if(!Ee.equalsEpsilon(f,m,xe.EPSILON8))return Kri(o,f,m,v);if(N(v))return v;let y=Di.unpack(o,0,rZe);return new rT({rectangle:y,minimumHeight:o[4],maximumHeight:o[5]})}function Zri(o,f,m){let v=H.fromElements(o[0],o[1],o[2],iZe),y=o[3];v=Ee.multiplyByPoint(f,v,v);let x=Ee.getScale(f,tZe),C=H.maximumComponent(x);return y*=C,N(m)?(m.update(v,y),m):new lD(v,y)}af.prototype.createBoundingVolume=function(o,f,m){if(!N(o))throw new sr("boundingVolume must be defined");if(Gh(o,"3DTILES_bounding_volume_S2"))return new fAe(o.extensions["3DTILES_bounding_volume_S2"]);let{box:v,region:y,sphere:x}=o;if(N(v))return Jri(v,f,m);if(N(y))return Qri(o.region,f,this._initialTransform,m);if(N(x))return Zri(x,f,m);throw new sr("boundingVolume must contain a sphere, region, or box")};af.prototype.updateTransform=function(o){o=Z(o,Ee.IDENTITY);let f=Ee.multiplyTransformation(o,this.transform,mge);if(Ee.equals(f,this.computedTransform))return;Ee.clone(f,this.computedTransform);let m=this._header,v=this._contentHeader;this._boundingVolume=this.createBoundingVolume(m.boundingVolume,this.computedTransform,this._boundingVolume),N(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(v.boundingVolume,this.computedTransform,this._contentBoundingVolume)),N(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(m.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};af.prototype.updateGeometricErrorScale=function(){let o=Ee.getScale(this.computedTransform,tZe),f=H.maximumComponent(o);if(this.geometricError=this._geometricError*f,!N(this.parent)){let m=this._tileset;m._scaledGeometricError=m._geometricError*f}};function $ri(o,f,m,v){if(!v.isRender)return;let y=N(o._contentHeader)&&N(o._contentHeader.boundingVolume),x=f.debugShowBoundingVolume||f.debugShowContentBoundingVolume&&!y;if(x){let A;o._finalResolution?o.hasRenderableContent?A=Re.WHITE:A=Re.DARKGRAY:A=Re.YELLOW,N(o._debugBoundingVolume)||(o._debugBoundingVolume=o._boundingVolume.createDebugVolume(A)),o._debugBoundingVolume.update(m);let E=o._debugBoundingVolume.getGeometryInstanceAttributes("outline");E.color=ea.toValue(A,E.color)}else!x&&N(o._debugBoundingVolume)&&(o._debugBoundingVolume=o._debugBoundingVolume.destroy());f.debugShowContentBoundingVolume&&y?(N(o._debugContentBoundingVolume)||(o._debugContentBoundingVolume=o._contentBoundingVolume.createDebugVolume(Re.BLUE)),o._debugContentBoundingVolume.update(m)):!f.debugShowContentBoundingVolume&&N(o._debugContentBoundingVolume)&&(o._debugContentBoundingVolume=o._debugContentBoundingVolume.destroy()),f.debugShowViewerRequestVolume&&N(o._viewerRequestVolume)?(N(o._debugViewerRequestVolume)||(o._debugViewerRequestVolume=o._viewerRequestVolume.createDebugVolume(Re.YELLOW)),o._debugViewerRequestVolume.update(m)):!f.debugShowViewerRequestVolume&&N(o._debugViewerRequestVolume)&&(o._debugViewerRequestVolume=o._debugViewerRequestVolume.destroy());let C=f.debugColorizeTiles&&!o._debugColorizeTiles||N(f._heatmap.tilePropertyName),w=!f.debugColorizeTiles&&o._debugColorizeTiles;C?(f._heatmap.colorize(o,m),o._debugColorizeTiles=!0,o.color=o._debugColor):w&&(o._debugColorizeTiles=!1,o.color=Re.WHITE),o._colorDirty&&(o._colorDirty=!1,o._content.applyDebugSettings(!0,o._color)),w&&f.makeStyleDirty()}function eni(o,f,m){let v=o._expiredContent;if(!o.hasMultipleContents&&N(v)){if(!o.contentReady){try{v.update(f,m)}catch{}return}o._expiredContent.destroy(),o._expiredContent=void 0}if(N(o.content))try{o.content.update(f,m)}catch(y){throw o._contentState=ud.FAILED,y}}function tni(o,f){let m=f.clippingPlanes,v=0;N(m)&&o._isClipped&&m.enabled&&(v=m.clippingPlanesState),v!==o._clippingPlanesState&&(o._clippingPlanesState=v,o.clippingPlanesDirty=!0)}af.prototype.update=function(o,f,m){let{commandList:v}=f,y=v.length;tni(this,o),$ri(this,o,f,m),eni(this,o,f);let x=v.length;this._commandsLength=x-y;for(let C=y;Cy||m);){let w=C.item;C=C.next,this.unloadTile(o,w,f)}};FB.prototype.trim=function(){this._trimTiles=!0};var _Ae=FB;function zne(o){this.tilePropertyName=o,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function gge(o,f){let m;return f==="_loadTimestamp"?m=ci.toDate(o).getTime():m=o,m}zne.prototype.setReferenceMinimumMaximum=function(o,f,m){this._referenceMinimum[m]=gge(o,m),this._referenceMaximum[m]=gge(f,m)};function nni(o,f){let m=o.tilePropertyName;if(N(m)){let v=gge(f[m],m);return N(v)?(o._maximum=Math.max(v,o._maximum),o._minimum=Math.min(v,o._minimum),v):(o.tilePropertyName=void 0,v)}}var vfe=[new Re(.1,.1,.1,1),new Re(.153,.278,.878,1),new Re(.827,.231,.49,1),new Re(.827,.188,.22,1),new Re(1,.592,.259,1),new Re(1,.843,0,1)];zne.prototype.colorize=function(o,f){let m=this.tilePropertyName;if(!N(m)||!o.contentAvailable||o._selectedFrame!==f.frameNumber)return;let v=nni(this,o),y=this._previousMinimum,x=this._previousMaximum;if(y===Number.MAX_VALUE||x===-Number.MAX_VALUE)return;let C=x-y+xe.EPSILON7,w=xe.clamp(v-y,0,C)/C,A=vfe.length-1,E=w*A,T=Math.floor(E),S=Math.ceil(E),M=E-T,I=vfe[T],P=vfe[S],D=Re.clone(Re.WHITE);D.red=xe.lerp(I.red,P.red,M),D.green=xe.lerp(I.green,P.green,M),D.blue=xe.lerp(I.blue,P.blue,M),o._debugColor=D};zne.prototype.resetMinimumMaximum=function(){let o=this.tilePropertyName;if(N(o)){let f=this._referenceMinimum[o],m=this._referenceMaximum[o],v=N(f)&&N(m);this._previousMinimum=v?f:this._minimum,this._previousMaximum=v?m:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var vAe=zne;function o6(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.batchTableByteLength=0}o6.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};function Hne(o,f,m,v){let y=f.innerContents,x=f.pointsLength,C=f.trianglesLength,w=f.featuresLength,A=f.geometryByteLength,E=f.texturesByteLength,T=f.batchTableByteLength;if(v?(o.numberOfFeaturesLoaded+=m?-w:w,o.numberOfPointsLoaded+=m?-x:x,o.geometryByteLength+=m?-A:A,o.texturesByteLength+=m?-E:E,o.batchTableByteLength+=m?-T:T):(o.numberOfFeaturesSelected+=m?-w:w,o.numberOfPointsSelected+=m?-x:x,o.numberOfTrianglesSelected+=m?-C:C),N(y)){let S=y.length;for(let M=0;M>1)&858993459,o=(o^o>>2)&252645135,o=(o^o>>4)&16711935,o=(o^o>>8)&65535,o}function xfe(o){return o&=153391689,o=(o^o>>2)&51130563,o=(o^o>>4)&50393103,o=(o^o>>8)&4278190335,o=(o^o>>16)&1023,o}_q.encode2D=function(o,f){return(lVe(o)|lVe(f)<<1)>>>0};_q.decode2D=function(o,f){return N(f)||(f=new Array(2)),f[0]=uVe(o),f[1]=uVe(o>>1),f};_q.encode3D=function(o,f,m){return yfe(o)|yfe(f)<<1|yfe(m)<<2};_q.decode3D=function(o,f){return N(f)||(f=new Array(3)),f[0]=xfe(o),f[1]=xfe(o>>1),f[2]=xfe(o>>2),f};var DH=_q;function Fd(o){this.subdivisionScheme=o.subdivisionScheme,this.subtreeLevels=o.subtreeLevels,this.level=o.level,this.x=o.x,this.y=o.y,this.z=void 0,o.subdivisionScheme===N0.OCTREE&&(this.z=o.z)}Object.defineProperties(Fd.prototype,{childIndex:{get:function(){let o=0;return o|=this.x&1,o|=(this.y&1)<<1,this.subdivisionScheme===N0.OCTREE&&(o|=(this.z&1)<<2),o}},mortonIndex:{get:function(){return this.subdivisionScheme===N0.OCTREE?DH.encode3D(this.x,this.y,this.z):DH.encode2D(this.x,this.y)}},tileIndex:{get:function(){let o=this.subdivisionScheme===N0.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,f=this.mortonIndex;return o+f}}});Fd.prototype.getDescendantCoordinates=function(o){let f=this.level+o.level,m=(this.x<>f,v=o.y>>f,y=this.x===m,x=this.y===v;if(this.subdivisionScheme===N0.OCTREE){let C=o.z>>f,w=this.z===C;return y&&x&&w}return y&&x};Fd.prototype.isEqual=function(o){return this.subdivisionScheme===o.subdivisionScheme&&this.subtreeLevels===o.subtreeLevels&&this.level===o.level&&this.x===o.x&&this.y===o.y&&(this.subdivisionScheme===N0.OCTREE?this.z===o.z:!0)};Fd.prototype.isImplicitTilesetRoot=function(){return this.level===0};Fd.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Fd.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Fd.prototype.getTemplateValues=function(){let o={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===N0.OCTREE&&(o.z=this.z),o};var cVe=[0,0,0];Fd.fromMortonIndex=function(o,f,m,v){let y;return o===N0.OCTREE?(y=DH.decode3D(v,cVe),new Fd({subdivisionScheme:o,subtreeLevels:f,level:m,x:y[0],y:y[1],z:y[2]})):(y=DH.decode2D(v,cVe),new Fd({subdivisionScheme:o,subtreeLevels:f,level:m,x:y[0],y:y[1]}))};Fd.fromTileIndex=function(o,f,m){let v,y,x;return o===N0.OCTREE?(v=Math.floor(xe.log2(7*m+1)/3),y=((1<<3*v)-1)/7,x=m-y):(v=Math.floor(xe.log2(3*m+1)/2),y=((1<<2*v)-1)/3,x=m-y),Fd.fromMortonIndex(o,f,v,x)};var Une=Fd;function hD(){}hD.selectTiles=function(o,f){li.throwInstantiationError()};hD.sortChildrenByDistanceToCamera=function(o,f){return f._distanceToCamera===0&&o._distanceToCamera===0?f._centerZDepth-o._centerZDepth:f._distanceToCamera-o._distanceToCamera};hD.canTraverse=function(o){return o.children.length===0?!1:o.hasTilesetContent||o.hasImplicitContent?!o.contentExpired:o._screenSpaceError>o.tileset._maximumScreenSpaceError};hD.selectTile=function(o,f){if(o.contentVisibility(f)===La.OUTSIDE)return;let{content:m,tileset:v}=o;m.featurePropertiesDirty?(m.featurePropertiesDirty=!1,o.lastStyleTime=0,v._selectedTilesToStyle.push(o)):o._selectedFrame0;if((o.hasTilesetContent||o.hasImplicitContent)&&m){let x=o.children[0];sZe(x,f),o._visible=x._visible;return}if(uni(o,f)){o._visible=!1;return}let v=o.refine===Ug.REPLACE,y=o._optimChildrenWithinParent===WR.USE_OPTIMIZATION;if(v&&y&&m&&!cni(o,f)){++o.tileset._statistics.numberOfTilesCulledWithChildrenUnion,o._visible=!1;return}}function uni(o,f){let{parent:m,tileset:v}=o;return!N(m)||m.hasTilesetContent||m.hasImplicitContent||m.refine!==Ug.ADD?!1:o.getScreenSpaceError(f,!0)<=v._maximumScreenSpaceError}function cni(o,f){let m=!1,v=o.children;for(let y=0;y0;){H9.stackMaximumLength=Math.max(H9.stackMaximumLength,C.length);let w=C.pop(),A=w.refine===Ug.ADD,E=w.refine===Ug.REPLACE,T=dni(w);T&&fni(w,C,f),(A||E&&!T)&&(pni(o,w),y(w,f),mni(w,f),w.hasRenderableContent&&!w.contentAvailable&&(m=!1)),x(w,f)}return H9.stack.trim(H9.stackMaximumLength),m};function dni(o){return o.children.length===0?!1:o.hasTilesetContent||o.hasImplicitContent?!o.contentExpired:(o.hasEmptyContent,!0)}function fni(o,f,m){let{children:v}=o;for(let y=0;y0;){rW.stackMaximumLength=Math.max(rW.stackMaximumLength,w.length);let A=w.pop(),E=A.parent,T=!N(E)||E._refines;A._refines=v(A)?gni(A,w,f)&&T:!1;let S=!A._refines&&T;A.hasRenderableContent?A.refine===Ug.ADD?(Cfe(A,f),y(A,f)):A.refine===Ug.REPLACE&&(y(A,f),S&&Cfe(A,f)):(m._emptyTiles.push(A),y(A,f),S&&Cfe(A,f)),x(A,f),C(A,f)}}function vni(o,f){let{canTraverse:m,updateTile:v,loadTile:y,touchTile:x}=Xy,C=!0,w=nW.stack;for(w.push(o);w.length>0;){nW.stackMaximumLength=Math.max(nW.stackMaximumLength,w.length);let A=w.pop(),E=A.children,T=E.length,S=!A.hasRenderableContent&&m(A),M=!A.hasRenderableContent&&A.children.length===0;if(!S&&!A.contentAvailable&&!M&&(C=!1),v(A,f),A.isVisible||(y(A,f),x(A,f)),S)for(let I=0;I0;){aW.stackMaximumLength=Math.max(aW.stackMaximumLength,x.length);let C=x.pop().children;for(let w=0;wm._depth+o.skipLevels)}function wni(o,f,m){let{tileset:v,children:y}=o,{updateTile:x,loadTile:C,touchTile:w}=Xy;for(let E=0;Ef:o._screenSpaceError>f:!0}function Eni(o,f){let{tileset:m}=o,v=m.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(m.baseScreenSpaceError,m.maximumScreenSpaceError),{canTraverse:y,loadTile:x,visitTile:C,touchTile:w}=Xy,A=oW.stack;for(A.push(o);A.length>0;){oW.stackMaximumLength=Math.max(oW.stackMaximumLength,A.length);let E=A.pop();Cni(E,f);let T=E.parent,S=!N(T)||T._refines;E._refines=y(E)?wni(E,A,f)&&S:!1;let M=!E._refines&&S;E.hasRenderableContent?E.refine===Ug.ADD?(mZ(E,f),x(E,f)):E.refine===Ug.REPLACE&&(Ani(E,v)?(x(E,f),M&&mZ(E,f)):M?(mZ(E,f),x(E,f)):bni(m,E)&&x(E,f)):(m._emptyTiles.push(E),x(E,f),M&&mZ(E,f)),C(E,f),w(E,f)}}function Tni(o,f){let{selectTile:m,canTraverse:v}=Xy,{stack:y,ancestorStack:x}=JI,C;for(y.push(o);y.length>0||x.length>0;){if(JI.stackMaximumLength=Math.max(JI.stackMaximumLength,y.length),JI.ancestorStackMaximumLength=Math.max(JI.ancestorStackMaximumLength,x.length),x.length>0){let E=x.peek();if(E._stackLength===y.length){x.pop(),E!==C&&(E._finalResolution=!1),m(E,f);continue}}let w=y.pop();if(!N(w))continue;let A=v(w);if(w._shouldSelect)if(w.refine===Ug.ADD)m(w,f);else{if(w._selectionDepth=x.length,w._selectionDepth>0&&(w.tileset.hasMixedContent=!0),C=w,!A){m(w,f);continue}x.push(w),w._stackLength=y.length}if(A){let E=w.children;for(let T=0;T(v._metadataExtension=C,x))}).then(function(x){if(v.isDestroyed())return;v._geometricError=x.geometricError,v._scaledGeometricError=x.geometricError,v._root=v.loadTileset(y,x);let C=N(x.asset.gltfUpAxis)?Df.fromName(x.asset.gltfUpAxis):Df.Y,w=Z(o.modelUpAxis,C),A=Z(o.modelForwardAxis,Df.X),E=x.asset;v._asset=E,v._properties=x.properties,v._extensionsUsed=x.extensionsUsed,v._extensions=x.extensions,v._modelUpAxis=w,v._modelForwardAxis=A,v._extras=x.extras;let T=E.extras;if(N(T)&&N(T.cesium)&&N(T.cesium.credits)){let P=T.cesium.credits,D=v._credits;N(D)||(D=[],v._credits=D);for(let L=0;Lzh._defaultMinTerrainHeight&&(v._initialClippingPlanesOriginMatrix=tn.eastNorthUpToFixedFrame(S)),v._clippingPlanesOriginMatrix=Ee.clone(v._initialClippingPlanesOriginMatrix);let I=Mt.fromCartesian(v.boundingSphere.center);return v._flattenOriginPoint=I,v._ready=!0,v}),lq.FlattenEXInit(this)}}vh.prototype.isAvailable=function(o){let f=this._availability;return!N(f)||f.contains(o)};Object.defineProperties(vh.prototype,{availability:S1("availability"),definitionChanged:{get:function(){return this._definitionChanged}},isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(o){Uv.setOwner(o,this,"_clippingPlanes")}},properties:{get:function(){return this._properties}},ready:{get:function(){return mi("Cesium3DTileset.ready","Cesium3DTileset.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),N(this._root)}},readyPromise:{get:function(){return mi("Cesium3DTileset.readyPromise","Cesium3DTileset.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTileset.fromUrl instead."),this._readyPromise}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return mi("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(o){this._styleEngine.style=o}},customShader:{get:function(){return this._customShader},set:function(o){this._customShader=o}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(o){this._hasMixedContent=o}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!N(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(N(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(N(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(o){this._maximumScreenSpaceError=o}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(o){this._maximumMemoryUsage=o}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(o){this._pointCloudShading=o}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(o){this._modelMatrix=Ee.clone(o,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let o=this._statistics;return o.texturesByteLength+o.geometryByteLength+o.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return N(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(Ee.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):Ee.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(o){this._foveatedConeSize=o}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(o){this._foveatedMinimumScreenSpaceErrorRelaxation=o}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(o){o!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=o,this._shouldDestroyImageBasedLighting=!1)}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(o){this._showCreditsOnScreen=o}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(o){typeof o=="number"&&(o=`featureId_${o}`),this._featureIdLabel=o}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(o){typeof o=="number"&&(o=`instanceFeatureId_${o}`),this._instanceFeatureIdLabel=o}},underGroundMode:{get:function(){return this._underGroundMode.enabled},set:function(o){this._underGroundMode.enabled=o,N(this._underGroundCustomShader)||(this._underGroundCustomShader=vh.createUnderGroundCustomShader()),o?(this._otherCustomShader=this.customShader,this.customShader=this._underGroundCustomShader):this.customShader=this._otherCustomShader,this._underGroundCustomShader&&this._underGroundCustomShader.uniforms&&this._underGroundCustomShader.uniforms.u_underGroundModel&&(this._underGroundCustomShader.uniforms.u_underGroundModel.value=o)}},underGroundModeAlpha:{get:function(){N(this._underGroundCustomShader)||(this._underGroundCustomShader=vh.createUnderGroundCustomShader());let o=this._underGroundCustomShader;return o&&o.uniforms&&o.uniforms.u_underGroundModelAlpha?o.uniforms.u_underGroundModelAlpha.value:0},set:function(o){N(this._underGroundCustomShader)||(this._underGroundCustomShader=vh.createUnderGroundCustomShader());let f=this._underGroundCustomShader;f&&f.uniforms&&f.uniforms.u_underGroundModelAlpha&&(f.uniforms.u_underGroundModelAlpha.value=o)}},underGroundModePosition:{get:function(){N(this._underGroundCustomShader)||(this._underGroundCustomShader=vh.createUnderGroundCustomShader());let o=this._underGroundCustomShader;return o&&o.uniforms&&o.uniforms.u_underGroundModelPosition?o.uniforms.u_underGroundModelPosition.value:new H(0,-0,0)},set:function(o){let f=this._underGroundCustomShader;f&&f.uniforms&&f.uniforms.u_underGroundModelPosition&&(f.uniforms.u_underGroundModelPosition.value=o)}},underGroundModeNormal:{get:function(){N(this._underGroundCustomShader)||(this._underGroundCustomShader=vh.createUnderGroundCustomShader());let o=this._underGroundCustomShader;return o&&o.uniforms&&o.uniforms.u_underGroundModelNormal?o.uniforms.u_underGroundModelNormal.value:new H(0,-0,0)},set:function(o){let f=this._underGroundCustomShader;f&&f.uniforms&&f.uniforms.u_underGroundModelNormal&&(f.uniforms.u_underGroundModelNormal.value=o)}},useCustomCullingVolume:{get:function(){return this._useCustomCullingVolume},set:function(o){this._useCustomCullingVolume=o}},cullingDistance:{get:function(){return this._cullingDistance},set:function(o){this._cullingDistance=o}},useCameraHeightRangeLimit:{get:function(){return this._useCameraHeightRangeLimit},set:function(o){this._useCameraHeightRangeLimit=o}},cameraHeightRange:{get:function(){return this._cameraHeightRange},set:function(o){this._cameraHeightRange=o}}});vh.createUnderGroundCustomShader=function(){return new Kw({uniforms:{u_underGroundModel:{type:Ra.BOOL,value:!0},u_underGroundModelAlpha:{type:Ra.FLOAT,value:.8},u_underGroundModelPosition:{type:Ra.VEC3,value:new H(0,0,20)},u_underGroundModelNormal:{type:Ra.VEC3,value:new H(0,0,1)}},fragmentShaderText:` uniform mat4 u_underGroundModeMatrix; void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { if(!u_underGroundModel) return; vec3 transNor = (u_underGroundModeMatrix * vec4(u_underGroundModelNormal, 0.0)).xyz; vec3 transPos = (u_underGroundModeMatrix * vec4(u_underGroundModelPosition, 1.0)).xyz; vec3 relectPos = fsInput.attributes.positionEC - transPos; float d = dot(transNor, relectPos); #ifdef TRANSLUCENT_PLANES if(d < 0.0) discard; material.alpha *= u_underGroundModelAlpha; #else if(d > 0.0) discard; #endif }`})};vh.fromIonAssetId=async function(o,f){let m=await Pw.fromAssetId(o);return vh.fromUrl(m,f)};vh.fromUrl=async function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=Jr.createIfNeeded(o),v;m.extension==="json"?v=m.getBaseUri(!0):m.isDataUri&&(v="");let y=await vh.loadJson(m),x=await hZe(m,y),C=new vh(f);C._resource=m,C._url=m.url,C._basePath=v,C._metadataExtension=x,C._geometricError=y.geometricError,C._scaledGeometricError=y.geometricError;let w=y.asset;C._asset=w,C._extras=y.extras;let A=m.credits;N(A)||(A=[]);let E=w.extras;if(N(E)&&N(E.cesium)&&N(E.cesium.credits)){let D=E.cesium.credits;for(let L=0;Lzh._defaultMinTerrainHeight&&(C._initialClippingPlanesOriginMatrix=tn.eastNorthUpToFixedFrame(I)),C._clippingPlanesOriginMatrix=Ee.clone(C._initialClippingPlanesOriginMatrix),C._readyPromise=Promise.resolve(C),C._ready=!0,C};vh.loadJson=function(o){return Jr.createIfNeeded(o).fetchJson()};vh.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};vh.prototype.loadTileset=function(o,f,m){let v=f.asset;if(!N(v))throw new sr("Tileset must have an asset property.");if(v.version!=="0.0"&&v.version!=="1.0"&&v.version!=="1.1")throw new sr("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");N(f.extensionsRequired)&&vh.checkSupportedExtensions(f.extensionsRequired);let y=this._statistics,x=v.tilesetVersion;N(x)&&(this._basePath+=`?v=${x}`,o=o.clone(),o.setQueryParameters({v:x}));let C=hVe(this,o,f.root,m);N(m)&&(m.children.push(C),C._depth=m._depth+1);let w=[];for(w.push(C);w.length>0;){let A=w.pop();++y.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&A.refine===Ug.ADD;let E=A._header.children;if(N(E))for(let T=0;TL.minimumRadius){let F=Mt.fromCartesian(O,L,Sni);m=H.normalize(w.positionWC,dVe),v=w.directionWC,y=w.positionCartographic.height,x=0,C=F.height*2}else{let F=Ee.multiplyByPoint(D,w.positionWC,Mni);if(m=H.UNIT_Z,v=Ee.multiplyByPointAsVector(D,w.directionWC,Dni),v=H.normalize(v,v),y=F.z,E instanceof M3){let k=A._header.boundingVolume.box[11];x=O.z-k,C=O.z+k}else if(E instanceof lD){let k=R.radius;x=O.z-k,C=O.z+k}}}let T=o.dynamicScreenSpaceErrorHeightFalloff,S=x+(C-x)*T,M=C,I=xe.clamp((y-S)/(M-S),0,1),P=1-Math.abs(H.dot(v,m));P=P*(1-I),o._dynamicScreenSpaceErrorComputedDensity=o.dynamicScreenSpaceErrorDensity*P}function Rni(o,f){if(f.hasEmptyContent)return;let{statistics:m}=o,v=f.contentExpired,y=f.requestContent();N(y)&&(y.then(x=>{!N(x)||f.isDestroyed()||o.isDestroyed()||(o._processingQueue.push(f),++m.numberOfTilesProcessing)}).catch(x=>{dZe(x,o,f)}),v&&(f.hasTilesetContent||f.hasImplicitContent?Uni(o,f):(m.decrementLoadCounts(f.content),--m.numberOfTilesWithContentReady)),o._requestedTilesInFlight.push(f))}function Oni(o,f){return o._priority-f._priority}vh.prototype.postPassesUpdate=function(o){N(this._root)&&(Nni(this,o),Wni(this,o),this._cache.unloadTiles(this,pZe),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};vh.prototype.prePassesUpdate=function(o){if(!N(this._root))return;kni(this,o);let f=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,N(f)&&f.enabled&&f.update(o),N(this._loadTimestamp)||(this._loadTimestamp=ci.clone(o.time)),this._timeSinceLoad=Math.max(ci.secondsDifference(o.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Lni(this,o),o.newFrame&&this._cache.reset()};function Nni(o,f){let m=o._requestedTilesInFlight,v=0;for(let y=0;y=1;if(x._contentState!==ud.LOADING){++v;continue}else if(C){x.cancelRequests(),++v;continue}v>0&&(m[y-v]=x)}m.length-=v}function Fni(o){let f=o._requestedTiles;f.sort(Oni);for(let m=0;m0?f.tileFailed.raiseEvent({url:v,message:y}):(console.log(`A 3D tile failed to load: ${v}`),console.log(`Error: ${y}`))}function Bni(o){let f=o._processingQueue,m=0;for(let v=0;v0&&(f[v-m]=y)}f.length-=m}function kni(o,f){Bni(o);let m=o._processingQueue,v=o._statistics,y;for(let x=0;x0&&(v+=` Points: ${o.content.pointsLength}`,y++),o.content.trianglesLength>0&&(v+=` Triangles: ${o.content.trianglesLength}`,y++),v+=` Features: ${o.content.featuresLength}`,y++),f.debugShowMemoryUsage&&(v+=` Texture Memory: ${fVe(o.content.texturesByteLength)}`,v+=` Geometry Memory: ${fVe(o.content.geometryByteLength)}`,y+=2),f.debugShowUrl)if(o.hasMultipleContents){v+=` Urls:`;let C=o.content.innerContentUrls;for(let w=0;w0;o._backfaceCommands.length=0,w&&(N(o._stencilClearCommand)||(o._stencilClearCommand=new Gc({stencil:0,pass:vr.CESIUM_3D_TILE,renderState:Mn.fromCache({stencilMask:Ua.SKIP_LOD_MASK})})),v.push(o._stencilClearCommand));let{statistics:A,tileVisible:E}=o,T=m.isRender,S=v.length;for(let P=0;P=0;--L)v[S+D+L]=v[S+L];for(let L=0;L0&&o._pointCloudEyeDomeLighting.update(f,x,o.pointCloudShading,o.boundingSphere),o.debugShowGeometricError||o.debugShowRenderingStatistics||o.debugShowMemoryUsage||o.debugShowUrl?(N(o._tileDebugLabels)||(o._tileDebugLabels=new UM),zni(o,f)):o._tileDebugLabels=o._tileDebugLabels&&o._tileDebugLabels.destroy())}var fZe=[];function Uni(o,f){let m=f,v=fZe;for(v.push(f);v.length>0;){f=v.pop();let y=f.children;for(let x=0;xthis._cameraHeightRange.y)return}this.updateForPass(o,o.tilesetPassState)};vh.prototype.updateForPass=function(o,f){let m=f.pass;if(m===ep.PRELOAD&&(!this.preloadWhenHidden||this.show)||m===ep.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||m===ep.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let v=o.commandList,y=o.camera,x=o.cullingVolume;f.ready=!1;let C=ep.getPassOptions(m),w=C.ignoreCommands,A=Z(f.commandList,v),E=A.length;o.commandList=A,o.camera=Z(f.camera,y),o.cullingVolume=Z(f.cullingVolume,x),y.frustum.farForTileset=this._cullingDistance,this._useCustomCullingVolume&&(o.cullingVolume=o.cullingVolumeForTileset);let T=this._statisticsPerPass[m];(this.show||w)&&(this._pass=m,f.ready=qni(this,o,T,C)),w&&(A.length=E),o.commandList=v,o.camera=y,o.cullingVolume=x};vh.prototype.hasExtension=function(o){return N(this._extensionsUsed)?this._extensionsUsed.indexOf(o)>-1:!1};vh.prototype.isDestroyed=function(){return!1};vh.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),N(this._root)){let o=fZe;for(o.push(this._root);o.length>0;){let f=o.pop();f.destroy();let m=f.children;for(let v=0;v{if(!D._childrenAreLoaded){let L=D._tileset._baseResource,R="./data/path/"+D._header.content.uri,O=L.getDerivedResource({url:R});for(let F=0;F> 11) & 0x1f; let green = (value >> 5) & 0x3f; let blue = value & 0x1f; colour[offset + 0] = ( red << 3 ) | ( red >> 2 ); colour[offset + 1] = ( green << 2 ) | ( green >> 4 ); colour[offset + 2] = ( blue << 3 ) | ( blue >> 2 ); colour[offset + 3] = 255; return value; } function DecompressColour(rgba, block, nOffset, isDxt1) { let codes = new Uint8Array(16); let a = Unpack565(block[nOffset + 0], block[nOffset + 1], codes, 0); let b = Unpack565(block[nOffset + 2], block[nOffset + 3], codes, 4); for (let i = 0; i < 3; i++) { let c = codes[i]; let d = codes[4 + i]; if (isDxt1 && a <= b) { codes[8 + i] = ( c + d ) / 2; codes[12 + i] = 0; } else { codes[8 + i] = ( 2 * c + d ) / 3; codes[12 + i] = ( c + 2 * d ) / 3; } } codes[8 + 3] = 255; codes[12 + 3] = ( isDxt1 && a <= b ) ? 0 : 255; let indices = new Uint8Array(16); for (let i = 0; i < 4; ++i) { let packed = block[nOffset + 4 + i]; indices[4 * i + 0] = packed & 0x3; indices[4 * i + 1] = ( packed >> 2 ) & 0x3; indices[4 * i + 2] = ( packed >> 4 ) & 0x3; indices[4 * i + 3] = ( packed >> 6 ) & 0x3; } for (let i = 0; i < 16; ++i) { let offset = 4 * indices[i]; for (let j = 0; j < 4; ++j) rgba[4 * i + j] = codes[offset + j]; } } function DecompressAlphaDxt3(rgba, block, nOffset) { // unpack the alpha values pairwise for (let i = 0; i < 8; ++i) { // quantise down to 4 bits let quant = bytes[nOffset + i]; // unpack the values let lo = quant & 0x0f; let hi = quant & 0xf0; // convert back up to bytes rgba[8 * i + 3] = lo | ( lo << 4 ); rgba[8 * i + 7] = hi | ( hi >> 4 ); } } function DecompressAlphaDxt5(rgba, block, nOffset) { let alpha0 = block[nOffset + 0]; let alpha1 = block[nOffset + 1]; let codes = new Uint8Array(8); codes[0] = alpha0; codes[1] = alpha1; if (alpha0 <= alpha1) { // use 5-alpha codebook for (let i = 1; i < 5; ++i) codes[1 + i] = ( ( 5 - i ) * alpha0 + i * alpha1 ) / 5; codes[6] = 0; codes[7] = 255; } else { // use 7-alpha codebook for (let i = 1; i < 7; ++i) codes[1 + i] = ( ( 7 - i ) * alpha0 + i * alpha1 ) / 7; } let indices = new Uint8Array(16); nOffset = nOffset + 2; let nBegin = 0; for (let i = 0; i < 2; ++i) { // grab 3 bytes let value = 0; for (let j = 0; j < 3; ++j) { let byte = block[nOffset++]; value |= ( byte << 8 * j ); } // unpack 8 3-bit values from it for (let j = 0; j < 8; ++j) { let index = ( value >> 3 * j ) & 0x7; indices[nBegin++] = index; } } for (let i = 0; i < 16; ++i) rgba[4 * i + 3] = codes[indices[i]]; } function Decompress(rgba, block, nOffset, flags) { let nOffset2 = 0; if (( flags & ( kDxt3 | kDxt5 ) ) != 0) nOffset2 = 8; DecompressColour(rgba, block, nOffset + nOffset2, ( flags & kDxt1 ) != 0); if (( flags & kDxt3 ) != 0) { DecompressAlphaDxt3(rgba, block, nOffset); } else if (( flags & kDxt5 ) != 0) { DecompressAlphaDxt5(rgba, block, nOffset); } } function DecompressImage565(rgb565, width, height, blocks) { let c = new Uint16Array(4); let dst = rgb565; let m = 0; let dstI = 0; let i = 0; let r0 = 0, g0 = 0, b0 = 0, r1 = 0, g1 = 0, b1 = 0; let blockWidth = width / 4; let blockHeight = height / 4; for (let blockY = 0; blockY < blockHeight; blockY++) { for (let blockX = 0; blockX < blockWidth; blockX++) { // flip Y i = 4 * ((blockHeight - blockY) * blockWidth + blockX); c[0] = blocks[i]; c[1] = blocks[i + 1]; r0 = c[0] & 0x1f; g0 = c[0] & 0x7e0; b0 = c[0] & 0xf800; r1 = c[1] & 0x1f; g1 = c[1] & 0x7e0; b1 = c[1] & 0xf800; // Interpolate between c0 and c1 to get c2 and c3. ~ // Note that we approximate 1/3 as 3/8 and 2/3 as 5/8 for // speed. This also appears to be what the hardware DXT // decoder in many GPUs does :) c[2] = ((5 * r0 + 3 * r1) >> 3) | (((5 * g0 + 3 * g1) >> 3) & 0x7e0) | (((5 * b0 + 3 * b1) >> 3) & 0xf800); c[3] = ((5 * r1 + 3 * r0) >> 3) | (((5 * g1 + 3 * g0) >> 3) & 0x7e0) | (((5 * b1 + 3 * b0) >> 3) & 0xf800); m = blocks[i + 2]; dstI = (blockY * 4) * width + blockX * 4; dst[dstI+2] = c[m & 0x3]; dst[dstI + 1] = c[(m >> 2) & 0x3]; dst[dstI + 0] = c[(m >> 4) & 0x3]; dst[dstI + 3] = c[(m >> 6) & 0x3]; dstI += width; dst[dstI+2] = c[(m >> 8) & 0x3]; dst[dstI + 1] = c[(m >> 10) & 0x3]; dst[dstI + 0] = c[(m >> 12) & 0x3]; dst[dstI + 3] = c[(m >> 14)]; m = blocks[i + 3]; dstI += width; dst[dstI+2] = c[m & 0x3]; dst[dstI + 1] = c[(m >> 2) & 0x3]; dst[dstI + 0] = c[(m >> 4) & 0x3]; dst[dstI + 3] = c[(m >> 6) & 0x3]; dstI += width; dst[dstI+2] = c[(m >> 8) & 0x3]; dst[dstI + 1] = c[(m >> 10) & 0x3]; dst[dstI + 0] = c[(m >> 12) & 0x3]; dst[dstI + 3] = c[(m >> 14)]; } } return dst; } function DecompressImage(rgba, width, height, blocks, flags) { let bytesPerBlock = ( ( flags & kDxt1 ) != 0 ) ? 8 : 16; let nOffset = 0; for (let y = 0; y < height; y += 4) { for (let x = 0; x < width; x += 4) { let targetRgba = new Uint8Array(4 * 16); Decompress(targetRgba, blocks, nOffset, flags); let nOffsetTarget = 0; for (let py = 0; py < 4; ++py) { for (let px = 0; px < 4; ++px) { let sx = x + px; let sy = y + py; if (sx < width && sy < height) { // flip Y let nBegin = 4 * ( width * (height - sy) + sx ); rgba[nBegin+2] = targetRgba[nOffsetTarget++] rgba[nBegin+1] = targetRgba[nOffsetTarget++] rgba[nBegin+0] = targetRgba[nOffsetTarget++] rgba[nBegin+3] = targetRgba[nOffsetTarget++] } else { nOffsetTarget += 4; } } } // advance nOffset += bytesPerBlock; } } } function DXTTextureDecode(options){ } DXTTextureDecode.decode = function(out, width, height, block, format){ if (out == null || block == null || height == 0 || width == 0) { return; } let flags = 0; //\u6709alpha\u901A\u9053,\u8F6C\u4E3ARGBA\uFF0C\u5426\u5219\u8F6C\u4E3Argb565 if (format > S3MPixelFormat.BGR || format === S3MPixelFormat.LUMINANCE_ALPHA) { flags = kDxt5; } else { flags = kDxt1 | krgb565; } if ((flags & kDxt1) && (flags & krgb565)) { DecompressImage565(out, width, height, block); } else { DecompressImage(out, width, height, block, flags); } }; // --------------------- DXT decode S3MModelParser.prototype.parseString = function(buffer, view, bytesOffset) { let length = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let stringBufferView = new Uint8Array(buffer, bytesOffset, length); let string = this.getStringFromTypedArray(stringBufferView); bytesOffset += length; return { string: string, bytesOffset: bytesOffset } }; S3MModelParser.prototype.parseGeode = function(buffer, view, bytesOffset, geodes) { let geode = {}; let skeletonNames = []; let geoMatrix = new Array(16); for(let i = 0; i < 16; i++) { geoMatrix[i] = view.getFloat64(bytesOffset, true); bytesOffset += Float64Array.BYTES_PER_ELEMENT; } geode.matrix = geoMatrix; geode.skeletonNames = skeletonNames; let skeletonCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; for(let i = 0; i < skeletonCount; i++) { let res = this.parseString(buffer, view, bytesOffset); skeletonNames.push(res.string); bytesOffset = res.bytesOffset; } geodes.push(geode); return bytesOffset; }; S3MModelParser.prototype.parsePageLOD = function(buffer, view, bytesOffset, pageLods) { let pageLOD = {}; pageLOD.rangeList = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; pageLOD.rangeMode = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let center = {}; center.x = view.getFloat64(bytesOffset, true); bytesOffset += Float64Array.BYTES_PER_ELEMENT; center.y = view.getFloat64(bytesOffset, true); bytesOffset += Float64Array.BYTES_PER_ELEMENT; center.z = view.getFloat64(bytesOffset, true); bytesOffset += Float64Array.BYTES_PER_ELEMENT; let radius = view.getFloat64(bytesOffset, true); bytesOffset += Float64Array.BYTES_PER_ELEMENT; pageLOD.boundingSphere = { center: center, radius: radius }; let res = this.parseString(buffer, view, bytesOffset); let strChildTile = res.string; bytesOffset = res.bytesOffset; let index = strChildTile.indexOf('Geometry'); if(index !== -1) { let ignoreString = strChildTile.substring(index); strChildTile = strChildTile.replace(ignoreString, ''); } pageLOD.childTile = strChildTile; pageLOD.geodes = []; let geodeCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; for(let i = 0; i < geodeCount; i++) { bytesOffset = this.parseGeode(buffer, view, bytesOffset, pageLOD.geodes); } pageLods.push(pageLOD); return bytesOffset; }; S3MModelParser.prototype.parseGroupNode = function(buffer, view, bytesOffset, result) { let groupNode = {}; let pageLods = []; bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let count = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; for(let i = 0; i < count; i++) { bytesOffset = this.parsePageLOD(buffer, view, bytesOffset, pageLods); } groupNode.pageLods = pageLods; let align = bytesOffset % 4; if(align !== 0) { bytesOffset += (4 - align); } result.groupNode = groupNode; return bytesOffset; }; S3MModelParser.prototype.parseVertex = function(buffer, view, bytesOffset, vertexPackage) { let verticesCount = view.getUint32(bytesOffset, true); vertexPackage.verticesCount = verticesCount; bytesOffset += Uint32Array.BYTES_PER_ELEMENT; if(bytesOffset <= 0) { return bytesOffset; } let vertexDimension = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let vertexStride = view.getUint16(bytesOffset, true); vertexStride = vertexDimension * Float32Array.BYTES_PER_ELEMENT; bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let byteLength = verticesCount * vertexDimension * Float32Array.BYTES_PER_ELEMENT; let attributes = vertexPackage.vertexAttributes; let attrLocation = vertexPackage.attrLocation; attrLocation['aPosition'] = attributes.length; let vertexBuffer = new Uint8Array(buffer).subarray(bytesOffset, bytesOffset + byteLength); attributes.push({ index: attrLocation['aPosition'], componentsPerAttribute: vertexDimension, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, offsetInBytes: bytesOffset, strideInBytes: vertexStride, byteLength: byteLength, normalize: false, typedArray: vertexBuffer }); bytesOffset += byteLength; return bytesOffset; }; S3MModelParser.prototype.parseNormal = function(buffer, view, bytesOffset, vertexPackage) { let normalCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; if(normalCount <= 0) { return bytesOffset; } let normalDimension = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let normalStride = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let byteLength = normalCount * normalDimension * Float32Array.BYTES_PER_ELEMENT; let attributes = vertexPackage.vertexAttributes; let attrLocation = vertexPackage.attrLocation; attrLocation['aNormal'] = attributes.length; attributes.push({ index: attrLocation['aNormal'], componentsPerAttribute: normalDimension, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, offsetInBytes: bytesOffset, strideInBytes: normalStride, byteLength: byteLength, normalize: false }); bytesOffset += byteLength; return bytesOffset; }; S3MModelParser.prototype.parseVertexColor = function(buffer, view, bytesOffset, vertexPackage) { let colorCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let verticesCount = vertexPackage.verticesCount; let vertexColor; if(colorCount > 0) { let colorStride = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; bytesOffset += Uint8Array.BYTES_PER_ELEMENT * 2; let byteLength = colorCount * Uint8Array.BYTES_PER_ELEMENT * 4; let attributes = vertexPackage.vertexAttributes; let attrLocation = vertexPackage.attrLocation; attrLocation['aColor'] = attributes.length; attributes.push({ index: attrLocation['aColor'], typedArray: vertexColor, componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.UNSIGNED_BYTE, offsetInBytes: bytesOffset, strideInBytes: 4, byteLength: byteLength, normalize: true }); bytesOffset += byteLength; } return bytesOffset; }; S3MModelParser.prototype.parseSecondColor = function(buffer, view, bytesOffset, vertexPackage) { let secondColorCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; if(secondColorCount <= 0) { return bytesOffset; } let secondColorStride = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; bytesOffset += Uint8Array.BYTES_PER_ELEMENT * 2; let byteLength = secondColorCount * Uint8Array.BYTES_PER_ELEMENT * 4; bytesOffset += byteLength; return bytesOffset; }; S3MModelParser.prototype.parseTexCoord = function(buffer, view, bytesOffset, vertexPackage) { let count = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; bytesOffset += Uint16Array.BYTES_PER_ELEMENT; for(let i = 0; i < count; i++) { let texCoordCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let dimension = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let texCoordStride = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let byteLength = texCoordCount * dimension * Float32Array.BYTES_PER_ELEMENT; let str = 'aTexCoord' + i; let attributes = vertexPackage.vertexAttributes; let attrLocation = vertexPackage.attrLocation; attrLocation[str] = attributes.length; attributes.push({ index: attrLocation[str], componentsPerAttribute: dimension, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, offsetInBytes: bytesOffset, strideInBytes: dimension * Float32Array.BYTES_PER_ELEMENT, byteLength: byteLength, normalize: false }); bytesOffset += byteLength; } return bytesOffset; }; S3MModelParser.prototype.parseInstanceInfo = function(buffer, view, bytesOffset, vertexPackage) { let count = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let attributes = vertexPackage.vertexAttributes; let attrLocation = vertexPackage.attrLocation; for(let i = 0; i < count; i++) { let texCoordCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let texDimensions = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let texCoordStride = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let byteLength = texCoordCount * texDimensions * Float32Array.BYTES_PER_ELEMENT; if(texDimensions === 17 || texDimensions === 29) { let instanceBuffer = new Uint8Array(buffer, bytesOffset, byteLength); vertexPackage.instanceCount = texCoordCount; vertexPackage.instanceMode = texDimensions; vertexPackage.instanceBuffer = instanceBuffer; vertexPackage.instanceIndex = 1; let len = texDimensions * texCoordCount * 4; let vertexColorInstance = instanceBuffer.slice(0, len); vertexPackage.vertexColorInstance = vertexColorInstance; let byteStride; if(texDimensions === 17) { byteStride = Float32Array.BYTES_PER_ELEMENT * 17; attrLocation['uv2'] = attributes.length; attributes.push({ index: attrLocation['uv2'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 0, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv3'] = attributes.length; attributes.push({ index: attrLocation['uv3'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 4 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv4'] = attributes.length; attributes.push({ index: attrLocation['uv4'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 8 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['secondary_colour'] = attributes.length; attributes.push({ index: attrLocation['secondary_colour'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 12 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv6'] = attributes.length; attributes.push({ index: attrLocation['uv6'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.UNSIGNED_BYTE, normalize: true, offsetInBytes: 16 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); } else if(texDimensions === 29) { byteStride = Float32Array.BYTES_PER_ELEMENT * 29; attrLocation['uv1'] = attributes.length; attributes.push({ index: attrLocation['uv1'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 0, strideInBytes: byteStride, instanceDivisor: 1, byteLength: byteLength }); attrLocation['uv2'] = attributes.length; attributes.push({ index: attrLocation['uv2'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 4 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv3'] = attributes.length; attributes.push({ index: attrLocation['uv3'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 8 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv4'] = attributes.length; attributes.push({ index: attrLocation['uv4'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 12 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv5'] = attributes.length; attributes.push({ index: attrLocation['uv5'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 16 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv6'] = attributes.length; attributes.push({ index: attrLocation['uv6'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 20 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv7'] = attributes.length; attributes.push({ index: attrLocation['uv7'], componentsPerAttribute: 3, componentDatatype: S3MModelParser.ComponentDatatype.FLOAT, normalize: false, offsetInBytes: 24 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['secondary_colour'] = attributes.length; attributes.push({ index: attrLocation['secondary_colour'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.UNSIGNED_BYTE, normalize: true, offsetInBytes: 27 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); attrLocation['uv9'] = attributes.length; attributes.push({ index: attrLocation['uv9'], componentsPerAttribute: 4, componentDatatype: S3MModelParser.ComponentDatatype.UNSIGNED_BYTE, normalize: true, offsetInBytes: 28 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: byteStride, instanceDivisor: 1 }); } } else { let len = texCoordCount * texDimensions; vertexPackage.instanceBounds = new Float32Array(len); for(let k = 0; k < len; k++) { vertexPackage.instanceBounds[k] = view.getFloat32(bytesOffset + k * Float32Array.BYTES_PER_ELEMENT, true); } } bytesOffset += byteLength; } return bytesOffset; }; S3MModelParser.prototype.parseCompressVertex = function(buffer, view, bytesOffset, vertexPackage) { let verticesCount = view.getUint32(bytesOffset, true); vertexPackage.verticesCount = verticesCount; bytesOffset += Uint32Array.BYTES_PER_ELEMENT; if(bytesOffset <= 0) { return bytesOffset; } let vertexDimension = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let vertexStride = view.getUint16(bytesOffset, true); vertexStride = vertexDimension * Int16Array.BYTES_PER_ELEMENT; bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let vertCompressConstant = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; let minVerticesValue = {}; minVerticesValue.x = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; minVerticesValue.y = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; minVerticesValue.z = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; minVerticesValue.w = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; vertexPackage.vertCompressConstant = vertCompressConstant; vertexPackage.minVerticesValue = minVerticesValue; let byteLength = verticesCount * vertexDimension * Int16Array.BYTES_PER_ELEMENT; let vertexBuffer = new Uint8Array(buffer, bytesOffset, byteLength); bytesOffset += byteLength; let attributes = vertexPackage.vertexAttributes; let attrLocation = vertexPackage.attrLocation; attrLocation['aPosition'] = attributes.length; attributes.push({ index: attrLocation['aPosition'], typedArray: vertexBuffer, componentsPerAttribute: vertexDimension, componentDatatype: ComponentDatatype.SHORT, offsetInBytes: 0, strideInBytes: vertexStride, normalize: false }); return bytesOffset; }; S3MModelParser.prototype.parseCompressNormal = function(buffer, view, bytesOffset, vertexPackage) { let normalCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; if(normalCount <= 0) { return bytesOffset; } let normalDimension = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let normalStride = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let byteLength = normalCount * 2 * Int16Array.BYTES_PER_ELEMENT; let normalBuffer = new Uint8Array(buffer, bytesOffset, byteLength); bytesOffset += byteLength; let attributes = vertexPackage.vertexAttributes; let attrLocation = vertexPackage.attrLocation; attrLocation['aNormal'] = attributes.length; attributes.push({ index: attrLocation['aNormal'], typedArray: normalBuffer, componentsPerAttribute: 2, componentDatatype: ComponentDatatype.SHORT, offsetInBytes: 0, strideInBytes: normalStride, normalize: false }); return bytesOffset; }; S3MModelParser.prototype.parseCompressTexCoord = function(buffer, view, bytesOffset, vertexPackage) { vertexPackage.texCoordCompressConstant = []; vertexPackage.minTexCoordValue = []; let count = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; bytesOffset += Uint16Array.BYTES_PER_ELEMENT; for(let i = 0; i < count; i++) { let bNeedTexCoordZ = view.getUint8(bytesOffset, true); bytesOffset += Uint8Array.BYTES_PER_ELEMENT; bytesOffset += Uint8Array.BYTES_PER_ELEMENT * 3; let texCoordCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let dimension = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let texCoordStride = view.getUint16(bytesOffset, true); bytesOffset += Uint16Array.BYTES_PER_ELEMENT; let texCoordCompressConstant = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; vertexPackage.texCoordCompressConstant.push(texCoordCompressConstant); let minTexCoordValue = {}; minTexCoordValue.x = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; minTexCoordValue.y = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; minTexCoordValue.z = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; minTexCoordValue.w = view.getFloat32(bytesOffset, true); bytesOffset += Float32Array.BYTES_PER_ELEMENT; vertexPackage.minTexCoordValue.push(minTexCoordValue); let byteLength = texCoordCount * dimension * Int16Array.BYTES_PER_ELEMENT; let texCoordBuffer = new Uint8Array(buffer, bytesOffset, byteLength); bytesOffset += byteLength; let align = bytesOffset % 4; if(align !== 0) { bytesOffset += (4 - align); } let str = 'aTexCoord' + i; let attributes = vertexPackage.vertexAttributes; let attrLocation = vertexPackage.attrLocation; attrLocation[str] = attributes.length; attributes.push({ index: attrLocation[str], typedArray: texCoordBuffer, componentsPerAttribute: dimension, componentDatatype: ComponentDatatype.SHORT, offsetInBytes: 0, strideInBytes: dimension * Int16Array.BYTES_PER_ELEMENT, normalize: false }); if(bNeedTexCoordZ) { byteLength = texCoordCount * Float32Array.BYTES_PER_ELEMENT; let texCoordZBuffer = new Uint8Array(buffer, bytesOffset, byteLength); bytesOffset += byteLength; vertexPackage.texCoordZMatrix = true; str = 'aTexCoordZ' + i; attrLocation[str] = attributes.length; attributes.push({ index: attrLocation[str], typedArray: texCoordZBuffer, componentsPerAttribute: 1, componentDatatype: ComponentDatatype.FLOAT, offsetInBytes: 0, strideInBytes: Float32Array.BYTES_PER_ELEMENT, normalize: false }); } } return bytesOffset; }; S3MModelParser.prototype.parseStandardSkeleton = function(buffer, view, bytesOffset, vertexPackage) { bytesOffset = this.parseVertex(buffer, view, bytesOffset, vertexPackage); bytesOffset = this.parseNormal(buffer, view, bytesOffset, vertexPackage); bytesOffset = this.parseVertexColor(buffer, view, bytesOffset, vertexPackage); bytesOffset = this.parseSecondColor(buffer, view, bytesOffset, vertexPackage); bytesOffset = this.parseTexCoord(buffer, view, bytesOffset, vertexPackage); bytesOffset = this.parseInstanceInfo(buffer, view, bytesOffset, vertexPackage); return bytesOffset; }; S3MModelParser.prototype.parseCompressSkeleton = function(buffer, view, bytesOffset, vertexPackage) { let compressOptions = view.getUint32(bytesOffset, true); vertexPackage.compressOptions = compressOptions; bytesOffset += Uint32Array.BYTES_PER_ELEMENT; if((compressOptions & S3MModelParser.VertexCompressOption.SVC_Vertex) === S3MModelParser.VertexCompressOption.SVC_Vertex) { bytesOffset = this.parseCompressVertex(buffer, view, bytesOffset, vertexPackage); } else { bytesOffset = this.parseVertex(buffer, view, bytesOffset, vertexPackage); } if((compressOptions & S3MModelParser.VertexCompressOption.SVC_Normal) === S3MModelParser.VertexCompressOption.SVC_Normal) { bytesOffset = this.parseCompressNormal(buffer, view, bytesOffset, vertexPackage); } else { bytesOffset = this.parseNormal(buffer, view, bytesOffset, vertexPackage); } bytesOffset = this.parseVertexColor(buffer, view, bytesOffset, vertexPackage); bytesOffset = this.parseSecondColor(buffer, view, bytesOffset, vertexPackage); if((compressOptions & S3MModelParser.VertexCompressOption.SVC_TexutreCoord) === S3MModelParser.VertexCompressOption.SVC_TexutreCoord) { bytesOffset = this.parseCompressTexCoord(buffer, view, bytesOffset, vertexPackage); } else { bytesOffset = this.parseTexCoord(buffer, view, bytesOffset, vertexPackage); } if((compressOptions & S3MModelParser.VertexCompressOption.SVC_TexutreCoordIsW) === S3MModelParser.VertexCompressOption.SVC_TexutreCoordIsW) { vertexPackage.textureCoordIsW = true; } bytesOffset = this.parseInstanceInfo(buffer, view, bytesOffset, vertexPackage); return bytesOffset; }; S3MModelParser.prototype.parseIndexPackage = function(buffer, view, bytesOffset, arrIndexPackage) { let count = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; for(let i = 0; i < count; i++) { let indexPackage = {}; let indexCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let indexType = view.getUint8(bytesOffset, true); bytesOffset += Uint8Array.BYTES_PER_ELEMENT; let bUseIndex = view.getUint8(bytesOffset, true); bytesOffset += Uint8Array.BYTES_PER_ELEMENT; let primitiveType = view.getUint8(bytesOffset, true); bytesOffset += Uint8Array.BYTES_PER_ELEMENT; bytesOffset += Uint8Array.BYTES_PER_ELEMENT; if(indexCount > 0) { let byteLength; if(indexType === 1 || indexType === 3) { byteLength = indexCount * Uint32Array.BYTES_PER_ELEMENT; indexPackage.bytesOffset = bytesOffset; indexPackage.byteLength = byteLength; } else { byteLength = indexCount * Uint16Array.BYTES_PER_ELEMENT; indexPackage.bytesOffset = bytesOffset; indexPackage.byteLength = byteLength; if(indexCount % 2 !== 0) { byteLength += 2; } } bytesOffset += byteLength; } indexPackage.indicesCount = indexCount; indexPackage.indexType = indexType; indexPackage.primitiveType = primitiveType; let arrPassName = []; let passNameCount = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; for(let j = 0; j < passNameCount; j++) { let res = this.parseString(buffer, view, bytesOffset); let passName = res.string; bytesOffset = res.bytesOffset; arrPassName.push(passName); indexPackage.materialCode = passName; } let align = bytesOffset % 4; if(align !== 0) { let nReserved = 4 - bytesOffset % 4; bytesOffset += nReserved; } arrIndexPackage.push(indexPackage); } return bytesOffset; }; S3MModelParser.prototype.parseSkeleton = function(buffer, view, bytesOffset, geoPackage) { let size = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let count = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; for(let i = 0; i < count; i++) { let res = this.parseString(buffer, view, bytesOffset); let geometryName = res.string; bytesOffset = res.bytesOffset; let align = bytesOffset % 4; if(align !== 0) { bytesOffset += (4 - align); } let tag = view.getUint32(bytesOffset, true); bytesOffset += Int32Array.BYTES_PER_ELEMENT; let vertexPackage = { vertexAttributes: [], attrLocation: {}, instanceCount: 0, instanceMode: 0, instanceIndex: -1 }; if(tag === S3MModelParser.S3MBVertexTag.SV_Standard) { bytesOffset = this.parseStandardSkeleton(buffer, view, bytesOffset, vertexPackage); } else if(tag === S3MModelParser.S3MBVertexTag.SV_Compressed) { bytesOffset = this.parseCompressSkeleton(buffer, view, bytesOffset, vertexPackage); } let arrIndexPackage = []; bytesOffset = this.parseIndexPackage(buffer, view, bytesOffset, arrIndexPackage); geoPackage[geometryName] = { vertexPackage: vertexPackage, arrIndexPackage: arrIndexPackage }; } let secColorSize = view.getUint32(bytesOffset, true); bytesOffset += secColorSize; bytesOffset += Uint32Array.BYTES_PER_ELEMENT; return bytesOffset; }; S3MModelParser.prototype.parseTexturePackage = function(buffer, view, bytesOffset, texturePackage) { let size = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let count = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; for(let i = 0; i < count; i++) { let res = this.parseString(buffer, view, bytesOffset); let textureCode = res.string; bytesOffset = res.bytesOffset; let align = bytesOffset % 4; if(align !== 0) { bytesOffset += (4 - align); } let level = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let width = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let height = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let compressType = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let size = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let pixelFormat = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let textureData = new Uint8Array(buffer, bytesOffset, size); bytesOffset += size; texturePackage[textureCode] = { id: textureCode, width: width, height: height, compressType: compressType, nFormat: pixelFormat, internalFormat: S3MModelParser.PixelFormat.RGBA_DXT5, imageBuffer: textureData }; } return bytesOffset; }; S3MModelParser.prototype.parseMaterial = function(buffer, view, bytesOffset, result) { let byteLength = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; let materialBuffer = new Uint8Array(buffer, bytesOffset, byteLength); let strMaterials = this.getStringFromTypedArray(materialBuffer); bytesOffset += byteLength; result.materials = JSON.parse(strMaterials); return bytesOffset; }; S3MModelParser.prototype.parseBuffer = function(unzipBuffer, bytesOffset) { let result = { version: undefined, groupNode: undefined, geoPackage: {}, matrials: undefined, texturePackage: {} }; result.byteLength = unzipBuffer.byteLength; result.buffer = unzipBuffer; view = new DataView(unzipBuffer); bytesOffset = 0; let nOptions = view.getUint32(bytesOffset, true); bytesOffset += Uint32Array.BYTES_PER_ELEMENT; bytesOffset = this.parseGroupNode(unzipBuffer, view, bytesOffset, result); bytesOffset = this.parseSkeleton(unzipBuffer, view, bytesOffset, result.geoPackage); bytesOffset = this.parseTexturePackage(unzipBuffer, view, bytesOffset, result.texturePackage); bytesOffset = this.parseMaterial(unzipBuffer, view, bytesOffset, result); return result; }; function _fillBMPHeader(buffer,width,height){ let extraBytes = width%4; let rgbSize = height * (4 * width + extraBytes); let headerInfoSize = 108; /******************header***********************/ let flag = "BM"; let reserved = 0; let offset_header = 122; let fileSize = rgbSize + offset; let planes = 1; let bitPP = 32; let compress = 3; let hr = 2835; let vr = 2835; let colors = 0; let importantColors = 0; let view = new DataView(buffer); let offset = 0; view.setUint16(offset, 0x4d42, true);offset += 2; view.setUint32(offset, fileSize, true);offset += 4; view.setUint32(offset, reserved, true);offset += 4; view.setUint32(offset, offset_header, true);offset += 4; view.setUint32(offset, headerInfoSize, true);offset += 4; view.setUint32(offset, width, true);offset += 4; view.setUint32(offset, height, true);offset += 4; view.setUint16(offset, planes, true);offset += 2; view.setUint16(offset, bitPP, true);offset += 2; view.setUint32(offset, this.compress, true);offset += 4; view.setUint32(offset, rgbSize, true);offset += 4; view.setUint32(offset, hr, true);offset += 4; view.setUint32(offset, vr, true);offset += 4; view.setUint8(offset, colors, true);offset += 4; view.setUint32(offset, importantColors, true);offset += 4; view.setUint32(offset, 0xff0000, true);offset += 4; view.setUint32(offset, 0xff00, true);offset += 4; view.setUint32(offset, 0xff, true);offset += 4; view.setUint32(offset, 0xff000000, true);offset += 4; view.setUint32(offset, 0x57696e20, true);offset += 4; }; S3MModelParser.prototype.generateGLTFBuffer = function( vertexCount, indicesArr, positionsArr, normalsArr, uv0sArr, colorsArr, texturePackage, geoMat, min, max, textureCodes, materialArr ) { return new Promise(function(resolve, reject) { (function(vertexCount, indicesArr, positionsArr, normalsArr, uv0sArr, colorsArr, texturePackage, geoMat, min, max, textureCodes, materialArr) { if( vertexCount === 0 || positionsArr === undefined || positionsArr.length === 0 ) { return { buffers: [], bufferViews: [], accessors: [], meshes: [], nodes: [], nodesInScene: [], }; } let buffers = []; let bufferViews = []; let accessors = []; let meshes = []; let nodes = []; let nodesInScene = []; let posIndex = 0; let normalIndex = 0; let uv0Index = 0; let colorIndex = 0; let indicesIndex = 0; let currentIndex = posIndex; for(let meshIndex = 0; meshIndex < positionsArr.length; meshIndex++) { let indices = indicesArr ? indicesArr[meshIndex] : undefined; let positions = positionsArr ? positionsArr[meshIndex] : undefined; let normals = normalsArr ? normalsArr[meshIndex] : undefined; let uv0s = uv0sArr ? uv0sArr[meshIndex] : undefined; let colors = colorsArr ? colorsArr[meshIndex] : undefined; // if we provide indices, then the vertex count is the length // of that array, otherwise we assume non-indexed triangle if(indices) { vertexCount = indices.length; } // allocate array let indexArray = new Uint32Array(vertexCount); if(indices) { // set the indices for(let vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) { indexArray[vertexIndex] = indices[vertexIndex]; } } else { // generate indices for(let vertexIndex = 0; vertexIndex < vertexCount; ++vertexIndex) { indexArray[vertexIndex] = vertexIndex; } } // push to the buffers, bufferViews and accessors let indicesBlob = new Blob([indexArray], { type: "application/binary" }); let indicesURL = URL.createObjectURL(indicesBlob); let endIndex = vertexCount; // POSITIONS let meshPositions = positions.subarray(0, endIndex * 3); let positionsBlob = new Blob([meshPositions], { type: "application/binary", }); let positionsURL = URL.createObjectURL(positionsBlob); // NORMALS let meshNormals = normals ? normals.subarray(0, endIndex * 3) : null; let normalsURL = null; if(meshNormals) { let normalsBlob = new Blob([meshNormals], { type: "application/binary", }); normalsURL = URL.createObjectURL(normalsBlob); } // UV0s let meshUv0s = uv0s ? uv0s.subarray(0, endIndex * 2) : null; let uv0URL = null; if(meshUv0s) { let uv0Blob = new Blob([meshUv0s], { type: "application/binary" }); uv0URL = URL.createObjectURL(uv0Blob); } // Colors // @TODO: check we can directly import vertex colors as bytes instead // of having to convert to float let meshColorsInBytes = colors ? colors.subarray(0, endIndex * 4) : null; let meshColors = null; let colorsURL = null; if(meshColorsInBytes) { let colorCount = meshColorsInBytes.length; meshColors = new Float32Array(colorCount); for(let i = 0; i < colorCount; ++i) { meshColors[i] = meshColorsInBytes[i] / 255.0; } let colorsBlob = new Blob([meshColors], { type: "application/binary" }); colorsURL = URL.createObjectURL(colorsBlob); } let attributes = {}; // POSITIONS attributes.POSITION = currentIndex; buffers.push({ uri: positionsURL, byteLength: meshPositions.byteLength, }); bufferViews.push({ buffer: currentIndex, byteOffset: 0, byteLength: meshPositions.byteLength, target: 34962, }); accessors.push({ bufferView: currentIndex, byteOffset: 0, componentType: 5126, count: vertexCount, type: "VEC3", max: max, min: min }); // NORMALS if(normalsURL) { ++currentIndex; normalIndex = currentIndex; attributes.NORMAL = normalIndex; buffers.push({ uri: normalsURL, byteLength: meshNormals.byteLength, }); bufferViews.push({ buffer: normalIndex, byteOffset: 0, byteLength: meshNormals.byteLength, target: 34962, }); accessors.push({ bufferView: normalIndex, byteOffset: 0, componentType: 5126, count: vertexCount, type: "VEC3", max: [0, 0, 0], min: [0, 0, 0], }); } // UV0 if(uv0URL) { ++currentIndex; uv0Index = currentIndex; attributes.TEXCOORD_0 = uv0Index; buffers.push({ uri: uv0URL, byteLength: meshUv0s.byteLength, }); bufferViews.push({ buffer: uv0Index, byteOffset: 0, byteLength: meshUv0s.byteLength, target: 34962, }); accessors.push({ bufferView: uv0Index, byteOffset: 0, componentType: 5126, count: vertexCount, type: "VEC2", max: [0, 0], min: [0, 0], }); } // COLORS if(colorsURL) { ++currentIndex; colorIndex = currentIndex; attributes.COLOR_0 = colorIndex; buffers.push({ uri: colorsURL, byteLength: meshColors.byteLength, }); bufferViews.push({ buffer: colorIndex, byteOffset: 0, byteLength: meshColors.byteLength, target: 34962, }); accessors.push({ bufferView: colorIndex, byteOffset: 0, componentType: 5126, count: vertexCount, type: "VEC4", max: [0, 0, 0, 0], min: [0, 0, 0, 0], }); } // INDICES ++currentIndex; indicesIndex = currentIndex; buffers.push({ uri: indicesURL, byteLength: indexArray.byteLength, }); bufferViews.push({ buffer: indicesIndex, byteOffset: 0, byteLength: indexArray.byteLength, target: 34963, }); accessors.push({ bufferView: indicesIndex, byteOffset: 0, componentType: 5125, count: vertexCount, type: "SCALAR", max: [0], min: [0], }); // create a new mesh for this page meshes.push({ primitives: [{ attributes: attributes, indices: indicesIndex, material: meshIndex, }, ], }); nodesInScene.push(meshIndex); nodes.push({ mesh: meshIndex, }); currentIndex++; } let gltfTextures = []; let gltfImages = []; let gltfSamplers = [{ magFilter: 9729, minFilter: 9729, wrapS: 10497, wrapT: 10497, }]; let gltfMaterials = new Array(textureCodes.length); let imageIndex = 0; let materialIndex = 0; let textureCount = 0; let blobs = []; let materialDefer = new Promise(function(subResolve, subReject) { for(let k = 0; k < materialArr.length; k++) { (function(k) { let hasTexture = materialArr[k].textureunitstates[0]; if(hasTexture) { textureCount++; let textureId = materialArr[k].textureunitstates[0].textureunitstate.id; let textureObj = texturePackage[textureId]; let imageBuffer = textureObj.imageBuffer; let imageTypedArray = null; let pixelFormat = textureObj.nFormat; let bmpHeaderLength = 122; if (pixelFormat > S3MPixelFormat.BGR || pixelFormat === S3MPixelFormat.LUMINANCE_ALPHA) { imageTypedArray = new Uint8Array(bmpHeaderLength + textureObj.width * textureObj.height * 4); } else { imageTypedArray = new Uint16Array(bmpHeaderLength / 2 + textureObj.width * textureObj.height); } DXTTextureDecode.decode(imageTypedArray.subarray(bmpHeaderLength), textureObj.width, textureObj.height, imageBuffer, pixelFormat); _fillBMPHeader(imageTypedArray.buffer, textureObj.width, textureObj.height); let bmpblob = new Blob([imageTypedArray],{type:"image/bmp"}); let textureURL = URL.createObjectURL(bmpblob); buffers.push({ uri: textureURL, byteLength: imageTypedArray.byteLength, }); bufferViews.push({ buffer: buffers.length - 1, byteOffset: 0, byteLength: imageTypedArray.byteLength, target: 34962, }); gltfImages.push({ "mimeType": "image/bmp", "bufferView": bufferViews.length - 1 }); gltfTextures.push({ sampler: 0, source: imageIndex++, }); blobs.push(bmpblob); if(blobs.length === textureCount) { // materialDefer.resolve(); subResolve(); } } gltfMaterials.push({ pbrMetallicRoughness: { metallicFactor: 0.0, baseColorTexture: hasTexture ? { index: materialIndex++, texCoord: 0 } : undefined }, doubleSided: true, name: textureId, }); })(k); } }); let rawGLTF = { scene: 0, scenes: [{ nodes: nodesInScene, }, ], nodes: nodes, meshes: meshes, buffers: buffers, bufferViews: bufferViews, accessors: accessors, materials: gltfMaterials, textures: gltfTextures, images: gltfImages, samplers: gltfSamplers, asset: { version: "2.0", }, }; if(textureCount === 0) { resolve(rawGLTF); } materialDefer.then(function() { resolve(rawGLTF); }); })(vertexCount, indicesArr, positionsArr, normalsArr, uv0sArr, colorsArr, texturePackage, geoMat, min, max, textureCodes, materialArr); }); }; S3MModelParser.prototype._binarizeGLTF = function(rawGLTF) { let encoder = new TextEncoder(); let rawGLTFData = encoder.encode(JSON.stringify(rawGLTF)); let binaryGLTFData = new Uint8Array(rawGLTFData.byteLength + 20); let binaryGLTF = { magic: new Uint8Array(binaryGLTFData.buffer, 0, 4), version: new Uint32Array(binaryGLTFData.buffer, 4, 1), length: new Uint32Array(binaryGLTFData.buffer, 8, 1), chunkLength: new Uint32Array(binaryGLTFData.buffer, 12, 1), chunkType: new Uint32Array(binaryGLTFData.buffer, 16, 1), chunkData: new Uint8Array( binaryGLTFData.buffer, 20, rawGLTFData.byteLength ), }; binaryGLTF.magic[0] = "g".charCodeAt(); binaryGLTF.magic[1] = "l".charCodeAt(); binaryGLTF.magic[2] = "T".charCodeAt(); binaryGLTF.magic[3] = "F".charCodeAt(); binaryGLTF.version[0] = 2; binaryGLTF.length[0] = binaryGLTFData.byteLength; binaryGLTF.chunkLength[0] = rawGLTFData.byteLength; binaryGLTF.chunkType[0] = 0x4e4f534a; // JSON binaryGLTF.chunkData.set(rawGLTFData); return binaryGLTFData; }; S3MModelParser.prototype._binarizeB3DM = function(featureTableJSON, batchTabelJSON, binaryGLTFData) { let encoder = new TextEncoder(); // Feature Table let featureTableOffset = 28; let featureTableJSONData = encoder.encode(featureTableJSON); let featureTableLength = featureTableJSONData.byteLength; // Batch Table let batchTableOffset = featureTableOffset + featureTableLength; let batchTableJSONData = encoder.encode(batchTabelJSON); // Calculate alignment buffer by padding the remainder of the batch table let paddingCount = (batchTableOffset + batchTableJSONData.byteLength) % 8; let batchTableLength = batchTableJSONData.byteLength + paddingCount; let paddingStart = batchTableJSONData.byteLength; let paddingStop = batchTableLength; // Binary GLTF let binaryGLTFOffset = batchTableOffset + batchTableLength; let binaryGLTFLength = binaryGLTFData.byteLength; let dataSize = featureTableLength + batchTableLength + binaryGLTFLength; let b3dmRawData = new Uint8Array(28 + dataSize); let b3dmData = { magic: new Uint8Array(b3dmRawData.buffer, 0, 4), version: new Uint32Array(b3dmRawData.buffer, 4, 1), byteLength: new Uint32Array(b3dmRawData.buffer, 8, 1), featureTableJSONByteLength: new Uint32Array(b3dmRawData.buffer, 12, 1), featureTableBinaryByteLength: new Uint32Array(b3dmRawData.buffer, 16, 1), batchTableJSONByteLength: new Uint32Array(b3dmRawData.buffer, 20, 1), batchTableBinaryByteLength: new Uint32Array(b3dmRawData.buffer, 24, 1), featureTable: new Uint8Array( b3dmRawData.buffer, featureTableOffset, featureTableLength ), batchTable: new Uint8Array( b3dmRawData.buffer, batchTableOffset, batchTableLength ), binaryGLTF: new Uint8Array( b3dmRawData.buffer, binaryGLTFOffset, binaryGLTFLength ), }; b3dmData.magic[0] = "b".charCodeAt(); b3dmData.magic[1] = "3".charCodeAt(); b3dmData.magic[2] = "d".charCodeAt(); b3dmData.magic[3] = "m".charCodeAt(); b3dmData.version[0] = 1; b3dmData.byteLength[0] = b3dmRawData.byteLength; b3dmData.featureTable.set(featureTableJSONData); b3dmData.featureTableJSONByteLength[0] = featureTableLength; b3dmData.featureTableBinaryByteLength[0] = 0; b3dmData.batchTable.set(batchTableJSONData); for(let index = paddingStart; index < paddingStop; ++index) { b3dmData.batchTable[index] = 0x20; } b3dmData.batchTableJSONByteLength[0] = batchTableLength; b3dmData.batchTableBinaryByteLength[0] = 0; b3dmData.binaryGLTF.set(binaryGLTFData); return b3dmRawData; }; let modelParser = new S3MModelParser(); onmessage = function (e) { let buffer = e.data.buffer; let bytesOffset = e.data.bytesOffset; let result = modelParser.parseBuffer(buffer, bytesOffset); let geoPackage = result.geoPackage; let pageLods = result.groupNode.pageLods; let verticesCount; let indices; let positionsArr = []; let positions_4; let positions; let indexArr = []; let uvArr = []; let colorArr = []; let materialArr = []; let totalVerticesCount = 0; let mat = pageLods[0].geodes[0].matrix; let textureCodes = []; let materialsMap = {} for(let i = 0; i < result.materials.material.length; i++) { materialsMap[result.materials.material[i].material.id] = result.materials.material[i].material; } let scratchCartesian = { x: 0, y: 0, z: 0 }; let indicesCount = 0; let minX = Number.MAX_VALUE, minY = Number.MAX_VALUE, minZ = Number.MAX_VALUE; let maxX = Number.MIN_VALUE, maxY = Number.MIN_VALUE, maxZ = Number.MIN_VALUE; for(let geoName in geoPackage) { let vertexPackage = geoPackage[geoName].vertexPackage; verticesCount = vertexPackage.verticesCount; let buffer = vertexPackage.vertexAttributes[0].typedArray.buffer; let componentsPerAttribute = vertexPackage.vertexAttributes[0].componentsPerAttribute; positions_4 = new Float32Array(buffer, vertexPackage.vertexAttributes[0].offsetInBytes, verticesCount * componentsPerAttribute); positions = new Float32Array(verticesCount * 3); for(let i = 0; i < verticesCount; i++) { let x = positions_4[i * componentsPerAttribute]; let y = positions_4[i * componentsPerAttribute + 1]; let z = positions_4[i * componentsPerAttribute + 2]; S3MModelParser.multiplyByPoint(mat, {x: x, y: y, z: z}, scratchCartesian); positions[i * 3] = scratchCartesian.x; positions[i * 3 + 1] = scratchCartesian.y; positions[i * 3 + 2] = scratchCartesian.z; minX = Math.min(minX, positions[i * 3]); minY = Math.min(minY, positions[i * 3 + 1]); minZ = Math.min(minZ, positions[i * 3 + 2]); maxX = Math.max(maxX, positions[i * 3]); maxY = Math.max(maxY, positions[i * 3 + 1]); maxZ = Math.max(maxZ, positions[i * 3 + 2]); } positionsArr.push(positions); let attrLocation = vertexPackage.attrLocation['aTexCoord0']; if(attrLocation) { let uvNum = vertexPackage.vertexAttributes[attrLocation].componentsPerAttribute; let uvsOri = new Float32Array(buffer, vertexPackage.vertexAttributes[attrLocation].offsetInBytes, verticesCount * uvNum ); let uvs = new Float32Array(verticesCount * 2); for(let i = 0; i < verticesCount; i++) { uvs[i * 2] = uvsOri[i * uvNum]; uvs[i * 2 + 1] = uvsOri[i * uvNum + 1]; } uvArr.push(uvs); } else { uvArr.push(undefined); } indices = new Uint16Array(result.buffer, geoPackage[geoName].arrIndexPackage[0].bytesOffset, geoPackage[geoName].arrIndexPackage[0].byteLength / 2); indexArr.push(indices); indicesCount += indices.length; totalVerticesCount += verticesCount; let materialCode = geoPackage[geoName].arrIndexPackage[0].materialCode; materialArr.push(materialsMap[materialCode]); } let min = [minX, minY, minZ]; let max = [maxX, maxY, maxZ]; let rawGLTFPromise = modelParser.generateGLTFBuffer(totalVerticesCount, indexArr, positionsArr, null, uvArr, null, result.texturePackage, mat, min, max, textureCodes, materialArr); rawGLTFPromise.then(function(rawGLTF) { let binaryGLTFData = modelParser._binarizeGLTF(rawGLTF); let featureTableJSON = JSON.stringify({ BATCH_LENGTH: 0 }); let batchTableJSON = JSON.stringify({}); let b3dmBuffer = modelParser._binarizeB3DM( featureTableJSON, batchTableJSON, binaryGLTFData ); postMessage({ b3dmBuffer: b3dmBuffer, pageLods: pageLods }); }); }; `;function gZe(o){this._ownerTile=o,this._dataSource=o._tileset._s3mDataSource,this._ready=!1,this._relativePath="",o._depth<=1?this._relativePath=o._header.content.uri.substring(0,o._header.content.uri.lastIndexOf("/")+1):this._relativePath=o.parent._s3mTile._relativePath}function Qni(o){return function(){return o.priority}}gZe.prototype.requestContent=function(){let o=this._ownerTile,f=o._tileset._baseResource,m=o._header.content.uri,v="./data/path/"+m;if(m===""){o._contentState=ud.UNLOADED,this._ready=!0,o._content=new uj(o.tileset,o),o.hasEmptyContent=!0;return}let y=f.getDerivedResource({url:v}),x=new cg({throttle:!0,throttleByServer:!0,type:Qy.TILES3D,priorityFunction:Qni(o),serverKey:o._serverKey});o._request=x,y.request=x;let C=y.fetchArrayBuffer();if(!N(C))return!1;o._contentState=ud.LOADING;let w=this;return C.then(function(A){w._dataSource._GLTFProcessingQueue.addTask(A).then(function(E){let T=E.gltfData,S=new Blob([T],{type:"application/binary"});o._pageLods=E.pageLods,o._contentResource._url=URL.createObjectURL(S),o._contentState=ud.UNLOADED,w._ready=!0,o._resolveHookedObject()})}).catch(function(A){o._contentState=ud.UNLOADED}),!1};xC.prototype._resolveHookedObject=function(){let o=this._contentReadyToProcessPromise,f=this._contentReadyPromise;this._S3MhookedRequestContent(),o&&this._contentReadyToProcessPromise.then(()=>{o.resolve()}),f&&this._contentReadyPromise.then(()=>{this._isLoading=!1,this._content._contentReadyPromise.resolve()})};xC.prototype._S3MhookedRequestContent=xC.prototype.requestContent;xC.prototype.requestContent=function(){if(!this.tileset._isS3MTileSet)return this._S3MhookedRequestContent();N(this._s3mTile)||(this._s3mTile=new gZe(this),this._contentReadyToProcessPromise=Promise.resolve(!0),this._contentReadyPromise=Promise.resolve(!0)),this._s3mTile.requestContent()};function Gne(){this._queue=[],this._processing=!1,this._createWorkers(()=>{this._process()})}Gne.prototype._process=function(){for(let o of this._workers)o.isReadyToWork&&this._queue.length>0&&this._queue.shift().execute(o);setTimeout(()=>{this._process()},100)};Gne.prototype._createWorkers=function(o){let f=Kni,m=[],v="",y=[];for(let w=0;w{A=T});y.push(E),fetch(m[w]).then(T=>{T.text().then(S=>{v+=S,A()})})}let x=Promise.all(y),C=this;x.then(function(){let w=new Blob([v+f],{type:"test/javascript"}),A=1;C._workers=[];for(let E=0;E=2){let O=D.getUint32(I,!0);I+=Uint32Array.BYTES_PER_ELEMENT}let L=D.getUint32(I,!0);I+=Uint32Array.BYTES_PER_ELEMENT;let R=Jni(M,I);T.postMessage({buffer:R,bytesOffset:I})},T.onmessage=function(S){let M=T._task,I=S.data.b3dmBuffer,P=S.data.pageLods;T._task=null,T.isReadyToWork=!0,M.resolve({gltfData:I,pageLods:P})},T.isReadyToWork=!0,C._workers.push(T)})();o()})};Gne.prototype.addTask=function(o){let f={_data:o,execute:function(m){m.setTask(this)}};return new Promise((m,v)=>{f.resolve=m,f.reject=v,this._queue.push(f)})};var _Ze=mZe,pVe=new Wt;function Zni(o,f,m){let v=o.length,y,x,C;if(m){y=Nn.LUMINANCE,x=Rn.FLOAT,C=new Float32Array(v);for(let w=0;w distanceLimit ? 0.0: 1.0; vec3 vl = normalize(positionEC - spotPosition.xyz); float theta = dot(spotDirection, vl); float epsilon = cutOff - outerCutOff; float factor = clamp((theta - outerCutOff) / epsilon, 0.0, 1.0); sumSpotColor += vec3(colorX * factor * distanceFactor, colorY * factor * distanceFactor, colorZ * factor * distanceFactor); //float distance = length(positionEC - spotPosition.xyz); //attenuation += 1.0 / (constant + distance * linear + distance * distance * quadratic); } attenuation = 1.0; diffuse = diffuse * sumSpotColor * attenuation; color = color * u_backgroundBrightness + diffuse; return color; }`,uniforms:{u_spotmodelViewMatrix:fte,u_spotPointTexture:"123",u_backgroundBrightness:v}},translucent:!1});return y._textures.u_spotPointTexture=o,y.uniforms.u_spotPointTextureDimensions.x=f.length,y.uniforms.u_spotPointTextureDimensions.y=1,y}var eoi=new Ee;function vZe(o,f,m,v,y){return new Kw({lightingModel:y,uniforms:{u_spotPointTextureDimensions:{type:Ra.INT_VEC2,value:new Ye(f.length,1)},u_spotPointTexture:{type:Ra.SAMPLER_2D,value:o},u_spotmodelViewMatrix:{type:Ra.MAT4,value:eoi},u_backgroundBrightness:{type:Ra.FLOAT,value:v}},fragmentShaderText:` #define Spot_Texture_Width ${f.length} ${m?"#define use_texture_float":""} float getPointComponent(int idx, float invTexSize) { vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); #ifdef use_texture_float return texture(u_spotPointTexture, uv).x; #else return czm_unpackFloat(texture(u_spotPointTexture, uv)); #endif } void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { if(u_spotPointTextureDimensions.x == 1) { material.diffuse *= 1.0; } vec3 diffuse = material.diffuse; vec3 positionEC = fsInput.attributes.positionEC.xyz; float constant = 1.0; float linear = 0.022; float quadratic = 0.0019; float attenuation = 0.0; vec3 sumSpotColor = vec3(0.0); float invTexSize = 1.0 / float(u_spotPointTextureDimensions.x); for(int idx = 0; idx distanceLimit ? 0.0: 1.0; vec3 vl = normalize(positionEC - spotPosition.xyz); float theta = dot(spotDirection, vl); float epsilon = cutOff - outerCutOff; float factor = clamp((theta - outerCutOff) / epsilon, 0.0, 1.0); sumSpotColor += vec3(colorX * factor * distanceFactor, colorY * factor * distanceFactor, colorZ * factor * distanceFactor); //float distance = length(positionEC - spotPosition.xyz); //attenuation += 1.0 / (constant + distance * linear + distance * distance * quadratic); } attenuation = 1.0; diffuse = diffuse * sumSpotColor * attenuation; material.diffuse = material.diffuse * u_backgroundBrightness + diffuse; }`})}function toi(o,f,m,v,y,x,C){let w=$ni(f,m,x,C);o.spotMaterial=w,v.preUpdate.addEventListener(function(){let A=v.camera.viewMatrix,E=new Ee;Ee.multiply(A,y,E),Ee.toArray(E,fte),w&&(w.uniforms.u_spotmodelViewMatrix=fte)})}function ioi(o,f,m,v,y,x,C,w){let A=vZe(f,m,x,C,w);o.customShader=A,v.preUpdate.addEventListener(function(){let E=v.camera.viewMatrix,T=new Ee;Ee.multiply(E,y,T),A.setUniform("u_spotmodelViewMatrix",T)})}function roi(o,f,m,v,y,x,C){let w=vZe(f,m,x,C);o.customShader=w,v.preUpdate.addEventListener(function(){let A=v.camera.viewMatrix,E=new Ee;Ee.multiply(A,y,E),w.setUniform("u_spotmodelViewMatrix",E)})}function Wne(o,f={},m=[]){N(o)&&(this._viewer=o,this._texture=void 0,!(!N(f)&&!(N(f.globe)&&N(f.tileset)&&N(f.gltf)))&&this.initialize(o,f,m))}Wne.prototype.reSet=function(o={},f=[]){this._texture&&(this._texture.destroy(),this._texture=void 0),this.initialize(this._viewer,o,f)};Wne.prototype.destroy=function(o){!N(o)&&!(N(o.globe)&&N(o.tileset)&&N(o.gltf))||(N(o.globe)&&o.globe.spotMaterial&&(o.globe.spotMaterial=void 0),N(o.tileset)&&o.tileset.customShader&&(o.tileset.customShader=null),N(o.gltf)&&o.gltf.customShader&&(o.gltf.customShader=null),this._texture&&(this._texture.destroy(),this._texture=void 0))};Wne.prototype.initialize=function(o,f,m){if(!N(f)&&!(N(f.globe)&&N(f.tileset)&&N(f.gltf)))return;let v=Z(f.globeBrightness,.2),y=Z(f.gltfBrightness,.2),x=Z(f.tilesetBrightness,.2),C=Z(f.gltfLightModel,pC.PBR),w=Z(f.tilesetLightModel,pC.PBR);if(!Array.isArray(m)||m.length===0)return;let A=o.scene,E=tn.eastNorthUpToFixedFrame(m[0].position),T=new Ee;Ee.inverseTransformation(E,T);let S=[],M=new H;for(let D=0;D0?f._subdomains=f._subdomains.split(""):f._subdomains=["a","b","c"],f._tileWidth=Z(m.tileWidth,256),f._tileHeight=Z(m.tileHeight,256),f._minimumLevel=Z(m.minimumLevel,0),f._maximumLevel=m.maximumLevel,f._tilingScheme=Z(m.tilingScheme,new Mm({ellipsoid:m.ellipsoid})),f._rectangle=Z(m.rectangle,f._tilingScheme.rectangle),f._rectangle=Di.intersection(f._rectangle,f._tilingScheme.rectangle),f._hasAlphaChannel=Z(m.hasAlphaChannel,!0);let A=m.credit;return typeof A=="string"&&(A=new Cs(A)),f._credit=A,f._resource=C,f._tags=y,f._pickFeaturesResource=w,f._pickFeaturesTags=x,!0})};BB.prototype.getTileCredits=function(o,f,m){};BB.prototype.requestImage=function(o,f,m,v){let y=ooi(this,o,f,m,v),x=Q2.loadImage(this,y);return typeof this.loadtitle=="function"&&this.loadtitle(y),x};BB.prototype.loadtitle=function(o){};BB.prototype.pickFeatures=function(o,f,m,v,y){if(!this.enablePickFeatures||!N(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let x=0,C=this;function w(E,T){return E.callback(T)}function A(){if(x>=C._getFeatureInfoFormats.length)return Promise.resolve([]);let E=C._getFeatureInfoFormats[x],T=aoi(C,o,f,m,v,y,E.format);return++x,E.type==="json"?T.fetchJson().then(E.callback).otherwise(A):E.type==="xml"?T.fetchXML().then(E.callback).otherwise(A):E.type==="text"||E.type==="html"?T.fetchText().then(E.callback).otherwise(A):T.fetch({responseType:E.format}).then(w.bind(void 0,E)).otherwise(A)}return A()};var pte=!1,w1=new Di,mte=!1,vq=new Di;function ooi(o,f,m,v,y){pte=!1,mte=!1;let x=o._resource,C=x.getUrlComponent(!0),w=o._tags,A={},E=C.match(xZe);return N(E)&&E.forEach(function(T){let S=T.substring(1,T.length-1);N(w[S])&&(A[S]=w[S](o,f,m,v))}),x.getDerivedResource({request:y,templateValues:A})}var _ge=!1,LH=new Ye,vge=!1;function aoi(o,f,m,v,y,x,C){pte=!1,mte=!1,_ge=!1,vge=!1;let w=o._pickFeaturesResource,A=w.getUrlComponent(!0),E=o._pickFeaturesTags,T={},S=A.match(xZe);return N(S)&&S.forEach(function(M){let I=M.substring(1,M.length-1);N(E[I])&&(T[I]=E[I](o,f,m,v,y,x,C))}),w.getDerivedResource({templateValues:T})}function a6(o,f,m){if(o&&o.urlSchemeZeroPadding&&o.urlSchemeZeroPadding.hasOwnProperty(f)){let v=o.urlSchemeZeroPadding[f];if(typeof v=="string"){let y=v.length;y>1&&(m=m.length>=y?m:new Array(y-m.toString().length+1).join("0")+m)}}return m}function soi(o,f,m,v){return a6(o,"{x}",f)}function loi(o,f,m,v){let y=o.tilingScheme.getNumberOfXTilesAtLevel(v)-f-1;return a6(o,"{reverseX}",y)}function uoi(o,f,m,v){return a6(o,"{y}",m)}function coi(o,f,m,v){let y=o.tilingScheme.getNumberOfYTilesAtLevel(v)-m-1;return a6(o,"{reverseY}",y)}function hoi(o,f,m,v){let y=o.maximumLevel,x=N(y)&&v= shadowMap_lightPositionEC.w) { discard; } distance /= shadowMap_lightPositionEC.w; // radius out_FragColor = czm_packDepth(distance); `:m?E+=` out_FragColor = vec4(1.0); `:E+=` out_FragColor = czm_packDepth(gl_FragCoord.z); `,E+=`} `,x.push(E),new Zr({defines:y,sources:x})};kB.getShadowReceiveShaderKeyword=function(o,f,m,v){let y=o._usesDepthTexture,x=o._polygonOffsetSupported,C=o._isPointLight,w=o._isSpotLight,A=o._numberOfCascades>1,E=o.debugCascadeColors,T=o.softShadows;return`receiveViewShed ${y}${x}${C}${w}${A}${E}${T}${f}${m}${v}`};kB.createShadowReceiveVertexShader=function(o,f,m){let v=o.defines.slice(0),y=o.sources.slice(0);return v.push("SHADOW_MAP"),f&&(m?v.push("GENERATE_POSITION_AND_NORMAL"):v.push("GENERATE_POSITION")),new Zr({defines:v,sources:y})};kB.createShadowReceiveFragmentShader=function(o,f,m,v,y){let x=Zr.findNormalVarying(o),C=!v&&N(x)||v&&y,w=Zr.findPositionVarying(o),A=N(w),E=f._usesDepthTexture,T=f._polygonOffsetSupported,S=f._isPointLight,M=f._isSpotLight,I=f._numberOfCascades>1,P=f.debugCascadeColors,D=f.softShadows,L=S?f._pointBias:v?f._terrainBias:f._primitiveBias,R=o.defines.slice(0),O=o.sources.slice(0),F=O.length;for(let G=0;G0&&R.push("USE_NORMAL_SHADING_SMOOTH"));let k="";S?k+=`uniform samplerCube shadowMap_textureCube; `:k+=`uniform sampler2D shadowMap_texture; `;let U;return A?U=` return vec4(${w}, 1.0); `:U=`#ifndef LOG_DEPTH return czm_windowToEyeCoordinates(gl_FragCoord); #else return vec4(v_logPositionEC, 1.0); #endif `,k+=`uniform mat4 shadowMap_matrix; uniform vec3 shadowMap_lightDirectionEC; uniform vec4 shadowMap_lightPositionEC; uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; uniform mat4 camera_projection_matrix; uniform mat4 camera_view_matrix; uniform float far; uniform vec4 u_visibleColor; uniform vec4 u_invisibleColor; #ifdef LOG_DEPTH in vec3 v_logPositionEC; #endif vec4 getPositionEC() { ${U}} vec3 getNormalEC() { ${C?` return normalize(${x}); `:` return vec3(1.0); `} return vec3(1.0); } void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) { ${L.normalOffset&&C?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; float normalOffsetScale = 1.0 - nDotL; vec3 offset = normalOffset * normalOffsetScale * normalEC; positionEC.xyz += offset; `:""}} `,k+=` bool visible(in vec4 result) { result.x/=result.w; result.y/=result.w; result.z/=result.w; return result.x>=-1.&&result.x<=1.&&result.y>=-1.&&result.y<=1.&&result.z>=-1.&&result.z<=1.; } `,k+=`void main() { czm_shadow_receive_main(); vec4 positionEC = getPositionEC(); vec4 wordPos = czm_inverseView * positionEC; vec4 vcPos = camera_view_matrix * wordPos; vec3 normalEC = getNormalEC(); float depth = -positionEC.z; `,k+=` czm_shadowParameters shadowParameters; shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; `,v?k+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); `:T||(k+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); `),S?k+=` vec4 posInEye = camera_projection_matrix * vcPos; if(!visible(posInEye)) { return; } vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; float distance = length(directionEC); directionEC = normalize(directionEC); float radius = shadowMap_lightPositionEC.w; // Stop early if the fragment is beyond the point light radius if (distance > radius) { return; } vec3 directionWC = czm_inverseViewRotation * directionEC; shadowParameters.depth = distance / radius - 0.0003; shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); shadowParameters.texCoords = directionWC; float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); `:M?k+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); vec4 shadowPosition = shadowMap_matrix * positionEC; // Spot light uses a perspective projection, so perform the perspective divide shadowPosition /= shadowPosition.w; // Stop early if the fragment is not in the shadow bounds if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { return; } shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `:I?k+=` float maxDepth = shadowMap_cascadeSplits[1].w; // Stop early if the eye depth exceeds the last cascade if (depth > maxDepth) { return; } // Get the cascade based on the eye-space depth vec4 weights = czm_cascadeWeights(depth); // Apply normal offset float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); // Transform position into the cascade vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; // Get visibility shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); // Fade out shadows that are far away float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); visibility = mix(visibility, 1.0, fade); ${P?` // Draw cascade colors for debugging out_FragColor *= czm_cascadeColor(weights); `:""}`:k+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); vec4 shadowPosition = shadowMap_matrix * positionEC; // Stop early if the fragment is not in the shadow bounds if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { return; } shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,k+=` if(visibility > 0.3){ out_FragColor = mix(out_FragColor, u_visibleColor, .5); } else { out_FragColor = mix(out_FragColor, u_invisibleColor, .5); } } `,O.push(k),new Zr({defines:R,sources:O})};var h3=kB;function lP(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.context;this._enabled=Z(o.enabled,!0),this._softShadows=Z(o.softShadows,!1),this._normalOffset=Z(o.normalOffset,!0),this.dirty=!0,this.fromLightSource=Z(o.fromLightSource,!0),this.darkness=Z(o.darkness,.3),this._darkness=this.darkness,this.maximumDistance=Z(o.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let m=!0;(pa.isInternetExplorer()||pa.isEdge()||(pa.isChrome()||pa.isFirefox())&&pa.isWindows()&&!f.depthTexture)&&(m=!1),this._polygonOffsetSupported=m,this._terrainBias={polygonOffset:m,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:m,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Ee,this._shadowMapTexture=void 0,this._lightDirectionEC=new H,this._lightPositionEC=new Wt,this._distance=0,this._lightCamera=o.lightCamera,this._shadowMapCamera=new Xne,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new Pi,this._isPointLight=Z(o.isPointLight,!1),this._pointLightRadius=Z(o.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:Z(o.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?Z(o.numberOfCascades,4):0,this._fitNearFar=!1,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Ye,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pm:N(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Wt,new Wt],this._cascadeMatrices=[new Ee,new Ee,new Ee,new Ee],this._cascadeDistances=new Wt;let v;this._isPointLight?v=6:this._cascadesEnabled?v=this._numberOfCascades:v=1,this._passes=new Array(v);for(let y=0;y=f?f:Bo.maximumCubeMapSize,y.x=f,y.y=f;let x=new Xr(0,0,f,f);m[0].passState.viewport=x,m[1].passState.viewport=x,m[2].passState.viewport=x,m[3].passState.viewport=x,m[4].passState.viewport=x,m[5].passState.viewport=x}else v===1?(f=Bo.maximumTextureSize>=f?f:Bo.maximumTextureSize,y.x=f,y.y=f,m[0].passState.viewport=new Xr(0,0,f,f)):v===4&&(f=Bo.maximumTextureSize>=f*2?f:Bo.maximumTextureSize/2,y.x=f*2,y.y=f*2,m[0].passState.viewport=new Xr(0,0,f,f),m[1].passState.viewport=new Xr(f,0,f,f),m[2].passState.viewport=new Xr(0,f,f,f),m[3].passState.viewport=new Xr(f,f,f,f));o._clearPassState.viewport=new Xr(0,0,y.x,y.y);for(let x=0;x=o.maximumDistance){o._outOfView=!0,o._needsUpdate=!1;return}let x=f.mapProjection.ellipsoid.geodeticSurfaceNormal(m.positionWC,lai),C=H.negate(v.directionWC,uai),w=H.dot(x,C),A=xe.clamp(w/.1,0,1);if(o._darkness=xe.lerp(1,o.darkness,A),w<0){o._outOfView=!0,o._needsUpdate=!1;return}o._needsUpdate=!0,o._outOfView=!1}else if(o._isPointLight)y.center=v.positionWC,y.radius=o._pointLightRadius,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere);else{let x=v.frustum.far/2,C=H.add(v.positionWC,H.multiplyByScalar(v.directionWC,x,gVe),gVe);y.center=C,y.radius=x,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere)}}function hai(o,f){let m=f.camera,v=o._lightCamera,y=o._sceneCamera,x=o._shadowMapCamera;o._cascadesEnabled?H.clone(v.directionWC,x.directionWC):o._isPointLight?H.clone(v.positionWC,x.positionWC):x.clone(v);let C=o._lightDirectionEC;Ee.multiplyByPointAsVector(m.viewMatrix,x.directionWC,C),H.normalize(C,C),H.negate(C,C),Ee.multiplyByPoint(m.viewMatrix,x.positionWC,o._lightPositionEC),o._lightPositionEC.w=o._pointLightRadius;let w,A;o._fitNearFar?(w=Math.min(f.viewShedState.nearPlane,o.maximumDistance),A=Math.min(f.viewShedState.farPlane,o.maximumDistance+1)):(w=m.frustum.near,A=o.maximumDistance),o._sceneCamera=Vl.clone(m,y),m.frustum.clone(o._sceneCamera.frustum),o._sceneCamera.frustum.near=w,o._sceneCamera.frustum.far=A,o._distance=A-w,cai(o,f),!o._outOfViewPrevious&&o._outOfView&&(o._needsUpdate=!0),o._outOfViewPrevious=o._outOfView}lP.prototype.update=function(o){if(hai(this,o),this._needsUpdate)if(zoi(this,o.context),this._isPointLight&&sai(this,o),this._cascadesEnabled&&(rai(this,o),this._numberOfCascades>1&&$oi(this,o)),this._isPointLight)this._shadowMapCullingVolume=hg.fromBoundingSphere(this._boundingSphere);else{let f=this._shadowMapCamera,m=f.positionWC,v=f.directionWC,y=f.upWC;this._shadowMapCullingVolume=f.frustum.computeCullingVolume(m,v,y),this._passes.length===1&&this._passes[0].camera.clone(f)}if(this._passes.length===1){let f=this._sceneCamera.inverseViewMatrix;Ee.multiply(this._shadowMapCamera.getViewProjection(),f,this._shadowMapMatrix)}this.debugShow&&Xoi(this,o)};lP.prototype.updatePass=function(o,f){AZe(this,o,f)};var dai=new Ye;function PZe(o,f,m){let v=o._isPointLight?o._pointBias:m?o._terrainBias:o._primitiveBias,y={shadowMap_texture:function(){return o._shadowMapTexture},shadowMap_textureCube:function(){return o._shadowMapTexture},shadowMap_matrix:function(){return o._shadowMapMatrix},shadowMap_cascadeSplits:function(){return o._cascadeSplits},shadowMap_cascadeMatrices:function(){return o._cascadeMatrices},shadowMap_lightDirectionEC:function(){return o._lightDirectionEC},shadowMap_lightPositionEC:function(){return o._lightPositionEC},shadowMap_cascadeDistances:function(){return o._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let x=dai;return x.x=1/o._textureSize.x,x.y=1/o._textureSize.y,Wt.fromElements(x.x,x.y,v.depthBias,v.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Wt.fromElements(v.normalOffsetScale,o._distance,o.maximumDistance,o._darkness,this.combinedUniforms2)},camera_projection_matrix:function(){return o._lightCamera.frustum.projectionMatrix},camera_view_matrix:function(){return o._lightCamera.viewMatrix},far:function(){return o._pointLightRadius},u_visibleColor:function(){return o.visibleColor},u_invisibleColor:function(){return o.invisibleColor},combinedUniforms1:new Wt,combinedUniforms2:new Wt};return va(f,y,!1)}function fai(o,f,m,v,y,x){let C,w,A;if(N(x)&&(C=x.shaderProgram,w=x.renderState,A=x.uniformMap),x=Jn.shallowClone(m,x),x.castShadows=!0,x.receiveShadows=!1,!N(C)||y!==m.shaderProgram.id||f){let E=m.shaderProgram,T=m.pass===vr.GLOBE,S=m.pass!==vr.TRANSLUCENT,M=o._isPointLight,I=o._usesDepthTexture,P=h3.getShadowCastShaderKeyword(M,T,I,S);if(C=v.shaderCache.getDerivedShaderProgram(E,P),!N(C)){let D=E.vertexShaderSource,L=E.fragmentShaderSource,R=h3.createShadowCastVertexShader(D,M,T),O=h3.createShadowCastFragmentShader(L,M,I,S);C=v.shaderCache.createDerivedShaderProgram(E,P,{vertexShaderSource:R,fragmentShaderSource:O,attributeLocations:E._attributeLocations})}w=o._primitiveRenderState,M?w=o._pointRenderState:T&&(w=o._terrainRenderState),m.renderState.cull.enabled||(w=uo(w,!1),w.cull=uo(w.cull,!1),w.cull.enabled=!1,w=Mn.fromCache(w)),A=PZe(o,m.uniformMap,T)}return x.shaderProgram=C,x.renderState=w,x.uniformMap=A,x}lP.createReceiveDerivedCommand=function(o,f,m,v,y){N(y)||(y={});let x=o.length>0,C=f.shaderProgram,w=C.vertexShaderSource,A=C.fragmentShaderSource,E=f.pass===vr.GLOBE,T=!1;if(E&&(T=f.owner.data.renderedMesh.encoding.hasVertexNormals),f.receiveShadows&&x){let S,M;N(y.receiveCommand)&&(S=y.receiveCommand.shaderProgram,M=y.receiveCommand.uniformMap),y.receiveCommand=Jn.shallowClone(f,y.receiveCommand),y.castShadows=!1,y.receiveShadows=!0;let I=y.receiveShaderCastShadows!==f.castShadows,P=y.receiveShaderProgramId!==f.shaderProgram.id;if(!N(S)||P||m||I){let D=h3.getShadowReceiveShaderKeyword(o[0],f.castShadows,E,T);if(S=v.shaderCache.getDerivedShaderProgram(C,D),!N(S)){let L=h3.createShadowReceiveVertexShader(w,E,T),R=h3.createShadowReceiveFragmentShader(A,o[0],f.castShadows,E,T);S=v.shaderCache.createDerivedShaderProgram(C,D,{vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:C._attributeLocations})}M=PZe(o[0],f.uniformMap,E)}y.receiveCommand.shaderProgram=S,y.receiveCommand.uniformMap=M,y.receiveShaderProgramId=f.shaderProgram.id,y.receiveShaderCastShadows=f.castShadows}return y};lP.createCastDerivedCommand=function(o,f,m,v,y){if(N(y)||(y={}),f.castShadows){let x=y.castCommands;N(x)||(x=y.castCommands=[]);let C=y.castShaderProgramId,w=o.length;x.length=w;for(let A=0;A-1&&v.derivedKeywords.splice(C,1)}return this.createDerivedShaderProgram(o,f,m)};_T.prototype.getDerivedShaderProgram=function(o,f){let m=o._cachedShader,v=f+m.keyword,y=this._shaders[v];if(N(y))return y.shaderProgram};_T.prototype.createDerivedShaderProgram=function(o,f,m){let v=o._cachedShader,y=f+v.keyword,x=m.vertexShaderSource,C=m.fragmentShaderSource,w=m.attributeLocations;typeof x=="string"&&(x=new Zr({sources:[x]})),typeof C=="string"&&(C=new Zr({sources:[C]}));let A=this._context,E=x.createCombinedVertexShader(A),T=C.createCombinedFragmentShader(A),S=new Rs({gl:A._gl,logShaderCompilation:A.logShaderCompilation,debugShaders:A.debugShaders,vertexShaderSource:x,vertexShaderText:E,fragmentShaderSource:C,fragmentShaderText:T,attributeLocations:w}),M={cache:this,shaderProgram:S,keyword:y,derivedKeywords:[],count:0};return v.derivedKeywords.push(f),S._cachedShader=M,this._shaders[y]=M,S};function PAe(o,f){let m=f.derivedKeywords,v=m.length;for(let y=0;ySai;++x){y=v;let C=y-f*Math.sin(y)-o,w=1-f*Math.cos(y);v=y-C/w}return y=v+m*xe.TWO_PI,y}function Iai(o,f){let m=Math.floor(o/xe.TWO_PI);o-=m*xe.TWO_PI;let v=Math.cos(o)-f,y=Math.sin(o)*Math.sqrt(1-f*f),x=Math.atan2(y,v);return x=xe.zeroToTwoPi(x),o<0&&(x-=xe.TWO_PI),x+=m*xe.TWO_PI,x}function Mai(o,f,m,v){let y=Math.cos(o),x=Math.sin(o),C=Math.cos(f),w=Math.sin(f),A=Math.cos(m),E=Math.sin(m);return N(v)?(v[0]=A*y-E*x*C,v[1]=E*y+A*x*C,v[2]=x*w,v[3]=-A*x-E*y*C,v[4]=-E*x+A*y*C,v[5]=y*w,v[6]=E*w,v[7]=-A*w,v[8]=C):v=new Ut(A*y-E*x*C,-A*x-E*y*C,E*w,E*y+A*x*C,-E*x+A*y*C,-A*w,x*w,y*w,C),v}var Dai=1.0000010178*P_,Lai=100.46645683*uw,Rai=129597742283429e-5*A1,vVe=16002,yVe=21863,xVe=32004,CVe=10931,bVe=14529,wVe=16368,AVe=15318,EVe=32794,Oai=64*1e-7*P_,Nai=-152*1e-7*P_,Fai=62*1e-7*P_,Bai=-8*1e-7*P_,kai=32*1e-7*P_,Vai=-41*1e-7*P_,zai=19*1e-7*P_,Hai=-11*1e-7*P_,Uai=-150*1e-7*P_,Gai=-46*1e-7*P_,Wai=68*1e-7*P_,jai=54*1e-7*P_,Yai=14*1e-7*P_,qai=24*1e-7*P_,Xai=-28*1e-7*P_,Jai=22*1e-7*P_,TVe=10,SVe=16002,PVe=21863,IVe=10931,MVe=1473,DVe=32004,LVe=4387,RVe=73,Kai=-325*1e-7,Qai=-322*1e-7,Zai=-79*1e-7,$ai=232*1e-7,esi=-52*1e-7,tsi=97*1e-7,isi=55*1e-7,rsi=-41*1e-7,nsi=-105*1e-7,osi=-137*1e-7,asi=258*1e-7,ssi=35*1e-7,lsi=-116*1e-7,usi=-88*1e-7,csi=-112*1e-7,hsi=-80*1e-7,Gz=new ci(0,0,gu.TAI);function dsi(o,f){MZe(o,Gz);let m=(Gz.dayNumber-gte.dayNumber+(Gz.secondsOfDay-gte.secondsOfDay)/lc.SECONDS_PER_DAY)/(lc.DAYS_PER_JULIAN_CENTURY*10),v=.3595362*m,y=Dai+Oai*Math.cos(vVe*v)+Uai*Math.sin(vVe*v)+Nai*Math.cos(yVe*v)+Gai*Math.sin(yVe*v)+Fai*Math.cos(xVe*v)+Wai*Math.sin(xVe*v)+Bai*Math.cos(CVe*v)+jai*Math.sin(CVe*v)+kai*Math.cos(bVe*v)+Yai*Math.sin(bVe*v)+Vai*Math.cos(wVe*v)+qai*Math.sin(wVe*v)+zai*Math.cos(AVe*v)+Xai*Math.sin(AVe*v)+Hai*Math.cos(EVe*v)+Jai*Math.sin(EVe*v),x=Lai+Rai*m+Kai*Math.cos(TVe*v)+nsi*Math.sin(TVe*v)+Qai*Math.cos(SVe*v)+osi*Math.sin(SVe*v)+Zai*Math.cos(PVe*v)+asi*Math.sin(PVe*v)+$ai*Math.cos(IVe*v)+ssi*Math.sin(IVe*v)+esi*Math.cos(MVe*v)+lsi*Math.sin(MVe*v)+tsi*Math.cos(DVe*v)+usi*Math.sin(DVe*v)+isi*Math.cos(LVe*v)+csi*Math.sin(LVe*v)+rsi*Math.cos(RVe*v)+hsi*Math.sin(RVe*v),C=.0167086342-.0004203654*m,w=102.93734808*uw+11612.3529*A1*m,A=469.97289*A1*m,E=174.87317577*uw-8679.27034*A1*m;return DZe(y,C,A,w,E,x,f)}function LZe(o,f){MZe(o,Gz);let m=(Gz.dayNumber-gte.dayNumber+(Gz.secondsOfDay-gte.secondsOfDay)/lc.SECONDS_PER_DAY)/lc.DAYS_PER_JULIAN_CENTURY,v=m*m,y=v*m,x=y*m,C=383397.7725+.004*m,w=.055545526-16e-9*m,A=5.15668983*uw,E=-8e-5*m+.02966*v-42e-6*y-13e-8*x,T=83.35324312*uw,S=146434202669e-4*m-38.2702*v-.045047*y+21301e-8*x,M=125.04455501*uw,I=-69679193631e-4*m+6.3602*v+.007625*y-3586e-8*x,P=218.31664563*uw,D=17325593434847e-4*m-6.391*v+.006588*y-3169e-8*x,L=297.85019547*uw+A1*(1602961601209e-3*m-6.3706*v+.006593*y-3169e-8*x),R=93.27209062*uw+A1*(17395272628478e-4*m-12.7512*v-.001037*y+417e-8*x),O=134.96340251*uw+A1*(17179159232178e-4*m+31.8792*v+.051635*y-2447e-7*x),F=357.52910918*uw+A1*(1295965810481e-4*m-.5532*v+136e-6*y-1149e-8*x),k=310.17137918*uw-A1*(6967051436e-3*m+6.2068*v+.007618*y-3219e-8*x),U=2*L,G=4*L,j=6*L,q=2*O,J=3*O,X=4*O,Y=2*R;C+=3400.4*Math.cos(U)-635.6*Math.cos(U-O)-235.6*Math.cos(O)+218.1*Math.cos(U-F)+181*Math.cos(U+O),w+=.014216*Math.cos(U-O)+.008551*Math.cos(U-q)-.001383*Math.cos(O)+.001356*Math.cos(U+O)-.001147*Math.cos(G-J)-914e-6*Math.cos(G-q)+869e-6*Math.cos(U-F-O)-627e-6*Math.cos(U)-394e-6*Math.cos(G-X)+282e-6*Math.cos(U-F-q)-279e-6*Math.cos(L-O)-236e-6*Math.cos(q)+231e-6*Math.cos(G)+229e-6*Math.cos(j-X)-201e-6*Math.cos(q-Y),E+=486.26*Math.cos(U-Y)-40.13*Math.cos(U)+37.51*Math.cos(Y)+25.73*Math.cos(q-Y)+19.97*Math.cos(U-F-Y),S+=-55609*Math.sin(U-O)-34711*Math.sin(U-q)-9792*Math.sin(O)+9385*Math.sin(G-J)+7505*Math.sin(G-q)+5318*Math.sin(U+O)+3484*Math.sin(G-X)-3417*Math.sin(U-F-O)-2530*Math.sin(j-X)-2376*Math.sin(U)-2075*Math.sin(U-J)-1883*Math.sin(q)-1736*Math.sin(j-5*O)+1626*Math.sin(F)-1370*Math.sin(j-J),I+=-5392*Math.sin(U-Y)-540*Math.sin(F)-441*Math.sin(U)+423*Math.sin(Y)-288*Math.sin(q-Y),D+=-3332.9*Math.sin(U)+1197.4*Math.sin(U-O)-662.5*Math.sin(F)+396.3*Math.sin(O)-218*Math.sin(U-F);let Q=2*k,ee=3*k;E+=46.997*Math.cos(k)*m-.614*Math.cos(U-Y+k)*m+.614*Math.cos(U-Y-k)*m-.0297*Math.cos(Q)*v-.0335*Math.cos(k)*v+.0012*Math.cos(U-Y+Q)*v-16e-5*Math.cos(k)*y+4e-5*Math.cos(ee)*y+4e-5*Math.cos(Q)*y;let z=2.116*Math.sin(k)*m-.111*Math.sin(U-Y-k)*m-.0015*Math.sin(k)*v;S+=z,D+=z,I+=-520.77*Math.sin(k)*m+13.66*Math.sin(U-Y+k)*m+1.12*Math.sin(U-k)*m-1.06*Math.sin(Y-k)*m+.66*Math.sin(Q)*v+.371*Math.sin(k)*v-.035*Math.sin(U-Y+Q)*v-.015*Math.sin(U-Y+k)*v+.0014*Math.sin(k)*y-.0011*Math.sin(ee)*y-9e-4*Math.sin(Q)*y,C*=wai;let ie=A+E*A1,re=T+S*A1,ne=P+D*A1,oe=M+I*A1;return DZe(C,w,ie,re,oe,ne,f)}var OVe=.012300034,fsi=OVe/(OVe+1)*-1;function psi(o,f){return f=LZe(o,f),H.multiplyByScalar(f,fsi,f)}var RZe=new Ut(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),G9=new H;DAe.computeSunPositionInEarthInertialFrame=function(o,f){return N(o)||(o=ci.now()),N(f)||(f=new H),G9=dsi(o,G9),f=H.negate(G9,f),psi(o,G9),H.subtract(f,G9,f),Ut.multiplyByVector(RZe,f,f),f};DAe.computeMoonPositionInEarthInertialFrame=function(o,f){return N(o)||(o=ci.now()),f=LZe(o,f),Ut.multiplyByVector(RZe,f,f),f};var cj=DAe;function msi(o){o=Z(o,Z.EMPTY_OBJECT),this.color=Re.clone(Z(o.color,Re.WHITE)),this.intensity=Z(o.intensity,2)}var l6=msi;function u6(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Xr,this._viewportCartesian4=new Wt,this._viewportDirty=!1,this._viewportOrthographicMatrix=Ee.clone(Ee.IDENTITY),this._viewportTransformation=Ee.clone(Ee.IDENTITY),this._model=Ee.clone(Ee.IDENTITY),this._view=Ee.clone(Ee.IDENTITY),this._inverseView=Ee.clone(Ee.IDENTITY),this._projection=Ee.clone(Ee.IDENTITY),this._infiniteProjection=Ee.clone(Ee.IDENTITY),this._entireFrustum=new Ye,this._currentFrustum=new Ye,this._frustumPlanes=new Wt,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=Ut.clone(Ee.IDENTITY),this._view3DDirty=!0,this._view3D=new Ee,this._inverseView3DDirty=!0,this._inverseView3D=new Ee,this._inverseModelDirty=!0,this._inverseModel=new Ee,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new Ut,this._viewRotation=new Ut,this._inverseViewRotation=new Ut,this._viewRotation3D=new Ut,this._inverseViewRotation3D=new Ut,this._inverseProjectionDirty=!0,this._inverseProjection=new Ee,this._modelViewDirty=!0,this._modelView=new Ee,this._modelView3DDirty=!0,this._modelView3D=new Ee,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new Ee,this._inverseModelViewDirty=!0,this._inverseModelView=new Ee,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new Ee,this._viewProjectionDirty=!0,this._viewProjection=new Ee,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new Ee,this._modelViewProjectionDirty=!0,this._modelViewProjection=new Ee,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new Ee,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new Ee,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new Ee,this._normalDirty=!0,this._normal=new Ut,this._normal3DDirty=!0,this._normal3D=new Ut,this._inverseNormalDirty=!0,this._inverseNormal=new Ut,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new Ut,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Qu,this._cameraPosition=new H,this._sunPositionWC=new H,this._sunPositionColumbusView=new H,this._sunDirectionWC=new H,this._sunDirectionEC=new H,this._moonDirectionEC=new H,this._lightDirectionWC=new H,this._lightDirectionEC=new H,this._lightColor=new H,this._lightColorHdr=new H,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new H,this._cameraRight=new H,this._cameraUp=new H,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new Ye,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new Re,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsDimensions=new Ye,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(u6.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(o){if(!Xr.equals(o,this._viewport)){Xr.clone(o,this._viewport);let f=this._viewport,m=this._viewportCartesian4;m.x=f.x,m.y=f.y,m.z=f.width,m.w=f.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return BVe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return BVe(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(o){Ee.clone(o,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,Ee.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let o=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,Ee.getMatrix3(this.inverseModel,o),Ut.transpose(o,o)),o}},view:{get:function(){return this._view}},view3D:{get:function(){return Efe(this),this._view3D}},viewRotation:{get:function(){return Efe(this),this._viewRotation}},viewRotation3D:{get:function(){return Efe(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return zVe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return zVe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return Esi(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return Tsi(this),this._modelView}},modelView3D:{get:function(){return Ssi(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return Rsi(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return Psi(this),this._inverseModelView}},inverseModelView3D:{get:function(){return Isi(this),this._inverseModelView3D}},viewProjection:{get:function(){return Msi(this),this._viewProjection}},inverseViewProjection:{get:function(){return Dsi(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return Lsi(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return Osi(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return Nsi(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return Fsi(this),this._modelViewInfiniteProjection}},normal:{get:function(){return Bsi(this),this._normal}},normal3D:{get:function(){return ksi(this),this._normal3D}},inverseNormal:{get:function(){return Vsi(this),this._inverseNormal}},inverseNormal3D:{get:function(){return zsi(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return VVe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return VVe(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsDimensions:{get:function(){return this._specularEnvironmentMapsDimensions}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return Z(this._ellipsoid,ki.WGS84)}}});function gsi(o,f){Ee.clone(f,o._view),Ee.getMatrix3(f,o._viewRotation),o._view3DDirty=!0,o._inverseView3DDirty=!0,o._modelViewDirty=!0,o._modelView3DDirty=!0,o._modelViewRelativeToEyeDirty=!0,o._inverseModelViewDirty=!0,o._inverseModelView3DDirty=!0,o._viewProjectionDirty=!0,o._inverseViewProjectionDirty=!0,o._modelViewProjectionDirty=!0,o._modelViewProjectionRelativeToEyeDirty=!0,o._modelViewInfiniteProjectionDirty=!0,o._normalDirty=!0,o._inverseNormalDirty=!0,o._normal3DDirty=!0,o._inverseNormal3DDirty=!0}function _si(o,f){Ee.clone(f,o._inverseView),Ee.getMatrix3(f,o._inverseViewRotation)}function vsi(o,f){Ee.clone(f,o._projection),o._inverseProjectionDirty=!0,o._viewProjectionDirty=!0,o._inverseViewProjectionDirty=!0,o._modelViewProjectionDirty=!0,o._modelViewProjectionRelativeToEyeDirty=!0}function ysi(o,f){Ee.clone(f,o._infiniteProjection),o._modelViewInfiniteProjectionDirty=!0}function xsi(o,f){H.clone(f.positionWC,o._cameraPosition),H.clone(f.directionWC,o._cameraDirection),H.clone(f.rightWC,o._cameraRight),H.clone(f.upWC,o._cameraUp);let m=f.positionCartographic;N(m)?o._eyeHeight=m.height:o._eyeHeight=-o._ellipsoid.maximumRadius,o._encodedCameraPositionMCDirty=!0}var W9=new Ut,Csi=new Mt,NVe=new H,FVe=new H;function bsi(o,f){N(tn.computeIcrfToFixedMatrix(f.time,W9))||(W9=tn.computeTemeToPseudoFixedMatrix(f.time,W9));let m=cj.computeSunPositionInEarthInertialFrame(f.time,o._sunPositionWC);if(Ut.multiplyByVector(W9,m,m),H.normalize(m,o._sunDirectionWC),Hy.isMoon()&&H.clone(o._sunPositionWC,NVe),m=Ut.multiplyByVector(o.viewRotation3D,m,o._sunDirectionEC),H.normalize(m,m),m=cj.computeMoonPositionInEarthInertialFrame(f.time,o._moonDirectionEC),Ut.multiplyByVector(W9,m,m),Hy.isMoon()){H.clone(m,FVe);let x=H.subtract(NVe,FVe,new H),C=Ut.multiplyByVector(o.viewRotation3D,x,o._sunDirectionEC);H.normalize(C,C)}Ut.multiplyByVector(o.viewRotation3D,m,m),H.normalize(m,m);let v=f.mapProjection,y=v.ellipsoid.cartesianToCartographic(o._sunPositionWC,Csi);v.project(y,o._sunPositionColumbusView)}u6.prototype.updateCamera=function(o){gsi(this,o.viewMatrix),_si(this,o.inverseViewMatrix),xsi(this,o),this._entireFrustum.x=o.frustum.near,this._entireFrustum.y=o.frustum.far,this.updateFrustum(o.frustum),this._orthographicIn3D=this._mode!==_i.SCENE2D&&o.frustum instanceof Gs};u6.prototype.updateFrustum=function(o){vsi(this,o.projectionMatrix),N(o.infiniteProjectionMatrix)&&ysi(this,o.infiniteProjectionMatrix),this._currentFrustum.x=o.near,this._currentFrustum.y=o.far,this._farDepthFromNearPlusOne=o.far-o.near+1,this._log2FarDepthFromNearPlusOne=xe.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let f=o.offCenterFrustum;N(f)&&(o=f),this._frustumPlanes.x=o.top,this._frustumPlanes.y=o.bottom,this._frustumPlanes.z=o.left,this._frustumPlanes.w=o.right};u6.prototype.updatePass=function(o){this._pass=o};var wsi=[],Asi=new l6;u6.prototype.update=function(o){this._mode=o.mode,this._mapProjection=o.mapProjection,this._ellipsoid=o.mapProjection.ellipsoid,this._pixelRatio=o.pixelRatio;let f=o.camera;this.updateCamera(f),o.mode===_i.SCENE2D?(this._frustum2DWidth=f.frustum.right-f.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),bsi(this,o);let m=Z(o.light,Asi);m instanceof l6?(this._lightDirectionWC=H.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=H.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=H.normalize(H.negate(m.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=Ut.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let v=m.color,y=H.fromElements(v.red,v.green,v.blue,this._lightColorHdr);y=H.multiplyByScalar(y,m.intensity,y);let x=H.maximumComponent(y);x>1?H.divideByScalar(y,x,this._lightColor):H.clone(y,this._lightColor);let C=o.brdfLutGenerator,w=N(C)?C.colorTexture:void 0;this._brdfLut=w,this._environmentMap=Z(o.environmentMap,o.context.defaultCubeMap),this._sphericalHarmonicCoefficients=Z(o.sphericalHarmonicCoefficients,wsi),this._specularEnvironmentMaps=o.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=o.specularEnvironmentMapsMaximumLOD,N(this._specularEnvironmentMaps)&&Ye.clone(this._specularEnvironmentMaps.dimensions,this._specularEnvironmentMapsDimensions),this._fogDensity=o.fog.density,this._invertClassificationColor=o.invertClassificationColor,this._frameState=o,this._temeToPseudoFixed=tn.computeTemeToPseudoFixedMatrix(o.time,this._temeToPseudoFixed),this._splitPosition=o.splitPosition*o.context.drawingBufferWidth;let A=f.frustum.fov,E=this._viewport,T;N(A)?E.height>E.width?T=Math.tan(.5*A)*2/E.height:T=Math.tan(.5*A)*2/E.width:T=1/Math.max(E.width,E.height),this._geometricToleranceOverMeter=T*o.maximumScreenSpaceError,Re.clone(o.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=o.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function BVe(o){if(o._viewportDirty){let f=o._viewport;Ee.computeOrthographicOffCenter(f.x,f.x+f.width,f.y,f.y+f.height,0,1,o._viewportOrthographicMatrix),Ee.computeViewportTransformation(f,0,1,o._viewportTransformation),o._viewportDirty=!1}}function Esi(o){o._inverseProjectionDirty&&(o._inverseProjectionDirty=!1,o._mode!==_i.SCENE2D&&o._mode!==_i.MORPHING&&!o._orthographicIn3D?Ee.inverse(o._projection,o._inverseProjection):Ee.clone(Ee.ZERO,o._inverseProjection))}function Tsi(o){o._modelViewDirty&&(o._modelViewDirty=!1,Ee.multiplyTransformation(o._view,o._model,o._modelView))}function Ssi(o){o._modelView3DDirty&&(o._modelView3DDirty=!1,Ee.multiplyTransformation(o.view3D,o._model,o._modelView3D))}function Psi(o){o._inverseModelViewDirty&&(o._inverseModelViewDirty=!1,Ee.inverse(o.modelView,o._inverseModelView))}function Isi(o){o._inverseModelView3DDirty&&(o._inverseModelView3DDirty=!1,Ee.inverse(o.modelView3D,o._inverseModelView3D))}function Msi(o){o._viewProjectionDirty&&(o._viewProjectionDirty=!1,Ee.multiply(o._projection,o._view,o._viewProjection))}function Dsi(o){o._inverseViewProjectionDirty&&(o._inverseViewProjectionDirty=!1,Ee.inverse(o.viewProjection,o._inverseViewProjection))}function Lsi(o){o._modelViewProjectionDirty&&(o._modelViewProjectionDirty=!1,Ee.multiply(o._projection,o.modelView,o._modelViewProjection))}function Rsi(o){if(o._modelViewRelativeToEyeDirty){o._modelViewRelativeToEyeDirty=!1;let f=o.modelView,m=o._modelViewRelativeToEye;m[0]=f[0],m[1]=f[1],m[2]=f[2],m[3]=f[3],m[4]=f[4],m[5]=f[5],m[6]=f[6],m[7]=f[7],m[8]=f[8],m[9]=f[9],m[10]=f[10],m[11]=f[11],m[12]=0,m[13]=0,m[14]=0,m[15]=f[15]}}function Osi(o){o._inverseModelViewProjectionDirty&&(o._inverseModelViewProjectionDirty=!1,Ee.inverse(o.modelViewProjection,o._inverseModelViewProjection))}function Nsi(o){o._modelViewProjectionRelativeToEyeDirty&&(o._modelViewProjectionRelativeToEyeDirty=!1,Ee.multiply(o._projection,o.modelViewRelativeToEye,o._modelViewProjectionRelativeToEye))}function Fsi(o){o._modelViewInfiniteProjectionDirty&&(o._modelViewInfiniteProjectionDirty=!1,Ee.multiply(o._infiniteProjection,o.modelView,o._modelViewInfiniteProjection))}function Bsi(o){if(o._normalDirty){o._normalDirty=!1;let f=o._normal;Ee.getMatrix3(o.inverseModelView,f),Ut.getRotation(f,f),Ut.transpose(f,f)}}function ksi(o){if(o._normal3DDirty){o._normal3DDirty=!1;let f=o._normal3D;Ee.getMatrix3(o.inverseModelView3D,f),Ut.getRotation(f,f),Ut.transpose(f,f)}}function Vsi(o){o._inverseNormalDirty&&(o._inverseNormalDirty=!1,Ee.getMatrix3(o.inverseModelView,o._inverseNormal),Ut.getRotation(o._inverseNormal,o._inverseNormal))}function zsi(o){o._inverseNormal3DDirty&&(o._inverseNormal3DDirty=!1,Ee.getMatrix3(o.inverseModelView3D,o._inverseNormal3D),Ut.getRotation(o._inverseNormal3D,o._inverseNormal3D))}var kVe=new H;function VVe(o){o._encodedCameraPositionMCDirty&&(o._encodedCameraPositionMCDirty=!1,Ee.multiplyByPoint(o.inverseModel,o._cameraPosition,kVe),Qu.fromCartesian(kVe,o._encodedCameraPositionMC))}var Hsi=new H,Usi=new H,Gsi=new H,Wsi=new H,jsi=new Mt,Ysi=new H,qsi=new Ee;function Xsi(o,f,m,v,y,x,C,w){let A=Hsi;A.x=o.y,A.y=o.z,A.z=o.x;let E=Usi;E.x=m.y,E.y=m.z,E.z=m.x;let T=Gsi;T.x=v.y,T.y=v.z,T.z=v.x;let S=Wsi;S.x=f.y,S.y=f.z,S.z=f.x,x===_i.SCENE2D&&(A.z=y*.5);let M=C.unproject(A,jsi);M.longitude=xe.clamp(M.longitude,-Math.PI,Math.PI),M.latitude=xe.clamp(M.latitude,-xe.PI_OVER_TWO,xe.PI_OVER_TWO);let I=C.ellipsoid,P=I.cartographicToCartesian(M,Ysi),D=tn.eastNorthUpToFixedFrame(P,I,qsi);return Ee.multiplyByPointAsVector(D,E,E),Ee.multiplyByPointAsVector(D,T,T),Ee.multiplyByPointAsVector(D,S,S),N(w)||(w=new Ee),w[0]=E.x,w[1]=T.x,w[2]=-S.x,w[3]=0,w[4]=E.y,w[5]=T.y,w[6]=-S.y,w[7]=0,w[8]=E.z,w[9]=T.z,w[10]=-S.z,w[11]=0,w[12]=-H.dot(E,P),w[13]=-H.dot(T,P),w[14]=H.dot(S,P),w[15]=1,w}function Efe(o){o._view3DDirty&&(o._mode===_i.SCENE3D?Ee.clone(o._view,o._view3D):Xsi(o._cameraPosition,o._cameraDirection,o._cameraRight,o._cameraUp,o._frustum2DWidth,o._mode,o._mapProjection,o._view3D),Ee.getMatrix3(o._view3D,o._viewRotation3D),o._view3DDirty=!1)}function zVe(o){o._inverseView3DDirty&&(Ee.inverseTransformation(o.view3D,o._inverseView3D),Ee.getMatrix3(o._inverseView3D,o._inverseViewRotation3D),o._inverseView3DDirty=!1)}var LAe=u6;function ub(o,f){let{getWebGLStub:m,requestWebgl1:v,webgl:y={},allowTextureFilterAnisotropic:x=!0}=Z(f,{});y.alpha=Z(y.alpha,!1),y.stencil=Z(y.stencil,!0),y.powerPreference=Z(y.powerPreference,"high-performance");let C=N(m)?m(o,y):Jsi(o,y,v),w=typeof WebGL2RenderingContext<"u"&&C instanceof WebGL2RenderingContext;this._canvas=o,this._originalGLContext=C,this._gl=C,this._webgl2=w,this._id=zl(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new IAe(this),this._textureCache=new MAe;let A=C;this._stencilBits=A.getParameter(A.STENCIL_BITS),Bo._maximumCombinedTextureImageUnits=A.getParameter(A.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Bo._maximumCubeMapSize=A.getParameter(A.MAX_CUBE_MAP_TEXTURE_SIZE),Bo._maximumFragmentUniformVectors=A.getParameter(A.MAX_FRAGMENT_UNIFORM_VECTORS),Bo._maximumTextureImageUnits=A.getParameter(A.MAX_TEXTURE_IMAGE_UNITS),Bo._maximumRenderbufferSize=A.getParameter(A.MAX_RENDERBUFFER_SIZE),Bo._maximumTextureSize=A.getParameter(A.MAX_TEXTURE_SIZE),Bo._maximumVaryingVectors=A.getParameter(A.MAX_VARYING_VECTORS),Bo._maximumVertexAttributes=A.getParameter(A.MAX_VERTEX_ATTRIBS),Bo._maximumVertexTextureImageUnits=A.getParameter(A.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Bo._maximumVertexUniformVectors=A.getParameter(A.MAX_VERTEX_UNIFORM_VECTORS),Bo._maximumSamples=this._webgl2?A.getParameter(A.MAX_SAMPLES):0;let E=A.getParameter(A.ALIASED_LINE_WIDTH_RANGE);Bo._minimumAliasedLineWidth=E[0],Bo._maximumAliasedLineWidth=E[1];let T=A.getParameter(A.ALIASED_POINT_SIZE_RANGE);Bo._minimumAliasedPointSize=T[0],Bo._maximumAliasedPointSize=T[1];let S=A.getParameter(A.MAX_VIEWPORT_DIMS);Bo._maximumViewportWidth=S[0],Bo._maximumViewportHeight=S[1];let M=A.getShaderPrecisionFormat(A.FRAGMENT_SHADER,A.HIGH_FLOAT);Bo._highpFloatSupported=M.precision!==0;let I=A.getShaderPrecisionFormat(A.FRAGMENT_SHADER,A.HIGH_INT);Bo._highpIntSupported=I.rangeMax!==0,this._antialias=A.getContextAttributes().antialias,this._standardDerivatives=!!Cp(A,["OES_standard_derivatives"]),this._blendMinmax=!!Cp(A,["EXT_blend_minmax"]),this._elementIndexUint=!!Cp(A,["OES_element_index_uint"]),this._depthTexture=!!Cp(A,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Cp(A,["EXT_frag_depth"]),this._debugShaders=Cp(A,["WEBGL_debug_shaders"]),this._textureFloat=!!Cp(A,["OES_texture_float"]),this._textureHalfFloat=!!Cp(A,["OES_texture_half_float"]),this._textureFloatLinear=!!Cp(A,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Cp(A,["OES_texture_half_float_linear"]),this._colorBufferFloat=!!Cp(A,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Cp(A,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Cp(A,["EXT_color_buffer_half_float"]),this._s3tc=!!Cp(A,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Cp(A,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Cp(A,["WEBGL_compressed_texture_astc"]),this._etc=!!Cp(A,["WEBG_compressed_texture_etc"]),this._etc1=!!Cp(A,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Cp(A,["EXT_texture_compression_bptc"]),$3.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let P=x?Cp(A,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=P,Bo._maximumTextureFilterAnisotropy=N(P)?A.getParameter(P.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let D,L,R,O,F,k,U,G,j,q;if(w){let Q=this;D=function(){return Q._gl.createVertexArray()},L=function(ee){Q._gl.bindVertexArray(ee)},R=function(ee){Q._gl.deleteVertexArray(ee)},O=function(ee,z,ie,re,ne){A.drawElementsInstanced(ee,z,ie,re,ne)},F=function(ee,z,ie,re){A.drawArraysInstanced(ee,z,ie,re)},k=function(ee,z){A.vertexAttribDivisor(ee,z)},U=function(ee){A.drawBuffers(ee)}}else G=Cp(A,["OES_vertex_array_object"]),N(G)&&(D=function(){return G.createVertexArrayOES()},L=function(Q){G.bindVertexArrayOES(Q)},R=function(Q){G.deleteVertexArrayOES(Q)}),j=Cp(A,["ANGLE_instanced_arrays"]),N(j)&&(O=function(Q,ee,z,ie,re){j.drawElementsInstancedANGLE(Q,ee,z,ie,re)},F=function(Q,ee,z,ie){j.drawArraysInstancedANGLE(Q,ee,z,ie)},k=function(Q,ee){j.vertexAttribDivisorANGLE(Q,ee)}),q=Cp(A,["WEBGL_draw_buffers"]),N(q)&&(U=function(Q){q.drawBuffersWEBGL(Q)});this.glCreateVertexArray=D,this.glBindVertexArray=L,this.glDeleteVertexArray=R,this.glDrawElementsInstanced=O,this.glDrawArraysInstanced=F,this.glVertexAttribDivisor=k,this.glDrawBuffers=U,this._vertexArrayObject=!!G,this._instancedArrays=!!j,this._drawBuffers=!!q,Bo._maximumDrawBuffers=this.drawBuffers?A.getParameter(xi.MAX_DRAW_BUFFERS):1,Bo._maximumColorAttachments=this.drawBuffers?A.getParameter(xi.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new Re(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let J=new LAe,X=new Kg(this),Y=Mn.fromCache();this._defaultPassState=X,this._defaultRenderState=Y,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=J,this._currentRenderState=Y,this._currentPassState=X,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let Q=0;Q"u")throw new sr("The browser does not support WebGL. Visit http://get.webgl.org.");!m&&!(typeof WebGL2RenderingContext<"u")&&(m=!0);let v=m?"webgl":"webgl2",y=o.getContext(v,f);if(!N(y))throw new sr("The browser supports WebGL, but initialization failed.");return y}function Ksi(o,f){let m="WebGL Error: ";switch(f){case o.INVALID_ENUM:m+="INVALID_ENUM";break;case o.INVALID_VALUE:m+="INVALID_VALUE";break;case o.INVALID_OPERATION:m+="INVALID_OPERATION";break;case o.OUT_OF_MEMORY:m+="OUT_OF_MEMORY";break;case o.CONTEXT_LOST_WEBGL:m+="CONTEXT_LOST_WEBGL lost";break;default:m+=`Unknown (${f})`}return m}function Qsi(o,f,m,v){let y=`${Ksi(o,v)}: ${f.name}(`;for(let x=0;x=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(o){this._throwOnWebGLError=o,this._gl=eli(this._originalGLContext,o?Zsi:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new _o({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new _o({context:this,pixelFormat:Nn.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new _o({context:this,pixelFormat:Nn.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let o={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new lT({context:this,source:{positiveX:o,negativeX:o,positiveY:o,negativeY:o,positiveZ:o,negativeZ:o},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return tli}}});function OZe(o,f,m,v){let y=o._currentRenderState,x=o._currentPassState;o._currentRenderState=f,o._currentPassState=m,Mn.partialApply(o._gl,y,f,x,m,v)}var RAe;typeof WebGLRenderingContext<"u"&&(RAe=[xi.BACK]);function hj(o,f){if(f!==o._currentFramebuffer){o._currentFramebuffer=f;let m=RAe;if(N(f))f._bind(),m=f._getActiveColorAttachments();else{let v=o._gl;v.bindFramebuffer(v.FRAMEBUFFER,null)}o.drawBuffers&&o.glDrawBuffers(m)}}var ili=new Gc;ub.prototype.clear=function(o,f){o=Z(o,ili),f=Z(f,this._defaultPassState);let m=this._gl,v=0,y=o.color,x=o.depth,C=o.stencil;N(y)&&(Re.equals(this._clearColor,y)||(Re.clone(y,this._clearColor),m.clearColor(y.red,y.green,y.blue,y.alpha)),v|=m.COLOR_BUFFER_BIT),N(x)&&(x!==this._clearDepth&&(this._clearDepth=x,m.clearDepth(x)),v|=m.DEPTH_BUFFER_BIT),N(C)&&(C!==this._clearStencil&&(this._clearStencil=C,m.clearStencil(C)),v|=m.STENCIL_BUFFER_BIT);let w=Z(o.renderState,this._defaultRenderState);OZe(this,w,f,!0);let A=Z(o.framebuffer,f.framebuffer);hj(this,A),m.clear(v)};function rli(o,f,m,v,y){hj(o,f),OZe(o,y,m,!1),v._bind(),o._maxFrameTextureUnitIndex=Math.max(o._maxFrameTextureUnitIndex,v.maximumTextureUnitIndex)}function nli(o,f,m,v){let y=f._primitiveType,x=f._vertexArray,C=f._offset,w=f._count,A=f.instanceCount;o._us.model=Z(f._modelMatrix,Ee.IDENTITY),m._setUniforms(v,o._us,o.validateShaderProgram,o.customProject),x._bind();let E=x.indexBuffer;N(E)?(C=C*E.bytesPerIndex,w=Z(w,E.numberOfIndices),A===0?o._gl.drawElements(y,w,E.indexDatatype,C):o.glDrawElementsInstanced(y,w,E.indexDatatype,C,A)):(w=Z(w,x.numberOfVertices),A===0?o._gl.drawArrays(y,C,w):o.glDrawArraysInstanced(y,C,w,A)),x._unBind()}ub.prototype.draw=function(o,f,m,v){f=Z(f,this._defaultPassState);let y=Z(o._framebuffer,f.framebuffer);N(f.framebuffer)&&N(o._framebuffer)&&o._framebuffer._externalDepthStencil&&(o._framebuffer.depthStencilTexture=f.framebuffer.depthStencilTexture);let x=Z(o._renderState,this._defaultRenderState);m=Z(m,o._shaderProgram),v=Z(v,o._uniformMap),rli(this,y,f,m,x),nli(this,o,m,v)};ub.prototype.endFrame=function(){let o=this._gl;o.useProgram(null),this._currentFramebuffer=void 0,o.bindFramebuffer(o.FRAMEBUFFER,null);let f=RAe;this.drawBuffers&&this.glDrawBuffers(f);let m=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let v=0;v0&&(w=C.getColorTexture(0).pixelDatatype);let A=Nn.createTypedArray(Nn.RGBA,w,y,x);return hj(this,C),f.readPixels(m,v,y,x,Nn.RGBA,Rn.toWebGLConstant(w,this),A),A};var NZe={position:0,textureCoordinates:1};ub.prototype.getViewportQuadVertexArray=function(){let o=this.cache.viewportQuad_vertexArray;if(!N(o)){let f=new ga({attributes:{position:new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Fn.TRIANGLES});o=Du.fromGeometry({context:this,geometry:f,attributeLocations:NZe,bufferUsage:gn.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=o}return o};ub.prototype.createViewportQuadCommand=function(o,f){return f=Z(f,Z.EMPTY_OBJECT),new Jn({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Fn.TRIANGLES,renderState:f.renderState,shaderProgram:Rs.fromCache({context:this,vertexShaderSource:Jne,fragmentShaderSource:o,attributeLocations:NZe}),uniformMap:f.uniformMap,owner:f.owner,framebuffer:f.framebuffer,pass:f.pass})};ub.prototype.getObjectByPickColor=function(o){return this._pickObjects[o.toRgba()]};function OAe(o,f,m){this._pickObjects=o,this.key=f,this.color=m}Object.defineProperties(OAe.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(o){this._pickObjects[this.key]=o}}});OAe.prototype.destroy=function(){delete this._pickObjects[this.key]};ub.prototype.createPickId=function(o){++this._nextPickColor[0];let f=this._nextPickColor[0];if(f===0)throw new sr("Out of unique Pick IDs.");return this._pickObjects[f]=o,new OAe(this._pickObjects,f,Re.fromRgba(f))};ub.prototype.isDestroyed=function(){return!1};ub.prototype.destroy=function(){let o=this.cache;for(let f in o)if(o.hasOwnProperty(f)){let m=o[f];N(m.destroy)&&m.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),kr(this)};ub.prototype.clearFrameBuffer=function(o){let f=this._gl;f.clearColor(0,0,0,0,0),hj(this,o),f.clear(f.COLOR_BUFFER_BIT),f.clearColor(this._clearColor.red,this._clearColor.green,this._clearColor.blue,this._clearColor.alpha),hj(this,this._currentFramebuffer)};var NAe=ub;function oli(o,f,m){let v={flipY:!0,skipColorSpaceConversion:m,preferImageBitmap:!0},y=[Jr.createIfNeeded(f.positiveX).fetchImage(v),Jr.createIfNeeded(f.negativeX).fetchImage(v),Jr.createIfNeeded(f.positiveY).fetchImage(v),Jr.createIfNeeded(f.negativeY).fetchImage(v),Jr.createIfNeeded(f.positiveZ).fetchImage(v),Jr.createIfNeeded(f.negativeZ).fetchImage(v)];return Promise.all(y).then(function(x){return new lT({context:o,source:{positiveX:x[0],negativeX:x[1],positiveY:x[2],negativeY:x[3],positiveZ:x[4],negativeZ:x[5]}})})}var FAe=oli;function RH(o){o=Z(o,Z.EMPTY_OBJECT),kh.defined("options.context",o.context);let f=o.context,m=o.width,v=o.height,y=o.depth,x=o.source,C=Z(o.pixelFormat,Nn.RGBA),w=Z(o.pixelDataType,Rn.UNSIGNED_BYTE),A=Nn.toInternalFormat(C,w,f);if(!N(m)||!N(v)||!N(y))throw new li("options requires a source field to create an 3d texture. width or height or dimension fileds");if(kh.typeOf.number.greaterThan("width",m,0),m>Bo.maximumTextureSize)throw new li("width must be less than or equal to the maximum texture size");if(kh.typeOf.number.greaterThan("height",v,0),v>Bo.maximumTextureSize)throw new li("height must be less than or equal to the maximum texture size");if(kh.typeOf.number.greaterThan("dimensions",y,0),y>Bo.maximumTextureSize)throw new li("dimension must be less than or equal to the maximum texture size");if(!Nn.validate(C))throw new li("Invalid options.pixelFormat.");if(!Rn.validate(w))throw new li("Invalid options.pixelDatatype.");let E=!0,T=f._gl,S=T.TEXTURE_3D,M=T.createTexture();T.activeTexture(T.TEXTURE0),T.bindTexture(S,M);let I=4;if(N(x)&&N(x.arrayBufferView)&&(I=Nn.alignmentInBytes(C,w,m)),T.pixelStorei(T.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),T.pixelStorei(T.UNPACK_FLIP_Y_WEBGL,!1),T.pixelStorei(T.UNPACK_ALIGNMENT,I),T.pixelStorei(T.UNPACK_COLORSPACE_CONVERSION_WEBGL,T.BROWSER_DEFAULT_WEBGL),N(x)&&N(x.arrayBufferView)){let P=x.arrayBufferView;T.texImage3D(S,0,A,m,v,y,0,C,Rn.toWebGLConstant(w,f),P),E=!0}T.bindTexture(S,null),this._id=zl(),this._context=f,this._textureFilterAnisotropic=f._textureFilterAnisotropic,this._textureTarget=S,this._texture=M,this._internalFormat=A,this._pixelFormat=C,this._pixelDatatype=w,this._width=m,this._height=v,this._depth=y,this._dimensions=new H(m,v,y),this._hasMinmap=!1,this._sizeInBytes=4,this._preMultiplyAlpha=!1,this._flipY=!1,this._initialized=E,this._sampler=void 0,this.sampler=N(o.sampler)?o.sampler:new gs}RH.fromFramebuffer=function(o){o=Z(o,Z.EMPTY_OBJECT),kh.defined("options.context",o.context);let f=o.context,m=f._gl,v=Z(o.pixelFormat,Nn.RGB),y=Z(o.width,m.drawingBufferWidth),x=Z(o.height,m.drawingBufferHeight),C=Z(o.depth,128),w=o.framebuffer;return new RH({context:f,width:y,height:x,pixelFormat:v,source:{framebuffer:N(w)?w:f.defaultFramebuffer,width:y,height:x,depth:C}})};Object.defineProperties(RH.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(o){let f=o.minificationFilter,m=o.magnificationFilter,v=this._context._gl,y=this._textureTarget;v.activeTexture(v.TEXTURE0),v.bindTexture(y,this._texture),v.texParameteri(y,v.TEXTURE_MIN_FILTER,f),v.texParameteri(y,v.TEXTURE_MAG_FILTER,m),v.texParameteri(y,v.TEXTURE_WRAP_R,o.wrapR),v.texParameteri(y,v.TEXTURE_WRAP_S,o.wrapS),v.texParameteri(y,v.TEXTURE_WRAP_T,o.wrapT),v.bindTexture(y,null),this._sampler=o}},dimensions:{get:function(){return this._dimensions}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},depth:{get:function(){return this._depth}},_target:{get:function(){return this._textureTarget}}});RH.prototype.isDestroyed=function(){return!1};RH.prototype.destory=function(){return this._context._gl.deleteTexture(this._texture),kr(this)};var BAe=RH,_te=`#ifdef MRT layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1; #else layout (location = 0) out vec4 out_FragColor; #endif uniform vec4 u_bgColor; uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { if (texture(u_depthTexture, v_textureCoordinates).r < 1.0) { #ifdef MRT out_FragData_0 = u_bgColor; out_FragData_1 = vec4(u_bgColor.a); #else out_FragColor = u_bgColor; #endif return; } discard; } `,OH=`uniform vec3 u_radiiAndDynamicAtmosphereColor; uniform float u_atmosphereLightIntensity; uniform float u_atmosphereRayleighScaleHeight; uniform float u_atmosphereMieScaleHeight; uniform float u_atmosphereMieAnisotropy; uniform vec3 u_atmosphereRayleighCoefficient; uniform vec3 u_atmosphereMieCoefficient; const float ATMOSPHERE_THICKNESS = 111e3; // The thickness of the atmosphere in meters. const int PRIMARY_STEPS_MAX = 16; // Maximum number of times the ray from the camera to the world position (primary ray) is sampled. const int LIGHT_STEPS_MAX = 4; // Maximum number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. /** * Rational approximation to tanh(x) */ float approximateTanh(float x) { float x2 = x * x; return max(-1.0, min(+1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2))); } /** * This function computes the colors contributed by Rayliegh and Mie scattering on a given ray, as well as * the transmittance value for the ray. * * @param {czm_ray} primaryRay The ray from the camera to the position. * @param {float} primaryRayLength The length of the primary ray. * @param {vec3} lightDirection The direction of the light to calculate the scattering from. * @param {vec3} rayleighColor The variable the Rayleigh scattering will be written to. * @param {vec3} mieColor The variable the Mie scattering will be written to. * @param {float} opacity The variable the transmittance will be written to. * @glslFunction */ void computeScattering( czm_ray primaryRay, float primaryRayLength, vec3 lightDirection, float atmosphereInnerRadius, out vec3 rayleighColor, out vec3 mieColor, out float opacity ) { // Initialize the default scattering amounts to 0. rayleighColor = vec3(0.0); mieColor = vec3(0.0); opacity = 0.0; float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; vec3 origin = vec3(0.0); // Calculate intersection from the camera to the outer ring of the atmosphere. czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius); // Return empty colors if no intersection with the atmosphere geometry. if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) { return; } // To deal with smaller values of PRIMARY_STEPS (e.g. 4) // we implement a split strategy: sky or horizon. // For performance reasons, instead of a if/else branch // a soft choice is implemented through a weight 0.0 <= w_stop_gt_lprl <= 1.0 float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength); // Value close to 0.0: close to the horizon // Value close to 1.0: above in the sky float w_stop_gt_lprl = 0.5 * (1.0 + approximateTanh(x)); // The ray should start from the first intersection with the outer atmopshere, or from the camera position, if it is inside the atmosphere. float start_0 = primaryRayAtmosphereIntersect.start; primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0); // The ray should end at the exit from the atmosphere or at the distance to the vertex, whichever is smaller. primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength)); // For the number of ray steps, distinguish inside or outside atmosphere (outer space) // (1) from outer space we have to use more ray steps to get a realistic rendering // (2) within atmosphere we need fewer steps for faster rendering float x_o_a = start_0 - ATMOSPHERE_THICKNESS; // ATMOSPHERE_THICKNESS used as an ad-hoc constant, no precise meaning here, only the order of magnitude matters float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + approximateTanh(x_o_a)); int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0); // Number of times the ray from the camera to the world position (primary ray) is sampled. int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0); // Number of times the light is sampled from the light source's intersection with the atmosphere to a sample position on the primary ray. // Setup for sampling positions along the ray - starting from the intersection with the outer ring of the atmosphere. float rayPositionLength = primaryRayAtmosphereIntersect.start; // (1) Outside the atmosphere: constant rayStepLength // (2) Inside atmosphere: variable rayStepLength to compensate the rough rendering of the smaller number of ray steps float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength; float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0)); float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS)); vec3 rayleighAccumulation = vec3(0.0); vec3 mieAccumulation = vec3(0.0); vec2 opticalDepth = vec2(0.0); vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight); // Sample positions on the primary ray. for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) { // The loop should be: for (int i = 0; i < PRIMARY_STEPS; ++i) {...} but WebGL1 cannot // loop with non-constant condition, so it has to break early instead if (i >= PRIMARY_STEPS) { break; } // Calculate sample position along viewpoint ray. vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength); // Calculate height of sample position above ellipsoid. float sampleHeight = length(samplePosition) - atmosphereInnerRadius; // Calculate and accumulate density of particles at the sample position. vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength; opticalDepth += sampleDensity; // Generate ray from the sample position segment to the light source, up to the outer ring of the atmosphere. czm_ray lightRay = czm_ray(samplePosition, lightDirection); czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius); float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS); float lightPositionLength = 0.0; vec2 lightOpticalDepth = vec2(0.0); // Sample positions along the light ray, to accumulate incidence of light on the latest sample segment. for (int j = 0; j < LIGHT_STEPS_MAX; ++j) { // The loop should be: for (int j = 0; i < LIGHT_STEPS; ++j) {...} but WebGL1 cannot // loop with non-constant condition, so it has to break early instead if (j >= LIGHT_STEPS) { break; } // Calculate sample position along light ray. vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5); // Calculate height of the light sample position above ellipsoid. float lightHeight = length(lightPosition) - atmosphereInnerRadius; // Calculate density of photons at the light sample position. lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength; // Increment distance on light ray. lightPositionLength += lightStepLength; } // Compute attenuation via the primary ray and the light ray. vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x)))); // Accumulate the scattering. rayleighAccumulation += sampleDensity.x * attenuation; mieAccumulation += sampleDensity.y * attenuation; // Increment distance on primary ray. rayPositionLength += (rayStepLength += rayStepLengthIncrease); } // Compute the scattering amount. rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation; mieColor = u_atmosphereMieCoefficient * mieAccumulation; // Compute the transmittance i.e. how much light is passing through the atmosphere. opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x)))); } vec4 computeAtmosphereColor( vec3 positionWC, vec3 lightDirection, vec3 rayleighColor, vec3 mieColor, float opacity ) { // Setup the primary ray: from the camera position to the vertex position. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); float cosAngle = dot(cameraToPositionWCDirection, lightDirection); float cosAngleSq = cosAngle * cosAngle; float G = u_atmosphereMieAnisotropy; float GSq = G * G; // The Rayleigh phase function. float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq); // The Mie phase function. float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq)); // The final color is generated by combining the effects of the Rayleigh and Mie scattering. vec3 rayleigh = rayleighPhase * rayleighColor; vec3 mie = miePhase * mieColor; vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity; return vec4(color, opacity); } `,kAe=`in vec2 v_textureCoordinates; const float M_PI = 3.141592653589793; float vdcRadicalInverse(int i) { float r; float base = 2.0; float value = 0.0; float invBase = 1.0 / base; float invBi = invBase; for (int x = 0; x < 100; x++) { if (i <= 0) { break; } r = mod(float(i), base); value += r * invBi; invBi *= invBase; i = int(float(i) * invBase); } return value; } vec2 hammersley2D(int i, int N) { return vec2(float(i) / float(N), vdcRadicalInverse(i)); } vec3 importanceSampleGGX(vec2 xi, float roughness, vec3 N) { float a = roughness * roughness; float phi = 2.0 * M_PI * xi.x; float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (a * a - 1.0) * xi.y)); float sinTheta = sqrt(1.0 - cosTheta * cosTheta); vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta); vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0); vec3 tangentX = normalize(cross(upVector, N)); vec3 tangentY = cross(N, tangentX); return tangentX * H.x + tangentY * H.y + N * H.z; } float G1_Smith(float NdotV, float k) { return NdotV / (NdotV * (1.0 - k) + k); } float G_Smith(float roughness, float NdotV, float NdotL) { float k = roughness * roughness / 2.0; return G1_Smith(NdotV, k) * G1_Smith(NdotL, k); } vec2 integrateBrdf(float roughness, float NdotV) { vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV); float A = 0.0; float B = 0.0; const int NumSamples = 1024; for (int i = 0; i < NumSamples; i++) { vec2 xi = hammersley2D(i, NumSamples); vec3 H = importanceSampleGGX(xi, roughness, vec3(0.0, 0.0, 1.0)); vec3 L = 2.0 * dot(V, H) * H - V; float NdotL = clamp(L.z, 0.0, 1.0); float NdotH = clamp(H.z, 0.0, 1.0); float VdotH = clamp(dot(V, H), 0.0, 1.0); if (NdotL > 0.0) { float G = G_Smith(roughness, NdotV, NdotL); float G_Vis = G * VdotH / (NdotH * NdotV); float Fc = pow(1.0 - VdotH, 5.0); A += (1.0 - Fc) * G_Vis; B += Fc * G_Vis; } } return vec2(A, B) / float(NumSamples); } void main() { out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0); } `,FZe=`uniform sampler2D u_floatTexture; void main() { float actual = texture(u_floatTexture, vec2(0.5, 0.5)).r; float expected = 123456.0; out_FragColor = vec4(abs(actual - expected), 0.0, 0.0, 1.0); } `,VAe=`uniform sampler2D u_noiseTexture; uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; in vec2 v_offset; in vec3 v_maximumSize; in vec4 v_color; in float v_slice; in float v_brightness; float wrap(float value, float rangeLength) { if(value < 0.0) { float absValue = abs(value); float modValue = mod(absValue, rangeLength); return mod(rangeLength - modValue, rangeLength); } return mod(value, rangeLength); } vec3 wrapVec(vec3 value, float rangeLength) { return vec3(wrap(value.x, rangeLength), wrap(value.y, rangeLength), wrap(value.z, rangeLength)); } vec2 voxelToUV(vec3 voxelIndex) { float textureSliceWidth = u_noiseTextureDimensions.x; float noiseTextureRows = u_noiseTextureDimensions.y; float inverseNoiseTextureRows = u_noiseTextureDimensions.z; float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth; vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared, inverseNoiseTextureRows / textureSliceWidth); vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth); float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows); float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows); float xPixelCoord = wrappedIndex.x + column * textureSliceWidth; float yPixelCoord = wrappedIndex.y + row * textureSliceWidth; return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions; } // Interpolate a voxel with its neighbor (along the positive X-axis) vec4 lerpSamplesX(vec3 voxelIndex, float x) { vec2 uv0 = voxelToUV(voxelIndex); vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0)); vec4 sample0 = texture(u_noiseTexture, uv0); vec4 sample1 = texture(u_noiseTexture, uv1); return mix(sample0, sample1, x); } vec4 sampleNoiseTexture(vec3 position) { float textureSliceWidth = u_noiseTextureDimensions.x; vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0); vec3 lerpValue = fract(recenteredPos); vec3 voxelIndex = floor(recenteredPos); vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x); vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x); vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x); vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x); vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y); vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y); return mix(yLerp0, yLerp1, lerpValue.z); } // Intersection with a unit sphere with radius 0.5 at center (0, 0, 0). bool intersectSphere(vec3 origin, vec3 dir, float slice, out vec3 point, out vec3 normal) { float A = dot(dir, dir); float B = dot(origin, dir); float C = dot(origin, origin) - 0.25; float discriminant = (B * B) - (A * C); if(discriminant < 0.0) { return false; } float root = sqrt(discriminant); float t = (-B - root) / A; if(t < 0.0) { t = (-B + root) / A; } point = origin + t * dir; if(slice >= 0.0) { point.z = (slice / 2.0) - 0.5; if(length(point) > 0.5) { return false; } } normal = normalize(point); point -= czm_epsilon2 * normal; return true; } // Transforms the ray origin and direction into unit sphere space, // then transforms the result back into the ellipsoid's space. bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice, out vec3 point, out vec3 normal) { if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) { return false; } vec3 o = (origin - center) / scale; vec3 d = dir / scale; vec3 p, n; bool intersected = intersectSphere(o, d, slice, p, n); if(intersected) { point = (p * scale) + center; normal = n; } return intersected; } // Assume that if phase shift is being called for octave i, // the frequency is of i - 1. This saves us from doing extra // division / multiplication operations. vec2 phaseShift2D(vec2 p, vec2 freq) { return (czm_pi / 2.0) * sin(freq.yx * p.yx); } vec2 phaseShift3D(vec3 p, vec2 freq) { return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z)); } // The cloud texture function derived from Gardner's 1985 paper, // "Visual Simulation of Clouds." // https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner.pdf const float T0 = 0.6; // contrast of the texture pattern const float k = 0.1; // computed to produce a maximum value of 1 const float C0 = 0.8; // coefficient const float FX0 = 0.6; // frequency X const float FY0 = 0.6; // frequency Y const int octaves = 5; float T(vec3 point) { vec2 sum = vec2(0.0); float Ci = C0; vec2 FXY = vec2(FX0, FY0); vec2 PXY = vec2(0.0); for(int i = 1; i <= octaves; i++) { PXY = phaseShift3D(point, FXY); Ci *= 0.707; FXY *= 2.0; vec2 sinTerm = sin(FXY * point.xy + PXY); sum += Ci * sinTerm + vec2(T0); } return k * sum.x * sum.y; } const float a = 0.5; // fraction of surface reflection due to ambient or scattered light, const float t = 0.4; // fraction of texture shading const float s = 0.25; // fraction of specular reflection float I(float Id, float Is, float It) { return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a; } const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7)); vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice, float brightness) { vec3 cloudPoint, cloudNormal; if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice, cloudPoint, cloudNormal)) { return vec4(0.0); } float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0); // diffuse reflection float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0); // specular reflection float It = T(cloudPoint); // texture function float intensity = I(Id, Is, It); vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0)); vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint); float W = noise.x; float W2 = noise.y; float W3 = noise.z; // The dot product between the cloud's normal and the ray's direction is greatest // in the center of the ellipsoid's surface. It decreases towards the edge. // Thus, it is used to blur the areas leading to the edges of the ellipsoid, // so that no harsh lines appear. // The first (and biggest) layer of worley noise is then subtracted from this. // The final result is scaled up so that the base cloud is not too translucent. float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0); float TR = pow(ndDot, 3.0) - W; // translucency TR *= 1.3; // Subtracting the second and third layers of worley noise is more complicated. // If these layers of noise were simply subtracted from the current translucency, // the shape derived from the first layer of noise would be completely deleted. // The erosion of this noise should thus be constricted to the edges of the cloud. // However, because the edges of the ellipsoid were already blurred away, mapping // the noise to (1.0 - ndDot) will have no impact on most of the cloud's appearance. // The value of (0.5 - ndDot) provides the best compromise. float minusDot = 0.5 - ndDot; // Even with the previous calculation, subtracting the second layer of wnoise // erode too much of the cloud. The addition of it, however, will detailed // volume to the cloud. As long as the noise is only added and not subtracted, // the results are aesthetically pleasing. // The minusDot product is mapped in a way that it is larger at the edges of // the ellipsoid, so a subtraction and min operation are used instead of // an addition and max one. TR -= min(minusDot * W2, 0.0); // The third level of worley noise is subtracted from the result, with some // modifications. First, a scalar is added to minusDot so that the noise // starts affecting the shape farther away from the center of the ellipsoid's // surface. Then, it is scaled down so its impact is not too intense. TR -= 0.8 * (minusDot + 0.25) * W3; // The texture function's shading does not correlate with the shape of the cloud // produced by the layers of noise, so an extra shading scalar is calculated. // The darkest areas of the cloud are assigned to be where the noise erodes // the cloud the most. This is then interpolated based on the translucency // and the diffuse shading term of that point in the cloud. float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR); // To avoid values that are too dark, this scalar is increased by a small amount // and clamped so it never goes to zero. shading = clamp(shading + 0.2, 0.3, 1.0); // Finally, the contrast of the cloud's color is increased. vec3 finalColor = mix(vec3(0.5), shading * color, 1.15); return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color; } void main() { #ifdef DEBUG_BILLBOARDS out_FragColor = vec4(0.0, 0.5, 0.5, 1.0); #endif // To avoid calculations with high values, // we raycast from an arbitrarily smaller space. vec2 coordinate = v_maximumSize.xy * v_offset; vec3 ellipsoidScale = 0.82 * v_maximumSize; vec3 ellipsoidCenter = vec3(0.0); float zOffset = max(ellipsoidScale.z - 10.0, 0.0); vec3 eye = vec3(0, 0, -10.0 - zOffset); vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye); vec3 rayOrigin = eye; #ifdef DEBUG_ELLIPSOIDS vec3 point, normal; if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, point, normal)) { out_FragColor = v_brightness * v_color; } #else #ifndef DEBUG_BILLBOARDS vec4 cloud = drawCloud(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice, v_brightness); if(cloud.w < 0.01) { discard; } out_FragColor = cloud; #endif #endif } `,zAe=`#ifdef INSTANCED in vec2 direction; #endif in vec4 positionHighAndScaleX; in vec4 positionLowAndScaleY; in vec4 packedAttribute0; in vec4 packedAttribute1; in vec4 color; out vec2 v_offset; out vec3 v_maximumSize; out vec4 v_color; out float v_slice; out float v_brightness; void main() { // Unpack attributes. vec3 positionHigh = positionHighAndScaleX.xyz; vec3 positionLow = positionLowAndScaleY.xyz; vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w); float show = packedAttribute0.x; float brightness = packedAttribute0.y; vec2 coordinates = packedAttribute0.wz; vec3 maximumSize = packedAttribute1.xyz; float slice = packedAttribute1.w; #ifdef INSTANCED vec2 dir = direction; #else vec2 dir = coordinates; #endif vec2 offset = dir - vec2(0.5, 0.5); vec2 scaledOffset = scale * offset; vec4 p = czm_translateRelativeToEye(positionHigh, positionLow); vec4 positionEC = czm_modelViewRelativeToEye * p; positionEC.xy += scaledOffset; positionEC.xyz *= show; gl_Position = czm_projection * positionEC; v_offset = offset; v_maximumSize = maximumSize; v_color = color; v_slice = slice; v_brightness = brightness; } `,HAe=`uniform vec3 u_noiseTextureDimensions; uniform float u_noiseDetail; uniform vec3 u_noiseOffset; in vec2 v_position; float wrap(float value, float rangeLength) { if(value < 0.0) { float absValue = abs(value); float modValue = mod(absValue, rangeLength); return mod(rangeLength - modValue, rangeLength); } return mod(value, rangeLength); } vec3 wrapVec(vec3 value, float rangeLength) { return vec3(wrap(value.x, rangeLength), wrap(value.y, rangeLength), wrap(value.z, rangeLength)); } vec3 random3(vec3 p) { float dot1 = dot(p, vec3(127.1, 311.7, 932.8)); float dot2 = dot(p, vec3(269.5, 183.3, 421.4)); return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2)); } // Frequency corresponds to cell size. // The higher the frequency, the smaller the cell size. vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) { float textureSliceWidth = u_noiseTextureDimensions.x; vec3 cell = centerCell + offset; cell = wrapVec(cell, textureSliceWidth / u_noiseDetail); cell += floor(u_noiseOffset / u_noiseDetail); vec3 p = offset + random3(cell); return p; } float worleyNoise(vec3 p, float freq) { vec3 centerCell = floor(p * freq); vec3 pointInCell = fract(p * freq); float shortestDistance = 1000.0; for(float z = -1.0; z <= 1.0; z++) { for(float y = -1.0; y <= 1.0; y++) { for(float x = -1.0; x <= 1.0; x++) { vec3 offset = vec3(x, y, z); vec3 point = getWorleyCellPoint(centerCell, offset, freq); float distance = length(pointInCell - point); if(distance < shortestDistance) { shortestDistance = distance; } } } } return shortestDistance; } const float MAX_FBM_ITERATIONS = 10.0; float worleyFBMNoise(vec3 p, float octaves, float scale) { float noise = 0.0; float freq = 1.0; float persistence = 0.625; for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) { if(i >= octaves) { break; } noise += worleyNoise(p * scale, freq * scale) * persistence; persistence *= 0.5; freq *= 2.0; } return noise; } void main() { float textureSliceWidth = u_noiseTextureDimensions.x; float inverseNoiseTextureRows = u_noiseTextureDimensions.z; float x = mod(v_position.x, textureSliceWidth); float y = mod(v_position.y, textureSliceWidth); float sliceRow = floor(v_position.y / textureSliceWidth); float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth; vec3 position = vec3(x, y, z); position /= u_noiseDetail; float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0); float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0); float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0); out_FragColor = vec4(worley0, worley1, worley2, 1.0); } `,UAe=`uniform vec3 u_noiseTextureDimensions; in vec2 position; out vec2 v_position; void main() { gl_Position = vec4(position, 0.1, 1.0); float textureSliceWidth = u_noiseTextureDimensions.x; float noiseTextureRows = u_noiseTextureDimensions.y; float inverseNoiseTextureRows = u_noiseTextureDimensions.z; vec2 transformedPos = (position * 0.5) + vec2(0.5); transformedPos *= textureSliceWidth; transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows; transformedPos.y *= noiseTextureRows; v_position = transformedPos; } `,GAe=`uniform sampler2D u_opaqueDepthTexture; uniform sampler2D u_translucentDepthTexture; in vec2 v_textureCoordinates; void main() { float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r; float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r; translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth); out_FragColor = czm_packDepth(translucentDepth); } `,WAe=`/** * Compositing for Weighted Blended Order-Independent Transparency. See: * - http://jcgt.org/published/0002/02/09/ * - http://casual-effects.blogspot.com/2014/03/weighted-blended-order-independent.html */ uniform sampler2D u_opaque; uniform sampler2D u_accumulation; uniform sampler2D u_revealage; in vec2 v_textureCoordinates; void main() { vec4 opaque = texture(u_opaque, v_textureCoordinates); vec4 accum = texture(u_accumulation, v_textureCoordinates); float r = texture(u_revealage, v_textureCoordinates).r; #ifdef MRT vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a); #else vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r); #endif out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque; if (opaque != czm_backgroundColor) { out_FragColor.a = 1.0; } } `,jAe=`in vec4 positionEC; void main() { vec3 position; vec3 direction; if (czm_orthographicIn3D == 1.0) { vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw; vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y); // left, bottom vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x); // right, top position = vec3(mix(minPlane, maxPlane, uv), 0.0); direction = vec3(0.0, 0.0, -1.0); } else { position = vec3(0.0); direction = normalize(positionEC.xyz); } czm_ray ray = czm_ray(position, direction); vec3 ellipsoid_center = czm_view[3].xyz; czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); if (!czm_isEmpty(intersection)) { out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); } else { discard; } czm_writeLogDepth(); } `,YAe=`in vec4 position; out vec4 positionEC; void main() { positionEC = czm_modelView * position; gl_Position = czm_projection * positionEC; czm_vertexLogDepth(); } `,vte=`uniform vec3 u_radii; uniform vec3 u_oneOverEllipsoidRadiiSquared; in vec3 v_positionEC; vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) { vec3 positionEC = czm_pointAlongRay(ray, intersection); vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz; vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared)); vec3 sphericalNormal = normalize(positionMC / u_radii); vec3 normalMC = geodeticNormal * side; // normalized surface normal (always facing the viewer) in model coordinates vec3 normalEC = normalize(czm_normal * normalMC); // normalized surface normal in eye coordiantes vec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal); vec3 positionToEyeEC = -positionEC; czm_materialInput materialInput; materialInput.s = st.s; materialInput.st = st; materialInput.str = (positionMC + u_radii) / u_radii; materialInput.normalEC = normalEC; materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC); materialInput.positionToEyeEC = positionToEyeEC; czm_material material = czm_getMaterial(materialInput); #ifdef ONLY_SUN_LIGHTING return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC); #else return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } void main() { // PERFORMANCE_TODO: When dynamic branching is available, compute ratio of maximum and minimum radii // in the vertex shader. Only when it is larger than some constant, march along the ray. // Otherwise perform one intersection test which will be the common case. // Test if the ray intersects a sphere with the ellipsoid's maximum radius. // For very oblate ellipsoids, using the ellipsoid's radii for an intersection test // may cause false negatives. This will discard fragments before marching the ray forward. float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5; vec3 direction = normalize(v_positionEC); vec3 ellipsoidCenter = czm_modelView[3].xyz; float t1 = -1.0; float t2 = -1.0; float b = -2.0 * dot(direction, ellipsoidCenter); float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius; float discriminant = b * b - 4.0 * c; if (discriminant >= 0.0) { t1 = (-b - sqrt(discriminant)) * 0.5; t2 = (-b + sqrt(discriminant)) * 0.5; } if (t1 < 0.0 && t2 < 0.0) { discard; } float t = min(t1, t2); if (t < 0.0) { t = 0.0; } // March ray forward to intersection with larger sphere and find czm_ray ray = czm_ray(t * direction, direction); vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z); czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii); if (czm_isEmpty(intersection)) { discard; } // If the viewer is outside, compute outsideFaceColor, with normals facing outward. vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0); // If the viewer either is inside or can see inside, compute insideFaceColor, with normals facing inward. vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0); out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a); out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a); #if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth))) t = (intersection.start != 0.0) ? intersection.start : intersection.stop; vec3 positionEC = czm_pointAlongRay(ray, t); vec4 positionCC = czm_projection * vec4(positionEC, 1.0); #ifdef LOG_DEPTH czm_writeLogDepth(1.0 + positionCC.w); #else float z = positionCC.z / positionCC.w; float n = czm_depthRange.near; float f = czm_depthRange.far; gl_FragDepth = (z * (f - n) + f + n) * 0.5; #endif #endif } `,yte=`in vec3 position; uniform vec3 u_radii; out vec3 v_positionEC; void main() { // In the vertex data, the cube goes from (-1.0, -1.0, -1.0) to (1.0, 1.0, 1.0) in model coordinates. // Scale to consider the radii. We could also do this once on the CPU when using the BoxGeometry, // but doing it here allows us to change the radii without rewriting the vertex data, and // allows all ellipsoids to reuse the same vertex data. vec4 p = vec4(u_radii * position, 1.0); v_positionEC = (czm_modelView * p).xyz; // position in eye coordinates gl_Position = czm_modelViewProjection * p; // position in clip coordinates // With multi-frustum, when the ellipsoid primitive is positioned on the intersection of two frustums // and close to terrain, the terrain (writes depth) in the closest frustum can overwrite part of the // ellipsoid (does not write depth) that was rendered in the farther frustum. // // Here, we clamp the depth in the vertex shader to avoid being overwritten; however, this creates // artifacts since some fragments can be alpha blended twice. This is solved by only rendering // the ellipsoid in the closest frustum to the viewer. gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); czm_vertexLogDepth(); } `;/** * @license * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of NVIDIA CORPORATION nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */var qAe=`/** * @license * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of NVIDIA CORPORATION nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS \`\`AS IS'' AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // NVIDIA GameWorks Graphics Samples GitHub link: https://github.com/NVIDIAGameWorks/GraphicsSamples // Original FXAA 3.11 shader link: https://github.com/NVIDIAGameWorks/GraphicsSamples/blob/master/samples/es3-kepler/FXAA/FXAA3_11.h // Steps used to integrate into Cesium: // * The following defines are set: // #define FXAA_PC 1 // #define FXAA_WEBGL_1 1 // #define FXAA_GREEN_AS_LUMA 1 // #define FXAA_EARLY_EXIT 1 // #define FXAA_GLSL_120 1 // * All other preprocessor directives besides the FXAA_QUALITY__P* directives were removed. // * Double underscores are invalid for preprocessor directives so replace them with a single underscore. Replace // /FXAA_QUALITY__P(.*)/g with /FXAA_QUALITY__P$1/. // * There are no implicit conversions from ivec* to vec* so replace: // #define FxaaInt2 ivec2 // with // #define FxaaInt2 vec2 // * The texture2DLod function is only available in vertex shaders so replace: // #define FxaaTexTop(t, p) texture2DLod(t, p, 0.0) // #define FxaaTexOff(t, p, o, r) texture2DLod(t, p + (o * r), 0.0) // with // #define FxaaTexTop(t, p) texture(t, p) // #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) // * FXAA_QUALITY_PRESET is prepended in the javascript code. We may want to expose that setting in the future. // * The following parameters to FxaaPixelShader are unused and can be removed: // fxaaConsolePosPos // fxaaConsoleRcpFrameOpt // fxaaConsoleRcpFrameOpt2 // fxaaConsole360RcpFrameOpt2 // fxaaConsoleEdgeSharpness // fxaaConsoleEdgeThreshold // fxaaConsoleEdgeThresholdMi // fxaaConsole360ConstDir // // Choose the quality preset. // This needs to be compiled into the shader as it effects code. // Best option to include multiple presets is to // in each shader define the preset, then include this file. // // OPTIONS // ----------------------------------------------------------------------- // 10 to 15 - default medium dither (10=fastest, 15=highest quality) // 20 to 29 - less dither, more expensive (20=fastest, 29=highest quality) // 39 - no dither, very expensive // // NOTES // ----------------------------------------------------------------------- // 12 = slightly faster then FXAA 3.9 and higher edge quality (default) // 13 = about same speed as FXAA 3.9 and better than 12 // 23 = closest to FXAA 3.9 visually and performance wise // _ = the lowest digit is directly related to performance // _ = the highest digit is directly related to style // //#define FXAA_QUALITY_PRESET 12 #if (FXAA_QUALITY_PRESET == 10) #define FXAA_QUALITY_PS 3 #define FXAA_QUALITY_P0 1.5 #define FXAA_QUALITY_P1 3.0 #define FXAA_QUALITY_P2 12.0 #endif #if (FXAA_QUALITY_PRESET == 11) #define FXAA_QUALITY_PS 4 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 3.0 #define FXAA_QUALITY_P3 12.0 #endif #if (FXAA_QUALITY_PRESET == 12) #define FXAA_QUALITY_PS 5 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 4.0 #define FXAA_QUALITY_P4 12.0 #endif #if (FXAA_QUALITY_PRESET == 13) #define FXAA_QUALITY_PS 6 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 4.0 #define FXAA_QUALITY_P5 12.0 #endif #if (FXAA_QUALITY_PRESET == 14) #define FXAA_QUALITY_PS 7 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 4.0 #define FXAA_QUALITY_P6 12.0 #endif #if (FXAA_QUALITY_PRESET == 15) #define FXAA_QUALITY_PS 8 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 2.0 #define FXAA_QUALITY_P6 4.0 #define FXAA_QUALITY_P7 12.0 #endif #if (FXAA_QUALITY_PRESET == 20) #define FXAA_QUALITY_PS 3 #define FXAA_QUALITY_P0 1.5 #define FXAA_QUALITY_P1 2.0 #define FXAA_QUALITY_P2 8.0 #endif #if (FXAA_QUALITY_PRESET == 21) #define FXAA_QUALITY_PS 4 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 8.0 #endif #if (FXAA_QUALITY_PRESET == 22) #define FXAA_QUALITY_PS 5 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 8.0 #endif #if (FXAA_QUALITY_PRESET == 23) #define FXAA_QUALITY_PS 6 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 8.0 #endif #if (FXAA_QUALITY_PRESET == 24) #define FXAA_QUALITY_PS 7 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 3.0 #define FXAA_QUALITY_P6 8.0 #endif #if (FXAA_QUALITY_PRESET == 25) #define FXAA_QUALITY_PS 8 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 2.0 #define FXAA_QUALITY_P6 4.0 #define FXAA_QUALITY_P7 8.0 #endif #if (FXAA_QUALITY_PRESET == 26) #define FXAA_QUALITY_PS 9 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 2.0 #define FXAA_QUALITY_P6 2.0 #define FXAA_QUALITY_P7 4.0 #define FXAA_QUALITY_P8 8.0 #endif #if (FXAA_QUALITY_PRESET == 27) #define FXAA_QUALITY_PS 10 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 2.0 #define FXAA_QUALITY_P6 2.0 #define FXAA_QUALITY_P7 2.0 #define FXAA_QUALITY_P8 4.0 #define FXAA_QUALITY_P9 8.0 #endif #if (FXAA_QUALITY_PRESET == 28) #define FXAA_QUALITY_PS 11 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 2.0 #define FXAA_QUALITY_P6 2.0 #define FXAA_QUALITY_P7 2.0 #define FXAA_QUALITY_P8 2.0 #define FXAA_QUALITY_P9 4.0 #define FXAA_QUALITY_P10 8.0 #endif #if (FXAA_QUALITY_PRESET == 29) #define FXAA_QUALITY_PS 12 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.5 #define FXAA_QUALITY_P2 2.0 #define FXAA_QUALITY_P3 2.0 #define FXAA_QUALITY_P4 2.0 #define FXAA_QUALITY_P5 2.0 #define FXAA_QUALITY_P6 2.0 #define FXAA_QUALITY_P7 2.0 #define FXAA_QUALITY_P8 2.0 #define FXAA_QUALITY_P9 2.0 #define FXAA_QUALITY_P10 4.0 #define FXAA_QUALITY_P11 8.0 #endif #if (FXAA_QUALITY_PRESET == 39) #define FXAA_QUALITY_PS 12 #define FXAA_QUALITY_P0 1.0 #define FXAA_QUALITY_P1 1.0 #define FXAA_QUALITY_P2 1.0 #define FXAA_QUALITY_P3 1.0 #define FXAA_QUALITY_P4 1.0 #define FXAA_QUALITY_P5 1.5 #define FXAA_QUALITY_P6 2.0 #define FXAA_QUALITY_P7 2.0 #define FXAA_QUALITY_P8 2.0 #define FXAA_QUALITY_P9 2.0 #define FXAA_QUALITY_P10 4.0 #define FXAA_QUALITY_P11 8.0 #endif #define FxaaBool bool #define FxaaFloat float #define FxaaFloat2 vec2 #define FxaaFloat3 vec3 #define FxaaFloat4 vec4 #define FxaaHalf float #define FxaaHalf2 vec2 #define FxaaHalf3 vec3 #define FxaaHalf4 vec4 #define FxaaInt2 vec2 #define FxaaTex sampler2D #define FxaaSat(x) clamp(x, 0.0, 1.0) #define FxaaTexTop(t, p) texture(t, p) #define FxaaTexOff(t, p, o, r) texture(t, p + (o * r)) FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; } FxaaFloat4 FxaaPixelShader( // // Use noperspective interpolation here (turn off perspective interpolation). // {xy} = center of pixel FxaaFloat2 pos, // // Input color texture. // {rgb_} = color in linear or perceptual color space // if (FXAA_GREEN_AS_LUMA == 0) // {___a} = luma in perceptual color space (not linear) FxaaTex tex, // // Only used on FXAA Quality. // This must be from a constant/uniform. // {x_} = 1.0/screenWidthInPixels // {_y} = 1.0/screenHeightInPixels FxaaFloat2 fxaaQualityRcpFrame, // // Only used on FXAA Quality. // This used to be the FXAA_QUALITY_SUBPIX define. // It is here now to allow easier tuning. // Choose the amount of sub-pixel aliasing removal. // This can effect sharpness. // 1.00 - upper limit (softer) // 0.75 - default amount of filtering // 0.50 - lower limit (sharper, less sub-pixel aliasing removal) // 0.25 - almost off // 0.00 - completely off FxaaFloat fxaaQualitySubpix, // // Only used on FXAA Quality. // This used to be the FXAA_QUALITY_EDGE_THRESHOLD define. // It is here now to allow easier tuning. // The minimum amount of local contrast required to apply algorithm. // 0.333 - too little (faster) // 0.250 - low quality // 0.166 - default // 0.125 - high quality // 0.063 - overkill (slower) FxaaFloat fxaaQualityEdgeThreshold, // // Only used on FXAA Quality. // This used to be the FXAA_QUALITY_EDGE_THRESHOLD_MIN define. // It is here now to allow easier tuning. // Trims the algorithm from processing darks. // 0.0833 - upper limit (default, the start of visible unfiltered edges) // 0.0625 - high quality (faster) // 0.0312 - visible limit (slower) // Special notes when using FXAA_GREEN_AS_LUMA, // Likely want to set this to zero. // As colors that are mostly not-green // will appear very dark in the green channel! // Tune by looking at mostly non-green content, // then start at zero and increase until aliasing is a problem. FxaaFloat fxaaQualityEdgeThresholdMin ) { /*--------------------------------------------------------------------------*/ FxaaFloat2 posM; posM.x = pos.x; posM.y = pos.y; FxaaFloat4 rgbyM = FxaaTexTop(tex, posM); #define lumaM rgbyM.y FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy)); FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy)); FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy)); FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy)); /*--------------------------------------------------------------------------*/ FxaaFloat maxSM = max(lumaS, lumaM); FxaaFloat minSM = min(lumaS, lumaM); FxaaFloat maxESM = max(lumaE, maxSM); FxaaFloat minESM = min(lumaE, minSM); FxaaFloat maxWN = max(lumaN, lumaW); FxaaFloat minWN = min(lumaN, lumaW); FxaaFloat rangeMax = max(maxWN, maxESM); FxaaFloat rangeMin = min(minWN, minESM); FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold; FxaaFloat range = rangeMax - rangeMin; FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled); FxaaBool earlyExit = range < rangeMaxClamped; /*--------------------------------------------------------------------------*/ if(earlyExit) return rgbyM; /*--------------------------------------------------------------------------*/ FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy)); FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy)); FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy)); FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy)); /*--------------------------------------------------------------------------*/ FxaaFloat lumaNS = lumaN + lumaS; FxaaFloat lumaWE = lumaW + lumaE; FxaaFloat subpixRcpRange = 1.0/range; FxaaFloat subpixNSWE = lumaNS + lumaWE; FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS; FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE; /*--------------------------------------------------------------------------*/ FxaaFloat lumaNESE = lumaNE + lumaSE; FxaaFloat lumaNWNE = lumaNW + lumaNE; FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE; FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE; /*--------------------------------------------------------------------------*/ FxaaFloat lumaNWSW = lumaNW + lumaSW; FxaaFloat lumaSWSE = lumaSW + lumaSE; FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2); FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2); FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW; FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE; FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4; FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4; /*--------------------------------------------------------------------------*/ FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE; FxaaFloat lengthSign = fxaaQualityRcpFrame.x; FxaaBool horzSpan = edgeHorz >= edgeVert; FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE; /*--------------------------------------------------------------------------*/ if(!horzSpan) lumaN = lumaW; if(!horzSpan) lumaS = lumaE; if(horzSpan) lengthSign = fxaaQualityRcpFrame.y; FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM; /*--------------------------------------------------------------------------*/ FxaaFloat gradientN = lumaN - lumaM; FxaaFloat gradientS = lumaS - lumaM; FxaaFloat lumaNN = lumaN + lumaM; FxaaFloat lumaSS = lumaS + lumaM; FxaaBool pairN = abs(gradientN) >= abs(gradientS); FxaaFloat gradient = max(abs(gradientN), abs(gradientS)); if(pairN) lengthSign = -lengthSign; FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange); /*--------------------------------------------------------------------------*/ FxaaFloat2 posB; posB.x = posM.x; posB.y = posM.y; FxaaFloat2 offNP; offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x; offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y; if(!horzSpan) posB.x += lengthSign * 0.5; if( horzSpan) posB.y += lengthSign * 0.5; /*--------------------------------------------------------------------------*/ FxaaFloat2 posN; posN.x = posB.x - offNP.x * FXAA_QUALITY_P0; posN.y = posB.y - offNP.y * FXAA_QUALITY_P0; FxaaFloat2 posP; posP.x = posB.x + offNP.x * FXAA_QUALITY_P0; posP.y = posB.y + offNP.y * FXAA_QUALITY_P0; FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0; FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN)); FxaaFloat subpixE = subpixC * subpixC; FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP)); /*--------------------------------------------------------------------------*/ if(!pairN) lumaNN = lumaSS; FxaaFloat gradientScaled = gradient * 1.0/4.0; FxaaFloat lumaMM = lumaM - lumaNN * 0.5; FxaaFloat subpixF = subpixD * subpixE; FxaaBool lumaMLTZero = lumaMM < 0.0; /*--------------------------------------------------------------------------*/ lumaEndN -= lumaNN * 0.5; lumaEndP -= lumaNN * 0.5; FxaaBool doneN = abs(lumaEndN) >= gradientScaled; FxaaBool doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1; FxaaBool doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1; /*--------------------------------------------------------------------------*/ if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 3) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 4) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 5) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 6) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 7) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 8) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 9) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 10) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 11) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11; /*--------------------------------------------------------------------------*/ #if (FXAA_QUALITY_PS > 12) if(doneNP) { if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy)); if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy)); if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5; if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5; doneN = abs(lumaEndN) >= gradientScaled; doneP = abs(lumaEndP) >= gradientScaled; if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12; if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12; doneNP = (!doneN) || (!doneP); if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12; if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12; /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } #endif /*--------------------------------------------------------------------------*/ } /*--------------------------------------------------------------------------*/ FxaaFloat dstN = posM.x - posN.x; FxaaFloat dstP = posP.x - posM.x; if(!horzSpan) dstN = posM.y - posN.y; if(!horzSpan) dstP = posP.y - posM.y; /*--------------------------------------------------------------------------*/ FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero; FxaaFloat spanLength = (dstP + dstN); FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero; FxaaFloat spanLengthRcp = 1.0/spanLength; /*--------------------------------------------------------------------------*/ FxaaBool directionN = dstN < dstP; FxaaFloat dst = min(dstN, dstP); FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP; FxaaFloat subpixG = subpixF * subpixF; FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5; FxaaFloat subpixH = subpixG * fxaaQualitySubpix; /*--------------------------------------------------------------------------*/ FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0; FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH); if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); } `,XAe=`uniform vec4 u_initialColor; #if TEXTURE_UNITS > 0 uniform sampler2D u_dayTextures[TEXTURE_UNITS]; uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS]; #ifdef APPLY_ALPHA uniform float u_dayTextureAlpha[TEXTURE_UNITS]; #endif #ifdef APPLY_DAY_NIGHT_ALPHA uniform float u_dayTextureNightAlpha[TEXTURE_UNITS]; uniform float u_dayTextureDayAlpha[TEXTURE_UNITS]; #endif #ifdef APPLY_SPLIT uniform float u_dayTextureSplit[TEXTURE_UNITS]; #endif #ifdef APPLY_BRIGHTNESS uniform float u_dayTextureBrightness[TEXTURE_UNITS]; #endif #ifdef APPLY_CONTRAST uniform float u_dayTextureContrast[TEXTURE_UNITS]; #endif #ifdef APPLY_HUE uniform float u_dayTextureHue[TEXTURE_UNITS]; #endif #ifdef APPLY_SATURATION uniform float u_dayTextureSaturation[TEXTURE_UNITS]; #endif #ifdef APPLY_GAMMA uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS]; #endif #ifdef APPLY_IMAGERY_CUTOUT uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS]; #endif #ifdef APPLY_COLOR_TO_ALPHA uniform vec4 u_colorsToAlpha[TEXTURE_UNITS]; #endif uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS]; #endif #ifdef SHOW_REFLECTIVE_OCEAN uniform sampler2D u_waterMask; uniform vec4 u_waterMaskTranslationAndScale; uniform float u_zoomedOutOceanSpecularIntensity; #endif #ifdef SHOW_OCEAN_WAVES uniform sampler2D u_oceanNormalMap; #endif #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) uniform vec2 u_lightingFadeDistance; #endif #ifdef TILE_LIMIT_RECTANGLE uniform vec4 u_cartographicLimitRectangle; #endif #ifdef GROUND_ATMOSPHERE uniform vec2 u_nightFadeDistance; #endif #ifdef ENABLE_SLOPE_MAP uniform sampler2D u_slopeColorsTexture; #endif #ifdef ENABLE_CLIPPING_PLANES uniform highp sampler2D u_clippingPlanes; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; #endif #ifdef SHOW_CONTOUR_LINE uniform sampler2D u_contourLineTexture; uniform vec4 u_contourLineTranslationAndScale; #endif #if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) uniform float u_minimumBrightness; #endif #ifdef COLOR_CORRECT uniform vec3 u_hsbShift; // Hue, saturation, brightness #endif #ifdef HIGHLIGHT_FILL_TILE uniform vec4 u_fillHighlightColor; #endif #ifdef TRANSLUCENT uniform vec4 u_frontFaceAlphaByDistance; uniform vec4 u_backFaceAlphaByDistance; uniform vec4 u_translucencyRectangle; #endif #ifdef UNDERGROUND_COLOR uniform vec4 u_undergroundColor; uniform vec4 u_undergroundColorAlphaByDistance; #endif #ifdef ENABLE_VERTEX_LIGHTING uniform float u_lambertDiffuseMultiplier; uniform float u_vertexShadowDarkness; #endif #ifdef SHOW_GRATICULES uniform vec4 u_graticuleTranslationAndScale; uniform float u_widthHeight; uniform vec4 u_graticulesColor; #endif in vec3 v_positionMC; in vec3 v_positionEC; in vec3 v_textureCoordinates; in vec3 v_normalMC; in vec3 v_normalEC; #ifdef APPLY_MATERIAL in float v_slope; in float v_aspect; #endif #ifdef APPLY_FLATTEN uniform bool u_bFlatten; uniform bool u_clipPlaneOfFlatten; #endif #ifdef REGION_WEATHER uniform bool u_ripple; uniform bool u_regionSnow; uniform float u_regionAlpha; uniform float u_regionGradientDistance; uniform bool u_heightFog; uniform float u_fogHeight; #endif #if defined(APPLY_FLATTEN) || defined(REGION_WEATHER) in vec3 v_scopePosition; uniform mat4 u_r_eastNorthUpToFixedFrameA; uniform vec4 u_polygonBounds; uniform sampler2D u_polygonTexture; #endif #if defined(APPLY_MATERIAL) || defined(APPLY_FLATTEN) || defined(REGION_WEATHER) in float v_height; #endif #ifdef APPLY_SLOPE_REGION uniform sampler2D u_regionRectTexture; #endif #ifdef APPLY_SLOPE_ARROW uniform sampler2D u_normalTexture; uniform vec4 u_normalTextureTranslationAndScale; uniform sampler2D u_arrowTexture; #endif // \u5728\u8303\u56F4\u5185 bool isPointInBound(vec4 point, vec4 bounds) { return (point.x>bounds.x && point.xbounds.w); } float unpackDepth(const in vec4 rgba_depth) { // \u89E3\u7801\u6DF1\u5EA6 const vec4 bitShifts = vec4(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0), 1.0 / (255.0 * 255.0 * 255.0)); float depth=dot(rgba_depth, bitShifts); return depth; } uniform float u_tileLevel; #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) in float v_distance; #endif #if defined(GROUND_ATMOSPHERE) || defined(FOG) in vec3 v_atmosphereRayleighColor; in vec3 v_atmosphereMieColor; in float v_atmosphereOpacity; #endif #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; float endDistance = nearFarScalar.z; float endValue = nearFarScalar.w; float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); return mix(startValue, endValue, t); } #endif #if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL) vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) { return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); } #endif #ifdef TRANSLUCENT bool inTranslucencyRectangle() { return v_textureCoordinates.x > u_translucencyRectangle.x && v_textureCoordinates.x < u_translucencyRectangle.z && v_textureCoordinates.y > u_translucencyRectangle.y && v_textureCoordinates.y < u_translucencyRectangle.w; } #endif vec4 sampleAndBlend( vec4 previousColor, sampler2D textureToSample, vec2 tileTextureCoordinates, vec4 textureCoordinateRectangle, vec4 textureCoordinateTranslationAndScale, float textureAlpha, float textureNightAlpha, float textureDayAlpha, float textureBrightness, float textureContrast, float textureHue, float textureSaturation, float textureOneOverGamma, float split, vec4 colorToAlpha, float nightBlend) { // This crazy step stuff sets the alpha to 0.0 if this following condition is true: // tileTextureCoordinates.s < textureCoordinateRectangle.s || // tileTextureCoordinates.s > textureCoordinateRectangle.p || // tileTextureCoordinates.t < textureCoordinateRectangle.t || // tileTextureCoordinates.t > textureCoordinateRectangle.q // In other words, the alpha is zero if the fragment is outside the rectangle // covered by this texture. Would an actual 'if' yield better performance? vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates); textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates); textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y; #if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend); #endif vec2 translation = textureCoordinateTranslationAndScale.xy; vec2 scale = textureCoordinateTranslationAndScale.zw; vec2 textureCoordinates = tileTextureCoordinates * scale + translation; vec4 value = texture(textureToSample, textureCoordinates); vec3 color = value.rgb; float alpha = value.a; #ifdef APPLY_COLOR_TO_ALPHA vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb); colorDiff.r = max(max(colorDiff.r, colorDiff.g), colorDiff.b); alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha); #endif #if !defined(APPLY_GAMMA) vec4 tempColor = czm_gammaCorrect(vec4(color, alpha)); color = tempColor.rgb; alpha = tempColor.a; #else color = pow(color, vec3(textureOneOverGamma)); #endif #ifdef APPLY_SPLIT float splitPosition = czm_splitPosition; // Split to the left if (split < 0.0 && gl_FragCoord.x > splitPosition) { alpha = 0.0; } // Split to the right else if (split > 0.0 && gl_FragCoord.x < splitPosition) { alpha = 0.0; } #endif #ifdef APPLY_BRIGHTNESS color = mix(vec3(0.0), color, textureBrightness); #endif #ifdef APPLY_CONTRAST color = mix(vec3(0.5), color, textureContrast); #endif #ifdef APPLY_HUE color = czm_hue(color, textureHue); #endif #ifdef APPLY_SATURATION color = czm_saturation(color, textureSaturation); #endif float sourceAlpha = alpha * textureAlpha; float outAlpha = mix(previousColor.a, 1.0, sourceAlpha); outAlpha += sign(outAlpha) - 1.0; vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha; // When rendering imagery for a tile in multiple passes, // some GPU/WebGL implementation combinations will not blend fragments in // additional passes correctly if their computation includes an unmasked // divide-by-zero operation, // even if it's not in the output or if the output has alpha zero. // // For example, without sanitization for outAlpha, // this renders without artifacts: // if (outAlpha == 0.0) { outColor = vec3(0.0); } // // but using czm_branchFreeTernary will cause portions of the tile that are // alpha-zero in the additional pass to render as black instead of blending // with the previous pass: // outColor = czm_branchFreeTernary(outAlpha == 0.0, vec3(0.0), outColor); // // So instead, sanitize against divide-by-zero, // store this state on the sign of outAlpha, and correct on return. return vec4(outColor, max(outAlpha, 0.0)); } vec3 colorCorrect(vec3 rgb) { #ifdef COLOR_CORRECT // Convert rgb color to hsb vec3 hsb = czm_RGBToHSB(rgb); // Perform hsb shift hsb.x += u_hsbShift.x; // hue hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness // Convert shifted hsb back to rgb rgb = czm_HSBToRGB(hsb); #endif return rgb; } vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend); vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade); const float fExposure = 2.0; vec3 computeEllipsoidPosition() { float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0); vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0); xy *= czm_viewport.zw * mpp * 0.5; vec3 direction = normalize(vec3(xy, -czm_currentFrustum.x)); czm_ray ray = czm_ray(vec3(0.0), direction); vec3 ellipsoid_center = czm_view[3].xyz; czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii); vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start); return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz; } #ifdef APPLY_FLATTEN float regionGradient(vec4 point, vec4 bounds, float distance) { float rate1 = min((point.x - bounds.x) / distance, (bounds.z - point.x) / distance); float rate2 = min((point.y - bounds.w) / distance, (bounds.y - point.y) / distance); float rate = smoothstep(0.0, 1.0, rate1 * rate2); return rate; } #endif #define MAX_RADIUS 2 #define DOUBLE_HASH 0 #define HASHSCALE1 .1031 #define HASHSCALE3 vec3(.1031, .1030, .0973) float hash12(vec2 p) { vec3 p3 = fract(vec3(p.xyx) * HASHSCALE1); p3 += dot(p3, p3.yzx + 19.19); return fract((p3.x + p3.y) * p3.z); } vec2 hash22(vec2 p) { vec3 p3 = fract(vec3(p.xyx) * HASHSCALE3); p3 += dot(p3, p3.yzx+19.19); return fract((p3.xx+p3.yz)*p3.zy); } void rippleImage( out vec4 fragColor, in vec2 fragCoord, float tileLevel ) { float iTime = czm_frameNumber / 30.0; vec2 uv = fragCoord.xy * 10.0 * tileLevel; vec2 p0 = floor(uv); vec2 circles = vec2(0.); for (int j = -MAX_RADIUS; j <= MAX_RADIUS; ++j) { for (int i = -MAX_RADIUS; i <= MAX_RADIUS; ++i) { vec2 pi = p0 + vec2(i, j); #if DOUBLE_HASH vec2 hsh = hash22(pi); #else vec2 hsh = pi; #endif vec2 p = pi + hash22(hsh); float t = fract(0.8*iTime + hash12(hsh)); vec2 v = p - uv; float d = length(v) - (float(MAX_RADIUS) + 1.)*t; float h = 1e-3; float d1 = d - h; float d2 = d + h; float p1 = sin(31.*d1) * smoothstep(-0.6, -0.3, d1) * smoothstep(0., -0.3, d1); float p2 = sin(31.*d2) * smoothstep(-0.6, -0.3, d2) * smoothstep(0., -0.3, d2); circles += 0.5 * normalize(v) * ((p2 - p1) / (2. * h) * (1. - t) * (1. - t)); } } circles /= float((MAX_RADIUS*2+1)*(MAX_RADIUS*2+1)); float intensity = mix(0.01, 0.15, smoothstep(0.1, 0.6, abs(fract(0.05*iTime + 0.5)*2.-1.))); vec3 n = vec3(circles, sqrt(1. - dot(circles, circles))); vec3 color = vec3(0.0) + 5.*pow(clamp(dot(n, normalize(vec3(1., 0.7, 0.5))), 0., 1.), 6.); fragColor = vec4(color, 1.0); } void main() { #ifdef TILE_LIMIT_RECTANGLE if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x || v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y) { discard; } #endif #ifdef ENABLE_CLIPPING_PLANES float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix); #endif #if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR) vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)); // normalized surface normal in model coordinates vec3 normalEC = czm_normal3D * normalMC; // normalized surface normal in eye coordiantes #endif #if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING) float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0); #else float nightBlend = 0.0; #endif // The clamp below works around an apparent bug in Chrome Canary v23.0.1241.0 // where the fragment shader sees textures coordinates < 0.0 and > 1.0 for the // fragments on the edges of tiles even though the vertex shader is outputting // coordinates strictly in the 0-1 range. vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend); #ifdef SHOW_TILE_BOUNDARIES if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) || v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0)) { color = vec4(1.0, 0.0, 0.0, 1.0); } #endif #if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE) float cameraDist; if (czm_sceneMode == czm_sceneMode2D) { cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5; } else if (czm_sceneMode == czm_sceneModeColumbusView) { cameraDist = -czm_view[3].z; } else { cameraDist = length(czm_view[3]); } float fadeOutDist = u_lightingFadeDistance.x; float fadeInDist = u_lightingFadeDistance.y; if (czm_sceneMode != czm_sceneMode3D) { vec3 radii = czm_ellipsoidRadii; float maxRadii = max(radii.x, max(radii.y, radii.z)); fadeOutDist -= maxRadii; fadeInDist -= maxRadii; } float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0); #else float fade = 0.0; #endif #ifdef SHOW_REFLECTIVE_OCEAN vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy; vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw; vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation; waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y; float mask = texture(u_waterMask, waterMaskTextureCoordinates).r; if (mask > 0.0) { mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC); vec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC); vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx); vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z)); color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade); } #endif #ifdef SHOW_CONTOUR_LINE vec2 contourLineTranslation = u_contourLineTranslationAndScale.xy; vec2 contourLineScale = u_contourLineTranslationAndScale.zw; vec2 contourLineTextureCoordinates = v_textureCoordinates.xy * contourLineScale + contourLineTranslation; //contourLineTextureCoordinates.y = 1.0 - contourLineTextureCoordinates.y; vec4 contourLineColor = texture(u_contourLineTexture, contourLineTextureCoordinates); if( (contourLineColor.r > 0.0 && contourLineColor.r < 1.0) && (contourLineColor.g > 0.0 && contourLineColor.g < 1.0) && (contourLineColor.b > 0.0 && contourLineColor.b < 1.0) ){ color = contourLineColor; } #endif #ifdef SHOW_GRATICULES vec2 graticuleTranslation = u_graticuleTranslationAndScale.xy; vec2 graticuleScale = u_graticuleTranslationAndScale.zw; vec2 graticuleCoordinates = v_textureCoordinates.xy * graticuleScale + graticuleTranslation; vec4 position = czm_windowToEyeCoordinates(gl_FragCoord); float pixelWidth = czm_metersPerPixel(position); bool flag = false; int sizeX = int(graticuleTranslation.x + graticuleScale.x) + 1; for(int ii=0; ii 1.0) { discard; } } } } #endif vec4 rippleColor = vec4(0.0); #ifdef REGION_WEATHER if(u_ripple || u_regionSnow || u_heightFog) { // \u53D8\u6362\u5230\u4E16\u754C\u4F4D\u7F6E\uFF0C\u7136\u540E\u53C8\u5230 vec4 m_position = u_r_eastNorthUpToFixedFrameA *vec4(v_scopePosition, 1.0); // \u662F\u5426\u5728\u8303\u56F4\u5185 if (isPointInBound(m_position, u_polygonBounds)) { vec2 texCoord; texCoord.x = (m_position.x-u_polygonBounds.x)/(u_polygonBounds.z-u_polygonBounds.x); texCoord.y = (m_position.y-u_polygonBounds.w)/(u_polygonBounds.y-u_polygonBounds.w); // \u56FE\u7247\u5927\u5C0F\u662F float texelSize = 1.0/4096.0; // \u89E3\u7801\u6DF1\u5EA6 float depth0 = unpackDepth(texture(u_polygonTexture, texCoord.xy)); float depth1 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(-texelSize, 0.0))); float depth2 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(texelSize, 0.0))); float depth3 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, -texelSize))); float depth4 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, texelSize))); // \u83B7\u53D6\u6700\u5C0F\u7684\u6DF1\u5EA6 float minDepth = min(min(min(min(depth0, depth1), depth2), depth3), depth4); if (minDepth*5000.0 > 1.0) { float rate = regionGradient(m_position, u_polygonBounds, u_regionGradientDistance); if(u_ripple){ vec4 fragColor; rippleImage(fragColor, v_textureCoordinates.xy, u_tileLevel); rippleColor.rgb = fragColor.rgb; rippleColor.a = u_regionAlpha * rate; } else if(u_regionSnow){ rippleColor = vec4(vec3(0.8), u_regionAlpha * rate); } else if(u_heightFog){ if(v_height < u_fogHeight){ rippleColor = vec4(vec3(0.8), clamp(v_height / u_fogHeight, 0.2, 1.0) * u_regionAlpha); } rippleColor.a *= rate; } } } } #endif // \u805A\u5149\u706F --begin #ifdef APPLY_SPOT vec3 spotMaterialColor = czm_getMaterial_spot(v_positionEC, color.rgb); color = vec4(spotMaterialColor.xyz, color.a); #endif // \u805A\u5149\u706F --end // \u70B9\u5149\u6E90 --begin #ifdef APPLY_POINT vec3 spotMaterialColor = czm_getMaterial_point(v_positionEC, color.rgb); color = vec4(spotMaterialColor.xyz, color.a); #endif // \u70B9\u5149\u6E90 --end #ifdef ENABLE_VERTEX_LIGHTING float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0); vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); #elif defined(ENABLE_DAYNIGHT_SHADING) float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0); diffuseIntensity = mix(1.0, diffuseIntensity, fade); vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a); #else vec4 finalColor = color; #endif // SmartEarth \u4FEE\u6539 \u5761\u5EA6\u5206\u6790 #ifdef ENABLE_SLOPE_MAP #ifdef SMOOTH_SLOPE_AT_HIGHER_ALT finalColor = vec4(texture(u_slopeColorsTexture, vec2(0., 1.)).rgb * 0.5 + color.rgb * 0.5, 1.); #else vec3 ellipsoidNormal = normalize(v_positionMC.xyz); float n; if(v_normalMC.r >= 123.456 - 1.0 && v_normalMC.r <= 123.456 + 1.0){ out_FragColor = vec4(vec3(0.66) * 0.5 + finalColor.rgb * 0.5, 1.0); return; }else{ n = abs(dot(v_normalMC, ellipsoidNormal)); } vec3 texColor = texture(u_slopeColorsTexture, vec2(0., n)).rgb; finalColor = vec4(texColor * 0.5 + color.rgb * 0.5, 1.); #endif #endif // SmartEarth \u4FEE\u6539 \u5761\u5EA6\u5206\u6790 #ifdef ENABLE_CLIPPING_PLANES vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb; float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a; if (clipDistance < clippingPlanesEdgeWidth) { finalColor = clippingPlanesEdgeColor; } #endif #ifdef HIGHLIGHT_FILL_TILE finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a); #endif #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) vec3 atmosphereLightDirection = czm_sunDirectionWC; #else vec3 atmosphereLightDirection = czm_lightDirectionWC; #endif #if defined(GROUND_ATMOSPHERE) || defined(FOG) if (!czm_backFacing()) { bool dynamicLighting = false; #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) dynamicLighting = true; #endif vec3 rayleighColor; vec3 mieColor; float opacity; vec3 positionWC; vec3 lightDirection; // When the camera is far away (camera distance > nightFadeOutDistance), the scattering is computed in the fragment shader. // Otherwise, the scattering is computed in the vertex shader. #ifdef PER_FRAGMENT_GROUND_ATMOSPHERE positionWC = computeEllipsoidPosition(); lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); computeAtmosphereScattering( positionWC, lightDirection, rayleighColor, mieColor, opacity ); #else positionWC = v_positionMC; lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC)); rayleighColor = v_atmosphereRayleighColor; mieColor = v_atmosphereMieColor; opacity = v_atmosphereOpacity; #endif rayleighColor = colorCorrect(rayleighColor); mieColor = colorCorrect(mieColor); vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity); // Fog is applied to tiles selected for fog, close to the Earth. #ifdef FOG vec3 fogColor = groundAtmosphereColor.rgb; // If there is lighting, apply that to the fog. #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0); fogColor *= darken; #endif #ifndef HDR fogColor.rgb = czm_acesTonemapping(fogColor.rgb); fogColor.rgb = czm_inverseGamma(fogColor.rgb); #endif const float modifier = 0.15; finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, modifier), finalColor.a); #else // The transmittance is based on optical depth i.e. the length of segment of the ray inside the atmosphere. // This value is larger near the "circumference", as it is further away from the camera. We use it to // brighten up that area of the ground atmosphere. const float transmittanceModifier = 0.5; float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0); vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance; #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING)) float fadeInDist = u_nightFadeDistance.x; float fadeOutDist = u_nightFadeDistance.y; float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0); float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0); vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken); finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity); #endif #ifndef HDR finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb); #else finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6); #endif finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade); #endif } #endif #ifdef UNDERGROUND_COLOR if (czm_backFacing()) { float distanceFromEllipsoid = max(czm_eyeHeight, 0.0); float distance = max(v_distance - distanceFromEllipsoid, 0.0); float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance); vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount); finalColor = alphaBlend(undergroundColor, finalColor); } #endif #ifdef TRANSLUCENT if (inTranslucencyRectangle()) { vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance; finalColor.a *= interpolateByDistance(alphaByDistance, v_distance); } #endif finalColor.rgb = mix(finalColor.rgb, rippleColor.rgb, rippleColor.a); // \u5761\u5EA6\u7BAD\u5934 #if defined(APPLY_SLOPE_REGION) && defined(APPLY_SLOPE_ARROW) vec4 regionRectTexture = texture(u_regionRectTexture, v_textureCoordinates.xy); if(regionRectTexture.r < 0.1){ vec2 normalTextureTranslation = u_normalTextureTranslationAndScale.xy; vec2 normalTextureScale = u_normalTextureTranslationAndScale.zw; vec2 normalTextureCoordinates = v_textureCoordinates.xy * normalTextureScale + normalTextureTranslation; float xCompent = floor(normalTextureCoordinates.x) / normalTextureScale.x; float yCompent = floor(normalTextureCoordinates.y) / normalTextureScale.y; vec4 slopeNormal = texture(u_normalTexture, vec2(xCompent, yCompent)); vec2 nxy_SlopeNormal = normalize(slopeNormal.rg); // x\u8F74\u7EBF\u5411\u91CF nxy_SlopeNormal -= 0.5; nxy_SlopeNormal *= 2.0; nxy_SlopeNormal = normalize(nxy_SlopeNormal); mat2 transformArrow = mat2(nxy_SlopeNormal.x, nxy_SlopeNormal.y, -nxy_SlopeNormal.y, nxy_SlopeNormal.x); // \u6839\u636Ey\u7684\u6B63\u8D1F\u8FDB\u884C\u987A\u65F6\u9488\u8F6C\u8FD8\u662F\u9006\u65F6\u9488\u8F6C vec2 arrowUV = vec2(fract(normalTextureCoordinates.x), fract(normalTextureCoordinates.y)) - vec2(0.5,0.5); vec2 rotateArrowXY = transformArrow * arrowUV + vec2(0.5,0.5); vec4 arrowColor = texture(u_arrowTexture, rotateArrowXY); finalColor.rgb = finalColor.rgb * 0.5 + arrowColor.rgb * 0.5; finalColor.a = 1.0; } #elif defined(APPLY_SLOPE_ARROW) vec2 normalTextureTranslation = u_normalTextureTranslationAndScale.xy; vec2 normalTextureScale = u_normalTextureTranslationAndScale.zw; vec2 normalTextureCoordinates = v_textureCoordinates.xy * normalTextureScale + normalTextureTranslation; float xCompent = floor(normalTextureCoordinates.x) / normalTextureScale.x; float yCompent = floor(normalTextureCoordinates.y) / normalTextureScale.y; vec4 slopeNormal = texture(u_normalTexture, vec2(xCompent, yCompent)); vec2 nxy_SlopeNormal = normalize(slopeNormal.rg); // x\u8F74\u7EBF\u5411\u91CF nxy_SlopeNormal -= 0.5; nxy_SlopeNormal *= 2.0; nxy_SlopeNormal = normalize(nxy_SlopeNormal); mat2 transformArrow = mat2(nxy_SlopeNormal.x, nxy_SlopeNormal.y, -nxy_SlopeNormal.y, nxy_SlopeNormal.x); // \u6839\u636Ey\u7684\u6B63\u8D1F\u8FDB\u884C\u987A\u65F6\u9488\u8F6C\u8FD8\u662F\u9006\u65F6\u9488\u8F6C vec2 arrowUV = vec2(fract(normalTextureCoordinates.x), fract(normalTextureCoordinates.y)) - vec2(0.5,0.5); vec2 rotateArrowXY = transformArrow * arrowUV + vec2(0.5,0.5); vec4 arrowColor = texture(u_arrowTexture, rotateArrowXY); finalColor.rgb = mix(finalColor.rgb, arrowColor.rgb, 0.8); #endif out_FragColor = finalColor; } #ifdef SHOW_REFLECTIVE_OCEAN float waveFade(float edge0, float edge1, float x) { float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); return pow(1.0 - y, 5.0); } float linearFade(float edge0, float edge1, float x) { return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); } // Based on water rendering by Jonas Wagner: // http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog // low altitude wave settings const float oceanFrequencyLowAltitude = 825000.0; const float oceanAnimationSpeedLowAltitude = 0.004; const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0; const float oceanSpecularIntensity = 0.5; // high altitude wave settings const float oceanFrequencyHighAltitude = 125000.0; const float oceanAnimationSpeedHighAltitude = 0.008; const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0; vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade) { vec3 positionToEyeEC = -positionEyeCoordinates; float positionToEyeECLength = length(positionToEyeEC); // The double normalize below works around a bug in Firefox on Android devices. vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC)); // Fade out the waves as the camera moves far from the surface. float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength); #ifdef SHOW_OCEAN_WAVES // high altitude waves float time = czm_frameNumber * oceanAnimationSpeedHighAltitude; vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0); vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude); // low altitude waves time = czm_frameNumber * oceanAnimationSpeedLowAltitude; noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0); vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude); // blend the 2 wave layers based on distance to surface float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength); float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength); vec3 normalTangentSpace = (highAltitudeFade * normalTangentSpaceHighAltitude) + (lowAltitudeFade * normalTangentSpaceLowAltitude); normalTangentSpace = normalize(normalTangentSpace); // fade out the normal perturbation as we move farther from the water surface normalTangentSpace.xy *= waveIntensity; normalTangentSpace = normalize(normalTangentSpace); #else vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0); #endif vec3 normalEC = enuToEye * normalTangentSpace; const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6); // Use diffuse light to highlight the waves float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue; vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade); #ifdef SHOW_OCEAN_WAVES // Where diffuse light is low or non-existent, use wave highlights based solely on // the wave bumpiness and no particular light direction. float tsPerturbationRatio = normalTangentSpace.z; vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity); #else vec3 nonDiffuseHighlight = vec3(0.0); #endif // Add specular highlights in 3D, and in all modes when zoomed in. float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0); float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue); float specular = specularIntensity * surfaceReflectance; #ifdef HDR specular *= 1.4; float e = 0.2; float d = 3.3; float c = 1.7; vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular)); #else vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular; #endif return vec4(color, imageryColor.a); } #endif // #ifdef SHOW_REFLECTIVE_OCEAN `,JAe=`#ifdef QUANTIZATION_BITS12 in vec4 compressed0; in float compressed1; #else in vec4 position3DAndHeight; in vec4 textureCoordAndEncodedNormals; #endif in float skirt; #ifdef GEODETIC_SURFACE_NORMALS in vec3 geodeticSurfaceNormal; #endif #ifdef EXAGGERATION uniform vec2 u_terrainExaggerationAndRelativeHeight; #endif #ifdef APPLY_FLATTEN uniform mat4 u_eastNorthUpToFixedFrame; uniform mat4 u_eastNorthUpToFixedFrameA; uniform mat4 u_r_eastNorthUpToFixedFrame; uniform mat4 u_r_eastNorthUpToFixedFrameA; uniform bool u_bFlatten; uniform vec4 u_polygonBounds; uniform sampler2D u_polygonTexture; uniform float u_minFlattenHeight; uniform bool u_clipPlaneOfFlatten; uniform bool u_ripple; uniform bool u_regionSnow; uniform bool u_heightFog; #endif // \u5730\u5FC3\u4F4D\u7F6E uniform vec3 u_center3D; uniform mat4 u_modifiedModelView; uniform mat4 u_modifiedModelViewProjection; uniform vec4 u_tileRectangle; // Uniforms for 2D Mercator projection uniform vec2 u_southAndNorthLatitude; uniform vec2 u_southMercatorYAndOneOverHeight; out vec3 v_positionMC; out vec3 v_positionEC; out vec3 v_textureCoordinates; out vec3 v_normalMC; out vec3 v_normalEC; #if defined(APPLY_MATERIAL) out float v_slope; out float v_aspect; #endif #if defined(APPLY_FLATTEN) || defined(REGION_WEATHER) out vec3 v_scopePosition; #endif #if defined(APPLY_MATERIAL) || defined(APPLY_FLATTEN) out float v_height; #endif #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) out float v_distance; #endif #if defined(FOG) || defined(GROUND_ATMOSPHERE) out vec3 v_atmosphereRayleighColor; out vec3 v_atmosphereMieColor; out float v_atmosphereOpacity; #endif // These functions are generated at runtime. vec4 getPosition(vec3 position, float height, vec2 textureCoordinates); float get2DYPositionFraction(vec2 textureCoordinates); vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates) { return u_modifiedModelViewProjection * vec4(position, 1.0); } float get2DMercatorYPositionFraction(vec2 textureCoordinates) { // The width of a tile at level 11, in radians and assuming a single root tile, is // 2.0 * czm_pi / pow(2.0, 11.0) // We want to just linearly interpolate the 2D position from the texture coordinates // when we're at this level or higher. The constant below is the expression // above evaluated and then rounded up at the 4th significant digit. const float maxTileWidth = 0.003068; float positionFraction = textureCoordinates.y; float southLatitude = u_southAndNorthLatitude.x; float northLatitude = u_southAndNorthLatitude.y; if (northLatitude - southLatitude > maxTileWidth) { float southMercatorY = u_southMercatorYAndOneOverHeight.x; float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y; float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y); currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude); positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight); } return positionFraction; } float get2DGeographicYPositionFraction(vec2 textureCoordinates) { return textureCoordinates.y; } vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates) { float yPositionFraction = get2DYPositionFraction(textureCoordinates); vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); return u_modifiedModelViewProjection * rtcPosition2D; } vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates) { return getPositionPlanarEarth(position, 0.0, textureCoordinates); } vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates) { return getPositionPlanarEarth(position, height, textureCoordinates); } vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates) { // We do not do RTC while morphing, so there is potential for jitter. // This is unlikely to be noticeable, though. vec3 position3DWC = position + u_center3D; float yPositionFraction = get2DYPositionFraction(textureCoordinates); vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0); vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime); return czm_modelViewProjection * morphPosition; } // \u5728\u8303\u56F4\u5185 bool isPointInBound(vec4 point, vec4 bounds) { return (point.x>bounds.x && point.xbounds.w); } float unpackDepth(const in vec4 rgba_depth) { // \u89E3\u7801\u6DF1\u5EA6 const vec4 bitShifts = vec4(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0), 1.0 / (255.0 * 255.0 * 255.0)); float depth=dot(rgba_depth, bitShifts); return depth; } #ifdef QUANTIZATION_BITS12 uniform vec2 u_minMaxHeight; uniform mat4 u_scaleAndBias; #endif void main() { #ifdef QUANTIZATION_BITS12 vec2 xy = czm_decompressTextureCoordinates(compressed0.x); vec2 zh = czm_decompressTextureCoordinates(compressed0.y); vec3 position = vec3(xy, zh.x); float height = zh.y; vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z); height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x; position = (u_scaleAndBias * vec4(position, 1.0)).xyz; #if defined(ENABLE_SLOPE_MAP) || ((defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y)) float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; float encodedNormal = compressed1; #elif defined(INCLUDE_WEB_MERCATOR_Y) float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x; float encodedNormal = 0.0; #elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) float webMercatorT = textureCoordinates.y; float encodedNormal = compressed0.w; #else float webMercatorT = textureCoordinates.y; float encodedNormal = 0.0; #endif #else // A single float per element vec3 position = position3DAndHeight.xyz; float height = position3DAndHeight.w; vec2 textureCoordinates = textureCoordAndEncodedNormals.xy; #if defined(ENABLE_SLOPE_MAP) || ((defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)) float webMercatorT = textureCoordAndEncodedNormals.z; float encodedNormal = textureCoordAndEncodedNormals.w; #elif defined(ENABLE_SLOPE_MAP) || defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) float webMercatorT = textureCoordinates.y; float encodedNormal = textureCoordAndEncodedNormals.z; #elif defined(INCLUDE_WEB_MERCATOR_Y) float webMercatorT = textureCoordAndEncodedNormals.z; float encodedNormal = 0.0; #else float webMercatorT = textureCoordinates.y; float encodedNormal = 0.0; #endif #endif vec3 position3DWC = position + u_center3D; #ifdef GEODETIC_SURFACE_NORMALS vec3 ellipsoidNormal = geodeticSurfaceNormal; #else vec3 ellipsoidNormal = normalize(position3DWC); #endif // \u5904\u7406\u5730\u5F62\u5938\u5F20 #if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) // \u5938\u5F20\u6BD4\u4F8B float exaggeration = u_terrainExaggerationAndRelativeHeight.x; // \u5938\u5F20\u76F8\u5BF9\u9AD8\u5EA6 float relativeHeight = u_terrainExaggerationAndRelativeHeight.y; // \u5728\u6B64\u76F8\u5BF9\u9AD8\u5EA6\u5904\u8FDB\u884C\u5938\u5F20 float newHeight = (height - relativeHeight) * exaggeration + relativeHeight; // stop from going through center of earth // \u6700\u5C0F\u534A\u5F84 float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z); // \u5938\u5F20\u9AD8\u5EA6\u4E0D\u80FD\u7A7F\u8D8A\u6700\u5C0F\u5730\u7403\u534A\u5F84 newHeight = max(newHeight, -minRadius); // \u8BA1\u7B97\u504F\u79FB vec3 offset = ellipsoidNormal * (newHeight - height); // \u5F53\u524D\u4F4D\u7F6E\u589E\u52A0\u504F\u79FB position += offset; // \u5F53\u524D\u4F4D\u7F6E\u4E16\u754C\u5750\u6807\u589E\u52A0\u504F\u79FB position3DWC += offset; // \u65B0\u7684\u9AD8\u5EA6 height = newHeight; #endif #ifdef APPLY_FLATTEN if (u_bFlatten && !u_clipPlaneOfFlatten && !u_ripple && !u_regionSnow && !u_heightFog ) { // \u53D8\u6362\u5230\u4E16\u754C\u4F4D\u7F6E\uFF0C\u7136\u540E\u53C8\u5230 vec4 m_position = u_r_eastNorthUpToFixedFrameA *vec4(position, 1.0); // \u662F\u5426\u5728\u8303\u56F4\u5185 if (isPointInBound(m_position, u_polygonBounds)) { vec2 texCoord; // texCoord.x = (m_position.x-u_polygonBounds.x)/(u_polygonBounds.z-u_polygonBounds.x); texCoord.y = (m_position.y-u_polygonBounds.w)/(u_polygonBounds.y-u_polygonBounds.w); // \u56FE\u7247\u5927\u5C0F\u662F float texelSize = 1.0/4096.0; // \u89E3\u7801\u6DF1\u5EA6 float depth0 = unpackDepth(texture(u_polygonTexture, texCoord.xy)); float depth1 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(-texelSize, 0.0))); float depth2 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(texelSize, 0.0))); float depth3 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, -texelSize))); float depth4 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, texelSize))); // \u83B7\u53D6\u6700\u5C0F\u7684\u6DF1\u5EA6 float minDepth = min(min(min(min(depth0, depth1), depth2), depth3), depth4); if (minDepth*5000.0 > 1.0) { float depth = max(max(max(max(depth0, depth1), depth2), depth3), depth4); m_position.z = depth*5000.0 + m_position.z * 0.00001; } vec4 offset_Position = u_eastNorthUpToFixedFrameA * m_position - vec4(position, 1.0); position += offset_Position.xyz; position3DWC += offset_Position.xyz; if(skirt > 0.0) { position += ellipsoidNormal * u_minFlattenHeight; position3DWC += ellipsoidNormal * u_minFlattenHeight; } } } else { if (u_bFlatten && u_clipPlaneOfFlatten) { v_scopePosition = position ; } } #endif #ifdef REGION_WEATHER v_scopePosition = position ; #endif // \u8BA1\u7B97\u4F4D\u7F6E gl_Position = getPosition(position, height, textureCoordinates); v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; v_positionMC = position3DWC; // position in model coordinates v_textureCoordinates = vec3(textureCoordinates, webMercatorT); // SmartEarth \u6539 \u5761\u5EA6\u5206\u6790 #if defined(ENABLE_SLOPE_MAP) || defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL) v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz; v_positionMC = position3DWC; // SmartEarth \u6539 end vec3 normalMC = czm_octDecode(encodedNormal); #if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS) vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal; vec3 rejection = normalMC - projection; normalMC = normalize(projection + rejection * exaggeration); #endif v_normalMC = normalMC; v_normalEC = czm_normal3D * v_normalMC; #endif #if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE)) bool dynamicLighting = false; #if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING)) dynamicLighting = true; #endif #if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN) vec3 atmosphereLightDirection = czm_sunDirectionWC; #else vec3 atmosphereLightDirection = czm_lightDirectionWC; #endif vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC)); computeAtmosphereScattering( position3DWC, lightDirection, v_atmosphereRayleighColor, v_atmosphereMieColor, v_atmosphereOpacity ); #endif #if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz); #endif #ifdef APPLY_MATERIAL float northPoleZ = czm_ellipsoidRadii.z; vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ); vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal)); float dotProd = abs(dot(ellipsoidNormal, v_normalMC)); v_slope = acos(dotProd); vec3 normalRejected = ellipsoidNormal * dotProd; vec3 normalProjected = v_normalMC - normalRejected; vec3 aspectVector = normalize(normalProjected); v_aspect = acos(dot(aspectVector, vectorEastMC)); float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal); v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect); #endif #if defined(APPLY_MATERIAL) || defined(APPLY_FLATTEN) v_height = height; #endif } `,xte=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); float atmosphereInnerRadius = length(positionWC); computeScattering( primaryRay, length(cameraToPositionWC), lightDirection, atmosphereInnerRadius, rayleighColor, mieColor, opacity ); } `,KAe=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { out_FragColor = texture(u_texture, v_textureCoordinates); } `,QAe=`in vec4 position; in float webMercatorT; uniform vec2 u_textureDimensions; out vec2 v_textureCoordinates; void main() { v_textureCoordinates = vec2(position.x, webMercatorT); gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); } `,Cte=`float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; float endDistance = nearFarScalar.z; float endValue = nearFarScalar.w; float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); return mix(startValue, endValue, t); } vec3 getLightDirection(vec3 positionWC) { float lightEnum = u_radiiAndDynamicAtmosphereColor.z; vec3 lightDirection = positionWC * float(lightEnum == 0.0) + czm_lightDirectionWC * float(lightEnum == 1.0) + czm_sunDirectionWC * float(lightEnum == 2.0); return normalize(lightDirection); } void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe) { float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z; // Adjustment to the atmosphere radius applied based on the camera height. float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0; float distanceAdjustMax = czm_ellipsoidRadii.x; float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0; float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0); // Since atmosphere scattering assumes the atmosphere is a spherical shell, we compute an inner radius of the atmosphere best fit // for the position on the ellipsoid. float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust; float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust; // Setup the primary ray: from the camera position to the vertex position. vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); underTranslucentGlobe = 0.0; // Brighten the sky atmosphere under the Earth's atmosphere when translucency is enabled. #if defined(GLOBE_TRANSLUCENT) // Check for intersection with the inner radius of the atmopshere. czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust); if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) { // Compute position on globe. vec3 direction = normalize(positionWC); czm_ray ellipsoidRay = czm_ray(positionWC, -direction); czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii); vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start); // Control the color using the camera angle. float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth)); // Control the opacity using the distance from Earth. opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth)); vec3 horizonColor = vec3(0.1, 0.2, 0.3); vec3 nearColor = vec3(0.0); rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity); // Set the traslucent flag to avoid alpha adjustment in computeFinalColor funciton. underTranslucentGlobe = 1.0; return; } #endif computeScattering( primaryRay, length(cameraToPositionWC), lightDirection, atmosphereInnerRadius, rayleighColor, mieColor, opacity ); // Alter the opacity based on how close the viewer is to the ground. // (0.0 = At edge of atmosphere, 1.0 = On ground) float cameraHeight = czm_eyeHeight + atmosphereInnerRadius; float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS; opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0); // Alter alpha based on time of day (0.0 = night , 1.0 = day) float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; opacity *= pow(nightAlpha, 0.5); } `,ZAe=`in vec3 v_outerPositionWC; uniform vec3 u_hsbShift; #ifndef PER_FRAGMENT_ATMOSPHERE in vec3 v_mieColor; in vec3 v_rayleighColor; in float v_opacity; in float v_translucent; #endif void main (void) { vec3 lightDirection = getLightDirection(v_outerPositionWC); vec3 mieColor; vec3 rayleighColor; float opacity; float translucent; #ifdef PER_FRAGMENT_ATMOSPHERE computeAtmosphereScattering( v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity, translucent ); #else mieColor = v_mieColor; rayleighColor = v_rayleighColor; opacity = v_opacity; translucent = v_translucent; #endif vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity); #ifndef HDR color.rgb = czm_acesTonemapping(color.rgb); color.rgb = czm_inverseGamma(color.rgb); #endif #ifdef COLOR_CORRECT // Convert rgb color to hsb vec3 hsb = czm_RGBToHSB(color.rgb); // Perform hsb shift hsb.x += u_hsbShift.x; // hue hsb.y = clamp(hsb.y + u_hsbShift.y, 0.0, 1.0); // saturation hsb.z = hsb.z > czm_epsilon7 ? hsb.z + u_hsbShift.z : 0.0; // brightness // Convert shifted hsb back to rgb color.rgb = czm_HSBToRGB(hsb); #endif // For the parts of the sky atmosphere that are not behind a translucent globe, // we mix in the default opacity so that the sky atmosphere still appears at distance. // This is needed because the opacity in the sky atmosphere is initially adjusted based // on the camera height. if (translucent == 0.0) { color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } out_FragColor = color; } `,$Ae=`in vec4 position; out vec3 v_outerPositionWC; #ifndef PER_FRAGMENT_ATMOSPHERE out vec3 v_mieColor; out vec3 v_rayleighColor; out float v_opacity; out float v_translucent; #endif void main(void) { vec4 positionWC = czm_model * position; vec3 lightDirection = getLightDirection(positionWC.xyz); #ifndef PER_FRAGMENT_ATMOSPHERE computeAtmosphereScattering( positionWC.xyz, lightDirection, v_rayleighColor, v_mieColor, v_opacity, v_translucent ); #endif v_outerPositionWC = positionWC.xyz; gl_Position = czm_modelViewProjection * position; } `,eEe=`uniform samplerCube u_cubeMap; in vec3 v_texCoord; void main() { vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); } `,tEe=`in vec3 position; out vec3 v_texCoord; void main() { vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); gl_Position = czm_projection * vec4(p, 1.0); v_texCoord = position.xyz; } `,iEe=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(u_texture, v_textureCoordinates); out_FragColor = czm_gammaCorrect(color); } `,rEe=`uniform float u_radiusTS; in vec2 v_textureCoordinates; vec2 rotate(vec2 p, vec2 direction) { return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x); } vec4 addBurst(vec2 position, vec2 direction, float lengthScalar) { vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75); float radius = length(rotatedPosition) * lengthScalar; float burst = 1.0 - smoothstep(0.0, 0.55, radius); return vec4(burst); } void main() { float lengthScalar = 2.0 / sqrt(2.0); vec2 position = v_textureCoordinates - vec2(0.5); float radius = length(position) * lengthScalar; float surface = step(radius, u_radiusTS); vec4 color = vec4(vec2(1.0), surface + 0.2, surface); float glow = 1.0 - smoothstep(0.0, 0.55, radius); color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; vec4 burst = vec4(0.0); // The following loop has been manually unrolled for speed, to // avoid sin() and cos(). // //for (float i = 0.4; i < 3.2; i += 1.047) { // vec2 direction = vec2(sin(i), cos(i)); // burst += 0.4 * addBurst(position, direction, lengthScalar); // // direction = vec2(sin(i - 0.08), cos(i - 0.08)); // burst += 0.3 * addBurst(position, direction, lengthScalar); //} burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar); // angle == 0.4 burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar); // angle == 0.4 + 1.047 burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar); // angle == 0.4 + 1.047 * 2.0 burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar); // angle == 0.4 - 0.08 burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar); // angle == 0.4 + 1.047 - 0.08 burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); // angle == 0.4 + 1.047 * 2.0 - 0.08 // End of manual loop unrolling. color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); } `,BZe=`//created by zq uniform float u_radiusTS; in vec2 v_textureCoordinates; const float _BlurRadius = 0.3;//0.05; const int _Iteration = 30;//10; vec4 getColor(vec2 p) { float lengthScalar = 2.0 / sqrt(2.0); //float lengthScalar = 5.0 / sqrt(5.0); vec2 position = p - vec2(0.5); float radius = length(position) * lengthScalar; float surface = step(radius, u_radiusTS); vec4 color = vec4(vec2(1.0), surface + 0.2, surface); float glow = 1.0 - smoothstep(0.0, 0.55, radius); //float glow = 1.0 - smoothstep(0.0, 1.0, radius); color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75; return color; } void main() { //vec2 blurVector = (vec2(0.5) - v_textureCoordinates) * _BlurRadius; vec2 blurVector = (v_textureCoordinates - vec2(0.5)) * _BlurRadius; vec4 acumulateColor = vec4(0, 0, 0, 0); vec2 texcoord = v_textureCoordinates; //out_FragColor = vec4(1.0, 1.0, 0.0, 1.0); out_FragColor = getColor(texcoord); } `,nEe=`uniform sampler2D depthTexture; uniform sampler2D colorTexture; //uniform sampler2D u_texture; in vec2 v_textureCoordinates; const float threshold = 0.95;//0.5;//1.0; const float exposure = 1.0; const float gamma = 2.2; void main(void) { float depth = czm_readDepth(depthTexture, v_textureCoordinates); //float depth = czm_readDepth(colorTexture, v_textureCoordinates); //float sunDepth = gl_FragCoord.z / gl_FragCoord.w; //if(sunDepth > depth) if(depth < 1.0) //if(gl_FragCoord.z < 0.7) { out_FragColor = vec4(vec3(0.0), 1.0); //out_FragColor = vec4(0.0, 0.0, 1.0, 1.0); } else { vec4 color = texture(colorTexture, v_textureCoordinates); color = czm_gammaCorrect(color); float brightness = dot(color.rgb, vec3(0.2126, 0.7152, 0.0722)); out_FragColor = brightness > threshold ? vec4(color.rgb * 1.1, 1.0) : vec4(0.0, 0.0, 0.0, 1.0); //color = brightness > threshold ? vec4(color.rgb * 1.5, 1.0) : vec4(0.0, 0.0, 0.0, 1.0); // tone mapping //vec3 result = vec3(1.0) - exp(-color.rgb * exposure); // also gamma correct while we're at it //result = pow(result, vec3(1.0 / gamma)); //out_FragColor = vec4(result, 1.0); //out_FragColor = color; //out_FragColor = vec4(1.0, 0.0, 0.0, 1.0); } //out_FragColor = vec4(1.0, 0.0, 1.0, 1.0); //out_FragColor = vec4(v_textureCoordinates, 0.0, 1.0); } `,oEe=`attribute vec2 direction; uniform float u_size; out vec2 v_textureCoordinates; void main() { vec4 position; if (czm_morphTime == 1.0) { position = vec4(czm_sunPositionWC, 1.0); } else { position = vec4(czm_sunPositionColumbusView.zxy, 1.0); } vec4 positionEC = czm_view * position; vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); vec2 halfSize = vec2(u_size * 0.5); halfSize *= ((direction * 2.0) - 1.0); gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); //gl_Position = vec4(direction, 0.0, 1.0); //v_textureCoordinates = direction; //v_textureCoordinates = (gl_Position.xy + 1.0) / 2.0; v_textureCoordinates.x = (gl_Position.x + 1.0) / 2.0; v_textureCoordinates.y = (gl_Position.y + 1.0) / 2.0; //v_textureCoordinates = gl_Position.xy; } `,aEe=`in vec2 direction; uniform float u_size; out vec2 v_textureCoordinates; void main() { vec4 position; if (czm_morphTime == 1.0) { position = vec4(czm_sunPositionWC, 1.0); } else { position = vec4(czm_sunPositionColumbusView.zxy, 1.0); } vec4 positionEC = czm_view * position; vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); vec2 halfSize = vec2(u_size * 0.5); halfSize *= ((direction * 2.0) - 1.0); gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); v_textureCoordinates = direction; } `,sEe=` in vec2 v_textureCoordinates; void main() { czm_materialInput materialInput; materialInput.s = v_textureCoordinates.s; materialInput.st = v_textureCoordinates; materialInput.str = vec3(v_textureCoordinates, 0.0); materialInput.normalEC = vec3(0.0, 0.0, -1.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); } `,ali=function(){var o=import.meta.url;return function(f){return f=f||{},f.ready}}(),eee={};eee.onRuntimeInitialized||(eee.onRuntimeInitialized=function(){},ali(eee));var kZe=eee,j9=dd($Ge(),1),VZe={};(function(o,f){o.FlowEcharts=f(j9.default,o.Geoworld)})(VZe,function(o,f){return function(m){var v={};function y(x){if(v[x])return v[x].exports;var C=v[x]={i:x,l:!1,exports:{}};return m[x].call(C.exports,C,C.exports,y),C.l=!0,C.exports}return y.m=m,y.c=v,y.d=function(x,C,w){y.o(x,C)||Object.defineProperty(x,C,{enumerable:!0,get:w})},y.r=function(x){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(x,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(x,"__esModule",{value:!0})},y.t=function(x,C){if(C&1&&(x=y(x)),C&8||C&4&&typeof x=="object"&&x&&x.__esModule)return x;var w=Object.create(null);if(y.r(w),Object.defineProperty(w,"default",{enumerable:!0,value:x}),C&2&&typeof x!="string")for(var A in x)y.d(w,A,function(E){return x[E]}.bind(null,A));return w},y.n=function(x){var C=x&&x.__esModule?function(){return x.default}:function(){return x};return y.d(C,"a",C),C},y.o=function(x,C){return Object.prototype.hasOwnProperty.call(x,C)},y.p="",y(y.s=0)}([function(m,v,y){y(1);var x=y(7);m.exports=x},function(m,v,y){var x;x=function(C){return y(2).registerCoordinateSystem("GLMap",y(3)),y(5),y(6),y(2).registerAction({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(w,A){}),{version:"1.0.0"}}.call(v,y,v,m),x!==void 0&&(m.exports=x)},function(m,v){m.exports=o},function(m,v,y){var x;x=function(C){var w=y(2);function A(E,T){this._GLMap=E,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=T}return A.prototype.dimensions=["lng","lat"],A.prototype.setMapOffset=function(E){this._mapOffset=E},A.prototype.getBMap=function(){return this._GLMap},A.prototype.dataToPoint=function(E){var T=xe.toRadians(80),S=[99999,99999],M=H.fromDegrees(E[0],E[1]);if(!M)return S;var I=this._GLMap.cartesianToCanvasCoordinates(M);if(!I)return S;var P=this._GLMap;return P.mode===_i.SCENE3D&&H.angleBetween(P.camera.position,M)>T?!1:[I.x-this._mapOffset[0],I.y-this._mapOffset[1]]},A.prototype.pointToData=function(S){var T=this._mapOffset,S=this._bmap.project([S[0]+T[0],S[1]+T[1]]);return[S.lng,S.lat]},A.prototype.getViewRect=function(){var E=this._api;return new w.graphic.BoundingRect(0,0,E.getWidth(),E.getHeight())},A.prototype.getRoamTransform=function(){return w.matrix.create()},A.dimensions=A.prototype.dimensions,A.create=function(E,T){var S;E.eachComponent("GLMap",function(M){var I=T.getZr().painter.getViewportRoot(),P=w.glMap;S=new A(P,T),S.setMapOffset(M.__mapOffset||[0,0]),M.coordinateSystem=S}),E.eachSeries(function(M){M.get("coordinateSystem")==="GLMap"&&(M.coordinateSystem=S)})},A}.call(v,y,v,m),x!==void 0&&(m.exports=x)},function(m,v){m.exports=f},function(m,v,y){var x;x=function(C){return y(2).extendComponentModel({type:"GLMap",getBMap:function(){return this.__GLMap},defaultOption:{roam:!1}})}.call(v,y,v,m),x!==void 0&&(m.exports=x)},function(m,v,y){var x;x=function(C){return y(2).extendComponentView({type:"GLMap",init:function(w,A){this.api=A,j9.default.glMap.postRender.addEventListener(this.moveHandler,this)},moveHandler:function(){this.api.dispatchAction({type:"GLMapRoam"})},render:function(w,A,E){},dispose:function(w,A){j9.default.glMap.postRender.removeEventListener(this.moveHandler,this)}})}.call(v,y,v,m),x!==void 0&&(m.exports=x)},function(m,v){function y(x,C){this._mapContainer=x,this._overlay=this._createChartOverlay(),this._overlay.setOption(C)}y.prototype._createChartOverlay=function(){var x=this._mapContainer.scene;x.canvas.setAttribute("tabIndex",0);var C=document.createElement("div");return C.style.position="absolute",C.style.top="0px",C.style.left="0px",C.style.width=x.canvas.width+"px",C.style.height=x.canvas.height+"px",C.style.pointerEvents="none",C.setAttribute("id","echarts"),C.setAttribute("class","echartMap"),this._mapContainer.container.appendChild(C),this._echartsContainer=C,j9.default.glMap=x,j9.default.init(C)},y.prototype.dispose=function(){this._echartsContainer&&(this._mapContainer.container.removeChild(this._echartsContainer),this._echartsContainer=null),this._overlay&&(this._overlay.dispose(),this._overlay=null)},y.prototype.destroy=function(){this.dispose()},y.prototype.updateOverlay=function(x){this._overlay&&this._overlay.setOption(x)},y.prototype.getMap=function(){return this._mapContainer},y.prototype.getOverlay=function(){return this._overlay},m.exports=y}])});var Qne=VZe.FlowEcharts,sli={DONE:0,PENDING:1,FAILED:2},Vo=Object.freeze(sli),lli=Re.WHITE,uli=H.ZERO,cli=qn.NONE,hli=Ye.ZERO,dli=1,fli=0,pli=H.ZERO,mli=Zc.CENTER,gli=so.CENTER,_li=!1,vli=new H,yli=new Re,xli=new H,Cli=new Ye,bli=new sa,wli=new sa,Ali=new sa,Eli=new Xr,Tli=new ia;function HVe(o){this.entity=o,this.billboard=void 0,this.textureValue=void 0}function L3(o,f){f.collectionChanged.addEventListener(L3.prototype._onCollectionChanged,this),this._cluster=o,this._entityCollection=f,this._items=new wa,this._onCollectionChanged(f,f.values,[],[])}L3.prototype.update=function(o){let f=this._items.values,m=this._cluster;for(let v=0,y=f.length;v-1;y--)x=f[y],N(x._billboard)&&N(x._position)&&C.set(x.id,new HVe(x));for(y=v.length-1;y>-1;y--)x=v[y],N(x._billboard)&&N(x._position)?C.contains(x.id)||C.set(x.id,new HVe(x)):(yge(C.get(x.id),x,w),C.remove(x.id));for(y=m.length-1;y>-1;y--)x=m[y],yge(C.get(x.id),x,w),C.remove(x.id)};function yge(o,f,m){N(o)&&(o.billboard=void 0,m.removeBillboard(f))}var lEe=L3,Sli=new H;function z1(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.minimum,m=o.maximum,v=Z(o.vertexFormat,un.DEFAULT);this._minimum=H.clone(f),this._maximum=H.clone(m),this._vertexFormat=v,this._offsetAttribute=o.offsetAttribute,this._workerName="createBoxGeometry"}z1.fromDimensions=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.dimensions,m=H.multiplyByScalar(f,.5,new H);return new z1({minimum:H.negate(m,new H),maximum:m,vertexFormat:o.vertexFormat,offsetAttribute:o.offsetAttribute})};z1.fromAxisAlignedBoundingBox=function(o){return new z1({minimum:o.minimum,maximum:o.maximum})};z1.packedLength=2*H.packedLength+un.packedLength+1;z1.pack=function(o,f,m){return m=Z(m,0),H.pack(o._minimum,f,m),H.pack(o._maximum,f,m+H.packedLength),un.pack(o._vertexFormat,f,m+2*H.packedLength),f[m+2*H.packedLength+un.packedLength]=Z(o._offsetAttribute,-1),f};var zZe=new H,HZe=new H,UZe=new un,UVe={minimum:zZe,maximum:HZe,vertexFormat:UZe,offsetAttribute:void 0};z1.unpack=function(o,f,m){f=Z(f,0);let v=H.unpack(o,f,zZe),y=H.unpack(o,f+H.packedLength,HZe),x=un.unpack(o,f+2*H.packedLength,UZe),C=o[f+2*H.packedLength+un.packedLength];return N(m)?(m._minimum=H.clone(v,m._minimum),m._maximum=H.clone(y,m._maximum),m._vertexFormat=un.clone(x,m._vertexFormat),m._offsetAttribute=C===-1?void 0:C,m):(UVe.offsetAttribute=C===-1?void 0:C,new z1(UVe))};z1.createGeometry=function(o){let f=o._minimum,m=o._maximum,v=o._vertexFormat;if(H.equals(f,m))return;let y=new Oc,x,C;if(v.position&&(v.st||v.normal||v.tangent||v.bitangent)){if(v.position&&(C=new Float64Array(6*4*3),C[0]=f.x,C[1]=f.y,C[2]=m.z,C[3]=m.x,C[4]=f.y,C[5]=m.z,C[6]=m.x,C[7]=m.y,C[8]=m.z,C[9]=f.x,C[10]=m.y,C[11]=m.z,C[12]=f.x,C[13]=f.y,C[14]=f.z,C[15]=m.x,C[16]=f.y,C[17]=f.z,C[18]=m.x,C[19]=m.y,C[20]=f.z,C[21]=f.x,C[22]=m.y,C[23]=f.z,C[24]=m.x,C[25]=f.y,C[26]=f.z,C[27]=m.x,C[28]=m.y,C[29]=f.z,C[30]=m.x,C[31]=m.y,C[32]=m.z,C[33]=m.x,C[34]=f.y,C[35]=m.z,C[36]=f.x,C[37]=f.y,C[38]=f.z,C[39]=f.x,C[40]=m.y,C[41]=f.z,C[42]=f.x,C[43]=m.y,C[44]=m.z,C[45]=f.x,C[46]=f.y,C[47]=m.z,C[48]=f.x,C[49]=m.y,C[50]=f.z,C[51]=m.x,C[52]=m.y,C[53]=f.z,C[54]=m.x,C[55]=m.y,C[56]=m.z,C[57]=f.x,C[58]=m.y,C[59]=m.z,C[60]=f.x,C[61]=f.y,C[62]=f.z,C[63]=m.x,C[64]=f.y,C[65]=f.z,C[66]=m.x,C[67]=f.y,C[68]=m.z,C[69]=f.x,C[70]=f.y,C[71]=m.z,y.position=new en({componentDatatype:Rt.DOUBLE,componentsPerAttribute:3,values:C})),v.normal){let E=new Float32Array(72);E[0]=0,E[1]=0,E[2]=1,E[3]=0,E[4]=0,E[5]=1,E[6]=0,E[7]=0,E[8]=1,E[9]=0,E[10]=0,E[11]=1,E[12]=0,E[13]=0,E[14]=-1,E[15]=0,E[16]=0,E[17]=-1,E[18]=0,E[19]=0,E[20]=-1,E[21]=0,E[22]=0,E[23]=-1,E[24]=1,E[25]=0,E[26]=0,E[27]=1,E[28]=0,E[29]=0,E[30]=1,E[31]=0,E[32]=0,E[33]=1,E[34]=0,E[35]=0,E[36]=-1,E[37]=0,E[38]=0,E[39]=-1,E[40]=0,E[41]=0,E[42]=-1,E[43]=0,E[44]=0,E[45]=-1,E[46]=0,E[47]=0,E[48]=0,E[49]=1,E[50]=0,E[51]=0,E[52]=1,E[53]=0,E[54]=0,E[55]=1,E[56]=0,E[57]=0,E[58]=1,E[59]=0,E[60]=0,E[61]=-1,E[62]=0,E[63]=0,E[64]=-1,E[65]=0,E[66]=0,E[67]=-1,E[68]=0,E[69]=0,E[70]=-1,E[71]=0,y.normal=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:E})}if(v.st){let E=new Float32Array(48);E[0]=0,E[1]=0,E[2]=1,E[3]=0,E[4]=1,E[5]=1,E[6]=0,E[7]=1,E[8]=1,E[9]=0,E[10]=0,E[11]=0,E[12]=0,E[13]=1,E[14]=1,E[15]=1,E[16]=0,E[17]=0,E[18]=1,E[19]=0,E[20]=1,E[21]=1,E[22]=0,E[23]=1,E[24]=1,E[25]=0,E[26]=0,E[27]=0,E[28]=0,E[29]=1,E[30]=1,E[31]=1,E[32]=1,E[33]=0,E[34]=0,E[35]=0,E[36]=0,E[37]=1,E[38]=1,E[39]=1,E[40]=0,E[41]=0,E[42]=1,E[43]=0,E[44]=1,E[45]=1,E[46]=0,E[47]=1,y.st=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:E})}if(v.tangent){let E=new Float32Array(72);E[0]=1,E[1]=0,E[2]=0,E[3]=1,E[4]=0,E[5]=0,E[6]=1,E[7]=0,E[8]=0,E[9]=1,E[10]=0,E[11]=0,E[12]=-1,E[13]=0,E[14]=0,E[15]=-1,E[16]=0,E[17]=0,E[18]=-1,E[19]=0,E[20]=0,E[21]=-1,E[22]=0,E[23]=0,E[24]=0,E[25]=1,E[26]=0,E[27]=0,E[28]=1,E[29]=0,E[30]=0,E[31]=1,E[32]=0,E[33]=0,E[34]=1,E[35]=0,E[36]=0,E[37]=-1,E[38]=0,E[39]=0,E[40]=-1,E[41]=0,E[42]=0,E[43]=-1,E[44]=0,E[45]=0,E[46]=-1,E[47]=0,E[48]=-1,E[49]=0,E[50]=0,E[51]=-1,E[52]=0,E[53]=0,E[54]=-1,E[55]=0,E[56]=0,E[57]=-1,E[58]=0,E[59]=0,E[60]=1,E[61]=0,E[62]=0,E[63]=1,E[64]=0,E[65]=0,E[66]=1,E[67]=0,E[68]=0,E[69]=1,E[70]=0,E[71]=0,y.tangent=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:E})}if(v.bitangent){let E=new Float32Array(72);E[0]=0,E[1]=1,E[2]=0,E[3]=0,E[4]=1,E[5]=0,E[6]=0,E[7]=1,E[8]=0,E[9]=0,E[10]=1,E[11]=0,E[12]=0,E[13]=1,E[14]=0,E[15]=0,E[16]=1,E[17]=0,E[18]=0,E[19]=1,E[20]=0,E[21]=0,E[22]=1,E[23]=0,E[24]=0,E[25]=0,E[26]=1,E[27]=0,E[28]=0,E[29]=1,E[30]=0,E[31]=0,E[32]=1,E[33]=0,E[34]=0,E[35]=1,E[36]=0,E[37]=0,E[38]=1,E[39]=0,E[40]=0,E[41]=1,E[42]=0,E[43]=0,E[44]=1,E[45]=0,E[46]=0,E[47]=1,E[48]=0,E[49]=0,E[50]=1,E[51]=0,E[52]=0,E[53]=1,E[54]=0,E[55]=0,E[56]=1,E[57]=0,E[58]=0,E[59]=1,E[60]=0,E[61]=0,E[62]=1,E[63]=0,E[64]=0,E[65]=1,E[66]=0,E[67]=0,E[68]=1,E[69]=0,E[70]=0,E[71]=1,y.bitangent=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:E})}x=new Uint16Array(6*2*3),x[0]=0,x[1]=1,x[2]=2,x[3]=0,x[4]=2,x[5]=3,x[6]=4+2,x[7]=4+1,x[8]=4+0,x[9]=4+3,x[10]=4+2,x[11]=4+0,x[12]=8+0,x[13]=8+1,x[14]=8+2,x[15]=8+0,x[16]=8+2,x[17]=8+3,x[18]=12+2,x[19]=12+1,x[20]=12+0,x[21]=12+3,x[22]=12+2,x[23]=12+0,x[24]=16+2,x[25]=16+1,x[26]=16+0,x[27]=16+3,x[28]=16+2,x[29]=16+0,x[30]=20+0,x[31]=20+1,x[32]=20+2,x[33]=20+0,x[34]=20+2,x[35]=20+3}else C=new Float64Array(8*3),C[0]=f.x,C[1]=f.y,C[2]=f.z,C[3]=m.x,C[4]=f.y,C[5]=f.z,C[6]=m.x,C[7]=m.y,C[8]=f.z,C[9]=f.x,C[10]=m.y,C[11]=f.z,C[12]=f.x,C[13]=f.y,C[14]=m.z,C[15]=m.x,C[16]=f.y,C[17]=m.z,C[18]=m.x,C[19]=m.y,C[20]=m.z,C[21]=f.x,C[22]=m.y,C[23]=m.z,y.position=new en({componentDatatype:Rt.DOUBLE,componentsPerAttribute:3,values:C}),x=new Uint16Array(6*2*3),x[0]=4,x[1]=5,x[2]=6,x[3]=4,x[4]=6,x[5]=7,x[6]=1,x[7]=0,x[8]=3,x[9]=1,x[10]=3,x[11]=2,x[12]=1,x[13]=6,x[14]=5,x[15]=1,x[16]=2,x[17]=6,x[18]=2,x[19]=3,x[20]=7,x[21]=2,x[22]=7,x[23]=6,x[24]=3,x[25]=0,x[26]=4,x[27]=3,x[28]=4,x[29]=7,x[30]=0,x[31]=1,x[32]=5,x[33]=0,x[34]=5,x[35]=4;let w=H.subtract(m,f,Sli),A=H.magnitude(w)*.5;if(N(o._offsetAttribute)){let E=C.length,T=o._offsetAttribute===yl.NONE?0:1,S=new Uint8Array(E/3).fill(T);y.applyOffset=new en({componentDatatype:Rt.UNSIGNED_BYTE,componentsPerAttribute:1,values:S})}return new ga({attributes:y,indices:x,primitiveType:Fn.TRIANGLES,boundingSphere:new Pi(H.ZERO,A),offsetAttribute:o._offsetAttribute})};var Tfe;z1.getUnitBox=function(){return N(Tfe)||(Tfe=z1.createGeometry(z1.fromDimensions({dimensions:new H(1,1,1),vertexFormat:un.POSITION_ONLY}))),Tfe};var MM=z1;function dj(o,f){o=Z(o,0),f=Z(f,Number.MAX_VALUE),this.value=new Float32Array([o,f])}Object.defineProperties(dj.prototype,{componentDatatype:{get:function(){return Rt.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});dj.fromDistanceDisplayCondition=function(o){return new dj(o.near,o.far)};dj.toValue=function(o,f){return N(f)?(f[0]=o.near,f[1]=o.far,f):new Float32Array([o.near,o.far])};var th=dj;function Zne(o){o=Z(o,!0),this.value=Zne.toValue(o)}Object.defineProperties(Zne.prototype,{componentDatatype:{get:function(){return Rt.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});Zne.toValue=function(o,f){return N(f)?(f[0]=o,f):new Uint8Array([o])};var zu=Zne;function c6(){li.throwInstantiationError()}Object.defineProperties(c6.prototype,{isConstant:{get:li.throwInstantiationError},definitionChanged:{get:li.throwInstantiationError}});c6.prototype.getType=li.throwInstantiationError;c6.prototype.getValue=li.throwInstantiationError;c6.prototype.equals=li.throwInstantiationError;c6.getValue=function(o,f,m){let v;return N(f)&&(v=f.getType(o),N(v))?((!N(m)||m.type!==v)&&(m=zo.fromType(v)),f.getValue(o,m.uniforms),m):((!N(m)||m.type!==zo.ColorType)&&(m=zo.fromType(zo.ColorType)),Re.clone(Re.WHITE,m.uniforms.color),m)};var O0=c6;function zB(o,f,m){this._primitives=f,this._orderedGroundPrimitives=m,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=o,this._options=o._options,this._entity=o._entity,this._material=void 0}zB.prototype._isHidden=function(o,f,m){return!o.isShowing||!o.isAvailable(m)||!vt.getValueOrDefault(f.show,m,!0)};zB.prototype._setOptions=li.throwInstantiationError;zB.prototype.update=function(o){let f=this._geometryUpdater,m=f._onTerrain,v=this._primitives,y=this._orderedGroundPrimitives;m?y.remove(this._primitive):(v.removeAndDestroy(this._primitive),v.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let x=this._entity,C=x[this._geometryUpdater._geometryPropertyName];if(this._setOptions(x,C,o),this._isHidden(x,C,o))return;let w=this._geometryUpdater.shadowsProperty.getValue(o),A=this._options;if(!N(C.fill)||C.fill.getValue(o)){let E=f.fillMaterialProperty,T=E instanceof xs,S,M=f._getIsClosed(A);if(T)S=new ms({closed:M,flat:m&&!f._supportsMaterialsforEntitiesOnTerrain});else{let I=O0.getValue(o,E,this._material);this._material=I,S=new Nd({material:I,translucent:I.isTranslucent(),closed:M})}if(m)A.vertexFormat=ms.VERTEX_FORMAT,this._primitive=y.add(new Zw({geometryInstances:this._geometryUpdater.createFillGeometryInstance(o),appearance:S,asynchronous:!1,shadows:w,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(o)}),vt.getValueOrUndefined(this._geometryUpdater.zIndex,o));else{A.vertexFormat=S.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(o);T&&(S.translucent=I.attributes.color.value[3]!==255),this._primitive=v.add(new Ia({geometryInstances:I,appearance:S,asynchronous:!1,shadows:w}))}}if(!m&&N(C.outline)&&C.outline.getValue(o)){let E=this._geometryUpdater.createOutlineGeometryInstance(o),T=vt.getValueOrDefault(C.outlineWidth,o,1);this._outlinePrimitive=v.add(new Ia({geometryInstances:E,appearance:new ms({flat:!0,translucent:E.attributes.color.value[3]!==255,renderState:{lineWidth:f._scene.clampLineWidth(T)}}),asynchronous:!1,shadows:w}))}};zB.prototype.getBoundingSphere=function(o){let f=this._entity,m=this._primitive,v=this._outlinePrimitive,y;return N(m)&&m.show&&m.ready&&(y=m.getGeometryInstanceAttributes(f),N(y)&&N(y.boundingSphere))||N(v)&&v.show&&v.ready&&(y=v.getGeometryInstanceAttributes(f),N(y)&&N(y.boundingSphere))?(Pi.clone(y.boundingSphere,o),Vo.DONE):N(m)&&!m.ready||N(v)&&!v.ready?Vo.PENDING:Vo.FAILED};zB.prototype.isDestroyed=function(){return!1};zB.prototype.destroy=function(){let o=this._primitives,f=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?f.remove(this._primitive):o.removeAndDestroy(this._primitive),o.removeAndDestroy(this._outlinePrimitive),kr(this)};var wh=zB,Pli=new xs(Re.WHITE),Ili=new Uc(!0),Mli=new Uc(!0),Dli=new Uc(!1),Lli=new Uc(Re.BLACK),Rli=new Uc(Cl.DISABLED),Oli=new Uc(new ia),Nli=new Uc(uc.BOTH);function tx(o){let f=o.entity,m=o.geometryPropertyName;this._entity=f,this._scene=o.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new Br,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=o.geometryOptions,this._geometryPropertyName=m,this._id=`${m}-${f.id}`,this._observedPropertyNames=o.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Wh.supportsMaterialsforEntitiesOnTerrain(o.scene)}Object.defineProperties(tx.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!N(this._entity.availability)&&vt.isConstant(this._showProperty)&&vt.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!N(this._entity.availability)&&vt.isConstant(this._showProperty)&&vt.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});tx.prototype.isOutlineVisible=function(o){let f=this._entity,m=this._outlineEnabled&&f.isAvailable(o)&&this._showProperty.getValue(o)&&this._showOutlineProperty.getValue(o);return Z(m,!1)};tx.prototype.isFilled=function(o){let f=this._entity,m=this._fillEnabled&&f.isAvailable(o)&&this._showProperty.getValue(o)&&this._fillProperty.getValue(o);return Z(m,!1)};tx.prototype.createFillGeometryInstance=li.throwInstantiationError;tx.prototype.createOutlineGeometryInstance=li.throwInstantiationError;tx.prototype.isDestroyed=function(){return!1};tx.prototype.destroy=function(){kr(this)};tx.prototype._isHidden=function(o,f){let m=f.show;return N(m)&&m.isConstant&&!m.getValue(Hn.MINIMUM_VALUE)};tx.prototype._isOnTerrain=function(o,f){return!1};tx.prototype._getIsClosed=function(o){return!0};tx.prototype._isDynamic=li.throwInstantiationError;tx.prototype._setStaticOptions=li.throwInstantiationError;tx.prototype._onEntityPropertyChanged=function(o,f,m,v){if(this._observedPropertyNames.indexOf(f)===-1)return;let y=this._entity[this._geometryPropertyName];if(!N(y)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let x=y.fill,C=N(x)&&x.isConstant?x.getValue(Hn.MINIMUM_VALUE):!0,w=y.outline,A=N(w);if(A&&w.isConstant&&(A=w.getValue(Hn.MINIMUM_VALUE)),!C&&!A){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let E=y.show;if(this._isHidden(o,y)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=Z(y.material,Pli),this._fillProperty=Z(x,Mli),this._showProperty=Z(E,Ili),this._showOutlineProperty=Z(y.outline,Dli),this._outlineColorProperty=A?Z(y.outlineColor,Lli):void 0,this._shadowsProperty=Z(y.shadows,Rli),this._distanceDisplayConditionProperty=Z(y.distanceDisplayCondition,Oli),this._classificationTypeProperty=Z(y.classificationType,Nli),this._fillEnabled=C;let T=this._isOnTerrain(o,y)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof xs);if(A&&T&&(Ba(Ba.geometryOutlines),A=!1),this._onTerrain=T,this._outlineEnabled=A,this._isDynamic(o,y))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(o,y),this._isClosed=this._getIsClosed(this._options);let S=y.outlineWidth;this._outlineWidth=N(S)?S.getValue(Hn.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};tx.prototype.createDynamicUpdater=function(o,f){return new this.constructor.DynamicGeometryUpdater(this,o,f)};var nd=tx,GZe=new H,Fli=new Mt;function h6(o,f,m,v){this._scene=o,this._heightReference=m,this._extrudedHeightReference=v,this._positionProperty=f,this._position=new H,this._cartographicPosition=new Mt,this._normal=new H,this._definitionChanged=new Br,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let y=this;if(N(o.globe)&&(this._removeEventListener=o.terrainProviderChanged.addEventListener(function(){y._updateClamping()}),this._removeModeListener=o.morphComplete.addEventListener(function(){y._updateClamping()})),f.isConstant){let x=f.getValue(Hn.MINIMUM_VALUE,GZe);if(!N(x)||H.equals(x,H.ZERO)||!N(o.globe))return;this._position=H.clone(x,this._position),this._updateClamping(),this._normal=o.globe.ellipsoid.geodeticSurfaceNormal(x,this._normal)}}Object.defineProperties(h6.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});h6.prototype._updateClamping=function(){N(this._removeCallbackFunc)&&this._removeCallbackFunc();let o=this._scene,f=o.globe,m=this._position;if(!N(f)||H.equals(m,H.ZERO)){this._terrainHeight=0;return}let v=f.ellipsoid,y=f._surface,x=this,C=v.cartesianToCartographic(m,this._cartographicPosition),w=f.getHeight(C);N(w)?this._terrainHeight=w:this._terrainHeight=0;function A(E){if(o.mode===_i.SCENE3D){let T=v.cartesianToCartographic(E,Fli);x._terrainHeight=T.height}else x._terrainHeight=E.x;x.definitionChanged.raiseEvent()}this._removeCallbackFunc=y.updateHeight(C,A)};h6.prototype.getValue=function(o,f){let m=vt.getValueOrDefault(this._heightReference,o,qn.NONE),v=vt.getValueOrDefault(this._extrudedHeightReference,o,qn.NONE);if(m===qn.NONE&&v!==qn.RELATIVE_TO_GROUND)return this._position=H.clone(H.ZERO,this._position),H.clone(H.ZERO,f);if(this._positionProperty.isConstant)return H.multiplyByScalar(this._normal,this._terrainHeight,f);let y=this._scene,x=this._positionProperty.getValue(o,GZe);if(!N(x)||H.equals(x,H.ZERO)||!N(y.globe))return H.clone(H.ZERO,f);if(H.equalsEpsilon(this._position,x,xe.EPSILON10))return H.multiplyByScalar(this._normal,this._terrainHeight,f);this._position=H.clone(x,this._position),this._updateClamping();let C=y.globe.ellipsoid.geodeticSurfaceNormal(x,this._normal);return H.multiplyByScalar(C,this._terrainHeight,f)};h6.prototype.isDestroyed=function(){return!1};h6.prototype.destroy=function(){return N(this._removeEventListener)&&this._removeEventListener(),N(this._removeModeListener)&&this._removeModeListener(),N(this._removeCallbackFunc)&&this._removeCallbackFunc(),kr(this)};var $ne=h6;function Bli(o,f,m,v){if(nd.prototype._onEntityPropertyChanged.call(this,o,f,m,v),this._observedPropertyNames.indexOf(f)===-1)return;let y=this._entity[this._geometryPropertyName];if(!N(y))return;N(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let x=y.heightReference;if(N(x)){let C=new xn(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new $ne(this._scene,C,x)}}var yq=Bli,WZe=H.ZERO,jZe=new H,kli=new H,YZe=new Re;function Vli(o){this.id=o,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function H1(o,f){nd.call(this,{entity:o,scene:f,geometryOptions:new Vli(o),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(o,"box",o.box,void 0)}N(Object.create)&&(H1.prototype=Object.create(nd.prototype),H1.prototype.constructor=H1);Object.defineProperties(H1.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});H1.prototype.createFillGeometryInstance=function(o){let f=this._entity,m=f.isAvailable(o),v=new zu(m&&f.isShowing&&this._showProperty.getValue(o)&&this._fillProperty.getValue(o)),y=this._distanceDisplayConditionProperty.getValue(o),x=th.fromDistanceDisplayCondition(y),C={show:v,distanceDisplayCondition:x,color:void 0,offset:void 0};if(this._materialProperty instanceof xs){let w;N(this._materialProperty.color)&&(this._materialProperty.color.isConstant||m)&&(w=this._materialProperty.color.getValue(o,YZe)),N(w)||(w=Re.WHITE),C.color=ea.fromColor(w)}return N(this._options.offsetAttribute)&&(C.offset=nm.fromCartesian3(vt.getValueOrDefault(this._terrainOffsetProperty,o,WZe,jZe))),new co({id:f,geometry:MM.fromDimensions(this._options),modelMatrix:f.computeModelMatrixForHeightReference(o,f.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:C})};H1.prototype.createOutlineGeometryInstance=function(o){let f=this._entity,m=f.isAvailable(o),v=vt.getValueOrDefault(this._outlineColorProperty,o,Re.BLACK,YZe),y=this._distanceDisplayConditionProperty.getValue(o),x={show:new zu(m&&f.isShowing&&this._showProperty.getValue(o)&&this._showOutlineProperty.getValue(o)),color:ea.fromColor(v),distanceDisplayCondition:th.fromDistanceDisplayCondition(y),offset:void 0};return N(this._options.offsetAttribute)&&(x.offset=nm.fromCartesian3(vt.getValueOrDefault(this._terrainOffsetProperty,o,WZe,jZe))),new co({id:f,geometry:X2.fromDimensions(this._options),modelMatrix:f.computeModelMatrixForHeightReference(o,f.box.heightReference,this._options.dimensions.z*.5,this._scene.mapProjection.ellipsoid),attributes:x})};H1.prototype._computeCenter=function(o,f){return vt.getValueOrUndefined(this._entity.position,o,f)};H1.prototype._isHidden=function(o,f){return!N(f.dimensions)||!N(o.position)||nd.prototype._isHidden.call(this,o,f)};H1.prototype._isDynamic=function(o,f){return!o.position.isConstant||!vt.isConstant(o.orientation)||!f.dimensions.isConstant||!vt.isConstant(f.outlineWidth)};H1.prototype._setStaticOptions=function(o,f){let m=vt.getValueOrDefault(f.heightReference,Hn.MINIMUM_VALUE,qn.NONE),v=this._options;v.vertexFormat=this._materialProperty instanceof xs?ms.VERTEX_FORMAT:Nd.MaterialSupport.TEXTURED.vertexFormat,v.dimensions=f.dimensions.getValue(Hn.MINIMUM_VALUE,v.dimensions),v.offsetAttribute=m!==qn.NONE?yl.ALL:void 0};H1.prototype._onEntityPropertyChanged=yq;H1.DynamicGeometryUpdater=Wz;function Wz(o,f,m){wh.call(this,o,f,m)}N(Object.create)&&(Wz.prototype=Object.create(wh.prototype),Wz.prototype.constructor=Wz);Wz.prototype._isHidden=function(o,f,m){let v=vt.getValueOrUndefined(o.position,m,kli),y=this._options.dimensions;return!N(v)||!N(y)||wh.prototype._isHidden.call(this,o,f,m)};Wz.prototype._setOptions=function(o,f,m){let v=vt.getValueOrDefault(f.heightReference,m,qn.NONE),y=this._options;y.dimensions=vt.getValueOrUndefined(f.dimensions,m,y.dimensions),y.offsetAttribute=v!==qn.NONE?yl.ALL:void 0};var uEe=H1,zli=new Ee;function R3(o,f){f.collectionChanged.addEventListener(R3.prototype._onCollectionChanged,this),this._scene=o,this._primitives=o.primitives,this._entityCollection=f,this._tilesetHash={},this._entitiesToVisualize=new wa,this._onCollectionChanged(f,f.values,[],[])}R3.prototype.update=function(o){let f=this._entitiesToVisualize.values,m=this._tilesetHash,v=this._primitives;for(let y=0,x=f.length;y-1;v--)xge(this,o[v],f,m);return kr(this)};R3.prototype.getBoundingSphere=function(o,f){let m=this._tilesetHash[o.id];if(!N(m)||m.loadFail)return Vo.FAILED;let v=m.tilesetPrimitive;return N(v)?v.show?(Pi.clone(v.boundingSphere,f),Vo.DONE):Vo.FAILED:Vo.PENDING};R3.prototype._onCollectionChanged=function(o,f,m,v){let y,x,C=this._entitiesToVisualize,w=this._tilesetHash,A=this._primitives;for(y=f.length-1;y>-1;y--)x=f[y],N(x._tileset)&&C.set(x.id,x);for(y=v.length-1;y>-1;y--)x=v[y],N(x._tileset)?C.set(x.id,x):(xge(this,x,w,A),C.remove(x.id));for(y=m.length-1;y>-1;y--)x=m[y],xge(this,x,w,A),C.remove(x.id)};function xge(o,f,m,v){let y=m[f.id];N(y)&&(N(y.tilesetPrimitive)&&v.removeAndDestroy(y.tilesetPrimitive),delete m[f.id])}async function Hli(o,f,m,v){f[m.id]={url:o.url,loadFail:!1};try{let y=await pg.fromUrl(o);if(y.id=m,v.add(y),!N(f[m.id]))return;f[m.id].tilesetPrimitive=y}catch(y){console.error(y),f[m.id].loadFail=!0}}var cEe=R3,Uli=Re.WHITE,Gli=Re.BLACK,Wli=new Ye(2,2);function NH(o){o=Z(o,Z.EMPTY_OBJECT),this._definitionChanged=new Br,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=o.evenColor,this.oddColor=o.oddColor,this.repeat=o.repeat}Object.defineProperties(NH.prototype,{isConstant:{get:function(){return vt.isConstant(this._evenColor)&&vt.isConstant(this._oddColor)&&vt.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:Oi("evenColor"),oddColor:Oi("oddColor"),repeat:Oi("repeat")});NH.prototype.getType=function(o){return"Checkerboard"};NH.prototype.getValue=function(o,f){return N(f)||(f={}),f.lightColor=vt.getValueOrClonedDefault(this._evenColor,o,Uli,f.lightColor),f.darkColor=vt.getValueOrClonedDefault(this._oddColor,o,Gli,f.darkColor),f.repeat=vt.getValueOrDefault(this._repeat,o,Wli),f};NH.prototype.equals=function(o){return this===o||o instanceof NH&&vt.equals(this._evenColor,o._evenColor)&&vt.equals(this._oddColor,o._oddColor)&&vt.equals(this._repeat,o._repeat)};var bte=NH,wte={id:void 0},jz=new Array(2);function Cge(o){let f=o.propertyNames,m=f.length;for(let v=0;v-1;A--)C=w[A],XZe(o,M,I,C);for(x=m-1;x>=0;x--)for(E=f[x],E.collectionChanged.addEventListener(Ip.prototype._onCollectionChanged,o),w=E.values,I=E.id,A=w.length-1;A>-1;A--){C=w[A],qZe(o,M,I,C);let D=S.getById(C.id);N(D)||(D=T.getById(C.id),N(D)?Cge(D):(wte.id=C.id,D=new Wh(wte)),S.add(D)),D.merge(C)}o._collectionsCopy=f.slice(0),T.suspendEvents(),T.removeAll();let P=S.values;for(x=0;x=0;w--)A=v[w].getById(D),N(A)&&(N(E)||(E=x.getById(D),Cge(E)),E.merge(A));N(E)||x.removeById(D),E=void 0}let I=f.length;for(C=0;C=0;w--)A=v[w].getById(D),N(A)&&(N(E)||(E=x.getById(D),N(E)?Cge(E):(wte.id=D,E=new Wh(wte),x.add(E))),E.merge(A));E=void 0}x.resumeEvents()};Ip.prototype._onDefinitionChanged=function(o,f,m,v){let y=this._collections,x=this._composite,C=y.length,w=o.id,A=x.getById(w),E=A[f],T=!N(E),S=!0;for(let M=C-1;M>=0;M--){let I=y[M].getById(o.id);if(N(I)){let P=I[f];if(N(P)){if(S)if(S=!1,N(P.merge)&&N(P.clone))E=P.clone(E);else{E=P;break}E.merge(P)}}}T&&A.propertyNames.indexOf(f)===-1&&A.addProperty(f),A[f]=E};var KZe=Ip;function O3(){this._definitionChanged=new Br,this._composite=new bw,this._composite.definitionChanged.addEventListener(O3.prototype._raiseDefinitionChanged,this)}Object.defineProperties(O3.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});O3.prototype.getType=function(o){let f=this._composite._intervals.findDataForIntervalContainingDate(o);if(N(f))return f.getType(o)};O3.prototype.getValue=function(o,f){let m=this._composite._intervals.findDataForIntervalContainingDate(o);if(N(m))return m.getValue(o,f)};O3.prototype.equals=function(o){return this===o||o instanceof O3&&this._composite.equals(o._composite,vt.equals)};O3.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ate=O3,jli={ROUNDED:0,MITERED:1,BEVELED:2},ed=Object.freeze(jli),b0=[new H,new H],Yli=new H,qli=new H,Xli=new H,Jli=new H,Kli=new H,Qli=new H,Zli=new H,$li=new H,eui=new H,lz=new H,_Z=new H,fj={},Sfe=new Mt;function tui(o,f){let m=new Array(o.length);for(let v=0;v=0?-w:w}var rui=new H(-1,0,0),RF=new Ee,nui=new Ee,Ife=new Ut,oui=Ut.IDENTITY.clone(),aui=new H,sui=new Wt,GVe=new H;function KI(o,f,m,v,y,x,C,w){let A=aui,E=sui;RF=tn.eastNorthUpToFixedFrame(o,y,RF),A=Ee.multiplyByPointAsVector(RF,rui,A),A=H.normalize(A,A);let T=iui(A,f,o,y);Ife=Ut.fromRotationZ(T,Ife),GVe.z=x,RF=Ee.multiplyTransformation(RF,Ee.fromRotationTranslation(Ife,GVe,nui),RF);let S=oui;S[0]=C;for(let M=0;M0){let D=E?2:1;for(let L=0;L=0};var cui=new H,hui=new H;fj.computePositions=function(o,f,m,v,y){let x=v._ellipsoid,C=tui(o,x),w=v._granularity,A=v._cornerType,E=y?uui(f,m):WVe(f,m),T=y?WVe(f,m):void 0,S=m.height/2,M=m.width/2,I=o.length,P=[],D=y?[]:void 0,L=Yli,R=qli,O=Xli,F=Jli,k=Kli,U=Qli,G=Zli,j=$li,q=eui,J=o[0],X=o[1];F=x.geodeticSurfaceNormal(J,F),L=H.subtract(X,J,L),L=H.normalize(L,L),j=H.cross(F,L,j),j=H.normalize(j,j);let Y=C[0],Q=C[1];y&&(D=KI(J,j,T,D,x,Y+S,1,1)),q=H.clone(J,q),J=X,R=H.negate(L,R);let ee,z;for(let ne=1;neXe;M--)Ue=xe.PI_OVER_TWO-M*Oe,he[De++]=1-Ce*(1+Math.cos(Ue)),he[De++]=.5*(1+Math.sin(Ue));for(M=Xe;M>0;M--)Ue=xe.PI_OVER_TWO-Oe*M,he[De++]=1-Se*(1+Math.cos(Ue)),he[De++]=.5*(1+Math.sin(Ue));for(M=T-L;M>0;M--)he[De++]=M*Se,he[De++]=1;for(M=1;M0;M--)he[De++]=(M-1)*Se,he[De++]=1}A.st=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:he})}return f.normal&&(A.normal=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:G.normals})),f.tangent&&(A.tangent=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:G.tangents})),f.bitangent&&(A.bitangent=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:G.bitangents})),{attributes:A,indices:oe}}function Aui(o,f){if(!f.normal&&!f.tangent&&!f.bitangent&&!f.st)return o;let m=o.position.values,v,y;(f.normal||f.bitangent)&&(v=o.normal.values,y=o.bitangent.values);let x=o.position.values.length/18,C=x*3,w=x*2,A=C*2,E;if(f.normal||f.bitangent||f.tangent){let T=f.normal?new Float32Array(C*6):void 0,S=f.tangent?new Float32Array(C*6):void 0,M=f.bitangent?new Float32Array(C*6):void 0,I=t$e,P=i$e,D=tee,L=iee,R=wui,O=r$e,F=A;for(E=0;E0){let D=Math.min(x,y);E=Math.round(y/D),A+=D}let T=ro.createTypedArray(C,A*2),S=0,M;for(M=0;M0)for(M=0;M0){for(A=0;AA&&o!==Object}let P=typeof o.unpack=="function"&&o!==S2;if(!I&&!M){S?f[m]=new Uc(P?o.unpack(E,0):E):f[m]=sze(o,C,v);return}let D=f[m],L,R=v.epoch;if(N(R)&&(L=ci.fromIso8601(R)),I&&!M){D instanceof ZI||(f[m]=D=new ZI(o)),D.addSamplesPackedArray(E,L),Dte(v,D);return}let O;if(!I&&M){w=w.clone(),S?w.data=P?o.unpack(E,0):E:w.data=sze(o,C,v),N(D)||(f[m]=D=S?new CH:new bw),S&&D instanceof CH?D.intervals.addInterval(w):D instanceof bw?(S&&(w.data=new Uc(w.data)),D.intervals.addInterval(w)):(f[m]=D=fze(D),S&&(w.data=new Uc(w.data)),D.intervals.addInterval(w));return}N(D)||(f[m]=D=new bw),D instanceof bw||(f[m]=D=fze(D));let F=D.intervals;O=F.findInterval(w),(!N(O)||!(O.data instanceof ZI))&&(O=w.clone(),O.data=new ZI(o),F.addInterval(O)),O.data.addSamplesPackedArray(E,L),Dte(v,O.data)}function x$e(o,f){if(o instanceof ZI){o.removeSamples(f);return}else if(o instanceof CH){o.intervals.removeInterval(f);return}else if(o instanceof bw){let m=o.intervals;for(let v=0;vA),!P&&!M){S?o[f]=new c2(H.unpack(E),I):o[f]=gj(x,m.reference);return}let D=o[f],L,R=m.epoch;if(N(R)&&(L=ci.fromIso8601(R)),P&&!M){(!(D instanceof ww)||N(I)&&D.referenceFrame!==I)&&(o[f]=D=new ww(I,w)),D.addSamplesPackedArray(E,L),Dte(m,D);return}let O;if(!P&&M){C=C.clone(),S?C.data=H.unpack(E):C.data=gj(x,m.reference),N(D)||(S?D=new HH(I):D=new O1(I),o[f]=D),S&&D instanceof HH&&N(I)&&D.referenceFrame===I?D.intervals.addInterval(C):D instanceof O1?(S&&(C.data=new c2(C.data,I)),D.intervals.addInterval(C)):(o[f]=D=pze(D),S&&(C.data=new c2(C.data,I)),D.intervals.addInterval(C));return}N(D)?D instanceof O1||(o[f]=D=pze(D)):o[f]=D=new O1(I);let F=D.intervals;O=F.findInterval(C),(!N(O)||!(O.data instanceof ww)||N(I)&&O.data.referenceFrame!==I)&&(O=C.clone(),O.data=new ww(I,w),F.addInterval(O)),O.data.addSamplesPackedArray(E,L),Dte(m,O.data)}function C$e(o,f){if(o instanceof ww){o.removeSamples(f);return}else if(o instanceof HH){o.intervals.removeInterval(f);return}else if(o instanceof O1){let m=o.intervals;for(let v=0;v. version format.");let v=f._documentPacket;N(o.name)&&(v.name=o.name);let y=o.clock;if(N(y)){let x=v.clock;N(x)?(x.interval=Z(y.interval,x.interval),x.currentTime=Z(y.currentTime,x.currentTime),x.range=Z(y.range,x.range),x.step=Z(y.step,x.step),x.multiplier=Z(y.multiplier,x.multiplier)):v.clock={interval:y.interval,currentTime:y.currentTime,range:y.range,step:y.step,multiplier:y.multiplier}}}function Fci(o,f,m,v){let y=f.ellipse;if(!N(y))return;let x=Rf(y.interval),C=o.ellipse;N(C)||(o.ellipse=C=new gre),Zi(Boolean,C,"show",y.show,x,v,m),Zi(Number,C,"semiMajorAxis",y.semiMajorAxis,x,v,m),Zi(Number,C,"semiMinorAxis",y.semiMinorAxis,x,v,m),Zi(Number,C,"height",y.height,x,v,m),Zi(qn,C,"heightReference",y.heightReference,x,v,m),Zi(Number,C,"extrudedHeight",y.extrudedHeight,x,v,m),Zi(qn,C,"extrudedHeightReference",y.extrudedHeightReference,x,v,m),Zi(S2,C,"rotation",y.rotation,x,v,m),Zi(S2,C,"stRotation",y.stRotation,x,v,m),Zi(Number,C,"granularity",y.granularity,x,v,m),Zi(Boolean,C,"fill",y.fill,x,v,m),eb(C,"material",y.material,x,v,m),Zi(Boolean,C,"outline",y.outline,x,v,m),Zi(Re,C,"outlineColor",y.outlineColor,x,v,m),Zi(Number,C,"outlineWidth",y.outlineWidth,x,v,m),Zi(Number,C,"numberOfVerticalLines",y.numberOfVerticalLines,x,v,m),Zi(Cl,C,"shadows",y.shadows,x,v,m),Zi(ia,C,"distanceDisplayCondition",y.distanceDisplayCondition,x,v,m),Zi(uc,C,"classificationType",y.classificationType,x,v,m),Zi(Number,C,"zIndex",y.zIndex,x,v,m)}function Bci(o,f,m,v){let y=f.ellipsoid;if(!N(y))return;let x=Rf(y.interval),C=o.ellipsoid;N(C)||(o.ellipsoid=C=new TU),Zi(Boolean,C,"show",y.show,x,v,m),Zi(H,C,"radii",y.radii,x,v,m),Zi(H,C,"innerRadii",y.innerRadii,x,v,m),Zi(Number,C,"minimumClock",y.minimumClock,x,v,m),Zi(Number,C,"maximumClock",y.maximumClock,x,v,m),Zi(Number,C,"minimumCone",y.minimumCone,x,v,m),Zi(Number,C,"maximumCone",y.maximumCone,x,v,m),Zi(qn,C,"heightReference",y.heightReference,x,v,m),Zi(Boolean,C,"fill",y.fill,x,v,m),eb(C,"material",y.material,x,v,m),Zi(Boolean,C,"outline",y.outline,x,v,m),Zi(Re,C,"outlineColor",y.outlineColor,x,v,m),Zi(Number,C,"outlineWidth",y.outlineWidth,x,v,m),Zi(Number,C,"stackPartitions",y.stackPartitions,x,v,m),Zi(Number,C,"slicePartitions",y.slicePartitions,x,v,m),Zi(Number,C,"subdivisions",y.subdivisions,x,v,m),Zi(Cl,C,"shadows",y.shadows,x,v,m),Zi(ia,C,"distanceDisplayCondition",y.distanceDisplayCondition,x,v,m)}function kci(o,f,m,v){let y=f.label;if(!N(y))return;let x=Rf(y.interval),C=o.label;N(C)||(o.label=C=new SU),Zi(Boolean,C,"show",y.show,x,v,m),Zi(String,C,"text",y.text,x,v,m),Zi(String,C,"font",y.font,x,v,m),Zi(of,C,"style",y.style,x,v,m),Zi(Number,C,"scale",y.scale,x,v,m),Zi(Boolean,C,"showBackground",y.showBackground,x,v,m),Zi(Re,C,"backgroundColor",y.backgroundColor,x,v,m),Zi(Ye,C,"backgroundPadding",y.backgroundPadding,x,v,m),Zi(Ye,C,"pixelOffset",y.pixelOffset,x,v,m),Zi(H,C,"eyeOffset",y.eyeOffset,x,v,m),Zi(Zc,C,"horizontalOrigin",y.horizontalOrigin,x,v,m),Zi(so,C,"verticalOrigin",y.verticalOrigin,x,v,m),Zi(qn,C,"heightReference",y.heightReference,x,v,m),Zi(Re,C,"fillColor",y.fillColor,x,v,m),Zi(Re,C,"outlineColor",y.outlineColor,x,v,m),Zi(Number,C,"outlineWidth",y.outlineWidth,x,v,m),Zi(sa,C,"translucencyByDistance",y.translucencyByDistance,x,v,m),Zi(sa,C,"pixelOffsetScaleByDistance",y.pixelOffsetScaleByDistance,x,v,m),Zi(sa,C,"scaleByDistance",y.scaleByDistance,x,v,m),Zi(ia,C,"distanceDisplayCondition",y.distanceDisplayCondition,x,v,m),Zi(Number,C,"disableDepthTestDistance",y.disableDepthTestDistance,x,v,m)}function Vci(o,f,m,v){let y=f.model;if(!N(y))return;let x=Rf(y.interval),C=o.model;N(C)||(o.model=C=new yY),Zi(Boolean,C,"show",y.show,x,v,m),Zi(roe.default,C,"uri",y.gltf,x,v,m),Zi(Number,C,"scale",y.scale,x,v,m),Zi(Number,C,"minimumPixelSize",y.minimumPixelSize,x,v,m),Zi(Number,C,"maximumScale",y.maximumScale,x,v,m),Zi(Boolean,C,"incrementallyLoadTextures",y.incrementallyLoadTextures,x,v,m),Zi(Boolean,C,"runAnimations",y.runAnimations,x,v,m),Zi(Boolean,C,"clampAnimations",y.clampAnimations,x,v,m),Zi(Cl,C,"shadows",y.shadows,x,v,m),Zi(qn,C,"heightReference",y.heightReference,x,v,m),Zi(Re,C,"silhouetteColor",y.silhouetteColor,x,v,m),Zi(Number,C,"silhouetteSize",y.silhouetteSize,x,v,m),Zi(Re,C,"color",y.color,x,v,m),Zi(T2,C,"colorBlendMode",y.colorBlendMode,x,v,m),Zi(Number,C,"colorBlendAmount",y.colorBlendAmount,x,v,m),Zi(ia,C,"distanceDisplayCondition",y.distanceDisplayCondition,x,v,m);let w,A,E=y.nodeTransformations;if(N(E))if(Array.isArray(E))for(w=0,A=E.length;w-1;A--)m[A](C,o,f,v)}bge=void 0}function Jci(o){let f,m=o._documentPacket.clock;if(!N(m)){if(!N(o._clock)){let y=o._entityCollection.computeAvailability();if(!y.start.equals(Hn.MINIMUM_VALUE)){let x=y.start,C=y.stop,w=ci.secondsDifference(C,x),A=Math.round(w/120);return f=new D5,f.startTime=ci.clone(x),f.stopTime=ci.clone(C),f.clockRange=L0.LOOP_STOP,f.multiplier=A,f.currentTime=ci.clone(x),f.clockStep=Od.SYSTEM_CLOCK_MULTIPLIER,o._clock=f,!0}}return!1}N(o._clock)?f=o._clock.clone():(f=new D5,f.startTime=Hn.MINIMUM_VALUE.clone(),f.stopTime=Hn.MAXIMUM_VALUE.clone(),f.currentTime=Hn.MINIMUM_VALUE.clone(),f.clockRange=L0.LOOP_STOP,f.clockStep=Od.SYSTEM_CLOCK_MULTIPLIER,f.multiplier=1);let v=Rf(m.interval);return N(v)&&(f.startTime=v.start,f.stopTime=v.stop),N(m.currentTime)&&(f.currentTime=ci.fromIso8601(m.currentTime)),N(m.range)&&(f.clockRange=Z(L0[m.range],L0.LOOP_STOP)),N(m.step)&&(f.clockStep=Z(Od[m.step],Od.SYSTEM_CLOCK_MULTIPLIER)),N(m.multiplier)&&(f.multiplier=m.multiplier),f.equals(o._clock)?!1:(o._clock=f.clone(o._clock),!0)}function w$e(o,f,m,v){m=Z(m,Z.EMPTY_OBJECT);let y=f,x=m.sourceUri,C=m.credit;if(typeof C=="string"&&(C=new Cs(C)),o._credit=C,typeof f=="string"||f instanceof Jr){f=Jr.createIfNeeded(f),y=f.fetchJson(),x=Z(x,f.clone());let w=o._resourceCredits,A=f.credits;if(N(A)){let E=A.length;for(let T=0;T1;--Y){if(R=xe.PI_OVER_TWO-(Y-1)*L,U=GF(-R,x,P,I,A,T,E,S,M,U),G=GF(R+Math.PI,x,P,I,A,T,E,S,M,G),f){for(F[k++]=U.x,F[k++]=U.y,F[k++]=U.z,ee=2*(Y-1)+2,Q=1;Q1;--C){for(f[m++]=v++,f[m++]=v,f[m++]=x,y=2*C,w=0;wxe.PI&&(T.north=T.north>0?xe.PI_OVER_TWO-xe.EPSILON7:T.north,T.south=T.south<0?xe.EPSILON7-xe.PI_OVER_TWO:T.south,T.east=xe.PI,T.west=-xe.PI),T}function P2(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.center,m=Z(o.ellipsoid,ki.WGS84),v=o.semiMajorAxis,y=o.semiMinorAxis,x=Z(o.granularity,xe.RADIANS_PER_DEGREE),C=Z(o.vertexFormat,un.DEFAULT),w=Z(o.height,0),A=Z(o.extrudedHeight,w);this._center=H.clone(f),this._semiMajorAxis=v,this._semiMinorAxis=y,this._ellipsoid=ki.clone(m),this._rotation=Z(o.rotation,0),this._stRotation=Z(o.stRotation,0),this._height=Math.max(A,w),this._granularity=x,this._vertexFormat=un.clone(C),this._extrudedHeight=Math.min(A,w),this._shadowVolume=Z(o.shadowVolume,!1),this._workerName="createEllipseGeometry",this._offsetAttribute=o.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}P2.packedLength=H.packedLength+ki.packedLength+un.packedLength+9;P2.pack=function(o,f,m){return m=Z(m,0),H.pack(o._center,f,m),m+=H.packedLength,ki.pack(o._ellipsoid,f,m),m+=ki.packedLength,un.pack(o._vertexFormat,f,m),m+=un.packedLength,f[m++]=o._semiMajorAxis,f[m++]=o._semiMinorAxis,f[m++]=o._rotation,f[m++]=o._stRotation,f[m++]=o._height,f[m++]=o._granularity,f[m++]=o._extrudedHeight,f[m++]=o._shadowVolume?1:0,f[m]=Z(o._offsetAttribute,-1),f};var k$e=new H,V$e=new ki,z$e=new un,WS={center:k$e,ellipsoid:V$e,vertexFormat:z$e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};P2.unpack=function(o,f,m){f=Z(f,0);let v=H.unpack(o,f,k$e);f+=H.packedLength;let y=ki.unpack(o,f,V$e);f+=ki.packedLength;let x=un.unpack(o,f,z$e);f+=un.packedLength;let C=o[f++],w=o[f++],A=o[f++],E=o[f++],T=o[f++],S=o[f++],M=o[f++],I=o[f++]===1,P=o[f];return N(m)?(m._center=H.clone(v,m._center),m._ellipsoid=ki.clone(y,m._ellipsoid),m._vertexFormat=un.clone(x,m._vertexFormat),m._semiMajorAxis=C,m._semiMinorAxis=w,m._rotation=A,m._stRotation=E,m._height=T,m._granularity=S,m._extrudedHeight=M,m._shadowVolume=I,m._offsetAttribute=P===-1?void 0:P,m):(WS.height=T,WS.extrudedHeight=M,WS.granularity=S,WS.stRotation=E,WS.rotation=A,WS.semiMajorAxis=C,WS.semiMinorAxis=w,WS.shadowVolume=I,WS.offsetAttribute=P===-1?void 0:P,new P2(WS))};P2.computeRectangle=function(o,f){o=Z(o,Z.EMPTY_OBJECT);let m=o.center,v=Z(o.ellipsoid,ki.WGS84),y=o.semiMajorAxis,x=o.semiMinorAxis,C=Z(o.granularity,xe.RADIANS_PER_DEGREE),w=Z(o.rotation,0);return B$e(m,y,x,w,C,v,f)};P2.createGeometry=function(o){if(o._semiMajorAxis<=0||o._semiMinorAxis<=0)return;let f=o._height,m=o._extrudedHeight,v=!xe.equalsEpsilon(f,m,0,xe.EPSILON2);o._center=o._ellipsoid.scaleToGeodeticSurface(o._center,o._center);let y={center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:o._ellipsoid,rotation:o._rotation,height:f,granularity:o._granularity,vertexFormat:o._vertexFormat,stRotation:o._stRotation},x;if(v)y.extrudedHeight=m,y.shadowVolume=o._shadowVolume,y.offsetAttribute=o._offsetAttribute,x=ohi(y);else if(x=ihi(y),N(o._offsetAttribute)){let C=x.attributes.position.values.length,w=o._offsetAttribute===yl.NONE?0:1,A=new Uint8Array(C/3).fill(w);x.attributes.applyOffset=new en({componentDatatype:Rt.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new ga({attributes:x.attributes,indices:x.indices,primitiveType:Fn.TRIANGLES,boundingSphere:x.boundingSphere,offsetAttribute:o._offsetAttribute})};P2.createShadowVolume=function(o,f,m){let v=o._granularity,y=o._ellipsoid,x=f(v,y),C=m(v,y);return new P2({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,ellipsoid:y,rotation:o._rotation,stRotation:o._stRotation,granularity:v,extrudedHeight:x,height:C,vertexFormat:un.POSITION_ONLY,shadowVolume:!0})};function ahi(o){let f=-o._stRotation;if(f===0)return[0,0,0,1,1,0];let m=tb.computeEllipsePositions({center:o._center,semiMajorAxis:o._semiMajorAxis,semiMinorAxis:o._semiMinorAxis,rotation:o._rotation,granularity:o._granularity},!1,!0).outerPositions,v=m.length/3,y=new Array(v);for(let w=0;w0){let P=Math.min(E,A);I=Math.round(A/P);let D=Math.min(I*E,A);for(M=0;M0&&(k=!0,R+=A-1),C0&&T!==D-1&&S!==0&&S!==L-1&&(X[de]=!0),de++;M=0;let ve,pe;for(T=1;T=Ot&&T1||U>1))for(let Q=0;Q0;T-=E)Ue=T*3,fe=zV(fe,he,Ue,M,L),he+=6,y.st&&(pe=HV(pe,Ce,T*2,U),Ce+=4),m&&(Se+=3,de[Se++]=G[Ue],de[Se++]=G[Ue+1],de[Se++]=G[Ue+2]),ce&&(ve[De++]=1,De+=1);if(ee){let Ot=Oe;for(Ue=Ot*3,T=0;T<2;T++)fe=zV(fe,he,Ue,M,L),he+=6,y.st&&(pe=HV(pe,Ce,Ot*2,U),Ce+=4),m&&(Se+=3,de[Se++]=G[Ue],de[Se++]=G[Ue+1],de[Se++]=G[Ue+2]),ce&&(ve[De++]=1,De+=1)}else for(T=E-1;T>=0;T--)Ue=T*3,fe=zV(fe,he,Ue,M,L),he+=6,y.st&&(pe=HV(pe,Ce,T*2,U),Ce+=4),m&&(Se+=3,de[Se++]=G[Ue],de[Se++]=G[Ue+1],de[Se++]=G[Ue+2]),ce&&(ve[De++]=1,De+=1);let Xe=udi(fe,y,w);y.st&&(Xe.attributes.st=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:pe})),m&&(Xe.attributes.extrudeDirection=new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:de})),q&&(Xe.attributes.applyOffset=new en({componentDatatype:Rt.UNSIGNED_BYTE,componentsPerAttribute:1,values:ve}));let it=ro.createTypedArray(ae,ne*6),ut,at,Pt,Qe;I=fe.length/3;let ft=0;for(T=0;T0){N(v)&&(N(this.oldPrimitive)?y.remove(v):this.oldPrimitive=v);let w;N(this.depthFailAppearanceType)&&(N(this.depthFailMaterialProperty)&&(this.depthFailMaterial=O0.getValue(o,this.depthFailMaterialProperty,this.depthFailMaterial)),w=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),v=new Ia({show:!1,asynchronous:!0,geometryInstances:C.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:w,shadows:this.shadows}),y.add(v),f=!1}else{N(v)&&(y.remove(v),v=void 0);let w=this.oldPrimitive;N(w)&&(y.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=v,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(N(v)&&v.ready){v.show=!0,N(this.oldPrimitive)&&(y.remove(this.oldPrimitive),this.oldPrimitive=void 0),N(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof xs)&&(this.depthFailMaterial=O0.getValue(o,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let C=this.updatersWithAttributes.values,w=C.length,A=this.waitingOnCreate;for(x=0;x=0;v--){let y=o[v];if(y.remove(f))return y.updaters.length===0&&(o.splice(v,1),y.destroy()),!0}return!1}f6.prototype.remove=function(o){Fze(this._solidItems,o)||Fze(this._translucentItems,o)};function Bze(o,f,m){let v=!1,y=f.length;for(let x=0;x0)for(x=0;x=0;x--){let C=f[x];if(C.invalidated){f.splice(x,1);let w=C.updaters.values,A=w.length;for(let E=0;E0){N(m)&&(N(this.oldPrimitive)?v.remove(m):this.oldPrimitive=m),this.material=O0.getValue(o,this.materialProperty,this.material);let C;N(this.depthFailMaterialProperty)&&(this.depthFailMaterial=O0.getValue(o,this.depthFailMaterialProperty,this.depthFailMaterial),C=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),m=new Ia({show:!1,asynchronous:!0,geometryInstances:y.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:C,shadows:this.shadows}),v.add(m),f=!1}else{N(m)&&(v.remove(m),m=void 0);let C=this.oldPrimitive;N(C)&&(v.remove(C),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1}else if(N(m)&&m.ready){m.show=!0,N(this.oldPrimitive)&&(v.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=O0.getValue(o,this.materialProperty,this.material),this.primitive.appearance.material=this.material,N(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof xs)&&(this.depthFailMaterial=O0.getValue(o,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let C=this.updatersWithAttributes.values,w=C.length;for(x=0;x=0;v--){let y=f[v];if(y.remove(o)){y.updaters.length===0&&(f.splice(v,1),y.destroy());break}}};p6.prototype.update=function(o){let f,m=this._items,v=m.length;for(f=v-1;f>=0;f--){let x=m[f];if(x.invalidated){m.splice(f,1);let C=x.updaters.values,w=C.length;for(let A=0;A0)N(v)&&(N(this.oldPrimitive)?y.remove(v):this.oldPrimitive=v),v=new Zw({show:!1,asynchronous:!0,geometryInstances:C.slice(),classificationType:this.classificationType}),y.add(v,this.zIndex),f=!1;else{N(v)&&(y.remove(v),v=void 0);let w=this.oldPrimitive;N(w)&&(y.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=v,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(N(v)&&v.ready){v.show=!0,N(this.oldPrimitive)&&(y.remove(this.oldPrimitive),this.oldPrimitive=void 0);let C=this.updatersWithAttributes.values,w=C.length,A=this.waitingOnCreate;for(x=0;x=0;--f){let C=y[f];C.isDirty&&(v=y[f].update(o)&&v,C.isDirty=!1),C.geometry.length===0&&y.splice(f,1)}return v};m6.prototype.getBoundingSphere=function(o,f){let m=this._batches,v=m.length;for(let y=0;y0)N(m)&&(N(this.oldPrimitive)?v.remove(m):this.oldPrimitive=m),this.material=O0.getValue(o,this.materialProperty,this.material),m=new Zw({show:!1,asynchronous:!0,geometryInstances:y.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),v.add(m,this.zIndex),f=!1;else{N(m)&&(v.remove(m),m=void 0);let C=this.oldPrimitive;N(C)&&(v.remove(C),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1}else if(N(m)&&m.ready){m.show=!0,N(this.oldPrimitive)&&(v.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=O0.getValue(o,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let C=this.updatersWithAttributes.values,w=C.length;for(x=0;x=0;v--){let y=f[v];if(y.remove(o)){y.updaters.length===0&&(f.splice(v,1),y.destroy());break}}};g6.prototype.update=function(o){let f,m=this._items,v=m.length;for(f=v-1;f>=0;f--){let x=m[f];if(x.invalidated){m.splice(f,1);let C=x.updaters.values,w=C.length;for(let A=0;A0)N(v)&&(N(this.oldPrimitive)?y.remove(v):this.oldPrimitive=v),v=new Ia({show:!1,asynchronous:!0,geometryInstances:C.slice(),appearance:new ms({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),y.add(v),f=!1;else{N(v)&&(y.remove(v),v=void 0);let w=this.oldPrimitive;N(w)&&(y.remove(w),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=v,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(N(v)&&v.ready){v.show=!0,N(this.oldPrimitive)&&(y.remove(this.oldPrimitive),this.oldPrimitive=void 0);let C=this.updatersWithAttributes.values,w=C.length,A=this.waitingOnCreate;for(x=0;x0)for(S=!0,f=0;f0)for(S=!0,f=0;f0)for(C=new Array(y),v=0;v0)for(w=new Array(y),v=0;v0)for(C=new Array(y),v=0;v0)for(w=new Array(y),v=0;v-1;w--)A=C[w],E=A.id,T=this._updaterSets.get(E),T.entity===A?T.forEach(function(D){S._removeUpdater(D),S._insertUpdaterIntoBatch(o,D)}):(y.push(A),m.push(A));for(w=y.length-1;w>-1;w--)A=y[w],E=A.id,T=this._updaterSets.get(E),T.forEach(this._removeUpdater.bind(this)),T.destroy(),this._updaterSets.remove(E),this._subscriptions.get(E)(),this._subscriptions.remove(E);for(w=m.length-1;w>-1;w--)A=m[w],E=A.id,T=new wq(A,this._scene),this._updaterSets.set(E,T),T.forEach(function(D){S._insertUpdaterIntoBatch(o,D)}),this._subscriptions.set(E,T.geometryChanged.addEventListener(zw._onGeometryChanged,this));f.removeAll(),v.removeAll(),x.removeAll();let M=!0,I=this._batches,P=I.length;for(w=0;w-1;C--)A=m[C],w=A.id,v.remove(w)||(y.set(w,A),x.remove(w));for(C=f.length-1;C>-1;C--)A=f[C],w=A.id,y.remove(w)?x.set(w,A):v.set(w,A)};var KEe=zw,afi=1,sfi="30px sans-serif",lfi=of.FILL,ufi=Re.WHITE,cfi=Re.BLACK,hfi=1,dfi=!1,ffi=new Re(.165,.165,.165,.8),pfi=new Ye(7,5),mfi=Ye.ZERO,gfi=H.ZERO,_fi=qn.NONE,vfi=Zc.CENTER,yfi=so.CENTER,xfi=new H,Cfi=new Re,bfi=new Re,wfi=new Re,Afi=new Ye,Efi=new H,Tfi=new Ye,Sfi=new sa,Pfi=new sa,Ifi=new sa,Mfi=new ia;function Wze(o){this.entity=o,this.label=void 0,this.index=void 0}function V3(o,f){f.collectionChanged.addEventListener(V3.prototype._onCollectionChanged,this),this._cluster=o,this._entityCollection=f,this._items=new wa,this._onCollectionChanged(f,f.values,[],[])}V3.prototype.update=function(o){let f=this._items.values,m=this._cluster;for(let v=0,y=f.length;v-1;y--)x=f[y],N(x._label)&&N(x._position)&&C.set(x.id,new Wze(x));for(y=v.length-1;y>-1;y--)x=v[y],N(x._label)&&N(x._position)?C.contains(x.id)||C.set(x.id,new Wze(x)):(Sge(C.get(x.id),x,w),C.remove(x.id));for(y=m.length-1;y>-1;y--)x=m[y],Sge(C.get(x.id),x,w),C.remove(x.id)};function Sge(o,f,m){N(o)&&(o.label=void 0,m.removeLabel(f))}var QEe=V3;async function Dfi(o,f,m){return N(o._readyPromise)?await o._readyPromise:N(o.readyPromise)&&await o.readyPromise,Ofi(o,f,m)}function Lfi(o,f){let m=o[0],v=m.terrainProvider.requestTileGeometry(m.x,m.y,m.level);if(!v)return!1;let y=v.then(Nfi(m)).catch(Ffi(m));return o.shift(),f.push(y),!0}function Rfi(o){return new Promise(function(f){setTimeout(f,o)})}function Pge(o,f){return o.length?Lfi(o,f)?Pge(o,f):Rfi(100).then(()=>Pge(o,f)):Promise.resolve()}function Ofi(o,f,m){let v=o.tilingScheme,y,x=[],C={};for(y=0;y0&&await Det(o,C),f}var xT=Det,Bfi=1,kfi=0,Vfi=!0,zfi=!0,Hfi=Cl.ENABLED,Ufi=qn.NONE,Gfi=Re.RED,Wfi=0,jfi=Re.WHITE,Yfi=T2.HIGHLIGHT,qfi=.5,Xfi=new Ye(1,1),Jfi=new Ee,Kfi=new Ee,Yze=new Re,qze=new Array(4),Qfi=new H;function D2(o,f){f.collectionChanged.addEventListener(D2.prototype._onCollectionChanged,this),this._scene=o,this._primitives=o.primitives,this._entityCollection=f,this._modelHash={},this._entitiesToVisualize=new wa,this._onCollectionChanged(f,f.values,[],[])}async function Zfi(o,f,m,v){let y=o._primitives,x=o._modelHash;try{let C=await S_.fromGltfAsync({url:m,incrementallyLoadTextures:v,scene:o._scene});if(o.isDestroyed()||!N(x[f.id]))return;C.id=f,y.add(C),x[f.id].modelPrimitive=C,C.errorEvent.addEventListener(w=>{N(x[f.id])&&(console.log(w),w.name!=="TextureError"&&C.incrementallyLoadTextures&&(x[f.id].loadFailed=!0))})}catch(C){if(o.isDestroyed()||!N(x[f.id]))return;console.log(C),x[f.id].loadFailed=!0}}D2.prototype.update=function(o){let f=this._entitiesToVisualize.values,m=this._modelHash,v=this._primitives;for(let y=0,x=f.length;y-1;v--)Ige(this,o[v],f,m);return kr(this)};D2._sampleTerrainMostDetailed=xT;var UV=new H,Xze=new Mt;D2.prototype.getBoundingSphere=function(o,f){let m=this._modelHash[o.id];if(!N(m)||m.loadFailed)return Vo.FAILED;let v=m.modelPrimitive;if(!N(v)||!v.show||!v.ready||!m.modelUpdated)return Vo.PENDING;let y=this._scene.globe,x=N(y)?y.terrainProvider:void 0,C=v.heightReference!==qn.NONE;if(N(y)&&C){let w=y.ellipsoid;if(N(x)&&(N(x._ready)?!x._ready:N(x.ready)&&!x.ready))return Vo.PENDING;let A=v.modelMatrix;UV.x=A[12],UV.y=A[13],UV.z=A[14];let E=w.cartesianToCartographic(UV);if(!N(x.availability)){v.heightReference===qn.CLAMP_TO_GROUND&&(E.height=0);let S=w.cartographicToCartesian(E);return Pi.clone(v.boundingSphere,f),f.center=S,Vo.DONE}let T=this._modelHash[o.id].clampedBoundingSphere;return this._modelHash[o.id].sampleTerrainFailed?(this._modelHash[o.id].sampleTerrainFailed=!1,Vo.FAILED):N(T)?(Pi.clone(T,f),this._modelHash[o.id].clampedBoundingSphere=void 0,Vo.DONE):(T=new Pi,this._modelHash[o.id].awaitingSampleTerrain||(Mt.clone(E,Xze),this._modelHash[o.id].awaitingSampleTerrain=!0,D2._sampleTerrainMostDetailed(x,[Xze]).then(S=>{if(this.isDestroyed())return;this._modelHash[o.id].awaitingSampleTerrain=!1;let M=S[0];v.heightReference===qn.RELATIVE_TO_GROUND&&(M.height+=E.height),w.cartographicToCartesian(M,UV),Pi.clone(v.boundingSphere,T),T.center=UV,this._modelHash[o.id].clampedBoundingSphere=Pi.clone(T)}).catch(S=>{this.isDestroyed()||(this._modelHash[o.id].sampleTerrainFailed=!0,this._modelHash[o.id].awaitingSampleTerrain=!1)})),Vo.PENDING)}return Pi.clone(v.boundingSphere,f),Vo.DONE};D2.prototype._onCollectionChanged=function(o,f,m,v){let y,x,C=this._entitiesToVisualize,w=this._modelHash,A=this._primitives;for(y=f.length-1;y>-1;y--)x=f[y],N(x._model)&&N(x._position)&&C.set(x.id,x);for(y=v.length-1;y>-1;y--)x=v[y],N(x._model)&&N(x._position)?($fi(x,w),C.set(x.id,x)):(Ige(this,x,w,A),C.remove(x.id));for(y=m.length-1;y>-1;y--)x=m[y],Ige(this,x,w,A),C.remove(x.id)};function Ige(o,f,m,v){let y=m[f.id];N(y)&&(v.removeAndDestroy(y.modelPrimitive),delete m[f.id])}function $fi(o,f){let m=f[o.id];N(m)&&(m.nodeTransformationsScratch={},m.articulationsScratch={})}var ZEe=D2,epi=60,tpi=1,Let=new hl,zfe=new hl,Hfe=new hl;function Jze(o){this.entity=o,this.polyline=void 0,this.index=void 0,this.updater=void 0}function ipi(o,f,m,v,y,x,C,w,A){let E=w,T;T=o.getValueInReferenceFrame(f,x,A[E]),N(T)&&(A[E++]=T);let S=!N(y)||ci.lessThanOrEquals(y,f)||ci.greaterThanOrEquals(y,m),M=0,I=v.length,P=v[M],D=m,L=!1,R,O,F;for(;M0&&!L){let k=v[M+1],U=ci.secondsDifference(k,P);L=U>C,L&&(R=Math.ceil(U/C),O=0,F=U/Math.max(R,2),R=Math.max(R-1,1))}if(L&&O0){let M=S.pop();A=this._polylineCollection.get(M),f.index=M}else f.index=this._polylineCollection.length,A=this._polylineCollection.add();A.id=m,f.polyline=A}let T=vt.getValueOrDefault(v._resolution,o,epi);A.show=!0,A.positions=Oet(y,x,C,o,this._referenceFrame,T,A.positions.slice()),A.material=O0.getValue(o,v._material,A.material),A.width=vt.getValueOrDefault(v._width,o,tpi),A.distanceDisplayCondition=vt.getValueOrUndefined(v._distanceDisplayCondition,o,A.distanceDisplayCondition)};Eq.prototype.removeObject=function(o){let f=o.polyline;N(f)&&(this._unusedIndexes.push(o.index),o.polyline=void 0,f.show=!1,f.id=void 0,o.index=void 0)};Eq.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),kr(this)};function z3(o,f){f.collectionChanged.addEventListener(z3.prototype._onCollectionChanged,this),this._scene=o,this._updaters={},this._entityCollection=f,this._items=new wa,this._onCollectionChanged(f,f.values,[],[])}z3.prototype.update=function(o){let f=this._updaters;for(let v in f)f.hasOwnProperty(v)&&f[v].update(o);let m=this._items.values;if(m.length===0&&N(this._updaters)&&Object.keys(this._updaters).length>0){for(let v in f)f.hasOwnProperty(v)&&f[v].destroy();this._updaters={}}for(let v=0,y=m.length;v-1;y--)x=f[y],N(x._path)&&N(x._position)&&w.set(x.id,new Jze(x));for(y=v.length-1;y>-1;y--)x=v[y],N(x._path)&&N(x._position)?w.contains(x.id)||w.set(x.id,new Jze(x)):(C=w.get(x.id),N(C)&&(N(C.updater)&&C.updater.removeObject(C),w.remove(x.id)));for(y=m.length-1;y>-1;y--)x=m[y],C=w.get(x.id),N(C)&&(N(C.updater)&&C.updater.removeObject(C),w.remove(x.id))};z3._subSample=Oet;var $Ee=z3,Qze=Re.WHITE,Zze=Re.BLACK,$ze=0,eHe=1,tHe=0,iHe=new Re,spi=new H,rHe=new Re,nHe=new sa,oHe=new sa,aHe=new ia;function sHe(o){this.entity=o,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function H3(o,f){f.collectionChanged.addEventListener(H3.prototype._onCollectionChanged,this),this._cluster=o,this._entityCollection=f,this._items=new wa,this._onCollectionChanged(f,f.values,[],[])}H3.prototype.update=function(o){let f=this._items.values,m=this._cluster;for(let v=0,y=f.length;v0?(E.scale=1,I=I||R!==x.outlineWidth||O!==x.pixelSize||!Re.equals(D,x.color)||!Re.equals(L,x.outlineColor)):(E.scale=O/50,O=50,I=I||R!==x.outlineWidth||!Re.equals(D,x.color)||!Re.equals(L,x.outlineColor)),I){x.color=Re.clone(D,x.color),x.outlineColor=Re.clone(L,x.outlineColor),x.pixelSize=O,x.outlineWidth=R;let F=D.alpha,k=D.toCssColorString(),U=L.toCssColorString(),G=JSON.stringify([k,O,U,R]);E.setImage(G,Rne(F,k,U,R,O))}P&&E._updateClamping()}}return!0};H3.prototype.getBoundingSphere=function(o,f){let m=this._items.get(o.id);if(!N(m)||!(N(m.pointPrimitive)||N(m.billboard)))return Vo.FAILED;if(N(m.pointPrimitive))f.center=H.clone(m.pointPrimitive.position,f.center);else{let v=m.billboard;if(!N(v._clampedPosition))return Vo.PENDING;f.center=H.clone(v._clampedPosition,f.center)}return f.radius=0,Vo.DONE};H3.prototype.isDestroyed=function(){return!1};H3.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(H3.prototype._onCollectionChanged,this);let o=this._entityCollection.values;for(let f=0;f-1;y--)x=f[y],N(x._point)&&N(x._position)&&C.set(x.id,new sHe(x));for(y=v.length-1;y>-1;y--)x=v[y],N(x._point)&&N(x._position)?C.contains(x.id)||C.set(x.id,new sHe(x)):(lW(C.get(x.id),x,w),C.remove(x.id));for(y=m.length-1;y>-1;y--)x=m[y],lW(C.get(x.id),x,w),C.remove(x.id)};function lW(o,f,m){if(N(o)){let v=o.pointPrimitive;if(N(v)){o.pointPrimitive=void 0,m.removePoint(f);return}let y=o.billboard;N(y)&&(o.billboard=void 0,m.removeBillboard(f))}}var eTe=H3,lpi=new Uc(0),Bte={},lHe=new Re,upi=new xs(Re.WHITE),cpi=new Uc(!0),hpi=new Uc(Cl.DISABLED),dpi=new Uc(new ia),fpi=new Uc(uc.BOTH);function ppi(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function mpi(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function CT(o,f){this._entity=o,this._scene=f,this._entitySubscription=o.definitionChanged.addEventListener(CT.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new Br,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new ppi,this._groundGeometryOptions=new mpi,this._id=`polyline-${o.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Wh.supportsPolylinesOnTerrain(f),this._zIndex=0,this._onEntityPropertyChanged(o,"polyline",o.polyline,void 0)}Object.defineProperties(CT.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!N(this._entity.availability)&&vt.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});CT.prototype.isOutlineVisible=function(o){return!1};CT.prototype.isFilled=function(o){let f=this._entity,m=this._fillEnabled&&f.isAvailable(o)&&this._showProperty.getValue(o);return Z(m,!1)};CT.prototype.createFillGeometryInstance=function(o){let f=this._entity,m=f.isAvailable(o),v=new zu(m&&f.isShowing&&this._showProperty.getValue(o)),y=this._distanceDisplayConditionProperty.getValue(o),x=th.fromDistanceDisplayCondition(y),C={show:v,distanceDisplayCondition:x},w;return this._materialProperty instanceof xs&&(N(this._materialProperty.color)&&(this._materialProperty.color.isConstant||m)&&(w=this._materialProperty.color.getValue(o,lHe)),N(w)||(w=Re.WHITE),C.color=ea.fromColor(w)),this.clampToGround?new co({id:f,geometry:new bU(this._groundGeometryOptions),attributes:C}):(N(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof xs&&(N(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||m)&&(w=this._depthFailMaterialProperty.color.getValue(o,lHe)),N(w)||(w=Re.WHITE),C.depthFailColor=ea.fromColor(w)),new co({id:f,geometry:new b_(this._geometryOptions),attributes:C}))};CT.prototype.createOutlineGeometryInstance=function(o){};CT.prototype.isDestroyed=function(){return!1};CT.prototype.destroy=function(){this._entitySubscription(),kr(this)};CT.prototype._onEntityPropertyChanged=function(o,f,m,v){if(!(f==="availability"||f==="polyline"))return;let y=this._entity.polyline;if(!N(y)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let x=y.positions,C=y.show;if(N(C)&&C.isConstant&&!C.getValue(Hn.MINIMUM_VALUE)||!N(x)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let w=y.zIndex,A=Z(y.material,upi),E=A instanceof xs;this._materialProperty=A,this._depthFailMaterialProperty=y.depthFailMaterial,this._showProperty=Z(C,cpi),this._shadowsProperty=Z(y.shadows,hpi),this._distanceDisplayConditionProperty=Z(y.distanceDisplayCondition,dpi),this._classificationTypeProperty=Z(y.classificationType,fpi),this._fillEnabled=!0,this._zIndex=Z(w,lpi);let T=y.width,S=y.arcType,M=y.clampToGround,I=y.granularity;if(!x.isConstant||!vt.isConstant(T)||!vt.isConstant(S)||!vt.isConstant(I)||!vt.isConstant(M)||!vt.isConstant(w))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let P=this._geometryOptions,D=x.getValue(Hn.MINIMUM_VALUE,P.positions);if(!N(D)||D.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let L;E&&(!N(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof xs)?L=tm.VERTEX_FORMAT:L=M0.VERTEX_FORMAT,P.vertexFormat=L,P.positions=D,P.width=N(T)?T.getValue(Hn.MINIMUM_VALUE):void 0,P.arcType=N(S)?S.getValue(Hn.MINIMUM_VALUE):void 0,P.granularity=N(I)?I.getValue(Hn.MINIMUM_VALUE):void 0;let R=this._groundGeometryOptions;R.positions=D,R.width=P.width,R.arcType=P.arcType,R.granularity=P.granularity,this._clampToGround=N(M)?M.getValue(Hn.MINIMUM_VALUE):!1,!this._clampToGround&&N(w)&&Ba("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};CT.prototype.createDynamicUpdater=function(o,f){return new Tq(o,f,this)};var GV={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function Tq(o,f,m){this._line=void 0,this._primitives=o,this._groundPrimitives=f,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=m,this._positions=[]}function Net(o){if(N(o._line))return o._line;let f=o._geometryUpdater._scene.id,m=Bte[f],v=o._primitives;!N(m)||m.isDestroyed()?(m=new lO,Bte[f]=m,v.add(m)):v.contains(m)||v.add(m);let y=m.add();return y.id=o._geometryUpdater._entity,o._line=y,y}Tq.prototype.update=function(o){let f=this._geometryUpdater,m=f._entity,v=m.polyline,y=v.positions,x=vt.getValueOrUndefined(y,o,this._positions);f._clampToGround=vt.getValueOrDefault(v._clampToGround,o,!1),f._groundGeometryOptions.positions=x,f._groundGeometryOptions.width=vt.getValueOrDefault(v._width,o,1),f._groundGeometryOptions.arcType=vt.getValueOrDefault(v._arcType,o,fs.GEODESIC),f._groundGeometryOptions.granularity=vt.getValueOrDefault(v._granularity,o,9999);let C=this._groundPrimitives;if(N(this._groundPolylinePrimitive)&&(C.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),f.clampToGround){if(!m.isShowing||!m.isAvailable(o)||!vt.getValueOrDefault(v._show,o,!0)||!N(x)||x.length<2)return;let T=f.fillMaterialProperty,S;if(T instanceof xs)S=new tm;else{let M=O0.getValue(o,T,this._material);S=new M0({material:M,translucent:M.isTranslucent()}),this._material=M}this._groundPolylinePrimitive=C.add(new aO({geometryInstances:f.createFillGeometryInstance(o),appearance:S,classificationType:f.classificationTypeProperty.getValue(o),asynchronous:!1}),vt.getValueOrUndefined(f.zIndex,o)),N(this._line)&&(this._line.show=!1);return}let w=Net(this);if(!m.isShowing||!m.isAvailable(o)||!vt.getValueOrDefault(v._show,o,!0)){w.show=!1;return}if(!N(x)||x.length<2){w.show=!1;return}let A=fs.GEODESIC;A=vt.getValueOrDefault(v._arcType,o,A);let E=f._scene.globe;A!==fs.NONE&&N(E)&&(GV.ellipsoid=E.ellipsoid,GV.positions=x,GV.granularity=vt.getValueOrUndefined(v._granularity,o),GV.height=Zh.extractHeights(x,E.ellipsoid),A===fs.GEODESIC?x=Zh.generateCartesianArc(GV):x=Zh.generateCartesianRhumbArc(GV)),w.show=!0,w.positions=x.slice(),w.material=O0.getValue(o,f.fillMaterialProperty,w.material),w.width=vt.getValueOrDefault(v._width,o,1),w.distanceDisplayCondition=vt.getValueOrUndefined(v._distanceDisplayCondition,o,w.distanceDisplayCondition)};Tq.prototype.getBoundingSphere=function(o){if(this._geometryUpdater.clampToGround){let f=this._groundPolylinePrimitive;if(N(f)&&f.show&&f.ready){let m=f.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(N(m)&&N(m.boundingSphere))return Pi.clone(m.boundingSphere,o),Vo.DONE}return N(f)&&!f.ready?Vo.PENDING:Vo.DONE}else{let f=Net(this);if(f.show&&f.positions.length>0)return Pi.fromPoints(f.positions,o),Vo.DONE}return Vo.FAILED};Tq.prototype.isDestroyed=function(){return!1};Tq.prototype.destroy=function(){let o=this._geometryUpdater._scene.id,f=Bte[o];N(f)&&(f.remove(this._line),f.length===0&&(this._primitives.removeAndDestroy(f),delete Bte[o])),N(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),kr(this)};var tTe=CT,gpi=new Re,_pi=new ia,vpi=new ia;function bT(o,f,m,v,y){let x;m instanceof xs?x=tm:x=M0,this.orderedGroundPrimitives=o,this.classificationType=f,this.appearanceType=x,this.materialProperty=m,this.updaters=new wa,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new wa,this.material=void 0,this.updatersWithAttributes=new wa,this.attributes=new wa,this.invalidated=!1,this.removeMaterialSubscription=m.definitionChanged.addEventListener(bT.prototype.onMaterialChanged,this),this.subscriptions=new wa,this.showsUpdated=new wa,this.zIndex=v,this._asynchronous=y}bT.prototype.onMaterialChanged=function(){this.invalidated=!0};bT.prototype.isMaterial=function(o){let f=this.materialProperty,m=o.fillMaterialProperty;return m===f||m instanceof xs&&f instanceof xs?!0:N(f)&&f.equals(m)};bT.prototype.add=function(o,f,m){let v=f.id;if(this.updaters.set(v,f),this.geometry.set(v,m),!f.hasConstantFill||!f.fillMaterialProperty.isConstant||!vt.isConstant(f.distanceDisplayConditionProperty))this.updatersWithAttributes.set(v,f);else{let y=this;this.subscriptions.set(v,f.entity.definitionChanged.addEventListener(function(x,C,w,A){C==="isShowing"&&y.showsUpdated.set(f.id,f)}))}this.createPrimitive=!0};bT.prototype.remove=function(o){let f=o.id;if(this.createPrimitive=this.geometry.remove(f)||this.createPrimitive,this.updaters.remove(f)){this.updatersWithAttributes.remove(f);let m=this.subscriptions.get(f);return N(m)&&(m(),this.subscriptions.remove(f)),!0}return!1};bT.prototype.update=function(o){let f=!0,m=this.primitive,v=this.orderedGroundPrimitives,y=this.geometry.values,x;if(this.createPrimitive){if(y.length>0)N(m)&&(N(this.oldPrimitive)?v.remove(m):this.oldPrimitive=m),m=new aO({show:!1,asynchronous:this._asynchronous,geometryInstances:y.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===M0&&(this.material=O0.getValue(o,this.materialProperty,this.material),m.appearance.material=this.material),v.add(m,this.zIndex),f=!1;else{N(m)&&(v.remove(m),m=void 0);let C=this.oldPrimitive;N(C)&&(v.remove(C),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=m,this.createPrimitive=!1}else if(N(m)&&m.ready){m.show=!0,N(this.oldPrimitive)&&(v.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===M0&&(this.material=O0.getValue(o,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let C=this.updatersWithAttributes.values,w=C.length;for(x=0;x=0;v--){let y=f[v];if(y.remove(o)){y.updaters.length===0&&(f.splice(v,1),y.destroy());break}}};v6.prototype.update=function(o){let f,m=this._items,v=m.length;for(f=v-1;f>=0;f--){let x=m[f];if(x.invalidated){m.splice(f,1);let C=x.updaters.values,w=C.length;for(let A=0;A-1;w--)A=C[w],E=A.id,T=this._updaters.get(E),T.entity===A?(uHe(this,T),cHe(this,o,T)):(y.push(A),m.push(A));for(w=y.length-1;w>-1;w--)A=y[w],E=A.id,T=this._updaters.get(E),uHe(this,T),T.destroy(),this._updaters.remove(E),this._subscriptions.get(E)(),this._subscriptions.remove(E);for(w=m.length-1;w>-1;w--)A=m[w],E=A.id,T=new tTe(A,this._scene),this._updaters.set(E,T),cHe(this,o,T),this._subscriptions.set(E,T.geometryChanged.addEventListener(L2._onGeometryChanged,this));f.removeAll(),v.removeAll(),x.removeAll();let S=!0,M=this._batches,I=M.length;for(w=0;w-1;C--)A=m[C],w=A.id,v.remove(w)||(y.set(w,A),x.remove(w));for(C=f.length-1;C>-1;C--)A=f[C],w=A.id,y.remove(w)?x.set(w,A):v.set(w,A)};var rTe=L2;function rA(o){Zw.initializeTerrainHeights(),aO.initializeTerrainHeights();let f=o.scene,m=o.dataSourceCollection;this._eventHelper=new AC,this._eventHelper.add(m.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(m.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(m.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(f.postRender,this._postRender,this),this._dataSourceCollection=m,this._scene=f,this._visualizersCallback=Z(o.visualizersCallback,rA.defaultVisualizersCallback);let v=!1,y=new w_,x=new w_;m.length>0&&(f.primitives.add(y),f.groundPrimitives.add(x),v=!0),this._primitives=y,this._groundPrimitives=x;for(let E=0,T=m.length;EEpi*C.maximumRadius?(S=pHe,H.normalize(A,S),H.negate(S,S),I=H.clone(H.UNIT_Z,Ufe),M=H.cross(I,S,IZ),H.magnitude(M)>xe.EPSILON7&&(H.normalize(S,S),H.normalize(M,M),I=H.cross(S,M,Ufe),H.normalize(I,I),E=!0)):H.equalsEpsilon(A,O,xe.EPSILON7)||(I=pHe,H.normalize(G,I),H.normalize(j,j),M=H.cross(I,j,Ufe),T&&(M=H.multiplyByScalar(M,-1,M)),H.equalsEpsilon(M,H.ZERO,xe.EPSILON7)||(S=H.cross(M,I,IZ),Ut.multiplyByVector(U,S,S),Ut.multiplyByVector(U,M,M),Ut.multiplyByVector(U,I,I),H.normalize(S,S),H.normalize(M,M),H.normalize(I,I),E=!0))}}N(o.boundingSphere)&&(A=o.boundingSphere.center);let P,D,L;v&&(P=H.clone(f.position,Gfe),D=H.clone(f.direction,mHe),L=H.clone(f.up,gHe));let R=Api;E?(R[0]=S.x,R[1]=S.y,R[2]=S.z,R[3]=0,R[4]=M.x,R[5]=M.y,R[6]=M.z,R[7]=0,R[8]=I.x,R[9]=I.y,R[10]=I.z,R[11]=0,R[12]=A.x,R[13]=A.y,R[14]=A.z,R[15]=0):tn.eastNorthUpToFixedFrame(A,C,R),f._setTransform(R),v&&(H.clone(P,f.position),H.clone(D,f.direction),H.clone(L,f.up),H.cross(D,L,f.right))}if(m){let E=w===_i.SCENE2D||H.equals(o._offset3D,H.ZERO)?void 0:o._offset3D;f.lookAtTransform(f.transform,E)}}function xj(o,f,m){this.entity=o,this.scene=f,this.ellipsoid=Z(m,ki.WGS84),this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new H,this._defaultOffset3D=void 0,this._offset3D=new H}Object.defineProperties(xj,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(o){this._defaultOffset3D=H.clone(o,new H)}}});xj.defaultOffset3D=new H(-14e3,3500,3500);var MZ=new gC,Spi=new H;xj.prototype.update=function(o,f){let m=this.scene,v=this.ellipsoid,y=m.mode;if(y===_i.MORPHING)return;let x=this.entity,C=x.position;if(!N(C))return;let w=x!==this._lastEntity,A=y!==this._mode,E=m.camera,T=w||A,S=!0;if(w){let M=x.viewFrom,I=N(M);if(!I&&N(f)){MZ.pitch=-xe.PI_OVER_FOUR,MZ.range=0;let P=C.getValue(o,Spi);if(N(P)){let D=2-1/Math.max(1,H.magnitude(P)/v.maximumRadius);MZ.pitch*=D}E.viewBoundingSphere(f,MZ),this.boundingSphere=f,T=!1,S=!1}else(!I||!N(M.getValue(o,this._offset3D)))&&H.clone(xj._defaultOffset3D,this._offset3D)}else!A&&this._mode!==_i.SCENE2D&&H.clone(E.position,this._offset3D);this._lastEntity=x,this._mode=y,Tpi(this,E,T,S,C,o,v)};var nTe=xj,Mge=32,Ppi="http://www.opengis.net/kml/2.2",OE="http://www.google.com/kml/ext/2.2",Ipi="http://www.w3.org/2000/xmlns/";function foe(o){this._files={},this._promises=[],this._count=0,this._modelCallback=o}var Mpi=/^data:image\/([^,;]+)/;foe.prototype.texture=function(o){let f=this,m;if(typeof o=="string"||o instanceof Jr){if(o=Jr.createIfNeeded(o),!o.isDataUri)return o.url;let v=o.url.match(Mpi);m=`texture_${++this._count}`,N(v)&&(m+=`.${v[1]}`);let y=o.fetchBlob().then(function(x){f._files[m]=x});return this._promises.push(y),m}if(o instanceof HTMLCanvasElement){m=`texture_${++this._count}.png`;let v=new Promise(y=>{o.toBlob(function(x){f._files[m]=x,y()})});return this._promises.push(v),m}return""};function Dpi(o,f){return function(m){o._files[f]=m}}foe.prototype.model=function(o,f){let m=this._modelCallback;if(!N(m))throw new sr("Encountered a model entity while exporting to KML, but no model callback was supplied.");let v={},y=m(o,f,v);for(let x in v)if(v.hasOwnProperty(x)){let C=Promise.resolve(v[x]);this._promises.push(C),C.then(Dpi(this,x))}return y};Object.defineProperties(foe.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function poe(o){this._time=o}poe.prototype.get=function(o,f,m){let v;return N(o)&&(v=N(o.getValue)?o.getValue(this._time,m):o),Z(v,f)};poe.prototype.getColor=function(o,f){let m=this.get(o,f);if(N(m))return JF(m)};poe.prototype.getMaterialType=function(o){if(N(o))return o.getType(this._time)};function oTe(){this._ids={},this._styles={},this._count=0}oTe.prototype.get=function(o){let f=this._ids,m=o.innerHTML;if(N(f[m]))return f[m];let v=`style-${++this._count}`;return o.setAttribute("id",v),v=`#${v}`,f[m]=v,this._styles[m]=o,v};oTe.prototype.save=function(o){let f=this._styles,m=o.childNodes[0];for(let v in f)f.hasOwnProperty(v)&&o.insertBefore(f[v],m)};function Fet(){this._ids={}}Fet.prototype.get=function(o){if(!N(o))return this.get(zl());let f=this._ids;return N(f[o])?`${o.toString()}-${++f[o]}`:(f[o]=0,o)};function aTe(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.entities,m=Z(o.kmz,!1),v=aTe._createState(o),y=f.values.filter(function(E){return!N(E.parent)}),x=v.kmlDoc,C=x.documentElement;C.setAttributeNS(Ipi,"xmlns:gx",OE);let w=x.createElement("Document");C.appendChild(w),ket(v,w,y),v.styleCache.save(w);let A=v.externalFileHandler;return A.promise.then(function(){let E=new XMLSerializer().serializeToString(v.kmlDoc);return m?Lpi(E,A.files):{kml:E,externalFiles:A.files}})}function Lpi(o,f){let m=Ms("ThirdParty/Workers/z-worker-pako.js");sCe({workerScripts:{deflate:[m,"./pako_deflate.min.js"],inflate:[m,"./pako_inflate.min.js"]}});let v=new uqe,y=new SVt(v);return y.add("doc.kml",new Kkt(o)).then(function(){let x=Object.keys(f);return Bet(y,x,f,0)}).then(function(){return y.close()}).then(function(x){return{kmz:x}})}function Bet(o,f,m,v){if(f.length===v)return;let y=f[v];return o.add(y,new dCe(m[y])).then(function(){return Bet(o,f,m,v+1)})}aTe._createState=function(o){let f=o.entities,m=new oTe,v=f.computeAvailability(),y=N(o.time)?o.time:v.start,x=Z(o.defaultAvailability,v),C=Z(o.sampleDuration,60);x.start===Hn.MINIMUM_VALUE?x.stop===Hn.MAXIMUM_VALUE?x=new hl:ci.addSeconds(x.stop,-10*C,x.start):x.stop===Hn.MAXIMUM_VALUE&&ci.addSeconds(x.start,10*C,x.stop);let w=new foe(o.modelCallback);return{kmlDoc:document.implementation.createDocument(Ppi,"kml"),ellipsoid:Z(o.ellipsoid,ki.WGS84),idManager:new Fet,styleCache:m,externalFileHandler:w,time:y,valueGetter:new poe(y),sampleDuration:C,defaultAvailability:new Lv([x])}};function ket(o,f,m){let v=o.kmlDoc,y=o.styleCache,x=o.valueGetter,C=o.idManager,w=m.length,A,E,T;for(let S=0;S0){let R=v.createElement("Placemark");R.setAttribute("id",C.get(M.id));let O=M.name,F=M.label;if(N(F)){let U=v.createElement("LabelStyle"),G=x.get(F.text);O=N(G)&&G.length>0?G:O;let j=x.getColor(F.fillColor);N(j)&&(U.appendChild(Za(v,"color",j)),U.appendChild(Za(v,"colorMode","normal")));let q=x.get(F.scale);N(q)&&U.appendChild(Za(v,"scale",q)),T.push(U)}R.appendChild(Za(v,"name",O)),R.appendChild(Za(v,"visibility",M.show)),R.appendChild(Za(v,"description",M.description)),N(I)&&R.appendChild(I),f.appendChild(R);let k=T.length;if(k>0){let U=v.createElement("Style");for(let G=0;G1){let U=v.createElement("MultiGeometry");for(let G=0;G0){let R=v.createElement("Folder");R.setAttribute("id",C.get(M.id)),R.appendChild(Za(v,"name",M.name)),R.appendChild(Za(v,"visibility",M.show)),R.appendChild(Za(v,"description",M.description)),f.appendChild(R),ket(o,R,L)}}}var Xx=new H,Vy=new Mt,CE=new ci;function Rpi(o,f,m,v){let y=o.kmlDoc,x=o.ellipsoid,C=o.valueGetter,w=Z(f.billboard,f.point);if(!N(w)&&!N(f.path))return;let A=f.position;if(!A.isConstant){Vet(o,f,w,m,v);return}C.get(A,void 0,Xx);let E=Za(y,"coordinates",XF(Xx,x)),T=y.createElement("Point"),S=y.createElement("altitudeMode");S.appendChild(y5(o,w.heightReference)),T.appendChild(S),T.appendChild(E),m.push(T);let M=w instanceof jM?Het(o,w):zet(o,w);v.push(M)}function Vet(o,f,m,v,y){let x=o.kmlDoc,C=o.ellipsoid,w=o.valueGetter,A,E=f.position,T=!0;E instanceof O1?(A=E.intervals,T=!1):A=Z(f.availability,o.defaultAvailability);let S=m instanceof yY,M,I,P,D=[];for(M=0;M1){let R=x.createElementNS(OE,"MultiTrack");for(M=0;M0&&(x=m);let C=f.coordinates,w=y.get(C),A=[],E=[Di.northeast,Di.southeast,Di.southwest,Di.northwest];for(let I=0;I<4;++I)E[I](w,Vy),A.push(`${xe.toDegrees(Vy.longitude)},${xe.toDegrees(Vy.latitude)},${x}`);let T=Za(v,"coordinates",A.join(" ")),S=v.createElement("outerBoundaryIs"),M=v.createElement("LinearRing");return M.appendChild(T),S.appendChild(M),[S]}function _He(o,f,m,v){let y=o.kmlDoc,x=o.ellipsoid,C=[],w=f.length;for(let T=0;T0&&(x=m);let w=[],A=f.hierarchy,E=y.get(A),T=Array.isArray(E)?E:E.positions,S=v.createElement("outerBoundaryIs");S.appendChild(_He(o,T,x,C)),w.push(S);let M=E.holes;if(N(M)){let I=M.length;for(let P=0;P0&&A.appendChild(Za(x,"extrude",!0));let T=w?Npi(o,f,E):Fpi(o,f,E),S=T.length;for(let L=0;L=0;--v)f+=m[v]<16?`0${m[v].toString(16)}`:m[v].toString(16);return f}var Get=aTe,Wet;typeof DOMParser<"u"&&(Wet=new DOMParser);var Vpi=new NYe({stripPrefix:!1,email:!1,replaceFn:function(o,f){return f.urlMatchType==="scheme"||f.urlMatchType==="www"}}),kte=32,yHe=2414016,xHe=1,CHe=16093e3,bHe=.1,zpi=[null,void 0,"http://www.topografix.com/GPX/1/1"],td={gpx:zpi};function Hpi(o){return new Promise((f,m)=>{let v=new FileReader;v.addEventListener("load",function(){f(v.result)}),v.addEventListener("error",function(){m(v.error)}),v.readAsText(o)})}function lTe(o,f){let m=Cj(o,"id");return m=N(m)?m:zl(),f.getOrCreateEntity(m)}function uTe(o){let f=wHe(o,"lon"),m=wHe(o,"lat"),v=T7(o,"ele",td.gpx);return H.fromDegrees(f,m,v)}function wHe(o,f){if(!N(o))return;let m=o.getAttribute(f);if(m!==null){let v=parseFloat(m);return isNaN(v)?void 0:v}}function Cj(o,f){if(!N(o))return;let m=o.getAttribute(f);return m!==null?m:void 0}function _O(o,f,m){if(!N(o))return;let v=o.childNodes,y=v.length;for(let x=0;x${S.text}: ${S.value}

`)}if(!N(v)||v==="")return;v=Vpi.link(v),S7.innerHTML=v;let C=S7.querySelectorAll("a");for(m=0;m',E+=`${S7.innerHTML}`,S7.innerHTML="",E}function qet(o,f,m,v){let y=uTe(f),x=lTe(f,m);x.position=y;let C=N(v.waypointImage)?v.waypointImage:o._pinBuilder.fromMakiIconId("marker",Re.RED,kte);x.billboard=jet(C);let w=sC(f,"name",td.gpx);x.name=w,x.label=Upi(),x.label.text=w,x.description=hTe(f,x),v.clampToGround&&(x.billboard.heightReference=qn.CLAMP_TO_GROUND,x.label.heightReference=qn.CLAMP_TO_GROUND)}function Gpi(o,f,m,v){let y=lTe(f,m);y.description=hTe(f,y);let x=cTe(f,"rtept",td.gpx),C=new Array(x.length);for(let w=0;w0?(w=w.concat(A.times),T.addSamples(w,C),E=E&&!0):E=!1;if(E){let S=N(v.waypointImage)?v.waypointImage:o._pinBuilder.fromMakiIconId("marker",Re.RED,kte);y.billboard=jet(S),y.position=T,v.clampToGround&&(y.billboard.heightReference=qn.CLAMP_TO_GROUND),y.availability=new Lv,y.availability.addInterval(new hl({start:w[0],stop:w[w.length-1]}))}y.polyline=Yet(v.trackColor),y.polyline.positions=C,v.clampToGround&&(y.polyline.clampToGround=!0)}function jpi(o){let f={positions:[],times:[]},m=cTe(o,"trkpt",td.gpx),v;for(let y=0;yMath.min(x[0],C[0])&&o[0]<=Math.max(x[0],C[0])&&o[1]<=Math.max(x[1],C[1])&&x[0]!==C[0]&&(y=(o[0]-x[0])*(C[1]-x[1])/(C[0]-x[0])+x[1],(x[1]===C[1]||o[1]<=y)&&m++),x=C;return m%2!==0}qS.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Wfe=new H,lmi=new Ee,umi=new H,cmi=new H;qS.computeVertices=function(o){let f=o.flattenPolygonHeight||[1],m=o.flattenPolygon||[],v=o.VTN,y=Math.cos,x=Math.sin,C=Math.sqrt,w=Math.atan,A=Math.exp,E=xe.PI_OVER_TWO,T=xe.toRadians,S=o.heightmap,M=o.width,I=o.height,P=o.skirtHeight,D=P>0,L=Z(o.isGeographic,!0),R=Z(o.ellipsoid,ki.WGS84),O=1/R.maximumRadius,F=Di.clone(o.nativeRectangle),k=Di.clone(o.rectangle),U,G,j,q;N(k)?(U=k.west,G=k.south,j=k.east,q=k.north):L?(U=T(F.west),G=T(F.south),j=T(F.east),q=T(F.north)):(U=F.west*O,G=E-2*w(A(-F.south*O)),j=F.east*O,q=E-2*w(A(-F.north*O)));let J=o.relativeToCenter,X=N(J);J=X?J:H.ZERO;let Y=Z(o.includeWebMercatorT,!1),Q=Z(o.exaggeration,1),ee=Z(o.exaggerationRelativeHeight,0),z=Q!==1,ie=Z(o.structure,qS.DEFAULT_STRUCTURE),re=Z(ie.heightScale,qS.DEFAULT_STRUCTURE.heightScale),ne=Z(ie.heightOffset,qS.DEFAULT_STRUCTURE.heightOffset),oe=Z(ie.elementsPerHeight,qS.DEFAULT_STRUCTURE.elementsPerHeight),se=Z(ie.stride,qS.DEFAULT_STRUCTURE.stride),ae=Z(ie.elementMultiplier,qS.DEFAULT_STRUCTURE.elementMultiplier),fe=Z(ie.isBigEndian,qS.DEFAULT_STRUCTURE.isBigEndian),de=Di.computeWidth(F),ve=Di.computeHeight(F),pe=de/(M-1),ce=ve/(I-1);L||(de*=O,ve*=O);let he=R.radiiSquared,Ce=he.x,Se=he.y,De=he.z,Oe=65536,Ue=-65536,Xe=tn.eastNorthUpToFixedFrame(J,R),it=Ee.inverseTransformation(Xe,lmi),ut,at;Y&&(ut=hd.geodeticLatitudeToMercatorAngle(G),at=1/(hd.geodeticLatitudeToMercatorAngle(q)-ut));let Pt=umi;Pt.x=Number.POSITIVE_INFINITY,Pt.y=Number.POSITIVE_INFINITY,Pt.z=Number.POSITIVE_INFINITY;let Qe=cmi;Qe.x=Number.NEGATIVE_INFINITY,Qe.y=Number.NEGATIVE_INFINITY,Qe.z=Number.NEGATIVE_INFINITY;let ft=Number.POSITIVE_INFINITY,Ot=M*I,Xt=P>0?M*2+I*2:0,At=Ot+Xt,bt=new Array(At),gt=new Array(At),It=new Array(At),Jt=Y?new Array(At):[],bi=z?new Array(At):[],Yi=new Array(At),ii=0,ei=I,Li=0,Je=M;D&&(--ii,++ei,--Li,++Je);let Nt=1e-5;for(let zi=ii;zi=I&&(Ui=I-1);let Gt=F.north-ce*Ui;L?Gt=T(Gt):Gt=E-2*w(A(-Gt*O));let $t=(Gt-G)/(q-G);$t=xe.clamp($t,0,1);let jt=zi===ii,ct=zi===ei-1;P>0&&(jt?Gt+=Nt*ve:ct&&(Gt-=Nt*ve));let Pe=y(Gt),Ht=x(Gt),si=De*Ht,_t;Y&&(_t=(hd.geodeticLatitudeToMercatorAngle(Gt)-ut)*at);for(let Yt=Li;Yt=M&&(Fi=M-1);let Dt=Ui*(M*se)+Fi*se,Lt;if(oe===1)Lt=S[Dt];else{Lt=0;let pr;if(fe)for(pr=0;pr=0;--pr)Lt=Lt*ae+S[Dt+pr]}Lt=Lt*re+ne,Ue=Math.max(Ue,Lt),Oe=Math.min(Oe,Lt);let Si=F.west+pe*Fi;L?Si=T(Si):Si=Si*O;let nt=(Si-U)/(j-U);nt=xe.clamp(nt,0,1);let wt=Ui*M+Fi;if(Yi[wt]=0,P>0){let pr=Yt===Li,yn=Yt===Je-1,dn=jt||ct||pr||yn;if((jt||ct)&&(pr||yn))continue;dn&&(Lt-=P,pr?(wt=Ot+(I-Ui-1),Si-=Nt*de):ct?wt=Ot+I+(M-Fi-1):yn?(wt=Ot+I+M+Ui,Si+=Nt*de):jt&&(wt=Ot+I+M+I+Fi),Yi[wt]=1)}let yt=Pe*y(Si),Tt=Pe*x(Si),Et=Ce*yt,ti=Se*Tt,ir=1/C(Et*yt+ti*Tt+si*Ht),or=Et*ir,xr=ti*ir,Tn=si*ir;for(let pr=0;pr0){let zi=0;for(let Ui=0;Ui=I-1&&($t=0);for(let jt=0;jt=M-1&&(Pe=0),zi=Ui*M+jt;try{let Ht=bt[(Ui+Gt)*M+jt],si=bt[(Ui+$t)*M+jt],_t=bt[Ui*M+(jt+ct)],Yt=bt[Ui*M+(jt+Pe)],Fi=H.subtract(_t,Yt,new H),Dt=H.subtract(Ht,si,new H),Lt=H.cross(Fi,Dt,new H),Si=H.normalize(Lt,new H);yi[zi]=Ku.octEncodeFloat(Si)}catch{yi[zi]=0}}}}let ai=Pi.fromPoints(bt),wi;N(k)&&(wi=fc.fromRectangle(k,Oe,Ue,R));let ji;X&&(ji=new pB(R).computeHorizonCullingPointPossiblyUnderEllipsoid(J,bt,Oe));let hi=new _Y(Pt,Qe,J),Ri=new Hw(J,hi,ft,Ue,Xe,v?P>0:!1,Y,z,Q,ee),pt=new Float32Array(At*Ri.stride),wr=0;for(let zi=0;zi0?yi[zi]:void 0,Jt[zi],bi[zi],P>0||void 0,void 0,Yi[zi]);return{vertices:pt,maximumHeight:Ue,minimumHeight:Oe,encoding:Ri,boundingSphere3D:ai,orientedBoundingBox:wi,occludeePointInScaledSpace:ji}};var moe=qS;function vO(){li.throwInstantiationError()}Object.defineProperties(vO.prototype,{credits:{get:li.throwInstantiationError},waterMask:{get:li.throwInstantiationError}});vO.prototype.interpolateHeight=li.throwInstantiationError;vO.prototype.isChildAvailable=li.throwInstantiationError;vO.prototype.createMesh=li.throwInstantiationError;vO.prototype.upsample=li.throwInstantiationError;vO.prototype.wasCreatedByUpsampling=li.throwInstantiationError;vO.maximumAsynchronousTasks=5;var WB=vO;function hmi(o,f,m,v,y,x,C,w,A,E,T,S,M,I,P,D){this.center=o,this.vertices=f,this.stride=Z(E,6),this.indices=m,this.indexCountWithoutSkirts=v,this.vertexCountWithoutSkirts=y,this.minimumHeight=x,this.maximumHeight=C,this.boundingSphere3D=w,this.occludeePointInScaledSpace=A,this.orientedBoundingBox=T,this.encoding=S,this.westIndicesSouthToNorth=M,this.southIndicesEastToWest=I,this.eastIndicesNorthToSouth=P,this.northIndicesWestToEast=D}var jB=hmi;function Jy(){li.throwInstantiationError()}Object.defineProperties(Jy.prototype,{errorEvent:{get:li.throwInstantiationError},credit:{get:li.throwInstantiationError},tilingScheme:{get:li.throwInstantiationError},ready:{get:li.throwInstantiationError},readyPromise:{get:li.throwInstantiationError},hasWaterMask:{get:li.throwInstantiationError},hasVertexNormals:{get:li.throwInstantiationError},availability:{get:li.throwInstantiationError}});var SHe=[];Jy.getRegularGridIndices=function(o,f){let m=SHe[o];N(m)||(SHe[o]=m=[]);let v=m[f];return N(v)||(o*f0?R=Rv.getRegularGridAndSkirtIndicesAndEdgeIndices(L.gridWidth,L.gridHeight):R=Rv.getRegularGridIndicesAndEdgeIndices(L.gridWidth,L.gridHeight);let O=L.gridWidth*L.gridHeight;return D._mesh=new jB(S,new Float32Array(L.vertices),R.indices,R.indexCountWithoutSkirts,O,L.minimumHeight,L.maximumHeight,Pi.clone(L.boundingSphere3D),H.clone(L.occludeePointInScaledSpace),L.numberOfAttributes,fc.clone(L.orientedBoundingBox),Hw.clone(L.encoding),R.westIndicesSouthToNorth,R.southIndicesEastToWest,R.eastIndicesNorthToSouth,R.northIndicesWestToEast),D._buffer=void 0,D._mesh})};RM.prototype._createMeshSync=function(o){let f=o.tilingScheme,m=o.x,v=o.y,y=o.level,x=Z(o.exaggeration,1),C=Z(o.exaggerationRelativeHeight,0),w=f.ellipsoid,A=f.tileXYToNativeRectangle(m,v,y),E=f.tileXYToRectangle(m,v,y),T=w.cartographicToCartesian(Di.center(E)),S=this._structure,M=Rv.getEstimatedLevelZeroGeometricErrorForAHeightmap(w,this._width,f.getNumberOfXTilesAtLevel(0))/(1<0?P=Rv.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):P=Rv.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let D=I.gridWidth*I.gridHeight;return this._mesh=new jB(T,I.vertices,P.indices,P.indexCountWithoutSkirts,D,I.minimumHeight,I.maximumHeight,I.boundingSphere3D,I.occludeePointInScaledSpace,I.encoding.stride,I.orientedBoundingBox,I.encoding,P.westIndicesSouthToNorth,P.southIndicesEastToWest,P.eastIndicesNorthToSouth,P.northIndicesWestToEast),this._mesh};RM.prototype.interpolateHeight=function(o,f,m){let v=this._width,y=this._height,x=this._structure,C=x.stride,w=x.elementsPerHeight,A=x.elementMultiplier,E=x.isBigEndian,T=x.heightOffset,S=x.heightScale,M=N(this._mesh),I=this._encoding===U3.LERC;if(!M&&I)return;let P;if(M){let D=this._mesh.vertices,L=this._mesh.encoding;P=ett(D,L,T,S,o,v,y,f,m)}else P=pmi(this._buffer,w,A,C,E,o,v,y,f,m),P=P*S+T;return P};RM.prototype.upsample=function(o,f,m,v,y,x,C){let w=this._mesh;if(!N(w))return;let A=this._width,E=this._height,T=this._structure,S=T.stride,M=new this._bufferType(A*E*S),I=w.vertices,P=w.encoding,D=o.tileXYToRectangle(f,m,v),L=o.tileXYToRectangle(y,x,C),R=T.heightOffset,O=T.heightScale,F=T.elementsPerHeight,k=T.elementMultiplier,U=T.isBigEndian,G=Math.pow(k,F-1);for(let j=0;jT.highestEncodedHeight?T.highestEncodedHeight:Y,mmi(M,F,k,G,S,U,j*A+J,Y)}}return Promise.resolve(new RM({buffer:M,width:A,height:E,childTileMask:0,structure:this._structure,createdByUpsampling:!0,flattenPolygonHeight:this._flattenPolygonHeight,flattenPolygon:this._flattenPolygon}))};RM.prototype.isChildAvailable=function(o,f,m,v){let y=2;return m!==o*2&&++y,v!==f*2&&(y-=2),(this._childTileMask&1<=C&&(I=C-1,M=C-2);let P=S|0,D=P+1;D>=w&&(D=w-1,P=w-2);let L=T-M,R=S-P;P=w-1-P,D=w-1-D;let O=RZ(o,f,m,v,y,P*C+M),F=RZ(o,f,m,v,y,P*C+I),k=RZ(o,f,m,v,y,D*C+M),U=RZ(o,f,m,v,y,D*C+I);return ttt(L,R,O,F,k,U)}function ett(o,f,m,v,y,x,C,w,A){let E=(w-y.west)*(x-1)/(y.east-y.west),T=(A-y.south)*(C-1)/(y.north-y.south),S=E|0,M=S+1;M>=x&&(M=x-1,S=x-2);let I=T|0,P=I+1;P>=C&&(P=C-1,I=C-2);let D=E-S,L=T-I;I=C-1-I,P=C-1-P;let R=(f.decodeHeight(o,I*x+S)-m)/v,O=(f.decodeHeight(o,I*x+M)-m)/v,F=(f.decodeHeight(o,P*x+S)-m)/v,k=(f.decodeHeight(o,P*x+M)-m)/v;return ttt(D,L,R,O,F,k)}function ttt(o,f,m,v,y,x){return f=0;--w)C=C*m+o[x+w];return C}function mmi(o,f,m,v,y,x,C,w){C*=y;let A;if(x)for(A=0;A0;--A)o[C+A]=w/v|0,w-=o[C+A]*v,v/=m;o[C+A]=w}var wT=RM;function y6(o){o=Z(o,Z.EMPTY_OBJECT),this._tilingScheme=o.tilingScheme,N(this._tilingScheme)||(this._tilingScheme=new Bd({ellipsoid:Z(o.ellipsoid,ki.WGS84)})),this._levelZeroMaximumGeometricError=Rv.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Br,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(y6.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return mi("EllipsoidTerrainProvider.ready","EllipsoidTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return mi("EllipsoidTerrainProvider.readyPromise","EllipsoidTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});y6.prototype.requestTileGeometry=function(o,f,m,v){return Promise.resolve(new wT({buffer:new Uint8Array(16*16),width:16,height:16}))};y6.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<0&&(Ot=G?j.clippingPlanesState:0);let Xt=m.surfaceShader;if(N(Xt)&&Xt.numberOfDayTextures===v&&Xt.flags===ft&&Xt.material===this.material&&Xt.clippingShaderState===Ot)return Xt.shaderProgram;let At=this._shadersByTexturesFlags[v];if(N(At)||(At=this._shadersByTexturesFlags[v]={}),Xt=At[ft],!N(Xt)||Xt.material!==this.material||Xt.clippingShaderState!==Ot){let bt=this.baseVertexShaderSource.clone(),gt=this.baseFragmentShaderSource.clone();Ot!==0&>.sources.unshift(Iq(j,f.context)),bt.defines.push(ce),gt.defines.push(`TEXTURE_UNITS ${v}`,Se,Oe),y&>.defines.push("APPLY_BRIGHTNESS"),x&>.defines.push("APPLY_CONTRAST"),C&>.defines.push("APPLY_HUE"),w&>.defines.push("APPLY_SATURATION"),A&>.defines.push("APPLY_GAMMA"),E&>.defines.push("APPLY_ALPHA"),T&>.defines.push("APPLY_DAY_NIGHT_ALPHA"),M&&(gt.defines.push("SHOW_REFLECTIVE_OCEAN"),bt.defines.push("SHOW_REFLECTIVE_OCEAN")),I&>.defines.push("SHOW_OCEAN_WAVES"),de&&(bt.defines.push("ENABLE_SLOPE_MAP"),gt.defines.push("ENABLE_SLOPE_MAP")),ve&>.defines.push("SMOOTH_SLOPE_AT_HIGHER_ALT"),Q&>.defines.push("APPLY_COLOR_TO_ALPHA"),ie&&(bt.defines.push("UNDERGROUND_COLOR"),gt.defines.push("UNDERGROUND_COLOR")),re&&(bt.defines.push("TRANSLUCENT"),gt.defines.push("TRANSLUCENT")),P&&(F?(bt.defines.push("ENABLE_VERTEX_LIGHTING"),gt.defines.push("ENABLE_VERTEX_LIGHTING")):(bt.defines.push("ENABLE_DAYNIGHT_SHADING"),gt.defines.push("ENABLE_DAYNIGHT_SHADING"))),D&&(bt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),gt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),L&&(bt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),gt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),R&&(bt.defines.push("GROUND_ATMOSPHERE"),gt.defines.push("GROUND_ATMOSPHERE"),O&&(bt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),gt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),bt.defines.push("INCLUDE_WEB_MERCATOR_Y"),gt.defines.push("INCLUDE_WEB_MERCATOR_Y"),U&&(bt.defines.push("FOG"),gt.defines.push("FOG")),S&>.defines.push("APPLY_SPLIT"),G&>.defines.push("ENABLE_CLIPPING_PLANES"),X&>.defines.push("COLOR_CORRECT"),Y&>.defines.push("HIGHLIGHT_FILL_TILE"),ee&&bt.defines.push("GEODETIC_SURFACE_NORMALS"),z&&bt.defines.push("EXAGGERATION"),ne&&(bt.defines.push("APPLY_FLATTEN"),gt.defines.push("APPLY_FLATTEN")),oe&&(bt.defines.push("REGION_WEATHER"),gt.defines.push("REGION_WEATHER")),se&>.defines.push("SHOW_GRATICULES"),ae&&(gt.defines.push("APPLY_SLOPE_REGION"),bt.defines.push("APPLY_SLOPE_REGION")),fe&>.defines.push("APPLY_SLOPE_ARROW");let It=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) { vec4 color = initialColor; `;J&&(It+=` vec4 cutoutAndColorResult; bool texelUnclipped; `);for(let bi=0;bi0?m.raiseEvent(A):N(f)&&console.log(`An error occurred in "${f.constructor.name}": ${XH(v)}`),A};Vte.reportSuccess=function(o){N(o)&&(o.timesRetried=-1)};var ld=Vte,Emi={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},kl=Object.freeze(Emi),Tmi={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},Ls=Object.freeze(Tmi),Smi=function(o){"use strict";var f=Object.defineProperty,m=(Ve,_e,Me)=>_e in Ve?f(Ve,_e,{enumerable:!0,configurable:!0,writable:!0,value:Me}):Ve[_e]=Me,v=(Ve,_e,Me)=>(m(Ve,typeof _e!="symbol"?_e+"":_e,Me),Me);let y={EvenOdd:0,NonZero:1,Positive:2,Negative:3},x={None:0,Intersection:1,Union:2,Difference:3,Xor:4},C={Subject:1,Clip:2},w=Ve=>Ve!=null&&typeof Ve=="object",A=Ve=>Ve>=0n?Ve:-Ve,E=Ve=>w(Ve)&&"x"in Ve&&typeof Ve.x=="bigint"&&"y"in Ve&&typeof Ve.y=="bigint",T={equals:(Ve,_e)=>Ve.x===_e.x&&Ve.y===_e.y,notEquals:(Ve,_e)=>Ve.x!==_e.x||Ve.y!==_e.y,clone:Ve=>({x:Ve.x,y:Ve.y}),createScaledPoint:(Ve,_e,Me)=>({x:na(Ve*Me),y:na(_e*Me)}),toString(Ve){return`${Ve.x}d,${Ve.y}d `}},S={IsOn:0,IsInside:1,IsOutside:2},M={None:0,OpenStart:1,OpenEnd:2,LocalMax:4,LocalMin:8},I={None:0,Left:1,Right:2},P=1e-12,D=.25,L=Ve=>{if(Ve<-8||Ve>8)throw new RangeError("Precision must be between -8 and 8.")},R=Ve=>Math.abs(Ve)<=P;function O(Ve,_e,Me){return(_e.x-Ve.x)*(Me.y-_e.y)-(_e.y-Ve.y)*(Me.x-_e.x)}function F(Ve,_e){return Ve.y*_e.x-_e.y*Ve.x}function k(Ve,_e,Me){return(_e.x-Ve.x)*(Me.x-_e.x)+(_e.y-Ve.y)*(Me.y-_e.y)}function U(Ve,_e){return Ve.x*_e.x+Ve.y*_e.y}let G=(Ve,_e,Me,Ge)=>{let st=_e.y-Ve.y,kt=_e.x-Ve.x,Ti=Ge.y-Me.y,Vi=Ge.x-Me.x,Hi=st*Vi-Ti*kt;if(Hi===0n)return{result:!1,ip:{x:0n,y:0n}};let pi=Number((Ve.x-Me.x)*Ti-(Ve.y-Me.y)*Vi)/Number(Hi);return pi<=0?{result:!0,ip:T.clone(Ve)}:pi>=1?{result:!0,ip:T.clone(_e)}:{result:!0,ip:{x:na(Number(Ve.x)+pi*Number(kt)),y:na(Number(Ve.y)+pi*Number(st))}}},j=(Ve,_e,Me,Ge,st=!1)=>{if(st){let kt=O(Ve,Me,Ge),Ti=O(_e,Me,Ge);if(kt*Ti>0n)return!1;let Vi=O(Me,Ve,_e),Hi=O(Ge,Ve,_e);return Vi*Hi>0n?!1:kt!==0n||Ti!==0n||Vi!==0n||Hi!==0n}else return O(Ve,Me,Ge)*O(_e,Me,Ge)<0n&&O(Me,Ve,_e)*O(Ge,Ve,_e)<0n},q=(Ve,_e,Me)=>{if(T.equals(_e,Me))return T.clone(_e);let Ge=Me.x-_e.x,st=Me.y-_e.y,kt=Number((Ve.x-_e.x)*Ge+(Ve.y-_e.y)*st)/Number(Ge*Ge+st*st);return kt<0?T.clone(_e):kt>1?T.clone(Me):{x:_e.x+BigInt(qs(kt*Number(Ge))),y:_e.y+BigInt(qs(kt*Number(st)))}},J=(Ve,_e)=>{let Me=_e.length,Ge=0;if(Me<3)return S.IsOutside;for(;GeVe.y;)Vi++;if(Vi===Hi)continue}let pi=_e.getClone(Vi),Qi=Vi>0?_e.getClone(Vi-1):_e.getClone(Me-1);if(pi.y===Ve.y){if(pi.x===Ve.x||pi.y===Qi.y&&Ve.xQi.x&&Ve.x>pi.x)Ti=!Ti;else if(Ve.x>=Qi.x||Ve.x>=pi.x){let dr=O(Qi,pi,Ve);if(dr===0n)return S.IsOn;dr<0n===st&&(Ti=!Ti)}st=!st,Vi++}if(st!==kt){Vi===Me&&(Vi=0);let pi;if(Vi===0?pi=O(_e.getClone(Me-1),_e.getClone(0),Ve):pi=O(_e.getClone(Vi-1),_e.getClone(Vi),Ve),pi===0n)return S.IsOn;pi<0n===st&&(Ti=!Ti)}return Ti?S.IsInside:S.IsOutside},X={getClosestPtOnSegment:q,pointInPolygon:J},Y=Symbol("Path64"),Q=Ve=>w(Ve)&&Ve.type===Y;class ee extends Array{constructor(..._e){var Me=(...Ge)=>{super(...Ge),v(this,"type")};_e.length===0?Me():typeof _e[0]=="number"?Me(_e[0]):(Me(),this.pushRange(_e)),this.type=Y}clone(){let _e=new ee;return _e.pushRange(this),_e}get(_e){return this[_e]}getX(_e){return this[_e].x}getY(_e){return this[_e].y}getClone(_e){return{x:this[_e].x,y:this[_e].y}}set(_e,Me,Ge){this[_e].x=Me,this[_e].y=Ge}push(..._e){for(let Me of _e)super.push(T.clone(Me));return this.length}pushRange(_e){for(let Me of _e)super.push(T.clone(Me));return this.length}clear(){this.length!==0&&(this.length=0)}}let z=Symbol("Path64"),ie={get(Ve,_e,Me){if(_e==="x")return Ve.source.getX(Ve.index);if(_e==="y")return Ve.source.getY(Ve.index)},set(Ve,_e,Me,Ge){if(_e==="x")return Ve.source.setX(Ve.index,Me),!0;if(_e==="y")return Ve.source.setY(Ve.index,Me),!0;throw new Error("Properties cannot be added.")},has(Ve,_e){return["x","y"].includes(_e)}};class re{constructor(..._e){if(v(this,"type"),v(this,"_capacity"),v(this,"_innerLength"),v(this,"_path"),this.type=z,_e.length===0)this._capacity=8,this._innerLength=0,this._path=new Float64Array(16);else if(typeof _e[0]=="number"){let Me=_e[0];this._capacity=Me,this._innerLength=0,this._path=new Float64Array(Me*2)}else if(_e[0]instanceof re){let Me=_e[0].length,Ge=Me;this._innerLength=Me,this._capacity=Ge,this._path=_e[0]._path.slice(0,Ge*2)}else{let Me=_e.length;this._capacity=Me,this._innerLength=0,this._path=new Float64Array(Me*2),this.pushRange(_e)}}_realloc(_e){let Me=_e<8?8:_e,Ge=new Float64Array(Me*2);Ge.set(this._path),this._path=Ge,this._capacity=Me,_e=this._innerLength)throw new RangeError("Invalid array length.")}clone(){return new re(this)}pushDecomposed(_e,Me){this._capacity===this._innerLength&&this._realloc(Math.ceil(this._capacity*2)),this._path[this._innerLength*2]=_e,this._path[this._innerLength*2+1]=Me,this._innerLength++}get(_e){return this._checkLength(_e),new Proxy({index:_e,source:this},ie)}set(_e,Me,Ge){this._checkLength(_e),this.setX(_e,Me),this.setY(_e,Ge)}getClone(_e){return this._checkLength(_e),{x:this._path[_e*2],y:this._path[_e*2+1]}}getX(_e){return this._checkLength(_e),this._path[_e*2]}getY(_e){return this._checkLength(_e),this._path[_e*2+1]}setX(_e,Me){return this._checkLength(_e),this._path[_e*2]=Me}setY(_e,Me){return this._checkLength(_e),this._path[_e*2+1]=Me}setChild(_e,Me){this._checkLength(_e);let Ge=_e%this._innerLength*2;return this._path[Ge]=Me.x,this._path[Ge+1]=Me.y,!0}push(..._e){for(let Me of _e)this._push(Me);return this.length}pushRange(_e){for(let Me of _e)this._push(Me);return this.length}pop(){if(this._innerLength===0)return;let _e=this.getClone(this._innerLength-1);return this._innerLength--,_e}clear(){this._innerLength=0}get length(){return this._innerLength}asScaledPath64(_e){let Me=new oe(this._innerLength);for(let Ge=0;Ge=this._innerLength)throw new RangeError("Invalid array length.")}clone(){return new oe(this)}pushDecomposed(_e,Me){this._capacity===this._innerLength&&this._realloc(Math.ceil(this._capacity*2)),this._path[this._innerLength*2]=_e,this._path[this._innerLength*2+1]=Me,this._innerLength++}get(_e){return this._checkLength(_e),new Proxy({index:_e,source:this},ne)}set(_e,Me,Ge){this._checkLength(_e),this.setX(_e,Me),this.setY(_e,Ge)}getClone(_e){return this._checkLength(_e),{x:this._path[_e*2],y:this._path[_e*2+1]}}getX(_e){return this._checkLength(_e),this._path[_e*2]}getY(_e){return this._checkLength(_e),this._path[_e*2+1]}setX(_e,Me){return this._checkLength(_e),this._path[_e*2]=Me}setY(_e,Me){return this._checkLength(_e),this._path[_e*2+1]=Me}setChild(_e,Me){this._checkLength(_e);let Ge=_e%this._innerLength*2;return this._path[Ge]=Me.x,this._path[Ge+1]=Me.y,!0}push(..._e){for(let Me of _e)this._push(Me);return this.length}pushRange(_e){for(let Me of _e)this._push(Me);return this.length}pop(){if(this._innerLength===0)return;let _e=this.getClone(this._innerLength-1);return this._innerLength--,_e}clear(){this._innerLength=0}get length(){return this._innerLength}asScaledPath64(_e){if(_e===1)return new oe(this);{let Me=new oe(this._innerLength);for(let Ge=0;Gew(Ve)&&"x"in Ve&&typeof Ve.x=="number"&&"y"in Ve&&typeof Ve.y=="number",ae={equals:(Ve,_e)=>R(Ve.x-_e.x)&&R(Ve.y-_e.y),notEquals:(Ve,_e)=>!R(Ve.x-_e.x)||!R(Ve.y-_e.y),clone:Ve=>({x:Ve.x,y:Ve.y}),toString(Ve,_e=2){return`${Ve.x.toFixed(_e)},${Ve.y.toFixed(_e)} `}},fe=Ve=>w(Ve)&&Ve.type===z;class de extends Array{constructor(..._e){var Me=(...Ge)=>{super(...Ge),v(this,"type")};_e.length===0?Me():typeof _e[0]=="number"?Me(_e[0]):(Me(),this.pushRange(_e)),this.type=z}clone(){let _e=new de;return _e.pushRange(this),_e}get(_e){return this[_e]}getX(_e){return this[_e].x}getY(_e){return this[_e].y}getClone(_e){return{x:this[_e].x,y:this[_e].y}}set(_e,Me,Ge){this[_e].x=Me,this[_e].y=Ge}push(..._e){for(let Me of _e)super.push(ae.clone(Me));return this.length}pushRange(_e){for(let Me of _e)super.push(ae.clone(Me));return this.length}clear(){this.length!==0&&(this.length=0)}}let ve=Ve=>w(Ve)&&Ve.type===pe,pe="Paths64";class ce extends Array{constructor(..._e){var Me=(...Ge)=>{super(...Ge),v(this,"type")};if(_e.length===0)Me();else if(typeof _e[0]=="number")Me(_e[0]);else{Me();for(let Ge of _e)this._push(Ge)}this.type=pe}static clone(_e){let Me=new ce;return Me.pushRange(_e),Me}clear(){if(this.length!==0){for(let _e of this)_e.clear();this.length=0}}_push(_e){let Me;if(Q(_e))Me=_e.clone();else{"length"in _e&&typeof _e.length=="number"&&_e.length>0?Me=new oe(_e.length):Me=new oe;for(let Ge of _e)Me.push(Ge)}super.push(Me)}directPush(_e){super.push(_e)}push(..._e){for(let Me of _e)this._push(Me);return this.length}pushRange(_e){for(let Me of _e)this._push(Me);return this.length}}let he=Ve=>w(Ve)&&Ve.type===Ce,Ce="PathsD";class Se extends Array{constructor(..._e){var Me=(...Ge)=>{super(...Ge),v(this,"type")};if(_e.length===0)Me();else if(typeof _e[0]=="number")Me(_e[0]);else{Me();for(let Ge of _e)this._push(Ge)}this.type=Ce}static clone(_e){let Me=new Se;return Me.pushRange(_e),Me}clear(){if(this.length!==0){for(let _e of this)_e.clear();this.length=0}}_push(_e){let Me;if(fe(_e))Me=_e.clone();else{"length"in _e&&typeof _e.length=="number"&&_e.length>0?Me=new re(_e.length):Me=new re;for(let Ge of _e)Me.push(Ge)}super.push(Me)}directPush(_e){super.push(_e)}push(..._e){for(let Me of _e)this._push(Me);return this.length}pushRange(_e){for(let Me of _e)this._push(Me);return this.length}}let De=Ve=>w(Ve)&&Ve.type===Oe,Oe=Symbol("Rect64");class Ue{constructor(_e,Me,Ge,st){if(v(this,"type"),v(this,"left"),v(this,"top"),v(this,"right"),v(this,"bottom"),this.type=Oe,_e===void 0)this.left=0n,this.top=0n,this.right=0n,this.bottom=0n;else if(typeof _e=="bigint"&&typeof Me=="bigint"&&typeof Ge=="bigint"&&typeof st=="bigint")this.left=_e,this.top=Me,this.right=Ge,this.bottom=st;else if(typeof _e=="boolean")_e?(this.left=0n,this.top=0n,this.right=0n,this.bottom=0n):(this.left=9223372036854775807n,this.top=9223372036854775807n,this.right=-9223372036854775808n,this.bottom=-9223372036854775808n);else if(De(_e))this.left=_e.left,this.top=_e.top,this.right=_e.right,this.bottom=_e.bottom;else throw new TypeError("Invalid argument types.")}get width(){return this.right-this.left}set width(_e){this.right=this.left+_e}get height(){return this.bottom-this.top}set height(_e){this.bottom=this.top+_e}midPoint(){return{x:(this.right+this.left)/2n,y:(this.bottom+this.top)/2n}}asPath(){return new oe({x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.right,y:this.bottom},{x:this.left,y:this.bottom})}contains(_e){if(E(_e))return _e.x>this.left&&_e.xthis.top&&_e.y=this.left&&_e.right<=this.right&&_e.top>=this.top&&_e.bottom<=this.bottom;throw new TypeError("Invalid argument types.")}scale(_e){this.top=na(Number(this.top)*_e),this.bottom=na(Number(this.bottom)*_e),this.left=na(Number(this.left)*_e),this.right=na(Number(this.right)*_e)}isEmpty(){return this.bottom<=this.top||this.right<=this.left}isValid(){return this.left<9223372036854775808n}intersects(_e){return(this.left>=_e.left?this.left:_e.left)<=(this.right<=_e.right?this.right:_e.right)&&(this.top>=_e.top?this.top:_e.top)<=(this.bottom<=_e.bottom?this.bottom:_e.bottom)}}let Xe=new Ue,it=Ve=>w(Ve)&&Ve.type===ut,ut=Symbol("RectD");class at{constructor(_e,Me,Ge,st){if(v(this,"type"),v(this,"left"),v(this,"top"),v(this,"right"),v(this,"bottom"),this.type=ut,_e===void 0)this.left=0,this.top=0,this.right=0,this.bottom=0;else if(typeof _e=="number"&&typeof Me=="number"&&typeof Ge=="number"&&typeof st=="number")this.left=_e,this.top=Me,this.right=Ge,this.bottom=st;else if(typeof _e=="boolean")_e?(this.left=0,this.top=0,this.right=0,this.bottom=0):(this.left=1/0,this.top=1/0,this.right=-1/0,this.bottom=-1/0);else if(it(_e))this.left=_e.left,this.top=_e.top,this.right=_e.right,this.bottom=_e.bottom;else throw new TypeError("Invalid argument types.")}get width(){return this.right-this.left}set width(_e){this.right=this.left+_e}get height(){return this.bottom-this.top}set height(_e){this.bottom=this.top+_e}midPoint(){return{x:(this.right+this.left)/2,y:(this.bottom+this.top)/2}}asPath(){return new de({x:this.left,y:this.top},{x:this.right,y:this.top},{x:this.right,y:this.bottom},{x:this.left,y:this.bottom})}contains(_e){if(se(_e))return _e.x>this.left&&_e.xthis.top&&_e.y=this.left&&_e.right<=this.right&&_e.top>=this.top&&_e.bottom<=this.bottom;throw new TypeError("Invalid argument types.")}scale(_e){this.top=this.top*_e,this.bottom=this.bottom*_e,this.left=this.left*_e,this.right=this.right*_e}isEmpty(){return this.bottom<=this.top||this.right<=this.left}intersects(_e){return(this.left>=_e.left?this.left:_e.left)<=(this.right>=_e.right?this.right:_e.right)&&(this.top>=_e.top?this.top:_e.top)<=(this.bottom>=_e.bottom?this.bottom:_e.bottom)}}let Pt=(Ve,_e,Me,Ge,st)=>{for(let kt of Ve){let Ti,Vi,Hi;for(let dr of kt){let bn=T.clone(dr);Ti===void 0?(Ti={pt:bn,flags:M.None},st.push(Ti),Vi=Ti):T.notEquals(Vi.pt,bn)&&(Hi={pt:bn,flags:M.None,prev:Vi},st.push(Hi),Vi.next=Hi,Vi=Hi)}if(Vi===void 0||Vi?.prev===void 0||(!Me&&T.equals(Vi.pt,Ti.pt)&&(Vi=Vi.prev),Vi.next=Ti,Ti.prev=Vi,!Me&&Vi.next===Vi))continue;let pi=!1;if(Me){for(Hi=Ti.next;Hi!==Ti&&Hi.pt.y===Ti.pt.y;)Hi=Hi.next;pi=Hi.pt.y<=Ti.pt.y,pi?(Ti.flags=M.OpenStart,Qe(Ti,_e,!0,Ge)):Ti.flags=M.OpenStart|M.LocalMax}else{for(Vi=Ti.prev;Vi!==Ti&&Vi.pt.y===Ti.pt.y;)Vi=Vi.prev;if(Vi===Ti)continue;pi=Vi.pt.y>Ti.pt.y}let Qi=pi;for(Vi=Ti,Hi=Ti.next;Hi!==Ti;)Hi.pt.y>Vi.pt.y&&pi?(Vi.flags|=M.LocalMax,pi=!1):Hi.pt.y{(Ve.flags&M.LocalMin)===M.None&&(Ve.flags|=M.LocalMin,Ge.push({vertex:Ve,polytype:_e,isOpen:Me}))},ft=(Ve,_e)=>Ve===void 0||_e===void 0?0:Ve.rightOp===void 0?_e.rightOp===void 0?0:1:_e.rightOp===void 0?-1:Ve.leftOp.pt.x===_e.leftOp.pt.x?0:Ve.leftOp.pt.x>_e.leftOp.pt.x?1:-1,Ot=(Ve,_e)=>Ve.pt.y===_e.pt.y?Ve.pt.x===_e.pt.x?0:Ve.pt.x<_e.pt.x?-1:1:Ve.pt.y>_e.pt.y?-1:1,Xt=(Ve,_e)=>_e.vertex.pt.y===Ve.vertex.pt.y?0:_e.vertex.pt.y>Ve.vertex.pt.y?1:-1,At=Ve=>(Ve&1)!==0,bt=Ve=>Ve.outrec!==void 0,gt=Ve=>Ve.localMinIsOpen,It=Ve=>(Ve.flags&(M.OpenStart|M.OpenEnd))!==M.None,Jt=Ve=>Ve.localMinIsOpen&&(Ve.vertexTop.flags&(M.OpenStart|M.OpenEnd))!==M.None,bi=Ve=>{let _e=Ve.prevInAEL;for(;_e!==void 0&&(gt(_e)||!bt(_e));)_e=_e.prevInAEL;return _e},Yi=Ve=>Ve===Ve.outrec.frontEdge,ii=(Ve,_e)=>{let Me=_e.y-Ve.y;return Me!==0n?Number(_e.x-Ve.x)/Number(Me):_e.x>Ve.x?-1/0:1/0},ei=(Ve,_e)=>_e===Ve.top.y||Ve.top.x===Ve.bot.x?Ve.top.x:_e===Ve.bot.y?Ve.bot.x:Ve.bot.x+BigInt(qs(Ve.dx*Number(_e-Ve.bot.y))),Li=Ve=>Ve.top.y===Ve.bot.y,Je=Ve=>Ve.dx===-1/0,Nt=Ve=>Ve.dx===1/0,yi=Ve=>Ve.localMinPolytype,ai=(Ve,_e)=>Ve.localMinPolytype===_e.localMinPolytype,wi=Ve=>{Ve.dx=ii(Ve.bot,Ve.top)},ji=Ve=>Ve.windDx>0?Ve.vertexTop.next:Ve.vertexTop.prev,hi=Ve=>Ve.windDx>0?Ve.vertexTop.prev.prev:Ve.vertexTop.next.next,Ri=Ve=>(Ve.flags&M.LocalMax)!==M.None,pt=Ve=>(Ve.vertexTop.flags&M.LocalMax)!==M.None,wr=Ve=>{let _e=Ve.nextInAEL;for(;_e!==void 0;){if(_e.vertexTop===Ve.vertexTop)return _e;_e=_e.nextInAEL}},zi=Ve=>{let _e=Ve.vertexTop;if(Ve.windDx>0)for(;_e.next.pt.y===_e.pt.y&&(_e.flags&(M.OpenEnd|M.LocalMax))===M.None;)_e=_e.next;else for(;_e.prev.pt.y===_e.pt.y&&(_e.flags&(M.OpenEnd|M.LocalMax))===M.None;)_e=_e.prev;return Ri(_e)||(_e=void 0),_e},Ui=Ve=>{let _e=Ve.vertexTop;if(Ve.windDx>0)for(;_e.next.pt.y===_e.pt.y;)_e=_e.next;else for(;_e.prev.pt.y===_e.pt.y;)_e=_e.prev;return Ri(_e)||(_e=void 0),_e},Gt=(Ve,_e,Me)=>{Ve.frontEdge=_e,Ve.backEdge=Me},$t=(Ve,_e)=>{let Me=Ve.outrec,Ge=_e.outrec;if(Me===Ge){let st=Me.frontEdge;Me.frontEdge=Me.backEdge,Me.backEdge=st;return}Me!==void 0&&(Ve===Me.frontEdge?Me.frontEdge=_e:Me.backEdge=_e),Ge!==void 0&&(_e===Ge.frontEdge?Ge.frontEdge=Ve:Ge.backEdge=Ve),Ve.outrec=Ge,_e.outrec=Me},jt=(Ve,_e)=>{for(;_e.owner!==void 0&&_e.owner.pts===void 0;)_e.owner=_e.owner.owner;let Me=_e;for(;Me!==void 0&&Me!==Ve;)Me=Me.owner;Me!==void 0&&(_e.owner=Ve.owner),Ve.owner=_e},ct=Ve=>{let _e=0n,Me=Ve;do _e+=(Me.prev.pt.y+Me.pt.y)*(Me.prev.pt.x-Me.pt.x),Me=Me.next;while(Me!==Ve);return Number(_e)*.5},Pe=(Ve,_e,Me)=>Number((Me.y+Ve.y)*(Me.x-Ve.x)+(Ve.y+_e.y)*(Ve.x-_e.x)+(_e.y+Me.y)*(_e.x-Me.x)),Ht=Ve=>{for(;Ve!==void 0&&Ve.pts===void 0;)Ve=Ve.owner;return Ve},si=(Ve,_e)=>{for(;_e!==void 0&&_e!==Ve;)_e=_e.owner;return _e===void 0},_t=Ve=>{let _e=Ve.outrec;_e!==void 0&&(_e.frontEdge.outrec=void 0,_e.backEdge.outrec=void 0,_e.frontEdge=void 0,_e.backEdge=void 0)},Yt=Ve=>Ve===Ve.outrec.frontEdge,Fi=Ve=>{let _e=Ve.frontEdge;Ve.frontEdge=Ve.backEdge,Ve.backEdge=_e,Ve.pts=Ve.pts.next},Dt=Ve=>Ve.edge1.nextInAEL===Ve.edge2||Ve.edge1.prevInAEL===Ve.edge2,Lt=(Ve,_e)=>{if(Ve.bot.x===Ve.top.x){let Me=Ve.nextInAEL;for(;Me!==void 0&&Me.vertexTop!==_e;)Me=Me.nextInAEL;return{leftX:Ve.curX,rightX:Ve.curX,result:Me!==void 0}}return Ve.curX{let Me=!1,Ge=ji(Ve).pt;for(;Ge.y===Ve.top.y&&!(_e&&Ge.xVe.joinWith!==I.None,wt=(Ve,_e)=>{if(_e.curX!==Ve.curX)return _e.curX>Ve.curX;let Me=O(Ve.top,_e.bot,_e.top);if(Me!==0n)return Me<0n;if(!pt(Ve)&&Ve.top.y>_e.top.y)return O(_e.bot,Ve.top,ji(Ve).pt)<=0;if(!pt(_e)&&_e.top.y>Ve.top.y)return O(_e.bot,_e.top,ji(_e).pt)>=0;let Ge=_e.bot.y,st=_e.isLeftBound;return Ve.bot.y!==Ge||Ve.localMinVertex.pt.y!==Ge?_e.isLeftBound:Ve.isLeftBound!==st?st:O(hi(Ve).pt,Ve.bot,Ve.top)===0n?!0:O(hi(Ve).pt,_e.bot,hi(_e).pt)>0===st},yt=(Ve,_e)=>{_e.nextInAEL=Ve.nextInAEL,Ve.nextInAEL!==void 0&&(Ve.nextInAEL.prevInAEL=_e),_e.prevInAEL=Ve,Ve.nextInAEL=_e},Tt=(Ve,_e)=>{let Me=Ve.outrec.pts,Ge=_e.outrec.pts,st=Me.next,kt=Ge.next;Yi(Ve)?(kt.prev=Me,Me.next=kt,Ge.next=st,st.prev=Ge,Ve.outrec.pts=Ge,Ve.outrec.frontEdge=_e.outrec.frontEdge,Ve.outrec.frontEdge!==void 0&&(Ve.outrec.frontEdge.outrec=Ve.outrec)):(st.prev=Ge,Ge.next=st,Me.next=kt,kt.prev=Me,Ve.outrec.backEdge=_e.outrec.backEdge,Ve.outrec.backEdge!==void 0&&(Ve.outrec.backEdge.outrec=Ve.outrec)),_e.outrec.frontEdge=void 0,_e.outrec.backEdge=void 0,_e.outrec.pts=void 0,jt(_e.outrec,Ve.outrec),Jt(Ve)&&(_e.outrec.pts=Ve.outrec.pts,Ve.outrec.pts=void 0),Ve.outrec=void 0,_e.outrec=void 0},Et=(Ve,_e)=>{let Me=Ve.outrec,Ge=Yi(Ve),st=Me.pts,kt=st.next;if(Ge&&T.equals(_e,st.pt))return st;if(!Ge&&T.equals(_e,kt.pt))return kt;let Ti={pt:T.clone(_e),outrec:Me,prev:st,next:kt};return kt.prev=Ti,st.next=Ti,Ge&&(Me.pts=Ti),Ti},ti=Ve=>{let _e=Ve.nextInAEL;for(;_e!==void 0;){if(_e.localMinVertex===Ve.localMinVertex)return _e;if(!Li(_e)&&T.notEquals(Ve.bot,_e.bot))break;_e=_e.nextInAEL}for(_e=Ve.prevInAEL;_e!==void 0;){if(_e.localMinVertex===Ve.localMinVertex)return _e;if(!Li(_e)&&T.notEquals(Ve.bot,_e.bot))break;_e=_e.prevInAEL}},ir=Ve=>{let _e=Ve.nextInSEL;return _e!==void 0&&(_e.prevInSEL=Ve.prevInSEL),Ve.prevInSEL.nextInSEL=_e,_e},or=(Ve,_e)=>{Ve.prevInSEL=_e.prevInSEL,Ve.prevInSEL!==void 0&&(Ve.prevInSEL.nextInSEL=Ve),Ve.nextInSEL=_e,_e.prevInSEL=Ve},xr=Ve=>{let _e=Ve.pts;do _e.outrec=Ve,_e=_e.next;while(_e!==Ve.pts)},Tn=(Ve,_e,Me)=>_e.pt.x===Me.pt.x?!1:(_e.pt.x{let _e=Ve.leftOp,Me=Ht(_e.outrec),Ge=Me.frontEdge!==void 0,st=_e.pt.y,kt=_e,Ti=_e;if(Ge){let Hi=Me.pts,pi=Hi.next;for(;kt!==pi&&kt.prev.pt.y===st;)kt=kt.prev;for(;Ti!==Hi&&Ti.next.pt.y===st;)Ti=Ti.next}else{for(;kt.prev!==Ti&&kt.prev.pt.y===st;)kt=kt.prev;for(;Ti.next!==kt&&Ti.next.pt.y===st;)Ti=Ti.next}let Vi=Tn(Ve,kt,Ti)&&Ve.leftOp.horz===void 0;return Vi?Ve.leftOp.horz=Ve:Ve.rightOp=void 0,Vi},pr=(Ve,_e)=>{let Me={pt:T.clone(Ve.pt),outrec:Ve.outrec};return _e?(Me.next=Ve.next,Me.next.prev=Me,Me.prev=Ve,Ve.next=Me):(Me.prev=Ve.prev,Me.prev.next=Me,Me.next=Ve,Ve.prev=Me),Me},yn=Ve=>{let _e=new oe,Me=Ve;for(;Me.next!==Ve&&(Me.pt.x===Me.next.pt.x&&Me.pt.x===Me.prev.pt.x||Me.pt.y===Me.next.pt.y&&Me.pt.y===Me.prev.pt.y);)Me=Me.next;_e.push(Me.pt);let Ge=Me;for(Me=Me.next;Me!==Ve;)(Me.pt.x!==Me.next.pt.x||Me.pt.x!==Ge.pt.x)&&(Me.pt.y!==Me.next.pt.y||Me.pt.y!==Ge.pt.y)&&(_e.push(Me.pt),Ge=Me),Me=Me.next;return _e},dn=(Ve,_e)=>{if(_e===_e.next||_e.prev===_e.next)return S.IsOutside;let Me=_e;do{if(_e.pt.y!==Ve.y)break;_e=_e.next}while(_e!==Me);if(_e.pt.y===Ve.y)return S.IsOutside;let Ge=_e.pt.yVe.y;)Me=Me.next;if(Me===_e)break;if(Me.pt.y===Ve.y){if(Me.pt.x===Ve.x||Me.pt.y===Me.prev.pt.y&&Ve.x{let Me,Ge=0,st=Ve;do Me=dn(st.pt,_e),Me===S.IsOutside?Ge++:Me===S.IsInside&&Ge--,st=st.next;while(st!==Ve&&Math.abs(Ge)<2);if(Math.abs(Ge)>1)return Ge<0;let kt=Va(yn(Ve)).midPoint(),Ti=yn(_e);return J(kt,Ti)!==S.IsOutside},Or=(Ve,_e)=>A(Ve.x-_e.x)<2n&&A(Ve.y-_e.y)<2n,On=Ve=>Ve.next.next===Ve.prev&&(Or(Ve.prev.pt,Ve.next.pt)||Or(Ve.pt,Ve.next.pt)||Or(Ve.pt,Ve.prev.pt)),eo=Ve=>Ve!==void 0&&Ve.next!==Ve&&(Ve.next!==Ve.prev||!On(Ve)),Cn=Ve=>{let _e=Ve.next===Ve?void 0:Ve.next;return Ve.prev.next=Ve.next,Ve.next.prev=Ve.prev,_e},Sa=(Ve,_e,Me,Ge)=>{if(Ve===void 0||Ve.next===Ve||!Me&&Ve.next===Ve.prev)return!1;if(Ge.clear(),_e){let st=Ve.pt,kt=Ve.prev;for(Ge.push(st);kt!==Ve;)T.notEquals(kt.pt,st)&&(st=kt.pt,Ge.push(st)),kt=kt.prev}else{Ve=Ve.next;let st=Ve.pt,kt=Ve.next;for(Ge.push(st);kt!==Ve;)T.notEquals(kt.pt,st)&&(st=kt.pt,Ge.push(st)),kt=kt.next}return!(Ge.length===3&&On(Ve))},Va=Ve=>{if(Ve.length===0)return new Ue;let _e=new Ue(!1);for(let Me=0,Ge=Ve.length;Me_e.right&&(_e.right=Ve.getX(Me)),Ve.getY(Me)<_e.top&&(_e.top=Ve.getY(Me)),Ve.getY(Me)>_e.bottom&&(_e.bottom=Ve.getY(Me));return _e};class za{constructor(){v(this,"_cliptype"),v(this,"_fillrule"),v(this,"_actives"),v(this,"_sel"),v(this,"_minimaList"),v(this,"_intersectList"),v(this,"_vertexList"),v(this,"_outrecList"),v(this,"_scanlineList"),v(this,"_horzSegList"),v(this,"_horzJoinList"),v(this,"_currentLocMin"),v(this,"_currentBotY"),v(this,"_isSortedMinimaList"),v(this,"_hasOpenPaths"),v(this,"_using_polytree"),v(this,"_succeeded"),v(this,"preserveCollinear"),v(this,"reverseSolution"),this._cliptype=x.None,this._fillrule=y.EvenOdd,this._minimaList=[],this._intersectList=[],this._vertexList=[],this._outrecList=[],this._scanlineList=[],this._horzSegList=[],this._horzJoinList=[],this._currentLocMin=0,this._currentBotY=0n,this._isSortedMinimaList=!1,this._hasOpenPaths=!1,this._using_polytree=!1,this._succeeded=!1,this.preserveCollinear=!0,this.reverseSolution=!1}clearSolutionOnly(){for(;this._actives!==void 0;)this.deleteFromAEL(this._actives);this._scanlineList=[],this.disposeIntersectNodes(),this._outrecList=[],this._horzSegList=[],this._horzJoinList=[]}clear(){this.clearSolutionOnly(),this._minimaList=[],this._vertexList=[],this._currentLocMin=0,this._isSortedMinimaList=!1,this._hasOpenPaths=!1}reset(){this._isSortedMinimaList||(this._minimaList.sort(Xt),this._isSortedMinimaList=!0);for(let _e=this._minimaList.length-1;_e>=0;_e--)this._scanlineList.push(this._minimaList[_e].vertex.pt.y);this._currentBotY=0n,this._currentLocMin=0,this._actives=void 0,this._sel=void 0,this._succeeded=!0}insertScanLine(_e){let Me=this._scanlineList.findIndex(Ge=>_e<=Ge);Me===-1&&this._scanlineList.push(_e),this._scanlineList.splice(Me,0,_e)}popScanline(){if(this._scanlineList.length<1)return{result:!1,y:0n};let _e=this._scanlineList.pop();for(;this._scanlineList.length>=1&&_e===this._scanlineList[this._scanlineList.length-1];)this._scanlineList.pop();return{result:!0,y:_e}}hasLocMinAtY(_e){return this._currentLocMin0;case y.Negative:return _e.windCount2<0;default:return _e.windCount2!==0}case x.Union:switch(this._fillrule){case y.Positive:return _e.windCount2<=0;case y.Negative:return _e.windCount2>=0;default:return _e.windCount2===0}case x.Difference:{let Me;switch(this._fillrule){case y.Positive:Me=_e.windCount2<=0;break;case y.Negative:Me=_e.windCount2>=0;break;default:Me=_e.windCount2===0;break}return yi(_e)===C.Subject?Me:!Me}case x.Xor:return!0;default:return!1}}isContributingOpen(_e){let Me=!1,Ge=!1;switch(this._fillrule){case y.Positive:Me=_e.windCount>0,Ge=_e.windCount2>0;break;case y.Negative:Me=_e.windCount<0,Ge=_e.windCount2<0;break;default:Me=_e.windCount!==0,Ge=_e.windCount2!==0;break}switch(this._cliptype){case x.Intersection:return Ge;case x.Union:return!Me&&!Ge;default:return!Ge}}setWindCountForClosedPathEdge(_e){let Me=_e.prevInAEL,Ge=yi(_e);for(;Me!==void 0&&(yi(Me)!==Ge||gt(Me));)Me=Me.prevInAEL;if(Me===void 0?(_e.windCount=_e.windDx,Me=this._actives):this._fillrule===y.EvenOdd?(_e.windCount=_e.windDx,_e.windCount2=Me.windCount2,Me=Me.nextInAEL):(Me.windCount*Me.windDx<0?Math.abs(Me.windCount)>1?Me.windDx*_e.windDx<0?_e.windCount=Me.windCount:_e.windCount=Me.windCount+_e.windDx:_e.windCount=gt(_e)?1:_e.windDx:Me.windDx*_e.windDx<0?_e.windCount=Me.windCount:_e.windCount=Me.windCount+_e.windDx,_e.windCount2=Me.windCount2,Me=Me.nextInAEL),this._fillrule===y.EvenOdd)for(;Me!==_e;)yi(Me)!==Ge&&!gt(Me)&&(_e.windCount2=_e.windCount2===0?1:0),Me=Me.nextInAEL;else for(;Me!==_e;)yi(Me)!==Ge&&!gt(Me)&&(_e.windCount2+=Me.windDx),Me=Me.nextInAEL}setWindCountForOpenPathEdge(_e){let Me=this._actives;if(this._fillrule===y.EvenOdd){let Ge=0,st=0;for(;Me!==_e;)yi(Me)===C.Clip?st++:gt(Me)||Ge++,Me=Me.nextInAEL;_e.windCount=At(Ge)?1:0,_e.windCount2=At(st)?1:0}else for(;Me!==_e;)yi(Me)===C.Clip?_e.windCount2+=Me.windDx:gt(Me)||(_e.windCount+=Me.windDx),Me=Me.nextInAEL}insertLeftEdge(_e){if(this._actives===void 0)_e.prevInAEL=void 0,_e.nextInAEL=void 0,this._actives=_e;else if(!wt(this._actives,_e))_e.prevInAEL=void 0,_e.nextInAEL=this._actives,this._actives.prevInAEL=_e,this._actives=_e;else{let Me=this._actives;for(;Me.nextInAEL!==void 0&&wt(Me.nextInAEL,_e);)Me=Me.nextInAEL;Me.joinWith===I.Right&&(Me=Me.nextInAEL),_e.nextInAEL=Me.nextInAEL,Me.nextInAEL!==void 0&&(Me.nextInAEL.prevInAEL=_e),_e.prevInAEL=Me,Me.nextInAEL=_e}}insertLocalMinimaIntoAEL(_e){let Me,Ge,st;for(;this.hasLocMinAtY(_e);){Me=this.popLocalMinima(),(Me.vertex.flags&M.OpenStart)!==M.None?Ge=void 0:(Ge={bot:T.clone(Me.vertex.pt),curX:Me.vertex.pt.x,windDx:-1,vertexTop:Me.vertex.prev,top:T.clone(Me.vertex.prev.pt),outrec:void 0,localMinVertex:Me.vertex,localMinPolytype:Me.polytype,localMinIsOpen:Me.isOpen,isLeftBound:!1,dx:0,windCount:0,windCount2:0,joinWith:I.None},wi(Ge)),(Me.vertex.flags&M.OpenEnd)!==M.None?st=void 0:(st={bot:T.clone(Me.vertex.pt),curX:Me.vertex.pt.x,windDx:1,vertexTop:Me.vertex.next,top:T.clone(Me.vertex.next.pt),outrec:void 0,localMinVertex:Me.vertex,localMinPolytype:Me.polytype,localMinIsOpen:Me.isOpen,isLeftBound:!1,dx:0,windCount:0,windCount2:0,joinWith:I.None},wi(st)),Ge===void 0?(Ge=st,st=void 0):st!==void 0&&(Li(Ge)?Je(Ge)&&([Ge,st]=[st,Ge]):Li(st)?Nt(st)&&([Ge,st]=[st,Ge]):Ge.dx0?Gt(kt,_e,Me):Gt(kt,Me,_e);else{kt.isOpen=!1;let Vi=bi(_e);Vi!==void 0?(this._using_polytree&&jt(kt,Vi.outrec),kt.owner=Vi.outrec,Yt(Vi)===st?Gt(kt,Me,_e):Gt(kt,_e,Me)):(kt.owner=void 0,st?Gt(kt,_e,Me):Gt(kt,Me,_e))}let Ti={pt:Ge,outrec:kt};return Ti.next=Ti,Ti.prev=Ti,kt.pts=Ti,Ti}addLocalMaxPoly(_e,Me,Ge){if(nt(_e)&&this.split(_e,Ge),nt(Me)&&this.split(Me,Ge),Yi(_e)===Yi(Me))if(Jt(_e))Fi(_e.outrec);else if(Jt(Me))Fi(Me.outrec);else{this._succeeded=!1;return}let st=Et(_e,Ge);if(_e.outrec===Me.outrec){let kt=_e.outrec;if(kt.pts=st,this._using_polytree){let Ti=bi(_e);Ti===void 0?kt.owner=void 0:jt(kt,Ti.outrec)}_t(_e)}else gt(_e)?_e.windDx<0?Tt(_e,Me):Tt(Me,_e):_e.outrec.idx0?(Ge.frontEdge=_e,Ge.backEdge=void 0):(Ge.frontEdge=void 0,Ge.backEdge=_e),_e.outrec=Ge;let st={pt:T.clone(Me),outrec:Ge};return st.next=st,st.prev=st,Ge.pts=st,st}updateEdgeIntoAEL(_e){if(_e.bot=T.clone(_e.top),_e.vertexTop=ji(_e),_e.top=T.clone(_e.vertexTop.pt),_e.curX=_e.bot.x,wi(_e),nt(_e)&&this.split(_e,_e.bot),Li(_e)){gt(_e)||Si(_e,this.preserveCollinear);return}this.insertScanLine(_e.top.y),this.checkJoinLeft(_e,_e.bot),this.checkJoinRight(_e,_e.bot,!0)}intersectEdges(_e,Me,Ge){let st;if(this._hasOpenPaths&&(gt(_e)||gt(Me))){if(gt(_e)&>(Me))return;if(gt(Me)&&([_e,Me]=[Me,_e]),nt(Me)&&this.split(Me,Ge),this._cliptype===x.Union){if(!bt(Me))return}else if(Me.localMinPolytype===C.Subject)return;switch(this._fillrule){case y.Positive:if(Me.windCount!==1)return;break;case y.Negative:if(Me.windCount!==-1)return;break;default:if(Math.abs(Me.windCount)!==1)return;break}if(bt(_e))st=Et(_e,Ge),Yi(_e)?_e.outrec.frontEdge=void 0:_e.outrec.backEdge=void 0,_e.outrec=void 0;else if(T.equals(Ge,_e.localMinVertex.pt)&&!It(_e.localMinVertex)){let pi=ti(_e);if(pi!==void 0&&bt(pi))return _e.outrec=pi.outrec,_e.windDx>0?Gt(pi.outrec,_e,pi):Gt(pi.outrec,pi,_e),pi.outrec.pts;st=this.startOpenPath(_e,Ge)}else st=this.startOpenPath(_e,Ge);return st}nt(_e)&&this.split(_e,Ge),nt(Me)&&this.split(Me,Ge);let kt,Ti;switch(_e.localMinPolytype===Me.localMinPolytype?this._fillrule===y.EvenOdd?(kt=_e.windCount,_e.windCount=Me.windCount,Me.windCount=kt):(_e.windCount+Me.windDx===0?_e.windCount=-_e.windCount:_e.windCount+=Me.windDx,Me.windCount-_e.windDx===0?Me.windCount=-Me.windCount:Me.windCount-=_e.windDx):(this._fillrule!==y.EvenOdd?_e.windCount2+=Me.windDx:_e.windCount2=_e.windCount2===0?1:0,this._fillrule!==y.EvenOdd?Me.windCount2-=_e.windDx:Me.windCount2=Me.windCount2===0?1:0),this._fillrule){case y.Positive:kt=_e.windCount,Ti=Me.windCount;break;case y.Negative:kt=-_e.windCount,Ti=-Me.windCount;break;default:kt=Math.abs(_e.windCount),Ti=Math.abs(Me.windCount);break}let Vi=kt===0||kt===1,Hi=Ti===0||Ti===1;if(!(!bt(_e)&&!Vi||!bt(Me)&&!Hi)){if(bt(_e)&&bt(Me))kt!==0&&kt!==1||Ti!==0&&Ti!==1||_e.localMinPolytype!==Me.localMinPolytype&&this._cliptype!==x.Xor?st=this.addLocalMaxPoly(_e,Me,Ge):Yi(_e)||_e.outrec===Me.outrec?(st=this.addLocalMaxPoly(_e,Me,Ge),this.addLocalMinPoly(_e,Me,Ge)):(st=Et(_e,Ge),Et(Me,Ge),$t(_e,Me));else if(bt(_e))st=Et(_e,Ge),$t(_e,Me);else if(bt(Me))st=Et(Me,Ge),$t(_e,Me);else{let pi,Qi;switch(this._fillrule){case y.Positive:pi=_e.windCount2,Qi=Me.windCount2;break;case y.Negative:pi=-_e.windCount2,Qi=-Me.windCount2;break;default:pi=Math.abs(_e.windCount2),Qi=Math.abs(Me.windCount2);break}if(!ai(_e,Me))st=this.addLocalMinPoly(_e,Me,Ge);else if(kt===1&&Ti===1)switch(st=void 0,this._cliptype){case x.Union:if(pi>0&&Qi>0)return;st=this.addLocalMinPoly(_e,Me,Ge);break;case x.Difference:(yi(_e)===C.Clip&&pi>0&&Qi>0||yi(_e)===C.Subject&&pi<=0&&Qi<=0)&&(st=this.addLocalMinPoly(_e,Me,Ge));break;case x.Xor:st=this.addLocalMinPoly(_e,Me,Ge);break;default:if(pi<=0||Qi<=0)return;st=this.addLocalMinPoly(_e,Me,Ge);break}}return st}}deleteFromAEL(_e){let Me=_e.prevInAEL,Ge=_e.nextInAEL;Me===void 0&&Ge===void 0&&_e!==this._actives||(Me!==void 0?Me.nextInAEL=Ge:this._actives=Ge,Ge!==void 0&&(Ge.prevInAEL=Me))}adjustCurrXAndCopyToSEL(_e){let Me=this._actives;for(this._sel=Me;Me!==void 0;)Me.prevInSEL=Me.prevInAEL,Me.nextInSEL=Me.nextInAEL,Me.jump=Me.nextInSEL,Me.joinWith===I.Left?Me.curX=Me.prevInAEL.curX:Me.curX=ei(Me,_e),Me=Me.nextInAEL}executeInternal(_e,Me){if(_e===x.None)return;this._fillrule=Me,this._cliptype=_e,this.reset();let Ge;if(({y:Ge}=this.popScanline()).result){for(;this._succeeded;){this.insertLocalMinimaIntoAEL(Ge);let st;for(;({value:st}=this.popHorz()).result;)this.doHorizontal(st);if(this._horzSegList.length>0&&(this.convertHorzSegsToJoins(),this._horzSegList=[]),this._currentBotY=Ge,!({y:Ge}=this.popScanline()).result)break;for(this.doIntersections(Ge),this.doTopOfScanbeam(Ge);({value:st}=this.popHorz()).result;)this.doHorizontal(st)}this._succeeded&&this.processHorzJoins()}}doIntersections(_e){this.buildIntersectList(_e)&&(this.processIntersectList(),this.disposeIntersectNodes())}disposeIntersectNodes(){this._intersectList=[]}addNewIntersectNode(_e,Me,Ge){let st;if(({ip:st}=G(_e.bot,_e.top,Me.bot,Me.top)).result||(st={x:_e.curX,y:Ge}),st.y>this._currentBotY||st.y100&&Vi>100?Ti>Vi?st=q(st,_e.bot,_e.top):st=q(st,Me.bot,Me.top):Ti>100?st=q(st,_e.bot,_e.top):Vi>100?st=q(st,Me.bot,Me.top):(st.y0}processIntersectList(){this._intersectList.sort(Ot);for(let _e=0;_eVi||!kt&&Hi.curXQi.x||!kt&&ei(Hi,Qi.y)=Qi.x||!kt&&ei(Hi,Qi.y)<=Qi.x)break}}let pi={x:Hi.curX,y:Ge};kt?(this.intersectEdges(_e,Hi,pi),this.swapPositionsInAEL(_e,Hi),this.checkJoinLeft(Hi,pi),_e.curX=Hi.curX,Hi=_e.nextInAEL):(this.intersectEdges(Hi,_e,pi),this.swapPositionsInAEL(Hi,_e),this.checkJoinRight(Hi,pi),_e.curX=Hi.curX,Hi=_e.prevInAEL),bt(_e)&&this.addToHorzSegList(this.getLastOp(_e))}if(Me&&Jt(_e)){bt(_e)&&(Et(_e,_e.top),Yi(_e)?_e.outrec.frontEdge=void 0:_e.outrec.backEdge=void 0,_e.outrec=void 0),this.deleteFromAEL(_e);return}else if(ji(_e).pt.y!==_e.top.y)break;bt(_e)&&Et(_e,_e.top),this.updateEdgeIntoAEL(_e),{result:kt,leftX:Ti,rightX:Vi}=Lt(_e,st)}if(bt(_e)){let Hi=Et(_e,_e.top);this.addToHorzSegList(Hi)}this.updateEdgeIntoAEL(_e)}doTopOfScanbeam(_e){this._sel=void 0;let Me=this._actives;for(;Me!==void 0;){if(Me.top.y===_e){if(Me.curX=Me.top.x,pt(Me)){Me=this.doMaxima(Me);continue}bt(Me)&&Et(Me,Me.top),this.updateEdgeIntoAEL(Me),Li(Me)&&this.pushHorz(Me)}else Me.curX=ei(Me,_e);Me=Me.nextInAEL}}doMaxima(_e){let Me=_e.prevInAEL,Ge=_e.nextInAEL;if(Jt(_e))return bt(_e)&&Et(_e,_e.top),Li(_e)||(bt(_e)&&(Yi(_e)?_e.outrec.frontEdge=void 0:_e.outrec.backEdge=void 0,_e.outrec=void 0),this.deleteFromAEL(_e)),Ge;let st=wr(_e);if(st===void 0)return Ge;for(nt(_e)&&this.split(_e,_e.top),nt(st)&&this.split(st,st.top);Ge!==st;)this.intersectEdges(_e,Ge,_e.top),this.swapPositionsInAEL(_e,Ge),Ge=_e.nextInAEL;return gt(_e)?(bt(_e)&&this.addLocalMaxPoly(_e,st,_e.top),this.deleteFromAEL(st),this.deleteFromAEL(_e)):(bt(_e)&&this.addLocalMaxPoly(_e,st,_e.top),this.deleteFromAEL(_e),this.deleteFromAEL(st)),Me!==void 0?Me.nextInAEL:this._actives}split(_e,Me){_e.joinWith===I.Right?(_e.joinWith=I.None,_e.nextInAEL.joinWith=I.None,this.addLocalMinPoly(_e,_e.nextInAEL,Me,!0)):(_e.joinWith=I.None,_e.prevInAEL.joinWith=I.None,this.addLocalMinPoly(_e.prevInAEL,_e,Me,!0))}checkJoinLeft(_e,Me,Ge=!1){let st=_e.prevInAEL;if(!(st===void 0||gt(_e)||gt(st)||!bt(_e)||!bt(st))&&!((Me.y-_e.top.y<2n||Me.y-st.top.y<2n)&&(_e.bot.y>Me.y||st.bot.y>Me.y))){if(Ge){if(Xi(Me,st.bot,st.top)>.25)return}else if(_e.curX!==st.curX)return;O(_e.top,Me,st.top)===0n&&(_e.outrec.idx===st.outrec.idx?this.addLocalMaxPoly(st,_e,Me):_e.outrec.idxMe.y||st.bot.y>Me.y))){if(Ge){if(Xi(Me,st.bot,st.top)>.25)return}else if(_e.curX!==st.curX)return;O(_e.top,Me,st.top)===0n&&(_e.outrec.idx===st.outrec.idx?this.addLocalMaxPoly(_e,st,Me):_e.outrec.idx=Ge.rightOp.pt.x||kt.rightOp.pt.x<=Ge.leftOp.pt.x)continue;let Ti=Ge.leftOp.pt.y;if(Ge.leftToRight){for(;Ge.leftOp.next.pt.y===Ti&&Ge.leftOp.next.pt.x<=kt.leftOp.pt.x;)Ge.leftOp=Ge.leftOp.next;for(;kt.leftOp.prev.pt.y===Ti&&kt.leftOp.prev.pt.x<=Ge.leftOp.pt.x;)kt.leftOp=kt.leftOp.prev;let Vi={op1:pr(Ge.leftOp,!0),op2:pr(kt.leftOp,!1)};this._horzJoinList.push(Vi)}else{for(;Ge.leftOp.prev.pt.y===Ti&&Ge.leftOp.prev.pt.x<=kt.leftOp.pt.x;)Ge.leftOp=Ge.leftOp.prev;for(;kt.leftOp.next.pt.y===Ti&&kt.leftOp.next.pt.x<=Ge.leftOp.pt.x;)kt.leftOp=kt.leftOp.next;let Vi={op1:pr(kt.leftOp,!0),op2:pr(Ge.leftOp,!1)};this._horzJoinList.push(Vi)}}}}}moveSplits(_e,Me){if(_e.splits!==void 0){Me.splits??(Me.splits=[]);for(let Ge of _e.splits)Me.splits.push(Ge);_e.splits=void 0}}processHorzJoins(){for(let _e of this._horzJoinList){let Me=Ht(_e.op1.outrec),Ge=Ht(_e.op2.outrec),st=_e.op1.next,kt=_e.op2.prev;if(_e.op1.next=_e.op2,_e.op2.prev=_e.op1,st.prev=kt,kt.next=st,Me===Ge)if(Ge=this.newOutRec(),Ge.pts=st,xr(Ge),Me.pts.outrec===Ge&&(Me.pts=_e.op1,Me.pts.outrec=Me),this._using_polytree){if(fn(Me.pts,Ge.pts)){let Ti=Me.pts;Me.pts=Ge.pts,Ge.pts=Ti,xr(Me),xr(Ge),Ge.owner=Me}else fn(Ge.pts,Me.pts)?Ge.owner=Me:Ge.owner=Me.owner;Me.splits??(Me.splits=[]),Me.splits.push(Ge.idx)}else Ge.owner=Me;else Ge.pts=void 0,this._using_polytree?(jt(Ge,Me),this.moveSplits(Ge,Me)):Ge.owner=Me}}cleanCollinear(_e){if(_e=Ht(_e),_e===void 0||_e.isOpen)return;if(!eo(_e.pts)){_e.pts=void 0;return}let Me=_e.pts,Ge=Me;for(;;){if((!this.preserveCollinear||T.equals(Ge.pt,Ge.prev.pt)||T.equals(Ge.pt,Ge.next.pt)||k(Ge.prev.pt,Ge.pt,Ge.next.pt)<0n)&&O(Ge.prev.pt,Ge.pt,Ge.next.pt)===0n){if(Ge===_e.pts&&(_e.pts=Ge.prev),Ge=Cn(Ge),!eo(Ge)){_e.pts=void 0;return}Me=Ge;continue}if(Ge=Ge.next,Ge===Me)break}this.fixSelfIntersects(_e)}doSplitOp(_e,Me){let Ge=Me.prev,st=Me.next.next;_e.pts=Ge;let{ip:kt}=G(Ge.pt,Me.pt,Me.next.pt,st.pt),Ti=ct(Ge),Vi=Math.abs(Ti);if(Vi<2){_e.pts=void 0;return}let Hi=Pe(kt,Me.pt,Me.next.pt),pi=Math.abs(Hi);if(T.equals(kt,Ge.pt)||T.equals(kt,st.pt))st.prev=Ge,Ge.next=st;else{let Qi={pt:kt,outrec:_e,prev:Ge,next:st};st.prev=Qi,Ge.next=Qi}if(pi>1&&(pi>Vi||Hi>0==Ti>0)){let Qi=this.newOutRec();Qi.owner=_e.owner,Me.outrec=Qi,Me.next.outrec=Qi;let dr={pt:kt,outrec:Qi,prev:Me.next,next:Me};Qi.pts=dr,Me.prev=dr,Me.next.next=dr,this._using_polytree&&(fn(Ge,dr)?(Qi.splits??(Qi.splits=[]),Qi.splits.push(_e.idx)):(_e.splits??(_e.splits=[]),_e.splits.push(Qi.idx)))}}fixSelfIntersects(_e){let Me=_e.pts;for(;Me.prev!==Me.next.next;){if(j(Me.prev.pt,Me.pt,Me.next.pt,Me.next.next.pt)){if(this.doSplitOp(_e,Me),_e.pts===void 0)return;Me=_e.pts;continue}else Me=Me.next;if(Me===_e.pts)break}}buildPaths(_e,Me){_e.clear(),Me?.clear();let Ge=0;for(;Ge_e.right&&(_e.right=Ge.pt.x),Ge.pt.y<_e.top&&(_e.top=Ge.pt.y),Ge.pt.y>_e.bottom&&(_e.bottom=Ge.pt.y),Ge=Ge.next;while(Ge!==Me)}return _e.isEmpty()?new Ue:_e}}class zr{constructor(_e){v(this,"_parent"),v(this,"_childs"),this._parent=_e,this._childs=[]}getLevel(){let _e=0,Me=this._parent;for(;Me!==void 0;)_e++,Me=Me._parent;return _e}getIsHole(){let _e=this.getLevel();return _e!==0&&(_e&1)===0}get length(){return this._childs.length}clear(){this._childs.length=0}addChild(_e){}*[Symbol.iterator](){for(let _e of this._childs)yield _e}}class Ci extends zr{constructor(){super(...arguments),v(this,"polygon")}addChild(_e){let Me=new Ci(this);return Me.polygon=_e,this._childs.push(Me),Me}child(_e){if(_e<0||_e>=this._childs.length)throw new RangeError("Invalid array length.");return this._childs[_e]}area(){let _e=this.polygon===void 0?0:du(this.polygon);for(let Me of this._childs)_e+=Me.area();return _e}}class Ni extends Ci{}let cr=Ve=>w(Ve)&&"asScaledPathD"in Ve&&typeof Ve.asScaledPathD=="function"&&"asScaledPath64"in Ve&&typeof Ve.asScaledPath64=="function";class Bi{constructor(_e,Me){v(this,"_wrapedObject"),v(this,"_scale"),this._wrapedObject=_e,this._scale=Me}*[Symbol.iterator](){for(let _e of this._wrapedObject)E(_e)?yield T.clone(_e):yield T.createScaledPoint(_e.x,_e.y,this._scale)}}class Ct{constructor(_e,Me){v(this,"_wrapedObject"),v(this,"_scale"),this._wrapedObject=_e,this._scale=Me}get length(){return this._wrapedObject}*[Symbol.iterator](){if(cr(this._wrapedObject))yield this._wrapedObject.asScaledPath64(this._scale);else for(let _e of this._wrapedObject)if(E(_e)){yield this._wrapedObject;break}else if(se(_e)){yield new Bi(this._wrapedObject,this._scale);break}else cr(_e)?yield _e.asScaledPath64(this._scale):Q(_e)?yield _e:yield new Bi(_e,this._scale)}}class Mi extends za{addPath(_e,Me,Ge=!1){this.addPaths(_e,Me,Ge)}addPaths(_e,Me,Ge=!1){super.addPaths(new Ct(_e,1),Me,Ge)}addSubject(_e){this.addPaths(_e,C.Subject)}addOpenSubject(_e){this.addPaths(_e,C.Subject,!0)}addClip(_e){this.addPaths(_e,C.Clip)}execute(_e,Me,Ge,st){return Ge instanceof Ni?(Ge.clear(),st?.clear(),this._using_polytree=!0,this.executeInternal(_e,Me),this.buildTree(Ge,st)):(Ge.clear(),st?.clear(),this.executeInternal(_e,Me),this.buildPaths(Ge,st)),this.clearSolutionOnly(),this._succeeded}}class $i extends zr{constructor(_e){super(_e),v(this,"scale"),v(this,"polygon"),this.scale=0}addChild(_e){if(Q(_e)){let Me=new $i(this);return Me.scale=this.scale,Me.polygon=vf(_e,1/this.scale),this._childs.push(Me),Me}else if(fe(_e)){let Me=new $i(this);return Me.scale=this.scale,Me.polygon=_e.clone(),this._childs.push(Me),Me}throw new TypeError("Invalid argument types.")}area(){let _e=this.polygon===void 0?0:du(this.polygon);for(let Me of this._childs)_e+=Me.area();return _e}}class ur extends $i{}class Nr extends za{constructor(_e=2){super(),v(this,"_scale"),v(this,"_invScale"),L(_e),this._scale=Math.pow(10,_e),this._invScale=1/this._scale}addPath(_e,Me,Ge=!1){this.addPaths(_e,Me,Ge)}addPaths(_e,Me,Ge=!1){super.addPaths(new Ct(_e,this._scale),Me,Ge)}addSubject(_e){this.addPaths(_e,C.Subject)}addOpenSubject(_e){this.addPaths(_e,C.Subject,!0)}addClip(_e){this.addPaths(_e,C.Clip)}execute(_e,Me,Ge,st){if(Ge instanceof ur){Ge.clear(),st?.clear(),this._using_polytree=!0,Ge.scale=this._scale;let kt=new ce;if(this.executeInternal(_e,Me),this.buildTree(Ge,kt),this.clearSolutionOnly(),st!==void 0)for(let Ti of kt)cr(Ti)?st.directPush(Ti.asScaledPathD(this._invScale)):st.directPush(vf(Ti,this._invScale))}else{let kt=new ce,Ti=st===void 0?void 0:new ce;Ge.clear(),st?.clear(),this.executeInternal(_e,Me),this.buildPaths(kt,Ti),this.clearSolutionOnly();for(let Vi of kt)cr(Vi)?Ge.directPush(Vi.asScaledPathD(this._invScale)):Ge.directPush(vf(Vi,this._invScale));if(Ti!==void 0&&st!==void 0)for(let Vi of Ti)cr(Vi)?st.directPush(Vi.asScaledPathD(this._invScale)):st.directPush(vf(Vi,this._invScale))}return!0}}let qe=(Ve,_e,Me,Ge)=>{let st=Ge?0:1,kt=Ve.length,Ti=_e.length,Vi=new ce;for(let dr of _e){let bn=new oe;if(Me)for(let go of Ve)bn.push({x:dr.x+go.x,y:dr.y+go.y});else for(let go of Ve)bn.push({x:dr.x-go.x,y:dr.y-go.y});Vi.push(bn)}let Hi=new ce,pi=Ge?Ti-1:0,Qi=kt-1;for(let dr=st;dr{let _e=[];for(let Me of Ve){if(Me.length<1){_e.push(new Ue(!1));continue}let Ge=Me.getX(0),st=Me.getY(0),kt=new Ue(Ge,st,Ge,st);for(let Ti=0;Tikt.bottom?kt.bottom=Hi:Hikt.right?kt.right=Vi:Vi{let _e=-1,Me=9223372036854775807n,Ge=-9223372036854775808n;for(let st=0;stGe||kt.bottom===Ge&&kt.left=0&&this.isHoleList[this.lowestPathIdx],this.pathsReversed)for(let kt=0;kt!1),this.pathsReversed=!1}}let Kn=1e-12,Un=2305843009213693951n,Qn=-2305843009213693951n;class Pa{constructor(_e=2,Me=0,Ge=!1,st=!1){v(this,"_groupList"),v(this,"_inPath"),v(this,"_pathOut"),v(this,"_normals"),v(this,"_solution"),v(this,"_groupDelta"),v(this,"_delta"),v(this,"_mitLimSqr"),v(this,"_stepsPerRad"),v(this,"_stepSin"),v(this,"_stepCos"),v(this,"_joinType"),v(this,"_endType"),v(this,"arcTolerance"),v(this,"mergeGroups"),v(this,"miterLimit"),v(this,"preserveCollinear"),v(this,"reverseSolution"),v(this,"deltaCallback"),this.miterLimit=_e,this.arcTolerance=Me,this.mergeGroups=!0,this.preserveCollinear=Ge,this.reverseSolution=st,this._groupList=[],this._inPath=new oe,this._pathOut=new oe,this._normals=new re,this._solution=new ce,this._groupDelta=0,this._delta=0,this._mitLimSqr=0,this._stepsPerRad=0,this._stepSin=0,this._stepCos=0,this._joinType=Zt.Bevel,this._endType=ui.Polygon}clear(){this._groupList.length=0}addPath(_e,Me,Ge){if(_e.length===0)return;let st=new ce;st.push(_e),this.addPaths(st,Me,Ge)}addPaths(_e,Me,Ge){_e.length!==0&&this._groupList.push(new ln(_e,Me,Ge))}executeInternal(_e){if(this._solution.clear(),this._groupList.length!==0){if(Math.abs(_e)<.5){for(let Me of this._groupList)for(let Ge of Me.inPaths)this._solution.push(Ge);return}this._delta=_e,this._mitLimSqr=this.miterLimit<=1?2:2/Ie(this.miterLimit);for(let Me of this._groupList)this.doGroupOffset(Me)}}checkPathReversed(){let _e=!1;for(let Me of this._groupList)if(Me.endType===ui.Polygon){_e=Me.pathsReversed;break}return _e}execute(_e,Me){let Ge;if(typeof _e=="number"?Ge=_e:(this.deltaCallback=_e,Ge=1),Me.clear(),this.executeInternal(Ge),this._groupList.length===0)return;let st=this.checkPathReversed(),kt=st?y.Negative:y.Positive,Ti=new Mi;Ti.preserveCollinear=this.preserveCollinear,Ti.reverseSolution=this.reverseSolution!==st,Ti.addSubject(this._solution),Ti.execute(x.Union,kt,Me)}getUnitNormal(_e,Me){let Ge=Number(Me.x-_e.x),st=Number(Me.y-_e.y);if(Ge===0&&st===0)return{x:0,y:0};let kt=1/Math.sqrt(Ge*Ge+st*st);return Ge*=kt,st*=kt,{x:st,y:-Ge}}validateBounds(_e,Me){let Ge=na(Math.trunc(Me));for(let st of _e)if(st.isValid()){if(st.leftUn+Ge||st.topUn+Ge)return!1}else continue;return!0}translatePoint(_e,Me,Ge){return{x:_e.x+Me,y:_e.y+Ge}}reflectPoint(_e,Me){return{x:Me.x+(Me.x-_e.x),y:Me.y+(Me.y-_e.y)}}almostZero(_e,Me=.001){return Math.abs(_e).01?this.arcTolerance:Math.log10(2+Qi)*D,bn=Math.PI/Math.acos(1-dr/Qi);this._stepSin=Math.sin(2*Math.PI/bn),this._stepCos=Math.cos(2*Math.PI/bn),this._groupDelta<0&&(this._stepSin=-this._stepSin),this._stepsPerRad=bn/(2*Math.PI)}let kt=this._normals.getClone(Ge),Ti=this._normals.getClone(Me),Vi=_e.getClone(Me),Hi={x:kt.x*this._groupDelta,y:kt.y*this._groupDelta};Me===Ge&&(Hi.x=-Hi.x,Hi.y=-Hi.y),this._pathOut.push({x:Vi.x+na(Hi.x),y:Vi.y+na(Hi.y)});let pi=Math.ceil(this._stepsPerRad*Math.abs(st));for(let Qi=1;Qi1?Vi=1:Vi<-1&&(Vi=-1),this.deltaCallback!==void 0&&(this._groupDelta=this.deltaCallback(Me,this._normals,Ge,st),_e.pathsReversed&&(this._groupDelta=-this._groupDelta));let pi=Me.getClone(Ge);return Math.abs(this._groupDelta)-.99&&Vi*this._groupDelta<0?(this._pathOut.push(this.getPerpendic(pi,kt)),this._pathOut.push(pi),this._pathOut.push(this.getPerpendic(pi,Ti))):Hi>.999&&this._joinType!==Zt.Round?this.doMiter(Me,Ge,st,Hi):this._joinType===Zt.Miter?Hi>this._mitLimSqr-1?this.doMiter(Me,Ge,st,Hi):this.doSquare(Me,Ge,st):this._joinType===Zt.Round?this.doRound(Me,Ge,st,Math.atan2(Vi,Hi)):this._joinType===Zt.Bevel?this.doBevel(Me,Ge,st):this.doSquare(Me,Ge,st),Ge)}offsetPolygon(_e,Me){this._pathOut=new oe;let Ge=Me.length,st=Ge-1;for(let kt=0;kt0;Vi--){let Hi=this._normals.getClone(Vi-1);this._normals.set(Vi,-Hi.x,-Hi.y)}let kt=this._normals.getClone(Ge);this._normals.set(0,kt.x,kt.y),this.deltaCallback!==void 0&&(this._groupDelta=this.deltaCallback(Me,this._normals,Ge,Ge));let Ti=Me.getClone(Ge);if(Math.abs(this._groupDelta)0;Vi--)Hi=this.offsetPoint(_e,Me,Vi,Hi);this._solution.push(this._pathOut)}doGroupOffset(_e){_e.endType===ui.Polygon?(_e.lowestPathIdx<0&&(this._delta=Math.abs(this._delta)),this._groupDelta=_e.pathsReversed?-this._delta:this._delta):this._groupDelta=Math.abs(this._delta);let Me=Math.abs(this._groupDelta);if(!this.validateBounds(_e.boundsList,Me))throw new RangeError("Coordinate range is invalid.");if(this._joinType=_e.joinType,this._endType=_e.endType,_e.joinType===Zt.Round||_e.endType===ui.Round){let st=this.arcTolerance>.01?this.arcTolerance:Math.log10(2+Me)*D,kt=Math.PI/Math.acos(1-st/Me);this._stepSin=Math.sin(2*Math.PI/kt),this._stepCos=Math.cos(2*Math.PI/kt),this._groupDelta<0&&(this._stepSin=-this._stepSin),this._stepsPerRad=kt/(2*Math.PI)}let Ge=0;for(let st of _e.inPaths){let kt=_e.boundsList[Ge],Ti=_e.isHoleList[Ge];if(Ge++,!kt.isValid())continue;let Vi=st.length;if(!(Vi===0||Vi<3&&this._endType===ui.Polygon)){if(this._pathOut=new oe,Vi===1){let Hi=st.getClone(0);if(_e.endType===ui.Round){let pi=Me,Qi=Math.ceil(this._stepsPerRad*2*Math.PI);this._pathOut=WC(Hi,pi,pi,Qi)}else{let pi=BigInt(Math.ceil(this._groupDelta)),Qi=new Ue(Hi.x-pi,Hi.y-pi,Hi.x+pi,Hi.y+pi);this._pathOut=Qi.asPath()}this._solution.push(this._pathOut);continue}this._groupDelta>0==(Ti!==_e.pathsReversed)&&(kt.width>kt.height?kt.height:kt.width)<=-(this._groupDelta*2)||(Vi==2&&_e.endType===ui.Joined&&(_e.joinType===Zt.Round?this._endType=ui.Round:this._endType=ui.Square),this.bulidNormals(st),this._endType===ui.Polygon?this.offsetPolygon(_e,st):this._endType===ui.Joined?this.offsetOpenJoined(_e,st):this.offsetOpenPath(_e,st))}}}}let Gn={left:0,top:1,right:2,bottom:3,inside:4},Ja=(Ve,_e)=>{let Me=0;for(let Ge of _e){switch(J(Ge,Ve)){case S.IsInside:Me--;break;case S.IsOutside:Me++;break}if(Math.abs(Me)>1)break}return Me<=0},fl=(Ve,_e,Me,Ge,st)=>Ul(Ve,_e)?O(Me,st,Ge)<0:hu(Ve,_e),Ul=(Ve,_e)=>Math.abs(Ve-_e)===2,hu=(Ve,_e)=>(Ve+1)%4===_e,Ys=(Ve,_e)=>(Ve+(_e?1:3))%4,Wd=Ve=>{if(Ve!==Ve.next)return Ve.prev.next=Ve.next,Ve.next.prev=Ve.prev,Ve.next},Pc=Ve=>{if(Ve.next!==Ve)return Ve.prev.next=Ve.next,Ve.next.prev=Ve.prev,Ve.prev},So=(Ve,_e)=>{let Me=0;return Ve.x===_e.left?Me=1:Ve.x===_e.right&&(Me=4),Ve.y===_e.top?Me+=2:Ve.y===_e.bottom&&(Me+=8),Me},Kh=(Ve,_e,Me)=>{switch(Me){case 0:return _e.yVe.x;case 2:return _e.y>Ve.y;default:return _e.xVe.xMe.x,Gl=(Ve,_e,Me,Ge)=>Ve.yMe.y,Wl=(Ve,_e)=>{_e.edge===void 0&&(_e.edge=Ve,Ve.push(_e))},Th=Ve=>{if(Ve.edge!==void 0){for(let _e=0;_e{Ve.ownerIdx=_e;let Me=Ve.next;for(;Me!==Ve;)Me.ownerIdx=_e,Me=Me.next},mo=(Ve,_e)=>_e.x===Ve.left&&_e.y>=Ve.top&&_e.y<=Ve.bottom?{result:!1,loc:Gn.left}:_e.x===Ve.right&&_e.y>=Ve.top&&_e.y<=Ve.bottom?{result:!1,loc:Gn.right}:_e.y===Ve.top&&_e.x>=Ve.left&&_e.x<=Ve.right?{result:!1,loc:Gn.top}:_e.y===Ve.bottom&&_e.x>=Ve.left&&_e.x<=Ve.right?{result:!1,loc:Gn.bottom}:_e.xVe.right?{result:!0,loc:Gn.right}:_e.yVe.bottom?{result:!0,loc:Gn.bottom}:{result:!0,loc:Gn.inside},Wn=(Ve,_e)=>Ve.y===_e.y,yo=(Ve,_e,Me,Ge)=>{let st=O(Ve,Me,Ge),kt=O(_e,Me,Ge),Ti;if(st===0n){Ti=T.clone(Ve);let pi;return kt===0n?pi=!1:T.equals(Ve,Me)||T.equals(Ve,Ge)?pi=!0:Wn(Me,Ge)?pi=Ve.x>Me.x==Ve.xMe.y==Ve.yMe.x==_e.xMe.y==_e.y0==kt>0)return Ti={x:0n,y:0n},{result:!1,ip:Ti};let Vi=O(Me,Ve,_e),Hi=O(Ge,Ve,_e);if(Vi===0n){Ti=T.clone(Me);let pi;return T.equals(Me,Ve)||T.equals(Me,_e)?pi=!0:Wn(Ve,_e)?pi=Me.x>Ve.x==Me.x<_e.x:pi=Me.y>Ve.y==Me.y<_e.y,{result:pi,ip:Ti}}else if(Hi===0n){Ti=T.clone(Ge);let pi;return T.equals(Ge,Ve)||T.equals(Ge,_e)?pi=!0:Wn(Ve,_e)?pi=Ge.x>Ve.x==Ge.x<_e.x:pi=Ge.y>Ve.y==Ge.y<_e.y,{result:pi,ip:Ti}}return Vi>0==Hi>0?(Ti={x:0n,y:0n},{result:!1,ip:Ti}):G(Ve,_e,Me,Ge)};class Ga{constructor(_e){v(this,"_rect"),v(this,"_mp"),v(this,"_rectPath"),v(this,"_pathBounds"),v(this,"_results"),v(this,"_edges"),v(this,"_currIdx"),this._currIdx=-1,this._rect=_e,this._mp=_e.midPoint(),this._rectPath=_e.asPath(),this._pathBounds=new Ue,this._results=[],this._edges=[];for(let Me=0;Me<8;Me++)this._edges[Me]=[]}add(_e,Me=!1){let Ge=this._results.length,st;if(Ge===0||Me)st={ownerIdx:Ge,pt:T.clone(_e)},this._results.push(st),st.prev=st,st.next=st;else{Ge--;let kt=this._results[Ge];if(T.equals(kt.pt,_e))return kt;st={ownerIdx:Ge,pt:T.clone(_e),next:kt.next},kt.next.prev=st,kt.next=st,st.prev=kt,this._results[Ge]=st}return st}addCorner(_e,Me){this.add(this._rectPath.getClone(hu(_e,Me)?_e:Me))}addCornerRef(_e,Me){return Me?(this.add(this._rectPath.getClone(_e)),_e=Ys(_e,!0),_e):(_e=Ys(_e,!1),this.add(this._rectPath.getClone(_e)),_e)}getIntersection(_e,Me,Ge,st){let kt={x:0n,y:0n},Ti,Vi=_e.getClone(0),Hi=_e.getClone(1),pi=_e.getClone(2),Qi=_e.getClone(3);switch(st){case Gn.left:if(({result:Ti,ip:kt}=yo(Me,Ge,Vi,Qi)).result)break;if(Me.yHi.x&&({result:Ti,ip:kt}=yo(Me,Ge,Hi,pi)).result){st=Gn.right;break}else{Ti=!1;break}case Gn.bottom:if(({result:Ti,ip:kt}=yo(Me,Ge,pi,Qi)).result)break;if(Me.xpi.x&&({result:Ti,ip:kt}=yo(Me,Ge,Hi,pi)).result){st=Gn.right;break}else{Ti=!1;break}default:if(({result:Ti,ip:kt}=yo(Me,Ge,Vi,Qi)).result){st=Gn.left;break}else if(({result:Ti,ip:kt}=yo(Me,Ge,Vi,Hi)).result){st=Gn.top;break}else if(({result:Ti,ip:kt}=yo(Me,Ge,Hi,pi)).result){st=Gn.right;break}else if(({result:Ti,ip:kt}=yo(Me,Ge,pi,Qi)).result){st=Gn.bottom;break}else{Ti=!1;break}}return{result:Ti,ip:kt,loc:st}}getNextLocation(_e,Me,Ge,st){switch(Me){case Gn.left:{for(;Ge<=st&&_e.getX(Ge)<=this._rect.left;)Ge++;if(Ge>st)break;let kt=_e.getClone(Ge);kt.x>=this._rect.right?Me=Gn.right:kt.y<=this._rect.top?Me=Gn.top:kt.y>=this._rect.bottom?Me=Gn.bottom:Me=Gn.inside;break}case Gn.top:{for(;Ge<=st&&_e.getY(Ge)<=this._rect.top;)Ge++;if(Ge>st)break;let kt=_e.getClone(Ge);kt.y>=this._rect.bottom?Me=Gn.bottom:kt.x<=this._rect.left?Me=Gn.left:kt.x>=this._rect.right?Me=Gn.right:Me=Gn.inside;break}case Gn.right:{for(;Ge<=st&&_e.getX(Ge)>=this._rect.right;)Ge++;if(Ge>st)break;let kt=_e.getClone(Ge);kt.x<=this._rect.left?Me=Gn.left:kt.y<=this._rect.top?Me=Gn.top:kt.y>=this._rect.bottom?Me=Gn.bottom:Me=Gn.inside;break}case Gn.bottom:{for(;Ge<=st&&_e.getY(Ge)>=this._rect.bottom;)Ge++;if(Ge>st)break;let kt=_e.getClone(Ge);kt.y<=this._rect.top?Me=Gn.top:kt.x<=this._rect.left?Me=Gn.left:kt.x>=this._rect.right?Me=Gn.right:Me=Gn.inside;break}case Gn.inside:{for(;Ge<=st;){let kt=_e.getClone(Ge);if(kt.xthis._rect.right)Me=Gn.right;else if(kt.y>this._rect.bottom)Me=Gn.bottom;else if(kt.y=0&&!({loc:kt}=mo(this._rect,_e.getClone(Ti))).result;)Ti--;if(Ti<0){for(let Qi of _e)this.add(Qi);return}kt===Gn.inside&&(Hi=Gn.inside)}let pi=Hi;for(Ti=0;Ti<=Vi;){kt=Hi;let Qi=st;if({loc:Hi,i:Ti}=this.getNextLocation(_e,Hi,Ti,Vi),Ti>Vi)break;let dr=_e.getClone(Ti),bn=Ti===0?_e.getClone(Vi):_e.getClone(Ti-1);st=Hi;let go;if(!({loc:st,ip:go}=this.getIntersection(this._rectPath,dr,bn,st)).result){if(Qi===Gn.inside){let Uo=fl(kt,Hi,bn,dr,this._mp);do Me.push(kt),kt=Ys(kt,Uo);while(kt!==Hi);st=Qi}else if(kt!==Gn.inside&&kt!==Hi){let Uo=fl(kt,Hi,bn,dr,this._mp);do kt=this.addCornerRef(kt,Uo);while(kt!==Hi)}Ti++;continue}if(Hi===Gn.inside){if(Ge===Gn.inside)Ge=st,Me.push(kt);else if(kt!==st){let Uo=fl(kt,st,bn,dr,this._mp);do kt=this.addCornerRef(kt,Uo);while(kt!==st)}}else if(kt!==Gn.inside){Hi=kt;let Uo;if({loc:Hi,ip:Uo}=this.getIntersection(this._rectPath,bn,dr,Hi),Qi!==Gn.inside&&Qi!==Hi&&this.addCorner(Qi,Hi),Ge===Gn.inside&&(Ge=Hi,Me.push(kt)),Hi=st,this.add(Uo),T.equals(go,Uo)){({loc:Hi}=mo(this._rect,dr)),this.addCorner(st,Hi),st=Hi;continue}}else Hi=st,Ge===Gn.inside&&(Ge=st);this.add(go)}if(Ge===Gn.inside){if(pi!==Gn.inside&&this._pathBounds.contains(this._rect)&&Ja(_e,this._rectPath))for(let Qi=0;Qi<4;Qi++)this.add(this._rectPath.getClone(Qi)),Wl(this._edges[Qi*2],this._results[0])}else if(Hi!==Gn.inside&&(Hi!==Ge||Me.length>2)){if(Me.length>0){kt=Hi;for(let Qi of Me)kt!==Qi&&(kt=this.addCornerRef(kt,hu(kt,Qi)),kt=Qi);Hi=kt}Hi!==Ge&&(Hi=this.addCornerRef(Hi,hu(Hi,Ge)))}}execute(_e){let Me=new ce;if(this._rect.isEmpty())return Me;for(let Ge of _e)if(!(Ge.length<3)){if(this._pathBounds=s0(Ge),this._rect.intersects(this._pathBounds)){if(this._rect.contains(this._pathBounds)){Me.push(Ge);continue}}else continue;this.executeInternal(Ge),this.checkEdges();for(let st=0;st<4;st++)this.tidyEdgePair(st,this._edges[st*2],this._edges[st*2+1]);for(let st of this._results){let kt=this.getPath(st);kt.length>0&&Me.push(kt)}this._results.length=0;for(let st=0;st<8;st++)this._edges[st].length=0}return Me}checkEdges(){for(let _e=0;_ebn.prev.pt.x:bn.pt.y>bn.prev.pt.y,zm=st?go.pt.x>go.prev.pt.x:go.pt.y>go.prev.pt.y;bn.next===bn.prev||T.equals(bn.pt,bn.prev.pt)?zm===kt?(Me[Ti]=go,Ge[Vi++]=void 0):(Ge[Vi]=go,Me[Ti++]=void 0):go.next===go.prev||T.equals(go.pt,go.prev.pt)?nc===kt?(Me[Ti]=bn,Ge[Vi++]=void 0):(Ge[Vi]=bn,Me[Ti++]=void 0):nc===zm?nc===kt?(Me[Ti]=bn,Th(go),Wl(Me,go),Ge[Vi++]=void 0):(Me[Ti++]=void 0,Ge[Vi]=go,Th(bn),Wl(Ge,bn),Vi=0):(nc===kt?Me[Ti]=bn:Ge[Vi]=bn,zm===kt?Me[Ti]=go:Ge[Vi]=go)}}getPath(_e){if(_e===void 0||_e.prev===_e.next)return new oe;let Me=_e.next;for(;Me!==void 0&&Me!==_e;)O(Me.prev.pt,Me.pt,Me.next.pt)===0n?(_e=Me.prev,Me=Wd(Me)):Me=Me.next;if(Me===void 0)return new oe;let Ge=new oe;for(Ge.push(_e.pt),Me=_e.next;Me!==_e;)Ge.push(Me.pt),Me=Me.next;return Ge}}class xu extends Ga{execute(_e){let Me=new ce;if(this._rect.isEmpty())return Me;for(let Ge of _e)if(!(Ge.length<2)&&(this._pathBounds=s0(Ge),!!this._rect.intersects(this._pathBounds))){this.executeInternal(Ge);for(let st of this._results){let kt=this.getPath(st);kt.length>0&&Me.push(kt)}this._results.length=0;for(let st=0;st<8;st++)this._edges[st].length=0}return Me}getPath(_e){let Me=new oe;if(_e===void 0||_e===_e.next)return Me;_e=_e.next,Me.push(_e.pt);let Ge=_e.next;for(;Ge!==_e;)Me.push(Ge.pt),Ge=Ge.next;return Me}executeInternal(_e){if(this._results.length=0,_e.length<2||this._rect.isEmpty())return;let Me=Gn.inside,Ge=1,st=_e.length-1,kt;if(!({loc:kt}=mo(this._rect,_e.getClone(0))).result){for(;Ge<=st&&!({loc:Me}=mo(this._rect,_e.getClone(Ge))).result;)Ge++;if(Ge>st)for(let Vi of _e)this.add(Vi);Me===Gn.inside&&(kt=Gn.inside),Ge=1}let Ti=_e.getClone(0);for(kt===Gn.inside&&this.add(Ti);Ge<=st&&(Me=kt,{loc:kt,i:Ge}=this.getNextLocation(_e,kt,Ge,st),!(Ge>st));){let Vi=_e.getClone(Ge-1),Hi=kt,pi;if(!({loc:Hi,ip:pi}=this.getIntersection(this._rectPath,Ti,Vi,Hi)).result){++Ge;continue}if(kt===Gn.inside)this.add(pi,!0);else if(Me!==Gn.inside){Hi=Me;let Qi;({loc:Hi,ip:Qi}=this.getIntersection(this._rectPath,Vi,Ti,Hi)),this.add(Qi),this.add(pi)}else this.add(pi)}}}let qs=Ve=>{if(Number.isInteger(Ve))return Ve;if(Number.isInteger(Ve*2)){let _e=Math.trunc(Ve);return _e+_e%2}return Cu(Ve)},Cu=Ve=>Ve>=0?Math.trunc(Ve+.5):Math.trunc(Ve-.5);function na(Ve){return BigInt(Cu(Ve))}function gf(Ve,_e,Me){if(E(Ve)&&E(_e)&&E(Me))return Xi(Ve,_e,Me);if(se(Ve)&&se(_e)&&se(Me))return ke(Ve,_e,Me);throw new TypeError("Invalid argument types. Argument pt and line1 and line2 are must be of same point type.")}function Xi(Ve,_e,Me){let Ge=Me.x-_e.x,st=Me.y-_e.y;if(Ge===0n&&st===0n)return 0;let kt=Ve.x-_e.x,Ti=Ve.y-_e.y;return Ie(Number(kt*st-Ge*Ti))/Number(Ge*Ge+st*st)}function ke(Ve,_e,Me){let Ge=Me.x-_e.x,st=Me.y-_e.y;if(Ge===0&&st===0)return 0;let kt=Ve.x-_e.x,Ti=Ve.y-_e.y;return Ie(kt*st-Ge*Ti)/(Ge*Ge+st*st)}function Ie(Ve){return Ve*Ve}function He(Ve,_e,Me,Ge,st){let kt=0,Ti=0;if(Q(Ve)){let Vi=Ve.getClone(_e);for(;Me>_e&&T.equals(Vi,Ve.getClone(Me));)st[Me--]=!1;let Hi=Ve.get(Me);for(let pi=_e+1;pi_e+1&&He(Ve,_e,kt,Ge,st),kt_e&&ae.equals(Vi,Ve.getClone(Me));)st[Me--]=!1;let Hi=Ve.getClone(Me);for(let pi=_e+1;pi_e+1&&He(Ve,_e,kt,Ge,st),ktnew Ue(!1),Vt=()=>new at(!1);function ni(Ve,_e,Me,Ge=2){return An(x.Intersection,Ve,_e,Me,Ge)}function _r(Ve,_e,Me,Ge=2){return typeof _e=="number"?An(x.Union,Ve,void 0,_e,Ge):An(x.Union,Ve,_e,Me,Ge)}function Ir(Ve,_e,Me,Ge=2){return An(x.Difference,Ve,_e,Me,Ge)}function Pn(Ve,_e,Me,Ge=2){return An(x.Xor,Ve,_e,Me,Ge)}function An(Ve,_e,Me,Ge,st,kt){if(ve(_e)&&(Me===void 0||ve(Me))){if(typeof Ge=="number"){let Ti=new ce,Vi=new Mi;return Vi.addPaths(_e,C.Subject),Me!==void 0&&Vi.addPaths(Me,C.Clip),Vi.execute(Ve,Ge,Ti),Ti}else if(Ge instanceof Ni){let Ti=new Mi;Ti.addPaths(_e,C.Subject),Me!==void 0&&Ti.addPaths(Me,C.Clip),Ti.execute(Ve,st,Ge);return}}else if(he(_e)&&(Me===void 0||he(Me))){if(typeof Ge=="number"){let Ti=new Se,Vi=new Nr(st??2);return Vi.addPaths(_e,C.Subject),Me!==void 0&&Vi.addPaths(Me,C.Clip),Vi.execute(Ve,Ge,Ti),Ti}else if(Ge instanceof ur){let Ti=new Nr(kt??2);Ti.addPaths(_e,C.Subject),Me!==void 0&&Ti.addPaths(Me,C.Clip),Ti.execute(Ve,st,Ge);return}}throw new TypeError("Invalid argument types.")}function Wr(Ve,_e,Me,Ge,st=2,kt=2,Ti=0){if(ve(Ve)){let Vi=new Pa(st,Ti);Vi.addPaths(Ve,Me,Ge);let Hi=new ce;return Vi.execute(_e,Hi),Hi}else if(he(Ve)){L(kt);let Vi=Math.pow(10,kt),Hi=cp(Ve,Vi),pi=new Pa(st,Ti);return pi.addPaths(Hi,Me,Ge),pi.execute(_e*Vi,Hi),yf(Hi,1/Vi)}throw new TypeError("Invalid argument types.")}function Ho(Ve,_e,Me=2){if(De(Ve)&&(ve(_e)||Q(_e))){if(Ve.isEmpty()||_e.length===0)return new ce;let Ge;return ve(_e)?Ge=ce.clone(_e):Ge=ce.clone([_e]),new Ga(Ve).execute(Ge)}else if(it(Ve)&&(he(_e)||fe(_e))){if(L(Me),Ve.isEmpty()||_e.length===0)return new Se;let Ge=Math.pow(10,Me),st;he(_e)?st=cp(_e,Ge):(st=new ce,st.push(Bc(_e,Ge)));let kt=_c(Ve,Ge);return st=new Ga(kt).execute(st),yf(st,1/Ge)}throw new TypeError("Invalid argument types.")}function ma(Ve,_e,Me=2){if(De(Ve)&&(ve(_e)||Q(_e))){if(Ve.isEmpty()||_e.length===0)return new ce;let Ge;return ve(_e)?Ge=_e:(Ge=new ce,Ge.push(_e)),new xu(Ve).execute(Ge)}else if(it(Ve)&&(he(_e)||fe(_e))){if(L(Me),Ve.isEmpty()||_e.length===0)return new Se;let Ge=Math.pow(10,Me),st;he(_e)?st=cp(_e,Ge):(st=new ce,st.push(Bc(_e,Ge)));let kt=_c(Ve,Ge);return st=new xu(kt).execute(st),yf(st,1/Ge)}throw new TypeError("Invalid argument types.")}function Zo(Ve,_e,Me){return tt(Ve,_e,Me)}function $o(Ve,_e,Me){return $e(Ve,_e,Me)}function du(Ve){let _e=0;if(ve(Ve)||he(Ve))for(let Me of Ve)_e+=du(Me);else if(Q(Ve)){if(Ve.length<3)return 0;let Me=Ve.getX(Ve.length-1),Ge=Ve.getY(Ve.length-1);for(let st=0,kt=Ve.length;st=0}function Wa(Ve){let _e="";for(let Me of Ve)_e+=T.toString(Me);return _e+` `}function fu(Ve){let _e="";for(let Me of Ve)_e+=Wa(Me);return _e}function Hs(Ve){let _e="";for(let Me of Ve)_e+=ae.toString(Me);return _e+` `}function Wu(Ve){let _e="";for(let Me of Ve)_e+=Hs(Me);return _e}function Ic(Ve,_e,Me){let Ge=new oe;for(let st=0,kt=Ve.length;st=0;Me--)_e.push(Ve.getClone(Me));return _e}else if(fe(Ve)){let _e=new re;for(let Me=Ve.length-1;Me>=0;Me--)_e.push(Ve.getClone(Me));return _e}throw new TypeError("Invalid argument types.")}function Qh(Ve){if(ve(Ve)){let _e=new ce;for(let Me of Ve)_e.push(bg(Me));return _e}else if(he(Ve)){let _e=new Se;for(let Me of Ve)_e.push(bg(Me));return _e}throw new TypeError("Invalid argument types.")}function s0(Ve){if(ve(Ve)){let _e=dt();for(let Me of Ve)for(let Ge=0,st=Me.length;Ge_e.right&&(_e.right=Me.getX(Ge)),Me.getY(Ge)<_e.top&&(_e.top=Me.getY(Ge)),Me.getY(Ge)>_e.bottom&&(_e.bottom=Me.getY(Ge));return _e.left===9223372036854775807n?new Ue:_e}else if(Q(Ve)){let _e=dt();for(let Me=0,Ge=Ve.length;Me_e.right&&(_e.right=Ve.getX(Me)),Ve.getY(Me)<_e.top&&(_e.top=Ve.getY(Me)),Ve.getY(Me)>_e.bottom&&(_e.bottom=Ve.getY(Me));return _e.left===9223372036854775807n?new Ue:_e}else if(he(Ve)){let _e=Vt();for(let Me of Ve)for(let Ge=0,st=Me.length;Ge_e.right&&(_e.right=Me.getX(Ge)),Me.getY(Ge)<_e.top&&(_e.top=Me.getY(Ge)),Me.getY(Ge)>_e.bottom&&(_e.bottom=Me.getY(Ge));return _e.left===1/0?new at:_e}else if(fe(Ve)){let _e=Vt();for(let Me=0,Ge=Ve.length;Me_e.right&&(_e.right=Ve.getX(Me)),Ve.getY(Me)<_e.top&&(_e.top=Ve.getY(Me)),Ve.getY(Me)>_e.bottom&&(_e.bottom=Ve.getY(Me));return _e.left===1/0?new at:_e}throw new TypeError("Invalid argument types.")}function hp(Ve){let _e=new oe;for(let Me=0;Me0&&_e.push(Ve.polygon);for(let Me=0;Me0&&_e.push(Ve.polygon);for(let Me=0;Mekt??!1);He(Ve,0,Me-1,Ie(_e),st);for(let kt=0;ktkt??!1);He(Ve,0,Me-1,Ie(_e),st);for(let kt=0;kt=Ge)throw new RangeError("Invalid array length.");for(;Ve<=_e&&Me[Ve];)Ve++;if(Ve<=_e)return Ve;for(Ve=0;Me[Ve]&&Ve=Ge)throw new RangeError("Invalid array length.");return Ve}function G_(Ve,_e,Me){let Ge=Me.length;if(_e>=Ge)throw new RangeError("Invalid array length.");for(Ve=Ve===0?_e:Ve-1;Ve>0&&Me[Ve];)Ve--;if(!Me[Ve])return Ve;for(Ve=_e;Ve>=0&&Me[Ve];)Ve--;if(Ve<0)throw new RangeError("Invalid array length.");return Ve}function _x(Ve,_e,Me=!0){let Ge=Ve.length,st=Ge-1,kt=Ie(_e);if(Ge<4)return Ve.clone();let Ti=Array.from({length:Ge},()=>!1),Vi=Array.from({length:Ge},()=>0),Hi=0,pi,Qi,dr,bn;Me?(Vi[0]=Xi(Ve.getClone(0),Ve.getClone(st),Ve.getClone(1)),Vi[st]=Xi(Ve.getClone(st),Ve.getClone(0),Ve.getClone(st-1))):(Vi[0]=1/0,Vi[st]=1/0);for(let Uo=1;Uokt){Qi=Hi;do Hi=ah(Hi,st,Ti);while(Hi!==Qi&&Vi[Hi]>kt);if(Hi===Qi)break}if(pi=G_(Hi,st,Ti),dr=ah(Hi,st,Ti),dr===pi)break;Vi[dr]!1),Vi=Array.from({length:Ge},()=>0),Hi=0,pi,Qi,dr,bn;Me?(Vi[0]=ke(Ve.getClone(0),Ve.getClone(st),Ve.getClone(1)),Vi[st]=ke(Ve.getClone(st),Ve.getClone(0),Ve.getClone(st-1))):(Vi[0]=1/0,Vi[st]=1/0);for(let Uo=1;Uokt){Qi=Hi;do Hi=ah(Hi,st,Ti);while(Hi!==Qi&&Vi[Hi]>kt);if(Hi===Qi)break}if(pi=G_(Hi,st,Ti),dr=ah(Hi,st,Ti),dr===pi)break;Vi[dr]2&&O(Vi.getClone(Vi.length-1),Vi.getClone(Vi.length-2),pi)===0n;)Vi.pop();Vi.length<3&&Vi.clear()}return Vi}throw new TypeError("Invalid argument types.")}function py(Ve,_e,Me=2){if(E(Ve)&&Q(_e))return J(Ve,_e);if(se(Ve)&&fe(_e)){L(Me);let Ge=Math.pow(10,Me),st=T.createScaledPoint(Ve.x,Ve.y,Ge),kt=Bc(_e,Ge);return J(st,kt)}throw new TypeError("Invalid argument types.")}function WC(Ve,_e,Me,Ge){if(E(Ve))return vx(Ve,_e,Me,Ge);if(se(Ve))return BA(Ve,_e,Me,Ge);throw new TypeError("Invalid argument types.")}function vx(Ve,_e,Me=0,Ge=0){if(_e<=0)return new oe;Me<=0&&(Me=_e),Ge<=2&&(Ge=Math.ceil(Math.PI*Math.sqrt((_e+Me)/2)));let st=Math.sin(2*Math.PI/Ge),kt=Math.cos(2*Math.PI/Ge),Ti=kt,Vi=st,Hi=Ve.x,pi=Ve.y,Qi=new oe(Ge);Qi.push({x:Hi+na(_e),y:pi});for(let dr=1;dr=0&&(T=O)}return T!==Number.MAX_VALUE?_s.getPoint(o,T,y):void 0};Rc.prototype.findNextSegment=function(o,f,m,v,y){for(let x=0;x0;){let x=[],C=v.shift();x.push(C),this.findNextSegment(C,v,x,0,1),this.findNextSegment(C,v,x,0,1),this.findNextSegment(C,v,x,1,0),this.findNextSegment(C,v,x,1,1),y.push(x)}}};function Omi(o,f,m){let v=new Ye(f.x-o.x,f.y-o.y);if(v.x===0&&v.y===0)return 0;Ye.normalize(v,v);let y=new Ye((f.x+o.x)*.5,(f.y+o.y)*.5),x=new Ye(m.x-y.x,m.y-y.y);Ye.normalize(x,x);let C=new Ye(-v.y,v.x),w=Ye.angleBetween(C,x);w>xe.PI_OVER_TWO&&(C=new Ye(v.y,-v.x));let A=new Ye(0,1);return w=Ye.angleBetween(C,A),Ye.cross(A,C)<0&&(w=-w),w}Rc.prototype.createContourLineTexture=function(o,f,m){let v=document.createElement("canvas");v.width=256,v.height=256;let y=v.getContext("2d");for(let w=0;wo.level)return;let x=this.mesh;if(!N(x)||N(this.contourLineTexture))return;let C=[],w=new H,A=x.orientedBoundingBox.halfAxes;Ut.getScale(A,w);let E=x.vertices,T=x.indices,S=x.encoding,M=x.indexCountWithoutSkirts,I=x.minimumHeight,P=x.maximumHeight,D=o.tilingScheme.ellipsoid,L=D.cartesianToCartographic(x.center,new H);L.height=0;let R=D.cartographicToCartesian(L,new H),O=tn.eastNorthUpToFixedFrame(R,D),F=Ee.inverseTransformation(O,new Ee),k=new Array(M);for(let U=0;Ure.z?ie.z>ne.z?ie:ne:re.z>ne.z?re:ne,se=new H;if(oe.clone(se),Hh.lineSegmentPlane(ie,re,j,MHe)){let ae=new H;MHe.clone(ae),z.push({insertPosition:ae,start:X,end:Y,maxVv:se}),ee++}if(Hh.lineSegmentPlane(re,ne,j,DHe)){let ae=new H;DHe.clone(ae),z.push({insertPosition:ae,start:Y,end:Q,maxVv:se}),ee++}if(Hh.lineSegmentPlane(ne,ie,j,LHe)){let ae=new H;LHe.clone(ae),z.push({insertPosition:ae,start:Q,end:X,maxVv:se}),ee++}ee===2&&q.positions.push(z)}C.push(q)}this.contourLineTopy(C),this.createContourLineTexture(C,y,o.level)};var JH=32,KH=256;function Nmi(o,f,m){let v=f.vertices,y=f.indices,x=f.encoding,C=f.indexCountWithoutSkirts,w=f.minimumHeight,A=f.maximumHeight,E=o.tilingScheme.ellipsoid,T=E.cartesianToCartographic(f.center,new H);T.height=0;let S=E.cartographicToCartesian(T,new H),M=tn.eastNorthUpToFixedFrame(S,E),I=Ee.inverseTransformation(M,new Ee),P=JH/KH,D=KH/JH,L={mins:[],maxs:[],indexMins:[],indexMaxs:[],minPositions:[],maxPositions:[]};for(let O=0;Ok&&(L.mins[j]=k,L.indexMins[j]=F),J0){let U=L.minPositions[O],G=tH(x,null,m,v,F,zte),j=Ee.multiplyByPoint(I,G,new H);U.x=j.x,U.y=j.y}let k=L.indexMaxs[O];if(k>0){let U=L.maxPositions[O],G=tH(x,null,m,v,k,zte),j=Ee.multiplyByPoint(I,G,new H);U.x=j.x,U.y=j.y}}return{mins:L.minPositions,maxs:L.maxPositions}}Rc.prototype.getNormalTexture=function(o,f,m){let v=this.mesh;if(N(v)){if(!this._normalTexture){let y=this.mesh,{mins:x,maxs:C}=Nmi(o,y,f),w=[];for(let M=0;M0?(I=Ye.normalize(I,new Ye),I=Ye.multiplyByScalar(I,.5,new Ye),I=Ye.add(I,new Ye(.5),new Ye),I=Ye.multiplyByScalar(I,255,new Ye)):I=new Ye(0,1),w.push(I)}let A=KH/JH,E=KH/JH,T=new Uint8Array(A*E*4);for(let M=0;M0){let w=C[0],A=w.length;for(let E=0;E250&&(M=256),I<5&&(I=0),I>250&&(I=256),E.lineTo(M,I)}E.closePath(),E.fill();let T=new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR,maximumAnisotropy:1});return this._regionRectTexture=_o.create({context:m,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,source:A,sampler:T,flipY:!1}),this._regionRectTexture};Rc.prototype.freeResources=function(){N(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),N(this.contourLineTexture)&&(--this.contourLineTexture.referenceCount,this.contourLineTexture.referenceCount===0&&this.contourLineTexture.destroy(),this.contourLineTexture=void 0),this._regionRectTexture&&(this._regionRectTexture.destroy(),this._regionRectTexture=null),this._normalTexture&&(this._normalTexture.destroy(),this._normalTexture=null),this.terrainData=void 0,this.terrainState=Ls.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let o=this.imagery;for(let f=0,m=o.length;f=Ls.RECEIVED&&C.waterMaskTexture===void 0&&m.hasWaterMask)if(C.terrainData.waterMask!==void 0)Wmi(f.context,C);else{let A=C._findAncestorTileWithTerrainData(o);N(A)&&N(A.data.waterMaskTexture)&&(C.waterMaskTexture=A.data.waterMaskTexture,++C.waterMaskTexture.referenceCount,C._computeWaterMaskTranslationAndScale(o,A,C.waterMaskTranslationAndScale))}}function kmi(o,f,m,v,y,x,C){let w=f.parent;if(!w){f.state=Ch.FAILED;return}let A=w.data.terrainData,E=w.x,T=w.y,S=w.level;if(!N(A))return;let M=A.upsample(v.tilingScheme,E,T,S,y,x,C);N(M)&&(o.terrainState=Ls.RECEIVING,Promise.resolve(M).then(function(I){o.terrainData=I,o.terrainState=Ls.RECEIVED}).catch(function(){o.terrainState=Ls.FAILED}))}function Vmi(o,f,m,v,y){function x(A){o.terrainData=A,o.terrainState=Ls.RECEIVED,o.request=void 0}function C(A){if(o.request.state===bc.CANCELLED){o.terrainData=void 0,o.terrainState=Ls.UNLOADED,o.request=void 0;return}o.terrainState=Ls.FAILED,o.request=void 0;let E=`Failed to obtain terrain tile X: ${m} Y: ${v} Level: ${y}. Error message: "${A}"`;f._requestError=ld.reportError(f._requestError,f,f.errorEvent,E,m,v,y),f._requestError.retry&&w()}function w(){let A=new cg({throttle:!1,throttleByServer:!0,type:Qy.TERRAIN});o.request=A;let E=f.requestTileGeometry(m,v,y,A);N(E)?(o.terrainState=Ls.RECEIVING,Promise.resolve(E).then(function(T){x(T)}).catch(function(T){C(T)})):(o.terrainState=Ls.UNLOADED,o.request=void 0)}w()}var zmi={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Hmi(o,f,m,v,y,x){let C=m.tilingScheme,w=zmi;w.tilingScheme=C,w.x=v,w.y=y,w.level=x,w.exaggeration=f.terrainExaggeration,w.exaggerationRelativeHeight=f.terrainExaggerationRelativeHeight,w.throttle=!0;let A=o.terrainData.createMesh(w);N(A)&&(o.terrainState=Ls.TRANSFORMING,Promise.resolve(A).then(function(E){o.mesh=E,o.terrainState=Ls.TRANSFORMED}).catch(function(){o.terrainState=Ls.FAILED}))}Rc._createVertexArrayForMesh=function(o,f){let m=f.vertices,v=Ao.createVertexBuffer({context:o,typedArray:m,usage:gn.STATIC_DRAW}),y=f.encoding.getAttributes(v),x=f.indices.indexBuffers||{},C=x[o.id];if(!N(C)||C.isDestroyed()){let w=f.indices;C=Ao.createIndexBuffer({context:o,typedArray:w,usage:gn.STATIC_DRAW,indexDatatype:ro.fromSizeInBytes(w.BYTES_PER_ELEMENT)}),C.vertexArrayDestroyable=!1,C.referenceCount=1,x[o.id]=C,f.indices.indexBuffers=x}else++C.referenceCount;return new Du({context:o,attributes:y,indexBuffer:C})};Rc._freeVertexArray=function(o){if(N(o)){let f=o.indexBuffer;o.isDestroyed()||o.destroy(),N(f)&&!f.isDestroyed()&&N(f.referenceCount)&&(--f.referenceCount,f.referenceCount===0&&f.destroy())}};function Umi(o,f,m,v,y,x,C){o.vertexArray=Rc._createVertexArrayForMesh(f,o.mesh),o.terrainState=Ls.READY,o.fill=o.fill&&o.fill.destroy(C)}function Gmi(o){let f=o.cache.tile_waterMaskData;if(!N(f)){let m=_o.create({context:o,pixelFormat:Nn.LUMINANCE,pixelDatatype:Rn.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});m.referenceCount=1;let v=new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR});f={allWaterTexture:m,sampler:v,destroy:function(){this.allWaterTexture.destroy()}},o.cache.tile_waterMaskData=f}return f}function Wmi(o,f){let m=f.terrainData.waterMask,v=Gmi(o),y,x=m.length;if(x===1)if(m[0]!==0)y=v.allWaterTexture;else return;else{let C=Math.sqrt(x);y=_o.create({context:o,pixelFormat:Nn.LUMINANCE,pixelDatatype:Rn.UNSIGNED_BYTE,source:{width:C,height:C,arrayBufferView:m},sampler:v.sampler,flipY:!1}),y.referenceCount=0}++y.referenceCount,f.waterMaskTexture=y,Wt.fromElements(0,0,1,1,f.waterMaskTranslationAndScale)}Rc.prototype._findAncestorTileWithTerrainData=function(o){let f=o.parent;for(;N(f)&&(!N(f.data)||!N(f.data.terrainData)||f.data.terrainData.wasCreatedByUpsampling());)f=f.parent;return f};Rc.prototype._computeWaterMaskTranslationAndScale=function(o,f,m){let v=f.rectangle,y=o.rectangle,x=y.width,C=y.height,w=x/v.width,A=C/v.height;return m.x=w*(y.west-v.west)/x,m.y=A*(y.south-v.south)/C,m.z=w,m.w=A,m};var OM=Rc,OZ,rtt="AAPKac82a6d80f1340a4aa9587f789d07e96a_Jj1a4fbA59cggYHArDizxxA2U4QDofLUm36VivpUsSRyK7O1JjRPwy916Y-7ld",x6={};x6.defaultAccessToken=rtt;x6.defaultWorldImageryServer=new Jr({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});x6.defaultWorldHillshadeServer=new Jr({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});x6.defaultWorldOceanServer=new Jr({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});x6.getDefaultTokenCredit=function(o){if(o===rtt){if(!N(OZ)){let f=' This application is using a default ArcGIS access token. Please assign Cesium.ArcGisMapService.defaultAccessToken with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at https://developers.arcgis.com/.';OZ=new Cs(f,!0),OZ._isDefaultToken=!0}return OZ}};var EE=x6;function mTe(o){o=Z(o,Z.EMPTY_OBJECT),this._pixelsToCheck=o.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let f=Jr.createIfNeeded(o.missingImageUrl),m=this;function v(x){N(x.blob)&&(m._missingImageByteLength=x.blob.size);let C=w5(x);if(o.disableCheckIfAllPixelsAreTransparent){let w=!0,A=x.width,E=o.pixelsToCheck;for(let T=0,S=E.length;w&&T0&&(w=!1)}w&&(C=void 0)}m._missingImagePixels=C,m._isReady=!0}function y(){m._missingImagePixels=void 0,m._isReady=!0}f.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(v).catch(y)}mTe.prototype.isReady=function(){return this._isReady};mTe.prototype.shouldDiscardImage=function(o){let f=this._pixelsToCheck,m=this._missingImagePixels;if(!N(m)||N(o.blob)&&o.blob.size!==this._missingImageByteLength)return!1;let v=w5(o),y=o.width;for(let x=0,C=f.length;x1&&y==="name"?(f=1,m=v):f>2&&y==="title"?(f=2,m=v):f>3&&/name/i.test(v)?(f=3,m=v):f>4&&/title/i.test(v)&&(f=4,m=v)}N(m)&&(this.name=o[m])};_Te.prototype.configureDescriptionFromProperties=function(o){function f(m){let v='';for(let y in m)if(m.hasOwnProperty(y)){let x=m[y];N(x)&&(typeof x=="object"?v+=``:v+=``)}return v+="
${y}${f(x)}
${y}${x}
",v}this.description=f(o)};var yO=_Te,jmi={SATELLITE:1,OCEANS:2,HILLSHADE:3},d3=Object.freeze(jmi);function vTe(o){this.useTiles=Z(o.usePreCachedTilesIfAvailable,!0);let f=o.ellipsoid;this.tilingScheme=Z(o.tilingScheme,new Bd({ellipsoid:f})),this.rectangle=Z(o.rectangle,this.tilingScheme.rectangle),this.ellipsoid=f;let m=o.credit;typeof m=="string"&&(m=new Cs(m)),this.credit=m,this.tileCredits=void 0,this.tileDiscardPolicy=o.tileDiscardPolicy,this.tileWidth=Z(o.tileWidth,256),this.tileHeight=Z(o.tileHeight,256),this.maximumLevel=o.maximumLevel}vTe.prototype.build=function(o){o._useTiles=this.useTiles,o._tilingScheme=this.tilingScheme,o._rectangle=this.rectangle,o._credit=this.credit,o._tileCredits=this.tileCredits,o._tileDiscardPolicy=this.tileDiscardPolicy,o._tileWidth=this.tileWidth,o._tileHeight=this.tileHeight,o._maximumLevel=this.maximumLevel,this.useTiles&&!N(this.tileDiscardPolicy)&&(o._tileDiscardPolicy=new gTe({missingImageUrl:ott(o,0,0,this.maximumLevel).url,pixelsToCheck:[new Ye(0,0),new Ye(200,20),new Ye(20,200),new Ye(80,110),new Ye(160,130)],disableCheckIfAllPixelsAreTransparent:!0})),o._ready=!0};var RHe=void 0;function Ymi(o,f){let m=o.tileInfo;if(!N(m))f.useTiles=!1;else{if(f.tileWidth=m.rows,f.tileHeight=m.cols,m.spatialReference.wkid===102100||m.spatialReference.wkid===102113)f.tilingScheme=new Mm({ellipsoid:f.ellipsoid});else if(o.tileInfo.spatialReference.wkid===4326)f.tilingScheme=new Bd({ellipsoid:f.ellipsoid});else if(o.fullExtent.spatialReference.wkid===4490)RHe._tilingScheme=new Bd({ellipsoid:f.ellipsoid,tileInfo:o.tileInfo});else{let v=`Tile spatial reference WKID ${o.tileInfo.spatialReference.wkid} is not supported.`;throw new sr(v)}if(f.maximumLevel=o.tileInfo.lods.length-1,N(o.fullExtent)){if(N(o.fullExtent.spatialReference)&&N(o.fullExtent.spatialReference.wkid))if(o.fullExtent.spatialReference.wkid===102100||o.fullExtent.spatialReference.wkid===102113){let v=new hd,y=o.fullExtent,x=v.unproject(new H(Math.max(y.xmin,-f.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(y.ymin,-f.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),C=v.unproject(new H(Math.min(y.xmax,f.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(y.ymax,f.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));f.rectangle=new Di(x.longitude,x.latitude,C.longitude,C.latitude)}else if(o.fullExtent.spatialReference.wkid===4326)f.rectangle=Di.fromDegrees(o.fullExtent.xmin,o.fullExtent.ymin,o.fullExtent.xmax,o.fullExtent.ymax);else if(o.fullExtent.spatialReference.wkid===4490)RHe._rectangle=Di.fromDegrees(o.fullExtent.xmin,o.fullExtent.ymin,o.fullExtent.xmax,o.fullExtent.ymax);else{let v=`fullExtent.spatialReference WKID ${o.fullExtent.spatialReference.wkid} is not supported.`;throw new sr(v)}}else f.rectangle=f.tilingScheme.rectangle;f.useTiles=!0}N(o.copyrightText)&&o.copyrightText.length>0&&(N(f.credit)?f.tileCredits=[new Cs(o.copyrightText)]:f.credit=new Cs(o.copyrightText))}function qmi(o,f,m){let v=`An error occurred while accessing ${o.url}`;throw N(f)&&N(f.message)&&(v+=`: ${f.message}`),ld.reportError(void 0,m,N(m)?m._errorEvent:void 0,v,void 0,void 0,void 0,f),new sr(v)}async function ntt(o,f,m){let v=o.getDerivedResource({queryParameters:{f:"json"}});try{let y=await v.fetchJson();Ymi(y,f)}catch(y){qmi(o,y,m)}}function R2(o){o=Z(o,Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=o.tileDiscardPolicy,this._tileWidth=Z(o.tileWidth,256),this._tileHeight=Z(o.tileHeight,256),this._maximumLevel=o.maximumLevel,this._tilingScheme=Z(o.tilingScheme,new Bd({ellipsoid:o.ellipsoid})),this._useTiles=Z(o.usePreCachedTilesIfAvailable,!0),this._rectangle=Z(o.rectangle,this._tilingScheme.rectangle),this._layers=o.layers,this._credit=o.credit,this._tileCredits=void 0;let f=o.credit;if(typeof f=="string"&&(f=new Cs(f)),this.enablePickFeatures=Z(o.enablePickFeatures,!0),this._errorEvent=new Br,this._ready=!1,N(o.url)){mi("ArcGisMapServerImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead.");let m=Jr.createIfNeeded(o.url);m.appendForwardSlash(),this._tileDiscardPolicy=o.tileDiscardPolicy,N(o.token)&&m.setQueryParameters({token:o.token}),this._resource=m;let v=new vTe(o);v.useTiles?this._readyPromise=ntt(m,v,this).then(()=>(v.build(this),!0)):(v.build(this),this._readyPromise=Promise.resolve(!0))}}R2.fromBasemapType=async function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m,v,y;switch(o){case d3.SATELLITE:{m=Z(f.token,EE.defaultAccessToken),v=Jr.createIfNeeded(Z(f.url,EE.defaultWorldImageryServer)),v.appendForwardSlash();let x=EE.getDefaultTokenCredit(m);N(x)&&(y=Cs.clone(x))}break;case d3.OCEANS:{m=Z(f.token,EE.defaultAccessToken),v=Jr.createIfNeeded(Z(f.url,EE.defaultWorldOceanServer)),v.appendForwardSlash();let x=EE.getDefaultTokenCredit(m);N(x)&&(y=Cs.clone(x))}break;case d3.HILLSHADE:{m=Z(f.token,EE.defaultAccessToken),v=Jr.createIfNeeded(Z(f.url,EE.defaultWorldHillshadeServer)),v.appendForwardSlash();let x=EE.getDefaultTokenCredit(m);N(x)&&(y=Cs.clone(x))}break;default:}return R2.fromUrl(v,{...f,token:m,credit:y,usePreCachedTilesIfAvailable:!0})};function ott(o,f,m,v,y){let x;if(o._useTiles)x=o._resource.getDerivedResource({url:`tile/${v}/${m}/${f}`,request:y});else{let C=o._tilingScheme.tileXYToNativeRectangle(f,m,v),w={bbox:`${C.west},${C.south},${C.east},${C.north}`,size:`${o._tileWidth},${o._tileHeight}`,format:"png32",transparent:!0,f:"image"};o._tilingScheme.projection instanceof Mp?(w.bboxSR=4326,w.imageSR=4326):(w.bboxSR=3857,w.imageSR=3857),o.layers&&(w.layers=`show:${o.layers}`),x=o._resource.getDerivedResource({url:"export",request:y,queryParameters:w})}return x}Object.defineProperties(R2.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("ArcGisMapServerImageryProvider.ready","ArcGisMapServerImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return mi("ArcGisMapServerImageryProvider.readyPromise","ArcGisMapServerImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGisMapServerImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}},defaultAlpha:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("ArcGisMapServerImageryProvider.defaultAlpha","ArcGisMapServerImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(o){mi("ArcGisMapServerImageryProvider.defaultNightAlpha","ArcGisMapServerImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("ArcGisMapServerImageryProvider.defaultDayAlpha","ArcGisMapServerImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("ArcGisMapServerImageryProvider.defaultBrightness","ArcGisMapServerImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("ArcGisMapServerImageryProvider.defaultContrast","ArcGisMapServerImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("ArcGisMapServerImageryProvider.defaultHue","ArcGisMapServerImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("ArcGisMapServerImageryProvider.defaultSaturation","ArcGisMapServerImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("ArcGisMapServerImageryProvider.defaultGamma","ArcGisMapServerImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("ArcGisMapServerImageryProvider.defaultMinificationFilter","ArcGisMapServerImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("ArcGisMapServerImageryProvider.defaultMagnificationFilter","ArcGisMapServerImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});R2.fromUrl=async function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=Jr.createIfNeeded(o);m.appendForwardSlash(),N(f.token)&&m.setQueryParameters({token:f.token});let v=new R2(f);v._resource=m;let y=new vTe(f);return Z(f.usePreCachedTilesIfAvailable,!0)&&await ntt(m,y),y.build(v),v._readyPromise=Promise.resolve(!0),v};R2.prototype.getTileCredits=function(o,f,m){return this._tileCredits};R2.prototype.requestImage=function(o,f,m,v){return Q2.loadImage(this,ott(this,o,f,m,v))};R2.prototype.pickFeatures=function(o,f,m,v,y){if(!this.enablePickFeatures)return;let x=this._tilingScheme.tileXYToNativeRectangle(o,f,m),C,w,A;if(this._tilingScheme.projection instanceof Mp)C=xe.toDegrees(v),w=xe.toDegrees(y),A="4326";else{let S=this._tilingScheme.projection.project(new Mt(v,y,0));C=S.x,w=S.y,A="3857"}let E="visible";N(this._layers)&&(E+=`:${this._layers}`);let T={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${C},${w}`,mapExtent:`${x.west},${x.south},${x.east},${x.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:A,layers:E};return this._resource.getDerivedResource({url:"identify",queryParameters:T}).fetchJson().then(function(S){let M=[],I=S.results;if(!N(I))return M;for(let P=0;P`),this._tilingScheme=new Mm({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:o.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new Br,this._ready=!1,N(o.url)){mi("BingMapsImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead.");let f=o.tileProtocol;N(f)?f.length>0&&f[f.length-1]===":"&&(f=f.substr(0,f.length-1)):f=document.location.protocol==="http:"?"http":"https";let m=Jr.createIfNeeded(o.url);this._resource=m,m.appendForwardSlash();let v=m.getDerivedResource({url:`REST/v1/Imagery/Metadata/${this._mapStyle}`,queryParameters:{incl:"ImageryProviders",key:o.key,uriScheme:f}}),y=new yTe(o);this._readyPromise=att(v,y,this).then(()=>(y.build(this),!0))}}Object.defineProperties(sg.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("BingMapsImageryProvider.ready","BingMapsImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return mi("BingMapsImageryProvider.readyPromise","BingMapsImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use BingMapsImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return mi("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("BingMapsImageryProvider.defaultAlpha","BingMapsImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(o){mi("BingMapsImageryProvider.defaultNightAlpha","BingMapsImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("BingMapsImageryProvider.defaultDayAlpha","BingMapsImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("BingMapsImageryProvider.defaultBrightness","BingMapsImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("BingMapsImageryProvider.defaultContrast","BingMapsImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("BingMapsImageryProvider.defaultHue","BingMapsImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("BingMapsImageryProvider.defaultSaturation","BingMapsImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("BingMapsImageryProvider.defaultGamma","BingMapsImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("BingMapsImageryProvider.defaultMinificationFilter","BingMapsImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("BingMapsImageryProvider.defaultMagnificationFilter","BingMapsImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});sg.fromUrl=async function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=f.tileProtocol;N(m)?m.length>0&&m[m.length-1]===":"&&(m=m.substr(0,m.length-1)):m=document.location.protocol==="http:"?"http":"https";let v=Z(f.mapStyle,goe.AERIAL),y=Jr.createIfNeeded(o);y.appendForwardSlash();let x=y.getDerivedResource({url:`REST/v1/Imagery/Metadata/${v}`,queryParameters:{incl:"ImageryProviders",key:f.key,uriScheme:m}}),C=new sg(f);C._resource=y;let w=new yTe(f);return await att(x,w),w.build(C),C._readyPromise=Promise.resolve(!0),C};var Qmi=new Di;sg.prototype.getTileCredits=function(o,f,m){let v=this._tilingScheme.tileXYToRectangle(o,f,m,Qmi);return egi(this._attributionList,m,v)};sg.prototype.requestImage=function(o,f,m,v){let y=Q2.loadImage(this,Zmi(this,o,f,m,v));if(N(y))return y.catch(function(x){return N(x.blob)&&x.blob.size===0?_oe.EMPTY_IMAGE:Promise.reject(x)})};sg.prototype.pickFeatures=function(o,f,m,v,y){};sg.tileXYToQuadKey=function(o,f,m){let v="";for(let y=m;y>=0;--y){let x=1<=0;--y){let x=1<=S.zoomMin&&f<=S.zoomMax){let M=Di.intersection(m,S.bbox,$mi);N(M)&&(A=!0)}}A&&v.push(C.credit)}return v}sg._metadataCache={};var xO=sg,stt=/{[^}]+}/g,xTe={x:rgi,y:ogi,z:lgi,s:ugi,reverseX:ngi,reverseY:agi,reverseZ:sgi,westDegrees:cgi,southDegrees:hgi,eastDegrees:dgi,northDegrees:fgi,westProjected:pgi,southProjected:mgi,eastProjected:ggi,northProjected:_gi,width:vgi,height:ygi},ltt=va(xTe,{i:xgi,j:Cgi,reverseI:bgi,reverseJ:wgi,longitudeDegrees:Egi,latitudeDegrees:Tgi,longitudeProjected:Sgi,latitudeProjected:Pgi,format:Mgi});function YB(o){if(o=Z(o,Z.EMPTY_OBJECT),this._errorEvent=new Br,N(o.then)){this._reinitialize(o);return}let f=Jr.createIfNeeded(o.url),m=Jr.createIfNeeded(o.pickFeaturesUrl);this._resource=f,this._urlSchemeZeroPadding=o.urlSchemeZeroPadding,this._getFeatureInfoFormats=o.getFeatureInfoFormats,this._pickFeaturesResource=m;let v=o.subdomains;Array.isArray(v)?v=v.slice():N(v)&&v.length>0?v=v.split(""):v=["a","b","c"],this._subdomains=v,this._tileWidth=Z(o.tileWidth,256),this._tileHeight=Z(o.tileHeight,256),this._minimumLevel=Z(o.minimumLevel,0),this._maximumLevel=o.maximumLevel,this._tilingScheme=Z(o.tilingScheme,new Mm({ellipsoid:o.ellipsoid})),this._rectangle=Z(o.rectangle,this._tilingScheme.rectangle),this._rectangle=Di.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=o.tileDiscardPolicy;let y=o.credit;typeof y=="string"&&(y=new Cs(y)),this._credit=y,this._hasAlphaChannel=Z(o.hasAlphaChannel,!0);let x=o.customTags,C=va(xTe,x),w=va(ltt,x);this._tags=C,this._pickFeaturesTags=w,this._readyPromise=Promise.resolve(!0),this._ready=!0,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=Z(o.enablePickFeatures,!0)}Object.defineProperties(YB.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("UrlTemplateImageryProvider.ready","UrlTemplateImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._ready&&N(this._resource)}},readyPromise:{get:function(){return mi("UrlTemplateImageryProvider.readyPromise","UrlTemplateImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}},defaultAlpha:{get:function(){return mi("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("UrlTemplateImageryProvider.defaultAlpha","UrlTemplateImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(o){mi("UrlTemplateImageryProvider.defaultNightAlpha","UrlTemplateImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("UrlTemplateImageryProvider.defaultDayAlpha","UrlTemplateImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("UrlTemplateImageryProvider.defaultBrightness","UrlTemplateImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("UrlTemplateImageryProvider.defaultContrast","UrlTemplateImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("UrlTemplateImageryProvider.defaultHue","UrlTemplateImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("UrlTemplateImageryProvider.defaultSaturation","UrlTemplateImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("UrlTemplateImageryProvider.defaultGamma","UrlTemplateImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("UrlTemplateImageryProvider.defaultMinificationFilter","UrlTemplateImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("UrlTemplateImageryProvider.defaultMagnificationFilter","UrlTemplateImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});YB.prototype.reinitialize=function(o){return mi("UrlTemplateImageryProvider.reinitialize","UrlTemplateImageryProvider.reinitialize was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._reinitialize(o)};YB.prototype._reinitialize=function(o){let f=this;f._readyPromise=Promise.resolve(o).then(function(m){let v=m.customTags,y=va(xTe,v),x=va(ltt,v),C=Jr.createIfNeeded(m.url),w=Jr.createIfNeeded(m.pickFeaturesUrl);f.enablePickFeatures=Z(m.enablePickFeatures,f.enablePickFeatures),f._urlSchemeZeroPadding=Z(m.urlSchemeZeroPadding,f.urlSchemeZeroPadding),f._tileDiscardPolicy=m.tileDiscardPolicy,f._getFeatureInfoFormats=m.getFeatureInfoFormats,f._subdomains=m.subdomains,Array.isArray(f._subdomains)?f._subdomains=f._subdomains.slice():N(f._subdomains)&&f._subdomains.length>0?f._subdomains=f._subdomains.split(""):f._subdomains=["a","b","c"],f._tileWidth=Z(m.tileWidth,256),f._tileHeight=Z(m.tileHeight,256),f._minimumLevel=Z(m.minimumLevel,0),f._maximumLevel=m.maximumLevel,f._tilingScheme=Z(m.tilingScheme,new Mm({ellipsoid:m.ellipsoid})),f._rectangle=Z(m.rectangle,f._tilingScheme.rectangle),f._rectangle=Di.intersection(f._rectangle,f._tilingScheme.rectangle),f._hasAlphaChannel=Z(m.hasAlphaChannel,!0);let A=m.credit;return typeof A=="string"&&(A=new Cs(A)),f._credit=A,f._resource=C,f._tags=y,f._pickFeaturesResource=w,f._pickFeaturesTags=x,f._ready=!0,!0})};YB.prototype.getTileCredits=function(o,f,m){};YB.prototype.requestImage=function(o,f,m,v){return Q2.loadImage(this,tgi(this,o,f,m,v))};YB.prototype.pickFeatures=function(o,f,m,v,y){if(!this.enablePickFeatures||!N(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let x=0,C=this;function w(E,T){return E.callback(T)}function A(){if(x>=C._getFeatureInfoFormats.length)return Promise.resolve([]);let E=C._getFeatureInfoFormats[x],T=igi(C,o,f,m,v,y,E.format);return++x,E.type==="json"?T.fetchJson().then(E.callback).catch(A):E.type==="xml"?T.fetchXML().then(E.callback).catch(A):E.type==="text"||E.type==="html"?T.fetchText().then(E.callback).catch(A):T.fetch({responseType:E.format}).then(w.bind(void 0,E)).catch(A)}return A()};var Hte=!1,E1=new Di,Ute=!1,Mq=new Di;function tgi(o,f,m,v,y){Hte=!1,Ute=!1;let x=o._resource,C=x.getUrlComponent(!0),w=o._tags,A={},E=C.match(stt);return N(E)&&E.forEach(function(T){let S=T.substring(1,T.length-1);N(w[S])&&(A[S]=w[S](o,f,m,v))}),x.getDerivedResource({request:y,templateValues:A})}var Dge=!1,QH=new Ye,Lge=!1;function igi(o,f,m,v,y,x,C){Hte=!1,Ute=!1,Dge=!1,Lge=!1;let w=o._pickFeaturesResource,A=w.getUrlComponent(!0),E=o._pickFeaturesTags,T={},S=A.match(stt);return N(S)&&S.forEach(function(M){let I=M.substring(1,M.length-1);N(E[I])&&(T[I]=E[I](o,f,m,v,y,x,C))}),w.getDerivedResource({templateValues:T})}function C6(o,f,m){if(o&&o.urlSchemeZeroPadding&&o.urlSchemeZeroPadding.hasOwnProperty(f)){let v=o.urlSchemeZeroPadding[f];if(typeof v=="string"){let y=v.length;y>1&&(m=m.length>=y?m:new Array(y-m.toString().length+1).join("0")+m)}}return m}function rgi(o,f,m,v){return C6(o,"{x}",f)}function ngi(o,f,m,v){let y=o.tilingScheme.getNumberOfXTilesAtLevel(v)-f-1;return C6(o,"{reverseX}",y)}function ogi(o,f,m,v){return C6(o,"{y}",m)}function agi(o,f,m,v){let y=o.tilingScheme.getNumberOfYTilesAtLevel(v)-m-1;return C6(o,"{reverseY}",y)}function sgi(o,f,m,v){let y=o.maximumLevel,x=N(y)&&vPromise.reject(y));Xv.call(this,v),this._promise=v}}j1._requestMetadata=async function(o,f,m,v){try{let y=await m.fetchXML();return j1._metadataSuccess(y,o,f,m,v)}catch(y){if(y instanceof A5)return j1._metadataFailure(o,f);throw y}};j1.fromUrl=async function(o,f){let m=Jr.createIfNeeded(o);m.appendForwardSlash();let v=m,y=m.getDerivedResource({url:"tilemapresource.xml"});f=Z(f,Z.EMPTY_OBJECT);let x=await j1._requestMetadata(f,v,y),C=new j1;return Xv.call(C,x),C};N(Object.create)&&(j1.prototype=Object.create(Xv.prototype),j1.prototype.constructor=j1);function utt(o,f){return o.westf.rectangle.east&&(o.east=f.rectangle.east),o.southf.rectangle.north&&(o.north=f.rectangle.north),o}function ctt(o,f,m){let v=o.positionToTileXY(Di.southwest(f),m),y=o.positionToTileXY(Di.northeast(f),m);return(Math.abs(y.x-v.x)+1)*(Math.abs(y.y-v.y)+1)>4?0:m}j1._metadataSuccess=function(o,f,m,v,y){let x=/tileformat/i,C=/tileset/i,w=/tilesets/i,A=/boundingbox/i,E,T,S,M=[],I=o.childNodes[0].childNodes;for(let j=0;j`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=o.maximumLevel,this._errorEvent=new Br,N(o.url)||N(o.channel)){mi("GoogleEarthEnterpriseMapsProvider.url","GoogleEarthEnterpriseMapsProvider.url and GoogleEarthEnterpriseMapsProvider.channel were deprecated in CesiumJS 1.104. They will be in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead.");let f=o.url,m=Z(o.path,"/default_map"),v=Jr.createIfNeeded(f).getDerivedResource({url:m[0]==="/"?m.substring(1):m});v.appendForwardSlash(),this._resource=v,this._url=f,this._path=m,this._ready=!1;let y=v.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),x=new bTe(o);this._readyPromise=htt(y,x,this).then(()=>(x.build(this),this._ready=!0,!0))}}Object.defineProperties(iC.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.ready","GoogleEarthEnterpriseMapsProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.readyPromise","GoogleEarthEnterpriseMapsProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMapsProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultAlpha","GoogleEarthEnterpriseMapsProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultNightAlpha","GoogleEarthEnterpriseMapsProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultDayAlpha","GoogleEarthEnterpriseMapsProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultBrightness","GoogleEarthEnterpriseMapsProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultContrast","GoogleEarthEnterpriseMapsProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultHue","GoogleEarthEnterpriseMapsProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultSaturation","GoogleEarthEnterpriseMapsProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultGamma","GoogleEarthEnterpriseMapsProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter","GoogleEarthEnterpriseMapsProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});iC.fromUrl=async function(o,f,m){m=Z(m,{});let v=Z(m.path,"/default_map"),y=Jr.createIfNeeded(o).getDerivedResource({url:v[0]==="/"?v.substring(1):v});y.appendForwardSlash();let x=y.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),C=new bTe(m);C.channel=f,await htt(x,C);let w=new iC(m);return C.build(w),w._readyPromise=Promise.resolve(!0),w._ready=!0,w._resource=y,w._url=o,w._path=v,w};iC.prototype.getTileCredits=function(o,f,m){};iC.prototype.requestImage=function(o,f,m,v){let y=this._resource.getDerivedResource({url:"query",request:v,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:o,y:f,z:m+1}});return Q2.loadImage(this,y)};iC.prototype.pickFeatures=function(o,f,m,v,y){};iC._logoUrl=void 0;Object.defineProperties(iC,{logoUrl:{get:function(){return N(iC._logoUrl)||(iC._logoUrl=Ms("Assets/Images/google_earth_credit.png")),iC._logoUrl},set:function(o){iC._logoUrl=o}}});var Coe=iC,Rgi=/\/$/,dtt=new Cs('© Mapbox © OpenStreetMap Improve this map');function b6(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.mapId,m=o.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let v=Jr.createIfNeeded(Z(o.url,"https://{s}.tiles.mapbox.com/v4/"));this._mapId=f,this._accessToken=m;let y=Z(o.format,"png");/\./.test(y)||(y=`.${y}`),this._format=y;let x=v.getUrlComponent();Rgi.test(x)||(x+="/"),x+=`${f}/{z}/{x}/{y}${this._format}`,v.url=x,v.setQueryParameters({access_token:m});let C;N(o.credit)?(C=o.credit,typeof C=="string"&&(C=new Cs(C))):C=dtt,this._resource=v,this._imageryProvider=new Xv({url:v,credit:C,ellipsoid:o.ellipsoid,minimumLevel:o.minimumLevel,maximumLevel:o.maximumLevel,rectangle:o.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(b6.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return mi("MapboxImageryProvider.ready","MapboxImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return mi("MapboxImageryProvider.readyPromise","MapboxImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return mi("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("MapboxImageryProvider.defaultAlpha","MapboxImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(o){mi("MapboxImageryProvider.defaultNightAlpha","MapboxImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("MapboxImageryProvider.defaultDayAlpha","MapboxImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("MapboxImageryProvider.defaultBrightness","MapboxImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("MapboxImageryProvider.defaultContrast","MapboxImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("MapboxImageryProvider.defaultHue","MapboxImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("MapboxImageryProvider.defaultSaturation","MapboxImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("MapboxImageryProvider.defaultGamma","MapboxImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("MapboxImageryProvider.defaultMinificationFilter","MapboxImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("MapboxImageryProvider.defaultMagnificationFilter","MapboxImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});b6.prototype.getTileCredits=function(o,f,m){};b6.prototype.requestImage=function(o,f,m,v){return this._imageryProvider.requestImage(o,f,m,v)};b6.prototype.pickFeatures=function(o,f,m,v,y){return this._imageryProvider.pickFeatures(o,f,m,v,y)};b6._defaultCredit=dtt;var CO=b6;function J5(o){o=Z(o,Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let f=Z(o.rectangle,Di.MAX_VALUE),m=new Bd({rectangle:f,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:o.ellipsoid});this._tilingScheme=m,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new Br,this._ready=!1;let v=o.credit;typeof v=="string"&&(v=new Cs(v)),this._credit=v;let y=Jr.createIfNeeded(o.url);if(this._resource=y,N(o.tileWidth)||N(o.tileHeight)){this._tileWidth=o.tileWidth,this._tileHeight=o.tileHeight,this._ready=!0,this._readyPromise=Promise.resolve(!0);return}mi("SingleTileImageryProvider options","options.tileHeight and options.tileWidth became required in CesiumJS 1.104. Omitting these properties will result in an error in 1.107. Provide options.tileHeight and options.tileWidth, or use SingleTileImageryProvider.fromUrl instead."),this._tileWidth=0,this._tileHeight=0,this._readyPromise=boe(y,this).then(x=>(ld.reportSuccess(this._errorEvent),this._image=x,this._tileWidth=x.width,this._tileHeight=x.height,this._ready=!0,!0))}Object.defineProperties(J5.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("SingleTileImageryProvider.ready","SingleTileImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return mi("SingleTileImageryProvider.readyPromise","SingleTileImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use SingleTileImageryProvider.fromUrl instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return mi("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("SingleTileImageryProvider.defaultAlpha","SingleTileImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(o){mi("SingleTileImageryProvider.defaultNightAlpha","SingleTileImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("SingleTileImageryProvider.defaultDayAlpha","SingleTileImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("SingleTileImageryProvider.defaultBrightness","SingleTileImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("SingleTileImageryProvider.defaultContrast","SingleTileImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("SingleTileImageryProvider.defaultHue","SingleTileImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("SingleTileImageryProvider.defaultSaturation","SingleTileImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("SingleTileImageryProvider.defaultGamma","SingleTileImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("SingleTileImageryProvider.defaultMinificationFilter","SingleTileImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("SingleTileImageryProvider.defaultMagnificationFilter","SingleTileImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});function Ogi(o,f,m,v){let y=`Failed to load image ${o.url}`;N(f)&&N(f.message)&&(y+=`: ${f.message}`);let x=ld.reportError(v,m,N(m)?m._errorEvent:void 0,y,0,0,0,f);if(x.retry)return boe(o,m,x);throw N(m)&&(m._hasError=!0),new sr(y)}async function boe(o,f,m){try{return await Q2.loadImage(null,o)}catch(v){return Ogi(o,v,f,m)}}J5.fromUrl=async function(o,f){let m=Jr.createIfNeeded(o),v=await boe(m);f=Z(f,Z.EMPTY_OBJECT);let y=new J5({...f,url:o,tileWidth:v.width,tileHeight:v.height});return y._image=v,y};J5.prototype.getTileCredits=function(o,f,m){};J5.prototype.requestImage=async function(o,f,m,v){if(!this._hasError&&!N(this._image)){let y=await boe(this._resource,this);return this._image=y,ld.reportSuccess(this._errorEvent),y}return this._image};J5.prototype.pickFeatures=function(o,f,m,v,y){};var EC=J5;function Ngi(o,f,m){this.type=o,N(f)||(o==="json"?f="application/json":o==="xml"?f="text/xml":o==="html"?f="text/html":o==="text"&&(f="text/plain")),this.format=f,N(m)||(o==="json"?m=Fgi:o==="xml"?m=zgi:(o==="html"||o==="text")&&(m=Jgi)),this.callback=m}function Fgi(o){let f=[],m=o.features;for(let v=0;v0)for(let x=0;x\s*<\/body>/im,qgi=//im,Xgi=/([\s\S]*)<\/title>/im;function Jgi(o){if(Ygi.test(o)||qgi.test(o))return;let f,m=Xgi.exec(o);m&&m.length>1&&(f=m[1]);let v=new yO;return v.name=f,v.description=o,v.data=o,[v]}var uW=Ngi;function Dq(o){o=Z(o,Z.EMPTY_OBJECT),this._tileCache={},this._tilesRequestedForInterval=[];let f=this._clock=o.clock;this._times=o.times,this._requestImageFunction=o.requestImageFunction,this._reloadFunction=o.reloadFunction,this._currentIntervalIndex=-1,f.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(f)}Object.defineProperties(Dq.prototype,{clock:{get:function(){return this._clock},set:function(o){this._clock!==o&&(this._clock=o,this._clockOnTick(o),this._reloadFunction())}},times:{get:function(){return this._times},set:function(o){this._times!==o&&(this._times=o,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});Dq.prototype.getFromCache=function(o,f,m,v){let y=ftt(o,f,m),x,C=this._tileCache[this._currentIntervalIndex];if(N(C)&&N(C[y])){let w=C[y];x=w.promise.catch(function(A){throw v.state=w.request.state,A}),delete C[y]}return x};Dq.prototype.checkApproachingInterval=function(o,f,m,v){let y=ftt(o,f,m),x=this._tilesRequestedForInterval,C=ptt(this),w={key:y,priorityFunction:v.priorityFunction};(!N(C)||!mtt(this,w,C))&&x.push(w),x.length>=512&&x.splice(0,256)};Dq.prototype._clockOnTick=function(o){let f=o.currentTime,m=this._times.indexOf(f),v=this._currentIntervalIndex;if(m!==v){let x=this._tileCache[v];for(let C in x)x.hasOwnProperty(C)&&x[C].request.cancel();delete this._tileCache[v],this._tilesRequestedForInterval=[],this._currentIntervalIndex=m,this._reloadFunction();return}let y=ptt(this);if(N(y)){let x=this._tilesRequestedForInterval,C=!0;for(;C&&x.length!==0;){let w=x.pop();C=mtt(this,w,y),C||x.push(w)}}};function ftt(o,f,m){return`${o}-${f}-${m}`}function Kgi(o){let f=o.split("-");if(f.length===3)return{x:Number(f[0]),y:Number(f[1]),level:Number(f[2])}}function ptt(o){let f=o._times;if(!N(f))return;let m=o._clock,v=m.currentTime,y=m.canAnimate&&m.shouldAnimate,x=m.multiplier;if(!y&&x!==0)return;let C,w=f.indexOf(v);if(w<0)return;let A=f.get(w);return x>0?(C=ci.secondsDifference(A.stop,v),++w):(C=ci.secondsDifference(A.start,v),--w),C/=x,w>=0&&C<=5?f.get(w):void 0}function mtt(o,f,m){let v=o._times.indexOf(m.start),y=o._tileCache,x=y[v];N(x)||(x=y[v]={});let C=f.key;if(N(x[C]))return!0;let w=Kgi(C),A=new cg({throttle:!1,throttleByServer:!0,type:Qy.IMAGERY,priorityFunction:f.priorityFunction}),E=o._requestImageFunction(w.x,w.y,w.level,A,m);return N(E)?(x[C]={promise:E,request:A},!0):!1}var woe=Dq,Qgi=[3034,3035,3042,3043,3044],Zgi=[4471,4559,4544];function jE(o){if(o=Z(o,Z.EMPTY_OBJECT),N(o.times)&&!N(o.clock))throw new li("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=Z(o.getFeatureInfoUrl,o.url);let f=Jr.createIfNeeded(o.url),m=Jr.createIfNeeded(this._getFeatureInfoUrl);f.setQueryParameters(jE.DefaultParameters,!0),m.setQueryParameters(jE.GetFeatureInfoDefaultParameters,!0),N(o.parameters)&&f.setQueryParameters(OHe(o.parameters)),N(o.getFeatureInfoParameters)&&m.setQueryParameters(OHe(o.getFeatureInfoParameters));let v=this;this._reload=void 0,N(o.times)&&(this._timeDynamicImagery=new woe({clock:o.clock,times:o.times,requestImageFunction:function(C,w,A,E,T){return gtt(v,C,w,A,E,T)},reloadFunction:function(){N(v._reload)&&v._reload()}}));let y={};if(y.layers=o.layers,y.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",y.width="{width}",y.height="{height}",parseFloat(f.queryParameters.version)>=1.3){y.crs=Z(o.crs,o.tilingScheme&&o.tilingScheme.projection instanceof hd?"EPSG:3857":"CRS:84");let C=y.crs.split(":");if(C[0]==="EPSG"&&C.length===2){let w=Number(C[1]),A=Z(o.reverseAxis,!0);(w>=4e3&&w<5e3&&!Zgi.includes(w)&&A||Qgi.includes(w))&&(y.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else y.srs=Z(o.srs,o.tilingScheme&&o.tilingScheme.projection instanceof hd?"EPSG:3857":"EPSG:4326");f.setQueryParameters(y,!0),m.setQueryParameters(y,!0);let x={query_layers:o.layers,info_format:"{format}"};parseFloat(m.queryParameters.version)>=1.3?(x.i="{i}",x.j="{j}"):(x.x="{i}",x.y="{j}"),m.setQueryParameters(x,!0),this._resource=f,this._pickFeaturesResource=m,this._layers=o.layers,this._tileProvider=new Xv({url:f,pickFeaturesUrl:m,tilingScheme:Z(o.tilingScheme,new Bd({ellipsoid:o.ellipsoid})),rectangle:o.rectangle,tileWidth:o.tileWidth,tileHeight:o.tileHeight,minimumLevel:o.minimumLevel,maximumLevel:o.maximumLevel,subdomains:o.subdomains,tileDiscardPolicy:o.tileDiscardPolicy,credit:o.credit,getFeatureInfoFormats:Z(o.getFeatureInfoFormats,jE.DefaultGetFeatureInfoFormats),enablePickFeatures:o.enablePickFeatures}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}function gtt(o,f,m,v,y,x){let C=N(x)?x.data:void 0,w=o._tileProvider;return N(C)&&w._resource.setQueryParameters(C),w.requestImage(f,m,v,y)}function $gi(o,f,m,v,y,x,C){let w=N(C)?C.data:void 0,A=o._tileProvider;return N(w)&&A._pickFeaturesResource.setQueryParameters(w),A.pickFeatures(f,m,v,y,x)}Object.defineProperties(jE.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},ready:{get:function(){return mi("WebMapServiceImageryProvider.ready","WebMapServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._tileProvider.ready}},readyPromise:{get:function(){return mi("WebMapServiceImageryProvider.readyPromise","WebMapServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._tileProvider.readyPromise}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(o){this._tileProvider.enablePickFeatures=o}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(o){this._timeDynamicImagery.clock=o}},times:{get:function(){return this._timeDynamicImagery.times},set:function(o){this._timeDynamicImagery.times=o}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}},defaultAlpha:{get:function(){return mi("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("WebMapServiceImageryProvider.defaultAlpha","WebMapServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(o){mi("WebMapServiceImageryProvider.defaultNightAlpha","WebMapServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("WebMapServiceImageryProvider.defaultDayAlpha","WebMapServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("WebMapServiceImageryProvider.defaultBrightness","WebMapServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("WebMapServiceImageryProvider.defaultContrast","WebMapServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("WebMapServiceImageryProvider.defaultHue","WebMapServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("WebMapServiceImageryProvider.defaultSaturation","WebMapServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("WebMapServiceImageryProvider.defaultGamma","WebMapServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("WebMapServiceImageryProvider.defaultMinificationFilter","WebMapServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("WebMapServiceImageryProvider.defaultMagnificationFilter","WebMapServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});jE.prototype.getTileCredits=function(o,f,m){return this._tileProvider.getTileCredits(o,f,m)};jE.prototype.requestImage=function(o,f,m,v){let y,x=this._timeDynamicImagery,C;return N(x)&&(C=x.currentInterval,y=x.getFromCache(o,f,m,v)),N(y)||(y=gtt(this,o,f,m,v,C)),N(y)&&N(x)&&x.checkApproachingInterval(o,f,m,v),y};jE.prototype.pickFeatures=function(o,f,m,v,y){let x=this._timeDynamicImagery,C=N(x)?x.currentInterval:void 0;return $gi(this,o,f,m,v,y,C)};jE.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});jE.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});jE.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new uW("json","application/json")),Object.freeze(new uW("xml","text/xml")),Object.freeze(new uW("text","text/html"))]);function OHe(o){let f={};for(let m in o)o.hasOwnProperty(m)&&(f[m.toLowerCase()]=o[m]);return f}var bO=jE,e0i=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function Lq(o){o=Z(o,Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let f=Jr.createIfNeeded(o.url),m=o.style,v=o.tileMatrixSetID,y=f.url,x=y.match(/{/g);if(!N(x)||x.length===1&&/{s}/.test(y))f.setQueryParameters(e0i),this._useKvp=!0;else{let S={style:m,Style:m,TileMatrixSet:v};f.setTemplateValues(S),this._useKvp=!1}this._resource=f,this._layer=o.layer,this._style=m,this._tileMatrixSetID=v,this._tileMatrixLabels=o.tileMatrixLabels,this._format=Z(o.format,"image/jpeg"),this._tileDiscardPolicy=o.tileDiscardPolicy,this._tilingScheme=N(o.tilingScheme)?o.tilingScheme:new Mm({ellipsoid:o.ellipsoid}),this._tileWidth=Z(o.tileWidth,256),this._tileHeight=Z(o.tileHeight,256),this._minimumLevel=Z(o.minimumLevel,0),this._maximumLevel=o.maximumLevel,this._rectangle=Z(o.rectangle,this._tilingScheme.rectangle),this._dimensions=o.dimensions;let C=this;this._reload=void 0,N(o.times)&&(this._timeDynamicImagery=new woe({clock:o.clock,times:o.times,requestImageFunction:function(S,M,I,P,D){return _tt(C,S,M,I,P,D)},reloadFunction:function(){N(C._reload)&&C._reload()}})),this._readyPromise=Promise.resolve(!0),this._ready=!0;let w=this._tilingScheme.positionToTileXY(Di.southwest(this._rectangle),this._minimumLevel),A=this._tilingScheme.positionToTileXY(Di.northeast(this._rectangle),this._minimumLevel),E=(Math.abs(A.x-w.x)+1)*(Math.abs(A.y-w.y)+1);this._errorEvent=new Br;let T=o.credit;this._credit=typeof T=="string"?new Cs(T):T,this._subdomains=o.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():N(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function _tt(o,f,m,v,y,x){let C=o._tileMatrixLabels,w=N(C)?C[v]:v.toString(),A=o._subdomains,E=o._dimensions,T=N(x)?x.data:void 0,S,M;if(!o._useKvp)M={TileMatrix:w,TileRow:m.toString(),TileCol:f.toString(),s:A[(f+m+v)%A.length]},S=o._resource.getDerivedResource({request:y}),S.setTemplateValues(M),N(E)&&S.setTemplateValues(E),N(T)&&S.setTemplateValues(T);else{let I={};I.tilematrix=w,I.layer=o._layer,I.style=o._style,I.tilerow=m,I.tilecol=f,I.tilematrixset=o._tileMatrixSetID,I.format=o._format,N(E)&&(I=va(I,E)),N(T)&&(I=va(I,T)),M={s:A[(f+m+v)%A.length]},S=o._resource.getDerivedResource({queryParameters:I,request:y}),S.setTemplateValues(M)}return Q2.loadImage(o,S)}Object.defineProperties(Lq.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},ready:{get:function(){return mi("WebMapTileServiceImageryProvider.ready","WebMapTileServiceImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return mi("WebMapTileServiceImageryProvider.readyPromise","WebMapTileServiceImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(o){this._timeDynamicImagery.clock=o}},times:{get:function(){return this._timeDynamicImagery.times},set:function(o){this._timeDynamicImagery.times=o}},dimensions:{get:function(){return this._dimensions},set:function(o){this._dimensions!==o&&(this._dimensions=o,N(this._reload)&&this._reload())}},defaultAlpha:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("WebMapTileServiceImageryProvider.defaultAlpha","WebMapTileServiceImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(o){mi("WebMapTileServiceImageryProvider.defaultNightAlpha","WebMapTileServiceImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("WebMapTileServiceImageryProvider.defaultDayAlpha","WebMapTileServiceImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("WebMapTileServiceImageryProvider.defaultBrightness","WebMapTileServiceImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("WebMapTileServiceImageryProvider.defaultContrast","WebMapTileServiceImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("WebMapTileServiceImageryProvider.defaultHue","WebMapTileServiceImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("WebMapTileServiceImageryProvider.defaultSaturation","WebMapTileServiceImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("WebMapTileServiceImageryProvider.defaultGamma","WebMapTileServiceImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("WebMapTileServiceImageryProvider.defaultMinificationFilter","WebMapTileServiceImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("WebMapTileServiceImageryProvider.defaultMagnificationFilter","WebMapTileServiceImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});Lq.prototype.getTileCredits=function(o,f,m){};Lq.prototype.requestImage=function(o,f,m,v){let y,x=this._timeDynamicImagery,C;return N(x)&&(C=x.currentInterval,y=x.getFromCache(o,f,m,v)),N(y)||(y=_tt(this,o,f,m,v,C)),N(y)&&N(x)&&x.checkApproachingInterval(o,f,m,v),y};Lq.prototype.pickFeatures=function(o,f,m,v,y){};var hP=Lq;function FI(o){return function(f){return new o(f)}}var t0i={ARCGIS_MAPSERVER:FI(hC),BING:FI(xO),GOOGLE_EARTH:FI(Coe),MAPBOX:FI(CO),SINGLE_TILE:FI(EC),TMS:FI(cb),URL_TEMPLATE:FI(Xv),WMS:FI(bO),WMTS:FI(hP)},i0i={ARCGIS_MAPSERVER:hC.fromUrl,BING:async(o,f)=>xO.fromUrl(o,f),GOOGLE_EARTH:async(o,f)=>{let m=f.channel;return delete f.channel,Coe.fromUrl(o,m,f)},MAPBOX:(o,f)=>new CO({url:o,...f}),SINGLE_TILE:EC.fromUrl,TMS:cb.fromUrl,URL_TEMPLATE:(o,f)=>new Xv({url:o,...f}),WMS:(o,f)=>new bO({url:o,...f}),WMTS:(o,f)=>new hP({url:o,...f})};function lC(o){o=Z(o,Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._ready=!1,this._tileCredits=void 0,this._errorEvent=new Br;let f=o.assetId;N(f)&&(mi("IonImageryProvider options.assetId","options.assetId was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),lC._initialize(this,f,o))}Object.defineProperties(lC.prototype,{ready:{get:function(){return mi("IonImageryProvider.ready","IonImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._ready}},readyPromise:{get:function(){return mi("IonImageryProvider.readyPromise","IonImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use IonImageryProvider.fromAssetId instead."),this._readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}},defaultAlpha:{get:function(){return mi("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("IonImageryProvider.defaultAlpha","IonImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(o){mi("IonImageryProvider.defaultNightAlpha","IonImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("IonImageryProvider.defaultDayAlpha","IonImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("IonImageryProvider.defaultBrightness","IonImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("IonImageryProvider.defaultContrast","IonImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("IonImageryProvider.defaultHue","IonImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("IonImageryProvider.defaultSaturation","IonImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("IonImageryProvider.defaultGamma","IonImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("IonImageryProvider.defaultMinificationFilter","IonImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("IonImageryProvider.defaultMagnificationFilter","IonImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});lC._initialize=function(o,f,m){let v=Pw._createEndpointResource(f,m),y=f.toString()+m.accessToken+m.server,x=lC._endpointCache[y];N(x)||(x=v.fetchJson(),lC._endpointCache[y]=x),o._readyPromise=x.then(function(C){if(C.type!=="IMAGERY")return Promise.reject(new sr(`Cesium ion asset ${f} is not an imagery asset.`));let w,A=C.externalType;if(!N(A))w=new cb({url:new Pw(C,v)});else{let E=t0i[A];if(!N(E))return Promise.reject(new sr(`Unrecognized Cesium ion imagery type: ${A}`));w=E(C.options)}return o._tileCredits=Pw.getCreditsFromEndpoint(C,v),w.errorEvent.addEventListener(function(E){E.provider=o,o._errorEvent.raiseEvent(E)}),o._imageryProvider=w,Promise.resolve(w._readyPromise).then(function(){return o._ready=!0,!0})})};lC.fromAssetId=async function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=Pw._createEndpointResource(o,f),v=o.toString()+f.accessToken+f.server,y=lC._endpointCache[v];N(y)||(y=m.fetchJson(),lC._endpointCache[v]=y);let x=await y;if(x.type!=="IMAGERY")throw new sr(`Cesium ion asset ${o} is not an imagery asset.`);let C,w=x.externalType;if(!N(w))C=await cb.fromUrl(new Pw(x,m));else{let E=i0i[w];if(!N(E))throw new sr(`Unrecognized Cesium ion imagery type: ${w}`);let T={...x.options},S=T.url;delete T.url,C=await E(S,T)}let A=new lC(f);return C.errorEvent.addEventListener(function(E){E.provider=A,A._errorEvent.raiseEvent(E)}),A._tileCredits=Pw.getCreditsFromEndpoint(x,m),A._imageryProvider=C,A._ready=!0,A._readyPromise=Promise.resolve(!0),A};lC.prototype.getTileCredits=function(o,f,m){let v=this._imageryProvider.getTileCredits(o,f,m);return N(v)?this._tileCredits.concat(v):this._tileCredits};lC.prototype.requestImage=function(o,f,m,v){return this._imageryProvider.requestImage(o,f,m,v)};lC.prototype.pickFeatures=function(o,f,m,v,y){return this._imageryProvider.pickFeatures(o,f,m,v,y)};lC._endpointCache={};var p2=lC,r0i={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},x5=Object.freeze(r0i);function n0i(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.style,x5.AERIAL);return p2.fromAssetId(f)}var rH=n0i;function ZH(o,f,m,v,y){if(this.imageryLayer=o,this.x=f,this.y=m,this.level=v,this.request=void 0,v!==0){let C=f/2|0,w=m/2|0,A=v-1;this.parent=o.getImageryFromCache(C,w,A)}this.state=kl.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0;let x=o.imageryProvider;!N(y)&&o.ready&&(N(x._ready)?x._ready:!N(x.ready)||x.ready)&&(y=o.imageryProvider.tilingScheme.tileXYToRectangle(f,m,v)),this.rectangle=y}ZH.createPlaceholder=function(o){let f=new ZH(o,0,0,0);return f.addReference(),f.state=kl.PLACEHOLDER,f};ZH.prototype.addReference=function(){++this.referenceCount};ZH.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),N(this.parent)&&this.parent.releaseReference(),N(this.image)&&N(this.image.destroy)&&this.image.destroy(),N(this.texture)&&this.texture.destroy(),N(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),kr(this),0):this.referenceCount};ZH.prototype.processStateMachine=function(o,f,m){this.state===kl.UNLOADED&&!m&&(this.state=kl.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===kl.RECEIVED&&(this.state=kl.TRANSITIONING,this.imageryLayer._createTexture(o.context,this));let v=this.state===kl.READY&&f&&!this.texture;(this.state===kl.TEXTURE_LOADED||v)&&(this.state=kl.TRANSITIONING,this.imageryLayer._reprojectTexture(o,this,f))};var Aoe=ZH;function ATe(o,f,m){this.readyImagery=void 0,this.loadingImagery=o,this.textureCoordinateRectangle=f,this.textureTranslationAndScale=void 0,this.useWebMercatorT=m}ATe.prototype.freeResources=function(){N(this.readyImagery)&&this.readyImagery.releaseReference(),N(this.loadingImagery)&&this.loadingImagery.releaseReference()};ATe.prototype.processStateMachine=function(o,f,m){let v=this.loadingImagery,y=v.imageryLayer;if(v.processStateMachine(f,!this.useWebMercatorT,m),v.state===kl.READY)return N(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=y._calculateTextureTranslationAndScale(o,this),!0;let x=v.parent,C;for(;N(x)&&(x.state!==kl.READY||!this.useWebMercatorT&&!N(x.texture));)x.state!==kl.FAILED&&x.state!==kl.INVALID&&(C=C||x),x=x.parent;return this.readyImagery!==x&&(N(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=x,N(x)&&(x.addReference(),this.textureTranslationAndScale=y._calculateTextureTranslationAndScale(o,this))),v.state===kl.FAILED||v.state===kl.INVALID?N(C)?(C.processStateMachine(f,!this.useWebMercatorT,m),!1):!0:!1};var Eoe=ATe;function Su(o,f){this._imageryProvider=o,this._readyEvent=new Br,this._errorEvent=new Br,f=Z(f,Z.EMPTY_OBJECT),o=Z(o,Z.EMPTY_OBJECT),this._availability=void 0,this._definitionChanged=new Br,this.availability=Z(this.availability,f.availability),this.alpha=Z(f.alpha,Z(o._defaultAlpha,1)),this.nightAlpha=Z(f.nightAlpha,Z(o._defaultNightAlpha,1)),this.dayAlpha=Z(f.dayAlpha,Z(o._defaultDayAlpha,1)),this.brightness=Z(f.brightness,Z(o._defaultBrightness,Su.DEFAULT_BRIGHTNESS)),this.contrast=Z(f.contrast,Z(o._defaultContrast,Su.DEFAULT_CONTRAST)),this.hue=Z(f.hue,Z(o._defaultHue,Su.DEFAULT_HUE)),this.saturation=Z(f.saturation,Z(o._defaultSaturation,Su.DEFAULT_SATURATION)),this.gamma=Z(f.gamma,Z(o._defaultGamma,Su.DEFAULT_GAMMA)),this.splitDirection=Z(f.splitDirection,Su.DEFAULT_SPLIT),this.minificationFilter=Z(f.minificationFilter,Z(o._defaultMinificationFilter,Su.DEFAULT_MINIFICATION_FILTER)),this.magnificationFilter=Z(f.magnificationFilter,Z(o._defaultMagnificationFilter,Su.DEFAULT_MAGNIFICATION_FILTER)),this.show=Z(f.show,!0),this._minimumTerrainLevel=f.minimumTerrainLevel,this._maximumTerrainLevel=f.maximumTerrainLevel,this._rectangle=Z(f.rectangle,Di.MAX_VALUE),this._maximumAnisotropy=f.maximumAnisotropy,this._imageryCache={},this._imageryCacheAdd={},this._skeletonPlaceholder=new Eoe(Aoe.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=f.cutoutRectangle,this.colorToAlpha=f.colorToAlpha,this.colorToAlphaThreshold=Z(f.colorToAlphaThreshold,Su.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD)}Object.defineProperties(Su.prototype,{availability:S1("availability"),definitionChanged:{get:function(){return this._definitionChanged}},imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return N(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Su.DEFAULT_BRIGHTNESS=1;Su.DEFAULT_CONTRAST=1;Su.DEFAULT_HUE=0;Su.DEFAULT_SATURATION=1;Su.DEFAULT_GAMMA=1;Su.DEFAULT_SPLIT=eD.NONE;Su.DEFAULT_MINIFICATION_FILTER=Xa.LINEAR;Su.DEFAULT_MAGNIFICATION_FILTER=Zu.LINEAR;Su.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Su.fromProviderAsync=function(o,f){let m=new Su(void 0,f);return u0i(m,Promise.resolve(o)),m};Su.fromWorldImagery=function(o){return o=Z(o,Z.EMPTY_OBJECT),Su.fromProviderAsync(rH({style:o.style}),o)};Su.prototype.isBaseLayer=function(){return this._isBaseLayer};Su.prototype.isDestroyed=function(){return!1};Su.prototype.destroy=function(){return kr(this)};var vtt=new Di,NHe=new Di,jfe=new Di,ytt=new Di;Su.prototype.getViewableRectangle=async function(){mi("ImageryLayer.getViewableRectangle","ImageryLayer.getViewableRectangle was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.getImageryRectangle instead.");let o=this._imageryProvider,f=this._rectangle;return N(o._readyPromise)?await o._readyPromise:N(o.readyPromise)&&await o.readyPromise,Di.intersection(o.rectangle,f)};Su.prototype.getImageryRectangle=function(){let o=this._imageryProvider,f=this._rectangle;return Di.intersection(o.rectangle,f)};Su.prototype._createTileImagerySkeletons=function(o,f,m){let v=o.data;if(!N(f)||N(this._minimumTerrainLevel)&&o.level<this._minimumTerrainLevel||N(this._maximumTerrainLevel)&&o.level>this._maximumTerrainLevel)return!1;N(m)||(m=v.imagery.length);let y=this._imageryProvider;if(!this.ready||(N(y._ready)?!y._ready:N(y.ready)&&!y.ready))return this._skeletonPlaceholder.loadingImagery.addReference(),v.imagery.splice(m,0,this._skeletonPlaceholder),!0;let x=(y.tilingScheme.projection instanceof hd||y.tilingScheme.projection instanceof vU)&&o.rectangle.north<hd.MaximumLatitude&&o.rectangle.south>-hd.MaximumLatitude,C=Di.intersection(y.rectangle,this._rectangle,vtt),w=Di.intersection(o.rectangle,C,NHe);if(!N(w)){if(!this.isBaseLayer())return!1;let Q=C,ee=o.rectangle;w=NHe,ee.south>=Q.north?w.north=w.south=Q.north:ee.north<=Q.south?w.north=w.south=Q.south:(w.south=Math.max(ee.south,Q.south),w.north=Math.min(ee.north,Q.north)),ee.west>=Q.east?w.west=w.east=Q.east:ee.east<=Q.west?w.west=w.east=Q.west:(w.west=Math.max(ee.west,Q.west),w.east=Math.min(ee.east,Q.east))}let A=0;w.south>0?A=w.south:w.north<0&&(A=w.north);let E=1*f.getLevelMaximumGeometricError(o.level),T=s0i(this,E,A);T=Math.max(0,T);let S=y.maximumLevel;if(T>S&&(T=S),N(y.minimumLevel)){let Q=y.minimumLevel;T<Q&&(T=Q)}let M=y.tilingScheme,I=M.positionToTileXY(Di.northwest(w),T),P=M.positionToTileXY(Di.southeast(w),T),D=o.rectangle.width/512,L=o.rectangle.height/512,R=M.tileXYToRectangle(I.x,I.y,T);Math.abs(R.south-o.rectangle.north)<L&&I.y<P.y&&++I.y,Math.abs(R.east-o.rectangle.west)<D&&I.x<P.x&&++I.x;let O=M.tileXYToRectangle(P.x,P.y,T);Math.abs(O.north-o.rectangle.south)<L&&P.y>I.y&&--P.y,Math.abs(O.west-o.rectangle.east)<D&&P.x>I.x&&--P.x;let F=Di.clone(o.rectangle,ytt),k=M.tileXYToRectangle(I.x,I.y,T),U=Di.intersection(k,C,jfe),G;x?(M.rectangleToNativeRectangle(F,F),M.rectangleToNativeRectangle(k,k),M.rectangleToNativeRectangle(U,U),M.rectangleToNativeRectangle(C,C),G=M.tileXYToNativeRectangle.bind(M),D=F.width/512,L=F.height/512):G=M.tileXYToRectangle.bind(M);let j,q=0,J=1,X;!this.isBaseLayer()&&Math.abs(U.west-F.west)>=D&&(q=Math.min(1,(U.west-F.west)/F.width)),!this.isBaseLayer()&&Math.abs(U.north-F.north)>=L&&(J=Math.max(0,(U.north-F.south)/F.height));let Y=J;for(let Q=I.x;Q<=P.x;Q++)if(j=q,k=G(Q,I.y,T),U=Di.simpleIntersection(k,C,jfe),!!N(U)){q=Math.min(1,(U.east-F.west)/F.width),Q===P.x&&(this.isBaseLayer()||Math.abs(U.east-F.east)<D)&&(q=1),J=Y;for(let ee=I.y;ee<=P.y;ee++){if(X=J,k=G(Q,ee,T),U=Di.simpleIntersection(k,C,jfe),!N(U))continue;J=Math.max(0,(U.south-F.south)/F.height),ee===P.y&&(this.isBaseLayer()||Math.abs(U.south-F.south)<L)&&(J=0);let z=new Wt(j,J,q,X),ie=this.getImageryFromCache(Q,ee,T);v.imagery.splice(m,0,new Eoe(ie,z,x)),++m}}return!0};Su.prototype._calculateTextureTranslationAndScale=function(o,f){let m=f.readyImagery.rectangle,v=o.rectangle;if(f.useWebMercatorT){let A=f.readyImagery.imageryLayer.imageryProvider.tilingScheme;m=A.rectangleToNativeRectangle(m,vtt),v=A.rectangleToNativeRectangle(v,ytt)}let y=v.width,x=v.height,C=y/m.width,w=x/m.height;return new Wt(C*(v.west-m.west)/y,w*(v.south-m.south)/x,C,w)};Su.prototype._requestImagery=function(o){let f=this._imageryProvider,m=this,v=$H(o.x,o.y,o.level);f.addLevel&&this._imageryCache[v]&&(delete this._imageryCache[v],o.level+=f.addLevel,v=$H(o.x,o.y,o.level),this._imageryCacheAdd[v]=o);function y(w){if(!N(w))return x();o.image=w,o.state=kl.RECEIVED,o.request=void 0,ld.reportSuccess(m._requestImageError)}function x(w){if(o.request.state===bc.CANCELLED){o.state=kl.UNLOADED,o.request=void 0;return}o.state=kl.FAILED,o.request=void 0;let A=`Failed to obtain image tile X: ${o.x} Y: ${o.y} Level: ${o.level}.`;m._requestImageError=ld.reportError(m._requestImageError,f,f.errorEvent,A,o.x,o.y,o.level,w),m._requestImageError.retry&&C()}function C(){let w=new cg({throttle:!1,throttleByServer:!0,type:Qy.IMAGERY});o.request=w,o.state=kl.TRANSITIONING;let A=f.requestImage(o.x,o.y,o.level,w);if(!N(A)){o.state=kl.UNLOADED,o.request=void 0;return}N(f.getTileCredits)&&(o.credits=f.getTileCredits(o.x,o.y,o.level)),A.then(function(E){y(E)}).catch(function(E){x(E)})}C()};Su.prototype._createTextureWebGL=function(o,f){let m=new gs({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),v=f.image;return N(v.internalFormat)?new _o({context:o,pixelFormat:v.internalFormat,width:v.width,height:v.height,source:{arrayBufferView:v.bufferView},sampler:m}):new _o({context:o,source:v,pixelFormat:this._imageryProvider.hasAlphaChannel?Nn.RGBA:Nn.RGB,sampler:m})};Su.prototype._createTexture=function(o,f){let m=this._imageryProvider,v=f.image;if(N(m.tileDiscardPolicy)){let x=m.tileDiscardPolicy;if(N(x)){if(!x.isReady()){f.state=kl.RECEIVED;return}if(x.shouldDiscardImage(v)){f.state=kl.INVALID;return}}}let y=this._createTextureWebGL(o,f);m.tilingScheme.projection instanceof hd||m.tilingScheme.projection instanceof vU?f.textureWebMercator=y:f.texture=y,f.image=void 0,f.state=kl.TEXTURE_LOADED};function FHe(o,f,m){return`${o}:${f}:${m}`}Su.prototype._finalizeReprojectTexture=function(o,f){let m=this.minificationFilter,v=this.magnificationFilter;if(m===Xa.LINEAR&&v===Zu.LINEAR&&!Nn.isCompressedFormat(f.pixelFormat)&&xe.isPowerOfTwo(f.width)&&xe.isPowerOfTwo(f.height)){m=Xa.LINEAR_MIPMAP_LINEAR;let y=Bo.maximumTextureFilterAnisotropy,x=Math.min(y,Z(this._maximumAnisotropy,y)),C=FHe(m,v,x),w=o.cache.imageryLayerMipmapSamplers;N(w)||(w={},o.cache.imageryLayerMipmapSamplers=w);let A=w[C];N(A)||(A=w[C]=new gs({minificationFilter:m,magnificationFilter:v,maximumAnisotropy:x})),f.generateMipmap(hB.NICEST),f.sampler=A}else{let y=FHe(m,v,0),x=o.cache.imageryLayerNonMipmapSamplers;N(x)||(x={},o.cache.imageryLayerNonMipmapSamplers=x);let C=x[y];N(C)||(C=x[y]=new gs({minificationFilter:m,magnificationFilter:v})),f.sampler=C}};Su.prototype._reprojectTexture=function(o,f,m){let v=f.textureWebMercator||f.texture,y=f.rectangle,x=o.context;if(m=Z(m,!0),m&&!(this._imageryProvider.tilingScheme.projection instanceof Mp)&&y.width/v.width>1e-5){let C=this;f.addReference();let w=new B5({persists:!0,owner:this,preExecute:function(A){a0i(A,x,v,f.rectangle)},postExecute:function(A){f.texture=A,C._finalizeReprojectTexture(x,A),f.state=kl.READY,f.releaseReference()},canceled:function(){f.state=kl.TEXTURE_LOADED,f.releaseReference()}});this._reprojectComputeCommands.push(w)}else m&&(f.texture=v),this._finalizeReprojectTexture(x,v),f.state=kl.READY};Su.prototype.queueReprojectionCommands=function(o){let f=this._reprojectComputeCommands,m=f.length;for(let v=0;v<m;++v)o.commandList.push(f[v]);f.length=0};Su.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(o){N(o.canceled)&&o.canceled()}),this._reprojectComputeCommands.length=0};Su.prototype.getImageryFromCache=function(o,f,m,v){let y=$H(o,f,m),x=this._imageryCache[y];if(this._imageryProvider.addLevel){let C=$H(o,f,m+this._imageryProvider.addLevel);x||(x=this._imageryCacheAdd[C])}return N(x)||(x=new Aoe(this,o,f,m,v),this._imageryCache[y]=x),x.addReference(),x};Su.prototype.removeImageryFromCache=function(o){let f=$H(o.x,o.y,o.level);if(this._imageryProvider.addLevel){this._imageryCacheAdd[f]&&delete this._imageryCacheAdd[f],this._imageryCache[f]&&delete this._imageryCache[f];let m=$H(o.x,o.y,o.level+this._imageryProvider.addLevel);this._imageryCacheAdd[m]&&delete this._imageryCacheAdd[m];return}delete this._imageryCache[f]};Su.prototype.isAvailable=function(o){let f=this._availability;return!N(f)||f.contains(o)};function $H(o,f,m){return JSON.stringify([o,f,m])}var FZ={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new Ye,texture:void 0},o0i=pa.supportsTypedArrays()?new Float32Array(2*64):void 0;function a0i(o,f,m,v){let y=f.cache.imageryLayer_reproject;if(!N(y)){y=f.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){N(this.framebuffer)&&this.framebuffer.destroy(),N(this.vertexArray)&&this.vertexArray.destroy(),N(this.shaderProgram)&&this.shaderProgram.destroy()}};let D=new Float32Array(2*64*2),L=0;for(let U=0;U<64;++U){let G=U/63;D[L++]=0,D[L++]=G,D[L++]=1,D[L++]=G}let R={position:0,webMercatorT:1},O=Rv.getRegularGridIndices(2,64),F=Ao.createIndexBuffer({context:f,typedArray:O,usage:gn.STATIC_DRAW,indexDatatype:ro.UNSIGNED_SHORT});y.vertexArray=new Du({context:f,attributes:[{index:R.position,vertexBuffer:Ao.createVertexBuffer({context:f,typedArray:D,usage:gn.STATIC_DRAW}),componentsPerAttribute:2},{index:R.webMercatorT,vertexBuffer:Ao.createVertexBuffer({context:f,sizeInBytes:64*2*4,usage:gn.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:F});let k=new Zr({sources:[QAe]});y.shaderProgram=Rs.fromCache({context:f,vertexShaderSource:k,fragmentShaderSource:KAe,attributeLocations:R}),y.sampler=new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR})}m.sampler=y.sampler;let x=m.width,C=m.height;FZ.textureDimensions.x=x,FZ.textureDimensions.y=C,FZ.texture=m;let w=Math.sin(v.south),A=.5*Math.log((1+w)/(1-w));w=Math.sin(v.north);let E=1/(.5*Math.log((1+w)/(1-w))-A),T=new _o({context:f,width:x,height:C,pixelFormat:m.pixelFormat,pixelDatatype:m.pixelDatatype,preMultiplyAlpha:m.preMultiplyAlpha});xe.isPowerOfTwo(x)&&xe.isPowerOfTwo(C)&&T.generateMipmap(hB.NICEST);let S=v.south,M=v.north,I=o0i,P=0;for(let D=0;D<64;++D){let L=D/63,R=xe.lerp(S,M,L);w=Math.sin(R);let O=(.5*Math.log((1+w)/(1-w))-A)*E;I[P++]=O,I[P++]=O}y.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(I),o.shaderProgram=y.shaderProgram,o.outputTexture=T,o.uniformMap=FZ,o.vertexArray=y.vertexArray}function s0i(o,f,m){let v=o._imageryProvider,y=v.tilingScheme,x=y.ellipsoid,C=o._imageryProvider.tilingScheme.projection instanceof Mp?1:Math.cos(m),w=y.rectangle,A=x.maximumRadius*w.width*C/(v.tileWidth*y.getNumberOfXTilesAtLevel(0))/f,E=Math.log(A)/Math.log(2);return Math.round(E)|0}function l0i(o,f){o.numberOfListeners>0?o.raiseEvent(f):console.error(f)}async function u0i(o,f){let m;try{if(m=await Promise.resolve(f),o.isDestroyed())return;o._imageryProvider=m,o._readyEvent.raiseEvent(m)}catch(v){l0i(o._errorEvent,v)}}var x_=Su,c0i={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Ss=c0i;function w6(o){this.tile=o,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new Wt}w6.prototype.update=function(o,f,m){this.changedThisFrame&&(xtt(o,f,this.tile,m),this.changedThisFrame=!1)};w6.prototype.destroy=function(o){this._destroyVertexArray(o),N(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};w6.prototype._destroyVertexArray=function(o){N(this.vertexArray)&&(N(o)?o.push(this.vertexArray):OM._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var h0i=new R5;w6.updateFillTiles=function(o,f,m,v){let y=o._quadtree,x=y._levelZeroTiles,C=y._lastSelectionFrameNumber,w=h0i;w.clear();for(let E=0;E<f.length;++E){let T=f[E];N(T.data.vertexArray)&&w.enqueue(f[E])}let A=w.dequeue();for(;A!==void 0;){let E=A.findTileToWest(x),T=A.findTileToSouth(x),S=A.findTileToEast(x),M=A.findTileToNorth(x);eg(o,m,A,E,C,Ss.EAST,!1,w,v),eg(o,m,A,T,C,Ss.NORTH,!1,w,v),eg(o,m,A,S,C,Ss.WEST,!1,w,v),eg(o,m,A,M,C,Ss.SOUTH,!1,w,v);let I=E.findTileToNorth(x),P=E.findTileToSouth(x),D=S.findTileToNorth(x),L=S.findTileToSouth(x);eg(o,m,A,I,C,Ss.SOUTHEAST,!1,w,v),eg(o,m,A,D,C,Ss.SOUTHWEST,!1,w,v),eg(o,m,A,P,C,Ss.NORTHEAST,!1,w,v),eg(o,m,A,L,C,Ss.NORTHWEST,!1,w,v),A=w.dequeue()}};function eg(o,f,m,v,y,x,C,w,A){if(v===void 0)return;let E=v;for(;E&&(E._lastSelectionResultFrame!==y||ba.wasKicked(E._lastSelectionResult)||ba.originalResult(E._lastSelectionResult)===ba.CULLED);){if(C)return;let T=E.parent;if(x>=Ss.NORTHWEST&&T!==void 0)switch(x){case Ss.NORTHWEST:E=E===T.northwestChild?T:void 0;break;case Ss.NORTHEAST:E=E===T.northeastChild?T:void 0;break;case Ss.SOUTHWEST:E=E===T.southwestChild?T:void 0;break;case Ss.SOUTHEAST:E=E===T.southeastChild?T:void 0;break}else E=T}if(E!==void 0){if(E._lastSelectionResult===ba.RENDERED){if(N(E.data.vertexArray))return;d0i(o,f,m,E,x,y,w,A);return}if(ba.originalResult(v._lastSelectionResult)!==ba.CULLED)switch(x){case Ss.WEST:eg(o,f,m,v.northwestChild,y,x,!0,w,A),eg(o,f,m,v.southwestChild,y,x,!0,w,A);break;case Ss.EAST:eg(o,f,m,v.southeastChild,y,x,!0,w,A),eg(o,f,m,v.northeastChild,y,x,!0,w,A);break;case Ss.SOUTH:eg(o,f,m,v.southwestChild,y,x,!0,w,A),eg(o,f,m,v.southeastChild,y,x,!0,w,A);break;case Ss.NORTH:eg(o,f,m,v.northeastChild,y,x,!0,w,A),eg(o,f,m,v.northwestChild,y,x,!0,w,A);break;case Ss.NORTHWEST:eg(o,f,m,v.northwestChild,y,x,!0,w,A);break;case Ss.NORTHEAST:eg(o,f,m,v.northeastChild,y,x,!0,w,A);break;case Ss.SOUTHWEST:eg(o,f,m,v.southwestChild,y,x,!0,w,A);break;case Ss.SOUTHEAST:eg(o,f,m,v.southeastChild,y,x,!0,w,A);break;default:throw new li("Invalid edge")}}}function d0i(o,f,m,v,y,x,C,w){let A=v.data;if(A.fill===void 0)A.fill=new w6(v);else if(A.fill.visitedFrame===x)return;A.fill.enqueuedFrame!==x&&(A.fill.enqueuedFrame=x,A.fill.changedThisFrame=!1,C.enqueue(v)),f0i(o,f,m,v,y,w)}function f0i(o,f,m,v,y,x){let C=v.data.fill,w,A=m.data.fill;N(A)?(A.visitedFrame=f.frameNumber,A.changedThisFrame&&(xtt(o,f,m,x),A.changedThisFrame=!1),w=m.data.fill.mesh):w=m.data.mesh;let E,T;switch(y){case Ss.WEST:E=C.westMeshes,T=C.westTiles;break;case Ss.SOUTH:E=C.southMeshes,T=C.southTiles;break;case Ss.EAST:E=C.eastMeshes,T=C.eastTiles;break;case Ss.NORTH:E=C.northMeshes,T=C.northTiles;break;case Ss.NORTHWEST:C.changedThisFrame=C.changedThisFrame||C.northwestMesh!==w,C.northwestMesh=w,C.northwestTile=m;return;case Ss.NORTHEAST:C.changedThisFrame=C.changedThisFrame||C.northeastMesh!==w,C.northeastMesh=w,C.northeastTile=m;return;case Ss.SOUTHWEST:C.changedThisFrame=C.changedThisFrame||C.southwestMesh!==w,C.southwestMesh=w,C.southwestTile=m;return;case Ss.SOUTHEAST:C.changedThisFrame=C.changedThisFrame||C.southeastMesh!==w,C.southeastMesh=w,C.southeastTile=m;return}if(m.level<=v.level){C.changedThisFrame=C.changedThisFrame||E[0]!==w||E.length!==1,E[0]=w,T[0]=m,E.length=1,T.length=1;return}let S,M,I,P,D=m.rectangle,L,R=v.rectangle;switch(y){case Ss.WEST:for(L=(R.north-R.south)*xe.EPSILON5,S=0;S<T.length&&(I=T[S],P=I.rectangle,!xe.greaterThan(D.north,P.south,L));++S);for(M=S;M<T.length&&(I=T[M],P=I.rectangle,!xe.greaterThanOrEquals(D.south,P.north,L));++M);break;case Ss.SOUTH:for(L=(R.east-R.west)*xe.EPSILON5,S=0;S<T.length&&(I=T[S],P=I.rectangle,!xe.lessThan(D.west,P.east,L));++S);for(M=S;M<T.length&&(I=T[M],P=I.rectangle,!xe.lessThanOrEquals(D.east,P.west,L));++M);break;case Ss.EAST:for(L=(R.north-R.south)*xe.EPSILON5,S=0;S<T.length&&(I=T[S],P=I.rectangle,!xe.lessThan(D.south,P.north,L));++S);for(M=S;M<T.length&&(I=T[M],P=I.rectangle,!xe.lessThanOrEquals(D.north,P.south,L));++M);break;case Ss.NORTH:for(L=(R.east-R.west)*xe.EPSILON5,S=0;S<T.length&&(I=T[S],P=I.rectangle,!xe.greaterThan(D.east,P.west,L));++S);for(M=S;M<T.length&&(I=T[M],P=I.rectangle,!xe.greaterThanOrEquals(D.west,P.east,L));++M);break}M-S===1?(C.changedThisFrame=C.changedThisFrame||E[S]!==w,E[S]=w,T[S]=m):(C.changedThisFrame=!0,E.splice(S,M-S,w),T.splice(S,M-S,m))}var r5=new Mt,p0i=new Mt,nH=new H,ETe=new H,Oge=new Ye,Nge=new Ye,P1=new Ye;function Toe(){this.height=0,this.encodedNormal=new Ye}function BZ(o,f,m,v,y,x,C,w,A){if(N(y))return y;let E;if(N(x)&&N(C))E=(x.height+C.height)*.5;else if(N(x))E=x.height;else if(N(C))E=C.height;else if(N(w))E=w.height;else{let T=o.tile.data.tileBoundingRegion,S=0,M=0;N(T)&&(S=T.minimumHeight,M=T.maximumHeight),E=(S+M)*.5}return Ctt(o,f,m,v,E,A),A}var m0i={minimumHeight:0,maximumHeight:0},g0i=new H,BHe=new Toe,kHe=new Toe,VHe=new Toe,zHe=new Toe,_0i=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,v0i={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function xtt(o,f,m,v){OM.initialize(m,o.terrainProvider,o._imageryLayers);let y=m.data,x=y.fill,C=m.rectangle,w=f.terrainExaggeration,A=f.terrainExaggerationRelativeHeight,E=w!==1,T=m.tilingScheme.ellipsoid,S=VZ(x,T,0,1,x.northwestTile,x.northwestMesh,x.northTiles,x.northMeshes,x.westTiles,x.westMeshes,VHe),M=VZ(x,T,0,0,x.southwestTile,x.southwestMesh,x.westTiles,x.westMeshes,x.southTiles,x.southMeshes,BHe),I=VZ(x,T,1,0,x.southeastTile,x.southeastMesh,x.southTiles,x.southMeshes,x.eastTiles,x.eastMeshes,kHe),P=VZ(x,T,1,1,x.northeastTile,x.northeastMesh,x.eastTiles,x.eastMeshes,x.northTiles,x.northMeshes,zHe);S=BZ(x,T,0,1,S,M,P,I,VHe),M=BZ(x,T,0,0,M,S,I,P,BHe),I=BZ(x,T,1,1,I,M,P,S,kHe),P=BZ(x,T,1,1,P,I,S,M,zHe);let D=M.height,L=I.height,R=S.height,O=P.height,F=Math.min(D,L,R,O),k=Math.max(D,L,R,O),U=(F+k)*.5,G,j,q=o.getLevelMaximumGeometricError(m.level),J=T.maximumRadius-q,X=Math.acos(J/T.maximumRadius)*4;if(X*=1.5,C.width>X&&k-F<=q){let ee=new wT({width:9,height:9,buffer:_0i,structure:{heightOffset:k},flattenPolygonHeight:[1],flattenPolygon:[]}),z=v0i;z.tilingScheme=m.tilingScheme,z.x=m.x,z.y=m.y,z.level=m.level,z.exaggeration=w,z.exaggerationRelativeHeight=A,x.mesh=ee._createMeshSync(z)}else{let ee=E,z=Di.center(C,p0i);z.height=U;let ie=T.cartographicToCartesian(z,g0i),re=new Hw(ie,void 0,void 0,void 0,void 0,!0,!0,ee,w,A),ne=5,oe;for(oe=x.westMeshes,G=0,j=oe.length;G<j;++G)ne+=oe[G].eastIndicesNorthToSouth.length;for(oe=x.southMeshes,G=0,j=oe.length;G<j;++G)ne+=oe[G].northIndicesWestToEast.length;for(oe=x.eastMeshes,G=0,j=oe.length;G<j;++G)ne+=oe[G].westIndicesSouthToNorth.length;for(oe=x.northMeshes,G=0,j=oe.length;G<j;++G)ne+=oe[G].southIndicesEastToWest.length;let se=m0i;se.minimumHeight=F,se.maximumHeight=k;let ae=re.stride,fe=new Float32Array(ne*ae),de=0,ve=de;de=kZ(T,C,re,fe,de,0,1,S.height,S.encodedNormal,1,se),de=HZ(x,T,re,fe,de,x.westTiles,x.westMeshes,Ss.EAST,se);let pe=de;de=kZ(T,C,re,fe,de,0,0,M.height,M.encodedNormal,0,se),de=HZ(x,T,re,fe,de,x.southTiles,x.southMeshes,Ss.NORTH,se);let ce=de;de=kZ(T,C,re,fe,de,1,0,I.height,I.encodedNormal,0,se),de=HZ(x,T,re,fe,de,x.eastTiles,x.eastMeshes,Ss.WEST,se);let he=de;de=kZ(T,C,re,fe,de,1,1,P.height,P.encodedNormal,1,se),de=HZ(x,T,re,fe,de,x.northTiles,x.northMeshes,Ss.SOUTH,se),F=se.minimumHeight,k=se.maximumHeight;let Ce=fc.fromRectangle(C,F,k,m.tilingScheme.ellipsoid),Se=hd.geodeticLatitudeToMercatorAngle(C.south),De=1/(hd.geodeticLatitudeToMercatorAngle(C.north)-Se),Oe=(hd.geodeticLatitudeToMercatorAngle(z.latitude)-Se)*De,Ue=T.geodeticSurfaceNormalCartographic(r5,ETe),Xe=Ku.octEncode(Ue,Oge),it=de;re.encode(fe,de*ae,Ce.center,Ye.fromElements(.5,.5,P1),U,Xe,Oe,Ue),++de;let ut=de,at=ut<256?1:2,Pt=(ut-1)*3,Qe=Pt*at,ft=(fe.length-ut*ae)*Float32Array.BYTES_PER_ELEMENT,Ot;if(ft>=Qe){let Jt=ut*ae*Float32Array.BYTES_PER_ELEMENT;Ot=ut<256?new Uint8Array(fe.buffer,Jt,Pt):new Uint16Array(fe.buffer,Jt,Pt)}else Ot=ut<256?new Uint8Array(Pt):new Uint16Array(Pt);fe=new Float32Array(fe.buffer,0,ut*ae);let Xt=0;for(G=0;G<ut-2;++G)Ot[Xt++]=it,Ot[Xt++]=G,Ot[Xt++]=G+1;Ot[Xt++]=it,Ot[Xt++]=G,Ot[Xt++]=0;let At=[];for(G=pe;G>=ve;--G)At.push(G);let bt=[];for(G=ce;G>=pe;--G)bt.push(G);let gt=[];for(G=he;G>=ce;--G)gt.push(G);let It=[];for(It.push(0),G=it-1;G>=he;--G)It.push(G);x.mesh=new jB(re.center,fe,Ot,Pt,ut,F,k,Pi.fromOrientedBoundingBox(Ce),E0i(o,Ce.center,C,F,k),re.stride,Ce,re,At,bt,gt,It)}let Y=f.context;x._destroyVertexArray(v),x.vertexArray=OM._createVertexArrayForMesh(Y,x.mesh),y.processImagery(m,o.terrainProvider,f,!0);let Q=x.waterMaskTexture;if(x.waterMaskTexture=void 0,o.terrainProvider.hasWaterMask){let ee=y._findAncestorTileWithTerrainData(m);N(ee)&&N(ee.data.waterMaskTexture)&&(x.waterMaskTexture=ee.data.waterMaskTexture,++x.waterMaskTexture.referenceCount,y._computeWaterMaskTranslationAndScale(m,ee,x.waterMaskTranslationAndScale))}N(Q)&&(--Q.referenceCount,Q.referenceCount===0&&Q.destroy())}function kZ(o,f,m,v,y,x,C,w,A,E,T){let S=r5;S.longitude=xe.lerp(f.west,f.east,x),S.latitude=xe.lerp(f.south,f.north,C),S.height=w;let M=o.cartographicToCartesian(S,nH),I;m.hasGeodeticSurfaceNormals&&(I=o.geodeticSurfaceNormal(M,ETe));let P=Nge;return P.x=x,P.y=C,m.encode(v,y*m.stride,M,P,w,A,E,I),T.minimumHeight=Math.min(T.minimumHeight,w),T.maximumHeight=Math.max(T.maximumHeight,w),y+1}var Wte=new Di;function wj(o,f,m,v){let y=o.rectangle,x=f.rectangle;f.x===0&&m.x===1&&o.x===o.tilingScheme.getNumberOfXTilesAtLevel(o.level)-1?(y=Di.clone(o.rectangle,Wte),y.west-=xe.TWO_PI,y.east-=xe.TWO_PI):o.x===0&&m.x===0&&f.x===f.tilingScheme.getNumberOfXTilesAtLevel(f.level)-1&&(y=Di.clone(o.rectangle,Wte),y.west+=xe.TWO_PI,y.east+=xe.TWO_PI);let C=y.east-y.west,w=(x.west-y.west)/C,A=(x.east-y.west)/C,E=y.north-y.south,T=(x.south-y.south)/E,S=(x.north-y.south)/E,M=(m.x-w)/(A-w),I=(m.y-T)/(S-T);return Math.abs(M)<Math.EPSILON5?M=0:Math.abs(M-1)<Math.EPSILON5&&(M=1),Math.abs(I)<Math.EPSILON5?I=0:Math.abs(I-1)<Math.EPSILON5&&(I=1),v.x=M,v.y=I,v}var y0i=new Ye;function Fge(o,f,m,v,y){let x=o.encoding,C=o.vertices;if(y.height=x.decodeHeight(C,f),x.hasVertexNormals)x.getOctEncodedNormal(C,f,y.encodedNormal);else{let w=y.encodedNormal;w.x=0,w.y=0}}var x0i=new Ye,C0i=new H;function b0i(o,f,m,v,y,x,C,w,A,E){let T=v.encoding,S=v.vertices,M=wj(f,m,T.decodeTextureCoordinates(S,y,P1),P1),I=wj(f,m,T.decodeTextureCoordinates(S,x,Nge),Nge),P;A?P=(C-M.x)/(I.x-M.x):P=(w-M.y)/(I.y-M.y);let D=T.decodeHeight(S,y),L=T.decodeHeight(S,x),R=m.rectangle;r5.longitude=xe.lerp(R.west,R.east,C),r5.latitude=xe.lerp(R.south,R.north,w),E.height=r5.height=xe.lerp(D,L,P);let O;if(T.hasVertexNormals){let F=T.getOctEncodedNormal(S,y,y0i),k=T.getOctEncodedNormal(S,x,x0i),U=Ku.octDecode(F.x,F.y,nH),G=Ku.octDecode(k.x,k.y,C0i);O=H.lerp(U,G,P,nH),H.normalize(O,O),Ku.octEncode(O,E.encodedNormal)}else O=o.geodeticSurfaceNormalCartographic(r5,nH),Ku.octEncode(O,E.encodedNormal)}function Ctt(o,f,m,v,y,x){x.height=y;let C=f.geodeticSurfaceNormalCartographic(r5,nH);Ku.octEncode(C,x.encodedNormal)}function VZ(o,f,m,v,y,x,C,w,A,E,T){if(UHe(o,f,w,C,!1,m,v,T)||UHe(o,f,E,A,!0,m,v,T))return T;let S;if(TTe(y,x))return m===0?v===0?S=x.eastIndicesNorthToSouth[0]:S=x.southIndicesEastToWest[0]:v===0?S=x.northIndicesWestToEast[0]:S=x.westIndicesSouthToNorth[0],Fge(x,S,m,v,T),T;let M;if(m===0?v===0?M=zZ(o.westMeshes,o.westTiles,Ss.EAST,o.southMeshes,o.southTiles,Ss.NORTH,m,v):M=zZ(o.northMeshes,o.northTiles,Ss.SOUTH,o.westMeshes,o.westTiles,Ss.EAST,m,v):v===0?M=zZ(o.southMeshes,o.southTiles,Ss.NORTH,o.eastMeshes,o.eastTiles,Ss.WEST,m,v):M=zZ(o.eastMeshes,o.eastTiles,Ss.WEST,o.northMeshes,o.northTiles,Ss.SOUTH,m,v),N(M))return Ctt(o,f,m,v,M,T),T}function zZ(o,f,m,v,y,x,C,w){let A=HHe(o,f,!1,m,C,w),E=HHe(v,y,!0,x,C,w);return N(A)&&N(E)?(A+E)*.5:N(A)?A:E}function HZ(o,f,m,v,y,x,C,w,A){for(let E=0;E<x.length;++E)y=w0i(o,f,m,v,y,x[E],C[E],w,A);return y}function w0i(o,f,m,v,y,x,C,w,A){let E=x.rectangle;w===Ss.EAST&&o.tile.x===0?(E=Di.clone(x.rectangle,Wte),E.west-=xe.TWO_PI,E.east-=xe.TWO_PI):w===Ss.WEST&&x.x===0&&(E=Di.clone(x.rectangle,Wte),E.west+=xe.TWO_PI,E.east+=xe.TWO_PI);let T=o.tile.rectangle,S,M;y>0&&(m.decodeTextureCoordinates(v,y-1,P1),S=P1.x,M=P1.y);let I,P;switch(w){case Ss.WEST:I=C.westIndicesSouthToNorth,P=!1;break;case Ss.NORTH:I=C.northIndicesWestToEast,P=!0;break;case Ss.EAST:I=C.eastIndicesNorthToSouth,P=!1;break;case Ss.SOUTH:I=C.southIndicesEastToWest,P=!0;break}let D=x,L=o.tile,R=C.encoding,O=C.vertices,F=m.stride,k,U;R.hasWebMercatorT&&(k=hd.geodeticLatitudeToMercatorAngle(T.south),U=1/(hd.geodeticLatitudeToMercatorAngle(T.north)-k));for(let G=0;G<I.length;++G){let j=I[G],q=R.decodeTextureCoordinates(O,j,P1);wj(D,L,q,q);let J=q.x,X=q.y,Y=P?J:X;if(Y<0||Y>1||Math.abs(J-S)<xe.EPSILON5&&Math.abs(X-M)<xe.EPSILON5)continue;let Q=Math.abs(J)<xe.EPSILON5||Math.abs(J-1)<xe.EPSILON5,ee=Math.abs(X)<xe.EPSILON5||Math.abs(X-1)<xe.EPSILON5;if(Q&&ee)continue;let z=R.decodePosition(O,j,nH),ie=R.decodeHeight(O,j),re;R.hasVertexNormals?re=R.getOctEncodedNormal(O,j,Oge):(re=Oge,re.x=0,re.y=0);let ne=X;if(R.hasWebMercatorT){let se=xe.lerp(T.south,T.north,X);ne=(hd.geodeticLatitudeToMercatorAngle(se)-k)*U}let oe;m.hasGeodeticSurfaceNormals&&(oe=f.geodeticSurfaceNormal(z,ETe)),m.encode(v,y*F,z,q,ie,re,ne,oe),A.minimumHeight=Math.min(A.minimumHeight,ie),A.maximumHeight=Math.max(A.maximumHeight,ie),++y}return y}function HHe(o,f,m,v,y,x){let C,w,A;m?(C=0,w=o.length,A=1):(C=o.length-1,w=-1,A=-1);for(let E=C;E!==w;E+=A){let T=o[E],S=f[E];if(!TTe(S,T))continue;let M;switch(v){case Ss.WEST:M=T.westIndicesSouthToNorth;break;case Ss.SOUTH:M=T.southIndicesEastToWest;break;case Ss.EAST:M=T.eastIndicesNorthToSouth;break;case Ss.NORTH:M=T.northIndicesWestToEast;break}let I=M[m?0:M.length-1];if(N(I))return T.encoding.decodeHeight(T.vertices,I)}}function TTe(o,f){return N(f)&&(!N(o.data.fill)||!o.data.fill.changedThisFrame)}function UHe(o,f,m,v,y,x,C,w){let A,E,T,S,M,I=v[y?0:m.length-1],P=m[y?0:m.length-1];if(TTe(I,P)&&(x===0?C===0?(A=y?P.northIndicesWestToEast:P.eastIndicesNorthToSouth,E=y,T=y):(A=y?P.eastIndicesNorthToSouth:P.southIndicesEastToWest,E=!y,T=!1):C===0?(A=y?P.westIndicesSouthToNorth:P.northIndicesWestToEast,E=!y,T=!0):(A=y?P.southIndicesEastToWest:P.westIndicesSouthToNorth,E=y,T=!y),A.length>0)){S=y?0:A.length-1,M=A[S],P.encoding.decodeTextureCoordinates(P.vertices,M,P1);let D=wj(I,o.tile,P1,P1);if(D.x===x&&D.y===C)return Fge(P,M,x,C,w),!0;if(S=Wg(A,E?x:C,function(L,R){P.encoding.decodeTextureCoordinates(P.vertices,L,P1);let O=wj(I,o.tile,P1,P1);return T?E?O.x-x:O.y-C:E?x-O.x:C-O.y}),S<0){if(S=~S,S>0&&S<A.length)return b0i(f,I,o.tile,P,A[S-1],A[S],x,C,E,w),!0}else return Fge(P,A[S],x,C,w),!0}return!1}var A0i=[new H,new H,new H,new H];function E0i(o,f,m,v,y,x){let C=o.quadtree._occluders.ellipsoid,w=C.ellipsoid,A=A0i;return H.fromRadians(m.west,m.south,y,w,A[0]),H.fromRadians(m.east,m.south,y,w,A[1]),H.fromRadians(m.west,m.north,y,w,A[2]),H.fromRadians(m.east,m.north,y,w,A[3]),C.computeHorizonCullingPointPossiblyUnderEllipsoid(f,A,v,x)}var Soe=w6;function sf(o){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Cl.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=o.terrainProvider,this._imageryLayers=o.imageryLayers,this._surfaceShaderSet=o.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new Br,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(sf.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(sf.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(sf.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(sf.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Br,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new Re(0,0,.5,1),this._clippingPlanes=void 0,this._multiClippingPlanes=void 0,this.cartographicLimitRectangle=Di.clone(Di.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldTerrainExaggeration=void 0,this._oldTerrainExaggerationRelativeHeight=void 0,this._flattenPolygonRegion={enableFlatten:!1,enableRegionWeather:!1},this.clipPlanes=[],this._clipPlanes=[],this.graticulesLevel=1,this.graticulesEnable=!1,this.graticulesColor=null,this.arrowTexture=null,this.slopeArrowTextureEnable=!1,this.slopeRegionTextureEnable=!1,this.regionPositions=[]}Object.defineProperties(sf.prototype,{baseColor:{get:function(){return this._baseColor},set:function(o){this._baseColor=o,this._firstPassInitialColor=Wt.fromColor(o,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(o){this._quadtree=o}},ready:{get:function(){let o=this._terrainProvider;if(!N(o)||(N(o._ready)?!o._ready:N(o.ready)&&!o.ready))return!1;if(this._imageryLayers.length===0)return!0;let f=this._imageryLayers.get(0);if(!f.ready)return!1;let m=f.imageryProvider;return N(m._ready)?m._ready:!N(m.ready)||m.ready}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(o){this._terrainProvider!==o&&(this._terrainProvider=o,N(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(o){Uv.setOwner(o,this,"_clippingPlanes")}},multiClippingPlanes:{get:function(){return this._multiClippingPlanes},set:function(o){N(o)?this._multiClippingPlanes=o:this._multiClippingPlanes=void 0}}});function T0i(o,f){let m=o.loadingImagery;N(m)||(m=o.readyImagery);let v=f.loadingImagery;return N(v)||(v=f.readyImagery),m.imageryLayer._layerIndex-v.imageryLayer._layerIndex}sf.prototype.update=function(o){this._imageryLayers._update()};function S0i(o,f){let m=f.creditDisplay,v=o._terrainProvider;N(v)&&(N(v._ready)?v._ready:!N(v.ready)||v.ready)&&N(v.credit)&&m.addCreditToNextFrame(v.credit);let y=o._imageryLayers;for(let x=0,C=y.length;x<C;++x){let w=y.get(x);if(w.ready){let A=w.imageryProvider;(N(A._ready)?A._ready:!N(A.ready)||A.ready)&&N(w.imageryProvider.credit)&&m.addCreditToNextFrame(w.imageryProvider.credit)}}}sf.prototype.initialize=function(o){this._imageryLayers.queueReprojectionCommands(o),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(v){v.data.imagery.sort(T0i)})),S0i(this,o);let f=this._vertexArraysToDestroy,m=f.length;for(let v=0;v<m;++v)OM._freeVertexArray(f[v]);f.length=0};sf.prototype.beginUpdate=function(o){let f=this._tilesToRenderByTextureCount;for(let y=0,x=f.length;y<x;++y){let C=f[y];N(C)&&(C.length=0)}let m=this._clippingPlanes;N(m)&&m.enabled&&m.update(o);let v=this._multiClippingPlanes;N(v)&&v.update(o),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};sf.prototype.endUpdate=function(o){if(!N(this._renderState)){this._renderState=Mn.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:mC.LESS}}),this._blendRenderState=Mn.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:mC.LESS_OR_EQUAL},blending:Mu.ALPHA_BLEND});let C=uo(this._renderState,!0);C.cull.enabled=!1,this._disableCullingRenderState=Mn.fromCache(C),C=uo(this._blendRenderState,!0),C.cull.enabled=!1,this._disableCullingBlendRenderState=Mn.fromCache(C)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&Soe.updateFillTiles(this,this._quadtree._tilesToRender,o,this._vertexArraysToDestroy);let f=this.quadtree,m=o.terrainExaggeration,v=o.terrainExaggerationRelativeHeight,y=this._oldTerrainExaggeration!==m||this._oldTerrainExaggerationRelativeHeight!==v;this._oldTerrainExaggeration=m,this._oldTerrainExaggerationRelativeHeight=v,y&&f.forEachLoadedTile(function(C){C.data.updateExaggeration(C,o,f)});let x=this._tilesToRenderByTextureCount;for(let C=0,w=x.length;C<w;++C){let A=x[C];if(N(A))for(let E=0,T=A.length;E<T;++E){let S=A[E],M=S.data.tileBoundingRegion;$0i(this,S,o),o.minimumTerrainHeight=Math.min(o.minimumTerrainHeight,M.minimumHeight)}}};function btt(o,f){let m=f.globeTranslucencyState;if(m.translucent){let v=o.renderState.blending.enabled;m.pushDerivedCommands(o,v,f)}else f.commandList.push(o)}sf.prototype.updateForPick=function(o){let f=this._drawCommands;for(let m=0,v=this._usedDrawCommands;m<v;++m)btt(f[m],o)};sf.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};sf.prototype.getLevelMaximumGeometricError=function(o){return N(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(o):0};sf.prototype.loadTile=function(o,f){let m=f.data,v=!0,y;N(m)&&(v=m.boundingVolumeSourceTile!==f||f._lastSelectionResult===ba.CULLED_BUT_NEEDED,y=m.terrainState),OM.processStateMachine(f,o,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,v),m=f.data,v&&y!==f.data.terrainState&&this.computeTileVisibility(f,o,this.quadtree.occluders)!==Bl.NONE&&m.boundingVolumeSourceTile===f&&(v=!1,OM.processStateMachine(f,o,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,v))};var P0i=new Pi,wtt=new Di,I0i=new Di,M0i=new Mt;function ree(o,f){if(f.west<f.east)return f;let m=Di.clone(f,I0i);return Di.center(o,M0i).longitude>0?m.east=xe.PI:m.west=-xe.PI,m}function Att(o,f){if(f.cameraUnderground||f.globeTranslucencyState.translucent)return!0;if(o.backFaceCulling)return!1;let m=o._clippingPlanes;return!!(N(m)&&m.enabled||N(o._multiClippingPlanes)||!Di.equals(o.cartographicLimitRectangle,Di.MAX_VALUE))}sf.prototype.computeTileVisibility=function(o,f,m){let v=this.computeDistanceToTile(o,f);o._distance=v;let y=Att(this,f);if(f.fog.enabled&&!y&&xe.fog(v,f.fog.density)>=1)return Bl.NONE;let x=o.data,C=x.tileBoundingRegion;if(x.boundingVolumeSourceTile===void 0)return Bl.PARTIAL;let w=f.cullingVolume,A=C.boundingVolume;N(A)||(A=C.boundingSphere),x.clippedByBoundaries=!1;let E=ree(o.rectangle,this.cartographicLimitRectangle),T=Di.simpleIntersection(E,o.rectangle,wtt);if(!N(T))return Bl.NONE;if(Di.equals(T,o.rectangle)||(x.clippedByBoundaries=!0),f.mode!==_i.SCENE3D&&(A=P0i,Pi.fromRectangleWithHeights2D(o.rectangle,f.mapProjection,C.minimumHeight,C.maximumHeight,A),H.fromElements(A.center.z,A.center.x,A.center.y,A.center),f.mode===_i.MORPHING&&N(x.renderedMesh)&&(A=Pi.union(C.boundingSphere,A,A))),!N(A))return Bl.PARTIAL;let S=this._clippingPlanes;if(N(S)&&S.enabled){let L=S.computeIntersectionWithBoundingVolume(A);if(o.isClipped=L!==La.INSIDE,L===La.OUTSIDE)return Bl.NONE}let M=this._multiClippingPlanes;if(N(M)&&M.enabled)for(let L=0;M.length;L++){let R=M[L].computeIntersectionWithBoundingVolume(A);if(o.isClipped=R!==La.INSIDE,R===La.OUTSIDE)return Bl.NONE}let I,P=w.computeVisibility(A);if(P===La.OUTSIDE?I=Bl.NONE:P===La.INTERSECTING?I=Bl.PARTIAL:P===La.INSIDE&&(I=Bl.FULL),I===Bl.NONE)return I;let D=f.mode===_i.SCENE3D&&f.camera.frustum instanceof Gs;if(f.mode===_i.SCENE3D&&!D&&N(m)&&!y){let L=x.occludeePointInScaledSpace;return!N(L)||m.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(L,C.minimumHeight)?I:Bl.NONE}return I};sf.prototype.canRefine=function(o){return N(o.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(o.x*2,o.y*2,o.level+1)!==void 0};var D0i=[],L0i=[];sf.prototype.canRenderWithoutLosingDetail=function(o,f){let m=o.data,v=D0i;v.length=this._imageryLayers.length;let y=!1,x=!1,C;N(m)&&(y=m.terrainState===Ls.READY,x=!0,C=m.imagery);let w,A;for(w=0,A=v.length;w<A;++w)v[w]=x;if(N(C))for(w=0,A=C.length;w<A;++w){let S=C[w],M=S.loadingImagery,I=!N(M)||M.state===kl.FAILED||M.state===kl.INVALID,P=(S.loadingImagery||S.readyImagery).imageryLayer._layerIndex;v[P]=I&&v[P]}let E=this.quadtree._lastSelectionFrameNumber,T=L0i;for(T.length=0,T.push(o.southwestChild,o.southeastChild,o.northwestChild,o.northeastChild);T.length>0;){let S=T.pop(),M=S._lastSelectionResultFrame===E?S._lastSelectionResult:ba.NONE;if(M===ba.RENDERED){let I=S.data;if(!N(I))continue;if(!y&&S.data.terrainState===Ls.READY)return!1;let P=S.data.imagery;for(w=0,A=P.length;w<A;++w){let D=P[w],L=D.loadingImagery,R=!N(L)||L.state===kl.FAILED||L.state===kl.INVALID,O=(D.loadingImagery||D.readyImagery).imageryLayer._layerIndex;if(R&&!v[O])return!1}}else M===ba.REFINED&&T.push(S.southwestChild,S.southeastChild,S.northwestChild,S.northeastChild)}return!0};var R0i=new H;sf.prototype.computeTileLoadPriority=function(o,f){let m=o.data;if(m===void 0)return 0;let v=m.tileBoundingRegion.boundingVolume;if(v===void 0)return 0;let y=f.camera.positionWC,x=f.camera.directionWC,C=H.subtract(v.center,y,R0i),w=H.magnitude(C);return w<xe.EPSILON5?0:(H.divideByScalar(C,w,C),(1-H.dot(C,x))*o._distance)};var GHe=new Ee,UZ=new Ee,O0i=new Wt,N0i=new Wt,F0i=new Wt,B0i=new H,WHe=new H,k0i=new H,V0i=new H;sf.prototype.showTileThisFrame=function(o,f){let m=0,v=o.data.imagery;for(let w=0,A=v.length;w<A;++w){let E=v[w];N(E.readyImagery)&&E.readyImagery.imageryLayer.alpha!==0&&++m}let y=this._tilesToRenderByTextureCount[m];N(y)||(y=[],this._tilesToRenderByTextureCount[m]=y),y.push(o);let x=o.data;N(x.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let C=this._debug;++C.tilesRendered,C.texturesRendered+=m};var z0i=[new H,new H,new H,new H];function jHe(o,f,m,v,y,x){let C=o.quadtree._occluders.ellipsoid,w=C.ellipsoid,A=z0i;return H.fromRadians(m.west,m.south,y,w,A[0]),H.fromRadians(m.east,m.south,y,w,A[1]),H.fromRadians(m.west,m.north,y,w,A[2]),H.fromRadians(m.east,m.north,y,w,A[3]),C.computeHorizonCullingPointPossiblyUnderEllipsoid(f,A,v,x)}sf.prototype.computeDistanceToTile=function(o,f){W0i(o,this,f);let m=o.data;if(m.boundingVolumeSourceTile===void 0)return 9999999999;let v=m.tileBoundingRegion,y=v.minimumHeight,x=v.maximumHeight;if(m.boundingVolumeSourceTile!==o){let w=f.camera.positionCartographic.height,A=Math.abs(w-y),E=Math.abs(w-x);A>E?(v.minimumHeight=y,v.maximumHeight=y):(v.minimumHeight=x,v.maximumHeight=x)}let C=v.distanceToCamera(f);return v.minimumHeight=y,v.maximumHeight=x,C};function H0i(o,f){let m=0,v,y,x,C,w=f.length;for(x=f[0],v=1;v<=w;v++)C=f[v%w],o[0]>Math.min(x[0],C[0])&&o[0]<=Math.max(x[0],C[0])&&o[1]<=Math.max(x[1],C[1])&&x[0]!==C[0]&&(y=(o[0]-x[0])*(C[1]-x[1])/(C[0]-x[0])+x[1],(x[1]===C[1]||o[1]<=y)&&m++),x=C;return m%2!==0}function U0i(o,f,m,v){let y=(o.x-m.x)*(f.y-m.y)-(o.y-m.y)*(f.x-m.x),x=(o.x-v.x)*(f.y-v.y)-(o.y-v.y)*(f.x-v.x);if(y*x>=0)return!1;let C=(m.x-o.x)*(v.y-o.y)-(m.y-o.y)*(v.x-o.x),w=C+y-x;if(C*w>=0)return!1;let A=C/(x-y),E=A*(f.x-o.x),T=A*(f.y-o.y);return{x:o.x+E,y:o.y+T}}var GZ=new Mt,$9=[],WZ=[];function G0i(o,f,m){if(!N(o._flattenPolygonRegion.flattenPolygons))return!1;let v=o._flattenPolygonRegion.flattenPolygons,y=o._flattenPolygonRegion.flattenPolygonHeights,x=m.rectangle,C=x.west,w=x.south,A=x.east,E=x.north;$9.length=0,WZ.length=0;let T=!1,S=[[C,w],[A,w],[A,E],[C,E]];for(let M=0;M<y.length;M++){T=!1;for(let I=0;I<v[M].length;I++){let P=v[M][I];if(GZ.longitude=P[0],GZ.latitude=P[1],GZ.height=0,Di.contains(x,GZ)){$9.push(y[M]),WZ.push(v[M]),T=!0;break}}if(!T){for(let I=0;I<S.length;I++)if(H0i(S[I],v[M])){$9.push(y[M]),WZ.push(v[M]),T=!0;break}}if(!T)for(let I=0;I<v[M].length-1;I++){for(let P=0;P<S.length-1;P++){let D={x:S[P][0],y:S[P][1]},L={x:S[P+1][0],y:S[P+1][1]},R={x:v[M][I][0],y:v[M][I][1]},O={x:v[M][I+1][0],y:v[M][I+1][1]};if(U0i(D,L,R,O)){$9.push(y[M]),WZ.push(v[M]),T=!0;break}}if(T)break}if(T){let I=$9[0],P=I.maxHeight,D=I.minHeight,L=m.maximumHeight,R=m.minimumHeight;D>R&&P<L,P>=L&&(L=P),D<=R&&(R=D),m.maximumHeight=L,m.minimumHeight=R}}return!0}function W0i(o,f,m){let v=o.data;v===void 0&&(v=o.data=new OM);let y=o.tilingScheme.ellipsoid;v.tileBoundingRegion===void 0&&(v.tileBoundingRegion=new rT({computeBoundingVolumes:!1,rectangle:o.rectangle,ellipsoid:y,minimumHeight:0,maximumHeight:0}));let x=v.tileBoundingRegion,C=x.minimumHeight,w=x.maximumHeight,A=!1,E=o,T=v.mesh,S=v.terrainData;if(T!==void 0&&T.minimumHeight!==void 0&&T.maximumHeight!==void 0)x.minimumHeight=T.minimumHeight,x.maximumHeight=T.maximumHeight,A=!0;else if(S!==void 0&&S._minimumHeight!==void 0&&S._maximumHeight!==void 0)x.minimumHeight=S._minimumHeight,x.maximumHeight=S._maximumHeight;else{x.minimumHeight=Number.NaN,x.maximumHeight=Number.NaN;let M=o.parent;for(;M!==void 0;){let I=M.data;if(I!==void 0){let P=I.mesh,D=I.terrainData;if(P!==void 0&&P.minimumHeight!==void 0&&P.maximumHeight!==void 0){x.minimumHeight=P.minimumHeight,x.maximumHeight=P.maximumHeight;break}else if(D!==void 0&&D._minimumHeight!==void 0&&D._maximumHeight!==void 0){x.minimumHeight=D._minimumHeight,x.maximumHeight=D._maximumHeight;break}}M=M.parent}E=M}if(E!==void 0){let M=m.terrainExaggeration,I=m.terrainExaggerationRelativeHeight;if(M!==1&&(A=!1,x.minimumHeight=V1.getHeight(x.minimumHeight,M,I),x.maximumHeight=V1.getHeight(x.maximumHeight,M,I)),G0i(f,y,x)&&(A=!1),A)v.boundingVolumeIsFromMesh||(x._orientedBoundingBox=fc.clone(T.orientedBoundingBox,x._orientedBoundingBox),x._boundingSphere=Pi.clone(T.boundingSphere3D,x._boundingSphere),v.occludeePointInScaledSpace=H.clone(T.occludeePointInScaledSpace,v.occludeePointInScaledSpace),N(v.occludeePointInScaledSpace)||(v.occludeePointInScaledSpace=jHe(f,x._orientedBoundingBox.center,o.rectangle,x.minimumHeight,x.maximumHeight,v.occludeePointInScaledSpace)));else{let P=x._orientedBoundingBox===void 0||x._boundingSphere===void 0;(x.minimumHeight!==C||x.maximumHeight!==w||P)&&(x.computeBoundingVolumes(y),v.occludeePointInScaledSpace=jHe(f,x._orientedBoundingBox.center,o.rectangle,x.minimumHeight,x.maximumHeight,v.occludeePointInScaledSpace))}v.boundingVolumeSourceTile=E,v.boundingVolumeIsFromMesh=A}else v.boundingVolumeSourceTile=void 0,v.boundingVolumeIsFromMesh=!1}sf.prototype.isDestroyed=function(){return!1};sf.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),N(this._multiClippingPlanes)&&(this._multiClippingPlanes.destroy(),this._multiClippingPlanes=void 0),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),kr(this)};function j0i(o,f,m){return function(v){let y,x,C=-1,w=v.data.imagery,A=w.length,E;for(E=0;E<A;++E)if(y=w[E],x=Z(y.readyImagery,y.loadingImagery),x.imageryLayer===f){C=E;break}if(C!==-1){let T=C+o;if(y=w[T],x=N(y)?Z(y.readyImagery,y.loadingImagery):void 0,!N(x)||x.imageryLayer!==f)return!f._createTileImagerySkeletons(v,m,T);for(E=C;E<T;++E)w[E].freeResources();w.splice(C,o)}return!0}}sf.prototype._onLayerAdded=function(o,f){if(!this.isDestroyed()&&o.show){let m=this._terrainProvider,v=this,y=this._imageryLayersUpdatedEvent,x=function(){o._imageryCache={},v._quadtree.forEachLoadedTile(function(C){if(N(C._loadedCallbacks[o._layerIndex]))return;let w,A=C.data.imagery,E=A.length,T=-1,S=0;for(w=0;w<E;++w){let I=A[w];if(Z(I.readyImagery,I.loadingImagery).imageryLayer===o)T===-1&&(T=w),++S;else if(T!==-1)break}if(T===-1)return;let M=T+S;o._createTileImagerySkeletons(C,m,M)&&(C._loadedCallbacks[o._layerIndex]=j0i(S,o,m),C.state=Ch.LOADING)})};if(o.ready){let C=o.imageryProvider;C._reload=x}this._quadtree.forEachLoadedTile(function(C){o._createTileImagerySkeletons(C,m)&&(C.state=Ch.LOADING,C.level!==0&&(C._lastSelectionResultFrame!==v.quadtree._lastSelectionFrameNumber||C._lastSelectionResult!==ba.RENDERED)&&(C.renderable=!1))}),this._layerOrderChanged=!0,y.raiseEvent()}};sf.prototype._onLayerRemoved=function(o,f){this._quadtree.forEachLoadedTile(function(m){let v=m.data.imagery,y=-1,x=0;for(let C=0,w=v.length;C<w;++C){let A=v[C],E=A.loadingImagery;if(N(E)||(E=A.readyImagery),E.imageryLayer===o)y===-1&&(y=C),A.freeResources(),++x;else if(y!==-1)break}y!==-1&&v.splice(y,x)}),N(o.imageryProvider)&&(o.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};sf.prototype._onLayerMoved=function(o,f,m){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};sf.prototype._onLayerShownOrHidden=function(o,f,m){m?this._onLayerAdded(o,f):this._onLayerRemoved(o,f)};var YHe=new Ee,qHe=new Ee;function XHe(o,f){let m={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_terrainExaggerationAndRelativeHeight:function(){return this.properties.terrainExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let y=o.context.uniformState.view,x=Ee.multiplyByPoint(y,this.properties.rtc,WHe);return Ee.setTranslation(y,x,GHe),GHe},u_modifiedModelViewProjection:function(){let y=o.context.uniformState.view,x=o.context.uniformState.projection,C=Ee.multiplyByPoint(y,this.properties.rtc,WHe);return Ee.setTranslation(y,C,UZ),Ee.multiply(x,UZ,UZ),UZ},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_slopeColorsTexture:function(){return qx.isSlopeDirty&&(qx._slopeTex=qx.createElevationTextureFromPallete(qx.SlopeMapPallete,o),this.properties.slopeColorsTexture2=qx._slopeTex,qx.isSlopeDirty=!1),qx._slopeTex},u_clippingPlanes:function(){let y=f._multiClippingPlanes;if(N(y)&&N(y.dataTexture))return y.dataTexture;let x=f._clippingPlanes;return N(x)&&N(x.texture)?x.texture:o.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let y=f._multiClippingPlanes;if(N(y)){let w=Ee.multiply(o.context.uniformState.view,y.modelMatrix,YHe);return Ee.inverseTranspose(w,qHe)}let x=f._clippingPlanes,C=N(x)?Ee.multiply(o.context.uniformState.view,x.modelMatrix,YHe):Ee.IDENTITY;return Ee.inverseTranspose(C,qHe)},u_clippingPlanesEdgeStyle:function(){let y=f._multiClippingPlanes;if(N(y)){let C=y.edgeColor.clone();return C.alpha=y.edgeWidth,C}let x=this.properties.clippingPlanesEdgeColor;return x.alpha=this.properties.clippingPlanesEdgeWidth,x},u_multiClippingPlanesLength:function(){let y=f._multiClippingPlanes;if(N(y)){let x=y.lengthTexture;if(N(x))return x}return N(y)?y:o.context.defaultTexture},u_minimumBrightness:function(){return o.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_tileLevel:function(){return this.properties.tileLevel},u_graticuleTranslationAndScale:function(){return this.properties.graticuleTranslationAndScale},u_widthHeight:function(){return this.properties.widthHeight},u_graticulesColor:function(){return this.properties.graticulesColor},u_normalTexture:function(){return this.properties.normalTexture},u_normalTextureTranslationAndScale:function(){return this.properties.normalTextureTranslationAndScale},u_arrowTexture:function(){return this.properties.arrowTexture},u_regionRectTexture:function(){return this.properties.regionRectTexture},properties:{initialColor:new Wt(0,0,.5,1),fillHighlightColor:new Re(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new Ye(65e5,9e6),nightFadeDistance:new Ye(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new H(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new H(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new H,center3D:void 0,rtc:new H,modifiedModelView:new Ee,tileRectangle:new Wt,terrainExaggerationAndRelativeHeight:new Ye(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new Ye,southMercatorYAndOneOverHeight:new Ye,waterMask:void 0,waterMaskTranslationAndScale:new Wt,minMaxHeight:new Ye,scaleAndBias:new Ee,clippingPlanesEdgeColor:Re.clone(Re.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new Wt,frontFaceAlphaByDistance:new Wt,backFaceAlphaByDistance:new Wt,localizedTranslucencyRectangle:new Wt,undergroundColor:Re.clone(Re.TRANSPARENT),undergroundColorAlphaByDistance:new Wt,lambertDiffuseMultiplier:0,slopeColorsTexture2:N(qx._slopeTex)?qx._slopeTex:qx.createElevationTextureFromPallete(qx.SlopeMapPallete,o),vertexShadowDarkness:0,tileLevel:1,graticuleTranslationAndScale:new Wt,graticulesColor:Re.clone(Re.SNOW),widthHeight:1,normalTexture:void 0,normalTextureTranslationAndScale:new Wt,arrowTexture:void 0,regionRectTexture:null}};if(f.clipPlanes.length>0&&(m.properties.contourLineTexture=null,m.u_contourLineTexture=function(){return m.properties.contourLineTexture},m.properties.contourLineTranslationAndScale=new Wt,m.u_contourLineTranslationAndScale=function(){return this.properties.contourLineTranslationAndScale}),N(f.cutPolygonUniformMap))return va(m,f.cutPolygonUniformMap);let v=f.materialUniformMap;if(N(v)){let y=v.u_bFlatten;if(N(y)&&y()){let x=v.u_r_eastNorthUpToFixedFrame(),C=v.u_eastNorthUpToFixedFrame(),w=function(){let E=new Ee;return Ee.fromTranslation(m.properties.rtc,E),E},A=function(){let E=new Ee;Ee.fromTranslation(m.properties.rtc,E);let T=new Ee;return Ee.inverse(E,T),T};m=va(m,{u_eastNorthUpToFixedFrameA:function(){let E=A(),T=new Ee;return Ee.multiply(E,C,T),T},u_r_eastNorthUpToFixedFrameA:function(){let E=w(),T=new Ee;return Ee.multiply(x,E,T),T}})}return va(m,v)}return m}function Y0i(o,f,m){let v=m.data,y,x;if(N(v.vertexArray)?(y=v.mesh,x=v.vertexArray):N(v.fill)&&N(v.fill.vertexArray)&&(y=v.fill.mesh,x=v.fill.vertexArray),!(!N(y)||!N(x))){if(N(v.wireframeVertexArray)){if(v.wireframeVertexArray.mesh===y)return;v.wireframeVertexArray.destroy(),v.wireframeVertexArray=void 0}v.wireframeVertexArray=q0i(o,x,y),v.wireframeVertexArray.mesh=y}}function q0i(o,f,m){let v={indices:m.indices,primitiveType:Fn.TRIANGLES};Ju.toWireframe(v);let y=v.indices,x=Ao.createIndexBuffer({context:o,typedArray:y,usage:gn.STATIC_DRAW,indexDatatype:ro.fromSizeInBytes(y.BYTES_PER_ELEMENT)});return new Du({context:o,attributes:f._attributes,indexBuffer:x})}var Ett,Ttt,nee;(function(){let o=new co({geometry:X2.fromDimensions({dimensions:new H(2,2,2)})}),f=new co({geometry:new YM({radius:1})}),m=new Ee,v,y;function x(C){return new Ia({geometryInstances:C,appearance:new ms({translucent:!1,flat:!0}),asynchronous:!1})}Ett=function(C,w){return C===v||(nee(),v=C,m=Ee.fromRotationTranslation(C.halfAxes,C.center,m),o.modelMatrix=m,o.attributes.color=ea.fromColor(w),y=x(o)),y},Ttt=function(C,w){return C===v||(nee(),v=C,m=Ee.fromTranslation(C.center,m),m=Ee.multiplyByUniformScale(m,C.radius,m),f.modelMatrix=m,f.attributes.color=ea.fromColor(w),y=x(f)),y},nee=function(){N(y)&&(y.destroy(),y=void 0,v=void 0)}})();var X0i=new Wt(0,0,0,0),J0i={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},K0i=Re.TRANSPARENT,Q0i=new sa;function Z0i(o,f){let m=new Wt,v=o.graticulesLevel,y=f._rectangle,x=f.tilingScheme,C=Math.pow(2,v)*36,w=Math.pow(2,v)*18,A=xe.TWO_PI/C,E=xe.PI/w,T=y.west+xe.PI,S=(T-Math.floor(T/A)*A)/A,M=(y.east+xe.PI-T)/A,I=y.south+xe.PI_OVER_TWO,P=(I-Math.floor(I/E)*E)/E,D=(y.north+xe.PI_OVER_TWO-I)/E;return m.x=S,m.y=P,m.z=M,m.w=D,m}function $0i(o,f,m){let v=f.data;N(v.vertexArray)||(v.fill===void 0&&(v.fill=new Soe(f)),v.fill.update(o,m));let y=m.creditDisplay,x=v.terrainData;if(N(x)&&N(x.credits)){let bi=x.credits;for(let Yi=0,ii=bi.length;Yi<ii;++Yi)y.addCreditToNextFrame(bi[Yi])}let C=Bo.maximumTextureImageUnits,w=v.waterMaskTexture,A=v.waterMaskTranslationAndScale;!N(w)&&N(v.fill)&&(w=v.fill.waterMaskTexture,A=v.fill.waterMaskTranslationAndScale);let E=m.cameraUnderground,T=m.globeTranslucencyState,S=T.translucent,M=T.frontFaceAlphaByDistance,I=T.backFaceAlphaByDistance,P=T.rectangle,D=Z(o.undergroundColor,K0i),L=Z(o.undergroundColorAlphaByDistance,Q0i),R=Att(o,m)&&m.mode===_i.SCENE3D&&D.alpha>0&&(L.nearValue>0||L.farValue>0),O=o.lambertDiffuseMultiplier,F=o.vertexShadowDarkness,k=o.hasWaterMask&&N(w),U=o.oceanNormalMap,G=k&&N(U),j=o.terrainProvider,q=N(j)&&(N(j._ready)?j._ready:!N(j.ready)||j.ready)&&o.terrainProvider.hasVertexNormals,J=m.fog.enabled&&m.fog.renderable&&!E,X=o.showGroundAtmosphere&&m.mode===_i.SCENE3D,Y=Cl.castShadows(o.shadows)&&!S,Q=Cl.receiveShadows(o.shadows)&&!S,ee=o.hueShift,z=o.saturationShift,ie=o.brightnessShift,re=o.graticulesEnable,ne=o.slopeRegionTextureEnable,oe=o.slopeArrowTextureEnable,se=!(xe.equalsEpsilon(ee,0,xe.EPSILON7)&&xe.equalsEpsilon(z,0,xe.EPSILON7)&&xe.equalsEpsilon(ie,0,xe.EPSILON7)),ae=!1;if(X){let bi=H.magnitude(m.camera.positionWC),Yi=o.nightFadeOutDistance;ae=bi>Yi}k&&--C,G&&--C,N(m.shadowState)&&m.shadowState.shadowsEnabled&&--C,N(o.clippingPlanes)&&o.clippingPlanes.enabled&&--C,C-=T.numberOfTextureUniforms;let fe=v.renderedMesh,de=fe.center,ve=fe.encoding,pe=v.tileBoundingRegion,ce=m.terrainExaggeration,he=m.terrainExaggerationRelativeHeight,Ce=ce!==1,Se=ve.hasGeodeticSurfaceNormals,De=O0i,Oe=0,Ue=0,Xe=0,it=0,ut=!1;if(m.mode!==_i.SCENE3D){let bi=m.mapProjection,Yi=bi.project(Di.southwest(f.rectangle),k0i),ii=bi.project(Di.northeast(f.rectangle),V0i);if(De.x=Yi.x,De.y=Yi.y,De.z=ii.x,De.w=ii.y,m.mode!==_i.MORPHING&&(de=B0i,de.x=0,de.y=(De.z+De.x)*.5,de.z=(De.w+De.y)*.5,De.x-=de.y,De.y-=de.z,De.z-=de.y,De.w-=de.z),m.mode===_i.SCENE2D&&ve.quantization===Wy.BITS12){let ei=1/(Math.pow(2,12)-1)*.5,Li=(De.z-De.x)*ei,Je=(De.w-De.y)*ei;De.x-=Li,De.y-=Je,De.z+=Li,De.w+=Je}(bi instanceof hd||bi instanceof vU)&&(Oe=f.rectangle.south,Ue=f.rectangle.north,Xe=hd.geodeticLatitudeToMercatorAngle(Oe),it=1/(hd.geodeticLatitudeToMercatorAngle(Ue)-Xe),ut=!0)}let at=J0i;at.frameState=m,at.surfaceTile=v,at.showReflectiveOcean=k,at.showOceanWaves=G,at.enableLighting=o.enableLighting,at.dynamicAtmosphereLighting=o.dynamicAtmosphereLighting,at.dynamicAtmosphereLightingFromSun=o.dynamicAtmosphereLightingFromSun,at.showGroundAtmosphere=X,at.atmosphereLightIntensity=o.atmosphereLightIntensity,at.atmosphereRayleighCoefficient=o.atmosphereRayleighCoefficient,at.atmosphereMieCoefficient=o.atmosphereMieCoefficient,at.atmosphereRayleighScaleHeight=o.atmosphereRayleighScaleHeight,at.atmosphereMieScaleHeight=o.atmosphereMieScaleHeight,at.atmosphereMieAnisotropy=o.atmosphereMieAnisotropy,at.perFragmentGroundAtmosphere=ae,at.hasVertexNormals=q,at.useWebMercatorProjection=ut,at.clippedByBoundaries=v.clippedByBoundaries,at.hasGeodeticSurfaceNormals=Se,at.hasExaggeration=Ce;let Pt=v.imagery,Qe=0,ft=Pt.length,Ot=o.showSkirts&&!E&&!S,Xt=o.backFaceCulling&&!E&&!S,At=Xt?o._renderState:o._disableCullingRenderState,bt=Xt?o._blendRenderState:o._disableCullingBlendRenderState,gt=At,It=o._firstPassInitialColor,Jt=m.context;if(N(o._debug.boundingSphereTile)||nee(),o._materialUniformMap!==o.materialUniformMap||o.clipPlanes.length!==o._clipPlanes.length||o._heightFog!==o.heightFog){o._materialUniformMap=o.materialUniformMap;let bi=o._drawCommands.length;for(let Yi=0;Yi<bi;++Yi)o._uniformMaps[Yi]=XHe(m,o);o.clipPlanes.length!==o._clipPlanes.length&&(o._clipPlanes=o.clipPlanes),o._heightFog!==o.heightFog&&(o._heightFog=o.heightFog)}do{let bi=0,Yi,ii;if(o._drawCommands.length<=o._usedDrawCommands?(Yi=new Jn,Yi.owner=f,Yi.cull=!1,Yi.boundingVolume=new Pi,Yi.orientedBoundingBox=void 0,ii=XHe(m,o),o._drawCommands.push(Yi),o._uniformMaps.push(ii)):(Yi=o._drawCommands[o._usedDrawCommands],ii=o._uniformMaps[o._usedDrawCommands]),Yi.owner=f,++o._usedDrawCommands,f===o._debug.boundingSphereTile){let nt=pe.boundingVolume,wt=pe.boundingSphere;N(nt)?Ett(nt,Re.RED).update(m):N(wt)&&Ttt(wt,Re.RED).update(m)}let ei=ii.properties;Wt.clone(It,ei.initialColor),ei.oceanNormalMap=U,ei.lightingFadeDistance.x=o.lightingFadeOutDistance,ei.lightingFadeDistance.y=o.lightingFadeInDistance,ei.nightFadeDistance.x=o.nightFadeOutDistance,ei.nightFadeDistance.y=o.nightFadeInDistance,ei.atmosphereLightIntensity=o.atmosphereLightIntensity,ei.atmosphereRayleighCoefficient=o.atmosphereRayleighCoefficient,ei.atmosphereMieCoefficient=o.atmosphereMieCoefficient,ei.atmosphereRayleighScaleHeight=o.atmosphereRayleighScaleHeight,ei.atmosphereMieScaleHeight=o.atmosphereMieScaleHeight,ei.atmosphereMieAnisotropy=o.atmosphereMieAnisotropy,ei.zoomedOutOceanSpecularIntensity=o.zoomedOutOceanSpecularIntensity;let Li=E?I:M,Je=E?M:I;N(Li)&&(Wt.fromElements(Li.near,Li.nearValue,Li.far,Li.farValue,ei.frontFaceAlphaByDistance),Wt.fromElements(Je.near,Je.nearValue,Je.far,Je.farValue,ei.backFaceAlphaByDistance)),Wt.fromElements(L.near,L.nearValue,L.far,L.farValue,ei.undergroundColorAlphaByDistance),Re.clone(D,ei.undergroundColor),ei.lambertDiffuseMultiplier=O,ei.vertexShadowDarkness=F;let Nt=!N(v.vertexArray)&&N(o.fillHighlightColor)&&o.fillHighlightColor.alpha>0;Nt&&Re.clone(o.fillHighlightColor,ei.fillHighlightColor),ei.terrainExaggerationAndRelativeHeight.x=ce,ei.terrainExaggerationAndRelativeHeight.y=he,ei.center3D=fe.center,H.clone(de,ei.rtc),Wt.clone(De,ei.tileRectangle),ei.southAndNorthLatitude.x=Oe,ei.southAndNorthLatitude.y=Ue,ei.southMercatorYAndOneOverHeight.x=Xe,ei.southMercatorYAndOneOverHeight.y=it;let yi=N0i,ai=ree(f.rectangle,o.cartographicLimitRectangle),wi=F0i,ji=ree(f.rectangle,P);H.fromElements(ee,z,ie,ei.hsbShift);let hi=f.rectangle,Ri=1/hi.width,pt=1/hi.height;yi.x=(ai.west-hi.west)*Ri,yi.y=(ai.south-hi.south)*pt,yi.z=(ai.east-hi.west)*Ri,yi.w=(ai.north-hi.south)*pt,Wt.clone(yi,ei.localizedCartographicLimitRectangle),wi.x=(ji.west-hi.west)*Ri,wi.y=(ji.south-hi.south)*pt,wi.z=(ji.east-hi.west)*Ri,wi.w=(ji.north-hi.south)*pt,Wt.clone(wi,ei.localizedTranslucencyRectangle);let wr=J&&xe.fog(f._distance,m.fog.density)>xe.EPSILON3;se=se&&(wr||X);let zi=!1,Ui=!1,Gt=!1,$t=!1,jt=!1,ct=!1,Pe=!1,Ht=!1,si=!1,_t=!1;for(;bi<C&&Qe<ft;){let nt=Pt[Qe],wt=nt.readyImagery;if(++Qe,!N(wt)||wt.imageryLayer.alpha===0)continue;let yt=nt.useWebMercatorT?wt.textureWebMercator:wt.texture,Tt=wt.imageryLayer;N(nt.textureTranslationAndScale)||(nt.textureTranslationAndScale=Tt._calculateTextureTranslationAndScale(f,nt)),ei.dayTextures[bi]=yt,ei.dayTextureTranslationAndScale[bi]=nt.textureTranslationAndScale,ei.dayTextureTexCoordsRectangle[bi]=nt.textureCoordinateRectangle,ei.dayTextureUseWebMercatorT[bi]=nt.useWebMercatorT,ei.dayTextureAlpha[bi]=Tt.alpha,ct=ct||ei.dayTextureAlpha[bi]!==1,ei.dayTextureNightAlpha[bi]=Tt.nightAlpha,Pe=Pe||ei.dayTextureNightAlpha[bi]!==1,ei.dayTextureDayAlpha[bi]=Tt.dayAlpha,Pe=Pe||ei.dayTextureDayAlpha[bi]!==1,ei.dayTextureBrightness[bi]=Tt.brightness,zi=zi||ei.dayTextureBrightness[bi]!==x_.DEFAULT_BRIGHTNESS,ei.dayTextureContrast[bi]=Tt.contrast,Ui=Ui||ei.dayTextureContrast[bi]!==x_.DEFAULT_CONTRAST,ei.dayTextureHue[bi]=Tt.hue,Gt=Gt||ei.dayTextureHue[bi]!==x_.DEFAULT_HUE,ei.dayTextureSaturation[bi]=Tt.saturation,$t=$t||ei.dayTextureSaturation[bi]!==x_.DEFAULT_SATURATION,ei.dayTextureOneOverGamma[bi]=1/Tt.gamma,jt=jt||ei.dayTextureOneOverGamma[bi]!==1/x_.DEFAULT_GAMMA,ei.dayTextureSplit[bi]=Tt.splitDirection,Ht=Ht||ei.dayTextureSplit[bi]!==0;let Et=ei.dayTextureCutoutRectangles[bi];if(N(Et)||(Et=ei.dayTextureCutoutRectangles[bi]=new Wt),Wt.clone(Wt.ZERO,Et),N(Tt.cutoutRectangle)){let or=ree(hi,Tt.cutoutRectangle),xr=Di.simpleIntersection(or,hi,wtt);si=N(xr)||si,Et.x=(or.west-hi.west)*Ri,Et.y=(or.south-hi.south)*pt,Et.z=(or.east-hi.west)*Ri,Et.w=(or.north-hi.south)*pt}let ti=ei.colorsToAlpha[bi];N(ti)||(ti=ei.colorsToAlpha[bi]=new Wt);let ir=N(Tt.colorToAlpha)&&Tt.colorToAlphaThreshold>0;if(_t=_t||ir,ir){let or=Tt.colorToAlpha;ti.x=or.red,ti.y=or.green,ti.z=or.blue,ti.w=Tt.colorToAlphaThreshold}else ti.w=-1;if(N(wt.credits)){let or=wt.credits;for(let xr=0,Tn=or.length;xr<Tn;++xr)y.addCreditToNextFrame(or[xr])}++bi}if(ei.dayTextures.length=bi,ei.waterMask=w,Wt.clone(A,ei.waterMaskTranslationAndScale),o.clipPlanes.length>0){let nt=v.contourLineTexture?v.contourLineTexture:m.context.defaultTexture;ei.contourLineTexture=nt,Wt.clone(v.contourLineTranslationAndScale,ei.contourLineTranslationAndScale)}if(ei.tileLevel=f.level,re){let nt=Z0i(o,f);ei.graticuleTranslationAndScale=nt;let wt=Ut.getScale(pe.boundingVolume.halfAxes,new H);ei.widthHeight=wt.x/nt.z,ei.graticulesColor=o.graticulesColor}if(o.slopeArrowTextureEnable){let nt=v.getNormalTexture(f,m.mapProjection,Jt);ei.normalTexture=nt||Jt.defaultTexture,ei.normalTextureTranslationAndScale=v.getNormalTextureTranslationAndScale(),ei.arrowTexture=o.arrowTexture||Jt.defaultTexture}o.slopeRegionTextureEnable&&(ei.regionRectTexture=v.getRegionTexture(o.regionPositions,f,Jt)||Jt.defaultTexture),ei.minMaxHeight.x=ve.minimumHeight,ei.minMaxHeight.y=ve.maximumHeight,Ee.clone(ve.matrix,ei.scaleAndBias);let Yt=o._clippingPlanes,Fi=N(Yt)&&Yt.enabled&&f.isClipped;Fi&&(ei.clippingPlanesEdgeColor=Re.clone(Yt.edgeColor,ei.clippingPlanesEdgeColor),ei.clippingPlanesEdgeWidth=Yt.edgeWidth),at.numberOfDayTextures=bi,at.applyBrightness=zi,at.applyContrast=Ui,at.applyHue=Gt,at.applySaturation=$t,at.applyGamma=jt,at.applyAlpha=ct,at.applyDayNightAlpha=Pe,at.applySplit=Ht,at.enableFog=wr,at.enableClippingPlanes=Fi,at.clippingPlanes=Yt,at.hasImageryLayerCutout=si,at.colorCorrect=se,at.highlightFillTile=Nt,at.colorToAlpha=_t,at.showUndergroundColor=R,at.translucent=S,at.enableFlatten=o._flattenPolygonRegion.enableFlatten,at.enableRegionWeather=o._flattenPolygonRegion.enableRegionWeather,at.graticulesEnable=re,at.slopeRegionTextureEnable=ne,at.slopeArrowTextureEnable=oe,at.showSlopeMap=qx.displaySlopeMap,at.smoothSlopeAtHigherAlt=!1,at.multiClippingPlanes=o._multiClippingPlanes;let Dt=v.renderedMesh.indices.length;Ot||(Dt=v.renderedMesh.indexCountWithoutSkirts),Yi.shaderProgram=o._surfaceShaderSet.getShaderProgram(at),Yi.castShadows=Y,Yi.receiveShadows=Q,Yi.renderState=gt,Yi.primitiveType=Fn.TRIANGLES,Yi.vertexArray=v.vertexArray||v.fill.vertexArray,Yi.count=Dt,Yi.uniformMap=ii,Yi.pass=vr.GLOBE,o._debug.wireframe&&(Y0i(Jt,o,f),N(v.wireframeVertexArray)&&(Yi.vertexArray=v.wireframeVertexArray,Yi.primitiveType=Fn.LINES,Yi.count=Dt*2));let Lt=Yi.boundingVolume,Si=Yi.orientedBoundingBox;m.mode!==_i.SCENE3D?(Pi.fromRectangleWithHeights2D(f.rectangle,m.mapProjection,pe.minimumHeight,pe.maximumHeight,Lt),H.fromElements(Lt.center.z,Lt.center.x,Lt.center.y,Lt.center),m.mode===_i.MORPHING&&(Lt=Pi.union(pe.boundingSphere,Lt,Lt))):(Yi.boundingVolume=Pi.clone(pe.boundingSphere,Lt),Yi.orientedBoundingBox=fc.clone(pe.boundingVolume,Si)),Yi.dirty=!0,S&&T.updateDerivedCommands(Yi,m),btt(Yi,m),gt=bt,It=X0i}while(Qe<ft)}var STe=sf;function Stt(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=Di.clone(Di.MAX_VALUE)}Object.defineProperties(Stt.prototype,{enabled:{get:function(){return this._enabled},set:function(o){this._enabled=o}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(o){this._frontFaceAlpha=o}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(o){this._frontFaceAlphaByDistance=sa.clone(o,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(o){this._backFaceAlpha=o}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(o){this._backFaceAlphaByDistance=sa.clone(o,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(o){N(o)||(o=Di.clone(Di.MAX_VALUE)),Di.clone(o,this._rectangle)}}});var Rq=Stt;function mg(){this._layers=[],this.layerAdded=new Br,this.layerRemoved=new Br,this.layerMoved=new Br,this.layerShownOrHidden=new Br}Object.defineProperties(mg.prototype,{length:{get:function(){return this._layers.length}}});mg.prototype.add=function(o,f){N(f)?this._layers.splice(f,0,o):(f=this._layers.length,this._layers.push(o)),this._update(),this.layerAdded.raiseEvent(o,f);let m=o.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(o,o._layerIndex,o.show),m()})};mg.prototype.addImageryProvider=function(o,f){let m=new x_(o);return this.add(m,f),m};mg.prototype.remove=function(o,f){f=Z(f,!0);let m=this._layers.indexOf(o);return m!==-1?(this._layers.splice(m,1),this._update(),this.layerRemoved.raiseEvent(o,m),f&&o.destroy(),!0):!1};mg.prototype.removeAll=function(o){o=Z(o,!0);let f=this._layers;for(let m=0,v=f.length;m<v;m++){let y=f[m];this.layerRemoved.raiseEvent(y,m),o&&y.destroy()}this._layers=[]};mg.prototype.contains=function(o){return this.indexOf(o)!==-1};mg.prototype.indexOf=function(o){return this._layers.indexOf(o)};mg.prototype.get=function(o){return this._layers[o]};function Poe(o,f){return o.indexOf(f)}function Ptt(o,f,m){let v=o._layers;if(f=xe.clamp(f,0,v.length-1),m=xe.clamp(m,0,v.length-1),f===m)return;let y=v[f];v[f]=v[m],v[m]=y,o._update(),o.layerMoved.raiseEvent(y,m,f)}mg.prototype.raise=function(o){let f=Poe(this._layers,o);Ptt(this,f,f+1)};mg.prototype.lower=function(o){let f=Poe(this._layers,o);Ptt(this,f,f-1)};mg.prototype.raiseToTop=function(o){let f=Poe(this._layers,o);f!==this._layers.length-1&&(this._layers.splice(f,1),this._layers.push(o),this._update(),this.layerMoved.raiseEvent(o,this._layers.length-1,f))};mg.prototype.lowerToBottom=function(o){let f=Poe(this._layers,o);f!==0&&(this._layers.splice(f,1),this._layers.splice(0,0,o),this._update(),this.layerMoved.raiseEvent(o,0,f))};var e_i=new Di;function Itt(o,f,m,v){let y=o.globe._surface._tilesToRender,x;for(let w=0;!N(x)&&w<y.length;++w){let A=y[w];Di.contains(A.rectangle,f)&&(x=A)}if(!N(x))return;let C=x.data.imagery;for(let w=C.length-1;w>=0;--w){let A=C[w],E=A.readyImagery;if(!N(E)||!E.imageryLayer.ready)continue;let T=E.imageryLayer.imageryProvider;if(m&&!N(T.pickFeatures)||!Di.contains(E.rectangle,f))continue;let S=e_i,M=1/1024;S.west=xe.lerp(x.rectangle.west,x.rectangle.east,A.textureCoordinateRectangle.x-M),S.east=xe.lerp(x.rectangle.west,x.rectangle.east,A.textureCoordinateRectangle.z+M),S.south=xe.lerp(x.rectangle.south,x.rectangle.north,A.textureCoordinateRectangle.y-M),S.north=xe.lerp(x.rectangle.south,x.rectangle.north,A.textureCoordinateRectangle.w+M),Di.contains(S,f)&&v(E)}}mg.prototype.pickImageryLayers=function(o,f){let m=f.globe.pick(o,f);if(!N(m))return;let v=f.globe.ellipsoid.cartesianToCartographic(m),y=[];if(Itt(f,v,!1,function(x){y.push(x.imageryLayer)}),y.length!==0)return y};mg.prototype.pickImageryLayerFeatures=function(o,f){let m=f.globe.pick(o,f);if(!N(m))return;let v=f.globe.ellipsoid.cartesianToCartographic(m),y=[],x=[];if(Itt(f,v,!0,function(C){if(!C.imageryLayer.ready)return;let w=C.imageryLayer.imageryProvider.pickFeatures(C.x,C.y,C.level,v.longitude,v.latitude);N(w)&&(y.push(w),x.push(C.imageryLayer))}),y.length!==0)return Promise.all(y).then(function(C){let w=[];for(let A=0;A<C.length;++A){let E=C[A],T=x[A];if(N(E)&&E.length>0)for(let S=0;S<E.length;++S){let M=E[S];M.imageryLayer=T,N(M.position)||(M.position=v),w.push(M)}}return w})};mg.prototype.queueReprojectionCommands=function(o){let f=this._layers;for(let m=0,v=f.length;m<v;++m)f[m].queueReprojectionCommands(o)};mg.prototype.cancelReprojections=function(){let o=this._layers;for(let f=0,m=o.length;f<m;++f)o[f].cancelReprojections()};mg.prototype.isDestroyed=function(){return!1};mg.prototype.destroy=function(){return this.removeAll(!0),kr(this)};mg.prototype._update=function(){let o=!0,f=this._layers,m,v,y,x;for(y=0,x=f.length;y<x;++y)v=f[y],v._layerIndex=y,v.show?(v._isBaseLayer=o,o=!1):v._isBaseLayer=!1,v.show!==v._show&&(N(v._show)&&(N(m)||(m=[]),m.push(v)),v._show=v.show);if(N(m))for(y=0,x=m.length;y<x;++y)v=m[y],this.layerShownOrHidden.raiseEvent(v,v._layerIndex,v.show)};var PTe=mg;function nA(o){this._tileProvider=o.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let f=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new Kre,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=Z(o.maximumScreenSpaceError,2),this.tileCacheSize=Z(o.tileCacheSize,100),this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new Xre({ellipsoid:f}),this._tileLoadProgressEvent=new Br,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(nA.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});nA.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function t_i(o){let f=o._tileReplacementQueue;f.head=void 0,f.tail=void 0,f.count=0,Mtt(o);let m=o._levelZeroTiles;if(N(m))for(let v=0;v<m.length;++v){let y=m[v].customData,x=y.length;for(let C=0;C<x;++C){let w=y[C];w.level=0,o._addHeightCallbacks.push(w)}m[v].freeResources()}o._levelZeroTiles=void 0,o._tileProvider.cancelReprojections()}nA.prototype.forEachLoadedTile=function(o){let f=this._tileReplacementQueue.head;for(;N(f);)f.state!==Ch.START&&o(f),f=f.replacementNext};nA.prototype.forEachRenderedTile=function(o){let f=this._tilesToRender;for(let m=0,v=f.length;m<v;++m)o(f[m])};nA.prototype.updateHeight=function(o,f){let m=this,v={positionOnEllipsoidSurface:void 0,positionCartographic:o,level:-1,callback:f};return v.removeFunc=function(){let y=m._addHeightCallbacks,x=y.length;for(let C=0;C<x;++C)if(y[C]===v){y.splice(C,1);break}m._removeHeightCallbacks.push(v),v.callback&&(v.callback=void 0)},m._addHeightCallbacks.push(v),v.removeFunc};nA.prototype.update=function(o){N(this._tileProvider.update)&&this._tileProvider.update(o)};function Mtt(o){let f=o._debug;f.maxDepth=0,f.maxDepthVisited=0,f.tilesVisited=0,f.tilesCulled=0,f.tilesRendered=0,f.tilesWaitingForChildren=0,o._tileLoadQueueHigh.length=0,o._tileLoadQueueMedium.length=0,o._tileLoadQueueLow.length=0}nA.prototype.beginFrame=function(o){o.passes.render&&(this._tilesInvalidated&&(t_i(this),this._tilesInvalidated=!1),this._tileProvider.initialize(o),Mtt(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};nA.prototype.render=function(o){let f=o.passes,m=this._tileProvider;f.render&&(m.beginUpdate(o),o_i(this,o),m_i(this,o),m.endUpdate(o)),f.pick&&this._tilesToRender.length>0&&m.updateForPick(o)};function i_i(o,f){let m=o._tileLoadQueueHigh.length+o._tileLoadQueueMedium.length+o._tileLoadQueueLow.length;if(m!==o._lastTileLoadQueueLength||o._tilesInvalidated){let y=Br.prototype.raiseEvent.bind(o._tileLoadProgressEvent,m);f.afterRender.push(()=>(y(),!0)),o._lastTileLoadQueueLength=m}let v=o._debug;v.enableDebugOutput&&!v.suspendLodUpdate&&(v.maxDepth=o._tilesToRender.reduce(function(y,x){return Math.max(y,x.level)},-1),v.tilesRendered=o._tilesToRender.length,(v.tilesVisited!==v.lastTilesVisited||v.tilesRendered!==v.lastTilesRendered||v.tilesCulled!==v.lastTilesCulled||v.maxDepth!==v.lastMaxDepth||v.tilesWaitingForChildren!==v.lastTilesWaitingForChildren||v.maxDepthVisited!==v.lastMaxDepthVisited)&&(console.log(`Visited ${v.tilesVisited}, Rendered: ${v.tilesRendered}, Culled: ${v.tilesCulled}, Max Depth Rendered: ${v.maxDepth}, Max Depth Visited: ${v.maxDepthVisited}, Waiting for children: ${v.tilesWaitingForChildren}`),v.lastTilesVisited=v.tilesVisited,v.lastTilesRendered=v.tilesRendered,v.lastTilesCulled=v.tilesCulled,v.lastMaxDepth=v.maxDepth,v.lastTilesWaitingForChildren=v.tilesWaitingForChildren,v.lastMaxDepthVisited=v.maxDepthVisited))}nA.prototype.endFrame=function(o){!o.passes.render||o.mode===_i.MORPHING||(h_i(this,o),p_i(this,o),i_i(this,o))};nA.prototype.isDestroyed=function(){return!1};nA.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var M7,JHe=new Mt;function r_i(o,f){let m=Di.center(o.rectangle,JHe),v=m.longitude-M7.longitude,y=m.latitude-M7.latitude;m=Di.center(f.rectangle,JHe);let x=m.longitude-M7.longitude,C=m.latitude-M7.latitude;return v*v+y*y-(x*x+C*C)}var n_i=new H,e7=[];function o_i(o,f){let m=o._debug;if(m.suspendLodUpdate)return;let v=o._tilesToRender;v.length=0;let y,x=o._tileProvider;if(!N(o._levelZeroTiles))if(x.ready){let D=x.tilingScheme;o._levelZeroTiles=kY.createLevelZeroTiles(D);let L=o._levelZeroTiles.length;if(e7.length<L)for(e7=new Array(L),y=0;y<L;++y)e7[y]===void 0&&(e7[y]=new D7)}else return;o._occluders.ellipsoid.cameraPosition=f.camera.positionWC;let C,w=o._levelZeroTiles,A=w.length>1?o._occluders:void 0;M7=f.camera.positionCartographic,w.sort(r_i);let E=o._addHeightCallbacks,T=o._removeHeightCallbacks,S=f.frameNumber,M;if(E.length>0||T.length>0){for(y=0,M=w.length;y<M;++y)C=w[y],C._updateCustomData(S,E,T);E.length=0,T.length=0}let I=f.camera;o._cameraPositionCartographic=I.positionCartographic;let P=Ee.getTranslation(I.transform,n_i);for(o._cameraReferenceFrameOriginCartographic=o.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(P,o._cameraReferenceFrameOriginCartographic),y=0,M=w.length;y<M;++y)C=w[y],o._tileReplacementQueue.markTileRendered(C),C.renderable?d_(o,C,x,f,A,!1,e7[y]):(qI(o,o._tileLoadQueueHigh,C,f),++m.tilesWaitingForChildren);o._lastSelectionFrameNumber=S}function qI(o,f,m,v){m.needsLoading&&(o.tileProvider.computeTileLoadPriority!==void 0&&(m._loadPriority=o.tileProvider.computeTileLoadPriority(m,v)),f.push(m))}function D7(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Dtt(){this.southwest=new D7,this.southeast=new D7,this.northwest=new D7,this.northeast=new D7}Dtt.prototype.combine=function(o){let f=this.southwest,m=this.southeast,v=this.northwest,y=this.northeast;o.allAreRenderable=f.allAreRenderable&&m.allAreRenderable&&v.allAreRenderable&&y.allAreRenderable,o.anyWereRenderedLastFrame=f.anyWereRenderedLastFrame||m.anyWereRenderedLastFrame||v.anyWereRenderedLastFrame||y.anyWereRenderedLastFrame,o.notYetRenderableCount=f.notYetRenderableCount+m.notYetRenderableCount+v.notYetRenderableCount+y.notYetRenderableCount};var Bge=new Array(31);for(let o=0;o<Bge.length;++o)Bge[o]=new Dtt;function a_i(o,f,m,v,y){let x=o._debug;++x.tilesVisited,o._tileReplacementQueue.markTileRendered(m),m._updateCustomData(f.frameNumber),m.level>x.maxDepthVisited&&(x.maxDepthVisited=m.level);let C=u_i(o,f,m)<o.maximumScreenSpaceError,w=m.southwestChild,A=m.southeastChild,E=m.northwestChild,T=m.northeastChild,S=o._lastSelectionFrameNumber,M=m._lastSelectionResultFrame===S?m._lastSelectionResult:ba.NONE,I=o.tileProvider;if(C||v){let P=ba.originalResult(M)===ba.RENDERED,D=ba.originalResult(M)===ba.CULLED||M===ba.NONE,L=m.state===Ch.DONE,R=P||D||L;if(R||N(I.canRenderWithoutLosingDetail)&&(R=I.canRenderWithoutLosingDetail(m)),R){C&&qI(o,o._tileLoadQueueMedium,m,f),jZ(o,m),y.allAreRenderable=m.renderable,y.anyWereRenderedLastFrame=M===ba.RENDERED,y.notYetRenderableCount=m.renderable?0:1,m._lastSelectionResultFrame=f.frameNumber,m._lastSelectionResult=ba.RENDERED,y.anyWereRenderedLastFrame||o._tileToUpdateHeights.push(m);return}v=!0,C&&qI(o,o._tileLoadQueueHigh,m,f)}if(I.canRefine(m)){if(w.upsampledFromParent&&A.upsampledFromParent&&E.upsampledFromParent&&T.upsampledFromParent){jZ(o,m),qI(o,o._tileLoadQueueMedium,m,f),o._tileReplacementQueue.markTileRendered(w),o._tileReplacementQueue.markTileRendered(A),o._tileReplacementQueue.markTileRendered(E),o._tileReplacementQueue.markTileRendered(T),y.allAreRenderable=m.renderable,y.anyWereRenderedLastFrame=M===ba.RENDERED,y.notYetRenderableCount=m.renderable?0:1,m._lastSelectionResultFrame=f.frameNumber,m._lastSelectionResult=ba.RENDERED,y.anyWereRenderedLastFrame||o._tileToUpdateHeights.push(m);return}m._lastSelectionResultFrame=f.frameNumber,m._lastSelectionResult=ba.REFINED;let P=o._tilesToRender.length,D=o._tileLoadQueueLow.length,L=o._tileLoadQueueMedium.length,R=o._tileLoadQueueHigh.length,O=o._tileToUpdateHeights.length;if(s_i(o,w,A,E,T,f,v,y),P!==o._tilesToRender.length){let F=y.allAreRenderable,k=y.anyWereRenderedLastFrame,U=y.notYetRenderableCount,G=!1;if(!F&&!k){let j=o._tilesToRender;for(let J=P;J<j.length;++J){let X=j[J];for(;X!==void 0&&X._lastSelectionResult!==ba.KICKED&&X!==m;)X._lastSelectionResult=ba.kick(X._lastSelectionResult),X=X.parent}o._tilesToRender.length=P,o._tileToUpdateHeights.length=O,jZ(o,m),m._lastSelectionResult=ba.RENDERED;let q=M===ba.RENDERED;!q&&U>o.loadingDescendantLimit&&(o._tileLoadQueueLow.length=D,o._tileLoadQueueMedium.length=L,o._tileLoadQueueHigh.length=R,qI(o,o._tileLoadQueueMedium,m,f),y.notYetRenderableCount=m.renderable?0:1,G=!0),y.allAreRenderable=m.renderable,y.anyWereRenderedLastFrame=q,q||o._tileToUpdateHeights.push(m),++x.tilesWaitingForChildren}o.preloadAncestors&&!G&&qI(o,o._tileLoadQueueLow,m,f)}return}m._lastSelectionResultFrame=f.frameNumber,m._lastSelectionResult=ba.RENDERED,jZ(o,m),qI(o,o._tileLoadQueueHigh,m,f),y.allAreRenderable=m.renderable,y.anyWereRenderedLastFrame=M===ba.RENDERED,y.notYetRenderableCount=m.renderable?0:1}function s_i(o,f,m,v,y,x,C,w){let A=x.camera.positionCartographic,E=o._tileProvider,T=o._occluders,S=Bge[f.level],M=S.southwest,I=S.southeast,P=S.northwest,D=S.northeast;A.longitude<f.rectangle.east?A.latitude<f.rectangle.north?(d_(o,f,E,x,T,C,M),d_(o,m,E,x,T,C,I),d_(o,v,E,x,T,C,P),d_(o,y,E,x,T,C,D)):(d_(o,v,E,x,T,C,P),d_(o,f,E,x,T,C,M),d_(o,y,E,x,T,C,D),d_(o,m,E,x,T,C,I)):A.latitude<f.rectangle.north?(d_(o,m,E,x,T,C,I),d_(o,f,E,x,T,C,M),d_(o,y,E,x,T,C,D),d_(o,v,E,x,T,C,P)):(d_(o,y,E,x,T,C,D),d_(o,v,E,x,T,C,P),d_(o,m,E,x,T,C,I),d_(o,f,E,x,T,C,M)),S.combine(w)}function l_i(o,f){let m=f.rectangle;return N(o._cameraPositionCartographic)&&Di.contains(m,o._cameraPositionCartographic)||N(o._cameraReferenceFrameOriginCartographic)&&Di.contains(m,o._cameraReferenceFrameOriginCartographic)}function d_(o,f,m,v,y,x,C){if(m.computeTileVisibility(f,v,y)!==Bl.NONE)return a_i(o,v,f,x,C);if(++o._debug.tilesCulled,o._tileReplacementQueue.markTileRendered(f),C.allAreRenderable=!0,C.anyWereRenderedLastFrame=!1,C.notYetRenderableCount=0,l_i(o,f)){(!N(f.data)||!N(f.data.vertexArray))&&qI(o,o._tileLoadQueueMedium,f,v);let w=o._lastSelectionFrameNumber,A=f._lastSelectionResultFrame===w?f._lastSelectionResult:ba.NONE;A!==ba.CULLED_BUT_NEEDED&&A!==ba.RENDERED&&o._tileToUpdateHeights.push(f),f._lastSelectionResult=ba.CULLED_BUT_NEEDED}else(o.preloadSiblings||f.level===0)&&qI(o,o._tileLoadQueueLow,f,v),f._lastSelectionResult=ba.CULLED;f._lastSelectionResultFrame=v.frameNumber}function u_i(o,f,m){if(f.mode===_i.SCENE2D||f.camera.frustum instanceof Gs||f.camera.frustum instanceof Pm)return c_i(o,f,m);let v=o._tileProvider.getLevelMaximumGeometricError(m.level),y=m._distance,x=f.context.drawingBufferHeight,C=f.camera.frustum.sseDenominator,w=v*x/(y*C);return f.fog.enabled&&(w-=xe.fog(y,f.fog.density)*f.fog.sse),w/=f.pixelRatio,w}function c_i(o,f,m){let v=f.camera.frustum,y=v.offCenterFrustum;N(y)&&(v=y);let x=f.context,C=x.drawingBufferWidth,w=x.drawingBufferHeight,A=o._tileProvider.getLevelMaximumGeometricError(m.level),E=Math.max(v.top-v.bottom,v.right-v.left)/Math.max(C,w),T=A/E;return f.fog.enabled&&f.mode!==_i.SCENE2D&&(T-=xe.fog(m._distance,f.fog.density)*f.fog.sse),T/=f.pixelRatio,T}function jZ(o,f){o._tilesToRender.push(f)}function h_i(o,f){let m=o._tileLoadQueueHigh,v=o._tileLoadQueueMedium,y=o._tileLoadQueueLow;if(m.length===0&&v.length===0&&y.length===0)return;o._tileReplacementQueue.trimTiles(o.tileCacheSize);let x=$c()+o._loadQueueTimeSlice,C=o._tileProvider,w=Yfe(o,f,C,x,m,!1);w=Yfe(o,f,C,x,v,w),Yfe(o,f,C,x,y,w)}function d_i(o,f){return o._loadPriority-f._loadPriority}function Yfe(o,f,m,v,y,x){m.computeTileLoadPriority!==void 0&&y.sort(d_i);for(let C=0,w=y.length;C<w&&($c()<v||!x);++C){let A=y[C];o._tileReplacementQueue.markTileRendered(A),m.loadTile(f,A),x=!0}return x}var jV=new _s,qfe=new Mt,fR=new H,f_i=[];function p_i(o,f){if(!o.tileProvider.ready)return;let m=f_i;m.length=0;let v=o._tileToUpdateHeights,y=$c(),x=o._updateHeightsTimeSlice,C=y+x,w=f.mode,A=f.mapProjection,E=o.tileProvider.tilingScheme.ellipsoid,T;for(;v.length>0;){let S=v[0];if(!N(S.data)||!N(S.data.mesh)){let D=S._lastSelectionResultFrame===o._lastSelectionFrameNumber?S._lastSelectionResult:ba.NONE;(D===ba.RENDERED||D===ba.CULLED_BUT_NEEDED)&&m.push(S),v.shift(),o._lastTileIndex=0;continue}let M=S.customData,I=M.length,P=!1;for(T=o._lastTileIndex;T<I;++T){let D=M[T],L=S.data.terrainData,R=N(L)&&L.wasCreatedByUpsampling();if(S.level>D.level&&!R){if(N(D.positionOnEllipsoidSurface)||(D.positionOnEllipsoidSurface=H.fromRadians(D.positionCartographic.longitude,D.positionCartographic.latitude,0,E)),w===_i.SCENE3D){let F=E.geodeticSurfaceNormal(D.positionOnEllipsoidSurface,jV.direction),k=E.getSurfaceNormalIntersectionWithZAxis(D.positionOnEllipsoidSurface,11500,jV.origin);if(!N(k)){let U=0;N(S.data.tileBoundingRegion)&&(U=S.data.tileBoundingRegion.minimumHeight);let G=Math.min(U,-11500),j=H.multiplyByScalar(F,Math.abs(G)+1,fR);H.subtract(D.positionOnEllipsoidSurface,j,jV.origin)}}else Mt.clone(D.positionCartographic,qfe),qfe.height=-11500,A.project(qfe,fR),H.fromElements(fR.z,fR.x,fR.y,fR),H.clone(fR,jV.origin),H.clone(H.UNIT_X,jV.direction);let O=S.data.pick(jV,w,A,!1,fR);N(O)&&(N(D.callback)&&D.callback(O),D.level=S.level)}if($c()>=C){P=!0;break}}if(P){o._lastTileIndex=T;break}else o._lastTileIndex=0,v.shift()}for(T=0;T<m.length;T++)v.push(m[T])}function m_i(o,f){let m=o._tileProvider,v=o._tilesToRender;for(let y=0,x=v.length;y<x;++y){let C=v[y];m.showTileThisFrame(C,f)}}var hb=nA;function oA(o,f){this._scene=f,o=Z(o,ki.WGS84);let m=new AT({ellipsoid:o}),v=new PTe;this._ellipsoid=o,this._imageryLayerCollection=v,this._spotMaterial=void 0,this._pointMaterial=void 0,this._surfaceShaderSet=new pTe,this._material=void 0,this._surface=new hb({tileProvider:new STe({terrainProvider:m,imageryLayers:v,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=m,this._terrainProviderChanged=new Br,this._undergroundColor=Re.clone(Re.BLACK),this._undergroundColorAlphaByDistance=new sa(o.maximumRadius/1e3,0,o.maximumRadius/5,1),this._translucency=new Rq,this._clipPlanes=[],CR(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new Jr({url:Ms("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!0,this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new H(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new H(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=1e7,this.lightingFadeInDistance=2e7,this.nightFadeOutDistance=1e7,this.nightFadeInDistance=5e7,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!0,this.shadows=Cl.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3,this._flattenPolygonRegion={},this._flattenUniforms=void 0,this._graticulesEnable=!1,this._graticulesLevel=1,this._graticulesColor=new Re(0,1,0,1),this._arrowTexture=void 0,this._arrowTextureResource=new Jr({url:Ms("Assets/Textures/arrow.png")}),this._slopeArrowTextureEnable=!1,this._regionPositions=null,this._slopeRegionTextureEnable=!1}Object.defineProperties(oA.prototype,{flattenPolygonRegion:{get:function(){return this._flattenPolygonRegion},set:function(o){this._flattenPolygonRegion=o}},flattenUniforms:{get:function(){return this._flattenUniforms},set:function(o){this._flattenUniforms!==o&&(this._flattenUniforms=o,CR(this))}},ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return N(this._surface)?this._surface.tileProvider.ready&&this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(o){this._surface.tileProvider.baseColor=o}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(o){this._surface.tileProvider.clippingPlanes=o}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(o){N(o)||(o=Di.clone(Di.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=o}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(o){this._oceanNormalMapResource.url=o,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(o){o!==this._terrainProvider&&(this._terrainProvider=o,this._terrainProviderChanged.raiseEvent(o),N(this._material)&&CR(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(o){this._material!==o&&(this._material=o,CR(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(o){this._undergroundColor=Re.clone(o,this._undergroundColor)}},spotMaterial:{get:function(){return this._spotMaterial},set:function(o){this._spotMaterial!==o&&(this._spotMaterial=o,CR(this))}},pointMaterial:{get:function(){return this._pointMaterial},set:function(o){this._pointMaterial!==o&&(this._pointMaterial=o,CR(this))}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(o){this._undergroundColorAlphaByDistance=sa.clone(o,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}},clipPlanes:{get:function(){return this._clipPlanes},set:function(o){this._clipPlanes=o,CR(this)}},heightFog:{get:function(){return this._heightFog},set:function(o){this._heightFog!==o&&(this._heightFog=o,CR(this))}},graticulesLevel:{get:function(){return this._graticulesLevel},set:function(o){this._graticulesLevel!==o&&(this._graticulesLevel=o)}},graticulesEnable:{get:function(){return this._graticulesEnable},set:function(o){this._graticulesEnable=o}},graticulesColor:{get:function(){return this._graticulesColor},set:function(o){this._graticulesColor=o}},regionPositions:{set:function(o){this._regionPositions=o}},slopeRegionTextureEnable:{set:function(o){this._slopeRegionTextureEnable=o}},slopeArrowTextureEnable:{set:function(o){this._slopeArrowTextureEnable=o}}});function CR(o){let f=[],m=N(o._material)&&(o._material.shaderSource.match(/slope/)||o._material.shaderSource.match("normalEC")),v=[OH,xte];N(o._material)&&(!m||o._terrainProvider.requestVertexNormals)?(v.push(o._material.shaderSource),f.push("APPLY_MATERIAL"),o._surface._tileProvider.materialUniformMap=o._material._uniforms):N(o._spotMaterial)?(v.push(o._spotMaterial.shaderSource),f.push("APPLY_SPOT"),o._surface._tileProvider.materialUniformMap=o._spotMaterial._uniforms):N(o._pointMaterial)?(v.push(o._pointMaterial.shaderSource),f.push("APPLY_POINT"),o._surface._tileProvider.materialUniformMap=o._pointMaterial._uniforms):o.flattenUniforms?o._surface._tileProvider.materialUniformMap=o.flattenUniforms:o._surface._tileProvider.materialUniformMap=void 0,v.push(XAe),o._clipPlanes.length>0&&f.push("SHOW_CONTOUR_LINE"),o._surfaceShaderSet.baseVertexShaderSource=new Zr({sources:[OH,xte,JAe],defines:f}),o._surfaceShaderSet.baseFragmentShaderSource=new Zr({sources:v,defines:f}),o._material?o._surfaceShaderSet.material=o._material:o._spotMaterial?o._surfaceShaderSet.material=o._spotMaterial:o._surfaceShaderSet.material=void 0}function g_i(o){return function(f,m){let v=Pi.distanceSquaredTo(f.pickBoundingSphere,o),y=Pi.distanceSquaredTo(m.pickBoundingSphere,o);return v-y}}var Ltt=[],__i={start:0,stop:0};oA.prototype.pickWorldCoordinates=function(o,f,m,v){m=Z(m,!0);let y=f.mode,x=f.mapProjection,C=Ltt;C.length=0;let w=this._surface._tilesToRender,A=w.length,E,T;for(T=0;T<A;++T){E=w[T];let M=E.data;if(!N(M))continue;let I=M.pickBoundingSphere;if(y!==_i.SCENE3D)M.pickBoundingSphere=I=Pi.fromRectangleWithHeights2D(E.rectangle,x,M.tileBoundingRegion.minimumHeight,M.tileBoundingRegion.maximumHeight,I),H.fromElements(I.center.z,I.center.x,I.center.y,I.center);else if(N(M.renderedMesh))Pi.clone(M.tileBoundingRegion.boundingSphere,I);else continue;let P=Hh.raySphere(o,I,__i);N(P)&&C.push(M)}C.sort(g_i(o.origin));let S;for(A=C.length,T=0;T<A&&(S=C[T].pick(o,f.mode,f.mapProjection,m,v),!N(S));++T);return S};oA.prototype.drawTileContourLine=function(o,f,m){let v=Ltt;v.length=0;let y=this._surface._tilesToRender,x=y.length;for(let C=0;C<x;++C){let w=y[C],A=w.data;N(A)&&A.drawContourLine(w,o,f.mode,f.mapProjection,m)}};var v_i=new Mt;oA.prototype.pick=function(o,f,m){if(m=this.pickWorldCoordinates(o,f,!0,m),N(m)&&f.mode!==_i.SCENE3D){m=H.fromElements(m.y,m.z,m.x,m);let v=f.mapProjection.unproject(m,v_i);m=f.globe.ellipsoid.cartographicToCartesian(v,m)}return m};var y_i=new H,KHe=new H,x_i=new Mt,C_i=new _s;function Xfe(o,f){return N(o)&&Di.contains(o.rectangle,f)?o:void 0}oA.prototype.getHeight=function(o){let f=this._surface._levelZeroTiles;if(!N(f))return;let m,v,y=f.length;for(v=0;v<y&&(m=f[v],!Di.contains(m.rectangle,o));++v);if(v>=y)return;let x=m;for(;N(m);)m=Xfe(m._southwestChild,o)||Xfe(m._southeastChild,o)||Xfe(m._northwestChild,o)||m._northeastChild,N(m)&&N(m.data)&&N(m.data.renderedMesh)&&(x=m);if(m=x,!N(m)||!N(m.data)||!N(m.data.renderedMesh))return;let C=this._surface._tileProvider.tilingScheme.projection,w=this._surface._tileProvider.tilingScheme.ellipsoid,A=H.fromRadians(o.longitude,o.latitude,0,w,y_i),E=C_i,T=w.geodeticSurfaceNormal(A,E.direction),S=w.getSurfaceNormalIntersectionWithZAxis(A,11500,E.origin);if(!N(S)){let I;N(m.data.tileBoundingRegion)&&(I=m.data.tileBoundingRegion.minimumHeight);let P=Math.min(Z(I,0),-11500),D=H.multiplyByScalar(T,Math.abs(P)+1,KHe);H.subtract(A,D,E.origin)}let M=m.data.pick(E,void 0,C,!1,KHe);if(N(M))return w.cartesianToCartographic(M,x_i).height};oA.prototype.update=function(o){this.show&&o.passes.render&&this._surface.update(o)};oA.prototype.beginFrame=function(o){let f=this._surface,m=f.tileProvider,v=this.terrainProvider,y=N(v)&&(N(v._ready)?v._ready:!N(v.ready)||v.ready),x=this.showWaterEffect&&y&&v.hasWaterMask&&v.hasWaterMask;if(x&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let A=this._oceanNormalMapResource,E=A.url;if(N(E)){let T=this;A.fetchImage().then(function(S){E===T._oceanNormalMapResource.url&&(T._oceanNormalMap=T._oceanNormalMap&&T._oceanNormalMap.destroy(),T._oceanNormalMap=new _o({context:o.context,source:S}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}if(!this._arrowTexture&&this._slopeArrowTextureEnable){this._arrowTexture=!0;let A=this._arrowTextureResource,E=this;A.fetchImage().then(function(T){E._arrowTexture=new _o({context:o.context,source:T})})}else this._arrowTexture&&!this._slopeArrowTextureEnable&&(this._arrowTexture=this._arrowTexture&&this._arrowTexture.destroy());let C=o.passes,w=o.mode;C.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,f.maximumScreenSpaceError=this.maximumScreenSpaceError,f.tileCacheSize=this.tileCacheSize,f.loadingDescendantLimit=this.loadingDescendantLimit,f.preloadAncestors=this.preloadAncestors,f.preloadSiblings=this.preloadSiblings,m.terrainProvider=this.terrainProvider,m.lightingFadeOutDistance=this.lightingFadeOutDistance,m.lightingFadeInDistance=this.lightingFadeInDistance,m.nightFadeOutDistance=this.nightFadeOutDistance,m.nightFadeInDistance=this.nightFadeInDistance,m.zoomedOutOceanSpecularIntensity=w===_i.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,m.hasWaterMask=x,m.oceanNormalMap=this._oceanNormalMap,m.enableLighting=this.enableLighting,m.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,m.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,m.showGroundAtmosphere=this.showGroundAtmosphere,m.atmosphereLightIntensity=this.atmosphereLightIntensity,m.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,m.atmosphereMieCoefficient=this.atmosphereMieCoefficient,m.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,m.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,m.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,m.shadows=this.shadows,m.hueShift=this.atmosphereHueShift,m.saturationShift=this.atmosphereSaturationShift,m.brightnessShift=this.atmosphereBrightnessShift,m.fillHighlightColor=this.fillHighlightColor,m.showSkirts=this.showSkirts,m.backFaceCulling=this.backFaceCulling,m.vertexShadowDarkness=this.vertexShadowDarkness,m.undergroundColor=this._undergroundColor,m.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,m.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,m._flattenPolygonRegion=this._flattenPolygonRegion,m.clipPlanes=this._clipPlanes,m.graticulesLevel=this._graticulesLevel,m.graticulesEnable=this._graticulesEnable,m.graticulesColor=this._graticulesColor,m.arrowTexture=this._arrowTexture,m.slopeArrowTextureEnable=this._slopeArrowTextureEnable,m.regionPositions=this._regionPositions,m.slopeRegionTextureEnable=this._slopeRegionTextureEnable,f.beginFrame(o))};oA.prototype.render=function(o){this.show&&(N(this._material)&&this._material.update(o.context),this.drawTileContourLine(this._clipPlanes,this._scene,o),this._surface.render(o))};oA.prototype.endFrame=function(o){this.show&&o.passes.render&&this._surface.endFrame(o)};oA.prototype.isDestroyed=function(){return!1};oA.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),kr(this)};var ITe=oA;function b_i(o,f,m,v){this.rightAscension=o,this.declination=f,this.rotation=m,this.rotationRate=v}var MTe=b_i,Rtt={},w_i=32.184,A_i=2451545,QHe=-.0529921,ZHe=-.1059842,$He=13.0120009,eUe=13.3407154,tUe=.9856003,iUe=26.4057084,rUe=13.064993,nUe=.3287146,oUe=1.7484877,aUe=-.1589763,sUe=.0036096,lUe=.1643573,uUe=12.9590088,Jfe=new ci;Rtt.ComputeMoon=function(o,f){N(o)||(o=ci.now()),Jfe=ci.addSeconds(o,w_i,Jfe);let m=ci.totalDays(Jfe)-A_i,v=m/lc.DAYS_PER_JULIAN_CENTURY,y=(125.045+QHe*m)*xe.RADIANS_PER_DEGREE,x=(250.089+ZHe*m)*xe.RADIANS_PER_DEGREE,C=(260.008+$He*m)*xe.RADIANS_PER_DEGREE,w=(176.625+eUe*m)*xe.RADIANS_PER_DEGREE,A=(357.529+tUe*m)*xe.RADIANS_PER_DEGREE,E=(311.589+iUe*m)*xe.RADIANS_PER_DEGREE,T=(134.963+rUe*m)*xe.RADIANS_PER_DEGREE,S=(276.617+nUe*m)*xe.RADIANS_PER_DEGREE,M=(34.226+oUe*m)*xe.RADIANS_PER_DEGREE,I=(15.134+aUe*m)*xe.RADIANS_PER_DEGREE,P=(119.743+sUe*m)*xe.RADIANS_PER_DEGREE,D=(239.961+lUe*m)*xe.RADIANS_PER_DEGREE,L=(25.053+uUe*m)*xe.RADIANS_PER_DEGREE,R=Math.sin(y),O=Math.sin(x),F=Math.sin(C),k=Math.sin(w),U=Math.sin(A),G=Math.sin(E),j=Math.sin(T),q=Math.sin(S),J=Math.sin(M),X=Math.sin(I),Y=Math.sin(P),Q=Math.sin(D),ee=Math.sin(L),z=Math.cos(y),ie=Math.cos(x),re=Math.cos(C),ne=Math.cos(w),oe=Math.cos(A),se=Math.cos(E),ae=Math.cos(T),fe=Math.cos(S),de=Math.cos(M),ve=Math.cos(I),pe=Math.cos(P),ce=Math.cos(D),he=Math.cos(L),Ce=(269.9949+.0031*v-3.8787*R-.1204*O+.07*F-.0172*k+.0072*G-.0052*X+.0043*ee)*xe.RADIANS_PER_DEGREE,Se=(66.5392+.013*v+1.5419*z+.0239*ie-.0278*re+.0068*ne-.0029*se+9e-4*ae+8e-4*ve-9e-4*he)*xe.RADIANS_PER_DEGREE,De=(38.3213+13.17635815*m-14e-13*m*m+3.561*R+.1208*O-.0642*F+.0158*k+.0252*U-.0066*G-.0047*j-.0046*q+.0028*J+.0052*X+.004*Y+.0019*Q-.0044*ee)*xe.RADIANS_PER_DEGREE,Oe=(13.17635815-14e-13*(2*m)+3.561*z*QHe+.1208*ie*ZHe-.0642*re*$He+.0158*ne*eUe+.0252*oe*tUe-.0066*se*iUe-.0047*ae*rUe-.0046*fe*nUe+.0028*de*oUe+.0052*ve*aUe+.004*pe*sUe+.0019*ce*lUe-.0044*he*uUe)/86400*xe.RADIANS_PER_DEGREE;return N(f)||(f=new MTe),f.rightAscension=Ce,f.declination=Se,f.rotation=De,f.rotationRate=Oe,f};var DTe=Rtt;function Ott(o){(!N(o)||typeof o!="function")&&(o=DTe.ComputeMoon),this._computeFunction=o}var E_i=new H,T_i=new H,S_i=new H;function P_i(o,f,m){let v=E_i;v.x=Math.cos(o+xe.PI_OVER_TWO),v.y=Math.sin(o+xe.PI_OVER_TWO),v.z=0;let y=Math.cos(f),x=S_i;x.x=y*Math.cos(o),x.y=y*Math.sin(o),x.z=Math.sin(f);let C=H.cross(x,v,T_i);return N(m)||(m=new Ut),m[0]=v.x,m[1]=C.x,m[2]=x.x,m[3]=v.y,m[4]=C.y,m[5]=x.y,m[6]=v.z,m[7]=C.z,m[8]=x.z,m}var I_i=new Ut,M_i=new Gr;Ott.prototype.evaluate=function(o,f){N(o)||(o=ci.now());let m=this._computeFunction(o),v=P_i(m.rightAscension,m.declination,f),y=xe.zeroToTwoPi(m.rotation),x=Gr.fromAxisAngle(H.UNIT_Z,y,M_i),C=Ut.fromQuaternion(Gr.conjugate(x,x),I_i);return Ut.multiply(C,v,v)};var LTe=Ott,kge={position:0};function Ioe(o){o=Z(o,Z.EMPTY_OBJECT),this.center=H.clone(Z(o.center,H.ZERO)),this._center=new H,this.radii=H.clone(o.radii),this._radii=new H,this._oneOverEllipsoidRadiiSquared=new H,this._boundingSphere=new Pi,this.modelMatrix=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),this._modelMatrix=new Ee,this._computedModelMatrix=new Ee,this.show=Z(o.show,!0),this.material=Z(o.material,zo.fromType(zo.ColorType)),this._material=void 0,this._translucent=void 0,this.id=o.id,this._id=void 0,this.debugShowBoundingVolume=Z(o.debugShowBoundingVolume,!1),this.onlySunLighting=Z(o.onlySunLighting,!1),this._onlySunLighting=!1,this._depthTestEnabled=Z(o.depthTestEnabled,!0),this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new Jn({owner:Z(o._owner,this)}),this._pickCommand=new Jn({owner:Z(o._owner,this),pickOnly:!0});let f=this;this._uniforms={u_radii:function(){return f.radii},u_oneOverEllipsoidRadiiSquared:function(){return f._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return f._pickId.color}}}function D_i(o){let f=o.cache.ellipsoidPrimitive_vertexArray;if(N(f))return f;let m=MM.createGeometry(MM.fromDimensions({dimensions:new H(2,2,2),vertexFormat:un.POSITION_ONLY}));return f=Du.fromGeometry({context:o,geometry:m,attributeLocations:kge,bufferUsage:gn.STATIC_DRAW,interleave:!0}),o.cache.ellipsoidPrimitive_vertexArray=f,f}Ioe.prototype.update=function(o){if(!this.show||o.mode!==_i.SCENE3D||!N(this.center)||!N(this.radii))return;let f=o.context,m=this.material.isTranslucent(),v=this._translucent!==m;(!N(this._rs)||v)&&(this._translucent=m,this._rs=Mn.fromCache({cull:{enabled:!0,face:uh.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!m&&f.fragmentDepth,blending:m?Mu.ALPHA_BLEND:void 0})),N(this._va)||(this._va=D_i(f));let y=!1,x=this.radii;if(!H.equals(this._radii,x)){H.clone(x,this._radii);let D=this._oneOverEllipsoidRadiiSquared;D.x=1/(x.x*x.x),D.y=1/(x.y*x.y),D.z=1/(x.z*x.z),y=!0}(!Ee.equals(this.modelMatrix,this._modelMatrix)||!H.equals(this.center,this._center))&&(Ee.clone(this.modelMatrix,this._modelMatrix),H.clone(this.center,this._center),Ee.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),y=!0),y&&(H.clone(H.ZERO,this._boundingSphere.center),this._boundingSphere.radius=H.maximumComponent(x),Pi.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let C=this._material!==this.material;this._material=this.material,this._material.update(f);let w=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let A=o.useLogDepth,E=this._useLogDepth!==A;this._useLogDepth=A;let T=this._colorCommand,S,M;(C||w||v||E)&&(S=new Zr({sources:[yte]}),M=new Zr({sources:[this.material.shaderSource,vte]}),this.onlySunLighting&&M.defines.push("ONLY_SUN_LIGHTING"),!m&&f.fragmentDepth&&M.defines.push("WRITE_DEPTH"),this._useLogDepth&&(S.defines.push("LOG_DEPTH"),M.defines.push("LOG_DEPTH")),this._sp=Rs.replaceCache({context:f,shaderProgram:this._sp,vertexShaderSource:S,fragmentShaderSource:M,attributeLocations:kge}),T.vertexArray=this._va,T.renderState=this._rs,T.shaderProgram=this._sp,T.uniformMap=va(this._uniforms,this.material._uniforms),T.executeInClosestFrustum=m);let I=o.commandList,P=o.passes;if(P.render&&(T.boundingVolume=this._boundingSphere,T.debugShowBoundingVolume=this.debugShowBoundingVolume,T.modelMatrix=this._computedModelMatrix,T.pass=m?vr.TRANSLUCENT:vr.OPAQUE,I.push(T)),P.pick){let D=this._pickCommand;(!N(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=f.createPickId({primitive:this,id:this.id})),(C||w||!N(this._pickSP)||E)&&(S=new Zr({sources:[yte]}),M=new Zr({sources:[this.material.shaderSource,vte],pickColorQualifier:"uniform"}),this.onlySunLighting&&M.defines.push("ONLY_SUN_LIGHTING"),!m&&f.fragmentDepth&&M.defines.push("WRITE_DEPTH"),this._useLogDepth&&(S.defines.push("LOG_DEPTH"),M.defines.push("LOG_DEPTH")),this._pickSP=Rs.replaceCache({context:f,shaderProgram:this._pickSP,vertexShaderSource:S,fragmentShaderSource:M,attributeLocations:kge}),D.vertexArray=this._va,D.renderState=this._rs,D.shaderProgram=this._pickSP,D.uniformMap=va(va(this._uniforms,this._pickUniforms),this.material._uniforms),D.executeInClosestFrustum=m),D.boundingVolume=this._boundingSphere,D.modelMatrix=this._computedModelMatrix,D.pass=m?vr.TRANSLUCENT:vr.OPAQUE,I.push(D)}};Ioe.prototype.isDestroyed=function(){return!1};Ioe.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),kr(this)};var RTe=Ioe;function Oq(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.textureUrl;N(f)||(f=Ms("Assets/Textures/moonSmall.jpg")),this.show=Z(o.show,!0),this.textureUrl=f,this._ellipsoid=Z(o.ellipsoid,ki.MOON),this.onlySunLighting=Z(o.onlySunLighting,!0),this._ellipsoidPrimitive=new RTe({radii:this.ellipsoid.radii,material:zo.fromType(zo.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new LTe}Object.defineProperties(Oq.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var YZ=new Ut,L_i=new Ut,R_i=new H,qZ=[];Oq.prototype.update=function(o){if(!this.show)return;let f=this._ellipsoidPrimitive;f.material.uniforms.image=this.textureUrl,f.onlySunLighting=this.onlySunLighting;let m=o.time;N(tn.computeIcrfToFixedMatrix(m,YZ))||tn.computeTemeToPseudoFixedMatrix(m,YZ);let v=this._axes.evaluate(m,L_i);Ut.transpose(v,v),Ut.multiply(YZ,v,v);let y=cj.computeMoonPositionInEarthInertialFrame(m,R_i);Ut.multiplyByVector(YZ,y,y),Ee.fromRotationTranslation(v,y,f.modelMatrix);let x=o.commandList;return o.commandList=qZ,qZ.length=0,f.update(o),o.commandList=x,qZ.length===1?qZ[0]:void 0};Oq.prototype.isDestroyed=function(){return!1};Oq.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),kr(this)};var OTe=Oq,Vge=[],zge=[];function O_i(o,f,m,v,y,x){let C=y-v+1,w=x-y,A=Vge,E=zge,T,S;for(T=0;T<C;++T)A[T]=o[v+T];for(S=0;S<w;++S)E[S]=o[y+S+1];T=0,S=0;for(let M=v;M<=x;++M){let I=A[T],P=E[S];T<C&&(S>=w||f(I,P,m)<=0)?(o[M]=I,++T):S<w&&(o[M]=P,++S)}}function Hge(o,f,m,v,y){if(v>=y)return;let x=Math.floor((v+y)*.5);Hge(o,f,m,v,x),Hge(o,f,m,x+1,y),O_i(o,f,m,v,x,y)}function N_i(o,f,m){let v=o.length,y=Math.ceil(v*.5);Vge.length=y,zge.length=y,Hge(o,f,m,0,v-1),Vge.length=0,zge.length=0}var A6=N_i;function Nq(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(Nq.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function F_i(o,f,m){let v=f.createViewportQuadCommand(kAe,{framebuffer:m,renderState:Mn.fromCache({viewport:new Xr(0,0,256,256)})});o._drawCommand=v}Nq.prototype.update=function(o){if(!N(this._colorTexture)){let f=o.context,m=new _o({context:f,width:256,height:256,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,sampler:gs.NEAREST});this._colorTexture=m;let v=new dg({context:f,colorTextures:[m],destroyAttachments:!1});F_i(this,f,v),this._drawCommand.execute(f),v.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};Nq.prototype.isDestroyed=function(){return!1};Nq.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),kr(this)};var NTe=Nq;function B_i(o){this.pass=o.pass,this.commandList=o.commandList,this.camera=o.camera,this.cullingVolume=o.cullingVolume,this.ready=!1}var ET=B_i,k_i=dd(jw(),1),cUe=576,V_i=100,t7="#ffffff",Kfe="#48b";function Ntt(o,f){this.credit=o,this.count=Z(f,1)}function Ftt(o,f){let m=o.length;for(let v=0;v<m;v++){let y=o[v];if(Cs.equals(y,f))return!0}return!1}function z_i(o){let f=o._previousCesiumCredit,m=o._currentCesiumCredit;Cs.equals(m,f)||(N(f)&&o._cesiumCreditContainer.removeChild(f.element),N(m)&&o._cesiumCreditContainer.appendChild(m.element),o._previousCesiumCredit=m)}var Btt="cesium-credit-delimiter";function hUe(o){let f=document.createElement("span");return f.textContent=o,f.className=Btt,f}function dUe(o,f){if(N(f)){let m=document.createElement(f);m._creditId=o._creditId,m.appendChild(o),o=m}return o}function fUe(o,f,m,v){let y=o.childNodes,x=-1;f.sort(function(C,w){return w.count-C.count});for(let C=0;C<f.length;++C){let w=f[C].credit;if(N(w)){if(x=C,N(m)&&(x*=2,C>0)){let E=x-1;if(y.length<=E)o.appendChild(hUe(m));else{let T=y[E];T.className!==Btt&&o.replaceChild(hUe(m),T)}}let A=w.element;if(y.length<=x)o.appendChild(dUe(A,v));else{let E=y[x];E._creditId!==w._id&&o.replaceChild(dUe(A,v),E)}}}for(++x;x<y.length;)o.removeChild(y[x])}function H_i(o){let f=o._lightboxCredits,m=o.viewport.clientWidth,v=o.viewport.clientHeight;m!==o._lastViewportWidth&&(m<cUe?(f.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",f.style.marginTop="0"):(f.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",f.style.marginTop=`${Math.floor((v-f.clientHeight)*.5)}px`),o._lastViewportWidth=m),m>=cUe&&v!==o._lastViewportHeight&&(f.style.marginTop=`${Math.floor((v-f.clientHeight)*.5)}px`,o._lastViewportHeight=v)}function pv(o,f){let m=`${o} {`;for(let v in f)f.hasOwnProperty(v)&&(m+=`${v}: ${f[v]}; `);return m+=` } `,m}function U_i(o){let f="";f+=pv(".cesium-credit-lightbox-overlay",{display:"none","z-index":"1",position:"absolute",top:"0",left:"0",width:"100%",height:"100%","background-color":"rgba(80, 80, 80, 0.8)"}),f+=pv(".cesium-credit-lightbox",{"background-color":"#303336",color:t7,position:"relative","min-height":`${V_i}px`,margin:"auto"}),f+=pv(".cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited",{color:t7}),f+=pv(".cesium-credit-lightbox > ul > li a:hover",{color:Kfe}),f+=pv(".cesium-credit-lightbox.cesium-credit-lightbox-expanded",{border:"1px solid #444","border-radius":"5px","max-width":"370px"}),f+=pv(".cesium-credit-lightbox.cesium-credit-lightbox-mobile",{height:"100%",width:"100%"}),f+=pv(".cesium-credit-lightbox-title",{padding:"20px 20px 0 20px"}),f+=pv(".cesium-credit-lightbox-close",{"font-size":"18pt",cursor:"pointer",position:"absolute",top:"0",right:"6px",color:t7}),f+=pv(".cesium-credit-lightbox-close:hover",{color:Kfe}),f+=pv(".cesium-credit-lightbox > ul",{margin:"0",padding:"12px 20px 12px 40px","font-size":"13px"}),f+=pv(".cesium-credit-lightbox > ul > li",{"padding-bottom":"6px"}),f+=pv(".cesium-credit-lightbox > ul > li *",{padding:"0",margin:"0"}),f+=pv(".cesium-credit-expand-link",{"padding-left":"5px",cursor:"pointer","text-decoration":"underline",color:t7}),f+=pv(".cesium-credit-expand-link:hover",{color:Kfe}),f+=pv(".cesium-credit-text",{color:t7}),f+=pv(".cesium-credit-textContainer *, .cesium-credit-logoContainer *",{display:"inline"});function m(x){if(x.shadowRoot)return x.shadowRoot;if(x.getRootNode){let C=x.getRootNode();if(C instanceof ShadowRoot)return C}}let v=Z(m(o),document.head),y=document.createElement("style");y.innerHTML=f,v.appendChild(y)}function cd(o,f,m){let v=this;m=Z(m,document.body);let y=document.createElement("div");y.className="cesium-credit-lightbox-overlay",m.appendChild(y);let x=document.createElement("div");x.className="cesium-credit-lightbox",y.appendChild(x);function C(P){x.contains(P.target)||v.hideLightbox()}y.addEventListener("click",C,!1);let w=document.createElement("div");w.className="cesium-credit-lightbox-title",w.textContent="Data provided by:",x.appendChild(w);let A=document.createElement("a");A.onclick=this.hideLightbox.bind(this),A.innerHTML="×",A.className="cesium-credit-lightbox-close",x.appendChild(A);let E=document.createElement("ul");x.appendChild(E);let T=document.createElement("div");T.className="cesium-credit-logoContainer",T.style.display="inline",o.appendChild(T);let S=document.createElement("div");S.className="cesium-credit-textContainer",S.style.display="inline",o.appendChild(S);let M=document.createElement("a");M.className="cesium-credit-expand-link",M.onclick=this.showLightbox.bind(this),M.textContent="Data attribution",o.appendChild(M),U_i(o);let I=Cs.clone(cd.cesiumCredit);this._delimiter=Z(f," \u2022 "),this._screenContainer=S,this._cesiumCreditContainer=T,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=x,this._creditList=E,this._lightbox=y,this._hideLightbox=C,this._expandLink=M,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=I,this._previousCesiumCredit=void 0,this._currentCesiumCredit=I,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new wa,lightboxCredits:new wa},this._defaultCredit=void 0,this.viewport=m,this.container=o}function ktt(o,f,m,v){v=Z(v,1);let y=f.get(m.id);if(N(y))y.count<Number.MAX_VALUE&&(y.count+=v);else{let x=o._creditDisplayElementPool,C=o._creditDisplayElementPoolIndex;C<x.length?(y=x[C],y.credit=m,y.count=v):(y=new Ntt(m,v),x.push(y)),++o._creditDisplayElementPoolIndex,f.set(m.id,y)}}cd.prototype.addCredit=function(o){mi("CreditDisplay.addCredit","CreditDisplay.addCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addCreditToNextFrame instead."),this.addCreditToNextFrame(o)};cd.prototype.addCreditToNextFrame=function(o){if(o._isIon){N(this._defaultCredit)||(this._defaultCredit=Cs.clone(Vtt())),this._currentCesiumCredit=this._defaultCredit;return}let f;o.showOnScreen?f=this._currentFrameCredits.screenCredits:f=this._currentFrameCredits.lightboxCredits,ktt(this,f,o)};cd.prototype.addDefaultCredit=function(o){mi("CreditDisplay.addDefaultCredit","CreditDisplay.addDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead.");let f=this._staticCredits;Ftt(f,o)||(o.showOnScreen=!0,f.push(o))};cd.prototype.addStaticCredit=function(o){let f=this._staticCredits;Ftt(f,o)||f.push(o)};cd.prototype.removeStaticCredit=function(o){let f=this._staticCredits,m=f.indexOf(o);m!==-1&&f.splice(m,1)};cd.prototype.removeDefaultCredit=function(o){mi("CreditDisplay.removeDefaultCredit","CreditDisplay.removeDefaultCredit was deprecated in CesiumJS 1.105. It will be removed in CesiumJS 1.107. Use CreditDisplay.addStaticCredit instead."),this.removeStaticCredit(o)};cd.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};cd.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};cd.prototype.update=function(){this._expanded&&H_i(this)};cd.prototype.beginFrame=function(){let o=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let f=o.screenCredits,m=o.lightboxCredits;f.removeAll(),m.removeAll();let v=this._staticCredits;for(let y=0;y<v.length;++y){let x=v[y],C=x.showOnScreen?f:m;x._isIon&&Cs.equals(cd.cesiumCredit,this._cesiumCredit)||ktt(this,C,x,Number.MAX_VALUE)}Cs.equals(cd.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Cs.clone(cd.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};cd.prototype.endFrame=function(){let o=this._currentFrameCredits.screenCredits.values;fUe(this._screenContainer,o,this._delimiter,void 0);let f=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=f.length>0?"inline":"none",fUe(this._creditList,f,void 0,"li"),z_i(this)};cd.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),kr(this)};cd.prototype.isDestroyed=function(){return!1};cd._cesiumCredit=void 0;cd._cesiumCreditInitialized=!1;var XZ;function Vtt(){if(!N(XZ)){let o=Ms("Assets/Images/ion-credit.png");o.indexOf("http://")!==0&&o.indexOf("https://")!==0&&o.indexOf("data:")!==0&&(o=new k_i.default(o).path()),XZ=new Cs(`<a href="https://cesium.com/" target="_blank"><img src="${o}" title="Cesium ion"/></a>`,!0)}return cd._cesiumCreditInitialized||(cd._cesiumCredit=XZ,cd._cesiumCreditInitialized=!0),XZ}Object.defineProperties(cd,{cesiumCredit:{get:function(){return Vtt(),cd._cesiumCredit},set:function(o){cd._cesiumCredit=o,cd._cesiumCreditInitialized=!0}}});cd.CreditDisplayElement=Ntt;var FTe=cd;function Fq(o){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=Z(o,0)}var i7=pa.supportsTypedArrays()?new Float32Array(12):[],pUe=new H,mUe=new H,Qfe=new H,gUe=new H,JZ=new H;function G_i(o,f){let m=o.radii,v=f.camera,y,x,C;if(v.frustum instanceof Gs)y=H.ZERO,x=v.rightWC,C=v.upWC;else{let S=v.positionWC,M=H.multiplyComponents(o.oneOverRadii,S,pUe),I=H.normalize(M,mUe),P=H.normalize(H.cross(H.UNIT_Z,M,Qfe),Qfe),D=H.normalize(H.cross(I,P,gUe),gUe),L=H.magnitude(M),R=Math.sqrt(L*L-1);y=H.multiplyByScalar(I,1/L,pUe);let O=R/L;x=H.multiplyByScalar(P,O,mUe),C=H.multiplyByScalar(D,O,Qfe)}let w=H.add(y,C,JZ);H.subtract(w,x,w),H.multiplyComponents(m,w,w),H.pack(w,i7,0);let A=H.subtract(y,C,JZ);H.subtract(A,x,A),H.multiplyComponents(m,A,A),H.pack(A,i7,3);let E=H.add(y,C,JZ);H.add(E,x,E),H.multiplyComponents(m,E,E),H.pack(E,i7,6);let T=H.subtract(y,C,JZ);return H.add(T,x,T),H.multiplyComponents(m,T,T),H.pack(T,i7,9),i7}Fq.prototype.update=function(o){if(this._mode=o.mode,o.mode!==_i.SCENE3D)return;let f=o.context,m=o.mapProjection.ellipsoid.radii,v=new ki(m.x+this._ellipsoidOffset,m.y+this._ellipsoidOffset,m.z+this._ellipsoidOffset),y=o.useLogDepth;if(N(this._command)||(this._rs=Mn.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new Jn({renderState:this._rs,boundingVolume:new Pi(H.ZERO,v.maximumRadius),pass:vr.OPAQUE,owner:this})),!N(this._sp)||this._useLogDepth!==y){this._useLogDepth=y;let C=new Zr({sources:[YAe]}),w=new Zr({sources:[jAe]});y&&(w.defines.push("LOG_DEPTH"),C.defines.push("LOG_DEPTH")),this._sp=Rs.replaceCache({shaderProgram:this._sp,context:f,vertexShaderSource:C,fragmentShaderSource:w,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let x=G_i(v,o);if(N(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(x);else{let C=new ga({attributes:{position:new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:x})},indices:[0,1,2,2,1,3],primitiveType:Fn.TRIANGLES});this._va=Du.fromGeometry({context:f,geometry:C,attributeLocations:{position:0},bufferUsage:gn.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};Fq.prototype.execute=function(o,f){this._mode===_i.SCENE3D&&this._command.execute(o,f)};Fq.prototype.isDestroyed=function(){return!1};Fq.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var BTe=Fq;function Bq(){}var W_i=/\bgl_FragDepth\b/,j_i=/\bdiscard\b/;function Y_i(o,f){let m=o.shaderCache.getDerivedShaderProgram(f,"depthOnly");if(!N(m)){let v=f._attributeLocations,y=f.fragmentShaderSource,x,C=!1,w=y.sources,A=w.length;for(x=0;x<A;++x)if(W_i.test(w[x])||j_i.test(w[x])){C=!0;break}let E=!1,T=y.defines;for(A=T.length,x=0;x<A;++x)if(T[x]==="LOG_DEPTH"){E=!0;break}let S;!C&&!E?(S=`void main() { out_FragColor = vec4(1.0); } `,y=new Zr({sources:[S]})):!C&&E&&(S=`void main() { out_FragColor = vec4(1.0); czm_writeLogDepth(); } `,y=new Zr({defines:["LOG_DEPTH"],sources:[S]})),m=o.shaderCache.createDerivedShaderProgram(f,"depthOnly",{vertexShaderSource:f.vertexShaderSource,fragmentShaderSource:y,attributeLocations:v})}return m}function q_i(o,f){let m=o._depthOnlyRenderStateCache,v=m[f.id];if(!N(v)){let y=Mn.getState(f);y.depthMask=!0,y.colorMask={red:!1,green:!1,blue:!1,alpha:!1},v=Mn.fromCache(y),m[f.id]=v}return v}Bq.createDepthOnlyDerivedCommand=function(o,f,m,v){N(v)||(v={});let y,x;return N(v.depthOnlyCommand)&&(y=v.depthOnlyCommand.shaderProgram,x=v.depthOnlyCommand.renderState),v.depthOnlyCommand=Jn.shallowClone(f,v.depthOnlyCommand),!N(y)||v.shaderProgramId!==f.shaderProgram.id?(v.depthOnlyCommand.shaderProgram=Y_i(m,f.shaderProgram),v.depthOnlyCommand.renderState=q_i(o,f.renderState),v.shaderProgramId=f.shaderProgram.id):(v.depthOnlyCommand.shaderProgram=y,v.depthOnlyCommand.renderState=x),v};var X_i=/\s+czm_writeLogDepth\(/,J_i=/\s+czm_vertexLogDepth\(/;function K_i(o,f){if(f.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return f;let m=o.shaderCache.getDerivedShaderProgram(f,"logDepth");if(!N(m)){let v=f._attributeLocations,y=f.vertexShaderSource.clone(),x=f.fragmentShaderSource.clone();y.defines=N(y.defines)?y.defines.slice(0):[],y.defines.push("LOG_DEPTH"),x.defines=N(x.defines)?x.defines.slice(0):[],x.defines.push("LOG_DEPTH");let C,w,A=!1,E=y.sources,T=E.length;for(C=0;C<T;++C)if(J_i.test(E[C])){A=!0;break}if(!A){for(C=0;C<T;++C)E[C]=Zr.replaceMain(E[C],"czm_log_depth_main");w=` void main() { czm_log_depth_main(); czm_vertexLogDepth(); } `,E.push(w)}for(E=x.sources,T=E.length,A=!1,C=0;C<T;++C)X_i.test(E[C])&&(A=!0);x.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(A=!0);let S="";if(!A){for(C=0;C<T;C++)E[C]=Zr.replaceMain(E[C],"czm_log_depth_main");S+=` void main() { czm_log_depth_main(); czm_writeLogDepth(); } `}E.push(S),m=o.shaderCache.createDerivedShaderProgram(f,"logDepth",{vertexShaderSource:y,fragmentShaderSource:x,attributeLocations:v})}return m}Bq.createLogDepthCommand=function(o,f,m){N(m)||(m={});let v;return N(m.command)&&(v=m.command.shaderProgram),m.command=Jn.shallowClone(o,m.command),!N(v)||m.shaderProgramId!==o.shaderProgram.id?(m.command.shaderProgram=K_i(f,o.shaderProgram),m.shaderProgramId=o.shaderProgram.id):m.command.shaderProgram=v,m};function Q_i(o,f,m){let v=o.shaderCache.getDerivedShaderProgram(f,"pick");if(!N(v)){let y=f._attributeLocations,x=f.fragmentShaderSource,C=x.sources,w=C.length,A=`void main() { czm_non_pick_main(); if (out_FragColor.a == 0.0) { discard; } out_FragColor = ${m}; } `,E=new Array(w+1);for(let T=0;T<w;++T)E[T]=Zr.replaceMain(C[T],"czm_non_pick_main");E[w]=A,x=new Zr({sources:E,defines:x.defines}),v=o.shaderCache.createDerivedShaderProgram(f,"pick",{vertexShaderSource:f.vertexShaderSource,fragmentShaderSource:x,attributeLocations:y})}return v}function Z_i(o,f){let m=o.picking.pickRenderStateCache,v=m[f.id];if(!N(v)){let y=Mn.getState(f);y.blending.enabled=!1,y.depthMask=!0,v=Mn.fromCache(y),m[f.id]=v}return v}Bq.createPickDerivedCommand=function(o,f,m,v){N(v)||(v={});let y,x;return N(v.pickCommand)&&(y=v.pickCommand.shaderProgram,x=v.pickCommand.renderState),v.pickCommand=Jn.shallowClone(f,v.pickCommand),!N(y)||v.shaderProgramId!==f.shaderProgram.id?(v.pickCommand.shaderProgram=Q_i(m,f.shaderProgram,f.pickId),v.pickCommand.renderState=Z_i(o,f.renderState),v.shaderProgramId=f.shaderProgram.id):(v.pickCommand.shaderProgram=y,v.pickCommand.renderState=x),v};function $_i(o,f){let m=o.shaderCache.getDerivedShaderProgram(f,"HDR");if(!N(m)){let v=f._attributeLocations,y=f.vertexShaderSource.clone(),x=f.fragmentShaderSource.clone();y.defines=N(y.defines)?y.defines.slice(0):[],y.defines.push("HDR"),x.defines=N(x.defines)?x.defines.slice(0):[],x.defines.push("HDR"),m=o.shaderCache.createDerivedShaderProgram(f,"HDR",{vertexShaderSource:y,fragmentShaderSource:x,attributeLocations:v})}return m}Bq.createHdrCommand=function(o,f,m){N(m)||(m={});let v;return N(m.command)&&(v=m.command.shaderProgram),m.command=Jn.shallowClone(o,m.command),!N(v)||m.shaderProgramId!==o.shaderProgram.id?(m.command.shaderProgram=$_i(f,o.shaderProgram),m.shaderProgramId=o.shaderProgram.id):m.command.shaderProgram=v,m};var Iv=Bq;function Moe(o){this._scene=o,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let f=this;function m(v){let y=v.alpha;if(!N(y)){f._alpha=void 0,f._beta=void 0,f._gamma=void 0;return}f._alpha=xe.toRadians(y),f._beta=xe.toRadians(v.beta),f._gamma=xe.toRadians(v.gamma)}window.addEventListener("deviceorientation",m,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",m,!1)}}var evi=new Gr,_Ue=new Gr,tvi=new Ut;function ivi(o,f,m,v){let y=o.direction,x=o.right,C=o.up,w=Gr.fromAxisAngle(y,m,_Ue),A=Gr.fromAxisAngle(x,v,evi),E=Gr.multiply(A,w,A),T=Gr.fromAxisAngle(C,f,_Ue);Gr.multiply(T,E,E);let S=Ut.fromQuaternion(E,tvi);Ut.multiplyByVector(S,x,x),Ut.multiplyByVector(S,C,C),Ut.multiplyByVector(S,y,y)}Moe.prototype.update=function(){if(!N(this._alpha))return;N(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let o=this._lastAlpha-this._alpha,f=this._lastBeta-this._beta,m=this._lastGamma-this._gamma;ivi(this._scene.camera,-o,f,m),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};Moe.prototype.isDestroyed=function(){return!1};Moe.prototype.destroy=function(){return this._removeListener(),kr(this)};var kTe=Moe;function ztt(){this.enabled=!0,this.renderable=!0,this.density=2e-4,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}var oee=[359.393,800.749,1275.6501,2151.1192,3141.7763,4777.5198,6281.2493,12364.307,15900.765,49889.0549,78026.8259,99260.7344,120036.3873,151011.0158,156091.1953,203849.3112,274866.9803,319916.3149,493552.0528,628733.5874],m2=[2e-5,2e-4,1e-4,7e-5,5e-5,4e-5,3e-5,19e-6,1e-5,85e-7,62e-7,58e-7,53e-7,52e-7,51e-7,42e-7,4e-6,34e-7,26e-7,22e-7];for(let o=0;o<m2.length;++o)m2[o]*=1e6;var Htt=m2[1],Uge=m2[m2.length-1];for(let o=0;o<m2.length;++o)m2[o]=(m2[o]-Uge)/(Htt-Uge);var w0=0;function rvi(o){let f=oee,m=f.length;if(o<f[0])return w0=0,w0;if(o>f[m-1])return w0=m-2,w0;if(o>=f[w0]){if(w0+1<m&&o<f[w0+1])return w0;if(w0+2<m&&o<f[w0+2])return++w0,w0}else if(w0-1>=0&&o>=f[w0-1])return--w0,w0;let v;for(v=0;v<m-2&&!(o>=f[v]&&o<f[v+1]);++v);return w0=v,w0}var nvi=new H;ztt.prototype.update=function(o){if(!(o.fog.enabled=this.enabled))return;o.fog.renderable=this.renderable;let f=o.camera,m=f.positionCartographic;if(!N(m)||m.height>8e5||o.mode!==_i.SCENE3D){o.fog.enabled=!1;return}let v=m.height,y=rvi(v),x=xe.clamp((v-oee[y])/(oee[y+1]-oee[y]),0,1),C=xe.lerp(m2[y],m2[y+1],x),w=this.density*1e6,A=w/Htt*Uge;C=C*(w-A)*1e-6;let E=H.normalize(f.positionWC,nvi),T=Math.abs(H.dot(f.directionWC,E));C*=1-T,o.fog.density=C,o.fog.sse=this.screenSpaceErrorFactor,o.fog.minimumBrightness=this.minimumBrightness};var VTe=ztt;function ovi(o,f,m){this.context=o,this.commandList=[],this.shadowMaps=[],this.textureProjectionMaps=[],this.viewShedMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=_i.SCENE3D,this.morphTime=_i.getMorphTime(_i.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=m,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.cullingVolumeForTileset=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=f,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,density:void 0,sse:void 0,minimumBrightness:void 0},this.terrainExaggeration=1,this.terrainExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.textureProjecitonHints={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.viewShedState={shadowsEnabled:!0,lightShadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0}var zTe=ovi,E0={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},n5=E0.DERIVED_COMMANDS_MAXIMUM_LENGTH,Utt=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function qB(){this._frontFaceAlphaByDistance=new sa(0,1,0,1),this._backFaceAlphaByDistance=new sa(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=Di.clone(Di.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(n5),this._derivedBlendCommandTypes=new Array(n5),this._derivedPickCommandTypes=new Array(n5),this._derivedCommandTypesToUpdate=new Array(n5),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(qB.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});qB.prototype.update=function(o){let f=o.globe;if(!N(f)||!f.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=vUe(f.translucency.enabled,f.translucency.frontFaceAlpha,f.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=vUe(f.translucency.enabled,f.translucency.backFaceAlpha,f.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=yUe(f.translucency.enabled,this._frontFaceAlphaByDistance,f),this._backFaceTranslucent=yUe(f.translucency.enabled,this._backFaceAlphaByDistance,f),this._requiresManualDepthTest=uvi(this,o,f),this._sunVisibleThroughGlobe=avi(this,o),this._environmentVisible=svi(this,o),this._useDepthPlane=lvi(this,o),this._numberOfTextureUniforms=cvi(this),this._rectangle=Di.clone(f.translucency.rectangle,this._rectangle),hvi(this,o)};function vUe(o,f,m,v){return o?N(m)?(sa.clone(m,v),v.nearValue*=f,v.farValue*=f,v):(v.nearValue=f,v.farValue=f,v):(v.nearValue=1,v.farValue=1,v)}function yUe(o,f,m){return o&&(m.baseColor.alpha<1||f.nearValue<1||f.farValue<1)}function avi(o,f){let m=o._frontFaceTranslucent,v=o._backFaceTranslucent;return m&&(f.cameraUnderground||v)}function svi(o,f){return!f.cameraUnderground||o._frontFaceTranslucent}function lvi(o,f){return!f.cameraUnderground&&!o._frontFaceTranslucent}function uvi(o,f,m){return o._frontFaceTranslucent&&!o._backFaceTranslucent&&!m.depthTestAgainstTerrain&&f.mode!==_i.SCENE2D&&f.context.depthTexture}function cvi(o){let f=0;return o._frontFaceTranslucent&&++f,o._requiresManualDepthTest&&++f,f}function hvi(o,f){o._derivedCommandsLength=Zfe(o,f,!1,!1,o._derivedCommandTypes),o._derivedBlendCommandsLength=Zfe(o,f,!0,!1,o._derivedBlendCommandTypes),o._derivedPickCommandsLength=Zfe(o,f,!1,!0,o._derivedPickCommandTypes);let m,v=0;for(m=0;m<o._derivedCommandsLength;++m)v|=1<<o._derivedCommandTypes[m];for(m=0;m<o._derivedBlendCommandsLength;++m)v|=1<<o._derivedBlendCommandTypes[m];for(m=0;m<o._derivedPickCommandsLength;++m)v|=1<<o._derivedPickCommandTypes[m];let y=0;for(m=0;m<n5;++m)(v&1<<m)>0&&(o._derivedCommandTypesToUpdate[y++]=m);o._derivedCommandsToUpdateLength=y;let x=v!==o._derivedCommandKey;o._derivedCommandKey=v,o._derivedCommandsDirty=x,!N(o._derivedCommandPacks)&&o._frontFaceTranslucent&&(o._derivedCommandPacks=Tvi())}function Zfe(o,f,m,v,y){let x=0,C=o._frontFaceTranslucent,w=o._backFaceTranslucent;if(!C)return x;let A=f.cameraUnderground,E=o._requiresManualDepthTest,T=v?E0.PICK_FRONT_FACE:E?E0.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:E0.TRANSLUCENT_FRONT_FACE,S=v?E0.PICK_BACK_FACE:E?E0.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:E0.TRANSLUCENT_BACK_FACE;return f.mode===_i.SCENE2D?(y[x++]=E0.DEPTH_ONLY_FRONT_FACE,y[x++]=T,x):(w?(m||(y[x++]=E0.DEPTH_ONLY_FRONT_AND_BACK_FACE),A?(y[x++]=T,y[x++]=S):(y[x++]=S,y[x++]=T)):A?(m||(y[x++]=E0.DEPTH_ONLY_BACK_FACE),y[x++]=E0.OPAQUE_FRONT_FACE,y[x++]=S):(m||(y[x++]=E0.DEPTH_ONLY_FRONT_FACE),y[x++]=E0.OPAQUE_BACK_FACE,y[x++]=T),x)}function _w(o,f){let m=o.indexOf(f);m>-1&&o.splice(m,1)}function xUe(o,f){return o.indexOf(f)>-1}function dvi(o,f){_w(o.defines,"TRANSLUCENT"),_w(f.defines,"TRANSLUCENT")}function fvi(o,f){_w(o.defines,"GROUND_ATMOSPHERE"),_w(f.defines,"GROUND_ATMOSPHERE"),_w(o.defines,"FOG"),_w(f.defines,"FOG"),_w(o.defines,"TRANSLUCENT"),_w(f.defines,"TRANSLUCENT")}function $fe(o,f){if(xUe(f.defines,"TILE_LIMIT_RECTANGLE")||xUe(f.defines,"ENABLE_CLIPPING_PLANES"))return;let m=`void main() { out_FragColor = vec4(1.0); } `;f.sources=[m]}function HTe(o,f){let m=f.sources,v=m.length;for(let x=0;x<v;++x)m[x]=Zr.replaceMain(m[x],"czm_globe_translucency_main");let y=` uniform sampler2D u_classificationTexture; void main() { vec2 st = gl_FragCoord.xy / czm_viewport.zw; #ifdef MANUAL_DEPTH_TEST float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st)); if (logDepthOrDepth != 0.0) { vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth); float depthEC = eyeCoordinate.z / eyeCoordinate.w; if (v_positionEC.z < depthEC) { discard; } } #endif czm_globe_translucency_main(); vec4 classificationColor = texture(u_classificationTexture, st); if (classificationColor.a > 0.0) { // Reverse premultiplication process to get the correct composited result of the classification primitives classificationColor.rgb /= classificationColor.a; } out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); } `;m.push(y)}function Gtt(o,f){HTe(o,f),_w(o.defines,"GROUND_ATMOSPHERE"),_w(f.defines,"GROUND_ATMOSPHERE"),_w(o.defines,"FOG"),_w(f.defines,"FOG")}function pvi(o,f){HTe(o,f),o.defines.push("GENERATE_POSITION"),f.defines.push("MANUAL_DEPTH_TEST")}function mvi(o,f){Gtt(o,f),o.defines.push("GENERATE_POSITION"),f.defines.push("MANUAL_DEPTH_TEST")}function CUe(o,f){let m=`uniform sampler2D u_classificationTexture; void main() { vec2 st = gl_FragCoord.xy / czm_viewport.zw; vec4 pickColor = texture(u_classificationTexture, st); if (pickColor == vec4(0.0)) { discard; } out_FragColor = pickColor; } `;f.sources=[m]}function gvi(o,f,m,v,y,x){if(!N(y))return f;if(!v&&N(m))return m;let C=o.shaderCache.getDerivedShaderProgram(f,x);if(!N(C)){let w=f._attributeLocations,A=f.vertexShaderSource.clone(),E=f.fragmentShaderSource.clone();A.defines=N(A.defines)?A.defines.slice(0):[],E.defines=N(E.defines)?E.defines.slice(0):[],y(A,E),C=o.shaderCache.createDerivedShaderProgram(f,x,{vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:w})}return C}function _vi(o){o.cull.face=uh.BACK,o.cull.enabled=!0}function vvi(o){o.cull.face=uh.FRONT,o.cull.enabled=!0}function yvi(o){o.cull.face=uh.BACK,o.cull.enabled=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function xvi(o){o.cull.face=uh.FRONT,o.cull.enabled=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Cvi(o){o.cull.enabled=!1,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function bUe(o){o.cull.face=uh.BACK,o.cull.enabled=!0,o.depthMask=!1,o.blending=Mu.ALPHA_BLEND}function wUe(o){o.cull.face=uh.FRONT,o.cull.enabled=!0,o.depthMask=!1,o.blending=Mu.ALPHA_BLEND}function bvi(o){o.cull.face=uh.BACK,o.cull.enabled=!0,o.blending.enabled=!1}function wvi(o){o.cull.face=uh.FRONT,o.cull.enabled=!0,o.blending.enabled=!1}function Avi(o,f,m,v,y){if(!N(v))return o;if(!m&&N(f))return f;let x=y[o.id];if(!N(x)){let C=Mn.getState(o);v(C),x=Mn.fromCache(C),y[o.id]=x}return x}function YV(o){return{u_classificationTexture:function(){return o._globeTranslucencyFramebuffer.classificationTexture}}}function Evi(o,f,m,v,y){return N(y)?!v&&N(m)?m:va(f,y(o),!1):f}function bE(o){this.pass=o.pass,this.pickOnly=o.pickOnly,this.getShaderProgramFunction=o.getShaderProgramFunction,this.getRenderStateFunction=o.getRenderStateFunction,this.getUniformMapFunction=o.getUniformMapFunction,this.renderStateCache={}}function Tvi(){return[new bE({pass:vr.GLOBE,pickOnly:!1,getShaderProgramFunction:dvi,getRenderStateFunction:_vi,getUniformMapFunction:void 0}),new bE({pass:vr.GLOBE,pickOnly:!1,getShaderProgramFunction:fvi,getRenderStateFunction:vvi,getUniformMapFunction:void 0}),new bE({pass:vr.GLOBE,pickOnly:!1,getShaderProgramFunction:$fe,getRenderStateFunction:yvi,getUniformMapFunction:void 0}),new bE({pass:vr.GLOBE,pickOnly:!1,getShaderProgramFunction:$fe,getRenderStateFunction:xvi,getUniformMapFunction:void 0}),new bE({pass:vr.GLOBE,pickOnly:!1,getShaderProgramFunction:$fe,getRenderStateFunction:Cvi,getUniformMapFunction:void 0}),new bE({pass:vr.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:HTe,getRenderStateFunction:bUe,getUniformMapFunction:YV}),new bE({pass:vr.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Gtt,getRenderStateFunction:wUe,getUniformMapFunction:YV}),new bE({pass:vr.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:pvi,getRenderStateFunction:bUe,getUniformMapFunction:YV}),new bE({pass:vr.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:mvi,getRenderStateFunction:wUe,getUniformMapFunction:YV}),new bE({pass:vr.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:CUe,getRenderStateFunction:bvi,getUniformMapFunction:YV}),new bE({pass:vr.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:CUe,getRenderStateFunction:wvi,getUniformMapFunction:YV})]}var AUe=new Array(n5),EUe=new Array(n5);qB.prototype.updateDerivedCommands=function(o,f){let m=this._derivedCommandTypesToUpdate,v=this._derivedCommandsToUpdateLength;if(v!==0){for(let y=0;y<v;++y)EUe[y]=this._derivedCommandPacks[m[y]],AUe[y]=Utt[m[y]];Svi(this,o,v,m,AUe,EUe,f)}};function Svi(o,f,m,v,y,x,C){let w=f.derivedCommands.globeTranslucency,A=o._derivedCommandsDirty;if(f.dirty||!N(w)||A){f.dirty=!1,N(w)||(w={},f.derivedCommands.globeTranslucency=w);let E=C.frameNumber,T=Z(w.uniformMapDirtyFrame,0),S=Z(w.shaderProgramDirtyFrame,0),M=Z(w.renderStateDirtyFrame,0),I=w.uniformMap!==f.uniformMap,P=w.shaderProgramId!==f.shaderProgram.id,D=w.renderStateId!==f.renderState.id;I&&(w.uniformMapDirtyFrame=E),P&&(w.shaderProgramDirtyFrame=E),D&&(w.renderStateDirtyFrame=E),w.uniformMap=f.uniformMap,w.shaderProgramId=f.shaderProgram.id,w.renderStateId=f.renderState.id;for(let L=0;L<m;++L){let R=x[L],O=v[L],F=y[L],k=w[F],U,G,j;N(k)?(U=k.uniformMap,G=k.shaderProgram,j=k.renderState):(U=void 0,G=void 0,j=void 0),k=Jn.shallowClone(f,k),w[F]=k;let q=Z(k.derivedCommands.uniformMapDirtyFrame,0),J=Z(k.derivedCommands.shaderProgramDirtyFrame,0),X=Z(k.derivedCommands.renderStateDirtyFrame,0),Y=I||q<T,Q=P||J<S,ee=D||X<M;Y&&(k.derivedCommands.uniformMapDirtyFrame=E),Q&&(k.derivedCommands.shaderProgramDirtyFrame=E),ee&&(k.derivedCommands.renderStateDirtyFrame=E),k.derivedCommands.type=O,k.pass=R.pass,k.pickOnly=R.pickOnly,k.uniformMap=Evi(o,f.uniformMap,U,Y,R.getUniformMapFunction),k.shaderProgram=gvi(C.context,f.shaderProgram,G,Q,R.getShaderProgramFunction,F),k.renderState=Avi(f.renderState,j,ee,R.getRenderStateFunction,R.renderStateCache)}}}qB.prototype.pushDerivedCommands=function(o,f,m){let v=m.passes.pick;if(v&&f)return;let y=this._derivedCommandTypes,x=this._derivedCommandsLength;if(v?(y=this._derivedPickCommandTypes,x=this._derivedPickCommandsLength):f&&(y=this._derivedBlendCommandTypes,x=this._derivedBlendCommandsLength),x===0){m.commandList.push(o);return}let C=o.derivedCommands.globeTranslucency;for(let w=0;w<x;++w){let A=Utt[y[w]];m.commandList.push(C[A])}};function Wtt(o,f,m,v,y,x,C){for(let w=0;w<f;++w){let A=o[w],E=A.derivedCommands.type;(!N(C)||C.indexOf(E)>-1)&&m(A,v,y,x)}}function TUe(o,f,m,v,y,x){for(let C=0;C<f;++C)m(o[C],v,y,x)}var Pvi=[E0.OPAQUE_FRONT_FACE,E0.OPAQUE_BACK_FACE],Ivi=[E0.DEPTH_ONLY_FRONT_FACE,E0.DEPTH_ONLY_BACK_FACE,E0.DEPTH_ONLY_FRONT_AND_BACK_FACE];qB.prototype.executeGlobeCommands=function(o,f,m,v,y){let x=v.context,C=o.commands[vr.GLOBE],w=o.indices[vr.GLOBE];w!==0&&(this._globeTranslucencyFramebuffer=m,m.clearClassification(x,y),Wtt(C,w,f,v,x,y,Pvi))};qB.prototype.executeGlobeClassificationCommands=function(o,f,m,v,y){let x=v.context,C=o.commands[vr.GLOBE],w=o.indices[vr.GLOBE],A=o.commands[vr.TERRAIN_CLASSIFICATION],E=o.indices[vr.TERRAIN_CLASSIFICATION];if(w===0||E===0)return;let T=this._frontFaceTranslucent,S=this._backFaceTranslucent;if((!T||!S)&&TUe(A,E,f,v,x,y),!T&&!S)return;this._globeTranslucencyFramebuffer=m;let M=x.uniformState.globeDepthTexture,I=y.framebuffer;if(y.framebuffer=m.classificationFramebuffer,Wtt(C,w,f,v,x,y,Ivi),x.depthTexture){let P=m.packDepth(x,y);x.uniformState.globeDepthTexture=P}TUe(A,E,f,v,x,y),x.uniformState.globeDepthTexture=M,y.framebuffer=I};var UTe=qB,NM=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); } `;function dP(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new $h({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new $h({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new Gc({color:new Re(0,0,0,0),owner:this}),this._clearCommand=new Gc({color:new Re(0,0,0,0),depth:1,stencil:0});let o=this;this._uniformMap={colorTexture:function(){return o._fbo.getColorTexture()},depthTexture:function(){return o._depthStencilTexture},classifiedTexture:function(){return o._fboClassified.getColorTexture()}}}Object.defineProperties(dP.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});dP.isTranslucencySupported=function(o){return o.depthTexture&&o.fragmentDepth};var Mvi={depthMask:!1,stencilTest:{enabled:!0,frontFunction:dc.EQUAL,frontOperation:{fail:No.KEEP,zFail:No.KEEP,zPass:No.KEEP},backFunction:dc.NEVER,reference:0,mask:Ua.CLASSIFICATION_MASK},blending:Mu.ALPHA_BLEND},Dvi={depthMask:!1,stencilTest:{enabled:!0,frontFunction:dc.NOT_EQUAL,frontOperation:{fail:No.KEEP,zFail:No.KEEP,zPass:No.KEEP},backFunction:dc.NEVER,reference:0,mask:Ua.CLASSIFICATION_MASK},blending:Mu.ALPHA_BLEND},Lvi={depthMask:!0,depthTest:{enabled:!0},stencilTest:Ua.setCesium3DTileBit(),stencilMask:Ua.CESIUM_3D_TILE_MASK,blending:Mu.ALPHA_BLEND},Rvi=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(colorTexture, v_textureCoordinates); if (color.a == 0.0) { discard; } bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0))); #ifdef UNCLASSIFIED vec4 highlightColor = czm_invertClassificationColor; if (isClassified) { discard; } #else vec4 highlightColor = vec4(1.0); if (!isClassified) { discard; } #endif out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } `,Ovi=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(colorTexture, v_textureCoordinates); if (color.a == 0.0) { discard; } #ifdef UNCLASSIFIED out_FragColor = color * czm_invertClassificationColor; #else out_FragColor = color; #endif } `;dP.prototype.update=function(o,f,m){let v=this._fbo.getColorTexture(),y=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let x=this._numSamples!==f,C=o.drawingBufferWidth,w=o.drawingBufferHeight,A=!N(v)||v.width!==C||v.height!==w;if((A||y||x)&&(this._numSamples=f,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),N(this._previousFramebuffer)||(this._depthStencilTexture=new _o({context:o,width:C,height:w,pixelFormat:Nn.DEPTH_STENCIL,pixelDatatype:Rn.UNSIGNED_INT_24_8}),f>1&&(this._depthStencilRenderbuffer=new N1({context:o,width:C,height:w,format:aC.DEPTH24_STENCIL8,numSamples:f})))),!N(this._fbo.framebuffer)||A||y||x){this._fbo.destroy(),this._fboClassified.destroy();let E,T;N(this._previousFramebuffer)?(E=m.getDepthStencilTexture(),T=m.getDepthStencilRenderbuffer()):(E=this._depthStencilTexture,T=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(E),N(T)&&this._fbo.setDepthStencilRenderbuffer(T),this._fbo.update(o,C,w,f),N(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(E),this._fboClassified.update(o,C,w))}if(N(this._rsUnclassified)||(this._rsUnclassified=Mn.fromCache(Mvi),this._rsClassified=Mn.fromCache(Dvi),this._rsDefault=Mn.fromCache(Lvi)),!N(this._unclassifiedCommand)||y||x){N(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let E=N(this._previousFramebuffer)?Ovi:Rvi,T=new Zr({defines:["UNCLASSIFIED"],sources:[E]}),S=new Zr({sources:[E]});this._unclassifiedCommand=o.createViewportQuadCommand(T,{renderState:N(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=o.createViewportQuadCommand(S,{renderState:N(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),N(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),N(this._previousFramebuffer)||(this._translucentCommand=o.createViewportQuadCommand(NM,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};dP.prototype.prepareTextures=function(o,f){this._fbo._numSamples>1&&this._fbo.prepareTextures(o,f)};dP.prototype.clear=function(o,f){N(this._previousFramebuffer)?this._fbo.clear(o,this._clearColorCommand,f):(this._fbo.clear(o,this._clearCommand,f),this._fboClassified.clear(o,this._clearCommand,f))};dP.prototype.executeClassified=function(o,f){if(!N(this._previousFramebuffer)){let m=f.framebuffer;this.prepareTextures(o,!0),f.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(o,f),f.framebuffer=m}this._classifiedCommand.execute(o,f)};dP.prototype.executeUnclassified=function(o,f){this._unclassifiedCommand.execute(o,f)};dP.prototype.isDestroyed=function(){return!1};dP.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),N(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),kr(this)};var Doe=dP;function aee(o){this._total=o,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(aee.prototype,{total:{get:function(){return this._total}}});function f3(o){let f=new Array(Zx.NUMBER_OF_JOB_TYPES);f[Zx.TEXTURE]=new aee(N(o)?o[Zx.TEXTURE]:10),f[Zx.PROGRAM]=new aee(N(o)?o[Zx.PROGRAM]:10),f[Zx.BUFFER]=new aee(N(o)?o[Zx.BUFFER]:30);let m=f.length,v,y=0;for(v=0;v<m;++v)y+=f[v].total;let x=new Array(m);for(v=0;v<m;++v)x[v]=!1;this._totalBudget=y,this._totalUsedThisFrame=0,this._budgets=f,this._executedThisFrame=x}f3.getTimestamp=$c;Object.defineProperties(f3.prototype,{totalBudget:{get:function(){return this._totalBudget}}});f3.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};f3.prototype.resetBudgets=function(){let o=this._budgets,f=o.length;for(let m=0;m<f;++m){let v=o[m];v.starvedLastFrame=v.starvedThisFrame,v.starvedThisFrame=!1,v.usedThisFrame=0,v.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};f3.prototype.execute=function(o,f){let m=this._budgets,v=m[f],y=this._executedThisFrame[f];if(this._totalUsedThisFrame>=this._totalBudget&&y)return v.starvedThisFrame=!0,!1;let x;if(v.usedThisFrame+v.stolenFromMeThisFrame>=v.total){let A=m.length,E;for(E=0;E<A&&(x=m[E],!(x.usedThisFrame+x.stolenFromMeThisFrame<x.total&&!x.starvedLastFrame));++E);if(E===A&&y)return!1;y&&(v.starvedThisFrame=!0)}let C=f3.getTimestamp();o.execute();let w=f3.getTimestamp()-C;return this._totalUsedThisFrame+=w,x?x.stolenFromMeThisFrame+=w:v.usedThisFrame+=w,this._executedThisFrame[f]=!0,!0};var GTe=f3;function Loe(o){o=Z(o,Z.EMPTY_OBJECT);let f=Uh(o.container);this._container=f;let m=document.createElement("div");m.className="cesium-performanceDisplay";let v=document.createElement("div");v.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),v.appendChild(this._fpsText);let y=document.createElement("div");y.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),y.appendChild(this._msText),m.appendChild(y),m.appendChild(v),this._container.appendChild(m),this._lastFpsSampleTime=$c(),this._lastMsSampleTime=$c(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let x=document.createElement("div");x.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),x.appendChild(this._throttledText),m.appendChild(x)}Object.defineProperties(Loe.prototype,{throttled:{get:function(){return this._throttled},set:function(o){this._throttled!==o&&(o?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=o)}}});Loe.prototype.update=function(o){let f=$c(),m=Z(o,!0);this._fpsFrameCount++;let v=f-this._lastFpsSampleTime;if(v>1e3){let x="N/A";m&&(x=this._fpsFrameCount*1e3/v|0),this._fpsText.nodeValue=`${x} FPS`,this._lastFpsSampleTime=f,this._fpsFrameCount=0}this._msFrameCount++;let y=f-this._lastMsSampleTime;if(y>200){let x="N/A";m&&(x=(y/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${x} MS`,this._lastMsSampleTime=f,this._msFrameCount=0}};Loe.prototype.destroy=function(){return kr(this)};var kq=Loe;function XB(){this._framebuffer=new $h,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(XB.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Nvi(o,f,m){let v=m.width,y=m.height;o._framebuffer.update(f,v,y)}function Fvi(o,f,m){if(!N(o._copyDepthCommand)){let v=`uniform highp sampler2D u_texture; in vec2 v_textureCoordinates; void main() { out_FragColor = czm_packDepth(texture(u_texture, v_textureCoordinates).r); } `;o._copyDepthCommand=f.createViewportQuadCommand(v,{renderState:Mn.fromCache(),uniformMap:{u_texture:function(){return o._textureToCopy}},owner:o})}o._textureToCopy=m,o._copyDepthCommand.framebuffer=o.framebuffer}XB.prototype.update=function(o,f){Nvi(this,o,f),Fvi(this,o,f)};var Bvi=new Wt,kvi=new Wt(1,1/255,1/65025,1/16581375);XB.prototype.getDepth=function(o,f,m){if(!N(this.framebuffer))return;let v=o.readPixels({x:f,y:m,width:1,height:1,framebuffer:this.framebuffer}),y=Wt.unpack(v,0,Bvi);return Wt.divideByScalar(y,255,y),Wt.dot(y,kvi)};XB.prototype.executeCopyDepth=function(o,f){this._copyDepthCommand.execute(o,f)};XB.prototype.isDestroyed=function(){return!1};XB.prototype.destroy=function(){return this._framebuffer.destroy(),N(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=N(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),kr(this)};var WTe=XB;function Vvi(o,f){this.near=Z(o,0),this.far=Z(f,0);let m=vr.NUMBER_OF_PASSES,v=new Array(m),y=new Array(m);for(let x=0;x<m;++x)v[x]=[],y[x]=0;this.commands=v,this.indices=y}var jTe=Vvi,Aj=`uniform highp sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } `;function fP(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new $h({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new $h({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new $h,this._tempCopyDepthFramebuffer=new $h,this._updateDepthFramebuffer=new $h({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Xr,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(fP.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(o){this._picking=o}}});function zvi(o){o._pickColorFramebuffer.destroy(),o._outputFramebuffer.destroy(),o._copyDepthFramebuffer.destroy(),o._tempCopyDepthFramebuffer.destroy(),o._updateDepthFramebuffer.destroy()}function jtt(o,f,m,v,y){o._viewport.width=m,o._viewport.height=v;let x=!Xr.equals(o._viewport,y.viewport),C=x!==o._useScissorTest;o._useScissorTest=x,Xr.equals(o._scissorRectangle,y.viewport)||(o._scissorRectangle=Xr.clone(y.viewport,o._scissorRectangle),C=!0),(!N(o._rs)||!Xr.equals(o._viewport,o._rs.viewport)||C)&&(o._rs=Mn.fromCache({viewport:o._viewport,scissorTest:{enabled:o._useScissorTest,rectangle:o._scissorRectangle}}),o._rsBlend=Mn.fromCache({viewport:o._viewport,scissorTest:{enabled:o._useScissorTest,rectangle:o._scissorRectangle},blending:Mu.ALPHA_BLEND}),o._rsUpdate=Mn.fromCache({viewport:o._viewport,scissorTest:{enabled:o._useScissorTest,rectangle:o._scissorRectangle},stencilTest:{enabled:!0,frontFunction:dc.EQUAL,frontOperation:{fail:No.KEEP,zFail:No.KEEP,zPass:No.KEEP},backFunction:dc.NEVER,reference:Ua.CESIUM_3D_TILE_MASK,mask:Ua.CESIUM_3D_TILE_MASK}})),N(o._copyDepthCommand)||(o._copyDepthCommand=f.createViewportQuadCommand(Aj,{uniformMap:{u_depthTexture:function(){return o.colorFramebufferManager.getDepthStencilTexture()}},owner:o})),o._copyDepthCommand.framebuffer=o._copyDepthFramebuffer.framebuffer,o._copyDepthCommand.renderState=o._rs,N(o._copyColorCommand)||(o._copyColorCommand=f.createViewportQuadCommand(NM,{uniformMap:{colorTexture:function(){return o.colorFramebufferManager.getColorTexture()}},owner:o})),o._copyColorCommand.renderState=o._rs,N(o._tempCopyDepthCommand)||(o._tempCopyDepthCommand=f.createViewportQuadCommand(Aj,{uniformMap:{u_depthTexture:function(){return o._tempCopyDepthTexture}},owner:o})),o._tempCopyDepthCommand.framebuffer=o._tempCopyDepthFramebuffer.framebuffer,o._tempCopyDepthCommand.renderState=o._rs,N(o._updateDepthCommand)||(o._updateDepthCommand=f.createViewportQuadCommand(NM,{uniformMap:{colorTexture:function(){return o._tempCopyDepthFramebuffer.getColorTexture()}},owner:o})),o._updateDepthCommand.framebuffer=o._updateDepthFramebuffer.framebuffer,o._updateDepthCommand.renderState=o._rsUpdate,N(o._clearGlobeColorCommand)||(o._clearGlobeColorCommand=new Gc({color:new Re(0,0,0,0),stencil:0,owner:o})),o._clearGlobeColorCommand.framebuffer=o.framebuffer}fP.prototype.update=function(o,f,m,v,y,x){let C=m.width,w=m.height,A=y?o.halfFloatingPointTexture?Rn.HALF_FLOAT:Rn.FLOAT:Rn.UNSIGNED_BYTE;this._numSamples=v,this.picking?this._pickColorFramebuffer.update(o,C,w):this._outputFramebuffer.update(o,C,w,v,A),this._copyDepthFramebuffer.update(o,C,w),jtt(this,o,C,w,f),o.uniformState.globeDepthTexture=void 0,this._useHdr=y,this._clearGlobeDepth=x};fP.prototype.prepareColorTextures=function(o,f){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(o,f)};fP.prototype.executeCopyDepth=function(o,f){N(this._copyDepthCommand)&&(this.prepareColorTextures(o),this._copyDepthCommand.execute(o,f),o.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};fP.prototype.executeUpdateDepth=function(o,f,m,v){let y=N(v)?v:f.framebuffer.depthStencilTexture;if(m||y!==this.colorFramebufferManager.getDepthStencilTexture()){if(N(this._updateDepthCommand)){if(!N(this._updateDepthFramebuffer.framebuffer)||this._updateDepthFramebuffer.getDepthStencilTexture()!==y||this._updateDepthFramebuffer.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let x=this._copyDepthFramebuffer.getColorTexture().width,C=this._copyDepthFramebuffer.getColorTexture().height;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(o,x,C);let w=this._copyDepthFramebuffer.getColorTexture();this._updateDepthFramebuffer.setColorTexture(w,0),this._updateDepthFramebuffer.setDepthStencilTexture(y),this._updateDepthFramebuffer.update(o,x,C),jtt(this,o,x,C,f)}this._tempCopyDepthTexture=y,this._tempCopyDepthCommand.execute(o,f),this._updateDepthCommand.execute(o,f)}return}N(this._copyDepthCommand)&&this._copyDepthCommand.execute(o,f)};fP.prototype.executeCopyColor=function(o,f){N(this._copyColorCommand)&&this._copyColorCommand.execute(o,f)};fP.prototype.clear=function(o,f,m){let v=this._clearGlobeColorCommand;N(v)&&(Re.clone(m,v.color),this.colorFramebufferManager.clear(o,v,f))};fP.prototype.isDestroyed=function(){return!1};fP.prototype.destroy=function(){return zvi(this),N(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),N(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),N(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),N(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),kr(this)};var YTe=fP;function JB(){this._framebuffer=new $h({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new $h,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Xr,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(JB.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Hvi(o){o._framebuffer.destroy(),o._packedDepthFramebuffer.destroy()}function Uvi(o,f,m,v,y){let x=y?f.halfFloatingPointTexture?Rn.HALF_FLOAT:Rn.FLOAT:Rn.UNSIGNED_BYTE;o._framebuffer.update(f,m,v,1,x),o._packedDepthFramebuffer.update(f,m,v)}function Gvi(o,f,m,v,y){o._viewport.width=m,o._viewport.height=v;let x=!Xr.equals(o._viewport,y.viewport),C=x!==o._useScissorTest;o._useScissorTest=x,Xr.equals(o._scissorRectangle,y.viewport)||(o._scissorRectangle=Xr.clone(y.viewport,o._scissorRectangle),C=!0),(!N(o._renderState)||!Xr.equals(o._viewport,o._renderState.viewport)||C)&&(o._renderState=Mn.fromCache({viewport:o._viewport,scissorTest:{enabled:o._useScissorTest,rectangle:o._scissorRectangle}})),N(o._packedDepthCommand)||(o._packedDepthCommand=f.createViewportQuadCommand(Aj,{uniformMap:{u_depthTexture:function(){return o.depthStencilTexture}},owner:o})),N(o._clearCommand)||(o._clearCommand=new Gc({color:new Re(0,0,0,0),depth:1,stencil:0,owner:o})),o._packedDepthCommand.framebuffer=o._packedDepthFramebuffer.framebuffer,o._packedDepthCommand.renderState=o._renderState,o._clearCommand.framebuffer=o.classificationFramebuffer,o._clearCommand.renderState=o._renderState}JB.prototype.updateAndClear=function(o,f,m,v){let y=f.width,x=f.height;Uvi(this,m,y,x,o),Gvi(this,m,y,x,v),this._useHdr=o};JB.prototype.clearClassification=function(o,f){this._clearCommand.execute(o,f)};JB.prototype.packDepth=function(o,f){return this._packedDepthCommand.execute(o,f),this.packedDepthTexture};JB.prototype.isDestroyed=function(){return!1};JB.prototype.destroy=function(){return Hvi(this),kr(this)};var qTe=JB;function fD(o){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let f=o.colorBufferFloat&&o.depthTexture&&o.floatBlend;this._translucentMRTSupport=o.drawBuffers&&f,this._translucentMultipassSupport=!this._translucentMRTSupport&&f,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new $h({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new $h({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new $h({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new $h({createColorAttachments:!1}),this._opaqueClearCommand=new Gc({color:new Re(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new Gc({color:new Re(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new Gc({color:new Re(0,0,0,0),owner:this}),this._alphaClearCommand=new Gc({color:new Re(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Xr,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Ytt(o){o._accumulationTexture=o._accumulationTexture&&!o._accumulationTexture.isDestroyed()&&o._accumulationTexture.destroy(),o._revealageTexture=o._revealageTexture&&!o._revealageTexture.isDestroyed()&&o._revealageTexture.destroy()}function Gge(o){o._translucentFBO.destroy(),o._alphaFBO.destroy(),o._adjustTranslucentFBO.destroy(),o._adjustAlphaFBO.destroy()}function qtt(o){Ytt(o),Gge(o)}function Wvi(o,f,m,v){Ytt(o),o._accumulationTexture=new _o({context:f,width:m,height:v,pixelFormat:Nn.RGBA,pixelDatatype:Rn.FLOAT});let y=new Float32Array(m*v*4);o._revealageTexture=new _o({context:f,pixelFormat:Nn.RGBA,pixelDatatype:Rn.FLOAT,source:{arrayBufferView:y,width:m,height:v},flipY:!1})}function jvi(o,f){Gge(o);let m=xi.FRAMEBUFFER_COMPLETE,v=!0,{width:y,height:x}=o._accumulationTexture;if(o._translucentMRTSupport&&(o._translucentFBO.setColorTexture(o._accumulationTexture,0),o._translucentFBO.setColorTexture(o._revealageTexture,1),o._translucentFBO.setDepthStencilTexture(o._depthStencilTexture),o._translucentFBO.update(f,y,x),o._adjustTranslucentFBO.setColorTexture(o._accumulationTexture,0),o._adjustTranslucentFBO.setColorTexture(o._revealageTexture,1),o._adjustTranslucentFBO.update(f,y,x),(o._translucentFBO.status!==m||o._adjustTranslucentFBO.status!==m)&&(Gge(o),o._translucentMRTSupport=!1)),!o._translucentMRTSupport){o._translucentFBO.setColorTexture(o._accumulationTexture),o._translucentFBO.setDepthStencilTexture(o._depthStencilTexture),o._translucentFBO.update(f,y,x),o._alphaFBO.setColorTexture(o._revealageTexture),o._alphaFBO.setDepthStencilTexture(o._depthStencilTexture),o._alphaFBO.update(f,y,x),o._adjustTranslucentFBO.setColorTexture(o._accumulationTexture),o._adjustTranslucentFBO.update(f,y,x),o._adjustAlphaFBO.setColorTexture(o._revealageTexture),o._adjustAlphaFBO.update(f,y,x);let C=o._translucentFBO.status===m,w=o._alphaFBO.status===m,A=o._adjustTranslucentFBO.status===m,E=o._adjustAlphaFBO.status===m;(!C||!w||!A||!E)&&(qtt(o),o._translucentMultipassSupport=!1,v=!1)}return v}fD.prototype.update=function(o,f,m,v,y){if(!this.isSupported())return;this._opaqueFBO=m,this._opaqueTexture=m.getColorTexture(0),this._depthStencilTexture=m.getDepthStencilTexture();let{width:x,height:C}=this._opaqueTexture,w=this._accumulationTexture,A=!N(w)||w.width!==x||w.height!==C||v!==this._useHDR,E=this._numSamples!==y;if((A||E)&&(this._numSamples=y,Wvi(this,o,x,C)),(!N(this._translucentFBO.framebuffer)||A||E)&&!jvi(this,o))return;this._useHDR=v;let T=this,S,M;N(this._compositeCommand)||(S=new Zr({sources:[WAe]}),this._translucentMRTSupport&&S.defines.push("MRT"),M={u_opaque:function(){return T._opaqueTexture},u_accumulation:function(){return T._accumulationTexture},u_revealage:function(){return T._revealageTexture}},this._compositeCommand=o.createViewportQuadCommand(S,{uniformMap:M,owner:this})),N(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(S=new Zr({defines:["MRT"],sources:[_te]}),M={u_bgColor:function(){return T._translucentMRTClearCommand.color},u_depthTexture:function(){return T._depthStencilTexture}},this._adjustTranslucentCommand=o.createViewportQuadCommand(S,{uniformMap:M,owner:this})):this._translucentMultipassSupport&&(S=new Zr({sources:[_te]}),M={u_bgColor:function(){return T._translucentMultipassClearCommand.color},u_depthTexture:function(){return T._depthStencilTexture}},this._adjustTranslucentCommand=o.createViewportQuadCommand(S,{uniformMap:M,owner:this}),M={u_bgColor:function(){return T._alphaClearCommand.color},u_depthTexture:function(){return T._depthStencilTexture}},this._adjustAlphaCommand=o.createViewportQuadCommand(S,{uniformMap:M,owner:this}))),this._viewport.width=x,this._viewport.height=C;let I=!Xr.equals(this._viewport,f.viewport),P=I!==this._useScissorTest;this._useScissorTest=I,Xr.equals(this._scissorRectangle,f.viewport)||(this._scissorRectangle=Xr.clone(f.viewport,this._scissorRectangle),P=!0),(!N(this._rs)||!Xr.equals(this._viewport,this._rs.viewport)||P)&&(this._rs=Mn.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),N(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),N(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Yvi={enabled:!0,color:new Re(0,0,0,0),equationRgb:Cv.ADD,equationAlpha:Cv.ADD,functionSourceRgb:Bh.ONE,functionDestinationRgb:Bh.ONE,functionSourceAlpha:Bh.ZERO,functionDestinationAlpha:Bh.ONE_MINUS_SOURCE_ALPHA},qvi={enabled:!0,color:new Re(0,0,0,0),equationRgb:Cv.ADD,equationAlpha:Cv.ADD,functionSourceRgb:Bh.ONE,functionDestinationRgb:Bh.ONE,functionSourceAlpha:Bh.ONE,functionDestinationAlpha:Bh.ONE},Xvi={enabled:!0,color:new Re(0,0,0,0),equationRgb:Cv.ADD,equationAlpha:Cv.ADD,functionSourceRgb:Bh.ZERO,functionDestinationRgb:Bh.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Bh.ZERO,functionDestinationAlpha:Bh.ONE_MINUS_SOURCE_ALPHA};function XTe(o,f,m,v){let y=m[v.id];if(!N(y)){let x=Mn.getState(v);x.depthMask=!1,x.blending=f,y=Mn.fromCache(x),m[v.id]=y}return y}function Jvi(o,f,m){return XTe(f,Yvi,o._translucentRenderStateCache,m)}function Kvi(o,f,m){return XTe(f,qvi,o._translucentRenderStateCache,m)}function Qvi(o,f,m){return XTe(f,Xvi,o._alphaRenderStateCache,m)}var Zvi=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragData_0 = vec4(Ci * wzi, ai); out_FragData_1 = vec4(ai * wzi); `,$vi=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragColor = vec4(Ci, ai) * wzi; `,eyi=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); `;function JTe(o,f,m,v){let{shaderCache:y}=o,x=y.getDerivedShaderProgram(f,m);if(N(x))return x;let C=f._attributeLocations,w=f.fragmentShaderSource.clone();w.sources=w.sources.map(function(T){return Zr.replaceMain(T,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),w.defines.push("TRANSLUCENT_PLANES"),w.sources.splice(0,0,`vec4 czm_out_FragColor; bool czm_discard = false; `);let A=[...v.matchAll(/out_FragData_(\d+)/g)],E="";for(let T=0;T<A.length;T++){let S=A[T];E=`layout (location = ${S[1]}) out vec4 ${S[0]}; ${E}`}return w.sources.push(E),w.sources.push(`void main() { czm_translucent_main(); if (czm_discard) { discard; } ${v}} `),y.createDerivedShaderProgram(f,m,{vertexShaderSource:f.vertexShaderSource,fragmentShaderSource:w,attributeLocations:C})}function tyi(o,f){return JTe(o,f,"translucentMRT",Zvi)}function iyi(o,f){return JTe(o,f,"translucentMultipass",$vi)}function ryi(o,f){return JTe(o,f,"alphaMultipass",eyi)}fD.prototype.createDerivedCommands=function(o,f,m){if(N(m)||(m={}),this._translucentMRTSupport){let w,A;return N(m.translucentCommand)&&(w=m.translucentCommand.shaderProgram,A=m.translucentCommand.renderState),m.translucentCommand=Jn.shallowClone(o,m.translucentCommand),!N(w)||m.shaderProgramId!==o.shaderProgram.id?(m.translucentCommand.shaderProgram=tyi(f,o.shaderProgram),m.translucentCommand.renderState=Jvi(this,f,o.renderState),m.shaderProgramId=o.shaderProgram.id):(m.translucentCommand.shaderProgram=w,m.translucentCommand.renderState=A),m}let v,y,x,C;return N(m.translucentCommand)&&(v=m.translucentCommand.shaderProgram,y=m.translucentCommand.renderState,x=m.alphaCommand.shaderProgram,C=m.alphaCommand.renderState),m.translucentCommand=Jn.shallowClone(o,m.translucentCommand),m.alphaCommand=Jn.shallowClone(o,m.alphaCommand),!N(v)||m.shaderProgramId!==o.shaderProgram.id?(m.translucentCommand.shaderProgram=iyi(f,o.shaderProgram),m.translucentCommand.renderState=Kvi(this,f,o.renderState),m.alphaCommand.shaderProgram=ryi(f,o.shaderProgram),m.alphaCommand.renderState=Qvi(this,f,o.renderState),m.shaderProgramId=o.shaderProgram.id):(m.translucentCommand.shaderProgram=v,m.translucentCommand.renderState=y,m.alphaCommand.shaderProgram=x,m.alphaCommand.renderState=C),m};function nyi(o,f,m,v,y,x){let C,w,A,{context:E,frameState:T}=f,{useLogDepth:S,shadowState:M}=T,I=f._hdr,P=v.framebuffer,D=M.lightShadowsEnabled;v.framebuffer=o._adjustTranslucentFBO.framebuffer,o._adjustTranslucentCommand.execute(E,v),v.framebuffer=o._adjustAlphaFBO.framebuffer,o._adjustAlphaCommand.execute(E,v);let L=o._opaqueFBO.framebuffer;for(v.framebuffer=o._translucentFBO.framebuffer,A=0;A<y.length;++A)C=y[A],C=S?C.derivedCommands.logDepth.command:C,C=I?C.derivedCommands.hdr.command:C,w=D&&C.receiveShadows?C.derivedCommands.oit.shadows.translucentCommand:C.derivedCommands.oit.translucentCommand,m(w,f,E,v,L);for(N(x)&&(C=x.unclassifiedCommand,w=D&&C.receiveShadows?C.derivedCommands.oit.shadows.translucentCommand:C.derivedCommands.oit.translucentCommand,m(w,f,E,v,L)),v.framebuffer=o._alphaFBO.framebuffer,A=0;A<y.length;++A)C=y[A],C=S?C.derivedCommands.logDepth.command:C,C=I?C.derivedCommands.hdr.command:C,w=D&&C.receiveShadows?C.derivedCommands.oit.shadows.alphaCommand:C.derivedCommands.oit.alphaCommand,m(w,f,E,v,L);N(x)&&(C=x.unclassifiedCommand,w=D&&C.receiveShadows?C.derivedCommands.oit.shadows.alphaCommand:C.derivedCommands.oit.alphaCommand,m(w,f,E,v,L)),v.framebuffer=P}function oyi(o,f,m,v,y,x){let{context:C,frameState:w}=f,{useLogDepth:A,shadowState:E,textureProjecitonHints:T}=w,S=f._hdr,M=v.framebuffer,I=E.lightShadowsEnabled;v.framebuffer=o._adjustTranslucentFBO.framebuffer,o._adjustTranslucentCommand.execute(C,v);let P=o._opaqueFBO.framebuffer;v.framebuffer=o._translucentFBO.framebuffer;let D,L;for(let R=0;R<y.length;++R)D=y[R],D=A?D.derivedCommands.logDepth.command:D,D=S?D.derivedCommands.hdr.command:D,L=I&&D.receiveShadows?D.derivedCommands.oit.shadows.translucentCommand:D.derivedCommands.oit.translucentCommand,m(L,f,C,v,P),D.derivedCommands.oit.perspectivesWithDepth&&T.lightShadowsEnabled&&D.receiveShadows&&(L=D.derivedCommands.oit.perspectivesWithDepth.translucentCommand,m(L,f,C,v,P));N(x)&&(D=x.unclassifiedCommand,L=I&&D.receiveShadows?D.derivedCommands.oit.shadows.translucentCommand:D.derivedCommands.oit.translucentCommand,m(L,f,C,v,P),D.derivedCommands.oit.perspectivesWithDepth&&T.lightShadowsEnabled&&D.receiveShadows&&(L=D.derivedCommands.oit.perspectivesWithDepth.translucentCommand,m(L,f,C,v,P))),v.framebuffer=M}fD.prototype.executeCommands=function(o,f,m,v,y){if(this._translucentMRTSupport){oyi(this,o,f,m,v,y);return}nyi(this,o,f,m,v,y)};fD.prototype.execute=function(o,f){this._compositeCommand.execute(o,f)};fD.prototype.clear=function(o,f,m){let v=f.framebuffer;f.framebuffer=this._opaqueFBO.framebuffer,Re.clone(m,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(o,f),f.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(o,f),this._translucentMultipassSupport&&(f.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(o,f)),f.framebuffer=v};fD.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};fD.prototype.isDestroyed=function(){return!1};fD.prototype.destroy=function(){return qtt(this),N(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),N(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),N(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),kr(this)};var KTe=fD;function Vq(){this._framebuffer=new $h({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(Vq.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ayi(o){o._framebuffer.destroy()}function syi(o,f){let m=f.drawingBufferWidth,v=f.drawingBufferHeight;o._framebuffer.update(f,m,v);let y=new Kg(f);y.blendingEnabled=!1,y.scissorTest={enabled:!0,rectangle:new Xr},y.viewport=new Xr,o._passState=y}Vq.prototype.update=function(o,f,m){let v=m.width,y=m.height;this._framebuffer.isDirty(v,y)&&syi(this,o);let x=this.framebuffer,C=this._passState;return C.framebuffer=x,C.viewport.width=v,C.viewport.height=y,C.scissorTest.rectangle.x=f.x,C.scissorTest.rectangle.y=y-f.y,C.scissorTest.rectangle.width=1,C.scissorTest.rectangle.height=1,C};Vq.prototype.isDestroyed=function(){return!1};Vq.prototype.destroy=function(){return ayi(this),kr(this)};var QTe=Vq;function zq(o){let f=new Kg(o);f.blendingEnabled=!1,f.scissorTest={enabled:!0,rectangle:new Xr},f.viewport=new Xr,this._context=o,this._fb=new $h({depthStencil:!0}),this._passState=f,this._width=0,this._height=0}zq.prototype.begin=function(o,f){let m=this._context,v=f.width,y=f.height;return Xr.clone(o,this._passState.scissorTest.rectangle),this._width=v,this._height=y,this._fb.update(m,v,y),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=v,this._passState.viewport.height=y,this._passState};var r7=new Re;zq.prototype.end=function(o){let f=Z(o.width,1),m=Z(o.height,1),v=this._context,y=v.readPixels({x:o.x,y:o.y,width:f,height:m,framebuffer:this._fb.framebuffer}),x=Math.max(f,m),C=x*x,w=Math.floor(f*.5),A=Math.floor(m*.5),E=0,T=0,S=0,M=-1;for(let I=0;I<C;++I){if(-w<=E&&E<=w&&-A<=T&&T<=A){let P=4*((A-T)*f+E+w);r7.red=Re.byteToFloat(y[P]),r7.green=Re.byteToFloat(y[P+1]),r7.blue=Re.byteToFloat(y[P+2]),r7.alpha=Re.byteToFloat(y[P+3]);let D=v.getObjectByPickColor(r7);if(N(D))return D}if(E===T||E<0&&-E===T||E>0&&E===1-T){let P=S;S=-M,M=P}E+=S,T+=M}};zq.prototype.isDestroyed=function(){return!1};zq.prototype.destroy=function(){return this._fb.destroy(),kr(this)};var ZTe=zq;function pD(){this._numSamples=1,this._colorFramebuffer=new $h({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new $h({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new Re(0,0,0,0),this._clearCommand=new Gc({color:new Re(0,0,0,0),depth:1,owner:this})}function lyi(o){o._colorFramebuffer.destroy(),o._idFramebuffer.destroy()}Object.defineProperties(pD.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});pD.prototype.update=function(o,f,m,v){let y=f.width,x=f.height,C=m?o.halfFloatingPointTexture?Rn.HALF_FLOAT:Rn.FLOAT:Rn.UNSIGNED_BYTE;this._numSamples=v,this._colorFramebuffer.update(o,y,x,v,C),this._idFramebuffer.update(o,y,x)};pD.prototype.clear=function(o,f,m){Re.clone(m,this._clearCommand.color),Re.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(o,this._clearCommand,f),this._idFramebuffer.clear(o,this._clearCommand,f)};pD.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};pD.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};pD.prototype.prepareColorTextures=function(o){this._numSamples>1&&this._colorFramebuffer.prepareTextures(o)};pD.prototype.isDestroyed=function(){return!1};pD.prototype.destroy=function(){return lyi(this),kr(this)};var Roe=pD;function KB(){}KB.getShadowCastShaderKeyword=function(o,f,m,v){return`castShadow ${o} ${f} ${m} ${v}`};KB.createShadowCastVertexShader=function(o,f,m){let v=o.defines.slice(0),y=o.sources.slice(0);v.push("SHADOW_MAP"),m&&v.push("GENERATE_POSITION");let x=Zr.findPositionVarying(o),C=N(x);if(f&&!C){let w=y.length;for(let E=0;E<w;++E)y[E]=Zr.replaceMain(y[E],"czm_shadow_cast_main");let A=`out vec3 v_positionEC; void main() { czm_shadow_cast_main(); v_positionEC = (czm_inverseProjection * gl_Position).xyz; }`;y.push(A)}return new Zr({defines:v,sources:y})};KB.createShadowCastFragmentShader=function(o,f,m,v){let y=o.defines.slice(0),x=o.sources.slice(0);y.push("SHADOW_MAP");let C=Zr.findPositionVarying(o),w=N(C);w||(C="v_positionEC");let A=x.length;for(let T=0;T<A;++T)x[T]=Zr.replaceMain(x[T],"czm_shadow_cast_main");let E="";return f&&(w||(E+=`in vec3 v_positionEC; `),E+=`uniform vec4 shadowMap_lightPositionEC; `),v?E+=`void main() { `:E+=`void main() { czm_shadow_cast_main(); if (out_FragColor.a == 0.0) { discard; } `,f?E+=` float distance = length(${C}); if (distance >= shadowMap_lightPositionEC.w) { discard; } distance /= shadowMap_lightPositionEC.w; // radius out_FragColor = czm_packDepth(distance); `:m?E+=` out_FragColor = vec4(1.0); `:E+=` out_FragColor = czm_packDepth(gl_FragCoord.z); `,E+=`} `,x.push(E),new Zr({defines:y,sources:x})};KB.getShadowReceiveShaderKeyword=function(o,f,m,v){let y=o._usesDepthTexture,x=o._polygonOffsetSupported,C=o._isPointLight,w=o._isSpotLight,A=o._numberOfCascades>1,E=o.debugCascadeColors,T=o.softShadows;return`receiveShadow ${y}${x}${C}${w}${A}${E}${T}${f}${m}${v}`};KB.createShadowReceiveVertexShader=function(o,f,m){let v=o.defines.slice(0),y=o.sources.slice(0);return v.push("SHADOW_MAP"),f&&(m?v.push("GENERATE_POSITION_AND_NORMAL"):v.push("GENERATE_POSITION")),new Zr({defines:v,sources:y})};KB.createShadowReceiveFragmentShader=function(o,f,m,v,y){let x=Zr.findNormalVarying(o),C=!v&&N(x)||v&&y,w=Zr.findPositionVarying(o),A=N(w),E=f._usesDepthTexture,T=f._polygonOffsetSupported,S=f._isPointLight,M=f._isSpotLight,I=f._numberOfCascades>1,P=f.debugCascadeColors,D=f.softShadows,L=S?f._pointBias:v?f._terrainBias:f._primitiveBias,R=o.defines.slice(0),O=o.sources.slice(0),F=O.length;for(let G=0;G<F;++G)O[G]=Zr.replaceMain(O[G],"czm_shadow_receive_main");S?R.push("USE_CUBE_MAP_SHADOW"):E&&R.push("USE_SHADOW_DEPTH_TEXTURE"),D&&!S&&R.push("USE_SOFT_SHADOWS"),I&&m&&v&&(C?R.push("ENABLE_VERTEX_LIGHTING"):R.push("ENABLE_DAYNIGHT_SHADING")),m&&L.normalShading&&C&&(R.push("USE_NORMAL_SHADING"),L.normalShadingSmooth>0&&R.push("USE_NORMAL_SHADING_SMOOTH"));let k="";k+=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif `,S?k+=`uniform samplerCube shadowMap_textureCube; `:k+=`uniform sampler2D shadowMap_texture; `;let U;return A?U=` return vec4(${w}, 1.0); `:U=`#ifndef LOG_DEPTH return czm_windowToEyeCoordinates(gl_FragCoord); #else return vec4(v_logPositionEC, 1.0); #endif `,k+=`uniform bool u_isSun; uniform bool u_isVisible; uniform bool u_isB3dm; uniform bool u_isPreviewMode; uniform bool u_viewshedCalculateNormals; uniform float shadowMap_horizonCullingDistance; uniform bool u_isBelowGround; uniform mat4 shadowMap_matrix; uniform vec3 shadowMap_lightDirectionEC; uniform vec3 shadowMap_viewshed_Back; uniform vec3 shadowMap_viewshed_Fore; uniform vec3 shadowMap_color; uniform vec4 shadowMap_lightPositionEC; uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; bool isTerrain = false; #ifdef LOG_DEPTH in vec3 v_logPositionEC; #endif vec4 getPositionEC() { ${U}} vec3 getNormalEC() { ${C?` return normalize(${x}); `:` return vec3(1.0); `}} void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL) { ${L.normalOffset&&C?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x; float normalOffsetScale = 1.0 - nDotL; vec3 offset = normalOffset * normalOffsetScale * normalEC; positionEC.xyz += offset; `:""}} `,k+=`void main() { czm_shadow_receive_main(); vec4 positionEC = getPositionEC(); vec3 normalEC = getNormalEC(); float distanceFromLight = 0.; float maxDistanceForColoring = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.y; float depth = -positionEC.z; `,k+=` czm_shadowParameters shadowParameters; shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; `,v?(M?k+=` vec3 ffy = dFdy(positionEC.xyz); vec3 ffx = dFdx(positionEC.xyz); normalEC = normalize(cross(ffx,ffy)); distanceFromLight = length(positionEC.xyz - shadowMap_lightPositionEC.xyz); shadowParameters.depthBias *= max(distanceFromLight * 0.01, 1.0); `:k+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); `,k+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0); `):T||(k+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015); `),S?k+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; float distance = length(directionEC); directionEC = normalize(directionEC); float radius = shadowMap_lightPositionEC.w; // Stop early if the fragment is beyond the point light radius if (distance > radius) { return; } vec3 directionWC = czm_inverseViewRotation * directionEC; shadowParameters.depth = distance / radius; shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); shadowParameters.texCoords = directionWC; float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters); `:M?k+=` if (u_isB3dm && u_viewshedCalculateNormals){ vec3 nffy = dFdy(positionEC.xyz); vec3 nffx = dFdx(positionEC.xyz); normalEC = normalize(cross(nffx,nffy)); } vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); vec4 shadowPosition = shadowMap_matrix * positionEC; // Spot light uses a perspective projection, so perform the perspective divide shadowPosition /= shadowPosition.w; // Stop early if the fragment is not in the shadow bounds if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { return; } shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `:I?k+=` float maxDepth = shadowMap_cascadeSplits[1].w; // Stop early if the eye depth exceeds the last cascade if (depth > maxDepth) { return; } // Get the cascade based on the eye-space depth vec4 weights = czm_cascadeWeights(depth); // Apply normal offset float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); // Transform position into the cascade vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; // Get visibility shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); // Fade out shadows that are far away float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); visibility = mix(visibility, 1.0, fade); ${P?` // Draw cascade colors for debugging out_FragColor *= czm_cascadeColor(weights); `:""}`:k+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0); applyNormalOffset(positionEC, normalEC, nDotL); vec4 shadowPosition = shadowMap_matrix * positionEC; // Stop early if the fragment is not in the shadow bounds if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { return; } shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,k+=` if (u_isSun){ ; out_FragColor.rgb = mix(shadowMap_color,out_FragColor.rgb,visibility); } else if (!u_isVisible) { out_FragColor.rgba = vec4(out_FragColor.rgb,0.); } else if (u_isPreviewMode) { out_FragColor.rgba = vec4(out_FragColor.rgb * 0.85 + 0.15 * mix(vec3(1.0, 0.0, 0.0), vec3(0.0, 1.0, 0.0), 1.-step(visibility,0.5)),1.); } else { out_FragColor.rgba = vec4(out_FragColor.rgb * 0.6 + 0.4 * mix(shadowMap_viewshed_Back, shadowMap_viewshed_Fore, 1.-step(visibility,0.5)),1.); } } `,O.push(k),new Zr({defines:R,sources:O})};var p3=KB;function pP(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.context;this._enabled=Z(o.enabled,!0),this._softShadows=Z(o.softShadows,!1),this._normalOffset=Z(o.normalOffset,!0),this.dirty=!0,this.fromLightSource=Z(o.fromLightSource,!0),this.darkness=Z(o.darkness,.3),this._darkness=this.darkness,this.fadingEnabled=Z(o.fadingEnabled,!0),this.maximumDistance=Z(o.maximumDistance,5e3),this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let m=!0;(pa.isInternetExplorer()||pa.isEdge()||(pa.isChrome()||pa.isFirefox())&&pa.isWindows()&&!f.depthTexture)&&(m=!1),this._polygonOffsetSupported=m,this._terrainBias={polygonOffset:m,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:m,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new Ee,this._shadowMapTexture=void 0,this._lightDirectionEC=new H,this._lightPositionEC=new Wt,this._distance=0,this._lightCamera=o.lightCamera,this._shadowMapCamera=new Ooe,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new Pi,this._isPointLight=Z(o.isPointLight,!1),this._pointLightRadius=Z(o.pointLightRadius,100),this._cascadesEnabled=this._isPointLight?!1:Z(o.cascadesEnabled,!0),this._numberOfCascades=this._cascadesEnabled?Z(o.numberOfCascades,4):0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new Ye,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Pm:N(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new Wt,new Wt],this._cascadeMatrices=[new Ee,new Ee,new Ee,new Ee],this._cascadeDistances=new Wt;let v;this._isPointLight?v=6:this._cascadesEnabled?v=this._numberOfCascades:v=1,this._passes=new Array(v);for(let y=0;y<v;++y)this._passes[y]=new uyi(f);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=f.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,$Te(this),this._clearCommand=new Gc({depth:1,color:new Re}),this._clearPassState=new Kg(f),this._size=Z(o.size,2048),this.size=this._size}pP.MAXIMUM_DISTANCE=2e4;function uyi(o){this.camera=new Ooe,this.passState=new Kg(o),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function epe(o,f){return Mn.fromCache({cull:{enabled:!0,face:uh.BACK},depthTest:{enabled:!0},colorMask:{red:o,green:o,blue:o,alpha:o},depthMask:!0,polygonOffset:{enabled:f.polygonOffset,factor:f.polygonOffsetFactor,units:f.polygonOffsetUnits}})}function $Te(o){let f=!o._usesDepthTexture;o._primitiveRenderState=epe(f,o._primitiveBias),o._terrainRenderState=epe(f,o._terrainBias),o._pointRenderState=epe(f,o._pointBias)}pP.prototype.debugCreateRenderStates=function(){$Te(this)};Object.defineProperties(pP.prototype,{enabled:{get:function(){return this._enabled},set:function(o){this.dirty=this._enabled!==o,this._enabled=o}},normalOffset:{get:function(){return this._normalOffset},set:function(o){this.dirty=this._normalOffset!==o,this._normalOffset=o,this._terrainBias.normalOffset=o,this._primitiveBias.normalOffset=o,this._pointBias.normalOffset=o}},softShadows:{get:function(){return this._softShadows},set:function(o){this.dirty=this._softShadows!==o,this._softShadows=o}},size:{get:function(){return this._size},set:function(o){myi(this,o)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(o){this.dirty=this._debugCascadeColors!==o,this._debugCascadeColors=o}}});function eSe(o){let f=o._passes.length;for(let m=0;m<f;++m){let v=o._passes[m],y=v.framebuffer;N(y)&&!y.isDestroyed()&&y.destroy(),v.framebuffer=void 0}o._depthAttachment=o._depthAttachment&&o._depthAttachment.destroy(),o._colorAttachment=o._colorAttachment&&o._colorAttachment.destroy()}function Xtt(){return new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.NEAREST,magnificationFilter:Zu.NEAREST})}function cyi(o,f){let m=new N1({context:f,width:o._textureSize.x,height:o._textureSize.y,format:aC.DEPTH_COMPONENT16}),v=new _o({context:f,width:o._textureSize.x,height:o._textureSize.y,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,sampler:Xtt()}),y=new dg({context:f,depthRenderbuffer:m,colorTextures:[v],destroyAttachments:!1}),x=o._passes.length;for(let C=0;C<x;++C){let w=o._passes[C];w.framebuffer=y,w.passState.framebuffer=y}o._shadowMapTexture=v,o._depthAttachment=m,o._colorAttachment=v}function hyi(o,f){let m=new _o({context:f,width:o._textureSize.x,height:o._textureSize.y,pixelFormat:Nn.DEPTH_STENCIL,pixelDatatype:Rn.UNSIGNED_INT_24_8,sampler:Xtt()}),v=new dg({context:f,depthStencilTexture:m,destroyAttachments:!1}),y=o._passes.length;for(let x=0;x<y;++x){let C=o._passes[x];C.framebuffer=v,C.passState.framebuffer=v}o._shadowMapTexture=m,o._depthAttachment=m}function dyi(o,f){let m=new N1({context:f,width:o._textureSize.x,height:o._textureSize.y,format:aC.DEPTH_COMPONENT16}),v=new lT({context:f,width:o._textureSize.x,height:o._textureSize.y,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,sampler:gs.NEAREST}),y=[v.negativeX,v.negativeY,v.negativeZ,v.positiveX,v.positiveY,v.positiveZ];for(let x=0;x<6;++x){let C=new dg({context:f,depthRenderbuffer:m,colorTextures:[y[x]],destroyAttachments:!1}),w=o._passes[x];w.framebuffer=C,w.passState.framebuffer=C}o._shadowMapTexture=v,o._depthAttachment=m,o._colorAttachment=v}function Jtt(o,f){o._isPointLight?dyi(o,f):o._usesDepthTexture?hyi(o,f):cyi(o,f)}function fyi(o,f){o._usesDepthTexture&&o._passes[0].framebuffer.status!==xi.FRAMEBUFFER_COMPLETE&&(o._usesDepthTexture=!1,$Te(o),eSe(o),Jtt(o,f))}function pyi(o,f){(!N(o._passes[0].framebuffer)||o._shadowMapTexture.width!==o._textureSize.x)&&(eSe(o),Jtt(o,f),fyi(o,f),Ktt(o,f))}function Ktt(o,f,m){m=Z(m,0),(o._isPointLight||m===0)&&(o._clearCommand.framebuffer=o._passes[m].framebuffer,o._clearCommand.execute(f,o._clearPassState))}function myi(o,f){o._size=f;let m=o._passes,v=m.length,y=o._textureSize;if(o._isPointLight){f=Bo.maximumCubeMapSize>=f?f:Bo.maximumCubeMapSize,y.x=f,y.y=f;let x=new Xr(0,0,f,f);m[0].passState.viewport=x,m[1].passState.viewport=x,m[2].passState.viewport=x,m[3].passState.viewport=x,m[4].passState.viewport=x,m[5].passState.viewport=x}else v===1?(f=Bo.maximumTextureSize>=f?f:Bo.maximumTextureSize,y.x=f,y.y=f,m[0].passState.viewport=new Xr(0,0,f,f)):v===4&&(f=Bo.maximumTextureSize>=f*2?f:Bo.maximumTextureSize/2,y.x=f*2,y.y=f*2,m[0].passState.viewport=new Xr(0,0,f,f),m[1].passState.viewport=new Xr(f,0,f,f),m[2].passState.viewport=new Xr(0,f,f,f),m[3].passState.viewport=new Xr(f,f,f,f));o._clearPassState.viewport=new Xr(0,0,y.x,y.y);for(let x=0;x<v;++x){let C=m[x],w=C.passState.viewport,A=w.x/y.x,E=w.y/y.y,T=w.width/y.x,S=w.height/y.y;C.textureOffsets=new Ee(T,0,0,A,0,S,0,E,0,0,1,0,0,0,0,1)}}var gyi=new Xr;function _yi(o,f){let m;o._isPointLight?m=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { vec2 uv = v_textureCoordinates; vec3 dir; if (uv.y < 0.5) { if (uv.x < 0.333) { dir.x = -1.0; dir.y = uv.x * 6.0 - 1.0; dir.z = uv.y * 4.0 - 1.0; } else if (uv.x < 0.666) { dir.y = -1.0; dir.x = uv.x * 6.0 - 3.0; dir.z = uv.y * 4.0 - 1.0; } else { dir.z = -1.0; dir.x = uv.x * 6.0 - 5.0; dir.y = uv.y * 4.0 - 1.0; } } else { if (uv.x < 0.333) { dir.x = 1.0; dir.y = uv.x * 6.0 - 1.0; dir.z = uv.y * 4.0 - 3.0; } else if (uv.x < 0.666) { dir.y = 1.0; dir.x = uv.x * 6.0 - 3.0; dir.z = uv.y * 4.0 - 3.0; } else { dir.z = 1.0; dir.x = uv.x * 6.0 - 5.0; dir.y = uv.y * 4.0 - 3.0; } } float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir)); out_FragColor = vec4(vec3(shadow), 1.0); } `:m=`uniform sampler2D shadowMap_texture; in vec2 v_textureCoordinates; void main() { ${o._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r; `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); `} out_FragColor = vec4(vec3(shadow), 1.0); } `;let v=f.createViewportQuadCommand(m,{uniformMap:{shadowMap_texture:function(){return o._shadowMapTexture},shadowMap_textureCube:function(){return o._shadowMapTexture}}});return v.pass=vr.OVERLAY,v}function vyi(o,f){let m=f.context,v=f.context.drawingBufferWidth,y=f.context.drawingBufferHeight,x=Math.min(v,y)*.3,C=gyi;C.x=v-x,C.y=0,C.width=x,C.height=x;let w=o._debugShadowViewCommand;N(w)||(w=_yi(o,m),o._debugShadowViewCommand=w),(!N(w.renderState)||!Xr.equals(w.renderState.viewport,C))&&(w.renderState=Mn.fromCache({viewport:Xr.clone(C)})),f.commandList.push(o._debugShadowViewCommand)}var mP=new Array(8);mP[0]=new Wt(-1,-1,-1,1);mP[1]=new Wt(1,-1,-1,1);mP[2]=new Wt(1,1,-1,1);mP[3]=new Wt(-1,1,-1,1);mP[4]=new Wt(-1,-1,1,1);mP[5]=new Wt(1,-1,1,1);mP[6]=new Wt(1,1,1,1);mP[7]=new Wt(-1,1,1,1);var YR=new Ee,tSe=new Array(8);for(let o=0;o<8;++o)tSe[o]=new Wt;function yyi(o,f){let m=new co({geometry:new X2({minimum:new H(-.5,-.5,-.5),maximum:new H(.5,.5,.5)}),attributes:{color:ea.fromColor(f)}}),v=new co({geometry:new YM({radius:.5}),attributes:{color:ea.fromColor(f)}});return new Ia({geometryInstances:[m,v],appearance:new ms({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:o})}var xyi=[Re.RED,Re.GREEN,Re.BLUE,Re.MAGENTA],Cyi=new H;function byi(o,f){vyi(o,f);let m=o.debugFreezeFrame&&!o._debugFreezeFrame;if(o._debugFreezeFrame=o.debugFreezeFrame,o.debugFreezeFrame&&(m&&(o._debugCameraFrustum=o._debugCameraFrustum&&o._debugCameraFrustum.destroy(),o._debugCameraFrustum=new Ap({camera:o._sceneCamera,color:Re.CYAN,updateOnChange:!1})),o._debugCameraFrustum.update(f)),o._cascadesEnabled){if(o.debugFreezeFrame){m&&(o._debugLightFrustum=o._debugLightFrustum&&o._debugLightFrustum.destroy(),o._debugLightFrustum=new Ap({camera:o._shadowMapCamera,color:Re.YELLOW,updateOnChange:!1})),o._debugLightFrustum.update(f);for(let v=0;v<o._numberOfCascades;++v)m&&(o._debugCascadeFrustums[v]=o._debugCascadeFrustums[v]&&o._debugCascadeFrustums[v].destroy(),o._debugCascadeFrustums[v]=new Ap({camera:o._passes[v].camera,color:xyi[v],updateOnChange:!1})),o._debugCascadeFrustums[v].update(f)}}else if(o._isPointLight){if(!N(o._debugLightFrustum)||o._needsUpdate){let v=o._shadowMapCamera.positionWC,y=Gr.IDENTITY,x=o._pointLightRadius*2,C=H.fromElements(x,x,x,Cyi),w=Ee.fromTranslationQuaternionRotationScale(v,y,C,YR);o._debugLightFrustum=o._debugLightFrustum&&o._debugLightFrustum.destroy(),o._debugLightFrustum=yyi(w,Re.YELLOW)}o._debugLightFrustum.update(f)}else(!N(o._debugLightFrustum)||o._needsUpdate)&&(o._debugLightFrustum=new Ap({camera:o._shadowMapCamera,color:Re.YELLOW,updateOnChange:!1})),o._debugLightFrustum.update(f)}function Ooe(){this.viewMatrix=new Ee,this.inverseViewMatrix=new Ee,this.frustum=void 0,this.positionCartographic=new Mt,this.positionWC=new H,this.directionWC=H.clone(H.UNIT_Z),this.upWC=H.clone(H.UNIT_Y),this.rightWC=H.clone(H.UNIT_X),this.viewProjectionMatrix=new Ee}Ooe.prototype.clone=function(o){Ee.clone(o.viewMatrix,this.viewMatrix),Ee.clone(o.inverseViewMatrix,this.inverseViewMatrix),this.frustum=o.frustum.clone(this.frustum),Mt.clone(o.positionCartographic,this.positionCartographic),H.clone(o.positionWC,this.positionWC),H.clone(o.directionWC,this.directionWC),H.clone(o.upWC,this.upWC),H.clone(o.rightWC,this.rightWC)};var wyi=new Ee(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);Ooe.prototype.getViewProjection=function(){let o=this.viewMatrix,f=this.frustum.projectionMatrix;return Ee.multiply(f,o,this.viewProjectionMatrix),Ee.multiply(wyi,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ayi=new Array(5),Eyi=new pc,Tyi=new Array(4),Qtt=new H,Ztt=new H;function Syi(o,f){let m=o._shadowMapCamera,v=o._sceneCamera,y=v.frustum.near,x=v.frustum.far,C=o._numberOfCascades,w,A=x-y,E=x/y,T=.9,S=!1;f.shadowState.closestObjectSize<200&&(S=!0,T=.9);let M=Tyi,I=Ayi;for(I[0]=y,I[C]=x,w=0;w<C;++w){let X=(w+1)/C,Y=y*Math.pow(E,X),Q=y+A*X,ee=xe.lerp(Q,Y,T);I[w+1]=ee,M[w]=ee-I[w]}if(S){for(w=0;w<C;++w)M[w]=Math.min(M[w],o._maximumCascadeDistances[w]);let X=I[0];for(w=0;w<C-1;++w)X+=M[w],I[w+1]=X}Wt.unpack(I,0,o._cascadeSplits[0]),Wt.unpack(I,1,o._cascadeSplits[1]),Wt.unpack(M,0,o._cascadeDistances);let P=m.frustum,D=P.left,L=P.right,R=P.bottom,O=P.top,F=P.near,k=P.far,U=m.positionWC,G=m.directionWC,j=m.upWC,q=v.frustum.clone(Eyi),J=m.getViewProjection();for(w=0;w<C;++w){q.near=I[w],q.far=I[w+1];let X=Ee.multiply(q.projectionMatrix,v.viewMatrix,YR),Y=Ee.inverse(X,YR),Q=Ee.multiply(J,Y,YR),ee=H.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Qtt),z=H.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ztt);for(let se=0;se<8;++se){let ae=Wt.clone(mP[se],tSe[se]);Ee.multiplyByVector(Q,ae,ae),H.divideByScalar(ae,ae.w,ae),H.minimumByComponent(ae,ee,ee),H.maximumByComponent(ae,z,z)}ee.x=Math.max(ee.x,0),ee.y=Math.max(ee.y,0),ee.z=0,z.x=Math.min(z.x,1),z.y=Math.min(z.y,1),z.z=Math.min(z.z,1);let ie=o._passes[w],re=ie.camera;re.clone(m);let ne=re.frustum;ne.left=D+ee.x*(L-D),ne.right=D+z.x*(L-D),ne.bottom=R+ee.y*(O-R),ne.top=R+z.y*(O-R),ne.near=F+ee.z*(k-F),ne.far=F+z.z*(k-F),ie.cullingVolume=re.frustum.computeCullingVolume(U,G,j);let oe=o._cascadeMatrices[w];Ee.multiply(re.getViewProjection(),v.inverseViewMatrix,oe),Ee.multiply(ie.textureOffsets,oe,oe)}}var Pyi=new Ee,Iyi=new H,Myi=new H,SUe=new H;function Dyi(o,f){let m=o._shadowMapCamera,v=o._sceneCamera,y=Ee.multiply(v.frustum.projectionMatrix,v.viewMatrix,YR),x=Ee.inverse(y,YR),C=m.directionWC,w=v.directionWC;H.equalsEpsilon(C,w,xe.EPSILON10)&&(w=v.upWC);let A=H.cross(C,w,Iyi);w=H.cross(A,C,Myi),H.normalize(w,w),H.normalize(A,A);let E=H.fromElements(0,0,0,SUe),T=Ee.computeView(E,C,w,A,Pyi),S=Ee.multiply(T,x,YR),M=H.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Qtt),I=H.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Ztt);for(let k=0;k<8;++k){let U=Wt.clone(mP[k],tSe[k]);Ee.multiplyByVector(S,U,U),H.divideByScalar(U,U.w,U),H.minimumByComponent(U,M,M),H.maximumByComponent(U,I,I)}I.z+=1e3,M.z-=10;let P=SUe;P.x=-(.5*(M.x+I.x)),P.y=-(.5*(M.y+I.y)),P.z=-I.z;let D=Ee.fromTranslation(P,YR);T=Ee.multiply(D,T,T);let L=.5*(I.x-M.x),R=.5*(I.y-M.y),O=I.z-M.z,F=m.frustum;F.left=-L,F.right=L,F.bottom=-R,F.top=R,F.near=.01,F.far=O,Ee.clone(T,m.viewMatrix),Ee.inverse(T,m.inverseViewMatrix),Ee.getTranslation(m.inverseViewMatrix,m.positionWC),f.mapProjection.ellipsoid.cartesianToCartographic(m.positionWC,m.positionCartographic),H.clone(C,m.directionWC),H.clone(w,m.upWC),H.clone(A,m.rightWC)}var Lyi=[new H(-1,0,0),new H(0,-1,0),new H(0,0,-1),new H(1,0,0),new H(0,1,0),new H(0,0,1)],Ryi=[new H(0,-1,0),new H(0,0,-1),new H(0,-1,0),new H(0,-1,0),new H(0,0,1),new H(0,-1,0)],Oyi=[new H(0,0,1),new H(1,0,0),new H(-1,0,0),new H(0,0,-1),new H(1,0,0),new H(1,0,0)];function Nyi(o,f){let m=new pc;m.fov=xe.PI_OVER_TWO,m.near=1,m.far=o._pointLightRadius,m.aspectRatio=1;for(let v=0;v<6;++v){let y=o._passes[v].camera;y.positionWC=o._shadowMapCamera.positionWC,y.positionCartographic=f.mapProjection.ellipsoid.cartesianToCartographic(y.positionWC,y.positionCartographic),y.directionWC=Lyi[v],y.upWC=Ryi[v],y.rightWC=Oyi[v],Ee.computeView(y.positionWC,y.directionWC,y.upWC,y.rightWC,y.viewMatrix),Ee.inverse(y.viewMatrix,y.inverseViewMatrix),y.frustum=m}}var Fyi=new H,Byi=new H,$tt=new Pi,PUe=$tt.center;function kyi(o,f){let m=o._sceneCamera,v=o._shadowMapCamera,y=$tt;if(o._cascadesEnabled){if(m.frustum.near>=o.maximumDistance){o._outOfView=!0,o._needsUpdate=!1;return}let x=f.mapProjection.ellipsoid.geodeticSurfaceNormal(m.positionWC,Fyi),C=H.negate(v.directionWC,Byi),w=H.dot(x,C);if(o.fadingEnabled){let A=xe.clamp(w/.1,0,1);o._darkness=xe.lerp(1,o.darkness,A)}else o._darkness=o.darkness;if(w<0){o._outOfView=!0,o._needsUpdate=!1;return}o._needsUpdate=!0,o._outOfView=!1}else if(o._isPointLight)y.center=v.positionWC,y.radius=o._pointLightRadius,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere);else{let x=v.frustum.far/2,C=H.add(v.positionWC,H.multiplyByScalar(v.directionWC,x,PUe),PUe);y.center=C,y.radius=x,o._outOfView=f.cullingVolume.computeVisibility(y)===La.OUTSIDE,o._needsUpdate=!o._outOfView&&!o._boundingSphere.equals(y),Pi.clone(y,o._boundingSphere)}}function Vyi(o,f){let m=f.camera,v=o._lightCamera,y=o._sceneCamera,x=o._shadowMapCamera;o._cascadesEnabled?v&&x&&H.clone(v.directionWC,x.directionWC):o._isPointLight?v&&x&&H.clone(v.positionWC,x.positionWC):x&&v&&x.clone(v);let C=o._lightDirectionEC;Ee.multiplyByPointAsVector(m.viewMatrix,x.directionWC,C),H.normalize(C,C),H.negate(C,C),Ee.multiplyByPoint(m.viewMatrix,x.positionWC,o._lightPositionEC),o._lightPositionEC.w=o._pointLightRadius;let w,A;o._fitNearFar?(w=Math.min(f.shadowState.nearPlane,o.maximumDistance),A=Math.min(f.shadowState.farPlane,o.maximumDistance),A=Math.max(A,w+1)):(w=m.frustum.near,A=o.maximumDistance),o._sceneCamera=Vl.clone(m,y),m.frustum.clone(o._sceneCamera.frustum),o._sceneCamera.frustum.near=w,o._sceneCamera.frustum.far=A,o._distance=A-w,kyi(o,f),!o._outOfViewPrevious&&o._outOfView&&(o._needsUpdate=!0),o._outOfViewPrevious=o._outOfView}pP.prototype.update=function(o){if(Vyi(this,o),this._needsUpdate)if(pyi(this,o.context),this._isPointLight&&Nyi(this,o),this._cascadesEnabled&&(Dyi(this,o),this._numberOfCascades>1&&Syi(this,o)),this._isPointLight)this._shadowMapCullingVolume=hg.fromBoundingSphere(this._boundingSphere);else{let f=this._shadowMapCamera,m=f.positionWC,v=f.directionWC,y=f.upWC;this._shadowMapCullingVolume=f.frustum.computeCullingVolume(m,v,y),this._passes.length===1&&this._passes[0].camera.clone(f)}if(this._passes.length===1){let f=this._sceneCamera.inverseViewMatrix;Ee.multiply(this._shadowMapCamera.getViewProjection(),f,this._shadowMapMatrix)}this.debugShow&&byi(this,o)};pP.prototype.updatePass=function(o,f){Ktt(this,o,f)};var zyi=new Ye;function eit(o,f,m){let v=o._isPointLight?o._pointBias:m?o._terrainBias:o._primitiveBias,y={shadowMap_texture:function(){return o._shadowMapTexture},shadowMap_textureCube:function(){return o._shadowMapTexture},shadowMap_matrix:function(){return o._shadowMapMatrix},shadowMap_cascadeSplits:function(){return o._cascadeSplits},shadowMap_cascadeMatrices:function(){return o._cascadeMatrices},shadowMap_lightDirectionEC:function(){return o._lightDirectionEC},shadowMap_lightPositionEC:function(){return o._lightPositionEC},shadowMap_cascadeDistances:function(){return o._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let x=zyi;return x.x=1/o._textureSize.x,x.y=1/o._textureSize.y,Wt.fromElements(x.x,x.y,v.depthBias,v.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return Wt.fromElements(v.normalOffsetScale,o._distance,o.maximumDistance,o._darkness,this.combinedUniforms2)},shadowMap_horizonCullingDistance:function(){return o.horizonCullingDistanceFromViewshed===void 0?6371010:o.horizonCullingDistanceFromViewshed},u_isSun:function(){return o.guid===void 0},u_isVisible:function(){return!!o.show},u_isPreviewMode:function(){return!!o.isPreviewMode},u_isBelowGround:function(){return!!o.isBelowGround},u_viewshedCalculateNormals:function(){return!1},shadowMap_viewshed_Back:function(){return o._viewshed_Back?o._viewshed_Back:new H(1,0,0)},shadowMap_viewshed_Fore:function(){return o._viewshed_Fore?o._viewshed_Fore:new H(0,1,0)},shadowMap_color:function(){return o._color?o._color:new H(0,0,0)},combinedUniforms1:new Wt,combinedUniforms2:new Wt};return va(f,y,!1)}function Hyi(o,f,m,v,y,x){let C,w,A;if(N(x)&&(C=x.shaderProgram,w=x.renderState,A=x.uniformMap),x=Jn.shallowClone(m,x),x.castShadows=!0,x.receiveShadows=!1,!N(C)||y!==m.shaderProgram.id||f){let E=m.shaderProgram,T=m.pass===vr.GLOBE,S=m.pass!==vr.TRANSLUCENT,M=o._isPointLight||o._isSpotLight,I=o._usesDepthTexture,P=p3.getShadowCastShaderKeyword(M,T,I,S);if(C=v.shaderCache.getDerivedShaderProgram(E,P),!N(C)){let D=E.vertexShaderSource,L=E.fragmentShaderSource,R=p3.createShadowCastVertexShader(D,M,T),O=p3.createShadowCastFragmentShader(L,M,I,S);C=v.shaderCache.createDerivedShaderProgram(E,P,{vertexShaderSource:R,fragmentShaderSource:O,attributeLocations:E._attributeLocations})}w=o._primitiveRenderState,M?w=o._pointRenderState:T&&(w=o._terrainRenderState),m.renderState.cull.enabled||(w=uo(w,!1),w.cull=uo(w.cull,!1),w.cull.enabled=!1,w=Mn.fromCache(w)),A=eit(o,m.uniformMap,T)}return x.shaderProgram=C,x.renderState=w,x.uniformMap=A,x.uniformMap.u_isB3dm=function(){return m.pass===vr.CESIUM_3D_TILE},x}pP.createReceiveDerivedCommand=function(o,f,m,v,y){N(y)||(y={});let x=o.length>0,C=f.shaderProgram,w=C.vertexShaderSource,A=C.fragmentShaderSource,E=f.pass===vr.GLOBE,T=!1;if(E&&(T=f.owner.data.renderedMesh.encoding.hasVertexNormals),f.receiveShadows&&x){let S,M;N(y.receiveCommand)&&(S=y.receiveCommand.shaderProgram,M=y.receiveCommand.uniformMap),y.receiveCommand=Jn.shallowClone(f,y.receiveCommand),y.castShadows=!1,y.receiveShadows=!0;let I=y.receiveShaderCastShadows!==f.castShadows,P=y.receiveShaderProgramId!==f.shaderProgram.id;if(!N(S)||P||m||I){let D=p3.getShadowReceiveShaderKeyword(o[0],f.castShadows,E,T);if(S=v.shaderCache.getDerivedShaderProgram(C,D),!N(S)){let L=p3.createShadowReceiveVertexShader(w,E,T),R=p3.createShadowReceiveFragmentShader(A,o[0],f.castShadows,E,T);S=v.shaderCache.createDerivedShaderProgram(C,D,{vertexShaderSource:L,fragmentShaderSource:R,attributeLocations:C._attributeLocations})}M=eit(o[0],f.uniformMap,E)}y.receiveCommand.shaderProgram=S,y.receiveCommand.uniformMap=M,y.receiveCommand.uniformMap.u_isB3dm=function(){return f.pass===vr.CESIUM_3D_TILE},y.receiveShaderProgramId=f.shaderProgram.id,y.receiveShaderCastShadows=f.castShadows}return y};pP.createCastDerivedCommand=function(o,f,m,v,y){if(N(y)||(y={}),f.castShadows){let x=y.castCommands;N(x)||(x=y.castCommands=[]);let C=y.castShaderProgramId,w=o.length;x.length=w;for(let A=0;A<w;++A)x[A]=Hyi(o[A],m,f,v,C,x[A]);y.castShaderProgramId=f.shaderProgram.id}return y};pP.prototype.isDestroyed=function(){return!1};pP.prototype.destroy=function(){eSe(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let o=0;o<this._numberOfCascades;++o)this._debugCascadeFrustums[o]=this._debugCascadeFrustums[o]&&this._debugCascadeFrustums[o].destroy();return kr(this)};var mD=pP,cW=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif in vec2 v_textureCoordinates; void main() { #ifdef DEBUG_SHOW_DEPTH if (v_textureCoordinates.x < 0.5) { out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates))); out_FragColor.a = 1.0; } #else vec4 color = texture(colorTexture, v_textureCoordinates); #ifdef PICK if (color == vec4(0.0)) { discard; } #else // Reverse premultiplication process to get the correct composited result of the classification primitives color.rgb /= color.a; #endif out_FragColor = color; #endif } `,Uyi=!1;function wO(o){this._drawClassificationFBO=new $h({createDepthAttachments:!1}),this._accumulationFBO=new $h({createDepthAttachments:!1}),this._packFBO=new $h,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new Gc({color:new Re(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new Gc({depth:1,stencil:0,owner:this}),this._supported=o.depthTexture,this._viewport=new Xr,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(wO.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function tit(o){o._textureToComposite=void 0,o._translucentDepthStencilTexture=o._translucentDepthStencilTexture&&!o._translucentDepthStencilTexture.isDestroyed()&&o._translucentDepthStencilTexture.destroy()}function iit(o){o._drawClassificationFBO.destroy(),o._accumulationFBO.destroy(),o._packFBO.destroy()}function Gyi(o,f,m,v){tit(o),o._translucentDepthStencilTexture=new _o({context:f,width:m,height:v,pixelFormat:Nn.DEPTH_STENCIL,pixelDatatype:Rn.UNSIGNED_INT_24_8,sampler:gs.NEAREST})}function Wyi(o,f,m,v){iit(o),o._drawClassificationFBO.setDepthStencilTexture(o._translucentDepthStencilTexture),o._drawClassificationFBO.update(f,m,v),o._accumulationFBO.setDepthStencilTexture(o._translucentDepthStencilTexture),o._accumulationFBO.update(f,m,v),o._packFBO.update(f,m,v)}function jyi(o,f,m,v){if(!o.isSupported())return;o._opaqueDepthStencilTexture=v;let y=o._opaqueDepthStencilTexture.width,x=o._opaqueDepthStencilTexture.height;o._drawClassificationFBO.isDirty(y,x)&&(Gyi(o,f,y,x),Wyi(o,f,y,x));let C,w;if(N(o._packDepthCommand)||(C=new Zr({sources:[GAe]}),w={u_opaqueDepthTexture:function(){return o._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return o._translucentDepthStencilTexture}},o._packDepthCommand=f.createViewportQuadCommand(C,{uniformMap:w,owner:o})),!N(o._compositeCommand)){C=new Zr({sources:[cW]}),w={colorTexture:function(){return o._textureToComposite}},Uyi&&(C.defines=["DEBUG_SHOW_DEPTH"],w.u_packedTranslucentDepth=function(){return o._packFBO.getColorTexture()}),o._compositeCommand=f.createViewportQuadCommand(C,{uniformMap:w,owner:o});let T=o._compositeCommand,S=T.shaderProgram,M=f.shaderCache.createDerivedShaderProgram(S,"pick",{vertexShaderSource:S.vertexShaderSource,fragmentShaderSource:new Zr({sources:C.sources,defines:["PICK"]}),attributeLocations:S._attributeLocations}),I=Jn.shallowClone(T);I.shaderProgram=M,T.derivedCommands.pick=I}N(o._copyCommand)||(C=new Zr({sources:[cW]}),w={colorTexture:function(){return o._drawClassificationFBO.getColorTexture()}},o._copyCommand=f.createViewportQuadCommand(C,{uniformMap:w,owner:o})),N(o._accumulateCommand)||(C=new Zr({sources:[cW]}),w={colorTexture:function(){return o._drawClassificationFBO.getColorTexture()}},o._accumulateCommand=f.createViewportQuadCommand(C,{uniformMap:w,owner:o})),o._viewport.width=y,o._viewport.height=x;let A=!Xr.equals(o._viewport,m.viewport),E=A!==o._useScissorTest;o._useScissorTest=A,Xr.equals(o._scissorRectangle,m.viewport)||(o._scissorRectangle=Xr.clone(m.viewport,o._scissorRectangle),E=!0),(!N(o._rsDepth)||!Xr.equals(o._viewport,o._rsDepth.viewport)||E)&&(o._rsDepth=Mn.fromCache({viewport:o._viewport,scissorTest:{enabled:o._useScissorTest,rectangle:o._scissorRectangle}})),N(o._packDepthCommand)&&(o._packDepthCommand.renderState=o._rsDepth),(!N(o._rsAccumulate)||!Xr.equals(o._viewport,o._rsAccumulate.viewport)||E)&&(o._rsAccumulate=Mn.fromCache({viewport:o._viewport,scissorTest:{enabled:o._useScissorTest,rectangle:o._scissorRectangle},stencilTest:{enabled:!0,frontFunction:dc.EQUAL,reference:Ua.CESIUM_3D_TILE_MASK}})),N(o._accumulateCommand)&&(o._accumulateCommand.renderState=o._rsAccumulate),(!N(o._rsComp)||!Xr.equals(o._viewport,o._rsComp.viewport)||E)&&(o._rsComp=Mn.fromCache({viewport:o._viewport,scissorTest:{enabled:o._useScissorTest,rectangle:o._scissorRectangle},blending:Mu.ALPHA_BLEND})),N(o._compositeCommand)&&(o._compositeCommand.renderState=o._rsComp,o._compositeCommand.derivedCommands.pick.renderState=o._rsComp)}wO.prototype.executeTranslucentCommands=function(o,f,m,v,y){let x=v.length,C,w,A=o.frameState.useLogDepth,E=o.context,T=m.framebuffer;for(w=0;w<x;++w)if(C=v[w],C=A?C.derivedCommands.logDepth.command:C,C.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}if(this._hasTranslucentDepth){for(jyi(this,E,m,y),m.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(E,m),w=0;w<x;++w){if(C=v[w],C=A?C.derivedCommands.logDepth.command:C,!C.depthForTranslucentClassification)continue;let S=C.derivedCommands.depth.depthOnlyCommand;f(S,o,E,m)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(m.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(E,m)),m.framebuffer=T}};wO.prototype.executeClassificationCommands=function(o,f,m,v){if(!this._hasTranslucentDepth)return;let y=o.context,x=y.uniformState,C=m.framebuffer;this._frustumsDrawn===2&&(m.framebuffer=this._accumulationFBO.framebuffer,this._copyCommand.execute(y,m)),m.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(y,m),x.updatePass(vr.CESIUM_3D_TILE_CLASSIFICATION);let w=x.globeDepthTexture;x.globeDepthTexture=this._packFBO.getColorTexture();let A=v.commands[vr.CESIUM_3D_TILE_CLASSIFICATION],E=v.indices[vr.CESIUM_3D_TILE_CLASSIFICATION];for(let T=0;T<E;++T)f(A[T],o,y,m);x.globeDepthTexture=w,m.framebuffer=C,this._frustumsDrawn!==1&&(m.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(y,m),m.framebuffer=C)};wO.prototype.execute=function(o,f){!this._hasTranslucentDepth||(this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(o.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(o.context,f),Yyi(this,o,f))};function Yyi(o,f,m){if(!o._hasTranslucentDepth)return;let v=m.framebuffer;m.framebuffer=o._drawClassificationFBO.framebuffer,o._clearColorCommand.execute(f._context,m),m.framebuffer=v,o._frustumsDrawn>1&&(m.framebuffer=o._accumulationFBO.framebuffer,o._clearColorCommand.execute(f._context,m)),o._hasTranslucentDepth=!1,o._frustumsDrawn=0}wO.prototype.isSupported=function(){return this._supported};wO.prototype.isDestroyed=function(){return!1};wO.prototype.destroy=function(){return tit(this),iit(this),N(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),N(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),kr(this)};var iSe=wO;function qyi(){this.command=void 0,this.near=void 0,this.far=void 0}function Noe(o,f,m){let v=o.context,y;v.depthTexture&&(y=new YTe);let x;o._useOIT&&v.depthTexture&&(x=new KTe(v));let C=new Kg(v);C.viewport=Xr.clone(m),this.camera=f,this._cameraClone=Vl.clone(f),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=m,this.passState=C,this.pickFramebuffer=new ZTe(v),this.pickDepthFramebuffer=new QTe,this.sceneFramebuffer=new Roe,this.globeDepth=y,this.globeTranslucencyFramebuffer=new qTe,this.oit=x,this.translucentTileClassification=new iSe(v),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var IUe=new H,MUe=new H;function Xyi(o,f){let m=Math.max(Math.abs(o.x),Math.abs(f.x)),v=Math.max(Math.abs(o.y),Math.abs(f.y)),y=Math.max(Math.abs(o.z),Math.abs(f.z));return Math.max(Math.max(m,v),y)}function Jyi(o,f,m){let v=1/Math.max(1,Xyi(o.position,f.position));return H.multiplyByScalar(o.position,v,IUe),H.multiplyByScalar(f.position,v,MUe),H.equalsEpsilon(IUe,MUe,m)&&H.equalsEpsilon(o.direction,f.direction,m)&&H.equalsEpsilon(o.up,f.up,m)&&H.equalsEpsilon(o.right,f.right,m)&&Ee.equalsEpsilon(o.transform,f.transform,m)&&o.frustum.equalsEpsilon(f.frustum,m)}Noe.prototype.checkForCameraUpdates=function(o){let f=this.camera,m=this._cameraClone;return Jyi(f,m,xe.EPSILON15)?(this._cameraStartFired&&$c()-this._cameraMovedTime>o.cameraEventWaitTime&&(f.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(f.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=$c(),Vl.clone(f,m),!0)};function Kyi(o,f,m,v){let y=f.frameState,x=y.camera,C=y.useLogDepth?f.logarithmicDepthFarToNearRatio:f.farToNearRatio,w=f.mode===_i.SCENE2D,A=f.nearToFarDistance2D;v*=1+xe.EPSILON2,m=Math.min(Math.max(m,x.frustum.near),x.frustum.far),v=Math.max(Math.min(v,x.frustum.far),m);let E;w?(v=Math.min(v,x.position.z+f.nearToFarDistance2D),m=Math.min(m,v),E=Math.ceil(Math.max(1,v-m)/f.nearToFarDistance2D)):E=Math.ceil(Math.log(v/m)/Math.log(C));let T=o.frustumCommandsList;T.length=E;for(let S=0;S<E;++S){let M,I;w?(M=Math.min(v-A,m+S*A),I=Math.min(v,M+A)):(M=Math.max(m,Math.pow(C,S)*m),I=Math.min(v,C*M));let P=T[S];N(P)?(P.near=M,P.far=I):P=T[S]=new jTe(M,I)}}function Qyi(o,f,m,v,y){f.debugShowFrustums&&(m.debugOverlappingFrustums=0);let x=o.frustumCommandsList,C=x.length;for(let w=0;w<C;++w){let A=x[w],E=A.near,T=A.far;if(m._customType!==-1){let I=x[0],P=m.pass,D=I.indices[P]++;if(I.commands[P][D]=m,f.debugShowFrustums&&(m.debugOverlappingFrustums|=1<<w),m.executeInClosestFrustum)break;continue}if(v>T)continue;if(y<E)break;let S=m.pass,M=A.indices[S]++;if(A.commands[S][M]=m,f.debugShowFrustums&&(m.debugOverlappingFrustums|=1<<w),m.executeInClosestFrustum)break}if(f.debugShowFrustums){let w=o.debugFrustumStatistics.commandsInFrustums;w[m.debugOverlappingFrustums]=N(w[m.debugOverlappingFrustums])?w[m.debugOverlappingFrustums]+1:1,++o.debugFrustumStatistics.totalCommands}f.updateDerivedCommands(m)}var DUe=new hg,Zyi=new t2;Noe.prototype.createPotentiallyVisibleSet=function(o){let f=o.frameState,m=f.camera,v=m.directionWC,y=m.positionWC,x=o._computeCommandList,C=o._overlayCommandList,w=f.commandList;o.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let A=this.frustumCommandsList,E=A.length,T=vr.NUMBER_OF_PASSES;for(let Q=0;Q<E;++Q)for(let ee=0;ee<T;++ee)A[Q].indices[ee]=0;x.length=0,C.length=0;let S=this._commandExtents,M=S.length,I=0,P=+Number.MAX_VALUE,D=-Number.MAX_VALUE,L=f.shadowState.shadowsEnabled,R=+Number.MAX_VALUE,O=-Number.MAX_VALUE,F=Number.MAX_VALUE,k=f.mode===_i.SCENE3D?f.occluder:void 0,U=f.cullingVolume,G=DUe.planes;for(let Q=0;Q<5;++Q)G[Q]=U.planes[Q];U=DUe;let j=w.length;for(let Q=0;Q<j;++Q){let ee=w[Q],z=ee.pass;if(z===vr.COMPUTE)x.push(ee);else if(z===vr.OVERLAY)C.push(ee);else{let ie,re,ne=ee.boundingVolume;if(N(ne)){if(!o.isVisible(ee,U,k))continue;let se=ne.computePlaneDistances(y,v,Zyi);if(ie=se.start,re=se.stop,P=Math.min(P,ie),D=Math.max(D,re),L&&ee.receiveShadows&&ie<mD.MAXIMUM_DISTANCE&&!(z===vr.GLOBE&&ie<-100&&re>100)){let ae=re-ie;z!==vr.GLOBE&&ie<100&&(F=Math.min(F,ae)),R=Math.min(R,ie),O=Math.max(O,re)}}else ee instanceof Gc?(ie=m.frustum.near,re=m.frustum.far):(ie=m.frustum.near,re=m.frustum.far,P=Math.min(P,ie),D=Math.max(D,re));let oe=S[I];N(oe)||(oe=S[I]=new qyi),oe.command=ee,oe.near=ie,oe.far=re,I++}}L&&(R=Math.min(Math.max(R,m.frustum.near),m.frustum.far),O=Math.max(Math.min(O,m.frustum.far),R)),L&&(f.shadowState.nearPlane=R,f.shadowState.farPlane=O,f.shadowState.closestObjectSize=F),Kyi(this,o,P,D);let q,J;for(q=0;q<I;q++)J=S[q],Qyi(this,o,J.command,J.near,J.far);if(I<M)for(q=I;q<M&&(J=S[q],!!N(J.command));q++)J.command=void 0;let X=A.length,Y=f.frustumSplits;Y.length=X+1;for(let Q=0;Q<X;++Q)Y[Q]=A[Q].near,Q===X-1&&(Y[Q+1]=A[Q].far)};Noe.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let o,f=this.pickDepths,m=f.length;for(o=0;o<m;++o)f[o].destroy()};var E6=Noe,rit=.1,$yi=new ET({pass:ep.MOST_DETAILED_PRELOAD}),exi=new ET({pass:ep.MOST_DETAILED_PICK}),rSe=new ET({pass:ep.PICK});function I_(o){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let f=new Xr(0,0,1,1),m=new Vl(o);m.frustum=new Gs({width:rit,aspectRatio:1,near:.1}),this._pickOffscreenView=new E6(o,m,f)}I_.prototype.update=function(){this._pickPositionCacheDirty=!0};I_.prototype.getPickDepth=function(o,f){let m=o.view.pickDepths,v=m[f];return N(v)||(v=new WTe,m[f]=v),v};var txi=new Pm,ixi=new H,KZ=new H,rxi=new Ye,nxi=new Ee;function oxi(o,f,m,v,y){let x=o.camera,C=x.frustum,w=C.offCenterFrustum;N(w)&&(C=w);let A=2*(f.x-y.x)/y.width-1;A*=(C.right-C.left)*.5;let E=2*(y.height-f.y-y.y)/y.height-1;E*=(C.top-C.bottom)*.5;let T=Ee.clone(x.transform,nxi);x._setTransform(Ee.IDENTITY);let S=H.clone(x.position,ixi);H.multiplyByScalar(x.right,A,KZ),H.add(KZ,S,S),H.multiplyByScalar(x.up,E,KZ),H.add(KZ,S,S),x._setTransform(T),o.mode===_i.SCENE2D&&H.fromElements(S.z,S.x,S.y,S);let M=C.getPixelDimensions(y.width,y.height,1,1,rxi),I=txi;return I.right=M.x*.5,I.left=-I.right,I.top=M.y*.5,I.bottom=-I.top,I.near=C.near,I.far=C.far,I.computeCullingVolume(S,x.directionWC,x.upWC)}var axi=new J2,sxi=new Ye;function lxi(o,f,m,v,y){let x=o.camera,C=x.frustum,w=C.near,A=Math.tan(C.fovy*.5),E=C.aspectRatio*A,T=2*(f.x-y.x)/y.width-1,S=2*(y.height-f.y-y.y)/y.height-1,M=T*w*E,I=S*w*A,P=C.getPixelDimensions(y.width,y.height,1,1,sxi),D=P.x*m*.5,L=P.y*v*.5,R=axi;return R.top=I+L,R.bottom=I-L,R.right=M+D,R.left=M-D,R.near=w,R.far=C.far,R.computeCullingVolume(x.positionWC,x.directionWC,x.upWC)}function nit(o,f,m,v,y){let x=o.camera.frustum;return x instanceof Gs||x instanceof Pm?oxi(o,f,m,v,y):lxi(o,f,m,v,y)}var uz=3,L7=3,KS=new Xr(0,0,uz,L7),oit=new Ye,nSe=new Re(0,0,0,0);I_.prototype.pick=function(o,f,m,v){uz=Z(m,3),L7=Z(v,uz);let y=o.context,x=y.uniformState,C=o.frameState,w=o.defaultView;o.view=w;let A=w.viewport;A.x=0,A.y=0,A.width=y.drawingBufferWidth,A.height=y.drawingBufferHeight;let E=w.passState;E.viewport=Xr.clone(A,E.viewport);let T=nl.transformWindowToDrawingBuffer(o,f,oit);o.jobScheduler.disableThisFrame(),o.updateFrameState(),C.cullingVolume=nit(o,T,uz,L7,A),C.invertClassification=!1,C.passes.pick=!0,C.tilesetPassState=rSe,x.update(C),o.updateEnvironment(),KS.x=T.x-(uz-1)*.5,KS.y=o.drawingBufferHeight-T.y-(L7-1)*.5,KS.width=uz,KS.height=L7,E=w.pickFramebuffer.begin(KS,w.viewport),o.updateAndExecuteCommandszh(E,nSe),o.resolveFramebuffers(E);let S=w.pickFramebuffer.end(KS);return y.endFrame(),S};function uxi(o,f){let m=o.context,v=o.frameState,y=o.environmentState,x=o.defaultView;o.view=x;let C=x.viewport;C.x=0,C.y=0,C.width=m.drawingBufferWidth,C.height=m.drawingBufferHeight;let w=x.passState;w.viewport=Xr.clone(C,w.viewport),o.clearPasses(v.passes),v.passes.pick=!0,v.passes.depth=!0,v.cullingVolume=nit(o,f,1,1,C),v.tilesetPassState=rSe,o.updateEnvironment(),y.renderTranslucentDepthForPick=!0,w=x.pickDepthFramebuffer.update(m,f,C),o.updateAndExecuteCommands(w,nSe),o.resolveFramebuffers(w),m.endFrame()}var cxi=new pc,hxi=new J2,dxi=new Gs,fxi=new Pm;I_.prototype.pickPositionWorldCoordinates=function(o,f,m){if(!o.useDepthPicking)return;let v=f.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(v))return H.clone(this._pickPositionCache[v],m);let y=o.frameState,x=o.context,C=x.uniformState,w=o.defaultView;o.view=w;let A=nl.transformWindowToDrawingBuffer(o,f,oit);o.pickTranslucentDepth?uxi(o,A):(o.updateFrameState(),C.update(y),o.updateEnvironment()),A.y=o.drawingBufferHeight-A.y;let E=o.camera,T;N(E.frustum.fov)?T=E.frustum.clone(cxi):N(E.frustum.infiniteProjectionMatrix)?T=E.frustum.clone(hxi):N(E.frustum.width)?T=E.frustum.clone(dxi):T=E.frustum.clone(fxi);let S=w.frustumCommandsList,M=S.length;for(let I=0;I<M;++I){let P=this.getPickDepth(o,I).getDepth(x,A.x,A.y);if(N(P)&&P>0&&P<1){let D=S[I],L;return o.mode===_i.SCENE2D?(L=E.position.z,E.position.z=L-D.near+1,T.far=Math.max(1,D.far-D.near),T.near=1,C.update(y),C.updateFrustum(T)):(T.near=D.near*(I!==0?o.opaqueFrustumNearOffset:1),T.far=D.far,C.updateFrustum(T)),m=nl.drawingBufferToWgs84Coordinates(o,A,P,m),o.mode===_i.SCENE2D&&(E.position.z=L,C.update(y)),this._pickPositionCache[v]=H.clone(m),m}}this._pickPositionCache[v]=void 0};var pxi=new Mt;I_.prototype.pickPosition=function(o,f,m){if(m=this.pickPositionWorldCoordinates(o,f,m),N(m)&&o.mode!==_i.SCENE3D){H.fromElements(m.y,m.z,m.x,m);let v=o.mapProjection,y=v.ellipsoid,x=v.unproject(m,pxi);y.cartographicToCartesian(x,m)}return m};function ait(o,f){let m,v,y=[],x=[],C=[],w=[];N(o)||(o=Number.MAX_VALUE);let A=f();for(;N(A);){let E=A.object,T=A.position,S=A.exclude;if(N(T)&&!N(E)){y.push(A);break}if(!N(E)||!N(E.primitive)||!S&&(y.push(A),0>=--o))break;let M=E.primitive,I=!1;typeof M.getGeometryInstanceAttributes=="function"&&N(E.id)&&(v=M.getGeometryInstanceAttributes(E.id),N(v)&&N(v.show)&&(I=!0,v.show=zu.toValue(!1,v.show),C.push(v))),E instanceof Qs&&(I=!0,E.show=!1,w.push(E)),I||(M.show=!1,x.push(M)),A=f()}for(m=0;m<x.length;++m)x[m].show=!0;for(m=0;m<C.length;++m)v=C[m],v.show=zu.toValue(!0,v.show);for(m=0;m<w.length;++m)w[m].show=!0;return y}I_.prototype.drillPick=function(o,f,m,v,y){let x=this;return ait(m,function(){let C=x.pick(o,f,v,y);if(N(C))return{object:C,position:void 0,exclude:!1}}).map(function(C){return C.object})};var LUe=new H,mxi=new H;function gxi(o,f,m){this.ray=o,this.width=f,this.tilesets=m,this.ready=!1;let v=this;this.promise=new Promise(y=>{v._completePick=()=>{y()}})}function sit(o,f,m,v){let y=f.direction,x=H.mostOrthogonalAxis(y,LUe),C=H.cross(y,x,LUe),w=H.cross(y,C,mxi);return v.position=f.origin,v.direction=y,v.up=w,v.right=C,v.frustum.width=Z(m,rit),v.frustum.computeCullingVolume(v.positionWC,v.directionWC,v.upWC)}function _xi(o,f,m){let v=f.frameState,y=m.ray,x=m.width,C=m.tilesets,w=o._pickOffscreenView.camera,A=sit(o,y,x,w),E=$yi;E.camera=w,E.cullingVolume=A;let T=!0,S=C.length;for(let M=0;M<S;++M){let I=C[M];I.show&&f.primitives.contains(I)&&(I.updateForPass(v,E),T=T&&E.ready)}return T&&m._completePick(),T}I_.prototype.updateMostDetailedRayPicks=function(o){let f=this._mostDetailedRayPicks;for(let m=0;m<f.length;++m)_xi(this,o,f[m])&&f.splice(m--,1)};function lit(o,f,m){let v=o.length;for(let y=0;y<v;++y){let x=o.get(y);x.show&&(N(x.isCesium3DTileset)?(!N(f)||f.indexOf(x)===-1)&&m.push(x):x instanceof w_&&lit(x,f,m))}}function Foe(o,f,m,v,y,x){let C=[];if(lit(f.primitives,v,C),C.length===0)return Promise.resolve(x());let w=new gxi(m,y,C);return o._mostDetailedRayPicks.push(w),w.promise.then(function(){return x()})}function vxi(o,f){return!N(o)||!N(f)||f.length===0?!1:f.indexOf(o)>-1||f.indexOf(o.primitive)>-1||f.indexOf(o.id)>-1}function yxi(o,f,m,v,y,x,C){let w=f.context,A=w.uniformState,E=f.frameState,T=o._pickOffscreenView;f.view=T,sit(o,m,y,T.camera),KS=Xr.clone(T.viewport,KS);let S=T.pickFramebuffer.begin(KS,T.viewport);f.jobScheduler.disableThisFrame(),f.updateFrameState(),E.invertClassification=!1,E.passes.pick=!0,E.passes.offscreen=!0,C?E.tilesetPassState=exi:E.tilesetPassState=rSe,A.update(E),f.updateEnvironment(),f.updateAndExecuteCommands(S,nSe),f.resolveFramebuffers(S);let M,I=T.pickFramebuffer.end(KS);if(f.context.depthTexture){let P=T.frustumCommandsList.length;for(let D=0;D<P;++D){let L=o.getPickDepth(f,D).getDepth(w,0,0);if(N(L)&&L>0&&L<1){let R=T.frustumCommandsList[D],O=R.near*(D!==0?f.opaqueFrustumNearOffset:1),F=R.far,k=O+L*(F-O);M=_s.getPoint(m,k);break}}}if(f.view=f.defaultView,w.endFrame(),N(I)||N(M))return{object:I,position:M,exclude:!N(M)&&x||vxi(I,v)}}function uit(o,f,m,v,y,x,C,w){return ait(v,function(){return yxi(o,f,m,y,x,C,w)})}function T6(o,f,m,v,y,x,C){let w=uit(o,f,m,1,v,y,x,C);if(w.length>0)return w[0]}function cit(o,f,m,v,y,x,C,w){return uit(o,f,m,v,y,x,C,w)}function Boe(o,f){return new Promise((m,v)=>{f.then(function(y){let x=o.postRender.addEventListener(function(){x(),m(y)});o.requestRender()}).catch(function(y){v(y)})})}I_.prototype.pickFromRay=function(o,f,m,v){return T6(this,o,f,m,v,!1,!1)};I_.prototype.drillPickFromRay=function(o,f,m,v,y){return cit(this,o,f,m,v,y,!1,!1)};I_.prototype.pickFromRayMostDetailed=function(o,f,m,v){let y=this;return f=_s.clone(f),m=N(m)?m.slice():m,Boe(o,Foe(y,o,f,m,v,function(){return T6(y,o,f,m,v,!1,!0)}))};I_.prototype.drillPickFromRayMostDetailed=function(o,f,m,v,y){let x=this;return f=_s.clone(f),v=N(v)?v.slice():v,Boe(o,Foe(x,o,f,v,y,function(){return cit(x,o,f,m,v,y,!1,!0)}))};var xxi=new H,Cxi=new H,bxi=new _s,hit=new Mt;function oSe(o,f){let m=o.globe,v=N(m)?m.ellipsoid:o.mapProjection.ellipsoid,y=zh._defaultMaxTerrainHeight,x=v.geodeticSurfaceNormalCartographic(f,Cxi),C=Mt.toCartesian(f,v,xxi),w=bxi;w.origin=C,w.direction=x;let A=new _s;return _s.getPoint(w,y,A.origin),H.negate(x,A.direction),A}function dit(o,f){let m=o.globe,v=N(m)?m.ellipsoid:o.mapProjection.ellipsoid,y=Mt.fromCartesian(f,v,hit);return oSe(o,y)}function fit(o,f){let m=o.globe,v=N(m)?m.ellipsoid:o.mapProjection.ellipsoid;return Mt.fromCartesian(f,v,hit).height}function wxi(o,f,m,v,y){let x=oSe(f,m);return Foe(o,f,x,v,y,function(){let C=T6(o,f,x,v,y,!0,!0);if(N(C))return fit(f,C.position)})}function Axi(o,f,m,v,y,x){let C=dit(f,m);return Foe(o,f,C,v,y,function(){let w=T6(o,f,C,v,y,!0,!0);if(N(w))return H.clone(w.position,x)})}I_.prototype.sampleHeight=function(o,f,m,v){let y=oSe(o,f),x=T6(this,o,y,m,v,!0,!1);if(N(x))return fit(o,x.position)};I_.prototype.clampToHeight=function(o,f,m,v,y){let x=dit(o,f),C=T6(this,o,x,m,v,!0,!1);if(N(C))return H.clone(C.position,y)};I_.prototype.sampleHeightMostDetailed=function(o,f,m,v){m=N(m)?m.slice():m;let y=f.length,x=new Array(y);for(let C=0;C<y;++C)x[C]=wxi(this,o,f[C],m,v);return Boe(o,Promise.all(x).then(function(C){let w=C.length;for(let A=0;A<w;++A)f[A].height=C[A];return f}))};I_.prototype.clampToHeightMostDetailed=function(o,f,m,v){m=N(m)?m.slice():m;let y=f.length,x=new Array(y);for(let C=0;C<y;++C)x[C]=Axi(this,o,f[C],m,v,f[C]);return Boe(o,Promise.all(x).then(function(C){let w=C.length;for(let A=0;A<w;++A)f[A]=C[A];return f}))};I_.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var aSe=I_,sSe=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; #endif void main() { vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); vec3 color = fragmentColor.rgb; #ifdef AUTO_EXPOSURE color /= texture(autoExposure, vec2(0.5)).r; #endif color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } `,lSe=`uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; uniform float bias; uniform float lengthCap; uniform float stepSize; uniform float frustumLength; in vec2 v_textureCoordinates; vec4 clipToEye(vec2 uv, float depth) { vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0); posEC = posEC / posEC.w; return posEC; } //Reconstruct Normal Without Edge Removation vec3 getNormalXEdge(vec3 posInCamera, float depthU, float depthD, float depthL, float depthR, vec2 pixelSize) { vec4 posInCameraUp = clipToEye(v_textureCoordinates - vec2(0.0, pixelSize.y), depthU); vec4 posInCameraDown = clipToEye(v_textureCoordinates + vec2(0.0, pixelSize.y), depthD); vec4 posInCameraLeft = clipToEye(v_textureCoordinates - vec2(pixelSize.x, 0.0), depthL); vec4 posInCameraRight = clipToEye(v_textureCoordinates + vec2(pixelSize.x, 0.0), depthR); vec3 up = posInCamera.xyz - posInCameraUp.xyz; vec3 down = posInCameraDown.xyz - posInCamera.xyz; vec3 left = posInCamera.xyz - posInCameraLeft.xyz; vec3 right = posInCameraRight.xyz - posInCamera.xyz; vec3 DX = length(left) < length(right) ? left : right; vec3 DY = length(up) < length(down) ? up : down; return normalize(cross(DY, DX)); } void main(void) { float depth = czm_readDepth(depthTexture, v_textureCoordinates); vec4 posInCamera = clipToEye(v_textureCoordinates, depth); if (posInCamera.z > frustumLength) { out_FragColor = vec4(1.0); return; } vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; float depthU = czm_readDepth(depthTexture, v_textureCoordinates - vec2(0.0, pixelSize.y)); float depthD = czm_readDepth(depthTexture, v_textureCoordinates + vec2(0.0, pixelSize.y)); float depthL = czm_readDepth(depthTexture, v_textureCoordinates - vec2(pixelSize.x, 0.0)); float depthR = czm_readDepth(depthTexture, v_textureCoordinates + vec2(pixelSize.x, 0.0)); vec3 normalInCamera = getNormalXEdge(posInCamera.xyz, depthU, depthD, depthL, depthR, pixelSize); float ao = 0.0; vec2 sampleDirection = vec2(1.0, 0.0); float gapAngle = 90.0 * czm_radiansPerDegree; // RandomNoise float randomVal = texture(randomTexture, v_textureCoordinates / pixelSize / 255.0).x; //Loop for each direction for (int i = 0; i < 4; i++) { float newGapAngle = gapAngle * (float(i) + randomVal); float cosVal = cos(newGapAngle); float sinVal = sin(newGapAngle); //Rotate Sampling Direction vec2 rotatedSampleDirection = vec2(cosVal * sampleDirection.x - sinVal * sampleDirection.y, sinVal * sampleDirection.x + cosVal * sampleDirection.y); float localAO = 0.0; float localStepSize = stepSize; //Loop for each step for (int j = 0; j < 6; j++) { vec2 newCoords = v_textureCoordinates + rotatedSampleDirection * localStepSize * pixelSize; //Exception Handling if(newCoords.x > 1.0 || newCoords.y > 1.0 || newCoords.x < 0.0 || newCoords.y < 0.0) { break; } float stepDepthInfo = czm_readDepth(depthTexture, newCoords); vec4 stepPosInCamera = clipToEye(newCoords, stepDepthInfo); vec3 diffVec = stepPosInCamera.xyz - posInCamera.xyz; float len = length(diffVec); if (len > lengthCap) { break; } float dotVal = clamp(dot(normalInCamera, normalize(diffVec)), 0.0, 1.0 ); float weight = len / lengthCap; weight = 1.0 - weight * weight; if (dotVal < bias) { dotVal = 0.0; } localAO = max(localAO, dotVal * weight); localStepSize += stepSize; } ao += localAO; } ao /= 4.0; ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } `,uSe=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; void main(void) { vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } `,cSe=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) { vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; #ifdef CZM_SELECTED_FEATURE if (czm_selected()) { out_FragColor = vec4(rgb, 1.0); return; } #endif float luminance = czm_luminance(rgb); float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } `,hSe=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; void main(void) { vec4 color = texture(colorTexture, v_textureCoordinates); #ifdef CZM_SELECTED_FEATURE if (czm_selected()) { out_FragColor = color; return; } #endif vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } `,dSe=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) { vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } `,fSe=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; void main(void) { vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz; sceneColor = czm_RGBToHSB(sceneColor); sceneColor.z += brightness; sceneColor = czm_HSBToRGB(sceneColor); float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); out_FragColor = vec4(sceneColor, 1.0); } `,pSe=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; in vec2 v_textureCoordinates; vec4 toEye(vec2 uv, float depth) { vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0)); vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0); posInCamera = posInCamera / posInCamera.w; return posInCamera; } float computeDepthBlur(float depth) { float f; if (depth < focalDistance) { f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x); } else { f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance); f = pow(f, 0.1); } f *= f; f = clamp(f, 0.0, 1.0); return pow(f, 0.5); } void main(void) { float depth = czm_readDepth(depthTexture, v_textureCoordinates); vec4 posInCamera = toEye(v_textureCoordinates, depth); float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } `,mSe=`uniform sampler2D depthTexture; in vec2 v_textureCoordinates; void main(void) { float depth = czm_readDepth(depthTexture, v_textureCoordinates); out_FragColor = vec4(vec3(depth), 1.0); } `,gSe=`uniform sampler2D depthTexture; uniform float length; uniform float width; uniform vec4 color; in vec2 v_textureCoordinates; void main(void) { float directions[3]; directions[0] = -1.0; directions[1] = 0.0; directions[2] = 1.0; float scalars[3]; scalars[0] = 3.0; scalars[1] = 10.0; scalars[2] = 3.0; float padx = czm_pixelRatio / czm_viewport.z; float pady = width / czm_viewport.w; // Geoworld add \u5929\u9645\u7EBF\u5BBD\u5EA6 #ifdef CZM_SELECTED_FEATURE bool selected = false; for (int i = 0; i < 3; ++i) { float dir = directions[i]; selected = selected || czm_selected(vec2(-padx, dir * pady)); selected = selected || czm_selected(vec2(padx, dir * pady)); selected = selected || czm_selected(vec2(dir * padx, -pady)); selected = selected || czm_selected(vec2(dir * padx, pady)); if (selected) { break; } } if (!selected) { out_FragColor = vec4(color.rgb, 0.0); return; } #endif float horizEdge = 0.0; float vertEdge = 0.0; for (int i = 0; i < 3; ++i) { float dir = directions[i]; float scale = scalars[i]; horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale; horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale; vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale; vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale; } float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } `,_Se=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; #endif // See slides 142 and 143: // http://www.gdcvault.com/play/1012459/Uncharted_2__HDR_Lighting void main() { vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); vec3 color = fragmentColor.rgb; #ifdef AUTO_EXPOSURE float exposure = texture(autoExposure, vec2(0.5)).r; color /= exposure; #endif const float A = 0.22; // shoulder strength const float B = 0.30; // linear strength const float C = 0.10; // linear angle const float D = 0.20; // toe strength const float E = 0.01; // toe numerator const float F = 0.30; // toe denominator const float white = 11.2; // linear white point value vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F; float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F; c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } `,vSe=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; const float fxaaQualityEdgeThresholdMin = 0.0833; void main() { vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw; vec4 color = FxaaPixelShader( v_textureCoordinates, colorTexture, fxaaQualityRcpFrame, fxaaQualitySubpix, fxaaQualityEdgeThreshold, fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } `,Ej=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; // 0.0 for x direction, 1.0 for y direction uniform sampler2D colorTexture; #ifdef USE_STEP_SIZE uniform float stepSize; #else uniform vec2 step; #endif in vec2 v_textureCoordinates; // Incremental Computation of the Gaussian: // https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html void main() { vec2 st = v_textureCoordinates; vec2 dir = vec2(1.0 - direction, direction); #ifdef USE_STEP_SIZE vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw)); #else vec2 step = step; #endif vec3 g; g.x = 1.0 / (sqrt(czm_twoPi) * sigma); g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); g.z = g.y * g.y; vec4 result = texture(colorTexture, st) * g.x; for (int i = 1; i < SAMPLES; ++i) { g.xy *= g.yz; vec2 offset = float(i) * dir * step; result += texture(colorTexture, st - offset) * g.x; result += texture(colorTexture, st + offset) * g.x; } out_FragColor = result; } `,ySe=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; uniform float distortion; uniform float ghostDispersal; uniform float haloWidth; uniform float dirtAmount; uniform float earthRadius; uniform float intensity; in vec2 v_textureCoordinates; // whether it is in space or not // 6500000.0 is empirical value #define DISTANCE_TO_SPACE 6500000.0 // return ndc from world coordinate biased earthRadius vec4 getNDCFromWC(vec3 WC, float earthRadius) { vec4 positionEC = czm_view * vec4(WC, 1.0); positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0); vec4 positionWC = czm_eyeToWindowCoordinates(positionEC); return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0); } // Check if current pixel is included Earth // if then mask it gradually float isInEarth(vec2 texcoord, vec2 sceneSize) { vec2 NDC = texcoord * 2.0 - 1.0; vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0); vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5); NDC.xy -= earthPosSC.xy; float X = abs(NDC.x) * sceneSize.x; float Y = abs(NDC.y) * sceneSize.y; return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0)); } // For Chromatic effect vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace) { vec2 sceneSize = czm_viewport.zw; vec3 color; if(isSpace) { color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r; color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g; color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b; } else { color.r = texture(tex, texcoord + direction * distortion.r).r; color.g = texture(tex, texcoord + direction * distortion.g).g; color.b = texture(tex, texcoord + direction * distortion.b).b; } return vec4(clamp(color, 0.0, 1.0), 0.0); } void main(void) { vec4 originalColor = texture(colorTexture, v_textureCoordinates); vec3 rgb = originalColor.rgb; bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE; // Sun position vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); vec4 sunPositionEC = czm_view * sunPos; vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); // If sun is not in the screen space, use original color. if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1))) { // Lens flare is disabled when not in space until #5932 is fixed. // https://github.com/CesiumGS/cesium/issues/5932 out_FragColor = originalColor; return; } vec2 texcoord = vec2(1.0) - v_textureCoordinates; vec2 pixelSize = czm_pixelRatio / czm_viewport.zw; vec2 invPixelSize = 1.0 / pixelSize; vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion); // ghost vector to image centre: vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal; vec3 direction = normalize(vec3(ghostVec, 0.0)); // sample ghosts: vec4 result = vec4(0.0); vec4 ghost = vec4(0.0); for (int i = 0; i < 4; ++i) { vec2 offset = fract(texcoord + ghostVec * float(i)); // Only bright spots from the centre of the source image ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace); } result += ghost; // sample halo vec2 haloVec = normalize(ghostVec) * haloWidth; float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5)); weightForHalo = pow(1.0 - weightForHalo, 5.0); result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5; // dirt on lens vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions; if (dirtTexCoords.x > 1.0) { dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x); } if (dirtTexCoords.y > 1.0) { dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y); } result += dirtAmount * texture(dirtTexture, dirtTexCoords); // Rotating starburst texture's coordinate // dot(czm_view[0].xyz, vec3(0.0, 0.0, 1.0)) + dot(czm_view[1].xyz, vec3(0.0, 1.0, 0.0)) float camrot = czm_view[0].z + czm_view[1].y; float cosValue = cos(camrot); float sinValue = sin(camrot); mat3 rotation = mat3( cosValue, -sinValue, 0.0, sinValue, cosValue, 0.0, 0.0, 0.0, 1.0 ); vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0); vec3 st2 = vec3((rotation * st1).xy, 1.0); vec3 st3 = st2 * 0.5 + vec3(0.5); vec2 lensStarTexcoord = st3.xy; float weightForLensFlare = length(vec3(sunPos.xy, 0.0)); float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0); if (!isSpace) { result *= oneMinusWeightForLensFlare * intensity * 0.2; } else { result *= oneMinusWeightForLensFlare * intensity; result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0; } result += texture(colorTexture, v_textureCoordinates); out_FragColor = result; } `,xSe=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; #endif // See equation 4: // http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf void main() { vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); vec3 color = fragmentColor.rgb; #ifdef AUTO_EXPOSURE float exposure = texture(autoExposure, vec2(0.5)).r; color /= exposure; #endif color = (color * (1.0 + color / white)) / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } `,CSe=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float rand(vec2 co) { return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453); } void main(void) { float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1; vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 green = vec3(0.0, 1.0, 0.0); out_FragColor = vec4((noiseValue + rgb) * green, 1.0); } `,bSe=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; #endif // See equation 3: // http://www.cs.utah.edu/~reinhard/cdrom/tonemap.pdf void main() { vec4 fragmentColor = texture(colorTexture, v_textureCoordinates); vec3 color = fragmentColor.rgb; #ifdef AUTO_EXPOSURE float exposure = texture(autoExposure, vec2(0.5)).r; color /= exposure; #endif color = color / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } `,wSe=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; void main(void) { vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); vec4 color = texture(colorTexture, v_textureCoordinates); out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); } `;function QB(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new $h,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new Ye,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(QB.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let o=this._framebuffers;if(N(o))return o[o.length-1].getColorTexture(0)}}});function pit(o){let f=o._framebuffers;if(!N(f))return;let m=f.length;for(let v=0;v<m;++v)f[v].destroy();o._framebuffers=void 0,o._previousLuminance.destroy(),o._previousLuminance=void 0}function Exi(o,f){pit(o);let m=o._width,v=o._height,y=f.halfFloatingPointTexture?Rn.HALF_FLOAT:Rn.FLOAT,x=Math.ceil(Math.log(Math.max(m,v))/Math.log(3)),C=new Array(x);for(let A=0;A<x;++A)m=Math.max(Math.ceil(m/3),1),v=Math.max(Math.ceil(v/3),1),C[A]=new $h,C[A].update(f,m,v,1,y);let w=C[x-1].getColorTexture(0);o._previousLuminance.update(f,w.width,w.height,1,y),o._framebuffers=C}function mit(o){let f=o._commands;if(!N(f))return;let m=f.length;for(let v=0;v<m;++v)f[v].shaderProgram.destroy();o._commands=void 0}function Txi(o,f){let m;if(f===0)m={colorTexture:function(){return o._colorTexture},colorTextureDimensions:function(){return o._colorTexture.dimensions}};else{let v=o._framebuffers[f-1].getColorTexture(0);m={colorTexture:function(){return v},colorTextureDimensions:function(){return v.dimensions}}}return m.minMaxLuminance=function(){return o._minMaxLuminance},m.previousLuminance=function(){return o._previousLuminance.getColorTexture(0)},m}function Sxi(o,f){let m=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float sampleTexture(vec2 offset) { `;return o===0?m+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); return czm_luminance(color.rgb); `:m+=` return texture(colorTexture, v_textureCoordinates + offset).r; `,m+=`} `,m+=`uniform vec2 colorTextureDimensions; uniform vec2 minMaxLuminance; uniform sampler2D previousLuminance; void main() { float color = 0.0; float xStep = 1.0 / colorTextureDimensions.x; float yStep = 1.0 / colorTextureDimensions.y; int count = 0; for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { vec2 offset; offset.x = -xStep + float(i) * xStep; offset.y = -yStep + float(j) * yStep; if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) { continue; } color += sampleTexture(offset); ++count; } } if (count > 0) { color /= float(count); } `,o===f-1&&(m+=` float previous = texture(previousLuminance, vec2(0.5)).r; color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); color = previous + (color - previous) / (60.0 * 1.5); color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),m+=` out_FragColor = vec4(color); } `,m}function Pxi(o,f){mit(o);let m=o._framebuffers,v=m.length,y=new Array(v);for(let x=0;x<v;++x)y[x]=f.createViewportQuadCommand(Sxi(x,v),{framebuffer:m[x].framebuffer,uniformMap:Txi(o,x)});o._commands=y}QB.prototype.clear=function(o){let f=this._framebuffers;if(!N(f))return;let m=this._clearCommand;N(m)||(m=this._clearCommand=new Gc({color:new Re(0,0,0,0),framebuffer:void 0}));let v=f.length;for(let y=0;y<v;++y)f[y].clear(o,m)};QB.prototype.update=function(o){let f=o.drawingBufferWidth,m=o.drawingBufferHeight;(f!==this._width||m!==this._height)&&(this._width=f,this._height=m,Exi(this,o),Pxi(this,o),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let v=this._framebuffers,y=v[v.length-1];v[v.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=y};QB.prototype.execute=function(o,f){this._colorTexture=f;let m=this._commands;if(!N(m))return;let v=m.length;for(let y=0;y<v;++y)m[y].execute(o)};QB.prototype.isDestroyed=function(){return!1};QB.prototype.destroy=function(){return pit(this),mit(this),kr(this)};var ASe=QB,Ixi={NEAREST:0,LINEAR:1},zy=Ixi;function ZB(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.fragmentShader,m=Z(o.textureScale,1),v=Z(o.pixelFormat,Nn.RGBA);this._fragmentShader=f,this._uniforms=o.uniforms,this._textureScale=m,this._forcePowerOfTwo=Z(o.forcePowerOfTwo,!1),this._sampleMode=Z(o.sampleMode,zy.NEAREST),this._pixelFormat=v,this._pixelDatatype=Z(o.pixelDatatype,Rn.UNSIGNED_BYTE),this._clearColor=Z(o.clearColor,Re.BLACK),this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let y=new Kg;y.scissorTest={enabled:!0,rectangle:N(o.scissorRectangle)?Xr.clone(o.scissorRectangle):new Xr},this._passState=y,this._ready=!1;let x=o.name;N(x)||(x=zl()),this._name=x,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0,this._isShaft=Z(o.isShaft,!1),this._sunUsize=210,this._sunBoundingVolume=new Pi,this._sunScissorRectangle=new Xr}Object.defineProperties(ZB.prototype,{isShaft:{get:function(){return this._isShaft},set:function(o){this._isShaft=o}},ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(N(this._textureCache)){let o=this._textureCache.getFramebuffer(this._name);if(N(o))return o.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(o){this._selected=o}},parentSelected:{get:function(){return this._parentSelected},set:function(o){this._parentSelected=o}}});var Mxi=/uniform\s+sampler2D\s+depthTexture/g;ZB.prototype._isSupported=function(o){return!Mxi.test(this._fragmentShader)||o.depthTexture};function Dxi(o,f,m){let v=f[m];return(typeof v=="string"||v instanceof HTMLCanvasElement||v instanceof HTMLImageElement||v instanceof HTMLVideoElement||v instanceof ImageData)&&o._dirtyUniforms.push(m),{get:function(){return f[m]},set:function(y){let x=f[m];f[m]=y;let C=o._actualUniforms,w=C[m];N(w)&&w!==x&&w instanceof _o&&!N(o._textureCache.getStageByName(m))&&(o._texturesToRelease.push(w),delete C[m],delete C[`${m}Dimensions`]),x instanceof _o&&o._texturesToRelease.push(x),typeof y=="string"||y instanceof HTMLCanvasElement||y instanceof HTMLImageElement||y instanceof HTMLVideoElement||y instanceof ImageData?o._dirtyUniforms.push(m):C[m]=y}}}function Lxi(o,f){return function(){let m=o._actualUniforms[f];return typeof m=="function"?m():m}}function Rxi(o,f){return function(){let m=o[f]();if(N(m))return m.dimensions}}function Oxi(o){if(N(o._uniformMap))return;let f={},m={},v=o._uniforms,y=o._actualUniforms;for(let x in v)if(v.hasOwnProperty(x)){typeof v[x]!="function"?(f[x]=Lxi(o,x),m[x]=Dxi(o,v,x)):(f[x]=v[x],m[x]=v[x]),y[x]=v[x];let C=f[x]();(typeof C=="string"||C instanceof _o||C instanceof HTMLImageElement||C instanceof HTMLCanvasElement||C instanceof HTMLVideoElement)&&(f[`${x}Dimensions`]=Rxi(f,x))}o._uniforms={},Object.defineProperties(o._uniforms,m),o._uniformMap=va(f,{colorTexture:function(){return o._colorTexture},colorTextureDimensions:function(){return o._colorTexture.dimensions},depthTexture:function(){return o._depthTexture},depthTextureDimensions:function(){return o._depthTexture.dimensions},czm_idTexture:function(){return o._idTexture},czm_selectedIdTexture:function(){return o._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/o._selectedIdTexture.width}})}function Nxi(o,f){if(N(o._command)&&!o._logDepthChanged&&!o._selectedDirty)return;let m=o._fragmentShader;if(N(o._selectedIdTexture)){let y=o._selectedIdTexture.width;m=m.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),m=`#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; in vec2 v_textureCoordinates; bool czm_selected(vec2 offset) { bool selected = false; vec4 id = texture(czm_idTexture, v_textureCoordinates + offset); for (int i = 0; i < ${y}; ++i) { vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); if (all(equal(id, selectedId))) { return true; } } return false; } bool czm_selected() { return czm_selected(vec2(0.0)); } ${m}`}let v=new Zr({defines:[o._useLogDepth?"LOG_DEPTH":""],sources:[m]});if(o._isShaft){if(N(o._command)&&N(o._command.vertexArray))return;let y={direction:0},x=new Uint8Array(4*2);x[0]=0,x[1]=0,x[2]=255,x[3]=0,x[4]=255,x[5]=255,x[6]=0,x[7]=255;let C=Ao.createVertexBuffer({context:f,typedArray:x,usage:gn.STATIC_DRAW}),w=[{index:y.direction,vertexBuffer:C,componentsPerAttribute:2,normalize:!0,componentDatatype:Rt.UNSIGNED_BYTE}],A=Ao.createIndexBuffer({context:f,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:gn.STATIC_DRAW,indexDatatype:ro.UNSIGNED_SHORT}),E=new Du({context:f,attributes:w,indexBuffer:A}),T=new ga({attributes:{position:new en({componentDatatype:Rt.UNSIGNED_BYTE,componentsPerAttribute:2,values:[0,0,255,0,255,255,0,255]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Fn.TRIANGLES}),S={direction:0},M=Du.fromGeometry({context:f,geometry:T,attributeLocations:S,bufferUsage:gn.STATIC_DRAW,interleave:!0}),I=Mn.fromCache({blending:Mu.ALPHA_BLEND});o._command=new Jn({vertexArray:E,primitiveType:Fn.TRIANGLES,renderState:I,shaderProgram:Rs.fromCache({context:f,vertexShaderSource:oEe,fragmentShaderSource:v,attributeLocations:S}),uniformMap:o._uniformMap,owner:o,framebuffer:o.framebuffer,boundingVolume:new Pi,pass:o.pass})}else o._command=f.createViewportQuadCommand(v,{uniformMap:o._uniformMap,owner:o})}function Fxi(o){let f=o._sampleMode,m,v;f===zy.LINEAR?(m=Xa.LINEAR,v=Zu.LINEAR):(m=Xa.NEAREST,v=Zu.NEAREST);let y=o._sampler;(!N(y)||y.minificationFilter!==m||y.magnificationFilter!==v)&&(o._sampler=new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:m,magnificationFilter:v}))}function Bxi(o,f){return function(m){o._texturesToCreate.push({name:f,source:m})}}function kxi(o,f){return function(){return o._textureCache.getOutputTexture(f)}}function Vxi(o,f){let m,v,y,x=o._texturesToRelease,C=x.length;for(m=0;m<C;++m)v=x[m],v=v&&v.destroy();x.length=0;let w=o._texturesToCreate;for(C=w.length,m=0;m<C;++m){let S=w[m];y=S.name;let M=S.source;o._actualUniforms[y]=new _o({context:f,source:M})}w.length=0;let A=o._dirtyUniforms;if(A.length===0&&!N(o._texturePromise)){o._ready=!0;return}if(A.length===0||N(o._texturePromise))return;C=A.length;let E=o._uniforms,T=[];for(m=0;m<C;++m){y=A[m];let S=E[y],M=o._textureCache.getStageByName(S);if(N(M))o._actualUniforms[y]=kxi(o,S);else if(typeof S=="string"){let I=new Jr({url:S});T.push(I.fetchImage().then(Bxi(o,y)))}else o._texturesToCreate.push({name:y,source:S})}A.length=0,T.length>0?(o._ready=!1,o._texturePromise=Promise.all(T).then(function(){o._ready=!0,o._texturePromise=void 0})):o._ready=!0}function git(o){N(o._command)&&(o._command.shaderProgram=o._command.shaderProgram&&o._command.shaderProgram.destroy(),o._command=void 0),o._selectedIdTexture=o._selectedIdTexture&&o._selectedIdTexture.destroy();let f=o._textureCache;if(!N(f))return;let m=o._uniforms,v=o._actualUniforms;for(let y in v)v.hasOwnProperty(y)&&v[y]instanceof _o&&(N(f.getStageByName(m[y]))||v[y].destroy(),o._dirtyUniforms.push(y))}function zxi(o){let f=N(o._selected)?o._selected.length:0,m=N(o._parentSelected)?o._parentSelected:0,v=o._selected!==o._selectedShadow||f!==o._selectedLength;if(v=v||o._parentSelected!==o._parentSelectedShadow||m!==o._parentSelectedLength,N(o._selected)&&N(o._parentSelected)?o._combinedSelected=o._selected.concat(o._parentSelected):N(o._parentSelected)?o._combinedSelected=o._parentSelected:o._combinedSelected=o._selected,!v&&N(o._combinedSelected)){if(!N(o._combinedSelectedShadow))return!0;f=o._combinedSelected.length;for(let y=0;y<f;++y)if(o._combinedSelected[y]!==o._combinedSelectedShadow[y])return!0}return v}function Hxi(o,f){if(!o._selectedDirty)return;o._selectedIdTexture=o._selectedIdTexture&&o._selectedIdTexture.destroy(),o._selectedIdTexture=void 0;let m=o._combinedSelected;if(!N(m))return;let v,y,x=0,C=m.length;for(v=0;v<C;++v)y=m[v],N(y.pickIds)?x+=y.pickIds.length:N(y.pickId)&&++x;if(C===0||x===0){let T=new Uint8Array(4);T[0]=255,T[1]=255,T[2]=255,T[3]=255,o._selectedIdTexture=new _o({context:f,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,source:{arrayBufferView:T,width:1,height:1},sampler:gs.NEAREST});return}let w,A=0,E=new Uint8Array(x*4);for(v=0;v<C;++v)if(y=m[v],N(y.pickIds)){let T=y.pickIds,S=T.length;for(let M=0;M<S;++M)w=T[M].color,E[A]=Re.floatToByte(w.red),E[A+1]=Re.floatToByte(w.green),E[A+2]=Re.floatToByte(w.blue),E[A+3]=Re.floatToByte(w.alpha),A+=4}else N(y.pickId)&&(w=y.pickId.color,E[A]=Re.floatToByte(w.red),E[A+1]=Re.floatToByte(w.green),E[A+2]=Re.floatToByte(w.blue),E[A+3]=Re.floatToByte(w.alpha),A+=4);o._selectedIdTexture=new _o({context:f,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,source:{arrayBufferView:E,width:x,height:1},sampler:gs.NEAREST})}ZB.prototype.update=function(o,f){if(this.enabled!==this._enabled&&!this.enabled&&git(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=f!==this._useLogDepth,this._useLogDepth=f,this._selectedDirty=zxi(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=N(this._selected)?this._selected.length:0,this._parentSelectedLength=N(this._parentSelected)?this._parentSelected.length:0,Hxi(this,o),Oxi(this),Vxi(this,o),Nxi(this,o),Fxi(this),this._isShaft&&(Pi.clone(this._sunBoundingVolume,this._command.boundingVolume),Xr.clone(this._sunScissorRectangle,this.scissorRectangle)),this._selectedDirty=!1,!this._ready))return;let m=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=m,!N(m))return;let v=m.getColorTexture(0),y;(v.width!==o.drawingBufferWidth||v.height!==o.drawingBufferHeight)&&(y=this._renderState,(!N(y)||v.width!==y.viewport.width||v.height!==y.viewport.height)&&(this._renderState=Mn.fromCache({viewport:new Xr(0,0,v.width,v.height)}))),this._command.renderState=y};ZB.prototype.execute=function(o,f,m,v){if(!N(this._command)||!N(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=f,this._depthTexture=m,this._idTexture=v,gs.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let y=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;N(y)&&(y.context=o),this._command.execute(o,y)};ZB.prototype.isDestroyed=function(){return!1};ZB.prototype.destroy=function(){return git(this),kr(this)};var as=ZB;function $B(o){o=Z(o,Z.EMPTY_OBJECT),this._stages=o.stages,this._inputPreviousStageTexture=Z(o.inputPreviousStageTexture,!0);let f=o.name;N(f)||(f=zl()),this._name=f,this._uniforms=o.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties($B.prototype,{ready:{get:function(){let o=this._stages,f=o.length;for(let m=0;m<f;++m)if(!o[m].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(o){let f=this._stages,m=f.length;for(let v=0;v<m;++v)f[v].enabled=o}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(o){this._selected=o}},parentSelected:{get:function(){return this._parentSelected},set:function(o){this._parentSelected=o}}});$B.prototype._isSupported=function(o){let f=this._stages,m=f.length;for(let v=0;v<m;++v)if(!f[v]._isSupported(o))return!1;return!0};$B.prototype.get=function(o){return this._stages[o]};function Uxi(o){let f=N(o._selected)?o._selected.length:0,m=N(o._parentSelected)?o._parentSelected:0,v=o._selected!==o._selectedShadow||f!==o._selectedLength;if(v=v||o._parentSelected!==o._parentSelectedShadow||m!==o._parentSelectedLength,N(o._selected)&&N(o._parentSelected)?o._combinedSelected=o._selected.concat(o._parentSelected):N(o._parentSelected)?o._combinedSelected=o._parentSelected:o._combinedSelected=o._selected,!v&&N(o._combinedSelected)){if(!N(o._combinedSelectedShadow))return!0;f=o._combinedSelected.length;for(let y=0;y<f;++y)if(o._combinedSelected[y]!==o._combinedSelectedShadow[y])return!0}return v}$B.prototype.update=function(o,f){this._selectedDirty=Uxi(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=N(this._selected)?this._selected.length:0,this._parentSelectedLength=N(this._parentSelected)?this._parentSelected.length:0;let m=this._stages,v=m.length;for(let y=0;y<v;++y){let x=m[y];this._selectedDirty&&(x.parentSelected=this._combinedSelected),x.update(o,f)}};$B.prototype.isDestroyed=function(){return!1};$B.prototype.destroy=function(){let o=this._stages,f=o.length;for(let m=0;m<f;++m)o[m].destroy();return kr(this)};var z0=$B,ESe=`varying vec2 v_textureCoordinates; uniform sampler2D sunShaftTexture; uniform sampler2D colorTexture; //uniform float exposure = 1.0; const float exposure = 1.0; void main() { const float gamma = 2.2; vec3 hdrColor = texture(colorTexture, v_textureCoordinates).rgb; vec3 bloomColor = texture(sunShaftTexture, v_textureCoordinates).rgb; //vec3 bloomColor = texture(colorTexture, v_textureCoordinates).rgb; hdrColor += bloomColor; // additive blending // tone mapping //vec3 result = vec3(1.0) - exp(-hdrColor * exposure); // also gamma correct while we're at it //result = pow(result, vec3(1.0 / gamma)); //out_FragColor = vec4(result, 1.0); out_FragColor = vec4(hdrColor, 1.0); } `,TSe=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; // 0.0 for x direction, 1.0 for y direction uniform sampler2D sunTexture; #ifdef USE_STEP_SIZE uniform float stepSize; #else uniform vec2 step; #endif in vec2 v_textureCoordinates; // Incremental Computation of the Gaussian: // https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch40.html void main() { vec2 st = v_textureCoordinates; vec2 dir = vec2(1.0 - direction, direction); #ifdef USE_STEP_SIZE vec2 step = vec2(stepSize / czm_viewport.zw); #else vec2 step = step; #endif vec3 g; g.x = 1.0 / (sqrt(czm_twoPi) * sigma); g.y = exp((-0.5 * delta * delta) / (sigma * sigma)); g.z = g.y * g.y; vec4 result = texture(sunTexture, st) * g.x; for (int i = 1; i < SAMPLES; ++i) { g.xy *= g.yz; vec2 offset = float(i) * dir * step; result += texture(sunTexture, st - offset) * g.x; result += texture(sunTexture, st + offset) * g.x; } out_FragColor = result; } `,SSe=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; uniform sampler2D sunVisibleTexture; const float _BlurRadius = 0.04;//0.0293;//0.05;//0.06;//0.3; const float _Iteration = 26.0;//27.0;//30.0;//30; const float nFrag = 1.0 / 30.0; const float _SunScreenRadius = 0.1; const float exposure = 1.0; const float gamma = 2.2; const float strength = 0.1; float rnd(vec3 scale, float seed) { return fract(sin(dot(gl_FragCoord.stp + seed, scale)) * 43758.5453 + seed); } vec4 fragRadialBlur(vec2 p, vec2 sunCoord) { vec2 fc = p; vec2 fcc = fc - sunCoord; vec3 destColor = vec3(0.0); float random = rnd(vec3(12.9898, 78.233, 151.7182), 0.0); float totalWeight = 0.0; for (float i = 0.0; i <= _Iteration; i++) { float percent = (i + random) * nFrag; float weight = percent - percent * percent; vec2 t = fc - fcc * percent * strength * nFrag; destColor += texture(sunVisibleTexture, t).rgb * weight; totalWeight += weight; } return vec4(destColor / totalWeight, 1.0); } vec2 getCenter(vec2 sunCoord) { vec4 sunColor = texture(sunVisibleTexture, sunCoord); if(sunColor.x > 0.0) { return sunCoord; } vec2 step = vec2(0.0, 0.02); vec2 tmp = vec2(0.0, 0.0); for(float i = 0.0; i < 1.0; i += 0.02) { tmp = vec2(sunCoord.x, sunCoord.y + i); if(texture(sunVisibleTexture, tmp).r > 0.0 || tmp.y >= 1.0) { break; } } vec2 low = vec2(0.0, 0.0); if(texture(sunVisibleTexture, tmp).r > 0.0) { low = tmp; } else { return sunCoord; } for(float i = 0.0; i < 1.0; i += 0.02) { tmp = vec2(low.x, low.y + i); if(texture(sunVisibleTexture, tmp).r > 0.0 || tmp.y >= 1.0) { break; } } vec2 high; if(texture(sunVisibleTexture, tmp).r > 0.0) { high = tmp; } else { return sunCoord; } return (low + high) / 2.0; } vec4 getColor(vec2 p, vec2 sunCoord) { vec2 blurVector = (sunCoord - p) * _BlurRadius; //vec2 blurVector = (p - sunCoord) * _BlurRadius; vec4 acumulateColor = vec4(0, 0, 0, 0); vec2 texcoord = p; for (int j = 0; j < int(_Iteration); j ++) { acumulateColor += texture(sunVisibleTexture, texcoord); //acumulateColor += texture(colorTexture, texcoord); texcoord += blurVector; } vec4 color = acumulateColor / float(_Iteration); return color; } void main() { // Sun position vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); vec4 sunPositionEC = czm_view * sunPos; vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); //sunPos = sunPositionWC; vec2 sunTexcoord = sunPos.xy * 0.5 + vec2(0.5); //out_FragColor = length(sunTexcoord - v_textureCoordinates) > _SunScreenRadius // ? texture(sunVisibleTexture, v_textureCoordinates): getColor(v_textureCoordinates, sunTexcoord); vec2 center = getCenter(sunTexcoord); out_FragColor = getColor(v_textureCoordinates, center); //out_FragColor = fragRadialBlur(v_textureCoordinates, center); //vec4 color = getColor(v_textureCoordinates, center); // tone mapping //vec3 result = vec3(1.0) - exp(-color.rgb * exposure); // also gamma correct while we're at it //result = pow(result, vec3(1.0 / gamma)); //out_FragColor = vec4(result, 1.0); } `,ip={};function Hq(o){let f=`#define USE_STEP_SIZE ${Ej}`,m=new as({name:`${o}_x_direction`,fragmentShader:f,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:zy.LINEAR}),v=new as({name:`${o}_y_direction`,fragmentShader:f,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:zy.LINEAR}),y={};return Object.defineProperties(y,{delta:{get:function(){return m.uniforms.delta},set:function(x){let C=m.uniforms,w=v.uniforms;C.delta=w.delta=x}},sigma:{get:function(){return m.uniforms.sigma},set:function(x){let C=m.uniforms,w=v.uniforms;C.sigma=w.sigma=x}},stepSize:{get:function(){return m.uniforms.stepSize},set:function(x){let C=m.uniforms,w=v.uniforms;C.stepSize=w.stepSize=x}}}),new z0({name:o,stages:[m,v],uniforms:y})}ip.createBlurStage=function(){return Hq("czm_blur")};ip.createDepthOfFieldStage=function(){let o=Hq("czm_depth_of_field_blur"),f=new as({name:"czm_depth_of_field_composite",fragmentShader:pSe,uniforms:{focalDistance:5,blurTexture:o.name}}),m={};return Object.defineProperties(m,{focalDistance:{get:function(){return f.uniforms.focalDistance},set:function(v){f.uniforms.focalDistance=v}},delta:{get:function(){return o.uniforms.delta},set:function(v){o.uniforms.delta=v}},sigma:{get:function(){return o.uniforms.sigma},set:function(v){o.uniforms.sigma=v}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(v){o.uniforms.stepSize=v}}}),new z0({name:"czm_depth_of_field",stages:[o,f],inputPreviousStageTexture:!1,uniforms:m})};ip.isDepthOfFieldSupported=function(o){return o.context.depthTexture};ip.createEdgeDetectionStage=function(o){let f=zl();return new as({name:`czm_edge_detection_${f}`,fragmentShader:gSe,uniforms:{length:.25,color:Re.clone(Re.BLACK),width:Z(o.width,1)}})};ip.isEdgeDetectionSupported=function(o){return o.context.depthTexture};function Gxi(o){if(!N(o))return ip.createEdgeDetectionStage();let f=new z0({name:"czm_edge_detection_multiple",stages:o,inputPreviousStageTexture:!1}),m={},v="",y="";for(let w=0;w<o.length;++w)v+=`uniform sampler2D edgeTexture${w}; `,y+=` vec4 edge${w} = texture(edgeTexture${w}, v_textureCoordinates); if (edge${w}.a > 0.0) { color = edge${w}; break; } `,m[`edgeTexture${w}`]=o[w].name;let x=`${v}in vec2 v_textureCoordinates; void main() { vec4 color = vec4(0.0); for (int i = 0; i < ${o.length}; i++) { ${y} } out_FragColor = color; } `,C=new as({name:"czm_edge_detection_combine",fragmentShader:x,uniforms:m});return new z0({name:"czm_edge_detection_composite",stages:[f,C]})}ip.createSilhouetteStage=function(o){let f=Gxi(o),m=new as({name:"czm_silhouette_color_edges",fragmentShader:wSe,uniforms:{silhouetteTexture:f.name}});return new z0({name:"czm_silhouette",stages:[f,m],inputPreviousStageTexture:!1,uniforms:f.uniforms})};ip.isSilhouetteSupported=function(o){return o.context.depthTexture};ip.createBloomStage=function(){let o=new as({name:"czm_bloom_contrast_bias",fragmentShader:fSe,uniforms:{contrast:128,brightness:-.3}}),f=Hq("czm_bloom_blur"),m=new z0({name:"czm_bloom_contrast_bias_blur",stages:[o,f]}),v=new as({name:"czm_bloom_generate_composite",fragmentShader:hSe,uniforms:{glowOnly:!1,bloomTexture:m.name}}),y={};return Object.defineProperties(y,{glowOnly:{get:function(){return v.uniforms.glowOnly},set:function(x){v.uniforms.glowOnly=x}},contrast:{get:function(){return o.uniforms.contrast},set:function(x){o.uniforms.contrast=x}},brightness:{get:function(){return o.uniforms.brightness},set:function(x){o.uniforms.brightness=x}},delta:{get:function(){return f.uniforms.delta},set:function(x){f.uniforms.delta=x}},sigma:{get:function(){return f.uniforms.sigma},set:function(x){f.uniforms.sigma=x}},stepSize:{get:function(){return f.uniforms.stepSize},set:function(x){f.uniforms.stepSize=x}}}),new z0({name:"czm_bloom",stages:[m,v],inputPreviousStageTexture:!1,uniforms:y})};ip.createAmbientOcclusionStage=function(){let o=new as({name:"czm_ambient_occlusion_generate",fragmentShader:lSe,uniforms:{intensity:3,bias:.1,lengthCap:.26,stepSize:1.95,frustumLength:1e3,randomTexture:void 0}}),f=Hq("czm_ambient_occlusion_blur");f.uniforms.stepSize=.86;let m=new z0({name:"czm_ambient_occlusion_generate_blur",stages:[o,f]}),v=new as({name:"czm_ambient_occlusion_composite",fragmentShader:uSe,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:m.name}}),y={};return Object.defineProperties(y,{intensity:{get:function(){return o.uniforms.intensity},set:function(x){o.uniforms.intensity=x}},bias:{get:function(){return o.uniforms.bias},set:function(x){o.uniforms.bias=x}},lengthCap:{get:function(){return o.uniforms.lengthCap},set:function(x){o.uniforms.lengthCap=x}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(x){o.uniforms.stepSize=x}},frustumLength:{get:function(){return o.uniforms.frustumLength},set:function(x){o.uniforms.frustumLength=x}},randomTexture:{get:function(){return o.uniforms.randomTexture},set:function(x){o.uniforms.randomTexture=x}},delta:{get:function(){return f.uniforms.delta},set:function(x){f.uniforms.delta=x}},sigma:{get:function(){return f.uniforms.sigma},set:function(x){f.uniforms.sigma=x}},blurStepSize:{get:function(){return f.uniforms.stepSize},set:function(x){f.uniforms.stepSize=x}},ambientOcclusionOnly:{get:function(){return v.uniforms.ambientOcclusionOnly},set:function(x){v.uniforms.ambientOcclusionOnly=x}}}),new z0({name:"czm_ambient_occlusion",stages:[m,v],inputPreviousStageTexture:!1,uniforms:y})};ip.isAmbientOcclusionSupported=function(o){return o.context.depthTexture};var Wxi=`#define FXAA_QUALITY_PRESET 39 ${qAe} ${vSe}`;ip.createFXAAStage=function(){return new as({name:"czm_FXAA",fragmentShader:Wxi,sampleMode:zy.LINEAR})};ip.createAcesTonemappingStage=function(o){let f=o?`#define AUTO_EXPOSURE `:"";return f+=sSe,new as({name:"czm_aces",fragmentShader:f,uniforms:{autoExposure:void 0}})};ip.createFilmicTonemappingStage=function(o){let f=o?`#define AUTO_EXPOSURE `:"";return f+=_Se,new as({name:"czm_filmic",fragmentShader:f,uniforms:{autoExposure:void 0}})};ip.createReinhardTonemappingStage=function(o){let f=o?`#define AUTO_EXPOSURE `:"";return f+=bSe,new as({name:"czm_reinhard",fragmentShader:f,uniforms:{autoExposure:void 0}})};ip.createModifiedReinhardTonemappingStage=function(o){let f=o?`#define AUTO_EXPOSURE `:"";return f+=xSe,new as({name:"czm_modified_reinhard",fragmentShader:f,uniforms:{white:Re.WHITE,autoExposure:void 0}})};ip.createAutoExposureStage=function(){return new ASe};ip.createBlackAndWhiteStage=function(){return new as({name:"czm_black_and_white",fragmentShader:cSe,uniforms:{gradations:5}})};ip.createBrightnessStage=function(){return new as({name:"czm_brightness",fragmentShader:dSe,uniforms:{brightness:.5}})};ip.createNightVisionStage=function(){return new as({name:"czm_night_vision",fragmentShader:CSe})};ip.createDepthViewStage=function(){return new as({name:"czm_depth_view",fragmentShader:mSe})};ip.createLensFlareStage=function(){return new as({name:"czm_lens_flare",fragmentShader:ySe,uniforms:{dirtTexture:Ms("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Ms("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ki.WGS84.maximumRadius}})};ip.createSunShaftStage=function(){let o=new as({name:"czm_SunVisible",fragmentShader:nEe,isShaft:!0,sampleMode:zy.LINEAR,uniforms:{u_size:210}}),f=new as({name:"czm_SunVisibleShaft",fragmentShader:SSe,sampleMode:zy.LINEAR,uniforms:{sunVisibleTexture:o.name}}),m=Hq("czm_sun_shaft_blur"),v=1,y=2,x=1,C=`#define USE_STEP_SIZE ${TSe}`,w=new as({name:"czm_sun_shaft_x_direction",fragmentShader:C,uniforms:{delta:v,sigma:y,stepSize:x,direction:0,sunTexture:f.name},sampleMode:zy.LINEAR}),A=new as({name:"czm_sun_shaft_y_direction",fragmentShader:C,uniforms:{delta:v,sigma:y,stepSize:x,direction:1,sunTexture:w.name},sampleMode:zy.LINEAR}),E=new as({name:"czm_SunShaft_Modulate",fragmentShader:ESe,uniforms:{exposure:1,sunShaftTexture:A.name}}),T={};return Object.defineProperties(T,{exposure:{get:function(){return E.uniforms.exposure},set:function(S){E.uniforms.exposure=S}},u_size:{get:function(){return o.uniforms.u_size},set:function(S){o.uniforms.u_size=S}},delta:{get:function(){return w.uniforms.delta},set:function(S){let M=w.uniforms,I=A.uniforms;M.delta=I.delta=S}},sigma:{get:function(){return w.uniforms.sigma},set:function(S){let M=w.uniforms,I=A.uniforms;M.sigma=I.sigma=S}},stepSize:{get:function(){return w.uniforms.stepSize},set:function(S){let M=w.uniforms,I=A.uniforms;M.stepSize=I.stepSize=S}}}),new z0({name:"czm_SunShaft_All",inputPreviousStageTexture:!1,stages:[o,f,w,A,E],uniforms:T})};var D0=ip;function gD(o){this._collection=o,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function hW(o){for(;N(o.length);)o=o.get(o.length-1);return o.name}function Wge(o,f,m,v,y){if(!v.enabled||!v._isSupported(f))return y;let x=m[v.name]={};if(N(y)){let w=o.getStageByName(y);x[hW(w)]=!0}let C=v.uniforms;if(N(C)){let w=Object.getOwnPropertyNames(C),A=w.length;for(let E=0;E<A;++E){let T=C[w[E]];if(typeof T=="string"){let S=o.getStageByName(T);N(S)&&(x[hW(S)]=!0)}}}return v.name}function cz(o,f,m,v,y){if(N(v.enabled)&&!v.enabled||N(v._isSupported)&&!v._isSupported(f))return y;let x=y,C=!N(v.inputPreviousStageTexture)||v.inputPreviousStageTexture,w=y,A=v.length;for(let S=0;S<A;++S){let M=v.get(S);N(M.length)?w=cz(o,f,m,M,y):w=Wge(o,f,m,M,y),C&&(y=w)}let E,T;if(C)for(E=1;E<A;++E)T=hW(v.get(E)),N(m[T])||(m[T]={}),m[T][x]=!0;else for(E=1;E<A;++E){T=hW(v.get(E));let S=m[T];for(let M=0;M<E;++M)S[hW(v.get(M))]=!0}return w}function jxi(o,f){let m={};if(N(o.ambientOcclusion)){let v=o.ambientOcclusion,y=o.bloom,x=o._tonemapping,C=o.fxaa,w=cz(o,f,m,v,void 0);w=cz(o,f,m,y,w),w=Wge(o,f,m,x,w),w=cz(o,f,m,o,w);let A=o.sunShaft;w=cz(o,f,m,A,w),Wge(o,f,m,C,w)}else cz(o,f,m,o,void 0);return m}function Yxi(o,f,m){let v=o._collection.getStageByName(f),y=v._textureScale,x=v._forcePowerOfTwo,C=v._pixelFormat,w=v._pixelDatatype,A=v._clearColor,E,T,S=o._framebuffers,M=S.length;for(E=0;E<M;++E){if(T=S[E],y!==T.textureScale||x!==T.forcePowerOfTwo||C!==T.pixelFormat||w!==T.pixelDatatype||!Re.equals(A,T.clearColor))continue;let I=T.stages,P=I.length,D=!1;for(let L=0;L<P;++L)if(m[I[L]]){D=!0;break}if(!D)break}return N(T)&&E<M?(T.stages.push(f),T):(T={textureScale:y,forcePowerOfTwo:x,pixelFormat:C,pixelDatatype:w,clearColor:A,stages:[f],buffer:new $h({pixelFormat:C,pixelDatatype:w}),clear:void 0},S.push(T),T)}function qxi(o,f){let m=jxi(o._collection,f);for(let v in m)m.hasOwnProperty(v)&&(o._stageNameToFramebuffer[v]=Yxi(o,v,m[v]))}function jge(o){let f=o._framebuffers,m=f.length;for(let v=0;v<m;++v)f[v].buffer.destroy()}function Xxi(o,f){let m=o._width,v=o._height,y=o._framebuffers,x=y.length;for(let C=0;C<x;++C){let w=y[C],A=w.textureScale,E=Math.ceil(m*A),T=Math.ceil(v*A),S=Math.min(E,T);w.forcePowerOfTwo&&(xe.isPowerOfTwo(S)||(S=xe.nextPowerOfTwo(S)),E=S,T=S),w.buffer.update(f,E,T),w.clear=new Gc({color:w.clearColor,framebuffer:w.buffer.framebuffer})}}gD.prototype.updateDependencies=function(){this._updateDependencies=!0};gD.prototype.update=function(o){let f=this._collection,m=this._updateDependencies,v=N(f.ambientOcclusion)&&f.ambientOcclusion.enabled&&f.ambientOcclusion._isSupported(o),y=N(f.bloom)&&f.bloom.enabled&&f.bloom._isSupported(o),x=N(f._tonemapping)&&f._tonemapping.enabled&&f._tonemapping._isSupported(o),C=N(f.fxaa)&&f.fxaa.enabled&&f.fxaa._isSupported(o),w=!N(f._activeStages)||f._activeStages.length>0||v||y||x||C,A=N(f.sunShaft)&&f.sunShaft.enabled&&f.sunShaft._isSupported(o);if(w=!N(f._activeStages)||f._activeStages.length>0||v||y||x||C||A,(m||!w&&this._framebuffers.length>0)&&(jge(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!m&&!w)return;this._framebuffers.length===0&&qxi(this,o);let E=o.drawingBufferWidth,T=o.drawingBufferHeight,S=this._width!==E||this._height!==T;!m&&!S||(this._width=E,this._height=T,this._updateDependencies=!1,jge(this),Xxi(this,o))};gD.prototype.clear=function(o){let f=this._framebuffers;for(let m=0;m<f.length;++m)f[m].clear.execute(o)};gD.prototype.getStageByName=function(o){return this._collection.getStageByName(o)};gD.prototype.getOutputTexture=function(o){return this._collection.getOutputTexture(o)};gD.prototype.getFramebuffer=function(o){let f=this._stageNameToFramebuffer[o];if(N(f))return f.buffer.framebuffer};gD.prototype.isDestroyed=function(){return!1};gD.prototype.destroy=function(){return jge(this),kr(this)};var koe=gD,R7={REINHARD:0,MODIFIED_REINHARD:1,FILMIC:2,ACES:3,validate:function(o){return o===R7.REINHARD||o===R7.MODIFIED_REINHARD||o===R7.FILMIC||o===R7.ACES}},oH=Object.freeze(R7),PSe=[];function rx(){let o=D0.createFXAAStage(),f=D0.createAmbientOcclusionStage(),m=D0.createBloomStage(),v=D0.createSunShaftStage();this._autoExposureEnabled=!1,this._autoExposure=D0.createAutoExposureStage(),this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=oH.ACES;let y=this._tonemapping;o.enabled=!1,f.enabled=!1,m.enabled=!1,y.enabled=!1,v.enabled=!1;let x=new koe(this),C={},w=PSe;for(w.push(o,f,m,y,v);w.length>0;){let E=w.pop();C[E.name]=E,E._textureCache=x;let T=E.length;if(N(T))for(let S=0;S<T;++S)w.push(E.get(S))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let A=this;f.uniforms.randomTexture=function(){return A._randomTexture},this._ao=f,this._bloom=m,this._fxaa=o,this._sunShaft=v,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._sunShaftEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=C,this._textureCache=x}Object.defineProperties(rx.prototype,{ready:{get:function(){let o=!1,f=this._stages,m=f.length;for(let A=m-1;A>=0;--A){let E=f[A];o=o||E.ready&&E.enabled}let v=this._fxaa,y=this._ao,x=this._bloom,C=this._tonemapping,w=this._sunShaft;return o=o||v.ready&&v.enabled,o=o||y.ready&&y.enabled,o=o||x.ready&&x.enabled,o=o||C.ready&&C.enabled,o=o||w.ready&&w.enabled,o}},fxaa:{get:function(){return this._fxaa}},sunShaft:{get:function(){return this._sunShaft}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return ISe(this),this._stages.length}},outputTexture:{get:function(){let o=this._fxaa;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let f=this._stages,m=f.length;for(let w=m-1;w>=0;--w){let A=f[w];if(N(A)&&A.ready&&A.enabled)return this.getOutputTexture(A.name)}let v=this._tonemapping;if(v.enabled&&v.ready)return this.getOutputTexture(v.name);let y=this._bloom;if(y.enabled&&y.ready)return this.getOutputTexture(y.name);let x=this._ao;if(x.enabled&&x.ready)return this.getOutputTexture(x.name);let C=this._sunShaft;if(C.enabled&&C.ready)return this.getOutputTexture(C.name)}},hasSelected:{get:function(){let o=this._stages.slice();for(;o.length>0;){let f=o.pop();if(!N(f))continue;if(N(f.selected))return!0;let m=f.length;if(N(m))for(let v=0;v<m;++v)o.push(f.get(v))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(o){if(this._tonemapper===o)return;N(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let f=this._autoExposureEnabled,m;switch(o){case oH.REINHARD:m=D0.createReinhardTonemappingStage(f);break;case oH.MODIFIED_REINHARD:m=D0.createModifiedReinhardTonemappingStage(f);break;case oH.FILMIC:m=D0.createFilmicTonemappingStage(f);break;default:m=D0.createAcesTonemappingStage(f);break}if(f){let v=this._autoExposure;m.uniforms.autoExposure=function(){return v.outputTexture}}this._tonemapper=o,this._tonemapping=m,N(this._stageNames)&&(this._stageNames[m.name]=m,m._textureCache=this._textureCache),this._textureCacheDirty=!0}}});function ISe(o){if(!o._stagesRemoved)return;o._stagesRemoved=!1;let f=[],m=o._stages,v=m.length;for(let y=0,x=0;y<v;++y){let C=m[y];C&&(C._index=x++,f.push(C))}o._stages=f}rx.prototype.add=function(o){let f=this._stageNames,m=PSe;for(m.push(o);m.length>0;){let y=m.pop();f[y.name]=y,y._textureCache=this._textureCache;let x=y.length;if(N(x))for(let C=0;C<x;++C)m.push(y.get(C))}let v=this._stages;return o._index=v.length,v.push(o),this._textureCacheDirty=!0,o};rx.prototype.remove=function(o){if(!this.contains(o))return!1;let f=this._stageNames,m=PSe;for(m.push(o);m.length>0;){let v=m.pop();delete f[v.name];let y=v.length;if(N(y))for(let x=0;x<y;++x)m.push(v.get(x))}return this._stages[o._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,o._index=void 0,o._textureCache=void 0,o.destroy(),!0};rx.prototype.contains=function(o){return N(o)&&N(o._index)&&o._textureCache===this._textureCache};rx.prototype.get=function(o){return ISe(this),this._stages[o]};rx.prototype.removeAll=function(){let o=this._stages,f=o.length;for(let m=0;m<f;++m)this.remove(o[m]);o.length=0};rx.prototype.getStageByName=function(o){return this._stageNames[o]};rx.prototype.update=function(o,f,m){ISe(this);let v=this._activeStages,y=this._activeStages=this._previousActiveStages;this._previousActiveStages=v;let x=this._stages,C=y.length=x.length,w,A,E=0;for(w=0;w<C;++w)A=x[w],A.ready&&A.enabled&&A._isSupported(o)&&(y[E++]=A);y.length=E;let T=E!==v.length;if(!T){for(w=0;w<E;++w)if(y[w]!==v[w]){T=!0;break}}let S=this._ao,M=this._bloom,I=this._autoExposure,P=this._tonemapping,D=this._fxaa,L=this._sunShaft;P.enabled=m;let R=S.enabled&&S._isSupported(o),O=M.enabled&&M._isSupported(o),F=P.enabled&&P._isSupported(o),k=D.enabled&&D._isSupported(o),U=L.enabled&&L._isSupported(o);if((T||this._textureCacheDirty||R!==this._aoEnabled||O!==this._bloomEnabled||F!==this._tonemappingEnabled||k!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=R,this._bloomEnabled=O,this._tonemappingEnabled=F,this._fxaaEnabled=k,this._sunShaftEnabled=U,this._textureCacheDirty=!1),N(this._randomTexture)&&!R&&(this._randomTexture.destroy(),this._randomTexture=void 0),!N(this._randomTexture)&&R){C=256*256*3;let G=new Uint8Array(C);for(w=0;w<C;w+=3)G[w]=Math.floor(Math.random()*255);this._randomTexture=new _o({context:o,pixelFormat:Nn.RGB,pixelDatatype:Rn.UNSIGNED_BYTE,source:{arrayBufferView:G,width:256,height:256},sampler:new gs({wrapS:ha.REPEAT,wrapT:ha.REPEAT,minificationFilter:Xa.NEAREST,magnificationFilter:Zu.NEAREST})})}for(this._textureCache.update(o),D.update(o,f),U&&L.update(o,f),S.update(o,f),M.update(o,f),P.update(o,f),this._autoExposureEnabled&&I.update(o,f),C=x.length,w=0;w<C;++w)x[w].update(o,f);for(E=0,w=0;w<C;++w)A=x[w],A.ready&&A.enabled&&A._isSupported(o)&&E++;T=E!==y.length,T&&this.update(o,f,m)};rx.prototype.clear=function(o){this._textureCache.clear(o),this._autoExposureEnabled&&this._autoExposure.clear(o)};function DR(o){for(;N(o.length);)o=o.get(o.length-1);return o.outputTexture}rx.prototype.getOutputTexture=function(o){let f=this.getStageByName(o);if(N(f))return DR(f)};function PE(o,f,m,v,y){if(N(o.execute)){o.execute(f,m,v,y);return}let x=o.length,C;if(o.inputPreviousStageTexture)for(PE(o.get(0),f,m,v,y),C=1;C<x;++C)PE(o.get(C),f,DR(o.get(C-1)),v,y);else for(C=0;C<x;++C)PE(o.get(C),f,m,v,y)}rx.prototype.execute=function(o,f,m,v){let y=this._activeStages,x=y.length,C=this._fxaa,w=this._ao,A=this._bloom,E=this._autoExposure,T=this._tonemapping,S=this._sunShaft,M=w.enabled&&w._isSupported(o),I=A.enabled&&A._isSupported(o),P=this._autoExposureEnabled,D=T.enabled&&T._isSupported(o),L=C.enabled&&C._isSupported(o),R=S.enabled&&S._isSupported(o);if(!R&&!L&&!M&&!I&&!D&&x===0)return;let O=f;R&&S.ready&&(PE(S,o,O,m,v),O=DR(S)),M&&w.ready&&(PE(w,o,O,m,v),O=DR(w)),I&&A.ready&&(PE(A,o,O,m,v),O=DR(A)),P&&E.ready&&PE(E,o,O,m,v),D&&T.ready&&(PE(T,o,O,m,v),O=DR(T));let F=O;if(x>0){PE(y[0],o,O,m,v);for(let k=1;k<x;++k)PE(y[k],o,DR(y[k-1]),m,v);F=DR(y[x-1])}L&&C.ready&&PE(C,o,F,m,v)};rx.prototype.copy=function(o,f){if(!N(this._copyColorCommand)){let m=this;this._copyColorCommand=o.createViewportQuadCommand(NM,{uniformMap:{colorTexture:function(){return m.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=f,this._copyColorCommand.execute(o)};rx.prototype.isDestroyed=function(){return!1};rx.prototype.destroy=function(){return this._fxaa.destroy(),this._sunShaft.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),kr(this)};var MSe=rx,Jxi={SHIFT:0,CTRL:1,ALT:2},dC=Object.freeze(Jxi),Kxi={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Ei=Object.freeze(Kxi);function AO(o,f,m){let v=o._element;if(v===document)return m.x=f.clientX,m.y=f.clientY,m;let y=v.getBoundingClientRect();return m.x=f.clientX-y.left,m.y=f.clientY-y.top,m}function DSe(o,f){let m=o;return N(f)&&(m+=`+${f}`),m}function e4(o){if(o.shiftKey)return dC.SHIFT;if(o.ctrlKey)return dC.CTRL;if(o.altKey)return dC.ALT}var rg={LEFT:0,MIDDLE:1,RIGHT:2};function y1(o,f,m,v){function y(x){v(o,x)}pa.isInternetExplorer()?m.addEventListener(f,y,!1):m.addEventListener(f,y,{capture:!1,passive:!1}),o._removalFunctions.push(function(){m.removeEventListener(f,y,!1)})}function Qxi(o){let f=o._element,m=N(f.disableRootEvents)?f:document;pa.supportsPointerEvents()?(y1(o,"pointerdown",f,rCi),y1(o,"pointerup",f,UUe),y1(o,"pointermove",f,nCi),y1(o,"pointercancel",f,UUe)):(y1(o,"mousedown",f,_it),y1(o,"mouseup",m,vit),y1(o,"mousemove",m,yit),y1(o,"touchstart",f,tCi),y1(o,"touchend",m,BUe),y1(o,"touchmove",m,iCi),y1(o,"touchcancel",m,BUe)),y1(o,"dblclick",f,$xi);let v;"onwheel"in f?v="wheel":document.onmousewheel!==void 0?v="mousewheel":v="DOMMouseScroll",y1(o,v,f,eCi)}function Zxi(o){let f=o._removalFunctions;for(let m=0;m<f.length;++m)f[m]()}var RUe={position:new Ye};function LSe(o){o._lastSeenTouchEvent=$c()}function RSe(o){return $c()-o._lastSeenTouchEvent>TT.mouseEmulationIgnoreMilliseconds}function Yge(o,f,m){let v=o.x-f.x,y=o.y-f.y;return Math.sqrt(v*v+y*y)<m}function _it(o,f){if(!RSe(o))return;let m=f.button;o._buttonDown[m]=!0;let v;if(m===rg.LEFT)v=Ei.LEFT_DOWN;else if(m===rg.MIDDLE)v=Ei.MIDDLE_DOWN;else if(m===rg.RIGHT)v=Ei.RIGHT_DOWN;else return;let y=AO(o,f,o._primaryPosition);Ye.clone(y,o._primaryStartPosition),Ye.clone(y,o._primaryPreviousPosition);let x=e4(f),C=o.getInputAction(v,x);N(C)&&(Ye.clone(y,RUe.position),C(RUe),f.preventDefault())}var OUe={position:new Ye},NUe={position:new Ye};function tpe(o,f,m,v){let y=e4(v),x=o.getInputAction(f,y),C=o.getInputAction(m,y);if(N(x)||N(C)){let w=AO(o,v,o._primaryPosition);if(N(x)&&(Ye.clone(w,OUe.position),x(OUe)),N(C)){let A=o._primaryStartPosition;Yge(A,w,o._clickPixelTolerance)&&(Ye.clone(w,NUe.position),C(NUe))}}}function vit(o,f){if(!RSe(o))return;let m=f.button;m!==rg.LEFT&&m!==rg.MIDDLE&&m!==rg.RIGHT||(o._buttonDown[rg.LEFT]&&(tpe(o,Ei.LEFT_UP,Ei.LEFT_CLICK,f),o._buttonDown[rg.LEFT]=!1),o._buttonDown[rg.MIDDLE]&&(tpe(o,Ei.MIDDLE_UP,Ei.MIDDLE_CLICK,f),o._buttonDown[rg.MIDDLE]=!1),o._buttonDown[rg.RIGHT]&&(tpe(o,Ei.RIGHT_UP,Ei.RIGHT_CLICK,f),o._buttonDown[rg.RIGHT]=!1))}var ipe={startPosition:new Ye,endPosition:new Ye};function yit(o,f){if(!RSe(o))return;let m=e4(f),v=AO(o,f,o._primaryPosition),y=o._primaryPreviousPosition,x=o.getInputAction(Ei.MOUSE_MOVE,m);N(x)&&(Ye.clone(y,ipe.startPosition),Ye.clone(v,ipe.endPosition),x(ipe)),Ye.clone(v,y),(o._buttonDown[rg.LEFT]||o._buttonDown[rg.MIDDLE]||o._buttonDown[rg.RIGHT])&&f.preventDefault()}var FUe={position:new Ye};function $xi(o,f){let m=f.button,v;if(m===rg.LEFT)v=Ei.LEFT_DOUBLE_CLICK;else return;let y=e4(f),x=o.getInputAction(v,y);N(x)&&(AO(o,f,FUe.position),x(FUe))}function eCi(o,f){let m;if(N(f.deltaY)){let x=f.deltaMode;x===f.DOM_DELTA_PIXEL?m=-f.deltaY:x===f.DOM_DELTA_LINE?m=-f.deltaY*40:m=-f.deltaY*120}else f.detail>0?m=f.detail*-120:m=f.wheelDelta;if(!N(m))return;let v=e4(f),y=o.getInputAction(Ei.WHEEL,v);N(y)&&(y(m),f.preventDefault())}function tCi(o,f){LSe(o);let m=f.changedTouches,v,y=m.length,x,C,w=o._positions;for(v=0;v<y;++v)x=m[v],C=x.identifier,w.set(C,AO(o,x,new Ye));Voe(o,f);let A=o._previousPositions;for(v=0;v<y;++v)x=m[v],C=x.identifier,A.set(C,Ye.clone(w.get(C)))}function BUe(o,f){LSe(o);let m=f.changedTouches,v,y=m.length,x,C,w=o._positions;for(v=0;v<y;++v)x=m[v],C=x.identifier,w.remove(C);Voe(o,f);let A=o._previousPositions;for(v=0;v<y;++v)x=m[v],C=x.identifier,A.remove(C)}var kUe={position:new Ye},rpe={position1:new Ye,position2:new Ye},VUe={position:new Ye},zUe={position:new Ye},HUe={position:new Ye};function Voe(o,f){let m=e4(f),v=o._positions,y=v.length,x,C,w=o._isPinching;if(y!==1&&o._buttonDown[rg.LEFT]){if(o._buttonDown[rg.LEFT]=!1,N(o._touchHoldTimer)&&(clearTimeout(o._touchHoldTimer),o._touchHoldTimer=void 0),x=o.getInputAction(Ei.LEFT_UP,m),N(x)&&(Ye.clone(o._primaryPosition,VUe.position),x(VUe)),y===0&&!o._isTouchHolding&&(C=o.getInputAction(Ei.LEFT_CLICK,m),N(C))){let A=o._primaryStartPosition,E=o._previousPositions.values[0];Yge(A,E,o._clickPixelTolerance)&&(Ye.clone(o._primaryPosition,zUe.position),C(zUe))}o._isTouchHolding=!1}if(y===0&&w&&(o._isPinching=!1,x=o.getInputAction(Ei.PINCH_END,m),N(x)&&x()),y===1&&!w){let A=v.values[0];Ye.clone(A,o._primaryPosition),Ye.clone(A,o._primaryStartPosition),Ye.clone(A,o._primaryPreviousPosition),o._buttonDown[rg.LEFT]=!0,x=o.getInputAction(Ei.LEFT_DOWN,m),N(x)&&(Ye.clone(A,kUe.position),x(kUe)),o._touchHoldTimer=setTimeout(function(){if(!o.isDestroyed()&&(o._touchHoldTimer=void 0,o._isTouchHolding=!0,C=o.getInputAction(Ei.RIGHT_CLICK,m),N(C))){let E=o._primaryStartPosition,T=o._previousPositions.values[0];Yge(E,T,o._holdPixelTolerance)&&(Ye.clone(o._primaryPosition,HUe.position),C(HUe))}},TT.touchHoldDelayMilliseconds),f.preventDefault()}y===2&&!w&&(o._isPinching=!0,x=o.getInputAction(Ei.PINCH_START,m),N(x)&&(Ye.clone(v.values[0],rpe.position1),Ye.clone(v.values[1],rpe.position2),x(rpe),f.preventDefault()))}function iCi(o,f){LSe(o);let m=f.changedTouches,v,y=m.length,x,C,w=o._positions;for(v=0;v<y;++v){x=m[v],C=x.identifier;let E=w.get(C);N(E)&&AO(o,x,E)}xit(o,f);let A=o._previousPositions;for(v=0;v<y;++v)x=m[v],C=x.identifier,Ye.clone(w.get(C),A.get(C))}var npe={startPosition:new Ye,endPosition:new Ye},n7={distance:{startPosition:new Ye,endPosition:new Ye},angleAndHeight:{startPosition:new Ye,endPosition:new Ye}};function xit(o,f){let m=e4(f),v=o._positions,y=o._previousPositions,x=v.length,C;if(x===1&&o._buttonDown[rg.LEFT]){let w=v.values[0];Ye.clone(w,o._primaryPosition);let A=o._primaryPreviousPosition;C=o.getInputAction(Ei.MOUSE_MOVE,m),N(C)&&(Ye.clone(A,npe.startPosition),Ye.clone(w,npe.endPosition),C(npe)),Ye.clone(w,A),f.preventDefault()}else if(x===2&&o._isPinching&&(C=o.getInputAction(Ei.PINCH_MOVE,m),N(C))){let w=v.values[0],A=v.values[1],E=y.values[0],T=y.values[1],S=A.x-w.x,M=A.y-w.y,I=Math.sqrt(S*S+M*M)*.25,P=T.x-E.x,D=T.y-E.y,L=Math.sqrt(P*P+D*D)*.25,R=(A.y+w.y)*.125,O=(T.y+E.y)*.125,F=Math.atan2(M,S),k=Math.atan2(D,P);Ye.fromElements(0,L,n7.distance.startPosition),Ye.fromElements(0,I,n7.distance.endPosition),Ye.fromElements(k,O,n7.angleAndHeight.startPosition),Ye.fromElements(F,R,n7.angleAndHeight.endPosition),C(n7)}}function rCi(o,f){if(f.target.setPointerCapture(f.pointerId),f.pointerType==="touch"){let m=o._positions,v=f.pointerId;m.set(v,AO(o,f,new Ye)),Voe(o,f),o._previousPositions.set(v,Ye.clone(m.get(v)))}else _it(o,f)}function UUe(o,f){if(f.pointerType==="touch"){let m=o._positions,v=f.pointerId;m.remove(v),Voe(o,f),o._previousPositions.remove(v)}else vit(o,f)}function nCi(o,f){if(f.pointerType==="touch"){let m=o._positions,v=f.pointerId,y=m.get(v);if(!N(y))return;AO(o,f,y),xit(o,f);let x=o._previousPositions;Ye.clone(m.get(v),x.get(v))}else yit(o,f)}function TT(o){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-TT.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new Ye,this._primaryPosition=new Ye,this._primaryPreviousPosition=new Ye,this._positions=new wa,this._previousPositions=new wa,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=Z(o,document),Qxi(this)}TT.prototype.setInputAction=function(o,f,m){let v=DSe(f,m);this._inputEvents[v]=o};TT.prototype.getInputAction=function(o,f){let m=DSe(o,f);return this._inputEvents[m]};TT.prototype.removeInputAction=function(o,f){let m=DSe(o,f);delete this._inputEvents[m]};TT.prototype.isDestroyed=function(){return!1};TT.prototype.destroy=function(){return Zxi(this),kr(this)};TT.mouseEmulationIgnoreMilliseconds=800;TT.touchHoldDelayMilliseconds=1500;var Ur=TT;function t4(o){this._scene=o,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}t4.prototype.completeMorph=function(){N(this._completeMorph)&&this._completeMorph()};t4.prototype.morphTo2D=function(o,f){N(this._completeMorph)&&this._completeMorph();let m=this._scene;this._previousMode=m.mode,this._morphToOrthographic=m.camera.frustum instanceof Gs,!(this._previousMode===_i.SCENE2D||this._previousMode===_i.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,_i.SCENE2D,!0),m._mode=_i.MORPHING,m.camera._setTransform(Ee.IDENTITY),this._previousMode===_i.COLUMBUS_VIEW?BCi(this,o):WCi(this,o,f),o===0&&N(this._completeMorph)&&this._completeMorph())};var oCi=new H,aCi=new H,sCi=new H,lCi=new H,uCi=new H,cCi=new H,hCi=new H,dCi=new Mt,fCi=new Ee,pCi=new pc,mCi=new Gs,gCi={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};t4.prototype.morphToColumbusView=function(o,f){N(this._completeMorph)&&this._completeMorph();let m=this._scene;if(this._previousMode=m.mode,this._previousMode===_i.COLUMBUS_VIEW||this._previousMode===_i.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,_i.COLUMBUS_VIEW,!0),m.camera._setTransform(Ee.IDENTITY);let v=oCi,y=aCi,x=sCi;if(o>0)v.x=0,v.y=-1,v.z=1,v=H.multiplyByScalar(H.normalize(v,v),5*f.maximumRadius,v),H.negate(H.normalize(v,y),y),H.cross(H.UNIT_X,y,x);else{let E=m.camera;if(this._previousMode===_i.SCENE2D)H.clone(E.position,v),v.z=E.frustum.right-E.frustum.left,H.negate(H.UNIT_Z,y),H.clone(H.UNIT_Y,x);else{H.clone(E.positionWC,v),H.clone(E.directionWC,y),H.clone(E.upWC,x);let T=f.scaleToGeodeticSurface(v,hCi),S=tn.eastNorthUpToFixedFrame(T,f,fCi);Ee.inverseTransformation(S,S),m.mapProjection.project(f.cartesianToCartographic(v,dCi),v),Ee.multiplyByPointAsVector(S,y,y),Ee.multiplyByPointAsVector(S,x,x)}}let C;this._morphToOrthographic?(C=mCi,C.width=m.camera.frustum.right-m.camera.frustum.left,C.aspectRatio=m.drawingBufferWidth/m.drawingBufferHeight):(C=pCi,C.aspectRatio=m.drawingBufferWidth/m.drawingBufferHeight,C.fov=xe.toRadians(60));let w=gCi;w.position=v,w.direction=y,w.up=x,w.frustum=C;let A=YCi(w);Uq(this,A),this._previousMode===_i.SCENE2D?jCi(this,o,w,A):(w.position2D=Ee.multiplyByPoint(Vl.TRANSFORM_2D,v,lCi),w.direction2D=Ee.multiplyByPointAsVector(Vl.TRANSFORM_2D,y,uCi),w.up2D=Ee.multiplyByPointAsVector(Vl.TRANSFORM_2D,x,cCi),m._mode=_i.MORPHING,Mit(this,o,w,A)),o===0&&N(this._completeMorph)&&this._completeMorph()};var OSe={position:new H,direction:new H,up:new H,frustum:void 0},Cit=new pc;t4.prototype.morphTo3D=function(o,f){N(this._completeMorph)&&this._completeMorph();let m=this._scene;if(this._previousMode=m.mode,!(this._previousMode===_i.SCENE3D||this._previousMode===_i.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,_i.SCENE3D,!0),m._mode=_i.MORPHING,m.camera._setTransform(Ee.IDENTITY),this._previousMode===_i.SCENE2D)SCi(this,o,f);else{let v;o>0?(v=OSe,H.fromDegrees(0,0,5*f.maximumRadius,f,v.position),H.negate(v.position,v.direction),H.normalize(v.direction,v.direction),H.clone(H.UNIT_Z,v.up)):v=bit(this,f);let y,x=m.camera;x.frustum instanceof Gs?y=x.frustum.clone():(y=Cit,y.aspectRatio=m.drawingBufferWidth/m.drawingBufferHeight,y.fov=xe.toRadians(60)),v.frustum=y;let C=Lit(v);Uq(this,C),qge(this,o,v,C)}o===0&&N(this._completeMorph)&&this._completeMorph()}};t4.prototype.isDestroyed=function(){return!1};t4.prototype.destroy=function(){return zoe(this),kr(this)};function Uq(o,f){if(o._scene.completeMorphOnUserInput){o._morphHandler=new Ur(o._scene.canvas);let m=function(){o._morphCancelled=!0,o._scene.camera.cancelFlight(),f(o)};o._completeMorph=m,o._morphHandler.setInputAction(m,Ei.LEFT_DOWN),o._morphHandler.setInputAction(m,Ei.MIDDLE_DOWN),o._morphHandler.setInputAction(m,Ei.RIGHT_DOWN),o._morphHandler.setInputAction(m,Ei.WHEEL)}}function zoe(o){let f=o._currentTweens;for(let m=0;m<f.length;++m)f[m].cancelTween();o._currentTweens.length=0,o._morphHandler=o._morphHandler&&o._morphHandler.destroy()}var _Ci=new Mt,vCi=new H,yCi=new Ee;function bit(o,f){let m=o._scene,v=m.camera,y=OSe,x=y.position,C=y.direction,w=y.up,A=m.mapProjection.unproject(v.position,_Ci);f.cartographicToCartesian(A,x);let E=f.scaleToGeodeticSurface(x,vCi),T=tn.eastNorthUpToFixedFrame(E,f,yCi);return Ee.multiplyByPointAsVector(T,v.direction,C),Ee.multiplyByPointAsVector(T,v.up,w),y}var xCi=new H,CCi=new H,bCi=new H,wCi=new H,ACi=new H,ECi=new H;function qge(o,f,m,v){f*=.5;let y=o._scene,x=y.camera,C=H.clone(x.position,xCi),w=H.clone(x.direction,CCi),A=H.clone(x.up,bCi),E=Ee.multiplyByPoint(Vl.TRANSFORM_2D_INVERSE,m.position,wCi),T=Ee.multiplyByPointAsVector(Vl.TRANSFORM_2D_INVERSE,m.direction,ACi),S=Ee.multiplyByPointAsVector(Vl.TRANSFORM_2D_INVERSE,m.up,ECi);function M(P){Mw(C,E,P.time,x.position),Mw(w,T,P.time,x.direction),Mw(A,S,P.time,x.up),H.cross(x.direction,x.up,x.right),H.normalize(x.right,x.right)}let I=y.tweens.add({duration:f,easingFunction:Bv.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:M,complete:function(){Dit(o,y,0,1,f,v)}});o._currentTweens.push(I)}var TCi=new Gs,wit=new H,Ait=new H,Eit=new H,NSe=new H,Tit=new H,Sit=new H;function SCi(o,f,m){f/=3;let v=o._scene,y=v.camera,x;f>0?(x=OSe,H.fromDegrees(0,0,5*m.maximumRadius,m,x.position),H.negate(x.position,x.direction),H.normalize(x.direction,x.direction),H.clone(H.UNIT_Z,x.up)):(y.position.z=y.frustum.right-y.frustum.left,x=bit(o,m));let C;o._morphToOrthographic?(C=TCi,C.aspectRatio=v.drawingBufferWidth/v.drawingBufferHeight,C.width=y.frustum.right-y.frustum.left):(C=Cit,C.aspectRatio=v.drawingBufferWidth/v.drawingBufferHeight,C.fov=xe.toRadians(60)),x.frustum=C;let w=Lit(x);Uq(o,w);let A;o._morphToOrthographic?A=function(){qge(o,f,x,w)}:A=function(){Iit(o,f,x,function(){qge(o,f,x,w)})},f>0?(v._mode=_i.SCENE2D,y.flyTo({duration:f,destination:H.fromDegrees(0,0,5*m.maximumRadius,m,NSe),complete:function(){v._mode=_i.MORPHING,A()}})):A()}function Mw(o,f,m,v){return H.lerp(o,f,m,v)}function Pit(o,f,m,v,y){let x=o._scene,C=x.camera;if(C.frustum instanceof Gs)return;let w=C.frustum.fov,A=xe.RADIANS_PER_DEGREE*.5,E=m.position.z*Math.tan(w*.5);C.frustum.far=E/Math.tan(A*.5)+1e7;function T(M){C.frustum.fov=xe.lerp(w,A,M.time);let I=E/Math.tan(C.frustum.fov*.5);v(C,I)}let S=x.tweens.add({duration:f,easingFunction:Bv.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:T,complete:function(){C.frustum=m.frustum.clone(),y(o)}});o._currentTweens.push(S)}var PCi=new H,ICi=new H,MCi=new H,ope=new H,DCi=new H,LCi=new H,RCi=new Pm,OCi=new _s,NCi=new H,FCi={position:void 0,direction:void 0,up:void 0,frustum:void 0};function BCi(o,f){f*=.5;let m=o._scene,v=m.camera,y=H.clone(v.position,PCi),x=H.clone(v.direction,ICi),C=H.clone(v.up,MCi),w=H.negate(H.UNIT_Z,DCi),A=H.clone(H.UNIT_Y,LCi),E=ope;if(f>0)H.clone(H.ZERO,ope),E.z=5*m.mapProjection.ellipsoid.maximumRadius;else{H.clone(y,ope);let L=OCi;Ee.multiplyByPoint(Vl.TRANSFORM_2D,y,L.origin),Ee.multiplyByPointAsVector(Vl.TRANSFORM_2D,x,L.direction);let R=m.globe;if(N(R)){let O=R.pickWorldCoordinates(L,m,!0,NCi);N(O)&&(Ee.multiplyByPoint(Vl.TRANSFORM_2D_INVERSE,O,E),E.z+=H.distance(y,E))}}let T=RCi;T.right=E.z*.5,T.left=-T.right,T.top=T.right*(m.drawingBufferHeight/m.drawingBufferWidth),T.bottom=-T.top;let S=FCi;S.position=E,S.direction=w,S.up=A,S.frustum=T;let M=Rit(S);Uq(o,M);function I(L){Mw(y,E,L.time,v.position),Mw(x,w,L.time,v.direction),Mw(C,A,L.time,v.up),H.cross(v.direction,v.up,v.right),H.normalize(v.right,v.right),v._adjustOrthographicFrustum(!0)}function P(L,R){L.position.z=R}let D=m.tweens.add({duration:f,easingFunction:Bv.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:I,complete:function(){Pit(o,f,S,P,M)}});o._currentTweens.push(D)}var GUe=new Mt,kCi={position:new H,direction:new H,up:new H,position2D:new H,direction2D:new H,up2D:new H,frustum:new Pm},VCi={position:new H,direction:new H,up:new H,frustum:void 0},zCi=new H,HCi=new _s,UCi=new Ee,GCi=new H;function WCi(o,f,m){f*=.5;let v=o._scene,y=v.camera,x=kCi;if(f>0)H.clone(H.ZERO,x.position),x.position.z=5*m.maximumRadius,H.negate(H.UNIT_Z,x.direction),H.clone(H.UNIT_Y,x.up);else{m.cartesianToCartographic(y.positionWC,GUe),v.mapProjection.project(GUe,x.position),H.negate(H.UNIT_Z,x.direction),H.clone(H.UNIT_Y,x.up);let S=HCi;H.clone(x.position2D,S.origin);let M=H.clone(y.directionWC,S.direction),I=m.scaleToGeodeticSurface(y.positionWC,GCi),P=tn.eastNorthUpToFixedFrame(I,m,UCi);Ee.inverseTransformation(P,P),Ee.multiplyByPointAsVector(P,M,M),Ee.multiplyByPointAsVector(Vl.TRANSFORM_2D,M,M);let D=v.globe;if(N(D)){let L=D.pickWorldCoordinates(S,v,!0,zCi);if(N(L)){let R=H.distance(x.position2D,L);L.x+=R,H.clone(L,x.position2D)}}}function C(S,M){S.position.x=M}Ee.multiplyByPoint(Vl.TRANSFORM_2D,x.position,x.position2D),Ee.multiplyByPointAsVector(Vl.TRANSFORM_2D,x.direction,x.direction2D),Ee.multiplyByPointAsVector(Vl.TRANSFORM_2D,x.up,x.up2D);let w=x.frustum;w.right=x.position.z*.5,w.left=-w.right,w.top=w.right*(v.drawingBufferHeight/v.drawingBufferWidth),w.bottom=-w.top;let A=VCi;Ee.multiplyByPoint(Vl.TRANSFORM_2D_INVERSE,x.position2D,A.position),H.clone(x.direction,A.direction),H.clone(x.up,A.up),A.frustum=w;let E=Rit(A);Uq(o,E);function T(){Pit(o,f,x,C,E)}Mit(o,f,x,T)}function Iit(o,f,m,v){let y=o._scene,x=y.camera,C=x.frustum.right-x.frustum.left;x.frustum=m.frustum.clone();let w=x.frustum.fov,A=xe.RADIANS_PER_DEGREE*.5,E=C*Math.tan(w*.5);x.frustum.far=E/Math.tan(A*.5)+1e7,x.frustum.fov=A;function T(M){x.frustum.fov=xe.lerp(A,w,M.time),x.position.z=E/Math.tan(x.frustum.fov*.5)}let S=y.tweens.add({duration:f,easingFunction:Bv.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:T,complete:function(){v(o)}});o._currentTweens.push(S)}function jCi(o,f,m,v){f*=.5;let y=o._scene,x=y.camera,C=H.clone(m.position,NSe),w=H.clone(m.direction,Tit),A=H.clone(m.up,Sit);y._mode=_i.MORPHING;function E(){x.frustum=m.frustum.clone();let T=H.clone(x.position,wit),S=H.clone(x.direction,Ait),M=H.clone(x.up,Eit);T.z=C.z;function I(D){Mw(T,C,D.time,x.position),Mw(S,w,D.time,x.direction),Mw(M,A,D.time,x.up),H.cross(x.direction,x.up,x.right),H.normalize(x.right,x.right)}let P=y.tweens.add({duration:f,easingFunction:Bv.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:I,complete:function(){v(o)}});o._currentTweens.push(P)}o._morphToOrthographic?E():Iit(o,0,m,E)}function Mit(o,f,m,v){let y=o._scene,x=y.camera,C=H.clone(x.position,wit),w=H.clone(x.direction,Ait),A=H.clone(x.up,Eit),E=H.clone(m.position2D,NSe),T=H.clone(m.direction2D,Tit),S=H.clone(m.up2D,Sit);function M(P){Mw(C,E,P.time,x.position),Mw(w,T,P.time,x.direction),Mw(A,S,P.time,x.up),H.cross(x.direction,x.up,x.right),H.normalize(x.right,x.right),x._adjustOrthographicFrustum(!0)}let I=y.tweens.add({duration:f,easingFunction:Bv.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:M,complete:function(){Dit(o,y,1,0,f,v)}});o._currentTweens.push(I)}function Dit(o,f,m,v,y,x){let C={object:f,property:"morphTime",startValue:m,stopValue:v,duration:y,easingFunction:Bv.QUARTIC_OUT};N(x)&&(C.complete=function(){x(o)});let w=f.tweens.addProperty(C);o._currentTweens.push(w)}function Lit(o){return function(f){let m=f._scene;m._mode=_i.SCENE3D,m.morphTime=_i.getMorphTime(_i.SCENE3D),zoe(f);let v=m.camera;(f._previousMode!==_i.MORPHING||f._morphCancelled)&&(f._morphCancelled=!1,H.clone(o.position,v.position),H.clone(o.direction,v.direction),H.clone(o.up,v.up),H.cross(v.direction,v.up,v.right),H.normalize(v.right,v.right),v.frustum=o.frustum.clone());let y=v.frustum;m.frameState.useLogDepth&&(y.near=.1,y.far=1e10);let x=N(f._completeMorph);f._completeMorph=void 0,m.camera.update(m.mode),f._scene.morphComplete.raiseEvent(f,f._previousMode,_i.SCENE3D,x)}}function Rit(o){return function(f){let m=f._scene;m._mode=_i.SCENE2D,m.morphTime=_i.getMorphTime(_i.SCENE2D),zoe(f);let v=m.camera;H.clone(o.position,v.position),v.position.z=m.mapProjection.ellipsoid.maximumRadius*2,H.clone(o.direction,v.direction),H.clone(o.up,v.up),H.cross(v.direction,v.up,v.right),H.normalize(v.right,v.right),v.frustum=o.frustum.clone();let y=N(f._completeMorph);f._completeMorph=void 0,m.camera.update(m.mode),f._scene.morphComplete.raiseEvent(f,f._previousMode,_i.SCENE2D,y)}}function YCi(o){return function(f){let m=f._scene;m._mode=_i.COLUMBUS_VIEW,m.morphTime=_i.getMorphTime(_i.COLUMBUS_VIEW),zoe(f);let v=m.camera;(f._previousModeMode!==_i.MORPHING||f._morphCancelled)&&(f._morphCancelled=!1,H.clone(o.position,v.position),H.clone(o.direction,v.direction),H.clone(o.up,v.up),H.cross(v.direction,v.up,v.right),H.normalize(v.right,v.right));let y=v.frustum;m.frameState.useLogDepth&&(y.near=.1,y.far=1e10);let x=N(f._completeMorph);f._completeMorph=void 0,m.camera.update(m.mode),f._scene.morphComplete.raiseEvent(f,f._previousMode,_i.COLUMBUS_VIEW,x)}}var FSe=t4,qCi={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Hc=Object.freeze(qCi);function Mv(o,f){let m=o;return N(f)&&(m+=`+${f}`),m}function XCi(o,f){Ye.clone(o.distance.startPosition,f.distance.startPosition),Ye.clone(o.distance.endPosition,f.distance.endPosition),Ye.clone(o.angleAndHeight.startPosition,f.angleAndHeight.startPosition),Ye.clone(o.angleAndHeight.endPosition,f.angleAndHeight.endPosition)}function WUe(o,f,m){let v=Mv(Hc.PINCH,f),y=o._update,x=o._isDown,C=o._eventStartPosition,w=o._pressTime,A=o._releaseTime;y[v]=!0,x[v]=!1,C[v]=new Ye;let E=o._movement[v];N(E)||(E=o._movement[v]={}),E.distance={startPosition:new Ye,endPosition:new Ye},E.angleAndHeight={startPosition:new Ye,endPosition:new Ye},E.prevAngle=0,o._eventHandler.setInputAction(function(T){o._buttonsDown++,x[v]=!0,w[v]=new Date,Ye.lerp(T.position1,T.position2,.5,C[v])},Ei.PINCH_START,f),o._eventHandler.setInputAction(function(){o._buttonsDown=Math.max(o._buttonsDown-1,0),x[v]=!1,A[v]=new Date},Ei.PINCH_END,f),o._eventHandler.setInputAction(function(T){if(x[v]){y[v]?(XCi(T,E),y[v]=!1,E.prevAngle=E.angleAndHeight.startPosition.x):(Ye.clone(T.distance.endPosition,E.distance.endPosition),Ye.clone(T.angleAndHeight.endPosition,E.angleAndHeight.endPosition));let S=E.angleAndHeight.endPosition.x,M=E.prevAngle,I=Math.PI*2;for(;S>=M+Math.PI;)S-=I;for(;S<M-Math.PI;)S+=I;E.angleAndHeight.endPosition.x=-S*m.clientWidth/12,E.angleAndHeight.startPosition.x=-M*m.clientWidth/12}},Ei.PINCH_MOVE,f)}function jUe(o,f){let m=Mv(Hc.WHEEL,f),v=o._pressTime,y=o._releaseTime,x=o._update;x[m]=!0;let C=o._movement[m];N(C)||(C=o._movement[m]={});let w=o._lastMovement[m];N(w)||(w=o._lastMovement[m]={startPosition:new Ye,endPosition:new Ye,valid:!1}),C.startPosition=new Ye,Ye.clone(Ye.ZERO,C.startPosition),C.endPosition=new Ye,o._eventHandler.setInputAction(function(A){let E=7.5*xe.toRadians(A);v[m]=y[m]=new Date,C.endPosition.x=0,C.endPosition.y=E,Ye.clone(C.endPosition,w.endPosition),w.valid=!0,x[m]=!1},Ei.WHEEL,f)}function qV(o,f,m){let v=Mv(m,f),y=o._isDown,x=o._eventStartPosition,C=o._pressTime,w=o._releaseTime;y[v]=!1,x[v]=new Ye;let A=o._lastMovement[v];N(A)||(A=o._lastMovement[v]={startPosition:new Ye,endPosition:new Ye,valid:!1});let E,T;m===Hc.LEFT_DRAG?(E=Ei.LEFT_DOWN,T=Ei.LEFT_UP):m===Hc.RIGHT_DRAG?(E=Ei.RIGHT_DOWN,T=Ei.RIGHT_UP):m===Hc.MIDDLE_DRAG&&(E=Ei.MIDDLE_DOWN,T=Ei.MIDDLE_UP),o._eventHandler.setInputAction(function(S){o._buttonsDown++,A.valid=!1,y[v]=!0,C[v]=new Date,Ye.clone(S.position,x[v])},E,f),o._eventHandler.setInputAction(function(){o._buttonsDown=Math.max(o._buttonsDown-1,0),y[v]=!1,w[v]=new Date},T,f)}function YUe(o,f){Ye.clone(o.startPosition,f.startPosition),Ye.clone(o.endPosition,f.endPosition)}function qUe(o,f){let m=o._update,v=o._movement,y=o._lastMovement,x=o._isDown;for(let C in Hc)if(Hc.hasOwnProperty(C)){let w=Hc[C];if(N(w)){let A=Mv(w,f);m[A]=!0,N(o._lastMovement[A])||(o._lastMovement[A]={startPosition:new Ye,endPosition:new Ye,valid:!1}),N(o._movement[A])||(o._movement[A]={startPosition:new Ye,endPosition:new Ye})}}o._eventHandler.setInputAction(function(C){for(let w in Hc)if(Hc.hasOwnProperty(w)){let A=Hc[w];if(N(A)){let E=Mv(A,f);x[E]&&(m[E]?(YUe(v[E],y[E]),y[E].valid=!0,YUe(C,v[E]),m[E]=!1):Ye.clone(C.endPosition,v[E].endPosition))}}Ye.clone(C.endPosition,o._currentMousePosition)},Ei.MOUSE_MOVE,f)}function aA(o){this._eventHandler=new Ur(o),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new Ye,jUe(this,void 0),WUe(this,void 0,o),qV(this,void 0,Hc.LEFT_DRAG),qV(this,void 0,Hc.RIGHT_DRAG),qV(this,void 0,Hc.MIDDLE_DRAG),qUe(this,void 0);for(let f in dC)if(dC.hasOwnProperty(f)){let m=dC[f];N(m)&&(jUe(this,m),WUe(this,m,o),qV(this,m,Hc.LEFT_DRAG),qV(this,m,Hc.RIGHT_DRAG),qV(this,m,Hc.MIDDLE_DRAG),qUe(this,m))}}Object.defineProperties(aA.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let o=!this._update[Mv(Hc.WHEEL)]||!this._update[Mv(Hc.WHEEL,dC.SHIFT)]||!this._update[Mv(Hc.WHEEL,dC.CTRL)]||!this._update[Mv(Hc.WHEEL,dC.ALT)];return this._buttonsDown>0||o}}});aA.prototype.isMoving=function(o,f){let m=Mv(o,f);return!this._update[m]};aA.prototype.getMovement=function(o,f){let m=Mv(o,f);return this._movement[m]};aA.prototype.getLastMovement=function(o,f){let m=Mv(o,f),v=this._lastMovement[m];if(v.valid)return v};aA.prototype.isButtonDown=function(o,f){let m=Mv(o,f);return this._isDown[m]};aA.prototype.getStartMousePosition=function(o,f){if(o===Hc.WHEEL)return this._currentMousePosition;let m=Mv(o,f);return this._eventStartPosition[m]};aA.prototype.getButtonPressTime=function(o,f){let m=Mv(o,f);return this._pressTime[m]};aA.prototype.getButtonReleaseTime=function(o,f){let m=Mv(o,f);return this._releaseTime[m]};aA.prototype.reset=function(){for(let o in this._update)this._update.hasOwnProperty(o)&&(this._update[o]=!0)};aA.prototype.isDestroyed=function(){return!1};aA.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),kr(this)};var BSe=aA;function jte(o,f,m,v,y,x,C,w,A,E){this._tweens=o,this._tweenjs=f,this._startObject=uo(m),this._stopObject=uo(v),this._duration=y,this._delay=x,this._easingFunction=C,this._update=w,this._complete=A,this.cancel=E,this.needsStart=!0}Object.defineProperties(jte.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});jte.prototype.cancelTween=function(){this._tweens.remove(this)};function ST(){this._tweens=[]}Object.defineProperties(ST.prototype,{length:{get:function(){return this._tweens.length}}});ST.prototype.add=function(o){if(o=Z(o,Z.EMPTY_OBJECT),o.duration===0)return N(o.complete)&&o.complete(),new jte(this);let f=o.duration/lc.SECONDS_PER_MILLISECOND,m=Z(o.delay,0),v=m/lc.SECONDS_PER_MILLISECOND,y=Z(o.easingFunction,Bv.LINEAR_NONE),x=o.startObject,C=new zVt(x);C.to(uo(o.stopObject),f),C.delay(v),C.easing(y),N(o.update)&&C.onUpdate(function(){o.update(x)}),C.onComplete(Z(o.complete,null)),C.repeat(Z(o._repeat,0));let w=new jte(this,C,o.startObject,o.stopObject,o.duration,m,y,o.update,o.complete,o.cancel);return this._tweens.push(w),w};ST.prototype.addProperty=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.object,m=o.property,v=o.startValue,y=o.stopValue;function x(C){f[m]=C.value}return this.add({startObject:{value:v},stopObject:{value:y},duration:Z(o.duration,3),delay:o.delay,easingFunction:o.easingFunction,update:x,complete:o.complete,cancel:o.cancel,_repeat:o._repeat})};ST.prototype.addAlpha=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.material,m=[];for(let y in f.uniforms)f.uniforms.hasOwnProperty(y)&&N(f.uniforms[y])&&N(f.uniforms[y].alpha)&&m.push(y);function v(y){let x=m.length;for(let C=0;C<x;++C)f.uniforms[m[C]].alpha=y.alpha}return this.add({startObject:{alpha:Z(o.startValue,0)},stopObject:{alpha:Z(o.stopValue,1)},duration:Z(o.duration,3),delay:o.delay,easingFunction:o.easingFunction,update:v,complete:o.complete,cancel:o.cancel})};ST.prototype.addOffsetIncrement=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.material.uniforms;return this.addProperty({object:f,property:"offset",startValue:f.offset,stopValue:f.offset+1,duration:o.duration,delay:o.delay,easingFunction:o.easingFunction,update:o.update,cancel:o.cancel,_repeat:1/0})};ST.prototype.remove=function(o){if(!N(o))return!1;let f=this._tweens.indexOf(o);return f!==-1?(o.tweenjs.stop(),N(o.cancel)&&o.cancel(),this._tweens.splice(f,1),!0):!1};ST.prototype.removeAll=function(){let o=this._tweens;for(let f=0;f<o.length;++f){let m=o[f];m.tweenjs.stop(),N(m.cancel)&&m.cancel()}o.length=0};ST.prototype.contains=function(o){return N(o)&&this._tweens.indexOf(o)!==-1};ST.prototype.get=function(o){return this._tweens[o]};ST.prototype.update=function(o){let f=this._tweens,m=0;for(o=N(o)?o/lc.SECONDS_PER_MILLISECOND:$c();m<f.length;){let v=f[m],y=v.tweenjs;v.needsStart?(v.needsStart=!1,y.start(o)):y.update(o)?m++:(y.stop(),f.splice(m,1))}};var Hoe=ST;function Gq(o){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.translateEventTypes=Hc.LEFT_DRAG,this.zoomEventTypes=[Hc.RIGHT_DRAG,Hc.WHEEL,Hc.PINCH],this.rotateEventTypes=Hc.LEFT_DRAG,this.tiltEventTypes=[Hc.MIDDLE_DRAG,Hc.PINCH,{eventType:Hc.LEFT_DRAG,modifier:dC.CTRL},{eventType:Hc.RIGHT_DRAG,modifier:dC.CTRL}],this.lookEventTypes={eventType:Hc.LEFT_DRAG,modifier:dC.SHIFT},this.minimumPickingTerrainHeight=15e4,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=4e3,this.minimumCollisionTerrainHeight=15e3,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=75e5,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.enableModelCollisionDetection=!1,this.enableGroundRoaming=!1,this.enableModelGroundCollisionDetection=!1,this.defaultGroundRoamingHeight=1.8,this.defaultCollisionRayWidth=.5,this._scene=o,this._globe=void 0,this._ellipsoid=void 0,this._aggregator=new BSe(o.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new Hoe,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new Ye(-1,-1),this._tiltCenter=new H,this._rotateMousePosition=new Ye(-1,-1),this._rotateStartPosition=new H,this._strafeStartPosition=new H,this._strafeMousePosition=new Ye,this._strafeEndMousePosition=new Ye,this._zoomMouseStart=new Ye(-1,-1),this._zoomWorldPosition=new H,this._useZoomWorldPosition=!1,this._panLastMousePosition=new Ye,this._panLastWorldPosition=new H,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let f=o.mapProjection;this._maxCoord=f.project(new Mt(Math.PI,xe.PI_OVER_TWO)),this._zoomFactor=5,this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function JCi(o,f){if(o<0)return 0;let m=(1-f)*25;return Math.exp(-m*o)}function KCi(o){return Ye.equalsEpsilon(o.startPosition,o.endPosition,xe.EPSILON14)}var QCi=.4;function ZCi(o,f,m,v,y,x,C){let w=x[C];N(w)||(w=x[C]={startPosition:new Ye,endPosition:new Ye,motion:new Ye,inertiaEnabled:!0});let A=o.getButtonPressTime(f,m),E=o.getButtonReleaseTime(f,m),T=A&&E&&(E.getTime()-A.getTime())/1e3,S=E&&(new Date().getTime()-E.getTime())/1e3;if(A&&E&&T<QCi){let M=JCi(S,v),I=o.getLastMovement(f,m);if(!N(I)||KCi(I)||!w.inertiaEnabled||(w.motion.x=(I.endPosition.x-I.startPosition.x)*.5,w.motion.y=(I.endPosition.y-I.startPosition.y)*.5,w.startPosition=Ye.clone(I.startPosition,w.startPosition),w.endPosition=Ye.multiplyByScalar(w.motion,M,w.endPosition),w.endPosition=Ye.add(w.startPosition,w.endPosition,w.endPosition),isNaN(w.endPosition.x)||isNaN(w.endPosition.y)||Ye.distance(w.startPosition,w.endPosition)<.5))return;if(!o.isButtonDown(f,m)){let P=o.getStartMousePosition(f,m);y(x,P,w)}}}function $Ci(o,f){if(N(f)){let m=o[f];N(m)&&(m.inertiaEnabled=!0);let v=o._inertiaDisablers[f];if(N(v)){let y=v.length;for(let x=0;x<y;++x)m=o[v[x]],N(m)&&(m.inertiaEnabled=!1)}}}var XUe=[];function Oy(o,f,m,v,y,x){if(!N(m))return;let C=o._aggregator;Array.isArray(m)||(XUe[0]=m,m=XUe);let w=m.length;for(let A=0;A<w;++A){let E=m[A],T=N(E.eventType)?E.eventType:E,S=E.modifier,M=C.isMoving(T,S)&&C.getMovement(T,S),I=C.getStartMousePosition(T,S);o.enableInputs&&f&&(M?(v(o,I,M),$Ci(o,x)):y<1&&ZCi(C,T,S,y,v,o,x))}}var QZ=new _s,e1i=new H,t1i=new Ye,i1i=new H,r1i=new Ye,n1i=new H,o1i=new H,a1i=new H,s1i=new H,Oit=new H,l1i=new H,u1i=new H,c1i=new H,h1i=new H,d1i=new H,f1i=new H,p1i=new H,m1i=new H,g1i=new H,_1i=new H,BF=new H,JUe=new H,KUe=new H,ape={orientation:new dl};function kSe(o,f,m,v,y,x){let C=1;N(x)&&(C=xe.clamp(Math.abs(x),.25,1));let w=m.endPosition.y-m.startPosition.y,A=w>0?o.minimumZoomDistance*C:0,E=o.maximumZoomDistance,T=y-A,S=v*T;S=xe.clamp(S,o._minimumZoomRate,o._maximumZoomRate);let M=w/o._scene.canvas.clientHeight;M=Math.min(M,o.maximumMovementRatio);let I=S*M;if(o.enableCollisionDetection||o.minimumZoomDistance===0||!N(o._globe)){if(I>0&&Math.abs(y-A)<1||I<0&&Math.abs(y-E)<1)return;y-I<A?I=y-A-1:y-I>E&&(I=y-E)}let P=o._scene,D=P.camera,L=P.mode,R=ape.orientation;if(R.heading=D.heading,R.pitch=D.pitch,R.roll=D.roll,D.frustum instanceof Gs){Math.abs(I)>0&&(D.zoomIn(I),D._adjustOrthographicFrustum(!0));return}let O=Z(m.inertiaEnabled,Ye.equals(f,o._zoomMouseStart)),F=o._zoomingOnVector,k=o._rotatingZoom,U;if(O||(o._zoomMouseStart=Ye.clone(f,o._zoomMouseStart),N(o._globe)&&L===_i.SCENE2D?(U=D.getPickRay(f,QZ).origin,U=H.fromElements(U.y,U.z,U.x)):N(o._globe)&&(U=FM(o,f,e1i,!0)),N(U)?(o._useZoomWorldPosition=!0,o._zoomWorldPosition=H.clone(U,o._zoomWorldPosition)):o._useZoomWorldPosition=!1,F=o._zoomingOnVector=!1,k=o._rotatingZoom=!1,o._zoomingUnderground=o._cameraUnderground),!o._useZoomWorldPosition){D.zoomIn(I);return}let G=L===_i.COLUMBUS_VIEW;if(D.positionCartographic.height<2e6&&(k=!0),!O||k){if(L===_i.SCENE2D){let j=o._zoomWorldPosition,q=D.position;if(!H.equals(j,q)&&D.positionCartographic.height<o._maxCoord.x*2){let J=D.position.x,X=H.subtract(j,q,i1i);H.normalize(X,X);let Y=H.distance(j,q)*I/(D.getMagnitude()*.5);D.move(X,Y*.5),(D.position.x<0&&J>0||D.position.x>0&&J<0)&&(U=D.getPickRay(f,QZ).origin,U=H.fromElements(U.y,U.z,U.x),o._zoomWorldPosition=H.clone(U,o._zoomWorldPosition))}}else if(L===_i.SCENE3D){let j=H.normalize(D.position,Oit);if(o._cameraUnderground||o._zoomingUnderground||D.positionCartographic.height<3e3&&Math.abs(H.dot(D.direction,j))<.6)G=!0;else{let q=P.canvas,J=r1i;J.x=q.clientWidth/2,J.y=q.clientHeight/2;let X=FM(o,J,n1i,!0);if(!N(X))G=!0;else if(D.positionCartographic.height<1e6)if(H.dot(D.direction,j)>=-.5)G=!0;else{let Y=u1i;H.clone(D.position,Y);let Q=o._zoomWorldPosition,ee=l1i;if(ee=H.normalize(Q,ee),H.dot(ee,j)<0)return;let z=_1i,ie=d1i;H.clone(D.direction,ie),H.add(Y,H.multiplyByScalar(ie,1e3,BF),z);let re=f1i,ne=p1i;H.subtract(Q,Y,re),H.normalize(re,ne);let oe=H.dot(j,ne);if(oe>=0){o._zoomMouseStart.x=-1;return}let se=Math.acos(-oe),ae=H.magnitude(Y),fe=H.magnitude(Q),de=ae-I,ve=H.magnitude(re),pe=Math.asin(xe.clamp(ve/fe*Math.sin(se),-1,1)),ce=Math.asin(xe.clamp(de/fe*Math.sin(se),-1,1)),he=pe-ce+se,Ce=c1i;H.normalize(Y,Ce);let Se=h1i;Se=H.cross(ne,Ce,Se),Se=H.normalize(Se,Se),H.normalize(H.cross(Ce,Se,BF),ie),H.multiplyByScalar(H.normalize(z,BF),H.magnitude(z)-I,z),H.normalize(Y,Y),H.multiplyByScalar(Y,de,Y);let De=m1i;H.multiplyByScalar(H.add(H.multiplyByScalar(Ce,Math.cos(he)-1,JUe),H.multiplyByScalar(ie,Math.sin(he),KUe),BF),de,De),H.add(Y,De,Y),H.normalize(z,Ce),H.normalize(H.cross(Ce,Se,BF),ie);let Oe=g1i;H.multiplyByScalar(H.add(H.multiplyByScalar(Ce,Math.cos(he)-1,JUe),H.multiplyByScalar(ie,Math.sin(he),KUe),BF),H.magnitude(z),Oe),H.add(z,Oe,z),H.clone(Y,D.position),H.normalize(H.subtract(z,Y,BF),D.direction),H.clone(D.direction,D.direction),H.cross(D.direction,D.up,D.right),H.cross(D.right,D.direction,D.up),D.setView(ape);return}else{let Y=H.normalize(X,o1i),Q=H.normalize(o._zoomWorldPosition,a1i),ee=H.dot(Q,Y);if(ee>0&&ee<1){let z=xe.acosClamped(ee),ie=H.cross(Q,Y,s1i),re=Math.abs(z)>xe.toRadians(20)?D.positionCartographic.height*.75:D.positionCartographic.height-I,ne=I/re;D.rotate(ie,z*ne)}}}}o._rotatingZoom=!G}if(!O&&G||F){let j,q=nl.wgs84ToWindowCoordinates(P,o._zoomWorldPosition,t1i);L!==_i.COLUMBUS_VIEW&&Ye.equals(f,o._zoomMouseStart)&&N(q)?j=D.getPickRay(q,QZ):j=D.getPickRay(f,QZ);let J=j.direction;(L===_i.COLUMBUS_VIEW||L===_i.SCENE2D)&&H.fromElements(J.y,J.z,J.x,J),D.move(J,I),o._zoomingOnVector=!0}else D.zoomIn(I);o._cameraUnderground||D.setView(ape)}var v1i=new _s,y1i=new _s,x1i=new H;function C1i(o,f,m){let v=o._scene.camera,y=v.getPickRay(m.startPosition,v1i).origin,x=v.getPickRay(m.endPosition,y1i).origin;y=H.fromElements(y.y,y.z,y.x,y),x=H.fromElements(x.y,x.z,x.x,x);let C=H.subtract(y,x,x1i),w=H.magnitude(C);w>0&&(H.normalize(C,C),v.move(C,w))}function QUe(o,f,m){N(m.distance)&&(m=m.distance);let v=o._scene.camera;kSe(o,f,m,o._zoomFactor,v.getMagnitude())}var b1i=new Ye,w1i=new Ye;function ZUe(o,f,m){if(N(m.angleAndHeight)){A1i(o,f,m.angleAndHeight);return}let v=o._scene,y=v.camera,x=v.canvas,C=x.clientWidth,w=x.clientHeight,A=b1i;A.x=2/C*m.startPosition.x-1,A.y=2/w*(w-m.startPosition.y)-1,A=Ye.normalize(A,A);let E=w1i;E.x=2/C*m.endPosition.x-1,E.y=2/w*(w-m.endPosition.y)-1,E=Ye.normalize(E,E);let T=xe.acosClamped(A.x);A.y<0&&(T=xe.TWO_PI-T);let S=xe.acosClamped(E.x);E.y<0&&(S=xe.TWO_PI-S);let M=S-T;y.twistRight(M)}function A1i(o,f,m){let v=o._rotateFactor*o._rotateRateRangeAdjustment;v>o._maximumRotateRate&&(v=o._maximumRotateRate),v<o._minimumRotateRate&&(v=o._minimumRotateRate);let y=o._scene,x=y.camera,C=y.canvas,w=(m.endPosition.x-m.startPosition.x)/C.clientWidth;w=Math.min(w,o.maximumMovementRatio);let A=v*w*Math.PI*4;x.twistRight(A)}function E1i(o){let f=o._scene.mapMode2D===$E.ROTATE;Ee.equals(Ee.IDENTITY,o._scene.camera.transform)?(Oy(o,o.enableTranslate,o.translateEventTypes,C1i,o.inertiaTranslate,"_lastInertiaTranslateMovement"),Oy(o,o.enableZoom,o.zoomEventTypes,QUe,o.inertiaZoom,"_lastInertiaZoomMovement"),f&&Oy(o,o.enableRotate,o.tiltEventTypes,ZUe,o.inertiaSpin,"_lastInertiaTiltMovement")):(Oy(o,o.enableZoom,o.zoomEventTypes,QUe,o.inertiaZoom,"_lastInertiaZoomMovement"),f&&Oy(o,o.enableRotate,o.translateEventTypes,ZUe,o.inertiaSpin,"_lastInertiaSpinMovement"))}var Nit=new _s,T1i=new H,S1i=new H;function FM(o,f,m,v){let y=o._scene,x=o._globe,C=y.camera,w;if(y.pickPositionSupported&&(w=y.pickPositionWorldCoordinates(f,T1i)),!N(x))return H.clone(w,m);let A=!o._cameraUnderground,E=C.getPickRay(f,Nit),T=x.pickWorldCoordinates(E,y,A,S1i),S=N(w)?H.distance(w,C.positionWC):Number.POSITIVE_INFINITY,M=N(T)?H.distance(T,C.positionWC):Number.POSITIVE_INFINITY;return S<M?H.clone(w,m):H.clone(T,m)}var P1i=new Mt;function Yte(o){let f=o._ellipsoid,m=o._scene,v=m.camera,y=m.mode,x=0;if(y===_i.SCENE3D){let w=f.cartesianToCartographic(v.position,P1i);N(w)&&(x=w.height)}else x=v.position.z;let C=Z(o._scene.globeHeight,0);return Math.abs(C-x)}var I1i=new H;function Fit(o,f){let m=f.origin,v=f.direction,y=Yte(o),x=H.normalize(m,I1i),C=Math.abs(H.dot(x,v));return C=Math.max(C,.5)*2,y*C}function Bit(o,f,m,v){let y=H.distance(f.origin,m),x=Yte(o),C=xe.clamp(x*5,o._minimumUndergroundPickDistance,o._maximumUndergroundPickDistance);return y>C&&(y=Math.min(y,x/5),y=Math.max(y,100)),_s.getPoint(f,y,v)}function kit(o,f,m,v){let y;return N(m)?(y=H.distance(f.origin,m),y>o._maximumUndergroundPickDistance&&(y=Yte(o))):y=Yte(o),_s.getPoint(f,y,v)}var M1i=new Ye;function Vit(o,f){let m=f.endPosition,v=Ye.subtract(f.endPosition,f.startPosition,M1i),y=o._strafeEndMousePosition;Ye.add(y,v,y),f.endPosition=y,VSe(o,f,o._strafeStartPosition),f.endPosition=m}var $Ue=new _s,D1i=new _s,spe=new H,L1i=new H,R1i=new H,O1i=new H,N1i=new $a(H.UNIT_X,0),F1i=new Ye,B1i=new Ye;function k1i(o,f,m){if(H.equals(f,o._translateMousePosition)||(o._looking=!1),H.equals(f,o._strafeMousePosition)||(o._strafing=!1),o._looking){q1(o,f,m);return}if(o._strafing){Vit(o,m);return}let v=o._scene.camera,y=o._cameraUnderground,x=Ye.clone(m.startPosition,F1i),C=Ye.clone(m.endPosition,B1i),w=v.getPickRay(x,$Ue),A=H.clone(H.ZERO,O1i),E=H.UNIT_X,T;if(v.position.z<o._minimumPickingTerrainHeight&&(T=FM(o,x,spe),N(T)&&(A.x=T.x)),y||A.x>v.position.z&&N(T)){let O=T;y&&(O=kit(o,w,T,spe)),Ye.clone(f,o._strafeMousePosition),Ye.clone(f,o._strafeEndMousePosition),H.clone(O,o._strafeStartPosition),o._strafing=!0,VSe(o,m,o._strafeStartPosition);return}let S=$a.fromPointNormal(A,E,N1i);w=v.getPickRay(x,$Ue);let M=Hh.rayPlane(w,S,spe),I=v.getPickRay(C,D1i),P=Hh.rayPlane(I,S,L1i);if(!N(M)||!N(P)){o._looking=!0,q1(o,f,m),Ye.clone(f,o._translateMousePosition);return}let D=H.subtract(M,P,R1i),L=D.x;D.x=D.y,D.y=D.z,D.z=L;let R=H.magnitude(D);R>xe.EPSILON6&&(H.normalize(D,D),v.move(D,R))}var zit=new Ye,see=new _s,lee=new H,V1i=new H,Hit=new Ee,z1i=new Ee,H1i=new H,U1i=new $a(H.UNIT_X,0),lpe=new H,Xge=new Mt,Uit=new Ee,G1i=new Gr,W1i=new Ut,uee=new H;function j1i(o,f,m){if(N(m.angleAndHeight)&&(m=m.angleAndHeight),Ye.equals(f,o._tiltCenterMousePosition)||(o._tiltCVOffMap=!1,o._looking=!1),o._looking){q1(o,f,m);return}let v=o._scene.camera;o._tiltCVOffMap||!o.onMap()||Math.abs(v.position.z)>o._minimumPickingTerrainHeight?(o._tiltCVOffMap=!0,Y1i(o,f,m)):q1i(o,f,m)}function Y1i(o,f,m){let v=o._scene,y=v.camera,x=v.canvas,C=zit;C.x=x.clientWidth/2,C.y=x.clientHeight/2;let w=y.getPickRay(C,see),A=H.UNIT_X,E=w.origin,T=w.direction,S,M=H.dot(A,T);if(Math.abs(M)>xe.EPSILON6&&(S=-H.dot(A,E)/M),!N(S)||S<=0){o._looking=!0,q1(o,f,m),Ye.clone(f,o._tiltCenterMousePosition);return}let I=H.multiplyByScalar(T,S,lee);H.add(E,I,I);let P=v.mapProjection,D=P.ellipsoid;H.fromElements(I.y,I.z,I.x,I);let L=P.unproject(I,Xge);D.cartographicToCartesian(L,I);let R=tn.eastNorthUpToFixedFrame(I,D,Hit),O=o._globe,F=o._ellipsoid;o._globe=void 0,o._ellipsoid=ki.UNIT_SPHERE,o._rotateFactor=1,o._rotateRateRangeAdjustment=1;let k=Ee.clone(y.transform,Uit);y._setTransform(R),Y1(o,f,m,H.UNIT_Z),y._setTransform(k),o._globe=O,o._ellipsoid=F;let U=F.maximumRadius;o._rotateFactor=1/U,o._rotateRateRangeAdjustment=U}function q1i(o,f,m){let v=o._scene,y=v.camera,x=o._cameraUnderground,C,w,A=H.UNIT_X;if(Ye.equals(f,o._tiltCenterMousePosition))C=H.clone(o._tiltCenter,lee);else{if(y.position.z<o._minimumPickingTerrainHeight&&(C=FM(o,f,lee)),!N(C)){w=y.getPickRay(f,see);let Y=w.origin,Q=w.direction,ee,z=H.dot(A,Q);if(Math.abs(z)>xe.EPSILON6&&(ee=-H.dot(A,Y)/z),!N(ee)||ee<=0){o._looking=!0,q1(o,f,m),Ye.clone(f,o._tiltCenterMousePosition);return}C=H.multiplyByScalar(Q,ee,lee),H.add(Y,C,C)}x&&(N(w)||(w=y.getPickRay(f,see)),Bit(o,w,C,C)),Ye.clone(f,o._tiltCenterMousePosition),H.clone(C,o._tiltCenter)}let E=v.canvas,T=zit;T.x=E.clientWidth/2,T.y=o._tiltCenterMousePosition.y,w=y.getPickRay(T,see);let S=H.clone(H.ZERO,H1i);S.x=C.x;let M=$a.fromPointNormal(S,A,U1i),I=Hh.rayPlane(w,M,V1i),P=y._projection,D=P.ellipsoid;H.fromElements(C.y,C.z,C.x,C);let L=P.unproject(C,Xge);D.cartographicToCartesian(L,C);let R=tn.eastNorthUpToFixedFrame(C,D,Hit),O;N(I)?(H.fromElements(I.y,I.z,I.x,I),L=P.unproject(I,Xge),D.cartographicToCartesian(L,I),O=tn.eastNorthUpToFixedFrame(I,D,z1i)):O=R;let F=o._globe,k=o._ellipsoid;o._globe=void 0,o._ellipsoid=ki.UNIT_SPHERE,o._rotateFactor=1,o._rotateRateRangeAdjustment=1;let U=H.UNIT_Z,G=Ee.clone(y.transform,Uit);y._setTransform(R);let j=H.cross(H.UNIT_Z,H.normalize(y.position,lpe),lpe),q=H.dot(y.right,j);if(Y1(o,f,m,U,!1,!0),y._setTransform(O),q<0){let Y=m.startPosition.y-m.endPosition.y;(x&&Y<0||!x&&Y>0)&&(U=void 0);let Q=y.constrainedAxis;y.constrainedAxis=void 0,Y1(o,f,m,U,!0,!1),y.constrainedAxis=Q}else Y1(o,f,m,U,!0,!1);if(N(y.constrainedAxis)){let Y=H.cross(y.direction,y.constrainedAxis,uee);H.equalsEpsilon(Y,H.ZERO,xe.EPSILON6)||(H.dot(Y,y.right)<0&&H.negate(Y,Y),H.cross(Y,y.direction,y.up),H.cross(y.direction,y.up,y.right),H.normalize(y.up,y.up),H.normalize(y.right,y.right))}y._setTransform(G),o._globe=F,o._ellipsoid=k;let J=k.maximumRadius;o._rotateFactor=1/J,o._rotateRateRangeAdjustment=J;let X=H.clone(y.positionWC,lpe);if(o.enableCollisionDetection&&USe(o),!H.equals(y.positionWC,X)){y._setTransform(O),y.worldToCameraCoordinatesPoint(X,X);let Y=H.magnitudeSquared(X);H.magnitudeSquared(y.position)>Y&&(H.normalize(y.position,y.position),H.multiplyByScalar(y.position,Math.sqrt(Y),y.position));let Q=H.angleBetween(X,y.position),ee=H.cross(X,y.position,X);H.normalize(ee,ee);let z=Gr.fromAxisAngle(ee,Q,G1i),ie=Ut.fromQuaternion(z,W1i);Ut.multiplyByVector(ie,y.direction,y.direction),Ut.multiplyByVector(ie,y.up,y.up),H.cross(y.direction,y.up,y.right),H.cross(y.right,y.direction,y.up),y._setTransform(G)}}var Git=new Ye,Wit=new _s,jit=new H;function X1i(o,f,m){N(m.distance)&&(m=m.distance);let v=o._scene,y=v.camera,x=v.canvas,C=o._cameraUnderground,w;C?w=f:(w=Git,w.x=x.clientWidth/2,w.y=x.clientHeight/2);let A=y.getPickRay(w,Wit),E=A.origin,T=A.direction,S=y.position.z,M;S<o._minimumPickingTerrainHeight&&(M=FM(o,w,jit));let I;if(N(M)&&(I=H.distance(E,M)),C){let P=Fit(o,A,S);N(I)?I=Math.min(I,P):I=P}if(!N(I)){let P=H.UNIT_X;I=-H.dot(P,E)/H.dot(P,T)}kSe(o,f,m,o._zoomFactor,I)}function J1i(o){let f=o._scene.camera;if(!Ee.equals(Ee.IDENTITY,f.transform))Oy(o,o.enableRotate,o.rotateEventTypes,Y1,o.inertiaSpin,"_lastInertiaSpinMovement"),Oy(o,o.enableZoom,o.zoomEventTypes,qit,o.inertiaZoom,"_lastInertiaZoomMovement");else{let m=o._tweens;if(o._aggregator.anyButtonDown&&m.removeAll(),Oy(o,o.enableTilt,o.tiltEventTypes,j1i,o.inertiaSpin,"_lastInertiaTiltMovement"),Oy(o,o.enableTranslate,o.translateEventTypes,k1i,o.inertiaTranslate,"_lastInertiaTranslateMovement"),Oy(o,o.enableZoom,o.zoomEventTypes,X1i,o.inertiaZoom,"_lastInertiaZoomMovement"),Oy(o,o.enableLook,o.lookEventTypes,q1),!o._aggregator.anyButtonDown&&!m.contains(o._tween)){let v=f.createCorrectPositionTween(o.bounceAnimationTime);N(v)&&(o._tween=m.add(v))}m.update()}}var K1i=new _s,Q1i=new $a(H.UNIT_X,0),Z1i=new H,$1i=new H;function VSe(o,f,m){let v=o._scene,y=v.camera,x=y.getPickRay(f.endPosition,K1i),C=H.clone(y.direction,$1i);v.mode===_i.COLUMBUS_VIEW&&H.fromElements(C.z,C.x,C.y,C);let w=$a.fromPointNormal(m,C,Q1i),A=Hh.rayPlane(x,w,Z1i);N(A)&&(C=H.subtract(m,A,C),v.mode===_i.COLUMBUS_VIEW&&H.fromElements(C.y,C.z,C.x,C),H.add(y.position,C,y.position))}var e6e=new H,Yit=new Mt,Jge=new H,Kge=new ki,ebi=new H,tbi=new H,ibi=new H;function rbi(o,f,m){let v=o._scene.camera,y=o._cameraUnderground,x=o._ellipsoid;if(!Ee.equals(v.transform,Ee.IDENTITY)){Y1(o,f,m);return}let C,w,A=x.geodeticSurfaceNormal(v.position,ebi);if(Ye.equals(f,o._rotateMousePosition)){if(o._looking)q1(o,f,m,A);else if(o._rotating)Y1(o,f,m);else if(o._strafing)Vit(o,m);else{if(H.magnitude(v.position)<H.magnitude(o._rotateStartPosition))return;C=H.magnitude(o._rotateStartPosition),w=Jge,w.x=w.y=w.z=C,x=ki.fromCartesian3(w,Kge),cpe(o,f,m,x)}return}o._looking=!1,o._rotating=!1,o._strafing=!1;let E=x.cartesianToCartographic(v.positionWC,Yit).height,T=o._globe;if(N(T)&&E<o._minimumPickingTerrainHeight){let S=FM(o,m.startPosition,ibi);if(N(S)){let M=!1,I=v.getPickRay(m.startPosition,Nit);if(y)M=!0,kit(o,I,S,S);else{let P=x.geodeticSurfaceNormal(S,tbi);Math.abs(H.dot(I.direction,P))<.05?M=!0:M=H.magnitude(v.position)<H.magnitude(S)}M?(Ye.clone(f,o._strafeEndMousePosition),H.clone(S,o._strafeStartPosition),o._strafing=!0,VSe(o,m,o._strafeStartPosition)):(C=H.magnitude(S),w=Jge,w.x=w.y=w.z=C,x=ki.fromCartesian3(w,Kge),cpe(o,f,m,x),H.clone(S,o._rotateStartPosition))}else o._looking=!0,q1(o,f,m,A)}else N(v.pickEllipsoid(m.startPosition,o._ellipsoid,e6e))?(cpe(o,f,m,o._ellipsoid),H.clone(e6e,o._rotateStartPosition)):E>o._minimumTrackBallHeight?(o._rotating=!0,Y1(o,f,m)):(o._looking=!0,q1(o,f,m,A));Ye.clone(f,o._rotateMousePosition)}function Y1(o,f,m,v,y,x){y=Z(y,!1),x=Z(x,!1);let C=o._scene,w=C.camera,A=C.canvas,E=w.constrainedAxis;N(v)&&(w.constrainedAxis=v);let T=H.magnitude(w.position),S=o._rotateFactor*(T-o._rotateRateRangeAdjustment);S>o._maximumRotateRate&&(S=o._maximumRotateRate),S<o._minimumRotateRate&&(S=o._minimumRotateRate);let M=(m.startPosition.x-m.endPosition.x)/A.clientWidth,I=(m.startPosition.y-m.endPosition.y)/A.clientHeight;M=Math.min(M,o.maximumMovementRatio),I=Math.min(I,o.maximumMovementRatio);let P=S*M*Math.PI*2,D=S*I*Math.PI;y||w.rotateRight(P),x||w.rotateUp(D),w.constrainedAxis=E}var upe=Wt.clone(Wt.UNIT_W),t6e=Wt.clone(Wt.UNIT_W),ZZ=new H,XV=new H,$Z=new H,i6e=new H,nbi=new Ye,obi=new Ye,abi=new Ye,sbi=new Ye,lbi=new _s;function cpe(o,f,m,v){let y=o._scene,x=y.camera,C=Ye.clone(m.startPosition,nbi),w=Ye.clone(m.endPosition,obi),A=v.cartesianToCartographic(x.positionWC,Yit).height,E,T;if(!m.inertiaEnabled&&A<o._minimumPickingTerrainHeight&&(E=H.clone(o._panLastWorldPosition,upe),!N(o._globe)&&!Ye.equalsEpsilon(C,o._panLastMousePosition)&&(E=FM(o,C,upe)),!N(o._globe)&&N(E))){let S=H.subtract(E,x.positionWC,XV),M=H.multiplyByScalar(x.directionWC,H.dot(x.directionWC,S),XV),I=H.magnitude(M),P=x.frustum.getPixelDimensions(y.drawingBufferWidth,y.drawingBufferHeight,I,y.pixelRatio,sbi),D=Ye.subtract(w,C,abi),L=H.multiplyByScalar(x.rightWC,D.x*P.x,XV),R=H.normalize(x.positionWC,Oit),O=x.getPickRay(w,lbi).direction,F=H.subtract(O,H.projectVector(O,x.rightWC,$Z),$Z),k=H.angleBetween(F,x.directionWC),U=1;N(x.frustum.fov)&&(U=Math.max(Math.tan(k),.1));let G=Math.abs(H.dot(x.directionWC,R)),j=-D.y*P.y*2/Math.sqrt(U)*(1-G),q=H.multiplyByScalar(O,j,$Z);G=Math.abs(H.dot(x.upWC,R));let J=H.multiplyByScalar(x.upWC,-D.y*(1-G)*P.y,i6e);T=H.add(E,L,t6e),T=H.add(T,q,T),T=H.add(T,J,T),H.clone(T,o._panLastWorldPosition),Ye.clone(w,o._panLastMousePosition)}if((!N(E)||!N(T))&&(E=x.pickEllipsoid(C,v,upe),T=x.pickEllipsoid(w,v,t6e)),!N(E)||!N(T)){o._rotating=!0,Y1(o,f,m);return}if(E=x.worldToCameraCoordinates(E,E),T=x.worldToCameraCoordinates(T,T),N(x.constrainedAxis)){let S=x.constrainedAxis,M=H.mostOrthogonalAxis(S,ZZ);H.cross(M,S,M),H.normalize(M,M);let I=H.cross(S,M,XV),P=H.magnitude(E),D=H.dot(S,E),L=Math.acos(D/P),R=H.multiplyByScalar(S,D,$Z);H.subtract(E,R,R),H.normalize(R,R);let O=H.magnitude(T),F=H.dot(S,T),k=Math.acos(F/O),U=H.multiplyByScalar(S,F,i6e);H.subtract(T,U,U),H.normalize(U,U);let G=Math.acos(H.dot(R,M));H.dot(R,I)<0&&(G=xe.TWO_PI-G);let j=Math.acos(H.dot(U,M));H.dot(U,I)<0&&(j=xe.TWO_PI-j);let q=G-j,J;H.equalsEpsilon(S,x.position,xe.EPSILON2)?J=x.right:J=H.cross(S,x.position,ZZ);let X=H.cross(S,J,ZZ),Y=H.dot(X,H.subtract(E,S,XV)),Q=H.dot(X,H.subtract(T,S,XV)),ee;Y>0&&Q>0?ee=k-L:Y>0&&Q<=0?H.dot(x.position,S)>0?ee=-L-k:ee=L+k:ee=L-k,x.rotateRight(q),x.rotateUp(ee)}else{H.normalize(E,E),H.normalize(T,T);let S=H.dot(E,T),M=H.cross(E,T,ZZ);if(S<1&&!H.equalsEpsilon(M,H.ZERO,xe.EPSILON14)){let I=Math.acos(S);x.rotate(M,I)}}}var ubi=new H,cbi=new Mt,r6e=0;function qit(o,f,m){N(m.distance)&&(m=m.distance);let v=m.inertiaEnabled,y=o._ellipsoid,x=o._scene,C=x.camera,w=x.canvas,A=o._cameraUnderground,E;A?E=f:(E=Git,E.x=w.clientWidth/2,E.y=w.clientHeight/2);let T=C.getPickRay(E,Wit),S,M=y.cartesianToCartographic(C.position,cbi).height,I=Math.abs(r6e)<o.minimumPickingTerrainDistanceWithInertia;(v?I:M<o._minimumPickingTerrainHeight)&&(S=FM(o,E,jit,!0));let P;if(N(S)&&(P=H.distance(T.origin,S),r6e=P),A){let L=Fit(o,T,M);N(P)?P=Math.min(P,L):P=L}N(P)||(P=M);let D=H.normalize(C.position,ubi);kSe(o,f,m,o._zoomFactor,P,H.dot(D,C.direction))}var Xit=new Ye,cee=new _s,dW=new H,hbi=new H,Jit=new Ee,dbi=new Ee,Kit=new Ee,fbi=new Gr,pbi=new Ut,zSe=new Mt,HSe=new H;function mbi(o,f,m){let v=o._scene.camera;if(!Ee.equals(v.transform,Ee.IDENTITY))return;if(N(m.angleAndHeight)&&(m=m.angleAndHeight),Ye.equals(f,o._tiltCenterMousePosition)||(o._tiltOnEllipsoid=!1,o._looking=!1),o._looking){let x=o._ellipsoid.geodeticSurfaceNormal(v.position,HSe);q1(o,f,m,x);return}let y=o._ellipsoid.cartesianToCartographic(v.position,zSe);o._tiltOnEllipsoid||y.height>o._minimumCollisionTerrainHeight?(o._tiltOnEllipsoid=!0,_bi(o,f,m)):vbi(o,f,m)}var gbi=new Mt;function _bi(o,f,m){let v=o._ellipsoid,y=o._scene,x=y.camera,C=o.minimumZoomDistance*.25,w=v.cartesianToCartographic(x.positionWC,gbi).height;if(w-C-1<xe.EPSILON3&&m.endPosition.y-m.startPosition.y<0)return;let A=y.canvas,E=Xit;E.x=A.clientWidth/2,E.y=A.clientHeight/2;let T=x.getPickRay(E,cee),S,M=Hh.rayEllipsoid(T,v);if(N(M))S=_s.getPoint(T,M.start,dW);else if(w>o._minimumTrackBallHeight){let O=Hh.grazingAltitudeLocation(T,v);if(!N(O))return;let F=v.cartesianToCartographic(O,zSe);F.height=0,S=v.cartographicToCartesian(F,dW)}else{o._looking=!0;let O=o._ellipsoid.geodeticSurfaceNormal(x.position,HSe);q1(o,f,m,O),Ye.clone(f,o._tiltCenterMousePosition);return}let I=tn.eastNorthUpToFixedFrame(S,v,Jit),P=o._globe,D=o._ellipsoid;o._globe=void 0,o._ellipsoid=ki.UNIT_SPHERE,o._rotateFactor=1,o._rotateRateRangeAdjustment=1;let L=Ee.clone(x.transform,Kit);x._setTransform(I),Y1(o,f,m,H.UNIT_Z),x._setTransform(L),o._globe=P,o._ellipsoid=D;let R=D.maximumRadius;o._rotateFactor=1/R,o._rotateRateRangeAdjustment=R}function vbi(o,f,m){let v=o._ellipsoid,y=o._scene,x=y.camera,C=o._cameraUnderground,w,A,E;if(Ye.equals(f,o._tiltCenterMousePosition))w=H.clone(o._tiltCenter,dW);else{if(w=FM(o,f,dW),!N(w)){if(A=x.getPickRay(f,cee),E=Hh.rayEllipsoid(A,v),!N(E)){if(v.cartesianToCartographic(x.position,zSe).height<=o._minimumTrackBallHeight){o._looking=!0;let X=o._ellipsoid.geodeticSurfaceNormal(x.position,HSe);q1(o,f,m,X),Ye.clone(f,o._tiltCenterMousePosition)}return}w=_s.getPoint(A,E.start,dW)}C&&(N(A)||(A=x.getPickRay(f,cee)),Bit(o,A,w,w)),Ye.clone(f,o._tiltCenterMousePosition),H.clone(w,o._tiltCenter)}let T=y.canvas,S=Xit;S.x=T.clientWidth/2,S.y=o._tiltCenterMousePosition.y,A=x.getPickRay(S,cee);let M=H.magnitude(w),I=H.fromElements(M,M,M,Jge),P=ki.fromCartesian3(I,Kge);if(E=Hh.rayEllipsoid(A,P),!N(E))return;let D=H.magnitude(A.origin)>M?E.start:E.stop,L=_s.getPoint(A,D,hbi),R=tn.eastNorthUpToFixedFrame(w,v,Jit),O=tn.eastNorthUpToFixedFrame(L,P,dbi),F=o._globe,k=o._ellipsoid;o._globe=void 0,o._ellipsoid=ki.UNIT_SPHERE,o._rotateFactor=1,o._rotateRateRangeAdjustment=1;let U=H.UNIT_Z,G=Ee.clone(x.transform,Kit);x._setTransform(O);let j=H.cross(L,x.positionWC,uee);if(H.dot(x.rightWC,j)<0){let X=m.startPosition.y-m.endPosition.y;(C&&X<0||!C&&X>0)&&(U=void 0);let Y=x.constrainedAxis;x.constrainedAxis=void 0,Y1(o,f,m,U,!0,!1),x.constrainedAxis=Y}else Y1(o,f,m,U,!0,!1);if(x._setTransform(R),Y1(o,f,m,U,!1,!0),N(x.constrainedAxis)){let X=H.cross(x.direction,x.constrainedAxis,uee);H.equalsEpsilon(X,H.ZERO,xe.EPSILON6)||(H.dot(X,x.right)<0&&H.negate(X,X),H.cross(X,x.direction,x.up),H.cross(x.direction,x.up,x.right),H.normalize(x.up,x.up),H.normalize(x.right,x.right))}x._setTransform(G),o._globe=F,o._ellipsoid=k;let q=k.maximumRadius;o._rotateFactor=1/q,o._rotateRateRangeAdjustment=q;let J=H.clone(x.positionWC,uee);if(o.enableCollisionDetection&&USe(o),!H.equals(x.positionWC,J)){x._setTransform(O),x.worldToCameraCoordinatesPoint(J,J);let X=H.magnitudeSquared(J);H.magnitudeSquared(x.position)>X&&(H.normalize(x.position,x.position),H.multiplyByScalar(x.position,Math.sqrt(X),x.position));let Y=H.angleBetween(J,x.position),Q=H.cross(J,x.position,J);H.normalize(Q,Q);let ee=Gr.fromAxisAngle(Q,Y,fbi),z=Ut.fromQuaternion(ee,pbi);Ut.multiplyByVector(z,x.direction,x.direction),Ut.multiplyByVector(z,x.up,x.up),H.cross(x.direction,x.up,x.right),H.cross(x.right,x.direction,x.up),x._setTransform(G)}}var ybi=new Ye,xbi=new Ye,n6e=new _s,o6e=new _s,Cbi=new H,bbi=new H;function q1(o,f,m,v){let y=o._scene.camera,x=ybi;x.x=m.startPosition.x,x.y=0;let C=xbi;C.x=m.endPosition.x,C.y=0;let w=y.getPickRay(x,n6e),A=y.getPickRay(C,o6e),E=0,T,S;y.frustum instanceof Gs?(T=w.origin,S=A.origin,H.add(y.direction,T,T),H.add(y.direction,S,S),H.subtract(T,y.position,T),H.subtract(S,y.position,S),H.normalize(T,T),H.normalize(S,S)):(T=w.direction,S=A.direction);let M=H.dot(T,S);M<1&&(E=Math.acos(M)),E=m.startPosition.x>m.endPosition.x?-E:E;let I=o._horizontalRotationAxis;if(N(v)?y.look(v,-E):N(I)?y.look(I,-E):y.lookLeft(E),x.x=0,x.y=m.startPosition.y,C.x=0,C.y=m.endPosition.y,w=y.getPickRay(x,n6e),A=y.getPickRay(C,o6e),E=0,y.frustum instanceof Gs?(T=w.origin,S=A.origin,H.add(y.direction,T,T),H.add(y.direction,S,S),H.subtract(T,y.position,T),H.subtract(S,y.position,S),H.normalize(T,T),H.normalize(S,S)):(T=w.direction,S=A.direction),M=H.dot(T,S),M<1&&(E=Math.acos(M)),E=m.startPosition.y>m.endPosition.y?-E:E,v=Z(v,I),N(v)){let P=y.direction,D=H.negate(v,Cbi),L=H.equalsEpsilon(P,v,xe.EPSILON2),R=H.equalsEpsilon(P,D,xe.EPSILON2);if(!L&&!R){M=H.dot(P,v);let O=xe.acosClamped(M);E>0&&E>O&&(E=O-xe.EPSILON4),M=H.dot(P,D),O=xe.acosClamped(M),E<0&&-E>O&&(E=-O+xe.EPSILON4);let F=H.cross(v,P,bbi);y.look(F,E)}else(L&&E<0||R&&E>0)&&y.look(y.right,-E)}else y.lookUp(E)}function wbi(o){Oy(o,o.enableRotate,o.rotateEventTypes,rbi,o.inertiaSpin,"_lastInertiaSpinMovement"),Oy(o,o.enableZoom,o.zoomEventTypes,qit,o.inertiaZoom,"_lastInertiaZoomMovement"),Oy(o,o.enableTilt,o.tiltEventTypes,mbi,o.inertiaSpin,"_lastInertiaTiltMovement"),Oy(o,o.enableLook,o.lookEventTypes,q1)}var Abi=new Ee,Ebi=new Mt;function USe(o){o._adjustedHeightForTerrain=!0;let f=o._scene,m=f.mode,v=f.globe;if(!N(v)||m===_i.SCENE2D||m===_i.MORPHING)return;let y=f.camera,x=v.ellipsoid,C=f.mapProjection,w,A;Ee.equals(y.transform,Ee.IDENTITY)||(w=Ee.clone(y.transform,Abi),A=H.magnitude(y.position),y._setTransform(Ee.IDENTITY));let E=Ebi;m===_i.SCENE3D?x.cartesianToCartographic(y.position,E):C.unproject(y.position,E);let T=!1;if(E.height<o._minimumCollisionTerrainHeight){let S=o._scene.globeHeight;if(N(S)){let M=S+o.minimumZoomDistance;E.height<M&&(E.height=M,m===_i.SCENE3D?x.cartographicToCartesian(E,y.position):C.project(E,y.position),T=!0)}}N(w)&&(y._setTransform(w),T&&(H.normalize(y.position,y.position),H.negate(y.position,y.direction),H.multiplyByScalar(y.position,Math.max(A,o.minimumZoomDistance),y.position),H.normalize(y.direction,y.direction),H.cross(y.direction,y.up,y.right),H.cross(y.right,y.direction,y.up)))}Gq.prototype.onMap=function(){let o=this._scene,f=o.mode,m=o.camera;return f===_i.COLUMBUS_VIEW?Math.abs(m.position.x)-this._maxCoord.x<0&&Math.abs(m.position.y)-this._maxCoord.y<0:!0};var Tbi=new H,Sbi=new H;Gq.prototype.update=function(){let o=this._scene,f=o.camera,m=o.globe,v=o.mode;Ee.equals(f.transform,Ee.IDENTITY)?(this._globe=m,this._ellipsoid=N(this._globe)?this._globe.ellipsoid:o.mapProjection.ellipsoid):(this._globe=void 0,this._ellipsoid=ki.UNIT_SPHERE);let y=N(this._globe)?this._globe.terrainExaggeration:1,x=N(this._globe)?this._globe.terrainExaggerationRelativeHeight:0;this._minimumCollisionTerrainHeight=V1.getHeight(this.minimumCollisionTerrainHeight,y,x),this._minimumPickingTerrainHeight=V1.getHeight(this.minimumPickingTerrainHeight,y,x),this._minimumTrackBallHeight=V1.getHeight(this.minimumTrackBallHeight,y,x),this._cameraUnderground=o.cameraUnderground&&N(this._globe);let C=this._ellipsoid.maximumRadius;this._rotateFactor=1/C,this._rotateRateRangeAdjustment=C,this._adjustedHeightForTerrain=!1;let w=H.clone(f.positionWC,Tbi),A=H.clone(f.directionWC,Sbi);v===_i.SCENE2D?E1i(this):v===_i.COLUMBUS_VIEW?(this._horizontalRotationAxis=H.UNIT_Z,J1i(this)):v===_i.SCENE3D&&(this._horizontalRotationAxis=void 0,wbi(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain&&(!H.equals(w,f.positionWC)||!H.equals(A,f.directionWC))&&USe(this),this._aggregator.reset()};Gq.prototype.isDestroyed=function(){return!1};Gq.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),kr(this)};var GSe=Gq,WSe=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; in vec2 v_textureCoordinates; void main() { vec4 color0 = texture(colorTexture, v_textureCoordinates); vec4 color1 = texture(colorTexture2, v_textureCoordinates); float x = length(gl_FragCoord.xy - center) / radius; float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } `,jSe=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; in vec2 v_textureCoordinates; float key(float avg) { float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0)); return max(0.0, guess) + 0.1; } // See section 9. "The bright-pass filter" of Realtime HDR Rendering // http://www.cg.tuwien.ac.at/research/publications/2007/Luksch_2007_RHR/Luksch_2007_RHR-RealtimeHDR%20.pdf void main() { vec4 color = texture(colorTexture, v_textureCoordinates); vec3 xyz = czm_RGBToXYZ(color.rgb); float luminance = xyz.r; float scaledLum = key(avgLuminance) * luminance / avgLuminance; float brightLum = max(scaledLum - threshold, 0.0); float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } `;function _D(){this._sceneFramebuffer=new Roe;let o=.25,f=new Array(6);f[0]=new as({fragmentShader:NM,textureScale:o,forcePowerOfTwo:!0,sampleMode:zy.LINEAR});let m=f[1]=new as({fragmentShader:jSe,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:o,forcePowerOfTwo:!0}),v=this;this._delta=1,this._sigma=2,this._blurStep=new Ye,f[2]=new as({fragmentShader:Ej,uniforms:{step:function(){return v._blurStep.x=v._blurStep.y=1/m.outputTexture.width,v._blurStep},delta:function(){return v._delta},sigma:function(){return v._sigma},direction:0},textureScale:o,forcePowerOfTwo:!0}),f[3]=new as({fragmentShader:Ej,uniforms:{step:function(){return v._blurStep.x=v._blurStep.y=1/m.outputTexture.width,v._blurStep},delta:function(){return v._delta},sigma:function(){return v._sigma},direction:1},textureScale:o,forcePowerOfTwo:!0}),f[4]=new as({fragmentShader:NM,sampleMode:zy.LINEAR}),this._uCenter=new Ye,this._uRadius=void 0,f[5]=new as({fragmentShader:WSe,uniforms:{center:function(){return v._uCenter},radius:function(){return v._uRadius},colorTexture2:function(){return v._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new z0({stages:f});let y=new koe(this),x=f.length;for(let C=0;C<x;++C)f[C]._textureCache=y;this._textureCache=y,this.length=f.length}_D.prototype.get=function(o){return this._stages.get(o)};_D.prototype.getStageByName=function(o){let f=this._stages.length;for(let m=0;m<f;++m){let v=this._stages.get(m);if(v.name===o)return v}};var Pbi=new Wt,a6e=new Ye,Ibi=new Ye,s6e=new Ee;function Mbi(o,f,m){let v=f.uniformState,y=v.sunPositionWC,x=v.view,C=v.viewProjection,w=v.projection,A=Ee.computeViewportTransformation(m,0,1,s6e),E=Ee.multiplyByPoint(x,y,Pbi),T=tn.pointToGLWindowCoordinates(C,A,y,a6e);E.x+=xe.SOLAR_RADIUS;let S=tn.pointToGLWindowCoordinates(w,A,E,E),M=Ye.magnitude(Ye.subtract(S,T,S))*30*2,I=Ibi;I.x=M,I.y=M,o._uCenter=Ye.clone(T,o._uCenter),o._uRadius=Math.max(I.x,I.y)*.15;let P=f.drawingBufferWidth,D=f.drawingBufferHeight,L=o._stages,R=L.get(0),O=R.outputTexture.width,F=R.outputTexture.height,k=new Xr;k.width=O,k.height=F,A=Ee.computeViewportTransformation(k,0,1,s6e),T=tn.pointToGLWindowCoordinates(C,A,y,a6e),I.x*=O/P,I.y*=F/D;let U=R.scissorRectangle;U.x=Math.max(T.x-I.x*.5,0),U.y=Math.max(T.y-I.y*.5,0),U.width=Math.min(I.x,P),U.height=Math.min(I.y,D);for(let G=1;G<4;++G)Xr.clone(U,L.get(G).scissorRectangle)}_D.prototype.clear=function(o,f,m){this._sceneFramebuffer.clear(o,f,m),this._textureCache.clear(o)};_D.prototype.update=function(o){let f=o.context,m=o.viewport,v=this._sceneFramebuffer;v.update(f,m);let y=v.framebuffer;return this._textureCache.update(f),this._stages.update(f,!1),Mbi(this,f,m),y};_D.prototype.execute=function(o){let f=this._sceneFramebuffer.framebuffer.getColorTexture(0),m=this._stages,v=m.length;m.get(0).execute(o,f);for(let y=1;y<v;++y)m.get(y).execute(o,m.get(y-1).outputTexture)};_D.prototype.copy=function(o,f){if(!N(this._copyColorCommand)){let m=this;this._copyColorCommand=o.createViewportQuadCommand(NM,{uniformMap:{colorTexture:function(){return m._stages.get(m._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=f,this._copyColorCommand.execute(o)};_D.prototype.isDestroyed=function(){return!1};_D.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),kr(this)};var YSe=_D;function Qit(){this._cachedShowFrustumsShaders={}}function Dbi(o){let f={},m=o.vertexAttributes;for(let v in m)m.hasOwnProperty(v)&&(f[v]=m[v].index);return f}function Lbi(o,f){let m=o.context,v=f,y=v.fragmentShaderSource.clone(),x=[];y.sources=y.sources.map(function(T){T=Zr.replaceMain(T,"czm_Debug_main");let S=/out_FragData_(\d+)/g,M;for(;(M=S.exec(T))!==null;)x.indexOf(M[1])===-1&&x.push(M[1]);return T});let C=x.length,w="";w+=`uniform vec3 debugShowCommandsColor; `,w+=`uniform vec3 debugShowFrustumsColor; `,w+=`void main() { czm_Debug_main(); `;let A;if(C>0)for(A=0;A<C;++A)w+=` out_FragData_${x[A]}.rgb *= debugShowCommandsColor; `,w+=` out_FragData_${x[A]}.rgb *= debugShowFrustumsColor; `;else w+=` out_FragColor.rgb *= debugShowCommandsColor; `,w+=` out_FragColor.rgb *= debugShowFrustumsColor; `;w+="}",y.sources.push(w);let E=Dbi(v);return Rs.fromCache({context:m,vertexShaderSource:v.vertexShaderSource,fragmentShaderSource:y,attributeLocations:E})}var o7=new Re;function Rbi(o,f){let m;return N(f.uniformMap)?m=f.uniformMap:m={},N(m.debugShowCommandsColor)||N(m.debugShowFrustumsColor)||(m.debugShowCommandsColor=function(){return o.debugShowCommands?(N(f._debugColor)||(f._debugColor=Re.fromRandom()),f._debugColor):Re.WHITE},m.debugShowFrustumsColor=function(){return o.debugShowFrustums?(o7.red=f.debugOverlappingFrustums&1?1:0,o7.green=f.debugOverlappingFrustums&2?1:0,o7.blue=f.debugOverlappingFrustums&4?1:0,o7.alpha=1,o7):Re.WHITE}),m}var Obi=new Jn;Qit.prototype.executeDebugShowFrustumsCommand=function(o,f,m){let v=f.shaderProgram.id,y=this._cachedShowFrustumsShaders[v];N(y)||(y=Lbi(o,f.shaderProgram),this._cachedShowFrustumsShaders[v]=y);let x=Jn.shallowClone(f,Obi);x.shaderProgram=y,x.uniformMap=Rbi(o,f),x.execute(o.context,m)};var qSe=Qit,XSe=`in vec4 aPosition; in vec4 aTexCoord0; #ifdef TexCoord2 in vec4 aTexCoord1; #endif out vec4 vTexCoord; in vec4 aColor; out vec4 vColor; void main() { vTexCoord.xy = aTexCoord0.xy; #ifdef TexCoord2 vTexCoord.zw = aTexCoord1.xy; #endif vColor = aColor; gl_Position = czm_modelViewProjection * vec4(aPosition.xyz, 1.0); } `,JSe=`uniform sampler2D uTexture; #ifdef TexCoord2 uniform sampler2D uTexture2; #endif uniform vec4 uDiffuseColor; uniform vec4 uAmbientColor; in vec4 vColor; in vec4 vTexCoord; void main() { vec4 color = vColor * texture(uTexture, vTexCoord.xy); #ifdef TexCoord2 color *= texture(uTexture2, vTexCoord.zw); #endif out_FragColor = czm_gammaCorrect(color); } `;function KSe(){this.context=void 0,this.model=void 0,this.index=void 0}KSe.prototype.set=function(o,f,m){this.context=o,this.model=f,this.index=m};KSe.prototype.execute=function(){let o=this.context,f=this.index,m=this.model.vertexPackage,v=m.vertexAttributes[f];if(!N(v))throw new li("attribute is null");if(m.instanceIndex!==-1&&!N(this.model._instanceBuffer)){if(!N(m.instanceBuffer))throw new li("instance buffer is null");this.model.instanceBuffer=Ao.createVertexBuffer({context:o,typedArray:m.instanceBuffer,usage:gn.STATIC_DRAW})}if(v.instanceDivisor===1){v.vertexBuffer=this.model.instanceBuffer;return}N(v.vertexBuffer)||(v.vertexBuffer=Ao.createVertexBuffer({context:o,typedArray:v.typedArray,usage:gn.STATIC_DRAW}),v.typedArray=null,delete v.typedArray)};var QSe=KSe;function ZSe(){this.model=void 0,this.context=void 0,this.index=0}ZSe.prototype.set=function(o,f,m){this.model=f,this.context=o,this.index=m};ZSe.prototype.execute=function(){let o=this.context,f=this.model.arrIndexPackage[this.index],m=this.model.vertexPackage.verticesCount;if(!N(f))throw new li("index package is null");if(N(f.indexBuffer))return;if(!N(f.indicesTypedArray))throw new li("index buffer is null");let v=ro.UNSIGNED_SHORT;(f.indexType===1||m>=xe.SIXTY_FOUR_KILOBYTES)&&o.elementIndexUint&&(v=ro.UNSIGNED_INT),f.indexBuffer=Ao.createIndexBuffer({context:o,typedArray:f.indicesTypedArray,usage:gn.STATIC_DRAW,indexDatatype:v}),f.indicesTypedArray=null,delete f.indicesTypedArray};var $Se=ZSe;function S6(o){this.layer=o.layer,this.vertexPackage=o.vertexPackage,this.arrIndexPackage=o.arrIndexPackage,this.vertexBufferToCreate=new R5,this.indexBufferToCreate=new R5;let f,m;for(f=0,m=this.vertexPackage.vertexAttributes.length;f<m;f++)this.vertexBufferToCreate.enqueue(f);for(f=0,m=this.arrIndexPackage.length;f<m;f++)this.indexBufferToCreate.enqueue(f);this.boundingVolume=o.boundingVolume,this.material=o.material,this.modelMatrix=o.modelMatrix,this.shaderProgram=void 0,this.vertexArray=void 0,this.colorCommand=void 0,this.ready=!1}var l6e=new QSe,u6e=new $Se;function Nbi(o,f){let m=o.layer.context,v=o.vertexBufferToCreate;for(;v.length;){let y=v.peek();if(l6e.set(m,o,y),!f.jobScheduler.execute(l6e,Zx.BUFFER))break;v.dequeue()}}function Fbi(o,f){let m=o.layer.context,v=o.indexBufferToCreate;for(;v.length;){let y=v.peek();if(u6e.set(m,o,y),!f.jobScheduler.execute(u6e,Zx.BUFFER))break;v.dequeue()}}S6.prototype.createBuffers=function(o){Nbi(this,o),Fbi(this,o)};S6.prototype.createCommand=li.throwInstantiationError;S6.prototype.update=li.throwInstantiationError;S6.prototype.isDestroyed=li.throwInstantiationError;S6.prototype.destroy=li.throwInstantiationError;var Wq=S6;function i4(o){Wq.call(this,o)}i4.prototype=Object.create(Wq.prototype);i4.prototype.constructor=Wq;function Bbi(o,f,m){let v=new Zr({sources:[XSe]}),y=new Zr({sources:[JSe]});return N(f.aNormal)&&(v.defines.push("VertexNormal"),y.defines.push("VertexNormal")),m.textures.length>0&&(v.defines.push("TexCoord"),y.defines.push("TexCoord")),m.textures.length===2&&(v.defines.push("TexCoord2"),y.defines.push("TexCoord2")),Rs.fromCache({context:o,vertexShaderSource:v,fragmentShaderSource:y,attributeLocations:f})}function kbi(){return Mn.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:mC.LESS_OR_EQUAL}})}function Vbi(){return Mn.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:mC.LESS_OR_EQUAL},blending:Mu.ALPHA_BLEND})}function zbi(o){return{uTexture:function(){return o.textures[0]},uTextureWidth:function(){return o.textures[0]._width},uTexture2:function(){return o.textures[1]},uTexture2Width:function(){return o.textures[1]._width},uDiffuseColor:function(){return o.diffuseColor},uAmbientColor:function(){return o.ambientColor}}}i4.prototype.createCommand=function(){if(N(this.colorCommand))return;let o=this.layer.context,f=this.vertexPackage,m=this.arrIndexPackage,v=f.vertexAttributes,y=f.attrLocation;if(m.length<1)return;let x=m[0],C=this.material;this.shaderProgram=Bbi(o,y,C),this.vertexArray=new Du({context:o,attributes:v,indexBuffer:x.indexBuffer}),this.colorCommand=new Jn({owner:this,primitiveType:x.primitiveType,modelMatrix:this.modelMatrix,boundingVolume:Pi.clone(this.boundingVolume),pickId:"vSecondColor",vertexArray:this.vertexArray,shaderProgram:this.shaderProgram,pass:C.bTransparentSorting?vr.TRANSLUCENT:vr.CESIUM_3D_TILE,renderState:C.bTransparentSorting?Vbi():kbi()}),this.colorCommand.uniformMap=zbi(C),this.vertexPackage=null,this.arrIndexPackage=null,this.ready=!0};i4.prototype.update=function(o){if(!this.ready){this.createBuffers(o),this.createCommand(o);return}o.commandList.push(this.colorCommand)};i4.prototype.isDestroyed=function(){return!1};i4.prototype.destroy=function(){return this.shaderProgram=this.shaderProgram&&!this.shaderProgram.isDestroyed()&&this.shaderProgram.destroy(),this.vertexArray=this.vertexArray&&!this.vertexArray.isDestroyed()&&this.vertexArray.destroy(),this.colorCommand=void 0,this.vertexPackage=null,this.arrIndexPackage=null,kr(this)};var Tj=i4,qte=function(o){return function(){o.frameState.afterRender.push(function(){o.requestRender()})}};function Lu(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.canvas,m=o.creditContainer,v=o.creditViewport,y=uo(o.contextOptions),x=N(m),C=new NAe(f,y);x||(m=document.createElement("div"),m.style.position="absolute",m.style.bottom="0",m.style["text-shadow"]="0 0 2px #000000",m.style.color="#ffffff",m.style["font-size"]="10px",m.style["padding-right"]="5px",f.parentNode.appendChild(m)),N(v)||(v=f.parentNode),this._id=zl(),this._jobScheduler=new GTe,this._frameState=new zTe(C,new FTe(m," \u2022 ",v),this._jobScheduler),this._frameState.scene3DOnly=Z(o.scene3DOnly,!1),this._removeCreditContainer=!x,this._creditContainer=m,this._canvas=f,this._context=C,this._computeEngine=new SAe(C),this._globe=void 0,this._globeTranslucencyState=new UTe,this._primitives=new w_,this._primitivesQuadTrees=[],this._groundPrimitives=new w_,this._globeHeight=void 0,this._cameraUnderground=!1,this._logDepthBuffer=C.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new Hoe,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=Z(o.orderIndependentTranslucency,!0),this._executeOITFunction=void 0,this._depthPlane=new BTe(o.depthPlaneEllipsoidOffset),this._clearColorCommand=new Gc({color:new Re,stencil:0,owner:this}),this._depthClearCommand=new Gc({depth:1,owner:this}),this._stencilClearCommand=new Gc({stencil:0}),this._classificationStencilClearCommand=new Gc({stencil:0,renderState:Mn.fromCache({stencilMask:Ua.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new FSe(this),this._preUpdate=new Br,this._postUpdate=new Br,this._renderError=new Br,this._preRender=new Br,this._postRender=new Br,this._minimumDisableDepthTestDistance=0,this._debugInspector=new qSe,this._sunShaftEnabled=!1,this._msaaSamples=Z(o.msaaSamples,1),this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Br,this.morphComplete=new Br,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=Re.clone(Re.BLACK),this._mode=_i.SCENE3D,this._mapProjection=N(o.mapProjection)?o.mapProjection:new Mp,this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.fog=new VTe,this._shadowMapCamera=new Vl(this),this.shadowMap=new mD({context:C,lightCamera:this._shadowMapCamera,enabled:Z(o.shadows,!1)}),this.textureProjectionMapList=new Array,this.viewShedMapList=[],this.invertClassification=!1,this.invertClassificationColor=Re.clone(Re.WHITE),this._actualInvertClassificationColor=Re.clone(this._invertClassificationColor),this._invertClassification=new Doe,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new MSe,this._brdfLutGenerator=new NTe,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new GSe(this),this._cameraUnderground=!1,this._mapMode2D=Z(o.mapMode2D,$E.INFINITE_SCROLL),this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=Z(o.requestRenderMode,!1),this._renderRequested=!0,this.maximumRenderTimeChange=Z(o.maximumRenderTimeChange,0),this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Rw.requestCompletedEvent.addEventListener(qte(this)),this._removeTaskProcessorListenerCallback=tp.taskCompletedEvent.addEventListener(qte(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let w=new Xr(0,0,C.drawingBufferWidth,C.drawingBufferHeight),A=new Vl(this);this._logDepthBuffer&&(A.frustum.near=.1,A.frustum.far=1e10),this.preloadFlightCamera=new Vl(this),this.preloadFlightCullingVolume=void 0,this._picking=new aSe(this),this._defaultView=new E6(this,A,w),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this._sunColor=new H(2.3,2.35,2.5),this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentMapAtlas=void 0,this.light=new l6,this._loadPrimitiveFirst=!1,this._maxProjectionCount=4,Zit(this,0,ci.now()),this.updateFrameState(),this.initializeFrame()}function Hbi(o,f){for(let v=0;v<o._removeGlobeCallbacks.length;++v)o._removeGlobeCallbacks[v]();o._removeGlobeCallbacks.length=0;let m=[];N(f)&&(m.push(f.imageryLayersUpdatedEvent.addEventListener(qte(o))),m.push(f.terrainProviderChanged.addEventListener(qte(o)))),o._removeGlobeCallbacks=m}Object.defineProperties(Lu.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Bo.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Bo.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return V5.isSupported(this._context)}},globe:{get:function(){return this._globe},set:function(o){this._globe=this._globe&&this._globe.destroy(),this._globe=o,Hbi(this,o)}},primitives:{get:function(){return this._primitives}},primitivesQuadTrees:{get:function(){return this._primitivesQuadTrees}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(o){this._view.camera=o}},view:{get:function(){return this._view},set:function(o){this._view=o}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(N(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(N(this.globe))return this.globe.terrainProvider},set:function(o){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),N(this.globe)&&(this.globe.terrainProvider=o)}},terrainProviderChanged:{get:function(){if(N(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(o){o===_i.SCENE2D?this.morphTo2D(0):o===_i.SCENE3D?this.morphTo3D(0):o===_i.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=o}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(o){this._useWebVR=o,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Vl(this),N(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new kTe(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(o){this._frameState.splitPosition=o}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(o){this._minimumDisableDepthTestDistance=o}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(o){o=this._context.fragmentDepth&&o,this._logDepthBuffer!==o&&(this._logDepthBuffer=o,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(o){this._context.uniformState.gamma=o}},highDynamicRange:{get:function(){return this._hdr},set:function(o){let f=this._context,m=o&&f.depthTexture&&(f.colorBufferFloat||f.colorBufferHalfFloat);this._hdrDirty=m!==this._hdr,this._hdr=m}},highDynamicRangeSupported:{get:function(){let o=this._context;return o.depthTexture&&(o.colorBufferFloat||o.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(o){o=Math.min(o,Bo.maximumSamples),this._msaaSamples=o}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(o){this._frameState.pixelRatio=o}},opaqueFrustumNearOffset:{get:function(){return .9999}},sunShaftEnabled:{get:function(){return this._sunShaftEnabled},set:function(o){this._sunShaftEnabled=o}},loadPrimitiveFirst:{get:function(){return this._loadPrimitiveFirst},set:function(o){this._loadPrimitiveFirst=o}},globeHeight:{get:function(){return this._globeHeight}},maxProjectionCount:{get:function(){return this._maxProjectionCount},set:function(o){o<=1?o=1:o>100&&(o=100),this._maxProjectionCount=o}}});Lu.prototype.getCompressedTextureFormatSupported=function(o){let f=this.context;return(o==="WEBGL_compressed_texture_s3tc"||o==="s3tc")&&f.s3tc||(o==="WEBGL_compressed_texture_pvrtc"||o==="pvrtc")&&f.pvrtc||(o==="WEBGL_compressed_texture_etc"||o==="etc")&&f.etc||(o==="WEBGL_compressed_texture_etc1"||o==="etc1")&&f.etc1||(o==="WEBGL_compressed_texture_astc"||o==="astc")&&f.astc||(o==="EXT_texture_compression_bptc"||o==="bc7")&&f.bc7};function c6e(o,f,m,v,y,x,C,w,A,E){f?o.perspectivesWithDepth=FY.createDerivedCommands(m,f,v,y,x,C,w,A,o.perspectivesWithDepth):(o.perspectives=NY.createDerivedCommands(m,v,y,x,C,w,A,o.perspectives),o.fisheyes=OY.createDerivedCommands(m,v,y,x,C,A,o.fisheyes))}function h6e(o,f,m,v,y,x){let C=o._frameState,w=o._context,A=o._view.oit,E=C.textureProjecitonHints.lightShadowMaps,T=C.textureProjecitonHints.lightShadowsEnabled,S=f.derivedCommands;N(f.pickId)&&(S.picking=Iv.createPickDerivedCommand(o,f,w,S.picking)),f.pickOnly||(S.depth=Iv.createDepthOnlyDerivedCommand(o,f,w,S.depth)),S.originalCommand=f,o._hdr&&(S.hdr=Iv.createHdrCommand(f,w,S.hdr),f=S.hdr.command,S=f.derivedCommands),T&&f.receiveShadows&&(S.shadows=mD.createReceiveDerivedCommand(E,f,m,w,S.shadows)),f.pass===vr.TRANSLUCENT&&N(A)&&A.isSupported()&&(T&&f.receiveShadows?(N(S.oit)||(S.oit=A.createDerivedCommands(f,w,S.oit)),S.perspectivesWithDepth&&(S.oit.perspectivesWithDepth=A.createDerivedCommands(S.perspectivesWithDepth.receiveCommand,w,S.oit.perspectivesWithDepth))):S.oit=A.createDerivedCommands(f,w,S.oit))}function d6e(o,f,m){let v=o._frameState,y=o._context,x=o._view.oit,C=v.viewShedState.lightShadowMaps,w=v.viewShedState.lightShadowsEnabled,A=f.derivedCommands;N(f.pickId)&&(A.picking=Iv.createPickDerivedCommand(o,f,y,A.picking)),f.pickOnly||(A.depth=Iv.createDepthOnlyDerivedCommand(o,f,y,A.depth)),A.originalCommand=f,o._hdr&&(A.hdr=Iv.createHdrCommand(f,y,A.hdr),f=A.hdr.command,A=f.derivedCommands),w&&f.receiveShadows&&(A.viewShedMaps=s6.createReceiveDerivedCommand(C,f,m,y,A.viewShedMaps)),f.pass===vr.TRANSLUCENT&&N(x)&&x.isSupported()&&(w&&f.receiveShadows?A.oit=N(A.oit)?A.oit:{}:A.oit=x.createDerivedCommands(f,y,A.oit))}function f6e(o,f,m){let v=o._frameState,y=o._context,x=o._view.oit,C=v.shadowState.lightShadowMaps,w=v.shadowState.lightShadowsEnabled,A=f.derivedCommands;N(f.pickId)&&(A.picking=Iv.createPickDerivedCommand(o,f,y,A.picking)),f.pickOnly||(A.depth=Iv.createDepthOnlyDerivedCommand(o,f,y,A.depth)),A.originalCommand=f,o._hdr&&(A.hdr=Iv.createHdrCommand(f,y,A.hdr),f=A.hdr.command,A=f.derivedCommands),w&&f.receiveShadows&&(A.shadows=mD.createReceiveDerivedCommand(C,f,m,y,A.shadows)),f.pass===vr.TRANSLUCENT&&N(x)&&x.isSupported()&&(w&&f.receiveShadows?(A.oit=N(A.oit)?A.oit:{},A.oit.shadows=x.createDerivedCommands(A.shadows.receiveCommand,y,A.oit.shadows)):A.oit=x.createDerivedCommands(f,y,A.oit))}Lu.prototype.updateDerivedCommands=function(o){if(!N(o.derivedCommands))return;let f=this._frameState,m=this._context,v=o.derivedCommands,y=!1,x=f.shadowState.lastDirtyTime;o.lastDirtyTime!==x&&(o.lastDirtyTime=x,o.dirty=!0,y=!0);let C=f.useLogDepth,w=N(v.logDepth),A=C&&!w,E=f.textureProjecitonHints.shadowsEnabled,T=f.textureProjecitonHints.shadowMaps,S=f.textureProjecitonHints.lightShadowMaps,M=o.owner&&(o.owner instanceof S_||o.owner instanceof kY||o.owner instanceof Tj);if(E&&M){let k=[],U=[];for(let j of T)j._useDepth?U.push(j):k.push(j);let G=!1;if(k.length>0&&N(o.receiveTextureProjectionList)&&o.receiveTextureProjectionList.length>0&&((w||A)&&(v.logDepth=Iv.createLogDepthCommand(o,m,v.logDepth),c6e(v.logDepth.command.derivedCommands,!1,k,S,v.logDepth.command,y,m,this._camera,this.maxProjectionCount),h6e(this,v.logDepth.command,y,!1,k,S)),G=!0),U.length>0&&((w||A)&&(v.logDepth=Iv.createLogDepthCommand(o,m,v.logDepth),c6e(v.logDepth.command.derivedCommands,!0,U,S,v.logDepth.command,y,m,this._camera,this.maxProjectionCount),o.castShadows&&(v.perspectivesWithDepth=v.logDepth.command.derivedCommands.perspectivesWithDepth),h6e(this,v.logDepth.command,y,!0,U,S)),G=!0),G)return}let I=!1,P=f.viewShedState.lastDirtyTime;o.lastDirtyTime!==P&&(o.lastDirtyTime=P,o.dirty=!0,I=!0);let D=this._hdr,L=N(v.hdr),R=N(v.originalCommand),O=D&&!L,F=(!C||!D)&&!R;if(o.dirty=o.dirty||A||O||F,o.dirty){o.dirty=!1;let k=f.viewShedState.shadowMaps;f.viewShedState.shadowsEnabled&&o.castShadows&&(v.viewShedMaps=s6.createCastDerivedCommand(k,o,I,m,v.viewShedMaps)),(w||A)&&(v.logDepth=Iv.createLogDepthCommand(o,m,v.logDepth),d6e(this,v.logDepth.command,I)),(R||F)&&d6e(this,o,I)}if(y=!1,o.lastDirtyTime!==x&&(o.lastDirtyTime=x,o.dirty=!0,y=!0),o.dirty=o.dirty||A||O||F,o.dirty){o.dirty=!1;let k=f.shadowState.shadowMaps;f.shadowState.shadowsEnabled&&o.castShadows&&(v.shadows=mD.createCastDerivedCommand(k,o,y,m,v.shadows)),(w||A)&&(v.logDepth=Iv.createLogDepthCommand(o,m,v.logDepth),f6e(this,v.logDepth.command,y)),(R||F)&&f6e(this,o,y)}};var Ubi=new ET({pass:ep.RENDER}),hpe=new ET({pass:ep.PRELOAD}),dpe=new ET({pass:ep.PRELOAD_FLIGHT}),Gbi=new ET({pass:ep.REQUEST_RENDER_MODE_DEFER_CHECK}),p6e=new Pi,fpe;function Wbi(o){let f=o.globe;if(o._mode===_i.SCENE3D&&N(f)&&f.show&&!o._cameraUnderground&&!o._globeTranslucencyState.translucent){let m=f.ellipsoid,v=o.frameState.minimumTerrainHeight;return p6e.radius=m.minimumRadius+v,fpe=Ure.fromBoundingSphere(p6e,o.camera.positionWC,fpe),fpe}}Lu.prototype.clearPasses=function(o){o.render=!1,o.pick=!1,o.depth=!1,o.postProcess=!1,o.offscreen=!1};function Zit(o,f,m){let v=o._frameState;v.frameNumber=f,v.time=ci.clone(m,v.time)}Lu.prototype.updateFrameState=function(){let o=this.camera,f=this._frameState;f.commandList.length=0,f.shadowMaps.length=0,f.textureProjectionMaps.length=0,f.viewShedMaps.length=0,f.brdfLutGenerator=this._brdfLutGenerator,f.environmentMap=this.skyBox&&this.skyBox._cubeMap,f.mode=this._mode,f.morphTime=this.morphTime,f.mapProjection=this.mapProjection,f.camera=o,f.cullingVolume=o.frustum.computeCullingVolume(o.positionWC,o.directionWC,o.upWC),N(o.frustum.computeCullingVolumeForTileset)&&(f.cullingVolumeForTileset=o.frustum.computeCullingVolumeForTileset(o.positionWC,o.directionWC,o.upWC)),f.occluder=Wbi(this),f.minimumTerrainHeight=0,f.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,f.invertClassification=this.invertClassification,f.sunColor=this._sunColor,f.light=this.light,f.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof Gs||this.camera.frustum instanceof Pm),f.light=this.light,f.cameraUnderground=this._cameraUnderground,f.globeTranslucencyState=this._globeTranslucencyState,N(this.globe)&&(f.terrainExaggeration=this.globe.terrainExaggeration,f.terrainExaggerationRelativeHeight=this.globe.terrainExaggerationRelativeHeight),N(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.ready?(f.specularEnvironmentMaps=this._specularEnvironmentMapAtlas.texture,f.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentMapAtlas.maximumMipmapLevel):(f.specularEnvironmentMaps=void 0,f.specularEnvironmentMapsMaximumLOD=void 0),f.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=Re.clone(this.invertClassificationColor,this._actualInvertClassificationColor),Doe.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),f.invertClassificationColor=this._actualInvertClassificationColor,N(this.globe)?f.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:f.maximumScreenSpaceError=2,this.clearPasses(f.passes),f.tilesetPassState=void 0};Lu.prototype.isVisible=function(o,f,m){return N(o)&&(!N(o.boundingVolume)||!o.cull||f.computeVisibility(o.boundingVolume)!==La.OUTSIDE&&(!N(m)||!o.occlude||!o.boundingVolume.isOccluded(m)))};var hee=new Ee(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);hee=Ee.inverseTransformation(hee,hee);function jbi(o,f,m,v){let y=f._frameState,x=y.context,C=o.boundingVolume;N(f._debugVolume)&&f._debugVolume.destroy();let w,A=H.clone(C.center);if(y.mode!==_i.SCENE3D){A=Ee.multiplyByPoint(hee,A,A);let M=y.mapProjection,I=M.unproject(A);A=M.ellipsoid.cartographicToCartesian(I)}if(N(C.radius)){let M=C.radius;w=Ju.toWireframe(V0.createGeometry(new V0({radii:new H(M,M,M),vertexFormat:ms.FLAT_VERTEX_FORMAT}))),f._debugVolume=new Ia({geometryInstances:new co({geometry:w,modelMatrix:Ee.fromTranslation(A),attributes:{color:new ea(1,0,0,1)}}),appearance:new ms({flat:!0,translucent:!1}),asynchronous:!1})}else{let M=C.halfAxes;w=Ju.toWireframe(MM.createGeometry(MM.fromDimensions({dimensions:new H(2,2,2),vertexFormat:ms.FLAT_VERTEX_FORMAT}))),f._debugVolume=new Ia({geometryInstances:new co({geometry:w,modelMatrix:Ee.fromRotationTranslation(M,A,new Ee),attributes:{color:new ea(1,0,0,1)}}),appearance:new ms({flat:!0,translucent:!1}),asynchronous:!1})}let E=y.commandList,T=y.commandList=[];f._debugVolume.update(y),o=T[0],y.useLogDepth&&(o=Iv.createLogDepthCommand(o,x).command);let S;N(v)&&(S=m.framebuffer,m.framebuffer=v),o.execute(x,m),N(S)&&(m.framebuffer=S),y.commandList=E}function Bg(o,f,m,v,y){let x=f._frameState;if(N(f.debugCommandFilter)&&!f.debugCommandFilter(o))return;if(o instanceof Gc){o.execute(m,v);return}o.debugShowBoundingVolume&&N(o.boundingVolume)&&jbi(o,f,v,y),x.useLogDepth&&N(o.derivedCommands.logDepth)&&(o=o.derivedCommands.logDepth.command);let C=x.passes;if(!C.pick&&!C.depth&&f._hdr&&N(o.derivedCommands)&&N(o.derivedCommands.hdr)&&(o=o.derivedCommands.hdr.command),C.pick||C.depth){if(C.pick&&!C.depth&&N(o.derivedCommands.picking)){o=o.derivedCommands.picking.pickCommand,o.execute(m,v);return}else if(N(o.derivedCommands.depth)){o=o.derivedCommands.depth.depthOnlyCommand,o.execute(m,v);return}}if(f.debugShowCommands||f.debugShowFrustums){f._debugInspector.executeDebugShowFrustumsCommand(f,o,v);return}let w=f.frameState.textureProjecitonHints.shadowsEnabled&&f.frameState.textureProjecitonHints.lightShadowMaps.length>0,A=N(o.derivedCommands.fisheyes),E=N(o.derivedCommands.perspectives),T=N(o.derivedCommands.perspectivesWithDepth);w&&(A||E||T)?(E&&o.derivedCommands.perspectives.receiveCommand.execute(m,v),T&&o.derivedCommands.perspectivesWithDepth.receiveCommand.execute(m,v),A&&o.derivedCommands.fisheyes.receiveCommand.execute(m,v)):x.viewShedState.lightShadowsEnabled&&N(o.derivedCommands.viewShedMaps)?o.derivedCommands.viewShedMaps.receiveCommand.execute(m,v):x.shadowState.lightShadowsEnabled&&o.receiveShadows&&N(o.derivedCommands.shadows)?o.derivedCommands.shadows.receiveCommand.execute(m,v):o.execute(m,v)}function a7(o,f,m,v){let y=f._frameState,x=o.derivedCommands;N(x)&&(y.useLogDepth&&N(x.logDepth)&&(o=x.logDepth.command),x=o.derivedCommands,N(x.picking)?(o=x.picking.pickCommand,o.execute(m,v)):N(x.depth)&&(o=x.depth.depthOnlyCommand,o.execute(m,v)))}function $it(o,f,m){return f.boundingVolume.distanceSquaredTo(m)-o.boundingVolume.distanceSquaredTo(m)}function Ybi(o,f,m){return o.boundingVolume.distanceSquaredTo(m)-f.boundingVolume.distanceSquaredTo(m)+xe.EPSILON12}function qbi(o,f,m,v,y){let x=o.context;A6(v,$it,o.camera.positionWC),N(y)&&f(y.unclassifiedCommand,o,x,m);let C=v.length;for(let w=0;w<C;++w)f(v[w],o,x,m)}function Xbi(o,f,m,v,y){let x=o.context;A6(v,Ybi,o.camera.positionWC),N(y)&&f(y.unclassifiedCommand,o,x,m);let C=v.length;for(let w=0;w<C;++w)f(v[w],o,x,m)}function Jbi(o,f,m,v){let y=o.context;A6(v,$it,o.camera.positionWC);let x=v.length;for(let C=0;C<x;++C)f(v[C],o,y,m)}var ert=new pc,trt=new J2,irt=new Gs,rrt=new Pm;function Xte(o,f,m){o.bim&&(m?o.bim.RenderShadow(f,m):o.bim.RenderColor(f))}function Jte(o,f){let m=o.camera,v=o.context,y=o.frameState,x=v.uniformState;x.updateCamera(m);let C;N(m.frustum.fov)?C=m.frustum.clone(ert):N(m.frustum.infiniteProjectionMatrix)?C=m.frustum.clone(trt):N(m.frustum.width)?C=m.frustum.clone(irt):C=m.frustum.clone(rrt),C.near=m.frustum.near,C.far=m.frustum.far,x.updateFrustum(C),x.updatePass(vr.ENVIRONMENT);let w=y.passes,A=w.pick,E=o._environmentState,T=o._view,S=E.renderTranslucentDepthForPick,M=E.useWebVR;if(!A){let Q=E.skyBoxCommand;if(N(Q)&&Bg(Q,o,v,f),E.isSkyAtmosphereVisible&&Bg(E.skyAtmosphereCommand,o,v,f),E.isSunVisible&&(E.sunDrawCommand.execute(v,f),o.sunBloom&&!M)){let ee;E.useGlobeDepthFramebuffer?ee=T.globeDepth.framebuffer:E.usePostProcess?ee=T.sceneFramebuffer.framebuffer:ee=E.originalFramebuffer,o._sunPostProcess.execute(v),o._sunPostProcess.copy(v,ee),f.framebuffer=ee}E.isMoonVisible&&E.moonCommand.execute(v,f)}let I;E.useOIT?(N(o._executeOITFunction)||(o._executeOITFunction=function(Q,ee,z,ie,re){T.globeDepth.prepareColorTextures(v),T.oit.executeCommands(Q,ee,z,ie,re)}),I=o._executeOITFunction):w.render?I=qbi:I=Xbi;let P=T.frustumCommandsList,D=P.length,L=E.clearGlobeDepth,R=E.useDepthPlane,O=o._globeTranslucencyState,F=O.translucent,k=o._view.globeTranslucencyFramebuffer,U=o._depthClearCommand,G=o._stencilClearCommand,j=o._classificationStencilClearCommand,q=o._depthPlane,J=E.usePostProcessSelected,X=m.position.z,Y;for(let Q=0;Q<D;++Q){let ee=D-Q-1,z=P[ee];o.mode===_i.SCENE2D?(m.position.z=X-z.near+1,C.far=Math.max(1,z.far-z.near),C.near=1,x.update(y),x.updateFrustum(C)):(C.near=ee!==0?z.near*o.opaqueFrustumNearOffset:z.near,C.far=z.far,x.updateFrustum(C)),U.execute(v,f),v.stencilBuffer&&G.execute(v,f),x.updatePass(vr.GLOBE);let ie=z.commands[vr.GLOBE],re=z.indices[vr.GLOBE];if(F)O.executeGlobeCommands(z,Bg,k,o,f);else for(Y=0;Y<re;++Y)Bg(ie[Y],o,v,f);Xte(o,f,!1);let ne=T.globeDepth;if(N(ne)&&E.useGlobeDepthFramebuffer&&ne.executeCopyDepth(v,f),!E.renderTranslucentDepthForPick)if(x.updatePass(vr.TERRAIN_CLASSIFICATION),ie=z.commands[vr.TERRAIN_CLASSIFICATION],re=z.indices[vr.TERRAIN_CLASSIFICATION],F)O.executeGlobeClassificationCommands(z,Bg,k,o,f);else for(Y=0;Y<re;++Y)Bg(ie[Y],o,v,f);if(L&&(U.execute(v,f),R&&q.execute(v,f)),!E.useInvertClassification||A||E.renderTranslucentDepthForPick){for(x.updatePass(vr.CESIUM_3D_TILE),ie=z.commands[vr.CESIUM_3D_TILE],re=z.indices[vr.CESIUM_3D_TILE],Y=0;Y<re;++Y)Bg(ie[Y],o,v,f);if(re>0&&(N(ne)&&E.useGlobeDepthFramebuffer&&(ne.prepareColorTextures(v,L),ne.executeUpdateDepth(v,f,L,ne.depthStencilTexture)),!E.renderTranslucentDepthForPick))for(x.updatePass(vr.CESIUM_3D_TILE_CLASSIFICATION),ie=z.commands[vr.CESIUM_3D_TILE_CLASSIFICATION],re=z.indices[vr.CESIUM_3D_TILE_CLASSIFICATION],Y=0;Y<re;++Y)Bg(ie[Y],o,v,f)}else{o._invertClassification.clear(v,f);let ae=f.framebuffer;for(f.framebuffer=o._invertClassification._fbo.framebuffer,x.updatePass(vr.CESIUM_3D_TILE),ie=z.commands[vr.CESIUM_3D_TILE],re=z.indices[vr.CESIUM_3D_TILE],Y=0;Y<re;++Y)Bg(ie[Y],o,v,f);for(N(ne)&&E.useGlobeDepthFramebuffer&&(o._invertClassification.prepareTextures(v),ne.executeUpdateDepth(v,f,L,o._invertClassification._fbo.getDepthStencilTexture())),x.updatePass(vr.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),ie=z.commands[vr.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],re=z.indices[vr.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW],Y=0;Y<re;++Y)Bg(ie[Y],o,v,f);for(f.framebuffer=ae,o._invertClassification.executeClassified(v,f),y.invertClassificationColor.alpha===1&&o._invertClassification.executeUnclassified(v,f),re>0&&v.stencilBuffer&&j.execute(v,f),x.updatePass(vr.CESIUM_3D_TILE_CLASSIFICATION),ie=z.commands[vr.CESIUM_3D_TILE_CLASSIFICATION],re=z.indices[vr.CESIUM_3D_TILE_CLASSIFICATION],Y=0;Y<re;++Y)Bg(ie[Y],o,v,f)}for(re>0&&v.stencilBuffer&&G.execute(v,f),x.updatePass(vr.VOXELS),ie=z.commands[vr.VOXELS],re=z.indices[vr.VOXELS],ie.length=re,Jbi(o,Bg,f,ie),x.updatePass(vr.OPAQUE),ie=z.commands[vr.OPAQUE],re=z.indices[vr.OPAQUE],Y=0;Y<re;++Y)Bg(ie[Y],o,v,f);ee!==0&&o.mode!==_i.SCENE2D&&(C.near=z.near,x.updateFrustum(C));let oe;if(!A&&E.useInvertClassification&&y.invertClassificationColor.alpha<1&&(oe=o._invertClassification),x.updatePass(vr.TRANSLUCENT),ie=z.commands[vr.TRANSLUCENT],ie.length=z.indices[vr.TRANSLUCENT],I(o,Bg,f,ie,oe),z.indices[vr.CESIUM_3D_TILE_CLASSIFICATION]>0&&T.translucentTileClassification.isSupported()&&(T.translucentTileClassification.executeTranslucentCommands(o,Bg,f,ie,ne.depthStencilTexture),T.translucentTileClassification.executeClassificationCommands(o,Bg,f,z)),v.depthTexture&&o.useDepthPicking&&(E.useGlobeDepthFramebuffer||S)){let ae=ne.depthStencilTexture,fe=o._picking.getPickDepth(o,ee);fe.update(v,ae),fe.executeCopyDepth(v,f)}if(A||!J)continue;let se=f.framebuffer;if(f.framebuffer=T.sceneFramebuffer.getIdFramebuffer(),C.near=ee!==0?z.near*o.opaqueFrustumNearOffset:z.near,C.far=z.far,x.updateFrustum(C),x.updatePass(vr.GLOBE),ie=z.commands[vr.GLOBE],re=z.indices[vr.GLOBE],F)O.executeGlobeCommands(z,a7,k,o,f);else for(Y=0;Y<re;++Y)a7(ie[Y],o,v,f);for(L&&(U.framebuffer=f.framebuffer,U.execute(v,f),U.framebuffer=void 0),L&&R&&q.execute(v,f),x.updatePass(vr.CESIUM_3D_TILE),ie=z.commands[vr.CESIUM_3D_TILE],re=z.indices[vr.CESIUM_3D_TILE],Y=0;Y<re;++Y)a7(ie[Y],o,v,f);for(x.updatePass(vr.OPAQUE),ie=z.commands[vr.OPAQUE],re=z.indices[vr.OPAQUE],Y=0;Y<re;++Y)a7(ie[Y],o,v,f);for(x.updatePass(vr.TRANSLUCENT),ie=z.commands[vr.TRANSLUCENT],re=z.indices[vr.TRANSLUCENT],Y=0;Y<re;++Y)a7(ie[Y],o,v,f);f.framebuffer=se}D===0&&(U.execute(v,f),x.updatePass(vr.GLOBE),Xte(o,f,!1))}function e2e(o){o.context.uniformState.updatePass(vr.COMPUTE);let f=o._environmentState.sunComputeCommand;N(f)&&f.execute(o._computeEngine);let m=o._computeCommandList,v=m.length;for(let y=0;y<v;++y)m[y].execute(o._computeEngine)}function Kbi(o,f){o.context.uniformState.updatePass(vr.OVERLAY);let m=o.context,v=o._overlayCommandList,y=v.length;for(let x=0;x<y;++x)v[x].execute(m,f)}function t2e(o,f,m,v){v=Z(v,!0);let y=m.shadowMapCullingVolume,x=m.isPointLight,C=m.passes,w=C.length,A=f.length;for(let E=0;E<A;++E){let T=f[E];if(v&&o.updateDerivedCommands(T),T.castShadows&&(T.pass===vr.GLOBE||T.pass===vr.CESIUM_3D_TILE||T.pass===vr.OPAQUE||T.pass===vr.TRANSLUCENT)&&o.isVisible(T,y))if(x)for(let S=0;S<w;++S)C[S].commandList.push(T);else if(w===1)C[0].commandList.push(T);else{let S=!1;for(let M=w-1;M>=0;--M){let I=C[M].cullingVolume;if(o.isVisible(T,I))C[M].commandList.push(T),S=!0;else if(S)break}}}}function i2e(o){let f=o.frameState,m=f.shadowState.shadowMaps,v=m.length;if(!f.shadowState.shadowsEnabled)return;let y=o.context,x=y.uniformState;for(let C=0;C<v;++C){let w=m[C];if(w.outOfView)continue;let A=w.passes,E=A.length;for(let S=0;S<E;++S)A[S].commandList.length=0;let T=o.frameState.commandList;t2e(o,T,w);for(let S=0;S<E;++S){let M=w.passes[S];x.updateCamera(M.camera),w.updatePass(y,S);let I=M.commandList.length;for(let P=0;P<I;++P){let D=M.commandList[P];x.updatePass(D.pass),Bg(D.derivedCommands.shadows.castCommands[C],o,y,M.passState)}Xte(o,M.passState,w)}}}function nrt(o){let f=o.frameState,m=[],v=f.viewShedState.shadowMaps;for(let w of v)m.push(w);let y=m.length;if(!f.viewShedState.shadowsEnabled)return;let x=o.context,C=x.uniformState;for(let w=0;w<y;++w){let A=m[w];if(A.outOfView)continue;let E,T=A.passes,S=T.length;for(E=0;E<S;++E)T[E].commandList.length=0;let M=o.frameState.commandList;for(t2e(o,M,A),E=0;E<S;++E){let I=A.passes[E];C.updateCamera(I.camera),A.updatePass(x,E);let P=I.commandList.length;for(let D=0;D<P;++D){let L=I.commandList[D];N(L.derivedCommands.viewShedMaps)&&(L.derivedCommands.viewShedMaps.castCommands.length<y||(C.updatePass(L.pass),Bg(L.derivedCommands.viewShedMaps.castCommands[w],o,x,I.passState)))}Xte(o,I.passState,A)}}}function ort(o){let f=o.frameState;if(!f.textureProjecitonHints.shadowsEnabled)return;let m=[],v=f.textureProjecitonHints.shadowMaps;for(let w of v)w._useDepth&&!w.outOfView&&m.push(w);let y=m.length,x=o.context,C=x.uniformState;for(let w=0;w<y;++w){let A=m[w],E,T=A.passes,S=T.length;for(E=0;E<S;++E)T[E].commandList.length=0;let M=o.frameState.commandList;for(t2e(o,M,A,!1),E=0;E<S;++E){let I=A.passes[E];C.updateCamera(I.camera),A.updatePass(x,E);let P=I.commandList.length;for(let D=0;D<P;++D){let L=I.commandList[D];N(L.derivedCommands.perspectivesWithDepth)&&(L.derivedCommands.perspectivesWithDepth.castCommands.length<y||(C.updatePass(L.pass),Bg(L.derivedCommands.perspectivesWithDepth.castCommands[w],o,x,I.passState)))}}}}var Qbi=new H;Lu.prototype.updateAndExecuteCommands=function(o,f){let m=this._frameState.mode;this._environmentState.useWebVR?art(this,o,f):m!==_i.SCENE2D||this._mapMode2D===$E.ROTATE?bR(!0,this,o,f):(jq(this,o,f),srt(this,o))};Lu.prototype.updateAndExecuteCommandszh=function(o,f){let m=this._frameState.mode;this._environmentState.useWebVR?art(this,o,f):m!==_i.SCENE2D||this._mapMode2D===$E.ROTATE?awi(!0,this,o,f):(jq(this,o,f),srt(this,o))};function art(o,f,m){let v=o._view,y=v.camera,x=o._environmentState.renderTranslucentDepthForPick;jq(o,f,m),crt(o),v.createPotentiallyVisibleSet(o),e2e(o),x||(i2e(o),ort(o),nrt(o));let C=f.viewport;C.x=0,C.y=0,C.width=C.width*.5;let w=Vl.clone(y,o._cameraVR);w.frustum=y.frustum;let A=y.frustum.near,E=A*Z(o.focalLength,5),T=Z(o.eyeSeparation,E/30),S=H.multiplyByScalar(w.right,T*.5,Qbi);y.frustum.aspectRatio=C.width/C.height;let M=.5*T*A/E;H.add(w.position,S,y.position),y.frustum.xOffset=M,Jte(o,f),C.x=C.width,H.subtract(w.position,S,y.position),y.frustum.xOffset=-M,Jte(o,f),Vl.clone(w,y)}var Zbi=new Mt(Math.PI,xe.PI_OVER_TWO),$bi=new H,ewi=new H,twi=new Ee,iwi=new Ee,rwi=new H,nwi=new H,owi=new Xr;function srt(o,f){let m=o.context,v=o.frameState,y=o.camera,x=f.viewport,C=Xr.clone(x,owi);f.viewport=C;let w=Zbi,A=$bi;o.mapProjection.project(w,A);let E=H.clone(y.position,ewi),T=Ee.clone(y.transform,iwi),S=y.frustum.clone();y._setTransform(Ee.IDENTITY);let M=Ee.computeViewportTransformation(C,0,1,twi),I=y.frustum.projectionMatrix,P=y.positionWC.y,D=H.fromElements(xe.sign(P)*A.x-P,0,-y.positionWC.x,rwi),L=tn.pointToGLWindowCoordinates(I,M,D,nwi);L.x=Math.floor(L.x);let R=C.x,O=C.width;if(P===0||L.x<=R||L.x>=R+O)bR(!0,o,f);else if(Math.abs(R+O*.5-L.x)<1)C.width=L.x-C.x,y.position.x*=xe.sign(y.position.x),y.frustum.right=0,v.cullingVolume=y.frustum.computeCullingVolume(y.positionWC,y.directionWC,y.upWC),m.uniformState.update(v),bR(!0,o,f),C.x=L.x,y.position.x=-y.position.x,y.frustum.right=-y.frustum.left,y.frustum.left=0,v.cullingVolume=y.frustum.computeCullingVolume(y.positionWC,y.directionWC,y.upWC),m.uniformState.update(v),bR(!1,o,f);else if(L.x>R+O*.5){C.width=L.x-R;let F=y.frustum.right;y.frustum.right=A.x-P,v.cullingVolume=y.frustum.computeCullingVolume(y.positionWC,y.directionWC,y.upWC),m.uniformState.update(v),bR(!0,o,f),C.x=L.x,C.width=R+O-L.x,y.position.x=-y.position.x,y.frustum.left=-y.frustum.right,y.frustum.right=F-y.frustum.right*2,v.cullingVolume=y.frustum.computeCullingVolume(y.positionWC,y.directionWC,y.upWC),m.uniformState.update(v),bR(!1,o,f)}else{C.x=L.x,C.width=R+O-L.x;let F=y.frustum.left;y.frustum.left=-A.x-P,v.cullingVolume=y.frustum.computeCullingVolume(y.positionWC,y.directionWC,y.upWC),m.uniformState.update(v),bR(!0,o,f),C.x=R,C.width=L.x-R,y.position.x=-y.position.x,y.frustum.right=-y.frustum.left,y.frustum.left=F-y.frustum.left*2,v.cullingVolume=y.frustum.computeCullingVolume(y.positionWC,y.directionWC,y.upWC),m.uniformState.update(v),bR(!1,o,f)}y._setTransform(T),H.clone(E,y.position),y.frustum=S.clone(),f.viewport=x}function bR(o,f,m,v){let y=f._environmentState,x=f._view,C=y.renderTranslucentDepthForPick;o||(f.frameState.commandList.length=0),crt(f),x.createPotentiallyVisibleSet(f),o&&(N(v)&&jq(f,m,v),e2e(f),C||(i2e(f),ort(f),nrt(f))),Jte(f,m)}function awi(o,f,m,v){let y=f._environmentState,x=f._view,C=y.renderTranslucentDepthForPick;!o&&!C&&(f.frameState.commandList.length=0),C||uwi(f),x.createPotentiallyVisibleSet(f),o&&(N(v)&&jq(f,m,v),C||(e2e(f),i2e(f))),Jte(f,m)}var m6e=new hg;Lu.prototype.updateEnvironment=function(){let o=this._frameState,f=this._view,m=this._environmentState,v=o.passes.render,y=o.passes.offscreen,x=this.skyAtmosphere,C=this.globe,w=this._globeTranslucencyState;if(!v||this._mode!==_i.SCENE2D&&f.camera.frustum instanceof Gs||!w.environmentVisible)m.skyAtmosphereCommand=void 0,m.skyBoxCommand=void 0,m.sunDrawCommand=void 0,m.sunComputeCommand=void 0,m.moonCommand=void 0;else{N(x)?(N(C)&&(x.setDynamicAtmosphereColor(C.enableLighting&&C.dynamicAtmosphereLighting,C.dynamicAtmosphereLightingFromSun),m.isReadyForAtmosphere=m.isReadyForAtmosphere||C._surface._tilesToRender.length>0),m.skyAtmosphereCommand=x.update(o,C)):m.skyAtmosphereCommand=void 0,m.skyBoxCommand=N(this.skyBox)?this.skyBox.update(o,this._hdr):void 0;let P=N(this.sun)?this.sun.update(o,f.passState,this._hdr):void 0;m.sunDrawCommand=N(P)?P.drawCommand:void 0,m.sunComputeCommand=N(P)?P.computeCommand:void 0,m.moonCommand=N(this.moon)?this.moon.update(o):void 0}let A=m.clearGlobeDepth=N(C)&&C.show&&(!C.depthTestAgainstTerrain||this.mode===_i.SCENE2D);(m.useDepthPlane=A&&this.mode===_i.SCENE3D&&w.useDepthPlane)&&this._depthPlane.update(o),m.renderTranslucentDepthForPick=!1,m.useWebVR=this._useWebVR&&this.mode!==_i.SCENE2D&&!y;let E=o.mode===_i.SCENE3D&&!w.sunVisibleThroughGlobe?o.occluder:void 0,T=o.cullingVolume,S=m6e.planes;for(let P=0;P<5;++P)S[P]=T.planes[P];T=m6e,m.isSkyAtmosphereVisible=N(m.skyAtmosphereCommand)&&m.isReadyForAtmosphere,m.isSunVisible=this.isVisible(m.sunDrawCommand,T,E),m.isMoonVisible=this.isVisible(m.moonCommand,T,E);let M=this.specularEnvironmentMaps,I=this._specularEnvironmentMapAtlas;N(M)&&(!N(I)||I.url!==M)?(I=I&&I.destroy(),this._specularEnvironmentMapAtlas=new V5(M)):!N(M)&&N(I)&&(I.destroy(),this._specularEnvironmentMapAtlas=void 0),N(this._specularEnvironmentMapAtlas)&&this._specularEnvironmentMapAtlas.update(o)};function lrt(o){let f=o._frameState;o.debugShowFrustumPlanes!==o._debugShowFrustumPlanes&&(o.debugShowFrustumPlanes?o._debugFrustumPlanes=new Ap({camera:o.camera,updateOnChange:!1,frustumSplits:f.frustumSplits}):o._debugFrustumPlanes=o._debugFrustumPlanes&&o._debugFrustumPlanes.destroy(),o._debugShowFrustumPlanes=o.debugShowFrustumPlanes),N(o._debugFrustumPlanes)&&o._debugFrustumPlanes.update(f)}function urt(o){let f=o._frameState,m=f.shadowMaps,v=m.length,y=v>0&&!f.passes.pick&&o.mode===_i.SCENE3D;if(y!==f.shadowState.shadowsEnabled&&(++f.shadowState.lastDirtyTime,f.shadowState.shadowsEnabled=y),f.shadowState.lightShadowsEnabled=!1,!!y){for(let x=0;x<v;++x)if(m[x]!==f.shadowState.shadowMaps[x]){++f.shadowState.lastDirtyTime;break}f.shadowState.shadowMaps.length=0,f.shadowState.lightShadowMaps.length=0;for(let x=0;x<v;++x){let C=m[x];C.update(f),f.shadowState.shadowMaps.push(C),C.fromLightSource&&(f.shadowState.lightShadowMaps.push(C),f.shadowState.lightShadowsEnabled=!0),C.dirty&&(++f.shadowState.lastDirtyTime,C.dirty=!1)}}}function swi(o){let f=o._frameState,m=f.textureProjectionMaps,v=m.length,y=v>0&&!f.passes.pick&&o.mode===_i.SCENE3D;if(y!==f.textureProjecitonHints.shadowsEnabled&&(++f.textureProjecitonHints.lastDirtyTime,f.textureProjecitonHints.shadowsEnabled=y),f.textureProjecitonHints.lightShadowsEnabled=!1,!!y){for(let x=0;x<v;++x)if(m[x]!==f.textureProjecitonHints.shadowMaps[x]){++f.textureProjecitonHints.lastDirtyTime;break}f.textureProjecitonHints.shadowMaps.length=0,f.textureProjecitonHints.lightShadowMaps.length=0;for(let x=0;x<v;++x){let C=m[x];C.update(f),f.textureProjecitonHints.shadowMaps.push(C),C.fromLightSource&&(f.textureProjecitonHints.lightShadowMaps.push(C),f.textureProjecitonHints.lightShadowsEnabled=!0),C.dirty&&(++f.textureProjecitonHints.lastDirtyTime,C.dirty=!1)}}}function lwi(o){let f=o._frameState,m=f.viewShedMaps,v=m.length,y=v>0&&!f.passes.pick&&o.mode===_i.SCENE3D;if(y!==f.viewShedState.shadowsEnabled&&(++f.viewShedState.lastDirtyTime,f.viewShedState.shadowsEnabled=y),f.viewShedState.lightShadowsEnabled=!1,!!y){for(let x=0;x<v;++x)if(m[x]!==f.viewShedState.shadowMaps[x]){++f.viewShedState.lastDirtyTime;break}f.viewShedState.shadowMaps.length=0,f.viewShedState.lightShadowMaps.length=0;for(let x=0;x<v;++x){let C=m[x];C.update(f),f.viewShedState.shadowMaps.push(C),f.viewShedState.lightShadowMaps.push(C),f.viewShedState.lightShadowsEnabled=!0,C.dirty&&(++f.viewShedState.lastDirtyTime,C.dirty=!1)}}}function crt(o){let f=o._frameState;f.scene=o,o.loadPrimitiveFirst?(o._primitives.update(f),o._groundPrimitives.update(f)):(o._groundPrimitives.update(f),o._primitives.update(f)),lrt(o),urt(o),swi(o),lwi(o),o._globe&&o._globe.render(f)}function uwi(o){let f=o._frameState;o._groundPrimitives.update(f),o._primitives.update(f),o.UpdateQuad(f),lrt(o),urt(o),o._globe&&o._globe.render(f)}function jq(o,f,m){let v=o._context,y=o._frameState,x=o._environmentState,C=o._view,w=o._frameState.passes.pick;N(C.globeDepth)&&(C.globeDepth.picking=w);let A=x.useWebVR;x.originalFramebuffer=f.framebuffer,N(o.sun)&&o.sunBloom!==o._sunBloom?(o.sunBloom&&!A?o._sunPostProcess=new YSe:N(o._sunPostProcess)&&(o._sunPostProcess=o._sunPostProcess.destroy()),o._sunBloom=o.sunBloom):!N(o.sun)&&N(o._sunPostProcess)&&(o._sunPostProcess=o._sunPostProcess.destroy(),o._sunBloom=!1);let E=o._clearColorCommand;Re.clone(m,E.color),E.execute(v,f);let T=x.useGlobeDepthFramebuffer=N(C.globeDepth);T&&(C.globeDepth.update(v,f,C.viewport,o.msaaSamples,o._hdr,x.clearGlobeDepth),C.globeDepth.clear(v,f,m));let S=C.oit,M=x.useOIT=!w&&N(S)&&S.isSupported();M&&(S.update(v,f,C.globeDepth.colorFramebufferManager,o._hdr,o.msaaSamples),S.clear(v,f,m),x.useOIT=S.isSupported());let I=o.postProcessStages;o._sunShaftEnabled&&x.isSunVisible?I.sunShaft.enabled=!0:I.sunShaft.enabled=!1;let P=x.usePostProcess=!w&&(o._hdr||I.length>0||I.ambientOcclusion.enabled||I.fxaa.enabled||I.bloom.enabled);if(x.usePostProcessSelected=!1,P){if(C.sceneFramebuffer.update(v,C.viewport,o._hdr,o.msaaSamples),C.sceneFramebuffer.clear(v,f,m),I.sunShaft.enabled){I.sunShaft.uniforms.u_size=o.sun._size;let D=y.mode;D===_i.SCENE3D?Pi.clone(o.sun._boundingVolume,I.sunShaft._sunBoundingVolume):D===_i.COLUMBUS_VIEW&&Pi.clone(o.sun._boundingVolume2D,I.sunShaft._sunBoundingVolume)}I.update(v,y.useLogDepth,o._hdr),I.clear(v),P=x.usePostProcess=I.ready,x.usePostProcessSelected=P&&I.hasSelected}if(x.isSunVisible&&o.sunBloom&&!A?(f.framebuffer=o._sunPostProcess.update(f),o._sunPostProcess.clear(v,f,m)):T?f.framebuffer=C.globeDepth.framebuffer:P&&(f.framebuffer=C.sceneFramebuffer.framebuffer),N(f.framebuffer)&&E.execute(v,f),x.useInvertClassification=!w&&N(f.framebuffer)&&o.invertClassification){let D;if(o.frameState.invertClassificationColor.alpha===1&&x.useGlobeDepthFramebuffer&&(D=C.globeDepth.framebuffer),N(D)||v.depthTexture){if(o._invertClassification.previousFramebuffer=D,o._invertClassification.update(v,o.msaaSamples,C.globeDepth.colorFramebufferManager),o._invertClassification.clear(v,f),o.frameState.invertClassificationColor.alpha<1&&M){let L=o._invertClassification.unclassifiedCommand,R=L.derivedCommands;R.oit=S.createDerivedCommands(L,v,R.oit)}}else x.useInvertClassification=!1}o._globeTranslucencyState.translucent&&C.globeTranslucencyFramebuffer.updateAndClear(o._hdr,C.viewport,v,f)}Lu.prototype.resolveFramebuffers=function(o){let f=this._context,m=this._environmentState,v=this._view,y=v.globeDepth;N(y)&&y.prepareColorTextures(f);let x=m.useOIT,C=m.useGlobeDepthFramebuffer,w=m.usePostProcess,A=m.originalFramebuffer,E=C?y.colorFramebufferManager:void 0,T=v.sceneFramebuffer._colorFramebuffer,S=v.sceneFramebuffer.idFramebuffer;if(x&&(o.framebuffer=w?T.framebuffer:A,v.oit.execute(f,o)),m.isSunVisible){let I=this.camera,P=f.uniformState;P.updateCamera(I);let D;N(I.frustum.fov)?D=I.frustum.clone(ert):N(I.frustum.infiniteProjectionMatrix)?D=I.frustum.clone(trt):N(I.frustum.width)?D=I.frustum.clone(irt):D=I.frustum.clone(rrt),D.near=I.frustum.near,D.far=I.frustum.far,P.updateFrustum(D)}let M=v.translucentTileClassification;if(M.hasTranslucentDepth&&M.isSupported()&&M.execute(this,o),w){v.sceneFramebuffer.prepareColorTextures(f);let I=T;C&&!x&&(I=E);let P=this.postProcessStages,D=I.getColorTexture(0),L=S.getColorTexture(0),R=Z(E,T).getDepthStencilTexture();P.execute(f,D,R,L),P.copy(f,A)}!x&&!w&&C&&(o.framebuffer=A,y.executeCopyColor(f,o))};function cwi(o){let f=o._frameState.afterRender;for(let m=0,v=f.length;m<v;++m)f[m]()&&o.requestRender();f.length=0}function hrt(o){let f=o._globe,m=o.camera.positionCartographic;if(N(f)&&f.show&&N(m))return f.getHeight(m)}function drt(o){let f=o.camera,m=o._mode,v=o.globe,y=o._screenSpaceCameraController,x=f.positionCartographic;if(!N(x))return!1;if(!y.onMap()&&x.height<0)return!0;if(!N(v)||!v.show||m===_i.SCENE2D||m===_i.MORPHING)return!1;let C=o._globeHeight;return N(C)&&x.height<C}Lu.prototype.initializeOffScreenFrame=function(){this._globeHeight=hrt(this),this._cameraUnderground=drt(this)};Lu.prototype.setProject=function(o){this.context.customProject=o};Lu.prototype.initializeFrame=function(){this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeight=hrt(this),this._cameraUnderground=drt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),N(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function hwi(o,f){if(o.debugShowFramesPerSecond){if(!N(o._performanceDisplay)){let m=document.createElement("div");m.className="cesium-performanceDisplay-defaultContainer",o._canvas.parentNode.appendChild(m);let v=new kq({container:m});o._performanceDisplay=v,o._performanceContainer=m}o._performanceDisplay.throttled=o.requestRenderMode,o._performanceDisplay.update(f)}else N(o._performanceDisplay)&&(o._performanceDisplay=o._performanceDisplay&&o._performanceDisplay.destroy(),o._performanceContainer.parentNode.removeChild(o._performanceContainer))}function dwi(o){o._jobScheduler.resetBudgets();let f=o._frameState;o.primitives.prePassesUpdate(f),N(o.globe)&&o.globe.update(f),o._picking.update(),f.creditDisplay.update()}function fwi(o){let f=o._frameState;o.primitives.postPassesUpdate(f),Rw.update()}var pwi=new Re;function mwi(o){let f=o._frameState,m=o.context,v=m.uniformState,y=o._defaultView;o._view=y,o.updateFrameState(),f.passes.render=!0,f.passes.postProcess=o.postProcessStages.hasSelected,f.tilesetPassState=Ubi;let x=Z(o.backgroundColor,Re.BLACK);o._hdr&&(x=Re.clone(x,pwi),x.red=Math.pow(x.red,o.gamma),x.green=Math.pow(x.green,o.gamma),x.blue=Math.pow(x.blue,o.gamma)),f.backgroundColor=x,o.fog.update(f),v.update(f);let C=o.shadowMap;N(C)&&C.enabled&&(!N(o.light)||o.light instanceof l6?H.negate(v.sunDirectionWC,o._shadowMapCamera.direction):H.clone(o.light.direction,o._shadowMapCamera.direction),f.shadowMaps.push(C));let w=o.textureProjectionMapList;if(w.length>0)for(let S=0;S<w.length;S++){let M=w[S];M.enabled&&f.textureProjectionMaps.push(M)}let A=o.viewShedMapList;for(let S=0;S<A.length;S++){let M=A[S];M.enabled&&f.viewShedMaps.push(M)}o._computeCommandList.length=0,o._overlayCommandList.length=0;let E=y.viewport;E.x=0,E.y=0,E.width=m.drawingBufferWidth,E.height=m.drawingBufferHeight;let T=y.passState;T.framebuffer=void 0,T.blendingEnabled=void 0,T.scissorTest=void 0,T.viewport=Xr.clone(E,T.viewport),N(o.globe)&&o.globe.beginFrame(f),o.updateEnvironment(),o.updateAndExecuteCommands(T,x),o.resolveFramebuffers(T),T.framebuffer=void 0,Kbi(o,T),N(o.globe)&&(o.globe.endFrame(f),o.globe.tilesLoaded||(o._renderRequested=!0)),m.endFrame()}function kF(o,f){try{f(o)}catch(m){if(o._renderError.raiseEvent(o,m),o.rethrowRenderErrors)throw m}}function gwi(o){return o._picking.updateMostDetailedRayPicks(o)}Lu.prototype.render=function(o){this._preUpdate.raiseEvent(this,o);let f=this._frameState;f.newFrame=!1,N(o)||(o=ci.now());let m=this._view.checkForCameraUpdates(this),v=!this.requestRenderMode||this._renderRequested||m||this._logDepthBufferDirty||this._hdrDirty||this.mode===_i.MORPHING;if(!v&&N(this.maximumRenderTimeChange)&&N(this._lastRenderTime)){let y=Math.abs(ci.secondsDifference(this._lastRenderTime,o));v=v||y>this.maximumRenderTimeChange}if(v){this._lastRenderTime=ci.clone(o,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let y=xe.incrementWrap(f.frameNumber,15e6,1);Zit(this,y,o),f.newFrame=!0}kF(this,dwi),this.primitives.show&&(kF(this,gwi),kF(this,_wi),kF(this,vwi),v||kF(this,ywi)),this._postUpdate.raiseEvent(this,o),v&&(this._preRender.raiseEvent(this,o),kF(this,mwi)),hwi(this,v),kF(this,fwi),cwi(this),v&&this._postRender.raiseEvent(this,o)};Lu.prototype.forceRender=function(o){this._renderRequested=!0,this.render(o)};Lu.prototype.requestRender=function(){this._renderRequested=!0};Lu.prototype.clampLineWidth=function(o){return Math.max(Bo.minimumAliasedLineWidth,Math.min(o,Bo.maximumAliasedLineWidth))};Lu.prototype.pick=function(o,f,m){return this._picking.pick(this,o,f,m)};Lu.prototype.UpdateQuad=function(o){for(let f=0,m=this._primitivesQuadTrees.length;f<m;f++){let v=this._primitivesQuadTrees[f]._tilesToRender;if(v)for(let y=0,x=v.length;y<x;y++){let C=v[y];C.data&&C.data.geometryPrimitive&&C.data.geometryPrimitive.update(o)}}};Lu.prototype.pickPositionWorldCoordinates=function(o,f){return this._picking.pickPositionWorldCoordinates(this,o,f)};Lu.prototype.pickPosition=function(o,f){return this._picking.pickPosition(this,o,f)};Lu.prototype.drillPick=function(o,f,m,v){return this._picking.drillPick(this,o,f,m,v)};function _wi(o){let f=o._frameState;hpe.camera=f.camera,hpe.cullingVolume=f.cullingVolume,o.primitives.updateForPass(f,hpe)}function vwi(o){let f=o._frameState;!f.camera.canPreloadFlight()||(dpe.camera=o.preloadFlightCamera,dpe.cullingVolume=o.preloadFlightCullingVolume,o.primitives.updateForPass(f,dpe))}function ywi(o){o.primitives.updateForPass(o._frameState,Gbi)}Lu.prototype.pickFromRay=function(o,f,m){return this._picking.pickFromRay(this,o,f,m)};Lu.prototype.drillPickFromRay=function(o,f,m,v){return this._picking.drillPickFromRay(this,o,f,m,v)};Lu.prototype.pickFromRayMostDetailed=function(o,f,m){return this._picking.pickFromRayMostDetailed(this,o,f,m)};Lu.prototype.drillPickFromRayMostDetailed=function(o,f,m,v){return this._picking.drillPickFromRayMostDetailed(this,o,f,m,v)};Lu.prototype.sampleHeight=function(o,f,m){return this._picking.sampleHeight(this,o,f,m)};Lu.prototype.clampToHeight=function(o,f,m,v){return this._picking.clampToHeight(this,o,f,m,v)};Lu.prototype.sampleHeightMostDetailed=function(o,f,m){return this._picking.sampleHeightMostDetailed(this,o,f,m)};Lu.prototype.clampToHeightMostDetailed=function(o,f,m){return this._picking.clampToHeightMostDetailed(this,o,f,m)};Lu.prototype.cartesianToCanvasCoordinates=function(o,f){return nl.wgs84ToWindowCoordinates(this,o,f)};Lu.prototype.completeMorph=function(){this._transitioner.completeMorph()};Lu.prototype.morphTo2D=function(o){let f,m=this.globe;N(m)?f=m.ellipsoid:f=this.mapProjection.ellipsoid,o=Z(o,2),this._transitioner.morphTo2D(o,f)};Lu.prototype.morphToColumbusView=function(o){let f,m=this.globe;N(m)?f=m.ellipsoid:f=this.mapProjection.ellipsoid,o=Z(o,2),this._transitioner.morphToColumbusView(o,f)};Lu.prototype.morphTo3D=function(o){let f,m=this.globe;N(m)?f=m.ellipsoid:f=this.mapProjection.ellipsoid,o=Z(o,2),this._transitioner.morphTo3D(o,f)};function xwi(o,f){if(o._removeTerrainProviderReadyListener=o._removeTerrainProviderReadyListener&&o._removeTerrainProviderReadyListener(),f.ready){N(o.globe)&&(o.globe.terrainProvider=f.provider);return}o.globe.terrainProvider=void 0,o._removeTerrainProviderReadyListener=f.readyEvent.addEventListener(m=>{N(o)&&N(o.globe)&&(o.globe.terrainProvider=m),o._removeTerrainProviderReadyListener()})}Lu.prototype.setTerrain=function(o){return xwi(this,o),o};Lu.prototype.isDestroyed=function(){return!1};Lu.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),N(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let o=0;o<this._removeGlobeCallbacks.length;++o)this._removeGlobeCallbacks[o]();return this._removeGlobeCallbacks.length=0,kr(this)};Lu.prototype.clickVideoProjection=function(o){if(N(o)){let f=this.textureProjectionMapList,m=f.length;for(let v=0;v<m;v++){let y=f[v];if(N(y._id)&&y._id===o){f[v]=f[m-1],f[m-1]=y;break}}}};var r2e=Lu;function P6(o){o=Z(o,ki.WGS84),this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=o;let f=1.025,m=H.multiplyByScalar(o.radii,f,new H);this._scaleMatrix=Ee.fromScale(m),this._modelMatrix=new Ee,this._command=new Jn({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new H(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new H(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new H;let v=new H;v.x=o.maximumRadius*f,v.y=o.maximumRadius,v.z=0,this._radiiAndDynamicAtmosphereColor=v;let y=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return y._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return y._hueSaturationBrightness.x=y.hueShift,y._hueSaturationBrightness.y=y.saturationShift,y._hueSaturationBrightness.z=y.brightnessShift,y._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return y.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return y.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return y.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return y.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return y.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return y.atmosphereMieAnisotropy}}}Object.defineProperties(P6.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});P6.prototype.setDynamicAtmosphereColor=function(o,f){let m=o?f?2:1:0;this._radiiAndDynamicAtmosphereColor.z=m};var ppe=new Ee;P6.prototype.update=function(o,f){if(!this.show)return;let m=o.mode;if(m!==_i.SCENE3D&&m!==_i.MORPHING||!o.passes.render)return;let v=Ee.fromRotationTranslation(o.context.uniformState.inverseViewRotation,H.ZERO,ppe),y=Ee.multiplyTransformation(v,Df.Y_UP_TO_Z_UP,ppe),x=Ee.multiply(this._scaleMatrix,y,ppe);Ee.clone(x,this._modelMatrix);let C=o.context,w=Cwi(this),A=o.globeTranslucencyState.translucent,E=this.perFragmentAtmosphere||A||!N(f)||!f.show,T=this._command;if(!N(T.vertexArray)){let M=V0.createGeometry(new V0({radii:new H(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:un.POSITION_ONLY}));T.vertexArray=Du.fromGeometry({context:C,geometry:M,attributeLocations:Ju.createAttributeLocations(M),bufferUsage:gn.STATIC_DRAW}),T.renderState=Mn.fromCache({cull:{enabled:!0,face:uh.FRONT},blending:Mu.ALPHA_BLEND,depthMask:!1})}let S=w|E<<2|A<<3;if(S!==this._flags){this._flags=S;let M=[];w&&M.push("COLOR_CORRECT"),E&&M.push("PER_FRAGMENT_ATMOSPHERE"),A&&M.push("GLOBE_TRANSLUCENT");let I=new Zr({defines:M,sources:[OH,Cte,$Ae]}),P=new Zr({defines:M,sources:[OH,Cte,ZAe]});this._spSkyAtmosphere=Rs.fromCache({context:C,vertexShaderSource:I,fragmentShaderSource:P}),T.shaderProgram=this._spSkyAtmosphere}return T};function Cwi(o){return!(xe.equalsEpsilon(o.hueShift,0,xe.EPSILON7)&&xe.equalsEpsilon(o.saturationShift,0,xe.EPSILON7)&&xe.equalsEpsilon(o.brightnessShift,0,xe.EPSILON7))}P6.prototype.isDestroyed=function(){return!1};P6.prototype.destroy=function(){let o=this._command;return o.vertexArray=o.vertexArray&&o.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),kr(this)};var Yq=P6;function Uoe(o){this.sources=o.sources,this._sources=void 0,this.show=Z(o.show,!0),this._command=new Jn({modelMatrix:Ee.clone(Ee.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}Uoe.prototype.update=function(o,f){let m=this;if(!this.show||o.mode!==_i.SCENE3D&&o.mode!==_i.MORPHING||!o.passes.render)return;let v=o.context;if(this._sources!==this.sources){this._sources=this.sources;let x=this.sources;typeof x.positiveX=="string"?FAe(v,this._sources).then(function(C){m._cubeMap=m._cubeMap&&m._cubeMap.destroy(),m._cubeMap=C}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new lT({context:v,source:x}))}let y=this._command;if(!N(y.vertexArray)){y.uniformMap={u_cubeMap:function(){return m._cubeMap}};let x=MM.createGeometry(MM.fromDimensions({dimensions:new H(2,2,2),vertexFormat:un.POSITION_ONLY})),C=this._attributeLocations=Ju.createAttributeLocations(x);y.vertexArray=Du.fromGeometry({context:v,geometry:x,attributeLocations:C,bufferUsage:gn.STATIC_DRAW}),y.renderState=Mn.fromCache({blending:Mu.ALPHA_BLEND})}if(!N(y.shaderProgram)||this._useHdr!==f){let x=new Zr({defines:[f?"HDR":""],sources:[eEe]});y.shaderProgram=Rs.fromCache({context:v,vertexShaderSource:tEe,fragmentShaderSource:x,attributeLocations:this._attributeLocations}),this._useHdr=f}if(N(this._cubeMap))return y};Uoe.prototype.isDestroyed=function(){return!1};Uoe.prototype.destroy=function(){let o=this._command;return o.vertexArray=o.vertexArray&&o.vertexArray.destroy(),o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),kr(this)};var r4=Uoe;function qq(){this.show=!0,this._drawCommand=new Jn({primitiveType:Fn.TRIANGLES,boundingVolume:new Pi,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new Pi,this._boundingVolume2D=new Pi,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let o=this;this._uniformMap={u_texture:function(){return o._texture},u_size:function(){return o._size}}}Object.defineProperties(qq.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(o){o=Math.max(o,0),this._glowFactor=o,this._glowFactorDirty=!0}}});var bwi=new Ye,wwi=new Ye,Awi=new Wt,s7=new Wt;qq.prototype.update=function(o,f,m){if(!this.show)return;let v=o.mode;if(v===_i.SCENE2D||v===_i.MORPHING||!o.passes.render)return;let y=o.context,x=f.viewport.width,C=f.viewport.height;if(!N(this._texture)||x!==this._drawingBufferWidth||C!==this._drawingBufferHeight||this._glowFactorDirty||m!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=x,this._drawingBufferHeight=C,this._glowFactorDirty=!1,this._useHdr=m;let k=Math.max(x,C);k=Math.pow(2,Math.ceil(Math.log(k)/Math.log(2))-2),k=Math.max(1,k);let U=m?y.halfFloatingPointTexture?Rn.HALF_FLOAT:Rn.FLOAT:Rn.UNSIGNED_BYTE;this._texture=new _o({context:y,width:k,height:k,pixelFormat:Nn.RGBA,pixelDatatype:U}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let G=this,j={u_radiusTS:function(){return G._radiusTS}};this._commands.computeCommand=new B5({fragmentShaderSource:rEe,outputTexture:this._texture,uniformMap:j,persists:!1,owner:this,postExecute:function(){G._commands.computeCommand=void 0}})}let w=this._drawCommand;if(!N(w.vertexArray)){let k={direction:0},U=new Uint8Array(4*2);U[0]=0,U[1]=0,U[2]=255,U[3]=0,U[4]=255,U[5]=255,U[6]=0,U[7]=255;let G=Ao.createVertexBuffer({context:y,typedArray:U,usage:gn.STATIC_DRAW}),j=[{index:k.direction,vertexBuffer:G,componentsPerAttribute:2,normalize:!0,componentDatatype:Rt.UNSIGNED_BYTE}],q=Ao.createIndexBuffer({context:y,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:gn.STATIC_DRAW,indexDatatype:ro.UNSIGNED_SHORT});w.vertexArray=new Du({context:y,attributes:j,indexBuffer:q}),w.shaderProgram=Rs.fromCache({context:y,vertexShaderSource:aEe,fragmentShaderSource:iEe,attributeLocations:k}),w.renderState=Mn.fromCache({blending:Mu.ALPHA_BLEND}),w.uniformMap=this._uniformMap}let A=y.uniformState.sunPositionWC,E=y.uniformState.sunPositionColumbusView,T=this._boundingVolume,S=this._boundingVolume2D;H.clone(A,T.center),S.center.x=E.z,S.center.y=E.x,S.center.z=E.y,T.radius=xe.SOLAR_RADIUS+xe.SOLAR_RADIUS*this._glowLengthTS,S.radius=T.radius,v===_i.SCENE3D?Pi.clone(T,w.boundingVolume):v===_i.COLUMBUS_VIEW&&Pi.clone(S,w.boundingVolume);let M=nl.computeActualWgs84Position(o,A,s7),I=H.magnitude(H.subtract(M,o.camera.position,s7)),P=y.uniformState.projection,D=Awi;D.x=0,D.y=0,D.z=-I,D.w=1;let L=Ee.multiplyByVector(P,D,s7),R=nl.clipToGLWindowCoordinates(f.viewport,L,bwi);D.x=xe.SOLAR_RADIUS;let O=Ee.multiplyByVector(P,D,s7),F=nl.clipToGLWindowCoordinates(f.viewport,O,wwi);return this._size=Ye.magnitude(Ye.subtract(F,R,s7)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};qq.prototype.isDestroyed=function(){return!1};qq.prototype.destroy=function(){let o=this._drawCommand;return o.vertexArray=o.vertexArray&&o.vertexArray.destroy(),o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),kr(this)};var n2e=qq;function JV(o){return Ms(`Assets/Textures/SkyBox/skyBox_${o}.jpg`)}function Ewi(o){o._renderLoopRunning=!0;let f=0;function m(v){if(!o.isDestroyed())if(o._useDefaultRenderLoop)try{let y=o._targetFrameRate;if(!N(y))o.resize(),o.render(),requestAnimationFrame(m);else{let x=1e3/y,C=v-f;C>x&&(o.resize(),o.render(),f=v-C%x),requestAnimationFrame(m)}}catch(y){if(o._useDefaultRenderLoop=!1,o._renderLoopRunning=!1,o._showRenderLoopErrors){let x="An error occurred while rendering. Rendering has stopped.";o.showErrorPanel(x,void 0,y)}}else o._renderLoopRunning=!1}requestAnimationFrame(m)}function frt(o){let f=o._useBrowserRecommendedResolution?1:window.devicePixelRatio;return f*=o._resolutionScale,N(o._scene)&&(o._scene.pixelRatio=f),f}function prt(o){let f=o._canvas,m=f.clientWidth,v=f.clientHeight,y=frt(o);o._canvasClientWidth=m,o._canvasClientHeight=v,m*=y,v*=y,f.width=m,f.height=v,o._canRender=m!==0&&v!==0,o._lastDevicePixelRatio=window.devicePixelRatio}function mrt(o){let f=o._canvas,m=f.width,v=f.height;if(m!==0&&v!==0){let y=o._scene.camera.frustum;N(y.aspectRatio)?y.aspectRatio=m/v:(y.top=y.right*(v/m),y.bottom=-y.top)}}function n4(o,f){o=Uh(o),f=Z(f,Z.EMPTY_OBJECT);let m=document.createElement("div");m.className="map-widget",o.appendChild(m);let v=document.createElement("canvas");v.setAttribute("id","mapRenderCanvas");let y=pa.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=y,y&&(v.style.imageRendering=pa.imageRenderingValue()),v.oncontextmenu=function(){return!1},v.onselectstart=function(){return!1};function x(){v!==v.ownerDocument.activeElement&&v.ownerDocument.activeElement.blur()}Z(f.blurActiveElementOnCanvasFocus,!0)&&(v.addEventListener("mousedown",x),v.addEventListener("pointerdown",x)),m.appendChild(v);let C=document.createElement("div");C.className="map-widget-credits";let w=N(f.creditContainer)?Uh(f.creditContainer):m;w.appendChild(C);let A=N(f.creditViewport)?Uh(f.creditViewport):m,E=Z(f.showRenderLoopErrors,!0),T=Z(f.useBrowserRecommendedResolution,!0);this._element=m,this._container=o,this._canvas=v,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=A,this._creditContainer=w,this._innerCreditContainer=C,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=E,this._resolutionScale=1,this._useBrowserRecommendedResolution=T,this._forceResize=!1,this._clock=N(f.clock)?f.clock:new MU,prt(this);try{let S=new r2e({canvas:v,contextOptions:f.contextOptions,creditContainer:C,creditViewport:A,mapProjection:f.mapProjection,orderIndependentTranslucency:f.orderIndependentTranslucency,scene3DOnly:Z(f.scene3DOnly,!1),shadows:f.shadows,mapMode2D:f.mapMode2D,requestRenderMode:f.requestRenderMode,maximumRenderTimeChange:f.maximumRenderTimeChange,depthPlaneEllipsoidOffset:f.depthPlaneEllipsoidOffset,msaaSamples:f.msaaSamples});this._scene=S,S.camera.constrainedAxis=H.UNIT_Z,frt(this),mrt(this);let M=null;f.contextOptions&&(f.contextOptions.ellipsoidCoordinates==="CGCS2000"?M=ki.CGCS2000:f.contextOptions.ellipsoidCoordinates==="MOON"||f.contextOptions.ellipsoidCoordinates==="MOON2000"?M=ki.MOON2000:M=Z(S.mapProjection.ellipsoid,ki.WGS84),Hy.ellipsoidCoordinates=f.contextOptions.ellipsoidCoordinates);let I=f.globe;N(I)||(I=new ITe(M,S)),I!==!1&&(S.globe=I,S.globe.shadows=Z(f.terrainShadows,Cl.RECEIVE_ONLY));let P=f.skyBox;N(P)||(P=new r4({sources:{positiveX:JV("px"),negativeX:JV("mx"),positiveY:JV("py"),negativeY:JV("my"),positiveZ:JV("pz"),negativeZ:JV("mz")}})),P!==!1&&(S.skyBox=P,S.sun=new n2e,S.moon=new OTe);let D=f.skyAtmosphere;N(D)||(D=new Yq(M)),D!==!1&&(S.skyAtmosphere=D),N(f.imageryProvider)&&mi("CesiumWidget options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use options.baseLayer instead.");let L=f.baseLayer;f.globe!==!1&&L!==!1&&f.imageryProvider!==!1&&(N(f.imageryProvider)&&!N(L)&&(L=new x_(f.imageryProvider)),N(L)||(L=x_.fromWorldImagery()),S.imageryLayers.add(L)),N(f.terrainProvider)&&f.globe!==!1&&(S.terrainProvider=f.terrainProvider),N(f.terrain)&&f.globe!==!1&&S.setTerrain(f.terrain),this._screenSpaceEventHandler=new Ur(v),N(f.sceneMode)&&(f.sceneMode===_i.SCENE2D&&this._scene.morphTo2D(0),f.sceneMode===_i.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=Z(f.useDefaultRenderLoop,!0),this._targetFrameRate=void 0,this.targetFrameRate=f.targetFrameRate;let R=this;this._onRenderError=function(O,F){if(R._useDefaultRenderLoop=!1,R._renderLoopRunning=!1,R._showRenderLoopErrors){let k="An error occurred while rendering. Rendering has stopped.";R.showErrorPanel(k,void 0,F)}},S.renderError.addEventListener(this._onRenderError)}catch(S){if(E){let M="Error constructing CesiumWidget.",I='Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:';this.showErrorPanel(M,I,S)}throw S}}Object.defineProperties(n4.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(o){this._scene.terrainProvider=o}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},camera:{get:function(){return this._scene.camera}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(o){this._targetFrameRate=o}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(o){this._useDefaultRenderLoop!==o&&(this._useDefaultRenderLoop=o,o&&!this._renderLoopRunning&&Ewi(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(o){this._resolutionScale!==o&&(this._resolutionScale=o,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(o){this._useBrowserRecommendedResolution!==o&&(this._useBrowserRecommendedResolution=o,this._forceResize=!0)}}});n4.prototype.showErrorPanel=function(o,f,m){let v=this._element,y=document.createElement("div");y.className="map-widget-errorPanel";let x=document.createElement("div");x.className="map-widget-errorPanel-content",y.appendChild(x);let C=document.createElement("div");C.className="map-widget-errorPanel-header",C.appendChild(document.createTextNode(o)),x.appendChild(C);let w=document.createElement("div");w.className="map-widget-errorPanel-scroll",x.appendChild(w);function A(){w.style.maxHeight=`${Math.max(Math.round(v.clientHeight*.9-100),30)}px`}A(),N(window.addEventListener)&&window.addEventListener("resize",A,!1);let E=N(f),T=N(m);if(E||T){let I=document.createElement("div");if(I.className="map-widget-errorPanel-message",w.appendChild(I),T){let P=XH(m);E||(typeof m=="string"&&(m=new Error(m)),f=XH({name:m.name,message:m.message}),P=m.stack),typeof console<"u"&&console.error(`${o} ${f} ${P}`);let D=document.createElement("div");D.className="map-widget-errorPanel-message-details collapsed";let L=document.createElement("span");L.className="map-widget-errorPanel-more-details",L.appendChild(document.createTextNode("See more...")),D.appendChild(L),D.onclick=function(R){D.removeChild(L),D.appendChild(document.createTextNode(P)),D.className="map-widget-errorPanel-message-details",x.className="map-widget-errorPanel-content expanded",D.onclick=void 0},w.appendChild(D)}I.innerHTML=`<p>${f}</p>`}let S=document.createElement("div");S.className="map-widget-errorPanel-buttonPanel",x.appendChild(S);let M=document.createElement("button");M.setAttribute("type","button"),M.className="map-button",M.appendChild(document.createTextNode("OK")),M.onclick=function(){N(A)&&N(window.removeEventListener)&&window.removeEventListener("resize",A,!1),v.removeChild(y)},S.appendChild(M),v.appendChild(y)};n4.prototype.isDestroyed=function(){return!1};n4.prototype.destroy=function(){N(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),kr(this)};n4.prototype.resize=function(){let o=this._canvas;!this._forceResize&&this._canvasClientWidth===o.clientWidth&&this._canvasClientHeight===o.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,prt(this),mrt(this),this._scene.requestRender())};n4.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let o=this._clock.tick();this._scene.render(o)}else this._clock.tick()};var Xq=n4;function I6(o,f){this._tilingScheme=o,this._maximumLevel=f,this._rootNodes=[]}var WF=new Di;function Twi(o,f,m,v){let y=v.length;for(let x=0;x<y;++x){let C=v[x];if(C.x===f&&C.y===m&&C.level===o)return!0}return!1}I6.prototype.addAvailableTileRange=function(o,f,m,v,y){let x=this._tilingScheme,C=this._rootNodes;if(o===0)for(let M=m;M<=y;++M)for(let I=f;I<=v;++I)Twi(o,I,M,C)||C.push(new hz(x,void 0,0,I,M));x.tileXYToRectangle(f,m,o,WF);let w=WF.west,A=WF.north;x.tileXYToRectangle(v,y,o,WF);let E=WF.east,T=WF.south,S=new Dwi(o,w,T,E,A);for(let M=0;M<C.length;++M){let I=C[M];o2e(I.extent,S)&&Lwi(this._maximumLevel,I,S)}};I6.prototype.computeMaximumLevelAtPosition=function(o){let f;for(let m=0;m<this._rootNodes.length;++m){let v=this._rootNodes[m];if(dz(v.extent,o)){f=v;break}}return N(f)?O7(void 0,f,o):-1};var Swi=[],Pwi=[],Iwi=new Di,Mwi=new Di;I6.prototype.computeBestAvailableLevelOverRectangle=function(o){let f=Swi;f.length=0,o.east<o.west?(f.push(Di.fromRadians(-Math.PI,o.south,o.east,o.north,Iwi)),f.push(Di.fromRadians(o.west,o.south,Math.PI,o.north,Mwi))):f.push(o);let m=Pwi;m.length=0;let v;for(v=0;v<this._rootNodes.length;++v)N7(m,this._rootNodes[v],f);for(v=m.length-1;v>=0;--v)if(N(m[v])&&m[v].length===0)return v;return 0};var g6e=new Mt;I6.prototype.isTileAvailable=function(o,f,m){let v=this._tilingScheme.tileXYToRectangle(f,m,o,WF);return Di.center(v,g6e),this.computeMaximumLevelAtPosition(g6e)>=o};I6.prototype.computeChildMaskForTile=function(o,f,m){let v=o+1;if(v>=this._maximumLevel)return 0;let y=0;return y|=this.isTileAvailable(v,2*f,2*m+1)?1:0,y|=this.isTileAvailable(v,2*f+1,2*m+1)?2:0,y|=this.isTileAvailable(v,2*f,2*m)?4:0,y|=this.isTileAvailable(v,2*f+1,2*m)?8:0,y};function hz(o,f,m,v,y){this.tilingScheme=o,this.parent=f,this.level=m,this.x=v,this.y=y,this.extent=o.tileXYToRectangle(v,y,m),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(hz.prototype,{nw:{get:function(){return this._nw||(this._nw=new hz(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new hz(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new hz(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new hz(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Dwi(o,f,m,v,y){this.level=o,this.west=f,this.south=m,this.east=v,this.north=y}function o2e(o,f){let m=Math.max(o.west,f.west),v=Math.max(o.south,f.south),y=Math.min(o.east,f.east),x=Math.min(o.north,f.north);return v<x&&m<y}function Lwi(o,f,m){for(;f.level<o;)if(e$(f.nw.extent,m))f=f.nw;else if(e$(f.ne.extent,m))f=f.ne;else if(e$(f.sw.extent,m))f=f.sw;else if(e$(f.se.extent,m))f=f.se;else break;if(f.rectangles.length===0||f.rectangles[f.rectangles.length-1].level<=m.level)f.rectangles.push(m);else{let v=Wg(f.rectangles,m.level,Rwi);v<0&&(v=~v),f.rectangles.splice(v,0,m)}}function Rwi(o,f){return o.level-f}function e$(o,f){return f.west>=o.west&&f.east<=o.east&&f.south>=o.south&&f.north<=o.north}function dz(o,f){return f.longitude>=o.west&&f.longitude<=o.east&&f.latitude>=o.south&&f.latitude<=o.north}function O7(o,f,m){let v=0,y=!1;for(;!y;){let x=f._nw&&dz(f._nw.extent,m),C=f._ne&&dz(f._ne.extent,m),w=f._sw&&dz(f._sw.extent,m),A=f._se&&dz(f._se.extent,m);if(x+C+w+A>1){x&&(v=Math.max(v,O7(f,f._nw,m))),C&&(v=Math.max(v,O7(f,f._ne,m))),w&&(v=Math.max(v,O7(f,f._sw,m))),A&&(v=Math.max(v,O7(f,f._se,m)));break}else x?f=f._nw:C?f=f._ne:w?f=f._sw:A?f=f._se:y=!0}for(;f!==o;){let x=f.rectangles;for(let C=x.length-1;C>=0&&x[C].level>v;--C){let w=x[C];dz(w,m)&&(v=w.level)}f=f.parent}return v}function N7(o,f,m){if(!f)return;let v,y=!1;for(v=0;v<m.length;++v)y=y||o2e(f.extent,m[v]);if(!y)return;let x=f.rectangles;for(v=0;v<x.length;++v){let C=x[v];o[C.level]||(o[C.level]=m),o[C.level]=Owi(o[C.level],C)}N7(o,f._nw,m),N7(o,f._ne,m),N7(o,f._sw,m),N7(o,f._se,m)}function Owi(o,f){let m=[];for(let v=0;v<o.length;++v){let y=o[v];o2e(y,f)?(y.west<f.west&&m.push(new Di(y.west,y.south,f.west,y.north)),y.east>f.east&&m.push(new Di(f.east,y.south,y.east,y.north)),y.south<f.south&&m.push(new Di(Math.max(f.west,y.west),y.south,Math.min(f.east,y.east),f.south)),y.north>f.north&&m.push(new Di(Math.max(f.west,y.west),f.north,Math.min(f.east,y.east),y.north))):m.push(y)}return m}var m3=I6,Nwi=15;function a2e(o){this.ellipsoid=Z(o.ellipsoid,ki.WGS84),this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}a2e.prototype.build=function(o){o._credit=this.credit,o._tilingScheme=this.tilingScheme,o._height=this.height,o._width=this.width,o._encoding=this.encoding,o._lodCount=this.lodCount,o._hasAvailability=this.hasAvailability,o._tilesAvailable=this.tilesAvailable,o._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,o._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,o._terrainDataStructure=this.terrainDataStructure,o._ready=!0};function Fwi(o,f){let m=f.copyrightText;N(m)&&(o.credit=new Cs(m));let v=f.spatialReference,y=Z(v.latestWkid,v.wkid),x=f.extent,C={ellipsoid:o.ellipsoid};if(y===4326||y===4490)C.rectangle=Di.fromDegrees(x.xmin,x.ymin,x.xmax,x.ymax),o.tilingScheme=new Bd(C),o.tilingScheme.bounds=[x.xmin,x.ymin,x.xmax,x.ymax];else if(y===3857){let A=Math.PI*o.ellipsoid.maximumRadius;f.extent.xmax>A&&(f.extent.xmax=A),f.extent.ymax>A&&(f.extent.ymax=A),f.extent.xmin<-A&&(f.extent.xmin=-A),f.extent.ymin<-A&&(f.extent.ymin=-A),C.rectangleSouthwestInMeters=new Ye(x.xmin,x.ymin),C.rectangleNortheastInMeters=new Ye(x.xmax,x.ymax),o.tilingScheme=new Mm(C),o.tilingScheme.bounds=[x.xmin,x.ymin,x.xmax,x.ymax]}else throw new sr("Invalid spatial reference");let w=f.tileInfo;if(!N(w))throw new sr("tileInfo is required");o.width=w.rows+1,o.height=w.cols+1,o.encoding=w.format==="LERC"?U3.LERC:U3.NONE,o.lodCount=w.lods.length-1,(o.hasAvailability=f.capabilities.indexOf("Tilemap")!==-1)&&(o.tilesAvailable=new m3(o.tilingScheme,o.lodCount),o.tilesAvailable.addAvailableTileRange(0,0,0,o.tilingScheme.getNumberOfXTilesAtLevel(0),o.tilingScheme.getNumberOfYTilesAtLevel(0)),o.tilesAvailabilityLoaded=new m3(o.tilingScheme,o.lodCount)),o.levelZeroMaximumGeometricError=Rv.getEstimatedLevelZeroGeometricErrorForAHeightmap(o.tilingScheme.ellipsoid,o.width,o.tilingScheme.getNumberOfXTilesAtLevel(0)),f.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),N(f.minValues)&&N(f.maxValues)?o.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:f.minValues[0],highestEncodedHeight:f.maxValues[0]}:o.terrainDataStructure={elementMultiplier:1}}async function grt(o,f,m){try{let v=await f.fetchJson();Fwi(o,v)}catch(v){let y=`An error occurred while accessing ${f}.`;throw ld.reportError(void 0,m,N(m)?m._errorEvent:void 0,y),v}}function G3(o){o=Z(o,Z.EMPTY_OBJECT),this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0;let f=o.token;if(this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._ready=!1,this._errorEvent=new Br,N(o.url)){mi("ArcGISTiledElevationTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead.");let m=this,v=new a2e(o);this._readyPromise=Promise.resolve(o.url).then(async function(y){let x=Jr.createIfNeeded(y);x.appendForwardSlash(),N(f)&&(x=x.getDerivedResource({queryParameters:{token:f}})),m._resource=x;let C=x.getDerivedResource({queryParameters:{f:"pjson"}});return await grt(v,C,m),v.build(m),!0})}}Object.defineProperties(G3.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return mi("ArcGISTiledElevationTerrainProvider.ready","ArcGISTiledElevationTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return mi("ArcGISTiledElevationTerrainProvider.readyPromise","ArcGISTiledElevationTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ArcGISTiledElevationTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});G3.fromUrl=async function(o,f){f=Z(f,Z.EMPTY_OBJECT),o=await Promise.resolve(o);let m=Jr.createIfNeeded(o);m.appendForwardSlash(),N(f.token)&&(m=m.getDerivedResource({queryParameters:{token:f.token}}));let v=m.getDerivedResource({queryParameters:{f:"pjson"}}),y=new a2e(f);await grt(y,v);let x=new G3(f);return y.build(x),x._resource=m,x};G3.prototype.requestTileGeometry=function(o,f,m,v){let y=this._resource.getDerivedResource({url:`tile/${m}/${f}/${o}`,request:v}),x=this._hasAvailability,C=Promise.resolve(!0),w;if(x&&!N(s2e(this,m+1,o*2,f*2))){let S=_rt(this,m+1,o*2,f*2);C=S.promise,w=S.request}let A=y.fetchArrayBuffer();if(!N(A)||!N(C))return;let E=this,T=this._tilesAvailable;return Promise.all([A,C]).then(function(S){return new wT({buffer:S[0],width:E._width,height:E._height,childTileMask:x?T.computeChildMaskForTile(m,o,f):Nwi,structure:E._terrainDataStructure,encoding:E._encoding})}).catch(function(S){return N(w)&&w.state===bc.CANCELLED?(v.cancel(),v.deferred.promise.finally(function(){return v.state=bc.CANCELLED,Promise.reject(S)})):Promise.reject(S)})};function s2e(o,f,m,v){if(!o._hasAvailability)return;let y=o._tilesAvailabilityLoaded,x=o._tilesAvailable;if(f>o._lodCount)return!1;if(x.isTileAvailable(f,m,v))return!0;if(y.isTileAvailable(f,m,v))return!1}G3.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)};G3.prototype.getTileDataAvailable=function(o,f,m){if(!this._hasAvailability)return;let v=s2e(this,m,o,f);if(N(v))return v;_rt(this,m,o,f)};G3.prototype.loadTileDataAvailability=function(o,f,m){};function Bwi(o,f,m,v){let y=f-1,x=m-1,C=v[o.y*f+o.x],w=[],A={startX:o.x,startY:o.y,endX:0,endY:0},E=new Ye(o.x+1,o.y+1),T=!1,S=!1;for(;!(T&&S);){let M=E.x,I=S?E.y+1:E.y;if(!T){for(let P=o.y;P<I;++P)if(v[P*f+E.x]!==C){T=!0;break}T?(w.push(new Ye(E.x,o.y)),--E.x,--M,A.endX=E.x):E.x===y?(A.endX=E.x,T=!0):++E.x}if(!S){let P=E.y*f;for(let D=o.x;D<=M;++D)if(v[P+D]!==C){S=!0;break}S?(w.push(new Ye(o.x,E.y)),--E.y,A.endY=E.y):E.y===x?(A.endY=E.y,S=!0):++E.y}}return{endingIndices:w,range:A,value:C}}function kwi(o,f,m,v,y){let x=[];if(y.every(function(w){return w===y[0]}))return y[0]===1&&x.push({startX:o,startY:f,endX:o+m-1,endY:f+v-1}),x;let C=[new Ye(0,0)];for(;C.length>0;){let w=C.pop(),A=Bwi(w,m,v,y);if(A.value===1){let T=A.range;T.startX+=o,T.endX+=o,T.startY+=f,T.endY+=f,x.push(T)}let E=A.endingIndices;E.length>0&&(C=C.concat(E))}return x}function _rt(o,f,m,v){if(!o._hasAvailability)return{};let y=Math.floor(m/128)*128,x=Math.floor(v/128)*128,C=Math.min(1<<f,128),w=`tilemap/${f}/${x}/${y}/${C}/${C}`,A=o._availableCache;if(N(A[w]))return A[w];let E=new cg({throttle:!1,throttleByServer:!0,type:Qy.TERRAIN}),T=o._resource.getDerivedResource({url:w,request:E}).fetchJson();return N(T)?(T=T.then(function(S){let M=kwi(y,x,C,C,S.data);o._tilesAvailabilityLoaded.addAvailableTileRange(f,y,x,y+C,x+C);let I=o._tilesAvailable;for(let P=0;P<M.length;++P){let D=M[P];I.addAvailableTileRange(f,D.startX,D.startY,D.endX,D.endY)}return s2e(o,f,m,v)}),A[w]={promise:T,request:E},T=T.finally(function(S){return delete A[w],S}),{promise:T,request:E}):{}}var Goe=G3,vrt="https://dev.virtualearth.net/REST/v1/Locations";function l2e(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.key;this._key=f;let m={key:f};N(o.culture)&&(m.culture=o.culture),this._resource=new Jr({url:vrt,queryParameters:m}),this._credit=new Cs('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(l2e.prototype,{url:{get:function(){return vrt}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});l2e.prototype.geocode=async function(o){return this._resource.getDerivedResource({queryParameters:{query:o}}).fetchJsonp("jsonp").then(function(f){return f.resourceSets.length===0?[]:f.resourceSets[0].resources.map(function(m){let v=m.bbox,y=v[0],x=v[1],C=v[2],w=v[3];return{displayName:m.name,destination:Di.fromDegrees(x,y,w,C)}})})};var yrt=l2e;function u2e(){}Object.defineProperties(u2e.prototype,{credit:{get:function(){}}});u2e.prototype.geocode=function(o){let f=o.match(/[^\s,\n]+/g);if(f.length===2||f.length===3){let m=+f[0],v=+f[1],y=f.length===3?+f[2]:300;if(isNaN(m)&&isNaN(v)){let x=/^(\d+.?\d*)([nsew])/i;for(let C=0;C<f.length;++C){let w=f[C].match(x);x.test(f[C])&&w.length===3&&(/^[ns]/i.test(w[2])?v=/^[n]/i.test(w[2])?+w[1]:-w[1]:/^[ew]/i.test(w[2])&&(m=/^[e]/i.test(w[2])?+w[1]:-w[1]))}}if(!isNaN(m)&&!isNaN(v)&&!isNaN(y)){let x={displayName:o,destination:H.fromDegrees(m,v,y)};return Promise.resolve([x])}}return Promise.resolve([])};var c2e=u2e,Vwi=new Wt,_6e=new H,KV=new H;function zwi(o){let f=o.points,m=o.times;if(f.length<3){let v=m[0],y=1/(m[1]-v),x=f[0],C=f[1];return function(w,A){N(A)||(A=new H);let E=(w-v)*y;return H.lerp(x,C,E,A)}}return function(v,y){N(y)||(y=new H);let x=o._lastTimeIndex=o.findTimeInterval(v,o._lastTimeIndex),C=(v-m[x])/(m[x+1]-m[x]),w=Vwi;w.z=C,w.y=C*C,w.x=w.y*C,w.w=1;let A,E,T,S,M;return x===0?(A=f[0],E=f[1],T=o.firstTangent,S=H.subtract(f[2],A,_6e),H.multiplyByScalar(S,.5,S),M=Ee.multiplyByVector(aj.hermiteCoefficientMatrix,w,w)):x===f.length-2?(A=f[x],E=f[x+1],S=o.lastTangent,T=H.subtract(E,f[x-1],_6e),H.multiplyByScalar(T,.5,T),M=Ee.multiplyByVector(aj.hermiteCoefficientMatrix,w,w)):(A=f[x-1],E=f[x],T=f[x+1],S=f[x+2],M=Ee.multiplyByVector(EO.catmullRomCoefficientMatrix,w,w)),y=H.multiplyByScalar(A,M.x,y),H.multiplyByScalar(E,M.y,KV),H.add(y,KV,y),H.multiplyByScalar(T,M.z,KV),H.add(y,KV,y),H.multiplyByScalar(S,M.w,KV),H.add(y,KV,y)}}var Hwi=new H,Uwi=new H;function EO(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.points,m=o.times,v=o.firstTangent,y=o.lastTangent;if(f.length>2&&(N(v)||(v=Hwi,H.multiplyByScalar(f[1],2,v),H.subtract(v,f[2],v),H.subtract(v,f[0],v),H.multiplyByScalar(v,.5,v)),!N(y))){let x=f.length-1;y=Uwi,H.multiplyByScalar(f[x-1],2,y),H.subtract(f[x],y,y),H.add(y,f[x-2],y),H.multiplyByScalar(y,.5,y)}this._times=m,this._points=f,this._firstTangent=H.clone(v),this._lastTangent=H.clone(y),this._evaluateFunction=zwi(this),this._lastTimeIndex=0}Object.defineProperties(EO.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});EO.catmullRomCoefficientMatrix=new Ee(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);EO.prototype.findTimeInterval=gd.prototype.findTimeInterval;EO.prototype.wrapTime=gd.prototype.wrapTime;EO.prototype.clampTime=gd.prototype.clampTime;EO.prototype.evaluate=function(o,f){return this._evaluateFunction(o,f)};var xrt=EO,Gwi=new Wt,$8i=new H,QV=new H;function Wwi(o){let f=o.points,m=o.times;if(f.length<3){let v=m[0],y=1/(m[1]-v),x=f[0],C=f[1];return function(w,A){N(A)||(A=new H);let E=(w-v)*y;return H.lerp(x,C,E,A)}}return function(v,y){N(y)||(y=new H);let x=o._lastTimeIndex=o.findTimeInterval(v,o._lastTimeIndex),C=(v-m[x])/(m[x+1]-m[x]),w=Gwi;w.z=C,w.y=C*C,w.x=w.y*C,w.w=1;let A,E,T,S,M;return x===0?(A=o.firstTangent,E=f[0],T=f[1],S=f[2],M=Ee.multiplyByVector(g2.catmullRomCoefficientMatrix,w,w)):x===f.length-2?(A=f[x-1],E=f[x],E=f[x+1],S=o.lastTangent,M=Ee.multiplyByVector(g2.catmullRomCoefficientMatrix,w,w)):(A=f[x-1],E=f[x],T=f[x+1],S=f[x+2],M=Ee.multiplyByVector(g2.catmullRomCoefficientMatrix,w,w)),y=H.multiplyByScalar(A,M.x,y),H.multiplyByScalar(E,M.y,QV),H.add(y,QV,y),H.multiplyByScalar(T,M.z,QV),H.add(y,QV,y),H.multiplyByScalar(S,M.w,QV),H.add(y,QV,y)}}var jwi=new H,Ywi=new H;function g2(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.points,m=o.times,v=o.firstTangent,y=o.lastTangent;if(f.length>2&&(N(v)||(v=jwi,H.multiplyByScalar(f[1],2,v),H.subtract(v,f[2],v),H.subtract(v,f[0],v),H.multiplyByScalar(v,.5,v)),!N(y))){let x=f.length-1;y=Ywi,H.multiplyByScalar(f[x-1],2,y),H.subtract(f[x],y,y),H.add(y,f[x-2],y),H.multiplyByScalar(y,.5,y)}this._times=m,this._points=f,this._firstTangent=H.clone(v),this._lastTangent=H.clone(y),this._evaluateFunction=Wwi(this),this._lastTimeIndex=0}Object.defineProperties(g2.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});g2.catmullRomCoefficientMatrix=new Ee(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);g2.prototype.findTimeInterval=gd.prototype.findTimeInterval;g2.prototype.wrapTime=gd.prototype.wrapTime;g2.prototype.clampTime=gd.prototype.clampTime;g2.prototype.evaluate=function(o,f){return this._evaluateFunction(o,f)};var Crt=g2,Woe={};Woe.clipTriangleAtAxisAlignedThreshold=function(o,f,m,v,y,x){N(x)?x.length=0:x=[];let C,w,A;f?(C=m<o,w=v<o,A=y<o):(C=m>o,w=v>o,A=y>o);let E=C+w+A,T,S,M,I,P,D;return E===1?C?(T=(o-m)/(v-m),S=(o-m)/(y-m),x.push(1),x.push(2),S!==1&&(x.push(-1),x.push(0),x.push(2),x.push(S)),T!==1&&(x.push(-1),x.push(0),x.push(1),x.push(T))):w?(M=(o-v)/(y-v),I=(o-v)/(m-v),x.push(2),x.push(0),I!==1&&(x.push(-1),x.push(1),x.push(0),x.push(I)),M!==1&&(x.push(-1),x.push(1),x.push(2),x.push(M))):A&&(P=(o-y)/(m-y),D=(o-y)/(v-y),x.push(0),x.push(1),D!==1&&(x.push(-1),x.push(2),x.push(1),x.push(D)),P!==1&&(x.push(-1),x.push(2),x.push(0),x.push(P))):E===2?!C&&m!==o?(I=(o-v)/(m-v),P=(o-y)/(m-y),x.push(0),x.push(-1),x.push(1),x.push(0),x.push(I),x.push(-1),x.push(2),x.push(0),x.push(P)):!w&&v!==o?(D=(o-y)/(v-y),T=(o-m)/(v-m),x.push(1),x.push(-1),x.push(2),x.push(1),x.push(D),x.push(-1),x.push(0),x.push(1),x.push(T)):!A&&y!==o&&(S=(o-m)/(y-m),M=(o-v)/(y-v),x.push(2),x.push(-1),x.push(0),x.push(2),x.push(S),x.push(-1),x.push(1),x.push(2),x.push(M)):E!==3&&(x.push(0),x.push(1),x.push(2)),x};Woe.computeBarycentricCoordinates=function(o,f,m,v,y,x,C,w,A){let E=m-C,T=C-y,S=x-w,M=v-w,I=1/(S*E+T*M),P=f-w,D=o-C,L=(S*D+T*P)*I,R=(-M*D+E*P)*I,O=1-L-R;return N(A)?(A.x=L,A.y=R,A.z=O,A):new H(L,R,O)};Woe.computeLineSegmentLineSegmentIntersection=function(o,f,m,v,y,x,C,w,A){let E=(C-y)*(f-x)-(w-x)*(o-y),T=(m-o)*(f-x)-(v-f)*(o-y),S=(w-x)*(m-o)-(C-y)*(v-f);if(S===0)return;let M=E/S,I=T/S;if(M>=0&&M<=1&&I>=0&&I<=1)return N(A)||(A=new Ye),A.x=o+M*(m-o),A.y=f+M*(v-f),A};var M6=Woe;function W3(o){this._flattenPolygonHeight=o.flattenPolygonHeight||[1],this._flattenPolygon=o.flattenPolygon||[],this._flattenRectangle=o.flattenRectangle,this._quantizedVertices=o.quantizedVertices,this._encodedNormals=o.encodedNormals,this._indices=o.indices,this._minimumHeight=o.minimumHeight,this._maximumHeight=o.maximumHeight,this._boundingSphere=o.boundingSphere,this._orientedBoundingBox=o.orientedBoundingBox,this._horizonOcclusionPoint=o.horizonOcclusionPoint,this._credits=o.credits;let f=this._quantizedVertices.length/3,m=this._uValues=this._quantizedVertices.subarray(0,f),v=this._vValues=this._quantizedVertices.subarray(f,2*f);this._heightValues=this._quantizedVertices.subarray(2*f,3*f);function y(C,w){return v[C]-v[w]}function x(C,w){return m[C]-m[w]}this._westIndices=i$(o.westIndices,y,f),this._southIndices=i$(o.southIndices,x,f),this._eastIndices=i$(o.eastIndices,y,f),this._northIndices=i$(o.northIndices,x,f),this._westSkirtHeight=o.westSkirtHeight,this._southSkirtHeight=o.southSkirtHeight,this._eastSkirtHeight=o.eastSkirtHeight,this._northSkirtHeight=o.northSkirtHeight,this._childTileMask=Z(o.childTileMask,15),this._createdByUpsampling=Z(o.createdByUpsampling,!1),this._waterMask=o.waterMask,this._mesh=void 0}Object.defineProperties(W3.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return N(this._mesh)}}});var t$=[];function i$(o,f,m){t$.length=o.length;let v=!1;for(let y=0,x=o.length;y<x;++y)t$[y]=o[y],v=v||y>0&&f(o[y-1],o[y])>0;return v?(t$.sort(f),ro.createTypedArray(m,t$)):o}var brt="createVerticesFromQuantizedTerrainMesh",qwi=new tp(brt),Xwi=new tp(brt,WB.maximumAsynchronousTasks);W3.prototype.createMesh=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.tilingScheme,m=o.x,v=o.y,y=o.level,x=Z(o.exaggeration,1),C=Z(o.exaggerationRelativeHeight,0),w=Z(o.throttle,!0),A=f.ellipsoid,E=f.tileXYToRectangle(m,v,y),T=(w?Xwi:qwi).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:E,relativeToCenter:this._boundingSphere.center,ellipsoid:A,exaggeration:x,exaggerationRelativeHeight:C,flattenPolygonHeight:this._flattenPolygonHeight,flattenPolygon:this._flattenPolygon});if(!N(T))return;let S=this;return Promise.resolve(T).then(function(M){let I=S._quantizedVertices.length/3,P=I+S._westIndices.length+S._southIndices.length+S._eastIndices.length+S._northIndices.length,D=ro.createTypedArray(P,M.indices),L=new Float32Array(M.vertices),R=M.center,O=M.minimumHeight,F=M.maximumHeight,k=S._boundingSphere,U=S._orientedBoundingBox,G=Z(H.clone(M.occludeePointInScaledSpace),S._horizonOcclusionPoint),j=M.vertexStride,q=Hw.clone(M.encoding);return S._mesh=new jB(R,L,D,M.indexCountWithoutSkirts,I,O,F,k,G,j,U,q,M.westIndicesSouthToNorth,M.southIndicesEastToWest,M.eastIndicesNorthToSouth,M.northIndicesWestToEast),S._quantizedVertices=void 0,S._encodedNormals=void 0,S._indices=void 0,S._uValues=void 0,S._vValues=void 0,S._heightValues=void 0,S._westIndices=void 0,S._southIndices=void 0,S._eastIndices=void 0,S._northIndices=void 0,S._mesh})};var Jwi=new tp("upsampleQuantizedTerrainMesh",WB.maximumAsynchronousTasks);W3.prototype.upsample=function(o,f,m,v,y,x,C){let w=this._mesh;if(!N(this._mesh))return;let A=f*2!==y,E=m*2===x,T=o.ellipsoid,S=o.tileXYToRectangle(y,x,C),M=Jwi.scheduleTask({vertices:w.vertices,vertexCountWithoutSkirts:w.vertexCountWithoutSkirts,indices:w.indices,indexCountWithoutSkirts:w.indexCountWithoutSkirts,encoding:w.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:A,isNorthChild:E,childRectangle:S,ellipsoid:T});if(!N(M))return;let I=Math.min(this._westSkirtHeight,this._eastSkirtHeight);I=Math.min(I,this._southSkirtHeight),I=Math.min(I,this._northSkirtHeight);let P=A?I*.5:this._westSkirtHeight,D=E?I*.5:this._southSkirtHeight,L=A?this._eastSkirtHeight:I*.5,R=E?this._northSkirtHeight:I*.5,O=this._credits,F=this;return Promise.resolve(M).then(function(k){let U=new Uint16Array(k.vertices),G=ro.createTypedArray(U.length/3,k.indices),j;return N(k.encodedNormals)&&(j=new Uint8Array(k.encodedNormals)),new W3({quantizedVertices:U,indices:G,encodedNormals:j,minimumHeight:k.minimumHeight,maximumHeight:k.maximumHeight,boundingSphere:Pi.clone(k.boundingSphere),orientedBoundingBox:fc.clone(k.orientedBoundingBox),horizonOcclusionPoint:H.clone(k.horizonOcclusionPoint),westIndices:k.westIndices,southIndices:k.southIndices,eastIndices:k.eastIndices,northIndices:k.northIndices,westSkirtHeight:P,southSkirtHeight:D,eastSkirtHeight:L,northSkirtHeight:R,childTileMask:0,credits:O,createdByUpsampling:!0,flattenPolygonHeight:F._flattenPolygonHeight,flattenPolygon:F._flattenPolygon,flattenRectangle:F._flattenRectangle})})};var Qge=32767,wrt=new H;W3.prototype.interpolateHeight=function(o,f,m){let v=xe.clamp((f-o.west)/o.width,0,1);v*=Qge;let y=xe.clamp((m-o.south)/o.height,0,1);return y*=Qge,N(this._mesh)?$wi(this,v,y):eAi(this,v,y)};function Art(o,f,m,v,y,x,C,w){let A=Math.min(m,y,C),E=Math.max(m,y,C),T=Math.min(v,x,w),S=Math.max(v,x,w);return o>=A&&o<=E&&f>=T&&f<=S}var Kwi=new Ye,Qwi=new Ye,Zwi=new Ye;function $wi(o,f,m){let v=o._mesh,y=v.vertices,x=v.encoding,C=v.indices;for(let w=0,A=C.length;w<A;w+=3){let E=C[w],T=C[w+1],S=C[w+2],M=x.decodeTextureCoordinates(y,E,Kwi),I=x.decodeTextureCoordinates(y,T,Qwi),P=x.decodeTextureCoordinates(y,S,Zwi);if(Art(f,m,M.x,M.y,I.x,I.y,P.x,P.y)){let D=M6.computeBarycentricCoordinates(f,m,M.x,M.y,I.x,I.y,P.x,P.y,wrt);if(D.x>=-1e-15&&D.y>=-1e-15&&D.z>=-1e-15){let L=x.decodeHeight(y,E),R=x.decodeHeight(y,T),O=x.decodeHeight(y,S);return D.x*L+D.y*R+D.z*O}}}}function eAi(o,f,m){let v=o._uValues,y=o._vValues,x=o._heightValues,C=o._indices;for(let w=0,A=C.length;w<A;w+=3){let E=C[w],T=C[w+1],S=C[w+2],M=v[E],I=v[T],P=v[S],D=y[E],L=y[T],R=y[S];if(Art(f,m,M,D,I,L,P,R)){let O=M6.computeBarycentricCoordinates(f,m,M,D,I,L,P,R,wrt);if(O.x>=-1e-15&&O.y>=-1e-15&&O.z>=-1e-15){let F=O.x*x[E]+O.y*x[T]+O.z*x[S];return xe.lerp(o._minimumHeight,o._maximumHeight,F/Qge)}}}}W3.prototype.isChildAvailable=function(o,f,m,v){let y=2;return m!==o*2&&++y,v!==f*2&&(y-=2),(this._childTileMask&1<<y)!==0};W3.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var joe=W3;function tAi(o){this.resource=o.resource,this.version=o.version,this.isHeightmap=o.isHeightmap,this.tileUrlTemplates=o.tileUrlTemplates,this.availability=o.availability,this.hasVertexNormals=o.hasVertexNormals,this.hasWaterMask=o.hasWaterMask,this.hasMetadata=o.hasMetadata,this.availabilityLevels=o.availabilityLevels,this.availabilityTilesLoaded=o.availabilityTilesLoaded,this.littleEndianExtensionSize=o.littleEndianExtensionSize,this.availabilityPromiseCache={}}function h2e(o){this.requestVertexNormals=Z(o.requestVertexNormals,!1),this.requestWaterMask=Z(o.requestWaterMask,!1),this.requestMetadata=Z(o.requestMetadata,!0),this.ellipsoid=o.ellipsoid,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this._flattenPolygonHeight=o.flattenPolygonHeight,this._flattenPolygon=o.flattenPolygon,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}h2e.prototype.build=function(o){o._heightmapWidth=this.heightmapWidth,o._scheme=this.scheme;let f=N(this.lastResource.credits)?this.lastResource.credits:[];o._tileCredits=f.concat(this.tileCredits),o._availability=this.availability,o._tilingScheme=this.tilingScheme,o._requestWaterMask=this.requestWaterMask,o._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,o._heightmapStructure=this.heightmapStructure,o._layers=this.layers,o._hasWaterMask=this.hasWaterMask,o._hasVertexNormals=this.hasVertexNormals,o._hasMetadata=this.hasMetadata,o._ready=!0};async function Ert(o,f,m){if(!f.format){let D="The tile format is not specified in the layer.json file.";throw o.previousError=ld.reportError(o.previousError,m,N(m)?m._errorEvent:void 0,D),new sr(D)}if(!f.tiles||f.tiles.length===0){let D="The layer.json file does not specify any tile URL templates.";throw o.previousError=ld.reportError(o.previousError,m,N(m)?m._errorEvent:void 0,D),new sr(D)}let v=!1,y=!1,x=!1,C=!0,w=!1;if(f.format==="heightmap-1.0")w=!0,N(o.heightmapStructure)||(o.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),y=!0,o.requestWaterMask=!0;else if(f.format.indexOf("quantized-mesh-1.")!==0){let D=`The tile format "${f.format}" is invalid or not supported.`;throw o.previousError=ld.reportError(o.previousError,m,N(m)?m._errorEvent:void 0,D),new sr(D)}let A=f.tiles,E=f.maxzoom;if(o.overallMaxZoom=Math.max(o.overallMaxZoom,E),!f.projection||f.projection==="EPSG:4326")o.tilingScheme=new Bd({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:o.ellipsoid}),o.tilingScheme.bounds=f.bounds;else if(f.projection==="EPSG:3857")o.tilingScheme=new Mm({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:o.ellipsoid}),o.tilingScheme.bounds=f.bounds;else{let D=`The projection "${f.projection}" is invalid or not supported.`;throw o.previousError=ld.reportError(o.previousError,m,N(m)?m._errorEvent:void 0,D),new sr(D)}if(o.levelZeroMaximumGeometricError=Rv.getEstimatedLevelZeroGeometricErrorForAHeightmap(o.tilingScheme.ellipsoid,o.heightmapWidth,o.tilingScheme.getNumberOfXTilesAtLevel(0)),!f.scheme||f.scheme==="tms"||f.scheme==="slippyMap")o.scheme=f.scheme;else{let D=`The scheme "${f.scheme}" is invalid or not supported.`;throw o.previousError=ld.reportError(o.previousError,m,N(m)?m._errorEvent:void 0,D),new sr(D)}let T;N(f.extensions)&&f.extensions.indexOf("octvertexnormals")!==-1?v=!0:N(f.extensions)&&f.extensions.indexOf("vertexnormals")!==-1&&(v=!0,C=!1),N(f.extensions)&&f.extensions.indexOf("watermask")!==-1&&(y=!0),N(f.extensions)&&f.extensions.indexOf("metadata")!==-1&&(x=!0);let S=f.metadataAvailability,M=f.available,I;if(N(M)&&!N(S)){I=new m3(o.tilingScheme,M.length);for(let D=0;D<M.length;++D){let L=M[D],R=o.tilingScheme.getNumberOfYTilesAtLevel(D);N(o.overallAvailability[D])||(o.overallAvailability[D]=[]);for(let O=0;O<L.length;++O){let F=L[O],k=R-F.endY-1,U=R-F.startY-1;o.overallAvailability[D].push([F.startX,k,F.endX,U]),I.addAvailableTileRange(D,F.startX,k,F.endX,U)}}}else N(S)&&(T=new m3(o.tilingScheme,E),I=new m3(o.tilingScheme,E),o.overallAvailability[0]=[[0,0,1,0]],I.addAvailableTileRange(0,0,0,1,0));o.hasWaterMask=o.hasWaterMask||y,o.hasVertexNormals=o.hasVertexNormals||v,o.hasMetadata=o.hasMetadata||x,N(f.attribution)&&(o.attribution.length>0&&(o.attribution+=" "),o.attribution+=f.attribution),o.layers.push(new tAi({resource:o.lastResource,version:f.version,isHeightmap:w,tileUrlTemplates:A,availability:I,hasVertexNormals:v,hasWaterMask:y,hasMetadata:x,availabilityLevels:S,availabilityTilesLoaded:T,littleEndianExtensionSize:C}));let P=f.parentUrl;return N(P)?N(I)?(o.lastResource=o.lastResource.getDerivedResource({url:P}),o.lastResource.appendForwardSlash(),o.layerJsonResource=o.lastResource.getDerivedResource({url:"layer.json"}),await Yoe(o),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function iAi(o,f,m){let v=`An error occurred while accessing ${o.layerJsonResource.url}.`;if(N(f)&&(v+=` ${f.message}`),o.previousError=ld.reportError(o.previousError,m,N(m)?m._errorEvent:void 0,v),o.previousError.retry)return Yoe(o,m);throw new sr(v)}async function rAi(o,f,m){await Ert(o,f,m);let v=o.overallAvailability.length;if(v>0){let y=o.availability=new m3(o.tilingScheme,o.overallMaxZoom);for(let x=0;x<v;++x){let C=o.overallAvailability[x];for(let w=0;w<C.length;++w){let A=C[w];y.addAvailableTileRange(x,A[0],A[1],A[2],A[3])}}}if(o.attribution.length>0){let y=new Cs(o.attribution);o.tileCredits.push(y)}return!0}async function Yoe(o,f){try{let m=await o.layerJsonResource.fetchJson();return rAi(o,m,f)}catch(m){return N(m)&&m.statusCode===404?(await Ert(o,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},f),!0):iAi(o,m,f)}}function ib(o){o=Z(o,Z.EMPTY_OBJECT),this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=o.ellipsoid,this._requestVertexNormals=Z(o.requestVertexNormals,!1),this._requestWaterMask=Z(o.requestWaterMask,!1),this._requestMetadata=Z(o.requestMetadata,!0),this._errorEvent=new Br;let f=o.credit;typeof f=="string"&&(f=new Cs(f)),this._credit=f,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._ready=!1,this._tileCredits=void 0,this._readyPromise=Promise.resolve(!0),N(o.url)&&(mi("CesiumTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise=ib._initializeReadyPromise(o,this))}ib._initializeReadyPromise=async function(o,f){let m=await Promise.resolve(o.url),v=new h2e(o),y=Jr.createIfNeeded(m);return y.appendForwardSlash(),v.lastResource=y,v.layerJsonResource=v.lastResource.getDerivedResource({url:"layer.json"}),await Yoe(v,f),v.build(f),!0};var mpe={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function v6e(o){return!N(o)||o.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${o.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function nAi(o,f,m,v,y){let x=new Uint16Array(f,0,o._heightmapWidth*o._heightmapWidth);return new wT({buffer:x,childTileMask:new Uint8Array(f,x.byteLength,1)[0],waterMask:new Uint8Array(f,x.byteLength+1,f.byteLength-x.byteLength-1),width:o._heightmapWidth,height:o._heightmapWidth,structure:o._heightmapStructure,credits:o._tileCredits,flattenPolygonHeight:o._flattenPolygonHeight,flattenPolygon:o._flattenPolygon})}function oAi(o,f,m,v,y,x){let C=x.littleEndianExtensionSize,w=0,A=3,E=A+1,T=Float64Array.BYTES_PER_ELEMENT*A,S=Float64Array.BYTES_PER_ELEMENT*E,M=3,I=Uint16Array.BYTES_PER_ELEMENT*M,P=3,D=Uint16Array.BYTES_PER_ELEMENT,L=D*P,R=new DataView(f),O=new H(R.getFloat64(w,!0),R.getFloat64(w+8,!0),R.getFloat64(w+16,!0));w+=T;let F=R.getFloat32(w,!0);w+=Float32Array.BYTES_PER_ELEMENT;let k=R.getFloat32(w,!0);w+=Float32Array.BYTES_PER_ELEMENT;let U=new Pi(new H(R.getFloat64(w,!0),R.getFloat64(w+8,!0),R.getFloat64(w+16,!0)),R.getFloat64(w+T,!0));w+=S;let G=new H(R.getFloat64(w,!0),R.getFloat64(w+8,!0),R.getFloat64(w+16,!0));w+=T;let j=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;let q=new Uint16Array(f,w,j*3);w+=j*I,j>64*1024&&(D=Uint32Array.BYTES_PER_ELEMENT,L=D*P);let J=q.subarray(0,j),X=q.subarray(j,2*j),Y=q.subarray(j*2,3*j);Ku.zigZagDeltaDecode(J,X,Y),w%D!==0&&(w+=D-w%D);let Q=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;let ee=ro.createTypedArrayFromArrayBuffer(j,f,w,Q*P);w+=Q*L;let z=0,ie=ee.length;for(let De=0;De<ie;++De){let Oe=ee[De];ee[De]=z-Oe,Oe===0&&++z}let re=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;let ne=ro.createTypedArrayFromArrayBuffer(j,f,w,re);w+=re*D;let oe=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;let se=ro.createTypedArrayFromArrayBuffer(j,f,w,oe);w+=oe*D;let ae=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;let fe=ro.createTypedArrayFromArrayBuffer(j,f,w,ae);w+=ae*D;let de=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;let ve=ro.createTypedArrayFromArrayBuffer(j,f,w,de);w+=de*D;let pe,ce;for(;w<R.byteLength;){let De=R.getUint8(w,!0);w+=Uint8Array.BYTES_PER_ELEMENT;let Oe=R.getUint32(w,C);if(w+=Uint32Array.BYTES_PER_ELEMENT,De===mpe.OCT_VERTEX_NORMALS&&o._requestVertexNormals)pe=new Uint8Array(f,w,j*2);else if(De===mpe.WATER_MASK&&o._requestWaterMask)ce=new Uint8Array(f,w,Oe);else if(De===mpe.METADATA&&o._requestMetadata){let Ue=R.getUint32(w,!0);if(Ue>0){let Xe=E_(new Uint8Array(f),w+Uint32Array.BYTES_PER_ELEMENT,Ue).available;if(N(Xe))for(let it=0;it<Xe.length;++it){let ut=m+it+1,at=Xe[it],Pt=o._tilingScheme.getNumberOfYTilesAtLevel(ut);for(let Qe=0;Qe<at.length;++Qe){let ft=at[Qe],Ot=Pt-ft.endY-1,Xt=Pt-ft.startY-1;o.availability.addAvailableTileRange(ut,ft.startX,Ot,ft.endX,Xt),x.availability.addAvailableTileRange(ut,ft.startX,Ot,ft.endX,Xt)}}}x.availabilityTilesLoaded.addAvailableTileRange(m,v,y,v,y)}w+=Oe}let he=o.getLevelMaximumGeometricError(m)*5,Ce=o._tilingScheme.tileXYToRectangle(v,y,m),Se=fc.fromRectangle(Ce,F,k,o._tilingScheme.ellipsoid);return new joe({center:O,minimumHeight:F,maximumHeight:k,boundingSphere:U,orientedBoundingBox:Se,horizonOcclusionPoint:G,quantizedVertices:q,encodedNormals:pe,indices:ee,westIndices:ne,southIndices:se,eastIndices:fe,northIndices:ve,westSkirtHeight:he,southSkirtHeight:he,eastSkirtHeight:he,northSkirtHeight:he,childTileMask:o.availability.computeChildMaskForTile(m,v,y),waterMask:ce,credits:o._tileCredits,flattenPolygonHeight:o._flattenPolygonHeight,flattenPolygon:o._flattenPolygon,flattenRectangle:{rectangle:Ce,minimumHeight:F,maximumHeight:k,ellipsoid:o._tilingScheme.ellipsoid}})}ib.prototype.requestTileGeometry=function(o,f,m,v){let y=this._layers,x,C=y.length,w=!1,A=Promise.resolve();if(C===1)x=y[0];else for(let E=0;E<C;++E){let T=y[E];if(!N(T.availability)||T.availability.isTileAvailable(m,o,f)){x=T;break}let S=d2e(this,o,f,m,T,E===0);S.result&&(w=!0,A=A.then(()=>S.promise))}return!N(x)&&w?A.then(()=>this.requestTileGeometry(o,f,m,v)):Trt(this,o,f,m,x,v)};function Trt(o,f,m,v,y,x){if(!N(y))return Promise.reject(new sr("Terrain tile doesn't exist"));let C=y.tileUrlTemplates;if(C.length===0)return;let w;!o._scheme||o._scheme==="tms"?w=o._tilingScheme.getNumberOfYTilesAtLevel(v)-m-1:w=m;let A=[];o._requestVertexNormals&&y.hasVertexNormals&&A.push(y.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),o._requestWaterMask&&y.hasWaterMask&&A.push("watermask"),o._requestMetadata&&y.hasMetadata&&A.push("metadata");let E,T,S=C[(f+w+v)%C.length],M=y.resource;N(M._ionEndpoint)&&!N(M._ionEndpoint.externalType)?(A.length!==0&&(T={extensions:A.join("-")}),E=v6e(void 0)):E=v6e(A);let I=M.getDerivedResource({url:S,templateValues:{version:y.version,z:v,x:f,y:w},queryParameters:T,headers:E,request:x}).fetchArrayBuffer();if(N(I))return I.then(function(P){return N(P)?N(o._heightmapStructure)?nAi(o,P,v,f,m):oAi(o,P,v,f,m,y):Promise.reject(new sr("Mesh buffer doesn't exist."))})}Object.defineProperties(ib.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return mi("CesiumTerrainProvider.ready","CesiumTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return mi("CesiumTerrainProvider.readyPromise","CesiumTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use CesiumTerrainProvider.fromIonAssetId or CesiumTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});ib.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)};ib.fromIonAssetId=async function(o,f){let m=await Pw.fromAssetId(o);return ib.fromUrl(m,f)};ib.fromUrl=async function(o,f){f=Z(f,Z.EMPTY_OBJECT),o=await Promise.resolve(o);let m=Jr.createIfNeeded(o);m.appendForwardSlash();let v=new h2e(f);v.lastResource=m,v.layerJsonResource=v.lastResource.getDerivedResource({url:"layer.json"}),await Yoe(v);let y=new ib(f);return v.build(y),y};ib.prototype.getTileDataAvailable=function(o,f,m){if(!N(this._availability))return;if(m>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(m,o,f))return!0;if(!this._hasMetadata)return!1;let v=this._layers,y=v.length;for(let x=0;x<y;++x)if(d2e(this,o,f,m,v[x],x===0).result)return;return!1};ib.prototype.loadTileDataAvailability=function(o,f,m){if(!N(this._availability)||m>this._availability._maximumLevel||this._availability.isTileAvailable(m,o,f)||!this._hasMetadata)return;let v=this._layers,y=v.length;for(let x=0;x<y;++x){let C=d2e(this,o,f,m,v[x],x===0);if(N(C.promise))return C.promise}};function Zge(o,f,m,v){if(v===0)return;let y=o.availabilityLevels,x=v%y===0?v-y:(v/y|0)*y,C=1<<v-x,w=f/C|0,A=m/C|0;return{level:x,x:w,y:A}}function d2e(o,f,m,v,y,x){if(!N(y.availabilityLevels))return{result:!1};let C,w=function(){delete y.availabilityPromiseCache[C]},A=y.availabilityTilesLoaded,E=y.availability,T=Zge(y,f,m,v);for(;N(T);){if(E.isTileAvailable(T.level,T.x,T.y)&&!A.isTileAvailable(T.level,T.x,T.y)){let S;if(!x&&(C=`${T.level}-${T.x}-${T.y}`,S=y.availabilityPromiseCache[C],!N(S))){let M=new cg({throttle:!1,throttleByServer:!0,type:Qy.TERRAIN});S=Trt(o,T.x,T.y,T.level,y,M),N(S)&&(y.availabilityPromiseCache[C]=S,S.then(w))}return{result:!0,promise:S}}T=Zge(y,T.x,T.y,T.level)}return{result:!1}}ib._getAvailabilityTile=Zge;var K5=ib;function BM(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.radius,m={center:o.center,semiMajorAxis:f,semiMinorAxis:f,ellipsoid:o.ellipsoid,height:o.height,extrudedHeight:o.extrudedHeight,granularity:o.granularity,vertexFormat:o.vertexFormat,stRotation:o.stRotation,shadowVolume:o.shadowVolume};this._ellipseGeometry=new Vw(m),this._workerName="createCircleGeometry"}BM.packedLength=Vw.packedLength;BM.pack=function(o,f,m){return Vw.pack(o._ellipseGeometry,f,m)};var aAi=new Vw({center:new H,semiMajorAxis:1,semiMinorAxis:1}),mv={center:new H,radius:void 0,ellipsoid:ki.clone(ki.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new un,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};BM.unpack=function(o,f,m){let v=Vw.unpack(o,f,aAi);return mv.center=H.clone(v._center,mv.center),mv.ellipsoid=ki.clone(v._ellipsoid,mv.ellipsoid),mv.height=v._height,mv.extrudedHeight=v._extrudedHeight,mv.granularity=v._granularity,mv.vertexFormat=un.clone(v._vertexFormat,mv.vertexFormat),mv.stRotation=v._stRotation,mv.shadowVolume=v._shadowVolume,N(m)?(mv.semiMajorAxis=v._semiMajorAxis,mv.semiMinorAxis=v._semiMinorAxis,m._ellipseGeometry=new Vw(mv),m):(mv.radius=v._semiMajorAxis,new BM(mv))};BM.createGeometry=function(o){return Vw.createGeometry(o._ellipseGeometry)};BM.createShadowVolume=function(o,f,m){let v=o._ellipseGeometry._granularity,y=o._ellipseGeometry._ellipsoid,x=f(v,y),C=m(v,y);return new BM({center:o._ellipseGeometry._center,radius:o._ellipseGeometry._semiMajorAxis,ellipsoid:y,stRotation:o._ellipseGeometry._stRotation,granularity:v,extrudedHeight:x,height:C,vertexFormat:un.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(BM.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Srt=BM;function eU(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.radius,m={center:o.center,semiMajorAxis:f,semiMinorAxis:f,ellipsoid:o.ellipsoid,height:o.height,extrudedHeight:o.extrudedHeight,granularity:o.granularity,numberOfVerticalLines:o.numberOfVerticalLines};this._ellipseGeometry=new I2(m),this._workerName="createCircleOutlineGeometry"}eU.packedLength=I2.packedLength;eU.pack=function(o,f,m){return I2.pack(o._ellipseGeometry,f,m)};var sAi=new I2({center:new H,semiMajorAxis:1,semiMinorAxis:1}),x1={center:new H,radius:void 0,ellipsoid:ki.clone(ki.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};eU.unpack=function(o,f,m){let v=I2.unpack(o,f,sAi);return x1.center=H.clone(v._center,x1.center),x1.ellipsoid=ki.clone(v._ellipsoid,x1.ellipsoid),x1.height=v._height,x1.extrudedHeight=v._extrudedHeight,x1.granularity=v._granularity,x1.numberOfVerticalLines=v._numberOfVerticalLines,N(m)?(x1.semiMajorAxis=v._semiMajorAxis,x1.semiMinorAxis=v._semiMinorAxis,m._ellipseGeometry=new I2(x1),m):(x1.radius=v._semiMajorAxis,new eU(x1))};eU.createGeometry=function(o){return I2.createGeometry(o._ellipseGeometry)};var Prt=eU;function lAi(o){mi("createWorldTerrain","createWorldTerrain was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createWorldTerrainAsync instead."),o=Z(o,Z.EMPTY_OBJECT);let f=new K5({requestVertexNormals:Z(o.requestVertexNormals,!1),requestWaterMask:Z(o.requestWaterMask,!1)});return f._readyPromise=K5._initializeReadyPromise({url:Pw.fromAssetId(1),requestVertexNormals:Z(o.requestVertexNormals,!1),requestWaterMask:Z(o.requestWaterMask,!1)},f),f}var Irt=lAi;function uAi(o){return o=Z(o,Z.EMPTY_OBJECT),K5.fromIonAssetId(1,{requestVertexNormals:Z(o.requestVertexNormals,!1),requestWaterMask:Z(o.requestWaterMask,!1)})}var qoe=uAi;function D6(o){o=Z(o,Z.EMPTY_OBJECT),this._callback=o.callback,this._tilingScheme=o.tilingScheme,N(this._tilingScheme)||(this._tilingScheme=new Bd({ellipsoid:Z(o.ellipsoid,ki.WGS84)})),this._width=o.width,this._height=o.height;let f=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Rv.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,f,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Br;let m=o.credit;typeof m=="string"&&(m=new Cs(m)),this._credit=m,this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(D6.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return mi("CustomHeightmapTerrainProvider.ready","CustomHeightmapTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return mi("CustomHeightmapTerrainProvider.readyPromise","CustomHeightmapTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});D6.prototype.requestTileGeometry=function(o,f,m,v){let y=this._callback(o,f,m);if(!N(y))return;let x=this._width,C=this._height;return Promise.resolve(y).then(function(w){let A=w;return Array.isArray(A)&&(A=new Float64Array(A)),new wT({buffer:A,width:x,height:C})})};D6.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)};D6.prototype.getTileDataAvailable=function(o,f,m){};D6.prototype.loadTileDataAvailability=function(o,f,m){};var Mrt=D6,cAi=1953029805,hAi=2917034100;function f2e(o,f){if(f2e.passThroughDataForTesting)return f;let m=o.byteLength;if(m===0||m%4!==0)throw new sr("The length of key must be greater than 0 and a multiple of 4.");let v=new DataView(f),y=v.getUint32(0,!0);if(y===cAi||y===hAi)return f;let x=new DataView(o),C=0,w=f.byteLength,A=w-w%8,E=m,T,S=8;for(;C<A;)for(S=(S+8)%24,T=S;C<A&&T<E;)v.setUint32(C,v.getUint32(C,!0)^x.getUint32(T,!0),!0),v.setUint32(C+4,v.getUint32(C+4,!0)^x.getUint32(T+4,!0),!0),C+=8,T+=24;if(C<w)for(T>=E&&(S=(S+8)%24,T=S);C<w;)v.setUint8(C,v.getUint8(C)^x.getUint8(T)),C++,T++}f2e.passThroughDataForTesting=!1;var p2e=f2e;function Drt(o){this.proxy=o}Drt.prototype.getURL=function(o){let f=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+f+encodeURIComponent(o)};var Lrt=Drt;function nT(o){this._comparator=o.comparator,this._maximumLength=o.maximumLength,this._array=N(o.maximumLength)?new Array(o.maximumLength):[],this._length=0}Object.defineProperties(nT.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(o){if(N(o)){for(;this._length>o;)this.removeMinimum();this._array.length=o}this._maximumLength=o}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});nT.prototype.clone=function(){let o=this._maximumLength,f=this._comparator,m=this._array,v=this._length,y=new nT({comparator:f,maximumLength:o});y._length=v;for(let x=0;x<v;x++)y._array[x]=m[x];return y};nT.prototype.reset=function(){this._length=0;let o=this._maximumLength;if(N(o))for(let f=0;f<o;f++)this._array[f]=void 0;else this._array.length=0};nT.prototype.resort=function(){let o=this._length;for(let f=0;f<o;f++)Rrt(this,f)};nT.prototype.insert=function(o){let f,m=this._maximumLength;if(N(m)){if(m===0)return;if(this._length===m){let y=this._array[0];if(this._comparator(o,y)<=0)return o;f=this.removeMinimum()}}let v=this._length;return this._array[v]=o,this._length++,Rrt(this,v),f};nT.prototype.removeMinimum=function(){let o=this._length;if(o===0)return;this._length--;let f=this._array[0];return o>=2&&(this._array[0]=this._array[o-1],Ort(this,0)),this._array[o-1]=void 0,f};nT.prototype.removeMaximum=function(){let o=this._length;if(o===0)return;this._length--;let f;if(o<=2)f=this._array[o-1];else{let m=m2e(this,1,2)?1:2;f=this._array[m],this._array[m]=this._array[o-1],o>=4&&Ort(this,m)}return this._array[o-1]=void 0,f};nT.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};nT.prototype.getMaximum=function(){let o=this._length;if(o!==0)return o<=2?this._array[o-1]:this._array[m2e(this,1,2)?1:2]};function Kte(o,f,m){let v=o._array,y=v[f];v[f]=v[m],v[m]=y}function fW(o,f,m){return o._comparator(o._array[f],o._array[m])<0}function m2e(o,f,m){return o._comparator(o._array[f],o._array[m])>0}function Rrt(o,f){if(f===0)return;let m=Math.floor(xe.log2(f+1))%2===0,v=Math.floor((f-1)/2),y=fW(o,f,v);for(y!==m&&(Kte(o,f,v),f=v);f>=3;){let x=Math.floor((f-3)/4);if(fW(o,f,x)!==y)break;Kte(o,f,x),f=x}}function Ort(o,f){let m=o._length,v=Math.floor(xe.log2(f+1))%2===0,y;for(;(y=2*f+1)<m;){let x=y,C=y+1;if(C<m){fW(o,C,x)===v&&(x=C);let w=2*y+1,A=Math.max(Math.min(m-w,4),0);for(let E=0;E<A;E++){let T=w+E;fW(o,T,x)===v&&(x=T)}}if(fW(o,x,f)===v&&(Kte(o,x,f),x!==y&&x!==C)){let w=Math.floor((x-1)/2);m2e(o,x,w)===v&&Kte(o,x,w)}f=x}}var Xoe=nT;function Joe(){li.throwInstantiationError()}Object.defineProperties(Joe.prototype,{credit:{get:li.throwInstantiationError}});Joe.getCreditsFromResult=function(o){if(N(o.attributions))return o.attributions.map(Cs.getIonCredit)};Joe.prototype.geocode=li.throwInstantiationError;var Koe=Joe,dAi={SEARCH:0,AUTOCOMPLETE:1},Jq=Object.freeze(dAi);function Nrt(){li.throwInstantiationError()}Nrt.createGeometry=function(o){li.throwInstantiationError()};var Frt=Nrt,fAi=dd(t9e(),1);function pAi(o,f){return(o&f)!==0}var X1=pAi,mAi=[1,2,4,8],Brt=15,gAi=16,_Ai=64,vAi=128;function O2(o,f,m,v,y,x){this._bits=o,this.cnodeVersion=f,this.imageryVersion=m,this.terrainVersion=v,this.imageryProvider=y,this.terrainProvider=x,this.ancestorHasTerrain=!1,this.terrainState=void 0}O2.clone=function(o,f){return N(f)?(f._bits=o._bits,f.cnodeVersion=o.cnodeVersion,f.imageryVersion=o.imageryVersion,f.terrainVersion=o.terrainVersion,f.imageryProvider=o.imageryProvider,f.terrainProvider=o.terrainProvider):f=new O2(o._bits,o.cnodeVersion,o.imageryVersion,o.terrainVersion,o.imageryProvider,o.terrainProvider),f.ancestorHasTerrain=o.ancestorHasTerrain,f.terrainState=o.terrainState,f};O2.prototype.setParent=function(o){this.ancestorHasTerrain=o.ancestorHasTerrain||this.hasTerrain()};O2.prototype.hasSubtree=function(){return X1(this._bits,gAi)};O2.prototype.hasImagery=function(){return X1(this._bits,_Ai)};O2.prototype.hasTerrain=function(){return X1(this._bits,vAi)};O2.prototype.hasChildren=function(){return X1(this._bits,Brt)};O2.prototype.hasChild=function(o){return X1(this._bits,mAi[o])};O2.prototype.getChildBitmask=function(){return this._bits&Brt};var g2e=O2;function yAi(o){let f=o.length,m=new ArrayBuffer(f),v=new Uint8Array(m);for(let y=0;y<f;++y)v[y]=o.charCodeAt(y);return m}var xAi=yAi(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB \f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 \xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS >\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 \x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function rb(o){if(this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=xe.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={},this._readyPromise=Promise.resolve(!0),N(o)){mi("GoogleEarthEnterpriseMetadata options.url","GoogleEarthEnterpriseMetadata constructor parmeter resourceOrUrl was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead.");let f=o;typeof f!="string"&&!(f instanceof Jr)&&(f=o.url);let m=Jr.createIfNeeded(f);m.appendForwardSlash(),this._resource=m;let v=this;this._readyPromise=Vrt(this).then(function(){return v.getQuadTreePacket("",v._quadPacketVersion)}).then(function(){return!0}).catch(function(y){let x=`An error occurred while accessing ${_2e(v,"",1).url}.`;return Promise.reject(new sr(x))})}}Object.defineProperties(rb.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}},readyPromise:{get:function(){return mi("GoogleEarthEnterpriseMetadata.readyPromise","GoogleEarthEnterpriseMetadata.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseMetadata.fromUrl instead."),this._readyPromise}}});rb.fromUrl=async function(o){let f=o;typeof f!="string"&&!(f instanceof Jr)&&(f=o.url);let m=Jr.createIfNeeded(f);m.appendForwardSlash();let v=new rb;v._resource=m;try{await Vrt(v),await v.getQuadTreePacket("",v._quadPacketVersion)}catch(y){let x=`An error occurred while accessing ${_2e(v,"",1).url}: ${y}`;throw new sr(x)}return v};rb.tileXYToQuadKey=function(o,f,m){let v="";for(let y=m;y>=0;--y){let x=1<<y,C=0;X1(f,x)?X1(o,x)&&(C|=1):(C|=2,X1(o,x)||(C|=1)),v+=C}return v};rb.quadKeyToTileXY=function(o){let f=0,m=0,v=o.length-1;for(let y=v;y>=0;--y){let x=1<<y,C=+o[v-y];X1(C,2)?X1(C,1)||(f|=x):(m|=x,X1(C,1)&&(f|=x))}return{x:f,y:m,level:v}};rb.prototype.isValid=function(o){let f=this.getTileInformationFromQuadKey(o);if(N(f))return f!==null;let m=!0,v=o,y;for(;v.length>1;)if(y=v.substring(v.length-1),v=v.substring(0,v.length-1),f=this.getTileInformationFromQuadKey(v),N(f)){!f.hasSubtree()&&!f.hasChild(parseInt(y))&&(m=!1);break}else if(f===null){m=!1;break}return m};var krt=new tp("decodeGoogleEarthEnterprisePacket");rb.prototype.getQuadTreePacket=function(o,f,m){f=Z(f,1),o=Z(o,"");let v=_2e(this,o,f,m).fetchArrayBuffer();if(!N(v))return;let y=this._tileInfo,x=this.key;return v.then(function(C){return krt.scheduleTask({buffer:C,quadKey:o,type:"Metadata",key:x},[C]).then(function(w){let A,E=-1;if(o!==""){E=o.length+1;let M=w[o];A=y[o],A._bits|=M._bits,delete w[o]}let T=Object.keys(w);T.sort(function(M,I){return M.length-I.length});let S=T.length;for(let M=0;M<S;++M){let I=T[M];if(w[I]!==null){let P=g2e.clone(w[I]),D=I.length;if(D===E)P.setParent(A);else if(D>1){let L=y[I.substring(0,I.length-1)];P.setParent(L)}y[I]=P}else y[I]=null}})})};rb.prototype.populateSubtree=function(o,f,m,v){let y=rb.tileXYToQuadKey(o,f,m);return $ge(this,y,v)};function $ge(o,f,m){let v=o._tileInfo,y=f,x=v[y];if(N(x)&&(!x.hasSubtree()||x.hasChildren()))return x;for(;x===void 0&&y.length>1;)y=y.substring(0,y.length-1),x=v[y];let C,w=o._subtreePromises,A=w[y];if(N(A))return A.then(function(){return C=new cg({throttle:m.throttle,throttleByServer:m.throttleByServer,type:m.type,priorityFunction:m.priorityFunction}),$ge(o,f,C)});if(!N(x)||!x.hasSubtree())return Promise.reject(new sr(`Couldn't load metadata for tile ${f}`));if(A=o.getQuadTreePacket(y,x.cnodeVersion,m),!!N(A))return w[y]=A,A.then(function(){return C=new cg({throttle:m.throttle,throttleByServer:m.throttleByServer,type:m.type,priorityFunction:m.priorityFunction}),$ge(o,f,C)}).finally(function(){delete w[y]})}rb.prototype.getTileInformation=function(o,f,m){let v=rb.tileXYToQuadKey(o,f,m);return this._tileInfo[v]};rb.prototype.getTileInformationFromQuadKey=function(o){return this._tileInfo[o]};function _2e(o,f,m,v){return o._resource.getDerivedResource({url:`flatfile?q2-0${f}-q.${m.toString()}`,request:v})}var gpe,_pe;function Vrt(o){let f=o._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!N(_pe)){let m=Ms("ThirdParty/google-earth-dbroot-parser.js"),v=window.cesiumGoogleEarthDbRootParser;_pe=zie(m).then(function(){gpe=window.cesiumGoogleEarthDbRootParser(fAi),N(v)?window.cesiumGoogleEarthDbRootParser=v:delete window.cesiumGoogleEarthDbRootParser})}return _pe.then(function(){return f.fetchArrayBuffer()}).then(function(m){let v=gpe.EncryptedDbRootProto.decode(new Uint8Array(m)),y=v.encryptionData,x=y.byteOffset,C=x+y.byteLength,w=o.key=y.buffer.slice(x,C);y=v.dbrootData,x=y.byteOffset,C=x+y.byteLength;let A=y.buffer.slice(x,C);return krt.scheduleTask({buffer:A,type:"DbRoot",key:w},[A])}).then(function(m){let v=gpe.DbRootProto.decode(new Uint8Array(m.buffer));if(o.imageryPresent=Z(v.imageryPresent,o.imageryPresent),o.protoImagery=v.protoImagery,o.terrainPresent=Z(v.terrainPresent,o.terrainPresent),N(v.endSnippet)&&N(v.endSnippet.model)){let w=v.endSnippet.model;o.negativeAltitudeExponentBias=Z(w.negativeAltitudeExponentBias,o.negativeAltitudeExponentBias),o.negativeAltitudeThreshold=Z(w.compressedNegativeAltitudeThreshold,o.negativeAltitudeThreshold)}N(v.databaseVersion)&&(o._quadPacketVersion=Z(v.databaseVersion.quadtreeVersion,o._quadPacketVersion));let y=o.providers,x=Z(v.providerInfo,[]),C=x.length;for(let w=0;w<C;++w){let A=x[w],E=A.copyrightString;N(E)&&(y[A.providerId]=new Cs(E.value))}}).catch(function(){console.log(`Failed to retrieve ${f.url}. Using defaults.`),o.key=xAi})}var TO=rb;function o4(o){o=Z(o,Z.EMPTY_OBJECT),this._buffer=o.buffer,this._credits=o.credits,this._negativeAltitudeExponentBias=o.negativeAltitudeExponentBias,this._negativeElevationThreshold=o.negativeElevationThreshold;let f=Z(o.childTileMask,15),m=f&3;m|=f&4?8:0,m|=f&8?4:0,this._childTileMask=m,this._createdByUpsampling=Z(o.createdByUpsampling,!1),this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(o4.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var zrt="createVerticesFromGoogleEarthEnterpriseBuffer",CAi=new tp(zrt),bAi=new tp(zrt,WB.maximumAsynchronousTasks),y6e=new Di,vpe=new Di;o4.prototype.createMesh=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.tilingScheme,m=o.x,v=o.y,y=o.level,x=Z(o.exaggeration,1),C=Z(o.exaggerationRelativeHeight,0),w=Z(o.throttle,!0),A=f.ellipsoid;f.tileXYToNativeRectangle(m,v,y,y6e),f.tileXYToRectangle(m,v,y,vpe);let E=A.cartographicToCartesian(Di.center(vpe)),T=40075.16/(1<<y);this._skirtHeight=Math.min(T*8,1e3);let S=(w?bAi:CAi).scheduleTask({buffer:this._buffer,nativeRectangle:y6e,rectangle:vpe,relativeToCenter:E,ellipsoid:A,skirtHeight:this._skirtHeight,exaggeration:x,exaggerationRelativeHeight:C,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!N(S))return;let M=this;return S.then(function(I){return M._mesh=new jB(E,new Float32Array(I.vertices),new Uint16Array(I.indices),I.indexCountWithoutSkirts,I.vertexCountWithoutSkirts,I.minimumHeight,I.maximumHeight,Pi.clone(I.boundingSphere3D),H.clone(I.occludeePointInScaledSpace),I.numberOfAttributes,fc.clone(I.orientedBoundingBox),Hw.clone(I.encoding),I.westIndicesSouthToNorth,I.southIndicesEastToWest,I.eastIndicesNorthToSouth,I.northIndicesWestToEast),M._minimumHeight=I.minimumHeight,M._maximumHeight=I.maximumHeight,M._buffer=void 0,M._mesh})};o4.prototype.interpolateHeight=function(o,f,m){let v=xe.clamp((f-o.west)/o.width,0,1),y=xe.clamp((m-o.south)/o.height,0,1);return N(this._mesh)?SAi(this,v,y):MAi(this,v,y,o)};var wAi=new tp("upsampleQuantizedTerrainMesh",WB.maximumAsynchronousTasks);o4.prototype.upsample=function(o,f,m,v,y,x,C){let w=this._mesh;if(!N(this._mesh))return;let A=f*2!==y,E=m*2===x,T=o.ellipsoid,S=o.tileXYToRectangle(y,x,C),M=wAi.scheduleTask({vertices:w.vertices,indices:w.indices,indexCountWithoutSkirts:w.indexCountWithoutSkirts,vertexCountWithoutSkirts:w.vertexCountWithoutSkirts,encoding:w.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:A,isNorthChild:E,childRectangle:S,ellipsoid:T});if(!N(M))return;let I=this;return M.then(function(P){let D=new Uint16Array(P.vertices),L=ro.createTypedArray(D.length/3,P.indices),R=I._skirtHeight;return new joe({quantizedVertices:D,indices:L,minimumHeight:P.minimumHeight,maximumHeight:P.maximumHeight,boundingSphere:Pi.clone(P.boundingSphere),orientedBoundingBox:fc.clone(P.orientedBoundingBox),horizonOcclusionPoint:H.clone(P.horizonOcclusionPoint),westIndices:P.westIndices,southIndices:P.southIndices,eastIndices:P.eastIndices,northIndices:P.northIndices,westSkirtHeight:R,southSkirtHeight:R,eastSkirtHeight:R,northSkirtHeight:R,childTileMask:0,createdByUpsampling:!0,credits:I._credits})})};o4.prototype.isChildAvailable=function(o,f,m,v){let y=2;return m!==o*2&&++y,v!==f*2&&(y-=2),(this._childTileMask&1<<y)!==0};o4.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var AAi=new Ye,EAi=new Ye,TAi=new Ye,Hrt=new H;function SAi(o,f,m){let v=o._mesh,y=v.vertices,x=v.encoding,C=v.indices;for(let w=0,A=C.length;w<A;w+=3){let E=C[w],T=C[w+1],S=C[w+2],M=x.decodeTextureCoordinates(y,E,AAi),I=x.decodeTextureCoordinates(y,T,EAi),P=x.decodeTextureCoordinates(y,S,TAi),D=M6.computeBarycentricCoordinates(f,m,M.x,M.y,I.x,I.y,P.x,P.y,Hrt);if(D.x>=-1e-15&&D.y>=-1e-15&&D.z>=-1e-15){let L=x.decodeHeight(y,E),R=x.decodeHeight(y,T),O=x.decodeHeight(y,S);return D.x*L+D.y*R+D.z*O}}}var PAi=Uint16Array.BYTES_PER_ELEMENT,x6e=Uint32Array.BYTES_PER_ELEMENT,ype=Int32Array.BYTES_PER_ELEMENT,IAi=Float32Array.BYTES_PER_ELEMENT,xpe=Float64Array.BYTES_PER_ELEMENT;function MAi(o,f,m,v){let y=o._buffer,x=0,C=0,w=0;m>.5?(f>.5?(x=2,C=.5):x=3,w=.5):f>.5&&(x=1,C=.5);let A=new DataView(y),E=0;for(let U=0;U<x;++U)E+=A.getUint32(E,!0),E+=x6e;E+=x6e,E+=2*xpe;let T=xe.toRadians(A.getFloat64(E,!0)*180);E+=xpe;let S=xe.toRadians(A.getFloat64(E,!0)*180);E+=xpe;let M=v.width/T/2,I=v.height/S/2,P=A.getInt32(E,!0);E+=ype;let D=A.getInt32(E,!0)*3;E+=ype,E+=ype;let L=new Array(P),R=new Array(P),O=new Array(P),F;for(F=0;F<P;++F)L[F]=C+A.getUint8(E++)*M,R[F]=w+A.getUint8(E++)*I,O[F]=A.getFloat32(E,!0)*6371010,E+=IAi;let k=new Array(D);for(F=0;F<D;++F)k[F]=A.getUint16(E,!0),E+=PAi;for(F=0;F<D;F+=3){let U=k[F],G=k[F+1],j=k[F+2],q=L[U],J=L[G],X=L[j],Y=R[U],Q=R[G],ee=R[j],z=M6.computeBarycentricCoordinates(f,m,q,Y,J,Q,X,ee,Hrt);if(z.x>=-1e-15&&z.y>=-1e-15&&z.z>=-1e-15)return z.x*O[U]+z.y*O[G]+z.z*O[j]}}var Qte=o4,hw={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},r$=new ci;function Qoe(){this._terrainCache={},this._lastTidy=ci.now()}Qoe.prototype.add=function(o,f){this._terrainCache[o]={buffer:f,timestamp:ci.now()}};Qoe.prototype.get=function(o){let f=this._terrainCache[o];if(N(f))return delete this._terrainCache[o],f.buffer};Qoe.prototype.tidy=function(){if(ci.now(r$),ci.secondsDifference(r$,this._lastTidy)>10){let o=this._terrainCache,f=Object.keys(o),m=f.length;for(let v=0;v<m;++v){let y=f[v],x=o[y];ci.secondsDifference(r$,x.timestamp)>10&&delete o[y]}ci.clone(r$,this._lastTidy)}};function j3(o){o=Z(o,Z.EMPTY_OBJECT),this._tilingScheme=new Bd({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Di(-xe.PI,-xe.PI,xe.PI,xe.PI),ellipsoid:o.ellipsoid});let f=o.credit;if(typeof f=="string"&&(f=new Cs(f)),this._credit=f,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new Qoe,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Br,this._ready=!1,N(o.url)){mi("GoogleEarthEnterpriseTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let m=Jr.createIfNeeded(o.url),v=this,y;this._readyPromise=TO.fromUrl(m).then(x=>{if(!x.terrainPresent){let C=new sr(`The server ${x.url} doesn't have terrain`);return Promise.reject(C)}return ld.reportSuccess(y),v._metadata=x,v._ready=!0,!0}).catch(x=>{throw y=ld.reportError(y,v,v._errorEvent,x.message,void 0,void 0,void 0,x),x})}else if(N(o.metadata)){mi("GoogleEarthEnterpriseTerrainProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseTerrainProvider.fromMetadata instead.");let m=o.metadata;this._metadata=m;let v=this;this._readyPromise=Promise.resolve(this._metadata._readyPromise).then(()=>{if(!m.terrainPresent)throw new sr(`The server ${m.url} doesn't have terrain`);v._ready=!0})}}Object.defineProperties(j3.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("GoogleEarthEnterpriseTerrainProvider.ready","GoogleEarthEnterpriseTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._ready}},readyPromise:{get:function(){return mi("GoogleEarthEnterpriseTerrainProvider.readyPromise","GoogleEarthEnterpriseTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});j3.fromMetadata=function(o,f){if(!o.terrainPresent)throw new sr(`The server ${o.url} doesn't have terrain`);let m=new j3(f);return m._metadata=o,m._readyPromise=Promise.resolve(!0),m._ready=!0,m};var DAi=new tp("decodeGoogleEarthEnterprisePacket");function C6e(o,f,m){let v=f.getChildBitmask();if(f.terrainState===hw.PARENT){v=0;for(let y=0;y<4;++y){let x=m.getTileInformationFromQuadKey(o+y.toString());N(x)&&x.hasTerrain()&&(v|=1<<y)}}return v}j3.prototype.requestTileGeometry=function(o,f,m,v){let y=TO.tileXYToQuadKey(o,f,m),x=this._terrainCache,C=this._metadata,w=C.getTileInformationFromQuadKey(y);if(!N(w))return Promise.reject(new sr("Terrain tile doesn't exist"));let A=w.terrainState;N(A)||(A=w.terrainState=hw.UNKNOWN);let E=x.get(y);if(N(E)){let R=C.providers[w.terrainProvider];return Promise.resolve(new Qte({buffer:E,childTileMask:C6e(y,w,C),credits:N(R)?[R]:void 0,negativeAltitudeExponentBias:C.negativeAltitudeExponentBias,negativeElevationThreshold:C.negativeAltitudeThreshold}))}if(x.tidy(),w.ancestorHasTerrain){if(A===hw.NONE)return Promise.reject(new sr("Terrain tile doesn't exist"))}else return Promise.resolve(new wT({buffer:new Uint8Array(16*16),width:16,height:16}));let T,S=y,M=-1;switch(A){case hw.SELF:M=w.terrainVersion;break;case hw.PARENT:S=S.substring(0,S.length-1),T=C.getTileInformationFromQuadKey(S),M=T.terrainVersion;break;case hw.UNKNOWN:w.hasTerrain()?M=w.terrainVersion:(S=S.substring(0,S.length-1),T=C.getTileInformationFromQuadKey(S),N(T)&&T.hasTerrain()&&(M=T.terrainVersion));break}if(M<0)return Promise.reject(new sr("Terrain tile doesn't exist"));let I=this._terrainPromises,P=this._terrainRequests,D,L;if(N(I[S]))D=I[S],L=P[S];else{L=v;let R=LAi(this,S,M,L).fetchArrayBuffer();if(!N(R))return;D=R.then(function(O){return N(O)?DAi.scheduleTask({buffer:O,type:"Terrain",key:C.key},[O]).then(function(F){let k=C.getTileInformationFromQuadKey(S);k.terrainState=hw.SELF,x.add(S,F[0]);let U=k.terrainProvider,G=F.length-1;for(let j=0;j<G;++j){let q=S+j.toString(),J=C.getTileInformationFromQuadKey(q);N(J)&&(x.add(q,F[j+1]),J.terrainState=hw.PARENT,J.terrainProvider===0&&(J.terrainProvider=U))}}):Promise.reject(new sr("Failed to load terrain."))}),I[S]=D,P[S]=L,D=D.finally(function(){delete I[S],delete P[S]})}return D.then(function(){let R=x.get(y);if(N(R)){let O=C.providers[w.terrainProvider];return new Qte({buffer:R,childTileMask:C6e(y,w,C),credits:N(O)?[O]:void 0,negativeAltitudeExponentBias:C.negativeAltitudeExponentBias,negativeElevationThreshold:C.negativeAltitudeThreshold})}return Promise.reject(new sr("Failed to load terrain."))}).catch(function(R){return L.state===bc.CANCELLED?(v.state=L.state,Promise.reject(R)):(w.terrainState=hw.NONE,Promise.reject(R))})};j3.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)};j3.prototype.getTileDataAvailable=function(o,f,m){let v=this._metadata,y=TO.tileXYToQuadKey(o,f,m),x=v.getTileInformation(o,f,m);if(x===null)return!1;if(N(x)){if(!x.ancestorHasTerrain)return!0;let C=x.terrainState;if(C===hw.NONE)return!1;if((!N(C)||C===hw.UNKNOWN)&&(x.terrainState=hw.UNKNOWN,!x.hasTerrain())){y=y.substring(0,y.length-1);let w=v.getTileInformationFromQuadKey(y);if(!N(w)||!w.hasTerrain())return!1}return!0}if(v.isValid(y)){let C=new cg({throttle:!1,throttleByServer:!0,type:Qy.TERRAIN});v.populateSubtree(o,f,m,C)}return!1};j3.prototype.loadTileDataAvailability=function(o,f,m){};function LAi(o,f,m,v){return m=N(m)&&m>0?m:1,o._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${f}-t.${m.toString()}`,request:v})}var Urt=j3,n$,Grt="AIzaSyBqCv5lozjjhtIQ_pZuj2obyAL9bTJdY28",Zoe={};Zoe.defaultApiKey=Grt;Zoe.mapTilesApiEndpoint=new Jr({url:"https://tile.googleapis.com/v1/"});Zoe.getDefaultApiKeyCredit=function(o){if(o===Grt){if(!N(n$)){let f=`<b> This application is using CesiumJS's default Google Maps API key. Please assign <i>Cesium.GoogleMaps.defaultApiKey</i> with <a href="https://developers.google.com/maps/documentation/embed/get-api-key">your API key for the Google Maps Platform</a>.</b>`;n$=new Cs(f,!0),n$._isDefaultToken=!0}return n$}};var pW=Zoe,Kq={};Kq.type=void 0;Kq.getRequiredDataPoints=li.throwInstantiationError;Kq.interpolateOrderZero=li.throwInstantiationError;Kq.interpolate=li.throwInstantiationError;var Wrt=Kq;function v2e(o){this._url=Jr.createIfNeeded(o),this._url.appendForwardSlash()}Object.defineProperties(v2e.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});v2e.prototype.geocode=async function(o,f){return this._url.getDerivedResource({url:f===Jq.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:o}}).fetchJson().then(function(m){return m.features.map(function(v){let y,x=v.bbox;if(N(x))y=Di.fromDegrees(x[0],x[1],x[2],x[3]);else{let C=v.geometry.coordinates[0],w=v.geometry.coordinates[1];y=H.fromDegrees(C,w)}return{displayName:v.properties.label,destination:y,attributions:m.attributions}})})};var y2e=v2e;function x2e(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.accessToken,ZR.defaultAccessToken),m=Jr.createIfNeeded(Z(o.server,ZR.defaultServer));m.appendForwardSlash();let v=ZR.getDefaultTokenCredit(f);N(v)&&o.scene.frameState.creditDisplay.addStaticCredit(Cs.clone(v));let y=m.getDerivedResource({url:"v1/geocode"});N(f)&&y.appendQueryParameters({access_token:f}),this._accessToken=f,this._server=m,this._pelias=new y2e(y)}Object.defineProperties(x2e.prototype,{credit:{get:function(){}}});x2e.prototype.geocode=async function(o,f){return this._pelias.geocode(o,f)};var C2e=x2e,RAi=new tp("transcodeCRNToDXT",Number.POSITIVE_INFINITY);function OAi(o){let f;if(o instanceof ArrayBuffer||ArrayBuffer.isView(o)?f=Promise.resolve(o):f=Jr.createIfNeeded(o).fetchArrayBuffer(),!!N(f))return f.then(function(m){if(!N(m))return;let v=[];return m instanceof ArrayBuffer?v.push(m):(m.byteOffset===0&&m.byteLength===m.buffer.byteLength||(m=m.slice(0,m.length)),v.push(m.buffer)),RAi.scheduleTask(m,v)}).then(function(m){return iY.clone(m)})}var jrt=OAi;function $oe(){li.throwInstantiationError()}Object.defineProperties($oe.prototype,{ellipsoid:{get:li.throwInstantiationError}});$oe.prototype.project=li.throwInstantiationError;$oe.prototype.unproject=li.throwInstantiationError;var Yrt=$oe;function L6(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.weights,m=o.times;this._times=m,this._weights=f,this._count=f.length/m.length,this._lastTimeIndex=0}Object.defineProperties(L6.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});L6.prototype.findTimeInterval=gd.prototype.findTimeInterval;L6.prototype.wrapTime=gd.prototype.wrapTime;L6.prototype.clampTime=gd.prototype.clampTime;L6.prototype.evaluate=function(o,f){let m=this.weights,v=this.times,y=this._lastTimeIndex=this.findTimeInterval(o,this._lastTimeIndex),x=(o-v[y])/(v[y+1]-v[y]);N(f)||(f=new Array(this._count));for(let C=0;C<this._count;C++){let w=y*this._count+C;f[C]=m[w]*(1-x)+m[w+this._count]*x}return f};var qrt=L6;function b2e(o,f,m){o=Jr.createIfNeeded(o),o.appendForwardSlash(),o.setQueryParameters({key:f}),this._url=o,this._params=Z(m,{}),this._credit=new Cs('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(b2e.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});b2e.prototype.geocode=async function(o){return this._url.getDerivedResource({url:"json",queryParameters:va(this._params,{q:o})}).fetchJson().then(function(f){return f.results.map(function(m){let v,y=m.bounds;if(N(y))v=Di.fromDegrees(y.southwest.lng,y.southwest.lat,y.northeast.lng,y.northeast.lat);else{let x=m.geometry.lat,C=m.geometry.lng;v=H.fromDegrees(x,C)}return{displayName:m.formatted,destination:v}})})};var Xrt=b2e,NAi={packedLength:void 0,pack:li.throwInstantiationError,unpack:li.throwInstantiationError},Jrt=NAi,FAi={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:li.throwInstantiationError,unpackInterpolationResult:li.throwInstantiationError},Krt=FAi,BAi=new H;function kAi(o,f,m,v){let y=hre(o,f,m,v,BAi);return N(y)?y.x>0&&y.y>0&&y.z>0:!1}var Qrt=kAi;function Zrt(){li.throwInstantiationError()}Zrt.prototype.getURL=li.throwInstantiationError;var $rt=Zrt;function VAi(o,f,m,v,y,x,C){let w=Zh.numberOfPoints(o,f,y),A,E=m.red,T=m.green,S=m.blue,M=m.alpha,I=v.red,P=v.green,D=v.blue,L=v.alpha;if(Re.equals(m,v)){for(A=0;A<w;A++)x[C++]=Re.floatToByte(E),x[C++]=Re.floatToByte(T),x[C++]=Re.floatToByte(S),x[C++]=Re.floatToByte(M);return C}let R=(I-E)/w,O=(P-T)/w,F=(D-S)/w,k=(L-M)/w,U=C;for(A=0;A<w;A++)x[U++]=Re.floatToByte(E+A*R),x[U++]=Re.floatToByte(T+A*O),x[U++]=Re.floatToByte(S+A*F),x[U++]=Re.floatToByte(M+A*k);return U}function Sj(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.positions,m=o.colors,v=Z(o.colorsPerVertex,!1);this._positions=f,this._colors=m,this._colorsPerVertex=v,this._arcType=Z(o.arcType,fs.GEODESIC),this._granularity=Z(o.granularity,xe.RADIANS_PER_DEGREE),this._ellipsoid=Z(o.ellipsoid,ki.WGS84),this._workerName="createSimplePolylineGeometry";let y=1+f.length*H.packedLength;y+=N(m)?1+m.length*Re.packedLength:1,this.packedLength=y+ki.packedLength+3}Sj.pack=function(o,f,m){m=Z(m,0);let v,y=o._positions,x=y.length;for(f[m++]=x,v=0;v<x;++v,m+=H.packedLength)H.pack(y[v],f,m);let C=o._colors;for(x=N(C)?C.length:0,f[m++]=x,v=0;v<x;++v,m+=Re.packedLength)Re.pack(C[v],f,m);return ki.pack(o._ellipsoid,f,m),m+=ki.packedLength,f[m++]=o._colorsPerVertex?1:0,f[m++]=o._arcType,f[m]=o._granularity,f};Sj.unpack=function(o,f,m){f=Z(f,0);let v,y=o[f++],x=new Array(y);for(v=0;v<y;++v,f+=H.packedLength)x[v]=H.unpack(o,f);y=o[f++];let C=y>0?new Array(y):void 0;for(v=0;v<y;++v,f+=Re.packedLength)C[v]=Re.unpack(o,f);let w=ki.unpack(o,f);f+=ki.packedLength;let A=o[f++]===1,E=o[f++],T=o[f];return N(m)?(m._positions=x,m._colors=C,m._ellipsoid=w,m._colorsPerVertex=A,m._arcType=E,m._granularity=T,m):new Sj({positions:x,colors:C,ellipsoid:w,colorsPerVertex:A,arcType:E,granularity:T})};var dee=new Array(2),fee=new Array(2),zAi={positions:dee,height:fee,ellipsoid:void 0,minDistance:void 0,granularity:void 0};Sj.createGeometry=function(o){let f=o._positions,m=o._colors,v=o._colorsPerVertex,y=o._arcType,x=o._granularity,C=o._ellipsoid,w=xe.chordLength(x,C.maximumRadius),A=N(m)&&!v,E,T=f.length,S,M,I,P,D=0;if(y===fs.GEODESIC||y===fs.RHUMB){let k,U,G;y===fs.GEODESIC?(k=xe.chordLength(x,C.maximumRadius),U=Zh.numberOfPoints,G=Zh.generateArc):(k=x,U=Zh.numberOfPointsRhumbLine,G=Zh.generateRhumbArc);let j=Zh.extractHeights(f,C),q=zAi;if(y===fs.GEODESIC?q.minDistance=w:q.granularity=x,q.ellipsoid=C,A){let J=0;for(E=0;E<T-1;E++)J+=U(f[E],f[E+1],k)+1;S=new Float64Array(J*3),I=new Uint8Array(J*4),q.positions=dee,q.height=fee;let X=0;for(E=0;E<T-1;++E){dee[0]=f[E],dee[1]=f[E+1],fee[0]=j[E],fee[1]=j[E+1];let Y=G(q);if(N(m)){let Q=Y.length/3;P=m[E];for(let ee=0;ee<Q;++ee)I[X++]=Re.floatToByte(P.red),I[X++]=Re.floatToByte(P.green),I[X++]=Re.floatToByte(P.blue),I[X++]=Re.floatToByte(P.alpha)}S.set(Y,D),D+=Y.length}}else if(q.positions=f,q.height=j,S=new Float64Array(G(q)),N(m)){for(I=new Uint8Array(S.length/3*4),E=0;E<T-1;++E){let X=f[E],Y=f[E+1],Q=m[E],ee=m[E+1];D=VAi(X,Y,Q,ee,w,I,D)}let J=m[T-1];I[D++]=Re.floatToByte(J.red),I[D++]=Re.floatToByte(J.green),I[D++]=Re.floatToByte(J.blue),I[D++]=Re.floatToByte(J.alpha)}}else{M=A?T*2-2:T,S=new Float64Array(M*3),I=N(m)?new Uint8Array(M*4):void 0;let k=0,U=0;for(E=0;E<T;++E){let G=f[E];if(A&&E>0&&(H.pack(G,S,k),k+=3,P=m[E-1],I[U++]=Re.floatToByte(P.red),I[U++]=Re.floatToByte(P.green),I[U++]=Re.floatToByte(P.blue),I[U++]=Re.floatToByte(P.alpha)),A&&E===T-1)break;H.pack(G,S,k),k+=3,N(m)&&(P=m[E],I[U++]=Re.floatToByte(P.red),I[U++]=Re.floatToByte(P.green),I[U++]=Re.floatToByte(P.blue),I[U++]=Re.floatToByte(P.alpha))}}let L=new Oc;L.position=new en({componentDatatype:Rt.DOUBLE,componentsPerAttribute:3,values:S}),N(m)&&(L.color=new en({componentDatatype:Rt.UNSIGNED_BYTE,componentsPerAttribute:4,values:I,normalize:!0})),M=S.length/3;let R=(M-1)*2,O=ro.createTypedArray(M,R),F=0;for(E=0;E<M-1;++E)O[F++]=E,O[F++]=E+1;return new ga({attributes:L,indices:O,primitiveType:Fn.LINES,boundingSphere:Pi.fromPoints(f)})};var ent=Sj;function tU(o){let f=Z(o.radius,1),m={radii:new H(f,f,f),stackPartitions:o.stackPartitions,slicePartitions:o.slicePartitions,vertexFormat:o.vertexFormat};this._ellipsoidGeometry=new V0(m),this._workerName="createSphereGeometry"}tU.packedLength=V0.packedLength;tU.pack=function(o,f,m){return V0.pack(o._ellipsoidGeometry,f,m)};var HAi=new V0,pR={radius:void 0,radii:new H,vertexFormat:new un,stackPartitions:void 0,slicePartitions:void 0};tU.unpack=function(o,f,m){let v=V0.unpack(o,f,HAi);return pR.vertexFormat=un.clone(v._vertexFormat,pR.vertexFormat),pR.stackPartitions=v._stackPartitions,pR.slicePartitions=v._slicePartitions,N(m)?(H.clone(v._radii,pR.radii),m._ellipsoidGeometry=new V0(pR),m):(pR.radius=v._radii.x,new tU(pR))};tU.createGeometry=function(o){return V0.createGeometry(o._ellipsoidGeometry)};var tnt=tU;function SO(o){}Object.defineProperties(SO.prototype,{ellipsoid:{get:li.throwInstantiationError},rectangle:{get:li.throwInstantiationError},projection:{get:li.throwInstantiationError}});SO.prototype.getNumberOfXTilesAtLevel=li.throwInstantiationError;SO.prototype.getNumberOfYTilesAtLevel=li.throwInstantiationError;SO.prototype.rectangleToNativeRectangle=li.throwInstantiationError;SO.prototype.tileXYToNativeRectangle=li.throwInstantiationError;SO.prototype.tileXYToRectangle=li.throwInstantiationError;SO.prototype.positionToTileXY=li.throwInstantiationError;var int=SO;function Q5(o){o=Z(o,Z.EMPTY_OBJECT),this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=o.clock,this.element=o.element,this.epoch=Z(o.epoch,Hn.MINIMUM_VALUE),this.tolerance=Z(o.tolerance,1),this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(Q5.prototype,{clock:{get:function(){return this._clock},set:function(o){let f=this._clock;f!==o&&(N(f)&&(this._clockSubscription(),this._clockSubscription=void 0),N(o)&&(this._clockSubscription=o.onTick.addEventListener(Q5.prototype._onTick,this)),this._clock=o)}},element:{get:function(){return this._element},set:function(o){let f=this._element;f!==o&&(N(f)&&f.removeEventListener("seeked",this._seekFunction,!1),N(o)&&(this._seeking=!1,this._seekFunction=UAi(this),o.addEventListener("seeked",this._seekFunction,!1)),this._element=o,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Q5.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,kr(this)};Q5.prototype.isDestroyed=function(){return!1};Q5.prototype._trySetPlaybackRate=function(o){if(this._lastPlaybackRate===o.multiplier)return;let f=this._element;try{f.playbackRate=o.multiplier}catch{f.playbackRate=0}this._lastPlaybackRate=o.multiplier};Q5.prototype._onTick=function(o){let f=this._element;if(!N(f)||f.readyState<2)return;let m=f.paused,v=o.shouldAnimate;if(v===m&&(v?f.play():f.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(o);let y=o.currentTime,x=Z(this.epoch,Hn.MINIMUM_VALUE),C=ci.secondsDifference(y,x),w=f.duration,A,E=f.currentTime;f.loop?(C=C%w,C<0&&(C=w-C),A=C):C>w?A=w:C<0?A=0:A=C;let T=v?Z(this.tolerance,1):.001;Math.abs(A-E)>T&&(this._seeking=!0,f.currentTime=A)};function UAi(o){return function(){o._seeking=!1,o._firstTickAfterSeek=!0}}var rnt=Q5;function GAi(o,f){this.rectangle=o,this.maxLevel=f}function w2e(o){this.ellipsoid=Z(o.ellipsoid,ki.WGS84),this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}w2e.prototype.build=function(o){o._tilingScheme=this.tilingScheme,o._heightmapWidth=this.heightmapWidth,o._heightmapHeight=this.heightmapHeight,o._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,o._rectangles=this.rectangles,o._ready=!0};function WAi(o,f){let m=f.getElementsByTagName("SRS")[0].textContent;if(m==="EPSG:4326")o.tilingScheme=new Bd({ellipsoid:o.ellipsoid});else throw new sr(`SRS ${m} is not supported`);let v=f.getElementsByTagName("TileFormat")[0];o.heightmapWidth=parseInt(v.getAttribute("width"),10),o.heightmapHeight=parseInt(v.getAttribute("height"),10),o.levelZeroMaximumGeometricError=Rv.getEstimatedLevelZeroGeometricErrorForAHeightmap(o.ellipsoid,Math.min(o.heightmapWidth,o.heightmapHeight),o.tilingScheme.getNumberOfXTilesAtLevel(0));let y=f.getElementsByTagName("DataExtent");for(let x=0;x<y.length;++x){let C=y[x],w=xe.toRadians(parseFloat(C.getAttribute("minx"))),A=xe.toRadians(parseFloat(C.getAttribute("miny"))),E=xe.toRadians(parseFloat(C.getAttribute("maxx"))),T=xe.toRadians(parseFloat(C.getAttribute("maxy"))),S=parseInt(C.getAttribute("maxlevel"),10);o.rectangles.push(new GAi(new Di(w,A,E,T),S))}}function jAi(o,f,m){let v=`An error occurred while accessing ${o.url}`;throw N(f)&&N(f.message)&&(v=`${v}: ${f.message}`),ld.reportError(void 0,m,N(m)?m._errorEvent:void 0,v),new sr(v)}async function nnt(o,f,m){try{let v=await f.fetchXML();WAi(o,v)}catch(v){jAi(f,v,m)}}function Y3(o){o=Z(o,Z.EMPTY_OBJECT),this._errorEvent=new Br,this._ready=!1,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let f=o.credit;if(typeof f=="string"&&(f=new Cs(f)),this._credit=f,this._tilingScheme=void 0,this._rectangles=[],N(o.url)){mi("VRTheWorldTerrainProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. VRTheWorldTerrainProvider.fromUrl instead.");let m=this,v=new w2e(o),y=Jr.createIfNeeded(o.url);this._resource=y,this._readyPromise=nnt(v,y,m).then(()=>(v.build(m),!0))}}Object.defineProperties(Y3.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return mi("VRTheWorldTerrainProvider.ready","VRTheWorldTerrainProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._ready}},readyPromise:{get:function(){return mi("VRTheWorldTerrainProvider.readyPromise","VRTheWorldTerrainProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use VRTheWorldTerrainProvider.fromUrl instead."),this._readyPromise}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Y3.fromUrl=async function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=new w2e(f),v=Jr.createIfNeeded(o);await nnt(m,v);let y=new Y3(f);return m.build(y),y._resource=v,y};Y3.prototype.requestTileGeometry=function(o,f,m,v){let y=this._tilingScheme.getNumberOfYTilesAtLevel(m),x=this._resource.getDerivedResource({url:`${m}/${o}/${y-f-1}.tif`,queryParameters:{cesium:!0},request:v}).fetchImage({preferImageBitmap:!0});if(!N(x))return;let C=this;return Promise.resolve(x).then(function(w){return new wT({buffer:w5(w),width:C._heightmapWidth,height:C._heightmapHeight,childTileMask:YAi(C,o,f,m),structure:C._terrainDataStructure})})};Y3.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)};var ont=new Di;function YAi(o,f,m,v){let y=o._tilingScheme,x=o._rectangles,C=y.tileXYToRectangle(f,m,v),w=0;for(let A=0;A<x.length&&w!==15;++A){let E=x[A];if(E.maxLevel<=v)continue;let T=E.rectangle,S=Di.intersection(T,C,ont);N(S)&&(o$(y,T,f*2,m*2,v+1)&&(w|=4),o$(y,T,f*2+1,m*2,v+1)&&(w|=8),o$(y,T,f*2,m*2+1,v+1)&&(w|=1),o$(y,T,f*2+1,m*2+1,v+1)&&(w|=2))}return w}function o$(o,f,m,v,y){let x=o.tileXYToRectangle(m,v,y);return N(Di.intersection(x,f,ont))}Y3.prototype.getTileDataAvailable=function(o,f,m){};Y3.prototype.loadTileDataAvailability=function(o,f,m){};var ant=Y3,qAi={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},snt=Object.freeze(qAi);function XAi(o){switch(o){case xi.FLOAT:return"float";case xi.FLOAT_VEC2:return"vec2";case xi.FLOAT_VEC3:return"vec3";case xi.FLOAT_VEC4:return"vec4";case xi.FLOAT_MAT2:return"mat2";case xi.FLOAT_MAT3:return"mat3";case xi.FLOAT_MAT4:return"mat4";case xi.SAMPLER_2D:return"sampler2D";case xi.BOOL:return"bool"}}var lnt=XAi;function JAi(o,f,m){return function(){m.apply(o,arguments),f.apply(o,arguments)}}var A2e=JAi,KAi=new H(1,1,1);function E2e(o){o=Z(o,KAi),this._dimensions=H.clone(o)}Object.defineProperties(E2e.prototype,{dimensions:{get:function(){return this._dimensions},set:function(o){H.clone(o,this._dimensions)}}});var QAi=new H;E2e.prototype.emit=function(o){let f=this._dimensions,m=H.multiplyByScalar(f,.5,QAi),v=xe.randomBetween(-m.x,m.x),y=xe.randomBetween(-m.y,m.y),x=xe.randomBetween(-m.z,m.z);o.position=H.fromElements(v,y,x,o.position),o.velocity=H.normalize(o.position,o.velocity)};var eae=E2e,T2e=`// See Intersection.glsl for the definition of intersectScene // See IntersectionUtils.glsl for the definition of nextIntersection // See convertUvToBox.glsl, convertUvToCylinder.glsl, or convertUvToEllipsoid.glsl // for the definition of convertUvToShapeUvSpace. The appropriate function is // selected based on the VoxelPrimitive shape type, and added to the shader in // Scene/VoxelRenderResources.js. // See Octree.glsl for the definitions of TraversalData, SampleData, // traverseOctreeFromBeginning, and traverseOctreeFromExisting // See Megatexture.glsl for the definition of accumulatePropertiesFromMegatexture #define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops #define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0 uniform mat3 u_transformDirectionViewToLocal; uniform vec3 u_cameraPositionUv; uniform float u_stepSize; #if defined(PICKING) uniform vec4 u_pickColor; #endif #if defined(JITTER) float hash(vec2 p) { vec3 p3 = fract(vec3(p.xyx) * 50.0); // magic number = hashscale p3 += dot(p3, p3.yzx + 19.19); return fract((p3.x + p3.y) * p3.z); } #endif vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection) { #if defined(SHAPE_BOX) Box voxelBox = constructVoxelBox(sampleData.tileCoords, sampleData.tileUv); RayShapeIntersection voxelIntersection = intersectBox(viewRay, voxelBox); vec4 entry = shapeIntersection.entry.w >= voxelIntersection.entry.w ? shapeIntersection.entry : voxelIntersection.entry; float exit = min(voxelIntersection.exit.w, shapeIntersection.exit.w); float dt = (exit - entry.w) * RAY_SCALE; return vec4(normalize(entry.xyz), dt); #else float dimAtLevel = pow(2.0, float(sampleData.tileCoords.w)); return vec4(viewRay.dir, u_stepSize / dimAtLevel); #endif } void main() { vec4 fragCoord = gl_FragCoord; vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw; // [0,1] vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz); vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection); // normalize again just in case vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection); // normalize again just in case vec3 viewPosUv = u_cameraPositionUv; #if defined(SHAPE_BOX) vec3 dInv = 1.0 / viewDirUv; Ray viewRayUv = Ray(viewPosUv, viewDirUv, dInv); #else Ray viewRayUv = Ray(viewPosUv, viewDirUv); #endif Intersections ix; RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix); // Exit early if the scene was completely missed. if (shapeIntersection.entry.w == NO_HIT) { discard; } float currT = shapeIntersection.entry.w * RAY_SCALE; float endT = shapeIntersection.exit.w; vec3 positionUv = viewPosUv + currT * viewDirUv; vec3 positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); // Traverse the tree from the start position TraversalData traversalData; SampleData sampleDatas[SAMPLE_COUNT]; traverseOctreeFromBeginning(positionUvShapeSpace, traversalData, sampleDatas); vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); #if defined(JITTER) float noise = hash(screenCoord); // [0,1] currT += noise * step.w; positionUv += noise * step.w * viewDirUv; #endif FragmentInput fragmentInput; #if defined(STATISTICS) setStatistics(fragmentInput.metadata.statistics); #endif vec4 colorAccum =vec4(0.0); for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) { // Read properties from the megatexture based on the traversal state Properties properties = accumulatePropertiesFromMegatexture(sampleDatas); // Prepare the custom shader inputs copyPropertiesToMetadata(properties, fragmentInput.metadata); fragmentInput.voxel.positionUv = positionUv; fragmentInput.voxel.positionShapeUv = positionUvShapeSpace; fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv; fragmentInput.voxel.viewDirUv = viewDirUv; fragmentInput.voxel.viewDirWorld = viewDirWorld; fragmentInput.voxel.surfaceNormal = step.xyz; fragmentInput.voxel.travelDistance = step.w; // Run the custom shader czm_modelMaterial materialOutput; fragmentMain(fragmentInput, materialOutput); // Sanitize the custom shader output vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha); color.rgb = max(color.rgb, vec3(0.0)); color.a = clamp(color.a, 0.0, 1.0); // Pre-multiplied alpha blend colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a); // Stop traversing if the alpha has been fully saturated if (colorAccum.a > ALPHA_ACCUM_MAX) { colorAccum.a = ALPHA_ACCUM_MAX; break; } if (step.w == 0.0) { // Shape is infinitely thin. The ray may have hit the edge of a // foreground voxel. Step ahead slightly to check for more voxels step.w == 0.00001; } // Keep raymarching currT += step.w; positionUv += step.w * viewDirUv; // Check if there's more intersections. if (currT > endT) { #if (INTERSECTION_COUNT == 1) break; #else shapeIntersection = nextIntersection(ix); if (shapeIntersection.entry.w == NO_HIT) { break; } else { // Found another intersection. Resume raymarching there currT = shapeIntersection.entry.w * RAY_SCALE; endT = shapeIntersection.exit.w; positionUv = viewPosUv + currT * viewDirUv; } #endif } // Traverse the tree from the current ray position. // This is similar to traverseOctreeFromBeginning but is faster when the ray is in the same tile as the previous step. positionUvShapeSpace = convertUvToShapeUvSpace(positionUv); traverseOctreeFromExisting(positionUvShapeSpace, traversalData, sampleDatas); step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection); } // Convert the alpha from [0,ALPHA_ACCUM_MAX] to [0,1] colorAccum.a /= ALPHA_ACCUM_MAX; #if defined(PICKING) // If alpha is 0.0 there is nothing to pick if (colorAccum.a == 0.0) { discard; } out_FragColor = u_pickColor; #else out_FragColor = colorAccum; #endif } `,S2e=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; void main() { vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw; vec2 translation = 0.5 * (aabbMax + aabbMin); vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } `,P2e=`/* Intersection defines #define INTERSECTION_COUNT ### */ #define NO_HIT (-czm_infinity) #define INF_HIT (czm_infinity * 0.5) #define RAY_SHIFT (0.000003163) #define RAY_SCALE (1.003163) struct Ray { vec3 pos; vec3 dir; #if defined(SHAPE_BOX) vec3 dInv; #endif }; struct RayShapeIntersection { vec4 entry; vec4 exit; }; struct Intersections { // Don't access these member variables directly - call the functions instead. // Store an array of ray-surface intersections. Each intersection is composed of: // .xyz for the surface normal at the intersection point // .w for the T value // The scale of the normal encodes the shape intersection type: // length(intersection.xyz) = 1: positive shape entry // length(intersection.xyz) = 2: positive shape exit // length(intersection.xyz) = 3: negative shape entry // length(intersection.xyz) = 4: negative shape exit // INTERSECTION_COUNT is the number of ray-*shape* (volume) intersections, // so we need twice as many to track ray-*surface* intersections vec4 intersections[INTERSECTION_COUNT * 2]; #if (INTERSECTION_COUNT > 1) // Maintain state for future nextIntersection calls int index; int surroundCount; bool surroundIsPositive; #endif }; RayShapeIntersection getFirstIntersection(in Intersections ix) { return RayShapeIntersection(ix.intersections[0], ix.intersections[1]); } vec4 encodeIntersectionType(vec4 intersection, int index, bool entry) { float scale = float(index > 0) * 2.0 + float(!entry) + 1.0; return vec4(intersection.xyz * scale, intersection.w); } // Use defines instead of real functions because WebGL1 cannot access array with non-constant index. #define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t)) #define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y) #define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection) (ix).intersections[(index)] = intersection; #define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false) #if (INTERSECTION_COUNT > 1) void initializeIntersections(inout Intersections ix) { // Sort the intersections from min T to max T with bubble sort. // Note: If this sorting function changes, some of the intersection test may // need to be updated. Search for "bubble sort" to find those areas. const int sortPasses = INTERSECTION_COUNT * 2 - 1; for (int n = sortPasses; n > 0; --n) { for (int i = 0; i < sortPasses; ++i) { // The loop should be: for (i = 0; i < n; ++i) {...} but WebGL1 cannot // loop with non-constant condition, so it has to break early instead if (i >= n) { break; } vec4 intersect0 = ix.intersections[i + 0]; vec4 intersect1 = ix.intersections[i + 1]; bool inOrder = intersect0.w <= intersect1.w; ix.intersections[i + 0] = inOrder ? intersect0 : intersect1; ix.intersections[i + 1] = inOrder ? intersect1 : intersect0; } } // Prepare initial state for nextIntersection ix.index = 0; ix.surroundCount = 0; ix.surroundIsPositive = false; } #endif #if (INTERSECTION_COUNT > 1) RayShapeIntersection nextIntersection(inout Intersections ix) { vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT); RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection); const int passCount = INTERSECTION_COUNT * 2; if (ix.index == passCount) { return shapeIntersection; } for (int i = 0; i < passCount; ++i) { // The loop should be: for (i = ix.index; i < passCount; ++i) {...} but WebGL1 cannot // loop with non-constant condition, so it has to continue instead. if (i < ix.index) { continue; } ix.index = i + 1; surfaceIntersection = ix.intersections[i]; int intersectionType = int(length(surfaceIntersection.xyz) - 0.5); bool currShapeIsPositive = intersectionType < 2; bool enter = intMod(intersectionType, 2) == 0; ix.surroundCount += enter ? +1 : -1; ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive; // entering positive or exiting negative if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) { shapeIntersection.entry = surfaceIntersection; } // exiting positive or entering negative after being inside positive bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0; bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive; if (exitPositive || enterNegativeFromPositive) { shapeIntersection.exit = surfaceIntersection; // entry and exit have been found, so the loop can stop if (exitPositive) { // After exiting positive shape there is nothing left to intersect, so jump to the end index. ix.index = passCount; } break; } } return shapeIntersection; } #endif // NOTE: initializeIntersections, nextIntersection aren't even declared unless INTERSECTION_COUNT > 1 `,I2e=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, // setIntersectionPair, INF_HIT, NO_HIT /* intersectDepth defines (set in Scene/VoxelRenderResources.js) #define DEPTH_INTERSECTION_INDEX ### */ uniform mat4 u_transformPositionViewToUv; void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); if (logDepthOrDepth != 0.0) { // Calculate how far the ray must travel before it hits the depth buffer. vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth); eyeCoordinateDepth /= eyeCoordinateDepth.w; vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth); float t = dot(depthPositionUv - ray.pos, ray.dir); setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT)); } else { // There's no depth at this location. setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT)); } } `,M2e=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, INF_HIT, // NO_HIT, setIntersectionPair /* Clipping plane defines (set in Scene/VoxelRenderResources.js) #define CLIPPING_PLANES_UNION #define CLIPPING_PLANES_COUNT #define CLIPPING_PLANES_INTERSECTION_INDEX */ uniform sampler2D u_clippingPlanesTexture; uniform mat4 u_clippingPlanesMatrix; // Plane is in Hessian Normal Form vec4 intersectPlane(in Ray ray, in vec4 plane) { vec3 n = plane.xyz; // normal float w = plane.w; // -dot(pointOnPlane, normal) float a = dot(ray.pos, n); float b = dot(ray.dir, n); float t = -(w + a) / b; return vec4(n, t); } void intersectClippingPlanes(in Ray ray, inout Intersections ix) { vec4 backSide = vec4(-ray.dir, -INF_HIT); vec4 farSide = vec4(ray.dir, +INF_HIT); RayShapeIntersection clippingVolume; #if (CLIPPING_PLANES_COUNT == 1) // Union and intersection are the same when there's one clipping plane, and the code // is more simplified. vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix); vec4 intersection = intersectPlane(ray, planeUv); bool reflects = dot(ray.dir, intersection.xyz) < 0.0; clippingVolume.entry = reflects ? backSide : intersection; clippingVolume.exit = reflects ? intersection : farSide; setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #elif defined(CLIPPING_PLANES_UNION) vec4 firstTransmission = vec4(ray.dir, +INF_HIT); vec4 lastReflection = vec4(-ray.dir, -INF_HIT); for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); vec4 intersection = intersectPlane(ray, planeUv); if (dot(ray.dir, planeUv.xyz) > 0.0) { firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission; } else { lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection; } } clippingVolume.entry = backSide; clippingVolume.exit = lastReflection; setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume); clippingVolume.entry = firstTransmission; clippingVolume.exit = farSide; setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume); #else // intersection vec4 lastTransmission = vec4(ray.dir, -INF_HIT); vec4 firstReflection = vec4(-ray.dir, +INF_HIT); for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) { vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix); vec4 intersection = intersectPlane(ray, planeUv); if (dot(ray.dir, planeUv.xyz) > 0.0) { lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission; } else { firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection; } } if (lastTransmission.w < firstReflection.w) { clippingVolume.entry = lastTransmission; clippingVolume.exit = firstReflection; } else { clippingVolume.entry = vec4(-ray.dir, NO_HIT); clippingVolume.exit = vec4(ray.dir, NO_HIT); } setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #endif } `,D2e=`// See IntersectionUtils.glsl for the definitions of Ray and NO_HIT // See convertUvToBox.glsl for the definition of convertShapeUvToUvSpace /* Box defines (set in Scene/VoxelBoxShape.js) #define BOX_INTERSECTION_INDEX ### // always 0 */ uniform vec3 u_renderMinBounds; uniform vec3 u_renderMaxBounds; struct Box { vec3 p0; vec3 p1; }; Box constructVoxelBox(in ivec4 octreeCoords, in vec3 tileUv) { // Find the min/max cornerpoints of the voxel in tile coordinates vec3 tileOrigin = vec3(octreeCoords.xyz); vec3 numSamples = vec3(u_dimensions); vec3 voxelSize = 1.0 / numSamples; vec3 coordP0 = floor(tileUv * numSamples) * voxelSize + tileOrigin; vec3 coordP1 = coordP0 + voxelSize; // Transform to the UV coordinates of the scaled tileset float tileSize = 1.0 / pow(2.0, float(octreeCoords.w)); vec3 p0 = convertShapeUvToUvSpace(coordP0 * tileSize); vec3 p1 = convertShapeUvToUvSpace(coordP1 * tileSize); return Box(p0, p1); } vec3 getBoxNormal(in Box box, in Ray ray, in float t) { vec3 hitPoint = ray.pos + t * ray.dir; vec3 lower = step(hitPoint, box.p0); vec3 upper = step(box.p1, hitPoint); return normalize(upper - lower); } // Find the distances along a ray at which the ray intersects an axis-aligned box // See https://tavianator.com/2011/ray_box.html RayShapeIntersection intersectBox(in Ray ray, in Box box) { // Consider the box as the intersection of the space between 3 pairs of parallel planes // Compute the distance along the ray to each plane vec3 t0 = (box.p0 - ray.pos) * ray.dInv; vec3 t1 = (box.p1 - ray.pos) * ray.dInv; // Identify candidate entries/exits based on distance from ray.pos vec3 entries = min(t0, t1); vec3 exits = max(t0, t1); // The actual box intersection points are the furthest entry and the closest exit float entryT = max(max(entries.x, entries.y), entries.z); float exitT = min(min(exits.x, exits.y), exits.z); vec3 entryNormal = getBoxNormal(box, ray, entryT - RAY_SHIFT); vec3 exitNormal = getBoxNormal(box, ray, exitT + RAY_SHIFT); if (entryT > exitT) { entryT = NO_HIT; exitT = NO_HIT; } return RayShapeIntersection(vec4(entryNormal, entryT), vec4(exitNormal, exitT)); } void intersectShape(in Ray ray, inout Intersections ix) { RayShapeIntersection intersection = intersectBox(ray, Box(u_renderMinBounds, u_renderMaxBounds)); setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } `,L2e=`// See IntersectionUtils.glsl for the definitions of Ray, setIntersection, // setIntersectionPair /* Cylinder defines (set in Scene/VoxelCylinderShape.js) #define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN #define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX #define CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT #define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT #define CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF #define CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED #define CYLINDER_INTERSECTION_INDEX_RADIUS_MAX #define CYLINDER_INTERSECTION_INDEX_RADIUS_MIN #define CYLINDER_INTERSECTION_INDEX_ANGLE */ // Cylinder uniforms #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) uniform vec3 u_cylinderUvToRenderBoundsScale; uniform vec3 u_cylinderUvToRenderBoundsTranslate; #endif #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) && !defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) uniform float u_cylinderUvToRenderRadiusMin; #endif #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) uniform vec2 u_cylinderRenderAngleMinMax; #endif vec4 intersectHalfPlane(Ray ray, float angle) { vec2 o = ray.pos.xy; vec2 d = ray.dir.xy; vec2 planeDirection = vec2(cos(angle), sin(angle)); vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); float a = dot(o, planeNormal); float b = dot(d, planeNormal); float t = -a / b; vec2 p = o + t * d; bool outside = dot(p, planeDirection) < 0.0; if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); return vec4(-INF_HIT, t, t, +INF_HIT); } #define POSITIVE_HIT vec2(t, +INF_HIT); #define NEGATIVE_HIT vec2(-INF_HIT, t); vec2 intersectHalfSpace(Ray ray, float angle) { vec2 o = ray.pos.xy; vec2 d = ray.dir.xy; vec2 n = vec2(sin(angle), -cos(angle)); float a = dot(o, n); float b = dot(d, n); float t = -a / b; float s = sign(a); // Half space cuts right through the camera, pick the side to intersect if (a == 0.0) { if (b >= 0.0) { return POSITIVE_HIT; } else { return NEGATIVE_HIT; } } if (t >= 0.0 != s >= 0.0) { return POSITIVE_HIT; } else { return NEGATIVE_HIT; } } vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) { vec2 o = ray.pos.xy; vec2 d = ray.dir.xy; vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); float a1 = dot(o, n1); float a2 = dot(o, n2); float b1 = dot(d, n1); float b2 = dot(d, n2); float t1 = -a1 / b1; float t2 = -a2 / b2; float s1 = sign(a1); float s2 = sign(a2); float tmin = min(t1, t2); float tmax = max(t1, t2); float smin = tmin == t1 ? s1 : s2; float smax = tmin == t1 ? s2 : s1; bool e = tmin >= 0.0; bool f = tmax >= 0.0; bool g = smin >= 0.0; bool h = smax >= 0.0; if (e != g && f == h) return vec2(tmin, tmax); else if (e == g && f == h) return vec2(-INF_HIT, tmin); else if (e != g && f != h) return vec2(tmax, +INF_HIT); else return vec2(NO_HIT); } vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) { vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); return vec4(planeIntersectMin, planeIntersectMax); } vec2 intersectUnitCylinder(Ray ray) { vec3 o = ray.pos; vec3 d = ray.dir; float a = dot(d.xy, d.xy); float b = dot(o.xy, d.xy); float c = dot(o.xy, o.xy) - 1.0; float det = b * b - a * c; if (det < 0.0) { return vec2(NO_HIT); } det = sqrt(det); float ta = (-b - det) / a; float tb = (-b + det) / a; float t1 = min(ta, tb); float t2 = max(ta, tb); float z1 = o.z + t1 * d.z; float z2 = o.z + t2 * d.z; if (abs(z1) >= 1.0) { float tCap = (sign(z1) - o.z) / d.z; t1 = abs(b + a * tCap) < det ? tCap : NO_HIT; } if (abs(z2) >= 1.0) { float tCap = (sign(z2) - o.z) / d.z; t2 = abs(b + a * tCap) < det ? tCap : NO_HIT; } return vec2(t1, t2); } vec2 intersectUnitCircle(Ray ray) { vec3 o = ray.pos; vec3 d = ray.dir; float t = -o.z / d.z; vec2 zPlanePos = o.xy + d.xy * t; float distSqr = dot(zPlanePos, zPlanePos); if (distSqr > 1.0) { return vec2(NO_HIT); } return vec2(t, t); } vec2 intersectInfiniteUnitCylinder(Ray ray) { vec3 o = ray.pos; vec3 d = ray.dir; float a = dot(d.xy, d.xy); float b = dot(o.xy, d.xy); float c = dot(o.xy, o.xy) - 1.0; float det = b * b - a * c; if (det < 0.0) { return vec2(NO_HIT); } det = sqrt(det); float t1 = (-b - det) / a; float t2 = (-b + det) / a; float tmin = min(t1, t2); float tmax = max(t1, t2); return vec2(tmin, tmax); } void intersectShape(Ray ray, inout Intersections ix) { #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX) || defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT) ray.pos = ray.pos * u_cylinderUvToRenderBoundsScale + u_cylinderUvToRenderBoundsTranslate; ray.dir *= u_cylinderUvToRenderBoundsScale; #else // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. // Direction is scaled as well to be in sync with position. ray.pos = ray.pos * 2.0 - 1.0; ray.dir *= 2.0; #endif #if defined(CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT) vec2 outerIntersect = intersectUnitCircle(ray); #else vec2 outerIntersect = intersectUnitCylinder(ray); #endif setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect); if (outerIntersect.x == NO_HIT) { return; } #if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT) // When the cylinder is perfectly thin it's necessary to sandwich the // inner cylinder intersection inside the outer cylinder intersection. // Without this special case, // [outerMin, outerMax, innerMin, innerMax] will bubble sort to // [outerMin, innerMin, outerMax, innerMax] which will cause the back // side of the cylinder to be invisible because it will think the ray // is still inside the inner (negative) cylinder after exiting the // outer (positive) cylinder. // With this special case, // [outerMin, innerMin, innerMax, outerMax] will bubble sort to // [outerMin, innerMin, innerMax, outerMax] which will work correctly. // Note: If initializeIntersections() changes its sorting function // from bubble sort to something else, this code may need to change. vec2 innerIntersect = intersectInfiniteUnitCylinder(ray); setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit #elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN) Ray innerRay = Ray(ray.pos * u_cylinderUvToRenderRadiusMin, ray.dir * u_cylinderUvToRenderRadiusMin); vec2 innerIntersect = intersectInfiniteUnitCylinder(innerRay); setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect); #endif #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF) vec2 wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF) vec4 wedgeIntersect = intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax.x, u_cylinderRenderAngleMinMax.y); setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF) vec2 wedgeIntersect = intersectHalfSpace(ray, u_cylinderRenderAngleMinMax.x); setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect); #elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) vec4 wedgeIntersect = intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x); setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersect.xy); setIntersectionPair(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersect.zw); #endif } `,R2e=`// See IntersectionUtils.glsl for the definitions of Ray, Intersections, // setIntersection, setIntersectionPair, INF_HIT, NO_HIT /* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF #define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX #define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN #define ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT #define ELLIPSOID_INTERSECTION_INDEX_LONGITUDE #define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX #define ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN #define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX #define ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN */ #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) uniform vec2 u_ellipsoidRenderLongitudeMinMax; #endif #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) uniform vec2 u_ellipsoidRenderLatitudeCosSqrHalfMinMax; #endif #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) uniform float u_ellipsoidInverseOuterScaleUv; #endif #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) uniform float u_ellipsoidInverseInnerScaleUv; #endif vec2 intersectZPlane(Ray ray) { float o = ray.pos.z; float d = ray.dir.z; float t = -o / d; float s = sign(o); if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); else return vec2(-INF_HIT, t); } vec4 intersectHalfPlane(Ray ray, float angle) { vec2 o = ray.pos.xy; vec2 d = ray.dir.xy; vec2 planeDirection = vec2(cos(angle), sin(angle)); vec2 planeNormal = vec2(planeDirection.y, -planeDirection.x); float a = dot(o, planeNormal); float b = dot(d, planeNormal); float t = -a / b; vec2 p = o + t * d; bool outside = dot(p, planeDirection) < 0.0; if (outside) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); return vec4(-INF_HIT, t, t, +INF_HIT); } vec2 intersectHalfSpace(Ray ray, float angle) { vec2 o = ray.pos.xy; vec2 d = ray.dir.xy; vec2 n = vec2(sin(angle), -cos(angle)); float a = dot(o, n); float b = dot(d, n); float t = -a / b; float s = sign(a); if (t >= 0.0 != s >= 0.0) return vec2(t, +INF_HIT); else return vec2(-INF_HIT, t); } vec2 intersectRegularWedge(Ray ray, float minAngle, float maxAngle) { vec2 o = ray.pos.xy; vec2 d = ray.dir.xy; vec2 n1 = vec2(sin(minAngle), -cos(minAngle)); vec2 n2 = vec2(-sin(maxAngle), cos(maxAngle)); float a1 = dot(o, n1); float a2 = dot(o, n2); float b1 = dot(d, n1); float b2 = dot(d, n2); float t1 = -a1 / b1; float t2 = -a2 / b2; float s1 = sign(a1); float s2 = sign(a2); float tmin = min(t1, t2); float tmax = max(t1, t2); float smin = tmin == t1 ? s1 : s2; float smax = tmin == t1 ? s2 : s1; bool e = tmin >= 0.0; bool f = tmax >= 0.0; bool g = smin >= 0.0; bool h = smax >= 0.0; if (e != g && f == h) return vec2(tmin, tmax); else if (e == g && f == h) return vec2(-INF_HIT, tmin); else if (e != g && f != h) return vec2(tmax, +INF_HIT); else return vec2(NO_HIT); } vec4 intersectFlippedWedge(Ray ray, float minAngle, float maxAngle) { vec2 planeIntersectMin = intersectHalfSpace(ray, minAngle); vec2 planeIntersectMax = intersectHalfSpace(ray, maxAngle + czm_pi); return vec4(planeIntersectMin, planeIntersectMax); } vec2 intersectUnitSphere(Ray ray) { vec3 o = ray.pos; vec3 d = ray.dir; float b = dot(d, o); float c = dot(o, o) - 1.0; float det = b * b - c; if (det < 0.0) { return vec2(NO_HIT); } det = sqrt(det); float t1 = -b - det; float t2 = -b + det; float tmin = min(t1, t2); float tmax = max(t1, t2); return vec2(tmin, tmax); } vec2 intersectUnitSphereUnnormalizedDirection(Ray ray) { vec3 o = ray.pos; vec3 d = ray.dir; float a = dot(d, d); float b = dot(d, o); float c = dot(o, o) - 1.0; float det = b * b - a * c; if (det < 0.0) { return vec2(NO_HIT); } det = sqrt(det); float t1 = (-b - det) / a; float t2 = (-b + det) / a; float tmin = min(t1, t2); float tmax = max(t1, t2); return vec2(tmin, tmax); } vec2 intersectDoubleEndedCone(Ray ray, float cosSqrHalfAngle) { vec3 o = ray.pos; vec3 d = ray.dir; float a = d.z * d.z - dot(d, d) * cosSqrHalfAngle; float b = d.z * o.z - dot(o, d) * cosSqrHalfAngle; float c = o.z * o.z - dot(o, o) * cosSqrHalfAngle; float det = b * b - a * c; if (det < 0.0) { return vec2(NO_HIT); } det = sqrt(det); float t1 = (-b - det) / a; float t2 = (-b + det) / a; float tmin = min(t1, t2); float tmax = max(t1, t2); return vec2(tmin, tmax); } vec4 intersectFlippedCone(Ray ray, float cosSqrHalfAngle) { vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); if (intersect.x == NO_HIT) { return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); } vec3 o = ray.pos; vec3 d = ray.dir; float tmin = intersect.x; float tmax = intersect.y; float zmin = o.z + tmin * d.z; float zmax = o.z + tmax * d.z; // One interval if (zmin < 0.0 && zmax < 0.0) return vec4(-INF_HIT, +INF_HIT, NO_HIT, NO_HIT); else if (zmin < 0.0) return vec4(-INF_HIT, tmax, NO_HIT, NO_HIT); else if (zmax < 0.0) return vec4(tmin, +INF_HIT, NO_HIT, NO_HIT); // Two intervals else return vec4(-INF_HIT, tmin, tmax, +INF_HIT); } vec2 intersectRegularCone(Ray ray, float cosSqrHalfAngle) { vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle); if (intersect.x == NO_HIT) { return vec2(NO_HIT); } vec3 o = ray.pos; vec3 d = ray.dir; float tmin = intersect.x; float tmax = intersect.y; float zmin = o.z + tmin * d.z; float zmax = o.z + tmax * d.z; if (zmin < 0.0 && zmax < 0.0) return vec2(NO_HIT); else if (zmin < 0.0) return vec2(tmax, +INF_HIT); else if (zmax < 0.0) return vec2(-INF_HIT, tmin); else return vec2(tmin, tmax); } void intersectShape(in Ray ray, inout Intersections ix) { // Position is converted from [0,1] to [-1,+1] because shape intersections assume unit space is [-1,+1]. // Direction is scaled as well to be in sync with position. ray.pos = ray.pos * 2.0 - 1.0; ray.dir *= 2.0; #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX) Ray outerRay = Ray(ray.pos * u_ellipsoidInverseOuterScaleUv, ray.dir * u_ellipsoidInverseOuterScaleUv); #else Ray outerRay = ray; #endif // Outer ellipsoid vec2 outerIntersect = intersectUnitSphereUnnormalizedDirection(outerRay); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect); // Exit early if the outer ellipsoid was missed. if (outerIntersect.x == NO_HIT) { return; } // Inner ellipsoid #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT) // When the ellipsoid is perfectly thin it's necessary to sandwich the // inner ellipsoid intersection inside the outer ellipsoid intersection. // Without this special case, // [outerMin, outerMax, innerMin, innerMax] will bubble sort to // [outerMin, innerMin, outerMax, innerMax] which will cause the back // side of the ellipsoid to be invisible because it will think the ray // is still inside the inner (negative) ellipsoid after exiting the // outer (positive) ellipsoid. // With this special case, // [outerMin, innerMin, innerMax, outerMax] will bubble sort to // [outerMin, innerMin, innerMax, outerMax] which will work correctly. // Note: If initializeIntersections() changes its sorting function // from bubble sort to something else, this code may need to change. setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter setIntersection(ix, 1, outerIntersect.x, false, true); // negative, enter setIntersection(ix, 2, outerIntersect.y, false, false); // negative, exit setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN) Ray innerRay = Ray(ray.pos * u_ellipsoidInverseInnerScaleUv, ray.dir * u_ellipsoidInverseInnerScaleUv); vec2 innerIntersect = intersectUnitSphereUnnormalizedDirection(innerRay); if (innerIntersect == vec2(NO_HIT)) { setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect); } else { // When the ellipsoid is very large and thin it's possible for floating // point math to cause the ray to intersect the inner ellipsoid before // the outer ellipsoid. To prevent this from happening, clamp innerIntersect // to outerIntersect and sandwhich the intersections like described above. // // In theory a similar fix is needed for cylinders, however it's more // complicated to implement because the inner shape is allowed to be // intersected first. innerIntersect.x = max(innerIntersect.x, outerIntersect.x); innerIntersect.y = min(innerIntersect.y, outerIntersect.y); setIntersection(ix, 0, outerIntersect.x, true, true); // positive, enter setIntersection(ix, 1, innerIntersect.x, false, true); // negative, enter setIntersection(ix, 2, innerIntersect.y, false, false); // negative, exit setIntersection(ix, 3, outerIntersect.y, true, false); // positive, exit } #endif // Flip the ray because the intersection function expects a cone growing towards +Z. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) Ray flippedRay = outerRay; flippedRay.dir.z *= -1.0; flippedRay.pos.z *= -1.0; #endif // Bottom cone #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF) vec2 bottomConeIntersection = intersectRegularCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF) vec2 bottomConeIntersection = intersectZPlane(flippedRay); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection); #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF) vec4 bottomConeIntersection = intersectFlippedCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.x); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersection.xy); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersection.zw); #endif // Top cone #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF) vec4 topConeIntersection = intersectFlippedCone(flippedRay, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersection.xy); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersection.zw); #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF) vec2 topConeIntersection = intersectZPlane(ray); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF) vec2 topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeCosSqrHalfMinMax.y); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection); #endif // Wedge #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) vec4 wedgeIntersect = intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF) vec2 wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF) vec2 wedgeIntersect = intersectHalfSpace(ray, u_ellipsoidRenderLongitudeMinMax.x); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect); #elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF) vec4 wedgeIntersect = intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax.x, u_ellipsoidRenderLongitudeMinMax.y); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersect.xy); setIntersectionPair(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersect.zw); #endif } `,mW=`// Main intersection function for Voxel scenes. // See IntersectBox.glsl, IntersectCylinder.glsl, or IntersectEllipsoid.glsl // for the definition of intersectShape. The appropriate function is selected // based on the VoxelPrimitive shape type, and added to the shader in // Scene/VoxelRenderResources.js. // See also IntersectClippingPlane.glsl and IntersectDepth.glsl. // See IntersectionUtils.glsl for the definitions of Ray, NO_HIT, // getFirstIntersection, initializeIntersections, nextIntersection. /* Intersection defines (set in Scene/VoxelRenderResources.js) #define INTERSECTION_COUNT ### */ RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) { // Do a ray-shape intersection to find the exact starting and ending points. intersectShape(ray, ix); // Exit early if the positive shape was completely missed or behind the ray. RayShapeIntersection intersection = getFirstIntersection(ix); if (intersection.entry.w == NO_HIT) { // Positive shape was completely missed - so exit early. return intersection; } // Clipping planes #if defined(CLIPPING_PLANES) intersectClippingPlanes(ray, ix); #endif // Depth #if defined(DEPTH_TEST) intersectDepth(screenCoord, ray, ix); #endif // Find the first intersection that's in front of the ray #if (INTERSECTION_COUNT > 1) initializeIntersections(ix); for (int i = 0; i < INTERSECTION_COUNT; ++i) { intersection = nextIntersection(ix); if (intersection.exit.w > 0.0) { // Set start to 0.0 when ray is inside the shape. intersection.entry.w = max(intersection.entry.w, 0.0); break; } } #else // Set start to 0.0 when ray is inside the shape. intersection.entry.w = max(intersection.entry.w, 0.0); #endif return intersection; } `,O2e=`/* Box defines (set in Scene/VoxelBoxShape.js) #define BOX_HAS_SHAPE_BOUNDS */ #if defined(BOX_HAS_SHAPE_BOUNDS) uniform vec3 u_boxUvToShapeUvScale; uniform vec3 u_boxUvToShapeUvTranslate; #endif vec3 convertUvToShapeUvSpace(in vec3 positionUv) { #if defined(BOX_HAS_SHAPE_BOUNDS) return positionUv * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate; #else return positionUv; #endif } vec3 convertShapeUvToUvSpace(in vec3 shapeUv) { #if defined(BOX_HAS_SHAPE_BOUNDS) return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale; #else return shapeUv; #endif } `,N2e=`/* Cylinder defines (set in Scene/VoxelCylinderShape.js) #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS #define CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT #define CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY #define CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED */ #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) uniform vec2 u_cylinderUvToShapeUvRadius; // x = scale, y = offset #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) uniform vec2 u_cylinderUvToShapeUvHeight; // x = scale, y = offset #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) uniform vec2 u_cylinderUvToShapeUvAngle; // x = scale, y = offset #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) uniform vec2 u_cylinderShapeUvAngleMinMax; #endif #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) uniform float u_cylinderShapeUvAngleRangeZeroMid; #endif vec3 convertUvToShapeUvSpace(in vec3 positionUv) { vec3 positionLocal = positionUv * 2.0 - 1.0; // [-1,+1] // Compute radius #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT) float radius = 1.0; #else float radius = length(positionLocal.xy); // [0,1] #if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS) radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y; // x = scale, y = offset #endif #endif // Compute height #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) float height = 1.0; #else float height = positionUv.z; // [0,1] #if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT) height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y; // x = scale, y = offset #endif #endif // Compute angle #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO) float angle = 1.0; #else float angle = (atan(positionLocal.y, positionLocal.x) + czm_pi) / czm_twoPi; // [0,1] #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE) #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED) // Comparing against u_cylinderShapeUvAngleMinMax has precision problems. u_cylinderShapeUvAngleRangeZeroMid is more conservative. angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid); #endif // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. #if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle; #elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle; #endif angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y; // x = scale, y = offset #endif #endif return vec3(radius, height, angle); } `,F2e=`/* Ellipsoid defines (set in Scene/VoxelEllipsoidShape.js) #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY #define ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO #define ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED #define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE #define ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO #define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN #define ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT #define ELLIPSOID_IS_SPHERE */ uniform vec3 u_ellipsoidRadiiUv; // [0,1] #if !defined(ELLIPSOID_IS_SPHERE) uniform vec3 u_ellipsoidInverseRadiiSquaredUv; #endif #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid; #endif #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) uniform vec2 u_ellipsoidUvToShapeUvLongitude; // x = scale, y = offset #endif #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) uniform vec2 u_ellipsoidUvToShapeUvLatitude; // x = scale, y = offset #endif #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) && !defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) uniform float u_ellipsoidInverseHeightDifferenceUv; uniform vec2 u_ellipseInnerRadiiUv; // [0,1] #endif // robust iterative solution without trig functions // https://github.com/0xfaded/ellipse_demo/issues/1 // https://stackoverflow.com/questions/22959698/distance-from-given-point-to-given-ellipse // Pro: Good when radii.x ~= radii.y // Con: Breaks at pos.x ~= 0.0, especially inside the ellipse // Con: Inaccurate with exterior points and thin ellipses float ellipseDistanceIterative (vec2 pos, vec2 radii) { vec2 p = abs(pos); vec2 invRadii = 1.0 / radii; vec2 a = vec2(1.0, -1.0) * (radii.x * radii.x - radii.y * radii.y) * invRadii; vec2 t = vec2(0.70710678118); // sqrt(2) / 2 vec2 v = radii * t; const int iterations = 3; for (int i = 0; i < iterations; ++i) { vec2 e = a * pow(t, vec2(3.0)); vec2 q = normalize(p - e) * length(v - e); t = normalize((q + e) * invRadii); v = radii * t; } return length(v * sign(pos) - pos) * sign(p.y - v.y); } vec3 convertUvToShapeUvSpace(in vec3 positionUv) { // Compute position and normal. // Convert positionUv [0,1] to local space [-1,+1] to "normalized" cartesian space [-a,+a] where a = (radii + height) / (max(radii) + height). // A point on the largest ellipsoid axis would be [-1,+1] and everything else would be smaller. vec3 positionLocal = positionUv * 2.0 - 1.0; #if defined(ELLIPSOID_IS_SPHERE) vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv.x; vec3 normal = normalize(posEllipsoid); #else vec3 posEllipsoid = positionLocal * u_ellipsoidRadiiUv; vec3 normal = normalize(posEllipsoid * u_ellipsoidInverseRadiiSquaredUv); // geodetic surface normal #endif // Compute longitude #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO) float longitude = 1.0; #else float longitude = (atan(normal.y, normal.x) + czm_pi) / czm_twoPi; // Correct the angle when max < min // Technically this should compare against min longitude - but it has precision problems so compare against the middle of empty space. #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED) longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z); #endif // Avoid flickering from reading voxels from both sides of the -pi/+pi discontinuity. #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude; #endif #if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude; #endif #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE) longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y; #endif #endif // Compute latitude #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO) float latitude = 1.0; #else float latitude = (asin(normal.z) + czm_piOverTwo) / czm_pi; #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE) latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y; #endif #endif // Compute height #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT) // TODO: This breaks down when minBounds == maxBounds. To fix it, this // function would have to know if ray is intersecting the front or back of the shape // and set the shape space position to 1 (front) or 0 (back) accordingly. float height = 1.0; #else #if defined(ELLIPSOID_IS_SPHERE) #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) float height = (length(posEllipsoid) - u_ellipseInnerRadiiUv.x) * u_ellipsoidInverseHeightDifferenceUv; #else float height = length(posEllipsoid); #endif #else #if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN) // Convert the 3D position to a 2D position relative to the ellipse (radii.x, radii.z) (assuming radii.x == radii.y which is true for WGS84). // This is an optimization so that math can be done with ellipses instead of ellipsoids. vec2 posEllipse = vec2(length(posEllipsoid.xy), posEllipsoid.z); float height = ellipseDistanceIterative(posEllipse, u_ellipseInnerRadiiUv) * u_ellipsoidInverseHeightDifferenceUv; #else // TODO: this is probably not correct float height = length(posEllipsoid); #endif #endif #endif return vec3(longitude, latitude, height); } `,B2e=`// These octree flags must be in sync with GpuOctreeFlag in VoxelTraversal.js #define OCTREE_FLAG_INTERNAL 0 #define OCTREE_FLAG_LEAF 1 #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 #define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops uniform sampler2D u_octreeInternalNodeTexture; uniform vec2 u_octreeInternalNodeTexelSizeUv; uniform int u_octreeInternalNodeTilesPerRow; #if (SAMPLE_COUNT > 1) uniform sampler2D u_octreeLeafNodeTexture; uniform vec2 u_octreeLeafNodeTexelSizeUv; uniform int u_octreeLeafNodeTilesPerRow; #endif struct OctreeNodeData { int data; int flag; }; struct TraversalData { ivec4 octreeCoords; int parentOctreeIndex; }; struct SampleData { int megatextureIndex; ivec4 tileCoords; vec3 tileUv; #if (SAMPLE_COUNT > 1) float weight; #endif }; // Integer mod: For WebGL1 only int intMod(in int a, in int b) { return a - (b * (a / b)); } int normU8_toInt(in float value) { return int(value * 255.0); } int normU8x2_toInt(in vec2 value) { return int(value.x * 255.0) + 256 * int(value.y * 255.0); } float normU8x2_toFloat(in vec2 value) { return float(normU8x2_toInt(value)) / 65535.0; } OctreeNodeData getOctreeNodeData(in vec2 octreeUv) { vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv); OctreeNodeData data; data.data = normU8x2_toInt(texData.xy); data.flag = normU8x2_toInt(texData.zw); return data; } OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) { int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x; int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex; int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow; vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); return getOctreeNodeData(octreeUv); } int getOctreeParentIndex(in int octreeIndex) { int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9; int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow; vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5); vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv); int parentOctreeIndex = normU8x2_toInt(parentData.xy); return parentOctreeIndex; } /** * Convert a position in the uv-space of the tileset bounding shape * into the uv-space of a tile within the tileset */ vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) { // PERFORMANCE_IDEA: use bit-shifting (only in WebGL2) float dimAtLevel = pow(2.0, float(octreeCoords.w)); return shapePosition * dimAtLevel - vec3(octreeCoords.xyz); } void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) { sampleData.megatextureIndex = data.data; sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT) ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) : octreeCoords; } #if (SAMPLE_COUNT > 1) void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) { int leafIndex = data.data; int leafNodeTexelCount = 2; // Adding 0.5 moves to the center of the texel float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5; float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5; // Get an interpolation weight and a flag to determine whether to read the parent texture vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY); vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0); float lerp = normU8x2_toFloat(leafData0.xy); sampleDatas[0].weight = 1.0 - lerp; sampleDatas[1].weight = lerp; // TODO: this looks wrong? Should be comparing to OCTREE_FLAG_PACKED_LEAF_FROM_PARENT sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1) ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) : octreeCoords; sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1) ? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1) : octreeCoords; // Get megatexture indices for both samples vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY); vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1); sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy); sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw); } #endif OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) { float sizeAtLevel = 1.0 / pow(2.0, float(traversalData.octreeCoords.w)); vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel; vec3 end = start + vec3(sizeAtLevel); OctreeNodeData childData; for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { // Find out which octree child contains the position // 0 if before center, 1 if after vec3 center = 0.5 * (start + end); vec3 childCoord = step(center, shapePosition); // Get octree coords for the next level down ivec4 octreeCoords = traversalData.octreeCoords; traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1); childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord)); if (childData.flag != OCTREE_FLAG_INTERNAL) { // leaf tile - stop traversing break; } // interior tile - keep going deeper start = mix(start, center, childCoord); end = mix(center, end, childCoord); traversalData.parentOctreeIndex = childData.data; } return childData; } /** * Transform a given position to an octree tile coordinate and a position within that tile, * and find the corresponding megatexture index and texture coordinates */ void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) { traversalData.octreeCoords = ivec4(0); traversalData.parentOctreeIndex = 0; OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0)); if (nodeData.flag != OCTREE_FLAG_LEAF) { nodeData = traverseOctreeDownwards(shapePosition, traversalData); } #if (SAMPLE_COUNT == 1) getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); #else getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); #endif } bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) { return clamp(v, minVal, maxVal) == v; } bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) { vec3 tileUv = getTileUv(shapePosition, octreeCoords); bool inside = inRange(tileUv, vec3(0.0), vec3(1.0)); // Assume (!) the position is always inside the root tile. return inside || octreeCoords.w == 0; } void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) { if (insideTile(shapePosition, traversalData.octreeCoords)) { for (int i = 0; i < SAMPLE_COUNT; i++) { sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); } return; } // Go up tree until we find a parent tile containing shapePosition for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) { traversalData.octreeCoords.xyz /= 2; traversalData.octreeCoords.w -= 1; if (insideTile(shapePosition, traversalData.octreeCoords)) { break; } traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex); } // Go down tree OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData); #if (SAMPLE_COUNT == 1) getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]); sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); #else getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas); sampleDatas[0].tileUv = getTileUv(shapePosition, sampleDatas[0].tileCoords); sampleDatas[1].tileUv = getTileUv(shapePosition, sampleDatas[1].tileCoords); #endif } `,k2e=`// See Octree.glsl for the definitions of SampleData and intMod /* Megatexture defines (set in Scene/VoxelRenderResources.js) #define SAMPLE_COUNT ### #define NEAREST_SAMPLING #define PADDING */ uniform ivec2 u_megatextureSliceDimensions; // number of slices per tile, in two dimensions uniform ivec2 u_megatextureTileDimensions; // number of tiles per megatexture, in two dimensions uniform vec2 u_megatextureVoxelSizeUv; uniform vec2 u_megatextureSliceSizeUv; uniform vec2 u_megatextureTileSizeUv; uniform ivec3 u_dimensions; // does not include padding #if defined(PADDING) uniform ivec3 u_paddingBefore; uniform ivec3 u_paddingAfter; #endif // Integer min, max, clamp: For WebGL1 only int intMin(int a, int b) { return a <= b ? a : b; } int intMax(int a, int b) { return a >= b ? a : b; } int intClamp(int v, int minVal, int maxVal) { return intMin(intMax(v, minVal), maxVal); } vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale) { int indexX = intMod(index, dimensions.x); int indexY = index / dimensions.x; return vec2(indexX, indexY) * uvScale; } /* How is 3D data stored in a 2D megatexture? In this example there is only one loaded tile and it has 2x2x2 voxels (8 voxels total). The data is sliced by Z. The data at Z = 0 is placed in texels (0,0), (0,1), (1,0), (1,1) and the data at Z = 1 is placed in texels (2,0), (2,1), (3,0), (3,1). Note that there could be empty space in the megatexture because it's a power of two. 0 1 2 3 +---+---+---+---+ | | | | | 3 +---+---+---+---+ | | | | | 2 +-------+-------+ |010|110|011|111| 1 |--- ---|--- ---| |000|100|001|101| 0 +-------+-------+ When doing linear interpolation the megatexture needs to be sampled twice: once for the Z slice above the voxel coordinate and once for the slice below. The two slices are interpolated with fract(coord.z - 0.5). For example, a Z coordinate of 1.0 is halfway between two Z slices so the interpolation factor is 0.5. Below is a side view of the 3D voxel grid with voxel coordinates on the left side. 2 +---+ |001| 1 +-z-+ |000| 0 +---+ When doing nearest neighbor the megatexture only needs to be sampled once at the closest Z slice. */ Properties getPropertiesFromMegatexture(in SampleData sampleData) { vec3 tileUv = clamp(sampleData.tileUv, vec3(0.0), vec3(1.0)); // TODO is the clamp necessary? int tileIndex = sampleData.megatextureIndex; vec3 voxelCoord = tileUv * vec3(u_dimensions); ivec3 voxelDimensions = u_dimensions; #if defined(PADDING) voxelDimensions += u_paddingBefore + u_paddingAfter; voxelCoord += vec3(u_paddingBefore); #endif #if defined(NEAREST_SAMPLING) // Round to the center of the nearest voxel voxelCoord = floor(voxelCoord) + vec3(0.5); #endif // Tile location vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv); // Slice location float slice = voxelCoord.z - 0.5; int sliceIndex = int(floor(slice)); int sliceIndex0 = intClamp(sliceIndex, 0, voxelDimensions.z - 1); vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); // Voxel location vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(voxelDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv; // Final location in the megatexture vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset; #if defined(NEAREST_SAMPLING) return getPropertiesFromMegatextureAtUv(uv0); #else float sliceLerp = fract(slice); int sliceIndex1 = intMin(sliceIndex + 1, voxelDimensions.z - 1); vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv); vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset; Properties properties0 = getPropertiesFromMegatextureAtUv(uv0); Properties properties1 = getPropertiesFromMegatextureAtUv(uv1); return mixProperties(properties0, properties1, sliceLerp); #endif } // Convert an array of sample datas to a final weighted properties. Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) { #if (SAMPLE_COUNT == 1) return getPropertiesFromMegatexture(sampleDatas[0]); #else // When more than one sample is taken the accumulator needs to start at 0 Properties properties = clearProperties(); for (int i = 0; i < SAMPLE_COUNT; ++i) { float weight = sampleDatas[i].weight; // Avoid reading the megatexture when the weight is 0 as it can be costly. if (weight > 0.0) { Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]); tempProperties = scaleProperties(tempProperties, weight); properties = sumProperties(properties, tempProperties); } } return properties; #endif } `;function ZAi(o){let f=new Ine;this.shaderBuilder=f;let m=o._customShader,v=va(o._uniformMap,m.uniformMap);o._uniformMap=v;let y=m.uniforms;for(let M in y)if(y.hasOwnProperty(M)){let I=y[M];f.addUniform(I.type,M,yr.FRAGMENT)}f.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",yr.FRAGMENT),this.uniformMap=v;let x=o._clippingPlanes,C=N(x)&&x.enabled?x.length:0;this.clippingPlanes=x,this.clippingPlanesLength=C,f.addVertexLines([S2e]),f.addFragmentLines([m.fragmentShaderText,"#line 0",B2e,P2e,k2e]),C>0&&(f.addDefine("CLIPPING_PLANES",void 0,yr.FRAGMENT),f.addDefine("CLIPPING_PLANES_COUNT",C,yr.FRAGMENT),x.unionClippingRegions&&f.addDefine("CLIPPING_PLANES_UNION",void 0,yr.FRAGMENT),f.addFragmentLines([M2e])),o._depthTest&&(f.addDefine("DEPTH_TEST",void 0,yr.FRAGMENT),f.addFragmentLines([I2e]));let w=o._provider.shape;w==="BOX"?(f.addDefine("SHAPE_BOX",void 0,yr.FRAGMENT),f.addFragmentLines([O2e,D2e,mW])):w==="CYLINDER"?f.addFragmentLines([L2e,mW,N2e]):w==="ELLIPSOID"&&f.addFragmentLines([R2e,mW,F2e]),f.addFragmentLines([T2e]);let A=o._shape,E=A.shaderDefines;for(let M in E)if(E.hasOwnProperty(M)){let I=E[M];N(I)&&(I=I===!0?void 0:I,f.addDefine(M,I,yr.FRAGMENT))}let T=A.shaderMaximumIntersectionsLength;C>0&&(f.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",T,yr.FRAGMENT),C===1?T+=1:x.unionClippingRegions?T+=2:T+=1),o._depthTest&&(f.addDefine("DEPTH_INTERSECTION_INDEX",T,yr.FRAGMENT),T+=1),f.addDefine("INTERSECTION_COUNT",T,yr.FRAGMENT),(!H.equals(o.paddingBefore,H.ZERO)||!H.equals(o.paddingAfter,H.ZERO))&&f.addDefine("PADDING",void 0,yr.FRAGMENT),o._useLogDepth&&f.addDefine("LOG_DEPTH_READ_ONLY",void 0,yr.FRAGMENT),o._jitter&&f.addDefine("JITTER",void 0,yr.FRAGMENT),o._nearestSampling&&f.addDefine("NEAREST_SAMPLING",void 0,yr.FRAGMENT);let S=o._traversal;f.addDefine("SAMPLE_COUNT",`${S._sampleCount}`,yr.FRAGMENT)}var V2e=ZAi;function $Ai(o,f){let{shaderBuilder:m}=o,{names:v,types:y,componentTypes:x,minimumValues:C,maximumValues:w}=f._provider,A=y.length,E=N(C)&&N(w);m.addDefine("METADATA_COUNT",A,yr.FRAGMENT),E&&m.addDefine("STATISTICS",void 0,yr.FRAGMENT);for(let q=0;q<A;q++){let J=v[q],X=y[q],Y=`PropertyStatistics_${J}`,Q=`PropertyStatistics_${J}`;m.addStruct(Y,Q,yr.FRAGMENT);let ee=a$(X);m.addStructField(Y,ee,"min"),m.addStructField(Y,ee,"max")}let T="Statistics",S="Statistics",M="statistics";m.addStruct(T,S,yr.FRAGMENT);for(let q=0;q<A;q++){let J=v[q],X=`PropertyStatistics_${J}`,Y=J;m.addStructField(T,X,Y)}let I="Metadata",P="Metadata",D="metadata";m.addStruct(I,P,yr.FRAGMENT),m.addStructField(I,S,M);for(let q=0;q<A;q++){let J=v[q],X=y[q],Y=a$(X);m.addStructField(I,Y,J)}for(let q=0;q<A;q++){let J=v[q],X=y[q],Y=tEi(X),Q=`VoxelProperty_${J}`,ee=`VoxelProperty_${J}`;m.addStruct(Q,ee,yr.FRAGMENT),m.addStructField(Q,Y,"partialDerivativeLocal"),m.addStructField(Q,Y,"partialDerivativeWorld"),m.addStructField(Q,Y,"partialDerivativeView"),m.addStructField(Q,Y,"partialDerivativeValid")}let L="Voxel",R="Voxel",O="voxel";m.addStruct(L,R,yr.FRAGMENT);for(let q=0;q<A;q++){let J=v[q],X=`VoxelProperty_${J}`;m.addStructField(L,X,J)}m.addStructField(L,"vec3","positionEC"),m.addStructField(L,"vec3","positionUv"),m.addStructField(L,"vec3","positionShapeUv"),m.addStructField(L,"vec3","positionUvLocal"),m.addStructField(L,"vec3","viewDirUv"),m.addStructField(L,"vec3","viewDirWorld"),m.addStructField(L,"vec3","surfaceNormal"),m.addStructField(L,"float","travelDistance");let F="FragmentInput",k="FragmentInput";m.addStruct(F,k,yr.FRAGMENT),m.addStructField(F,P,D),m.addStructField(F,R,O);let U="Properties",G="Properties",j="properties";m.addStruct(U,G,yr.FRAGMENT);for(let q=0;q<A;q++){let J=v[q],X=y[q],Y=a$(X);m.addStructField(U,Y,J)}{let q="clearProperties";m.addFunction(q,`${G} clearProperties()`,yr.FRAGMENT),m.addFunctionLines(q,[`${G} ${j};`]);for(let J=0;J<A;J++){let X=v[J],Y=y[J],Q=x[J],ee=a$(Y,Q);m.addFunctionLines(q,[`${j}.${X} = ${ee}(0.0);`])}m.addFunctionLines(q,[`return ${j};`])}{let q="sumProperties";m.addFunction(q,`${G} sumProperties(${G} propertiesA, ${G} propertiesB)`,yr.FRAGMENT),m.addFunctionLines(q,[`${G} ${j};`]);for(let J=0;J<A;J++){let X=v[J];m.addFunctionLines(q,[`${j}.${X} = propertiesA.${X} + propertiesB.${X};`])}m.addFunctionLines(q,[`return ${j};`])}{let q="scaleProperties";m.addFunction(q,`${G} scaleProperties(${G} ${j}, float scale)`,yr.FRAGMENT),m.addFunctionLines(q,[`${G} scaledProperties = ${j};`]);for(let J=0;J<A;J++){let X=v[J];m.addFunctionLines(q,[`scaledProperties.${X} *= scale;`])}m.addFunctionLines(q,["return scaledProperties;"])}{let q="mixProperties";m.addFunction(q,`${G} mixProperties(${G} propertiesA, ${G} propertiesB, float mixFactor)`,yr.FRAGMENT),m.addFunctionLines(q,[`${G} ${j};`]);for(let J=0;J<A;J++){let X=v[J];m.addFunctionLines(q,[`${j}.${X} = mix(propertiesA.${X}, propertiesB.${X}, mixFactor);`])}m.addFunctionLines(q,[`return ${j};`])}{let q="copyPropertiesToMetadata";m.addFunction(q,`void copyPropertiesToMetadata(in ${G} ${j}, inout ${P} ${D})`,yr.FRAGMENT);for(let J=0;J<A;J++){let X=v[J];m.addFunctionLines(q,[`${D}.${X} = ${j}.${X};`])}}if(E){let q="setStatistics";m.addFunction(q,`void setStatistics(inout ${S} ${M})`,yr.FRAGMENT);for(let J=0;J<A;J++){let X=v[J],Y=y[J],Q=Fa.getComponentCount(Y);for(let ee=0;ee<Q;ee++){let z=iEi(Y,ee),ie=C[J][ee],re=w[J][ee];m.addFunctionLines(q,[`${M}.${X}.min${z} = ${b6e(ie)};`,`${M}.${X}.max${z} = ${b6e(re)};`])}}}{let q="getPropertiesFromMegatextureAtUv";m.addFunction(q,`${G} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,yr.FRAGMENT),m.addFunctionLines(q,[`${G} ${j};`]);for(let J=0;J<A;J++){let X=v[J],Y=y[J],Q=x[J],ee=eEi(Y,Q);m.addFunctionLines(q,[`properties.${X} = texture(u_megatextureTextures[${J}], texcoord)${ee};`])}m.addFunctionLines(q,[`return ${j};`])}}function a$(o){if(o===Fa.SCALAR)return"float";if(o===Fa.VEC2)return"vec2";if(o===Fa.VEC3)return"vec3";if(o===Fa.VEC4)return"vec4"}function eEi(o){if(o===Fa.SCALAR)return".r";if(o===Fa.VEC2)return".ra";if(o===Fa.VEC3)return".rgb";if(o===Fa.VEC4)return""}function tEi(o){if(o===Fa.SCALAR)return"vec3";if(o===Fa.VEC2)return"mat2";if(o===Fa.VEC3)return"mat3";if(o===Fa.VEC4)return"mat4"}function b6e(o){let f=o.toString();return f.indexOf(".")===-1&&(f=`${o}.0`),f}function iEi(o,f){return o===Fa.SCALAR?"":`[${f}]`}var z2e=$Ai;function rEi(o,f){let m=new V2e(o);z2e(m,o);let{shaderBuilder:v,clippingPlanes:y,clippingPlanesLength:x}=m;if(x>0){let P="getClippingPlane",D=Iq(y,f),L=0,R=D.indexOf(")")+1,O=D.indexOf("{",R)+1,F=D.indexOf("}",O),k=D.slice(L,R),U=D.slice(O,F);v.addFunction(P,k,yr.FRAGMENT),v.addFunctionLines(P,[U])}let C=v.clone();C.addDefine("PICKING",void 0,yr.FRAGMENT);let w=v.buildShaderProgram(f),A=C.buildShaderProgram(f),E=Mn.fromCache({cull:{enabled:!0,face:uh.BACK},depthTest:{enabled:!1},depthMask:!1,blending:Mu.PRE_MULTIPLIED_ALPHA_BLEND}),T=f.getViewportQuadVertexArray(),S=o._depthTest,M=new Jn({vertexArray:T,primitiveType:Fn.TRIANGLES,renderState:E,shaderProgram:w,uniformMap:m.uniformMap,modelMatrix:o._compoundModelMatrix,pass:vr.VOXELS,executeInClosestFrustum:!0,owner:this,cull:S,occlude:S}),I=Jn.shallowClone(M,new Jn);if(I.shaderProgram=A,I.pickOnly=!0,N(o._drawCommand)){let P=o._drawCommand;P.shaderProgram=P.shaderProgram&&P.shaderProgram.destroy()}if(N(o._drawCommandPick)){let P=o._drawCommandPick;P.shaderProgram=P.shaderProgram&&P.shaderProgram.destroy()}o._drawCommand=M,o._drawCommandPick=I}var H2e=rEi;function vD(){this.featurePropertiesDirty=!1}Object.defineProperties(vD.prototype,{featuresLength:{get:function(){li.throwInstantiationError()}},pointsLength:{get:function(){li.throwInstantiationError()}},trianglesLength:{get:function(){li.throwInstantiationError()}},geometryByteLength:{get:function(){li.throwInstantiationError()}},texturesByteLength:{get:function(){li.throwInstantiationError()}},batchTableByteLength:{get:function(){li.throwInstantiationError()}},innerContents:{get:function(){li.throwInstantiationError()}},ready:{get:function(){li.throwInstantiationError()}},readyPromise:{get:function(){li.throwInstantiationError()}},tileset:{get:function(){li.throwInstantiationError()}},tile:{get:function(){li.throwInstantiationError()}},url:{get:function(){li.throwInstantiationError()}},batchTable:{get:function(){li.throwInstantiationError()}},metadata:{get:function(){li.throwInstantiationError()},set:function(o){li.throwInstantiationError()}},group:{get:function(){li.throwInstantiationError()},set:function(o){li.throwInstantiationError()}}});vD.prototype.hasProperty=function(o,f){li.throwInstantiationError()};vD.prototype.getFeature=function(o){li.throwInstantiationError()};vD.prototype.applyDebugSettings=function(o,f){li.throwInstantiationError()};vD.prototype.applyStyle=function(o){li.throwInstantiationError()};vD.prototype.update=function(o,f){li.throwInstantiationError()};vD.prototype.isDestroyed=function(){li.throwInstantiationError()};vD.prototype.destroy=function(){li.throwInstantiationError()};var unt=vD;function Qq(o){o=Z(o,Z.EMPTY_OBJECT),this._maximumSubtreeCount=Z(o.maximumSubtreeCount,0),this._subtreeRequestCounter=0,this._queue=new Xoe({comparator:Qq.comparator})}Qq.prototype.addSubtree=function(o){let f=new nEi(o,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(f);let m=o.implicitCoordinates;if(m.level>0){let v=m.getParentSubtreeCoordinates(),y=this.find(v)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==f;)this._queue.removeMinimum()};Qq.prototype.find=function(o){let f=this._queue,m=f.internalArray,v=f.length;for(let y=0;y<v;y++){let x=m[y],C=x.subtree.implicitCoordinates;if(o.isEqual(C))return x.subtree}};Qq.comparator=function(o,f){let m=o.subtree.implicitCoordinates,v=f.subtree.implicitCoordinates;return m.isAncestor(v)?1:v.isAncestor(m)?-1:o.stamp-f.stamp};function nEi(o,f){this.subtree=o,this.stamp=f}var U2e=Qq;function rC(){this.orientedBoundingBox=new fc,this.boundingSphere=new Pi,this.boundTransform=new Ee,this.shapeTransform=new Ee,this._minBounds=H.clone(rC.DefaultMinBounds,new H),this._maxBounds=H.clone(rC.DefaultMaxBounds,new H),this.shaderUniforms={renderMinBounds:new H,renderMaxBounds:new H,boxUvToShapeUvScale:new H,boxUvToShapeUvTranslate:new H},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var oEi=new H,e0e=new H,aEi=new Ut,sEi=new H,lEi=new H,uEi=new H,cEi=new H,w6e=Ee.fromRotationTranslation(Ut.fromUniformScale(.5,new Ut),new H(.5,.5,.5),new Ee);rC.prototype.update=function(o,f,m,v,y){v=Z(v,rC.DefaultMinBounds),y=Z(y,rC.DefaultMaxBounds);let x=rC.DefaultMinBounds,C=rC.DefaultMaxBounds;f=this._minBounds=H.clamp(f,x,C,this._minBounds),m=this._maxBounds=H.clamp(m,x,C,this._maxBounds),v=H.clamp(v,x,C,sEi),y=H.clamp(y,x,C,lEi);let w=H.clamp(f,v,y,uEi),A=H.clamp(m,v,y,cEi),E=Ee.getScale(o,e0e);if(w.x>A.x||w.y>A.y||w.z>A.z||(w.x===A.x)+(w.y===A.y)+(w.z===A.z)>=2||v.x>y.x||v.y>y.y||v.z>y.z||E.x===0||E.y===0||E.z===0)return!1;this.shapeTransform=Ee.clone(o,this.shapeTransform),this.orientedBoundingBox=cnt(w,A,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=Ee.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=Pi.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:T,shaderDefines:S}=this;for(let P in S)S.hasOwnProperty(P)&&(S[P]=void 0);let M=!H.equals(f,x)||!H.equals(m,C),I=0;if(S.BOX_INTERSECTION_INDEX=I,I+=1,T.renderMinBounds=Ee.multiplyByPoint(w6e,w,T.renderMinBounds),T.renderMaxBounds=Ee.multiplyByPoint(w6e,A,T.renderMaxBounds),M){S.BOX_HAS_SHAPE_BOUNDS=!0;let P=f,D=m;T.boxUvToShapeUvScale=H.fromElements(2/(P.x===D.x?1:D.x-P.x),2/(P.y===D.y?1:D.y-P.y),2/(P.z===D.z?1:D.z-P.z),T.boxUvToShapeUvScale),T.boxUvToShapeUvTranslate=H.fromElements(-T.boxUvToShapeUvScale.x*(P.x*.5+.5),-T.boxUvToShapeUvScale.y*(P.y*.5+.5),-T.boxUvToShapeUvScale.z*(P.z*.5+.5),T.boxUvToShapeUvTranslate)}return this.shaderMaximumIntersectionsLength=I,!0};var hEi=new H,dEi=new H;rC.prototype.computeOrientedBoundingBoxForTile=function(o,f,m,v,y){let x=this._minBounds,C=this._maxBounds,w=1/Math.pow(2,o),A=H.fromElements(xe.lerp(x.x,C.x,w*f),xe.lerp(x.y,C.y,w*m),xe.lerp(x.z,C.z,w*v),hEi),E=H.fromElements(xe.lerp(x.x,C.x,w*(f+1)),xe.lerp(x.y,C.y,w*(m+1)),xe.lerp(x.z,C.z,w*(v+1)),dEi);return cnt(A,E,this.shapeTransform,y)};rC.prototype.computeApproximateStepSize=function(o){return 1/H.maximumComponent(o)};rC.DefaultMinBounds=Object.freeze(new H(-1,-1,-1));rC.DefaultMaxBounds=Object.freeze(new H(1,1,1));function cnt(o,f,m,v){let y=rC.DefaultMinBounds,x=rC.DefaultMaxBounds;if(H.equals(o,y)&&H.equals(f,x))v.center=Ee.getTranslation(m,v.center),v.halfAxes=Ee.getMatrix3(m,v.halfAxes);else{let C=Ee.getScale(m,e0e),w=H.midpoint(o,f,oEi);v.center=Ee.multiplyByPoint(m,w,v.center),C=H.fromElements(C.x*.5*(f.x-o.x),C.y*.5*(f.y-o.y),C.z*.5*(f.z-o.z),e0e);let A=Ee.getRotation(m,aEi);v.halfAxes=Ut.setScale(A,C,v.halfAxes)}return v}var Z5=rC;function Zte(o){this._resource=o,this._metadataTable=void 0}Object.defineProperties(Zte.prototype,{metadataTable:{get:function(){return this._metadataTable}}});Zte.fromJson=async function(o,f,m,v){let y;N(f)?y={json:f,binary:void 0}:y=pEi(m);let x=await fEi(o,y.json,y.binary),C={},w=y.json.bufferViews.length;for(let S=0;S<w;++S){let M=y.json.bufferViews[S],I=M.byteOffset,P=I+M.byteLength,D=x[M.buffer].subarray(I,P);C[S]=D}let A=y.json.voxelTable,E=y.json.propertyTables[A],T=new Zte(o);return T._metadataTable=new hO({count:E.count,properties:E.properties,class:v.classes[E.class],bufferViews:C}),T};function fEi(o,f,m){let v=f.buffers.length,y=new Array(v);for(let x=0;x<v;x++){let C=f.buffers[x];if(N(C.uri)){let w=o.getDerivedResource({url:C.uri});y[x]=w.fetchArrayBuffer().then(function(A){return new Uint8Array(A)})}else y[x]=Promise.resolve(m)}return Promise.all(y)}function pEi(o){let f=new DataView(o.buffer,o.byteOffset),m=8,v=f.getUint32(m,!0);m+=8;let y=f.getUint32(m,!0);m+=8;let x=E_(o,m,v);m+=v;let C=o.subarray(m,m+y);return{json:x,binary:C}}var G2e=Zte;function $p(){this.orientedBoundingBox=new fc,this.boundingSphere=new Pi,this.boundTransform=new Ee,this.shapeTransform=new Ee,this._minimumRadius=$p.DefaultMinBounds.x,this._maximumRadius=$p.DefaultMaxBounds.x,this._minimumHeight=$p.DefaultMinBounds.y,this._maximumHeight=$p.DefaultMaxBounds.y,this._minimumAngle=$p.DefaultMinBounds.z,this._maximumAngle=$p.DefaultMaxBounds.z,this.shaderUniforms={cylinderUvToRenderBoundsScale:new H,cylinderUvToRenderBoundsTranslate:new H,cylinderUvToRenderRadiusMin:0,cylinderRenderAngleMinMax:new Ye,cylinderUvToShapeUvRadius:new Ye,cylinderUvToShapeUvHeight:new Ye,cylinderUvToShapeUvAngle:new Ye,cylinderShapeUvAngleMinMax:new Ye,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var hnt=new H,mEi=new H,gEi=new H,_Ei=new Ut,vEi=new Ee,yEi=new Ee,xEi=Ee.fromRotationTranslation(Ut.fromUniformScale(2,new Ut),new H(-1,-1,-1),new Ee);$p.prototype.update=function(o,f,m,v,y){v=Z(v,$p.DefaultMinBounds),y=Z(y,$p.DefaultMaxBounds);let x=$p.DefaultMinBounds.x,C=$p.DefaultMaxBounds.x,w=$p.DefaultMinBounds.y,A=$p.DefaultMaxBounds.y,E=$p.DefaultMinBounds.z,T=$p.DefaultMaxBounds.z,S=T-E,M=.5*S,I=xe.EPSILON10,P=xe.EPSILON3,D=xe.EPSILON10,L=xe.clamp(f.x,x,C),R=xe.clamp(m.x,x,C),O=xe.clamp(v.x,x,C),F=xe.clamp(y.x,x,C),k=Math.max(L,O),U=Math.min(R,F),G=xe.clamp(f.y,w,A),j=xe.clamp(m.y,w,A),q=xe.clamp(v.y,w,A),J=xe.clamp(y.y,w,A),X=Math.max(G,q),Y=Math.min(j,J),Q=xe.negativePiToPi(f.z),ee=xe.negativePiToPi(m.z),z=xe.negativePiToPi(v.z),ie=xe.negativePiToPi(y.z),re=Math.max(Q,z),ne=Math.min(ee,ie),oe=Ee.getScale(o,hnt);if(U===0||k>U||X>Y||xe.equalsEpsilon(oe.x,0,void 0,I)||xe.equalsEpsilon(oe.y,0,void 0,I)||xe.equalsEpsilon(oe.z,0,void 0,I))return!1;this._minimumRadius=L,this._maximumRadius=R,this._minimumHeight=G,this._maximumHeight=j,this._minimumAngle=Q,this._maximumAngle=ee,this.shapeTransform=Ee.clone(o,this.shapeTransform),this.orientedBoundingBox=W2e(k,U,X,Y,re,ne,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=Ee.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=Pi.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let se=L===x&&R===C,ae=G===w&&j===A,fe=ee<Q,de=ee-Q+fe*S,ve=de>M+D&&de<S-D,pe=de>D&&de<M-D,ce=de>=M-D&&de<=M+D,he=de<=D,Ce=ve||pe||ce||he,Se=xe.equalsEpsilon(Q,E,void 0,P),De=xe.equalsEpsilon(ee,T,void 0,P),Oe=U===C,Ue=k===x,Xe=X===w&&Y===A,it=ne<re,ut=ne-re+it*S,at=ut>M+D&&ut<S-D,Pt=ut>D&&ut<M-D,Qe=ut>=M-D&&ut<=M+D,ft=ut<=D,Ot=at||Pt||Qe||ft,Xt=this.shaderUniforms,At=this.shaderDefines;for(let gt in At)At.hasOwnProperty(gt)&&(At[gt]=void 0);let bt=0;if(At.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=bt,bt+=1,Ue||(At.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,At.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=bt,bt+=1,Xt.cylinderUvToRenderRadiusMin=U/k),Oe||(At.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MAX=!0),k===U&&(At.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),Xe||(At.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT=!0),X===Y&&(At.CYLINDER_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),G===j&&(At.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0),L===R&&(At.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS_FLAT=!0),!se){At.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let gt=1/(R-L),It=L/(L-R);Xt.cylinderUvToShapeUvRadius=Ye.fromElements(gt,It,Xt.cylinderUvToShapeUvRadius)}if(!ae){At.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let gt=2/(j-G),It=(G+1)/(G-j);Xt.cylinderUvToShapeUvHeight=Ye.fromElements(gt,It,Xt.cylinderUvToShapeUvHeight)}if(!Oe||!Xe){let gt=.5*(Y-X),It=H.fromElements(1/U,1/U,1/(gt===0?1:gt),gEi),Jt=H.fromElements(0,0,-It.z*.5*(X+Y),mEi),bi=Ee.fromRotationTranslation(Ut.fromScale(It,_Ei),Jt,vEi),Yi=Ee.multiplyTransformation(bi,xEi,yEi);Xt.cylinderUvToRenderBoundsScale=Ee.getScale(Yi,Xt.cylinderUvToRenderBoundsScale),Xt.cylinderUvToRenderBoundsTranslate=Ee.getTranslation(Yi,Xt.cylinderUvToRenderBoundsTranslate)}if(fe&&(At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),Ot&&(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,At.CYLINDER_INTERSECTION_INDEX_ANGLE=bt,at?(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,bt+=1):Pt?(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,bt+=2):Qe?(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_HALF=!0,bt+=1):ft&&(At.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,bt+=2),Xt.cylinderRenderAngleMinMax=Ye.fromElements(re,ne,Xt.cylinderAngleMinMax)),Ce){At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,he&&(At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0),Se&&(At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),De&&(At.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let gt=(Q-E)/S,It=(ee-E)/S,Jt=1-de/S;Xt.cylinderShapeUvAngleMinMax=Ye.fromElements(gt,It,Xt.cylinderShapeUvAngleMinMax),Xt.cylinderShapeUvAngleRangeZeroMid=(It+.5*Jt)%1;let bi=S/de,Yi=-(Q-E)/de;Xt.cylinderUvToShapeUvAngle=Ye.fromElements(bi,Yi,Xt.cylinderUvToShapeUvAngle)}return this.shaderMaximumIntersectionsLength=bt,!0};$p.prototype.computeOrientedBoundingBoxForTile=function(o,f,m,v,y){let x=this._minimumRadius,C=this._maximumRadius,w=this._minimumHeight,A=this._maximumHeight,E=this._minimumAngle,T=this._maximumAngle,S=1/Math.pow(2,o),M=xe.lerp(x,C,f*S),I=xe.lerp(x,C,(f+1)*S),P=xe.lerp(w,A,m*S),D=xe.lerp(w,A,(m+1)*S),L=xe.lerp(E,T,v*S),R=xe.lerp(E,T,(v+1)*S);return W2e(M,I,P,D,L,R,this.shapeTransform,y)};var CEi=new fc,bEi=new H,wEi=new H,AEi=new H;$p.prototype.computeApproximateStepSize=function(o){let f=this.shapeTransform,m=this._minimumRadius,v=this._maximumRadius,y=this._minimumHeight,x=this._maximumHeight,C=this._minimumAngle,w=this._maximumAngle,A=1-1/o.x,E=1-1/o.y,T=1-1/o.z,S=xe.lerp(m,v,A),M=xe.lerp(y,x,E),I=xe.lerp(C,w,T),P=W2e(S,v,M,x,I,w,f,CEi),D=Ut.getScale(P.halfAxes,bEi),L=Ee.getScale(f,wEi),R=H.divideComponents(D,L,AEi);return H.minimumComponent(R)};$p.DefaultMinBounds=Object.freeze(new H(0,-1,-xe.PI));$p.DefaultMaxBounds=Object.freeze(new H(1,1,+xe.PI));var EEi=5,TEi=new Array(EEi),SEi=new H,PEi=new Ut,IEi=new Ee,MEi=new Ee,DEi=new Ee,Cpe=new Ee,LEi=new H,REi=new H,OEi=new H,dnt=new Array(8);for(let o=0;o<8;o++)dnt[o]=new H;function A6e(o,f,m){return Math.abs(Wt.dot(o,f))<m}function NEi(o){let f=Ee.getColumn(o,0,LEi),m=Ee.getColumn(o,1,REi),v=Ee.getColumn(o,2,OEi),y=xe.EPSILON4;return A6e(f,m,y)&&A6e(m,v,y)}function FEi(o,f){let m=dnt;H.fromElements(-.5,-.5,-.5,m[0]),H.fromElements(-.5,-.5,.5,m[1]),H.fromElements(-.5,.5,-.5,m[2]),H.fromElements(-.5,.5,.5,m[3]),H.fromElements(.5,-.5,-.5,m[4]),H.fromElements(.5,-.5,.5,m[5]),H.fromElements(.5,.5,-.5,m[6]),H.fromElements(.5,.5,.5,m[7]);for(let v=0;v<8;++v)Ee.multiplyByPoint(o,m[v],m[v]);return fc.fromPoints(m,f)}function W2e(o,f,m,v,y,x,C,w){let A=$p.DefaultMinBounds,E=$p.DefaultMaxBounds,T=A.x,S=E.x,M=A.y,I=E.y,P=A.z,D=E.z;if(o===T&&f===S&&m===M&&v===I&&y===P&&x===D)return w.center=Ee.getTranslation(C,w.center),w.halfAxes=Ee.getMatrix3(C,w.halfAxes),w;x<y&&(x+=xe.TWO_PI);let L=x-y,R=y+L*.5,O=TEi,F=0;O[F++]=y,O[F++]=x,O[F++]=R,L>xe.PI&&(O[F++]=R-xe.PI_OVER_TWO,O[F++]=R+xe.PI_OVER_TWO);let k=1,U=1,G=-1,j=-1;for(let de=0;de<F;++de){let ve=O[de]-R,pe=Math.cos(ve),ce=Math.sin(ve),he=pe*o,Ce=ce*o,Se=pe*f,De=ce*f;k=Math.min(k,he),U=Math.min(U,Ce),k=Math.min(k,Se),U=Math.min(U,De),G=Math.max(G,he),j=Math.max(j,Ce),G=Math.max(G,Se),j=Math.max(j,De)}let q=G-k,J=j-U,X=v-m,Y=(k+G)*.5,Q=(U+j)*.5,ee=(m+v)*.5,z=H.fromElements(Y,Q,ee,SEi),ie=Ut.fromRotationZ(R,PEi),re=H.fromElements(q,J,X,hnt),ne=Ee.fromScale(re,DEi),oe=Ee.fromRotation(ie,MEi),se=Ee.fromTranslation(z,IEi),ae=Ee.multiplyTransformation(oe,Ee.multiplyTransformation(se,ne,Cpe),Cpe),fe=Ee.multiplyTransformation(C,ae,Cpe);return NEi(fe)?fc.fromTransformation(fe,w):FEi(fe,w)}var $5=$p;function $x(){this.orientedBoundingBox=new fc,this.boundingSphere=new Pi,this.boundTransform=new Ee,this.shapeTransform=new Ee,this._rectangle=new Di,this._minimumHeight=$x.DefaultMinBounds.z,this._maximumHeight=$x.DefaultMaxBounds.z,this._ellipsoid=new ki,this._translation=new H,this._rotation=new Ut,this.shaderUniforms={ellipsoidRadiiUv:new H,ellipsoidInverseRadiiSquaredUv:new H,ellipsoidRenderLongitudeMinMax:new Ye,ellipsoidShapeUvLongitudeMinMaxMid:new H,ellipsoidUvToShapeUvLongitude:new Ye,ellipsoidUvToShapeUvLatitude:new Ye,ellipsoidRenderLatitudeCosSqrHalfMinMax:new Ye,ellipsoidInverseHeightDifferenceUv:0,ellipseInnerRadiiUv:new Ye,ellipsoidInverseInnerScaleUv:0,ellipsoidInverseOuterScaleUv:0},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT:void 0,ELLIPSOID_IS_SPHERE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var BEi=new H,kEi=new Ut,E6e=new H,T6e=new H,S6e=new H,P6e=new H,VEi=new Di;$x.prototype.update=function(o,f,m,v,y){v=Z(v,$x.DefaultMinBounds),y=Z(y,$x.DefaultMaxBounds);let x=$x.DefaultMinBounds.x,C=$x.DefaultMaxBounds.x,w=C-x,A=.5*w,E=$x.DefaultMinBounds.y,T=$x.DefaultMaxBounds.y,S=T-E,M=xe.EPSILON10,I=xe.EPSILON3,P=xe.EPSILON10,D=xe.EPSILON10,L=xe.EPSILON3,R=xe.clamp(f.x,x,C),O=xe.clamp(m.x,x,C),F=xe.clamp(v.x,x,C),k=xe.clamp(y.x,x,C),U=Math.max(R,F),G=Math.min(O,k),j=xe.clamp(f.y,E,T),q=xe.clamp(m.y,E,T),J=xe.clamp(v.y,E,T),X=xe.clamp(y.y,E,T),Y=Math.max(j,J),Q=Math.min(q,X),ee=Ee.getScale(o,BEi),z=ee.x===ee.y&&ee.y===ee.z,ie=H.minimumComponent(ee),re=Math.max(f.z,-ie),ne=Math.max(m.z,-ie),oe=Math.max(v.z,-ie),se=Math.max(y.z,-ie),ae=Math.max(re,oe),fe=Math.min(ne,se),de=H.add(ee,H.fromElements(re,re,re,T6e),T6e),ve=H.add(ee,H.fromElements(ne,ne,ne,E6e),E6e),pe=H.maximumComponent(ve),ce=H.add(ee,H.fromElements(ae,ae,ae,P6e),P6e),he=H.add(ee,H.fromElements(fe,fe,fe,S6e),S6e);if(Y>Q||Y===T||Q===E||ae>fe||xe.equalsEpsilon(he,H.ZERO,void 0,M))return!1;this._rectangle=Di.fromRadians(R,j,O,q),this._translation=Ee.getTranslation(o,this._translation),this._rotation=Ee.getRotation(o,this._rotation),this._ellipsoid=ki.fromCartesian3(ee,this._ellipsoid),this._minimumHeight=re,this._maximumHeight=ne;let Ce=Di.fromRadians(U,Y,G,Q,VEi);this.orientedBoundingBox=fnt(Ce,ae,fe,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=Ee.fromRotationTranslation(Ut.setScale(this._rotation,ve,kEi),this._translation,this.shapeTransform),this.boundTransform=Ee.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=Pi.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let Se=G<U,De=G-U+Se*w,Oe=De<=P,Ue=De>A+P&&De<w-P,Xe=De>=A-P&&De<=A+P,it=De>P&&De<A-P,ut=Oe||Ue||Xe||it,at=O<R,Pt=O-R+at*w,Qe=Pt<=P,ft=Pt>A+P&&Pt<w-P,Ot=Pt>=A-P&&Pt<=A+P,Xt=Pt>P&&Pt<A-P,At=Qe||ft||Ot||Xt,bt=Q<-L,gt=Q>=-L&&Q<=+L,It=Q>+L&&Q<T-D,Jt=bt||gt||It,bi=Y>E+D&&Y<-L,Yi=Y>=-L&&Y<=+L,ii=Y>+L,ei=bi||Yi||ii,Li=Jt||ei,Je=q-j,Nt=q<-L,yi=q>=-L&&q<=+L,ai=q>+L&&q<T-D,wi=Nt||yi||ai,ji=j>E+D&&j<-L,hi=j>=-L&&j<=+L,Ri=j>+L,pt=wi||ji||hi||Ri,wr=!H.equals(ce,H.ZERO),zi=!H.equals(he,H.ZERO),Ui=wr||zi,Gt=fe-ae,$t=!H.equals(de,H.ZERO),jt=!H.equals(ve,H.ZERO),ct=$t||jt,Pe=this.shaderUniforms,Ht=this.shaderDefines;for(let _t in Ht)Ht.hasOwnProperty(_t)&&(Ht[_t]=void 0);Pe.ellipsoidRadiiUv=H.divideByScalar(ve,pe,Pe.ellipsoidRadiiUv),Pe.ellipsoidInverseRadiiSquaredUv=H.divideComponents(H.ONE,H.multiplyComponents(Pe.ellipsoidRadiiUv,Pe.ellipsoidRadiiUv,Pe.ellipsoidInverseRadiiSquaredUv),Pe.ellipsoidInverseRadiiSquaredUv);let si=0;if(Ht.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=si,si+=1,Ui&&(Gt===0&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_FLAT=!0),wr&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MIN=!0,Ht.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=si,si+=1,Pe.ellipsoidInverseInnerScaleUv=pe/(pe-(ne-ae))),zi&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_HEIGHT_MAX=!0,Pe.ellipsoidInverseOuterScaleUv=pe/(pe-(ne-fe)))),ct){if($t){Ht.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_MIN=!0;let _t=(ne-re)/pe;Pe.ellipsoidInverseHeightDifferenceUv=1/_t,Pe.ellipseInnerRadiiUv=Ye.fromElements(Pe.ellipsoidRadiiUv.x*(1-_t),Pe.ellipsoidRadiiUv.z*(1-_t),Pe.ellipseInnerRadiiUv)}re===ne&&(Ht.ELLIPSOID_HAS_SHAPE_BOUNDS_HEIGHT_FLAT=!0)}if(ut&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ht.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=si,Ue?(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,si+=1):it?(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,si+=2):Xe?(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_HALF=!0,si+=1):Oe&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,si+=2),Pe.ellipsoidRenderLongitudeMinMax=Ye.fromElements(U,G,Pe.ellipsoidRenderLongitudeMinMax)),At){Ht.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,O<R&&(Ht.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0);let _t=w/Pt,Yt=-(R-x)/Pt;Pe.ellipsoidUvToShapeUvLongitude=Ye.fromElements(_t,Yt,Pe.ellipsoidUvToShapeUvLongitude)}if(ut){let _t=xe.equalsEpsilon(U,x,void 0,I),Yt=xe.equalsEpsilon(G,C,void 0,I);_t&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),Yt&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let Fi=(R-x)/w,Dt=(O-x)/w,Lt=(G-x)/w,Si=1-De/w,nt=(Lt+.5*Si)%1;Pe.ellipsoidShapeUvLongitudeMinMaxMid=H.fromElements(Fi,Dt,nt,Pe.ellipsoidShapeUvLongitudeMinMaxMid)}if(Li){Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE=!0,ei&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ht.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=si,bi?(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,si+=1):Yi?(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,si+=1):ii&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,si+=2)),Jt&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ht.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=si,bt?(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,si+=2):gt?(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,si+=1):It&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,si+=1)),Y===Q&&(Ht.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let _t=Math.pow(Math.cos(xe.PI_OVER_TWO-Math.abs(Y)),2),Yt=Math.pow(Math.cos(xe.PI_OVER_TWO-Math.abs(Q)),2);Pe.ellipsoidRenderLatitudeCosSqrHalfMinMax=Ye.fromElements(_t,Yt,Pe.ellipsoidRenderLatitudeCosSqrHalfMinMax)}if(pt){Ht.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,j===q&&(Ht.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE_RANGE_EQUAL_ZERO=!0);let _t=S/Je,Yt=(E-j)/Je;Pe.ellipsoidUvToShapeUvLatitude=Ye.fromElements(_t,Yt,Pe.ellipsoidUvToShapeUvLatitude)}return z&&(Ht.ELLIPSOID_IS_SPHERE=!0),this.shaderMaximumIntersectionsLength=si,!0};var zEi=new Di;$x.prototype.computeOrientedBoundingBoxForTile=function(o,f,m,v,y){let x=1/Math.pow(2,o),C=f*x,w=(f+1)*x,A=m*x,E=(m+1)*x,T=v*x,S=(v+1)*x,M=Di.subsection(this._rectangle,C,A,w,E,zEi),I=xe.lerp(this._minimumHeight,this._maximumHeight,T),P=xe.lerp(this._minimumHeight,this._maximumHeight,S);return fnt(M,I,P,this._ellipsoid,this._translation,this._rotation,y)};$x.prototype.computeApproximateStepSize=function(o){let f=this._ellipsoid.maximumRadius,m=this._minimumHeight,v=this._maximumHeight;return .5*((v-m)/(f+v))/o.z};function fnt(o,f,m,v,y,x,C){return C=fc.fromRectangle(o,f,m,v,C),C.center=H.add(C.center,y,C.center),C.halfAxes=Ut.multiply(C.halfAxes,x,C.halfAxes),C}$x.DefaultMinBounds=Object.freeze(new H(-xe.PI,-xe.PI_OVER_TWO,-Number.MAX_VALUE));$x.DefaultMaxBounds=Object.freeze(new H(+xe.PI,+xe.PI_OVER_TWO,+Number.MAX_VALUE));var Zq=$x,B1={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};B1.getMinBounds=function(o){switch(o){case B1.BOX:return Z5.DefaultMinBounds;case B1.ELLIPSOID:return Zq.DefaultMinBounds;case B1.CYLINDER:return $5.DefaultMinBounds}};B1.getMaxBounds=function(o){switch(o){case B1.BOX:return Z5.DefaultMaxBounds;case B1.ELLIPSOID:return Zq.DefaultMaxBounds;case B1.CYLINDER:return $5.DefaultMaxBounds}};B1.getShapeConstructor=function(o){switch(o){case B1.BOX:return Z5;case B1.ELLIPSOID:return Zq;case B1.CYLINDER:return $5}};var Rh=Object.freeze(B1);function Pj(o){o=Z(o,Z.EMPTY_OBJECT),this._ready=!1,this.shapeTransform=void 0,this.globalTransform=void 0,this.shape=void 0,this.minBounds=void 0,this.maxBounds=void 0,this.dimensions=void 0,this.paddingBefore=void 0,this.paddingAfter=void 0,this.names=void 0,this.types=void 0,this.componentTypes=void 0,this.minimumValues=void 0,this.maximumValues=void 0,this.maximumTileCount=void 0,this._implicitTileset=void 0,this._subtreeCache=new U2e;let f=this,m;N(o.url)&&(mi("Cesium3DTilesVoxelProvider options.url","Cesium3DTilesVoxelProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise=Promise.resolve(o.url).then(function(v){let y=Jr.createIfNeeded(v);return y.fetchJson().then(function(x){return m=x,mnt(m),_nt(m,y).load()}).then(function(x){let C=m.root,w=C.content.extensions["3DTILES_content_voxels"],A=w.class,E=Gh(m,"3DTILES_metadata")?m.extensions["3DTILES_metadata"]:m,T=x.schema,S=new fq({metadataJson:E,schema:T});vnt(f,S,A);let M=new gq(y,C,T),{shape:I,minBounds:P,maxBounds:D,shapeTransform:L,globalTransform:R}=gnt(C);f.shape=I,f.minBounds=P,f.maxBounds=D,f.dimensions=H.unpack(w.dimensions),f.shapeTransform=L,f.globalTransform=R,f.maximumTileCount=pnt(S);let O,F;return N(w.padding)&&(O=H.unpack(w.padding.before),F=H.unpack(w.padding.after)),f.paddingBefore=O,f.paddingAfter=F,f._implicitTileset=M,id.unload(x),f._ready=!0,f})}))}Object.defineProperties(Pj.prototype,{readyPromise:{get:function(){return mi("Cesium3DTilesVoxelProvider.readyPromise","Cesium3DTilesVoxelProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return mi("Cesium3DTilesVoxelProvider.ready","Cesium3DTilesVoxelProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use Cesium3DTilesVoxelProvider.fromUrl instead."),this._ready}}});Pj.fromUrl=async function(o){let f=Jr.createIfNeeded(o),m=await f.fetchJson();mnt(m);let v=_nt(m,f);await v.load();let y=m.root,x=y.content.extensions["3DTILES_content_voxels"],C=x.class,w=Gh(m,"3DTILES_metadata")?m.extensions["3DTILES_metadata"]:m,A=v.schema,E=new fq({metadataJson:w,schema:A}),T=new Pj;vnt(T,E,C);let S=new gq(f,y,A),{shape:M,minBounds:I,maxBounds:P,shapeTransform:D,globalTransform:L}=gnt(y);T.shape=M,T.minBounds=I,T.maxBounds=P,T.dimensions=H.unpack(x.dimensions),T.shapeTransform=D,T.globalTransform=L,T.maximumTileCount=pnt(E);let R,O;return N(x.padding)&&(R=H.unpack(x.padding.before),O=H.unpack(x.padding.after)),T.paddingBefore=R,T.paddingAfter=O,T._implicitTileset=S,id.unload(v),T._ready=!0,T._readyPromise=Promise.resolve(T),T};function pnt(o){if(N(o.tileset))return o.tileset.getPropertyBySemantic(gne.TILESET_TILE_COUNT)}function mnt(o){let f=o.root;if(!N(f.content))throw new sr("Root must have content");if(!Gh(f.content,"3DTILES_content_voxels"))throw new sr("Root tile content must have 3DTILES_content_voxels extension");if(!Gh(f,"3DTILES_implicit_tiling")&&!N(f.implicitTiling))throw new sr("Root tile must have implicit tiling");if(!N(o.schema)&&!N(o.schemaUri)&&!Gh(o,"3DTILES_metadata"))throw new sr("Tileset must have a metadata schema")}function gnt(o){let f=o.boundingVolume,m;if(N(o.transform)?m=Ee.unpack(o.transform):m=Ee.clone(Ee.IDENTITY),N(f.box))return UEi(f.box,m);if(N(f.region))return HEi(f.region);if(Gh(f,"3DTILES_bounding_volume_cylinder"))return GEi(f.extensions["3DTILES_bounding_volume_cylinder"].cylinder,m);throw new sr("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function HEi(o){let f=o[0],m=o[1],v=o[2],y=o[3],x=o[4],C=o[5],w=Ee.fromScale(ki.WGS84.radii),A=f,E=v,T=m,S=y,M=x,I=C,P=new H(A,T,M),D=new H(E,S,I);return{shape:Rh.ELLIPSOID,minBounds:P,maxBounds:D,shapeTransform:w,globalTransform:Ee.clone(Ee.IDENTITY)}}function UEi(o,f){let m=fc.unpack(o),v=Ee.fromRotationTranslation(m.halfAxes,m.center);return{shape:Rh.BOX,minBounds:H.clone(Z5.DefaultMinBounds),maxBounds:H.clone(Z5.DefaultMaxBounds),shapeTransform:v,globalTransform:f}}function GEi(o,f){let m=fc.unpack(o),v=Ee.fromRotationTranslation(m.halfAxes,m.center);return{shape:Rh.CYLINDER,minBounds:H.clone($5.DefaultMinBounds),maxBounds:H.clone($5.DefaultMaxBounds),shapeTransform:v,globalTransform:f}}function _nt(o,f){let{schemaUri:m,schema:v}=o;return N(m)?id.getSchemaLoader({resource:f.getDerivedResource({url:m})}):id.getSchemaLoader({schema:v})}function vnt(o,f,m){let{schema:v,statistics:y}=f,x=y?.classes[m],C=v.classes[m].properties,w=Object.entries(C).map(([S,M])=>{let{type:I,componentType:P}=M,D=x?.properties[S].min,L=x?.properties[S].max,R=Fa.getComponentCount(I),O=I6e(D,R),F=I6e(L,R);return{id:S,type:I,componentType:P,minValue:O,maxValue:F}});o.names=w.map(S=>S.id),o.types=w.map(S=>S.type),o.componentTypes=w.map(S=>S.componentType);let A=w.map(S=>S.minValue),E=w.map(S=>S.maxValue),T=A.some(N);o.minimumValues=T?A:void 0,o.maximumValues=T?E:void 0}function I6e(o,f){if(!N(o))return;let m=Array.isArray(o)?o:[o];return Array.from({length:f},(v,y)=>m[y])}async function WEi(o,f){let m=o.contentUriTemplates[0].getDerivedResource({templateValues:f.getTemplateValues()}),v=o.baseResource.getDerivedResource({url:m.url}),y=await v.fetchArrayBuffer(),x=t6(y);return await G2e.fromJson(v,x.jsonPayload,x.binaryPayload,o.metadataSchema)}async function jEi(o,f){let m=o._implicitTileset,v=o._subtreeCache,y=v.find(f);if(N(y))return y;let x=m.subtreeUriTemplate.getDerivedResource({templateValues:f.getTemplateValues()}),C=m.baseResource.getDerivedResource({url:x.url}),w=await C.fetchArrayBuffer();if(y=v.find(f),N(y))return y;let A=t6(w);return y=await mne.fromSubtreeJson(C,A.jsonPayload,A.binaryPayload,m,f),v.addSubtree(y),y}Pj.prototype.requestData=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.tileLevel,0),m=Z(o.tileX,0),v=Z(o.tileY,0),y=Z(o.tileZ,0);if(Z(o.keyframe,0)!==0)return;let x=this._implicitTileset,C=this.names,w=new Une({subdivisionScheme:x.subdivisionScheme,subtreeLevels:x.subtreeLevels,level:f,x:m,y:v,z:y}),A=w.isSubtreeRoot()&&w.level>0,E=A?w.getParentSubtreeCoordinates():w.getSubtreeCoordinates();return jEi(this,E).then(function(T){return(A?T.childSubtreeIsAvailableAtCoordinates(w):T.tileIsAvailableAtCoordinates(w))?WEi(x,w):Promise.reject("Tile is not available")}).then(function(T){return C.map(function(S){return T.metadataTable.getPropertyTypedArray(S)})})};var ynt=Pj;function j2e(o){o=Z(o,1),this._radius=Z(o,1)}Object.defineProperties(j2e.prototype,{radius:{get:function(){return this._radius},set:function(o){this._radius=o}}});j2e.prototype.emit=function(o){let f=xe.randomBetween(0,xe.TWO_PI),m=xe.randomBetween(0,this._radius),v=m*Math.cos(f),y=m*Math.sin(f),x=0;o.position=H.fromElements(v,y,x,o.position),o.velocity=H.clone(H.UNIT_Z,o.velocity)};var Y2e=j2e,t0e={CUMULUS:0};t0e.validate=function(o){return o===t0e.CUMULUS};var $te=Object.freeze(t0e);function PT(o,f){if(o=Z(o,Z.EMPTY_OBJECT),this._show=Z(o.show,!0),this._position=H.clone(Z(o.position,H.ZERO)),!N(o.scale)&&N(o.maximumSize))this._maximumSize=H.clone(o.maximumSize),this._scale=new Ye(this._maximumSize.x,this._maximumSize.y);else{this._scale=Ye.clone(Z(o.scale,new Ye(20,12)));let m=new H(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=H.clone(Z(o.maximumSize,m))}this._slice=Z(o.slice,-1),this._color=Re.clone(Z(o.color,Re.WHITE)),this._brightness=Z(o.brightness,1),this._cloudCollection=f,this._index=-1}var YEi=PT.SHOW_INDEX=0,qEi=PT.POSITION_INDEX=1,XEi=PT.SCALE_INDEX=2,JEi=PT.MAXIMUM_SIZE_INDEX=3,KEi=PT.SLICE_INDEX=4,QEi=PT.BRIGHTNESS_INDEX=5,ZEi=PT.COLOR_INDEX=6;PT.NUMBER_OF_PROPERTIES=7;function VF(o,f){let m=o._cloudCollection;N(m)&&(m._updateCloud(o,f),o._dirty=!0)}Object.defineProperties(PT.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,VF(this,YEi))}},position:{get:function(){return this._position},set:function(o){let f=this._position;H.equals(f,o)||(H.clone(o,f),VF(this,qEi))}},scale:{get:function(){return this._scale},set:function(o){let f=this._scale;Ye.equals(f,o)||(Ye.clone(o,f),VF(this,XEi))}},maximumSize:{get:function(){return this._maximumSize},set:function(o){let f=this._maximumSize;H.equals(f,o)||(H.clone(o,f),VF(this,JEi))}},color:{get:function(){return this._color},set:function(o){let f=this._color;Re.equals(f,o)||(Re.clone(o,f),VF(this,ZEi))}},slice:{get:function(){return this._slice},set:function(o){this._slice!==o&&(this._slice=o,VF(this,KEi))}},brightness:{get:function(){return this._brightness},set:function(o){this._brightness!==o&&(this._brightness=o,VF(this,QEi))}}});PT.prototype._destroy=function(){this._cloudCollection=void 0};var IT=PT,I1,s$=new H,$Ei={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},eTi={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},tTi=IT.SHOW_INDEX,iTi=IT.POSITION_INDEX,rTi=IT.SCALE_INDEX,nTi=IT.MAXIMUM_SIZE_INDEX,oTi=IT.SLICE_INDEX,aTi=IT.BRIGHTNESS_INDEX,sTi=IT.NUMBER_OF_PROPERTIES,lTi=IT.COLOR_INDEX;function MT(o){o=Z(o,Z.EMPTY_OBJECT),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(sTi),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=Z(o.noiseDetail,16),this.noiseOffset=H.clone(Z(o.noiseOffset,H.ZERO)),this._loading=!1,this._ready=!1;let f=this;this._uniforms={u_noiseTexture:function(){return f._noiseTexture},u_noiseTextureDimensions:xnt(f),u_noiseDetail:function(){return f.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=Z(o.show,!0),this._colorCommands=[],this.debugBillboards=Z(o.debugBillboards,!1),this._compiledDebugBillboards=!1,this.debugEllipsoids=Z(o.debugEllipsoids,!1),this._compiledDebugEllipsoids=!1}function xnt(o){return function(){return s$.x=o._textureSliceWidth,s$.y=o._noiseTextureRows,s$.z=1/o._noiseTextureRows,s$}}Object.defineProperties(MT.prototype,{length:{get:function(){return q2e(this),this._clouds.length}}});function Cnt(o){let f=o.length;for(let m=0;m<f;++m)o[m]&&o[m]._destroy()}MT.prototype.add=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.cloudType,$te.CUMULUS),m;return f===$te.CUMULUS&&(m=new IT(o,this),m._index=this._clouds.length,this._clouds.push(m),this._createVertexArray=!0),m};MT.prototype.remove=function(o){return this.contains(o)?(this._clouds[o._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,o._destroy(),!0):!1};MT.prototype.removeAll=function(){Cnt(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function q2e(o){if(o._cloudsRemoved){o._cloudsRemoved=!1;let f=[],m=o._clouds,v=m.length;for(let y=0,x=0;y<v;++y){let C=m[y];N(C)&&(m._index=x++,f.push(C))}o._clouds=f}}MT.prototype._updateCloud=function(o,f){o._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=o),++this._propertiesChanged[f]};MT.prototype.contains=function(o){return N(o)&&o._cloudCollection===this};MT.prototype.get=function(o){return q2e(this),this._clouds[o]};var uTi=new Float32Array([-1,-1,1,-1,1,1,-1,1]),cTi=new Uint16Array([0,1,2,0,2,3]);function hTi(o){let f=Ao.createVertexBuffer({context:o,typedArray:uTi,usage:gn.STATIC_DRAW}),m=Ao.createIndexBuffer({context:o,typedArray:cTi,usage:gn.STATIC_DRAW,indexDatatype:ro.UNSIGNED_SHORT}),v=[{index:0,vertexBuffer:f,componentsPerAttribute:2,componentDatatype:Rt.FLOAT}];return new Du({context:o,attributes:v,indexBuffer:m})}var X2e;function dTi(o){let f=o.cache.cloudCollection_indexBufferBatched;if(N(f))return f;let m=16384*6-6,v=new Uint16Array(m);for(let y=0,x=0;y<m;y+=6,x+=4)v[y]=x,v[y+1]=x+1,v[y+2]=x+2,v[y+3]=x,v[y+4]=x+2,v[y+5]=x+3;return f=Ao.createIndexBuffer({context:o,typedArray:v,usage:gn.STATIC_DRAW,indexDatatype:ro.UNSIGNED_SHORT}),f.vertexArrayDestroyable=!1,o.cache.cloudCollection_indexBufferBatched=f,f}function fTi(o){let f=o.cache.cloudCollection_indexBufferInstanced;return N(f)||(f=Ao.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:gn.STATIC_DRAW,indexDatatype:ro.UNSIGNED_SHORT}),f.vertexArrayDestroyable=!1,o.cache.cloudCollection_indexBufferInstanced=f),f}function pTi(o){let f=o.cache.cloudCollection_vertexBufferInstanced;return N(f)||(f=Ao.createVertexBuffer({context:o,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:gn.STATIC_DRAW}),f.vertexArrayDestroyable=!1,o.cache.cloudCollection_vertexBufferInstanced=f),f}function mTi(o,f,m){let v=[{index:I1.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,usage:gn.STATIC_DRAW},{index:I1.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,usage:gn.STATIC_DRAW},{index:I1.packedAttribute0,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,usage:gn.STATIC_DRAW},{index:I1.packedAttribute1,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,usage:gn.STATIC_DRAW},{index:I1.color,componentsPerAttribute:4,componentDatatype:Rt.UNSIGNED_BYTE,normalize:!0,usage:gn.STATIC_DRAW}];m&&v.push({index:I1.direction,componentsPerAttribute:2,componentDatatype:Rt.FLOAT,vertexBuffer:pTi(o)});let y=m?f:4*f;return new oY(o,v,y,m)}var bpe=new Qu;function bnt(o,f,m,v){let y,x=m[I1.positionHighAndScaleX],C=m[I1.positionLowAndScaleY],w=v.position;Qu.fromCartesian(w,bpe);let A=v.scale,E=bpe.high,T=bpe.low;o._instanced?(y=v._index,x(y,E.x,E.y,E.z,A.x),C(y,T.x,T.y,T.z,A.y)):(y=v._index*4,x(y+0,E.x,E.y,E.z,A.x),x(y+1,E.x,E.y,E.z,A.x),x(y+2,E.x,E.y,E.z,A.x),x(y+3,E.x,E.y,E.z,A.x),C(y+0,T.x,T.y,T.z,A.y),C(y+1,T.x,T.y,T.z,A.y),C(y+2,T.x,T.y,T.z,A.y),C(y+3,T.x,T.y,T.z,A.y))}function wnt(o,f,m,v){let y,x=m[I1.packedAttribute0],C=v.show,w=v.brightness;o._instanced?(y=v._index,x(y,C,w,0,0)):(y=v._index*4,x(y+0,C,w,0,0),x(y+1,C,w,1,0),x(y+2,C,w,1,1),x(y+3,C,w,0,1))}function Ant(o,f,m,v){let y,x=m[I1.packedAttribute1],C=v.maximumSize,w=v.slice;o._instanced?(y=v._index,x(y,C.x,C.y,C.z,w)):(y=v._index*4,x(y+0,C.x,C.y,C.z,w),x(y+1,C.x,C.y,C.z,w),x(y+2,C.x,C.y,C.z,w),x(y+3,C.x,C.y,C.z,w))}function Ent(o,f,m,v){let y,x=m[I1.color],C=v.color,w=Re.floatToByte(C.red),A=Re.floatToByte(C.green),E=Re.floatToByte(C.blue),T=Re.floatToByte(C.alpha);o._instanced?(y=v._index,x(y,w,A,E,T)):(y=v._index*4,x(y+0,w,A,E,T),x(y+1,w,A,E,T),x(y+2,w,A,E,T),x(y+3,w,A,E,T))}function gTi(o,f,m,v){bnt(o,f,m,v),wnt(o,f,m,v),Ant(o,f,m,v),Ent(o,f,m,v)}function _Ti(o,f,m,v){let y=o,x=y._textureSliceWidth,C=y._noiseTextureRows,w=f.context;y._vaNoise=hTi(w),y._spNoise=Rs.fromCache({context:w,vertexShaderSource:m,fragmentShaderSource:v,attributeLocations:{position:0}});let A=y.noiseDetail,E=y.noiseOffset;y._noiseTexture=new _o({context:w,width:x*x/C,height:x*C,pixelDatatype:Rn.UNSIGNED_BYTE,pixelFormat:Nn.RGBA,sampler:new gs({wrapS:ha.REPEAT,wrapT:ha.REPEAT,minificationFilter:Xa.NEAREST,magnificationFilter:Zu.NEAREST})});let T=new B5({vertexArray:y._vaNoise,shaderProgram:y._spNoise,outputTexture:y._noiseTexture,uniformMap:{u_noiseTextureDimensions:xnt(y),u_noiseDetail:function(){return A},u_noiseOffset:function(){return E}},persists:!1,owner:o,postExecute:function(S){y._ready=!0,y._loading=!1}});f.commandList.push(T),y._loading=!0}function vTi(o,f){let m=o,v=f.context;m._createVertexArray=!1,m._vaf=m._vaf&&m._vaf.destroy();let y=o._clouds,x=y.length;if(x>0){m._vaf=mTi(v,x,m._instanced);let C=m._vaf.writers,w;for(w=0;w<x;++w){let A=y[w];gTi(o,f,C,A)}m._vaf.commit(X2e(v))}}var yTi=[];function xTi(o,f){let m=f.context,v=o,y=v._clouds.length,x=v._cloudsToUpdate,C=v._cloudsToUpdateIndex,w=v._propertiesChanged,A=yTi;A.length=0,(w[iTi]||w[rTi])&&A.push(bnt),(w[tTi]||w[aTi])&&A.push(wnt),(w[nTi]||w[oTi])&&A.push(Ant),w[lTi]&&A.push(Ent);let E=A.length,T=v._vaf.writers,S,M,I;if(C/y>.1){for(S=0;S<C;++S)for(M=x[S],M._dirty=!1,I=0;I<E;++I)A[I](o,f,T,M);v._vaf.commit(X2e(m))}else{for(S=0;S<C;++S){for(M=x[S],M._dirty=!1,I=0;I<E;++I)A[I](o,f,T,M);v._instanced?v._vaf.subCommit(M._index,1):v._vaf.subCommit(M._index*4,4)}v._vaf.endSubCommits()}v._cloudsToUpdateIndex=0}function CTi(o,f,m,v){let y=f.context,x=o,C=new Zr({defines:[],sources:[m]});x._instanced&&C.defines.push("INSTANCED");let w=new Zr({defines:[],sources:[v]});x.debugBillboards&&w.defines.push("DEBUG_BILLBOARDS"),x.debugEllipsoids&&w.defines.push("DEBUG_ELLIPSOIDS"),x._sp=Rs.replaceCache({context:y,shaderProgram:x._sp,vertexShaderSource:C,fragmentShaderSource:w,attributeLocations:I1}),x._rs=Mn.fromCache({depthTest:{enabled:!0,func:xi.LESS},depthMask:!1,blending:Mu.ALPHA_BLEND}),x._spCreated=!0,x._compiledDebugBillboards=x.debugBillboards,x._compiledDebugEllipsoids=x.debugEllipsoids}function bTi(o,f){let m=o,v=f.passes,y=m._uniforms,x=f.commandList;if(v.render){let C=m._colorCommands,w=m._vaf.va,A=w.length;C.length=A;for(let E=0;E<A;E++){let T=C[E];N(T)||(T=C[E]=new Jn),T.pass=vr.TRANSLUCENT,T.owner=o,T.uniformMap=y,T.count=w[E].indicesCount,T.vertexArray=w[E].va,T.shaderProgram=m._sp,T.renderState=m._rs,m._instanced&&(T.count=6,T.instanceCount=m._clouds.length),x.push(T)}}}MT.prototype.update=function(o){if(q2e(this),!this.show)return;let f=this.debugBillboards||this.debugEllipsoids;this._ready=f?!0:N(this._noiseTexture),!this._ready&&!this._loading&&!f&&_Ti(this,o,UAe,HAe),this._instanced=o.context.instancedArrays,I1=this._instanced?eTi:$Ei,X2e=this._instanced?fTi:dTi;let m=this._clouds.length,v=this._cloudsToUpdate,y=this._cloudsToUpdateIndex;this._createVertexArray?vTi(this,o):y>0&&xTi(this,o),y>m*1.5&&(v.length=m),!(!N(this._vaf)||!N(this._vaf.va)||!this._ready&!f)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&CTi(this,o,zAe,VAe),bTi(this,o))};MT.prototype.isDestroyed=function(){return!1};MT.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Cnt(this._clouds),kr(this)};var Tnt=MT;async function J2e(o,f){let m=f.terrainProvider,v=f.mapProjection,y=v.ellipsoid,x,C=f.camera.getRectangleCameraCoordinates(o);if(f.mode===_i.SCENE3D?x=y.cartesianToCartographic(C):x=v.unproject(C),!N(m))return x;N(m._readyPromise)?await m._readyPromise:N(m.readyPromise)&&await m.readyPromise;let w=m.availability;if(!N(w)||f.mode===_i.SCENE2D)return x;let A=[Di.center(o),Di.southeast(o),Di.southwest(o),Di.northeast(o),Di.northwest(o)],E=await J2e._sampleTerrainMostDetailed(m,A),T=!1,S=E.reduce(function(I,P){return N(P.height)?(T=!0,Math.max(P.height,I)):I},-Number.MAX_VALUE),M=x;return T&&(M.height+=S),M}J2e._sampleTerrainMostDetailed=xT;var tae=J2e,wTi=xe.toRadians(30);function K2e(o){this._angle=Z(o,wTi)}Object.defineProperties(K2e.prototype,{angle:{get:function(){return this._angle},set:function(o){this._angle=o}}});K2e.prototype.emit=function(o){let f=Math.tan(this._angle),m=xe.randomBetween(0,xe.TWO_PI),v=xe.randomBetween(0,f),y=v*Math.cos(m),x=v*Math.sin(m),C=1;o.velocity=H.fromElements(y,x,C,o.velocity),H.normalize(o.velocity,o.velocity),o.position=H.clone(H.ZERO,o.position)};var R6=K2e,ATi=new Re,ETi=new Re,TTi=new Re,STi=new Re,M6e=new Wt,l7=new Uint8Array(4);function D6e(o,f,m,v){let y=f.height===m.height?0:(o-f.height)/(m.height-f.height);return Re.lerp(f.color,m.color,y,v)}function pee(o,f){return{height:o,color:Re.clone(f)}}function Snt(o){return o=o.filter(function(f,m,v){let y=m>0,x=m<v.length-1,C=y?f.height===v[m-1].height:!0,w=x?f.height===v[m+1].height:!0;return!C||!w}),o=o.filter(function(f,m,v){let y=m>0,x=m<v.length-1,C=y?Re.equals(f.color,v[m-1].color):!1,w=x?Re.equals(f.color,v[m+1].color):!1;return!C||!w}),o=o.filter(function(f,m,v){let y=m>0,x=y?Re.equals(f.color,v[m-1].color):!1,C=y?f.height===v[m-1].height:!0;return!x||!C}),o}function PTi(o){let f,m,v=[],y=o.length;for(f=0;f<y;f++){let x=o[f],C=x.entries,w=C.length,A=[];for(m=0;m<w;m++){let I=C[m],P=xe.clamp(I.height,uC._minimumHeight,uC._maximumHeight),D=Re.clone(I.color,ATi);D.red*=D.alpha,D.green*=D.alpha,D.blue*=D.alpha,A.push(pee(P,D))}let E=!0,T=!0;for(m=0;m<w-1;m++){let I=A[m+0],P=A[m+1];E=E&&I.height<=P.height,T=T&&I.height>=P.height}T?A=A.reverse():E||A6(A,function(I,P){return xe.sign(I.height-P.height)});let S=Z(x.extendDownwards,!1),M=Z(x.extendUpwards,!1);A.length===1&&!S&&!M&&(S=!0,M=!0),S&&A.splice(0,0,pee(uC._minimumHeight,A[0].color)),M&&A.splice(A.length,0,pee(uC._maximumHeight,A[A.length-1].color)),A=Snt(A),v.push(A)}return v}function ITi(o){let f=PTi(o),m=[],v=[],y;function x(A,E){m.push(pee(A,E))}function C(A,E,T){let S=Re.multiplyByScalar(T,1-E.alpha,STi);S=Re.add(S,E,S),x(A,S)}let w=f.length;for(y=0;y<w;y++){let A=f[y],E=0,T=0;v=m,m=[];let S=A.length,M=v.length;for(;E<S||T<M;){let I=E<S?A[E]:void 0,P=E>0?A[E-1]:void 0,D=E<S-1?A[E+1]:void 0,L=T<M?v[T]:void 0,R=T>0?v[T-1]:void 0,O=T<M-1?v[T+1]:void 0;if(N(I)&&N(L)&&I.height===L.height){let F=N(O)&&L.height===O.height,k=!N(R),U=!N(O),G=N(D)&&I.height===D.height,j=!N(P),q=!N(D);F?G?(C(I.height,I.color,L.color),C(I.height,D.color,O.color)):j?(x(I.height,L.color),C(I.height,I.color,O.color)):q?(C(I.height,I.color,L.color),x(I.height,O.color)):(C(I.height,I.color,L.color),C(I.height,I.color,O.color)):k?G?(x(I.height,I.color),C(I.height,D.color,L.color)):q?(x(I.height,I.color),x(I.height,L.color)):(j||x(I.height,I.color),C(I.height,I.color,L.color)):U?G?(C(I.height,I.color,L.color),x(I.height,D.color)):j?(x(I.height,L.color),x(I.height,I.color)):q?C(I.height,I.color,L.color):(C(I.height,I.color,L.color),x(I.height,I.color)):G?(C(I.height,I.color,L.color),C(I.height,D.color,L.color)):j?(x(I.height,L.color),C(I.height,I.color,L.color)):q?(C(I.height,I.color,L.color),x(I.height,L.color)):C(I.height,I.color,L.color),E+=G?2:1,T+=F?2:1}else if(N(I)&&N(L)&&N(R)&&I.height<L.height){let F=D6e(I.height,R,L,TTi);N(P)?N(D)?C(I.height,I.color,F):(C(I.height,I.color,F),x(I.height,F)):(x(I.height,F),C(I.height,I.color,F)),E++}else if(N(L)&&N(I)&&N(P)&&L.height<I.height){let F=D6e(L.height,P,I,ETi);N(R)?N(O)?C(L.height,F,L.color):(C(L.height,F,L.color),x(L.height,F)):(x(L.height,F),C(L.height,F,L.color)),T++}else N(I)&&(!N(L)||I.height<L.height)?(N(L)&&!N(R)&&!N(D)?(x(I.height,I.color),x(I.height,uC._emptyColor),x(L.height,uC._emptyColor)):(!N(L)&&N(R)&&!N(P)&&(x(R.height,uC._emptyColor),x(I.height,uC._emptyColor)),x(I.height,I.color)),E++):N(L)&&(!N(I)||L.height<I.height)&&(x(L.height,L.color),T++)}}return Snt(m)}function uC(o){let{scene:f,layers:m}=Z(o,Z.EMPTY_OBJECT),{context:v}=f,y=ITi(m),x=y.length,C,w,A;if(uC._useFloatTexture(v)){w=Rn.FLOAT,A=v.webgl2?Nn.RED:Nn.LUMINANCE,C=new Float32Array(x);for(let M=0;M<x;M++)C[M]=y[M].height}else{w=Rn.UNSIGNED_BYTE,A=Nn.RGBA,C=new Uint8Array(x*4);for(let M=0;M<x;M++)Wt.packFloat(y[M].height,M6e),Wt.pack(M6e,C,M*4)}let E=_o.create({context:v,pixelFormat:A,pixelDatatype:w,source:{arrayBufferView:C,width:x,height:1},sampler:new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.NEAREST,magnificationFilter:Zu.NEAREST})}),T=new Uint8Array(x*4);for(let M=0;M<x;M++)y[M].color.toBytes(l7),T[M*4+0]=l7[0],T[M*4+1]=l7[1],T[M*4+2]=l7[2],T[M*4+3]=l7[3];let S=_o.create({context:v,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,source:{arrayBufferView:T,width:x,height:1},sampler:new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR})});return zo.fromType("ElevationBand",{heights:E,colors:S})}uC._useFloatTexture=function(o){return o.floatingPointTexture};uC._maximumHeight=5906376425472;uC._minimumHeight=-5906376425472;uC._emptyColor=new Re(0,0,0,0);var Pnt=uC;async function MTi(o,f){o=Z(o,pW.defaultApiKey);let m,v=pW.getDefaultApiKeyCredit(o);N(v)&&(m=[v]),f=Z(f,{}),f.showCreditsOnScreen=!0;let y=new Jr({url:`${pW.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:o},credits:m});return pg.fromUrl(y,f)}var Int=MTi;function DTi(o){mi("createOsmBuildings","createOsmBuildings was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createOsmBuildingsAsync instead."),o=va(o,{url:Pw.fromAssetId(96188)});let f=new pg(o),m=o.style;if(!N(m)){let v=Z(o.defaultColor,Re.WHITE).toCssColorString();m=new G2({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${v}`})}return f.style=m,f}var Mnt=DTi;async function LTi(o){let f=await pg.fromIonAssetId(96188,o);o=Z(o,Z.EMPTY_OBJECT);let m=o.style;if(!N(m)){let v=Z(o.defaultColor,Re.WHITE).toCssColorString();m=new G2({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${v}`})}return f.style=m,f}var Dnt=LTi;function RTi(o){o=Z(o,Z.EMPTY_OBJECT);let f=[],m=o.geometry;(!N(m.attributes)||!N(m.primitiveType))&&(m=m.constructor.createGeometry(m));let v=m.attributes,y=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),x=Z(o.length,1e4);if(N(v.normal)&&f.push(new co({geometry:Ju.createLineSegmentsForVectors(m,"normal",x),attributes:{color:new ea(1,0,0,1)},modelMatrix:y})),N(v.tangent)&&f.push(new co({geometry:Ju.createLineSegmentsForVectors(m,"tangent",x),attributes:{color:new ea(0,1,0,1)},modelMatrix:y})),N(v.bitangent)&&f.push(new co({geometry:Ju.createLineSegmentsForVectors(m,"bitangent",x),attributes:{color:new ea(0,0,1,1)},modelMatrix:y})),f.length>0)return new Ia({asynchronous:!1,geometryInstances:f,appearance:new ms({flat:!0,translucent:!1})})}var Lnt=RTi;function OTi(o){mi("createWorldImagery","createWorldImagery was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use createWorldImageryAsync instead."),o=Z(o,Z.EMPTY_OBJECT);let f=Z(o.style,x5.AERIAL),m=new p2;return p2._initialize(m,f,o),m}var Rnt=OTi;function $q(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.attributeName,m=o.perInstanceAttribute;N(m)||(m=!1);let v=Z(o.glslDatatype,"vec3"),y=`v_${f}`,x;if(f==="normal"||f==="tangent"||f==="bitangent")x=`vec4 getColor() { return vec4((${y} + vec3(1.0)) * 0.5, 1.0); } `;else switch(f==="st"&&(v="vec2"),v){case"float":x=`vec4 getColor() { return vec4(vec3(${y}), 1.0); } `;break;case"vec2":x=`vec4 getColor() { return vec4(${y}, 0.0, 1.0); } `;break;case"vec3":x=`vec4 getColor() { return vec4(${y}, 1.0); } `;break;case"vec4":x=`vec4 getColor() { return ${y}; } `;break}let C=`in vec3 position3DHigh; in vec3 position3DLow; in float batchId; ${m?"":`in ${v} ${f}; `}out ${v} ${y}; void main() { vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); ${m?`${y} = czm_batchTable_${f}(batchId); `:`${y} = ${f}; `}gl_Position = czm_modelViewProjectionRelativeToEye * p; }`,w=`in ${v} ${y}; ${x} void main() { out_FragColor = getColor(); }`;this.material=void 0,this.translucent=Z(o.translucent,!1),this._vertexShaderSource=Z(o.vertexShaderSource,C),this._fragmentShaderSource=Z(o.fragmentShaderSource,w),this._renderState=md.getDefaultRenderState(!1,!1,o.renderState),this._closed=Z(o.closed,!1),this._attributeName=f,this._glslDatatype=v}Object.defineProperties($q.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});$q.prototype.getFragmentShaderSource=md.prototype.getFragmentShaderSource;$q.prototype.isTranslucent=md.prototype.isTranslucent;$q.prototype.getRenderState=md.prototype.getRenderState;var Ont=$q;function iae(o){o=Z(o,Z.EMPTY_OBJECT),this.length=Z(o.length,1e7),this._length=void 0,this.width=Z(o.width,2),this._width=void 0,this.show=Z(o.show,!0),this.modelMatrix=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),this._modelMatrix=new Ee,this.id=o.id,this._id=void 0,this._primitive=void 0}iae.prototype.update=function(o){if(this.show){if(!N(this._primitive)||!Ee.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=Ee.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,N(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let f=new co({geometry:new b_({positions:[H.ZERO,H.UNIT_X],width:this.width,vertexFormat:tm.VERTEX_FORMAT,colors:[Re.RED,Re.RED],arcType:fs.NONE}),modelMatrix:Ee.multiplyByUniformScale(this.modelMatrix,this.length,new Ee),id:this.id,pickPrimitive:this}),m=new co({geometry:new b_({positions:[H.ZERO,H.UNIT_Y],width:this.width,vertexFormat:tm.VERTEX_FORMAT,colors:[Re.GREEN,Re.GREEN],arcType:fs.NONE}),modelMatrix:Ee.multiplyByUniformScale(this.modelMatrix,this.length,new Ee),id:this.id,pickPrimitive:this}),v=new co({geometry:new b_({positions:[H.ZERO,H.UNIT_Z],width:this.width,vertexFormat:tm.VERTEX_FORMAT,colors:[Re.BLUE,Re.BLUE],arcType:fs.NONE}),modelMatrix:Ee.multiplyByUniformScale(this.modelMatrix,this.length,new Ee),id:this.id,pickPrimitive:this});this._primitive=new Ia({geometryInstances:[f,m,v],appearance:new tm,asynchronous:!1})}this._primitive.update(o)}};iae.prototype.isDestroyed=function(){return!1};iae.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),kr(this)};var Q2e=iae;function NTi(o){this.direction=H.clone(o.direction),this.color=Re.clone(Z(o.color,Re.WHITE)),this.intensity=Z(o.intensity,1)}var rae=NTi;function nC(o){this._scene=o.scene,this.samplingWindow=Z(o.samplingWindow,nC.defaultSettings.samplingWindow),this.quietPeriod=Z(o.quietPeriod,nC.defaultSettings.quietPeriod),this.warmupPeriod=Z(o.warmupPeriod,nC.defaultSettings.warmupPeriod),this.minimumFrameRateDuringWarmup=Z(o.minimumFrameRateDuringWarmup,nC.defaultSettings.minimumFrameRateDuringWarmup),this.minimumFrameRateAfterWarmup=Z(o.minimumFrameRateAfterWarmup,nC.defaultSettings.minimumFrameRateAfterWarmup),this._lowFrameRate=new Br,this._nominalFrameRate=new Br,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let f=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(y,x){FTi(f,x)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let m=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function v(){BTi(f)}this._visibilityChangeRemoveListener=void 0,N(m)&&(document.addEventListener(m,v,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(m,v,!1)})}nC.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};nC.fromScene=function(o){return(!N(o._frameRateMonitor)||o._frameRateMonitor.isDestroyed())&&(o._frameRateMonitor=new nC({scene:o})),o._frameRateMonitor};Object.defineProperties(nC.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});nC.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};nC.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};nC.prototype.isDestroyed=function(){return!1};nC.prototype.destroy=function(){return this._preUpdateRemoveListener(),N(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),kr(this)};function FTi(o,f){if(o._pauseCount>0)return;let m=$c();if(o._needsQuietPeriod)o._needsQuietPeriod=!1,o._frameTimes.length=0,o._quietPeriodEndTime=m+o.quietPeriod/lc.SECONDS_PER_MILLISECOND,o._warmupPeriodEndTime=o._quietPeriodEndTime+(o.warmupPeriod+o.samplingWindow)/lc.SECONDS_PER_MILLISECOND;else if(m>=o._quietPeriodEndTime){o._frameTimes.push(m);let v=m-o.samplingWindow/lc.SECONDS_PER_MILLISECOND;if(o._frameTimes.length>=2&&o._frameTimes[0]<=v){for(;o._frameTimes.length>=2&&o._frameTimes[1]<v;)o._frameTimes.shift();let y=(m-o._frameTimes[0])/(o._frameTimes.length-1);o._lastFramesPerSecond=1e3/y;let x=1e3/(m>o._warmupPeriodEndTime?o.minimumFrameRateAfterWarmup:o.minimumFrameRateDuringWarmup);y>x?o._frameRateIsLow||(o._frameRateIsLow=!0,o._needsQuietPeriod=!0,o.lowFrameRate.raiseEvent(o.scene,o._lastFramesPerSecond)):o._frameRateIsLow&&(o._frameRateIsLow=!1,o._needsQuietPeriod=!0,o.nominalFrameRate.raiseEvent(o.scene,o._lastFramesPerSecond))}}}function BTi(o){document[o._hiddenPropertyName]?o.pause():o.unpause()}var Z2e=nC;function kTi(o,f,m){return` float clipDistance = clip(gl_FragCoord, ${o}, ${f}); vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = ${m}.rgb; float clippingPlanesEdgeWidth = ${m}.a; if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { out_FragColor = clippingPlanesEdgeColor; } `}var $2e=kTi,VTi=dd(t9e(),1);function ePe(){this._image=new Image}ePe.prototype.isReady=function(){return!0};ePe.prototype.shouldDiscardImage=function(o){return o===this._image};function eB(o){o=Z(o,Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=o.tileDiscardPolicy,this._tilingScheme=new Bd({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new Di(-xe.PI,-xe.PI,xe.PI,xe.PI),ellipsoid:o.ellipsoid});let f=o.credit;typeof f=="string"&&(f=new Cs(f)),this._credit=f,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,N(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new ePe),this._errorEvent=new Br,this._ready=!1;let m=this,v,y;if(N(o.url)){mi("GoogleEarthEnterpriseImageryProvider options.url","options.url was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead.");let x=Jr.createIfNeeded(o.url);y=new TO(x)}N(o.metadata)&&(mi("GoogleEarthEnterpriseImageryProvider options.metadata","options.metadata was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),y=o.metadata),this._metadata=y,N(y)&&(this._readyPromise=y.readyPromise.then(function(x){if(!y.imageryPresent){let C=new sr(`The server ${y.url} doesn't have imagery`);return v=ld.reportError(v,m,m._errorEvent,C.message,void 0,void 0,void 0,C),Promise.reject(C)}return ld.reportSuccess(v),m._ready=x,x}).catch(function(x){return v=ld.reportError(v,m,m._errorEvent,x.message,void 0,void 0,void 0,x),Promise.reject(x)}))}Object.defineProperties(eB.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.ready","GoogleEarthEnterpriseImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._ready}},readyPromise:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.readyPromise","GoogleEarthEnterpriseImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use GoogleEarthEnterpriseImageryProvider.fromMetadata instead."),this._readyPromise}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}},defaultAlpha:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultAlpha","GoogleEarthEnterpriseImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultNightAlpha","GoogleEarthEnterpriseImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultDayAlpha","GoogleEarthEnterpriseImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultBrightness","GoogleEarthEnterpriseImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultContrast","GoogleEarthEnterpriseImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultHue","GoogleEarthEnterpriseImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultSaturation","GoogleEarthEnterpriseImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultGamma","GoogleEarthEnterpriseImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter","GoogleEarthEnterpriseImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});eB.fromMetadata=function(o,f){if(!o.imageryPresent)throw new sr(`The server ${o.url} doesn't have imagery`);let m=new eB(f);return m._metadata=o,m._ready=!0,m._readyPromise=Promise.resolve(!0),m};eB.prototype.getTileCredits=function(o,f,m){let v=this._metadata,y=v.getTileInformation(o,f,m);if(N(y)){let x=v.providers[y.imageryProvider];if(N(x))return[x]}};eB.prototype.requestImage=function(o,f,m,v){let y=this._tileDiscardPolicy._image,x=this._metadata,C=TO.tileXYToQuadKey(o,f,m),w=x.getTileInformation(o,f,m);if(!N(w)){if(x.isValid(C)){let E=new cg({throttle:v.throttle,throttleByServer:v.throttleByServer,type:v.type,priorityFunction:v.priorityFunction});x.populateSubtree(o,f,m,E);return}return Promise.resolve(y)}if(!w.hasImagery())return Promise.resolve(y);let A=zTi(this,w,o,f,m,v).fetchArrayBuffer();if(N(A))return A.then(function(E){p2e(x.key,E);let T=new Uint8Array(E),S,M=x.protoImagery;if((!N(M)||!M)&&(S=HTi(T)),!N(S)&&(!N(M)||M)){let I=UTi(T);S=I.imageType,T=I.imageData}return!N(S)||!N(T)?y:nne({uint8Array:T,format:S,flipY:!0})})};eB.prototype.pickFeatures=function(o,f,m,v,y){};function zTi(o,f,m,v,y,x){let C=TO.tileXYToQuadKey(m,v,y),w=f.imageryVersion;return w=N(w)&&w>0?w:1,o._metadata.resource.getDerivedResource({url:`flatfile?f1-0${C}-i.${w.toString()}`,request:x})}function HTi(o){let f="JFIF";if(o[6]===f.charCodeAt(0)&&o[7]===f.charCodeAt(1)&&o[8]===f.charCodeAt(2)&&o[9]===f.charCodeAt(3))return"image/jpeg";let m="PNG";if(o[1]===m.charCodeAt(0)&&o[2]===m.charCodeAt(1)&&o[3]===m.charCodeAt(2))return"image/png"}function UTi(o){let f=VTi.Reader.create(o),m=f.len,v={};for(;f.pos<m;){let C=f.uint32(),w;switch(C>>>3){case 1:v.imageType=f.uint32();break;case 2:v.imageData=f.bytes();break;case 3:v.alphaType=f.uint32();break;case 4:v.imageAlpha=f.bytes();break;case 5:if(w=v.copyrightIds,N(w)||(w=v.copyrightIds=[]),(C&7)===2){let A=f.uint32()+f.pos;for(;f.pos<A;)w.push(f.uint32())}else w.push(f.uint32());break;default:f.skipType(C&7);break}}let y=v.imageType;if(N(y))switch(y){case 0:v.imageType="image/jpeg";break;case 4:v.imageType="image/png";break;default:throw new sr("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let x=v.alphaType;return N(x)&&x!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete v.alphaType,delete v.imageAlpha),v}var Nnt=eB,GTi=new Re(1,1,1,.4),WTi=new Re(0,1,0,.05),jTi=new Re(0,.5,0,.2);function a4(o){o=Z(o,Z.EMPTY_OBJECT),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=N(o.tilingScheme)?o.tilingScheme:new Bd({ellipsoid:o.ellipsoid}),this._cells=Z(o.cells,8),this._color=Z(o.color,GTi),this._glowColor=Z(o.glowColor,WTi),this._glowWidth=Z(o.glowWidth,6),this._backgroundColor=Z(o.backgroundColor,jTi),this._errorEvent=new Br,this._tileWidth=Z(o.tileWidth,256),this._tileHeight=Z(o.tileHeight,256),this._canvasSize=Z(o.canvasSize,256),this._canvas=this._createGridCanvas(),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(a4.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("GridImageryProvider.ready","GridImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return mi("GridImageryProvider.readyPromise","GridImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return mi("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("GridImageryProvider.defaultAlpha","GridImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha},set:function(o){mi("GridImageryProvider.defaultNightAlpha","GridImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this.defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("GridImageryProvider.defaultDayAlpha","GridImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("GridImageryProvider.defaultBrightness","GridImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("GridImageryProvider.defaultContrast","GridImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("GridImageryProvider.defaultHue","GridImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("GridImageryProvider.defaultSaturation","GridImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("GridImageryProvider.defaultGamma","GridImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("GridImageryProvider.defaultMinificationFilter","GridImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("GridImageryProvider.defaultMagnificationFilter","GridImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});a4.prototype._drawGrid=function(o){let f=this._canvasSize;for(let m=0;m<=this._cells;++m){let v=1+m/this._cells*(f-1);o.moveTo(v,0),o.lineTo(v,f),o.moveTo(0,v),o.lineTo(f,v)}o.stroke()};a4.prototype._createGridCanvas=function(){let o=document.createElement("canvas");o.width=this._canvasSize,o.height=this._canvasSize;let f=0,m=this._canvasSize,v=o.getContext("2d"),y=this._backgroundColor.toCssColorString();v.fillStyle=y,v.fillRect(f,f,m,m);let x=this._glowColor.toCssColorString();v.strokeStyle=x,v.lineWidth=this._glowWidth,v.strokeRect(f,f,m,m),this._drawGrid(v),v.lineWidth=this._glowWidth*.5,v.strokeRect(f,f,m,m),this._drawGrid(v);let C=this._color.toCssColorString();return v.strokeStyle=C,v.lineWidth=2,v.strokeRect(f,f,m,m),v.lineWidth=1,this._drawGrid(v),o};a4.prototype.getTileCredits=function(o,f,m){};a4.prototype.requestImage=function(o,f,m,v){return Promise.resolve(this._canvas)};a4.prototype.pickFeatures=function(o,f,m,v,y){};var Fnt=a4;function tPe(o,f){this._parent=o,this._dataProvider=o._dataProvider,this._layer=o._layer,N(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${f}`}):this._resource=this._parent.resource.getDerivedResource({url:f})}Object.defineProperties(tPe.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});tPe.prototype.load=async function(){return this._data=await nae.loadJson(this._resource,this._dataProvider._traceFetches),this._data};var iPe=tPe;function O6(o,f){this._storageInfo=f,this._parent=o,this._dataProvider=o._dataProvider;let m=`attributes/${f.key}/0`;N(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${m}`}):this._resource=this._parent.resource.getDerivedResource({url:m})}Object.defineProperties(O6.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){return N(this._values)&&N(this._values.attributeValues)?this._values.attributeValues:[]}},name:{get:function(){return this._storageInfo.name}}});function YTi(o){return o==="UInt8"||o==="Int8"?1:o==="UInt16"||o==="Int16"?2:o==="UInt32"||o==="Int32"||o==="Oid32"||o==="Float32"?4:o==="UInt64"||o==="Int64"||o==="Float64"?8:0}O6.prototype.load=function(){let o=this;return this._dataProvider._loadBinary(this._resource).then(function(f){let m=new DataView(f),v=!0;if(m.getUint8(0)==="{".charCodeAt(0)&&new TextDecoder().decode(f).includes("404")&&(v=!1,console.error(`Failed to load: ${o.resource.url}`)),v){o._data=f;let y=o._parseHeader(m),x=YTi(o._storageInfo.attributeValues.valueType);x>0&&(y=Math.ceil(y/x)*x),o._parseBody(m,y)}})};O6.prototype._parseValue=function(o,f,m){let v;if(f==="UInt8")v=o.getUint8(m),m+=1;else if(f==="Int8")v=o.getInt8(m),m+=1;else if(f==="UInt16")v=o.getUint16(m,!0),m+=2;else if(f==="Int16")v=o.getInt16(m,!0),m+=2;else if(f==="UInt32")v=o.getUint32(m,!0),m+=4;else if(f==="Oid32")v=o.getUint32(m,!0),m+=4;else if(f==="Int32")v=o.getInt32(m,!0),m+=4;else if(f==="UInt64"){let y=o.getUint32(m,!0),x=o.getUint32(m+4,!0);v=y+Math.pow(2,32)*x,m+=8}else if(f==="Int64"){let y=o.getUint32(m,!0),x=o.getUint32(m+4,!0);x<Math.pow(2,31)?v=y+Math.pow(2,32)*x:v=y+Math.pow(2,32)*(x-Math.pow(2,32)),m+=8}else f==="Float32"?(v=o.getFloat32(m,!0),m+=4):f==="Float64"?(v=o.getFloat64(m,!0),m+=8):f==="String"&&(v=String.fromCharCode(o.getUint8(m)),m+=1);return{value:v,offset:m}};O6.prototype._parseHeader=function(o){let f=0;this._header={};for(let m=0;m<this._storageInfo.header.length;m++){let v=this._storageInfo.header[m],y=this._parseValue(o,v.valueType,f);this._header[v.property]=y.value,f=y.offset}return f};O6.prototype._parseBody=function(o,f){this._values={};for(let m=0;m<this._storageInfo.ordering.length;m++){let v=this._storageInfo.ordering[m],y=this._storageInfo[v];if(N(y)){this._values[v]=[];for(let x=0;x<this._header.count;++x)if(y.valueType!=="String"){let C=this._parseValue(o,y.valueType,f);this._values[v].push(C.value),f=C.offset}else{let C=this._values.attributeByteCounts[x],w="";for(let A=0;A<C;++A){let E=this._parseValue(o,y.valueType,f);E.value.charCodeAt(0)!==0&&(w+=E.value),f=E.offset}this._values[v].push(w)}}}};var rPe=O6;function eX(o,f){let m=o._dataProvider,v=o._layer,y;N(o._nodeIndex)?y=v.resource.getDerivedResource({url:`nodes/${o._data.mesh.geometry.resource}/${f}`}):y=o.resource.getDerivedResource({url:f}),this._parent=o,this._dataProvider=m,this._layer=v,this._resource=y,this._customAttributes=void 0}Object.defineProperties(eX.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});eX.prototype.load=function(){let o=this;return this._dataProvider._loadBinary(this._resource).then(function(f){return o._data=f,f})};var qTi=new H,XTi=new H,JTi=new H,KTi=new H,QTi=new H;function wpe(o,f,m,v){let y=H.subtract(v,m,qTi),x=H.cross(y,H.subtract(o,m,XTi),KTi),C=H.cross(y,H.subtract(f,m,JTi),QTi);return H.dot(x,C)>=0}var ZTi=new H,$Ti=new H,eSi=new H,tSi=new H,iSi=new H,rSi=new H,nSi=new H,oSi=new H,aSi=new H,sSi=new H;eX.prototype.getClosestPointIndexOnTriangle=function(o,f,m){if(N(this._customAttributes)&&N(this._customAttributes.positions)){let v=new H(o,f,m);v.x-=this._customAttributes.cartesianCenter.x,v.y-=this._customAttributes.cartesianCenter.y,v.z-=this._customAttributes.cartesianCenter.z,Ut.multiplyByVector(this._customAttributes.parentRotation,v,v);let y=Number.MAX_VALUE,x,C,w,A,E=this._customAttributes.positions,T=this._customAttributes.indices,S;N(T)?S=T.length:S=E.length/3;for(let M=0;M<S;M++){let I,P,D;N(T)?(I=T[M],P=T[M+1],D=T[M+2]):(I=M*3,P=M*3+1,D=M*3+2);let L=H.fromElements(E[I*3],E[I*3+1],E[I*3+2],ZTi),R=H.fromElements(E[P*3],E[P*3+1],E[P*3+2],$Ti),O=new H(E[D*3],E[D*3+1],E[D*3+2],eSi);if(!wpe(v,L,R,O)||!wpe(v,R,L,O)||!wpe(v,O,L,R))continue;let F=H.subtract(R,L,tSi),k=H.subtract(O,L,iSi),U=H.cross(F,k,rSi);if(H.magnitude(U)===0)continue;let G=H.normalize(U,nSi),j=H.subtract(v,L,oSi),q=Math.abs(H.dot(j,G));if(q<y){y=q,x=M;let J=H.magnitudeSquared(H.subtract(v,L,j)),X=H.magnitudeSquared(H.subtract(v,R,aSi)),Y=H.magnitudeSquared(H.subtract(v,O,sSi));J<X&&J<Y?(w=I,A=L,C=J):X<Y?(w=P,A=R,C=X):(w=D,A=O,C=Y)}}if(N(x))return{index:w,distanceSquared:C,distance:Math.sqrt(C),queriedPosition:v,closestPosition:H.clone(A)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};eX.prototype._generateGltf=function(o,f,m,v,y,x){let C={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},w=!1,A,E="";if(N(this._parent._data.mesh)&&N(this._layer._data.materialDefinitions)){let I=this._parent._data.mesh.material.definition;if(I>=0&&I<this._layer._data.materialDefinitions.length&&(A=this._layer._data.materialDefinitions[I],C=A,N(C.pbrMetallicRoughness)&&N(C.pbrMetallicRoughness.baseColorTexture))){w=!0,C.pbrMetallicRoughness.baseColorTexture.index=0;let P="0";if(N(this._layer._data.textureSetDefinitions))for(let D=0;D<this._layer._data.textureSetDefinitions.length;D++){let L=this._layer._data.textureSetDefinitions[D];for(let R=0;R<L.formats.length;R++){let O=L.formats[R];if(O.format==="jpg"){P=O.name;break}}}N(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(E=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${P}`}).url)}}else N(this._parent._data.textureData)&&(w=!0,E=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,C.pbrMetallicRoughness.baseColorTexture={index:0});let T=[],S=[],M=[];return w&&(T=[{sampler:0,source:0}],S=[{uri:E}],M=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]),{scene:0,scenes:[{nodes:o}],nodes:f,meshes:m,buffers:v,bufferViews:y,accessors:x,materials:[C],textures:T,images:S,samplers:M,asset:{version:"2.0"}}};var eie=eX;function bC(o,f,m){let v,y,x,C;m?(v=0,y=o):(v=o._level+1,y=o._layer),typeof f=="number"?x=f:C=o.resource.getDerivedResource({url:`${f}/`}),this._parent=o,this._dataProvider=o._dataProvider,this._isRoot=m,this._level=v,this._layer=y,this._nodeIndex=x,this._resource=C,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0}Object.defineProperties(bC.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});bC.prototype.load=async function(){let o=this;function f(){if(!o._isRoot){let y=o._create3DTileDefinition();o._tile=new xC(o._layer._tileset,o._dataProvider.resource,y,o._parent._tile),o._tile._i3sNode=o}}if(!N(this._nodeIndex)){let y=await nae.loadJson(this._resource,this._dataProvider._traceFetches);o._data=y,f();return}let m=await this._layer._getNodeInNodePages(this._nodeIndex);o._data=m;let v;o._isRoot?v="nodes/root/":N(m.mesh)&&(v=`../${m.mesh.geometry.resource}/`),N(v)&&(o._resource=o._parent.resource.getDerivedResource({url:v})),f()};bC.prototype.loadFields=function(){let o=this._layer._data.attributeStorageInfo,f=this;function m(y,x){let C=new rPe(f,y[x]);return f._fields[C._storageInfo.name]=C,C.load()}let v=[];if(N(o))for(let y=0;y<o.length;y++)v.push(m(o,y));return Promise.all(v)};bC.prototype.getFieldsForPickedPosition=function(o){let f=this.geometryData[0];if(!N(f.customAttributes.featureIndex))return{};let m=f.getClosestPointIndexOnTriangle(o.x,o.y,o.z);if(m.index===-1||m.index>f.customAttributes.featureIndex.length)return{};let v=f.customAttributes.featureIndex[m.index];return this.getFieldsForFeature(v)};bC.prototype.getFieldsForFeature=function(o){let f={};for(let m in this.fields)if(this.fields.hasOwnProperty(m)){let v=this.fields[m];o>=0&&o<v.values.length&&(f[v.name]=v.values[o])}return f};bC.prototype._loadChildren=function(){let o=this;if(N(this._childrenReadyPromise))return this._childrenReadyPromise;let f=[];if(N(o._data.children))for(let m=0;m<o._data.children.length;m++){let v=o._data.children[m],y=new bC(o,Z(v.href,v),!1);o._children.push(y),f.push(y.load())}return this._childrenReadyPromise=Promise.all(f).then(function(){for(let m=0;m<o._children.length;m++)o._tile.children.push(o._children[m]._tile)}),this._childrenReadyPromise};bC.prototype._loadGeometryData=function(){let o=[];if(N(this._data.geometryData))for(let f=0;f<this._data.geometryData.length;f++){let m=new eie(this,this._data.geometryData[f].href);this._geometryData.push(m),o.push(m.load())}else if(N(this._data.mesh)){let f=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),m=`./geometries/${f.bufferIndex}/`,v=new eie(this,m);v._geometryDefinitions=f.definition,v._geometryBufferInfo=f.geometryBufferInfo,this._geometryData.push(v),o.push(v.load())}return Promise.all(o)};bC.prototype._loadFeatureData=function(){let o=[];if(N(this._data.featureData))for(let f=0;f<this._data.featureData.length;f++){let m=new iPe(this,this._data.featureData[f].href);this._featureData.push(m),o.push(m.load())}return Promise.all(o)};bC.prototype._clearGeometryData=function(){this._geometryData=[]};bC.prototype._create3DTileDefinition=function(){let o=this._data.obb,f=this._data.mbs;if(!N(o)&&!N(f)){console.error("Failed to load I3S node. Bounding volume is required.");return}let m;if(N(o)?m=Mt.fromDegrees(o.center[0],o.center[1],o.center[2]):m=Mt.fromDegrees(f[0],f[1],f[2]),N(this._dataProvider._geoidDataList)&&N(m))for(let L=0;L<this._dataProvider._geoidDataList.length;L++){let R=this._dataProvider._geoidDataList[L],O=R.projection.project(m);if(O.x>R.nativeExtent.west&&O.x<R.nativeExtent.east&&O.y>R.nativeExtent.south&&O.y<R.nativeExtent.north){m.height+=uSi(O.x,O.y,R);break}}let v={},y,x=0;N(o)?(v={box:[0,0,0,o.halfSize[0],0,0,0,o.halfSize[1],0,0,0,o.halfSize[2]]},x=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),y=ki.WGS84.cartographicToCartesian(m)):(v={sphere:[0,0,0,f[3]]},y=ki.WGS84.cartographicToCartesian(m),x=this._data.mbs[3]),x*=2;let C=1/0;if(N(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let L=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));C=x/L}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let L=this._data.lodThreshold;C=x/L}else console.error("Invalid lodSelectionMetricType in Layer");else if(N(this._data.lodSelection))for(let L=0;L<this._data.lodSelection.length;L++)this._data.lodSelection[L].metricType==="maxScreenThreshold"&&(C=x/this._data.lodSelection[L].maxError);C===1/0&&(C=1e5);let w=C*16,A=new dl(0,0,0),E=tn.headingPitchRollQuaternion(y,A);N(this._data.obb)&&(E=new Gr(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let T=Ut.fromQuaternion(E),S=Ut.inverse(T,new Ut),M=new Ee(T[0],T[1],T[2],0,T[3],T[4],T[5],0,T[6],T[7],T[8],0,y.x,y.y,y.z,1),I=Ee.inverse(M,new Ee),P=Ee.clone(M);N(this._parent._globalTransform)&&Ee.multiply(M,this._parent._inverseGlobalTransform,P),this._globalTransform=M,this._inverseGlobalTransform=I,this._inverseRotationMatrix=S;let D=[];for(let L=0;L<this._children.length;L++)D.push(this._children[L]._create3DTileDefinition());return{children:D,refine:"REPLACE",boundingVolume:v,transform:[P[0],P[4],P[8],P[12],P[1],P[5],P[9],P[13],P[2],P[6],P[10],P[14],P[3],P[7],P[11],P[15]],content:{uri:N(this._resource)?this._resource.url:void 0},geometricError:w}};bC.prototype._createI3SDecoderTask=async function(o,f){let m=f.geometryData._parent._data,v=f.geometryData._parent._inverseRotationMatrix,y=0,x=0,C=0;N(m.obb)?(y=m.obb.center[0],x=m.obb.center[1],C=m.obb.center[2]):N(m.mbs)&&(y=m.mbs[0],x=m.mbs[1],C=m.mbs[2]);let w=Ut.fromRotationX(-xe.PI_OVER_TWO),A=new Ut;Ut.multiply(w,v,A);let E=Mt.fromDegrees(y,x,C),T=ki.WGS84.cartographicToCartesian(E),S={binaryData:f.geometryData._data,featureData:N(f.featureData)&&N(f.featureData[0])?f.featureData[0].data:void 0,schema:f.defaultGeometrySchema,bufferInfo:f.geometryData._geometryBufferInfo,ellipsoidRadiiSquare:ki.WGS84.radiiSquared,url:f.url,geoidDataList:f.geometryData._dataProvider._geoidDataList,cartographicCenter:E,cartesianCenter:T,parentRotation:A},M=[];return o.scheduleTask(S,M)};bC.prototype._createContentURL=async function(){let o={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},f=await this._dataProvider.getDecoderTaskProcessor(),m=[this._loadGeometryData()];this._dataProvider.legacyVersion16&&m.push(this._loadFeatureData());let v=this;return Promise.all(m).then(function(){let y=Promise.resolve();if(N(v._geometryData)&&v._geometryData.length>0){let x={geometryData:v._geometryData[0],featureData:v._featureData,defaultGeometrySchema:v._layer._data.store.defaultGeometrySchema,url:v._geometryData[0].resource.url,tile:v._tile},C=v._createI3SDecoderTask(f,x);if(!N(C))return;y=C.then(function(w){o=x.geometryData._generateGltf(w.meshData.nodesInScene,w.meshData.nodes,w.meshData.meshes,w.meshData.buffers,w.meshData.bufferViews,w.meshData.accessors),v._geometryData[0]._customAttributes=w.meshData._customAttributes})}return y.then(function(){let x=v._dataProvider._binarizeGltf(o),C=new Blob([x],{type:"application/binary"});return URL.createObjectURL(C)})})};xC.prototype._hookedRequestContent=xC.prototype.requestContent;xC.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading)return this._isLoading=!0,this._i3sNode._createContentURL().then(o=>{if(!N(o)){this._isLoading=!1;return}return this._contentResource=new Jr({url:o}),this._hookedRequestContent()}).then(o=>(this._isLoading=!1,o))};function lSi(o,f,m,v,y,x){let C=m*(1-o)+v*o,w=y*(1-o)+x*o;return C*(1-f)+w*f}function l$(o,f,m,v){let y=o+f*m;return v[y]}function uSi(o,f,m){let v=m.nativeExtent,y=(o-v.west)/(v.east-v.west)*(m.width-1),x=(f-v.south)/(v.north-v.south)*(m.height-1),C=Math.floor(y),w=Math.floor(x);y-=C,x-=w;let A=C<m.width?C+1:C,E=w<m.height?w+1:w;w=m.height-1-w,E=m.height-1-E;let T=l$(C,w,m.width,m.buffer),S=l$(A,w,m.width,m.buffer),M=l$(C,E,m.width,m.buffer),I=l$(A,E,m.width,m.buffer),P=lSi(y,x,T,S,M,I);return P=P*m.scale+m.offset,P}Object.defineProperties(xC.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var tie=bC;function Uw(o,f,m){this._dataProvider=o,N(f.href)||(f.href=`./layers/${m}`);let v=this._dataProvider.resource.getUrlComponent(),y="";v.match(/layers\/\d/)?y=`${v}`.replace(/\/+$/,""):y=`${v}`.replace(/\/?$/,"/").concat(`${f.href}`),this._version=f.store.version;let x=this._version.split(".");this._majorVersion=parseInt(x[0]),this._minorVersion=x.length>1?parseInt(x[1]):0,this._resource=new Jr({url:y}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=f,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Uw.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(N(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Uw.prototype.load=async function(){if(this._data.spatialReference.wkid!==4326&&this._data.spatialReference.wkid!==4490)throw new sr(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(await this._dataProvider.loadGeoidData(),await this._loadRootNode(),await this._create3DTileset(),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Uw.prototype._computeGeometryDefinitions=function(o){if(this._geometryDefinitions=[],N(this._data.geometryDefinitions))for(let f=0;f<this._data.geometryDefinitions.length;f++){let m=[],v=this._data.geometryDefinitions[f].geometryBuffers;for(let y=0;y<v.length;y++){let x=v[y],C=[],w=!1;if(N(x.compressedAttributes)&&o){w=!0;let A=x.compressedAttributes.attributes;for(let E=0;E<A.length;E++)C.push(A[E])}else for(let A in x)A!=="offset"&&C.push(A);m.push({compressed:w,attributes:C,index:v.indexOf(x)})}m.sort(function(y,x){return y.compressed&&!x.compressed?-1:!y.compressed&&x.compressed?1:y.attributes.length-x.attributes.length}),this._geometryDefinitions.push(m)}};Uw.prototype._findBestGeometryBuffers=function(o,f){let m=this._geometryDefinitions[o];if(N(m))for(let v=0;v<m.length;++v){let y=m[v],x=!1,C=y.attributes;for(let w=0;w<f.length;w++)if(!C.includes(f[w])){x=!0;break}if(!x)return{bufferIndex:y.index,definition:m,geometryBufferInfo:y}}return 0};Uw.prototype._loadRootNode=function(){if(N(this._data.nodePages)){let o=0;N(this._data.nodePages.rootIndex)&&(o=this._data.nodePages.rootIndex),this._rootNode=new tie(this,o,!0)}else this._rootNode=new tie(this,this._data.store.rootNode,!0);return this._rootNode.load()};Uw.prototype._getNodeInNodePages=function(o){let f=Math.floor(o/this._data.nodePages.nodesPerPage),m=o%this._data.nodePages.nodesPerPage,v=this;return this._loadNodePage(f).then(function(){return v._nodePages[f][m]})};Uw._fetchJson=function(o){return o.fetchJson()};Uw.prototype._loadNodePage=function(o){let f=this;if(!N(this._nodePageFetches[o])){let m=this.resource.getDerivedResource({url:`nodepages/${o}/`}),v=Uw._fetchJson(m).then(function(y){return N(y.error)&&y.error.code!==200?Promise.reject(y.error):(f._nodePages[o]=y.nodes,y)});this._nodePageFetches[o]=v}return this._nodePageFetches[o]};Uw.prototype._computeExtent=function(){N(this._data.fullExtent)?this._extent=Di.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):N(this._data.store.extent)&&(this._extent=Di.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Uw.prototype._create3DTileset=async function(){let o={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},f=new Blob([JSON.stringify(o)],{type:"application/json"}),m=URL.createObjectURL(f),v={};if(N(this._dataProvider._cesium3dTilesetOptions))for(let y in this._dataProvider._cesium3dTilesetOptions)this._dataProvider._cesium3dTilesetOptions.hasOwnProperty(y)&&(v[y]=this._dataProvider._cesium3dTilesetOptions[y]);this._tileset=await pg.fromUrl(m,v),this._tileset.show=this._dataProvider.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(y){y._i3sNode._clearGeometryData(),URL.revokeObjectURL(y._contentResource._url),y._contentResource=y._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(y){N(y._i3sNode)&&y._i3sNode._loadChildren()})};var iU=Uw,cSi=dd(X1t(),1);function wm(o){o=Z(o,Z.EMPTY_OBJECT),this._name=o.name,this._show=Z(o.show,!0),this._geoidTiledTerrainProvider=o.geoidTiledTerrainProvider,this._traceFetches=Z(o.traceFetches,!1),this._cesium3dTilesetOptions=Z(o.cesium3dTilesetOptions,Z.EMPTY_OBJECT),this._layers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,N(o.url)&&(mi("I3SDataProvider options.url","I3SDataProvider constructor parameter options.url was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise=void 0,this._ready=!1,this._resource=Jr.createIfNeeded(o.url),this._load())}Object.defineProperties(wm.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(o){this._show=o;for(let f=0;f<this._layers.length;f++)N(this._layers[f]._tileset)&&(this._layers[f]._tileset.show=this._show)}},traceFetches:{get:function(){return this._traceFetches},set:function(o){this._traceFetches=o}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},readyPromise:{get:function(){return mi("I3SDataProvider.readyPromise","I3SDataProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._readyPromise}},ready:{get:function(){return mi("I3SDataProvider.ready","I3SDataProvider.ready was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use I3SDataProvider.fromUrl instead."),this._ready}},resource:{get:function(){return this._resource}}});wm.prototype.destroy=function(){for(let o=0;o<this._layers.length;o++)N(this._layers[o]._tileset)&&this._layers[o]._tileset.destroy();return kr(this)};wm.prototype.isDestroyed=function(){return!1};wm.prototype.update=function(o){for(let f=0;f<this._layers.length;f++)N(this._layers[f]._tileset)&&this._layers[f]._tileset.update(o)};wm.prototype.prePassesUpdate=function(o){for(let f=0;f<this._layers.length;f++)N(this._layers[f]._tileset)&&this._layers[f]._tileset.prePassesUpdate(o)};wm.prototype.postPassesUpdate=function(o){for(let f=0;f<this._layers.length;f++)N(this._layers[f]._tileset)&&this._layers[f]._tileset.postPassesUpdate(o)};wm.prototype.updateForPass=function(o,f){for(let m=0;m<this._layers.length;m++)N(this._layers[m]._tileset)&&this._layers[m]._tileset.updateForPass(o,f)};wm.fromUrl=async function(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=Jr.createIfNeeded(o),v=await wm.loadJson(m),y=new wm(f);if(y._resource=m,y._data=v,N(v.layers))for(let C=0;C<v.layers.length;C++){let w=new iU(y,v.layers[C],C);y._layers.push(w)}else{let C=new iU(y,v,v.id);y._layers.push(C)}y._computeExtent();let x=[];for(let C=0;C<y._layers.length;C++)x.push(y._layers[C].load());return await Promise.all(x),y._ready=!0,y._readyPromise=Promise.resolve(y),y};wm.prototype._load=function(){let o=this;return this._readyPromise=wm.loadJson(this._resource,this._traceFetches).then(function(f){if(o._data=f,N(f.layers))for(let v=0;v<f.layers.length;v++){let y=new iU(o,f.layers[v],v);o._layers.push(y)}else{let v=new iU(o,f,f.id);o._layers.push(v)}o._computeExtent();let m=[];for(let v=0;v<o._layers.length;v++)m.push(o._layers[v].load());return Promise.all(m).then(function(){return o._ready=!0,o})}),this._readyPromise};wm._fetchJson=function(o){return o.fetchJson()};wm.loadJson=async function(o,f){f&&console.log("I3S FETCH:",o.url);let m=await wm._fetchJson(o);if(N(m.error)){if(console.error("Failed to fetch I3S ",o.url),N(m.error.message)&&console.error(m.error.message),N(m.error.details))for(let v=0;v<m.error.details.length;v++)console.log(m.error.details[v]);throw new sr(m.error)}return m};wm.prototype._loadBinary=function(o){return this._traceFetches&&console.log("I3S FETCH:",o.url),o.fetchArrayBuffer()};wm.prototype._binarizeGltf=function(o){let f=new TextEncoder().encode(JSON.stringify(o)),m=new Uint8Array(f.byteLength+20),v={magic:new Uint8Array(m.buffer,0,4),version:new Uint32Array(m.buffer,4,1),length:new Uint32Array(m.buffer,8,1),chunkLength:new Uint32Array(m.buffer,12,1),chunkType:new Uint32Array(m.buffer,16,1),chunkData:new Uint8Array(m.buffer,20,f.byteLength)};return v.magic[0]="g".charCodeAt(),v.magic[1]="l".charCodeAt(),v.magic[2]="T".charCodeAt(),v.magic[3]="F".charCodeAt(),v.version[0]=2,v.length[0]=m.byteLength,v.chunkLength[0]=f.byteLength,v.chunkType[0]=1313821514,v.chunkData.set(f),m};wm.prototype.getDecoderTaskProcessor=function(){if(N(this._taskProcessorReadyPromise))return this._taskProcessorReadyPromise;if(!N(this._decoderTaskProcessor)){let o=new tp("decodeI3S");this._taskProcessorReadyPromise=o.initWebAssemblyModule({modulePath:"ThirdParty/Workers/draco_decoder_nodejs.js",wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(()=>o),this._decoderTaskProcessor=o}return this._taskProcessorReadyPromise};function hSi(o,f){return fSi(o,f)}var dSi=new Ye;function fSi(o,f){let m=o.tilingScheme,v=[],y={},x=o._lodCount,C=Mt.fromRadians(f.west,f.north),w=Mt.fromRadians(f.east,f.south),A=m.positionToTileXY(C,x),E=m.positionToTileXY(w,x);for(let S=A.x;S<=E.x;S++)for(let M=A.y;M<=E.y;M++){let I=Ye.fromElements(S,M,dSi),P=I.toString();if(!y.hasOwnProperty(P)){let D={x:I.x,y:I.y,level:x,tilingScheme:m,terrainProvider:o,positions:[]};y[P]=D,v.push(D)}}let T=[];for(let S=0;S<v.length;++S){let M=v[S],I=M.terrainProvider.requestTileGeometry(M.x,M.y,M.level);T.push(I)}return Promise.all(T).then(function(S){let M=[];for(let I=0;I<S.length;I++){let P={tilingScheme:m,x:v[I].x,y:v[I].y,level:v[I].level},D=S[I],L="Geographic";m._projection instanceof hd&&(L="WebMercator");let R={projectionType:L,projection:m._projection,nativeExtent:m.tileXYToNativeRectangle(P.x,P.y,P.level),height:D._height,width:D._width,scale:D._structure.heightScale,offset:D._structure.heightOffset};if(D._encoding===U3.LERC){let O=cSi.default.decode(D._buffer);R.buffer=O.pixels[0]}else R.buffer=D._buffer;M.push(R)}return M})}async function pSi(o){let f=o._geoidTiledTerrainProvider;if(!N(f)){console.log("No Geoid Terrain service provided - no geoid conversion will be performed.");return}try{let m=await hSi(f,o._extent);o._geoidDataList=m}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}wm.prototype.loadGeoidData=async function(){return N(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=pSi(this),this._geoidDataPromise)};wm.prototype._computeExtent=function(){let o;for(let f=0;f<this._layers.length;f++)if(N(this._layers[f]._extent)){let m=this._layers[f]._extent;N(o)?Di.union(o,m,o):o=Di.clone(m)}this._extent=o};var nae=wm,Bnt=Object.freeze({UNLOADED:0,RECEIVING:1,RECEIVED:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function oae(o,f){this.spatialNode=o,this.keyframe=f,this.state=Bnt.UNLOADED,this.metadatas=[],this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}oae.priorityComparator=function(o,f){return o.priority-f.priority};oae.searchComparator=function(o,f){return o.keyframe-f.keyframe};oae.LoadState=Bnt;var _h=oae;function knt(){}Object.defineProperties(knt.prototype,{color:{get:li.throwInstantiationError},intensity:{get:li.throwInstantiationError}});var Vnt=knt,mSi=/\/$/,znt=new Cs('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function N6(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.styleId,m=o.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let v=Jr.createIfNeeded(Z(o.url,"https://api.mapbox.com/styles/v1/"));this._styleId=f,this._accessToken=m;let y=Z(o.tilesize,512);this._tilesize=y;let x=Z(o.username,"mapbox");this._username=x;let C=N(o.scaleFactor)?"@2x":"",w=v.getUrlComponent();mSi.test(w)||(w+="/"),w+=`${this._username}/${f}/tiles/${this._tilesize}/{z}/{x}/{y}${C}`,v.url=w,v.setQueryParameters({access_token:m});let A;N(o.credit)?(A=o.credit,typeof A=="string"&&(A=new Cs(A))):A=znt,this._resource=v,this._imageryProvider=new Xv({url:v,credit:A,ellipsoid:o.ellipsoid,minimumLevel:o.minimumLevel,maximumLevel:o.maximumLevel,rectangle:o.rectangle}),this._ready=!0,this._readyPromise=Promise.resolve(!0)}Object.defineProperties(N6.prototype,{url:{get:function(){return this._imageryProvider.url}},ready:{get:function(){return mi("MapboxStyleImageryProvider.ready","MapboxStyleImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.ready}},readyPromise:{get:function(){return mi("MapboxStyleImageryProvider.readyPromise","MapboxStyleImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._imageryProvider.readyPromise}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},defaultAlpha:{get:function(){return mi("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("MapboxStyleImageryProvider.defaultAlpha","MapboxStyleImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(o){mi("MapboxStyleImageryProvider.defaultNightAlpha","MapboxStyleImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("MapboxStyleImageryProvider.defaultDayAlpha","MapboxStyleImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("MapboxStyleImageryProvider.defaultBrightness","MapboxStyleImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("MapboxStyleImageryProvider.defaultContrast","MapboxStyleImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("MapboxStyleImageryProvider.defaultHue","MapboxStyleImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("MapboxStyleImageryProvider.defaultSaturation","MapboxStyleImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("MapboxStyleImageryProvider.defaultGamma","MapboxStyleImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("MapboxStyleImageryProvider.defaultMinificationFilter","MapboxStyleImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("MapboxStyleImageryProvider.defaultMagnificationFilter","MapboxStyleImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});N6.prototype.getTileCredits=function(o,f,m){};N6.prototype.requestImage=function(o,f,m,v){return this._imageryProvider.requestImage(o,f,m,v)};N6.prototype.pickFeatures=function(o,f,m,v,y){return this._imageryProvider.pickFeatures(o,f,m,v,y)};N6._defaultCredit=znt;var Hnt=N6;function PO(o,f,m,v,y){v===ds.UNSIGNED_SHORT&&(v=ds.FLOAT32);let x=o.floatingPointTexture;if(v===ds.FLOAT32&&!x)throw new sr("Floating point texture not supported");let C;v===ds.FLOAT32||v===ds.FLOAT64?C=Rn.FLOAT:v===ds.UINT8&&(C=Rn.UNSIGNED_BYTE);let w;m===1?w=o.webgl2?Nn.RED:Nn.LUMINANCE:m===2?w=o.webgl2?Nn.RG:Nn.LUMINANCE_ALPHA:m===3?w=Nn.RGB:m===4&&(w=Nn.RGBA);let A=512*1024*1024,E=128*1024*1024;y=Math.min(Z(y,E),A);let T=Bo.maximumTextureSize,S=ds.getSizeInBytes(v),M=Math.floor(y/(m*S)),I=Math.min(T,xe.previousPowerOfTwo(Math.floor(Math.sqrt(M)))),P=Math.ceil(Math.sqrt(f.x)),D=Math.ceil(f.z/P),L=P*f.x,R=D*f.y,O=Math.floor(I/L),F=Math.floor(I/R);if(O===0||F===0)throw new sr("Tileset is too large to fit into megatexture");this.channelCount=m,this.componentType=v,this.voxelCountPerTile=H.clone(f,new H),this.maximumTileCount=O*F,this.regionCountPerMegatexture=new Ye(O,F),this.voxelCountPerRegion=new Ye(L,R),this.sliceCountPerRegion=new Ye(P,D),this.voxelSizeUv=new Ye(1/I,1/I),this.sliceSizeUv=new Ye(f.x/I,f.y/I),this.regionSizeUv=new Ye(L/I,R/I),this.texture=new _o({context:o,pixelFormat:w,pixelDatatype:C,flipY:!1,width:I,height:I,sampler:new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR})});let k=ds.toComponentDatatype(v);this.tileVoxelDataTemp=Rt.createTypedArray(k,L*R*m),this.nodes=new Array(this.maximumTileCount);for(let U=0;U<this.maximumTileCount;U++)this.nodes[U]=new gSi(U);for(let U=0;U<this.maximumTileCount;U++){let G=this.nodes[U];G.previousNode=U>0?this.nodes[U-1]:void 0,G.nextNode=U<this.maximumTileCount-1?this.nodes[U+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function gSi(o){this.index=o,this.nextNode=void 0,this.previousNode=void 0}PO.prototype.add=function(o){if(this.isFull())throw new li("Trying to add when there are no empty spots");let f=this.emptyList;this.emptyList=this.emptyList.nextNode,N(this.emptyList)&&(this.emptyList.previousNode=void 0),f.nextNode=this.occupiedList,N(f.nextNode)&&(f.nextNode.previousNode=f),this.occupiedList=f;let m=f.index;return this.writeDataToTexture(m,o),this.occupiedCount++,m};PO.prototype.remove=function(o){if(o<0||o>=this.maximumTileCount)throw new li("Megatexture index out of bounds");let f=this.nodes[o];N(f.previousNode)&&(f.previousNode.nextNode=f.nextNode),N(f.nextNode)&&(f.nextNode.previousNode=f.previousNode),f.nextNode=this.emptyList,N(f.nextNode)&&(f.nextNode.previousNode=f),f.previousNode=void 0,this.emptyList=f,this.occupiedCount--};PO.prototype.isFull=function(){return this.emptyList===void 0};PO.getApproximateTextureMemoryByteLength=function(o,f,m,v){v===ds.UNSIGNED_SHORT&&(v=ds.FLOAT32);let y=ds.getSizeInBytes(v),x=o*f.x*f.y*f.z,C=Math.ceil(Math.sqrt(f.z)),w=Math.ceil(f.z/C),A=C*f.x,E=w*f.y,T=xe.previousPowerOfTwo(Math.floor(Math.sqrt(x)));for(;;){let S=Math.floor(T/A),M=Math.floor(T/E);if(S*M>=o)break;T*=2}return T*T*m*y};PO.prototype.writeDataToTexture=function(o,f){let m=f.constructor===Uint16Array?new Float32Array(f):f,v=this.voxelCountPerTile,y=this.sliceCountPerRegion,x=this.voxelCountPerRegion,C=this.channelCount,w=this.tileVoxelDataTemp;for(let P=0;P<v.z;P++){let D=P%y.x*v.x,L=Math.floor(P/y.x)*v.y;for(let R=0;R<v.y;R++)for(let O=0;O<v.x;O++){let F=P*v.y*v.x+R*v.x+O,k=(L+R)*x.x+(D+O);for(let U=0;U<C;U++)w[k*C+U]=m[F*C+U]}}let A=this.regionCountPerMegatexture,E=x.x,T=x.y,S=o%A.x*x.x,M=Math.floor(o/A.x)*x.y,I={source:{arrayBufferView:w,width:E,height:T},xOffset:S,yOffset:M};this.texture.copyFrom(I)};PO.prototype.isDestroyed=function(){return!1};PO.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),kr(this)};var aae=PO;function nPe(o){}nPe.prototype.isReady=function(){return!0};nPe.prototype.shouldDiscardImage=function(o){return!1};var Unt=nPe,_Si=new Cs("MapQuest, Open Street Map and contributors, CC-BY-SA");function mee(o){o=Z(o,Z.EMPTY_OBJECT);let f=Jr.createIfNeeded(Z(o.url,"https://a.tile.openstreetmap.org/"));f.appendForwardSlash(),f.url+=`{z}/{x}/{y}.${Z(o.fileExtension,"png")}`;let m=new Mm({ellipsoid:o.ellipsoid}),v=256,y=256,x=Z(o.minimumLevel,0),C=o.maximumLevel,w=Z(o.rectangle,m.rectangle),A=m.positionToTileXY(Di.southwest(w),x),E=m.positionToTileXY(Di.northeast(w),x),T=(Math.abs(E.x-A.x)+1)*(Math.abs(E.y-A.y)+1),S=Z(o.credit,_Si);typeof S=="string"&&(S=new Cs(S)),Xv.call(this,{url:f,credit:S,tilingScheme:m,tileWidth:v,tileHeight:y,minimumLevel:x,maximumLevel:C,rectangle:w})}N(Object.create)&&(mee.prototype=Object.create(Xv.prototype),mee.prototype.constructor=mee);var pM=mee,vSi=new Ye(1,1);function oPe(o){o=Z(o,Z.EMPTY_OBJECT),this.mass=Z(o.mass,1),this.position=H.clone(Z(o.position,H.ZERO)),this.velocity=H.clone(Z(o.velocity,H.ZERO)),this.life=Z(o.life,Number.MAX_VALUE),this.image=o.image,this.startColor=Re.clone(Z(o.startColor,Re.WHITE)),this.endColor=Re.clone(Z(o.endColor,Re.WHITE)),this.startScale=Z(o.startScale,1),this.endScale=Z(o.endScale,1),this.imageSize=Ye.clone(Z(o.imageSize,vSi)),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(oPe.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var L6e=new H;oPe.prototype.update=function(o,f){return H.multiplyByScalar(this.velocity,o,L6e),H.add(this.position,L6e,this.position),N(f)&&f(this,o),this._age+=o,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var sae=oPe;function Gnt(o){o=Z(o,Z.EMPTY_OBJECT),this.time=Z(o.time,0),this.minimum=Z(o.minimum,0),this.maximum=Z(o.maximum,50),this._complete=!1}Object.defineProperties(Gnt.prototype,{complete:{get:function(){return this._complete}}});var F6=Gnt;function Wnt(o){}Wnt.prototype.emit=function(o){li.throwInstantiationError()};var jnt=Wnt,R6e=new Ye(1,1);function tX(o){o=Z(o,Z.EMPTY_OBJECT),this.show=Z(o.show,!0),this.updateCallback=o.updateCallback,this.loop=Z(o.loop,!0),this.image=Z(o.image,void 0);let f=o.emitter;N(f)||(f=new Y2e(.5)),this._emitter=f,this._bursts=o.bursts,this._modelMatrix=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),this._emitterModelMatrix=Ee.clone(Z(o.emitterModelMatrix,Ee.IDENTITY)),this._matrixDirty=!0,this._combinedMatrix=new Ee,this._startColor=Re.clone(Z(o.color,Z(o.startColor,Re.WHITE))),this._endColor=Re.clone(Z(o.color,Z(o.endColor,Re.WHITE))),this._startScale=Z(o.scale,Z(o.startScale,1)),this._endScale=Z(o.scale,Z(o.endScale,1)),this._emissionRate=Z(o.emissionRate,5),this._minimumSpeed=Z(o.speed,Z(o.minimumSpeed,1)),this._maximumSpeed=Z(o.speed,Z(o.maximumSpeed,1)),this._minimumParticleLife=Z(o.particleLife,Z(o.minimumParticleLife,5)),this._maximumParticleLife=Z(o.particleLife,Z(o.maximumParticleLife,5)),this._minimumMass=Z(o.mass,Z(o.minimumMass,1)),this._maximumMass=Z(o.mass,Z(o.maximumMass,1)),this._minimumImageSize=Ye.clone(Z(o.imageSize,Z(o.minimumImageSize,R6e))),this._maximumImageSize=Ye.clone(Z(o.imageSize,Z(o.maximumImageSize,R6e))),this._sizeInMeters=Z(o.sizeInMeters,!1),this._lifetime=Z(o.lifetime,Number.MAX_VALUE),this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new Br,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(tX.prototype,{emitter:{get:function(){return this._emitter},set:function(o){this._emitter=o}},bursts:{get:function(){return this._bursts},set:function(o){this._bursts=o,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(o){this._matrixDirty=this._matrixDirty||!Ee.equals(this._modelMatrix,o),Ee.clone(o,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(o){this._matrixDirty=this._matrixDirty||!Ee.equals(this._emitterModelMatrix,o),Ee.clone(o,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(o){Re.clone(o,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(o){Re.clone(o,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(o){this._startScale=o}},endScale:{get:function(){return this._endScale},set:function(o){this._endScale=o}},emissionRate:{get:function(){return this._emissionRate},set:function(o){this._emissionRate=o,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(o){this._minimumSpeed=o}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(o){this._maximumSpeed=o}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(o){this._minimumParticleLife=o}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(o){this._maximumParticleLife=o,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(o){this._minimumMass=o}},maximumMass:{get:function(){return this._maximumMass},set:function(o){this._maximumMass=o}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(o){this._minimumImageSize=o}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(o){this._maximumImageSize=o}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(o){this._sizeInMeters=o}},lifetime:{get:function(){return this._lifetime},set:function(o){this._lifetime=o}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function ySi(o){let f=o._emissionRate,m=o._maximumParticleLife,v=0,y=o._bursts;if(N(y)){let S=y.length;for(let M=0;M<S;++M)v+=y[M].maximum}let x=o._billboardCollection,C=o.image,w=Math.ceil(f*m+v),A=o._particles,E=o._particlePool,T=Math.max(w-A.length-E.length,0);for(let S=0;S<T;++S){let M=new sae;M._billboard=x.add({image:C,show:!1}),E.push(M)}o._particleEstimate=w}function xSi(o){let f=o._particlePool.pop();return N(f)||(f=new sae),f}function CSi(o,f){o._particlePool.push(f)}function bSi(o){let f=o._particles,m=o._particlePool,v=o._billboardCollection,y=f.length,x=m.length,C=o._particleEstimate,w=x-Math.max(C-y-x,0);for(let A=w;A<x;++A){let E=m[A];v.remove(E._billboard)}m.length=w}function wSi(o){N(o._billboard)&&(o._billboard.show=!1)}function O6e(o,f){let m=f._billboard;N(m)||(m=f._billboard=o._billboardCollection.add({image:f.image})),m.width=f.imageSize.x,m.height=f.imageSize.y,m.position=f.position,m.sizeInMeters=o.sizeInMeters,m.show=!0;let v=xe.lerp(f.startColor.red,f.endColor.red,f.normalizedAge),y=xe.lerp(f.startColor.green,f.endColor.green,f.normalizedAge),x=xe.lerp(f.startColor.blue,f.endColor.blue,f.normalizedAge),C=xe.lerp(f.startColor.alpha,f.endColor.alpha,f.normalizedAge);m.color=new Re(v,y,x,C),m.scale=xe.lerp(f.startScale,f.endScale,f.normalizedAge)}function ASi(o,f){f.startColor=Re.clone(o._startColor,f.startColor),f.endColor=Re.clone(o._endColor,f.endColor),f.startScale=o._startScale,f.endScale=o._endScale,f.image=o.image,f.life=xe.randomBetween(o._minimumParticleLife,o._maximumParticleLife),f.mass=xe.randomBetween(o._minimumMass,o._maximumMass),f.imageSize.x=xe.randomBetween(o._minimumImageSize.x,o._maximumImageSize.x),f.imageSize.y=xe.randomBetween(o._minimumImageSize.y,o._maximumImageSize.y),f._normalizedAge=0,f._age=0;let m=xe.randomBetween(o._minimumSpeed,o._maximumSpeed);H.multiplyByScalar(f.velocity,m,f.velocity),o._particles.push(f)}function ESi(o,f){if(o._isComplete)return 0;f=xe.mod(f,o._lifetime);let m=f*o._emissionRate,v=Math.floor(m);if(o._carryOver+=m-v,o._carryOver>1&&(v++,o._carryOver-=1),N(o.bursts)){let y=o.bursts.length;for(let x=0;x<y;x++){let C=o.bursts[x],w=o._currentTime;N(C)&&!C._complete&&w>C.time&&(v+=xe.randomBetween(C.minimum,C.maximum),C._complete=!0)}}return v}var u$=new H;tX.prototype.update=function(o){if(!this.show)return;N(this._billboardCollection)||(this._billboardCollection=new XE),this._updateParticlePool&&(ySi(this),this._updateParticlePool=!1);let f=0;this._previousTime&&(f=ci.secondsDifference(o.time,this._previousTime)),f<0&&(f=0);let m=this._particles,v=this._emitter,y=this.updateCallback,x,C,w=m.length;for(x=0;x<w;++x)C=m[x],C.update(f,y)?O6e(this,C):(wSi(C),CSi(this,C),m[x]=m[w-1],--x,--w);m.length=w;let A=ESi(this,f);if(A>0&&N(v)){this._matrixDirty&&(this._combinedMatrix=Ee.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let E=this._combinedMatrix;for(x=0;x<A;x++)C=xSi(this),this._emitter.emit(C),H.add(C.position,C.velocity,u$),Ee.multiplyByPoint(E,u$,u$),C.position=Ee.multiplyByPoint(E,C.position,C.position),H.subtract(u$,C.position,C.velocity),H.normalize(C.velocity,C.velocity),ASi(this,C),O6e(this,C)}if(this._billboardCollection.update(o),this._previousTime=ci.clone(o.time,this._previousTime),this._currentTime+=f,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=xe.mod(this._currentTime,this._lifetime),this.bursts){let E=this.bursts.length;for(x=0;x<E;x++)this.bursts[x]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);o.frameNumber%120===0&&bSi(this)};tX.prototype.isDestroyed=function(){return!1};tX.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),kr(this)};var sA=tX,TSi=dd(d0e(),1),SSi={modifyFragmentShader:function(o){return o=Zr.replaceMain(o,"czm_splitter_main"),o+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; #endif czm_splitter_main(); } `,o},addUniforms:function(o,f){f.czm_splitDirection=function(){return o.splitDirection}}},lae=SSi,QF={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function iX(o){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=Re.clone(Re.DARKGRAY),this._highlightColor=Re.clone(Re.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=QF.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=o.vertexShaderLoaded,this._fragmentShaderLoaded=o.fragmentShaderLoaded,this._uniformMapLoaded=o.uniformMapLoaded,this._batchTableLoaded=o.batchTableLoaded,this._pickIdLoaded=o.pickIdLoaded,this._opaquePass=Z(o.opaquePass,vr.OPAQUE),this._cull=Z(o.cull,!0),this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=Ee.clone(Ee.IDENTITY),this._modelMatrix=Ee.clone(Ee.IDENTITY),this.time=0,this.shadows=Cl.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=Z(o.splitDirection,eD.NONE),this._splittingEnabled=!1,this._error=void 0,PSi(this,o)}Object.defineProperties(iX.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return Re.clone(this._highlightColor)},set:function(o){this._highlightColor=Re.clone(o,this._highlightColor)}},boundingSphere:{get:function(){if(N(this._drawCommand))return this._drawCommand.boundingVolume},set:function(o){this._boundingSphere=Pi.clone(o,this._boundingSphere)}}});function PSi(o,f){let m=Dne.parse(f.arrayBuffer,f.byteOffset);if(o._parsedContent=m,o._rtcCenter=m.rtcCenter,o._hasNormals=m.hasNormals,o._hasColors=m.hasColors,o._hasBatchIds=m.hasBatchIds,o._isTranslucent=m.isTranslucent,!m.hasBatchIds&&N(m.batchTableBinary)&&(m.styleableProperties=UY.getBinaryProperties(m.pointsLength,m.batchTableJson,m.batchTableBinary)),N(m.draco)){let w=m.draco;o._decodingState=QF.NEEDS_DECODE,w.dequantizeInShader=o._dequantizeInShader}let v=m.positions;N(v)&&(o._isQuantized=v.isQuantized,o._quantizedVolumeScale=v.quantizedVolumeScale,o._quantizedVolumeOffset=v.quantizedVolumeOffset,o._quantizedRange=v.quantizedRange);let y=m.normals;N(y)&&(o._isOctEncoded16P=y.octEncoded);let x=m.colors;N(x)&&(N(x.constantColor)&&(o._constantColor=Re.clone(x.constantColor,o._constantColor),o._hasColors=!1),o._isRGB565=x.isRGB565);let C=m.batchIds;N(m.batchIds)&&(C.name="BATCH_ID",C.semantic="BATCH_ID",C.setIndex=void 0),m.hasBatchIds&&o._batchTableLoaded(m.batchLength,m.batchTableJson,m.batchTableBinary),o._pointsLength=m.pointsLength}var ISi=new H,MSi=new H,DSi=new H,N6e,c$;function LSi(o){if(!N(c$)){N6e=new TSi.default(0),c$=new Array(o);for(let f=0;f<o;++f)c$[f]=N6e.random()}return c$}function RSi(o){let f=o.length/3,m=Math.min(f,20),v=LSi(20),y=Number.MAX_VALUE,x=-Number.MAX_VALUE,C=H.fromElements(y,y,y,ISi),w=H.fromElements(x,x,x,MSi);for(let E=0;E<m;++E){let T=Math.floor(v[E]*f),S=H.unpack(o,T*3,DSi);H.minimumByComponent(C,S,C),H.maximumByComponent(w,S,w)}let A=Pi.fromCornerPoints(C,w);return A.radius+=xe.EPSILON2,A}function F6e(o,f){let m=Rt.fromTypedArray(o);return m===Rt.INT||m===Rt.UNSIGNED_INT||m===Rt.DOUBLE?(Ba("Cast pnts property to floats",`Point cloud property "${f}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(o)):o}var OSi=new Wt,NSi=new Wt,FSi=new Re,Ynt=0,iie=1,i0e=2,qnt=3,BSi=4,Ape=new Ee,kSi=new Ee;function VSi(o,f){let m=f.context,v=o._parsedContent,y=o._pointsLength,x=v.positions,C=v.colors,w=v.normals,A=v.batchIds,E=v.styleableProperties,T=N(E),S=o._isQuantized,M=o._isQuantizedDraco,I=o._isOctEncoded16P,P=o._isOctEncodedDraco,D=o._quantizedRange,L=o._octEncodedRange,R=o._isRGB565,O=o._isTranslucent,F=o._hasColors,k=o._hasNormals,U=o._hasBatchIds,G,j,q=[],J={};if(o._styleableShaderAttributes=J,T){let oe=BSi;for(let se in E)if(E.hasOwnProperty(se)){let ae=E[se],fe=F6e(ae.typedArray,se);G=ae.componentCount,j=Rt.fromTypedArray(fe);let de=Ao.createVertexBuffer({context:m,typedArray:fe,usage:gn.STATIC_DRAW});o._geometryByteLength+=de.sizeInBytes;let ve={index:oe,vertexBuffer:de,componentsPerAttribute:G,componentDatatype:j,normalize:!1,offsetInBytes:0,strideInBytes:0};q.push(ve),J[se]={location:oe,componentCount:G},++oe}}let X=Ao.createVertexBuffer({context:m,typedArray:x.typedArray,usage:gn.STATIC_DRAW});o._geometryByteLength+=X.sizeInBytes;let Y;F&&(Y=Ao.createVertexBuffer({context:m,typedArray:C.typedArray,usage:gn.STATIC_DRAW}),o._geometryByteLength+=Y.sizeInBytes);let Q;k&&(Q=Ao.createVertexBuffer({context:m,typedArray:w.typedArray,usage:gn.STATIC_DRAW}),o._geometryByteLength+=Q.sizeInBytes);let ee;U&&(A.typedArray=F6e(A.typedArray,"batchIds"),ee=Ao.createVertexBuffer({context:m,typedArray:A.typedArray,usage:gn.STATIC_DRAW}),o._geometryByteLength+=ee.sizeInBytes);let z=[];if(S?j=Rt.UNSIGNED_SHORT:M?j=D<=255?Rt.UNSIGNED_BYTE:Rt.UNSIGNED_SHORT:j=Rt.FLOAT,z.push({index:Ynt,vertexBuffer:X,componentsPerAttribute:3,componentDatatype:j,normalize:!1,offsetInBytes:0,strideInBytes:0}),o._cull&&(S||M?o._boundingSphere=Pi.fromCornerPoints(H.ZERO,o._quantizedVolumeScale):o._boundingSphere=RSi(x.typedArray)),F)if(R)z.push({index:iie,vertexBuffer:Y,componentsPerAttribute:1,componentDatatype:Rt.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let oe=O?4:3;z.push({index:iie,vertexBuffer:Y,componentsPerAttribute:oe,componentDatatype:Rt.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}k&&(I?(G=2,j=Rt.UNSIGNED_BYTE):P?(G=2,j=L<=255?Rt.UNSIGNED_BYTE:Rt.UNSIGNED_SHORT):(G=3,j=Rt.FLOAT),z.push({index:i0e,vertexBuffer:Q,componentsPerAttribute:G,componentDatatype:j,normalize:!1,offsetInBytes:0,strideInBytes:0})),U&&z.push({index:qnt,vertexBuffer:ee,componentsPerAttribute:1,componentDatatype:Rt.fromTypedArray(A.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),T&&(z=z.concat(q));let ie=new Du({context:m,attributes:z}),re={depthTest:{enabled:!0}},ne={depthTest:{enabled:!0},depthMask:!1,blending:Mu.ALPHA_BLEND};o._opaquePass===vr.CESIUM_3D_TILE&&(re.stencilTest=Ua.setCesium3DTileBit(),re.stencilMask=Ua.CESIUM_3D_TILE_MASK,ne.stencilTest=Ua.setCesium3DTileBit(),ne.stencilMask=Ua.CESIUM_3D_TILE_MASK),o._opaqueRenderState=Mn.fromCache(re),o._translucentRenderState=Mn.fromCache(ne),o._drawCommand=new Jn({boundingVolume:new Pi,cull:o._cull,modelMatrix:new Ee,primitiveType:Fn.POINTS,vertexArray:ie,count:y,shaderProgram:void 0,uniformMap:void 0,renderState:O?o._translucentRenderState:o._opaqueRenderState,pass:O?vr.TRANSLUCENT:o._opaquePass,owner:o,castShadows:!1,receiveShadows:!1,pickId:o._pickIdLoaded()})}function zSi(o,f){let m=f.context,v=o._isQuantized,y=o._isQuantizedDraco,x=o._isOctEncodedDraco,C={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let w=OSi;if(w.x=o._attenuation?o.maximumAttenuation:o._pointSize,w.x*=f.pixelRatio,w.y=o.time,o._attenuation){let A=f.camera.frustum,E;f.mode===_i.SCENE2D||A instanceof Gs?E=Number.POSITIVE_INFINITY:E=m.drawingBufferHeight/f.camera.frustum.sseDenominator,w.z=o.geometricError*o.geometricErrorScale,w.w=E}return w},u_highlightColor:function(){return o._highlightColor},u_constantColor:function(){return o._constantColor},u_clippingPlanes:function(){let w=o.clippingPlanes;return o.isClipped?w.texture:m.defaultTexture},u_clippingPlanesEdgeStyle:function(){let w=o.clippingPlanes;if(!N(w))return Re.TRANSPARENT;let A=Re.clone(w.edgeColor,FSi);return A.alpha=w.edgeWidth,A},u_clippingPlanesMatrix:function(){let w=o.clippingPlanes;if(!N(w))return Ee.IDENTITY;let A=Z(o.clippingPlanesOriginMatrix,o._modelMatrix);Ee.multiply(m.uniformState.view3D,A,Ape);let E=Ee.multiply(Ape,w.modelMatrix,Ape);return Ee.inverseTranspose(E,kSi)}};lae.addUniforms(o,C),(v||y||x)&&(C=va(C,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let w=NSi;if(N(o._quantizedVolumeScale)){let A=H.clone(o._quantizedVolumeScale,w);H.divideByScalar(A,o._quantizedRange,w)}return w.w=o._octEncodedRange,w}})),N(o._uniformMapLoaded)&&(C=o._uniformMapLoaded(C)),o._drawCommand.uniformMap=C}function Epe(o,f){let m=/czm_3dtiles_property_(\d+)/g,v=m.exec(o);for(;v!==null;){let y=parseInt(v[1]);f.indexOf(y)===-1&&f.push(y),v=m.exec(o)}}function Tpe(o,f){o=o.slice(o.indexOf(` `));let m=/czm_3dtiles_builtin_property_(\w+)/g,v=m.exec(o);for(;v!==null;){let y=v[1];f.indexOf(y)===-1&&f.push(y),v=m.exec(o)}}function Spe(o,f){let m=o.numberOfAttributes;for(let v=0;v<m;++v){let y=o.getAttribute(v);if(y.index===f)return y}}var HSi={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function USi(o,f,m){let v,y,x,C=f.context,w=N(m),A=o._isQuantized,E=o._isQuantizedDraco,T=o._isOctEncoded16P,S=o._isOctEncodedDraco,M=o._isRGB565,I=o._isTranslucent,P=o._hasColors,D=o._hasNormals,L=o._hasBatchIds,R=o._backFaceCulling,O=o._normalShading,F=o._drawCommand.vertexArray,k=o.clippingPlanes,U=o._attenuation,G,j,q,J=I,X=uo(HSi),Y={},Q=o._styleableShaderAttributes;for(y in Q)Q.hasOwnProperty(y)&&(x=Q[y],X[y]=`czm_3dtiles_property_${x.location}`,Y[x.location]=x);if(w){let De={translucent:!1},Oe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";G=m.getColorShaderFunction(`getColorFromStyle${Oe}`,X,De),j=m.getShowShaderFunction(`getShowFromStyle${Oe}`,X,De),q=m.getPointSizeShaderFunction(`getPointSizeFromStyle${Oe}`,X,De),N(G)&&De.translucent&&(J=!0)}o._styleTranslucent=J;let ee=N(G),z=N(j),ie=N(q),re=o.isClipped,ne=[],oe=[];ee&&(Epe(G,ne),Tpe(G,oe)),z&&(Epe(j,ne),Tpe(j,oe)),ie&&(Epe(q,ne),Tpe(q,oe));let se=oe.indexOf("COLOR")>=0,ae=oe.indexOf("NORMAL")>=0;if(ae&&!D)throw new sr("Style references the NORMAL semantic but the point cloud does not have normals");for(y in Q)if(Q.hasOwnProperty(y)){x=Q[y];let De=ne.indexOf(x.location)>=0,Oe=Spe(F,x.location);Oe.enabled=De}let fe=P&&(!ee||se);if(P){let De=Spe(F,iie);De.enabled=fe}let de=D&&(O||R||ae);if(D){let De=Spe(F,i0e);De.enabled=de}let ve={a_position:Ynt};fe&&(ve.a_color=iie),de&&(ve.a_normal=i0e),L&&(ve.a_batchId=qnt);let pe="",ce=ne.length;for(v=0;v<ce;++v){let De=ne[v];x=Y[De];let Oe=x.componentCount,Ue=`czm_3dtiles_property_${De}`,Xe;Oe===1?Xe="float":Xe=`vec${Oe}`,pe+=`in ${Xe} ${Ue}; `,ve[Ue]=x.location}zSi(o,f);let he=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; uniform vec4 u_highlightColor; `;he+=`float u_pointSize; float tiles3d_tileset_time; `,U&&(he+=`float u_geometricError; float u_depthMultiplier; `),he+=pe,fe&&(I?he+=`in vec4 a_color; `:M?he+=`in float a_color; const float SHIFT_RIGHT_11 = 1.0 / 2048.0; const float SHIFT_RIGHT_5 = 1.0 / 32.0; const float SHIFT_LEFT_11 = 2048.0; const float SHIFT_LEFT_5 = 32.0; const float NORMALIZE_6 = 1.0 / 64.0; const float NORMALIZE_5 = 1.0 / 32.0; `:he+=`in vec3 a_color; `),de&&(T||S?he+=`in vec2 a_normal; `:he+=`in vec3 a_normal; `),L&&(he+=`in float a_batchId; `),(A||E||S)&&(he+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange; `),ee&&(he+=G),z&&(he+=j),ie&&(he+=q),he+=`void main() { u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x; tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y; `,U&&(he+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z; u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w; `),fe?I?he+=` vec4 color = a_color; `:M?he+=` float compressed = a_color; float r = floor(compressed * SHIFT_RIGHT_11); compressed -= r * SHIFT_LEFT_11; float g = floor(compressed * SHIFT_RIGHT_5); compressed -= g * SHIFT_LEFT_5; float b = compressed; vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5); vec4 color = vec4(rgb, 1.0); `:he+=` vec4 color = vec4(a_color, 1.0); `:he+=` vec4 color = u_constantColor; `,A||E?he+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz; `:he+=` vec3 position = a_position; `,he+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0)); `,de?(T?he+=` vec3 normal = czm_octDecode(a_normal); `:S?he+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy; `:he+=` vec3 normal = a_normal; `,he+=` vec3 normalEC = czm_normal * normal; `):he+=` vec3 normal = vec3(1.0); `,ee&&(he+=` color = getColorFromStyle(position, position_absolute, color, normal); `),z&&(he+=` float show = float(getShowFromStyle(position, position_absolute, color, normal)); `),ie?he+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio; `:U?he+=` vec4 positionEC = czm_modelView * vec4(position, 1.0); float depth = -positionEC.z; gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize); `:he+=` gl_PointSize = u_pointSize; `,he+=` color = color * u_highlightColor; `,de&&O&&(he+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC); diffuseStrength = max(diffuseStrength, 0.4); color.xyz *= diffuseStrength * czm_lightColor; `),he+=` v_color = color; gl_Position = czm_modelViewProjection * vec4(position, 1.0); `,de&&R&&(he+=` float visible = step(-normalEC.z, 0.0); gl_Position *= visible; gl_PointSize *= visible; `),z&&(he+=` gl_Position.w *= float(show); gl_PointSize *= float(show); `),he+=`} `;let Ce=`in vec4 v_color; `;re&&(Ce+=`uniform highp sampler2D u_clippingPlanes; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,Ce+=` `,Ce+=Iq(k,C),Ce+=` `),Ce+=`void main() { out_FragColor = czm_gammaCorrect(v_color); `,re&&(Ce+=$2e("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),Ce+=`} `,o.splitDirection!==eD.NONE&&(Ce=lae.modifyFragmentShader(Ce)),N(o._vertexShaderLoaded)&&(he=o._vertexShaderLoaded(he)),N(o._fragmentShaderLoaded)&&(Ce=o._fragmentShaderLoaded(Ce));let Se=o._drawCommand;N(Se.shaderProgram)&&Se.shaderProgram.destroy(),Se.shaderProgram=Rs.fromCache({context:C,vertexShaderSource:he,fragmentShaderSource:Ce,attributeLocations:ve});try{Se.shaderProgram._bind()}catch{throw new sr("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function GSi(o,f){if(o._decodingState===QF.READY)return!1;if(o._decodingState===QF.NEEDS_DECODE){let m=o._parsedContent,v=m.draco,y=YY.decodePointCloud(v,f);N(y)&&(o._decodingState=QF.DECODING,y.then(function(x){o._decodingState=QF.READY;let C=N(x.POSITION)?x.POSITION.array:void 0,w=N(x.RGB)?x.RGB.array:void 0,A=N(x.RGBA)?x.RGBA.array:void 0,E=N(x.NORMAL)?x.NORMAL.array:void 0,T=N(x.BATCH_ID)?x.BATCH_ID.array:void 0,S=N(C)&&N(x.POSITION.data.quantization),M=N(E)&&N(x.NORMAL.data.quantization);if(S){let L=x.POSITION.data.quantization,R=L.range;o._quantizedVolumeScale=H.fromElements(R,R,R),o._quantizedVolumeOffset=H.unpack(L.minValues),o._quantizedRange=(1<<L.quantizationBits)-1,o._isQuantizedDraco=!0}M&&(o._octEncodedRange=(1<<x.NORMAL.data.quantization.quantizationBits)-1,o._isOctEncodedDraco=!0);let I=m.styleableProperties,P=v.batchTableProperties;for(let L in P)if(P.hasOwnProperty(L)){let R=x[L];N(I)||(I={}),I[L]={typedArray:R.array,componentCount:R.data.componentsPerAttribute}}N(C)&&(m.positions={typedArray:C});let D=Z(A,w);N(D)&&(m.colors={typedArray:D}),N(E)&&(m.normals={typedArray:E}),N(T)&&(m.batchIds={typedArray:T}),m.styleableProperties=I}).catch(function(x){o._decodingState=QF.FAILED,o._error=x}))}return!0}var WSi=new Wt,jSi=new H;iX.prototype.update=function(o){let f=o.context;if(N(this._error)){let A=this._error;throw this._error=void 0,A}if(GSi(this,f))return;let m=!1,v=!Ee.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==o.mode&&(this._mode=o.mode,v=!0),N(this._drawCommand)||(VSi(this,o),v=!0,m=!0,this._ready=!0,this._parsedContent=void 0),v){Ee.clone(this.modelMatrix,this._modelMatrix);let A=this._drawCommand.modelMatrix;if(Ee.clone(this._modelMatrix,A),N(this._rtcCenter)&&Ee.multiplyByTranslation(A,this._rtcCenter,A),N(this._quantizedVolumeOffset)&&Ee.multiplyByTranslation(A,this._quantizedVolumeOffset,A),o.mode!==_i.SCENE3D){let T=o.mapProjection,S=Ee.getColumn(A,3,WSi);Wt.equals(S,Wt.UNIT_W)||tn.basisTo2D(T,A,A)}let E=this._drawCommand.boundingVolume;if(Pi.clone(this._boundingSphere,E),this._cull){let T=E.center;Ee.multiplyByPoint(A,T,T);let S=Ee.getScale(A,jSi);E.radius*=H.maximumComponent(S)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,m=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,m=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,m=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,m=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,m=!0);let y=this.splitDirection!==eD.NONE;this._splittingEnabled!==y&&(this._splittingEnabled=y,m=!0),m&&USi(this,o,this._style),this._drawCommand.castShadows=Cl.castShadows(this.shadows),this._drawCommand.receiveShadows=Cl.receiveShadows(this.shadows);let x=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=x?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=x?vr.TRANSLUCENT:this._opaquePass;let C=o.commandList,w=o.passes;(w.render||w.pick)&&C.push(this._drawCommand)};iX.prototype.isDestroyed=function(){return!1};iX.prototype.destroy=function(){let o=this._drawCommand;return N(o)&&(o.vertexArray=o.vertexArray&&o.vertexArray.destroy(),o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy()),kr(this)};var aPe=iX;function db(){li.throwInstantiationError()}db.computeDefaultLevelZeroMaximumGeometricError=function(o){return o.ellipsoid.maximumRadius*2*Math.PI*.25/(65*o.getNumberOfXTilesAtLevel(0))};Object.defineProperties(db.prototype,{quadtree:{get:li.throwInstantiationError,set:li.throwInstantiationError},ready:{get:li.throwInstantiationError},tilingScheme:{get:li.throwInstantiationError},errorEvent:{get:li.throwInstantiationError}});db.prototype.update=li.throwInstantiationError;db.prototype.beginUpdate=li.throwInstantiationError;db.prototype.endUpdate=li.throwInstantiationError;db.prototype.getLevelMaximumGeometricError=li.throwInstantiationError;db.prototype.loadTile=li.throwInstantiationError;db.prototype.computeTileVisibility=li.throwInstantiationError;db.prototype.showTileThisFrame=li.throwInstantiationError;db.prototype.computeDistanceToTile=li.throwInstantiationError;db.prototype.isDestroyed=li.throwInstantiationError;db.prototype.destroy=li.throwInstantiationError;var s4=db;function Gw(o,f,m,v,y,x,C){this.children=void 0,this.parent=y,this.level=o,this.x=f,this.y=m,this.z=v,this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new fc,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(x,C)}var YSi=new H;Gw.prototype.computeBoundingVolumes=function(o,f){this.orientedBoundingBox=o.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let m=Ut.getScale(this.orientedBoundingBox.halfAxes,YSi),v=2*H.maximumComponent(m);this.approximateVoxelSize=v/H.minimumComponent(f)};Gw.prototype.constructChildNodes=function(o,f){let{level:m,x:v,y,z:x}=this,C=v*2,w=y*2,A=x*2,E=w+1,T=C+1,S=A+1,M=m+1,I=[[M,C,w,A],[M,T,w,A],[M,C,E,A],[M,T,E,A],[M,C,w,S],[M,T,w,S],[M,C,E,S],[M,T,E,S]];this.children=I.map(([P,D,L,R])=>new Gw(P,D,L,R,this,o,f))};Gw.prototype.visibility=function(o,f){let m=this.orientedBoundingBox;return o.cullingVolume.computeVisibilityWithPlaneMask(m,f)};Gw.prototype.computeScreenSpaceError=function(o,f){let m=this.orientedBoundingBox,v=Math.sqrt(m.distanceSquaredTo(o));v=Math.max(v,xe.EPSILON7);let y=this.approximateVoxelSize,x=f*(y/v);this.screenSpaceError=x};var B6e={keyframe:0};function Ij(o,f){return B6e.keyframe=o,Wg(f,B6e,_h.searchComparator)}Gw.prototype.computeSurroundingRenderableKeyframeNodes=function(o){let f=this,m=f.level,v=Math.floor(o),y=Math.ceil(o),x,C,w=+Number.MAX_VALUE,A=+Number.MAX_VALUE;for(;N(f);){let{renderableKeyframeNodes:S}=f;if(S.length>=1){let M=qSi(v,S),I=S[M],P=y===v||v<I.keyframe?M:Math.min(M+1,S.length-1),D=S[P],L=v-I.keyframe,R=k6e(m-f.level,L);R<w&&(w=R,x=I);let O=D.keyframe-y,F=k6e(m-f.level,O);if(F<A&&(A=F,C=D),L===0&&O===0)break}f=f.parent}if(this.renderableKeyframeNodePrevious=x,this.renderableKeyframeNodeNext=C,!N(x)||!N(C))return;let E=x.keyframe,T=C.keyframe;this.renderableKeyframeNodeLerp=E===T?0:xe.clamp((o-E)/(T-E),0,1)};function qSi(o,f){let m=Ij(o,f);return m<0?xe.clamp(~m-1,0,f.length-1):m}function k6e(o,f){let m=Math.exp(o*4),v=f>=0?1:-200;return o*m+f*v}Gw.prototype.isVisited=function(o){return this.visitedFrameNumber===o};Gw.prototype.createKeyframeNode=function(o){let f=Ij(o,this.keyframeNodes);if(f<0){f=~f;let m=new _h(this,o);this.keyframeNodes.splice(f,0,m)}};Gw.prototype.destroyKeyframeNode=function(o,f){let m=o.keyframe,v=Ij(m,this.keyframeNodes);if(v<0)throw new li("Keyframe node does not exist.");if(this.keyframeNodes.splice(v,1),o.megatextureIndex!==-1){for(let x=0;x<f.length;x++)f[x].remove(o.megatextureIndex);let y=Ij(m,this.renderableKeyframeNodes);if(y<0)throw new li("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(y,1)}o.spatialNode=void 0,o.state=_h.LoadState.UNLOADED,o.metadatas={},o.megatextureIndex=-1,o.priority=-Number.MAX_VALUE,o.highPriorityFrameNumber=-1};Gw.prototype.addKeyframeNodeToMegatextures=function(o,f){if(o.state!==_h.LoadState.RECEIVED||o.megatextureIndex!==-1||o.metadatas.length!==f.length)throw new li("Keyframe node cannot be added to megatexture");for(let y=0;y<f.length;y++){let x=f[y];o.megatextureIndex=x.add(o.metadatas[y]),o.metadatas[y]=void 0}o.state=_h.LoadState.LOADED;let m=this.renderableKeyframeNodes,v=Ij(o.keyframe,m);if(v>=0)throw new li("Keyframe already renderable");v=~v,m.splice(v,0,o)};Gw.prototype.isRenderable=function(o){let f=this.renderableKeyframeNodePrevious,m=this.renderableKeyframeNodeNext,v=this.level;return N(f)&&N(m)&&(f.spatialNode.level===v||m.spatialNode.level===v)&&this.visitedFrameNumber===o};var sPe=Gw;function lPe(o){o=Z(o,1),this._radius=Z(o,1)}Object.defineProperties(lPe.prototype,{radius:{get:function(){return this._radius},set:function(o){this._radius=o}}});lPe.prototype.emit=function(o){let f=xe.randomBetween(0,xe.TWO_PI),m=xe.randomBetween(0,xe.PI),v=xe.randomBetween(0,this._radius),y=v*Math.cos(f)*Math.sin(m),x=v*Math.sin(f)*Math.sin(m),C=v*Math.cos(m);o.position=H.fromElements(y,x,C,o.position),o.velocity=H.normalize(o.position,o.velocity)};var B6=lPe;function rX(){}rX.prototype.evaluate=function(o,f){li.throwInstantiationError()};rX.prototype.evaluateColor=function(o,f){li.throwInstantiationError()};rX.prototype.getShaderFunction=function(o,f,m,v){li.throwInstantiationError()};rX.prototype.getVariables=function(){li.throwInstantiationError()};var Xnt=rX;function rie(o){this._ready=!1,this._provider=void 0,this._errorEvent=new Br,this._readyEvent=new Br,JSi(this,o)}Object.defineProperties(rie.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});rie.fromWorldTerrain=function(o){return new rie(qoe(o))};function XSi(o,f){o.numberOfListeners>0?o.raiseEvent(f):console.error(f)}async function JSi(o,f){let m;try{m=await Promise.resolve(f),o._provider=m,o._ready=!0,o._readyEvent.raiseEvent(m)}catch(v){XSi(o._errorEvent,v)}}var uPe=rie;function k6(){}k6.prototype.boundingVolume=void 0;k6.prototype.boundingSphere=void 0;k6.prototype.distanceToCamera=function(o){li.throwInstantiationError()};k6.prototype.intersectPlane=function(o){li.throwInstantiationError()};k6.prototype.createDebugVolume=function(o){li.throwInstantiationError()};var Jnt=k6;function nX(o){o=Z(o,Z.EMPTY_OBJECT),this._tilingScheme=N(o.tilingScheme)?o.tilingScheme:new Bd({ellipsoid:o.ellipsoid}),this._color=Z(o.color,Re.YELLOW),this._errorEvent=new Br,this._tileWidth=Z(o.tileWidth,256),this._tileHeight=Z(o.tileHeight,256),this._ready=!0,this._readyPromise=Promise.resolve(!0),this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(nX.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return mi("TileCoordinatesImageryProvider.ready","TileCoordinatesImageryProvider.ready was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),!0}},readyPromise:{get:function(){return mi("TileCoordinatesImageryProvider.readyPromise","TileCoordinatesImageryProvider.readyPromise was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107."),this._readyPromise}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}},defaultAlpha:{get:function(){return mi("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha},set:function(o){mi("TileCoordinatesImageryProvider.defaultAlpha","TileCoordinatesImageryProvider.defaultAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.alpha instead."),this._defaultAlpha=o}},defaultNightAlpha:{get:function(){return mi("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha},set:function(o){mi("TileCoordinatesImageryProvider.defaultNightAlpha","TileCoordinatesImageryProvider.defaultNightAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.nightAlpha instead."),this._defaultNightAlpha=o}},defaultDayAlpha:{get:function(){return mi("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha},set:function(o){mi("TileCoordinatesImageryProvider.defaultDayAlpha","TileCoordinatesImageryProvider.defaultDayAlpha was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.dayAlpha instead."),this._defaultDayAlpha=o}},defaultBrightness:{get:function(){return mi("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness},set:function(o){mi("TileCoordinatesImageryProvider.defaultBrightness","TileCoordinatesImageryProvider.defaultBrightness was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.brightness instead."),this._defaultBrightness=o}},defaultContrast:{get:function(){return mi("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast},set:function(o){mi("TileCoordinatesImageryProvider.defaultContrast","TileCoordinatesImageryProvider.defaultContrast was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.contrast instead."),this._defaultContrast=o}},defaultHue:{get:function(){return mi("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue},set:function(o){mi("TileCoordinatesImageryProvider.defaultHue","TileCoordinatesImageryProvider.defaultHue was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.hue instead."),this._defaultHue=o}},defaultSaturation:{get:function(){return mi("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation},set:function(o){mi("TileCoordinatesImageryProvider.defaultSaturation","TileCoordinatesImageryProvider.defaultSaturation was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.saturation instead."),this._defaultSaturation=o}},defaultGamma:{get:function(){return mi("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma},set:function(o){mi("TileCoordinatesImageryProvider.defaultGamma","TileCoordinatesImageryProvider.defaultGamma was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.gamma instead."),this._defaultGamma=o}},defaultMinificationFilter:{get:function(){return mi("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter},set:function(o){mi("TileCoordinatesImageryProvider.defaultMinificationFilter","TileCoordinatesImageryProvider.defaultMinificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.minificationFilter instead."),this._defaultMinificationFilter=o}},defaultMagnificationFilter:{get:function(){return mi("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter},set:function(o){mi("TileCoordinatesImageryProvider.defaultMagnificationFilter","TileCoordinatesImageryProvider.defaultMagnificationFilter was deprecated in CesiumJS 1.104. It will be removed in CesiumJS 1.107. Use ImageryLayer.magnificationFilter instead."),this._defaultMagnificationFilter=o}}});nX.prototype.getTileCredits=function(o,f,m){};nX.prototype.requestImage=function(o,f,m,v){let y=document.createElement("canvas");y.width=256,y.height=256;let x=y.getContext("2d"),C=this._color.toCssColorString();return x.strokeStyle=C,x.lineWidth=2,x.strokeRect(1,1,255,255),x.font="bold 25px Arial",x.textAlign="center",x.fillStyle=C,x.fillText(`L: ${m}`,124,86),x.fillText(`X: ${o}`,124,136),x.fillText(`Y: ${f}`,124,186),Promise.resolve(y)};nX.prototype.pickFeatures=function(o,f,m,v,y){};var oX=nX;function cPe(o){li.throwInstantiationError()}cPe.prototype.isReady=li.throwInstantiationError;cPe.prototype.shouldDiscardImage=li.throwInstantiationError;var Knt=cPe,KSi={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},Qnt=Object.freeze(KSi);function l4(o){o=Z(o,Z.EMPTY_OBJECT),this.show=Z(o.show,!0),this.modelMatrix=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),this.shadows=Z(o.shadows,Cl.ENABLED),this.maximumMemoryUsage=Z(o.maximumMemoryUsage,256),this.shading=new YU(o.shading),this.style=o.style,this.frameFailed=new Br,this.frameChanged=new Br,this._clock=o.clock,this._intervals=o.intervals,this._clippingPlanes=void 0,this.clippingPlanes=o.clippingPlanes,this._pointCloudEyeDomeLighting=new oq,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._resolveReadyPromise=void 0;let f=this;this._readyPromise=new Promise(function(m){f._resolveReadyPromise=m}),this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(l4.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(o){Uv.setOwner(o,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(N(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}},readyPromise:{get:function(){return mi("TimeDynamicPointCloud.readyPromise","TimeDynamicPointCloud.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Use TimeDynamicPointCloud.frameFailed instead."),this._readyPromise}}});function QSi(o){return`uniform vec4 czm_pickColor; ${o}`}function ZSi(o){return function(f){return va(f,{czm_pickColor:function(){return o._pickId.color}})}}function $Si(){return"czm_pickColor"}l4.prototype.makeStyleDirty=function(){this._styleDirty=!0};l4.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var e2i=new ci;function hPe(o){let f=o._clock,m=f.canAnimate&&f.shouldAnimate,v=f.multiplier;return m?v:0}function tB(o,f){return o._intervals.indexOf(f.start)}function t2i(o,f){let m=o._intervals,v=o._clock,y=hPe(o);if(y===0)return;let x=o._getAverageLoadTime(),C=ci.addSeconds(v.currentTime,x*y,e2i),w=m.indexOf(C),A=tB(o,f);return w===A&&(y>=0?++w:--w),m.get(w)}function i2i(o){let f=o._intervals,m=o._clock.currentTime,v=f.indexOf(m);return f.get(v)}function r2i(o,f,m){let v=hPe(o),y=tB(o,f),x=tB(o,m);return v>=0?y>=x:y<=x}function Znt(o,f){return function(m){let v=N(m.message)?m.message:m.toString();o.frameFailed.numberOfListeners>0?o.frameFailed.raiseEvent({uri:f,message:v}):(console.log(`A frame failed to load: ${f}`),console.log(`Error: ${v}`))}}function n2i(o,f,m){let v=tB(o,f),y=o._frames,x=y[v];if(!N(x)){let C=f.data.transform,w=N(C)?Ee.fromArray(C):void 0,A=f.data.uri;x={pointCloud:void 0,transform:w,timestamp:$c(),sequential:!0,ready:!1,touchedFrameNumber:m.frameNumber,uri:A},y[v]=x,Jr.fetchArrayBuffer({url:A}).then(function(E){x.pointCloud=new aPe({arrayBuffer:E,cull:!0,fragmentShaderLoaded:QSi,uniformMapLoaded:ZSi(o),pickIdLoaded:$Si})}).catch(Znt(o,A))}return x}function o2i(o,f){o._runningSum+=f,o._runningSum-=o._runningSamples[o._runningIndex],o._runningSamples[o._runningIndex]=f,o._runningLength=Math.min(o._runningLength+1,o._runningSamples.length),o._runningIndex=(o._runningIndex+1)%o._runningSamples.length,o._runningAverage=o._runningSum/o._runningLength}function a2i(o,f,m,v){f.touchedFrameNumber<v.frameNumber-1&&(f.sequential=!1);let y=f.pointCloud;if(N(y)&&!f.ready){let x=v.commandList,C=x.length;if($nt(o,f,m,v),y.ready&&(f.ready=!0,o._totalMemoryUsageInBytes+=y.geometryByteLength,x.length=C,f.sequential)){let w=($c()-f.timestamp)/1e3;o2i(o,w)}}f.touchedFrameNumber=v.frameNumber}var s2i=new Ee;function l2i(o,f){let m=o.shading;return N(m)&&N(m.baseResolution)?m.baseResolution:N(f.boundingSphere)?xe.cbrt(f.boundingSphere.volume()/f.pointsLength):0}function u2i(o){let f=o.shading;return N(f)&&N(f.maximumAttenuation)?f.maximumAttenuation:10}var c2i=new YU;function $nt(o,f,m,v){let y=Z(o.shading,c2i),x=f.pointCloud,C=Z(f.transform,Ee.IDENTITY);x.modelMatrix=Ee.multiplyTransformation(o.modelMatrix,C,s2i),x.style=o.style,x.time=m.timeSinceLoad,x.shadows=o.shadows,x.clippingPlanes=o._clippingPlanes,x.isClipped=m.isClipped,x.attenuation=y.attenuation,x.backFaceCulling=y.backFaceCulling,x.normalShading=y.normalShading,x.geometricError=l2i(o,x),x.geometricErrorScale=y.geometricErrorScale,x.maximumAttenuation=u2i(o);try{x.update(v)}catch(w){Znt(o,f.uri)(w)}f.touchedFrameNumber=v.frameNumber}function r0e(o,f,m,v){let y=n2i(o,f,v);a2i(o,y,m,v)}function h2i(o){return function(f){return f.touchedFrameNumber<o.frameNumber}}function eot(o,f){let m=o._frames,v=m.length;for(let y=0;y<v;++y){let x=m[y];if(N(x)&&(!N(f)||f(x))){let C=x.pointCloud;x.ready&&(o._totalMemoryUsageInBytes-=C.geometryByteLength),N(C)&&C.destroy(),x===o._lastRenderedFrame&&(o._lastRenderedFrame=void 0),m[y]=void 0}}}function d2i(o,f){let m=tB(o,f),v=o._frames[m];if(N(v)&&v.ready)return v}function V6e(o,f,m,v,y){return N(m)?m.ready?!0:(r0e(o,f,v,y),m.ready):!1}function f2i(o,f,m,v,y){let x,C,w,A=o._intervals,E=o._frames,T=tB(o,m),S=tB(o,f);if(T>=S){for(x=T;x>=S;--x)if(C=A.get(x),w=E[x],V6e(o,C,w,v,y))return C}else for(x=T;x<=S;++x)if(C=A.get(x),w=E[x],V6e(o,C,w,v,y))return C;return f}function p2i(o,f,m){let v=o._frames,y=v.length;for(let x=0;x<y;++x){let C=v[x];N(C)&&N(C.pointCloud)&&(C.pointCloud.clippingPlanesDirty=f,C.pointCloud.styleDirty=m)}}var ZV={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};l4.prototype.update=function(o){if(o.mode===_i.MORPHING||!this.show)return;N(this._pickId)||(this._pickId=o.context.createPickId({primitive:this})),N(this._loadTimestamp)||(this._loadTimestamp=ci.clone(o.time));let f=Math.max(ci.secondsDifference(o.time,this._loadTimestamp)*1e3,0),m=this._clippingPlanes,v=0,y=!1,x=N(m)&&m.enabled;x&&(m.update(o),v=m.clippingPlanesState),this._clippingPlanesState!==v&&(this._clippingPlanesState=v,y=!0);let C=this._styleDirty;this._styleDirty=!1,(y||C)&&p2i(this,y,C),ZV.timeSinceLoad=f,ZV.isClipped=x;let w=this.shading,A=this._pointCloudEyeDomeLighting,E=o.commandList,T=E.length,S=this._previousInterval,M=this._nextInterval,I=i2i(this);if(!N(I))return;let P=!1,D=hPe(this),L=D===0;D!==this._clockMultiplier&&(P=!0,this._clockMultiplier=D),(!N(S)||L)&&(S=I),(!N(M)||P||r2i(this,I,M))&&(M=t2i(this,I)),S=f2i(this,S,I,ZV,o);let R=d2i(this,S);N(R)||(r0e(this,S,ZV,o),R=this._lastRenderedFrame),N(R)&&$nt(this,R,ZV,o),N(M)&&r0e(this,M,ZV,o);let O=this;N(R)&&!N(this._lastRenderedFrame)&&o.afterRender.push(function(){return O._resolveReadyPromise(O),!0}),N(R)&&R!==this._lastRenderedFrame&&O.frameChanged.numberOfListeners>0&&o.afterRender.push(function(){return O.frameChanged.raiseEvent(O),!0}),this._previousInterval=S,this._nextInterval=M,this._lastRenderedFrame=R;let F=this._totalMemoryUsageInBytes,k=this.maximumMemoryUsage*1024*1024;F>k&&eot(this,h2i(o));let U=E.length-T;N(w)&&w.attenuation&&w.eyeDomeLighting&&U>0&&A.update(o,T,w,this.boundingSphere)};l4.prototype.isDestroyed=function(){return!1};l4.prototype.destroy=function(){return eot(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),kr(this)};var uae=l4;function cae(o,f){this.show=!0,N(o)||(o=new Xr),this.rectangle=Xr.clone(o),N(f)||(f=zo.fromType(zo.ColorType,{color:new Re(1,1,1,1)})),this.material=f,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}cae.prototype.update=function(o){if(!this.show)return;let f=this._rs;if((!N(f)||!Xr.equals(f.viewport,this.rectangle))&&(this._rs=Mn.fromCache({blending:Mu.ALPHA_BLEND,viewport:this.rectangle})),o.passes.render){let m=o.context;if(this._material!==this.material||!N(this._overlayCommand)){this._material=this.material,N(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let v=new Zr({sources:[this._material.shaderSource,sEe]});this._overlayCommand=m.createViewportQuadCommand(v,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=vr.OVERLAY}this._material.update(m),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,o.commandList.push(this._overlayCommand)}};cae.prototype.isDestroyed=function(){return!1};cae.prototype.destroy=function(){return N(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),kr(this)};var hae=cae;function IO(o,f,m,v,y,x,C){this._primitive=o;let w=v.length;this.megatextures=new Array(w);for(let D=0;D<w;D++){let L=v[D],R=Fa.getComponentCount(L),O=y[D];this.megatextures[D]=new aae(f,m,R,O,C)}let A=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._frameNumber=0;let E=o._shape;this.rootNode=new sPe(0,0,0,0,void 0,E,m),this._priorityQueue=new Xoe({maximumLength:A,comparator:_h.priorityComparator}),this._highPriorityKeyframeNodes=new Array(A),this._keyframeNodesInMegatexture=new Array(A),this._keyframeCount=x,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(x);let T=this._binaryTreeKeyframeWeighting;T[0]=0,T[x-1]=0,n0e(T,1,x-2,0);let S=9,M=2048,I=Math.floor(M/S),P=Math.ceil(A/I);this.internalNodeTexture=new _o({context:f,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,flipY:!1,width:M,height:P,sampler:new gs({minificationFilter:Xa.NEAREST,magnificationFilter:Zu.NEAREST})}),this.internalNodeTilesPerRow=I,this.internalNodeTexelSizeUv=new Ye(1/M,1/P),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new Ye}function n0e(o,f,m,v){if(f>m)return;let y=Math.floor((f+m)/2);o[y]=v,n0e(o,f,y-1,v+1),n0e(o,y+1,m,v+1)}IO.simultaneousRequestCountMaximum=50;IO.prototype.update=function(o,f,m,v){let y=this._primitive,x=o.context,C=this.megatextures[0].maximumTileCount,w=this._keyframeCount,A=y._levelBlendFactor,E=A>0,T=w>1,S=(E?2:1)*(T?2:1);this._sampleCount=S;let M=S>=2;if(M&&!N(this.leafNodeTexture)){let L=Math.floor(512),R=Math.ceil(C/L);this.leafNodeTexture=new _o({context:x,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE,flipY:!1,width:1024,height:R,sampler:new gs({minificationFilter:Xa.NEAREST,magnificationFilter:Zu.NEAREST})}),this.leafNodeTexelSizeUv=Ye.fromElements(1/1024,1/R,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=L}else!M&&N(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=xe.clamp(f,0,w-1),m&&tot(this,this.rootNode),v)return;this._frameNumber=o.frameNumber;let I=$c();_2i(this,o);let P=$c();y2i(this,S,A);let D=$c();if(this._debugPrint){let L=P-I,R=D-P,O=D-I;v2i(this,L,R,O)}};IO.prototype.isRenderable=function(o){return o.isRenderable(this._frameNumber)};IO.prototype.isDestroyed=function(){return!1};IO.prototype.destroy=function(){let o=this.megatextures,f=o.length;for(let m=0;m<f;m++)o[m]=o[m]&&o[m].destroy();return this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),kr(this)};function tot(o,f){let m=o._primitive,v=m._shape,y=m._provider.dimensions;if(f.computeBoundingVolumes(v,y),N(f.children))for(let x=0;x<8;x++){let C=f.children[x];tot(o,C)}}function m2i(o,f){if(o._simultaneousRequestCount>=IO.simultaneousRequestCountMaximum)return;let m=o._primitive,v=m._provider;function y(E){o._simultaneousRequestCount--;let T=m._provider.types.length;if(!N(E))f.state=_h.LoadState.UNAVAILABLE;else if(E===_h.LoadState.FAILED)f.state=_h.LoadState.FAILED;else if(!Array.isArray(E)||E.length!==T)f.state=_h.LoadState.FAILED;else{let S=o.megatextures;for(let M=0;M<T;M++){let{voxelCountPerTile:I,channelCount:P}=S[M],{x:D,y:L,z:R}=I,O=D*L*R,F=E[M],k=O*P;if(F.length===k)f.metadatas[M]=F,f.state=_h.LoadState.RECEIVED;else{f.state=_h.LoadState.FAILED;break}}}}function x(){o._simultaneousRequestCount--,f.state=_h.LoadState.FAILED}let{keyframe:C,spatialNode:w}=f,A=v.requestData({tileLevel:w.level,tileX:w.x,tileY:w.y,tileZ:w.z,keyframe:C});N(A)?(o._simultaneousRequestCount++,f.state=_h.LoadState.RECEIVING,A.then(y).catch(x)):f.state=_h.LoadState.FAILED}function g2i(o){return o/(1+o)}function _2i(o,f){let m=o._frameNumber,v=o._primitive,y=v._shape,{dimensions:x}=v,C=v.screenSpaceError,w=o._priorityQueue,A=o._keyframeLocation,E=o._keyframeCount,T=o.rootNode,{camera:S,context:M,pixelRatio:I}=f,{positionWC:P,frustum:D}=S,L=M.drawingBufferHeight/I/D.sseDenominator;function R(Y,Q,ee){let z=Math.min(Math.abs(Q-Y),Math.abs(Q-ee)),ie=Math.max(Y,E-ee-1,1),re=Math.pow(1-z/ie,4),ne=Math.exp(-o._binaryTreeKeyframeWeighting[Q]);return xe.lerp(ne,re,.15+.85*re)}function O(Y,Q){if(Y.computeScreenSpaceError(P,L),Q=Y.visibility(f,Q),Q===hg.MASK_OUTSIDE)return;Y.visitedFrameNumber=m;let ee=xe.clamp(Math.floor(A),0,E-2),z=ee+1;if(E===1)Y.createKeyframeNode(0);else if(Y.keyframeNodes.length!==E)for(let oe=0;oe<E;oe++)Y.createKeyframeNode(oe);let ie=g2i(Y.screenSpaceError),re=!1,ne=Y.keyframeNodes;for(let oe=0;oe<ne.length;oe++){let se=ne[oe];se.priority=10*ie+R(ee,se.keyframe,z),se.state!==_h.LoadState.UNAVAILABLE&&se.state!==_h.LoadState.FAILED&&se.priority!==-Number.MAX_VALUE&&w.insert(se),se.state===_h.LoadState.LOADED&&(re=!0)}if(Y.screenSpaceError<C||!re){Y.children=void 0;return}N(Y.children)||Y.constructChildNodes(y,x);for(let oe=0;oe<8;oe++){let se=Y.children[oe];O(se,Q)}}w.reset(),O(T,hg.MASK_INDETERMINATE);let F=o._highPriorityKeyframeNodes,k=0,U;for(;w.length>0;)U=w.removeMaximum(),U.highPriorityFrameNumber=m,F[k]=U,k++;let G=o._keyframeNodesInMegatexture,j=o.megatextures[0],q=j.occupiedCount;G.length=q,G.sort(function(Y,Q){return Y.highPriorityFrameNumber===Q.highPriorityFrameNumber?Q.priority-Y.priority:Q.highPriorityFrameNumber-Y.highPriorityFrameNumber});let J=0,X=0;for(let Y=0;Y<k;Y++)if(U=F[Y],!(U.state===_h.LoadState.LOADED||U.spatialNode===void 0)&&(U.state===_h.LoadState.UNLOADED&&m2i(o,U),U.state===_h.LoadState.RECEIVED)){let Q=0;if(j.isFull()){Q=q-1-J,J++;let ee=G[Q];ee.spatialNode.destroyKeyframeNode(ee,o.megatextures)}else Q=q+X,X++;U.spatialNode.addKeyframeNodeToMegatextures(U,o.megatextures),G[Q]=U}}function v2i(o,f,m,v){let y=o._keyframeCount,x=o.rootNode,C=Object.keys(_h.LoadState).length,w=new Array(C),A=new Array(C),E=0;for(let R=0;R<C;R++){let O=new Array(y);w[R]=O;for(let F=0;F<y;F++)O[F]=0;A[R]=0}function T(R){let O=R.keyframeNodes;for(let F=0;F<O.length;F++){let k=O[F],U=k.keyframe,G=k.state;w[G][U]+=1,A[G]+=1,E++}if(N(R.children))for(let F=0;F<8;F++){let k=R.children[F];T(k)}}T(x);let S=`KEYFRAMES: ${w[_h.LoadState.LOADED]}`,M=`UNLOADED: ${A[_h.LoadState.UNLOADED]} | RECEIVING: ${A[_h.LoadState.RECEIVING]} | RECEIVED: ${A[_h.LoadState.RECEIVED]} | LOADED: ${A[_h.LoadState.LOADED]} | FAILED: ${A[_h.LoadState.FAILED]} | UNAVAILABLE: ${A[_h.LoadState.UNAVAILABLE]} | TOTAL: ${E}`,I=Math.round(f*100)/100,P=Math.round(m*100)/100,D=Math.round(v*100)/100,L=`LOAD: ${I} | OCT: ${P} | ALL: ${D}`;console.log(`${S} || ${M} || ${L}`)}var h$={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function y2i(o,f,m){let v=o._primitive._screenSpaceError,y=o._keyframeLocation,x=o._frameNumber,C=f>=2,w=0,A=0,E=[],T=[];function S(I,P,D,L,R){let O=!1;if(N(I.children))for(let F=0;F<8;F++){let k=I.children[F];k.computeSurroundingRenderableKeyframeNodes(y),k.isRenderable(x)&&(O=!0)}if(O){E[R]=h$.INTERNAL<<16|P,E[D]=L,w++,L=P,R=L*9+1;for(let F=0;F<8;F++){let k=I.children[F];P=w,D=P*9+0,S(k,P,D,L,R+F)}}else{if(C){let F=A*5,k=I.renderableKeyframeNodePrevious,U=I.level-k.spatialNode.level,G=k.spatialNode.parent,j=N(G)?G.renderableKeyframeNodePrevious:k,q=x2i(I,v,m),J=U,X=1,Y=k.megatextureIndex,Q=j.megatextureIndex;T[F+0]=q,T[F+1]=J,T[F+2]=X,T[F+3]=Y,T[F+4]=Q,E[R]=h$.LEAF<<16|A}else{let F=I.renderableKeyframeNodePrevious,k=I.level-F.spatialNode.level===0?h$.LEAF:h$.PACKED_LEAF_FROM_PARENT;E[R]=k<<16|F.megatextureIndex}A++}}let M=o.rootNode;M.computeSurroundingRenderableKeyframeNodes(y),M.isRenderable(x)&&S(M,0,0,0,0),C2i(E,9,o.internalNodeTilesPerRow,o.internalNodeTexture),C&&b2i(T,2,o.leafNodeTilesPerRow,o.leafNodeTexture)}function x2i(o,f,m){if(o.parent===void 0)return 0;let v=o.screenSpaceError,y=o.parent.screenSpaceError,x=((f-v)/(y-v)+m-1)/m;return xe.clamp(x,0,1)}function C2i(o,f,m,v){let y=Nn.componentsLength(v.pixelFormat),x=Math.ceil(o.length/f),C=Math.max(1,f*Math.min(x,m)),w=Math.max(1,Math.ceil(x/m)),A=new Uint8Array(C*w*y);for(let T=0;T<o.length;T++){let S=o[T],M=T*y;for(let I=0;I<y;I++)A[M+I]=S>>>I*8&255}let E={source:{arrayBufferView:A,width:C,height:w},xOffset:0,yOffset:0};v.copyFrom(E)}function b2i(o,f,m,v){let y=Nn.componentsLength(v.pixelFormat),x=5,C=Math.ceil(o.length/x),w=Math.max(1,f*Math.min(C,m)),A=Math.max(1,Math.ceil(C/m)),E=new Uint8Array(w*A*y);for(let S=0;S<C;S++){let M=o[S*x+0],I=o[S*x+1],P=o[S*x+2],D=o[S*x+3],L=o[S*x+4],R=xe.clamp(Math.floor(65536*M),0,65535);E[S*8+0]=R>>>0&255,E[S*8+1]=R>>>8&255,E[S*8+2]=I&255,E[S*8+3]=P&255,E[S*8+4]=D>>>0&255,E[S*8+5]=D>>>8&255,E[S*8+6]=L>>>0&255,E[S*8+7]=L>>>8&255}let T={source:{arrayBufferView:E,width:w,height:A},xOffset:0,yOffset:0};v.copyFrom(T)}IO.getApproximateTextureMemoryByteLength=function(o,f,m,v){let y=0,x=m.length;for(let C=0;C<x;C++){let w=m[C],A=v[C],E=Fa.getComponentCount(w);y+=aae.getApproximateTextureMemoryByteLength(o,f,E,A)}return y};var nie=IO;function N2(o){o=Z(o,Z.EMPTY_OBJECT),this._ready=!1,this._provider=Z(o.provider,N2.DefaultProvider),this._traversal=void 0,this._shape=void 0,this._shapeVisible=!1,this._paddingBefore=new H,this._paddingAfter=new H,this._minBounds=new H,this._minBoundsOld=new H,this._maxBounds=new H,this._maxBoundsOld=new H,this._minClippingBounds=new H,this._minClippingBoundsOld=new H,this._maxClippingBounds=new H,this._maxClippingBoundsOld=new H,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=Ee.clone(Z(o.modelMatrix,Ee.IDENTITY)),this._compoundModelMatrix=new Ee,this._compoundModelMatrixOld=new Ee,this._customShader=Z(o.customShader,N2.DefaultCustomShader),this._customShaderCompilationEvent=new Br,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=o.clock,this._transformPositionWorldToUv=new Ee,this._transformPositionUvToWorld=new Ee,this._transformDirectionWorldToLocal=new Ut,this._transformNormalLocalToWorld=new Ut,this._stepSizeUv=1,this._jitter=!0,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new lO,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new Ye,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new Ye,megatextureTextures:[],megatextureSliceDimensions:new Ye,megatextureTileDimensions:new Ye,megatextureVoxelSizeUv:new Ye,megatextureSliceSizeUv:new Ye,megatextureTileSizeUv:new Ye,dimensions:new H,paddingBefore:new H,paddingAfter:new H,transformPositionViewToUv:new Ee,transformPositionUvToView:new Ee,transformDirectionViewToLocal:new Ut,transformNormalLocalToWorld:new Ut,cameraPositionUv:new H,ndcSpaceAxisAlignedBoundingBox:new Wt,clippingPlanesTexture:void 0,clippingPlanesMatrix:new Ee,stepSize:0,pickColor:new Re},this._shapeDefinesOld={},this._uniformMap={};let f=this._uniforms,m=this._uniformMap;for(let y in f)if(f.hasOwnProperty(y)){let x=`u_${y}`;m[x]=function(){return f[y]}}let v=this._provider;this._completeLoad=function(y,x){},this._readyPromise=w2i(this,v)}async function w2i(o,f){let m=new Promise(function(w){o._completeLoad=function(A,E){E.afterRender.push(function(){return A._ready=!0,w(A),!0})}});N(f._readyPromise)&&!f._ready&&await f._readyPromise;let{shape:v,minBounds:y=Rh.getMinBounds(v),maxBounds:x=Rh.getMaxBounds(v)}=f;o.minBounds=y,o.maxBounds=x,o.minClippingBounds=Rh.getMinBounds(v),o.maxClippingBounds=Rh.getMaxBounds(v),iot(o,f);let C=Rh.getShapeConstructor(v);return o._shape=new C,o._shapeVisible=rot(o,o._shape,f),m}Object.defineProperties(N2.prototype,{ready:{get:function(){return this._ready}},readyPromise:{get:function(){return mi("VoxelPrimitive.readyPromise","VoxelPrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for VoxelPrimitive.ready to return true instead."),this._readyPromise}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this.shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(o){this._modelMatrix=Ee.clone(o,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._provider.dimensions}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(o){this._disableRender=!o}},disableUpdate:{get:function(){return this._disableUpdate},set:function(o){this._disableUpdate=o}},debugDraw:{get:function(){return this._debugDraw},set:function(o){this._debugDraw=o}},depthTest:{get:function(){return this._depthTest},set:function(o){this._depthTest!==o&&(this._depthTest=o,this._shaderDirty=!0)}},jitter:{get:function(){return this._jitter},set:function(o){this._jitter!==o&&(this._jitter=o,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(o){this._nearestSampling!==o&&(this._nearestSampling=o,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(o){this._levelBlendFactor=xe.clamp(o,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(o){this._screenSpaceError=o}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(o){this._stepSizeMultiplier=o}},minBounds:{get:function(){return this._minBounds},set:function(o){this._minBounds=H.clone(o,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(o){this._maxBounds=H.clone(o,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(o){this._minClippingBounds=H.clone(o,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(o){this._maxClippingBounds=H.clone(o,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(o){Uv.setOwner(o,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(o){if(this._customShader!==o){let f=this._uniformMap,m=this._customShader.uniformMap;for(let v in m)m.hasOwnProperty(v)&&delete f[v];N(o)?this._customShader=o:this._customShader=N2.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}}});var A2i=new H,E2i=new Wt,T2i=new Wt,S2i=new H,P2i=new H,I2i=new Ut,M2i=new Ut,D2i=new Ee,L2i=new Ee,R2i=new Ee,O2i=Ee.fromRotationTranslation(Ut.fromUniformScale(.5,new Ut),new H(.5,.5,.5),new Ee),N2i=Ee.fromRotationTranslation(Ut.fromUniformScale(2,new Ut),new H(-1,-1,-1),new Ee);N2.prototype.update=function(o){let f=this._provider;if(this._customShader.update(o),N(f._ready)&&!f._ready||!N(this._shape))return;let m=o.context;if(!this._ready){F2i(this,f,m),this._completeLoad(this,o);return}let v=iot(this,f),y=this._shape;if(v&&(this._shapeVisible=rot(this,y,f),V2i(this,y)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let x=z2i(f.timeIntervalCollection,this._clock),C=this._traversal,w=C._sampleCount;if(C.update(o,x,v,this._disableUpdate),w!==C._sampleCount&&(this._shaderDirty=!0),!C.isRenderable(C.rootNode)||(this._debugDraw&&X2i(this,o),this._disableRender))return;this._useLogDepth!==o.useLogDepth&&(this._useLogDepth=o.useLogDepth,this._shaderDirty=!0),H2i(this,o)&&(this._shaderDirty=!0);let A=C.leafNodeTexture,E=this._uniforms;N(A)&&(E.octreeLeafNodeTexture=C.leafNodeTexture,E.octreeLeafNodeTexelSizeUv=Ye.clone(C.leafNodeTexelSizeUv,E.octreeLeafNodeTexelSizeUv),E.octreeLeafNodeTilesPerRow=C.leafNodeTilesPerRow),this._shaderDirty&&(H2e(this,m),this._shaderDirty=!1);let T=m.uniformState.viewProjection,S=y.orientedBoundingBox,M=W2i(S,T,T2i);if(M.x===1||M.y===1||M.z===-1||M.w===-1)return;E.ndcSpaceAxisAlignedBoundingBox=Wt.clone(M,E.ndcSpaceAxisAlignedBoundingBox);let I=m.uniformState.inverseView;E.transformPositionViewToUv=Ee.multiplyTransformation(this._transformPositionWorldToUv,I,E.transformPositionViewToUv);let P=m.uniformState.view;E.transformPositionUvToView=Ee.multiplyTransformation(P,this._transformPositionUvToWorld,E.transformPositionUvToView);let D=m.uniformState.inverseViewRotation;E.transformDirectionViewToLocal=Ut.multiply(this._transformDirectionWorldToLocal,D,E.transformDirectionViewToLocal),E.transformNormalLocalToWorld=Ut.clone(this._transformNormalLocalToWorld,E.transformNormalLocalToWorld);let L=o.camera.positionWC;E.cameraPositionUv=Ee.multiplyByPoint(this._transformPositionWorldToUv,L,E.cameraPositionUv),E.stepSize=this._stepSizeUv*this._stepSizeMultiplier;let R=o.passes.pick?this._drawCommandPick:this._drawCommand;R.boundingVolume=y.boundingSphere,o.commandList.push(R)};function F2i(o,f,m){let v=o._uniforms;o._pickId=m.createPickId({primitive:o}),v.pickColor=Re.clone(o._pickId.color,v.pickColor);let{shaderDefines:y,shaderUniforms:x}=o._shape;o._shapeDefinesOld=uo(y,!0);let C=o._uniformMap;for(let w in x)if(x.hasOwnProperty(w)){let A=`u_${w}`;C[A]=function(){return x[w]}}v.dimensions=H.clone(f.dimensions,v.dimensions),o._paddingBefore=H.clone(Z(f.paddingBefore,H.ZERO),o._paddingBefore),v.paddingBefore=H.clone(o._paddingBefore,v.paddingBefore),o._paddingAfter=H.clone(Z(f.paddingAfter,H.ZERO),o._paddingBefore),v.paddingAfter=H.clone(o._paddingAfter,v.paddingAfter),o._traversal=B2i(o,f,m),k2i(o._traversal,v)}function iot(o,f){let m=Z(f.shapeTransform,Ee.IDENTITY),v=Z(f.globalTransform,Ee.IDENTITY);return Ee.multiplyTransformation(v,o._modelMatrix,o._compoundModelMatrix),Ee.multiplyTransformation(o._compoundModelMatrix,m,o._compoundModelMatrix),u7(o,"_compoundModelMatrix","_compoundModelMatrixOld")+u7(o,"_minBounds","_minBoundsOld")+u7(o,"_maxBounds","_maxBoundsOld")+u7(o,"_minClippingBounds","_minClippingBoundsOld")+u7(o,"_maxClippingBounds","_maxClippingBoundsOld")>0}function u7(o,f,m){let v=o[f],y=o[m],x=!v.equals(y);return x&&v.clone(y),x?1:0}function rot(o,f,m){if(!f.update(o._compoundModelMatrix,o.minBounds,o.maxBounds,o.minClippingBounds,o.maxClippingBounds))return!1;let v=f.shapeTransform,y=Ee.inverse(v,D2i),x=Ee.getRotation(v,I2i),C=Ee.getScale(v,S2i),w=H.maximumComponent(C),A=H.divideByScalar(C,w,P2i),E=Ut.multiplyByScale(x,A,M2i),T=m.dimensions;return o._stepSizeUv=f.computeApproximateStepSize(T),o._transformPositionWorldToUv=Ee.multiplyTransformation(O2i,y,o._transformPositionWorldToUv),o._transformPositionUvToWorld=Ee.multiplyTransformation(v,N2i,o._transformPositionUvToWorld),o._transformDirectionWorldToLocal=Ee.getMatrix3(y,o._transformDirectionWorldToLocal),o._transformNormalLocalToWorld=Ut.inverseTranspose(E,o._transformNormalLocalToWorld),!0}function B2i(o,f,m){let v=H.clone(f.dimensions,A2i);H.add(v,o._paddingBefore,v),H.add(v,o._paddingAfter,v);let y=f.maximumTileCount,x=N(y)?nie.getApproximateTextureMemoryByteLength(y,v,f.types,f.componentTypes):void 0,C=Z(f.keyframeCount,1);return new nie(o,m,v,f.types,f.componentTypes,C,x)}function k2i(o,f){f.octreeInternalNodeTexture=o.internalNodeTexture,f.octreeInternalNodeTexelSizeUv=Ye.clone(o.internalNodeTexelSizeUv,f.octreeInternalNodeTexelSizeUv),f.octreeInternalNodeTilesPerRow=o.internalNodeTilesPerRow;let m=o.megatextures,v=m[0],y=m.length;f.megatextureTextures=new Array(y);for(let x=0;x<y;x++)f.megatextureTextures[x]=m[x].texture;f.megatextureSliceDimensions=Ye.clone(v.sliceCountPerRegion,f.megatextureSliceDimensions),f.megatextureTileDimensions=Ye.clone(v.regionCountPerMegatexture,f.megatextureTileDimensions),f.megatextureVoxelSizeUv=Ye.clone(v.voxelSizeUv,f.megatextureVoxelSizeUv),f.megatextureSliceSizeUv=Ye.clone(v.sliceSizeUv,f.megatextureSliceSizeUv),f.megatextureTileSizeUv=Ye.clone(v.regionSizeUv,f.megatextureTileSizeUv)}function V2i(o,f){let m=f.shaderDefines,v=Object.keys(m).some(y=>m[y]!==o._shapeDefinesOld[y]);return v&&(o._shapeDefinesOld=uo(m,!0)),v}function z2i(o,f){if(!N(o)||!N(f))return 0;let m=f.currentTime,v,y=o.indexOf(m);y>=0?v=o.get(y):(y=~y,y===o.length?(y=o.length-1,v=o.get(y),m=v.stop):(v=o.get(y),m=v.start));let x=ci.secondsDifference(v.stop,v.start),C=ci.secondsDifference(m,v.start)/x;return y+C}function H2i(o,f){let m=o.clippingPlanes;if(!N(m))return!1;m.update(f);let{clippingPlanesState:v,enabled:y}=m;if(y){let x=o._uniforms;x.clippingPlanesTexture=m.texture,x.clippingPlanesMatrix=Ee.transpose(Ee.multiplyTransformation(Ee.inverse(m.modelMatrix,x.clippingPlanesMatrix),o._transformPositionUvToWorld,x.clippingPlanesMatrix),x.clippingPlanesMatrix)}return o._clippingPlanesState===v&&o._clippingPlanesEnabled===y?!1:(o._clippingPlanesState=v,o._clippingPlanesEnabled=y,!0)}N2.prototype.isDestroyed=function(){return!1};N2.prototype.destroy=function(){let o=this._drawCommand;N(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy());let f=this._drawCommandPick;return N(f)&&(f.shaderProgram=f.shaderProgram&&f.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),kr(this)};var z6e=new Array(new Wt(-1,-1,-1,1),new Wt(1,-1,-1,1),new Wt(-1,1,-1,1),new Wt(1,1,-1,1),new Wt(-1,-1,1,1),new Wt(1,-1,1,1),new Wt(-1,1,1,1),new Wt(1,1,1,1)),U2i=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),G2i=new Array(new Wt,new Wt,new Wt,new Wt,new Wt,new Wt,new Wt,new Wt);function W2i(o,f,m){let v=Ee.fromRotationTranslation(o.halfAxes,o.center,L2i),y=Ee.multiply(f,v,R2i),x=+Number.MAX_VALUE,C=-Number.MAX_VALUE,w=+Number.MAX_VALUE,A=-Number.MAX_VALUE,E,T=G2i,S=z6e.length;for(E=0;E<S;E++)Ee.multiplyByVector(y,z6e[E],T[E]);for(E=0;E<S;E++){let M=T[E];if(M.z>=-M.w){let I=M.x/M.w,P=M.y/M.w;x=Math.min(x,I),C=Math.max(C,I),w=Math.min(w,P),A=Math.max(A,P)}else for(let I=0;I<3;I++){let P=U2i[E*3+I],D=T[P];if(D.z>=-D.w){let L=M.z+M.w,R=D.z+D.w,O=L/(L-R),F=Wt.lerp(M,D,O,E2i),k=F.x/F.w,U=F.y/F.w;x=Math.min(x,k),C=Math.max(C,k),w=Math.min(w,U),A=Math.max(A,U)}}}return x=xe.clamp(x,-1,1),w=xe.clamp(w,-1,1),C=xe.clamp(C,-1,1),A=xe.clamp(A,-1,1),m=Wt.fromElements(x,w,C,A,m),m}var dPe=3e7,j2i=new H(dPe,0,0),Y2i=new H(0,dPe,0),q2i=new H(0,0,dPe);function X2i(o,f){let m=o._traversal,v=o._debugPolylines;v.removeAll();function y(A,E,T,S){v.add({positions:[A,E],width:S,material:zo.fromType("Color",{color:T})})}function x(A,E,T){let S=A.computeCorners();y(S[0],S[1],E,T),y(S[2],S[3],E,T),y(S[4],S[5],E,T),y(S[6],S[7],E,T),y(S[0],S[2],E,T),y(S[4],S[6],E,T),y(S[1],S[3],E,T),y(S[5],S[7],E,T),y(S[0],S[4],E,T),y(S[2],S[6],E,T),y(S[1],S[5],E,T),y(S[3],S[7],E,T)}function C(A){if(!m.isRenderable(A))return;let E=A.level,T=Math.max(1,5/Math.pow(2,E)),S=[Re.RED,Re.LIME,Re.BLUE][E%3];if(x(A.orientedBoundingBox,S,T),N(A.children))for(let M=0;M<8;M++)C(A.children[M])}x(o._shape.orientedBoundingBox,Re.WHITE,5),C(m.rootNode);let w=10;y(H.ZERO,j2i,Re.RED,w),y(H.ZERO,Y2i,Re.LIME,w),y(H.ZERO,q2i,Re.BLUE,w),v.update(f)}N2.DefaultCustomShader=new Kw({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = vec3(1.0); material.alpha = 1.0; }`});function not(){this.ready=!0,this.shape=Rh.BOX,this.dimensions=new H(1,1,1),this.names=["data"],this.types=[Fa.SCALAR],this.componentTypes=[ds.FLOAT32],this.maximumTileCount=1}not.prototype.requestData=function(o){if(!((N(o)?Z(o.tileLevel,0):0)>=1))return Promise.resolve([new Float32Array(1)])};N2.DefaultProvider=new not;var dae=N2;function fPe(){li.throwInstantiationError()}Object.defineProperties(fPe.prototype,{ready:{get:li.throwInstantiationError},readyPromise:{get:li.throwInstantiationError},globalTransform:{get:li.throwInstantiationError},shapeTransform:{get:li.throwInstantiationError},shape:{get:li.throwInstantiationError},minBounds:{get:li.throwInstantiationError},maxBounds:{get:li.throwInstantiationError},dimensions:{get:li.throwInstantiationError},paddingBefore:{get:li.throwInstantiationError},paddingAfter:{get:li.throwInstantiationError},names:{get:li.throwInstantiationError},types:{get:li.throwInstantiationError},componentTypes:{get:li.throwInstantiationError},minimumValues:{get:li.throwInstantiationError},maximumValues:{get:li.throwInstantiationError},maximumTileCount:{get:li.throwInstantiationError},keyframeCount:{get:li.throwInstantiationError},timeIntervalCollection:{get:li.throwInstantiationError}});fPe.prototype.requestData=li.throwInstantiationError;var oot=fPe;function u4(){li.throwInstantiationError()}Object.defineProperties(u4.prototype,{orientedBoundingBox:{get:li.throwInstantiationError},boundingSphere:{get:li.throwInstantiationError},boundTransform:{get:li.throwInstantiationError},shapeTransform:{get:li.throwInstantiationError},shaderUniforms:{get:li.throwInstantiationError},shaderDefines:{get:li.throwInstantiationError},shaderMaximumIntersectionsLength:{get:li.throwInstantiationError}});u4.prototype.update=li.throwInstantiationError;u4.prototype.computeOrientedBoundingBoxForTile=li.throwInstantiationError;u4.prototype.computeApproximateStepSize=li.throwInstantiationError;u4.DefaultMinBounds=li.throwInstantiationError;u4.DefaultMaxBounds=li.throwInstantiationError;var aot=u4,J2i=`in vec2 depth; vec4 packDepth(float depth) { const vec4 bias = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); float r = depth; float g = fract(r * 255.0); float b = fract(g * 255.0); float a = fract(b * 255.0); vec4 color = vec4(r, g, b, a); return color - (color.yzww * bias); } void main() { float fDepth = (depth.x) / 5000.0; out_FragColor = packDepth(fDepth); }`,K2i=`in vec3 position; out vec2 depth; void main() { vec4 pos = vec4(position.xyz,1.0); depth = pos.zw; pos.z = 0.0; gl_Position = czm_projection*pos; }`;function gP(){this._flattenPolygons=[],this._regionDirty=!1,this._defautTexture=void 0,this._regionBounds=new Wt,this._fromENU=Ee.IDENTITY,this._polygonDepth=new H5}Object.defineProperties(gP.prototype,{needUpdateFlatten:{get:function(){return this._needUpdateFlatten},set:function(o){this._needUpdateFlatten=o}},flattenPolygons:{get:function(){return this._flattenPolygons},set:function(o){!N(o)||!N(o.length)?this._flattenPolygons=[]:this._flattenPolygons=o,this._updateFlattenInternal=!0}},fromENU:{get:function(){return this._fromENU},set:function(o){this._fromENU=o}}});gP.prototype.initailize=function(o){if(this._flattenPolygons.length>0){let f={position:0},m=new Ee;Ee.inverse(this._fromENU,m);let v=new Xr,y=[];for(let x=0;x<this._flattenPolygons.length;x++){let C=o.context,w=this._flattenPolygons[x],A=UB.createGeometry(w),E=A.attributes.position.values;for(let L=0;L<E.length/3;L++){let R=new H(0,0,0);R.x=E[3*L],R.y=E[3*L+1],R.z=E[3*L+2],Ee.multiplyByPoint(m,R,R),y.push(R),A.attributes.position.values[3*L]=R.x,A.attributes.position.values[3*L+1]=R.y,A.attributes.position.values[3*L+2]=R.z}let T=Pi.transform(A.boundingSphere,m);A.boundingSphere=T;let S=Du.fromGeometry({context:C,geometry:A,attributeLocations:f,bufferUsage:gn.STATIC_DRAW,interleave:!0}),M=Rs.fromCache({context:C,vertexShaderSource:K2i,fragmentShaderSource:J2i}),I=new Mn;I.depthTest.enabled=!0,I.cull.enabled=!0,I.cull.face=xi.BACK;let P={},D=new Jn({boundingVolume:T,modelMatrix:new Ee,primitiveType:Fn.TRIANGLES,vertexArray:S,shaderProgram:M,uniformMap:P,renderState:I,pass:vr.GLOBE});this._polygonDepth._flattenPolygonDrawCommands.push(D)}Xr.fromPoints(y,v),this._regionBounds.x=v.x,this._regionBounds.y=v.y+v.height,this._regionBounds.z=v.x+v.width,this._regionBounds.w=v.y,this._polygonDepth.updateFrustum(this._regionBounds.x,this._regionBounds.y,this._regionBounds.z,this._regionBounds.w)}};gP.prototype.addFlattenPolygon=function(o){this._flattenPolygons=[o],this._regionDirty=!0};gP.prototype.clearFlattenPolygon=function(){N(this._polygonDepth)&&(this._polygonDepth._flattenPolygonDrawCommands=[],this._polygonDepth.destroy()),this._flattenPolygons=[],this._regionDirty=!1};gP.prototype.update=function(o){this._frameState=o,N(this._defautTexture)||(this._defautTexture=new _o({context:this._frameState.context,width:2,height:2})),this._regionDirty===!0&&(this._polygonDepth._flattenPolygonDrawCommands=[],this._flattenPolygons.length>0&&(this.initailize(o),this._polygonDepth.update(o)),this._regionDirty=!1)};gP.prototype.getTexture=function(){return N(this._polygonDepth)?this._polygonDepth._colorTexture:this._defautTexture};gP.prototype.getInvertMatrix=function(){let o=new Ee;return Ee.inverse(this.fromENU,o),o};gP.prototype.getProject=function(){return Ee.IDENTITY};gP.prototype.getRegionBounds=function(){return this._regionBounds};var pPe=gP;function MO(o){this._scene=o,this._flattenPolygons=[],this._polygonTexture=new pPe}MO.prototype.addPolygon=function(o){this._flattenPolygons=[o],this.update()};MO.prototype.clearPolygon=function(){this._flattenPolygons=[],this._polygonTexture.clearFlattenPolygon()};function sot(o){let f=null,m=[];for(let y=0;y<o.length;y+=3){let x=o[y];if(x instanceof Array)f=sot(x);else{let C=o[y],w=o[y+1],A=o[y+2];m.push(C,w,A)}}let v=null;return f?v={positions:H.fromDegreesArrayHeights(m),holes:[f]}:v={positions:H.fromDegreesArrayHeights(m)},v}MO.prototype.update=function(){let o=this._flattenPolygons;if(o.length<1)return;let f=this._scene,m=this._polygonTexture;for(let w=0;w<o.length;w++){let A=o[w],E=sot(A),T=new UB({polygonHierarchy:E,extrudedHeight:10,perPositionHeight:!0});m.addFlattenPolygon(T)}let v=o[0][0],y=o[0][1],x=new H.fromDegrees(v,y,-2e3),C=tn.eastNorthUpToFixedFrame(x);m.fromENU=C,m.update(f._frameState)};MO.prototype.getTexture=function(){return this._polygonTexture.getTexture()};MO.prototype.getInvertMatrix=function(){return this._polygonTexture.getInvertMatrix()};MO.prototype.getProject=function(){return this._polygonTexture.getProject()};MO.prototype.getRegionBounds=function(){return this._polygonTexture.getRegionBounds()};var mPe=MO;function yD(){this._flattenPolygons=[],this._needUpdateFlatten=!1,this._updateFlattenInternal=!1,this._defautTexture=void 0,this._flattenBounds=new Wt,this._polygonDepth=void 0,this._matMW=Ee.IDENTITY,this._flattenOriginPoint=void 0}Object.defineProperties(yD.prototype,{needUpdateFlatten:{get:function(){return this._needUpdateFlatten},set:function(o){this._needUpdateFlatten=o}},flattenPolygons:{get:function(){return this._flattenPolygons},set:function(o){!N(o)||!N(o.length)?this._flattenPolygons=[]:this._flattenPolygons=o,this._updateFlattenInternal=!0}},localViewMatrix:{get:function(){return this._matMW},set:function(o){this._matMW=o}}});yD.prototype.initailize=function(o){if(this._flattenPolygons.length>0){N(this._polygonDepth)||(this._polygonDepth=new H5),this._polygonDepth._flattenPolygonDrawCommands=[];let f={position:0},m=new Ee;Ee.inverse(this._matMW,m);let v=new Xr,y=[];for(let x=0;x<this._flattenPolygons.length;x++){let C=o.context,w=this._flattenPolygons[x],A=UB.createGeometry(w),E=A.attributes.position.values;for(let L=0;L<E.length/3;L++){let R=new H(0,0,0);R.x=E[3*L],R.y=E[3*L+1],R.z=E[3*L+2],Ee.multiplyByPoint(m,R,R),y.push(R),A.attributes.position.values[3*L]=R.x,A.attributes.position.values[3*L+1]=R.y,A.attributes.position.values[3*L+2]=R.z}let T=Pi.transform(A.boundingSphere,m);A.boundingSphere=T;let S=Du.fromGeometry({context:C,geometry:A,attributeLocations:f,bufferUsage:gn.STATIC_DRAW,interleave:!0}),M=Rs.fromCache({context:C,vertexShaderSource:Tne,fragmentShaderSource:Ene}),I=new Mn;I.depthTest.enabled=!0,I.cull.enabled=!0,I.cull.face=xi.BACK;let P={},D=new Jn({boundingVolume:T,modelMatrix:new Ee,primitiveType:Fn.TRIANGLES,vertexArray:S,shaderProgram:M,uniformMap:P,renderState:I,pass:vr.GLOBE});this._polygonDepth._flattenPolygonDrawCommands.push(D)}Xr.fromPoints(y,v),this._flattenBounds.x=v.x,this._flattenBounds.y=v.y+v.height,this._flattenBounds.z=v.x+v.width,this._flattenBounds.w=v.y,this._polygonDepth.updateFrustum(this._flattenBounds.x,this._flattenBounds.y,this._flattenBounds.z,this._flattenBounds.w)}};yD.prototype.addFlattenPolygon=function(o){this._flattenPolygons.push(o),this._updateFlattenInternal=!0,this._needUpdateFlatten=!0};yD.prototype.removeFlattenPolygon=function(o){for(let f=0;f<this._flattenPolygons.length;f++)if(this._flattenPolygons[f]===o){this._flattenPolygons.splice(f,1),this._updateFlattenInternal=!0,N(this._polygonDepth)||(this._polygonDepth=new H5),this._polygonDepth.destroy(),this._polygonDepth=void 0;break}};yD.prototype.clearFlattenPolygon=function(){N(this._polygonDepth)&&(this._polygonDepth._flattenPolygonDrawCommands=[],this._polygonDepth.destroy(),this._polygonDepth=void 0),this._flattenPolygons=[],this._needUpdateFlatten=!1,this._updateFlattenInternal=!1};yD.prototype.update=function(o,f,m){this._frameState=o,N(this._defautTexture)||(this._defautTexture=new _o({context:this._frameState.context,width:2,height:2})),this._needUpdateFlatten===!0&&N(this._flattenPolygons)&&this._flattenPolygons.length>0&&(this._updateFlattenInternal===!0&&(N(this._polygonDepth)?(this._polygonDepth.destroy(),this._polygonDepth=void 0,this.initailize(o)):this.initailize(o)),N(this._polygonDepth)&&this._polygonDepth.update(o),this._updateFlattenInternal=!1)};yD.getShader=function(o){};yD.prototype.getUniformMap=function(){let o=this,f={};return f.u_polygonTexture=function(){return N(o._polygonDepth)?o._polygonDepth._colorTexture:o._defautTexture},f.u_polygonBounds=function(){return o._flattenBounds},f.u_bFlatten=function(){return!!(o._needUpdateFlatten===!0&&N(o._polygonDepth))},f.u_eastNorthUpToFixedFrame=function(){return o.localViewMatrix},f.u_r_eastNorthUpToFixedFrame=function(){let m=new Ee;return Ee.inverse(o.localViewMatrix,m),m},f};var Q2i=yD,gPe=Q2i;function V6(o,f,m){this._scene=o,this._flattenPolygons=[],this._polygonTexture=new gPe,this._clipPlaneOfFlatten=!1,this._enableFlatten=f||!0,this._enableRegionWeather=m||!1,this._ripple=!1,this._snow=!1,this._regionAlpha=.8,this._regionGradientDistance=10,this._heightFog=!1,this._fogheight=100}Object.defineProperties(V6.prototype,{clipPlaneOfFlatten:{get:function(){return this._clipPlaneOfFlatten},set:function(o){this._clipPlaneOfFlatten=o}},ripple:{get:function(){return this._ripple},set:function(o){this._ripple=o}},snow:{get:function(){return this._snow},set:function(o){this._snow=o}},heightFog:{get:function(){return this._heightFog},set:function(o){this._heightFog=o}},disabled:{set:function(o){this.ripple=o,this.snow=o,this.heightFog=o}}});V6.prototype.addPolygon=function(o){this._flattenPolygons.push(o)};V6.prototype.clearPolygon=function(){this._flattenPolygons=[];let o=this._polygonTexture,f=this._scene,m={flattenBounds:[],flattenPolygons:[],flattenPolygonHeights:[]};f.globe.flattenPolygonRegion=m,f.globe.flattenUniforms=void 0,o.clearFlattenPolygon()};function lot(o){let f=null,m=[];for(let y=0;y<o.length;y+=3){let x=o[y];if(x instanceof Array)f=lot(x);else{let C=o[y],w=o[y+1],A=o[y+2];m.push(C,w,A)}}let v=null;return f?v={positions:H.fromDegreesArrayHeights(m),holes:[f]}:v={positions:H.fromDegreesArrayHeights(m)},v}V6.prototype.generatePolygonTexture=function(){let o=this._scene,f=this._polygonTexture,m=this._flattenPolygons;if(m.length<1)return;for(let w=0;w<m.length;w++){let A=m[w],E=lot(A),T=new UB({polygonHierarchy:E,extrudedHeight:10,perPositionHeight:!0});f.addFlattenPolygon(T)}let v=m[0][0],y=m[0][1],x=new H.fromDegrees(v,y,-2e3),C=tn.eastNorthUpToFixedFrame(x);f.localViewMatrix=C,f.update(o._frameState)};V6.prototype.update=function(){let o=this._scene,f=this._polygonTexture,m=this._flattenPolygons;if(m.length<1)return;this.generatePolygonTexture();let v={flattenBounds:[],flattenPolygons:[],flattenPolygonHeights:[],enableFlatten:!1,enableRegionWeather:!1},y=-100;for(let w=0;w<m.length;w++){let A=m[w],E=new Xr,T=[],S=[],M=0,I=0;for(let D=0;D<A.length/3;D++){let L=A[3*D];if(L instanceof Array)console.log("");else{let R=A[3*D+1],O=new H(L,R,0);T.push(O),S.push([xe.toRadians(L),xe.toRadians(R)]),M=Math.max(A[3*D+2],M),I=Math.min(A[3*D+2],I),y=Math.min(y,I)}}Xr.fromPoints(T,E);let P=new Wt(E.x,E.y+E.height,E.x+E.width,E.y);v.flattenBounds.push(P),v.flattenPolygons.push(S),v.flattenPolygonHeights.push({maxHeight:M+2,minHeight:I-2}),v.enableFlatten=this._enableFlatten,v.enableRegionWeather=this._enableRegionWeather}o.globe.flattenPolygonRegion=v;let x=f.getUniformMap();x.u_minFlattenHeight=function(){return y};let C=this;x.u_clipPlaneOfFlatten=function(){return C.clipPlaneOfFlatten},x.u_ripple=function(){return C.ripple},x.u_regionSnow=function(){return C.snow},x.u_regionAlpha=function(){return C.regionAlpha},x.u_regionGradientDistance=function(){return C.regionGradientDistance},x.u_heightFog=function(){return C.heightFog},x.u_fogHeight=function(){return C.fogHeight},o.globe.flattenUniforms=x,o.requestRender()};var xD=V6,F7;typeof ko<"u"&&(F7=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) */(function(){(function(o){var f=this||(0,eval)("this"),m=f.document,v=f.navigator,y=f.jQuery,x=f.JSON;y||typeof jQuery>"u"||(y=jQuery),function(C){C(f.ko={})}(function(C,w){function A(Y,Q){return Y===null||typeof Y in D?Y===Q:!1}function E(Y,Q){var ee;return function(){ee||(ee=P.a.setTimeout(function(){ee=o,Y()},Q))}}function T(Y,Q){var ee;return function(){clearTimeout(ee),ee=P.a.setTimeout(Y,Q)}}function S(Y,Q){Q&&Q!=="change"?Q==="beforeChange"?this.pc(Y):this.gb(Y,Q):this.qc(Y)}function M(Y,Q){Q!==null&&Q.s&&Q.s()}function I(Y,Q){var ee=this.qd,z=ee[k];z.ra||(this.Qb&&this.mb[Q]?(ee.uc(Q,Y,this.mb[Q]),this.mb[Q]=null,--this.Qb):z.I[Q]||ee.uc(Q,Y,z.J?{da:Y}:ee.$c(Y)),Y.Ja&&Y.gd())}var P=typeof C<"u"?C:{};P.b=function(Y,Q){for(var ee=Y.split("."),z=P,ie=0;ie<ee.length-1;ie++)z=z[ee[ie]];z[ee[ee.length-1]]=Q},P.L=function(Y,Q,ee){Y[Q]=ee},P.version="3.5.1",P.b("version",P.version),P.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},P.a=function(){function Y(pe,ce){for(var he in pe)ie.call(pe,he)&&ce(he,pe[he])}function Q(pe,ce){if(ce)for(var he in ce)ie.call(ce,he)&&(pe[he]=ce[he]);return pe}function ee(pe,ce){return pe.__proto__=ce,pe}function z(pe,ce,he,Ce){var Se=pe[ce].match(de)||[];P.a.D(he.match(de),function(De){P.a.Na(Se,De,Ce)}),pe[ce]=Se.join(" ")}var ie=Object.prototype.hasOwnProperty,re={__proto__:[]}instanceof Array,ne=typeof Symbol=="function",oe={},se={};oe[v&&/Firefox\/2/i.test(v.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],oe.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),Y(oe,function(pe,ce){if(ce.length)for(var he=0,Ce=ce.length;he<Ce;he++)se[ce[he]]=pe});var ae={propertychange:!0},fe=m&&function(){for(var pe=3,ce=m.createElement("div"),he=ce.getElementsByTagName("i");ce.innerHTML="<!--[if gt IE "+ ++pe+"]><i></i><![endif]-->",he[0];);return 4<pe?pe:o}(),de=/\S+/g,ve;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(pe,ce,he){for(var Ce=0,Se=pe.length;Ce<Se;Ce++)ce.call(he,pe[Ce],Ce,pe)},A:typeof Array.prototype.indexOf=="function"?function(pe,ce){return Array.prototype.indexOf.call(pe,ce)}:function(pe,ce){for(var he=0,Ce=pe.length;he<Ce;he++)if(pe[he]===ce)return he;return-1},Lb:function(pe,ce,he){for(var Ce=0,Se=pe.length;Ce<Se;Ce++)if(ce.call(he,pe[Ce],Ce,pe))return pe[Ce];return o},Pa:function(pe,ce){var he=P.a.A(pe,ce);0<he?pe.splice(he,1):he===0&&pe.shift()},wc:function(pe){var ce=[];return pe&&P.a.D(pe,function(he){0>P.a.A(ce,he)&&ce.push(he)}),ce},Mb:function(pe,ce,he){var Ce=[];if(pe)for(var Se=0,De=pe.length;Se<De;Se++)Ce.push(ce.call(he,pe[Se],Se));return Ce},jb:function(pe,ce,he){var Ce=[];if(pe)for(var Se=0,De=pe.length;Se<De;Se++)ce.call(he,pe[Se],Se)&&Ce.push(pe[Se]);return Ce},Nb:function(pe,ce){if(ce instanceof Array)pe.push.apply(pe,ce);else for(var he=0,Ce=ce.length;he<Ce;he++)pe.push(ce[he]);return pe},Na:function(pe,ce,he){var Ce=P.a.A(P.a.bc(pe),ce);0>Ce?he&&pe.push(ce):he||pe.splice(Ce,1)},Ba:re,extend:Q,setPrototypeOf:ee,Ab:re?ee:Q,P:Y,Ga:function(pe,ce,he){if(!pe)return pe;var Ce={},Se;for(Se in pe)ie.call(pe,Se)&&(Ce[Se]=ce.call(he,pe[Se],Se,pe));return Ce},Tb:function(pe){for(;pe.firstChild;)P.removeNode(pe.firstChild)},Yb:function(pe){pe=P.a.la(pe);for(var ce=(pe[0]&&pe[0].ownerDocument||m).createElement("div"),he=0,Ce=pe.length;he<Ce;he++)ce.appendChild(P.oa(pe[he]));return ce},Ca:function(pe,ce){for(var he=0,Ce=pe.length,Se=[];he<Ce;he++){var De=pe[he].cloneNode(!0);Se.push(ce?P.oa(De):De)}return Se},va:function(pe,ce){if(P.a.Tb(pe),ce)for(var he=0,Ce=ce.length;he<Ce;he++)pe.appendChild(ce[he])},Xc:function(pe,ce){var he=pe.nodeType?[pe]:pe;if(0<he.length){for(var Ce=he[0],Se=Ce.parentNode,De=0,Oe=ce.length;De<Oe;De++)Se.insertBefore(ce[De],Ce);for(De=0,Oe=he.length;De<Oe;De++)P.removeNode(he[De])}},Ua:function(pe,ce){if(pe.length){for(ce=ce.nodeType===8&&ce.parentNode||ce;pe.length&&pe[0].parentNode!==ce;)pe.splice(0,1);for(;1<pe.length&&pe[pe.length-1].parentNode!==ce;)pe.length--;if(1<pe.length){var he=pe[0],Ce=pe[pe.length-1];for(pe.length=0;he!==Ce;)pe.push(he),he=he.nextSibling;pe.push(Ce)}}return pe},Zc:function(pe,ce){7>fe?pe.setAttribute("selected",ce):pe.selected=ce},Db:function(pe){return pe===null||pe===o?"":pe.trim?pe.trim():pe.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(pe,ce){return pe=pe||"",ce.length>pe.length?!1:pe.substring(0,ce.length)===ce},vd:function(pe,ce){if(pe===ce)return!0;if(pe.nodeType===11)return!1;if(ce.contains)return ce.contains(pe.nodeType!==1?pe.parentNode:pe);if(ce.compareDocumentPosition)return(ce.compareDocumentPosition(pe)&16)==16;for(;pe&&pe!=ce;)pe=pe.parentNode;return!!pe},Sb:function(pe){return P.a.vd(pe,pe.ownerDocument.documentElement)},kd:function(pe){return!!P.a.Lb(pe,P.a.Sb)},R:function(pe){return pe&&pe.tagName&&pe.tagName.toLowerCase()},Ac:function(pe){return P.onError?function(){try{return pe.apply(this,arguments)}catch(ce){throw P.onError&&P.onError(ce),ce}}:pe},setTimeout:function(pe,ce){return setTimeout(P.a.Ac(pe),ce)},Gc:function(pe){setTimeout(function(){throw P.onError&&P.onError(pe),pe},0)},B:function(pe,ce,he){var Ce=P.a.Ac(he);if(he=ae[ce],P.options.useOnlyNativeEvents||he||!y)if(he||typeof pe.addEventListener!="function")if(typeof pe.attachEvent<"u"){var Se=function(Oe){Ce.call(pe,Oe)},De="on"+ce;pe.attachEvent(De,Se),P.a.K.za(pe,function(){pe.detachEvent(De,Se)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else pe.addEventListener(ce,Ce,!1);else ve||(ve=typeof y(pe).on=="function"?"on":"bind"),y(pe)[ve](ce,Ce)},Fb:function(pe,ce){if(!pe||!pe.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var he;if(P.a.R(pe)==="input"&&pe.type&&ce.toLowerCase()=="click"?(he=pe.type,he=he=="checkbox"||he=="radio"):he=!1,P.options.useOnlyNativeEvents||!y||he)if(typeof m.createEvent=="function")if(typeof pe.dispatchEvent=="function")he=m.createEvent(se[ce]||"HTMLEvents"),he.initEvent(ce,!0,!0,f,0,0,0,0,0,!1,!1,!1,!1,0,pe),pe.dispatchEvent(he);else throw Error("The supplied element doesn't support dispatchEvent");else if(he&&pe.click)pe.click();else if(typeof pe.fireEvent<"u")pe.fireEvent("on"+ce);else throw Error("Browser doesn't support triggering events");else y(pe).trigger(ce)},f:function(pe){return P.O(pe)?pe():pe},bc:function(pe){return P.O(pe)?pe.v():pe},Eb:function(pe,ce,he){var Ce;ce&&(typeof pe.classList=="object"?(Ce=pe.classList[he?"add":"remove"],P.a.D(ce.match(de),function(Se){Ce.call(pe.classList,Se)})):typeof pe.className.baseVal=="string"?z(pe.className,"baseVal",ce,he):z(pe,"className",ce,he))},Bb:function(pe,ce){var he=P.a.f(ce);(he===null||he===o)&&(he="");var Ce=P.h.firstChild(pe);!Ce||Ce.nodeType!=3||P.h.nextSibling(Ce)?P.h.va(pe,[pe.ownerDocument.createTextNode(he)]):Ce.data=he,P.a.Ad(pe)},Yc:function(pe,ce){if(pe.name=ce,7>=fe)try{var he=pe.name.replace(/[&<>'"]/g,function(Ce){return"&#"+Ce.charCodeAt(0)+";"});pe.mergeAttributes(m.createElement("<input name='"+he+"'/>"),!1)}catch{}},Ad:function(pe){9<=fe&&(pe=pe.nodeType==1?pe:pe.parentNode,pe.style&&(pe.style.zoom=pe.style.zoom))},wd:function(pe){if(fe){var ce=pe.style.width;pe.style.width=0,pe.style.width=ce}},Pd:function(pe,ce){pe=P.a.f(pe),ce=P.a.f(ce);for(var he=[],Ce=pe;Ce<=ce;Ce++)he.push(Ce);return he},la:function(pe){for(var ce=[],he=0,Ce=pe.length;he<Ce;he++)ce.push(pe[he]);return ce},Da:function(pe){return ne?Symbol(pe):pe},Zd:fe===6,$d:fe===7,W:fe,Lc:function(pe,ce){for(var he=P.a.la(pe.getElementsByTagName("input")).concat(P.a.la(pe.getElementsByTagName("textarea"))),Ce=typeof ce=="string"?function(Oe){return Oe.name===ce}:function(Oe){return ce.test(Oe.name)},Se=[],De=he.length-1;0<=De;De--)Ce(he[De])&&Se.push(he[De]);return Se},Nd:function(pe){return typeof pe=="string"&&(pe=P.a.Db(pe))?x&&x.parse?x.parse(pe):new Function("return "+pe)():null},hc:function(pe,ce,he){if(!x||!x.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return x.stringify(P.a.f(pe),ce,he)},Od:function(pe,ce,he){he=he||{};var Ce=he.params||{},Se=he.includeFields||this.Jc,De=pe;if(typeof pe=="object"&&P.a.R(pe)==="form")for(var De=pe.action,Oe=Se.length-1;0<=Oe;Oe--)for(var Ue=P.a.Lc(pe,Se[Oe]),Xe=Ue.length-1;0<=Xe;Xe--)Ce[Ue[Xe].name]=Ue[Xe].value;ce=P.a.f(ce);var it=m.createElement("form");it.style.display="none",it.action=De,it.method="post";for(var ut in ce)pe=m.createElement("input"),pe.type="hidden",pe.name=ut,pe.value=P.a.hc(P.a.f(ce[ut])),it.appendChild(pe);Y(Ce,function(at,Pt){var Qe=m.createElement("input");Qe.type="hidden",Qe.name=at,Qe.value=Pt,it.appendChild(Qe)}),m.body.appendChild(it),he.submitter?he.submitter(it):it.submit(),setTimeout(function(){it.parentNode.removeChild(it)},0)}}}(),P.b("utils",P.a),P.b("utils.arrayForEach",P.a.D),P.b("utils.arrayFirst",P.a.Lb),P.b("utils.arrayFilter",P.a.jb),P.b("utils.arrayGetDistinctValues",P.a.wc),P.b("utils.arrayIndexOf",P.a.A),P.b("utils.arrayMap",P.a.Mb),P.b("utils.arrayPushAll",P.a.Nb),P.b("utils.arrayRemoveItem",P.a.Pa),P.b("utils.cloneNodes",P.a.Ca),P.b("utils.createSymbolOrString",P.a.Da),P.b("utils.extend",P.a.extend),P.b("utils.fieldsIncludedWithJsonPost",P.a.Jc),P.b("utils.getFormFields",P.a.Lc),P.b("utils.objectMap",P.a.Ga),P.b("utils.peekObservable",P.a.bc),P.b("utils.postJson",P.a.Od),P.b("utils.parseJson",P.a.Nd),P.b("utils.registerEventHandler",P.a.B),P.b("utils.stringifyJson",P.a.hc),P.b("utils.range",P.a.Pd),P.b("utils.toggleDomNodeCssClass",P.a.Eb),P.b("utils.triggerEvent",P.a.Fb),P.b("utils.unwrapObservable",P.a.f),P.b("utils.objectForEach",P.a.P),P.b("utils.addOrRemoveItem",P.a.Na),P.b("utils.setTextContent",P.a.Bb),P.b("unwrap",P.a.f),Function.prototype.bind||(Function.prototype.bind=function(Y){var Q=this;if(arguments.length===1)return function(){return Q.apply(Y,arguments)};var ee=Array.prototype.slice.call(arguments,1);return function(){var z=ee.slice(0);return z.push.apply(z,arguments),Q.apply(Y,z)}}),P.a.g=new function(){var Y=0,Q="__ko__"+new Date().getTime(),ee={},z,ie;return P.a.W?(z=function(re,ne){var oe=re[Q];if(!oe||oe==="null"||!ee[oe]){if(!ne)return o;oe=re[Q]="ko"+Y++,ee[oe]={}}return ee[oe]},ie=function(re){var ne=re[Q];return ne?(delete ee[ne],re[Q]=null,!0):!1}):(z=function(re,ne){var oe=re[Q];return!oe&&ne&&(oe=re[Q]={}),oe},ie=function(re){return re[Q]?(delete re[Q],!0):!1}),{get:function(re,ne){var oe=z(re,!1);return oe&&oe[ne]},set:function(re,ne,oe){(re=z(re,oe!==o))&&(re[ne]=oe)},Ub:function(re,ne,oe){return re=z(re,!0),re[ne]||(re[ne]=oe)},clear:ie,Z:function(){return Y+++Q}}},P.b("utils.domData",P.a.g),P.b("utils.domData.clear",P.a.g.clear),P.a.K=new function(){function Y(ne,oe){var se=P.a.g.get(ne,z);return se===o&&oe&&(se=[],P.a.g.set(ne,z,se)),se}function Q(ne){var oe=Y(ne,!1);if(oe)for(var oe=oe.slice(0),se=0;se<oe.length;se++)oe[se](ne);P.a.g.clear(ne),P.a.K.cleanExternalData(ne),re[ne.nodeType]&&ee(ne.childNodes,!0)}function ee(ne,oe){for(var se=[],ae,fe=0;fe<ne.length;fe++)if((!oe||ne[fe].nodeType===8)&&(Q(se[se.length]=ae=ne[fe]),ne[fe]!==ae))for(;fe--&&P.a.A(se,ne[fe])==-1;);}var z=P.a.g.Z(),ie={1:!0,8:!0,9:!0},re={1:!0,9:!0};return{za:function(ne,oe){if(typeof oe!="function")throw Error("Callback must be a function");Y(ne,!0).push(oe)},yb:function(ne,oe){var se=Y(ne,!1);se&&(P.a.Pa(se,oe),se.length==0&&P.a.g.set(ne,z,o))},oa:function(ne){return P.u.G(function(){ie[ne.nodeType]&&(Q(ne),re[ne.nodeType]&&ee(ne.getElementsByTagName("*")))}),ne},removeNode:function(ne){P.oa(ne),ne.parentNode&&ne.parentNode.removeChild(ne)},cleanExternalData:function(ne){y&&typeof y.cleanData=="function"&&y.cleanData([ne])}}},P.oa=P.a.K.oa,P.removeNode=P.a.K.removeNode,P.b("cleanNode",P.oa),P.b("removeNode",P.removeNode),P.b("utils.domNodeDisposal",P.a.K),P.b("utils.domNodeDisposal.addDisposeCallback",P.a.K.za),P.b("utils.domNodeDisposal.removeDisposeCallback",P.a.K.yb),function(){var Y=[0,"",""],Q=[1,"<table>","</table>"],ee=[3,"<table><tbody><tr>","</tr></tbody></table>"],z=[1,"<select multiple='multiple'>","</select>"],ie={thead:Q,tbody:Q,tfoot:Q,tr:[2,"<table><tbody>","</tbody></table>"],td:ee,th:ee,option:z,optgroup:z},re=8>=P.a.W;P.a.ua=function(ne,oe){var se;if(y){if(y.parseHTML)se=y.parseHTML(ne,oe)||[];else if((se=y.clean([ne],oe))&&se[0]){for(var ae=se[0];ae.parentNode&&ae.parentNode.nodeType!==11;)ae=ae.parentNode;ae.parentNode&&ae.parentNode.removeChild(ae)}}else{(se=oe)||(se=m);var ae=se.parentWindow||se.defaultView||f,fe=P.a.Db(ne).toLowerCase(),de=se.createElement("div"),ve;for(ve=(fe=fe.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&ie[fe[1]]||Y,fe=ve[0],ve="ignored<div>"+ve[1]+ne+ve[2]+"</div>",typeof ae.innerShiv=="function"?de.appendChild(ae.innerShiv(ve)):(re&&se.body.appendChild(de),de.innerHTML=ve,re&&de.parentNode.removeChild(de));fe--;)de=de.lastChild;se=P.a.la(de.lastChild.childNodes)}return se},P.a.Md=function(ne,oe){var se=P.a.ua(ne,oe);return se.length&&se[0].parentElement||P.a.Yb(se)},P.a.fc=function(ne,oe){if(P.a.Tb(ne),oe=P.a.f(oe),oe!==null&&oe!==o)if(typeof oe!="string"&&(oe=oe.toString()),y)y(ne).html(oe);else for(var se=P.a.ua(oe,ne.ownerDocument),ae=0;ae<se.length;ae++)ne.appendChild(se[ae])}}(),P.b("utils.parseHtmlFragment",P.a.ua),P.b("utils.setHtml",P.a.fc),P.aa=function(){function Y(ee,z){if(ee){if(ee.nodeType==8){var ie=P.aa.Uc(ee.nodeValue);ie!=null&&z.push({ud:ee,Kd:ie})}else if(ee.nodeType==1)for(var ie=0,re=ee.childNodes,ne=re.length;ie<ne;ie++)Y(re[ie],z)}}var Q={};return{Xb:function(ee){if(typeof ee!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var z=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return Q[z]=ee,"<!--[ko_memo:"+z+"]-->"},bd:function(ee,z){var ie=Q[ee];if(ie===o)throw Error("Couldn't find any memo with ID "+ee+". Perhaps it's already been unmemoized.");try{return ie.apply(null,z||[]),!0}finally{delete Q[ee]}},cd:function(ee,z){var ie=[];Y(ee,ie);for(var re=0,ne=ie.length;re<ne;re++){var oe=ie[re].ud,se=[oe];z&&P.a.Nb(se,z),P.aa.bd(ie[re].Kd,se),oe.nodeValue="",oe.parentNode&&oe.parentNode.removeChild(oe)}},Uc:function(ee){return(ee=ee.match(/^\[ko_memo\:(.*?)\]$/))?ee[1]:null}}}(),P.b("memoization",P.aa),P.b("memoization.memoize",P.aa.Xb),P.b("memoization.unmemoize",P.aa.bd),P.b("memoization.parseMemoText",P.aa.Uc),P.b("memoization.unmemoizeDomNodeAndDescendants",P.aa.cd),P.na=function(){function Y(){if(ie){for(var oe=ie,se=0,ae;ne<ie;)if(ae=z[ne++]){if(ne>oe){if(5e3<=++se){ne=ie,P.a.Gc(Error("'Too much recursion' after processing "+se+" task groups."));break}oe=ie}try{ae()}catch(fe){P.a.Gc(fe)}}}}function Q(){Y(),ne=ie=z.length=0}var ee,z=[],ie=0,re=1,ne=0;return f.MutationObserver?ee=function(oe){var se=m.createElement("div");return new MutationObserver(oe).observe(se,{attributes:!0}),function(){se.classList.toggle("foo")}}(Q):ee=m&&"onreadystatechange"in m.createElement("script")?function(oe){var se=m.createElement("script");se.onreadystatechange=function(){se.onreadystatechange=null,m.documentElement.removeChild(se),se=null,oe()},m.documentElement.appendChild(se)}:function(oe){setTimeout(oe,0)},{scheduler:ee,zb:function(oe){return ie||P.na.scheduler(Q),z[ie++]=oe,re++},cancel:function(oe){oe=oe-(re-ie),oe>=ne&&oe<ie&&(z[oe]=null)},resetForTesting:function(){var oe=ie-ne;return ne=ie=z.length=0,oe},Sd:Y}}(),P.b("tasks",P.na),P.b("tasks.schedule",P.na.zb),P.b("tasks.runEarly",P.na.Sd),P.Ta={throttle:function(Y,Q){Y.throttleEvaluation=Q;var ee=null;return P.$({read:Y,write:function(z){clearTimeout(ee),ee=P.a.setTimeout(function(){Y(z)},Q)}})},rateLimit:function(Y,Q){var ee,z,ie;typeof Q=="number"?ee=Q:(ee=Q.timeout,z=Q.method),Y.Hb=!1,ie=typeof z=="function"?z:z=="notifyWhenChangesStop"?T:E,Y.ub(function(re){return ie(re,ee,Q)})},deferred:function(Y,Q){if(Q!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");Y.Hb||(Y.Hb=!0,Y.ub(function(ee){var z,ie=!1;return function(){if(!ie){P.na.cancel(z),z=P.na.zb(ee);try{ie=!0,Y.notifySubscribers(o,"dirty")}finally{ie=!1}}}}))},notify:function(Y,Q){Y.equalityComparer=Q=="always"?null:A}};var D={undefined:1,boolean:1,number:1,string:1};P.b("extenders",P.Ta),P.ic=function(Y,Q,ee){this.da=Y,this.lc=Q,this.mc=ee,this.Ib=!1,this.fb=this.Jb=null,P.L(this,"dispose",this.s),P.L(this,"disposeWhenNodeIsRemoved",this.l)},P.ic.prototype.s=function(){this.Ib||(this.fb&&P.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},P.ic.prototype.l=function(Y){this.Jb=Y,P.a.K.za(Y,this.fb=this.s.bind(this))},P.T=function(){P.a.Ab(this,L),L.qb(this)};var L={qb:function(Y){Y.U={change:[]},Y.sc=1},subscribe:function(Y,Q,ee){var z=this;ee=ee||"change";var ie=new P.ic(z,Q?Y.bind(Q):Y,function(){P.a.Pa(z.U[ee],ie),z.hb&&z.hb(ee)});return z.Qa&&z.Qa(ee),z.U[ee]||(z.U[ee]=[]),z.U[ee].push(ie),ie},notifySubscribers:function(Y,Q){if(Q=Q||"change",Q==="change"&&this.Gb(),this.Wa(Q)){var ee=Q==="change"&&this.ed||this.U[Q].slice(0);try{P.u.xc();for(var z=0,ie;ie=ee[z];++z)ie.Ib||ie.lc(Y)}finally{P.u.end()}}},ob:function(){return this.sc},Dd:function(Y){return this.ob()!==Y},Gb:function(){++this.sc},ub:function(Y){var Q=this,ee=P.O(Q),z,ie,re,ne,oe;Q.gb||(Q.gb=Q.notifySubscribers,Q.notifySubscribers=S);var se=Y(function(){Q.Ja=!1,ee&&ne===Q&&(ne=Q.nc?Q.nc():Q());var ae=ie||oe&&Q.sb(re,ne);oe=ie=z=!1,ae&&Q.gb(re=ne)});Q.qc=function(ae,fe){fe&&Q.Ja||(oe=!fe),Q.ed=Q.U.change.slice(0),Q.Ja=z=!0,ne=ae,se()},Q.pc=function(ae){z||(re=ae,Q.gb(ae,"beforeChange"))},Q.rc=function(){oe=!0},Q.gd=function(){Q.sb(re,Q.v(!0))&&(ie=!0)}},Wa:function(Y){return this.U[Y]&&this.U[Y].length},Bd:function(Y){if(Y)return this.U[Y]&&this.U[Y].length||0;var Q=0;return P.a.P(this.U,function(ee,z){ee!=="dirty"&&(Q+=z.length)}),Q},sb:function(Y,Q){return!this.equalityComparer||!this.equalityComparer(Y,Q)},toString:function(){return"[object Object]"},extend:function(Y){var Q=this;return Y&&P.a.P(Y,function(ee,z){var ie=P.Ta[ee];typeof ie=="function"&&(Q=ie(Q,z)||Q)}),Q}};P.L(L,"init",L.qb),P.L(L,"subscribe",L.subscribe),P.L(L,"extend",L.extend),P.L(L,"getSubscriptionsCount",L.Bd),P.a.Ba&&P.a.setPrototypeOf(L,Function.prototype),P.T.fn=L,P.Qc=function(Y){return Y!=null&&typeof Y.subscribe=="function"&&typeof Y.notifySubscribers=="function"},P.b("subscribable",P.T),P.b("isSubscribable",P.Qc),P.S=P.u=function(){function Y(re){ee.push(z),z=re}function Q(){z=ee.pop()}var ee=[],z,ie=0;return{xc:Y,end:Q,cc:function(re){if(z){if(!P.Qc(re))throw Error("Only subscribable things can act as dependencies");z.od.call(z.pd,re,re.fd||(re.fd=++ie))}},G:function(re,ne,oe){try{return Y(),re.apply(ne,oe||[])}finally{Q()}},qa:function(){if(z)return z.o.qa()},Va:function(){if(z)return z.o.Va()},Ya:function(){if(z)return z.Ya},o:function(){if(z)return z.o}}}(),P.b("computedContext",P.S),P.b("computedContext.getDependenciesCount",P.S.qa),P.b("computedContext.getDependencies",P.S.Va),P.b("computedContext.isInitial",P.S.Ya),P.b("computedContext.registerDependency",P.S.cc),P.b("ignoreDependencies",P.Yd=P.u.G);var R=P.a.Da("_latestValue");P.ta=function(Y){function Q(){return 0<arguments.length?(Q.sb(Q[R],arguments[0])&&(Q.ya(),Q[R]=arguments[0],Q.xa()),this):(P.u.cc(Q),Q[R])}return Q[R]=Y,P.a.Ba||P.a.extend(Q,P.T.fn),P.T.fn.qb(Q),P.a.Ab(Q,O),P.options.deferUpdates&&P.Ta.deferred(Q,!0),Q};var O={equalityComparer:A,v:function(){return this[R]},xa:function(){this.notifySubscribers(this[R],"spectate"),this.notifySubscribers(this[R])},ya:function(){this.notifySubscribers(this[R],"beforeChange")}};P.a.Ba&&P.a.setPrototypeOf(O,P.T.fn);var F=P.ta.Ma="__ko_proto__";O[F]=P.ta,P.O=function(Y){if((Y=typeof Y=="function"&&Y[F])&&Y!==O[F]&&Y!==P.o.fn[F])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!Y},P.Za=function(Y){return typeof Y=="function"&&(Y[F]===O[F]||Y[F]===P.o.fn[F]&&Y.Nc)},P.b("observable",P.ta),P.b("isObservable",P.O),P.b("isWriteableObservable",P.Za),P.b("isWritableObservable",P.Za),P.b("observable.fn",O),P.L(O,"peek",O.v),P.L(O,"valueHasMutated",O.xa),P.L(O,"valueWillMutate",O.ya),P.Ha=function(Y){if(Y=Y||[],typeof Y!="object"||!("length"in Y))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return Y=P.ta(Y),P.a.Ab(Y,P.Ha.fn),Y.extend({trackArrayChanges:!0})},P.Ha.fn={remove:function(Y){for(var Q=this.v(),ee=[],z=typeof Y!="function"||P.O(Y)?function(ne){return ne===Y}:Y,ie=0;ie<Q.length;ie++){var re=Q[ie];if(z(re)){if(ee.length===0&&this.ya(),Q[ie]!==re)throw Error("Array modified during remove; cannot remove item");ee.push(re),Q.splice(ie,1),ie--}}return ee.length&&this.xa(),ee},removeAll:function(Y){if(Y===o){var Q=this.v(),ee=Q.slice(0);return this.ya(),Q.splice(0,Q.length),this.xa(),ee}return Y?this.remove(function(z){return 0<=P.a.A(Y,z)}):[]},destroy:function(Y){var Q=this.v(),ee=typeof Y!="function"||P.O(Y)?function(re){return re===Y}:Y;this.ya();for(var z=Q.length-1;0<=z;z--){var ie=Q[z];ee(ie)&&(ie._destroy=!0)}this.xa()},destroyAll:function(Y){return Y===o?this.destroy(function(){return!0}):Y?this.destroy(function(Q){return 0<=P.a.A(Y,Q)}):[]},indexOf:function(Y){var Q=this();return P.a.A(Q,Y)},replace:function(Y,Q){var ee=this.indexOf(Y);0<=ee&&(this.ya(),this.v()[ee]=Q,this.xa())},sorted:function(Y){var Q=this().slice(0);return Y?Q.sort(Y):Q.sort()},reversed:function(){return this().slice(0).reverse()}},P.a.Ba&&P.a.setPrototypeOf(P.Ha.fn,P.ta.fn),P.a.D("pop push reverse shift sort splice unshift".split(" "),function(Y){P.Ha.fn[Y]=function(){var Q=this.v();this.ya(),this.zc(Q,Y,arguments);var ee=Q[Y].apply(Q,arguments);return this.xa(),ee===Q?this:ee}}),P.a.D(["slice"],function(Y){P.Ha.fn[Y]=function(){var Q=this();return Q[Y].apply(Q,arguments)}}),P.Pc=function(Y){return P.O(Y)&&typeof Y.remove=="function"&&typeof Y.push=="function"},P.b("observableArray",P.Ha),P.b("isObservableArray",P.Pc),P.Ta.trackArrayChanges=function(Y,Q){function ee(){function de(){if(oe){var ve=[].concat(Y.v()||[]),pe;Y.Wa("arrayChange")&&((!ie||1<oe)&&(ie=P.a.Pb(se,ve,Y.Ob)),pe=ie),se=ve,ie=null,oe=0,pe&&pe.length&&Y.notifySubscribers(pe,"arrayChange")}}z?de():(z=!0,ne=Y.subscribe(function(){++oe},null,"spectate"),se=[].concat(Y.v()||[]),ie=null,re=Y.subscribe(de))}if(Y.Ob={},Q&&typeof Q=="object"&&P.a.extend(Y.Ob,Q),Y.Ob.sparse=!0,!Y.zc){var z=!1,ie=null,re,ne,oe=0,se,ae=Y.Qa,fe=Y.hb;Y.Qa=function(de){ae&&ae.call(Y,de),de==="arrayChange"&&ee()},Y.hb=function(de){fe&&fe.call(Y,de),de!=="arrayChange"||Y.Wa("arrayChange")||(re&&re.s(),ne&&ne.s(),ne=re=null,z=!1,se=o)},Y.zc=function(de,ve,pe){function ce(it,ut,at){return he[he.length]={status:it,value:ut,index:at}}if(z&&!oe){var he=[],Ce=de.length,Se=pe.length,De=0;switch(ve){case"push":De=Ce;case"unshift":for(ve=0;ve<Se;ve++)ce("added",pe[ve],De+ve);break;case"pop":De=Ce-1;case"shift":Ce&&ce("deleted",de[De],De);break;case"splice":ve=Math.min(Math.max(0,0>pe[0]?Ce+pe[0]:pe[0]),Ce);for(var Ce=Se===1?Ce:Math.min(ve+(pe[1]||0),Ce),Se=ve+Se-2,De=Math.max(Ce,Se),Oe=[],Ue=[],Xe=2;ve<De;++ve,++Xe)ve<Ce&&Ue.push(ce("deleted",de[ve],ve)),ve<Se&&Oe.push(ce("added",pe[Xe],ve));P.a.Kc(Ue,Oe);break;default:return}ie=he}}}};var k=P.a.Da("_state");P.o=P.$=function(Y,Q,ee){function z(){if(0<arguments.length){if(typeof ie=="function")ie.apply(re.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return re.ra||P.u.cc(z),(re.ka||re.J&&z.Xa())&&z.ha(),re.X}if(typeof Y=="object"?ee=Y:(ee=ee||{},Y&&(ee.read=Y)),typeof ee.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var ie=ee.write,re={X:o,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:ee.read,nb:Q||ee.owner,l:ee.disposeWhenNodeIsRemoved||ee.l||null,Sa:ee.disposeWhen||ee.Sa,Rb:null,I:{},V:0,Ic:null};return z[k]=re,z.Nc=typeof ie=="function",P.a.Ba||P.a.extend(z,P.T.fn),P.T.fn.qb(z),P.a.Ab(z,U),ee.pure?(re.wb=!0,re.J=!0,P.a.extend(z,G)):ee.deferEvaluation&&P.a.extend(z,j),P.options.deferUpdates&&P.Ta.deferred(z,!0),re.l&&(re.jc=!0,re.l.nodeType||(re.l=null)),re.J||ee.deferEvaluation||z.ha(),re.l&&z.ja()&&P.a.K.za(re.l,re.Rb=function(){z.s()}),z};var U={equalityComparer:A,qa:function(){return this[k].V},Va:function(){var Y=[];return P.a.P(this[k].I,function(Q,ee){Y[ee.Ka]=ee.da}),Y},Vb:function(Y){if(!this[k].V)return!1;var Q=this.Va();return P.a.A(Q,Y)!==-1?!0:!!P.a.Lb(Q,function(ee){return ee.Vb&&ee.Vb(Y)})},uc:function(Y,Q,ee){if(this[k].wb&&Q===this)throw Error("A 'pure' computed must not be called recursively");this[k].I[Y]=ee,ee.Ka=this[k].V++,ee.La=Q.ob()},Xa:function(){var Y,Q,ee=this[k].I;for(Y in ee)if(Object.prototype.hasOwnProperty.call(ee,Y)&&(Q=ee[Y],this.Ia&&Q.da.Ja||Q.da.Dd(Q.La)))return!0},Jd:function(){this.Ia&&!this[k].rb&&this.Ia(!1)},ja:function(){var Y=this[k];return Y.ka||0<Y.V},Rd:function(){this.Ja?this[k].ka&&(this[k].sa=!0):this.Hc()},$c:function(Y){if(Y.Hb){var Q=Y.subscribe(this.Jd,this,"dirty"),ee=Y.subscribe(this.Rd,this);return{da:Y,s:function(){Q.s(),ee.s()}}}return Y.subscribe(this.Hc,this)},Hc:function(){var Y=this,Q=Y.throttleEvaluation;Q&&0<=Q?(clearTimeout(this[k].Ic),this[k].Ic=P.a.setTimeout(function(){Y.ha(!0)},Q)):Y.Ia?Y.Ia(!0):Y.ha(!0)},ha:function(Y){var Q=this[k],ee=Q.Sa,z=!1;if(!Q.rb&&!Q.ra){if(Q.l&&!P.a.Sb(Q.l)||ee&&ee()){if(!Q.jc){this.s();return}}else Q.jc=!1;Q.rb=!0;try{z=this.zd(Y)}finally{Q.rb=!1}return z}},zd:function(Y){var Q=this[k],z=!1,ee=Q.wb?o:!Q.V,z={qd:this,mb:Q.I,Qb:Q.V};P.u.xc({pd:z,od:I,o:this,Ya:ee}),Q.I={},Q.V=0;var ie=this.yd(Q,z);return Q.V?z=this.sb(Q.X,ie):(this.s(),z=!0),z&&(Q.J?this.Gb():this.notifySubscribers(Q.X,"beforeChange"),Q.X=ie,this.notifySubscribers(Q.X,"spectate"),!Q.J&&Y&&this.notifySubscribers(Q.X),this.rc&&this.rc()),ee&&this.notifySubscribers(Q.X,"awake"),z},yd:function(Y,Q){try{var ee=Y.Wc;return Y.nb?ee.call(Y.nb):ee()}finally{P.u.end(),Q.Qb&&!Y.J&&P.a.P(Q.mb,M),Y.sa=Y.ka=!1}},v:function(Y){var Q=this[k];return(Q.ka&&(Y||!Q.V)||Q.J&&this.Xa())&&this.ha(),Q.X},ub:function(Y){P.T.fn.ub.call(this,Y),this.nc=function(){return this[k].J||(this[k].sa?this.ha():this[k].ka=!1),this[k].X},this.Ia=function(Q){this.pc(this[k].X),this[k].ka=!0,Q&&(this[k].sa=!0),this.qc(this,!Q)}},s:function(){var Y=this[k];!Y.J&&Y.I&&P.a.P(Y.I,function(Q,ee){ee.s&&ee.s()}),Y.l&&Y.Rb&&P.a.K.yb(Y.l,Y.Rb),Y.I=o,Y.V=0,Y.ra=!0,Y.sa=!1,Y.ka=!1,Y.J=!1,Y.l=o,Y.Sa=o,Y.Wc=o,this.Nc||(Y.nb=o)}},G={Qa:function(Y){var Q=this,ee=Q[k];if(!ee.ra&&ee.J&&Y=="change"){if(ee.J=!1,ee.sa||Q.Xa())ee.I=null,ee.V=0,Q.ha()&&Q.Gb();else{var z=[];P.a.P(ee.I,function(ie,re){z[re.Ka]=ie}),P.a.D(z,function(ie,re){var ne=ee.I[ie],oe=Q.$c(ne.da);oe.Ka=re,oe.La=ne.La,ee.I[ie]=oe}),Q.Xa()&&Q.ha()&&Q.Gb()}ee.ra||Q.notifySubscribers(ee.X,"awake")}},hb:function(Y){var Q=this[k];Q.ra||Y!="change"||this.Wa("change")||(P.a.P(Q.I,function(ee,z){z.s&&(Q.I[ee]={da:z.da,Ka:z.Ka,La:z.La},z.s())}),Q.J=!0,this.notifySubscribers(o,"asleep"))},ob:function(){var Y=this[k];return Y.J&&(Y.sa||this.Xa())&&this.ha(),P.T.fn.ob.call(this)}},j={Qa:function(Y){Y!="change"&&Y!="beforeChange"||this.v()}};P.a.Ba&&P.a.setPrototypeOf(U,P.T.fn);var q=P.ta.Ma;U[q]=P.o,P.Oc=function(Y){return typeof Y=="function"&&Y[q]===U[q]},P.Fd=function(Y){return P.Oc(Y)&&Y[k]&&Y[k].wb},P.b("computed",P.o),P.b("dependentObservable",P.o),P.b("isComputed",P.Oc),P.b("isPureComputed",P.Fd),P.b("computed.fn",U),P.L(U,"peek",U.v),P.L(U,"dispose",U.s),P.L(U,"isActive",U.ja),P.L(U,"getDependenciesCount",U.qa),P.L(U,"getDependencies",U.Va),P.xb=function(Y,Q){return typeof Y=="function"?P.o(Y,Q,{pure:!0}):(Y=P.a.extend({},Y),Y.pure=!0,P.o(Y,Q))},P.b("pureComputed",P.xb),function(){function Y(z,ie,re){if(re=re||new ee,z=ie(z),typeof z!="object"||z===null||z===o||z instanceof RegExp||z instanceof Date||z instanceof String||z instanceof Number||z instanceof Boolean)return z;var ne=z instanceof Array?[]:{};return re.save(z,ne),Q(z,function(oe){var se=ie(z[oe]);switch(typeof se){case"boolean":case"number":case"string":case"function":ne[oe]=se;break;case"object":case"undefined":var ae=re.get(se);ne[oe]=ae!==o?ae:Y(se,ie,re)}}),ne}function Q(z,ie){if(z instanceof Array){for(var re=0;re<z.length;re++)ie(re);typeof z.toJSON=="function"&&ie("toJSON")}else for(re in z)ie(re)}function ee(){this.keys=[],this.values=[]}P.ad=function(z){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return Y(z,function(ie){for(var re=0;P.O(ie)&&10>re;re++)ie=ie();return ie})},P.toJSON=function(z,ie,re){return z=P.ad(z),P.a.hc(z,ie,re)},ee.prototype={constructor:ee,save:function(z,ie){var re=P.a.A(this.keys,z);0<=re?this.values[re]=ie:(this.keys.push(z),this.values.push(ie))},get:function(z){return z=P.a.A(this.keys,z),0<=z?this.values[z]:o}}}(),P.b("toJS",P.ad),P.b("toJSON",P.toJSON),P.Wd=function(Y,Q,ee){function z(ie){var re=P.xb(Y,ee).extend({ma:"always"}),ne=re.subscribe(function(oe){oe&&(ne.s(),ie(oe))});return re.notifySubscribers(re.v()),ne}return typeof Promise!="function"||Q?z(Q.bind(ee)):new Promise(z)},P.b("when",P.Wd),function(){P.w={M:function(Y){switch(P.a.R(Y)){case"option":return Y.__ko__hasDomDataOptionValue__===!0?P.a.g.get(Y,P.c.options.$b):7>=P.a.W?Y.getAttributeNode("value")&&Y.getAttributeNode("value").specified?Y.value:Y.text:Y.value;case"select":return 0<=Y.selectedIndex?P.w.M(Y.options[Y.selectedIndex]):o;default:return Y.value}},cb:function(Y,Q,ee){switch(P.a.R(Y)){case"option":typeof Q=="string"?(P.a.g.set(Y,P.c.options.$b,o),"__ko__hasDomDataOptionValue__"in Y&&delete Y.__ko__hasDomDataOptionValue__,Y.value=Q):(P.a.g.set(Y,P.c.options.$b,Q),Y.__ko__hasDomDataOptionValue__=!0,Y.value=typeof Q=="number"?Q:"");break;case"select":(Q===""||Q===null)&&(Q=o);for(var z=-1,ie=0,re=Y.options.length,ne;ie<re;++ie)if(ne=P.w.M(Y.options[ie]),ne==Q||ne===""&&Q===o){z=ie;break}(ee||0<=z||Q===o&&1<Y.size)&&(Y.selectedIndex=z,P.a.W===6&&P.a.setTimeout(function(){Y.selectedIndex=z},0));break;default:(Q===null||Q===o)&&(Q=""),Y.value=Q}}}}(),P.b("selectExtensions",P.w),P.b("selectExtensions.readValue",P.w.M),P.b("selectExtensions.writeValue",P.w.cb),P.m=function(){function Y(oe){oe=P.a.Db(oe),oe.charCodeAt(0)===123&&(oe=oe.slice(1,-1)),oe+=` ,`;var se=[],ae=oe.match(z),fe,de=[],ve=0;if(1<ae.length){for(var pe=0,ce;ce=ae[pe];++pe){var he=ce.charCodeAt(0);if(he===44){if(0>=ve){se.push(fe&&de.length?{key:fe,value:de.join("")}:{unknown:fe||de.join("")}),fe=ve=0,de=[];continue}}else if(he===58){if(!ve&&!fe&&de.length===1){fe=de.pop();continue}}else{if(he===47&&1<ce.length&&(ce.charCodeAt(1)===47||ce.charCodeAt(1)===42))continue;he===47&&pe&&1<ce.length?(he=ae[pe-1].match(ie))&&!re[he[0]]&&(oe=oe.substr(oe.indexOf(ce)+1),ae=oe.match(z),pe=-1,ce="/"):he===40||he===123||he===91?++ve:he===41||he===125||he===93?--ve:fe||de.length||he!==34&&he!==39||(ce=ce.slice(1,-1))}de.push(ce)}if(0<ve)throw Error("Unbalanced parentheses, braces, or brackets")}return se}var Q=["true","false","null","undefined"],ee=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,z=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.* |/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),ie=/[\])"'A-Za-z0-9_$]+$/,re={in:1,return:1,typeof:1},ne={};return{Ra:[],wa:ne,ac:Y,vb:function(oe,se){function ae(he,Ce){var Se;if(!pe){var De=P.getBindingHandler(he);if(De&&De.preprocess&&!(Ce=De.preprocess(Ce,he,ae)))return;(De=ne[he])&&(Se=Ce,0<=P.a.A(Q,Se)?Se=!1:(De=Se.match(ee),Se=De===null?!1:De[1]?"Object("+De[1]+")"+De[2]:Se),De=Se),De&&de.push("'"+(typeof ne[he]=="string"?ne[he]:he)+"':function(_z){"+Se+"=_z}")}ve&&(Ce="function(){return "+Ce+" }"),fe.push("'"+he+"':"+Ce)}se=se||{};var fe=[],de=[],ve=se.valueAccessors,pe=se.bindingParams,ce=typeof oe=="string"?Y(oe):oe;return P.a.D(ce,function(he){ae(he.key||he.unknown,he.value)}),de.length&&ae("_ko_property_writers","{"+de.join(",")+" }"),fe.join(",")},Id:function(oe,se){for(var ae=0;ae<oe.length;ae++)if(oe[ae].key==se)return!0;return!1},eb:function(oe,se,ae,fe,de){oe&&P.O(oe)?!P.Za(oe)||de&&oe.v()===fe||oe(fe):(oe=se.get("_ko_property_writers"))&&oe[ae]&&oe[ae](fe)}}}(),P.b("expressionRewriting",P.m),P.b("expressionRewriting.bindingRewriteValidators",P.m.Ra),P.b("expressionRewriting.parseObjectLiteral",P.m.ac),P.b("expressionRewriting.preProcessBindings",P.m.vb),P.b("expressionRewriting._twoWayBindings",P.m.wa),P.b("jsonExpressionRewriting",P.m),P.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",P.m.vb),function(){function Y(ae){return ae.nodeType==8&&re.test(ie?ae.text:ae.nodeValue)}function Q(ae){return ae.nodeType==8&&ne.test(ie?ae.text:ae.nodeValue)}function ee(ae,fe){for(var de=ae,ve=1,pe=[];de=de.nextSibling;){if(Q(de)&&(P.a.g.set(de,se,!0),ve--,ve===0))return pe;pe.push(de),Y(de)&&ve++}if(!fe)throw Error("Cannot find closing comment tag to match: "+ae.nodeValue);return null}function z(ae,fe){var de=ee(ae,fe);return de?0<de.length?de[de.length-1].nextSibling:ae.nextSibling:null}var ie=m&&m.createComment("test").text==="<!--test-->",re=ie?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,ne=ie?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,oe={ul:!0,ol:!0},se="__ko_matchedEndComment__";P.h={ea:{},childNodes:function(ae){return Y(ae)?ee(ae):ae.childNodes},Ea:function(ae){if(Y(ae)){ae=P.h.childNodes(ae);for(var fe=0,de=ae.length;fe<de;fe++)P.removeNode(ae[fe])}else P.a.Tb(ae)},va:function(ae,fe){if(Y(ae)){P.h.Ea(ae);for(var de=ae.nextSibling,ve=0,pe=fe.length;ve<pe;ve++)de.parentNode.insertBefore(fe[ve],de)}else P.a.va(ae,fe)},Vc:function(ae,fe){var de;Y(ae)?(de=ae.nextSibling,ae=ae.parentNode):de=ae.firstChild,de?fe!==de&&ae.insertBefore(fe,de):ae.appendChild(fe)},Wb:function(ae,fe,de){de?(de=de.nextSibling,Y(ae)&&(ae=ae.parentNode),de?fe!==de&&ae.insertBefore(fe,de):ae.appendChild(fe)):P.h.Vc(ae,fe)},firstChild:function(ae){if(Y(ae))return!ae.nextSibling||Q(ae.nextSibling)?null:ae.nextSibling;if(ae.firstChild&&Q(ae.firstChild))throw Error("Found invalid end comment, as the first child of "+ae);return ae.firstChild},nextSibling:function(ae){if(Y(ae)&&(ae=z(ae)),ae.nextSibling&&Q(ae.nextSibling)){var fe=ae.nextSibling;if(Q(fe)&&!P.a.g.get(fe,se))throw Error("Found end comment without a matching opening comment, as child of "+ae);return null}return ae.nextSibling},Cd:Y,Vd:function(ae){return(ae=(ie?ae.text:ae.nodeValue).match(re))?ae[1]:null},Sc:function(ae){if(oe[P.a.R(ae)]){var fe=ae.firstChild;if(fe)do if(fe.nodeType===1){var de;de=fe.firstChild;var ve=null;if(de)do if(ve)ve.push(de);else if(Y(de)){var pe=z(de,!0);pe?de=pe:ve=[de]}else Q(de)&&(ve=[de]);while(de=de.nextSibling);if(de=ve)for(ve=fe.nextSibling,pe=0;pe<de.length;pe++)ve?ae.insertBefore(de[pe],ve):ae.appendChild(de[pe])}while(fe=fe.nextSibling)}}}}(),P.b("virtualElements",P.h),P.b("virtualElements.allowedBindings",P.h.ea),P.b("virtualElements.emptyNode",P.h.Ea),P.b("virtualElements.insertAfter",P.h.Wb),P.b("virtualElements.prepend",P.h.Vc),P.b("virtualElements.setDomNodeChildren",P.h.va),function(){P.ga=function(){this.nd={}},P.a.extend(P.ga.prototype,{nodeHasBindings:function(Y){switch(Y.nodeType){case 1:return Y.getAttribute("data-bind")!=null||P.j.getComponentNameForNode(Y);case 8:return P.h.Cd(Y);default:return!1}},getBindings:function(Y,Q){var ee=this.getBindingsString(Y,Q),ee=ee?this.parseBindingsString(ee,Q,Y):null;return P.j.tc(ee,Y,Q,!1)},getBindingAccessors:function(Y,Q){var ee=this.getBindingsString(Y,Q),ee=ee?this.parseBindingsString(ee,Q,Y,{valueAccessors:!0}):null;return P.j.tc(ee,Y,Q,!0)},getBindingsString:function(Y){switch(Y.nodeType){case 1:return Y.getAttribute("data-bind");case 8:return P.h.Vd(Y);default:return null}},parseBindingsString:function(Y,Q,ee,z){try{var ie=this.nd,re=Y+(z&&z.valueAccessors||""),ne;if(!(ne=ie[re])){var oe,se="with($context){with($data||{}){return{"+P.m.vb(Y,z)+"}}}";oe=new Function("$context","$element",se),ne=ie[re]=oe}return ne(Q,ee)}catch(ae){throw ae.message=`Unable to parse bindings. Bindings value: `+Y+` Message: `+ae.message,ae}}}),P.ga.instance=new P.ga}(),P.b("bindingProvider",P.ga),function(){function Y(De){var Oe=(De=P.a.g.get(De,Se))&&De.N;Oe&&(De.N=null,Oe.Tc())}function Q(De,Oe,Ue){this.node=De,this.yc=Oe,this.kb=[],this.H=!1,Oe.N||P.a.K.za(De,Y),Ue&&Ue.N&&(Ue.N.kb.push(De),this.Kb=Ue)}function ee(De){return function(){return De}}function z(De){return De()}function ie(De){return P.a.Ga(P.u.G(De),function(Oe,Ue){return function(){return De()[Ue]}})}function re(De,Oe,Ue){return typeof De=="function"?ie(De.bind(null,Oe,Ue)):P.a.Ga(De,ee)}function ne(De,Oe){return ie(this.getBindings.bind(this,De,Oe))}function oe(De,Oe){var Ue=P.h.firstChild(Oe);if(Ue){var Xe,it=P.ga.instance,ut=it.preprocessNode;if(ut){for(;Xe=Ue;)Ue=P.h.nextSibling(Xe),ut.call(it,Xe);Ue=P.h.firstChild(Oe)}for(;Xe=Ue;)Ue=P.h.nextSibling(Xe),se(De,Xe)}P.i.ma(Oe,P.i.H)}function se(De,Oe){var Ue=De,Xe=Oe.nodeType===1;Xe&&P.h.Sc(Oe),(Xe||P.ga.instance.nodeHasBindings(Oe))&&(Ue=fe(Oe,null,De).bindingContextForDescendants),Ue&&!he[P.a.R(Oe)]&&oe(Ue,Oe)}function ae(De){var Oe=[],Ue={},Xe=[];return P.a.P(De,function it(ut){if(!Ue[ut]){var at=P.getBindingHandler(ut);at&&(at.after&&(Xe.push(ut),P.a.D(at.after,function(Pt){if(De[Pt]){if(P.a.A(Xe,Pt)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Xe.join(", "));it(Pt)}}),Xe.length--),Oe.push({key:ut,Mc:at})),Ue[ut]=!0}}),Oe}function fe(De,Oe,Ue){var Xe=P.a.g.Ub(De,Se,{}),it=Xe.hd;if(!Oe){if(it)throw Error("You cannot apply bindings multiple times to the same element.");Xe.hd=!0}it||(Xe.context=Ue),Xe.Zb||(Xe.Zb={});var ut;if(Oe&&typeof Oe!="function")ut=Oe;else{var at=P.ga.instance,Pt=at.getBindingAccessors||ne,Qe=P.$(function(){return(ut=Oe?Oe(Ue,De):Pt.call(at,De,Ue))&&(Ue[ve]&&Ue[ve](),Ue[ce]&&Ue[ce]()),ut},null,{l:De});ut&&Qe.ja()||(Qe=null)}var ft=Ue,Ot;if(ut){var Xt=function(){return P.a.Ga(Qe?Qe():ut,z)},At=Qe?function(bt){return function(){return z(Qe()[bt])}}:function(bt){return ut[bt]};Xt.get=function(bt){return ut[bt]&&z(At(bt))},Xt.has=function(bt){return bt in ut},P.i.H in ut&&P.i.subscribe(De,P.i.H,function(){var bt=(0,ut[P.i.H])();if(bt){var gt=P.h.childNodes(De);gt.length&&bt(gt,P.Ec(gt[0]))}}),P.i.pa in ut&&(ft=P.i.Cb(De,Ue),P.i.subscribe(De,P.i.pa,function(){var bt=(0,ut[P.i.pa])();bt&&P.h.firstChild(De)&&bt(De)})),Xe=ae(ut),P.a.D(Xe,function(bt){var gt=bt.Mc.init,It=bt.Mc.update,Jt=bt.key;if(De.nodeType===8&&!P.h.ea[Jt])throw Error("The binding '"+Jt+"' cannot be used with virtual elements");try{typeof gt=="function"&&P.u.G(function(){var bi=gt(De,At(Jt),Xt,ft.$data,ft);if(bi&&bi.controlsDescendantBindings){if(Ot!==o)throw Error("Multiple bindings ("+Ot+" and "+Jt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Ot=Jt}}),typeof It=="function"&&P.$(function(){It(De,At(Jt),Xt,ft.$data,ft)},null,{l:De})}catch(bi){throw bi.message='Unable to process binding "'+Jt+": "+ut[Jt]+`" Message: `+bi.message,bi}})}return Xe=Ot===o,{shouldBindDescendants:Xe,bindingContextForDescendants:Xe&&ft}}function de(De,Oe){return De&&De instanceof P.fa?De:new P.fa(De,o,o,Oe)}var ve=P.a.Da("_subscribable"),pe=P.a.Da("_ancestorBindingInfo"),ce=P.a.Da("_dataDependency");P.c={};var he={script:!0,textarea:!0,template:!0};P.getBindingHandler=function(De){return P.c[De]};var Ce={};P.fa=function(De,Oe,Ue,Xe,it){function ut(){var At=ft?Qe():Qe,bt=P.a.f(At);return Oe?(P.a.extend(at,Oe),pe in Oe&&(at[pe]=Oe[pe])):(at.$parents=[],at.$root=bt,at.ko=P),at[ve]=Ot,Pt?bt=at.$data:(at.$rawData=At,at.$data=bt),Ue&&(at[Ue]=bt),Xe&&Xe(at,Oe,bt),Oe&&Oe[ve]&&!P.S.o().Vb(Oe[ve])&&Oe[ve](),Xt&&(at[ce]=Xt),at.$data}var at=this,Pt=De===Ce,Qe=Pt?o:De,ft=typeof Qe=="function"&&!P.O(Qe),Ot,Xt=it&&it.dataDependency;it&&it.exportDependencies?ut():(Ot=P.xb(ut),Ot.v(),Ot.ja()?Ot.equalityComparer=null:at[ve]=o)},P.fa.prototype.createChildContext=function(De,Oe,Ue,Xe){if(!Xe&&Oe&&typeof Oe=="object"&&(Xe=Oe,Oe=Xe.as,Ue=Xe.extend),Oe&&Xe&&Xe.noChildContext){var it=typeof De=="function"&&!P.O(De);return new P.fa(Ce,this,null,function(ut){Ue&&Ue(ut),ut[Oe]=it?De():De},Xe)}return new P.fa(De,this,Oe,function(ut,at){ut.$parentContext=at,ut.$parent=at.$data,ut.$parents=(at.$parents||[]).slice(0),ut.$parents.unshift(ut.$parent),Ue&&Ue(ut)},Xe)},P.fa.prototype.extend=function(De,Oe){return new P.fa(Ce,this,null,function(Ue){P.a.extend(Ue,typeof De=="function"?De(Ue):De)},Oe)};var Se=P.a.g.Z();Q.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},Q.prototype.sd=function(De){P.a.Pa(this.kb,De),!this.kb.length&&this.H&&this.Cc()},Q.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,P.a.K.yb(this.node,Y),P.i.ma(this.node,P.i.pa),this.Tc())},P.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(De,Oe,Ue,Xe,it){var ut=P.a.g.Ub(De,Se,{});return ut.Fa||(ut.Fa=new P.T),it&&it.notifyImmediately&&ut.Zb[Oe]&&P.u.G(Ue,Xe,[De]),ut.Fa.subscribe(Ue,Xe,Oe)},ma:function(De,Oe){var Ue=P.a.g.get(De,Se);if(Ue&&(Ue.Zb[Oe]=!0,Ue.Fa&&Ue.Fa.notifySubscribers(De,Oe),Oe==P.i.H)){if(Ue.N)Ue.N.Cc();else if(Ue.N===o&&Ue.Fa&&Ue.Fa.Wa(P.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(De,Oe){var Ue=P.a.g.Ub(De,Se,{});return Ue.N||(Ue.N=new Q(De,Ue,Oe[pe])),Oe[pe]==Ue?Oe:Oe.extend(function(Xe){Xe[pe]=Ue})}},P.Td=function(De){return(De=P.a.g.get(De,Se))&&De.context},P.ib=function(De,Oe,Ue){return De.nodeType===1&&P.h.Sc(De),fe(De,Oe,de(Ue))},P.ld=function(De,Oe,Ue){return Ue=de(Ue),P.ib(De,re(Oe,Ue,De),Ue)},P.Oa=function(De,Oe){Oe.nodeType!==1&&Oe.nodeType!==8||oe(de(De),Oe)},P.vc=function(De,Oe,Ue){if(!y&&f.jQuery&&(y=f.jQuery),2>arguments.length){if(Oe=m.body,!Oe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!Oe||Oe.nodeType!==1&&Oe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");se(de(De,Ue),Oe)},P.Dc=function(De){return!De||De.nodeType!==1&&De.nodeType!==8?o:P.Td(De)},P.Ec=function(De){return(De=P.Dc(De))?De.$data:o},P.b("bindingHandlers",P.c),P.b("bindingEvent",P.i),P.b("bindingEvent.subscribe",P.i.subscribe),P.b("bindingEvent.startPossiblyAsyncContentBinding",P.i.Cb),P.b("applyBindings",P.vc),P.b("applyBindingsToDescendants",P.Oa),P.b("applyBindingAccessorsToNode",P.ib),P.b("applyBindingsToNode",P.ld),P.b("contextFor",P.Dc),P.b("dataFor",P.Ec)}(),function(Y){function Q(ne,oe){var se=Object.prototype.hasOwnProperty.call(ie,ne)?ie[ne]:Y,ae;se?se.subscribe(oe):(se=ie[ne]=new P.T,se.subscribe(oe),ee(ne,function(fe,de){var ve=!(!de||!de.synchronous);re[ne]={definition:fe,Gd:ve},delete ie[ne],ae||ve?se.notifySubscribers(fe):P.na.zb(function(){se.notifySubscribers(fe)})}),ae=!0)}function ee(ne,oe){z("getConfig",[ne],function(se){se?z("loadComponent",[ne,se],function(ae){oe(ae,se)}):oe(null,null)})}function z(ne,oe,se,ae){ae||(ae=P.j.loaders.slice(0));var fe=ae.shift();if(fe){var de=fe[ne];if(de){var ve=!1;if(de.apply(fe,oe.concat(function(pe){ve?se(null):pe!==null?se(pe):z(ne,oe,se,ae)}))!==Y&&(ve=!0,!fe.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else z(ne,oe,se,ae)}else se(null)}var ie={},re={};P.j={get:function(ne,oe){var se=Object.prototype.hasOwnProperty.call(re,ne)?re[ne]:Y;se?se.Gd?P.u.G(function(){oe(se.definition)}):P.na.zb(function(){oe(se.definition)}):Q(ne,oe)},Bc:function(ne){delete re[ne]},oc:z},P.j.loaders=[],P.b("components",P.j),P.b("components.get",P.j.get),P.b("components.clearCachedDefinition",P.j.Bc)}(),function(){function Y(se,ae,fe,de){function ve(){--ce===0&&de(pe)}var pe={},ce=2,he=fe.template;fe=fe.viewModel,he?ie(ae,he,function(Ce){P.j.oc("loadTemplate",[se,Ce],function(Se){pe.template=Se,ve()})}):ve(),fe?ie(ae,fe,function(Ce){P.j.oc("loadViewModel",[se,Ce],function(Se){pe[oe]=Se,ve()})}):ve()}function Q(se,ae,fe){if(typeof ae=="function")fe(function(ve){return new ae(ve)});else if(typeof ae[oe]=="function")fe(ae[oe]);else if("instance"in ae){var de=ae.instance;fe(function(){return de})}else"viewModel"in ae?Q(se,ae.viewModel,fe):se("Unknown viewModel value: "+ae)}function ee(se){switch(P.a.R(se)){case"script":return P.a.ua(se.text);case"textarea":return P.a.ua(se.value);case"template":if(z(se.content))return P.a.Ca(se.content.childNodes)}return P.a.Ca(se.childNodes)}function z(se){return f.DocumentFragment?se instanceof DocumentFragment:se&&se.nodeType===11}function ie(se,ae,fe){typeof ae.require=="string"?w||f.require?(w||f.require)([ae.require],function(de){de&&typeof de=="object"&&de.Xd&&de.default&&(de=de.default),fe(de)}):se("Uses require, but no AMD loader is present"):fe(ae)}function re(se){return function(ae){throw Error("Component '"+se+"': "+ae)}}var ne={};P.j.register=function(se,ae){if(!ae)throw Error("Invalid configuration for "+se);if(P.j.tb(se))throw Error("Component "+se+" is already registered");ne[se]=ae},P.j.tb=function(se){return Object.prototype.hasOwnProperty.call(ne,se)},P.j.unregister=function(se){delete ne[se],P.j.Bc(se)},P.j.Fc={getConfig:function(se,ae){ae(P.j.tb(se)?ne[se]:null)},loadComponent:function(se,ae,fe){var de=re(se);ie(de,ae,function(ve){Y(se,de,ve,fe)})},loadTemplate:function(se,ae,fe){if(se=re(se),typeof ae=="string")fe(P.a.ua(ae));else if(ae instanceof Array)fe(ae);else if(z(ae))fe(P.a.la(ae.childNodes));else if(ae.element)if(ae=ae.element,f.HTMLElement?ae instanceof HTMLElement:ae&&ae.tagName&&ae.nodeType===1)fe(ee(ae));else if(typeof ae=="string"){var de=m.getElementById(ae);de?fe(ee(de)):se("Cannot find element with ID "+ae)}else se("Unknown element type: "+ae);else se("Unknown template value: "+ae)},loadViewModel:function(se,ae,fe){Q(re(se),ae,fe)}};var oe="createViewModel";P.b("components.register",P.j.register),P.b("components.isRegistered",P.j.tb),P.b("components.unregister",P.j.unregister),P.b("components.defaultLoader",P.j.Fc),P.j.loaders.push(P.j.Fc),P.j.dd=ne}(),function(){function Y(ee,z){var ie=ee.getAttribute("params");if(ie){var ie=Q.parseBindingsString(ie,z,ee,{valueAccessors:!0,bindingParams:!0}),ie=P.a.Ga(ie,function(oe){return P.o(oe,null,{l:ee})}),re=P.a.Ga(ie,function(oe){var se=oe.v();return oe.ja()?P.o({read:function(){return P.a.f(oe())},write:P.Za(se)&&function(ae){oe()(ae)},l:ee}):se});return Object.prototype.hasOwnProperty.call(re,"$raw")||(re.$raw=ie),re}return{$raw:{}}}P.j.getComponentNameForNode=function(ee){var z=P.a.R(ee);if(P.j.tb(z)&&(z.indexOf("-")!=-1||""+ee=="[object HTMLUnknownElement]"||8>=P.a.W&&ee.tagName===z))return z},P.j.tc=function(ee,z,ie,re){if(z.nodeType===1){var ne=P.j.getComponentNameForNode(z);if(ne){if(ee=ee||{},ee.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var oe={name:ne,params:Y(z,ie)};ee.component=re?function(){return oe}:oe}}return ee};var Q=new P.ga;9>P.a.W&&(P.j.register=function(ee){return function(z){return ee.apply(this,arguments)}}(P.j.register),m.createDocumentFragment=function(ee){return function(){var z=ee(),ie=P.j.dd,re;for(re in ie);return z}}(m.createDocumentFragment))}(),function(){function Y(z,ie,re){if(ie=ie.template,!ie)throw Error("Component '"+z+"' has no template");z=P.a.Ca(ie),P.h.va(re,z)}function Q(z,ie,re){var ne=z.createViewModel;return ne?ne.call(z,ie,re):ie}var ee=0;P.c.component={init:function(z,ie,re,ne,oe){function se(){var pe=ae&&ae.dispose;typeof pe=="function"&&pe.call(ae),de&&de.s(),fe=ae=de=null}var ae,fe,de,ve=P.a.la(P.h.childNodes(z));return P.h.Ea(z),P.a.K.za(z,se),P.o(function(){var pe=P.a.f(ie()),ce,he;if(typeof pe=="string"?ce=pe:(ce=P.a.f(pe.name),he=P.a.f(pe.params)),!ce)throw Error("No component name specified");var Ce=P.i.Cb(z,oe),Se=fe=++ee;P.j.get(ce,function(De){if(fe===Se){if(se(),!De)throw Error("Unknown component '"+ce+"'");Y(ce,De,z);var Oe=Q(De,he,{element:z,templateNodes:ve});De=Ce.createChildContext(Oe,{extend:function(Ue){Ue.$component=Oe,Ue.$componentTemplateNodes=ve}}),Oe&&Oe.koDescendantsComplete&&(de=P.i.subscribe(z,P.i.pa,Oe.koDescendantsComplete,Oe)),ae=Oe,P.Oa(De,z)}})},null,{l:z}),{controlsDescendantBindings:!0}}},P.h.ea.component=!0}();var J={class:"className",for:"htmlFor"};P.c.attr={update:function(Y,Q){var ee=P.a.f(Q())||{};P.a.P(ee,function(z,ie){ie=P.a.f(ie);var re=z.indexOf(":"),re="lookupNamespaceURI"in Y&&0<re&&Y.lookupNamespaceURI(z.substr(0,re)),ne=ie===!1||ie===null||ie===o;ne?re?Y.removeAttributeNS(re,z):Y.removeAttribute(z):ie=ie.toString(),8>=P.a.W&&z in J?(z=J[z],ne?Y.removeAttribute(z):Y[z]=ie):ne||(re?Y.setAttributeNS(re,z,ie):Y.setAttribute(z,ie)),z==="name"&&P.a.Yc(Y,ne?"":ie)})}},function(){P.c.checked={after:["value","attr"],init:function(Y,Q,ee){function z(){var pe=Y.checked,ce=re();if(!P.S.Ya()&&(pe||!oe&&!P.S.qa())){var he=P.u.G(Q);if(ae){var Ce=fe?he.v():he,Se=ve;ve=ce,Se!==ce?pe&&(P.a.Na(Ce,ce,!0),P.a.Na(Ce,Se,!1)):P.a.Na(Ce,ce,pe),fe&&P.Za(he)&&he(Ce)}else ne&&(ce===o?ce=pe:pe||(ce=o)),P.m.eb(he,ee,"checked",ce,!0)}}function ie(){var pe=P.a.f(Q()),ce=re();ae?(Y.checked=0<=P.a.A(pe,ce),ve=ce):Y.checked=ne&&ce===o?!!pe:re()===pe}var re=P.xb(function(){if(ee.has("checkedValue"))return P.a.f(ee.get("checkedValue"));if(de)return ee.has("value")?P.a.f(ee.get("value")):Y.value}),ne=Y.type=="checkbox",oe=Y.type=="radio";if(ne||oe){var se=Q(),ae=ne&&P.a.f(se)instanceof Array,fe=!(ae&&se.push&&se.splice),de=oe||ae,ve=ae?re():o;oe&&!Y.name&&P.c.uniqueName.init(Y,function(){return!0}),P.o(z,null,{l:Y}),P.a.B(Y,"click",z),P.o(ie,null,{l:Y}),se=o}}},P.m.wa.checked=!0,P.c.checkedValue={update:function(Y,Q){Y.value=P.a.f(Q())}}}(),P.c.class={update:function(Y,Q){var ee=P.a.Db(P.a.f(Q()));P.a.Eb(Y,Y.__ko__cssValue,!1),Y.__ko__cssValue=ee,P.a.Eb(Y,ee,!0)}},P.c.css={update:function(Y,Q){var ee=P.a.f(Q());ee!==null&&typeof ee=="object"?P.a.P(ee,function(z,ie){ie=P.a.f(ie),P.a.Eb(Y,z,ie)}):P.c.class.update(Y,Q)}},P.c.enable={update:function(Y,Q){var ee=P.a.f(Q());ee&&Y.disabled?Y.removeAttribute("disabled"):ee||Y.disabled||(Y.disabled=!0)}},P.c.disable={update:function(Y,Q){P.c.enable.update(Y,function(){return!P.a.f(Q())})}},P.c.event={init:function(Y,Q,ee,z,ie){var re=Q()||{};P.a.P(re,function(ne){typeof ne=="string"&&P.a.B(Y,ne,function(oe){var se,ae=Q()[ne];if(ae){try{var fe=P.a.la(arguments);z=ie.$data,fe.unshift(z),se=ae.apply(z,fe)}finally{se!==!0&&(oe.preventDefault?oe.preventDefault():oe.returnValue=!1)}ee.get(ne+"Bubble")===!1&&(oe.cancelBubble=!0,oe.stopPropagation&&oe.stopPropagation())}})})}},P.c.foreach={Rc:function(Y){return function(){var Q=Y(),ee=P.a.bc(Q);return!ee||typeof ee.length=="number"?{foreach:Q,templateEngine:P.ba.Ma}:(P.a.f(Q),{foreach:ee.data,as:ee.as,noChildContext:ee.noChildContext,includeDestroyed:ee.includeDestroyed,afterAdd:ee.afterAdd,beforeRemove:ee.beforeRemove,afterRender:ee.afterRender,beforeMove:ee.beforeMove,afterMove:ee.afterMove,templateEngine:P.ba.Ma})}},init:function(Y,Q){return P.c.template.init(Y,P.c.foreach.Rc(Q))},update:function(Y,Q,ee,z,ie){return P.c.template.update(Y,P.c.foreach.Rc(Q),ee,z,ie)}},P.m.Ra.foreach=!1,P.h.ea.foreach=!0,P.c.hasfocus={init:function(Y,Q,ee){function z(ne){Y.__ko_hasfocusUpdating=!0;var oe=Y.ownerDocument;if("activeElement"in oe){var se;try{se=oe.activeElement}catch{se=oe.body}ne=se===Y}oe=Q(),P.m.eb(oe,ee,"hasfocus",ne,!0),Y.__ko_hasfocusLastValue=ne,Y.__ko_hasfocusUpdating=!1}var ie=z.bind(null,!0),re=z.bind(null,!1);P.a.B(Y,"focus",ie),P.a.B(Y,"focusin",ie),P.a.B(Y,"blur",re),P.a.B(Y,"focusout",re),Y.__ko_hasfocusLastValue=!1},update:function(Y,Q){var ee=!!P.a.f(Q());Y.__ko_hasfocusUpdating||Y.__ko_hasfocusLastValue===ee||(ee?Y.focus():Y.blur(),!ee&&Y.__ko_hasfocusLastValue&&Y.ownerDocument.body.focus(),P.u.G(P.a.Fb,null,[Y,ee?"focusin":"focusout"]))}},P.m.wa.hasfocus=!0,P.c.hasFocus=P.c.hasfocus,P.m.wa.hasFocus="hasfocus",P.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(Y,Q){P.a.fc(Y,Q())}},function(){function Y(Q,ee,z){P.c[Q]={init:function(ie,re,ne,oe,se){var ae,fe,de={},ve,pe,ce;if(ee){oe=ne.get("as");var he=ne.get("noChildContext");ce=!(oe&&he),de={as:oe,noChildContext:he,exportDependencies:ce}}return pe=(ve=ne.get("completeOn")=="render")||ne.has(P.i.pa),P.o(function(){var Ce=P.a.f(re()),Se=!z!=!Ce,De=!fe,Oe;(ce||Se!==ae)&&(pe&&(se=P.i.Cb(ie,se)),Se&&((!ee||ce)&&(de.dataDependency=P.S.o()),Oe=ee?se.createChildContext(typeof Ce=="function"?Ce:re,de):P.S.qa()?se.extend(null,de):se),De&&P.S.qa()&&(fe=P.a.Ca(P.h.childNodes(ie),!0)),Se?(De||P.h.va(ie,P.a.Ca(fe)),P.Oa(Oe,ie)):(P.h.Ea(ie),ve||P.i.ma(ie,P.i.H)),ae=Se)},null,{l:ie}),{controlsDescendantBindings:!0}}},P.m.Ra[Q]=!1,P.h.ea[Q]=!0}Y("if"),Y("ifnot",!1,!0),Y("with",!0)}(),P.c.let={init:function(Y,Q,ee,z,ie){return Q=ie.extend(Q),P.Oa(Q,Y),{controlsDescendantBindings:!0}}},P.h.ea.let=!0;var X={};P.c.options={init:function(Y){if(P.a.R(Y)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<Y.length;)Y.remove(0);return{controlsDescendantBindings:!0}},update:function(Y,Q,ee){function z(){return P.a.jb(Y.options,function(he){return he.selected})}function ie(he,Ce,Se){var De=typeof Ce;return De=="function"?Ce(he):De=="string"?he[Ce]:Se}function re(he,Ce){if(pe&&ae)P.i.ma(Y,P.i.H);else if(ve.length){var Se=0<=P.a.A(ve,P.w.M(Ce[0]));P.a.Zc(Ce[0],Se),pe&&!Se&&P.u.G(P.a.Fb,null,[Y,"change"])}}var ne=Y.multiple,oe=Y.length!=0&&ne?Y.scrollTop:null,se=P.a.f(Q()),ae=ee.get("valueAllowUnset")&&ee.has("value"),fe=ee.get("optionsIncludeDestroyed");Q={};var de,ve=[];ae||(ne?ve=P.a.Mb(z(),P.w.M):0<=Y.selectedIndex&&ve.push(P.w.M(Y.options[Y.selectedIndex]))),se&&(typeof se.length>"u"&&(se=[se]),de=P.a.jb(se,function(he){return fe||he===o||he===null||!P.a.f(he._destroy)}),ee.has("optionsCaption")&&(se=P.a.f(ee.get("optionsCaption")),se!==null&&se!==o&&de.unshift(X)));var pe=!1;if(Q.beforeRemove=function(he){Y.removeChild(he)},se=re,ee.has("optionsAfterRender")&&typeof ee.get("optionsAfterRender")=="function"&&(se=function(he,Ce){re(0,Ce),P.u.G(ee.get("optionsAfterRender"),null,[Ce[0],he!==X?he:o])}),P.a.ec(Y,de,function(he,Ce,Se){return Se.length&&(ve=!ae&&Se[0].selected?[P.w.M(Se[0])]:[],pe=!0),Ce=Y.ownerDocument.createElement("option"),he===X?(P.a.Bb(Ce,ee.get("optionsCaption")),P.w.cb(Ce,o)):(Se=ie(he,ee.get("optionsValue"),he),P.w.cb(Ce,P.a.f(Se)),he=ie(he,ee.get("optionsText"),Se),P.a.Bb(Ce,he)),[Ce]},Q,se),!ae){var ce;ne?ce=ve.length&&z().length<ve.length:ce=ve.length&&0<=Y.selectedIndex?P.w.M(Y.options[Y.selectedIndex])!==ve[0]:ve.length||0<=Y.selectedIndex,ce&&P.u.G(P.a.Fb,null,[Y,"change"])}(ae||P.S.Ya())&&P.i.ma(Y,P.i.H),P.a.wd(Y),oe&&20<Math.abs(oe-Y.scrollTop)&&(Y.scrollTop=oe)}},P.c.options.$b=P.a.g.Z(),P.c.selectedOptions={init:function(Y,Q,ee){function z(){var ne=Q(),oe=[];P.a.D(Y.getElementsByTagName("option"),function(se){se.selected&&oe.push(P.w.M(se))}),P.m.eb(ne,ee,"selectedOptions",oe)}function ie(){var ne=P.a.f(Q()),oe=Y.scrollTop;ne&&typeof ne.length=="number"&&P.a.D(Y.getElementsByTagName("option"),function(se){var ae=0<=P.a.A(ne,P.w.M(se));se.selected!=ae&&P.a.Zc(se,ae)}),Y.scrollTop=oe}if(P.a.R(Y)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var re;P.i.subscribe(Y,P.i.H,function(){re?z():(P.a.B(Y,"change",z),re=P.o(ie,null,{l:Y}))},null,{notifyImmediately:!0})},update:function(){}},P.m.wa.selectedOptions=!0,P.c.style={update:function(Y,Q){var ee=P.a.f(Q()||{});P.a.P(ee,function(z,ie){if(ie=P.a.f(ie),(ie===null||ie===o||ie===!1)&&(ie=""),y)y(Y).css(z,ie);else if(/^--/.test(z))Y.style.setProperty(z,ie);else{z=z.replace(/-(\w)/g,function(ne,oe){return oe.toUpperCase()});var re=Y.style[z];Y.style[z]=ie,ie===re||Y.style[z]!=re||isNaN(ie)||(Y.style[z]=ie+"px")}})}},P.c.submit={init:function(Y,Q,ee,z,ie){if(typeof Q()!="function")throw Error("The value for a submit binding must be a function");P.a.B(Y,"submit",function(re){var ne,oe=Q();try{ne=oe.call(ie.$data,Y)}finally{ne!==!0&&(re.preventDefault?re.preventDefault():re.returnValue=!1)}})}},P.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(Y,Q){P.a.Bb(Y,Q())}},P.h.ea.text=!0,function(){if(f&&f.navigator){var Y=function(de){if(de)return parseFloat(de[1])},Q=f.navigator.userAgent,ee,z,ie,re,ne;(ee=f.opera&&f.opera.version&&parseInt(f.opera.version()))||(ne=Y(Q.match(/Edge\/([^ ]+)$/)))||Y(Q.match(/Chrome\/([^ ]+)/))||(z=Y(Q.match(/Version\/([^ ]+) Safari/)))||(ie=Y(Q.match(/Firefox\/([^ ]+)/)))||(re=P.a.W||Y(Q.match(/MSIE ([^ ]+)/)))||(re=Y(Q.match(/rv:([^ )]+)/)))}if(8<=re&&10>re)var oe=P.a.g.Z(),se=P.a.g.Z(),ae=function(de){var ve=this.activeElement;(ve=ve&&P.a.g.get(ve,se))&&ve(de)},fe=function(de,ve){var pe=de.ownerDocument;P.a.g.get(pe,oe)||(P.a.g.set(pe,oe,!0),P.a.B(pe,"selectionchange",ae)),P.a.g.set(de,se,ve)};P.c.textInput={init:function(de,ve,pe){function ce(ut,at){P.a.B(de,ut,at)}function he(){var ut=P.a.f(ve());(ut===null||ut===o)&&(ut=""),Ue!==o&&ut===Ue?P.a.setTimeout(he,4):de.value!==ut&&(it=!0,de.value=ut,it=!1,De=de.value)}function Ce(){Oe||(Ue=de.value,Oe=P.a.setTimeout(Se,4))}function Se(){clearTimeout(Oe),Ue=Oe=o;var ut=de.value;De!==ut&&(De=ut,P.m.eb(ve(),pe,"textInput",ut))}var De=de.value,Oe,Ue,Xe=P.a.W==9?Ce:Se,it=!1;re&&ce("keypress",Se),11>re&&ce("propertychange",function(ut){it||ut.propertyName!=="value"||Xe(ut)}),re==8&&(ce("keyup",Se),ce("keydown",Se)),fe&&(fe(de,Xe),ce("dragend",Ce)),(!re||9<=re)&&ce("input",Xe),5>z&&P.a.R(de)==="textarea"?(ce("keydown",Ce),ce("paste",Ce),ce("cut",Ce)):11>ee?ce("keydown",Ce):4>ie?(ce("DOMAutoComplete",Se),ce("dragdrop",Se),ce("drop",Se)):ne&&de.type==="number"&&ce("keydown",Ce),ce("change",Se),ce("blur",Se),P.o(he,null,{l:de})}},P.m.wa.textInput=!0,P.c.textinput={preprocess:function(de,ve,pe){pe("textInput",de)}}}(),P.c.uniqueName={init:function(Y,Q){if(Q()){var ee="ko_unique_"+ ++P.c.uniqueName.rd;P.a.Yc(Y,ee)}}},P.c.uniqueName.rd=0,P.c.using={init:function(Y,Q,ee,z,ie){var re;return ee.has("as")&&(re={as:ee.get("as"),noChildContext:ee.get("noChildContext")}),Q=ie.createChildContext(Q,re),P.Oa(Q,Y),{controlsDescendantBindings:!0}}},P.h.ea.using=!0,P.c.value={init:function(Y,Q,ee){var z=P.a.R(Y),ie=z=="input";if(!ie||Y.type!="checkbox"&&Y.type!="radio"){var re=[],ne=ee.get("valueUpdate"),oe=!1,se=null;ne&&(typeof ne=="string"?re=[ne]:re=P.a.wc(ne),P.a.Pa(re,"change"));var ae=function(){se=null,oe=!1;var ve=Q(),pe=P.w.M(Y);P.m.eb(ve,ee,"value",pe)};!P.a.W||!ie||Y.type!="text"||Y.autocomplete=="off"||Y.form&&Y.form.autocomplete=="off"||P.a.A(re,"propertychange")!=-1||(P.a.B(Y,"propertychange",function(){oe=!0}),P.a.B(Y,"focus",function(){oe=!1}),P.a.B(Y,"blur",function(){oe&&ae()})),P.a.D(re,function(ve){var pe=ae;P.a.Ud(ve,"after")&&(pe=function(){se=P.w.M(Y),P.a.setTimeout(ae,0)},ve=ve.substring(5)),P.a.B(Y,ve,pe)});var fe;if(fe=ie&&Y.type=="file"?function(){var ve=P.a.f(Q());ve===null||ve===o||ve===""?Y.value="":P.u.G(ae)}:function(){var ve=P.a.f(Q()),pe=P.w.M(Y);se!==null&&ve===se?P.a.setTimeout(fe,0):(ve!==pe||pe===o)&&(z==="select"?(pe=ee.get("valueAllowUnset"),P.w.cb(Y,ve,pe),pe||ve===P.w.M(Y)||P.u.G(ae)):P.w.cb(Y,ve))},z==="select"){var de;P.i.subscribe(Y,P.i.H,function(){de?ee.get("valueAllowUnset")?fe():ae():(P.a.B(Y,"change",ae),de=P.o(fe,null,{l:Y}))},null,{notifyImmediately:!0})}else P.a.B(Y,"change",ae),P.o(fe,null,{l:Y})}else P.ib(Y,{checkedValue:Q})},update:function(){}},P.m.wa.value=!0,P.c.visible={update:function(Y,Q){var ee=P.a.f(Q()),z=Y.style.display!="none";ee&&!z?Y.style.display="":!ee&&z&&(Y.style.display="none")}},P.c.hidden={update:function(Y,Q){P.c.visible.update(Y,function(){return!P.a.f(Q())})}},function(Y){P.c[Y]={init:function(Q,ee,z,ie,re){return P.c.event.init.call(this,Q,function(){var ne={};return ne[Y]=ee(),ne},z,ie,re)}}}("click"),P.ca=function(){},P.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},P.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},P.ca.prototype.makeTemplateSource=function(Y,Q){if(typeof Y=="string"){Q=Q||m;var ee=Q.getElementById(Y);if(!ee)throw Error("Cannot find template with ID "+Y);return new P.C.F(ee)}if(Y.nodeType==1||Y.nodeType==8)return new P.C.ia(Y);throw Error("Unknown template type: "+Y)},P.ca.prototype.renderTemplate=function(Y,Q,ee,z){return Y=this.makeTemplateSource(Y,z),this.renderTemplateSource(Y,Q,ee,z)},P.ca.prototype.isTemplateRewritten=function(Y,Q){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(Y,Q).data("isRewritten")},P.ca.prototype.rewriteTemplate=function(Y,Q,ee){Y=this.makeTemplateSource(Y,ee),Q=Q(Y.text()),Y.text(Q),Y.data("isRewritten",!0)},P.b("templateEngine",P.ca),P.kc=function(){function Y(z,ie,re,ne){z=P.m.ac(z);for(var oe=P.m.Ra,se=0;se<z.length;se++){var ae=z[se].key;if(Object.prototype.hasOwnProperty.call(oe,ae)){var fe=oe[ae];if(typeof fe=="function"){if(ae=fe(z[se].value))throw Error(ae)}else if(!fe)throw Error("This template engine does not support the '"+ae+"' binding within its templates")}}return re="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+P.m.vb(z,{valueAccessors:!0})+" } })()},'"+re.toLowerCase()+"')",ne.createJavaScriptEvaluatorBlock(re)+ie}var Q=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,ee=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(z,ie,re){ie.isTemplateRewritten(z,re)||ie.rewriteTemplate(z,function(ne){return P.kc.Ld(ne,ie)},re)},Ld:function(z,ie){return z.replace(Q,function(re,ne,oe,se,ae){return Y(ae,ne,oe,ie)}).replace(ee,function(re,ne){return Y(ne,"<!-- ko -->","#comment",ie)})},md:function(z,ie){return P.aa.Xb(function(re,ne){var oe=re.nextSibling;oe&&oe.nodeName.toLowerCase()===ie&&P.ib(oe,z,ne)})}}}(),P.b("__tr_ambtns",P.kc.md),function(){P.C={},P.C.F=function(ee){if(this.F=ee){var z=P.a.R(ee);this.ab=z==="script"?1:z==="textarea"?2:z=="template"&&ee.content&&ee.content.nodeType===11?3:4}},P.C.F.prototype.text=function(){var ee=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[ee];var z=arguments[0];ee==="innerHTML"?P.a.fc(this.F,z):this.F[ee]=z};var Y=P.a.g.Z()+"_";P.C.F.prototype.data=function(ee){if(arguments.length===1)return P.a.g.get(this.F,Y+ee);P.a.g.set(this.F,Y+ee,arguments[1])};var Q=P.a.g.Z();P.C.F.prototype.nodes=function(){var ee=this.F;if(arguments.length==0){var z=P.a.g.get(ee,Q)||{},ie=z.lb||(this.ab===3?ee.content:this.ab===4?ee:o);if(!ie||z.jd){var re=this.text();re&&re!==z.bb&&(ie=P.a.Md(re,ee.ownerDocument),P.a.g.set(ee,Q,{lb:ie,bb:re,jd:!0}))}return ie}z=arguments[0],this.ab!==o&&this.text(""),P.a.g.set(ee,Q,{lb:z})},P.C.ia=function(ee){this.F=ee},P.C.ia.prototype=new P.C.F,P.C.ia.prototype.constructor=P.C.ia,P.C.ia.prototype.text=function(){if(arguments.length==0){var ee=P.a.g.get(this.F,Q)||{};return ee.bb===o&&ee.lb&&(ee.bb=ee.lb.innerHTML),ee.bb}P.a.g.set(this.F,Q,{bb:arguments[0]})},P.b("templateSources",P.C),P.b("templateSources.domElement",P.C.F),P.b("templateSources.anonymousTemplate",P.C.ia)}(),function(){function Y(se,ae,fe){var de;for(ae=P.h.nextSibling(ae);se&&(de=se)!==ae;)se=P.h.nextSibling(de),fe(de,se)}function Q(se,ae){if(se.length){var fe=se[0],de=se[se.length-1],ve=fe.parentNode,pe=P.ga.instance,ce=pe.preprocessNode;if(ce){if(Y(fe,de,function(he,Ce){var Se=he.previousSibling,De=ce.call(pe,he);De&&(he===fe&&(fe=De[0]||Ce),he===de&&(de=De[De.length-1]||Se))}),se.length=0,!fe)return;fe===de?se.push(fe):(se.push(fe,de),P.a.Ua(se,ve))}Y(fe,de,function(he){he.nodeType!==1&&he.nodeType!==8||P.vc(ae,he)}),Y(fe,de,function(he){he.nodeType!==1&&he.nodeType!==8||P.aa.cd(he,[ae])}),P.a.Ua(se,ve)}}function ee(se){return se.nodeType?se:0<se.length?se[0]:null}function z(se,ae,fe,de,ve){ve=ve||{};var pe=(se&&ee(se)||fe||{}).ownerDocument,ce=ve.templateEngine||re;if(P.kc.xd(fe,ce,pe),fe=ce.renderTemplate(fe,de,ve,pe),typeof fe.length!="number"||0<fe.length&&typeof fe[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(pe=!1,ae){case"replaceChildren":P.h.va(se,fe),pe=!0;break;case"replaceNode":P.a.Xc(se,fe),pe=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+ae)}return pe&&(Q(fe,de),ve.afterRender&&P.u.G(ve.afterRender,null,[fe,de[ve.as||"$data"]]),ae=="replaceChildren"&&P.i.ma(se,P.i.H)),fe}function ie(se,ae,fe){return P.O(se)?se():typeof se=="function"?se(ae,fe):se}var re;P.gc=function(se){if(se!=o&&!(se instanceof P.ca))throw Error("templateEngine must inherit from ko.templateEngine");re=se},P.dc=function(se,ae,fe,de,ve){if(fe=fe||{},(fe.templateEngine||re)==o)throw Error("Set a template engine before calling renderTemplate");if(ve=ve||"replaceChildren",de){var pe=ee(de);return P.$(function(){var he=ae&&ae instanceof P.fa?ae:new P.fa(ae,null,null,null,{exportDependencies:!0}),ce=ie(se,he.$data,he),he=z(de,ve,ce,he,fe);ve=="replaceNode"&&(de=he,pe=ee(de))},null,{Sa:function(){return!pe||!P.a.Sb(pe)},l:pe&&ve=="replaceNode"?pe.parentNode:pe})}return P.aa.Xb(function(ce){P.dc(se,ae,fe,ce,"replaceNode")})},P.Qd=function(se,ae,fe,de,ve){function pe(Ue,Xe){P.u.G(P.a.ec,null,[de,Ue,he,fe,ce,Xe]),P.i.ma(de,P.i.H)}function ce(Ue,Xe){Q(Xe,Ce),fe.afterRender&&fe.afterRender(Xe,Ue),Ce=null}function he(Ue,Xe){Ce=ve.createChildContext(Ue,{as:Se,noChildContext:fe.noChildContext,extend:function(ut){ut.$index=Xe,Se&&(ut[Se+"Index"]=Xe)}});var it=ie(se,Ue,Ce);return z(de,"ignoreTargetNode",it,Ce,fe)}var Ce,Se=fe.as,De=fe.includeDestroyed===!1||P.options.foreachHidesDestroyed&&!fe.includeDestroyed;if(De||fe.beforeRemove||!P.Pc(ae))return P.$(function(){var Ue=P.a.f(ae)||[];typeof Ue.length>"u"&&(Ue=[Ue]),De&&(Ue=P.a.jb(Ue,function(Xe){return Xe===o||Xe===null||!P.a.f(Xe._destroy)})),pe(Ue)},null,{l:de});pe(ae.v());var Oe=ae.subscribe(function(Ue){pe(ae(),Ue)},null,"arrayChange");return Oe.l(de),Oe};var ne=P.a.g.Z(),oe=P.a.g.Z();P.c.template={init:function(se,ae){var fe=P.a.f(ae());if(typeof fe=="string"||"name"in fe)P.h.Ea(se);else if("nodes"in fe){if(fe=fe.nodes||[],P.O(fe))throw Error('The "nodes" option must be a plain, non-observable array.');var de=fe[0]&&fe[0].parentNode;de&&P.a.g.get(de,oe)||(de=P.a.Yb(fe),P.a.g.set(de,oe,!0)),new P.C.ia(se).nodes(de)}else if(fe=P.h.childNodes(se),0<fe.length)de=P.a.Yb(fe),new P.C.ia(se).nodes(de);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(se,ae,fe,de,ve){var pe=ae();ae=P.a.f(pe),fe=!0,de=null,typeof ae=="string"?ae={}:(pe="name"in ae?ae.name:se,"if"in ae&&(fe=P.a.f(ae.if)),fe&&"ifnot"in ae&&(fe=!P.a.f(ae.ifnot)),fe&&!pe&&(fe=!1)),"foreach"in ae?de=P.Qd(pe,fe&&ae.foreach||[],ae,se,ve):fe?(fe=ve,"data"in ae&&(fe=ve.createChildContext(ae.data,{as:ae.as,noChildContext:ae.noChildContext,exportDependencies:!0})),de=P.dc(pe,fe,ae,se)):P.h.Ea(se),ve=de,(ae=P.a.g.get(se,ne))&&typeof ae.s=="function"&&ae.s(),P.a.g.set(se,ne,!ve||ve.ja&&!ve.ja()?o:ve)}},P.m.Ra.template=function(se){return se=P.m.ac(se),se.length==1&&se[0].unknown||P.m.Id(se,"name")?null:"This template engine does not support anonymous templates nested within its templates"},P.h.ea.template=!0}(),P.b("setTemplateEngine",P.gc),P.b("renderTemplate",P.dc),P.a.Kc=function(Y,Q,ee){if(Y.length&&Q.length){var z,ie,re,ne,oe;for(z=ie=0;(!ee||z<ee)&&(ne=Y[ie]);++ie){for(re=0;oe=Q[re];++re)if(ne.value===oe.value){ne.moved=oe.index,oe.moved=ne.index,Q.splice(re,1),z=re=0;break}z+=re}}},P.a.Pb=function(){function Y(Q,ee,z,ie,re){var ne=Math.min,oe=Math.max,se=[],ae,fe=Q.length,de,ve=ee.length,pe=ve-fe||1,ce=fe+ve+1,he,Ce,Se;for(ae=0;ae<=fe;ae++)for(Ce=he,se.push(he=[]),Se=ne(ve,ae+pe),de=oe(0,ae-1);de<=Se;de++)he[de]=de?ae?Q[ae-1]===ee[de-1]?Ce[de-1]:ne(Ce[de]||ce,he[de-1]||ce)+1:de+1:ae+1;for(ne=[],oe=[],pe=[],ae=fe,de=ve;ae||de;)ve=se[ae][de]-1,de&&ve===se[ae][de-1]?oe.push(ne[ne.length]={status:z,value:ee[--de],index:de}):ae&&ve===se[ae-1][de]?pe.push(ne[ne.length]={status:ie,value:Q[--ae],index:ae}):(--de,--ae,re.sparse||ne.push({status:"retained",value:ee[de]}));return P.a.Kc(pe,oe,!re.dontLimitMoves&&10*fe),ne.reverse()}return function(Q,ee,z){return z=typeof z=="boolean"?{dontLimitMoves:z}:z||{},Q=Q||[],ee=ee||[],Q.length<ee.length?Y(Q,ee,"added","deleted",z):Y(ee,Q,"deleted","added",z)}}(),P.b("utils.compareArrays",P.a.Pb),function(){function Y(z,ie,re,ne,oe){var se=[],ae=P.$(function(){var fe=ie(re,oe,P.a.Ua(se,z))||[];0<se.length&&(P.a.Xc(se,fe),ne&&P.u.G(ne,null,[re,fe,oe])),se.length=0,P.a.Nb(se,fe)},null,{l:z,Sa:function(){return!P.a.kd(se)}});return{Y:se,$:ae.ja()?ae:o}}var Q=P.a.g.Z(),ee=P.a.g.Z();P.a.ec=function(z,ie,re,ne,oe,se){function ae(bt){it={Aa:bt,pb:P.ta(Ce++)},ce.push(it),pe||Xe.push(it)}function fe(bt){it=ve[bt],Ce!==it.pb.v()&&Ue.push(it),it.pb(Ce++),P.a.Ua(it.Y,z),ce.push(it)}function de(bt,gt){if(bt)for(var It=0,Jt=gt.length;It<Jt;It++)P.a.D(gt[It].Y,function(bi){bt(bi,It,gt[It].Aa)})}ie=ie||[],typeof ie.length>"u"&&(ie=[ie]),ne=ne||{};var ve=P.a.g.get(z,Q),pe=!ve,ce=[],he=0,Ce=0,Se=[],De=[],Oe=[],Ue=[],Xe=[],it,ut=0;if(pe)P.a.D(ie,ae);else{if(!se||ve&&ve._countWaitingForRemove){var at=P.a.Mb(ve,function(bt){return bt.Aa});se=P.a.Pb(at,ie,{dontLimitMoves:ne.dontLimitMoves,sparse:!0})}for(var at=0,Pt,Qe,ft;Pt=se[at];at++)switch(Qe=Pt.moved,ft=Pt.index,Pt.status){case"deleted":for(;he<ft;)fe(he++);Qe===o&&(it=ve[he],it.$&&(it.$.s(),it.$=o),P.a.Ua(it.Y,z).length&&(ne.beforeRemove&&(ce.push(it),ut++,it.Aa===ee?it=null:Oe.push(it)),it&&Se.push.apply(Se,it.Y))),he++;break;case"added":for(;Ce<ft;)fe(he++);Qe!==o?(De.push(ce.length),fe(Qe)):ae(Pt.value)}for(;Ce<ie.length;)fe(he++);ce._countWaitingForRemove=ut}P.a.g.set(z,Q,ce),de(ne.beforeMove,Ue),P.a.D(Se,ne.beforeRemove?P.oa:P.removeNode);var Ot,Xt,At;try{At=z.ownerDocument.activeElement}catch{}if(De.length)for(;(at=De.shift())!=o;){for(it=ce[at],Ot=o;at;)if((Xt=ce[--at].Y)&&Xt.length){Ot=Xt[Xt.length-1];break}for(ie=0;he=it.Y[ie];Ot=he,ie++)P.h.Wb(z,he,Ot)}for(at=0;it=ce[at];at++){for(it.Y||P.a.extend(it,Y(z,re,it.Aa,oe,it.pb)),ie=0;he=it.Y[ie];Ot=he,ie++)P.h.Wb(z,he,Ot);!it.Ed&&oe&&(oe(it.Aa,it.Y,it.pb),it.Ed=!0,Ot=it.Y[it.Y.length-1])}for(At&&z.ownerDocument.activeElement!=At&&At.focus(),de(ne.beforeRemove,Oe),at=0;at<Oe.length;++at)Oe[at].Aa=ee;de(ne.afterMove,Ue),de(ne.afterAdd,Xe)}}(),P.b("utils.setDomNodeChildrenFromArrayMapping",P.a.ec),P.ba=function(){this.allowTemplateRewriting=!1},P.ba.prototype=new P.ca,P.ba.prototype.constructor=P.ba,P.ba.prototype.renderTemplateSource=function(Y,Q,ee,z){return(Q=!(9>P.a.W)&&Y.nodes?Y.nodes():null)?P.a.la(Q.cloneNode(!0).childNodes):(Y=Y.text(),P.a.ua(Y,z))},P.ba.Ma=new P.ba,P.gc(P.ba.Ma),P.b("nativeTemplateEngine",P.ba),function(){P.$a=function(){var Q=this.Hd=function(){if(!y||!y.tmpl)return 0;try{if(0<=y.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(ee,z,ie,re){if(re=re||m,ie=ie||{},2>Q)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var ne=ee.data("precompiled");return ne||(ne=ee.text()||"",ne=y.template(null,"{{ko_with $item.koBindingContext}}"+ne+"{{/ko_with}}"),ee.data("precompiled",ne)),ee=[z.$data],z=y.extend({koBindingContext:z},ie.templateOptions),z=y.tmpl(ne,ee,z),z.appendTo(re.createElement("div")),y.fragments={},z},this.createJavaScriptEvaluatorBlock=function(ee){return"{{ko_code ((function() { return "+ee+" })()) }}"},this.addTemplate=function(ee,z){m.write("<script type='text/html' id='"+ee+"'>"+z+"<\/script>")},0<Q&&(y.tmpl.tag.ko_code={open:"__.push($1 || '');"},y.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},P.$a.prototype=new P.ca,P.$a.prototype.constructor=P.$a;var Y=new P.$a;0<Y.Hd&&P.gc(Y),P.b("jqueryTmplTemplateEngine",P.$a)}()})})()})()})();var Z2i=ko;typeof window<"u"?(ko=window.ko,typeof F7<"u"?window.ko=F7:delete window.ko):(ko=global.ko,typeof F7<"u"?global.ko=F7:delete global.ko);var CD=Z2i,$2i=function(o){let f=document.createElement("div");f.innerHTML=o;let m=document.createDocumentFragment();for(;f.firstChild;)m.appendChild(f.firstChild);return m},_Pe=$2i,ePi=CD,tPi=function(o,f,m){f=Uh(f);let v=_Pe(o),y=[],x;for(x=0;x<v.childNodes.length;++x)y.push(v.childNodes[x]);for(f.appendChild(v),x=0;x<y.length;++x){let C=y[x];(C.nodeType===1||C.nodeType===8)&&ePi.applyBindings(m,C)}return y},fae=tPi,iPi=CD,Mj=function(o){if(!N(o)||!N(o.terria))throw new li("options.terria is required.");this.terria=o.terria,this._removeSubscription=void 0,this._lastLegendUpdate=void 0,this.eventHelper=new AC,this.distanceLabel=void 0,this.barWidth=void 0,this.enableDistanceLegend=N(o.enableDistanceLegend)?o.enableDistanceLegend:!0,iPi.track(this,["distanceLabel","barWidth"]),this.eventHelper.add(this.terria.afterWidgetChanged,function(){N(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0)},this);let f=this;function m(){if(N(f.terria)){let v=f.terria.scene;f._removeSubscription=v.postRender.addEventListener(function(){rPi(this,v)},f)}}m(),this.eventHelper.add(this.terria.afterWidgetChanged,function(){m()},this)};Mj.prototype.destroy=function(){this.eventHelper.removeAll()};Mj.prototype.show=function(o){let f;this.enableDistanceLegend?f=`<div class="distance-legend" data-bind="visible: distanceLabel && barWidth"><div class="distance-legend-label" data-bind="text: distanceLabel"></div><div class="distance-legend-scale-bar" data-bind="style: { width: barWidth + 'px', left: (5 + (125 - barWidth) / 2) + 'px' }"></div></div>`:f=`<div class="distance-legend" style="display: none;" data-bind="visible: distanceLabel && barWidth"><div class="distance-legend-label" data-bind="text: distanceLabel"></div><div class="distance-legend-scale-bar" data-bind="style: { width: barWidth + 'px', left: (5 + (125 - barWidth) / 2) + 'px' }"></div></div>`,fae(f,o,this)};Mj.create=function(o){let f=new Mj(o);return f.show(o.container),f};var H6e=new Im,Ppe=[1,2,3,5,10,20,30,50,100,200,300,500,1e3,2e3,3e3,5e3,1e4,2e4,3e4,5e4,1e5,2e5,3e5,5e5,1e6,2e6,3e6,5e6,1e7,2e7,3e7,5e7];function rPi(o,f){if(!o.enableDistanceLegend){o.barWidth=void 0,o.distanceLabel=void 0;return}let m=$c();if(m<o._lastLegendUpdate+250)return;o._lastLegendUpdate=m;let v=f.canvas.clientWidth,y=f.canvas.clientHeight,x=f.camera.getPickRay(new Ye(v/2|0,y-1)),C=f.camera.getPickRay(new Ye(1+v/2|0,y-1)),w=f.globe,A=w.pick(x,f),E=w.pick(C,f);if(!N(A)||!N(E)){o.barWidth=void 0,o.distanceLabel=void 0;return}let T=w.ellipsoid.cartesianToCartographic(A),S=w.ellipsoid.cartesianToCartographic(E);H6e.setEndPoints(T,S);let M=H6e.surfaceDistance,I=100,P;for(let D=Ppe.length-1;!N(P)&&D>=0;--D)Ppe[D]/M<I&&(P=Ppe[D]);if(N(P)){let D;P>=1e3?D=(P/1e3).toString()+" km":D=P.toString()+" m",o.barWidth=P/M|0,o.distanceLabel=D}else o.barWidth=void 0,o.distanceLabel=void 0}var vPe=Mj,nPi="M 7.5,0 C 3.375,0 0,3.375 0,7.5 0,11.625 3.375,15 7.5,15 c 3.46875,0 6.375,-2.4375 7.21875,-5.625 l -1.96875,0 C 12,11.53125 9.9375,13.125 7.5,13.125 4.40625,13.125 1.875,10.59375 1.875,7.5 1.875,4.40625 4.40625,1.875 7.5,1.875 c 1.59375,0 2.90625,0.65625 3.9375,1.6875 l -3,3 6.5625,0 L 15,0 12.75,2.25 C 11.4375,0.84375 9.5625,0 7.5,0 z",yPe=nPi,oPi=CD,xPe=function(o){if(!N(o))throw new li("terria is required");this._terria=o,this.name="Unnamed Control",this.text=void 0,this.svgIcon=void 0,this.svgHeight=void 0,this.svgWidth=void 0,this.cssClass=void 0,this.isActive=!1,oPi.track(this,["name","svgIcon","svgHeight","svgWidth","cssClass","isActive"])};Object.defineProperties(xPe.prototype,{terria:{get:function(){return this._terria}},hasText:{get:function(){return N(this.text)&&typeof this.text=="string"}}});xPe.prototype.activate=function(){throw new li("activate must be implemented in the derived class.")};var pae=xPe,uot=function(o){pae.apply(this,arguments)};uot.prototype=Object.create(pae.prototype);var z6=uot,aX=function(o){z6.apply(this,arguments),this.name="\u91CD\u7F6E\u89C6\u56FE",this.navigationLocked=!1,this.svgIcon=yPe,this.svgHeight=15,this.svgWidth=15,this.cssClass="navigation-control-icon-reset"};aX.prototype=Object.create(z6.prototype);aX.prototype.setNavigationLocked=function(o){this.navigationLocked=o};aX.prototype.resetView=function(){if(this.navigationLocked)return;let o=this.terria.scene;if(!o.screenSpaceCameraController.enableInputs)return;this.isActive=!0;let f=o.camera;if(N(this.terria.trackedEntity)){let m=this.terria.trackedEntity;this.terria.trackedEntity=void 0,this.terria.trackedEntity=m}else if(this.terria.options.defaultResetView){if(this.terria.options.defaultResetView&&this.terria.options.defaultResetView instanceof Mt)f.flyTo({destination:o.globe.ellipsoid.cartographicToCartesian(this.terria.options.defaultResetView)});else if(this.terria.options.defaultResetView&&this.terria.options.defaultResetView instanceof Di)try{Di.validate(this.terria.options.defaultResetView),f.flyTo({destination:this.terria.options.defaultResetView})}catch{console.log("Cesium-navigation/ResetViewNavigationControl: options.defaultResetView Cesium rectangle is invalid!")}}else typeof f.flyHome=="function"?f.flyHome(1):f.flyTo({destination:Vl.DEFAULT_VIEW_RECTANGLE,duration:1});this.isActive=!1};aX.prototype.activate=function(){this.resetView()};var CPe=aX,cot={},aPi=new Mt,Ipe=new _s;cot.getCameraFocus=function(o,f,m){let v=o.scene,y=v.camera;if(v.mode!==_i.MORPHING&&(N(m)||(m=new H),N(o.trackedEntity)?m=o.trackedEntity.position.getValue(o.clock.currentTime,m):(Ipe.origin=y.positionWC,Ipe.direction=y.directionWC,m=v.globe.pick(Ipe,v,m)),!!N(m)))return v.mode===_i.SCENE2D||v.mode===_i.COLUMBUS_VIEW?(m=y.worldToCameraCoordinatesPoint(m,m),f&&(m=v.globe.ellipsoid.cartographicToCartesian(v.mapProjection.unproject(m,aPi),m))):f||(m=y.worldToCameraCoordinatesPoint(m,m)),m};var H6=cot,sX=function(o,f){z6.apply(this,arguments),this.name="Zoom "+(f?"In":"Out"),this.text=f?"+":"-",this.cssClass="navigation-control-icon-zoom-"+(f?"in":"out"),this.relativeAmount=2,f&&(this.relativeAmount=1/this.relativeAmount)};sX.prototype.relativeAmount=1;sX.prototype=Object.create(z6.prototype);sX.prototype.activate=function(){this.zoom(this.relativeAmount)};var sPi=new H;sX.prototype.zoom=function(o){if(this.isActive=!0,N(this.terria)){let f=this.terria.scene,m=f.screenSpaceCameraController;if(!m.enableInputs||!m.enableZoom)return;let v=f.camera,y;switch(f.mode){case _i.MORPHING:break;case _i.SCENE2D:v.zoomIn(v.positionCartographic.height*(1-this.relativeAmount));break;default:let x;if(N(this.terria.trackedEntity)?x=new H:x=H6.getCameraFocus(this.terria,!1),N(x))y={direction:v.direction,up:v.up};else{let E=new _s(v.worldToCameraCoordinatesPoint(f.globe.ellipsoid.cartographicToCartesian(v.positionCartographic)),v.directionWC);x=Hh.grazingAltitudeLocation(E,f.globe.ellipsoid),y={heading:v.heading,pitch:v.pitch,roll:v.roll}}let C=H.subtract(v.position,x,sPi),w=H.multiplyByScalar(C,o,C),A=H.add(x,w,x);if(N(this.terria.trackedEntity)||f.mode===_i.COLUMBUS_VIEW)v.position=A;else{if(o===.5&&Z(v.undergroundMode,!1)===!1&&v.positionCartographic.height<1)return;v.flyTo({destination:A,orientation:y,duration:.5,convert:!1})}}}this.isActive=!1};var oie=sX,lPi="m 66.5625,0 0,15.15625 3.71875,0 0,-10.40625 5.5,10.40625 4.375,0 0,-15.15625 -3.71875,0 0,10.40625 L 70.9375,0 66.5625,0 z M 72.5,20.21875 c -28.867432,0 -52.28125,23.407738 -52.28125,52.28125 0,28.87351 23.413818,52.3125 52.28125,52.3125 28.86743,0 52.28125,-23.43899 52.28125,-52.3125 0,-28.873512 -23.41382,-52.28125 -52.28125,-52.28125 z m 0,1.75 c 13.842515,0 26.368948,5.558092 35.5,14.5625 l -11.03125,11 0.625,0.625 11.03125,-11 c 8.9199,9.108762 14.4375,21.579143 14.4375,35.34375 0,13.764606 -5.5176,26.22729 -14.4375,35.34375 l -11.03125,-11 -0.625,0.625 11.03125,11 c -9.130866,9.01087 -21.658601,14.59375 -35.5,14.59375 -13.801622,0 -26.321058,-5.53481 -35.4375,-14.5 l 11.125,-11.09375 c 6.277989,6.12179 14.857796,9.90625 24.3125,9.90625 19.241896,0 34.875,-15.629154 34.875,-34.875 0,-19.245847 -15.633104,-34.84375 -34.875,-34.84375 -9.454704,0 -18.034511,3.760884 -24.3125,9.875 L 37.0625,36.4375 C 46.179178,27.478444 58.696991,21.96875 72.5,21.96875 z m -0.875,0.84375 0,13.9375 1.75,0 0,-13.9375 -1.75,0 z M 36.46875,37.0625 47.5625,48.15625 C 41.429794,54.436565 37.65625,63.027539 37.65625,72.5 c 0,9.472461 3.773544,18.055746 9.90625,24.34375 L 36.46875,107.9375 c -8.96721,-9.1247 -14.5,-21.624886 -14.5,-35.4375 0,-13.812615 5.53279,-26.320526 14.5,-35.4375 z M 72.5,39.40625 c 18.297686,0 33.125,14.791695 33.125,33.09375 0,18.302054 -14.827314,33.125 -33.125,33.125 -18.297687,0 -33.09375,-14.822946 -33.09375,-33.125 0,-18.302056 14.796063,-33.09375 33.09375,-33.09375 z M 22.84375,71.625 l 0,1.75 13.96875,0 0,-1.75 -13.96875,0 z m 85.5625,0 0,1.75 14,0 0,-1.75 -14,0 z M 71.75,108.25 l 0,13.9375 1.71875,0 0,-13.9375 -1.71875,0 z",bPe=lPi,uPi="m 72.71875,54.375 c -0.476702,0 -0.908208,0.245402 -1.21875,0.5625 -0.310542,0.317098 -0.551189,0.701933 -0.78125,1.1875 -0.172018,0.363062 -0.319101,0.791709 -0.46875,1.25 -6.91615,1.075544 -12.313231,6.656514 -13,13.625 -0.327516,0.117495 -0.661877,0.244642 -0.9375,0.375 -0.485434,0.22959 -0.901634,0.471239 -1.21875,0.78125 -0.317116,0.310011 -0.5625,0.742111 -0.5625,1.21875 l 0.03125,0 c 0,0.476639 0.245384,0.877489 0.5625,1.1875 0.317116,0.310011 0.702066,0.58291 1.1875,0.8125 0.35554,0.168155 0.771616,0.32165 1.21875,0.46875 1.370803,6.10004 6.420817,10.834127 12.71875,11.8125 0.146999,0.447079 0.30025,0.863113 0.46875,1.21875 0.230061,0.485567 0.470708,0.870402 0.78125,1.1875 0.310542,0.317098 0.742048,0.5625 1.21875,0.5625 0.476702,0 0.876958,-0.245402 1.1875,-0.5625 0.310542,-0.317098 0.582439,-0.701933 0.8125,-1.1875 0.172018,-0.363062 0.319101,-0.791709 0.46875,-1.25 6.249045,-1.017063 11.256351,-5.7184 12.625,-11.78125 0.447134,-0.1471 0.86321,-0.300595 1.21875,-0.46875 0.485434,-0.22959 0.901633,-0.502489 1.21875,-0.8125 0.317117,-0.310011 0.5625,-0.710861 0.5625,-1.1875 l -0.03125,0 c 0,-0.476639 -0.245383,-0.908739 -0.5625,-1.21875 C 89.901633,71.846239 89.516684,71.60459 89.03125,71.375 88.755626,71.244642 88.456123,71.117495 88.125,71 87.439949,64.078341 82.072807,58.503735 75.21875,57.375 c -0.15044,-0.461669 -0.326927,-0.884711 -0.5,-1.25 -0.230061,-0.485567 -0.501958,-0.870402 -0.8125,-1.1875 -0.310542,-0.317098 -0.710798,-0.5625 -1.1875,-0.5625 z m -0.0625,1.40625 c 0.03595,-0.01283 0.05968,0 0.0625,0 0.0056,0 0.04321,-0.02233 0.1875,0.125 0.144288,0.147334 0.34336,0.447188 0.53125,0.84375 0.06385,0.134761 0.123901,0.309578 0.1875,0.46875 -0.320353,-0.01957 -0.643524,-0.0625 -0.96875,-0.0625 -0.289073,0 -0.558569,0.04702 -0.84375,0.0625 C 71.8761,57.059578 71.936151,56.884761 72,56.75 c 0.18789,-0.396562 0.355712,-0.696416 0.5,-0.84375 0.07214,-0.07367 0.120304,-0.112167 0.15625,-0.125 z m 0,2.40625 c 0.448007,0 0.906196,0.05436 1.34375,0.09375 0.177011,0.592256 0.347655,1.271044 0.5,2.03125 0.475097,2.370753 0.807525,5.463852 0.9375,8.9375 -0.906869,-0.02852 -1.834463,-0.0625 -2.78125,-0.0625 -0.92298,0 -1.802327,0.03537 -2.6875,0.0625 0.138529,-3.473648 0.493653,-6.566747 0.96875,-8.9375 0.154684,-0.771878 0.320019,-1.463985 0.5,-2.0625 0.405568,-0.03377 0.804291,-0.0625 1.21875,-0.0625 z m -2.71875,0.28125 c -0.129732,0.498888 -0.259782,0.987558 -0.375,1.5625 -0.498513,2.487595 -0.838088,5.693299 -0.96875,9.25 -3.21363,0.15162 -6.119596,0.480068 -8.40625,0.9375 -0.682394,0.136509 -1.275579,0.279657 -1.84375,0.4375 0.799068,-6.135482 5.504716,-11.036454 11.59375,-12.1875 z M 75.5,58.5 c 6.043169,1.18408 10.705093,6.052712 11.5,12.15625 -0.569435,-0.155806 -1.200273,-0.302525 -1.875,-0.4375 -2.262525,-0.452605 -5.108535,-0.783809 -8.28125,-0.9375 -0.130662,-3.556701 -0.470237,-6.762405 -0.96875,-9.25 C 75.761959,59.467174 75.626981,58.990925 75.5,58.5 z m -2.84375,12.09375 c 0.959338,0 1.895843,0.03282 2.8125,0.0625 C 75.48165,71.267751 75.5,71.871028 75.5,72.5 c 0,1.228616 -0.01449,2.438313 -0.0625,3.59375 -0.897358,0.0284 -1.811972,0.0625 -2.75,0.0625 -0.927373,0 -1.831062,-0.03473 -2.71875,-0.0625 -0.05109,-1.155437 -0.0625,-2.365134 -0.0625,-3.59375 0,-0.628972 0.01741,-1.232249 0.03125,-1.84375 0.895269,-0.02827 1.783025,-0.0625 2.71875,-0.0625 z M 68.5625,70.6875 c -0.01243,0.60601 -0.03125,1.189946 -0.03125,1.8125 0,1.22431 0.01541,2.407837 0.0625,3.5625 -3.125243,-0.150329 -5.92077,-0.471558 -8.09375,-0.90625 -0.784983,-0.157031 -1.511491,-0.316471 -2.125,-0.5 -0.107878,-0.704096 -0.1875,-1.422089 -0.1875,-2.15625 0,-0.115714 0.02849,-0.228688 0.03125,-0.34375 0.643106,-0.20284 1.389577,-0.390377 2.25,-0.5625 2.166953,-0.433487 4.97905,-0.75541 8.09375,-0.90625 z m 8.3125,0.03125 c 3.075121,0.15271 5.824455,0.446046 7.96875,0.875 0.857478,0.171534 1.630962,0.360416 2.28125,0.5625 0.0027,0.114659 0,0.228443 0,0.34375 0,0.735827 -0.07914,1.450633 -0.1875,2.15625 -0.598568,0.180148 -1.29077,0.34562 -2.0625,0.5 -2.158064,0.431708 -4.932088,0.754666 -8.03125,0.90625 0.04709,-1.154663 0.0625,-2.33819 0.0625,-3.5625 0,-0.611824 -0.01924,-1.185379 -0.03125,-1.78125 z M 57.15625,72.5625 c 0.0023,0.572772 0.06082,1.131112 0.125,1.6875 -0.125327,-0.05123 -0.266577,-0.10497 -0.375,-0.15625 -0.396499,-0.187528 -0.665288,-0.387337 -0.8125,-0.53125 -0.147212,-0.143913 -0.15625,-0.182756 -0.15625,-0.1875 0,-0.0047 -0.02221,-0.07484 0.125,-0.21875 0.147212,-0.143913 0.447251,-0.312472 0.84375,-0.5 0.07123,-0.03369 0.171867,-0.06006 0.25,-0.09375 z m 31.03125,0 c 0.08201,0.03503 0.175941,0.05872 0.25,0.09375 0.396499,0.187528 0.665288,0.356087 0.8125,0.5 0.14725,0.14391 0.15625,0.21405 0.15625,0.21875 0,0.0047 -0.009,0.04359 -0.15625,0.1875 -0.147212,0.143913 -0.416001,0.343722 -0.8125,0.53125 -0.09755,0.04613 -0.233314,0.07889 -0.34375,0.125 0.06214,-0.546289 0.09144,-1.094215 0.09375,-1.65625 z m -29.5,3.625 c 0.479308,0.123125 0.983064,0.234089 1.53125,0.34375 2.301781,0.460458 5.229421,0.787224 8.46875,0.9375 0.167006,2.84339 0.46081,5.433176 0.875,7.5 0.115218,0.574942 0.245268,1.063612 0.375,1.5625 -5.463677,-1.028179 -9.833074,-5.091831 -11.25,-10.34375 z m 27.96875,0 C 85.247546,81.408945 80.919274,85.442932 75.5,86.5 c 0.126981,-0.490925 0.261959,-0.967174 0.375,-1.53125 0.41419,-2.066824 0.707994,-4.65661 0.875,-7.5 3.204493,-0.15162 6.088346,-0.480068 8.375,-0.9375 0.548186,-0.109661 1.051942,-0.220625 1.53125,-0.34375 z M 70.0625,77.53125 c 0.865391,0.02589 1.723666,0.03125 2.625,0.03125 0.912062,0 1.782843,-0.0048 2.65625,-0.03125 -0.165173,2.736408 -0.453252,5.207651 -0.84375,7.15625 -0.152345,0.760206 -0.322989,1.438994 -0.5,2.03125 -0.437447,0.03919 -0.895856,0.0625 -1.34375,0.0625 -0.414943,0 -0.812719,-0.02881 -1.21875,-0.0625 -0.177011,-0.592256 -0.347655,-1.271044 -0.5,-2.03125 -0.390498,-1.948599 -0.700644,-4.419842 -0.875,-7.15625 z m 1.75,10.28125 c 0.284911,0.01545 0.554954,0.03125 0.84375,0.03125 0.325029,0 0.648588,-0.01171 0.96875,-0.03125 -0.05999,0.148763 -0.127309,0.31046 -0.1875,0.4375 -0.18789,0.396562 -0.386962,0.696416 -0.53125,0.84375 -0.144288,0.147334 -0.181857,0.125 -0.1875,0.125 -0.0056,0 -0.07446,0.02233 -0.21875,-0.125 C 72.355712,88.946416 72.18789,88.646562 72,88.25 71.939809,88.12296 71.872486,87.961263 71.8125,87.8125 z",wPe=uPi,cPi="M 72.46875,22.03125 C 59.505873,22.050338 46.521615,27.004287 36.6875,36.875 L 47.84375,47.96875 C 61.521556,34.240041 83.442603,34.227389 97.125,47.90625 l 11.125,-11.125 C 98.401629,26.935424 85.431627,22.012162 72.46875,22.03125 z",APe=cPi,hPi=CD,oT=function(o){this.terria=o.terria,this.eventHelper=new AC,this.enableZoomControls=N(o.enableZoomControls)?o.enableZoomControls:!0,this.enableCompass=N(o.enableCompass)?o.enableCompass:!0,this.navigationLocked=!1,this.controls=o.controls,N(this.controls)||(this.controls=[new oie(this.terria,!0),new CPe(this.terria),new oie(this.terria,!1)]),this.svgCompassOuterRing=bPe,this.svgCompassGyro=wPe,this.svgCompassRotationMarker=APe,this.showCompass=N(this.terria)&&this.enableCompass,this.heading=this.showCompass?this.terria.scene.camera.heading:0,this.isOrbiting=!1,this.orbitCursorAngle=0,this.orbitCursorOpacity=0,this.orbitLastTimestamp=0,this.orbitFrame=void 0,this.orbitIsLook=!1,this.orbitMouseMoveFunction=void 0,this.orbitMouseUpFunction=void 0,this.isRotating=!1,this.rotateInitialCursorAngle=void 0,this.rotateFrame=void 0,this.rotateIsLook=!1,this.rotateMouseMoveFunction=void 0,this.rotateMouseUpFunction=void 0,this._unsubcribeFromPostRender=void 0,hPi.track(this,["controls","showCompass","heading","isOrbiting","orbitCursorAngle","isRotating"]);let f=this;oT.prototype.setNavigationLocked=function(v){this.navigationLocked=v,this.controls&&this.controls.length>1&&this.controls[1].setNavigationLocked(this.navigationLocked)};function m(){N(f.terria)?(f._unsubcribeFromPostRender&&(f._unsubcribeFromPostRender(),f._unsubcribeFromPostRender=void 0),f.showCompass=f.enableCompass,f._unsubcribeFromPostRender=f.terria.scene.postRender.addEventListener(function(){f.heading=f.terria.scene.camera.heading})):(f._unsubcribeFromPostRender&&(f._unsubcribeFromPostRender(),f._unsubcribeFromPostRender=void 0),f.showCompass=!1)}this.eventHelper.add(this.terria.afterWidgetChanged,m,this),m()};oT.prototype.destroy=function(){this.eventHelper.removeAll()};oT.prototype.show=function(o){let f;this.enableZoomControls&&this.enableCompass?f=`<div class="compass" title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }"><div class="compass-outer-ring-background"></div> <div class="compass-rotation-marker" data-bind="visible: isOrbiting, style: { transform: 'rotate(-' + orbitCursorAngle + 'rad)', '-webkit-transform': 'rotate(-' + orbitCursorAngle + 'rad)', opacity: orbitCursorOpacity }, cesiumSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }"></div> <div class="compass-outer-ring" title="" data-bind="style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }, cesiumSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }"></div> <div class="compass-gyro-background"></div> <div class="compass-gyro" data-bind="cesiumSvgPath: { path: svgCompassGyro, width: 145, height: 145 }, css: { 'compass-gyro-active': isOrbiting }"></div></div><div class="navigation-controls"><!-- ko foreach: controls --><div data-bind="click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? 'navigation-control-last' : 'navigation-control' "> <!-- ko if: $data.hasText --> <div data-bind="text: $data.text, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div> <!-- /ko --> <!-- ko ifnot: $data.hasText --> <div data-bind="cesiumSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div> <!-- /ko --> </div> <!-- /ko --></div>`:!this.enableZoomControls&&this.enableCompass?f=`<div class="compass" title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }"><div class="compass-outer-ring-background"></div> <div class="compass-rotation-marker" data-bind="visible: isOrbiting, style: { transform: 'rotate(-' + orbitCursorAngle + 'rad)', '-webkit-transform': 'rotate(-' + orbitCursorAngle + 'rad)', opacity: orbitCursorOpacity }, cesiumSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }"></div> <div class="compass-outer-ring" title="" data-bind="style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }, cesiumSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }"></div> <div class="compass-gyro-background"></div> <div class="compass-gyro" data-bind="cesiumSvgPath: { path: svgCompassGyro, width: 145, height: 145 }, css: { 'compass-gyro-active': isOrbiting }"></div></div><div class="navigation-controls" style="display: none;" ><!-- ko foreach: controls --><div data-bind="click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? 'navigation-control-last' : 'navigation-control' "> <!-- ko if: $data.hasText --> <div data-bind="text: $data.text, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div> <!-- /ko --> <!-- ko ifnot: $data.hasText --> <div data-bind="cesiumSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div> <!-- /ko --> </div> <!-- /ko --></div>`:this.enableZoomControls&&!this.enableCompass?f=`<div class="compass" style="display: none;" title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }"><div class="compass-outer-ring-background"></div> <div class="compass-rotation-marker" data-bind="visible: isOrbiting, style: { transform: 'rotate(-' + orbitCursorAngle + 'rad)', '-webkit-transform': 'rotate(-' + orbitCursorAngle + 'rad)', opacity: orbitCursorOpacity }, cesiumSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }"></div> <div class="compass-outer-ring" title="" data-bind="style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }, cesiumSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }"></div> <div class="compass-gyro-background"></div> <div class="compass-gyro" data-bind="cesiumSvgPath: { path: svgCompassGyro, width: 145, height: 145 }, css: { 'compass-gyro-active': isOrbiting }"></div></div><div class="navigation-controls" ><!-- ko foreach: controls --><div data-bind="click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? 'navigation-control-last' : 'navigation-control' "> <!-- ko if: $data.hasText --> <div data-bind="text: $data.text, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div> <!-- /ko --> <!-- ko ifnot: $data.hasText --> <div data-bind="cesiumSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div> <!-- /ko --> </div> <!-- /ko --></div>`:!this.enableZoomControls&&!this.enableCompass&&(f=`<div class="compass" style="display: none;" title="" data-bind="visible: showCompass, event: { mousedown: handleMouseDown, dblclick: handleDoubleClick }"><div class="compass-outer-ring-background"></div> <div class="compass-rotation-marker" data-bind="visible: isOrbiting, style: { transform: 'rotate(-' + orbitCursorAngle + 'rad)', '-webkit-transform': 'rotate(-' + orbitCursorAngle + 'rad)', opacity: orbitCursorOpacity }, cesiumSvgPath: { path: svgCompassRotationMarker, width: 145, height: 145 }"></div> <div class="compass-outer-ring" title="" data-bind="style: { transform: 'rotate(-' + heading + 'rad)', '-webkit-transform': 'rotate(-' + heading + 'rad)' }, cesiumSvgPath: { path: svgCompassOuterRing, width: 145, height: 145 }"></div> <div class="compass-gyro-background"></div> <div class="compass-gyro" data-bind="cesiumSvgPath: { path: svgCompassGyro, width: 145, height: 145 }, css: { 'compass-gyro-active': isOrbiting }"></div></div><div class="navigation-controls" style="display: none;" ><!-- ko foreach: controls --><div data-bind="click: activate, attr: { title: $data.name }, css: $root.isLastControl($data) ? 'navigation-control-last' : 'navigation-control' "> <!-- ko if: $data.hasText --> <div data-bind="text: $data.text, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div> <!-- /ko --> <!-- ko ifnot: $data.hasText --> <div data-bind="cesiumSvgPath: { path: $data.svgIcon, width: $data.svgWidth, height: $data.svgHeight }, css: $data.isActive ? 'navigation-control-icon-active ' + $data.cssClass : $data.cssClass"></div> <!-- /ko --> </div> <!-- /ko --></div>`),fae(f,o,this)};oT.prototype.add=function(o){this.controls.push(o)};oT.prototype.remove=function(o){this.controls.remove(o)};oT.prototype.isLastControl=function(o){return o===this.controls[this.controls.length-1]};var EPe=new Ye;oT.prototype.handleMouseDown=function(o,f){if(this.terria.scene.mode===_i.MORPHING||o.navigationLocked)return!0;let m=f.currentTarget,v=f.currentTarget.getBoundingClientRect(),y=v.width/2,x=new Ye((v.right-v.left)/2,(v.bottom-v.top)/2),C=new Ye(f.clientX-v.left,f.clientY-v.top),w=Ye.subtract(C,x,EPe),A=Ye.magnitude(w)/y;if(A<50/145)dPi(this,m,w);else if(A<1)fPi(this,m,w);else return!0};var o0e=new Ee,aie=new Ee,TPe=new H;oT.prototype.handleDoubleClick=function(o,f){let m=o.terria.scene,v=m.camera,y=m.screenSpaceCameraController;if(m.mode===_i.MORPHING||!y.enableInputs||o.navigationLocked)return!0;if(m.mode===_i.COLUMBUS_VIEW&&!y.enableTranslate||(m.mode===_i.SCENE3D||m.mode===_i.COLUMBUS_VIEW)&&(!y.enableLook||m.mode===_i.SCENE3D&&!y.enableRotate))return;let x=H6.getCameraFocus(o.terria,!0,TPe);if(!N(x)){this.controls[1].resetView();return}let C=m.globe.ellipsoid.cartographicToCartesian(v.positionCartographic,new H),w=m.globe.ellipsoid.geodeticSurfaceNormal(x),A=new Pi(x,0);v.flyToBoundingSphere(A,{offset:new gC(0,xe.PI_OVER_TWO-H.angleBetween(w,v.directionWC),H.distance(C,x)),duration:1.5})};oT.create=function(o){let f=new oT(o);return f.show(o.container),f};function dPi(o,f,m){let v=o.terria.scene,y=v.screenSpaceCameraController;if(v.mode===_i.MORPHING||!y.enableInputs)return;if(o.navigationLocked)return!0;switch(v.mode){case _i.COLUMBUS_VIEW:if(y.enableLook)break;if(!y.enableTranslate||!y.enableTilt)return;break;case _i.SCENE3D:if(y.enableLook)break;if(!y.enableTilt||!y.enableRotate)return;break;case _i.SCENE2D:if(!y.enableTranslate)return;break}document.removeEventListener("mousemove",o.orbitMouseMoveFunction,!1),document.removeEventListener("mouseup",o.orbitMouseUpFunction,!1),N(o.orbitTickFunction)&&o.terria.clock.onTick.removeEventListener(o.orbitTickFunction),o.orbitMouseMoveFunction=void 0,o.orbitMouseUpFunction=void 0,o.orbitTickFunction=void 0,o.isOrbiting=!0,o.orbitLastTimestamp=$c();let x=v.camera;if(N(o.terria.trackedEntity))o.orbitFrame=void 0,o.orbitIsLook=!1;else{let w=H6.getCameraFocus(o.terria,!0,TPe);N(w)?(o.orbitFrame=tn.eastNorthUpToFixedFrame(w,v.globe.ellipsoid,aie),o.orbitIsLook=!1):(o.orbitFrame=tn.eastNorthUpToFixedFrame(x.positionWC,v.globe.ellipsoid,aie),o.orbitIsLook=!0)}o.orbitTickFunction=function(w){let A=$c(),E=A-o.orbitLastTimestamp,T=(o.orbitCursorOpacity-.5)*2.5/1e3,S=E*T,M=o.orbitCursorAngle+xe.PI_OVER_TWO,I=Math.cos(M)*S,P=Math.sin(M)*S,D;if(o.navigationLocked)return!0;N(o.orbitFrame)&&(D=Ee.clone(x.transform,o0e),x.lookAtTransform(o.orbitFrame)),v.mode===_i.SCENE2D?x.move(new H(I,P,0),Math.max(v.canvas.clientWidth,v.canvas.clientHeight)/100*x.positionCartographic.height*S):o.orbitIsLook?(x.look(H.UNIT_Z,-I),x.look(x.right,-P)):(x.rotateLeft(I),x.rotateUp(P)),N(o.orbitFrame)&&x.lookAtTransform(D),o.orbitLastTimestamp=A};function C(w,A){let E=Math.atan2(-w.y,w.x);o.orbitCursorAngle=xe.zeroToTwoPi(E-xe.PI_OVER_TWO);let T=Ye.magnitude(w),S=A/2,M=Math.min(T/S,1),I=.5*M*M+.5;o.orbitCursorOpacity=I}o.orbitMouseMoveFunction=function(w){let A=f.getBoundingClientRect(),E=new Ye((A.right-A.left)/2,(A.bottom-A.top)/2),T=new Ye(w.clientX-A.left,w.clientY-A.top),S=Ye.subtract(T,E,EPe);C(S,A.width)},o.orbitMouseUpFunction=function(w){o.isOrbiting=!1,document.removeEventListener("mousemove",o.orbitMouseMoveFunction,!1),document.removeEventListener("mouseup",o.orbitMouseUpFunction,!1),N(o.orbitTickFunction)&&o.terria.clock.onTick.removeEventListener(o.orbitTickFunction),o.orbitMouseMoveFunction=void 0,o.orbitMouseUpFunction=void 0,o.orbitTickFunction=void 0},document.addEventListener("mousemove",o.orbitMouseMoveFunction,!1),document.addEventListener("mouseup",o.orbitMouseUpFunction,!1),o.terria.clock.onTick.addEventListener(o.orbitTickFunction),C(m,f.getBoundingClientRect().width)}function fPi(o,f,m){let v=o.terria.scene,y=v.camera,x=v.screenSpaceCameraController;if(v.mode===_i.MORPHING||v.mode===_i.SCENE2D||!x.enableInputs)return;if(o.navigationLocked)return!0;if(!x.enableLook&&(v.mode===_i.COLUMBUS_VIEW||v.mode===_i.SCENE3D&&!x.enableRotate))return;if(document.removeEventListener("mousemove",o.rotateMouseMoveFunction,!1),document.removeEventListener("mouseup",o.rotateMouseUpFunction,!1),o.rotateMouseMoveFunction=void 0,o.rotateMouseUpFunction=void 0,o.isRotating=!0,o.rotateInitialCursorAngle=Math.atan2(-m.y,m.x),N(o.terria.trackedEntity))o.rotateFrame=void 0,o.rotateIsLook=!1;else{let w=H6.getCameraFocus(o.terria,!0,TPe);!N(w)||v.mode===_i.COLUMBUS_VIEW&&!x.enableLook&&!x.enableTranslate?(o.rotateFrame=tn.eastNorthUpToFixedFrame(y.positionWC,v.globe.ellipsoid,aie),o.rotateIsLook=!0):(o.rotateFrame=tn.eastNorthUpToFixedFrame(w,v.globe.ellipsoid,aie),o.rotateIsLook=!1)}let C;N(o.rotateFrame)&&(C=Ee.clone(y.transform,o0e),y.lookAtTransform(o.rotateFrame)),o.rotateInitialCameraAngle=-y.heading,N(o.rotateFrame)&&y.lookAtTransform(C),o.rotateMouseMoveFunction=function(w){let A=f.getBoundingClientRect(),E=new Ye((A.right-A.left)/2,(A.bottom-A.top)/2),T=new Ye(w.clientX-A.left,w.clientY-A.top),S=Ye.subtract(T,E,EPe),M=Math.atan2(-S.y,S.x)-o.rotateInitialCursorAngle,I=xe.zeroToTwoPi(o.rotateInitialCameraAngle-M),P=o.terria.scene.camera,D;N(o.rotateFrame)&&(D=Ee.clone(P.transform,o0e),P.lookAtTransform(o.rotateFrame));let L=-P.heading;P.rotateRight(I-L),N(o.rotateFrame)&&P.lookAtTransform(D)},o.rotateMouseUpFunction=function(w){o.isRotating=!1,document.removeEventListener("mousemove",o.rotateMouseMoveFunction,!1),document.removeEventListener("mouseup",o.rotateMouseUpFunction,!1),o.rotateMouseMoveFunction=void 0,o.rotateMouseUpFunction=void 0},document.addEventListener("mousemove",o.rotateMouseMoveFunction,!1),document.addEventListener("mouseup",o.rotateMouseUpFunction,!1)}var gW=oT,U6e=Br,fb=function(o){pPi.apply(this,arguments),this._onDestroyListeners=[]};fb.prototype.distanceLegendViewModel=void 0;fb.prototype.navigationViewModel=void 0;fb.prototype.navigationDiv=void 0;fb.prototype.distanceLegendDiv=void 0;fb.prototype.terria=void 0;fb.prototype.container=void 0;fb.prototype._onDestroyListeners=void 0;fb.prototype._navigationLocked=!1;fb.prototype.setNavigationLocked=function(o){this._navigationLocked=o,this.navigationViewModel.setNavigationLocked(this._navigationLocked)};fb.prototype.getNavigationLocked=function(){return this._navigationLocked};fb.prototype.destroy=function(){N(this.navigationViewModel)&&this.navigationViewModel.destroy(),N(this.distanceLegendViewModel)&&this.distanceLegendViewModel.destroy(),N(this.navigationDiv)&&this.navigationDiv.parentNode.removeChild(this.navigationDiv),delete this.navigationDiv,N(this.distanceLegendDiv)&&this.distanceLegendDiv.parentNode.removeChild(this.distanceLegendDiv),delete this.distanceLegendDiv,N(this.container)&&this.container.parentNode.removeChild(this.container),delete this.container;for(let o=0;o<this._onDestroyListeners.length;o++)this._onDestroyListeners[o]()};fb.prototype.addOnDestroyListener=function(o){typeof o=="function"&&this._onDestroyListeners.push(o)};function pPi(o,f){if(!N(o))throw new li("CesiumWidget or Viewer is required.");let m=N(o.cesiumWidget)?o.cesiumWidget:o,v=document.createElement("div");v.className="Geoworld-widget-GeoworldNavigationContainer",m.container.appendChild(v),this.terria=o,this.terria.options=N(f)?f:{},this.terria.afterWidgetChanged=new U6e,this.terria.beforeWidgetChanged=new U6e,this.container=v,(!N(this.terria.options.enableDistanceLegend)||this.terria.options.enableDistanceLegend)&&(this.distanceLegendDiv=document.createElement("div"),v.appendChild(this.distanceLegendDiv),this.distanceLegendDiv.setAttribute("id","distanceLegendDiv"),this.distanceLegendViewModel=vPe.create({container:this.distanceLegendDiv,terria:this.terria,mapElement:v,enableDistanceLegend:!0})),(!N(this.terria.options.enableZoomControls)||this.terria.options.enableZoomControls)&&(!N(this.terria.options.enableCompass)||this.terria.options.enableCompass)?(this.navigationDiv=document.createElement("div"),this.navigationDiv.setAttribute("id","navigationDiv"),v.appendChild(this.navigationDiv),this.navigationViewModel=gW.create({container:this.navigationDiv,terria:this.terria,enableZoomControls:!0,enableCompass:!0})):N(this.terria.options.enableZoomControls)&&!this.terria.options.enableZoomControls&&(!N(this.terria.options.enableCompass)||this.terria.options.enableCompass)?(this.navigationDiv=document.createElement("div"),this.navigationDiv.setAttribute("id","navigationDiv"),v.appendChild(this.navigationDiv),this.navigationViewModel=gW.create({container:this.navigationDiv,terria:this.terria,enableZoomControls:!1,enableCompass:!0})):(!N(this.terria.options.enableZoomControls)||this.terria.options.enableZoomControls)&&N(this.terria.options.enableCompass)&&!this.terria.options.enableCompass?(this.navigationDiv=document.createElement("div"),this.navigationDiv.setAttribute("id","navigationDiv"),v.appendChild(this.navigationDiv),this.navigationViewModel=gW.create({container:this.navigationDiv,terria:this.terria,enableZoomControls:!0,enableCompass:!1})):N(this.terria.options.enableZoomControls)&&!this.terria.options.enableZoomControls&&N(this.terria.options.enableCompass)&&this.terria.options.enableCompass}var SPe=fb;function hot(o,f){if(!N(o))throw new li("viewer is required.");dot(o,f).addOnDestroyListener(function(m){return function(){delete m.cesiumNavigation}}(o)),Object.defineProperties(o,{cesiumNavigation:{configurable:!0,get:function(){return o.cesiumWidget.cesiumNavigation}}})}hot.mixinWidget=function(o,f){return dot.apply(void 0,arguments)};var dot=function(o,f){let m=new SPe(o,f),v=N(o.cesiumWidget)?o.cesiumWidget:o;return Object.defineProperties(v,{cesiumNavigation:{configurable:!0,get:function(){return m}}}),m.addOnDestroyListener(function(y){return function(){delete y.cesiumNavigation}}(v)),m},fot=hot,mPi=class{constructor(o,f,m){this.loadMap=!1,this.USE_raytrace=f._raytrace,this.parent=f,this.model=o,this.model.modelGroups=[],this.sceneIndex=m,this.model.receiveShadows=f._castShadows,this.model.castShadows=f._castShadows}parse(){let o=this.model;if(!o.modelMatrix){let f=o.positionBuffer.length,m=0;if(o.userData&&o.userData.transformData&&o.userData.transformData.translation){let v=o.userData.transformData.translation[0],y=o.userData.transformData.translation[2],x=o.userData.transformData.translation[1];for(let C=0;C<f;C+=3){o.positionBuffer[C]=o.positionBuffer[C]+v,o.positionBuffer[C+1]=o.positionBuffer[C+1]-y,o.positionBuffer[C+2]=o.positionBuffer[C+2]+x;let w=H.distanceSquared({x:0,y:0,z:0},{x:o.positionBuffer[C],y:o.positionBuffer[C+1],z:o.positionBuffer[C+2]});m=w>m?w:m}m=Math.sqrt(m)*this.parent._scale,o.boundingSphere=new Pi(this.parent._originPosition,m)}else{for(let v=0;v<f;v+=3){let y=H.distanceSquared({x:0,y:0,z:0},{x:o.positionBuffer[v],y:o.positionBuffer[v+1],z:o.positionBuffer[v+2]});m=y>m?y:m}m=Math.sqrt(m)*this.parent._scale,o.boundingSphere=new Pi(this.parent._originPosition,m)}o.modelMatrix=this.parent._modelMatrix.clone()}if(this.parent._boundingSphere?this.parent._boundingSphere&&o.boundingSphere.radius>this.parent._boundingSphere.radius&&(this.parent._boundingSphere=new Pi(this.parent._originPosition,o.boundingSphere.radius)):this.parent._boundingSphere=new Pi(this.parent._originPosition,o.boundingSphere.radius),this.model.groups.length>0){for(let f=0;f<this.model.groups.length;f++){let m=this.model.groups[f][0],v=m+this.model.groups[f][1],y={positionBuffer:this.model.positionBuffer.slice(m*3,v*3),normal:this.model.normal.slice(m*3,v*3),uvs:[this.model.uvs[0].slice(m*2,v*2)],materialIndex:this.model.groups[f][2]};this.model.modelGroups.push(y)}this.model.positionBuffer=null,this.model.normal=null,this.model.uvs=null}if(Array.isArray(this.model.material))for(let f=0;f<this.model.material.length;f++)this.loadShader(this.model.material[f]);else this.loadShader(this.model.material);return this}loadShader(o){o.fragmentShaderText=` struct Material{ vec3 diffuse; vec3 specular; vec3 emissive;//\u81EA\u53D1\u5149 float shininess;//\u5149\u6CFD\u5EA6 float alpha; }; uniform Material objMaterial; //\u57FA\u7840\u6750\u8D28 uniform sampler2D diffuseMap; //\u6F2B\u53CD\u5C04\u8D34\u56FE uniform vec2 diffuseMapRepeat; uniform vec2 diffuseMapOffset; uniform sampler2D specularMap; //\u53CD\u5C04\u8D34\u56FE uniform vec2 specularMapRepeat; uniform vec2 specularMapOffset; uniform sampler2D bumpMap;//\u6CD5\u7EBF\u8D34\u56FE uniform vec2 bumpMapRepeat; uniform vec2 bumpMapOffset; uniform sampler2D alphaMap; //\u900F\u660E\u8D34\u56FE uniform vec2 alphaMapRepeat; uniform vec2 alphaMapOffset; uniform sampler2D emissiveMap; //\u53D1\u5149\u8D34\u56FE uniform vec2 emissiveMapRepeat; uniform vec2 emissiveMapOffset; uniform vec3 ambientColor; // \u73AF\u5883\u5149 uniform vec3 lightDir; // \u592A\u9633\u65B9\u5411 uniform vec3 lightColor; // \u5149\u7167\u989C\u8272 uniform vec4 color; //\u53E0\u52A0\u989C\u8272 ${this.pickId?"uniform vec4 czm_pickId;":""} uniform vec3 viewDir; // \u89C6\u89D2\u65B9\u5411 in vec2 fragTexCoord; // \u6A21\u578B\u7EB9\u7406 in vec3 fragNormal; // \u6A21\u578B\u6CD5\u7EBF in vec3 fragPosition; // \u6A21\u578B\u9876\u70B9 void main(){ ${this.USE_raytrace?`vec3 lightDir = normalize(lightDir); ${o.USE_bumpMap?`vec3 normal = texture(bumpMap, fragTexCoord * bumpMapRepeat + bumpMapOffset).rgb * 2.0 - 1.0; normal.yz *= -1.0; normal= normalize(normal); `:"vec3 normal = normalize(fragNormal);"} //\u6F2B\u53CD\u5C04---\u5170\u4F2F\u7279\u5149\u7167\u6A21\u578B float diff = max(dot(normal, lightDir),0.0); vec3 diffuse = diff * lightColor; //\u53CD\u5C04 vec3 reflectDir = reflect(-lightDir, normal); vec3 viewDirection = normalize(-viewDir); float spec = pow(max(dot(viewDirection, reflectDir), 0.0),1.0); vec3 specular = spec * vec3(1.0,1.0,1.0); vec3 ambient = vec3(ambientColor); `:` vec3 diffuse = vec3(1.0,1.0,1.0); vec3 specular = vec3(0.0,0.0,0.0); vec3 ambient = vec3(0.0,0.0,0.0); `} ${o.USE_diffuseMap?"vec3 diffuseColor = vec3(texture(diffuseMap, fragTexCoord * diffuseMapRepeat + diffuseMapOffset));":"vec3 diffuseColor = objMaterial.diffuse;"} ${o.USE_specularMap?"vec3 specularColor = vec3(texture(specularMap, fragTexCoord * specularMapRepeat + specularMapOffset));":"vec3 specularColor = objMaterial.specular;"} diffuse = diffuseColor * diffuse; specular = specularColor * specular; ${o.USE_emissiveMap?"vec3 emissive = vec3(texture(emissiveMap, fragTexCoord * emissiveMapRepeat + emissiveMapOffset));":"vec3 emissive = objMaterial.emissive;"} //\u6700\u7EC8\u989C\u8272 vec3 finalColor = diffuse + specular + ambient * diffuseColor + emissive; ${o.USE_alphaMap?"out_FragColor = vec4(finalColor, texture(alphaMap, fragTexCoord * alphaMapRepeat + alphaMapOffset).r);":"out_FragColor = vec4(finalColor, objMaterial.alpha);"} out_FragColor *=color; }`}loadPickId(o){let f=o.createPickId({sceneIndex:this.sceneIndex,primitive:this.parent,model:this.model});if(this.pickId=f,Array.isArray(this.model.material))for(let m=0;m<this.model.material.length;m++)this.loadShader(this.model.material[m]);else this.loadShader(this.model.material)}loadingMap(o){let f=this.model,m=this,v=(x,C,w,A)=>{x&&x[C]&&(x[C].img.onload=function(){x.texture[w]||(x[C].offset?x.texture[w+"offset"]=new Ye(x[C].offset.x,x[C].offset.y):x.texture[w+"offset"]=new Ye(0,0),x[C].repeat?x.texture[w+"repeat"]=new Ye(x[C].repeat.x,x[C].repeat.y):x.texture[w+"repeat"]=new Ye(1,1),x.texture[w]=new _o({context:o,source:x[C].img,width:x[C].img.naturalWidth||512,height:x[C].img.naturalHeight||512,sampler:new gs({wrapS:x[C].wrapS,wrapT:x[C].wrapT})})),x[A]=!0,m.loadShader(x)})},y=f.material;if(Array.isArray(y))for(let x=0;x<y.length;x++)v(y[x],"map","mapTexture","USE_diffuseMap"),v(y[x],"specularMap","specularTexture","USE_specularMap"),v(y[x],"alphaMap","alphaTexture","USE_alphaMap"),v(y[x],"bumpMap","bumpTexture","USE_bumpMap");else v(y,"map","mapTexture","USE_diffuseMap"),v(y,"specularMap","specularTexture","USE_specularMap"),v(y,"alphaMap","alphaTexture","USE_alphaMap"),v(y,"bumpMap","bumpTexture","USE_bumpMap"),v(y,"emissiveMap","emissiveTexture","USE_emissiveMap")}},PPe=mPi;/*! fflate - fast JavaScript compression/decompression <https://101arrowz.github.io/fflate> Licensed under MIT. https://github.com/101arrowz/fflate/blob/master/LICENSE version 0.6.9 */var G6e=function(o){return URL.createObjectURL(new Blob([o],{type:"text/javascript"}))},gPi=function(o){return new Worker(o)};try{URL.revokeObjectURL(G6e(""))}catch{G6e=function(o){return"data:application/javascript;charset=UTF-8,"+encodeURI(o)},gPi=function(o){return new Worker(o,{type:"module"})}}var Cw=Uint8Array,qR=Uint16Array,a0e=Uint32Array,pot=new Cw([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),mot=new Cw([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),_Pi=new Cw([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),got=function(o,f){for(var m=new qR(31),v=0;v<31;++v)m[v]=f+=1<<o[v-1];for(var y=new a0e(m[30]),v=1;v<30;++v)for(var x=m[v];x<m[v+1];++x)y[x]=x-m[v]<<5|v;return[m,y]},_ot=got(pot,2),vot=_ot[0],vPi=_ot[1];vot[28]=258,vPi[258]=28;var yot=got(mot,0),yPi=yot[0],eGi=yot[1],s0e=new qR(32768);for(yh=0;yh<32768;++yh)BI=(yh&43690)>>>1|(yh&21845)<<1,BI=(BI&52428)>>>2|(BI&13107)<<2,BI=(BI&61680)>>>4|(BI&3855)<<4,s0e[yh]=((BI&65280)>>>8|(BI&255)<<8)>>>1;var BI,yh,_W=function(o,f,m){for(var v=o.length,y=0,x=new qR(f);y<v;++y)++x[o[y]-1];var C=new qR(f);for(y=0;y<f;++y)C[y]=C[y-1]+x[y-1]<<1;var w;if(m){w=new qR(1<<f);var A=15-f;for(y=0;y<v;++y)if(o[y])for(var E=y<<4|o[y],T=f-o[y],S=C[o[y]-1]++<<T,M=S|(1<<T)-1;S<=M;++S)w[s0e[S]>>>A]=E}else for(w=new qR(v),y=0;y<v;++y)o[y]&&(w[y]=s0e[C[o[y]-1]++]>>>15-o[y]);return w},lX=new Cw(288);for(yh=0;yh<144;++yh)lX[yh]=8;var yh;for(yh=144;yh<256;++yh)lX[yh]=9;var yh;for(yh=256;yh<280;++yh)lX[yh]=7;var yh;for(yh=280;yh<288;++yh)lX[yh]=8;var yh,xot=new Cw(32);for(yh=0;yh<32;++yh)xot[yh]=5;var yh,xPi=_W(lX,9,1),CPi=_W(xot,5,1),Mpe=function(o){for(var f=o[0],m=1;m<o.length;++m)o[m]>f&&(f=o[m]);return f},wE=function(o,f,m){var v=f/8|0;return(o[v]|o[v+1]<<8)>>(f&7)&m},Dpe=function(o,f){var m=f/8|0;return(o[m]|o[m+1]<<8|o[m+2]<<16)>>(f&7)},bPi=function(o){return(o/8|0)+(o&7&&1)},wPi=function(o,f,m){(f==null||f<0)&&(f=0),(m==null||m>o.length)&&(m=o.length);var v=new(o instanceof qR?qR:o instanceof a0e?a0e:Cw)(m-f);return v.set(o.subarray(f,m)),v},APi=function(o,f,m){var v=o.length;if(!v||m&&!m.l&&v<5)return f||new Cw(0);var y=!f||m,x=!m||m.i;m||(m={}),f||(f=new Cw(v*3));var C=function(he){var Ce=f.length;if(he>Ce){var Se=new Cw(Math.max(Ce*2,he));Se.set(f),f=Se}},w=m.f||0,A=m.p||0,E=m.b||0,T=m.l,S=m.d,M=m.m,I=m.n,P=v*8;do{if(!T){m.f=w=wE(o,A,1);var D=wE(o,A+1,3);if(A+=3,D)if(D==1)T=xPi,S=CPi,M=9,I=5;else if(D==2){var L=wE(o,A,31)+257,R=wE(o,A+10,15)+4,O=L+wE(o,A+5,31)+1;A+=14;for(var F=new Cw(O),k=new Cw(19),U=0;U<R;++U)k[_Pi[U]]=wE(o,A+U*3,7);A+=R*3;for(var G=Mpe(k),j=(1<<G)-1,q=_W(k,G,1),U=0;U<O;){var J=q[wE(o,A,j)];A+=J&15;var X=J>>>4;if(X<16)F[U++]=X;else{var Y=0,Q=0;for(X==16?(Q=3+wE(o,A,3),A+=2,Y=F[U-1]):X==17?(Q=3+wE(o,A,7),A+=3):X==18&&(Q=11+wE(o,A,127),A+=7);Q--;)F[U++]=Y}}var ee=F.subarray(0,L),z=F.subarray(L);M=Mpe(ee),I=Mpe(z),T=_W(ee,M,1),S=_W(z,I,1)}else throw"invalid block type";else{var X=bPi(A)+4,ie=o[X-4]|o[X-3]<<8,re=X+ie;if(re>v){if(x)throw"unexpected EOF";break}y&&C(E+ie),f.set(o.subarray(X,re),E),m.b=E+=ie,m.p=A=re*8;continue}if(A>P){if(x)throw"unexpected EOF";break}}y&&C(E+131072);for(var ne=(1<<M)-1,oe=(1<<I)-1,se=A;;se=A){var Y=T[Dpe(o,A)&ne],ae=Y>>>4;if(A+=Y&15,A>P){if(x)throw"unexpected EOF";break}if(!Y)throw"invalid length/literal";if(ae<256)f[E++]=ae;else if(ae==256){se=A,T=null;break}else{var fe=ae-254;if(ae>264){var U=ae-257,de=pot[U];fe=wE(o,A,(1<<de)-1)+vot[U],A+=de}var ve=S[Dpe(o,A)&oe],pe=ve>>>4;if(!ve)throw"invalid distance";A+=ve&15;var z=yPi[pe];if(pe>3){var de=mot[pe];z+=Dpe(o,A)&(1<<de)-1,A+=de}if(A>P){if(x)throw"unexpected EOF";break}y&&C(E+131072);for(var ce=E+fe;E<ce;E+=4)f[E]=f[E-z],f[E+1]=f[E+1-z],f[E+2]=f[E+2-z],f[E+3]=f[E+3-z];E=ce}}m.l=T,m.p=se,m.b=E,T&&(w=1,m.m=M,m.d=S,m.n=I)}while(!w);return E==f.length?f:wPi(f,0,E)},EPi=new Cw(0),TPi=function(o){if((o[0]&15)!=8||o[0]>>>4>7||(o[0]<<8|o[1])%31)throw"invalid zlib data";if(o[1]&32)throw"invalid zlib data: preset dictionaries not supported"},SPi=function(o,f){return APi((TPi(o),o.subarray(2,-4)),f)},PPi=typeof TextDecoder<"u"&&new TextDecoder,IPi=0;try{PPi.decode(EPi,{stream:!0}),IPi=1}catch{}var IPe=SPi,MPi=class{constructor(o){this.isMaterial=!0,this.isMeshPhongMaterial=!0,this.name="",this.type="MeshPhongMaterial",this.uuid=zl(),this.color=Re.fromRgba("0xffffff"),this.vertexColors=!1,this.map=null,this.specular=Re.fromRgba("0x111111"),this.specularMap=null,this.shininess=30,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=Re.fromRgba("0x000000"),this.emissiveIntensity=0,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=0,this.normalScale=new Ye(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.alphaMap=null,this.envMap=null,this.combine=0,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.texture={},this.setValues(o)}copy(o){return super.copy(o),this.color.copy(o.color),this.specular.copy(o.specular),this.shininess=o.shininess,this.map=o.map,this.lightMap=o.lightMap,this.lightMapIntensity=o.lightMapIntensity,this.aoMap=o.aoMap,this.aoMapIntensity=o.aoMapIntensity,this.emissive.copy(o.emissive),this.emissiveMap=o.emissiveMap,this.emissiveIntensity=o.emissiveIntensity,this.bumpMap=o.bumpMap,this.bumpScale=o.bumpScale,this.normalMap=o.normalMap,this.normalMapType=o.normalMapType,this.normalScale.copy(o.normalScale),this.displacementMap=o.displacementMap,this.displacementScale=o.displacementScale,this.displacementBias=o.displacementBias,this.specularMap=o.specularMap,this.alphaMap=o.alphaMap,this.envMap=o.envMap,this.combine=o.combine,this.reflectivity=o.reflectivity,this.refractionRatio=o.refractionRatio,this.wireframe=o.wireframe,this.wireframeLinewidth=o.wireframeLinewidth,this.wireframeLinecap=o.wireframeLinecap,this.wireframeLinejoin=o.wireframeLinejoin,this.flatShading=o.flatShading,this.fog=o.fog,this}setValues(o){if(o!==void 0)for(let f in o){let m=o[f];if(m===void 0){console.warn(`Material: parameter '${f}' has value of undefined.`);continue}let v=this[f];if(v===void 0){console.warn(`Material: '${f}' is not a property of ${this.type}.`);continue}v&&v.isColor?v.set(m):v&&v.isVector3&&m&&m.isVector3?v.copy(m):this[f]=m}}},vW=MPi,DPi=class{constructor(){this.uuid=zl(),this.name="",this.positionBuffer=new Float32Array,this.groups=[],this.uvs=[],this.userData={},this.type="mesh"}parse(){}setAttribute(o,f){switch(o){case"position":this.positionBuffer=f;break;case"preTransform":this.preTransform=f;break;case"color":this.color=f;break;case"normal":this.normal=f;break;case"uv":this.uv=f;break;case"skinIndex":this.skinIndex=f;break;case"skinWeight":this.skinWeight=f;break;default:console.warn('MeshParser: type "'+o+'" is not supported.');return}}addGroup(o,f,m){this.groups.push([o,f,m])}},MPe=DPi,Zm,jS,d$={scene:[]},W6e="",LPi=class{constructor(){}parse(o,f){Zm=o,W6e=f,jS=this.parseConnections();let m=this.parseImages(),v=this.parseTextures(m),y=this.parseMaterials(v),x=this.parseDeformers(),C=new RPi().parse(x);return this.parseScene(x,C,y),d$}parseConnections(){let o=new Map;return"Connections"in Zm&&Zm.Connections.connections.forEach(function(f){let m=f[0],v=f[1],y=f[2];o.has(m)||o.set(m,{parents:[],children:[]});let x={ID:v,relationship:y};o.get(m).parents.push(x),o.has(v)||o.set(v,{parents:[],children:[]});let C={ID:m,relationship:y};o.get(v).children.push(C)}),o}parseImages(){let o={},f={};if("Video"in Zm.Objects){let m=Zm.Objects.Video;for(let v in m){let y=m[v],x=parseInt(v);if(o[x]=y.RelativeFilename||y.Filename,"Content"in y){let C=y.Content instanceof ArrayBuffer&&y.Content.byteLength>0,w=typeof y.Content=="string"&&y.Content!=="";if(C||w){let A=this.parseImage(m[v]);f[y.RelativeFilename||y.Filename]=A}}}}for(let m in o){let v=o[m];f[v]!==void 0?o[m]=f[v]:o[m]=o[m].split("\\").pop()}return o}parseImage(o){let f=o.Content,m=o.RelativeFilename||o.Filename,v=m.slice(m.lastIndexOf(".")+1).toLowerCase(),y;switch(v){case"bmp":y="image/bmp";break;case"jpg":case"jpeg":y="image/jpeg";break;case"png":y="image/png";break;case"tif":y="image/tiff";break;case"tga":y="image/tga";break;default:console.warn('FBXLoader: Image type "'+v+'" is not supported.');return}if(typeof f=="string")return"data:"+y+";base64,"+f;{let x=new Uint8Array(f);return window.URL.createObjectURL(new Blob([x],{type:y}))}}parseTextures(o){let f=new Map;if("Texture"in Zm.Objects){let m=Zm.Objects.Texture;for(let v in m){let y=this.parseTexture(m[v],o);f.set(parseInt(v),y)}}return f}parseTexture(o,f){let m=this.loadTexture(o,f);m.ID=o.id,m.name=o.attrName;let v=o.WrapModeU,y=o.WrapModeV,x=v!==void 0?v.value:0,C=y!==void 0?y.value:0;if(m.wrapS=x===0?ha.REPEAT:ha.CLAMP_TO_EDGE,m.wrapT=C===0?ha.REPEAT:ha.CLAMP_TO_EDGE,"Scaling"in o){let w=o.Scaling.value;m.repeat={},m.repeat.x=w[0],m.repeat.y=w[1]}if("Translation"in o){let w=o.Translation.value;m.offset={},m.offset.x=w[0],m.offset.y=w[1]}return m}loadTexture(o,f){let m,v,y=jS.get(o.id).children;y!==void 0&&y.length>0&&f[y[0].ID]!==void 0&&(m=f[y[0].ID],m.indexOf("blob:")===0||m.indexOf("data:")===0?v=m:(v=o.RelativeFilename.replace(/\\/g,"/"),v=new URL(v,W6e).href));let x,C=o.FileName.slice(-3).toLowerCase();return C==="tga"||C==="psd"?console.warn("FBXLoader: PSD textures are not supported, creating placeholder texture for",o.RelativeFilename):(x={img:new Image},x.img.src=v),x}parseMaterials(o){let f=new Map;if("Material"in Zm.Objects){let m=Zm.Objects.Material;for(let v in m){let y=this.parseMaterial(m[v],o);y!==null&&f.set(parseInt(v),y)}}return f}parseMaterial(o,f){let m=o.id,v=o.attrName,y=o.ShadingModel;if(typeof y=="object"&&(y=y.value),!jS.has(m))return null;let x=this.parseParameters(o,f,m),C;switch(y.toLowerCase()){case"phong":C=new vW;break;case"lambert":C=new MeshLambertMaterial;break;default:console.warn('FBXLoader: unknown material type "%s". Defaulting to MeshPhongMaterial.',y),C=new vW;break}return C.setValues(x),C.name=v,C}parseParameters(o,f,m){let v={};if(o.BumpFactor&&(v.bumpScale=o.BumpFactor.value),o.Diffuse){let x=o.Diffuse.value;v.color=new Re(x[0],x[1],x[2])}else if(o.DiffuseColor&&(o.DiffuseColor.type==="Color"||o.DiffuseColor.type==="ColorRGB")){let x=o.DiffuseColor.value;v.color=new Re(x[0],x[1],x[2])}if(o.DisplacementFactor&&(v.displacementScale=o.DisplacementFactor.value),o.Emissive){let x=o.Emissive.value;v.emissive=new Re(x[0],x[1],x[2])}else o.EmissiveColor&&(o.EmissiveColor.type==="Color"||o.EmissiveColor.type==="ColorRGB")&&(v.emissive=new Re().fromArray(o.EmissiveColor.value).convertSRGBToLinear());if(o.EmissiveFactor&&(v.emissiveIntensity=parseFloat(o.EmissiveFactor.value)),o.Opacity&&(v.opacity=parseFloat(o.Opacity.value)),v.opacity<1&&(v.transparent=!0),o.ReflectionFactor&&(v.reflectivity=o.ReflectionFactor.value),o.Shininess&&(v.shininess=o.Shininess.value),o.Specular){let x=o.Specular.value;v.specular=new Re(x[0],x[1],x[2])}else o.SpecularColor&&o.SpecularColor.type;let y=this;return jS.get(m).children.forEach(function(x){let C=x.relationship;switch(C){case"Bump":v.bumpMap=y.getTexture(f,x.ID);break;case"Maya|TEX_ao_map":v.aoMap=y.getTexture(f,x.ID);break;case"DiffuseColor":case"Maya|TEX_color_map":v.map=y.getTexture(f,x.ID),v.map!==void 0&&(v.map.colorSpace="srgb");break;case"DisplacementColor":v.displacementMap=y.getTexture(f,x.ID);break;case"EmissiveColor":v.emissiveMap=y.getTexture(f,x.ID);break;case"NormalMap":case"Maya|TEX_normal_map":v.normalMap=y.getTexture(f,x.ID);break;case"ReflectionColor":v.envMap=y.getTexture(f,x.ID);break;case"SpecularColor":v.specularMap=y.getTexture(f,x.ID);break;case"TransparentColor":case"TransparencyFactor":v.alphaMap=y.getTexture(f,x.ID),v.transparent=!0;break;case"AmbientColor":case"ShininessExponent":case"SpecularFactor":case"VectorDisplacementColor":default:console.warn("FBXLoader: %s map is not supported in it, skipping texture.",C);break}}),v}getTexture(o,f){return"LayeredTexture"in Zm.Objects&&f in Zm.Objects.LayeredTexture&&(console.warn("FBXLoader: layered textures are not supported in it. Discarding all but first layer."),f=jS.get(f).children[0].ID),o.get(f)}parseDeformers(){let o={},f={};if("Deformer"in Zm.Objects){let m=Zm.Objects.Deformer;for(let v in m){let y=m[v],x=jS.get(parseInt(v));if(y.attrType==="Skin"){let C=this.parseSkeleton(x,m);C.ID=v,x.parents.length>1&&console.warn("FBXLoader: skeleton attached to more than one geometry is not supported."),C.geometryID=x.parents[0].ID,o[v]=C}else if(y.attrType==="BlendShape"){let C={id:v};C.rawTargets=this.parseMorphTargets(x,m),C.id=v,x.parents.length>1&&console.warn("FBXLoader: morph target attached to more than one geometry is not supported."),f[v]=C}}}return{skeletons:o,morphTargets:f}}parseSkeleton(o,f){let m=[];return o.children.forEach(function(v){let y=f[v.ID];if(y.attrType!=="Cluster")return;let x={ID:v.ID,indices:[],weights:[],transformLink:Ee.fromArray(y.TransformLink.a,new Ee)};"Indexes"in y&&(x.indices=y.Indexes.a,x.weights=y.Weights.a),m.push(x)}),{rawBones:m,bones:[]}}parseMorphTargets(o,f){let m=[];for(let v=0;v<o.children.length;v++){let y=o.children[v],x=f[y.ID],C={name:x.attrName,initialWeight:x.DeformPercent,id:x.id,fullWeights:x.FullWeights.a};if(x.attrType!=="BlendShapeChannel")return;C.geoID=jS.get(parseInt(y.ID)).children.filter(function(w){return w.relationship===void 0})[0].ID,m.push(C)}return m}parseScene(o,f,m){this.parseModels(o.skeletons,f,m).forEach(function(y){d$.scene.push(y)});let v=null;d$.animations=v}parseModels(o,f,m){let v=new Map,y=Zm.Objects.Model;for(let x in y){let C=parseInt(x),w=y[x],A=jS.get(C),E=null;if(!E){switch(w.attrType){case"Camera":E=this.createCamera(A);break;case"Light":E=null;break;case"Mesh":E=this.createMesh(A,f,m);break;case"NurbsCurve":E=this.createCurve(A,f);break;case"LimbNode":case"Root":E=new Bone;break;case"Null":default:E=w,w.userData={};break}E.name=w.attrName?w.attrName:"",E.userData.originalName=w.attrName,E.ID=C}this.getTransformData(E,w),v.set(C,E)}return v}buildSkeleton(o,f,m,v){let y=null;return o.parents.forEach(function(x){for(let C in f){let w=f[C];w.rawBones.forEach(function(A,E){if(A.ID===x.ID){let T=y;y=new Bone,y.matrixWorld.copy(A.transformLink),y.name=v?PropertyBinding.sanitizeNodeName(v):"",y.userData.originalName=v,y.ID=m,w.bones[E]=y,T!==null&&y.add(T)}})}}),y}createCamera(o){let f,m;if(o.children.forEach(function(v){let y=Zm.Objects.NodeAttribute[v.ID];y!==void 0&&(m=y)}),m===void 0)f=new Object3D;else{let v=0;m.CameraProjectionType!==void 0&&m.CameraProjectionType.value===1&&(v=1);let y=1;m.NearPlane!==void 0&&(y=m.NearPlane.value/1e3);let x=1e3;m.FarPlane!==void 0&&(x=m.FarPlane.value/1e3);let C=window.innerWidth,w=window.innerHeight;m.AspectWidth!==void 0&&m.AspectHeight!==void 0&&(C=m.AspectWidth.value,w=m.AspectHeight.value);let A=C/w,E=45;m.FieldOfView!==void 0&&(E=m.FieldOfView.value);let T=m.FocalLength?m.FocalLength.value:null;switch(v){case 0:f={type:"PerspectiveFrustum",fov:E,aspect:A,near:y,far:x,userData:{}},T!==null&&(f.focalLength=T);break;case 1:f=new OrthographicCamera(-C/2,C/2,w/2,-w/2,y,x);break;default:console.warn("FBXLoader: Unknown camera type "+v+"."),f=new Object3D;break}}return f}createMesh(o,f,m){let v,y=null,x=null,C=[];return o.children.forEach(function(w){f.has(w.ID)&&(y=f.get(w.ID)),m.has(w.ID)&&C.push(m.get(w.ID))}),C.length>1?x=C:C.length>0?x=C[0]:(x=new vW({name:"default_MeshPhongMaterial",color:Re.fromRgba("0xcccccc")}),C.push(x)),y.color&&C.forEach(function(w){w.vertexColors=!0}),y.FBX_Deformer||(y.material=x,v=y),v}createCurve(o,f){let m=o.children.reduce(function(y,x){return f.has(x.ID)&&(y=f.get(x.ID)),y},null),v=new LineBasicMaterial({name:Loader.DEFAULT_MATERIAL_NAME,color:3342591,linewidth:1});return new Line(m,v)}getTransformData(o,f){let m={};if("InheritType"in f&&(m.inheritType=parseInt(f.InheritType.value)),"RotationOrder"in f?m.eulerOrder=Cot(f.RotationOrder.value):m.eulerOrder="ZYX","Lcl_Translation"in f&&(m.translation=f.Lcl_Translation.value),"PreRotation"in f&&(m.preRotation=f.PreRotation.value),"Lcl_Rotation"in f&&(m.rotation=f.Lcl_Rotation.value),"PostRotation"in f&&(m.postRotation=f.PostRotation.value),"Lcl_Scaling"in f&&(m.scale=f.Lcl_Scaling.value),"ScalingOffset"in f&&(m.scalingOffset=f.ScalingOffset.value),"ScalingPivot"in f&&(m.scalingPivot=f.ScalingPivot.value),"RotationOffset"in f&&(m.rotationOffset=f.RotationOffset.value),"RotationPivot"in f&&(m.rotationPivot=f.RotationPivot.value),o.userData.transformData=m,m.scale&&o.positionBuffer)for(let v=0;v<o.positionBuffer.length;v=v+3)o.positionBuffer[v]*=m.scale[0],o.positionBuffer[v+1]*=m.scale[1],o.positionBuffer[v+2]*=m.scale[2];if(m.rotation&&o.positionBuffer)for(let v=0;v<o.positionBuffer.length;v=v+3){let y=bot(m,o.positionBuffer,v);o.positionBuffer[v]=y.x,o.positionBuffer[v+1]=y.y,o.positionBuffer[v+2]=y.z}}setLookAtProperties(o,f){"LookAtProperty"in f&&jS.get(o.ID).children.forEach(function(m){if(m.relationship==="LookAtProperty"){let v=Zm.Objects.Model[m.ID];if("Lcl_Translation"in v){let y=v.Lcl_Translation.value;o.target!==void 0?(o.target.position.fromArray(y),d$.add(o.target)):o.lookAt(new Vector3().fromArray(y))}}})}},RPi=class{constructor(){this.negativeMaterialIndices=!1}parse(o){let f=new Map;if("Geometry"in Zm.Objects){let m=Zm.Objects.Geometry;for(let v in m){let y=jS.get(parseInt(v)),x=this.parseGeometry(y,m[v],o);f.set(parseInt(v),x)}}return this.negativeMaterialIndices===!0&&console.warn("FBXLoader: The FBX file contains invalid (negative) material indices. The asset might not render as expected."),f}parseGeometry(o,f,m){switch(f.attrType){case"Mesh":return this.parseMeshGeometry(o,f,m);case"NurbsCurve":return this.parseNurbsGeometry(f)}}parseMeshGeometry(o,f,m){let v=m.skeletons,y=[],x=o.parents.map(function(T){return Zm.Objects.Model[T.ID]});if(x.length===0)return;let C=o.children.reduce(function(T,S){return v[S.ID]!==void 0&&(T=v[S.ID]),T},null);o.children.forEach(function(T){m.morphTargets[T.ID]!==void 0&&y.push(m.morphTargets[T.ID])});let w=x[0],A={};"RotationOrder"in w&&(A.eulerOrder=Cot(w.RotationOrder.value)),"InheritType"in w&&(A.inheritType=parseInt(w.InheritType.value)),"GeometricTranslation"in w&&(A.translation=w.GeometricTranslation.value),"GeometricRotation"in w&&(A.rotation=w.GeometricRotation.value),"GeometricScaling"in w&&(A.scale=w.GeometricScaling.value);let E=A;return this.genGeometry(f,C,y,E)}genGeometry(o,f,m,v){let y=this.parseGeoNode(o,f),x=this.genBuffers(y),C=new MPe;o.attrName&&(C.name=o.attrName);let w=new Float32Array(x.vertex);if(v&&v.rotation){let A=w.length;for(let E=0;E<A;E+=3){let T=bot(v,w,E);w[E]=T.x,w[E+1]=T.y,w[E+2]=T.z}C.setAttribute("preTransform",v)}if(v&&v.translation){let A=w.length,E=v.translation[0],T=v.translation[1],S=v.translation[2];for(let M=0;M<A;M+=3)w[M]=w[M]+E,w[M+1]=w[M+1]+T,w[M+2]=w[M+2]+S;C.setAttribute("preTransform",v)}if(C.setAttribute("position",w),x.colors.length>0&&C.setAttribute("color",new Float32Array(x.colors)),f&&(C.setAttribute("skinIndex",new Uint16Array(x.weightsIndices)),C.setAttribute("skinWeight",new Float32Array(x.vertexWeights)),C.FBX_Deformer=f),x.normal.length>0){let A=new Float32Array(x.normal);C.setAttribute("normal",A)}if(x.uvs.forEach(function(A,E){C.uvs.push(new Float32Array(x.uvs[E]))}),y.material&&y.material.mappingType!=="AllSame"){let A=x.materialIndex[0],E=0;if(x.materialIndex.forEach(function(T,S){T!==A&&(C.addGroup(E,S-E,A),A=T,E=S)}),C.groups.length>0){let T=C.groups[C.groups.length-1],S=T[0]+T[1];S!==x.materialIndex.length&&C.addGroup(S,x.materialIndex.length-S,A)}C.groups.length===0&&C.addGroup(0,x.materialIndex.length,x.materialIndex[0])}return C}parseGeoNode(o,f){let m={};if(m.vertexPositions=o.Vertices!==void 0?o.Vertices.a:[],m.vertexIndices=o.PolygonVertexIndex!==void 0?o.PolygonVertexIndex.a:[],o.LayerElementColor&&(m.color=this.parseVertexColors(o.LayerElementColor[0])),o.LayerElementMaterial&&(m.material=this.parseMaterialIndices(o.LayerElementMaterial[0])),o.LayerElementNormal&&(m.normal=this.parseNormals(o.LayerElementNormal[0])),o.LayerElementUV){m.uv=[];let v=0;for(;o.LayerElementUV[v];)o.LayerElementUV[v].UV&&m.uv.push(this.parseUVs(o.LayerElementUV[v])),v++}return m.weightTable={},f!==null&&(m.skeleton=f,f.rawBones.forEach(function(v,y){v.indices.forEach(function(x,C){m.weightTable[x]===void 0&&(m.weightTable[x]=[]),m.weightTable[x].push({id:y,weight:v.weights[C]})})})),m}genBuffers(o){let f={vertex:[],normal:[],colors:[],uvs:[],materialIndex:[],vertexWeights:[],weightsIndices:[]},m=0,v=0,y=!1,x=[],C=[],w=[],A=[],E=[],T=[],S=this;return o.vertexIndices.forEach(function(M,I){let P,D=!1;M<0&&(M=M^-1,D=!0);let L=[],R=[];if(x.push(M*3,M*3+1,M*3+2),o.color){let O=f$(I,m,M,o.color);w.push(O[0],O[1],O[2])}if(o.skeleton){if(o.weightTable[M]!==void 0&&o.weightTable[M].forEach(function(O){R.push(O.weight),L.push(O.id)}),R.length>4){y||(console.warn("FBXLoader: Vertex has more than 4 skinning weights assigned to vertex. Deleting additional weights."),y=!0);let O=[0,0,0,0],F=[0,0,0,0];R.forEach(function(k,U){let G=k,j=L[U];F.forEach(function(q,J,X){if(G>q){X[J]=G,G=q;let Y=O[J];O[J]=j,j=Y}})}),L=O,R=F}for(;R.length<4;)R.push(0),L.push(0);for(let O=0;O<4;++O)E.push(R[O]),T.push(L[O])}if(o.normal){let O=f$(I,m,M,o.normal);C.push(O[0],O[1],O[2])}o.material&&o.material.mappingType!=="AllSame"&&(P=f$(I,m,M,o.material)[0],P<0&&(S.negativeMaterialIndices=!0,P=0)),o.uv&&o.uv.forEach(function(O,F){let k=f$(I,m,M,O);A[F]===void 0&&(A[F]=[]),A[F].push(k[0]),A[F].push(k[1])}),v++,D&&(v>4&&console.warn("FBXLoader: Polygons with more than four sides are not supported. Make sure to triangulate the geometry during export."),S.genFace(f,o,x,P,C,w,A,E,T,v),m++,v=0,x=[],C=[],w=[],A=[],E=[],T=[])}),f}genFace(o,f,m,v,y,x,C,w,A,E){for(let T=2;T<E;T++)o.vertex.push(f.vertexPositions[m[0]]),o.vertex.push(f.vertexPositions[m[1]]),o.vertex.push(f.vertexPositions[m[2]]),o.vertex.push(f.vertexPositions[m[(T-1)*3]]),o.vertex.push(f.vertexPositions[m[(T-1)*3+1]]),o.vertex.push(f.vertexPositions[m[(T-1)*3+2]]),o.vertex.push(f.vertexPositions[m[T*3]]),o.vertex.push(f.vertexPositions[m[T*3+1]]),o.vertex.push(f.vertexPositions[m[T*3+2]]),f.skeleton&&(o.vertexWeights.push(w[0]),o.vertexWeights.push(w[1]),o.vertexWeights.push(w[2]),o.vertexWeights.push(w[3]),o.vertexWeights.push(w[(T-1)*4]),o.vertexWeights.push(w[(T-1)*4+1]),o.vertexWeights.push(w[(T-1)*4+2]),o.vertexWeights.push(w[(T-1)*4+3]),o.vertexWeights.push(w[T*4]),o.vertexWeights.push(w[T*4+1]),o.vertexWeights.push(w[T*4+2]),o.vertexWeights.push(w[T*4+3]),o.weightsIndices.push(A[0]),o.weightsIndices.push(A[1]),o.weightsIndices.push(A[2]),o.weightsIndices.push(A[3]),o.weightsIndices.push(A[(T-1)*4]),o.weightsIndices.push(A[(T-1)*4+1]),o.weightsIndices.push(A[(T-1)*4+2]),o.weightsIndices.push(A[(T-1)*4+3]),o.weightsIndices.push(A[T*4]),o.weightsIndices.push(A[T*4+1]),o.weightsIndices.push(A[T*4+2]),o.weightsIndices.push(A[T*4+3])),f.color&&(o.colors.push(x[0]),o.colors.push(x[1]),o.colors.push(x[2]),o.colors.push(x[(T-1)*3]),o.colors.push(x[(T-1)*3+1]),o.colors.push(x[(T-1)*3+2]),o.colors.push(x[T*3]),o.colors.push(x[T*3+1]),o.colors.push(x[T*3+2])),f.material&&f.material.mappingType!=="AllSame"&&(o.materialIndex.push(v),o.materialIndex.push(v),o.materialIndex.push(v)),f.normal&&(o.normal.push(y[0]),o.normal.push(y[1]),o.normal.push(y[2]),o.normal.push(y[(T-1)*3]),o.normal.push(y[(T-1)*3+1]),o.normal.push(y[(T-1)*3+2]),o.normal.push(y[T*3]),o.normal.push(y[T*3+1]),o.normal.push(y[T*3+2])),f.uv&&f.uv.forEach(function(S,M){o.uvs[M]===void 0&&(o.uvs[M]=[]),o.uvs[M].push(C[M][0]),o.uvs[M].push(C[M][1]),o.uvs[M].push(C[M][(T-1)*2]),o.uvs[M].push(C[M][(T-1)*2+1]),o.uvs[M].push(C[M][T*2]),o.uvs[M].push(C[M][T*2+1])})}addMorphTargets(o,f,m,v){if(m.length===0)return;o.morphTargetsRelative=!0,o.morphAttributes.position=[];let y=this;m.forEach(function(x){x.rawTargets.forEach(function(C){let w=Zm.Objects.Geometry[C.geoID];w!==void 0&&y.genMorphGeometry(o,f,w,v,C.name)})})}genMorphGeometry(o,f,m,v,y){let x=f.PolygonVertexIndex!==void 0?f.PolygonVertexIndex.a:[],C=m.Vertices!==void 0?m.Vertices.a:[],w=m.Indexes!==void 0?m.Indexes.a:[],A=o.attributes.position.count*3,E=new Float32Array(A);for(let I=0;I<w.length;I++){let P=w[I]*3;E[P]=C[I*3],E[P+1]=C[I*3+1],E[P+2]=C[I*3+2]}let T={vertexIndices:x,vertexPositions:E},S=this.genBuffers(T),M=new Float32Array(S.vertex);M.name=y||m.attrName,M.applyMatrix4(v),o.morphAttributes.position.push(M)}parseNormals(o){let f=o.MappingInformationType,m=o.ReferenceInformationType,v=o.Normals.a,y=[];return m==="IndexToDirect"&&("NormalIndex"in o?y=o.NormalIndex.a:"NormalsIndex"in o&&(y=o.NormalsIndex.a)),{dataSize:3,buffer:v,indices:y,mappingType:f,referenceType:m}}parseUVs(o){let f=o.MappingInformationType,m=o.ReferenceInformationType,v=o.UV.a,y=[];return m==="IndexToDirect"&&(y=o.UVIndex.a),{dataSize:2,buffer:v,indices:y,mappingType:f,referenceType:m}}parseVertexColors(o){let f=o.MappingInformationType,m=o.ReferenceInformationType,v=o.Colors.a,y=[];return m==="IndexToDirect"&&(y=o.ColorIndex.a),{dataSize:4,buffer:v,indices:y,mappingType:f,referenceType:m}}parseMaterialIndices(o){let f=o.MappingInformationType,m=o.ReferenceInformationType;if(f==="NoMappingInformation")return{dataSize:1,buffer:[0],indices:[0],mappingType:"AllSame",referenceType:m};let v=o.Materials.a,y=[];for(let x=0;x<v.length;++x)y.push(x);return{dataSize:1,buffer:v,indices:y,mappingType:f,referenceType:m}}parseNurbsGeometry(o){let f=parseInt(o.Order);if(isNaN(f))return console.error("FBXLoader: Invalid Order %s given for geometry ID: %s",o.Order,o.id),new BufferGeometry;let m=f-1,v=o.KnotVector.a,y=[],x=o.Points.a;for(let E=0,T=x.length;E<T;E+=4)y.push(new Vector4().fromArray(x,E));let C,w;if(o.Form==="Closed")y.push(y[0]);else if(o.Form==="Periodic"){C=m,w=v.length-1-C;for(let E=0;E<m;++E)y.push(y[E])}let A=new NURBSCurve(m,v,y,C,w).getPoints(y.length*12);return new BufferGeometry().setFromPoints(A)}},OPi=[];function f$(o,f,m,v){let y;switch(v.mappingType){case"ByPolygonVertex":y=o;break;case"ByPolygon":y=f;break;case"ByVertice":y=m;break;case"AllSame":y=v.indices[0];break;default:console.warn("FBXLoader: unknown attribute mapping type "+v.mappingType)}v.referenceType==="IndexToDirect"&&(y=v.indices[y]);let x=y*v.dataSize,C=x+v.dataSize;return NPi(OPi,v.buffer,x,C)}function Cot(o){o=o||0;let f=["ZYX","YZX","XZY","ZXY","YXZ","XYZ"];return o===6?(console.warn("FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect."),f[0]):f[o]}function NPi(o,f,m,v){for(let y=m,x=0;y<v;y++,x++)o[x]=f[y];return o}function bot(o,f,m){let v=new H(0,0,0),y=Z(o.rotation,[0,0,0]);f&&(v=new H(f[m],f[m+1],f[m+2]));let x=xe.toRadians(y[0]),C=xe.toRadians(y[1]),w=xe.toRadians(y[2]),A=Ee.fromTranslation(new H(0,0,0)),E=Ee.fromRotationTranslation(Ut.fromRotationX(x));A=Ee.multiply(E,A,new Ee);let T=Ee.fromRotationTranslation(Ut.fromRotationY(C));A=Ee.multiply(T,A,new Ee);let S=Ee.fromRotationTranslation(Ut.fromRotationZ(w));return A=Ee.multiply(S,A,new Ee),Ee.multiplyByPoint(A,v,new H)}var DPe=LPi,Lpe,FPi=class{constructor(){this.successLoad=null}load(o,f,m,v){this._url=o;let y=this;this.successLoad=f,Jr.fetchArrayBuffer({url:o}).then(x=>{this.path=o,y.parse(x,o)})}parse(o,f){if(VPi(o))Lpe=new BPi().parse(o);else{let v=Aot(o);if(!zPi(v))throw new Error(".FBXLoader: Unknown format.");if(Y6e(v)<7e3)throw new Error(".FBXLoader: FBX version not supported, FileVersion: "+Y6e(v));Lpe=new kPi().parse(v)}let m=new DPe().parse(Lpe,this._url);return this.successLoad(m),m}},wot=class{add(o,f){this[o]=f}},BPi=class{parse(o){let f=new j6e(o);f.skip(23);let m=f.getUint32();if(m<6400)throw new Error(".FBXLoader: FBX version not supported, FileVersion: "+m);let v=new wot;for(;!this.endOfContent(f);){let y=this.parseNode(f,m);y!==null&&v.add(y.name,y)}return v}endOfContent(o){return o.size()%16===0?(o.getOffset()+160+16&-16)>=o.size():o.getOffset()+160+16>=o.size()}parseNode(o,f){let m={},v=f>=7500?o.getUint64():o.getUint32(),y=f>=7500?o.getUint64():o.getUint32();f>=7500?o.getUint64():o.getUint32();let x=o.getUint8(),C=o.getString(x);if(v===0)return null;let w=[];for(let S=0;S<y;S++)w.push(this.parseProperty(o));let A=w.length>0?w[0]:"",E=w.length>1?w[1]:"",T=w.length>2?w[2]:"";for(m.singleProperty=y===1&&o.getOffset()===v;v>o.getOffset();){let S=this.parseNode(o,f);S!==null&&this.parseSubNode(C,m,S)}return m.propertyList=w,typeof A=="number"&&(m.id=A),E!==""&&(m.attrName=E),T!==""&&(m.attrType=T),C!==""&&(m.name=C),m}parseSubNode(o,f,m){if(m.singleProperty===!0){let v=m.propertyList[0];Array.isArray(v)?(f[m.name]=m,m.a=v):f[m.name]=v}else if(o==="Connections"&&m.name==="C"){let v=[];m.propertyList.forEach(function(y,x){x!==0&&v.push(y)}),f.connections===void 0&&(f.connections=[]),f.connections.push(v)}else if(m.name==="Properties70")Object.keys(m).forEach(function(v){f[v]=m[v]});else if(o==="Properties70"&&m.name==="P"){let v=m.propertyList[0],y=m.propertyList[1],x=m.propertyList[2],C=m.propertyList[3],w;v.indexOf("Lcl ")===0&&(v=v.replace("Lcl ","Lcl_")),y.indexOf("Lcl ")===0&&(y=y.replace("Lcl ","Lcl_")),y==="Color"||y==="ColorRGB"||y==="Vector"||y==="Vector3D"||y.indexOf("Lcl_")===0?w=[m.propertyList[4],m.propertyList[5],m.propertyList[6]]:w=m.propertyList[4],f[v]={type:y,type2:x,flag:C,value:w}}else f[m.name]===void 0?typeof m.id=="number"?(f[m.name]={},f[m.name][m.id]=m):f[m.name]=m:m.name==="PoseNode"?(Array.isArray(f[m.name])||(f[m.name]=[f[m.name]]),f[m.name].push(m)):f[m.name][m.id]===void 0&&(f[m.name][m.id]=m)}parseProperty(o){let f=o.getString(1),m;switch(f){case"C":return o.getBoolean();case"D":return o.getFloat64();case"F":return o.getFloat32();case"I":return o.getInt32();case"L":return o.getInt64();case"R":return m=o.getUint32(),o.getArrayBuffer(m);case"S":return m=o.getUint32(),o.getString(m);case"Y":return o.getInt16();case"b":case"c":case"d":case"f":case"i":case"l":let v=o.getUint32(),y=o.getUint32(),x=o.getUint32();if(y===0)switch(f){case"b":case"c":return o.getBooleanArray(v);case"d":return o.getFloat64Array(v);case"f":return o.getFloat32Array(v);case"i":return o.getInt32Array(v);case"l":return o.getInt64Array(v)}let C=IPe(new Uint8Array(o.getArrayBuffer(x))),w=new j6e(C.buffer);switch(f){case"b":case"c":return w.getBooleanArray(v);case"d":return w.getFloat64Array(v);case"f":return w.getFloat32Array(v);case"i":return w.getInt32Array(v);case"l":return w.getInt64Array(v)}break;default:throw new Error(".FBXLoader: Unknown property type "+f)}}},j6e=class{constructor(o,f){this.dv=new DataView(o),this.offset=0,this.littleEndian=f!==void 0?f:!0,this._textDecoder=new TextDecoder}getOffset(){return this.offset}size(){return this.dv.buffer.byteLength}skip(o){this.offset+=o}getBoolean(){return(this.getUint8()&1)===1}getBooleanArray(o){let f=[];for(let m=0;m<o;m++)f.push(this.getBoolean());return f}getUint8(){let o=this.dv.getUint8(this.offset);return this.offset+=1,o}getInt16(){let o=this.dv.getInt16(this.offset,this.littleEndian);return this.offset+=2,o}getInt32(){let o=this.dv.getInt32(this.offset,this.littleEndian);return this.offset+=4,o}getInt32Array(o){let f=[];for(let m=0;m<o;m++)f.push(this.getInt32());return f}getUint32(){let o=this.dv.getUint32(this.offset,this.littleEndian);return this.offset+=4,o}getInt64(){let o,f;return this.littleEndian?(o=this.getUint32(),f=this.getUint32()):(f=this.getUint32(),o=this.getUint32()),f&2147483648?(f=~f&4294967295,o=~o&4294967295,o===4294967295&&(f=f+1&4294967295),o=o+1&4294967295,-(f*4294967296+o)):f*4294967296+o}getInt64Array(o){let f=[];for(let m=0;m<o;m++)f.push(this.getInt64());return f}getUint64(){let o,f;return this.littleEndian?(o=this.getUint32(),f=this.getUint32()):(f=this.getUint32(),o=this.getUint32()),f*4294967296+o}getFloat32(){let o=this.dv.getFloat32(this.offset,this.littleEndian);return this.offset+=4,o}getFloat32Array(o){let f=[];for(let m=0;m<o;m++)f.push(this.getFloat32());return f}getFloat64(){let o=this.dv.getFloat64(this.offset,this.littleEndian);return this.offset+=8,o}getFloat64Array(o){let f=[];for(let m=0;m<o;m++)f.push(this.getFloat64());return f}getArrayBuffer(o){let f=this.dv.buffer.slice(this.offset,this.offset+o);return this.offset+=o,f}getString(o){let f=this.offset,m=new Uint8Array(this.dv.buffer,f,o);this.skip(o);let v=m.indexOf(0);return v>=0&&(m=new Uint8Array(this.dv.buffer,f,v)),this._textDecoder.decode(m)}},kPi=class{getPrevNode(){return this.nodeStack[this.currentIndent-2]}getCurrentNode(){return this.nodeStack[this.currentIndent-1]}getCurrentProp(){return this.currentProp}pushStack(o){this.nodeStack.push(o),this.currentIndent+=1}popStack(){this.nodeStack.pop(),this.currentIndent-=1}setCurrentProp(o,f){this.currentProp=o,this.currentPropName=f}parse(o){this.currentIndent=0,this.allNodes=new wot,this.nodeStack=[],this.currentProp=[],this.currentPropName="";let f=this,m=o.split(/[\r\n]+/);return m.forEach(function(v,y){let x=v.match(/^[\s\t]*;/),C=v.match(/^[\s\t]*$/);if(x||C)return;let w=v.match("^\\t{"+f.currentIndent+"}(\\w+):(.*){",""),A=v.match("^\\t{"+f.currentIndent+"}(\\w+):[\\s\\t\\r\\n](.*)"),E=v.match("^\\t{"+(f.currentIndent-1)+"}}");w?f.parseNodeBegin(v,w):A?f.parseNodeProperty(v,A,m[++y]):E?f.popStack():v.match(/^[^\s\t}]/)&&f.parseNodePropertyContinued(v)}),this.allNodes}parseNodeBegin(o,f){let m=f[1].trim().replace(/^"/,"").replace(/"$/,""),v=f[2].split(",").map(function(w){return w.trim().replace(/^"/,"").replace(/"$/,"")}),y={name:m},x=this.parseNodeAttr(v),C=this.getCurrentNode();this.currentIndent===0?this.allNodes.add(m,y):m in C?(m==="PoseNode"?C.PoseNode.push(y):C[m].id!==void 0&&(C[m]={},C[m][C[m].id]=C[m]),x.id!==""&&(C[m][x.id]=y)):typeof x.id=="number"?(C[m]={},C[m][x.id]=y):m!=="Properties70"&&(m==="PoseNode"?C[m]=[y]:C[m]=y),typeof x.id=="number"&&(y.id=x.id),x.name!==""&&(y.attrName=x.name),x.type!==""&&(y.attrType=x.type),this.pushStack(y)}parseNodeAttr(o){let f=o[0];o[0]!==""&&(f=parseInt(o[0]),isNaN(f)&&(f=o[0]));let m="",v="";return o.length>1&&(m=o[1].replace(/^(\w+)::/,""),v=o[2]),{id:f,name:m,type:v}}parseNodeProperty(o,f,m){let v=f[1].replace(/^"/,"").replace(/"$/,"").trim(),y=f[2].replace(/^"/,"").replace(/"$/,"").trim();v==="Content"&&y===","&&(y=m.replace(/"/g,"").replace(/,$/,"").trim());let x=this.getCurrentNode();if(x.name==="Properties70"){this.parseNodeSpecialProperty(o,v,y);return}if(v==="C"){let C=y.split(",").slice(1),w=parseInt(C[0]),A=parseInt(C[1]),E=y.split(",").slice(3);E=E.map(function(T){return T.trim().replace(/^"/,"")}),v="connections",y=[w,A],append(y,E),x[v]===void 0&&(x[v]=[])}v==="Node"&&(x.id=y),v in x&&Array.isArray(x[v])?x[v].push(y):v!=="a"?x[v]=y:x.a=y,this.setCurrentProp(x,v),v==="a"&&y.slice(-1)!==","&&(x.a=Rpe(y))}parseNodePropertyContinued(o){let f=this.getCurrentNode();f.a+=o,o.slice(-1)!==","&&(f.a=Rpe(f.a))}parseNodeSpecialProperty(o,f,m){let v=m.split('",').map(function(E){return E.trim().replace(/^\"/,"").replace(/\s/,"_")}),y=v[0],x=v[1],C=v[2],w=v[3],A=v[4];switch(x){case"int":case"enum":case"bool":case"ULongLong":case"double":case"Number":case"FieldOfView":A=parseFloat(A);break;case"Color":case"ColorRGB":case"Vector3D":case"Lcl_Translation":case"Lcl_Rotation":case"Lcl_Scaling":A=Rpe(A);break}this.getPrevNode()[y]={type:x,type2:C,flag:w,value:A},this.setCurrentProp(this.getPrevNode(),y)}};function VPi(o){let f="Kaydara FBX Binary \0";return o.byteLength>=f.length&&f===Aot(o,0,f.length)}function zPi(o){let f=["K","a","y","d","a","r","a","\\","F","B","X","\\","B","i","n","a","r","y","\\","\\"],m=0;function v(y){let x=o[y-1];return o=o.slice(m+y),m++,x}for(let y=0;y<f.length;++y)if(v(1)===f[y])return!1;return!0}function Y6e(o){let f=/FBXVersion: (\d+)/,m=o.match(f);if(m)return parseInt(m[1]);throw new Error(".FBXLoader: Cannot find the version number for the file given.")}function Rpe(o){return o.split(",").map(function(f){return parseFloat(f)})}function Aot(o,f,m){return f===void 0&&(f=0),m===void 0&&(m=o.byteLength),new TextDecoder().decode(new Uint8Array(o,f,m))}var LPe=FPi,q6e=function(o,f,m,v,y){m.loadContext||(m.loadContext=!0,m.loadPickId(o.context),m.loadingMap(o.context));let x={"objMaterial.diffuse"(){return y.color},"objMaterial.specular"(){return y.specular},"objMaterial.shininess"(){return y.shininess},"objMaterial.emissive"(){return y.emissive},"objMaterial.alpha"(){return y.opacity},diffuseMap(){return y.texture.mapTexture},diffuseMapRepeat(){return y.texture.mapTexturerepeat},diffuseMapOffset(){return y.texture.mapTextureoffset},specularMap(){return y.texture.specularTexture},specularMapRepeat(){return y.texture.specularTexturerepeat},specularMapOffset(){return y.texture.specularTextureoffset},bumpMap(){return y.texture.bumpTexture},bumpMapRepeat(){return y.texture.bumpTexturerepeat},bumpMapOffset(){return y.texture.bumpTextureoffset},emissiveMap(){return y.texture.emissiveTexture},emissiveMapRepeat(){return y.texture.emissiveTexturerepeat},emissiveMapOffset(){return y.texture.emissiveTextureoffset},alphaMap(){return y.texture.alphaTexture},alphaMapRepeat(){return y.texture.alphaTexturerepeat},alphaMapOffset(){return y.texture.alphaTextureoffset},ambientColor(){return f._ambientColor},lightDir(){return f._realTimeLighting?o.context.uniformState.sunPositionWC:f._lightDirection},lightColor(){return new Re(1,1,1,1)},viewDir(){return o.context.uniformState._cameraDirection},czm_pickId(){return m.pickId.color},color(){return new Re(1,1,1,1)}},C=Ao.createVertexBuffer({usage:gn.STATIC_DRAW,typedArray:v.positionBuffer,context:o.context}),w=Ao.createVertexBuffer({usage:gn.STATIC_DRAW,typedArray:v.normal,context:o.context}),A=Ao.createVertexBuffer({usage:gn.STATIC_DRAW,typedArray:v.uvs[0],context:o.context}),E=new Du({context:o.context,attributes:[{index:0,enabled:!0,vertexBuffer:C,componentsPerAttribute:3,normalize:!0,componentDatatype:Rt.FLOAT},{index:1,enabled:!0,vertexBuffer:w,componentsPerAttribute:3,componentDatatype:Rt.FLOAT},{index:2,enabled:!0,componentDatatype:Rt.FLOAT,componentsPerAttribute:2,vertexBuffer:A}]}),T=` layout(location = 0) in vec3 inPosition; layout(location = 1) in vec3 inNormal; layout(location = 2) in vec2 inTexCoord; out vec3 fragPosition; out vec2 fragTexCoord; out vec3 fragNormal; void main() { fragTexCoord = inTexCoord; fragPosition = vec3(czm_model * vec4(inPosition, 1.0)); gl_Position = czm_projection * czm_modelView * vec4( inPosition , 1.0 ); fragNormal = mat3( transpose( inverse(czm_model) ) ) * inNormal; }`,S=Rs.fromCache({context:o.context,vertexShaderSource:T,fragmentShaderSource:y.fragmentShaderText,attributeLocations:{position:0,normal:1,uv:2}}),M=Mn.fromCache({depthTest:{enabled:!0}}),I=vr.OPAQUE;return y&&y.transparent&&(I=vr.TRANSLUCENT),new Jn({modelMatrix:m.model.modelMatrix,vertexArray:E,shaderProgram:S,uniformMap:x,renderState:M,pass:I,receiveShadows:m.model.receiveShadows,castShadows:m.model.castShadows,pickId:"czm_pickId",boundingVolume:m.model.boundingSphere})},Eot=class{constructor(o,f){this._viewer=f.viewer,this._render=[],this._id=Z(f.id,zl()),this._url=f.url,this._type="fbx",this._originPosition=f.originPosition,this._modelMatrix=null,this._loadFBX=!1,this._fbx=null,this._scale=Z(f.scale,1),this._heading=Z(f.heading,0),this._pitch=Z(f.pitch,0),this._roll=Z(f.roll,0),this._ambientColor=Z(f.ambientColor,new Re(.2,.2,.2,1)),this._sunlightIntensity=1,this._lightDirection=Z(f.lightDirection,new H(-1,.5,1)),this._realTimeLighting=Z(f.realTimeLighting,!1),this._show=Z(f.show,!0),this._raytrace=Z(f.raytrace,!0),this._castShadows=Z(f.castShadows,!1),this._receiveShadows=Z(f.receiveShadows,!1),this._selectColor=new Re(1,1,1,1),this._callback=f.callback,this.initialize()}update(o){if(this._show&&this._loadFBX)for(let f=0;f<this._render.length;f++){let m=this._render[f];if(m.model.groups.length>0)for(let v=0;v<m.model.modelGroups.length;v++){let y=m.model.modelGroups[v],x=q6e(o,this,m,y,m.model.material[y.materialIndex]);o.commandList.push(x)}else{let v=q6e(o,this,m,m.model,m.model.material);o.commandList.push(v)}}}destroy(){this._loadFBX=!1;for(let o=0;o<this._render.length;o++)this._render[o].pickId&&(this._render[o].pickId.destroy(),this._render[o].pickId=null),this._render[o]=null;this._fbx=null}initialize(){let o=this;if(!this._url||!this._originPosition)return;let f=new dl(xe.toRadians(this._heading),xe.toRadians(this._pitch),xe.toRadians(this._roll));if(this._modelMatrix=tn.headingPitchRollToFixedFrame(this._originPosition,f),this._modelMatrix=Ee.multiplyByScale(this._modelMatrix,new H(this._scale,this._scale,this._scale),this._modelMatrix),this._fullURL=new URL(this._url,window.location.href),this._fullURL.href){let m=function(v){o._fbx=v;for(let y=0;y<v.scene.length;y++)if(v.scene[y].type&&v.scene[y].type=="mesh"){let x=new PPe(v.scene[y],o,y).parse();o._render.push(x)}o._loadFBX=!0,o._callback&&typeof o._callback&&o._callback(o)};new LPe().load(this._fullURL.href,m)}}};Object.defineProperties(Eot.prototype,{show:{get:function(){return this._show},set:function(o){this._show=o}}});var mae=Eot,HPi=class{constructor(){this._type="mtl"}load(o,f,m,v,y){let x=this;return this.name=o,this.onLoad=m,this.onProgress=v,new Promise((C,w)=>{Jr.fetch({url:f}).then(A=>{let E=x.parse(A,f);C(E)}).catch(A=>{w("MTLLoaderERROR",A),console.log("MTLLoaderERROR:",A)})})}parse(o,f){let m=o.split(` `),v={},y=/\s+/,x={};for(let w=0;w<m.length;w++){let A=m[w];if(A=A.trim(),A.length===0||A.charAt(0)==="#")continue;let E=A.indexOf(" "),T=E>=0?A.substring(0,E):A;T=T.toLowerCase();let S=E>=0?A.substring(E+1):"";if(S=S.trim(),T==="newmtl")v={name:S},x[S]=v;else if(T==="ka"||T==="kd"||T==="ks"||T==="ke"){let M=S.split(y,3);v[T]=[parseFloat(M[0]),parseFloat(M[1]),parseFloat(M[2])]}else v[T]=S}let C=new UPi(f,this.materialOptions,this.name);return C.setMaterials(x),C.preload()}},UPi=class{constructor(o="",f={},m){this.name=m,this.baseUrl=o,this.options=f,this.materialsInfo={},this.materials={},this.crossOrigin="anonymous",this.side=this.options.side!==void 0?this.options.side:"FrontSide"}setMaterials(o){this.materialsInfo=o,this.materials={}}preload(){for(let f in this.materialsInfo)this.create(f);let o={};return o[this.name]=this.materials,o}create(o){return this.materials[o]===void 0&&this.createMaterial_(o),this.materials[o]}createMaterial_(o){let f=this,m=this.materialsInfo[o],v={name:o,side:this.side,transparent:!1};function y(C,w){if(typeof w!="string"||w==="")return"";try{return new URL(w),w}catch{return new URL(w,C).href.replace(/\\/g,"/")}}function x(C,w){if(v[C])return;let A=f.getTextureParams(w,v),E=f.loadTexture(y(f.baseUrl,A.url));v[C+"offset"]=A.offset,v[C+"scale"]=A.scale,v[C]=E}for(let C in m){let w=m[C],A;if(w!=="")switch(C.toLowerCase()){case"kd":v.color=new H(w[0],w[1],w[2]);break;case"ks":v.specular=new H(w[0],w[1],w[2]);break;case"ke":v.emissive=new H(w[0],w[1],w[2]);break;case"map_kd":x("diffuse",w);break;case"map_ks":x("specularMap",w);break;case"map_ke":x("emissiveMap",w);break;case"norm":x("normalMap",w);break;case"map_bump":case"bump":x("bumpMap",w);break;case"map_d":x("alphaMap",w),v.transparent=!0;break;case"ns":v.shininess=parseFloat(w);break;case"map_ns":x("shininessMap",w);break;case"d":A=parseFloat(w),A<1&&(v.opacity=A,v.transparent=!0);break;case"tr":A=parseFloat(w),this.options&&this.options.invertTrProperty&&(A=1-A),A>0&&(v.opacity=1-A,v.transparent=!0);break;default:break}}return this.materials[o]=v,this.materials[o].loadMap=!1,this.materials[o]}getTextureParams(o,f){let m={scale:new Ye(1,1),offset:new Ye(0,0)},v=o.split(/\s+/),y;return y=v.indexOf("-bm"),y>=0&&(f.bumpScale=parseFloat(v[y+1]),v.splice(y,2)),y=v.indexOf("-s"),y>=0&&(m.scale=new Ye(parseFloat(v[y+1]),parseFloat(v[y+2])),v.splice(y,4)),y=v.indexOf("-o"),y>=0&&(m.offset=new Ye(parseFloat(v[y+1]),parseFloat(v[y+2])),v.splice(y,4)),m.url=v.join(" ").trim(),m}loadTexture(o,f,m,v,y){let x=new Image;return x.src=o,x}},RPe=HPi,GPi=` #define USE_PICKING; in vec2 fragTexCoord; // \u6A21\u578B\u7EB9\u7406 in vec3 fragNormal; // \u6A21\u578B\u6CD5\u7EBF in vec3 fragPosition; // \u6A21\u578B\u9876\u70B9 uniform vec3 cameraPos; uniform mat4 inverseMatrix; uniform vec4 czm_pickColor; in vec4 v_pickColor; uniform vec3 pickColor; uniform vec4 batchId; struct Material{ vec3 diffuse; //\u6F2B\u53CD\u5C04 vec3 specular; //\u53CD\u5C04\u8272 vec3 emissive; //\u81EA\u53D1\u5149 float shininess; //\u5149\u6CFD\u5EA6 float alpha; }; uniform Material objMaterial; //\u57FA\u7840\u6750\u8D28 uniform sampler2D diffuseMap; //\u6F2B\u53CD\u5C04\u8D34\u56FE uniform vec2 diffuseMapScale; uniform vec2 diffuseMapOffset; uniform sampler2D specularMap; //\u53CD\u5C04\u8272\u8D34\u56FE uniform vec2 specularMapScale; uniform vec2 specularMapOffset; uniform sampler2D shininessMap; //\u53CD\u5C04\u7387\u8D34\u56FE uniform vec2 shininessMapScale; uniform vec2 shininessMapOffset; uniform sampler2D bumpMap; //\u6CD5\u7EBF\u8D34\u56FE uniform vec2 bumpMapScale; uniform vec2 bumpMapOffset; uniform sampler2D alphaMap; //\u900F\u660E\u8D34\u56FE uniform vec2 alphaMapScale; uniform vec2 alphaMapOffset; uniform sampler2D emissiveMap; //\u81EA\u53D1\u5149\u8D34\u56FE uniform vec2 emissiveMapScale; uniform vec2 emissiveMapOffset; uniform sampler2D model_specularEnvironmentMaps;//\u73AF\u5883\u53CD\u5C04\u8D34\u56FE(\u516B\u9762\u4F53\u6620\u5C04) uniform vec2 model_specularEnvironmentMapsSize; uniform float model_specularEnvironmentMapsMaximumLOD; uniform float environmentShininessfilter; //\u53CD\u5C04\u8FC7\u6EE4 uniform mat3 environmentMapMatrix;//\u73AF\u5883\u8D34\u56FE\u65CB\u8F6C\u77E9\u9635 uniform vec3 ambientColor; // \u73AF\u5883\u5149 uniform vec3 lightPosition; // \u706F\u5149\u4F4D\u7F6E uniform vec3 lightColor; `,WPi=o=>` ${o&&o.diffuse?"vec3 diffuseColor = vec3(texture(diffuseMap, fragTexCoord * diffuseMapScale + diffuseMapOffset, 0.0));":"vec3 diffuseColor = objMaterial.diffuse;"} ${o&&o.specularMap?"vec3 specularColor = vec3(texture(specularMap, fragTexCoord * specularMapScale + specularMapOffset ));":"vec3 specularColor = objMaterial.specular;"} ${o&&o.shininessMap?"float roughness = texture(shininessMap, fragTexCoord * shininessMapScale + shininessMapOffset,0.0).r; float shininess = 1000.0 - roughness * 1000.0;":"float shininess = objMaterial.shininess; float roughness = 1.0 - shininess * 0.001;"} ${o&&o.alphaMap?"float alpha = texture(alphaMap, fragTexCoord * alphaMapScale + alphaMapOffset).r;":"float alpha = objMaterial.alpha;"} ${o&&o.emissiveMap?"vec3 emissive = vec3(texture(emissiveMap, fragTexCoord * emissiveMapScale + emissiveMapOffset,0.0));":"vec3 emissive = objMaterial.emissive;"} if (emissive.r + emissive.g + emissive.b >0.0) { diffuseColor=vec3(0.0); } vec3 normal = normalize(fragNormal); ${o&&o.bumpMap?` vec3 pos_dx = dFdx(fragPosition); vec3 pos_dy = dFdy(fragPosition); vec3 tex_dx = dFdx(vec3(fragTexCoord,0.0)); vec3 tex_dy = dFdy(vec3(fragTexCoord,0.0)); vec3 t = (tex_dy.t * pos_dx - tex_dx.t * pos_dy) / (tex_dx.s * tex_dy.t - tex_dy.s * tex_dx.t); t = normalize(t - normal * dot(normal, t)); vec3 b = normalize(cross(normal, t)); mat3 tbn = mat3(t, b, normal); vec3 n = texture(bumpMap, fragTexCoord * bumpMapScale + bumpMapOffset).rgb; normal = normalize(tbn * (2.0 * n - 1.0)); `:""} `,jPi=` vec4 fragPos = vec4((cameraPos - fragPosition),1.0); vec3 viewDir = normalize(vec3(fragPos * inverseMatrix)); vec3 diffuse = vec3(0.0); vec3 specular = vec3(0.0); vec3 ambient = vec3(ambientColor); vec3 envSpecular = vec3(0.0); vec3 lightDir = vec3(0.0); `,YPi=` //\u5165\u5C04\u5149\u7EBF vec4 lightPos = vec4((lightPosition - fragPosition),1.0); lightDir = normalize(vec3(lightPos * inverseMatrix)); //\u6F2B\u53CD\u5C04 float diff = max(dot(normal, lightDir),0.0); diffuse += diff * lightColor * diffuseColor; //\u53CD\u5C04 if(shininess > 0.1) { vec3 reflectDir = reflect(-lightDir, normal); float spec = pow(max(dot(viewDir, reflectDir), 0.0), shininess); specular += lightColor * spec * specularColor; } `,qPi=` #define CUSTOM_SPECULAR_IBL const mat3 yUpToZUp = mat3( -1.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 1.0, 0.0 ); if (shininess > environmentShininessfilter) { vec3 R = reflect(-viewDir, normal); vec3 cubeDir = normalize(R * yUpToZUp * environmentMapMatrix); vec3 skyColor = czm_sampleOctahedralProjection(model_specularEnvironmentMaps, model_specularEnvironmentMapsSize, cubeDir, roughness * model_specularEnvironmentMapsMaximumLOD, model_specularEnvironmentMapsMaximumLOD); envSpecular = skyColor * specularColor * shininess *0.001; diffuse *= (vec3(1.0) - envSpecular); } `,XPi=` //\u6F2B\u53CD\u5C04 + \u53CD\u5C04 + \u73AF\u5883\u6F2B\u53CD\u5C04 + \u73AF\u5883\u53CD\u5C04 + \u81EA\u53D1\u5149 vec3 finalColor = diffuse + specular + ambient * diffuseColor + envSpecular + emissive; float pick_r = abs(v_pickColor.r - batchId.r); float pick_g = abs(v_pickColor.g - batchId.g); float pick_b = abs(v_pickColor.b - batchId.b); float pick_a = abs(v_pickColor.a - batchId.a); if( pick_r < 0.000001 && pick_g < 0.000001 && pick_b < 0.000001 && pick_a < 0.000001) { finalColor *= pickColor; } out_FragColor = vec4(finalColor, alpha); `,JPi="out_FragColor = czm_gammaCorrect(out_FragColor);";function KPi(o){let f=GPi;return f+="void main(){",f+=WPi(o.material),f+=jPi,f+=o.lightCal?YPi:"diffuse = diffuseColor;",f+=o.environmentSpcCal?qPi:"",f+=o.customCalText?o.customCalText:XPi,f+=o.gammaCorrect?JPi:"",f+="}",f}var OPe=KPi,QPi=/^[og]\s*(.+)?/,ZPi=/^mtllib /,$Pi=/^usemtl /,eIi=/^usemap /,X6e=/\s+/;function tIi(){let o={objects:[],object:{},vertices:[],normals:[],colors:[],uvs:[],materials:{},materialLibraries:[],startObject:function(f,m){if(this.object&&this.object.fromDeclaration===!1){this.object.name=f,this.object.fromDeclaration=m!==!1;return}let v=this.object&&typeof this.object.currentMaterial=="function"?this.object.currentMaterial():void 0;if(this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0),this.object={name:f||"",fromDeclaration:m!==!1,geometry:{vertices:[],normals:[],colors:[],uvs:[],hasUVIndices:!1},groups:[],smooth:!0,startMaterial:function(y,x){let C=this._finalize(!1);C&&(C.inherited||C.groupCount<=0)&&this.groups.splice(C.index,1);let w={index:this.groups.length,name:y||"",mtllib:Array.isArray(x)&&x.length>0?x[x.length-1]:"",smooth:C!==void 0?C.smooth:this.smooth,groupStart:C!==void 0?C.groupEnd:0,groupEnd:-1,groupCount:-1,inherited:!1,clone:function(A){let E={index:typeof A=="number"?A:this.index,name:this.name,mtllib:this.mtllib,smooth:this.smooth,groupStart:0,groupEnd:-1,groupCount:-1,inherited:!1};return E.clone=this.clone.bind(E),E}};return this.groups.push(w),w},currentMaterial:function(){if(this.groups.length>0)return this.groups[this.groups.length-1]},_finalize:function(y){let x=this.currentMaterial();if(x&&x.groupEnd===-1&&(x.groupEnd=this.geometry.vertices.length/3,x.groupCount=x.groupEnd-x.groupStart,x.inherited=!1),y&&this.groups.length>1)for(let C=this.groups.length-1;C>=0;C--)this.groups[C].groupCount<=0&&this.groups.splice(C,1);return y&&this.groups.length===0&&this.groups.push({name:"",smooth:this.smooth}),x}},v&&v.name&&typeof v.clone=="function"){let y=v.clone(0);y.inherited=!0,this.object.groups.push(y)}this.objects.push(this.object)},finalize:function(){this.object&&typeof this.object._finalize=="function"&&this.object._finalize(!0)},parseVertexIndex:function(f,m){let v=parseInt(f,10);return(v>=0?v-1:v+m/3)*3},parseNormalIndex:function(f,m){let v=parseInt(f,10);return(v>=0?v-1:v+m/3)*3},parseUVIndex:function(f,m){let v=parseInt(f,10);return(v>=0?v-1:v+m/2)*2},addVertex:function(f,m,v){let y=this.vertices,x=this.object.geometry.vertices;x.push(y[f+0],y[f+1],y[f+2]),x.push(y[m+0],y[m+1],y[m+2]),x.push(y[v+0],y[v+1],y[v+2])},addVertexPoint:function(f){let m=this.vertices;this.object.geometry.vertices.push(m[f+0],m[f+1],m[f+2])},addVertexLine:function(f){let m=this.vertices;this.object.geometry.vertices.push(m[f+0],m[f+1],m[f+2])},addNormal:function(f,m,v){let y=this.normals,x=this.object.geometry.normals;x.push(y[f+0],y[f+1],y[f+2]),x.push(y[m+0],y[m+1],y[m+2]),x.push(y[v+0],y[v+1],y[v+2])},addFaceNormal:function(f,m,v){let y=this.vertices,x=this.object.geometry.normals;_vA.fromArray(y,f),_vB.fromArray(y,m),_vC.fromArray(y,v),_cb.subVectors(_vC,_vB),_ab.subVectors(_vA,_vB),_cb.cross(_ab),_cb.normalize(),x.push(_cb.x,_cb.y,_cb.z),x.push(_cb.x,_cb.y,_cb.z),x.push(_cb.x,_cb.y,_cb.z)},addColor:function(f,m,v){let y=this.colors,x=this.object.geometry.colors;y[f]!==void 0&&x.push(y[f+0],y[f+1],y[f+2]),y[m]!==void 0&&x.push(y[m+0],y[m+1],y[m+2]),y[v]!==void 0&&x.push(y[v+0],y[v+1],y[v+2])},addUV:function(f,m,v){let y=this.uvs,x=this.object.geometry.uvs;x.push(y[f+0],y[f+1]),x.push(y[m+0],y[m+1]),x.push(y[v+0],y[v+1])},addDefaultUV:function(){let f=this.object.geometry.uvs;f.push(0,0),f.push(0,0),f.push(0,0)},addUVLine:function(f){let m=this.uvs;this.object.geometry.uvs.push(m[f+0],m[f+1])},addFace:function(f,m,v,y,x,C,w,A,E){let T=this.vertices.length,S=this.parseVertexIndex(f,T),M=this.parseVertexIndex(m,T),I=this.parseVertexIndex(v,T);if(this.addVertex(S,M,I),this.addColor(S,M,I),w!==void 0&&w!==""){let P=this.normals.length;S=this.parseNormalIndex(w,P),M=this.parseNormalIndex(A,P),I=this.parseNormalIndex(E,P),this.addNormal(S,M,I)}else this.addFaceNormal(S,M,I);if(y!==void 0&&y!==""){let P=this.uvs.length;S=this.parseUVIndex(y,P),M=this.parseUVIndex(x,P),I=this.parseUVIndex(C,P),this.addUV(S,M,I),this.object.geometry.hasUVIndices=!0}else this.addDefaultUV()},addPointGeometry:function(f){this.object.geometry.type="Points";let m=this.vertices.length;for(let v=0,y=f.length;v<y;v++){let x=this.parseVertexIndex(f[v],m);this.addVertexPoint(x),this.addColor(x)}},addLineGeometry:function(f,m){this.object.geometry.type="Line";let v=this.vertices.length,y=this.uvs.length;for(let x=0,C=f.length;x<C;x++)this.addVertexLine(this.parseVertexIndex(f[x],v));for(let x=0,C=m.length;x<C;x++)this.addUVLine(this.parseUVIndex(m[x],y))}};return o.startObject("",!1),o}var iIi=class{constructor(){this.successLoad=null,this.materials=null}load(o,f){this._url=o;let m=this;return this._flipYZaxis=f,new Promise((v,y)=>{Jr.fetch({url:o}).then(x=>{m.path=o;let C=m.parse(x);v(C)}).catch(x=>{console.log("OBJLoaderERROR:"+x)})})}parse(o){let f=new tIi,m=this;o.indexOf(`\r `)!==-1&&(o=o.replace(/\r\n/g,` `)),o.indexOf(`\\ `)!==-1&&(o=o.replace(/\\\n/g,""));let v=o.split(` `),y=[];for(let A=0,E=v.length;A<E;A++){let T=v[A].trimStart();if(T.length===0)continue;let S=T.charAt(0);if(S!=="#"){if(S==="v"){let M=T.split(X6e);switch(M[0]){case"v":f.vertices.push(parseFloat(M[1]),parseFloat(M[2]),parseFloat(M[3])),M.length>=7;break;case"vn":f.normals.push(parseFloat(M[1]),parseFloat(M[2]),parseFloat(M[3]));break;case"vt":f.uvs.push(parseFloat(M[1]),parseFloat(M[2]));break}}else if(S==="f"){let M=T.slice(1).trim().split(X6e),I=[];for(let D=0,L=M.length;D<L;D++){let R=M[D];if(R.length>0){let O=R.split("/");I.push(O)}}let P=I[0];for(let D=1,L=I.length-1;D<L;D++){let R=I[D],O=I[D+1];f.addFace(P[0],R[0],O[0],P[1],R[1],O[1],P[2],R[2],O[2])}}else if(S==="l"){let M=T.substring(1).trim().split(" "),I=[],P=[];if(T.indexOf("/")===-1)I=M;else for(let D=0,L=M.length;D<L;D++){let R=M[D].split("/");R[0]!==""&&I.push(R[0]),R[1]!==""&&P.push(R[1])}f.addLineGeometry(I,P)}else if(S==="p"){let M=T.slice(1).trim().split(" ");f.addPointGeometry(M)}else if((y=QPi.exec(T))!==null){let M=(" "+y[0].slice(1).trim()).slice(1);f.startObject(M)}else if($Pi.test(T))f.object.startMaterial(T.substring(7).trim(),f.materialLibraries);else if(ZPi.test(T)){let M=T.substring(7).trim();f.materialLibraries.push(M.split(".")[0]);let I=this._url.split("/");I.pop();let P="";for(var x=0;x<I.length;x++)P+=I[x]+"/";let D=new RPe,L=`${P+M}`;f.mtlload=D.load(M.split(".")[0],L)}else if(eIi.test(T))console.warn('OBJLoader: Rendering identifier "usemap" not supported. Textures must be defined in MTL files.');else if(S==="s"){if(y=T.split(" "),y.length>1){let I=y[1].trim().toLowerCase();f.object.smooth=I!=="0"&&I!=="off"}else f.object.smooth=!0;let M=f.object.currentMaterial();M&&(M.smooth=f.object.smooth)}else if(T==="\0")continue}}f.finalize();let C=!(f.objects.length===1&&f.objects[0].geometry.vertices.length===0),w={};if(C===!0)for(let A=0,E=f.objects.length;A<E;A++){let T=f.objects[A],S=T.geometry,M=T.groups,I=T.name;if(S.vertices.length!==0){if(m._flipYZaxis){for(let P=1;P<S.vertices.length;P+=3)[S.vertices[P],S.vertices[P+1]]=[S.vertices[P+1],S.vertices[P]];for(let P=1;P<S.normals.length;P+=3)[S.normals[P],S.normals[P+1]]=[S.normals[P+1],S.normals[P]]}for(let P=0;P<M.length;P++)if(M[P].mtllib&&M[P].name!==""){w[M[P].mtllib]||(w[M[P].mtllib]={}),w[M[P].mtllib][M[P].name]||(w[M[P].mtllib][M[P].name]={vertices:[],normals:[],uvs:[],group:[],names:[]});let D=M[P].groupStart,L=M[P].groupEnd;if(!D&&!L){for(let F=0;F<S.vertices.length;F++)w[M[P].mtllib][M[P].name].vertices.push(S.vertices[F]);for(let F=0;F<S.normals.length;F++)w[M[P].mtllib][M[P].name].normals.push(S.normals[F]);for(let F=0;F<S.uvs.length;F++)w[M[P].mtllib][M[P].name].uvs.push(S.uvs[F]);w[M[P].mtllib][M[P].name].names.push(I);let R=w[M[P].mtllib][M[P].name].group,O=R.length>0?R[R.length-1]+S.vertices.length:S.vertices.length;R.push(O)}else{for(let F=D*3;F<L*3;F++)w[M[P].mtllib][M[P].name].vertices.push(S.vertices[F]),w[M[P].mtllib][M[P].name].normals.push(S.normals[F]);for(let F=D*2;F<L*2;F++)w[M[P].mtllib][M[P].name].uvs.push(S.uvs[F]);w[M[P].mtllib][M[P].name].names.push(I);let R=w[M[P].mtllib][M[P].name].group,O=R.length>0?R[R.length-1]+M[P].groupCount*3:M[P].groupCount*3;R.push(O)}}else if(!w.defaultMaterialLibrary_001)w.defaultMaterialLibrary_001={defaultMaterial_001:{vertices:S.vertices,normals:S.normals,uvs:S.uvs,group:[S.vertices.length],names:[I]}};else{w.defaultMaterialLibrary_001.defaultMaterial_001.vertices=w.defaultMaterialLibrary_001.defaultMaterial_001.vertices.concat(...S.vertices),w.defaultMaterialLibrary_001.defaultMaterial_001.normals=w.defaultMaterialLibrary_001.defaultMaterial_001.normals.concat(...S.normals),w.defaultMaterialLibrary_001.defaultMaterial_001.uvs=w.defaultMaterialLibrary_001.defaultMaterial_001.uvs.concat(...S.uvs),w.defaultMaterialLibrary_001.defaultMaterial_001.names.push(I);let D=w.defaultMaterialLibrary_001.defaultMaterial_001.group;D.push(D[D.length-1]+S.vertices.length)}}}return{objects:w,mtlload:f.mtlload}}},NPe=iIi,rIi=function(o,f,m,v){let y=f.objects[m][v],x=[],C=null,w=f._imageBasedLighting._specularEnvironmentMapAtlas;if(f._materials[m]!==void 0&&f._materials[m][v]!==void 0?C=f._materials[m][v]:C=f._materials.defaultMaterialLibrary_001.defaultMaterial_001,!y.maxRadius){let k=y.vertices,U=0,G=0,j=o.context.createPickId({objectName:y.names[G],materialName:v,primitive:f,_modelId:{id:G+"_"+v,properties:{name:y.names[G]}}});f._pickIds[y.names[G]]||(f._pickIds[y.names[G]]={}),f._pickIds[y.names[G]][v]={pickId:j,highLight:!1};for(let q=0;q<k.length;q+=3){let J=H.distanceSquared({x:0,y:0,z:0},{x:k[q],y:k[q+1],z:k[q+2]});if(U=J>U?J:U,q<y.group[G]){let{red:X,green:Y,blue:Q,alpha:ee}=f._pickIds[y.names[G]][v].pickId.color;x.push(X,Y,Q,ee)}else if(q==y.group[G]){G++;let X=o.context.createPickId({objectName:y.names[G],materialName:v,primitive:f,_modelId:{id:G+"_"+v,properties:{name:y.names[G]}}});f._pickIds[y.names[G]]||(f._pickIds[y.names[G]]={}),f._pickIds[y.names[G]][v]={pickId:X,highLight:!1};let{red:Y,green:Q,blue:ee,alpha:z}=X.color;x.push(Y,Q,ee,z)}}y.maxRadius=Math.sqrt(U)*f._scale,y._boundingSphere=new Pi(f._originPosition,y.maxRadius),y.maxRadius>f._maxRadius&&(f._maxRadius=y.maxRadius,f._boundingSphere=new Pi(f._originPosition,f._maxRadius)),y._modelMatrix||(y._modelMatrix=f._modelMatrix.clone())}let A=(k,U,G)=>{k[U]&&!k[G]&&(k[U].onload=function(){k[U].crossOrigin="",k[G]=new _o({context:o.context,source:k[U],width:k[U].naturalWidth||512,height:k[U].naturalHeight||512,sampler:new gs({wrapS:ha.REPEAT,wrapT:ha.REPEAT,magnificationFilter:f._textureMagnificationFilter,minificationFilter:f._textureMinificationFilter})}),k[G].generateMipmap(hB.NICEST)})};C&&(A(C,"diffuse","diffuseTexture"),A(C,"specularMap","specularTexture"),A(C,"shininessMap","shininessTexture"),A(C,"bumpMap","bumpTexture"),A(C,"alphaMap","alphaTexture"),A(C,"emissiveMap","emissiveTexture"));let E={"objMaterial.diffuse"(){return C.color||{x:.8,y:.8,z:.8}},"objMaterial.specular"(){return C.specular||{x:0,y:0,z:0}},"objMaterial.shininess"(){return C.shininess||0},"objMaterial.emissive"(){return C.emissive||{x:0,y:0,z:0}},"objMaterial.alpha"(){return C.opacity||1},diffuseMap(){return C.diffuseTexture||o.context._defaultTexture},diffuseMapScale(){return C.diffusescale},diffuseMapOffset(){return C.diffuseoffset},specularMap(){return C.specularTexture||o.context._defaultTexture},specularMapScale(){return C.specularMapscale},specularMapOffset(){return C.specularMapoffset},shininessMap(){return C.shininessTexture||o.context._defaultTexture},shininessMapScale(){return C.shininessMapscale},shininessMapOffset(){return C.shininessMapoffset},bumpMap(){return C.bumpTexture||o.context._defaultTexture},bumpMapScale(){return C.bumpMapscale},bumpMapOffset(){return C.bumpMapoffset},alphaMap(){return C.alphaTexture||o.context._defaultTexture},alphaMapScale(){return C.alphaMapscale},alphaMapOffset(){return C.alphaMapoffset},emissiveMap(){return C.emissiveTexture||o.context._defaultTexture},emissiveMapScale(){return C.emissiveMapscale},emissiveMapOffset(){return C.emissiveMapoffset},ambientColor(){return f._ambientColor},lightPosition(){let k=f._lightPosition||o.context.uniformState.sunPositionWC;return Ee.multiplyByPoint(f._inverseMatrix,k,{x:0,y:0,z:0})},lightColor(){return f._lightColor},cameraPos(){let k=o.context.uniformState._cameraPosition;return k=Ee.multiplyByPoint(f._inverseMatrix,k,{x:0,y:0,z:0}),k},environmentMapMatrix(){let k=tn.eastNorthUpToFixedFrame(o.camera._positionWC);return Ee.getMatrix3(k,new Ut)},batchId(){return f._selectObject&&f._pickIds[f._selectObject]&&f._pickIds[f._selectObject][v]&&f._pickIds[f._selectObject][v].highLight?f._pickIds[f._selectObject][v].pickId.color:{red:1,green:1,blue:1,alpha:1}},pickColor(){return f._selectColor},inverseMatrix(){return f._inverseMatrix},model_specularEnvironmentMaps(){return w.texture||o.context._defaultTexture},model_specularEnvironmentMapsSize(){return w.texture?w.texture.dimensions:{x:256,y:256}},model_specularEnvironmentMapsMaximumLOD(){return w.maximumMipmapLevel||0},environmentShininessfilter(){return f._environmentShininessfilter}},T=Ao.createVertexBuffer({usage:gn.STATIC_DRAW,typedArray:new Float32Array(y.vertices),context:o.context}),S=Ao.createVertexBuffer({usage:gn.STATIC_DRAW,typedArray:new Float32Array(y.normals),context:o.context}),M=Ao.createVertexBuffer({usage:gn.STATIC_DRAW,typedArray:new Float32Array(y.uvs),context:o.context}),I=Ao.createVertexBuffer({usage:gn.STATIC_DRAW,typedArray:new Float32Array(x),context:o.context}),P=new Du({context:o.context,attributes:[{index:0,enabled:!0,vertexBuffer:T,componentsPerAttribute:3,normalize:!0,componentDatatype:Rt.FLOAT},{index:1,enabled:!0,vertexBuffer:S,componentsPerAttribute:3,componentDatatype:Rt.FLOAT},{index:2,enabled:!0,componentDatatype:Rt.FLOAT,componentsPerAttribute:2,vertexBuffer:M},{index:3,enabled:!0,componentDatatype:Rt.FLOAT,componentsPerAttribute:4,vertexBuffer:I,normalize:!1}]}),D=` #define USE_PICKING; layout(location = 0) in vec3 inPosition; layout(location = 1) in vec3 inNormal; layout(location = 2) in vec2 inTexCoord; in vec4 a_pickColor; out vec3 fragPosition; out vec2 fragTexCoord; out vec3 fragNormal; out vec4 v_pickColor; void main() { v_pickColor = a_pickColor; fragPosition = inPosition; fragNormal = mat3( transpose( inverse(czm_model) ) ) * inNormal; fragTexCoord = inTexCoord; gl_Position = czm_projection * czm_modelView * vec4( inPosition , 1.0 ); }`,L=OPe({material:C,lightCal:f._raytrace,environmentSpcCal:f._environmentSpcCal&&w,customCalText:f._customCalText,gammaCorrect:f._gammaCorrect}),R=Rs.fromCache({context:o.context,vertexShaderSource:D,fragmentShaderSource:L,attributeLocations:{position:0,normal:1,uv:2,a_pickColor:3}}),O=Mn.fromCache({depthTest:{enabled:!0}}),F=vr.OPAQUE;return C&&C.transparent===!0&&(F=vr.TRANSLUCENT),new Jn({modelMatrix:y._modelMatrix,vertexArray:P,shaderProgram:R,uniformMap:E,renderState:O,pass:F,receiveShadows:f._receiveShadows,castShadows:f._castShadows,pickId:"v_pickColor",boundingVolume:y._boundingSphere})},Tot=class{constructor(o,f){return this._viewer=f.viewer,this._id=f.id,this._url=f.url,this._type="obj",this._originPosition=f.originPosition,this._modelMatrix=null,this._loadModel=!1,this.objects=[],this._maxRadius=0,this._materials={defaultMaterialLibrary_001:{defaultMaterial_001:{color:{x:.8,y:.8,z:.8},specular:{x:0,y:0,z:0},shininess:0,opacity:1,alpha:1,emissive:{x:0,y:0,z:0}}}},this._scale=Z(f.scale,1),this._heading=Z(f.heading,0),this._pitch=Z(f.pitch,0),this._roll=Z(f.roll,0),this._ambientColor=Z(f.ambientColor,new Re(.15,.15,.15,1)),this._lightPosition=f.lightPosition,this._lightColor=Z(f.lightColor,new Re(1,1,1,1)),this._show=Z(f.show,!0),this._flipYZaxis=Z(f.flipYZaxis,!1),this._raytrace=Z(f.raytrace,!0),this._castShadows=Z(f.castShadows,!1),this._receiveShadows=Z(f.receiveShadows,!1),this._environmentSpcCal=Z(f.environmentSpcCal,!0),this._hasSpecularEnvironmentMapAtlas=!1,this._specularSkyBoxSources=f.specularSkyBoxSources,this._customCalText=f.customCalText,this._gammaCorrect=Z(f.gammaCorrect,!1),this._pickIds={},this._selectObject=null,this._selectColor=new Re(1,1,0),this._textureMinificationFilter=Z(f.textureMinificationFilter,Xa.NEAREST_MIPMAP_NEAREST),this._textureMagnificationFilter=Z(f.textureMinificationFilter,Zu.NEAREST),this._environmentShininessfilter=Z(f.environmentShininessfilter*1e3,600),N(f.imageBasedLighting)?(this._imageBasedLighting=f.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new zY,this._shouldDestroyImageBasedLighting=!0),this.initialize(),this}update(o){if(this._show&&this._loadModel){this._imageBasedLighting&&this._imageBasedLighting.update(o);let f=this.objects;for(let m in f)if(f.hasOwnProperty(m))for(let v in f[m])f[m].hasOwnProperty(v)&&(f[m][v].command?o.commandList.push(f[m][v].command):f[m][v].command=rIi(o,this,m,v))}}destroy(){this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;for(let f in this._pickId)for(let m in this._pickId[f])this._pickId[f][m].pickId.destroy(),this._pickId[f][m].pickId=null;let o=this.objects;this._loadModel=!1;for(let f in o)if(o.hasOwnProperty(f))for(let m in o[f])o[f].hasOwnProperty(m)&&(o[f][m].command._vertexArray.destroy(),o[f][m].command=null);this.objects={},this._pickId={},this._materials={}}initialize(){let o=this;!this._url||!this._originPosition||(this._fullURL=new URL(this._url,window.location.href),this._fullURL.href&&new NPe().load(this._fullURL.href,this._flipYZaxis).then(f=>{o.objects=f.objects,f.mtlload?f.mtlload.then(m=>{o._materials={...o._materials,...m},this._loadModel=!0}).catch(m=>{this._loadModel=!0,console.error("\u6750\u8D28\u52A0\u8F7D\u5931\u8D25",m)}):(console.log("\u6CA1\u6709\u6750\u8D28\u52A0\u8F7D"),this._loadModel=!0)}),this._modelMatrix||(this.hpRoll=new dl(xe.toRadians(this._heading),xe.toRadians(this._pitch),xe.toRadians(this._roll)),this._modelMatrix=tn.headingPitchRollToFixedFrame(this._originPosition,this.hpRoll),this._modelMatrix=Ee.multiplyByScale(this._modelMatrix,new H(this._scale,this._scale,this._scale),this._modelMatrix)),this._inverseMatrix=Ee.inverse(this._modelMatrix,new Ee))}};Object.defineProperties(Tot.prototype,{show:{get:function(){return this._show},set:function(o){this._show=o}}});var gae=Tot;function nIi(o,f,m,v,y,x){let C=v._frameState,w=o.derivedCommands;N(w)&&(C.useLogDepth&&N(w.logDepth)&&(o=w.logDepth.command),w=o.derivedCommands,N(w[f])&&(o=w[f][m],o.execute(y,x)))}var Ope,Npe,Fpe,Bpe;function J6e(o,f,m,v,y,x){Ope=Ope||new pc,Npe=Npe||new J2,Fpe=Fpe||new Gs,Bpe=Bpe||new Pm;let C=o._us,w=C._frameState,A=w.camera,E=A._scene,T=E._view,S=T.frustumCommandsList,M=S.length,I=E._globeTranslucencyState,P=I.translucent,D;N(A.frustum.fov)?D=A.frustum.clone(Ope):N(A.frustum.infiniteProjectionMatrix)?D=A.frustum.clone(Npe):N(A.frustum.width)?D=A.frustum.clone(Fpe):D=A.frustum.clone(Bpe);function L(k,U,G,j){(!x||x(k,U))&&(v&&y?nIi(k,v,y,U,G,j):k.execute(G,j))}let R,O,F;for(let k=0;k<M;++k){let U=M-k-1,G=S[U],j=m.framebuffer;m.framebuffer=f,D.near=U!==0?G.near*E.opaqueFrustumNearOffset:G.near,D.far=G.far,C.updateFrustum(D),C.updatePass(vr.GLOBE),F=G.commands[vr.GLOBE],O=G.indices[vr.GLOBE];let q=E._view.globeTranslucencyFramebuffer;if(P)I.executeGlobeCommands(G,L,q,E,m);else for(R=0;R<O;++R)L(F[R],E,o,m);for(C.updatePass(vr.CESIUM_3D_TILE),F=G.commands[vr.CESIUM_3D_TILE],O=G.indices[vr.CESIUM_3D_TILE],R=0;R<O;++R)L(F[R],E,o,m);for(C.updatePass(vr.OPAQUE),F=G.commands[vr.OPAQUE],O=G.indices[vr.OPAQUE],R=0;R<O;++R)L(F[R],E,o,m);for(C.updatePass(vr.TRANSLUCENT),F=G.commands[vr.TRANSLUCENT],O=G.indices[vr.TRANSLUCENT],R=0;R<O;++R)L(F[R],E,o,m);m.framebuffer=j}}var K6e=` vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1) const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1) const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; // tidy overflow return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } // NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } // NOTE: https://twitter.com/gonnavis/status/1377183786949959682 float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); } `,Q6e=`uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; uniform float czm_selectedIdTextureWidth; bool czm_selected(vec4 id) { bool selected = false; for (int i = 0; i < 1024000; i++) { vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); if (all(equal(id, selectedId))) { return true; } if(float(i)>czm_selectedIdTextureWidth)break; } return false; } `;function FPe(o){this._selectedIdTexture=null;let{name:f,vertexShader:m,fragmentShader:v,uniforms:y,renderStateProcess:x,beforeUpdate:C,viewportScale:w,overrideViewport:A,enableEntitySelect:E}=o,{renderType:T,textureScale:S,shaderRedefine:M}=o,I=`renderPass_${f.replace(/[\.\\\/\-]/g,"_")}`,P=`czm_non_${I}_main`,D=`czm_${I}_main`,L=`_cache_${I}`,R=`${I}Command`,O=null,F=null,k=null,U=null,G=null,j,q=new Gc({color:Re.TRANSPARENT,depth:1}),J=new Xr,X=this;if(A&&Xr.clone(A,J),M=M||"add",T=T||"all",S=S||1,S<0||S>8)throw new li("CesiumRenderPass\uFF1AtextureScale\u5FC5\u987B\u5927\u4E8E0\u5C0F\u4E8E\u7B49\u4E8E8");function Y(he,Ce,Se,De){let Oe=he.shaderCache.getDerivedShaderProgram(Ce,I);if(!N(Oe)){let Ue=Ce._attributeLocations,Xe=Ce.fragmentShaderSource,it=Ce.vertexShaderSource,ut=Ce._vertexShaderText,at=Xe.sources,Pt=at.length,Qe=!!G&&de(),ft=Q6e,Ot=/texture\s?\(\s?tile_pickTexture\s?,\s?tile_featureSt\s?\)/.test(Se);De==="in"&&!Ot?ft+=` //in float me_isSelected; bool czm_selected(){ //bool isSelected=false; //if(!isSelected){ // isSelected= czm_selected(${Se}); //} if(${E}) { return czm_selected(${Se}); } return true; } `:ft+=` bool czm_selected(){ return czm_selected(${Se}); }`;let Xt=Q6e,At=!1,bt=!1;if(/in\s?vec3\s?normal\s?;/.test(ut)||/\n\s?vec3\s?normal\s?;/.test(ut)?At=!0:/out\s?vec3\s?v_normal\s?;/.test(ut)&&(bt=!0),v){let gt=!1;for(let Yi=0;Yi<Pt;++Yi)if(/vec4\s?packDepthToRGBA\s?\(/.test(at[Yi])){gt=!0;break}let It=gt?"":K6e;It+=Qe?ft:"",It+=Zr.replaceMain(v,D);let Jt=`${P}();`;It+=`void main() { ${M!=="replace"?Jt:""} ${D}(); } `;let bi=new Array(Pt+1);for(let Yi=0;Yi<Pt;++Yi)bi[Yi]=Zr.replaceMain(at[Yi],P);bi[Pt]=It,At?Xe.defines.push("HAS_NORMAL"):bt&&Xe.defines.push("HAS_V_NORMAL"),Xe.defines.push("MRT"),Xe=new Zr({sources:bi,defines:Xe.defines})}if(m||v){at=it.sources,Pt=at.length;let gt=!1;for(let bi=0;bi<Pt;++bi)if(/vec4\s?packDepthToRGBA\s?\(/.test(at[bi])){gt=!0;break}Qe=Qe&&De==="in"&&!Ot,At?it.defines.push("HAS_NORMAL"):bt&&it.defines.push("HAS_V_NORMAL");let It=`${gt?"":K6e} ${Qe?Xt:""} ${Zr.replaceMain(m||"void main(){}",D)} void main() { ${M!=="replace"?` ${P}();`:""} //${Qe?" me_isSelected=czm_selected()?1.:0.;":""} ${D}(); }`,Jt=new Array(Pt+1);for(let bi=0;bi<Pt;++bi)Jt[bi]=Zr.replaceMain(at[bi],P);Jt[Pt]=It,it=new Zr({sources:Jt,defines:it.defines})}Oe=he.shaderCache.createDerivedShaderProgram(Ce,I,{vertexShaderSource:it,fragmentShaderSource:Xe,attributeLocations:Ue})}return Oe}function Q(he,Ce){he._renderPassCache=he._renderPassCache||{},he._renderPassCache[L]=he._renderPassCache[L]||{};let Se=he._renderPassCache[L],De=Se[Ce.id];if(!N(De)){let Oe=Mn.getState(Ce);typeof x=="function"&&x.call(X,Oe),De=Mn.fromCache(Oe),Se[Ce.id]=De}return De}function ee(he,Ce,Se){let De=he,Oe=Ce._frameState,Ue=he.derivedCommands;if(!N(Ue))return;Oe.useLogDepth&&N(Ue.logDepth)&&(he=Ue.logDepth.command),Ue=he.derivedCommands;let Xe=Ue.renderPass;N(Ue.renderPass)||(Xe=Ue.renderPass={});let it,ut;if(N(Xe[R])&&(it=Xe[R].shaderProgram,ut=Xe[R].renderState),Xe[R]=Jn.shallowClone(he,Xe[R]),!N(it)||Xe.shaderProgramId!==he.shaderProgram.id){let Pt=he.shaderProgram,Qe=De._pickIdQualifier=new RegExp(`uniform\\s?vec4\\s?${he.pickId}`,"g").test(Pt._fragmentShaderText)?"uniform":"in";Xe[R].shaderProgram=Y(Se,Pt,he.pickId,Qe),Xe[R].renderState=Q(Ce,he.renderState),Xe.shaderProgramId=he.shaderProgram.id}else Xe[R].shaderProgram=it,Xe[R].renderState=ut;let at=Xe[R].uniformMap;re(at)}function z(he){return function(){let Ce=y[he];return typeof Ce=="function"?Ce():Ce}}function ie(he,Ce){return function(){let Se=he[Ce]();if(N(Se))return Se.dimensions}}function re(he){if(!he.__created&&(he.czm_selectedIdTexture=function(){return G._selectedIdTexture},he.czm_selectedIdTextureWidth=function(){return G._selectedIdTexture?G._selectedIdTexture.width:0},he.czm_selectedIdTextureStep=function(){return G._selectedIdTexture?1/G._selectedIdTexture.width:-1},!!y)){he.__created=!0;for(let Ce in y)if(y.hasOwnProperty(Ce)){typeof y[Ce]!="function"?he[Ce]=z(Ce):he[Ce]=y[Ce];let Se=he[Ce]();(typeof Se=="string"||Se instanceof _o||Se instanceof HTMLImageElement||Se instanceof HTMLCanvasElement||Se instanceof HTMLVideoElement)&&(he[`${Ce}Dimensions`]=ie(he,Ce))}}}function ne(he){let Ce=he._view,Se=Ce.frustumCommandsList,De=Se.length,Oe,Ue,Xe;for(let it=0;it<De;++it){let ut=De-it-1,at=Se[ut];for(Ue=0;Ue<at.commands.length;Ue++){let Pt=at.commands[Ue];if(Xe=at.indices[Ue],!(G&&Ue===vr.GLOBE))for(Oe=0;Oe<Xe;++Oe){let Qe=Pt[Oe];ee(Qe,he,he._context)}}}}function oe(){k&&(k.destroy(),k=void 0),F&&(F.destroy(),F=void 0),U&&(U.destroy(),U=void 0),O&&(O.destroy(),O=void 0)}function se(he,Ce,Se,De){let Oe=Ce.width,Ue=Ce.height;k&&k.width===Oe&&k.height===Ue&&Se===j||(j=Se,oe(),k=new _o({context:he,width:Oe,height:Ue,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE}),F=new _o({context:he,width:Oe,height:Ue,pixelFormat:Nn.RGBA,pixelDatatype:Rn.UNSIGNED_BYTE}),U=new _o({context:he,width:Oe,height:Ue,pixelFormat:Nn.DEPTH_COMPONENT,pixelDatatype:Rn.UNSIGNED_SHORT,sampler:gs.NEAREST}),O=new dg({colorTextures:[k,F],context:he,destroyAttachments:!1,depthTexture:U}))}function ae(he){A||(J=Xr.clone(he.viewport,J),w?(J.x=J.width*w.x,J.y=J.height*w.y,J.width*=w.width,J.height*=w.height):(J.width*=S,J.height*=S));let Ce=Object.assign({},he.passState);return Ce.viewport=J,Ce}function fe(he,Ce){let Se=he._us._frameState,De=Se.camera,Oe=De._scene,Ue=Oe._view;try{if(!m&&!v){let Xe=ae(Ue);typeof C=="function"&&C.call(X,Oe,Ce),se(he,J,Oe.hdr,Ue.sceneFramebuffer),J6e(he,O,Xe)}else{let Xe=ae(Ue);typeof C=="function"&&C.call(X,Oe,Ce),se(he,J,Oe.hdr,Ue.sceneFramebuffer),ne(Oe),J6e(he,O,Xe,"renderPass",R,T==="all"||!G||!G._selectedIdTexture?null:ve)}}catch(Xe){console.error(Xe)}}function de(){if(!G)return;let he=G.selected||G.parentSelected;if(he.length)return he}function ve(he,Ce){let Se=G&&(G.selected||G.parentSelected);if(he.pass===vr.TRANSLUCENT||!G||!Se||!Se.length)return!1;if(!he.pickId||he._pickIdQualifier!=="uniform")return!0;let De=!0,Oe=he.owner,Ue=T==="selected";if(Oe&&Oe.isObject3D){for(let it=0;it<Se.length;it++)if(Se[it]===Oe)return Ue;return!Ue}let Xe=he.uniformMap;if(Xe[he.pickId]){let it=Xe[he.pickId]();De=!Ue;for(let ut=0;ut<Se.length;ut++){let at=Se[ut],Pt=at.pickId?[at.pickId]:at.pickIds||at._pickIds;for(let Qe=0;Qe<Pt.length;Qe++){let ft=Pt[Qe];if(ft.color===it||Re.equals(ft.color,it))return Ue}}}return De}function pe(he){if(O){let Ce=he._us._frameState.camera._scene._view;q.framebuffer=O,q.execute(he,Ce.passState),q.framebuffer=void 0}}function ce(he){if(G&&X.prevStageUpdate&&(G.update=X.prevStageUpdate,X.prevStageUpdate=null,X.prevStageExecute=null),G=he,!G)return;let Ce=G.update;X.prevStageUpdate=Ce,G.update=function(Se,De){if(pe(Se),k&&Ce.call(G,Se,De),!!G.enabled)if(!m&&!v)fe(Se,De);else{let Oe=G.selected||G.parentSelected;Oe&&Oe.length&&fe(Se,De)}}}this.update=fe,this.clear=pe,Object.defineProperties(this,{texture:{get(){return k}},depthTexture:{get(){return U}},planeDepthTexture:{get(){return F}},stage:{get(){return G},set(he){G!==he&&ce(he)}}})}function BPe(o){let f=[];for(let m in o.defines)if(o.defines.hasOwnProperty(m)){let v=o.defines[m];f.push(`#define ${m} ${v}`)}return f=`${f.join(` `)} `,o.fragmentShader&&(o.fragmentShader=f+o.fragmentShader),o.vertexShader&&(o.vertexShader=f+o.vertexShader),o}var oIi=` in vec2 v_textureCoordinates; uniform sampler2D colorTexture; uniform vec2 colorTextureDimensions; uniform vec2 direction; uniform float kernelRadius; float gaussianPdf(in float x, in float sigma) { return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma; } void main() { vec2 vUv=v_textureCoordinates; vec2 invSize = 1.0 / colorTextureDimensions; float weightSum = gaussianPdf(0.0, kernelRadius); vec4 diffuseSum = texture( colorTexture, vUv) * weightSum; vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS); vec2 uvOffset = delta; for( int i = 1; i <= MAX_RADIUS; i ++ ) { float w = gaussianPdf(uvOffset.x, kernelRadius); vec4 sample1 = texture( colorTexture, vUv + uvOffset); vec4 sample2 = texture( colorTexture, vUv - uvOffset); diffuseSum += ((sample1 + sample2) * w); weightSum += (2.0 * w); uvOffset += delta; } out_FragColor = diffuseSum/weightSum;}`;function sie(o,f,m,v){let y=new Ye(1,0),x=new Ye(0,1),C={defines:{MAX_RADIUS:f},fragmentShader:oIi};BPe(C);let w=new as({name:`${o}_x_direction`,fragmentShader:C.fragmentShader,textureScale:v,forcePowerOfTwo:!0,uniforms:{kernelRadius:m,direction:y},sampleMode:zy.LINEAR}),A=new as({name:`${o}_y_direction`,fragmentShader:C.fragmentShader,textureScale:v,forcePowerOfTwo:!0,uniforms:{kernelRadius:m,direction:x},sampleMode:zy.LINEAR});return new z0({name:o,stages:[w,A],inputPreviousStageTexture:!0})}function U6(o,f){f=f||"OutlineEffect";let m=2,v=12*Math.PI/180,y=!1,x=!1,C=Re.WHITE.clone(),w=Re.RED.clone(),A=!1,E=1,T=3,S=!1,M=Z(o,!1),I=new FPe({name:`${f}Pass`,vertexShader:` //out vec3 vOutlineNormal; void main(){ // #ifdef HAS_NORMALS // vOutlineNormal = a_normalMC; // #else // #ifdef HAS_V_NORMAL // vOutlineNormal = v_normal; // #else // vOutlineNormal=vec3(0.); // #endif // #endif } `,fragmentShader:` //#extension GL_EXT_draw_buffers : enable //in vec3 vOutlineNormal; vec4 packDepth(float depth) { const vec4 bias = vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0); float r = depth; float g = fract(r * 255.0); float b = fract(g * 255.0); float a = fract(b * 255.0); vec4 color = vec4(r, g, b, a); return color - (color.yzww * bias); } vec3 limitVec3(vec3 direct){ return (direct + vec3(1.0)) * 0.5; } void main(){ if(!czm_selected())discard; #ifdef HAS_NORMALS vec3 normalEC = v_normalEC; #else vec3 pos_dx = dFdx(v_positionEC); vec3 pos_dy = dFdy(v_positionEC); pos_dx = normalize(pos_dx); pos_dy = normalize(pos_dy); vec3 normalEC = cross(pos_dx, pos_dy); #endif if(length(normalEC)>0.) { vec3 vNormalEC = normalize(normalEC); out_FragColor=vec4(limitVec3(vNormalEC), out_FragColor.a); float planeDepth = abs(dot(v_positionEC, vNormalEC)); out_FragData_1 = packDepth(planeDepth/100000.0); } else { out_FragColor=vec4( 0.0 ); out_FragData_1=vec4( 0.0 ); } } `,sampler:new gs({minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR}),enableEntitySelect:M}),P=new as({name:`${f}Mask`,uniforms:{outlineWidth(){return m},devicePixelRatio,thresholdAngle:function(){return v},useSingleColor:function(){return y},showOutlineOnly:function(){return x},visibleEdgeColor:function(){return C},hiddenEdgeColor:function(){return w},maskTexture(){return I.texture},maskDepthTexture(){return I.depthTexture},maskPlaneDepthTexture(){return I.planeDepthTexture}},fragmentShader:` uniform sampler2D colorTexture; uniform vec2 colorTextureDimensions; uniform sampler2D depthTexture; uniform sampler2D maskPlaneDepthTexture; uniform sampler2D maskTexture; uniform sampler2D maskDepthTexture; uniform float thresholdAngle; uniform bool showOutlineOnly; uniform float outlineWidth; uniform float devicePixelRatio; uniform vec3 visibleEdgeColor; uniform vec3 hiddenEdgeColor; uniform bool useSingleColor; in vec2 v_textureCoordinates; float lengthSq(vec3 v){ return v.x * v.x + v.y * v.y + v.z * v.z; } float normal_angleTo(vec3 a,vec3 b){ float denominator = sqrt( lengthSq(a) * lengthSq(b) ); if ( denominator == 0. ) return czm_pi / 2.; float theta = dot(a, b ) / denominator; // clamp, to handle numerical problems return acos( clamp( theta, - 1., 1. ) ); } float compareNormal(vec4 n1,vec4 n2){ float l1 = length( n1.xyz ); float l2 = length( n2.xyz ); if(l1 == 0.0 && l2 == 0.0) return 0.0; if( abs ( normal_angleTo( n1.xyz , n2.xyz ) ) < thresholdAngle ){ return 0.; }else{ return 1.; } } vec3 upLimitVec3(vec3 direct){ return direct * 2.0 - vec3(1.0); } const float UnpackDownscale = 255. / 256.; const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } float unpackDepth(const in vec4 rgba_depth) { const vec4 bitShifts = vec4(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0), 1.0 / (255.0 * 255.0 * 255.0)); float depth = dot(rgba_depth, bitShifts); return depth; } float compareDepth(const in vec2 uv){ float maskDepth = czm_readDepth( maskDepthTexture, uv); float nonDepth = czm_readDepth( depthTexture, uv); return maskDepth>nonDepth?1.:0.; } void main(){ vec2 vUv=v_textureCoordinates; // vec4 color = texture( colorTexture, vUv); vec4 maskColor = texture( maskTexture, vUv); if( maskColor.a < 0.0001){ // out_FragColor =color; discard; return; } vec2 invSize = outlineWidth / colorTextureDimensions; vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize); vec4 c1 = texture( maskTexture, vUv + uvOffset.xy); //c1.xyz = upLimitVec3(c1.xyz); vec4 c2 = texture( maskTexture, vUv - uvOffset.xy); //c2.xyz = upLimitVec3(c2.xyz); vec4 c3 = texture( maskTexture, vUv + uvOffset.yw); //c3.xyz = upLimitVec3(c3.xyz); vec4 c4 = texture( maskTexture, vUv - uvOffset.yw); //c4.xyz = upLimitVec3(c4.xyz); float d; if(showOutlineOnly){ float diff1 = (c1.a - c2.a)*0.5; float diff2 = (c3.a - c4.a)*0.5; d = length( vec2(diff1, diff2) ); } else{ float diff1 = compareNormal(c1,c2)*0.5; float diff2 = compareNormal(c3,c4)*0.5; d = length( vec2(diff1, diff2) ); } // \u9762\u6DF1\u5EA6 vec4 pd1 = texture( maskPlaneDepthTexture, vUv + uvOffset.xy); vec4 pd2 = texture( maskPlaneDepthTexture, vUv - uvOffset.xy); vec4 pd3 = texture( maskPlaneDepthTexture, vUv + uvOffset.yw); vec4 pd4 = texture( maskPlaneDepthTexture, vUv - uvOffset.yw); float pdf1 = unpackDepth(pd1); float pdf2 = unpackDepth(pd2); float pdf3 = unpackDepth(pd3); float pdf4 = unpackDepth(pd4); bool fPdf = (abs(pdf1 - pdf2) > 0.00001 || abs(pdf3 - pdf4) > 0.00001); if(d < 0.0000001 && fPdf) { d = 0.5; } if(useSingleColor==false){ float dp1 = compareDepth( vUv + uvOffset.xy); float dp2 = compareDepth( vUv - uvOffset.xy); float dp3 = compareDepth( vUv + uvOffset.yw); float dp4 = compareDepth( vUv - uvOffset.yw); float a1 = min(dp1, dp2); float a2 = min(dp3, dp4); float visibilityFactor = min(a1, a2); vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? vec3(visibleEdgeColor) + vec3(0.01) : hiddenEdgeColor; // out_FragColor =color+ vec4( edgeColor , 1. ) * vec4(d); out_FragColor = vec4( edgeColor , 1. ) * vec4(d); }else{ // out_FragColor =color+ vec4( visibleEdgeColor , 1. ) * vec4(d); out_FragColor = vec4( visibleEdgeColor + vec3(0.01) , 1. ) * vec4(d); } } `});I.stage=P;let D=sie(`${f}Blur1`,4,1,.75),L=sie(`${f}Blur2`,4,4,.5),R=new z0({name:`${f}BlurComposite`,stages:[P,D,L],inputPreviousStageTexture:!0}),O=new as({name:`${f}Additive`,uniforms:{showGlow:function(){return A},edgeGlow:function(){return E},edgeStrength:function(){return T},edgeOnly(){return S},maskTexture(){return I.texture},lineTexture:P.name,edgeTexture1:D.name,edgeTexture2:R.name},fragmentShader:` uniform sampler2D colorTexture; uniform sampler2D edgeTexture1; uniform sampler2D edgeTexture2; uniform sampler2D lineTexture; uniform sampler2D maskTexture; uniform bool showGlow; uniform float edgeGlow; uniform bool edgeOnly; uniform float edgeStrength; in vec2 v_textureCoordinates; void main(){ vec2 vUv =v_textureCoordinates; vec4 edgeColor=texture( lineTexture, vUv); vec4 color=texture( colorTexture, vUv); float opacity=1.; if(edgeOnly){ vec4 maskColor=texture( maskTexture, vUv); opacity=1.-maskColor.a; out_FragColor = maskColor; return; } if(showGlow){ float visFactor= czm_selected()?1.:0.; vec4 edgeValue1 = texture(edgeTexture1, vUv); vec4 edgeValue2 = texture(edgeTexture2, vUv); vec4 glowColor = edgeValue1 + edgeValue2 * edgeGlow; out_FragColor = opacity * color + edgeColor + edgeStrength * (1. - edgeColor.r) * glowColor; } else{ if(edgeColor.r>0.0 && edgeColor.g>0.0 &&edgeColor.b>0.0 ) { out_FragColor = edgeColor; } else{ out_FragColor = opacity * color + edgeColor; } } } `}),F=new z0({name:`${f}Composite`,stages:[R,O],inputPreviousStageTexture:!1});function k(U){Object.defineProperties(U,{showGlow:{get(){return A},set(G){A=G}},edgeGlow:{get(){return E},set(G){E=G}},edgeStrength:{get(){return T},set(G){T=G}},thresholdAngle:{get(){return v},set(G){v=G}},showOutlineOnly:{get(){return x},set(G){x=G}},edgeOnly:{get(){return S},set(G){S=G}},useSingleColor:{get(){return y},set(G){y=G}},outlineWidth:{get(){return m},set(G){m=G}},visibleEdgeColor:{get(){return C},set(G){C=G}},hiddenEdgeColor:{get(){return w},set(G){w=G}}})}return k(F),F._uniforms=F._uniforms||{},k(F._uniforms),F}function uX(o){this._primitive=o,this._primitive.ripple=!1,this._primitive.snow=!1,this._primitive.heightFog=!1,this._primitive.fogHeight=100,this._primitive.regionAlpha=1,this._primitive.regionGradientDistance=1,this._ripple=!1,this._snow=!1,this._heightFog=!1}Object.defineProperties(uX.prototype,{ripple:{set:function(o){this._ripple!==o&&(this._primitive.snow=!1,this._primitive.heightFog=!1),this._primitive.ripple=o,this._ripple=o}},snow:{set:function(o){this._snow!==o&&(this._primitive.ripple=!1,this._primitive.heightFog=!1),this._primitive.snow=o,this._snow=o}},heightFog:{set:function(o){this._heightFog!==o&&(this._primitive.snow=!1,this._primitive.ripple=!1),this._primitive.heightFog=o,this._heightFog=o}},fogHeight:{set:function(o){this._primitive.fogHeight=o}},regionAlpha:{set:function(o){this._primitive.regionAlpha=o}},regionGradientDistance:{set:function(o){this._primitive.regionGradientDistance=o}},disabled:{set:function(o){this.ripple=o,this.snow=o,this.heightFog=o,this._primitive.ripple=!1,this._primitive.snow=!1,this._primitive.heightFog=!1}}});uX.prototype.addPolygon=function(o){this._primitive.addFlattenPolygon(o)};uX.prototype.clearPolygon=function(){this._primitive.clearFlattenPolygon()};uX.prototype.update=function(){this._primitive.update()};var kPe=uX;function cX(o){this._terrainFlatten=new xD(o,!1,!0),this._terrainFlatten.ripple=!1,this._terrainFlatten.snow=!1,this._terrainFlatten.heightFog=!1,this._terrainFlatten.fogHeight=100,this._terrainFlatten.regionAlpha=1,this._terrainFlatten.regionGradientDistance=10,this._ripple=!1,this._snow=!1,this._heightFog=!1}Object.defineProperties(cX.prototype,{ripple:{set:function(o){this._ripple!==o&&(this._terrainFlatten.snow=!1,this._terrainFlatten.heightFog=!1),this._terrainFlatten.ripple=o,this._ripple=o}},snow:{set:function(o){this._snow!==o&&(this._terrainFlatten.ripple=!1,this._terrainFlatten.heightFog=!1),this._terrainFlatten.snow=o,this._snow=o}},heightFog:{set:function(o){this._heightFog!==o&&(this._terrainFlatten.snow=!1,this._terrainFlatten.ripple=!1),this._terrainFlatten.heightFog=o,this._heightFog=o}},fogHeight:{set:function(o){this._terrainFlatten.fogHeight=o}},regionAlpha:{set:function(o){this._terrainFlatten.regionAlpha=o}},regionGradientDistance:{set:function(o){this._terrainFlatten.regionGradientDistance=o}},disabled:{set:function(o){this.ripple=o,this.snow=o,this.heightFog=o,this._terrainFlatten.ripple=!1,this._terrainFlatten.snow=!1,this._terrainFlatten.heightFog=!1}}});cX.prototype.addPolygon=function(o){this._terrainFlatten.addPolygon(o)};cX.prototype.clearPolygon=function(){this._terrainFlatten.clearPolygon()};cX.prototype.update=function(){this._terrainFlatten.update()};var VPe=cX;function aIi(o,f,m){let v=new Ye(15,30),y=new H,x=function(C,w){y=H.normalize(C.position,y),y=H.multiplyByScalar(y,-1050,y),C.position=H.add(C.position,y,C.position);let A=H.distance(o.camera.position,C.position),E=1;m<1e5&&(E=.1/(m/1e5));let T=m*E;A>T?C.endColor.alpha=0:C.endColor.alpha=Re.BLUE.alpha/(A/T+.1)};return new sA({modelMatrix:new Ee.fromTranslation(f),speed:-1,lifetime:15,emitter:new eae(new H(m,m,m)),startScale:5,endScale:0,image:`${globalThis.GEOWORLD_BASE_URL}Assets/Textures/littleRain.png`,emissionRate:9e3,startColor:new Re(.8,.8,.8,0),endColor:new Re(.8,.8,.8,.9),imageSize:v,updateCallback:x})}function sIi(o,f,m){let v=new Ye(12,12),y=new Ye(12*2,12*2),x=new H,C=function(w,A){x=H.normalize(w.position,x),H.multiplyByScalar(x,xe.randomBetween(-30,-300),x),w.velocity=H.add(w.velocity,x,w.velocity);let E=H.distance(o.camera.position,w.position);E>m?w.endColor.alpha=0:w.endColor.alpha=1/(E/m+.1)};return new sA({modelMatrix:new Ee.fromTranslation(f),minimumSpeed:-1,maximumSpeed:0,lifetime:15,emitter:new eae(new H(m,m,m)),startScale:.5,endScale:1,image:`${globalThis.GEOWORLD_BASE_URL}Assets/Textures/snow.png`,emissionRate:7e3,startColor:Re.WHITE.withAlpha(0),endColor:Re.WHITE.withAlpha(1),minimumImageSize:v,maximumImageSize:y,updateCallback:C})}function lIi(o,f){let m=tn.eastNorthUpToFixedFrame(o),v=Ee.multiplyByPoint(m,new H(f*.5,f*.5,0),new H),y=Ee.multiplyByPoint(m,new H(f*.5,-f*.5,0),new H),x=Ee.multiplyByPoint(m,new H(-f*.5,-f*.5,0),new H),C=Ee.multiplyByPoint(m,new H(-f*.5,f*.5,0),new H),w=Mt.fromCartesian(v),A=Mt.fromCartesian(y),E=Mt.fromCartesian(x),T=Mt.fromCartesian(C);return[xe.toDegrees(w.longitude),xe.toDegrees(w.latitude),-1e4,xe.toDegrees(A.longitude),xe.toDegrees(A.latitude),-1e4,xe.toDegrees(E.longitude),xe.toDegrees(E.latitude),-1e4,xe.toDegrees(T.longitude),xe.toDegrees(T.latitude),-1e4]}function Xu(o,f,m,v){this._scene=o,this._primitive=f,this._position=m,this._radius=v,f&&(this._tilesetWeather=new kPe(f)),o&&(this._terrainWeather=new VPe(o)),this._enableWeatherType=Xu.TYPE_NONE,this._region=lIi(m,v),this._skyAtmosphereHueShift=o.skyAtmosphere.hueShift,this._skyAtmosphereSaturationShift=o.skyAtmosphere.saturationShift,this._skyAtmosphereBrightnessShift=o.skyAtmosphere.brightnessShift,this._fogDensity=o.fog.density,this._fogMinimumBrightness=o.fog.minimumBrightness}Object.defineProperties(Xu.prototype,{enableWeatherType:{get:function(){return this._enableWeatherType},set:function(o){this._enableWeatherType!==o&&(this._enableWeatherType!==Xu.TYPE_RAIN&&this._enableWeatherType!==Xu.TYPE_SNOW&&this._enableWeatherType!==Xu.TYPE_HEIGHT_FOG&&(o===Xu.TYPE_RAIN||o===Xu.TYPE_SNOW||o===Xu.TYPE_HEIGHT_FOG)&&(this.addPolygon(this._region),this.update()),(this._enableWeatherType===Xu.TYPE_RAIN||this._enableWeatherType===Xu.TYPE_SNOW||this._enableWeatherType===Xu.TYPE_HEIGHT_FOG)&&o!==Xu.TYPE_RAIN&&o!==Xu.TYPE_SNOW&&o!==Xu.TYPE_HEIGHT_FOG&&this.clearPolygon(),o===Xu.TYPE_RAIN?this.enableRainSnowFog(o):o===Xu.TYPE_SNOW?this.enableRainSnowFog(o):o===Xu.TYPE_HEIGHT_FOG?this.enableRainSnowFog(o):o===Xu.TYPE_NONE&&this.disableRainSnowFog(),this._enableWeatherType=o)}},fogHeight:{set:function(o){this._tilesetWeather&&(this._tilesetWeather.fogHeight=o),this._terrainWeather&&(this._terrainWeather.fogHeight=o)}},regionAlpha:{set:function(o){this._tilesetWeather&&(this._tilesetWeather.regionAlpha=o),this._terrainWeather&&(this._terrainWeather.regionAlpha=o)}},regionGradientDistance:{set:function(o){this._tilesetWeather&&(this._tilesetWeather.regionGradientDistance=o),this._terrainWeather&&(this._terrainWeather.regionGradientDistance=o)}}});Xu.prototype.enableRainSnowFog=function(o){let f=this._scene,m=this._position,v=this._radius;f.skyAtmosphere.hueShift=-.97,f.skyAtmosphere.saturationShift=.25,f.skyAtmosphere.brightnessShift=-.4,f.fog.density=25e-5,f.fog.minimumBrightness=.005,this._weatherParticle&&f.primitives.remove(this._weatherParticle),o===Xu.TYPE_RAIN?(this._weatherParticle=aIi(f,m,v),f.primitives.add(this._weatherParticle)):o===Xu.TYPE_SNOW&&(this._weatherParticle=sIi(f,m,v),f.primitives.add(this._weatherParticle)),this._terrainWeather.disabled=!0,this._terrainWeather&&(o===Xu.TYPE_RAIN?this._terrainWeather.ripple=!0:o===Xu.TYPE_SNOW?this._terrainWeather.snow=!0:o===Xu.TYPE_HEIGHT_FOG?this._terrainWeather.heightFog=!0:o===Xu.TYPE_NONE&&(this._terrainWeather.disabled=!0)),this._tilesetWeather.disabled=!0,this._tilesetWeather&&(o===Xu.TYPE_RAIN?this._tilesetWeather.ripple=!0:o===Xu.TYPE_SNOW?this._tilesetWeather.snow=!0:o===Xu.TYPE_HEIGHT_FOG?this._tilesetWeather.heightFog=!0:o===Xu.TYPE_NONE&&(this._tilesetWeather.disabled=!0))};Xu.prototype.disableRainSnowFog=function(){let o=this._scene;o.skyAtmosphere.hueShift=this._skyAtmosphereHueShift,o.skyAtmosphere.saturationShift=this._skyAtmosphereSaturationShift,o.skyAtmosphere.brightnessShift=this._skyAtmosphereBrightnessShift,o.fog.density=this._fogDensity,o.fog.minimumBrightness=this._fogMinimumBrightness,this._weatherParticle&&o.primitives.remove(this._weatherParticle)};Xu.prototype.addPolygon=function(){if(this._terrainWeather&&this._terrainWeather.addPolygon(this._region),this._tilesetWeather){let o=Ec.fromPositions({positions:H.fromDegreesArrayHeights(this._region),perPositionHeight:!0});this._tilesetWeather.addPolygon(o)}};Xu.prototype.clearPolygon=function(){this._terrainWeather&&this._terrainWeather.clearPolygon(),this._tilesetWeather&&this._tilesetWeather.clearPolygon()};Xu.prototype.update=function(){this._terrainWeather&&this._terrainWeather.update(),this._tilesetWeather};Xu.TYPE_RAIN=0;Xu.TYPE_SNOW=1;Xu.TYPE_HEIGHT_FOG=2;Xu.TYPE_NONE=3;var _ae=Xu;function hX(o,f,m){let v=o._gl;this.id=f,this._size=m.imageBuffer.length,this._context=o,this._width=m.width,this._height=m.height,this._texture=null,this._internalFormat=m.internalFormat,this._wrapS=Z(m.wrapS,ha.CLAMP_TO_EDGE),this._wrapT=Z(m.wrapT,ha.CLAMP_TO_EDGE),this.id=f,this._target=v.TEXTURE_2D,this._texture=v.createTexture(),v.bindTexture(v.TEXTURE_2D,this._texture);let y=0,x=0,C=uIi(m.imageBuffer,this._internalFormat,this._width,this._height),w=this._width,A=this._height;do{let E=Nn.compressedTextureSizeInBytes(this._internalFormat,w,A),T=new Uint8Array(m.imageBuffer.buffer,m.imageBuffer.byteOffset+y,E);v.compressedTexImage2D(v.TEXTURE_2D,x++,this._internalFormat,w,A,0,T),w=Math.max(w>>1,1),A=Math.max(A>>1,1),y+=E}while(y<m.imageBuffer.length&&C);x>1?(v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR_MIPMAP_LINEAR)):(v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MAG_FILTER,v.LINEAR),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_MIN_FILTER,v.LINEAR)),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,this._wrapS),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,this._wrapT),v.bindTexture(v.TEXTURE_2D,null)}function uIi(o,f,m,v){let y=o.length,x=m,C=v,w=0;for(;;){let A=Nn.compressedTextureSizeInBytes(f,x,C);if(w+=A,x=x>>1,C=C>>1,x===0&&C===0)break;x=Math.max(x,1),C=Math.max(C,1)}return w===y}hX.prototype.enable=function(){let o=this._context._gl;o.activeTexture(this._gl.TEXTURE0),o.bindTexture(this._target,this._texture)};hX.prototype.disable=function(){this._context._gl.bindTexture(this._target,null)};hX.prototype.isDestroyed=function(){return!1};hX.prototype.destroy=function(){this._context._gl.deleteTexture(this._texture),this._texture=null,this.id=0,kr(this)};var zPe=hX;function HPe(){this.ambientColor=new Re,this.diffuseColor=new Re,this.specularColor=new Re(0,0,0,0),this.shininess=50,this.bTransparentSorting=!1,this.textures=[]}HPe.prototype.isDestroyed=function(){return!1};HPe.prototype.destroy=function(){return kr(this)};var UPe=HPe,cIi={OSGBFile:function(o){return new Tj(o)},OSGBCacheFile:function(o){return new Tj(o)}},GPe=cIi,hIi={SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32},dw=Object.freeze(hIi);function Sot(){}function dIi(o,f){let m={},v=f.materials.material;for(let y=0,x=v.length;y<x;y++){let C=v[y].material,w=C.id,A=new UPe;m[w]=A;let E=C.ambient;A.ambientColor=new Re(E.r,E.g,E.b,E.a);let T=C.diffuse;A.diffuseColor=new Re(T.r,T.g,T.b,T.a);let S=C.specular;A.specularColor=new Re(S.r,S.g,S.b,S.a),A.shininess=C.shininess,A.bTransparentSorting=C.transparentsorting;let M=C.textureunitstates,I=M.length;for(let P=0;P<I;P++){let D=M[P].textureunitstate,L=D.id,R=D.addressmode.u===0?ha.REPEAT:ha.CLAMP_TO_EDGE,O=D.addressmode.v===0?ha.REPEAT:ha.CLAMP_TO_EDGE;A.texMatrix=Ee.unpack(D.texmodmatrix);let F=f.texturePackage[L];if(N(F)&&F.imageBuffer.byteLength>0){F.wrapS=R,F.wrapT=O;let k=new zPe(o,L,F);A.textures.push(k)}}}return m}function fIi(o,f){let m=new Pi,v=new H,y=o.vertexAttributes[0],x=y.componentsPerAttribute,C=N(o.nCompressOptions)&&(o.nCompressOptions&dw.SVC_Vertex)===dw.SVC_Vertex,w=1,A,E;C?(w=o.vertCompressConstant,A=new H(o.minVerticesValue.x,o.minVerticesValue.y,o.minVerticesValue.z),E=new Uint16Array(y.typedArray.buffer,y.typedArray.byteOffset,y.typedArray.byteLength/2)):E=new Float32Array(y.typedArray.buffer,y.typedArray.byteOffset,y.typedArray.byteLength/4);let T=[];for(let S=0;S<o.verticesCount;S++)H.fromArray(E,x*S,v),C&&(v=H.multiplyByScalar(v,w,v),v=H.add(v,A,v)),T.push(H.clone(v));return Pi.fromPoints(T,m),Pi.transform(m,f,m),T.length=0,m}function pIi(o,f,m,v,y){let x={},C=v.geodes;for(let w=0,A=C.length;w<A;w++){let E=C[w],T=E.matrix,S=Ee.multiply(o.modelMatrix,T,new Ee),M;N(y.boundingVolume)&&(M=new Pi(y.boundingVolume.sphere.center,y.boundingVolume.sphere.radius),Pi.transform(M,o.modelMatrix,M));let I=E.skeletonNames;for(let P=0,D=I.length;P<D;P++){let L=I[P],R=f.geoPackage[L],O=R.vertexPackage,F=R.arrIndexPackage,k=R.pickInfo,U;F.length>0&&(U=m[F[0].materialCode]);let G=N(M)?M:fIi(O,S);x[L]=GPe[o.fileType]({layer:o,vertexPackage:O,arrIndexPackage:F,pickInfo:k,modelMatrix:S,boundingVolume:G,material:U})}}if(!N(y.boundingVolume)){let w=[];for(let A in x)x.hasOwnProperty(A)&&w.push(x[A].boundingVolume);y.boundingVolume=Pi.fromBoundingSpheres(w)}y.geoMap=x}function mIi(o,f,m){let v=f.groupNode,y=[];for(let x=0,C=v.pageLods.length;x<C;x++){let w={},A=v.pageLods[x];w.rangeMode=A.rangeMode,w.rangeDataList=A.childTile,w.rangeList=A.rangeList;let E=A.boundingSphere.center,T=A.boundingSphere.radius;w.rangeDataList!==""?w.boundingVolume={sphere:{center:new H(E.x,E.y,E.z),radius:T}}:w.isLeafTile=!0,pIi(o,f,m,A,w),y.push(w)}return y}Sot.parse=function(o,f){if(!N(f))return;let m=dIi(o.context,f);return mIi(o,f,m)};var WPe=Sot;function c4(){this._list=new Vne,this._sentinel=this._list.add(),this._trimTiles=!1}c4.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};c4.prototype.touch=function(o){let f=o.cacheNode;N(f)&&this._list.splice(this._sentinel,f)};c4.prototype.add=function(o){N(o.cacheNode)||(o.cacheNode=this._list.add(o))};c4.prototype.unloadTile=function(o,f,m){let v=f.cacheNode;N(v)&&(this._list.remove(v),f.cacheNode=void 0,m(o,f))};c4.prototype.unloadTiles=function(o,f){let m=this._trimTiles;this._trimTiles=!1;let v=this._list,y=o.maximumMemoryUsage*1024*1024,x=this._sentinel,C=v.head;for(;C!==x&&(o.totalMemoryUsageInBytes>y||m);){let w=C.item;C=C.next,w.isDestroyed()&&console.log(w),this.unloadTile(o,w,f)}};c4.prototype.trim=function(){this._trimTiles=!0};var jPe=c4,gIi={UNLOADED:0,LOADING:1,PARSING:2,READY:3,FAILED:4},a2=Object.freeze(gIi);function Pot(){this._stack=[]}function _Ii(o,f,m){f.length=0;for(let v=0,y=o._rootTiles.length;v<y;v++){let x=o._rootTiles[v];x.updateVisibility(m),x.visible&&f.push(x)}}function vIi(o,f){return o.distanceToCamera-f.distanceToCamera}function yIi(o,f,m,v){let y,x=f.children,C=x.length;for(y=0;y<C;++y)x[y].updateVisibility(v);for(x.sort(vIi),y=0;y<C;++y){let w=x[y];w.visible&&m.push(w)}}function xIi(o,f,m){f.renderable&&(o._selectedTiles.push(f),f.selectedFrame=m.frameNumber)}function CIi(o,f,m){f.requestedFrame===m.frameNumber||f.contentState!==a2.UNLOADED||f.isLeafTile||(o._requestTiles.push(f),f.requestedFrame=m.frameNumber)}function bIi(o,f,m){f.touchedFrame!==m.frameNumber&&(o._cache.touch(f),f.touchedFrame=m.frameNumber)}function wIi(o,f,m){for(;f.length;){let v=f.pop();if(v.visible){if(bIi(o,v,m),v.canTraverse()){yIi(o,v,f,m);continue}xIi(o,v,m),CIi(o,v,m)}}}Pot.prototype.scheduler=function(o,f){o._requestTiles.length=0,o._selectedTiles.length=0;let m=this._stack;_Ii(o,m,f),wIi(o,m,f)};var YPe=Pot,AIi=dd(e9e(),1);function Iot(){}var Z6e={SV_Unkown:0,SV_Standard:1,SV_Compressed:2};function EIi(o,f){let m=new Uint8Array(o,f);return AIi.default.inflate(m).buffer}function G6(o,f,m){let v=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let y=new Uint8Array(o,m,v),x=nP(y);return m+=v,{string:x,bytesOffset:m}}function TIi(o,f,m,v){let y={},x=[],C=new Array(16);for(let A=0;A<16;A++)C[A]=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;y.matrix=C,y.skeletonNames=x;let w=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let A=0;A<w;A++){let E=G6(o,f,m);x.push(E.string),m=E.bytesOffset}return v.push(y),m}function SIi(o,f,m,v){let y={};y.rangeList=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,y.rangeMode=f.getUint16(m,!0),m+=Uint16Array.BYTES_PER_ELEMENT;let x={};x.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,x.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,x.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let C=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT,y.boundingSphere={center:x,radius:C};let w=G6(o,f,m),A=w.string;m=w.bytesOffset;let E=A.indexOf("Geometry");if(E!==-1){let S=A.substring(E);A=A.replace(S,"")}y.childTile=A,y.geodes=[];let T=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let S=0;S<T;S++)m=TIi(o,f,m,y.geodes);return v.push(y),m}function PIi(o,f,m,v){let y={},x=[],C=[],w=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let A=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let T=0;T<A;T++)m=SIi(o,f,m,C);y.pageLods=C;let E=m%4;return E!==0&&(m+=4-E),v.groupNode=y,m}function Mot(o,f,m,v){let y=f.getUint32(m,!0);if(v.verticesCount=y,m+=Uint32Array.BYTES_PER_ELEMENT,m<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);C=x*Float32Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;let w=y*x*Float32Array.BYTES_PER_ELEMENT,A=new Uint8Array(o,m,w);m+=w;let E=v.vertexAttributes,T=v.attrLocation;return T.aPosition=E.length,E.push({index:T.aPosition,typedArray:A,componentsPerAttribute:x,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:C,normalize:!1}),m}function Dot(o,f,m,v){let y=f.getUint32(m,!0);if(m+=Uint32Array.BYTES_PER_ELEMENT,y<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let w=y*x*Float32Array.BYTES_PER_ELEMENT,A=new Uint8Array(o,m,w);m+=w;let E=v.vertexAttributes,T=v.attrLocation;return T.aNormal=E.length,E.push({index:T.aNormal,typedArray:A,componentsPerAttribute:x,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:C,normalize:!1}),m}function Lot(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let x=v.verticesCount,C;if(y>0){let E=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint8Array.BYTES_PER_ELEMENT*2;let T=y*Uint8Array.BYTES_PER_ELEMENT*4;C=new Uint8Array(o,m,T).slice(0,T),m+=T}else{C=new Uint8Array(4*x);for(let E=0;E<x;E++)C[E*4]=255,C[E*4+1]=255,C[E*4+2]=255,C[E*4+3]=255}let w=v.vertexAttributes,A=v.attrLocation;return A.aColor=w.length,w.push({index:A.aColor,typedArray:C,componentsPerAttribute:4,componentDatatype:Rt.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),v.vertexColor=C,m}function Rot(o,f,m,v){let y=f.getUint32(m,!0);if(m+=Uint32Array.BYTES_PER_ELEMENT,y<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint8Array.BYTES_PER_ELEMENT*2;let C=y*Uint8Array.BYTES_PER_ELEMENT*4,w=new Uint8Array(o,m,C);m+=C;let A=v.vertexAttributes,E=v.attrLocation;return E.aSecondColor=A.length,A.push({index:E.aSecondColor,typedArray:w,componentsPerAttribute:4,componentDatatype:Rt.UNSIGNED_BYTE,offsetInBytes:0,strideInBytes:4,normalize:!0}),m}function Oot(o,f,m,v){let y=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;for(let x=0;x<y;x++){let C=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let w=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let A=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let E=C*w*Float32Array.BYTES_PER_ELEMENT,T=new Uint8Array(o,m,E);m+=E;let S="aTexCoord"+x,M=v.vertexAttributes,I=v.attrLocation;I[S]=M.length,M.push({index:I[S],typedArray:T,componentsPerAttribute:w,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:w*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}return m}function Not(o,f,m,v){let y=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;let x=v.vertexAttributes,C=v.attrLocation;for(let w=0;w<y;w++){let A=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let E=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let T=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let S=A*E*Float32Array.BYTES_PER_ELEMENT;if(E===17||E===29){let M=new Uint8Array(o,m,S);v.instanceCount=A,v.instanceMode=E,v.instanceBuffer=M,v.instanceIndex=1;let I=E*A*4,P=M.slice(0,I);v.vertexColorInstance=P;let D;E===17?(D=Float32Array.BYTES_PER_ELEMENT*17,C.uv2=x.length,x.push({index:C.uv2,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:D,instanceDivisor:1}),C.uv3=x.length,x.push({index:C.uv3,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv4=x.length,x.push({index:C.uv4,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv5=x.length,x.push({index:C.uv5,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv6=x.length,x.push({index:C.uv6,componentsPerAttribute:4,componentDatatype:Rt.UNSIGNED_BYTE,normalize:!0,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1})):E===29&&(D=Float32Array.BYTES_PER_ELEMENT*29,C.uv1=x.length,x.push({index:C.uv1,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:D,instanceDivisor:1,byteLength:S}),C.uv2=x.length,x.push({index:C.uv2,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv3=x.length,x.push({index:C.uv3,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv4=x.length,x.push({index:C.uv4,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv5=x.length,x.push({index:C.uv5,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv6=x.length,x.push({index:C.uv6,componentsPerAttribute:4,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv7=x.length,x.push({index:C.uv7,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv8=x.length,x.push({index:C.uv8,componentsPerAttribute:4,componentDatatype:Rt.UNSIGNED_BYTE,normalize:!0,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv9=x.length,x.push({index:C.uv9,componentsPerAttribute:4,componentDatatype:Rt.UNSIGNED_BYTE,normalize:!0,offsetInBytes:28*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}))}else{let M=A*E;v.instanceBounds=new Float32Array(M);for(let I=0;I<M;I++)v.instanceBounds[I]=f.getFloat32(m,!0)}m+=S}return m}function IIi(o,f,m,v){let y=f.getUint32(m,!0);if(v.verticesCount=y,m+=Uint32Array.BYTES_PER_ELEMENT,m<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);C=x*Int16Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;let w=f.getFloat32(m,!0);m+=Float32Array.BYTES_PER_ELEMENT;let A={};A.x=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,A.y=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,A.z=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,A.w=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,v.vertCompressConstant=w,v.minVerticesValue=A;let E=y*x*Int16Array.BYTES_PER_ELEMENT,T=new Uint8Array(o,m,E);m+=E;let S=v.vertexAttributes,M=v.attrLocation;return M.aPosition=S.length,S.push({index:M.aPosition,typedArray:T,componentsPerAttribute:x,componentDatatype:Rt.SHORT,offsetInBytes:0,strideInBytes:C,normalize:!1}),m}function MIi(o,f,m,v){let y=f.getUint32(m,!0);if(m+=Uint32Array.BYTES_PER_ELEMENT,y<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let w=y*2*Int16Array.BYTES_PER_ELEMENT,A=new Uint8Array(o,m,w);m+=w;let E=v.vertexAttributes,T=v.attrLocation;return T.aNormal=E.length,E.push({index:T.aNormal,typedArray:A,componentsPerAttribute:2,componentDatatype:Rt.SHORT,offsetInBytes:0,strideInBytes:C,normalize:!1}),m}function DIi(o,f,m,v){v.texCoordCompressConstant=[],v.minTexCoordValue=[];let y=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;for(let x=0;x<y;x++){let C=f.getUint8(m,!0);m+=Uint8Array.BYTES_PER_ELEMENT,m+=Uint8Array.BYTES_PER_ELEMENT*3;let w=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let A=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let E=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let T=f.getFloat32(m,!0);m+=Float32Array.BYTES_PER_ELEMENT,v.texCoordCompressConstant.push(T);let S={};S.x=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,S.y=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,S.z=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,S.w=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,v.minTexCoordValue.push(S);let M=w*A*Int16Array.BYTES_PER_ELEMENT,I=new Uint8Array(o,m,M);m+=M;let P=m%4;P!==0&&(m+=4-P);let D="aTexCoord"+x,L=v.vertexAttributes,R=v.attrLocation;if(R[D]=L.length,L.push({index:R[D],typedArray:I,componentsPerAttribute:A,componentDatatype:Rt.SHORT,offsetInBytes:0,strideInBytes:A*Int16Array.BYTES_PER_ELEMENT,normalize:!1}),C){M=w*Float32Array.BYTES_PER_ELEMENT;let O=new Uint8Array(o,m,M);m+=M,v.texCoordZMatrix=!0,D="aTexCoordZ"+x,R[D]=L.length,L.push({index:R[D],typedArray:O,componentsPerAttribute:1,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:Float32Array.BYTES_PER_ELEMENT,normalize:!1})}}return m}function LIi(o,f,m,v){return m=Mot(o,f,m,v),m=Dot(o,f,m,v),m=Lot(o,f,m,v),m=Rot(o,f,m,v),m=Oot(o,f,m,v),m=Not(o,f,m,v),m}function RIi(o,f,m,v){let y=f.getUint32(m,!0);return v.compressOptions=y,m+=Uint32Array.BYTES_PER_ELEMENT,(y&dw.SVC_Vertex)===dw.SVC_Vertex?m=IIi(o,f,m,v):m=Mot(o,f,m,v),(y&dw.SVC_Normal)===dw.SVC_Normal?m=MIi(o,f,m,v):m=Dot(o,f,m,v),m=Lot(o,f,m,v),m=Rot(o,f,m,v),(y&dw.SVC_TexutreCoord)===dw.SVC_TexutreCoord?m=DIi(o,f,m,v):m=Oot(o,f,m,v),(y&dw.SVC_TexutreCoordIsW)===dw.SVC_TexutreCoordIsW&&(v.textureCoordIsW=!0),m=Not(o,f,m,v),m}function OIi(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let x=0;x<y;x++){let C={},w=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let A=f.getUint8(m,!0);m+=Uint8Array.BYTES_PER_ELEMENT;let E=f.getUint8(m,!0);m+=Uint8Array.BYTES_PER_ELEMENT;let T=f.getUint8(m,!0);if(m+=Uint8Array.BYTES_PER_ELEMENT,m+=Uint8Array.BYTES_PER_ELEMENT,w>0){let I=null,P;A===1||A===3?(P=w*Uint32Array.BYTES_PER_ELEMENT,I=new Uint8Array(o,m,P)):(P=w*Uint16Array.BYTES_PER_ELEMENT,I=new Uint8Array(o,m,P),w%2!==0&&(P+=2)),C.indicesTypedArray=I,m+=P}C.indicesCount=w,C.indexType=A,C.primitiveType=T;let S=[],M=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let I=0;I<M;I++){let P=G6(o,f,m),D=P.string;m=P.bytesOffset,S.push(D),C.materialCode=D}if(m%4!==0){let I=4-m%4;m+=I}v.push(C)}return m}function NIi(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let x=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let w=0;w<x;w++){let A=G6(o,f,m),E=A.string;m=A.bytesOffset;let T=m%4;T!==0&&(m+=4-T);let S=f.getUint32(m,!0);m+=Int32Array.BYTES_PER_ELEMENT;let M={vertexAttributes:[],attrLocation:{},instanceCount:0,instanceMode:0,instanceIndex:-1};S===Z6e.SV_Standard?m=LIi(o,f,m,M):S===Z6e.SV_Compressed&&(m=RIi(o,f,m,M));let I=[];m=OIi(o,f,m,I),v[E]={vertexPackage:M,arrIndexPackage:I}}let C=f.getUint32(m,!0);return m+=C,m+=Uint32Array.BYTES_PER_ELEMENT,m}function FIi(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let x=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let C=0;C<x;C++){let w=G6(o,f,m),A=w.string;m=w.bytesOffset;let E=m%4;E!==0&&(m+=4-E);let T=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let S=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let M=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let I=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let P=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let D=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let L=new Uint8Array(o,m,P);m+=P,v[A]={id:A,width:S,height:M,compressType:I,nFormat:D,internalFormat:Nn.RGBA_DXT5,imageBuffer:L}}return m}function BIi(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let x=new Uint8Array(o,m,y),C=nP(x);return m+=y,v.materials=JSON.parse(C),m}function kIi(o,f,m,v,y){if((v&1)===1){let x=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let C=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let w=0;w<C;w++){let A=G6(o,f,m),E=A.string;m=A.bytesOffset;let T=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let S={};y[E].pickInfo=S;let M=y[E].vertexPackage.instanceIndex;for(let I=0;I<T;I++){let P=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let D=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let L=[];for(let R=0;R<D;R++){let O=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let F=1;M===-1&&(F=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT),L.push({vertexColorOffset:O,vertexColorCount:F})}S[P]=L}}}return m}Iot.parseBuffer=function(o){let f=0,m={version:void 0,groupNode:void 0,geoPackage:{},matrials:void 0,texturePackage:{}},v=new DataView(o);m.version=v.getFloat32(f,!0),f+=Float32Array.BYTES_PER_ELEMENT;let y=v.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;let x=EIi(o,f);v=new DataView(x),f=0;let C=v.getUint32(f,!0);return f+=Uint32Array.BYTES_PER_ELEMENT,f=PIi(x,v,f,m),f=NIi(x,v,f,m.geoPackage),f=FIi(x,v,f,m.texturePackage),f=BIi(x,v,f,m),kIi(x,v,f,C,m.geoPackage),m};var qPe=Iot;function TC(o,f,m,v,y,x,C){this.layer=o,this.parent=f,this.fileName=v,this.isLeafTile=Z(C,!1),this.boundingVolume=this.createBoundingVolume(m,o.modelMatrix);let w=Jr.createIfNeeded(o._baseResource);if(N(f))this.baseUri=f.baseUri;else{let A=new Jr(v);this.baseUri=A.getBaseUri()}this.contentResource=w.getDerivedResource({url:v}),this.serverKey=Rw.getServerKey(this.contentResource.getUrlComponent()),this.request=void 0,this.cacheNode=void 0,this.distanceToCamera=0,this.pixel=0,this.visibilityPlaneMask=0,this.visible=!1,this.children=[],this.lodRangeData=y,this.renderEntityMap=x,this.contentState=a2.UNLOADED,this.readerable=!1,this.touchedFrame=0,this.requestedFrame=0,this.selectedFrame=0,this.priority=0}Object.defineProperties(TC.prototype,{renderable:{get:function(){return N(this.renderEntityMap)}}});var Fot=new H;function VIi(o,f){let m=H.clone(o.center),v=o.radius;m=Ee.multiplyByPoint(f,m,m);let y=Ee.getScale(f,Fot),x=H.maximumComponent(y);return v*=x,new lD(m,v)}function zIi(o,f){let m=new H(o.min.x,o.min.y,o.min.z);Ee.multiplyByPoint(f,m,m);let v=new H(o.max.x,o.max.y,o.max.z);Ee.multiplyByPoint(f,v,v);let y=Pi.fromCornerPoints(m,v,new Pi),x=y.center,C=y.radius,w=Ee.getScale(f,Fot),A=H.maximumComponent(w);return C*=A,new lD(x,C)}TC.prototype.createBoundingVolume=function(o,f){if(this.isLeafTile)return new lD(o.center,o.radius);if(N(o.sphere))return VIi(o.sphere,f);if(N(o.box))return zIi(o.box,f)};TC.prototype.canTraverse=function(){return this.children.length===0||this.isLeafTile?!1:N(this.lodRangeData)?this.pixel>this.lodRangeData:!0};function Bot(o,f){return o.boundingVolume}TC.prototype.getPixel=function(o){let f=this.boundingVolume,m=f.radius,v=f.center,y=H.distance(o.camera.positionWC,v),x=o.context.drawingBufferHeight,C=o.camera.frustum._fovy*.5;return x*.5/Math.tan(C)*m/y};TC.prototype.distanceToTile=function(o){return Bot(this,o).distanceToCamera(o)};TC.prototype.visibility=function(o,f){let m=Bot(this,o);return o.cullingVolume.computeVisibilityWithPlaneMask(m,f)};TC.prototype.updateVisibility=function(o){let f=this.parent,m=N(f)?f.visibilityPlaneMask:hg.MASK_INDETERMINATE;this.distanceToCamera=this.distanceToTile(o),this.pixel=this.getPixel(o),this.visibilityPlaneMask=this.visibility(o,m),this.visible=this.visibilityPlaneMask!==hg.MASK_OUTSIDE};function HIi(o){return function(){return o.priority}}function UIi(o){return function(f){o.contentState=a2.FAILED,o.contentReadyPromise.reject(f)}}function GIi(o,f){let m=o.layer,v=f.length;for(let y=0;y<v;y++){let x=f[y],C=x.boundingVolume,w=x.rangeDataList;w=o.baseUri+w;let A=x.rangeList,E=x.geoMap,T=new TC(m,o,C,w,A,E,x.isLeafTile);o.children.push(T),o.layer._cache.add(T)}}TC.prototype.requestContent=function(){let o=this,f=this.layer,m=this.contentResource.clone(),v=new cg({throttle:!0,throttleByServer:!0,type:Qy.TILES3D,priorityFunction:HIi(this),serverKey:this.serverKey});this.request=v,m.request=v;let y=m.fetchArrayBuffer();if(!N(y))return!1;this.contentState=a2.LOADING,this.contentReadyPromise=pd();let x=UIi(this);return y.then(function(C){if(o.isDestroyed()){x();return}let w=qPe.parseBuffer(C),A=WPe.parse(o.layer,w);GIi(o,A),o.selectedFrame=0,o.contentState=a2.READY,o.contentReadyPromise.resolve(w)}).catch(function(C){if(v.state===bc.CANCELLED){o.contentState=a2.UNLOADED;return}o.contentState=a2.FAILED}),!0};TC.prototype.update=function(o){let f=this.renderEntityMap;for(let m in f)f.hasOwnProperty(m)&&f[m].update(o)};TC.prototype.free=function(){for(let o=0,f=this.children.length;o<f;o++)this.children[o].destroy();this.children.length=0,this.contentState=a2.UNLOADED};TC.prototype.isDestroyed=function(){return!1};TC.prototype.destroy=function(){for(let o in this.renderEntityMap)this.renderEntityMap.hasOwnProperty(o)&&this.renderEntityMap[o].destroy();this.renderEntityMap=void 0;for(let o=0,f=this.children.length;o<f;o++)this.children[o].destroy();return this.children.length=0,kr(this)};var XPe=TC;function dX(o){o=Z(o,Z.EMPTY_OBJECT),kh.defined("options.url",o.url),kh.defined("options.context",o.context),this.context=o.context,this._show=Z(o.show,!0),this._url=void 0,this._basePath=void 0,this._baseResource=void 0,this.modelMatrix=void 0,this.fileType=void 0,this._position=void 0,this._rectangle=void 0,this._rootTiles=[],this._schuduler=new YPe,this._requestTiles=[],this._selectedTiles=[],this._cache=new jPe,this._maximumMemoryUsage=-1,this._totalMemoryUsageInBytes=0,this.loadConfig(o.url)}Object.defineProperties(dX.prototype,{ready:{get:function(){return this._rootTiles.length>0}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._rectangle}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes},set:function(o){this._totalMemoryUsageInBytes=o}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(o){this._maximumMemoryUsage=o}},show:{get:function(){return this._show},set:function(o){this._show=o}}});dX.prototype.loadConfig=function(o){let f=this;this._readyPromise=Promise.resolve(o).then(function(m){let v,y=Jr.createIfNeeded(m);return v=y.getBaseUri(!0),f._url=y.url,f._basePath=v,f._baseResource=y,y.fetchJson()}).then(function(m){let v=m.extensions;f.fileType=v["s3m:FileType"];let y=m.position.x,x=m.position.y,C=m.position.z;f._position=H.fromDegrees(y,x,C),f.modelMatrix=tn.eastNorthUpToFixedFrame(f._position),f._rectangle=Di.fromDegrees(m.geoBounds.left,m.geoBounds.bottom,m.geoBounds.right,m.geoBounds.top);for(let w=0,A=m.tiles.length;w<A;w++){let E=m.tiles[w].url,T={box:m.tiles[w].boundingbox},S=new XPe(f,void 0,T,E);f._cache.add(S),f._rootTiles.push(S)}return f}).catch(function(m){return m})};function WIi(o,f){return o.priority-f.priority}function jIi(o){let f=o._requestTiles,m=f.length;f.sort(WIi);for(let v=0;v<m;++v)f[v].requestContent()}function YIi(o,f){let m=o._selectedTiles,v=m.length;for(let y=0;y<v;y++)m[y].update(f)}function qIi(o,f){}function XIi(o){o._cache.unloadTiles(o,qIi)}dX.prototype.prePassesUpdate=function(o){this.ready&&o.newFrame&&this._cache.reset()};dX.prototype.update=function(o){this.ready&&this._show&&(this._schuduler.scheduler(this,o),jIi(this),YIi(this,o),XIi(this))};var vae=dX;function Dj(o,f,m){let v=f[o.id];if(N(v)){let y=v.primitive;m.remove(y),y.isDestroyed()||y.destroy(),delete f[o.id]}}var yae=`in vec4 position; in vec3 normal; out vec3 v_position; out vec3 v_positionWC; out vec3 v_positionEC; out vec3 v_normalEC; void main() { gl_Position = czm_modelViewProjection * position; v_position = vec3(position); v_positionWC = (czm_model * position).xyz; v_positionEC = (czm_modelView * position).xyz; v_normalEC = czm_normal * normal; } `,lie=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif uniform bool u_showIntersection; uniform bool u_showThroughEllipsoid; uniform float u_radius; uniform float u_xHalfAngle; uniform float u_yHalfAngle; uniform float u_normalDirection; uniform float u_type; in vec3 v_position; in vec3 v_positionWC; in vec3 v_positionEC; in vec3 v_normalEC; vec4 getColor(float sensorRadius, vec3 pointEC) { czm_materialInput materialInput; vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC); materialInput.str = pointMC / sensorRadius; vec3 positionToEyeEC = -v_positionEC; materialInput.positionToEyeEC = positionToEyeEC; vec3 normalEC = normalize(v_normalEC); materialInput.normalEC = u_normalDirection * normalEC; czm_material material = czm_getMaterial(materialInput); return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC), vec4(material.diffuse, material.alpha), 0.4); } bool isOnBoundary(float value, float epsilon) { float width = getIntersectionWidth(); float tolerance = width * epsilon; #ifdef GL_OES_standard_derivatives float delta = max(abs(dFdx(value)), abs(dFdy(value))); float pixels = width * delta; float temp = abs(value); // There are a couple things going on here. // First we test the value at the current fragment to see if it is within the tolerance. // We also want to check if the value of an adjacent pixel is within the tolerance, // but we don't want to admit points that are obviously not on the surface. // For example, if we are looking for "value" to be close to 0, but value is 1 and the adjacent value is 2, // then the delta would be 1 and "temp - delta" would be "1 - 1" which is zero even though neither of // the points is close to zero. return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels); #else return abs(value) < tolerance; #endif } vec4 shade(bool isOnBoundary) { if (u_showIntersection && isOnBoundary) { return getIntersectionColor(); } if(u_type == 1.0){ return getLineColor(); } return getColor(u_radius, v_positionEC); } float ellipsoidSurfaceFunction(vec3 point) { vec3 scaled = czm_ellipsoidInverseRadii * point; return dot(scaled, scaled) - 1.0; } void main() { vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates //vec3 pixDir = normalize(v_position); float positionX = v_position.x; float positionY = v_position.y; float positionZ = v_position.z; vec3 zDir = vec3(0.0, 0.0, 1.0); vec3 lineX = vec3(positionX, 0 ,positionZ); vec3 lineY = vec3(0, positionY, positionZ); float resX = dot(normalize(lineX), zDir); if(resX < cos(u_xHalfAngle)-0.00001){ discard; } float resY = dot(normalize(lineY), zDir); if(resY < cos(u_yHalfAngle)-0.00001){ discard; } // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC(); float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC); // Occluded by the ellipsoid? if (!u_showThroughEllipsoid) { // Discard if in the ellipsoid // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done on the CPU first. if (ellipsoidValue < 0.0) { discard; } // Discard if in the sensor's shadow if (inSensorShadow(sensorVertexWC, v_positionWC)) { discard; } } // Notes: Each surface functions should have an associated tolerance based on the floating point error. bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); //isOnEllipsoid = false; //if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81)){ /*if(false){ out_FragColor = vec4(1.0,0.0,0.0,1.0); }else{ out_FragColor = shade(isOnEllipsoid); } */ out_FragColor = shade(isOnEllipsoid); } `,Lj=`uniform vec4 u_intersectionColor; uniform float u_intersectionWidth; uniform vec4 u_lineColor; bool inSensorShadow(vec3 coneVertexWC, vec3 pointWC) { // Diagonal matrix from the unscaled ellipsoid space to the scaled space. vec3 D = czm_ellipsoidInverseRadii; // Sensor vertex in the scaled ellipsoid space vec3 q = D * coneVertexWC; float qMagnitudeSquared = dot(q, q); float test = qMagnitudeSquared - 1.0; // Sensor vertex to fragment vector in the ellipsoid's scaled space vec3 temp = D * pointWC - q; float d = dot(temp, q); // Behind silhouette plane and inside silhouette cone return (d < -test) && (d / length(temp) < -sqrt(test)); } /////////////////////////////////////////////////////////////////////////////// vec4 getLineColor() { return u_lineColor; } vec4 getIntersectionColor() { return u_intersectionColor; } float getIntersectionWidth() { return u_intersectionWidth; } vec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC) { // (s, t) both in the range [0, 1] float t = pointMC.z / sensorRadius; float s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi); s = s - floor(s); return vec2(s, t); } `,JPe=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif uniform bool u_showIntersection; uniform bool u_showThroughEllipsoid; uniform float u_radius; uniform float u_xHalfAngle; uniform float u_yHalfAngle; uniform float u_normalDirection; uniform vec4 u_color; in vec3 v_position; in vec3 v_positionWC; in vec3 v_positionEC; in vec3 v_normalEC; vec4 getColor(float sensorRadius, vec3 pointEC) { czm_materialInput materialInput; vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz; materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC); materialInput.str = pointMC / sensorRadius; vec3 positionToEyeEC = -v_positionEC; materialInput.positionToEyeEC = positionToEyeEC; vec3 normalEC = normalize(v_normalEC); materialInput.normalEC = u_normalDirection * normalEC; czm_material material = czm_getMaterial(materialInput); material.diffuse = u_color.rgb; material.alpha = u_color.a; return mix(czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC), vec4(material.diffuse, material.alpha), 0.4); } bool isOnBoundary(float value, float epsilon) { float width = getIntersectionWidth(); float tolerance = width * epsilon; #ifdef GL_OES_standard_derivatives float delta = max(abs(dFdx(value)), abs(dFdy(value))); float pixels = width * delta; float temp = abs(value); // There are a couple things going on here. // First we test the value at the current fragment to see if it is within the tolerance. // We also want to check if the value of an adjacent pixel is within the tolerance, // but we don't want to admit points that are obviously not on the surface. // For example, if we are looking for "value" to be close to 0, but value is 1 and the adjacent value is 2, // then the delta would be 1 and "temp - delta" would be "1 - 1" which is zero even though neither of // the points is close to zero. return temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels); #else return abs(value) < tolerance; #endif } vec4 shade(bool isOnBoundary) { if (u_showIntersection && isOnBoundary) { return getIntersectionColor(); } return getColor(u_radius, v_positionEC); } float ellipsoidSurfaceFunction(vec3 point) { vec3 scaled = czm_ellipsoidInverseRadii * point; return dot(scaled, scaled) - 1.0; } void main() { vec3 sensorVertexWC = czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates vec3 sensorVertexEC = czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates //vec3 pixDir = normalize(v_position); float positionX = v_position.x; float positionY = v_position.y; float positionZ = v_position.z; vec3 zDir = vec3(0.0, 0.0, 1.0); vec3 lineX = vec3(positionX, 0 ,positionZ); vec3 lineY = vec3(0, positionY, positionZ); float resX = dot(normalize(lineX), zDir); if(resX < cos(u_xHalfAngle) - 0.0001){ discard; } float resY = dot(normalize(lineY), zDir); if(resY < cos(u_yHalfAngle)- 0.0001){ discard; } // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC(); float ellipsoidValue = ellipsoidSurfaceFunction(v_positionWC); // Occluded by the ellipsoid? if (!u_showThroughEllipsoid) { // Discard if in the ellipsoid // PERFORMANCE_IDEA: A coare check for ellipsoid intersection could be done on the CPU first. if (ellipsoidValue < 0.0) { discard; } // Discard if in the sensor's shadow if (inSensorShadow(sensorVertexWC, v_positionWC)) { discard; } } // Notes: Each surface functions should have an associated tolerane based on the floating point error. bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3); out_FragColor = shade(isOnEllipsoid); } `,$6e=Math.sin,Tz=Math.cos,uie=Math.tan,cie=Math.atan,F2={position:0,normal:1};function kot(o){let f=this;o=Z(o,Z.EMPTY_OBJECT),this.show=Z(o.show,!0),this.slice=Z(o.slice,32),this.modelMatrix=Ee.clone(o.modelMatrix,new Ee),this._modelMatrix=new Ee,this._computedModelMatrix=new Ee,this._computedScanPlaneModelMatrix=new Ee,this.radius=Z(o.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=Z(o.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=Z(o.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=Z(o.lineColor,Re.WHITE),this.showSectorLines=Z(o.showSectorLines,!0),this.showSectorSegmentLines=Z(o.showSectorSegmentLines,!0),this.showLateralSurfaces=Z(o.showLateralSurfaces,!0),this.material=N(o.material)?o.material:zo.fromType(zo.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=N(o.lateralSurfaceMaterial)?o.lateralSurfaceMaterial:zo.fromType(zo.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=Z(o.showDomeSurfaces,!0),this.domeSurfaceMaterial=N(o.domeSurfaceMaterial)?o.domeSurfaceMaterial:zo.fromType(zo.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=Z(o.showDomeLines,!0),this.showIntersection=Z(o.showIntersection,!0),this.intersectionColor=Z(o.intersectionColor,Re.WHITE),this.intersectionWidth=Z(o.intersectionWidth,5),this.showThroughEllipsoid=Z(o.showThroughEllipsoid,!1),this._showThroughEllipsoid=void 0,this.showScanPlane=Z(o.showScanPlane,!0),this.scanPlaneColor=Z(o.scanPlaneColor,Re.WHITE),this.scanPlaneMode=Z(o.scanPlaneMode,"horizontal"),this.scanPlaneRate=Z(o.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=ci.now(),this._boundingSphere=new Pi,this._boundingSphereWC=new Pi,this._sectorFrontCommand=new Jn({owner:this,primitiveType:Fn.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new Jn({owner:this,primitiveType:Fn.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new Jn({owner:this,primitiveType:Fn.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new Jn({owner:this,primitiveType:Fn.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new Jn({owner:this,primitiveType:Fn.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new Jn({owner:this,primitiveType:Fn.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new Jn({owner:this,primitiveType:Fn.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new Jn({owner:this,primitiveType:Fn.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new Jn({owner:this,primitiveType:Fn.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return f.xHalfAngle},u_yHalfAngle:function(){return f.yHalfAngle},u_radius:function(){return f.radius},u_showThroughEllipsoid:function(){return f.showThroughEllipsoid},u_showIntersection:function(){return f.showIntersection},u_intersectionColor:function(){return f.intersectionColor},u_intersectionWidth:function(){return f.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return f.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return f._scanePlaneXHalfAngle},u_yHalfAngle:function(){return f._scanePlaneYHalfAngle},u_radius:function(){return f.radius},u_color:function(){return f.scanPlaneColor},u_showThroughEllipsoid:function(){return f.showThroughEllipsoid},u_showIntersection:function(){return f.showIntersection},u_intersectionColor:function(){return f.intersectionColor},u_intersectionWidth:function(){return f.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return f.lineColor}}}kot.prototype.update=function(o){let f=o.mode;if(!this.show||f!==_i.SCENE3D)return;let m=!1,v=!1,y=!1,x=this.xHalfAngle,C=this.yHalfAngle;if(x<0||C<0)throw new li("halfAngle must be greater than or equal to zero.");if(x===0||C===0)return;(this._xHalfAngle!==x||this._yHalfAngle!==C)&&(this._xHalfAngle=x,this._yHalfAngle=C,m=!0);let w=this.radius;if(w<0)throw new li("this.radius must be greater than or equal to zero.");let A=!1;this._radius!==w&&(A=!0,this._radius=w,this._boundingSphere=new Pi(H.ZERO,this.radius)),(!Ee.equals(this.modelMatrix,this._modelMatrix)||A)&&(Ee.clone(this.modelMatrix,this._modelMatrix),Ee.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),Pi.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC));let E=this.showThroughEllipsoid;this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=E,v=!0);let T=this.material;this._material!==T&&(this._material=T,v=!0,y=!0);let S=T.isTranslucent();if(this._translucent!==S&&(this._translucent=S,v=!0),this.showScanPlane){let D=o.time,L=ci.secondsDifference(D,this._time);L<0&&(this._time=ci.clone(D,this._time));let R=Math.max(L%this.scanPlaneRate/this.scanPlaneRate,0),O;if(this.scanPlaneMode==="horizontal"){O=2*C*R-C;let F=Tz(O),k=uie(x),U=cie(F*k);this._scanePlaneXHalfAngle=U,this._scanePlaneYHalfAngle=O,Ut.fromRotationX(this._scanePlaneYHalfAngle,o5)}else{O=2*x*R-x;let F=uie(C),k=Tz(O),U=cie(k*F);this._scanePlaneXHalfAngle=O,this._scanePlaneYHalfAngle=U,Ut.fromRotationY(this._scanePlaneXHalfAngle,o5)}Ee.multiplyByMatrix3(this.modelMatrix,o5,this._computedScanPlaneModelMatrix),Ee.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix)}m&&tMi(this,o),v&&oMi(this,E,S),y&&nMi(this,o,T),(v||y)&&aMi(this,S);let M=o.commandList,I=o.passes,P=this._colorCommands;if(I.render)for(let D=0,L=P.length;D<L;D++){let R=P[D];M.push(R)}};var o5=new Ut,e8e=new H;function kpe(o,f,m){let v=o.slice,y=Tz(m),x=uie(m),C=Tz(f),w=uie(f),A=cie(C*x),E=cie(y*w),T=[];for(let M=0;M<v;M++){let I=2*A*M/(v-1)-A;T.push(new H(0,$6e(I),Tz(I)))}let S=[];for(let M=0;M<v;M++){let I=2*E*M/(v-1)-E;S.push(new H($6e(I),0,Tz(I)))}return{zoy:T,zox:S}}function JIi(o,f){let m=o.xHalfAngle,v=o.yHalfAngle,y=f.zoy,x=f.zox,C=[],w=Ut.fromRotationY(m,o5);return C.push(y.map(function(A){return Ut.multiplyByVector(w,A,new H)})),w=Ut.fromRotationX(-v,o5),C.push(x.map(function(A){return Ut.multiplyByVector(w,A,new H)}).reverse()),w=Ut.fromRotationY(-m,o5),C.push(y.map(function(A){return Ut.multiplyByVector(w,A,new H)}).reverse()),w=Ut.fromRotationX(v,o5),C.push(x.map(function(A){return Ut.multiplyByVector(w,A,new H)})),C}function KIi(o,f){let m=Array.prototype.concat.apply([],f).length-f.length,v=new Float32Array(2*3*3*m),y=0;for(let A=0,E=f.length;A<E;A++){let T=f[A],S=H.normalize(H.cross(T[0],T[T.length-1],e8e),e8e);for(let M=0,I=T.length-1;M<I;M++)v[y++]=0,v[y++]=0,v[y++]=0,v[y++]=-S.x,v[y++]=-S.y,v[y++]=-S.z,v[y++]=T[M].x,v[y++]=T[M].y,v[y++]=T[M].z,v[y++]=-S.x,v[y++]=-S.y,v[y++]=-S.z,v[y++]=T[M+1].x,v[y++]=T[M+1].y,v[y++]=T[M+1].z,v[y++]=-S.x,v[y++]=-S.y,v[y++]=-S.z}let x=Ao.createVertexBuffer({context:o,typedArray:v,usage:gn.STATIC_DRAW}),C=2*3*Float32Array.BYTES_PER_ELEMENT,w=[{index:F2.position,vertexBuffer:x,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:C},{index:F2.normal,vertexBuffer:x,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:C}];return new Du({context:o,attributes:w})}function QIi(o,f){let m=f.length,v=new Float32Array(3*3*m),y=0;for(let A=0,E=f.length;A<E;A++){let T=f[A];v[y++]=0,v[y++]=0,v[y++]=0,v[y++]=T[0].x,v[y++]=T[0].y,v[y++]=T[0].z}let x=Ao.createVertexBuffer({context:o,typedArray:v,usage:gn.STATIC_DRAW}),C=3*Float32Array.BYTES_PER_ELEMENT,w=[{index:F2.position,vertexBuffer:x,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:C}];return new Du({context:o,attributes:w})}function ZIi(o,f){let m=Array.prototype.concat.apply([],f).length-f.length,v=new Float32Array(3*3*m),y=0;for(let A=0,E=f.length;A<E;A++){let T=f[A];for(let S=0,M=T.length-1;S<M;S++)v[y++]=T[S].x,v[y++]=T[S].y,v[y++]=T[S].z,v[y++]=T[S+1].x,v[y++]=T[S+1].y,v[y++]=T[S+1].z}let x=Ao.createVertexBuffer({context:o,typedArray:v,usage:gn.STATIC_DRAW}),C=3*Float32Array.BYTES_PER_ELEMENT,w=[{index:F2.position,vertexBuffer:x,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:C}];return new Du({context:o,attributes:w})}function $Ii(o){let f=V0.createGeometry(new V0({vertexFormat:un.POSITION_ONLY,stackPartitions:32,slicePartitions:32}));return Du.fromGeometry({context:o,geometry:f,attributeLocations:F2,bufferUsage:gn.STATIC_DRAW,interleave:!1})}function eMi(o){let f=Bw.createGeometry(new Bw({vertexFormat:un.POSITION_ONLY,stackPartitions:32,slicePartitions:32}));return Du.fromGeometry({context:o,geometry:f,attributeLocations:F2,bufferUsage:gn.STATIC_DRAW,interleave:!1})}function t8e(o,f){let m=f.length-1,v=new Float32Array(3*3*m),y=0;for(let A=0;A<m;A++)v[y++]=0,v[y++]=0,v[y++]=0,v[y++]=f[A].x,v[y++]=f[A].y,v[y++]=f[A].z,v[y++]=f[A+1].x,v[y++]=f[A+1].y,v[y++]=f[A+1].z;let x=Ao.createVertexBuffer({context:o,typedArray:v,usage:gn.STATIC_DRAW}),C=3*Float32Array.BYTES_PER_ELEMENT,w=[{index:F2.position,vertexBuffer:x,componentsPerAttribute:3,componentDatatype:Rt.FLOAT,offsetInBytes:0,strideInBytes:C}];return new Du({context:o,attributes:w})}function tMi(o,f){let m=f.context,v=kpe(o,o.xHalfAngle,o.yHalfAngle),y=JIi(o,v);if(o.showLateralSurfaces&&(o._sectorVA=KIi(m,y)),o.showSectorLines&&(o._sectorLineVA=QIi(m,y)),o.showSectorSegmentLines&&(o._sectorSegmentLineVA=ZIi(m,y)),o.showDomeSurfaces&&(o._domeVA=$Ii(m)),o.showDomeLines&&(o._domeLineVA=eMi(m)),o.showScanPlane)if(o.scanPlaneMode==="horizontal"){let x=kpe(o,xe.PI_OVER_TWO,0);o._scanPlaneVA=t8e(m,x.zox)}else{let x=kpe(o,0,xe.PI_OVER_TWO);o._scanPlaneVA=t8e(m,x.zoy)}}function iMi(o,f,m){let v=f.context,y=yae,x=new Zr({sources:[Lj,m.shaderSource,lie]});o._sp=Rs.replaceCache({context:v,shaderProgram:o._sp,vertexShaderSource:y,fragmentShaderSource:x,attributeLocations:F2});let C=new Zr({sources:[Lj,m.shaderSource,lie],pickColorQualifier:"uniform"});o._pickSP=Rs.replaceCache({context:v,shaderProgram:o._pickSP,vertexShaderSource:y,fragmentShaderSource:C,attributeLocations:F2})}function rMi(o,f,m){let v=f.context,y=yae,x=new Zr({sources:[Lj,m.shaderSource,JPe]});o._scanePlaneSP=Rs.replaceCache({context:v,shaderProgram:o._scanePlaneSP,vertexShaderSource:y,fragmentShaderSource:x,attributeLocations:F2})}function nMi(o,f,m){iMi(o,f,m),o.showScanPlane&&rMi(o,f,m)}function oMi(o,f,m){m?(o._frontFaceRS=Mn.fromCache({depthTest:{enabled:!f},depthMask:!1,blending:Mu.ALPHA_BLEND,cull:{enabled:!0,face:uh.BACK}}),o._backFaceRS=Mn.fromCache({depthTest:{enabled:!f},depthMask:!1,blending:Mu.ALPHA_BLEND,cull:{enabled:!0,face:uh.FRONT}}),o._pickRS=Mn.fromCache({depthTest:{enabled:!f},depthMask:!1,blending:Mu.ALPHA_BLEND})):(o._frontFaceRS=Mn.fromCache({depthTest:{enabled:!f},depthMask:!0}),o._pickRS=Mn.fromCache({depthTest:{enabled:!0},depthMask:!0}))}function $V(o,f,m,v,y,x,C,w,A,E,T,S){E&&m&&(m.vertexArray=C,m.renderState=y,m.shaderProgram=x,m.uniformMap=va(w,o._material._uniforms),m.uniformMap.u_normalDirection=function(){return-1},m.pass=T,m.modelMatrix=A,o._colorCommands.push(m)),f.vertexArray=C,f.renderState=v,f.shaderProgram=x,f.uniformMap=va(w,o._material._uniforms),S&&(f.uniformMap.u_type=function(){return 1}),f.pass=T,f.modelMatrix=A,o._colorCommands.push(f)}function aMi(o,f){o._colorCommands.length=0;let m=f?vr.TRANSLUCENT:vr.OPAQUE;o.showLateralSurfaces&&$V(o,o._sectorFrontCommand,o._sectorBackCommand,o._frontFaceRS,o._backFaceRS,o._sp,o._sectorVA,o._uniforms,o._computedModelMatrix,f,m),o.showSectorLines&&$V(o,o._sectorLineCommand,void 0,o._frontFaceRS,o._backFaceRS,o._sp,o._sectorLineVA,o._uniforms,o._computedModelMatrix,f,m,!0),o.showSectorSegmentLines&&$V(o,o._sectorSegmentLineCommand,void 0,o._frontFaceRS,o._backFaceRS,o._sp,o._sectorSegmentLineVA,o._uniforms,o._computedModelMatrix,f,m,!0),o.showDomeSurfaces&&$V(o,o._domeFrontCommand,o._domeBackCommand,o._frontFaceRS,o._backFaceRS,o._sp,o._domeVA,o._uniforms,o._computedModelMatrix,f,m),o.showDomeLines&&$V(o,o._domeLineCommand,void 0,o._frontFaceRS,o._backFaceRS,o._sp,o._domeLineVA,o._uniforms,o._computedModelMatrix,f,m,!0),o.showScanPlane&&$V(o,o._scanPlaneFrontCommand,o._scanPlaneBackCommand,o._frontFaceRS,o._backFaceRS,o._scanePlaneSP,o._scanPlaneVA,o._scanUniforms,o._computedScanPlaneModelMatrix,f,m)}var KPe=kot,i8e=new Ut,sMi=new H,lMi=new H,uMi=new Gr,r8e=new H,cMi=new Gr,W6=function(o,f){if(!N(o))throw new li("scene is required.");if(!N(f))throw new li("entityCollection is required.");f.collectionChanged.addEventListener(W6.prototype._onCollectionChanged,this),this._scene=o,this._primitives=o.primitives,this._entityCollection=f,this._hash={},this._entitiesToVisualize=new wa,this._onCollectionChanged(f,f.values,[],[])};W6.prototype.update=function(o){if(!N(o))throw new li("time is required.");let f=this._entitiesToVisualize.values,m=this._hash,v=this._primitives;for(let y=0,x=f.length;y<x;y++){let C=f[y],w=C._rectangularSensor,A,E,T,S,M,I=m[C.id],P=C.isShowing&&C.isAvailable(o)&&vt.getValueOrDefault(w._show,o,!0);if(P&&(A=vt.getValueOrUndefined(C._position,o,sMi),E=vt.getValueOrUndefined(C._orientation,o,uMi),T=vt.getValueOrUndefined(w._radius,o),S=vt.getValueOrUndefined(w._xHalfAngle,o),M=vt.getValueOrUndefined(w._yHalfAngle,o),P=N(A)&&N(S)&&N(M)),!P){N(I)&&(I.primitive.show=!1);continue}let D=N(I)?I.primitive:void 0;N(D)||(D=new KPe,D.id=C,v.add(D),I={primitive:D,position:void 0,orientation:void 0},m[C.id]=I);let L=vt.getValueOrUndefined(w._gaze,o);if(N(L)){let R=vt.getValueOrUndefined(L._position,o,lMi);if(!N(A)||!N(R))continue;let O=H.subtract(A,R,r8e),F=H.angleBetween(H.UNIT_Z,O),k=H.cross(H.UNIT_Z,O,r8e),U=Gr.fromAxisAngle(k,F-Math.PI,cMi);T=H.distance(A,R),D.modelMatrix=Ee.fromRotationTranslation(Ut.fromQuaternion(U,i8e),A,D.modelMatrix)}else(!H.equals(A,I.position)||!Gr.equals(E,I.orientation))&&(N(E)?(D.modelMatrix=Ee.fromRotationTranslation(Ut.fromQuaternion(E,i8e),A,D.modelMatrix),I.position=H.clone(A,I.position),I.orientation=Gr.clone(E,I.orientation)):(D.modelMatrix=tn.eastNorthUpToFixedFrame(A),I.position=H.clone(A,I.position)));D.show=!0,D.gaze=L,D.radius=T,D.xHalfAngle=S,D.yHalfAngle=M,D.lineColor=vt.getValueOrDefault(w._lineColor,o,Re.WHITE),D.showSectorLines=vt.getValueOrDefault(w._showSectorLines,o,!0),D.showSectorSegmentLines=vt.getValueOrDefault(w._showSectorSegmentLines,o,!0),D.showLateralSurfaces=vt.getValueOrDefault(w._showLateralSurfaces,o,!0),D.material=O0.getValue(o,w._material,D.material),D.showDomeSurfaces=vt.getValueOrDefault(w._showDomeSurfaces,o,!0),D.showDomeLines=vt.getValueOrDefault(w._showDomeLines,o,!0),D.showIntersection=vt.getValueOrDefault(w._showIntersection,o,!0),D.intersectionColor=vt.getValueOrDefault(w._intersectionColor,o,Re.WHITE),D.intersectionWidth=vt.getValueOrDefault(w._intersectionWidth,o,1),D.showThroughEllipsoid=vt.getValueOrDefault(w._showThroughEllipsoid,o,!0),D.scanPlaneMode=vt.getValueOrDefault(w._scanPlaneMode,o),D.scanPlaneColor=vt.getValueOrDefault(w._scanPlaneColor,o,Re.WHITE),D.showScanPlane=vt.getValueOrDefault(w._showScanPlane,o,!0),D.scanPlaneRate=vt.getValueOrDefault(w._scanPlaneRate,o,1)}return!0};W6.prototype.isDestroyed=function(){return!1};W6.prototype.destroy=function(){let o=this._entitiesToVisualize.values,f=this._hash,m=this._primitives;for(let v=o.length-1;v>-1;v--)Dj(o[v],f,m);return kr(this)};W6.prototype._onCollectionChanged=function(o,f,m,v){let y,x,C=this._entitiesToVisualize,w=this._hash,A=this._primitives;for(y=f.length-1;y>-1;y--)x=f[y],N(x._rectangularSensor)&&N(x._position)&&C.set(x.id,x);for(y=v.length-1;y>-1;y--)x=v[y],N(x._rectangularSensor)&&N(x._position)?C.set(x.id,x):(Dj(x,w,A),C.remove(x.id));for(y=m.length-1;y>-1;y--)x=m[y],Dj(x,w,A),C.remove(x.id)};var QPe=W6,hMi={},dMi=Sq.defaultVisualizersCallback;Sq.defaultVisualizersCallback=function(o,f,m){let v=m.entities;return dMi(o,f,m).concat([new QPe(o,v)])};var Vot=hMi;function xae(){this.slopeRamp=[0,.29,.5,Math.sqrt(2)/2,.87,.91,1],this._material=null}xae.prototype.getColorRamp=function(o,f){let m=document.createElement("canvas");m.width=100,m.height=1;let v=m.getContext("2d"),y=v.createLinearGradient(0,0,100,0);for(let x=0;x<o.length;x++)y.addColorStop(f[x],o[x]);return v.fillStyle=y,v.fillRect(0,0,100,1),m};xae.prototype.updateMaterial=function(o,f){if(!this._material){let v=zo.fromType("SlopeRamp");this._material=v}let m=this._material.uniforms;return m.image=this.getColorRamp(o,f),this._material};xae.prototype.getMaterial=function(){return this._material};function Dv(o){this._scene=o,this._regionTexture=new mPe(o),this._positions=[],this._regionDirty=!1,this._slopeColor=new xae,this._colors=[],this._slopeType=Dv.SLOPE_NONE}Dv.SLOPE_NONE=0;Dv.SLOPE_ARROW=1;Dv.SLOPE_COLOR=2;Dv.SLOPE_BOTH=3;Object.defineProperties(Dv.prototype,{slopeType:{get:function(){return this._slopeType},set:function(o){this._slopeType!==o&&(this._slopeType=o,this.updateGlobeMaterial(o))}},regionEnabled:{get:function(){return this._regionEnabled},set:function(o){this._regionEnabled!==o&&(this._regionEnabled=o,this.updateGlobeRegion(o))}}});Dv.prototype.updateGlobeMaterial=function(o){let f=this._scene.globe;o===Dv.SLOPE_ARROW?(f.slopeArrowTextureEnable=!0,f.material=null):o===Dv.SLOPE_COLOR?(f.material=this._slopeColor.getMaterial(),f.slopeArrowTextureEnable=!1):o===Dv.SLOPE_BOTH?(f.material=this._slopeColor.getMaterial(),f.slopeArrowTextureEnable=!0):(f.material=null,f.slopeArrowTextureEnable=!1)};Dv.prototype.updateGlobeRegion=function(o){let f=this._scene.globe;f.slopeRegionTextureEnable=o};Dv.prototype.setPositions=function(o){if(o&&o instanceof Array&&o.length>0){this._positions=o;let f=this._scene.globe;f.regionPositions=this._positions;return}console.log("\u9700\u8981[longitude1,latitude1,longitude2,latitude2,...]")};Dv.prototype.setColorsAndAngles=function(o,f){if(o&&o instanceof Array&&o.length>0&&f&&f instanceof Array&&f.length>0){this._colors=o,this._angles=f,this._colorsDirty=!0,this.update();return}console.log('\u9700\u8981\u989C\u8272\u6570\u7EC4["#000000","#000120","#030000","#050000",...]'),console.log('\u9700\u8981\u7B49\u5206\u6570\u7EC4["0.1","0.2","0.3",..."1.0"]')};Dv.prototype.update=function(){this._regionDirty&&(this._regionDirty=!1,this._regionTexture.addPolygon(this._positions)),this._colorsDirty&&(this._colorsDirty=!1,this._slopeColor.updateMaterial(this._colors,this._angles))};Dv.prototype.destroy=function(){this._regionTexture.destroy()};var Cae=Dv,fMi=` precision highp sampler3D; uniform sampler2D colorTexture; uniform sampler2D depthTexture; in vec2 v_textureCoordinates; uniform mat4 u_inversModelView; uniform mat4 u_inversModelMatrix; #define EPSILON 0.0001 #define PI 3.14159 #define MAX_ITERATION 256 // \u6700\u5927\u5FAA\u73AF\u6B21\u6570 #define SUN_STEPS 1 precision highp sampler2D; precision highp sampler3D; precision highp float; uniform sampler3D detail_map; uniform sampler3D detail_map_high; uniform sampler2D weather_map; uniform sampler2D blue_noise; uniform sampler2D mark_noise; vec3 skyMin = vec3( -0.5, -0.5, -0.5 ); // \u5929\u7A7A\u7684\u6700\u5C0F\u4F4D\u7F6E\uFF0C\u5DE6\u4E0B\u89D2 vec3 skyMax = vec3( 0.5, 0.5, 0.5 ); // \u5929\u7A7A\u7684\u6700\u5927\u4F4D\u7F6E\uFF0C\u53F3\u4E0A\u89D2 uniform float u_time; vec3 u_sunPosition; uniform bool wind_animation; uniform float wind_speed; uniform vec3 wind_direction; uniform vec3 sun_color; uniform float global_coverage; uniform float global_density; uniform float global_lightAbsorption; uniform float cloud_in_scatter; uniform float cloud_out_scatter; uniform float cloud_scatter_ratio; uniform float cloud_silver_intensity; uniform float cloud_silver_exponent; uniform float cloud_out_scatter_ambient; uniform float highlightScale; uniform float backScale; uniform float attenuationScale; bool use_blue_noise = true; bool use_quarter_update = false; float uvScale = 1.0; float getDistance(sampler2D depthTexture, vec2 texCoords) { float depth = czm_unpackDepth(texture(depthTexture, texCoords)); if (depth == 0.0) { return czm_infinity; } vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); return -eyeCoordinate.z / eyeCoordinate.w; } vec2 rayIntersectsBox(vec3 rayOrigin, vec3 rayDirection, vec3 boxMin, vec3 boxMax) { vec3 invRayDir = 1.0 / rayDirection; vec3 tMin = (boxMin - rayOrigin) * invRayDir; vec3 tMax = (boxMax - rayOrigin) * invRayDir; vec3 t1 = min(tMin, tMax); vec3 t2 = max(tMin, tMax); float tNear = max(max(t1.x, t1.y), t1.z); float tFar = min(min(t2.x, t2.y), t2.z); if (tFar < 0.0 || tNear > tFar) { return vec2(-1.0, -1.0); // no intersection } return vec2(tNear, tFar); // intersection } // \u91CD\u6620\u5C04,\u5C06v\u4ECElo\u6620\u5C04\u5230ho float R(float v, float lo, float ho, float ln, float hn) { return ln + (v - lo) * (hn - ln) / (ho - lo); } // \u5C06v\u9650\u5236\u57280.0~1.0\u4E4B\u95F4 float SAT(float v) { return clamp(v, 0.0, 1.0); } // \u7EBF\u6027\u5DEE\u503C float LERP(float v0, float v1, float i) { return (1.0 - i) * v0 + i * v1; } // \u968F\u7740\u9AD8\u5EA6\u53D8\u5316\uFF0C\u786E\u5B9A\u4E91\u603B\u4F53\u5F62\u72B6,SRb\u4F7F\u5E95\u90E8\u6241\u5E73,SRt\u4F7F\u9876\u90E8\u6E10\u6DE1 float HeightAlter(float ph, vec4 map) { // round bottom SRb\u4F7F\u5E95\u90E8\u6241\u5E73 float SRb = SAT(R(ph, 0.0 , 0.4, 0.0, 1.0)); // round top SRt\u4F7F\u9876\u90E8\u6E10\u6DE1 float w_h = SAT(map.b + 0.12); // \u6700\u9AD8\u4E91\u9AD8 float SRt = SAT(R(ph, w_h * 0.2, w_h, 1.0, 0.1)); return SRb * SRt; } // \u968F\u7740\u9AD8\u5EA6\u53D8\u5316,\u786E\u5B9A\u4E91\u6574\u4F53\u5BC6\u5EA6: DRb\u964D\u4F4E\u5E95\u90E8\u5BC6\u5EA6, DRt\u9876\u90E8\u5BC6\u5EA6\u6DE1\u51FA float DensityAlter(float p_h, vec4 map) { float g_d = global_density; // reduce density as base float DRb = p_h * SAT(R(p_h, 0.0, 0.2, 0.0, 1.0)); // reduce density at top float DRt = SAT(R(p_h, 0.9, 1.0, 1.0, 0.0)); // apply weather_map density float DA = g_d * DRb * DRt * map.a * 2.0; return DA; } // \u5728\u70B9\u7684\u4F4D\u7F6E\u5904\u91C7\u6837\u5BC6\u5EA6 float SampleDensity(vec3 p) { float density = 0.0; // \u5728\u5929\u7A7A\u4E2D\uFF0C\u4E91\u5C42\u7684\u9AD8\u5EA6 if(p.x > skyMin.x && p.x < skyMax.x && p.y > skyMin.y && p.y < skyMax.y && p.z > skyMin.z && p.z < skyMax.z) { // \u5750\u6807\u7531\u5929\u7A7A\u7684\u6700\u5C0F\u6700\u5927\u4F4D\u7F6E\u8F6C\u6362\u52300.0~1.0\u4E4B\u95F4 float u = R(p.x, skyMin.x, skyMax.x, 0.0, 1.0); float v = R(p.y, skyMin.y, skyMax.y, 0.0, 1.0); // \u4EE3\u8868\u9AD8\u5EA6 float w = R(p.z, skyMin.z, skyMax.z, 0.0, 1.0); // weather_map \u5929\u6C14\u56FE\u4FE1\u606F[r:\u4E91\u7684\u4F4E\u9891\u8986\u76D6\u7387\uFF0C g:\u4E91\u7684\u9AD8\u9891\u80A1\u6982\u7387,b\u7528\u4E8E\u8BA1\u7B97\u6700\u9AD8\u4E91\u9AD8,a:\u4E91\u7684\u5BC6\u5EA6] vec4 map = texture(weather_map, vec2(u + sin(u_time * 0.2), w + cos(u_time * 0.2)) * uvScale) ; //vec4 map = texture(weather_map, vec2(u, w)); // \u4E91\u51FA\u73B0\u7684\u6982\u7387 float g_c = global_coverage; float WM = SAT(max(map.r, SAT(g_c) * map.g * 2.0)); WM = WM < 0.2 ? WM : WM * 2.0; // \u786E\u5B9A\u4E91\u6574\u4F53\u5F62\u72B6 float SA = HeightAlter(v, map); //float SA = 0.4; // \u786E\u5B9A\u4E91\u6574\u4F53\u5BC6\u5EA6 float DA = DensityAlter(v, map); // detail_map \u7EC6\u8282\u566A\u58F0\u56FEPerlin-Worley[r:\u4F4E\u9891, g:\u4E2D\u9891, b: \u9AD8\u9891, a:\u66F4\u9AD8\u9891] // \u901A\u8FC7\u91C7\u6837,\u5E76\u8FDB\u884C\u52A0\u6743\u5E73\u5747,\u540E\u9762\u4F7F\u7528SN_sample\u503C\u53BB\u548C\u4E2D\u4F53\u5F62\u72B6\u53C2\u6570SA\u53BB\u4E58\u79EF,\u83B7\u5F97\u6700\u540E\u7684\u884C\u72B6\u503C, vec4 sn = texture(detail_map, 0.5 + 0.3 * vec3(p.x, p.y, p.z) * uvScale); float SN_sample = R(sn.r, (sn.g * 0.625 + sn.b * 0.25 + sn.a * 0.125) - 1.0, 1.0, 0.0, 1.0); vec4 dn = texture(detail_map_high, (wind_animation ? u_time * wind_speed * normalize(wind_direction): vec3(0.0)) + 0.75 * vec3(p.x, p.y, p.z) * uvScale); // \u5206\u578B\u5E03\u6717\u52A0\u6743\u5E73\u5747 float DN_fbm = dn.r * 0.625 + dn.g * 0.25 + dn.b * 0.125; density = SAT(R(SN_sample * SA * DN_fbm, 1.0 - WM, 1.0, 0.0, 1.0)) * DA; } return density; } float HG(float cosTheta, float g) { float g2 = g * g; return ((1.0 - g2) / pow(1.0 + g2 - 2.0 * g * cosTheta, 1.5)) / 4.0 * PI; } // \u6563\u5C04 float InOutScatter(float cosTheta, float exponent) { float hg1 = HG(cosTheta, cloud_in_scatter); float hg2 = cloud_silver_intensity * pow(SAT(cosTheta), exponent); float in_scatter_hg = max(hg1, hg2); float out_scatter_hg = HG(cosTheta, -cloud_out_scatter); return LERP(in_scatter_hg, out_scatter_hg, cloud_scatter_ratio); } // \u8870\u51CF float Attenuation(float densityToSun, float cosTheta) { float horizonFactor = pow(1.0 - abs(dot(normalize(u_sunPosition), vec3(0, 1, 0))), 2.0); float absorption = mix(0.2, global_lightAbsorption, horizonFactor); float prim = exp(-absorption * densityToSun); float scnd = exp(-absorption * 0.2) * 0.7; float checkval = R(cosTheta, 0.0, 1.0, scnd, scnd * 0.5); return max(checkval, prim); } float OutScatterAmbient(float density, float ph) { float depth = cloud_out_scatter_ambient * pow(density, R(ph, 0.3, 0.9, 0.5, 1.0)); float vertical = pow(SAT(R(ph, 0.0, 0.3, 0.8, 1.0)), 0.8); float out_scatter = depth * vertical; return 1.0 - SAT(out_scatter); } // \u706F\u5149\u6B65\u8FDB float LightMarch(vec3 p, float cosTheta) { // \u592A\u9633\u65B9\u5411 vec3 direction = normalize(u_sunPosition); // \u6B65\u957F1\u6B21 float stepSize = 0.25 * (skyMax.y - skyMin.y) / float(SUN_STEPS); float totalDensity = 0.0; for(int step = 0; step < SUN_STEPS; ++step) { // \u8BA1\u7B97\u65B9\u5411 p += direction * stepSize; // \u91C7\u6837\u5BC6\u5EA6 totalDensity += max(0.0, SampleDensity(p) * stepSize); } // \u8870\u51CF float transmittance = Attenuation(totalDensity, cosTheta); return transmittance; } void getColor(){ vec4 sceneColor = texture(colorTexture, v_textureCoordinates); // \u91C7\u6837\u80CC\u666F\u8272 vec4 out_color = sceneColor; // \u8BE5\u70B9\u7684\u5C04\u7EBF vec3 rayDir = czm_windowToEyeCoordinates(gl_FragCoord.xy, -1.0).xyz; rayDir = (u_inversModelView * vec4(rayDir, 0.0)).xyz; vec3 vOrigin = vec3(0.0,0.0,0.0); vOrigin = (u_inversModelView * vec4(vOrigin, 1.0)).xyz; // \u592A\u9633\u8F6C\u6362\u5230\u6A21\u578B\u7A7A\u95F4\u4E2D u_sunPosition = (u_inversModelMatrix * vec4(czm_sunDirectionWC, 0.0)).xzy; vec2 bounds = rayIntersectsBox(vOrigin, rayDir, skyMin, skyMax); if ( bounds.y > 0.0 ) { bounds.x = max( bounds.x, 0.0 ); // \u6DF1\u5EA6\u6BD4\u8F83 float distance = getDistance(depthTexture, v_textureCoordinates); if(distance > bounds.x){ // update pixel // \u4F7F\u7528\u56DB\u5206\u4E4B\u4E00\u66F4\u65B0\uFF1F\uFF1F //if (use_quarter_update && int(gl_FragCoord.y * 4.0 + gl_FragCoord.x) % 16 != updatePixel) { // return; //} // get ray direction into the scene \u83B7\u53D6\u5C04\u7EBF // \u8F6C\u6362\u5230-1~1\u7684\u4F4D\u7F6E //vec2 uv = (2.0 * gl_FragCoord.xy - resolution.xy) / resolution.xy; // \u76F8\u673A\u4F4D\u7F6E vec3 rayOrigin = vOrigin + bounds.x * rayDir; // \u5C04\u7EBF\u65B9\u5411 vec3 rayDirection = rayDir; rayOrigin = rayOrigin.xzy; rayDirection = rayDirection.xzy; // \u592A\u9633\u65B9\u5411 vec3 sunDirection = normalize(u_sunPosition); // \u592A\u9633\u4E0E\u5C04\u7EBF\u65B9\u5411 float cosTheta = dot(sunDirection, rayDirection); // ray march along the ray direction \u6CBF\u7740\u5C04\u7EBF\u65B9\u5411\u6B65\u8FDB float stepSize = 2.0; float dist_start = 0.0; // \u4F7F\u7528\u84DD\u566A\u58F0\uFF1F\uFF1F //if(use_blue_noise) // dist_start += (texture(blue_noise, uv).r - 0.5) * 2.0 * stepSize; float attenuation = 1.0; // \u8870\u51CF float totalDensity = 0.0; // \u603B\u7684\u5BC6\u5EA6 float distanceTravelled = dist_start; vec3 firstHit = vec3(1000); // far clipping plane \u8FDC\u88C1\u5207\u9762 // \u6700\u5927\u5FAA\u73AF\u6B21\u6570 for(float i = bounds.x; i < bounds.y; i += stepSize ) { // \u5C04\u7EBF\u65B9\u5411\u7684\u4F4D\u7F6E vec3 rayPosition = rayOrigin + rayDirection * distanceTravelled; // \u906E\u7F69 float rAlpha = 1.0-texture(mark_noise, rayPosition.xz + 0.5).r; rAlpha = rAlpha < 0.01 ? 0.0 : rAlpha; if(rayPosition.x < -0.499 || rayPosition.x > 0.499 || rayPosition.z < -0.499 || rayPosition.z > 0.499) { rAlpha = rAlpha * 0.1; } // \u7B80\u5355\u91C7\u6837 float density = SampleDensity(rayPosition) * rAlpha / stepSize; if(rayOrigin.y > 0.499) { density = sin(density) * 0.2; } // \u5BC6\u5EA6\u7D2F\u52A0 totalDensity += density; // \u5BC6\u5EA6\u9650\u5236 if(totalDensity >= 1.0) { totalDensity = 1.0; break; } if(density > 0.0) { // \u5BC6\u5EA6>0 // \u51FB\u4E2Dbox\u6700\u540E\u4E00\u4E2A\u70B9 if(firstHit == vec3(1000)) firstHit = rayPosition - rayDirection * dist_start; // \u706F\u5149\u6B65\u8FDB float transmittance = LightMarch(rayPosition, cosTheta); // \u5927\u6C14\u6563\u5C04 float scatter = OutScatterAmbient(density, R(rayPosition.y, skyMin.y, skyMax.y, 0.0, 1.0)); // \u8BA1\u7B97\u8870\u51CF attenuation *= transmittance * scatter * attenuationScale; } // \u6B65\u8FDB distanceTravelled += stepSize; } // calculate final color \u8BA1\u7B97\u6700\u540E\u7684\u989C\u8272 float horizonFactor = pow(1.0 - SAT(dot(sunDirection, vec3(0, 1, 0))), 2.0); vec3 sunColor = mix(vec3(0.83, 0.87, 0.9), vec3(0.89, 0.76, 0.59), horizonFactor); // \u6307\u6570 float exponent = mix(1.5, 2.3, horizonFactor); float highlight = LERP(1.0, InOutScatter(cosTheta, exponent), horizonFactor); vec3 color = sunColor * attenuation * highlight * pow(SAT(1.2 - horizonFactor), 0.5) * highlightScale; // gamma //color = pow( clamp(color*1.1-0.02,0.0,1.0), vec3(0.4545) ); // contrast \u5BF9\u6BD4\u5EA6 //color = color*color*(3.0-2.0*color); // \u6DF7\u5408\u6700\u7EC8\u7684\u989C\u8272 vec3 finalColor = mix(sceneColor.rgb, color, totalDensity * backScale ); // \u6700\u7EC8\u7684\u989C\u8272 out_color = vec4(finalColor, 1.0); } } float exposure = 2.0; out_color.rgb = vec3(1.0) - exp(-out_color.rgb * exposure); out_FragColor = out_color; } void main() { getColor(); } `;function n8e(o,f,m,v){let y=new Uint8Array(f),x=Math.ceil(Math.sqrt(y.length));return new BAe({width:m,height:m,depth:m,context:o,pixelFormat:v?Nn.RGBA:Nn.RGB,pixelDataType:Rn.UNSIGNED_BYTE,source:{width:x,height:x,arrayBufferView:y},sampler:new gs({wrapR:ha.MIRRORED_REPEAT,wrapS:ha.MIRRORED_REPEAT,wrapT:ha.MIRRORED_REPEAT,minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR})})}function o8e(o,f,m){let v=f;return new _o({context:o,source:v,sampler:new gs({wrapS:ha.MIRRORED_REPEAT,wrapT:ha.MIRRORED_REPEAT,minificationFilter:Xa.LINEAR,magnificationFilter:Zu.LINEAR})})}function pMi(o){let f=[],m=o.detail_noise_high,v=new Jr({url:m,queryParameters:{format:"bin"}});f.push(v.fetchArrayBuffer());let y=o.detail_noise,x=new Jr({url:y,queryParameters:{format:"bin"}});f.push(x.fetchArrayBuffer());let C=o.weather,w=new Jr({url:C,queryParameters:{format:"png"}});f.push(w.fetchImage());let A=o.mark_noise,E=new Jr({url:A,queryParameters:{format:"png"}});return f.push(E.fetchImage()),Promise.all(f)}function fX(o){this._coordinate=o.coordinate,this._modelMatrix=null,this._modelMatrixDirty=!0,this._cloudParam=o.cloudParam;let f=o.urls,m=o.viewer;this._viewer=m;let v=m.scene.camera.viewMatrix;this._enable=!0,this._postProcess=null;let y=this;pMi(f).then(function(x){let C=y.getUniforms(v,m.scene.context,x);y._postProcess=m.scene.postProcessStages.add(new as({fragmentShader:fMi,uniforms:C}))}).catch(function(x){console.log(x)})}fX.prototype.getModelMatrix=function(o){if(this._modelMatrixDirty){let f=o.cartographicPosition,m=o.height,v=o.size,y=Ee.fromScale(v),x=tn.eastNorthUpToFixedFrame(H.fromDegrees(f.x,f.y));Ee.multiply(x,y,y);let C=Ee.fromTranslation(new H(0,0,m));Ee.multiply(C,y,y),this._modelMatrixDirty=!1,this._modelMatrix=y}return this._modelMatrix};fX.prototype.getUniforms=function(o,f,m){let v=new Ee,y=new Ee,x=new Ee,C=0,w=null,A=null,E=null,T=null,S=this;return{u_inversModelView:function(){let M=S.getModelMatrix(S._coordinate);return Ee.multiply(o,M,v),Ee.inverse(v,y),y},u_inversModelMatrix:function(){let M=S.getModelMatrix(S._coordinate);return Ee.inverse(M,x),x},u_time:function(){return C+=.001,C},detail_map_high:function(){return A||(A=n8e(f,m[0],32,!1)),A},detail_map:function(){return w||(w=n8e(f,m[1],128,!0)),w},weather_map:function(){return E||(E=o8e(f,m[2],512)),E},mark_noise:function(){return T||(T=o8e(f,m[3],512)),T},wind_speed:function(){return S._cloudParam.wind_speed},wind_direction:function(){let M=new Ye;return M.x=S._cloudParam.wind_direction_x,M.z=S._cloudParam.wind_direction_z,M},global_coverage:function(){return S._cloudParam.global_coverage},global_density:function(){return S._cloudParam.global_density},global_lightAbsorption:function(){return S._cloudParam.global_lightAbsorption},cloud_in_scatter:function(){return S._cloudParam.cloud_in_scatter},cloud_out_scatter:function(){return S._cloudParam.cloud_out_scatter},cloud_scatter_ratio:function(){return S._cloudParam.cloud_scatter_ratio},cloud_silver_intensity:function(){return S._cloudParam.cloud_silver_intensity},cloud_silver_exponent:function(){return S._cloudParam.cloud_silver_exponent},cloud_out_scatter_ambient:function(){return S._cloudParam.cloud_out_scatter_ambient},wind_animation:function(){return S._cloudParam.wind_animation},use_blue_noise:function(){return S._cloudParam.use_blue_noise},use_quarter_update:function(){return S._cloudParam.use_quarter_update},highlightScale:function(){return S._cloudParam.highlightScale},backScale:function(){return S._cloudParam.backScale},attenuationScale:function(){return S._cloudParam.attenuationScale}}};Object.defineProperties(fX.prototype,{enable:{set:function(o){this._enable=o,this._postProcess.enabled=o},get:function(){return this._enable}},coordinate:{get:function(){return this._coordinate}},cloudParam:{get:function(){return this._cloudParam}}});fX.prototype.update=function(){N(this._postProcess)&&this._enable&&(this._viewer.camera.positionCartographic.height>5e5?this._postProcess.enabled=!1:this._postProcess.enabled=!0)};var bae=fX,zot=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates)); z_window = czm_reverseLogDepth(z_window); float n_range = czm_depthRange.near; float f_range = czm_depthRange.far; float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range); float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } `,Hot=` uniform sampler2D colorTexture;//\u8F93\u5165\u7684\u573A\u666F\u6E32\u67D3\u7167\u7247 in vec2 v_textureCoordinates; float hash(float x) { return fract(sin(x*133.3)*13.13); } void main(void) { float time = czm_frameNumber / 60.0; vec2 resolution = czm_viewport.zw; vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y); vec3 c=vec3(.6,.7,.8); float a=-.4; float si=sin(a),co=cos(a); uv*=mat2(co,-si,si,co); uv*=length(uv+vec2(0,4.9))*.3+1.; float v=1.-sin(hash(floor(uv.x*100.))*2.); float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.; c*=v*b; //\u5C4F\u5E55\u4E0A\u96E8\u7684\u989C\u8272 out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); //\u5C06\u96E8\u548C\u4E09\u7EF4\u573A\u666F\u878D\u5408 } `,Uot=`uniform sampler2D colorTexture; //\u8F93\u5165\u7684\u573A\u666F\u6E32\u67D3\u7167\u7247 in vec2 v_textureCoordinates; float snow(vec2 uv,float scale) { float time = czm_frameNumber / 60.0; float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.; uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale; uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d; p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k); k=smoothstep(0.,k,sin(f.x+f.y)*0.01); return k*w; } void main(void) { vec2 resolution = czm_viewport.zw; vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y); vec3 finalColor=vec3(0); //float c=smoothstep(1.,0.3,clamp(uv.y*.3+.8,0.,.75)); float c = 0.0; c+=snow(uv,30.)*.0; c+=snow(uv,20.)*.0; c+=snow(uv,15.)*.0; c+=snow(uv,10.); c+=snow(uv,8.); c+=snow(uv,6.); c+=snow(uv,5.); finalColor=(vec3(c)); //\u5C4F\u5E55\u4E0A\u96EA\u7684\u989C\u8272 out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5); //\u5C06\u96EA\u548C\u4E09\u7EF4\u573A\u666F\u878D\u5408 } `,Got=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float _BlurRadius = 5.0;//0.3; const int _Iteration = 30; const float _SunScreenRadius = 0.3;//0.1; const float exposure = 1.0; const float gamma = 2.2; vec4 getColor(vec2 p, vec2 sunCoord) { //vec2 blurVector = (sunCoord - p) * _BlurRadius; vec2 blurVector = (p - sunCoord) * _BlurRadius; vec4 acumulateColor = vec4(0, 0, 0, 0); vec2 texcoord = p; for (int j = 0; j < _Iteration; j ++) { acumulateColor += texture(colorTexture, texcoord); texcoord += blurVector; } vec4 color = acumulateColor / float(_Iteration); return color; } void main() { // Sun position vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0); vec4 sunPositionEC = czm_view * sunPos; vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC); sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0); //sunPos = sunPositionWC; vec2 sunTexcoord = sunPos.xy * 0.5 + vec2(0.5); //out_FragColor = length(sunTexcoord - v_textureCoordinates) > _SunScreenRadius // ? texture(colorTexture, v_textureCoordinates): getColor(v_textureCoordinates, sunTexcoord); out_FragColor = getColor(v_textureCoordinates, sunTexcoord); } `,Wot=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float threshold = 0.5;//0.99;//0.8;//0.5;//1.0; void main() { vec4 fragColor = texture(colorTexture, v_textureCoordinates); // Check whether fragment output is higher than threshold, if so output as brightness color float brightness = dot(fragColor.rgb, vec3(0.2126, 0.7152, 0.0722)); out_FragColor = brightness > threshold ? vec4(fragColor.rgb, 1.0) : vec4(0.0, 0.0, 0.0, 1.0); } `,mMi=` uniform mat4 u_eastNorthUpToFixedFrame; uniform mat4 u_r_eastNorthUpToFixedFrame; uniform bool u_bFlatten; uniform vec4 u_polygonBounds; uniform sampler2D u_polygonTexture; uniform bool u_clipPlaneOfFlatten; uniform bool u_ripple; uniform bool u_regionSnow; uniform bool u_heightFog; //out vec3 v_positionWC; //FlattenVS_v_positionEC //FlattenVS_v_normal //FlattenVS_a_normal // \u5728\u8303\u56F4\u5185 bool isPointInBound(vec4 point, vec4 bounds) { return (point.x>bounds.x && point.x<bounds.z && point.y<bounds.y && point.y>bounds.w); } float unpackDepth(const in vec4 rgba_depth) { // \u89E3\u7801\u6DF1\u5EA6 const vec4 bitShifts = vec4(1.0, 1.0 / 255.0, 1.0 / (255.0 * 255.0), 1.0 / (255.0 * 255.0 * 255.0)); float depth=dot(rgba_depth, bitShifts); return depth; } void main(void) { // \u4E4B\u524D\u7684\u529F\u80FD zhiu_flatten_main(); if (u_bFlatten && !u_clipPlaneOfFlatten && !u_ripple && !u_regionSnow && !u_heightFog) { // \u53D8\u6362\u5230\u4E16\u754C\u4F4D\u7F6E\uFF0C\u7136\u540E\u53C8\u5230 vec4 m_position = u_r_eastNorthUpToFixedFrame * vec4(FlattenVS_a_pos, 1.0); // \u662F\u5426\u5728\u8303\u56F4\u5185 if (isPointInBound(m_position, u_polygonBounds)) { vec2 texCoord; // texCoord.x = (m_position.x-u_polygonBounds.x)/(u_polygonBounds.z-u_polygonBounds.x); texCoord.y = (m_position.y-u_polygonBounds.w)/(u_polygonBounds.y-u_polygonBounds.w); // \u56FE\u7247\u5927\u5C0F\u662F float texelSize = 1.0/4096.0; // \u89E3\u7801\u6DF1\u5EA6 float depth0 = unpackDepth(texture(u_polygonTexture, texCoord.xy)); float depth1 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(-texelSize, 0.0))); float depth2 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(texelSize, 0.0))); float depth3 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, -texelSize))); float depth4 = unpackDepth(texture(u_polygonTexture, texCoord.xy + vec2(0.0, texelSize))); // \u83B7\u53D6\u6700\u5C0F\u7684\u6DF1\u5EA6 float minDepth = min(min(min(min(depth0, depth1), depth2), depth3), depth4); if (minDepth*5000.0 > 1.0) { float depth = max(max(max(max(depth0, depth1), depth2), depth3), depth4); m_position.z = depth*5000.0 + m_position.z * 0.01; } gl_Position = FlattenVS_u_proj * FlattenVS_u_mv * u_eastNorthUpToFixedFrame * m_position; vec3 weightedPosition = FlattenVS_a_pos; //vec3 weightedNormal = a_normal; vec4 position = vec4(weightedPosition, 1.0); v_positionWC = (czm_model * position).xyz; v_positionEC = position.xyz; } } if (u_bFlatten && u_clipPlaneOfFlatten) { v_position = FlattenVS_a_pos; } if (u_bFlatten && (u_ripple || u_regionSnow || u_heightFog)) { v_position = FlattenVS_a_pos ; } }`,jot=mMi,gMi=`in vec3 v_elevationPos; void main(){ zhiu_clip_main(); float vtxf_a11 = fract(czm_frameNumber / 120.0) * 3.14159265 * 2.0; float vtxf_a12 = v_elevationPos.z / 60.0 + sin(vtxf_a11) * 0.1; out_FragColor *= vec4(vtxf_a12, vtxf_a12, vtxf_a12, 1.0); float vtxf_a13 = fract(czm_frameNumber / 360.0); float vtxf_h = clamp(v_elevationPos.z / 300.0, 0.0, 1.0); vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0; float vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13)); out_FragColor.rgb += out_FragColor.rgb * (1.0 - vtxf_diff); }`,Yot=gMi,_Mi=`out vec3 v_elevationPos; out vec3 vtxf_a_position; uniform mat4 u_inverseElevationMatrix; void main(){ zhiu_height_main(); vtxf_a_position = a_position.xyz; vtxf_a_position = gltf_u_dec_position_min + vtxf_a_position * gltf_u_dec_position_normConstant; v_elevationPos = (u_inverseElevationMatrix * vec4(vtxf_a_position, 1.0)).xyz; vtxf_a_position = (vtxf_a_position - gltf_u_dec_position_min) / gltf_u_dec_position_normConstant; }`,qot=_Mi,vMi=`#define USE_CUBE_MAP_SHADOW true uniform sampler2D colorTexture; uniform sampler2D depthTexture; in vec2 v_textureCoordinates; uniform mat4 camera_projection_matrix; uniform mat4 camera_view_matrix; uniform float far; uniform samplerCube shadowMap_textureCube; uniform mat4 shadowMap_matrix; uniform vec4 shadowMap_lightPositionEC; uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; struct zx_shadowParameters { vec3 texCoords; float depthBias; float depth; float nDotL; vec2 texelStepSize; float normalShadingSmooth; float darkness; }; float czm_shadowVisibility(samplerCube shadowMap, zx_shadowParameters shadowParameters) { float depthBias = shadowParameters.depthBias; float depth = shadowParameters.depth; float nDotL = shadowParameters.nDotL; float normalShadingSmooth = shadowParameters.normalShadingSmooth; float darkness = shadowParameters.darkness; vec3 uvw = shadowParameters.texCoords; depth -= depthBias; float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth); return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness); } vec4 getPositionEC(){ return czm_windowToEyeCoordinates(gl_FragCoord); } vec3 getNormalEC(){ return vec3(1.); } vec4 toEye(in vec2 uv,in float depth){ vec2 xy=vec2((uv.x*2.-1.),(uv.y*2.-1.)); vec4 posInCamera=czm_inverseProjection*vec4(xy,depth,1.); posInCamera=posInCamera/posInCamera.w; return posInCamera; } vec3 pointProjectOnPlane(in vec3 planeNormal,in vec3 planeOrigin,in vec3 point){ vec3 v01=point-planeOrigin; float d=dot(planeNormal,v01); return(point-planeNormal*d); } float getDepth(in vec4 depth){ float z_window=czm_unpackDepth(depth); z_window=czm_reverseLogDepth(z_window); float n_range=czm_depthRange.near; float f_range=czm_depthRange.far; return(2.*z_window-n_range-f_range)/(f_range-n_range); } float shadow( in vec4 positionEC ){ vec3 normalEC=getNormalEC(); zx_shadowParameters shadowParameters; shadowParameters.texelStepSize=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; shadowParameters.depthBias=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; shadowParameters.normalShadingSmooth=shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; shadowParameters.darkness=shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; vec3 directionEC=positionEC.xyz-shadowMap_lightPositionEC.xyz; float distance=length(directionEC); directionEC=normalize(directionEC); float radius=shadowMap_lightPositionEC.w; if(distance>radius) { return 2.0; } vec3 directionWC=czm_inverseViewRotation*directionEC; shadowParameters.depth=distance/radius-0.0003; shadowParameters.nDotL=clamp(dot(normalEC,-directionEC),0.,1.); shadowParameters.texCoords=directionWC; float visibility=czm_shadowVisibility(shadowMap_textureCube,shadowParameters); return visibility; } bool visible(in vec4 result) { result.x/=result.w; result.y/=result.w; result.z/=result.w; return result.x>=-1.&&result.x<=1. &&result.y>=-1.&&result.y<=1. &&result.z>=-1.&&result.z<=1.; } void main(){ // \u5F97\u5230\u91C9\u8272=\u7ED3\u6784\u4E8C\u7EF4(\u5F69\u8272\u7EB9\u7406,\u7EB9\u7406\u5750\u6807) out_FragColor=texture(colorTexture,v_textureCoordinates); // \u6DF1\u5EA6=(\u91C9\u8272=\u7ED3\u6784\u4E8C\u7EF4(\u6DF1\u5EA6\u7EB9\u7406,\u7EB9\u7406\u5750\u6807)) float depth=getDepth(texture(depthTexture,v_textureCoordinates)); // \u89C6\u89D2=(\u7EB9\u7406\u5750\u6807,\u6DF1\u5EA6) vec4 viewPos=toEye(v_textureCoordinates,depth); // \u4E16\u754C\u5750\u6807 vec4 wordPos=czm_inverseView*viewPos; // \u865A\u62DF\u76F8\u673A\u4E2D\u5750\u6807 vec4 vcPos=camera_view_matrix*wordPos; float near=.001*far; float dis=length(vcPos.xyz); if(dis>near&&dis<far){ // \u900F\u89C6\u6295\u5F71 vec4 posInEye=camera_projection_matrix*vcPos; // \u53EF\u89C6\u533A\u989C\u8272 vec4 v_color=vec4(0.,1.,0.,.5); vec4 inv_color=vec4(1.,0.,0.,.5); if(visible(posInEye)){ float vis=shadow(viewPos); if(vis>0.3){ out_FragColor=mix(out_FragColor,v_color,.5); } else{ out_FragColor=mix(out_FragColor,inv_color,.5); } } } }`,Xot=vMi,yMi={encNONE:0,enrS3TCDXTN:14,enrPVRTPF_PVRTC2:19,enrPVRTPF_PVRTC:20,enrPVRTPF_PVRTC_4bpp:21,enrPVRTPF_ETC1:22},Jot=Object.freeze(yMi),xMi={LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21},Kot=Object.freeze(xMi);function Rj(o){this._angle=void 0,this._angleSubscription=void 0,this._radius=void 0,this._radiusSubscription=void 0,this._stack=void 0,this._stackSubscription=void 0,this._slice=void 0,this._sliceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._show=void 0,this._showSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._definitionChanged=new Br,this._gaze=void 0,this._gazeSubscription=void 0,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(Rj.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),material:A_("material"),fill:Oi("fill"),shadows:Oi("shadows"),distanceDisplayCondition:Oi("distanceDisplayCondition")});Rj.prototype.clone=function(o){return N(o)?(o.angle=this.angle,o.radius=this.radius,o.stack=this.stack,o.slice=this.slice,o.show=this.show,o.material=this.material,o.color=this.color,o.fill=this.fill,o.outline=this.outline,o.outlineColor=this.outlineColor,o.outlineWidth=this.outlineWidth,o.shadows=this.shadows,o.distanceDisplayCondition=this.distanceDisplayCondition,o.gaze=this.gaze,o):new Rj(this)};Rj.prototype.merge=function(o){this.angle=Z(this.angle,o.angle),this.radius=Z(this.radius,o.radius),this.stack=Z(this.stack,o.stack),this.slice=Z(this.slice,o.slice),this.show=Z(this.show,o.show),this.color=Z(this.color,o.color),this.material=Z(this.material,o.material),this.fill=Z(this.fill,o.fill),this.outline=Z(this.outline,o.outline),this.outlineColor=Z(this.outlineColor,o.outlineColor),this.outlineWidth=Z(this.outlineWidth,o.outlineWidth),this.shadows=Z(this.shadows,o.shadows),this.distanceDisplayCondition=Z(this.distanceDisplayCondition,o.distanceDisplayCondition),this.gaze=Z(this.gaze,o.gaze)};var hie=Rj;function CMi(o){return new c2(o)}function bMi(o){return Oi(o,void 0,CMi)}function wae(o){o=o||{},this._position=void 0,this._orientation=void 0,this._show=void 0;let f=o.conicArcSensor;f instanceof hie||(f=new hie(f)),this._conicArcSensor=f,this._distanceDisplayCondition=new ia,this._geometry=void 0,this._outlineGeometry=void 0,this._definitionChanged=new Br,this.merge(o)}Object.defineProperties(wae.prototype,{position:bMi("position"),orientation:Oi("orientation"),show:Oi("show")});wae.prototype.merge=function(o){this.position=o.position,this.orientation=o.orientation,this.show=o.show};wae.prototype.gazeAt=function(o){o instanceof Wh&&(this._conicArcSensor.gaze=o)};var die=wae,a8e=Math.cos,s8e=Math.sin;function fie(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.angle,m=o.radius,v=Math.round(Z(o.stackPartitions,12)),y=Math.round(Z(o.slicePartitions,64)),x=Z(o.vertexFormat,un.DEFAULT);this._angle=f,this._radius=m,this._stackPartitions=v,this._slicePartitions=y,this._vertexFormat=x}fie.fromDimensions=function(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.angle,m=o.radius,v=o.height,y=o.stackPartitions,x=o.slicePartitions;return new fie({angle:f,radius:m,stackPartitions:y,slicePartitions:x,vertexFormat:o.vertexFormat})};fie.createGeometry=function(o){console.time("createGeometry");let f=o._angle,m=o._radius,v=o._stackPartitions+1,y=o._slicePartitions+1,x=o._vertexFormat,C=new Oc,w,A=3*(y-1)+6*(y-1)*(v-2)+(y-1)*1*3,E=v*y,T=ro.createTypedArray(E,A),S=new Float64Array(E*3+(y-1)*3*3);if(x.position){let L=0,R=new Array(y),O=new Array(y);for(let F=0;F<y;F++){let k=xe.TWO_PI*F/(y-1);R[F]=a8e(k),O[F]=s8e(k),S[L++]=0,S[L++]=0,S[L++]=-m}for(i=1;i<v;i++){let F=f*i/(v-1),k=s8e(F),U=m*k,G=m*k,j=m*a8e(F);for(let q=0;q<y;q++)S[L++]=R[q]*U,S[L++]=O[q]*G,S[L++]=-j}w=L;for(let F=0;F<y-1;F++)S[L++]=0,S[L++]=0,S[L++]=0,S[L++]=S[w-(y-F-1)*3],S[L++]=S[w-(y-F-1)*3+1],S[L++]=S[w-(y-F-1)*3+2],S[L++]=S[w-(y-F)*3],S[L++]=S[w-(y-F)*3+1],S[L++]=S[w-(y-F)*3+2];C.position=new en({componentDatatype:Rt.DOUBLE,componentsPerAttribute:3,values:S})}let M=0;for(let L=0;L<y-1;L++)T[M++]=y+L,T[M++]=y+L+1,T[M++]=L+1;let I,P;for(let L=1;L<v-1;L++){I=L*y,P=(L+1)*y;for(let R=0;R<y-1;R++)T[M++]=P+R,T[M++]=P+R+1,T[M++]=I+R+1,T[M++]=P+R,T[M++]=I+R+1,T[M++]=I+R}for(let L=0,R=(y-1)*3;L<R;L++)T[M++]=L+w/3;let D=new ga({attributes:C,indices:T,primitiveType:Fn.TRIANGLES,boundingSphere:new Pi(H.ZERO,m)});return D=Ju.computeNormal(D),console.timeEnd("createGeometry"),D};var pie=fie,p$=Math.cos,m$=Math.sin;function Qot(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.angle,m=o.radius,v=Math.round(Z(o.stackPartitions,10)),y=Math.round(Z(o.slicePartitions,8)),x=Math.round(Z(o.subdivisions,128));this._angle=f,this._radius=m,this._stackPartitions=v,this._slicePartitions=y,this._subdivisions=x}Qot.createGeometry=function(o){let f=o._angle,m=o._radius;if(m<=0||f<=0)return;let v=o._stackPartitions,y=o._slicePartitions,x=o._subdivisions,C=x*(v+y-1),w=C-y+2,A=new Float64Array(w*3),E=ro.createTypedArray(w,C*2),T,S,M,I,P,D,L=0,R=new Array(x),O=new Array(x);for(T=0;T<x;T++)M=xe.TWO_PI*T/x,R[T]=p$(M),O[T]=m$(M);for(T=1;T<v;T++)for(I=f*T/(v-1),P=p$(I),D=m$(I),S=0;S<x;S++)A[L++]=m*R[S]*D,A[L++]=m*O[S]*D,A[L++]=-m*P;for(R.length=y,O.length=y,T=0;T<y;T++)M=xe.TWO_PI*T/y,R[T]=p$(M),O[T]=m$(M);for(A[L++]=0,A[L++]=0,A[L++]=-m,T=1;T<x;T++)for(I=f*T/x,P=p$(I),D=m$(I),S=0;S<y;S++)A[L++]=m*R[S]*D,A[L++]=m*O[S]*D,A[L++]=-m*P;for(L=0,T=0;T<v-1;++T){let U=T*x;for(S=0;S<x-1;++S)E[L++]=U+S,E[L++]=U+S+1;E[L++]=U+x-1,E[L++]=U}let F=x*(v-1);for(S=1;S<y+1;++S)E[L++]=F,E[L++]=F+S;for(T=0;T<x-2;++T){let U=T*y+1+F,G=(T+1)*y+1+F;for(S=0;S<y-1;++S)E[L++]=G+S,E[L++]=U+S;E[L++]=G+y-1,E[L++]=U+y-1}let k=new Oc({position:new en({componentDatatype:Rt.DOUBLE,componentsPerAttribute:3,values:A})});return new ga({attributes:k,indices:E,primitiveType:Fn.LINES,boundingSphere:new Pi(H.ZERO,m)})};var mie=Qot;function pX(o){let f=this;if(!N(o))throw new li("viewer is required.");this._earthCtrl=o;let m=o.coreMap.scene;this._scene=m;let v=o.coreMap.clock;this._clock=v,this._primitives=m.primitives,this._primitive=void 0,this._outlinePrimitive=void 0,this._conicArcSensorCollection=[],v.onTick.addEventListener(function(){f.update()})}var Vpe=new Ut,zpe=new Ee,wMi=new H,AMi=new H,l8e=new H,u8e=new Gr;pX.prototype.add=function(o){return o instanceof die||(o=new die(o)),this._conicArcSensorCollection.push(o),o};pX.prototype.remove=function(o){let f=this._conicArcSensorCollection.indexOf(o);f!==-1&&this._conicArcSensorCollection.splice(f,1)};pX.prototype.removeAll=function(){this._conicArcSensorCollection.length=0};pX.prototype.update=function(){let o=this._clock.currentTime,f=this._conicArcSensorCollection,m=this._primitives,v=this._primitive,y=this._outlinePrimitive,x=[],C=[];N(v)&&m.removeAndDestroy(v),N(y)&&m.removeAndDestroy(y);for(let w=0,A=f.length;w<A;w++){let E=f[w],T=E._conicArcSensor;if(!vt.getValueOrDefault(T.show,o,!0))continue;let S=T.angle,M=T.radius,I=T.stack,P=T.slice;if(!N(S)||!vt.getValueOrDefault(E.show,o,!0))continue;let D=vt.getValueOrUndefined(E.position,o,wMi);if(!N(D))continue;let L,R=T.gaze;if(N(R)){let q=vt.getValueOrUndefined(R.position,o,AMi);if(!N(D)||!N(q))continue;let J=H.subtract(D,q,l8e),X=H.angleBetween(H.UNIT_Z,J),Y=H.cross(H.UNIT_Z,J,l8e),Q=Gr.fromAxisAngle(Y,X,u8e),ee=H.distance(D,q);M=1,L=Ee.fromRotationTranslation(Ut.multiplyByScalar(Ut.fromQuaternion(Q,Vpe),ee,Vpe),D,zpe)}else{let q=vt.getValueOrUndefined(E.orientation,o,u8e);N(q)?L=Ee.fromRotationTranslation(Ut.fromQuaternion(q,Vpe),D,zpe):L=tn.eastNorthUpToFixedFrame(D,void 0,zpe)}if(!N(L))continue;let O=E._geometry;if(!N(O)){let q;q=new pie({vertexFormat:un.POSITION_AND_NORMAL,angle:S,radius:M,stackPartitions:I,slicePartitions:P}),E._geometry=pie.createGeometry(q),O=E._geometry}let F=T.color,k=T.outline,U=T.outlineWidth;N(U)||(U=1);let G=T.outlineColor;N(G)||(G=Re.WHITE);let j=new co({geometry:O,modelMatrix:L,attributes:{color:ea.fromColor(F)}});if(x.push(j),k){let q=E._outlineGeometry;if(!N(q)){let X;X=new mie({vertexFormat:un.POSITION_ONLY,angle:S,radius:M}),E._outlineGeometry=mie.createGeometry(X),q=E._outlineGeometry}let J=new co({geometry:q,modelMatrix:L,attributes:{color:ea.fromColor(G)}});C.push(J)}}x.length>0&&(this._primitive=this._primitives.add(new Ia({asynchronous:!1,geometryInstances:x,appearance:new ms({flat:!1,translucent:!0,closed:!0})}))),C.length>0&&(this._outlinePrimitive=this._primitives.add(new Ia({asynchronous:!1,geometryInstances:C,appearance:new ms({flat:!0,translucent:!0,renderState:{lineWidth:this._scene.clampLineWidth(outlineWidth)}})})))};var Zot=pX;function Oj(o){this._show=void 0,this._radius=void 0,this._xHalfAngle=void 0,this._yHalfAngle=void 0,this._lineColor=void 0,this._showSectorLines=void 0,this._showSectorSegmentLines=void 0,this._showLateralSurfaces=void 0,this._material=void 0,this._showDomeSurfaces=void 0,this._showDomeLines=void 0,this._showIntersection=void 0,this._intersectionColor=void 0,this._intersectionWidth=void 0,this._showThroughEllipsoid=void 0,this._gaze=void 0,this._showScanPlane=void 0,this._scanPlaneColor=void 0,this._scanPlaneMode=void 0,this._scanPlaneRate=void 0,this._definitionChanged=new Br,this.merge(Z(o,Z.EMPTY_OBJECT))}Object.defineProperties(Oj.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:Oi("show"),radius:Oi("radius"),xHalfAngle:Oi("xHalfAngle"),yHalfAngle:Oi("yHalfAngle"),lineColor:Oi("lineColor"),showSectorLines:Oi("showSectorLines"),showSectorSegmentLines:Oi("showSectorSegmentLines"),showLateralSurfaces:Oi("showLateralSurfaces"),material:A_("material"),showDomeSurfaces:Oi("showDomeSurfaces"),showDomeLines:Oi("showDomeLines "),showIntersection:Oi("showIntersection"),intersectionColor:Oi("intersectionColor"),intersectionWidth:Oi("intersectionWidth"),showThroughEllipsoid:Oi("showThroughEllipsoid"),gaze:Oi("gaze"),showScanPlane:Oi("showScanPlane"),scanPlaneColor:Oi("scanPlaneColor"),scanPlaneMode:Oi("scanPlaneMode"),scanPlaneRate:Oi("scanPlaneRate")});Oj.prototype.clone=function(o){return N(o)||(o=new Oj),o.show=this.show,o.radius=this.radius,o.xHalfAngle=this.xHalfAngle,o.yHalfAngle=this.yHalfAngle,o.lineColor=this.lineColor,o.showSectorLines=this.showSectorLines,o.showSectorSegmentLines=this.showSectorSegmentLines,o.showLateralSurfaces=this.showLateralSurfaces,o.material=this.material,o.showDomeSurfaces=this.showDomeSurfaces,o.showDomeLines=this.showDomeLines,o.showIntersection=this.showIntersection,o.intersectionColor=this.intersectionColor,o.intersectionWidth=this.intersectionWidth,o.showThroughEllipsoid=this.showThroughEllipsoid,o.gaze=this.gaze,o.showScanPlane=this.showScanPlane,o.scanPlaneColor=this.scanPlaneColor,o.scanPlaneMode=this.scanPlaneMode,o.scanPlaneRate=this.scanPlaneRate,o};Oj.prototype.merge=function(o){if(!N(o))throw new li("source is required.");this.show=Z(this.show,o.show),this.radius=Z(this.radius,o.radius),this.xHalfAngle=Z(this.xHalfAngle,o.xHalfAngle),this.yHalfAngle=Z(this.yHalfAngle,o.yHalfAngle),this.lineColor=Z(this.lineColor,o.lineColor),this.showSectorLines=Z(this.showSectorLines,o.showSectorLines),this.showSectorSegmentLines=Z(this.showSectorSegmentLines,o.showSectorSegmentLines),this.showLateralSurfaces=Z(this.showLateralSurfaces,o.showLateralSurfaces),this.material=Z(this.material,o.material),this.showDomeSurfaces=Z(this.showDomeSurfaces,o.showDomeSurfaces),this.showDomeLines=Z(this.showDomeLines,o.showDomeLines),this.showIntersection=Z(this.showIntersection,o.showIntersection),this.intersectionColor=Z(this.intersectionColor,o.intersectionColor),this.intersectionWidth=Z(this.intersectionWidth,o.intersectionWidth),this.showThroughEllipsoid=Z(this.showThroughEllipsoid,o.showThroughEllipsoid),this.gaze=Z(this.gaze,o.gaze),this.showScanPlane=Z(this.showScanPlane,o.showScanPlane),this.scanPlaneColor=Z(this.scanPlaneColor,o.scanPlaneColor),this.scanPlaneMode=Z(this.scanPlaneMode,o.scanPlaneMode),this.scanPlaneRate=Z(this.scanPlaneRate,o.scanPlaneRate)};var $ot=Oj;function EMi(o,f,m){let v;try{return v=o(f,m),v}catch(y){return Promise.reject(y)}}function TMi(o){let f;return function(m){let v=m.data,y=[],x={id:v.id,result:void 0,error:void 0};return Promise.resolve(EMi(o,v.parameters,y)).then(function(C){x.result=C}).catch(function(C){C instanceof Error?x.error={name:C.name,message:C.message,stack:C.stack}:x.error=C}).finally(function(){N(f)||(f=Z(self.webkitPostMessage,self.postMessage)),v.canTransferArrayBuffer||(y.length=0);try{f(x,y)}catch(C){x.result=void 0,x.error=`postMessage failed with error: ${XH(C)} with responseMessage: ${JSON.stringify(x)}`,f(x)}})}}var eat=TMi;globalThis.CESIUM_VERSION="1.106";/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license */var l0e="__knockoutObservables",u0e="__knockoutSubscribable";function tat(o,f){if(!o)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var m=this,v=iat(o,!0);return f=f||Object.getOwnPropertyNames(o),f.forEach(function(y){if(!(y===l0e||y===u0e)&&!(y in v)){var x=o[y],C=x instanceof Array,w=m.isObservable(x)?x:C?m.observableArray(x):m.observable(x);Object.defineProperty(o,y,{configurable:!0,enumerable:!0,get:w,set:m.isWriteableObservable(w)?w:void 0}),v[y]=w,C&&PMi(m,w)}}),o}function iat(o,f){var m=o[l0e];return!m&&f&&(m={},Object.defineProperty(o,l0e,{value:m})),m}function SMi(o,f,m){var v=this,y={owner:o,deferEvaluation:!0};if(typeof m=="function")y.read=m;else{if("value"in m)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof m.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');y.read=m.get,y.write=m.set}return o[f]=v.computed(y),tat.call(v,o,[f]),o}function PMi(o,f){var m=null;o.computed(function(){m&&(m.dispose(),m=null);var v=f();v instanceof Array&&(m=IMi(o,f,v))})}function IMi(o,f,m){var v=MMi(o,m);return v.subscribe(f)}function MMi(o,f){var m=f[u0e];if(!m){m=new o.subscribable,Object.defineProperty(f,u0e,{value:m});var v={};DMi(f,m,v),LMi(o,f,m,v)}return m}function DMi(o,f,m){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(v){var y=o[v];o[v]=function(){var x=y.apply(this,arguments);return m.pause!==!0&&f.notifySubscribers(this),x}})}function LMi(o,f,m,v){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(y){Object.defineProperty(f,y,{enumerable:!1,value:function(){var x;v.pause=!0;try{x=o.observableArray.fn[y].apply(o.observableArray(f),arguments)}finally{v.pause=!1}return m.notifySubscribers(f),x}})})}function rat(o,f){if(!o)return null;var m=iat(o,!1);return m&&m[f]||null}function RMi(o,f){var m=rat(o,f);m&&m.valueHasMutated()}function OMi(o){o.track=tat,o.getObservable=rat,o.valueHasMutated=RMi,o.defineProperty=SMi}var ZPe={attachToKo:OMi},c8e="http://www.w3.org/2000/svg",h8e="cesium-svgPath-svg",NMi={register:function(o){o.bindingHandlers.cesiumSvgPath={init:function(f,m){let v=document.createElementNS(c8e,"svg:svg");v.setAttribute("class",h8e);let y=document.createElementNS(c8e,"path");return v.appendChild(y),o.virtualElements.setDomNodeChildren(f,[v]),o.computed({read:function(){let x=o.unwrap(m());y.setAttribute("d",o.unwrap(x.path));let C=o.unwrap(x.width),w=o.unwrap(x.height);v.setAttribute("width",C),v.setAttribute("height",w),v.setAttribute("viewBox",`0 0 ${C} ${w}`),x.css&&v.setAttribute("class",`${h8e} ${o.unwrap(x.css)}`)},disposeWhenNodeIsRemoved:f}),{controlsDescendantBindings:!0}}},o.virtualElements.allowedBindings.cesiumSvgPath=!0}},$Pe=NMi;ZPe.attachToKo(CD);$Pe.register(CD);var br=CD;function mX(o){N(o)||(o=new MU),this._clock=o,this._eventHelper=new AC,this._eventHelper.add(o.onTick,this.synchronize,this),this.systemTime=br.observable(ci.now()),this.systemTime.equalityComparer=ci.equals,this.startTime=br.observable(o.startTime),this.startTime.equalityComparer=ci.equals,this.startTime.subscribe(function(f){o.startTime=f,this.synchronize()},this),this.stopTime=br.observable(o.stopTime),this.stopTime.equalityComparer=ci.equals,this.stopTime.subscribe(function(f){o.stopTime=f,this.synchronize()},this),this.currentTime=br.observable(o.currentTime),this.currentTime.equalityComparer=ci.equals,this.currentTime.subscribe(function(f){o.currentTime=f,this.synchronize()},this),this.multiplier=br.observable(o.multiplier),this.multiplier.subscribe(function(f){o.multiplier=f,this.synchronize()},this),this.clockStep=br.observable(o.clockStep),this.clockStep.subscribe(function(f){o.clockStep=f,this.synchronize()},this),this.clockRange=br.observable(o.clockRange),this.clockRange.subscribe(function(f){o.clockRange=f,this.synchronize()},this),this.canAnimate=br.observable(o.canAnimate),this.canAnimate.subscribe(function(f){o.canAnimate=f,this.synchronize()},this),this.shouldAnimate=br.observable(o.shouldAnimate),this.shouldAnimate.subscribe(function(f){o.shouldAnimate=f,this.synchronize()},this),br.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(mX.prototype,{clock:{get:function(){return this._clock}}});mX.prototype.synchronize=function(){let o=this._clock;this.systemTime=ci.now(),this.startTime=o.startTime,this.stopTime=o.stopTime,this.currentTime=o.currentTime,this.multiplier=o.multiplier,this.clockStep=o.clockStep,this.clockRange=o.clockRange,this.canAnimate=o.canAnimate,this.shouldAnimate=o.shouldAnimate};mX.prototype.isDestroyed=function(){return!1};mX.prototype.destroy=function(){this._eventHelper.removeAll(),kr(this)};var eIe=mX;function FMi(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,li.throwInstantiationError()}var nat=FMi;function BMi(o,f){f=Z(f,!0);let m=new Br,v=new Br;function y(){let x={args:arguments,cancel:!1},C;return m.raiseEvent(x),x.cancel||(C=o.apply(null,arguments),v.raiseEvent(C)),C}return y.canExecute=f,br.track(y,["canExecute"]),Object.defineProperties(y,{beforeExecute:{value:m},afterExecute:{value:v}}),y}var Fl=BMi,gX={};gX.createCheckbox=function(o,f,m){let v=document.createElement("div"),y=document.createElement("label"),x=document.createElement("input");x.type="checkbox";let C=`checked: ${f}`;return N(m)&&(C+=`, enable: ${m}`),x.setAttribute("data-bind",C),y.appendChild(x),y.appendChild(document.createTextNode(o)),v.appendChild(y),v};gX.createSection=function(o,f,m,v){let y=document.createElement("div");y.className="cesium-cesiumInspector-section",y.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${m} }`),o.appendChild(y);let x=document.createElement("h3");x.className="cesium-cesiumInspector-sectionHeader",x.appendChild(document.createTextNode(f)),x.setAttribute("data-bind",`click: ${v}`),y.appendChild(x);let C=document.createElement("div");return C.className="cesium-cesiumInspector-sectionContent",y.appendChild(C),C};gX.createRangeInput=function(o,f,m,v,y,x){x=Z(x,f);let C=document.createElement("input");C.setAttribute("data-bind",`value: ${x}`),C.type="number";let w=document.createElement("input");w.type="range",w.min=m,w.max=v,w.step=Z(y,"any"),w.setAttribute("data-bind",`valueUpdate: "input", value: ${f}`);let A=document.createElement("div");A.appendChild(w);let E=document.createElement("div");return E.className="cesium-cesiumInspector-slider",E.appendChild(document.createTextNode(o)),E.appendChild(C),E.appendChild(A),E};gX.createButton=function(o,f,m){let v=document.createElement("button");v.type="button",v.textContent=o,v.className="cesium-cesiumInspector-pickButton";let y=`click: ${f}`;return N(m)&&(y+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${m}}`),v.setAttribute("data-bind",y),v};var k1=gX;function kMi(o,f,m,v,y){return m.call(v,o[f]),br.getObservable(o,f).subscribe(m,v,y)}var oC=kMi;function oat(o,f){this._command=o,f=Z(f,Z.EMPTY_OBJECT),this.toggled=Z(f.toggled,!1),this.tooltip=Z(f.tooltip,""),br.track(this,["toggled","tooltip"])}Object.defineProperties(oat.prototype,{command:{get:function(){return this._command}}});var Sz=oat,a5="http://www.w3.org/2000/svg",aat="http://www.w3.org/1999/xlink",g$,c7=Re.fromCssColorString("rgba(247,250,255,0.384)"),_$=Re.fromCssColorString("rgba(143,191,255,0.216)"),Hpe=Re.fromCssColorString("rgba(153,197,255,0.098)"),v$=Re.fromCssColorString("rgba(255,255,255,0.086)"),VMi=Re.fromCssColorString("rgba(255,255,255,0.267)"),zMi=Re.fromCssColorString("rgba(255,255,255,0)"),d8e=Re.fromCssColorString("rgba(66,67,68,0.3)"),f8e=Re.fromCssColorString("rgba(0,0,0,0.5)");function mR(o){return Re.fromCssColorString(window.getComputedStyle(o).getPropertyValue("color"))}var Nj={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function DE(o){let f=document.createElementNS(a5,o.tagName);for(let m in o)if(o.hasOwnProperty(m)&&m!=="tagName")if(m==="children"){let v=o.children.length;for(let y=0;y<v;++y)f.appendChild(DE(o.children[y]))}else m.indexOf("xlink:")===0?f.setAttributeNS(aat,m.substring(6),o[m]):m==="textContent"?f.textContent=o[m]:f.setAttribute(m,o[m]);return f}function Upe(o,f,m){let v=document.createElementNS(a5,"text");v.setAttribute("x",o),v.setAttribute("y",f),v.setAttribute("class","cesium-animation-svgText");let y=document.createElementNS(a5,"tspan");return y.textContent=m,v.appendChild(y),v}function HMi(o,f,m){o.setAttribute("transform",`translate(100,100) rotate(${m})`),f.setAttribute("transform",`rotate(${m})`)}var y$=new Re;function Qp(o,f){let m=f.alpha,v=1-m;return y$.red=o.red*v+f.red*m,y$.green=o.green*v+f.green*m,y$.blue=o.blue*v+f.blue*m,y$.toCssColorString()}function Gpe(o,f,m){let v=Nj[m],y={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${o},${f})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:m,tagName:v.tagName,transform:v.transform,d:v.d},{tagName:"title",textContent:""}]};return DE(y)}function UMi(o,f,m){let v=Nj[m],y=Nj.animation_pathWingButton,x={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${o},${f})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:y.tagName,d:y.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:y.tagName,d:y.d},{class:"cesium-animation-buttonPath",id:m,tagName:v.tagName,transform:v.transform,d:v.d},{tagName:"title",textContent:""}]};return DE(x)}function GMi(o,f){let m=o._viewModel,v=m.shuttleRingDragging;if(!(v&&g$!==o))if(f.type==="mousedown"||v&&f.type==="mousemove"||f.type==="touchstart"&&f.touches.length===1||v&&f.type==="touchmove"&&f.touches.length===1){let y=o._centerX,x=o._centerY,C=o._svgNode.getBoundingClientRect(),w,A;if(f.type==="touchstart"||f.type==="touchmove"?(w=f.touches[0].clientX,A=f.touches[0].clientY):(w=f.clientX,A=f.clientY),!v&&(w>C.right||w<C.left||A<C.top||A>C.bottom))return;let E=o._shuttleRingPointer.getBoundingClientRect(),T=w-y-C.left,S=A-x-C.top,M=Math.atan2(S,T)*180/Math.PI+90;M>180&&(M-=360);let I=m.shuttleRingAngle;v||w<E.right&&w>E.left&&A>E.top&&A<E.bottom?(g$=o,m.shuttleRingDragging=!0,m.shuttleRingAngle=M):M<I?m.slower():M>I&&m.faster(),f.preventDefault()}else o===g$&&(g$=void 0),m.shuttleRingDragging=!1}function iM(o,f){this._viewModel=f,this.svgElement=o,this._enabled=void 0,this._toggled=void 0;let m=this;this._clickFunction=function(){let v=m._viewModel.command;v.canExecute&&v()},o.addEventListener("click",this._clickFunction,!0),this._subscriptions=[oC(f,"toggled",this.setToggled,this),oC(f,"tooltip",this.setTooltip,this),oC(f.command,"canExecute",this.setEnabled,this)]}iM.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let o=this._subscriptions;for(let f=0,m=o.length;f<m;f++)o[f].dispose();kr(this)};iM.prototype.isDestroyed=function(){return!1};iM.prototype.setEnabled=function(o){if(this._enabled!==o){if(this._enabled=o,!o){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};iM.prototype.setToggled=function(o){this._toggled!==o&&(this._toggled=o,this._enabled&&(o?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};iM.prototype.setTooltip=function(o){this.svgElement.getElementsByTagName("title")[0].textContent=o};function j6(o,f){o=Uh(o),this._viewModel=f,this._container=o,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let m=o.ownerDocument,v=document.createElement("style");v.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",m.head.insertBefore(v,m.head.childNodes[0]);let y=document.createElement("div");y.className="cesium-animation-theme",y.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=y,this._themeNormal=y.childNodes[0],this._themeHover=y.childNodes[1],this._themeSelect=y.childNodes[2],this._themeDisabled=y.childNodes[3],this._themeKnob=y.childNodes[4],this._themePointer=y.childNodes[5],this._themeSwoosh=y.childNodes[6],this._themeSwooshHover=y.childNodes[7];let x=document.createElementNS(a5,"svg:svg");this._svgNode=x,x.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",aat);let C=document.createElementNS(a5,"g");this._topG=C,this._realtimeSVG=new iM(UMi(3,4,"animation_pathClock"),f.playRealtimeViewModel),this._playReverseSVG=new iM(Gpe(44,99,"animation_pathPlayReverse"),f.playReverseViewModel),this._playForwardSVG=new iM(Gpe(124,99,"animation_pathPlay"),f.playForwardViewModel),this._pauseSVG=new iM(Gpe(84,99,"animation_pathPause"),f.pauseViewModel);let w=document.createElementNS(a5,"g");w.appendChild(this._realtimeSVG.svgElement),w.appendChild(this._playReverseSVG.svgElement),w.appendChild(this._playForwardSVG.svgElement),w.appendChild(this._pauseSVG.svgElement);let A=DE({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=A;let E=Nj.animation_pathSwooshFX,T=Nj.animation_pathPointer,S=DE({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:E.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:E.d},{tagName:E.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:E.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=S,this._shuttleRingPointer=DE({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:T.tagName,d:T.d});let M=DE({tagName:"g",transform:"translate(100,100)"});this._knobOuter=DE({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let I=61,P=DE({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:I});this._knobDate=Upe(0,-24,""),this._knobTime=Upe(0,-7,""),this._knobStatus=Upe(0,-41,"");let D=DE({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:I}),L=document.createElementNS(a5,"g");L.setAttribute("class","cesium-animation-shuttleRingG"),o.appendChild(y),C.appendChild(L),C.appendChild(M),C.appendChild(w),L.appendChild(A),L.appendChild(S),L.appendChild(this._shuttleRingPointer),M.appendChild(this._knobOuter),M.appendChild(P),M.appendChild(this._knobDate),M.appendChild(this._knobTime),M.appendChild(this._knobStatus),M.appendChild(D),x.appendChild(C),o.appendChild(x);let R=this;function O(j){GMi(R,j)}this._mouseCallback=O,A.addEventListener("mousedown",O,!0),A.addEventListener("touchstart",O,!0),S.addEventListener("mousedown",O,!0),S.addEventListener("touchstart",O,!0),m.addEventListener("mousemove",O,!0),m.addEventListener("touchmove",O,!0),m.addEventListener("mouseup",O,!0),m.addEventListener("touchend",O,!0),m.addEventListener("touchcancel",O,!0),this._shuttleRingPointer.addEventListener("mousedown",O,!0),this._shuttleRingPointer.addEventListener("touchstart",O,!0),this._knobOuter.addEventListener("mousedown",O,!0),this._knobOuter.addEventListener("touchstart",O,!0);let F=this._knobTime.childNodes[0],k=this._knobDate.childNodes[0],U=this._knobStatus.childNodes[0],G;this._subscriptions=[oC(f.pauseViewModel,"toggled",function(j){G!==j&&(G=j,G?R._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):R._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),oC(f,"shuttleRingAngle",function(j){HMi(R._shuttleRingPointer,R._knobOuter,j)}),oC(f,"dateLabel",function(j){k.textContent!==j&&(k.textContent=j)}),oC(f,"timeLabel",function(j){F.textContent!==j&&(F.textContent=j)}),oC(f,"multiplierLabel",function(j){U.textContent!==j&&(U.textContent=j)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(j6.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});j6.prototype.isDestroyed=function(){return!1};j6.prototype.destroy=function(){N(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let o=this._container.ownerDocument,f=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",f,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",f,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",f,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",f,!0),o.removeEventListener("mousemove",f,!0),o.removeEventListener("touchmove",f,!0),o.removeEventListener("mouseup",f,!0),o.removeEventListener("touchend",f,!0),o.removeEventListener("touchcancel",f,!0),this._shuttleRingPointer.removeEventListener("mousedown",f,!0),this._shuttleRingPointer.removeEventListener("touchstart",f,!0),this._knobOuter.removeEventListener("mousedown",f,!0),this._knobOuter.removeEventListener("touchstart",f,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let m=this._subscriptions;for(let v=0,y=m.length;v<y;v++)m[v].dispose();return kr(this)};j6.prototype.resize=function(){let o=this._container.clientWidth,f=this._container.clientHeight;if(o===this._lastWidth&&f===this._lastHeight)return;let m=this._svgNode,v=200,y=132,x=o,C=f;o===0&&f===0?(x=v,C=y):o===0?(C=f,x=v*(f/y)):f===0&&(x=o,C=y*(o/v));let w=x/v,A=C/y;m.style.cssText=`width: ${x}px; height: ${C}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,m.setAttribute("width",x),m.setAttribute("height",C),m.setAttribute("viewBox",`0 0 ${x} ${C}`),this._topG.setAttribute("transform",`scale(${w},${A})`),this._centerX=Math.max(1,100*w),this._centerY=Math.max(1,100*A),this._lastHeight=o,this._lastWidth=f};j6.prototype.applyThemeChanges=function(){let o=this._container.ownerDocument;if(!o.body.contains(this._container)){if(N(this._observer))return;let T=this;T._observer=new MutationObserver(function(){o.body.contains(T._container)&&(T._observer.disconnect(),T._observer=void 0,T.applyThemeChanges())}),T._observer.observe(o,{childList:!0,subtree:!0});return}let f=mR(this._themeNormal),m=mR(this._themeHover),v=mR(this._themeSelect),y=mR(this._themeDisabled),x=mR(this._themeKnob),C=mR(this._themePointer),w=mR(this._themeSwoosh),A=mR(this._themeSwooshHover),E=DE({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Qp(f,c7)},{tagName:"stop",offset:"12%","stop-color":Qp(f,_$)},{tagName:"stop",offset:"46%","stop-color":Qp(f,Hpe)},{tagName:"stop",offset:"81%","stop-color":Qp(f,v$)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Qp(m,c7)},{tagName:"stop",offset:"12%","stop-color":Qp(m,_$)},{tagName:"stop",offset:"46%","stop-color":Qp(m,Hpe)},{tagName:"stop",offset:"81%","stop-color":Qp(m,v$)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Qp(v,c7)},{tagName:"stop",offset:"12%","stop-color":Qp(v,_$)},{tagName:"stop",offset:"46%","stop-color":Qp(v,Hpe)},{tagName:"stop",offset:"81%","stop-color":Qp(v,v$)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Qp(y,VMi)},{tagName:"stop",offset:"75%","stop-color":Qp(y,zMi)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":w.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":w.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":w.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":A.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":A.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":A.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":C.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":C.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Qp(C,f8e)},{tagName:"stop",offset:"100%","stop-color":Qp(C,f8e)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Qp(x,c7)},{tagName:"stop",offset:"60%","stop-color":Qp(x,d8e)},{tagName:"stop",offset:"85%","stop-color":Qp(x,_$)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Qp(x,d8e)},{tagName:"stop",offset:"60%","stop-color":Qp(x,c7)},{tagName:"stop",offset:"85%","stop-color":Qp(x,v$)}]}]});N(this._defsElement)?this._svgNode.replaceChild(E,this._defsElement):this._svgNode.appendChild(E),this._defsElement=E};var tIe=j6,g3=15,aH=105;function sat(o,f){return o-f}function Wpe(o,f){let m=Wg(f,o,sat);return m<0?~m:m}function WMi(o,f){if(Math.abs(o)<=g3)return o/g3;let m=g3,v=aH,y,x=0,C;return o>0?(y=Math.log(f[f.length-1]),C=(y-x)/(v-m),Math.exp(x+C*(o-m))):(y=Math.log(-f[0]),C=(y-x)/(v-m),-Math.exp(x+C*(Math.abs(o)-m)))}function jMi(o,f,m){if(m.clockStep===Od.SYSTEM_CLOCK)return g3;if(Math.abs(o)<=1)return o*g3;let v=f[f.length-1];o>v?o=v:o<-v&&(o=-v);let y=g3,x=aH,C,w=0,A;return o>0?(C=Math.log(v),A=(C-w)/(x-y),(Math.log(o)-w)/A+y):(C=Math.log(-f[0]),A=(C-w)/(x-y),-((Math.log(Math.abs(o))-w)/A+y))}function Dw(o){let f=this;this._clockViewModel=o,this._allShuttleRingTicks=[],this._dateFormatter=Dw.defaultDateFormatter,this._timeFormatter=Dw.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,br.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Dw.defaultTicks),this.timeLabel=void 0,br.defineProperty(this,"timeLabel",function(){return f._timeFormatter(f._clockViewModel.currentTime,f)}),this.dateLabel=void 0,br.defineProperty(this,"dateLabel",function(){return f._dateFormatter(f._clockViewModel.currentTime,f)}),this.multiplierLabel=void 0,br.defineProperty(this,"multiplierLabel",function(){let C=f._clockViewModel;if(C.clockStep===Od.SYSTEM_CLOCK)return"Today";let w=C.multiplier;return w%1===0?`${w.toFixed(0)}x`:`${w.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,br.defineProperty(this,"shuttleRingAngle",{get:function(){return jMi(o.multiplier,f._allShuttleRingTicks,o)},set:function(C){C=Math.max(Math.min(C,aH),-aH);let w=f._allShuttleRingTicks,A=f._clockViewModel;if(A.clockStep=Od.SYSTEM_CLOCK_MULTIPLIER,Math.abs(C)===aH){A.multiplier=C>0?w[w.length-1]:w[0];return}let E=WMi(C,w);if(f.snapToTicks)E=w[Wpe(E,w)];else if(E!==0){let T=Math.abs(E);if(T>100){let S=T.toFixed(0).length-2,M=Math.pow(10,S);E=Math.round(E/M)*M|0}else T>g3?E=Math.round(E):T>1?E=+E.toFixed(1):T>0&&(E=+E.toFixed(2))}A.multiplier=E}}),this._canAnimate=void 0,br.defineProperty(this,"_canAnimate",function(){let C=f._clockViewModel,w=C.clockRange;if(f.shuttleRingDragging||w===L0.UNBOUNDED)return!0;let A=C.multiplier,E=C.currentTime,T=C.startTime,S=!1;if(w===L0.LOOP_STOP)S=ci.greaterThan(E,T)||E.equals(T)&&A>0;else{let M=C.stopTime;S=ci.greaterThan(E,T)&&ci.lessThan(E,M)||E.equals(T)&&A>0||E.equals(M)&&A<0}return S||(C.shouldAnimate=!1),S}),this._isSystemTimeAvailable=void 0,br.defineProperty(this,"_isSystemTimeAvailable",function(){let C=f._clockViewModel;if(C.clockRange===L0.UNBOUNDED)return!0;let w=C.systemTime;return ci.greaterThanOrEquals(w,C.startTime)&&ci.lessThanOrEquals(w,C.stopTime)}),this._isAnimating=void 0,br.defineProperty(this,"_isAnimating",function(){return f._clockViewModel.shouldAnimate&&(f._canAnimate||f.shuttleRingDragging)});let m=Fl(function(){let C=f._clockViewModel;C.shouldAnimate?C.shouldAnimate=!1:f._canAnimate&&(C.shouldAnimate=!0)});this._pauseViewModel=new Sz(m,{toggled:br.computed(function(){return!f._isAnimating}),tooltip:"Pause"});let v=Fl(function(){let C=f._clockViewModel,w=C.multiplier;w>0&&(C.multiplier=-w),C.shouldAnimate=!0});this._playReverseViewModel=new Sz(v,{toggled:br.computed(function(){return f._isAnimating&&o.multiplier<0}),tooltip:"Play Reverse"});let y=Fl(function(){let C=f._clockViewModel,w=C.multiplier;w<0&&(C.multiplier=-w),C.shouldAnimate=!0});this._playForwardViewModel=new Sz(y,{toggled:br.computed(function(){return f._isAnimating&&o.multiplier>0&&o.clockStep!==Od.SYSTEM_CLOCK}),tooltip:"Play Forward"});let x=Fl(function(){f._clockViewModel.clockStep=Od.SYSTEM_CLOCK},br.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Sz(x,{toggled:br.computed(function(){return o.clockStep===Od.SYSTEM_CLOCK}),tooltip:br.computed(function(){return f._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Fl(function(){let C=f._clockViewModel,w=f._allShuttleRingTicks,A=C.multiplier,E=Wpe(A,w)-1;E>=0&&(C.multiplier=w[E])}),this._faster=Fl(function(){let C=f._clockViewModel,w=f._allShuttleRingTicks,A=C.multiplier,E=Wpe(A,w)+1;E<w.length&&(C.multiplier=w[E])})}Dw.defaultDateFormatter=function(o,f){let m=ci.addHours(o,8,new ci),v=ci.toGregorianDate(m);return v.year+"/"+v.month+"/"+v.day};Dw.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Dw.defaultTimeFormatter=function(o,f){let m=ci.addHours(o,8,new ci),v=ci.toGregorianDate(m),y=Math.round(v.millisecond);return Math.abs(f._clockViewModel.multiplier)<1?`${v.hour.toString().padStart(2,"0")}:${v.minute.toString().padStart(2,"0")}:${v.second.toString().padStart(2,"0")}.${y.toString().padStart(3,"0")}`:`${v.hour.toString().padStart(2,"0")}:${v.minute.toString().padStart(2,"0")}:${v.second.toString().padStart(2,"0")} UTC`};Dw.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Dw.prototype.setShuttleRingTicks=function(o){let f,m,v,y={},x=this._sortedFilteredPositiveTicks;for(x.length=0,f=0,m=o.length;f<m;++f)v=o[f],y.hasOwnProperty(v)||(y[v]=!0,x.push(v));x.sort(sat);let C=[];for(m=x.length,f=m-1;f>=0;--f)v=x[f],v!==0&&C.push(-v);Array.prototype.push.apply(C,x),this._allShuttleRingTicks=C};Object.defineProperties(Dw.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(o){this._dateFormatter=o}},timeFormatter:{get:function(){return this._timeFormatter},set:function(o){this._timeFormatter=o}}});Dw._maxShuttleRingAngle=aH;Dw._realtimeShuttleRingAngle=g3;var iIe=Dw;function YMi(o){return function(f){let m=o._scene.pick(f.position);N(m)&&m.primitive instanceof pg&&(o.tileset=m.primitive),o.pickActive=!1}}function lat(o,f){f?o._eventHandler.setInputAction(function(m){let v=o._scene.pick(m.endPosition);N(v)&&v.primitive instanceof pg&&(o.tileset=v.primitive)},Ei.MOUSE_MOVE):(o._eventHandler.removeInputAction(Ei.MOUSE_MOVE),o.picking=o.picking)}var qMi={maximumFractionDigits:3};function yW(o){let f=o/1048576;return f<1?f.toLocaleString(void 0,qMi):Math.round(f).toLocaleString()}function Fj(o,f){if(!N(o))return"";let m=f?o._statisticsPerPass[ep.PICK]:o._statisticsPerPass[ep.RENDER],v='<ul class="cesium-cesiumInspector-statistics">';return v+=`<li><strong>\u8BBF\u95EE: </strong>${m.visited.toLocaleString()}</li><li><strong>\u9009\u62E9: </strong>${m.selected.toLocaleString()}</li><li><strong>\u7ED8\u5236\u547D\u4EE4: </strong>${m.numberOfCommands.toLocaleString()}</li>`,v+="</ul>",f||(v+='<ul class="cesium-cesiumInspector-statistics">',v+=`<li><strong>\u8BF7\u6C42: </strong>${m.numberOfPendingRequests.toLocaleString()}</li><li><strong>\u5C1D\u8BD5: </strong>${m.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>\u5904\u7406\u4E2D: </strong>${m.numberOfTilesProcessing.toLocaleString()}</li><li><strong>\u5185\u5BB9\u5C31\u7EEA: </strong>${m.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>\u603B\u5171: </strong>${m.numberOfTilesTotal.toLocaleString()}</li>`,v+="</ul>",v+='<ul class="cesium-cesiumInspector-statistics">',v+=`<li><strong>\u7279\u5F81\u9009\u62E9: </strong>${m.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>\u7279\u5F81\u52A0\u8F7D: </strong>${m.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>\u70B9\u4E91\u9009\u62E9: </strong>${m.numberOfPointsSelected.toLocaleString()}</li><li><strong>\u70B9\u4E91\u52A0\u8F7D: </strong>${m.numberOfPointsLoaded.toLocaleString()}</li><li><strong>\u4E09\u89D2\u5F62\u6570: </strong>${m.numberOfTrianglesSelected.toLocaleString()}</li>`,v+="</ul>",v+='<ul class="cesium-cesiumInspector-statistics">',v+=`<li><strong>\u6837\u5F0F\u6E32\u67D3\u74E6\u7247\u6570: </strong>${m.numberOfTilesStyled.toLocaleString()}</li><li><strong>\u6837\u5F0F\u6E32\u67D3\u7279\u5F81\u6570: </strong>${m.numberOfFeaturesStyled.toLocaleString()}</li>`,v+="</ul>",v+='<ul class="cesium-cesiumInspector-statistics">',v+=`<li><strong>\u5B50\u8282\u70B9\u5254\u9664\u6570: </strong>${m.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,v+="</ul>",v+='<ul class="cesium-cesiumInspector-statistics">',v+=`<li><strong>\u51E0\u4F55\u5360\u5185\u5B58 (MB): </strong>${yW(m.geometryByteLength)}</li><li><strong>\u7EB9\u7406\u5360\u5185\u5B58 (MB): </strong>${yW(m.texturesByteLength)}</li><li><strong>\u5C5E\u6027\u5360\u5185\u5B58 (MB): </strong>${yW(m.batchTableByteLength)}</li>`,v+="</ul>"),v}function uat(){let o=id.statistics;return` <ul class="cesium-cesiumInspector-statistics"> <li><strong>\u51E0\u4F55\u5360\u5185\u5B58 (MB): </strong>${yW(o.geometryByteLength)}</li> <li><strong>\u7EB9\u7406\u5360\u5185\u5B58 (MB): </strong>${yW(o.texturesByteLength)}</li> </ul> `}var XMi=[{text:"\u9AD8\u4EAE",value:d2.HIGHLIGHT},{text:"\u66FF\u6362",value:d2.REPLACE},{text:"\u6DF7\u5408",value:d2.MIX}],p8e=new Re(1,1,0,.4),JMi=new Re,x$=new Re;function j0(o,f){let m=this,v=o.canvas;this._eventHandler=new Ur(v),this._scene=o,this._performanceContainer=f,this._canvas=v,this._performanceDisplay=new kq({container:f}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,br.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=br.observable({}),this.properties=[],br.defineProperty(this,"properties",function(){let ae=[],fe=m._properties();for(let de in fe)fe.hasOwnProperty(de)&&ae.push(de);return ae});let y=br.observable();br.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return y()},set:function(ae){y(ae),N(m._tileset)&&(m._tileset.dynamicScreenSpaceError=ae)}}),this.dynamicScreenSpaceError=!1;let x=br.observable();br.defineProperty(this,"colorBlendMode",{get:function(){return x()},set:function(ae){x(ae),N(m._tileset)&&(m._tileset.colorBlendMode=ae,m._scene.requestRender())}}),this.colorBlendMode=d2.HIGHLIGHT;let C=br.observable(),w=br.observable();br.defineProperty(this,"picking",{get:function(){return w()},set:function(ae){w(ae),ae?m._eventHandler.setInputAction(function(fe){let de=o.pick(fe.endPosition);if(de instanceof Qs?(m.feature=de,m.tile=de.content.tile):N(de)&&N(de.content)?(m.feature=void 0,m.tile=de.content.tile):(m.feature=void 0,m.tile=void 0),!!N(m._tileset)){if(C&&N(de)&&N(de.content)){let ve;o.pickPositionSupported&&(ve=o.pickPosition(fe.endPosition),N(ve)&&(m._tileset.debugPickPosition=ve)),m._tileset.debugPickedTile=de.content.tile}else m._tileset.debugPickedTile=void 0;m._scene.requestRender()}},Ei.MOUSE_MOVE):(m.feature=void 0,m.tile=void 0,m._eventHandler.removeInputAction(Ei.MOUSE_MOVE))}}),this.picking=!0;let A=br.observable();br.defineProperty(this,"colorize",{get:function(){return A()},set:function(ae){A(ae),N(m._tileset)&&(m._tileset.debugColorizeTiles=ae,m._scene.requestRender())}}),this.colorize=!1;let E=br.observable();br.defineProperty(this,"wireframe",{get:function(){return E()},set:function(ae){E(ae),N(m._tileset)&&(m._tileset.debugWireframe=ae,m._scene.requestRender())}}),this.wireframe=!1;let T=br.observable();br.defineProperty(this,"showBoundingVolumes",{get:function(){return T()},set:function(ae){T(ae),N(m._tileset)&&(m._tileset.debugShowBoundingVolume=ae,m._scene.requestRender())}}),this.showBoundingVolumes=!1;let S=br.observable();br.defineProperty(this,"showContentBoundingVolumes",{get:function(){return S()},set:function(ae){S(ae),N(m._tileset)&&(m._tileset.debugShowContentBoundingVolume=ae,m._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let M=br.observable();br.defineProperty(this,"showRequestVolumes",{get:function(){return M()},set:function(ae){M(ae),N(m._tileset)&&(m._tileset.debugShowViewerRequestVolume=ae,m._scene.requestRender())}}),this.showRequestVolumes=!1;let I=br.observable();br.defineProperty(this,"freezeFrame",{get:function(){return I()},set:function(ae){I(ae),N(m._tileset)&&(m._tileset.debugFreezeFrame=ae,m._scene.debugShowFrustumPlanes=ae,m._scene.requestRender())}}),this.freezeFrame=!1,br.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return C()},set:function(ae){C(ae),N(m._tileset)&&(m._tileset.debugPickedTileLabelOnly=ae,m._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let P=br.observable();br.defineProperty(this,"showGeometricError",{get:function(){return P()},set:function(ae){P(ae),N(m._tileset)&&(m._tileset.debugShowGeometricError=ae,m._scene.requestRender())}}),this.showGeometricError=!1;let D=br.observable();br.defineProperty(this,"showRenderingStatistics",{get:function(){return D()},set:function(ae){D(ae),N(m._tileset)&&(m._tileset.debugShowRenderingStatistics=ae,m._scene.requestRender())}}),this.showRenderingStatistics=!1;let L=br.observable();br.defineProperty(this,"showMemoryUsage",{get:function(){return L()},set:function(ae){L(ae),N(m._tileset)&&(m._tileset.debugShowMemoryUsage=ae,m._scene.requestRender())}}),this.showMemoryUsage=!1;let R=br.observable();br.defineProperty(this,"showUrl",{get:function(){return R()},set:function(ae){R(ae),N(m._tileset)&&(m._tileset.debugShowUrl=ae,m._scene.requestRender())}}),this.showUrl=!1;let O=br.observable();br.defineProperty(this,"maximumScreenSpaceError",{get:function(){return O()},set:function(ae){ae=Number(ae),isNaN(ae)||(O(ae),N(m._tileset)&&(m._tileset.maximumScreenSpaceError=ae))}}),this.maximumScreenSpaceError=16;let F=br.observable();br.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return F()},set:function(ae){ae=Number(ae),isNaN(ae)||(F(ae),N(m._tileset)&&(m._tileset.dynamicScreenSpaceErrorDensity=ae))}}),this.dynamicScreenSpaceErrorDensity=.00278,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,br.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(F(),1/6)},set:function(ae){F(Math.pow(ae,6))}});let k=br.observable();br.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return k()},set:function(ae){ae=Number(ae),isNaN(ae)||(k(ae),N(m._tileset)&&(m._tileset.dynamicScreenSpaceErrorFactor=ae))}}),this.dynamicScreenSpaceErrorFactor=4;let U=YMi(this),G=br.observable();br.defineProperty(this,"pickActive",{get:function(){return G()},set:function(ae){G(ae),ae?m._eventHandler.setInputAction(U,Ei.LEFT_CLICK):m._eventHandler.removeInputAction(Ei.LEFT_CLICK)}});let j=br.observable();br.defineProperty(this,"pointCloudShading",{get:function(){return j()},set:function(ae){j(ae),N(m._tileset)&&(m._tileset.pointCloudShading.attenuation=ae)}}),this.pointCloudShading=!1;let q=br.observable();br.defineProperty(this,"geometricErrorScale",{get:function(){return q()},set:function(ae){ae=Number(ae),isNaN(ae)||(q(ae),N(m._tileset)&&(m._tileset.pointCloudShading.geometricErrorScale=ae))}}),this.geometricErrorScale=1;let J=br.observable();br.defineProperty(this,"maximumAttenuation",{get:function(){return J()},set:function(ae){ae=Number(ae),isNaN(ae)||(J(ae),N(m._tileset)&&(m._tileset.pointCloudShading.maximumAttenuation=ae===0?void 0:ae))}}),this.maximumAttenuation=0;let X=br.observable();br.defineProperty(this,"baseResolution",{get:function(){return X()},set:function(ae){ae=Number(ae),isNaN(ae)||(X(ae),N(m._tileset)&&(m._tileset.pointCloudShading.baseResolution=ae===0?void 0:ae))}}),this.baseResolution=0;let Y=br.observable();br.defineProperty(this,"eyeDomeLighting",{get:function(){return Y()},set:function(ae){Y(ae),N(m._tileset)&&(m._tileset.pointCloudShading.eyeDomeLighting=ae)}}),this.eyeDomeLighting=!1;let Q=br.observable();br.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return Q()},set:function(ae){ae=Number(ae),isNaN(ae)||(Q(ae),N(m._tileset)&&(m._tileset.pointCloudShading.eyeDomeLightingStrength=ae))}}),this.eyeDomeLightingStrength=1;let ee=br.observable();br.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return ee()},set:function(ae){ae=Number(ae),isNaN(ae)||(ee(ae),N(m._tileset)&&(m._tileset.pointCloudShading.eyeDomeLightingRadius=ae))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let z=br.observable();br.defineProperty(this,"skipLevelOfDetail",{get:function(){return z()},set:function(ae){z(ae),N(m._tileset)&&(m._tileset.skipLevelOfDetail=ae)}}),this.skipLevelOfDetail=!0;let ie=br.observable();br.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return ie()},set:function(ae){ae=Number(ae),isNaN(ae)||(ie(ae),N(m._tileset)&&(m._tileset.skipScreenSpaceErrorFactor=ae))}}),this.skipScreenSpaceErrorFactor=16;let re=br.observable();br.defineProperty(this,"baseScreenSpaceError",{get:function(){return re()},set:function(ae){ae=Number(ae),isNaN(ae)||(re(ae),N(m._tileset)&&(m._tileset.baseScreenSpaceError=ae))}}),this.baseScreenSpaceError=1024;let ne=br.observable();br.defineProperty(this,"skipLevels",{get:function(){return ne()},set:function(ae){ae=Number(ae),isNaN(ae)||(ne(ae),N(m._tileset)&&(m._tileset.skipLevels=ae))}}),this.skipLevels=1;let oe=br.observable();br.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return oe()},set:function(ae){oe(ae),N(m._tileset)&&(m._tileset.immediatelyLoadDesiredLevelOfDetail=ae)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let se=br.observable();br.defineProperty(this,"loadSiblings",{get:function(){return se()},set:function(ae){se(ae),N(m._tileset)&&(m._tileset.loadSiblings=ae)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=o.postRender.addEventListener(function(){m._update()}),N(this._tileset)||lat(this,!0)}Object.defineProperties(j0.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return XMi}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(o){if(this._tileset=o,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,N(o)){let f=this;o._readyPromise.then(function(x){f.isDestroyed()||f._properties(x.properties)});let m=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],v=m.length;for(let x=0;x<v;++x){let C=m[x];this[C]=this[C]}this.maximumScreenSpaceError=o.maximumScreenSpaceError,this.dynamicScreenSpaceError=o.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=o.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=o.dynamicScreenSpaceErrorFactor,this.colorBlendMode=o.colorBlendMode,this.skipLevelOfDetail=o.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=o.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=o.baseScreenSpaceError,this.skipLevels=o.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=o.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=o.loadSiblings,this.hasEnabledWireframe=o._enableDebugWireframe;let y=o.pointCloudShading;this.pointCloudShading=y.attenuation,this.geometricErrorScale=y.geometricErrorScale,this.maximumAttenuation=y.maximumAttenuation?y.maximumAttenuation:0,this.baseResolution=y.baseResolution?y.baseResolution:0,this.eyeDomeLighting=y.eyeDomeLighting,this.eyeDomeLightingStrength=y.eyeDomeLightingStrength,this.eyeDomeLightingRadius=y.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=Fj(o,!1),this._pickStatisticsText=Fj(o,!0),this._resourceCacheStatisticsText=uat(),lat(this,!1)}},feature:{get:function(){return this._feature},set:function(o){if(this._feature===o)return;let f=this._feature;N(f)&&!f.content.isDestroyed()&&(!this.colorize&&N(this._style)?f.color=N(this._style.color)?this._style.color.evaluateColor(f,JMi):Re.WHITE:f.color=x$,this._scene.requestRender()),N(o)&&(Re.clone(o.color,x$),o.color=p8e,this._scene.requestRender()),this._feature=o}},tile:{get:function(){return this._tile},set:function(o){if(this._tile===o)return;let f=this._tile;N(f)&&!f.isDestroyed()&&!c0e(f.content)&&(f.color=x$,this._scene.requestRender()),N(o)&&!c0e(o.content)&&(Re.clone(o.color,x$),o.color=p8e,this._scene.requestRender()),this._tile=o}}});function c0e(o){if(!N(o))return!1;if(o.featuresLength>0)return!0;let f=o.innerContents;if(N(f)){let m=f.length;for(let v=0;v<m;++v)if(!c0e(f[v]))return!1;return!0}return!1}j0.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};j0.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};j0.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};j0.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};j0.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};j0.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};j0.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};j0.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};j0.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};j0.prototype.trimTilesCache=function(){N(this._tileset)&&this._tileset.trimLoadedTiles()};j0.prototype.compileStyle=function(){let o=this._tileset;if(!(!N(o)||this.styleString===JSON.stringify(o.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new G2(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(f){this._editorError=f.toString()}this.feature=this._feature,this.tile=this._tile}};j0.prototype.styleEditorKeyPress=function(o,f){if(f.keyCode===9){f.preventDefault();let m=f.target,v=m.selectionStart,y=m.selectionEnd,x=y,C=m.value.slice(v,y).split(` `),w=C.length,A;if(f.shiftKey)for(A=0;A<w;++A)C[A][0]===" "&&(C[A][1]===" "?(C[A]=C[A].substr(2),x-=2):(C[A]=C[A].substr(1),x-=1));else for(A=0;A<w;++A)C[A]=` ${C[A]}`,x+=2;let E=C.join(` `);m.value=m.value.slice(0,v)+E+m.value.slice(y),m.selectionStart=v!==y?v:x,m.selectionEnd=x}else f.ctrlKey&&(f.keyCode===10||f.keyCode===13)&&this.compileStyle();return!0};j0.prototype._update=function(){let o=this._tileset;if(this.performance&&this._performanceDisplay.update(),N(o)){if(o.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let f=o.style;this._style!==o.style&&(this._shouldStyle?(o.style=this._style,this._shouldStyle=!1):(this._style=f,this.styleString=JSON.stringify(f.style,null," ")))}this.showStatistics&&(this._statisticsText=Fj(o,!1),this._pickStatisticsText=Fj(o,!0),this._resourceCacheStatisticsText=uat())};j0.prototype.isDestroyed=function(){return!1};j0.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let o=this;return this._definedProperties.forEach(function(f){br.getObservable(o,f).dispose()}),kr(this)};j0.getStatistics=Fj;var rIe=j0;function Aae(o,f){o=Uh(o);let m=document.createElement("div"),v=document.createElement("div");v.setAttribute("data-bind","visible: performance");let y=new rIe(f,v);this._viewModel=y,this._container=o,this._element=m;let x=document.createElement("div");x.textContent="3D Tiles Inspector",x.className="cesium-cesiumInspector-button",x.setAttribute("data-bind","click: toggleInspector"),m.appendChild(x),m.className="cesium-cesiumInspector cesium-3DTilesInspector",m.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),o.appendChild(m);let C=document.createElement("div");C.className="cesium-cesiumInspector-dropDown",m.appendChild(C);let w=k1.createSection,A=k1.createCheckbox,E=k1.createRangeInput,T=k1.createButton,S=w(C,"\u74E6\u7247","tilesetVisible","toggleTileset"),M=w(C,"\u663E\u793A","displayVisible","toggleDisplay"),I=w(C,"\u66F4\u65B0","updateVisible","toggleUpdate"),P=w(C,"\u8BB0\u5F55","loggingVisible","toggleLogging"),D=w(C,"\u74E6\u7247\u8C03\u8BD5\u6807\u7B7E","tileDebugLabelsVisible","toggleTileDebugLabels"),L=w(C,"\u6837\u5F0F","styleVisible","toggleStyle"),R=w(C,"\u4F18\u5316","optimizationVisible","toggleOptimization"),O=document.createElement("div");O.className="field-group";let F=document.createElement("label");F.className="field-label",F.appendChild(document.createTextNode("\u5C5E\u6027: "));let k=document.createElement("div");k.setAttribute("data-bind","text: properties"),O.appendChild(F),O.appendChild(k),S.appendChild(O),S.appendChild(T("\u62FE\u53D6\u74E6\u7247","togglePickTileset","pickActive")),S.appendChild(T("\u6E05\u7406\u74E6\u7247\u7F13\u5B58","trimTilesCache")),S.appendChild(A("\u53EF\u62FE\u53D6","picking")),M.appendChild(A("\u7740\u8272","colorize"));let U=M.appendChild(A("\u7EBF\u6846","wireframe","_tileset === undefined || hasEnabledWireframe")),G=document.createElement("p");G.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),G.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),G.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",M.lastChild.appendChild(G),M.appendChild(A("\u5305\u56F4\u76D2","showBoundingVolumes")),M.appendChild(A("\u5185\u90E8\u5305\u56F4\u76D2","showContentBoundingVolumes")),M.appendChild(A("\u8BF7\u6C42\u5305\u56F4\u76D2","showRequestVolumes")),M.appendChild(A("\u70B9\u4E91\u7740\u8272","pointCloudShading"));let j=document.createElement("div");j.setAttribute("data-bind","visible: pointCloudShading"),j.appendChild(E("\u51E0\u4F55\u8BEF\u5DEE\u5C3A\u5EA6","geometricErrorScale",0,2,.01)),j.appendChild(E("\u6700\u5927\u8870\u51CF","maximumAttenuation",0,32,1)),j.appendChild(E("\u57FA\u672C\u5206\u8FA8\u7387","baseResolution",0,1,.01)),j.appendChild(A("\u9E70\u773C\u7A79\u9876\u5149\u7167 (EDL)","eyeDomeLighting")),M.appendChild(j);let q=document.createElement("div");q.setAttribute("data-bind","visible: eyeDomeLighting"),q.appendChild(E("EDL \u5F3A\u5EA6","eyeDomeLightingStrength",0,2,.1)),q.appendChild(E("EDL \u534A\u5F84","eyeDomeLightingRadius",0,4,.1)),j.appendChild(q),I.appendChild(A("\u51BB\u7ED3\u5E27","freezeFrame")),I.appendChild(A("\u52A8\u6001\u5C4F\u5E55\u7A7A\u95F4\u8BEF\u5DEE","dynamicScreenSpaceError"));let J=document.createElement("div");J.appendChild(E("\u6700\u5927\u5C4F\u5E55\u7A7A\u95F4\u8BEF\u5DEE","maximumScreenSpaceError",0,128,1)),I.appendChild(J);let X=document.createElement("div");X.setAttribute("data-bind","visible: dynamicScreenSpaceError"),X.appendChild(E("\u5C4F\u5E55\u7A7A\u95F4\u8BEF\u5DEE\u5BC6\u5EA6","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),X.appendChild(E("\u5C4F\u5E55\u7A7A\u95F4\u8BEF\u5DEE\u56E0\u5B50","dynamicScreenSpaceErrorFactor",1,10,.1)),I.appendChild(X),P.appendChild(A("\u5E27\u7387","performance")),P.appendChild(v),P.appendChild(A("\u7EDF\u8BA1\u4FE1\u606F","showStatistics"));let Y=document.createElement("div");Y.className="cesium-3dTilesInspector-statistics",Y.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),P.appendChild(Y),P.appendChild(A("\u62FE\u53D6\u7EDF\u8BA1","showPickStatistics"));let Q=document.createElement("div");Q.className="cesium-3dTilesInspector-statistics",Q.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),P.appendChild(Q),P.appendChild(A("\u8D44\u6E90\u7F13\u5B58\u7EDF\u8BA1","showResourceCacheStatistics"));let ee=document.createElement("div");ee.className="cesium-3dTilesInspector-statistics",ee.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),P.appendChild(ee);let z=document.createElement("div");L.appendChild(z),z.appendChild(document.createTextNode("\u989C\u8272\u6DF7\u5408\u6A21\u5F0F: "));let ie=document.createElement("select");ie.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),z.appendChild(ie);let re=document.createElement("textarea");re.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),z.className="cesium-cesiumInspector-styleEditor",z.appendChild(re);let ne=T("\u7F16\u8BD1 (Ctrl+Enter)","compileStyle");z.appendChild(ne);let oe=document.createElement("div");oe.className="cesium-cesiumInspector-error",oe.setAttribute("data-bind","text: editorError"),z.appendChild(oe),D.appendChild(A("\u4EC5\u663E\u793A\u62FE\u53D6\u74E6\u7247","showOnlyPickedTileDebugLabel")),D.appendChild(A("\u51E0\u4F55\u8BEF\u5DEE","showGeometricError")),D.appendChild(A("\u6E32\u67D3\u7EDF\u8BA1","showRenderingStatistics")),D.appendChild(A("\u5185\u5B58\u4F7F\u7528 (MB)","showMemoryUsage")),D.appendChild(A("\u74E6\u7247\u8DEF\u5F84","showUrl")),R.appendChild(A("\u8DF3\u8FC7\u74E6\u7247\u5C42\u7EA7","skipLevelOfDetail"));let se=document.createElement("div");se.appendChild(E("\u8DF3\u8FC7\u5C4F\u5E55\u8BEF\u5DEE\u56E0\u5B50","skipScreenSpaceErrorFactor",1,50,1)),R.appendChild(se);let ae=document.createElement("div");ae.appendChild(E("\u57FA\u7840\u5C4F\u5E55\u7A7A\u95F4\u8BEF\u5DEE","baseScreenSpaceError",0,4096,1)),R.appendChild(ae);let fe=document.createElement("div");fe.appendChild(E("\u8DF3\u8FC7\u5C42\u7EA7\u6570","skipLevels",0,10,1)),R.appendChild(fe),R.appendChild(A("\u4EC5\u52A0\u8F7D\u6EE1\u8DB3\u6700\u5927\u5C4F\u5E55\u8BEF\u5DEE\u7684\u74E6\u7247","immediatelyLoadDesiredLevelOfDetail")),R.appendChild(A("\u52A0\u8F7D\u53EF\u89C1\u74E6\u7247\u9644\u8FD1\u7684\u74E6\u7247","loadSiblings")),br.applyBindings(y,m)}Object.defineProperties(Aae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Aae.prototype.isDestroyed=function(){return!1};Aae.prototype.destroy=function(){return br.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),kr(this)};var nIe=Aae;function cat(o){o=Z(o,Z.EMPTY_OBJECT);let f=o.globe,m=Z(o.imageryProviderViewModels,[]),v=Z(o.terrainProviderViewModels,[]);this._globe=f,this.imageryProviderViewModels=m.slice(0),this.terrainProviderViewModels=v.slice(0),this.dropDownVisible=!1,br.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let y=br.getObservable(this,"imageryProviderViewModels"),x=br.pureComputed(function(){let S=y(),M={},I;for(I=0;I<S.length;I++){let L=S[I],R=L.category;N(M[R])?M[R].push(L):M[R]=[L]}let P=Object.keys(M),D=[];for(I=0;I<P.length;I++){let L=P[I];D.push({name:L,providers:M[L]})}return D});this._imageryProviders=x;let C=br.getObservable(this,"terrainProviderViewModels"),w=br.pureComputed(function(){let S=C(),M={},I;for(I=0;I<S.length;I++){let L=S[I],R=L.category;N(M[R])?M[R].push(L):M[R]=[L]}let P=Object.keys(M),D=[];for(I=0;I<P.length;I++){let L=P[I];D.push({name:L,providers:M[L]})}return D});this._terrainProviders=w,this.buttonTooltip=void 0,br.defineProperty(this,"buttonTooltip",function(){let S=this.selectedImagery,M=this.selectedTerrain,I=N(S)?S.name:void 0,P=N(M)?M.name:void 0;return N(I)&&N(P)?`${I} ${P}`:N(I)?I:P}),this.buttonImageUrl=void 0,br.defineProperty(this,"buttonImageUrl",function(){let S=this.selectedImagery;if(N(S))return S.iconUrl}),this.selectedImagery=void 0;let A=br.observable();this._currentImageryLayers=[],br.defineProperty(this,"selectedImagery",{get:function(){return A()},set:function(S){if(A()===S){this.dropDownVisible=!1;return}let M,I=this._currentImageryLayers,P=I.length,D=this._globe.imageryLayers,L=!1;for(M=0;M<P;M++){let R=D.length;for(let O=0;O<R;O++){let F=D.get(O);if(F===I[M]){D.remove(F),L=!0;break}}}if(N(S)){let R=S.creationCommand();if(Array.isArray(R)){let O=R.length;for(this._currentImageryLayers=[],M=O-1;M>=0;M--){let F=x_.fromProviderAsync(R[M]);D.add(F,0),this._currentImageryLayers.push(F)}}else{this._currentImageryLayers=[];let O=x_.fromProviderAsync(R);if(O.name=S.name,L)D.add(O,0);else{let F=D.get(0);N(F)&&D.remove(F),D.add(O,0)}this._currentImageryLayers.push(O)}}A(S),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let E=br.observable();br.defineProperty(this,"selectedTerrain",{get:function(){return E()},set:function(S){if(E()===S){this.dropDownVisible=!1;return}let M;N(S)&&(M=S.creationCommand());let I=!1,P=this._globe.terrainProviderChanged.addEventListener(()=>{I=!0,P()}),D=new uPe(Promise.resolve(M)).readyEvent.addEventListener(L=>{I||(this._globe.depthTestAgainstTerrain=!(L instanceof AT),this._globe.terrainProvider=L,D())});E(S),this.dropDownVisible=!1}});let T=this;this._toggleDropDown=Fl(function(){T.dropDownVisible=!T.dropDownVisible}),this.selectedImagery=Z(o.selectedImageryProviderViewModel,m[0]),this.selectedTerrain=Z(o.selectedTerrainProviderViewModel,v[0])}Object.defineProperties(cat.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var oIe=cat;function Eae(o,f){o=Uh(o);let m=new oIe(f),v=document.createElement("button");v.type="button",v.className="cesium-button cesium-toolbar-button",v.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),o.appendChild(v);let y=document.createElement("img");y.setAttribute("draggable","false"),y.className="cesium-baseLayerPicker-selected",y.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),v.appendChild(y);let x=document.createElement("div");x.className="cesium-baseLayerPicker-dropDown",x.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),o.appendChild(x);let C=document.createElement("div");C.className="cesium-baseLayerPicker-sectionTitle",C.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),C.innerHTML="Imagery",x.appendChild(C);let w=document.createElement("div");w.className="cesium-baseLayerPicker-section",w.setAttribute("data-bind","foreach: _imageryProviders"),x.appendChild(w);let A=document.createElement("div");A.className="cesium-baseLayerPicker-category",w.appendChild(A);let E=document.createElement("div");E.className="cesium-baseLayerPicker-categoryTitle",E.setAttribute("data-bind","text: name"),A.appendChild(E);let T=document.createElement("div");T.className="cesium-baseLayerPicker-choices",T.setAttribute("data-bind","foreach: providers"),A.appendChild(T);let S=document.createElement("div");S.className="cesium-baseLayerPicker-item",S.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),T.appendChild(S);let M=document.createElement("img");M.className="cesium-baseLayerPicker-itemIcon",M.setAttribute("data-bind","attr: { src: iconUrl }"),M.setAttribute("draggable","false"),S.appendChild(M);let I=document.createElement("div");I.className="cesium-baseLayerPicker-itemLabel",I.setAttribute("data-bind","text: name"),S.appendChild(I);let P=document.createElement("div");P.className="cesium-baseLayerPicker-sectionTitle",P.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),P.innerHTML="Terrain",x.appendChild(P);let D=document.createElement("div");D.className="cesium-baseLayerPicker-section",D.setAttribute("data-bind","foreach: _terrainProviders"),x.appendChild(D);let L=document.createElement("div");L.className="cesium-baseLayerPicker-category",D.appendChild(L);let R=document.createElement("div");R.className="cesium-baseLayerPicker-categoryTitle",R.setAttribute("data-bind","text: name"),L.appendChild(R);let O=document.createElement("div");O.className="cesium-baseLayerPicker-choices",O.setAttribute("data-bind","foreach: providers"),L.appendChild(O);let F=document.createElement("div");F.className="cesium-baseLayerPicker-item",F.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),O.appendChild(F);let k=document.createElement("img");k.className="cesium-baseLayerPicker-itemIcon",k.setAttribute("data-bind","attr: { src: iconUrl }"),k.setAttribute("draggable","false"),F.appendChild(k);let U=document.createElement("div");U.className="cesium-baseLayerPicker-itemLabel",U.setAttribute("data-bind","text: name"),F.appendChild(U),br.applyBindings(m,v),br.applyBindings(m,x),this._viewModel=m,this._container=o,this._element=v,this._dropPanel=x,this._closeDropDown=function(G){v.contains(G.target)||x.contains(G.target)||(m.dropDownVisible=!1)},pa.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(Eae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Eae.prototype.isDestroyed=function(){return!1};Eae.prototype.destroy=function(){return pa.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),br.cleanNode(this._element),br.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),kr(this)};var aIe=Eae;function hat(o){let f=o.creationFunction;N(f.canExecute)||(f=Fl(f)),this._creationCommand=f,this.name=o.name,this.tooltip=o.tooltip,this.iconUrl=o.iconUrl,this._category=Z(o.category,""),br.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(hat.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var $m=hat;function KMi(){let o=[];return o.push(new $m({name:"Bing Maps Aerial",iconUrl:Ms("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return rH({style:x5.AERIAL})}})),o.push(new $m({name:"Bing Maps Aerial with Labels",iconUrl:Ms("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return rH({style:x5.AERIAL_WITH_LABELS})}})),o.push(new $m({name:"Bing Maps Roads",iconUrl:Ms("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return rH({style:x5.ROAD})}})),o.push(new $m({name:"ArcGIS World Imagery",iconUrl:Ms("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return hC.fromBasemapType(d3.SATELLITE,{enablePickFeatures:!1})}})),o.push(new $m({name:"ArcGIS World Hillshade",iconUrl:Ms("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return hC.fromBasemapType(d3.HILLSHADE,{enablePickFeatures:!1})}})),o.push(new $m({name:"Esri World Ocean",iconUrl:Ms("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return hC.fromBasemapType(d3.OCEANS,{enablePickFeatures:!1})}})),o.push(new $m({name:"Open\xADStreet\xADMap",iconUrl:Ms("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new pM({url:"https://a.tile.openstreetmap.org/"})}})),o.push(new $m({name:"Stamen Watercolor",iconUrl:Ms("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. http://maps.stamen.com`,category:"Other",creationFunction:function(){return new pM({url:"https://stamen-tiles.a.ssl.fastly.net/watercolor/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),o.push(new $m({name:"Stamen Toner",iconUrl:Ms("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`A high contrast black and white map. http://maps.stamen.com`,category:"Other",creationFunction:function(){return new pM({url:"https://stamen-tiles.a.ssl.fastly.net/toner/",credit:"Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA."})}})),o.push(new $m({name:"Sentinel-2",iconUrl:Ms("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return p2.fromAssetId(3954)}})),o.push(new $m({name:"Blue Marble",iconUrl:Ms("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return p2.fromAssetId(3845)}})),o.push(new $m({name:"Earth at night",iconUrl:Ms("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return p2.fromAssetId(3812)}})),o.push(new $m({name:"Natural Earth\xA0II",iconUrl:Ms("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return cb.fromUrl(Ms("Assets/Textures/NaturalEarthII"))}})),o}var sIe=KMi;function QMi(){let o=[];return o.push(new $m({name:"WGS84 Ellipsoid",iconUrl:Ms("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new AT}})),o.push(new $m({name:"Cesium World Terrain",iconUrl:Ms("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return qoe({requestWaterMask:!0,requestVertexNormals:!0})}})),o}var lIe=QMi;function ZMi(o){let f;if(N(o)){f="Command Statistics";let m=o.commandsInFrustums;for(let v in m)if(m.hasOwnProperty(v)){let y=parseInt(v,10),x;if(y===7)x="1, 2 and 3";else{let C=[];for(let w=2;w>=0;w--){let A=Math.pow(2,w);y>=A&&(C.push(w+1),y-=A)}x=C.reverse().join(" and ")}f+=`<br>    ${m[v]} in frustum ${x}`}f+=`<br>Total: ${o.totalCommands}`}return f}function h0e(o,f,m){let v=Math.min(m,f);return v=Math.max(v,o),v}var $Mi=new _s,eDi=new H;function _X(o,f){let m=this,v=o.canvas,y=new Ur(v);this._eventHandler=y,this._scene=o,this._canvas=v,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=f;let x=this._scene.globe;x.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",br.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Fl(function(){m.dropDownVisible=!m.dropDownVisible}),this._toggleGeneral=Fl(function(){m.generalVisible=!m.generalVisible}),this._togglePrimitives=Fl(function(){m.primitivesVisible=!m.primitivesVisible}),this._toggleTerrain=Fl(function(){m.terrainVisible=!m.terrainVisible}),this._frustumsSubscription=br.getObservable(this,"frustums").subscribe(function(E){m._scene.debugShowFrustums=E,m._scene.requestRender()}),this._frustumPlanesSubscription=br.getObservable(this,"frustumPlanes").subscribe(function(E){m._scene.debugShowFrustumPlanes=E,m._scene.requestRender()}),this._performanceSubscription=br.getObservable(this,"performance").subscribe(function(E){E?m._performanceDisplay=new kq({container:m._performanceContainer}):m._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Fl(function(){return m._primitive.debugShowBoundingVolume=m.primitiveBoundingSphere,m._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=br.getObservable(this,"primitiveBoundingSphere").subscribe(function(){m._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Fl(function(){if(m.primitiveReferenceFrame){let E=m._primitive.modelMatrix;m._modelMatrixPrimitive=new Q2e({modelMatrix:E}),m._scene.primitives.add(m._modelMatrixPrimitive)}else N(m._modelMatrixPrimitive)&&(m._scene.primitives.remove(m._modelMatrixPrimitive),m._modelMatrixPrimitive=void 0);return m._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=br.getObservable(this,"primitiveReferenceFrame").subscribe(function(){m._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Fl(function(){return m.filterPrimitive?m._scene.debugCommandFilter=function(E){return N(m._modelMatrixPrimitive)&&E.owner===m._modelMatrixPrimitive._primitive?!0:N(m._primitive)?E.owner===m._primitive||E.owner===m._primitive._billboardCollection||E.owner.primitive===m._primitive:!1}:m._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=br.getObservable(this,"filterPrimitive").subscribe(function(){m._doFilterPrimitive(),m._scene.requestRender()}),this._wireframeSubscription=br.getObservable(this,"wireframe").subscribe(function(E){x._surface.tileProvider._debug.wireframe=E,m._scene.requestRender()}),this._depthFrustumSubscription=br.getObservable(this,"depthFrustum").subscribe(function(E){m._scene.debugShowDepthFrustum=E,m._scene.requestRender()}),this._incrementDepthFrustum=Fl(function(){let E=m.depthFrustum+1;return m.depthFrustum=h0e(1,m._numberOfFrustums,E),m._scene.requestRender(),!0}),this._decrementDepthFrustum=Fl(function(){let E=m.depthFrustum-1;return m.depthFrustum=h0e(1,m._numberOfFrustums,E),m._scene.requestRender(),!0}),this._suspendUpdatesSubscription=br.getObservable(this,"suspendUpdates").subscribe(function(E){x._surface._debug.suspendLodUpdate=E,E||(m.filterTile=!1)});let C;this._showTileCoordinates=Fl(function(){return m.tileCoordinates&&!N(C)?C=o.imageryLayers.addImageryProvider(new oX({tilingScheme:o.terrainProvider.tilingScheme})):!m.tileCoordinates&&N(C)&&(o.imageryLayers.remove(C),C=void 0),!0}),this._tileCoordinatesSubscription=br.getObservable(this,"tileCoordinates").subscribe(function(){m._showTileCoordinates(),m._scene.requestRender()}),this._tileBoundingSphereSubscription=br.getObservable(this,"tileBoundingSphere").subscribe(function(){m._showTileBoundingSphere(),m._scene.requestRender()}),this._showTileBoundingSphere=Fl(function(){return m.tileBoundingSphere?x._surface.tileProvider._debug.boundingSphereTile=m._tile:x._surface.tileProvider._debug.boundingSphereTile=void 0,m._scene.requestRender(),!0}),this._doFilterTile=Fl(function(){return m.filterTile?(m.suspendUpdates=!0,x._surface._tilesToRender=[],N(m._tile)&&m._tile.renderable&&x._surface._tilesToRender.push(m._tile)):m.suspendUpdates=!1,!0}),this._filterTileSubscription=br.getObservable(this,"filterTile").subscribe(function(){m.doFilterTile(),m._scene.requestRender()});function w(E){let T=m._scene.pick({x:E.position.x,y:E.position.y});N(T)&&(m.primitive=N(T.collection)?T.collection:T.primitive),m._scene.requestRender(),m.pickPrimitiveActive=!1}this._pickPrimitive=Fl(function(){m.pickPrimitiveActive=!m.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=br.getObservable(this,"pickPrimitiveActive").subscribe(function(E){E?y.setInputAction(w,Ei.LEFT_CLICK):y.removeInputAction(Ei.LEFT_CLICK)});function A(E){let T,S=x.ellipsoid,M=m._scene.camera.getPickRay(E.position,$Mi),I=x.pick(M,m._scene,eDi);if(N(I)){let P=S.cartesianToCartographic(I),D=x._surface.tileProvider._tilesToRenderByTextureCount;for(let L=0;!T&&L<D.length;++L){let R=D[L];if(N(R))for(let O=0;!T&&O<R.length;++O){let F=R[O];Di.contains(F.rectangle,P)&&(T=F)}}}m.tile=T,m.pickTileActive=!1}this._pickTile=Fl(function(){m.pickTileActive=!m.pickTileActive}),this._pickTileActiveSubscription=br.getObservable(this,"pickTileActive").subscribe(function(E){E?y.setInputAction(A,Ei.LEFT_CLICK):y.removeInputAction(Ei.LEFT_CLICK)}),this._removePostRenderEvent=o.postRender.addEventListener(function(){m._update()})}Object.defineProperties(_X.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let o=this;return Fl(function(){o.tile=o.tile.parent})}},selectNW:{get:function(){let o=this;return Fl(function(){o.tile=o.tile.northwestChild})}},selectNE:{get:function(){let o=this;return Fl(function(){o.tile=o.tile.northeastChild})}},selectSW:{get:function(){let o=this;return Fl(function(){o.tile=o.tile.southwestChild})}},selectSE:{get:function(){let o=this;return Fl(function(){o.tile=o.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(o){let f=this._primitive;o!==f&&(this.hasPickedPrimitive=!0,N(f)&&(f.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,N(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=o,o.show=!1,setTimeout(function(){o.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(o){if(N(o)){this.hasPickedTile=!0;let f=this._tile;if(o!==f){this.tileText=`L: ${o.level} X: ${o.x} Y: ${o.y}`,this.tileText+=`<br>SW corner: ${o.rectangle.west}, ${o.rectangle.south}`,this.tileText+=`<br>NE corner: ${o.rectangle.east}, ${o.rectangle.north}`;let m=o.data;N(m)&&N(m.tileBoundingRegion)?this.tileText+=`<br>Min: ${m.tileBoundingRegion.minimumHeight} Max: ${m.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=o,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});_X.prototype._update=function(){this.frustums&&(this.frustumStatisticText=ZMi(this._scene.debugFrustumStatistics));let o=this._scene.numberOfFrustums;this._numberOfFrustums=o,this.depthFrustum=h0e(1,o,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${o}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};_X.prototype.isDestroyed=function(){return!1};_X.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),kr(this)};var uIe=_X;function Tae(o,f){o=Uh(o);let m=document.createElement("div"),v=new uIe(f,m);this._viewModel=v,this._container=o;let y=document.createElement("div");this._element=y;let x=document.createElement("div");x.textContent="Cesium Inspector",x.className="cesium-cesiumInspector-button",x.setAttribute("data-bind","click: toggleDropDown"),y.appendChild(x),y.className="cesium-cesiumInspector",y.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),o.appendChild(this._element);let C=document.createElement("div");C.className="cesium-cesiumInspector-dropDown",y.appendChild(C);let w=k1.createSection,A=k1.createCheckbox,E=w(C,"General","generalVisible","toggleGeneral"),T=A("Show Frustums","frustums"),S=document.createElement("div");S.className="cesium-cesiumInspector-frustumStatistics",S.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),T.appendChild(S),E.appendChild(T),E.appendChild(A("Show Frustum Planes","frustumPlanes")),E.appendChild(A("Performance Display","performance")),m.className="cesium-cesiumInspector-performanceDisplay",E.appendChild(m);let M=document.createElement("div");M.className="cesium-cesiumInspector-shaderCache",M.setAttribute("data-bind","html: shaderCacheText"),E.appendChild(M);let I=document.createElement("div");E.appendChild(I);let P=document.createElement("span");P.setAttribute("data-bind",'html: "     Frustum:"'),I.appendChild(P);let D=document.createElement("span");D.setAttribute("data-bind","text: depthFrustumText"),I.appendChild(D);let L=document.createElement("input");L.type="button",L.value="-",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: decrementDepthFrustum"),I.appendChild(L);let R=document.createElement("input");R.type="button",R.value="+",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind","click: incrementDepthFrustum"),I.appendChild(R);let O=w(C,"Primitives","primitivesVisible","togglePrimitives"),F=document.createElement("div");F.className="cesium-cesiumInspector-pickSection",O.appendChild(F);let k=document.createElement("input");k.type="button",k.value="Pick a primitive",k.className="cesium-cesiumInspector-pickButton",k.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let U=document.createElement("div");U.className="cesium-cesiumInspector-center",U.appendChild(k),F.appendChild(U),F.appendChild(A("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),F.appendChild(A("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=A("Show only selected","filterPrimitive","hasPickedPrimitive"),F.appendChild(this._primitiveOnly);let G=w(C,"Terrain","terrainVisible","toggleTerrain"),j=document.createElement("div");j.className="cesium-cesiumInspector-pickSection",G.appendChild(j);let q=document.createElement("input");q.type="button",q.value="Pick a tile",q.className="cesium-cesiumInspector-pickButton",q.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),U=document.createElement("div"),U.appendChild(q),U.className="cesium-cesiumInspector-center",j.appendChild(U);let J=document.createElement("div");j.appendChild(J);let X=document.createElement("input");X.type="button",X.value="Parent",X.className="cesium-cesiumInspector-pickButton",X.setAttribute("data-bind","click: selectParent");let Y=document.createElement("input");Y.type="button",Y.value="NW",Y.className="cesium-cesiumInspector-pickButton",Y.setAttribute("data-bind","click: selectNW");let Q=document.createElement("input");Q.type="button",Q.value="NE",Q.className="cesium-cesiumInspector-pickButton",Q.setAttribute("data-bind","click: selectNE");let ee=document.createElement("input");ee.type="button",ee.value="SW",ee.className="cesium-cesiumInspector-pickButton",ee.setAttribute("data-bind","click: selectSW");let z=document.createElement("input");z.type="button",z.value="SE",z.className="cesium-cesiumInspector-pickButton",z.setAttribute("data-bind","click: selectSE");let ie=document.createElement("div");ie.className="cesium-cesiumInspector-tileText",J.className="cesium-cesiumInspector-frustumStatistics",J.appendChild(ie),J.setAttribute("data-bind","visible: hasPickedTile"),ie.setAttribute("data-bind","html: tileText");let re=document.createElement("div");re.className="cesium-cesiumInspector-relativeText",re.textContent="Select relative:",J.appendChild(re);let ne=document.createElement("table"),oe=document.createElement("tr"),se=document.createElement("tr"),ae=document.createElement("td");ae.appendChild(X);let fe=document.createElement("td");fe.appendChild(Y);let de=document.createElement("td");de.appendChild(Q),oe.appendChild(ae),oe.appendChild(fe),oe.appendChild(de);let ve=document.createElement("td"),pe=document.createElement("td");pe.appendChild(ee);let ce=document.createElement("td");ce.appendChild(z),se.appendChild(ve),se.appendChild(pe),se.appendChild(ce),ne.appendChild(oe),ne.appendChild(se),J.appendChild(ne),j.appendChild(A("Show bounding volume","tileBoundingSphere","hasPickedTile")),j.appendChild(A("Show only selected","filterTile","hasPickedTile")),G.appendChild(A("Wireframe","wireframe")),G.appendChild(A("Suspend LOD update","suspendUpdates")),G.appendChild(A("Show tile coordinates","tileCoordinates")),br.applyBindings(v,this._element)}Object.defineProperties(Tae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Tae.prototype.isDestroyed=function(){return!1};Tae.prototype.destroy=function(){return br.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),kr(this)};var cIe=Tae;function Sae(o,f){N(f)||(f=document.body),f=Uh(f);let m=this,v=br.observable(ng.fullscreen),y=br.observable(ng.enabled),x=f.ownerDocument;this.isFullscreen=void 0,br.defineProperty(this,"isFullscreen",{get:function(){return v()}}),this.isFullscreenEnabled=void 0,br.defineProperty(this,"isFullscreenEnabled",{get:function(){return y()},set:function(C){y(C&&ng.enabled)}}),this.tooltip=void 0,br.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?v()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Fl(function(){ng.fullscreen?ng.exitFullscreen():ng.requestFullscreen(m._fullscreenElement)},br.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Z(Uh(o),x.body),this._callback=function(){v(ng.fullscreen)},x.addEventListener(ng.changeEventName,this._callback)}Object.defineProperties(Sae.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(o){this._fullscreenElement=o}},command:{get:function(){return this._command}}});Sae.prototype.isDestroyed=function(){return!1};Sae.prototype.destroy=function(){document.removeEventListener(ng.changeEventName,this._callback),kr(this)};var hIe=Sae,tDi="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",iDi="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function Pae(o,f){o=Uh(o);let m=new hIe(f,o);m._exitFullScreenPath=iDi,m._enterFullScreenPath=tDi;let v=document.createElement("button");v.type="button",v.className="cesium-button cesium-fullscreenButton",v.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),o.appendChild(v),br.applyBindings(m,v),this._container=o,this._viewModel=m,this._element=v}Object.defineProperties(Pae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Pae.prototype.isDestroyed=function(){return!1};Pae.prototype.destroy=function(){return this._viewModel.destroy(),br.cleanNode(this._element),this._container.removeChild(this._element),kr(this)};var dIe=Pae,m8e=1e3;function Ww(o){N(o.geocoderServices)?this._geocoderServices=o.geocoderServices:this._geocoderServices=[new c2e,new C2e({scene:o.scene})],this._viewContainer=o.container,this._scene=o.scene,this._flightDuration=o.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new Br,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=_8e,this._handleArrowUp=g8e;let f=this;this._suggestionsVisible=br.pureComputed(function(){let v=br.getObservable(f,"_suggestions")().length>0,y=br.getObservable(f,"_showSuggestions")();return v&&y}),this._searchCommand=Fl(function(v){if(v=Z(v,Jq.SEARCH),f._focusTextbox=!1,N(f._selectedSuggestion))return f.activateSuggestion(f._selectedSuggestion),!1;if(f.hideSuggestions(),f.isSearchInProgress)lDi(f);else return aDi(f,f._geocoderServices,v)}),this.deselectSuggestion=function(){f._selectedSuggestion=void 0},this.handleKeyDown=function(v,y){let x=y.key==="ArrowDown"||y.key==="Down"||y.keyCode===40,C=y.key==="ArrowUp"||y.key==="Up"||y.keyCode===38;return(x||C)&&y.preventDefault(),!0},this.handleKeyUp=function(v,y){let x=y.key==="ArrowDown"||y.key==="Down"||y.keyCode===40,C=y.key==="ArrowUp"||y.key==="Up"||y.keyCode===38,w=y.key==="Enter"||y.keyCode===13;return C?g8e(f):x?_8e(f):w&&f._searchCommand(),!0},this.activateSuggestion=function(v){f.hideSuggestions(),f._searchText=v.displayName;let y=v.destination;pat(f),f.destinationFound(f,y)},this.hideSuggestions=function(){f._showSuggestions=!1,f._selectedSuggestion=void 0},this.showSuggestions=function(){f._showSuggestions=!0},this.handleMouseover=function(v,y){v!==f._selectedSuggestion&&(f._selectedSuggestion=v)},this.keepExpanded=!1,this.autoComplete=Z(o.autocomplete,!0),this.destinationFound=Z(o.destinationFound,Ww.flyToDestination),this._focusTextbox=!1,br.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let m=br.getObservable(this,"_searchText");m.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=m.subscribe(function(){Ww._updateSearchSuggestions(f)}),this.isSearchInProgress=void 0,br.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,br.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(v){this._searchText=v}}),this.flightDuration=void 0,br.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(v){this._flightDuration=v}})}Object.defineProperties(Ww.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});Ww.prototype.destroy=function(){this._suggestionSubscription.dispose()};function g8e(o){if(o._suggestions.length===0)return;let f=o._suggestions.indexOf(o._selectedSuggestion);if(f===-1||f===0){o._selectedSuggestion=void 0;return}let m=f-1;o._selectedSuggestion=o._suggestions[m],Ww._adjustSuggestionsScroll(o,m)}function _8e(o){if(o._suggestions.length===0)return;let f=o._suggestions.length,m=(o._suggestions.indexOf(o._selectedSuggestion)+1)%f;o._selectedSuggestion=o._suggestions[m],Ww._adjustSuggestionsScroll(o,m)}function rDi(o,f){let m=N(f)?f.availability:void 0;return N(m)?xT(f,[o]).then(function(v){return o=v[0],o.height+=m8e,o}):(o.height+=m8e,Promise.resolve(o))}function nDi(o,f){let m=o._scene,v=m.mapProjection.ellipsoid,y=m.camera,x=m.terrainProvider,C=f,w;return f instanceof Di?xe.equalsEpsilon(f.south,f.north,xe.EPSILON7)&&xe.equalsEpsilon(f.east,f.west,xe.EPSILON7)?f=Di.center(f):w=tae(f,m):f=v.cartesianToCartographic(f),N(w)||(w=rDi(f,x)),w.then(function(A){C=v.cartographicToCartesian(A)}).finally(function(){y.flyTo({destination:C,complete:function(){o._complete.raiseEvent()},duration:o._flightDuration,endTransform:Ee.IDENTITY})})}async function oDi(o,f,m){try{return{state:"fulfilled",value:await o.geocode(f,m),credits:o.credit}}catch(v){return{state:"rejected",reason:v}}}async function aDi(o,f,m){let v=o._searchText;if(fat(v)){o.showSuggestions();return}o._isSearchInProgress=!0,o._wasGeocodeCancelled=!1;let y,x;for(y=0;y<f.length;y++){if(o._wasGeocodeCancelled)return;if(x=await oDi(f[y],v,m),N(x)&&x.state==="fulfilled"&&x.value.length>0)break}if(o._wasGeocodeCancelled)return;o._isSearchInProgress=!1,pIe(o);let C=x.value;if(x.state==="fulfilled"&&N(C)&&C.length>0){o._searchText=C[0].displayName,o.destinationFound(o,C[0].destination);let w=dat(o,Koe.getCreditsFromResult(C[0]));N(w)||fIe(o,f[y].credit);return}o._searchText=`${v} (not found)`}function fIe(o,f){N(f)&&!o._scene.isDestroyed()&&!o._scene.frameState.creditDisplay.isDestroyed()&&(o._scene.frameState.creditDisplay.addStaticCredit(f),o._previousCredits.push(f))}function dat(o,f){return N(f)&&f.forEach(m=>fIe(o,m)),f}function pIe(o){!o._scene.isDestroyed()&&!o._scene.frameState.creditDisplay.isDestroyed()&&o._previousCredits.forEach(f=>{o._scene.frameState.creditDisplay.removeStaticCredit(f)}),o._previousCredits.length=0}function sDi(o,f){let m=Uh(o._viewContainer),v=m.getElementsByClassName("search-results")[0],y=m.getElementsByTagName("li")[f];if(f===0){v.scrollTop=0;return}let x=y.offsetTop;x+y.clientHeight>v.clientHeight?v.scrollTop=x+y.clientHeight:x<v.scrollTop&&(v.scrollTop=x)}function lDi(o){o._isSearchInProgress&&(o._isSearchInProgress=!1,o._wasGeocodeCancelled=!0)}function fat(o){return/^\s*$/.test(o)}function pat(o){br.getObservable(o,"_suggestions").removeAll()}async function uDi(o){if(!o.autoComplete)return;let f=o._searchText;if(pat(o),pIe(o),!fat(f))for(let m of o._geocoderServices){let v=await m.geocode(f,Jq.AUTOCOMPLETE);if(o._suggestions=o._suggestions.concat(v),v.length>0){let y=!0;v.forEach(x=>{let C=Koe.getCreditsFromResult(x);y=y&&!N(C),dat(o,C)}),y&&fIe(o,m.credit)}if(o._suggestions.length>=5)return}}Ww.flyToDestination=nDi;Ww._updateSearchSuggestions=uDi;Ww._adjustSuggestionsScroll=sDi;Ww.prototype.isDestroyed=function(){return!1};Ww.prototype.destroy=function(){return pIe(this),kr(this)};var mIe=Ww,cDi="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",hDi="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function Iae(o){let f=Uh(o.container),m=new mIe(o);m._startSearchPath=cDi,m._stopSearchPath=hDi;let v=document.createElement("form");v.setAttribute("data-bind","submit: search");let y=document.createElement("input");y.type="search",y.className="cesium-geocoder-input",y.setAttribute("placeholder","Enter an address or landmark..."),y.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){y.select()},0)},y.addEventListener("focus",this._onTextBoxFocus,!1),v.appendChild(y),this._textBox=y;let x=document.createElement("span");x.className="cesium-geocoder-searchButton",x.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),v.appendChild(x),f.appendChild(v);let C=document.createElement("div");C.className="search-results",C.setAttribute("data-bind","visible: _suggestionsVisible");let w=document.createElement("ul");w.setAttribute("data-bind","foreach: _suggestions");let A=document.createElement("li");w.appendChild(A),A.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),C.appendChild(w),f.appendChild(C),br.applyBindings(m,v),br.applyBindings(m,C),this._container=f,this._searchSuggestionsContainer=C,this._viewModel=m,this._form=v,this._onInputBegin=function(E){let T=E.target;typeof E.composedPath=="function"&&(T=E.composedPath()[0]),f.contains(T)||(m._focusTextbox=!1,m.hideSuggestions())},this._onInputEnd=function(E){m._focusTextbox=!0,m.showSuggestions()},pa.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),f.addEventListener("pointerup",this._onInputEnd,!0),f.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),f.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),f.addEventListener("touchend",this._onInputEnd,!0),f.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(Iae.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});Iae.prototype.isDestroyed=function(){return!1};Iae.prototype.destroy=function(){let o=this._container;return pa.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),o.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),o.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),o.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),br.cleanNode(this._form),br.cleanNode(this._searchSuggestionsContainer),o.removeChild(this._form),o.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),kr(this)};var gIe=Iae;function mat(o,f){this._scene=o,this._duration=f;let m=this;this._command=Fl(function(){m._scene.camera.flyHome(m._duration)}),this.tooltip="View Home",br.track(this,["tooltip"])}Object.defineProperties(mat.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(o){this._duration=o}}});var _Ie=mat;function Mae(o,f,m){o=Uh(o);let v=new _Ie(f,m);v._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let y=document.createElement("button");y.type="button",y.className="cesium-button cesium-toolbar-button cesium-home-button",y.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),o.appendChild(y),br.applyBindings(v,y),this._container=o,this._viewModel=v,this._element=y}Object.defineProperties(Mae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Mae.prototype.isDestroyed=function(){return!1};Mae.prototype.destroy=function(){return br.cleanNode(this._element),this._container.removeChild(this._element),kr(this)};var vIe=Mae,dDi="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",fDi="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function yIe(){this._cameraClicked=new Br,this._closeClicked=new Br,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",br.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,br.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?fDi:dDi}}),br.defineProperty(this,"_bodyless",{get:function(){return!N(this.description)||this.description.length===0}})}yIe.prototype.maxHeightOffset=function(o){return`${this.maxHeight-o}px`};Object.defineProperties(yIe.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var xIe=yIe;function Dae(o){o=Uh(o);let f=document.createElement("div");f.className="cesium-infoBox",f.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),o.appendChild(f);let m=document.createElement("div");m.className="cesium-infoBox-title",m.setAttribute("data-bind","text: titleText"),f.appendChild(m);let v=document.createElement("button");v.type="button",v.className="cesium-button cesium-infoBox-camera",v.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),f.appendChild(v);let y=document.createElement("button");y.type="button",y.className="cesium-infoBox-close",y.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),y.innerHTML="×",f.appendChild(y);let x=document.createElement("iframe");x.className="cesium-infoBox-iframe",x.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),x.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),x.setAttribute("allowfullscreen",!0),f.appendChild(x);let C=new xIe;br.applyBindings(C,f),this._container=o,this._element=f,this._frame=x,this._viewModel=C,this._descriptionSubscription=void 0;let w=this;x.addEventListener("load",function(){let A=x.contentDocument,E=A.createElement("link");E.href=Ms("Widgets/InfoBox/InfoBoxDescription.css"),E.rel="stylesheet",E.type="text/css";let T=A.createElement("div");T.className="cesium-infoBox-description",A.head.appendChild(E),A.body.appendChild(T),w._descriptionSubscription=oC(C,"description",function(S){x.style.height="5px",T.innerHTML=S;let M=null,I=T.firstElementChild;if(I!==null&&T.childNodes.length===1){let D=window.getComputedStyle(I);if(D!==null){let L=D["background-color"],R=Re.fromCssColorString(L);N(R)&&R.alpha!==0&&(M=D["background-color"])}}f.style["background-color"]=M;let P=T.getBoundingClientRect().height;x.style.height=`${P}px`})}),x.setAttribute("src","about:blank")}Object.defineProperties(Dae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});Dae.prototype.isDestroyed=function(){return!1};Dae.prototype.destroy=function(){let o=this._container;return br.cleanNode(this._element),o.removeChild(this._element),N(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),kr(this)};var CIe=Dae;function gat(){this.showInstructions=!1;let o=this;this._command=Fl(function(){o.showInstructions=!o.showInstructions}),this._showClick=Fl(function(){o._touch=!1}),this._showTouch=Fl(function(){o._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",br.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(gat.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var bIe=gat;function Lae(o){let f=Uh(o.container),m=new bIe,v=Z(o.instructionsInitiallyVisible,!1);m.showInstructions=v,m._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let y=document.createElement("span");y.className="cesium-navigationHelpButton-wrapper",f.appendChild(y);let x=document.createElement("button");x.type="button",x.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",x.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),y.appendChild(x);let C=document.createElement("div");C.className="cesium-navigation-help",C.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),y.appendChild(C);let w=document.createElement("button");w.type="button",w.className="cesium-navigation-button cesium-navigation-button-left",w.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let A=document.createElement("img");A.src=Ms("Widgets/Images/NavigationHelp/Mouse.svg"),A.className="cesium-navigation-button-icon",A.style.width="25px",A.style.height="25px",w.appendChild(A),w.appendChild(document.createTextNode("Mouse"));let E=document.createElement("button");E.type="button",E.className="cesium-navigation-button cesium-navigation-button-right",E.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let T=document.createElement("img");T.src=Ms("Widgets/Images/NavigationHelp/Touch.svg"),T.className="cesium-navigation-button-icon",T.style.width="25px",T.style.height="25px",E.appendChild(T),E.appendChild(document.createTextNode("Touch")),C.appendChild(w),C.appendChild(E);let S=document.createElement("div");S.className="cesium-click-navigation-help cesium-navigation-help-instructions",S.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),S.innerHTML=` <table> <tr> <td><img src="${Ms("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${Ms("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${Ms("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,C.appendChild(S);let M=document.createElement("div");M.className="cesium-touch-navigation-help cesium-navigation-help-instructions",M.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),M.innerHTML=` <table> <tr> <td><img src="${Ms("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${Ms("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${Ms("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${Ms("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,C.appendChild(M),br.applyBindings(m,y),this._container=f,this._viewModel=m,this._wrapper=y,this._closeInstructions=function(I){y.contains(I.target)||(m.showInstructions=!1)},pa.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(Lae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Lae.prototype.isDestroyed=function(){return!1};Lae.prototype.destroy=function(){return pa.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),br.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),kr(this)};var wIe=Lae;function AIe(o){this._scene=o.scene,this.lowFrameRateMessage=Z(o.lowFrameRateMessage,"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers."),this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,br.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let f=this;this._dismissMessage=Fl(function(){f.showingLowFrameRateMessage=!1,f.lowFrameRateMessageDismissed=!0});let m=Z2e.fromScene(o.scene);this._unsubscribeLowFrameRate=m.lowFrameRate.addEventListener(function(){f.lowFrameRateMessageDismissed||(f.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=m.nominalFrameRate.addEventListener(function(){f.showingLowFrameRateMessage=!1})}Object.defineProperties(AIe.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});AIe.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),kr(this)};var EIe=AIe;function Rae(o){let f=Uh(o.container),m=new EIe(o),v=document.createElement("div");v.className="cesium-performance-watchdog-message-area",v.setAttribute("data-bind","visible: showingLowFrameRateMessage");let y=document.createElement("button");y.setAttribute("type","button"),y.className="cesium-performance-watchdog-message-dismiss",y.innerHTML="×",y.setAttribute("data-bind","click: dismissMessage"),v.appendChild(y);let x=document.createElement("div");x.className="cesium-performance-watchdog-message",x.setAttribute("data-bind","html: lowFrameRateMessage"),v.appendChild(x),f.appendChild(v),br.applyBindings(m,v),this._container=f,this._viewModel=m,this._element=v}Object.defineProperties(Rae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Rae.prototype.isDestroyed=function(){return!1};Rae.prototype.destroy=function(){return this._viewModel.destroy(),br.cleanNode(this._element),this._container.removeChild(this._element),kr(this)};var TIe=Rae;function Oae(o,f){this._scene=o;let m=this,v=function(y,x,C,w){m.sceneMode=C,m.dropDownVisible=!1};this._eventHelper=new AC,this._eventHelper.add(o.morphStart,v),this._duration=Z(f,2),this.sceneMode=o.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",br.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,br.defineProperty(this,"selectedTooltip",function(){let y=m.sceneMode;return y===_i.SCENE2D?m.tooltip2D:y===_i.SCENE3D?m.tooltip3D:m.tooltipColumbusView}),this._toggleDropDown=Fl(function(){m.dropDownVisible=!m.dropDownVisible}),this._morphTo2D=Fl(function(){o.morphTo2D(m._duration)}),this._morphTo3D=Fl(function(){o.morphTo3D(m._duration)}),this._morphToColumbusView=Fl(function(){o.morphToColumbusView(m._duration)}),this._sceneMode=_i}Object.defineProperties(Oae.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(o){this._duration=o}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});Oae.prototype.isDestroyed=function(){return!1};Oae.prototype.destroy=function(){this._eventHelper.removeAll(),kr(this)};var SIe=Oae,pDi="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",mDi="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",gDi="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function Nae(o,f,m){o=Uh(o);let v=new SIe(f,m);v._globePath=pDi,v._flatMapPath=mDi,v._columbusViewPath=gDi;let y=document.createElement("span");y.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",o.appendChild(y);let x=document.createElement("button");x.type="button",x.className="cesium-button cesium-toolbar-button",x.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),x.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',y.appendChild(x);let C=document.createElement("button");C.type="button",C.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",C.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),y.appendChild(C);let w=document.createElement("button");w.type="button",w.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",w.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),y.appendChild(w);let A=document.createElement("button");A.type="button",A.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",A.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),y.appendChild(A),br.applyBindings(v,y),this._viewModel=v,this._container=o,this._wrapper=y,this._closeDropDown=function(E){y.contains(E.target)||(v.dropDownVisible=!1)},pa.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(Nae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Nae.prototype.isDestroyed=function(){return!1};Nae.prototype.destroy=function(){return this._viewModel.destroy(),pa.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),br.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),kr(this)};var PIe=Nae,_Di=new Ye,gie="-1000px";function vX(o,f,m){this._scene=o,this._screenPositionX=gie,this._screenPositionY=gie,this._tweens=o.tweens,this._container=Z(m,document.body),this._selectionIndicatorElement=f,this._scale=1,this.position=void 0,this.showSelection=!1,br.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,br.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&N(this.position)}}),br.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(v,y){return nl.wgs84ToWindowCoordinates(o,v,y)}}vX.prototype.update=function(){if(this.showSelection&&N(this.position)){let o=this.computeScreenSpacePosition(this.position,_Di);if(!N(o))this._screenPositionX=gie,this._screenPositionY=gie;else{let f=this._container,m=f.parentNode.clientWidth,v=f.parentNode.clientHeight,y=this._selectionIndicatorElement.clientWidth,x=y*.5;o.x=Math.min(Math.max(o.x,-y),m+y)-x,o.y=Math.min(Math.max(o.y,-y),v+y)-x,this._screenPositionX=`${Math.floor(o.x+.25)}px`,this._screenPositionY=`${Math.floor(o.y+.25)}px`}}};vX.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Bv.EXPONENTIAL_OUT})};vX.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Bv.EXPONENTIAL_OUT})};Object.defineProperties(vX.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var IIe=vX;function Fae(o,f){o=Uh(o),this._container=o;let m=document.createElement("div");m.className="cesium-selection-wrapper",m.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),o.appendChild(m),this._element=m;let v="http://www.w3.org/2000/svg",y="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",x=document.createElementNS(v,"svg:svg");x.setAttribute("width",160),x.setAttribute("height",160),x.setAttribute("viewBox","0 0 160 160");let C=document.createElementNS(v,"g");C.setAttribute("transform","translate(80,80)"),x.appendChild(C);let w=document.createElementNS(v,"path");w.setAttribute("data-bind","attr: { transform: _transform }"),w.setAttribute("d",y),C.appendChild(w),m.appendChild(x);let A=new IIe(f,this._element,this._container);this._viewModel=A,br.applyBindings(this._viewModel,this._element)}Object.defineProperties(Fae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Fae.prototype.isDestroyed=function(){return!1};Fae.prototype.destroy=function(){let o=this._container;return br.cleanNode(this._element),o.removeChild(this._element),kr(this)};var MIe=Fae;function Bae(o){this._scene=o,this._orthographic=o.camera.frustum instanceof Gs,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=o.mode,br.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let f=this;br.defineProperty(this,"selectedTooltip",function(){return f._orthographic?f.tooltipOrthographic:f.tooltipPerspective}),this._toggleDropDown=Fl(function(){f.sceneMode===_i.SCENE2D||f._flightInProgress||(f.dropDownVisible=!f.dropDownVisible)}),this._eventHelper=new AC,this._eventHelper.add(o.morphComplete,function(m,v,y,x){f.sceneMode=y,f._orthographic=y===_i.SCENE2D||f._scene.camera.frustum instanceof Gs}),this._eventHelper.add(o.preRender,function(){f._flightInProgress=N(o.camera._currentFlight)}),this._switchToPerspective=Fl(function(){f.sceneMode!==_i.SCENE2D&&(f._scene.camera.switchToPerspectiveFrustum(),f._orthographic=!1,f.dropDownVisible=!1)}),this._switchToOrthographic=Fl(function(){f.sceneMode!==_i.SCENE2D&&(f._scene.camera.switchToOrthographicFrustum(),f._orthographic=!0,f.dropDownVisible=!1)}),this._sceneMode=_i}Object.defineProperties(Bae.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});Bae.prototype.isDestroyed=function(){return!1};Bae.prototype.destroy=function(){this._eventHelper.removeAll(),kr(this)};var DIe=Bae,vDi="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",yDi="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function kae(o,f){o=Uh(o);let m=new DIe(f);m._perspectivePath=vDi,m._orthographicPath=yDi;let v=document.createElement("span");v.className="cesium-projectionPicker-wrapper cesium-toolbar-button",o.appendChild(v);let y=document.createElement("button");y.type="button",y.className="cesium-button cesium-toolbar-button",y.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),y.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',v.appendChild(y);let x=document.createElement("button");x.type="button",x.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",x.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),v.appendChild(x);let C=document.createElement("button");C.type="button",C.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",C.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),v.appendChild(C),br.applyBindings(m,v),this._viewModel=m,this._container=o,this._wrapper=v,this._closeDropDown=function(w){v.contains(w.target)||(m.dropDownVisible=!1)},pa.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(kae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kae.prototype.isDestroyed=function(){return!1};kae.prototype.destroy=function(){return this._viewModel.destroy(),pa.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),br.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),kr(this)};var LIe=kae;function h4(o,f,m){this._color=o,this._height=f,this._base=Z(m,0)}h4.prototype.getHeight=function(){return this._height};h4.prototype.getBase=function(){return this._base};h4.prototype.getStartTime=function(){return this._start};h4.prototype.getStopTime=function(){return this._stop};h4.prototype.setRange=function(o,f){this._start=o,this._stop=f};h4.prototype.render=function(o){let f="";if(this._start&&this._stop&&this._color){let m=ci.secondsDifference(this._start,o.epochJulian),v=Math.round(o.timeBarWidth*o.getAlpha(m)),y=ci.secondsDifference(this._stop,o.epochJulian),x=Math.round(o.timeBarWidth*o.getAlpha(y))-v;v<0&&(x+=v,v=0),v+x>o.timeBarWidth&&(x=o.timeBarWidth-v),x>0&&(f=`<span class="cesium-timeline-highlight" style="left: ${v.toString()}px; width: ${x.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return f};var RIe=h4;function _at(o,f,m,v){this.interval=o,this.height=f,this.color=m||new Re(.5,.5,.5,1),this.backgroundColor=v||new Re(0,0,0,0)}_at.prototype.render=function(o,f){let m=this.interval.start,v=this.interval.stop,y=f.startJulian,x=ci.addSeconds(f.startJulian,f.duration,new ci);if(ci.lessThan(m,y)&&ci.greaterThan(v,x))o.fillStyle=this.color.toCssColorString(),o.fillRect(0,f.y,f.timeBarWidth,this.height);else if(ci.lessThanOrEquals(m,x)&&ci.greaterThanOrEquals(v,y)){let C,w,A;for(C=0;C<f.timeBarWidth;++C){let E=ci.addSeconds(f.startJulian,C/f.timeBarWidth*f.duration,new ci);!N(w)&&ci.greaterThanOrEquals(E,m)?w=C:!N(A)&&ci.greaterThanOrEquals(E,v)&&(A=C)}o.fillStyle=this.backgroundColor.toCssColorString(),o.fillRect(0,f.y,f.timeBarWidth,this.height),N(w)&&(N(A)||(A=f.timeBarWidth),o.fillStyle=this.color.toCssColorString(),o.fillRect(w,f.y,Math.max(A-w,1),this.height))}};var OIe=_at,jpe=1e12,Ew={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Ny={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},gR=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6];function nx(o,f){o=Uh(o);let m=o.ownerDocument;this.container=o;let v=m.createElement("div");v.className="cesium-timeline-main",o.appendChild(v),this._topDiv=v,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=f,this._scrubJulian=f.currentTime,this._mainTicSpan=-1,this._mouseMode=Ew.none,this._touchMode=Ny.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(f.startTime,f.stopTime),this._onMouseDown=xDi(this),this._onMouseUp=CDi(this),this._onMouseMove=bDi(this),this._onMouseWheel=wDi(this),this._onTouchStart=ADi(this),this._onTouchMove=TDi(this),this._onTouchEnd=EDi(this);let y=this._timeBarEle;m.addEventListener("mouseup",this._onMouseUp,!1),m.addEventListener("mousemove",this._onMouseMove,!1),y.addEventListener("mousedown",this._onMouseDown,!1),y.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),y.addEventListener("mousewheel",this._onMouseWheel,!1),y.addEventListener("touchstart",this._onTouchStart,!1),y.addEventListener("touchmove",this._onTouchMove,!1),y.addEventListener("touchend",this._onTouchEnd,!1),y.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},f.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}nx.prototype.addEventListener=function(o,f,m){this._topDiv.addEventListener(o,f,m)};nx.prototype.removeEventListener=function(o,f,m){this._topDiv.removeEventListener(o,f,m)};nx.prototype.isDestroyed=function(){return!1};nx.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let o=this.container.ownerDocument;o.removeEventListener("mouseup",this._onMouseUp,!1),o.removeEventListener("mousemove",this._onMouseMove,!1);let f=this._timeBarEle;f.removeEventListener("mousedown",this._onMouseDown,!1),f.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),f.removeEventListener("mousewheel",this._onMouseWheel,!1),f.removeEventListener("touchstart",this._onTouchStart,!1),f.removeEventListener("touchmove",this._onTouchMove,!1),f.removeEventListener("touchend",this._onTouchEnd,!1),f.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),kr(this)};nx.prototype.addHighlightRange=function(o,f,m){let v=new RIe(o,f,m);return this._highlightRanges.push(v),this.resize(),v};nx.prototype.addTrack=function(o,f,m,v){let y=new OIe(o,f,m,v);return this._trackList.push(y),this._lastHeight=void 0,this.resize(),y};nx.prototype.zoomTo=function(o,f){if(this._startJulian=o,this._endJulian=f,this._timeBarSecondsSpan=ci.secondsDifference(f,o),this._clock&&this._clock.clockRange!==L0.UNBOUNDED){let v=this._clock.startTime,y=this._clock.stopTime,x=ci.secondsDifference(y,v),C=ci.secondsDifference(v,this._startJulian),w=ci.secondsDifference(y,this._endJulian);this._timeBarSecondsSpan>=x?(this._timeBarSecondsSpan=x,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):C>0?(this._endJulian=ci.addSeconds(this._endJulian,C,new ci),this._startJulian=v,this._timeBarSecondsSpan=ci.secondsDifference(this._endJulian,this._startJulian)):w<0&&(this._startJulian=ci.addSeconds(this._startJulian,w,new ci),this._endJulian=y,this._timeBarSecondsSpan=ci.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let m=document.createEvent("Event");m.initEvent("setzoom",!0,!0),m.startJulian=this._startJulian,m.endJulian=this._endJulian,m.epochJulian=this._epochJulian,m.totalSpan=this._timeBarSecondsSpan,m.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(m)};nx.prototype.zoomFrom=function(o){let f=ci.secondsDifference(this._scrubJulian,this._startJulian);o>1||f<0||f>this._timeBarSecondsSpan?f=this._timeBarSecondsSpan*.5:f+=f-this._timeBarSecondsSpan*.5;let m=this._timeBarSecondsSpan-f;this.zoomTo(ci.addSeconds(this._startJulian,f-f*o,new ci),ci.addSeconds(this._endJulian,m*o-m,new ci))};nx.prototype.makeLabel=function(o){let f=new Date(o);return`${f.getFullYear()} ${f.getMonth()+1} ${f.getDate()-1} ${f.getHours()}:${f.getMinutes()}:${f.getSeconds()}`};nx.prototype.smallestTicInPixels=7;nx.prototype._makeTics=function(){let o=this._timeBarEle,f=ci.secondsDifference(this._scrubJulian,this._startJulian),m=Math.round(f*this._topDiv.clientWidth/this._timeBarSecondsSpan),v=m-8,y,x=this;this._needleEle.style.left=`${m.toString()}px`;let C="",w=.01,A=31536e6,E=1e-10,T=0,S=this._timeBarSecondsSpan;S<w?(S=w,this._timeBarSecondsSpan=w,this._endJulian=ci.addSeconds(this._startJulian,w,new ci)):S>A&&(S=A,this._timeBarSecondsSpan=A,this._endJulian=ci.addSeconds(this._startJulian,A,new ci));let M=this._timeBarEle.clientWidth;M<10&&(M=10);let I=this._startJulian,P=Math.min(S/M*1e-5,.4),D,L=ci.toGregorianDate(I);S>31536e4?D=ci.fromDate(new Date(Date.UTC(Math.floor(L.year/100)*100,0))):S>31536e3?D=ci.fromDate(new Date(Date.UTC(Math.floor(L.year/10)*10,0))):S>86400?D=ci.fromDate(new Date(Date.UTC(L.year,0))):D=ci.fromDate(new Date(Date.UTC(L.year,L.month,L.day)));let R=ci.secondsDifference(this._startJulian,ci.addSeconds(D,P,new ci)),O=R+S;this._epochJulian=D;function F(ae){return Math.floor(R/ae)*ae}function k(ae,fe){return Math.ceil(ae/fe+.5)*fe}function U(ae){return(ae-R)/S}function G(ae,fe){return ae-fe*Math.round(ae/fe)}this._rulerEle.innerHTML=this.makeLabel(ci.addSeconds(this._endJulian,-w,new ci));let j=this._rulerEle.offsetWidth+20;j<30&&(j=180);let q=T;T-=E;let J={startTime:R,startJulian:I,epochJulian:D,duration:S,timeBarWidth:M,getAlpha:U};this._highlightRanges.forEach(function(ae){C+=ae.render(J)});let X=0,Y=0,Q=0,ee=j/M;ee>1&&(ee=1),ee*=this._timeBarSecondsSpan;let z=-1,ie=-1,re=gR.length,ne;for(ne=0;ne<re;++ne){let ae=gR[ne];if(++z,X=ae,ae>ee&&ae>T)break;ie<0&&M*(ae/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(ie=z)}if(z>0){for(;z>0;)if(--z,Math.abs(G(X,gR[z]))<1e-5){gR[z]>=T&&(Y=gR[z]);break}if(ie>=0)for(;ie<z;){if(Math.abs(G(Y,gR[ie]))<1e-5&&gR[ie]>=T){Q=gR[ie];break}++ie}}T=q,T>E&&Q<1e-5&&Math.abs(T-X)>E&&(Q=T,T<=X+E&&(Y=0));let oe=-999999,se;if(M*(Q/this._timeBarSecondsSpan)>=3)for(y=F(Q);y<=O;y=k(y,Q))C+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(M*U(y)).toString()}px;"></span>`;if(M*(Y/this._timeBarSecondsSpan)>=3)for(y=F(Y);y<=O;y=k(y,Y))C+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(M*U(y)).toString()}px;"></span>`;if(M*(X/this._timeBarSecondsSpan)>=2){this._mainTicSpan=X,O+=X,y=F(X);let ae=ci.computeTaiMinusUtc(D);for(;y<=O;){let fe=ci.addSeconds(I,y-R,new ci);if(X>2.1){let ce=ci.computeTaiMinusUtc(fe);Math.abs(ce-ae)>.1&&(y+=ce-ae,fe=ci.addSeconds(I,y-R,new ci))}let de=Math.round(M*U(y)),ve=this.makeLabel(fe);this._rulerEle.innerHTML=ve,se=this._rulerEle.offsetWidth,se<10&&(se=j);let pe=de-(se/2-1);pe>oe?(oe=pe+se+5,C+=`<span class="cesium-timeline-ticMain" style="left: ${de.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${pe.toString()}px;">${ve}</span>`):C+=`<span class="cesium-timeline-ticSub" style="left: ${de.toString()}px;"></span>`,y=k(y,X)}}else this._mainTicSpan=-1;C+=`<span class="cesium-timeline-icon16" style="left:${v}px;bottom:0;background-position: 0 0;"></span>`,o.innerHTML=C,this._scrubElement=o.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),J.y=0,this._trackList.forEach(function(ae){ae.render(x._context,J),J.y+=ae.height})};nx.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let o=this._scrubElement;if(N(this._scrubElement)){let f=ci.secondsDifference(this._scrubJulian,this._startJulian),m=Math.round(f*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==m&&(this._lastXPos=m,o.style.left=`${m-8}px`,this._needleEle.style.left=`${m}px`)}N(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(ci.addSeconds(this._startJulian,this._timelineDrag,new ci),ci.addSeconds(this._endJulian,this._timelineDrag,new ci)))};nx.prototype._setTimeBarTime=function(o,f){if(o=Math.round(o),this._scrubJulian=ci.addSeconds(this._startJulian,f,new ci),this._scrubElement){let v=o-8;this._scrubElement.style.left=`${v.toString()}px`,this._needleEle.style.left=`${o.toString()}px`}let m=document.createEvent("Event");m.initEvent("settime",!0,!0),m.clientX=o,m.timeSeconds=f,m.timeJulian=this._scrubJulian,m.clock=this._clock,this._topDiv.dispatchEvent(m)};function xDi(o){return function(f){o._mouseMode!==Ew.touchOnly&&(f.button===0?(o._mouseMode=Ew.scrub,o._scrubElement&&(o._scrubElement.style.backgroundPosition="-16px 0"),o._onMouseMove(f)):(o._mouseX=f.clientX,f.button===2?o._mouseMode=Ew.zoom:o._mouseMode=Ew.slide)),f.preventDefault()}}function CDi(o){return function(f){o._mouseMode=Ew.none,o._scrubElement&&(o._scrubElement.style.backgroundPosition="0 0"),o._timelineDrag=0,o._timelineDragLocation=void 0}}function bDi(o){return function(f){let m;if(o._mouseMode===Ew.scrub){f.preventDefault();let v=f.clientX-o._topDiv.getBoundingClientRect().left;v<0?(o._timelineDragLocation=0,o._timelineDrag=-.01*o._timeBarSecondsSpan):v>o._topDiv.clientWidth?(o._timelineDragLocation=o._topDiv.clientWidth,o._timelineDrag=.01*o._timeBarSecondsSpan):(o._timelineDragLocation=void 0,o._setTimeBarTime(v,v*o._timeBarSecondsSpan/o._topDiv.clientWidth))}else if(o._mouseMode===Ew.slide){if(m=o._mouseX-f.clientX,o._mouseX=f.clientX,m!==0){let v=m*o._timeBarSecondsSpan/o._topDiv.clientWidth;o.zoomTo(ci.addSeconds(o._startJulian,v,new ci),ci.addSeconds(o._endJulian,v,new ci))}}else o._mouseMode===Ew.zoom&&(m=o._mouseX-f.clientX,o._mouseX=f.clientX,m!==0&&o.zoomFrom(Math.pow(1.01,m)))}}function wDi(o){return function(f){let m=f.wheelDeltaY||f.wheelDelta||-f.detail;jpe=Math.max(Math.min(Math.abs(m),jpe),1),m/=jpe,o.zoomFrom(Math.pow(1.05,-m))}}function ADi(o){return function(f){let m=f.touches.length,v,y,x=o._topDiv.getBoundingClientRect().left;f.preventDefault(),o._mouseMode=Ew.touchOnly,m===1?(v=ci.secondsDifference(o._scrubJulian,o._startJulian),y=Math.round(v*o._topDiv.clientWidth/o._timeBarSecondsSpan+x),Math.abs(f.touches[0].clientX-y)<50?(o._touchMode=Ny.scrub,o._scrubElement&&(o._scrubElement.style.backgroundPosition=m===1?"-16px 0":"0 0")):(o._touchMode=Ny.singleTap,o._touchState.centerX=f.touches[0].clientX-x)):m===2?(o._touchMode=Ny.slideZoom,o._touchState.centerX=(f.touches[0].clientX+f.touches[1].clientX)*.5-x,o._touchState.spanX=Math.abs(f.touches[0].clientX-f.touches[1].clientX)):o._touchMode=Ny.ignore}}function EDi(o){return function(f){let m=f.touches.length,v=o._topDiv.getBoundingClientRect().left;o._touchMode===Ny.singleTap?(o._touchMode=Ny.scrub,o._onTouchMove(f)):o._touchMode===Ny.scrub&&o._onTouchMove(f),o._mouseMode=Ew.touchOnly,m!==1?o._touchMode=m>0?Ny.ignore:Ny.none:o._touchMode===Ny.slideZoom&&(o._touchState.centerX=f.touches[0].clientX-v),o._scrubElement&&(o._scrubElement.style.backgroundPosition="0 0")}}function TDi(o){return function(f){let m,v,y,x,C,w,A=1,E=o._topDiv.getBoundingClientRect().left;o._touchMode===Ny.singleTap&&(o._touchMode=Ny.slideZoom),o._mouseMode=Ew.touchOnly,o._touchMode===Ny.scrub?(f.preventDefault(),f.changedTouches.length===1&&(v=f.changedTouches[0].clientX-E,v>=0&&v<=o._topDiv.clientWidth&&o._setTimeBarTime(v,v*o._timeBarSecondsSpan/o._topDiv.clientWidth))):o._touchMode===Ny.slideZoom&&(y=f.touches.length,y===2?(x=(f.touches[0].clientX+f.touches[1].clientX)*.5-E,C=Math.abs(f.touches[0].clientX-f.touches[1].clientX)):y===1&&(x=f.touches[0].clientX-E,C=0),N(x)&&(C>0&&o._touchState.spanX>0?(A=o._touchState.spanX/C,w=ci.addSeconds(o._startJulian,(o._touchState.centerX*o._timeBarSecondsSpan-x*o._timeBarSecondsSpan*A)/o._topDiv.clientWidth,new ci)):(m=o._touchState.centerX-x,w=ci.addSeconds(o._startJulian,m*o._timeBarSecondsSpan/o._topDiv.clientWidth,new ci)),o.zoomTo(w,ci.addSeconds(w,o._timeBarSecondsSpan*A,new ci)),o._touchState.centerX=x,o._touchState.spanX=C))}}nx.prototype.resize=function(){let o=this.container.clientWidth,f=this.container.clientHeight;if(o===this._lastWidth&&f===this._lastHeight)return;this._trackContainer.style.height=`${f}px`;let m=1;this._trackList.forEach(function(v){m+=v.height}),this._trackListEle.style.height=`${m.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=m,this._makeTics(),this._lastXPos=void 0,this._lastWidth=o,this._lastHeight=f};var NIe=nx;function vat(o){let f=o.split(` `),m;for(m=0;m<f.length&&!f[m].match(/\S/);m++);if(m===f.length)return"";let v="",y=/^\s*/,x=f[m].match(y)[0].length;for(let C=m;C<f.length;C++){let w=f[C];w.match(y)[0].length>=x&&(w=w.slice(x)),v+=`${w} `}return v}function lA(o){this._scene=o,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let f=this;function m(y){let{name:x,initialValue:C}=y;f._definedProperties.push(x);let w=y.setPrimitiveFunction;w===!0&&(w=function(T){f._voxelPrimitive[x]=T});let A=y.getPrimitiveFunction;A===!0&&(A=function(){f[x]=f._voxelPrimitive[x]}),N(A)&&f._getPrimitiveFunctions.push(A);let E=br.observable();return br.defineProperty(f,x,{get:function(){return E()},set:function(T){typeof C=="number"&&typeof T=="string"&&(T=Number(T),isNaN(T)&&(T=C)),typeof C=="boolean"&&typeof T=="number"&&(T=T===1),E(T),N(w)&&N(f._voxelPrimitive)&&(w(T),o.requestRender())}}),f[x]=C,E}function v(y,x){return function(C){let w=f._voxelPrimitive[y].clone();w[x]=C,f._voxelPrimitive[y]=w}}m({name:"inspectorVisible",initialValue:!0}),m({name:"displayVisible",initialValue:!1}),m({name:"transformVisible",initialValue:!1}),m({name:"boundsVisible",initialValue:!1}),m({name:"clippingVisible",initialValue:!1}),m({name:"shaderVisible",initialValue:!1}),m({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let y=f._voxelPrimitive.customShader.fragmentShaderText;f.shaderString=vat(y)}}),m({name:"shaderCompilationMessage",initialValue:""}),m({name:"shaderCompilationSuccess",initialValue:!0}),m({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),m({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),m({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),m({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),m({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),m({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),m({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),m({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),m({name:"shapeIsBox",getPrimitiveFunction:function(){let y=f._voxelPrimitive.shape;f.shapeIsBox=y===Rh.BOX}}),m({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let y=f._voxelPrimitive.shape;f.shapeIsEllipsoid=y===Rh.ELLIPSOID}}),m({name:"shapeIsCylinder",getPrimitiveFunction:function(){let y=f._voxelPrimitive.shape;f.shapeIsCylinder=y===Rh.CYLINDER}}),m({name:"boundsBoxMaxX",initialValue:0,setPrimitiveFunction:v("maxBounds","x"),getPrimitiveFunction:function(){f.boundsBoxMaxX=f._voxelPrimitive.maxBounds.x}}),m({name:"boundsBoxMinX",initialValue:0,setPrimitiveFunction:v("minBounds","x"),getPrimitiveFunction:function(){f.boundsBoxMinX=f._voxelPrimitive.minBounds.x}}),m({name:"boundsBoxMaxY",initialValue:0,setPrimitiveFunction:v("maxBounds","y"),getPrimitiveFunction:function(){f.boundsBoxMaxY=f._voxelPrimitive.maxBounds.y}}),m({name:"boundsBoxMinY",initialValue:0,setPrimitiveFunction:v("minBounds","y"),getPrimitiveFunction:function(){f.boundsBoxMinY=f._voxelPrimitive.minBounds.y}}),m({name:"boundsBoxMaxZ",initialValue:0,setPrimitiveFunction:v("maxBounds","z"),getPrimitiveFunction:function(){f.boundsBoxMaxZ=f._voxelPrimitive.maxBounds.z}}),m({name:"boundsBoxMinZ",initialValue:0,setPrimitiveFunction:v("minBounds","z"),getPrimitiveFunction:function(){f.boundsBoxMinZ=f._voxelPrimitive.minBounds.z}}),m({name:"boundsEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:v("maxBounds","x"),getPrimitiveFunction:function(){f.boundsEllipsoidMaxLongitude=f._voxelPrimitive.maxBounds.x}}),m({name:"boundsEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:v("minBounds","x"),getPrimitiveFunction:function(){f.boundsEllipsoidMinLongitude=f._voxelPrimitive.minBounds.x}}),m({name:"boundsEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:v("maxBounds","y"),getPrimitiveFunction:function(){f.boundsEllipsoidMaxLatitude=f._voxelPrimitive.maxBounds.y}}),m({name:"boundsEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:v("minBounds","y"),getPrimitiveFunction:function(){f.boundsEllipsoidMinLatitude=f._voxelPrimitive.minBounds.y}}),m({name:"boundsEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:v("maxBounds","z"),getPrimitiveFunction:function(){f.boundsEllipsoidMaxHeight=f._voxelPrimitive.maxBounds.z}}),m({name:"boundsEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:v("minBounds","z"),getPrimitiveFunction:function(){f.boundsEllipsoidMinHeight=f._voxelPrimitive.minBounds.z}}),m({name:"boundsCylinderMaxRadius",initialValue:0,setPrimitiveFunction:v("maxBounds","x"),getPrimitiveFunction:function(){f.boundsCylinderMaxRadius=f._voxelPrimitive.maxBounds.x}}),m({name:"boundsCylinderMinRadius",initialValue:0,setPrimitiveFunction:v("minBounds","x"),getPrimitiveFunction:function(){f.boundsCylinderMinRadius=f._voxelPrimitive.minBounds.x}}),m({name:"boundsCylinderMaxHeight",initialValue:0,setPrimitiveFunction:v("maxBounds","y"),getPrimitiveFunction:function(){f.boundsCylinderMaxHeight=f._voxelPrimitive.maxBounds.y}}),m({name:"boundsCylinderMinHeight",initialValue:0,setPrimitiveFunction:v("minBounds","y"),getPrimitiveFunction:function(){f.boundsCylinderMinHeight=f._voxelPrimitive.minBounds.y}}),m({name:"boundsCylinderMaxAngle",initialValue:0,setPrimitiveFunction:v("maxBounds","z"),getPrimitiveFunction:function(){f.boundsCylinderMaxAngle=f._voxelPrimitive.maxBounds.z}}),m({name:"boundsCylinderMinAngle",initialValue:0,setPrimitiveFunction:v("minBounds","z"),getPrimitiveFunction:function(){f.boundsCylinderMinAngle=f._voxelPrimitive.minBounds.z}}),m({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","x"),getPrimitiveFunction:function(){f.clippingBoxMaxX=f._voxelPrimitive.maxClippingBounds.x}}),m({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:v("minClippingBounds","x"),getPrimitiveFunction:function(){f.clippingBoxMinX=f._voxelPrimitive.minClippingBounds.x}}),m({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","y"),getPrimitiveFunction:function(){f.clippingBoxMaxY=f._voxelPrimitive.maxClippingBounds.y}}),m({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:v("minClippingBounds","y"),getPrimitiveFunction:function(){f.clippingBoxMinY=f._voxelPrimitive.minClippingBounds.y}}),m({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","z"),getPrimitiveFunction:function(){f.clippingBoxMaxZ=f._voxelPrimitive.maxClippingBounds.z}}),m({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:v("minClippingBounds","z"),getPrimitiveFunction:function(){f.clippingBoxMinZ=f._voxelPrimitive.minClippingBounds.z}}),m({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","x"),getPrimitiveFunction:function(){f.clippingEllipsoidMaxLongitude=f._voxelPrimitive.maxClippingBounds.x}}),m({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:v("minClippingBounds","x"),getPrimitiveFunction:function(){f.clippingEllipsoidMinLongitude=f._voxelPrimitive.minClippingBounds.x}}),m({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","y"),getPrimitiveFunction:function(){f.clippingEllipsoidMaxLatitude=f._voxelPrimitive.maxClippingBounds.y}}),m({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:v("minClippingBounds","y"),getPrimitiveFunction:function(){f.clippingEllipsoidMinLatitude=f._voxelPrimitive.minClippingBounds.y}}),m({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","z"),getPrimitiveFunction:function(){f.clippingEllipsoidMaxHeight=f._voxelPrimitive.maxClippingBounds.z}}),m({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:v("minClippingBounds","z"),getPrimitiveFunction:function(){f.clippingEllipsoidMinHeight=f._voxelPrimitive.minClippingBounds.z}}),m({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","x"),getPrimitiveFunction:function(){f.clippingCylinderMaxRadius=f._voxelPrimitive.maxClippingBounds.x}}),m({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:v("minClippingBounds","x"),getPrimitiveFunction:function(){f.clippingCylinderMinRadius=f._voxelPrimitive.minClippingBounds.x}}),m({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","y"),getPrimitiveFunction:function(){f.clippingCylinderMaxHeight=f._voxelPrimitive.maxClippingBounds.y}}),m({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:v("minClippingBounds","y"),getPrimitiveFunction:function(){f.clippingCylinderMinHeight=f._voxelPrimitive.minClippingBounds.y}}),m({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:v("maxClippingBounds","z"),getPrimitiveFunction:function(){f.clippingCylinderMaxAngle=f._voxelPrimitive.maxClippingBounds.z}}),m({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:v("minClippingBounds","z"),getPrimitiveFunction:function(){f.clippingCylinderMinAngle=f._voxelPrimitive.minClippingBounds.z}}),m({name:"translationX",initialValue:0,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)},getPrimitiveFunction:function(){f.translationX=Ee.getTranslation(f._voxelPrimitive.modelMatrix,new H).x}}),m({name:"translationY",initialValue:0,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)},getPrimitiveFunction:function(){f.translationY=Ee.getTranslation(f._voxelPrimitive.modelMatrix,new H).y}}),m({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)},getPrimitiveFunction:function(){f.translationZ=Ee.getTranslation(f._voxelPrimitive.modelMatrix,new H).z}}),m({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)},getPrimitiveFunction:function(){f.scaleX=Ee.getScale(f._voxelPrimitive.modelMatrix,new H).x}}),m({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)},getPrimitiveFunction:function(){f.scaleY=Ee.getScale(f._voxelPrimitive.modelMatrix,new H).y}}),m({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)},getPrimitiveFunction:function(){f.scaleZ=Ee.getScale(f._voxelPrimitive.modelMatrix,new H).z}}),m({name:"angleX",initialValue:0,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)}}),m({name:"angleY",initialValue:0,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)}}),m({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){f._modelMatrixReady&&YS(f)}})}var SDi=new H,PDi=new H,IDi=new dl,MDi=new Ut;function YS(o){let f=H.fromElements(o.translationX,o.translationY,o.translationZ,SDi),m=H.fromElements(o.scaleX,o.scaleY,o.scaleZ,PDi),v=IDi;v.heading=o.angleX,v.pitch=o.angleY,v.roll=o.angleZ;let y=Ut.fromHeadingPitchRoll(v,MDi),x=Ut.multiplyByScale(y,m,y);o._voxelPrimitive.modelMatrix=Ee.fromRotationTranslation(x,f,o._voxelPrimitive.modelMatrix)}Object.defineProperties(lA.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(o){if(N(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),N(o)){this._voxelPrimitive=o;let f=this;f._voxelPrimitive._readyPromise.then(function(){f._customShaderCompilationRemoveCallback=f._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(m){let v=f._voxelPrimitive.customShader.fragmentShaderText;f.shaderString=vat(v),N(m)?(f.shaderCompilationMessage=m.message,f.shaderCompilationSuccess=!1):(f.shaderCompilationMessage="Shader compiled successfully!",f.shaderCompilationSuccess=!0)}),f._modelMatrixReady=!1;for(let m=0;m<f._getPrimitiveFunctions.length;m++)f._getPrimitiveFunctions[m]();f._modelMatrixReady=!0,YS(f)})}}}});lA.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};lA.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};lA.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};lA.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};lA.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};lA.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};lA.prototype.compileShader=function(){N(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new Kw({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};lA.prototype.shaderEditorKeyPress=function(o,f){if(f.keyCode===9){f.preventDefault();let m=f.target,v=m.selectionStart,y=m.selectionEnd,x=y,C=m.value.slice(v,y).split(` `),w=C.length,A;if(f.shiftKey)for(A=0;A<w;++A)C[A][0]===" "&&(C[A][1]===" "?(C[A]=C[A].substr(2),x-=2):(C[A]=C[A].substr(1),x-=1));else for(A=0;A<w;++A)C[A]=` ${C[A]}`,x+=2;let E=C.join(` `);m.value=m.value.slice(0,v)+E+m.value.slice(y),m.selectionStart=v!==y?v:x,m.selectionEnd=x}else f.ctrlKey&&(f.keyCode===10||f.keyCode===13)&&this.compileShader();return!0};lA.prototype.isDestroyed=function(){return!1};lA.prototype.destroy=function(){let o=this;return this._definedProperties.forEach(function(f){br.getObservable(o,f).dispose()}),kr(this)};var FIe=lA;function Vae(o,f){o=Uh(o);let m=document.createElement("div"),v=new FIe(f);this._viewModel=v,this._container=o,this._element=m;let y=document.createElement("div");y.textContent="Voxel Inspector",y.className="cesium-cesiumInspector-button",y.setAttribute("data-bind","click: toggleInspector"),m.appendChild(y),m.className="cesium-cesiumInspector cesium-VoxelInspector",m.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),o.appendChild(m);let x=document.createElement("div");x.className="cesium-cesiumInspector-dropDown",m.appendChild(x);let C=k1.createSection,w=k1.createCheckbox,A=k1.createRangeInput,E=k1.createButton,T=C(x,"Display","displayVisible","toggleDisplay"),S=C(x,"Transform","transformVisible","toggleTransform"),M=C(x,"Bounds","boundsVisible","toggleBounds"),I=C(x,"Clipping","clippingVisible","toggleClipping"),P=C(x,"Shader","shaderVisible","toggleShader");T.appendChild(w("Depth Test","depthTest")),T.appendChild(w("Show","show")),T.appendChild(w("Disable Update","disableUpdate")),T.appendChild(w("Debug Draw","debugDraw")),T.appendChild(w("Jitter","jitter")),T.appendChild(w("Nearest Sampling","nearestSampling")),T.appendChild(A("Screen Space Error","screenSpaceError",0,128)),T.appendChild(A("Step Size","stepSize",0,2));let D=10,L=10,R=xe.PI;S.appendChild(A("Translation X","translationX",-D,+D)),S.appendChild(A("Translation Y","translationY",-D,+D)),S.appendChild(A("Translation Z","translationZ",-D,+D)),S.appendChild(A("Scale X","scaleX",0,+L)),S.appendChild(A("Scale Y","scaleY",0,+L)),S.appendChild(A("Scale Z","scaleZ",0,+L)),S.appendChild(A("Heading","angleX",-R,+R)),S.appendChild(A("Pitch","angleY",-R,+R)),S.appendChild(A("Roll","angleZ",-R,+R));let O=Rh.getMinBounds(Rh.BOX),F=Rh.getMaxBounds(Rh.BOX),k=H.fromElements(Rh.getMinBounds(Rh.ELLIPSOID).x,Rh.getMinBounds(Rh.ELLIPSOID).y,-ki.WGS84.maximumRadius,new H),U=H.fromElements(Rh.getMaxBounds(Rh.ELLIPSOID).x,Rh.getMaxBounds(Rh.ELLIPSOID).y,1e7,new H),G=Rh.getMinBounds(Rh.CYLINDER),j=Rh.getMaxBounds(Rh.CYLINDER);ez("Max X","Min X","Max Y","Min Y","Max Z","Min Z","boundsBoxMaxX","boundsBoxMinX","boundsBoxMaxY","boundsBoxMinY","boundsBoxMaxZ","boundsBoxMinZ",O,F,"shapeIsBox",M),ez("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","boundsEllipsoidMaxLongitude","boundsEllipsoidMinLongitude","boundsEllipsoidMaxLatitude","boundsEllipsoidMinLatitude","boundsEllipsoidMaxHeight","boundsEllipsoidMinHeight",k,U,"shapeIsEllipsoid",M),ez("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","boundsCylinderMaxRadius","boundsCylinderMinRadius","boundsCylinderMaxHeight","boundsCylinderMinHeight","boundsCylinderMaxAngle","boundsCylinderMinAngle",G,j,"shapeIsCylinder",M),ez("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ",O,F,"shapeIsBox",I),ez("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight",k,U,"shapeIsEllipsoid",I),ez("Max Radius","Min Radius","Max Height","Min Height","Max Angle","Min Angle","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxHeight","clippingCylinderMinHeight","clippingCylinderMaxAngle","clippingCylinderMinAngle",G,j,"shapeIsCylinder",I);let q=document.createElement("div");P.appendChild(q);let J=document.createElement("textarea");J.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),q.className="cesium-cesiumInspector-styleEditor",q.appendChild(J);let X=E("Compile (Ctrl+Enter)","compileShader");q.appendChild(X);let Y=document.createElement("label");Y.style.display="block",Y.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),q.appendChild(Y),br.applyBindings(v,m)}Object.defineProperties(Vae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Vae.prototype.isDestroyed=function(){return!1};Vae.prototype.destroy=function(){return br.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),kr(this)};function ez(o,f,m,v,y,x,C,w,A,E,T,S,M,I,P,D){let L=k1.createRangeInput,R=M,O=I,F=D.appendChild(document.createElement("div"));F.setAttribute("data-bind",`if: ${P}`),F.appendChild(L(o,C,R.x,O.x)),F.appendChild(L(f,w,R.x,O.x)),F.appendChild(L(m,A,R.y,O.y)),F.appendChild(L(v,E,R.y,O.y)),F.appendChild(L(y,T,R.z,O.z)),F.appendChild(L(x,S,R.z,O.z))}var BIe=Vae,DDi=dd(K1t(),1);function LDi(o){let f=!1,m=window.screen;return N(m)&&(N(m.lockOrientation)?f=m.lockOrientation(o):N(m.mozLockOrientation)?f=m.mozLockOrientation(o):N(m.msLockOrientation)?f=m.msLockOrientation(o):N(m.orientation&&m.orientation.lock)&&(f=m.orientation.lock(o))),f}function yat(){let o=window.screen;N(o)&&(N(o.unlockOrientation)?o.unlockOrientation():N(o.mozUnlockOrientation)?o.mozUnlockOrientation():N(o.msUnlockOrientation)?o.msUnlockOrientation():N(o.orientation&&o.orientation.unlock)&&o.orientation.unlock())}function RDi(o,f,m,v){v()||(m()?(f.useWebVR=!1,o._locked&&(yat(),o._locked=!1),o._noSleep.disable(),ng.exitFullscreen(),m(!1)):(ng.fullscreen||ng.requestFullscreen(o._vrElement),o._noSleep.enable(),o._locked||(o._locked=LDi("landscape")),f.useWebVR=!0,m(!0)))}function zae(o,f){let m=this,v=br.observable(ng.enabled),y=br.observable(!1);this.isVRMode=void 0,br.defineProperty(this,"isVRMode",{get:function(){return y()}}),this.isVREnabled=void 0,br.defineProperty(this,"isVREnabled",{get:function(){return v()},set:function(C){v(C&&ng.enabled)}}),this.tooltip=void 0,br.defineProperty(this,"tooltip",function(){return v()?y()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let x=br.observable(!1);this._isOrthographic=void 0,br.defineProperty(this,"_isOrthographic",{get:function(){return x()}}),this._eventHelper=new AC,this._eventHelper.add(o.preRender,function(){x(o.camera.frustum instanceof Gs)}),this._locked=!1,this._noSleep=new DDi.default,this._command=Fl(function(){RDi(m,o,y,x)},br.getObservable(this,"isVREnabled")),this._vrElement=Z(Uh(f),document.body),this._callback=function(){!ng.fullscreen&&y()&&(o.useWebVR=!1,m._locked&&(yat(),m._locked=!1),m._noSleep.disable(),y(!1))},document.addEventListener(ng.changeEventName,this._callback)}Object.defineProperties(zae.prototype,{vrElement:{get:function(){return this._vrElement},set:function(o){this._vrElement=o}},command:{get:function(){return this._command}}});zae.prototype.isDestroyed=function(){return!1};zae.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(ng.changeEventName,this._callback),kr(this)};var kIe=zae,ODi="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",NDi="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function Hae(o,f,m){o=Uh(o);let v=new kIe(f,m);v._exitVRPath=NDi,v._enterVRPath=ODi;let y=document.createElement("button");y.type="button",y.className="cesium-button cesium-vrButton",y.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),o.appendChild(y),br.applyBindings(v,y),this._container=o,this._viewModel=v,this._element=y}Object.defineProperties(Hae.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Hae.prototype.isDestroyed=function(){return!1};Hae.prototype.destroy=function(){return this._viewModel.destroy(),br.cleanNode(this._element),this._container.removeChild(this._element),kr(this)};var VIe=Hae,XR=new Pi;function xat(o){let f=o.clock;f.currentTime=o.timeJulian,f.shouldAnimate=!1}function FDi(o){let f=o.getPropertyIds(),m="";return f.forEach(function(v){let y=o.getProperty(v);N(y)&&(m+=`<tr><th>${v}</th><td>${y}</td></tr>`)}),m.length>0&&(m=`<table class="cesium-infoBox-defaultTable"><tbody>${m}</tbody></table>`),m}function BDi(o){let f,m=[],v=o.getPropertyIds();for(f=0;f<v.length;f++){let x=v[f];/^name$/i.test(x)?m[0]=o.getProperty(x):/name/i.test(x)?m[1]=o.getProperty(x):/^title$/i.test(x)?m[2]=o.getProperty(x):/^(id|identifier)$/i.test(x)?m[3]=o.getProperty(x):/element/i.test(x)?m[4]=o.getProperty(x):/(id|identifier)$/i.test(x)&&(m[5]=o.getProperty(x))}let y=m.length;for(f=0;f<y;f++){let x=m[f];if(N(x)&&x!=="")return x}return"Unnamed Feature"}function v8e(o,f){let m=o.scene.pick(f.position);if(N(m)){let v=Z(m.id,m.primitive.id);if(v instanceof Wh)return v;if(m instanceof Qs)return new Wh({name:BDi(m),description:FDi(m),feature:m})}if(N(o.scene.globe))return zDi(o,f.position)}var kDi=new ci;function Cat(o,f,m){if(N(m)){let v=m.clock;if(N(v)&&(v.getValue(f),N(o))){let y=v.startTime,x=v.stopTime;ci.equals(y,x)&&(x=ci.addSeconds(y,xe.EPSILON2,kDi)),o.updateFromClock(),o.zoomTo(y,x)}}}var VDi=new H;function zDi(o,f){let m=o.scene,v=m.camera.getPickRay(f),y=m.imageryLayers.pickImageryLayerFeatures(v,m);if(!N(y))return;let x=new Wh({id:"Loading...",description:"Loading feature information..."});return y.then(function(C){if(o.selectedEntity!==x)return;if(!N(C)||C.length===0){o.selectedEntity=y8e();return}let w=C[0],A=new Wh({id:w.name,description:w.description});if(N(w.position)){let E=o.scene.globe.ellipsoid.cartographicToCartesian(w.position,VDi);A.position=new c2(E)}o.selectedEntity=A},function(){o.selectedEntity===x&&(o.selectedEntity=y8e())}),x}function y8e(){return new Wh({id:"None",description:"No features found."})}function HDi(o,f){let m=o._geocoder,v=o._homeButton,y=o._sceneModePicker,x=o._projectionPicker,C=o._baseLayerPicker,w=o._animation,A=o._timeline,E=o._fullscreenButton,T=o._infoBox,S=o._selectionIndicator,M=f?"hidden":"visible";if(N(m)&&(m.container.style.visibility=M),N(v)&&(v.container.style.visibility=M),N(y)&&(y.container.style.visibility=M),N(x)&&(x.container.style.visibility=M),N(C)&&(C.container.style.visibility=M),N(w)&&(w.container.style.visibility=M),N(A)&&(A.container.style.visibility=M),N(E)&&E.viewModel.isFullscreenEnabled&&(E.container.style.visibility=M),N(T)&&(T.container.style.visibility=M),N(S)&&(S.container.style.visibility=M),o._container){let I=f||!N(E)?0:E.container.clientWidth;o._vrButton.container.style.right=`${I}px`,o.forceResize()}}function ac(o,f){o=Uh(o),f=Z(f,Z.EMPTY_OBJECT);let m=(!N(f.globe)||f.globe!==!1)&&(!N(f.baseLayerPicker)||f.baseLayerPicker!==!1),v=this,y=document.createElement("div");y.className="cesium-viewer",o.appendChild(y);let x=document.createElement("div");x.className="cesium-viewer-cesiumWidgetContainer",y.appendChild(x);let C=document.createElement("div");C.className="cesium-viewer-bottom",y.appendChild(C);let w=Z(f.scene3DOnly,!1),A,E,T=!1;N(f.clockViewModel)?(E=f.clockViewModel,A=E.clock):(A=new MU,E=new eIe(A),T=!0),N(f.shouldAnimate)&&(A.shouldAnimate=f.shouldAnimate);let S=new Xq(x,{baseLayer:m||N(f.baseLayer)||N(f.imageryProvider)?!1:void 0,clock:A,skyBox:f.skyBox,skyAtmosphere:f.skyAtmosphere,sceneMode:f.sceneMode,mapProjection:f.mapProjection,globe:f.globe,orderIndependentTranslucency:f.orderIndependentTranslucency,contextOptions:f.contextOptions,useDefaultRenderLoop:f.useDefaultRenderLoop,targetFrameRate:f.targetFrameRate,showRenderLoopErrors:f.showRenderLoopErrors,useBrowserRecommendedResolution:f.useBrowserRecommendedResolution,creditContainer:N(f.creditContainer)?f.creditContainer:C,creditViewport:f.creditViewport,scene3DOnly:w,shadows:f.shadows,terrainShadows:f.terrainShadows,mapMode2D:f.mapMode2D,blurActiveElementOnCanvasFocus:f.blurActiveElementOnCanvasFocus,requestRenderMode:f.requestRenderMode,maximumRenderTimeChange:f.maximumRenderTimeChange,depthPlaneEllipsoidOffset:f.depthPlaneEllipsoidOffset,msaaSamples:f.msaaSamples}),M=f.dataSources,I=!1;N(M)||(M=new EEe,I=!0);let P=S.scene,D=new Sq({scene:P,dataSourceCollection:M}),L=new AC;L.add(A.onTick,ac.prototype._onTick,this),L.add(P.morphStart,ac.prototype._clearTrackedObject,this);let R;if(!N(f.selectionIndicator)||f.selectionIndicator!==!1){let de=document.createElement("div");de.className="cesium-viewer-selectionIndicatorContainer",y.appendChild(de),R=new MIe(de,P)}let O;if(!N(f.infoBox)||f.infoBox!==!1){let de=document.createElement("div");de.className="cesium-viewer-infoBoxContainer",y.appendChild(de),O=new CIe(de);let ve=O.viewModel;L.add(ve.cameraClicked,ac.prototype._onInfoBoxCameraClicked,this),L.add(ve.closeClicked,ac.prototype._onInfoBoxClockClicked,this)}let F=document.createElement("div");F.className="cesium-viewer-toolbar",y.appendChild(F);let k;if(!N(f.geocoder)||f.geocoder!==!1){let de=document.createElement("div");de.className="cesium-viewer-geocoderContainer",F.appendChild(de);let ve;N(f.geocoder)&&typeof f.geocoder!="boolean"&&(ve=Array.isArray(f.geocoder)?f.geocoder:[f.geocoder]),k=new gIe({container:de,geocoderServices:ve,scene:P}),L.add(k.viewModel.search.beforeExecute,ac.prototype._clearObjects,this)}let U;(!N(f.homeButton)||f.homeButton!==!1)&&(U=new vIe(F,P),N(k)&&L.add(U.viewModel.command.afterExecute,function(){let de=k.viewModel;de.searchText="",de.isSearchInProgress&&de.search()}),L.add(U.viewModel.command.beforeExecute,ac.prototype._clearTrackedObject,this));let G;!w&&(!N(f.sceneModePicker)||f.sceneModePicker!==!1)&&(G=new PIe(F,P));let j;f.projectionPicker&&(j=new LIe(F,P));let q,J;if(m){let de=Z(f.imageryProviderViewModels,sIe()),ve=Z(f.terrainProviderViewModels,lIe());q=new aIe(F,{globe:P.globe,imageryProviderViewModels:de,selectedImageryProviderViewModel:f.selectedImageryProviderViewModel,terrainProviderViewModels:ve,selectedTerrainProviderViewModel:f.selectedTerrainProviderViewModel}),J=F.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}N(f.imageryProvider)&&f.imageryProvider!==!1&&(mi("Viewer options.imageryProvider","options.imageryProvider was deprecated in CesiumJS 1.104. It will be in CesiumJS 1.107. Use options.baseLayer instead."),m&&(q.viewModel.selectedImagery=void 0),P.imageryLayers.removeAll(),P.imageryLayers.addImageryProvider(f.imageryProvider)),N(f.baseLayer)&&f.baseLayer!==!1&&(m&&(q.viewModel.selectedImagery=void 0),P.imageryLayers.removeAll(),P.imageryLayers.add(f.baseLayer)),N(f.terrainProvider)&&(m&&(q.viewModel.selectedTerrain=void 0),P.terrainProvider=f.terrainProvider),N(f.terrain)&&(m&&(q.viewModel.selectedTerrain=void 0,P.globe.depthTestAgainstTerrain=!0),P.setTerrain(f.terrain));let X;if(!N(f.navigationHelpButton)||f.navigationHelpButton!==!1){let de=!0;try{if(N(window.localStorage)){let ve=window.localStorage.getItem("cesium-hasSeenNavHelp");N(ve)&&ve?de=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}X=new wIe({container:F,instructionsInitiallyVisible:Z(f.navigationInstructionsInitiallyVisible,de)})}let Y;if(!N(f.animation)||f.animation!==!1){let de=document.createElement("div");de.className="cesium-viewer-animationContainer",y.appendChild(de),Y=new tIe(de,new iIe(E))}let Q;if(!N(f.timeline)||f.timeline!==!1){let de=document.createElement("div");de.className="cesium-viewer-timelineContainer",y.appendChild(de),Q=new NIe(de,A),Q.addEventListener("settime",xat,!1),Q.zoomTo(A.startTime,A.stopTime)}let ee,z,ie;(!N(f.fullscreenButton)||f.fullscreenButton!==!1)&&(ie=document.createElement("div"),ie.className="cesium-viewer-fullscreenContainer",y.appendChild(ie),ee=new dIe(ie,f.fullscreenElement),z=oC(ee.viewModel,"isFullscreenEnabled",function(de){ie.style.display=de?"block":"none",N(Q)&&(Q.container.style.right=`${ie.clientWidth}px`,Q.resize())}));let re,ne,oe;if(f.vrButton){let de=document.createElement("div");de.className="cesium-viewer-vrContainer",y.appendChild(de),re=new VIe(de,P,f.fullScreenElement),ne=oC(re.viewModel,"isVREnabled",function(ve){de.style.display=ve?"block":"none",N(ee)&&(de.style.right=`${ie.clientWidth}px`),N(Q)&&(Q.container.style.right=`${de.clientWidth}px`,Q.resize())}),oe=oC(re.viewModel,"isVRMode",function(ve){HDi(v,ve)})}this._baseLayerPickerDropDown=J,this._fullscreenSubscription=z,this._vrSubscription=ne,this._vrModeSubscription=oe,this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=Z(f.automaticallyTrackDataSourceClocks,!0),this._container=o,this._bottomContainer=C,this._element=y,this._cesiumWidget=S,this._selectionIndicator=R,this._infoBox=O,this._dataSourceCollection=M,this._destroyDataSourceCollection=I,this._dataSourceDisplay=D,this._clockViewModel=E,this._destroyClockViewModel=T,this._toolbar=F,this._homeButton=U,this._sceneModePicker=G,this._projectionPicker=j,this._baseLayerPicker=q,this._navigationHelpButton=X,this._animation=Y,this._timeline=Q,this._fullscreenButton=ee,this._vrButton=re,this._geocoder=k,this._eventHelper=L,this._lastWidth=0,this._lastHeight=0,this._allowDataSourcesToSuspendAnimation=!0,this._entityView=void 0,this._enableInfoOrSelection=N(O)||N(R),this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._selectedEntity=void 0,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._selectedEntityChanged=new Br,this._trackedEntityChanged=new Br,br.track(this,["_trackedEntity","_selectedEntity","_clockTrackedDataSource"]),L.add(M.dataSourceAdded,ac.prototype._onDataSourceAdded,this),L.add(M.dataSourceRemoved,ac.prototype._onDataSourceRemoved,this),L.add(P.postUpdate,ac.prototype.resize,this),L.add(P.postRender,ac.prototype._postRender,this);let se=M.length;for(let de=0;de<se;de++)this._dataSourceAdded(M,M.get(de));this._dataSourceAdded(void 0,D.defaultDataSource),L.add(M.dataSourceAdded,ac.prototype._dataSourceAdded,this),L.add(M.dataSourceRemoved,ac.prototype._dataSourceRemoved,this);function ae(de){let ve=v8e(v,de);N(ve)?vt.getValueOrUndefined(ve.position,v.clock.currentTime)?v.trackedEntity=ve:v.zoomTo(ve):N(v.trackedEntity)&&(v.trackedEntity=void 0)}function fe(de){v.selectedEntity=v8e(v,de)}S.screenSpaceEventHandler.setInputAction(fe,Ei.LEFT_CLICK),S.screenSpaceEventHandler.setInputAction(ae,Ei.LEFT_DOUBLE_CLICK)}Object.defineProperties(ac.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(o){this.scene.shadowMap.enabled=o}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(o){this.scene.globe.shadows=o}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(o){this.scene.terrainProvider=o}},camera:{get:function(){return this.scene.camera}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(o){this._cesiumWidget.targetFrameRate=o}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(o){this._cesiumWidget.useDefaultRenderLoop=o}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(o){this._cesiumWidget.resolutionScale=o}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(o){this._cesiumWidget.useBrowserRecommendedResolution=o}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(o){this._allowDataSourcesToSuspendAnimation=o}},trackedEntity:{get:function(){return this._trackedEntity},set:function(o){if(this._trackedEntity!==o){this._trackedEntity=o,_ie(this);let f=this.scene,m=f.mode;!N(o)||!N(o.position)?(this._needTrackedEntityUpdate=!1,(m===_i.COLUMBUS_VIEW||m===_i.SCENE2D)&&(f.screenSpaceCameraController.enableTranslate=!0),(m===_i.COLUMBUS_VIEW||m===_i.SCENE3D)&&(f.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(Ee.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(o),this.scene.requestRender()}}},selectedEntity:{get:function(){return this._selectedEntity},set:function(o){if(this._selectedEntity!==o){this._selectedEntity=o;let f=N(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;N(o)?N(f)&&f.animateAppear():N(f)&&f.animateDepart(),this._selectedEntityChanged.raiseEvent(o)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(o){this._clockTrackedDataSource!==o&&(this._clockTrackedDataSource=o,Cat(this._timeline,this.clock,o))}}});ac.prototype.extend=function(o,f){o(this,f)};ac.prototype.resize=function(){let o=this._cesiumWidget,f=this._container,m=f.clientWidth,v=f.clientHeight,y=N(this._animation),x=N(this._timeline);if(o.resize(),m===this._lastWidth&&v===this._lastHeight)return;let C=v-125,w=this._baseLayerPickerDropDown;if(N(w)&&(w.style.maxHeight=`${C}px`),N(this._geocoder)){let I=this._geocoder.searchSuggestionsContainer;I.style.maxHeight=`${C}px`}N(this._infoBox)&&(this._infoBox.viewModel.maxHeight=C);let A=this._timeline,E,T=0,S=0,M=0;if(y&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let I=this._lastWidth;E=this._animation.container,m>900?(T=169,I<=900&&(E.style.width="169px",E.style.height="112px",this._animation.resize())):m>=600?(T=136,(I<600||I>900)&&(E.style.width="136px",E.style.height="90px",this._animation.resize())):(T=106,(I>600||I===0)&&(E.style.width="106px",E.style.height="70px",this._animation.resize())),S=T+5}if(x&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let I=this._fullscreenButton,P=this._vrButton,D=A.container,L=D.style;M=D.clientHeight+3,L.left=`${T}px`;let R=0;N(I)&&(R+=I.container.clientWidth),N(P)&&(R+=P.container.clientWidth),L.right=`${R}px`,A.resize()}this._bottomContainer.style.left=`${S}px`,this._bottomContainer.style.bottom=`${M}px`,this._lastWidth=m,this._lastHeight=v};ac.prototype.forceResize=function(){this._lastWidth=0,this.resize()};ac.prototype.render=function(){this._cesiumWidget.render()};ac.prototype.isDestroyed=function(){return!1};ac.prototype.destroy=function(){let o;this.screenSpaceEventHandler.removeInputAction(Ei.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Ei.LEFT_DOUBLE_CLICK);let f=this.dataSources,m=f.length;for(o=0;o<m;o++)this._dataSourceRemoved(f,f.get(o));return this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),N(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),N(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),N(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),N(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),N(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),N(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),N(this._timeline)&&(this._timeline.removeEventListener("settime",xat,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),N(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),N(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),N(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),N(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),this._cesiumWidget=this._cesiumWidget.destroy(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),kr(this)};ac.prototype._dataSourceAdded=function(o,f){f.entities.collectionChanged.addEventListener(ac.prototype._onEntityCollectionChanged,this)};ac.prototype._dataSourceRemoved=function(o,f){let m=f.entities;m.collectionChanged.removeEventListener(ac.prototype._onEntityCollectionChanged,this),N(this.trackedEntity)&&m.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0),N(this.selectedEntity)&&m.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};ac.prototype._onTick=function(o){let f=o.currentTime,m=this._dataSourceDisplay.update(f);this._allowDataSourcesToSuspendAnimation&&(this._clockViewModel.canAnimate=m);let v=this._entityView;if(N(v)){let I=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(I,!1,XR)===Vo.DONE&&v.update(f,XR)}let y,x=!1,C=this.selectedEntity,w=N(C)&&this._enableInfoOrSelection;w&&C.isShowing&&C.isAvailable(f)&&(this._dataSourceDisplay.getBoundingSphere(C,!0,XR)!==Vo.FAILED?y=XR.center:N(C.position)&&(y=C.position.getValue(f,y)),x=N(y));let A=this.imageryLayers,E,T;for(T=0;T<A.length;T++)E=A.get(T),E&&E._availability&&(E.show=E.isAvailable(f));let S=N(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;N(S)&&(S.position=H.clone(y,S.position),S.showSelection=w&&x,S.update());let M=N(this._infoBox)?this._infoBox.viewModel:void 0;N(M)&&(M.showInfo=w,M.enableCamera=x,M.isCameraTracking=this.trackedEntity===this.selectedEntity,w?(M.titleText=Z(C.name,C.id),M.description=vt.getValueOrDefault(C.description,f,"")):(M.titleText="",M.description=""))};ac.prototype._onEntityCollectionChanged=function(o,f,m){let v=m.length;for(let y=0;y<v;y++){let x=m[y];this.trackedEntity===x&&(this.trackedEntity=void 0),this.selectedEntity===x&&(this.selectedEntity=void 0)}};ac.prototype._onInfoBoxCameraClicked=function(o){if(o.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let f=this.selectedEntity.position;N(f)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};ac.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};ac.prototype._onInfoBoxClockClicked=function(o){this.selectedEntity=void 0};ac.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};ac.prototype._onDataSourceChanged=function(o){this.clockTrackedDataSource===o&&Cat(this.timeline,this.clock,o)};ac.prototype._onDataSourceAdded=function(o,f){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=f);let m=f.entities.id,v=this._eventHelper.add(f.changedEvent,ac.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[m]=v};ac.prototype._onDataSourceRemoved=function(o,f){let m=this.clockTrackedDataSource===f,v=f.entities.id;if(this._dataSourceChangedListeners[v](),this._dataSourceChangedListeners[v]=void 0,m){let y=o.length;this._automaticallyTrackDataSourceClocks&&y>0?this.clockTrackedDataSource=o.get(y-1):this.clockTrackedDataSource=void 0}};ac.prototype.zoomTo=function(o,f){return bat(this,o,{offset:f},!1)};ac.prototype.flyTo=function(o,f){return bat(this,o,f,!0)};function bat(o,f,m,v){_ie(o);let y=new Promise(x=>{o._completeZoom=function(C){x(C)}});return o._zoomPromise=y,o._zoomIsFlight=v,o._zoomOptions=m,Promise.resolve(f).then(function(x){if(o._zoomPromise===y){if(x instanceof x_){let C;if(N(x.imageryProvider)){let w=Promise.resolve();N(x.imageryProvider._readyPromise)?w=x.imageryProvider._readyPromise:N(x.imageryProvider.readyPromise)&&(w=x.imageryProvider.readyPromise),C=w.then(()=>x.getImageryRectangle())}else C=new Promise(w=>{let A=x.readyEvent.addEventListener(()=>{A(),w(x.getImageryRectangle())})});C.then(function(w){return tae(w,o.scene)}).then(function(w){o._zoomPromise===y&&(o._zoomTarget=w)});return}if(x instanceof pg||x instanceof uae||x instanceof dae){o._zoomTarget=x;return}if(x.isLoading&&N(x.loadingEvent)){let C=x.loadingEvent.addEventListener(function(){C(),o._zoomPromise===y&&(o._zoomTarget=x.entities.values.slice(0))});return}if(Array.isArray(x)){o._zoomTarget=x.slice(0);return}x=Z(x.values,x),N(x.entities)&&(x=x.entities.values),Array.isArray(x)?o._zoomTarget=x.slice(0):o._zoomTarget=[x]}}),o.scene.requestRender(),y}function fz(o){o._zoomPromise=void 0,o._zoomTarget=void 0,o._zoomOptions=void 0}function _ie(o){let f=o._zoomPromise;N(f)&&(fz(o),o._completeZoom(!1))}ac.prototype._postRender=function(){UDi(this),GDi(this)};function UDi(o){let f=o._zoomTarget;if(!N(f)||o.scene.mode===_i.MORPHING)return;let m=o.scene,v=m.camera,y=Z(o._zoomOptions,{}),x;if(f instanceof pg||f instanceof dae)return f._readyPromise.then(function(){let E=f.boundingSphere;N(y.offset)||(y.offset=new gC(0,-.5,E.radius)),x={offset:y.offset,duration:y.duration,maximumHeight:y.maximumHeight,complete:function(){o._completeZoom(!0)},cancel:function(){o._completeZoom(!1)}},o._zoomIsFlight?v.flyToBoundingSphere(f.boundingSphere,x):(v.viewBoundingSphere(E,y.offset),v.lookAtTransform(Ee.IDENTITY),o._completeZoom(!0)),fz(o)}).catch(()=>{_ie(o)});if(f instanceof uae)return f._readyPromise.then(function(){let E=f.boundingSphere;N(y.offset)||(y.offset=new gC(0,-.5,E.radius)),x={offset:y.offset,duration:y.duration,maximumHeight:y.maximumHeight,complete:function(){o._completeZoom(!0)},cancel:function(){o._completeZoom(!1)}},o._zoomIsFlight?v.flyToBoundingSphere(E,x):(v.viewBoundingSphere(E,y.offset),v.lookAtTransform(Ee.IDENTITY),o._completeZoom(!0)),fz(o)});if(f instanceof Mt){x={destination:m.mapProjection.ellipsoid.cartographicToCartesian(f),duration:y.duration,maximumHeight:y.maximumHeight,complete:function(){o._completeZoom(!0)},cancel:function(){o._completeZoom(!1)}},o._zoomIsFlight?v.flyTo(x):(v.setView(x),o._completeZoom(!0)),fz(o);return}let C=f,w=[];for(let E=0,T=C.length;E<T;E++){let S=o._dataSourceDisplay.getBoundingSphere(C[E],!1,XR);if(S===Vo.PENDING)return;S!==Vo.FAILED&&w.push(Pi.clone(XR))}if(w.length===0){_ie(o);return}o.trackedEntity=void 0;let A=Pi.fromBoundingSpheres(w);o._zoomIsFlight?(fz(o),v.flyToBoundingSphere(A,{duration:y.duration,maximumHeight:y.maximumHeight,complete:function(){o._completeZoom(!0)},cancel:function(){o._completeZoom(!1)},offset:y.offset})):(v.viewBoundingSphere(A,y.offset),v.lookAtTransform(Ee.IDENTITY),fz(o),o._completeZoom(!0))}function GDi(o){if(!o._needTrackedEntityUpdate)return;let f=o._trackedEntity,m=o.clock.currentTime,v=vt.getValueOrUndefined(f.position,m);if(!N(v))return;let y=o.scene,x=o._dataSourceDisplay.getBoundingSphere(f,!1,XR);if(x===Vo.PENDING)return;let C=y.mode;(C===_i.COLUMBUS_VIEW||C===_i.SCENE2D)&&(y.screenSpaceCameraController.enableTranslate=!1),(C===_i.COLUMBUS_VIEW||C===_i.SCENE3D)&&(y.screenSpaceCameraController.enableTilt=!1);let w=x!==Vo.FAILED?XR:void 0;o._entityView=new nTe(f,y,y.mapProjection.ellipsoid),o._entityView.update(m,w),o._needTrackedEntityUpdate=!1}var Uae=ac;function WDi(o){let f=document.createElement("div");f.className="cesium-viewer-cesium3DTilesInspectorContainer",o.container.appendChild(f);let m=new nIe(f,o.scene);Object.defineProperties(o,{cesium3DTilesInspector:{get:function(){return m}}})}var wat=WDi;function jDi(o){let f=document.createElement("div");f.className="cesium-viewer-cesiumInspectorContainer",o.container.appendChild(f);let m=new cIe(f,o.scene);Object.defineProperties(o,{cesiumInspector:{get:function(){return m}}})}var Aat=jDi;function YDi(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=!0,v=Z(f.flyToOnDrop,!0),y=new Br,x=Z(f.clearOnDrop,!0),C=Z(f.dropTarget,o.container),w=Z(f.clampToGround,!0),A=f.proxy;C=Uh(C),Object.defineProperties(o,{dropTarget:{get:function(){return C},set:function(T){x8e(C,E),C=T,Ype(C,E)}},dropEnabled:{get:function(){return m},set:function(T){T!==m&&(T?Ype(C,E):x8e(C,E),m=T)}},dropError:{get:function(){return y}},clearOnDrop:{get:function(){return x},set:function(T){x=T}},flyToOnDrop:{get:function(){return v},set:function(T){v=T}},proxy:{get:function(){return A},set:function(T){A=T}},clampToGround:{get:function(){return w},set:function(T){w=T}}});function E(T){C5(T),x&&(o.entities.removeAll(),o.dataSources.removeAll());let S=T.dataTransfer.files,M=S.length;for(let I=0;I<M;I++){let P=S[I],D=new FileReader;D.onload=qDi(o,P,A,w),D.onerror=XDi(o,P),D.readAsText(P)}}Ype(C,E),o.destroy=A2e(o,o.destroy,function(){o.dropEnabled=!1}),o._handleDrop=E}function C5(o){o.stopPropagation(),o.preventDefault()}function x8e(o,f){let m=o;N(m)&&(m.removeEventListener("drop",f,!1),m.removeEventListener("dragenter",C5,!1),m.removeEventListener("dragover",C5,!1),m.removeEventListener("dragexit",C5,!1))}function Ype(o,f){o.addEventListener("drop",f,!1),o.addEventListener("dragenter",C5,!1),o.addEventListener("dragover",C5,!1),o.addEventListener("dragexit",C5,!1)}function qDi(o,f,m,v){let y=o.scene;return function(x){let C=f.name;try{let w;if(/\.czml$/i.test(C))w=bq.load(JSON.parse(x.target.result),{sourceUri:C});else if(/\.geojson$/i.test(C)||/\.json$/i.test(C)||/\.topojson$/i.test(C))w=ZW.load(JSON.parse(x.target.result),{sourceUri:C,clampToGround:v});else if(/\.(kml|kmz)$/i.test(C))w=Ore.load(f,{sourceUri:C,proxy:m,camera:y.camera,canvas:y.canvas,clampToGround:v,screenOverlayContainer:o.container});else if(/\.gpx$/i.test(C))w=dTe.load(f,{sourceUri:C,proxy:m});else{o.dropError.raiseEvent(o,C,`Unrecognized file: ${C}`);return}N(w)&&o.dataSources.add(w).then(function(A){o.flyToOnDrop&&o.flyTo(A)}).catch(function(A){o.dropError.raiseEvent(o,C,A)})}catch(w){o.dropError.raiseEvent(o,C,w)}}}function XDi(o,f){return function(m){o.dropError.raiseEvent(o,f.name,m.target.error)}}var Eat=YDi;function JDi(o,f){f=Z(f,Z.EMPTY_OBJECT);let m=new TIe({scene:o.scene,container:o.bottomContainer,lowFrameRateMessage:f.lowFrameRateMessage});Object.defineProperties(o,{performanceWatchdog:{get:function(){return m}}})}var Tat=JDi;function KDi(o){let f=document.createElement("div");f.className="cesium-viewer-voxelInspectorContainer",o.container.appendChild(f);let m=new BIe(f,o.scene);Object.defineProperties(o,{voxelInspector:{get:function(){return m}}})}var Sat=KDi;globalThis.CESIUM_VERSION="1.106";var Pat="3.2.5";var qi={};Ice(qi,{AlphaMode:()=>PH,AlphaPipelineStage:()=>qbe,Animation:()=>tIe,AnimationViewModel:()=>iIe,Appearance:()=>md,ApproximateTerrainHeights:()=>zh,ArcGISTiledElevationTerrainProvider:()=>Goe,ArcGisBaseMapType:()=>d3,ArcGisMapServerImageryProvider:()=>hC,ArcGisMapService:()=>EE,ArcType:()=>fs,ArticulationStageType:()=>b1,AssociativeArray:()=>wa,AttributeCompression:()=>Ku,AttributeType:()=>Ks,AutoExposure:()=>ASe,AutomaticUniforms:()=>Mz,Axis:()=>Df,AxisAlignedBoundingBox:()=>_Y,B3dmLoader:()=>sbe,B3dmParser:()=>abe,Base64Encoder:()=>gee,BaseLayerPicker:()=>aIe,BaseLayerPickerViewModel:()=>oIe,BatchTable:()=>cre,BatchTableHierarchy:()=>$re,BatchTexture:()=>mw,BatchTexturePipelineStage:()=>Xbe,Billboard:()=>kd,BillboardCollection:()=>XE,BillboardGraphics:()=>jM,BillboardVisualizer:()=>lEe,BingMapsGeocoderService:()=>yrt,BingMapsImageryProvider:()=>xO,BingMapsStyle:()=>goe,BlendEquation:()=>Cv,BlendFunction:()=>Bh,BlendOption:()=>If,BlendTexture:()=>pU,BlendingState:()=>Mu,BoundingRectangle:()=>Xr,BoundingSphere:()=>Pi,BoundingSphereState:()=>Vo,BoxEmitter:()=>eae,BoxGeometry:()=>MM,BoxGeometryUpdater:()=>uEe,BoxGraphics:()=>fre,BoxOutlineGeometry:()=>X2,BrdfLutGenerator:()=>NTe,Buffer:()=>Ao,BufferLoader:()=>jY,BufferUsage:()=>gn,CPUStylingPipelineStage:()=>Zbe,CallbackProperty:()=>xn,Camera:()=>Vl,CameraEventAggregator:()=>BSe,CameraEventType:()=>Hc,CameraFlightPath:()=>KCe,Cartesian2:()=>Ye,Cartesian3:()=>H,Cartesian4:()=>Wt,Cartographic:()=>Mt,CartographicGeocoderService:()=>c2e,CatmullRomSpline:()=>xrt,CatmullRomSplineExtend:()=>Crt,Cesium3DContentGroup:()=>Zre,Cesium3DTile:()=>xC,Cesium3DTileBatchTable:()=>UY,Cesium3DTileColorBlendMode:()=>d2,Cesium3DTileContent:()=>unt,Cesium3DTileContentFactory:()=>Nne,Cesium3DTileContentState:()=>ud,Cesium3DTileContentType:()=>Ev,Cesium3DTileFeature:()=>Qs,Cesium3DTileFeatureTable:()=>qU,Cesium3DTileOptimizationHint:()=>WR,Cesium3DTileOptimizations:()=>gAe,Cesium3DTilePass:()=>ep,Cesium3DTilePassState:()=>ET,Cesium3DTilePointFeature:()=>i5,Cesium3DTileRefine:()=>Ug,Cesium3DTileStyle:()=>G2,Cesium3DTileStyleEngine:()=>yAe,Cesium3DTilesInspector:()=>nIe,Cesium3DTilesInspectorViewModel:()=>rIe,Cesium3DTilesVoxelProvider:()=>ynt,Cesium3DTileset:()=>pg,Cesium3DTilesetBaseTraversal:()=>CAe,Cesium3DTilesetCache:()=>_Ae,Cesium3DTilesetGraphics:()=>vre,Cesium3DTilesetHeatmap:()=>vAe,Cesium3DTilesetMetadata:()=>fq,Cesium3DTilesetMostDetailedTraversal:()=>xAe,Cesium3DTilesetSkipTraversal:()=>bAe,Cesium3DTilesetStatistics:()=>v5,Cesium3DTilesetTraversal:()=>Xy,Cesium3DTilesetVisualizer:()=>cEe,CesiumInspector:()=>cIe,CesiumInspectorViewModel:()=>uIe,CesiumNavigation:()=>SPe,CesiumRenderPass:()=>FPe,CesiumTerrainProvider:()=>K5,CesiumWidget:()=>Xq,Check:()=>kh,CheckerboardMaterialProperty:()=>bte,CircleEmitter:()=>Y2e,CircleGeometry:()=>Srt,CircleOutlineGeometry:()=>Prt,CircleWaveMaterialProperty:()=>mU,ClassificationModelDrawCommand:()=>Tbe,ClassificationPipelineStage:()=>Jbe,ClassificationPrimitive:()=>AU,ClassificationType:()=>uc,ClearCommand:()=>Gc,ClippingPlane:()=>zv,ClippingPlaneCollection:()=>Uv,Clock:()=>MU,ClockRange:()=>L0,ClockStep:()=>Od,ClockViewModel:()=>eIe,CloudCollection:()=>Tnt,CloudType:()=>$te,CollectionSource:()=>BWe,Color:()=>Re,ColorBlendMode:()=>T2,ColorGeometryInstanceAttribute:()=>ea,ColorMaterialProperty:()=>xs,Command:()=>nat,CommandLoader:()=>PPe,ComponentDatatype:()=>Rt,Composite3DTileContent:()=>_1e,CompositeEntityCollection:()=>KZe,CompositeMaterialProperty:()=>Ate,CompositePositionProperty:()=>O1,CompositeProperty:()=>bw,CompressedTextureBuffer:()=>iY,ComputeCommand:()=>B5,ComputeEngine:()=>SAe,ComputeRegionBox:()=>kZe,ConditionsExpression:()=>Bxe,ConeEmitter:()=>R6,ConicArcSensor:()=>die,ConicArcSensorCollection:()=>Zot,ConicArcSensorGeometry:()=>pie,ConicArcSensorGraphics:()=>hie,ConicArcSensorOutlineGeometry:()=>mie,ConstantPositionProperty:()=>c2,ConstantProperty:()=>Uc,ConstantSpline:()=>fbe,ConstructionWorker:()=>VWe,ContentMetadata:()=>aAe,ContentState:()=>a2,Context:()=>NAe,ContextLimits:()=>Bo,CoplanarPolygonGeometry:()=>UB,CoplanarPolygonGeometryLibrary:()=>Hz,CoplanarPolygonOutlineGeometry:()=>YI,CornerType:()=>ed,CorridorGeometry:()=>xq,CorridorGeometryLibrary:()=>Kc,CorridorGeometryUpdater:()=>fEe,CorridorGraphics:()=>pre,CorridorOutlineGeometry:()=>dEe,Credit:()=>Cs,CreditDisplay:()=>FTe,CubeMap:()=>lT,CubeMapFace:()=>wR,CubicRealPolynomial:()=>gY,CullFace:()=>uh,CullingVolume:()=>hg,CumulusCloud:()=>IT,CustomDataSource:()=>Cre,CustomHeightmapTerrainProvider:()=>Mrt,CustomMercatorProjection:()=>vU,CustomShader:()=>Kw,CustomShaderManagerEx:()=>are,CustomShaderMode:()=>hY,CustomShaderPipelineStage:()=>owe,CustomShaderTranslucencyMode:()=>C3,CustomTilingScheme:()=>xje,CylinderGeometry:()=>pEe,CylinderGeometryLibrary:()=>toe,CylinderGeometryUpdater:()=>gEe,CylinderGraphics:()=>mre,CylinderOutlineGeometry:()=>mEe,CzmlDataSource:()=>bq,DDSTexture:()=>zPe,DataSource:()=>C_,DataSourceClock:()=>D5,DataSourceCollection:()=>EEe,DataSourceDisplay:()=>Sq,DebugAppearance:()=>Ont,DebugCameraPrimitive:()=>Ap,DebugInspector:()=>qSe,DebugModelMatrixPrimitive:()=>Q2e,DefaultProxy:()=>Lrt,DepthFunction:()=>mC,DepthPlane:()=>BTe,DequantizationPipelineStage:()=>awe,DerivedCommand:()=>Iv,DeveloperError:()=>li,DeviceOrientationCameraController:()=>kTe,DirectionalLight:()=>rae,DiscardEmptyTileImagePolicy:()=>_oe,DiscardMissingTileImagePolicy:()=>gTe,DistanceDisplayCondition:()=>ia,DistanceDisplayConditionGeometryInstanceAttribute:()=>th,DistanceLegendViewModel:()=>vPe,DoubleEndedPriorityQueue:()=>Xoe,DoublyLinkedList:()=>Vne,DracoLoader:()=>YY,DrawCommand:()=>Jn,DynamicGeometryBatch:()=>loe,DynamicGeometryUpdater:()=>wh,ECharts:()=>fY,EarthOrientationParameters:()=>k_e,EarthOrientationParametersSample:()=>nY,EasingFunction:()=>Bv,EllipseGeometry:()=>Vw,EllipseGeometryLibrary:()=>tb,EllipseGeometryUpdater:()=>SEe,EllipseGraphics:()=>gre,EllipseOutlineGeometry:()=>I2,Ellipsoid:()=>ki,EllipsoidGeodesic:()=>Im,EllipsoidGeometry:()=>V0,EllipsoidGeometryUpdater:()=>DEe,EllipsoidGraphics:()=>TU,EllipsoidOutlineGeometry:()=>Bw,EllipsoidPrimitive:()=>RTe,EllipsoidRhumbLine:()=>Sw,EllipsoidSurfaceAppearance:()=>MY,EllipsoidTangentPlane:()=>KE,EllipsoidTerrainProvider:()=>AT,EllipsoidalOccluder:()=>pB,Empty3DTileContent:()=>uj,EncodedCartesian3:()=>Qu,Entity:()=>Wh,EntityCluster:()=>iO,EntityCollection:()=>$w,EntityView:()=>nTe,Event:()=>Br,EventHelper:()=>AC,ExpandBySmartEarth:()=>qx,ExpandByTerra:()=>Cje,Expression:()=>b3,ExpressionNodeType:()=>Co,ExternalParameter:()=>Hy,ExtrapolationType:()=>n2,FBXLoader:()=>LPe,FBXPrimitive:()=>mae,FBXTreeParser:()=>DPe,FeatureDataProvider:()=>Nre,FeatureDetection:()=>pa,FeatureIdPipelineStage:()=>uq,FeatureJsonData:()=>RU,FisheyeProjectionMap:()=>OY,FisheyeProjectionMapShader:()=>K7,FlattenVS:()=>jot,FlowEcharts:()=>Qne,Fog:()=>VTe,ForEach:()=>an,FrameRateMonitor:()=>Z2e,FrameState:()=>zTe,Framebuffer:()=>dg,FramebufferManager:()=>$h,FrustumCommands:()=>jTe,FrustumGeometry:()=>OU,FrustumOutlineGeometry:()=>RY,Fullscreen:()=>ng,FullscreenButton:()=>dIe,FullscreenButtonViewModel:()=>hIe,GWBaiduImageryProvider:()=>FU,GeoJsonDataSource:()=>ZW,GeoJsonLoader:()=>cbe,GeocodeType:()=>Jq,Geocoder:()=>gIe,GeocoderService:()=>Koe,GeocoderViewModel:()=>mIe,GeographicProjection:()=>Mp,GeographicTilingScheme:()=>Bd,Geometry:()=>ga,Geometry3DTileContent:()=>v1e,GeometryAttribute:()=>en,GeometryAttributes:()=>Oc,GeometryFactory:()=>Frt,GeometryInstance:()=>co,GeometryInstanceAttribute:()=>L1,GeometryOffsetAttribute:()=>yl,GeometryPipeline:()=>Ju,GeometryPipelineStage:()=>uwe,GeometryType:()=>NR,GeometryUpdater:()=>nd,GeometryVisualizer:()=>KEe,GetFeatureInfoFormat:()=>uW,GifImageProperty:()=>OXe,Globe:()=>ITe,GlobeDepth:()=>YTe,GlobeSurfaceShaderSet:()=>pTe,GlobeSurfaceTile:()=>OM,GlobeSurfaceTileProvider:()=>STe,GlobeTranslucency:()=>Rq,GlobeTranslucencyFramebuffer:()=>qTe,GlobeTranslucencyState:()=>UTe,GltfBufferViewLoader:()=>ine,GltfDracoLoader:()=>rne,GltfImageLoader:()=>one,GltfIndexBufferLoader:()=>ane,GltfInstanceLoader:()=>bne,GltfJsonLoader:()=>une,GltfLoader:()=>RB,GltfLoaderUtil:()=>IM,GltfStructuralMetadataLoader:()=>tbe,GltfTextureLoader:()=>hne,GltfVertexBufferLoader:()=>dne,GoogleEarthEnterpriseImageryProvider:()=>Nnt,GoogleEarthEnterpriseMapsProvider:()=>Coe,GoogleEarthEnterpriseMetadata:()=>TO,GoogleEarthEnterpriseTerrainData:()=>Qte,GoogleEarthEnterpriseTerrainProvider:()=>Urt,GoogleEarthEnterpriseTileInformation:()=>g2e,GoogleMaps:()=>pW,GpxDataSource:()=>dTe,Graticules:()=>Gre,GregorianDate:()=>gU,GridImageryProvider:()=>Fnt,GridMaterialProperty:()=>Pte,GroundGeometryUpdater:()=>uu,GroundPolylineGeometry:()=>bU,GroundPolylinePrimitive:()=>aO,GroundPrimitive:()=>Zw,GroupMetadata:()=>dte,GwBufferAnalysis:()=>Wre,HeadingPitchRange:()=>gC,HeadingPitchRoll:()=>dl,Heap:()=>t_e,HeightReference:()=>qn,HeightmapEncoding:()=>U3,HeightmapTerrainData:()=>wT,HeightmapTessellator:()=>moe,HermitePolynomialApproximation:()=>vEe,HermiteSpline:()=>aj,HilbertOrder:()=>Qee,HomeButton:()=>vIe,HomeButtonViewModel:()=>_Ie,HorizontalOrigin:()=>Zc,HugeAdapter:()=>lq,I3SDataProvider:()=>nae,I3SFeature:()=>iPe,I3SField:()=>rPe,I3SGeometry:()=>eie,I3SLayer:()=>iU,I3SNode:()=>tie,I3dmLoader:()=>dbe,I3dmParser:()=>hbe,Iau2000Orientation:()=>DTe,Iau2006XysData:()=>z_e,Iau2006XysSample:()=>Jie,IauOrientationAxes:()=>LTe,IauOrientationParameters:()=>MTe,ImageBasedLighting:()=>zY,ImageBasedLightingPipelineStage:()=>Dbe,ImageCombine:()=>rre,ImageMaterialProperty:()=>Pp,Imagery:()=>Aoe,ImageryLayer:()=>x_,ImageryLayerCollection:()=>PTe,ImageryLayerFeatureInfo:()=>yO,ImageryProvider:()=>Q2,ImageryState:()=>kl,Implicit3DTileContent:()=>ote,ImplicitAvailabilityBitstream:()=>$ee,ImplicitMetadataView:()=>tne,ImplicitSubdivisionScheme:()=>N0,ImplicitSubtree:()=>mne,ImplicitSubtreeCache:()=>U2e,ImplicitSubtreeMetadata:()=>b1e,ImplicitTileCoordinates:()=>Une,ImplicitTileset:()=>gq,IndexDatatype:()=>ro,InfoBox:()=>CIe,InfoBoxViewModel:()=>xIe,InspectorShared:()=>k1,InstanceAttributeSemantic:()=>ag,InstancingPipelineStage:()=>Ube,InterpolationAlgorithm:()=>Wrt,InterpolationType:()=>o3,Intersect:()=>La,IntersectionTests:()=>Hh,Intersections2D:()=>M6,Interval:()=>t2,InvertClassification:()=>Doe,Ion:()=>ZR,IonGeocoderService:()=>C2e,IonImageryProvider:()=>p2,IonResource:()=>Pw,IonWorldImageryStyle:()=>x5,Iso8601:()=>Hn,JobScheduler:()=>GTe,JobType:()=>Zx,JsonMetadataTable:()=>eq,JulianDate:()=>ci,KTX2Transcoder:()=>r_e,KeyboardEventModifier:()=>dC,KeyframeNode:()=>_h,KmlCamera:()=>gCe,KmlDataSource:()=>Ore,KmlLookAt:()=>_Ce,KmlTour:()=>vCe,KmlTourFlyTo:()=>yCe,KmlTourWait:()=>CCe,Label:()=>TW,LabelCollection:()=>UM,LabelGraphics:()=>SU,LabelStyle:()=>of,LabelVisualizer:()=>QEe,LagrangePolynomialApproximation:()=>xEe,LeapSecond:()=>lh,Light:()=>Vnt,LightingModel:()=>pC,LightingPipelineStage:()=>hwe,LinearApproximation:()=>Ire,LinearSampler:()=>Z2,LinearSpline:()=>sq,MTLLoader:()=>RPe,ManagedArray:()=>E2,MapMode2D:()=>$E,MapProjection:()=>Yrt,MapboxImageryProvider:()=>CO,MapboxStyleImageryProvider:()=>Hnt,Material:()=>zo,MaterialAppearance:()=>Nd,MaterialPass:()=>UPe,MaterialPipelineStage:()=>fwe,MaterialProperty:()=>O0,Math:()=>xe,Matrix2:()=>im,Matrix3:()=>Ut,Matrix4:()=>Ee,Megatexture:()=>aae,MeshParser:()=>MPe,MeshPhongMaterial:()=>vW,MetadataClass:()=>UU,MetadataClassProperty:()=>GY,MetadataComponentType:()=>ds,MetadataEntity:()=>yu,MetadataEnum:()=>j1e,MetadataEnumValue:()=>W1e,MetadataPipelineStage:()=>hM,MetadataSchema:()=>LB,MetadataSchemaLoader:()=>fne,MetadataSemantic:()=>gne,MetadataTable:()=>hO,MetadataTableProperty:()=>A1e,MetadataType:()=>Fa,MipmapHint:()=>hB,Model:()=>S_,Model3DTileContent:()=>PR,ModelAlphaOptions:()=>Dwe,ModelAnimation:()=>ybe,ModelAnimationChannel:()=>_be,ModelAnimationCollection:()=>xbe,ModelAnimationLoop:()=>RE,ModelAnimationState:()=>OR,ModelArticulation:()=>Obe,ModelArticulationStage:()=>Rbe,ModelClippingPlanesPipelineStage:()=>Bbe,ModelColorPipelineStage:()=>sj,ModelComponents:()=>Ta,ModelDrawCommand:()=>Sbe,ModelFeature:()=>Cbe,ModelFeatureTable:()=>bbe,ModelFlattenPipelineStage:()=>qwe,ModelGraphics:()=>yY,ModelLightingOptions:()=>Gwe,ModelMatrixUpdateStage:()=>Wbe,ModelNode:()=>kbe,ModelRenderResources:()=>Fwe,ModelRuntimeNode:()=>Ybe,ModelRuntimePrimitive:()=>Pwe,ModelSceneGraph:()=>Xwe,ModelSilhouettePipelineStage:()=>Vwe,ModelSkin:()=>Mwe,ModelSplitterPipelineStage:()=>Hwe,ModelStatistics:()=>Jwe,ModelType:()=>Lf,ModelUtility:()=>xl,ModelVisualizer:()=>ZEe,Moon:()=>OTe,MorphTargetsPipelineStage:()=>mwe,MorphWeightSpline:()=>qrt,MortonOrder:()=>DH,MultiResourceImageryProvider:()=>BU,MultiResourceTerrainProvider:()=>jre,Multiple3DTileContent:()=>hAe,MultisampleFramebuffer:()=>nbe,NavigationControl:()=>z6,NavigationHelpButton:()=>wIe,NavigationHelpButtonViewModel:()=>bIe,NavigationUtils:()=>H6,NavigationViewModel:()=>gW,NearFarScalar:()=>sa,NeverTileDiscardPolicy:()=>Unt,NodeRenderResources:()=>Uwe,NodeStatisticsPipelineStage:()=>jbe,NodeTransformationProperty:()=>_re,OBJLoader:()=>NPe,OBJPrimitive:()=>gae,OIT:()=>KTe,Occluder:()=>Ure,OctahedralProjectedCubeMap:()=>V5,OffsetGeometryInstanceAttribute:()=>nm,OlMVTImageryProvider:()=>kU,OpenCageGeocoderService:()=>Xrt,OpenStreetMapImageryProvider:()=>pM,OrderedGroundPrimitiveCollection:()=>TEe,OrientedBoundingBox:()=>fc,OrthographicFrustum:()=>Gs,OrthographicOffCenterFrustum:()=>Pm,Packable:()=>Jrt,PackableForInterpolation:()=>Krt,Particle:()=>sae,ParticleBurst:()=>F6,ParticleEmitter:()=>jnt,ParticleSystem:()=>sA,Pass:()=>vr,PassState:()=>Kg,PathGraphics:()=>xY,PathVisualizer:()=>$Ee,PeliasGeocoderService:()=>y2e,PerInstanceColorAppearance:()=>ms,PerformanceDisplay:()=>kq,PerformanceWatchdog:()=>TIe,PerformanceWatchdogViewModel:()=>EIe,PerspectiveFrustum:()=>pc,PerspectiveOffCenterFrustum:()=>J2,PerspectiveProjectionMap:()=>NY,PerspectiveProjectionMapShader:()=>Q7,PerspectiveProjectionMapWithDepth:()=>FY,PerspectiveProjectionMapWithDepthShader:()=>QR,PickDepth:()=>WTe,PickDepthFramebuffer:()=>QTe,PickFramebuffer:()=>ZTe,Picking:()=>aSe,PickingPipelineStage:()=>gwe,PinBuilder:()=>AY,PixelDatatype:()=>Rn,PixelFormat:()=>Nn,Plane:()=>$a,PlaneGeometry:()=>LEe,PlaneGeometryUpdater:()=>NEe,PlaneGraphics:()=>oCe,PlaneOutlineGeometry:()=>REe,PntsLoader:()=>Lne,PntsParser:()=>Dne,PointCloud:()=>aPe,PointCloudEyeDomeLighting:()=>oq,PointCloudShading:()=>YU,PointCloudStylingPipelineStage:()=>vwe,PointGraphics:()=>yre,PointLight:()=>BY,PointPrimitive:()=>jv,PointPrimitiveCollection:()=>_B,PointVisualizer:()=>eTe,PolygonDepth:()=>H5,PolygonDepthFS:()=>Ene,PolygonDepthVS:()=>Tne,PolygonGeometry:()=>Ec,PolygonGeometryLibrary:()=>lu,PolygonGeometryUpdater:()=>BEe,PolygonGraphics:()=>bl,PolygonHierarchy:()=>ho,PolygonOutlineGeometry:()=>FEe,PolygonPipeline:()=>xh,Polyline:()=>Y2,PolylineArrowMaterialProperty:()=>_C,PolylineCollection:()=>lO,PolylineColorAppearance:()=>tm,PolylineDashMaterialProperty:()=>Hl,PolylineGeometry:()=>b_,PolylineGeometryUpdater:()=>tTe,PolylineGlowMaterialProperty:()=>Ite,PolylineGraphics:()=>b2,PolylineMaterialAppearance:()=>M0,PolylineOutlineMaterialProperty:()=>SM,PolylinePipeline:()=>Zh,PolylineTrailLinkMaterialProperty:()=>JXe,PolylineVisualizer:()=>rTe,PolylineVolumeGeometry:()=>kEe,PolylineVolumeGeometryLibrary:()=>G5,PolylineVolumeGeometryUpdater:()=>zEe,PolylineVolumeGraphics:()=>xre,PolylineVolumeOutlineGeometry:()=>VEe,PositionProperty:()=>vY,PositionPropertyArray:()=>xH,PostProcessStage:()=>as,PostProcessStageCollection:()=>MSe,PostProcessStageComposite:()=>z0,PostProcessStageLibrary:()=>D0,PostProcessStageSampleMode:()=>zy,PostProcessStageTextureCache:()=>koe,Primitive:()=>Ia,PrimitiveCollection:()=>w_,PrimitiveLoadPlan:()=>rq,PrimitiveOutlineGenerator:()=>xne,PrimitiveOutlinePipelineStage:()=>Cwe,PrimitivePipeline:()=>S5,PrimitiveRenderResources:()=>Wwe,PrimitiveState:()=>Zp,PrimitiveStatisticsPipelineStage:()=>bwe,PrimitiveType:()=>Fn,ProjectionPicker:()=>LIe,ProjectionPickerViewModel:()=>DIe,Property:()=>vt,PropertyArray:()=>noe,PropertyAttribute:()=>vne,PropertyAttributeProperty:()=>Q1e,PropertyBag:()=>C2,PropertyTable:()=>pO,PropertyTexture:()=>_ne,PropertyTextureProperty:()=>J1e,ProviderViewModel:()=>$m,Proxy:()=>$rt,QuadraticRealPolynomial:()=>FE,QuadtreeOccluders:()=>Xre,QuadtreePrimitive:()=>hb,QuadtreePrimitivezh:()=>tJe,QuadtreeTile:()=>kY,QuadtreeTileLoadState:()=>Ch,QuadtreeTileProvider:()=>s4,QuantizedMeshTerrainData:()=>joe,QuarticRealPolynomial:()=>Uxe,Quaternion:()=>Gr,QuaternionSpline:()=>mbe,Queue:()=>R5,RasterizeHtml:()=>VU,Ray:()=>_s,Rectangle:()=>Di,RectangleCollisionChecker:()=>hoe,RectangleGeometry:()=>GB,RectangleGeometryLibrary:()=>y_,RectangleGeometryUpdater:()=>jEe,RectangleGraphics:()=>PU,RectangleOutlineGeometry:()=>kne,RectangularSensor:()=>Lj,RectangularSensorFS:()=>lie,RectangularSensorGraphics:()=>$ot,RectangularSensorPrimitive:()=>KPe,RectangularSensorScanPlaneFS:()=>JPe,RectangularSensorVS:()=>yae,RectangularSensorVisualizer:()=>QPe,ReferenceFrame:()=>om,ReferenceProperty:()=>PY,RegionPolygonTexture:()=>pPe,RegionTexture:()=>mPe,RegionWeather:()=>_ae,RenderEntity:()=>Wq,RenderObjectFactory:()=>ec,RenderState:()=>Mn,Renderbuffer:()=>N1,RenderbufferFormat:()=>aC,Request:()=>cg,RequestErrorEvent:()=>A5,RequestScheduler:()=>Rw,RequestState:()=>bc,RequestType:()=>Qy,ResetViewNavigationControl:()=>CPe,Resource:()=>Jr,ResourceCache:()=>id,ResourceCacheKey:()=>tA,ResourceCacheStatistics:()=>q1e,ResourceLoader:()=>W0,ResourceLoaderState:()=>la,Rotation:()=>S2,RuntimeError:()=>sr,S2Cell:()=>zz,S3MCacheFileRenderEntity:()=>Tj,S3MCompressType:()=>Jot,S3MContentFactory:()=>GPe,S3MContentParser:()=>WPe,S3MCreateIndexJob:()=>$Se,S3MCreateVertexJob:()=>QSe,S3MDataSource:()=>_Ze,S3MLayerCache:()=>jPe,S3MLayerScheduler:()=>YPe,S3MPixelFormat:()=>Kot,S3MTile:()=>XPe,S3MTilesFS:()=>JSe,S3MTilesLayer:()=>vae,S3MTilesVS:()=>XSe,S3ModelParser:()=>qPe,SDFSettings:()=>By,SampledPositionProperty:()=>ww,SampledProperty:()=>ZI,Sampler:()=>gs,ScaledPositionProperty:()=>DU,Scene:()=>r2e,SceneFramebuffer:()=>Roe,SceneMode:()=>_i,SceneMode2DPipelineStage:()=>wwe,SceneModePicker:()=>PIe,SceneModePickerViewModel:()=>SIe,SceneTransforms:()=>nl,SceneTransitioner:()=>FSe,ScreenSpaceCameraController:()=>GSe,ScreenSpaceEventHandler:()=>Ur,ScreenSpaceEventType:()=>Ei,SelectedFeatureIdPipelineStage:()=>lj,SelectionIndicator:()=>MIe,SelectionIndicatorViewModel:()=>IIe,Sensor:()=>Vot,ShaderBuilder:()=>Ine,ShaderCache:()=>IAe,ShaderDestination:()=>yr,ShaderFunction:()=>Nwe,ShaderProgram:()=>Rs,ShaderSource:()=>Zr,ShaderStruct:()=>Rwe,ShadowMap:()=>mD,ShadowMapShader:()=>p3,ShadowMode:()=>Cl,ShadowVolumeAppearance:()=>nM,ShowGeometryInstanceAttribute:()=>zu,Simon1994PlanetaryPositions:()=>cj,SimplePolylineGeometry:()=>ent,SingleTileImageryProvider:()=>EC,SkinningPipelineStage:()=>Ewe,SkyAtmosphere:()=>Yq,SkyBox:()=>r4,SlopeArrow:()=>Cae,SpatialNode:()=>sPe,SphereEmitter:()=>B6,SphereGeometry:()=>tnt,SphereOutlineGeometry:()=>YM,Spherical:()=>CEe,Spline:()=>gd,SplitDirection:()=>eD,Splitter:()=>lae,SpotLight:()=>yZe,StaticGeometryColorBatch:()=>eM,StaticGeometryPerMaterialBatch:()=>tM,StaticGroundGeometryColorBatch:()=>Nte,StaticGroundGeometryPerMaterialBatch:()=>YEe,StaticGroundPolylinePerMaterialBatch:()=>iTe,StaticOutlineGeometryBatch:()=>Fte,StencilConstants:()=>Ua,StencilFunction:()=>dc,StencilOperation:()=>No,SteppedSpline:()=>pbe,StripeMaterialProperty:()=>Mte,StripeOrientation:()=>F3,StructuralMetadata:()=>$M,StyleCommandsNeeded:()=>z5,StyleExpression:()=>Xnt,Sun:()=>n2e,SunLight:()=>l6,SunPostProcess:()=>YSe,SupportedImageFormats:()=>ibe,SvgPathBindingHandler:()=>$Pe,TaskProcessor:()=>tp,Terrain:()=>uPe,TerrainData:()=>WB,TerrainEncoding:()=>Hw,TerrainExaggeration:()=>V1,TerrainFillMesh:()=>Soe,TerrainFlatten:()=>xD,TerrainFlattenPolygonTexture:()=>gPe,TerrainMesh:()=>jB,TerrainOffsetProperty:()=>$ne,TerrainProvider:()=>Rv,TerrainQuantization:()=>Wy,TerrainRegionWeather:()=>VPe,TerrainState:()=>Ls,Texture:()=>_o,Texture3D:()=>BAe,TextureAtlas:()=>EW,TextureCache:()=>MAe,TextureMagnificationFilter:()=>Zu,TextureManager:()=>Nxe,TextureMinificationFilter:()=>Xa,TextureUniform:()=>Rxe,TextureWrap:()=>ha,TileAvailability:()=>m3,TileBoundingRegion:()=>rT,TileBoundingS2Cell:()=>fAe,TileBoundingSphere:()=>lD,TileBoundingVolume:()=>Jnt,TileCoordinatesImageryProvider:()=>oX,TileDiscardPolicy:()=>Knt,TileEdge:()=>Ss,TileImagery:()=>Eoe,TileMapServiceImageryProvider:()=>cb,TileMetadata:()=>lAe,TileOrientedBoundingBox:()=>M3,TileProviderError:()=>ld,TileReplacementQueue:()=>Kre,TileSelectionResult:()=>ba,TileState:()=>Qnt,Tileset3DTileContent:()=>Kwe,TilesetMetadata:()=>mAe,TilesetPipelineStage:()=>Ibe,TilesetRegionWeather:()=>kPe,TilingScheme:()=>int,TimeConstants:()=>lc,TimeDynamicImagery:()=>woe,TimeDynamicPointCloud:()=>uae,TimeInterval:()=>hl,TimeIntervalCollection:()=>Lv,TimeIntervalCollectionPositionProperty:()=>HH,TimeIntervalCollectionProperty:()=>CH,TimeStandard:()=>gu,Timeline:()=>NIe,TimelineHighlightRange:()=>RIe,TimelineTrack:()=>OIe,Tipsify:()=>Zxe,ToggleButtonViewModel:()=>Sz,Tonemapper:()=>oH,Transforms:()=>tn,TranslationRotationScale:()=>ob,TranslucentTileClassification:()=>iSe,TridiagonalSystemSolver:()=>wne,TrustedServers:()=>Gie,TweenCollection:()=>Hoe,UniformState:()=>LAe,UniformType:()=>Ra,UrlTemplateGeojsonProvider:()=>bZe,UrlTemplateImageryProvider:()=>Xv,UserInterfaceControl:()=>pae,Utils:()=>fT,VERSION:()=>Pat,VRButton:()=>VIe,VRButtonViewModel:()=>kIe,VRTheWorldTerrainProvider:()=>ant,VaryingType:()=>Nv,Vector3DTileBatch:()=>SH,Vector3DTileClampedPolylines:()=>iAe,Vector3DTileContent:()=>oAe,Vector3DTileGeometry:()=>YF,Vector3DTilePoints:()=>Qwe,Vector3DTilePolygons:()=>Zwe,Vector3DTilePolylines:()=>One,Vector3DTilePrimitive:()=>ene,VelocityOrientationProperty:()=>bEe,VelocityVectorProperty:()=>ooe,VertexArray:()=>Du,VertexArrayFacade:()=>oY,VertexAttributeSemantic:()=>fa,VertexCompressOption:()=>dw,VertexFormat:()=>un,VerticalOrigin:()=>so,VideoSynchronizer:()=>rnt,View:()=>E6,ViewShed:()=>Xot,ViewShedMap:()=>s6,ViewShedMapShader:()=>h3,Viewer:()=>Uae,ViewportQuad:()=>hae,Visibility:()=>Bl,Visualizer:()=>Jet,VolumeCloud:()=>bae,VoxelBoxShape:()=>Z5,VoxelContent:()=>G2e,VoxelCylinderShape:()=>$5,VoxelEllipsoidShape:()=>Zq,VoxelInspector:()=>BIe,VoxelInspectorViewModel:()=>FIe,VoxelPrimitive:()=>dae,VoxelProvider:()=>oot,VoxelRenderResources:()=>V2e,VoxelShape:()=>aot,VoxelShapeType:()=>Rh,VoxelTraversal:()=>nie,VulkanConstants:()=>snt,WallGeometry:()=>qEe,WallGeometryLibrary:()=>doe,WallGeometryUpdater:()=>JEe,WallGraphics:()=>CY,WallOutlineGeometry:()=>XEe,WaterFS:()=>qCe,WaterMaterialProperty:()=>IZe,WebGLConstants:()=>xi,WebMapServiceImageryProvider:()=>bO,WebMapTileServiceImageryProvider:()=>hP,WebMercatorProjection:()=>hd,WebMercatorTilingScheme:()=>Mm,WindingOrder:()=>K1,WireframeIndexGenerator:()=>Pne,WireframePipelineStage:()=>Swe,ZoomNavigationControl:()=>oie,_shadersAcesTonemappingStage:()=>sSe,_shadersAdditiveBlend:()=>WSe,_shadersAdjustTranslucentFS:()=>_te,_shadersAllMaterialAppearanceFS:()=>FCe,_shadersAllMaterialAppearanceVS:()=>BCe,_shadersAmbientOcclusionGenerate:()=>lSe,_shadersAmbientOcclusionModulate:()=>uSe,_shadersAspectRampMaterial:()=>o_e,_shadersAtmosphereCommon:()=>OH,_shadersBasicMaterialAppearanceFS:()=>kCe,_shadersBasicMaterialAppearanceVS:()=>VCe,_shadersBillboardCollectionFS:()=>_xe,_shadersBillboardCollectionVS:()=>vxe,_shadersBlackAndWhite:()=>cSe,_shadersBloomComposite:()=>hSe,_shadersBrdfLutGeneratorFS:()=>kAe,_shadersBrightPass:()=>jSe,_shadersBrightness:()=>dSe,_shadersBumpMapMaterial:()=>a_e,_shadersCPUStylingStageFS:()=>Qbe,_shadersCPUStylingStageVS:()=>Kbe,_shadersCheckFloatTexturePrecisionFS:()=>FZe,_shadersCheckerboardMaterial:()=>s_e,_shadersCloudCollectionFS:()=>VAe,_shadersCloudCollectionVS:()=>zAe,_shadersCloudNoiseFS:()=>HAe,_shadersCloudNoiseVS:()=>UAe,_shadersCompareAndPackTranslucentDepth:()=>GAe,_shadersCompositeOITFS:()=>WAe,_shadersCompositeTranslucentClassification:()=>cW,_shadersContrastBias:()=>fSe,_shadersCustomShaderStageFS:()=>ewe,_shadersCustomShaderStageVS:()=>$be,_shadersCzmBuiltins:()=>V7,_shadersDepthOfField:()=>pSe,_shadersDepthPlaneFS:()=>jAe,_shadersDepthPlaneVS:()=>YAe,_shadersDepthView:()=>mSe,_shadersDepthViewPacked:()=>zot,_shadersDotMaterial:()=>l_e,_shadersEdgeDetection:()=>gSe,_shadersElevationBandMaterial:()=>u_e,_shadersElevationContourMaterial:()=>c_e,_shadersElevationRampMaterial:()=>h_e,_shadersEllipsoidFS:()=>vte,_shadersEllipsoidSurfaceAppearanceFS:()=>UCe,_shadersEllipsoidSurfaceAppearanceVS:()=>GCe,_shadersEllipsoidVS:()=>yte,_shadersFXAA:()=>vSe,_shadersFXAA3_11:()=>qAe,_shadersFadeMaterial:()=>d_e,_shadersFeatureIdStageFS:()=>twe,_shadersFeatureIdStageVS:()=>iwe,_shadersFilmicTonemapping:()=>_Se,_shadersGaussianBlur1D:()=>Ej,_shadersGaussianBlur1DSun:()=>TSe,_shadersGeometryStageFS:()=>swe,_shadersGeometryStageVS:()=>lwe,_shadersGlobeFS:()=>XAe,_shadersGlobeVS:()=>JAe,_shadersGridMaterial:()=>f_e,_shadersGroundAtmosphere:()=>xte,_shadersHSBToRGB:()=>pye,_shadersHSLToRGB:()=>mye,_shadersImageBasedLightingStageFS:()=>Mbe,_shadersInstancingStageCommon:()=>Vbe,_shadersInstancingStageVS:()=>zbe,_shadersIntersectBox:()=>D2e,_shadersIntersectClippingPlanes:()=>M2e,_shadersIntersectCylinder:()=>L2e,_shadersIntersectDepth:()=>I2e,_shadersIntersectEllipsoid:()=>R2e,_shadersIntersection:()=>mW,_shadersIntersectionUtils:()=>P2e,_shadersLegacyInstancingStageVS:()=>Hbe,_shadersLensFlare:()=>ySe,_shadersLightingStageFS:()=>cwe,_shadersMaterialStageFS:()=>dwe,_shadersMegatexture:()=>k2e,_shadersMetadataStageFS:()=>rwe,_shadersMetadataStageVS:()=>nwe,_shadersModelClippingPlanesStageFS:()=>Fbe,_shadersModelColorStageFS:()=>Nbe,_shadersModelFS:()=>wbe,_shadersModelFlattenStageFS:()=>Ywe,_shadersModelFlattenStageVS:()=>jwe,_shadersModelSilhouetteStageFS:()=>Bwe,_shadersModelSilhouetteStageVS:()=>kwe,_shadersModelSplitterStageFS:()=>zwe,_shadersModelVS:()=>Abe,_shadersModifiedReinhardTonemapping:()=>xSe,_shadersMorphTargetsStageVS:()=>pwe,_shadersNightVision:()=>CSe,_shadersNormalMapMaterial:()=>p_e,_shadersOctahedralProjectionAtlasFS:()=>p1e,_shadersOctahedralProjectionFS:()=>m1e,_shadersOctahedralProjectionVS:()=>g1e,_shadersOctree:()=>B2e,_shadersPassThrough:()=>NM,_shadersPassThroughDepth:()=>Aj,_shadersPerInstanceColorAppearanceFS:()=>iCe,_shadersPerInstanceColorAppearanceVS:()=>rCe,_shadersPerInstanceFlatColorAppearanceFS:()=>lre,_shadersPerInstanceFlatColorAppearanceVS:()=>nCe,_shadersPointCloudEyeDomeLighting:()=>obe,_shadersPointCloudStylingStageVS:()=>_we,_shadersPointPrimitiveCollectionFS:()=>mz,_shadersPointPrimitiveCollectionVS:()=>Cxe,_shadersPolylineArrowMaterial:()=>m_e,_shadersPolylineColorAppearanceVS:()=>Xxe,_shadersPolylineCommon:()=>xB,_shadersPolylineDashMaterial:()=>g_e,_shadersPolylineFS:()=>ure,_shadersPolylineGlowMaterial:()=>__e,_shadersPolylineMaterialAppearanceVS:()=>Jxe,_shadersPolylineOutlineMaterial:()=>v_e,_shadersPolylineShadowVolumeFS:()=>Wxe,_shadersPolylineShadowVolumeMorphFS:()=>jxe,_shadersPolylineShadowVolumeMorphVS:()=>Yxe,_shadersPolylineShadowVolumeVS:()=>qxe,_shadersPolylineVS:()=>WCe,_shadersPostProcessRain:()=>Hot,_shadersPostProcessSnow:()=>Uot,_shadersPrimitiveOutlineStageFS:()=>xwe,_shadersPrimitiveOutlineStageVS:()=>ywe,_shadersRGBToHSB:()=>Hye,_shadersRGBToHSL:()=>Uye,_shadersRGBToXYZ:()=>Gye,_shadersReinhardTonemapping:()=>bSe,_shadersReprojectWebMercatorFS:()=>KAe,_shadersReprojectWebMercatorVS:()=>QAe,_shadersRimLightingMaterial:()=>y_e,_shadersSelectedFeatureIdStageCommon:()=>ute,_shadersShadowVolumeAppearanceFS:()=>dre,_shadersShadowVolumeAppearanceVS:()=>tCe,_shadersShadowVolumeFS:()=>RW,_shadersSilhouette:()=>wSe,_shadersSkinningStageVS:()=>Awe,_shadersSkyAtmosphereCommon:()=>Cte,_shadersSkyAtmosphereFS:()=>ZAe,_shadersSkyAtmosphereVS:()=>$Ae,_shadersSkyBoxFS:()=>eEe,_shadersSkyBoxVS:()=>tEe,_shadersSlopeRampMaterial:()=>x_e,_shadersStripeMaterial:()=>C_e,_shadersSunFS:()=>iEe,_shadersSunShaft:()=>Got,_shadersSunShaftHdr:()=>Wot,_shadersSunShaftModulate:()=>ESe,_shadersSunTextureFS:()=>rEe,_shadersSunTextureFS_v2:()=>BZe,_shadersSunVS:()=>aEe,_shadersSunVisibleFS:()=>nEe,_shadersSunVisibleShaft:()=>SSe,_shadersSunVisibleVS:()=>oEe,_shadersTexturedMaterialAppearanceFS:()=>zCe,_shadersTexturedMaterialAppearanceVS:()=>HCe,_shadersVector3DTileClampedPolylinesFS:()=>tAe,_shadersVector3DTileClampedPolylinesVS:()=>eAe,_shadersVector3DTilePolylinesVS:()=>$we,_shadersVectorTileVS:()=>Kee,_shadersViewportQuadFS:()=>sEe,_shadersViewportQuadVS:()=>Jne,_shadersVoxelFS:()=>T2e,_shadersVoxelVS:()=>S2e,_shadersWater:()=>b_e,_shadersXYZToRGB:()=>fxe,_shadersacesTonemapping:()=>kve,_shadersalphaWeight:()=>Vve,_shadersantialias:()=>zve,_shadersapproximateSphericalCoordinates:()=>Hve,_shadersbackFacing:()=>Uve,_shadersbranchFreeTernary:()=>Gve,_shaderscascadeColor:()=>Wve,_shaderscascadeDistance:()=>jve,_shaderscascadeMatrix:()=>Yve,_shaderscascadeWeights:()=>qve,_shaderscolumbusViewMorph:()=>Xve,_shaderscomputePosition:()=>Jve,_shadersconvertUvToBox:()=>O2e,_shadersconvertUvToCylinder:()=>N2e,_shadersconvertUvToEllipsoid:()=>F2e,_shaderscosineAndSine:()=>Kve,_shadersdecompressTextureCoordinates:()=>Qve,_shadersdefaultPbrMaterial:()=>Zve,_shadersdegreesPerRadian:()=>j_e,_shadersdepthClamp:()=>$ve,_shadersdepthRange:()=>Y_e,_shadersdepthRangeStruct:()=>Ive,_shaderseastNorthUpToEyeCoordinates:()=>eye,_shadersellipsoidContainsPoint:()=>tye,_shadersellipsoidWgs84TextureCoordinates:()=>iye,_shadersepsilon1:()=>q_e,_shadersepsilon2:()=>X_e,_shadersepsilon3:()=>J_e,_shadersepsilon4:()=>K_e,_shadersepsilon5:()=>Q_e,_shadersepsilon6:()=>Z_e,_shadersepsilon7:()=>$_e,_shadersequalsEpsilon:()=>rye,_shaderseyeOffset:()=>nye,_shaderseyeToWindowCoordinates:()=>oye,_shadersfastApproximateAtan:()=>aye,_shadersfog:()=>sye,_shadersgammaCorrect:()=>lye,_shadersgeodeticSurfaceNormal:()=>uye,_shadersgetDefaultMaterial:()=>cye,_shadersgetLambertDiffuse:()=>hye,_shadersgetSpecular:()=>dye,_shadersgetWaterNoise:()=>fye,_shadershue:()=>gye,_shadersinfinity:()=>eve,_shadersinverseGamma:()=>_ye,_shadersisEmpty:()=>vye,_shadersisFull:()=>yye,_shaderslatitudeToWebMercatorFraction:()=>xye,_shaderslineDistance:()=>bye,_shaderslinearToSrgb:()=>Cye,_shadersluminance:()=>wye,_shadersmaterial:()=>Mve,_shadersmaterialInput:()=>Dve,_shadersmetersPerPixel:()=>Aye,_shadersmodelMaterial:()=>Lve,_shadersmodelToWindowCoordinates:()=>Eye,_shadersmodelVertexOutput:()=>Rve,_shadersmultiplyWithColorBalance:()=>Tye,_shadersnearFarScalar:()=>Sye,_shadersoctDecode:()=>Pye,_shadersoneOverPi:()=>tve,_shadersoneOverTwoPi:()=>ive,_shaderspackDepth:()=>Iye,_shaderspassCesium3DTile:()=>rve,_shaderspassCesium3DTileClassification:()=>nve,_shaderspassCesium3DTileClassificationIgnoreShow:()=>ove,_shaderspassClassification:()=>ave,_shaderspassCompute:()=>sve,_shaderspassEnvironment:()=>lve,_shaderspassGlobe:()=>uve,_shaderspassOpaque:()=>cve,_shaderspassOverlay:()=>hve,_shaderspassTerrainClassification:()=>dve,_shaderspassTranslucent:()=>fve,_shaderspassVoxels:()=>pve,_shaderspbrLighting:()=>Mye,_shaderspbrMetallicRoughnessMaterial:()=>Dye,_shaderspbrParameters:()=>Ove,_shaderspbrSpecularGlossinessMaterial:()=>Lye,_shadersphong:()=>Rye,_shaderspi:()=>mve,_shaderspiOverFour:()=>gve,_shaderspiOverSix:()=>_ve,_shaderspiOverThree:()=>vve,_shaderspiOverTwo:()=>yve,_shadersplaneDistance:()=>Oye,_shaderspointAlongRay:()=>Nye,_shadersradiansPerDegree:()=>xve,_shadersray:()=>Nve,_shadersrayEllipsoidIntersectionInterval:()=>Fye,_shadersraySegment:()=>Fve,_shadersraySphereIntersectionInterval:()=>Bye,_shadersreadDepth:()=>kye,_shadersreadNonPerspective:()=>Vye,_shadersreverseLogDepth:()=>zye,_shadersround:()=>Wye,_shaderssampleOctahedralProjection:()=>jye,_shaderssaturation:()=>Yye,_shaderssceneMode2D:()=>Cve,_shaderssceneMode3D:()=>bve,_shaderssceneModeColumbusView:()=>wve,_shaderssceneModeMorphing:()=>Ave,_shadersshadowDepthCompare:()=>qye,_shadersshadowParameters:()=>Bve,_shadersshadowVisibility:()=>Xye,_shaderssignNotZero:()=>Jye,_shaderssolarRadius:()=>Eve,_shaderssphericalHarmonics:()=>Kye,_shaderssrgbToLinear:()=>Qye,_shaderstangentToEyeSpaceMatrix:()=>Zye,_shaderstextureCube:()=>$ye,_shadersthreePiOver2:()=>Tve,_shaderstransformPlane:()=>exe,_shaderstranslateRelativeToEye:()=>txe,_shaderstranslucentPhong:()=>ixe,_shaderstranspose:()=>rxe,_shaderstwoPi:()=>Sve,_shadersunpackDepth:()=>nxe,_shadersunpackFloat:()=>oxe,_shadersunpackUint:()=>axe,_shadersvalueTransform:()=>sxe,_shadersvertexLogDepth:()=>lxe,_shaderswebMercatorMaxLatitude:()=>Pve,_shaderswindowToEyeCoordinates:()=>uxe,_shaderswriteDepthClamp:()=>cxe,_shaderswriteLogDepth:()=>hxe,_shaderswriteNonPerspective:()=>dxe,addBuffer:()=>N1e,addDefaults:()=>S1e,addExtensionsRequired:()=>L1e,addExtensionsUsed:()=>DB,addPipelineExtras:()=>qY,addToArray:()=>F1,appendForwardSlash:()=>K0e,arrayRemoveDuplicates:()=>F0,barycentricCoordinates:()=>hre,binarySearch:()=>Wg,buildDrawCommand:()=>Pbe,buildModuleUrl:()=>Ms,buildVoxelDrawCommands:()=>H2e,clipper2lib:()=>MR,clone:()=>uo,combine:()=>va,computeFlyToLocationForRectangle:()=>tae,createBillboardPointCallback:()=>Rne,createBlurStage:()=>sie,createCommand:()=>Fl,createDefaultImageryProviderViewModels:()=>sIe,createDefaultTerrainProviderViewModels:()=>lIe,createEdgeStage:()=>U6,createElevationBandMaterial:()=>Pnt,createFragmentFromTemplate:()=>_Pe,createGooglePhotorealistic3DTileset:()=>Int,createGuid:()=>zl,createMaterialPropertyDescriptor:()=>A_,createOsmBuildings:()=>Mnt,createOsmBuildingsAsync:()=>Dnt,createPropertyDescriptor:()=>Oi,createRawPropertyDescriptor:()=>S1,createTangentSpaceDebugPrimitive:()=>Lnt,createTaskProcessorWorker:()=>eat,createUniform:()=>U_e,createUniformArray:()=>W_e,createWorldImagery:()=>Rnt,createWorldImageryAsync:()=>rH,createWorldTerrain:()=>Irt,createWorldTerrainAsync:()=>qoe,decodeGoogleEarthEnterpriseData:()=>p2e,decodeVectorPolylinePositions:()=>rAe,defaultValue:()=>Z,defer:()=>pd,defined:()=>N,demodernizeShader:()=>pxe,deprecationWarning:()=>mi,destroyObject:()=>kr,exportKml:()=>Get,fflate_module:()=>IPe,findAccessorMinMax:()=>JY,findContentMetadata:()=>Fne,findGroupMetadata:()=>Bne,findTileMetadata:()=>cAe,forEachTextureInMaterial:()=>lne,formatError:()=>XH,fragment:()=>Yot,freezeRenderState:()=>i7e,getAbsoluteUri:()=>$j,getAccessorByteStride:()=>fO,getBaseUri:()=>Z0e,getBinaryAccessor:()=>oM,getClipAndStyleCode:()=>$2e,getClippingFunction:()=>Iq,getComponentReader:()=>XY,getElement:()=>Uh,getExtensionFromUri:()=>Bie,getFilenameFromUri:()=>wY,getImageFromTypedArray:()=>Oxe,getImagePixels:()=>w5,getJsonFromTypedArray:()=>E_,getMagic:()=>HU,getStringFromTypedArray:()=>nP,getTimestamp:()=>$c,hasExtension:()=>Gh,heightReferenceOnEntityPropertyChanged:()=>yq,isBitSet:()=>X1,isBlobUri:()=>kie,isCrossOriginUrl:()=>Vie,isDataUri:()=>eY,isLeapYear:()=>cH,knockout:()=>br,knockout_3_5_1:()=>CD,knockout_es5:()=>ZPe,libgif:()=>r1e,loadAndExecuteScript:()=>zie,loadCRN:()=>jrt,loadCubeMap:()=>FAe,loadDDS:()=>Wie,loadImageFromTypedArray:()=>nne,loadKTX2:()=>$3,loadView:()=>fae,mergeSort:()=>A6,moveTechniqueRenderStates:()=>D1e,moveTechniquesToExtension:()=>R1e,numberOfComponentsForType:()=>MB,objFS:()=>OPe,objectToQuery:()=>Hie,oneTimeWarning:()=>Ba,packer:()=>kxe,parseBatchTable:()=>GU,parseBoundingVolumeSemantics:()=>X1e,parseDefines:()=>BPe,parseFeatureMetadataLegacy:()=>ebe,parseGlb:()=>I1e,parseResponseHeaders:()=>$0e,parseStructuralMetadata:()=>$1e,pointInsideTriangle:()=>Qrt,preprocess3DTileContent:()=>t6,processVoxelProperties:()=>z2e,queryToObject:()=>s2,rasterizeHTML_allinone:()=>f1e,readAccessorPacked:()=>F1e,removeExtension:()=>nj,removeExtensionsRequired:()=>P1e,removeExtensionsUsed:()=>sne,removePipelineExtras:()=>M1e,removeUnusedElements:()=>O1e,remove_primitive:()=>Dj,resizeImageToNextPowerOfTwo:()=>DW,sampleTerrain:()=>Aq,sampleTerrainMostDetailed:()=>xT,scaleToGeodeticSurface:()=>Yie,subdivideArray:()=>Kxe,subscribeAndEvaluate:()=>oC,svgCompassGyro:()=>wPe,svgCompassOuterRing:()=>bPe,svgCompassRotationMarker:()=>APe,svgReset:()=>yPe,turf:()=>ra,updateAccessorComponentTypes:()=>B1e,updateVersion:()=>k1e,usesExtension:()=>ug,vertex:()=>qot,viewerCesium3DTilesInspectorMixin:()=>wat,viewerCesiumInspectorMixin:()=>Aat,viewerCesiumNavigationMixin:()=>fot,viewerDragDropMixin:()=>Eat,viewerPerformanceWatchdogMixin:()=>Tat,viewerVoxelInspectorMixin:()=>Sat,webGLConstantToGlslType:()=>lnt,wrapFunction:()=>A2e,writeTextToCanvas:()=>gB});function yX(o=!0){this.async=o}yX.prototype.getXmlHttpRequest=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)return new ActiveXObject("MsXml2.XmlHttp")};yX.prototype.includeJsText=function(o,f){if(o!=null){var m=document.createElement("script");m.type="text/javascript",m.text=f,o.appendChild(m)}};yX.prototype.includeJsSrc=function(o,f){if(o!=null){var m=document.createElement("script");m.type="text/javascript",m.src=f,o.appendChild(m)}};yX.prototype.addJs=function(o,f){var m=this.getXmlHttpRequest(),v=this;m.onreadystatechange=function(){m.readyState===4&&(m.status===200||m.status===304?v.includeJsSrc(o,f):console.log("XML request error: "+m.statusText+" ("+m.status+")"))},m.open("GET",f,v.async),m.send(null),m.status===404?console.log(f+" is not found"):v.includeJsText(o,m.responseText)};var Y0=yX;var QDi={testModel:"Workers/Model/xiaoche.glb",modelAxis:"Workers/Model/axis.gltf",flyModel:"Workers/Model/fly.glb",divpoint:"Workers/image/divpoint.png",divpoint1:"Workers/image/divpoint1.png",richtextpoint:"Workers/image/richtextpoint1.png",mark:"Workers/image/mark.png",mark1:"Workers/image/mark1.png",TrailLine:"Workers/image/TrailLine.png",road:"Workers/image/road.jpg",colors3:"Workers/image/colors3.png",loading:"Workers/image/loading.gif",smog:"Workers/image/smog.png",penquan:"Workers/image/penquan.png",fire:"Workers/image/fire.png",fire2:"Workers/image/fire2.png",bottomplane:"Workers/image/bottomplane.jpg",MTY0001:"Workers/image/MTY0001.jpg",MTY0002:"Workers/image/MTY0002.jpg",wall:"Workers/image/ggy.jpg",rotate:"Workers/image/rotate.png",move:"Workers/image/move.png",draw:"Workers/image/cursor/draw.cur",water:"Workers/image/waterNormals.jpg",movingRiver:"Workers/image/movingRiver.png",effectCircle:"Workers/image/circle.png",scanCircle:"Workers/image/scan.png",particles:"Workers/image/particles.png",trafficLight:{l_go:"Workers/image/trafficLights/l-go.png",l_wait:"Workers/image/trafficLights/l-wait.png",l_stop:"Workers/image/trafficLights/l-stop.png",l_null:"Workers/image/trafficLights/l-null.png",go:"Workers/image/trafficLights/go.png",wait:"Workers/image/trafficLights/wait.png",stop:"Workers/image/trafficLights/stop.png",null:"Workers/image/trafficLights/null.png",r_go:"Workers/image/trafficLights/r-go.png",r_wait:"Workers/image/trafficLights/r-wait.png",r_stop:"Workers/image/trafficLights/r-stop.png",r_null:"Workers/image/trafficLights/r-null.png",bg:"Workers/image/trafficLights/bg.png"}},pn=Object.freeze(QDi);function ZDi(o,f){return o??f}var sm=ZDi;var Mat=`// author: \u5F20\u4E39\u948A czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; if(twoColor){ if(st.s<time){ material.alpha = color1.a; material.diffuse = color1.rgb; }else{ material.alpha = color2.a; material.diffuse = color2.rgb; } }else if(lightSpot){ if(st.s<time){ material.alpha = pow(st.s / time, 20.0); if(material.alpha<alpha){ material.alpha = alpha; material.diffuse = color.rgb; }else{ material.diffuse = lightSpotColor.rgb; } }else{ material.alpha = alpha; material.diffuse = color.rgb; } }else{ vec4 colorImage = texture(image, vec2(fract(st.s - time), st.t)); material.alpha = colorImage.a * color.a; material.diffuse = (colorImage.rgb + color.rgb) / 2.0; } return material; }`;var Dat=`// author: \u5F20\u4E39\u948A uniform vec4 color; uniform vec4 color1; uniform vec4 color2; uniform vec4 lightSpotColor; uniform sampler2D image; uniform bool twoColor; uniform bool lightSpot; uniform float alpha; uniform float intervalTime; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float time = fract(czm_frameNumber / (60.0 * intervalTime)); if(twoColor){ if(st.s < time){ material.alpha = color1.a; material.diffuse = color1.rgb; }else{ material.alpha = color2.a; material.diffuse = color2.rgb; } }else if(lightSpot){ if(st.s<time){ material.alpha = pow(st.s / time, 20.0); if(material.alpha<alpha){ material.alpha = alpha; material.diffuse = color.rgb; }else{ material.diffuse = lightSpotColor.rgb; } }else{ material.alpha = alpha; material.diffuse = color.rgb; } }else{ vec4 colorImage = texture(image, vec2(fract(st.s - time), st.t)); material.alpha = colorImage.a * color.a; material.diffuse = (colorImage.rgb + color.rgb)/2.0; } return material; }`;var Vd=null;function bD(o,f,m,v){Vd=v,$Di(),this._definitionChanged=new Vd.Event,this._color=void 0,this._colorSubscription=void 0,this.color=Vd.Color.fromCssColorString(o||"#ffffff"),this._Line=f||Vd.Material.PolylineTrailLinkImage,this.duration=m||3e3,this.alpha=.3,this._time=new Date().getTime(),typeof this._Line=="object"&&(this._Line.LightSpot?this._Line.color=Vd.Color.fromCssColorString(this._Line.color):(this._Line.color1=Vd.Color.fromCssColorString(this._Line.color1),this._Line.color2=Vd.Color.fromCssColorString(this._Line.color2))),this.isConstant=!1,this.definitionChanged=this._definitionChanged,this.color=Vd.createPropertyDescriptor("color")}bD.prototype.getType=function(o){return"PolylineTrailLink"};bD.prototype.setScale=function(o){this.scale=o};bD.prototype.getValue=function(o,f){return Vd.defined(f)||(f={}),f.color=Vd.Property.getValueOrClonedDefault(this._color,o,Vd.Color.WHITE,f.color),typeof this._Line=="object"?this._Line.LightSpot?(f.lightSpot=!0,f.lightSpotColor=this._Line.color):(f.color1=this._Line.color1,f.color2=this._Line.color2,f.twoColor=!0):f.image=this._Line,this.scale!==void 0?f.time=this.scale:f.time=(new Date().getTime()-this._time)%this.duration/this.duration,f.alpha=this.alpha,f};bD.prototype.equals=function(o){return this===o||o instanceof bD&&Vd.Property.equals(this._color,o._color)};function $Di(){return Vd.PolylineTrailLinkMaterialProperty||(Vd.PolylineTrailLinkMaterialProperty=bD,Vd.Material.PolylineTrailLinkType="PolylineTrailLink",Vd.Material.PolylineTrailLinkImage=window.SmartEarthRootUrl+pn.TrailLine,Vd.Material.PolylineTrailLinkSource=Mat,Vd.Material._materialCache.addMaterial(Vd.Material.PolylineTrailLinkType,{fabric:{type:Vd.Material.PolylineTrailLinkType,uniforms:{color:new Vd.Color(1,0,0,.5),color1:new Vd.Color(0,1,0,.5),color2:new Vd.Color(1,0,0,.5),image:Vd.Material.PolylineTrailLinkImage,twoColor:!1,lightSpot:!1,lightSpotColor:new Vd.Color(1,1,1,.5),alpha:.3,time:0},source:Vd.Material.PolylineTrailLinkSource},translucent:function(o){return!0}})),Vd.Material}function Gae(o){return new o.Cesium.Material({fabric:{uniforms:{color:sm(o.color,new o.Cesium.Color(1,0,0,.5)),color1:sm(o.color1,new o.Cesium.Color(0,1,0,.5)),color2:sm(o.color2,new o.Cesium.Color(1,0,0,.5)),image:sm(o.image,window.SmartEarthRootUrl+pn.TrailLine),twoColor:sm(o.twoColor,!1),lightSpot:sm(o.lightSpot,!1),lightSpotColor:sm(o.lightSpotColor,new o.Cesium.Color(1,1,1,.5)),alpha:sm(o.alpha,.3),intervalTime:sm(o.time,3e3)/1e3},source:Dat}})}var Lat=bD;var Y6=null;function uA(o,f){Y6=f,this._mapContainer=o,window.echarts||new Y0(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/echarts.min.js"),this.Init(o)}uA.prototype.setOption=function(o,f){return this._echartsContainer&&f&&this.clear(),!this._overlay&&(this._overlay=this._createChartOverlay()),this._overlay.setOption(o),this};uA.prototype._createChartOverlay=function(){var o=this._mapContainer.scene;o.canvas.setAttribute("tabIndex",0);var f=document.createElement("div");return f.style.position="absolute",f.style.top="0px",f.style.left="0px",f.style.width=o.canvas.width+"px",f.style.height=o.canvas.height+"px",f.style.pointerEvents="none",f.setAttribute("id","smartearth-cesium-echarts"),f.setAttribute("class","echartMap"),this._mapContainer.container.appendChild(f),this._echartsContainer=f,echarts.init(f)};uA.prototype.clear=function(){this._echartsContainer&&(this._mapContainer.container.removeChild(this._echartsContainer),this._echartsContainer=null),this._overlay&&(this._overlay.dispose(),this._overlay=null)};uA.prototype.deleteObject=uA.prototype.clear;uA.prototype.updateOverlay=function(o){this._overlay&&this._overlay.setOption(o)};uA.prototype.getMap=function(){return this._mapContainer};uA.prototype.getOverlay=function(){return this._overlay};uA.prototype.show=function(){document.getElementById(this._id).style.visibility="visible"};uA.prototype.hide=function(){document.getElementById(this._id).style.visibility="hidden"};uA.prototype.Init=function(o){(function(f){var m={};function v(y){if(m[y])return m[y].exports;var x=m[y]={i:y,l:!1,exports:{}};return f[y].call(x.exports,x,x.exports,v),x.l=!0,x.exports}v.m=f,v.c=m,v.d=function(y,x,C){v.o(y,x)||Object.defineProperty(y,x,{enumerable:!0,get:C})},v.r=function(y){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(y,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(y,"__esModule",{value:!0})},v.t=function(y,x){if(1&x&&(y=v(y)),8&x||4&x&&typeof y=="object"&&y&&y.__esModule)return y;var C=Object.create(null);if(v.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:y}),2&x&&typeof y!="string")for(var w in y)v.d(C,w,function(A){return y[A]}.bind(null,w));return C},v.n=function(y){var x=y&&y.__esModule?function(){return y.default}:function(){return y};return v.d(x,"a",x),x},v.o=function(y,x){return Object.prototype.hasOwnProperty.call(y,x)},v.p="",v(v.s=0)})([function(f,m,v){f.exports=v(1)},function(f,m,v){echarts?v(2).load():console.error("missing echarts lib")},function(f,m,v){"use strict";function y(w,A){for(var E=0;E<A.length;E++){var T=A[E];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(w,T.key,T)}}v.r(m);var x=function(){function w(S,M){(function(I,P){if(!(I instanceof P))throw new TypeError("Cannot call a class as a function")})(this,w),this._viewer=S,this.dimensions=["lng","lat"],this._mapOffset=[0,0],this._api=M}var A,E,T;return A=w,T=[{key:"create",value:function(S,M){var I;S.eachComponent("GLMap",function(P){(I=new w(o,M)).setMapOffset(P.__mapOffset||[0,0]),P.coordinateSystem=I}),S.eachSeries(function(P){P.get("coordinateSystem")==="GLMap"&&(P.coordinateSystem=I)})}},{key:"dimensions",get:function(){return["lng","lat"]}}],(E=[{key:"setMapOffset",value:function(S){return this._mapOffset=S,this}},{key:"getViewer",value:function(){return this._viewer}},{key:"dataToPoint",value:function(S){if(this._viewer&&this._viewer.scene){var M=this._viewer.scene,I=[0,0],P=Y6.Cartesian3.fromDegrees(S[0],S[1]);if(!P)return I;if(M.mode===Y6.SceneMode.SCENE3D&&Y6.Cartesian3.angleBetween(M.camera.position,P)>Y6.Math.toRadians(80))return!1;var D=M.cartesianToCanvasCoordinates(P);return D?[D.x-this._mapOffset[0],D.y-this._mapOffset[1]]:[]}else return[]}},{key:"pointToData",value:function(S){var M=this._mapOffset,I=o.scene.globe.ellipsoid,P=new Y6.cartesian3(S[1]+M,S[2]+M[2],0),D=I.cartesianToCartographic(P);return[D.lng,D.lat]}},{key:"getViewRect",value:function(){var S=this._api;return new echarts.graphic.BoundingRect(0,0,S.getWidth(),S.getHeight())}},{key:"getRoamTransform",value:function(){return echarts.matrix.create()}}])&&y(A.prototype,E),T&&y(A,T),w}();echarts.extendComponentModel({type:"GLMap",getViewer:function(){return o},defaultOption:{roam:!1}}),echarts.extendComponentView({type:"GLMap",init:function(w,A){this.api=A,this.dispose(),o.scene.postRender.addEventListener(this.moveHandler,this)},moveHandler:function(w,A){this.api.dispatchAction({type:"GLMapRoam"})},render:function(w,A,E){},dispose:function(w){o.scene.postRender.removeEventListener(this.moveHandler,this)}});function C(){echarts.registerCoordinateSystem("GLMap",x),echarts.registerAction({type:"GLMapRoam",event:"GLMapRoam",update:"updateLayout"},function(w,A){})}v.d(m,"load",function(){return C})}])};var Rat=uA;function zIe(o){this.serverUrl=o}zIe.prototype.getSceneList=function(o){$.ajax({url:this.serverUrl+"/scene/sceneList",type:"get",success:function(f){o&&typeof o=="function"&&f&&o(JSON.parse(f))}})};zIe.prototype.query=function(o,f){var m=o.database,v={type:sm(o.type,"building"),id:o.id,returnGeometry:sm(o.returnGeometry,!0),returnChildren:sm(o.returnChildren,!0)};$.ajax({url:this.serverUrl+"/"+m+"/query?version=v2.1",type:"post",async:!0,data:v,success:function(y){f&&typeof f=="function"&&y&&f(JSON.parse(y))},error:function(y,x,C){alert("error:"+y.status)}})};var Oat=zIe;function q6(o,f){this.mediaOutputPath=o||"test.mp4",this.videoBPS=f||512e4}q6.prototype.startRecord=function(){navigator.mediaDevices.getDisplayMedia({video:!0,audio:!0}).then(o=>{this.createRecorder(o)}).catch(o=>{this.getUserMediaError(o)})};q6.prototype.getUserMediaError=function(o){console.log("mediaError",o)};q6.prototype.createRecorder=function(o){console.log("start record");var f={videoBitsPerSecond:this.videoBPS};this.recorder=new MediaRecorder(o,f),this.recorder.start();var m=[];this.recorder.onstop=v=>{let y=new Blob(m,{type:"video/mp4"});this.saveMedia(y)},this.recorder.ondataavailable=v=>{m.push(v.data)}};q6.prototype.saveMedia=function(o){let f=window.URL.createObjectURL(o);var m=document.createElement("a");m.innerHTML="test",m.download=this.mediaOutputPath,m.href=f,m.click()};q6.prototype.stopRecord=function(){this.recorder.stop()};var Nat=q6;var Wae=52.35987755982988,ox=3.141592653589793,Fat=6378245,Bat=.006693421622965943,eLi={BD09ToGCJ02(o,f){let m=+o-.0065,v=+f-.006,y=Math.sqrt(m*m+v*v)-2e-5*Math.sin(v*Wae),x=Math.atan2(v,m)-3e-6*Math.cos(m*Wae),C=y*Math.cos(x),w=y*Math.sin(x);return[C,w]},GCJ02ToBD09(o,f){f=+f,o=+o;let m=Math.sqrt(o*o+f*f)+2e-5*Math.sin(f*Wae),v=Math.atan2(f,o)+3e-6*Math.cos(o*Wae),y=m*Math.cos(v)+.0065,x=m*Math.sin(v)+.006;return[y,x]},WGS84ToGCJ02(o,f){if(f=+f,o=+o,this.out_of_china(o,f))return[o,f];{let m=this.delta(o,f);return[o+m[0],f+m[1]]}},GCJ02ToWGS84(o,f){if(f=+f,o=+o,this.out_of_china(o,f))return[o,f];{let m=this.delta(o,f),v=o+m[0],y=f+m[1];return[o*2-v,f*2-y]}},delta(o,f){let m=this.transformLng(o-105,f-35),v=this.transformLat(o-105,f-35),y=f/180*ox,x=Math.sin(y);x=1-Bat*x*x;let C=Math.sqrt(x);return m=m*180/(Fat/C*Math.cos(y)*ox),v=v*180/(Fat*(1-Bat)/(x*C)*ox),[m,v]},transformLng(o,f){f=+f,o=+o;let m=300+o+2*f+.1*o*o+.1*o*f+.1*Math.sqrt(Math.abs(o));return m+=(20*Math.sin(6*o*ox)+20*Math.sin(2*o*ox))*2/3,m+=(20*Math.sin(o*ox)+40*Math.sin(o/3*ox))*2/3,m+=(150*Math.sin(o/12*ox)+300*Math.sin(o/30*ox))*2/3,m},transformLat(o,f){f=+f,o=+o;let m=-100+2*o+3*f+.2*f*f+.1*o*f+.2*Math.sqrt(Math.abs(o));return m+=(20*Math.sin(6*o*ox)+20*Math.sin(2*o*ox))*2/3,m+=(20*Math.sin(f*ox)+40*Math.sin(f/3*ox))*2/3,m+=(160*Math.sin(f/12*ox)+320*Math.sin(f*ox/30))*2/3,m},out_of_china(o,f){return f=+f,o=+o,!(o>73.66&&o<135.05&&f>3.86&&f<53.55)}},HIe=eLi;function UIe(o,f,m){if(o&&f){o[0]!=="#"&&(o=this.colorHex(o)),f[0]!=="#"&&(f=this.colorHex(f));for(var v=this.colorRgb(o),y=v[0],x=v[1],C=v[2],w=this.colorRgb(f),A=w[0],E=w[1],T=w[2],S=(A-y)/m,M=(E-x)/m,I=(T-C)/m,P=[],D=0;D<m;D++){var L=this.colorHex("rgb("+parseInt(S*D+y)+","+parseInt(M*D+x)+","+parseInt(I*D+C)+")");P.push(L)}return P}return this}UIe.prototype.colorRgb=function(m){var f=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,m=m.toLowerCase();if(m&&f.test(m)){if(m.length===4){for(var v="#",y=1;y<4;y+=1)v+=m.slice(y,y+1).concat(m.slice(y,y+1));m=v}for(var x=[],y=1;y<7;y+=2)x.push(parseInt("0x"+m.slice(y,y+2)));return x}else return m};UIe.prototype.colorHex=function(o){var f=o,m=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(f)){var v=f.replace(/(rgb|RGB)*/g,"");v=v.replace("(","").replace(")","");for(var y=v.split(","),x="#",C=0;C<y.length;C++){var w=Number(y[C]).toString(16);w=w.length===1?0+""+w:w,w==="0"&&(w+=w),x+=w}return x.length!==7&&(x=f),x}else if(m.test(f)){var A=f.replace(/#/,"").split("");if(A.length===6)return f;if(A.length===3){for(var E="#",C=0;C<A.length;C+=1)E+=A[C]+A[C];return E}}else return f};var kat=UIe;function tLi(o,f){for(var m=0;m<o.length;m++)if(f(o[m]))return m}var d4=null;function X6(o,f){if(d4=f,o=o||[],!d4.defined(o.workerPath))throw new d4.DeveloperError("workerPath is required.");this._workerPath=o.workerPath,this._poolSize=d4.defaultValue(o.poolSize,16),this._workers=[],this._defered=[]}Object.defineProperties(X6.prototype,{errorEvent:{get:function(){return this.errorEvent}},poolSize:{get:function(){return this._poolSize}}}),X6.prototype.queueWorkItem=function(o,f){for(var m=d4.defer(),v=null,y=999999,x=0;x<this._workers.length;x++){var v=this._workers[x];this._workers[x].jobQueueSize<y&&(v=this._workers[x],y=this._workers[x].jobQueueSize)}if(y>0&&this._workers.length<this.poolSize){v=new Worker(this._workerPath);var C=this;v.addEventListener("message",function(A){C.onWorkerMessage(A)},!1),v.addEventListener("error",function(A){C.onWorkerError(A)},!1),v.jobQueueSize=0,this._workers.push(v),v.id=d4.createGuid()}o.workerId=v.id;var w=d4.createGuid();return o.deferedId=w,this._defered[w]=m,v.jobQueueSize++,v.postMessage(o,f),m.promise};X6.prototype.trimPool=function(o){var f=this;if(o==null){this.timerId!=null&&clearTimeout(this.timerId),this.timerId=setTimeout(function(){f.trimPool(!0)},5e3);return}for(var m=0;m<this._workers.length;m++)this._workers[m].jobQueueSize==0&&(this._workers[m].terminate(),this._workers.splice(m,1),m--);this._workers.length?this.timerId=setTimeout(function(){f.trimPool(!0)},5e3):this.timerId=null};X6.prototype.onWorkerMessage=function(o){var f=o.data,m=tLi(this._workers,function(x){return x.id===f.workerId});if(m!=null){var v=this._workers[m];v.jobQueueSize--,this.trimPool()}var y=this._defered[f.deferedId];delete this._defered[f.deferedId],y.resolve(f)};X6.prototype.onWorkerError=function(o){console.log(o)};var cA=X6;var GIe=new Map;function Vat(o,f){if(o=o.replaceAll("//","/"),o=o.replace("http:/","http://"),o=o.replace("https:/","https://"),GIe.has(o))return GIe.get(o);{let v=new cA({workerPath:SmartEarthRootUrl+"Workers/xhrworker.js"},f).queueWorkItem({type:"get",url:o});return v.then(y=>{y.xmlObj=zat(y.xmlText),v.catch(y)}),GIe.set(o,v),v}}function zat(o){let f={};if(document.all){let m=new ActiveXObject("Microsoft.XMLDOM");m.loadXML(o),f=m}else f=new DOMParser().parseFromString(o,"text/xml");return f}function J6(o){if(!o)return{};if(typeof o=="string"&&(o=zat(o)),o.nodeType==3||o.nodeType==4)return o.nodeValue;let f=o.nodeType==9?o.documentElement:o;return WIe(f)}function WIe(o){try{let f={};if(o.children.length>0)for(let m=0;m<o.children.length;m++){let v=o.children.item(m),y=v.nodeName;if(y=y.split(":"),y=y[1]||y[0],typeof f[y]>"u")f[y]=WIe(v);else{if(typeof f[y].push>"u"){let x=f[y];f[y]=[],f[y].push(x)}f[y].push(WIe(v))}}else if(o.attributes&&o.attributes.length&&!o.textContent){let m={};for(let v=0,y;v<o.attributes.length;v++)y=o.attributes[v],y.split?(y=y.split("="),m[y[0]]=y[1]):m[y.name]=y.textContent;return m}else f=o.textContent;return f}catch(f){console.log(f.message)}}var iLi={UNLOADED:0,LOADING:1,PARSING:2,READY:3,FAILED:4},hA=Object.freeze(iLi);var Hat={};(function(o){Hat=o()})(function(){var o,f,m;return function v(y,x,C){function w(T,S){if(!x[T]){if(!y[T]){var M=typeof Kb=="function"&&Kb;if(!S&&M)return M(T,!0);if(A)return A(T,!0);var I=new Error("Cannot find module '"+T+"'");throw I.code="MODULE_NOT_FOUND",I}var P=x[T]={exports:{}};y[T][0].call(P.exports,function(D){var L=y[T][1][D];return w(L||D)},P,P.exports,v,y,x,C)}return x[T].exports}for(var A=typeof Kb=="function"&&Kb,E=0;E<C.length;E++)w(C[E]);return w}({1:[function(v,y,x){"use strict";var C=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";x.assign=function(E){for(var T=Array.prototype.slice.call(arguments,1);T.length;){var S=T.shift();if(!!S){if(typeof S!="object")throw new TypeError(S+"must be non-object");for(var M in S)S.hasOwnProperty(M)&&(E[M]=S[M])}}return E},x.shrinkBuf=function(E,T){return E.length===T?E:E.subarray?E.subarray(0,T):(E.length=T,E)};var w={arraySet:function(E,T,S,M,I){if(T.subarray&&E.subarray){E.set(T.subarray(S,S+M),I);return}for(var P=0;P<M;P++)E[I+P]=T[S+P]},flattenChunks:function(E){var T,S,M,I,P,D;for(M=0,T=0,S=E.length;T<S;T++)M+=E[T].length;for(D=new Uint8Array(M),I=0,T=0,S=E.length;T<S;T++)P=E[T],D.set(P,I),I+=P.length;return D}},A={arraySet:function(E,T,S,M,I){for(var P=0;P<M;P++)E[I+P]=T[S+P]},flattenChunks:function(E){return[].concat.apply([],E)}};x.setTyped=function(E){E?(x.Buf8=Uint8Array,x.Buf16=Uint16Array,x.Buf32=Int32Array,x.assign(x,w)):(x.Buf8=Array,x.Buf16=Array,x.Buf32=Array,x.assign(x,A))},x.setTyped(C)},{}],2:[function(v,y,x){"use strict";var C=v("./common"),w=!0,A=!0;try{String.fromCharCode.apply(null,[0])}catch{w=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{A=!1}for(var E=new C.Buf8(256),T=0;T<256;T++)E[T]=T>=252?6:T>=248?5:T>=240?4:T>=224?3:T>=192?2:1;E[254]=E[254]=1,x.string2buf=function(M){var I,P,D,L,R,O=M.length,F=0;for(L=0;L<O;L++)P=M.charCodeAt(L),(P&64512)===55296&&L+1<O&&(D=M.charCodeAt(L+1),(D&64512)===56320&&(P=65536+(P-55296<<10)+(D-56320),L++)),F+=P<128?1:P<2048?2:P<65536?3:4;for(I=new C.Buf8(F),R=0,L=0;R<F;L++)P=M.charCodeAt(L),(P&64512)===55296&&L+1<O&&(D=M.charCodeAt(L+1),(D&64512)===56320&&(P=65536+(P-55296<<10)+(D-56320),L++)),P<128?I[R++]=P:P<2048?(I[R++]=192|P>>>6,I[R++]=128|P&63):P<65536?(I[R++]=224|P>>>12,I[R++]=128|P>>>6&63,I[R++]=128|P&63):(I[R++]=240|P>>>18,I[R++]=128|P>>>12&63,I[R++]=128|P>>>6&63,I[R++]=128|P&63);return I};function S(M,I){if(I<65537&&(M.subarray&&A||!M.subarray&&w))return String.fromCharCode.apply(null,C.shrinkBuf(M,I));for(var P="",D=0;D<I;D++)P+=String.fromCharCode(M[D]);return P}x.buf2binstring=function(M){return S(M,M.length)},x.binstring2buf=function(M){for(var I=new C.Buf8(M.length),P=0,D=I.length;P<D;P++)I[P]=M.charCodeAt(P);return I},x.buf2string=function(M,I){var P,D,L,R,O=I||M.length,F=new Array(O*2);for(D=0,P=0;P<O;){if(L=M[P++],L<128){F[D++]=L;continue}if(R=E[L],R>4){F[D++]=65533,P+=R-1;continue}for(L&=R===2?31:R===3?15:7;R>1&&P<O;)L=L<<6|M[P++]&63,R--;if(R>1){F[D++]=65533;continue}L<65536?F[D++]=L:(L-=65536,F[D++]=55296|L>>10&1023,F[D++]=56320|L&1023)}return S(F,D)},x.utf8border=function(M,I){var P;for(I=I||M.length,I>M.length&&(I=M.length),P=I-1;P>=0&&(M[P]&192)===128;)P--;return P<0||P===0?I:P+E[M[P]]>I?P:I}},{"./common":1}],3:[function(v,y,x){"use strict";function C(w,A,E,T){for(var S=w&65535|0,M=w>>>16&65535|0,I=0;E!==0;){I=E>2e3?2e3:E,E-=I;do S=S+A[T++]|0,M=M+S|0;while(--I);S%=65521,M%=65521}return S|M<<16|0}y.exports=C},{}],4:[function(v,y,x){"use strict";y.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(v,y,x){"use strict";function C(){for(var E,T=[],S=0;S<256;S++){E=S;for(var M=0;M<8;M++)E=E&1?3988292384^E>>>1:E>>>1;T[S]=E}return T}var w=C();function A(E,T,S,M){var I=w,P=M+S;E^=-1;for(var D=M;D<P;D++)E=E>>>8^I[(E^T[D])&255];return E^-1}y.exports=A},{}],6:[function(v,y,x){"use strict";function C(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}y.exports=C},{}],7:[function(v,y,x){"use strict";var C=30,w=12;y.exports=function(E,T){var S,M,I,P,D,L,R,O,F,k,U,G,j,q,J,X,Y,Q,ee,z,ie,re,ne,oe,se;S=E.state,M=E.next_in,oe=E.input,I=M+(E.avail_in-5),P=E.next_out,se=E.output,D=P-(T-E.avail_out),L=P+(E.avail_out-257),R=S.dmax,O=S.wsize,F=S.whave,k=S.wnext,U=S.window,G=S.hold,j=S.bits,q=S.lencode,J=S.distcode,X=(1<<S.lenbits)-1,Y=(1<<S.distbits)-1;e:do{j<15&&(G+=oe[M++]<<j,j+=8,G+=oe[M++]<<j,j+=8),Q=q[G&X];t:for(;;){if(ee=Q>>>24,G>>>=ee,j-=ee,ee=Q>>>16&255,ee===0)se[P++]=Q&65535;else if(ee&16){z=Q&65535,ee&=15,ee&&(j<ee&&(G+=oe[M++]<<j,j+=8),z+=G&(1<<ee)-1,G>>>=ee,j-=ee),j<15&&(G+=oe[M++]<<j,j+=8,G+=oe[M++]<<j,j+=8),Q=J[G&Y];i:for(;;){if(ee=Q>>>24,G>>>=ee,j-=ee,ee=Q>>>16&255,ee&16){if(ie=Q&65535,ee&=15,j<ee&&(G+=oe[M++]<<j,j+=8,j<ee&&(G+=oe[M++]<<j,j+=8)),ie+=G&(1<<ee)-1,ie>R){E.msg="invalid distance too far back",S.mode=C;break e}if(G>>>=ee,j-=ee,ee=P-D,ie>ee){if(ee=ie-ee,ee>F&&S.sane){E.msg="invalid distance too far back",S.mode=C;break e}if(re=0,ne=U,k===0){if(re+=O-ee,ee<z){z-=ee;do se[P++]=U[re++];while(--ee);re=P-ie,ne=se}}else if(k<ee){if(re+=O+k-ee,ee-=k,ee<z){z-=ee;do se[P++]=U[re++];while(--ee);if(re=0,k<z){ee=k,z-=ee;do se[P++]=U[re++];while(--ee);re=P-ie,ne=se}}}else if(re+=k-ee,ee<z){z-=ee;do se[P++]=U[re++];while(--ee);re=P-ie,ne=se}for(;z>2;)se[P++]=ne[re++],se[P++]=ne[re++],se[P++]=ne[re++],z-=3;z&&(se[P++]=ne[re++],z>1&&(se[P++]=ne[re++]))}else{re=P-ie;do se[P++]=se[re++],se[P++]=se[re++],se[P++]=se[re++],z-=3;while(z>2);z&&(se[P++]=se[re++],z>1&&(se[P++]=se[re++]))}}else if((ee&64)===0){Q=J[(Q&65535)+(G&(1<<ee)-1)];continue i}else{E.msg="invalid distance code",S.mode=C;break e}break}}else if((ee&64)===0){Q=q[(Q&65535)+(G&(1<<ee)-1)];continue t}else if(ee&32){S.mode=w;break e}else{E.msg="invalid literal/length code",S.mode=C;break e}break}}while(M<I&&P<L);z=j>>3,M-=z,j-=z<<3,G&=(1<<j)-1,E.next_in=M,E.next_out=P,E.avail_in=M<I?5+(I-M):5-(M-I),E.avail_out=P<L?257+(L-P):257-(P-L),S.hold=G,S.bits=j}},{}],8:[function(v,y,x){"use strict";var C=v("../utils/common"),w=v("./adler32"),A=v("./crc32"),E=v("./inffast"),T=v("./inftrees"),S=0,M=1,I=2,P=4,D=5,L=6,R=0,O=1,F=2,k=-2,U=-3,G=-4,j=-5,q=8,J=1,X=2,Y=3,Q=4,ee=5,z=6,ie=7,re=8,ne=9,oe=10,se=11,ae=12,fe=13,de=14,ve=15,pe=16,ce=17,he=18,Ce=19,Se=20,De=21,Oe=22,Ue=23,Xe=24,it=25,ut=26,at=27,Pt=28,Qe=29,ft=30,Ot=31,Xt=32,At=852,bt=592,gt=15,It=gt;function Jt(zi){return(zi>>>24&255)+(zi>>>8&65280)+((zi&65280)<<8)+((zi&255)<<24)}function bi(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new C.Buf16(320),this.work=new C.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Yi(zi){var Ui;return!zi||!zi.state?k:(Ui=zi.state,zi.total_in=zi.total_out=Ui.total=0,zi.msg="",Ui.wrap&&(zi.adler=Ui.wrap&1),Ui.mode=J,Ui.last=0,Ui.havedict=0,Ui.dmax=32768,Ui.head=null,Ui.hold=0,Ui.bits=0,Ui.lencode=Ui.lendyn=new C.Buf32(At),Ui.distcode=Ui.distdyn=new C.Buf32(bt),Ui.sane=1,Ui.back=-1,R)}function ii(zi){var Ui;return!zi||!zi.state?k:(Ui=zi.state,Ui.wsize=0,Ui.whave=0,Ui.wnext=0,Yi(zi))}function ei(zi,Ui){var Gt,$t;return!zi||!zi.state||($t=zi.state,Ui<0?(Gt=0,Ui=-Ui):(Gt=(Ui>>4)+1,Ui<48&&(Ui&=15)),Ui&&(Ui<8||Ui>15))?k:($t.window!==null&&$t.wbits!==Ui&&($t.window=null),$t.wrap=Gt,$t.wbits=Ui,ii(zi))}function Li(zi,Ui){var Gt,$t;return zi?($t=new bi,zi.state=$t,$t.window=null,Gt=ei(zi,Ui),Gt!==R&&(zi.state=null),Gt):k}function Je(zi){return Li(zi,It)}var Nt=!0,yi,ai;function wi(zi){if(Nt){var Ui;for(yi=new C.Buf32(512),ai=new C.Buf32(32),Ui=0;Ui<144;)zi.lens[Ui++]=8;for(;Ui<256;)zi.lens[Ui++]=9;for(;Ui<280;)zi.lens[Ui++]=7;for(;Ui<288;)zi.lens[Ui++]=8;for(T(M,zi.lens,0,288,yi,0,zi.work,{bits:9}),Ui=0;Ui<32;)zi.lens[Ui++]=5;T(I,zi.lens,0,32,ai,0,zi.work,{bits:5}),Nt=!1}zi.lencode=yi,zi.lenbits=9,zi.distcode=ai,zi.distbits=5}function ji(zi,Ui,Gt,$t){var jt,ct=zi.state;return ct.window===null&&(ct.wsize=1<<ct.wbits,ct.wnext=0,ct.whave=0,ct.window=new C.Buf8(ct.wsize)),$t>=ct.wsize?(C.arraySet(ct.window,Ui,Gt-ct.wsize,ct.wsize,0),ct.wnext=0,ct.whave=ct.wsize):(jt=ct.wsize-ct.wnext,jt>$t&&(jt=$t),C.arraySet(ct.window,Ui,Gt-$t,jt,ct.wnext),$t-=jt,$t?(C.arraySet(ct.window,Ui,Gt-$t,$t,0),ct.wnext=$t,ct.whave=ct.wsize):(ct.wnext+=jt,ct.wnext===ct.wsize&&(ct.wnext=0),ct.whave<ct.wsize&&(ct.whave+=jt))),0}function hi(zi,Ui){var Gt,$t,jt,ct,Pe,Ht,si,_t,Yt,Fi,Dt,Lt,Si,nt,wt=0,yt,Tt,Et,ti,ir,or,xr,Tn,Ii=new C.Buf8(4),pr,yn,dn=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!zi||!zi.state||!zi.output||!zi.input&&zi.avail_in!==0)return k;Gt=zi.state,Gt.mode===ae&&(Gt.mode=fe),Pe=zi.next_out,jt=zi.output,si=zi.avail_out,ct=zi.next_in,$t=zi.input,Ht=zi.avail_in,_t=Gt.hold,Yt=Gt.bits,Fi=Ht,Dt=si,Tn=R;e:for(;;)switch(Gt.mode){case J:if(Gt.wrap===0){Gt.mode=fe;break}for(;Yt<16;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if(Gt.wrap&2&&_t===35615){Gt.check=0,Ii[0]=_t&255,Ii[1]=_t>>>8&255,Gt.check=A(Gt.check,Ii,2,0),_t=0,Yt=0,Gt.mode=X;break}if(Gt.flags=0,Gt.head&&(Gt.head.done=!1),!(Gt.wrap&1)||(((_t&255)<<8)+(_t>>8))%31){zi.msg="incorrect header check",Gt.mode=ft;break}if((_t&15)!==q){zi.msg="unknown compression method",Gt.mode=ft;break}if(_t>>>=4,Yt-=4,xr=(_t&15)+8,Gt.wbits===0)Gt.wbits=xr;else if(xr>Gt.wbits){zi.msg="invalid window size",Gt.mode=ft;break}Gt.dmax=1<<xr,zi.adler=Gt.check=1,Gt.mode=_t&512?oe:ae,_t=0,Yt=0;break;case X:for(;Yt<16;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if(Gt.flags=_t,(Gt.flags&255)!==q){zi.msg="unknown compression method",Gt.mode=ft;break}if(Gt.flags&57344){zi.msg="unknown header flags set",Gt.mode=ft;break}Gt.head&&(Gt.head.text=_t>>8&1),Gt.flags&512&&(Ii[0]=_t&255,Ii[1]=_t>>>8&255,Gt.check=A(Gt.check,Ii,2,0)),_t=0,Yt=0,Gt.mode=Y;case Y:for(;Yt<32;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}Gt.head&&(Gt.head.time=_t),Gt.flags&512&&(Ii[0]=_t&255,Ii[1]=_t>>>8&255,Ii[2]=_t>>>16&255,Ii[3]=_t>>>24&255,Gt.check=A(Gt.check,Ii,4,0)),_t=0,Yt=0,Gt.mode=Q;case Q:for(;Yt<16;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}Gt.head&&(Gt.head.xflags=_t&255,Gt.head.os=_t>>8),Gt.flags&512&&(Ii[0]=_t&255,Ii[1]=_t>>>8&255,Gt.check=A(Gt.check,Ii,2,0)),_t=0,Yt=0,Gt.mode=ee;case ee:if(Gt.flags&1024){for(;Yt<16;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}Gt.length=_t,Gt.head&&(Gt.head.extra_len=_t),Gt.flags&512&&(Ii[0]=_t&255,Ii[1]=_t>>>8&255,Gt.check=A(Gt.check,Ii,2,0)),_t=0,Yt=0}else Gt.head&&(Gt.head.extra=null);Gt.mode=z;case z:if(Gt.flags&1024&&(Lt=Gt.length,Lt>Ht&&(Lt=Ht),Lt&&(Gt.head&&(xr=Gt.head.extra_len-Gt.length,Gt.head.extra||(Gt.head.extra=new Array(Gt.head.extra_len)),C.arraySet(Gt.head.extra,$t,ct,Lt,xr)),Gt.flags&512&&(Gt.check=A(Gt.check,$t,Lt,ct)),Ht-=Lt,ct+=Lt,Gt.length-=Lt),Gt.length))break e;Gt.length=0,Gt.mode=ie;case ie:if(Gt.flags&2048){if(Ht===0)break e;Lt=0;do xr=$t[ct+Lt++],Gt.head&&xr&&Gt.length<65536&&(Gt.head.name+=String.fromCharCode(xr));while(xr&&Lt<Ht);if(Gt.flags&512&&(Gt.check=A(Gt.check,$t,Lt,ct)),Ht-=Lt,ct+=Lt,xr)break e}else Gt.head&&(Gt.head.name=null);Gt.length=0,Gt.mode=re;case re:if(Gt.flags&4096){if(Ht===0)break e;Lt=0;do xr=$t[ct+Lt++],Gt.head&&xr&&Gt.length<65536&&(Gt.head.comment+=String.fromCharCode(xr));while(xr&&Lt<Ht);if(Gt.flags&512&&(Gt.check=A(Gt.check,$t,Lt,ct)),Ht-=Lt,ct+=Lt,xr)break e}else Gt.head&&(Gt.head.comment=null);Gt.mode=ne;case ne:if(Gt.flags&512){for(;Yt<16;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if(_t!==(Gt.check&65535)){zi.msg="header crc mismatch",Gt.mode=ft;break}_t=0,Yt=0}Gt.head&&(Gt.head.hcrc=Gt.flags>>9&1,Gt.head.done=!0),zi.adler=Gt.check=0,Gt.mode=ae;break;case oe:for(;Yt<32;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}zi.adler=Gt.check=Jt(_t),_t=0,Yt=0,Gt.mode=se;case se:if(Gt.havedict===0)return zi.next_out=Pe,zi.avail_out=si,zi.next_in=ct,zi.avail_in=Ht,Gt.hold=_t,Gt.bits=Yt,F;zi.adler=Gt.check=1,Gt.mode=ae;case ae:if(Ui===D||Ui===L)break e;case fe:if(Gt.last){_t>>>=Yt&7,Yt-=Yt&7,Gt.mode=at;break}for(;Yt<3;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}switch(Gt.last=_t&1,_t>>>=1,Yt-=1,_t&3){case 0:Gt.mode=de;break;case 1:if(wi(Gt),Gt.mode=Se,Ui===L){_t>>>=2,Yt-=2;break e}break;case 2:Gt.mode=ce;break;case 3:zi.msg="invalid block type",Gt.mode=ft}_t>>>=2,Yt-=2;break;case de:for(_t>>>=Yt&7,Yt-=Yt&7;Yt<32;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if((_t&65535)!==(_t>>>16^65535)){zi.msg="invalid stored block lengths",Gt.mode=ft;break}if(Gt.length=_t&65535,_t=0,Yt=0,Gt.mode=ve,Ui===L)break e;case ve:Gt.mode=pe;case pe:if(Lt=Gt.length,Lt){if(Lt>Ht&&(Lt=Ht),Lt>si&&(Lt=si),Lt===0)break e;C.arraySet(jt,$t,ct,Lt,Pe),Ht-=Lt,ct+=Lt,si-=Lt,Pe+=Lt,Gt.length-=Lt;break}Gt.mode=ae;break;case ce:for(;Yt<14;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if(Gt.nlen=(_t&31)+257,_t>>>=5,Yt-=5,Gt.ndist=(_t&31)+1,_t>>>=5,Yt-=5,Gt.ncode=(_t&15)+4,_t>>>=4,Yt-=4,Gt.nlen>286||Gt.ndist>30){zi.msg="too many length or distance symbols",Gt.mode=ft;break}Gt.have=0,Gt.mode=he;case he:for(;Gt.have<Gt.ncode;){for(;Yt<3;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}Gt.lens[dn[Gt.have++]]=_t&7,_t>>>=3,Yt-=3}for(;Gt.have<19;)Gt.lens[dn[Gt.have++]]=0;if(Gt.lencode=Gt.lendyn,Gt.lenbits=7,pr={bits:Gt.lenbits},Tn=T(S,Gt.lens,0,19,Gt.lencode,0,Gt.work,pr),Gt.lenbits=pr.bits,Tn){zi.msg="invalid code lengths set",Gt.mode=ft;break}Gt.have=0,Gt.mode=Ce;case Ce:for(;Gt.have<Gt.nlen+Gt.ndist;){for(;wt=Gt.lencode[_t&(1<<Gt.lenbits)-1],yt=wt>>>24,Tt=wt>>>16&255,Et=wt&65535,!(yt<=Yt);){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if(Et<16)_t>>>=yt,Yt-=yt,Gt.lens[Gt.have++]=Et;else{if(Et===16){for(yn=yt+2;Yt<yn;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if(_t>>>=yt,Yt-=yt,Gt.have===0){zi.msg="invalid bit length repeat",Gt.mode=ft;break}xr=Gt.lens[Gt.have-1],Lt=3+(_t&3),_t>>>=2,Yt-=2}else if(Et===17){for(yn=yt+3;Yt<yn;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}_t>>>=yt,Yt-=yt,xr=0,Lt=3+(_t&7),_t>>>=3,Yt-=3}else{for(yn=yt+7;Yt<yn;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}_t>>>=yt,Yt-=yt,xr=0,Lt=11+(_t&127),_t>>>=7,Yt-=7}if(Gt.have+Lt>Gt.nlen+Gt.ndist){zi.msg="invalid bit length repeat",Gt.mode=ft;break}for(;Lt--;)Gt.lens[Gt.have++]=xr}}if(Gt.mode===ft)break;if(Gt.lens[256]===0){zi.msg="invalid code -- missing end-of-block",Gt.mode=ft;break}if(Gt.lenbits=9,pr={bits:Gt.lenbits},Tn=T(M,Gt.lens,0,Gt.nlen,Gt.lencode,0,Gt.work,pr),Gt.lenbits=pr.bits,Tn){zi.msg="invalid literal/lengths set",Gt.mode=ft;break}if(Gt.distbits=6,Gt.distcode=Gt.distdyn,pr={bits:Gt.distbits},Tn=T(I,Gt.lens,Gt.nlen,Gt.ndist,Gt.distcode,0,Gt.work,pr),Gt.distbits=pr.bits,Tn){zi.msg="invalid distances set",Gt.mode=ft;break}if(Gt.mode=Se,Ui===L)break e;case Se:Gt.mode=De;case De:if(Ht>=6&&si>=258){zi.next_out=Pe,zi.avail_out=si,zi.next_in=ct,zi.avail_in=Ht,Gt.hold=_t,Gt.bits=Yt,E(zi,Dt),Pe=zi.next_out,jt=zi.output,si=zi.avail_out,ct=zi.next_in,$t=zi.input,Ht=zi.avail_in,_t=Gt.hold,Yt=Gt.bits,Gt.mode===ae&&(Gt.back=-1);break}for(Gt.back=0;wt=Gt.lencode[_t&(1<<Gt.lenbits)-1],yt=wt>>>24,Tt=wt>>>16&255,Et=wt&65535,!(yt<=Yt);){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if(Tt&&(Tt&240)===0){for(ti=yt,ir=Tt,or=Et;wt=Gt.lencode[or+((_t&(1<<ti+ir)-1)>>ti)],yt=wt>>>24,Tt=wt>>>16&255,Et=wt&65535,!(ti+yt<=Yt);){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}_t>>>=ti,Yt-=ti,Gt.back+=ti}if(_t>>>=yt,Yt-=yt,Gt.back+=yt,Gt.length=Et,Tt===0){Gt.mode=ut;break}if(Tt&32){Gt.back=-1,Gt.mode=ae;break}if(Tt&64){zi.msg="invalid literal/length code",Gt.mode=ft;break}Gt.extra=Tt&15,Gt.mode=Oe;case Oe:if(Gt.extra){for(yn=Gt.extra;Yt<yn;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}Gt.length+=_t&(1<<Gt.extra)-1,_t>>>=Gt.extra,Yt-=Gt.extra,Gt.back+=Gt.extra}Gt.was=Gt.length,Gt.mode=Ue;case Ue:for(;wt=Gt.distcode[_t&(1<<Gt.distbits)-1],yt=wt>>>24,Tt=wt>>>16&255,Et=wt&65535,!(yt<=Yt);){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if((Tt&240)===0){for(ti=yt,ir=Tt,or=Et;wt=Gt.distcode[or+((_t&(1<<ti+ir)-1)>>ti)],yt=wt>>>24,Tt=wt>>>16&255,Et=wt&65535,!(ti+yt<=Yt);){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}_t>>>=ti,Yt-=ti,Gt.back+=ti}if(_t>>>=yt,Yt-=yt,Gt.back+=yt,Tt&64){zi.msg="invalid distance code",Gt.mode=ft;break}Gt.offset=Et,Gt.extra=Tt&15,Gt.mode=Xe;case Xe:if(Gt.extra){for(yn=Gt.extra;Yt<yn;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}Gt.offset+=_t&(1<<Gt.extra)-1,_t>>>=Gt.extra,Yt-=Gt.extra,Gt.back+=Gt.extra}if(Gt.offset>Gt.dmax){zi.msg="invalid distance too far back",Gt.mode=ft;break}Gt.mode=it;case it:if(si===0)break e;if(Lt=Dt-si,Gt.offset>Lt){if(Lt=Gt.offset-Lt,Lt>Gt.whave&&Gt.sane){zi.msg="invalid distance too far back",Gt.mode=ft;break}Lt>Gt.wnext?(Lt-=Gt.wnext,Si=Gt.wsize-Lt):Si=Gt.wnext-Lt,Lt>Gt.length&&(Lt=Gt.length),nt=Gt.window}else nt=jt,Si=Pe-Gt.offset,Lt=Gt.length;Lt>si&&(Lt=si),si-=Lt,Gt.length-=Lt;do jt[Pe++]=nt[Si++];while(--Lt);Gt.length===0&&(Gt.mode=De);break;case ut:if(si===0)break e;jt[Pe++]=Gt.length,si--,Gt.mode=De;break;case at:if(Gt.wrap){for(;Yt<32;){if(Ht===0)break e;Ht--,_t|=$t[ct++]<<Yt,Yt+=8}if(Dt-=si,zi.total_out+=Dt,Gt.total+=Dt,Dt&&(zi.adler=Gt.check=Gt.flags?A(Gt.check,jt,Dt,Pe-Dt):w(Gt.check,jt,Dt,Pe-Dt)),Dt=si,(Gt.flags?_t:Jt(_t))!==Gt.check){zi.msg="incorrect data check",Gt.mode=ft;break}_t=0,Yt=0}Gt.mode=Pt;case Pt:if(Gt.wrap&&Gt.flags){for(;Yt<32;){if(Ht===0)break e;Ht--,_t+=$t[ct++]<<Yt,Yt+=8}if(_t!==(Gt.total&4294967295)){zi.msg="incorrect length check",Gt.mode=ft;break}_t=0,Yt=0}Gt.mode=Qe;case Qe:Tn=O;break e;case ft:Tn=U;break e;case Ot:return G;case Xt:default:return k}return zi.next_out=Pe,zi.avail_out=si,zi.next_in=ct,zi.avail_in=Ht,Gt.hold=_t,Gt.bits=Yt,(Gt.wsize||Dt!==zi.avail_out&&Gt.mode<ft&&(Gt.mode<at||Ui!==P))&&ji(zi,zi.output,zi.next_out,Dt-zi.avail_out)?(Gt.mode=Ot,G):(Fi-=zi.avail_in,Dt-=zi.avail_out,zi.total_in+=Fi,zi.total_out+=Dt,Gt.total+=Dt,Gt.wrap&&Dt&&(zi.adler=Gt.check=Gt.flags?A(Gt.check,jt,Dt,zi.next_out-Dt):w(Gt.check,jt,Dt,zi.next_out-Dt)),zi.data_type=Gt.bits+(Gt.last?64:0)+(Gt.mode===ae?128:0)+(Gt.mode===Se||Gt.mode===ve?256:0),(Fi===0&&Dt===0||Ui===P)&&Tn===R&&(Tn=j),Tn)}function Ri(zi){if(!zi||!zi.state)return k;var Ui=zi.state;return Ui.window&&(Ui.window=null),zi.state=null,R}function pt(zi,Ui){var Gt;return!zi||!zi.state||(Gt=zi.state,(Gt.wrap&2)===0)?k:(Gt.head=Ui,Ui.done=!1,R)}function wr(zi,Ui){var Gt=Ui.length,$t,jt,ct;return!zi||!zi.state||($t=zi.state,$t.wrap!==0&&$t.mode!==se)?k:$t.mode===se&&(jt=1,jt=w(jt,Ui,Gt,0),jt!==$t.check)?U:(ct=ji(zi,Ui,Gt,Gt),ct?($t.mode=Ot,G):($t.havedict=1,R))}x.inflateReset=ii,x.inflateReset2=ei,x.inflateResetKeep=Yi,x.inflateInit=Je,x.inflateInit2=Li,x.inflate=hi,x.inflateEnd=Ri,x.inflateGetHeader=pt,x.inflateSetDictionary=wr,x.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":1,"./adler32":3,"./crc32":5,"./inffast":7,"./inftrees":9}],9:[function(v,y,x){"use strict";var C=v("../utils/common"),w=15,A=852,E=592,T=0,S=1,M=2,I=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],P=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],D=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],L=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];y.exports=function(O,F,k,U,G,j,q,J){var X=J.bits,Y=0,Q=0,ee=0,z=0,ie=0,re=0,ne=0,oe=0,se=0,ae=0,fe,de,ve,pe,ce,he=null,Ce=0,Se,De=new C.Buf16(w+1),Oe=new C.Buf16(w+1),Ue=null,Xe=0,it,ut,at;for(Y=0;Y<=w;Y++)De[Y]=0;for(Q=0;Q<U;Q++)De[F[k+Q]]++;for(ie=X,z=w;z>=1&&De[z]===0;z--);if(ie>z&&(ie=z),z===0)return G[j++]=1<<24|64<<16|0,G[j++]=1<<24|64<<16|0,J.bits=1,0;for(ee=1;ee<z&&De[ee]===0;ee++);for(ie<ee&&(ie=ee),oe=1,Y=1;Y<=w;Y++)if(oe<<=1,oe-=De[Y],oe<0)return-1;if(oe>0&&(O===T||z!==1))return-1;for(Oe[1]=0,Y=1;Y<w;Y++)Oe[Y+1]=Oe[Y]+De[Y];for(Q=0;Q<U;Q++)F[k+Q]!==0&&(q[Oe[F[k+Q]]++]=Q);if(O===T?(he=Ue=q,Se=19):O===S?(he=I,Ce-=257,Ue=P,Xe-=257,Se=256):(he=D,Ue=L,Se=-1),ae=0,Q=0,Y=ee,ce=j,re=ie,ne=0,ve=-1,se=1<<ie,pe=se-1,O===S&&se>A||O===M&&se>E)return 1;for(;;){it=Y-ne,q[Q]<Se?(ut=0,at=q[Q]):q[Q]>Se?(ut=Ue[Xe+q[Q]],at=he[Ce+q[Q]]):(ut=32+64,at=0),fe=1<<Y-ne,de=1<<re,ee=de;do de-=fe,G[ce+(ae>>ne)+de]=it<<24|ut<<16|at|0;while(de!==0);for(fe=1<<Y-1;ae&fe;)fe>>=1;if(fe!==0?(ae&=fe-1,ae+=fe):ae=0,Q++,--De[Y]===0){if(Y===z)break;Y=F[k+q[Q]]}if(Y>ie&&(ae&pe)!==ve){for(ne===0&&(ne=ie),ce+=ee,re=Y-ne,oe=1<<re;re+ne<z&&(oe-=De[re+ne],!(oe<=0));)re++,oe<<=1;if(se+=1<<re,O===S&&se>A||O===M&&se>E)return 1;ve=ae&pe,G[ve]=ie<<24|re<<16|ce-j|0}}return ae!==0&&(G[ce+ae]=Y-ne<<24|64<<16|0),J.bits=ie,0}},{"../utils/common":1}],10:[function(v,y,x){"use strict";y.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(v,y,x){"use strict";function C(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}y.exports=C},{}],"/lib/inflate.js":[function(v,y,x){"use strict";var C=v("./zlib/inflate"),w=v("./utils/common"),A=v("./utils/strings"),E=v("./zlib/constants"),T=v("./zlib/messages"),S=v("./zlib/zstream"),M=v("./zlib/gzheader"),I=Object.prototype.toString;function P(R){if(!(this instanceof P))return new P(R);this.options=w.assign({chunkSize:16384,windowBits:0,to:""},R||{});var O=this.options;O.raw&&O.windowBits>=0&&O.windowBits<16&&(O.windowBits=-O.windowBits,O.windowBits===0&&(O.windowBits=-15)),O.windowBits>=0&&O.windowBits<16&&!(R&&R.windowBits)&&(O.windowBits+=32),O.windowBits>15&&O.windowBits<48&&(O.windowBits&15)===0&&(O.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new S,this.strm.avail_out=0;var F=C.inflateInit2(this.strm,O.windowBits);if(F!==E.Z_OK)throw new Error(T[F]);this.header=new M,C.inflateGetHeader(this.strm,this.header)}P.prototype.push=function(R,O){var F=this.strm,k=this.options.chunkSize,U=this.options.dictionary,G,j,q,J,X,Y,Q=!1;if(this.ended)return!1;j=O===~~O?O:O===!0?E.Z_FINISH:E.Z_NO_FLUSH,typeof R=="string"?F.input=A.binstring2buf(R):I.call(R)==="[object ArrayBuffer]"?F.input=new Uint8Array(R):F.input=R,F.next_in=0,F.avail_in=F.input.length;do{if(F.avail_out===0&&(F.output=new w.Buf8(k),F.next_out=0,F.avail_out=k),G=C.inflate(F,E.Z_NO_FLUSH),G===E.Z_NEED_DICT&&U&&(typeof U=="string"?Y=A.string2buf(U):I.call(U)==="[object ArrayBuffer]"?Y=new Uint8Array(U):Y=U,G=C.inflateSetDictionary(this.strm,Y)),G===E.Z_BUF_ERROR&&Q===!0&&(G=E.Z_OK,Q=!1),G!==E.Z_STREAM_END&&G!==E.Z_OK)return this.onEnd(G),this.ended=!0,!1;F.next_out&&(F.avail_out===0||G===E.Z_STREAM_END||F.avail_in===0&&(j===E.Z_FINISH||j===E.Z_SYNC_FLUSH))&&(this.options.to==="string"?(q=A.utf8border(F.output,F.next_out),J=F.next_out-q,X=A.buf2string(F.output,q),F.next_out=J,F.avail_out=k-J,J&&w.arraySet(F.output,F.output,q,J,0),this.onData(X)):this.onData(w.shrinkBuf(F.output,F.next_out))),F.avail_in===0&&F.avail_out===0&&(Q=!0)}while((F.avail_in>0||F.avail_out===0)&&G!==E.Z_STREAM_END);return G===E.Z_STREAM_END&&(j=E.Z_FINISH),j===E.Z_FINISH?(G=C.inflateEnd(this.strm),this.onEnd(G),this.ended=!0,G===E.Z_OK):(j===E.Z_SYNC_FLUSH&&(this.onEnd(E.Z_OK),F.avail_out=0),!0)},P.prototype.onData=function(R){this.chunks.push(R)},P.prototype.onEnd=function(R){R===E.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=w.flattenChunks(this.chunks)),this.chunks=[],this.err=R,this.msg=this.strm.msg};function D(R,O){var F=new P(O);if(F.push(R,!0),F.err)throw F.msg||T[F.err];return F.result}function L(R,O){return O=O||{},O.raw=!0,D(R,O)}x.Inflate=P,x.inflate=D,x.inflateRaw=L,x.ungzip=D},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")});var Uat=Hat;//! Use DXT1 compression. var jae=1;//! Use DXT3 compression. var Gat=1<<1;//! Use DXT5 compression. var jIe=1<<2;//! Use a very slow but very high quality colour compressor. var p9i=1<<8;//! Use a slow but high quality colour compressor (the default). var m9i=1<<3;//! Use a fast but low quality colour compressor. var g9i=1<<4;//! Weight the colour by alpha during cluster fit (disabled by default). var _9i=1<<7,Wat=1<<5;function jat(o,f,m,v){var y=o|f<<8,x=y>>11&31,C=y>>5&63,w=y&31;return m[v+0]=x<<3|x>>2,m[v+1]=C<<2|C>>4,m[v+2]=w<<3|w>>2,m[v+3]=255,y}function rLi(o,f,m,v){for(var y=new Uint8Array(16),x=jat(f[m+0],f[m+1],y,0),C=jat(f[m+2],f[m+3],y,4),w=0;w<3;w++){var A=y[w],E=y[4+w];v&&x<=C?(y[8+w]=(A+E)/2,y[12+w]=0):(y[8+w]=(2*A+E)/3,y[12+w]=(A+2*E)/3)}y[8+3]=255,y[12+3]=v&&x<=C?0:255;for(var T=new Uint8Array(16),w=0;w<4;++w){var S=f[m+4+w];T[4*w+0]=S&3,T[4*w+1]=S>>2&3,T[4*w+2]=S>>4&3,T[4*w+3]=S>>6&3}for(var w=0;w<16;++w)for(var M=4*T[w],I=0;I<4;++I)o[4*w+I]=y[M+I]}function nLi(o,f,m){for(var v=0;v<8;++v){var y=bytes[m+v],x=y&15,C=y&240;o[8*v+3]=x|x<<4,o[8*v+7]=C|C>>4}}function oLi(o,f,A){var v=f[A+0],y=f[A+1],x=new Uint8Array(8);if(x[0]=v,x[1]=y,v<=y){for(var C=1;C<5;++C)x[1+C]=((5-C)*v+C*y)/5;x[6]=0,x[7]=255}else for(var C=1;C<7;++C)x[1+C]=((7-C)*v+C*y)/7;for(var w=new Uint8Array(16),A=A+2,E=0,C=0;C<2;++C){for(var T=0,S=0;S<3;++S){var M=f[A++];T|=M<<8*S}for(var S=0;S<8;++S){var I=T>>3*S&7;w[E++]=I}}for(var C=0;C<16;++C)o[4*C+3]=x[w[C]]}function aLi(o,f,m,v){var y=0;(v&(Gat|jIe))!=0&&(y=8),rLi(o,f,m+y,(v&jae)!=0),(v&Gat)!=0?nLi(o,f,m):(v&jIe)!=0&&oLi(o,f,m)}function sLi(o,f,m,v){for(var y=new Uint16Array(4),x=o,C=0,w=0,A=0,E=0,T=0,S=0,M=0,I=0,P=0,D=f/4,L=m/4,R=0;R<L;R++)for(var O=0;O<D;O++)A=4*((L-R)*D+O),y[0]=v[A],y[1]=v[A+1],E=y[0]&31,T=y[0]&2016,S=y[0]&63488,M=y[1]&31,I=y[1]&2016,P=y[1]&63488,y[2]=5*E+3*M>>3|5*T+3*I>>3&2016|5*S+3*P>>3&63488,y[3]=5*M+3*E>>3|5*I+3*T>>3&2016|5*P+3*S>>3&63488,C=v[A+2],w=R*4*f+O*4,x[w]=y[C&3],x[w+1]=y[C>>2&3],x[w+2]=y[C>>4&3],x[w+3]=y[C>>6&3],w+=f,x[w]=y[C>>8&3],x[w+1]=y[C>>10&3],x[w+2]=y[C>>12&3],x[w+3]=y[C>>14],C=v[A+3],w+=f,x[w]=y[C&3],x[w+1]=y[C>>2&3],x[w+2]=y[C>>4&3],x[w+3]=y[C>>6&3],w+=f,x[w]=y[C>>8&3],x[w+1]=y[C>>10&3],x[w+2]=y[C>>12&3],x[w+3]=y[C>>14];return x}/*! @brief Decompresses an image in memory. @param rgba Storage for the decompressed pixels. @param width The width of the source image. @param height The height of the source image. @param blocks The compressed DXT blocks. @param flags Compression flags. The decompressed pixels will be written as a contiguous array of width*height 16 rgba values, with each component as 1 byte each. In memory this is: { r1, g1, b1, a1, .... , rn, gn, bn, an } for n = width*height The flags parameter should specify either kDxt1, kDxt3 or kDxt5 compression, however, DXT1 will be used by default if none is specified. All other flags are ignored. Internally this function calls squish::Decompress for each block. */function lLi(o,f,m,v,y){for(var x=(y&jae)!=0?8:16,C=0,w=0;w<m;w+=4)for(var A=0;A<f;A+=4){var E=new Uint8Array(64);aLi(E,v,C,y);for(var T=0,S=0;S<4;++S)for(var M=0;M<4;++M){var I=A+M,P=w+S;if(I<f&&P<m)for(var D=4*(f*(m-P)+I),L=0;L<4;++L)o[D++]=E[T++];else T+=4}C+=x}}function Yat(o){}Yat.decode=function(o,f,m,v,y){if(!(o==null||v==null||m==0||f==0)){var x=0;y>11||y===5?x=jIe:x=jae|Wat,x&jae&&x&Wat?sLi(o,f,m,v):lLi(o,f,m,v,x)}};var qat=Yat;var uLi=function(){"use strict";var o="B9h79tEBBBE8fV9gBB9gVUUUUUEU9gIUUUB9gEUEU9gIUUUEUIKQBEEEDDDILLLVE9wEEEVIEBEOWEUEC+Q/IEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBEy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBDe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBIl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBLk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBOL79iv9rBRQ+x8yQDBK/qMEZU8jJJJJBCJ/EB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rADZ1JJJBHWCJ/ABAD9uC/wfBgGOCJDAOCJD6eHdAICEFHLCBHQDNINAQAE9PMEAdAEAQ9rAQAdFAE6eHKDNDNADtMBAKCSFGOC9wgHXAOCL4CIFCD4HMAWCJDFHpCBHSALHZINDNARAZ9rAM9PMBCBHLXIKAZAMFHLDNAXtMBCBHhCBHIINDNARAL9rCk9PMBCBHLXVKAWCJ/CBFAIFHODNDNDNDNDNAZAICO4FrBBAhCOg4CIgpLBEDIBKAO9CB83IBAOCWF9CB83IBXIKAOALrBLALrBBGoCO4GaAaCIsGae86BBAOCEFALCLFAaFGarBBAoCL4CIgGcAcCIsGce86BBAOCDFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCIFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCLFAaAoFGarBBALrBEGoCO4GcAcCIsGce86BBAOCVFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCOFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCRFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCWFAaAoFGarBBALrBDGoCO4GcAcCIsGce86BBAOCdFAaAcFGarBBAoCL4CIgGcAcCIsGce86BBAOCQFAaAcFGarBBAoCD4CIgGcAcCIsGce86BBAOCKFAaAcFGarBBAoCIgGoAoCIsGoe86BBAOCXFAaAoFGorBBALrBIGLCO4GaAaCIsGae86BBAOCMFAoAaFGorBBALCL4CIgGaAaCIsGae86BBAOCpFAoAaFGorBBALCD4CIgGaAaCIsGae86BBAOCSFAoAaFGOrBBALCIgGLALCIsGLe86BBAOALFHLXDKAOALrBWALrBBGoCL4GaAaCSsGae86BBAOCEFALCWFAaFGarBBAoCSgGoAoCSsGoe86BBAOCDFAaAoFGorBBALrBEGaCL4GcAcCSsGce86BBAOCIFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCLFAoAaFGorBBALrBDGaCL4GcAcCSsGce86BBAOCVFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCOFAoAaFGorBBALrBIGaCL4GcAcCSsGce86BBAOCRFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCWFAoAaFGorBBALrBLGaCL4GcAcCSsGce86BBAOCdFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCQFAoAaFGorBBALrBVGaCL4GcAcCSsGce86BBAOCKFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCXFAoAaFGorBBALrBOGaCL4GcAcCSsGce86BBAOCMFAoAcFGorBBAaCSgGaAaCSsGae86BBAOCpFAoAaFGorBBALrBRGLCL4GaAaCSsGae86BBAOCSFAoAaFGOrBBALCSgGLALCSsGLe86BBAOALFHLXEKAOAL8pBB83BBAOCWFALCWF8pBB83BBALCZFHLKAhCDFHhAICZFGIAX6MBKKDNALMBCBHLXIKDNAKtMBAWASFrBBHhCBHOApHIINAIAWCJ/CBFAOFrBBGZCE4CBAZCEg9r7AhFGh86BBAIADFHIAOCEFGOAK9HMBKKApCEFHpALHZASCEFGSAD9HMBKKABAQAD2FAWCJDFAKAD2Z1JJJB8aAWAWCJDFAKCUFAD2FADZ1JJJB8aKAKCBALeAQFHQALMBKC9+HOXEKCBC99ARAL9rADCAADCA0eseHOKAVCJ/EBF8kJJJJBAOK+OoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJEZ+JJJJB8aAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK+lVOEUE99DUD99EUD99DNDNADCL9HMBAEtMEINDNDNjBBBzjBBB+/ABCDFGD8sBB+yAB8sBBGI+yGL+L+TABCEFGV8sBBGO+yGR+L+TGWjBBBB9gGdeAWjBB/+9CAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI86BBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD86BBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD86BBABCLFHBAECUFGEMBXDKKAEtMBINDNDNjBBBzjBBB+/ABCLFGD8uEB+yAB8uEBGI+yGL+L+TABCDFGV8uEBGO+yGR+L+TGWjBBBB9gGdeAWjB/+fsAWAWnjBBBBAWAdeGQAQ+MGKAICU9KeALmGLALnAQAKAOCU9KeARmGQAQnmm+R+VGRnmGW+LjBBB9P9dtMBAW+oHIXEKCJJJJ94HIKADAI87EBDNDNjBBBzjBBB+/AQjBBBB9geAQARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKAVAD87EBDNDNjBBBzjBBB+/ALjBBBB9geALARnmGW+LjBBB9P9dtMBAW+oHDXEKCJJJJ94HDKABAD87EBABCWFHBAECUFGEMBKKK/SILIUI99IUE99DNAEtMBCBHIABHLINDNDNj/zL81zALCOF8uEBGVCIv+y+VGOAL8uEB+ynGRjB/+fsnjBBBzjBBB+/ARjBBBB9gemGW+LjBBB9P9dtMBAW+oHdXEKCJJJJ94HdKALCLF8uEBHQALCDF8uEBHKABAVCEFCIgAIvCETFAd87EBDNDNAOAK+ynGWjB/+fsnjBBBzjBBB+/AWjBBBB9gemGX+LjBBB9P9dtMBAX+oHKXEKCJJJJ94HKKABAVCDFCIgAIvCETFAK87EBDNDNAOAQ+ynGOjB/+fsnjBBBzjBBB+/AOjBBBB9gemGX+LjBBB9P9dtMBAX+oHQXEKCJJJJ94HQKABAVCUFCIgAIvCETFAQ87EBDNDNjBBJzARARn+TAWAWn+TAOAOn+TGRjBBBBARjBBBB9ge+RjB/+fsnjBBBzmGR+LjBBB9P9dtMBAR+oHQXEKCJJJJ94HQKABAVCIgAIvCETFAQ87EBALCWFHLAICLFHIAECUFGEMBKKK6BDNADCD4AE2GEtMBINABABYDBGDCWTCW91+yADCk91ClTCJJJ/8IF++nuDBABCLFHBAECUFGEMBKKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIK/lEEEUDNDNAEABvCIgtMBABHIXEKDNDNADCZ9PMBABHIXEKABHIINAIAEYDBbDBAICLFAECLFYDBbDBAICWFAECWFYDBbDBAICXFAECXFYDBbDBAICZFHIAECZFHEADC9wFGDCS0MBKKADCL6MBINAIAEYDBbDBAECLFHEAICLFHIADC98FGDCI0MBKKDNADtMBINAIAErBB86BBAICEFHIAECEFHEADCUFGDMBKKABK/AEEDUDNDNABCIgtMBABHIXEKAECfEgC+B+C+EW2HLDNDNADCZ9PMBABHIXEKABHIINAIALbDBAICXFALbDBAICWFALbDBAICLFALbDBAICZFHIADC9wFGDCS0MBKKADCL6MBINAIALbDBAICLFHIADC98FGDCI0MBKKDNADtMBINAIAE86BBAICEFHIADCUFGDMBKKABKKKEBCJWKLZ9kBB",f="B9h79tEBBBE5V9gBB9gVUUUUUEU9gIUUUB9gDUUB9gEUEUIMXBBEBEEDIDIDLLVE9wEEEVIEBEOWEUEC+Q/aEKR/LEdO9tw9t9vv95DBh9f9f939h79t9f9j9h229f9jT9vv7BB8a9tw79o9v9wT9f9kw9j9v9kw9WwvTw949C919m9mwvBDy9tw79o9v9wT9f9kw9j9v9kw69u9kw949C919m9mwvBLe9tw79o9v9wT9f9kw9j9v9kw69u9kw949Twg91w9u9jwBVl9tw79o9v9wT9f9kw9j9v9kws9p2Twv9P9jTBOk9tw79o9v9wT9f9kw9j9v9kws9p2Twv9R919hTBWl9tw79o9v9wT9f9kw9j9v9kws9p2Twvt949wBQL79iv9rBKQ/j6XLBZIK9+EVU8jJJJJBCZ9rHBCBHEINCBHDCBHIINABCWFADFAICJUAEAD4CEgGLe86BBAIALFHIADCEFGDCW9HMBKAEC+Q+YJJBFAI86BBAECITC+Q1JJBFAB8pIW83IBAECEFGECJD9HMBKK1HLSUD97EUO978jJJJJBCJ/KB9rGV8kJJJJBC9+HODNADCEFAL0MBCUHOAIrBBC+gE9HMBAVAIALFGRAD9rAD/8QBBCJ/ABAD9uC/wfBgGOCJDAOCJD6eHWAICEFHOCBHdDNINAdAE9PMEAWAEAd9rAdAWFAE6eHQDNDNADtMBAQCSFGLC9wgGKCI2HXAKCETHMALCL4CIFCD4HpCBHSINAOHZCBHhDNINDNARAZ9rAp9PMBCBHOXVKAVCJ/CBFAhAK2FHoAZApFHOCBHIDNAKC/AB6MBARAO9rC/gB6MBCBHLINAoALFHIDNDNDNDNDNAZALCO4FrBBGaCIgpLBEDIBKAICBPhPKLBXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLBAOCZFHOKDNDNDNDNDNAaCD4CIgpLBEDIBKAICBPhPKLZXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLZAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLZAOCZFHOKDNDNDNDNDNAaCL4CIgpLBEDIBKAICBPhPKLAXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLAAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAIAOPBBBPKLAAOCZFHOKDNDNDNDNDNAaCO4pLBEDIBKAICBPhPKL8wXIKAIAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCLFAlPqBFAaC+Q+YJJBFrBBFHOXDKAIAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBAaC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGaCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKL8wAOCWFAlPqBFAaC+Q+YJJBFrBBFHOXEKAIAOPBBBPKL8wAOCZFHOKALC/ABFHIALCJEFAK0MEAIHLARAO9rC/fB0MBKKDNAIAK9PMBAICI4HLINDNARAO9rCk9PMBCBHOXRKAoAIFHaDNDNDNDNDNAZAICO4FrBBALCOg4CIgpLBEDIBKAaCBPhPKLBXIKAaAOPBBLAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlGcCDP+MEAcPMBZEhDoIaLcVxOqRlC+D+G+MkPhP9OGxCIPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCLFAlPqBFAqC+Q+YJJBFrBBFHOXDKAaAOPBBWAOPBBBGcCLP+MEAcPMBZEhDoIaLcVxOqRlC+P+e+8/4BPhP9OGxCSPSP8jGcP5B9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBAqC+Q+YJJBFPBBBGlAlPMBBBBBBBBBBBBBBBBAcP5E9CJf/8/4/w/g/AB9+9Cu1+nGqCITC+Q1JJBFPBIBP9uPMBEDILVORZhoacxqlPpAxAcP9SPKLBAOCWFAlPqBFAqC+Q+YJJBFrBBFHOXEKAaAOPBBBPKLBAOCZFHOKALCDFHLAICZFGIAK6MBKKDNAOtMBAOHZAhCEFGhCLsMDXEKKCBHOXIKDNAKtMBAVCJDFASFHIAVASFPBDBHlCBHaINAIAVCJ/CBFAaFGLPBLBGxCEP9tAxCEPSGcP9OP9hP9RGxALAKFPBLBGkCEP9tAkAcP9OP9hP9RGkPMBZEhDoIaLcVxOqRlGyALAMFPBLBG8aCEP9tA8aAcP9OP9hP9RG8aALAXFPBLBGeCEP9tAeAcP9OP9hP9RGePMBZEhDoIaLcVxOqRlG3PMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIAlP9uGlPeBbDBAIADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAyA3PMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWkdyQ8aKeX3M5p8eS8fGxA8aAePMWkdyQ8aKeX3M5p8eS8fGkPMBEZhDIoaLVcxORqlGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFGLAlAxAkPMWdkyQK8aeXM35pS8e8fGcAcPMBEDIBEDIBEDIBEDIP9uGlPeBbDBALADFGLAlAcAcPMLVORLVORLVORLVORP9uGlPeBbDBALADFGLAlAcAcPMWdQKWdQKWdQKWdQKP9uGlPeBbDBALADFGLAlAcAcPMXMpSXMpSXMpSXMpSP9uGlPeBbDBALADFHIAaCZFGaAK6MBKKASCLFGSAD6MBKKABAdAD2FAVCJDFAQAD2/8QBBAVAVCJDFAQCUFAD2FAD/8QBBKAQCBAOeAdFHdAOMBKC9+HOXEKCBC99ARAO9rADCAADCA0eseHOKAVCJ/KBF8kJJJJBAOKWBZ+BJJJBK+KoEZU8jJJJJBC/AE9rGV8kJJJJBC9+HODNAECI9uGRChFAL0MBCUHOAIrBBGWC/wEgC/gE9HMBAWCSgGdCE0MBAVC/ABFCfECJE/8KBAVCuF9CU83IBAVC8wF9CU83IBAVCYF9CU83IBAVCAF9CU83IBAVCkF9CU83IBAVCZF9CU83IBAV9CU83IWAV9CU83IBAIALFC9wFHQAICEFGWARFHKDNAEtMBCMCSAdCEseHXABHICBHdCBHMCBHpCBHLCBHOINDNAKAQ9NMBC9+HOXIKDNDNAWrBBGRC/vE0MBAVC/ABFARCL4CU7AOFCSgCITFGSYDLHZASYDBHhDNARCSgGSAX9PMBAVARCU7ALFCSgCDTFYDBAdASeHRAStHSDNDNADCD9HMBABAh87EBABCLFAR87EBABCDFAZ87EBXEKAIAhbDBAICWFARbDBAICLFAZbDBKAdASFHdAVC/ABFAOCITFGoARbDBAoAZbDLAVALCDTFARbDBAVC/ABFAOCEFCSgGOCITFGZAhbDBAZARbDLALASFHLAOCEFHOXDKDNDNASCSsMBAMASFASC987FCEFHMXEKAK8sBBGSCfEgHRDNDNASCU9MMBAKCEFHKXEKAK8sBEGSCfBgCRTARCfBgvHRDNASCU9MMBAKCDFHKXEKAK8sBDGSCfBgCpTARvHRDNASCU9MMBAKCIFHKXEKAK8sBIGSCfBgCxTARvHRDNASCU9MMBAKCLFHKXEKAKrBLC3TARvHRAKCVFHKKARCE4CBARCEg9r7AMFHMKDNDNADCD9HMBABAh87EBABCLFAM87EBABCDFAZ87EBXEKAIAhbDBAICWFAMbDBAICLFAZbDBKAVC/ABFAOCITFGRAMbDBARAZbDLAVALCDTFAMbDBAVC/ABFAOCEFCSgGOCITFGRAhbDBARAMbDLALCEFHLAOCEFHOXEKDNARCPE0MBAVALAQARCSgFrBBGSCL4GZ9rCSgCDTFYDBAdCEFGhAZeHRAVALAS9rCSgCDTFYDBAhAZtGoFGhASCSgGZeHSAZtHZDNDNADCD9HMBABAd87EBABCLFAS87EBABCDFAR87EBXEKAIAdbDBAICWFASbDBAICLFARbDBKAVALCDTFAdbDBAVC/ABFAOCITFGaARbDBAaAdbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALAoFCSgGLCDTFASbDBAVC/ABFAOCDFCSgGOCITFGRAdbDBARASbDLAOCEFHOALAZFHLAhAZFHdXEKAdCBAKrBBGaeGZARC/+EsGcFHRAaCSgHhDNDNAaCL4GoMBARCEFHSXEKARHSAVALAo9rCSgCDTFYDBHRKDNDNAhMBASCEFHdXEKASHdAVALAa9rCSgCDTFYDBHSKDNDNActMBAKCEFHaXEKAK8sBEGaCfEgHZDNDNAaCU9MMBAKCDFHaXEKAK8sBDGaCfBgCRTAZCfBgvHZDNAaCU9MMBAKCIFHaXEKAK8sBIGaCfBgCpTAZvHZDNAaCU9MMBAKCLFHaXEKAK8sBLGaCfBgCxTAZvHZDNAaCU9MMBAKCVFHaXEKAKCOFHaAKrBVC3TAZvHZKAZCE4CBAZCEg9r7AMFGMHZKDNDNAoCSsMBAaHcXEKAa8sBBGKCfEgHRDNDNAKCU9MMBAaCEFHcXEKAa8sBEGKCfBgCRTARCfBgvHRDNAKCU9MMBAaCDFHcXEKAa8sBDGKCfBgCpTARvHRDNAKCU9MMBAaCIFHcXEKAa8sBIGKCfBgCxTARvHRDNAKCU9MMBAaCLFHcXEKAaCVFHcAarBLC3TARvHRKARCE4CBARCEg9r7AMFGMHRKDNDNAhCSsMBAcHKXEKAc8sBBGKCfEgHSDNDNAKCU9MMBAcCEFHKXEKAc8sBEGKCfBgCRTASCfBgvHSDNAKCU9MMBAcCDFHKXEKAc8sBDGKCfBgCpTASvHSDNAKCU9MMBAcCIFHKXEKAc8sBIGKCfBgCxTASvHSDNAKCU9MMBAcCLFHKXEKAcCVFHKAcrBLC3TASvHSKASCE4CBASCEg9r7AMFGMHSKDNDNADCD9HMBABAZ87EBABCLFAS87EBABCDFAR87EBXEKAIAZbDBAICWFASbDBAICLFARbDBKAVC/ABFAOCITFGaARbDBAaAZbDLAVALCDTFAZbDBAVC/ABFAOCEFCSgCITFGaASbDBAaARbDLAVALCEFGLCSgCDTFARbDBAVC/ABFAOCDFCSgCITFGRAZbDBARASbDLAVALAotAoCSsvFGLCSgCDTFASbDBALAhtAhCSsvFHLAOCIFHOKAWCEFHWABCOFHBAICXFHIAOCSgHOALCSgHLApCIFGpAE6MBKKCBC99AKAQseHOKAVC/AEF8kJJJJBAOK/tLEDU8jJJJJBCZ9rHVC9+HODNAECVFAL0MBCUHOAIrBBC/+EgC/QE9HMBAV9CB83IWAICEFHOAIALFC98FHIDNAEtMBDNADCDsMBINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKAVCWFALCEgCDTvGDALCD4CBALCE4CEg9r7ADYDBFGLbDBABALbDBABCLFHBAECUFGEMBXDKKINDNAOAI6MBC9+SKAO8sBBGDCfEgHLDNDNADCU9MMBAOCEFHOXEKAO8sBEGDCfBgCRTALCfBgvHLDNADCU9MMBAOCDFHOXEKAO8sBDGDCfBgCpTALvHLDNADCU9MMBAOCIFHOXEKAO8sBIGDCfBgCxTALvHLDNADCU9MMBAOCLFHOXEKAOrBLC3TALvHLAOCVFHOKABALCD4CBALCE4CEg9r7AVCWFALCEgCDTvGLYDBFGD87EBALADbDBABCDFHBAECUFGEMBKKCBC99AOAIseHOKAOK/xVDIUO978jJJJJBCA9rGI8kJJJJBDNDNADCL9HMBDNAEC98gGLtMBABHDCBHVINADADPBBBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKBBADCZFHDAVCLFGVAL6MBKKALAE9PMEAIAECIgGVCDTGDvCBCZAD9r/8KBAIABALCDTFGLAD/8QBBDNAVtMBAIAIPBLBGOCkP+rECkP+sEP/6EGRAOCWP+rECkP+sEP/6EARP/gEAOCZP+rECkP+sEP/6EGWP/gEP/kEP/lEGdCBPhP+2EGQARCJJJJ94PhGKP9OP9RP/kEGRjBB/+9CPaARARP/mEAdAdP/mEAWAQAWAKP9OP9RP/kEGRARP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGQP/kECfEPhP9OAOCJJJ94PhP9OP9QARAWP/mEAQP/kECWP+rECJ/+IPhP9OP9QAdAWP/mEAQP/kECZP+rECJJ/8RPhP9OP9QPKLBKALAIAD/8QBBXEKABAEC98gGDZ+HJJJBADAE9PMBAIAECIgGLCITGVFCBCAAV9r/8KBAIABADCITFGDAV/8QBBAIALZ+HJJJBADAIAV/8QBBKAICAF8kJJJJBK+yIDDUR97DNAEtMBCBHDINABCZFGIAIPBBBGLCBPhGVCJJ98P3ECJJ98P3IGOP9OABPBBBGRALPMLVORXMpScxql358e8fCffEPhP9OP/6EARALPMBEDIWdQKZhoaky8aeGLCZP+sEP/6EGWP/gEALCZP+rECZP+sEP/6EGdP/gEP/kEP/lEGLjB/+fsPaAdALAVP+2EGVAdCJJJJ94PhGQP9OP9RP/kEGdAdP/mEALALP/mEAWAVAWAQP9OP9RP/kEGLALP/mEP/kEP/kEP/jEP/nEGWP/mEjBBN0PaGVP/kECZP+rEAdAWP/mEAVP/kECffIPhP9OP9QGdALAWP/mEAVP/kECUPSCBPlDCBPlICBPlOCBPlRCBPlQCBPlKCBPlpCBPlSP9OGLPMWdkyQK8aeXM35pS8e8fP9QPKBBABARAOP9OAdALPMBEZhDIoaLVcxORqlP9QPKBBABCAFHBADCLFGDAE6MBKKK94EIU8jJJJJBCA9rGI8kJJJJBABAEC98gGLZ+JJJJBDNALAE9PMBAIAECIgGVCITGEFCBCAAE9r/8KBAIABALCITFGBAE/8QBBAIAVZ+JJJJBABAIAE/8QBBKAICAF8kJJJJBK/hILDUE97EUV978jJJJJBCZ9rHDDNAEtMBCBHIINADABPBBBGLABCZFGVPBBBGOPMLVORXMpScxql358e8fGRCZP+sEGWCLP+rEPKLBABjBBJzPaj/zL81zPaAWCIPhP9QP/6EP/nEGWALAOPMBEDIWdQKZhoaky8aeGLCZP+rECZP+sEP/6EP/mEGOAOP/mEAWALCZP+sEP/6EP/mEGdAdP/mEAWARCZP+rECZP+sEP/6EP/mEGRARP/mEP/kEP/kEP/lECBPhP+4EP/jEjB/+fsPaGWP/mEjBBN0PaGLP/kECffIPhGQP9OAdAWP/mEALP/kECZP+rEP9QGdARAWP/mEALP/kECZP+rEAOAWP/mEALP/kEAQP9OP9QGWPMBEZhDIoaLVcxORqlGLP5BADPBLBPeB+t+J83IBABCWFALP5EADPBLBPeE+t+J83IBAVAdAWPMWdkyQK8aeXM35pS8e8fGWP5BADPBLBPeD+t+J83IBABCkFAWP5EADPBLBPeI+t+J83IBABCAFHBAICLFGIAE6MBKKK/3EDIUE978jJJJJBC/AB9rHIDNADCD4AE2GLC98gGVtMBCBHDABHEINAEAEPBBBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKBBAECZFHEADCLFGDAV6MBKKDNAVAL9PMBAIALCIgGDCDTGEvCBC/ABAE9r/8KBAIABAVCDTFGVAE/8QBBDNADtMBAIAIPBLBGOCWP+rECWP+sEP/6EAOCkP+sEClP+rECJJJ/8IPhP+uEP/mEPKLBKAVAIAE/8QBBKK9TEIUCBCBYDJ1JJBGEABCIFC98gFGBbDJ1JJBDNDNABzBCZTGD9NMBCUHIABAD9rCffIFCZ4NBCUsMEKAEHIKAIKKKEBCJWKLZ9tBB",m=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),v=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var y=o;WebAssembly.validate(m)&&(y=f);var x,C=WebAssembly.instantiate(w(y),{}).then(function(S){x=S.instance,x.exports.__wasm_call_ctors()});function w(S){for(var M=new Uint8Array(S.length),I=0;I<S.length;++I){var P=S.charCodeAt(I);M[I]=P>96?P-71:P>64?P-65:P>47?P+4:P>46?63:62}for(var D=0,I=0;I<S.length;++I)M[D++]=M[I]<60?v[M[I]]:(M[I]-60)*64+M[++I];return M.buffer.slice(0,D)}function A(S,M,I,P,D,L){var R=x.exports.sbrk,O=I+3&-4,F=R(O*P),k=R(D.length),U=new Uint8Array(x.exports.memory.buffer);U.set(D,k);var G=S(F,I,P,k,D.length);if(G==0&&L&&L(F,O,P),M.set(U.subarray(F,F+I*P)),R(F-R(0)),G!=0)throw new Error("Malformed buffer data: "+G)}var E={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},T={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return{ready:C,supported:!0,decodeVertexBuffer:function(S,M,I,P,D){A(x.exports.meshopt_decodeVertexBuffer,S,M,I,P,x.exports[E[D]])},decodeIndexBuffer:function(S,M,I,P){A(x.exports.meshopt_decodeIndexBuffer,S,M,I,P)},decodeIndexSequence:function(S,M,I,P){A(x.exports.meshopt_decodeIndexSequence,S,M,I,P)},decodeGltfBuffer:function(S,M,I,P,D,L){A(x.exports[T[D]],S,M,I,P,x.exports[E[L]])}}}(),YIe=uLi;function K6(){}K6.s3tc=!0;K6.pvrtc=!1;K6.etc1=!1;var f4={SV_Unkown:0,SV_Standard:1,SV_Compressed:2,SV_DracoCompressed:3},qIe={Standard:0,Draco:1,MeshOpt:2},cLi={0:Uint32Array.BYTES_PER_ELEMENT,1:Float32Array.BYTES_PER_ELEMENT,2:Float64Array.BYTES_PER_ELEMENT},Yae={LUMINANCE_8:1,LUMINANCE_16:2,ALPHA:3,ALPHA_4_LUMINANCE_4:4,LUMINANCE_ALPHA:5,RGB_565:6,BGR565:7,RGB:10,BGR:11,ARGB:12,ABGR:13,BGRA:14,WEBP:25,RGBA:28,DXT1:17,DXT2:18,DXT3:19,DXT4:20,DXT5:21,CRN_DXT5:26,STANDARD_CRN:27},DO={SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32},Qg={Invalid:0,Position:1,PositionW:2,Normal:4,Tangent:8,FirstTexcoord:16,SecondTexcoord:32,Color:64,SecondColor:128,Custom0:512,Custom1:1024};function hLi(o,f){let m=new Uint8Array(o,f);return Uat.inflate(m).buffer}function Jat(o,v,y){var v=0,y=o.byteLength,x="utf-8";o=o.subarray(v,v+y);var C=new TextDecoder(x);return C.decode(o)}function _P(o,f,m){let v=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let y=new Uint8Array(o,m,v),x=Jat(y);return m+=v,{string:x,bytesOffset:m,length:v}}function dLi(o,f,m,v){let y={},x=[],C=new Array(16);for(let A=0;A<16;A++)C[A]=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;y.matrix=C,y.skeletonNames=x;let w=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let A=0;A<w;A++){let E=_P(o,f,m);x.push(E.string),m=E.bytesOffset}return v.push(y),m}function fLi(o,f,m,v,y){let x={};x.rangeList=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,x.rangeMode=f.getUint16(m,!0),m+=Uint16Array.BYTES_PER_ELEMENT;let C={};C.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,C.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,C.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let w=f.getFloat64(m,!0);if(m+=Float64Array.BYTES_PER_ELEMENT,x.boundingSphere={center:C,radius:w},y===3){let M={};M.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,M.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,M.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let I={};I.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,I.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,I.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let P={};P.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,P.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,P.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let D={};D.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,D.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,D.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,x.obb={xExtent:I,yExtent:P,zExtent:D,obbCenter:M}}let A=_P(o,f,m),E=A.string;m=A.bytesOffset;let T=E.indexOf("Geometry");if(T!==-1){let M=E.substring(T);E=E.replace(M,"")}x.childTile=E,x.geodes=[];let S=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let M=0;M<S;M++)m=dLi(o,f,m,x.geodes);return v.push(x),y===3&&(m=_P(o,f,m).bytesOffset),m}function pLi(o,f,m,v){let y={},x=[],C=[],w=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let A=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let T=0;T<A;T++)m=fLi(o,f,m,C,v.version);y.pageLods=C;let E=m%4;return E!==0&&(m+=4-E),v.groupNode=y,m}function Kat(o,f,m,v){let y=f.getUint32(m,!0);if(v.verticesCount=y,m+=Uint32Array.BYTES_PER_ELEMENT,m<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);C=x*Float32Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;let w=y*x*Float32Array.BYTES_PER_ELEMENT,A=new Uint8Array(o,m,w);m+=w;let E=v.vertexAttributes,T=v.attrLocation;return T.aPosition=E.length,E.push({index:T.aPosition,typedArray:A,componentsPerAttribute:x,componentDatatype:5126,offsetInBytes:0,strideInBytes:C,normalize:!1}),m}function Qat(o,f,m,v){let y=f.getUint32(m,!0);if(m+=Uint32Array.BYTES_PER_ELEMENT,y<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let w=y*x*Float32Array.BYTES_PER_ELEMENT,A=new Uint8Array(o,m,w);m+=w;let E=v.vertexAttributes,T=v.attrLocation;return T.aNormal=E.length,E.push({index:T.aNormal,typedArray:A,componentsPerAttribute:x,componentDatatype:5126,offsetInBytes:0,strideInBytes:C,normalize:!1}),m}function Zat(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let x=v.verticesCount,C;if(y>0){let E=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint8Array.BYTES_PER_ELEMENT*2;let T=y*Uint8Array.BYTES_PER_ELEMENT*4;C=new Uint8Array(o,m,T).slice(0,T),m+=T}else{C=new Uint8Array(4*x);for(let E=0;E<x;E++)C[E*4]=255,C[E*4+1]=255,C[E*4+2]=255,C[E*4+3]=255}let w=v.vertexAttributes,A=v.attrLocation;return A.aColor=w.length,w.push({index:A.aColor,typedArray:C,componentsPerAttribute:4,componentDatatype:5121,offsetInBytes:0,strideInBytes:4,normalize:!0}),v.vertexColor=C,m}function $at(o,f,m,v){let y=f.getUint32(m,!0);if(m+=Uint32Array.BYTES_PER_ELEMENT,y<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint8Array.BYTES_PER_ELEMENT*2;let C=y*Uint8Array.BYTES_PER_ELEMENT*4,w=new Uint8Array(o,m,C);m+=C;let A=v.vertexAttributes,E=v.attrLocation;return E.aSecondColor=A.length,A.push({index:E.aSecondColor,typedArray:w,componentsPerAttribute:4,componentDatatype:5121,offsetInBytes:0,strideInBytes:4,normalize:!0}),m}function est(o,f,m,v){let y=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;for(let x=0;x<y;x++){let C=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let w=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let A=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let E=C*w*Float32Array.BYTES_PER_ELEMENT,T=new Uint8Array(o,m,E);m+=E;let S="aTexCoord"+x,M=v.vertexAttributes,I=v.attrLocation;I[S]=M.length,M.push({index:I[S],typedArray:T,componentsPerAttribute:w,componentDatatype:5126,offsetInBytes:0,strideInBytes:w*Float32Array.BYTES_PER_ELEMENT,normalize:!1})}return m}function tst(o,f,m,v){let y=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;let x=v.vertexAttributes,C=v.attrLocation;for(let w=0;w<y;w++){let A=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let E=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let T=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let S=A*E*Float32Array.BYTES_PER_ELEMENT;if(E===17||E===29){let M=new Uint8Array(o,m,S);v.instanceCount=A,v.instanceMode=E,v.instanceBuffer=M,v.instanceIndex=1;let I=E*A*4,P=M.slice(0,I);v.vertexColorInstance=P;let D;E===17?(D=Float32Array.BYTES_PER_ELEMENT*17,C.uv2=x.length,x.push({index:C.uv2,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:0,strideInBytes:D,instanceDivisor:1}),C.uv3=x.length,x.push({index:C.uv3,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv4=x.length,x.push({index:C.uv4,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.secondary_colour=x.length,x.push({index:C.secondary_colour,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv6=x.length,x.push({index:C.uv6,componentsPerAttribute:4,componentDatatype:5121,normalize:!0,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1})):E===29&&(D=Float32Array.BYTES_PER_ELEMENT*29,C.uv1=x.length,x.push({index:C.uv1,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:0,strideInBytes:D,instanceDivisor:1,byteLength:S}),C.uv2=x.length,x.push({index:C.uv2,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:4*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv3=x.length,x.push({index:C.uv3,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:8*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv4=x.length,x.push({index:C.uv4,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:12*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv5=x.length,x.push({index:C.uv5,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:16*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv6=x.length,x.push({index:C.uv6,componentsPerAttribute:4,componentDatatype:5126,normalize:!1,offsetInBytes:20*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv7=x.length,x.push({index:C.uv7,componentsPerAttribute:3,componentDatatype:5126,normalize:!1,offsetInBytes:24*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.secondary_colour=x.length,x.push({index:C.secondary_colour,componentsPerAttribute:4,componentDatatype:5121,normalize:!0,offsetInBytes:27*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}),C.uv9=x.length,x.push({index:C.uv9,componentsPerAttribute:4,componentDatatype:5121,normalize:!0,offsetInBytes:28*Float32Array.BYTES_PER_ELEMENT,strideInBytes:D,instanceDivisor:1}))}else{let M=A*E;v.instanceBounds=new Float32Array(M);for(let I=0;I<M;I++)v.instanceBounds[I]=f.getFloat32(m+I*Float32Array.BYTES_PER_ELEMENT,!0)}m+=S}return m}function mLi(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let x=0;x<y;x++){let C=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let w=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let A=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let E=C*w*cLi[A],T=new Uint8Array(o,m,E);m+=E;let S=v.vertexAttributes,M=v.attrLocation,I="aCustom"+x;M[I]=S.length,S.push({index:M[I],typedArray:T,componentsPerAttribute:w,componentDatatype:5126,offsetInBytes:0,strideInBytes:0,normalize:!1})}return m}function gLi(o,f,m,v){let y=f.getUint32(m,!0);if(v.verticesCount=y,m+=Uint32Array.BYTES_PER_ELEMENT,m<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);C=x*Int16Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;let w=f.getFloat32(m,!0);m+=Float32Array.BYTES_PER_ELEMENT;let A={};A.x=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,A.y=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,A.z=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,A.w=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,v.vertCompressConstant=w,v.minVerticesValue=A;let E=y*x*Int16Array.BYTES_PER_ELEMENT,T=new Uint8Array(o,m,E);m+=E;let S=v.vertexAttributes,M=v.attrLocation;return M.aPosition=S.length,S.push({index:M.aPosition,typedArray:T,componentsPerAttribute:x,componentDatatype:5122,offsetInBytes:0,strideInBytes:C,normalize:!1}),m}function _Li(o,f,m,v){let y=f.getUint32(m,!0);if(m+=Uint32Array.BYTES_PER_ELEMENT,y<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let w=y*2*Int16Array.BYTES_PER_ELEMENT,A=new Uint8Array(o,m,w);m+=w;let E=v.vertexAttributes,T=v.attrLocation;return T.aNormal=E.length,E.push({index:T.aNormal,typedArray:A,componentsPerAttribute:2,componentDatatype:5122,offsetInBytes:0,strideInBytes:C,normalize:!1}),m}function vLi(o,f,m,v){v.texCoordCompressConstant=[],v.minTexCoordValue=[];let y=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT,m+=Uint16Array.BYTES_PER_ELEMENT;for(let x=0;x<y;x++){let C=f.getUint8(m,!0);m+=Uint8Array.BYTES_PER_ELEMENT,m+=Uint8Array.BYTES_PER_ELEMENT*3;let w=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let A=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let E=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let T=f.getFloat32(m,!0);m+=Float32Array.BYTES_PER_ELEMENT,v.texCoordCompressConstant.push(T);let S={};S.x=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,S.y=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,S.z=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,S.w=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,v.minTexCoordValue.push(S);let M=w*A*Int16Array.BYTES_PER_ELEMENT,I=new Uint8Array(o,m,M);m+=M;let P=m%4;P!==0&&(m+=4-P);let D="aTexCoord"+x,L=v.vertexAttributes,R=v.attrLocation;if(R[D]=L.length,L.push({index:R[D],typedArray:I,componentsPerAttribute:A,componentDatatype:5122,offsetInBytes:0,strideInBytes:A*Int16Array.BYTES_PER_ELEMENT,normalize:!1}),C){M=w*Float32Array.BYTES_PER_ELEMENT;let O=new Uint8Array(o,m,M);m+=M,v.texCoordZMatrix=!0,D="aTexCoordZ"+x,R[D]=L.length,L.push({index:R[D],typedArray:O,componentsPerAttribute:1,componentDatatype:5126,offsetInBytes:0,strideInBytes:Float32Array.BYTES_PER_ELEMENT,normalize:!1})}}return m}function yLi(o,f,m,v){let y=f.getUint32(m,!0);if(m+=Uint32Array.BYTES_PER_ELEMENT,y<=0)return m;let x=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let C=f.getUint16(m,!0);m+=Uint16Array.BYTES_PER_ELEMENT;let w=y*x*Float32Array.BYTES_PER_ELEMENT;return m+=w,m}function xLi(o,f,m,v,y){if(y===3){let x=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT}if(m=Kat(o,f,m,v),m=Qat(o,f,m,v),m=Zat(o,f,m,v),y!==3&&(m=$at(o,f,m,v)),m=est(o,f,m,v),m=tst(o,f,m,v),y===3){m=mLi(o,f,m,v);let x=_P(o,f,m);m=x.bytesOffset,v.customVertexAttribute=JSON.parse(x.string);let C="aCustom"+v.customVertexAttribute.TextureCoordMatrix,w="aCustom"+v.customVertexAttribute.VertexWeight;v.attrLocation[C]!==void 0&&(v.attrLocation.aTextureCoordMatrix=v.attrLocation[C],delete v.attrLocation[C]),v.attrLocation[w]!==void 0&&(v.attrLocation.aVertexWeight=v.attrLocation[w],delete v.attrLocation[w]);let A=m%4;A&&(A=4-A),m+=A,m=yLi(o,f,m,v)}return m}function CLi(o,f,m,v,y,x){let C=0,w,A=y.vertexAttributes,E=y.attrLocation;switch(f){case Qg.Normal:case Qg.FirstTexcoord:case Qg.SecondTexcoord:C=Uint16Array.BYTES_PER_ELEMENT*2,(x&16)===0&&(f===Qg.FirstTexcoord||f===Qg.SecondTexcoord)&&(C=Float32Array.BYTES_PER_ELEMENT*2),w=new Uint8Array(o*C);break;case Qg.Color:case Qg.SecondColor:C=Uint8Array.BYTES_PER_ELEMENT*4,w=new Uint8Array(o*4);break;case Qg.Custom0:C=Float32Array.BYTES_PER_ELEMENT*m,w=new Uint8Array(o*m*4);break;case Qg.Custom1:C=Float32Array.BYTES_PER_ELEMENT*m,w=new Uint8Array(o*m*4);break;default:C=Uint16Array.BYTES_PER_ELEMENT*4,w=new Uint8Array(o*C);break}YIe.decodeVertexBuffer(w,o,C,v,v.length);let T,S,M;switch(f){case Qg.Position:E.aPosition=A.length,A.push({index:E.aPosition,typedArray:new Uint16Array(w.buffer,0,w.length/2),componentsPerAttribute:4,componentDatatype:5122,offsetInBytes:0,strideInBytes:0,normalize:!1}),y.verticesCount=o;break;case Qg.Normal:E.aNormal=A.length,A.push({index:E.aNormal,typedArray:new Int16Array(w.buffer,0,w.length/2),componentsPerAttribute:2,componentDatatype:5122,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case Qg.FirstTexcoord:(x&16)===0?(M=5126,S=Float32Array,T=new Float32Array(w.buffer,0,w.length/4)):(M=5122,S=Uint16Array,T=new Uint16Array(w.buffer,0,w.length/2)),E.aTexCoord0=A.length,A.push({index:E.aTexCoord0,typedArray:T,componentsPerAttribute:2,componentDatatype:M,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case Qg.SecondTexcoord:(x&16)===0?(M=5126,S=Float32Array,T=new Float32Array(w.buffer,0,w.length/4)):(M=5122,S=Uint16Array,T=new Uint16Array(w.buffer,0,w.length/2)),E.aTexCoord1=A.length,A.push({index:E.aTexCoord1,typedArray:T,componentsPerAttribute:2,componentDatatype:M,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case Qg.Color:E.aColor=A.length,A.push({index:E.aColor,typedArray:w,componentsPerAttribute:4,componentDatatype:5121,offsetInBytes:0,strideInBytes:0,normalize:!0});break;case Qg.SecondColor:E.aSecondColor=A.length,A.push({index:E.aSecondColor,typedArray:w,componentsPerAttribute:4,componentDatatype:5120,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case Qg.Custom0:E.aCustom0=A.length,A.push({index:E.aCustom0,typedArray:new Float32Array(w.buffer,0,w.length/4),componentsPerAttribute:m,componentDatatype:5126,offsetInBytes:0,strideInBytes:0,normalize:!1});break;case Qg.Custom1:E.aCustom1=A.length,A.push({index:E.aCustom1,typedArray:new Float32Array(w.buffer,0,w.length/4),componentsPerAttribute:m,componentDatatype:5126,offsetInBytes:0,strideInBytes:0,normalize:!1});break;default:break}}function bLi(o,f,m,v,y){let x=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT,v.compressOptions=x;let C=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT,v.minVerticesValue={x:0,y:0,z:0,w:0},v.minTexCoordValue=[{x:0,y:0},{x:0,y:0}],v.texCoordCompressConstant=[{x:0,y:0,z:0},{x:0,y:0,z:0}];let w=[];for(let A=0;A<C;A++){let E=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT,v.vertCompressConstant=f.getFloat32(m,!0),m+=Float32Array.BYTES_PER_ELEMENT,v.minVerticesValue.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,v.minVerticesValue.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,v.minVerticesValue.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let T=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT;let S=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT;let M=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT;let I=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT;let P=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT;let D=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT;let L=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT;let R=f.getFloat64(m,!0);m+=Float64Array.BYTES_PER_ELEMENT,v.minTexCoordValue[0].x=M,v.minTexCoordValue[0].y=I,v.minTexCoordValue[1].x=L,v.minTexCoordValue[1].y=R,v.texCoordCompressConstant[0].x=T,v.texCoordCompressConstant[0].y=S,v.texCoordCompressConstant[1].x=P,v.texCoordCompressConstant[1].y=D;let O=f.getInt32(m,!0);m+=Int32Array.BYTES_PER_ELEMENT;for(let j=0;j<O;j++){let q=f.getInt32(m,!0);m+=Int32Array.BYTES_PER_ELEMENT;let J=0;(q===Qg.Custom0||q===Qg.Custom1)&&(J=f.getInt32(m,!0),m+=Int32Array.BYTES_PER_ELEMENT);let X=f.getInt32(m,!0);m+=Int32Array.BYTES_PER_ELEMENT;let Y=new Uint8Array(o,m,X);m+=Uint8Array.BYTES_PER_ELEMENT*X;let Q=m%4;Q&&(Q=4-Q),m+=Q,CLi(E,q,J,Y,v,x)}let F=_P(o,f,m);m=F.bytesOffset,v.customVertexAttribute=JSON.parse(F.string);let k="aCustom"+v.customVertexAttribute.TextureCoordMatrix,U="aCustom"+v.customVertexAttribute.VertexWeight;v.attrLocation[k]!==void 0&&(v.attrLocation.aTextureCoordMatrix=v.attrLocation[k],A===C-1&&delete v.attrLocation[k]),v.attrLocation[U]!==void 0&&(v.attrLocation.aVertexWeight=v.attrLocation[U],A===C-1&&delete v.attrLocation[U]);let G=m%4;G&&(G=4-G),m+=G}return m}function wLi(o,f,m,v,y){let x=f.getInt32(m,!0);m+=Int32Array.BYTES_PER_ELEMENT;for(let C=0;C<x;C++){let w={},A=f.getInt32(m,!0);if(m+=Int32Array.BYTES_PER_ELEMENT,A<1)continue;let E=f.getInt8(m,!0);m+=Int8Array.BYTES_PER_ELEMENT;let T=f.getInt8(m,!0);m+=Int8Array.BYTES_PER_ELEMENT;let S=f.getInt8(m,!0);m+=Int8Array.BYTES_PER_ELEMENT;let M=f.getInt8(m,!0);m+=Int8Array.BYTES_PER_ELEMENT;let I=f.getInt32(m,!0);m+=Int32Array.BYTES_PER_ELEMENT;let P;S!==13?(P=new Uint8Array(o,m,I),m+=Uint8Array.BYTES_PER_ELEMENT*I):(P=new Uint32Array(o,m,I),m+=Uint32Array.BYTES_PER_ELEMENT*I);let D=m%4;D&&(D=4-D),m+=D;let L;S!==13?(L=new Uint8Array(A*Uint32Array.BYTES_PER_ELEMENT),YIe.decodeIndexBuffer(L,A,Uint32Array.BYTES_PER_ELEMENT,P)):L=P;let R=f.getInt32(m,!0);m+=Int32Array.BYTES_PER_ELEMENT,w.indexType=E;let O=E===0?new Uint16Array(A):new Uint32Array(A);w.indicesCount=A;let F=new Uint32Array(L.buffer,L.byteOffset,L.byteLength/4);O.set(F,0),w.indicesTypedArray=O,w.primitiveType=S;for(let k=0;k<R;k++){let U=_P(o,f,m);m=U.bytesOffset,w.materialCode=U.string}v.push(w),D=m%4,D&&(D=4-D),m+=D}return m}function ALi(o,f,m,v){let y=f.getUint32(m,!0);return v.compressOptions=y,m+=Uint32Array.BYTES_PER_ELEMENT,(y&DO.SVC_Vertex)===DO.SVC_Vertex?m=gLi(o,f,m,v):m=Kat(o,f,m,v),(y&DO.SVC_Normal)===DO.SVC_Normal?m=_Li(o,f,m,v):m=Qat(o,f,m,v),m=Zat(o,f,m,v),m=$at(o,f,m,v),(y&DO.SVC_TexutreCoord)===DO.SVC_TexutreCoord?m=vLi(o,f,m,v):m=est(o,f,m,v),(y&DO.SVC_TexutreCoordIsW)===DO.SVC_TexutreCoordIsW&&(v.textureCoordIsW=!0),m=tst(o,f,m,v),m}function ELi(o,f,m,v,y){let x=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let C=0;C<x;C++){let w={};if(y===3){let D=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT}let A=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let E=f.getUint8(m,!0);m+=Uint8Array.BYTES_PER_ELEMENT;let T=f.getUint8(m,!0);m+=Uint8Array.BYTES_PER_ELEMENT;let S=f.getUint8(m,!0);if(m+=Uint8Array.BYTES_PER_ELEMENT,m+=Uint8Array.BYTES_PER_ELEMENT,A>0){let D=null,L;E===1||E===3?(L=A*Uint32Array.BYTES_PER_ELEMENT,D=new Uint8Array(o,m,L)):(L=A*Uint16Array.BYTES_PER_ELEMENT,D=new Uint8Array(o,m,L),A%2!==0&&(L+=2)),w.indicesTypedArray=D,m+=L}w.indicesCount=A,w.indexType=E,w.primitiveType=S;let M=[],I=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let D=0;D<I;D++){let L=_P(o,f,m),R=L.string;m=L.bytesOffset,M.push(R),w.materialCode=R}if(m%4!==0){let D=4-m%4;m+=D}v.push(w)}return m}function TLi(o,f,m,v,y){let x=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let C=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let w=0;w<C;w++){if(y===3){let D=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT}let A=_P(o,f,m),E=A.string;m=A.bytesOffset;let T=A.length%4;T!==0&&(m+=4-T);let S=f.getUint32(m,!0);if(m+=Int32Array.BYTES_PER_ELEMENT,y===3)switch(S){case qIe.Standard:S=f4.SV_Standard;break;case qIe.Draco:S=f4.SV_DracoCompressed;break;case qIe.MeshOpt:S=f4.SV_Compressed;break;default:break}let M={vertexAttributes:[],attrLocation:{},instanceCount:0,instanceMode:0,instanceIndex:-1};S===f4.SV_Standard?m=xLi(o,f,m,M,y):S===f4.SV_Compressed&&y===3?m=bLi(o,f,m,M,y):S===f4.SV_Compressed&&(m=ALi(o,f,m,M));let I=[];S===f4.SV_Compressed&&y===3?m=wLi(o,f,m,I,y):m=ELi(o,f,m,I,y);let P;if(I.length===2&&I[1].primitiveType===13&&I[1].indicesCount>=3&&(P=S3MEdgeProcessor.createEdgeDataByIndices(M,I[1])),v[E]={vertexPackage:M,arrIndexPackage:I,edgeGeometry:P},y===3){let D={};D.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,D.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,D.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let L={};L.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,L.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,L.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let R={};R.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,R.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,R.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT;let O={};O.x=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,O.y=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT,O.z=f.getFloat64(m,!0),m+=Float64Array.BYTES_PER_ELEMENT}}if(y!==3){let w=f.getUint32(m,!0);m+=w,m+=Uint32Array.BYTES_PER_ELEMENT}return m}function SLi(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let x=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let C=0;C<x;C++){let w=_P(o,f,m),A=w.string;m=w.bytesOffset;let E=w.length%4;E!==0&&(m+=4-E);let T=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let S=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let M=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let I=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let P=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let D=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let L=new Uint8Array(o,m,P);m+=P;let R=D===Yae.RGB||D===Yae.BGR?33776:33779;if(I===22&&(R=36196),!K6.s3tc&&(R===33776||R===33779)){let O=new Uint8Array(S*M*4);qat.decode(O,S,M,L,D),L=O,I=0,R=D===Yae.RGB||D===Yae.RGB?273:4369}v[A]={id:A,width:S,height:M,compressType:I,nFormat:D,internalFormat:R,arrayBufferView:L}}return m}function PLi(o,f,m,v){let y=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let x=new Uint8Array(o,m,y),C=Jat(x);return m+=y,v.materials=JSON.parse(C),m}var qae={red:0,green:0,blue:0,alpha:0};var ILi=65536;function MLi(o,f,m,v,y,x){if(x===3&&(v=f.getUint32(m,!0),m+=Uint32Array.BYTES_PER_ELEMENT),(v&1)===1){let C=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let w=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let A=0;A<w;A++){let E=_P(o,f,m),T=E.string;m=E.bytesOffset;let S=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let M={};if(y[T].pickInfo=M,y[T].vertexPackage.instanceIndex==-1){let P=new Float32Array(y[T].vertexPackage.verticesCount);for(let D=0;D<S;D++){let L=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let R=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let O=[];for(let F=0;F<R;F++){let k=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;let U=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT,P.fill(D,k,k+U),O.push({vertexColorOffset:k,vertexColorCount:U,batchId:D})}M[L]=O}Xat(y[T].vertexPackage,P,void 0)}else{let P=y[T].vertexPackage.instanceCount,D=y[T].vertexPackage.instanceBuffer,L=y[T].vertexPackage.instanceMode,R=new Float32Array(P),O=[];for(let k=0;k<S;k++){let U=f.getUint32(m,!0);O.push(U),m+=Uint32Array.BYTES_PER_ELEMENT;let G=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT;for(let j=0;j<G;j++){let q=f.getUint32(m,!0);if(m+=Uint32Array.BYTES_PER_ELEMENT,x===3){let J=f.getUint32(m,!0);m+=Uint32Array.BYTES_PER_ELEMENT}}}let F=L===17?16:28;F*=Float32Array.BYTES_PER_ELEMENT;for(let k=0;k<P;k++){R[k]=k;let U=k*L*Float32Array.BYTES_PER_ELEMENT+F;Cesium.Color.unpack(D,U,qae);let G=x===2?O[k]:qae.red+qae.green*256+qae.blue*ILi;M[G]===void 0&&(M[G]={vertexColorCount:1,instanceIds:[],vertexColorOffset:k}),M[G].instanceIds.push(k)}Xat(y[T].vertexPackage,R,1)}}}return m}function Xat(o,f,m){let v=o.vertexAttributes,y=o.attrLocation,x=v.length,C=m===1?"instanceId":"batchId";y[C]=x,v.push({index:x,typedArray:f,componentsPerAttribute:1,componentDatatype:5126,offsetInBytes:0,strideInBytes:0,instanceDivisor:m})}K6.parseBuffer=function(o){let f=0,m={version:void 0,groupNode:void 0,geoPackage:{},matrials:void 0,texturePackage:{}},v=new DataView(o);if(m.version=v.getFloat32(f,!0),f+=Float32Array.BYTES_PER_ELEMENT,m.version>=2){let A=v.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT}let y=0;m.version>=3&&(y=v.getUint32(f,!0),f+=Uint32Array.BYTES_PER_ELEMENT);let x=v.getUint32(f,!0);f+=Uint32Array.BYTES_PER_ELEMENT;let C=hLi(o,f);v=new DataView(C),f=0;let w=v.getUint32(f,!0);return f+=Uint32Array.BYTES_PER_ELEMENT,f=pLi(C,v,f,m),f=TLi(C,v,f,m.geoPackage,m.version),f=SLi(C,v,f,m.texturePackage),f=PLi(C,v,f,m),MLi(C,v,f,w,m.geoPackage,m.version),m};var xX=K6;function Xae(o,f,m){let v=o._gl;this.contextId=o.id,this.textureId=f,this.layerId=m.layerId,this.rootName=m.rootName,this.context=o,this.width=m.width,this.height=m.height,this.compressType=m.compressType,this.internalFormat=m.internalFormat,this.pixelFormat=m.pixelFormat,this.arrayBufferView=m.arrayBufferView,this.wrapS=Cesium.defaultValue(m.wrapS,Cesium.TextureWrap.CLAMP_TO_EDGE),this.wrapT=Cesium.defaultValue(m.wrapT,Cesium.TextureWrap.CLAMP_TO_EDGE),this._target=v.TEXTURE_2D,this._texture=void 0,this.refCount=1,this.arrayBufferView&&this.init()}Xae.prototype.init=function(){let o=this.context._gl;this._texture||(this._texture=o.createTexture()),o.bindTexture(o.TEXTURE_2D,this._texture);let f=this.internalFormat;(f===6410||f===4369)&&o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,!0);let m=0,v=0,y=this.width,x=this.height,C=DLi(this.arrayBufferView,f,y,x);do{let w=Cesium.PixelFormat.compressedTextureSizeInBytes(f,y,x),A=new Uint8Array(this.arrayBufferView.buffer,this.arrayBufferView.byteOffset+v,w);f===4369?o.texImage2D(o.TEXTURE_2D,m++,o.RGBA,y,x,0,o.RGBA,o.UNSIGNED_BYTE,A):o.compressedTexImage2D(o.TEXTURE_2D,m++,f,y,x,0,A),y=Math.max(y>>1,1),x=Math.max(x>>1,1),v+=w}while(v<this.arrayBufferView.byteLength&&C);m>1?(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR_MIPMAP_LINEAR)):(o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MAG_FILTER,o.LINEAR),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_MIN_FILTER,o.LINEAR)),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,this.wrapS),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,this.wrapT),o.texParameteri(this._target,this.context._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,1),o.bindTexture(o.TEXTURE_2D,null),this.arrayBufferView=void 0,this.ready=!0};function DLi(o,f,m,v){let y=o.length,x=m,C=v,w=0;for(;;){let A=Cesium.PixelFormat.compressedTextureSizeInBytes(f,x,C);if(w+=A,x=x>>1,C=C>>1,x===0&&C===0)break;x=Math.max(x,1),C=Math.max(C,1)}return w===y}Xae.prototype.isDestroyed=function(){return!1};Xae.prototype.destroy=function(){this.context._gl.deleteTexture(this._texture),this._texture=null,this.id=0,Cesium.destroyObject(this)};var ist=Xae;function XIe(){this.ambientColor=new Cesium.Color,this.diffuseColor=new Cesium.Color,this.specularColor=new Cesium.Color(0,0,0,0),this.shininess=50,this.bTransparentSorting=!1,this.texMatrix=Cesium.Matrix4.clone(Cesium.Matrix4.IDENTITY,new Cesium.Matrix4),this.textures=[]}XIe.prototype.isDestroyed=function(){return!1};XIe.prototype.destroy=function(){let o=this.textures.length;for(let f=0;f<o;f++)this.textures[f].destroy();return this.textures.length=0,this.ambientColor=void 0,this.diffuseColor=void 0,this.specularColor=void 0,Cesium.destroyObject(this)};var Jae=XIe;var rst=` in vec4 aPosition; #ifdef VertexColor in vec4 aColor; #endif #ifdef VertexNormal in vec3 aNormal; #endif #ifdef Instance in float instanceId; #else in float batchId; #endif #ifdef USE_VertexWeight in float aVertexWeight; #endif #ifdef USE_TextureCoordMatrix in vec2 aTextureCoordMatrix; #endif #ifdef TexCoord in vec4 aTexCoord0; out vec4 vTexCoord; uniform mat4 uTexMatrix; #ifdef COMPUTE_TEXCOORD uniform float uTexture0Width; out vec4 vTexMatrix; out vec4 vTexCoordTransform; out vec2 vIsRGBA; #endif #endif #ifdef TexCoord2 in vec4 aTexCoord1; uniform float uTexture1Width; out vec4 vTexMatrix2; #endif #ifdef InstanceBim in vec4 uv2; in vec4 uv3; in vec4 uv4; in vec4 secondary_colour; in vec4 uv6; #endif #ifdef InstancePipe in vec4 uv1; in vec4 uv2; in vec4 uv3; in vec4 uv4; in vec4 uv5; in vec4 uv6; in vec4 uv7; in vec4 secondary_colour; in vec4 uv9; #endif uniform vec4 uFillForeColor; uniform vec4 uSelectedColor; out vec4 vSecondColor; out vec4 vPositionMC; out vec3 vPositionEC; #ifdef VertexNormal out vec3 vNormalEC; #endif out vec4 vColor; const float SHIFT_LEFT8 = 256.0; const float SHIFT_RIGHT8 = 1.0 / 256.0; const float SHIFT_RIGHT4 = 1.0 / 16.0; const float SHIFT_LEFT4 = 16.0; void getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale, inout float isRGBA) { if(nZ <= 0.0) { return; } float nDel8 = floor(nZ * SHIFT_RIGHT8); float nDel16 = floor(nDel8 * SHIFT_RIGHT8); float nDel20 = floor(nDel16 * SHIFT_RIGHT4); isRGBA = floor(nDel20); YTran = nZ - nDel8 * SHIFT_LEFT8; XTran = nDel8 - nDel16 * SHIFT_LEFT8; float nLevel = nDel16 - nDel20 * SHIFT_LEFT4; scale = 1.0 / pow(2.0, nLevel); } void operation(vec4 operationType, vec4 color, vec4 selectedColor, inout vec4 vertexColor) { float right_2 = operationType.x * 0.5; float right_4 = right_2 * 0.5; float right_8 = right_4 * 0.5; float right_16 = right_8 * 0.5; float isSetColor = fract(right_2); if(isSetColor > 0.1) { vertexColor *= color; } float isPicked = fract(floor(right_2)* 0.5); if(isPicked > 0.1) { vertexColor *= selectedColor; } float isHide = fract(floor(right_4)* 0.5); if(isHide > 0.1) { vertexColor.a = 0.0; } } #ifdef COMPRESS_TEXCOORD #ifdef TexCoord uniform vec2 decode_texCoord0_min; #endif #ifdef TexCoord2 uniform vec2 decode_texCoord1_min; #endif #ifdef MeshOPT_Compress uniform vec3 decode_texCoord0_vNormConstant; uniform vec3 decode_texCoord1_vNormConstant; #else uniform float decode_texCoord0_normConstant; uniform float decode_texCoord1_normConstant; #endif #endif #ifdef COMPRESS_VERTEX uniform vec4 decode_position_min; uniform float decode_position_normConstant; #endif #ifdef COMPRESS_NORMAL uniform float normal_rangeConstant; #endif void main() { #ifdef COMPRESS_VERTEX vec4 vertexPos = vec4(1.0); vertexPos = decode_position_min + vec4(aPosition.xyz, 1.0) * decode_position_normConstant; #else vec4 vertexPos = aPosition; #endif #ifdef TexCoord #ifdef COMPRESS_TEXCOORD #ifdef MeshOPT_Compress vec2 texCoord0; texCoord0.x = aTexCoord0.x * decode_texCoord0_vNormConstant.x; texCoord0.y = aTexCoord0.y * decode_texCoord0_vNormConstant.y; vTexCoord.xy = decode_texCoord0_min + texCoord0.xy; #else vTexCoord.xy = decode_texCoord0_min.xy + aTexCoord0.xy * decode_texCoord0_normConstant; #endif #else vTexCoord.xy = aTexCoord0.xy; #endif #ifdef COMPUTE_TEXCOORD vTexMatrix = vec4(0.0,0.0,1.0,0.0); vIsRGBA.x = 0.0; vTexCoordTransform.x = aTexCoord0.z; #ifdef USE_TextureCoordMatrix vTexCoordTransform.x = aTextureCoordMatrix.x; #endif if(vTexCoordTransform.x < -90000.0) { vTexMatrix.z = -1.0; } getTextureMatrixFromZValue(floor(vTexCoordTransform.x), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z, vIsRGBA.x); vTexMatrix.w = log2(uTexture0Width * vTexMatrix.z); #endif #endif #ifdef TexCoord2 #ifdef COMPRESS_TEXCOORD #ifdef MeshOPT_Compress vec2 texCoord1; texCoord1.x = aTexCoord1.x * decode_texCoord1_vNormConstant.x; texCoord1.y = aTexCoord1.y * decode_texCoord1_vNormConstant.y; vTexCoord.zw = decode_texCoord1_min + texCoord1.xy; #else vTexCoord.zw = decode_texCoord1_min.xy + aTexCoord1.xy * decode_texCoord1_normConstant; #endif #else vTexCoord.zw = aTexCoord1.xy; #endif vTexMatrix2 = vec4(0.0,0.0,1.0,0.0); vIsRGBA.y = 0.0; vTexCoordTransform.y = aTexCoord1.z; #ifdef USE_TextureCoordMatrix vTexCoordTransform.y = aTextureCoordMatrix.y; #endif if(vTexCoordTransform.y < -90000.0) { vTexMatrix2.z = -1.0; } getTextureMatrixFromZValue(floor(vTexCoordTransform.y), vTexMatrix2.x, vTexMatrix2.y, vTexMatrix2.z, vIsRGBA.y); vTexMatrix2.w = log2(uTexture1Width * vTexMatrix.z); #endif vec4 vertexColor = uFillForeColor; #ifdef VertexColor vertexColor *= aColor; #endif #ifdef VertexNormal vec3 normal = aNormal; #ifdef COMPRESS_NORMAL #ifdef MeshOPT_Compress normal.x = aNormal.x / 127.0; normal.y = aNormal.y / 127.0; normal.z = 1.0 - abs(normal.x) - abs(normal.y); normal = normalize(normal); #else normal = czm_octDecode(aNormal.xy, normal_rangeConstant).zxy; #endif #endif #endif #ifdef InstanceBim mat4 worldMatrix; worldMatrix[0] = uv2; worldMatrix[1] = uv3; worldMatrix[2] = uv4; worldMatrix[3] = vec4(0, 0, 0, 1); vertexPos = vec4(vertexPos.xyz,1.0) * worldMatrix; vertexColor *= secondary_colour; #endif #ifdef InstancePipe mat4 worldMatrix; mat4 worldMatrix0; mat4 worldMatrix1; vec4 worldPos0; vec4 worldPos1; worldMatrix0[0] = uv1; worldMatrix0[1] = uv2; worldMatrix0[2] = uv3; worldMatrix0[3] = vec4( 0.0, 0.0, 0.0, 1.0 ); worldMatrix1[0] = uv4; worldMatrix1[1] = uv5; worldMatrix1[2] = uv6; worldMatrix1[3] = vec4( 0.0, 0.0, 0.0, 1.0 ); vec4 realVertex = vec4(vertexPos.xyz, 1.0); realVertex.x = realVertex.x * uv7.z; worldPos0 = realVertex * worldMatrix0; worldPos1 = realVertex * worldMatrix1; vertexColor *= secondary_colour; #ifdef TexCoord if(aTexCoord0.y > 0.5) { vec4 tex4Vec = uTexMatrix * vec4(uv7.y, aTexCoord0.x, 0.0, 1.0); vTexCoord.xy = tex4Vec.xy; vertexPos = worldPos1; worldMatrix = worldMatrix1; } else { vec4 tex4Vec = uTexMatrix * vec4(uv7.x, aTexCoord0.x, 0.0, 1.0); vTexCoord.xy = tex4Vec.xy; vertexPos = worldPos0; worldMatrix = worldMatrix0; } #endif #ifdef VertexNormal normal.x = normal.x * uv7.z; #endif #endif #ifdef Instance float index = instanceId; #else float index = batchId; #endif vec4 operationType = batchTable_operation(index); operation(operationType, vec4(1.0), uSelectedColor, vertexColor); vSecondColor = batchTable_pickColor(index); vec4 positionMC = vec4(vertexPos.xyz, 1.0); vColor = vertexColor; #ifdef VertexNormal vNormalEC = czm_normal * normal; #endif vPositionMC = positionMC; vPositionEC = (czm_modelView * positionMC).xyz; gl_Position = czm_modelViewProjection * vec4(vertexPos.xyz, 1.0); }`;var nst=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif #ifdef GL_EXT_shader_texture_lod #extension GL_EXT_shader_texture_lod : enable #endif uniform vec4 uDiffuseColor; #ifdef TexCoord in vec4 vTexCoord; #ifdef COMPUTE_TEXCOORD uniform sampler2D uTexture; uniform float uTexture0Width; in vec4 vTexCoordTransform; in vec4 vTexMatrix; in vec2 vIsRGBA; #endif #endif in vec4 vColor; in vec4 vSecondColor; in vec4 vPositionMC; in vec3 vPositionEC; #ifdef VertexNormal in vec3 vNormalEC; #endif #ifdef TexCoord2 uniform sampler2D uTexture2; uniform float uTexture1Width; in vec4 vTexMatrix2; #endif #ifdef COMPUTE_TEXCOORD void calculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel) { vec2 dx = dFdx(inTexCoord * vecTile); vec2 dy = dFdy(inTexCoord * vecTile); float dotX = dot(dx, dx); float dotY = dot(dy, dy); float dMax = max(dotX, dotY); float dMin = min(dotX, dotY); float offset = (dMax - dMin) / (dMax + dMin); offset = clamp(offset, 0.0, 1.0); float d = dMax * (1.0 - offset) + dMin * offset; mipLevel = 0.5 * log2(d); mipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62); } void calculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord) { if(inTexCoord.z < -9000.0) { outTexCoord = inTexCoord.xy; } else { vec2 fTexCoord = fract(inTexCoord.xy); float offset = 1.0 * pow(2.0, mipLevel) / fTile; fTexCoord = clamp(fTexCoord, offset, 1.0 - offset); outTexCoord.x = (fTexCoord.x + XTran) * scale; outTexCoord.y = (fTexCoord.y + YTran) * scale; } } vec4 getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate, float isRGBA) { vec4 color = vec4(1.0); float mipLevel = 0.0; #ifdef GL_OES_standard_derivatives calculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel); #endif vec2 realTexCoord; calculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord); if(isRGBA > 0.5) { vec2 rgbTexCoord; rgbTexCoord.x = (realTexCoord.x + vecTexCoordTranslate.x * fTexCoordScale) * 0.5; rgbTexCoord.y = (realTexCoord.y + vecTexCoordTranslate.y * fTexCoordScale) * 0.5; color = texture(curTexture, rgbTexCoord.xy, -10.0); vec2 vecAlphaTexCoord; vecAlphaTexCoord.x = rgbTexCoord.x; vecAlphaTexCoord.y = rgbTexCoord.y + fTexCoordScale * 0.5; color.a = texture(curTexture, vecAlphaTexCoord.xy, -10.0).r; } else { if(oriTexCoord.z < -9000.0) { color = texture(curTexture, realTexCoord.xy); } else { #ifdef GL_EXT_shader_texture_lod color = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel); #else color = texture(curTexture, realTexCoord.xy, mipLevel); #endif } } return color; } vec4 getTextureColor() { if(vTexMatrix.z < 0.0) { return vec4(1.0); } float texTileWidth0 = vTexMatrix.z * uTexture0Width; vec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordTransform.x); vec4 FColor = getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy, vIsRGBA.x); #ifdef TexCoord2 float texTileWidth1 = vTexMatrix2.z * uTexture1Width; realTexCoord = vec3(vTexCoord.zw, vTexCoordTransform.y); vec4 SColor = getTexColorForS3M(uTexture2, realTexCoord, texTileWidth1, vTexMatrix2.w, vTexMatrix2.z, vTexMatrix2.xy, vIsRGBA.y); SColor.r = clamp(SColor.r, 0.0, 1.0); SColor.g = clamp(SColor.g, 0.0, 1.0); SColor.b = clamp(SColor.b, 0.0, 1.0); return FColor * SColor; #else return FColor; #endif } #endif vec4 SRGBtoLINEAR4(vec4 srgbIn) { #ifndef HDR vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); return vec4(linearOut, srgbIn.a); #else return srgbIn; #endif } vec3 LINEARtoSRGB(vec3 linearIn) { #ifndef HDR return pow(linearIn, vec3(1.0/2.2)); #else return linearIn; #endif } vec3 applyTonemapping(vec3 linearIn) { #ifndef HDR return czm_acesTonemapping(linearIn); #else return linearIn; #endif } vec3 computeNormal(in vec3 oriVertex) { vec3 normal = cross(vec3(dFdx(oriVertex.x), dFdx(oriVertex.y), dFdx(oriVertex.z)), vec3(dFdy(oriVertex.x), dFdy(oriVertex.y), dFdy(oriVertex.z))); normal = normalize(normal); return normal; } void main() { if(vColor.a < 0.1) { discard; } vec4 baseColorWithAlpha = vColor; #ifdef COMPUTE_TEXCOORD baseColorWithAlpha *= SRGBtoLINEAR4(getTextureColor()); #endif if(baseColorWithAlpha.a < 0.1) { discard; } vec3 normal = vec3(0.0); #ifdef VertexNormal normal = normalize(vNormalEC); #endif normal = length(normal) > 0.1 ? normal : computeNormal(vPositionMC.xyz); vec3 color = baseColorWithAlpha.rgb; vec3 dirVectorEC = normalize(czm_lightDirectionEC); float dotProduct = dot( normal, dirVectorEC ); float dirDiffuseWeight = max( dotProduct, 0.0 ); dirDiffuseWeight = dirDiffuseWeight * 0.5 + 0.5; color += color * uDiffuseColor.rgb * dirDiffuseWeight; #ifdef TexCoord color = LINEARtoSRGB(color); #endif out_FragColor = vec4(color, baseColorWithAlpha.a); }`;function JIe(){this.context=void 0,this.model=void 0,this.index=void 0}JIe.prototype.set=function(o,f,m){this.context=o,this.model=f,this.index=m};JIe.prototype.execute=function(){let o=this.context,f=this.index,m=this.model.vertexPackage,v=m.vertexAttributes[f];if(!Cesium.defined(v))throw new Cesium.DeveloperError("attribute is null");if(m.instanceIndex!==-1&&!Cesium.defined(this.model.instanceBuffer)){if(!Cesium.defined(m.instanceBuffer))throw new Cesium.DeveloperError("instance buffer is null");this.model.instanceBuffer=Cesium.Buffer.createVertexBuffer({context:o,typedArray:m.instanceBuffer,usage:Cesium.BufferUsage.STATIC_DRAW})}if(v.instanceDivisor===1&&!Cesium.defined(v.typedArray)){v.vertexBuffer=this.model.instanceBuffer;return}Cesium.defined(v.vertexBuffer)||(v.vertexBuffer=Cesium.Buffer.createVertexBuffer({context:o,typedArray:v.typedArray,usage:Cesium.BufferUsage.STATIC_DRAW}),v.typedArray=null,delete v.typedArray)};var ost=JIe;function KIe(){this.model=void 0,this.context=void 0,this.index=0}KIe.prototype.set=function(o,f,m){this.model=f,this.context=o,this.index=m};KIe.prototype.execute=function(){let o=this.context,f=this.model.arrIndexPackage[this.index],m=this.model.vertexPackage.verticesCount;if(!Cesium.defined(f))throw new Cesium.DeveloperError("index package is null");if(Cesium.defined(f.indexBuffer))return;if(!Cesium.defined(f.indicesTypedArray))throw new Cesium.DeveloperError("index buffer is null");let v=Cesium.IndexDatatype.UNSIGNED_SHORT;(f.indexType===1||m>=Cesium.Math.SIXTY_FOUR_KILOBYTES)&&o.elementIndexUint&&(v=Cesium.IndexDatatype.UNSIGNED_INT),Cesium.defined(f.indexBuffer)||(f.indexBuffer=Cesium.Buffer.createIndexBuffer({context:o,typedArray:f.indicesTypedArray,usage:Cesium.BufferUsage.STATIC_DRAW,indexDatatype:v})),f.indicesTypedArray=null,delete f.indicesTypedArray};var ast=KIe;var LLi={VertexNormal:"VertexNormal",VertexColor:"VertexColor",TexCoord:"TexCoord",TexCoord2:"TexCoord2",Instance:"Instance",COMPRESS_VERTEX:"COMPRESS_VERTEX",COMPRESS_NORMAL:"COMPRESS_NORMAL",COMPRESS_COLOR:"COMPRESS_COLOR",COMPRESS_TEXCOORD:"COMPRESS_TEXCOORD",UseLineColor:"USE_LINECOLOR",InstanceBim:"InstanceBim",InstancePipe:"InstancePipe",COMPUTE_TEXCOORD:"COMPUTE_TEXCOORD"},Jv=Object.freeze(LLi);var RLi={SVC_Vertex:1,SVC_Normal:2,SVC_VertexColor:4,SVC_SecondColor:8,SVC_TexutreCoord:16,SVC_TexutreCoordIsW:32},Zg=Object.freeze(RLi);var OLi={BIM:17,PIPELINE:29},QIe=Object.freeze(OLi);function ZIe(){this.model=void 0,this.context=void 0}ZIe.prototype.set=function(o,f){this.model=f,this.context=o};function NLi(o,f){let m=f.length;for(let v=0;v<m;++v){let y=o.getExtension(f[v]);if(y)return y}}ZIe.prototype.execute=function(){let o=this.context,f=this.model,m=f.layer,v=f.vs,y=f.fs,x=f.attributeLocations,C=f.material,w=f.vertexPackage,A=f.batchTable?f.batchTable.getVertexShaderCallback()(v):v;o.texturelod===void 0&&(o.texturelod=Cesium.defaultValue(NLi(o._gl,["EXT_shader_texture_lod"]),!1));let E=new Cesium.ShaderSource({sources:[A]}),T=new Cesium.ShaderSource({sources:[y]});if(Cesium.defined(x.aNormal)&&(E.defines.push(Jv.VertexNormal),T.defines.push(Jv.VertexNormal)),Cesium.defined(x.aColor)&&E.defines.push(Jv.VertexColor),C&&C.textures.length>0&&(E.defines.push(Jv.COMPUTE_TEXCOORD),T.defines.push(Jv.COMPUTE_TEXCOORD)),C&&C.textures.length===2&&(E.defines.push(Jv.TexCoord2),T.defines.push(Jv.TexCoord2)),Cesium.defined(x.aTexCoord0)&&(E.defines.push("TexCoord"),T.defines.push("TexCoord")),w.instanceIndex>-1&&E.defines.push(Jv.Instance),w.instanceMode===QIe.BIM&&E.defines.push(Jv.InstanceBim),w.instanceMode===QIe.PIPELINE&&E.defines.push(Jv.InstancePipe),Cesium.defined(w.compressOptions)){let S=w.compressOptions;(S&Zg.SVC_Vertex)===Zg.SVC_Vertex&&E.defines.push(Jv.COMPRESS_VERTEX),(S&Zg.SVC_Normal)===Zg.SVC_Normal&&E.defines.push(Jv.COMPRESS_NORMAL),(S&Zg.SVC_VertexColor)===Zg.SVC_VertexColor&&E.defines.push(Jv.COMPRESS_COLOR),(S&Zg.SVC_TexutreCoord)===Zg.SVC_TexutreCoord&&E.defines.push(Jv.COMPRESS_TEXCOORD)}Cesium.defined(f.arrIndexPackage)&&f.arrIndexPackage.length>0&&f.arrIndexPackage[0].primitiveType===2&&T.defines.push(Jv.UseLineColor),Cesium.defined(w.customVertexAttribute)&&Cesium.defined(w.customVertexAttribute.TextureCoordMatrix)&&E.defines.push("USE_TextureCoordMatrix"),Cesium.defined(w.customVertexAttribute)&&Cesium.defined(w.customVertexAttribute.VertexWeight)&&E.defines.push("USE_VertexWeight"),m._vertexCompressionType==="MESHOPT"&&E.defines.push("MeshOPT_Compress"),f.shaderProgram=Cesium.ShaderProgram.fromCache({context:o,vertexShaderSource:E,fragmentShaderSource:T,attributeLocations:x})};var sst=ZIe;function wD(o){this.layer=o.layer,this.vertexPackage=o.vertexPackage,this.arrIndexPackage=o.arrIndexPackage,this.vertexBufferToCreate=new Cesium.Queue,this.indexBufferToCreate=new Cesium.Queue,this.shaderProgramToCreate=new Cesium.Queue;let f,m;for(f=0,m=this.vertexPackage.vertexAttributes.length;f<m;f++)this.vertexBufferToCreate.enqueue(f);for(f=0,m=this.arrIndexPackage.length;f<m;f++)this.indexBufferToCreate.enqueue(f);this.shaderProgramToCreate.enqueue(0),this.boundingVolume=o.boundingVolume,this.material=Cesium.defaultValue(o.material,new Jae),this.geoName=o.geoName,this.modelMatrix=o.modelMatrix,this.geoMatrix=o.geoMatrix,this.invGeoMatrix=Cesium.Matrix4.inverse(this.geoMatrix,new Cesium.Matrix4),this.instanceCount=o.vertexPackage.instanceCount,this.attributeLocations=o.vertexPackage.attrLocation,this.shaderProgram=void 0,this.vertexArray=void 0,this.colorCommand=void 0,this.pickInfo=Cesium.defaultValue(o.pickInfo,{}),this.selectionInfoMap=new Cesium.AssociativeArray,this.batchTable=void 0,this.batchTableDirty=!1,this.idsOperationMap=new Cesium.AssociativeArray,this.pickColorIdentifier="vSecondColor",this.createBoundingBoxForInstance(),this.ready=!1}var lst=new ost,ust=new ast,cst=new sst;function FLi(o,f){let m=o.layer.context,v=o.vertexBufferToCreate;for(;v.length;){let y=v.peek();if(lst.set(m,o,y),!f.jobScheduler.execute(lst,Cesium.JobType.BUFFER))break;v.dequeue()}}function BLi(o,f){let m=o.layer.context,v=o.indexBufferToCreate;for(;v.length;){let y=v.peek();if(ust.set(m,o,y),!f.jobScheduler.execute(ust,Cesium.JobType.BUFFER))break;v.dequeue()}}function kLi(o,f){let m=o.layer.context,v=o.shaderProgramToCreate;for(;v.length;){let y=v.peek();if(cst.set(m,o),!f.jobScheduler.execute(cst,Cesium.JobType.PROGRAM))break;v.dequeue()}}function VLi(o,f){if(Cesium.defined(o.batchTable)||!o.pickInfo)return;let m=o.layer.context,v=[];v.push({functionName:"batchTable_operation",componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4},{functionName:"batchTable_pickColor",componentDatatype:Cesium.ComponentDatatype.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let y=o.pickInfo,x=Object.keys(y),C=o.instanceCount>0?o.instanceCount:x.length;o.batchTable=new Cesium.BatchTable(m,v,C)}wD.prototype.createBuffers=function(o){FLi(this,o),BLi(this,o)};wD.prototype.createShaderProgram=function(o){kLi(this,o)};wD.prototype.createBatchTable=function(o){VLi(this,o)};wD.prototype.createBoundingBoxForInstance=function(){let o=new Cesium.Cartesian3,f=this.vertexPackage;if(!Cesium.defined(f)||f.instanceIndex===-1||!Cesium.defined(f.instanceBounds))return;let m=f.instanceBounds,v=new Cesium.Cartesian3(m[0],m[1],m[2]),y=new Cesium.Cartesian3(m[3],m[4],m[5]),x=Cesium.Cartesian3.lerp(v,y,.5,o),C=Cesium.Cartesian3.distance(x,v),w=new Cesium.Cartesian3;Cesium.Matrix4.multiplyByPoint(this.modelMatrix,x,w),this.boundingVolume.center=w,this.boundingVolume.radius=C,f.instanceBounds=void 0};wD.prototype.initLayerSetting=function(o){Object.keys(o._objsOperationList).length>0&&this.updateObjsOperation(o._objsOperationList)};wD.prototype.createPickIds=function(){let o=new Cesium.Cartesian4,f=this.layer,m=f.context,v=this.pickInfo;if(!Cesium.defined(v))return;for(let w in v)!v.hasOwnProperty(w)||this.selectionInfoMap.set(w,v[w]);let y=this.batchTable,x=this.selectionInfoMap,C=x._hash;for(let w in C)if(C.hasOwnProperty(w)){let A=x.get(w),E;Cesium.defined(E)||(E=m.createPickId({primitive:f,id:w}));let T=E.color;o.x=Cesium.Color.floatToByte(T.red),o.y=Cesium.Color.floatToByte(T.green),o.z=Cesium.Color.floatToByte(T.blue),o.w=Cesium.Color.floatToByte(T.alpha);let S=A.instanceIds;if(this.instanceCount>0)S.map(function(M){y.setBatchedAttribute(M,1,o)});else{let M=A[0].batchId;y.setBatchedAttribute(M,1,o)}}this.pickInfo=void 0};wD.prototype.updateBatchTableAttributes=function(){let o=this,f=this.idsOperationMap;for(let m=0,v=f.length;m<v;m++){let y=f.values[m];!y.dirty||(y.dirty=!1,this.instanceCount>0?Array.isArray(y.instanceIds)&&y.instanceIds.map(function(x){o.batchTable.setBatchedAttribute(x,0,y.operationValue)}):Cesium.defined(y.batchId)&&this.batchTable.setBatchedAttribute(y.batchId,0,y.operationValue))}};wD.prototype.updateObjsOperation=function(o){if(!this.ready||this.selectionInfoMap.length<1)return;let f=this.selectionInfoMap._hash;for(let m in f){if(!f.hasOwnProperty(m))continue;let v=o[m];if(!Cesium.defined(v))continue;let y=f[m][0],x=y.batchId,C=y.instanceIds,w=this.idsOperationMap.get(m);Cesium.defined(w)||(w={batchId:x,instanceIds:C,operationValue:new Cesium.Cartesian4,dirty:!0}),w.dirty=!0,w.operationValue.x=w.operationValue.x&1|v,this.idsOperationMap.set(m,w),this.batchTableDirty=!0}};var LO=wD;function p4(o){LO.call(this,o),this.vs=rst,this.fs=nst,this.useLineColor=!1}p4.prototype=Object.create(LO.prototype);p4.prototype.constructor=LO;function zLi(){return Cesium.RenderState.fromCache({cull:{enabled:!1},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL},blending:Cesium.BlendingState.ALPHA_BLEND})}function HLi(){return Cesium.RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL},blending:Cesium.BlendingState.ALPHA_BLEND})}function ULi(o,f,m){let v={uGeoMatrix:function(){return m.geoMatrix},uTexMatrix:function(){return o.texMatrix},uFillForeColor:function(){return m.useLineColor?f.style3D.lineColor:f.style3D.fillForeColor},uInverseGeoMatrix:function(){return m.invGeoMatrix},uTexture:function(){return o.textures[0]},uTexture2:function(){return o.textures[1]},uTexture0Width:function(){return o.textures[0].width},uTexture1Width:function(){return o.textures[1].width},uDiffuseColor:function(){return o.diffuseColor},uSelectedColor:function(){return f._selectedColor}},y=m.vertexPackage,x=y.compressOptions;return(x&Zg.SVC_Vertex)===Zg.SVC_Vertex&&(v.decode_position_min=function(){return y.minVerticesValue},v.decode_position_normConstant=function(){return y.vertCompressConstant}),(x&Zg.SVC_Normal)===Zg.SVC_Normal&&(v.normal_rangeConstant=function(){return y.normalRangeConstant}),(x&Zg.SVC_TexutreCoord)===Zg.SVC_TexutreCoord&&(y.texCoordCompressConstant.length>0&&(v.decode_texCoord0_min=function(){return y.minTexCoordValue[0]},v.decode_texCoord0_normConstant=function(){return y.texCoordCompressConstant[0]},v.decode_texCoord0_vNormConstant=function(){return y.texCoordCompressConstant[0]}),y.texCoordCompressConstant.length>1&&(v.decode_texCoord1_min=function(){return y.minTexCoordValue[1]},v.decode_texCoord1_normConstant=function(){return y.texCoordCompressConstant[1]},v.decode_texCoord1_vNormConstant=function(){return y.texCoordCompressConstant[1]}),y.texCoordCompressConstant.length>2&&(v.decode_texCoord2_min=function(){return y.minTexCoordValue[2]},v.decode_texCoord2_normConstant=function(){return y.texCoordCompressConstant[2]}),y.texCoordCompressConstant.length>3&&(v.decode_texCoord3_min=function(){return y.minTexCoordValue[3]},v.decode_texCoord3_normConstant=function(){return y.texCoordCompressConstant[3]}),y.texCoordCompressConstant.length>4&&(v.decode_texCoord4_min=function(){return y.minTexCoordValue[4]},v.decode_texCoord4_normConstant=function(){return y.texCoordCompressConstant[4]}),y.texCoordCompressConstant.length>5&&(v.decode_texCoord5_min=function(){return y.minTexCoordValue[5]},v.decode_texCoord5_normConstant=function(){return y.texCoordCompressConstant[5]}),y.texCoordCompressConstant.length>6&&(v.decode_texCoord6_min=function(){return y.minTexCoordValue[6]},v.decode_texCoord6_normConstant=function(){return y.texCoordCompressConstant[6]}),y.texCoordCompressConstant.length>7&&(v.decode_texCoord7_min=function(){return y.minTexCoordValue[7]},v.decode_texCoord7_normConstant=function(){return y.texCoordCompressConstant[7]})),v}p4.prototype.createCommand=function(){if(Cesium.defined(this.colorCommand)||this.vertexBufferToCreate.length!==0||this.indexBufferToCreate.length!==0||this.shaderProgramToCreate.length!==0)return;let o=this.layer,f=o.context,m=this.vertexPackage,v=this.arrIndexPackage,y=m.vertexAttributes;if(v.length<1)return;let x=v[0],C=this.material;this.vertexArray=new Cesium.VertexArray({context:f,attributes:y,indexBuffer:x.indexBuffer});let w=Cesium.PrimitiveType.TRIANGLES;switch(x.primitiveType){case 1:w=Cesium.PrimitiveType.POINTS;break;case 2:w=Cesium.PrimitiveType.LINES;break;case 4:w=Cesium.PrimitiveType.TRIANGLES;break;default:break}this.useLineColor=w===Cesium.PrimitiveType.LINES,this.colorCommand=new Cesium.DrawCommand({primitiveType:w,modelMatrix:this.modelMatrix,boundingVolume:Cesium.BoundingSphere.clone(this.boundingVolume),pickId:this.pickColorIdentifier,vertexArray:this.vertexArray,shaderProgram:this.shaderProgram,pass:C.bTransparentSorting?Cesium.Pass.TRANSLUCENT:Cesium.Pass.OPAQUE,renderState:C.bTransparentSorting?HLi():zLi(),instanceCount:m.instanceCount});let A=ULi(C,o,this);this.batchTable&&(A=this.batchTable.getUniformMapCallback()(A)),this.colorCommand.uniformMap=A,this.vertexPackage=void 0,this.arrIndexPackage=void 0,this.vs=void 0,this.fs=void 0,this.ready=!0};p4.prototype.update=function(o,f){if(!this.ready){this.createBatchTable(o),this.createPickIds(),this.createBuffers(o),this.createShaderProgram(o),this.createCommand(o),this.initLayerSetting(f);return}this.batchTableDirty&&(this.updateBatchTableAttributes(),this.batchTableDirty=!1),this.batchTable&&this.batchTable.update(o),o.commandList.push(this.colorCommand)};p4.prototype.isDestroyed=function(){return!1};p4.prototype.destroy=function(){return this.shaderProgram=this.shaderProgram&&!this.shaderProgram.isDestroyed()&&this.shaderProgram.destroy(),this.vertexArray=this.vertexArray&&!this.vertexArray.isDestroyed()&&this.vertexArray.destroy(),this.material=this.material&&!this.material.isDestroyed()&&this.material.destroy(),this.batchTable=this.batchTable&&!this.batchTable.isDestroyed()&&this.batchTable.destroy(),this.colorCommand=void 0,this.vertexPackage=null,this.arrIndexPackage=null,this.modelMatrix=void 0,this.pickInfo=void 0,this.selectionInfoMap=void 0,this.vs=void 0,this.fs=void 0,Cesium.destroyObject(this)};var hst=p4;var dst=` in vec4 aPosition; in vec4 aColor; #ifdef TexCoord in vec4 aTexCoord0; uniform float uTexture0Width; out vec4 vTexCoord; out vec4 vTexMatrix; out vec4 vTexCoordTransform; #endif #ifdef VertexColor out vec4 vColor; #endif const float SHIFT_LEFT8 = 256.0; const float SHIFT_RIGHT8 = 1.0 / 256.0; const float SHIFT_RIGHT4 = 1.0 / 16.0; const float SHIFT_LEFT4 = 16.0; void getTextureMatrixFromZValue(in float nZ, inout float XTran, inout float YTran, inout float scale) { if(nZ <= 0.0) { return; } float nDel8 = floor(nZ * SHIFT_RIGHT8); float nDel16 = floor(nDel8 * SHIFT_RIGHT8); float nDel20 = floor(nDel16 * SHIFT_RIGHT4); YTran = nZ - nDel8 * SHIFT_LEFT8; XTran = nDel8 - nDel16 * SHIFT_LEFT8; float nLevel = nDel16 - nDel20 * SHIFT_LEFT4; scale = 1.0 / pow(2.0, nLevel); } void main() { #ifdef TexCoord vTexCoord.xy = aTexCoord0.xy; vTexMatrix = vec4(0.0,0.0,1.0,0.0); vTexCoordTransform.x = aTexCoord0.z; if(vTexCoordTransform.x < -90000.0) { vTexMatrix.z = -1.0; } getTextureMatrixFromZValue(floor(vTexCoordTransform.x), vTexMatrix.x, vTexMatrix.y, vTexMatrix.z); vTexMatrix.w = log2(uTexture0Width * vTexMatrix.z); #endif vec4 vertexPos = aPosition; #ifdef VertexColor vColor = aColor; #endif gl_Position = czm_modelViewProjection * vec4(vertexPos.xyz, 1.0); }`;var fst=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif #ifdef GL_EXT_shader_texture_lod #extension GL_EXT_shader_texture_lod : enable #endif #ifdef TexCoord uniform sampler2D uTexture; uniform float uTexture0Width; in vec4 vTexCoord; in vec4 vTexCoordTransform; in vec4 vTexMatrix; #endif #ifdef VertexColor in vec4 vColor; #endif #ifdef TexCoord void calculateMipLevel(in vec2 inTexCoord, in float vecTile, in float fMaxMip, inout float mipLevel) { vec2 dx = dFdx(inTexCoord * vecTile); vec2 dy = dFdy(inTexCoord * vecTile); float dotX = dot(dx, dx); float dotY = dot(dy, dy); float dMax = max(dotX, dotY); float dMin = min(dotX, dotY); float offset = (dMax - dMin) / (dMax + dMin); offset = clamp(offset, 0.0, 1.0); float d = dMax * (1.0 - offset) + dMin * offset; mipLevel = 0.5 * log2(d); mipLevel = clamp(mipLevel, 0.0, fMaxMip - 1.62); } void calculateTexCoord(in vec3 inTexCoord, in float scale, in float XTran, in float YTran, in float fTile, in float mipLevel, inout vec2 outTexCoord) { if(inTexCoord.z < -9000.0) { outTexCoord = inTexCoord.xy; } else { vec2 fTexCoord = fract(inTexCoord.xy); float offset = 1.0 * pow(2.0, mipLevel) / fTile; fTexCoord = clamp(fTexCoord, offset, 1.0 - offset); outTexCoord.x = (fTexCoord.x + XTran) * scale; outTexCoord.y = (fTexCoord.y + YTran) * scale; } } vec4 getTexColorForS3M(sampler2D curTexture, vec3 oriTexCoord, float texTileWidth, float fMaxMipLev, float fTexCoordScale, vec2 vecTexCoordTranslate) { vec4 color = vec4(1.0); float mipLevel = 0.0; #ifdef GL_OES_standard_derivatives calculateMipLevel(oriTexCoord.xy, texTileWidth, fMaxMipLev, mipLevel); #endif vec2 realTexCoord; calculateTexCoord(oriTexCoord, fTexCoordScale, vecTexCoordTranslate.x, vecTexCoordTranslate.y, texTileWidth, mipLevel, realTexCoord); if(oriTexCoord.z < -9000.0) { color = texture(curTexture, realTexCoord.xy); } else { #ifdef GL_EXT_shader_texture_lod color = texture2DLodEXT(curTexture, realTexCoord.xy, mipLevel); #else color = texture(curTexture, realTexCoord.xy, mipLevel); #endif } return color; } vec4 getTextureColor() { if(vTexMatrix.z < 0.0) { return vec4(1.0); } float texTileWidth0 = vTexMatrix.z * uTexture0Width; vec3 realTexCoord = vec3(vTexCoord.xy, vTexCoordTransform.x); return getTexColorForS3M(uTexture, realTexCoord, texTileWidth0, vTexMatrix.w, vTexMatrix.z, vTexMatrix.xy); } #endif void main() { vec4 baseColorWithAlpha = vec4(1.0); #ifdef VertexColor vec4 baseColorWithAlpha = vColor; #endif #ifdef TexCoord baseColorWithAlpha *= getTextureColor(); #endif out_FragColor = baseColorWithAlpha; }`;function m4(o){LO.call(this,o),this.vs=dst,this.fs=fst}m4.prototype=Object.create(LO.prototype);m4.prototype.constructor=LO;function GLi(){return Cesium.RenderState.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Cesium.DepthFunction.LESS_OR_EQUAL},blending:Cesium.BlendingState.ALPHA_BLEND})}function WLi(o,f,m){return{uGeoMatrix:function(){return m.geoMatrix},uInverseGeoMatrix:function(){return m.invGeoMatrix},uTexture:function(){return o.textures[0]},uTexture0Width:function(){return o.textures[0].width}}}m4.prototype.createCommand=function(){if(Cesium.defined(this.colorCommand)||this.vertexBufferToCreate.length!==0||this.indexBufferToCreate.length!==0||this.shaderProgramToCreate.length!==0)return;let o=this.layer,f=o.context,m=this.vertexPackage,v=this.arrIndexPackage,y=m.vertexAttributes;if(v.length<1)return;let x=v[0],C=this.material;this.vertexArray=new Cesium.VertexArray({context:f,attributes:y,indexBuffer:x.indexBuffer}),this.colorCommand=new Cesium.DrawCommand({primitiveType:x.primitiveType,modelMatrix:this.modelMatrix,boundingVolume:Cesium.BoundingSphere.clone(this.boundingVolume),vertexArray:this.vertexArray,shaderProgram:this.shaderProgram,pass:C.bTransparentSorting?Cesium.Pass.TRANSLUCENT:Cesium.Pass.OPAQUE,renderState:GLi(),instanceCount:m.instanceCount}),this.colorCommand.uniformMap=WLi(C,o,this),this.vertexPackage=void 0,this.arrIndexPackage=void 0,this.vs=void 0,this.fs=void 0,this.ready=!0};m4.prototype.update=function(o,f){if(!this.ready){this.createBuffers(o),this.createShaderProgram(o),this.createCommand(o),this.initLayerSetting(f);return}o.commandList.push(this.colorCommand)};m4.prototype.isDestroyed=function(){return!1};m4.prototype.destroy=function(){return this.shaderProgram=this.shaderProgram&&!this.shaderProgram.isDestroyed()&&this.shaderProgram.destroy(),this.vertexArray=this.vertexArray&&!this.vertexArray.isDestroyed()&&this.vertexArray.destroy(),this.material=this.material&&!this.material.isDestroyed()&&this.material.destroy(),this.colorCommand=void 0,this.vertexPackage=null,this.arrIndexPackage=null,this.modelMatrix=void 0,this.pickInfo=void 0,this.selectionInfoMap=void 0,this.vs=void 0,this.fs=void 0,Cesium.destroyObject(this)};var pst=m4;var jLi={OSGBFile:function(o){return new pst(o)},OSGBCacheFile:function(o){return new hst(o)}},mst=jLi;function gst(){}function YLi(o,f,m){let v={},y=f.materials.material;for(let x=0,C=y.length;x<C;x++){let w=y[x].material,A=w.id,E=new Jae;v[A]=E;let T=w.ambient;E.ambientColor=new Cesium.Color(T.r,T.g,T.b,T.a);let S=w.diffuse;E.diffuseColor=new Cesium.Color(S.r,S.g,S.b,S.a);let M=w.specular;E.specularColor=new Cesium.Color(M.r,M.g,M.b,M.a),E.shininess=w.shininess,E.bTransparentSorting=w.transparentsorting;let I=w.textureunitstates,P=I.length;for(let D=0;D<P;D++){let L=I[D].textureunitstate,R=L.id,O=L.addressmode.u===0?Cesium.TextureWrap.REPEAT:Cesium.TextureWrap.CLAMP_TO_EDGE,F=L.addressmode.v===0?Cesium.TextureWrap.REPEAT:Cesium.TextureWrap.CLAMP_TO_EDGE;E.texMatrix=Cesium.Matrix4.unpack(L.texmodmatrix);let k=f.texturePackage[R];if(Cesium.defined(k)&&k.arrayBufferView.byteLength>0){k.wrapS=O,k.wrapT=F;let U=m.fileName+R,G=o.textureCache.getTexture(U);if(!Cesium.defined(G)){if(Cesium.PixelFormat.isCompressedFormat(k.internalFormat))G=new ist(o,R,k);else{let j=Cesium.Math.isPowerOfTwo(k.width)&&Cesium.Math.isPowerOfTwo(k.height);G=new Cesium.Texture({context:o,source:{width:k.width,height:k.height,arrayBufferView:k.arrayBufferView},sampler:new Cesium.Sampler({minificationFilter:j?o._gl.LINEAR_MIPMAP_LINEAR:o._gl.LINEAR,wrapS:O,wrapT:F})}),j&&G.generateMipmap(Cesium.MipmapHint.NICEST)}o.textureCache.addTexture(U,G)}E.textures.push(G)}}}return v}function qLi(o,f){let m=new Cesium.BoundingSphere,v=new Cesium.Cartesian3,y=o.vertexAttributes[0],x=y.componentsPerAttribute,C=Cesium.defined(o.compressOptions)&&(o.compressOptions&Zg.SVC_Vertex)===Zg.SVC_Vertex,w=1,A,E;C?(w=o.vertCompressConstant,A=new Cesium.Cartesian3(o.minVerticesValue.x,o.minVerticesValue.y,o.minVerticesValue.z),E=new Uint16Array(y.typedArray.buffer,y.typedArray.byteOffset,y.typedArray.byteLength/2)):E=new Float32Array(y.typedArray.buffer,y.typedArray.byteOffset,y.typedArray.byteLength/4);let T=[];for(let S=0;S<o.verticesCount;S++)Cesium.Cartesian3.fromArray(E,x*S,v),C&&(v=Cesium.Cartesian3.multiplyByScalar(v,w,v),v=Cesium.Cartesian3.add(v,A,v)),T.push(Cesium.Cartesian3.clone(v));return Cesium.BoundingSphere.fromPoints(T,m),Cesium.BoundingSphere.transform(m,f,m),T.length=0,m}function XLi(o){let f=new Cesium.Cartesian3,m=new Cesium.BoundingSphere,v=o.instanceBounds;if(!Cesium.defined(v))return m;let y=new Cesium.Cartesian3(v[0],v[1],v[2]),x=new Cesium.Carteisan3(v[3],v[4],v[5]),C=new Cesium.Cartesian3.lerp(y,x,.5,f),w=new Cesium.Cartesian3.distance(C,y);return m.center=C,m.radius=w,m}function JLi(o,f){return o.instanceIndex>-1?XLi(o):qLi(o,f)}function KLi(o,f,m,v,y){let x=new Cesium.Matrix3,C={},w=v.geodes;for(let A=0,E=w.length;A<E;A++){let T=w[A],S=T.matrix,M=Cesium.Matrix4.multiply(o.modelMatrix,S,new Cesium.Matrix4),I;if(Cesium.defined(y.boundingVolume)){if(y.boundingVolume.sphere)I=new Cesium.BoundingSphere(y.boundingVolume.sphere.center,y.boundingVolume.sphere.radius),Cesium.BoundingSphere.transform(I,o.modelMatrix,I);else if(y.boundingVolume.box){let D=y.boundingVolume.box,L=new Cesium.Cartesian3(D.center.x,D.center.y,D.center.z),R=new Cesium.Cartesian4(D.xExtent.x,D.xExtent.y,D.xExtent.z,0),O=new Cesium.Cartesian4(D.yExtent.x,D.yExtent.y,D.yExtent.z,0),F=new Cesium.Cartesian4(D.zExtent.x,D.zExtent.y,D.zExtent.z,0),k=new Cesium.Matrix3;Cesium.Matrix3.setColumn(k,0,R,k),Cesium.Matrix3.setColumn(k,1,O,k),Cesium.Matrix3.setColumn(k,2,F,k),L=Cesium.Matrix4.multiplyByPoint(o.modelMatrix,L,L);let U=Cesium.Matrix4.getMatrix3(o.modelMatrix,x);k=Cesium.Matrix3.multiply(U,k,k),I=new Cesium.OrientedBoundingBox(L,k)}}let P=T.skeletonNames;for(let D=0,L=P.length;D<L;D++){let R=P[D],O=f.geoPackage[R],F=O.vertexPackage,k=O.arrIndexPackage,U=O.pickInfo,G;k.length>0&&(G=m[k[0].materialCode]);let j=JLi(F,M);C[R]=mst[o.fileType]({layer:o,vertexPackage:F,arrIndexPackage:k,pickInfo:U,modelMatrix:M,geoMatrix:S,boundingVolume:j,material:G,edgeGeometry:O.edgeGeometry,geoName:R})}}if(!(Object.keys(C).length<1)){if(!Cesium.defined(y.boundingVolume)){let A=[];for(let E in C)C.hasOwnProperty(E)&&A.push(C[E].boundingVolume);y.boundingVolume={sphere:Cesium.BoundingSphere.fromBoundingSpheres(A)}}y.geoMap=C}}function QLi(o,f,m){let v=f.groupNode,y=[];for(let x=0,C=v.pageLods.length;x<C;x++){let w={},A=v.pageLods[x];if(w.rangeMode=A.rangeMode,w.rangeDataList=A.childTile,w.rangeList=A.rangeList,A.obb)w.boundingVolume={box:{center:A.obb.obbCenter,xExtent:A.obb.xExtent,yExtent:A.obb.yExtent,zExtent:A.obb.zExtent}};else{let E=A.boundingSphere.center,T=A.boundingSphere.radius;w.rangeDataList!==""?w.boundingVolume={sphere:{center:new Cesium.Cartesian3(E.x,E.y,E.z),radius:T}}:w.isLeafTile=!0}KLi(o,f,m,A,w),Cesium.defined(w.geoMap)&&y.push(w)}return y}gst.parse=function(o,f,m){if(!Cesium.defined(f))return;let v=YLi(o.context,f,m);return QLi(o,f,v)};var _st=gst;var ZLi={Distance:0,Pixel:1,GeometryError:2},g4=Object.freeze(ZLi);function M_(o,f,m,v,y,x){this.layer=o,this.parent=f;let C=v.replace(/\\/g,"/");this.fileExtension=Cesium.getExtensionFromUri(v),this.relativePath=eRi(C,o),this.relativePath=this.relativePath.replace("data/path/data/path","data/path"),this.fileName=v,this.isLeafTile=y===0,this.isRootTile=!1,this.boundingVolume=this.createBoundingVolume(m,o.modelMatrix);let w=Cesium.Resource.createIfNeeded(o._baseResource);if(Cesium.defined(f))this.baseUri=f.baseUri;else{let A=new Cesium.Resource(C);this.baseUri=A.getBaseUri()}this.contentResource=w.getDerivedResource({url:this.relativePath}),this.serverKey=Cesium.RequestScheduler.getServerKey(this.contentResource.getUrlComponent()),this.request=void 0,this.cacheNode=void 0,this.distanceToCamera=0,this.centerZDepth=0,this.pixel=0,this.depth=f?f.depth+1:0,this.visibilityPlaneMask=0,this.visible=!1,this.children=[],this.renderEntities=[],this.lodRangeData=Cesium.defaultValue(y,16),this.lodRangeMode=Cesium.defaultValue(x,g4.Pixel),this.contentState=this.isLeafTile?hA.READY:hA.UNLOADED,this.touchedFrame=0,this.requestedFrame=0,this.processFrame=0,this.selectedFrame=0,this.updatedVisibilityFrame=0,this.foveatedFactor=0,this.priority=0,this.priorityHolder=this,this.wasMinPriorityChild=!1,this.shouldSelect=!1,this.selected=!1,this.finalResolution=!0,this.refines=!1}Object.defineProperties(M_.prototype,{renderable:{get:function(){let o=this.renderEntities,f=o.length;if(f===0)return!1;for(let m=0;m<f;m++)if(!o[m].ready)return!1;return!0}}});function $Li(o,f){let m=new Cesium.Cartesian3,v=Cesium.Cartesian3.clone(o.center),y=o.radius;v=Cesium.Matrix4.multiplyByPoint(f,v,v);let x=Cesium.Matrix4.getScale(f,m),C=Cesium.Cartesian3.maximumComponent(x);return y*=C,new Cesium.TileBoundingSphere(v,y)}function eRi(o,f){o=o.replace(/\+/g,"%2B");let m=f._basePath;if(!(f._basePath.indexOf("realspace")>-1))return o;let y=m.replace(/(.*realspace)/,"");return m.replace(/\/rest\/realspace/g,"").replace(y,"")+"/rest/realspace"+y+"data/path/"+o.replace(/^\.*/,"").replace(/^\//,"").replace(/\/$/,"")}function tRi(o,f){let m=new Cesium.Matrix3,v=new Cesium.Cartesian3;if(Cesium.defined(o.center)){let S=new Cesium.Cartesian3(o.center.x,o.center.y,o.center.z),M=new Cesium.Cartesian4(o.xExtent.x,o.xExtent.y,o.xExtent.z,0),I=new Cesium.Cartesian4(o.yExtent.x,o.yExtent.y,o.yExtent.z,0),P=new Cesium.Cartesian4(o.zExtent.x,o.zExtent.y,o.zExtent.z,0),D=new Cesium.Matrix3;Cesium.Matrix3.setColumn(D,0,M,D),Cesium.Matrix3.setColumn(D,1,I,D),Cesium.Matrix3.setColumn(D,2,P,D),S=Cesium.Matrix4.multiplyByPoint(f,S,S);let L=Cesium.Matrix4.getMatrix3(f,m);return D=Cesium.Matrix3.multiply(L,D,D),new Cesium.TileOrientedBoundingBox(S,D)}let y=new Cesium.Cartesian3(o.min.x,o.min.y,o.min.z);Cesium.Matrix4.multiplyByPoint(f,y,y);let x=new Cesium.Cartesian3(o.max.x,o.max.y,o.max.z);Cesium.Matrix4.multiplyByPoint(f,x,x);let C=Cesium.BoundingSphere.fromCornerPoints(y,x,new Cesium.BoundingSphere),w=C.center,A=C.radius,E=Cesium.Matrix4.getScale(f,v),T=Cesium.Cartesian3.maximumComponent(E);return A*=T,new Cesium.TileBoundingSphere(w,A)}M_.prototype.createBoundingVolume=function(o,f){if(Cesium.defined(o.sphere))return $Li(o.sphere,f);if(Cesium.defined(o.box))return tRi(o.box,f)};M_.prototype.canTraverse=function(){return this.children.length===0||this.isLeafTile?!1:Cesium.defined(this.lodRangeData)?this.pixel>this.lodRangeData:!0};function tMe(o,f){return o.boundingVolume}M_.prototype.getPixel=function(o){let m=this.boundingVolume.boundingSphere,v=m.radius,y=m.center,x=Cesium.Cartesian3.distance(o.camera.positionWC,y),C=o.context.drawingBufferHeight,w=o.camera.frustum._fovy*.5;return C*.5/Math.tan(w)*v/x};M_.prototype.getGeometryError=function(o){let f=o.camera,m=this.layer.context.drawingBufferHeight,v=this.lodRangeData,y=this.boundingVolume.distanceToCamera(o);return v*m/(y*f.frustum.sseDenominator)};M_.prototype.distanceToTile=function(o){return tMe(this,o).distanceToCamera(o)};M_.prototype.distanceToTileCenter=function(o){let f=new Cesium.Cartesian3,v=tMe(this,o).boundingVolume,y=Cesium.Cartesian3.subtract(v.center,o.camera.positionWC,f);return Cesium.Cartesian3.dot(o.camera.directionWC,y)};M_.prototype.visibility=function(o,f){let m=tMe(this,o);return o.cullingVolume.computeVisibilityWithPlaneMask(m,f)};function iRi(o,f){let m=new Cesium.Cartesian3,v=f.camera,x=o.boundingVolume.boundingSphere,C=x.radius,w=Cesium.Cartesian3.multiplyByScalar(v.directionWC,o.centerZDepth,m),A=Cesium.Cartesian3.add(v.positionWC,w,m),E=Cesium.Cartesian3.subtract(A,x.center,m);if(Cesium.Cartesian3.magnitude(E)>C){let M=Cesium.Cartesian3.normalize(E,m),I=Cesium.Cartesian3.multiplyByScalar(M,C,m),P=Cesium.Cartesian3.add(x.center,I,m),D=Cesium.Cartesian3.subtract(P,v.positionWC,m),L=Cesium.Cartesian3.normalize(D,m);o.foveatedFactor=1-Math.abs(Cesium.Cartesian3.dot(v.directionWC,L))}else o.foveatedFactor=0}M_.prototype.updateVisibility=function(o,f){let m=this.parent,v=Cesium.defined(m)?m.visibilityPlaneMask:Cesium.CullingVolume.MASK_INDETERMINATE;this.distanceToCamera=this.distanceToTile(o),this.centerZDepth=this.distanceToTileCenter(o),this.pixel=this.getPixel(o),this.geometryError=this.getGeometryError(o),this.visibilityPlaneMask=this.visibility(o,v),this.visible=this.visibilityPlaneMask!==Cesium.CullingVolume.MASK_OUTSIDE&&this.distanceToCamera>=f.visibleDistanceMin&&this.distanceToCamera<=f.visibleDistanceMax,this.priorityDeferred=iRi(this,o)};function rRi(o){return function(){return o.priority}}function nRi(o){return function(f){o.contentState=hA.FAILED,o.contentReadyPromise&&o.contentReadyPromise.reject(f)}}function oRi(o,f){let m=o.layer,v=f.length,y=Number.MAX_VALUE,x=0,C=g4.Pixel;for(let w=0;w<v;w++){let A=f[w],E=A.boundingVolume,T=A.rangeDataList;T=o.baseUri+T;let S=A.rangeList,M=A.rangeMode,I=A.geoMap;if(S!==0){let P=new M_(m,o,E,T,S,M);o.children.push(P),m._cache.add(P)}for(let P in I)I.hasOwnProperty(P)&&o.renderEntities.push(I[P]);y=Math.min(y,S),x=Math.max(x,S),C=M}o.isRootTile&&(o.lodRangeData=C===g4.Pixel?y/2:x*2,o.lodRangeMode=C)}function aRi(o,f,m){o._cache.add(f),xX.s3tc=o.context.s3tc,xX.pvrtc=o.context.pvrtc,xX.etc1=o.context.etc1;let v=xX.parseBuffer(m);if(!v){f.contentState=hA.FAILED,f.contentReadyPromise.reject();return}let y=_st.parse(o,v,f);oRi(f,y),f.selectedFrame=0,f.contentState=hA.READY,f.contentReadyPromise.resolve(v)}M_.prototype.requestContent=function(){let o=this,f=this.layer,m=this.contentResource.clone(),v=new Cesium.Request({throttle:!0,throttleByServer:!0,type:Cesium.RequestType.TILES3D,priorityFunction:rRi(this),serverKey:this.serverKey});this.request=v,m.request=v;let y=m.fetchArrayBuffer();if(!Cesium.defined(y))return!1;this.contentState=hA.LOADING,this.contentReadyPromise=Cesium.when.defer();let x=nRi(this);return y.then(function(C){if(o.isDestroyed()){x();return}aRi(f,o,C)}).catch(function(C){if(v.state===Cesium.RequestState.CANCELLED){o.contentState=hA.UNLOADED;return}x(C)}),!0};function $Ie(o,f,m){return Math.max(Cesium.Math.normalize(o,f,m)-Cesium.Math.EPSILON7,0)}function eMe(o,f,m){let v=o*Math.pow(10,f);return parseInt(v)*Math.pow(10,m)}M_.prototype.updatePriority=function(o,f){let m=o._minimumPriority,v=o._maximumPriority,y=4,x=4,C=$Ie(this.foveatedFactor,m.foveatedFactor,v.foveatedFactor),w=eMe(C,x,y);y=8;let A=$Ie(this.pixel,m.pixel,v.pixel),E=eMe(1-A,x,y);y=0;let T=$Ie(this.distanceToCamera,m.distance,v.distance),S=eMe(T,x,y);this.priority=w+E+S};M_.prototype.update=function(o,f){for(let m=0,v=this.renderEntities.length;m<v;m++)this.renderEntities[m].update(o,f)};M_.prototype.free=function(){this.contentState=hA.UNLOADED,this.request=void 0,this.cacheNode=void 0,this.priorityHolder=void 0,this.contentReadyPromise=void 0,this.priorityHolder=void 0;for(let o=0,f=this.renderEntities.length;o<f;o++)this.renderEntities[o].destroy();this.renderEntities.length=0,this.children.length=0};M_.prototype.isDestroyed=function(){return!1};M_.prototype.destroy=function(){return this.free(),Cesium.destroyObject(this)};var vst=M_;function yst(){this._stack=[]}function sRi(o,f){return f.distanceToCamera===0&&o.distanceToCamera===0?f.centerZDepth-o.centerZDepth:f.distanceToCamera-o.distanceToCamera}function lRi(o,f,m,v){let y,x=f.children,C=x.length;for(y=0;y<C;++y)wst(v,o,x[y]);x.sort(sRi);let w=!0,A=!1,E=-1,T=Number.MAX_VALUE,S=!0;for(y=0;y<C;++y){let M=x[y];M.foveatedFactor<T&&(E=y,T=M.foveatedFactor),M.visible?(m.push(M),A=!0):(xst(o,M,v),bst(o,M,v),Cst(o,M,v));let I=M.renderable;S&&(w=w&&I)}if(A||(w=!1),E!==-1){let M=x[E];M.wasMinPriorityChild=!0;let I=(f.wasMinPriorityChild||f.isRootTile)&&T<=f.priorityHolder.foveatedFactor?f.priorityHolder:f;for(I.foveatedFactor=Math.min(M.foveatedFactor,I.foveatedFactor),I.distanceToCamera=Math.min(M.distanceToCamera,I.distanceToCamera),y=0;y<C;++y){let P=x[y];P.priorityHolder=I}}return w}function uRi(o,f,m){f.selectedFrame===m.frameNumber||!f.renderable||(o._selectedTiles.push(f),f.selectedFrame=m.frameNumber)}function xst(o,f,m){f.requestedFrame===m.frameNumber||f.contentState!==hA.UNLOADED||(o._requestTiles.push(f),f.requestedFrame=m.frameNumber)}function Cst(o,f,m){f.processFrame===m.frameNumber||f.contentState!==hA.READY||f.renderable||(f.processFrame=m.frameNumber,o._processTiles.push(f))}function bst(o,f,m){f.touchedFrame!==m.frameNumber&&(o._cache.touch(f),f.touchedFrame=m.frameNumber)}function cRi(o,f,m){f.updatedVisibilityFrame!==m.frameNumber&&(f.updatedVisibilityFrame=m.frameNumber,f.updateVisibility(m,o))}function hRi(o,f,m){cRi(f,m,o)}function dRi(o,f){o._maximumPriority.distance=Math.max(f.distanceToCamera,o._maximumPriority.distance),o._minimumPriority.distance=Math.min(f.distanceToCamera,o._minimumPriority.distance),o._maximumPriority.depth=Math.max(f.depth,o._maximumPriority.depth),o._minimumPriority.depth=Math.min(f.depth,o._minimumPriority.depth),o._maximumPriority.foveatedFactor=Math.max(f.foveatedFactor,o._maximumPriority.foveatedFactor),o._minimumPriority.foveatedFactor=Math.min(f.foveatedFactor,o._minimumPriority.foveatedFactor),o._maximumPriority.pixel=Math.max(f.pixel,o._maximumPriority.pixel),o._minimumPriority.pixel=Math.min(f.pixel,o._minimumPriority.pixel)}function wst(o,f,m){hRi(o,f,m),m.wasMinPriorityChild=!1,m.priorityHolder=m,dRi(f,m),m.shouldSelect=!1,m.selected=!1}function fRi(o,f){return f.children.length===0?!1:f.lodRangeMode===g4.Pixel?f.pixel/o.lodRangeScale>f.lodRangeData:f.lodRangeMode===g4.GeometryError?f.geometryError>16:f.distanceToCamera*o.lodRangeScale<f.lodRangeData}function pRi(o,f,m){for(;f.length;){let v=f.pop(),y=v.parent,x=!Cesium.defined(y)||y.refines,C=!1;fRi(o,v)&&(C=lRi(o,v,f,m)&&x);let w=!C&&x;xst(o,v,m),Cst(o,v,m),w&&uRi(o,v,m),bst(o,v,m),v.refines=C}}function mRi(o,f,m){f.length=0;for(let v=0,y=o._rootTiles.length;v<y;v++){let x=o._rootTiles[v];wst(m,o,x),x.visible&&f.push(x)}}function gRi(o,f){let m=o._requestTiles,v=m.length;for(let y=0;y<v;++y)m[y].updatePriority(o,f)}yst.prototype.schedule=function(o,f){let m=this._stack;mRi(o,m,f),pRi(o,m,f),gRi(o,f)};var Ast=yst;var CX=null;function _4(o){CX=o,this._list=new CX.DoublyLinkedList,this._sentinel=this._list.add(),this._trimTiles=!1}_4.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};_4.prototype.touch=function(o){let f=o.cacheNode;CX.defined(f)&&this._list.splice(this._sentinel,f)};_4.prototype.add=function(o){CX.defined(o.cacheNode)||(o.cacheNode=this._list.add(o))};_4.prototype.unloadTile=function(o,f,m){let v=f.cacheNode;!CX.defined(v)||(this._list.remove(v),f.cacheNode=void 0,m(o,f))};_4.prototype.unloadTiles=function(o,f){let m=this._trimTiles;this._trimTiles=!1;let v=this._list,y=o.maximumMemoryUsage*1024*1024,x=this._sentinel,C=v.head;for(;C&&C!==x&&(o.totalMemoryUsageInBytes>y||m);){let w=C.item;C=C.next,this.unloadTile(o,w,f)}};_4.prototype.trim=function(){this._trimTiles=!0};var Est=_4;var _Ri={RESET:0,SetColor:1,SELECTED:2,HIDE:4,OFFSET:8,CLIP:16,BLOOM:32,ALL:255},bX=Object.freeze(_Ri);var SC=null;function Tst(o){SC=o,this._fillForeColor=new SC.Color,this._lineColor=new SC.Color,this._lineWidth=1,this._bottomAltitude=0,this._pointSize=1,this._pointColor=new SC.Color}Object.defineProperties(Tst.prototype,{fillForeColor:{get:function(){return this._fillForeColor},set:function(o){SC.Check.typeOf.object("fillForeColor value",o),SC.Color.clone(o,this._fillForeColor)}},bottomAltitude:{get:function(){return this._bottomAltitude},set:function(o){SC.Check.typeOf.number("bottomAltitude value",o),this._bottomAltitude!==o&&(this._bottomAltitude=o,this._dirty=!0)}},altitudeMode:{get:function(){return this._altitudeMode},set:function(o){SC.Check.typeOf.number("altitudeMode value",o),this._altitudeMode=o}},lineColor:{get:function(){return this._lineColor},set:function(o){SC.Check.typeOf.object("line color",o),SC.Color.clone(o,this._lineColor)}},lineWidth:{get:function(){return this._lineWidth},set:function(o){SC.Check.typeOf.number("line width",o),this._lineWidth=o}},pointSize:{get:function(){return this._pointSize},set:function(o){SC.Check.typeOf.number("point size",o),this._pointSize=o}},pointColor:{get:function(){return this._pointColor},set:function(o){SC.Check.typeOf.object("point color",o),SC.Color.clone(o,this._pointColor)}}});var Sst=Tst;var Nc=null;function Kv(o,f,m){Nc=m,o=Nc.defaultValue(o,Nc.defaultValue.EMPTY_OBJECT),Nc.Check.defined("options.url",o.url),Nc.Check.defined("options.context",o.scene),this.id=Nc.createGuid(),this.name=o.name,this.scene=o.scene,this.context=this.scene._context,this.show=!0,this._url=void 0,this._basePath=void 0,this._baseResource=void 0,this.modelMatrix=new Nc.Matrix4,this.invModelMatrix=new Nc.Matrix4,this._visibleDistanceMax=Nc.defaultValue(o.far,Number.MAX_VALUE),this._visibleDistanceMin=Nc.defaultValue(o.near,0),this._lodRangeScale=Nc.defaultValue(o.lodRangeScale,1),this._selectedColor=new Nc.Color(1,0,0,1),this.fileType=void 0,this._position=void 0,this._rectangle=void 0,this._rootTiles=[],this._schuduler=new Ast,this._selections=[],this._objsOperationList={},this._requestTiles=[],this._processTiles=[],this._selectedTiles=[],this._cache=new Est(Nc),this._maximumMemoryUsage=-1,this._totalMemoryUsageInBytes=0,this._vertexCompressionType=void 0,this._style3D=new Sst(Nc),this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,pixel:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,pixel:Number.MAX_VALUE},this._readyPromise=Nc.defer(),this.loadConfig(o.url),this.scene.primitives.add(this),this.readyPromise.promise.then(()=>{f&&f(this)}).catch(function(v){console.log(v)})}Object.defineProperties(Kv.prototype,{ready:{get:function(){return this._rootTiles.length>0}},readyPromise:{get:function(){return this._readyPromise}},rectangle:{get:function(){return this._rectangle}},visibleDistanceMax:{get:function(){return this._visibleDistanceMax},set:function(o){Nc.Check.typeOf.number("max visible distance",o),this._visibleDistanceMax=o}},visibleDistanceMin:{get:function(){return this._visibleDistanceMin},set:function(o){Nc.Check.typeOf.number("min visible distance",o),this._visibleDistanceMin=o}},lodRangeScale:{get:function(){return this._lodRangeScale},set:function(o){Nc.Check.typeOf.number("set layer lod range scale",o),this._lodRangeScale=o}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes},set:function(o){this._totalMemoryUsageInBytes=o}},maximumMemoryUsage:{get:function(){return this._maximumMemoryUsage},set:function(o){this._maximumMemoryUsage=o}},style3D:{get:function(){return this._style3D},set:function(o){this._style3D=o}}});Kv.prototype.loadConfig=function(o,f){let m=this;Promise.all([o]).then(function(v){let y,x=Nc.Resource.createIfNeeded(v);return y=x.getBaseUri(!0),m._url=x.url,m._basePath=y,m._baseResource=x,f?x.fetchXML():x.fetchJson()}).then(function(v){f&&(v=J6(v));let y=v.extensions;y?(m.fileType=y["s3m:FileType"],m._vertexCompressionType=y["s3m:VertexCompressionType"]):m.fileType=v.FileType;let x=v.position||v.Position,C=x.x||x.X,w=x.y||x.Y,A=x.z||x.Z;if(m._position=Nc.Cartesian3.fromDegrees(C,w,A),m.modelMatrix=Nc.Transforms.eastNorthUpToFixedFrame(m._position),m.invModelMatrix=Nc.Matrix4.inverse(m.modelMatrix,m.invModelMatrix),v.heightRange?(m._minHeight=v.heightRange.min,m._maxHeight=v.heightRange.max):v.HeightRange&&(m._minHeight=v.HeightRange.MinHeight,m._maxHeight=v.HeightRange.MaxHeight),v.geoBounds?m._rectangle=Nc.Rectangle.fromDegrees(v.geoBounds.left,v.geoBounds.bottom,v.geoBounds.right,v.geoBounds.top):m.viewPosition=Nc.Cartesian3.fromDegrees(C,w,m._maxHeight),v.wDescript){let T=v.wDescript.range;m._minWValue=T.min,m._maxWValue=T.max}let E=v.tiles||v.rootTiles||v.OSGFiles&&v.OSGFiles.Files;for(let T=0,S=E.length;T<S;T++){let M=E[T];if(M){let I=M.url||M.FileName,P={box:M.boundingbox};M.BoundingSphere&&(P.sphere={radius:M.BoundingSphere.Radius,center:new Nc.Cartesian3(M.BoundingSphere.CenterX,M.BoundingSphere.CenterY,M.BoundingSphere.CenterZ)});let D=new vst(m,void 0,P,I);D.isRootTile=!0,m._cache.add(D),m._rootTiles.push(D)}}m._readyPromise.resolve(m)}).catch(function(v){f?m._readyPromise.reject(v):m.loadConfig(o,!0)})};Kv.prototype._tranverseRenderEntity=function(o,f){let m=[];for(let v=0,y=this._rootTiles.length;v<y;v++){let x=this._rootTiles[v];m.push(x)}for(;m.length;){let v=m.pop();for(let y=0,x=v.renderEntities.length;y<x;y++){let C=v.renderEntities[y];C.ready&&f(C,o)}for(let y=0,x=v.children.length;y<x;y++)m.push(v.children[y])}};function vRi(o,f){o.updateObjsOperation(f.ids,f)}Kv.prototype._updateObjsOperation=function(o){this._tranverseRenderEntity({ids:o},vRi)};Kv.prototype._setObjsOperationType=function(o,f){Nc.Check.defined("set Objs Operation ids",o),Nc.Check.defined("set Objs Operation operationType",f),Array.isArray(o)||(o=[o]);let m=new Nc.AssociativeArray,v;for(let y=0,x=o.length;y<x;y++){if(v=o[y],!Nc.defined(v))continue;let C=Nc.defaultValue(this._objsOperationList[v],0);C!==f&&(C=C|f,this._objsOperationList[v]=C,m.set(v,C))}m.length>0&&this._updateObjsOperation(m._hash)};Kv.prototype._removeObjsOperationType=function(o,f){Nc.Check.defined("set Objs Operation ids",o),Array.isArray(o)||(o=[o]);let m=bX.ALL^f,v=new Nc.AssociativeArray,y;for(let x=0,C=o.length;x<C;x++){y=o[x];let w=this._objsOperationList[y];!Nc.defined(w)||(w&=m,w===bX.RESET?delete this._objsOperationList[y]:this._objsOperationList[y]=w,v.set(y,w))}v.length>0&&this._updateObjsOperation(v._hash)};Kv.prototype.releaseSelection=function(){this._selections.length<1||(this._removeObjsOperationType(this._selections,bX.SELECTED),this._selections.length=0)};Kv.prototype.setSelection=function(o){Nc.Check.defined("setSelection ids",o),Array.isArray(o)||(o=[o]),this.releaseSelection(),this._selections=this._selections.concat(o),this._setObjsOperationType(o,bX.SELECTED)};function yRi(o,f){return o.priority-f.priority}function xRi(o){let f=o._requestTiles,m=f.length;f.sort(yRi);for(let v=0;v<m;++v)f[v].requestContent()}function CRi(o,f){let m=o._processTiles,v=m.length;for(let y=0;y<v;++y)m[y].update(f,o)}function bRi(o,f){let m=o._selectedTiles,v=m.length;for(let y=0;y<v;y++)m[y].update(f,o)}function wRi(o,f){f.free()}function Pst(o){o._cache.unloadTiles(o,wRi)}Kv.prototype.prePassesUpdate=function(o){!this.ready||o.newFrame&&(this._cache.reset(),this._requestTiles.length=0,this._processTiles.length=0,this._selectedTiles.length=0)};Kv.prototype.postPassesUpdate=function(o){!this.ready||Pst(this)};Kv.prototype.update=function(o){!this.ready||!this.show||(this._schuduler.schedule(this,o),xRi(this),CRi(this,o),bRi(this,o))};Kv.prototype.isDestroyed=function(){return!1};Kv.prototype.deleteObject=function(){this.scene.primitives.remove(this)};Kv.prototype.destroy=function(){return this._cache.reset(),Pst(this),this._rootTiles.length=0,this._requestTiles.length=0,this._processTiles.length=0,this._selectedTiles.length=0,Nc.destroyObject(this)};Kv.prototype.setVisibility=function(o){this.show=o};var Kae=Kv;var Ist=`// author: \u5F20\u4E39\u948A czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; if(plus && st.s < time && time - st.s <= 0.1){ material.alpha = 1.0 - (time - st.s) / 0.1; if(material.alpha < 0.3){ material.alpha = 0.3; material.diffuse = color.rgb; }else{ material.diffuse = lightSpotColor.rgb; } }else if(inverse && st.s < (1.0 - time) && (1.0 - time) - st.s <= 0.1){ material.alpha = ((1.0-time) - st.s) / 0.1; if(material.alpha < 0.3){ material.alpha = 0.3; material.diffuse = color.rgb; }else{ material.diffuse = lightSpotColor.rgb; } }else{ material.alpha = 0.3; material.diffuse = color.rgb; } return material; }`;var ar=null,Mst=new Map;function oo(o,f){this._viewer=o,this._cesium=f,ar=this._cesium}oo.prototype.defaultValue=function(o,f){return sm(o,f)};oo.prototype.createRandomId=function(){return(Math.random()*1e7).toString(16).substr(0,4)+"-"+new Date().getTime()+"-"+Math.random().toString().substr(2,5)};oo.prototype.mouse=function(o,f,m){f==1?o.style.cursor="url("+m+"),auto":o.style.cursor="default"};oo.prototype.CreateTooltip=function(o={},f,m){var v,y,x,C,w;typeof o=="object"&&(v=o),v&&v.origin?(v.origin==="center"&&(y=15,x=-12),v.origin==="top"&&(y=15,x=-44),v.origin==="bottom"&&(y=15,x=20)):(y=15,x=20),v&&v.color?(v.color==="white"&&(C="background: rgba(255, 255, 255, 0.8);color: black;"),v.color==="black"&&(C="background: rgba(0, 0, 0, 0.5);color: white;"),v.color==="yellow"&&(C="color: black;background-color: #ffcc33;border: 1px solid white;")):C="background: rgba(0, 0, 0, 0.5);color: white;",v&&v.id?w="toolTip"+v.id:w="toolTip";var A=(this._viewer?this._viewer.container:document).querySelector("#"+w);if(!A){var E=document.createElement("div");$(".cesium-viewer").append(E);var T='<div id="'+w+'" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;'+C+'"></div>';$(".cesium-viewer").append(T),A=document.getElementById(w)}return m?(A.innerHTML=o,A.style.left=f.x+y+"px",A.style.top=f.y+x+"px",A.style.display="block"):A.style.display="none",{tooltip:A,style:v,showAt:function(S,M){this.tooltip.innerHTML=M,this.style&&this.style.origin?(this.style.origin==="center"&&(y=15,x=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(y=15,x=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(y=15,x=20)):(y=15,x=-this.tooltip.offsetHeight/2),this.tooltip.style.left=S.x+y+"px",this.tooltip.style.top=S.y+x+"px",this.tooltip.style.display="block"},show:function(S){S?this.tooltip.style.display="block":this.tooltip.style.display="none"}}};oo.prototype.getWMTSData=function(o,f){Vat(o.url+"?service=WMTS&request=GetCapabilities",ar).then(m=>{let v=m.xmlObj,y,x,C,w={};if(o.gisserverTMS)y=J6(v),x=y.Contents&&y.Contents.Layer;else{let A=v.getElementsByTagName("Layer");for(let E=0,T;E<A.length;E++)if(T=A[E].getElementsByTagName("ows:Identifier"),T&&T[0]&&T[0].innerHTML===o.layer){v=A[E];break}x=J6(v)}if(x){let A=x.TileMatrixSetLink,E=x.WGS84BoundingBox;if(E){let S=E.LowerCorner.split(" "),M=E.UpperCorner.split(" ");C=ar.BoundingSphere.fromPoints([ar.Cartesian3.fromDegrees(S[0],S[1]),ar.Cartesian3.fromDegrees(M[0],M[1])])}let T;if(o.gisserverTMS)T=A;else{let S=o.srs||"EPSG:4326";T=A.filter(M=>M.TileMatrixSet===S)[0]}T&&T.TileMatrixSetLimits&&T.TileMatrixSetLimits.TileMatrixLimits.forEach(S=>{let M=S.TileMatrix;M=M.split(":");let I=M[M.length-1];w[I]={maxCol:S.MaxTileCol,minCol:S.MinTileCol,maxRow:S.MaxTileRow,minRow:S.MinTileRow}})}f&&f({boundingSphere:C,TileMatrixLimits:w})})};oo.prototype.getPointToCameraDistance=function(o,f){let m;if(o.scene.mode===2){let v=o.camera.positionCartographic.clone();m=ar.Cartesian3.distance(f,ar.Cartesian3.fromRadians(v.longitude,v.latitude,v.height))}else m=this._cesium.Cartesian3.distance(f,o.camera.position);return m};oo.prototype.getPositionFromHR=function(o,f,m,v=0){var y=6378137,x=6356725,C=m*Math.sin(v*Math.PI/180),w=m*Math.cos(v*Math.PI/180),A=x+(y-x)*(90-f)/90,E=A*Math.cos(f*Math.PI/180),T=(C/E+o*Math.PI/180)*180/Math.PI,S=(w/A+f*Math.PI/180)*180/Math.PI;return[T,S]};oo.prototype.getPositionFromHPR=function(o,f,m=0,v=0){let y=Math.cos(ar.Math.toRadians(v))*f,x=Math.sin(ar.Math.toRadians(v))*f,C=this.getPositionFromHR(o[0],o[1],y,m);return{lon:C[0],lat:C[1],height:o[2]+x}};oo.prototype.CreateResultTooltip=function(o,f={}){var m,v,y;let x=f.id?"resultToolTip"+f.id:"resultToolTip";var C=document.getElementById(x);if(f.color?(f.color==="white"&&(y="background: rgba(255, 255, 255, 0.8);color: black;"),f.color==="black"&&(y="background: rgba(0, 0, 0, 0.5);color: white;"),f.color==="blue"&&(y="background: rgba(48, 119, 221);color: white;"),f.color==="yellow"&&(y="color: black;background-color: #ffcc33;border: 1px solid white;")):y="color: black;background-color: #ffcc33;border: 1px solid white;",!C){var w='<div id="'+x+'" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;'+y+'"></div>';$(o.container).append(w),C=document.getElementById(x)}var A=f.addX||0,E=f.addY||0,T,S=this;f.closeBtn&&(C.className="resultToolTip resultToolTipClose",C.onclick=()=>{C.style.display="none",T=void 0,f.close&&f.close()});function M(){if(T){if(f.far!==void 0||f.near!==void 0){let P=S.getPointToCameraDistance(o,T);if(P>f.far){C.style.display="none";return}else if(P<f.near){C.style.display="none";return}else C.style.display="block"}var I=o.scene.cartesianToCanvasCoordinates(T);if(!I)return;m=-C.offsetWidth/2+A,v=-C.offsetHeight+E,C.style.left=I.x+m+"px",C.style.top=I.y+v+"px"}}return o.clock.onTick.addEventListener(M),{tooltip:C,position:T,showAt:function(I,P){if(this.tooltip.innerHTML=P,this.tooltip.style.display="block",this.position=I,T=I,T){var D=o.scene.cartesianToCanvasCoordinates(T);if(!D)return;m=-this.tooltip.offsetWidth/2+A,v=-this.tooltip.offsetHeight+E,this.tooltip.style.left=D.x+m+"px",this.tooltip.style.top=D.y+v+"px"}},show:function(I){I?(this.tooltip.style.display="block",T=this.position):(this.tooltip.style.display="none",T=void 0)},destroy(){o.clock.onTick.removeEventListener(M),C.remove()}}};oo.prototype.CombineEcharts=function(o,f,m){return this._CombineEcharts||(this._CombineEcharts=new Rat(o,ar)),this._CombineEcharts.setOption(f,m)};oo.prototype.getHeatmapData=function(o,f,m=600){let v=[];for(let y=0;y<m;y++){let x=Math.random()*(o.east-o.west)+o.west,C=Math.random()*(o.north-o.south)+o.south,w=f.value||Math.random()*(f.max-f.min)+f.min;v.push({x,y:C,value:w})}return v};oo.prototype.pickFromRay=function(o,f,m,v=[]){if(f.equals(m))return;let y=ar.Cartesian3.normalize(ar.Cartesian3.subtract(m,f,new ar.Cartesian3),new ar.Cartesian3),x=new ar.Ray(f,y);return o.scene.pickFromRay(x,v)};oo.prototype.openLocalFile=function(o={}){let f=document.createElement("input");f.accept=o.accept,f.type="file",o.multiple&&(f.multiple="multiple"),f.onchange=function(){if(typeof o.callback=="function"&&f.files.length)if(o.multiple){let m=[],v=[];for(let y=0;y<f.files.length;y++)m.push(URL.createObjectURL(f.files[y])),v.push(f.files[y]);o.callback(m,v)}else o.callback(URL.createObjectURL(f.files[0]),f.files[0])},f.click()};oo.prototype.openShapeFile=function(o,f){this.openLocalFile({multiple:!0,accept:".shp,.dbf",callback:(m,v)=>{let y=new Map;v.forEach((x,C)=>{let w=x.name.substring(0,x.name.length-4),A=y.get(w);A||(y.set(w,{shp:void 0,dbf:void 0}),A=y.get(w)),x.name.includes(".shp")?A.shp=m[C]:A.dbf=m[C]}),y.forEach((x,C)=>{x.shp?this.loadShpFile({shp:x.shp,dbf:x.dbf,encoding:f,fileName:C},o):console.error("\u8BF7\u9009\u62E9"+C+".shp\u6587\u4EF6")})}})};oo.prototype.loadShpFile=function({fileName:o,shp:f,dbf:m,encoding:v},y){return window.shapefile||new Y0(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/shapefile.js"),shapefile.open(f,m,{encoding:v||"utf-8"}).then(x=>x.read().then(function C(w){if(!w.done)return ar.GeoJsonDataSource.load(w.value,{clampToGround:!0}).then(A=>{y&&o?y(o,A.entities.values[0]):y(A.entities.values[0])}),x.read().then(C)})).catch(x=>console.error(x.stack))};oo.prototype.getGifImageProperty=function(o,f=6){if(!o||o.indexOf(".gif")===-1)return o;window.SuperGif||new Y0(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/libgif.js");let m=document.createElement("img");m.src=o,m.setAttribute("rel:animated_src",o),m.setAttribute("rel:auto_play","0"),document.body.appendChild(m);let v=new SuperGif({gif:m}),y=[];new Promise(C=>{v.load(()=>{for(let w=1;w<=v.get_length();w++)v.move_to(w),y.push(v.get_canvas().toDataURL());C(y)})});let x=0;return new ar.CallbackProperty(function(){return y.length?(x<f*(y.length-1)?x++:x=0,y[Math.floor(x/f)===y.length-1?0:Math.floor(x/f)]):o},!1)};oo.prototype.isDOM=function(o){return typeof HTMLElement=="object"?o instanceof HTMLElement:o&&typeof o=="object"&&o.nodeType===1&&typeof o.nodeName=="string"};oo.prototype.getJSON=function(o,f){let m=new XMLHttpRequest;m.responseType="json",m.open("get",o,!0),m.onload=function(){if(m.status>=200&&m.status<300)f(m.response);else throw new Error(m.statusText)},m.send()};oo.prototype.getPositionFromWKT=function(o){let f=o+"!",m,v=[];return f.indexOf("MULTIPOLYGON")>-1?(m=f.replace("MULTIPOLYGON(",""),m=m.replace(")!",""),m=m.split(")),(("),m.forEach((y,x)=>{let C;m.length===1?C=y.substring(1,y.length-1):x===0?C=y.substring(1,y.length)+")":x===m.length-1?C="("+y.substring(0,y.length-1):C="("+y+")",C=C.split("),("),C.forEach((w,A)=>{let E;C.length===1?E=w.substring(1,w.length-1):A===0?E=w.substring(1,w.length):A===C.length-1&&(E=w.substring(0,w.length-1)),E=E.split(",");let T=[];E.forEach(S=>{let M=S.split(" ");T.push(ar.Cartesian3.fromDegrees(M[0],M[1]))}),v.push(T)})})):f.indexOf("POLYGON")>-1&&(m=f.replace("POLYGON(",""),m=m.replace(")!",""),m=m.split("),("),m.forEach((y,x)=>{let C;m.length===1?C=y.substring(1,y.length-1):x===0?C=y.substring(1,y.length):x===m.length-1&&(C=y.substring(0,y.length-1)),C=C.split(",");let w=[];C.forEach(A=>{let E=A.split(" ");w.push(ar.Cartesian3.fromDegrees(E[0],E[1]))}),v.push(w)})),v};oo.prototype.VectorSlice=function(o){var f="EPSG:4490";o.port&&(f=o.port);var m={url:o.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:o.layer,STYLE:"",TILEMATRIX:f+":{z}",TILEMATRIXSET:f,FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:o.upperLevelLimit,lowerLevelLimit:o.lowerLevelLimit,rectangle:ar.Rectangle.fromDegrees(o.minx,o.miny,o.maxx,o.maxy)};return m};oo.prototype.arge=function(o,f,m,v="180",y=!1){let x=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),C=Math.sqrt(Math.pow(o.x-m.x,2)+Math.pow(o.y-m.y,2)),w=Math.sqrt(Math.pow(f.x-m.x,2)+Math.pow(f.y-m.y,2)),A=(Math.pow(x,2)+Math.pow(C,2)-Math.pow(w,2))/(2*x*C),E=Math.round(Math.acos(A)*180/Math.PI);if(v==="360"||v==="+-"){let T=y?-1:1;this.isClockwise([[f.x,T*f.y],[o.x,T*o.y],[m.x,T*m.y],[f.x,T*f.y]])||(v==="+-"?E=-E:E=360-E)}return E};oo.prototype.isClockwise=function(o){let f=ar.turf.lineString(o);return ar.turf.booleanClockwise(f)};oo.prototype.saveAs=function(o,f){window.saveAs||new Y0(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/FileSaver.js"),saveAs(o,f)};oo.prototype.getEntityProp=function(o){let f=o.properties&&o.properties.getValue();return{id:o.id,properties:f}};oo.prototype.getEntityPropValue=function(o,f){let m=o.properties&&o.properties.getValue();return f.indexOf("[")>-1&&f.indexOf("]")>-1&&(f=f.replace("[","").replace("]","")),m&&m[f]};oo.prototype.setheight=function(o,f){var m=ar.Cartographic.fromCartesian(o);return ar.Cartesian3.fromRadians(m.longitude,m.latitude,f)};oo.prototype.setpolylineheight=function(o,f){let m=[];return o.forEach(function(v){var y=ar.Cartographic.fromCartesian(v);m.push(ar.Cartesian3.fromRadians(y.longitude,y.latitude,f))}),m};oo.prototype.StyleContrastGeoJson=function(o,f){var m={color:f.Color.WHITE,pixelSize:1,outlineColor:f.Color.BLACK,outlineWidth:0,show:!0,distanceDisplayCondition:new f.DistanceDisplayCondition(0,999999999)},v={id:"my label",text:"",font:"30px sans-serif",fillColor:f.Color.WHITE,outlineColor:f.Color.WHITE,outlineWidth:"10",scale:1,distanceDisplayCondition:new f.DistanceDisplayCondition(0,999999999)},y={show:!0,scale:1,width:void 0,height:void 0,pixelOffset:void 0,color:f.Color.WHITE,image:"",distanceDisplayCondition:new f.DistanceDisplayCondition(0,999999999)},x={positions:[],arcType:f.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:f.Color.RED,height:30},C={height:0,heightReference:f.HeightReference.NONE,show:!0,fill:!0,material:f.Color.WHITE,outline:!1,outlineColor:f.Color.BLACK,outlineWidth:1,stRotation:0,granularity:f.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:f.ShadowMode.ENABLED,clampToGround:!0};this.isnull(o.near)&&(o.near=0),this.isnull(o.far)&&(o.far=999999999);var w=parseFloat(o.near),A=parseFloat(o.far);return delete o.near,delete o.far,o.point!=null&&(o.point=this.extend(m,o.point,!0),o.point.distanceDisplayCondition=new f.DistanceDisplayCondition(w,A)),o.label!=null&&(o.label=this.extend(v,o.label,!0),o.label.distanceDisplayCondition=new f.DistanceDisplayCondition(w,A)),o.billboard!=null&&(o.billboard=this.extend(y,o.billboard,!0),o.billboard.distanceDisplayCondition=new f.DistanceDisplayCondition(w,A)),o.polyline!=null&&(o.polyline=this.extend(x,o.polyline,!0),o.polyline.distanceDisplayCondition=new f.DistanceDisplayCondition(w,A)),o.polygon!=null&&(o.polygon=this.extend(C,o.polygon,!0),o.polygon.distanceDisplayCondition=new f.DistanceDisplayCondition(w,A)),o};oo.prototype.getCatesian3FromPX=function(o,f,m,v){var y=f.scene.pick(o),x,C=f.scene.drillPick(o),w=null;if(v){for(var A=0;A<C.length;A++)if(C[A].id._id!=(v&&v[0]&&v[0].id)&&C[A].id._id!=(v&&v[1]&&v[1].id)){w=C[A].id;break}}else w=y;if(f.scene.pickPositionSupported&&m.defined(w))x=f.scene.pickPosition(o);else{var E=f.camera.getPickRay(o);if(!E)return;x=f.scene.globe.pick(E,f.scene)}return x};oo.prototype.StyleContrast=function(o,f,m){var v={text:"",font:" 30px sans-serif",style:m.LabelStyle.FILL_AND_OUTLINE,fillColor:m.Color.WHITE,outlineColor:m.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new m.Color(.165,.165,.165,.8),backgroundPadding:new m.Cartesian2(7,5),scale:1,horizontalOrigin:m.HorizontalOrigin.CENTER,verticalOrigin:m.VerticalOrigin.CENTER,eyeOffset:m.Cartesian3.ZERO,pixelOffset:m.Cartesian2.ZERO,heightReference:m.HeightReference.NONE,scaleByDistance:void 0,distanceDisplayCondition:void 0},y={show:!0,position:m.Cartesian3.ZERO,pixelOffset:m.Cartesian2.ZERO,eyeOffset:m.Cartesian3.ZERO,heightReference:m.HeightReference.NONE,horizontalOrigin:m.HorizontalOrigin.CENTER,verticalOrigin:m.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:m.Color.WHITE,rotation:0,alignedAxis:m.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},x={show:!0,pixelSize:1,heightReference:m.HeightReference.NONE,color:m.WHITE,outlineColor:m.Color.BLACK,outlineWidth:1,scaleByDistance:void 0,translucencyByDistance:void 0,distanceDisplayCondition:void 0},C={positions:[],width:5,material:m.Color.ALICEBLUE,arcType:m.ArcType.GEODESIC},w={polygonHierarchy:new m.PolygonHierarchy(m.Cartesian3.fromDegreesArray([-72,40,-70,35,-75,30,-70,30,-68,40])),height:0,extrudedHeight:0,material:"rgba(245, 20, 20, 0.91)"};this.isnull(f.near)&&(f.near=0),this.isnull(f.far)&&(f.far=999999999);var A=parseFloat(f.near),E=parseFloat(f.far);return delete f.near,delete f.far,f.distanceDisplayCondition=new m.DistanceDisplayCondition(A,E),o=="lable"?f=this.extend(v,f,!0):o=="billboard"?f=this.extend(y,f,!0):o=="point"?f=this.extend(x,f,!0):o=="polyline"?f=this.extend(C,f,!0):o=="polygon"&&(f=this.extend(w,f,!0)),f};oo.prototype.createPolyline=function(o,f,m,v){var y=null;if(f==-1){var x=new v.PolylineGeometry(o);y=new v.GeometryInstance({id:m,geometry:x})}else{var x=new v.GroundPolylineGeometry(o);y=new v.GeometryInstance({geometry:x,id:m})}return y};oo.prototype.createPolygon=function(o,f,m,v){var y=null,x=o.material,C=new v.PolygonGeometry(o);return delete o.material,y=new v.GeometryInstance({id:m,geometry:C,attributes:{color:new v.ColorGeometryInstanceAttribute.fromColor(x)}}),y};oo.prototype.coordinate=function(o,f){for(var m=0;m<f.length;m++)Array.isArray(f[m])?this.coordinate(o,f[m]):o.push(f[m]);return o};oo.prototype.Analysis=function(o,f){if(/^\[/.test(o)&&/\]$/.test(o)){var m=o.replace(/\[/,"").replace(/\]/,"");f.properties[m]!=null&&(o=f.properties[m])}return o};oo.prototype.unique=function(o){for(var f=[],m=0;m<o.length;m++)f.indexOf(o[m])===-1&&f.push(o[m]);return f};oo.prototype.extend=function(o,f,m=!1,v=!1){for(var y in f)v?o.hasOwnProperty(y)&&(o[y]=f[y]):(!o.hasOwnProperty(y)||m)&&(o[y]=f[y]);return o};oo.prototype.setPositionOffset=(o,f,m)=>{let v=ar.Transforms.headingPitchRollToFixedFrame(o,m||new ar.HeadingPitchRoll),y=new ar.Cartesian3(0,0,0);return ar.Matrix4.multiplyByPoint(v,f,y),y};oo.prototype.getOffsetTilingScheme=function(o="GCJ02"){let f,m;return o==="GCJ02"&&(f=new ar.WebMercatorTilingScheme,m=new ar.WebMercatorProjection,f._projection.project=function(v,y){return y=HIe.WGS84ToGCJ02(ar.Math.toDegrees(v.longitude),ar.Math.toDegrees(v.latitude)),y=m.project(new ar.Cartographic(ar.Math.toRadians(y[0]),ar.Math.toRadians(y[1]))),new ar.Cartesian2(y.x,y.y)},f._projection.unproject=function(v,y){let x=m.unproject(v);return y=HIe.GCJ02ToWGS84(ar.Math.toDegrees(x.longitude),ar.Math.toDegrees(x.latitude)),new ar.Cartographic(ar.Math.toRadians(y[0]),ar.Math.toRadians(y[1]))}),f};oo.prototype.trackedEntity=function(o,f,m={}){let v={type:"tracked",heading:0,pitch:-45,distance:1e3,minDistance:0};Object.assign(v,m);let y,x,C;if(v.tooltip){let E={innerHTML:"",drag:!1,near:0,far:1e3,addX:0,addY:0};v.tooltip=Object.assign(E,v.tooltip);let T=`<div id="trackedTooltip${f.id}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;"><div class="trackedTooltipContainer"></div></div>`;if($(o.container).append(T),y=document.getElementById("trackedTooltip"+f.id),x=y.firstElementChild,x.innerHTML=v.tooltip.innerHTML,x.style.left=v.tooltip.addX+"px",x.style.top=v.tooltip.addY+"px",x.style.position="relative",v.tooltip.drag){C=document.createElement("div"),C.className="trackedTooltip-arrow",y.appendChild(C);let S,M,I,P,D=(L,R)=>{let O;S=Math.sqrt(Math.pow(L,2)+Math.pow(R,2)),M=-(S-L)/2+"px",I=-R/2+"px",L?(O=ar.Math.toDegrees(Math.atan(R/L)),L<0&&(M=(S+L)/2-S+"px")):R>0?O=90:O=-90,P=`rotate(${O}deg)`};D(v.tooltip.addX,v.tooltip.addY),C.style.cssText=` position: absolute; bottom: ${I}; left: ${M}; width: ${S}px; height: 0px; transform: ${P}; border-top: 2px dashed #f00; `,x.style.pointerEvents="all",x.addEventListener("mousedown",function(L){let R=L.pageX-x.offsetLeft,O=L.pageY-x.offsetTop,F,k;document.onmousemove=U=>{F=U.pageX-R,k=U.pageY-O,x.style.left=F+"px",x.style.top=k+"px",D(F,k),C.style.width=`${S}px`,C.style.left=M,C.style.bottom=I,C.style.transform=P},document.onmouseup=U=>{document.onmousemove=null}})}}this.endTrackedEntity&&this.endTrackedEntity(),v.start&&typeof v.start=="function"&&v.start();let w=new ar.ScreenSpaceEventHandler(o.scene.canvas),A;if(v.type==="setView"){A=()=>{let I=o.clock.currentTime.clone(),P=f.position.getValue(I);if(o.scene.camera.setView({destination:P,orientation:{heading:ar.Math.toRadians(v.heading),pitch:ar.Math.toRadians(v.pitch)}}),o.scene.camera.moveBackward(v.distance),v.tooltip){v.distance<=v.tooltip.far&&v.distance>=v.tooltip.near?y.style.display="block":y.style.display="none";let D=o.scene.cartesianToCanvasCoordinates(P);if(!D)return;y.style.left=D.x+"px",y.style.top=D.y-y.offsetHeight+"px"}v.position=P,v.update&&typeof v.update=="function"&&v.update()},o.scene.preRender.addEventListener(A);let E,T,S,M;w.setInputAction(I=>{E={position:I.position,heading:v.heading,pitch:v.pitch}},ar.ScreenSpaceEventType.LEFT_DOWN),w.setInputAction(I=>{E=void 0},ar.ScreenSpaceEventType.LEFT_UP),w.setInputAction(I=>{E&&(T=I.endPosition,S=T.x-E.position.x,M=T.y-E.position.y,v.heading=E.heading+S/8,v.pitch=E.pitch-M/6)},ar.ScreenSpaceEventType.MOUSE_MOVE),w.setInputAction(I=>{v.distance-=I*v.distance/1e3,v.distance<v.minDistance&&(v.distance=v.minDistance)},ar.ScreenSpaceEventType.WHEEL)}else v.viewFrom&&(f.viewFrom=v.viewFrom),o.trackedEntity=f;return w.setInputAction(E=>{this.endTrackedEntity&&this.endTrackedEntity()},ar.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.endTrackedEntity=()=>{w&&w.destroy(),o.trackedEntity=void 0,A&&o.scene.preRender.removeEventListener(A),y&&y.remove(),y=void 0,A=void 0,w=void 0,v.end&&typeof v.end=="function"&&v.end()},v.destroy=this.endTrackedEntity,v.updataTooltip=E=>{x.innerHTML=v.tooltip.innerHTML=E},v};oo.prototype.getPointFromWindowPoint=function(o,f){if(f.scene.terrainProvider.constructor.name=="EllipsoidTerrainProvider")return f.camera.pickEllipsoid(o,f.scene.globe.ellipsoid);var m=f.scene.camera.getPickRay(o);return f.scene.globe.pick(m,f.scene)};oo.prototype.isnull=function(o){return o==null||o==null||o===""};oo.prototype.getuid=function(){return this.uuid(8,16)};oo.prototype.extendgl=function(o,f,m){return f!=null&&f!=null?(typeof f=="string"&&f.charAt(0)=="["&&f.charAt(f.length-1)=="]"&&(f=f.substr(0,f.length-1),f=f.substr(1),o.properties[f]._value!=null?f=o.properties[f]._value:o.properties[f]!=null&&(f=o.properties[f])),f):m};oo.prototype.customGeometry=function(o){if(o.scale)for(let m=0;m<o.position.length-2;m+=3)o.position[m]*=o.scale[0],o.position[m+1]*=o.scale[1],o.position[m+2]*=o.scale[2];return new ar.Geometry({attributes:{position:new ar.GeometryAttribute({componentDatatype:ar.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o.position}),st:new ar.GeometryAttribute({componentDatatype:ar.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:o.st})},indices:o.indices,primitiveType:o.grid?ar.PrimitiveType.LINES:ar.PrimitiveType.TRIANGLES,boundingSphere:o.boundingSphere})};oo.prototype.getLevel=function(o){let f=0,m=o.scene.globe._surface._tilesToRender;return m&&m.forEach(v=>{v.level>f&&(f=v.level)}),f};oo.prototype.getViewRectangle=function(o){let f=o.camera.computeViewRectangle();return this.toDegreesRectangle(f)};oo.prototype.toDegreesRectangle=function(o){let f=new ar.Rectangle;return f.west=ar.Math.toDegrees(o.west),f.north=ar.Math.toDegrees(o.north),f.east=ar.Math.toDegrees(o.east),f.south=ar.Math.toDegrees(o.south),f};oo.prototype.getCenterOfMass=function(o){let f=[],m=0;if(o[0].x){let x;o.forEach(C=>{x=this.toDegrees(C),f.push([x.lon,x.lat]),m+=x.height})}else o[0].lon?o.forEach(x=>{f.push([x.lon,x.lat]),m+=x.height||0}):Array.isArray(o[0])&&(f=o,o.forEach(x=>{m+=x[2]||0}));let v=turf.polygon([f]),y=turf.pointOnFeature(v);return m/=o.length,y.geometry.coordinates[2]=m,y.geometry.coordinates};oo.prototype.addPickStage=function(o,f="rgba(255,0,0,0.6)"){let m=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; uniform vec4 highlight; void main() { vec4 color = texture(colorTexture, v_textureCoordinates); if (czm_selected()) { vec3 highlighted = highlight.a * highlight.rgb + (1.0 - highlight.a) * color.rgb; out_FragColor = vec4(highlighted, 1.0); } else { out_FragColor = color; } } `,v=o.scene.postProcessStages.add(new ar.PostProcessStage({fragmentShader:m,uniforms:{highlight:function(){return new ar.Color.fromCssColorString(f)}}}));return v.selected=[],{select(y){!y.color&&y.content?y=y.content.tile:y.id instanceof ar.Entity&&(y=y.id),v.selected=[y],this.changeOtherHighlight()},changeOtherHighlight(){let y=v.selected[0];y&&(y instanceof ar.Cesium3DTile?y.defaultColor?(y.color=y.defaultColor,y.defaultColor=null):(y.defaultColor=y.color&&y.color.clone(),y.color=ar.Color.RED):y instanceof ar.Entity||y.primitive instanceof Kae&&(y.primitive._selections.length?y.primitive.releaseSelection():y.primitive.setSelection(y.id)))},remove(){this.changeOtherHighlight(),v.selected=[]},destroy(){o.scene.postProcessStages.remove(v)}}};oo.prototype.addLoading=function(o,f){let m=document.createElement("div");m.id="cesiumLoading",m.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let v=document.createElement("img");return v.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",v.src=f||window.SmartEarthRootUrl+pn.loading,m.appendChild(v),o.appendChild(m),{isLoading(y){y?m.style.display="block":m.style.display="none"},remove(){m&&m.remove(),m=null}}};oo.prototype.uuid=function(o,f){var m="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),v=[],y,v=[],y;if(f=f||m.length,o)for(y=0;y<o;y++)v[y]=m[0|Math.random()*f];else{var x;for(v[8]=v[13]=v[18]=v[23]="-",v[14]="4",y=0;y<36;y++)v[y]||(x=0|Math.random()*16,v[y]=m[y==19?x&3|8:x])}return v.join("")};oo.prototype.Shaders=function(o){var f="";return o=="VSHADER_SOURCE "?f=`in vec4 a_Position; in vec2 a_TexCoord; uniform mat4 u_MvpMatrix; out vec2 v_TexCoord; void main(){ gl_Position = u_MvpMatrix * a_Position; v_TexCoord = a_TexCoord; } `:o=="TRIANGLE_FSHADER_SOURCE"?f=`#ifdef GL_ES precision mediump float; #endif in vec4 v_Color; void main() { out_FragColor = v_Color; '} `:o=="TRIANGLE_VSHADER_SOURCE"?f=`in vec4 a_Position; in vec4 a_Normal; uniform mat4 u_MvpMatrix; uniform mat4 u_NormalMatrix; out vec4 v_Color; void main() { vec3 lightDirection = vec3(0.0, 0.0, 1.0); vec4 color = vec4(1.0, 1.0, 0.0, 1.0); gl_Position = u_MvpMatrix * a_Position; vec3 normal = normalize(vec3(u_NormalMatrix * a_Normal)); float nDotL = max(dot(normal, lightDirection), 0.0); v_Color = vec4(color.rgb * nDotL, color.a); } `:o=="vertexShaderSource"?f=`in vec3 position3DHigh;\r in vec3 position3DLow;\r in vec3 normal;\r in vec2 st;\r in vec4 color;\r in float batchId;\r out vec3 v_positionEC;\r out vec3 v_normalEC;\r out vec2 v_st;\r out vec4 v_color;\r void main()\r {\r vec4 p = czm_computePosition();\r v_positionEC = (czm_modelViewRelativeToEye * p).xyz;\r v_normalEC = czm_normal * normal;\r v_st = st;\r v_color = color;\r gl_Position = czm_modelViewProjectionRelativeToEye * p;\r }\r `:o=="fragmentShaderSource"&&(f=`in vec3 v_positionEC;\r in vec3 v_normalEC;\r in vec2 v_st;\r in vec4 v_color;\r \r vec4 czm_phong(vec3 toEye, czm_material material)\r {\r float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\r if (czm_sceneMode == czm_sceneMode3D) {\r diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\r }\r float specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\r vec3 materialDiffuse = material.diffuse * 0.5;\r vec3 ambient = materialDiffuse;\r vec3 color = ambient + material.emission;\r color += materialDiffuse * diffuse;\r color += material.specular * specular;\r return vec4(color, material.alpha);\r }void main()\r {\r vec3 positionToEyeEC = -v_positionEC;\r vec3 normalEC = normalize(v_normalEC);\r #ifdef FACE_FORWARD\r normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r #endif\r vec4 color = czm_gammaCorrect(v_color);\r czm_materialInput materialInput;\r materialInput.normalEC = normalEC;\r materialInput.positionToEyeEC = positionToEyeEC;\r materialInput.st = v_st;\r czm_material material = czm_getDefaultMaterial(materialInput);\r material.diffuse = color.rgb;\r material.alpha = color.a;\r #ifdef FLAT\r out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r #else\r out_FragColor = czm_phong(normalize(positionToEyeEC), material);\r #endif\r }\r `),f};oo.prototype.isHtmlColor=function(o){var f=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/;return f.test(o)};oo.prototype.isUrl=function(o){if(this.isnull(o))return!1;var f=/^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/;return f.test(o)};oo.prototype.dateTimespan=function(){var o=new Date;return o.toTimeString()};oo.prototype.getPointFromTwoPointCenter=function(o,f,m){let v=this.getSpaceDistancem(o,ar);if(v<f)return;let y=o[0],x=o[1],C=ar.Cartographic.fromCartesian(y),w=ar.Math.toDegrees(C.longitude),A=ar.Math.toDegrees(C.latitude),E=C.height,T=ar.Cartographic.fromCartesian(x),S=ar.Math.toDegrees(T.longitude),M=ar.Math.toDegrees(T.latitude),I=T.height,P=parseFloat(v/f),D=ar.Math.lerp(w,S,1/P)-w,L=ar.Math.lerp(A,M,1/P)-A,R=ar.Math.lerp(E,I,1/P)-E;return ar.Cartesian3.fromDegrees(w+D,A+L,m||E+R)};oo.prototype.getSpaceDistance=function(o,f){for(var m=0,v="",y=0;y<o.length-1;y++){var x=f.Cartographic.fromCartesian(o[y]),C=f.Cartographic.fromCartesian(o[y+1]),w=new f.EllipsoidGeodesic;w.setEndPoints(x,C);var A=w.surfaceDistance;A=Math.sqrt(Math.pow(A,2)+Math.pow(C.height-x.height,2)),m=m+A}return m>=1e3?v=(m/1e3).toFixed(2)+"\u5343\u7C73":v=m.toFixed(2)+"\u7C73",v};oo.prototype.getSpaceDistancem=function(o,f){for(var m=0,v=0;v<o.length-1;v++){var y=f.Cartographic.fromCartesian(o[v]),x=f.Cartographic.fromCartesian(o[v+1]),C=new f.EllipsoidGeodesic;C.setEndPoints(y,x);var w=C.surfaceDistance;w=Math.sqrt(Math.pow(w,2)+Math.pow(x.height-y.height,2)),m=m+w}return m.toFixed(2)};oo.prototype.getHorizontalDistance=function(o,f){for(var m=0,v=0;v<o.length-1;v++){var y=f.Cartographic.fromCartesian(o[v]),x=f.Cartographic.fromCartesian(o[v+1]),C=new f.EllipsoidGeodesic;C.setEndPoints(y,x);var w=C.surfaceDistance;m=m+w}return m>=1e3?m=(m/1e3).toFixed(2)+"\u5343\u7C73":m=m.toFixed(2)+"\u7C73",m};oo.prototype.getPointsInPolygon=function(o,f=50,m=!0){if(o.length<3)return;o.push(o[0]);let v=ar.turf.lineString(o),y=ar.turf.bbox(v),x=ar.turf.pointGrid(y,f,{units:"meters"}),C=ar.turf.polygon([o]),w=ar.turf.pointsWithinPolygon(x,C);if(m)for(let A=0;A<o.length-1;A++){let E=ar.turf.lineString([o[A],o[A+1]]),T={units:"meters"},S=ar.turf.length(E,T),M;for(let I=f;;I+=f)if(I<=S)M=ar.turf.along(E,I,T),w.features.push(M);else{M=ar.turf.along(E,S,T),w.features.push(M);break}}return w};oo.prototype.tinFromPoints=function(o,f={}){let{polygon:m,getArea:v}=f,y=ar.turf.tin(o),x=0;return y&&y.features&&y.features.forEach(C=>{let w=!0;if(m){let A=ar.turf.centerOfMass(C);w=ar.turf.booleanPointInPolygon(A,m)}if(w){let A=C.geometry.coordinates[0],E=[],T=[];for(let S=0;S<3;S++)E.push([A[S][0],A[S][1]]),T.push(ar.Cartesian3.fromDegrees(A[S][0],A[S][1],A[S][2]));C.positions=T,v&&(C.area=this.getArea(E,T,!0),x+=C.area)}}),{tin:y,area:x}};oo.prototype.getSpaceArea=function(o,f,m={}){let v=this.defaultValue(m.distance,50),y=this.defaultValue(m.onlyTerrain,!1),x=this.defaultValue(m.isNum,!1),C=this.getPointsInPolygon(f,v,!0),w=ar.turf.polygon([f]),A=()=>{let{tin:E,area:T}=this.tinFromPoints(C,{getArea:!0,polygon:w});return x?{area:T,tin:E}:(T<1e6?T=T.toFixed(2)+"\u5E73\u65B9\u7C73":T=(T/1e6).toFixed(2)+"\u5E73\u65B9\u5343\u7C73",{area:T,tin:E})};if(y){let E=[];return C.features.forEach(T=>{let S=T.geometry.coordinates;E.push(ar.Cartographic.fromDegrees(S[0],S[1]))}),this.getHeightsFromLonLat(o,E).then(T=>(C.features.forEach((S,M)=>{let I=S.geometry.coordinates;I[2]=T[M]||0}),A()))}else return C.features.forEach(E=>{let T=E.geometry.coordinates,S=new ar.Cartographic(ar.Math.toRadians(T[0]),ar.Math.toRadians(T[1])),M=o.scene.sampleHeight(S)||0;T[2]=M}),A()};oo.prototype.starPositions=function(o,f,m){for(var v=Math.PI/o,y=[],x=0;x<2*o;x++){var C=x%2===0?f:m,w=new ar.Cartesian2(Math.cos(x*v)*C,Math.sin(x*v)*C);y.push(w)}return y};oo.prototype.computeCircle=function(o){let f=Mst.get(o);if(f)return f;f=[];for(let m=0;m<360;m+=12){let v=ar.Math.toRadians(m);f.push(new ar.Cartesian2(o*Math.cos(v),o*Math.sin(v)))}return Mst.set(o,f),f};oo.prototype.getArea=function(o,f,m){if(o.length<3)return;let v=[];v=v.concat(o,[o[0]]);var y=0;let x=ar.turf.polygon([v]),C;v.length===4?C=[x]:C=ar.turf.tesselate(x).features;let w,A,E,T;return C.forEach(S=>{w=S.geometry.coordinates[0],A=v.findIndex(L=>L.toString()===w[0].toString()),E=v.findIndex(L=>L.toString()===w[1].toString()),T=v.findIndex(L=>L.toString()===w[2].toString());let M=this.getdistance(f[A],f[E]),I=this.getdistance(f[E],f[T]),P=this.getdistance(f[A],f[T]),D=(M+I+P)/2;y+=Math.sqrt(D*((D-M)*(D-I)*(D-P)))}),m||(y<1e6?y=y.toFixed(2)+"\u5E73\u65B9\u7C73":y=(y/1e6).toFixed(2)+"\u5E73\u65B9\u5343\u7C73"),y};oo.prototype.getdistance=function(o,f){var m=ar.Cartographic.fromCartesian(o),v=ar.Cartographic.fromCartesian(f),y=new ar.EllipsoidGeodesic;y.setEndPoints(m,v);var x=y.surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(v.height-m.height,2)),x};oo.prototype.Angle=function(o,f,m){var v=this.Bearing(f,o),y=this.Bearing(f,m),x=v-y;return x<0&&(x+=360),x};oo.prototype.Bearing=function(o,f){var m=Math.PI/180,v=180/Math.PI,y=o.lat*m,x=o.lon*m,C=f.lat*m,w=f.lon*m,A=-Math.atan2(Math.sin(x-w)*Math.cos(C),Math.cos(y)*Math.sin(C)-Math.sin(y)*Math.cos(C)*Math.cos(x-w));return A<0&&(A+=Math.PI*2),A=A*v,A};oo.prototype.getHeight=function(o,f){try{if(o.length>1){var m=f.Cartographic.fromCartesian(o[0]),v=f.Cartographic.fromCartesian(o[1]),y=(v.height-m.height)/1e3;return y.toFixed(2)}else return 0}catch(x){console.log(x)}};oo.prototype.getPmfx=function(o,f,m,v,y,x){var C={gcs:[],min:99999,max:0,juli:0,cys:f},w=this.getSpaceDistancem(o,v);C.juli=w,m==0||(f=parseInt(w/m)),C.cys=f;var A=[],E=o[0],T=o[o.length-1],S=v.Cartographic.fromCartesian(E),M=v.Math.toDegrees(S.longitude),I=v.Math.toDegrees(S.latitude),P=S.height,D=v.Cartographic.fromCartesian(T),L=v.Math.toDegrees(D.longitude),R=v.Math.toDegrees(D.latitude),O=D.height,F=f,k=v.Math.lerp(M,L,1/F)-M,U=v.Math.lerp(I,R,1/F)-I,G=[],j=[],q;G.push(S);for(var J=0;J<F;J++){var X=M+(J+1)*k,Y=I+(J+1)*U;q=v.Cartesian3.fromDegrees(X,Y),G.push(v.Cartographic.fromCartesian(q))}var Q=this;this.getHeightsFromLonLat(y,G).then(ee=>{if(ee){j=ee;var z=!1;for(y.scene.globe.depthTestAgainstTerrain!==!0&&(y.scene.globe.depthTestAgainstTerrain=!0,z=!0),J=0;J<j.length;J++){var ie=Q.get3DTileOrPrimitivesHeights(G[J],y);ie!==void 0&&(j[J]=ie);var re=j[J].toFixed(2);parseFloat(re)<parseFloat(C.min)&&(C.min=parseFloat(re)),parseFloat(re)>parseFloat(C.max)&&(C.max=parseFloat(re)),C.gcs.push(re)}z&&(y.scene.globe.depthTestAgainstTerrain=!1),x!=""&&x!=null&&typeof x=="function"&&x(C)}})};oo.prototype.getPmfxPro=function(o,f,m,v,y,x){let C=this,w={gcs:[],min:99999,max:0,juli:0,cys:0},A=[],E=[];for(let S=0;S<o.length-1;S++){let M=C.getSpaceDistancem([o[S],o[S+1]],v);M=parseFloat(M),w.juli+=M,m==0||(f=parseInt(M/m)),E.push(f),w.cys+=f}let T=()=>{E.forEach((M,I)=>{let P=o[I],D=o[I+1],L=v.Cartographic.fromCartesian(P),R=v.Math.toDegrees(L.longitude),O=v.Math.toDegrees(L.latitude),F=v.Cartographic.fromCartesian(D),k=v.Math.toDegrees(F.longitude),U=v.Math.toDegrees(F.latitude),G=M,j=v.Math.lerp(R,k,1/G)-R,q=v.Math.lerp(O,U,1/G)-O,J;I===0&&A.push(L);for(let X=0;X<G;X++){let Y=R+(X+1)*j,Q=O+(X+1)*q;J=v.Cartesian3.fromDegrees(Y,Q),A.push(v.Cartographic.fromCartesian(J))}}),A.push(v.Cartographic.fromCartesian(o[o.length-1]));let S=[];w.allPoint=A,this.getHeightsFromLonLat(y,A).then(M=>{if(M){S=M;let I=y.scene.globe.depthTestAgainstTerrain;y.scene.globe.depthTestAgainstTerrain=!0;for(let P=0;P<S.length;P++){let D=C.get3DTileOrPrimitivesHeights(A[P],y);D!==void 0&&(S[P]=D);let L=S[P].toFixed(2);parseFloat(L)<parseFloat(w.min)&&(w.min=parseFloat(L)),parseFloat(L)>parseFloat(w.max)&&(w.max=parseFloat(L)),w.gcs.push(L)}y.scene.globe.depthTestAgainstTerrain=I,x&&typeof x=="function"&&x(w)}})};w.cys>1e3?layuiLayer&&layuiLayer.msg("\u5F53\u524D\u91C7\u6837\u70B9\u6570\u8FC7\u591A\uFF0C\u662F\u5426\u7EE7\u7EED\u5206\u6790\uFF1F",{time:0,btn:["\u7EE7\u7EED","\u53D6\u6D88"],btnAlign:"c",yes:S=>{layuiLayer.close(S),setTimeout(()=>{T()},10)},btn2:()=>{x&&typeof x=="function"&&x(w)}}):setTimeout(()=>{T()},10)};oo.prototype.get3DTileOrPrimitivesHeights=function(o,f){return f.scene.sampleHeight(o)};oo.prototype.getHeightsFromLonLat=function(o,f){var m=[];return o.terrainProvider?o.terrainProvider instanceof ar.EllipsoidTerrainProvider?new Promise(function(v,y){f.forEach(x=>{m.push(0)}),v(m)}):ar.sampleTerrainMostDetailed(o.terrainProvider,f).then(y=>(y.forEach(function(x){m.push(x.height)}),m),()=>(f.forEach(y=>{m.push(o.scene.globe.getHeight(y))}),m)):new Promise(function(v,y){f.forEach(x=>{m.push(o.scene.globe.getHeight(x))}),v(m)})};oo.prototype.getColorRamp=function(o,f,m,v){var y=[0,.05,.2,.35,.5,.65,.8,.95,1],x=[],C=[0,0,.2,.4,.6,.8,.9,1,1],w=document.createElement("canvas");w.width=100,w.height=1;var A=w.getContext("2d"),E;o==="elevation"?E=y:o==="slope"?E=x:o==="aspect"&&(E=C),f||(f=["#0b0b88","#2747E0","#D33B7D","#D33038","#FF9742","#ffd700","#bbff00"]);var T=A.createLinearGradient(0,0,100,0);if(o==="slope"){m===void 0&&(m=0),v===void 0&&(m=90),m==0?x.push(0):(x.push(m/90),T.addColorStop(0,"#000000"));var S=(v-m)/6;if(v==90){for(var M=1;M<=5;M++)x.push((m+M*S)/90);x.push(1),x.forEach(function(I,P){T.addColorStop(I,f[P])})}else{for(var M=1;M<=5;M++)x.push((m+M*S)/90);x.push(v/90),x.forEach(function(I,P){T.addColorStop(I,f[P])}),T.addColorStop(1,"#000000")}}else T.addColorStop(E[0],"#000000"),T.addColorStop(E[1],f[0]),T.addColorStop(E[2],f[1]),T.addColorStop(E[3],f[2]),T.addColorStop(E[4],f[3]),T.addColorStop(E[5],f[4]),T.addColorStop(E[6],f[5]),T.addColorStop(E[7],f[6]),T.addColorStop(E[8],"#000000");return A.fillStyle=T,A.fillRect(0,0,100,1),w};oo.prototype.Gauss_to_XY=function(o,f,m,v){var y=6378137,x=63567523142e-4,C=Math.sqrt(y*y-x*x)/y,w=Math.sqrt(y*y-x*x)/x,A=0,E=0,A=0,E=0,T=0,S=0,M=this.to_Radian(m);f=this.to_Radian(f),o=this.to_Radian(o);var I=o-M,P=Math.cos(f);S=this.to_N(f),T=S*Math.cos(f),A=Math.tan(f),E=w*P;var D=Math.pow(A,2),L=Math.pow(A,4),R=Math.pow(E,2),O=Math.pow(E,4),F=Math.pow(P,3),k=Math.pow(P,5),U=this.to_Sm(f)+Math.pow(I,2)/2*T*P*A+Math.pow(I,4)/24*A*T*F*(5-D+9*R+4*O)+Math.pow(I,6)/720*A*T*k*(61-58*A*A+L+270*R-330*A*A*R),G=I*S*P+Math.pow(I,3)/6*S*F*(1-A*A+E*E)+Math.pow(I,5)/120*S*k*(5-18*A*A+L+14*R-58*R*D);return new v.Cartesian2(G,U)};oo.prototype.to_Radian=function(o){return o*Math.PI/180};oo.prototype.to_N=function(o){var f=6378137,m=63567523142e-4,v=Math.sqrt(f*f-m*m)/f,y=Math.sqrt(f*f-m*m)/m,x=f/Math.sqrt(1-v*v*Math.sin(o)*Math.sin(o));return x};oo.prototype.to_Sm=function(o){var f=6378137,m=63567523142e-4,v=Math.sqrt(f*f-m*m)/f,y=Math.sqrt(f*f-m*m)/m,x,C,w,A,E;return x=1+v*v*3/4+Math.pow(v,4)*45/64+Math.pow(v,6)*175/256+Math.pow(v,8)*11025/16384,C=Math.pow(v,2)*3/4+Math.pow(v,4)*15/16+Math.pow(v,6)*525/512+Math.pow(v,8)*2205/2048,w=Math.pow(v,4)*15/64+Math.pow(v,6)*105/256+Math.pow(v,8)*2205/4096,A=Math.pow(v,6)*35/512+Math.pow(v,8)*315/2048,E=Math.pow(v,8)*315/16384,f*(1-v*v)*(x*o-C/2*Math.sin(2*o)+w/4*Math.sin(4*o)-A/6*Math.sin(6*o)+E/8*Math.sin(8*o))};oo.prototype.ElevationAngle=function(o,f,m){function v(D,L){for(var R=0,O=0;O<D.length-1;O++){var F=L.Cartographic.fromCartesian(D[O]),k=L.Cartographic.fromCartesian(D[O+1]),U=new L.EllipsoidGeodesic;U.setEndPoints(F,k);var G=U.surfaceDistance;G=Math.sqrt(Math.pow(G,2)+Math.pow(k.height-F.height,2)),R=R+G}return R}function y(D,L){for(var R=0,O=0;O<D.length-1;O++){var F=L.Cartographic.fromCartesian(D[O]),k=L.Cartographic.fromCartesian(D[O+1]),U=new L.EllipsoidGeodesic;U.setEndPoints(F,k);var G=U.surfaceDistance;R=R+G}return R}function x(D,L){try{if(D.length>1){var R=L.Cartographic.fromCartesian(D[0]),O=L.Cartographic.fromCartesian(D[1]),F=O.height-R.height;return F}else return 0}catch(k){console.log(k)}}var C=m.Cartographic.fromCartesian(o),w=m.Cartographic.fromCartesian(f),A=C.height-(C.height-w.height),E=m.Cartesian3.fromDegrees(m.Math.toDegrees(w.longitude),m.Math.toDegrees(w.latitude),C.height),T=parseFloat(v([o,f],m)),S=parseFloat(y([o,E],m)),M=parseFloat(x([E,f],m)),I=M/T,P=Math.asin(I)*180/3.14;return P};oo.prototype.TwoPointAzimuth=function(o,f,m,v){var y=0,x=function(M){return M*Math.PI/180},C=Math.round(.5+f*36e4),w=Math.round(.5+v*36e4),A=Math.round(.5+o*36e4),E=Math.round(.5+m*36e4);if(f=x(f),o=x(o),v=x(v),m=x(m),C===w&&A===E)return y;if(A===E)C>w&&(y=180);else{var T=Math.acos(Math.sin(v)*Math.sin(f)+Math.cos(v)*Math.cos(f)*Math.cos(m-o)),S=Math.asin(Math.cos(v)*Math.sin(m-o)/Math.sin(T));y=S*180/Math.PI,w>C&&E>A||(w<C&&E<A||w<C&&E>A?y=180-y:w>C&&E<A&&(y+=360))}return y};oo.prototype.twoPointsHeadingPitchRoll=function(o,f,m){let v=new ar.Camera(o.scene);v.position=f,v.direction=ar.Cartesian3.subtract(m,f,new ar.Cartesian3),v.up=ar.Cartesian3.normalize(f,new ar.Cartesian3);let y=ar.Cartesian3.distance(f,m),x=ar.Cartesian3.normalize(ar.Cartesian3.subtract(m,f,new ar.Cartesian3),new ar.Cartesian3);v.direction=x,v.frustum.near=0,v.frustum.far=y;let{heading:C,pitch:w,roll:A}=v;return v=null,{heading:C,pitch:w,roll:A,radius:y}};oo.prototype.ThreePointAzimuth=function(o,f,m,v){var y=6371e3,x=Math.PI/180,C=180/Math.PI,w=v.Cartographic.fromCartesian(o),A=v.Cartographic.fromCartesian(f),E=v.Cartographic.fromCartesian(m);f=v.Cartesian3.fromDegrees(v.Math.toDegrees(A.longitude),v.Math.toDegrees(A.latitude),w.height),m=v.Cartesian3.fromDegrees(v.Math.toDegrees(E.longitude),v.Math.toDegrees(E.latitude),w.height),A=v.Cartographic.fromCartesian(f),E=v.Cartographic.fromCartesian(m);function T(I,P,D){var L=S(P,I),R=S(P,D),O=L-R;return O<0&&(O+=360),O}function S(I,P){var D=I.latitude*x,L=I.longitude*x,R=P.latitude*x,O=P.longitude*x,F=-Math.atan2(Math.sin(L-O)*Math.cos(R),Math.cos(D)*Math.sin(R)-Math.sin(D)*Math.cos(R)*Math.cos(L-O));return F<0&&(F+=Math.PI*2),F=F*C,F}var M=T(w,A,E);return M};oo.prototype.setDepthTest=function(o,f){o==="open"&&this.defaultDepthTest===void 0?(this.defaultDepthTest=!!f.scene.globe.depthTestAgainstTerrain,f.scene.globe.depthTestAgainstTerrain=!0):o==="close"&&this.defaultDepthTest!==void 0&&(f.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0)};oo.prototype.setImageMaterialProperty=function(o,f,m,v){this.id=v;var y=this,x=document.createElement("canvas");x.id=this.id+"-a",x.width=700,x.height=100;var C=document.createElement("canvas");C.id=this.id+"-b",C.width=700,C.height=100,document.body.appendChild(x),document.body.appendChild(C),o&&(y.images=o);var w=new f.CallbackProperty(function(A,E){var T=document.getElementById(y.id+"-"+y.curCanvas),S=700,M=100,I=T.getContext("2d"),P=new Image;return P.src=y.images,I.clearRect(0,0,S,M),P.onload=function(){y.i<=S?(I.drawImage(P,y.i,0),I.drawImage(P,y.i+100,0)):y.i=0,y.i+=5},y.curCanvas=y.curCanvas==="a"?"b":"a",T},!1);return m==1&&(w=new f.CallbackProperty(function(A,E){var T=y,S=document.getElementById(y.id+"-"+y.curCanvas),M=700,I=100,P=S.getContext("2d"),D=P.createLinearGradient(0,100,0,0);return D.addColorStop(0,"red"),y.i>1&&(y.i=1),D.addColorStop(y.i,"rgb(255,0,0,0.6)"),D.addColorStop(1,"rgb(255,0,0,0.1)"),P.clearRect(0,0,700,100),P.fillStyle=D,P.fillRect(0,0,700,100),y.i<1?y.i+=.01:y.i=0,y.curCanvas=y.curCanvas==="a"?"b":"a",S},!1)),new f.ImageMaterialProperty({image:w,transparent:!0})};oo.prototype.setDrawCanvasImage=function(o,f){var m=document.getElementById("canvas-"+curCanvas),v=700,y=100,x=m.getContext("2d"),C=new Image;return C.src=images,x.clearRect(0,0,v,y),C.onload=function(){i<=v?(x.drawImage(C,i,0),x.drawImage(C,i+100,0)):i=0,i+=5},curCanvas=curCanvas==="a"?"b":"a",m};oo.prototype.setDrawCanvasColorUpdown=function(o,f){var m=document.getElementById("canvas-"+curCanvas),v=700,y=100,x=m.getContext("2d"),C=x.createLinearGradient(0,100,0,0);return C.addColorStop(0,"red"),i>1&&(i=1),C.addColorStop(i,"rgb(255,0,0,0.6)"),C.addColorStop(1,"rgb(255,0,0,0.1)"),x.clearRect(0,0,700,100),x.fillStyle=C,x.fillRect(0,0,700,100),i<1?i+=.01:i=0,curCanvas=curCanvas==="a"?"b":"a",m};oo.prototype.toDegrees=function(o){let f=ar.Cartographic.fromCartesian(o);return{lon:ar.Math.toDegrees(f.longitude),lat:ar.Math.toDegrees(f.latitude),height:f.height}};oo.prototype.fromDegrees=function(o){return ar.Cartesian3.fromDegrees(o.lon,o.lat,o.height)};oo.prototype.LineInterpolation=function(o,f){let m,v,y=!1;f.positions?m=f.positions:m=f,v=f.num||100,f.getHeight&&(y=!0);let x={positions:[],cartographic:[],lon_lat:[],height:[]};for(let A=0;A<m.length-1;A++){let E=this.toDegrees(m[A]),T=this.toDegrees(m[A+1]);C(E.lon,E.lat,T.lon,T.lat)}function C(A,E,T,S){let M=ar.Math.lerp(A,T,1/v)-A,I=ar.Math.lerp(E,S,1/v)-E;x.lon_lat.push(A,E);let P;if(y){P=w(A,E),console.log("height",P),x.height.push(P),x.positions.push(ar.Cartesian3.fromDegrees(A,E,P));for(let D=0;D<v;D++){let L=A+(D+1)*M,R=E+(D+1)*I;x.lon_lat.push(L,R),P=w(L,R),x.height.push(P),x.positions.push(ar.Cartesian3.fromDegrees(L,R,P))}x.lon_lat.push(T,S),P=w(T,S),x.height.push(P),x.positions.push(ar.Cartesian3.fromDegrees(T,S,P))}else{x.positions.push(ar.Cartesian3.fromDegrees(A,E));for(let D=0;D<v;D++){let L=A+(D+1)*M,R=E+(D+1)*I;x.lon_lat.push(L,R),x.positions.push(ar.Cartesian3.fromDegrees(L,R))}x.lon_lat.push(T,S),x.positions.push(ar.Cartesian3.fromDegrees(T,S))}}function w(A,E){let T=ar.Cartographic.fromDegrees(A,E);return o.scene.globe.getHeight(T)}return x};oo.prototype.CIMServerTool=function(o){return new Oat(o)};oo.prototype.Recorder=function(o,f){return this._Recorder?(this._Recorder.mediaOutputPath=this.defaultValue(o,"test.mp4"),f&&(this._Recorder.videoBPS=f)):this._Recorder=new Nat(o,f),this._Recorder};oo.prototype.getLinkMaterial=function(o,f,m){if(!ar.PolylineLinkMaterialProperty){let v=function(y,x,C){this._definitionChanged=new ar.Event,this._color=void 0,this._colorSubscription=void 0,this.color=y,this.lightSpotColor=x,this.duration=C,this.old=void 0,this._time=new Date().getTime()};Object.defineProperties(v.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:ar.createPropertyDescriptor("color")}),v.prototype.getType=function(y){return"PolylineLink"},v.prototype.getValue=function(y,x){return ar.defined(x)||(x={}),x.color=ar.Property.getValueOrClonedDefault(this._color,y,ar.Color.WHITE,x.color),x.lightSpotColor=this.lightSpotColor,x.time=(new Date().getTime()-this._time)%this.duration/this.duration,this.old===void 0&&(this.old=x.time),this.old>.5&&x.time<.5&&(x.plus=!x.plus,x.inverse=!x.inverse),this.old=x.time,x.plus?x.time=x.time*1.1:x.time=x.time*1.2-.1,x},v.prototype.equals=function(y){return this===y||y instanceof v&&ar.Property.equals(this._color,y._color)},ar.PolylineLinkMaterialProperty=v,ar.Material.PolylineLinkType="PolylineLink",ar.Material.PolylineLinkSource=Ist,ar.Material._materialCache.addMaterial(ar.Material.PolylineLinkType,{fabric:{type:ar.Material.PolylineLinkType,uniforms:{color:new ar.Color(1,0,0,.5),lightSpotColor:new ar.Color(1,1,1,.5),time:0,plus:!0,inverse:!1},source:ar.Material.PolylineLinkSource},translucent:function(y){return!0}})}return new ar.PolylineLinkMaterialProperty(ar.Color.fromCssColorString(this.defaultValue(o,"#0000ff")),ar.Color.fromCssColorString(this.defaultValue(f,"#ffffff")),this.defaultValue(m,3e3))};oo.prototype.getTrailLinkMaterial=function(o,f,m){return new Lat(o,f,m,this._cesium)};oo.prototype.getConeRadarMaterial=function(o){if(!ar.ConeRadarMaterialProperty){let f=function(m,v){this._definitionChanged=new ar.Event,this._color=void 0,this._colorSubscription=void 0,this.color=m,this.duration=v,this._time=new Date().getTime()};Object.defineProperties(f.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:ar.createPropertyDescriptor("color")}),f.prototype.getType=function(m){return"ConeRadar"},f.prototype.getValue=function(m,v){return ar.defined(v)||(v={}),v.color=ar.Property.getValueOrClonedDefault(this._color,m,ar.Color.WHITE,v.color),v.time=(new Date().getTime()-this._time)%this.duration/this.duration,v},f.prototype.equals=function(m){return this===m||m instanceof f&&ar.Property.equals(this._color,m._color)},ar.ConeRadarMaterialProperty=f,ar.Material.ConeRadarType="ConeRadar",ar.Material.ConeRadarSource=` float ripple(float dist, float rippleIntensity, float rippleScale) { return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity)); } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); material.alpha = 0.0; float intensity = step(0.001,ripple(dis, 80.0, 15.0)); if(intensity == 1.0) { material.alpha = 1.0; } return material; }`,ar.Material._materialCache.addMaterial(ar.Material.ConeRadarType,{fabric:{type:ar.Material.ConeRadarType,uniforms:{color:new ar.Color(1,0,0,.5),time:0},source:ar.Material.ConeRadarSource},translucent:function(m){return!0}})}return new ar.ConeRadarMaterialProperty(ar.Color.fromCssColorString(this.defaultValue(o,"#0000ff")),3e3)};oo.prototype.getMultiCircleScanMaterial=function(o,f){if(!ar.CircleScanMultiMaterialProperty){let m=function(v,y){this._definitionChanged=new ar.Event,this._color=void 0,this._colorSubscription=void 0,this.color=v,this.u_radius1=0,this.u_radius2=0,this.u_radius3=0,this.duration=y,this._time=new Date().getTime()};Object.defineProperties(m.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:ar.createPropertyDescriptor("color")}),m.prototype.getType=function(v){return"CircleScanMulti"},m.prototype.getValue=function(v,y){return ar.defined(y)||(y={}),y.color=ar.Property.getValueOrClonedDefault(this._color,v,ar.Color.WHITE,y.color),y.time=(new Date().getTime()-this._time)%this.duration/this.duration,y.time<1/3&&this.u_radius2===0&&this.u_radius1===0?this.u_radius3=y.time:y.time>=1/3&&y.time<2/3&&this.u_radius1===0?(this.u_radius3=y.time,this.u_radius2=this.u_radius3-1/3):y.time>=2/3?(this.u_radius3=y.time,this.u_radius2=this.u_radius3-1/3,this.u_radius1=this.u_radius3-2/3):y.time<1/3&&this.u_radius2!==0&&this.u_radius1!==0?(this.u_radius1=y.time,this.u_radius2=y.time+1/3,this.u_radius3=y.time+2/3):y.time>=1/3&&y.time<2/3&&this.u_radius1!==0&&(this.u_radius1=y.time-1/3,this.u_radius2=y.time,this.u_radius3=y.time+1/3),y.u_radius1=this.u_radius1,y.u_radius2=this.u_radius2,y.u_radius3=this.u_radius3,y},m.prototype.equals=function(v){return this===v||v instanceof m&&ar.Property.equals(this._color,v._color)},ar.CircleScanMultiMaterialProperty=m,ar.Material.CircleScanMultiType="CircleScanMulti",ar.Material.CircleScanMultiSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); dis = dis * 2.0; if(dis < u_radius1) { float f = dis / u_radius1; material.alpha = pow(f, 9.0); }else if(dis < u_radius2){ float f = dis / u_radius2; material.alpha = pow(f, 9.0); }else if(dis < u_radius3){ float f = dis / u_radius3; material.alpha = pow(f, 9.0); }else{ material.alpha = 0.0; } return material; }`,ar.Material._materialCache.addMaterial(ar.Material.CircleScanMultiType,{fabric:{type:ar.Material.CircleScanMultiType,uniforms:{color:new ar.Color(1,0,0,1),time:0,u_radius1:0,u_radius2:0,u_radius3:0},source:ar.Material.CircleScanMultiSource},translucent:function(v){return!0}})}return new ar.CircleScanMultiMaterialProperty(ar.Color.fromCssColorString(this.defaultValue(o,"#ff0000")),this.defaultValue(f,3e3))};oo.prototype.getSectorScanMaterial=function(o,f){if(!ar.EllipsoidFadeMaterialProperty){let m=function(v,y,x){this._definitionChanged=new ar.Event,this._color=void 0,this._colorSubscription=void 0,this.color=v,this.duration=x,this._angle=y,this._time=new Date().getTime()};Object.defineProperties(m.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:ar.createPropertyDescriptor("color"),angle:ar.createPropertyDescriptor("angle")}),m.prototype.getType=function(v){return"EllipsoidFade"},m.prototype.getValue=function(v,y){return ar.defined(y)||(y={}),y.color=ar.Property.getValueOrClonedDefault(this._color,v,ar.Color.WHITE,y.color),y.angle=this._angle,y},m.prototype.equals=function(v){return this===v||v instanceof m&&Property.equals(this._color,v._color)},ar.EllipsoidFadeMaterialProperty=m,ar.Material.EllipsoidFadeType="EllipsoidFade",ar.Material.EllipsoidFadeSource=`float getAngle(in vec2 dv) { if(dv.y == 0.0 && dv.x > 0.0) { return 90.0; } if(dv.y == 0.0 && dv.x < 0.0) { return 270.0; } float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926; if(dv.x > 0.0) { if(dv.y < 0.0) { rAngle = 180.0 + rAngle; } } if(dv.x <= 0.0) { if(dv.y < 0.0) { rAngle = 180.0 + rAngle; } if(dv.y > 0.0) { rAngle = 360.0 + rAngle; } } return rAngle; } float ripple(float dist, float rippleIntensity, float rippleScale) { return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity)); } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = 1.5 * color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); float nowAngle = getAngle(st.xy-vec2(0.5, 0.5)); if(nowAngle < angle) { material.alpha = 1.0 - dis/0.5; float intensity =step(0.001,ripple(dis, 100.0, 15.0)); if(intensity == 1.0) { material.alpha = material.alpha/2.0; } } else{ material.alpha = 0.0; discard; } return material; }`,ar.Material._materialCache.addMaterial(ar.Material.EllipsoidFadeType,{fabric:{type:ar.Material.EllipsoidFadeType,uniforms:{color:new ar.Color(1,0,0,1),angle:90},source:ar.Material.EllipsoidFadeSource},translucent:function(v){return!0}})}return new ar.EllipsoidFadeMaterialProperty(ar.Color.fromCssColorString(this.defaultValue(o,"#ff0000")),this.defaultValue(f,45))};oo.prototype.getCircleScanMaterial=function(o,f){if(!ar.CircleScanMaterialProperty){let m=function(v,y){this._definitionChanged=new ar.Event,this._color=void 0,this._colorSubscription=void 0,this.color=v,this.duration=y,this._time=new Date().getTime()};Object.defineProperties(m.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:ar.createPropertyDescriptor("color")}),m.prototype.getType=function(v){return"CircleScan"},m.prototype.getValue=function(v,y){return ar.defined(y)||(y={}),y.color=ar.Property.getValueOrClonedDefault(this._color,v,ar.Color.WHITE,y.color),y.time=(new Date().getTime()-this._time)%this.duration/this.duration,y},m.prototype.equals=function(v){return this===v||v instanceof m&&ar.Property.equals(this._color,v._color)},ar.CircleScanMaterialProperty=m,ar.Material.CircleScanType="CircleScan",ar.Material.CircleScanSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); if(dis<time){ float f = dis / time; material.alpha = pow(f, 4.0); }else{ material.alpha = 0.0; } return material; }`,ar.Material._materialCache.addMaterial(ar.Material.CircleScanType,{fabric:{type:ar.Material.CircleScanType,uniforms:{color:new ar.Color(1,0,0,1),time:0},source:ar.Material.CircleScanSource},translucent:function(v){return!0}})}return new ar.CircleScanMaterialProperty(ar.Color.fromCssColorString(this.defaultValue(o,"#ff0000")),this.defaultValue(f,3e3))};oo.prototype.getRadarScanMaterial=function(o,f){if(!ar.RadarScanMaterialProperty){let m=function(v,y){this._definitionChanged=new ar.Event,this._color=void 0,this._colorSubscription=void 0,this.color=v,this.duration=y,this._time=new Date().getTime()};Object.defineProperties(m.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:ar.createPropertyDescriptor("color")}),m.prototype.getType=function(v){return"RadarScan"},m.prototype.getValue=function(v,y){return ar.defined(y)||(y={}),y.color=ar.Property.getValueOrClonedDefault(this._color,v,ar.Color.WHITE,y.color),y.time=(new Date().getTime()-this._time)%this.duration/this.duration,y.angle1=360*y.time,y.angle2=360*y.time+60,y.angle2>360&&(y.angle2=y.angle2-360),y},m.prototype.equals=function(v){return this===v||v instanceof m&&ar.Property.equals(this._color,v._color)},ar.RadarScanMaterialProperty=m,ar.Material.RadarScanType="RadarScan",ar.Material.RadarScanSource=`float getAngle(in vec2 dv) { if(dv.y == 0.0 && dv.x > 0.0) { return 90.0; } if(dv.y == 0.0 && dv.x < 0.0) { return 270.0; } float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926; if(dv.x > 0.0) { if(dv.y < 0.0) { rAngle = 180.0 + rAngle; } } if(dv.x <= 0.0) { if(dv.y < 0.0) { rAngle = 180.0 + rAngle; } if(dv.y > 0.0) { rAngle = 360.0 + rAngle; } } return rAngle; } float ripple(float dist, float rippleIntensity, float rippleScale) { return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity)); } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); float f = 0.0; float nowAngle = getAngle(st.xy-vec2(0.5, 0.5)); if(nowAngle < angle2 && nowAngle > angle1) { f = (nowAngle - angle1) / 60.0; material.alpha = f; }else if(nowAngle < 360.0 && nowAngle > angle1 && angle2 < 60.0){ f = (nowAngle - angle1) / 60.0; material.alpha = f; }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < 60.0){ f = (nowAngle + 360.0 - angle1) / 60.0; material.alpha = f; }else{ material.alpha = 0.0; discard; } return material; }`,ar.Material._materialCache.addMaterial(ar.Material.RadarScanType,{fabric:{type:ar.Material.RadarScanType,uniforms:{color:new ar.Color(1,0,0,1),time:0,angle2:0,angle1:0},source:ar.Material.RadarScanSource},translucent:function(v){return!0}})}return new ar.RadarScanMaterialProperty(ar.Color.fromCssColorString(this.defaultValue(o,"#ff0000")),this.defaultValue(f,3e3))};oo.prototype.gradientColor=function(o,f,m){return new kat(o,f,m)};oo.prototype.xhr=function(o){var f=new XMLHttpRequest,m=!0;if(o.async==null||o.async==null?m=!0:m=o.async,f.open(o.type,o.url,m),o.headers)for(let v in o.headers)f.setRequestHeader(v,o.headers[v]);f.send(o.data||{}),f.onreadystatechange=function(){this.readyState===4&&this.status===200?o.success&&typeof o.success=="function"&&o.success(o.isXml?this.responseXML:JSON.parse(this.responseText)):this.status!==200&&o.error&&typeof o.error=="function"&&o.error(f),o.complete&&typeof o.complete=="function"&&o.complete()}};var ARi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};oo.prototype._serialize=function(o){var f=[],m=window.encodeURIComponent;for(var v in o){var y=o[v];(typeof y>"u"?"undefined":ARi(y))==="object"?f.push(m(v)+"="+m(JSON.stringify(y))):f.push(m(v)+"="+m(o[v]))}return f.join("&")};oo.prototype.xml2json=function(o,f){return J6(o)};oo.prototype.getBrowser=function(){var o=navigator.userAgent.toLowerCase(),f=(o.match(/firefox|chrome|safari|opera/g)||"other")[0];(o.match(/msie|trident/g)||[])[0]&&(f="msie");var m="",v="",y="",x="ontouchstart"in window||o.indexOf("touch")!==-1||o.indexOf("mobile")!==-1;switch(x?o.indexOf("ipad")!==-1?m="pad":o.indexOf("mobile")!==-1?m="mobile":o.indexOf("android")!==-1?m="androidPad":m="pc":m="pc",f){case"chrome":case"safari":case"mobile":v="webkit";break;case"msie":v="ms";break;case"firefox":v="Moz";break;case"opera":v="O";break;default:v="webkit";break}return y=o.indexOf("android")>0?"android":navigator.platform.toLowerCase(),{version:(o.match(/[\s\S]+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[])[1],plat:y,type:f,pc:m,prefix:v,isMobile:m!="pc"}};var Sr=oo;var D_=null;function vP(o,f){D_=f,this._viewer=o,this.editType="Entity",this._core=new Sr(o,f),this.tooltip=this._core.CreateTooltip({id:"ModelEdit"})}vP.prototype.start=function(o,f={}){if(this.end(),!o)return;let m,v;if(o.item&&o.item instanceof D_.Cesium3DTileset)this.editType="SE3DTiles",v=o.boundingSphereRadius,m=D_.Cartesian3.fromDegrees(o.modelEditData.lon,o.modelEditData.lat,o.modelEditData.height);else{this.editType="Entity";let w=this._viewer.scene.primitives._primitives.findIndex(T=>T.id&&T.id.id===o.id);if(w<0)return;v=this._viewer.scene.primitives.get(w).boundingSphere.radius,m=o.position.getValue(),!o.heading&&(o.heading=0),!o.pitch&&(o.pitch=0),!o.roll&&(o.roll=0)}this.model=o;let y=3.63,x=2*v/y,C=D_.Transforms.eastNorthUpToFixedFrame(m);return this.axis=this._viewer.scene.primitives.add(D_.Model.fromGltf({id:"modeEditAxis",modelMatrix:C,url:window.SmartEarthRootUrl+pn.modelAxis,scale:x,minimumPixelSize:f.minimumPixelSize})),this.axis.readyPromise.then(()=>{f.rotateX===!1&&(this.axis._nodeCommands[1].show=!1),f.rotateY===!1&&(this.axis._nodeCommands[0].show=!1),f.rotateZ===!1&&(this.axis._nodeCommands[5].show=!1)}),this.initEvent(f),this};vP.prototype.initEvent=function(o){this.editHandler&&this.editHandler.destroy(),this.editHandler=new D_.ScreenSpaceEventHandler(this._viewer.scene.canvas);let f,m;this.editHandler.setInputAction(v=>{f?(m=v.position,this.editType==="Entity"?(this.originPosition=this.model.position.getValue(),this.originHeading=this.model.heading||0,this.originPitch=this.model.pitch||0,this.originRoll=this.model.roll||0):(this.originPosition=D_.Cartesian3.fromDegrees(this.model.modelEditData.lon,this.model.modelEditData.lat,this.model.modelEditData.height),this.originHeading=this.model.modelEditData.heading||0,this.originPitch=this.model.modelEditData.ritch||0,this.originRoll=this.model.modelEditData.roll||0),this.startPosition=this._viewer.scene.pickPosition(m),this.defaultEvent(!1),this.setMouseStyle("edit")):m=void 0},D_.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(v=>{m=void 0,this.defaultEvent(!0),this.setMouseStyle("default")},D_.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(v=>{if(m){this.mouseTooltip(f,v),this.edit(f,m,v.endPosition),o.callback&&o.callback(f);return}let y=this._viewer.scene.pick(v.endPosition);if(y&&y.id==="modeEditAxis"){let x=y.mesh?y.mesh.name:y.detail.node._name;x==="XArrow_1"?f="y":x==="YArrow_1"?f="x":x==="ZArrow_1"?f="z":x==="ZAxis_1"?f="heading":x==="XAxis_1"?f="pitch":x==="YAxis_1"?f="roll":f=void 0}else f=void 0;this.mouseTooltip(f,v)},D_.ScreenSpaceEventType.MOUSE_MOVE)};vP.prototype.defaultEvent=function(o){let f=this._viewer.scene;f.screenSpaceCameraController.enableRotate=o,f.screenSpaceCameraController.enableTranslate=o,f.screenSpaceCameraController.enableZoom=o,f.screenSpaceCameraController.enableTilt=o,f.screenSpaceCameraController.enableLook=o};vP.prototype.setMouseStyle=function(o){o==="edit"?(this.defaultMouseStyle=this._viewer.container.style.cursor,this._viewer.container.style.cursor="crosshair"):o==="default"&&(this._viewer.container.style.cursor=this.defaultMouseStyle||"default")};vP.prototype.edit=function(o,f,m){if(o){let v=this.originPosition,y=this.startPosition,x=this._viewer.scene.pickPosition(m),C=this._core.toDegrees(v),w=this._core.toDegrees(y),A=this._core.toDegrees(x),E=this._viewer.scene.cartesianToCanvasCoordinates(v),T=m.x-f.x,S=m.y-f.y,M;if(o==="x"){let I=w.lon-A.lon;C.lon-=I,this.setPosition(C)}else if(o==="y"){let I=w.lat-A.lat;C.lat-=I,this.setPosition(C)}else if(o==="z"){let I=w.height-C.height,P=S*Math.abs(I/(f.y-E.y));C.height-=P,this.setPosition(C)}else if(o==="heading"){let I=this.originHeading,P=this._core.arge(E,f,m,"+-",!0);I-=P,this.setRotate("heading",I)}else if(o==="pitch"){let P=(w.lon-C.lon)/(f.x-E.x),D=this.originPitch,L=this._core.arge(E,f,m,"+-",!0);P>0?D+=L:D-=L,this.setRotate("pitch",D)}else if(o==="roll"){let P=(w.lat-C.lat)/(f.x-E.x),D=this.originRoll,L=this._core.arge(E,f,m,"+-",!0);P<0?D-=L:D+=L,this.setRotate("roll",D)}}};vP.prototype.setPosition=function(o){let f=D_.Cartesian3.fromDegrees(o.lon,o.lat,o.height);this.editType==="Entity"?(this.model.position=f,window.SmartEarthPopupData&&window.SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="height"]').value=o.height.toFixed(2))):this.model.setEditData(o),this.axis.modelMatrix=D_.Transforms.eastNorthUpToFixedFrame(f)};vP.prototype.setRotate=function(o,f){if(this.model)if(this.editType==="Entity"){let m=this.model.heading,v=this.model.pitch,y=this.model.roll;o==="heading"?this.model.heading=m=f:o==="pitch"?this.model.pitch=v=f:o==="roll"&&(this.model.roll=y=f),this.model.orientation=D_.Transforms.headingPitchRollQuaternion(this.model.position.getValue(),new D_.HeadingPitchRoll(D_.Math.toRadians(m),D_.Math.toRadians(v),D_.Math.toRadians(y))),window.SmartEarthPopupData&&window.SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector(`.model input[name="${o}"]`)&&(SmartEarthPopupData.window.document.querySelector(`.model input[name="${o}"]`).value=f)}else switch(o){case"heading":this.model.setEditData({heading:-f});break;case"pitch":this.model.setEditData({pitch:f});break;case"roll":this.model.setEditData({roll:f});break}};vP.prototype.mouseTooltip=function(o,f){if(o){let m=f.endPosition||f.position;o==="x"?this.tooltip.showAt(m,"X\u65B9\u5411\u5E73\u79FB"):o==="y"?this.tooltip.showAt(m,"Y\u65B9\u5411\u5E73\u79FB"):o==="z"?this.tooltip.showAt(m,"Z\u65B9\u5411\u5E73\u79FB"):o==="heading"?this.tooltip.showAt(m,"\u7ED5Z\u8F74\u65CB\u8F6C"):o==="pitch"?this.tooltip.showAt(m,"\u7ED5Y\u8F74\u65CB\u8F6C"):o==="roll"?this.tooltip.showAt(m,"\u7ED5X\u8F74\u65CB\u8F6C"):this.tooltip.show(!1)}else this.tooltip.show(!1)};vP.prototype.end=function(){this.axis&&this._viewer.scene.primitives.remove(this.axis),this.axis=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0,this.model&&(this.model.ModelEdit=void 0),this.model=void 0,this.tooltip&&this.tooltip.show(!1)};var wX=vP;function RO(o,f,m,v){this._extractAttributes=o,this._featureName=f||"featureMember",this._xy=v,this._gmlns=m||"http://www.opengis.net/gml",this._regExes={trimSpace:/^\s*|\s*$/g,removeSpace:/\s*/g,splitSpace:/\s+/,trimComma:/\s*,\s*/g}}Object.defineProperties(RO.prototype,{featureName:{get:function(){return this._featureName},set:function(o){this._featureName=o}},extractAttributes:{get:function(){return this._extractAttributes},set:function(o){this._extractAttributes=o}},xy:{get:function(){return this._xy}}});RO.prototype.getElementsByTagNameNS=function(o,f,m){var v=[];if(o.getElementsByTagNameNS)v=o.getElementsByTagNameNS(f,m);else for(var y=o.getElementsByTagName("*"),x,C,w=0,A=y.length;w<A;++w)x=y[w],C=x.prefix?x.prefix+":"+m:m,(m=="*"||C==x.nodeName)&&(f=="*"||f==x.namespaceURI)&&v.push(x);return v};RO.prototype.read=function(o){for(var f=this.getElementsByTagNameNS(o.documentElement,this._gmlns,this.featureName),m=[],v=0;v<f.length;v++){var y=this.parseFeature(f[v]);y&&m.push(y)}return m};RO.prototype.parseFeature=function(o){for(var f=["MultiPolygon","Polygon","MultiLineString","LineString","MultiPoint","Point","Envelope"],m,v,y,x,C=0;C<f.length;++C)if(m=f[C],v=this.getElementsByTagNameNS(o,this._gmlns,m),v.length>0){x=this.parseGeometry[m.toLowerCase()],x?y=x.apply(this,[v[0]]):console.log("unsupportedGeometryType:"+m);break}var w,A=this.getElementsByTagNameNS(o,this._gmlns,"Box");for(C=0;C<A.length;++C){var E=A[C],T=this.parseGeometry.box.apply(this,[E]),S=E.parentNode,M=S.localName||S.nodeName.split(":").pop();M==="boundedBy"?w=T:y=T.toGeometry()}var I;this.extractAttributes&&(I=this.parseAttributes(o));var P={geometryType:m.toLowerCase(),positions:y,attributes:I};P.bounds=w;for(var D=o.firstChild,L;D&&!(D.nodeType==1&&(L=D.getAttribute("fid")||D.getAttribute("id"),L));)D=D.nextSibling;return P.fid=L,P};RO.prototype.parseGeometry={point:function(o){var v,f,m=[],v=this.getElementsByTagNameNS(o,this._gmlns,"pos");if(v.length>0&&(f=v[0].firstChild.nodeValue,f=f.replace(this._regExes.trimSpace,""),m=f.split(this._regExes.splitSpace)),m.length==0&&(v=this.getElementsByTagNameNS(o,this._gmlns,"coordinates"),v.length>0&&(f=v[0].firstChild.nodeValue,f=f.replace(this._regExes.removeSpace,""),m=f.split(","))),m.length==0&&(v=this.getElementsByTagNameNS(o,this._gmlns,"coord"),v.length>0)){var y=this.getElementsByTagNameNS(v[0],this._gmlns,"X"),x=this.getElementsByTagNameNS(v[0],this._gmlns,"Y");y.length>0&&x.length>0&&(m=[y[0].firstChild.nodeValue,x[0].firstChild.nodeValue])}return m.length==2&&(m[2]=null),this.xy?[parseFloat(m[0]),parseFloat(m[1]),parseFloat(m[2])]:[parseFloat(m[1]),parseFloat(m[0]),parseFloat(m[2])]},multipoint:function(o){var f=this.getElementsByTagNameNS(o,this._gmlns,"Point"),m=[];if(f.length>0)for(var v,y=0;y<f.length;++y)v=this.parseGeometry.point.apply(this,[f[y]]),v&&m.push(v);return m},linestring:function(o,f){var m,v,y=[],x=[];if(m=this.getElementsByTagNameNS(o,this._gmlns,"posList"),m.length>0){v=this.getChildValue(m[0]),v=v.replace(this._regExes.trimSpace,""),y=v.split(this._regExes.splitSpace);for(var C=parseInt(m[0].getAttribute("dimension")),w,A,E,T,S=0;S<y.length/C;++S)w=S*C,A=parseFloat(y[w]),E=parseFloat(y[w+1]),T=C==2?null:parseFloat(y[w+2]),this.xy?x.push(A,E,T):x.push(E,A,T)}if(y.length==0&&(m=this.getElementsByTagNameNS(o,this._gmlns,"coordinates"),m.length>0)){v=this.getChildValue(m[0]),v=v.replace(this._regExes.trimSpace,""),v=v.replace(this._regExes.trimComma,",");for(var M=v.split(this._regExes.splitSpace),S=0;S<M.length;++S)y=M[S].split(","),y.length==2&&(y[2]=null),this.xy?x.push(parseFloat(y[0]),parseFloat(y[1]),parseFloat(y[2])):x.push(parseFloat(y[1]),parseFloat(y[0]),parseFloat(y[2]))}return x},multilinestring:function(o){var f=this.getElementsByTagNameNS(o,this._gmlns,"LineString"),m=[];if(f.length>0)for(var v,y=0;y<f.length;++y)v=this.parseGeometry.linestring.apply(this,[f[y]]),v&&m.push(v);return m},polygon:function(o){var f=this.getElementsByTagNameNS(o,this._gmlns,"LinearRing"),m=[];if(f.length>0)for(var v,y=0;y<f.length;++y)v=this.parseGeometry.linestring.apply(this,[f[y],!0]),v&&m.push(v);return m},multipolygon:function(o){var f=this.getElementsByTagNameNS(o,this._gmlns,"Polygon"),m=[];if(f.length>0)for(var v,y=0;y<f.length;++y)v=this.parseGeometry.polygon.apply(this,[f[y]]),v&&m.push(v);return m},envelope:function(o){var f=[],m,v,y=this.getElementsByTagNameNS(o,this._gmlns,"lowerCorner");if(y.length>0){var x=[];if(y.length>0&&(m=y[0].firstChild.nodeValue,m=m.replace(this._regExes.trimSpace,""),x=m.split(this._regExes.splitSpace)),x.length==2&&(x[2]=null),this.xy)var C=new OpenLayers_Geometry_Point(x[0],x[1],x[2]);else var C=new OpenLayers_Geometry_Point(x[1],x[0],x[2])}var w=this.getElementsByTagNameNS(o,this._gmlns,"upperCorner");if(w.length>0){var x=[];if(w.length>0&&(m=w[0].firstChild.nodeValue,m=m.replace(this._regExes.trimSpace,""),x=m.split(this._regExes.splitSpace)),x.length==2&&(x[2]=null),this.xy)var A=new OpenLayers_Geometry_Point(x[0],x[1],x[2]);else var A=new OpenLayers_Geometry_Point(x[1],x[0],x[2])}return C&&A&&(f.push([C.x,C.y,null]),f.push([A.x,C.y,null]),f.push([A.x,A.y,null]),f.push([C.x,A.y,null]),f.push([C.x,C.y,null]),v=new OpenLayers_Geometry_Polygon([[f]])),v},box:function(o){var f=this.getElementsByTagNameNS(o,this._gmlns,"coordinates"),m,v,y=null,x=null;if(f.length>0&&(m=f[0].firstChild.nodeValue,v=m.split(" "),v.length==2&&(y=v[0].split(","),x=v[1].split(","))),y!==null&&x!==null)return[parseFloat(y[0]),parseFloat(y[1]),null,parseFloat(x[0]),parseFloat(x[1]),null]}};RO.prototype.parseAttributes=function(o){for(var f={},m=o.firstChild,v,y,x,C,w,A,E;m;){if(m.nodeType==1){for(v=m.childNodes,y=0;y<v.length;++y)x=v[y],x.nodeType==1&&(C=x.childNodes,C.length==1?(w=C[0],(w.nodeType==3||w.nodeType==4)&&(A=x.prefix?x.nodeName.split(":")[1]:x.nodeName,E=w.nodeValue.replace(this._regExes.trimSpace,""),f[A]=E)):f[x.nodeName.split(":").pop()]=null);break}m=m.nextSibling}return f};RO.prototype.getChildValue=function(o,f){var m=f||"";if(o)for(var v=o.firstChild;v;v=v.nextSibling)switch(v.nodeType){case 3:case 4:m+=v.nodeValue}return m};var Dst=RO;var Ps=null;function _d(o){Ps=o,this._core=new Sr(null,Ps),this.level=0,this._quadtree=void 0,this._loadTileEvent=new Ps.Event,this._tilingScheme=new Ps.GeographicTilingScheme,this._errorEvent=new Ps.Event,this._levelZeroMaximumError=Ps.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Ps.Rectangle.clone(Ps.Rectangle.MAX_VALUE),this._tileCache=[],this._primitivesWaitingToBeAddedToTheScene=[],this._pauseStreaming=!1,this._numTilesInLevel=[],this.tileLevel={},this.STREAM_SPEED_IMIDIATE=0,this.STREAM_SPEED_FAST=1,this.STREAM_SPEED_NORMAL=2,this.STREAM_SPEED_SLOW=3,this._streamSpeed=this.STREAM_SPEED_NORMAL,_d.prototype.ready||Object.defineProperties(_d.prototype,{quadtree:{get:function(){return this._quadtree},set:function(f){this._quadtree=f}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},loadTileEvent:{get:function(){return this._loadTileEvent}},pauseStreaming:{get:function(){return this._pauseStreaming},set:function(f){this._pauseStreaming=f}},streamSpeed:{get:function(){return this._streamSpeed},set:function(f){this._streamSpeed=f}},bestLevelAvailable:{get:function(){for(var f=0,m=0;m<22;m++)this._numTilesInLevel[m]!=null&&this._numTilesInLevel[m]>0&&f<m&&(f=m);return f}}})}function Ost(o,f,m){$.each(f._primitives,function(v,y){if(y instanceof Ps.BillboardCollection){var x=y,v=AX.indexOf(x);return x._parentCollection._primitiveOld=m,v!==-1?(o.scene.primitives.remove(AX[v]._parentCollection),AX[v]=x):AX.push(x),!1}})}function Nst(o,f,m){o.scene.primitives.remove(m),f._onDestroyTilePrimitive=function(){o.scene.primitives.remove(m),this._onDestroyTilePrimitive=void 0}}function iMe(o,f,m,v){Promise.all([f]).then(function(){o.scene.primitives.remove(v)}),m._onDestroyTilePrimitive=function(){o.scene.primitives.remove(v),this._onDestroyTilePrimitive=void 0}}function Fst(o,f,m){var v=$.map(f._primitives,function(y){return y.readyPromise});iMe(o,v,f,m)}function Bst(o,f,m){var v=$.map(f._primitives[0]._primitives,function(y){return y.readyPromise});iMe(o,v,f,m)}function kst(o,f,m){o.scene.primitives.remove(m)}function Vst(o,f,m){var v=[f.readyPromise];iMe(o,v,f,m)}_d.prototype.streamSpeedFactor=function(){switch(this._streamSpeed){case this.STREAM_SPEED_FAST:return 1;case this.STREAM_SPEED_NORMAL:return 3;case this.STREAM_SPEED_SLOW:return 20;default:return 3}};var AX=[],Lst=0;_d.prototype.onPreFrame=function(o,f){if(Lst++,!this._pauseStreaming){if(this._streamSpeed==this.STREAM_SPEED_IMIDIATE)for(;this._primitivesWaitingToBeAddedToTheScene.length>0;){var m=this._primitivesWaitingToBeAddedToTheScene.pop();o.primitives.add(m)}else if(this._primitivesWaitingToBeAddedToTheScene.length>0&&Lst%this.streamSpeedFactor()==0){var m=this._primitivesWaitingToBeAddedToTheScene.pop();m._instanceIds&&m._instanceIds.length>100&&this.streamSpeed===this.STREAM_SPEED_FAST&&(this.streamSpeed=this.STREAM_SPEED_NORMAL),o.primitives.add(m)}$.each(AX,function(v,y){y.ready&&this.viewer.scene.primitives.remove(y._parentCollection._primitiveOld)})}};_d.prototype.updateForPick=function(o){};var EX=180/Math.PI,j7i=1/EX;_d.prototype.placeHolder=function(o,f){f=f||Ps.Color.fromBytes(0,255,0,255);var m=new Ps.Primitive({geometryInstances:new Ps.GeometryInstance({geometry:new Ps.RectangleOutlineGeometry({rectangle:o.rectangle,height:this.viewer.camera.positionCartographic.height-TerraExplorer.internal.Navigate.HeightAboveGround*.99}),attributes:{color:Ps.ColorGeometryInstanceAttribute.fromColor(f)}}),appearance:new Ps.PerInstanceColorAppearance({flat:!0})});o.data.primitive.add(m)};_d.prototype.getTile=function(o){return this._tileCache[o]};_d.prototype.getAllTiles=function(){var o=[];for(var f in this._tileCache)o.push(this._tileCache[f]);return o};_d.prototype.addToScene=function(o){this._primitivesWaitingToBeAddedToTheScene.push(o)};_d.prototype.removeFromScene=function(o){var f=this._primitivesWaitingToBeAddedToTheScene.indexOf(o);f!=-1?(this._primitivesWaitingToBeAddedToTheScene[f].destroy(),this._primitivesWaitingToBeAddedToTheScene.splice(f,1)):this.viewer.scene.primitives.remove(o)};_d.prototype.replaceInScene=function(o,f){var m=this._primitivesWaitingToBeAddedToTheScene.indexOf(o);if(m!=-1)this._primitivesWaitingToBeAddedToTheScene[m]=f;else{o.ID!=f.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),o._replacmentPrimitive!=null&&this.viewer.scene.primitives.remove(o._replacmentPrimitive),o._replacmentPrimitive=f,this.viewer.scene.primitives.add(f);var v=f.ID.split(":")[0];switch(v){case"billboards":Ost(this.viewer,f,o);break;case"labels":Nst(this.viewer,f,o);break;case"polygons":Fst(this.viewer,f,o);break;case"models":Bst(this.viewer,f,o);break;case"polylines":Vst(this.viewer,f,o);break;case"points":kst(this.viewer,f,o);break;default:console.log("Error updating layer"),this.viewer.scene.primitives.remove(o)}}};var ERi={billboards:Ost,labels:Nst,polygons:Fst,models:Bst,polylines:Vst,points:kst};_d.prototype.replaceInSceneNew=function(o,f){var m=this._primitivesWaitingToBeAddedToTheScene.indexOf(o);if(m!=-1)this._primitivesWaitingToBeAddedToTheScene[m]=f;else{o.ID!==f.ID&&console.log("TileManager.replaceInScene Warning: new primitive has a different ID than old primitive"),this.addToScene(f);var v=void 0,y=f.ID.split(":")[0],x=ERi[y];x?x(f,o):(console.log("Error updating layer"),this.viewer.scene.primitives.remove(o))}};_d.prototype.update=function(o){this.level=this._core.getLevel(this.viewer);let f=this.getAllTiles(),m,v;f.forEach(y=>{for(let x in y.data.wfsLayerData)v=y.data.wfsLayerData[x]&&y.data.wfsLayerData[x].primitive,m=this.tileLevel[x].level,v&&m&&this.tileLevel[x].visible&&(this.level<=m.max&&this.level>=m.min?v.show=!0:v.show=!1)}),this._quadtree.beginFrame(o),this._quadtree.render(o),this._quadtree.endFrame(o)};var Rst=!1;_d.prototype.initialize=function(o){Rst||(this.viewer.scene.preRender.addEventListener(this.onPreFrame,this),Rst=!0)};_d.prototype.beginUpdate=function(o){this.quadtree.beginFrame(o)};_d.prototype.endUpdate=function(o){var f=this;o.afterRender.push(function(){f.quadtree.endFrame(o)})};_d.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumError/(1<<o)};_d.prototype.loadTile=function(o,f){var m=this;if(this._numTilesInLevel[f._level]==null&&(this._numTilesInLevel[f._level]=0),this._numTilesInLevel[f._level]++,f.state===Ps.QuadtreeTileLoadState.START){f.data={primitive:new Ps.PrimitiveCollection,wfsLayerData:[],id:Ps.createGuid(),freeResources:function(){if(m._tileCache[f.data.id]&&m._numTilesInLevel[f._level]--,m._numTilesInLevel[f._level]<0&&(m._numTilesInLevel[f._level]=0),Ps.defined(this.wfsLayerData)){for(var C in this.wfsLayerData)Ps.defined(this.wfsLayerData[C])&&this.wfsLayerData[C].freeResources();this.wfsLayerData=void 0}Ps.defined(this.primitive)&&(this.primitive.destroy(),this.primitive=void 0),delete m._tileCache[f.data.id]}},this._tileCache[f.data.id]=f;var v=6371e3,y=Math.abs(v*(f.rectangle.south-f.rectangle.north));f.data.boundingSphere3D=Ps.BoundingSphere.fromRectangle3D(f.rectangle),f.data.boundingSphere2D=Ps.BoundingSphere.fromRectangle2D(f.rectangle,o.mapProjection);var x=[EX*f.rectangle.west,EX*f.rectangle.south,EX*f.rectangle.east,EX*f.rectangle.north];this.loadTileEvent.raiseEvent(f),f.state=Ps.QuadtreeTileLoadState.DONE,f.renderable=!0}};_d.prototype.computeTileVisibility=function(o,f,m){var v=this.computeDistanceToTile(o,f);if(o._distance=v,f.fog.enabled&&Ps.Math.fog(v,f.fog.density)>=1)return Ps.Visibility.NONE;var y=o.data,x=y.tileBoundingRegion;if(y.boundingVolumeSourceTile===void 0)return Ps.Visibility.PARTIAL;var C=f.cullingVolume,w=y.orientedBoundingBox;!w&&y.renderedMesh&&(w=y.renderedMesh.boundingSphere3D),y.clippedByBoundaries=!1;function A(R,O){if(O.west<O.east)return O;var F=Rectangle.clone(O,splitCartographicLimitRectangleScratch),k=Rectangle.center(R,rectangleCenterScratch);return k.longitude>0?F.east=CesiumMath.PI:F.west=-CesiumMath.PI,F}var E=A(o.rectangle,this.cartographicLimitRectangle),T=new Ps.Rectangle,S=Ps.Rectangle.simpleIntersection(E,o.rectangle,T);if(!S)return Visibility.NONE;if(Ps.Rectangle.equals(S,o.rectangle)||(y.clippedByBoundaries=!0),f.mode,Ps.SceneMode.SCENE3D,!w)return Ps.Intersect.INTERSECTING;var M=this._clippingPlanes;if(M&&M.enabled){var I=M.computeIntersectionWithBoundingVolume(w);if(o.isClipped=I!==Intersect.INSIDE,I===Ps.Intersect.OUTSIDE)return Ps.Visibility.NONE}var P=C.computeVisibility(w);if(P===Ps.Intersect.OUTSIDE)return Ps.Visibility.NONE;var D=f.mode===Ps.SceneMode.SCENE3D&&f.camera.frustum instanceof Ps.OrthographicFrustum;if(f.mode===Ps.SceneMode.SCENE3D&&!D&&m){var L=y.occludeePointInScaledSpace;return!L||m.ellipsoid.isScaledSpacePointVisible(L)?P:Ps.Visibility.NONE}return P};_d.prototype.canRefine=function(o,f,m){return o.level<16};_d.prototype.showTileThisFrame=function(o,f,m,v){o.data.geometryPrimitive&&o.data.geometryPrimitive.update(f,m,v)};_d.prototype.computeDistanceToTile=function(o,f){function m(P,D,L,R,O){var F=P.quadtree._occluders.ellipsoid,k=F.ellipsoid,U=[new Ps.Cartesian3,new Ps.Cartesian3,new Ps.Cartesian3,new Ps.Cartesian3],G=U;return Ps.Cartesian3.fromRadians(L.west,L.south,R,k,G[0]),Ps.Cartesian3.fromRadians(L.east,L.south,R,k,G[1]),Ps.Cartesian3.fromRadians(L.west,L.north,R,k,G[2]),Ps.Cartesian3.fromRadians(L.east,L.north,R,k,G[3]),F.computeHorizonCullingPoint(D,G,O)}function v(P,D,L){var R=P.data;return R===void 0&&(R=P.data=new Ps.GlobeSurfaceTile),R.tileBoundingRegion===void 0&&(R.tileBoundingRegion=new Ps.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:P.rectangle,ellipsoid:P.tilingScheme.ellipsoid,minimumHeight:0,maximumHeight:0})),P}var y=v(o,this.terrainProvider,f),x=o.data,C=x.tileBoundingRegion;if(y===void 0)return 9999999999;if(x.boundingVolumeSourceTile!==y){x.boundingVolumeSourceTile=y;var w=o.rectangle;w&&w.width<Ps.Math.PI_OVER_TWO+Ps.Math.EPSILON5&&(x.orientedBoundingBox=Ps.OrientedBoundingBox.fromRectangle(o.rectangle,C.minimumHeight,C.maximumHeight,o.tilingScheme.ellipsoid,x.orientedBoundingBox),x.occludeePointInScaledSpace=m(this,x.orientedBoundingBox.center,o.rectangle,C.maximumHeight,x.occludeePointInScaledSpace))}var A=C.minimumHeight,E=C.maximumHeight;if(x.boundingVolumeSourceTile!==o){var T=f.camera.positionCartographic.height,S=Math.abs(T-A),M=Math.abs(T-E);S>M?(C.minimumHeight=A,C.maximumHeight=A):(C.minimumHeight=E,C.maximumHeight=E)}var I=C.distanceToCamera(f);return C.minimumHeight=A,C.maximumHeight=E,I};_d.prototype.isDestroyed=function(){return!1};_d.prototype.destroy=function(){return Ps.destroyObject(this)};_d.prototype.remove=function(){this.destroy()};_d.prototype.getInstance=function(o){if(Ps.defined(o.TileManager)==0){var f=new _d(Ps);o.TileManager=f,f.viewer=o;var m=new Ps.QuadtreePrimitive({tileProvider:o.TileManager,maximumScreenSpaceError:2});o.scene.primitives.add(m)}return o.TileManager};var zst=_d;function AD(){}function ax(o){return typeof o=="string"?o.replace(/^\s+/g,"").replace(/\s+$/g,""):o}function TX(o,f){for(var m="######",v=!1,y=0,x="",C=0;C<f.length;C++)!v&&/['"`]/.test(f[C])?v=f[C]:v&&f[C]==v?v=!1:!v&&f[C]=="("?y++:!v&&f[C]==")"&&y--,f[C]==o&&(y>0||v)?x+=m:x+=f[C];return f=x,f=f.split(o),f=f.map(function(w){return ax(w.replace(new RegExp(m,"g"),o))}),f}function rMe(o){for(var f="#",m=o.length,v=0;v<m;v++)f+=o[v]+"#";return f}function nMe(o){for(var f="",m=o.length,v=1;v<m;v+=2)f+=o[v];return f}function Q6(o){this.source=o,this.cursor=0,this.currentChar="",this.readNextChar()}function v4(o){this.lexer=new Q6(o),this.currentToken="",this.readNextToken()}function oMe(o,f){var m="";return typeof o.logic<"u"?(m=o.terms.map(function(v){return oMe(v,!0)}),m=m.join(" "+o.logic+" "),typeof f<"u"&&(m="("+m+")")):typeof o.left<"u"?(m=o.left,typeof o.operator<"u"&&(m+=" "+o.operator,typeof o.right<"u"&&(o.operator==="IN"?m+=" ("+o.right+")":m+=" "+o.right))):m=o,m}AD.sql2ast=function(o,f){function m(D,L){return L}(typeof f>"u"||f===null)&&(f=!0);var v="###semi-colon###";o=o.replace(/[("'`].*;.*[)"'`]/g,function(D){return D.replace(/;/g,v)});var y="###EOR###";o=o.replace(/;/g,y),o=o.split(y)[0],o=o.replace(new RegExp(v,"g"),";");var x=["SELECT","FROM","DELETE FROM","INSERT INTO","UPDATE","JOIN","LEFT JOIN","RIGHT JOIN","INNER JOIN","ORDER BY","GROUP BY","HAVING","WHERE","LIMIT","VALUES","SET"],C=x.map(function(D){return D+" "});C=C.concat(x.map(function(D){return D+"("})),C=C.concat(C.map(function(D){return D.toLowerCase()}));var w=C.map(function(D){return D.replace("(","[\\(]")});o=o.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(D){return D.replace(new RegExp(w.join("|"),"gi"),rMe)});var A=[];C.forEach(function(D){var L=0,R;do if(R=o.indexOf(D,L),R!=-1){var O=D.replace(/^((\w|\s)+?)\s?\(?$/i,m);A[R]=O,L=R+O.length}while(R!=-1)});var E=0;A.forEach(function(D,L){E>L?delete A[L]:(E=parseInt(L,10)+D.length,D=="JOIN"&&(A[L]="INNER JOIN"))});var T=w.slice(0);T=T.map(function(D){return rMe(D)}),T=T.join("|");var S=o.split(new RegExp(w.join("|"),"i"));o=o.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(D){return D.replace(new RegExp(T,"gi"),nMe)}),S=S.map(function(D){return D.replace(/\((.+?)\)|"(.+?)"|'(.+?)'|`(.+?)`/gi,function(L){return L.replace(new RegExp(T,"gi"),nMe)})});var M=[];M.SELECT=function(D){var L=TX(",",D);return L=L.filter(function(R){return R!==""}).map(function(R){return{name:R}}),L},M.SET=function(D){var L=TX(",",D);return L=L.filter(function(R){return R!==""}).map(function(R){return{expression:R}}),L},M.FROM=M["DELETE FROM"]=M.UPDATE=function(D){var L=D.split(",");return L=L.map(function(R){return ax(R)}),L.forEach(function(R,O){R===""&&L.splice(O)}),L=L.map(function(R){var O=R.split(" AS "),F=O[1]||"";return F.indexOf('"')===0&&F.lastIndexOf('"')==F.length-1&&(F=F.substring(1,F.length-1)),{table:O[0],as:F}}),L},M["LEFT JOIN"]=M.JOIN=M["INNER JOIN"]=M["RIGHT JOIN"]=function(D){D=D.split(" ON ");var L=D[0].split(" AS "),R={};return R.table=ax(L[0]),R.as=ax(L[1])||"",R.cond=ax(D[1]),R},M.WHERE=function(D){return ax(D)},M["ORDER BY"]=function(D){D=D.split(",");var L=[];return D.forEach(function(R,O){var F=/([A-Za-z0-9_\.]+)\s*(ASC|DESC){0,1}/gi;if(F=F.exec(R),F!==null){var k={};k.column=ax(F[1]),k.order=ax(F[2]),F[2]===void 0&&(k.order="ASC"),L.push(k)}}),L},M["GROUP BY"]=function(D){D=D.split(",");var L=[];return D.forEach(function(R,O){var F=/([A-Za-z0-9_\.]+)/gi;if(F=F.exec(R),F!==null){var k={};k.column=ax(F[1]),L.push(k)}}),L},M.LIMIT=function(D){var L=/((\d+)\s*,\s*)?(\d+)/gi;L=L.exec(D),typeof L[2]>"u"&&(L[2]=0);var R={};return R.nb=parseInt(ax(L[3]),10),R.from=parseInt(ax(L[2]),10),R},M["INSERT INTO"]=function(D){var L=/([A-Za-z0-9_\.]+)\s*(\(([A-Za-z0-9_\., ]+)\))?/gi;L=L.exec(D);var R={};return R.table=ax(L[1]),typeof L[3]<"u"&&(R.columns=L[3].split(","),R.columns=R.columns.map(function(O){return ax(O)})),R},M.VALUES=function(D){D=ax(D),D[0]!="("&&(D="("+D);var L=TX(",",D),R=[];return L.forEach(function(O){O=O.replace(/^\(/g,"").replace(/\)$/g,""),O=TX(",",O),R.push(O)}),R};var I={},P=0;return A.forEach(function(D,L){if(D=D.toUpperCase(),P++,typeof M[D]<"u"){var R=M[D](S[P]);if(typeof I[D]<"u"){if(typeof I[D]=="string"||typeof I[D][0]>"u"){var O=I[D];I[D]=[],I[D].push(O)}I[D].push(R)}else I[D]=R}else console.log(`Can't analyze statement "`+D+'"')}),typeof I["LEFT JOIN"]<"u"&&(typeof I.JOIN>"u"&&(I.JOIN=[]),typeof I["LEFT JOIN"][0]<"u"?I["LEFT JOIN"].forEach(function(D){D.type="left",I.JOIN.push(D)}):(I["LEFT JOIN"].type="left",I.JOIN.push(I["LEFT JOIN"])),delete I["LEFT JOIN"]),typeof I["INNER JOIN"]<"u"&&(typeof I.JOIN>"u"&&(I.JOIN=[]),typeof I["INNER JOIN"][0]<"u"?I["INNER JOIN"].forEach(function(D){D.type="inner",I.JOIN.push(D)}):(I["INNER JOIN"].type="inner",I.JOIN.push(I["INNER JOIN"])),delete I["INNER JOIN"]),typeof I["RIGHT JOIN"]<"u"&&(typeof I.JOIN>"u"&&(I.JOIN=[]),typeof I["RIGHT JOIN"][0]<"u"?I["RIGHT JOIN"].forEach(function(D){D.type="right",I.JOIN.push(D)}):(I["RIGHT JOIN"].type="right",I.JOIN.push(I["RIGHT JOIN"])),delete I["RIGHT JOIN"]),f&&(typeof I.WHERE=="string"&&(I.WHERE=v4.parse(I.WHERE)),typeof I.JOIN<"u"&&I.JOIN.forEach(function(D,L){I.JOIN[L].cond=v4.parse(D.cond)})),I};Q6.prototype={constructor:Q6,readNextChar:function(){typeof this.source!="string"?this.currentChar="":this.currentChar=this.source[this.cursor++]||""},readNextToken:function(){return/\w|[-]/.test(this.currentChar)?this.readWord():/["'`]/.test(this.currentChar)?this.readString():/[()]/.test(this.currentChar)?this.readGroupSymbol():/[!=<>]/.test(this.currentChar)?this.readOperator():this.currentChar===""?{type:"eot",value:""}:(this.readNextChar(),{type:"empty",value:""})},readWord:function(){for(var o="",f=0,m=!1;/./.test(this.currentChar);){if(!m&&/['"`]/.test(this.currentChar))m=this.currentChar;else if(m&&this.currentChar==m)m=!1;else if(!m&&(this.currentChar==")"&&f<=0||(this.currentChar=="("?f++:this.currentChar==")"&&f--,/[!=<>]/.test(this.currentChar)))||this.currentChar==" "&&f<=0)break;o+=this.currentChar,this.readNextChar()}return/^(AND|OR)$/i.test(o)?{type:"logic",value:o}:/^(IN|IS|NOT|LIKE)$/i.test(o)?{type:"operator",value:o}:{type:"word",value:o}},readString:function(){var o="",f=this.currentChar;for(o+=this.currentChar,this.readNextChar();this.currentChar!=f&&this.currentChar!=="";)o+=this.currentChar,this.readNextChar();return o+=this.currentChar,this.readNextChar(),this.currentChar=="."?(o+=this.currentChar,this.readNextChar(),o+=this.readString().value,{type:"word",value:o}):{type:"string",value:o}},readGroupSymbol:function(){var o=this.currentChar;return this.readNextChar(),{type:"group",value:o}},readOperator:function(){var o=this.currentChar;return this.readNextChar(),/[=<>]/.test(this.currentChar)&&(o+=this.currentChar,this.readNextChar()),{type:"operator",value:o}}};Q6.tokenize=function(o){var f=new Q6(o),m=[];do{var v=f.readNextToken();v.type!="empty"&&m.push(v)}while(f.currentChar);return m};v4.prototype={constructor:v4,readNextToken:function(){for(this.currentToken=this.lexer.readNextToken();this.currentToken.type=="empty";)this.currentToken=this.lexer.readNextToken();return this.currentToken},parseExpressionsRecursively:function(){return this.parseLogicalExpression()},parseLogicalExpression:function(){for(var o=this.parseConditionExpression();this.currentToken.type=="logic";){var f=this.currentToken.value;this.readNextToken();var m=this.parseConditionExpression();if(typeof o.logic<"u"&&o.logic==f&&typeof o.terms<"u")o.terms.push(m);else{var v=[o,m];o={logic:f,terms:v.slice(0)}}}return o},parseConditionExpression:function(){var o=this.parseBaseExpression();if(this.currentToken.type=="operator"){var f=this.currentToken.value;this.readNextToken(),this.currentToken.type=="operator"&&(f+=" "+this.currentToken.value,this.readNextToken());var m=this.parseBaseExpression();o={operator:f,left:o,right:m}}return o},parseBaseExpression:function(){var o="";return this.currentToken.type=="word"||this.currentToken.type=="string"?(o=this.currentToken.value,this.readNextToken()):this.currentToken.type=="group"&&(this.readNextToken(),o=this.parseExpressionsRecursively(),this.readNextToken()),o}};v4.parse=function(o){return new v4(o).parseExpressionsRecursively()};AD.ast2sql=function(o){function f(P){return typeof P.SELECT<"u"?"SELECT "+P.SELECT.map(function(D){return D.name}).join(", "):""}function m(P){if(typeof P.FROM<"u"){var D=" FROM ",L=P.FROM.map(function(R){var O=R.table;return R.as!==""&&(O+=" AS "+R.as),O});return D+=L.join(", "),D}return""}function v(P){if(typeof P.JOIN<"u"){var D="";return P.JOIN.forEach(function(L){D+=" "+L.type.toUpperCase()+" JOIN "+L.table,L.as!==""&&(D+=" AS "+L.as),D+=" ON "+oMe(L.cond)}),D}return""}function y(P){return typeof P.WHERE<"u"?" WHERE "+oMe(P.WHERE):""}function x(P){if(typeof P["ORDER BY"]<"u"){var D=" ORDER BY ",L=P["ORDER BY"].map(function(R){return R.column+" "+R.order});return D+=L.join(", "),D}return""}function C(P){if(typeof P["GROUP BY"]<"u"){var D=" GROUP BY ",L=P["GROUP BY"].map(function(R){return R.column});return D+=L.join(", "),D}return""}function w(P){if(typeof P.LIMIT<"u"&&typeof P.LIMIT.nb<"u"&&parseInt(P.LIMIT.nb,10)>0){var D=" LIMIT ";return typeof P.LIMIT.from<"u"&&parseInt(P.LIMIT.from,10)>1&&(D+=P.LIMIT.from+","),D+=P.LIMIT.nb,D}return""}function A(P){if(typeof P["INSERT INTO"]<"u"){var D="INSERT INTO "+P["INSERT INTO"].table;return typeof P["INSERT INTO"].columns<"u"&&(D+=" (",D+=P["INSERT INTO"].columns.join(", "),D+=")"),D}return""}function E(P){if(typeof P.VALUES<"u"){var D=" VALUES ",L=P.VALUES.map(function(R){return"("+R.join(", ")+")"});return D+=L.join(", "),D}return""}function T(P){if(typeof P["DELETE FROM"]<"u"){var D="DELETE FROM ";return D+=P["DELETE FROM"].map(function(L){var R=L.table;return L.as!==""&&(R+=" AS "+L.as),R}).join(", "),D}return""}function S(P){if(typeof P.UPDATE<"u"){var D="UPDATE ";return D+=P.UPDATE.map(function(L){var R=L.table;return L.as!==""&&(R+=" AS "+L.as),R}).join(", "),D}return""}function M(P){return typeof P.SET<"u"?" SET "+P.SET.map(function(D){return D.expression}).join(", "):""}var I="";return typeof o.SELECT<"u"&&typeof o.FROM<"u"?I=f(o)+m(o)+v(o)+y(o)+C(o)+x(o)+w(o):typeof o["INSERT INTO"]<"u"?I=A(o)+E(o):typeof o.UPDATE<"u"?I=S(o)+M(o)+y(o):typeof o["DELETE FROM"]<"u"?I=T(o)+y(o):I=null,I};AD.trim=ax;AD.protect=rMe;AD.unprotect=nMe;AD.protect_split=TX;AD.CondLexer=Q6;AD.CondParser=v4;var Hst=AD;function SX(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f)}SX.prototype.getPosition=function(){return this._viewer.camera.position};SX.prototype.getDegrees=function(){var o=this._viewer.camera.positionCartographic,f={lon:this._cesium.Math.toDegrees(o.longitude),lat:this._cesium.Math.toDegrees(o.latitude),height:o.height};return f};SX.prototype.getMousePosition=function(o,f){let m=o.endPosition||o.position||o;this.defaultDepthTest===void 0&&(this.defaultDepthTest=!!this._viewer.scene.globe.depthTestAgainstTerrain);let v=this._viewer.camera.getPickRay(m);f&&!Array.isArray(f)&&(f=[f]);let y=this._viewer.scene.pickPosition(m);y?y={position:y}:(this._viewer.scene.globe.depthTestAgainstTerrain=!0,y=this._viewer.scene.pickFromRay(v,f));let x;if(!y||!y.position||!this._viewer.scene.globe.depthTestAgainstTerrain?x=this._viewer.scene.globe.pick(v,this._viewer.scene):x=y.position,this._viewer.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,!x){console.log("\u672A\u62FE\u53D6\u5230\u5750\u6807\uFF01");return}return x};SX.prototype.getMouseDegrees=function(o,f){let m=this.getMousePosition(o,f);if(!!m)return this._core.toDegrees(m)};var Ru=SX;var dA=null;function pb(o,f){dA=f,this._viewer=o,this._cesium=f,this._scene=o.scene,this._core=new Sr(o,f),this._getPosition=new Ru(o,f),this.num=100,this.buffs=[],this.tooltip=this._core.CreateTooltip()}pb.prototype.changeBurr=function(o){if(this.num=o,this.this_buff)switch(this.type){case"point":this.setPointBuff(this.num);break;case"polyline":this.setPolylineBuff(this.num);break;case"polygon":this.setPolygonBuff(this.num);break}};pb.prototype.DrawPoint=function(o,f){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var m=this._viewer,v=this._cesium,y=this;let x,C;return typeof o=="number"?(x=o,C={}):typeof o=="object"&&(C=o,x=C.radius),this.num=x||this.num,this.drawHandler=new v.ScreenSpaceEventHandler(m.scene.canvas),this.this_buff={entity:null,buff:null},this.type="point",this.positions=[],this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this.drawHandler.setInputAction(function(w){var A=this._getPosition.getMouseDegrees(w);if(!!A){var E=A.lon,T=A.lat;this.positions.push(E,T),this.this_buff.entity=m.entities.add({name:"\u65B0\u5EFA\u7F13\u51B2\u70B9",position:v.Cartesian3.fromDegrees(E,T),point:{pixelSize:10,color:v.Color.YELLOW,outlineWidth:3,outlineColor:v.Color.YELLOW.withAlpha(.4),heightReference:1}}),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.setPointBuff(this.num,C),f&&typeof f=="function"&&f(A),this.end&&this.end()}}.bind(this),v.ScreenSpaceEventType.LEFT_CLICK),this.end=()=>{this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0},this.drawHandler.setInputAction(function(w){this.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u7ED8\u5236\u70B9")}.bind(this),v.ScreenSpaceEventType.MOUSE_MOVE),this};pb.prototype.setPointBuff=function(o,f){let m=dA.turf.point(this.positions),v=this.getBuff(m,o);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(v,f),this.buffs.push(this.this_buff.buff))};pb.prototype.DrawPolyline=function(o,f){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var m=this._viewer,v=this._cesium;let y,x;typeof o=="number"?(y=o,x={}):typeof o=="object"&&(x=o,y=x.radius),this.num=y||this.num;var C=0;return this.drawHandler=new v.ScreenSpaceEventHandler(m.scene.canvas),this.this_buff={entity:null,buff:null},this.type="polyline",this.positions=[],this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this.drawHandler.setInputAction(function(w){var A=this._getPosition.getMouseDegrees(w);if(!!A){var E=A.lon,T=A.lat;this.positions.push(E,T),C===0&&(this.positions.push(E,T),this.this_buff.entity=m.entities.add({name:"\u65B0\u5EFA\u7F13\u51B2\u7EBF",polyline:{positions:v.Cartesian3.fromDegreesArray(this.positions),width:2,material:new v.ColorMaterialProperty(v.Color.YELLOW),clampToGround:!0,zIndex:1}}),this.this_buff.entity.polyline.positions=new v.CallbackProperty(function(){return v.Cartesian3.fromDegreesArray(this.positions)}.bind(this),!1)),C++}}.bind(this),v.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(w){this.end&&this.end()}.bind(this),v.ScreenSpaceEventType.RIGHT_CLICK),this.end=w=>{if(this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0,w==="cancel"){m.entities.remove(this.this_buff.entity),this.this_buff=void 0;return}var A=this;if(this.positions.length<=4){window.layuiLayer&&window.layuiLayer.msg("\u5F53\u524D\u70B9\u6570\u5C0F\u4E8E\u4E24\u70B9\uFF0C\u8BF7\u91CD\u65B0\u7ED8\u5236"),m.entities.remove(this.this_buff.entity),this.this_buff=void 0,f&&typeof f=="function"&&f(A);return}this.positions.pop(),this.positions.pop(),this.this_buff.entity.polyline.positions=v.Cartesian3.fromDegreesArray(this.positions),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.positions=this.degreesArrayToPoints(this.positions),this.setPolylineBuff(this.num,x),f&&typeof f=="function"&&f(A)},this.drawHandler.setInputAction(function(w){if(C===0){this.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u6298\u7EBF");return}else C===1?this.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u7ED8\u5236\u6298\u7EBF"):this.tooltip.showAt(w.endPosition,"\u53F3\u51FB\u7ED3\u675F\u7ED8\u5236");var A=this._getPosition.getMouseDegrees(w);if(!!A){var E=A.lon,T=A.lat;this.positions.splice(this.positions.length-2,2),this.positions.push(E,T)}}.bind(this),v.ScreenSpaceEventType.MOUSE_MOVE),this};pb.prototype.setPolylineBuff=function(o,f){let m=dA.turf.lineString(this.positions),v=this.getBuff(m,o);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(v,f),this.buffs.push(this.this_buff.buff))};pb.prototype.DrawPolygon=function(o,f){this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.this_buff&&this.this_buff.entity&&this._viewer.entities.remove(this.this_buff.entity);var m=this._viewer,v=this._cesium;let y,x;typeof o=="number"?(y=o,x={}):typeof o=="object"&&(x=o,y=x.radius),this.num=y||this.num;var C=0;this.drawHandler=new v.ScreenSpaceEventHandler(m.scene.canvas),this.this_buff={entity:null,buff:null},this.type="polygon",this.positions=[];let w=this;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this.drawHandler.setInputAction(function(A){var E=this._getPosition.getMouseDegrees(A);if(!!E){var T=E.lon,S=E.lat;this.positions.push(T,S),C===0?(this.positions.push(T,S),this.this_buff.entity=m.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new v.CallbackProperty(function(){return v.Cartesian3.fromDegreesArray(w.positions)},!1),clampToGround:!0,material:new v.ColorMaterialProperty(v.Color.YELLOW.withAlpha(.5)),width:3}})):C===1&&(this.this_buff.entity&&m.entities.remove(this.this_buff.entity),this.this_buff.entity=m.entities.add({name:"\u65B0\u5EFA\u7F13\u51B2\u9762",polygon:{hierarchy:new v.PolygonHierarchy(v.Cartesian3.fromDegreesArray(this.positions)),material:new v.ColorMaterialProperty(v.Color.YELLOW.withAlpha(.5)),zIndex:1}}),this.this_buff.entity.polygon.hierarchy=new v.CallbackProperty(function(){return new v.PolygonHierarchy(v.Cartesian3.fromDegreesArray(this.positions))}.bind(this),!1)),C++}}.bind(this),v.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(A){this.end&&this.end()}.bind(this),v.ScreenSpaceEventType.RIGHT_CLICK),this.end=A=>{if(this.tooltip.show(!1),this.drawHandler.destroy(),this._core.mouse(this._viewer.container,0),this.drawHandler=null,this.end=void 0,A==="cancel"){m.entities.remove(this.this_buff.entity),this.this_buff=void 0;return}if(this.positions.length<=6){window.layuiLayer&&window.layuiLayer.msg("\u5F53\u524D\u70B9\u6570\u5C0F\u4E8E\u4E09\u70B9\uFF0C\u8BF7\u91CD\u65B0\u7ED8\u5236"),m.entities.remove(this.this_buff.entity),this.this_buff=void 0,f&&typeof f=="function"&&f(this);return}this.positions.pop(),this.positions.pop(),this.this_buff.entity.polygon.hierarchy=v.Cartesian3.fromDegreesArray(this.positions),this.buffs.push(this.this_buff.entity),this.this_buff.entity=void 0,this.positions=this.degreesArrayToPoints(this.positions),this.positions.push(this.positions[0]),this.setPolygonBuff(this.num,x),f&&typeof f=="function"&&f(this)},this.drawHandler.setInputAction(function(A){if(C===0){this.tooltip.showAt(A.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u591A\u8FB9\u5F62");return}else C<3?this.tooltip.showAt(A.endPosition,"\u70B9\u51FB\u7ED8\u5236\u591A\u8FB9\u5F62"):this.tooltip.showAt(A.endPosition,"\u53F3\u51FB\u7ED3\u675F\u7ED8\u5236");var E=this._getPosition.getMouseDegrees(A);if(!!E){var T=E.lon,S=E.lat;this.positions.splice(this.positions.length-2,2),this.positions.push(T,S)}}.bind(this),v.ScreenSpaceEventType.MOUSE_MOVE),this};pb.prototype.setPolygonBuff=function(o,f){let m=dA.turf.polygon([this.positions]),v=this.getBuff(m,o);this.this_buff.buff||(this.this_buff.buff=this.addBufferPolyogn(v,f),this.buffs.push(this.this_buff.buff))};pb.prototype.getBuff=function(o,f,m={}){let y=dA.turf.buffer(o,f,{units:"meters",...m}).geometry.coordinates,x=this.pointsToDegreesArray(y[0]),C={positions:dA.Cartesian3.fromDegreesArray(x)};if(y.length>1){C.holes=[];for(let w=1,A;w<y.length;w++)x=this.pointsToDegreesArray(y[w]),A=dA.Cartesian3.fromDegreesArray(x),C.holes.push(A)}return C};pb.prototype.pointsToDegreesArray=function(o){let f=[];return o.map(m=>{f.push(m[0]),f.push(m[1])}),f};pb.prototype.degreesArrayToPoints=function(o){let f=[];for(let m=0;m<o.length-1;m+=2)f.push([o[m],o[m+1]]);return f};pb.prototype.addBufferPolyogn=function(o,f={}){let m,v;return m=o.positions,o.holes&&(v=[],o.holes.forEach(y=>{v.push(new dA.PolygonHierarchy(y))})),this._viewer.entities.add({polygon:{hierarchy:new dA.CallbackProperty(function(){return new dA.PolygonHierarchy(m,v)},!1),material:dA.Color.RED.withAlpha(.6),outline:!0,outlineColor:dA.Color.YELLOW,outlineWidth:10,zIndex:0,...f}})};pb.prototype.clearBuff=function(){var o=this._viewer;this.buffs.length>0&&(this.buffs.forEach(function(f){o.entities.remove(f)}),this.buffs.length=0)};var yP=pb;var to=null,lMe=null;function Ust(o){return o*3/4}function TRi(o){var f=o*72/96;return-1*f}function SRi(o){for(var f=[],m=o.length,v=0;v<m;v++)for(var y=o[v],x=y.positions.length,C=0;C<x;C++)for(var w=y.positions[C],A=0;A<w.length;A+=3)f.push(to.Cartographic.fromDegrees(w[A+0],w[A+1],0));return f}function uMe(o){var f=0,m,v;if(o.length===0)return f;for(m=0;m<o.length;m++)v=o.charCodeAt(m),f=(f<<5)-f+v,f|=0;return f}function PRi(o,f,m,v){for(var y,x=0,C=0;C<o.length;C++){var w=o[C];y=v?Wst:m(w),w.absoluteHeightPositions==null&&(w.absoluteHeightPositions=[]);for(var A=0;A<w.positions.length;A++)for(var E=w.positions[A],T=w.absoluteHeightPositions[A]=[],S=2;S<E.length;S+=3){var M=v?0:E[S];f[x].height==null&&(f[x].height=0),T[S-2]=E[S-2],T[S-1]=E[S-1],T[S-0]=E[S-0],T[S]=M+f[x].height+y,x++}}}function IRi(o){for(var f=[],m=0;m<o.length;m++)for(var v=0;v<o[m].positions.length;v+=3)f.push(to.Cartographic.fromDegrees(o[m].positions[v+0],o[m].positions[v+1],0));return f}function MRi(o,f,m,v){for(var y,x=0,C=0;C<o.length;C++){y=v?Wst:m(o[C]);for(var w=2;w<o[C].positions.length;w+=3){f[x].height==null&&(f[x].height=0),o[C].absoluteHeightPositions==null&&(o[C].absoluteHeightPositions=[]),o[C].absoluteHeightPositions[w-2]=o[C].positions[w-2],o[C].absoluteHeightPositions[w-1]=o[C].positions[w-1],o[C].absoluteHeightPositions[w-0]=o[C].positions[w-0];var A=v?0:o[C].positions[w];o[C].absoluteHeightPositions[w]=A+f[x].height+y,x++}}}function Nf(o,f,m){to=m,this._style=o||{},this._core=new Sr(f,m),this._bufferAnalysis=new yP(f,to),f.scene.onHoverShowTextArray={},f.scene._lastObjectShowOnText=null,this.setEyeOffset=function(v,y){y===void 0&&(y=0),v.eyeOffset=Yst(y)},this.viewer=f,lMe=f}function cMe(o,f){for(var m=o.length,v=0;v<m;v++){var y=f(o[v]);if(o[v].geometryType=="polygon"||o[v].geometryType=="multipolygon"){for(var x=o[v],C=x.positions.length,w=0;w<C;w++){for(var A=x.positions[w],E=2;E<A.length;E+=3)A[E]=y;x.positions[w]=A}o[v]=x}else{for(var T=o[v],S=T.positions.length,w=2;w<S;w+=3)T.positions[w]=y;o[v]=T}}return o}function hMe(o,f){if(o.isQuery==null){if(o.originalInstanceIds==null){if(o.parentLayer.isExistRenderedFeatureId(f))return!1}else if(o.originalInstanceIds.indexOf(f)==-1)return!1}return!0}function PX(o){return function(f){var m=Number(o.applyConditionalClassification(o._style.altitudeOffset||o._style.height,f.attributes));return isNaN(m)&&(m=0),m}}function aMe(o){if(typeof o!="string")return o;var f=Number(o);if(!isNaN(f)){var m=f.toString(16);if(m.length<6&&m!=null)for(var v=m.length;v<6;)m="0"+m,v++;var y="#"+m,x=to.Color.fromCssColorString(y);if(x!=null){var C=x.red;x.red=x.blue,x.blue=C}return x}return o}function Qae(o){if(o!=null){var f=parseInt(o);if(o.alpha==null&&!isNaN(f)){f<0&&(f&=16777215);var m=f.toString(16);if(m.length<6&&m!=null)for(var v=m.length;v<6;)m="0"+m,v++;var y="#"+m;y=y.substring(0,7);var x=to.Color.fromCssColorString(y);if(x!=null){var C=x.red;x.red=x.blue,x.blue=C}return x}return o}}function Zae(o){return isNaN(o)?o:parseFloat(o)}function Gst(o,f){var m=[];$.each(o.attributeNames,function(y,x){m.push(Zae(f[x]))});var v;return m.length===1?v=o.func(m[0]):o.attributeNames.length===2?v=o.func(m[0],m[1]):o.attributeNames.length===3?v=o.func(m[0],m[1],m[2]):o.attributeNames.length===4&&(v=o.func(m[0],m[1],m[2],m[3])),v}function DRi(o,f){if(!(o===void 0||o.condition.length===0)){if(o.func===void 0)return Zae(o.value);var m=void 0,v=Gst(o,f);return v===!0&&(m=Zae(o.value)),m}}function LRi(o){return o.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")}function sMe(o,f,m){return o.replace(new RegExp(LRi(f),"g"),m)}var RRi=!1,ORi=IRi,NRi=MRi,Wst=1;Object.defineProperties(Nf.prototype,{style:{get:function(){return this._style},set:function(o){this._style=o}}});Nf.prototype.clonePartOfMultiFeature=function(o,f){let m=o.geometryType.includes("multi")?o.fid+"."+f:o.fid;return{positions:o.positions[f],attributes:o.attributes,fid:m,geometryType:o.geometryType}};Nf.prototype.createPrimitiveFromWFSFeatures=function(o){var f=new to.PrimitiveCollection,m=[],v=[],y=[];o.features.numPositions=0;for(var x=0;x<o.features.length;x++){var C=o.features[x];switch(this.sanitizePositions(C.positions),o.features.numPositions+=C.positions.length,C.geometryType){case"polygon":m.push(C);break;case"multipolygon":for(var A=C.positions.length,w=0;w<A;w++)m.push(this.clonePartOfMultiFeature(C,w));break;case"linestring":v.push(C);break;case"multilinestring":for(var A=C.positions.length,w=0;w<A;w++)v.push(this.clonePartOfMultiFeature(C,w));break;case"point":y.push(C);break;case"multipoint":for(var A=C.positions.length,w=0;w<A;w++)y.push(this.clonePartOfMultiFeature(C,w))}}m.length>0?(o.features=m,this.createPolygonPrimitive(o)):v.length>0?(o.features=v,this.createLinestringPrimitive(o)):y.length>0&&(o.features=y,this.createPointPrimitive(o))};Nf.prototype.createPolygonPrimitive=function(o){var f=this,m=!1,v=function(w){if(w.isQuery){w.onFinishedQuery(E);return}var A="",E=[],T=[],S=[],M=[],I=[];let P=f.style.polygon,D=P.clampToGround||!P.perPositionHeight&&!P.extrudedHeight&&!P.height,L;P.text&&(L=new to.LabelCollection);for(var R=0;R<w.features.length;R++){var O=w.features[R];if(!hMe(w,O.fid))continue;var F=O.absoluteHeightPositions?O.absoluteHeightPositions:O.positions,k=f.createPolygonOptions(F,O.attributes),U=f.createCommonOptions(O.attributes),G=to.BoundingSphere.fromPoints(k.hierarchy.positions);if(O.absoluteHeightPositions&&delete O.absoluteHeightPositions,E.push(G),w.isQuery)continue;let Y;if(k.randomColor&&(Y=to.Color.fromRandom()),k.outline&&!D){var j=f.createPolygonGeometryHelper("outline",O,k.outlineColor,k);S.push(j)}else k.outline&&S.push(new to.GeometryInstance({geometry:new to.GroundPolylineGeometry({positions:k.hierarchy.positions,width:k.outlineWidth})}));if(k.text){let Q=f._core.getCenterOfMass(k.hierarchy.positions),ee=f.createPointOptions(Q,O.attributes);if(!D&&f.style.pointHeight==null&&(k.extrudedHeight||k.height)&&(ee.position=to.Cartesian3.fromDegrees(Q[0],Q[1],k.extrudedHeight?(k.height||0)+k.extrudedHeight:k.height)),(k.labelNear||k.labelFar)&&(ee.label.distanceDisplayCondition=new to.DistanceDisplayCondition(k.labelNear||0,k.labelFar||1/0)),k.offsetPoint&&k.offsetPoint[ee.label.text]){let ie=f._core.toDegrees(ee.position);f._core.getCenterOfMass(k.hierarchy.positions);let re=k.offsetPoint[ee.label.text];re[0]&&(ie.lon=re[0]),re[1]&&(ie.lat=re[1]),re[2]!==void 0&&(ie.height=re[2]),ee.position=to.Cartesian3.fromDegrees(ie.lon,ie.lat,ie.height)}let z=L.add({id:O,position:ee.position,...ee.label});delete z.id.positions,z.id.boundingSphere=G}if(k.colorConfig){let Q;for(let ee in k.colorConfig){for(let z in k.colorConfig[ee])if(O.attributes[ee]==z){Q=k.colorConfig[ee][z];break}if(Q)break;k.colorConfig[ee]["#"]&&(Q=k.colorConfig[ee]["#"])}Q&&(k.material=to.Color.fromCssColorString(Q))}if(k.fill&&k.material.alpha>0){var j=f.createPolygonGeometryHelper("fill",O,Y||k.material,k);T.push(j)}w.parentLayer.addRenderedFeatureId(O.fid),A+=O.fid+";",M.push(O.fid),I.push(U.tooltip)}if(A!=""){var q=new to.PrimitiveCollection,J=new to.PerInstanceColorAppearance({flat:k.material.alpha==0,translucent:k.material.alpha<1});if(L&&q.add(L),T.length>0){if(k.water){let Y={color:k.water.color||"rgba(135,206,235,0.6)",image:k.water.image||window.SmartEarthRootUrl+pn.water,frequency:k.water.frequency||1e3,speed:k.water.speed||10,amplitude:k.water.amplitude||10},Q=to.Color.fromCssColorString(Y.color);J=new to.EllipsoidSurfaceAppearance({material:new to.Material({fabric:{type:"Water",uniforms:{baseWaterColor:Q,blendColor:Q,normalMap:Y.image,frequency:Y.frequency,animationSpeed:Y.speed/1e3,amplitude:Y.amplitude}}})})}var X;D?X=new to.GroundPrimitive({geometryInstances:T,appearance:J,classificationType:k.classificationType}):X=new to.Primitive({geometryInstances:T,appearance:J}),X._parentCollection=q,q.add(X)}if(S.length>0)if(k.clampToGround)q.add(new to.GroundPolylinePrimitive({geometryInstances:S,appearance:new to.PolylineMaterialAppearance({material:new to.Material({fabric:{type:"Color",uniforms:{color:k.outlineColor}}})})}));else{var X=new to.Primitive({geometryInstances:S,appearance:J});X._parentCollection=q,q.add(X)}q.ID="polygons:"+uMe(A),q._instanceIds=M,q._tooltips=I,w.onFinishedCreatePrimitive(q,E)}},y=this.style.altitudeMethod==3;if(y)o.features=cMe(o.features,PX(f)),v(o);else{m=!0;var x=SRi(o.features),C=dMe(x,IX.TERRAIN|IX.FLOOR,lMe);Promise.resolve(C).then(function(w){RRi&&console.log("adding polygon with "+w.length+" vertices");var A=f._style.altitudeMethod==2;PRi(o.features,w,PX(f),A),v(o)})}};Nf.prototype.createPolygonGeometryHelper=function(o,f,m,v){var y=v.hierarchy,x=v.perPositionHeight,C=v.extrudedHeight,w=v.height,A=v.water,E=C!=null||w!==void 0?to.PerInstanceColorAppearance.VERTEX_FORMAT:to.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT;A&&(E=to.EllipsoidSurfaceAppearance.VERTEX_FORMAT),C!==void 0&&w!==void 0&&(C+=w);var T;let S;return v.bulidingWall?(S=o==="fill"?to.CorridorGeometry:to.CorridorOutlineGeometry,T=new S({positions:y.positions,width:v.bulidingWallWidth||.8,vertexFormat:E,extrudedHeight:C,height:w,cornerType:to.CornerType.MITERED})):(S=o==="fill"?to.PolygonGeometry:to.PolygonOutlineGeometry,T=new S({polygonHierarchy:y,vertexFormat:E,perPositionHeight:w!==void 0?void 0:x,extrudedHeight:C,height:w})),new to.GeometryInstance({geometry:T,id:f,attributes:{color:to.ColorGeometryInstanceAttribute.fromColor(m)}})};Nf.prototype.createLinestringPrimitive=function(o){var f=this,m=!1,v=function(y){if(y.isQuery){y.onFinishedQuery(C);return}var x="",C=[],w,A=[],E=[],T=[];let S=new to.PrimitiveCollection;for(var M=0;M<y.features.length;M++){var I=y.features[M];if(!hMe(y,I.fid))continue;var P=I.absoluteHeightPositions?I.absoluteHeightPositions:I.positions,D=f.createLinestringOptions(P,I.attributes),L=f.createCommonOptions(I.attributes),R=0;if(R&&w==null&&(w=!!(D.widthInMeters&&f.style.altitudeMethod==2)),D.vertexFormat=w?to.PerInstanceColorAppearance.VERTEX_FORMAT:to.PolylineColorAppearance.VERTEX_FORMAT,I.absoluteHeightPositions&&delete I.absoluteHeightPositions,C.push(to.BoundingSphere.fromPoints(D.positions)),y.isQuery)continue;var O,F;D.clampToGround?(O=new to.GroundPolylineGeometry({positions:D.positions,width:D.width}),F=new to.GeometryInstance({id:I,geometry:O,attributes:{color:new to.ColorGeometryInstanceAttribute.fromColor(D.material)}})):(O=new to.PolylineGeometry(D),F=new to.GeometryInstance({id:I,geometry:O,attributes:{color:new to.ColorGeometryInstanceAttribute.fromColor(D.material)}})),y.parentLayer.addRenderedFeatureId(I.fid),x+=I.fid+";",A.push(I.fid),E.push(L.tooltip);let U=null,G;D.dash?G=new to.PolylineMaterialAppearance({material:to.Material.fromType(to.Material.PolylineDashType,{color:D.material,gapColor:D.gapColor||to.Color.TRANSPARENT,dashLength:D.dashLength||20})}):G=new to.PolylineMaterialAppearance({material:new to.Material({fabric:{type:"PolylineOutline",uniforms:{color:D.material,outlineColor:D.outlineColor||D.material,outlineWidth:D.outlineWidth||0}}})}),D.clampToGround?U=new to.GroundPolylinePrimitive({geometryInstances:F,appearance:G,classificationType:D.classificationType}):U=new to.Primitive({geometryInstances:F,appearance:G}),S.add(U)}if(x!=""){var k=S;k.ID="polylines:"+uMe(x),k._instanceIds&&k._instanceIds.length===0&&(k._instanceIds=A),k._tooltips=E,y.onFinishedCreatePrimitive(k,C)}};f&&f.style&&f.style.height!==void 0&&(o.features=cMe(o.features,PX(f))),v(o)};Nf.prototype.createPointPrimitive=function(o){var f=this,m=function(C){if(C.isQuery){C.onFinishedQuery(E);return}for(var w="",A=[],E=[],T=[],S,M=new to.LabelCollection({scene:f.viewer.scene}),I=new to.PointPrimitiveCollection({scene:f.viewer.scene}),P=new to.BillboardCollection({scene:f.viewer.scene}),D=new to.PrimitiveCollection,L=new to.PolylineCollection,R=0;R<C.features.length;R++){var O=C.features[R];if(!!hMe(C,O.fid)){var F=O.absoluteHeightPositions?O.absoluteHeightPositions:O.positions,k=f.createPointOptions(F,O.attributes),U=f.createCommonOptions(O.attributes);if(O.clampToGround=k.clampToGround,k.sgsPointPosition&&(O.sgsPointPosition=k.sgsPointPosition,delete k.sgsPointPosition),O.absoluteHeightPositions&&delete O.absoluteHeightPositions,E.push(to.BoundingSphere.fromPoints([k.position])),!C.isQuery){if(k.label)if(k.label.position=k.position,k.label.id=O,f.setEyeOffset(k.label),k.label.imageFile!=null&&(k.label.image=f.applyConditionalClassification(k.label.imageFile,O.attributes),k.label.label=k.label,P.add(k.label),f.setEyeOffset(k.label,-5)),k.label.imageFile!=null&&k.label.showText!=null&&k.label.showText&&(f.viewer.scene.onHoverShowTextArray[k.label.id]=!0),k.label.isBold!=null&&k.label.isBold)M.add(g);else if(k.label.isUnderline!=null&&k.label.isUnderline){var G="_",j=k.label.text.match(/[iljf1]/g)!=null?k.label.text.match(/[iljf1]/g):[],q=k.label.text.length,J=Array(Math.ceil(q-j.length*.5)).join(G);S=$.extend({},k.label),k.label.image!=null&&delete k.label.image,S.position=k.label.position,S.id=k.label.id,S.text=J,S.alignment=k.label.alignment!=null?k.label.alignment:void 0,S.underline=!0,S.textRelativeToImage=k.label.textRelativeToImage!=null?k.label.textRelativeToImage:void 0;var X=k.label.font.indexOf("pt")>-1?Number(k.label.font.split("pt")[0])*4/3:k.label.font.indexOf("px")>-1?Number(k.label.font.split("px")[0]):5;S.pixelOffset=new to.Cartesian2(0,-45),M.add(S)}else M.add(k.label);if(k.billboard&&(k.billboard.position=k.position,k.billboard.id=O,f.setEyeOffset(k.billboard),P.add(k.billboard)),k.model){k.model.url=k.model.uri,k.model.id=O;var Y=D.add(to.Model.fromGltf(k.model))}if(k.point&&(k.point.position=k.position,k.point.id=O,f.setEyeOffset(k.point),I.add(k.point)),k.lineToGround!=0){var Q=to.Cartographic.fromCartesian(k.position),ee=to.Cartesian3.fromRadians(Q.longitude,Q.latitude,0);if(k.lineToGround==2){var z=k.lineToGroundLength/to.Cartesian3.distance(k.position,ee);to.Cartesian3.lerp(k.position,ee,z,ee)}L.add({show:!0,width:1,positions:[k.position,ee],material:to.Material.fromType("Color",{color:k.lineToGroundColor})})}C.parentLayer.addRenderedFeatureId(O.fid),w+=O.fid+";",A.push(O.fid),T.push(U.tooltip)}}}if(w!=""){var ie,re=new to.PrimitiveCollection;M.length>0&&($.each(M._labels,function(ne,oe){oe._type="Label"}),M._billboardCollection._parentCollection=re,re.add(M),ie="labels"),P.length>0&&($.each(P._billboards,function(ne,oe){oe._type="Billboard"}),P._parentCollection=re,re.add(P),ie="billboards"),D.length>0&&($.each(D._primitives,function(ne,oe){oe._type="Model",oe._parentCollection=re}),re.add(D),ie="models"),I.length>0&&($.each(I._pointPrimitives,function(ne,oe){oe._type="Point"}),I._parentCollection=re,re.add(I),ie="points"),L.length>0&&($.each(L._polylines,function(ne,oe){oe._type="L2G"}),L._parentCollection=re,re.add(L),ie="L2G"),re.ID=ie+":"+uMe(w),re._instanceIds=A,re._tooltips=T,C.onFinishedCreatePrimitive(re,E)}},v=this.style.altitudeMethod==3;if(v)o.features=cMe(o.features,PX(f)),m(o);else{var y=ORi(o.features),x=dMe(y,IX.TERRAIN|IX.FLOOR,lMe);Promise.resolve(x).then(function(C){var w=f._style.altitudeMethod==2;NRi(o.features,C,PX(f),w),m(o)}).catch(function(C){})}};Nf.prototype.createCommonOptions=function(o){var f={};return f.tooltip=this.applyConditionalClassification(this.style.tooltip,o),f};Nf.prototype.createPolygonOptions=function(o,f){var m=this.getPolygonStyle(this.style);m.preLoad&&m.preLoad(m.polygon,f),m.polygon.hierarchy={positions:to.Cartesian3.fromDegreesArrayHeights(o[0]),holes:[]};for(var v=1;v<o.length;v++)m.polygon.hierarchy.holes.push({positions:to.Cartesian3.fromDegreesArrayHeights(o[v])});var y=this.applyConditionalClassification(m.polygon.material,f);if(m.polygon.material=aMe(y),m.polygon.fill!=null&&m.polygon.fromKml!=null){var x=this.applyConditionalClassification(m.polygon.fill,f);x>1&&(x/=100),m.polygon.material=new to.Color(m.polygon.material.red,m.polygon.material.green,m.polygon.material.blue,x)}if(m.polygon.height&&(m.polygon.height=Number(this.getValueFromProp(m.polygon.height,f))),m.polygon.extrudedHeight&&m.polygon.extrudedHeight&&m.polygon.extrudedHeight.indexOf&&m.polygon.extrudedHeight.indexOf("[")>-1&&m.polygon.extrudedHeight.defaultValue.indexOf("]")>-1){var y=f[m.polygon.extrudedHeight.defaultValue.substring(1,m.polygon.extrudedHeight.defaultValue.length-1)],y=parseInt(y),C=y*3;y!==void 0&&(m.polygon.extrudedHeight=y*3)}if(m.polygon.extrudedHeight&&(m.polygon.extrudedHeight=Number(m.polygon.extrudedHeight)),f.FSCALE){var w=this.getLevelDistance(f.FSCALE);m.polygon.distanceDisplayCondition=new to.DistanceDisplayCondition(1,w)}return y=this.applyConditionalClassification(m.polygon.outlineColor,f),m.polygon.outlineColor=aMe(y),m.polygon};Nf.prototype.translateLineWidth=function(o,f){var m=this.applyConditionalClassification(o.polyline.width,f);return m>0?TerraExplorer.USE_CORRIDOR_FOR_LINE_WIDTH_IN_METERS?m>1&&(o.polyline.widthInMeters=!0,m*=.8,o.polyline.backgroundOpacity>0&&(m*=.8)):m=m>1?2:1:m<0?m=Math.min(5,Math.abs(m)):m==0&&(m=1),m};Nf.prototype.createLinestringOptions=function(o,f){var m=this.getLinestringStyle(this.style);m.preLoad&&m.preLoad(m.polyline,f),m.id=f,m.polyline.positions=to.Cartesian3.fromDegreesArrayHeights(o);var v=this.applyConditionalClassification(m.polyline.material,f);if(m.polyline.material=aMe(v),m.polyline.far&&(m.polyline.distanceDisplayCondition=new to.DistanceDisplayCondition(m.polyline.near!==void 0?m.polyline.near:0,m.polyline.far)),f.FSCALE){var y=this.getLevelDistance(f.FSCALE);m.polyline.distanceDisplayCondition=new to.DistanceDisplayCondition(1,y)}return m.polyline.width=this.applyConditionalClassification(m.polyline.width,f),m.polyline};Nf.prototype.getValueFromProp=function(o,f){let m=o&&o.defaultValue?o.defaultValue:o;if(m&&m.indexOf){if(m.indexOf("[")>-1&&m.indexOf("]")>-1)m=m.replace("[","").replace("]",""),m=this.getPropValue(f,m);else if(m.indexOf("{")>-1&&m.indexOf("}")>-1){let v=/\{[^\}]+\}/g;m.match(v).forEach(x=>{let C=this.getPropValue(f,x.substring(1,x.length-1));m=m.replace(x,C)}),m=m.replaceAll("\\n",` `)}}return m};Nf.prototype.getPropValue=function(o,f){if(o[f])return o[f];if(f.includes(":"))return o[f.split(":")[1]]};Nf.prototype.applyConditionalClassification=function(o,f){if(o!=null){if(o.defaultValue==null)return o;var m=Zae(o.defaultValue);if(o.classificationArray===void 0&&(!isNaN(m)||m instanceof to.Color))return m;if(o.attributeName!==void 0){var v="["+o.attributeName+"]";if(m===v)m=f[o.attributeName];else if(o.multipleAttributeReplacementNeeded)for(name in f)m=sMe(m,"["+name+"]",f[name]);else m=sMe(m,v,f[o.attributeName]);return m}if(o.classification!==void 0)return m=Gst(o.classification,f),m;var y=o.classificationArray;return y!==void 0&&$(Object.keys(y)).each(function(x,C){var w=DRi(y[C],f);w&&(m=w)}),m}};Nf.prototype.createLineToGroundOptions=function(o,f){var m=this.applyConditionalClassification(o.lineToGround,f);if(m!=null&&Number(m)!=0){o.lineToGround=m;var v=this.applyConditionalClassification(o.lineToGroundColor,f);v=Qae(v),o.lineToGroundColor=v;var y=this.applyConditionalClassification(o.lineToGroundLength,f);typeof y=="string"&&y.indexOf("[")>-1&&y.indexOf("]")>-1&&(y=f[y.substring(1,y.length-1)]||0),o.lineToGroundLength=Number(y)}else o.lineToGround=0,o.lineToGroundColor=0,o.lineToGroundLength=0};Nf.prototype.createPointOptions=function(o,f){var m=this.getPointStyle(this.style);if(m.pointHeight){let R=m.pointHeight;R=this.getValueFromProp(R,f)||0,m.position=to.Cartesian3.fromDegrees(o[0],o[1],R),o[2]=R}else m.position=Array.isArray(o)?to.Cartesian3.fromDegrees(o[0],o[1],o[2]):o;if(m.sgsPointPosition=o,m.id=f,m.label){if(m.label.text=this.getValueFromProp(m.label.text,f),m.label.text=this.o(m.label.text)?this.s(m.label.text):m.label.text,m.label.text.indexOf("[")>-1&&m.label.text.indexOf("]")>-1&&(m.label.text=""),m.label.family!=null){var v=this.applyConditionalClassification(m.label.family,f),y=this.applyConditionalClassification(m.label.font,f);y>=0?m.label.font=Ust(y).toString()+"pt "+v:m.label.font=Ust(TRi(y)).toString()+"pt "+v}if(m.label.fillColor=Qae(this.applyConditionalClassification(m.label.fillColor,f)),m.label.backgroundColor=Qae(this.applyConditionalClassification(m.label.backgroundColor,f)),m.label.backgroundColor==null&&(m.label.backgroundColor=new to.Color(.165,.165,.165,0)),m.label.showBackground=!0,m.label.showText!=null){var x=this.applyConditionalClassification(m.label.showText,f);if(x&&Number(x)===1&&(m.label.onHoverShowText=!0),x&&viewer.scene.canvas.onHoverShowText==null){var C=viewer.scene,w=new to.ScreenSpaceEventHandler(C.canvas);w.setInputAction(function(R){var O={},F=C.screenToWorld(R.endPosition,O);to.defined(O.pickPrimitive)&&O.pickPrimitive.constructor.name=="Billboard"&&O.pickPrimitive.label!=null?C.onHoverShowTextArray[O.pickPrimitive.label.id]!=null&&(C._lastObjectShowOnText!=null&&C._lastObjectShowOnText.id!=O.pickPrimitive.label.id&&C._lastObjectShowOnText.show!=null&&(C._lastObjectShowOnText.show=!1),viewer.scene._lastObjectShowOnText=C.onHoverShowTextArray[O.pickPrimitive.label.id],C._lastObjectShowOnText.show!=null&&(viewer.scene._lastObjectShowOnText.show=!0)):C._lastObjectShowOnText!=null&&C._lastObjectShowOnText.show!=null&&(C._lastObjectShowOnText.show=!1)},to.ScreenSpaceEventType.MOUSE_MOVE),viewer.scene.canvas.onHoverShowText=!0}}if(m.label.textRelativeToImage!=null&&m.label.textAlignment!=null&&(m.label.textRelativeToImage=this.applyConditionalClassification(m.label.textRelativeToImage,f),m.label.alignment=this.applyConditionalClassification(m.label.textAlignment,f)),m.label.underline!=null&&(m.label.isUnderline=this.applyConditionalClassification(m.label.underline,f)),m.label.bold!=null){var A=this.applyConditionalClassification(m.label.bold,f);A==1&&(m.label.font="bold "+m.label.font)}if(m.label.italic!=null){var A=this.applyConditionalClassification(m.label.italic,f);A==1&&(m.label.font="italic "+m.label.font)}if(m.label.backgroundOpacity!=null&&(m.label.backgroundColor.alpha=this.applyConditionalClassification(m.label.backgroundOpacity,f)),m.label.minViewingHeight!=null){var E=this.applyConditionalClassification(m.label.minViewingHeight,f),T=this.applyConditionalClassification(m.label.scaleMPP,f)*650;m.label.distanceDisplayCondition=new to.DistanceDisplayCondition(E,T)}if(f.FSCALE){var x=this.getLevelDistance(f.FSCALE);m.label.distanceDisplayCondition=new to.DistanceDisplayCondition(1,x)}!m.label.disableDepthTestDistance&&(m.label.disableDepthTestDistance=1e3),m.clampToGround&&(m.label.heightReference=1)}if(m.billboard){if(m.billboard.sizeInMeters=!1,m.billboard.imageColor!=null){var S=this.applyConditionalClassification(m.billboard.imageColor,f);S=Qae(S),m.billboard.color=S}if(m.billboard.imageOpacity!=null&&m.billboard.color.alpha!=null&&(m.billboard.color.alpha=Number(this.applyConditionalClassification(m.billboard.imageOpacity,f))),m.billboard.image=this.applyConditionalClassification(m.billboard.image,f),m.billboard.minViewingHeight!=null){var E=this.applyConditionalClassification(m.billboard.minViewingHeight,f),T=this.applyConditionalClassification(m.billboard.scaleMPP,f)*650;m.billboard.distanceDisplayCondition=new to.DistanceDisplayCondition(E,T)}if(f.FSCALE){var x=this.getLevelDistance(f.FSCALE);m.billboard.distanceDisplayCondition=new to.DistanceDisplayCondition(1,x)}m.billboard.link&&m.id&&typeof m.id=="object"&&(m.id.link=this.applyConditionalClassification(m.billboard.link,f)),!m.billboard.disableDepthTestDistance&&(m.billboard.disableDepthTestDistance=1e3),m.clampToGround&&(m.billboard.heightReference=1)}if(m.model){var M=function(R){var O=Number(R);return(!to.defined(O)||isNaN(O))&&(O=0),O};m.model.uri=this.applyClassification(m.model.uri,f),m.model.scale=M(this.applyClassification(m.model.scale,f));var I=M(this.applyClassification(m.model.heading,f)),P=M(this.applyClassification(m.model.pitch,f)),D=M(this.applyClassification(m.model.roll,f)),L=new to.HeadingPitchRoll(to.Math.toRadians(I),to.Math.toRadians(P),to.Math.toRadians(D));m.model.modelMatrix=to.Transforms.headingPitchRollToFixedFrame(m.position,L)}return this.createLineToGroundOptions(m,f),m},Nf.prototype.s=function(o){return o.split("").reverse().join("")},Nf.prototype.getLevelDistance=function(o){var f=2e7;switch(parseInt(o)){case 2:f=10123e3;break;case 3:f=7123e3;break;case 4:f=6321e3;break;case 5:f=5522e3;break;case 6:f=3436e3;break;case 7:f=539e3;break;case 8:f=305e3;break;case 9:f=18e4;break;case 10:f=133e3;break;case 11:f=1e5;break;case 12:f=76500;break;case 13:f=58200;break;case 14:f=23500;break;case 15:f=9600;break;case 16:f=4e3;break;case 17:f=2e3;break;case 18:f=1700;break;case 19:f=1500;break;case 20:f=1e3;break;case 21:f=500;break;case 22:f=200;break;case 23:f=100;break}return f};Nf.prototype.o=function(o){if(!o)return o;var f="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u2C00-\uFB1C\uFDFE-\uFE6F\uFEFD-\uFFFF",m="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",v=new RegExp("^[^"+f+"]*["+m+"]");return v.test(o[0])};Nf.prototype.applyClassification=function(o,f){if($.type(o)!=="string")return o;if(/(\[([^\]]+)\])/g.exec(o)!=null)for(var m in f)o=sMe(o,"["+m+"]",f[m]);o=="undefined"&&(o="");for(var v=/(\<([^\>]+)\>)/g,y=v.exec(o);y!=null;){try{var x=y[y.length-1],C=(0,eval)(x);o=o.replace(y[0],C)}catch{}y=v.exec(o)}return o};Nf.prototype.getPolygonStyle=function(o){var f=$.extend(!0,{},OO.DEFAULT_POLYGON_STYLE,o);return f};Nf.prototype.getLinestringStyle=function(o){var f=$.extend(!0,{},OO.DEFAULT_POLYLINE_STYLE,o);return f};Nf.prototype.getPointStyle=function(o){if(o.label!=null){var f=$.extend(!0,{},OO.DEFAULT_LABEL_STYLE,o);return f}if(o.billboard!=null){var m=$.extend(!0,{},OO.DEFAULT_BILLBOARD_STYLE,o);return m}if(o.model!=null){var v=$.extend(!0,{},OO.DEFAULT_MODEL_STYLE,o);return v}if(o.point!=null){var y=$.extend(!0,{},OO.DEFAULT_POINT_STYLE,o);return y}return OO.DEFAULT_POINT_STYLE};Nf.prototype.sanitizePositions=function(o){for(var f=0;f<o.length;f++)o[f]instanceof Array?this.sanitizePositions(o[f]):isNaN(o[f])&&(o[f]=0)};var OO={};Object.defineProperties(OO,{DEFAULT_POLYGON_STYLE:{get:function(){return{polygon:{perPositionHeight:!0,fill:0,material:to.Color.GREEN,outline:!0,outlineColor:to.Color.WHITE,outlineWidth:1}}}},DEFAULT_POLYLINE_STYLE:{get:function(){return{polyline:{material:to.Color.WHITE,width:1}}}},DEFAULT_POINT_STYLE:{get:function(){return{point:{color:to.Color.RED.withAlpha(.5),pixelSize:5,outlineColor:to.Color.WHITE.withAlpha(.5),outlineWidth:2}}}},DEFAULT_LABEL_STYLE:{get:function(){return{label:{text:"Text",font:"18px arial",style:to.LabelStyle.FILL,fillColor:to.Color.WHITE,outlineColor:to.Color.BLACK,outlineWidth:5,scale:1,horizontalOrigin:to.HorizontalOrigin.CENTER,verticalOrigin:to.VerticalOrigin.BOTTOM,eyeOffset:to.Cartesian3.ZERO,pixelOffset:new to.Cartesian2(0,-50)}}}},DEFAULT_BILLBOARD_STYLE:{get:function(){return{billboard:{image:"./img/query.png",scale:1,horizontalOrigin:to.HorizontalOrigin.CENTER,verticalOrigin:to.VerticalOrigin.BOTTOM}}}},DEFAULT_MODEL_STYLE:{get:function(){return{model:{uri:"./img/CesiumTexturedBoxTest.bgltf",scale:1e3}}}}});var jst=Nf;var qst,zs=null;function jh(o,f,m,v,y,x,C,w,A,E){zs=E;var T=this;if(this._viewer=o,this._Viewer=o,T.G=65535,qst=new zst(zs),gMe=new cA({workerPath:WRi()},zs),!zs.sampleRenderedData){let M=function(F,k,U){var G=zs.defer();function j(q){F.ready?Promise.resolve(R(F,k,q)).then(function(J){G.resolve(J)}):setTimeout(j,10)}return zs.Check.typeOf.object("terrainProvider",F),zs.Check.defined("positions",k),j(U),G.promise},I=function(F,k){for(var U=0;U<F.children.length;U++){var G=F.children[U].state>=zs.QuadtreeTileLoadState.DONE&&(F.children[U].data.terrainData._mesh!=null||F.children[U].data.terrainData._buffer!=null);if(G&&F.children[U].x==k.x&&F.children[U].y==k.y)return F.children[U]}},P=function(F,k,U){for(var G=F.tilingScheme,j=G.positionToTileXY(k,0),q=U.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,J=q[0].x==j.x&&q[0].y==j.y?q[0]:q[1],X=1;X<22;X++){j=G.positionToTileXY(k,X);var Y=I(J,j);if(Y==null)break;J=Y}return J},D=function(F,k){zs.Check.defined("positions",F);var U=zs.defer();return Promise.resolve(L(F,k)).then(function(G){U.resolve(G)}),U.promise},L=function(F,k,U){var G=$.grep(U.scene.primitives._primitives,function(Q){return Q instanceof zs.Cesium3DTileset}),j;for(j=0;j<F.length;++j){var q=F[j],J=q instanceof zs.Cartographic,X=J?q:zs.Cartographic.fromCartesian(q);if(X.height=T.G,!J){var Y=zs.Cartesian3.fromRadiansArrayHeights([X.longitude,X.latitude,X.height])[0];q.z=Y.z}}return F},R=function(F,k,U){var G;for(G=0;G<k.length;++G){var j=k[G],q=P(F,j,U);j.height=q.data.terrainData.interpolateHeight(q.rectangle,j.longitude,j.latitude)}return k},O=function(F){this.value=new Float32Array([F])};O.fromZBias=function(F){if(!zs.defined(F))throw new DeveloperError("zbias is required.");return new O(F)},O.toValue=function(F,k){if(!zs.defined(F))throw new DeveloperError("zbias is required.");return zs.defined(k)?color.toBytes(k):new Float32Array(F)},O.equals=function(F,k){return F===k||zs.defined(F)&&zs.defined(k)&&F.value[0]===k.value[0]},O.defaultBias=function(){var F=15e-6;return O.fromZBias(F)},zs.ZBiasGeometryInstanceAttribute=O,zs.ZBiasGeometryInstanceAttribute=O,zs.SampleRenderedDataFlags={TERRAIN:2,MESH:4,FLOOR:8},zs.DynamicEyeOffset=function(F){return F===void 0&&(F=0),new zs.Cartesian3(.001234321,0,F)},zs.sampleRenderedData=function(F,k,U){var G={TERRAIN:2,MESH:4,FLOOR:8};k==null&&(k=G.TERRAIN|G.MESH);var j=zs.defer(),q=[];k>G.TERRAIN?F.forEach(function(Y){q.push(zs.Cartographic.fromRadians(Y.longitude,Y.latitude,Y.height))}):q=F;var J=[];k&G.TERRAIN&&J.push(M(U.terrainProvider,F));var X=(k&G.FLOOR)>0;return k&(G.MESH|G.FLOOR)&&J.push(D(q,X)),Promise.all(J).then(function(Y){if(J.length>1)for(var Q=0;Q<F.length;Q++){var ee=Y[0][Q],z=Y[1][Q];z.height!=T.G&&(ee.height<z.height||X)&&(ee.height=z.height)}j.resolve(Y[0])}),j.promise},zs.sampleRenderedMesh=function(F,k){zs.Check.defined("positions",F);var U=zs.defer();return Promise.resolve(L(F,k)).then(function(G){U.resolve(G)}),U.promise},zs.sampleRenderedTerrain=function(F,k){function U(){F.ready?Promise.resolve(R(F,k)).then(function(j){G.resolve(j)}):setTimeout(U,10)}zs.Check.typeOf.object("terrainProvider",F),zs.Check.defined("positions",k);var G=zs.defer();return U(),G.promise},zs.QuadtreePrimitive.prototype.getRenderedBestLevelInfo=function(){var F=this.getRenderedLevelInfo(),k=0;for(var U in F)k<Number(U)&&(k=Number(U));return{bestLevel:k,count:F[k]}},zs.QuadtreePrimitive.prototype.getRenderedLevelInfo=function(){var F=[];return this._tilesToRender.forEach(function(k){F[k.level]==null&&(F[k.level]=0),F[k.level]++}),F}}y=y||{},this._level=v||{min:0,max:22},typeof this._level=="number"&&(this._level={min:v,max:22}),this._url=f,this._layerName=m,this._guid=zs.createGuid(),this._visible=!0,this._gmlParser=new Dst(!0,null,null,!0);let S=!this._viewer.TileManager;this._tileManager=qst.getInstance(o),this._tileManager.tileLevel[this._guid]={level:this._level,visible:this._visible},this._tileManager._loadTileEvent.addEventListener(jh.prototype.loadTile,this),this._useWorkers=!0,this._layerDisplayName=x,this._showAttributesAsMessage=y.showAttributesAsMessage,delete y.showAttributesAsMessage,this._entityCreator=new jst(y,o,zs),this._featuresMap={},this._boundingBox=void 0,this._geometryFieldName=void 0,this._operations={},this._subdomains=C,this.latLon=!0,this._addedFeatures=[],this.simpleSqlParser=Hst,this.myLayer=A,this._statistics={numberOfAddedFeatures:0,numberOfDeletedFeatures:0,numberOfAddePositions:0,numberOfDeletedPositions:0,getNumberOfCurrentlyRenderedFeatures:function(){return this.numberOfAddedFeatures-this.numberOfDeletedFeatures},getNumberOfCurrentlyRenderedPositions:function(){return this.numberOfAddePositions-this.numberOfDeletedPositions}},kRi(this),Xst(this),w!==void 0&&this.setVisibility(w),S||this.refresh()}function DX(o,f){var m;return o.indexOf("{s}")!=-1?m=f!=null&&f.length>0?o.replace("{s}",f[0]):console.error("Error - sTag with no subdomains."):m=o,m}function fMe(o,f,m){var v=$(o).find(f);return v.length==0&&m.toLowerCase()==="wfs"&&(v=$(o).find("wfs\\:"+f+","+f)),v.length>0?v:$([])}function BRi(o,f){fMe(f,"FeatureType","wfs").each(function(m,v){if(fMe(v,"Name","wfs").text()==o._layerName){var y=fMe(v,"LatLongBoundingBox","wfs");return y.length!==1||(o._boundingBox=zs.Rectangle.fromDegrees(parseFloat(y[0].attributes.minx.value),parseFloat(y[0].attributes.miny.value),parseFloat(y[0].attributes.maxx.value),parseFloat(y[0].attributes.maxy.value))),!1}return!0})}function mMe(o){return o.indexOf("?")>-1?"&":"?"}function kRi(o){var f=o.cleanUrl(o._url).replace("{s}",o.sTag(o._layerName.length,o._layerName.length,o._level));f+=mMe(f),f+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities&outputFormat=GML2&typeName="+o._layerName;var m=zs.TrustedServers.contains(DX(o._url,o._subdomains));$.ajax({dataType:"xml",xhrFields:{withCredentials:m},url:encodeURI(f),success:function(v){BRi(o,v),VRi(o,v)}})}function VRi(o,f){$(f).find("FeatureType").each(function(m,v){if($(v).children("Name").text()==o._layerName){var y=$(v).children("Operations");return y.length==0||y.children().each(function(){o._operations[this.tagName.toLowerCase()]={}}),!1}return!0})}function Xst(o){o.featureColumnNames=null;var f=o.cleanUrl(o._url).replace("{s}",o.sTag(o._layerName.length,o._layerName.length,o._level));f+=mMe(f),f+="SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&typeName="+o._layerName;var m=zs.TrustedServers.contains(DX(o._url,o._subdomains));$.ajax({dataType:"xml",xhrFields:{withCredentials:m},url:encodeURI(f),success:function(v){URi(o,v)}})}function zRi(o,f){let m=eval;if(o==null)return null;try{var v=new XMLSerializer().serializeToString(o).match(m("/[<]([a-z]+):"+f+"[>]/i"));return v!=null?v[1]:null}catch{return!1}}function HRi(o,f){if(o==null)return!1;try{let v=eval;var m=new XMLSerializer().serializeToString(o.context!=null?o.context:o).match(v("/[<](([a-z]+):)?"+f+"[^>]*[>]/i"));return m!=null}catch{return!1}}function URi(o,f){var m=$(f).find("[type^='gml:']");o._geometryFieldName=$(m).attr("name"),o.geometryResponseData=f,o.wfsNamespace=zRi(o.geometryResponseData,"sequence"),o.wfsNamespace==null&&(o.wfsNamespace="xsd"),o.sgSchemaExists=$(o.geometryResponseData).find(o.wfsNamespace+"\\:schema").attr("xmlns:sfs"),o.sgSchemaExists||(o.sgSchemaExists=$(o.geometryResponseData).find("schema").attr("xmlns:sfs"));var v=$(o.geometryResponseData).find(o.wfsNamespace+"\\:sequence "+o.wfsNamespace+"\\:element");v.length==0&&(v=$(o.geometryResponseData).find("sequence").find("element")),o.geomFields=[],v.each(function(){var y=$(this),x=y.attr("name"),C=y.attr("type");if(C==null)C="string";else{var w=C.match(/.*[:](\w+)/);w&&(C=w[1])}o.geomFields.push({name:x,type:C})})}function $ae(o,f){if(o.operator){var m="";switch(o.operator.toLowerCase()){case"=":m="PropertyIsEqualTo";break;case"<>":m="PropertyIsNotEqualTo";break;case">":m="PropertyIsGreaterThan";break;case">=":m="PropertyIsGreaterThanOrEqualTo";break;case"<":m="PropertyIsLessThan";break;case"<=":m="PropertyIsLessThanOrEqualTo";break;case"like":m="PropertyIsLike"}var v=f.indexOf(o.right)!=-1?o.right:o.left,w="<ogc:"+m+(o.operator.toLowerCase()=="like"?' wildCard="*" singleChar="*" escape="*"':"")+">";w+="<ogc:PropertyName>"+v+"</ogc:PropertyName>";var y=f.indexOf(o.right)!=-1?o.left:o.right;y=y.replace(/^'|'$$/g,"");var x=y.match(/^[%]|[%]$$/)==null;return o.operator.toLowerCase()=="like"&&x&&(y="%"+y+"%"),w+="<ogc:Literal>"+y+"</ogc:Literal>",w+="</ogc:"+m+">",w}var C=o.logic.toLowerCase()=="and"?"And":"Or",w="<ogc:"+C+">";return o.terms.length==2?w+=$ae(o.terms[0],f):w+=$ae({logic:C,terms:o.terms.slice(0,o.terms.length-1)},f),w+=$ae(o.terms[o.terms.length-1],f),w+="</ogc:"+C+">",w}function GRi(o){var f=[],m=$(o).find("gml\\:featureMember");return m.length==0&&(m=$(o).find("featureMember")),m.each(function(){var v={},y=$(this).children().first();v.layerId=y[0].nodeName,v.originFid=y.attr("fid"),v.fid=y.attr("fid"),v.fid==null&&(v.fid=-1);var x=v.fid.match(/[.]?(\d+)$$/);x&&(v.fid=x[1]),v.node=y[0],y.children().each(function(){v[this.nodeName]=this.innerHTML,v[this.nodeName]==null&&(v[this.nodeName]=$(this).text())}),f.push(v)}),f}function pMe(o){return o==null?void 0:o.parentLayer?o:o._parentCollection?o._parentCollection:o.primitive&&o.primitive._parentCollection?o.primitive._parentCollection:void 0}Object.defineProperties(jh.prototype,{LayerDisplayName:{get:function(){return this._layerDisplayName}},displayName:{get:function(){return this.LayerDisplayName}},guid:{get:function(){return this._guid}},Style:{get:function(){return this._entityCreator.style}},show:{get:function(){return this._visible},set:function(o){this.setVisibility(o)}},BoundingBox:{get:function(){return this._boundingBox}},boundingSphere:{get:function(){return zs.BoundingSphere.fromRectangle3D(this._boundingBox)}},Statistics:{get:function(){return this._statistics}}});var MX=180/Math.PI,uWi=1/MX,Jst=1e3;jh.prototype.getRequestMaxFeatures=function(){return Jst};jh.prototype.isAttributeField=function(o,f){return!f||!o||o.toLowerCase()==""||o.toLowerCase()=="fid"?!1:f.toLowerCase()=="string"||f.toLowerCase()=="integer"||f.toLowerCase()=="double"};jh.prototype.updateFeatures=function(o,f){if(o.length<=0){f();return}var m=this,v=[];$(this.geomFields).each(function(){m.isAttributeField(this.name,this.type)&&v.push(this.name)});var y="<wfs:Transaction version='1.0.0' service='WFS' username='' password='' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> {wfs_updates}</wfs:Transaction>",x="";$(o).each(function(){var E=this,T='<wfs:Update typeName="{lyaer_id}">'.replace("{lyaer_id}",this.layerId);$(v).each(function(){T+="<wfs:Property><wfs:Name>"+this+"</wfs:Name><wfs:Value>"+E[this]+"</wfs:Value></wfs:Property>"}),T+='<ogc:Filter><ogc:FeatureId fid="'+E.originFid+'"/></ogc:Filter>',T+="</wfs:Update>",x+=T}),y=y.replace("{wfs_updates}",x);var C="Failed to save changes to server",w=DX(this.cleanUrl(this._url),this._subdomains),A=zs.TrustedServers.contains(w);$.ajax({dataType:"xml",type:"POST",data:y,xhrFields:{withCredentials:A},url:encodeURI(w),success:function(E){var T=new XMLSerializer().serializeToString(E.documentElement).toLowerCase();if(T.match(/success\s*\//)==null){f(C);return}f()},error:function(E,T,S){f(C)},timeout:1e4})};jh.prototype.getFeatures=function(o,f,m){var v=this,y=[];$(this.geomFields).each(function(){v.isAttributeField(this.name,this.type)&&y.push(this.name)});var x="<wfs:GetFeature version='1.0.0' service='WFS' username='' password='' maxFeatures='{REQUEST_MAX_FEATURES}' xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'> <wfs:Query typeName='{layer_name}'> {wfs_filter}</wfs:Query> </wfs:GetFeature>";x=x.replace("{layer_name}",this._layerName),x=x.replace("{REQUEST_MAX_FEATURES}",Jst);var C="";if(o.replace(/[ ]/g,"")!=""){C="<ogc:Filter xmlns:sfs='http://www.skylineglobe.com/sfs-schema' xmlns:ogc='http://www.opengis.net/ogc' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:wfs='http://www.opengis.net/wfs' xmlns:gml='http://www.opengis.net/gml'>";var w=v.simpleSqlParser.sql2ast("SELECT * FROM x WHERE "+o);C+=$ae(w.WHERE,y),C+="</ogc:Filter>"}x=x.replace("{wfs_filter}",C);var A=DX(this.cleanUrl(this._url),this._subdomains),E=zs.TrustedServers.contains(A);f.xhr=$.ajax({url:encodeURI(A),type:"POST",data:x,dataType:"xml",xhrFields:{withCredentials:E},success:function(T){var S=HRi($(T),"FeatureCollection");if(!S){m(null,TELang.i18n("layer_error_reading_features"));return}var M=GRi(T);m(M)},error:function(T,S,M){m(null,T.statusText)},timeout:1e4})};jh.prototype.getFeatureColumnNames=function(){if(this.featureColumnNames)return this.featureColumnNames;var o=$(this.geometryResponseData).find(this.wfsNamespace+"\\:sequence "+this.wfsNamespace+"\\:element");o.length==0&&(o=$(this.geometryResponseData).find("sequence").find("element"));var f=[];return o.each(function(){var m=$(this);m.attr("name").toLowerCase()!="geom"&&f.push(m.attr("name").toLowerCase())}),this.featureColumnNames=f,this.featureColumnNames};jh.prototype.refresh=function(o){let f=this._tileManager.getAllTiles();if(f){let m=f.length;for(let v=0;v<m;v++)f[v].data.wfsLayerData[this._guid]&&f[v].data.wfsLayerData[this._guid].freeResources(),this.loadTile(f[v]);o&&Xst(this)}};jh.prototype.setVisibility=function(o){if(this._visible!=o)if(this._visible=o,this._tileManager.tileLevel[this._guid].visible=o,o==0)for(var f=this._tileManager.getAllTiles(),m=f.length,v=0;v<m;v++)f[v].data.wfsLayerData[this._guid]&&f[v].data.wfsLayerData[this._guid].primitive&&(f[v].data.wfsLayerData[this._guid].primitive.show=!1);else for(var f=this._tileManager.getAllTiles(),m=f.length,v=0;v<m;v++)f[v].data.wfsLayerData[this._guid]&&(f[v].data.wfsLayerData[this._guid].primitive?f[v].data.wfsLayerData[this._guid].primitive.show=!0:this.loadTile(f[v]))};jh.prototype.loadTile=function(o){var f=this;o.data.wfsLayerData[this._guid]={id:o.data.id,primitive:void 0,freeResources:function(){zs.defined(this.xhr)&&(this.xhr.abort(),this.xhr=void 0),zs.defined(this.features)&&(f.removeFeaturesFromLayer(this.features),this.features=void 0),zs.defined(this.primitive)&&(f._tileManager.removeFromScene(this.primitive),this.primitive=void 0)}},this.show&&o.level>=this._level.min&&o.level<=this._level.max&&(this.statc=0,this._guide=this._guid,this.beginLoadWFSData(o))};jh.prototype.isDestroyed=function(){return!1};jh.prototype.destroy=function(){var o=this._tileManager.getAllTiles(),f=o.length;if(f>0)for(var m=0;m<f;m++)o[m].data.wfsLayerData[this._guid]&&o[m].data.wfsLayerData[this._guid].freeResources();return this._tileManager._loadTileEvent.removeEventListener(jh.prototype.loadTile,this),zs.destroyObject(this)};jh.prototype.sTag=function(o,f,m){if(this._subdomains==null)return"";var v=(o+f+m)%this._subdomains.length;return this._subdomains[v]};jh.prototype.cleanUrl=function(o){return o.indexOf("?")!=-1?o.split("?")[0]:o};function WRi(){return SmartEarthRootUrl+"Workers/featurefetcherworker.js"}jh.prototype.beginLoadWFSData=function(o){if(this.latLon!=null&&!this.latLon||(this.BoundingBox!=null&&(this.BoundingBox.width==0||this.BoundingBox.height==0)&&(this.BoundingBox.east+=1,this.BoundingBox.north+=1,this.BoundingBox.beenModified=!0),this.BoundingBox!==void 0&&zs.Rectangle.intersection(this.BoundingBox,o.rectangle)===void 0))return;var f=[MX*o.rectangle.west,MX*o.rectangle.south,MX*o.rectangle.east,MX*o.rectangle.north],m=this,v=this.cleanUrl(this._url).replace("{s}",this.sTag(o.x,o.y,o.level));v+=mMe(v);let y="GML2";v+="SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&outputFormat="+y+"&typeName="+this._layerName+"&srsName=EPSG:4326&BBOX="+f.join(",");var x=zs.TrustedServers.contains(DX(this._url,this._subdomains));o.data.wfsLayerData[this._guid].xhr=$.ajax({dataType:this._useWorkers?"text":"xml",url:encodeURI(v),cache:!0,xhrFields:{withCredentials:x},success:function(C){m.processWFSData(o,C,y)},error:function(C,w,A){A!=="abort"&&console.log("Failed to retrieve data from "+v+" :"+A)},complete:function(){o.data.wfsLayerData[m._guid].xhr=void 0}})};var gMe;jh.prototype.processWFSData=function(o,f,m){if(o.data.wfsLayerData[this._guid].xhr=void 0,this._useWorkers){var v=this;gMe.queueWorkItem({id:o.data.id,text:f,format:m,geometryFieldName:this._geometryFieldName}).then(function(x){v.addFeaturesToTile(x)})}else{var y=this._gmlParser.read(f);this.addFeaturesToTile({id:o.data.id,features:y})}};jh.prototype.boundingSphereFromGML=function(o,f){var m=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,v=this;gMe.queueWorkItem({id:"0",text:o,geometryFieldName:this._geometryFieldName}).then(function(y){var x={parentLayer:v,features:y.features,sampleTerrainLevel:m+1,isQuery:!0,onFinishedQuery:function(C){var w;C.length>0&&(w=zs.BoundingSphere.fromBoundingSpheres(C)),f(w)}};v._entityCreator.createPrimitiveFromWFSFeatures(x)})};jh.prototype.boundingSphereFromFeature=function(o){var f,m=viewer.scene.globe._surface.getRenderedBestLevelInfo().bestLevel,v={parentLayer:this,features:[o],sampleTerrainLevel:m+1,isQuery:!0,onFinishedQuery:function(y){y.length>0&&(f=zs.BoundingSphere.fromBoundingSpheres(y))}};return this._entityCreator.createPrimitiveFromWFSFeatures(v),f};jh.prototype.addRenderedFeatureId=function(o){this._addedFeatures[o]==null&&(this._addedFeatures[o]=0),this._addedFeatures[o]++};jh.prototype.removeRenderedFeatureId=function(o,f){if(f&&f.geometryType&&f.geometryType.includes("multi"))for(let m=0,v;m<f.positions.length;m++)v=o+"."+m,this._addedFeatures[v]!=null&&this._addedFeatures[v]--,this._addedFeatures[v]==0&&(this._addedFeatures[v]=void 0);else this._addedFeatures[o]!=null&&this._addedFeatures[o]--,this._addedFeatures[o]==0&&(this._addedFeatures[o]=void 0)};jh.prototype.isExistRenderedFeatureId=function(o){return this._addedFeatures[o]!=null};jh.prototype.addFeaturesToTile=function(o,f){var m=this._tileManager.getTile(o.id);if(m!==void 0){var v=f?m.data.wfsLayerData[this._guid].primitive._instanceIds:void 0,y=this,x={parentLayer:this,originalInstanceIds:v,features:o.features,onFinishedCreatePrimitive:function(C){if(!(o.features==null||m.data.wfsLayerData==null)&&(m.data.wfsLayerData[y._guid].features=o.features,f||y.addFeaturesToLayer(m.data.wfsLayerData[y._guid].features),C.length===void 0||C.length>0)){var w=m.data.wfsLayerData[y._guid].primitive;C.show=y.show,m.data.wfsLayerData[y._guid].primitive=C,C.parentLayer=y,C.parentTileId=o.id,C._guid=zs.createGuid(),f?y._tileManager.replaceInScene(w,C):y._tileManager.addToScene(C)}}};this._entityCreator.createPrimitiveFromWFSFeatures(x)}};jh.prototype.addFeaturesToLayer=function(o){this._statistics.numberOfAddedFeatures+=o.length,this._statistics.numberOfAddePositions+=zs.defaultValue(o.numPositions,0);for(var f=o.length,m=0;m<f;m++)Object.prototype.hasOwnProperty.call(this._featuresMap,o[m].fid)===!1?this._featuresMap[o[m].fid]={refCount:1,feature:o[m]}:this._featuresMap[o[m].fid].refCount++};jh.prototype.removeFeaturesFromLayer=function(o){this._statistics.numberOfDeletedFeatures+=o.length,this._statistics.numberOfDeletedPositions+=zs.defaultValue(o.numPositions,0);for(var f=o.length,m=0,v;m<f;m++)v=o[m].fid,Object.prototype.hasOwnProperty.call(this._featuresMap,v)!==!1&&(this._featuresMap[v].refCount--,this._featuresMap[v].refCount===0&&delete this._featuresMap[v],this.removeRenderedFeatureId(v,o[m]))};jh.prototype.getFeature=function(o){return Object.prototype.hasOwnProperty.call(this._featuresMap,o)===!1?null:this._featuresMap[o]};jh.prototype.updateTile=function(o){var f=this._tileManager.getTile(o);f!==void 0&&(f.data.wfsLayerData[this._guid].features==null?this.loadTile(f):this.addFeaturesToTile(f.data.wfsLayerData[this._guid],!0))};jh.blockRequestPrimitiveFromPrimitive=function(o){if(o!=null){var f=pMe(o);return f!=null||(o._labelCollection&&o._labelCollection._billboardCollection?f=pMe(o._labelCollection._billboardCollection):o._billboardCollection&&(f=pMe(o._billboardCollection))),f}};jh.prototype.resetAttributesTable=function(){this.lastEditedCell=null,this.attrTblDialogMemo=null};var ese=jh;var Ff=null;function tse(o,f){Ff=f,this.Viewer=o,this._core=new Sr(o,f),this.colorTool=this._core.gradientColor()}tse.prototype.CreateWfs=function(o,f){let m={},v,y;if(o==="point")if(f.sgStyleJSON)m=this.getSGStyle("point",f.sgStyleJSON,f.name);else{v=this.colorTool.colorRgb(this._core.defaultValue(f.color,"#ffffff"));var x=this.colorTool.colorRgb(this._core.defaultValue(f.bgColor,"#010101"));m={preLoad:f.preLoad,lineToGround:{defaultValue:f.lineToGround?f.lineToGroundLength?"2":"1":"0"},lineToGroundLength:{defaultValue:f.lineToGroundLength||0},lineToGroundColor:{defaultValue:{red:1,green:1,blue:1,alpha:1}},altitudeMethod:0,altitudeOffset:{defaultValue:"0"},clampToGround:this._core.defaultValue(f.clampToGround,!1),pointHeight:this._core.defaultValue(f.height,void 0)},f.text&&(f.offsetX&&(f.offsetX=parseInt(f.offsetX)),f.offsetY&&(f.offsetY=parseInt(f.offsetY)),m.label={text:{defaultValue:f.text},scaleMPP:{defaultValue:"15000"},fillColor:{defaultValue:{red:v[0]/255,green:v[1]/255,blue:v[2]/255,alpha:this._core.defaultValue(f.alpha,1)}},scaleByDistance:{near:150,nearValue:1,far:8e5,farValue:.5},minViewingHeight:{defaultValue:"0"},font:{defaultValue:"12"},family:{defaultValue:this._core.defaultValue(f.font,"Arial")},backgroundColor:{defaultValue:{red:x[0]/255,green:x[1]/255,blue:x[2]/255,alpha:this._core.defaultValue(f.alpha,1)}},scale:this._core.defaultValue(f.scale,2),backgroundOpacity:{defaultValue:f.bgColor?"0.5":"0"},italic:{defaultValue:f.italic?"1":"0"},bold:{defaultValue:f.bold?"1":"0"},limitGrowth:{defaultValue:"1"},textRelativeToImage:{defaultValue:"0"},showText:{defaultValue:"0"},textAlignment:{defaultValue:"17"},pixelOffset:new Ff.Cartesian2(this._core.defaultValue(f.offsetX,0),this._core.defaultValue(f.offsetY,f.image?-10:0)),outlineColor:Ff.Color.fromCssColorString(this._core.defaultValue(f.outlineColor,"#ffffff")),outlineWidth:this._core.defaultValue(f.outlineWidth,2),horizontalOrigin:Ff.HorizontalOrigin.CENTER,verticalOrigin:Ff.VerticalOrigin.BOTTOM,disableDepthTestDistance:f.disableDepthTestDistance==="Infinity"?Number.POSITIVE_INFINITY:f.disableDepthTestDistance}),f.outlineColor&&m.label&&(m.label.style=Ff.LabelStyle.FILL_AND_OUTLINE),f.image&&(m.billboard={image:f.image,scale:this._core.defaultValue(f.imageScale,1),disableDepthTestDistance:f.disableDepthTestDistance,horizontalOrigin:Ff.HorizontalOrigin.CENTER,verticalOrigin:Ff.VerticalOrigin.BOTTOM,link:f.link})}else o==="polyline"?f.sgStyleJSON?m=this.getSGStyle("polyline",f.sgStyleJSON,f.name):(v=this.colorTool.colorRgb(this._core.defaultValue(f.color,"#ffff00")),m={preLoad:f.preLoad,polyline:{material:{red:v[0]/255,green:v[1]/255,blue:v[2]/255,alpha:this._core.defaultValue(f.alpha,1)},outlineColor:Ff.Color.fromCssColorString(this._core.defaultValue(f.outlineColor,"#ffffff")),lineOpacity:this._core.defaultValue(f.alpha,1),outlineWidth:this._core.defaultValue(f.outlineWidth,0),width:this._core.defaultValue(f.width,4),clampToGround:this._core.defaultValue(f.clampToGround,!0),classificationType:f.classificationType,dash:f.dash,gapColor:f.gapColor&&Ff.Color.fromCssColorString(f.gapColor),dashLength:f.dashLength},height:f.height}):o==="polygon"&&(f.sgStyleJSON?m=this.getSGStyle("polygon",f.sgStyleJSON,f.name):(v=this.colorTool.colorRgb(this._core.defaultValue(f.color,"#6bbeef")),y=this.colorTool.colorRgb(this._core.defaultValue(f.outlineColor,"#ffffff")),m={preLoad:f.preLoad,pointHeight:this._core.defaultValue(f.pointHeight,void 0),polygon:{text:!!f.text,labelNear:f.labelNear,labelFar:f.labelFar,offsetPoint:f.offsetPoint,outlineColor:{defaultValue:{red:y[0]/255,green:y[1]/255,blue:y[2]/255,alpha:1}},outlineWidth:f.outlineWidth,fill:{defaultValue:this._core.defaultValue(f.alpha,1)},height:f.height,extrudedHeight:f.extrudedHeight,clampToGround:this._core.defaultValue(f.clampToGround,f.extrudedHeight===void 0&&f.height===void 0),classificationType:f.classificationType,water:f.water,bulidingWall:f.bulidingWall,bulidingWallWidth:f.bulidingWallWidth,randomColor:f.randomColor,colorConfig:f.colorConfig,outline:this._core.defaultValue(f.outline,!0),material:{defaultValue:{red:v[0]/255,green:v[1]/255,blue:v[2]/255,alpha:this._core.defaultValue(f.alpha,1)}},fromKml:!0}},f.text&&(m.label={style:Ff.LabelStyle.FILL_AND_OUTLINE,text:{defaultValue:f.text},scaleMPP:{defaultValue:"15000"},fillColor:{defaultValue:Ff.Color.fromCssColorString(this._core.defaultValue(f.labelColor||f.color,"#ffffff"))},scaleByDistance:{near:150,nearValue:1,far:8e5,farValue:.5},minViewingHeight:{defaultValue:"0"},font:{defaultValue:"12"},family:{defaultValue:this._core.defaultValue(f.font,"Arial")},backgroundColor:{defaultValue:{red:0,green:0,blue:0,alpha:0}},scale:this._core.defaultValue(f.scale,2),backgroundOpacity:{defaultValue:f.bgColor?"0.5":"0"},italic:{defaultValue:f.italic?"1":"0"},bold:{defaultValue:f.bold?"1":"0"},limitGrowth:{defaultValue:"1"},textRelativeToImage:{defaultValue:"0"},showText:{defaultValue:"0"},textAlignment:{defaultValue:"17"},pixelOffset:new Ff.Cartesian2(this._core.defaultValue(f.offsetX,0),this._core.defaultValue(f.offsetY,f.image?-10:0)),outlineColor:Ff.Color.fromCssColorString(this._core.defaultValue(f.labelOutlineColor||f.outlineColor,"#ffffff")),outlineWidth:this._core.defaultValue(f.scale,2),horizontalOrigin:Ff.HorizontalOrigin.CENTER,verticalOrigin:Ff.VerticalOrigin.BOTTOM,disableDepthTestDistance:f.disableDepthTestDistance==="Infinity"?Number.POSITIVE_INFINITY:f.disableDepthTestDistance})));if(!m&&f.sgStyleJSON){console.log(f.name+"\u83B7\u53D6\u6837\u5F0F\u5931\u8D25\uFF01");return}return m.position_x&&(f.lon=m.position_x,f.lat=m.position_y,f.height=m.position_z),new ese(this.Viewer,this._core.defaultValue(f.urls,m.urls),this._core.defaultValue(f.layer,m.layer),{min:this._core.defaultValue(f.minimumLevel,m.minimumLevel||0),max:this._core.defaultValue(f.maximumLevel,m.maximumLevel||22)},m,this._core.defaultValue(f.layer,m.layer),f.pID||"0",f.checked,void 0,Ff)};tse.prototype.getSGColor=function(o){let f=parseInt(o).toString(16);return f.length===2?f="0000"+f:f.length===4&&(f="00"+f),f="#"+f.slice(4)+f.slice(2,4)+f.slice(0,2),f};tse.prototype.getSGStyle=function(o,f,m){let v;return $.ajax({url:f,async:!1,contentType:"application/json",success:y=>{y&&typeof y=="string"&&(y=JSON.parse(y));let x=y.filter(C=>C.LayerName===m);if(o==="point"){let C=x[0];x=C.Point,x.Line_Color=this.getSGColor(x.Line_Color),x.Image_Color=this.getSGColor(x.Image_Color),x.Text_Color=this.getSGColor(x.Text_Color),x.Background_Color=this.getSGColor(x.Background_Color);let w=this.colorTool.colorRgb(this._core.defaultValue(x.Text_Color,"#ffffff")),A=this.colorTool.colorRgb(this._core.defaultValue(x.Background_Color,"#010101"));v={label:{text:{defaultValue:this._core.defaultValue(x.Text.match(/<Value>(\S*)<\/Value>/)[1],x.Text.match(/<DefaultValue>(\S*)<\/DefaultValue>/)[1])},scaleMPP:{defaultValue:x.Scale},fillColor:{defaultValue:{red:w[0]/255,green:w[1]/255,blue:w[2]/255,alpha:1}},scaleByDistance:{near:0,nearValue:1,far:8e8,farValue:1},minViewingHeight:{defaultValue:"0"},font:{defaultValue:x.Text_Size},family:{defaultValue:this._core.defaultValue(x.Font,"Arial")},backgroundColor:{defaultValue:{red:A[0]/255,green:A[1]/255,blue:A[2]/255,alpha:1}},scale:this._core.defaultValue(x.TextScale,1.5),backgroundOpacity:{defaultValue:x.Background_Opacity},italic:{defaultValue:x.Italic},bold:{defaultValue:x.Bold},limitGrowth:{defaultValue:"1"},textRelativeToImage:{defaultValue:"0"},showText:{defaultValue:"0"},textAlignment:{defaultValue:"17"},pixelOffset:new Ff.Cartesian2(this._core.defaultValue(x.offsetX,0),this._core.defaultValue(x.offsetY,x.Image_file?-10:0)),outlineColor:Ff.Color.fromCssColorString(this._core.defaultValue(x.Line_Color,"#ffffff")),outlineWidth:this._core.defaultValue(x.outlineWidth,2),horizontalOrigin:Ff.HorizontalOrigin.CENTER,verticalOrigin:Ff.VerticalOrigin.BOTTOM},lineToGround:{defaultValue:x.Line_to_Ground},lineToGroundLength:{defaultValue:x.Line_Length},lineToGroundColor:{defaultValue:{red:1,green:1,blue:1,alpha:1}},altitudeMethod:0,altitudeOffset:{defaultValue:"0"},clampToGround:this._core.defaultValue(x.clampToGround,!0),pointHeight:this._core.defaultValue(x.pointHeight,void 0),minimumLevel:this._core.defaultValue(x.level_min,0),maximumLevel:this._core.defaultValue(x.level_max,22),position_x:C.position_x,position_y:C.position_y,position_z:C.position_z==0?1e4:C.position_z,urls:C.Server,layer:C.ServerName},x.Line_Color&&v.label&&(v.label.style=Ff.LabelStyle.FILL_AND_OUTLINE),x.Image_file&&(v.billboard={image:x.Image_file,scale:this._core.defaultValue(x.ImageScale,1),scaleMPP:{defaultValue:x.Scale},scaleByDistance:{near:0,nearValue:1,far:8e8,farValue:1},minViewingHeight:{defaultValue:"0"},verticalOrigin:Ff.VerticalOrigin.BOTTOM})}else if(o==="polyline"){let C=x[0];x=C.Line,x.Line_Color=this.getSGColor(x.Line_Color),x.Line_Width&&(x.Line_Width.length===2?x.Line_Width/=10:x.Line_Width.length===3&&(x.Line_Width/=100));let w=this.colorTool.colorRgb(this._core.defaultValue(x.Line_Color,"#ff0000"));v={polyline:{material:{red:w[0]/255,green:w[1]/255,blue:w[2]/255,alpha:1},lineOpacity:parseInt(this._core.defaultValue(x.Line_Opacity,1)),width:parseInt(this._core.defaultValue(x.Line_Width,4)),near:x.Near,far:x.Far,clampToGround:this._core.defaultValue(x.clampToGround,!0),classificationType:option.classificationType},minimumLevel:this._core.defaultValue(x.level_min,0),maximumLevel:this._core.defaultValue(x.level_max,22),position_x:C.position_x,position_y:C.position_y,position_z:C.position_z==0?1e4:C.position_z,urls:C.Server,layer:C.ServerName}}else if(o==="polygon"){let C=x[0];x=C.data,x.fill=Ff.Color.fromCssColorString(x.fill),x.outlineColor=Ff.Color.fromCssColorString(x.outlineColor),v={polygon:{outlineColor:{defaultValue:x.outlineColor},outlineWidth:x.outlineWidth,fill:{defaultValue:x.fill.alpha},extrudedHeight:x.extrudedHeight||0,height:x.height,outline:x.outline,material:{defaultValue:x.fill},clampToGround:!x.extrudedHeight,classificationType:option.classificationType,fromKml:!0},altitudeMethod:2,altitudeOffset:{defaultValue:"0"},minimumLevel:this._core.defaultValue(x.level_min,0),maximumLevel:this._core.defaultValue(x.level_max,22),position_x:C.position_x,position_y:C.position_y,position_z:C.position_z==0?1e4:C.position_z,urls:C.Server,layer:C.ServerName}}},error:()=>{console.log("\u83B7\u53D6\u6837\u5F0F\u914D\u7F6E\u5931\u8D25\uFF01")}}),v};var LX=tse;function jRi(o=8,f=16){let m="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),v=[];if(f=f||m.length,o)for(let y=0;y<o;y++)v[y]=m[0|Math.random()*f];else{v[8]=v[13]=v[18]=v[23]="-",v[14]="4";for(let y=0,x;y<36;y++)v[y]||(x=0|Math.random()*16,v[y]=m[y==19?x&3|8:x])}return v.join("")}var _Me=jRi;var L_=null;function xP(o,f={},m){L_=m,this._viewer=o,this._cache={},this.timeout=null,this.option={id:_Me(),size:18,pixelRange:40,gradient:{1e-4:"rgb(0,191,255)",.001:"rgb(0,128,0)",.01:"rgb(255,165,0)",.1:"rgb(255,0,0)"},fontSize:12,horizontalOrigin:L_.HorizontalOrigin.CENTER,verticalOrigin:L_.VerticalOrigin.BOTTOM,fontColor:"rgb(0,0,0)",style:"circle",...f};for(let y in this.option.gradient)this.option.gradient[y]=L_.Color.fromCssColorString(this.option.gradient[y]);this.dataSource=new L_.CustomDataSource(this.option.id),this.dataSource.clustering.pixelRange=this.option.pixelRange,this.dataSource.clustering.clusterEvent.addEventListener(this._clusterEventHandler,this),this._viewer.dataSources.add(this.dataSource),this.readyCanvas();let v=this}xP.prototype.add=function(o,f={}){let m={id:f.id||_Me(),name:f.name,position:L_.Cartesian3.fromDegrees(o.lon,o.lat,o.height)};return f.label&&(m.label={show:!0,outlineWidth:L_.defaultValue(f.label.outlineWidth,2),font:L_.defaultValue(f.label.font,"12pt monospace"),style:L_.defaultValue(f.label.style,L_.LabelStyle.FILL_AND_OUTLINE),verticalOrigin:L_.defaultValue(f.label.verticalOrigin,L_.VerticalOrigin.BOTTOM),pixelOffset:L_.defaultValue(f.label.pixelOffset,new L_.Cartesian2(0,-20)),...f.label}),f.billboard&&(m.billboard={image:f.billboard.image,scale:f.billboard.scale||1,horizontalOrigin:f.billboard.horizontalOrigin||L_.HorizontalOrigin.CENTER,verticalOrigin:f.billboard.verticalOrigin||L_.VerticalOrigin.BOTTOM,disableDepthTestDistance:f.billboard.disableDepthTestDistance||Number.POSITIVE_INFINITY,...f.billboard}),this.dataSource.entities.add(m)};xP.prototype._drawCircle=function(o,f){let m=f.length,v=this.option.size*(m+1),y=o.toCssColorString()+"-"+f,x=v/2-m*this.option.fontSize/3,C=(v+this.option.fontSize)/2;if(!this._cache[y]){let w=document.createElement("canvas");w.width=v,w.height=v;let A=w.getContext("2d");A.save(),A.scale(v/24,v/24),A.fillStyle=o.withAlpha(.2).toCssColorString(),A.beginPath(),A.arc(12,12,9,0,2*Math.PI),A.closePath(),A.fill(),A.beginPath(),A.arc(12,12,6,0,2*Math.PI),A.fillStyle=o.toCssColorString(),A.fill(),A.closePath(),A.restore(),A.font=`bold ${this.option.fontSize}px sans-serif`,A.fillStyle=this.option.fontColor,A.fillText(f,x,C),this._cache[y]=w.toDataURL()}return this._cache[y]};xP.prototype._drawClustering=function(o,f){let m=f.length,v=this.option.size*(m+1),y=o.toCssColorString()+"-"+f;if(this._cache[y])return this._cache[y];let x=document.createElement("canvas");x.width=v,x.height=v;let C=x.getContext("2d"),w=v/24,A=v/2-m*this.option.fontSize/3,E=(v+this.option.fontSize)/2,T=-Math.PI/12,S=Math.PI/2,M=Math.PI/6;C.save(),C.scale(w,w),C.beginPath(),C.arc(12,12,6,0,2*Math.PI),C.fillStyle=o.toCssColorString(),C.fill(),C.closePath(),C.lineWidth=2;for(let I=0;I<3;I++)C.beginPath(),C.arc(12,12,8,T,T+S,!1),C.strokeStyle=o.withAlpha(.4).toCssColorString(),C.stroke(),C.arc(12,12,11,T,T+S,!1),C.strokeStyle=o.withAlpha(.2).toCssColorString(),C.stroke(),C.closePath(),T=T+S+M;return C.restore(),C.font=`bold ${this.option.fontSize}px sans-serif`,C.fillStyle=this.option.fontColor,C.fillText(f,A,E),this._cache[y]=x.toDataURL(),x.toDataURL()};xP.prototype._clusterEventHandler=function(o,f){if(!this.dataSource.clustering.enabled){this._cache={};return}if(f.billboard.show=!0,f.billboard.id=o,f.label.show=!1,f.billboard.disableDepthTestDistance=Number.POSITIVE_INFINITY,this.dataSource.entities.values.length){let m=this.dataSource.entities.values.length||0;for(let v in this.option.gradient)if(o.length>=m*v){let y=String(o.length);this.option.style==="circle"?f.billboard.image=this._drawCircle(this.option.gradient[v],y):f.billboard.image=this._drawClustering(this.option.gradient[v],y)}}};xP.prototype.readyCanvas=function(){for(let o=0;o<=100;o++)for(let f in this.option.gradient){let m=String(o);this.option.style==="circle"?this._drawCircle(this.option.gradient[f],m):this._drawClustering(this.option.gradient[f],m)}};xP.prototype.clear=function(){this.dataSource.entities.removeAll(),this._cache={}};xP.prototype.setVisibility=function(o){this.dataSource&&(this.dataSource.show=o)};xP.prototype.deleteObject=function(){this.clear(),this._viewer.dataSources.remove(this.dataSource),L_.destroyObject(this)};Object.defineProperties(xP.prototype,{enableCluster:{set:function(o){this.dataSource.clustering.enabled=o},get:function(){return this.dataSource.clustering.enabled}}});var YRi=xP;function qRi(o=0,f=0,m=0){this.lon=o,this.lat=f,this.height=m}var XRi=qRi;var Kst={draw_tip_left:"\u5DE6\u952E\u5F00\u59CB\u7ED8\u5236\uFF01",draw_tip_right:"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236\uFF01",draw_tip_click:"\u70B9\u51FB\u7EE7\u7EED\u7ED8\u5236\uFF01",draw_tip_cancel:"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88\uFF01",draw_tip_first_point:"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E00\u4E2A\u70B9",draw_tip_state:"\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F",draw_tip_info_radius:"\u534A\u5F84",unit_m:"\u7C73",unit_km:"\u5343\u7C73"};function ise(o){this._core=new Sr,this._lang=this._core.extend(Kst,o,!0)}ise.prototype.getStr=function(o){return this._lang[o]};ise.prototype.set=function(o){this._lang=this._core.extend(Kst,o,!0)};ise.prototype.get=function(){return this._lang};var Qst=ise;function y4(o,f,m){let v=new Y0(!1);this._core=new Sr(o._Viewer,m.Cesium),this.left=o,this.leftContainer=o._Viewer.container,this.leftContainer.style.width="50%",this.parentElement=this.leftContainer.parentElement,this._SmartEarth=m||null,this.createRightScreen(f),this.addEvenListener()}y4.prototype.createRightScreen=function(o){this.rightContainer=document.createElement("div"),this.rightContainer.id="SDKSecondaryScreen",this.rightContainer.style.cssText=` height: 100%; flex: 1; position: relative; `,this.parentElement.append(this.rightContainer),this.defaultStyle={display:this.parentElement.style.display,flexDirection:this.parentElement.style.flexDirection,flex:this.parentElement.style.flex},this.parentElement.style.display="flex",this.parentElement.style.flexDirection="row",this.parentElement.style.flex=1,this.right=new this._SmartEarth.EarthCtrl("SDKSecondaryScreen",o),this.right.camera.stop(),this.leftEvenListener()};y4.prototype.leftEvenListener=function(){this.right._Viewer.camera.setView({destination:this.left._Viewer.camera.position.clone(),orientation:{heading:this.left._Viewer.camera.heading,pitch:this.left._Viewer.camera.pitch,roll:this.left._Viewer.camera.roll}})};y4.prototype.rightEvenListener=function(){this.left._Viewer.camera.setView({destination:this.right._Viewer.camera.position.clone(),orientation:{heading:this.right._Viewer.camera.heading,pitch:this.right._Viewer.camera.pitch,roll:this.right._Viewer.camera.roll}})};var ED,TD;y4.prototype.addEvenListener=function(){this.leftContainer.onmouseover=()=>{ED||(ED=this.leftEvenListener.bind(this),this.left._Viewer.scene.preRender.addEventListener(ED)),TD&&this.right._Viewer.scene.preRender.removeEventListener(TD),TD=null},this.rightContainer.onmouseover=()=>{TD||(TD=this.rightEvenListener.bind(this),this.right._Viewer.scene.preRender.addEventListener(TD)),ED&&this.left._Viewer.scene.preRender.removeEventListener(ED),ED=null}};y4.prototype.removeEvenListener=function(){this.leftContainer.onmouseover=null,this.rightContainer.onmouseover=null,TD&&this.right._Viewer.scene.preRender.removeEventListener(TD),ED&&this.left._Viewer.scene.preRender.removeEventListener(ED),TD=null,ED=null};y4.prototype.destroy=function(){this.removeEvenListener(),this.rightContainer.remove(),this.left=null,this.right=null,this.parentElement.style.display=this.defaultStyle.display,this.parentElement.style.flexDirection=this.defaultStyle.flexDirection,this.parentElement.style.flex=this.defaultStyle.flex,this.leftContainer.style.width="100%"};var JRi=y4;function Qv(o,f){this._viewer=o,this.Cesium=f,this.czmlData=new Map,this.czmlJson=[]}Qv.prototype.get=function(o){return this.czmlData.get(o)};Qv.prototype.flyTo=function(o,f=!1){this.dataSource?f?this._viewer.flyTo(this.dataSource.entities):this._viewer.flyTo(this.dataSource.entities.getById(o)):this._viewer.flyTo(this.get(o))};Qv.prototype.trackedEntity=function(o){if(this.dataSource)this._viewer.trackedEntity=this.dataSource.entities.getById(o);else{let f=this.get(o);this._viewer.trackedEntity=f.entities.getById(o)}};Qv.prototype.delete=function(o){if(this.dataSource)this._viewer.dataSources.remove(this.dataSource),this.dataSource=void 0,this.czmlJson=[],this.czmlData=new Map;else{let f=this.czmlData.get(o);this._viewer.dataSources.remove(f),this.czmlData.delete(o)}};Qv.prototype.deleteAll=function(){if(this.dataSource)this._viewer.dataSources.remove(this.dataSource),this.dataSource=void 0,this.czmlJson=[],this.czmlData=new Map;else{for(let o of this.czmlData.values())this._viewer.dataSources.remove(o);this.czmlData=new Map}};Qv.prototype.getThisPlayTime=function(){let o=this._viewer.clock.currentTime.secondsOfDay,f=this._viewer.clock.startTime.secondsOfDay;return o-f};Qv.prototype.init=function(o,f,m={}){let v={gltf:m.modelUrl||"http://183.162.245.49:18076/sdkdemo_2022/SmartEarthSDK/Workers/Model/xiaoche.glb",runAnimations:!0,scale:m.modelScale||1,minimumPixelSize:m.minimumPixelSize},y=[{id:"document",name:"czmlPathAnimation",version:"1.0",clock:{interval:"2021-01-01T00:00:00Z/2021-01-02T00:00:00Z",currentTime:"2021-01-01T00:00:00Z",multiplier:1}}],x=this.getThisPlayTime(),C={lon:f.lon,lat:f.lat,height:f.alt||f.height||0};y.push({path:{show:m.showPath===void 0?!1:m.showPath,leadTime:0,trailTime:1e5,width:this.Cesium.defaultValue(m.pathWidth,3),resolution:1,material:{polylineGlow:{glowPower:.3,taperPower:1,color:{rgba:m.color||[255,255,0,255]}}}},id:o,position:{interpolationAlgorithm:"LINEAR",interpolationDegree:1,forwardExtrapolationType:"HOLD",backwardExtrapolationType:"HOLD",epoch:"2021-01-01T00:00:00Z",cartographicDegrees:[x,C.lon,C.lat,C.height,86400,C.lon,C.lat,C.height]},orientation:{velocityReference:"#position"},model:v});let w=new this.Cesium.CzmlDataSource;return this._viewer.dataSources.add(w),w.prePosition=C,this.czmlData.set(o,w),w.process(y).then(A=>{let E=A.entities.getById(o);E.propData=m.propData,this._viewer.clock.currentTime=this.Cesium.JulianDate.addSeconds(this._viewer.clock.startTime.clone(),x,new this.Cesium.JulianDate),m.callback&&m.callback(w)}),w};Qv.prototype.update=function(o,f,m=1){let v=this.get(o),y=this.getThisPlayTime(),x={lon:f.lon,lat:f.lat,height:f.alt||f.height||0},C={lon:x.lon-v.prePosition.lon,lat:x.lat-v.prePosition.lat,height:x.height-v.prePosition.height},w=[{id:o,position:{epoch:"2021-01-01T00:00:00Z",cartographicDegrees:[y+m,x.lon,x.lat,x.height,86400,x.lon+C.lon,x.lat+C.lat,x.height+C.height]}}];v.prePosition=x,v&&v.process(w)};Qv.prototype.create=function(o,f,m={}){let v={lon:this.Cesium.defaultValue(f.lon,120),lat:this.Cesium.defaultValue(f.lat,40),height:f.alt||f.height||0},y=[{id:"document",version:"1.0"}];if(m.clock&&(y[0].clock=m.czmlClock),m.czml)y=m.czml;else if(o&&f){let x=this.Cesium.Cartesian3.fromDegrees(v.lon,v.lat,v.height),C={id:o,availability:m.availability,description:m.description,position:this.getCzmlJson("position",m.position,x),orientation:this.getCzmlJson("orientation",m.orientation,x),parent:m.parent,billboard:this.getCzmlJson("billboard",m.billboard),label:this.getCzmlJson("label",m.label),model:this.getCzmlJson("model",m.model),path:this.getCzmlJson("path",m.path),prePosition:v};y.push(C)}return this.dataSource?this.dataSource.process(y).then(x=>{m.callback&&m.callback(x)}):(this.dataSource=new this.Cesium.CzmlDataSource,this._viewer.dataSources.add(this.dataSource),this.dataSource.process(y).then(x=>{m.callback&&m.callback(x)}),this.czmlData.set(o,this.dataSource)),this.czmlJson.push(y),this.dataSource};Qv.prototype.getCzmlJson=function(o,f,m){let v=this.Cesium;if(o==="billboard"&&f){let y=f;return{show:y.show,image:y.image,scale:y.scale,pixelOffset:this.getAttributeJson("cartesian2",y.pixelOffset),eyeOffset:this.getAttributeJson("cartesian3",y.eyeOffset),horizontalOrigin:this.getAttributeJson("verticalOrigin",y.horizontalOrigin),verticalOrigin:this.getAttributeJson("verticalOrigin",y.verticalOrigin),heightReference:this.getAttributeJson("heightReference",y.verticalOrigin),color:this.getAttributeJson("color",y.color),rotation:y.rotation,alignedAxis:this.getAttributeJson("cartesian3",y.alignedAxis),sizeInMeters:y.sizeInMeters,width:y.width,height:y.height,scaleByDistance:this.getAttributeJson("nearFarScalar",y.scaleByDistance),translucencyByDistance:this.getAttributeJson("nearFarScalar",y.translucencyByDistance),pixelOffsetScaleByDistance:this.getAttributeJson("nearFarScalar",y.pixelOffsetScaleByDistance),imageSubRegion:this.getAttributeJson("boundingRectangle",y.imageSubRegion),distanceDisplayCondition:this.getAttributeJson("distanceDisplayCondition",y.distanceDisplayCondition),disableDepthTestDistance:y.disableDepthTestDistance}}else if(o==="label"&&f){let y=f;return{show:y.show,text:y.text,font:y.font,style:this.getAttributeJson("labelStyle",y.style),scale:y.scale,showBackground:y.showBackground,backgroundColor:this.getAttributeJson("color",y.backgroundColor),backgroundPadding:this.getAttributeJson("cartesian2",y.backgroundPadding),pixelOffset:this.getAttributeJson("cartesian2",y.pixelOffset),eyeOffset:this.getAttributeJson("cartesian3",y.eyeOffset),horizontalOrigin:this.getAttributeJson("verticalOrigin",y.horizontalOrigin),verticalOrigin:this.getAttributeJson("verticalOrigin",y.verticalOrigin),heightReference:this.getAttributeJson("heightReference",y.verticalOrigin),fillColor:this.getAttributeJson("color",y.fillColor),outlineColor:this.getAttributeJson("color",y.outlineColor),outlineWidth:y.outlineWidth,translucencyByDistance:this.getAttributeJson("nearFarScalar",y.translucencyByDistance),pixelOffsetScaleByDistance:this.getAttributeJson("nearFarScalar",y.pixelOffsetScaleByDistance),scaleByDistance:this.getAttributeJson("nearFarScalar",y.scaleByDistance),distanceDisplayCondition:this.getAttributeJson("distanceDisplayCondition",y.distanceDisplayCondition),disableDepthTestDistance:y.disableDepthTestDistance}}else if(o==="path"&&f){let y=f;return{show:v.defaultValue(y.show,!1),leadTime:v.defaultValue(y.leadTime,0),trailTime:v.defaultValue(y.trailTime,86400),width:v.defaultValue(y.width,3),resolution:v.defaultValue(y.resolution,1),material:this.getAttributeJson("pathMaterial",y),distanceDisplayCondition:this.getAttributeJson("distanceDisplayCondition",y.distanceDisplayCondition)}}else if(o==="model"&&f){let y=f;return{show:y.show,gltf:v.defaultValue(y.url,"http://183.162.245.49:18076/sdkdemo_2022/SmartEarthSDK/Workers/Model/xiaoche.glb"),scale:y.scale,minimumPixelSize:y.minimumPixelSize,maximumScale:y.maximumScale,incrementallyLoadTextures:y.incrementallyLoadTextures,runAnimations:y.runAnimations,clampAnimations:y.clampAnimations,shadows:this.getAttributeJson("shadowMode",y.shadows),heightReference:this.getAttributeJson("heightReference",y.heightReference),silhouetteColor:this.getAttributeJson("color",y.silhouetteColor),silhouetteSize:y.silhouetteSize,color:this.getAttributeJson("color",y.color),colorBlendMode:this.getAttributeJson("colorBlendMode",y.colorBlendMode),colorBlendAmount:y.colorBlendAmount,imageBasedLightingFactor:this.getAttributeJson("cartesian2",y.imageBasedLightingFactor),lightColor:this.getAttributeJson("color",y.lightColor),distanceDisplayCondition:this.getAttributeJson("distanceDisplayCondition",y.distanceDisplayCondition)}}else if(o==="orientation")if(f&&!f.custom){let y=f,x=v.JulianDate.toIso8601(this._viewer.clock.currentTime);return{epoch:v.defaultValue(y.startTime,x),interpolationAlgorithm:y.interpolationAlgorithm,interpolationDegree:y.interpolationDegree,forwardExtrapolationType:v.defaultValue(y.forwardExtrapolationType,"HOLD"),forwardExtrapolationDuration:y.forwardExtrapolationDuration,backwardExtrapolationType:v.defaultValue(y.backwardExtrapolationType,"HOLD"),backwardExtrapolationDuration:y.backwardExtrapolationDuration,unitQuaternion:this.getAttributeJson("unitQuaternion",y,m)}}else return f&&f.custom?f:{velocityReference:"#position"};else if(o==="position"){let y=v.JulianDate.toIso8601(this._viewer.clock.currentTime);if(f&&!f.custom){let x=f;return{epoch:v.defaultValue(x.startTime,y),interpolationAlgorithm:x.interpolationAlgorithm,interpolationDegree:x.interpolationDegree,forwardExtrapolationType:x.forwardExtrapolationType,forwardExtrapolationDuration:x.forwardExtrapolationDuration,backwardExtrapolationType:x.backwardExtrapolationType,backwardExtrapolationDuration:x.backwardExtrapolationDuration,cartesian:[0,m.x,m.y,m.z]}}else return f&&f.custom?f:{epoch:y,cartesian:[0,m.x,m.y,m.z],forwardExtrapolationType:"HOLD",backwardExtrapolationType:"HOLD"}}};Qv.prototype.getAttributeJson=function(o,f,m){if(o==="verticalOrigin"&&f){if(f===0)return"CENTER";if(f===1)return"BOTTOM";if(f===2)return"BASELINE";if(f===-1)return"TOP"}else if(o==="horizontalOrigin"&&f){if(f===0)return"CENTER";if(f===1)return"LEFT";if(f===-1)return"RIGHT"}else if(o==="labelStyle"&&f){if(f===0)return"FILL";if(f===1)return"OUTLINE";if(f===2)return"FILL_AND_OUTLINE"}else{if(o==="color"&&f&&typeof f.red=="number"&&typeof f.green=="number"&&typeof f.blue=="number"&&typeof f.alpha=="number")return{rgba:[f.red*255,f.green*255,f.blue*255,f.alpha*255]};if(o==="cartesian2"&&f&&typeof f.x=="number"&&typeof f.y=="number")return{cartesian2:[f.x,f.y]};if(o==="cartesian3"&&f&&typeof f.x=="number"&&typeof f.y=="number"&&typeof f.z=="number")return{cartesian:[f.x,f.y,f.z]};if(o==="heightReference"&&f){if(f===0)return"NONE";if(f===1)return"CLAMP_TO_GROUND";if(f===2)return"RELATIVE_TO_GROUND"}else{if(o==="nearFarScalar"&&f&&typeof f.near=="number"&&typeof f.nearValue=="number"&&typeof f.far=="number"&&typeof f.farValue=="number")return{nearFarScalar:[f.near,f.nearValue,f.far,f.farValue]};if(o==="distanceDisplayCondition"&&f&&typeof f.near=="number"&&typeof f.far=="number")return{distanceDisplayCondition:[f.near,f.far]};if(o==="boundingRectangle"&&f&&typeof f.x=="number"&&typeof f.y=="number"&&typeof f.width=="number"&&typeof f.height=="number")return{boundingRectangle:[f.x,f.y,f.width,f.height]};if(o==="shadowMode"&&f){if(f===0)return"DISABLED";if(f===1)return"ENABLED";if(f===2)return"CAST_ONLY";if(f===3)return"RECEIVE_ONLY"}else if(o==="colorBlendMode"&&f){if(f===0)return"HIGHLIGHT";if(f===1)return"REPLACE";if(f===2)return"MIX"}else if(o==="pathMaterial"){let v=f;return v.color?{polylineGlow:{glowPower:1,taperPower:1,color:this.getAttributeJson("color",v.color)}}:v.materialType?{[v.materialType]:this.getAttributeJson(v.materialType,v.material)}:{polylineGlow:{glowPower:.5,taperPower:1,color:{rgba:[255,255,0,255]}}}}else if(o==="unitQuaternion"&&f)if(typeof f.heading=="number"||typeof f.pitch=="number"||typeof f.roll=="number"){let v=this.Cesium.HeadingPitchRoll.fromDegrees(f.heading||0,f.pitch||0,f.roll||0),y=this.Cesium.Transforms.headingPitchRollQuaternion(m,v);if(y)return[0,y.x,y.y,y.z,y.w]}else{if(f.quaternion)return[0,f.quaternion.x,f.quaternion.y,f.quaternion.z,f.quaternion.w];if(f.unitQuaternion)return f.unitQuaternion}else if(f){let v=this.getAttributeJson("color",f.color),y=this.getAttributeJson("color",f.outlineColor),x=f.outlineWidth;return{color:v,outlineColor:y,outlineWidth:x}}else if(f){let v=this.getAttributeJson("color",f.color),y=f.glowPower,x=f.taperPower;return{color:v,glowPower:y,taperPower:x}}else if(f)return{color:this.getAttributeJson("color",f.color)}}}};Qv.prototype.updateCZML=function(o){let{id:f,position:m,orientation:v,updateTime:y,customProcessData:x,time:C}=o,w=this.Cesium,A=-1,E=this.czmlJson.length;for(let D=0;D<E;D++)this.czmlJson[D][1].id===f&&(A=D);if(A===-1)return;y||(y=this._viewer.clock.currentTime);let T={lon:m.lon,lat:m.lat,height:m.alt||m.height||0},S=w.JulianDate.fromIso8601(this.czmlJson[A][1].position.epoch),M=w.JulianDate.secondsDifference(y,S)+C||1,I=w.Cartesian3.fromDegrees(T.lon,T.lat,T.height),P=[{id:f,position:{epoch:this.czmlJson[A][1].position.epoch,cartesian:[M,I.x,I.y,I.z],interpolationAlgorithm:m.interpolationAlgorithm,interpolationDegree:m.interpolationDegree,forwardExtrapolationType:w.defaultValue(m.forwardExtrapolationType,"HOLD"),forwardExtrapolationDuration:m.forwardExtrapolationDuration,backwardExtrapolationType:w.defaultValue(m.backwardExtrapolationType,"HOLD"),backwardExtrapolationDuration:m.backwardExtrapolationDuration}}];if(v){let D=w.HeadingPitchRoll.fromDegrees(v.heading||0,v.pitch||0,v.roll||0),L=w.Transforms.headingPitchRollQuaternion(I,D);P[0].orientation={epoch:this.czmlJson[A][1].position.epoch,unitQuaternion:[M,L.x,L.y,L.z,L.w],interpolationAlgorithm:v.interpolationAlgorithm,interpolationDegree:v.interpolationDegree,forwardExtrapolationType:w.defaultValue(v.forwardExtrapolationType,"HOLD"),forwardExtrapolationDuration:v.forwardExtrapolationDuration,backwardExtrapolationType:w.defaultValue(v.backwardExtrapolationType,"HOLD"),backwardExtrapolationDuration:v.backwardExtrapolationDuration}}x&&(P=x),this.czmlJson[A][1].prePosition=T,this.dataSource.process(P)};Qv.prototype.toDegrees=function(o){let f=Cesium.Cartographic.fromCartesian(o);return{lon:Cesium.Math.toDegrees(f.longitude),lat:Cesium.Math.toDegrees(f.latitude),height:f.height}};Qv.prototype.pick=function(o){this.endPick(),this.pickHandler=new this.Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);let f;this.pickHandler.setInputAction(m=>{f=this._viewer.scene.pick(m.endPosition),f&&f.id&&this.get(f.id.id)&&o&&o(f)},this.Cesium.ScreenSpaceEventType.LEFT_CLICK)};Qv.prototype.endPick=function(){this.pickHandler.destroy(),this.pickHandler=void 0};var Zst=Qv;var Z6=null;function DT(o,f={},m){Z6=m||window.Cesium,this.sgworld=o,this.contourUniforms=void 0,this.shadingUniforms=void 0,this.min={elevation:10,slope:0},this.max={elevation:2e3,slope:70},this.width=f.width||2,this.spacing=f.spacing||150,this.tf=!1,this.contourColor=f.contourColor||"#ff0000",this.type="none",this.Contour=void 0,this.startColor=f.startColor||"#0055ff",this.endColor=f.endColor||"#ff0000",this.colorArr=this.sgworld.core.gradientColor(this.startColor,this.endColor,7),this.changeSlopeColor=f.changeSlopeColor!==void 0?f.changeSlopeColor:!1}DT.prototype.render=function(){this.type==="slope"?(Z6.ExpandBySmartEarth.displaySlopeMap=!0,this.changeSlopeColor&&this.setShopeColor()):Z6.ExpandBySmartEarth.displaySlopeMap=!1,this.Contour=this.sgworld.analysis.createElevationContour(this.tf,this.type==="slope"?"none":this.type,{colorArr:this.colorArr,min:this.min[this.type],max:this.max[this.type],width:this.width,spacing:this.spacing,lineColor:this.contourColor}),this.shadingUniforms=this.Contour.item.shadingUniforms,this.contourUniforms=this.Contour.item.contourUniforms};DT.prototype.setContourColor=function(o){this.contourColor=o,this.Contour&&this.Contour.setMaterialColor(this.contourColor)};DT.prototype.setShopeColor=function(){let o=[],f=[0,6,17,31,45,70,90];this.colorArr.forEach((m,v)=>{o.unshift({val:100*Math.cos(Z6.Math.toRadians(f[v])),color:m})}),Z6.ExpandBySmartEarth.SlopeMapPallete=o,Z6.ExpandBySmartEarth.isSlopeDirty=!0};DT.prototype.setWidth=function(o){this.width=o,this.Contour&&this.Contour.setWidth(this.width)};DT.prototype.setSpacing=function(o){this.spacing=o,this.Contour&&this.Contour.setSpacing(this.spacing)};DT.prototype.setStartColor=function(o){this.startColor=o,this.colorArr=this.sgworld.core.gradientColor(this.startColor,this.endColor,7),this.render()};DT.prototype.setEndColor=function(o){this.endColor=o,this.colorArr=this.sgworld.core.gradientColor(this.startColor,this.endColor,7),this.render()};DT.prototype.setMin=function(o){this.min[this.type]=o,this.type==="elevation"?this.shadingUniforms.minimumHeight=this.min[this.type]:this.render()};DT.prototype.setMax=function(o){this.max[this.type]=o,this.type==="elevation"?this.shadingUniforms.maximumHeight=this.max[this.type]:this.render()};DT.prototype.reset=function(){this.contourColor="#ff0000",this.startColor="#0055ff",this.endColor="#ff0000",this.colorArr=this.sgworld.core.gradientColor(this.startColor,this.endColor,7),this.render()};var KRi=DT;hb.prototype.getRenderedBestLevelInfo=function(){let o=this.getRenderedLevelInfo(),f=0;for(let m in o)f<Number(m)&&(f=Number(m));return{bestLevel:f,count:o[f]}};hb.prototype.getRenderedLevelInfo=function(){let o=[];return this._tilesToRender.forEach(function(f){o[f.level]===void 0&&(o[f.level]=0),o[f.level]++}),o};function QRi(o,f,m){let v=pd();function y(x){o.ready?Promise.resolve(elt(o,f,x)).then(function(C){v.resolve(C)}):setTimeout(y,10)}return kh.typeOf.object("terrainProvider",o),kh.defined("positions",f),y(m),v.promise}function ZRi(o,f){for(let m=0;m<o.children.length;m++)if(o.children[m].state>=Ch.DONE&&(o.children[m].data.terrainData._mesh!==void 0||o.children[m].data.terrainData._buffer!==void 0)&&o.children[m].x===f.x&&o.children[m].y===f.y)return o.children[m]}function $Ri(o,f,m){let v=o.tilingScheme,y=v.positionToTileXY(f,0),x=m.scene.globe._surface.tileProvider.quadtree._levelZeroTiles,C=x[0].x===y.x&&x[0].y===y.y?x[0]:x[1];for(let w=1;w<22;w++){y=v.positionToTileXY(f,w);let A=ZRi(C,y);if(A===void 0)break;C=A}return C}function e3i(o,f){kh.defined("positions",o);let m=pd();return Promise.resolve($st(o,f)).then(function(v){m.resolve(v)}),m.promise}function $st(o,f,m){let v;for(v=0;v<o.length;++v){let y=o[v],x=y instanceof Mt,C=x?y:Mt.fromCartesian(y);if(C.height=65535,!x){let w=H.fromRadiansArrayHeights([C.longitude,C.latitude,C.height])[0];y.z=w.z}}return o}function elt(o,f,m){let v;for(v=0;v<f.length;++v){let y=f[v],x=$Ri(o,y,m);y.height=x.data.terrainData.interpolateHeight(x.rectangle,y.longitude,y.latitude)}return f}function x4(o){this.value=new Float32Array([o])}x4.fromZBias=function(o){if(!N(o))throw new li("zbias is required.");return new x4(o)};x4.toValue=function(o,f){if(!N(o))throw new li("zbias is required.");return N(f)?color.toBytes(f):new Float32Array(o)};x4.equals=function(o,f){return o===f||N(o)&&N(f)&&o.value[0]===f.value[0]};x4.defaultBias=function(){return x4.fromZBias(15e-6)};var FWi=x4,IX={TERRAIN:2,MESH:4,FLOOR:8},Yst=function(o){return o===void 0&&(o=0),new H(.001234321,0,o)},dMe=function(o,f,m){let v={TERRAIN:2,MESH:4,FLOOR:8};f===void 0&&(f=v.TERRAIN|v.MESH);let y=pd(),x=[];f>v.TERRAIN?o.forEach(function(A){x.push(Mt.fromRadians(A.longitude,A.latitude,A.height))}):x=o;let C=[];f&v.TERRAIN&&C.push(QRi(m.terrainProvider,o,m));let w=(f&v.FLOOR)>0;return f&(v.MESH|v.FLOOR)&&C.push(e3i(x,w)),Promise.all(C).then(function(A){if(C.length>1)for(let E=0;E<o.length;E++){let T=A[0][E],S=A[1][E];S.height!==65535&&(T.height<S.height||w)&&(T.height=S.height)}y.resolve(A[0])}),y.promise},BWi=function(o,f){kh.defined("positions",o);let m=pd();return Promise.resolve($st(o,f)).then(function(v){m.resolve(v)}),m.promise},kWi=function(o,f){let m=pd();function v(){o.ready?Promise.resolve(elt(o,f)).then(function(y){m.resolve(y)}):setTimeout(v,10)}return kh.typeOf.object("terrainProvider",o),kh.defined("positions",f),v(),m.promise},VWi=Jr?.fetchText,zWi=Jr?.fetchJson,HWi=Jr?.fetchBlob,UWi=Jr?.fetchArrayBuffer,GWi=Jr?.fetchImage;globalThis.SmartEarthPopupData={};function tlt(){new Y0(!1).addJs(document.body,`${globalThis.SmartEarthRootUrl}Workers/layui/lay/modules/layer.js`),globalThis.layuiLayer=globalThis.layer}globalThis.language=new Qst;var t3i=function(o){let f=new Array;f.remove=function(m){if(isNaN(m)||m>this.length)return!1;this.splice(m,1)},f.clear=function(m){for(let v=0;v<f.length;v++)(!m||f[v].o===m&&f[v].f)&&f.remove(v)},this.addEventHandler=function(m,v){for(let y=0;y<f.length;y++){if(f[y].o===m&&f[y].f===v)return;f.push({o:m,f:v})}f.length===0&&f.push({o:m,f:v})},this.removeEventHandler=function(m,v){for(let y=0;y<f.length;y++)f[y].o===m&&f[y].f===v&&f.remove(y)},this.clearEventHandler=function(m){f.clear(m)},this.notifyEvent=function(m,v,y){for(let x=0;x<f.length;x++)f[x].f(m,f[x].o,v,y)}},C4=t3i;function NO(o){let f=H.fromDegrees(o._longitude,o._latitude,o._altitude),m=new dl(o._heading*Math.PI/180,o._pitch*Math.PI/180,o._roll*Math.PI/180),v=tn.localFrameToFixedFrameGenerator("north","west");o._modelMatrix=tn.headingPitchRollToFixedFrame(f,m,ki.WGS84,v,o._modelMatrix)}var rse=class{constructor(){this._longitude=0,this._latitude=0,this._altitude=0,this._heading=0,this._pitch=0,this._roll=0,this._batchUpdate=!1,this._modelMatrix=new Ee}createFromWgs84(f,m,v,y,x,C){this._longitude=Z(f,0),this._latitude=Z(m,0),this._altitude=Z(v,0),this._heading=Z(y,0),this._pitch=Z(x,0),this._roll=Z(C,0),NO(this),this._batchUpdate=!1}beginUpdate(){this._batchUpdate=!0}endUpdate(){this._batchUpdate===!0&&(NO(this),this._batchUpdate=!1)}};Object.defineProperties(rse.prototype,{modelMatrix:{get:function(){return this._modelMatrix},set:function(o){this._modelMatrix=o}},longitude:{get:function(){return this._longitude},set:function(o){this._longitude=o,this._batchUpdate||NO(this)}},latitude:{get:function(){return this._latitude},set:function(o){this._latitude=o,this._batchUpdate||NO(this)}},altitude:{get:function(){return this._altitude},set:function(o){this._altitude=o,this._batchUpdate||NO(this)}},heading:{get:function(){return this._heading},set:function(o){this._heading=o,this._batchUpdate||NO(this)}},pitch:{get:function(){return this._pitch},set:function(o){this._pitch=o,this._batchUpdate||NO(this)}},roll:{get:function(){return this._roll},set:function(o){this._roll=o,this._batchUpdate||NO(this)}}});var RX=rse;function i3i(o){return document.querySelector(o)}function rp(o,f){let m=i3i(o);if(m){if(f.nodeType===1||f.nodeType===11||f.nodeType===9)m.appendChild(f);else if(typeof f=="string"){let v=document.createElement("div");v.innerHTML=f,m.appendChild(v)}}else console.error(`no selector named ${o}`)}function OX(o,f){this.earthCtrl=o,this.coreMap=o.coreMap,this._parameter=Z(f,Z.EMPTY_OBJECT),this.tooltip=null,this.style=null,this._show=!1,this._showAt=null,this._x=null,this._y=null,this._color=null,this.id=null,this.initialize()}OX.prototype.initialize=function(){let o=this._parameter;o&&o.style&&typeof o.style=="object"&&(this.style=o.style),this.style&&this.style.origin?(this.style.origin==="center"&&(this._x=15,this._y=-12),this.style.origin==="top"&&(this._x=15,this._y=-44),this.style.origin==="bottom"&&(this._x=15,this._y=20)):(this._x=15,this._y=20),this.style&&this.style.color?(this.style.color==="white"&&(this._color="background: rgba(255, 255, 255, 0.8);color: black;"),this.style.color==="black"&&(this._color="background: rgba(0, 0, 0, 0.5);color: white;"),this.style.color==="yellow"&&(this._color="color: black;background-color: #ffcc33;border: 1px solid white;")):this._color="background: rgba(0, 0, 0, 0.5);color: white;",this.style&&this.style.id?this.id=`toolTip${this.style.id}`:this.id="toolTip";let f=document.getElementById(this.id);if(!f){let m=document.createElement("div");rp(".map-widget",m);let v=`<div id="${this.id}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${this._color}"></div>`;rp(".map-widget",v),f=document.getElementById(this.id)}o&&o.show?(f.innerHTML=this.style.html,f.style.left=`${this.style.position.x+this._x}px`,f.style.top=`${this.style.position.y+this._y}px`,f.style.display="block"):f.style.display="none",this._show=o.show,this.tooltip=f,this.showAts()};OX.prototype.showFun=function(o){o?this.tooltip.style.display="block":this.tooltip.style.display="none"};OX.prototype.showAts=function(o){o||(o={text:`${this.earthCtrl.language.TOOLTIP_DEFAULT_TEXT}`,position:{x:500,y:500}}),this.tooltip.innerHTML=o.text,this.style&&this.style.origin?(this.style.origin==="center"&&(this._x=15,this._y=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(this._x=15,this._y=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(this._x=15,this._y=20)):(this._x=15,this._y=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${o.position.x+this._x}px`,this.tooltip.style.top=`${o.position.y+this._y}px`,this.tooltip.style.display="block"};Object.defineProperties(OX.prototype,{show:{get:function(){return this._show},set:function(o){this.showFun(o),this._show=o}},showAt:{get:function(){return this._showAt},set:function(o){o&&(this.showAts(o),this._showAt=o)}}});var ilt=OX;function vMe(o,f,m){if(o&&f){o[0]!=="#"&&(o=this.colorHex(o)),f[0]!=="#"&&(f=this.colorHex(f));let v=this.colorRgb(o),y=v[0],x=v[1],C=v[2],w=this.colorRgb(f),A=w[0],E=w[1],T=w[2],S=(A-y)/m,M=(E-x)/m,I=(T-C)/m,P=[];for(let D=0;D<m;D++){let L=this.colorHex(`rgb(${parseInt(S*D+y)},${parseInt(M*D+x)},${parseInt(I*D+C)})`);P.push(L)}return P}return this}vMe.prototype.colorRgb=function(o){let f,m=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(o=o.toLowerCase(),o&&m.test(o)){if(o.length===4){let y="#";for(f=1;f<4;f+=1)y+=o.slice(f,f+1).concat(o.slice(f,f+1));o=y}let v=[];for(f=1;f<7;f+=2)v.push(parseInt(`0x${o.slice(f,f+2)}`));return v}return o};vMe.prototype.colorHex=function(o){let f,m=o,v=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(m)){let y=m.replace(/(rgb|RGB)*/g,"");y=y.replace("(","").replace(")","");let x=y.split(","),C="#";for(f=0;f<x.length;f++){let w=Number(x[f]).toString(16);w=w.length===1?`${0}${w}`:w,w==="0"&&(w+=w),C+=w}return C.length!==7&&(C=m),C}else if(v.test(m)){let y=m.replace(/#/,"").split("");if(y.length===6)return m;if(y.length===3){let x="#";for(f=0;f<y.length;f+=1)x+=y[f]+y[f];return x}}else return m};var rlt=vMe;function lm(o){this.earthCtrl=o,this._sgCore=new Sr(o.viewer,qi)}Object.defineProperties(lm.prototype,{inner:{get:function(){return this._sgCore}}});lm.prototype.getOffsetTilingScheme=function(o){return this._sgCore.getOffsetTilingScheme(o)};lm.prototype.addPickStage=function(o,f){return this._sgCore.addPickStage(o,f)};lm.prototype.extend=function(o,f,m=!1,v=!1){return this._sgCore.extend(o,f,m,v)};lm.prototype.xhr=function(o){this._sgCore.xhr(o)};lm.prototype.gradientColor=function(o,f,m){return this._sgCore.gradientColor()};lm.prototype.createTooltip=function(o){return new ilt(this.earthCtrl,o)};lm.prototype.mouse=function(o,f,m){f===1?o.style.cursor=`url(${m}),auto`:o.style.cursor="default"};lm.prototype.activeTool=function(o){this.tools.hasOwnProperty(o)&&this.tools[o].onActive()};lm.prototype.deactiveTool=function(o){this.tools.hasOwnProperty(o)&&this.tools[o].onDeactive()};lm.prototype.deactiveAllTool=function(){for(let o in this.tools)this.tools.hasOwnProperty(o)&&o.onDeactive()};lm.prototype.clearResult=function(){let o=this;for(let f in o.tools)o.tools.hasOwnProperty(f)&&o.tools[f].clearResult()};lm.prototype.uuid=function(o,f){let m="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),v=[],y;if(f=f||m.length,o)for(y=0;y<o;y++)v[y]=m[0|Math.random()*f];else{let x;for(v[8]=v[13]=v[18]=v[23]="-",v[14]="4",y=0;y<36;y++)v[y]||(x=0|Math.random()*16,v[y]=m[y===19?x&3|8:x])}return v.join("")};lm.prototype.clearTool=function(){let o=this;for(let f in o.tools)if(o.tools.hasOwnProperty(f)){let m=o.tools[f];m.onDeactive(),m.destory()}this.tools={}};lm.prototype.gradientColor=function(o,f,m){return new rlt(o,f,m)};lm.prototype.toDegrees=function(o){let f=Mt.fromCartesian(o);return{lon:xe.toDegrees(f.longitude),lat:xe.toDegrees(f.latitude),height:f.height}};lm.prototype.getCenterOfMass=function(o){let f=[],m=0;if(o[0].x){let x;o.forEach(C=>{x=this.toDegrees(C),f.push([x.lon,x.lat]),m+=x.height})}else o[0].lon?o.forEach(x=>{f.push([x.lon,x.lat]),m+=x.height||0}):Array.isArray(o[0])&&(f=o,o.forEach(x=>{m+=x[2]||0}));let v=ra.polygon([f]),y=ra.pointOnFeature(v);return m/=o.length,y.geometry.coordinates[2]=m,y.geometry.coordinates};lm.prototype.openLocalFile=function(o){return this._sgCore.openLocalFile(o)};lm.prototype.openShapeFile=function(o,f){return this._sgCore.openShapeFile(o,f)};lm.prototype.trackedEntity=function(o,f,m={}){return this._sgCore.trackedEntity(o,f,m)};lm.prototype.LineInterpolation=function(o,f){return this._sgCore.LineInterpolation(o,f)};var PC=lm;var nse=class{constructor(f){this._earthCtrl=null,this._coreMap=null,this._name="",this._id="",this._userId="",this._rtti="BaseObject",this._earthCtrl=f,this._coreMap=f.coreMap}finalize(){}addToMap(){}removeFromMap(){}};Object.defineProperties(nse.prototype,{id:{get:function(){return this._id},set:function(o){this._id=o}},name:{get:function(){return this._name},set:function(o){this._name=o}},userId:{get:function(){return this._userId},set:function(o){this._userId=o}},rtti:{get:function(){return this._rtti}}});var Dm=nse;var ose=class extends Dm{constructor(f){super(f),this.mCoreMap=f.coreMap,this._childNodes=[],this._childNodeMap={},this._show=!0,this._parentNode=null}finalize(){this._parentNode=null,this._childNodes=[],this._childNodeMap={}}getChildCount(){return this._childNodes.length}getChildById(f){return this._childNodeMap.hasOwnProperty(f)?this._childNodeMap[f]:null}getChildByName(f){for(let m in this._childNodeMap)if(this._childNodeMap[m].name===f)return this._childNodeMap[m];return null}getChildByIndex(f){return this._childNodes[f]}addChild(f){return this._childNodeMap.hasOwnProperty(f.id)?!1:(f.parentNode=this,this._childNodes.push(f),this._childNodeMap[f.id]=f,!0)}removeChildById(f){if(!this._childNodeMap.hasOwnProperty(f))return!1;this._childNodeMap[f].parentNode=null,delete this._childNodeMap[f];for(let m=0;m<this._childNodes.length;m++)if(this._childNodes[m].id===f){this.childNodes.splice(m,1);break}return!0}removeChild(f){return this.removeChildById(f.id)}removeChildByIndex(f){let m=this._childNodes[f];return this.removeChild(m)}removeAll(){this._childNodes=[],this._childNodeMap={}}};Object.defineProperties(ose.prototype,{parentNode:{get:function(){return this._parentNode},set:function(o){this._parentNode=o}},childNodes:{get:function(){return this._childNodes}},show:{get:function(){return this._show},set:function(o){this._show=o}}});var $6=ose;var yMe=class{constructor(f,m,v){this.mEarthCtrl=null,this.mCoreMap=null,this.name="Tool",this.mEnable=!0,this.mLeftButtonDown=!1,this.mMidButtonDown=!1,this.mRightButtonDown=!1,this.mShiftDown=!1,this.mCtrlDown=!1,this.mAltDown=!1,this.mLeftButtonDrag=!1,this.mMidButtonDrag=!1,this.mRightButtonDrag=!1,this.mLastMouseDownTime=0,this.mCallback=null,this.mEarthCtrl=f,this.mCoreMap=f.coreMap,this.mCallback=m,this.mEnable=v!==void 0?v:!0,this.mRenderObjectSet={},this.position=new Ye,this.startPosition=new Ye,this.endPosition=new Ye}destory(){}clearResult(){}onActive(){this.mEnable=!0}onDeactive(){this.mEnable=!1,N(this.mPoly)&&this.mPoly.destory()}onInputMessage(f){if(this.mEnable===!1)return;function m(v,y){switch(N(v.position)&&(y.position=Ye.fromElements(v.position.x,v.position.y,y.position)),N(v.startPosition)&&(y.startPosition=Ye.fromElements(v.startPosition.x,v.startPosition.y,y.startPosition)),N(v.endPosition)&&(y.endPosition=Ye.fromElements(v.endPosition.x,v.endPosition.y,y.endPosition)),v.type){case Ei.LEFT_DOWN:y.onLButtonDown(y.position);break;case Ei.LEFT_UP:y.onLButtonUp(y.position);break;case Ei.LEFT_DOUBLE_CLICK:y.onLButtonDoubleClick(y.position);break;case Ei.LEFT_CLICK:y.onLButtonClick(y.position);break;case Ei.RIGHT_UP:y.onRButtonUp(y.position);break;case Ei.RIGHT_DOWN:y.onRButtonDown(y.position);break;case Ei.RIGHT_CLICK:y.onRButtonClick(y.position);break;case Ei.MIDDLE_UP:y.onMButtonUp(y.position);break;case Ei.MIDDLE_DOWN:y.onMButtonDown(y.position);break;case Ei.MIDDLE_CLICK:y.onMButtonClick(y.position);break;case Ei.MOUSE_MOVE:y.onMouseMove(y.endPosition);break}}m(f,this)}onLButtonDown(f){this.mMouseDownPoint=this.mMousePrevPoint=f,this.mLeftButtonDown=!0}onLButtonUp(f){return this.mLeftButtonDown=!1,this.mLeftButtonDrag?(this.mLeftButtonDrag=!1,!1):!0}onLButtonDoubleClick(f){this.mMouseDownPoint=this.mMousePrevPoint=f}onLButtonClick(f){this.mMouseDownPoint=this.mMousePrevPoint=f}onLButtonDrag(f){return!0}onMButtonDown(f){this.mMouseDownPoint=this.mMousePrevPoint=f,this.mMidButtonDown=!0}onMButtonUp(f){return this.mMidButtonDown=!1,this.mMidButtonDrag?(this.mMidButtonDrag=!1,!1):!0}onMButtonClick(f){this.mMouseDownPoint=this.mMousePrevPoint=f}onMButtonDrag(f){return!0}onRButtonDown(f){this.mMouseDownPoint=this.mMousePrevPoint=f,this.mRightButtonDown=!0}onRButtonUp(f){return this.mRightButtonDown=!1,this.mRightButtonDrag?(this.mRightButtonDrag=!1,!1):!0}onRButtonClick(f){this.mMouseDownPoint=this.mMousePrevPoint=f}onRButtonDrag(f){return!0}onMouseMove(f){if(this.mLeftButtonDown===!1&&this.mMidButtonDown===!1&&this.mRightButtonDown===!1){this.mMousePrevPoint=f;return}Ye.distance(f,this.mMousePrevPoint)<10||(this.mLeftButtonDown&&this.onLButtonDrag(f)&&(this.mMousePrevPoint=f,this.mLeftButtonDrag=!0),this.mMidButtonDown&&this.onMButtonDrag(f)&&(this.mMousePrevPoint=f,this.mMidButtonDrag=!0),this.mRightButtonDown&&this.onRButtonDrag(f)&&(this.mMousePrevPoint=f,this.mRightButtonDrag=!0),this.mMousePrevPoint=f)}onMouseWheel(f,m){}onKeyDown(f){}onKeyUp(f){}calculateLength(f,m){let v=0,y=f.length;for(let x=0;x<y-1;x++)v+=H.distance(f[x+1],f[x]);return m&&(v+=H.distance(f[0],f[y-1])),v}calculateSphericalArea(f,m){let v=0;if(m)for(let y=0;y<f.length-1;y++){let x=f[y],C=f[y+1];v+=x.x*C.y-C.x*x.y}else for(let y=0;y<f.length;y++){let x=f[y],C;y<f.length-1?C=f[y+1]:C=f[0],v+=x.x*C.y-C.x*x.y}return v/2}pickVector(f,m){let v=this.mCoreMap.scene,y=v.camera,x=v.globe;if(!N(x))return;let C;if(v.pickPositionSupported)if(v.bim){let w=v.bim.PickWorldPositionSync(f.x,f.y);if(w[0]===0){if(v.bim){let A=y.getPickRay(f);C=v.globe.pick(A,v)}else if(C=v.pickPosition(f),!C){let A=y.getPickRay(f);C=v.globe.pick(A,v)}if(C===void 0)return}else C=new H(w[0],w[1],w[2])}else{if(C=v.pickPosition(f),!C){let w=y.getPickRay(f);C=v.globe.pick(w,v)}if(C===void 0)return}return H.clone(C,m)}pickObject(f,m){let y=this.mCoreMap.scene.pick(f);return console.log("pickedObject",y),N(y)?(m.pickedObject=y,!0):!1}doubleClickObject(f,m){let y=this.mCoreMap.scene.pick(f);return N(y)?(m.doubeClickedObject=y,!0):!1}},ls=yMe;var ase=class extends Dm{constructor(f){super(f),this._rtti="SpatialObject",this._spatialTransform=new RX}};Object.defineProperties(ase.prototype,{spatialTransform:{get:function(){return this._spatialTransform},set:function(o){this._spatialTransform=o}}});var mc=ase;function mb(o){this.mEarthCtrl=o,this.mCoreMap=o.coreMap,this.tools={},this.canContinue=!0,this.handler=new Ur(o.coreMap.scene.canvas),this.initialize()}mb.prototype.initialize=function(){let o=this;function f(m){for(let v in o.tools)if(o.tools.hasOwnProperty(v)){let y=o.tools[v];if(y.mEnable&&(o.canContinue=!0,y.onInputMessage(m),o.canContinue===!1))break}}this.handler.setInputAction(m=>{m.type=Ei.LEFT_DOWN,f(m)},Ei.LEFT_DOWN),this.handler.setInputAction(m=>{m.type=Ei.LEFT_UP,f(m)},Ei.LEFT_UP),this.handler.setInputAction(m=>{m.type=Ei.LEFT_CLICK,f(m)},Ei.LEFT_CLICK),this.handler.setInputAction(m=>{m.type=Ei.LEFT_DOUBLE_CLICK,f(m)},Ei.LEFT_DOUBLE_CLICK),this.handler.setInputAction(m=>{m.type=Ei.RIGHT_DOWN,f(m)},Ei.RIGHT_DOWN),this.handler.setInputAction(m=>{m.type=Ei.RIGHT_UP,f(m)},Ei.RIGHT_UP),this.handler.setInputAction(m=>{m.type=Ei.RIGHT_CLICK,f(m)},Ei.RIGHT_CLICK),this.handler.setInputAction(m=>{m.type=Ei.MIDDLE_UP,f(m)},Ei.MIDDLE_UP),this.handler.setInputAction(m=>{m.type=Ei.MIDDLE_DOWN,f(m)},Ei.MIDDLE_DOWN),this.handler.setInputAction(m=>{m.type=Ei.MIDDLE_CLICK,f(m)},Ei.MIDDLE_CLICK),this.handler.setInputAction(m=>{m.type=Ei.MOUSE_MOVE,f(m)},Ei.MOUSE_MOVE)};mb.prototype.destory=function(){this.handler&&(this.handler.removeInputAction(Ei.LEFT_CLICK),this.handler.removeInputAction(Ei.LEFT_DOWN),this.handler.removeInputAction(Ei.LEFT_UP),this.handler.removeInputAction(Ei.LEFT_DOUBLE_CLICK),this.handler.removeInputAction(Ei.RIGHT_DOWN),this.handler.removeInputAction(Ei.RIGHT_UP),this.handler.removeInputAction(Ei.RIGHT_CLICK),this.handler.removeInputAction(Ei.MIDDLE_DOWN),this.handler.removeInputAction(Ei.MIDDLE_UP),this.handler.removeInputAction(Ei.MIDDLE_CLICK),this.handler.removeInputAction(Ei.MOUSE_MOVE),this.handler.destroy())};mb.prototype.setCanContinue=function(o){this.canContinue=o};mb.prototype.registerTool=function(o,f){this.tools[o]=f,f.onActive()};mb.prototype.unregisterTool=function(o){let f=this.tools[o];return delete this.tools[o],f};mb.prototype.browse=function(){this.clearTool()};mb.prototype.selectObject=function(){this.clearTool()};mb.prototype.activeTool=function(o){this.tools.hasOwnProperty(o)&&this.tools[o].onActive()};mb.prototype.deactiveTool=function(o){this.tools.hasOwnProperty(o)&&this.tools[o].onDeactive()};mb.prototype.deactiveAllTool=function(){for(let o in this.tools)this.tools.hasOwnProperty(o)&&o.onDeactive()};mb.prototype.clearResult=function(){let o=this;for(let f in o.tools)o.tools.hasOwnProperty(f)&&o.tools[f].clearResult()};mb.prototype.clearTool=function(){let o=this;for(let f in o.tools)if(o.tools.hasOwnProperty(f)){let m=o.tools[f];m.onDeactive(),m.destory()}this.tools={}};var xMe=mb;var CMe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="MoushHeadingTool",this.prevPosition=void 0,this.width=document.body.clientWidth,this.height=document.body.clientHeight,this.widthDegree=90,this.heightDegree=90,this.leftClick=!1}onLButtonDown(f){this.leftClick=!0}onLButtonUp(f){return this.leftClick=!1,!0}onMouseMove(f){if(!this.leftClick){this.prevPosition=void 0;return}if(this.prevPosition!==void 0){let m=(f.x-this.prevPosition.x)/this.width*this.widthDegree,v=(this.prevPosition.y-f.y)/this.height*this.heightDegree;this.mCallback&&this.mCallback({headingAmount:m,pitchAmount:v})}this.prevPosition=f}},nlt=CMe;var lr,r3i="4.17.21",bMe=200,n3i="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",fA="Expected a function",o3i="Invalid `variable` option passed into `_.template`",wMe="__lodash_hash_undefined__",a3i=500,pse="__lodash_placeholder__",BO=1,olt=2,e8=4,t8=1,sse=2,mA=1,w4=2,alt=4,CP=8,r8=16,bP=32,n8=64,SD=128,FX=256,DMe=512,s3i=30,l3i="...",u3i=800,c3i=16,slt=1,h3i=2,d3i=3,b4=1/0,kO=9007199254740991,f3i=17976931348623157e292,hse=0/0,wP=4294967295,p3i=wP-1,m3i=wP>>>1,g3i=[["ary",SD],["bind",mA],["bindKey",w4],["curry",CP],["curryRight",r8],["flip",DMe],["partial",bP],["partialRight",n8],["rearg",FX]],a8="[object Arguments]",mse="[object Array]",_3i="[object AsyncFunction]",BX="[object Boolean]",kX="[object Date]",v3i="[object DOMException]",gse="[object Error]",_se="[object Function]",llt="[object GeneratorFunction]",RT="[object Map]",VX="[object Number]",y3i="[object Null]",PD="[object Object]",ult="[object Promise]",x3i="[object Proxy]",zX="[object RegExp]",OT="[object Set]",HX="[object String]",dse="[object Symbol]",C3i="[object Undefined]",UX="[object WeakMap]",b3i="[object WeakSet]",GX="[object ArrayBuffer]",s8="[object DataView]",kMe="[object Float32Array]",VMe="[object Float64Array]",zMe="[object Int8Array]",HMe="[object Int16Array]",UMe="[object Int32Array]",GMe="[object Uint8Array]",WMe="[object Uint8ClampedArray]",jMe="[object Uint16Array]",YMe="[object Uint32Array]",w3i=/\b__p \+= '';/g,A3i=/\b(__p \+=) '' \+/g,E3i=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Mlt=/&(?:amp|lt|gt|quot|#39);/g,Dlt=/[&<>"']/g,T3i=RegExp(Mlt.source),S3i=RegExp(Dlt.source),P3i=/<%-([\s\S]+?)%>/g,I3i=/<%([\s\S]+?)%>/g,clt=/<%=([\s\S]+?)%>/g,M3i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,D3i=/^\w*$/,L3i=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,LMe=/[\\^$.*+?()[\]{}|]/g,R3i=RegExp(LMe.source),RMe=/^\s+/,O3i=/\s/,N3i=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,F3i=/\{\n\/\* \[wrapped with (.+)\] \*/,B3i=/,? & /,k3i=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,V3i=/[()=,{}\[\]\/\s]/,z3i=/\\(\\)?/g,H3i=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,hlt=/\w*$/,U3i=/^[-+]0x[0-9a-f]+$/i,G3i=/^0b[01]+$/i,W3i=/^\[object .+?Constructor\]$/,j3i=/^0o[0-7]+$/i,Y3i=/^(?:0|[1-9]\d*)$/,q3i=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,lse=/($^)/,X3i=/['\n\r\u2028\u2029\\]/g,yse="\\ud800-\\udfff",J3i="\\u0300-\\u036f",K3i="\\ufe20-\\ufe2f",Q3i="\\u20d0-\\u20ff",Llt=J3i+K3i+Q3i,Rlt="\\u2700-\\u27bf",Olt="a-z\\xdf-\\xf6\\xf8-\\xff",Z3i="\\xac\\xb1\\xd7\\xf7",$3i="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",eOi="\\u2000-\\u206f",tOi=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nlt="A-Z\\xc0-\\xd6\\xd8-\\xde",Flt="\\ufe0e\\ufe0f",Blt=Z3i+$3i+eOi+tOi,qMe="['\u2019]",iOi="["+yse+"]",dlt="["+Blt+"]",vse="["+Llt+"]",klt="\\d+",rOi="["+Rlt+"]",Vlt="["+Olt+"]",zlt="[^"+yse+Blt+klt+Rlt+Olt+Nlt+"]",OMe="\\ud83c[\\udffb-\\udfff]",nOi="(?:"+vse+"|"+OMe+")",Hlt="[^"+yse+"]",XMe="(?:\\ud83c[\\udde6-\\uddff]){2}",JMe="[\\ud800-\\udbff][\\udc00-\\udfff]",o8="["+Nlt+"]",Ult="\\u200d",flt="(?:"+Vlt+"|"+zlt+")",oOi="(?:"+o8+"|"+zlt+")",plt="(?:"+qMe+"(?:d|ll|m|re|s|t|ve))?",mlt="(?:"+qMe+"(?:D|LL|M|RE|S|T|VE))?",Glt=nOi+"?",Wlt="["+Flt+"]?",aOi="(?:"+Ult+"(?:"+[Hlt,XMe,JMe].join("|")+")"+Wlt+Glt+")*",sOi="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",lOi="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",jlt=Wlt+Glt+aOi,uOi="(?:"+[rOi,XMe,JMe].join("|")+")"+jlt,cOi="(?:"+[Hlt+vse+"?",vse,XMe,JMe,iOi].join("|")+")",hOi=RegExp(qMe,"g"),dOi=RegExp(vse,"g"),NMe=RegExp(OMe+"(?="+OMe+")|"+cOi+jlt,"g"),fOi=RegExp([o8+"?"+Vlt+"+"+plt+"(?="+[dlt,o8,"$"].join("|")+")",oOi+"+"+mlt+"(?="+[dlt,o8+flt,"$"].join("|")+")",o8+"?"+flt+"+"+plt,o8+"+"+mlt,lOi,sOi,klt,uOi].join("|"),"g"),pOi=RegExp("["+Ult+yse+Llt+Flt+"]"),mOi=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,gOi=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],_Oi=-1,Bf={};Bf[kMe]=Bf[VMe]=Bf[zMe]=Bf[HMe]=Bf[UMe]=Bf[GMe]=Bf[WMe]=Bf[jMe]=Bf[YMe]=!0;Bf[a8]=Bf[mse]=Bf[GX]=Bf[BX]=Bf[s8]=Bf[kX]=Bf[gse]=Bf[_se]=Bf[RT]=Bf[VX]=Bf[PD]=Bf[zX]=Bf[OT]=Bf[HX]=Bf[UX]=!1;var cf={};cf[a8]=cf[mse]=cf[GX]=cf[s8]=cf[BX]=cf[kX]=cf[kMe]=cf[VMe]=cf[zMe]=cf[HMe]=cf[UMe]=cf[RT]=cf[VX]=cf[PD]=cf[zX]=cf[OT]=cf[HX]=cf[dse]=cf[GMe]=cf[WMe]=cf[jMe]=cf[YMe]=!0;cf[gse]=cf[_se]=cf[UX]=!1;var vOi={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},yOi={"&":"&","<":"<",">":">",'"':""","'":"'"},xOi={"&":"&","<":"<",">":">",""":'"',"'":"'"},COi={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},bOi=parseFloat,wOi=parseInt,Ylt=typeof global=="object"&&global&&global.Object===Object&&global,AOi=typeof self=="object"&&self&&self.Object===Object&&self,Zv=Ylt||AOi||Function("return this")(),qlt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,WX=qlt&&typeof module=="object"&&module&&!module.nodeType&&module,Xlt=WX&&WX.exports===qlt,AMe=Xlt&&Ylt.process,gA=function(){try{var o=WX&&WX.require&&WX.require("util").types;return o||AMe&&AMe.binding&&AMe.binding("util")}catch{}}(),glt=gA&&gA.isArrayBuffer,_lt=gA&&gA.isDate,vlt=gA&&gA.isMap,ylt=gA&&gA.isRegExp,xlt=gA&&gA.isSet,Clt=gA&&gA.isTypedArray;function gb(o,f,m){switch(m.length){case 0:return o.call(f);case 1:return o.call(f,m[0]);case 2:return o.call(f,m[0],m[1]);case 3:return o.call(f,m[0],m[1],m[2])}return o.apply(f,m)}function EOi(o,f,m,v){for(var y=-1,x=o==null?0:o.length;++y<x;){var C=o[y];f(v,C,m(C),o)}return v}function pA(o,f){for(var m=-1,v=o==null?0:o.length;++m<v&&f(o[m],m,o)!==!1;);return o}function TOi(o,f){for(var m=o==null?0:o.length;m--&&f(o[m],m,o)!==!1;);return o}function blt(o,f){for(var m=-1,v=o==null?0:o.length;++m<v;)if(!f(o[m],m,o))return!1;return!0}function VO(o,f){for(var m=-1,v=o==null?0:o.length,y=0,x=[];++m<v;){var C=o[m];f(C,m,o)&&(x[y++]=C)}return x}function use(o,f){var m=o==null?0:o.length;return!!m&&u8(o,f,0)>-1}function EMe(o,f,m){for(var v=-1,y=o==null?0:o.length;++v<y;)if(m(f,o[v]))return!0;return!1}function np(o,f){for(var m=-1,v=o==null?0:o.length,y=Array(v);++m<v;)y[m]=f(o[m],m,o);return y}function zO(o,f){for(var m=-1,v=f.length,y=o.length;++m<v;)o[y+m]=f[m];return o}function TMe(o,f,m,v){var y=-1,x=o==null?0:o.length;for(v&&x&&(m=o[++y]);++y<x;)m=f(m,o[y],y,o);return m}function SOi(o,f,m,v){var y=o==null?0:o.length;for(v&&y&&(m=o[--y]);y--;)m=f(m,o[y],y,o);return m}function SMe(o,f){for(var m=-1,v=o==null?0:o.length;++m<v;)if(f(o[m],m,o))return!0;return!1}var POi=FMe("length");function IOi(o){return o.split("")}function MOi(o){return o.match(k3i)||[]}function wlt(o,f,m){var v;return m(o,function(y,x,C){if(f(y,x,C))return v=x,!1}),v}function fse(o,f,m,v){for(var y=o.length,x=m+(v?1:-1);v?x--:++x<y;)if(f(o[x],x,o))return x;return-1}function u8(o,f,m){return f===f?UOi(o,f,m):fse(o,Jlt,m)}function DOi(o,f,m,v){for(var y=m-1,x=o.length;++y<x;)if(v(o[y],f))return y;return-1}function Jlt(o){return o!==o}function Alt(o,f){var m=o==null?0:o.length;return m?BMe(o,f)/m:hse}function FMe(o){return function(f){return f==null?lr:f[o]}}function KMe(o){return function(f){return o==null?lr:o[f]}}function Elt(o,f,m,v,y){return y(o,function(x,C,w){m=v?(v=!1,x):f(m,x,C,w)}),m}function LOi(o,f){var m=o.length;for(o.sort(f);m--;)o[m]=o[m].value;return o}function BMe(o,f){for(var m,v=-1,y=o.length;++v<y;){var x=f(o[v]);x!==lr&&(m=m===lr?x:m+x)}return m}function PMe(o,f){for(var m=-1,v=Array(o);++m<o;)v[m]=f(m);return v}function ROi(o,f){return np(f,function(m){return[m,o[m]]})}function Tlt(o){return o&&o.slice(0,Klt(o)+1).replace(RMe,"")}function _b(o){return function(f){return o(f)}}function IMe(o,f){return np(f,function(m){return o[m]})}function NX(o,f){return o.has(f)}function Slt(o,f){for(var m=-1,v=o.length;++m<v&&u8(f,o[m],0)>-1;);return m}function Plt(o,f){for(var m=o.length;m--&&u8(f,o[m],0)>-1;);return m}function OOi(o,f){for(var m=o.length,v=0;m--;)o[m]===f&&++v;return v}var NOi=KMe(vOi),FOi=KMe(yOi);function BOi(o){return"\\"+COi[o]}function kOi(o,f){return o==null?lr:o[f]}function l8(o){return pOi.test(o)}function VOi(o){return mOi.test(o)}function zOi(o){for(var f,m=[];!(f=o.next()).done;)m.push(f.value);return m}function MMe(o){var f=-1,m=Array(o.size);return o.forEach(function(v,y){m[++f]=[y,v]}),m}function Ilt(o,f){return function(m){return o(f(m))}}function HO(o,f){for(var m=-1,v=o.length,y=0,x=[];++m<v;){var C=o[m];(C===f||C===pse)&&(o[m]=pse,x[y++]=m)}return x}function cse(o){var f=-1,m=Array(o.size);return o.forEach(function(v){m[++f]=v}),m}function HOi(o){var f=-1,m=Array(o.size);return o.forEach(function(v){m[++f]=[v,v]}),m}function UOi(o,f,m){for(var v=m-1,y=o.length;++v<y;)if(o[v]===f)return v;return-1}function GOi(o,f,m){for(var v=m+1;v--;)if(o[v]===f)return v;return v}function i8(o){return l8(o)?jOi(o):POi(o)}function LT(o){return l8(o)?YOi(o):IOi(o)}function Klt(o){for(var f=o.length;f--&&O3i.test(o.charAt(f)););return f}var WOi=KMe(xOi);function jOi(o){for(var f=NMe.lastIndex=0;NMe.test(o);)++f;return f}function YOi(o){return o.match(NMe)||[]}function qOi(o){return o.match(fOi)||[]}var XOi=function o(f){f=f==null?Zv:_.defaults(Zv.Object(),f,_.pick(Zv,gOi));var m=f.Array,v=f.Date,y=f.Error,x=f.Function,C=f.Math,w=f.Object,A=f.RegExp,E=f.String,T=f.TypeError,S=m.prototype,M=x.prototype,I=w.prototype,P=f["__core-js_shared__"],D=M.toString,L=I.hasOwnProperty,R=0,O=function(){var me=/[^.]+$/.exec(P&&P.keys&&P.keys.IE_PROTO||"");return me?"Symbol(src)_1."+me:""}(),F=I.toString,k=D.call(w),U=Zv._,G=A("^"+D.call(L).replace(LMe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),j=Xlt?f.Buffer:lr,q=f.Symbol,J=f.Uint8Array,X=j?j.allocUnsafe:lr,Y=Ilt(w.getPrototypeOf,w),Q=w.create,ee=I.propertyIsEnumerable,z=S.splice,ie=q?q.isConcatSpreadable:lr,re=q?q.iterator:lr,ne=q?q.toStringTag:lr,oe=function(){try{var me=jC(w,"defineProperty");return me({},"",{}),me}catch{}}(),se=f.clearTimeout!==Zv.clearTimeout&&f.clearTimeout,ae=v&&v.now!==Zv.Date.now&&v.now,fe=f.setTimeout!==Zv.setTimeout&&f.setTimeout,de=C.ceil,ve=C.floor,pe=w.getOwnPropertySymbols,ce=j?j.isBuffer:lr,he=f.isFinite,Ce=S.join,Se=Ilt(w.keys,w),De=C.max,Oe=C.min,Ue=v.now,Xe=f.parseInt,it=C.random,ut=S.reverse,at=jC(f,"DataView"),Pt=jC(f,"Map"),Qe=jC(f,"Promise"),ft=jC(f,"Set"),Ot=jC(f,"WeakMap"),Xt=jC(w,"create"),At=Ot&&new Ot,bt={},gt=Tg(at),It=Tg(Pt),Jt=Tg(Qe),bi=Tg(ft),Yi=Tg(Ot),ii=q?q.prototype:lr,ei=ii?ii.valueOf:lr,Li=ii?ii.toString:lr;function Je(me){if(Ad(me)&&!$s(me)&&!(me instanceof wi)){if(me instanceof ai)return me;if(L.call(me,"__wrapped__"))return Ob(me)}return new ai(me)}var Nt=function(){function me(){}return function(we){if(!wu(we))return{};if(Q)return Q(we);me.prototype=we;var Be=new me;return me.prototype=lr,Be}}();function yi(){}function ai(me,we){this.__wrapped__=me,this.__actions__=[],this.__chain__=!!we,this.__index__=0,this.__values__=lr}Je.templateSettings={escape:P3i,evaluate:I3i,interpolate:clt,variable:"",imports:{_:Je}},Je.prototype=yi.prototype,Je.prototype.constructor=Je,ai.prototype=Nt(yi.prototype),ai.prototype.constructor=ai;function wi(me){this.__wrapped__=me,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=wP,this.__views__=[]}function ji(){var me=new wi(this.__wrapped__);return me.__actions__=Gf(this.__actions__),me.__dir__=this.__dir__,me.__filtered__=this.__filtered__,me.__iteratees__=Gf(this.__iteratees__),me.__takeCount__=this.__takeCount__,me.__views__=Gf(this.__views__),me}function hi(){if(this.__filtered__){var me=new wi(this);me.__dir__=-1,me.__filtered__=!0}else me=this.clone(),me.__dir__*=-1;return me}function Ri(){var me=this.__wrapped__.value(),we=this.__dir__,Be=$s(me),ht=we<0,Kt=Be?me.length:0,di=dN(0,Kt,this.__views__),tr=di.start,mr=di.end,Mr=mr-tr,Ln=ht?mr:tr-1,Bn=this.__iteratees__,Xn=Bn.length,Jo=0,Ma=Oe(Mr,this.__takeCount__);if(!Be||!ht&&Kt==Mr&&Ma==Mr)return vf(me,this.__actions__);var Bs=[];e:for(;Mr--&&Jo<Ma;){Ln+=we;for(var Pl=-1,Go=me[Ln];++Pl<Xn;){var rl=Bn[Pl],Au=rl.iteratee,_m=rl.type,oc=Au(Go);if(_m==h3i)Go=oc;else if(!oc){if(_m==slt)continue e;break e}}Bs[Jo++]=Go}return Bs}wi.prototype=Nt(yi.prototype),wi.prototype.constructor=wi;function pt(me){var we=-1,Be=me==null?0:me.length;for(this.clear();++we<Be;){var ht=me[we];this.set(ht[0],ht[1])}}function wr(){this.__data__=Xt?Xt(null):{},this.size=0}function zi(me){var we=this.has(me)&&delete this.__data__[me];return this.size-=we?1:0,we}function Ui(me){var we=this.__data__;if(Xt){var Be=we[me];return Be===wMe?lr:Be}return L.call(we,me)?we[me]:lr}function Gt(me){var we=this.__data__;return Xt?we[me]!==lr:L.call(we,me)}function $t(me,we){var Be=this.__data__;return this.size+=this.has(me)?0:1,Be[me]=Xt&&we===lr?wMe:we,this}pt.prototype.clear=wr,pt.prototype.delete=zi,pt.prototype.get=Ui,pt.prototype.has=Gt,pt.prototype.set=$t;function jt(me){var we=-1,Be=me==null?0:me.length;for(this.clear();++we<Be;){var ht=me[we];this.set(ht[0],ht[1])}}function ct(){this.__data__=[],this.size=0}function Pe(me){var we=this.__data__,Be=On(we,me);if(Be<0)return!1;var ht=we.length-1;return Be==ht?we.pop():z.call(we,Be,1),--this.size,!0}function Ht(me){var we=this.__data__,Be=On(we,me);return Be<0?lr:we[Be][1]}function si(me){return On(this.__data__,me)>-1}function _t(me,we){var Be=this.__data__,ht=On(Be,me);return ht<0?(++this.size,Be.push([me,we])):Be[ht][1]=we,this}jt.prototype.clear=ct,jt.prototype.delete=Pe,jt.prototype.get=Ht,jt.prototype.has=si,jt.prototype.set=_t;function Yt(me){var we=-1,Be=me==null?0:me.length;for(this.clear();++we<Be;){var ht=me[we];this.set(ht[0],ht[1])}}function Fi(){this.size=0,this.__data__={hash:new pt,map:new(Pt||jt),string:new pt}}function Dt(me){var we=Ib(this,me).delete(me);return this.size-=we?1:0,we}function Lt(me){return Ib(this,me).get(me)}function Si(me){return Ib(this,me).has(me)}function nt(me,we){var Be=Ib(this,me),ht=Be.size;return Be.set(me,we),this.size+=Be.size==ht?0:1,this}Yt.prototype.clear=Fi,Yt.prototype.delete=Dt,Yt.prototype.get=Lt,Yt.prototype.has=Si,Yt.prototype.set=nt;function wt(me){var we=-1,Be=me==null?0:me.length;for(this.__data__=new Yt;++we<Be;)this.add(me[we])}function yt(me){return this.__data__.set(me,wMe),this}function Tt(me){return this.__data__.has(me)}wt.prototype.add=wt.prototype.push=yt,wt.prototype.has=Tt;function Et(me){var we=this.__data__=new jt(me);this.size=we.size}function ti(){this.__data__=new jt,this.size=0}function ir(me){var we=this.__data__,Be=we.delete(me);return this.size=we.size,Be}function or(me){return this.__data__.get(me)}function xr(me){return this.__data__.has(me)}function Tn(me,we){var Be=this.__data__;if(Be instanceof jt){var ht=Be.__data__;if(!Pt||ht.length<bMe-1)return ht.push([me,we]),this.size=++Be.size,this;Be=this.__data__=new Yt(ht)}return Be.set(me,we),this.size=Be.size,this}Et.prototype.clear=ti,Et.prototype.delete=ir,Et.prototype.get=or,Et.prototype.has=xr,Et.prototype.set=Tn;function Ii(me,we){var Be=$s(me),ht=!Be&&Y_(me),Kt=!Be&&!ht&&i_(me),di=!Be&&!ht&&!Kt&&vy(me),tr=Be||ht||Kt||di,mr=tr?PMe(me.length,E):[],Mr=mr.length;for(var Ln in me)(we||L.call(me,Ln))&&!(tr&&(Ln=="length"||Kt&&(Ln=="offset"||Ln=="parent")||di&&(Ln=="buffer"||Ln=="byteLength"||Ln=="byteOffset")||Z0(Ln,Mr)))&&mr.push(Ln);return mr}function pr(me){var we=me.length;return we?me[Ir(0,we-1)]:lr}function yn(me,we){return Lb(Gf(me),zr(we,0,me.length))}function dn(me){return Lb(Gf(me))}function fn(me,we,Be){(Be!==lr&&!t_(me[we],Be)||Be===lr&&!(we in me))&&Va(me,we,Be)}function Or(me,we,Be){var ht=me[we];(!(L.call(me,we)&&t_(ht,Be))||Be===lr&&!(we in me))&&Va(me,we,Be)}function On(me,we){for(var Be=me.length;Be--;)if(t_(me[Be][0],we))return Be;return-1}function eo(me,we,Be,ht){return Mi(me,function(Kt,di,tr){we(ht,Kt,Be(Kt),tr)}),ht}function Cn(me,we){return me&&Vm(we,qf(we),me)}function Sa(me,we){return me&&Vm(we,Pg(we),me)}function Va(me,we,Be){we=="__proto__"&&oe?oe(me,we,{configurable:!0,enumerable:!0,value:Be,writable:!0}):me[we]=Be}function za(me,we){for(var Be=-1,ht=we.length,Kt=m(ht),di=me==null;++Be<ht;)Kt[Be]=di?lr:Yf(me,we[Be]);return Kt}function zr(me,we,Be){return me===me&&(Be!==lr&&(me=me<=Be?me:Be),we!==lr&&(me=me>=we?me:we)),me}function Ci(me,we,Be,ht,Kt,di){var tr,mr=we&BO,Mr=we&olt,Ln=we&e8;if(Be&&(tr=Kt?Be(me,ht,Kt,di):Be(me)),tr!==lr)return tr;if(!wu(me))return me;var Bn=$s(me);if(Bn){if(tr=nS(me),!mr)return Gf(me,tr)}else{var Xn=dm(me),Jo=Xn==_se||Xn==llt;if(i_(me))return bg(me,mr);if(Xn==PD||Xn==a8||Jo&&!Kt){if(tr=Mr||Jo?{}:JP(me),!mr)return Mr?ah(me,Sa(tr,me)):dy(me,Cn(tr,me))}else{if(!cf[Xn])return Kt?me:{};tr=KP(me,Xn,mr)}}di||(di=new Et);var Ma=di.get(me);if(Ma)return Ma;di.set(me,tr),kc(me)?me.forEach(function(Go){tr.add(Ci(Go,we,Be,Go,me,di))}):zk(me)&&me.forEach(function(Go,rl){tr.set(rl,Ci(Go,we,Be,rl,me,di))});var Bs=Ln?Mr?l0:yx:Mr?Pg:qf,Pl=Bn?lr:Bs(me);return pA(Pl||me,function(Go,rl){Pl&&(rl=Go,Go=me[rl]),Or(tr,rl,Ci(Go,we,Be,rl,me,di))}),tr}function Ni(me){var we=qf(me);return function(Be){return cr(Be,me,we)}}function cr(me,we,Be){var ht=Be.length;if(me==null)return!ht;for(me=w(me);ht--;){var Kt=Be[ht],di=we[Kt],tr=me[Kt];if(tr===lr&&!(Kt in me)||!di(tr))return!1}return!0}function Bi(me,we,Be){if(typeof me!="function")throw new T(fA);return Db(function(){me.apply(lr,Be)},we)}function Ct(me,we,Be,ht){var Kt=-1,di=use,tr=!0,mr=me.length,Mr=[],Ln=we.length;if(!mr)return Mr;Be&&(we=np(we,_b(Be))),ht?(di=EMe,tr=!1):we.length>=bMe&&(di=NX,tr=!1,we=new wt(we));e:for(;++Kt<mr;){var Bn=me[Kt],Xn=Be==null?Bn:Be(Bn);if(Bn=ht||Bn!==0?Bn:0,tr&&Xn===Xn){for(var Jo=Ln;Jo--;)if(we[Jo]===Xn)continue e;Mr.push(Bn)}else di(we,Xn,ht)||Mr.push(Bn)}return Mr}var Mi=eS(ui),$i=eS(hr,!0);function ur(me,we){var Be=!0;return Mi(me,function(ht,Kt,di){return Be=!!we(ht,Kt,di),Be}),Be}function Nr(me,we,Be){for(var ht=-1,Kt=me.length;++ht<Kt;){var di=me[ht],tr=we(di);if(tr!=null&&(mr===lr?tr===tr&&!h0(tr):Be(tr,mr)))var mr=tr,Mr=di}return Mr}function qe(me,we,Be,ht){var Kt=me.length;for(Be=Sl(Be),Be<0&&(Be=-Be>Kt?0:Kt+Be),ht=ht===lr||ht>Kt?Kt:Sl(ht),ht<0&&(ht+=Kt),ht=Be>ht?0:NN(ht);Be<ht;)me[Be++]=we;return me}function tt(me,we){var Be=[];return Mi(me,function(ht,Kt,di){we(ht,Kt,di)&&Be.push(ht)}),Be}function $e(me,we,Be,ht,Kt){var di=-1,tr=me.length;for(Be||(Be=gk),Kt||(Kt=[]);++di<tr;){var mr=me[di];we>0&&Be(mr)?we>1?$e(mr,we-1,Be,ht,Kt):zO(Kt,mr):ht||(Kt[Kt.length]=mr)}return Kt}var St=fy(),Zt=fy(!0);function ui(me,we){return me&&St(me,we,qf)}function hr(me,we){return me&&Zt(me,we,qf)}function Yr(me,we){return VO(we,function(Be){return _y(me[Be])})}function ln(me,we){we=bu(we,me);for(var Be=0,ht=we.length;me!=null&&Be<ht;)me=me[Eg(we[Be++])];return Be&&Be==ht?me:lr}function Kn(me,we,Be){var ht=we(me);return $s(me)?ht:zO(ht,Be(me))}function Un(me){return me==null?me===lr?C3i:y3i:ne&&ne in w(me)?mk(me):uS(me)}function Qn(me,we){return me>we}function Pa(me,we){return me!=null&&L.call(me,we)}function Gn(me,we){return me!=null&&we in w(me)}function Ja(me,we,Be){return me>=Oe(we,Be)&&me<De(we,Be)}function fl(me,we,Be){for(var ht=Be?EMe:use,Kt=me[0].length,di=me.length,tr=di,mr=m(di),Mr=1/0,Ln=[];tr--;){var Bn=me[tr];tr&&we&&(Bn=np(Bn,_b(we))),Mr=Oe(Bn.length,Mr),mr[tr]=!Be&&(we||Kt>=120&&Bn.length>=120)?new wt(tr&&Bn):lr}Bn=me[0];var Xn=-1,Jo=mr[0];e:for(;++Xn<Kt&&Ln.length<Mr;){var Ma=Bn[Xn],Bs=we?we(Ma):Ma;if(Ma=Be||Ma!==0?Ma:0,!(Jo?NX(Jo,Bs):ht(Ln,Bs,Be))){for(tr=di;--tr;){var Pl=mr[tr];if(!(Pl?NX(Pl,Bs):ht(me[tr],Bs,Be)))continue e}Jo&&Jo.push(Bs),Ln.push(Ma)}}return Ln}function Ul(me,we,Be,ht){return ui(me,function(Kt,di,tr){we(ht,Be(Kt),di,tr)}),ht}function hu(me,we,Be){we=bu(we,me),me=xf(me,we);var ht=me==null?me:me[Eg($0(we))];return ht==null?lr:gb(ht,me,Be)}function Ys(me){return Ad(me)&&Un(me)==a8}function Wd(me){return Ad(me)&&Un(me)==GX}function Pc(me){return Ad(me)&&Un(me)==kX}function So(me,we,Be,ht,Kt){return me===we?!0:me==null||we==null||!Ad(me)&&!Ad(we)?me!==me&&we!==we:Kh(me,we,Be,ht,So,Kt)}function Kh(me,we,Be,ht,Kt,di){var tr=$s(me),mr=$s(we),Mr=tr?mse:dm(me),Ln=mr?mse:dm(we);Mr=Mr==a8?PD:Mr,Ln=Ln==a8?PD:Ln;var Bn=Mr==PD,Xn=Ln==PD,Jo=Mr==Ln;if(Jo&&i_(me)){if(!i_(we))return!1;tr=!0,Bn=!1}if(Jo&&!Bn)return di||(di=new Et),tr||vy(me)?Uo(me,we,Be,ht,Kt,di):Yd(me,we,Mr,Be,ht,Kt,di);if(!(Be&t8)){var Ma=Bn&&L.call(me,"__wrapped__"),Bs=Xn&&L.call(we,"__wrapped__");if(Ma||Bs){var Pl=Ma?me.value():me,Go=Bs?we.value():we;return di||(di=new Et),Kt(Pl,Go,Be,ht,di)}}return Jo?(di||(di=new Et),nc(me,we,Be,ht,Kt,di)):!1}function mf(me){return Ad(me)&&dm(me)==RT}function Gl(me,we,Be,ht){var Kt=Be.length,di=Kt,tr=!ht;if(me==null)return!di;for(me=w(me);Kt--;){var mr=Be[Kt];if(tr&&mr[2]?mr[1]!==me[mr[0]]:!(mr[0]in me))return!1}for(;++Kt<di;){mr=Be[Kt];var Mr=mr[0],Ln=me[Mr],Bn=mr[1];if(tr&&mr[2]){if(Ln===lr&&!(Mr in me))return!1}else{var Xn=new Et;if(ht)var Jo=ht(Ln,Bn,Mr,me,we,Xn);if(!(Jo===lr?So(Bn,Ln,t8|sse,ht,Xn):Jo))return!1}}return!0}function Wl(me){if(!wu(me)||_k(me))return!1;var we=_y(me)?G:W3i;return we.test(Tg(me))}function Th(me){return Ad(me)&&Un(me)==zX}function rr(me){return Ad(me)&&dm(me)==OT}function mo(me){return Ad(me)&&qd(me.length)&&!!Bf[Un(me)]}function Wn(me){return typeof me=="function"?me:me==null?Ph:typeof me=="object"?$s(me)?na(me[0],me[1]):Cu(me):by(me)}function yo(me){if(!YC(me))return Se(me);var we=[];for(var Be in w(me))L.call(me,Be)&&Be!="constructor"&&we.push(Be);return we}function Ga(me){if(!wu(me))return lS(me);var we=YC(me),Be=[];for(var ht in me)ht=="constructor"&&(we||!L.call(me,ht))||Be.push(ht);return Be}function xu(me,we){return me<we}function qs(me,we){var Be=-1,ht=Hp(me)?m(me.length):[];return Mi(me,function(Kt,di,tr){ht[++Be]=we(Kt,di,tr)}),ht}function Cu(me){var we=vc(me);return we.length==1&&we[0][2]?aS(we[0][0],we[0][1]):function(Be){return Be===me||Gl(Be,me,we)}}function na(me,we){return Mb(me)&&oS(we)?aS(Eg(me),we):function(Be){var ht=Yf(Be,me);return ht===lr&&ht===we?VN(Be,me):So(we,ht,t8|sse)}}function gf(me,we,Be,ht,Kt){me!==we&&St(we,function(di,tr){if(Kt||(Kt=new Et),wu(di))Xi(me,we,tr,Be,gf,ht,Kt);else{var mr=ht?ht(aL(me,tr),di,tr+"",me,we,Kt):lr;mr===lr&&(mr=di),fn(me,tr,mr)}},Pg)}function Xi(me,we,Be,ht,Kt,di,tr){var mr=aL(me,Be),Mr=aL(we,Be),Ln=tr.get(Mr);if(Ln){fn(me,Be,Ln);return}var Bn=di?di(mr,Mr,Be+"",me,we,tr):lr,Xn=Bn===lr;if(Xn){var Jo=$s(Mr),Ma=!Jo&&i_(Mr),Bs=!Jo&&!Ma&&vy(Mr);Bn=Mr,Jo||Ma||Bs?$s(mr)?Bn=mr:qc(mr)?Bn=Gf(mr):Ma?(Xn=!1,Bn=bg(Mr,!0)):Bs?(Xn=!1,Bn=ju(Mr,!0)):Bn=[]:Cf(Mr)||Y_(Mr)?(Bn=mr,Y_(mr)?Bn=TL(mr):(!wu(mr)||_y(mr))&&(Bn=JP(Mr))):Xn=!1}Xn&&(tr.set(Mr,Bn),Kt(Bn,Mr,ht,di,tr),tr.delete(Mr)),fn(me,Be,Bn)}function ke(me,we){var Be=me.length;if(!!Be)return we+=we<0?Be:0,Z0(we,Be)?me[we]:lr}function Ie(me,we,Be){we.length?we=np(we,function(di){return $s(di)?function(tr){return ln(tr,di.length===1?di[0]:di)}:di}):we=[Ph];var ht=-1;we=np(we,_b(ns()));var Kt=qs(me,function(di,tr,mr){var Mr=np(we,function(Ln){return Ln(di)});return{criteria:Mr,index:++ht,value:di}});return LOi(Kt,function(di,tr){return Uf(di,tr,Be)})}function He(me,we){return dt(me,we,function(Be,ht){return VN(me,ht)})}function dt(me,we,Be){for(var ht=-1,Kt=we.length,di={};++ht<Kt;){var tr=we[ht],mr=ln(me,tr);Be(mr,tr)&&Zo(di,bu(tr,me),mr)}return di}function Vt(me){return function(we){return ln(we,me)}}function ni(me,we,Be,ht){var Kt=ht?DOi:u8,di=-1,tr=we.length,mr=me;for(me===we&&(we=Gf(we)),Be&&(mr=np(me,_b(Be)));++di<tr;)for(var Mr=0,Ln=we[di],Bn=Be?Be(Ln):Ln;(Mr=Kt(mr,Bn,Mr,ht))>-1;)mr!==me&&z.call(mr,Mr,1),z.call(me,Mr,1);return me}function _r(me,we){for(var Be=me?we.length:0,ht=Be-1;Be--;){var Kt=we[Be];if(Be==ht||Kt!==di){var di=Kt;Z0(Kt)?z.call(me,Kt,1):_f(me,Kt)}}return me}function Ir(me,we){return me+ve(it()*(we-me+1))}function Pn(me,we,Be,ht){for(var Kt=-1,di=De(de((we-me)/(Be||1)),0),tr=m(di);di--;)tr[ht?di:++Kt]=me,me+=Be;return tr}function An(me,we){var Be="";if(!me||we<1||we>kO)return Be;do we%2&&(Be+=me),we=ve(we/2),we&&(me+=me);while(we);return Be}function Wr(me,we){return lL(fN(me,we,Ph),me+"")}function Ho(me){return pr(QA(me))}function ma(me,we){var Be=QA(me);return Lb(Be,zr(we,0,Be.length))}function Zo(me,we,Be,ht){if(!wu(me))return me;we=bu(we,me);for(var Kt=-1,di=we.length,tr=di-1,mr=me;mr!=null&&++Kt<di;){var Mr=Eg(we[Kt]),Ln=Be;if(Mr==="__proto__"||Mr==="constructor"||Mr==="prototype")return me;if(Kt!=tr){var Bn=mr[Mr];Ln=ht?ht(Bn,Mr,mr):lr,Ln===lr&&(Ln=wu(Bn)?Bn:Z0(we[Kt+1])?[]:{})}Or(mr,Mr,Ln),mr=mr[Mr]}return me}var $o=At?function(me,we){return At.set(me,we),me}:Ph,du=oe?function(me,we){return oe(me,"toString",{configurable:!0,enumerable:!1,value:p0(we),writable:!0})}:Ph;function rs(me){return Lb(QA(me))}function Wa(me,we,Be){var ht=-1,Kt=me.length;we<0&&(we=-we>Kt?0:Kt+we),Be=Be>Kt?Kt:Be,Be<0&&(Be+=Kt),Kt=we>Be?0:Be-we>>>0,we>>>=0;for(var di=m(Kt);++ht<Kt;)di[ht]=me[ht+we];return di}function fu(me,we){var Be;return Mi(me,function(ht,Kt,di){return Be=we(ht,Kt,di),!Be}),!!Be}function Hs(me,we,Be){var ht=0,Kt=me==null?ht:me.length;if(typeof we=="number"&&we===we&&Kt<=m3i){for(;ht<Kt;){var di=ht+Kt>>>1,tr=me[di];tr!==null&&!h0(tr)&&(Be?tr<=we:tr<we)?ht=di+1:Kt=di}return Kt}return Wu(me,we,Ph,Be)}function Wu(me,we,Be,ht){var Kt=0,di=me==null?0:me.length;if(di===0)return 0;we=Be(we);for(var tr=we!==we,mr=we===null,Mr=h0(we),Ln=we===lr;Kt<di;){var Bn=ve((Kt+di)/2),Xn=Be(me[Bn]),Jo=Xn!==lr,Ma=Xn===null,Bs=Xn===Xn,Pl=h0(Xn);if(tr)var Go=ht||Bs;else Ln?Go=Bs&&(ht||Jo):mr?Go=Bs&&Jo&&(ht||!Ma):Mr?Go=Bs&&Jo&&!Ma&&(ht||!Pl):Ma||Pl?Go=!1:Go=ht?Xn<=we:Xn<we;Go?Kt=Bn+1:di=Bn}return Oe(di,p3i)}function Ic(me,we){for(var Be=-1,ht=me.length,Kt=0,di=[];++Be<ht;){var tr=me[Be],mr=we?we(tr):tr;if(!Be||!t_(mr,Mr)){var Mr=mr;di[Kt++]=tr===0?0:tr}}return di}function Os(me){return typeof me=="number"?me:h0(me)?hse:+me}function Ns(me){if(typeof me=="string")return me;if($s(me))return np(me,Ns)+"";if(h0(me))return Li?Li.call(me):"";var we=me+"";return we=="0"&&1/me==-b4?"-0":we}function _c(me,we,Be){var ht=-1,Kt=use,di=me.length,tr=!0,mr=[],Mr=mr;if(Be)tr=!1,Kt=EMe;else if(di>=bMe){var Ln=we?null:Hi(me);if(Ln)return cse(Ln);tr=!1,Kt=NX,Mr=new wt}else Mr=we?[]:mr;e:for(;++ht<di;){var Bn=me[ht],Xn=we?we(Bn):Bn;if(Bn=Be||Bn!==0?Bn:0,tr&&Xn===Xn){for(var Jo=Mr.length;Jo--;)if(Mr[Jo]===Xn)continue e;we&&Mr.push(Xn),mr.push(Bn)}else Kt(Mr,Xn,Be)||(Mr!==mr&&Mr.push(Xn),mr.push(Bn))}return mr}function _f(me,we){return we=bu(we,me),me=xf(me,we),me==null||delete me[Eg($0(we))]}function wd(me,we,Be,ht){return Zo(me,we,Be(ln(me,we)),ht)}function Bc(me,we,Be,ht){for(var Kt=me.length,di=ht?Kt:-1;(ht?di--:++di<Kt)&&we(me[di],di,me););return Be?Wa(me,ht?0:di,ht?di+1:Kt):Wa(me,ht?di+1:0,ht?Kt:di)}function vf(me,we){var Be=me;return Be instanceof wi&&(Be=Be.value()),TMe(we,function(ht,Kt){return Kt.func.apply(Kt.thisArg,zO([ht],Kt.args))},Be)}function cp(me,we,Be){var ht=me.length;if(ht<2)return ht?_c(me[0]):[];for(var Kt=-1,di=m(ht);++Kt<ht;)for(var tr=me[Kt],mr=-1;++mr<ht;)mr!=Kt&&(di[Kt]=Ct(di[Kt]||tr,me[mr],we,Be));return _c($e(di,1),we,Be)}function yf(me,we,Be){for(var ht=-1,Kt=me.length,di=we.length,tr={};++ht<Kt;){var mr=ht<di?we[ht]:lr;Be(tr,me[ht],mr)}return tr}function Vp(me){return qc(me)?me:[]}function Hf(me){return typeof me=="function"?me:Ph}function bu(me,we){return $s(me)?me:Mb(me,we)?[me]:Rb(Mc(me))}var hy=Wr;function zp(me,we,Be){var ht=me.length;return Be=Be===lr?ht:Be,!we&&Be>=ht?me:Wa(me,we,Be)}var km=se||function(me){return Zv.clearTimeout(me)};function bg(me,we){if(we)return me.slice();var Be=me.length,ht=X?X(Be):new me.constructor(Be);return me.copy(ht),ht}function Qh(me){var we=new me.constructor(me.byteLength);return new J(we).set(new J(me)),we}function s0(me,we){var Be=we?Qh(me.buffer):me.buffer;return new me.constructor(Be,me.byteOffset,me.byteLength)}function hp(me){var we=new me.constructor(me.source,hlt.exec(me));return we.lastIndex=me.lastIndex,we}function jd(me){return ei?w(ei.call(me)):{}}function ju(me,we){var Be=we?Qh(me.buffer):me.buffer;return new me.constructor(Be,me.byteOffset,me.length)}function $T(me,we){if(me!==we){var Be=me!==lr,ht=me===null,Kt=me===me,di=h0(me),tr=we!==lr,mr=we===null,Mr=we===we,Ln=h0(we);if(!mr&&!Ln&&!di&&me>we||di&&tr&&Mr&&!mr&&!Ln||ht&&tr&&Mr||!Be&&Mr||!Kt)return 1;if(!ht&&!di&&!Ln&&me<we||Ln&&Be&&Kt&&!ht&&!di||mr&&Be&&Kt||!tr&&Kt||!Mr)return-1}return 0}function Uf(me,we,Be){for(var ht=-1,Kt=me.criteria,di=we.criteria,tr=Kt.length,mr=Be.length;++ht<tr;){var Mr=$T(Kt[ht],di[ht]);if(Mr){if(ht>=mr)return Mr;var Ln=Be[ht];return Mr*(Ln=="desc"?-1:1)}}return me.index-we.index}function mx(me,we,Be,ht){for(var Kt=-1,di=me.length,tr=Be.length,mr=-1,Mr=we.length,Ln=De(di-tr,0),Bn=m(Mr+Ln),Xn=!ht;++mr<Mr;)Bn[mr]=we[mr];for(;++Kt<tr;)(Xn||Kt<di)&&(Bn[Be[Kt]]=me[Kt]);for(;Ln--;)Bn[mr++]=me[Kt++];return Bn}function gx(me,we,Be,ht){for(var Kt=-1,di=me.length,tr=-1,mr=Be.length,Mr=-1,Ln=we.length,Bn=De(di-mr,0),Xn=m(Bn+Ln),Jo=!ht;++Kt<Bn;)Xn[Kt]=me[Kt];for(var Ma=Kt;++Mr<Ln;)Xn[Ma+Mr]=we[Mr];for(;++tr<mr;)(Jo||Kt<di)&&(Xn[Ma+Be[tr]]=me[Kt++]);return Xn}function Gf(me,we){var Be=-1,ht=me.length;for(we||(we=m(ht));++Be<ht;)we[Be]=me[Be];return we}function Vm(me,we,Be,ht){var Kt=!Be;Be||(Be={});for(var di=-1,tr=we.length;++di<tr;){var mr=we[di],Mr=ht?ht(Be[mr],me[mr],mr,Be,me):lr;Mr===lr&&(Mr=me[mr]),Kt?Va(Be,mr,Mr):Or(Be,mr,Mr)}return Be}function dy(me,we){return Vm(me,kA(me),we)}function ah(me,we){return Vm(me,hN(me),we)}function G_(me,we){return function(Be,ht){var Kt=$s(Be)?EOi:eo,di=we?we():{};return Kt(Be,me,ns(ht,2),di)}}function _x(me){return Wr(function(we,Be){var ht=-1,Kt=Be.length,di=Kt>1?Be[Kt-1]:lr,tr=Kt>2?Be[2]:lr;for(di=me.length>3&&typeof di=="function"?(Kt--,di):lr,tr&&fm(Be[0],Be[1],tr)&&(di=Kt<3?lr:di,Kt=1),we=w(we);++ht<Kt;){var mr=Be[ht];mr&&me(we,mr,ht,di)}return we})}function eS(me,we){return function(Be,ht){if(Be==null)return Be;if(!Hp(Be))return me(Be,ht);for(var Kt=Be.length,di=we?Kt:-1,tr=w(Be);(we?di--:++di<Kt)&&ht(tr[di],di,tr)!==!1;);return Be}}function fy(me){return function(we,Be,ht){for(var Kt=-1,di=w(we),tr=ht(we),mr=tr.length;mr--;){var Mr=tr[me?mr:++Kt];if(Be(di[Mr],Mr,di)===!1)break}return we}}function tS(me,we,Be){var ht=we&mA,Kt=WC(me);function di(){var tr=this&&this!==Zv&&this instanceof di?Kt:me;return tr.apply(ht?Be:this,arguments)}return di}function iS(me){return function(we){we=Mc(we);var Be=l8(we)?LT(we):lr,ht=Be?Be[0]:we.charAt(0),Kt=Be?zp(Be,1).join(""):we.slice(1);return ht[me]()+Kt}}function py(me){return function(we){return TMe(Hr(pI(we).replace(hOi,"")),me,"")}}function WC(me){return function(){var we=arguments;switch(we.length){case 0:return new me;case 1:return new me(we[0]);case 2:return new me(we[0],we[1]);case 3:return new me(we[0],we[1],we[2]);case 4:return new me(we[0],we[1],we[2],we[3]);case 5:return new me(we[0],we[1],we[2],we[3],we[4]);case 6:return new me(we[0],we[1],we[2],we[3],we[4],we[5]);case 7:return new me(we[0],we[1],we[2],we[3],we[4],we[5],we[6])}var Be=Nt(me.prototype),ht=me.apply(Be,we);return wu(ht)?ht:Be}}function vx(me,we,Be){var ht=WC(me);function Kt(){for(var di=arguments.length,tr=m(di),mr=di,Mr=dp(Kt);mr--;)tr[mr]=arguments[mr];var Ln=di<3&&tr[0]!==Mr&&tr[di-1]!==Mr?[]:HO(tr,Mr);if(di-=Ln.length,di<Be)return Ti(me,we,rS,Kt.placeholder,lr,tr,Ln,lr,lr,Be-di);var Bn=this&&this!==Zv&&this instanceof Kt?ht:me;return gb(Bn,this,tr)}return Kt}function BA(me){return function(we,Be,ht){var Kt=w(we);if(!Hp(we)){var di=ns(Be,3);we=qf(we),Be=function(mr){return di(Kt[mr],mr,Kt)}}var tr=me(we,Be,ht);return tr>-1?Kt[di?we[tr]:tr]:lr}}function YP(me){return zm(function(we){var Be=we.length,ht=Be,Kt=ai.prototype.thru;for(me&&we.reverse();ht--;){var di=we[ht];if(typeof di!="function")throw new T(fA);if(Kt&&!tr&&qP(di)=="wrapper")var tr=new ai([],!0)}for(ht=tr?ht:Be;++ht<Be;){di=we[ht];var mr=qP(di),Mr=mr=="wrapper"?wg(di):lr;Mr&&zA(Mr[0])&&Mr[1]==(SD|CP|bP|FX)&&!Mr[4].length&&Mr[9]==1?tr=tr[qP(Mr[0])].apply(tr,Mr[3]):tr=di.length==1&&zA(di)?tr[mr]():tr.thru(di)}return function(){var Ln=arguments,Bn=Ln[0];if(tr&&Ln.length==1&&$s(Bn))return tr.plant(Bn).value();for(var Xn=0,Jo=Be?we[Xn].apply(this,Ln):Bn;++Xn<Be;)Jo=we[Xn].call(this,Jo);return Jo}})}function rS(me,we,Be,ht,Kt,di,tr,mr,Mr,Ln){var Bn=we&SD,Xn=we&mA,Jo=we&w4,Ma=we&(CP|r8),Bs=we&DMe,Pl=Jo?lr:WC(me);function Go(){for(var rl=arguments.length,Au=m(rl),_m=rl;_m--;)Au[_m]=arguments[_m];if(Ma)var oc=dp(Go),vm=OOi(Au,oc);if(ht&&(Au=mx(Au,ht,Kt,Ma)),di&&(Au=gx(Au,di,tr,Ma)),rl-=vm,Ma&&rl<Ln){var Xd=HO(Au,oc);return Ti(me,we,rS,Go.placeholder,Be,Au,Xd,mr,Mr,Ln-rl)}var Jd=Xn?Be:this,$_=Jo?Jd[me]:me;return rl=Au.length,mr?Au=Wf(Au,mr):Bs&&rl>1&&Au.reverse(),Bn&&Mr<rl&&(Au.length=Mr),this&&this!==Zv&&this instanceof Go&&($_=Pl||WC($_)),$_.apply(Jd,Au)}return Go}function oL(me,we){return function(Be,ht){return Ul(Be,me,we(ht),{})}}function Ve(me,we){return function(Be,ht){var Kt;if(Be===lr&&ht===lr)return we;if(Be!==lr&&(Kt=Be),ht!==lr){if(Kt===lr)return ht;typeof Be=="string"||typeof ht=="string"?(Be=Ns(Be),ht=Ns(ht)):(Be=Os(Be),ht=Os(ht)),Kt=me(Be,ht)}return Kt}}function _e(me){return zm(function(we){return we=np(we,_b(ns())),Wr(function(Be){var ht=this;return me(we,function(Kt){return gb(Kt,ht,Be)})})})}function Me(me,we){we=we===lr?" ":Ns(we);var Be=we.length;if(Be<2)return Be?An(we,me):we;var ht=An(we,de(me/i8(we)));return l8(we)?zp(LT(ht),0,me).join(""):ht.slice(0,me)}function Ge(me,we,Be,ht){var Kt=we&mA,di=WC(me);function tr(){for(var mr=-1,Mr=arguments.length,Ln=-1,Bn=ht.length,Xn=m(Bn+Mr),Jo=this&&this!==Zv&&this instanceof tr?di:me;++Ln<Bn;)Xn[Ln]=ht[Ln];for(;Mr--;)Xn[Ln++]=arguments[++mr];return gb(Jo,Kt?Be:this,Xn)}return tr}function st(me){return function(we,Be,ht){return ht&&typeof ht!="number"&&fm(we,Be,ht)&&(Be=ht=lr),we=yy(we),Be===lr?(Be=we,we=0):Be=yy(Be),ht=ht===lr?we<Be?1:-1:yy(ht),Pn(we,Be,ht,me)}}function kt(me){return function(we,Be){return typeof we=="string"&&typeof Be=="string"||(we=bf(we),Be=bf(Be)),me(we,Be)}}function Ti(me,we,Be,ht,Kt,di,tr,mr,Mr,Ln){var Bn=we&CP,Xn=Bn?tr:lr,Jo=Bn?lr:tr,Ma=Bn?di:lr,Bs=Bn?lr:di;we|=Bn?bP:n8,we&=~(Bn?n8:bP),we&alt||(we&=~(mA|w4));var Pl=[me,we,Kt,Ma,Xn,Bs,Jo,mr,Mr,Ln],Go=Be.apply(lr,Pl);return zA(me)&&sL(Go,Pl),Go.placeholder=ht,cS(Go,me,we)}function Vi(me){var we=C[me];return function(Be,ht){if(Be=bf(Be),ht=ht==null?0:Oe(Sl(ht),292),ht&&he(Be)){var Kt=(Mc(Be)+"e").split("e"),di=we(Kt[0]+"e"+(+Kt[1]+ht));return Kt=(Mc(di)+"e").split("e"),+(Kt[0]+"e"+(+Kt[1]-ht))}return we(Be)}}var Hi=ft&&1/cse(new ft([,-0]))[1]==b4?function(me){return new ft(me)}:Mg;function pi(me){return function(we){var Be=dm(we);return Be==RT?MMe(we):Be==OT?HOi(we):ROi(we,me(we))}}function Qi(me,we,Be,ht,Kt,di,tr,mr){var Mr=we&w4;if(!Mr&&typeof me!="function")throw new T(fA);var Ln=ht?ht.length:0;if(Ln||(we&=~(bP|n8),ht=Kt=lr),tr=tr===lr?tr:De(Sl(tr),0),mr=mr===lr?mr:Sl(mr),Ln-=Kt?Kt.length:0,we&n8){var Bn=ht,Xn=Kt;ht=Kt=lr}var Jo=Mr?lr:wg(me),Ma=[me,we,Be,ht,Kt,Bn,Xn,di,tr,mr];if(Jo&&yG(Ma,Jo),me=Ma[0],we=Ma[1],Be=Ma[2],ht=Ma[3],Kt=Ma[4],mr=Ma[9]=Ma[9]===lr?Mr?0:me.length:De(Ma[9]-Ln,0),!mr&&we&(CP|r8)&&(we&=~(CP|r8)),!we||we==mA)var Bs=tS(me,we,Be);else we==CP||we==r8?Bs=vx(me,we,mr):(we==bP||we==(mA|bP))&&!Kt.length?Bs=Ge(me,we,Be,ht):Bs=rS.apply(lr,Ma);var Pl=Jo?$o:sL;return cS(Pl(Bs,Ma),me,we)}function dr(me,we,Be,ht){return me===lr||t_(me,I[Be])&&!L.call(ht,Be)?we:me}function bn(me,we,Be,ht,Kt,di){return wu(me)&&wu(we)&&(di.set(we,me),gf(me,we,lr,bn,di),di.delete(we)),me}function go(me){return Cf(me)?lr:me}function Uo(me,we,Be,ht,Kt,di){var tr=Be&t8,mr=me.length,Mr=we.length;if(mr!=Mr&&!(tr&&Mr>mr))return!1;var Ln=di.get(me),Bn=di.get(we);if(Ln&&Bn)return Ln==we&&Bn==me;var Xn=-1,Jo=!0,Ma=Be&sse?new wt:lr;for(di.set(me,we),di.set(we,me);++Xn<mr;){var Bs=me[Xn],Pl=we[Xn];if(ht)var Go=tr?ht(Pl,Bs,Xn,we,me,di):ht(Bs,Pl,Xn,me,we,di);if(Go!==lr){if(Go)continue;Jo=!1;break}if(Ma){if(!SMe(we,function(rl,Au){if(!NX(Ma,Au)&&(Bs===rl||Kt(Bs,rl,Be,ht,di)))return Ma.push(Au)})){Jo=!1;break}}else if(!(Bs===Pl||Kt(Bs,Pl,Be,ht,di))){Jo=!1;break}}return di.delete(me),di.delete(we),Jo}function Yd(me,we,Be,ht,Kt,di,tr){switch(Be){case s8:if(me.byteLength!=we.byteLength||me.byteOffset!=we.byteOffset)return!1;me=me.buffer,we=we.buffer;case GX:return!(me.byteLength!=we.byteLength||!di(new J(me),new J(we)));case BX:case kX:case VX:return t_(+me,+we);case gse:return me.name==we.name&&me.message==we.message;case zX:case HX:return me==we+"";case RT:var mr=MMe;case OT:var Mr=ht&t8;if(mr||(mr=cse),me.size!=we.size&&!Mr)return!1;var Ln=tr.get(me);if(Ln)return Ln==we;ht|=sse,tr.set(me,we);var Bn=Uo(mr(me),mr(we),ht,Kt,di,tr);return tr.delete(me),Bn;case dse:if(ei)return ei.call(me)==ei.call(we)}return!1}function nc(me,we,Be,ht,Kt,di){var tr=Be&t8,mr=yx(me),Mr=mr.length,Ln=yx(we),Bn=Ln.length;if(Mr!=Bn&&!tr)return!1;for(var Xn=Mr;Xn--;){var Jo=mr[Xn];if(!(tr?Jo in we:L.call(we,Jo)))return!1}var Ma=di.get(me),Bs=di.get(we);if(Ma&&Bs)return Ma==we&&Bs==me;var Pl=!0;di.set(me,we),di.set(we,me);for(var Go=tr;++Xn<Mr;){Jo=mr[Xn];var rl=me[Jo],Au=we[Jo];if(ht)var _m=tr?ht(Au,rl,Jo,we,me,di):ht(rl,Au,Jo,me,we,di);if(!(_m===lr?rl===Au||Kt(rl,Au,Be,ht,di):_m)){Pl=!1;break}Go||(Go=Jo=="constructor")}if(Pl&&!Go){var oc=me.constructor,vm=we.constructor;oc!=vm&&"constructor"in me&&"constructor"in we&&!(typeof oc=="function"&&oc instanceof oc&&typeof vm=="function"&&vm instanceof vm)&&(Pl=!1)}return di.delete(me),di.delete(we),Pl}function zm(me){return lL(fN(me,lr,Nb),me+"")}function yx(me){return Kn(me,qf,kA)}function l0(me){return Kn(me,Pg,hN)}var wg=At?function(me){return At.get(me)}:Mg;function qP(me){for(var we=me.name+"",Be=bt[we],ht=L.call(bt,we)?Be.length:0;ht--;){var Kt=Be[ht],di=Kt.func;if(di==null||di==me)return Kt.name}return we}function dp(me){var we=L.call(Je,"placeholder")?Je:me;return we.placeholder}function ns(){var me=Je.iteratee||Up;return me=me===Up?Wn:me,arguments.length?me(arguments[0],arguments[1]):me}function Ib(me,we){var Be=me.__data__;return VA(we)?Be[typeof we=="string"?"string":"hash"]:Be.map}function vc(me){for(var we=qf(me),Be=we.length;Be--;){var ht=we[Be],Kt=me[ht];we[Be]=[ht,Kt,oS(Kt)]}return we}function jC(me,we){var Be=kOi(me,we);return Wl(Be)?Be:lr}function mk(me){var we=L.call(me,ne),Be=me[ne];try{me[ne]=lr;var ht=!0}catch{}var Kt=F.call(me);return ht&&(we?me[ne]=Be:delete me[ne]),Kt}var kA=pe?function(me){return me==null?[]:(me=w(me),VO(pe(me),function(we){return ee.call(me,we)}))}:AS,hN=pe?function(me){for(var we=[];me;)zO(we,kA(me)),me=Y(me);return we}:AS,dm=Un;(at&&dm(new at(new ArrayBuffer(1)))!=s8||Pt&&dm(new Pt)!=RT||Qe&&dm(Qe.resolve())!=ult||ft&&dm(new ft)!=OT||Ot&&dm(new Ot)!=UX)&&(dm=function(me){var we=Un(me),Be=we==PD?me.constructor:lr,ht=Be?Tg(Be):"";if(ht)switch(ht){case gt:return s8;case It:return RT;case Jt:return ult;case bi:return OT;case Yi:return UX}return we});function dN(me,we,Be){for(var ht=-1,Kt=Be.length;++ht<Kt;){var di=Be[ht],tr=di.size;switch(di.type){case"drop":me+=tr;break;case"dropRight":we-=tr;break;case"take":we=Oe(we,me+tr);break;case"takeRight":me=De(me,we-tr);break}}return{start:me,end:we}}function XP(me){var we=me.match(F3i);return we?we[1].split(B3i):[]}function xx(me,we,Be){we=bu(we,me);for(var ht=-1,Kt=we.length,di=!1;++ht<Kt;){var tr=Eg(we[ht]);if(!(di=me!=null&&Be(me,tr)))break;me=me[tr]}return di||++ht!=Kt?di:(Kt=me==null?0:me.length,!!Kt&&qd(Kt)&&Z0(tr,Kt)&&($s(me)||Y_(me)))}function nS(me){var we=me.length,Be=new me.constructor(we);return we&&typeof me[0]=="string"&&L.call(me,"index")&&(Be.index=me.index,Be.input=me.input),Be}function JP(me){return typeof me.constructor=="function"&&!YC(me)?Nt(Y(me)):{}}function KP(me,we,Be){var ht=me.constructor;switch(we){case GX:return Qh(me);case BX:case kX:return new ht(+me);case s8:return s0(me,Be);case kMe:case VMe:case zMe:case HMe:case UMe:case GMe:case WMe:case jMe:case YMe:return ju(me,Be);case RT:return new ht;case VX:case HX:return new ht(me);case zX:return hp(me);case OT:return new ht;case dse:return jd(me)}}function Ag(me,we){var Be=we.length;if(!Be)return me;var ht=Be-1;return we[ht]=(Be>1?"& ":"")+we[ht],we=we.join(Be>2?", ":" "),me.replace(N3i,`{ /* [wrapped with `+we+`] */ `)}function gk(me){return $s(me)||Y_(me)||!!(ie&&me&&me[ie])}function Z0(me,we){var Be=typeof me;return we=we??kO,!!we&&(Be=="number"||Be!="symbol"&&Y3i.test(me))&&me>-1&&me%1==0&&me<we}function fm(me,we,Be){if(!wu(Be))return!1;var ht=typeof we;return(ht=="number"?Hp(Be)&&Z0(we,Be.length):ht=="string"&&we in Be)?t_(Be[we],me):!1}function Mb(me,we){if($s(me))return!1;var Be=typeof me;return Be=="number"||Be=="symbol"||Be=="boolean"||me==null||h0(me)?!0:D3i.test(me)||!M3i.test(me)||we!=null&&me in w(we)}function VA(me){var we=typeof me;return we=="string"||we=="number"||we=="symbol"||we=="boolean"?me!=="__proto__":me===null}function zA(me){var we=qP(me),Be=Je[we];if(typeof Be!="function"||!(we in wi.prototype))return!1;if(me===Be)return!0;var ht=wg(Be);return!!ht&&me===ht[0]}function _k(me){return!!O&&O in me}var vG=P?_y:Fs;function YC(me){var we=me&&me.constructor,Be=typeof we=="function"&&we.prototype||I;return me===Be}function oS(me){return me===me&&!wu(me)}function aS(me,we){return function(Be){return Be==null?!1:Be[me]===we&&(we!==lr||me in w(Be))}}function sS(me){var we=gl(me,function(ht){return Be.size===a3i&&Be.clear(),ht}),Be=we.cache;return we}function yG(me,we){var Be=me[1],ht=we[1],Kt=Be|ht,di=Kt<(mA|w4|SD),tr=ht==SD&&Be==CP||ht==SD&&Be==FX&&me[7].length<=we[8]||ht==(SD|FX)&&we[7].length<=we[8]&&Be==CP;if(!(di||tr))return me;ht&mA&&(me[2]=we[2],Kt|=Be&mA?0:alt);var mr=we[3];if(mr){var Mr=me[3];me[3]=Mr?mx(Mr,mr,we[4]):mr,me[4]=Mr?HO(me[3],pse):we[4]}return mr=we[5],mr&&(Mr=me[5],me[5]=Mr?gx(Mr,mr,we[6]):mr,me[6]=Mr?HO(me[5],pse):we[6]),mr=we[7],mr&&(me[7]=mr),ht&SD&&(me[8]=me[8]==null?we[8]:Oe(me[8],we[8])),me[9]==null&&(me[9]=we[9]),me[0]=we[0],me[1]=Kt,me}function lS(me){var we=[];if(me!=null)for(var Be in w(me))we.push(Be);return we}function uS(me){return F.call(me)}function fN(me,we,Be){return we=De(we===lr?me.length-1:we,0),function(){for(var ht=arguments,Kt=-1,di=De(ht.length-we,0),tr=m(di);++Kt<di;)tr[Kt]=ht[we+Kt];Kt=-1;for(var mr=m(we+1);++Kt<we;)mr[Kt]=ht[Kt];return mr[we]=Be(tr),gb(me,this,mr)}}function xf(me,we){return we.length<2?me:ln(me,Wa(we,0,-1))}function Wf(me,we){for(var Be=me.length,ht=Oe(we.length,Be),Kt=Gf(me);ht--;){var di=we[ht];me[ht]=Z0(di,Be)?Kt[di]:lr}return me}function aL(me,we){if(!(we==="constructor"&&typeof me[we]=="function")&&we!="__proto__")return me[we]}var sL=HA($o),Db=fe||function(me,we){return Zv.setTimeout(me,we)},lL=HA(du);function cS(me,we,Be){var ht=we+"";return lL(me,Ag(ht,QP(XP(ht),Be)))}function HA(me){var we=0,Be=0;return function(){var ht=Ue(),Kt=c3i-(ht-Be);if(Be=ht,Kt>0){if(++we>=u3i)return arguments[0]}else we=0;return me.apply(lr,arguments)}}function Lb(me,we){var Be=-1,ht=me.length,Kt=ht-1;for(we=we===lr?ht:we;++Be<we;){var di=Ir(Be,Kt),tr=me[di];me[di]=me[Be],me[Be]=tr}return me.length=we,me}var Rb=sS(function(me){var we=[];return me.charCodeAt(0)===46&&we.push(""),me.replace(L3i,function(Be,ht,Kt,di){we.push(Kt?di.replace(z3i,"$1"):ht||Be)}),we});function Eg(me){if(typeof me=="string"||h0(me))return me;var we=me+"";return we=="0"&&1/me==-b4?"-0":we}function Tg(me){if(me!=null){try{return D.call(me)}catch{}try{return me+""}catch{}}return""}function QP(me,we){return pA(g3i,function(Be){var ht="_."+Be[0];we&Be[1]&&!use(me,ht)&&me.push(ht)}),me.sort()}function Ob(me){if(me instanceof wi)return me.clone();var we=new ai(me.__wrapped__,me.__chain__);return we.__actions__=Gf(me.__actions__),we.__index__=me.__index__,we.__values__=me.__values__,we}function vk(me,we,Be){(Be?fm(me,we,Be):we===lr)?we=1:we=De(Sl(we),0);var ht=me==null?0:me.length;if(!ht||we<1)return[];for(var Kt=0,di=0,tr=m(de(ht/we));Kt<ht;)tr[di++]=Wa(me,Kt,Kt+=we);return tr}function yk(me){for(var we=-1,Be=me==null?0:me.length,ht=0,Kt=[];++we<Be;){var di=me[we];di&&(Kt[ht++]=di)}return Kt}function xk(){var me=arguments.length;if(!me)return[];for(var we=m(me-1),Be=arguments[0],ht=me;ht--;)we[ht-1]=arguments[ht];return zO($s(Be)?Gf(Be):[Be],$e(we,1))}var xG=Wr(function(me,we){return qc(me)?Ct(me,$e(we,1,qc,!0)):[]}),pN=Wr(function(me,we){var Be=$0(we);return qc(Be)&&(Be=lr),qc(me)?Ct(me,$e(we,1,qc,!0),ns(Be,2)):[]}),qC=Wr(function(me,we){var Be=$0(we);return qc(Be)&&(Be=lr),qc(me)?Ct(me,$e(we,1,qc,!0),lr,Be):[]});function hS(me,we,Be){var ht=me==null?0:me.length;return ht?(we=Be||we===lr?1:Sl(we),Wa(me,we<0?0:we,ht)):[]}function mN(me,we,Be){var ht=me==null?0:me.length;return ht?(we=Be||we===lr?1:Sl(we),we=ht-we,Wa(me,0,we<0?0:we)):[]}function vi(me,we){return me&&me.length?Bc(me,ns(we,3),!0,!0):[]}function my(me,we){return me&&me.length?Bc(me,ns(we,3),!0):[]}function ZP(me,we,Be,ht){var Kt=me==null?0:me.length;return Kt?(Be&&typeof Be!="number"&&fm(me,we,Be)&&(Be=0,ht=Kt),qe(me,we,Be,ht)):[]}function u0(me,we,Be){var ht=me==null?0:me.length;if(!ht)return-1;var Kt=Be==null?0:Sl(Be);return Kt<0&&(Kt=De(ht+Kt,0)),fse(me,ns(we,3),Kt)}function pu(me,we,Be){var ht=me==null?0:me.length;if(!ht)return-1;var Kt=ht-1;return Be!==lr&&(Kt=Sl(Be),Kt=Be<0?De(ht+Kt,0):Oe(Kt,ht-1)),fse(me,ns(we,3),Kt,!0)}function Nb(me){var we=me==null?0:me.length;return we?$e(me,1):[]}function Ck(me){var we=me==null?0:me.length;return we?$e(me,b4):[]}function dS(me,we){var Be=me==null?0:me.length;return Be?(we=we===lr?1:Sl(we),$e(me,we)):[]}function Fb(me){for(var we=-1,Be=me==null?0:me.length,ht={};++we<Be;){var Kt=me[we];ht[Kt[0]]=Kt[1]}return ht}function bk(me){return me&&me.length?me[0]:lr}function $P(me,we,Be){var ht=me==null?0:me.length;if(!ht)return-1;var Kt=Be==null?0:Sl(Be);return Kt<0&&(Kt=De(ht+Kt,0)),u8(me,we,Kt)}function uL(me){var we=me==null?0:me.length;return we?Wa(me,0,-1):[]}var cL=Wr(function(me){var we=np(me,Vp);return we.length&&we[0]===me[0]?fl(we):[]}),wk=Wr(function(me){var we=$0(me),Be=np(me,Vp);return we===$0(Be)?we=lr:Be.pop(),Be.length&&Be[0]===me[0]?fl(Be,ns(we,2)):[]}),Cx=Wr(function(me){var we=$0(me),Be=np(me,Vp);return we=typeof we=="function"?we:lr,we&&Be.pop(),Be.length&&Be[0]===me[0]?fl(Be,lr,we):[]});function CG(me,we){return me==null?"":Ce.call(me,we)}function $0(me){var we=me==null?0:me.length;return we?me[we-1]:lr}function UA(me,we,Be){var ht=me==null?0:me.length;if(!ht)return-1;var Kt=ht;return Be!==lr&&(Kt=Sl(Be),Kt=Kt<0?De(ht+Kt,0):Oe(Kt,ht-1)),we===we?GOi(me,we,Kt):fse(me,Jlt,Kt,!0)}function bG(me,we){return me&&me.length?ke(me,Sl(we)):lr}var pm=Wr(jf);function jf(me,we){return me&&me.length&&we&&we.length?ni(me,we):me}function jl(me,we,Be){return me&&me.length&&we&&we.length?ni(me,we,ns(Be,2)):me}function Yl(me,we,Be){return me&&me.length&&we&&we.length?ni(me,we,lr,Be):me}var ql=zm(function(me,we){var Be=me==null?0:me.length,ht=za(me,we);return _r(me,np(we,function(Kt){return Z0(Kt,Be)?+Kt:Kt}).sort($T)),ht});function Xl(me,we){var Be=[];if(!(me&&me.length))return Be;var ht=-1,Kt=[],di=me.length;for(we=ns(we,3);++ht<di;){var tr=me[ht];we(tr,ht,me)&&(Be.push(tr),Kt.push(ht))}return _r(me,Kt),Be}function El(me){return me==null?me:ut.call(me)}function sl(me,we,Be){var ht=me==null?0:me.length;return ht?(Be&&typeof Be!="number"&&fm(me,we,Be)?(we=0,Be=ht):(we=we==null?0:Sl(we),Be=Be===lr?ht:Sl(Be)),Wa(me,we,Be)):[]}function Jl(me,we){return Hs(me,we)}function Kl(me,we,Be){return Wu(me,we,ns(Be,2))}function Xs(me,we){var Be=me==null?0:me.length;if(Be){var ht=Hs(me,we);if(ht<Be&&t_(me[ht],we))return ht}return-1}function Ql(me,we){return Hs(me,we,!0)}function Zl(me,we,Be){return Wu(me,we,ns(Be,2),!0)}function $l(me,we){var Be=me==null?0:me.length;if(Be){var ht=Hs(me,we,!0)-1;if(t_(me[ht],we))return ht}return-1}function eu(me){return me&&me.length?Ic(me):[]}function tu(me,we){return me&&me.length?Ic(me,ns(we,2)):[]}function Ll(me){var we=me==null?0:me.length;return we?Wa(me,1,we):[]}function Rl(me,we,Be){return me&&me.length?(we=Be||we===lr?1:Sl(we),Wa(me,0,we<0?0:we)):[]}function iu(me,we,Be){var ht=me==null?0:me.length;return ht?(we=Be||we===lr?1:Sl(we),we=ht-we,Wa(me,we<0?0:we,ht)):[]}function ru(me,we){return me&&me.length?Bc(me,ns(we,3),!1,!0):[]}function Tl(me,we){return me&&me.length?Bc(me,ns(we,3)):[]}var pl=Wr(function(me){return _c($e(me,1,qc,!0))}),ml=Wr(function(me){var we=$0(me);return qc(we)&&(we=lr),_c($e(me,1,qc,!0),ns(we,2))}),nu=Wr(function(me){var we=$0(me);return we=typeof we=="function"?we:lr,_c($e(me,1,qc,!0),lr,we)});function Ol(me){return me&&me.length?_c(me):[]}function ou(me,we){return me&&me.length?_c(me,ns(we,2)):[]}function gy(me,we){return we=typeof we=="function"?we:lr,me&&me.length?_c(me,lr,we):[]}function GA(me){if(!(me&&me.length))return[];var we=0;return me=VO(me,function(Be){if(qc(Be))return we=De(Be.length,we),!0}),PMe(we,function(Be){return np(me,FMe(Be))})}function bx(me,we){if(!(me&&me.length))return[];var Be=GA(me);return we==null?Be:np(Be,function(ht){return gb(we,lr,ht)})}var c0=Wr(function(me,we){return qc(me)?Ct(me,we):[]}),gN=Wr(function(me){return cp(VO(me,qc))}),hL=Wr(function(me){var we=$0(me);return qc(we)&&(we=lr),cp(VO(me,qc),ns(we,2))}),dL=Wr(function(me){var we=$0(me);return we=typeof we=="function"?we:lr,cp(VO(me,qc),lr,we)}),WA=Wr(GA);function Yo(me,we){return yf(me||[],we||[],Or)}function Qo(me,we){return yf(me||[],we||[],Zo)}var Ya=Wr(function(me){var we=me.length,Be=we>1?me[we-1]:lr;return Be=typeof Be=="function"?(me.pop(),Be):lr,bx(me,Be)});function Ca(me){var we=Je(me);return we.__chain__=!0,we}function Es(me,we){return we(me),me}function Ka(me,we){return we(me)}var ys=zm(function(me){var we=me.length,Be=we?me[0]:0,ht=this.__wrapped__,Kt=function(di){return za(di,me)};return we>1||this.__actions__.length||!(ht instanceof wi)||!Z0(Be)?this.thru(Kt):(ht=ht.slice(Be,+Be+(we?1:0)),ht.__actions__.push({func:Ka,args:[Kt],thisArg:lr}),new ai(ht,this.__chain__).thru(function(di){return we&&!di.length&&di.push(lr),di}))});function Nl(){return Ca(this)}function Fo(){return new ai(this.value(),this.__chain__)}function ri(){this.__values__===lr&&(this.__values__=EL(this.value()));var me=this.__index__>=this.__values__.length,we=me?lr:this.__values__[this.__index__++];return{done:me,value:we}}function eI(){return this}function fL(me){for(var we,Be=this;Be instanceof yi;){var ht=Ob(Be);ht.__index__=0,ht.__values__=lr,we?Kt.__wrapped__=ht:we=ht;var Kt=ht;Be=Be.__wrapped__}return Kt.__wrapped__=me,we}function jA(){var me=this.__wrapped__;if(me instanceof wi){var we=me;return this.__actions__.length&&(we=new wi(this)),we=we.reverse(),we.__actions__.push({func:Ka,args:[El],thisArg:lr}),new ai(we,this.__chain__)}return this.thru(El)}function Ak(){return vf(this.__wrapped__,this.__actions__)}var Sg=G_(function(me,we,Be){L.call(me,Be)?++me[Be]:Va(me,Be,1)});function _N(me,we,Be){var ht=$s(me)?blt:ur;return Be&&fm(me,we,Be)&&(we=lr),ht(me,ns(we,3))}function wG(me,we){var Be=$s(me)?VO:tt;return Be(me,ns(we,3))}var AG=BA(u0),Ek=BA(pu);function pL(me,we){return $e(fS(me,we),1)}function Tk(me,we){return $e(fS(me,we),b4)}function Bb(me,we,Be){return Be=Be===lr?1:Sl(Be),$e(fS(me,we),Be)}function tI(me,we){var Be=$s(me)?pA:Mi;return Be(me,ns(we,3))}function Sk(me,we){var Be=$s(me)?TOi:$i;return Be(me,ns(we,3))}var Pk=G_(function(me,we,Be){L.call(me,Be)?me[Be].push(we):Va(me,Be,[we])});function YA(me,we,Be,ht){me=Hp(me)?me:QA(me),Be=Be&&!ht?Sl(Be):0;var Kt=me.length;return Be<0&&(Be=De(Kt+Be,0)),XA(me)?Be<=Kt&&me.indexOf(we,Be)>-1:!!Kt&&u8(me,we,Be)>-1}var Ik=Wr(function(me,we,Be){var ht=-1,Kt=typeof we=="function",di=Hp(me)?m(me.length):[];return Mi(me,function(tr){di[++ht]=Kt?gb(we,tr,Be):hu(tr,we,Be)}),di}),Mk=G_(function(me,we,Be){Va(me,Be,we)});function fS(me,we){var Be=$s(me)?np:qs;return Be(me,ns(we,3))}function vN(me,we,Be,ht){return me==null?[]:($s(we)||(we=we==null?[]:[we]),Be=ht?lr:Be,$s(Be)||(Be=Be==null?[]:[Be]),Ie(me,we,Be))}var EG=G_(function(me,we,Be){me[Be?0:1].push(we)},function(){return[[],[]]});function Dk(me,we,Be){var ht=$s(me)?TMe:Elt,Kt=arguments.length<3;return ht(me,ns(we,4),Be,Kt,Mi)}function Lk(me,we,Be){var ht=$s(me)?SOi:Elt,Kt=arguments.length<3;return ht(me,ns(we,4),Be,Kt,$i)}function yN(me,we){var Be=$s(me)?VO:tt;return Be(me,yL(ns(we,3)))}function xN(me){var we=$s(me)?pr:Ho;return we(me)}function Rk(me,we,Be){(Be?fm(me,we,Be):we===lr)?we=1:we=Sl(we);var ht=$s(me)?yn:ma;return ht(me,we)}function iI(me){var we=$s(me)?dn:rs;return we(me)}function Ok(me){if(me==null)return 0;if(Hp(me))return XA(me)?i8(me):me.length;var we=dm(me);return we==RT||we==OT?me.size:yo(me).length}function CN(me,we,Be){var ht=$s(me)?SMe:fu;return Be&&fm(me,we,Be)&&(we=lr),ht(me,ns(we,3))}var bN=Wr(function(me,we){if(me==null)return[];var Be=we.length;return Be>1&&fm(me,we[0],we[1])?we=[]:Be>2&&fm(we[0],we[1],we[2])&&(we=[we[0]]),Ie(me,$e(we,1),[])}),kb=ae||function(){return Zv.Date.now()};function Nk(me,we){if(typeof we!="function")throw new T(fA);return me=Sl(me),function(){if(--me<1)return we.apply(this,arguments)}}function W_(me,we,Be){return we=Be?lr:we,we=me&&we==null?me.length:we,Qi(me,SD,lr,lr,lr,lr,we)}function mL(me,we){var Be;if(typeof we!="function")throw new T(fA);return me=Sl(me),function(){return--me>0&&(Be=we.apply(this,arguments)),me<=1&&(we=lr),Be}}var gL=Wr(function(me,we,Be){var ht=mA;if(Be.length){var Kt=HO(Be,dp(gL));ht|=bP}return Qi(me,ht,we,Be,Kt)}),wN=Wr(function(me,we,Be){var ht=mA|w4;if(Be.length){var Kt=HO(Be,dp(wN));ht|=bP}return Qi(we,ht,me,Be,Kt)});function AN(me,we,Be){we=Be?lr:we;var ht=Qi(me,CP,lr,lr,lr,lr,lr,we);return ht.placeholder=AN.placeholder,ht}function rI(me,we,Be){we=Be?lr:we;var ht=Qi(me,r8,lr,lr,lr,lr,lr,we);return ht.placeholder=rI.placeholder,ht}function _L(me,we,Be){var ht,Kt,di,tr,mr,Mr,Ln=0,Bn=!1,Xn=!1,Jo=!0;if(typeof me!="function")throw new T(fA);we=bf(we)||0,wu(Be)&&(Bn=!!Be.leading,Xn="maxWait"in Be,di=Xn?De(bf(Be.maxWait)||0,we):di,Jo="trailing"in Be?!!Be.trailing:Jo);function Ma(Xd){var Jd=ht,$_=Kt;return ht=Kt=lr,Ln=Xd,tr=me.apply($_,Jd),tr}function Bs(Xd){return Ln=Xd,mr=Db(rl,we),Bn?Ma(Xd):tr}function Pl(Xd){var Jd=Xd-Mr,$_=Xd-Ln,i1=we-Jd;return Xn?Oe(i1,di-$_):i1}function Go(Xd){var Jd=Xd-Mr,$_=Xd-Ln;return Mr===lr||Jd>=we||Jd<0||Xn&&$_>=di}function rl(){var Xd=kb();if(Go(Xd))return Au(Xd);mr=Db(rl,Pl(Xd))}function Au(Xd){return mr=lr,Jo&&ht?Ma(Xd):(ht=Kt=lr,tr)}function _m(){mr!==lr&&km(mr),Ln=0,ht=Mr=Kt=mr=lr}function oc(){return mr===lr?tr:Au(kb())}function vm(){var Xd=kb(),Jd=Go(Xd);if(ht=arguments,Kt=this,Mr=Xd,Jd){if(mr===lr)return Bs(Mr);if(Xn)return km(mr),mr=Db(rl,we),Ma(Mr)}return mr===lr&&(mr=Db(rl,we)),tr}return vm.cancel=_m,vm.flush=oc,vm}var EN=Wr(function(me,we){return Bi(me,1,we)}),TG=Wr(function(me,we,Be){return Bi(me,bf(we)||0,Be)});function vL(me){return Qi(me,DMe)}function gl(me,we){if(typeof me!="function"||we!=null&&typeof we!="function")throw new T(fA);var Be=function(){var ht=arguments,Kt=we?we.apply(this,ht):ht[0],di=Be.cache;if(di.has(Kt))return di.get(Kt);var tr=me.apply(this,ht);return Be.cache=di.set(Kt,tr)||di,tr};return Be.cache=new(gl.Cache||Yt),Be}gl.Cache=Yt;function yL(me){if(typeof me!="function")throw new T(fA);return function(){var we=arguments;switch(we.length){case 0:return!me.call(this);case 1:return!me.call(this,we[0]);case 2:return!me.call(this,we[0],we[1]);case 3:return!me.call(this,we[0],we[1],we[2])}return!me.apply(this,we)}}function Fk(me){return mL(2,me)}var nI=hy(function(me,we){we=we.length==1&&$s(we[0])?np(we[0],_b(ns())):np($e(we,1),_b(ns()));var Be=we.length;return Wr(function(ht){for(var Kt=-1,di=Oe(ht.length,Be);++Kt<di;)ht[Kt]=we[Kt].call(this,ht[Kt]);return gb(me,this,ht)})}),xL=Wr(function(me,we){var Be=HO(we,dp(xL));return Qi(me,bP,lr,we,Be)}),Bk=Wr(function(me,we){var Be=HO(we,dp(Bk));return Qi(me,n8,lr,we,Be)}),SG=zm(function(me,we){return Qi(me,FX,lr,lr,lr,we)});function j_(me,we){if(typeof me!="function")throw new T(fA);return we=we===lr?we:Sl(we),Wr(me,we)}function kk(me,we){if(typeof me!="function")throw new T(fA);return we=we==null?0:De(Sl(we),0),Wr(function(Be){var ht=Be[we],Kt=zp(Be,0,we);return ht&&zO(Kt,ht),gb(me,this,Kt)})}function CL(me,we,Be){var ht=!0,Kt=!0;if(typeof me!="function")throw new T(fA);return wu(Be)&&(ht="leading"in Be?!!Be.leading:ht,Kt="trailing"in Be?!!Be.trailing:Kt),_L(me,we,{leading:ht,maxWait:we,trailing:Kt})}function TN(me){return W_(me,1)}function SN(me,we){return xL(Hf(we),me)}function PN(){if(!arguments.length)return[];var me=arguments[0];return $s(me)?me:[me]}function Hm(me){return Ci(me,e8)}function e_(me,we){return we=typeof we=="function"?we:lr,Ci(me,e8,we)}function pS(me){return Ci(me,BO|e8)}function IN(me,we){return we=typeof we=="function"?we:lr,Ci(me,BO|e8,we)}function bL(me,we){return we==null||cr(me,we,qf(we))}function t_(me,we){return me===we||me!==me&&we!==we}var MN=kt(Qn),Vk=kt(function(me,we){return me>=we}),Y_=Ys(function(){return arguments}())?Ys:function(me){return Ad(me)&&L.call(me,"callee")&&!ee.call(me,"callee")},$s=m.isArray,q_=glt?_b(glt):Wd;function Hp(me){return me!=null&&qd(me.length)&&!_y(me)}function qc(me){return Ad(me)&&Hp(me)}function mS(me){return me===!0||me===!1||Ad(me)&&Un(me)==BX}var i_=ce||Fs,gS=_lt?_b(_lt):Pc;function PG(me){return Ad(me)&&me.nodeType===1&&!Cf(me)}function IG(me){if(me==null)return!0;if(Hp(me)&&($s(me)||typeof me=="string"||typeof me.splice=="function"||i_(me)||vy(me)||Y_(me)))return!me.length;var we=dm(me);if(we==RT||we==OT)return!me.size;if(YC(me))return!yo(me).length;for(var Be in me)if(L.call(me,Be))return!1;return!0}function MG(me,we){return So(me,we)}function DN(me,we,Be){Be=typeof Be=="function"?Be:lr;var ht=Be?Be(me,we):lr;return ht===lr?So(me,we,lr,Be):!!ht}function wL(me){if(!Ad(me))return!1;var we=Un(me);return we==gse||we==v3i||typeof me.message=="string"&&typeof me.name=="string"&&!Cf(me)}function LN(me){return typeof me=="number"&&he(me)}function _y(me){if(!wu(me))return!1;var we=Un(me);return we==_se||we==llt||we==_3i||we==x3i}function RN(me){return typeof me=="number"&&me==Sl(me)}function qd(me){return typeof me=="number"&&me>-1&&me%1==0&&me<=kO}function wu(me){var we=typeof me;return me!=null&&(we=="object"||we=="function")}function Ad(me){return me!=null&&typeof me=="object"}var zk=vlt?_b(vlt):mf;function oI(me,we){return me===we||Gl(me,we,vc(we))}function Vb(me,we,Be){return Be=typeof Be=="function"?Be:lr,Gl(me,we,vc(we),Be)}function Hk(me){return X_(me)&&me!=+me}function Uk(me){if(vG(me))throw new y(n3i);return Wl(me)}function Gk(me){return me===null}function Wk(me){return me==null}function X_(me){return typeof me=="number"||Ad(me)&&Un(me)==VX}function Cf(me){if(!Ad(me)||Un(me)!=PD)return!1;var we=Y(me);if(we===null)return!0;var Be=L.call(we,"constructor")&&we.constructor;return typeof Be=="function"&&Be instanceof Be&&D.call(Be)==k}var qA=ylt?_b(ylt):Th;function mm(me){return RN(me)&&me>=-kO&&me<=kO}var kc=xlt?_b(xlt):rr;function XA(me){return typeof me=="string"||!$s(me)&&Ad(me)&&Un(me)==HX}function h0(me){return typeof me=="symbol"||Ad(me)&&Un(me)==dse}var vy=Clt?_b(Clt):mo;function ON(me){return me===lr}function aI(me){return Ad(me)&&dm(me)==UX}function jk(me){return Ad(me)&&Un(me)==b3i}var AL=kt(xu),sI=kt(function(me,we){return me<=we});function EL(me){if(!me)return[];if(Hp(me))return XA(me)?LT(me):Gf(me);if(re&&me[re])return zOi(me[re]());var we=dm(me),Be=we==RT?MMe:we==OT?cse:QA;return Be(me)}function yy(me){if(!me)return me===0?me:0;if(me=bf(me),me===b4||me===-b4){var we=me<0?-1:1;return we*f3i}return me===me?me:0}function Sl(me){var we=yy(me),Be=we%1;return we===we?Be?we-Be:we:0}function NN(me){return me?zr(Sl(me),0,wP):0}function bf(me){if(typeof me=="number")return me;if(h0(me))return hse;if(wu(me)){var we=typeof me.valueOf=="function"?me.valueOf():me;me=wu(we)?we+"":we}if(typeof me!="string")return me===0?me:+me;me=Tlt(me);var Be=G3i.test(me);return Be||j3i.test(me)?wOi(me.slice(2),Be?2:8):U3i.test(me)?hse:+me}function TL(me){return Vm(me,Pg(me))}function FN(me){return me?zr(Sl(me),-kO,kO):me===0?me:0}function Mc(me){return me==null?"":Ns(me)}var BN=_x(function(me,we){if(YC(we)||Hp(we)){Vm(we,qf(we),me);return}for(var Be in we)L.call(we,Be)&&Or(me,Be,we[Be])}),kN=_x(function(me,we){Vm(we,Pg(we),me)}),lI=_x(function(me,we,Be,ht){Vm(we,Pg(we),me,ht)}),XC=_x(function(me,we,Be,ht){Vm(we,qf(we),me,ht)}),JA=zm(za);function SL(me,we){var Be=Nt(me);return we==null?Be:Cn(Be,we)}var PL=Wr(function(me,we){me=w(me);var Be=-1,ht=we.length,Kt=ht>2?we[2]:lr;for(Kt&&fm(we[0],we[1],Kt)&&(ht=1);++Be<ht;)for(var di=we[Be],tr=Pg(di),mr=-1,Mr=tr.length;++mr<Mr;){var Ln=tr[mr],Bn=me[Ln];(Bn===lr||t_(Bn,I[Ln])&&!L.call(me,Ln))&&(me[Ln]=di[Ln])}return me}),uI=Wr(function(me){return me.push(lr,bn),gb(_S,lr,me)});function KA(me,we){return wlt(me,ns(we,3),ui)}function Is(me,we){return wlt(me,ns(we,3),hr)}function IL(me,we){return me==null?me:St(me,ns(we,3),Pg)}function ML(me,we){return me==null?me:Zt(me,ns(we,3),Pg)}function JC(me,we){return me&&ui(me,ns(we,3))}function Yk(me,we){return me&&hr(me,ns(we,3))}function cI(me){return me==null?[]:Yr(me,qf(me))}function hI(me){return me==null?[]:Yr(me,Pg(me))}function Yf(me,we,Be){var ht=me==null?lr:ln(me,we);return ht===lr?Be:ht}function qk(me,we){return me!=null&&xx(me,we,Pa)}function VN(me,we){return me!=null&&xx(me,we,Gn)}var KC=oL(function(me,we,Be){we!=null&&typeof we.toString!="function"&&(we=F.call(we)),me[we]=Be},p0(Ph)),DG=oL(function(me,we,Be){we!=null&&typeof we.toString!="function"&&(we=F.call(we)),L.call(me,we)?me[we].push(Be):me[we]=[Be]},ns),QC=Wr(hu);function qf(me){return Hp(me)?Ii(me):yo(me)}function Pg(me){return Hp(me)?Ii(me,!0):Ga(me)}function zN(me,we){var Be={};return we=ns(we,3),ui(me,function(ht,Kt,di){Va(Be,we(ht,Kt,di),ht)}),Be}function xy(me,we){var Be={};return we=ns(we,3),ui(me,function(ht,Kt,di){Va(Be,Kt,we(ht,Kt,di))}),Be}var gm=_x(function(me,we,Be){gf(me,we,Be)}),_S=_x(function(me,we,Be,ht){gf(me,we,Be,ht)}),HN=zm(function(me,we){var Be={};if(me==null)return Be;var ht=!1;we=np(we,function(di){return di=bu(di,me),ht||(ht=di.length>1),di}),Vm(me,l0(me),Be),ht&&(Be=Ci(Be,BO|olt|e8,go));for(var Kt=we.length;Kt--;)_f(Be,we[Kt]);return Be});function d0(me,we){return Um(me,yL(ns(we)))}var Xk=zm(function(me,we){return me==null?{}:He(me,we)});function Um(me,we){if(me==null)return{};var Be=np(l0(me),function(ht){return[ht]});return we=ns(we),dt(me,Be,function(ht,Kt){return we(ht,Kt[0])})}function ZC(me,we,Be){we=bu(we,me);var ht=-1,Kt=we.length;for(Kt||(Kt=1,me=lr);++ht<Kt;){var di=me==null?lr:me[Eg(we[ht])];di===lr&&(ht=Kt,di=Be),me=_y(di)?di.call(me):di}return me}function DL(me,we,Be){return me==null?me:Zo(me,we,Be)}function $C(me,we,Be,ht){return ht=typeof ht=="function"?ht:lr,me==null?me:Zo(me,we,Be,ht)}var Jk=pi(qf),LL=pi(Pg);function LG(me,we,Be){var ht=$s(me),Kt=ht||i_(me)||vy(me);if(we=ns(we,4),Be==null){var di=me&&me.constructor;Kt?Be=ht?new di:[]:wu(me)?Be=_y(di)?Nt(Y(me)):{}:Be={}}return(Kt?pA:ui)(me,function(tr,mr,Mr){return we(Be,tr,mr,Mr)}),Be}function Kk(me,we){return me==null?!0:_f(me,we)}function vS(me,we,Be){return me==null?me:wd(me,we,Hf(Be))}function yS(me,we,Be,ht){return ht=typeof ht=="function"?ht:lr,me==null?me:wd(me,we,Hf(Be),ht)}function QA(me){return me==null?[]:IMe(me,qf(me))}function RL(me){return me==null?[]:IMe(me,Pg(me))}function dI(me,we,Be){return Be===lr&&(Be=we,we=lr),Be!==lr&&(Be=bf(Be),Be=Be===Be?Be:0),we!==lr&&(we=bf(we),we=we===we?we:0),zr(bf(me),we,Be)}function fI(me,we,Be){return we=yy(we),Be===lr?(Be=we,we=0):Be=yy(Be),me=bf(me),Ja(me,we,Be)}function OL(me,we,Be){if(Be&&typeof Be!="boolean"&&fm(me,we,Be)&&(we=Be=lr),Be===lr&&(typeof we=="boolean"?(Be=we,we=lr):typeof me=="boolean"&&(Be=me,me=lr)),me===lr&&we===lr?(me=0,we=1):(me=yy(me),we===lr?(we=me,me=0):we=yy(we)),me>we){var ht=me;me=we,we=ht}if(Be||me%1||we%1){var Kt=it();return Oe(me+Kt*(we-me+bOi("1e-"+((Kt+"").length-1))),we)}return Ir(me,we)}var UN=py(function(me,we,Be){return we=we.toLowerCase(),me+(Be?J_(we):we)});function J_(me){return zb(Mc(me).toLowerCase())}function pI(me){return me=Mc(me),me&&me.replace(q3i,NOi).replace(dOi,"")}function mI(me,we,Be){me=Mc(me),we=Ns(we);var ht=me.length;Be=Be===lr?ht:zr(Sl(Be),0,ht);var Kt=Be;return Be-=we.length,Be>=0&&me.slice(Be,Kt)==we}function Cy(me){return me=Mc(me),me&&S3i.test(me)?me.replace(Dlt,FOi):me}function ZA(me){return me=Mc(me),me&&R3i.test(me)?me.replace(LMe,"\\$&"):me}var Qk=py(function(me,we,Be){return me+(Be?"-":"")+we.toLowerCase()}),Zk=py(function(me,we,Be){return me+(Be?" ":"")+we.toLowerCase()}),$k=iS("toLowerCase");function RG(me,we,Be){me=Mc(me),we=Sl(we);var ht=we?i8(me):0;if(!we||ht>=we)return me;var Kt=(we-ht)/2;return Me(ve(Kt),Be)+me+Me(de(Kt),Be)}function OG(me,we,Be){me=Mc(me),we=Sl(we);var ht=we?i8(me):0;return we&&ht<we?me+Me(we-ht,Be):me}function eV(me,we,Be){me=Mc(me),we=Sl(we);var ht=we?i8(me):0;return we&&ht<we?Me(we-ht,Be)+me:me}function NG(me,we,Be){return Be||we==null?we=0:we&&(we=+we),Xe(Mc(me).replace(RMe,""),we||0)}function Ax(me,we,Be){return(Be?fm(me,we,Be):we===lr)?we=1:we=Sl(we),An(Mc(me),we)}function FG(){var me=arguments,we=Mc(me[0]);return me.length<3?we:we.replace(me[1],me[2])}var BG=py(function(me,we,Be){return me+(Be?"_":"")+we.toLowerCase()});function kG(me,we,Be){return Be&&typeof Be!="number"&&fm(me,we,Be)&&(we=Be=lr),Be=Be===lr?wP:Be>>>0,Be?(me=Mc(me),me&&(typeof we=="string"||we!=null&&!qA(we))&&(we=Ns(we),!we&&l8(me))?zp(LT(me),0,Be):me.split(we,Be)):[]}var $A=py(function(me,we,Be){return me+(Be?" ":"")+zb(we)});function sh(me,we,Be){return me=Mc(me),Be=Be==null?0:zr(Sl(Be),0,me.length),we=Ns(we),me.slice(Be,Be+we.length)==we}function Ts(me,we,Be){var ht=Je.templateSettings;Be&&fm(me,we,Be)&&(we=lr),me=Mc(me),we=lI({},we,ht,dr);var Kt=lI({},we.imports,ht.imports,dr),di=qf(Kt),tr=IMe(Kt,di),mr,Mr,Ln=0,Bn=we.interpolate||lse,Xn="__p += '",Jo=A((we.escape||lse).source+"|"+Bn.source+"|"+(Bn===clt?H3i:lse).source+"|"+(we.evaluate||lse).source+"|$","g"),Ma="//# sourceURL="+(L.call(we,"sourceURL")?(we.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++_Oi+"]")+` `;me.replace(Jo,function(Go,rl,Au,_m,oc,vm){return Au||(Au=_m),Xn+=me.slice(Ln,vm).replace(X3i,BOi),rl&&(mr=!0,Xn+=`' + __e(`+rl+`) + '`),oc&&(Mr=!0,Xn+=`'; `+oc+`; __p += '`),Au&&(Xn+=`' + ((__t = (`+Au+`)) == null ? '' : __t) + '`),Ln=vm+Go.length,Go}),Xn+=`'; `;var Bs=L.call(we,"variable")&&we.variable;if(!Bs)Xn=`with (obj) { `+Xn+` } `;else if(V3i.test(Bs))throw new y(o3i);Xn=(Mr?Xn.replace(w3i,""):Xn).replace(A3i,"$1").replace(E3i,"$1;"),Xn="function("+(Bs||"obj")+`) { `+(Bs?"":`obj || (obj = {}); `)+"var __t, __p = ''"+(mr?", __e = _.escape":"")+(Mr?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+Xn+`return __p }`;var Pl=CS(function(){return x(di,Ma+"return "+Xn).apply(lr,tr)});if(Pl.source=Xn,wL(Pl))throw Pl;return Pl}function GN(me){return Mc(me).toLowerCase()}function Ig(me){return Mc(me).toUpperCase()}function NL(me,we,Be){if(me=Mc(me),me&&(Be||we===lr))return Tlt(me);if(!me||!(we=Ns(we)))return me;var ht=LT(me),Kt=LT(we),di=Slt(ht,Kt),tr=Plt(ht,Kt)+1;return zp(ht,di,tr).join("")}function xS(me,we,Be){if(me=Mc(me),me&&(Be||we===lr))return me.slice(0,Klt(me)+1);if(!me||!(we=Ns(we)))return me;var ht=LT(me),Kt=Plt(ht,LT(we))+1;return zp(ht,0,Kt).join("")}function f0(me,we,Be){if(me=Mc(me),me&&(Be||we===lr))return me.replace(RMe,"");if(!me||!(we=Ns(we)))return me;var ht=LT(me),Kt=Slt(ht,LT(we));return zp(ht,Kt).join("")}function Pr(me,we){var Be=s3i,ht=l3i;if(wu(we)){var Kt="separator"in we?we.separator:Kt;Be="length"in we?Sl(we.length):Be,ht="omission"in we?Ns(we.omission):ht}me=Mc(me);var di=me.length;if(l8(me)){var tr=LT(me);di=tr.length}if(Be>=di)return me;var mr=Be-i8(ht);if(mr<1)return ht;var Mr=tr?zp(tr,0,mr).join(""):me.slice(0,mr);if(Kt===lr)return Mr+ht;if(tr&&(mr+=Mr.length-mr),qA(Kt)){if(me.slice(mr).search(Kt)){var Ln,Bn=Mr;for(Kt.global||(Kt=A(Kt.source,Mc(hlt.exec(Kt))+"g")),Kt.lastIndex=0;Ln=Kt.exec(Bn);)var Xn=Ln.index;Mr=Mr.slice(0,Xn===lr?mr:Xn)}}else if(me.indexOf(Ns(Kt),mr)!=mr){var Jo=Mr.lastIndexOf(Kt);Jo>-1&&(Mr=Mr.slice(0,Jo))}return Mr+ht}function eE(me){return me=Mc(me),me&&T3i.test(me)?me.replace(Mlt,WOi):me}var e1=py(function(me,we,Be){return me+(Be?" ":"")+we.toUpperCase()}),zb=iS("toUpperCase");function Hr(me,we,Be){return me=Mc(me),we=Be?lr:we,we===lr?VOi(me)?qOi(me):MOi(me):me.match(we)||[]}var CS=Wr(function(me,we){try{return gb(me,lr,we)}catch(Be){return wL(Be)?Be:new y(Be)}}),os=zm(function(me,we){return pA(we,function(Be){Be=Eg(Be),Va(me,Be,gL(me[Be],me))}),me});function Sh(me){var we=me==null?0:me.length,Be=ns();return me=we?np(me,function(ht){if(typeof ht[1]!="function")throw new T(fA);return[Be(ht[0]),ht[1]]}):[],Wr(function(ht){for(var Kt=-1;++Kt<we;){var di=me[Kt];if(gb(di[0],this,ht))return gb(di[1],this,ht)}})}function tV(me){return Ni(Ci(me,BO))}function p0(me){return function(){return me}}function K_(me,we){return me==null||me!==me?we:me}var bS=YP(),Qr=YP(!0);function Ph(me){return me}function Up(me){return Wn(typeof me=="function"?me:Ci(me,BO))}function iV(me){return Cu(Ci(me,BO))}function _l(me,we){return na(me,Ci(we,BO))}var gI=Wr(function(me,we){return function(Be){return hu(Be,me,we)}}),rV=Wr(function(me,we){return function(Be){return hu(me,Be,we)}});function Hb(me,we,Be){var ht=qf(we),Kt=Yr(we,ht);Be==null&&!(wu(we)&&(Kt.length||!ht.length))&&(Be=we,we=me,me=this,Kt=Yr(we,qf(we)));var di=!(wu(Be)&&"chain"in Be)||!!Be.chain,tr=_y(me);return pA(Kt,function(mr){var Mr=we[mr];me[mr]=Mr,tr&&(me.prototype[mr]=function(){var Ln=this.__chain__;if(di||Ln){var Bn=me(this.__wrapped__),Xn=Bn.__actions__=Gf(this.__actions__);return Xn.push({func:Mr,args:arguments,thisArg:me}),Bn.__chain__=Ln,Bn}return Mr.apply(me,zO([this.value()],arguments))})}),me}function Xf(){return Zv._===this&&(Zv._=U),this}function Mg(){}function Aa(me){return me=Sl(me),Wr(function(we){return ke(we,me)})}var nV=_e(np),Q_=_e(blt),FL=_e(SMe);function by(me){return Mb(me)?FMe(Eg(me)):Vt(me)}function wS(me){return function(we){return me==null?lr:ln(me,we)}}var r_=st(),Ex=st(!0);function AS(){return[]}function Fs(){return!1}function dh(){return{}}function tE(){return""}function Ub(){return!0}function iE(me,we){if(me=Sl(me),me<1||me>kO)return[];var Be=wP,ht=Oe(me,wP);we=ns(we),me-=wP;for(var Kt=PMe(ht,we);++Be<me;)we(Be);return Kt}function Z_(me){return $s(me)?np(me,Eg):h0(me)?[me]:Gf(Rb(Mc(me)))}function Po(me){var we=++R;return Mc(me)+we}var Gb=Ve(function(me,we){return me+we},0),Tx=Vi("ceil"),Qa=Ve(function(me,we){return me/we},1),wy=Vi("floor");function WN(me){return me&&me.length?Nr(me,Ph,Qn):lr}function Ay(me,we){return me&&me.length?Nr(me,ns(we,2),Qn):lr}function m0(me){return Alt(me,Ph)}function Sx(me,we){return Alt(me,ns(we,2))}function ES(me){return me&&me.length?Nr(me,Ph,xu):lr}function rE(me,we){return me&&me.length?Nr(me,ns(we,2),xu):lr}var TS=Ve(function(me,we){return me*we},1),t1=Vi("round"),Ed=Ve(function(me,we){return me-we},0);function jN(me){return me&&me.length?BMe(me,Ph):0}function SS(me,we){return me&&me.length?BMe(me,ns(we,2)):0}return Je.after=Nk,Je.ary=W_,Je.assign=BN,Je.assignIn=kN,Je.assignInWith=lI,Je.assignWith=XC,Je.at=JA,Je.before=mL,Je.bind=gL,Je.bindAll=os,Je.bindKey=wN,Je.castArray=PN,Je.chain=Ca,Je.chunk=vk,Je.compact=yk,Je.concat=xk,Je.cond=Sh,Je.conforms=tV,Je.constant=p0,Je.countBy=Sg,Je.create=SL,Je.curry=AN,Je.curryRight=rI,Je.debounce=_L,Je.defaults=PL,Je.defaultsDeep=uI,Je.defer=EN,Je.delay=TG,Je.difference=xG,Je.differenceBy=pN,Je.differenceWith=qC,Je.drop=hS,Je.dropRight=mN,Je.dropRightWhile=vi,Je.dropWhile=my,Je.fill=ZP,Je.filter=wG,Je.flatMap=pL,Je.flatMapDeep=Tk,Je.flatMapDepth=Bb,Je.flatten=Nb,Je.flattenDeep=Ck,Je.flattenDepth=dS,Je.flip=vL,Je.flow=bS,Je.flowRight=Qr,Je.fromPairs=Fb,Je.functions=cI,Je.functionsIn=hI,Je.groupBy=Pk,Je.initial=uL,Je.intersection=cL,Je.intersectionBy=wk,Je.intersectionWith=Cx,Je.invert=KC,Je.invertBy=DG,Je.invokeMap=Ik,Je.iteratee=Up,Je.keyBy=Mk,Je.keys=qf,Je.keysIn=Pg,Je.map=fS,Je.mapKeys=zN,Je.mapValues=xy,Je.matches=iV,Je.matchesProperty=_l,Je.memoize=gl,Je.merge=gm,Je.mergeWith=_S,Je.method=gI,Je.methodOf=rV,Je.mixin=Hb,Je.negate=yL,Je.nthArg=Aa,Je.omit=HN,Je.omitBy=d0,Je.once=Fk,Je.orderBy=vN,Je.over=nV,Je.overArgs=nI,Je.overEvery=Q_,Je.overSome=FL,Je.partial=xL,Je.partialRight=Bk,Je.partition=EG,Je.pick=Xk,Je.pickBy=Um,Je.property=by,Je.propertyOf=wS,Je.pull=pm,Je.pullAll=jf,Je.pullAllBy=jl,Je.pullAllWith=Yl,Je.pullAt=ql,Je.range=r_,Je.rangeRight=Ex,Je.rearg=SG,Je.reject=yN,Je.remove=Xl,Je.rest=j_,Je.reverse=El,Je.sampleSize=Rk,Je.set=DL,Je.setWith=$C,Je.shuffle=iI,Je.slice=sl,Je.sortBy=bN,Je.sortedUniq=eu,Je.sortedUniqBy=tu,Je.split=kG,Je.spread=kk,Je.tail=Ll,Je.take=Rl,Je.takeRight=iu,Je.takeRightWhile=ru,Je.takeWhile=Tl,Je.tap=Es,Je.throttle=CL,Je.thru=Ka,Je.toArray=EL,Je.toPairs=Jk,Je.toPairsIn=LL,Je.toPath=Z_,Je.toPlainObject=TL,Je.transform=LG,Je.unary=TN,Je.union=pl,Je.unionBy=ml,Je.unionWith=nu,Je.uniq=Ol,Je.uniqBy=ou,Je.uniqWith=gy,Je.unset=Kk,Je.unzip=GA,Je.unzipWith=bx,Je.update=vS,Je.updateWith=yS,Je.values=QA,Je.valuesIn=RL,Je.without=c0,Je.words=Hr,Je.wrap=SN,Je.xor=gN,Je.xorBy=hL,Je.xorWith=dL,Je.zip=WA,Je.zipObject=Yo,Je.zipObjectDeep=Qo,Je.zipWith=Ya,Je.entries=Jk,Je.entriesIn=LL,Je.extend=kN,Je.extendWith=lI,Hb(Je,Je),Je.add=Gb,Je.attempt=CS,Je.camelCase=UN,Je.capitalize=J_,Je.ceil=Tx,Je.clamp=dI,Je.clone=Hm,Je.cloneDeep=pS,Je.cloneDeepWith=IN,Je.cloneWith=e_,Je.conformsTo=bL,Je.deburr=pI,Je.defaultTo=K_,Je.divide=Qa,Je.endsWith=mI,Je.eq=t_,Je.escape=Cy,Je.escapeRegExp=ZA,Je.every=_N,Je.find=AG,Je.findIndex=u0,Je.findKey=KA,Je.findLast=Ek,Je.findLastIndex=pu,Je.findLastKey=Is,Je.floor=wy,Je.forEach=tI,Je.forEachRight=Sk,Je.forIn=IL,Je.forInRight=ML,Je.forOwn=JC,Je.forOwnRight=Yk,Je.get=Yf,Je.gt=MN,Je.gte=Vk,Je.has=qk,Je.hasIn=VN,Je.head=bk,Je.identity=Ph,Je.includes=YA,Je.indexOf=$P,Je.inRange=fI,Je.invoke=QC,Je.isArguments=Y_,Je.isArray=$s,Je.isArrayBuffer=q_,Je.isArrayLike=Hp,Je.isArrayLikeObject=qc,Je.isBoolean=mS,Je.isBuffer=i_,Je.isDate=gS,Je.isElement=PG,Je.isEmpty=IG,Je.isEqual=MG,Je.isEqualWith=DN,Je.isError=wL,Je.isFinite=LN,Je.isFunction=_y,Je.isInteger=RN,Je.isLength=qd,Je.isMap=zk,Je.isMatch=oI,Je.isMatchWith=Vb,Je.isNaN=Hk,Je.isNative=Uk,Je.isNil=Wk,Je.isNull=Gk,Je.isNumber=X_,Je.isObject=wu,Je.isObjectLike=Ad,Je.isPlainObject=Cf,Je.isRegExp=qA,Je.isSafeInteger=mm,Je.isSet=kc,Je.isString=XA,Je.isSymbol=h0,Je.isTypedArray=vy,Je.isUndefined=ON,Je.isWeakMap=aI,Je.isWeakSet=jk,Je.join=CG,Je.kebabCase=Qk,Je.last=$0,Je.lastIndexOf=UA,Je.lowerCase=Zk,Je.lowerFirst=$k,Je.lt=AL,Je.lte=sI,Je.max=WN,Je.maxBy=Ay,Je.mean=m0,Je.meanBy=Sx,Je.min=ES,Je.minBy=rE,Je.stubArray=AS,Je.stubFalse=Fs,Je.stubObject=dh,Je.stubString=tE,Je.stubTrue=Ub,Je.multiply=TS,Je.nth=bG,Je.noConflict=Xf,Je.noop=Mg,Je.now=kb,Je.pad=RG,Je.padEnd=OG,Je.padStart=eV,Je.parseInt=NG,Je.random=OL,Je.reduce=Dk,Je.reduceRight=Lk,Je.repeat=Ax,Je.replace=FG,Je.result=ZC,Je.round=t1,Je.runInContext=o,Je.sample=xN,Je.size=Ok,Je.snakeCase=BG,Je.some=CN,Je.sortedIndex=Jl,Je.sortedIndexBy=Kl,Je.sortedIndexOf=Xs,Je.sortedLastIndex=Ql,Je.sortedLastIndexBy=Zl,Je.sortedLastIndexOf=$l,Je.startCase=$A,Je.startsWith=sh,Je.subtract=Ed,Je.sum=jN,Je.sumBy=SS,Je.template=Ts,Je.times=iE,Je.toFinite=yy,Je.toInteger=Sl,Je.toLength=NN,Je.toLower=GN,Je.toNumber=bf,Je.toSafeInteger=FN,Je.toString=Mc,Je.toUpper=Ig,Je.trim=NL,Je.trimEnd=xS,Je.trimStart=f0,Je.truncate=Pr,Je.unescape=eE,Je.uniqueId=Po,Je.upperCase=e1,Je.upperFirst=zb,Je.each=tI,Je.eachRight=Sk,Je.first=bk,Hb(Je,function(){var me={};return ui(Je,function(we,Be){L.call(Je.prototype,Be)||(me[Be]=we)}),me}(),{chain:!1}),Je.VERSION=r3i,pA(["bind","bindKey","curry","curryRight","partial","partialRight"],function(me){Je[me].placeholder=Je}),pA(["drop","take"],function(me,we){wi.prototype[me]=function(Be){Be=Be===lr?1:De(Sl(Be),0);var ht=this.__filtered__&&!we?new wi(this):this.clone();return ht.__filtered__?ht.__takeCount__=Oe(Be,ht.__takeCount__):ht.__views__.push({size:Oe(Be,wP),type:me+(ht.__dir__<0?"Right":"")}),ht},wi.prototype[me+"Right"]=function(Be){return this.reverse()[me](Be).reverse()}}),pA(["filter","map","takeWhile"],function(me,we){var Be=we+1,ht=Be==slt||Be==d3i;wi.prototype[me]=function(Kt){var di=this.clone();return di.__iteratees__.push({iteratee:ns(Kt,3),type:Be}),di.__filtered__=di.__filtered__||ht,di}}),pA(["head","last"],function(me,we){var Be="take"+(we?"Right":"");wi.prototype[me]=function(){return this[Be](1).value()[0]}}),pA(["initial","tail"],function(me,we){var Be="drop"+(we?"":"Right");wi.prototype[me]=function(){return this.__filtered__?new wi(this):this[Be](1)}}),wi.prototype.compact=function(){return this.filter(Ph)},wi.prototype.find=function(me){return this.filter(me).head()},wi.prototype.findLast=function(me){return this.reverse().find(me)},wi.prototype.invokeMap=Wr(function(me,we){return typeof me=="function"?new wi(this):this.map(function(Be){return hu(Be,me,we)})}),wi.prototype.reject=function(me){return this.filter(yL(ns(me)))},wi.prototype.slice=function(me,we){me=Sl(me);var Be=this;return Be.__filtered__&&(me>0||we<0)?new wi(Be):(me<0?Be=Be.takeRight(-me):me&&(Be=Be.drop(me)),we!==lr&&(we=Sl(we),Be=we<0?Be.dropRight(-we):Be.take(we-me)),Be)},wi.prototype.takeRightWhile=function(me){return this.reverse().takeWhile(me).reverse()},wi.prototype.toArray=function(){return this.take(wP)},ui(wi.prototype,function(me,we){var Be=/^(?:filter|find|map|reject)|While$/.test(we),ht=/^(?:head|last)$/.test(we),Kt=Je[ht?"take"+(we=="last"?"Right":""):we],di=ht||/^find/.test(we);!Kt||(Je.prototype[we]=function(){var tr=this.__wrapped__,mr=ht?[1]:arguments,Mr=tr instanceof wi,Ln=mr[0],Bn=Mr||$s(tr),Xn=function(rl){var Au=Kt.apply(Je,zO([rl],mr));return ht&&Jo?Au[0]:Au};Bn&&Be&&typeof Ln=="function"&&Ln.length!=1&&(Mr=Bn=!1);var Jo=this.__chain__,Ma=!!this.__actions__.length,Bs=di&&!Jo,Pl=Mr&&!Ma;if(!di&&Bn){tr=Pl?tr:new wi(this);var Go=me.apply(tr,mr);return Go.__actions__.push({func:Ka,args:[Xn],thisArg:lr}),new ai(Go,Jo)}return Bs&&Pl?me.apply(this,mr):(Go=this.thru(Xn),Bs?ht?Go.value()[0]:Go.value():Go)})}),pA(["pop","push","shift","sort","splice","unshift"],function(me){var we=S[me],Be=/^(?:push|sort|unshift)$/.test(me)?"tap":"thru",ht=/^(?:pop|shift)$/.test(me);Je.prototype[me]=function(){var Kt=arguments;if(ht&&!this.__chain__){var di=this.value();return we.apply($s(di)?di:[],Kt)}return this[Be](function(tr){return we.apply($s(tr)?tr:[],Kt)})}}),ui(wi.prototype,function(me,we){var Be=Je[we];if(Be){var ht=Be.name+"";L.call(bt,ht)||(bt[ht]=[]),bt[ht].push({name:we,func:Be})}}),bt[rS(lr,w4).name]=[{name:"wrapper",func:lr}],wi.prototype.clone=ji,wi.prototype.reverse=hi,wi.prototype.value=Ri,Je.prototype.at=ys,Je.prototype.chain=Nl,Je.prototype.commit=Fo,Je.prototype.next=ri,Je.prototype.plant=fL,Je.prototype.reverse=jA,Je.prototype.toJSON=Je.prototype.valueOf=Je.prototype.value=Ak,Je.prototype.first=Je.prototype.head,re&&(Je.prototype[re]=eI),Je},JOi=XOi(),Ji=JOi;var Na={};Na.Source=[];Na.TempSource=[];Na.entity=[];Na.lastSelectEntity=null;Na.pointsId=[];Na.states=0;Na.PointSelectSource=[];Na.currentObj=null;Na.selectedItem=null;Na.setSource=function(o){this.Source=o};Na.setTempSource=function(o){this.TempSource=o};Na.setPointSelectSource=function(o){this.PointSelectSource=o};Na.getSource=function(){return this.Source};Na.getTempSource=function(){return this.TempSource};Na.getPointSelectSource=function(){return this.PointSelectSource};Na.push=function(o){this.Source.push(o)};Na.pusTemSource=function(o){this.TempSource.push(o)};Na.pusPointSelectSource=function(o){this.PointSelectSource.push(o)};Na.insertGroupId=function(o,f){o.checked!=null&&o.checked!="true"&&o.checked!=null||(o.checked=!0);try{o.item.item.show==!1&&(o.checked=!1)}catch{}var m=this.getSourceById(Na.Source,f);if(m){for(var v=0,y=this.TempSource.length;v<y;v++)if(this.TempSource[v].id==f){o.checked&&!this.TempSource[v].checked&&(this.TempSource[v].checked=!0);break}m.children||(m.children=[]),m.children.push(o)}else this.push(o);var x=Ji.clone(o);return x.item=null,Na.currentObj=x,this.pusTemSource(x),o.id};Na.getSourceById=function(o,f){if(o)for(var m=0;m<o.length;m++){if(o[m].id==f)return o[m];if(o[m]&&o[m].children&&o[m].children.length>0){var v=this.getSourceById(o[m].children,f);if(v!=null)return v}}};Na.exitsGroup=function(o,f){if(o)for(var m=Na.Source,v=0;v<m.length;v++){if(m[v].id==o){if(m[v].type=="group")for(var y=0;y<m[v].children.length;y++){var x=m[v].children[y];if(x.name==f)return!0}return!1}if(m[v]&&m[v].children&&m[v].children.length>0)var C=this.getSourceById(m[v].children,o)}};Na.getTempSourceById=function(o){for(var f=0;f<this.TempSource.length;f++)if(this.TempSource[f].id==o)return this.TempSource[f]};Na.getPointSelectSourceById=function(o){for(var f=0;f<this.PointSelectSource.length;f++)if(this.PointSelectSource[f].id==o)return this.PointSelectSource[f]};Na.getSourceByName=function(o,f){return Ji.find(o,function(m){return m.name==f})};Na.delete=function(o,f,m){var v=this.getSourceById(Na.Source,o);if(v&&v.children&&v.children.length>0){for(var y=0;y<v.children.length;)this.delete(v.children[y].id);if(v&&v.type=="group")if(v.pId==0||v.pId==""){var x=this.getIndex(Na.Source,v);Na.Source.splice(x,1),this.delete1(v.id)}else{var C=this.getSourceById(Na.Source,v.pId),x=this.getIndex(C.children,v);C.children.splice(x,1),this.delete1(v.id)}else{if(v.item)v.item.deleteObject(o);else{try{f.entities.removeById(v.id)}catch{}try{var w=f.dataSources.get(v.id);w&&f.dataSources.remove(w)}catch{}try{var w=f.imageryLayers.get(v.id);w&&f.imageryLayers.remove(w)}catch{}try{var w=f.scene.primitives.get(v.id);f.scene.primitives.remove(w)}catch{}}var C=this.getSourceById(Na.Source,v.pId),x=this.getIndex(C.children,v);C.children.splice(x,1),this.delete1(v.id)}}else if(v&&v.type=="group")if(v.pId==0||v.pId==""){var x=this.getIndex(Na.Source,v);Na.Source.splice(x,1),this.delete1(v.id)}else{var C=this.getSourceById(Na.Source,v.pId),x=this.getIndex(C.children,v);C.children.splice(x,1),this.delete1(v.id)}else if(v){if(v.item&&v.item.deleteObject)v.item.deleteObject(o);else{try{f.entities.removeById(v.id)}catch{}try{var w=f.dataSources.get(v.id);w&&f.dataSources.remove(w)}catch{}try{var w=f.imageryLayers.get(v.id);w&&f.imageryLayers.remove(w)}catch{}try{var w=f.scene.primitives.get(v.id);f.scene.primitives.remove(w)}catch{}}this.delete1(v.id);var C=this.getSourceById(Na.Source,v.pId);if(C){var x=this.getIndex(C.children,v);C.children.splice(x,1)}}};Na.temporaryItem={obj:[],state:"start",operation:""};Na.endtemporaryItem=function(){Na.temporaryItem.obj=[],Na.temporaryItem.state="end",Na.temporaryItem.operation=""};Na.starttemporaryItem=function(o){var f=null;try{f=document.getElementById("toolTip")}catch{}if(f!=null&&(f.style.display="none"),Na.handler!=null&&(Na.handler.destroy(),Na.handler=null),Na.temporaryItem.obj.length>0&&Na.temporaryItem.state=="start")for(var m=0;m<Na.temporaryItem.obj.length;m++){try{Na.temporaryItem.obj[m].destroy()}catch{}try{o.entities.remove(Na.temporaryItem.obj[m])}catch{}}return Na.temporaryItem.obj=[],Na.temporaryItem.state="start",Na.temporaryItem.operation};Na.delete1=function(o){for(var f=0;f<this.TempSource.length;f++)this.TempSource[f].id==o&&this.TempSource.splice(f,1)};Na.getIndex=function(o,f){for(var m=0;m<o.length;m++)if(o[m].id==f.id)return m;return-1};Na.setVisibilityTemp=function(o,f){var m=Ji.filter(this.TempSource,function(v){return v.id==o});m&&m.length&&(m[0].checked=f)};Na.setVisibility=function(o,f,m,v){this.setVisibilityTemp(o,f);var y=this.getSourceById(Na.Source,o);if(!!y){if(y.children&&y.children.length>0){for(var x=0;x<y.children.length;x++)this.setVisibility(y.children[x].id,f);if(y.type!="group")if(y.item&&y.item.setVisibility)y.item.setVisibility(f,o);else{try{var C=m.entities.getById(y.id);C&&(C.show=f)}catch{}try{var C=m.dataSources.get(y.id);C&&(C.show=f)}catch{}try{var C=m.imageryLayers.get(y.id);C&&(C.show=f)}catch{}try{var C=m.scene.primitives.get(y.id);C&&(C.show=f)}catch{}}}else if(y.type!="group")if(y.item&&y.item.setVisibility)y.item.setVisibility(f,o);else{try{var C=m.entities.getById(y.id);C&&(C.show=f)}catch{}try{var C=m.dataSources.get(y.id);C&&(C.show=f)}catch{}try{var C=m.imageryLayers.get(y.id);C&&(C.show=f)}catch{}try{var C=m.scene.primitives.get(y.id);C&&(C.show=f)}catch{}}}};Na.removeItem=function(o){if(o)for(var f=0;f<o.length;f++)o[f].item=null,o[f].children&&this.removeItem(o[f].children);return o};Na.changeGroup=function(o,f){var x=this.getSourceById(this.Source,o),m=this.getSourceById(this.Source,f);if(x&&m&&m.children)if(x.id==0||x.id==null||x.id==null){var v=this.getIndex(this.Source,x);this.Source.splice(v,1),x.pId=f,m.children.push(x)}else{var y=this.getSourceById(this.Source,x.pId),v=this.getIndex(y.children,x);y.children.splice(v,1),x.pId=f,m.children.push(x)}var x=this.getTempSourceById(o);x&&(x.pId=f)};Na.handler=null;Na.removeHandler=function(){Na.handler&&(Na.handler.destroy(),Na.handler=null)};var Ne=Na;var ID=null;function QMe(o,f){ID=f,this._viewer=o,this._cesium=f,this._tree=Ne.getSource(),this._core=new Sr(o,f)}QMe.prototype.jumpTo=function(o){if(o&&o.west!=null&&o.west!=null)this._viewer.camera.setView({destination:this._cesium.Rectangle.fromDegrees(o.west,o.south,o.east,o.north)});else if(o&&o.destination!==void 0)this._viewer.camera.setView({destination:o.destination,orientation:o.orientation});else{if(o&&o.item&&o.item.id!=null&&o.item.id!=null){var f=Ne.getSourceById(this._tree,o.item.id);try{var m=this._viewer.scene.primitives.get(f.id);this._viewer.zoomTo(m)}catch{}}if(o&&o.item)if(o.item.entities)this._viewer.zoomTo(o.item);else if(o.item._primitives&&o.item._primitives.length){var v=Ji.filter(o.item._primitives,function(E){return E.geometryInstances==null});if(v.length>0){if(v[0]._boundingSpheres!=null)this._viewer.camera.viewBoundingSphere(v[0]._boundingSpheres[0]);else if(v[0]._labels!=null&&v[0]._labels.length>0){var y=v[0]._labels[0].position,x=this._cesium.Cartographic.fromCartesian(y),C=this._cesium.Math.toDegrees(x.longitude),w=this._cesium.Math.toDegrees(x.latitude),A=this._cesium.Cartesian3.fromDegrees(C,w,2e3);this._viewer.camera.setView({destination:A})}else if(v[0]._pointPrimitives!=null&&v[0]._pointPrimitives.length>0){var y=v[0]._pointPrimitives[0].position,x=this._cesium.Cartographic.fromCartesian(y),C=this._cesium.Math.toDegrees(x.longitude),w=this._cesium.Math.toDegrees(x.latitude),A=this._cesium.Cartesian3.fromDegrees(C,w,2e3);this._viewer.camera.setView({destination:A})}else if(v[0]._billboards!=null&&v[0]._billboards.length>0){var y=v[0]._billboards[0].position,x=this._cesium.Cartographic.fromCartesian(y),C=this._cesium.Math.toDegrees(x.longitude),w=this._cesium.Math.toDegrees(x.latitude),A=this._cesium.Cartesian3.fromDegrees(C,w,2e3);this._viewer.camera.setView({destination:A})}}}else if(o.item._primitives&&o.item._primitives._boundingSpheres)o.item._primitives._boundingSpheres.length&&this._viewer.camera.viewBoundingSphere(o.item._primitives._boundingSpheres[0]);else if(o.item._boundingSpheres&&o.item._boundingSpheres.length>0)this._viewer.camera.viewBoundingSphere(o.item._boundingSpheres[0]);else if(o.item._boundingVolumes&&o.item._boundingVolumes.length){var y=o.item._boundingVolumes[0].center,x=this._cesium.Cartographic.fromCartesian(y),C=this._cesium.Math.toDegrees(x.longitude),w=this._cesium.Math.toDegrees(x.latitude),A=this._cesium.Cartesian3.fromDegrees(C,w,5e3);this._viewer.camera.setView({destination:A})}else this._viewer.zoomTo(o.item);else o&&this._viewer.zoomTo(o)}};QMe.prototype.jumpToPosition=function(o,f,m,v={}){let y={heading:this._core.defaultValue(v.heading,0),pitch:this._core.defaultValue(v.pitch,-90),roll:this._core.defaultValue(v.roll,0)};Math.abs(o)<=180&&Math.abs(f)<=90?this._viewer.camera.setView({destination:this._cesium.Cartesian3.fromDegrees(o,f,m),orientation:new ID.HeadingPitchRoll(ID.Math.toRadians(y.heading),ID.Math.toRadians(y.pitch),ID.Math.toRadians(y.roll)),duration:y.time}):this._viewer.camera.setView({destination:{x:o,y:f,z:m},orientation:new ID.HeadingPitchRoll(ID.Math.toRadians(y.heading),ID.Math.toRadians(y.pitch),ID.Math.toRadians(y.roll))})};var Qlt=QMe;var IC=null;function Zlt(o,f){IC=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._getPosition=new Ru(o,f)}Zlt.prototype.setPointFly=function(o={}){let f=this._core.CreateTooltip(),m=this._viewer,v=this,y=!1,x,C;o.pitch&&(o.pitch=IC.Math.toRadians(o.pitch));let w,A,E=o.limitTime?o.limitAngel:360,T=o.time||30,S=(E||360)/T,M=function(){let D=IC.JulianDate.secondsDifference(m.clock.currentTime,m.clock.startTime);if(o.limitTime&&D>T){v.end&&v.end();return}let L=IC.Math.toRadians(D*S)+w;m.scene.camera.setView({destination:A,orientation:{heading:L,pitch:v.pitch}}),m.scene.camera.moveBackward(v.distance),IC.JulianDate.compare(m.clock.currentTime,m.clock.stopTime)>=0&&m.clock.onTick.removeEventListener(M)},I=P=>{A=P,v.pitch=o.pitch||m.camera.pitch,v.distance=o.distance,v.distance||(v.distance=IC.Cartesian3.distance(m.camera.position,P)),w=m.camera.heading;let D=IC.JulianDate.fromDate(new Date);m.clock.startTime=D.clone(),m.clock.currentTime=D.clone(),m.clock.clockRange=IC.ClockRange.CLAMPED,m.clock.clockStep=IC.ClockStep.SYSTEM_CLOCK,m.clock.onTick.addEventListener(M),!o.hideImage&&(x=v._viewer.entities.add({id:v._core.getuid(),name:"\u5B9A\u70B9",position:A,billboard:{horizontalOrigin:v._cesium.HorizontalOrigin.CENTER,verticalOrigin:v._cesium.VerticalOrigin.BOTTOM,scale:v._core.defaultValue(o.scale,1),image:v._core.defaultValue(o.image,window.SmartEarthRootUrl+pn.mark),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))};return o.position?I(o.position):(this.drawHandler&&this.drawHandler.destroy(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),C=new IC.ScreenSpaceEventHandler(m.scene.canvas),C.setInputAction(function(P){if(y)v.end&&v.end();else{f.showAt(P.position,"\u70B9\u51FB\u7ED3\u675F\u7ED5\u98DE"),y=!0;let D=v._getPosition.getMouseDegrees(P),L=IC.Cartesian3.fromDegrees(D.lon,D.lat,D.height);I(L)}},IC.ScreenSpaceEventType.LEFT_CLICK),C.setInputAction(function(P){!y&&f.showAt(P.endPosition,"\u70B9\u51FB\u9009\u62E9\u5B9A\u4F4D\u70B9"),y&&f.showAt(P.endPosition,"\u70B9\u51FB\u7ED3\u675F\u7ED5\u98DE")},IC.ScreenSpaceEventType.MOUSE_MOVE),C.setInputAction(function(P){v.distance-=P*v.distance/2e3,v.distance<1&&(v.distance=1)},IC.ScreenSpaceEventType.WHEEL),this.drawHandler=C),this.end=P=>{this.end=void 0,f.show(!1),C&&C.destroy(),x&&v._viewer.entities.remove(x),x=void 0,v._core.mouse(v._viewer.container,0),m.clock.onTick.removeEventListener(M),o.end&&o.end()},this};var c8=Zlt;var ZMe=null;function $lt(o,f){ZMe=f,this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}$lt.prototype.flyToObj=function(o){if(o&&o.flyTo)o.flyTo();else if(o&&o.west!==void 0&&o.west!==null)this._viewer.camera.flyTo({destination:this._cesium.Rectangle.fromDegrees(o.west,o.south,o.east,o.north)});else if(o instanceof ZMe.Entity)this._viewer.flyTo(o);else if(o&&o.rectangle)this._viewer.camera.flyTo({destination:o.rectangle});else{if(o&&o.item&&o.item.id!=null&&o.item.id!=null){var f=Ne.getSourceById(this._tree,o.item.id);try{var m=this._viewer.scene.primitives.get(f.id);this._viewer.flyTo(m)}catch{}}if(o&&o.item)if(o.item.entities)this._viewer.flyTo(o.item);else if(o.item._primitives&&o.item._primitives.length){var v=Ji.filter(o.item._primitives,function(E){return E.geometryInstances==null});if(v.length>0){if(v[0]._boundingSpheres!=null)this._viewer.camera.flyToBoundingSphere(v[0]._boundingSpheres[0]);else if(v[0]._primitive!=null&&v[0]._primitive!=null&&v[0]._primitive._boundingSpheres[0]!=null&&v[0]._primitive._boundingSpheres[0]!=null)this._viewer.camera.flyToBoundingSphere(v[0]._primitive._boundingSpheres[0]);else if(v[0]._labels!=null&&v[0]._labels.length>0){var y=v[0]._labels[0].position,x=this._cesium.Cartographic.fromCartesian(y),C=this._cesium.Math.toDegrees(x.longitude),w=this._cesium.Math.toDegrees(x.latitude),A=this._cesium.Cartesian3.fromDegrees(C,w,2e3);this._viewer.camera.flyTo({destination:A})}else if(v[0]._pointPrimitives!=null&&v[0]._pointPrimitives.length>0){var y=v[0]._pointPrimitives[0].position,x=this._cesium.Cartographic.fromCartesian(y),C=this._cesium.Math.toDegrees(x.longitude),w=this._cesium.Math.toDegrees(x.latitude),A=this._cesium.Cartesian3.fromDegrees(C,w,2e3);this._viewer.camera.flyTo({destination:A})}else if(v[0]._billboards!=null&&v[0]._billboards.length>0){var y=v[0]._billboards[0].position,x=this._cesium.Cartographic.fromCartesian(y),C=this._cesium.Math.toDegrees(x.longitude),w=this._cesium.Math.toDegrees(x.latitude),A=this._cesium.Cartesian3.fromDegrees(C,w,2e3);this._viewer.camera.flyTo({destination:A})}}}else if(o.item._primitives&&o.item._primitives._boundingSpheres)o.item._primitives._boundingSpheres.length&&this._viewer.camera.flyToBoundingSphere(o.item._primitives._boundingSpheres[0]);else if(o.item._boundingSpheres&&o.item._boundingSpheres.length>0)this._viewer.camera.flyToBoundingSphere(o.item._boundingSpheres[0]);else if(o.item._boundingVolumes&&o.item._boundingVolumes.length){var y=o.item._boundingVolumes[0].center,x=this._cesium.Cartographic.fromCartesian(y),C=this._cesium.Math.toDegrees(x.longitude),w=this._cesium.Math.toDegrees(x.latitude),A=this._cesium.Cartesian3.fromDegrees(C,w,5e3);this._viewer.camera.flyTo({destination:A})}else o.item instanceof ZMe.Cesium3DTileset?this._viewer.flyTo(o.item):o.item.boundingSphere?this._viewer.camera.flyToBoundingSphere(o.item.boundingSphere):this._viewer.flyTo(o.item);else o&&(o.boundingSphere?this._viewer.camera.flyToBoundingSphere(o.boundingSphere):this._viewer.flyTo(o))}};var eut=$lt;var _A=null;function ih(o,f){_A=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._getPosition=new Ru(this._viewer,this._cesium),this._tree=Ne,this._entityFly=null}ih.prototype.executeFlycesium=function(o){var f={},m=this,v=function(){function S(M){this.options={polyline:{show:!0,positions:[],material:new m._cesium.PolylineGlowMaterialProperty({glowPower:.1,color:m._cesium.Color.YELLOW}),width:10,clampToGround:!0}},this.positions=M,this._init()}return S.prototype._init=function(){var M=this,I=function(){return M.positions};this.options.polyline.positions=new m._cesium.CallbackProperty(I,!1),this.flycesium=m._viewer.entities.add(this.options),m.item=this.flycesium},S}(),y=this.handler=new m._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas),x=[],C=null,w=0,A=void 0,E={polyline:{},cameraRoll:null,cameraPitch:null,cameraPosition:null,cameraHeading:null,positions:[],distance:[],Totaltime:""},T=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),y.setInputAction(function(S){var M=m._getPosition.getMousePosition(S);m._core.getBrowser().pc==="pc"&&x.length==0&&x.push(M.clone()),x.push(M),x.length>=2&&(m._cesium.defined(A)||(A=new v(x)),w=m._core.getSpaceDistancem(x,m._cesium))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),y.setInputAction(function(S){T.showAt(S.endPosition,"\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01");var M=m._getPosition.getMousePosition(S);x.length>=2&&(m._cesium.defined(A)?M&&(x.pop(),x.push(M)):A=new v(x),w=m._core.getSpaceDistancem(x,m._cesium))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),y.setInputAction(function(S){m.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(S){y.destroy(),T.show(!1),m._core.mouse(m._viewer.container,0),m.end=void 0,m._viewer.entities.remove(m.item),!(S==="cancel"||x.length<2)&&(w=m._core.getSpaceDistancem(x,m._cesium),E.polyline=A,E.positions=x,E.distance=parseFloat(w),m.setFlycesium(E,function(M){m.flyceium=M,m.ploylinejl=E,typeof o=="function"&&o(M)}))},this};ih.prototype.getFlyData=function(o,f){let m=[];typeof o[0]=="object"?o.forEach(x=>{m.push(_A.Cartesian3.fromDegrees(x.lon,x.lat,x.height))}):typeof o[0]=="number"&&(m=_A.Cartesian3.fromDegreesArrayHeights(o));let v=this._core.getSpaceDistancem(m,_A);return this.setFlycesium({positions:m,distance:v},f)};ih.prototype.setFlycesium=function(o,f){for(var m=this,v=[],y=0;y<o.positions.length;y++){var x=m._cesium.Cartographic.fromCartesian(o.positions[y]),C=[x.longitude/Math.PI*180,x.latitude/Math.PI*180,x.height];v.push(C)}var w;w=(o.distance/50.5).toFixed(1);var A={id:m._core.getuid(),name:"\u65B0\u5EFA\u8DEF\u7EBF",distance:o.distance,showPoint:!1,showLine:!0,showModel:!0,isLoop:!1,Totaltime:Math.round(w),speed:50.5,height:10,perPositionHeight:!1,pitch:-20,range:100,mode:0,url:window.SmartEarthRootUrl+pn.testModel,geojson:{geometry:{type:"LineString",coordinates:v}}};return f&&f(A),A};ih.prototype.Start=function(o,f,m){var v=this,y=o.geojson;return o.Totaltime||(o.Totaltime=3e3),v._entityFly&&v.exit(),GO=m,setTimeout(function(){v.executeFly3D(o,f)},200),this};var MD=null,$v=null,GO=null,vs={start:null,time:null,longitude:0,latitude:0,cameraHeight:10,speed:50.5,multiplier:1,position:0};var $Me,rut,tut,YX,AP,A4=0,xse=0;ih.prototype.executeFly3D=function(o,f){var m=this,v=o.geojson;if($Me=new m._cesium.Cartesian3,YX=new m._cesium.SampledProperty(Number),AP=new m._cesium.SampledPositionProperty,v&&v.geometry){var y=v.geometry.coordinates,x=[],C=[];if(y.length>0)for(var w=0;w<y.length;w++){var A=y[w][0],E=y[w][1],T=y[w][2];o.lineHeight!==void 0&&!o.perPositionHeight&&(T=o.lineHeight),C.push(A,E,T),x.push({x:A,y:E,z:T})}else return;m._viewer.clock.clockRange=o.isLoop?m._cesium.ClockRange.LOOP_STOP:m._cesium.ClockRange.CLAMPED,m._viewer.clock.multiplier=o.multiplier||1,m._viewer.clock.canAnimate=!1,m._viewer.clock.shouldAnimate=!0,vs.distance=o.distance,vs.cameraHeight=this._core.defaultValue(o.height,10),vs.lineHeight=o.lineHeight,vs.perPositionHeight=o.perPositionHeight,vs.pitch=o.pitch,vs.range=o.range,vs.speed=o.speed||50.5,vs.Totaltime=o.distance/vs.speed,vs.start=m._cesium.JulianDate.fromDate(new Date),vs.stop=m._cesium.JulianDate.addSeconds(vs.start,vs.Totaltime,new m._cesium.JulianDate),m._viewer.clock.startTime=vs.start.clone(),m._viewer.clock.stopTime=vs.stop.clone(),m._viewer.clock.currentTime=vs.start.clone();var S=m.computeCirclularFlight(x);vs.position=S,vs.degrees=x,tut=new m._cesium.VelocityOrientationProperty(S);var M={};f!==""?M={show:m._cesium.defaultValue(o.showModel,!0),scale:m._cesium.defaultValue(o.modelScale,1),uri:f}:M={show:m._cesium.defaultValue(o.showModel,!0),scale:m._cesium.defaultValue(o.modelScale,1)},o.modelData&&(M=m._core.extend(M,o.modelData)),h8=function(){},MD=m._viewer.entities.add({availability:new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({start:vs.start,stop:vs.stop})]),position:S,polyline:{clampToGround:vs.lineHeight===void 0&&!vs.perPositionHeight,positions:_A.Cartesian3.fromDegreesArrayHeights(C),show:m._cesium.defaultValue(o.showLine,!0),material:new m._cesium.PolylineGlowMaterialProperty({glowPower:.1,color:m._cesium.Color.YELLOW}),width:10},label:{text:new m._cesium.CallbackProperty(I,!1),font:"20px sans-serif",showBackground:!1,distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,100),eyeOffset:new m._cesium.Cartesian3(0,3.5,0)}}),$v=m._viewer.entities.add({availability:new m._cesium.TimeIntervalCollection([new m._cesium.TimeInterval({start:vs.start,stop:vs.stop})]),position:S,orientation:tut,point:{show:m._cesium.defaultValue(o.showPoint,!1),color:m._cesium.Color.RED,outlineColor:m._cesium.Color.WHITE,outlineWidth:2,pixelSize:10},model:M,billboard:o.image,viewFrom:o.viewFrom||new m._cesium.Cartesian3(500,500,500)}),UO=MD,m._viewer.trackedEntity=$v,m._entityFly=MD,o.mode&&m.changeFlyMode(o.mode)}else return;function I(P,D){var L=UO,R=m._viewer.camera;if(m._viewer.clock.clockRange!==2&&_A.JulianDate.equals(m._viewer.clock.currentTime,m._viewer.clock.stopTime)){MD.label.text="",vs.time=vs.Totaltime,vs.ratio=1,vs.distanceTraveled=vs.distance,m.exit(),GO!=null&&typeof GO=="function"&&GO(vs,"end"),h8=function(){};return}try{var O=UO.position.getValue(m._viewer.clock.currentTime),F=m._cesium.Cartographic.fromCartesian(O);if(vs.longitude=m._cesium.Math.toDegrees(F.longitude),vs.latitude=m._cesium.Math.toDegrees(F.latitude),vs.lineHeight===void 0&&!vs.perPositionHeight){let G=m._viewer.scene.sampleHeight(F,[$v,UO]),j=m._viewer.scene.globe.getHeight(F);$v.position=m._cesium.Cartesian3.fromRadians(F.longitude,F.latitude,j>G?j:G)}}catch{}try{rut.getValue(P,$Me),h8(P);var k=m._cesium.Cartesian3.magnitude($Me),U=Math.round(k*3.6);U+=" km/h",vs.time=m._cesium.JulianDate.secondsDifference(P,vs.start),vs.ratio=vs.time/vs.Totaltime,vs.distanceTraveled=vs.ratio*vs.distance,vs.speed=U,vs.height=F.height,vs.globeHeight=m._viewer.scene.globe.getHeight(F);let G=!1;if(UO.position._property&&UO.position._property._times&&UO.position._property._times[xse]){let j=UO.position._property._times[xse];(m._viewer.clock.currentTime.dayNumber>j.dayNumber||m._viewer.clock.currentTime.secondsOfDay>=j.secondsOfDay)&&(xse++,G=!0)}GO!=null&&typeof GO=="function"&&(G?GO(vs,"PositionEnd"):GO(vs))}catch{}return""}};var jX,UO=null,h8;function iut(o){A4=YX.getValue(o),vs.heading=A4}function nut(o){var f=_A.Cartographic.fromCartesian(o),m=_A.Math.toDegrees(f.longitude),v=_A.Math.toDegrees(f.latitude);return _A.Cartesian3.fromDegrees(m,v,f.height+vs.cameraHeight)}ih.prototype.showPoint=function(o){$v&&$v.point&&($v.point.show=o)};ih.prototype.showLine=function(o){MD&&MD.polyline&&(MD.polyline.show=o)};ih.prototype.showModel=function(o){$v&&$v.model&&($v.model.show=o)};ih.prototype.setFlyHeight=function(o){vs.cameraHeight=o};ih.prototype.setFlyDistance=function(o){vs.range=o};ih.prototype.setFlyPitch=function(o){vs.pitch=o};ih.prototype.changeFlyMode=function(o){var f=this;switch(o){case 0:h8=function(){},f.BindingModel(!0);break;case 1:this.BindingModel(!1),h8=function(m){iut(m),f.exeuteVisualAngle(f._cesium.Math.toRadians(vs.heading),f._cesium.Math.toRadians(vs.pitch),vs.range)};break;case 2:this.BindingModel(!1),h8=function(m){iut(m),jX=f._entityFly.position.getValue(f._viewer.clock.currentTime),jX&&(jX=nut(jX),f._viewer.camera.setView({destination:jX,orientation:{heading:f._cesium.Math.toRadians(vs.heading),pitch:f._cesium.Math.toRadians(-90),roll:0}}))};break}};ih.prototype.faster=function(){this._viewer.animation.viewModel.faster()};ih.prototype.slower=function(){this._viewer.animation.viewModel.slower()};ih.prototype.setMultiplier=function(o){this._viewer.clock.multiplier=parseFloat(o)};ih.prototype.isPause=function(o){var f=this._viewer.clockViewModel;f.shouldAnimate=!o};ih.prototype.exit=function(){this.isPause(!0),this._viewer.clock.multiplier=1,this.executeSignout(),this.BindingModel(!1),this._viewer.entities.remove(MD),this._viewer.entities.remove($v),MD=null,$v=null,this._entityFly=null};ih.prototype.updateSpeedLabel=function(o,f){};ih.prototype.computeCirclularFlight=function(o){var f=this;rut=new f._cesium.VelocityVectorProperty(AP,!1);for(var m,v,y,x,C=0;C<o.length;C++){C===0&&(v=f._cesium.JulianDate.addSeconds(vs.start,0,new f._cesium.JulianDate),y=f._cesium.Cartesian3.fromDegrees(o[0].x,o[0].y,f._cesium.defaultValue(vs.lineHeight,o[C].z)),AP.addSample(v,y),A4=f._core.TwoPointAzimuth(o[0].x,o[0].y,o[1].x,o[1].y),YX.addSample(v,A4));try{if(C>0){y=new f._cesium.Cartesian3(AP._property._values[C*3-3],AP._property._values[C*3-2],AP._property._values[C*3-1]),x=f._cesium.Cartesian3.fromDegrees(o[C].x,o[C].y,f._cesium.defaultValue(vs.lineHeight,o[C].z));var w=_A.Cartesian3.distance(y,x);v=f._cesium.JulianDate.addSeconds(AP._property._times[C-1],.5,new f._cesium.JulianDate),m=f._cesium.JulianDate.addSeconds(AP._property._times[C-1],w/vs.speed,new f._cesium.JulianDate),AP.addSample(m,x),A4=f._core.TwoPointAzimuth(o[C-1].x,o[C-1].y,o[C].x,o[C].y),YX.addSample(v,A4),YX.addSample(m,A4)}}catch(A){console.log(A)}}return AP};ih.prototype.executePauseFly3DPaths=function(){var o=this._viewer.clockViewModel;o.shouldAnimate?o.shouldAnimate=!1:this._viewer.clockViewModel.canAnimate&&(o.shouldAnimate=!0)};ih.prototype.changeModel=function(o){$v.model.uri=o};ih.prototype.PointView=function(){var o={position:this._viewer.camera.position.clone(),orientation:{heading:this._viewer.camera.heading,pitch:this._viewer.camera.pitch,roll:this._viewer.camera.roll}};return o};ih.prototype.PlayPaths=function(o){var f=1,m=this;setInterval(function(){m._viewer.camera.setView({destination:m._cesium.Cartesian3.fromDegrees(117.48,30.67,15e3),orientation:{heading:m._cesium.Math.toRadians(90,0),pitch:m._cesium.Math.toRadians(-90),roll:0}})},2e3)};ih.prototype.BindingModel=function(o){o?this._viewer.trackedEntity=$v:(this._viewer.trackedEntity=void 0,this._viewer.camera.lookAtTransform(_A.Matrix4.IDENTITY))};ih.prototype.exeuteVisualAngle=function(o,f,m){var v={heading:null,pitch:null,range:null};v.heading=o||this._cesium.Math.toRadians(90),v.pitch=f||this._cesium.Math.toRadians(0),v.range=m||1e3;var y=this._entityFly.position.getValue(this._viewer.clock.currentTime);if(!!y){y=nut(y);var x=new this._cesium.HeadingPitchRange(v.heading,v.pitch,v.range);this._viewer.camera.lookAt(y,x)}};ih.prototype.Pathshow=function(o){this._entityFly.polyline.show=o};ih.prototype.Pointshow=function(o){$v._point.show=o};ih.prototype.Modelshow=function(o){$v._model.show=o};ih.prototype.executePlayForwardFly3DPaths=function(){var o=this._viewer.clockViewModel,f=o.multiplier;f<0&&(o.multiplier=-f),o.shouldAnimate=!0};ih.prototype.executePlayReverseFly3DPaths=function(){var o=this._viewer.clockViewModel,f=o.multiplier;f>0&&(o.multiplier=-f),o.shouldAnimate=!0};ih.prototype.executeSignout=function(){var o=this._cesium.JulianDate.fromDate(new Date);this._viewer.clock.startTime=o.clone();var f=this._cesium.JulianDate.addSeconds(o,86400,new this._cesium.JulianDate);this._viewer.clock.stopTime=f.clone()};ih.prototype.forceEndHanlder=function(){this.handler&&(this.handler.destroy(),this.handler=void 0)};var WO=ih;function jO(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f)}jO.prototype.VectorColorTransformation=function(o,f){var m=o;if(m&&m.toString().charAt(0)=="["&&m.toString().charAt(m.length-1)=="]"){var v=styleOption.fillColor.replace(/\[/,"").replace(/\]/,"");m=f.properties[v]}return this._core.isnull(m)||(this._core.isHtmlColor(m)?m=this.colorFromHtmlColor(m):(/^rgb/.test(m)&&(m=this.rgbaStringToRgbaObj(m)),m.r!=null?(m.r>1&&(m.r=m.r/255),m.g>1&&(m.g=m.g/255),m.b>1&&(m.b=m.b/255),m.a>1&&(m.a=m.a/255),m=this.createColor(m.r,m.g,m.b,m.a)):m.red!=null&&(m.red>1&&(m.red=m.red/255),m.green>1&&(m.green=m.green/255),m.blue>1&&(m.blue=m.blue/255),m.alpha>1&&(m.alpha=m.alpha/255),m=this.createColor(m.red,m.green,m.blue,m.alpha)))),m};jO.prototype.createColorTransformation=function(o){var f=o;return this._core.isnull(f)||f.toString().charAt(0)=="["&&f.toString().charAt(f.length-1)=="]"||(this._core.isHtmlColor(f)?f=this.colorFromHtmlColor(f):(/^rgb/.test(f)&&(f=this.rgbaStringToRgbaObj(f)),f.r>1&&(f.r=f.r/255),f.g>1&&(f.g=f.g/255),f.b>1&&(f.b=f.b/255),f.a>1&&(f.a=f.a/255),f=this.createColor(f.r,f.g,f.b,f.a))),f};jO.prototype.createColor=function(o,f,m,v){var y=new this._cesium.Color(o,f,m,v);return y};jO.prototype.colorFromHtmlColor=function(o){if(typeof o=="object")return o.color?o.color:void 0;var f=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/;if(o=o.toLowerCase(),!f.test(o)){console.log("\u4E0D\u662F\u6709\u6548\u7684html\u989C\u8272",o);return}if(o.length==4){for(var m="#",v=1;v<4;v+=1)m+=o.slice(v,v+1).concat(o.slice(v,v+1));o=m}for(var y=[],v=1;v<7;v+=2)y.push(parseInt("0x"+o.slice(v,v+2)));if(o.length==9){var x=parseInt(o.substr(7,2))/100;return this.createColor(y[0]/255,y[1]/255,y[2]/255,x)}return this.createColor(y[0]/255,y[1]/255,y[2]/255,1)};jO.prototype.toHtmlColor=function(o){var f=o.split(","),m=parseInt(f[0].split("(")[1]),v=parseInt(f[1]),y=parseInt(f[2].split(")")[0]),x="#"+((1<<24)+(m<<16)+(v<<8)+y).toString(16).slice(1);return x};jO.prototype.rgbaStringToRgbaObj=function(o){if(/^rgb/.test(o)){o=o.replace(/rgba\(/g,""),o=o.replace(/rgb\(/g,""),o=o.replace(/\)/g,"");var f=o.split(",");o={},f.length==3?(o.r=parseFloat(f[0]),o.g=parseFloat(f[1]),o.b=parseFloat(f[2]),o.a=1):f.length==4&&(o.r=parseFloat(f[0]),o.g=parseFloat(f[1]),o.b=parseFloat(f[2]),o.a=parseFloat(f[3]))}return o};jO.prototype.CreateColor=function(o,f,m,v){var y=new this._cesium.Color(o,f,m,v);return y};var no=jO;function Pu(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this._viewEvent=null,this.positions=[],this._getPosition=new Ru(this._viewer,this._cesium),this.objId=Number(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonRectangleArr=[]}Pu.prototype.createRectangle=function(o,f){var m=this,v=this;this._tree.removeHandler(),!o&&(o={});var y=[];m.shape={points:[],button:0,rect:null,entity:null};var x,C,w={fillColor:this._cesium.Color.YELLOW.withAlpha(.4),outlineColor:this._cesium.Color.RED};o&&o.fillColor&&(w.fillColor=new no(this._viewer,this._cesium).colorFromHtmlColor(fillColor)),o&&o.outlineColor&&(w.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(outlineColor)),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(v._viewer.scene.canvas),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var A=null,E=null;this._tree.handler.setInputAction(function(I){C=v._getPosition.getMousePosition(I,[m.shape.entity]);var P=v._getPosition.getMouseDegrees(I,[m.shape.entity]);if(m.shape.button>=1){E=P;var D={obj1:A,obj2:E},L={position:v._viewer.camera.position.clone(),orientation:{heading:v._viewer.camera.heading,pitch:v._viewer.camera.pitch,roll:v._viewer.camera.roll}},R={originalCameraLocation:L,pointes:D,terrainExaggeration:"5",zj:"true"};typeof f=="function"&&f(R),v._tree.handler.removeInputAction(v._cesium.ScreenSpaceEventType.MOUSE_MOVE),v._tree.handler.removeInputAction(v._cesium.ScreenSpaceEventType.LEFT_CLICK)}else A=P;m.shape.button=m.shape.button+1,C&&(m.shape.points.length==0?(y.push(C),m.shape.points.push(v._viewer.scene.globe.ellipsoid.cartesianToCartographic(C)),m.shape.rect=v._cesium.Rectangle.fromCartographicArray(m.shape.points),m.shape.rect.east+=1e-6,m.shape.rect.north+=1e-6,m.shape.entity=v._viewer.entities.add({rectangle:{coordinates:m.shape.rect,material:w.fillColor,outline:!0,outlineWidth:2,outlineColor:w.outlineColor,height:o&&o.height,heightReference:o&&o.heightReference}}),m.shape.entity.rectangle.coordinates=new v._cesium.CallbackProperty(function(){return m.shape.rect},!1),m.bufferEntity=m.shape.entity,v.item=m.shape.entity):(v._core.mouse(v._viewer.container,0,"0"),m.shape.entity.rectangle.coordinates=v._cesium.Rectangle.clone(m.shape.rect),v._tree.handler.removeInputAction(v._cesium.ScreenSpaceEventType.MOUSE_MOVE),v._tree.handler.removeInputAction(v._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),v._tree.handler.setInputAction(function(I){if(m.shape.points.length!=0){var P=v._getPosition.getMousePosition(I,[m.shape.entity]);P&&(y[1]=P,m.shape.points[1]=v._viewer.scene.globe.ellipsoid.cartesianToCartographic(P),m.shape.rect=v._cesium.Rectangle.fromCartographicArray(m.shape.points),m.shape.rect.west==m.shape.rect.east&&(m.shape.rect.east+=1e-6),m.shape.rect.south==m.shape.rect.north&&(m.shape.rect.north+=1e-6))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var T=0;!v._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(T=Ne.selectedItem.id);var S=v._core.getuid(),M={id:S,name:"\u65B0\u5EFA\u77E9\u5F62"+S,pId:v._core.isnull(T)?0:T,type:"rectangle",item:v};return v.setTreeobj(M),Ne.insertGroupId(M,v._core.isnull(T)?0:T),this};Pu.prototype.getstyles=function(){var o={};return o.show=this.item.rectangle.show?this.item.rectangle.show._value:!0,o.coordinates=this.item.rectangle.coordinates?{east:this.item.rectangle.coordinates.getValue().east,north:this.item.rectangle.coordinates.getValue().north,south:this.item.rectangle.coordinates.getValue().south,west:this.item.rectangle.coordinates.getValue().west}:[],o.height=this.item.rectangle.height?this.item.rectangle.height.toString():0,o.heightReference=this.item.rectangle.heightReference?this.item.rectangle.heightReference.toString():0,o.extrudedHeight=this.item.rectangle.extrudedHeight?this.item.rectangle.extrudedHeight.getValue().toString():0,o.extrudedHeightReference=this.item.rectangle.extrudedHeightReference?this.item.rectangle.extrudedHeightReference.toString():0,o.rotation=this.item.rectangle.rotation?this.item.rectangle.rotation.toString():0,o.stRotation=this.item.rectangle.stRotation?this.item.rectangle.stRotation.toString():0,o.granularity=this.item.rectangle.granularity&&this.item.rectangle.granularity._value?this.item.rectangle.granularity._value:void 0,o.fill=this.item.rectangle.fill?this.item.rectangle.fill._value:0,o.outline=this.item.rectangle.outline?this.item.rectangle.outline._value:0,o.outlineWidth=this.item.rectangle.outlineWidth&&this.item.rectangle.outlineWidth._value?this.item.rectangle.outlineWidth._value.toString():1,o.outlineColor=this.item.rectangle.outlineColor&&this.item.rectangle.outlineColor._value?"rgba"+this.item.rectangle.outlineColor.toString():null,o.material={},o.material.color=this.item.rectangle.material&&this.item.rectangle.material.color&&this.item.rectangle.material.color._value?"rgba"+this.item.rectangle.material.color.toString():null,o.material.image=this.item.rectangle.material&&this.item.rectangle.material.image&&this.item.rectangle.material.image._value?this.item.rectangle.material.image.toString():null,o.material.repeat=this.item.rectangle.material&&this.item.rectangle.material.repeat&&this.item.rectangle.material.repeat._value?this.item.rectangle.material.repeat._value:null,o.classificationType=this.item.rectangle.classificationType?this.item.rectangle.classificationType.toString():null,o.near=this.item.rectangle.distanceDisplayCondition?this.item.rectangle.distanceDisplayCondition._value.near:null,o.far=this.item.rectangle.distanceDisplayCondition?this.item.rectangle.distanceDisplayCondition._value.far:null,o};Pu.prototype.createRectangleOptimization=function(o,f){var m=this;this._tree.removeHandler();var v=[];m.shape={points:[],button:0,rect:null,entity:null};var y,x,C={fillColor:this._cesium.Color.YELLOW.withAlpha(.4),outlineColor:this._cesium.Color.RED};o&&o.fillColor&&(C.fillColor=new no(this._viewer,this._cesium).colorFromHtmlColor(fillColor)),o&&o.outlineColor&&(C.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(outlineColor)),this.handler=new this._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas);var w=null,A=null;this.handler.setInputAction(function(M){x=m._core.getPointFromWindowPoint(M.position,m._viewer);var I=m._viewer.camera.pickEllipsoid(M.position,m._viewer.scene.globe.ellipsoid);if(m.shape.button>=1){A=I;var P={obj1:w,obj2:A},D={position:m._viewer.camera.position.clone(),orientation:{heading:m._viewer.camera.heading,pitch:m._viewer.camera.pitch,roll:m._viewer.camera.roll}},L={originalCameraLocation:D,pointes:P,terrainExaggeration:"5",zj:"true"};typeof f=="function"&&f(L),m.handler.removeInputAction(m._cesium.ScreenSpaceEventType.MOUSE_MOVE),m.handler.removeInputAction(m._cesium.ScreenSpaceEventType.LEFT_CLICK)}else w=I;if(m.shape.button=m.shape.button+1,x){m.shape.points.length==0?(v.push(x),m.shape.points.push(m._viewer.scene.globe.ellipsoid.cartesianToCartographic(x)),m.shape.rect=m._cesium.Rectangle.fromCartographicArray(m.shape.points),m.shape.rect.east+=1e-6,m.shape.rect.north+=1e-6,m.shape.entity=m._viewer.entities.add({rectangle:{coordinates:m.shape.rect,material:C.fillColor,outline:!0,outlineWidth:2,outlineColor:C.outlineColor,height:o&&o.height,heightReference:o&&o.heightReference||1}}),m.shape.entity.objId=m.objId,m.shape.entity.rectangle.coordinates=new m._cesium.CallbackProperty(function(){return m.shape.rect},!1),m.bufferEntity=m.shape.entity,m.item=m.shape.entity):(m.state=1,m.handler.removeInputAction(m._cesium.ScreenSpaceEventType.MOUSE_MOVE),m.handler.removeInputAction(m._cesium.ScreenSpaceEventType.LEFT_CLICK));var R=m.createPoint(x,!1);R.wz=m.gonRectangleArr.length,m.gonRectangleArr.push(R),m.positions.push(x)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(M){if(m.shape.points.length!=0){var I=m._core.getPointFromWindowPoint(M.endPosition,m._viewer);if(I){var P=m._viewer.camera.getPickRay(M.endPosition),D=m._viewer.scene.globe.pick(P,m._viewer.scene);v[1]=I,m.shape.points[1]=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(I),m.shape.rect=m._cesium.Rectangle.fromCartographicArray(m.shape.points),m.shape.rect.west==m.shape.rect.east&&(m.shape.rect.east+=1e-6),m.shape.rect.south==m.shape.rect.north&&(m.shape.rect.north+=1e-6)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var E=0;!m._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(E=Ne.selectedItem.id);var T=m._core.getuid(),S={id:T,name:"\u65B0\u5EFA\u77E9\u5F62"+T,pId:m._core.isnull(E)?0:E,type:"rectangle",item:m};return m.setTreeobj(S),Ne.insertGroupId(S,m._core.isnull(E)?0:E),this};Pu.prototype.startModify=function(){var o="\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E,\u53F3\u51FB\u5220\u9664\u8BE5\u70B9";if(!(this.state!=1&&this.state!=2)){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var f=this,m=0;m<f.gonRectangleArr.length;m++){var v=f.gonRectangleArr[m];v&&(v.show=!0)}this.modifyHandler.setInputAction(function(y){var x=f._viewer.scene.pick(y.position);if(Cesium.defined(x)&&x.id)x.id.objId||(f.modifyPoint=x.id,o="\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539"),f.forbidDrawWorld(!0);else{for(var C=0;C<f.gonRectangleArr.length;C++){var w=f.gonRectangleArr[C];w&&(w.show=!1)}f.modifyHandler&&(f.modifyHandler.destroy(),f.modifyHandler=null)}},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(y){var x=f._viewer.scene.pick(y.endPosition);if(f._core.CreateTooltip(o,y.endPosition,!1),!f.modifyPoint){f._cesium.defined(x)&&x.id&&x.id.objId&&f._core.CreateTooltip("\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E",y.endPosition,!0);return}if(!(f.positions.length<1||!f.modifyPoint)){var C=f.getCatesian3FromPX(y.endPosition,f._viewer,[f.shape.entity,f.modifyPoint]);C&&(f.modifyPoint.position.setValue(C),f.shape.points[f.modifyPoint.wz]=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(C),f.shape.rect=f._cesium.Rectangle.fromCartographicArray(f.shape.points),f.shape.rect.east+=1e-6,f.shape.rect.north+=1e-6),f._core.CreateTooltip(o,y.endPosition,!0)}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(y){if(f.forbidDrawWorld(!1),!!f.modifyPoint){var x=f.getCatesian3FromPX(y.position,f._viewer,[f.shape.entity,f.modifyPoint]);f.modifyPoint.position.setValue(x),f.shape.points[f.modifyPoint.wz]=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(x),f.shape.rect=f._cesium.Rectangle.fromCartographicArray(f.shape.points),f.shape.rect.east+=1e-6,f.shape.rect.north+=1e-6,f.modifyPoint=null,f.forbidDrawWorld(!1),o="\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E"}},Cesium.ScreenSpaceEventType.LEFT_UP)}};Pu.prototype.createPoint=function(o,f){if(!!o)return this._viewer.entities.add({position:o,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:f})};Pu.prototype.getCatesian3FromPX=function(o,f,m){var v=f.scene.pick(o),y,x=f.scene.drillPick(o),C=null;if(m){for(var w=0;w<x.length;w++)if(x[w].id._id!=m[0].id&&x[w].id._id!=m[1].id){C=x[w].id;break}}else C=v;if(f.scene.pickPositionSupported&&this._cesium.defined(C))y=f.scene.pickPosition(o);else{var A=f.camera.getPickRay(o);if(!A)return;y=f.scene.globe.pick(A,f.scene)}return y};Pu.prototype.forbidDrawWorld=function(o){this._viewer.scene.screenSpaceCameraController.enableRotate=!o,this._viewer.scene.screenSpaceCameraController.enableTilt=!o,this._viewer.scene.screenSpaceCameraController.enableTranslate=!o,this._viewer.scene.screenSpaceCameraController.enableInputs=!o};Pu.prototype.CreateRectangle=function(o,f,m,v,y){var x=this,C=x._core.getuid(),w={outlineColor:this._cesium.Color.RED,material:this._cesium.Color.YELLOW.withAlpha(.5)};m&&m.fillColor&&(w.material=new no(this._viewer,this._cesium).colorFromHtmlColor(m.fillColor)),m&&m.outlineColor&&(w.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(m.outlineColor)),w=this._core.extend(w,m,!1),w.coordinates=this.getCoordinates(f),this.item=x._viewer.entities.add({id:C,name:o||"\u65B0\u5EFA\u77E9\u5F62",rectangle:w}),typeof y=="function"&&y(this.item),!x._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id);var A={id:C,name:"\u65B0\u5EFA\u77E9\u5F62"+C,pId:x._core.isnull(v)?0:v,type:"rectangle",item:this.item};return x.setTreeobj(A),Ne.insertGroupId(A,x._core.isnull(v)?0:v),this};Pu.prototype.getCoordinates=function(o){var f,m,v,y;return o[0].lon>o[1].lon?(f=o[1].lon,m=o[0].lon):(f=o[0].lon,m=o[1].lon),o[0].lat>o[1].lat?(v=o[0].lat,y=o[1].lat):(v=o[1].lat,y=o[0].lat),this._cesium.Rectangle.fromDegrees(f,y,m,v)};Pu.prototype.createRectanglelbj=function(o,f){var m=this,v=this,y=[];m.shape={points:[],button:0,rect:null,entity:null},this._tree.removeHandler(),this.closeBrowseBorder();var x,C,w=0;o!=null&&o!=null&&o.id!=null&&(w=o.id);var A=this._core.CreateTooltip();v._tree.handler=new this._cesium.ScreenSpaceEventHandler(v._viewer.scene.canvas);var E=null,T=null;v._tree.handler.setInputAction(function(P){C=v._core.getPointFromWindowPoint(P.position,v._viewer);var D=v._viewer.camera.pickEllipsoid(P.position,v._viewer.scene.globe.ellipsoid);if(m.shape.button>=1){T=D;var L={obj1:E,obj2:T},R={position:v._viewer.camera.position.clone(),orientation:{heading:v._viewer.camera.heading,pitch:v._viewer.camera.pitch,roll:v._viewer.camera.roll}},O={originalCameraLocation:R,pointes:L,terrainExaggeration:"5",zj:"true"};v.llbj(O,m.shape.entity),typeof f=="function"&&f(m.shape.entity),v._tree.handler.removeInputAction(v._cesium.ScreenSpaceEventType.LEFT_CLICK)}else E=D;m.shape.button=m.shape.button+1,C&&(m.shape.points.length==0?(y.push(C),m.shape.points.push(v._viewer.scene.globe.ellipsoid.cartesianToCartographic(C)),m.shape.rect=v._cesium.Rectangle.fromCartographicArray(m.shape.points),m.shape.rect.east+=1e-6,m.shape.rect.north+=1e-6,m.shape.entity=v._viewer.entities.add({rectangle:{coordinates:m.shape.rect,material:v._cesium.Color.YELLOW.withAlpha(0),outline:!0,outlineWidth:10,outlineColor:v._cesium.Color.YELLOW,height:0}}),m.shape.entity.rectangle.coordinates=new v._cesium.CallbackProperty(function(){return m.shape.rect},!1),v.item=m.shape.entity):m.shape.points.length==2||v._tree.handler.removeInputAction(v._cesium.ScreenSpaceEventType.MOUSE_MOVE))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),v._tree.handler.setInputAction(function(P){if(m.shape.points.length==0?A.showAt(P.endPosition,"\u70B9\u51FB\u5DE6\u952E\u5728\u7403\u9762\u4E0A\u7ED8\u5236\u77E9\u5F62\uFF01"):T&&A.showAt(P.endPosition,"\u8BF7\u5C06\u89C6\u91CE\u7F29\u653E\u5230\u8303\u56F4\u5185\u4EE5\u5F00\u542F\u8FB9\u754C\u6D4F\u89C8"),!(m.shape.points.length==0||T)){A.showAt(P.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");var D=v._core.getPointFromWindowPoint(P.endPosition,v._viewer);if(D){var L=v._viewer.camera.getPickRay(P.endPosition),R=v._viewer.scene.globe.pick(L,v._viewer.scene);y[1]=D,m.shape.points[1]=v._viewer.scene.globe.ellipsoid.cartesianToCartographic(D),m.shape.rect=v._cesium.Rectangle.fromCartographicArray(m.shape.points),m.shape.rect.west==m.shape.rect.east&&(m.shape.rect.east+=1e-6),m.shape.rect.south==m.shape.rect.north&&(m.shape.rect.north+=1e-6)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var S=0;!v._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(S=Ne.selectedItem.id);var M=v._core.getuid(),I={id:M,name:"\u65B0\u5EFA\u6D4F\u89C8\u8FB9\u754C"+M,pId:v._core.isnull(w)?0:w,type:"rectangle",item:v};return v.setTreeobj(I),Ne.insertGroupId(I,v._core.isnull(w)?0:w),this};Pu.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show._value,f=this.item.rectangle.coordinates==null?void 0:this.item.rectangle.coordinates._value;f!=null&&(f={east:f.east,north:f.north,south:f.south,west:f.west});var m=this.item.rectangle.height==null?void 0:this.item.rectangle.height._value,v=this.item.rectangle.extrudedHeight==null?void 0:this.item.rectangle.extrudedHeight._value,y=this.item.rectangle.rotation==null?void 0:this.item.rectangle.rotation._value,x=this.item.rectangle.stRotation==null?void 0:this.item.rectangle.stRotation._value,C=this.item.rectangle.fill==null?void 0:this.item.rectangle.fill._value,w=this.item.rectangle.material;w!=null&&(w={color:w.color._value==null?void 0:"rgba("+w.color._value.red+","+w.color._value.green+","+w.color._value.blue+","+w.color._value.alpha+")",image:w.image==null?void 0:w.image._value,diffusemap:w.diffusemap==null?void 0:w.diffusemap._value,alphamap:w.alphamap==null?void 0:w.alphamap._value});var A=this.item.rectangle.outline==null?void 0:this.item.rectangle.outline._value,E=this.item.rectangle.outlineColor==null?void 0:"rgba("+this.item.rectangle.outlineColor._value.red+","+this.item.rectangle.outlineColor._value.green+","+this.item.rectangle.outlineColor._value.blue+","+this.item.rectangle.outlineColor._value.alpha+")",T=this.item.rectangle.outlineWidth==null?void 0:this.item.rectangle.outlineWidth._value,S=this.item.rectangle.distanceDisplayCondition,M=S?._value.near,I=S?._value.far;return{type:"rectangle",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:o,coordinates:f,height:m,extrudedHeight:v,rotation:y,stRotation:x,fill:C,material:w,outline:A,outlineColor:E,outlineWidth:T,near:M,far:I}}};Pu.prototype.setTreeobj=function(o){this.treeobj=o};Pu.prototype.llbj=function(o,f){var m=document.getElementById("toolTip");m.innerHTML="\u8BF7\u5C06\u89C6\u91CE\u7F29\u653E\u5230\u8303\u56F4\u5185\u4EE5\u5F00\u542F\u8FB9\u754C\u6D4F\u89C8";var v=f.rectangle;v.height=void 0,v.heightReference=void 0,v.perPositionHeight=!1;var y=o.pointes,x=[];x.push(y.obj1),x.push(y.obj2);for(var C={},w=0,A,E,T;w<x.length;w++)A=this._cesium.Cartographic.fromCartesian(x[w]),E=this._cesium.Math.toDegrees(A.longitude),T=this._cesium.Math.toDegrees(A.latitude),w===0?(C.west=E,C.north=T,C.east=E,C.south=T):(E>C.west?C.east=E:C.west=E,T>C.south?C.north=T:C.south=T);var S={destination:{x:(x[0].x+x[1].x)/2,y:(x[0].y+x[1].y)/2,z:x[0].z+500},orientation:{heading:this._viewer.camera.heading,pitch:this._viewer.camera.pitch,roll:this._viewer.camera.roll}},M=this._viewer.camera.heading,I=this._viewer.camera.pitch,P=this._viewer.camera.roll,D=this._viewer.camera.position.clone(),L={orientation:{heading:M,pitch:I,roll:P},position:D},R=this;R.flyListener=function(){var O=R._viewer.camera.computeViewRectangle(),F=O.west/Math.PI*180,k=O.north/Math.PI*180,U=O.east/Math.PI*180,G=O.south/Math.PI*180,j={west:F,north:k,east:U,south:G},q=R.isInArea(j,C);q?(R._tree.removeHandler(),m.style.left="50%",m.style.top="50%",m.innerHTML="\u8FB9\u754C\u6D4F\u89C8\u5DF2\u5F00\u542F\uFF0C\u53F3\u952E\u7ED3\u675F\u8FB9\u754C\u6D4F\u89C8",setTimeout(function(){m.style.display="none"},2e3),R._viewer.scene.camera.changed.removeEventListener(R.flyListener),R.flyListener=void 0,R._tree.handler=new R._cesium.ScreenSpaceEventHandler(R._viewer.scene.canvas),R._viewEvent=function(J){L=R.limitView(C,L)},R._viewer.scene.camera.percentageChanged=.001,R._viewer.scene.camera.changed.addEventListener(R._viewEvent),R._tree.handler.setInputAction(function(J){R.closeBrowseBorder()},R._cesium.ScreenSpaceEventType.RIGHT_CLICK)):(M=R._viewer.camera.heading,I=R._viewer.camera.pitch,P=R._viewer.camera.roll,D=R._viewer.camera.position.clone(),L={orientation:{heading:M,pitch:I,roll:P},position:D})},this._viewer.scene.camera.percentageChanged=.001,this._viewer.scene.camera.changed.addEventListener(R.flyListener)};Pu.prototype.closeBrowseBorder=function(){var o=document.getElementById("toolTip");this._tree.endtemporaryItem(),this._tree.handler&&this._tree.handler.destroy(),this.flyListener&&(this._viewer.scene.camera.changed.removeEventListener(this.flyListener),this.flyListener=void 0),this._viewEvent?(this._viewer.scene.camera.changed.removeEventListener(this._viewEvent),this._viewEvent=void 0,o.style.display="block",o.innerHTML="\u53D6\u6D88\u8FB9\u754C\u6D4F\u89C8",setTimeout(function(){o.style.display="none"},1e3)):o&&(o.style.display="none")};Pu.prototype.limitView=function(o,f){var m=this._viewer.camera.computeViewRectangle(),v=m.west/Math.PI*180,y=m.north/Math.PI*180,x=m.east/Math.PI*180,C=m.south/Math.PI*180,w={west:v,north:y,east:x,south:C},A=this.isInArea(w,o);if(!A)f!==null&&this._viewer.camera.setView({destination:f.position,orientation:f.orientation});else{var E=this._viewer.camera.heading,T=this._viewer.camera.pitch,S=this._viewer.camera.roll,M=this._viewer.camera.position.clone();f={orientation:{heading:E,pitch:T,roll:S},position:M}}return f};Pu.prototype.isInArea=function(o,f){var m=!1;return o.south>f.south&&o.east<f.east&&o.north<f.north&&o.west>f.west&&(m=!0),m};Pu.prototype.createRectangledxkz=function(o){var f=this,m=this,v=[];m.shape={points:[],rect:null,entity:null};var y=null,x=null,C,w=new f._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas);w.setInputAction(function(E){C=A(E.position);var T=[],S=[],M=f._viewer.camera.pickEllipsoid(E.position,f._viewer.scene.globe.ellipsoid);if(y==null&&(y=M),y.x==M.x&&y.y==M.y&&y.z==M.z||(x=M),C)if(m.shape.points.length==0)v.push(C),m.shape.points.push(f._viewer.scene.globe.ellipsoid.cartesianToCartographic(C)),m.shape.rect=f._cesium.Rectangle.fromCartographicArray(m.shape.points),m.shape.rect.east+=1e-6,m.shape.rect.north+=1e-6,m.shape.entity=f._viewer.entities.add({rectangle:{coordinates:m.shape.rect,material:f._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:f._cesium.Color.RED,height:0}}),m.bufferEntity=m.shape.entity;else{w.removeInputAction(f._cesium.ScreenSpaceEventType.MOUSE_MOVE),w.removeInputAction(f._cesium.ScreenSpaceEventType.LEFT_CLICK);var I={obj1:y,obj2:x},P={position:f._viewer.camera.position.clone(),orientation:{heading:f._viewer.camera.heading,pitch:f._viewer.camera.pitch,roll:f._viewer.camera.roll}},D={pointes:I,originalCameraLocation:P};o!=""&&o!=null&&typeof o=="function"&&o(D)}},f._cesium.ScreenSpaceEventType.LEFT_CLICK),w.setInputAction(function(E){if(m.shape.points.length!=0){var T=A(E.endPosition);T&&(v[1]=T,m.shape.points[1]=f._viewer.scene.globe.ellipsoid.cartesianToCartographic(T),m.shape.rect=f._cesium.Rectangle.fromCartographicArray(m.shape.points),m.shape.rect.west==m.shape.rect.east&&(m.shape.rect.east+=1e-6),m.shape.rect.south==m.shape.rect.north&&(m.shape.rect.north+=1e-6),m.shape.entity.rectangle.coordinates=m.shape.rect)}},f._cesium.ScreenSpaceEventType.MOUSE_MOVE);function A(E){if(f._viewer.scene.terrainProvider.constructor.name=="EllipsoidTerrainProvider")return f._viewer.camera.pickEllipsoid(E,f._viewer.scene.globe.ellipsoid);var T=f._viewer.scene.camera.getPickRay(E);return f._viewer.scene.globe.pick(T,f._viewer.scene)}return this};Pu.prototype.executeExcavation=function(o){var f=this,m=this,v=[];f.shape={points:[],button:0,rect:null,entity:null};var y,x=new this._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas),C=[];x.setInputAction(function(T){if(y=m._core.getPointFromWindowPoint(T.position,m._viewer),f.shape.button>=2){var S=f._viewer.scene.globe;f.shape.box=m._viewer.entities.add({position:m._cesium.Cartesian3.fromDegrees(C[0].lon,C[0].lat,100),box:{dimensions:new m._cesium.Cartesian3(1e4,1e4,1e4),material:m._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:m._cesium.Color.WHITE}}),S.depthTestAgainstTerrain=!0,S.clippingPlanes=new f._cesium.ClippingPlaneCollection({modelMatrix:f.shape.box.computeModelMatrix(m._cesium.JulianDate.now()),planes:[new m._cesium.Plane(new m._cesium.Cartesian3(1,0,0),-700),new m._cesium.Plane(new m._cesium.Cartesian3(-1,0,0),-700),new m._cesium.Plane(new m._cesium.Cartesian3(0,1,0),-700),new m._cesium.Plane(new m._cesium.Cartesian3(0,-1,0),-700)],edgeWidth:1,edgeColor:m._cesium.Color.WHITE}),x.removeInputAction(m._cesium.ScreenSpaceEventType.MOUSE_MOVE),x.removeInputAction(m._cesium.ScreenSpaceEventType.LEFT_CLICK)}if(f.shape.button=f.shape.button+1,y)if(f.shape.points.length==0){v.push(y),f.shape.points.push(m._viewer.scene.globe.ellipsoid.cartesianToCartographic(y));var M=m._viewer.scene.camera.pickEllipsoid(movement.position,m._viewer.scene.globe.ellipsoid),I=m._cesium.Cartographic.fromCartesian(M),P=m._cesium.Math.toDegrees(I.longitude),D=m._cesium.Math.toDegrees(I.latitude);C.push({lon:P,lat:D}),f.shape.rect=m._cesium.Rectangle.fromCartographicArray(f.shape.points),f.shape.rect.east+=1e-6,f.shape.rect.north+=1e-6,f.shape.entity=m._viewer.entities.add({rectangle:{coordinates:f.shape.rect,material:m._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:m._cesium.Color.RED,height:0}}),f.bufferEntity=f.shape.entity,m.item=f.shape.entity}else f.shape.points.length==2||(x.removeInputAction(m._cesium.ScreenSpaceEventType.MOUSE_MOVE),x.removeInputAction(m._cesium.ScreenSpaceEventType.LEFT_CLICK))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),x.setInputAction(function(T){if(f.shape.points.length!=0){var S=m._core.getPointFromWindowPoint(T.endPosition,m._viewer);if(S){var M=m._viewer.camera.getPickRay(T.endPosition),I=m._viewer.scene.globe.pick(M,m._viewer.scene);v[1]=S,f.shape.points[1]=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(S),f.shape.rect=m._cesium.Rectangle.fromCartographicArray(f.shape.points),f.shape.rect.west==f.shape.rect.east&&(f.shape.rect.east+=1e-6),f.shape.rect.south==f.shape.rect.north&&(f.shape.rect.north+=1e-6),f.shape.entity.rectangle.coordinates=f.shape.rect}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var w=0;!m._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(w=Ne.selectedItem.id);var A=m._core.getuid(),E={id:A,name:"\u65B0\u5EFA\u77E9\u5F62"+A,pId:m._core.isnull(w)?0:w,type:"rectangle",item:m};return m.setTreeobj(E),Ne.insertGroupId(E,m._core.isnull(w)?0:w),typeof o=="function"&&o(ploylinejl),this};Pu.prototype.deleteObject=function(){this._viewer.entities.remove(this.item),this._viewEvent!=null&&(this._tree.handler.destroy(),this._viewer.scene.camera.changed.removeEventListener(this._viewEvent))};Pu.prototype.setVisibility=function(o){this.item.show=o};Pu.prototype.getVisibility=function(){return this.item.show};Pu.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._rectangle.distanceDisplayCondition=m}catch(v){console.log(v)}return this};Pu.prototype.setRectangleAlpha=function(o){try{this.item._rectangle.material.color._value.alpha=o,this.item._rectangle.show=!0}catch(f){console.log(f)}return this};Pu.prototype.setRectangleColor=function(o){try{this.item._rectangle.material.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};Pu.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._rectangle.distanceDisplayCondition=m}catch(v){console.log(v)}return this};Pu.prototype.setPolygonImage=function(o){try{this.item._rectangle.material=new this._cesium.ImageMaterialProperty({image:o})}catch(f){console.log(f)}return this};Pu.prototype.setRectangleRepeat=function(o,f){try{this.item._rectangle.material.repeat=new this._cesium.Cartesian2(o,f)}catch(m){console.log(m)}return this};Pu.prototype.setOutlineColor=function(o){try{this.item._rectangle.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};Pu.prototype.setOutline=function(o){try{this.item._rectangle.outline=o}catch(f){console.log(f)}return this};Pu.prototype.setExtrudedHeight=function(o){try{this.item._rectangle.extrudedHeight=o}catch(f){console.log(f)}return this};Pu.prototype.setHeight=function(o){try{this.item._rectangle.height=o}catch(f){console.log(f)}return this};Object.defineProperties(Pu.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(o){this.item.rectangle=o}}});Pu.prototype.setItem=function(o){this.item=o};Object.defineProperties(Pu.prototype,{polyline:{get:function(){return this.item.polyline},set:function(o){this.item.polyline=o}}});Object.defineProperties(Pu.prototype,{polygon:{get:function(){return this.item.polygon},set:function(o){this.item.polygon=o}}});Object.defineProperties(Pu.prototype,{point:{get:function(){return this.item.point},set:function(o){this.item.point=o}}});Object.defineProperties(Pu.prototype,{label:{get:function(){return this.item.label},set:function(o){this.item.label=o}}});Object.defineProperties(Pu.prototype,{model:{get:function(){return this.item.model},set:function(o){this.item.model=o}}});Object.defineProperties(Pu.prototype,{wall:{get:function(){return this.item.wall},set:function(o){this.item.wall=o}}});Object.defineProperties(Pu.prototype,{polygonTempOptions:{get:function(){return{height:0,extrudedHeight:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:ShadowMode.DISABLED,classificationType:ClassificationType.BOTH,arcType:ArcType.GEODESIC}}}});var NT=Pu;function KOi(o,f){this._viewer=o,this._cesium=f}KOi.prototype.zoomIn=function(){var o=Math.ceil(this._viewer.camera.positionCartographic.height)*.6;return this._viewer.camera.zoomIn(o)};function QOi(o,f){this._viewer=o,this._cesium=f}QOi.prototype.zoomOut=function(){var o=Math.ceil(this._viewer.camera.positionCartographic.height)*.6;return this._viewer.camera.zoomOut(o)};function Tc(o){this._earthCtrl=o,this._coreMap=o.coreMap,this._camera=this._coreMap.camera,this._undergroundMode=!1,this.underground=new Rq,this._jumpTo=new Qlt(o.viewer,qi),this._PointFly=new c8(o.viewer,qi),this._flyToObj=new eut(o.viewer,qi)}Tc.prototype.setViewBound=function(o,f,m,v){};Tc.prototype.forward=function(o){this._camera.moveBackward(o)};Tc.prototype.backward=function(o){this._camera.moveForward(o)};Tc.prototype.moveLeft=function(o){this._camera.moveLeft(o)};Tc.prototype.moveRight=function(o){this._camera.moveRight(o)};Tc.prototype.moveUp=function(o){this._camera.moveUp(o)};Tc.prototype.moveDown=function(o){this._camera.moveDown(o)};Tc.prototype.turnLeft=function(o){this._camera.twistLeft(o)};Tc.prototype.turnRight=function(o){this._camera.twistRight(o)};Tc.prototype.lookLeft=function(o){this._camera.lookLeft(o)};Tc.prototype.lookRight=function(o){this._camera.lookRight(o)};Tc.prototype.lookUp=function(o){this._camera.lookUp(o)};Tc.prototype.lookDown=function(o){this._camera.lookDown(o)};Tc.prototype.zoomIn=function(o){Z(this.undergroundMode,!1)===!1&&(this._camera.positionCartographic.height<o||!o&&this._camera.positionCartographic.height<1)||(o||(o=Math.ceil(this._camera.positionCartographic.height)*.6),this._camera.zoomIn(o))};Tc.prototype.zoomOut=function(o){o||(o=Math.ceil(this._camera.positionCartographic.height)*.6),this._camera.zoomOut(o)};Tc.prototype.zoom=function(o){};Tc.prototype.moveHeading=function(o){o=Z(o,1);let f=xe.toDegrees(this._coreMap.camera.heading)+o,m=this._coreMap.camera.pitch;this._coreMap.camera.setView({orientation:{heading:xe.toRadians(f),pitch:m,endTransform:Ee.IDENTITY}})};Tc.prototype.stop=function(){this._camera.cancelFlight()};Tc.prototype.jumpTo=function(o){return this.stop(),this._jumpTo.jumpTo(o)};Tc.prototype.rotateCenter=function(o=360,f=5){let m={x:this._coreMap.canvas.clientWidth/2,y:this._coreMap.canvas.clientHeight/2};return this._PointFly.setPointFly({position:this.getMousePosition(m),time:f,limitAngel:o,limitTime:!0,hideImage:!0,pitch:xe.toDegrees(this._coreMap.camera.pitch)})};Tc.prototype.executeFlycesium=function(o){return this._dynamicObject||(this._dynamicObject=new WO(this._coreMap,qi)),this._dynamicObject.executeFlycesium(o)};Tc.prototype.createRectanglelbj=function(o,f){this._rectangle||(this._rectangle=new NT(this._coreMap,qi)),this._rectangle.createRectanglelbj(o,f)};Tc.prototype.closeBrowseBorder=function(){this._rectangle&&this._rectangle.closeBrowseBorder()};Tc.prototype.flyToObj=function(o){this.stop(),this._flyToObj.flyToObj(o)};Tc.prototype.getMousePosition=function(o,f){return this._getPosition||(this._getPosition=new Ru(this._earthCtrl.viewer,qi)),this._getPosition.getMousePosition(o,f)};Tc.prototype.pickFromRay=function(o,f,m){let v=this._camera.getPickRay(o),y=this._coreMap.scene.pickFromRay(v,f,m);return N(y)?y.position:void 0};Tc.prototype.flyTo=function(o,f,m,v=0,y=-60,x=0,C=3,w){this._camera.flyTo({destination:H.fromDegrees(o,f,m),orientation:{heading:xe.toRadians(v),pitch:xe.toRadians(y),roll:xe.toRadians(x)},duration:C,complete:w})};Tc.prototype.flyToTarget=function(o,f,m,v,y,x,C,w,A){this._camera.flyTo({destination:H.fromDegrees(o,f,m),orientation:{heading:xe.toRadians(v),pitch:xe.toRadians(y),roll:xe.toRadians(x)},duration:w})};Tc.prototype.flyToPointsInterest=function(o,f){return this._camera.flyTo({destination:o.destination,orientation:o.orientation,duration:o.duration,complete:f})};var ZOi=new Pi;Tc.prototype.getPoseByData=function(o,f,m,v,y){let x=!1;if(o.length===0)return x;let C=new Pi;for(let A=0;A<o.length;A++){let E=o[A];if(E.rtti==="GwModel"||E.rtti==="GwModelLayer"){let T=E._primitive;if(N(T.modelMatrix)&&N(T.boundingSphere)){let S=Pi.transform(T.boundingSphere,T.modelMatrix,ZOi);A===0?Pi.clone(S,C):C=Pi.union(C,S,C),x=!0}}}if(x!==!0)return x;let w=Mt.fromCartesian(C.center);return y.longitude=xe.toDegrees(w.longitude),y.latitude=xe.toDegrees(w.latitude),y.height=w.height+C.radius,y.heading=f,y.tilt=m,y.roll=v,x};Tc.prototype.setView=function(o){this._camera.setView(o)};Tc.prototype.headingControl=function(o){if(this._earthCtrl.tools.clearTool(),o){let f=this._camera,m=new nlt(this._earthCtrl,function(v){let y=xe.toDegrees(f.heading)+v.headingAmount,x=xe.toDegrees(f.pitch)+v.pitchAmount;f.setView({destination:f.position,orientation:{heading:xe.toRadians(y),pitch:xe.toRadians(x),roll:0}})});this._earthCtrl.tools.registerTool("mouse_heading_tool",m)}};Tc.prototype.rotateCamera=function(o){let f=this._earthCtrl,m=Z(o.lon,120.9),v=Z(o.lat,30.8),y=Z(o.height,0),x=H.fromDegrees(m,v,y),C=Z(o.time,30),w=xe.toRadians(o.pitch),A=360/C,E=o.distance,T=ci.fromDate(new Date),S=ci.addSeconds(T,C,new ci),M=Z(o.keepRotating,!0);f.clock.startTime=T.clone(),f.clock.stopTime=S.clone(),f.clock.currentTime=T.clone(),f.clock.clockRange=L0.CLAMPED,f.clock.clockStep=Od.SYSTEM_CLOCK;let I=f.coreMap.scene.camera.heading,P=function(){let L=ci.secondsDifference(f.clock.currentTime,f.clock.startTime),R=xe.toRadians(L*A)+I;f.coreMap.scene.camera.lookAt(x,new gC(R,w,E)),ci.compare(f.clock.currentTime,f.clock.stopTime)>=0&&f.clock.onTick.removeEventListener(P)};return f.clock.onTick.addEventListener(P),this.removeFromMap=()=>{f.clock.onTick.removeEventListener(P),f.coreMap.camera.lookAtTransform(Ee.IDENTITY)},this};Tc.prototype.viewPoint={lon:104.5,lat:30.0624522000912,alt:6649118,heading:360,pitch:-90,roll:0,duration:0};Object.defineProperties(Tc.prototype,{enableModelColliDetection:{get:function(){return this._coreMap.scene.screenSpaceCameraController.enableModelCollisionDetection},set:function(o){this._coreMap.scene.screenSpaceCameraController.enableModelCollisionDetection=o}},enableModelGroundCollisionDetection:{get:function(){return this._coreMap.scene.screenSpaceCameraController.enableModelGroundCollisionDetection},set:function(o){this._coreMap.scene.screenSpaceCameraController.enableModelGroundCollisionDetection=o}},enableGroundRoaming:{get:function(){return this._coreMap.scene.screenSpaceCameraController.enableGroundRoaming},set:function(o){this._coreMap.scene.screenSpaceCameraController.enableInputs=!o,this._coreMap.scene.screenSpaceCameraController.enableRotate=!o,this._coreMap.scene.screenSpaceCameraController.enableZoom=!o,this._coreMap.scene.screenSpaceCameraController.enableTilt=!o,this._coreMap.scene.screenSpaceCameraController.enableLook=!o,this._coreMap.scene.screenSpaceCameraController.enableGroundRoaming=o,this._coreMap.camera.frustum.near=o?.1:1,this._coreMap.camera.frustum.fov=xe.toRadians(90)}},collisionRayWidth:{get:function(){return this._coreMap.scene.screenSpaceCameraController.defaultCollisionRayWidth},set:function(o){this._coreMap.scene.screenSpaceCameraController.defaultCollisionRayWidth=o}},groundRoamingHeight:{get:function(){return this._coreMap.scene.screenSpaceCameraController.defaultGroundRoamingHeight},set:function(o){o<1.5&&(o=1.5),this._coreMap.scene.screenSpaceCameraController.defaultGroundRoamingHeight=o}},undergroundMode:{get:function(){return this._undergroundMode},set:function(o){this._undergroundMode=o,o?this._coreMap.scene.globe.translucency.enabled=!0:this._coreMap.scene.globe.translucency.enabled=!1}},imageryLayerAlpha:{get:function(){return this._coreMap.scene.globe.translucency.frontFaceAlpha},set:function(o){this._coreMap.scene.globe.translucency.frontFaceAlpha=o}},cartesian3:{get:function(){return this._camera.position}},position:{get:function(){let o=Mt.fromCartesian(this._camera.position);return o.longitude=xe.toDegrees(o.longitude),o.latitude=xe.toDegrees(o.latitude),o}},heading:{get:function(){return xe.toDegrees(this._camera.heading)}},pitch:{get:function(){return xe.toDegrees(this._camera.pitch)}},roll:{get:function(){return xe.toDegrees(this._camera.roll)}}});var eDe=Tc;var DD=new H(0,0,0),qX=new H(0,0,0),d8=new H(0,0,0),Cse=new H(0,0,0),out=new H(0,0,0),$Oi=new H,tDe=class extends ls{constructor(f,m,v){super(f,v,m.enable),this.name="MeasureAzimuthTool",this._core=new PC(f),this._lineNorth=void 0,this._lineNorthAid=void 0,this._lineDirectionAid=void 0,this._lineDirection=void 0,this._sector=void 0,this._angleLabel=void 0,this._lineNorthPositions=[],this._lineNorthAidPositions=[],this._lineDirectionPositions=[],this._lineDirectionAidPositions=[],this._positionMatrix=new Ee,this._inversePositionMatrix=new Ee,this._labelAnglePosition=new H,this._angle=0,this._radii=new H,this.toolTips=this._core.createTooltip({style:{id:"AzimuthTool"},show:!1})}onActive(){this.mClickCount=0,this._core.mouse(this.mEarthCtrl.viewer.container,1,`${window.SmartEarthRootUrl}Assets/image/cursor/draw.cur`)}onDeactive(){this.clearResult(),this.mClickCount=0}clearResult(){this.mClickCount=0,N(this._lineDirection)&&(this._lineDirection.destory(),this._lineDirection=null),N(this._lineNorth)&&(this._lineNorth.destory(),this._lineNorth=null),N(this._lineNorthAid)&&(this._lineNorthAid.destory(),this._lineNorthAid=null),N(this._lineDirectionAid)&&(this._lineDirectionAid.destory(),this._lineDirectionAid=null),N(this._sector)&&(this.mEarthCtrl.entities.remove(this._sector),this._sector=null),N(this._angleLabel)&&(this.mEarthCtrl.entities.remove(this._angleLabel),this._angleLabel=null)}getAzimuth(f,m){let v=Ee.multiplyByPoint(this._inversePositionMatrix,m,$Oi);H.normalize(v,v),this._angle=xe.fastApproximateAtan2(v.y,v.x),this._angle<0&&(this._angle+=xe.TWO_PI)}onLButtonUp(f){if(!super.onLButtonUp(f)||this.mClickCount>=2)return!1;if(this.pickVector(f,d8)){if(this.mClickCount===0){H.clone(d8,qX);let m=Mt.fromCartesian(qX);m.height+=1,Mt.toCartesian(m,ki.WGS84,DD),this._positionMatrix=tn.eastNorthUpToFixedFrame(DD),this._inversePositionMatrix=Ee.inverse(this._positionMatrix,this._inversePositionMatrix),this.addPosition(this._lineNorthPositions,DD),this.addPosition(this._lineDirectionPositions,DD),this.addPosition(this._lineNorthAidPositions,qX),this.addPosition(this._lineNorthAidPositions,DD)}else this.updateDirectionPosition(d8,!0),this._core.mouse(this.mEarthCtrl.viewer.container,0,"0"),this.mEnable=!1,this.toolTips.show=!1;this.mClickCount++}return!0}onMouseMove(f){super.onMouseMove(f),this.toolTips.show||(this.toolTips.show=!0);let m=this;if(this.mClickCount===0)this.toolTips.showAts({text:`${this.mEarthCtrl.language.TOOLS_MEASURE_AZIMUTH_LEFT_TO_START}`,position:f});else if(this.mClickCount===1){if(this.toolTips.showAts({text:`${this.mEarthCtrl.language.TOOLS_MEASURE_AZIMUTH_LEFT_TO_STOP}`,position:f}),this.pickVector(f,d8)){if(d8.equals(qX))return;if(this.updateDirectionPosition(d8),N(this._lineDirection)||(this._lineDirection=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this._lineDirectionPositions,color:new _C(Re.GREEN),width:15}),this._lineDirection.entity.polyline.depthFailMaterial=new _C(Re.YELLOW)),N(this._lineDirectionAid)||(this._lineDirectionAid=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this._lineDirectionAidPositions,color:Re.YELLOW,width:4})),N(this._lineNorth)||(this._lineNorth=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this._lineNorthPositions,color:new _C(Re.RED),width:15}),this._lineNorth.entity.polyline.depthFailMaterial=new _C(Re.YELLOW)),N(this._lineNorthAid)||(this._lineNorthAid=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this._lineNorthAidPositions,color:Re.YELLOW,width:4})),!N(this._angleLabel)){let v=function(){return m._labelAnglePosition},y=function(){return`${xe.toDegrees(m._angle).toFixed(2)}\xB0`};this._angleLabel=this.mEarthCtrl.entities.add({id:"azimuth_label",position:new xn(v,!1),label:{text:new xn(y,!1),disableDepthTestDistance:1e4}})}if(!N(this._sector)){let v=function(){return m._radii},y=function(){return DD},x=function(){return xe.PI_OVER_TWO-m._angle};this._sector=this.mEarthCtrl.entities.add({id:"azimuth_sector",position:new xn(y,!1),ellipsoid:{radii:new xn(v,!1),innerRadii:new H(.1,.1,.1),minimumClock:new xn(x,!1),maximumClock:xe.PI_OVER_TWO,minimumCone:xe.PI_OVER_TWO,maximumCone:xe.PI_OVER_TWO,material:Re.GREENYELLOW.withAlpha(.3)}})}}}else this.toolTips.show&&(this.toolTips.show=!1)}updateDirectionPosition(f,m){let v=Mt.fromCartesian(f),y=Mt.fromCartesian(qX),x=Mt.fromCartesian(DD);v.height>=y.height?(v.height+=1,Mt.toCartesian(v,ki.WGS84,Cse),y.height=v.height,Mt.toCartesian(y,ki.WGS84,DD),this._positionMatrix=tn.eastNorthUpToFixedFrame(DD),this._inversePositionMatrix=Ee.inverse(this._positionMatrix,this._inversePositionMatrix)):(v.height=x.height,Mt.toCartesian(v,ki.WGS84,Cse)),this.addPosition(this._lineDirectionPositions,Cse);let C=this.calculateNorthPosition(this._lineDirectionPositions[0],this._lineDirectionPositions[1]);this.addPosition(this._lineNorthPositions,C),this._lineDirectionAidPositions.pop(),this._lineDirectionAidPositions.pop(),this.addPosition(this._lineDirectionAidPositions,f),this.addPosition(this._lineDirectionAidPositions,Cse),m&&(N(this._lineNorth)&&(this._lineNorth.entity.polyline.positions=this._lineNorthPositions),N(this._lineDirection)&&(this._lineDirection.entity.polyline.positions=this._lineDirectionPositions)),this.getAzimuth(this._lineDirectionPositions[0],this._lineDirectionPositions[1]),this.mCallback&&this.mCallback({result:this._angle})}addPosition(f,m){f.length>=2&&f.pop(),f.push(m)}calculateNorthPosition(f,m){let v=H.distance(f,m),y=v/4;this._radii.x=y,this._radii.y=y,this._radii.z=y;let x=new H(0,v,0);return this.calculateLabelPosition(y),Ee.multiplyByPoint(this._positionMatrix,x,out),out}calculateLabelPosition(f){H.fromElements(0,0,0,this._labelAnglePosition),this._labelAnglePosition.y=f;let m=Ut.fromRotationZ(-this._angle/2);Ut.multiplyByVector(m,this._labelAnglePosition,this._labelAnglePosition),Ee.multiplyByPoint(this._positionMatrix,this._labelAnglePosition,this._labelAnglePosition)}onRButtonClick(f){super.onRButtonClick(f)}},aut=tDe;var sut=new H(0,0,0),iDe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="MeasureLineLengthTool"}onActive(){this.mClickCount=0,this.mLength=0,this.mControlPointArray=new Array(2),this.mCoordsArray=[],this.mPolyline=null,this.mPoints=null,this.mLabel=null;let f=document.createElement("div");rp(".map-widget",f),rp(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),this.tooltip=document.getElementById("toolTip"),this.tooltip.innerHTML=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${this.mEarthCtrl.language.TOOLS_MEASURE_SLOPE_LEFT_CLICK_START_LEFT_STOP}</span>`}onDeactive(){this.clearResult(),this.mClickCount=0,this.mLength=0,this.mControlPointArray=null,this.mCoordsArray=null}clearResult(){N(this.mPolyline)&&(this.mPolyline.destory(),this.mPolyline=null),N(this.mPoints)&&(this.mPoints.destory(),this.mPoints=null),N(this.mLabel)&&(this.mLabel.destory(),this.mLabel=null),N(this.tooltip)&&(this.tooltip.style.display="none")}onLButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;if(this.tooltip.style.display="none",this.mClickCount>1)return!0;let m=new H(0,0,0);return this.pickVector(f,m)&&(this.mControlPointArray[this.mClickCount]=m,this.mClickCount===1&&(this.mLength=H.distance(this.mControlPointArray[0],this.mControlPointArray[1]),this.mCallback&&this.mCallback({result:this.mLength}),this.mEnable=!1),this.mClickCount++),!0}onMouseMove(f){if(super.onMouseMove(f),this.mClickCount<1&&(this.tooltip.style.left=`${f.x+10}px`,this.tooltip.style.top=`${f.y+20}px`,this.tooltip.style.display="block"),this.mClickCount===1&&(this.tooltip.innerHTML=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${this.mEarthCtrl.language.TOOLS_MEASURE_SLOPE_LEFT_CLICK_STOP}</span>`,this.tooltip.style.left=`${f.x+10}px`,this.tooltip.style.top=`${f.y+20}px`,this.tooltip.style.display="block",this.pickVector(f,sut))){this.mControlPointArray[1]=sut,this.mLength=H.distance(this.mControlPointArray[0],this.mControlPointArray[1]);let m=`${this.mEarthCtrl.language.TOOLS_MEASURE_LINE_LENGTH_LENGTH}`;this.mLength>=1e3?m+=`${parseInt(this.mLength/10)/100}${this.mEarthCtrl.language.UNIT_KILOMETER}`:m+=`${parseInt(this.mLength*100)/100}${this.mEarthCtrl.language.UNIT_METER}`,N(this.mPolyline)?(this.mLabel.position=this.mControlPointArray[1],this.mLabel.text=m):(this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mControlPointArray,color:Re.fromRgba(4286644096),width:3}),this.mLabel=ec.createLabelPrimitive(this.mEarthCtrl,{position:this.mControlPointArray[1],text:m}))}}},rDe=iDe;var f8=new H(0,0,0),nDe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="MeasurePathLengthTool"}onActive(){this.mTotalLength=0,this.mControlPointArray=[],this.mPathPointArray=[],this.mPolyline=null,this.mPoints=null,this.mLabel=null}onDeactive(){this.clearResult(),this.mTotalLength=0,this.mControlPointArray=null,this.mPathPointArray=null}clearResult(){N(this.mPolyline)&&(this.mPolyline.destory(),this.mPolyline=null),N(this.mPoints)&&(this.mPoints.destory(),this.mPoints=null),N(this.mLabel)&&(this.mLabel.destory(),this.mLabel=null)}onLButtonUp(f){return super.onLButtonUp(f)===!1?!1:(this.pickVector(f,f8)&&(this.mControlPointArray.length>0&&this.mControlPointArray.pop(),this.mControlPointArray.push(H.clone(f8)),this.mControlPointArray.push(H.clone(f8)),this.mTotalLength=this.calculateLength(this.mControlPointArray,!1),N(this.mPoints)&&this.mPoints.add(H.clone(f8))),!0)}onRButtonDown(f){super.onRButtonDown(f),this.mControlPointArray.length>=2&&(this.mEnable=!1,this.mCallback&&this.mCallback({result:this.mTotalLength}))}onMouseMove(f){super.onMouseMove(f);let m=this.mControlPointArray.length;if(!(m<=1)&&this.pickVector(f,f8)){H.clone(f8,this.mControlPointArray[m-1]),this.mTotalLength=this.calculateLength(this.mControlPointArray,!1);let v=`${this.mEarthCtrl.language.TOOLS_MEASURE_LINE_LENGTH_LENGTH}`;this.mTotalLength>=1e3?v+=`${parseInt(this.mTotalLength/10)/100}${this.mEarthCtrl.language.UNIT_KILOMETER}`:v+=`${parseInt(this.mTotalLength*100)/100}${this.mEarthCtrl.language.UNIT_METER}`,N(this.mPolyline)?(this.mLabel.position=this.mControlPointArray[m-1],this.mLabel.text=v):(this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mControlPointArray,color:Re.fromRgba(4286644096),width:3}),this.mLabel=ec.createLabelPrimitive(this.mEarthCtrl,{position:this.mControlPointArray[m-1],text:v}))}}},bse=nDe;var XX=new H(0,0,0),oDe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="MeasureHeightTool"}onActive(){this.mClickCount=0,this.mTotalLength=0,this.mControlPointArray=[];for(let v=0;v<3;v++)this.mControlPointArray.push(new H(0,0,0));this.mHorizontalVerts=new Array(2),this.mVerticalVerts=new Array(2),this.mHeight=0,this.mFirstVertex=new H(0,0,0),this.mSecondVertex=new H(0,0,0),this.mFirstCart=new Mt,this.mMidCart=new Mt,this.mSecondCart=new Mt,this.mPolylineHorizontal=null,this.mPolylineVertical=null,this.mPoints=null,this.mLabel=null;let f=document.createElement("div");rp(".map-widget",f),rp(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),this.tooltip=document.getElementById("toolTip"),this.tooltip.innerHTML=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${this.mEarthCtrl.language.TOOLS_MEASURE_SLOPE_LEFT_CLICK_START_LEFT_STOP}</span>`}onDeactive(){this.clearResult(),this.mClickCount=0,this.mTotalLength=0,this.mControlPointArray=null,this.mHorizontalVerts=null,this.mVerticalVerts=null,this.mHeight=0,this.mFirstVertex=null,this.mSecondVertex=null,this.mFirstCart=null,this.mMidCart=null,this.mSecondCart=null}clearResult(){N(this.mPolylineHorizontal)&&(this.mPolylineHorizontal.destory(),this.mPolylineHorizontal=null),N(this.mPolylineVertical)&&(this.mPolylineVertical.destory(),this.mPolylineVertical=null),N(this.mPoints)&&(this.mPoints.destory(),this.mPoints=null),N(this.mLabel)&&(this.mLabel.destory(),this.mLabel=null),N(this.tooltip)&&(this.tooltip.style.display="none")}onLButtonClick(f){return super.onLButtonClick(f)===!1?!1:(this.tooltip.style.display="none",this.mClickCount>1||this.pickVector(f,XX)&&(this.mClickCount===0?H.clone(XX,this.mFirstVertex):(H.clone(XX,this.mSecondVertex),Mt.fromCartesian(this.mFirstVertex,null,this.mFirstCart),Mt.fromCartesian(this.mSecondVertex,null,this.mSecondCart),this.mHeight=Math.abs(this.mSecondCart.height-this.mFirstCart.height),this.mCallback&&this.mCallback({result:this.mHeight}),this.mEnable=!1),this.mClickCount++),!0)}onMouseMove(f){if(super.onMouseMove(f),this.mClickCount<1&&(this.tooltip.style.left=`${f.x+10}px`,this.tooltip.style.top=`${f.y+20}px`,this.tooltip.style.display="block"),this.mClickCount===1&&(this.tooltip.innerHTML=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${this.mEarthCtrl.language.TOOLS_MEASURE_SLOPE_LEFT_CLICK_STOP}</span>`,this.tooltip.style.left=`${f.x+10}px`,this.tooltip.style.top=`${f.y+20}px`,this.tooltip.style.display="block",this.pickVector(f,XX))){H.clone(XX,this.mSecondVertex),Mt.fromCartesian(this.mFirstVertex,null,this.mFirstCart),Mt.fromCartesian(this.mSecondVertex,null,this.mSecondCart),this.mHeight=Math.abs(this.mSecondCart.height-this.mFirstCart.height),this.mSecondCart.height<this.mFirstCart.height&&(Mt.clone(this.mSecondCart,this.mMidCart),Mt.clone(this.mFirstCart,this.mSecondCart),Mt.clone(this.mMidCart,this.mFirstCart)),this.mMidCart.longitude=this.mFirstCart.longitude,this.mMidCart.latitude=this.mFirstCart.latitude,this.mMidCart.height=this.mSecondCart.height,Mt.toCartesian(this.mFirstCart,null,this.mControlPointArray[0]),Mt.toCartesian(this.mMidCart,null,this.mControlPointArray[1]),Mt.toCartesian(this.mSecondCart,null,this.mControlPointArray[2]);let m=`${this.mEarthCtrl.language.TOOLS_MEASURE_HEIGHT_HEIGHT}`;this.mHeight>=1e3?m+=`${parseInt(this.mHeight)/1e3}${this.mEarthCtrl.language.UNIT_KILOMETER}`:m+=`${parseInt(this.mHeight*1e3)/1e3}${this.mEarthCtrl.language.UNIT_METER}`,this.mHorizontalVerts[0]=this.mControlPointArray[1],this.mHorizontalVerts[1]=this.mControlPointArray[2],this.mVerticalVerts[0]=this.mControlPointArray[0],this.mVerticalVerts[1]=this.mControlPointArray[1],N(this.mPolylineHorizontal)?(this.mLabel.position=this.mControlPointArray[1],this.mLabel.text=m):(this.mPolylineHorizontal=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mHorizontalVerts,color:Re.fromRgba(4286644096),width:3}),this.mPolylineVertical=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mVerticalVerts,color:Re.YELLOW,width:3}),this.mLabel=ec.createLabelPrimitive(this.mEarthCtrl,{position:this.mControlPointArray[1],text:m}))}}},aDe=oDe;var lut=new H(0,0,0),uut=new Mt,cut=new Mt,sDe=class extends ls{constructor(f,m,v){super(f,v,m.enable),this.name="MeasureSlopeTool",this.polylineColor=Z(m.polyline,Re.fromRgba(4286644096)),this._core=new PC(f)}onActive(){this.mClickCount=0,this.mSlope=0,this.mControlPointArray=new Array(2),this.mCoordsArray=[],this.mPolyline=null,this.mPoints=null,this.mLabel=null,this._core.mouse(this.mEarthCtrl.viewer.container,1,`${window.SmartEarthRootUrl}Assets/image/cursor/draw.cur`);let f=document.createElement("div");rp(".map-widget",f),rp(".map-widget",'<div id="toolTipSlope" style="display: none;position: absolute;visibility: visible;max-width: 600px;min-width: 100px;padding: 1px 1px 1px 10px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),this.tooltip=document.getElementById("toolTipSlope"),this.tooltip.innerHTML=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${this.mEarthCtrl.language.TOOLS_MEASURE_SLOPE_LEFT_CLICK_START_LEFT_STOP}</span>`}onDeactive(){this.clearResult(),this.mClickCount=0,this.mLength=0,this.mControlPointArray=null,this.mCoordsArray=null}clearResult(){N(this.mPolyline)&&(this.mPolyline.destory(),this.mPolyline=null),N(this.mPoints)&&(this.mPoints.destory(),this.mPoints=null),N(this.mLabel)&&(this.mLabel.destory(),this.mLabel=null),N(this.tooltip)&&(this.tooltip.style.display="none")}getSlope(f,m){Mt.fromCartesian(f,null,uut),Mt.fromCartesian(m,null,cut);let v=cut.height-uut.height,y=H.distance(f,m);return y===0?0:Math.asin(v/y)/Math.PI*180}onLButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;if(this.tooltip.style.display="none",this.mClickCount>1)return!0;let m=new H(0,0,0);return this.pickVector(f,m)&&(this.mControlPointArray[this.mClickCount]=m,this.mClickCount===1&&(this.mSlope=this.getSlope(this.mControlPointArray[0],this.mControlPointArray[1]),this._core.mouse(this.mEarthCtrl.viewer.container,0,"0"),this.mCallback&&this.mCallback({result:this.mSlope}),this.mEnable=!1),this.mClickCount++),!0}onMouseMove(f){if(super.onMouseMove(f),this.mClickCount<1&&(this.tooltip.style.left=`${f.x+10}px`,this.tooltip.style.top=`${f.y+20}px`,this.tooltip.style.display="block"),this.mClickCount===1&&(this.tooltip.innerHTML=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${this.mEarthCtrl.language.TOOLS_MEASURE_SLOPE_LEFT_CLICK_STOP}</span>`,this.tooltip.style.left=`${f.x+10}px`,this.tooltip.style.top=`${f.y+20}px`,this.tooltip.style.display="block",this.pickVector(f,lut))){this.mControlPointArray[1]=lut,this.mSlope=this.getSlope(this.mControlPointArray[0],this.mControlPointArray[1]);let m=`${this.mEarthCtrl.language.TOOLS_MEASURE_SLOPE_SLOPE}`;m+=`${parseInt(this.mSlope*100)/100}${this.mEarthCtrl.language.UNIT_DEGREE}`,N(this.mPolyline)?(this.mLabel.position=this.mControlPointArray[1],this.mLabel.text=m):(this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mControlPointArray,color:this.polylineColor,width:3}),this.mLabel=ec.createLabelPrimitive(this.mEarthCtrl,{position:this.mControlPointArray[1],text:m}),this.mLabel.entity.label.showBackground=!0,this.mLabel.entity.label.scale=1.2,this.mLabel.entity.label.fillColor=Re.GOLD,this.mLabel.entity.label.font="border 14px \u9ED1\u4F53",this.mLabel.entity.label.style=of.FILL_AND_OUTLINE,this.mLabel.entity.label.backgroundColor=new Re(0,0,0,.7))}}onRButtonClick(f){super.onRButtonClick(f),this._core.mouse(this.mEarthCtrl.viewer.container,0,"0"),this.mEnable=!1,this.tooltip.style.display="none"}},lDe=sDe;var LD=new H(0,0,0),JX=new H(0,0,0);function hut(o,f){for(let m=0;m<o.length;m++){let v=o[m];Mt.fromCartesian(v,null,JX),JX.height=f,Mt.toCartesian(JX,null,v)}}function dut(o){let f=-99999999;for(let m=0;m<o.length;m++)Mt.fromCartesian(o[m],null,JX),f=Math.max(JX.height,f);return f}var uDe=class extends ls{constructor(f,m,v){super(f,v,m.enable),this.polylineColor=Z(m.polyline,Re.fromRgba(4286644096)),this.pointColor=Z(m.point,Re.fromCssColorString("#ff0000")),this.name="HorizontalDistanceTool",this._core=new PC(f)}onActive(){this.mClickCount=0,this.mTotalLength=0,this.mMaxHeight=-99999999,this.mHorizontalControlPointArray=[],this.mControlPointArray=[],this.mFinalVerticalPoints=[],this.mFinalVerticalPoints.push(new H(0,0,0)),this.mFinalVerticalPoints.push(new H(0,0,0)),this.mVerticalPolylines=[],this.mFinalVerticalPoly=null,this.mPolyline=null,this.mHorizontalPoints=null,this.mPoints=null,this.mLabel=null;let f=document.createElement("div");this._core.mouse(this.mEarthCtrl.viewer.container,1,`${window.SmartEarthRootUrl}Assets/image/cursor/draw.cur`),rp(".map-widget",f),rp(".map-widget",'<div id="toolTipHorizontal" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),this.tooltip=document.getElementById("toolTipHorizontal"),this.tooltip.innerHTML=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${this.mEarthCtrl.language.TOOLS_MEASURE_LEFT_START_RIGHT_END}</span>`}onDeactive(){this.clearResult(),this.mClickCount=0,this.mTotalLength=0,this.mMaxHeight=-99999999,this.mHorizontalControlPointArray=null,this.mControlPointArray=null,this.mFinalVerticalPoints=null}clearResult(){for(let f in this.mVerticalPolylines)this.mVerticalPolylines[f].destory();this.mVerticalPolylines=[],N(this.mFinalVerticalPoly)&&(this.mFinalVerticalPoly.destory(),this.mFinalVerticalPoly=null),N(this.mPolyline)&&(this.mPolyline.destory(),this.mPolyline=null),N(this.mHorizontalPoints)&&(this.mHorizontalPoints.destory(),this.mHorizontalPoints=null),N(this.mPoints)&&(this.mPoints.destory(),this.mPoints=null),N(this.mLabel)&&(this.mLabel.destory(),this.mLabel=null),N(this.tooltip)&&(this.tooltip.style.display="none")}onLButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;if(this.pickVector(f,LD)){this.mControlPointArray.length>0&&this.mControlPointArray.pop(),this.mControlPointArray.push(H.clone(LD)),this.mControlPointArray.push(H.clone(LD)),N(this.mPoints)&&this.mPoints.add(H.clone(LD)),this.mHorizontalControlPointArray.length>0&&this.mHorizontalControlPointArray.pop(),this.mHorizontalControlPointArray.push(H.clone(LD)),this.mHorizontalControlPointArray.push(H.clone(LD)),this.mMaxHeight=dut(this.mControlPointArray),hut(this.mHorizontalControlPointArray,this.mMaxHeight),N(this.mHorizontalPoints)&&this.mHorizontalPoints.add(H.clone(this.mHorizontalControlPointArray[this.mHorizontalControlPointArray.length-1]));let m=this.mControlPointArray.length,v=[this.mControlPointArray[m-2],this.mHorizontalControlPointArray[m-2]],y=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:v,color:Re.YELLOW,width:2});this.mVerticalPolylines.push(y),H.clone(this.mControlPointArray[m-1],this.mFinalVerticalPoints[0]),H.clone(this.mHorizontalControlPointArray[m-1],this.mFinalVerticalPoints[1])}return!0}onRButtonDown(f){return super.onRButtonDown(f),this.tooltip.style.display="none",this.mControlPointArray.length>=2&&this.mCallback&&this.mCallback({result:this.mTotalLength}),this.mEnable=!1,this._core.mouse(this.mEarthCtrl.viewer.container,0,"0"),!1}onMouseMove(f){super.onMouseMove(f),this.mClickCount<1&&(this.tooltip.style.left=`${f.x+10}px`,this.tooltip.style.top=`${f.y+20}px`,this.tooltip.style.display="block");let m=this.mControlPointArray.length;if(!(m<=1)&&(this.tooltip.innerHTML=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${this.mEarthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}</span>`,this.tooltip.style.left=`${f.x+10}px`,this.tooltip.style.top=`${f.y+20}px`,this.tooltip.style.display="block",this.pickVector(f,LD))){H.clone(LD,this.mControlPointArray[m-1]),H.clone(LD,this.mHorizontalControlPointArray[m-1]),this.mMaxHeight=dut(this.mControlPointArray),hut(this.mHorizontalControlPointArray,this.mMaxHeight),this.mTotalLength=this.calculateLength(this.mHorizontalControlPointArray,!1);let v=`${this.mEarthCtrl.language.TOOLS_MEASURE_LINE_LENGTH_LENGTH}`;this.mTotalLength>=1e3?v+=`${parseInt(this.mTotalLength)/1e3}${this.mEarthCtrl.language.UNIT_KILOMETER}`:v+=`${parseInt(this.mTotalLength*1e3)/1e3}${this.mEarthCtrl.language.UNIT_METER}`,H.clone(this.mControlPointArray[m-1],this.mFinalVerticalPoints[0]),H.clone(this.mHorizontalControlPointArray[m-1],this.mFinalVerticalPoints[1]),N(this.mPolyline)?(this.mLabel.position=this.mHorizontalControlPointArray[m-1],this.mLabel.text=v):(this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mHorizontalControlPointArray,color:this.polylineColor,width:3}),this.mFinalVerticalPoly=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mFinalVerticalPoints,color:Re.YELLOW,width:2}),this.mLabel=ec.createLabelPrimitive(this.mEarthCtrl,{position:this.mHorizontalControlPointArray[m-1],text:v}),this.mLabel.entity.label.showBackground=!0,this.mLabel.entity.label.scale=1.2,this.mLabel.entity.label.fillColor=Re.GOLD,this.mLabel.entity.label.font="border 14px \u9ED1\u4F53",this.mLabel.entity.label.style=of.FILL_AND_OUTLINE,this.mLabel.entity.label.backgroundColor=new Re(0,0,0,.7))}}},cDe=uDe;var E4=new H(0,0,0),hDe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="MeasureAreaTool"}onActive(){this.mTotalLength=0,this.mControlPointArray=[],this.mPolygonPointArray=[],this.mPolygon=null,this.mPolyline=null,this.mPoints=null,this.mLabel=null}onDeactive(){this.clearResult(),this.mTotalLength=0,this.mControlPointArray=[],this.mPolygonPointArray=[]}clearResult(){N(this.mPolygon)&&(this.mPolygon.destory(),this.mPolygon=null),N(this.mPolyline)&&(this.mPolyline.destory(),this.mPolyline=null),N(this.mPoints)&&(this.mPoints.destory(),this.mPoints=null),N(this.mLabel)&&(this.mLabel.destory(),this.mLabel=null)}onLButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;if(this.pickVector(f,E4)){if(this.mControlPointArray.length>0&&(this.mControlPointArray.pop(),this.mControlPointArray.pop()),this.mControlPointArray.push(H.clone(E4)),this.mControlPointArray.push(H.clone(E4)),this.mControlPointArray.push(H.clone(this.mControlPointArray[0])),this.mPolygonPointArray.push(H.clone(E4)),N(this.mPoints)&&this.mPoints.add(H.clone(E4)),this.mPolygonPointArray.length<3)return;N(this.mPolygon)||(this.mPolygon=ec.createPolygonPrimitive(this.mEarthCtrl,{positions:this.mPolygonPointArray,color:Re.fromRgba(2290155392),outlineColor:Re.WHITE,width:3}))}return!0}onRButtonDown(f){super.onRButtonDown(f),this.mControlPointArray.length>=2&&(this.mCallback&&this.mCallback({result:this.mTotalArea}),this.mEnable=!1)}onMouseMove(f){super.onMouseMove(f);let m=this.mControlPointArray.length;if(!(m<=2)&&this.pickVector(f,E4)){H.clone(E4,this.mControlPointArray[m-2]),this.mTotalArea=this.calculateSphericalArea(this.mControlPointArray,!0);let v=`${this.mEarthCtrl.language.TOOLS_MEASURE_AREA_PROJECTION_AREA}`;this.mTotalArea>=1e5?v+=`${parseInt(this.mTotalArea/1e3)/1e3}${this.mEarthCtrl.language.UNIT_SQUARE_KILOMETER}`:v+=`${parseInt(this.mTotalArea*1e3)/1e3}${this.mEarthCtrl.language.UNIT_SQUARE_METER}`,N(this.mPolyline)?(this.mLabel.position=this.mControlPointArray[m-1],this.mLabel.text=v):(this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mControlPointArray,color:Re.fromRgba(3422617472),width:3}),this.mLabel=ec.createLabelPrimitive(this.mEarthCtrl,{position:this.mControlPointArray[m-1],text:v}))}}},KX=hDe;var fut=new H(0,0,0),dDe=class extends KX{constructor(f,m,v){super(f,m,v),this.name="MeasureSurfaceAreaTool"}onMouseMove(f){super.onMouseMove(f);let m=this.mControlPointArray.length;if(!(m<=2)&&this.pickVector(f,fut)){H.clone(fut,this.mControlPointArray[m-2]),this.mTotalArea=this.calculateSphericalArea(this.mControlPointArray,!0);let v=`${this.mEarthCtrl.language.TOOLS_MEASURE_AREA_PROJECTION_AREA}`;this.mTotalArea>=1e5?v+=`${parseInt(this.mTotalArea/1e3)/1e3}${this.mEarthCtrl.language.UNIT_CUBIC_KILOMETER}`:v+=`${parseInt(this.mTotalArea*1e3)/1e3}${this.mEarthCtrl.language.UNIT_CUBIC_METER}`,N(this.mPolyline)?(this.mLabel.position=this.mControlPointArray[m-1],this.mLabel.text=v):(this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mControlPointArray,color:Re.fromRgba(3422617472),width:3}),this.mLabel=ec.createLabelPrimitive(this.mEarthCtrl,{position:this.mControlPointArray[m-1],text:v}))}}},fDe=dDe;var vb=new H(0,0,0),pDe=new Mt(0,0,0);function put(o,f,m){Mt.fromCartesian(o,null,pDe),pDe.height+=1.5,Mt.toCartesian(pDe,null,m)}var mDe=class extends ls{constructor(f,m,v){super(f,m,v),this.mClickCount=0,this.mTotalLength=0,this.mHorizontalControlPointArray=[],this.mControlPointArray=[],this.mFinalVerticalPoints=[],this.mFinalVerticalPoints.push(new H(0,0,0)),this.mFinalVerticalPoints.push(new H(0,0,0)),this.mMaxHeight=-99999999,this.mTotalLength=0,this.mPoly=null,this.mPoints=null,this.mHorizontalPoints=null,this.mLabel=null,this.mVerticalPolylines=[],this.mFinalVerticalPoly=null}onActive(){}onDeactive(){}destory(){N(this.mPoints)&&this.mPoints.destory(),N(this.mHorizontalPoints)&&this.mHorizontalPoints.destory()}onLButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;if(this.mClickCount>=2)return!0;if(this.pickVector(f,vb)){this.mControlPointArray.length>0&&this.mControlPointArray.pop(),this.mControlPointArray.push(H.clone(vb)),this.mControlPointArray.push(H.clone(vb)),N(this.mPoints)&&this.mPoints.add(H.clone(vb)),this.mHorizontalControlPointArray.length>0&&this.mHorizontalControlPointArray.pop(),put(vb,1.5,vb),this.mHorizontalControlPointArray.push(H.clone(vb)),this.mHorizontalControlPointArray.push(H.clone(vb)),N(this.mHorizontalPoints)&&this.mHorizontalPoints.add(H.clone(this.mHorizontalControlPointArray[this.mHorizontalControlPointArray.length-1]));let m=this.mControlPointArray.length;H.clone(this.mControlPointArray[m-1],this.mFinalVerticalPoints[0]),H.clone(this.mHorizontalControlPointArray[m-1],this.mFinalVerticalPoints[1]);let v=this;this.mClickCount===1&&this.mEarthCtrl.measure.lineOfSightByParams({startPoint:this.mHorizontalControlPointArray[0],endPoint:this.mHorizontalControlPointArray[2]},function(y){y.ret===!0&&(v.mHorizontalControlPointArray[m-2]=y.position,v.mHorizontalControlPointArray[m-1]=y.position),v.mCallback&&v.mCallback(y),v.mEnable=!1}),this.mClickCount++}return!0}onRender(){}onMouseMove(f){super.onMouseMove(f);let m=this.mControlPointArray.length;m<=1||this.pickVector(f,vb)&&(H.clone(vb,this.mControlPointArray[m-1]),put(vb,1.5,vb),H.clone(vb,this.mHorizontalControlPointArray[m-1]),H.clone(this.mControlPointArray[m-1],this.mFinalVerticalPoints[0]),H.clone(this.mHorizontalControlPointArray[m-1],this.mFinalVerticalPoints[1]))}},mut=mDe;var gDe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="PickObjectTool"}destory(){}onLButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;let m={};return this.pickObject(f,m)&&this.mCallback&&this.mCallback(m),!0}},_De=gDe;var vDe=class extends ls{constructor(f,m,v,y){super(m,v,y),this.name="PickPositionTool",this.options=f}onLButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;let m=new H(0,0,0);if(this.pickVector(f,m)){let v;!this.options||!this.options.type||this.options==="LongitudeAndLatitude"?(v=Mt.fromCartesian(m),v.longitude=xe.toDegrees(v.longitude),v.latitude=xe.toDegrees(v.latitude),this.mCallback&&this.mCallback({result:v})):this.options.type==="Cartographic"?(v=Mt.fromCartesian(m),this.mCallback&&this.mCallback({result:v})):this.options.type==="Cartesian2"?(v=f,this.mCallback&&this.mCallback({result:v})):this.options.type==="Cartesian3"&&(v=this.pickVector(f,m),this.mCallback&&this.mCallback({result:v}))}return!0}onRButtonUp(f){return super.onLButtonUp(f)===!1?!1:(this.mCallback&&this.mCallback({retCode:"finished"}),!0)}},yDe=vDe;var xDe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="HoverObjectTool"}destory(){}onMouseMove(f){if(super.onLButtonUp(f)===!1)return!1;let m={};return this.pickObject(f,m)&&this.mCallback&&this.mCallback(m),!0}},CDe=xDe;var bDe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="DoubleClickObjectTool"}destory(){}onRButtonDown(f){if(super.onLButtonUp(f)===!1)return!1;let m={};return this.doubleClickObject(f,m)&&this.mCallback&&this.mCallback(m),!0}},wDe=bDe;var ADe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="RClickObjectTool"}destory(){}onRButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;let m={};return this.pickObject(f,m)&&this.mCallback&&this.mCallback(m),!0}},EDe=ADe;var p8=null;function tc(o,f){p8=f,this.objId=Number(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0)),this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._getPosition=new Ru(this._viewer,this._cesium),this._tree=Ne,this.modifyPoint=null,this._color=new no(this._viewer,this._cesium),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._position=void 0,this._points=[],this._listeners={},this._point=null}tc.prototype.createPoint=function(o,f,m,v,y,x){var C={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.RED,clampToGround:!0};v||(v={}),C=this._core.extend(C,v,!0),m&&(this._core.isHtmlColor(m)?m=this._color.colorFromHtmlColor(m):(/^rgb/.test(m)&&(m=this._Color.rgbaStringToRgbaObj(m)),m.r>1&&(m.r=m.r/255),m.g>1&&(m.g=m.g/255),m.b>1&&(m.b=m.b/255),m.a>1&&(m.a=m.a/255),m.r&&(m=this._color.createColor(m.r,m.g,m.b,m.a))),C.color=m),this._position=f,this.item=this._viewer.entities.add({name:o,position:this._cesium.Cartesian3.fromDegrees(f[0],f[1],f[2]||0),point:C});var w={id:this.item.id,name:o,pId:this._core.isnull(y)?0:y,type:"Point",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,this._core.isnull(y)?0:y),this};tc.prototype.getstyles=function(){var o={};return o.show=this.item.point.show?this.item.point.show._value:!0,o.pixelSize=this.item.point.pixelSize?this.item.point.pixelSize.toString():null,o.heightReference=this.item.point.heightReference&&this.item.point.heightReference._value?this.item.point.heightReference.toString():null,o.color=this.item.point.color&&this.item.point.color._value?"rgba"+this.item.point.color.toString():null,o.outlineColor=this.item.point.outlineColor&&this.item.point.outlineColor._value?"rgba"+this.item.point.outlineColor.toString():null,o.outlineWidth=this.item.point.outlineWidth&&this.item.point.outlineWidth._value?this.item.point.outlineWidth.toString():null,o.near=this.item.point.distanceDisplayCondition?this.item.point.distanceDisplayCondition._value.near:null,o.far=this.item.point.distanceDisplayCondition?this.item.point.distanceDisplayCondition._value.far:null,o.position=this.item.position.getValue().toString(),o};tc.prototype.createLonlat=function(o){var f=this,m=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);m.setInputAction(function(v){var y=f._viewer.camera.pickEllipsoid(v.position,f._viewer.scene.globe.ellipsoid),x=f._cesium.Cartographic.fromCartesian(y,f._viewer.scene.globe.ellipsoid,new f._cesium.Cartographic),C=f._cesium.Math.toDegrees(x.latitude),w=f._cesium.Math.toDegrees(x.longitude),A=x.height,E={lng:w,lat:C,height:A};typeof o=="function"&&o(E)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(v){m.destroy()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK)};tc.prototype.createRichTextPoint=function(o,f,m={}){var v=this,y=this._core.getuid(),x=m.GroupID,C;f.length!==void 0?f.length===2?C=this._cesium.Cartesian3.fromDegrees(f[0],f[1]):f.length===3&&(C=this._cesium.Cartesian3.fromDegrees(f[0],f[1],f[2])):f.z?C=this._cesium.Cartesian3.fromDegrees(f.x,f.y,f.z):C=this._cesium.Cartesian3.fromDegrees(f.x,f.y),this._position=C;var w={horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,show:!0,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(v._core.defaultValue(m.near,0),v._core.defaultValue(m.far,Number.MAX_VALUE))},A=this._core.extend(w,m,!0),E="",T=15;m&&m.fontColor&&(E=m.fontColor),m&&m.fontSize&&(T=m.fontSize),M(o,T,E,function(I){A.image=I,v.item=v._viewer.entities.add({id:y,name:o,position:v._position,billboard:A}),v.item.degrees=f,v.item.type="RichPoint",v.item.data=m.data});var S={id:y,name:"\u65B0\u5EFA\u5BCC\u6587\u672C\u70B9"+y,pId:v._core.isnull(x)?0:x,type:"Imagelabel",item:v};v.setTreeobj(S),v._tree.insertGroupId(S,v._core.isnull(x)?0:x);function M(I,P,D,L){var R=document.createElement("img");R.src=v._core.defaultValue(A.url,window.SmartEarthRootUrl+pn.richtextpoint),P=parseFloat(P),R.crossOrigin="Anonymous",R.onload=function(){var O=document.createElement("canvas"),F=O.getContext("2d"),k=R.width,U=R.height;if(O.width=k,O.height=U,F.drawImage(R,0,0,k,U),F.shadowOffsetX=1,F.shadowOffsetY=0,F.shadowColor="#fff",F.shadowBlur=1,/^\</.test(I)&&/\>$/.test(I)){var G='<svg xmlns="http://www.w3.org/2000/svg" width="'+k+'" height="60"><foreignObject width="100%" height="100%">'+I+"</foreignObject></svg>",j=window.URL||window.webkitURL||window,q=document.createElement("img"),J=new Blob([G],{type:"image/svg+xml;charset=utf-8"}),X=j.createObjectURL(J);q.crossOrigin="Anonymous",q.src=X,q.onload=function(){F.drawImage(q,0,0,q.width,q.height),j.revokeObjectURL(X)},L(O)}else{if(F.fillStyle=D||"#fff",F.font=P+"px Calibri,sans-serif",I.length*P>k){var Y=I.substring(0,Math.ceil(I.length/2)),Q=I.substring(Math.floor(I.length/2),I.length),ee=(U-100-2*P)/2,z=ee+P,ie=(k-Y.length*P)/2;F.fillText(Y,ie,ee),F.fillText(Q,ie,z)}else{var re=(U-100-P)/2,ne=(k-I.length*P)/2;F.fillText(I,ne,re)}L(O)}}}return this};tc.prototype.createPoints=function(o,f){var m={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.RED,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},v=this._core.extend(m,o,!0);this._core.isnull(text)||(v.text=text),this._position=position,this.item=this._viewer.entities.add({name,position:this._cesium.Cartesian3.fromDegrees(position[0],position[1]),point:v});var y={id:this.item.id,name:v.text,pId:this._core.isnull(f)?0:f,type:"Point",item:this};return this.setTreeobj(y),this._tree.insertGroupId(y,this._core.isnull(f)?0:f),this};tc.prototype.createLocations=function(o,f,m){var v={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND};this._position=f,this._core.isnull(o)&&(o="\u65B0\u5EFA\u5174\u8DA3\u70B9"),this.item=this._viewer.entities.add({name:o,position:this._cesium.Cartesian3.fromDegrees(f[0],f[1],f[2]),point:v});var y={id:v.id,name:o,pId:this._core.isnull(m)?0:m,type:"Location",item:this};return this.setTreeobj(y),this._tree.insertGroupId(y,this._core.isnull(m)?0:m),this};tc.prototype.createLocation=function(o,f,m){var v={id:this._core.getuid(),show:!0,pixelSize:10,color:this._cesium.Color.TRANSPARENT,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND},y={destination:f.position,orientation:{heading:f.orientation.heading,pitch:f.orientation.pitch,roll:f.orientation.roll}};this._position=f,this._core.isnull(o)&&(o="\u65B0\u5EFA\u5174\u8DA3\u70B9");var x=this._core.getuid();this.item=this._viewer.entities.add({name:o,position:f.position,point:v}),this.item.originalCameraLocation=y;var C=this;return setTimeout(function(){var w={id:x,name:o+x,pId:C._core.isnull(m)?0:m,type:"Location",item:C};C.setTreeobj(w),C._tree.insertGroupId(w,C._core.isnull(m)?0:m)}),this};tc.prototype.createPointOptimization=function(o,f){var m=this,v,y=[],x=this._core.StyleContrastGeoJson(o,this._cesium);return this.handler.setInputAction(function(C){var w=m._viewer.scene.camera.getPickRay(C.position),A,E;if(w&&(A=m._viewer.scene.globe.pick(w,m._viewer.scene)),!!A){E=m._cesium.Ellipsoid.WGS84.cartesianToCartographic(A);var T=m._viewer.scene.globe.getHeight(E);m._point=m._cesium.Cartesian3.fromDegrees(E.longitude/Math.PI*180,E.latitude/Math.PI*180,T),x.position=new m._cesium.CallbackProperty(function(){return m._point},!1),m.objId=Number(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0));var S=m._viewer.entities.add(x);S.objId=m.objId,S.obj=m;var M={point:S};y.push(M),m.state=1,m.handler.destroy(),typeof method=="function"&&method(y),m.item=S}},m._cesium.ScreenSpaceEventType.LEFT_CLICK),this};tc.prototype.startModify=function(){var o="\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";if(!(this.state!=2&&this.state!=1)){this._tree.starttemporaryItem(this._viewer),this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this.viewer.scene.canvas));var f=this;this.modifyHandler.setInputAction(function(m){var v=f._viewer.scene.pick(m.position);f._cesium.defined(v)&&v.id&&f._cesium.defined(v)&&v.id&&v.id.objId&&v.id.objId==f.objId&&(f.modifyPoint=v.id,o="\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539",f.forbidDrawWorld(!0)),f.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(m){var v=f._viewer.scene.pick(m.endPosition);if(f._core.CreateTooltip(o,m.endPosition,!1),!f.modifyPoint){f._cesium.defined(v)&&v.id&&v.id.objId&&f._core.CreateTooltip("\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E",m.endPosition,!0);return}if(!!f.modifyPoint){var y=f.getCatesian3FromPX(m.endPosition,f._viewer,[f.modifyPoint]);y&&(f._point=y,f.modifyPoint.position=y),f._core.CreateTooltip(o,m.endPosition,!0)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(m){var v=f.getCatesian3FromPX(m.position,f._viewer,[f.modifyPoint]);!f.modifyPoint||(v&&(f._point=v),f.modifyPoint.position=v,f.modifyPoint=null,f.forbidDrawWorld(!1),o="\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E")},this._cesium.ScreenSpaceEventType.LEFT_UP)}};tc.prototype.getCatesian3FromPX=function(o,f,m){var v=f.scene.pick(o),y,x=f.scene.drillPick(o),C=null;if(m.length>0){for(var w=0;w<x.length;w++)if(x[w].id._id!=m[0].id&&x[w].id._id!=m[1].id){C=x[w].id;break}}else C=v;if(f.scene.pickPositionSupported&&this._cesium.defined(C))y=f.scene.pickPosition(o);else{var A=f.camera.getPickRay(o);if(!A)return;y=f.scene.globe.pick(A,f.scene)}return y};tc.prototype.forbidDrawWorld=function(o){this._viewer.scene.screenSpaceCameraController.enableRotate=!o,this._viewer.scene.screenSpaceCameraController.enableTilt=!o,this._viewer.scene.screenSpaceCameraController.enableTranslate=!o,this._viewer.scene.screenSpaceCameraController.enableInputs=!o};tc.prototype.executePoint=function(o,f){let m;(typeof o=="object"||typeof f=="function")&&(m=f,f=o,o=m),m=null,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var v=this;this._tree.starttemporaryItem(this._viewer);var y=[],x={point:v._cesium.Color.RED};Object.keys(f).length>0&&f.point!=""&&f.point!=null&&(x.point=f.point),this._tree.removeHandler();let C=this._core.CreateTooltip();return this._tree.handler=new v._cesium.ScreenSpaceEventHandler(v._viewer.scene.canvas),this._tree.handler.setInputAction(function(w){var A=v._getPosition.getMousePosition(w),E=v._core.toDegrees(A),T;E.height>=1e3?T=(E.height/1e3).toFixed(2)+"\u5343\u7C73":T=E.height.toFixed(2)+"\u7C73";let S=v._core.getPointToCameraDistance(v._viewer,A);var M=v._viewer.entities.add({name:"\u9AD8\u5EA6",position:A,point:{color:x.point.withAlpha(.5),pixelSize:5,outlineColor:v._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:v._cesium.HeightReference.none,distanceDisplayCondition:new p8.DistanceDisplayCondition(0,S*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:"\u6D77\u62D4\u9AD8\u5EA6\uFF1A"+T,font:"16px \u5B8B\u4F53",fillColor:p8.Color.GOLD,verticalOrigin:p8.VerticalOrigin.BOTTOM,pixelOffset:new p8.Cartesian2(20,-20),showBackground:!0,distanceDisplayCondition:new p8.DistanceDisplayCondition(0,S*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY}});v._tree.temporaryItem.obj.push(M);var I={point:M,height:T};y.push(I),v._tree.endtemporaryItem(),v._core.mouse(v._viewer.container,0,"0"),v._tree.handler.destroy(),C.show(!1),typeof o=="function"&&o(I),v.item=M},v._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(w){C.showAt(w.endPosition,"\u70B9\u51FB\u62FE\u53D6\u9AD8\u5EA6\uFF01")},v._cesium.ScreenSpaceEventType.MOUSE_MOVE),this};tc.prototype.altitude=tc.prototype.executePoint;tc.prototype.executePointp=function(o,f){this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var m=this,v;this._tree.starttemporaryItem(this._viewer);var y=[],x={point:m._cesium.Color.RED};return Object.keys(f).length>0&&f.point!=""&&f.point!=null&&(x.point=f.point),this._tree.removeHandler(),this._tree.handler=new m._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas),this._tree.handler.setInputAction(function(C){var w=m._getPosition.getMousePosition(C);if(!!w){var A=m._viewer.entities.add({name:"\u9AD8\u5EA6",position:w,point:{color:x.point.withAlpha(.5),pixelSize:5,outlineColor:m._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:m._cesium.HeightReference.none}});m._tree.temporaryItem.obj.push(A),m._tree.endtemporaryItem(),m._core.mouse(m._viewer.container,0,"0"),m._tree.handler.destroy(),typeof o=="function"&&o(A),m.item=A}},m._cesium.ScreenSpaceEventType.LEFT_CLICK),this};tc.prototype.deleteObject=function(){try{if(this._viewer.entities.remove(this.item),this._points.length>0)for(var o=0;o<this._points.length;o++)this._viewer.entities.remove(this._points[o])}catch{}};tc.prototype.setVisibility=function(o){if(this._points.length>0)for(var f=0;f<this._points.length;f++)this._points[f].show=o;this.item.show=o};tc.prototype.getVisibility=function(){return this.item.show};tc.prototype.setPointAlpha=function(o){try{this.item._point.material._value.alpha=o}catch(f){console.log(f)}return this};tc.prototype.export=function(){var o=this.item.point.show==null?void 0:this.item.point.show._value,f=this.item.point.pixelSize==null?void 0:this.item.point.pixelSize._value,m=this.item.point.color==null?void 0:"rgba("+this.item.point.color._value.red+","+this.item.point.color._value.green+","+this.item.point.color._value.blue+","+this.item.point.color._value.alpha+")",v=this.item.point.outlineColor==null?void 0:"rgba("+this.item.point.outlineColor._value.red+","+this.item.point.outlineColor._value.green+","+this.item.point.outlineColor._value.blue+","+this.item.point.outlineColor._value.alpha+")",y=this.item.point.outlineWidth==null?void 0:this.item.point.outlineWidth._value,x=this.item.point.distanceDisplayCondition,C=x?._value.near,w=x?._value.far,A=this._cesium.Cartographic.fromCartesian(this.item.position._value),E=this._cesium.Math.toDegrees(A.longitude),T=this._cesium.Math.toDegrees(A.latitude),S=this._cesium.Math.toDegrees(A.height);return{type:"point",position:{x:E,y:T,z:S},treeobj:{name:this.treeobj.name},style:{show:o,pixelSize:f,color:m,outlineColor:v,outlineWidth:y,near:C,far:w}}};tc.prototype.setTreeobj=function(o){this.treeobj=o};tc.prototype.setPointColor=function(o){try{this.item._point.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o),this.item.fillColor=this.item._point.color}catch(f){console.log(f)}return this};tc.prototype.setRadius=function(o){try{this.item.ellipse=new this._cesium.EllipseGraphics({semiMinorAxis:o,semiMajorAxis:o,material:this._cesium.Color.RED.withAlpha(.4)})}catch(f){console.log(f)}return this};tc.prototype.setOutlineColor=function(o){try{this.item._point.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};Object.defineProperties(tc.prototype,{HighLight:{set:function(o){o&&(this.item.fillColor=this.item.point._color),o?this.item._point.color=new no(this._viewer,this._cesium).colorFromHtmlColor(this._core.selectedColor):this.item.point._color=this.item.fillColor}}});Object.defineProperties(tc.prototype,{pointColor:{get:function(){if(!!this.item.point._color._value)return this._color.toHtmlColor("rgb("+this.item.point._color._value.red*255+","+this.item.point._color._value.green*255+","+this.item.point._color._value.blue*255+","+this.item.point._color._value.alpha*255+")")},set:function(o){try{/^rgb/.test(o)?(o=this._color.rgbaStringToRgbaObj(o),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a),this.item._point.color=o,this.item.fillColor=this.item._point.color):(this.item._point.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o),this.item.fillColor=this.item._point.color)}catch{}}},pointOutlineColor:{get:function(){if(this.item._point._outlineColor!=null)return this._color.toHtmlColor("rgb("+this.item._point.outlineColor._value.red*255+","+this.item._point.outlineColor._value.green*255+","+this.item._point.outlineColor._value.blue*255+","+this.item._point.outlineColor._value.alpha*255+")")},set:function(o){try{/^rgb/.test(o)?(o=this._color.rgbaStringToRgbaObj(o),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a),this.item._point.outlineColor=o):this.item._point.outlineColor=this._color.colorFromHtmlColor(o)}catch(f){console.log(f)}}},pointOutlineWidth:{get:function(){if(this.item.point.outlineWidth!=null)return this.item.point.outlineWidth._value},set:function(o){this.item.point.outlineWidth=o}},pointAlpha:{get:function(){if(this.item._point._color!=null)return this.item._point._color._value.alpha},set:function(o){this.item._point._color._value.alpha=o}},pointOutlineAlpha:{get:function(){if(this.item._point.outlineColor!=null)return this.item._point.outlineColor._value.alpha},set:function(o){try{this.item._point.outlineColor._value.alpha=o}catch{}}},pointHeight:{set:function(o){o=parseFloat(o);var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Cartesian3.fromDegrees(m,v,o);this.item.position._value=y},get:function(){var o=this._cesium.Cartographic.fromCartesian(this.item.position._value),f=this._cesium.Math.toDegrees(o.height);return f}},pointX:{set:function(o){var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Math.toDegrees(f.height),x=this._cesium.Cartesian3.fromDegrees(o,v,y);this.item.position.position=x},get:function(){var o=this._cesium.Cartographic.fromCartesian(this.item.position._value),f=this._cesium.Math.toDegrees(o.longitude);return f}},pointY:{set:function(o){var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Math.toDegrees(f.height),x=this._cesium.Cartesian3.fromDegrees(m,o,y);this.item.position.position=x},get:function(){var o=this._cesium.Cartographic.fromCartesian(this.item.position._value),f=this._cesium.Math.toDegrees(o.latitude);return f}}});Object.defineProperties(tc.prototype,{pixelSize:{get:function(){return this.item.point.pixelSize._value},set:function(o){this.item.point.pixelSize=o}}});Object.defineProperties(tc.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(o){this.item.rectangle=o}}});tc.prototype.setItem=function(o){this.item=o};Object.defineProperties(tc.prototype,{polyline:{get:function(){return this.item.polyline},set:function(o){this.item.polyline=o}}});Object.defineProperties(tc.prototype,{polygon:{get:function(){return this.item.polygon},set:function(o){this.item.polygon=o}}});Object.defineProperties(tc.prototype,{point:{get:function(){return this.item.point},set:function(o){this.item.point=o}}});Object.defineProperties(tc.prototype,{label:{get:function(){return this.item.label},set:function(o){this.item.label=o}}});Object.defineProperties(tc.prototype,{position:{get:function(){return this._position?this._position:this.item.position}}});Object.defineProperties(tc.prototype,{model:{get:function(){return this.item.model},set:function(o){this.item.model=o}}});Object.defineProperties(tc.prototype,{wall:{get:function(){return this.item.wall},set:function(o){this.item.wall=o}}});Object.defineProperties(tc.prototype,{pointTempOptions:{get:function(){return{color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:no.BLACK,outlineWidth:0,show:!0,scaleByDistance:null,translucencyByDistance:null,heightReference:null,distanceDisplayCondition:null,disableDepthTestDistance:null}}}});var yb=tc;var $r=null;function cl(o,f){$r=f,this._viewer=o,this._cesium=f,this._Color=new no(this._viewer,this._cesium),this._core=new Sr(o,f),this._getPosition=new Ru(this._viewer,this._cesium),this._tree=Ne,this._points=[],this._lable=null,this._entity=null,this.polygon1,this.id="0",this.curCanvas="a",this._lang={draw_tip_left:"\u5DE6\u952E\u5F00\u59CB\u7ED8\u5236\uFF01",draw_tip_right:"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236\uFF01",draw_tip_click:"\u70B9\u51FB\u7EE7\u7EED\u7ED8\u5236\uFF01",draw_tip_cancel:"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88\uFF01",unit_m:"\u7C73",unit_km:"\u5343\u7C73"}}cl.prototype.createPolygon=function(o,f,m,v,y){var x=[],C;if(Array.isArray(o)){if(o[0]instanceof Array){if(o[0].length===2){for(var w=0;w<o.length;w++)x.push(o[w][0],o[w][1]);C=this._cesium.Cartesian3.fromDegreesArray(x)}else if(o[0].length===3){for(var w=0;w<o.length;w++)x.push(o[w][0],o[w][1],o[w][2]);C=this._cesium.Cartesian3.fromDegreesArrayHeights(x)}}else if(o[0].z){for(var w=0;w<o.length;w++)x.push(o[w].x,o[w].y,o[w].z);C=this._cesium.Cartesian3.fromDegreesArrayHeights(x)}else{for(var w=0;w<o.length;w++)x.push(o[w].x,o[w].y);C=this._cesium.Cartesian3.fromDegreesArray(x)}var A=f;typeof A=="string"&&(A={fillColor:A}),this.item=this._viewer.entities.add({name:y,polygon:{hierarchy:new this._cesium.PolygonHierarchy(C),material:new no(this._viewer,this._cesium).colorFromHtmlColor(A.fillColor),heightReference:this._core.defaultValue(m,1),perPositionHeight:m!==1,outline:!0,outlineWidth:this._core.defaultValue(A.outlineWidth,1),outlineColor:new no(this._viewer,this._cesium).colorFromHtmlColor(this._core.defaultValue(A.outlineColor,A.fillColor))}})}else if(typeof o=="object"){o.points.forEach(S=>{x.push(S.x,S.y)}),C=$r.Cartesian3.fromDegreesArray(x);let T=this._core.defaultValue(o.alpha,.6);this.item=this._viewer.entities.add({id:o.id,name:y,polygon:{hierarchy:new $r.PolygonHierarchy(C),material:$r.Color.fromCssColorString(o.color||"#f00").withAlpha(T),heightReference:o.height!==void 0?0:1,height:o.height,perPositionHeight:!1,outline:!!o.outlineWidth,outlineWidth:o.outlineWidth,outlineColor:$r.Color.fromCssColorString(o.outlineColor||"#f00")}}),this.item.objectType="polygon"}var E={id:this.item.id,name:y||"\u65B0\u5EFA\u9762"+this._core.getuid(),pId:this._core.isnull(v)?0:v,type:"polygon",item:this};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};cl.prototype.getstyles=function(){var o={};return o.show=this.item.polygon.show?this.item.polygon.show._value:!0,o.hierarchy=this.item.polygon.hierarchy?this.item.polygon.hierarchy.getValue().positions.toString():null,o.height=this.item.polygon.height?this.item.polygon.height._value:null,o.heightReference=this.item.polygon.heightReference?this.item.polygon.heightReference._value:null,o.extrudedHeight=this.item.polygon.extrudedHeight?this.item.polygon.extrudedHeight.getValue():null,o.extrudedHeightReference=this.item.polygon.extrudedHeightReference?this.item.polygon.extrudedHeightReference.toString():null,o.stRotation=this.item.polygon.stRotation?this.item.polygon.stRotation._value:null,o.granularity=this.item.polygon.granularity?this.item.polygon.granularity._value:null,o.fill=this.item.polygon.fill?this.item.polygon.fill._value:null,o.material={},o.material.color=this.item.polygon.material&&this.item.polygon.material.color&&this.item.polygon.material.color._value?"rgba"+this.item.polygon.material.color.toString():null,o.material.image=this.item.polygon.material&&this.item.polygon.material.image?this.item.polygon.material.image._value:null,o.material.repeat=this.item.polygon.material&&this.item.polygon.material.repeat&&this.item.polygon.material.repeat._value?this.item.polygon.material.repeat._value:null,o.outline=this.item.polygon.outline?this.item.polygon.outline._value:null,o.outlineWidth=this.item.polygon.outlineWidth?this.item.polygon.outlineWidth._value:null,o.outlineColor=this.item.polygon.outlineColor&&this.item.polygon.outlineColor._value?"rgba"+this.item.polygon.outlineColor.toString():null,o.perPositionHeight=this.item.polygon.perPositionHeight?this.item.polygon.perPositionHeight.toString():null,o.closeTop=this.item.polygon.closeTop?this.item.polygon.closeTop.toString():null,o.closeBottom=this.item.polygon.closeBottom?this.item.polygon.closeBottom.toString():null,o.arcType=this.item.polygon.arcType?this.item.polygon.arcType.toString():null,o.classificationType=this.item.polygon.classificationType?this.item.polygon.classificationType.toString():null,o.near=this.item.polygon.distanceDisplayCondition?this.item.polygon.distanceDisplayCondition._value.near:null,o.far=this.item.polygon.distanceDisplayCondition?this.item.polygon.distanceDisplayCondition._value.far:null,o};cl.prototype.createCloudMap=function(o,f,m,v){var y=[],x=this;y.push(f.minx,f.miny),y.push(f.maxx,f.miny),y.push(f.maxx,f.maxy),y.push(f.minx,f.maxy);var C=this._cesium.Cartesian3.fromDegreesArray(y);v=this._core.defaultValue(v,1);var w=0,A=0;this.item=this._viewer.entities.add({name:o,polygon:{hierarchy:new this._cesium.PolygonHierarchy(C),material:new $r.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return A+=v,A>30&&(A=0,w++,w>m.length-1&&(w=0)),m[w]},!1),color:new this._cesium.CallbackProperty(function(){return x._cesium.Color.WHITE.withAlpha(A<15?.5+A/30:1.5-A/30)},!1),repeat:new x._cesium.Cartesian2(1,1)})}});var E={id:this.item.id,name:o,pId:0,type:"polygon",item:this};return this.setTreeobj(E),this._tree.insertGroupId(E,0),this};cl.prototype.createSector=function(o,f,m,v,y){var x={fillColor:this._cesium.Color.YELLOW.withAlpha(.5),outlineColor:this._cesium.Color.YELLOW},C=[],w=2*Math.PI/360*y,A=Math.sin(w)*f,E=Math.cos(w)*f,T=J(o,v,E),S={lon:o.lon,lat:o.lat,height:o.height},M={lon:T.lon,lat:T.lat,height:o.height+A},I=6378137,P=6356725,D=this;C=G(S,M);var L=document.createElement("canvas");L.id="0-a",L.width=800,L.height=800,document.body.appendChild(L);var R=document.createElement("canvas");R.id="0-b",R.width=800,R.height=800;var O="a";document.body.appendChild(R);var F=1,k=new $r.CallbackProperty(function(X,Y){var Q=document.getElementById("0-"+O),ee=Q.getContext("2d");ee.strokeStyle="red",ee.lineWidth=15;function z(oe,se,ae){ee.beginPath(),ee.arc(400,800,ae,re(oe),re(se),!1),ee.stroke()}function ie(oe,se,ae){ee.beginPath(),ee.arc(400,800,ae,re(oe),re(se),!1),ee.stroke()}function re(oe){return oe-=90,oe*Math.PI/180}ee.clearRect(0,0,800,800);var ne=ee.createLinearGradient(0,800,0,0);return ne.addColorStop(0,"rgba(255,0,0,0.6)"),ne.addColorStop(1,"rgba(255,0,0,0)"),ie(-(m/2),m/2,F+600),ee.lineTo(400,800),ee.closePath(),ee.fillStyle=ne,ee.fill(),z(-(m/2),m/2,F+100),z(-(m/2),m/2,F+200),z(-(m/2),m/2,F+300),z(-(m/2),m/2,F+400),z(-(m/2),m/2,F+500),z(-(m/2),m/2,F+600),F<100?F=F+1:F=1,O=O==="a"?"b":"a",Q},!1);this.item=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.PolygonHierarchy(this._cesium.Cartesian3.fromDegreesArrayHeights(C)),material:new this._cesium.ImageMaterialProperty({image:k,transparent:!0}),perPositionHeight:!0,outlineColor:x.outlineColor}});function U(X,Y,Q,ee){var z=Q*Math.sin(ee*Math.PI/180),ie=Q*Math.cos(ee*Math.PI/180),re=P+(I-P)*(90-X)/90,ne=re*Math.cos(X*Math.PI/180),oe=(z/ne+Y*Math.PI/180)*180/Math.PI,se=(ie/re+X*Math.PI/180)*180/Math.PI;return[oe,se]}function G(X,Y){var Q=[],ee=j(X.lat,X.lon,Y.lat,Y.lon),z=ee.anglew,ie=ee.distance;Q.push(X.lon,X.lat,X.height);for(var re=z-m/2,ne=null;re<z+m/2;re++)ne=U(X.lat,X.lon,ie,re),Q.push(ne[0],ne[1],Y.height+re*10);return Q}function j(X,Y,Q,ee){var z=q(X),ie=q(Q),re=q(Q)-q(X),ne=q(ee)-q(Y),oe=2*Math.asin(Math.sqrt(Math.pow(Math.sin(re/2),2)+Math.cos(z)*Math.cos(ie)*Math.pow(Math.sin(ne/2),2)));return oe=oe*I,oe=Math.round(oe*1e4)/1e4,{anglew:D._core.TwoPointAzimuth(Y,X,ee,Q),distance:oe}}function q(X){return X*Math.PI/180}function J(X,Y,Q){var ee={a:6378137,b:63567523142e-4,f:.0033528106647474805};function z(ei){return ei*Math.PI/180}function ie(ei){return ei*180/Math.PI}for(var re=ee,ne=re.a,oe=re.b,se=re.f,ae=X.lon*1,fe=X.lat*1,de=Q,ve=z(Y),pe=Math.sin(ve),ce=Math.cos(ve),he=(1-se)*Math.tan(z(fe)),Ce=1/Math.sqrt(1+he*he),Se=he*Ce,De=Math.atan2(he,ce),Oe=Ce*pe,Ue=1-Oe*Oe,Xe=Ue*(ne*ne-oe*oe)/(oe*oe),it=1+Xe/16384*(4096+Xe*(-768+Xe*(320-175*Xe))),ut=Xe/1024*(256+Xe*(-128+Xe*(74-47*Xe))),at=de/(oe*it),Pt=2*Math.PI;Math.abs(at-Pt)>1e-12;){var Qe=Math.cos(2*De+at),ft=Math.sin(at),Ot=Math.cos(at),Xt=ut*ft*(Qe+ut/4*(Ot*(-1+2*Qe*Qe)-ut/6*Qe*(-3+4*ft*ft)*(-3+4*Qe*Qe)));Pt=at,at=de/(oe*it)+Xt}var At=Se*ft-Ce*Ot*ce,bt=Math.atan2(Se*Ot+Ce*ft*ce,(1-se)*Math.sqrt(Oe*Oe+At*At)),gt=Math.atan2(ft*pe,Ce*Ot-Se*ft*ce),It=se/16*Ue*(4+se*(4-3*Ue)),Jt=gt-(1-It)*se*Oe*(at+It*ft*(Qe+It*Ot*(-1+2*Qe*Qe))),bi=Math.atan2(Oe,-At),Yi=ae*1+ie(Jt),ii={lon:Yi,lat:ie(bt)};return ii}return this};cl.prototype.setImageMaterialProperty=function(){var o=this,f=document.createElement("canvas");f.id="0-a",f.width=700,f.height=100;var m=document.createElement("canvas");m.id="0-b",m.width=700,m.height=100,document.body.appendChild(f),document.body.appendChild(m);var v=new o._cesium.CallbackProperty(function(y,x){var C=o,w=document.getElementById("0-"+o.curCanvas),A=w.getContext("2d");return w.strokeStyle="1px solid red",A.strokeStyle="red",A.fillStyle="red",A.save(),A.translate(100,100),A.arc(0,0,100,0,180*Math.PI/180),A.restore(),A.stroke(),o.curCanvas=o.curCanvas==="a"?"b":"a",w},!1);return new o._cesium.ImageMaterialProperty({image:v,transparent:!0})};cl.prototype.executeSector=function(o,f){var m=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var v=this._viewer,y=0,x,C,w={fillColor:m._cesium.Color.YELLOW.withAlpha(.5),outlineColor:m._cesium.Color.YELLOW};f&&f.fillColor&&(w.fillColor=f.fillColor),f&&f.outlineColor&&(w.outlineColor=f.outlineColor),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var A=[],E=this._core.CreateTooltip();this.item=void 0;var T,S;this.end=O=>{if(m._tree.handler.destroy(),m._tree.handler=null,E.show(!1),m._core.mouse(m._viewer.container,0,"0"),this.end=void 0,O==="cancel"){m.item&&v.entities.remove(m.item);return}m.item&&(m.item.polygon.hierarchy=new m._cesium.PolygonHierarchy(m._cesium.Cartesian3.fromDegreesArray(A))),typeof o=="function"&&o(m.item,{position:x,angle:T,distance:S})},this._tree.handler.setInputAction(function(O){var F=m._getPosition.getMouseDegrees(O);y===0?(x={lon:F.lon,lat:F.lat,height:F.height},y++):m.end&&m.end()},m._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(O){m.end&&m.end("cancel")},m._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(O){if(y===0){E.showAt(O.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");return}else E.showAt(O.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88");C=m._getPosition.getMouseDegrees(O),A=D(x,C),m.item||(m.item=v.entities.add({polygon:{hierarchy:new m._cesium.PolygonHierarchy(m._cesium.Cartesian3.fromDegreesArray(A)),material:new m._cesium.ColorMaterialProperty(w.fillColor),outlineColor:w.outlineColor,fill:!0}}),m.item.polygon.hierarchy=new m._cesium.CallbackProperty(function(){return new m._cesium.PolygonHierarchy(m._cesium.Cartesian3.fromDegreesArray(A))},!1))},m._cesium.ScreenSpaceEventType.MOUSE_MOVE);var M=6378137,I=6356725;function P(O,F,k,U){var G=k*Math.sin(U*Math.PI/180),j=k*Math.cos(U*Math.PI/180),q=I+(M-I)*(90-O)/90,J=q*Math.cos(O*Math.PI/180),X=(G/J+F*Math.PI/180)*180/Math.PI,Y=(j/q+O*Math.PI/180)*180/Math.PI;return[X,Y]}function D(O,F){var k=[],U=L(O.lat,O.lon,F.lat,F.lon);T=U.angle,S=U.distance,k.push(O.lon,O.lat);for(var G=T-30,j=null;G<T+30;G++)j=P(O.lat,O.lon,S,G),k.push(j[0],j[1]);return k}function L(O,F,k,U){var G=R(O),j=R(k),q=R(k)-R(O),J=R(U)-R(F),X=2*Math.asin(Math.sqrt(Math.pow(Math.sin(q/2),2)+Math.cos(G)*Math.cos(j)*Math.pow(Math.sin(J/2),2)));return X=X*M,X=Math.round(X*1e4)/1e4,{angle:m._core.TwoPointAzimuth(F,O,U,k),distance:X}}function R(O){return O*Math.PI/180}return this};cl.prototype.executePolygon=function(o,f){this._lang=this._core.extend(this._lang,language._lang);var m=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var v=function(){function A(E){this.options={name:"",polygon:{hierarchy:[],heightReference:m._core.defaultValue(o.heightReference,1),perPositionHeight:o.heightReference===0,material:m._core.defaultValue(o.material,m._cesium.Color.YELLOW.withAlpha(.5))}},this.hierarchy=E,this._init()}return A.prototype._init=function(){var E=this,T=function(){return E.hierarchy};this.options.polygon.hierarchy=new m._cesium.CallbackProperty(T,!1),this.polygon=m._viewer.entities.add(this.options),m.item=this.polygon,m._tree.temporaryItem.obj.push(this.polygon)},A}();this._tree.handler=new this._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas);var y=[],x={},C=void 0;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var w=this._core.CreateTooltip();return this._tree.handler.setInputAction(function(A){var E=m._getPosition.getMousePosition(A);y.length==0&&y.push(E.clone()),y.push(E),x=new m._cesium.PolygonHierarchy(y)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(A){y.length===0?w.showAt(A.endPosition,m._lang.draw_tip_left):y.length<=2?w.showAt(A.endPosition,m._lang.draw_tip_click):w.showAt(A.endPosition,m._lang.draw_tip_right);var E=m._getPosition.getMousePosition(A);y.length>=2&&(m._cesium.defined(C)?E!=null&&(y.pop(),E.y+=1+Math.random(),y.push(E),x=new m._cesium.PolygonHierarchy(y)):(x=new m._cesium.PolygonHierarchy(y),C=new v(x)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(A){m._tree.endtemporaryItem(),m._tree.handler.destroy(),w.show(!1);var E={polygon:{},positions:[],area:[]};E.polygon=C;for(var T=[],S=0;S<y.length;S++){var M=m._cesium.Cartographic.fromCartesian(y[S]),I=m._cesium.Math.toDegrees(M.longitude),P=m._cesium.Math.toDegrees(M.latitude),D=M.height;T.push({lon:I,lat:P,hei:D})}E.positions=T,m._core.mouse(m._viewer.container,0,"0"),typeof f=="function"&&f(E)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this};cl.prototype.executePolygonvideo=function(o,f){this._lang=this._core.extend(this._lang,language._lang);var m=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var v=function(){function P(D){this.options={name:"",polygon:{hierarchy:[],heightReference:m._cesium.HeightReference.CLAMP_TO_GROUND,classificationType:m._cesium.ClassificationType.BOTH,material:m._cesium.Color.YELLOW.withAlpha(.5)}},this.hierarchy=D,this._init()}return P.prototype._init=function(){var D=this,L=function(){return D.hierarchy};this.options.polygon.hierarchy=new m._cesium.CallbackProperty(L,!1),this.polygon=m._viewer.entities.add(this.options),M.style.transform="rotate("+f.angle+"deg)",this.polygon.polygon.stRotation=m._cesium.Math.toRadians(f.angle),m.item=this.polygon,m._tree.temporaryItem.obj.push(this.polygon)},P}();this._tree.handler=new this._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas);var y=[],x={},C=void 0,w=this._core.CreateTooltip(),A=m._core.getuid(),E=document.getElementById("videoToolbar");if(!E){var T='<div id="videoToolbar"></div>';$(".cesium-viewer").append(T),E=document.getElementById("videoToolbar")}var S='<video id="video'+A+'" style="display: none;" muted autoplay loop crossorigin controls><source src="'+f.url+'" type="video/mp4"></video>';$(E).append(S);var M=document.getElementById("video"+A);M.style.transform="rotate("+f.angle+"deg)";let I;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.handler.setInputAction(function(P){var D=m._getPosition.getMousePosition(P);if(y.length==0&&y.push(D.clone()),y.push(D),y.length===2&&!I&&(I=m._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new $r.CallbackProperty(()=>y,!1),clampToGround:!0,material:new $r.ColorMaterialProperty($r.Color.YELLOW.withAlpha(.5)),width:3}})),y.length>=3&&!C){I&&m._viewer.entities.remove(I),x=new m._cesium.PolygonHierarchy(y),C=new v(x);return}x=new m._cesium.PolygonHierarchy(y)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(P){if(y.length===0?w.showAt(P.endPosition,m._lang.draw_tip_left):y.length<=2?w.showAt(P.endPosition,m._lang.draw_tip_click):w.showAt(P.endPosition,m._lang.draw_tip_right),y.length>=2){var D=m._getPosition.getMousePosition(P);D&&(y.pop(),y.push(D),x=new m._cesium.PolygonHierarchy(y))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(P){m.end&&m.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=P=>{if(m._tree.endtemporaryItem(),m._tree.handler.destroy(),w.show(!1),m._core.mouse(m._viewer.container,0,"0"),this.end=void 0,I&&m._viewer.entities.remove(I),P==="cancel"||y.length<3){m.item&&m._viewer.entities.remove(m.item);return}M.play(),m.item.polygon.material=M;var D={polygon:{},positions:[],area:[]};D.polygon=m.item;for(var L=[],R=0;R<y.length;R++){var O=m._cesium.Cartographic.fromCartesian(y[R]),F=m._cesium.Math.toDegrees(O.longitude),k=m._cesium.Math.toDegrees(O.latitude),U=O.height;L.push({lon:F,lat:k,hei:U})}D.positions=L,D.id=A,typeof o=="function"&&o(D)},this};cl.prototype.addVideoPolygon=function(o,f){var m=[],v;if(o[0]instanceof Array){if(o[0].length===2){for(var y=0;y<o.length;y++)m.push(o[y][0],o[y][1]);v=this._cesium.Cartesian3.fromDegreesArray(m)}else if(o[0].length===3){for(var y=0;y<o.length;y++)m.push(o[y][0],o[y][1],o[y][2]);v=this._cesium.Cartesian3.fromDegreesArrayHeights(m)}}else if(o[0].z)if(o[0].x<180&&o[0].x>-180&&o[0].y<90&&o[0].y>-90){for(var y=0;y<o.length;y++)m.push(o[y].x,o[y].y,o[y].z);v=this._cesium.Cartesian3.fromDegreesArrayHeights(m)}else v=o;else{for(var y=0;y<o.length;y++)m.push(o[y].x,o[y].y);v=this._cesium.Cartesian3.fromDegreesArray(m)}var x=document.getElementById("videoToolbar");if(!x){var C='<div id="videoToolbar"></div>';$(".cesium-viewer").append(C),x=document.getElementById("videoToolbar")}var w=this._core.getuid(),A='<video id="video'+w+'" style="display: none;" muted autoplay loop crossorigin controls><source src="'+f.url+'" type="video/mp4"></video>';$(x).append(A);var E=document.getElementById("video"+w);E.play();let T=this._core.defaultValue(f.heightReference,1),S=this._core.defaultValue(f.color,"#FFFFFF");return this.item=this._viewer.entities.add({name:"\u9762\u8D34\u89C6\u9891",polygon:{hierarchy:new $r.PolygonHierarchy(v),material:new $r.ImageMaterialProperty({image:E,color:$r.Color.fromCssColorString(S)}),heightReference:T,perPositionHeight:T!==1,stRotation:$r.Math.toRadians(f.angle||0),rotation:$r.Math.toRadians(f.rotation||0)}}),this};cl.prototype.addVideoPlane=function(o,f){var m;o instanceof Array?m=this._cesium.Cartesian3.fromDegrees(...o):o.x?m=this._cesium.Cartesian3.fromDegrees(o.x,o.y,o.z):o.lon&&(m=this._cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height));var v=document.getElementById("videoToolbar");if(!v){var y='<div id="videoToolbar"></div>';$(".cesium-viewer").append(y),v=document.getElementById("videoToolbar")}var x=this._core.getuid(),C='<video id="video'+x+'" style="display: none;" muted autoplay loop crossorigin controls><source src="'+f.url+'" type="video/mp4"></video>';$(v).append(C);var w=document.getElementById("video"+x);w.play();let A=this._core.defaultValue(f.color,"#FFFFFF");return this.item=this._viewer.entities.add({name:"\u76D2\u5B50\u8D34\u89C6\u9891",position:m,orientation:$r.Transforms.headingPitchRollQuaternion(m,new $r.HeadingPitchRoll($r.Math.toRadians(f.heading||0),$r.Math.toRadians(f.pitch||0),$r.Math.toRadians(f.roll||0))),plane:{plane:new $r.Plane($r.Cartesian3.UNIT_Y,0),dimensions:new $r.Cartesian2(f.width||12.8,f.height||7.2),material:new $r.ImageMaterialProperty({image:w,color:$r.Color.fromCssColorString(A)}),distanceDisplayCondition:new $r.DistanceDisplayCondition(f.near,f.far||(f.width||12.8)*100)}}),this};cl.prototype.deleteObject=function(){if(this._viewer.entities.remove(this.item),this._points.length>0){for(var o=0;o<this._points.length;o++)this._viewer.entities.remove(this._points[o]);this._points=[]}try{this._viewer.scene.primitives.remove(this.item)}catch(f){console.log(f)}this.item=void 0};cl.prototype.executePolygoncl=function(o,f){this._lang=this._core.extend(this._lang,language._lang);let m;(typeof o=="object"||typeof f=="function")&&(m=f,f=o,o=m),m=null,this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var v=this,y=0;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var x=this._core.CreateTooltip(),C=[],w={},A=[],E=[],T=null,S=null,M,I,P={point:v._cesium.Color.RED,polyline:v._cesium.Color.YELLOW,polygon:v._cesium.Color.YELLOW.withAlpha(.5)};Object.keys(f).length>0&&(f.point!=""&&f.point!=null&&(P.point=f.point),f.polyline!=""&&f.polyline!=null&&(P.polyline=f.polyline),f.polygon!=""&&f.polygon!=null&&(P.polygon=f.polygon));var D={mj:0,label:[],polygon:[]};let L,R;this._tree.handler.setInputAction(function(F){if(C.length===0?x.showAt(F.endPosition,v._lang.draw_tip_left):C.length<=3?x.showAt(F.endPosition,v._lang.draw_tip_click):x.showAt(F.endPosition,v._lang.draw_tip_right),S=v._getPosition.getMousePosition(F),!!S){var k=v._cesium.Cartographic.fromCartesian(S),U=v._cesium.Math.toDegrees(k.longitude),G=v._cesium.Math.toDegrees(k.latitude),j=k.height;if(C.length>=2){v._cesium.defined(T)?(C.pop(),C.push(S),w=new v._cesium.PolygonHierarchy(C),E.pop(),E.push([U,G])):(w=new v._cesium.PolygonHierarchy(C),T=new O(w));var q=v._core.getArea(E,C);v._viewer.entities.remove(I),I=v._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:new $r.CallbackProperty(function(){let J=new $r.Cartesian3;return C.forEach(X=>{$r.Cartesian3.add(J,X,J)}),$r.Cartesian3.divideByScalar(J,C.length,new $r.Cartesian3)},!1),label:{text:q,font:"16px \u5B8B\u4F53",fillColor:$r.Color.GOLD,verticalOrigin:$r.VerticalOrigin.BOTTOM,pixelOffset:new $r.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new $r.DistanceDisplayCondition(0,R*1.5)}}),v._tree.temporaryItem.obj.push(I),D.label=I}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(F){if(S=v._getPosition.getMousePosition(F),!!S){!R&&(R=v._core.getPointToCameraDistance(v._viewer,S));var k=v._core.getArea(E,C),U=v._cesium.Cartographic.fromCartesian(S),G=v._cesium.Math.toDegrees(U.longitude),j=v._cesium.Math.toDegrees(U.latitude);C.length==0&&(C.push(S.clone()),E.push([G,j])),C.push(S),E.push([G,j]),w=new v._cesium.PolygonHierarchy(C),C.length===2&&(L=v._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new $r.CallbackProperty(()=>C,!1),clampToGround:!0,material:P.polygon,width:3}})),C.length>=3&&(v._cesium.defined(T)||(w=new v._cesium.PolygonHierarchy(C),T=new O(w)),v._viewer.entities.remove(I),I=v._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:new $r.CallbackProperty(function(){let q=new $r.Cartesian3;return C.forEach(J=>{$r.Cartesian3.add(q,J,q)}),$r.Cartesian3.divideByScalar(q,C.length,new $r.Cartesian3)},!1),label:{text:k,font:"16px \u5B8B\u4F53",fillColor:$r.Color.GOLD,verticalOrigin:$r.VerticalOrigin.BOTTOM,pixelOffset:new $r.Cartesian2(20,-40),showBackground:!0,distanceDisplayCondition:new $r.DistanceDisplayCondition(0,R*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),v._tree.temporaryItem.obj.push(I),D.label=I)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(F){v.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(F){if(x.show(!1),v._viewer.entities.remove(I),v._tree.handler.destroy(),v.end=void 0,v._core.mouse(v._viewer.container,0,"0"),L&&v._viewer.entities.remove(L),F==="cancel"||C.length<3){v.item&&v._viewer.entities.remove(v.item);return}var k=v._core.getArea(E,C);y=k;var U=v._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:new $r.CallbackProperty(function(){let G=new $r.Cartesian3;return C.forEach(j=>{$r.Cartesian3.add(G,j,G)}),$r.Cartesian3.divideByScalar(G,C.length,new $r.Cartesian3)},!1),label:{text:k,font:"16px \u5B8B\u4F53",fillColor:$r.Color.GOLD,verticalOrigin:$r.VerticalOrigin.BOTTOM,pixelOffset:new $r.Cartesian2(20,-40),showBackground:!0,distanceDisplayCondition:new $r.DistanceDisplayCondition(0,R*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY}});v._tree.endtemporaryItem(),v._points.push(U),v._lable=U,D.mj=y,D.label=U,o!=""&&o!=null&&typeof o=="function"&&o(D)};var O=function(){function F(k){this.options={name:"\u591A\u8FB9\u5F62",polygon:{show:!0,hierarchy:[],material:P.polygon,classificationType:v._cesium.ClassificationType.BOTH}},this.hierarchy=k,this._init()}return F.prototype._init=function(){var k=this,U=function(){return k.hierarchy};this.options.polygon.hierarchy=new v._cesium.CallbackProperty(U,!1),this.polygon=v._viewer.entities.add(this.options),v.item=this.polygon,v._entity=this.polygon,v._tree.temporaryItem.obj.push(this.polygon),D.polygon=this.polygon},F}();return this};cl.prototype.planeArea=cl.prototype.executePolygoncl;cl.prototype.executePolygonym=function(o){var f=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler();var m=0;this._tree.handler=new f._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas);var v=[],y={},x=[],C=null,w=null,A={ply:{},waterHeight:0,targetHeight:1e5,speed:0};A.start=function(){this.timer=setInterval(function(){var S=A.targetHeight;waterHeight<S&&(waterHeight+=speed,waterHeight>S&&(waterHeight=S),A.ply.options.polygon.extrudedHeight=A.waterHeight,f._viewer.entities.add(A.ply.options))},2e3)},A.setWaterHeight=function(S){A.waterHeight=S},A.setTargetHeight=function(S){A.targetHeight=S},A.setSpeed=function(S){A.speed=S};var E={mj:0,label:{}};this._tree.handler.setInputAction(function(S){var M=f._viewer.camera.getPickRay(S.endPosition);w=f._viewer.scene.globe.pick(M,f._viewer.scene),v.length>=2&&(f._cesium.defined(C)?(v.pop(),v.push(w),y=new f._cesium.PolygonHierarchy(v)):(y=new f._cesium.PolygonHierarchy(v),C=new T(y)))},f._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(S){var M=f._viewer.camera.getPickRay(S.position);w=f._viewer.scene.globe.pick(M,f._viewer.scene),v.length==0&&(v.push(w.clone()),y=new f._cesium.PolygonHierarchy(v)),v.push(w),y=new f._cesium.PolygonHierarchy(v);var I=f._cesium.Cartographic.fromCartesian(v[v.length-1]),P=f._cesium.Math.toDegrees(I.longitude),D=f._cesium.Math.toDegrees(I.latitude),L=I.height;x.push({lon:P,lat:D,hei:L});var R=f._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:v[v.length-1],point:{pixelSize:5,color:f._cesium.Color.RED.withAlpha(.5),outlineColor:f._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:f._cesium.HeightReference.CLAMP_TO_GROUND}});f._tree.temporaryItem.obj.push(R),f._points.push(R)},f._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(S){f._tree.handler.destroy(),f._tree.endtemporaryItem(),v.pop(),y=new f._cesium.PolygonHierarchy(v);var M="\u5E73\u65B9\u5343\u7C73";m=M;var I=f._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:new $r.CallbackProperty(function(){let P=new $r.Cartesian3;return v.forEach(D=>{$r.Cartesian3.add(P,D,P)}),$r.Cartesian3.divideByScalar(P,v.length,new $r.Cartesian3)},!1),label:{text:M,font:"16px \u5B8B\u4F53",fillColor:$r.Color.GOLD,verticalOrigin:$r.VerticalOrigin.BOTTOM,pixelOffset:new $r.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:f._cesium.HeightReference.CLAMP_TO_GROUND}});f._tree.temporaryItem.obj.push(I),f._points.push(I),E.mj=m,E.label=I,o!=""&&o!=null&&typeof o=="function"&&o(C)},f._cesium.ScreenSpaceEventType.RIGHT_CLICK);var T=function(){function S(D){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:f._cesium.Color.SKYBLUE.withAlpha(.4),extrudedHeight:0}},this.hierarchy=D,this._init()}S.prototype._init=function(){var D=this,L=function(){return D.hierarchy};this.options.polygon.hierarchy=new f._cesium.CallbackProperty(L,!1);var R=f._viewer.entities.add(this.options);f._tree.temporaryItem.obj.push(R),f.item=R};var M=0;!f._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(M=Ne.selectedItem.id);var I=f._core.getuid(),P={id:I,name:"\u65B0\u5EFA\u9762"+I,pId:f._core.isnull(M)?0:M,type:"polygon",item:f};return f.setTreeobj(P),Ne.insertGroupId(P,f._core.isnull(M)?0:M),S}();return this};cl.prototype.executePolygonymsd=function(o={},f){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var m=this;this._tree.handler=new m._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var v=this._core.CreateTooltip(),y={},x=[],C=[],w=null,A=null,E=null,T="0",S=0,M=1e3,I=10,P=!1,D={mj:0,label:[],ployline:[]},L=[];this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);let R,O;this._tree.handler.setInputAction(function(U){if(P){S===void 0?v.showAt(U.endPosition,"\u70B9\u51FB\u62FE\u53D6\u521D\u59CB\u6C34\u9762\u9AD8\u5EA6"):M===void 0&&v.showAt(U.endPosition,"\u70B9\u51FB\u62FE\u53D6\u6700\u5927\u6DF9\u6CA1\u9AD8\u5EA6");return}x.length>=4?v.showAt(U.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"):v.showAt(U.endPosition,"\u70B9\u51FB\u5DE6\u952E\u7ED8\u5236\u6DF9\u6CA1\u533A\u57DF");var G=m._viewer.camera.getPickRay(U.endPosition);if(E=m._viewer.scene.globe.pick(G,m._viewer.scene),x.length>=2){if(!m._cesium.defined(w))y=new m._cesium.PolygonHierarchy(x),w=new k(y);else if(o.rectangle)O=m._core.toDegrees(E),x=[$r.Cartesian3.fromDegrees(R.lon,R.lat),$r.Cartesian3.fromDegrees(R.lon,O.lat),$r.Cartesian3.fromDegrees(O.lon,O.lat),$r.Cartesian3.fromDegrees(O.lon,R.lat)],y=new m._cesium.PolygonHierarchy(x),w.hierarchy=y;else{for(var j=x[0],q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(j),J=$r.Math.toDegrees(q.latitude),X=$r.Math.toDegrees(q.longitude),Y=x[x.length-2],Q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(Y),ee=$r.Math.toDegrees(Q.latitude),z=$r.Math.toDegrees(Q.longitude),ie=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(E),re=$r.Math.toDegrees(ie.latitude),ne=$r.Math.toDegrees(ie.longitude),oe=$r.turf.lineString([[X,J],[ne,re]]),se=$r.turf.lineString([[z,ee],[ne,re]]),ae=!0,fe=0;fe<L.length&&L.length>=2;fe++){var de=L[fe];if(fe==0){if($r.turf.lineIntersect(se,de).features.length){ae=!1,v.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762\uFF01</span>';break}continue}if(fe==L.length-1){if($r.turf.lineIntersect(oe,de).features.length){ae=!1,v.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762\uFF01</span>';break}continue}if($r.turf.lineIntersect(oe,de).features.length){ae=!1,v.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762\uFF01</span>';return}if($r.turf.lineIntersect(se,de).features.length){ae=!1,v.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762\uFF01</span>';break}}if(!ae)return;x.pop(),x.push(E),y=new m._cesium.PolygonHierarchy(x)}A||(A=m._viewer.entities.add({polyline:{positions:new $r.CallbackProperty(function(){return x.concat([x[0]])},!1),clampToGround:!0,width:3}}),m._points.push(A))}},m._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(U){var G=m._getPosition.getMousePosition(U);if(!!G){if(P){let De=m._cesium.Cartographic.fromCartesian(G);if(S===void 0)S=De.height;else if(M===void 0){if(M=De.height,M<S){window.layuiLayer&&window.layuiLayer.msg("\u6700\u5927\u6DF9\u6CA1\u9AD8\u5EA6\u5C0F\u4E8E\u521D\u59CB\u6C34\u9762\u9AD8\u5EA6\uFF0C\u8BF7\u91CD\u65B0\u62FE\u53D6"),M=void 0,S=void 0;return}F()}return}if(x.length==0&&(x.push(G.clone()),y=new m._cesium.PolygonHierarchy(x)),x.length>=2)if(L.length==0){var j=x[0],q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(j),J=$r.Math.toDegrees(q.latitude),X=$r.Math.toDegrees(q.longitude),Y=x[1],Q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(Y),ee=$r.Math.toDegrees(Q.latitude),z=$r.Math.toDegrees(Q.longitude),ie=$r.turf.lineString([[X,J],[z,ee]]);L.push(ie)}else{if(L.length>=2){for(var j=x[0],q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(j),J=$r.Math.toDegrees(q.latitude),X=$r.Math.toDegrees(q.longitude),Y=x[x.length-2],Q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(Y),ee=$r.Math.toDegrees(Q.latitude),z=$r.Math.toDegrees(Q.longitude),re=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(G),ne=$r.Math.toDegrees(re.latitude),oe=$r.Math.toDegrees(re.longitude),se=$r.turf.lineString([[X,J],[oe,ne]]),ae=$r.turf.lineString([[z,ee],[oe,ne]]),fe=!0,de=0;de<L.length&&L.length>=2;de++){var ve=L[de];if(de==0){if($r.turf.lineIntersect(ae,ve).features.length){fe=!1,v.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762\uFF01</span>';break}continue}if(de==L.length-1){if($r.turf.lineIntersect(se,ve).features.length){fe=!1,v.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762\uFF01</span>';break}continue}if($r.turf.lineIntersect(se,ve).features.length){fe=!1,v.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762\uFF01</span>';return}if($r.turf.lineIntersect(ae,ve).features.length){fe=!1,v.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762\uFF01</span>';break}}if(!fe)return}var j=x[x.length-2],q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(j),J=$r.Math.toDegrees(q.latitude),X=$r.Math.toDegrees(q.longitude),Q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(G),ee=$r.Math.toDegrees(Q.latitude),z=$r.Math.toDegrees(Q.longitude),ie=$r.turf.lineString([[X,J],[z,ee]]);L.push(ie)}x.push(G),y=new m._cesium.PolygonHierarchy(x),o.rectangle&&(R?(O=m._core.toDegrees(G),x=[$r.Cartesian3.fromDegrees(R.lon,R.lat),$r.Cartesian3.fromDegrees(R.lon,O.lat),$r.Cartesian3.fromDegrees(O.lon,O.lat),$r.Cartesian3.fromDegrees(O.lon,R.lat)],y=new m._cesium.PolygonHierarchy(x),w.hierarchy=y,o.pointSelect?(S=void 0,M=void 0,P=!0):F()):R=m._core.toDegrees(G));var pe=m._cesium.Cartographic.fromCartesian(x[x.length-1]),ce=m._cesium.Math.toDegrees(pe.longitude),he=m._cesium.Math.toDegrees(pe.latitude),Ce=pe.height;C.push({lon:ce,lat:he,hei:Ce});var Se=m._viewer.entities.add({name:"\u591A\u8FB9\u5F62",position:G,point:{pixelSize:5,color:m._cesium.Color.RED.withAlpha(.5),outlineColor:m._cesium.Color.WHITE.withAlpha(.5),outlineWidth:1,heightReference:m._cesium.HeightReference.CLAMP_TO_GROUND}});m._tree.temporaryItem.obj.push(Se),D.label.push(Se),m._points.push(Se)}},m._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(U){P||x.length<=3||(v.show(!1),x.pop(),y=new m._cesium.PolygonHierarchy(x),o.pointSelect?(S=void 0,M=void 0,P=!0):F())},m._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=U=>{if(v.show(!1),m._core.mouse(m._viewer.container,0),m._tree.handler.destroy(),m._tree.endtemporaryItem(),m.end=void 0,U==="cancel"&&!this.waterTimer&&(m.item&&m._viewer.entities.remove(m.item),this._points.length>0)){for(var G=0;G<this._points.length;G++)this._viewer.entities.remove(this._points[G]);this._points=[]}};function F(){m.end();let U=I/20;m.waterTimer=setInterval(function(){if(S<M&&(S+=U,m.item._polygon.extrudedHeight.setValue(S),S>=M)){clearInterval(m.waterTimer),m.waterTimer=void 0,S=M,m._viewer.entities.remove(m.item),m.polygon1=new m._cesium.PolygonGeometry({polygonHierarchy:new m._cesium.PolygonHierarchy(x),extrudedHeight:M,height:0,vertexFormat:m._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT});var G=new m._cesium.Primitive({geometryInstances:new m._cesium.GeometryInstance({geometry:m.polygon1}),appearance:new $r.EllipsoidSurfaceAppearance({material:new $r.Material({fabric:{type:"Water",uniforms:{baseWaterColor:o.watherColor||$r.Color.SKYBLUE.withAlpha(.6),blendColor:o.watherColor||$r.Color.SKYBLUE.withAlpha(.6),normalMap:o.url,frequency:o.frequency||1e3,animationSpeed:o.watherSpeed||.01,amplitude:o.amplitude||10}}})}),show:!0}),j=m._viewer.scene,q=j.primitives.add(G);D.ployline.push(q),m.item=G,f!=""&&f!=null&&typeof f=="function"&&f(S),!m._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(T=Ne.selectedItem.id);var J=m._core.getuid(),X={id:J,name:"\u65B0\u5EFA\u6DF9\u6CA1\u5206\u6790"+J,pId:m._core.isnull(T)?0:T,type:"polygon",item:m};m.setTreeobj(X),Ne.insertGroupId(X,m._core.isnull(T)?0:T)}},50)}var k=function(){function U(G){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],material:m._cesium.Color.SKYBLUE.withAlpha(.5),heightReference:m._cesium.HeightReference.NONE,extrudedHeight:0}},this.hierarchy=G,this._init()}return U.prototype._init=function(){var G=this,j=function(){return G.hierarchy};this.options.polygon.hierarchy=new m._cesium.CallbackProperty(j,!1);var q=m._viewer.entities.add(this.options);m.item=q,m._tree.temporaryItem.obj.push(q);try{o!=null&&o!=""&&(o.waterHeight>0&&(S=o.waterHeight),o.targetHeight>0&&(M=o.targetHeight),o.spood>0&&(I=o.spood),o.GroupID!=""&&o.GroupID!=null&&(T=o.GroupID))}catch(J){console.log(J)}},U}();return this};cl.prototype.endWater=function(){this.end&&this.end(),this.waterTimer&&clearInterval(this.waterTimer),this._tree.endtemporaryItem(),this.deleteObject()};cl.prototype.executePolygonymsdtt=function(o,f){var m=0;this._tree.removeHandler();var v=this;this._tree.starttemporaryItem(this._viewer),this._tree.handler=new v._cesium.ScreenSpaceEventHandler(v._viewer.scene.canvas);var y=[],x={},C=[],w=null,A=null,E={mj:0,label:{}};this._tree.handler.setInputAction(function(S){var M=v._viewer.camera.getPickRay(S.endPosition);A=v._viewer.scene.globe.pick(M,v._viewer.scene),y.length>=2&&(v._cesium.defined(w)?(y.pop(),y.push(A),x=new v._cesium.PolygonHierarchy(y)):(w=new T(y),x=new v._cesium.PolygonHierarchy(y)))},v._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(S){var M=v._viewer.camera.getPickRay(S.position);A=v._viewer.scene.globe.pick(M,v._viewer.scene),y.length==0&&(y.push(A.clone()),x=new v._cesium.PolygonHierarchy(y)),y.push(A),x=new v._cesium.PolygonHierarchy(y);var I=v._cesium.Cartographic.fromCartesian(y[y.length-1]),P=v._cesium.Math.toDegrees(I.longitude),D=v._cesium.Math.toDegrees(I.latitude),L=I.height;C.push({lon:P,lat:D,hei:L});var R=v._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:y[y.length-1],point:{pixelSize:5,color:v._cesium.Color.RED.withAlpha(.5),outlineColor:v._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:v._cesium.HeightReference.CLAMP_TO_GROUND}});v._tree.temporaryItem.obj.push(R),v._points.push(R)},v._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(S){v._tree.handler.destroy();var M="\u5E73\u65B9\u5343\u7C73";m=M,E.mj=m,v._viewer.entities.remove(v.item),v.polygon1=new v._cesium.PolygonGeometry({polygonHierarchy:new v._cesium.PolygonHierarchy(y),extrudedHeight:0,height:0,vertexFormat:v._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT});var I=new v._cesium.Primitive({geometryInstances:new v._cesium.GeometryInstance({geometry:v.polygon1}),appearance:new v._cesium.EllipsoidSurfaceAppearance({aboveGround:!0}),show:!0}),P=new v._cesium.Material({fabric:{type:"Water",uniforms:{normalMap:o.url,frequency:100,animationSpeed:.01,amplitude:10}}});I.appearance.material=P;var D=v._viewer.scene;v.polygon1=D.primitives.add(I),v._tree.endtemporaryItem(),y.pop(),x=new v._cesium.PolygonHierarchy(y)},v._cesium.ScreenSpaceEventType.RIGHT_CLICK);var T=function(){function S(M){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],material:v._cesium.Color.SKYBLUE.withAlpha(.4),heightReference:v._cesium.HeightReference.NONE,extrudedHeight:0}},this.hierarchy=M,this._init()}return S.prototype._init=function(){var M=this,I=function(){return M.hierarchy};this.options.polygon.hierarchy=new v._cesium.CallbackProperty(I,!1);var P=v._viewer.entities.add(this.options);v.item=P,v._tree.temporaryItem.obj.push(P);var D=0;!v._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(D=Ne.selectedItem.id);var L=v._core.getuid(),R={id:L,name:"\u65B0\u5EFA\u6C34\u9762"+L,pId:v._core.isnull(D)?0:D,type:"polyline",item:v};v.setTreeobj(R),Ne.insertGroupId(R,v._core.isnull(D)?0:D)},S}();return this};cl.prototype.executePolygontdmj=function(o,f){this._lang=this._core.extend(this._lang,language._lang);var m=this;this._tree.starttemporaryItem(this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.removeHandler();var v={mj:0,label:[],polygon:[]},y=!0,x=[],C={},w=void 0,A=this._viewer.scene,E=A.globe.ellipsoid,T,S={point:m._cesium.Color.RED,polyline:m._cesium.Color.YELLOW,polygon:m._cesium.Color.YELLOW.withAlpha(.5)};Object.keys(f).length>0&&(f.point!=""&&f.point!=null&&(S.point=f.point),f.polyline!=""&&f.polyline!=null&&(S.polyline=f.polyline),f.polygon!=""&&f.polygon!=null&&(S.polygon=f.polygon));var M=this._core.CreateTooltip();this._tree.handler=new m._cesium.ScreenSpaceEventHandler(A.canvas);var I=0;let P;this._tree.handler.setInputAction(function(G){x.length===0?M.showAt(G.endPosition,m._lang.draw_tip_left):x.length<=2?M.showAt(G.endPosition,m._lang.draw_tip_click):M.showAt(G.endPosition,m._lang.draw_tip_right),T&&(m._viewer.entities.remove(T),T=void 0);var j=m._getPosition.getMousePosition(G,[v.polygon,v.label]),q;if(!!j&&(q=m._cesium.Ellipsoid.WGS84.cartesianToCartographic(j),q&&y&&(x.pop(),x.push(j),x.length>=3))){var J=String(O(w.path.positions));J=J.substr(0,J.indexOf(".",0)),J.length<6?I=J+"\u5E73\u65B9\u7C73":(J=String(J/1e6),J=J.substr(0,J.indexOf(".",0)+3),I=J+"\u5E73\u65B9\u5343\u7C73"),v.mj=I,T=m._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:new $r.CallbackProperty(function(){let X=new $r.Cartesian3;return x.forEach(Y=>{$r.Cartesian3.add(X,Y,X)}),$r.Cartesian3.divideByScalar(X,x.length,new $r.Cartesian3)},!1),label:{text:I,font:"16px \u5B8B\u4F53",fillColor:$r.Color.GOLD,verticalOrigin:$r.VerticalOrigin.BOTTOM,pixelOffset:new $r.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new $r.DistanceDisplayCondition(0,P*1.5),heightReference:m._cesium.HeightReference.CLAMP_TO_GROUND}}),m._tree.temporaryItem.obj.push(T),m._points.push(T),v.label=T}},m._cesium.ScreenSpaceEventType.MOUSE_MOVE);var D=0;let L;this._tree.handler.setInputAction(function(G){var j=m._getPosition.getMousePosition(G,[v.polygon,v.label]),q;if(D=1,j&&(!P&&(P=m._core.getPointToCameraDistance(m._viewer,j)),y&&(x.length||x.push(j.clone()),x.push(j),C=new m._cesium.PolygonHierarchy(x),T&&(m._viewer.entities.remove(T),T=void 0),x.length===2&&(L=m._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new $r.CallbackProperty(()=>x,!1),clampToGround:!0,material:S.polygon,width:3}})),x.length>=3&&!m._cesium.defined(w)&&(L&&m._viewer.entities.remove(L),w=new U(C,m._cesium)),x.length>=3))){var J=String(O(w.path.positions));J=J.substr(0,J.indexOf(".",0)),J.length<6?I=J+"\u5E73\u65B9\u7C73":(J=String(J/1e6),J=J.substr(0,J.indexOf(".",0)+3),I=J+"\u5E73\u65B9\u5343\u7C73"),v.mj=I,T=m._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:new $r.CallbackProperty(function(){let X=new $r.Cartesian3;return x.forEach(Y=>{$r.Cartesian3.add(X,Y,X)}),$r.Cartesian3.divideByScalar(X,x.length,new $r.Cartesian3)},!1),label:{text:I,font:"16px \u5B8B\u4F53",fillColor:$r.Color.GOLD,verticalOrigin:$r.VerticalOrigin.BOTTOM,pixelOffset:new $r.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new $r.DistanceDisplayCondition(0,P*1.5),heightReference:m._cesium.HeightReference.CLAMP_TO_GROUND}}),m._tree.temporaryItem.obj.push(T),m._points.push(T),v.label=T}},m._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(){m.end&&m.end()},m._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(G){if(m._tree.handler.removeInputAction(m._cesium.ScreenSpaceEventType.LEFT_CLICK),m._tree.handler.removeInputAction(m._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),m._cesium.trackedEntity=void 0,m.end=void 0,m._tree.endtemporaryItem(),y=!1,M.show(!1),m._tree.handler.destroy(),m._core.mouse(m._viewer.container,0,"0"),L&&m._viewer.entities.remove(L),G==="cancel"){m.deleteObject();return}x.length<3&&m.deleteObject(),o!=""&&o!=null&&typeof o=="function"&&o(v)};var R=function(G){for(var j=0,q=0,J=0,X=0;X<G.length;X++)j+=G[X].x,q+=G[X].y,J+=G[X].z;var Y=new m._cesium.Cartesian3(j/G.length,q/G.length,J/G.length);return Y},O=function(G){for(var j=new Array(G.length),q=0;q<G.length;q++)j[q]=F(E.cartesianToCartographic(G[q]));for(var J=0,q=0;q<j.length;q++)J+=j[q].longitude;J=J/j.length;for(var q=0;q<j.length;q++)j[q]=m._core.Gauss_to_XY(j[q].longitude,j[q].latitude,J,m._cesium);return Math.abs(k(j))},F=function(G){return G.longitude=G.longitude/Math.PI*180,G.latitude=G.latitude/Math.PI*180,G},k=function(G){for(var j=0,q=0;q<G.length;q++){var J=G[q],X;q<G.length-1?X=G[q+1]:X=G[0],j+=J.x*X.y-X.x*J.y}return j/2},U=function(){function G(j,q){if(!m._cesium.defined(j))throw new m._cesium.DeveloperError("positions is required!");if(j.length<3)throw new m._cesium.DeveloperError("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,classificationType:m._cesium.ClassificationType.BOTH,material:S.polygon}},this.path=j,this._init(q)}return G.prototype._init=function(j){var q=this,J=function(){return q.path};this.options.polygon.hierarchy=new m._cesium.CallbackProperty(J,!1),this.polygonEntity=m._viewer.entities.add(this.options),m.item=this.polygonEntity,m._tree.temporaryItem.obj.push(this.polygonEntity),v.polygon=this.polygonEntity,m._entity=this.polygonEntity},G}();return this};cl.prototype.surfaceArea=function(o={},f){this._lang=this._core.extend(this._lang,language._lang);var m=this;this._tree.removeHandler(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var v={mj:0,label:void 0,polygon:void 0},y=[],x=[],C={},w=void 0,A=this._viewer.scene,E={point:o.point||$r.Color.RED,polyline:o.polyline||$r.Color.YELLOW,polygon:o.polygon||$r.Color.YELLOW.withAlpha(.5)},T=this._core.CreateTooltip();this._tree.handler=new m._cesium.ScreenSpaceEventHandler(A.canvas);let S=!1,M;this._tree.handler.setInputAction(D=>{if(y.length===0?T.showAt(D.endPosition,m._lang.draw_tip_left):y.length<=2?T.showAt(D.endPosition,m._lang.draw_tip_click):T.showAt(D.endPosition,m._lang.draw_tip_right),!S)return;let L=this._getPosition.getMousePosition(D,[v.polygon,v.label]);L&&(y.pop(),y.push(L))},$r.ScreenSpaceEventType.MOUSE_MOVE);let I;this._tree.handler.setInputAction(D=>{S=!0;let L=this._getPosition.getMousePosition(D,[v.polygon,v.label]);if(L){!M&&(M=m._core.getPointToCameraDistance(m._viewer,L)),y.length||y.push(L.clone()),y.push(L);let R=this._core.toDegrees(L);x.push([R.lon,R.lat,R.height]),C=new m._cesium.PolygonHierarchy(y),y.length===2&&(I=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new $r.CallbackProperty(()=>y,!1),clampToGround:!0,material:E.polygon,width:3}})),y.length>=3&&!$r.defined(w)&&(I&&this._viewer.entities.remove(I),w=new P(C))}},$r.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(()=>{m.end&&m.end()},$r.ScreenSpaceEventType.RIGHT_CLICK),this.end=D=>{if(this.end=void 0,S=!1,T.show(!1),m._tree.handler.destroy(),m._core.mouse(m._viewer.container,0,"0"),I&&m._viewer.entities.remove(I),D==="cancel"){this.deleteObject();return}if(y.pop(),y.length<3&&this.deleteObject(),x.length>2){let L=$r.BoundingSphere.fromPoints(y),R=this._core.getSpaceArea(this._viewer,x,{onlyTerrain:o.onlyTerrain,distance:o.distance||L.radius/20}),O=F=>{let{area:k,tin:U}=F;v.mj=k;let G=new $r.Cartesian3;x.forEach(J=>{$r.Cartesian3.add(G,{x:J[0],y:J[1],z:J[2]},G)});let j=$r.Cartesian3.divideByScalar(G,x.length,new $r.Cartesian3),q=this._viewer.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:$r.Cartesian3.fromDegrees(j.x,j.y,j.z),label:{text:k,font:"16px \u5B8B\u4F53",fillColor:$r.Color.GOLD,verticalOrigin:$r.VerticalOrigin.BOTTOM,pixelOffset:new $r.Cartesian2(20,-40),showBackground:!0,distanceDisplayCondition:new $r.DistanceDisplayCondition(0,M*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY}});this._points.push(q),o.tin&&(this._viewer.entities.remove(v.polygon),U.features.forEach(J=>{if(J.positions){let X=this._viewer.entities.add({polygon:{hierarchy:new $r.PolygonHierarchy(J.positions),material:E.polygon,outline:!0,distanceDisplayCondition:new $r.DistanceDisplayCondition(0,M*1.5),outlineColor:$r.Color.YELLOW}});this._points.push(X)}})),v.label=q,f&&typeof f=="function"&&f(v)};o.onlyTerrain?R.then(F=>{O(F)}):O(R)}};var P=function(){function D(L){if(!$r.defined(L))throw new $r.DeveloperError("positions is required!");if(L.length<3)throw new $r.DeveloperError("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,classificationType:$r.ClassificationType.BOTH,material:E.polygon}},this.path=L,this._init()}return D.prototype._init=function(){var L=this,R=function(){return L.path};this.options.polygon.hierarchy=new $r.CallbackProperty(R,!1),this.polygonEntity=m._viewer.entities.add(this.options),m.item=this.polygonEntity,m._tree.temporaryItem.obj.push(this.polygonEntity),v.polygon=this.polygonEntity,m._entity=this.polygonEntity},D}();return this};cl.prototype.setVisibility=function(o){if(this._points.length>0)for(var f=0;f<this._points.length;f++)this._points[f].show=o;this._lable&&(this._lable.show=o),this.item&&(this.item.show=o)};cl.prototype.getVisibility=function(){return this.item.show};cl.prototype.setRadius=function(o){try{for(var f=[],m=this.item._polygon.hierarchy.getValue(),v=this._viewer.scene.globe.ellipsoid,y=0;y<m.length;y++){var x=new this._cesium.Cartesian3(m[y].x,m[y].y,m[y].z),C=v.cartesianToCartographic(x),E=this._cesium.Math.toDegrees(C.latitude),T=this._cesium.Math.toDegrees(C.longitude);f.push(T),f.push(E)}var w=new this._cesium.Cartesian3(m[0].x,m[0].y,m[0].z),A=v.cartesianToCartographic(w),E=this._cesium.Math.toDegrees(A.latitude),T=this._cesium.Math.toDegrees(A.longitude);f.push(T),f.push(E),f=this._cesium.Cartesian3.fromDegreesArray(f),this.item.corridor=new this._cesium.CorridorGraphics({positions:f,width:o,material:this._cesium.Color.RED.withAlpha(.4)})}catch(S){console.log(S)}return this};cl.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show._value,f=this.item.polygon.hierarchy.getValue(),m=this.item.polygon.height==null?void 0:this.item.polygon.height._value,v=this.item.polygon.extrudedHeight==null?void 0:this.item.polygon.extrudedHeight._value,y=this.item.polygon.stRotation==null?void 0:this.item.polygon.stRotation._value,x=this.item.polygon.fill==null?void 0:this.item.polygon.fill._value,C=this.item.polygon.material;C!=null&&(C={color:C.color==null?void 0:"rgba("+C.color._value.red+","+C.color._value.green+","+C.color._value.blue+","+C.color._value.alpha+")",image:C.image==null?void 0:C.image._value,diffusemap:C.diffusemap==null?void 0:C.diffusemap._value,alphamap:C.alphamap==null?void 0:C.alphamap._value});var w=this.item.polygon.outline==null?void 0:this.item.polygon.outline._value,A=this.item.polygon.outlineColor==null?void 0:"rgba("+this.item.polygon.outlineColor._value.red+","+this.item.polygon.outlineColor._value.green+","+this.item.polygon.outlineColor._value.blue+","+this.item.polygon.outlineColor._value.alpha+")",E=this.item.polygon.outlineWidth==null?void 0:this.item.polygon.outlineWidth._value,T=this.item.polygon.perPositionHeight==null?void 0:this.item.polygon.perPositionHeight._value,S=this.item.polygon.closeTop==null?void 0:this.item.polygon.closeTop._value,M=this.item.polygon.closeBottom==null?void 0:this.item.polygon.closeBottom._value,I=this.item.polygon.distanceDisplayCondition,P=I?._value.near,D=I?._value.far;return{type:"polygon",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:o,hierarchy:f,height:m,extrudedHeight:v,stRotation:y,fill:x,material:C,outline:w,outlineColor:A,outlineWidth:E,perPositionHeight:T,closeTop:S,closeBottom:M,near:P,far:D}}};cl.prototype.setTreeobj=function(o){this.treeobj=o};cl.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._polygon.distanceDisplayCondition=m}catch(v){console.log(v)}return this};cl.prototype.setPolygonAlpha=function(o){try{this.item._polygon.material.color._value.alpha=o}catch(f){console.log(f)}return this};cl.prototype.setPolygonColor=function(o){try{this.item._polygon.material.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};cl.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._polygon.distanceDisplayCondition=m}catch(v){console.log(v)}return this};cl.prototype.setPolygonImage=function(o){try{this.item._polygon.material=new this._cesium.ImageMaterialProperty({image:o})}catch(f){console.log(f)}return this};cl.prototype.setPolygonRepeat=function(o,f){try{this.item._polygon.material.repeat=new this._cesium.Cartesian2(o,f)}catch(m){console.log(m)}return this};cl.prototype.setOutlineColor=function(o){try{this.item._polygon.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};cl.prototype.setOutline=function(o){try{this.item._polygon.outline=o}catch(f){console.log(f)}return this};cl.prototype.setExtrudedHeight=function(o){try{this.item._polygon.extrudedHeight=o}catch(f){console.log(f)}return this};cl.prototype.setHeight=function(o){try{this.item._polygon.height=o}catch(f){console.log(f)}return this};cl.prototype.setHeightType=function(o){try{o==1?this.item._polygon.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:o==2?this.item._polygon.heightReference=this._cesium.HeightReference.NONE:o==3&&(this.item._polygon.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(f){console.log(f)}return this};Object.defineProperties(cl.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(o){this.item.rectangle=o}}});Object.defineProperties(cl.prototype,{HighLight:{set:function(o){o&&(this.item.material=this.item.polygon.material),o?this.item.polygon.material=new no(this._viewer,this._cesium).colorFromHtmlColor(this._core.selectedColor):this.item.polygon.material=this.item.material}},polygonShow:{set:Ji.debounce(function(o){this.item.polygon.show=o},500),get:function(){return this.item.polygon.b}},polygonHeight:{set:Ji.debounce(function(o){this._core.isnull(o)||(/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.height=o)},500),get:function(){var o=this.item.polygon.height;if(o)return o._value}},polygonHeightReference:{set:Ji.debounce(function(o){this._core.isnull(o)||(this.item.polygon.heightReference=o)},500),get:function(){var o=this.item.polygon.heightReference;if(o)return o._value}},polygonExtrudedHeight:{set:Ji.debounce(function(o){this._core.isnull(o)||(/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.extrudedHeight=o)},500),get:function(){var o=this.item.polygon.extrudedHeight;if(o)return o._value}},polygonExtrudedHeightReference:{set:Ji.debounce(function(o){this._core.isnull(o)||(this.item.polygon.extrudedHeightReference=o)},500),get:function(){var o=this.item.polygon.extrudedHeightReference;if(o)return o._value}},polygonFill:{set:Ji.debounce(function(o){this.item.polygon.fill=o},500),get:function(){var o=this.item.polygon.fill;if(o)return o._value}},polygonMaterial:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.polygon.material=o,this.item.material=this.item.polygon.material)},500),get:function(){var o=this.item.polygon.material;try{return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}catch{}}},polygonMaterialAlpha:{set:Ji.debounce(function(o){this._core.isnull(o)||(this.item.polygon.material.color.alpha=o)},500),get:function(){this.item.polygon.material;try{return this.item.polygon.material.color.alpha}catch{}}},polygonOutline:{set:Ji.debounce(function(o){this._core.isnull(o)||(this.item.polygon.outline=o)},500),get:function(){var o=this.item.polygon.outline;if(o)return o._value}},polygonOutlineColor:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.polygon.outlineColor=o)},500),get:function(){var o=this.item.polygon.outlineColor;return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}},polygonOutlineWidth:{set:Ji.debounce(function(o){this._core.isnull(o)||(/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,"")),this.item.polygon.outlineWidth=o)},500),get:function(){var o=this.item.polygon.outlineWidth;if(o)return o._value}}});cl.prototype.setItem=function(o){this.item=o};Object.defineProperties(cl.prototype,{polyline:{get:function(){return this.item.polyline},set:function(o){this.item.polyline=o}}});Object.defineProperties(cl.prototype,{polygon:{get:function(){return this.item.polygon},set:function(o){this.item.polygon=o}}});Object.defineProperties(cl.prototype,{point:{get:function(){return this.item.point},set:function(o){this.item.point=o}}});Object.defineProperties(cl.prototype,{label:{get:function(){return this.item.label},set:function(o){this.item.label=o}}});Object.defineProperties(cl.prototype,{model:{get:function(){return this.item.model},set:function(o){this.item.model=o}}});Object.defineProperties(cl.prototype,{wall:{get:function(){return this.item.wall},set:function(o){this.item.wall=o}}});Object.defineProperties(cl.prototype,{polygonTempOptions:{get:function(){return{height:0,extrudedHeight:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:ShadowMode.DISABLED,classificationType:ClassificationType.BOTH,arcType:ArcType.GEODESIC}}}});Object.defineProperties(cl.prototype,{Visibility:{get:function(){return this.item.show}},PolygonColor:{get:function(){var o=this.item._polygon.material.color._value;if(o)return new no(this._viewer,this._cesium).toHtmlColor("rgb("+o.red*255+","+o.green*255+","+o.blue*255+")")}},PolygonAlpha:{get:function(){if(this.item._polygon.material.color)return this.item._polygon.material.color._value.alpha||1}},Outline:{get:function(){if(this.item._polygon.outline)return this.item._polygon.outline._value}},OutlineColor:{get:function(){var o=this.item._polygon.outlineColor;if(this.item._polygon.outlineColor)return o=o._value,new no(this._viewer,this._cesium).toHtmlColor("rgb("+o.red*255+","+o.green*255+","+o.blue*255+")")}},ExtrudedHeight:{get:function(){if(this.item._polygon.extrudedHeight)return this.item._polygon.extrudedHeight._value}},Height:{get:function(){return this.item._polygon.height}},PolygonImage:{get:function(){if(this.item._polygon.material.uniforms)return this.item._polygon.material.uniforms.image}},PolygonRepeat:{get:function(){if(this.item._polygon.material.uniforms)return this.item._polygon.material.repeat}}});cl.prototype.forceEndHanlder=function(){this._tree.handler&&(this._tree.handler.destroy(),this._tree.handler=void 0)};var gg=cl;function eNi(o,f,m,v){var y=0,x=6378137,C=Math.PI;function w(j){return j*C/180}var A=w((o+m)/2),E=w((o-m)/2),T=w((f-v)/2),S=Math.sin(E),M=Math.sin(T),I=Math.sin(A),P,D,L,R,O,F,k,U=x,G=1/298.257;return S=S*S,M=M*M,I=I*I,P=S*(1-M)+(1-I)*M,D=(1-S)*(1-M)+I*M,L=Math.atan(Math.sqrt(P/D)),R=Math.sqrt(P*D)/L,O=2*L*U,F=(3*R-1)/2/D,k=(3*R+1)/2/P,y=O*(1+G*(F*I*(1-S)-k*(1-I)*S)),y}var op=eNi;var Kr=null;function us(o,f){Kr=f,this._viewer=o,this._cesium=f,this._Color=new no(this._viewer,this._cesium),this._core=new Sr(o,f),this._getPosition=new Ru(this._viewer,this._cesium),this._tree=Ne,this._points=[],this._polylines=[],this._lang={draw_tip_left:"\u5DE6\u952E\u5F00\u59CB\u7ED8\u5236\uFF01",draw_tip_right:"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236\uFF01",draw_tip_click:"\u70B9\u51FB\u7EE7\u7EED\u7ED8\u5236\uFF01",draw_tip_cancel:"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88\uFF01",unit_m:"\u7C73",unit_km:"\u5343\u7C73"}}us.prototype.createPolyline=function(o,f,m,v,y){var x=[];if(Array.isArray(o)){if(!o[0].x&&!o[0].y){if(o[0].length===2)for(var C=0;C<o.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(o[C][0],o[C][1]));else if(o[0].length===3)for(var C=0;C<o.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(o[C][0],o[C][1],o[C][2]))}else if(o[0].z!==void 0)for(var C=0;C<o.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(o[C].x,o[C].y,o[C].z));else for(var C=0;C<o.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(o[C].x,o[C].y));var w=!0;m===2&&(w=!1),this.item=this._viewer.entities.add({polyline:{positions:x,width:10,material:new this._cesium.PolylineGlowMaterialProperty({outlineColor:this._cesium.Color.BLACK,color:new no(this._viewer,this._cesium).colorFromHtmlColor(f)}),clampToGround:w}})}else if(typeof o=="object"){let E=this._core.defaultValue(o.alpha,.6);o.points.forEach(T=>{x.push(Kr.Cartesian3.fromDegrees(T.x,T.y,T.z))}),this.item=this._viewer.entities.add({id:o.id,polyline:{positions:x,width:o.width||4,material:Kr.Color.fromCssColorString(o.color||"#f00").withAlpha(E),clampToGround:o.clampToGround}}),this.item.objectType="polyline"}var A={id:this.item.id,name:y,pId:this._core.isnull(v)?0:v,type:"polyline",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(v)?0:v),this};us.prototype.getstyles=function(){var o={};return o.show=this.item.polyline.show?this.item.polyline.show.getValue():!0,o.positions=this.item.polyline.positions.getValue().toString(),o.width=this.item.polyline.width.toString(),o.granularity=this.item.polyline.granularity?this.item.polyline.granularity.toString():null,o.material={},o.material.color=this.item.polyline.material&&this.item.polyline.material.color&&this.item.polyline.material.color._value?"rgba"+this.item.polyline.material.color.toString():null,o.material.outlineColor=this.item.polyline.material.outlineColor&&this.item.polyline.material.outlineColor._value?"rgba"+this.item.polyline.material.outlineColor.toString():null,o.material.outlineWidth=this.item.polyline.material.outlineWidth&&this.item.polyline.material.outlineWidth._value?this.item.polyline.material.outlineWidth.toString():null,o.classificationType=this.item.polyline.classificationType?this.item.polyline.classificationType.toString():null,o.near=this.item.polyline.distanceDisplayCondition?this.item.polyline.distanceDisplayCondition._value.near:null,o.far=this.item.polyline.distanceDisplayCondition?this.item.polyline.distanceDisplayCondition._value.far:null,o};us.prototype.createLink=function(o,f,m){!m&&(m={});var v=[],y=[];if(o.lon&&o.lat?o.height!==void 0?(v.push(this._cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height)),v.push(this._cesium.Cartesian3.fromDegrees(f.lon,f.lat,f.height)),y.push({x:o.lon,y:o.lat,z:o.height},{x:f.lon,y:f.lat,z:f.height})):(v.push(this._cesium.Cartesian3.fromDegrees(o.lon,o.lat)),v.push(this._cesium.Cartesian3.fromDegrees(f.lon,f.lat)),y.push({x:o.lon,y:o.lat,z:0},{x:f.lon,y:f.lat,z:0})):o.x&&o.y?o.z!==void 0?(v.push(this._cesium.Cartesian3.fromDegrees(o.x,o.y,o.z)),v.push(this._cesium.Cartesian3.fromDegrees(f.x,f.y,f.z)),y.push(o,f)):(v.push(this._cesium.Cartesian3.fromDegrees(o.x,o.y)),v.push(this._cesium.Cartesian3.fromDegrees(f.x,f.y)),o.z=0,f.z=0,y.push(o,f)):o.length===2?(v.push(this._cesium.Cartesian3.fromDegrees(o[0],o[1])),v.push(this._cesium.Cartesian3.fromDegrees(f[0],f[1])),y.push({x:o[0],y:o[1],z:0},{x:f[0],y:f[1],z:0})):o.length===3&&(v.push(this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2])),v.push(this._cesium.Cartesian3.fromDegrees(f[0],f[1],f[2])),y.push({x:o[0],y:o[1],z:o[2]},{x:f[0],y:f[1],z:f[2]})),m.lineType===1?m.material=new this._cesium.PolylineDashMaterialProperty({color:this._core.defaultValue(m.lineColor&&this._cesium.Color.fromCssColorString(m.lineColor),this._cesium.Color.AQUAMARINE)}):m.lineType===2?m.material=new this._cesium.PolylineGlowMaterialProperty({glowPower:.3,color:this._core.defaultValue(m.lineColor&&this._cesium.Color.fromCssColorString(m.lineColor),this._cesium.Color.BLUE)}):m.material=this._core.defaultValue(m.lineColor&&this._cesium.Color.fromCssColorString(m.lineColor),this._cesium.Color.AQUAMARINE),m.cylinder){var x=y[1].z-y[0].z,C=Kr.Cartesian3.fromDegrees(y[0].x,y[0].y,0),w=Kr.Cartesian3.fromDegrees(y[1].x,y[0].y,0),A=this._core.getSpaceDistancem([C,w],this._cesium),E=x===0?Math.PI/2:Math.atan(A/x),T=this._core.getSpaceDistancem(v,this._cesium),S=Kr.Cartesian3.fromDegrees(y[0].x,y[1].y,0);A=this._core.getSpaceDistancem([C,S],this._cesium);var M=Math.asin(A/T);y[0].x>y[1].x&&y[0].y>y[1].y?M=x<0?-M:M:y[0].x>y[1].x&&y[0].y<y[1].y?M=x>=0?-M:M:y[0].x<y[1].x&&y[0].y<=y[1].y?(E=x!==0?-E:E,M=x>0?-M:M):y[0].x<y[1].x&&y[0].y>y[1].y&&(M=x<0?-M:M,E=-E);var I=new Kr.HeadingPitchRoll(0,E,M)}var P=v[0];this.item=this._viewer.entities.add({position:new this._cesium.CallbackProperty(function(){return P},!1),orientation:m.cylinder?new this._cesium.CallbackProperty(function(){return Kr.Transforms.headingPitchRollQuaternion(P,I)},!1):void 0,polyline:{positions:v,width:this._core.defaultValue(m.width,2),material:m.material,clampToGround:!1},cylinder:m.cylinder?{length:this._core.defaultValue(m.length,20),topRadius:this._core.defaultValue(m.size,8),bottomRadius:this._core.defaultValue(m.size,8),material:this._core.defaultValue(m.pointColor&&this._cesium.Color.fromCssColorString(m.pointColor),this._cesium.Color.RED)}:void 0,point:m.cylinder?void 0:{color:this._core.defaultValue(m.pointColor&&this._cesium.Color.fromCssColorString(m.pointColor),this._cesium.Color.RED),outlineColor:this._core.defaultValue(m.outlineColor&&this._cesium.Color.fromCssColorString(m.outlineColor),this._cesium.Color.YELLOW),outlineWidth:this._core.defaultValue(m.outlineWidth,2),pixelSize:this._core.defaultValue(m.size,8)}});var D=this._core.defaultValue(m.num,200),L=this._cesium.Math.lerp(y[0].x,y[1].x,1/D)-y[0].x,R=this._cesium.Math.lerp(y[0].y,y[1].y,1/D)-y[0].y,O=this._cesium.Math.lerp(y[0].z,y[1].z,1/D)-y[0].z,F=[];F.push(v[0]);for(let j=0;j<D;j++){let q=y[0].x+(j+1)*L,J=y[0].y+(j+1)*R,X=y[0].z+(j+1)*O;F.push(this._cesium.Cartesian3.fromDegrees(q,J,X))}F.push(v[1]);var k=this._core.defaultValue(m.speed,1),U=0;this._viewer.clock.onTick.addEventListener(function(){U+=k,U=parseInt(U),(U>=F.length-1&&k>0||U<=0&&k<0)&&(k=-k),P=F[U]});var G={id:this.item.id,name:"\u65B0\u5EFA\u94FE\u8DEF",pId:0,type:"polyline",item:this};return this.setTreeobj(G),this._tree.insertGroupId(G,0),this};us.prototype.createLinkPros=function(o){this._lang=this._core.extend(this._lang,language._lang);var x=this;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var f=[],m=null,v="0\u7C73",y=null,x=this,C,w="",A,E=this._core.CreateTooltip(),T={name:"",spot:[],distance:[],label:[],ployline:[]},S={point:x._cesium.Color.RED,polyline:x._cesium.Color.BLUE};this._tree.handler.setInputAction(function(I){y=x._getPosition.getMousePosition(I),y&&(f.length===0?E.showAt(I.endPosition,x._lang.draw_tip_left):E.showAt(I.endPosition,x._lang.draw_tip_right),f.length>=2&&(x._cesium.defined(m)?(f.length>x._points.length&&f.pop(),f.push(y)):m=new M(f)))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(I){var P=x._viewer.camera.getPickRay(I.position);if(y=x._getPosition.getMousePosition(I),!!y){f.length==0?f.push(y,y):f.length>x._points.length?(f.pop(),f.push(y)):f.push(y,y),f.length>=2&&(x._cesium.defined(m)||(m=new M(f)),v=x._core.getSpaceDistance(f,x._cesium)),A&&(x._viewer.entities.remove(A),A=void 0);var D=v;w="\u603B\u957F\uFF1A"+v,T.spot.push(y),T.distance.push(v)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(I){x.end&&x.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=I=>{if(E.show(!1),x._tree&&x._tree.handler.destroy(),x._core.mouse(x._viewer.container,0,"0"),x.end=void 0,!!m){var P={width:4,lineColor:"#0000ff"},D=m.positions;x._tree&&x._tree.endtemporaryItem(),A&&(x._viewer.entities.remove(A),A=void 0,f.pop()),x._points[x._points.length-1]&&(x._points[x._points.length-1].label.text=w),x._viewer.entities.remove(x.item),!(I==="cancel"||f.length<2)&&(x.item=x._viewer.entities.add({name:"\u65B0\u5EFA\u94FE\u8DEF",polyline:{positions:D,width:x._core.defaultValue(P.width,2),material:x._core.getLinkMaterial(P.lineColor,P.pointColor,P.time),clampToGround:!0}}),o&&o(x.item))}};var M=function(){function I(P){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S.polyline,width:3,clampToGround:!0}},this.positions=P,this._init()}return I.prototype._init=function(){var P=this,D=function(){return P.positions};this.options.polyline.positions=new x._cesium.CallbackProperty(D,!1);var L=x._viewer.entities.add(this.options);x.item=L,x._tree.temporaryItem.obj.push(L),T.ployline.push(L);var R=x._core.getuid();T.name="\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB"+R},I}();return this};us.prototype.createLandingLine=function(o,f={}){var m=[];if(o.lon&&o.lat)m.push(Kr.Cartesian3.fromDegrees(o.lon,o.lat,o.height)),m.push(Kr.Cartesian3.fromDegrees(o.lon,o.lat,0));else if(Array.isArray(o))m.push(Kr.Cartesian3.fromDegrees(o[0],o[1],o[2])),m.push(Kr.Cartesian3.fromDegrees(o[0],o[1],0));else if(o instanceof Kr.Cartesian3){m.push(o);let y=this._core.toDegrees(o);m.push(Kr.Cartesian3.fromDegrees(y.lon,y.lat,0))}this.item=this._viewer.entities.add({name:"\u65B0\u5EFA\u63A5\u5730\u7EBF",polyline:{positions:new Kr.CallbackProperty(function(){return m},!1),width:this._core.defaultValue(f.width,2),material:Kr.Color.fromCssColorString(f.color||"#fff")}}),this.positions={get value(){return m},set value(y){m[0]=y;let x=Kr.Cartographic.fromCartesian(y);x.height=0,m[1]=Kr.Cartographic.toCartesian(x)}};var v={id:this.item.id,name:"\u65B0\u5EFA\u63A5\u5730\u7EBF",pId:0,type:"polyline",item:this};return this.setTreeobj(v),this._tree.insertGroupId(v,0),this};us.prototype.createLinkPro=function(o,f,m){!m&&(m={});var v=[],y=[];o.lon&&o.lat?o.height!==void 0?(v.push(this._cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height)),v.push(this._cesium.Cartesian3.fromDegrees(f.lon,f.lat,f.height)),y.push({x:o.lon,y:o.lat,z:o.height},{x:f.lon,y:f.lat,z:f.height})):(v.push(this._cesium.Cartesian3.fromDegrees(o.lon,o.lat)),v.push(this._cesium.Cartesian3.fromDegrees(f.lon,f.lat)),y.push({x:o.lon,y:o.lat,z:0},{x:f.lon,y:f.lat,z:0})):o.x&&o.y?o.z!==void 0?(v.push(this._cesium.Cartesian3.fromDegrees(o.x,o.y,o.z)),v.push(this._cesium.Cartesian3.fromDegrees(f.x,f.y,f.z)),y.push(o,f)):(v.push(this._cesium.Cartesian3.fromDegrees(o.x,o.y)),v.push(this._cesium.Cartesian3.fromDegrees(f.x,f.y)),o.z=0,f.z=0,y.push(o,f)):o.length===2?(v.push(this._cesium.Cartesian3.fromDegrees(o[0],o[1])),v.push(this._cesium.Cartesian3.fromDegrees(f[0],f[1])),y.push({x:o[0],y:o[1],z:0},{x:f[0],y:f[1],z:0})):o.length===3&&(v.push(this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2])),v.push(this._cesium.Cartesian3.fromDegrees(f[0],f[1],f[2])),y.push({x:o[0],y:o[1],z:o[2]},{x:f[0],y:f[1],z:f[2]})),this.item=this._viewer.entities.add({name:"\u65B0\u5EFA\u94FE\u8DEF",polyline:{positions:v,width:this._core.defaultValue(m.width,2),material:this._core.getLinkMaterial(m.lineColor,m.pointColor,m.time),clampToGround:m.clampToGround}});var x={id:this.item.id,name:"\u65B0\u5EFA\u94FE\u8DEF",pId:0,type:"polyline",item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,0),this};us.prototype.executePolyline=function(o,f){this._lang=this._core.extend(this._lang,language._lang);var m={},v=this,y=function(){function E(T){this.options={polyline:{show:!0,positions:[],material:new v._cesium.PolylineOutlineMaterialProperty({color:v._core.defaultValue(o.color,v._cesium.Color.YELLOW)}),clampToGround:v._core.defaultValue(o.clampToGround,!0),width:v._core.defaultValue(o.width,3)}},this.positions=T,this._init()}return E.prototype._init=function(){var T=this,S=function(){return T.positions};this.options.polyline.positions=new v._cesium.CallbackProperty(S,!1),this.polyline=v._viewer.entities.add(this.options),v.item=this.polyline},E}(),x=new v._cesium.ScreenSpaceEventHandler(v._viewer.scene.canvas),C=[],w=void 0,A=this._core.CreateTooltip();return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),x.setInputAction(function(E){var T=v._getPosition.getMousePosition(E);C.length==0&&C.push(T.clone()),C.push(T)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),x.setInputAction(function(E){C.length===0?A.showAt(E.endPosition,v._lang.draw_tip_left):A.showAt(E.endPosition,v._lang.draw_tip_right);var T=v._getPosition.getMousePosition(E);C.length>=2&&(v._cesium.defined(w)?T!=null&&(C.pop(),T.y+=1+Math.random(),C.push(T)):w=new y(C))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),x.setInputAction(function(E){A.show(!1);var T={polyline:{},positions:[],positionsp:[],distance:[]};T.setDistance=function(){alert("qq")},x.destroy(),T.polyline=w;for(var S=[],M=0;M<C.length;M++){var I=v._cesium.Cartographic.fromCartesian(C[M]),P=v._cesium.Math.toDegrees(I.longitude),D=v._cesium.Math.toDegrees(I.latitude),L=I.height;S.push({lon:P,lat:D,hei:L})}T.positions=S;for(var R=1;R<C.length;R++)T.distance[R-1]=op(C[R-1].y,C[R-1].x,C[R].y,C[R].x);T.positionsp=C,v._core.mouse(v._viewer.container,0,"0"),typeof f=="function"&&f(T)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this};us.prototype.executePolyline1=function(o,f){this._lang=this._core.extend(this._lang,language._lang);let m;(typeof o=="object"||typeof f=="function")&&(m=f,f=o,o=m),m=null;var w=this;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var v=[],y=null,x="0\u7C73",C=null,w=this,A,E="",T,S=this._core.CreateTooltip(),M={name:"",spot:[],distance:[],label:[],ployline:[]},I={point:w._cesium.Color.RED,polyline:w._cesium.Color.YELLOW};Object.keys(f).length>0&&(f.point!=""&&f.point!=null&&(I.point=f.point),f.polyline!=""&&f.polyline!=null&&(I.polyline=f.polyline));let P;this._tree.handler.setInputAction(function(L){C=w._getPosition.getMousePosition(L),C&&(v.length===0?S.showAt(L.endPosition,w._lang.draw_tip_left):S.showAt(L.endPosition,w._lang.draw_tip_right),v.length>=2&&(w._cesium.defined(y)?(v.length>w._points.length&&v.pop(),v.push(C)):y=new D(v),x=w._core.getSpaceDistance(v,w._cesium)),T&&(w._viewer.entities.remove(T),T=void 0),T=w._viewer.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v[v.length-1],label:{text:"\u603B\u957F\uFF1A"+x,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,P*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),w._tree.temporaryItem.obj.push(T))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(L){var R=w._viewer.camera.getPickRay(L.position);if(C=w._getPosition.getMousePosition(L),!!C){!P&&(P=w._core.getPointToCameraDistance(w._viewer,C)),v.length==0?v.push(C,C):v.length>w._points.length?(v.pop(),v.push(C)):v.push(C,C),v.length>=2&&(w._cesium.defined(y)||(y=new D(v)),x=w._core.getSpaceDistance(v,w._cesium)),T&&(w._viewer.entities.remove(T),T=void 0);var O=x;E="\u603B\u957F\uFF1A"+x,A=w._viewer.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v[v.length-1],point:{pixelSize:5,color:I.point.withAlpha(.5),outlineColor:w._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,P*1.5),outlineWidth:2,clampToGround:!0},label:{text:O,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,P*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),w._tree.temporaryItem.obj.push(A),w._points.push(A),M.spot.push(C),M.distance.push(x),M.label.push(A)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(L){w.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(L){if(S.show(!1),w._tree&&w._tree.endtemporaryItem(),w.end=void 0,T&&(w._viewer.entities.remove(T),T=void 0,v.pop()),w._points[w._points.length-1]&&(w._points[w._points.length-1].label.text=E),w._tree&&w._tree.handler.destroy(),w._core.mouse(w._viewer.container,0,"0"),L==="cancel"){w.deleteObject();return}v.length<2&&w.deleteObject(),o!=""&&o!=null&&typeof o=="function"&&o(M)};var D=function(){function L(R){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:I.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,P*1.5),width:3,clampToGround:!1}},this.positions=R,this._init()}return L.prototype._init=function(){var R=this,O=function(){return R.positions};this.options.polyline.positions=new w._cesium.CallbackProperty(O,!1);var F=w._viewer.entities.add(this.options);w.item=F,w._tree.temporaryItem.obj.push(F),M.ployline.push(F);var k=w._core.getuid();M.name="\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB"+k},L}();return this};us.prototype.spaceDistance=us.prototype.executePolyline1;us.prototype.executeHorizontal=function(o,f){this._lang=this._core.extend(this._lang,language._lang);var C=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var m=[],v=null,y="0\u7C73",x=null,C=this,w,A=[],E="",T,S=this._core.CreateTooltip(),M={spot:[],distance:[],label:[],ployline:[]},I={point:C._cesium.Color.RED,polyline:C._cesium.Color.YELLOW};Object.keys(f).length>0&&(f.point!=""&&f.point!=null&&(I.point=f.point),f.polyline!=""&&f.polyline!=null&&(I.polyline=f.polyline));let P;this._tree.handler.setInputAction(function(R){x=C._getPosition.getMousePosition(R),x&&(m.length===0?S.showAt(R.endPosition,C._lang.draw_tip_left):S.showAt(R.endPosition,C._lang.draw_tip_right),m.length>=2&&(C._cesium.defined(v)?(m.pop(),m.push(x)):v=new L(m),y=C._core.getSpaceDistance(m,C._cesium)),C._viewer.entities.remove(T),T=C._viewer.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:m[m.length-1],label:{text:"\u603B\u957F\uFF1A"+y,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,P*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),C._tree.temporaryItem.obj.push(T))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(R){var O=C._viewer.camera.getPickRay(R.position);if(x=C._getPosition.getMousePosition(R),!!x){!P&&(P=C._core.getPointToCameraDistance(C._viewer,x)),D(x),m.length==0&&m.push(x.clone()),m.push(x);var F=y;E="\u603B\u957F\uFF1A"+y,w=C._viewer.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:m[m.length-1],point:{pixelSize:5,color:I.point.withAlpha(.5),outlineColor:C._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,P*1.5),outlineWidth:2,clampToGround:!0},label:{text:F,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,P*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),C._tree.temporaryItem.obj.push(w),C._points.push(w),M.spot.push(x),M.distance.push(y),M.label.push(w)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK);var D=function(R){polylineCartographic.push(R);var O=[];if(polylineCartographic.length>1){var F=polylineCartographic[polylineCartographic.length-2],k=polylineCartographic[polylineCartographic.length-1],U=Math.abs(F.longitude-k.longitude)*1e7,G=Math.abs(F.latitude-k.latitude)*1e7;U>G&&(G=U);var j=parseInt(G/10);j>1e3&&(j=1e3),j<2&&(j=2);for(var q=0;q<j;++q)O.push(new C._cesium.Cartographic(C._cesium.Math.lerp(F.longitude,k.longitude,q/(j-1)),C._cesium.Math.lerp(F.latitude,k.latitude,q/(j-1))))}else O=polylineCartographic;if(O.length>0)for(var J=0;J<O.length;J++){var R=O[J],X=C._viewer.scene.globe.getHeight(R),Y=C._cesium.Cartesian3.fromDegrees(R.longitude/Math.PI*180,R.latitude/Math.PI*180,X);A.push(Y)}};this._tree.handler.setInputAction(function(R){S.show(!1),C._tree.endtemporaryItem(),C._viewer.entities.remove(T),C._points[C._points.length-1].label.text=E,C._tree.handler.destroy(),m.pop(),o!=""&&o!=null&&typeof o=="function"&&o(M)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);var L=function(){function R(O){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:I.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,P*1.5),width:3,clampToGround:!1}},this.positions=O,this._init()}return R.prototype._init=function(){var O=this,F=function(){return O.positions};this.options.polyline.positions=new C._cesium.CallbackProperty(F,!1);var k=C._viewer.entities.add(this.options);C.item=k,C._tree.temporaryItem.obj.push(k),M.ployline.push(k)},R}();return this};us.prototype.executeHorizontals=function(o,f){this._lang=this._core.extend(this._lang,language._lang);let m;(typeof o=="object"||typeof f=="function")&&(m=f,f=o,o=m),m=null,this._tree.removeHandler(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.starttemporaryItem(this._viewer);var v=this,y=!1,x=[],C="",w=[],A=void 0,E=v._viewer.scene,T=E.globe.ellipsoid,S={name:"",spot:[],distance:[],label:[],polyline:[]},M={point:v._cesium.Color.RED,polyline:v._cesium.Color.YELLOW};Object.keys(f).length>0&&(f.point!=""&&f.point!=null&&(M.point=f.point),f.polyline!=""&&f.polyline!=null&&(M.polyline=f.polyline));var I=new v._cesium.BillboardCollection;E.primitives.add(I);var P=new v._cesium.WebMercatorProjection;this._tree.handler=new v._cesium.ScreenSpaceEventHandler(E.canvas);var D=this._core.CreateTooltip(),L=[],R=void 0,O=[],F;y=!0;let k;this._tree.handler.setInputAction(function(q){var J,X;if(x.length===0?D.showAt(q.endPosition,v._lang.draw_tip_left):D.showAt(q.endPosition,v._lang.draw_tip_right),J=v._getPosition.getMousePosition(q,S.polyline.concat(S.label)),!!J&&(X=v._cesium.Ellipsoid.WGS84.cartesianToCartographic(J),X)){var Y=J;if(y){if(x.length<1)return;v._cesium.defined(A)?(A.path.pop(),A.path.push(Y),O.pop(),O.push(Y)):A=new j(x,v._cesium);var Q=G(O);F&&(v._viewer.entities.remove(F),F=void 0),F=v._viewer.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:A.path[A.path.length-1],label:{text:"\u603B\u957F\uFF1A"+Q,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,k*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},v._cesium.ScreenSpaceEventType.MOUSE_MOVE);var U=function(q){w.push(q);var J=[];if(w.length>1){var X=w[w.length-2],Y=w[w.length-1],Q=Math.abs(X.longitude-Y.longitude)*1e7,ee=Math.abs(X.latitude-Y.latitude)*1e7;Q>ee&&(ee=Q);var z=parseInt(ee/10);z>1e3&&(z=1e3),z<2&&(z=2);for(var ie=0;ie<z;++ie)J.push(new v._cesium.Cartographic(v._cesium.Math.lerp(X.longitude,Y.longitude,ie/(z-1)),v._cesium.Math.lerp(X.latitude,Y.latitude,ie/(z-1))));J.push(Y.clone())}else J=w;if(J.length>0)for(var re=0;re<J.length;re++){var q=J[re],ne=v._viewer.scene.globe.getHeight(q),oe=v._cesium.Cartesian3.fromRadians(q.longitude,q.latitude,ne);O.push(oe)}};this._tree.handler.setInputAction(function(q){var J=v._getPosition.getMousePosition(q,S.polyline.concat(S.label)),X;if(J&&(X=v._cesium.Ellipsoid.WGS84.cartesianToCartographic(J)),X){!k&&(k=v._core.getPointToCameraDistance(v._viewer,J));var Y=J;if(y){O.length>0&&O.pop(),U(X),x.length===0?x.push(Y,Y):x.push(Y),v._cesium.defined(A)||(A=new j(x,v._cesium)),F&&(v._viewer.entities.remove(F),F=void 0);var Q="0\u7C73";A&&(Q=G(O)),O.push(Y),C="\u603B\u957F\uFF1A"+Q,S.spot.push(Y),S.distance.push(Q);var ee=v._viewer.entities.add({position:Y,point:{pixelSize:5,color:M.point.withAlpha(.5),outlineColor:v._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,k*1.5),outlineWidth:1,clampToGround:!0},label:{text:Q,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,k*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});S.label.push(ee),v._points.push(ee)}}},v._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(){v.end()},v._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(q){if(v._tre&&v._tree.endtemporaryItem(),F&&v._viewer.entities.remove(F),v._points[v._points.length-1]&&(v._points[v._points.length-1].label.text=C),v._tree&&v._tree.handler.destroy(),v.end=void 0,v._core.mouse(v._viewer.container,0,"0"),x.pop(),D.show(!1),q==="cancel"){v.deleteObject();return}x.length<2&&v.deleteObject(),o!=""&&o!=null&&typeof o=="function"&&o(S)};var G=function(q){for(var J=0,X=0+v._lang.unit_m,Y,Q,ee,z,ie,re,ne=0;ne<q.length-1;ne++)Y=T.cartesianToCartographic(q[ne]),Q=P.project(Y),ee=Q.x,z=Q.y,Y=T.cartesianToCartographic(q[ne+1]),Q=P.project(Y),ie=Q.x,re=Q.y,J=J+Math.sqrt((ee-ie)*(ee-ie)+(z-re)*(z-re));return J>0&&(X=J.toFixed(2)+v._lang.unit_m),J/1e3>=1&&(X=(J/1e3).toFixed(2)+v._lang.unit_km),X},j=function(){function q(J,X){if(!v._cesium.defined(J))throw new v._cesium.DeveloperError("positions is required!");if(J.length<2)throw new v._cesium.DeveloperError("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");var Y=v._cesium.Material.fromType(v._cesium.Material.ColorType);Y.uniforms.color=new v._cesium.Color(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:M.polyline,width:3,clampToGround:!0}},this.path=J,this._init(v._cesium)}return q.prototype._init=function(J){var X=this,Y=function(){return X.path};this.options.polyline.positions=new v._cesium.CallbackProperty(Y,!1),this.lineEntity=v._viewer.entities.add(this.options),v.item=this.lineEntity,S.polyline.push(this.lineEntity);var Q=v._core.getuid();S.name="\u65B0\u5EFA\u6C34\u5E73\u8DDD\u79BB"+Q},q}();return this};us.prototype.horizontalDistance=us.prototype.executeHorizontals;us.prototype.getHeight=function(o){var f=this._cesium.Cartographic.fromCartesian(o[0]),m=this._cesium.Cartographic.fromCartesian(o[1]),v=m.height-f.height;return v<1e3?v=v.toFixed(2)+this._lang.unit_m:(v=v/1e3,v=v.toFixed(2)+this._lang.unit_km),v};us.prototype.executeHeight=function(o){this._lang=this._core.extend(this._lang,language._lang);var f,m=this;this._tree.starttemporaryItem(this._viewer),this._tree.removeHandler(),f=this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var v=[],y=null,x=0,C=this._core.CreateTooltip(),w=null,A;let E;this._tree.handler.setInputAction(function(S){w=m._getPosition.getMousePosition(S),w&&(v.length===0?C.showAt(S.endPosition,m._lang.draw_tip_left):C.showAt(S.endPosition,m._lang.draw_tip_right),v.length>=2&&(m._cesium.defined(y)?(v.pop(),v.push(w)):y=new T(v),v.lenght>1&&(x=m._core.getHeight(v,m._cesium))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(S){if(w=m._getPosition.getMousePosition(S),!!w){!E&&(E=m._core.getPointToCameraDistance(m._viewer,w));var M=x+"\u7C73";if(v.length==0){v.push(w.clone()),v.push(w);var I,P=I=m._viewer.entities.add({name:"\u9AD8\u5EA6",position:v[0],point:{pixelSize:5,color:m._cesium.Color.RED.withAlpha(.5),outlineColor:m._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,E*1.5),outlineWidth:2,clampToGround:!0,heightReference:m._cesium.HeightReference.none},label:{text:M,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,E*1.5),pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});m._tree.temporaryItem.obj.push(P),m._points.push(P)}else v.length>=1&&(m._tree.endtemporaryItem(),o!=""&&o!=null&&typeof o=="function"&&o(v))}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(S){m._tree.handler.destroy();var M=x+"\u7C73",I=m._cesium.Cartographic.fromCartesian(v[0]),P=m._cesium.Cartographic.fromCartesian(v[1]),D=m._cesium.Cartesian3.fromDegrees(cesium.Math.toDegrees(I.longitude),m._cesium.Math.toDegrees(I.latitude),P.height),L=m._viewer.entities.add({name:"\u76F4\u7EBF\u8DDD\u79BB",position:D,point:{pixelSize:5,color:m._cesium.Color.RED.withAlpha(.5),outlineColor:m._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,clampToGround:!0,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,E*1.5),heightReference:m._cesium.HeightReference.none},label:{text:M,font:"16px \u5B8B\u4F53",distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,E*1.5),fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});m._tree.temporaryItem.obj.push(L),m._points.push(L)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var T=function(){function S(M){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:m._cesium.Color.YELLOW,clampToGround:!0,width:3},ellipse:{show:!1,material:m._cesium.Color.GREEN.withAlpha(.5),clampToGround:!0,outline:!0}},this.positions=M,this._init3()}return S.prototype._init3=function(){var M=this,I=function(){var D=[];D.push(M.positions[0]);var L=m._cesium.Cartographic.fromCartesian(M.positions[0]);try{var R=m._cesium.Cartographic.fromCartesian(M.positions[1])}catch{return}var O=m._cesium.Cartesian3.fromDegrees(m._cesium.Math.toDegrees(L.longitude),m._cesium.Math.toDegrees(L.latitude),R.height);return D.push(O),D};this.options.polyline.positions=new m._cesium.CallbackProperty(I,!1);var P=m._viewer.entities.add(this.options);m.item=P,m._tree.temporaryItem.obj.push(P)},S}();return this};us.prototype.executeHeightTe=function(o,f){this._lang=this._core.extend(this._lang,language._lang);let m;(typeof o=="object"||typeof f=="function")&&(m=f,f=o,o=m),m=null;var v={point:Kr.Color.RED,polyline:Kr.Color.YELLOW};Object.keys(f).length>0&&(f.point!=""&&f.point!=null&&(v.point=f.point),f.polyline!=""&&f.polyline!=null&&(v.polyline=f.polyline)),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var y,y=this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),x=[],C,w=null,A=null,E,T=this,S={name:"",spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[]},M=this._core.CreateTooltip();let I;this._tree.handler.setInputAction(function(L){if(x.length===0?M.showAt(L.endPosition,T._lang.draw_tip_left):M.showAt(L.endPosition,"\u53F3\u952E\u7ED3\u675F\uFF01"),A=T._getPosition.getMousePosition(L,S.polyline.concat(S.point)),!!A&&x.length>=2)if(T._cesium.defined(w))x.pop(),x.push(A.clone()),C=P(x);else{w=new D(x);var R=T._viewer.entities.add({name:"\u9AD8\u5EA6\u6D4B\u91CF",position:new T._cesium.CallbackProperty(function(){return x[1]},!1),point:{pixelSize:5,color:v.point.withAlpha(.5),outlineColor:T._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),heightReference:T._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});T._tree.temporaryItem.obj.push(R),S.point.push(R),T._points.push(R),C=P(x);var O=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return T._cesium.Cartesian3.midpoint(C.eq_lon_lat[0],C.eq_lon_lat[1],new T._cesium.Cartesian3)},!1),name:"\u7B49\u7ECF\u7EAC\u5EA6",polyline:{show:!0,positions:new T._cesium.CallbackProperty(function(){return C.eq_lon_lat},!1),material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),width:2},label:{text:new T._cesium.CallbackProperty(function(){var k=T.getHeight(C.eq_lon_lat),U=T._lang.unit_m,G=k;k.indexOf("\u5343\u7C73")!==-1?(U=T._lang.unit_km,G=k.replace("\u5343\u7C73","")):G=k.replace("\u7C73","");var G=parseFloat(G);return G<0&&(G=Math.abs(G)),k=G+U,k="\u9AD8\u5EA6\uFF1A"+k,S.gddistance=k,k},!1),font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});S.polyline.push(O),T._polylines.push(O);var F=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return T._cesium.Cartesian3.midpoint(C.eq_height[0],C.eq_height[1],new T._cesium.Cartesian3)},!1),name:"\u7B49\u9AD8\u5EA6\u76F4\u7EBF",polyline:{show:!0,positions:new T._cesium.CallbackProperty(function(){return C.eq_height},!1),material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),width:2},label:{text:new T._cesium.CallbackProperty(function(){var k=T._core.getHorizontalDistance(C.eq_height,T._cesium);return k="\u6C34\u5E73\u8DDD\u79BB\uFF1A"+k,S.spdistance=k,k},!1),font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});S.polyline.push(F),T._polylines.push(F)}},T._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(L){if(A=T._getPosition.getMousePosition(L,S.polyline.concat(S.point)),!!A){if(!I&&(I=T._core.getPointToCameraDistance(T._viewer,A)),x.length==0){x.push(A.clone()),x.push(A.clone()),C=P(x);var R=E=T._viewer.entities.add({name:"\u9AD8\u5EA6\u6D4B\u91CF",position:x[0],point:{pixelSize:5,color:v.point.withAlpha(.5),outlineColor:T._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),heightReference:T._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});T._tree.temporaryItem.obj.push(R),S.point.push(R),T._points.push(R)}else if(x.length>=2)if(T._cesium.defined(w))x.pop(),x.push(A.clone()),C=P(x);else{w=new D(x);var O=T._viewer.entities.add({name:"\u9AD8\u5EA6\u6D4B\u91CF",position:new T._cesium.CallbackProperty(function(){return x[1]},!1),point:{pixelSize:5,color:v.point.withAlpha(.5),outlineColor:T._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),heightReference:T._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});T._tree.temporaryItem.obj.push(O),S.point.push(O),T._points.push(O),C=P(x);var F=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return T._cesium.Cartesian3.midpoint(C.eq_lon_lat[0],C.eq_lon_lat[1],new T._cesium.Cartesian3)},!1),name:"\u7B49\u7ECF\u7EAC\u5EA6",polyline:{show:!0,positions:new T._cesium.CallbackProperty(function(){return C.eq_lon_lat},!1),material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),width:2},label:{text:new T._cesium.CallbackProperty(function(){var U=T.getHeight(C.eq_lon_lat),G=T._lang.unit_m,j=U;U.indexOf("\u5343\u7C73")!==-1?(G=T._lang.unit_km,j=U.replace("\u5343\u7C73","")):j=U.replace("\u7C73","");var j=parseFloat(j);return j<0&&(j=Math.abs(j)),U=j+G,U="\u9AD8\u5EA6\uFF1A"+U,S.gddistance=U,U},!1),font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});S.polyline.push(F),T._polylines.push(F);var k=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return T._cesium.Cartesian3.midpoint(C.eq_height[0],C.eq_height[1],new T._cesium.Cartesian3)},!1),name:"\u7B49\u9AD8\u5EA6\u76F4\u7EBF",polyline:{show:!0,positions:new T._cesium.CallbackProperty(function(){return C.eq_height},!1),material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),width:2},label:{text:new T._cesium.CallbackProperty(function(){var U=T._core.getHorizontalDistance(C.eq_height,T._cesium);return U="\u6C34\u5E73\u8DDD\u79BB\uFF1A"+U,S.spdistance=U,U},!1),font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});S.polyline.push(k),T._polylines.push(k)}}},T._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(L){T.end()},T._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(L){T.end()},T._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.end=function(L){if(T._tree.handler.destroy(),M.show(!1),T.end=void 0,T._tree.endtemporaryItem(),T._core.mouse(T._viewer.container,0,"0"),L==="cancel"){T.deleteObject();return}o!=""&&o!=null&&typeof o=="function"&&o(S)};function P(L){var R=T._cesium.Cartographic.fromCartesian(L[0]),O=T._cesium.Cartographic.fromCartesian(L[1]),F=O.height-(O.height-R.height),k,U,G;return O.height-R.height>0?(k=T._cesium.Cartesian3.fromDegrees(T._cesium.Math.toDegrees(R.longitude),T._cesium.Math.toDegrees(R.latitude),O.height),U=[L[1],k],G=[L[0],k]):(k=T._cesium.Cartesian3.fromDegrees(T._cesium.Math.toDegrees(O.longitude),T._cesium.Math.toDegrees(O.latitude),R.height),U=[L[0],k],G=[L[1],k]),{new:k,eq_height:U,eq_lon_lat:G}}var D=function(){function L(O){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),width:2},label:{font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,I*1.5),pixelOffset:new Kr.Cartesian2(20,20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=O,this._init()}function R(O){var F=T._cesium.Cartographic.fromCartesian(O[0]),k=T._cesium.Cartographic.fromCartesian(O[1]),U=new T._cesium.EllipsoidGeodesic;U.setEndPoints(F,k);var G=U.surfaceDistance;return G=Math.sqrt(Math.pow(G,2)+Math.pow(k.height-F.height,2)),G>=1e3?G=(G/1e3).toFixed(2)+T._lang.unit_km:G=G.toFixed(2)+T._lang.unit_m,G}return L.prototype._init=function(){var O=this,F=function(){return O.positions},k=function(){return T._cesium.Cartesian3.midpoint(C.eq_height[0],C.eq_height[1],new T._cesium.Cartesian3)},U=function(){var q=R(O.positions);return q="\u7A7A\u95F4\u8DDD\u79BB\uFF1A"+q,S.kjdistance=q,q};this.options.polyline.positions=new T._cesium.CallbackProperty(F,!1),this.options.position=new T._cesium.CallbackProperty(k,!1),this.options.label.text=new T._cesium.CallbackProperty(U,!1);var G=T._viewer.entities.add(this.options);T.item=G,T._tree.temporaryItem.obj.push(G),S.polyline.push(G);var j=T._core.getuid();S.name="\u65B0\u5EFA\u5782\u76F4\u9AD8\u5EA6"+j},L}();return this};us.prototype.verticalHeight=us.prototype.executeHeightTe;us.prototype.executeHeightTe1=function(o){this._lang=this._core.extend(this._lang,language._lang),this._tree.removeHandler();var f;this._tree.starttemporaryItem(this._viewer);var f=this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),m=[],v=[],y=[],x,C=null,w=null,A=null,E=null,T,S=this,M={spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[]},I=this._core.CreateTooltip();this._tree.handler.setInputAction(function(O){m.length===0?I.showAt(O.endPosition,S._lang.draw_tip_left):I.showAt(O.endPosition,S._lang.draw_tip_right),E=S._getPosition.getMousePosition(O),!!E&&m.length>=2&&(S._cesium.defined(C)?(m.pop(),m.push(E.clone()),x=P(m)):C=new D(m),S._cesium.define(w)||(w=new L(m)),S._cesium.define(A)||(A=new R(m)))},S._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(O){if(m.length==0){if(E=S._getPosition.getMousePosition(O),!E)return;m.push(E.clone()),m.push(E.clone()),x=P(m);var F=T=S._viewer.entities.add({name:"\u9AD8\u5EA6\u6D4B\u91CF",position:m[0],point:{pixelSize:5,color:S._cesium.Color.RED.withAlpha(.5),outlineColor:S._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:S._cesium.HeightReference.none}});S._tree.temporaryItem.obj.push(F),M.point.push(F)}},S._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(O){S._tree.handler.destroy(),I.show(!1),S._tree.endtemporaryItem(),o!=""&&o!=null&&typeof o=="function"&&o(M)},S._cesium.ScreenSpaceEventType.RIGHT_CLICK);function P(O){var F=S._cesium.Cartographic.fromCartesian(O[0]),k=S._cesium.Cartographic.fromCartesian(O[1]),U=k.height-(k.height-F.height),G=S._cesium.Cartesian3.fromDegrees(S._cesium.Math.toDegrees(F.longitude),S._cesium.Math.toDegrees(F.latitude),k.height);return G}var D=function(){function O(k){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S._cesium.Color.GOLD,width:2},label:{font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=k,this._init()}function F(k){var U=S._cesium.Cartographic.fromCartesian(k[0]),G=S._cesium.Cartographic.fromCartesian(k[1]),j=new S._cesium.EllipsoidGeodesic;j.setEndPoints(U,G);var q=j.surfaceDistance;return q=Math.sqrt(Math.pow(q,2)+Math.pow(G.height-U.height,2)),q>=1e3?q=(q/1e3).toFixed(2)+S._lang.unit_km:q=q.toFixed(2)+S._lang.unit_m,q}return O.prototype._init=function(){var k=this,U=function(){return k.positions},G=function(){return k.positions[1].clone()},j=function(){var J=F(k.positions);return J="\u7A7A\u95F4\u8DDD\u79BB\uFF1A"+J,M.kjdistance=J,J};this.options.polyline.positions=new S._cesium.CallbackProperty(U,!1),this.options.position=new S._cesium.CallbackProperty(G,!1),this.options.label.text=new S._cesium.CallbackProperty(j,!1);var q=S._viewer.entities.add(this.options);S._tree.temporaryItem.obj.push(q),M.polyline.push(q)},O}(),L=function(){function O(k){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S._cesium.Color.GOLD,width:2},label:{font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=k,this._init()}function F(k){var U=S._cesium.Cartographic.fromCartesian(k[0]),G=S._cesium.Cartographic.fromCartesian(k[1]),j=new S._cesium.EllipsoidGeodesic;j.setEndPoints(U,G);var q=j.surfaceDistance;return q=Math.sqrt(Math.pow(q,2)+Math.pow(G.height-U.height,2)),q>=1e3?q=(q/1e3).toFixed(2)+S._lang.unit_km:q=q.toFixed(2)+S._lang.unit_m,q}return O.prototype._init=function(){var k=this,U=function(){return k.positions},G=function(){return k.positions[1].clone()},j=function(){var J=F(k.positions);return J="\u7A7A\u95F4\u8DDD\u79BB\uFF1A"+J,M.kjdistance=J,J};this.options.polyline.positions=new S._cesium.CallbackProperty(U,!1),this.options.position=new S._cesium.CallbackProperty(G,!1),this.options.label.text=new S._cesium.CallbackProperty(j,!1);var q=S._viewer.entities.add(this.options);S._tree.temporaryItem.obj.push(q),M.polyline.push(q)},O}(),R=function(){function O(k){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:S._cesium.Color.GOLD,width:2},label:{font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=k,this._init()}function F(k){var U=S._cesium.Cartographic.fromCartesian(k[0]),G=S._cesium.Cartographic.fromCartesian(k[1]),j=new S._cesium.EllipsoidGeodesic;j.setEndPoints(U,G);var q=j.surfaceDistance;return q=Math.sqrt(Math.pow(q,2)+Math.pow(G.height-U.height,2)),q>=1e3?q=(q/1e3).toFixed(2)+S._lang.unit_km:q=q.toFixed(2)+S._lang.unit_m,q}return O.prototype._init=function(){var k=this,U=function(){return k.positions},G=function(){return k.positions[1].clone()},j=function(){var J=F(k.positions);return J="\u7A7A\u95F4\u8DDD\u79BB\uFF1A"+J,M.kjdistance=J,J};this.options.polyline.positions=new S._cesium.CallbackProperty(U,!1),this.options.position=new S._cesium.CallbackProperty(G,!1),this.options.label.text=new S._cesium.CallbackProperty(j,!1);var q=S._viewer.entities.add(this.options);S._tree.temporaryItem.obj.push(q),M.polyline.push(q)},O}();return this};us.prototype.executeAngle=function(o,f){this._lang=this._core.extend(this._lang,language._lang);let m;(typeof o=="object"||typeof f=="function")&&(m=f,f=o,o=m),m=null;var v={point:Kr.Color.RED,polyline:Kr.Color.YELLOW};Object.keys(f).length>0&&(f.point!=""&&f.point!=null&&(v.point=f.point),f.polyline!=""&&f.polyline!=null&&(v.polyline=f.polyline)),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer);var y,y=this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),x=[],C,w=null,A=null,E,T=this,S,M,I,P,D={name:"",spot:[],kjdistance:"",spdistance:"",gddistance:"",point:[],polyline:[],labels:[]},L=this._core.CreateTooltip();let R;this._tree.handler.setInputAction(function(k){if(x.length===0?L.showAt(k.endPosition,T._lang.draw_tip_left):L.showAt(k.endPosition,"\u53F3\u952E\u7ED3\u675F\uFF01"),A=T._getPosition.getMousePosition(k,D.polyline.concat(D.point)),!!A&&x.length>=2){var U=T._core.ElevationAngle(M,A,T._cesium),G="",j="";if(M.z<=A.z?(G="\u89D2\u5EA6\uFF1A"+(90-Math.abs(U)).toFixed(2),j="\u89D2\u5EA6\uFF1A"+Math.abs(U).toFixed(2)):(G="\u89D2\u5EA6\uFF1A"+Math.abs(U).toFixed(2),j="\u89D2\u5EA6\uFF1A"+(90-Math.abs(U)).toFixed(2)),S.label.text=G,T._cesium.defined(w)?(I.position.setValue(A),I.label.text=j):(I=T._viewer.entities.add({position:A,name:"\u7B49\u7ECF\u7EAC\u5EA6",label:{text:j,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.labels.push(I),T._points.push(I)),T._cesium.defined(w))x.pop(),x.push(A.clone()),C=O(x);else{w=new F(x);var q=T._viewer.entities.add({name:"\u89D2\u5EA6\u6D4B\u91CF",position:new T._cesium.CallbackProperty(function(){return x[1]},!1),point:{pixelSize:5,color:v.point.withAlpha(.5),outlineColor:T._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),outlineWidth:2,heightReference:T._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});T._tree.temporaryItem.obj.push(q),D.point.push(q),T._points.push(q),C=O(x);var J=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return x[0]},!1),name:"\u7B49\u7ECF\u7EAC\u5EA6",polyline:{show:!0,positions:new T._cesium.CallbackProperty(function(){return C.eq_lon_lat},!1),material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),width:2}});D.polyline.push(J),T._polylines.push(J);var X=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return x[1]},!1),name:"\u7B49\u9AD8\u5EA6\u76F4\u7EBF",polyline:{show:!0,positions:new T._cesium.CallbackProperty(function(){return C.eq_height},!1),material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),width:2}});D.polyline.push(X),T._polylines.push(X)}}},T._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(k){if(A=T._getPosition.getMousePosition(k,D.polyline.concat(D.point)),!!A){if(!R&&(R=T._core.getPointToCameraDistance(T._viewer,A)),x.length==0){M=A,S=T._viewer.entities.add({position:A,name:"\u7B49\u7ECF\u7EAC\u5EA6",label:{text:"0",font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),D.labels.push(S);var U=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return T._cesium.Cartesian3.midpoint(C.eq_lon_lat[0],C.eq_lon_lat[1],new T._cesium.Cartesian3)},!1),label:{font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});x.push(A.clone()),x.push(A.clone()),C=O(x);var G=E=T._viewer.entities.add({name:"\u9AD8\u5EA6\u6D4B\u91CF",position:x[0],point:{pixelSize:5,color:v.point.withAlpha(.5),outlineColor:T._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:T._cesium.HeightReference.none,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY}});T._tree.temporaryItem.obj.push(G),D.point.push(G),T._points.push(S,G)}else if(x.length>=2)if(T._cesium.defined(w))x.pop(),x.push(A.clone()),C=O(x);else{w=new F(x);var j=T._viewer.entities.add({name:"\u9AD8\u5EA6\u6D4B\u91CF",position:new T._cesium.CallbackProperty(function(){return x[1]},!1),point:{pixelSize:5,color:v.point.withAlpha(.5),outlineColor:T._cesium.Color.WHITE.withAlpha(.5),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),outlineWidth:2,heightReference:T._cesium.HeightReference.none,disableDepthTestDistance:Number.POSITIVE_INFINITY}});T._tree.temporaryItem.obj.push(j),D.point.push(j),T._points.push(j),C=O(x);var U=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return T._cesium.Cartesian3.midpoint(C.eq_lon_lat[0],C.eq_lon_lat[1],new T._cesium.Cartesian3)},!1),name:"\u7B49\u7ECF\u7EAC\u5EA6",polyline:{show:!0,positions:new T._cesium.CallbackProperty(function(){return C.eq_lon_lat},!1),material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),width:2},label:{text:new T._cesium.CallbackProperty(function(){var X=T.getHeight(C.eq_lon_lat),Y=T._lang.unit_m,Q=X;X.indexOf("\u5343\u7C73")!==-1?(Y=T._lang.unit_km,Q=X.replace("\u5343\u7C73","")):Q=X.replace("\u7C73","");var Q=parseFloat(Q);return Q<0&&(Q=Math.abs(Q)),X=Q+Y,X="\u9AD8\u5EA6\uFF1A"+X,D.gddistance=X,X},!1),font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});D.polyline.push(U),T._polylines.push(U);var q=T._viewer.entities.add({position:new T._cesium.CallbackProperty(function(){return T._cesium.Cartesian3.midpoint(C.eq_height[0],C.eq_height[1],new T._cesium.Cartesian3)},!1),name:"\u7B49\u9AD8\u5EA6\u76F4\u7EBF",polyline:{show:!0,positions:new T._cesium.CallbackProperty(function(){return C.eq_height},!1),material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),width:2},label:{text:new T._cesium.CallbackProperty(function(){var X=T._core.ElevationAngle(firtP,A,T._cesium);return X="\u89D2\u5EA6\uFF1A"+X.toFixed(2),D.spdistance=X,X},!1),font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(60,-20),distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});D.polyline.push(q),T._polylines.push(q)}}},T._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(k){T.end()},T._cesium.ScreenSpaceEventType.RIGHT_CLICK),this._tree.handler.setInputAction(function(k){T.end()},T._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this.end=function(k){if(T._tree.handler.destroy(),L.show(!1),T._tree.endtemporaryItem(),T.end=void 0,T._core.mouse(T._viewer.container,0,"0"),k==="cancel"){T.deleteObject();return}o!=""&&o!=null&&typeof o=="function"&&(this.labels=D.labels,o(D))};function O(k){var U=T._cesium.Cartographic.fromCartesian(k[0]),G=T._cesium.Cartographic.fromCartesian(k[1]),j=G.height-(G.height-U.height),q,J,X;return G.height-U.height>0?(q=T._cesium.Cartesian3.fromDegrees(T._cesium.Math.toDegrees(U.longitude),T._cesium.Math.toDegrees(U.latitude),G.height),J=[k[1],q],X=[k[0],q]):(q=T._cesium.Cartesian3.fromDegrees(T._cesium.Math.toDegrees(G.longitude),T._cesium.Math.toDegrees(G.latitude),U.height),J=[k[0],q],X=[k[1],q]),{new:q,eq_height:J,eq_lon_lat:X}}var F=function(){function k(U){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:v.polyline,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),width:2},label:{font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,distanceDisplayCondition:new Kr.DistanceDisplayCondition(0,R*1.5),pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=U,this._init()}return k.prototype._init=function(){var U=this,G=function(){return U.positions},j=function(){return T._cesium.Cartesian3.midpoint(U.positions[0],U.positions[1],new T._cesium.Cartesian3)};this.options.polyline.positions=new T._cesium.CallbackProperty(G,!1),this.options.position=new T._cesium.CallbackProperty(j,!1);var q=T._viewer.entities.add(this.options);T.item=q,T._tree.temporaryItem.obj.push(q),D.polyline.push(q);var J=T._core.getuid();D.name="\u65B0\u5EFA\u5782\u76F4\u9AD8\u5EA6"+J},k}();return this};us.prototype.measureAngle=us.prototype.executeAngle;us.prototype.executeHeightDg=function(o){this._tree.removeHandler();var f=this;this._tree.handler=new f._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas);var m=[],v,y=null,x=null,C;this._tree.handler.setInputAction(function(A){x=f._getPosition.getMousePosition(A),!!x&&m.length>=2&&(f._cesium.defined(y)?(m.pop(),m.push(x.clone()),v=point_conf(m)):y=new w(m))},f._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(A){if(m.length==0){if(x=f._getPosition.getMousePosition(A),!x)return;m.push(x.clone()),m.push(x.clone());var E=C=f._viewer.entities.add({parent:measure_entities,name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:m[0],point:{pixelSize:5,color:f._cesium.Color.RED.withAlpha(.5),outlineColor:f._cesium.Color.WHITE.withAlpha(.5),outlineWidth:2,heightReference:f._cesium.HeightReference.none}})}},f._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(A){f._tree.handler.destroy();var E=[],T=[];E.push(m[0].clone()),E.push(v.clone());var S=f.getHeight(E);f._viewer.entities.add({parent:measure_entities,name:"\u7B49\u7ECF\u7EAC\u5EA6",position:E[0].clone(),polyline:{show:!0,clampToGround:!0,positions:E,material:new f._cesium.PolylineDashMaterialProperty({color:f._cesium.Color.RED}),width:2},label:{text:S,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),T.push(v.clone()),T.push(m[1].clone()),S=getDistance(T)+f._lang.unit_km,f._viewer.entities.add({parent:measure_entities,name:"\u7B49\u9AD8\u5EA6\u76F4\u7EBF",position:T[0].clone(),polyline:{show:!0,positions:T,clampToGround:!0,material:new f._cesium.PolylineDashMaterialProperty({color:f._cesium.Color.RED}),width:2},label:{text:S,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(60,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}})},f._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);var w=function(){function A(E){this.options={parent:measure_entities,name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],clampToGround:!0,material:f._cesium.Color.GOLD,width:2},label:{font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-40),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}},this.positions=E,this._init()}return A.prototype._init=function(){var E=this,T=function(){return E.positions},S=function(){return E.positions[1].clone()},M=function(){var I=getSpaceDistance(E.positions);return I};this.options.polyline.positions=new f._cesium.CallbackProperty(T,!1),this.options.position=new f._cesium.CallbackProperty(S,!1),this.options.label.text=new f._cesium.CallbackProperty(M,!1),f._viewer.entities.add(this.options)},A}()};us.prototype.executeAnge=function(o){var f=this;this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var m=[],v=[],y=null,x=0,C="",w=null,A,E=0,T={spot:[],distance:0,label:{},angle:0};this._tree.handler.setInputAction(function(I){var P=f._viewer.camera.getPickRay(I.endPosition);if(w=f._getPosition.getMousePosition(I),!!w){m.length>=2&&(f._cesium.defined(y)?(m.pop(),m.push(w)):y=new M(m),C=f._core.getSpaceDistance(m,f._cesium));var D=C;f._viewer.entities.remove(A),m.length>1&&(E=(Math.atan2(m[1].y-m[0].y,m[1].x-m[0].x)*180/Math.PI).toFixed(0),A=f._viewer.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:m[m.length-1],label:{text:D+";"+E+"\u5EA6",font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}))}},f._cesium.ScreenSpaceEventType.MOUSE_MOVE);var S=0;this._tree.handler.setInputAction(function(I){S>0&&(f._tree.handler.destroy(),m.pop());var P=f._viewer.camera.getPickRay(I.position);if(w=f._getPosition.getMousePosition(I),!!w){m.length==0&&m.push(w.clone()),m.push(w);var D=C;T.spot.push(w),T.distance=C,T.label=A,f._points.push(A),T.angle=E,S==1&&o!=""&&o!=null&&typeof o=="function"&&o(T),S=S+1}},f._cesium.ScreenSpaceEventType.LEFT_CLICK);var M=function(){function I(P){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:f._cesium.Color.YELLOW,width:3,clampToGround:!0}},this.positions=P,this._init6()}return I.prototype._init6=function(){var P=this,D=function(){return P.positions};this.options.polyline.positions=new f._cesium.CallbackProperty(D,!1);var L=f._viewer.entities.add(this.options);f.item=L},I}();return this};us.prototype.executeProfile=function(o,f){this._lang=this._core.extend(this._lang,language._lang);var m=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var v=[],A=[],y=null,x=o.parameterd,C=o.objid,w=o.cyjj,A=[],E=0,T=this._core.CreateTooltip(),S=null,M,I=0,P={spot:[],min:0,max:0,distance:0,label:{},cys:0,gcs:[]};this._tree.handler.setInputAction(function(O){v.length===0?T.showAt(O.endPosition,m._lang.draw_tip_left):T.showAt(O.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");var F=m._viewer.camera.getPickRay(O.endPosition);S=m._viewer.scene.globe.pick(F,m._viewer.scene);var k=m._viewer.scene.pick(O.endPosition);if(k){var U=m._viewer.scene.pickPosition(O.endPosition);U&&(S=U)}if(!!S){v.length>=2&&(m._cesium.defined(y)?(v.pop(),v.push(S)):y=new R(v),E=m._core.getSpaceDistance(v,m._cesium));var G=E;m._viewer.entities.remove(M),v.length>1&&(I=(Math.atan2(v[1].y-v[0].y,v[1].x-v[0].x)*180/Math.PI).toFixed(0),M=m._viewer.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v[v.length-1],label:{text:G,font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),m._tree.temporaryItem.obj.push(M),m._points.push(M))}},m._cesium.ScreenSpaceEventType.MOUSE_MOVE);var D=0,L=[];this._tree.handler.setInputAction(function(O){D>0&&(m._tree.handler.destroy(),v.pop(),T.show(!1));var F=m._viewer.camera.getPickRay(O.position);S=m._viewer.scene.globe.pick(F,m._viewer.scene);var k=m._viewer.scene.pick(O.position);if(k){var U=m._viewer.scene.pickPosition(O.position);U&&(S=U)}if(!!S){if(v.length==0&&v.push(S.clone()),A.push(S),v.push(S),P.spot.push(S),P.label=M,D==1){m._tree.endtemporaryItem();var G=x,j=m._core.getPmfx(A,G,w,m._cesium,m._viewer,function(J){P.distance=J.juli,P.gcs=J.gcs,P.gcs=J.gcs,P.cys=J.cys,P.max=J.max,P.min=J.min,P.obj=m,T.show(!1),f!=""&&f!=null&&typeof f=="function"&&f(P)})}else{var q={leftX:O.position.x,leftY:O.position.y};L.push(q)}D=D+1}},m._cesium.ScreenSpaceEventType.LEFT_CLICK);var R=function(){function O(F){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:m._cesium.Color.YELLOW,width:2,clampToGround:!0}},this.positions=F,this._init10()}return O.prototype._init10=function(){var F=this,k=function(){return F.positions};this.options.polyline.positions=new m._cesium.CallbackProperty(k,!1);var U=m._viewer.entities.add(this.options);m.item=U,m._tree.temporaryItem.obj.push(U);var G=0;!m._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(G=Ne.selectedItem.id);var j=m._core.getuid(),q={id:j,name:"\u65B0\u5EFA\u5256\u9762\u5206\u6790"+j,pId:m._core.isnull(C)?0:C,type:"polyline",item:m};m.setTreeobj(q),Ne.insertGroupId(q,m._core.isnull(C)?0:C)},O}();return this};us.prototype.executeProfilePro=function(o,f){var m=this;this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var v=[],y=null,x=o.parameterd,C=o.objid,w=o.cyjj,A=this._core.CreateTooltip(),E=null,T={spot:[],min:0,max:0,distance:0,label:{},cys:0,gcs:[]};this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._tree.handler.setInputAction(function(I){v.length>=3?A.showAt(I.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"):A.showAt(I.endPosition,"\u70B9\u51FB\u7ED8\u5236\u5256\u9762\u70B9");var P=m._viewer.camera.getPickRay(I.endPosition);E=m._viewer.scene.globe.pick(P,m._viewer.scene);var D=m._viewer.scene.pick(I.endPosition);if(D){var L=m._viewer.scene.pickPosition(I.endPosition);L&&(E=L)}!E||v.length>=2&&(m._cesium.defined(y)?(v.pop(),v.push(E)):y=new M(v))},m._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(I){m.end()},m._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=function(I){if(m._tree.handler.destroy(),m._core.mouse(m._viewer.container,0),m._tree.endtemporaryItem(),m._core.getBrowser().pc=="pc"&&v.pop(),A.show(!1),m.end=void 0,I==="cancel"){m.item&&m._viewer.entities.remove(m.item);return}if(v.length<=1){window.layuiLayer&&window.layuiLayer.msg("\u5256\u9762\u70B9\u5C0F\u4E8E\u4E24\u70B9\uFF0C\u8BF7\u91CD\u65B0\u7ED8\u5236");return}T.spot=v;var P=x;m._core.getPmfxPro(v,P,w,m._cesium,m._viewer,function(D){T.distance=D.juli,T.gcs=D.gcs,T.cys=D.cys,T.max=D.max,T.min=D.min,T.allPoint=D.allPoint,f!=""&&f!=null&&typeof f=="function"&&f(T)})};var S=[];this._tree.handler.setInputAction(function(I){var P=m._viewer.camera.getPickRay(I.position);E=m._viewer.scene.globe.pick(P,m._viewer.scene);var D=m._viewer.scene.pick(I.position);if(D){var L=m._viewer.scene.pickPosition(I.position);L&&(E=L)}!E||(v.length===0&&v.push(E.clone()),v.push(E),v.length>2&&(m._cesium.defined(y)||(y=new M(v))))},m._cesium.ScreenSpaceEventType.LEFT_CLICK);var M=function(){function I(P){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:m._cesium.Color.YELLOW,width:2,clampToGround:!0}},this.positions=P,this._init10()}return I.prototype._init10=function(){var P=this,D=function(){return P.positions};this.options.polyline.positions=new m._cesium.CallbackProperty(D,!1);var L=m._viewer.entities.add(this.options);m.item=L,m._tree.temporaryItem.obj.push(L);var R=0;!m._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(R=Ne.selectedItem.id);var O=m._core.getuid(),F={id:O,name:"\u65B0\u5EFA\u5256\u9762\u5206\u6790"+O,pId:m._core.isnull(C)?0:C,type:"polyline",item:m};m.setTreeobj(F),Ne.insertGroupId(F,m._core.isnull(C)?0:C)},I}();return this};us.prototype.executeAngeSdcs=function(o){this._lang=this._core.extend(this._lang,language._lang);var f=this;this._tree.removeHandler(),this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);var m=[],v=[],y=null,x=[],C=this._core.CreateTooltip(),w=0,A="",E=null,T,S=0,M={spot:[],distance:0,label:{},angle:0};this._tree.handler.setInputAction(function(D){m.length===0?C.showAt(D.endPosition,f._lang.draw_tip_left):C.showAt(D.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01");var L=f._viewer.camera.getPickRay(D.endPosition);if(E=f._getPosition.getMousePosition(D),!!E&&m.length>=2&&(f._cesium.defined(y)?(m.pop(),m.push(E)):y=new P(m),A=f._core.getSpaceDistance(m,f._cesium),I>=2)){f._viewer.entities.remove(T);var R=f._cesium.Cartographic.fromCartesian(m[m.length-1]),O=f._cesium.Math.toDegrees(R.longitude),F=f._cesium.Math.toDegrees(R.latitude),k=R.height,U={lon:O,lat:F,hei:k};x[2]=U,S=f._core.Angle(x[0],x[1],x[2]).toFixed(1),T=f._viewer.entities.add({name:"\u4E09\u70B9\u89D2\u5EA6\u6D4B\u91CF",position:m[m.length-1],label:{text:S+"\u5EA6",font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(T)}},f._cesium.ScreenSpaceEventType.MOUSE_MOVE);var I=0;this._tree.handler.setInputAction(function(D){I>1&&(f._tree.handler.destroy(),m.pop());var L=f._viewer.camera.getPickRay(D.position);if(E=f._getPosition.getMousePosition(D),!!E){m.length==0&&m.push(E.clone()),m.push(E);var R=f._cesium.Cartographic.fromCartesian(m[m.length-1]),O=f._cesium.Math.toDegrees(R.longitude),F=f._cesium.Math.toDegrees(R.latitude),k=R.height;x.push({lon:O,lat:F,hei:k});var U=A;M.spot.push(E),M.distance=A,I==2&&(C.show(!1),M.label=T,M.angle=S,o!=""&&o!=null&&typeof o=="function"&&o(M)),I=I+1}},f._cesium.ScreenSpaceEventType.LEFT_CLICK);var P=function(){function D(L){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:f._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positions=L,this._init6()}return D.prototype._init6=function(){var L=this,R=function(){return L.positions};this.options.polyline.positions=new f._cesium.CallbackProperty(R,!1);var O=f._viewer.entities.add(this.options);f.item=O},D}();return this};us.prototype.executeAngeSd=function(o){this._lang=this._core.extend(this._lang,language._lang),this._tree.removeHandler();var f=[];this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var m=[],v=this,y=0,x=[],C=void 0,w=[],A=[];this._tree.starttemporaryItem(this._viewer);var E=this._core.CreateTooltip(),T=0,S=0,M=0,I,P=function(){function F(k){this.options={polyline:{show:!0,positions:[],material:v._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positionsp=k,this._init()}return F.prototype._init=function(){var k=this,U=function(){return k.positionsp};this.options.polyline.positions=new v._cesium.CallbackProperty(U,!1),this.polyline=v._viewer.entities.add(this.options),v._tree.temporaryItem.obj.push(this.polyline),v.item=this.polyline},F}();this._tree.handler=new v._cesium.ScreenSpaceEventHandler(v._viewer.scene.canvas);var D=[],L=void 0;if(this._points.length>0)for(var R=0;R<this._points.length;R++)this._viewer.entities.remove(this._points[R]);this._tree.handler.setInputAction(function(F){var k=v._getPosition.getMousePosition(F);if(!!k){w.push(k);var U=v._cesium.Cartographic.fromCartesian(k);if(D.length==0)D.push(k.clone()),D.push(k.clone()),C=k.clone();else{var G=v._core.ElevationAngle(C,k,v._cesium);f.length==1?A.push("\u4FEF\u4EF0\u89D21 "+G.toFixed(2)):A.push("\u4FEF\u4EF0\u89D22 "+G.toFixed(2)),L=void 0,D=[],D.push(C.clone()),D.push(C.clone()),L=new P(D),f.push(L.polyline)}if(A.length>=2){E.show(!1);var j={anglejd:T,anglefy:S,anglesp:M},q=v._core.ThreePointAzimuth(w[0],w[1],w[2],v._cesium);A.push("\u6C34\u5E73\u89D2 "+q.toFixed(2));var J=v._viewer.entities.add({name:"\u4E09\u70B9\u89D2\u5EA6\u6D4B\u91CF",position:w[1],label:{text:A[0],font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v._tree.temporaryItem.obj.push(J);var X=v._viewer.entities.add({name:"\u4E09\u70B9\u89D2\u5EA6\u6D4B\u91CF",position:w[2],label:{text:A[1],font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v._tree.temporaryItem.obj.push(X);var Y=v._viewer.entities.add({name:"\u4E09\u70B9\u89D2\u5EA6\u6D4B\u91CF",position:w[0],label:{text:A[2],font:"16px \u5B8B\u4F53",fillColor:Kr.Color.GOLD,verticalOrigin:Kr.VerticalOrigin.BOTTOM,pixelOffset:new Kr.Cartesian2(20,-20),showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});v._tree.temporaryItem.obj.push(Y),x.push(J),x.push(X),x.push(Y),D.pop(),v._tree.handler.destroy(),v._core.mouse(v._viewer.container,0,"0"),v._tree.endtemporaryItem(),v._points=x,v._polylines=f,v._polylines1=f,o!=""&&o!=null&&typeof o=="function"&&o({polylines:f,labels:x,angles:A})}}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(F){var k=v._getPosition.getMousePosition(F);!k||(D.length===0?E.showAt(F.endPosition,v._lang.draw_tip_left):D.length<=3?E.showAt(F.endPosition,"\u70B9\u51FB\u7ED8\u5236\u76EE\u6807\u70B9\uFF01"):E.showAt(F.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF01"),D.length>=2&&(v._cesium.defined(L)?k!=null&&(D.pop(),k.y+=1+Math.random(),D.push(k)):(L=new P(D),f.push(L.polyline))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var O=0;return this};us.prototype.deleteObject=function(){if(this.item&&this.item.item?this._viewer.entities.remove(this.item.item):this._viewer.entities.remove(this.item),this._points&&this._points.length>0){for(var o=0;o<this._points.length;o++)this._viewer.entities.remove(this._points[o]);this._points=[]}if(this._polylines&&this._polylines.length>0){for(var o=0;o<this._polylines.length;o++)this._viewer.entities.remove(this._polylines[o]);this._polylines=[]}if(this.labels&&this.labels.length>0){for(var o=0;o<this.labels.length;o++)this._viewer.entities.remove(this.labels[o]);this.labels=[]}if(this.item&&this.item._points&&this.item._points.length>0){for(var o=0;o<this.item._points.length;o++)this._viewer.entities.remove(this.item._points[o]);this.item._points=[]}if(this.item&&this.item._polylines&&this.item._polylines.length>0){for(var o=0;o<this.item._polylines.length;o++)this._viewer.entities.remove(this.item._polylines[o]);this.item._polylines=[]}};us.prototype.setHeightType=function(o){try{o==1?this.item._polyline.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:o==2?this.item._polyline.heightReference=this._cesium.HeightReference.NONE:o==3&&(this.item._polyline.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(f){console.log(f)}return this};us.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show._value,f=this.item.polyline.positions.getValue(),m=this.item.polyline.width==null?void 0:this.item.polyline.width._value,v=this.item.polyline.material;v!=null&&(v={color:v.color==null?void 0:"rgba("+v.color._value.red+","+v.color._value.green+","+v.color._value.blue+","+v.color._value.alpha+")",image:v.image==null?void 0:v.image._value,diffusemap:v.diffusemap==null?void 0:v.diffusemap._value,alphamap:v.alphamap==null?void 0:v.alphamap._value});var y=this.item.polyline.clampToGround==null?void 0:this.item.polyline.clampToGround._value,x=this.item.polyline.distanceDisplayCondition,C=x?._value.near,w=x?._value.far;return{type:"polyline",treeobj:{name:this.treeobj.name},style:{show:o,positions:f,width:m,material:v,clampToGround:y,near:C,far:w}}};us.prototype.setVisibility=function(o){if(this.item&&this.item.item?this.item.item.show=o:this.item.show=o,this.item&&this.item._points&&this.item._points.length>0)for(var f=0;f<this.item._points.length;f++)this.item._points[f].show=o;if(this._polylines&&this._polylines.length>0)for(var f=0;f<this._polylines.length;f++)this._polylines[f].show=o;if(this._points&&this._points.length>0)for(var f=0;f<this._points.length;f++)this._points[f].show=o;if(this.item&&this.item._polylines&&this.item._polylines.length>0)for(var f=0;f<this.item._polylines.length;f++)this.item._polylines[f].show=o};us.prototype.getVisibility=function(){return this.item.show};us.prototype.setOutlinewidth=function(o){this.item._polyline.material.outlineWidth=o};us.prototype.setMaterial=function(o){try{var f={outlineWidth:3},m=this._core.extend(f,o,!0);this.item._polyline.material=new this._cesium.PolylineGlowMaterialProperty(o),this.item.material=this.item._polyline.material}catch(v){console.log(v)}return this};us.prototype.setPolylineWall=function(o){try{for(var f=[],m=[],v=this.item._polyline.positions.getValue(),y=this._viewer.scene.globe.ellipsoid,x=0;x<v.length;x++){var C=new this._cesium.Cartesian3(v[x].x,v[x].y,v[x].z),w=y.cartesianToCartographic(C),A=this._cesium.Math.toDegrees(w.latitude),E=this._cesium.Math.toDegrees(w.longitude);f.push(E),f.push(A),m.push(o)}f=this._cesium.Cartesian3.fromDegreesArray(f),this.item.wall=new this._cesium.WallGraphics({positions:f,minimumHeights:m,material:this.item._polyline.material.color._value})}catch(T){console.log(T)}return this};us.prototype.setRadius=function(o){try{for(var f=[],m=this.item._polyline.positions.getValue(),v=this._viewer.scene.globe.ellipsoid,y=0;y<m.length;y++){var x=new this._cesium.Cartesian3(m[y].x,m[y].y,m[y].z),C=v.cartesianToCartographic(x),w=this._cesium.Math.toDegrees(C.latitude),A=this._cesium.Math.toDegrees(C.longitude);f.push(A),f.push(w)}f=this._cesium.Cartesian3.fromDegreesArray(f),this.item.corridor=new this._cesium.CorridorGraphics({positions:f,width:o,show:!0,outline:!0,material:this._cesium.Color.RED.withAlpha(.4),heightReference:this._cesium.HeightReference.none})}catch(E){console.log(E)}return this};us.prototype.setGlow=function(o){try{o?(this.item._polyline.material=new this._cesium.PolylineGlowMaterialProperty({glowPower:.2,taperPower:.5,color:this.item._polyline.material.color}),this.item.material=this.item._polyline.material):(this.item._polyline.material=new this._cesium.PolylineOutlineMaterialProperty({color:this.item._polyline.material.color,outlineWidth:this.item._polyline.material.outlineWidth,outlineColor:this.item._polyline.material.outlineColor}),this.item.material=this.item._polyline.material)}catch(f){console.log(f)}return this};us.prototype.setMaterialAlpha=function(o){try{this.item._polyline.material.color._value.alpha=o,this.item.material=this.item._polyline.material}catch(f){console.log(f)}return this};us.prototype.setType=function(o){try{o=="PolylineDashMaterialProperty"?this.item._polyline.material=new this._cesium.PolylineDashMaterialProperty({color:this.item._polyline.material.color}):o=="PolylineArrowMaterialProperty"?this.item._polyline.material=new this._cesium.PolylineArrowMaterialProperty({color:this.item._polyline.material.color}):o=="PolylineOutlineMaterialProperty"&&(this.item._polyline.material=new this._cesium.PolylineOutlineMaterialProperty({color:this.item._polyline.material.color}))}catch(f){console.log(f)}return this};us.prototype.setMaterialColor=function(o){try{this.item._polyline.material.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};us.prototype.setOutlineColor=function(o){try{this.item._polyline.material.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};us.prototype.setClampToGround=function(o){try{this.item._polyline.clampToGround=o}catch(f){console.log(f)}return this};us.prototype.setWidth=function(o){try{this.item._polyline.width=o}catch(f){console.log(f)}return this};us.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._polyline.distanceDisplayCondition=m}catch(v){console.log(v)}return this};Object.defineProperties(us.prototype,{HighLight:{set:function(o){o&&(this.item.material=this.item.polyline.material),o?this.item.polyline.material=new this._cesium.PolylineGlowMaterialProperty({glowPower:.8,color:this._cesium.Color.ORANGERED.withAlpha(.9)}):this.item.polyline.material=this.item.material}},polylinemMterial:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.polyline.material=o,this.item.material=this.item.polyline.material)},500),get:function(){var o=this.item.polyline.material;if(o)try{return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}catch{}}},polylinemArcType:{set:Ji.debounce(function(o){this._core.isnull(o)||(this.item.polyline.arcType=o)},500),get:function(){var o=this.item.polyline.arcType;if(o)return o._value}},polylineWidth:{set:Ji.debounce(function(o){this._core.isnull(o)||(o=parseFloat(o),this.item.polyline.width=o)},500),get:function(){var o=this.item.polyline.width;if(o)return o._value}}});Object.defineProperties(us.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(o){this.item.rectangle=o}}});Object.defineProperties(us.prototype,{polyline:{get:function(){return this.item.polyline},set:function(o){this.item.polyline=o}}});Object.defineProperties(us.prototype,{polygon:{get:function(){return this.item.polygon},set:function(o){this.item.polygon=o}}});Object.defineProperties(us.prototype,{point:{get:function(){return this.item.point},set:function(o){this.item.point=o}}});Object.defineProperties(us.prototype,{label:{get:function(){return this.item.label},set:function(o){this.item.label=o}}});Object.defineProperties(us.prototype,{model:{get:function(){return this.item.model},set:function(o){this.item.model=o}}});us.prototype.setItem=function(o){this.item=o};us.prototype.setTreeobj=function(o){this.treeobj=o};Object.defineProperties(us.prototype,{wall:{get:function(){return this.item.wall},set:function(o){this.item.wall=o}}});Object.defineProperties(us.prototype,{polylineTempOptions:{get:function(){return{positions:[],arcType:ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE}}}});Object.defineProperties(us.prototype,{MaterialColor:{get:function(){return new no(this._viewer,this._cesium).toHtmlColor("rgb("+this.item._polyline.material.color._value.red*255+","+this.item._polyline.material.color._value.green*255+","+this.item._polyline.material.color._value.blue*255+")")}},Height:{get:function(){return this.item._polyline.height}},Visibility:{get:function(){return this.item.show}},Outlinewidth:{get:function(){return this.item._polyline.material.outlineWidth._value}},OutlineColor:{get:function(){var o=this.item._polyline.material.outlineColor;return o?(o=o._value,new no(this._viewer,this._cesium).toHtmlColor("rgb("+o.red*255+","+o.green*255+","+o.blue*255+")")):"#ff0000"}},ClampToGround:{get:function(){return this.item._polyline.clampToGround}},Width:{get:function(){return this.item._polyline.width._value}},Type:{get:function(){return this.item._polyline.material instanceof this._cesium.PolylineDashMaterialProperty?"PolylineDashMaterialProperty":this.item._polyline.material instanceof this._cesium.PolylineArrowMaterialProperty?"PolylineArrowMaterialProperty":"PolylineOutlineMaterialProperty"}},Glow:{get:function(){return this.item._polyline.material instanceof this._cesium.PolylineGlowMaterialProperty}},MaterialAlpha:{get:function(){return this.item._polyline.material.color._value.alpha*100}}});us.prototype.CreatePolyline=function(o,f,m,v,y){this._Geometry=o;var x={color:this._cesium.Color.YELLOW,outlineColor:this._cesium.Color.BLACK,width:10,show:!0,AltitudeType:this._cesium.defaultValue(m,999)};f&&f!==""&&(x.color=new no(this._viewer,this._cesium).colorFromHtmlColor(f));for(var C=[],w=0;w<o.length;w++)C.push(this._cesium.Cartesian3.fromDegrees(o[w].x,o[w].y));this.item=this._viewer.entities.add({name:y,polyline:{positions:C,width:x.width,material:new this._cesium.PolylineGlowMaterialProperty({outlineColor:x.outlineColor,color:x.color})}});var A={id:this.item.id,name:y,pId:this._core.isnull(v)?0:v,type:"polyline",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(v)?0:v),this};us.prototype.forceEndHanlder=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._tree.handler&&(this._tree.handler.destroy(),this._tree.handler=void 0)};var _g=us;var Zs=null;function MC(o,f){Zs=f,this._viewer=o,this._scene=o.scene,this._core=new Sr(o,Zs),this._tooltip=this._core.CreateTooltip(),this._getPosition=new Ru(this._viewer,Zs),this._drawColor={point:Zs.Color.BLUE,polyline:Zs.Color.YELLOW,polygon:Zs.Color.YELLOW.withAlpha(.5)},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=window.SmartEarthRootUrl+pn.loading}MC.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};MC.prototype.deleteObject=MC.prototype.cleanUp;MC.prototype.startDrawing=function(o={},f="auto",m){var v=this._scene,y=this._tooltip,x=3,C=[],w=[],A=[],E;this._positions=w,this._degreesArr=A,this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=this._core.defaultValue(o.tin,!0),this.onlyTerrain=this._core.defaultValue(o.onlyTerrain,!0),this.selectDatum=this._core.defaultValue(o.selectDatum,!0);var T=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();var S=new Zs.ScreenSpaceEventHandler(v.canvas);this._mouseHandler=S,this.cleanUp(),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);let M;S.setInputAction(function(P){if(P.position!=null){var D=T._getPosition.getMousePosition(P);if(D){var L=Zs.Cartographic.fromCartesian(D),R=Zs.Math.toDegrees(L.longitude),O=Zs.Math.toDegrees(L.latitude);if(C.length===0&&(C.push(R,O),A.push([R,O]),w.push(D),E=D),w.length>=4){var F=Zs.SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene,E);if(F!==void 0){var k=F.x-P.position.x,U=F.y-P.position.y,G=k*k+U*U;if(G<16){C.splice(C.length-2,2),w.pop(),this.stopDrawing(m);return}}}C.push(R,O),A.push([R,O]),w.push(D),w.length===2&&!M&&(M=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Zs.CallbackProperty(function(){return w},!1),clampToGround:!0,material:T._drawColor.polygon,width:3}})),w.length===x&&(M&&this._viewer.entities.remove(M),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new Zs.PolygonHierarchy(Zs.Cartesian3.fromDegreesArray(C)),material:T._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new Zs.CallbackProperty(I,!1))}}}.bind(this),Zs.ScreenSpaceEventType.LEFT_CLICK),S.setInputAction(function(P){var D=P.endPosition;if(D!=null)if(w.length===0)y.showAt(D,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{var L=T._getPosition.getMousePosition(P);if(L){var R=Zs.Cartographic.fromCartesian(L),O=Zs.Math.toDegrees(R.longitude),F=Zs.Math.toDegrees(R.latitude);if(C.splice(C.length-2,2),A.pop(),w.pop(),C.push(O,F),A.push([O,F]),w.push(L),y.showAt(D,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"),w.length>=3&&w.length>=4){var k=Zs.SceneTransforms.wgs84ToWindowCoordinates(this._viewer.scene,E);if(k!==void 0){var U=k.x-D.x,G=k.y-D.y,j=U*U+G*G;j<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Zs.ScreenSpaceEventType.MOUSE_MOVE),S.setInputAction(function(P){this.end&&this.end()}.bind(this),Zs.ScreenSpaceEventType.RIGHT_CLICK);function I(){return new Zs.PolygonHierarchy(Zs.Cartesian3.fromDegreesArray(C))}return this.end=P=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._core.mouse(this._viewer.container,0),this._tooltip.show(!1),M&&this._viewer.entities.remove(M),this.end=void 0,!(w.length<x)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=Zs.Cartesian3.fromDegreesArray(C)),P==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}this.stopDrawing(f,m)}},this};MC.prototype.stopDrawing=function(o,f){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(m=>{this._viewer.entities.remove(m)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{var m=this.computeCutVolume(o,this.onlyTerrain);let v=y=>{var x=y.maxHeight,C=y.minHeight;this._prevEntity.polygon.height=y.minHeight,this._prevEntity.polygon.heightReference=0;var w={id:this._core.getuid(),polygon:{hierarchy:{positions:this._positions},height:C,extrudedHeight:x,closeTop:!1,closeBottom:!1,material:Zs.Color.CYAN.withAlpha(.2),distanceDisplayCondition:new Zs.DistanceDisplayCondition(0,this.viewDistance*1.5),outline:!0,outlineColor:Zs.Color.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(w),typeof f=="function"&&f(y),this.selectDatum){let A=()=>{this.addPoint(E=>{this.setDatum(E,T=>{typeof f=="function"&&f({...y,...T}),A()})})};A()}};this.onlyTerrain?m.then(y=>{v(y)}):v(m)},100)};MC.prototype.computeCentroidOfPolygon=function(o){for(var f=[],m=[],v=0,y=0,x=0;x<o.length;x++){var C=Zs.Cartographic.fromCartesian(o[x]);v+=C.longitude,y+=C.latitude,f.push(C.longitude),m.push(C.latitude)}var w=0,A=0;return w=v/o.length,A=y/o.length,new Zs.Cartographic(w,A)};MC.prototype.computeCutVolume=function(o,f){var m=15e3,v=-15e3;let y=Zs.BoundingSphere.fromPoints(this._positions);this.viewDistance=this._core.getPointToCameraDistance(this._viewer,y.center)*1.5,o==="auto"&&(o=y.radius/20);let x=this._core.getPointsInPolygon(this._degreesArr,o,!0),C=Zs.turf.polygon([this._degreesArr]),w=()=>{let{tin:A}=this._core.tinFromPoints(x,{getArea:!0,polygon:C});this.tinData=A;let E={fill:0,dig:0},T={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"};var S,M,I,P,D,L={fill:1,dig:1};this.Triangulation=[],A.features.forEach(O=>{if(O.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new Zs.PolygonHierarchy(O.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,distanceDisplayCondition:new Zs.DistanceDisplayCondition(0,this.viewDistance*1.5),outlineColor:Zs.Color.YELLOW}});this._volumeTin.push(k)}let F=O.geometry.coordinates[0];S=F[0][2],M=F[1][2],I=F[2][2],D=O.area,this.Triangulation.push({bottomArea:D,height:[S,M,I]}),P=(S-m+M-m+I-m)/3,P>0?E.dig=E.dig+D*P*L.dig:E.fill=E.fill-D*P*L.fill,E.dig>1e10&&T.dig==="\u7ACB\u65B9\u7C73"&&(E.dig=E.dig/1e9,T.dig="\u7ACB\u65B9\u5343\u7C73",L.dig=1e-9),E.fill>1e10&&T.fill==="\u7ACB\u65B9\u7C73"&&(E.fill=E.fill/1e9,T.fill="\u7ACB\u65B9\u5343\u7C73",L.fill=1e-9)}});var R=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:Zs.Cartesian3.fromRadians(R.longitude,R.latitude,v),label:{text:"\u6316\u65B9\u4F53\u79EF\uFF1A"+E.dig.toFixed(4)+T.dig,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:Zs.Color.GOLD,verticalOrigin:Zs.VerticalOrigin.BOTTOM,showBackground:!0,distanceDisplayCondition:new Zs.DistanceDisplayCondition(0,this.viewDistance*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:Zs.Cartesian3.fromRadians(R.longitude,R.latitude,v),label:{text:"\u586B\u65B9\u4F53\u79EF\uFF1A"+E.fill.toFixed(4)+T.fill,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:Zs.Color.GOLD,verticalOrigin:Zs.VerticalOrigin.BOTTOM,showBackground:!0,distanceDisplayCondition:new Zs.DistanceDisplayCondition(0,this.viewDistance*1.5),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:v,minHeight:m,volume:E,unit:T,spacing:o}};if(f){let A=[];return x.features.forEach(E=>{let T=E.geometry.coordinates;A.push(Zs.Cartographic.fromDegrees(T[0],T[1]))}),this._core.getHeightsFromLonLat(this._viewer,A).then(E=>(x.features.forEach((T,S)=>{let M=T.geometry.coordinates;M[2]=E[S]||0,v<M[2]&&(v=M[2]),m>M[2]&&(m=M[2])}),w()))}else return x.features.forEach(A=>{let E=A.geometry.coordinates,T=new Zs.Cartographic(Zs.Math.toRadians(E[0]),Zs.Math.toRadians(E[1]));E[2]=Viewer.scene.sampleHeight(T)||0,v<E[2]&&(v=E[2]),m>E[2]&&(m=E[2])}),w()};MC.prototype.addLoading=function(){var o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";var f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=this.loadingImg,o.appendChild(f),this.loading=o,this._viewer.container.appendChild(o)};MC.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};MC.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};MC.prototype.addPoint=function(o){if(this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),!this._prevEntity1)return;this.addPointHandle=new Zs.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(m){var v=this._viewer.scene.pick(m.position);if(v&&v.id&&v.id.id===this._prevEntity1.id){let x=this._getPosition.getMousePosition(m);if(x){var y=Zs.Cartographic.fromCartesian(x);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(y.height.toFixed(1))}}}.bind(this),Zs.ScreenSpaceEventType.LEFT_CLICK);let f;this.addPointHandle.setInputAction(function(m){clearTimeout(f),f=setTimeout(()=>{var v=this._viewer.scene.pick(m.endPosition);v&&v.id&&v.id.id===this._prevEntity1.id?this._tooltip.showAt(m.endPosition,"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"):this._tooltip.show(!1)},50)}.bind(this),Zs.ScreenSpaceEventType.MOUSE_MOVE)};MC.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(f=>{if(f.positions){let m=this._viewer.entities.add({polygon:{hierarchy:new Zs.PolygonHierarchy(f.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:Zs.Color.YELLOW}});this._volumeTin.push(m)}})};MC.prototype.setDatum=function(o,f){if(this.Triangulation&&this.Triangulation.length>0){var m,v,y,x={fill:0,dig:0},C={fill:"\u7ACB\u65B9\u7C73",dig:"\u7ACB\u65B9\u7C73"},w={fill:1,dig:1};this.Triangulation.forEach(function(A){m=A.bottomArea,v=A.height,y=(v[0]-o+v[1]-o+v[2]-o)/3,y>0?x.dig=x.dig+m*y*w.dig:x.fill=x.fill-m*y*w.fill,x.dig>1e10&&C.dig==="\u7ACB\u65B9\u7C73"&&(x.dig=x.dig/1e9,C.dig="\u7ACB\u65B9\u5343\u7C73",w.dig=1e-9),x.fill>1e10&&C.fill==="\u7ACB\u65B9\u7C73"&&(x.fill=x.fill/1e9,C.fill="\u7ACB\u65B9\u5343\u7C73",w.fill=1e-9)}),this._volumeLabel.label.text="\u6316\u65B9\u4F53\u79EF\uFF1A"+x.dig.toFixed(4)+C.dig,this._volumeLabel1.label.text="\u586B\u65B9\u4F53\u79EF\uFF1A"+x.fill.toFixed(4)+C.fill,this._prevEntity.polygon.height=o,f&&typeof f=="function"&&f({volume:x,unit:C})}};var wse=MC;var QX=null;function FT(o,f){QX=f,this._viewer=o,this._core=new Sr(o,f),this.measureData=new Map}FT.prototype.clearMeasure=function(o){if(o){let f=this.measureData.get(o);f&&f.deleteObject&&f.deleteObject(),f&&f.cleanUp&&f.cleanUp(),this.measureData.delete(o)}else this.measureData.forEach(f=>{f.deleteObject&&f.deleteObject(),f.cleanUp&&f.cleanUp()}),this.measureData.clear()};FT.prototype.horizontalDistance=function(o={},f){let m=this.Polyline.horizontalDistance(o,v=>{v.id=this._core.getuid(),this.measureData.set(v.id,m),f&&typeof f=="function"&&f(v)})};FT.prototype.spaceDistance=function(o={},f){let m=this.Polyline.spaceDistance(o,v=>{v.id=this._core.getuid(),this.measureData.set(v.id,m),f&&typeof f=="function"&&f(v)})};FT.prototype.altitude=function(o={},f){let m=this.Point.altitude(o,v=>{v.id=this._core.getuid(),this.measureData.set(v.id,m),f&&typeof f=="function"&&f(v)})};FT.prototype.verticalHeight=function(o={},f){let m=this.Polyline.verticalHeight(o,v=>{v.id=this._core.getuid(),this.measureData.set(v.id,m),f&&typeof f=="function"&&f(v)})};FT.prototype.surfaceArea=function(o={},f){let m=this.Polygon.surfaceArea(o,v=>{v.id=this._core.getuid(),this.measureData.set(v.id,m),f&&typeof f=="function"&&f(v)})};FT.prototype.planeArea=function(o={},f){let m=this.Polygon.planeArea(o,v=>{v.id=this._core.getuid(),this.measureData.set(v.id,m),f&&typeof f=="function"&&f(v)})};FT.prototype.measureAngle=function(o={},f){let m=this.Polyline.measureAngle(o,v=>{v.id=this._core.getuid(),this.measureData.set(v.id,m),f&&typeof f=="function"&&f(v)})};FT.prototype.analysisVolume=function(o={},f){let m=new wse(this._viewer,QX);m.startDrawing(o,o.spacing||"auto",v=>{m.value?m.value=`\u586B\u65B9\uFF1A${v.volume.fill.toFixed(4)+v.unit.fill}<br>\u6316\u65B9\uFF1A${v.volume.dig.toFixed(4)+v.unit.dig}`:(v.id=this._core.getuid(),this.measureData.set(v.id,m),m.value=`\u586B\u65B9\uFF1A${v.volume.fill.toFixed(4)+v.unit.fill}<br>\u6316\u65B9\uFF1A${v.volume.dig.toFixed(4)+v.unit.dig}`),f&&typeof f=="function"&&f(v)})};Object.defineProperties(FT.prototype,{Point:{get:function(){return new yb(this._viewer,QX)}},Polyline:{get:function(){return new _g(this._viewer,QX)}},Polygon:{get:function(){return new gg(this._viewer,QX)}}});var Ase=FT;function Yh(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.tools=[],this._measure=new Ase(o.viewer,qi)}Yh.prototype.lineLength=function(o){this._earthCtrl.analysis.saveResult===!1&&this._earthCtrl.tools.clearTool();let f=new rDe(this._earthCtrl,function(m){o&&o(m)});return this._earthCtrl.tools.registerTool("line_length_tool",f),this.tools.push(f),f};Yh.prototype.lineDistance=function(o={},f){this._measure.spaceDistance(o,f)};Yh.prototype.clampLineDistance=function(o={},f){this._measure.horizontalDistance(o,f)};Yh.prototype.pathLength=function(o){this._earthCtrl.analysis.saveResult===!1&&this._earthCtrl.tools.clearTool();let f=new bse(this._earthCtrl,function(m){o&&o(m)});return this._earthCtrl.tools.registerTool("path_length_tool",f),this.tools.push(f),f};Yh.prototype.measureHeight=function(o){this._earthCtrl.analysis.saveResult===!1&&this._earthCtrl.tools.clearTool();let f=new aDe(this._earthCtrl,function(m){o&&o(m)});return this._earthCtrl.tools.registerTool("height_tool",f),this.tools.push(f),f};Yh.prototype.measureSlope=function(o,f){o=Z(o,Z.EMPTY_OBJECT),N(o.enable)||(o.enable=!0);let m=new lDe(this._earthCtrl,o,function(y){f&&f(y)}),v=zl();return this._earthCtrl.tools.registerTool(`slope_tool${v}`,m),this.tools.push(m),m};Yh.prototype.spatialDistance=function(o){this._earthCtrl.analysis.saveResult===!1&&this._earthCtrl.tools.clearTool();let f=new bse(this._earthCtrl,function(m){o&&o(m)});return this._earthCtrl.tools.registerTool("spatial_distance_tool",f),this.tools.push(f),f};Yh.prototype.horizontalDistance=function(o,f){o=Z(o,Z.EMPTY_OBJECT),N(o.enable)||(o.enable=!0);let m=new cDe(this._earthCtrl,o,function(y){f&&f(y)}),v=zl();return this._earthCtrl.tools.registerTool(`horizontal_distance_tool${v}`,m),this.tools.push(m),m};Yh.prototype.planeArea=function(o,f){this._measure.planeArea(o,f)};Yh.prototype.surfaceArea=function(o,f){this._measure.surfaceArea(o,f)};Yh.prototype.measureArea=function(o){this._earthCtrl.analysis.saveResult===!1&&this._earthCtrl.tools.clearTool();let f=new KX(this._earthCtrl,function(m){o&&o(m)});return this._earthCtrl.tools.registerTool("area_tool",f),this.tools.push(f),f};Yh.prototype.measureSurfaceArea=function(o){this._earthCtrl.analysis.saveResult===!1&&this._earthCtrl.tools.clearTool();let f=new fDe(this._earthCtrl,function(m){o&&o(m)});return this._earthCtrl.tools.registerTool("surface_area_tool",f),this.tools.push(f),f};Yh.prototype.altitude=function(o,f){this._measure.altitude(o,f)};Yh.prototype.height=function(o,f){this._measure.verticalHeight(o,f)};Yh.prototype.angle=function(o,f){this._measure.measureAngle(o,f)};Yh.prototype.azimuth=function(o,f){this._earthCtrl.analysis.saveResult||this._earthCtrl.tools.clearTool();let m=new aut(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("azimuth_tool",m),this.tools.push(m),m};var Ese=new Mt;Yh.prototype.measureTerrainHeight=function(o){return Ese.longitude=xe.toRadians(o.longitude),Ese.latitude=xe.toRadians(o.latitude),Ese.height=o.height,this._coreMap.scene.globe.getHeight(Ese)};Yh.prototype.lineOfSight=function(o,f){this._earthCtrl.tools.clearTool();let m=new mut(this._earthCtrl,function(v){f&&f(v)});this._earthCtrl.tools.registerTool("line_of_sight_tool",m)};Yh.prototype.threatDome=function(o,f){};Yh.prototype.viewShed=function(o,f){};Yh.prototype.buffer=function(o,f){};Yh.prototype.pickPosition=function(o,f){this._earthCtrl.tools.clearTool();let m=new yDe(o,this._earthCtrl,function(v){f&&f(v)});this._earthCtrl.tools.registerTool("pick_position_tool",m)};Yh.prototype.pickObject=function(o,f){this._earthCtrl.tools.clearTool();let m=new _De(this._earthCtrl,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("pick_object_tool",m),m};Yh.prototype.endPickObject=function(o){this._earthCtrl.tools.clearTool(),o.endPickObject(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};Yh.prototype.hoverObject=function(o,f){this._earthCtrl.tools.clearTool();let m=new CDe(this._earthCtrl,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("hover_object_tool",m),m};Yh.prototype.doubleClickObject=function(o,f){this._earthCtrl.tools.clearTool();let m=new wDe(this._earthCtrl,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("doubeClick_object_tool",m),m};Yh.prototype.RClickObject=function(o,f){this._earthCtrl.tools.clearTool();let m=new EDe(this._earthCtrl,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("RClick_object_tool",m),m};Yh.prototype.clearResult=function(o){N(o)?o.clearResult():this._earthCtrl.tools.clearResult(),this._measure.clearMeasure()};Yh.prototype.lineOfSightByParams=function(o,f){let m=H.normalize(H.subtract(o.endPoint,o.startPoint,new H),new H),v=H.distance(o.endPoint,o.startPoint),y=new _s(o.startPoint,m),x=[],C=this.earthCtrl.coreMap.scene.pickFromSegment(y,v,x),w=!0,A;return!N(C)||!N(C.position)?w=!1:A=C.position,f&&f({ret:w,position:A}),w};var TDe=Yh;var m8=new H(0,0,0),SDe=class{constructor(){this.name="PolylineCreateTool"}onActive(){this.mTotalLength=0,this.mControlPointArray=[],this.mPathPointArray=[],this.mPolyline=null,this.mPoints=null}onDeactive(){N(this.mPolyline)&&(this.mPolyline.destory(),this.mPolyline=null),N(this.mPoints)&&(this.mPoints.destory(),this.mPoints=null),this.mTotalLength=0,this.mControlPointArray=null,this.mPathPointArray=null}onLButtonUp(f){return super.onLButtonUp(f)===!1?!1:(this.pickVector(f,m8)&&(this.mControlPointArray.length>0&&this.mControlPointArray.pop(),this.mControlPointArray.push(H.clone(m8)),this.mControlPointArray.push(H.clone(m8)),this.mTotalLength=this.calculateLength(this.mControlPointArray,!1),N(this.mPoints)&&this.mPoints.add(H.clone(m8))),!0)}onRButtonDown(f){super.onRButtonDown(f),this.mControlPointArray.length>=2&&(this.mCallback&&this.mCallback({result:this.mControlPointArray}),N(this.mPolyline)&&(this.mPolyline.destory(),this.mPolyline=null),this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mControlPointArray,color:Re.fromRgba(4286644096),width:3}),this.mEnable=!1)}onMouseMove(f){super.onMouseMove(f);let m=this.mControlPointArray.length;m<=1||this.pickVector(f,m8)&&(H.clone(m8,this.mControlPointArray[m-1]),N(this.mPolyline)||(this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mControlPointArray,color:Re.fromRgba(4286644096),width:3})))}},Tse=SDe;var T4=new H(0,0,0),PDe=class extends ls{constructor(f,m,v){super(f,m,v),this.name="PolylineCreateTool"}onActive(){this.mTotalLength=0,this.mControlPointArray=[],this.mPolygonPointArray=[],this.mPolygon=null,this.mPolyline=null,this.mPoints=null}onDeactive(){N(this.mPolygon)&&(this.mPolygon.destory(),this.mPolygon=null),N(this.mPolyline)&&(this.mPolyline.destory(),this.mPolyline=null),N(this.mPoints)&&(this.mPoints.destory(),this.mPoints=null),N(this.mLabel)&&(this.mLabel.destory(),this.mLabel=null),this.mTotalLength=0,this.mControlPointArray=[],this.mPolygonPointArray=[]}onLButtonUp(f){if(super.onLButtonUp(f)===!1)return!1;if(this.pickVector(f,T4)){if(this.mControlPointArray.length>0&&(this.mControlPointArray.pop(),this.mControlPointArray.pop()),this.mControlPointArray.push(H.clone(T4)),this.mControlPointArray.push(H.clone(T4)),this.mControlPointArray.push(H.clone(this.mControlPointArray[0])),this.mPolygonPointArray.push(H.clone(T4)),N(this.mPoints)&&this.mPoints.add(H.clone(T4)),this.mPolygonPointArray.length<3)return;N(this.mPolygon)||(this.mPolygon=ec.createPolygonPrimitive(this.mEarthCtrl,{positions:this.mPolygonPointArray,color:Re.fromRgba(2290155392),outlineColor:Re.WHITE,width:3}))}return!0}onRButtonDown(f){super.onRButtonDown(f),this.mControlPointArray.length>=2&&(this.mCallback&&this.mCallback({result:this.mControlPointArray}),this.mEnable=!1)}onMouseMove(f){super.onMouseMove(f);let m=this.mControlPointArray.length;m<=2||this.pickVector(f,T4)&&(H.clone(T4,this.mControlPointArray[m-2]),N(this.mPolyline)||(this.mPolyline=ec.createPolylinePrimitive(this.mEarthCtrl,{positions:this.mControlPointArray,color:Re.fromRgba(3422617472),width:3})))}},Sse=PDe;function g8(o,f){this.mEarthCtrl=o,this.handler=new Ur(o.coreMap.canvas),f=Z(f,Z.EMPTY_OBJECT),this._core=new PC(o),this.mCallback=f.callback,this.name="DrawShapeTool",this.entityShape=null,this.points=[],this.drawingMode=Z(f.shape,"polygon"),this.activeShapePoints=[],this.activeShape=void 0,this.floatingPoint=void 0,this._startDrawTips=`${this.mEarthCtrl.language.TOOLS_LEFT_CLICK_TO_START_DRAW}`,this._endDrawTips=`${this.mEarthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`,this.toolTips=this._core.createTooltip({style:{id:"drawShapeTool"},show:!1});let m=this;m.handler.setInputAction(function(v){let y=m.mEarthCtrl.coreMap;if(!Wh.supportsPolylinesOnTerrain(y.scene)){console.log("This browser does not support polylines on terrain.");return}let x=y.scene.pickPosition(v.position);N(x)&&(m.activeShapePoints.length===0&&(m.floatingPoint=m.createPoint(x),m.activeShapePoints.push(x)),m.activeShapePoints.push(x),m.createPoint(x))},Ei.LEFT_CLICK),m.handler.setInputAction(function(v){m.toolTips.showFun(!1),m.handler.destroy(),m.terminateShape()},Ei.RIGHT_CLICK),m.handler.setInputAction(function(v){if(m.activeShapePoints.length>=4?m.toolTips.showAts({text:m.endDrawTips,position:v.endPosition}):(m.toolTips.show||(m.toolTips.show=!0),m.toolTips.showAts({text:m.startDrawTips,position:v.endPosition})),N(m.floatingPoint)){let y=m.mEarthCtrl.coreMap.scene.pickPosition(v.endPosition);if(N(y)&&(m.floatingPoint.position.setValue(y),m.activeShapePoints.pop(),m.activeShapePoints.push(y),!N(m.entityShape))){let x;m.drawingMode==="polygon"?m.activeShapePoints.length>=3&&(x=new xn(function(){return new ho(m.activeShapePoints)},!1),m.entityShape=m.drawShape(x)):(x=new xn(function(){return m.activeShapePoints},!1),m.entityShape=m.drawShape(x))}}},Ei.MOUSE_MOVE)}Object.defineProperties(g8.prototype,{startDrawTips:{set:function(o){this._startDrawTips=o},get:function(){return this._startDrawTips}},endDrawTips:{set:function(o){this._endDrawTips=o},get:function(){return this._endDrawTips}}});g8.prototype.createPoint=function(o){let f=this.mEarthCtrl.entities.add({position:o,point:{pixelSize:10,color:Re.YELLOW,heightReference:qn.CLAMP_TO_GROUND}});return this.points.push(f),f};g8.prototype.terminateShape=function(){!N(this.mCallback)||(console.info(this.entityShape),N(this.entityShape.polygon)?this.mCallback({result:this.entityShape.polygon.hierarchy.getValue().positions}):N(this.entityShape.polyline)?this.mCallback({result:this.entityShape.polyline.positions.getValue()}):this.mCallback({result:this.entityShape.point.positions.getValue()}))};g8.prototype.drawShape=function(o){let f,v=this.mEarthCtrl;return this.drawingMode==="polyline"?f=v.entities.add({polyline:{positions:o,clampToGround:!0,arcType:fs.RHUMB,material:Re.GREEN,width:5}}):this.drawingMode==="polygon"?f=v.entities.add({polygon:{hierarchy:o,material:new xs(Re.LIGHTSKYBLUE.withAlpha(.7))}}):this.drawingMode==="point"&&(f=v.entities.add({position:o,point:{pixelSize:10,color:Re.YELLOW,heightReference:qn.CLAMP_TO_GROUND}})),f};g8.prototype.removeFromMap=function(){let o=this.mEarthCtrl;o.entities.remove(this.floatingPoint),o.entities.remove(this.activeShape);for(let f=0;f<this.points.length;f++){let m=this.points[f];o.entities.remove(m)}this.entityShape=null,this.floatingPoint=void 0,this.activeShape=void 0,this.activeShapePoints=[],this.points=[],this.toolTips.show=!1};var gut=g8;function tNi(o,f){let m=null,v="",y=null,x,C=[],w=function(){function M(I){this.options={name:"",polygon:{hierarchy:[],heightReference:Z(v.heightReference,1),perPositionHeight:v.heightReference===0,material:Z(v.material,Re.YELLOW.withAlpha(.5))}},this.hierarchy=I,this._init()}return M.prototype._init=function(){let I=this,P=function(){return I.hierarchy};this.options.polygon.hierarchy=new xn(P,!1),this.polygon=o.entities.add(this.options),m=this.polygon},M}();y=new Ur(o.coreMap.scene.canvas);let A=[],E={},T;y.setInputAction(function(M){let I=o.coreMap.camera.getPickRay(M.position),P=o.coreMap.scene.globe.pick(I,o.coreMap.scene),D=Mt.fromCartesian(P),L=xe.toDegrees(D.longitude),R=xe.toDegrees(D.latitude);A.length===0&&(A.push(P.clone()),C.push([L,R])),A.push(P),E=new ho(A),C.push([L,R])},Ei.LEFT_CLICK);let S=new iNi;y.setInputAction(function(M){A.length===0?S.showAt(M.endPosition,`${o.language.TOOLS_LEFT_CLICK_TO_START_DRAW}`):A.length<=2?S.showAt(M.endPosition,`${o.language.TOOLS_CLICK_TO_CONTINUE_DRAW}`):S.showAt(M.endPosition,`${o.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`);let I=o.coreMap.scene.pickPosition(M.endPosition);if(!I)return;let P=Mt.fromCartesian(I),D=xe.toDegrees(P.longitude),L=xe.toDegrees(P.latitude);A.length>=2&&(N(T)?I!==void 0&&(A.pop(),I.y+=1+Math.random(),A.push(I),E=new ho(A),C.pop(),C.push([D,L])):(E=new ho(A),T=new w(E)),o.entities.remove(x),x=o.entities.add({name:o.language.TOOLS_DRAW_POLYGON_AREA_NAME,position:new xn(function(){let R=new H;return A.forEach(O=>{H.add(R,O,R)}),H.divideByScalar(R,A.length,new H)},!1)}))},Ei.MOUSE_MOVE),y.setInputAction(function(M){y.destroy(),S.show(!1);let I={polygon:{},positions:[],area:[]};I.polygon=T;let P=[];for(let D=0;D<A.length;D++){let L=Mt.fromCartesian(A[D]),R=xe.toDegrees(L.longitude),O=xe.toDegrees(L.latitude),F=L.height;P.push({lon:R,lat:O,hei:F})}I.positions=P,f&&f(C),o.entities.remove(x),o.entities.remove(m)},Ei.RIGHT_CLICK)}function iNi(o={},f,m){let v,y,x,C,w;typeof o=="object"&&(v=o),v&&v.origin?(v.origin==="center"&&(y=15,x=-12),v.origin==="top"&&(y=15,x=-44),v.origin==="bottom"&&(y=15,x=20)):(y=15,x=20),v&&v.color?(v.color==="white"&&(C="background: rgba(255, 255, 255, 0.8);color: black;"),v.color==="black"&&(C="background: rgba(0, 0, 0, 0.5);color: white;"),v.color==="yellow"&&(C="color: black;background-color: #ffcc33;border: 1px solid white;")):C="background: rgba(0, 0, 0, 0.5);color: white;",v&&v.id?w=`toolTip${v.id}`:w="toolTip";let A=null;if(!A){let E=document.createElement("div");rp(".map-widget",E);let T=`<div id="${w}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${C}"></div>`;rp(".map-widget",T),A=document.getElementById(w)}return m?(A.innerHTML=o,A.style.left=`${f.x+y}px`,A.style.top=`${f.y+x}px`,A.style.display="block"):A.style.display="none",{tooltip:A,style:v,showAt:function(E,T){this.tooltip.innerHTML=T,this.style&&this.style.origin?(this.style.origin==="center"&&(y=15,x=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(y=15,x=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(y=15,x=20)):(y=15,x=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${E.x+y}px`,this.tooltip.style.top=`${E.y+x}px`,this.tooltip.style.display="block"},show:function(E){E?this.tooltip.style.display="block":this.tooltip.style.display="none"}}}var _ut=tNi;function ZX(o){this._earthCtrl=o,this._coreMap=o.coreMap}ZX.prototype.createPolyline=function(o){this._earthCtrl.tools.clearTool();let f=new Tse(this._earthCtrl,function(m){o&&o(m)});this._earthCtrl.tools.registerTool("createPolylineTool",f)};ZX.prototype.createPolygon=function(o){this._earthCtrl.tools.clearTool();let f=new Sse(this._earthCtrl,function(m){o&&o(m)});return this._earthCtrl.tools.registerTool("createPolygonTool",f),f};ZX.prototype.createDrawShapeTool=function(o,f){return new gut(this._earthCtrl,{callback:o,shape:f})};ZX.prototype.drawPolygon=function(o){return new _ut(this._earthCtrl,o)};var vut=ZX;function IDe(o){this._earthCtrl=o,this._coreMap=o.coreMap}IDe.prototype.select=function(o){this._earthCtrl.tools.clearTool();let f=new Tse(this._earthCtrl,function(m){o&&o(m)});this._earthCtrl.tools.registerTool("createPolylineTool",f)};IDe.prototype.selectInWorld=function(o){this._earthCtrl.tools.clearTool();let f=new Sse(this._earthCtrl,function(m){o&&o(m)});this._earthCtrl.tools.registerTool("createPolygonTool",f)};var MDe=IDe;function yut(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._parameter={},this._pps=null,this.removeFromMap=function(){xut(this)}}var sx={r:.8,g:.8,b:.8,a:.2,d:.3};function rNi(o){if(N(o._pps))return;o._pps=new as({name:"czm_fog",fragmentShader:nNi()}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function xut(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function nNi(){return` uniform sampler2D colorTexture; uniform sampler2D depthTexture; in vec2 v_textureCoordinates; void main(void){ vec4 origcolor=texture(colorTexture, v_textureCoordinates); vec4 fogcolor=vec4(${sx.r}, ${sx.g}, ${sx.b}, ${sx.a}); float depth = czm_readDepth(depthTexture, v_textureCoordinates); vec4 depthcolor=texture(depthTexture, v_textureCoordinates); float f=(depthcolor.r-0.22)/${sx.d}; if(f<0.0) f=0.0; else if(f>1.0) f=1.0; out_FragColor = mix(origcolor,fogcolor,f); }`}Object.defineProperties(yut.prototype,{parameter:{get:function(){return this._parameter},set:function(o){sx.r=o.r||sx.r,sx.g=o.g||sx.g,sx.b=o.b||sx.b,sx.a=o.a||sx.a,sx.d=o.d||sx.d}},show:{get:function(){return this._pps!==null},set:function(o){o?rNi(this):xut(this)}}});var DDe=yut;function Cut(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._parameter={},this._pps=null,this._restoreParam={hueShift:o.coreMap.scene.skyAtmosphere?.hueShift,saturationShift:o.coreMap.scene.skyAtmosphere?.saturationShift,brightnessShift:o.coreMap.scene.skyAtmosphere?.brightnessShift,density:o.coreMap.scene.fog.density,minimumBrightness:o.coreMap.scene.fog.minimumBrightness}}function oNi(o){if(N(o._pps))return;o._restoreParam={hueShift:o.mEarthCtrl.coreMap.scene.skyAtmosphere.hueShift,saturationShift:o.mEarthCtrl.coreMap.scene.skyAtmosphere.saturationShift,brightnessShift:o.mEarthCtrl.coreMap.scene.skyAtmosphere.brightnessShift,density:o.mEarthCtrl.coreMap.scene.fog.density,minimumBrightness:o.mEarthCtrl.coreMap.scene.fog.minimumBrightness},o.mEarthCtrl.coreMap.scene.skyAtmosphere.hueShift=-.8,o.mEarthCtrl.coreMap.scene.skyAtmosphere.saturationShift=-.7,o.mEarthCtrl.coreMap.scene.skyAtmosphere.brightnessShift=-.33,o.mEarthCtrl.coreMap.scene.fog.density=.001,o.mEarthCtrl.coreMap.scene.fog.minimumBrightness=.8,o._pps=new as({name:"czm_rain",fragmentShader:sNi()}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function aNi(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null,o.mEarthCtrl.coreMap.scene.skyAtmosphere.hueShift=o._restoreParam.hueShift,o.mEarthCtrl.coreMap.scene.skyAtmosphere.saturationShift=o._restoreParam.saturationShift,o.mEarthCtrl.coreMap.scene.skyAtmosphere.brightnessShift=o._restoreParam.brightnessShift,o.mEarthCtrl.coreMap.scene.fog.density=o._restoreParam.density,o.mEarthCtrl.coreMap.scene.fog.minimumBrightness=o._restoreParam.minimumBrightness)}function sNi(){return`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float hash(float x) { return fract(sin(x*133.3)*13.13); } void main(void) { float time = czm_frameNumber / 60.0; vec2 resolution = czm_viewport.zw; vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y); vec3 c=vec3(.6,.7,.8); float a=-.4; float si=sin(a),co=cos(a); uv*=mat2(co,-si,si,co); uv*=length(uv+vec2(0,4.9))*.3+1.; float v=1.-sin(hash(floor(uv.x*100.))*2.); float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.; c*=v*b; //\u5C4F\u5E55\u4E0A\u96E8\u7684\u989C\u8272 out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); //\u5C06\u96E8\u548C\u4E09\u7EF4\u573A\u666F\u878D\u5408 } `}Object.defineProperties(Cut.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o?oNi(this):aNi(this)}}});var LDe=Cut;function but(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._parameter={},this._pps=null}function lNi(o){if(N(o._pps))return;o._pps=new as({name:"czm_snow",fragmentShader:cNi()}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function uNi(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function cNi(){return`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float snow(vec2 uv,float scale) { float time = czm_frameNumber / 60.0; float w=smoothstep(1.,0.,-uv.y*(scale/10.));if(w<.1)return 0.; uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale; uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d; p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k); k=smoothstep(0.,k,sin(f.x+f.y)*0.01); return k*w; } void main(void) { vec2 resolution = czm_viewport.zw; vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y); vec3 finalColor=vec3(0); float c = 0.0; c+=snow(uv,30.)*.0; c+=snow(uv,20.)*.0; c+=snow(uv,15.)*.0; c+=snow(uv,10.); c+=snow(uv,8.); c+=snow(uv,6.); c+=snow(uv,5.); finalColor=(vec3(c)); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5); } `}Object.defineProperties(but.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o===!0?lNi(this):uNi(this)}}});var RDe=but;function wut(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._parameter={},this._pps=null,this._csbScale=new Wt(.5,1,1,1)}function hNi(o){if(N(o._pps))return;o._pps=new as({name:"czm_hsl",fragmentShader:fNi(),uniforms:{u_colorCSBScale:function(){return o._csbScale}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function dNi(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function fNi(){return` uniform vec4 u_colorCSBScale; uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main( void ) { vec4 renderTex = texture(colorTexture, v_textureCoordinates); vec3 finalColor = renderTex.rgb * u_colorCSBScale.z; float gray = 0.2125 * renderTex.r + 0.7154 * renderTex.g + 0.0721 * renderTex.b; vec3 grayColor = vec3(gray, gray, gray); finalColor = mix(grayColor, finalColor, u_colorCSBScale.y); vec3 avgColor = vec3(0.5, 0.5, 0.5); finalColor = mix(avgColor, finalColor, u_colorCSBScale.x); out_FragColor = vec4(finalColor.rgb, renderTex.a); } `}Object.defineProperties(wut.prototype,{contrast:{get:function(){return this._csbScale.x},set:function(o){this._csbScale.x=o}},saturation:{get:function(){return this._csbScale.y},set:function(o){this._csbScale.y=o}},brightness:{get:function(){return this._csbScale.z},set:function(o){this._csbScale.z=o}},show:{get:function(){return this._pps!==null},set:function(o){o?hNi(this):dNi(this)}}});var ODe=wut;function Aut(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._parameter={},this._pps=null}function pNi(o){if(N(o._pps))return;o._pps=new as({name:"czm_bwmode",fragmentShader:gNi()}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function mNi(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function gNi(){return`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main(void) { vec4 c = texture( colorTexture, v_textureCoordinates ); float grey = 0.2125*c.r+0.7154*c.g+0.0721*c.b; c.r=grey*grey; c.g=grey*grey; c.b=grey*grey; out_FragColor=c; } `}Object.defineProperties(Aut.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o?pNi(this):mNi(this)}}});var NDe=Aut;function Eut(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._parameter={},this._pps=null,this._restoreParam={hueShift:o.coreMap.scene.skyAtmosphere?.hueShift,saturationShift:o.coreMap.scene.skyAtmosphere?.saturationShift,brightnessShift:o.coreMap.scene.skyAtmosphere?.brightnessShift,density:o.coreMap.scene.fog.density,minimumBrightness:o.coreMap.scene.fog.minimumBrightness}}function _Ni(o){if(N(o._pps))return;let f=o.mEarthCtrl;o._restoreParam={hueShift:f.coreMap.scene.skyAtmosphere.hueShift,saturationShift:f.coreMap.scene.skyAtmosphere.saturationShift,brightnessShift:f.coreMap.scene.skyAtmosphere.brightnessShift,density:f.coreMap.scene.fog.density,minimumBrightness:f.coreMap.scene.fog.minimumBrightness},f.coreMap.scene.skyAtmosphere.hueShift=-.8,f.coreMap.scene.skyAtmosphere.saturationShift=-.7,f.coreMap.scene.skyAtmosphere.brightnessShift=-.33,f.coreMap.scene.fog.density=.001,f.coreMap.scene.fog.minimumBrightness=.8,o._pps=new as({name:"czm_night_mode",fragmentShader:yNi()}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function vNi(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null,o.mEarthCtrl.coreMap.scene.skyAtmosphere.hueShift=o._restoreParam.hueShift,o.mEarthCtrl.coreMap.scene.skyAtmosphere.saturationShift=o._restoreParam.saturationShift,o.mEarthCtrl.coreMap.scene.skyAtmosphere.brightnessShift=o._restoreParam.brightnessShift,o.mEarthCtrl.coreMap.scene.fog.density=o._restoreParam.density,o.mEarthCtrl.coreMap.scene.fog.minimumBrightness=o._restoreParam.minimumBrightness)}function yNi(){return`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main(void) { out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(0.1, 0.1, 0.1,1), 0.7); } `}Object.defineProperties(Eut.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o===!0?_Ni(this):vNi(this)}}});var FDe=Eut;function $X(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._fog=new DDe(o),this._rain=new LDe(o),this._snow=new RDe(o),this._colorAdjustment=new ODe(o),this._bwMode=new NDe(o),this._nightMode=new FDe(o)}$X.prototype.disableAllEffect=function(){this._fog.show=!1,this._rain.show=!1,this._snow.show=!1,this._colorAdjustment.show=!1,this._bwMode.show=!1,this._nightMode.show=!1};$X.prototype.showEffect=function(o,f){this.disableAllEffect(),o==="fog"?(f&&(this._fog.parameter=f),this._fog.show=!0):o==="rain"?this._rain.show=!0:o==="snow"?this._snow.show=!0:o==="colorAdjustment"?this._colorAdjustment.show=!0:o==="bwMode"?this._bwMode.show=!0:o==="nightMode"&&(this._nightMode.show=!0)};$X.prototype.disableEffect=function(o){o==="fog"?this._fog.show=!1:o==="rain"?this._rain.show=!1:o==="snow"?this._snow.show=!1:o==="colorAdjustment"?this._colorAdjustment.show=!1:o==="bwMode"?this._bwMode.show=!1:o==="nightMode"&&(this._nightMode.show=!1)};Object.defineProperties($X.prototype,{SkyBoxSource:{get:function(){return this.coreMap.scene.skyBox?this.coreMap.scene.skyBox.sources:{}},set:function(o){N(o)&&(this.coreMap.scene.skyBox&&this.coreMap.scene.skyBox.destroy(),this.coreMap.scene.skyBox=new r4({sources:o}))}},fog:{get:function(){return this._fog}},rain:{get:function(){return this._rain}},snow:{get:function(){return this._snow}},colorAdjustment:{get:function(){return this._colorAdjustment}},bwMode:{get:function(){return this._bwMode}},nightMode:{get:function(){return this._nightMode}}});var BDe=$X;function xNi(o,f){let m=o.length;for(;m--;)if(o[m]===f)return!0;return!1}function CNi(o,f){let m=o.indexOf(f);m>-1&&o.splice(m,1)}var Pse=class extends Dm{constructor(f){super(f),this._objectMap=[],this._isBenchUpdate=!1,this._EventSelectSetChanged=new C4("EventSelectSetChanged")}finalize(){this._objectArray=[]}addObject(f){if(xNi(this._objectArray,f))return!1;this._objectArray.push(f),this._isBenchUpdate||this.commitChanged()}removeObject(f){CNi(this._objectArray,f),this._isBenchUpdate||this.commitChanged()}getObject(f){return f<0||f>=this._objectArray.length?null:this._objectArray[f]}removeAll(f){this._objectArray=[],this._isBenchUpdate||this.commitChanged()}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventSelectSetChanged.notifyEvent(this)}};Object.defineProperties(Pse.prototype,{count:{get:function(){return this._objectArray.length}},EventSelectSetChanged:{get:function(){return this._EventSelectSetChanged}}});var kDe=Pse;var bNi={GWIMAGERYLAYER:"GwImageryLayer",GWTERRAINLAYER:"GwTerrainLayer",GWMODELLAYER:"GwModelLayer",GWFEATURELAYER:"GwFeatureLayer",GWMODEL:"GwModel",GWWATERS:"GwWaters",GWEXPLOSION:"GwExplosion",GWFIREWORK:"GwFireworks",GWFIRE:"GwFire",GWSMOKE:"GwSmoke",GWRADARSCAN:"GwRadarScan",GWCIRCLESCAN:"GwCircleScan",GWPOINT:"GwPoint",GWLABEL:"GwLabel",GWBILLBOARD:"GwBillboard",GWPOLYLINE:"GwPolyline",GWPOLYGON:"GwPolygon",GWRECTANGLE:"GwRectangle",GWBOX:"GwBox",GWCYLINDER:"GwCylinder",GWELLIPSOID:"GwEllipsoid",GWVIDEOPROJECTION:"GwVideoProjection"},Lp=Object.freeze(bNi);var wNi={NODE:"NODE",IMAGERY_LAYER:"IMAGERY_LAYER",TERRAIN_LAYER:"TERRAIN_LAYER",MODEL_LAYER:"MODEL_LAYER",FEATURE_LAYER:"FEATURE_LAYER",SKYBOX:"SKYBOX",ENVIRONMENT:"ENVIRONMENT",VIEWPOINT:"VIEWPOINT",MODEL:"MODEL",WATERS:"WATERS",EXPLOSION:"EXPLOSION",FIREWORK:"FIREWORK",SMOKE:"SMOKE",FIRE:"FIRE",RADARSCAN:"RADARSCAN",CIRCLESCAN:"CIRCLESCAN",POINT:"POINT",LABEL:"LABEL",BILLBOARD:"BILLBOARD",POLYLINE:"POLYLINE",POLYGON:"POLYGON",RECTANGLE:"RECTANGLE",ELLIPSE:"ELLIPSE",BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER",POLYLINEVOLUME:"POLYLINEVOLUME",PERSPECTIVE_VIDEO_PROJECTION:"PERSPECTIVE_VIDEO_PROJECTION",FISHEYE_VIDEO_PROJECTION:"FISHEYE_VIDEO_PROJECTION",TRACK:"TRACK",HEATMAP:"HEATMAP",ECHARTLAYER:"ECHARTLAYER"},Ko=Object.freeze(wNi);function ANi(o){return o!=null?o._value:o}var Ou=ANi;function kf(){}kf.export=function(o){let f=null,m=o.ExportObjectMap[o._rtti];return m!==void 0&&(f=m(o)),f};function ENi(o){let f=null,m=Z(o.sourceType,"wmts");if(m==="tms"){let v=o._primitive.imageryProvider._rectangle;N(v)?v={west:xe.toDegrees(v.west),south:xe.toDegrees(v.south),east:xe.toDegrees(v.east),north:xe.toDegrees(v.north)}:v={west:"",south:"",east:"",north:""},f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,""),west:v.west,south:v.south,east:v.east,north:v.north}}if(m==="wms"){let v=o._primitive.imageryProvider._resource._queryParameters;f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,layers:Z(o._primitive.imageryProvider._layers,""),maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,""),parameters:{transparent:v.transparent,format:v.format,crs:v.crs,version:v.version,layers:v.layers}}}return m==="wmts"&&(f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,layer:Z(o._primitive.imageryProvider._layer,""),format:Z(o._primitive.imageryProvider._format,""),tileMatrixSetID:Z(o._primitive.imageryProvider._tileMatrixSetID,""),maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,"")}),m==="mapbox"&&(f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,mapId:"",show:o.show,maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,"")}),m==="arcgis"&&(f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,"")}),m==="multi"&&(f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,"")}),m==="single"&&(f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,"")}),m==="baidu"&&(f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,"")}),m==="gaode"&&(f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,"")}),m==="mapworld"&&(f={class:Z(o._parameter.class,Ko.IMAGERY_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._primitive._layerIndex,url:o.dataUrl,show:o.show,maximumLevel:Z(o._primitive.imageryProvider.maximumLevel,""),minimumLevel:Z(o._primitive.imageryProvider.minimumLevel,"")}),f}function TNi(o){let f=null,m=Z(o.sourceType,"ctb");return m==="ude"&&(f={class:Z(o._parameter.class,Ko.TERRAIN_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._parameter.zIndex,url:o.dataUrl,show:o.show}),m==="ctb"&&(f={class:Z(o._parameter.class,Ko.TERRAIN_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._parameter.zIndex,url:o.dataUrl,show:o.show}),m==="multi"&&(f={class:Z(o._parameter.class,Ko.TERRAIN_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,zIndex:o._parameter.zIndex,url:o.dataUrl,show:o.show}),f}function SNi(o){let f=null,m=Z(o.sourceType,"b3dm");return(m==="b3dm"||m==="3DTiles")&&(f={class:Z(o._parameter.class,Ko.MODEL_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,zIndex:o._parameter.zIndex,url:o.dataUrl,options:o._parameter.options,transform:o._parameter.transform}),m==="osgb"&&(f={class:Z(o._parameter.class,Ko.MODEL_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),m==="s3m"&&(f={class:Z(o._parameter.class,Ko.MODEL_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),(m==="ude_block"||m==="ude_model")&&(f={class:Z(o._parameter.class,Ko.MODEL_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),f}function PNi(o){console.log("current node>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",o);let f=null,m=Z(o.sourceType,"geojson");return m==="geojson"&&(f={class:Z(o._parameter.class,Ko.FEATURE_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),m==="feature"&&(f={class:Z(o._parameter.class,Ko.FEATURE_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),m==="custom"&&(f={class:Z(o._parameter.class,Ko.FEATURE_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),m==="kml"&&(f={class:Z(o._parameter.class,Ko.FEATURE_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),m==="arcgis_json"&&(f={class:Z(o._parameter.class,Ko.FEATURE_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),m==="raster"&&(f={class:Z(o._parameter.class,Ko.FEATURE_LAYER),name:o.name,id:o.id,sourceType:o.sourceType,show:o.show,url:o.dataUrl}),f}function INi(o){let f=null,m=Z(o.sourceType,"gltf");return m==="gltf"&&(f={class:Z(o._parameter.class,Ko.MODEL),name:o.name,id:o.id,sourceType:m,show:o.show,url:o.dataUrl,lon:o.lon,lat:o.lat,alt:o.alt,heading:o.heading,pitch:o.pitch,roll:o.roll,scale:o._primitive.scale,minimumPixelSize:o._primitive.minimumPixelSize}),m==="glb"&&(f={class:Z(o._parameter.class,Ko.MODEL),name:o.name,id:o.id,sourceType:m,show:o.show,url:o.dataUrl,lon:o.lon,lat:o.lat,alt:o.alt,heading:o.heading,pitch:o.pitch,roll:o.roll,scale:o._primitive.scale,minimumPixelSize:o._primitive.minimumPixelSize}),f}function MNi(o){let f=null;return f={class:Z(o._parameter.class,Ko.EXPLOSION),name:o.name,id:o.id,show:o.show,lon:o.parameter.lon,lat:o.parameter.lat,alt:o.parameter.alt},f}function DNi(o){let f=null;return f={class:Z(o._parameter.class,Ko.WATERS),name:o.name,id:o.id,show:o.show,params:o.params,url:o.url,color:o.color,waterFrequency:o.waterFrequency,animationSpeed:o.animationSpeed,amplitude:o.amplitude},f}function LNi(o){let f=null;return f={class:Z(o._parameter.class,Ko.FIREWORK),name:o.name,id:o.id,show:o.show,lon:o.parameter.lon,lat:o.parameter.lat,alt:o.parameter.alt,emitHeight:o.parameter.emitHeight},f}function RNi(o){let f=null;return f={class:Z(o._parameter.class,Ko.FIRE),name:o.name,id:o.id,show:o.show,lon:o.parameter.lon,lat:o.parameter.lat,alt:o.parameter.alt,particleSize:o.parameter.particleSize},f}function ONi(o){let f=null;return f={class:Z(o._parameter.class,Ko.SMOKE),name:o.name,id:o.id,show:o.show,lon:o.parameter.lon,lat:o.parameter.lat,alt:o.parameter.alt,particleSize:o.parameter.particleSize},f}function NNi(o){let f=null;return f={class:Ko.RADARSCAN,name:o.name,id:o.id,show:o.show,lon:o._lon,lat:o._lat,height:o._height,maxRadius:o._maxRadius,duration:o._duration,color:o._color},f}function FNi(o){let f=null;return f={class:Ko.CIRCLESCAN,name:o.name,id:o.id,show:o.show,lon:o._lon,lat:o._lat,height:o._height,maxRadius:o._maxRadius,duration:o._duration,color:o._color},f}function BNi(o){let f=null,m=o._coreMap.scene.globe.ellipsoid.cartesianToCartographic(o._primitive.position._value);return f={class:Z(o._parameter.class,Ko.POINT),name:o.name,id:o.id,show:o.show,lon:xe.toDegrees(m.longitude),lat:xe.toDegrees(m.latitude),alt:parseInt(m.height.toFixed(2)),pixelSize:Ou(o._primitive.point.pixelSize),color:Ou(o._primitive.point.color),outlineColor:Ou(o._primitive.point.outlineColor),outlineWidth:Ou(o._primitive.point.outlineWidth)},f}function kNi(o){let f=null,m=o._coreMap.scene.globe.ellipsoid.cartesianToCartographic(o._primitive.position._value);return f={class:Z(o._parameter.class,Ko.LABEL),id:o.id,show:o.show,name:o.name,lon:xe.toDegrees(m.longitude),lat:xe.toDegrees(m.latitude),alt:parseInt(m.height.toFixed(2)),text:Ou(o._primitive.label.text),font:Ou(o._primitive.label.font),fillColor:Ou(o._primitive.label.fillColor),outlineWidth:Ou(o._primitive.label.outlineWidth),verticalOrigin:Ou(o._primitive.label.verticalOrigin)},f}function VNi(o){let f=null,m=o._coreMap.scene.globe.ellipsoid.cartesianToCartographic(o._primitive.position._value);return f={class:Z(o._parameter.class,Ko.BILLBOARD),name:o.name,id:o.id,show:o.show,lon:xe.toDegrees(m.longitude),lat:xe.toDegrees(m.latitude),alt:parseInt(m.height.toFixed(2)),image:Ou(o._primitive.billboard.image),scale:Ou(o._primitive.billboard.scale)},f}function zNi(o){let f=null,m=[];return o._primitive.polyline.positions._value.forEach(function(y){let x=[],C=o._coreMap.scene.globe.ellipsoid.cartesianToCartographic(y);x.push(xe.toDegrees(C.longitude)),x.push(xe.toDegrees(C.latitude)),x.push(C.height),m.push(x)}),f={class:Z(o._parameter.class,Ko.POLYLINE),name:o.name,id:o.id,show:o.show,positions:m,lineColor:o._parameter.lineColor,lineWidth:Ou(o._primitive.polyline.width),clampToGround:Ou(o._primitive.polyline.clampToGround),outlineColor:o._parameter.outlineColor},f}function HNi(o){let f=null,m=[];return o.positions.positions.forEach(function(y){let x=[],C=o._coreMap.scene.globe.ellipsoid.cartesianToCartographic(y);x.push(xe.toDegrees(C.longitude)),x.push(xe.toDegrees(C.latitude)),x.push(C.height),m.push(x)}),f={class:Z(o._parameter.class,Ko.POLYGON),name:o.name,id:o.id,show:o.show,positions:m,material:o.material?Ou(o._primitive.polygon.material.color):void 0,outline:Ou(o.outline),outlineColor:Ou(o.outlineColor)},f}function UNi(o){let f=null,m=o.coordinates,v=xe.toDegrees(m.east),y=xe.toDegrees(m.north),x=xe.toDegrees(m.south),w=[xe.toDegrees(m.west),x,v,y];return f={class:Z(o._parameter.class,Ko.RECTANGLE),name:o.name,id:o.id,show:o.show,coordinates:w,height:Ou(o.height),fillColor:o.fillColor?Ou(o.fillColor.color):void 0,outline:Ou(o.outline),outlineColor:Ou(o.outlineColor)},f}function GNi(o){let f=null,m=[],v=Ou(o.position),y=o._coreMap.scene.globe.ellipsoid.cartesianToCartographic(v);return m.push(xe.toDegrees(y.longitude)),m.push(xe.toDegrees(y.latitude)),m.push(y.height),f={class:Z(o._parameter.class,Ko.BOX),name:o.name,id:o.id,show:o.show,position:m,dimensions:o.dimensions._value,material:o.material?Ou(o._primitive.box.material.color):void 0,fill:Ou(o.fill),outline:Ou(o.outline),outlineColor:Ou(o.outlineColor)},f}function WNi(o){let f=null,m=[],v=Ou(o.position),y=o._coreMap.scene.globe.ellipsoid.cartesianToCartographic(v);return m.push(xe.toDegrees(y.longitude)),m.push(xe.toDegrees(y.latitude)),m.push(y.height),f={class:Z(o._parameter.class,Ko.CYLINDER),name:o.name,id:o.id,show:o.show,position:m,topRadius:Ou(o.topRadius),bottomRadius:Ou(o.bottomRadius),length:Ou(o.length),fill:Ou(o.fill),material:o.material?Ou(o._primitive.cylinder.material.color):void 0,outline:Ou(o.outline),outlineColor:Ou(o.outlineColor)},f}function jNi(o){let f=null,m=[],v=Ou(o.position),y=o._coreMap.scene.globe.ellipsoid.cartesianToCartographic(v);m.push(xe.toDegrees(y.longitude)),m.push(xe.toDegrees(y.latitude)),m.push(y.height);let x=[],C=Ou(o.radii);return x.push(C.x),x.push(C.y),x.push(C.z),f={class:Z(o._parameter.class,Ko.ELLIPSOID),name:o.name,id:o.id,show:o.show,position:m,radii:x,fill:Ou(o.fill),material:o.material?Ou(o._primitive.ellipsoid.material.color):void 0,outline:Ou(o.outline),outlineColor:Ou(o.outlineColor)},f}function YNi(o){let f=null,m=Z(o._parameter.sourceType,"perspective");return(m==="perspective"||m==="panorama")&&(f={class:Z(o._parameter.class,Ko.PERSPECTIVE_VIDEO_PROJECTION),name:o.name,id:o.id,sourceType:o._parameter.sourceType,matchMaterials:o._parameter.matchMaterials,lon:o._parameter.lon,lat:o._parameter.lat,height:o._parameter.height,heading:o._parameter.heading,pitch:o._parameter.pitch,roll:o._parameter.roll,fov:o._parameter.fov,far:o._parameter.far,near:o._parameter.near,opacity:o._parameter.opacity,maxDiffAngle:o._parameter.maxDiffAngle,videoLink:o._parameter.videoLink,aspect:o._parameter.aspect,addToMap:o._parameter.addToMap,preview:o._parameter.preview,playVideo:o._parameter.playVideo,showMesh:o.showMesh,show:o.show,enable:o._parameter.enable,videoFrameInterval:o._parameter.videoFrameInterval,useDepth:o._parameter.useDepth}),m==="fisheye"&&(f={class:Z(o._parameter.class,Ko.FISHEYE_VIDEO_PROJECTION),name:o.name,id:o.id,sourceType:o._parameter.sourceType,matchMaterials:o._parameter.matchMaterials,lon:o._parameter.lon,lat:o._parameter.lat,height:o._parameter.height,heading:o._parameter.heading,pitch:o._parameter.pitch,roll:o._parameter.roll,fov:o._parameter.fov,far:o._parameter.far,near:o._parameter.near,opacity:o._parameter.opacity,maxDiffAngle:o._parameter.maxDiffAngle,videoLink:o._parameter.videoLink,aspect:o._parameter.aspect,addToMap:o._parameter.addToMap,preview:o._parameter.preview,playVideo:o._parameter.playVideo,showMesh:o.showMesh,show:o.show,enable:o._parameter.enable,videoFrameInterval:o._parameter.videoFrameInterval,useDepth:o._parameter.useDepth}),f}kf.ExportObjectMap={};kf.ExportObjectMap[Lp.GWEXPLOSION]=MNi;kf.ExportObjectMap[Lp.GWWATERS]=DNi;kf.ExportObjectMap[Lp.GWFIREWORK]=LNi;kf.ExportObjectMap[Lp.GWSMOKE]=ONi;kf.ExportObjectMap[Lp.GWFIRE]=RNi;kf.ExportObjectMap[Lp.GWRADARSCAN]=NNi;kf.ExportObjectMap[Lp.GWCIRCLESCAN]=FNi;kf.ExportObjectMap[Lp.GWPOINT]=BNi;kf.ExportObjectMap[Lp.GWLABEL]=kNi;kf.ExportObjectMap[Lp.GWBILLBOARD]=VNi;kf.ExportObjectMap[Lp.GWPOLYLINE]=zNi;kf.ExportObjectMap[Lp.GWPOLYGON]=HNi;kf.ExportObjectMap[Lp.GWRECTANGLE]=UNi;kf.ExportObjectMap[Lp.GWBOX]=GNi;kf.ExportObjectMap[Lp.GWCYLINDER]=WNi;kf.ExportObjectMap[Lp.GWELLIPSOID]=jNi;kf.ExportObjectMap[Lp.GWVIDEOPROJECTION]=YNi;kf.ExportObjectMap[Lp.GWIMAGERYLAYER]=ENi;kf.ExportObjectMap[Lp.GWTERRAINLAYER]=TNi;kf.ExportObjectMap[Lp.GWMODELLAYER]=SNi;kf.ExportObjectMap[Lp.GWFEATURELAYER]=PNi;kf.ExportObjectMap[Lp.GWMODEL]=INi;var Ws=kf;function EP(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this.videoProjection=null,this._parameter=null,this._showMesh=!1,this._auxMeshArray=[],this._highlightState=0,this._colorStyle=[new Re(.3,1,.3),Re.YELLOW],this._rtti="GwVideoProjection"}Object.defineProperties(EP.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this.videoProjection!==null?this.videoProjection.enabled:!1},set:function(o){this.videoProjection!==null&&(this.videoProjection.enabled=o)}},showMesh:{get:function(){return this._showMesh},set:function(o){this._showMesh=o,this.updateAuxMesh()}},highlightState:{get:function(){return this._highlightState},set:function(o){this._highlightState=o,this.updateAuxMesh()}},id:{get:function(){return this.videoProjection._id}}});EP.prototype.setParameter=function(o){if(!!N(o)&&(N(o.lon)||N(o.lat)||N(o.height)||N(o.heading)||N(o.pitch)||N(o.roll)||N(o.near)||N(o.far)||N(o.aspect))){let f=this._parameter;for(let v in o)o.hasOwnProperty(v)&&N(f[v])&&(f[v]=o[v]);let m=this.videoProjection._lightCamera;m.setView({destination:H.fromDegrees(f.lon,f.lat,f.height),orientation:{heading:xe.toRadians(f.heading),pitch:xe.toRadians(f.pitch),roll:xe.toRadians(f.roll)}}),m.frustum.fov=f.fov/180*Math.PI,m.frustum.near=f.near||1,m.frustum.far=f.far||1e5,m.frustum.aspectRatio=f.aspect||1,this.updateAuxMesh()}};EP.prototype.initialize=function(o){this._parameter=o;let f=this._parameter,m=new Vl(this.coreMap.scene);f.fov=f.fov||60,m.setView({destination:H.fromDegrees(f.lon,f.lat,f.height),orientation:{heading:xe.toRadians(f.heading),pitch:xe.toRadians(f.pitch),roll:xe.toRadians(f.roll)}}),m.frustum.fov=f.fov/180*Math.PI,m.frustum.near=f.near||1,m.frustum.far=f.far||1e5,m.frustum.aspectRatio=f.aspect||1;let v;f.useDepth?v=new FY({name:f.name,matchMaterials:f.matchMaterials,context:this.coreMap.scene.context,lightCamera:m,enabled:f.show===!0,isPointLight:!1,cascadesEnabled:!1,numberOfCascades:1,frustum:{fov:f.fov/180*Math.PI,near:f.near||1,far:f.far||1e5,aspectRatio:f.aspect||1},depthBias:f.depthBias,videoFrameInterval:f.videoFrameInterval,playVideo:f.playVideo,opacity:f.opacity,calibrateParam:f.calibrateParam,maxDiffAngle:f.maxDiffAngle/180*Math.PI,useDepth:f.useDepth,blendTop:f.blendTop,blendRight:f.blendRight,blendBottom:f.blendBottom,blendLeft:f.blendLeft,maximumDistance:f.maximumDistance||1e3}):v=new NY({name:f.name,matchMaterials:f.matchMaterials,context:this.coreMap.scene.context,lightCamera:m,enabled:f.show===!0,isPointLight:!1,cascadesEnabled:!1,numberOfCascades:1,frustum:{fov:f.fov/180*Math.PI,near:f.near||1,far:f.far||1e5,aspectRatio:f.aspect||1},depthBias:f.depthBias,videoFrameInterval:f.videoFrameInterval,playVideo:f.playVideo,opacity:f.opacity,calibrateParam:f.calibrateParam,maxDiffAngle:f.maxDiffAngle/180*Math.PI,useDepth:!1,blendTop:f.blendTop,blendRight:f.blendRight,blendBottom:f.blendBottom,blendLeft:f.blendLeft,maximumDistance:f.maximumDistance}),v.castTexture=f.castTexture,this.videoProjection=v,this._showMesh=f.showMesh,f.addToMap===!0&&this.addToMap()};var VDe=new Gr;EP.prototype.updateAuxMesh=function(){let o=this;if(o._auxMeshArray.length>0){for(let m=0;m<o._auxMeshArray.length;m++){let v=o._auxMeshArray[m];this.mEarthCtrl.coreMap.scene.primitives.remove(v)}this._auxMeshArray=[]}let f=Cl;if(o._showMesh===!0){let m=o._colorStyle[o._highlightState],v=o.parameter;{let y=H.fromDegrees(v.lon,v.lat,v.height),x={heading:xe.toRadians(v.heading+90),pitch:xe.toRadians(90-v.pitch),roll:xe.toRadians(v.roll)},C=tn.headingPitchRollQuaternion(y,x);VDe=Gr.fromAxisAngle(o.videoProjection._lightCamera.direction,xe.toRadians(90),VDe),Gr.multiply(VDe,C,C);{let w=new co({geometry:new OU({frustum:this.videoProjection._lightCamera.frustum,origin:y,orientation:C,vertexFormat:un.ALL}),id:"ellipsoid",attributes:{color:ea.fromColor(m.withAlpha(.1))}}),A=new Ia({shadows:f.DISABLED,geometryInstances:w,appearance:new ms});this.mEarthCtrl.coreMap.scene.primitives.add(A),o._auxMeshArray.push(A)}{let w=new co({geometry:new RY({frustum:this.videoProjection._lightCamera.frustum,origin:y,orientation:C,vertexFormat:un.ALL}),id:"outlines",shadows:f.DISABLED,attributes:{color:ea.fromColor(m.withAlpha(.8))}}),A=new Ia({geometryInstances:w,appearance:new ms({translucent:!0,flat:!0}),shadows:f.DISABLED,asynchronous:!1});this.mEarthCtrl.coreMap.scene.primitives.add(A),o._auxMeshArray.push(A)}{let w=new co({geometry:new V0({radii:new H(.1,.1,.1),vertexFormat:un.POSITION_AND_NORMAL}),modelMatrix:Ee.multiplyByTranslation(tn.eastNorthUpToFixedFrame(H.fromDegrees(v.lon,v.lat,v.height)),new H(0,0,0),new Ee),id:"ellipsoid",shadows:f.DISABLED,attributes:{color:ea.fromColor(m.withAlpha(.5))}}),A=new Ia({geometryInstances:w,appearance:new ms});this.mEarthCtrl.coreMap.scene.primitives.add(A),o._auxMeshArray.push(A)}}}};EP.prototype.addToMap=function(){this.videoProjection!==null&&(this.mEarthCtrl.textureProjectionMapList.push(this.videoProjection),this.updateAuxMesh())};EP.prototype.setEnable=function(o){this.videoProjection!==null&&(this.videoProjection.enabled=o)};EP.prototype.remove=function(){let o=this;if(o.videoProjection!==null){let f=o.mEarthCtrl.textureProjectionMapList;for(let m=0;m<f.length;m++){let v=f[m];o.videoProjection===v&&f.splice(m,1)}}if(o._auxMeshArray.length>0){for(let f=0;f<o._auxMeshArray.length;f++){let m=o._auxMeshArray[f];o.mEarthCtrl.coreMap.scene.primitives.remove(m)}o._auxMeshArray=[]}};EP.prototype.toJSON=function(){return Ws.export(this)};EP.prototype.updateBlend=function(o,f,m,v){this.videoProjection&&this.videoProjection.updateBlend(this.coreMap.scene.context,o,f,m,v)};var zDe=EP;function _8(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this.shadowMap=null,this._rtti="GwVideoProjection"}_8.prototype.initialize=function(o){let f=new Vl(this.coreMap.scene);f.setView({destination:o.destination,orientation:o.orientation}),f.frustum.fov=o.fov||Math.PI/3,f.frustum.near=o.near||1,f.frustum.far=o.far||1e5,f.frustum.aspectRatio=o.aspect||1;let m=new mD({name:o.name,context:this.coreMap.scene.context,lightCamera:f,enabled:o.enabled||!0,isPointLight:!1,cascadesEnabled:!1,numberOfCascades:1,frustum:{fov:o.fov||Math.PI/3,near:o.near||1,far:o.far||1e5,aspectRatio:o.aspect||1},depthBias:o.depthBias,playVideo:o.playVideo});m.castTexture=o.castTexture,this.shadowMap=m,o.addToMap===!0&&this.addToMap()};_8.prototype.addToMap=function(){this.shadowMap!==null&&this.mEarthCtrl.shadowMapList.push(this.shadowMap)};_8.prototype.setEnable=function(o){this.shadowMap!==null&&(this.shadowMap.enabled=o)};_8.prototype.remove=function(){if(this.shadowMap!==null){let o=this.mEarthCtrl.shadowMapList;for(let f=0;f<o.length;f++){let m=o[f];this.shadowMap===m&&o.splice(f,1)}}};_8.prototype.toJSON=function(){return Ws.export(this)};var Tut=_8;function RD(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this.videoProjection=null,this._parameter=null,this._showMesh=!1,this._auxMesh=null,this._rtti="GwVideoProjection"}Object.defineProperties(RD.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this.videoProjection!==null?this.videoProjection.enabled:!1},set:function(o){this.videoProjection!==null&&(this.videoProjection.enabled=o)}},showMesh:{get:function(){return this._showMesh},set:function(o){this._showMesh=o,this.updateAuxMesh()}}});RD.prototype.setParameter=function(o){if(!!N(o)){if(N(o.lon)||N(o.lat)||N(o.height)||N(o.heading)||N(o.pitch)||N(o.roll)||N(o.near)||N(o.far)||N(o.aspect)){let f=this._parameter;for(let v in o)o.hasOwnProperty(v)&&N(f[v])&&(f[v]=o[v]);let m=this.videoProjection._lightCamera;m.setView({destination:H.fromDegrees(f.lon,f.lat,f.height),orientation:{heading:xe.toRadians(f.heading),pitch:xe.toRadians(f.pitch),roll:xe.toRadians(f.roll)}}),m.frustum.fov=170/180*Math.PI,m.frustum.near=f.near||1,m.frustum.far=f.far||1e5,m.frustum.aspectRatio=f.aspect||1}this.updateAuxMesh()}};RD.prototype.initialize=function(o){this._parameter=o;let f=this._parameter,m=new Vl(this.coreMap.scene);m.setView({destination:H.fromDegrees(f.lon,f.lat,f.height),orientation:{heading:xe.toRadians(f.heading),pitch:xe.toRadians(f.pitch),roll:xe.toRadians(f.roll)}}),m.frustum.fov=170/180*Math.PI,m.frustum.near=f.near||1,m.frustum.far=f.far||1e5,m.frustum.aspectRatio=f.aspect||1;let v=new OY({name:f.name,matchMaterials:f.matchMaterials,context:this.coreMap.scene.context,lightCamera:m,enabled:f.enabled||!0,isPointLight:!1,cascadesEnabled:!1,numberOfCascades:1,frustum:{fov:170/180*Math.PI,near:f.near||1,far:f.far||1e5,aspectRatio:f.aspect||1},depthBias:f.depthBias,videoFrameInterval:f.videoFrameInterval,playVideo:f.playVideo,opacity:f.opacity,maxDiffAngle:f.maxDiffAngle,maximumDistance:f.maximumDistance||1e3});v.castTexture=f.castTexture,this.videoProjection=v,this._showMesh=f.showMesh,f.addToMap===!0&&this.addToMap()};RD.prototype.updateAuxMesh=function(){let o=this;if(o._auxMesh&&(o.mEarthCtrl.factory.removeElement(o._auxMesh),o._auxMesh=null),o._showMesh===!0){let f=o.parameter,m=f.far||2;o._auxMesh=this.mEarthCtrl.factory.createElement({name:"sphere1",type:"ellipsoid",position:H.fromDegrees(f.lon,f.lat,f.height),parameters:{radii:new H(m,m,m),material:Re.RED.withAlpha(.1),outline:!0,outlineColor:Re.GREEN}})}};RD.prototype.addToMap=function(){this.videoProjection!==null&&(this.mEarthCtrl.textureProjectionMapList.push(this.videoProjection),this.updateAuxMesh())};RD.prototype.setEnable=function(o){this.videoProjection!==null&&(this.videoProjection.enabled=o)};RD.prototype.remove=function(){if(this.videoProjection!==null){let o=this.mEarthCtrl.textureProjectionMapList;for(let f=0;f<o.length;f++){let m=o[f];this.videoProjection===m&&o.splice(f,1)}}};RD.prototype.toJSON=function(){return Ws.export(this)};var HDe=RD;var YO=function(){let o=this;o.timer=null,o.interval=.05,o.isPause=!1,o.callbackList=new C4("callback")};YO.prototype.init=function(o){this.interval=o};YO.prototype.fini=function(){this.stop()};YO.prototype.start=function(){let o=this,f=function(){o.isPause===!1&&o.callbackList.notifyEvent(this,0)};o.timer=window.setInterval(f,this.interval*1e3)};YO.prototype.stop=function(){this.timer&&(window.clearInterval(this.timer),this.timer=null)};YO.prototype.setPause=function(o){this.isPause=o};YO.prototype.addListener=function(o){this.callbackList.addEventHandler(this,o)};YO.prototype.clearListeners=function(){this.callbackList.clearEventHandler()};var Ise=YO;function eJ(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this.trackInfos=[],this.timer=null,this.animationController=new Ise,this.currIndex=-1,this.startTime=0,this.currentTrackInfo=null}function qNi(o,f){if(o.length===0)return null;let m=null;for(let v=0;v<o.length&&o[v].timeStamp<f;v++)m=o[v];return m}function XNi(o,f){f.class==="LOOKAT"&&(f.duration===void 0&&(f.duration=4e3),N(f.position)||(f.position=H.fromDegrees(f.lon,f.lat,f.alt)),N(f.orientation)||(f.orientation={heading:xe.toRadians(f.heading),pitch:xe.toRadians(f.pitch),roll:xe.toRadians(f.roll)}),o.coreMap.camera.flyTo({destination:f.position,orientation:f.orientation,duration:f.duration/1e3}))}eJ.prototype.initialize=function(o){let f=0,m=this;for(let v=0;v<o.stations.length;v++){let y=o.stations[v];y.class==="LOOKAT"&&(y.timeStamp=f,f+=y.stopTime,m.trackInfos.push(y))}m.animationController.addListener(function(v){let y=new Date().getTime()-m.startTime,x=qNi(m.trackInfos,y);x!==m.currentTrackInfo&&(XNi(m.mEarthCtrl,x),m.currentTrackInfo=x)})};eJ.prototype.finalize=function(){this.animationController.finalize(),this.currentTrackInfo=null};eJ.prototype.play=function(){let o=this;o.currentTrackInfo=null,o.startTime=new Date().getTime(),o.animationController.start()};eJ.prototype.stop=function(){this.animationController.stop(),this.currentTrackInfo=null};var Sut=eJ;var Mse=class extends mc{constructor(f,m){super(f,m),this._rtti="Fire",this._primitive=null,this._parameter=m,this._spatialTransform.createFromWgs84(m.lon,m.lat,m.alt,m.heading,m.pitch,m.roll)}addToMap(){let f=this._parameter,m=this._coreMap;function v(){let C=dl.fromDegrees(0,0,0),w=new ob;return w.translation=H.fromElements(2.5,4,1),w.rotation=Gr.fromHeadingPitchRoll(C),Ee.fromTranslationRotationScale(w)}let y=Z(f.particleSize,30),x=m.scene.primitives.add(new sA({image:Z(f.image,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/fire.png`),startColor:Z(f.startColor,Re.RED.withAlpha(.7)),endColor:Z(f.endColor,Re.YELLOW.withAlpha(.3)),startScale:Z(f.startScale,1),endScale:Z(f.endScale,4),minimumParticleLife:Z(f.minimumParticleLife,1),maximumParticleLife:Z(f.maximumParticleLife,6),minimumSpeed:Z(f.minimumSpeed,5),maximumSpeed:Z(f.maximumSpeed,10),imageSize:new Ye(y,y),emissionRate:Z(f.emissionRate,5),bursts:[],lifetime:Z(f.lifeTime,16),emitter:new R6(xe.toRadians(30)),modelMatrix:this._spatialTransform.modelMatrix,emitterModelMatrix:v()}));this._primitive=x}removeFromMap(){this._primitive!==null&&this._coreMap.scene.primitives.remove(this._primitive)}toJSON(){let f=this;return Ws.export(f)}};Object.defineProperties(Mse.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var UDe=Mse;var Dse=class extends mc{constructor(f,m){super(f,m),this._rtti="Smoke",this._primitive=null,this._parameter=m,this._spatialTransform.createFromWgs84(m.lon,m.lat,m.alt,m.heading,m.pitch,m.roll),this._coreMap=f.coreMap}addToMap(){let f=this._parameter,m=this._coreMap;function v(){let C=dl.fromDegrees(0,0,0),w=new ob;return w.translation=H.fromElements(2.5,4,1),w.rotation=Gr.fromHeadingPitchRoll(C),Ee.fromTranslationRotationScale(w)}let y=Z(f.particleSize,30),x=m.scene.primitives.add(new sA({image:Z(f.image,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/smoke.png`),startColor:Z(f.startColor,Re.fromRgba(3425907507)),endColor:Z(f.endColor,Re.fromRgba(1154272460)),startScale:Z(f.startScale,1),endScale:Z(f.endScale,4),minimumParticleLife:Z(f.minimumParticleLife,1),maximumParticleLife:Z(f.maximumParticleLife,6),minimumSpeed:Z(f.minimumSpeed,5),maximumSpeed:Z(f.maximumSpeed,20),imageSize:new Ye(y,y),emissionRate:Z(f.emissionRate,10),bursts:[],lifetime:Z(f.lifeTime,16),emitter:new R6(xe.toRadians(30)),modelMatrix:this._spatialTransform.modelMatrix,emitterModelMatrix:v()}));this._primitive=x}removeFromMap(){this._primitive!==null&&this._coreMap.scene.primitives.remove(this._primitive)}toJSON(){let f=this;return Ws.export(f)}};Object.defineProperties(Dse.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}},lon:{get:function(){if(this._parameter!==null)return this._lon},set:function(o){if(this._parameter!==null){if(this._lon===o)return;this._parameter.lon=o,this._spatialTransform.createFromWgs84(this._parameter.lon,this._parameter.lat,this._parameter.alt,this._parameter.heading,this._parameter.pitch,this._parameter.roll),this._primitive.modelMatrix=this._spatialTransform.modelMatrix}}},lat:{get:function(){if(this._parameter!==null)return this._lat},set:function(o){if(this._parameter!==null){if(this._lat===o)return;this._parameter.lat=o,this._spatialTransform.createFromWgs84(this._parameter.lon,this._parameter.lat,this._parameter.alt,this._parameter.heading,this._parameter.pitch,this._parameter.roll),this._primitive.modelMatrix=this._spatialTransform.modelMatrix}}},particleSize:{get:function(){if(this._primitive!==null)return this._primitive.particleSize},set:function(o){if(this._parameter!==null){if(this._parameter.particleSize===o)return;this._parameter.particleSize=o,this._primitive.imageSize=new Ye(this._parameter.particleSize,this._parameter.particleSize)}}}});var GDe=Dse;var Lse=class extends mc{constructor(f,m){super(f,m),this._rtti="Explosion",this._primitive=null,this._parameter=m,this._spatialTransform.createFromWgs84(m.lon,m.lat,m.alt,m.heading,m.pitch,m.roll),this._coreMap=f.viewer}finalize(){}addToMap(){let f=this._parameter,m=this._coreMap;function v(){let L=dl.fromDegrees(0,0,0),R=new ob;return R.translation=H.fromElements(2.5,4,1),R.rotation=Gr.fromHeadingPitchRoll(L),Ee.fromTranslationRotationScale(R)}let y=this._spatialTransform.modelMatrix,x=new H(0,0,0),C=30,w=100,A=new Ye(30,30),E=400,T=10,S=new Ee;function M(L,R,O){let F=H.add(x,L,new H),k=Ee.fromTranslation(F,S),U=Ee.multiply(y,k,new Ee),G=Ee.inverseTransformation(U,U),j=xe.randomBetween(C,w),q=new H,J=function(ie){let re=Ee.multiplyByPoint(G,ie.position,q);H.magnitudeSquared(re)>=j*j&&H.clone(H.ZERO,ie.velocity)},X=(j-C)/(w-C),Y=.3,ee=X*(1-Y)+Y;return m.scene.primitives.add(new sA({image:Z(f.image,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/fire.png`),startColor:R,endColor:R.withAlpha(0),particleLife:ee,speed:100,imageSize:A,emissionRate:0,emitter:new B6(.1),bursts:O,lifetime:T,updateCallback:J,modelMatrix:y,emitterModelMatrix:k}))}let I=[];for(let L=0;L<3;++L)I.push(new F6({time:xe.nextRandomNumber()*T,minimum:E,maximum:E}));let P=new H(0,0,0),D=Re.WHITE.withAlpha(.7);this._primitive=M(P,D,I)}removeFromMap(){this._primitive!==null&&this._coreMap.scene.primitives.remove(this._primitive)}toJSON(){let f=this;return Ws.export(f)}};Object.defineProperties(Lse.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var WDe=Lse;var Rse=class extends mc{constructor(f,m){super(f,m),this._rtti="Fireworks",this._primitives=[],this._parameter=m,this._spatialTransform.createFromWgs84(m.lon,m.lat,m.alt,m.heading,m.pitch,m.roll)}addToMap(){let f=this._parameter,m=this._coreMap,v=Z(f.emitHeight,100);function y(){let J=dl.fromDegrees(0,0,0),X=new ob;return X.translation=H.fromElements(2.5,4,1),X.rotation=Gr.fromHeadingPitchRoll(J),Ee.fromTranslationRotationScale(X)}xe.setRandomNumberSeed(315);let x=this._spatialTransform.modelMatrix,C=new H(0,0,v),w;function A(){if(!N(w)){w=document.createElement("canvas"),w.width=20,w.height=20;let J=w.getContext("2d");J.beginPath(),J.arc(8,8,8,0,xe.TWO_PI,!0),J.closePath(),J.fillStyle="rgb(255, 255, 255)",J.fill()}return w}let E=30,T=100,S=new Ye(7,7),M=400,I=10,P=20,D=new Ee,L=this;function R(J,X,Y){let Q=H.add(C,J,new H),ee=Ee.fromTranslation(Q,D),z=Ee.multiply(x,ee,new Ee),ie=Ee.inverseTransformation(z,z),re=xe.randomBetween(E,T),ne=new H,oe=function(pe){let ce=Ee.multiplyByPoint(ie,pe.position,ne);H.magnitudeSquared(ce)>=re*re&&H.clone(H.ZERO,pe.velocity)},se=(re-E)/(T-E),ae=.3,de=se*(1-ae)+ae,ve=m.scene.primitives.add(new sA({image:A(),startColor:X,endColor:X.withAlpha(0),particleLife:de,speed:100,imageSize:S,emissionRate:0,emitter:new B6(.1),bursts:Y,lifetime:I,updateCallback:oe,modelMatrix:x,emitterModelMatrix:ee}));L._primitives.push(ve)}let O=-100,F=100,k=-80,U=100,G=-50,j=50,q=[{minimumRed:.75,green:0,minimumBlue:.8,alpha:1},{red:0,minimumGreen:.75,minimumBlue:.8,alpha:1},{red:0,green:0,minimumBlue:.8,alpha:1},{minimumRed:.75,minimumGreen:.75,blue:0,alpha:1}];for(let J=0;J<P;++J){let X=xe.randomBetween(O,F),Y=xe.randomBetween(k,U),Q=xe.randomBetween(G,j),ee=new H(X,Y,Q),z=Re.fromRandom(q[J%q.length]),ie=[];for(let re=0;re<3;++re)ie.push(new F6({time:xe.nextRandomNumber()*I,minimum:M,maximum:M}));R(ee,z,ie)}}removeFromMap(){for(let f in this._primitives)this._coreMap.scene.primitives.remove(this._primitives[f]);this._primitives=[]}toJSON(){console.log("fireworks=========================>>>>>",this);let f=this;return Ws.export(f)}};Object.defineProperties(Rse.prototype,{parameter:{get:function(){return this._parameter}},emitHeight:{get:function(){return this._parameter!==null?this._parameter.emitHeight:0},set:function(o){this._parameter!==null&&(this._parameter.emitHeight=o)}},show:{get:function(){return this._primitives.length>0?this._primitives[0].show:!1},set:function(o){for(let f in this._primitives)this._primitives[f].show=o}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var jDe=Rse;var Mut=qK(Iut(),1),cu={defaults:{useEntitiesIfAvailable:!0,minCanvasSize:700,maxCanvasSize:2e3,radiusFactor:60,spacingFactor:1.5,maxOpacity:.8,minOpacity:.1,blur:.85,gradient:{0:"#00AEFF",".58":"#A8FF00",".70":"#FFF000",".85":"#FE9B1A",1:"#FE411B"},mode3D:!1,scaleHeight:1}};cu.create=function(o,f,m){return new xb(o,f,m)};cu._getContainer=function(o,f,m){let v=document.createElement("div");return m&&v.setAttribute("id",m),v.setAttribute("style",`width: ${o}px; height: ${f}px; margin: 0px; display: none;`),document.body.appendChild(v),v};cu._getImageryProvider=function(o){let f=o._heatmap.getDataURL(),m=new EC({url:f,rectangle:o._rectangle});return m._tilingScheme=new Mm({rectangleSouthwestInMeters:new Ye(o._mbounds.west,o._mbounds.south),rectangleNortheastInMeters:new Ye(o._mbounds.east,o._mbounds.north)}),m};cu._getID=function(o){let f="",m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";for(let v=0;v<(o||8);v++)f+=m.charAt(Math.floor(xe.nextRandomNumber()*m.length));return f};var v8=new hd;cu.wgs84ToMercator=function(o){let f=v8.project(Mt.fromDegrees(o.x,o.y));return{x:f.x,y:f.y}};cu.wgs84ToMercatorBB=function(o){let f=v8.project(Mt.fromDegrees(o.west,o.south)),m=v8.project(Mt.fromDegrees(o.east,o.north));return{north:m.y,east:m.x,south:f.y,west:f.x}};cu.mercatorToWgs84=function(o){let f=v8.unproject(new H(o.x,o.y));return{x:f.longitude,y:f.latitude}};cu.mercatorToWgs84BB=function(o){let f=v8.unproject(new H(o.west,o.south)),m=v8.unproject(new H(o.east,o.north));return{north:this.rad2deg(m.latitude),east:this.rad2deg(m.longitude),south:this.rad2deg(f.latitude),west:this.rad2deg(f.longitude)}};cu.deg2rad=function(o){return o*(Math.PI/180)};cu.rad2deg=function(o){return o/(Math.PI/180)};function xb(o,f,m){if(!f)return null;m||(m={}),this._earthCtrl=o,this._options=m,this._id=cu._getID(),this._options.gradient=this._options.gradient?this._options.gradient:cu.defaults.gradient,this._options.maxOpacity=this._options.maxOpacity?this._options.maxOpacity:cu.defaults.maxOpacity,this._options.minOpacity=this._options.minOpacity?this._options.minOpacity:cu.defaults.minOpacity,this._options.blur=this._options.blur?this._options.blur:cu.defaults.blur,this._mbounds=cu.wgs84ToMercatorBB(f),this._setWidthAndHeight(this._mbounds),this._options.radius=Math.round(this._options.radius?this._options.radius:this.width>this.height?this.width/cu.defaults.radiusFactor:this.height/cu.defaults.radiusFactor),this._spacing=this._options.radius*cu.defaults.spacingFactor,this._xoffset=this._mbounds.west,this._yoffset=this._mbounds.south,this.width=Math.round(this.width+this._spacing*2),this.height=Math.round(this.height+this._spacing*2),this._mbounds.west-=this._spacing*this._factor,this._mbounds.east+=this._spacing*this._factor,this._mbounds.south-=this._spacing*this._factor,this._mbounds.north+=this._spacing*this._factor,this.bounds=cu.mercatorToWgs84BB(this._mbounds),this._rectangle=Di.fromDegrees(this.bounds.west,this.bounds.south,this.bounds.east,this.bounds.north),this._container=cu._getContainer(this.width,this.height,this._id),this._options.container=this._container,this._heatmap=Mut.default.create(this._options),this._container.children[0].setAttribute("id",`${this._id}-hm`),this._mode3D=this._options.mode3D?this._options.mode3D:cu.defaults.mode3D,this._scaleHeight=this._options.scaleHeight?this._options.scaleHeight:cu.defaults.scaleHeight,this._scaleHeight<=0&&(this._scaleHeight=1),this._granularity=this._options.granularity?this._options.granularity:xe.RADIANS_PER_DEGREE,this._useEntitiesIfAvailable=this._options.useEntitiesIfAvailable!==void 0?this._options.useEntitiesIfAvailable:cu.defaults.useEntitiesIfAvailable,this._lineCount=Z(this._options.lineCount,new Ye(1e3,1e3)),this._lineWidth=Z(this._options.lineWidth,1),console.info(this._lineCount)}xb.prototype.wgs84PointToHeatmapPoint=function(o){return this.mercatorPointToHeatmapPoint(cu.wgs84ToMercator(o))};xb.prototype.mercatorPointToHeatmapPoint=function(o){let f={};return f.x=Math.round((o.x-this._xoffset)/this._factor+this._spacing),f.y=Math.round((o.y-this._yoffset)/this._factor+this._spacing),f.y=this.height-f.y,f};xb.prototype.getValueAt=function(o,f){let m=this.wgs84PointToHeatmapPoint({x:o,y:f});return this._heatmap.getValueAt({x:m.x,y:m.y})};xb.prototype.setMode3D=function(o){o!==this._mode3D&&(this._mode3D=o,this.updateLayer())};xb.prototype._setWidthAndHeight=function(o){this.width=o.east>0&&o.west<0?o.east+Math.abs(o.west):Math.abs(o.east-o.west),this.height=o.north>0&&o.south<0?o.north+Math.abs(o.south):Math.abs(o.north-o.south),this._factor=1,this.width>this.height&&this.width>cu.defaults.maxCanvasSize?(this._factor=this.width/cu.defaults.maxCanvasSize,this.height/this._factor<cu.defaults.minCanvasSize&&(this._factor=this.height/cu.defaults.minCanvasSize)):this.height>this.width&&this.height>cu.defaults.maxCanvasSize?(this._factor=this.height/cu.defaults.maxCanvasSize,this.width/this._factor<cu.defaults.minCanvasSize&&(this._factor=this.width/cu.defaults.minCanvasSize)):this.width<this.height&&this.width<cu.defaults.minCanvasSize?(this._factor=this.width/cu.defaults.minCanvasSize,this.height/this._factor>cu.defaults.maxCanvasSize&&(this._factor=this.height/cu.defaults.maxCanvasSize)):this.height<this.width&&this.height<cu.defaults.minCanvasSize&&(this._factor=this.height/cu.defaults.minCanvasSize,this.width/this._factor>cu.defaults.maxCanvasSize&&(this._factor=this.width/cu.defaults.maxCanvasSize)),this.width=this.width/this._factor,this.height=this.height/this._factor};xb.prototype.setData=function(o,f,m){return m&&m.length>0&&o!==null&&o!==!1&&f!==null&&f!==!1?(this._heatmap.setData({min:o,max:f,data:m}),this.updateLayer(),!0):!1};xb.prototype.addWGS84Data=function(o){if(o){let f=Array.isArray(o)?o:[o],m=[];for(let v=0;v<f.length;v++){let y=f[v],x=this.wgs84PointToHeatmapPoint(y);(y.value||y.value===0)&&(x.value=y.value),m.push(x)}return this._heatmap.addData(m),this.updateLayer(),!0}return!1};xb.prototype.setWGS84Data=function(o,f,m){if(m&&m.length>0&&o!==null&&o!==!1&&f!==null&&f!==!1){let v=[];for(let y=0;y<m.length;y++){let x=m[y],C=this.wgs84PointToHeatmapPoint(x);(x.value||x.value===0)&&(C.value=x.value),v.push(C)}return this.setData(o,f,v)}return!1};xb.prototype.show=function(o){this._layer&&(this._layer.show=o)};xb.prototype.remove=function(){cu.defaults.useEntitiesIfAvailable&&this._earthCtrl.entities?this._layer&&this._earthCtrl.primitives.remove(this._layer):this._layer&&this._earthCtrl.coreMap.scene.imageryLayers.remove(this._layer)};Object.defineProperties(xb.prototype,{readyPromise:{get:function(){return this._layer.readyPromise}}});function JNi(o){return new zo({fabric:{type:"HeatMapMaterial",materials:{imageMaterial:{type:"Image",uniforms:{image:o}},gridMaterial:{type:"Grid"}},components:{emission:" imageMaterial.diffuse * gridMaterial.diffuse",diffuse:" imageMaterial.diffuse * gridMaterial.diffuse",alpha:"imageMaterial.alpha * gridMaterial.alpha*2.0"}},translucent:!1})}xb.prototype.updateLayer=function(){if(this._useEntitiesIfAvailable&&this._earthCtrl.entities){this._layer&&this._earthCtrl.primitives.remove(this._layer);let o=this,f=this._rectangle,m=H.fromRadiansArray([f.west,f.north,f.east,f.north,f.east,f.south,f.west,f.south]),v=JNi(this._heatmap._renderer.canvas);v.materials.gridMaterial.uniforms.color=Re.WHITE,v.materials.gridMaterial.uniforms.cellAlpha=.1,v.materials.gridMaterial.uniforms.lineCount=this._lineCount,v.materials.gridMaterial.uniforms.lineThickness=new Ye(this._lineWidth,this._lineWidth),v.update(o._earthCtrl.coreMap.scene.context),this._layer=this._earthCtrl.primitives.add(new Ia({geometryInstances:new co({geometry:new Ec({polygonHierarchy:new ho(m),granularity:o._granularity})}),appearance:new Nd({material:v}),heatMap:o._mode3D?o:void 0,scaleHeight:o._scaleHeight}))}else this._layer&&this._earthCtrl.coreMap.scene.imageryLayers.remove(this._layer),this._layer=this._earthCtrl.coreMap.scene.imageryLayers.addImageryProvider(cu._getImageryProvider(this))};function Dut(o,f){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._color=Z(f.color,Re.YELLOW.withAlpha(1)),this._maxRadius=Z(f.maxRadius,1500),this._duration=Z(f.duration,4e3),this._lon=Z(f.lon,121),this._lat=Z(f.lat,31),this._height=Z(f.height,500),this._cartoCenter=Mt.fromDegrees(this._lon,this._lat),this._pps=null,this._rtti="RadarScan",this._parameter=f,this.toJSON=function(){return Ws.export(this)},this.removeFromMap=function(){Lut(this)}}function KNi(o){if(N(o._pps))return;let f=o._cartoCenter,m=Mt.toCartesian(f),v=new Wt(m.x,m.y,m.z,1),y=new Mt(f.longitude,f.latitude,f.height+o._height),x=Mt.toCartesian(y),C=new Wt(x.x,x.y,x.z,1),w=new Mt(f.longitude+xe.toRadians(.001),f.latitude,f.height),A=Mt.toCartesian(w),E=new Wt(A.x,A.y,A.z,1),T=new Gr,S=new Ut,M=new Date().getTime(),I=new Wt,P=new Wt,D=new Wt,L=new H,R=new H,O=o.mEarthCtrl.coreMap.scene.camera;o._pps=new as({fragmentShader:QNi(),uniforms:{u_scanCenterEC:function(){return Ee.multiplyByVector(O._viewMatrix,v,I)},u_scanPlaneNormalEC:function(){let k=Ee.multiplyByVector(O._viewMatrix,v,I),U=Ee.multiplyByVector(O._viewMatrix,C,P);return L.x=U.x-k.x,L.y=U.y-k.y,L.z=U.z-k.z,H.normalize(L,L),L},u_radius:o._maxRadius,u_scanLineNormalEC:function(){let k=Ee.multiplyByVector(O._viewMatrix,v,I),U=Ee.multiplyByVector(O._viewMatrix,C,P),G=Ee.multiplyByVector(O._viewMatrix,E,D);L.x=U.x-k.x,L.y=U.y-k.y,L.z=U.z-k.z,H.normalize(L,L),R.x=G.x-k.x,R.y=G.y-k.y,R.z=G.z-k.z;let j=(new Date().getTime()-M)%o._duration/o._duration;return Gr.fromAxisAngle(L,j*xe.PI*2,T),Ut.fromQuaternion(T,S),Ut.multiplyByVector(S,R,R),H.normalize(R,R),R},u_scanColor:o._color}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function Lut(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function QNi(){return`uniform sampler2D colorTexture; uniform sampler2D depthTexture; in vec2 v_textureCoordinates; uniform vec4 u_scanCenterEC; uniform vec3 u_scanPlaneNormalEC; uniform vec3 u_scanLineNormalEC; uniform float u_radius; uniform vec4 u_scanColor; vec4 toEye(in vec2 uv, in float depth) { vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0)); vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0); posInCamera =posInCamera / posInCamera.w; return posInCamera; } bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt) { vec3 v01 = testPt - ptOnLine; normalize(v01); vec3 temp = cross(v01, lineNormal); float d = dot(temp, u_scanPlaneNormalEC); return d > 0.5; } vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point) { vec3 v01 = point -planeOrigin; float d = dot(planeNormal, v01) ; return (point - planeNormal * d); } float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt) { vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt); return length(tempPt - ptOnLine); } float getDepth(in vec4 depth) { float z_window = czm_unpackDepth(depth); z_window = czm_reverseLogDepth(z_window); float n_range = czm_depthRange.near; float f_range = czm_depthRange.far; return (2.0 * z_window - n_range - f_range) / (f_range - n_range); } void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); float depth = getDepth( texture(depthTexture, v_textureCoordinates)); vec4 viewPos = toEye(v_textureCoordinates, depth); vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz); float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz); float twou_radius = u_radius * 2.0; if(dis < u_radius) { vec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius; float f = 0.0; if(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz)) { float dis1= length(prjOnPlane.xyz - lineEndPt); f = abs(twou_radius -dis1) / twou_radius; f = pow(f, 3.0); } out_FragColor = mix(out_FragColor, u_scanColor, f); } } `}Object.defineProperties(Dut.prototype,{parameter:{get:function(){return this._parameter}},lon:{get:function(){if(this._parameter!==null)return this._lon},set:function(o){if(this._parameter!==null){if(this._lon===o)return;this._parameter.lon=o}}},lat:{get:function(){if(this._parameter!==null)return this._lat},set:function(o){if(this._parameter!==null){if(this._lat===o)return;this._parameter.lat=o}}},show:{get:function(){return this._pps!==null},set:function(o){this.show!==o&&(this._parameter.show=o,this._show=o,o?KNi(this):Lut(this))}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var YDe=Dut;function Rut(o,f){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._color=Z(f.color,Re.YELLOW.withAlpha(1)),this._maxRadius=Z(f.maxRadius,1500),this._duration=Z(f.duration,4e3),this._lon=Z(f.lon,121),this._lat=Z(f.lat,31),this._height=Z(f.height,500),this._cartoCenter=Mt.fromDegrees(this._lon,this._lat),this._pps=null,this._rtti="CircleScan",this._parameter=f,this.toJSON=function(){return Ws.export(this)},this.removeFromMap=function(){Out(this)}}function ZNi(o){if(N(o._pps))return;let f=o._cartoCenter,m=Mt.toCartesian(f),v=new Wt(m.x,m.y,m.z,1),y=new Mt(f.longitude,f.latitude,f.height+o._height),x=Mt.toCartesian(y),C=new Wt(x.x,x.y,x.z,1),w=new Date().getTime(),A=new Wt,E=new Wt,T=new H,S=o.mEarthCtrl.coreMap.scene.camera;o._pps=new as({fragmentShader:$Ni(),uniforms:{u_scanCenterEC:function(){return Ee.multiplyByVector(S._viewMatrix,v,A)},u_scanPlaneNormalEC:function(){let I=Ee.multiplyByVector(S._viewMatrix,v,A),P=Ee.multiplyByVector(S._viewMatrix,C,E);return T.x=P.x-I.x,T.y=P.y-I.y,T.z=P.z-I.z,H.normalize(T,T),T},u_radius:function(){return o._maxRadius*((new Date().getTime()-w)%o._duration)/o._duration},u_scanColor:o._color}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function Out(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function $Ni(){return`uniform sampler2D colorTexture; uniform sampler2D depthTexture; in vec2 v_textureCoordinates; uniform vec4 u_scanCenterEC; uniform vec3 u_scanPlaneNormalEC; uniform float u_radius; uniform vec4 u_scanColor; vec4 toEye(in vec2 uv, in float depth) { vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0)); vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0); posInCamera =posInCamera / posInCamera.w; return posInCamera; } vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point) { vec3 v01 = point -planeOrigin; float d = dot(planeNormal, v01) ; return (point - planeNormal * d); } float getDepth(in vec4 depth) { float z_window = czm_unpackDepth(depth); z_window = czm_reverseLogDepth(z_window); float n_range = czm_depthRange.near; float f_range = czm_depthRange.far; return (2.0 * z_window - n_range - f_range) / (f_range - n_range); } void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); float depth = getDepth( texture(depthTexture, v_textureCoordinates)); vec4 viewPos = toEye(v_textureCoordinates, depth); vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz); float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz); if(dis < u_radius) { float f = dis/ u_radius; f = pow(f, 2.0); out_FragColor = mix(out_FragColor, u_scanColor, f); } } `}Object.defineProperties(Rut.prototype,{parameter:{get:function(){return this._parameter}},lon:{get:function(){if(this._parameter!==null)return this._lon},set:function(o){if(this._parameter!==null){if(this._lon===o)return;this._lon=o,this._parameter.lon=o}}},lat:{get:function(){if(this._parameter!==null)return this._lat},set:function(o){if(this._parameter!==null){if(this._lat===o)return;this._lat=o,this._parameter.lat=o}}},show:{get:function(){return this._pps!==null},set:function(o){this.show!==o&&(this._parameter.show=o,o?ZNi(this):Out(this))}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var Nut=Rut;function Fut(o,f){this.mEarthCtrl=o,this.coreMap=o.coreMap,this._color=Z(f.color,new Re(1,0,0,1)),this._maxRadius=Z(f.maxRadius,15e3),this._duration=Z(f.duration,4e3),this._lon=Z(f.lon,121),this._lat=Z(f.lat,31),this._height=Z(f.height,500),this._cartoCenter=Mt.fromDegrees(this._lon,this._lat),this._minHeight=Z(f.minHeight,10),this._maxHeight=Z(f.maxHeight,200),this._currentHeight=this._minHeight,this._pps=null}function eFi(o){if(N(o._pps))return;let f=o._cartoCenter,m=Mt.toCartesian(f),v=new Wt(m.x,m.y,m.z,1),y=new Mt(f.longitude,f.latitude,f.height+o._height),x=Mt.toCartesian(y),C=new Wt(x.x,x.y,x.z,1),w=new Date().getTime(),A=new Wt,E=new Wt,T=new H,S=o.mEarthCtrl.coreMap.scene.camera;o._pps=new as({fragmentShader:iFi(),uniforms:{u_scanCenterEC:function(){return Ee.multiplyByVector(S._viewMatrix,v,A)},u_scanPlaneNormalEC:function(){let I=Ee.multiplyByVector(S._viewMatrix,v,A),P=Ee.multiplyByVector(S._viewMatrix,C,E);return T.x=P.x-I.x,T.y=P.y-I.y,T.z=P.z-I.z,H.normalize(T,T),T},u_radius:function(){return o._maxRadius},u_currentHeight:function(){if(o._currentHeight>=o._maxHeight)o._currentHeight=o._minHeight;else{let I=o._maxHeight-o._minHeight;I=I*((new Date().getTime()-w)%o._duration)/o._duration,o._currentHeight=o._minHeight+I}return o._currentHeight},u_scanColor:o._color}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function tFi(o){N(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function iFi(){return`uniform sampler2D colorTexture; uniform sampler2D depthTexture; in vec2 v_textureCoordinates; uniform vec4 u_scanCenterEC; uniform vec3 u_scanPlaneNormalEC; uniform float u_radius; uniform vec4 u_scanColor; uniform float u_currentHeight; vec4 toEye(in vec2 uv, in float depth) { vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0)); vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0); posInCamera =posInCamera / posInCamera.w; return posInCamera; } vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point) { vec3 v01 = point -planeOrigin; float d = dot(planeNormal, v01) ; return (point - planeNormal * d); } float getDepth(in vec4 depth) { float z_window = czm_unpackDepth(depth); z_window = czm_reverseLogDepth(z_window); float n_range = czm_depthRange.near; float f_range = czm_depthRange.far; return (2.0 * z_window - n_range - f_range) / (f_range - n_range); } void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); float depth = getDepth( texture(depthTexture, v_textureCoordinates)); vec4 viewPos = toEye(v_textureCoordinates, depth); vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz); float height_dis = length(prjOnPlane.xyz-viewPos.xyz); if(height_dis >= u_currentHeight && height_dis <= (u_currentHeight+1.0)) { out_FragColor = mix(out_FragColor, u_scanColor, u_scanColor.a); } } `}Object.defineProperties(Fut.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._pps!==null},set:function(o){o===!0?eFi(this):tFi(this)}}});var But=Fut;function qDe(o,f){return this._earthCtrl=o,this._coreMap=o.coreMap,this.createPointLight(f),this}qDe.prototype.createPointLight=function(o){if(!o.lights){console.log("\u8BF7\u4F20\u5165\u70B9\u5149\u6E90\uFF01");return}let f=this._earthCtrl.imageryLayers;if(f.length>0&&o.globe){let y=f.get(0);y.brightness=o.globeBrightness||1}let m=JSON.parse(JSON.stringify(o.lights));for(let y=0;y<o.lights.length;y++)m[y].pointColor=Re.lerp(Re.BLACK,o.lights[y].pointColor,o.lights[y].brightness,new Re);o.globeBrightness===0&&(o.globeBrightness=.001);let v=new BY(this._coreMap,{globeParam:{globe:Z(o.globe,this._coreMap.scene.globe),brightness:Z(o.globeBrightness,1)},gltfParam:{gltf:Z(o.gltf,null),brightness:Z(o.globeBrightness,1)},tilesetParam:{tileset:Z(o.tileset,null),brightness:Z(o.globeBrightness,1)}},m)};qDe.prototype.updatePointLights=function(o){if(!o.lights){console.log("\u8BF7\u4F20\u5165\u70B9\u5149\u6E90\uFF01");return}let f=this._earthCtrl.imageryLayers;if(f.length>0&&o.globe){let y=f.get(0);y.brightness=o.globeBrightness||1}let m=JSON.parse(JSON.stringify(o.lights));for(let y=0;y<o.lights.length;y++)m[y].pointColor=Re.lerp(Re.BLACK,o.lights[y].pointColor,o.lights[y].brightness,new Re);o.globeBrightness===0&&(o.globeBrightness=.001);let v=new BY(this._coreMap,{globeParam:{globe:Z(o.globe,this._coreMap.scene.globe),brightness:Z(o.globeBrightness,1)},gltfParam:{gltf:Z(o.gltf,null),brightness:Z(o.globeBrightness,1)},tilesetParam:{tileset:Z(o.tileset,null),brightness:Z(o.globeBrightness,1)}},m)};var kut=qDe;var Nse=class extends mc{constructor(f,m){super(f,m),this._rtti="Billboard",this._primitive=null,this._parameter=m,this._earthCtrl=f,this._isCanvas=!1,this._canvas=null,this._spatialTransform.createFromWgs84(m.lon,m.lat,m.alt,m.heading,m.pitch,m.roll)}addToMap(){let f=this._parameter,m={position:H.fromDegrees(f.lon,f.lat,f.alt),name:f.name};if(f.image=Z(f.image,""),f.width=Z(f.width,16),f.height=Z(f.height,16),f.scale=Z(f.scale,1),m.billboard=f,typeof f.image=="string"){let v=f.image.split(".");if(v[v.length-1]==="svg"){this._isCanvas=!0,this.svgDraw(m);return}}this._primitive=this._earthCtrl.entities.add(m)}svgDraw(f){let m=this,v=new Image;this._svgImg=v,v.src=f.billboard.image;let y=Z(f.billboard.minSvgWidth,f.billboard.width),x=Z(f.billboard.minSvgHeight,f.billboard.height);document.body.appendChild(v),v.onload=function(){let C=f.billboard.scale,w=document.createElement("canvas");m._canvas=w;let A=w.getContext("2d");if(f.billboard.scaleByDistance){let E=f.billboard.scaleByDistance,T=E.nearValue>E.farValue?E.nearValue:E.farValue;C=C<T?T:C}if(v.clientWidth<y||v.clientHeight<x?(w.width=y*C,w.height=x*C):(w.width=v.clientWidth*C,w.height=v.clientHeight*C),w.width<512||w.height<512){let E=w.width/w.height;w.width<w.height?(w.width=512,w.height=512/E):(w.height=512,w.width=512*E)}A.drawImage(v,0,0,w.width,w.height),f.billboard.image=w.toDataURL("image/png"),m._primitive=m._earthCtrl.entities.add(f)}}changeCanvasScale(f){let m=this._primitive.billboard.width*f,v=this._primitive.billboard.height*f;if(m>=this._canvas.width&&this._canvas.width*1.5<=2048&&this._canvas.height*1.5<=3072){let y=this._canvas.getContext("2d");y.clearRect(0,0,this._canvas.width,this._canvas.height),this._canvas.width=this._canvas.width*1.5,this._canvas.height=this._canvas.height*1.5,y.drawImage(this._svgImg,0,0,this._canvas.width,this._canvas.height),this._primitive.billboard._image._value=this._canvas.toDataURL("image/png")}if(v>=this._canvas.height&&this._canvas.height*1.5<=2048&&this._canvas.width*1.5<=3072){let y=this._canvas.getContext("2d");y.clearRect(0,0,this._canvas.width,this._canvas.height),this._canvas.width=this._canvas.width*1.5,this._canvas.height=this._canvas.height*1.5,y.drawImage(this._svgImg,0,0,this._canvas.width,this._canvas.height),this._primitive.billboard._image._value=this._canvas.toDataURL("image/png")}}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(Nse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},lon:{get:function(){return this._parameter!==null?this._parameter.lon:!1},set:function(o){this._parameter!==null&&(this._primitive.position=H.fromDegrees(o,this._parameter.lat,this._parameter.alt),this._parameter.lon=o)}},lat:{get:function(){return this._parameter!==null?this._parameter.lat:!1},set:function(o){this._parameter!==null&&(this._primitive.position=H.fromDegrees(this._parameter.lon,o,this._parameter.alt),this._parameter.lat=o)}},alt:{get:function(){return this._parameter!==null?this._parameter.alt:!1},set:function(o){this._primitive!==null&&(this._primitive.position=H.fromDegrees(this._parameter.lon,this._parameter.lat,o),this._parameter.alt=o)}},image:{get:function(){return this._parameter!==null?this._parameter.image:!1},set:function(o){this._primitive!==null&&(this._primitive.billboard.image=o,this._parameter.image=o)}},scale:{get:function(){return this._parameter!==null?this._parameter.scale:!1},set:function(o){this._primitive!==null&&(this._isCanvas&&this.changeCanvasScale(o),this._primitive.billboard.scale=o,this._parameter.scale=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var XDe=Nse;var Fse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._spatialTransform.createFromWgs84(m.lon,m.lat,m.alt,m.heading,m.pitch,m.roll),m.scale=Z(m.scale,1),m.minimumPixelSize=Z(m.minimumPixelSize,10)}addToMap(){let f=this._parameter,m=null,v=Z(f.sourceType,"gltf");(v==="gltf"||v==="glb")&&(m=S_.fromGltf(f),m.modelMatrix=this._spatialTransform.modelMatrix),this._primitive=this._coreMap.scene.primitives.add(m)}removeFromMap(){this._primitive!==null&&this._coreMap.scene.primitives.remove(this._primitive)}toJSON(){let f=this;return new Promise(function(m,v){(void 0).all([f._primitive.readyPromise]).then(function(y){let x=Ws.export(f);console.log("modelObj",x),m(x)})})}};Object.defineProperties(Fse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},lon:{get:function(){return this._spatialTransform.longitude},set:function(o){this._spatialTransform.longitude=o}},lat:{get:function(){return this._spatialTransform.latitude},set:function(o){this._spatialTransform.latitude=o}},alt:{get:function(){return this._spatialTransform.altitude},set:function(o){this._spatialTransform.altitude=o}},heading:{get:function(){return this._spatialTransform.heading},set:function(o){this._spatialTransform.heading=o}},pitch:{get:function(){return this._spatialTransform.pitch},set:function(o){this._spatialTransform.pitch=o}},roll:{get:function(){return this._spatialTransform.roll},set:function(o){this._spatialTransform.roll=o}},parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},sourceType:{get:function(){return this._parameter!==null?this._parameter.sourceType:!1}},dataUrl:{get:function(){return this._parameter!==null?this._parameter.url:!1}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var JDe=Fse;function Vut(o,f,m,v,y,x){let C=H.fromDegrees(o,f,m),w=new dl(v*Math.PI/180,y*Math.PI/180,x*Math.PI/180),A=tn.localFrameToFixedFrameGenerator("north","west"),E=new Ee;return E=tn.headingPitchRollToFixedFrame(C,w,ki.WGS84,A,E),E}var zut=new Re,KDe=null,Bse=class{constructor(f,m){this._coreMap=f.coreMap,this._parameter=m}async addToMap(){let f=this._parameter,m=f.animationLoop||!1,v=Z(f.allowPicking,!1),y=f.count,x=[];for(let A=0;A<y;A++)x.push(0,0,0);let C=null,w=Z(f.sourceType,"gltf");(w==="gltf"||w==="glb")&&(C=await S_.fromGltfInstance({url:f.url,positions:x,incrementallyLoadTextures:!1,cull:!1,debugShowBoundingVolume:!1,allowPicking:v}),C&&(m&&C.readyEvent.addEventListener(()=>{C.activeAnimations.addAll({multiplier:.5,loop:RE.REPEAT})}),this._primitive=this._coreMap.scene.primitives.add(C),v&&this.pickObject()))}pickObject(){if(this._primitive===null)return;let f=this;f.modifyHandler||(f.modifyHandler=new Ur(f._coreMap.scene.canvas)),f.modifyHandler.setInputAction(function(m){KDe&&(KDe.color=zut);let v=f._coreMap.scene.pick(m.position);if(N(v)){let y=v.getPropertyIds(),x=y.length;for(let C=0;C<x;++C){let w=y[C],A=v.getProperty(w);KDe=v,zut=v.color,v.color=new Re(1,0,0,1)}}},Ei.LEFT_CLICK)}updatePositionAndDirection(f){if(this._primitive===null)return;let m=f.positions,v=f.directions,y=f.scale||1;if(!(m instanceof Array)||!(v instanceof Array)){console.error("positions \u6216\u8005 directions \u5FC5\u987B\u662F\u6570\u7EC4\u5F62\u5F0F");return}let x=[],C=0,w=0,A=0,E=m.length;for(let S=0;S<E;S+=3){let M=m[S],I=m[S+1],P=m[S+2];C+=M,w+=I,A+=P;let D=v[S],L=v[S+1],R=v[S+2],O=Vut(M,I,P,D,L,R),F=Ee.fromScale(new H(y,y,y)),k=new Ee;Ee.multiply(O,F,k),x.push(k)}let T=new Ee;{let S=E/3,M=C/S,I=w/S,P=A/S,D=Vut(M,I,P,0,0,0),L=Ee.fromScale(new H(5e3,5e3,5e3));Ee.multiply(D,L,T)}this._primitive.modelMatrix=T,this._primitive._loader.matrixs=x}removeFromMap(){this._primitive!==null&&this._coreMap.scene.primitives.remove(this._primitive)}toJSON(){let f=this;return new Promise(function(m,v){(void 0).all([f._primitive.readyPromise]).then(function(y){let x=Ws.export(f);console.log("modelObj",x),m(x)})})}};Object.defineProperties(Bse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},sourceType:{get:function(){return this._parameter!==null?this._parameter.sourceType:!1}},dataUrl:{get:function(){return this._parameter!==null?this._parameter.url:!1}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var Hut=Bse;var kse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._spatialTransform.createFromWgs84(m.lon,m.lat,m.alt,m.heading,m.pitch,m.roll)}addToMap(){let f=this._parameter,m={position:H.fromDegrees(f.lon,f.lat,f.alt),name:f.name};f.text=Z(f.text,""),f.font=Z(f.font,"12pt monospace"),f.style=Z(f.style,of.FILL_AND_OUTLINE),f.outlineWidth=Z(f.outlineWidth,2),f.verticalOrigin=Z(f.verticalOrigin,so.BOTTOM),f.pixelOffset=Z(f.pixelOffset,new Ye(0,-20)),m.label=f,f.image&&(m.billboard={image:f.image,scale:f.iScale,pixelOffset:f.iPixelOffset,eyeOffset:f.iEyeOffset,horizontalOrigin:f.iHorizontalOrigin,verticalOrigin:f.iVerticalOrigin,heightReference:f.iHeightReference,color:f.iColor,rotation:f.iRotation,alignedAxis:f.iAlignedAxis,sizeInMeters:f.iSizeInMeters,width:f.iWidth,height:f.iHeight,scaleByDistance:f.iScaleByDistance,translucencyByDistance:f.iTranslucencyByDistance,pixelOffsetScaleByDistance:f.iPixelOffsetScaleByDistance,imageSubRegion:f.imageSubRegion,distanceDisplayCondition:f.iDistanceDisplayCondition,disableDepthTestDistance:f.iDisableDepthTestDistance}),this._primitive=this._earthCtrl.entities.add(m)}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(kse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},parameter:{get:function(){return this._parameter}},text:{get:function(){return this._primitive!==null?this._primitive.label.text:!1},set:function(o){this._parameter!==null&&(this._primitive.label.text=o,this._parameter.text=o)}},image:{get:function(){return this._parameter!==null?this._parameter.billboard.image:""}},font:{get:function(){return this._parameter!==null?this._parameter.font:!1},set:function(o){this._parameter!==null&&(this._parameter.font=o)}},outlineWidth:{get:function(){return this._parameter!==null?this._parameter.outlineWidth:!1},set:function(o){this._parameter!==null&&(this._parameter.outlineWidth=o)}},verticalOrigin:{get:function(){return this._parameter!==null?this._parameter.verticalOrigin:!1},set:function(o){this._parameter!==null&&(this._parameter.verticalOrigin=o)}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}},fillColor:{get:function(){return this._primitive!==null?this._primitive.label.fillColor:!1},set:function(o){this._parameter!==null&&(this._primitive.label.fillColor=o,this._parameter.fillColor=o)}},lon:{get:function(){return this._parameter!==null?this._parameter.lon:!1},set:function(o){if(this._primitive!==null){this._parameter.lon=o;let f=H.fromDegrees(o,this._parameter.lat,this._parameter.alt);this._primitive.position=new xn(function(){return f},!1)}}},lat:{get:function(){return this._parameter!==null?this._parameter.lat:!1},set:function(o){if(this._primitive!==null){this._parameter.lat=o;let f=H.fromDegrees(this._parameter.lon,o,this._parameter.alt);this._primitive.position=new xn(function(){return f},!1)}}},alt:{get:function(){return this._parameter!==null?this._parameter.alt:!1},set:function(o){if(this._primitive!==null){this._parameter.alt=o;let f=H.fromDegrees(this._parameter.lon,this._parameter.lat,o);this._primitive.position=new xn(function(){return f},!1)}}}});var QDe=kse;var Vse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._parameter.lineWidth=Z(m.lineWidth,1)}addToMap(){let f=this._parameter,m=this._earthCtrl.entities.add({name:f.name,polyline:{positions:f.positions,width:f.lineWidth,material:f.lineColor,clampToGround:f.clampToGround,shadows:f.shadows,distanceDisplayCondition:f.distanceDisplayCondition}});this._primitive=m}updateMaterial(){let f,m=this._parameter;return N(m.outlineColor)?f=new SM({color:m.lineColor,outlineColor:m.outlineColor}):f=m.lineColor,f}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(Vse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},positions:{get:function(){return this._primitive.polyline.positions},set:function(o){this._primitive.polyline.positions=o,this._parameter.positions=o}},lineColor:{get:function(){return this._parameter.lineColor},set:function(o){this._parameter.lineColor=o,this._primitive.polyline.material=this.updateMaterial()}},outlineColor:{get:function(){return this._parameter.outlineColor},set:function(o){this._parameter.outlineColor=o,this._primitive.polyline.material=this.updateMaterial()}},lineWidth:{get:function(){return this._primitive.polyline.width},set:function(o){this._primitive.polyline.width=o,this._parameter.lineWidth=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}},clampToGround:{get:function(){return this._primitive!==null?this._primitive.polyline.clampToGround:!1},set:function(o){this._primitive!==null&&(this._primitive.polyline.clampToGround=o,this._parameter.clampToGround=o)}}});var ZDe=Vse;var zse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._parameter.lineWidth=Z(m.lineWidth,2)}addToMap(){let f=this._parameter,m=Z(f.outline,!0),v=f.material,y=Z(f.outlineColor,v),x=null;N(f.hierarchy)?x=f.hierarchy:x={positions:f.positions};let C=this._earthCtrl.entities.add({name:f.name,polygon:{hierarchy:{positions:f.positions},height:f.height,heightReference:f.heightReference,extrudedHeight:f.extrudedHeight,extrudedHeightReference:f.extrudedHeightReference,stRotation:f.stRotation,fill:f.fill,outlineWidth:f.lineWidth,material:v,outline:m,outlineColor:y,perPositionHeight:f.perPositionHeight,closeTop:f.closeTop,closeBottom:f.closeBottom,shadows:f.shadows,distanceDisplayCondition:f.distanceDisplayCondition}});this._primitive=C}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(zse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},positions:{get:function(){return this._primitive.polygon.hierarchy._value},set:function(o){this._primitive.polygon.hierarchy._value=o}},fillColor:{get:function(){return this._primitive.polygon.material},set:function(o){this._primitive.polygon.material=o}},outline:{get:function(){return this._primitive.polygon.outline},set:function(o){this._primitive.polygon.outline=o}},outlineColor:{get:function(){return this._primitive.polygon.outlineColor},set:function(o){this._primitive.polygon.outlineColor=o}},lineWidth:{get:function(){return this._primitive.polygon.outlineWidth},set:function(o){this._primitive.polygon.outlineWidth=o}},height:{get:function(){return this._primitive.polygon.height._value},set:function(o){this._primitive.polygon.height._value=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var $De=zse;var Hse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._tree=Ne}addToMap(){let f=this._parameter,m=H.fromDegrees(f.lon,f.lat,f.alt),v=this._earthCtrl.entities.add({position:m,name:f.name,show:Z(f.show,!0),point:{pixelSize:Z(f.pixelSize,1),color:f.color,outlineColor:f.outlineColor,outlineWidth:f.outlineWidth,distanceDisplayCondition:f.distanceDisplayCondition,heightReference:f.heightReference}});this._primitive=v}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}export(){var f=this.item.point.show==null?void 0:this.item.point.show._value,m=this.item.point.pixelSize==null?void 0:this.item.point.pixelSize._value,v=this.item.point.color==null?void 0:"rgba("+this.item.point.color._value.red+","+this.item.point.color._value.green+","+this.item.point.color._value.blue+","+this.item.point.color._value.alpha+")",y=this.item.point.outlineColor==null?void 0:"rgba("+this.item.point.outlineColor._value.red+","+this.item.point.outlineColor._value.green+","+this.item.point.outlineColor._value.blue+","+this.item.point.outlineColor._value.alpha+")",x=this.item.point.outlineWidth==null?void 0:this.item.point.outlineWidth._value,C=this.item.point.distanceDisplayCondition,w=C?._value.near,A=C?._value.far,E=this._cesium.Cartographic.fromCartesian(this.item.position._value),T=this._cesium.Math.toDegrees(E.longitude),S=this._cesium.Math.toDegrees(E.latitude),M=this._cesium.Math.toDegrees(E.height);return{type:"point",position:{x:T,y:S,z:M},treeobj:{name:this.treeobj.name},style:{show:f,pixelSize:m,color:v,outlineColor:y,outlineWidth:x,near:w,far:A}}}};Object.defineProperties(Hse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},point:{get:function(){return this._primitive.position},set:function(o){this._primitive.position=o}},pixelSize:{get:function(){return this._primitive.point.pixelSize},set:function(o){this._primitive.point.pixelSize=o,this._parameter.pixelSize=o}},color:{get:function(){return this._primitive.point.color},set:function(o){this._primitive!==null&&(this._primitive.point.color=o,this._parameter.color=o)}},outlineColor:{get:function(){return this._primitive.point.outlineColor},set:function(o){this._primitive.point.outlineColor=o}},outlineWidth:{get:function(){return this._primitive.point.lineWidth},set:function(o){this._primitive.point.lineWidth=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}},lon:{get:function(){return this._parameter!==null?this._parameter.lon:!1},set:function(o){this._parameter!==null&&(this._primitive.position=H.fromDegrees(o,this._parameter.lat,this._parameter.alt),this._parameter.lon=o)}},lat:{get:function(){return this._parameter!==null?this._parameter.lat:!1},set:function(o){this._parameter!==null&&(this._primitive.position=H.fromDegrees(this._parameter.lon,o,this._parameter.alt),this._parameter.lat=o)}},alt:{get:function(){return this._parameter!==null?this._parameter.alt:!1},set:function(o){this._parameter!==null&&(this._primitive.position=H.fromDegrees(this._parameter.lon,this._parameter.lat,o),this._parameter.alt=o)}}});var eLe=Hse;var Use=class extends mc{constructor(f,m){super(f,m),this._rtti="Box",this._parameter=null,this._primitive=null,this._parameter=m,this._parameter.lineWidth=Z(m.lineWidth,2),this._spatialTransform.createFromWgs84(m.lon,m.lat,m.alt,m.heading,m.pitch,m.roll)}addToMap(){let f=this._parameter,m=f.material,v=void 0,y=Z(f.outline,!0),x=f.fillColor,C=Z(f.outlineColor,x),w=this._earthCtrl.entities.add({position:f.position,name:f.name,box:{outlineWidth:f.lineWidth,material:m,fill:f.fill,outline:y,dimensions:f.dimensions,outlineColor:C,shadows:f.shadows,distanceDisplayCondition:f.distanceDisplayCondition,depthFailMaterial:v}});this._primitive=w}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(Use.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},position:{get:function(){return this._primitive.position},set:function(o){this._primitive.position=o,this._parameter.position=o}},fill:{get:function(){return this._primitive.box.fill},set:function(o){this._primitive.box.fill=o,this._parameter.fill=o}},material:{get:function(){return this._primitive.box.material},set:function(o){this._primitive.box.material=o,this._parameter.material=o}},outline:{get:function(){return this._primitive.box.outline},set:function(o){this._primitive.box.outline=o,this._parameter.outline=o}},outlineColor:{get:function(){return this._primitive.box.outlineColor},set:function(o){this._primitive.box.outlineColor=o,this._parameter.outlineColor=o}},dimensions:{get:function(){return this._primitive.box.dimensions},set:function(o){this._primitive.box.dimensions=o,this._parameter.dimensions=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var tLe=Use;var Gse=class extends mc{constructor(f,m){super(f,m),this._rtti="Cylinder",this._parameter=null,this._primitive=null,this._parameter=m,this._parameter.lineWidth=Z(m.lineWidth,2)}addToMap(){let f=this._parameter,m=this._earthCtrl.entities.add({position:f.position,name:f.name,cylinder:{length:f.length,topRadius:f.topRadius,bottomRadius:f.bottomRadius,fill:f.fill,material:f.material,outline:f.outline,outlineColor:f.outlineColor,outlineWidth:f.outlineWidth,numberOfVerticalLines:f.numberOfVerticalLines,slices:f.slices,shadows:f.shadows,distanceDisplayCondition:f.distanceDisplayCondition}});this._primitive=m}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(Gse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},position:{get:function(){return this._primitive.position},set:function(o){this._primitive.position=o,this._parameter.position=o}},length:{get:function(){return this._primitive.cylinder.length},set:function(o){this._primitive.cylinder.length=o,this._parameter.length=o}},topRadius:{get:function(){return this._primitive.cylinder.topRadius},set:function(o){this._primitive.cylinder.topRadius=o,this._parameter.topRadius=o}},bottomRadius:{get:function(){return this._primitive.cylinder.bottomRadius},set:function(o){this._primitive.cylinder.bottomRadius=o,this._parameter.bottomRadius=o}},fill:{get:function(){return this._primitive.cylinder.fill},set:function(o){this._primitive.cylinder.fill=o,this._parameter.fill=o}},material:{get:function(){return this._primitive.cylinder.material},set:function(o){this._primitive.cylinder.material=o,this._parameter.material=o}},outline:{get:function(){return this._primitive.cylinder.outline},set:function(o){this._primitive.cylinder.outline=o}},outlineColor:{get:function(){return this._primitive.cylinder.outlineColor},set:function(o){this._primitive.cylinder.outlineColor=o,this._parameter.outlineColor=o}},outlineWidth:{get:function(){return this._primitive.cylinder.outlineWidth},set:function(o){this._primitive.cylinder.outlineWidth=o,this._parameter.outlineWidth=o}},numberOfVerticalLines:{get:function(){return this._primitive.cylinder.numberOfVerticalLines},set:function(o){this._primitive.cylinder.numberOfVerticalLines=o,this._parameter.numberOfVerticalLines=o}},slices:{get:function(){return this._primitive.cylinder.slices},set:function(o){this._primitive.cylinder.slices=o,this._parameter.slices=o}},shadows:{get:function(){return this._primitive.cylinder.shadows},set:function(o){this._primitive.cylinder.shadows=o,this._parameter.shadows=o}},distanceDisplayCondition:{get:function(){return this._primitive.cylinder.distanceDisplayCondition},set:function(o){this._primitive.cylinder.distanceDisplayCondition=o,this._parameter.distanceDisplayCondition=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var iLe=Gse;var Wse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._parameter.lineWidth=Z(m.lineWidth,2)}addToMap(){let f=this._parameter,m=this._earthCtrl.entities.add({position:f.position,name:f.name,ellipsoid:{radii:f.radii,fill:f.fill,outlineWidth:f.lineWidth,material:f.material,outline:f.outline,outlineColor:f.outlineColor,stackPartitions:f.stackPartitions,slicePartitions:f.slicePartitions,subdivisions:f.subdivisions,shadows:f.shadows,distanceDisplayCondition:f.distanceDisplayCondition}});this._primitive=m}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(Wse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},position:{get:function(){return this._primitive.position},set:function(o){this._primitive.position=o,this._parameter.position=o}},radii:{get:function(){return this._primitive.ellipsoid.radii},set:function(o){this._primitive.ellipsoid.radii=o,this._parameter.radii=o}},material:{get:function(){return this._primitive.ellipsoid.material},set:function(o){this._primitive.ellipsoid.material=o,this._parameter.material=o}},fill:{get:function(){return this._primitive.ellipsoid.fill},set:function(o){this._primitive.ellipsoid.fill=o,this._parameter.fill=o}},outline:{get:function(){return this._primitive.ellipsoid.outline},set:function(o){this._primitive.ellipsoid.outline=o,this._parameter.outline=o}},outlineColor:{get:function(){return this._primitive.ellipsoid.outlineColor},set:function(o){this._primitive.ellipsoid.outlineColor=o,this._parameter.outlineColor=o}},outlineWidth:{get:function(){return this._primitive.ellipsoid.outlineWidth},set:function(o){this._primitive.ellipsoid.outlineWidth=o,this._parameter.outlineWidth=o}},stackPartitions:{get:function(){return this._primitive.ellipsoid.stackPartitions},set:function(o){this._primitive.ellipsoid.stackPartitions=o,this._parameter.stackPartitions=o}},slicePartitions:{get:function(){return this._primitive.ellipsoid.slicePartitions},set:function(o){this._primitive.ellipsoid.slicePartitions=o,this._parameter.slicePartitions=o}},subdivisions:{get:function(){return this._primitive.ellipsoid.subdivisions},set:function(o){this._primitive.ellipsoid.subdivisions=o,this._parameter.subdivisions=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var rLe=Wse;var jse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._parameter.lineWidth=Z(m.lineWidth,2)}addToMap(){let f=this._parameter,m=Z(f.outline,!0),v=f.fillColor,y=Z(f.outlineColor,v),x=this._earthCtrl.entities.add({name:f.name,rectangle:{show:!0,coordinates:f.coordinates,height:f.height,heightReference:f.heightReference,extrudedHeight:f.extrudedHeight,extrudedHeightReference:f.extrudedHeightReference,rotation:f.rotation,stRotation:f.stRotation,fill:f.fill,material:v,outline:m,outlineColor:y,outlineWidth:f.lineWidth,shadows:f.shadows,distanceDisplayCondition:f.distanceDisplayCondition}});this._primitive=x}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(jse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},positions:{get:function(){return this._parameter!==null?this._primitive.rectangle.hierarchy._value:!1},set:function(o){this._primitive!==null&&(this._primitive.rectangle.hierarchy._value=o)}},fillColor:{get:function(){return this._primitive!==null?this._primitive.rectangle.material:!1},set:function(o){this._primitive!==null&&(this._primitive.rectangle.material=o,this._parameter.fillColor=o)}},outline:{get:function(){return this._primitive!==null?this._primitive.rectangle.outline:!1},set:function(o){this._primitive!==null&&(this._primitive.rectangle.outline=o,this._parameter.outline=o)}},outlineColor:{get:function(){return this._primitive!==null?this._primitive.rectangle.outlineColor:!1},set:function(o){this._primitive!==null&&(this._primitive.rectangle.outlineColor=o,this._parameter.outlineColor=o)}},lineWidth:{get:function(){return this._primitive!==null?this._primitive.rectangle.outlineWidth:!1},set:function(o){this._primitive!==null&&(this._primitive.rectangle.outlineWidth=o,this._parameter.outlineWidth=o)}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}},height:{get:function(){return this._primitive!==null?this._primitive.rectangle.height:!1},set:function(o){this._primitive!==null&&(this._primitive.rectangle.height=o,this._parameter.height=o)}},coordinates:{get:function(){return this._primitive!==null?this._parameter.coordinates:!1},set:function(o){this._primitive!==null&&(this._primitive.rectangle.coordinates=o,this._parameter.coordinates=o)}}});var nLe=jse;var Yse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._parameter.lineWidth=Z(m.lineWidth,2)}addToMap(){let f=this._parameter,m=this._earthCtrl.entities.add({position:f.position,name:f.name,ellipse:{show:f.show,semiMajorAxis:f.semiMajorAxis,semiMinorAxis:f.semiMinorAxis,height:f.height,rotation:f.rotation,stRotation:f.stRotation,fill:f.fill,outlineWidth:f.lineWidth,material:f.material,outline:f.outline,outlineColor:f.outlineColor,shadows:f.shadows,numberOfVerticalLines:f.numberOfVerticalLines,distanceDisplayCondition:f.distanceDisplayCondition}});this._primitive=m}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}};Object.defineProperties(Yse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},position:{get:function(){return this._primitive.position},set:function(o){this._primitive.position=o}},radii:{get:function(){return this._primitive.ellipsoid.radii},set:function(o){this._primitive.ellipsoid.radii=o}},material:{get:function(){return this._primitive.ellipsoid.material},set:function(o){this._primitive.ellipsoid.material=o}},fill:{get:function(){return this._primitive.ellipsoid.fill},set:function(o){this._primitive.ellipsoid.fill=o}},outline:{get:function(){return this._primitive.ellipsoid.outline},set:function(o){this._primitive.ellipsoid.outline=o}},outlineColor:{get:function(){return this._primitive.ellipsoid.outlineColor},set:function(o){this._primitive.ellipsoid.outlineColor=o}},outlineWidth:{get:function(){return this._primitive.ellipsoid.outlineWidth},set:function(o){this._primitive.ellipsoid.outlineWidth=o}},stackPartitions:{get:function(){return this._primitive.ellipsoid.stackPartitions},set:function(o){this._primitive.ellipsoid.stackPartitions=o}},slicePartitions:{get:function(){return this._primitive.ellipsoid.slicePartitions},set:function(o){this._primitive.ellipsoid.slicePartitions=o}},subdivisions:{get:function(){return this._primitive.ellipsoid.subdivisions},set:function(o){this._primitive.ellipsoid.subdivisions=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var oLe=Yse;var qse=class extends mc{constructor(f,m){super(f),this._parameter=m,this._parameter.lineWidth=Z(m.lineWidth,1)}addToMap(){let f=this._parameter,m=this._earthCtrl.entities.add({name:f.name,polylineVolume:f});this._primitive=m}updateMaterial(){let f,m=this._parameter;return N(m.outlineColor)?f=new SM({color:m.lineColor,outlineColor:m.outlineColor}):f=m.lineColor,f}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}};Object.defineProperties(qse.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},positions:{get:function(){return this._primitive.polyline.positions},set:function(o){this._primitive.polyline.positions=o,this._parameter.positions=o}},lineColor:{get:function(){return this._parameter.lineColor},set:function(o){this._parameter.lineColor=o,this.updateMaterial()}},outlineColor:{get:function(){return this._parameter.outlineColor},set:function(o){this._parameter.outlineColor=o,this.updateMaterial()}},lineWidth:{get:function(){return this._primitive.polyline.width},set:function(o){this._primitive.polyline.eidth=o,this._parameter.lineWidth=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}},shape:{get:function(){return this._parameter!==null?this._parameter.shape:!1},set:function(o){this._parameter!==null&&(this._parameter.shape=o)}}});var aLe=qse;var Xse=class extends Dm{constructor(f,m){super(f),this._primitive=null,this._parameter=null,this._wModels=[],this._instance=[],this.instanceId=new Map,this._parameter=m}addToMap(){let f=this._parameter,m=Z(f.sourceType,"wmts"),v=null;if(m==="wmts")v=new hP(f);else if(m==="mapbox")v=new CO(f);else if(m==="arcgis")v=new hC(f);else if(m==="wms")v=new bO(f);else if(m==="multi")v=new BU(f);else if(m==="single")v=new EC(f);else if(m==="tms"){let x=Z(f.west,void 0),C=Z(f.south,void 0),w=Z(f.east,void 0),A=Z(f.north,void 0);N(x)&&N(C)&&N(w)&&N(A)&&(f.rectangle=new Di(xe.toRadians(x),xe.toRadians(C),xe.toRadians(w),xe.toRadians(A))),N(f.fileExtension)&&f.fileExtension==="json"&&(f.callback=this.processGeoJson()),v=new cb(f)}else m==="baidu"?v=new FU(f):m==="gaode"||m==="geovis"||m==="qqmap"?v=new Xv(f):m==="mapworld"?v=new hP(f):m==="osm"?v=new pM(f):m==="bingmap"?v=new xO(f):m==="mvt"&&(N(f.coreMap)||(f.coreMap=this._earthCtrl.coreMap),v=new kU(f,f.ol));v!==null&&(this._primitive=this._earthCtrl.imageryLayers.addImageryProvider(v,f.zIndex),this._primitive._layerIndex=f.zIndex),m==="ion"&&(this._primitive=x_.fromProviderAsync(p2.fromAssetId(f.assetId),f),this._earthCtrl.imageryLayers.add(this._primitive),this._primitive._layerIndex=f.zIndex);let y=f.groupName||"\u65B0\u5F71\u50CF";f.addTree&&(f.addTree=void 0,f.groupName=void 0,this._earthCtrl.factory.layerTree.addTreeData(y,{id:f.id||this._earthCtrl.factory.createUUID(),name:f.name||m,sourceType:"ImageryProvider",item:this,feature:f,checked:this._primitive.show}))}checkWModels(f){return N(this._wModels[f])}removeInstance(f,m){let y=this._wModels[f];if(N(y)){let x=y.geometryInstances;if(N(x))for(let C=0;C<x.length;C++)x[C].id}}removeWModels(f){if(N(this._parameter.retain)&&this._parameter.retain)return;let m=this,v=m._wModels[f];if(N(v)){for(let y=0;y<m._instance[f].length;y++)m.instanceId.has(m._instance[f][y])&&m.instanceId.delete(m._instance[f][y]);m._instance[f]=[],m._wModels[f]=void 0}}convertCoordinates(f){let m=[];for(let v=0;v<f.length;v++){let y=f[v];for(let x=0;x<y.length;x++)Array.prototype.push.apply(m,y[x])}return m}processGeoJson(){let f=this,m=Z(f._parameter.modelHeightKey,"\u5C42\u9AD8"),v=Z(f._parameter.modelColor,Re.BLUE);function y(C){f.removeWModels(C)}function x(C,w){if(!N(w)||f.checkWModels(w))return;let A=[],E=ea.fromColor(v);f._instance[w]||(f._instance[w]=[]);let T;for(let S=0;S<C.features.length;S++){let M=C.features[S];if(M.geometry.type==="Polygon"){let I=M.id;if(!f.instanceId.has(I)){let P=f.convertCoordinates(M.geometry.coordinates),D=H.fromDegreesArray(P);T=M.properties[m],N(T)||(T=0),A.push(new co({geometry:new Ec({polygonHierarchy:new ho(D),extrudedHeight:T}),id:I,releaseGeometryInstances:!1,attributes:{color:E}})),f.instanceId.set(I,w),f._instance[w].push(I)}}else if(M.geometry.type==="MultiPolygon"){let I=M.geometry.coordinates;for(let P=0;P<I.length;P++){let D=M.id+S;if(!f.instanceId.has(D)){let L=I[P],R=f.convertCoordinates(L),O=H.fromDegreesArray(R);T=M.properties[m],N(T)||(T=0),A.push(new co({geometry:new Ec({polygonHierarchy:new ho(O),extrudedHeight:T}),id:D,releaseGeometryInstances:!1,attributes:{color:E}})),f.instanceId.set(D,w),f._instance[w].push(D)}}}else console.info(M.geometry.type)}if(A.length>0){let S=f._earthCtrl.primitives.add(new Ia({geometryInstances:A,allowPicking:!1,appearance:new ms({flat:!1,faceForward:!1,translucent:!1})}));f._wModels[w]=S}}return{callback:x,removePrimitive:y}}removeFromMap(){this._primitive!==null&&this._earthCtrl.imageryLayers.remove(this._primitive)}toJSON(){let f=this;return new Promise(function(m,v){(void 0).all([f._primitive.imageryProvider.readyPromise]).then(function(y){let x=Ws.export(f);console.log("imageobj",x),m(x)})})}};Object.defineProperties(Xse.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o),console.info(o);let f=this;for(let m=0;m<f._wModels.length;m++){let v=f._wModels[m],y=f.mEarthCtrl.entities.getById(v);y.show=o}}},sourceType:{get:function(){return this._parameter!==null?this._parameter.sourceType:!1}},dataUrl:{get:function(){return this._parameter!==null?this._parameter.url:!1}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var sLe=Xse;var rFi=function(o,f,m,v){let y=m,x=v;var C=f.west,w=f.east,A=f.south,E=f.north,T=w-C,S=E-A,M=o.longitude*180/Math.PI,I=o.latitude*180/Math.PI;return o.normalizedLongitude=(M-C)/T*m,o.normalizedLatitude=(I-A)/S*v,o},nFi=function(o,f,m,v){var y=[],x=o[0].longitude!==void 0;return o.forEach(function(C){var w=[],A=x?C:qO.scene.globe.ellipsoid.cartesianToCartographic(C);A=rFi(A,f,m,v),w.push(A.normalizedLongitude),w.push(A.normalizedLatitude),y.push(w)}),y},oFi=function(o,f,m){var v=32,y=f.west*xe.DEGREES_PER_RADIAN,x=f.east*xe.DEGREES_PER_RADIAN,C=f.south*xe.DEGREES_PER_RADIAN,w=f.north*xe.DEGREES_PER_RADIAN,A=new Di(y,C,x,w),E=nFi(o,A,v,v),T=aFi(E,"#FF0000",v,v);return T},aFi=function(o,f,m,v,y){if(y===void 0){var y=document.createElement("canvas");y.width=m,y.height=v}var x=y.getContext("2d");if(!(o.length<=0)){x.moveTo(o[0][0],o[0][1]);for(var C=0;C<o.length;C++)x.lineTo(o[C][0],o[C][1]);return f!=null&&f!=null&&(x.fillStyle=f,x.fill()),y}};function TP(o,f){return Math.floor(Math.random()*(f-o+1))+o}function sFi(){return globalThis.GEOWORLD_BASE_URL+"Workers/ParseElevationWorker.js"}function lFi(o,f){var m=pd();return TP=oFi(o.vertices,f,o.heights[0]),TP.timeStamp=o.timeStamp,TP.mtHeight=o.heights,TP.mtType=o.mtType,TP.fromKML=o.fromKML,TP.rect=o.rectangle,TP.level=o.level,m.resolve(TP),m.promise}function uFi(o,f){return Math.floor(Math.random()*(f-o+1))+o}function cFi(o,f){var m=pd(),v=[];return o.forEach(function(y){v.push(lFi(y,f))}),Promise.all(v).then(function(y){var x=y[0].lenght,C=function(E,T){return T.timeStamp-E.timeStamp};if(y.length===1)m.resolve(y[0]);else{var w=y.sort(C),A=w.shift();w.forEach(function(E){A.forEach(function(T,S){T===TP&&E[S]!==TP&&(A[S]=E[S])})}),m.resolve(A)}}),m.promise}var qO,Uut=!1;function zd(o,f){if(qO=o,!N(f))throw new li("options is required.");this._errorEvent=new Br,this._modelFloorMasks={},this._credit=f.credit,typeof this._credit=="string"&&(this._credit=new Cs(this._credit)),f.heightMapWidth=Z(f.heightMapWidth,32),f.heightMapHeight=Z(f.heightMapHeight,32),this._options=f,this.readyPromise=Promise.resolve(!0),this._subdomains=f.subdomains,f.firstRequestUrl=f.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=f.firstRequestUrl+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&v=1&layers="+f.layerName+"&Styles=&Format=image/mpt";var m=this,v=f.pngOnly;f.maxTerrainLevel!==void 0&&isNaN(f.maxTerrainLevel)&&(f.maxTerrainLevel=void 0),this._maxTerrainLevel=Z(f.maxTerrainLevel,30),v?m.setFormatMPT(!1):$.ajax({url:f.cacheUrl?f.cacheUrl+"/0/0/0.mpt":this._firstRequest,success:function(x){var C=!!(N(x.childNodes)&&x.childNodes.length>0);if(!!C)return m.setFormatMPT(!1),null;m.setFormatMPT(!0)},error:function(){return m.setFormatMPT(!1),null},async:!1}),f.cacheUrl&&(this.isCache=!0,this.cacheLevel=f.cacheLevel||16,this._cacheUrl=f.cacheUrl+"/{z}/{x}/{y}.mpt");let y=this._maxTerrainLevel;this._availability={computeMaximumLevelAtPosition:function(x){return Math.min(y,16)}},this._urlTemplate=f.url+"?request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+f.layerName+"&Styles=&Format=image/"+this._format,this._allElevationLayers=null,this._tilingScheme=new Bd,this._levelZeroMaximumGeometricError=Rv.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,f.heightMapWidth*4,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new cA({workerPath:sFi()},qi),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(x){},this)}zd._geometricErrorFactor=2;Object.defineProperties(zd.prototype,{errorEvent:{get:function(){return this._errorEvent}},availability:{get:function(){return this._availability}},credit:{get:function(){return this._credit}},hasVertexNormals:{get:function(){return!1}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}});zd.prototype.setFormatMPT=function(o){if(!(o&&this.pngOnly)){var f=this._format;this._format=o?"mpt":"png",f!==this._format&&(this._isMPT=o,this._urlTemplate!==void 0&&(this._urlTemplate=this._urlTemplate.replace("image/"+f,"image/"+this._format)))}};zd.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)*zd._geometricErrorFactor};zd.prototype.createKeyFromTile=function(o,f,m){return o+"_"+f+"_"+m};zd.prototype.getTileDataAvailable=function(o,f,m){var v=Math.min(this._maxTerrainLevel,25);return this._isMPT?!0:m<v};zd.prototype.requestFactorForLevel=function(o){var f=Math.log(this._requestGridSize)/Math.log(2);return f=Math.min(f,o),Math.pow(2,f)};zd.prototype.getRequestBaseTerrainUrl=function(o,f,m,v){return this.getRequestUrl(o,f,m,v)};zd.prototype.getRequestElevationLayer=function(o,f,m){return this.getRequestUrl(o,f,m,!1,!0)};zd.prototype.getRequestUrl=function(w,A,E,v,y){var x=E,C=v!=null?this.requestFactorForLevel(E):1,w=v!=null?(w-w%C)/C:w,A=v!=null?(A-A%C)/C:A,E=v!=null?E-Math.log(C)/Math.log(2):E;if(this.isCache&&E!==0&&E<=this.cacheLevel)return this._cacheUrl.replace("{x}",w).replace("{y}",A).replace("{z}",E);var T=this.tilingScheme.tileXYToNativeRectangle(w,A,E),S=this.heightMapWidth*C===256&&v?1:0;y&&(S=0);var M=this._urlTemplate.replace("{south}",T.south).replace("{north}",T.north).replace("{west}",T.west).replace("{east}",T.east).replace("{optimizedOnly}",S).replace("{width}",this.heightMapWidth*C).replace("{height}",this.heightMapHeight*C).replace("{s}",this.sTag(w,A,E));return M+"&level="+E+"&origLevel="+x};zd.prototype.isT_Inside_E=function(o,f){return o.west>=f.west*xe.DEGREES_PER_RADIAN&&o.east<=f.east*xe.DEGREES_PER_RADIAN&&o.south>=f.south*xe.DEGREES_PER_RADIAN&&o.north<=f.north*xe.DEGREES_PER_RADIAN};zd.prototype.isT_Intersects_E=function(o,f){var m=o.west*xe.RADIANS_PER_DEGREE,v=o.east*xe.RADIANS_PER_DEGREE,y=o.south*xe.RADIANS_PER_DEGREE,x=o.north*xe.RADIANS_PER_DEGREE,C=new Di(m,y,v,x),w=Di.intersection(C,f,new Di);return w};zd.prototype.sTag=function(o,f,m){if(this._subdomains==null)return"";var v=(o+f+m)%this._subdomains.length;return this._subdomains[v]};zd.prototype.refreshElevationLayer=function(o){if(o.rectangle&&qO.scene.globe._surface._levelZeroTiles!==void 0){var f=this.findDirectParent(o.rectangle,!0);f.freeResources()}};zd.prototype.findDirectParent=function(o,f){var m=function(x,C,w){var A=w?4.1:2.1;if(x._rectangle.width<=C.width*A&&Di.contains(x._rectangle,Di.center(C)))return x;for(var E=x.children.length,T=0;T<E;T++){var S=x.children[T];if(Di.contains(S._rectangle,Di.center(C)))return m(S,C,w)}return null};if(o.width==Math.PI)return null;for(var v=0;v<qO.scene.globe._surface._levelZeroTiles.length;v++){var y=m(qO.scene.globe._surface._levelZeroTiles[v],o,f);if(y)return y}return null};zd.prototype.isTileAvailable=function(o,f,m){var v=this._tilingScheme.tileXYToRectangle(o,f,m,new Di),y=this.findDirectParent(v);if(y&&y.data&&y.data.terrainData){if(!(y.data.terrainData._childTileMask>0))return!1;for(var x=y.children.length,C=0;C<x;C++){var w=y.children[C];if(Di.equals(w._rectangle,v))return y.data.terrainData._childTileMask&1<<C}}return!0};zd.prototype.markTileAsUnavailable=function(o,f,m){var v=this._tilingScheme.tileXYToRectangle(o,f,m,new Di),y=this.findDirectParent(v);y&&y.data&&y.data.terrainData&&y.data.terrainData._childTileMask>0&&$.each(y.children,function(x,C){if(Di.equals(C._rectangle,v)){switch(x){case 0:y.data.terrainData._childTileMask&=-5;break;case 1:y.data.terrainData._childTileMask&=-9;break;case 2:y.data.terrainData._childTileMask&=-2;break;case 3:y.data.terrainData._childTileMask&=-3;break;default:}return!1}return!0})};zd.prototype.requestBaseTerrainTileGeometry=function(o,f,m,v){return this.requestTileGeometryBuffers(o,f,m,v)};zd.prototype.requestElevationLayerTileGeometry=function(o,f,m,v,y){return this.requestTileGeometryBuffers(o,f,m,v,y)};zd.prototype.requestTileGeometryBuffers=function(o,f,m,v,y){var x=this,C=15,w={};w.requestedRectangle=this.tilingScheme.tileXYToNativeRectangle(o,f,m),w.layer=y;var M,A,E,T,S=pd(),M=this.requestTileHeightBuffer(o,f,m,v,void 0,y);return M===void 0?void 0:(A=this.requestTileHeightBuffer(o+1,f,m,v,!0,y),E=this.requestTileHeightBuffer(o,f+1,m,v,!0,y),T=this.requestTileHeightBuffer(o+1,f+1,m,v,!0,y),Promise.all([M,A,E,T]).then(function(I){if(Uut==0){if(I[0].myReject!=null&&I[0].myReject){S.reject();return}for(var P=x.heightMapWidth+1,D=x.heightMapHeight+1,L=new Float32Array(P*D),R=I[0].isFloor,O=0;O<P;O++)for(var F=0;F<D;F++){var k=O,U=F,G=0;F===P-1&&(U=0,G=1,R&&(G=0,U=P-2)),O===D-1&&(k=0,G=2);var j=O*P+F,q=k*x.heightMapWidth+U;I[G]!==null&&(I[G].myReject==null||!I[G].myReject)&&(L[j]=I[G][q])}(I[3].myReject==null||!I[3].myReject)&&(L[P*D-1]=I[3][0]);var J=x.arrayToHeightmapTerrainData(L,P,D,C);w.buffer=J,S.resolve(w)}else{var J=x.arrayToHeightmapTerrainData(I[0],x.heightMapWidth,x.heightMapHeight);w.buffer=J,S.resolve(w)}}).catch(function(){S.reject()}),S.promise)};zd.prototype.requestTileGeometry=function(o,f,m,v){var y=this,x=[],C=y.tilingScheme.tileXYToNativeRectangle(o,f,m);this._allElevationLayers!=null&&this._allElevationLayers.length>0&&m>7?$(this._allElevationLayers).each(function(A,E){var T=E.show;if(T){var S=E.rectangle;y.isT_Inside_E(C,S)?(y.setFormatMPT(!1),x.push(y.requestElevationLayerTileGeometry(o,f,m,v,E))):y.isT_Intersects_E(C,S)!=null?(y.setFormatMPT(!1),x.push(y.requestElevationLayerTileGeometry(o,f,m,v,E)),x.push(y.requestBaseTerrainTileGeometry(o,f,m,v))):(y.setFormatMPT(!0),x.push(y.requestBaseTerrainTileGeometry(o,f,m,v)))}else y.setFormatMPT(!0),x.push(y.requestBaseTerrainTileGeometry(o,f,m,v))}):(y.setFormatMPT(!0),x.push(y.requestBaseTerrainTileGeometry(o,f,m,v)));var w=pd();return Promise.all(x).then(function(A){if(A.length===1)A.layer!==void 0&&console.log("missing scale and offset"),w.resolve(A[0].buffer);else if(A.length>1){var E=$.grep(A,function(P){return P.layer!==void 0}),T=$.grep(A,function(P){return P.layer===void 0});if(E.length===0)w.resolve(A[0].buffer);else{var S=E[E.length-1],M=T[T.length-1],I={tolerance:S.layer.nullTolerance,nullValueNumber:S.layer.nullValueNumber,verticesX:S.layer.polygonVerticesX,verticesY:S.layer.polygonVerticesY,scale:Z(S.layer.scale,1),offset:Z(S.layer.offset,0)};w.resolve(y.mergeBuffers(M.buffer,S.buffer,I,M.requestedRectangle))}}else w.reject()}).catch(function(){w.reject()}),w.promise};zd.prototype.mergeBuffers=function(o,f,m,v){var y,x,C,w,A,E=33,T=33,S=v.west,M=v.north,I=v.east,P=v.south,D=v.width/E,L=v.height/T,R=m.scale,O=m.offset,F=m.nullValueNumber,k=m.tolerance,U=F!==void 0&&k!==void 0;if(U)var G=Z(m.nullValueNumber,0),j=Z(Number(m.tolerance),0);var q=new Float32Array(E*T);for(y=0,A=M;y<T;y++,A+=L)for(x=0,w=S;x<E;x++,w+=D)C=y*E+x,U?q[C]=!f._buffer[C]||f._buffer[C]>=G-j&&f._buffer[C]<=G+j?o._buffer[C]:f._buffer[C]*R+O:q[C]=f._buffer[C]?f._buffer[C]*R+O:o._buffer[C];return this.arrayToHeightmapTerrainData(q,E,T,15)};zd.prototype.requestTileHeightBuffer=function(o,f,m,v,y,x){var C=this;if(!isNaN(o+f+m)){(!N(v)||v===!1)&&(v=new cg({defer:!0}));var w=v.defer==0;y=Z(w,!1);var A=pd();if(Uut==0){var E;if(x!==void 0)x.getUrlFromSTag=function(Q,ee,z){return x.subdomains===void 0?x.url:x.subdomains[0]+"/SG"},E=this.getRequestElevationLayer(o,f,m).replace(this._options.url,x.getUrlFromSTag(o,f,m)+"/Elevation").replace(this._options.layerName,x.name),x.format==="mpt"&&(E=E.replace("image/png","image/mpt"));else{E=this.getRequestBaseTerrainUrl(o,f,m,w||y);var T=qO.terrainProvider.tilingScheme.tileXYToRectangle(o,f,m),S=qO.terrainProvider._modifyTerrainObjects,M=pd();if(S!==void 0){var I=[];if(S.forEach(function(Q){Q.show&&Di.intersection(T,Q.rectangle,new Di)!=null&&I.push(Q)}),I.length>0)if(I.length===1&&I[0].modelFloorBestLevel&&m>I[0].modelFloorBestLevel)M.resolve("NoMerge");else{var P=cFi(I,T,m);Promise.resolve(P).then(function(Q){M.resolve(Q)}).catch(function(Q){console.log(Q)})}else M.resolve("NoMerge")}else M.resolve("NoMerge");var D=pd(),L=$.grep([],function(Q){return Q._selectedTiles.length>0});if(L.length===1&&L[0].level&&m>L[0].level)D.resolve("NoFloor");else{var R=!1,O=32,F=65535;L.forEach(function(Q){if(Q.ready&&Q.show&&Q.rootFloorRectangle!==void 0&&Di.intersection(T,Q.rootFloorRectangle)!==void 0){for(var ee=new Uint16Array(O*O),z=T.west,ie=T.south,re=(T.east-T.west)/32,ne=(T.north-T.south)/32,oe,se=0;se<O;se++)for(var ae=0;ae<O;ae++){var fe=z+re*ae+re/2,de=T.north-ne*se-ne/2,ve=new Mt(fe,de);oe=F;var pe=Q.getHRMTFP(Q,ve,!0);pe!=null&&pe.content&&pe.content._model&&pe.content._model.floor&&(oe=pe.content._model.floor.getHeight(ve.longitude,ve.latitude)),oe!==F&&(oe+=1.5),ee[se*O+ae]=oe}R=!0,D.resolve(ee)}}),R||D.resolve("NoFloor")}var k=qO.scene.globe.ellipsoid}if(this._requestsCache.hasOwnProperty(E)===!1){if(this._requestsCache[E]={},this._requestsCacheKeys.push(E),this._requestsCacheKeys.length>100){for(var U=0;U<50;U++)delete this._requestsCache[this._requestsCacheKeys[U]];this._requestsCacheKeys.splice(0,50)}}else{var G=this._requestsCacheKeys.indexOf(E);this._requestsCacheKeys.splice(G,1),this._requestsCacheKeys.push(E)}var j=this._requestsCache[E];if(j.dataLoaded===void 0&&(w?j.dataLoaded=Jr.fetchArrayBuffer(E):j.dataLoaded=Jr.fetchArrayBuffer(E),!N(j.dataLoaded)))return;var q=this;this._pendingRequests++,Promise.resolve(j.dataLoaded).then(function(Q){j.workerFinished===void 0&&(j.workerFinished=q._workerPool.queueWorkItem({buffer:Q,isElevation:x!==void 0,level:m})),Promise.all([j.workerFinished,M.promise,D.promise]).then(function(ee){var z=ee[1]!==void 0&&ee[1]!=="NoMerge",ie=ee[2]!==void 0&&ee[2]!=="NoFloor";if(ee[0].rejected){for(var re=q.heightMapWidth*q.heightMapHeight,ne=new Int16Array(re),oe=0,se=0;se<re;se++)ne[se]=300;return m>2&&(ne.myReject=!0),A.resolve(ne),A.promise}var ae=q.extractTileHeightBuffer(ee[0].buffer,o,f,m);if(q._pendingRequests--,z)for(var se=0;se<32;se++)for(var fe=0;fe<32;fe++){var de=se*32+fe;ae[de]=ee[1].mtHeight[0]}if(ie){for(var se=0;se<32;se++)for(var fe=0;fe<32;fe++){var de=se*32+fe;ae[de]=ee[2][de]===65535||ee[2][de]>10500?ae[de]:ee[2][de]}ae.isFloor=!0}A.resolve(ae)}).catch(function(){for(var ee=q.heightMapWidth*q.heightMapHeight,z=new Int16Array(ee),ie=0,re=0;re<ee;re++)z[re]=300;return m>2&&(z.myReject=!0),A.resolve(z),A.promise})}).catch(function(){q._pendingRequests--,A.reject()})}else{for(var J=this.heightMapWidth*this.heightMapHeight,X=new Int16Array(J),Y=uFi(0,1500),U=0;U<J;U++)X[U]=Y;A.resolve(X)}return A.promise}};zd.prototype.extractTileHeightBuffer=function(o,f,m,v){try{for(var y=this.requestFactorForLevel(v),x=f%y,C=m%y,w=new Float32Array(this.heightMapWidth*this.heightMapHeight),A=1e6,E=-1e5,T=0;T<this.heightMapHeight;T++)for(var S=0;S<this.heightMapWidth;S++){var M=T+C*this.heightMapHeight,I=S+x*this.heightMapWidth,P=T*this.heightMapWidth+S,D=M*this.heightMapWidth*y+I;o[D]>E&&(E=o[D]),o[D]<A&&(A=o[D]),w[P]=o[D]}}catch(L){console.log(L.message)}return w};zd.prototype.arrayToHeightmapTerrainData=function(o,f,m,v){N(o)===!1&&(o=new Int16Array(f*m));var y={buffer:o,width:f,height:m,childTileMask:v};return new wT(y)};var Gut=zd;var Jse=class extends Dm{constructor(f,m){super(f),this._earthCtrl=f,this._primitive=null,this._parameter=m}addToMap(){let f=this._parameter,m=null,v=Z(f.sourceType,"ctb");v==="ude"||(v==="ctb"?m=new K5(f):v==="multi"?m=new jre(this._earthCtrl):v==="sgs"?m=new Gut(this._earthCtrl.coreMap,f):v==="arcgis"&&(m=new Goe(f))),m!==null&&(this._primitive=m,this._coreMap.terrainProvider=m);let y=f.groupName||"\u65B0\u5730\u5F62";f.addTree&&(f.addTree=void 0,f.groupName=void 0,this._earthCtrl.factory.layerTree.addTreeData(y,{id:f.id||this._earthCtrl.factory.createUUID(),name:f.name||v,sourceType:"TerrainProvider",item:this,feature:f,checked:this._primitive.show}))}removeFromMap(){this._primitive!==null&&(this._coreMap.terrainProvider=new AT)}toJSON(){let f=this;return new Promise(function(m,v){(void 0).all([this._primitive.readyPromise]).then(function(y){let x=Ws.export(f);console.log("terraobj",x),m(x)})})}flyTo(f={}){let m=f;m.orientation=Z(f.orientation,{heading:xe.toRadians(0),pitch:xe.toRadians(-60),roll:xe.toRadians(0)});function v(y,x){let w=Math.PI*6378137,A=y/w*180,E=180/Math.PI*(2*Math.atan(Math.exp(x/w*Math.PI))-Math.PI/2);return{lon:A,lat:E}}if(this._parameter.sourceType==="ctb"||this._parameter.sourceType==="arcgis"){if(this._primitive._tilingScheme.bounds[0]<180&&this._primitive._tilingScheme.bounds[0]>-180){let y=this._primitive._tilingScheme.bounds,x=(y[0]+y[2])/2,C=(y[1]+y[3])/2,w=f.height||1e4;m.destination=Z(f.destination,H.fromDegrees(x,C,w))}else{let y=this._primitive._tilingScheme.bounds,x=v(y[0],y[1]),C=v(y[2],y[3]),w=(x.lon+C.lon)/2,A=(x.lat+C.lat)/2,E=f.height||1e4;m.destination=Z(f.destination,H.fromDegrees(w,A,E))}this._coreMap.camera.flyTo(m)}}};Object.defineProperties(Jse.prototype,{parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},sourceType:{get:function(){return this._parameter!==null?this._parameter.sourceType:!1}},dataUrl:{get:function(){return this._parameter!==null?this._parameter.url:!1}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var lLe=Jse;function hFi(o,f){this._earthCtrl=o;let m=new vae(f),v=this._earthCtrl.viewer.camera;return m.flyTo=function(y={}){let x=Mt.fromCartesian(m._position);x.height<=10&&(x.height=100);let C=H.fromDegrees(xe.toDegrees(x.longitude),xe.toDegrees(x.latitude),x.height);v.flyTo({destination:Z(y.destination,C),orientation:y.orientation,duration:y.duration,complete:y.callback})},m}var Wut=hFi;var Kse=class extends Dm{constructor(f,m){super(f),this._earthCtrl=f,this._parameter=m}addToMap(){let f=this._parameter,m=null;f.sourceType==="b3dm"||f.sourceType==="3DTiles"?(m=new pg(f),N(f.transform)&&this.transform(f.transform,m)):f.sourceType==="osgb"?m=new pg(f):f.sourceType==="s3m"?m=new Wut(this._earthCtrl,f):(f.sourceType==="ude_block"||f.sourceType==="ude_model")&&(f.skipLevelOfDetail=!0,m=new pg(f)),m.readyPromise.then(function(v){f.success&&typeof f.success=="function"&&f.success(v)}),m.readyPromise.catch(function(v){f.failed&&typeof f.failed=="function"&&f.failed(v)}),this._primitive=this._coreMap.scene.primitives.add(m)}removeFromMap(){this._primitive!==null&&this._coreMap.scene.primitives.remove(this._primitive)}toJSON(){let f=this;return new Promise(function(m,v){(void 0).all([f._primitive.readyPromise]).then(function(y){let x=Ws.export(f);console.log("modellayerobj",x),m(x)})})}transform(f,m){m.readyPromise.then(function(v){let y=Ut.fromRotationX(xe.toRadians(f.pitch)),x=Ut.fromRotationY(xe.toRadians(f.roll)),C=Ut.fromRotationZ(xe.toRadians(f.heading)),w=Ee.fromRotationTranslation(y),A=Ee.fromRotationTranslation(x),E=Ee.fromRotationTranslation(C),T=H.fromDegrees(f.lon,f.lat,f.alt),S=tn.eastNorthUpToFixedFrame(T);Ee.multiply(S,w,S),Ee.multiply(S,A,S),Ee.multiply(S,E,S),v._root.transform=S})}};Object.defineProperties(Kse.prototype,{parameter:{get:function(){return this._parameter}},readyPromise:{get:function(){return this._primitive.readyPromise}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},sourceType:{get:function(){return this._parameter!==null?this._parameter.sourceType:!1}},dataUrl:{get:function(){return this._parameter!==null?this._parameter.url:!1}},boundingSphere:{get:function(){return this._primitive!==null&&this._primitive.boundingSphere?this._primitive.boundingSphere:null}},modelMatrix:{get:function(){return this._primitive!==null?this._primitive.modelMatrix:!1},set:function(o){this._primitive!==null&&(this._primitive.modelMatrix=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var uLe=Kse;var Qse=class extends Dm{constructor(f,m){super(f),this._rtti="FeatureLayer",this._primitive=null,this._parameter=m}finalize(){}addToMap(){let f=this._parameter;this._primitive=new Nre(this._earthCtrl,f);let m=f.groupName||"FeatureData";f.addTree&&(f.addTree=void 0,f.groupName=void 0,this._earthCtrl.factory.layerTree.addTreeData(m,{id:f.id||this._earthCtrl.factory.createUUID(),name:f.name||f.sourceType,sourceType:"FeatureDataProvider",item:this,feature:f,checked:this._primitive.show}))}updateStyle(f){if(!this._primitive)return;let m=this._primitive.entities.values;for(let v=0;v<m.length;v++){let y=m[v];for(let x=0;x<y.propertyNames.length;x++){let C=y.propertyNames[x];if(!!y[C]){typeof f.near<"u"&&typeof f.far<"u"&&(y[C].distanceDisplayCondition=new DistanceDisplayCondition(f.near,f.far));for(let w in f)if(Object.hasOwnProperty.call(f,w)){let A=f[w];y[C][w]&&(y[C][w]=A)}if(f.pointHeight){let w=Cartographic.fromCartesian(y.position._value),A=Math.toDegrees(w.longitude),E=Math.toDegrees(w.latitude);y.position=Cartesian3.fromDegrees(A,E,f.pointheight)}}}}}removeFromMap(){this._primitive!==null&&this._primitive.destory()}toJSON(){let f=this;return new Promise(function(m,v){(void 0).all([f._primitive]).then(function(y){let x=Ws.export(f);console.log("fireObj",x),m(x)})})}};Object.defineProperties(Qse.prototype,{entities:{get:function(){return this._primitive.entities}},dataSource:{get:function(){return this._primitive.dataSource}},parameter:{get:function(){return this._parameter}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o)}},sourceType:{get:function(){return this._parameter!==null?this._parameter.sourceType:!1}},dataUrl:{get:function(){return this._parameter!==null?this._parameter.url:!1}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var cLe=Qse;function Zse(o){this._earthCtrl=o,this._path="",this._layerWork=null}Object.defineProperties(Zse.prototype,{});Zse.prototype.addToMap=function(o){N(this._layerWork)?this._layerWork.updateOverlay(o):this._layerWork=new Qne(this._earthCtrl.coreMap,o)};Zse.prototype.removeFromMap=function(){this._layerWork.dispose()};var hLe=Zse;var dFi={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},js=Object.freeze(dFi);var $se=class extends Dm{constructor(f,m){super(f),this._parameter=m,this._parameter.type=Z(m.type,"water"),this._parameter.version=Z(m.version,"1.3.0"),this._parameter.baseWaterColor=Z(m.color,Re.fromCssColorString("#0374ff")),this._parameter.waterFrequency=Z(m.waterFrequency,3e3),this._parameter.animationSpeed=Z(m.animationSpeed,.01),this._parameter.amplitude=Z(m.amplitude,5e3)}addToMap(){let f=this._parameter;this._primitive=new RU(this._earthCtrl,f),this._primitive&&(this._parameter.color=this._primitive.baseWaterColor,this._parameter.params=this._primitive._params)}removeFromMap(){this._primitive!==null&&this._primitive.destory()}toJSON(){let f=this;return new Promise(function(m,v){(void 0).all([f._primitive]).then(function(y){let x=Ws.export(f);console.log("waterObj",x),m(x)})})}};Object.defineProperties($se.prototype,{type:{get:function(){return this._primitive.type}},version:{get:function(){return this._primitive._version}},params:{get:function(){return this._primitive._params},set:function(o){this._primitive!==null&&(this._primitive._params=o)}},show:{get:function(){return this._parameter!==null?this._parameter.show:!1},set:function(o){if(this._primitive!==null&&this._primitive._primitive&&this._primitive._primitive.length!==0){for(let f=0;f<this._primitive._primitive.length;f++)this._primitive._primitive[f].show=o;this._parameter.show=o}}},url:{get:function(){return this._primitive!==null?this._primitive.url:!1},set:function(o){this._primitive!==null&&(this._primitive.url=o)}},color:{get:function(){return this._primitive!==null?this._primitive.baseWaterColor:!1},set:function(o){this._primitive!==null&&(this._primitive.baseWaterColor=o)}},waterFrequency:{get:function(){return this._primitive!==null?this._primitive.waterFrequency:!1},set:function(o){this._primitive!==null&&(this._primitive.waterFrequency=o)}},animationSpeed:{get:function(){return this._primitive!==null?this._primitive.animationSpeed:!1},set:function(o){this._primitive!==null&&(this._primitive.animationSpeed=o)}},amplitude:{get:function(){return this._primitive!==null?this._primitive.amplitude:!1},set:function(o){this._primitive!==null&&(this._primitive.amplitude=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var dLe=$se;var fLe=class extends Dm{constructor(f,m){super(f),this._parameter=m,this._viewer=f.coreMap,this._cesium=qi}addToMap(){let f=this._parameter,m,v;Z(f.div)?(m=document.getElementById(f.div),v=f.div):(m=document.createElement("div"),m.id="Hawkeye",m.style.position="absolute",m.style.width="15%",m.style.height="20%",m.style.bottom="20px",m.style.right="0",m.style.pointerEvents="none",this._viewer.container.appendChild(m),v="Hawkeye"),f.style&&(f.style.width&&(m.style.width=f.style.width),f.style.height&&(m.style.height=f.style.height),f.style.bottom&&(m.style.bottom=f.style.bottom),f.style.right&&(m.style.right=f.style.right),f.style.top&&(m.style.top=f.style.top,m.style.bottom="unset"),f.style.left&&(m.style.left=f.style.left,m.style.right="unset"));let y;f.url?y=new this._cesium.SingleTileImageryProvider({url:f.url}):f.imageryProvider?y=f.imageryProvider:y=new cb({url:"http://103.25.37.71:4020/gisserver/tmsserver/earth_tms"});let x=new Xq(v,{imageryProvider:y,baseLayerPicker:!1,shadows:!1,shouldAnimate:!0,animation:!0,scene3DOnly:!0,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,contextOptions:{requestWebgl2:!0,licenseServer:window.licenseServer}});x._innerCreditContainer.style.display="none",x.scene.screenSpaceCameraController.enableRotate=!1,x.scene.screenSpaceCameraController.enableZoom=!1,x.scene.screenSpaceCameraController.enableTilt=!1;let C=this;function w(){let A=C._viewer.camera.position,E=Mt.fromCartesian(A);x.camera.setView({destination:Mt.toCartesian(E),orientation:{heading:C._viewer.camera.heading,pitch:C._viewer.camera.pitch,roll:C._viewer.camera.roll}})}return C._viewer.scene.preRender.addEventListener(w),this.close=function(){C._viewer.scene.preRender.removeEventListener(w),x.destroy(),m.remove(),C.close=void 0},this}removeFromMap(){this.close&&this.close()}},pLe=fLe;var jut=new Wt;function fFi(o,f,m){let v=o.length,y,x,C;if(m){y=Nn.LUMINANCE,x=Rn.FLOAT,C=new Float32Array(v);for(let w=0;w<v;w++)C[w]=o[w]}else{y=Nn.RGBA,x=Rn.UNSIGNED_BYTE,C=new Uint8Array(v*4);for(let w=0;w<v;w++)Wt.packFloat(o[w],jut),Wt.pack(jut,C,w*4)}return new _o.create({context:f,pixelFormat:y,pixelDatatype:x,source:{width:v,height:1,arrayBufferView:C},flipY:!1,sampler:new gs({wrapS:ha.CLAMP_TO_EDGE,wrapT:ha.CLAMP_TO_EDGE,minificationFilter:Xa.NEAREST,magnificationFilter:Zu.NEAREST})})}var ele=[];function pFi(o,f,m,v){Ee.toArray(Ee.IDENTITY,ele);let y=new zo({fabric:{type:"spotMaterial",source:` # define Spot_Texture_Width ${f.length} ${m?"#define use_texture_float":""} float getPointComponent(int idx, float invTexSize) { vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); #ifdef use_texture_float return texture(u_spotPointTexture, uv).x; #else return czm_unpackFloat(texture(u_spotPointTexture, uv)); #endif } vec3 czm_getMaterial_spot(vec3 positionEC, vec3 color) { if(u_spotPointTextureDimensions.x == 1) { return color; } vec3 diffuse = color; float constant = 1.0; float linear = 0.022; float quadratic = 0.0019; float attenuation = 0.0; vec3 sumSpotColor = vec3(0.0); float invTexSize = 1.0 / float(u_spotPointTextureDimensions.x); for(int idx = 0; idx <Spot_Texture_Width; idx += 12){ float x = getPointComponent(idx, invTexSize); float y = getPointComponent(idx + 1, invTexSize); float z = getPointComponent(idx + 2, invTexSize); float dirX = getPointComponent(idx + 3, invTexSize); float dirY = getPointComponent(idx + 4, invTexSize); float dirZ = getPointComponent(idx + 5, invTexSize); float colorX = getPointComponent(idx + 6, invTexSize); float colorY = getPointComponent(idx + 7, invTexSize); float colorZ = getPointComponent(idx + 8, invTexSize); float distanceLimit = getPointComponent(idx + 9, invTexSize); float cutOff = getPointComponent(idx + 10, invTexSize); float outerCutOff = getPointComponent(idx + 11, invTexSize); vec4 spotPosition = u_spotmodelViewMatrix * vec4(x, y, z, 1.0); mat3 spotmodelViewMatrix = mat3(u_spotmodelViewMatrix[0].xyz,u_spotmodelViewMatrix[1].xyz,u_spotmodelViewMatrix[2].xyz); vec3 spotDirection = spotmodelViewMatrix * vec3(dirX, dirY, dirZ); vec3 spotDirectionNormal = normalize(spotDirection); vec3 viewLight = vec3(positionEC - spotPosition.xyz); float lightDistance = dot(viewLight, spotDirectionNormal); float distanceFactor = lightDistance > distanceLimit ? 0.0: 1.0; vec3 vl = normalize(positionEC - spotPosition.xyz); float theta = dot(spotDirection, vl); float epsilon = cutOff - outerCutOff; float factor = clamp((theta - outerCutOff) / epsilon, 0.0, 1.0); sumSpotColor += vec3(colorX * factor * distanceFactor, colorY * factor * distanceFactor, colorZ * factor * distanceFactor); //float distance = length(positionEC - spotPosition.xyz); //attenuation += 1.0 / (constant + distance * linear + distance * distance * quadratic); } attenuation = 1.0; diffuse = diffuse * sumSpotColor * attenuation; color = color * u_backgroundBrightness + diffuse; return color; }`,uniforms:{u_spotmodelViewMatrix:ele,u_spotPointTexture:"123",u_backgroundBrightness:v}},translucent:!1});return y._textures.u_spotPointTexture=o,y.uniforms.u_spotPointTextureDimensions.x=f.length,y.uniforms.u_spotPointTextureDimensions.y=1,y}var mFi=new Ee;function Yut(o,f,m,v,y){return new Kw({lightingModel:y,uniforms:{u_spotPointTextureDimensions:{type:Ra.INT_VEC2,value:new Ye(f.length,1)},u_spotPointTexture:{type:Ra.SAMPLER_2D,value:o},u_spotmodelViewMatrix:{type:Ra.MAT4,value:mFi},u_backgroundBrightness:{type:Ra.FLOAT,value:v}},fragmentShaderText:` #define Spot_Texture_Width ${f.length} ${m?"#define use_texture_float":""} float getPointComponent(int idx, float invTexSize) { vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5); #ifdef use_texture_float return texture(u_spotPointTexture, uv).x; #else return czm_unpackFloat(texture(u_spotPointTexture, uv)); #endif } void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { if(u_spotPointTextureDimensions.x == 1) { material.diffuse *= 1.0; } vec3 diffuse = material.diffuse; vec3 positionEC = fsInput.attributes.positionEC.xyz; float constant = 1.0; float linear = 0.022; float quadratic = 0.0019; float attenuation = 0.0; vec3 sumSpotColor = vec3(0.0); float invTexSize = 1.0 / float(u_spotPointTextureDimensions.x); for(int idx = 0; idx <Spot_Texture_Width; idx += 12){ float x = getPointComponent(idx, invTexSize); float y = getPointComponent(idx + 1, invTexSize); float z = getPointComponent(idx + 2, invTexSize); float dirX = getPointComponent(idx + 3, invTexSize); float dirY = getPointComponent(idx + 4, invTexSize); float dirZ = getPointComponent(idx + 5, invTexSize); float colorX = getPointComponent(idx + 6, invTexSize); float colorY = getPointComponent(idx + 7, invTexSize); float colorZ = getPointComponent(idx + 8, invTexSize); float distanceLimit = getPointComponent(idx + 9, invTexSize); float cutOff = getPointComponent(idx + 10, invTexSize); float outerCutOff = getPointComponent(idx + 11, invTexSize); vec4 spotPosition = u_spotmodelViewMatrix * vec4(x, y, z, 1.0); mat3 spotmodelViewMatrix = mat3(u_spotmodelViewMatrix[0].xyz,u_spotmodelViewMatrix[1].xyz,u_spotmodelViewMatrix[2].xyz); vec3 spotDirection = spotmodelViewMatrix * vec3(dirX, dirY, dirZ); vec3 spotDirectionNormal = normalize(spotDirection); vec3 viewLight = vec3(positionEC - spotPosition.xyz); float lightDistance = dot(viewLight, spotDirectionNormal); float distanceFactor = lightDistance > distanceLimit ? 0.0: 1.0; vec3 vl = normalize(positionEC - spotPosition.xyz); float theta = dot(spotDirection, vl); float epsilon = cutOff - outerCutOff; float factor = clamp((theta - outerCutOff) / epsilon, 0.0, 1.0); sumSpotColor += vec3(colorX * factor * distanceFactor, colorY * factor * distanceFactor, colorZ * factor * distanceFactor); //float distance = length(positionEC - spotPosition.xyz); //attenuation += 1.0 / (constant + distance * linear + distance * distance * quadratic); } attenuation = 1.0; diffuse = diffuse * sumSpotColor * attenuation; material.diffuse = material.diffuse * u_backgroundBrightness + diffuse; }`})}function gFi(o,f,m,v,y,x,C){let w=pFi(f,m,x,C);o.spotMaterial=w,v.preUpdate.addEventListener(function(){let A=v.camera.viewMatrix,E=new Ee;Ee.multiply(A,y,E),Ee.toArray(E,ele),w&&(w.uniforms.u_spotmodelViewMatrix=ele)})}function _Fi(o,f,m,v,y,x,C,w){let A=Yut(f,m,x,C,w);o.customShader=A,v.preUpdate.addEventListener(function(){let E=v.camera.viewMatrix,T=new Ee;Ee.multiply(E,y,T),A.setUniform("u_spotmodelViewMatrix",T)})}function vFi(o,f,m,v,y,x,C){let w=Yut(f,m,x,C);o.customShader=w,v.preUpdate.addEventListener(function(){let A=v.camera.viewMatrix,E=new Ee;Ee.multiply(A,y,E),w.setUniform("u_spotmodelViewMatrix",E)})}function tJ(o,f={},m=[]){!N(o)||(this._viewer=o,this._texture=void 0,!(!N(f)&&!(N(f.globe)&&N(f.tileset)&&N(f.gltf)))&&this.initialize(o,f,m))}tJ.prototype.reSet=function(o={},f=[]){this._texture&&(this._texture.destroy(),this._texture=void 0),this.initialize(this._viewer,o,f)};tJ.prototype.destroy=function(o){!N(o)&&!(N(o.globe)&&N(o.tileset)&&N(o.gltf))||(N(o.globe)&&o.globe.spotMaterial&&(o.globe.spotMaterial=void 0),N(o.tileset)&&o.tileset.customShader&&(o.tileset.customShader=null),N(o.gltf)&&o.gltf.customShader&&(o.gltf.customShader=null),this._texture&&(this._texture.destroy(),this._texture=void 0))};tJ.prototype.removeFromMap=function(o){this.destroy(o)};tJ.prototype.initialize=function(o,f,m){if(!N(f)&&!(N(f.globe)&&N(f.tileset)&&N(f.gltf)))return;let v=Z(f.globeBrightness,.2),y=Z(f.gltfBrightness,.2),x=Z(f.tilesetBrightness,.2),C=Z(f.gltfLightModel,pC.PBR),w=Z(f.tilesetLightModel,pC.PBR);if(!Array.isArray(m)||m.length===0)return;let A=o.scene,E=tn.eastNorthUpToFixedFrame(m[0].position),T=new Ee;Ee.inverseTransformation(E,T);let S=[],M=new H;for(let D=0;D<m.length;D++){let L=m[D];Ee.multiplyByPoint(T,L.position,M),S.push(M.x,M.y,M.z),S.push(L.direction.x,L.direction.y,L.direction.z),S.push(L.spotColor.red,L.spotColor.green,L.spotColor.blue),S.push(L.distance,Math.cos(L.cutOff/180*3.1415),Math.cos(L.outerCutOff/180*3.1415))}let I=!1,P=fFi(S,A.context,I);this._texture=P,f.globe&&gFi(f.globe,P,S,A,E,I,v),f.tileset&&_Fi(f.tileset,P,S,A,E,I,x,w),f.gltf&&vFi(f.gltf,P,S,A,E,I,y,C)};var mLe=tJ;function S4(o,f){kh.defined("scene",o),kh.defined("tileset",f),this._scene=o,this._tileset=f,this._customShader=void 0,this._height=0,this._maxHeight=100,this._lightingModel=!0,this._translucencyMode=!0,this._preUpdate=S4._preUpdate.bind(this),this._scene.preUpdate.addEventListener(this._preUpdate),this._initialize()}Object.defineProperties(S4.prototype,{maxHeight:{set:function(o){this._customShader&&(this._maxHeight=o,this._customShader.uniforms.u_maxHeight.value=o)}},lineColor:{set:function(o){this._customShader&&(this._customShader.uniforms.u_lineColor.value=o)}},gradientColor:{set:function(o){this._customShader&&(this._customShader.uniforms.u_gradientColor.value=o)}},alpha:{set:function(o){this._customShader&&(o===1&&this._translucencyMode&&(this._translucencyMode=!1,this._initialize()),o!==1&&!this._translucencyMode&&(this._translucencyMode=!0,this._initialize()),this._customShader.uniforms.u_alpha.value=o)}},lightingModel:{set:function(o){this._customShader&&this._lightingModel!==o&&(this._lightingModel=o,this._initialize(),this._customShader.uniforms.u_lightingModel.value=o)}}});S4.prototype._initialize=function(){let o=this._createCostomShader({lightingModel:this._lightingModel,translucencyMode:this._translucencyMode});this._customShader=o,this._tileset.customShader=o};S4._preUpdate=function(){this._height>this._maxHeight?this._height=0:this._height+=.5,this._customShader.uniforms.u_height.value=this._height,this._scene.requestRender()};S4.prototype._createCostomShader=function(o){return new Kw({lightingModel:pC.UNLIT,translucencyMode:o.translucencyMode?C3.TRANSLUCENT:C3.OPAQUE,uniforms:{u_timeIndex:{type:Ra.FLOAT,value:1},u_height:{type:Ra.FLOAT,value:0},u_maxHeight:{type:Ra.FLOAT,value:100},u_lineColor:{type:Ra.VEC3,value:new H(2,2,2)},u_gradientColor:{type:Ra.VEC3,value:new H(0,0,1)},u_alpha:{type:Ra.FLOAT,value:.5},u_lightingModel:{type:Ra.BOOL,value:!0}},varyings:{v_nor:Nv.VEC3,v_pos:Nv.VEC3},vertexShaderText:` void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { v_nor = vsInput.attributes.normalMC; v_pos = vsInput.attributes.positionMC; } `,fragmentShaderText:` // Color tiles by distance to the camera void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { vec3 positionECF = fsInput.attributes.positionEC; vec4 direct = vec4(0.0,0.0,1.0,0.0); vec4 directF = czm_modelView * direct; vec3 directN = normalize(directF.xyz); float distance = dot(positionECF, directN); float rgb = v_pos.z/u_maxHeight; if(u_lightingModel) { material.diffuse *= u_gradientColor * rgb; } else { material.diffuse = u_gradientColor * rgb; } if((v_pos.z < u_height) && (u_height < v_pos.z + 2.0)){ material.diffuse = u_lineColor; } material.alpha = u_alpha; } `})};S4.prototype.destroy=function(){this._tileset.customShader===this._customShader&&(this._customShader=void 0,this._tileset.customShader=void 0),this._scene.preUpdate.removeEventListener(this._preUpdate)};function yFi(){this.customShaders={},this.customShaders.lightLine=S4}var qut=yFi;function y8(o,f){this.options=Z(f,{}),this.earthCtrl=o,this.viewer=o.coreMap,this.CSME=are,this.Cust=new this.CSME.CustomShaderStage(this.options.primitive,f),this.stageArr=[],this.eventListener=null,this.eventListener=this.viewer.scene.preUpdate.addEventListener(()=>{this.Cust.update()}),this.create()}y8.prototype.create=function(o){let f=this,m=null;o?m=o:m=f.options,m.lineMaterialStage&&(f.LineMaterialStage=new f.CSME.LineMaterialStage(Z(m.lineMaterialStage,{weight:.5})),f.Cust.addStage(f.LineMaterialStage),f.stageArr.push(f.LineMaterialStage)),m.gradientMaterialStage&&(f.GradientMaterialStage=new f.CSME.GradientMaterialStage(Z(m.gradientMaterialStage,{weight:.5})),f.Cust.addStage(f.GradientMaterialStage),f.stageArr.push(f.GradientMaterialStage)),m.normalizeMaterialStage&&(f.NormalizeMaterialStage=new f.CSME.NormalizeMaterialStage(Z(m.normalizeMaterialStage,{weight:.5})),f.Cust.addStage(f.NormalizeMaterialStage),f.stageArr.push(f.NormalizeMaterialStage)),m.dynamicColorMaterialStage&&(f.DynamicColorMaterialStage=new f.CSME.DynamicColorMaterialStage(Z(m.dynamicColorMaterialStage,{weight:.5})),f.Cust.addStage(f.DynamicColorMaterialStage),f.stageArr.push(f.DynamicColorMaterialStage)),m.reflectMaterialStage&&(f.ReflectMaterialStage=new f.CSME.ReflectMaterialStage(Z(m.reflectMaterialStage,{weight:.5})),f.Cust.addStage(f.ReflectMaterialStage),f.stageArr.push(f.ReflectMaterialStage)),m.textureMaterialStage&&(f.TextureMaterialStage=new f.CSME.TextureMaterialStage(Z(m.textureMaterialStage,{weight:.5,url:`${globalThis.GEOWORLD_BASE_URL}Assets/Textures/window.png`})),f.Cust.addStage(f.TextureMaterialStage),f.stageArr.push(f.TextureMaterialStage))};y8.prototype.addStage=function(o){let f=this;f.Cust.addStage(o),f.stageArr.push(o)};y8.prototype.removeStage=function(o){this.Cust.removeStage(o.name)};y8.prototype.update=function(){let o=this;o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=o.viewer.scene.preUpdate.addEventListener(()=>{o.Cust.update()})};y8.prototype.removeFromMap=function(){let o=this;for(let f=0;f<o.stageArr.length;f++)o.removeStage(o.stageArr[f]);o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=null};var Xut=y8;function tle(o,f={}){this._earthCtrl=o,this._edgeStage=null,this._options=f,this._options.visibleEdgeColor=Z(f.visibleEdgeColor,Re.fromCssColorString("#101010")),this._options.outlineWidth=Z(f.outlineWidth,1),this._options.thresholdAngle=Z(f.thresholdAngle,12*Math.PI/180),this.add()}tle.prototype.add=function(){this._edgeStage=U6();let o=this._edgeStage;o.visibleEdgeColor=this._options.visibleEdgeColor,o.outlineWidth=this._options.outlineWidth,o.thresholdAngle=this._options.thresholdAngle,o.selected=[{},{}],o.enabled=!0,this._earthCtrl.viewer.postProcessStages.add(o)};tle.prototype.removeFromMap=function(){this._edgeStage&&(this._earthCtrl.viewer.postProcessStages.remove(this._edgeStage),this.__edgeStage=null)};Object.defineProperties(tle.prototype,{show:{get:function(){return this._edgeStage.show},set:function(o){this._edgeStage.show=o}},outlineWidth:{get:function(){return this._edgeStage.outlineWidth},set:function(o){this._edgeStage.outlineWidth=o}},thresholdAngle:{get:function(){return this._edgeStage.thresholdAngle},set:function(o){!o||(this._edgeStage.thresholdAngle=o)}},visibleEdgeColor:{get:function(){return this._edgeStage.visibleEdgeColor},set:function(o){!o||(this._edgeStage.visibleEdgeColor=o)}},hiddenEdgeColor:{get:function(){return this._edgeStage.hiddenEdgeColor},set:function(o){!o||(this._edgeStage.hiddenEdgeColor=o)}},showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var Jut=tle;function ile(o,f={}){this._earthCtrl=o,this._edgeStage=null,this._options=f,this._visibleEdgeColor=Z(f.visibleEdgeColor,Re.fromCssColorString("#ff0000")),this._hiddenEdgeColor=Z(f.hiddenEdgeColor,Re.fromCssColorString("#4d4d4d")),this.handler=null,this.key=Z(f.key,"id"),this.model=Z(f.model,null),this.add()}ile.prototype.add=function(){let o=this,f="";this._edgeStage=U6(!0);let m=this._edgeStage;m.visibleEdgeColor=this._visibleEdgeColor,m.hiddenEdgeColor=this._hiddenEdgeColor,m.selected=[],m.enabled=!1,this._earthCtrl.viewer.postProcessStages.add(m);function v(y,x){function C(A,E){let T=A.featuresLength;for(let S=0;S<T;++S){let M=A.getFeature(S);if(M.getProperty(o.key)===f){let P={pickId:M.pickId};x.selected=[P],x.enabled=!0}}}function w(A,E){let T=A.content,S=T.innerContents;if(N(S)){let M=S.length;for(let I=0;I<M;++I)C(S[I],E)}else C(T,E)}y.tileVisible.addEventListener(function(A){f!==""&&w(A,null)})}v(this.model,m),this.handler=new Ur(this._earthCtrl.coreMap.scene.canvas),this.handler.setInputAction(function(y){let x=o._earthCtrl.coreMap.scene.pick(y.position);if(m.selected=[],f="",!x||!x.primitive)return;let w=x.primitive._pickIds,E={pickId:x.pickId};m.selected=[E],m.enabled=!0,f=x.getProperty(o.key)},Ei.LEFT_CLICK)};ile.prototype.removeFromMap=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._edgeStage&&this._earthCtrl.viewer.postProcessStages.remove(this._edgeStage)};Object.defineProperties(ile.prototype,{showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var Kut=ile;function ey(o,f={}){return this._viewer=o,this.createWindField(f.url,f),this}ey.prototype.createWindField=function(o,f){let m=this;return this.WindFieldOption={color:f.color||Re.GHOSTWHITE,speed:f.speed||.2,num:f.particleNum||2e3,maxAge:f.maxAge||15,brighten:f.brighten||1.5,width:2},f||(f={}),f.color&&(f.color=Re.fromCssColorString(f.color)),this.destroy(),this.windData=void 0,this.windField=void 0,this.particles=[],this.lines=void 0,this.timer=void 0,this.primitives=this._viewer.coreMap.scene.primitives,$.ajax({type:"get",async:!1,url:o,dataType:"json",success:function(y){m.windData=y,m._init(),m.timer=setInterval(function(){m.animate()},200)},error:function(y){console.log("\u8BF7\u6C42\u98CE\u573A\u6570\u636E\u5931\u8D25!")}}),new Ur(this._viewer.coreMap.scene.canvas).setInputAction(y=>{let x=this._viewer.camera.position;x.height>1e7?this.WindFieldOption.width=2:x.height>4e6?this.WindFieldOption.width=3:x.height>15e4?this.WindFieldOption.width=4:x.height>5e3?this.WindFieldOption.width=5.5:x.height>500?this.WindFieldOption.width=6.5:this.WindFieldOption.width=7},Ei.WHEEL),this};var xFi=function(){this.x=null,this.dx=null,this.dx=null,this.y=null,this.age=null,this.birthAge=null,this.path=null},gLe=function(o){this.west=null,this.east=null,this.south=null,this.north=null,this.rows=null,this.cols=null,this.dx=null,this.dy=null,this.unit=null,this.date=null,this.grid=null,this._init(o)};ey.prototype._init=function(){this.windField=this.createField();for(let o=0;o<this.WindFieldOption.num;o++)this.particles.push(this.randomParticle(new xFi))};ey.prototype.createField=function(){let o=this._parseWindJson();return new gLe(o)};ey.prototype.animate=function(){let o=this,f=o.windField,m=o.particles,v=[],y=null,x=null,C=null,w=null;m.forEach(function(A){if(A.age<=0&&o.randomParticle(A),A.age>0){let E=A.x,T=A.y;f.isInBound(E,T)?(w=f.getIn(E,T),y=E+o.WindFieldOption.speed*w[0],x=T+o.WindFieldOption.speed*w[1],A.path.push(y,x),A.x=y,A.y=x,v.push(o._createLineInstance(o._map(A.path),A.age/A.birthAge)),A.age--):A.age=0}}),v.length<=0&&o.removeLines(),o._drawLines(v)};ey.prototype._parseWindJson=function(){let o=null,f=null,m=null;return this.windData.forEach(function(v){switch(`${v.header.parameterCategory},${v.header.parameterNumber}`){case"2,2":o=v.data,m=v.header;break;case"2,3":f=v.data;break;default:break}}),{header:m,uComponent:o,vComponent:f}};ey.prototype.removeLines=function(){this.lines&&(this.primitives.remove(this.lines),this.lines.destroy())};ey.prototype._map=function(o){let f=o.length,m=this.windField,v=m.dx,y=m.dy,x=m.west,C=m.north,w=[];for(let A=0;A<=f-2;A+=2)w.push(x+o[A]*v,C-o[A+1]*y);return w};ey.prototype._createLineInstance=function(o,f){let m=[],v=o.length,y=v/2;for(let C=0;C<v;C++)m.push(this.WindFieldOption.color.withAlpha(C/y*f*this.WindFieldOption.brighten));let x=[];for(let C=1;C<=o.length;C++)x.push(o[C-1]),C%2===0&&x.push(100);return new co({geometry:new b_({positions:H.fromDegreesArrayHeights(x),colors:m,width:this.WindFieldOption.width,colorsPerVertex:!1})})};ey.prototype._drawLines=function(o){this.removeLines();let f=new Ia({appearance:new tm({translucent:!0}),geometryInstances:o,asynchronous:!1});this.lines=this.primitives.add(f)};ey.prototype.randomParticle=function(o){let f=30,m,v;do m=Math.floor(Math.random()*(this.windField.cols-2)),v=Math.floor(Math.random()*(this.windField.rows-2));while(this.windField.getIn(m,v)[2]<=0&&f++<30);return o.x=m,o.y=v,o.age=Math.round(Math.random()*this.WindFieldOption.maxAge),o.birthAge=o.age,o.path=[m,v],o};ey.prototype.changeColor=function(o){o==="random"?this.WindFieldOption.color=o:this.WindFieldOption.color=Re.fromCssColorString(o)};ey.prototype.setSpeed=function(o){this.WindFieldOption.speed=o};ey.prototype.setMaxAge=function(o){this.WindFieldOption.maxAge=o};ey.prototype.setBrighten=function(o){this.WindFieldOption.brighten=o};ey.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.timer=void 0,this.removeLines()};gLe.prototype={constructor:gLe,_init:function(o){let f=o.header,m=o.uComponent,v=o.vComponent;this.west=+f.lo1,this.east=+f.lo2,this.south=+f.la2,this.north=+f.la1,this.rows=+f.ny,this.cols=+f.nx,this.dx=+f.dx,this.dy=+f.dy,this.unit=f.parameterUnit,this.date=f.refTime,this.grid=[];let y=0,x=null,C=null;for(let w=0;w<this.rows;w++){x=[];for(let A=0;A<this.cols;A++,y++)C=this._calcUV(m[y],v[y]),x.push(C);this.grid.push(x)}},_calcUV:function(o,f){return[+o,+f,Math.sqrt(o*o+f*f)]},_bilinearInterpolation:function(o,f,m,v,y,x){let C=1-o,w=1-f,A=C*w,E=o*w,T=C*f,S=o*f,M=m[0]*A+v[0]*E+y[0]*T+x[0]*S,I=m[1]*A+v[1]*E+y[1]*T+x[1]*S;return this._calcUV(M,I)},getIn:function(o,f){let m=Math.floor(o),v=Math.floor(f),y,x;if(m===o&&v===f)return this.grid[f][o];y=m+1,x=v+1;let C=this.getIn(m,v),w=this.getIn(y,v),A=this.getIn(m,x),E=this.getIn(y,x);return this._bilinearInterpolation(o-m,f-v,C,w,A,E)},isInBound:function(o,f){return o>=0&&o<this.cols-2&&f>=0&&f<this.rows-2}};var Qut=ey;var Mo={opacity:1,poolSize:16,canvas:null,layers:new Array,showid:null,width:0,height:0,viewer:null,workers:new Array,oceanCanvas:null,oceanCtx:null,oceanWorker:null,isMove:!1},Zut=!1,ole=!1,_Le=30,CFi=2,bFi=1,wFi="rgba(0, 0, 0, 0.97)",$ut=216,vLe=[NaN,NaN,null],iJ=null,XO,x8=null,Lm,uct=null,ect=null,tct=null,ict=!0,rct=null,qh=!1,q0=1.5,vA=1.5,BT=1,Rm=10,vg=10,yLe=null,AFi=[[30,[10,25,68]],[33,[10,25,250]],[33.5,[24,255,255]],[34,[105,233,252]],[34.5,[255,233,65]],[34.5,[255,233,15]],[34.5,[255,233,15]],[34.5,[255,233,15]],[34.5,[255,233,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,255,15]],[35,[255,235,15]],[35,[255,215,15]],[35,[255,195,15]],[35,[255,175,15]],[35,[255,155,15]],[35,[255,135,15]],[35,[255,115,15]],[35,[255,95,15]],[35,[255,75,15]],[35,[255,55,15]],[35,[255,35,15]],[35,[255,15,15]]];function cct(){let o={},f=Math.round(XO.width*CFi),m=[];for(let C=0;C<f;C++)m.push(lct({age:bLe(0,_Le)}));if(ict){let C=XO.valMax-XO.valMin;C=C/(iJ.length-1);for(let A=0;A<iJ.length;A++)iJ[A][0]=XO.valMin+A*C;let w=NFi(iJ);rct=function(A){let E=w(A,$ut);return"rgba("+E[0]+", "+E[1]+", "+E[2]+", "+$ut+")"},ict=!1}function v(){o={},m.forEach(function(C){C.age>_Le&&(C.xt=C.yt=void 0,lct(C).age=0),C.xt&&C.yt&&(C.x=C.xt,C.y=C.yt);let w=C.x,A=C.y,E=hct(w,A),T=E[2];if(T===null)C.age=_Le;else{let S=qh?w+q0*E[0]:w+vA*E[0],M=qh?A+q0*E[1]:A+vA*E[1];if(dct(S,M)){C.xt=S,C.yt=M;let I=rct(T);o[I]||(o[I]=[]),o[I].push(C)}else C.x=S,C.y=M}C.age+=1})}function y(){if(!ole){let C=Mo.oceanCtx;C.lineWidth=bFi,C.fillStyle=wFi;let w=C.globalCompositeOperation;C.globalCompositeOperation="destination-in",C.fillRect(0,0,Mo.oceanCanvas.width,Mo.oceanCanvas.height),C.globalCompositeOperation=w;for(let A in o){let E=o[A];if(E.length>0){let T=[];for(let S in E){let M=E[S];T.push({x:M.x,y:M.y}),T.push({x:M.xt,y:M.yt}),M.x=M.xt,M.y=M.yt}C.beginPath();for(let S=0;S<T.length;S+=2){let M=T[S],I=T[S+1];C.moveTo(M.x,M.y),C.lineTo(I.x,I.y)}C.strokeStyle=A,C.stroke(),C.strokeStyle="#fff"}}}}Zut=!1,Mo.oceanCtx.clearRect(0,0,Mo.oceanCanvas.width,Mo.oceanCanvas.height),function C(){if(!Zut&&!ole)if(v(),y(),!qh)vA=vA>=1.5?vA-=.05:vA,uct=requestAnimationFrame(C);else for(let w=0;w<BT;w++)v(),y()}()}function EFi(o){switch(o.type){case"success":break;case"draw":TFi(o);break;case"updraw":Rm!==10&&(XO=o.data,x8=XO.drawData,cct(),vg===10?vg=5:vg===5&&(vg=3));case"error":break;default:break}}function TFi(o){XO=o.data,x8=XO.drawData,cct()}var xLe=null;function nct(o,f){return function(){xLe||(xLe=setTimeout(function(){o(),xLe=null},f))}}function oct(o){iJ=o.color||AFi,Mo.oceanWorker=new Worker(SmartEarthRootUrl+"Workers/field/oceanWorker.js"),Mo.oceanWorker.onmessage=function(f){EFi(f.data)},Mo.oceanWorker.postMessage(o.message)}function SFi(o){let f=new Worker(SmartEarthRootUrl+"/Workers/field/rendermapWorker.js");f.onmessage=function(m){o.callback(m.data),f.terminate()},f.postMessage(o.message)}function PFi(o,f){Mo.canvas!==null&&(Mo.canvas.remove(),Mo.canvas=null),Mo.canvas=document.createElement("canvas"),Mo.canvas.width=o,Mo.canvas.height=f,Mo.canvas.style.transform="translateZ(0)"}function rle(o,f){SFi({message:{id:o.id,ncpath:o.ncpath,letiable:o.letiable,depth:o.depth},callback:function(m){PFi(m.width,m.height);let v=Mo.canvas.getContext("2d"),y=v.getImageData(0,0,m.width,m.height);for(let x=0;x<m.arrayBufferView.length;x++)y.data[x]=m.arrayBufferView[x];v.putImageData(y,0,0),DFi(m,o.id),typeof f=="function"&&f(o.id)}})}function nle(o){let f={x:0,y:0,z:0};return f.x=o.x,f.y=o.y,f.z=o.z,f}function wLe(){let o=Mo.viewer.scene,f=o.camera,m=[],v=[],y=nle(f.positionWC),x=nle(f.directionWC),C=nle(f.rightWC),w=nle(f.upWC);for(let E=0;E<16;E++)m[E]=f.viewMatrix[E],v[E]=f.frustum.projectionMatrix[E];return{width:o.canvas.clientWidth,height:o.canvas.clientHeight,viewMatrix:m,projectionMatrix:v,frustum:{fovy:f.frustum.fovy,aspectRatio:f.frustum.aspectRatio,near:f.frustum.near},positionWC:y,directionWC:x,rightWC:C,upWC:w}}function IFi(o,f){let m=wLe();if(Mo.oceanCanvas===null){Mo.oceanCanvas=document.createElement("canvas"),Mo.oceanCanvas.width=m.width,Mo.oceanCanvas.height=m.height,Mo.oceanCanvas.id="animation",Mo.oceanCanvas.style="position: absolute;left: 0px;top: 0px;pointer-events: none;",document.getElementsByClassName("map-widget")[0].appendChild(Mo.oceanCanvas),Mo.oceanCtx=Mo.oceanCanvas.getContext("2d");let v={childList:!0,attributes:!0,subtree:!0},y=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;new y(function(){Mo.oceanCanvas.width=Mo.viewer.cesiumWidget.canvas.clientWidth,Mo.oceanCanvas.height=Mo.viewer.cesiumWidget.canvas.clientHeight}).observe(Mo.viewer.cesiumWidget.canvas,v),oct({message:{id:o.id,type:"init",upath:o.upath,vpath:o.vpath,scene:m},callback:function(w){}}),Mo.viewer.scene.camera.changed.addEventListener(function(){let w=Mo.viewer.camera.positionCartographic.height;w>12e6?(q0=8,BT=2):w>8e6?(q0=6,BT=2):w>5e6?(q0=4,BT=2):w>2e6?(q0=3,BT=2):(q0=1.5,BT=1)}),Lm=new Ur(Mo.viewer.scene.canvas),Lm.setInputAction(w=>{qh=!0,Rm=10,vg=10},Ei.LEFT_DOWN),Lm.setInputAction(w=>{qh=!0,Rm=10,vg=10},Ei.MIDDLE_DOWN),Lm.setInputAction(w=>{qh=!0,Rm=10,vg=10},Ei.RIGHT_DOWN),Lm.setInputAction(w=>{nct(CLe(),100)},Ei.MOUSE_MOVE),Lm.setInputAction(w=>{vA=q0,qh=!1;let A=setTimeout(()=>{Cb(),A&&clearTimeout(A)},500)},Ei.LEFT_UP),Lm.setInputAction(w=>{vA=q0,qh=!1;let A=setTimeout(()=>{Cb(),A&&clearTimeout(A)},500)},Ei.MIDDLE_UP),Lm.setInputAction(w=>{vA=q0,qh=!1;let A=setTimeout(()=>{Cb(),A&&clearTimeout(A)},500)},Ei.RIGHT_UP);let C=null;Lm.setInputAction(w=>{qh=!1,Rm=10,vg=10,I4(),C&&clearTimeout(C),C=setTimeout(()=>{P4(),Cb()},100)},Ei.WHEEL),ect=Mo.viewer.scene.camera.moveStart.addEventListener(function(){!qh&&!C&&I4()}),tct=Mo.viewer.scene.camera.moveEnd.addEventListener(function(){!qh&&!C&&(qh=!1,Rm=10,vg=10,C&&clearTimeout(C),C=setTimeout(()=>{P4(),Cb()},100))}),window.addEventListener("resize",()=>{qh=!1,Rm=10,vg=10,I4(),C&&clearTimeout(C),C=setTimeout(()=>{P4(),Cb()},100)})}else{oct({message:{id:o.id,type:"init",upath:o.upath,vpath:o.vpath,scene:m},callback:function(y){}}),P4(),Mo.viewer.scene.camera.changed.addEventListener(function(){let y=Mo.viewer.camera.positionCartographic.height;y>12e6?(q0=8,BT=2):y>8e6?(q0=6,BT=2):y>5e6?(q0=4,BT=2):y>2e6?(q0=3,BT=2):(q0=1.5,BT=1)}),Lm=new Ur(Mo.viewer.scene.canvas),Lm.setInputAction(y=>{qh=!0,Rm=10,vg=10},Ei.LEFT_DOWN),Lm.setInputAction(y=>{qh=!0,Rm=10,vg=10},Ei.MIDDLE_DOWN),Lm.setInputAction(y=>{qh=!0,Rm=10,vg=10},Ei.RIGHT_DOWN),Lm.setInputAction(y=>{nct(CLe(),100)},Ei.MOUSE_MOVE),Lm.setInputAction(y=>{vA=q0,qh=!1;let x=setTimeout(()=>{Cb(),x&&clearTimeout(x)},500)},Ei.LEFT_UP),Lm.setInputAction(y=>{vA=q0,qh=!1;let x=setTimeout(()=>{Cb(),x&&clearTimeout(x)},500)},Ei.MIDDLE_UP),Lm.setInputAction(y=>{vA=q0,qh=!1;let x=setTimeout(()=>{Cb(),x&&clearTimeout(x)},500)},Ei.RIGHT_UP);let v=null;Lm.setInputAction(y=>{qh=!1,Rm=10,vg=10,I4(),v&&clearTimeout(v),v=setTimeout(()=>{P4(),Cb()},100)},Ei.WHEEL),ect=Mo.viewer.scene.camera.moveStart.addEventListener(function(){!qh&&!v&&I4()}),tct=Mo.viewer.scene.camera.moveEnd.addEventListener(function(){!qh&&!v&&(qh=!1,Rm=10,vg=10,v&&clearTimeout(v),v=setTimeout(()=>{P4(),Cb()},100))}),window.addEventListener("resize",()=>{qh=!1,Rm=10,vg=10,I4(),v&&clearTimeout(v),v=setTimeout(()=>{P4(),Cb()},100)})}}function I4(){Mo.oceanWorker!==null&&(qh=null,ole=!0,x8=null,Mo.oceanCtx.clearRect(0,0,Mo.oceanCanvas.width,Mo.oceanCanvas.height))}function CLe(){qh&&Mo.oceanWorker!==null&&(ole=!1,Mo.oceanWorker.postMessage({type:"update",level:10,scene:wLe()}))}function P4(){qh=!0,CLe(),qh=!1}function Cb(){Mo.oceanWorker&&!qh?(yLe&&clearTimeout(yLe),Rm!==3&&(yLe=setTimeout(()=>{vg===Rm&&(Rm===10?Rm=5:Rm===5&&(Rm=3),Mo.oceanWorker.postMessage({type:"upQuality",level:Rm,scene:wLe()})),Cb()},200))):(Rm=10,vg=10)}function MFi(o,f){switch(o.type){case"single":rle({id:0,ncpath:o.ncpath,letiable:o.letiable,depth:o.depth},f);break;case"mfile":rle({id:0,ncpath:o.ncpath.format(o.params[0]),letiable:o.letiable,depth:o.depth},function(){typeof f=="function"&&f(0);for(let m=1;m<o.params.length;m++)rle({id:m,ncpath:o.ncpath.format(o.params[m]),letiable:o.letiable,depth:o.depth})});break;case"mdepth":break;case"ocean":IFi({id:0,upath:o.upath,vpath:o.vpath},f);break;default:rle({id:0,ncpath:o.ncpath,letiable:o.letiable,depth:o.depth});break}}Mo.hide=function(){(Mo.showid||Mo.showid===0)&&Mo.layers[Mo.showid]&&(Mo.layers[Mo.showid].show=!1)};Mo.show=function(o){(Mo.showid||Mo.showid===0)&&Mo.layers[Mo.showid]&&(Mo.layers[Mo.showid].show=!1),(o||o===0)&&Mo.layers[o]&&(Mo.layers[o].show=!0,Mo.showid=o)};Mo.draw=function(o,f){MFi(o,f)};Mo.destroy=function(){I4(),Lm&&(Lm.destroy(),Lm=null);try{for(let o=0;o<Mo.layers.length;o++)Mo.viewer.entities.remove(Mo.layers[o]);Mo.layers=[]}catch{}try{for(let o=0;o<Mo.workers.length;o++)try{Mo.workers[o].terminate()}catch{}Mo.workers=[]}catch{}try{Mo.oceanWorker.terminate(),Mo.oceanWorker=null,setTimeout(()=>{cancelAnimationFrame(uct),Mo.oceanCtx.clearRect(0,0,Mo.oceanCanvas.width,Mo.oceanCanvas.height)},1e3)}catch{}};function DFi(o,f){let m=o.minx,v=o.miny,y=o.maxx,x=o.maxy,C=Di.fromDegrees(m,v,y,x),w=new Pp({image:Mo.canvas,transparent:!0});mlayer=Mo.viewer.entities.add({show:!0,rectangle:{coordinates:C,material:w}}),Mo.layers[f]=mlayer}String.prototype.format=function(o){let f=this;if(arguments.length>0){if(arguments.length==1&&typeof o=="object"){for(let m in o)if(o[m]!==void 0){let v=new RegExp("({"+m+"})","g");f=f.replace(v,o[m])}}else for(let m=0;m<arguments.length;m++)if(arguments[m]!==void 0){let v=new RegExp("({)"+m+"(})","g");f=f.replace(v,arguments[m])}}return f};function LFi(o,f,m){return Math.max(f,Math.min(o,m))}function RFi(o,f,m){return(LFi(o,f,m)-f)/(m-f)}function OFi(o,f){let m=o[0],v=o[1],y=o[2],x=f[0]-m,C=f[1]-v,w=f[2]-y;return function(A,E){return[Math.floor(m+A*x),Math.floor(v+A*C),Math.floor(y+A*w),E]}}function NFi(o){let f=[],m=[],v=[];for(let y=0;y<o.length-1;y++)f.push(o[y+1][0]),m.push(OFi(o[y][1],o[y+1][1])),v.push([o[y][0],o[y+1][0]]);return function(y,x){let C;for(C=0;C<f.length-1&&!(y<=f[C]);C++);let w=v[C];return m[C](RFi(y,w[0],w[1]),x)}}function hct(o,f){if(vg===10){let m=x8[Math.round(o*.1)*10];return m&&m[Math.round(f*.1)*10]||vLe}else if(vg===5){let m=x8[act(o)];return m&&m[act(f)]||vLe}else{let m=x8[sct(o)];return m&&m[sct(f)]||vLe}}function act(o){let f=Math.floor(o/5)*5,m=f+5;return o-f<=2.5?f:m}function sct(o){let f=Math.floor(o/3)*3,m=f+3;return o-f<m-o?f:m}function dct(o,f){return hct(o,f)[2]!==null}function bLe(o,f){return f===null&&(f=o,o=0),o+Math.floor(Math.random()*(f-o+1))}function lct(o){let f=0,m=Mo.viewer.scene.canvas.clientWidth,v=Mo.viewer.scene.canvas.clientHeight,y=Math.round(bLe(0,m)),x=Math.round(bLe(0,v));for(;!dct(y,x)&&f++<30;);return o.x=y,o.y=x,o}function ale(o){Mo.viewer=o}ale.prototype.createField=function(o,f){return Mo.draw(o,f),this};ale.prototype.destroy=function(){Mo.destroy()};ale.prototype.remove=function(){Mo.destroy()};var fct=ale;function rJ(o,f,m){return this.earthCtrl=o,this.Viewer=f,this}rJ.prototype.showCloud=function(o){this.volumeClouds&&(this.volumeClouds._postProcess.enabled=o,this.volumeClouds.enable=o)};rJ.prototype.update=function(){let o=this;this.Viewer.scene.preUpdate.addEventListener(function(){o.volumeClouds.update()})};rJ.prototype.createCloud=function(o){function f(){this.use_blue_noise=o.use_blue_noise||!0,this.wind_animation=o.wind_animation||!0,this.vSync=o.vSync||!1,this.wind_speed=o.wind_speed||.75,this.wind_direction_x=o.wind_direction_x||.4,this.wind_direction_y=o.wind_direction_y||0,this.wind_direction_z=o.wind_direction_z||-1,this.global_coverage=o.global_coverage||.223,this.global_density=o.global_density||.253,this.cloud_in_scatter=o.cloud_in_scatter||.43,this.cloud_out_scatter=o.cloud_out_scatter||.06,this.cloud_scatter_ratio=o.cloud_scatter_ratiocloud_scatter_ratio||.57,this.cloud_silver_intensity=o.cloud_silver_intensity||5,this.cloud_out_scatter_ambient=o.cloud_out_scatter_ambient||.0204,this.global_lightAbsorption=o.global_lightAbsorption||.5,this.cloud_silver_exponent=o.cloud_silver_exponent||2.3,this.use_quarter_update=o.use_quarter_update||!1,this.highlightScale=o.highlightScale||2.2,this.backScale=o.backScale||.7,this.attenuationScale=o.attenuationScale||1}let v=new f,y=o.detail_noise_high||`${SmartEarthRootUrl}/Assets/cloud/detail_noise_high.bin`,x=o.detail_noise||`${SmartEarthRootUrl}/Assets/cloud/detail_noise.bin`,C=o.weather||`${SmartEarthRootUrl}/Assets/cloud/weather_map5.png`,w=o.mark_noise||`${SmartEarthRootUrl}/Assets/cloud/mark.png`;return this.volumeClouds=new bae({viewer:this.Viewer,coordinate:{cartographicPosition:o.position,size:o.size,height:o.height},urls:{detail_noise_high:y,detail_noise:x,weather:C,mark_noise:w},cloudParam:v}),this.update(),this};Object.defineProperties(rJ.prototype,{showCloud:function(o){this.showCloud(o)}});var pct=rJ;var mct=`// author: \u5F20\u4E39\u948A void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { if(u_snow){ vec3 normalEC = fsInput.attributes.normalEC; vec3 normalMC = czm_inverseNormal * normalEC; vec3 color = material.diffuse; vec3 white = vec3(1.0,1.0,1.0); float m = dot(normalMC, u_snowDirection); m = pow(m,5.0); material.diffuse = mix(color, white, clamp(m,0.0,1.0) * u_snowAlpha); } if(u_effects){ float vtxf_a11 = fract(czm_frameNumber / 240.0) * 3.14159265 * 2.0; float vtxf_a12 = fsInput.attributes.positionMC.z / (u_effectsMaxHeight / 2.0) + sin(vtxf_a11) * 0.1; material.diffuse *= vec3(vtxf_a12); float vtxf_a13 = fract(czm_frameNumber / 240.0); float vtxf_h = clamp(fsInput.attributes.positionMC.z / u_effectsMaxHeight, 0.0, 1.0); vtxf_a13 = abs(vtxf_a13 - 0.5) * 2.0; float vtxf_diff = step(0.005, abs(vtxf_h - vtxf_a13)); material.diffuse.rgb += material.diffuse.rgb * (1.0 - vtxf_diff); } }`;var gct=`// author: \u5F20\u4E39\u948A void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) { if(u_flatten){ vec3 positionMC = vsOutput.positionMC.xyz; vec4 northEast = czm_inverseModel * vec4(u_flattenNorthEast, 1.0); vec4 southWest = czm_inverseModel * vec4(u_flattenSouthWest, 1.0); if(positionMC.x>=southWest.x && positionMC.x<=northEast.x && positionMC.y>=southWest.y && positionMC.y<=northEast.y){ vec2 st; st.x = (positionMC.x - southWest.x)/(northEast.x - southWest.x); st.y = (positionMC.y - southWest.y)/(northEast.y - southWest.y); vec4 rgba_depth = texture(u_flattenTexture, st.xy); if(rgba_depth.r > 0.0) { vsOutput.positionMC.z = u_flattenHeight; } } } }`;var ka=null;function rh(o,f){ka=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,ka),this._tree=Ne,this._color=new no(this._viewer,this._cesium),this._ModelEdit=new wX(this._viewer,this._cesium),this.modelEditData={lon:0,lat:0,height:0,scale:1,heading:0,pitch:0,roll:0,rotate:!1,rootTransform:void 0},this.flattenData=new Map}rh.prototype.create3DTilesets=function(o,f,m,v,y,x,C){var w={url:f,preferLeaves:!0,skipLevelOfDetail:!0};if(typeof m.lightColor=="string"){let I=m.lightColor.split(",");m.lightColor=new this._cesium.Cartesian3(I[0],I[1],I[2])}v.groundHeight=this._core.defaultValue(m.height,v.groundHeight);var A=this._core.extend(w,m,!0);A.time&&(A.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:A.time.start?this._cesium.JulianDate.fromDate(new Date(A.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:A.time.end?this._cesium.JulianDate.fromDate(new Date(A.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),this.availability=A.availability),A.customShader=this.getCustomShader(v);var E=new this._cesium.Cesium3DTileset(A);(v.effects||v.snow)&&(E.enableModelExperimental=!0);var T=this,S=A.id||T._core.getuid();E.id=S,E.Level=A.Level,T.item=E,v.flattenPositions&&(this.setFlatten(!0,{positions:v.flattenPositions}),v.flattenHeight!==void 0&&(this.flattenHeight=v.flattenHeight)),setTimeout(function(){m.flyTo&&T._viewer.flyTo(E);var I=T._viewer.scene.primitives.add(E);v.maximumscreenspaceerror!=null&&(E.maximumScreenSpaceError=v.maximumscreenspaceerror),v.pointcloudshading!=null&&(E.pointCloudShading.maximumAttenuation=T.checkZero(v.pointcloudshading.maximumattenuation),E.pointCloudShading.baseResolution=v.pointcloudshading.baseresolution,E.pointCloudShading.geometricErrorScale=v.pointcloudshading.geometricerrorscale,E.pointCloudShading.attenuation=v.pointcloudshading.attenuation,E.pointCloudShading.eyeDomeLighting=v.pointcloudshading.eyedomelighting,E.pointCloudShading.eyeDomeLightingStrength=v.eyeDomeLightingStrength,E.pointCloudShading.eyeDomeLightingRadius=v.eyeDomeLightingRadius);let P=E.readyPromise.then(function(L){if(A.geometricError!=null&&(L._geometricError=A.geometricError),v.groundheight!=null&&T.setHeight(v.groundheight),v.groundHeight!=null&&T.setHeight(v.groundHeight),v.groundCenter&&T.setPosition(v.groundCenter),!T.boundingSphereCenter){T.getCenter();var R=T._cesium.Cartographic.fromCartesian(T.boundingSphereCenter);T.modelEditData.lon=T._cesium.Math.toDegrees(R.longitude),T.modelEditData.lat=T._cesium.Math.toDegrees(R.latitude),T.modelEditData.height=R.height}(v.heading||v.pitch||v.roll)&&T.setEditData({roll:v.roll,pitch:v.pitch,heading:v.heading}),v.edit&&T.setEditData(v.edit),typeof C=="function"&&C(T)});P.catch&&P.catch(function(L){console.log(L)}),P.otherwise&&P.otherwise(function(L){console.log(L)}),E.Level&&(T.Level=0,T._viewer.scene.preRender.addEventListener(function(){T.isShow&&(T.Level=T._core.getLevel(T._viewer),T.Level>E.Level&&!E.show?E.show=!0:T.Level<E.Level&&E.show&&(E.show=!1))})),T.sd=I,x?T.isShow=!0:T.setVisibility(!1);var D=T.setStyle(v);E.style=new T._cesium.Cesium3DTileStyle(D)}),T._core.isnull(o)&&(o="\u65B0\u5EFA\u6A21\u578B");var M={id:S,name:o,checked:x,pId:T._core.isnull(y)?0:y,type:"3DTilesets",item:T};return T.setTreeobj(M),T._tree.insertGroupId(M,T._core.isnull(y)?0:y),this};rh.prototype.setVisibility=function(o){this.isShow=o,this.item.show=o,this.item._availability&&!o?this.item._availability=void 0:this.availability&&o&&(this.item._availability=this.availability)};rh.prototype.checkZero=function(o){var f=parseFloat(o);return f===0?void 0:f};rh.prototype.getVisibility=function(){return this.item.show};rh.prototype.deleteObject=function(){try{this._viewer.scene.primitives.remove(this.item)}catch(o){console.log(o.message)}};rh.prototype.restore=function(){this.modelEditData={lon:0,lat:0,height:0,scale:1,heading:0,pitch:0,roll:0,rotate:!1,modelMatrix:this.modelEditData.modelMatrix,rootTransform:this.modelEditData.rootTransform,originalMatrix:this.modelEditData.originalMatrix};let o=this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter);this.modelEditData.lon=this._cesium.Math.toDegrees(o.longitude),this.modelEditData.lat=this._cesium.Math.toDegrees(o.latitude),this.modelEditData.height=o.height,this.item.modelMatrix=this.modelEditData.modelMatrix.clone(),this.modelEditData.rootTransform.equals(ka.Matrix4.IDENTITY)?this.item.modelMatrix=this.modelEditData.originalMatrix.clone():(this.item._root.transform=this.modelEditData.originalMatrix.clone(),this.modelEditData.rotate=!0),this.moveModelEnd&&(this.moveModelEnd(),this.moveModelEnd=void 0),this.rotatePointPosition=void 0,this.moveEndCenter=void 0};rh.prototype.setHeight=function(o){if(o=Number(o),!isNaN(o)&&this.item!=null&&this.item.boundingSphere!=null){this.boundingSphereCenter||this.getCenter();var f=this._cesium.Cartographic.fromCartesian(this.boundingSphereCenter);this.restore(),this.modelEditData.height=o;var m=this._cesium.Cartesian3.fromRadians(f.longitude,f.latitude,0),v=this._cesium.Cartesian3.fromRadians(f.longitude,f.latitude,o),y=this._cesium.Cartesian3.subtract(v,m,new this._cesium.Cartesian3);this.item.modelMatrix=this._cesium.Matrix4.fromTranslation(y)}};rh.prototype.setPosition=function(o,f){this.item!=null&&this.item.boundingSphere!=null&&o&&(this.boundingSphereCenter||this.getCenter(),this.setEditData({lon:o[0],lat:o[1],height:f?this.boundingSphereCenterHeight:o[2]}))};rh.prototype.setEditData=function(o){if(this.item!=null&&this.item.boundingSphere!=null){if(this.boundingSphereCenter||this.getCenter(),o&&(this.modelEditData=this._core.extend(this.modelEditData,o,!0)),this.modelEditData.rootTransform.equals(ka.Matrix4.IDENTITY)){var f=ka.Cartesian3.multiplyByScalar(this.boundingSphereCenter,-1,new ka.Cartesian3),m=ka.Matrix4.fromTranslation(f),v=this._cesium.Cartesian3.fromDegrees(this.modelEditData.lon,this.modelEditData.lat,this.modelEditData.height),y=ka.Matrix4.fromTranslation(v);let T=new ka.HeadingPitchRoll(ka.Math.toRadians(this.modelEditData.heading||0),ka.Math.toRadians(this.modelEditData.pitch||0),ka.Math.toRadians(this.modelEditData.roll||0)),S=ka.Matrix3.fromHeadingPitchRoll(T),M=ka.Matrix4.fromRotation(S,new ka.Matrix4);ka.Matrix4.multiply(M,m,m),ka.Matrix4.multiply(y,m,m),this.item.modelMatrix=m;return}var x=ka.Cartesian3.fromDegrees(this.modelEditData.lon,this.modelEditData.lat,this.modelEditData.height),C=ka.Transforms.eastNorthUpToFixedFrame(x);let A=new ka.HeadingPitchRoll(ka.Math.toRadians(this.modelEditData.heading||0),ka.Math.toRadians(this.modelEditData.pitch||0),ka.Math.toRadians(this.modelEditData.roll||0)),E=ka.Matrix3.fromHeadingPitchRoll(A);ka.Matrix4.multiplyByMatrix3(C,E,C);var w=ka.Matrix4.fromUniformScale(this.modelEditData.scale);ka.Matrix4.multiply(C,w,C),this.item._root.transform=C}};rh.prototype.getCenter=function(){if(!this.boundingSphereCenter){var o=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center);this.boundingSphereCenter=this.item.boundingSphere.center.clone(),this.boundingSphereCenterHeight=o.height,this.boundingSphereRadius=this.item.boundingSphere.radius,this.modelEditData.rootTransform=this.item._root.transform.clone(),this.modelEditData.modelMatrix=this.item.modelMatrix.clone(),this.modelEditData.rootTransform.equals(ka.Matrix4.IDENTITY)?this.modelEditData.originalMatrix=this.item.modelMatrix.clone():(this.modelEditData.originalMatrix=this.item._root.transform.clone(),this.modelEditData.rotate=!0)}};rh.prototype.arge=function(o,f,m){var v=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),y=Math.sqrt(Math.pow(o.x-m.x,2)+Math.pow(o.y-m.y,2)),x=Math.sqrt(Math.pow(f.x-m.x,2)+Math.pow(f.y-m.y,2)),C=(Math.pow(v,2)+Math.pow(y,2)-Math.pow(x,2))/(2*v*y);return Math.round(Math.acos(C)*180/Math.PI)};rh.prototype.editModel=function(o={}){this._ModelEdit.start(this,o)};rh.prototype.endEdit=function(){this._ModelEdit.end()};rh.prototype.clippingModel=function(o={}){var f=this,m=this._viewer;this.moveHandler&&(this.moveHandler.destroy(),this.moveHandler=void 0,this._viewer.entities.remove(this.movePoint),this._viewer.entities.remove(this.rotatePoint)),this.clippingHandler&&(this.clippingHandler.destroy(),this.clippingHandler=void 0,f.planeEntities&&f.planeEntities.forEach(O=>{f._viewer.entities.remove(O)}),f.planeEntities=[]);let v=o.direction||"z";f.planeEntities=[],this.targetY||(o.start?this.targetY=o.start:this.targetY=0);var y;this.clippingPlanes||(this.clippingPlanes=new this._cesium.ClippingPlaneCollection({planes:[],edgeWidth:1}),this.item.clippingPlanes=this.clippingPlanes),this.clippingPlanes.removeAll(),v==="z"?this.clippingPlanes.add(new this._cesium.ClippingPlane(new this._cesium.Cartesian3(0,0,-1),0)):v==="x"?this.clippingPlanes.add(new this._cesium.ClippingPlane(new this._cesium.Cartesian3(-1,0,0),0)):v==="y"&&this.clippingPlanes.add(new this._cesium.ClippingPlane(new this._cesium.Cartesian3(0,-1,0),0)),this.boundingSphereCenter||this.getCenter();var x=this.item.boundingSphere,C=this.boundingSphereRadius;if(!this._cesium.Matrix4.equals(this.item.root.transform,this._cesium.Matrix4.IDENTITY)){var w=this._cesium.Matrix4.getTranslation(this.item.root.transform,new ka.Cartesian3),A=this._cesium.Cartographic.fromCartesian(w),E=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center),T=E.height-A.height;this.clippingPlanes.modelMatrix=this._cesium.Matrix4.fromTranslation(new this._cesium.Cartesian3(0,0,T))}for(var S=0;S<this.clippingPlanes.length;++S){var M=this.clippingPlanes.get(S),I=m.entities.add({name:"modelClippingPlane",position:x.center,plane:{dimensions:new ka.Cartesian2(C*1.2,C*1.2),material:ka.Color.WHITE.withAlpha(.1),plane:new ka.CallbackProperty(R(M),!1),outline:!0,outlineColor:ka.Color.WHITE}});f.planeEntities.push(I)}this.enableModelExperimental=this.item.enableModelExperimental,this.item.enableModelExperimental=!1,this.clippingHandler=new this._cesium.ScreenSpaceEventHandler(m.scene.canvas);var P=f._core.CreateTooltip();let D=f._cesium.Cartographic.fromCartesian(f.boundingSphereCenter);D={lon:f._cesium.Math.toDegrees(D.longitude),lat:f._cesium.Math.toDegrees(D.latitude),hei:D.height},this.clippingHandler.setInputAction(function(O){var F=m.scene.pick(O.position);f._cesium.defined(F)&&F.id&&F.id.name==="modelClippingPlane"&&(y=F.id.plane,y.material=f._cesium.Color.WHITE.withAlpha(.05),y.outlineColor=f._cesium.Color.WHITE,m.scene.screenSpaceCameraController.enableInputs=!1)},this._cesium.ScreenSpaceEventType.LEFT_DOWN);let L=f;this.clippingHandler.setInputAction(O=>{if(ka.defined(y)){let F=L._viewer.scene.camera.position,k=L._cesium.Cartographic.fromCartesian(F);k={lon:L._cesium.Math.toDegrees(k.longitude),lat:L._cesium.Math.toDegrees(k.latitude),hei:k.height};let U=O.startPosition.y-O.endPosition.y;v=="x"?D.lon-k.lon<0&&(U=-U):v=="y"&&D.lat-k.lat<0&&(U=-U),this.targetY+=U*C*.001,P.showAt(O.endPosition,"\u79FB\u52A8\u9F20\u6807\u5E73\u79FB\u88C1\u5207\u9762")}else P.showAt(O.endPosition,"\u957F\u6309\u5DE6\u952E\u4E0A\u4E0B\u62D6\u52A8\u88C1\u5207\u9762\uFF0C\u53F3\u952E\u53D6\u6D88")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.clippingHandler.setInputAction(O=>{ka.defined(y)&&(y.material=ka.Color.WHITE.withAlpha(.1),y.outlineColor=ka.Color.WHITE,y=void 0),m.scene.screenSpaceCameraController.enableInputs=!0},this._cesium.ScreenSpaceEventType.LEFT_UP),this.clippingHandler.setInputAction(O=>{f.endClipping(),o.end&&o.end()},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),this.endClipping=()=>{f.clippingHandler.destroy(),P.show(!1),f.planeEntities&&f.planeEntities.forEach(O=>{f._viewer.entities.remove(O)}),f.planeEntities=[],f.item.enableModelExperimental=f.enableModelExperimental};function R(O){return function(){return O.distance=f.targetY,O}}};rh.prototype.setFlatten=function(o,f={}){if(this.flatten=o,this.updateModelExperimental(),!o)return;let m=f.positions||[];if(m[0]&&m[0].lon&&m[0].lat)for(let I=0;I<m.length;I++)m[I]=ka.Cartesian3.fromDegrees(m[I].lon,m[I].lat);let v,y;m.length&&(v=f.fid||this._core.getuid(),this.flattenData.set(v,{id:v,modelId:this.item.id,name:f.name||"\u65B0\u5EFA\u538B\u5E73",show:this._core.defaultValue(f.show,!0),boundingSphere:ka.BoundingSphere.fromPoints(m),positions:m,setVisibility:I=>{this.showFlattenById(v,I)},deleteObject:()=>{this.removeFlattenById(v)}}),y=ka.Rectangle.fromCartesianArray(m),this.flattenRectangle?this.flattenRectangle=ka.Rectangle.union(this.flattenRectangle,y):this.flattenRectangle=y),y=this.flattenRectangle;let x,C,w,A=y.east-y.west,E=y.north-y.south,T=1024,S=document.createElement("canvas");S.width=T,S.height=T;let M=S.getContext("2d");M.fillStyle="#000",M.fillRect(0,0,T,T);for(let I of this.flattenData.values())if(I.show){let P=[];I.positions.forEach(D=>{x=ka.Cartographic.fromCartesian(D),C=(x.longitude-y.west)/A*T,w=1024-(x.latitude-y.south)/E*T,P.push([C,w])}),M.moveTo(P[0][0],P[0][1]);for(let D=0;D<P.length;D++)M.lineTo(P[D][0],P[D][1]);M.fillStyle="#f00",M.fill()}return this.flattenTexture=new ka.TextureUniform({url:S.toDataURL("image/png")}),v&&this.flattenData.get(v)};rh.prototype.setFlattenByGeojson=function(o,f){if(f)return ka.GeoJsonDataSource.load(f).then(v=>{let y=v.entities.values,x=[];for(let C=0;C<y.length;C++){let w=y[C],A;w.polyline?A=w.polyline.positions.getValue():w.polygon&&(A=w.polygon.hierarchy.getValue().positions),A&&x.push(this.setFlatten(o,{fid:w.id,name:w.name,positions:A}))}return x});this.flatten=!!o,this.updateModelExperimental()};rh.prototype.removeFlattenById=function(o){this.flattenData.delete(o),this.flatten=!!this.flattenData.size,this.setFlatten(this.flatten)};rh.prototype.showFlattenById=function(o,f){let m=this.flattenData.get(o);m&&(m.show=f),this.setFlatten(this.flatten)};rh.prototype.removeFlattenAll=function(){this.flattenData.clear(),this.flattenRectangle=new ka.Rectangle,this._flattenRectangle=void 0,this.flatten=!1,this.flattenTexture=new ka.TextureUniform({url:""}),this.updateModelExperimental()};rh.prototype.updateModelExperimental=function(){this.effects||this.flatten||this.snow?this.item&&(this.item.enableModelExperimental=!0):this.item&&(this.item.enableModelExperimental=!1)};rh.prototype.setTreeobj=function(o){this.treeobj=o};Object.defineProperties(rh.prototype,{style:{get:function(){return this.item.style}}});rh.prototype.export=function(){var o=this.item.url,f=this.item.show,m=this.item.shadows;return{type:"3DTilesets",treeobj:{name:this.treeobj.name},style:{url:o,show:f,shadows:m}}};rh.prototype.setTreeobj=function(o){this.treeobj=o};rh.prototype.setItem=function(o){this.item=o};rh.prototype.setShowStyle=function(o){var f=this.item.style;this.item.style=new this._cesium.Cesium3DTileStyle({show:!0})};rh.prototype.setStyle=function(o){var f=[],m={color:void 0,show:!0},v=!0;if(o.colors instanceof Array){for(var y=0;y<o.colors.length;y++){var x=[],C=o.colors[y].color,w=o.colors[y].condition;/^\[/.test(w)&&(w=w.replace(/^\[/,"${").replace(/\]/,"}")),this._core.isHtmlColor(C)?C=this._color.colorFromHtmlColor(C):(/^rgb/.test(C)&&(C=this._color.rgbaStringToRgbaObj(C)),C.r>1&&(C.r=C.r/255),C.g>1&&(C.g=C.g/255),C.b>1&&(C.b=C.b/255),C.a>1&&(C.a=C.a/255),C=this._color.createColor(C.r,C.g,C.b,C.a)),x.push(w),x.push(C),f.push(x)}m.color={},m.color.conditions=f}else o.colors&&(m.color=`color("${o.colors}")`);return o.show&&/\[/.test(o.show)?v=o.show.replace(/^\[/,"${").replace(/\]/,"}"):o.show&&(v=o.show),m.show=v,m};Object.defineProperties(rh.prototype,{luminanceAtZenith:{get:function(){return this.item.luminanceAtZenith},set:function(o){this.item.luminanceAtZenith=o}},groundHeight:{get:function(){if(this.item!=null&&this.item.boundingSphere!=null){var o=this._cesium.Cartographic.fromCartesian(this.item.boundingSphere.center);return o.altitude}return 0},set:function(o){this.setHeight(o)}},lon:{get:function(){return this.modelEditData.lon},set:function(o){this.modelEditData.lon=o,this.setEditData()}},lat:{get:function(){return this.modelEditData.lat},set:function(o){this.modelEditData.lat=o,this.setEditData()}},height:{get:function(){return this.modelEditData.height},set:function(o){this.modelEditData.height=o,this.setEditData()}},scale:{get:function(){return this.modelEditData.scale},set:function(o){this.modelEditData.scale=o,this.setEditData()}},material:{set:function(o){this._core.isHtmlColor(o)||(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o="rgba("+o.r+","+o.g+","+o.b+","+o.a+")"),this.item.style=new this._cesium.Cesium3DTileStyle({color:"color('"+o+"')"})}},dynamicScreenSpaceErrorDensity:{get:function(){return this.item.dynamicScreenSpaceErrorDensity},set:function(o){this.item.dynamicScreenSpaceErrorDensity=o}},shadows:{get:function(){return this.item.shadows},set:function(o){this.item.shadows=o}},classificationType:{get:function(){return this.item.classificationType},set:function(o){this.item.classificationType=o}},dynamicScreenSpaceErrorHeightFalloff:{get:function(){return this.item.dynamicScreenSpaceErrorHeightFalloff},set:function(o){this.item.dynamicScreenSpaceErrorHeightFalloff=o}},dynamicScreenSpaceErrorFactor:{get:function(){return this.item.dynamicScreenSpaceErrorFactor},set:function(o){this.item.dynamicScreenSpaceErrorFactor=o}},imageBasedLightingFactor_x:{get:function(){return this.item.imageBasedLightingFactor==null?0:this.item.imageBasedLightingFactor.x},set:function(o){this.item.imageBasedLightingFactor=new this._cesium.Cartesian2(o,this.item.imageBasedLightingFactor_y)}},imageBasedLightingFactor_y:{get:function(){return this.item.imageBasedLightingFactor==null?0:this.item.imageBasedLightingFactor.y},set:function(o){this.item.imageBasedLightingFactor=new this._cesium.Cartesian2(o,this.item.imageBasedLightingFactor_y)}},effects:{get:function(){return this.item.customShader.uniforms.u_effects.value},set:function(o){this.item.customShader.setUniform("u_effects",o),this.item.customShader.lightingModel=o?0:void 0,this.updateModelExperimental()}},effectsMaxHeight:{get:function(){return this.item.customShader.uniforms.u_effectsMaxHeight.value},set:function(o){this.item.customShader.setUniform("u_effectsMaxHeight",o)}},snow:{get:function(){return this.item.customShader.uniforms.u_snow.value},set:function(o){this.item.customShader.setUniform("u_snow",o),this.updateModelExperimental()}},snowAlpha:{get:function(){return this.item.customShader.uniforms.u_snowAlpha.value},set:function(o){this.item.customShader.setUniform("u_snowAlpha",o)}},snowDirection:{get:function(){return this.item.customShader.uniforms.u_snowDirection.value},set:function(o){this.item.customShader.setUniform("u_snowDirection",o)}},flatten:{get:function(){return this.item.customShader.uniforms.u_flatten.value},set:function(o){this.item.customShader.setUniform("u_flatten",o),this.updateModelExperimental()}},flattenHeight:{get:function(){return this.item.customShader.uniforms.u_flattenHeight.value},set:function(o){this.item.customShader.setUniform("u_flattenHeight",o)}},flattenRectangle:{get:function(){return this._flattenRectangle},set:function(o){this._flattenRectangle=o,this.item.customShader.setUniform("u_flattenSouthWest",ka.Cartesian3.fromRadians(o.west,o.south)),this.item.customShader.setUniform("u_flattenNorthEast",ka.Cartesian3.fromRadians(o.east,o.north))}},flattenTexture:{get:function(){return this.item.customShader.uniforms.u_flattenTexture.value},set:function(o){this.item.customShader.setUniform("u_flattenTexture",o)}}});rh.prototype.getCustomShader=function(o){return ka.CustomShader&&new ka.CustomShader({mode:ka.CustomShaderMode.MODIFY_MATERIAL,lightingModel:o.effects||o.removeLighting?ka.LightingModel.UNLIT:void 0,uniforms:{u_flatten:{type:ka.UniformType.BOOL,value:!1},u_flattenHeight:{type:ka.UniformType.FLOAT,value:0},u_flattenNorthEast:{type:ka.UniformType.VEC3,value:new ka.Cartesian3},u_flattenSouthWest:{type:ka.UniformType.VEC3,value:new ka.Cartesian3},u_flattenTexture:{type:ka.UniformType.SAMPLER_2D,value:new ka.TextureUniform({url:""})},u_effects:{type:ka.UniformType.BOOL,value:o.effects||!1},u_effectsMaxHeight:{type:ka.UniformType.FLOAT,value:o.effectsMaxHeight||150},u_snow:{type:ka.UniformType.BOOL,value:o.snow||!1},u_snowAlpha:{type:ka.UniformType.FLOAT,value:o.snowAlpha||.8},u_snowDirection:{type:ka.UniformType.VEC3,value:o.snowDirection||new ka.Cartesian3(1,1,0)}},vertexShaderText:this.getFlattenShader(),fragmentShaderText:this.getEffectsShader()})};rh.prototype.getFlattenShader=function(){return gct};rh.prototype.getEffectsShader=function(){return mct};rh.prototype.getType=function(){return{label:"\u6A21\u578B",value:"3DTileset"}};var kT=rh;var sle=class extends mc{constructor(f,m){super(f),this._parameter=m}addToMap(){let f=this._parameter,m=this._earthCtrl.entities.add({name:f.name,wall:{positions:f.positions,minimumHeights:f.minimumHeights,maximumHeights:f.maximumHeights,material:f.material,outline:f.outline,outlineColor:f.outlineColor,outlineWidth:f.outlineWidth,shadows:f.shadows?1:0,distanceDisplayCondition:new ia(0,f.maxDisplayDistance)}});this._primitive=m}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(sle.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},positions:{get:function(){return this._primitive.Wall.positions},set:function(o){this._primitive.Wall.positions=o,this._parameter.positions=o}},material:{get:function(){return this._primitive.Wall.material},set:function(o){this._primitive.Wall.material=o,this._parameter.material=o}},outlineColor:{get:function(){return this._parameter.outlineColor},set:function(o){this._parameter.outlineColor=o,this._primitive.Wall.outlineColor=o}},outlineWidth:{get:function(){return this._primitive.Wall.outlineWidth},set:function(o){this._primitive.Wall.outlineWidth=o,this._parameter.outlineWidth=o}},shadows:{get:function(){return this._primitive.Wall.shadows},set:function(o){this._primitive.Wall.shadows=o,this._parameter.shadows=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var _ct=sle;var lle=class extends mc{constructor(f,m){super(f),this._parameter=m}addToMap(){let f=this._parameter,m=this._earthCtrl.entities.add({name:f.name,corridor:f});this._primitive=m}removeFromMap(){this._primitive!==null&&this._earthCtrl.entities.remove(this._primitive)}toJSON(){return Ws.export(this)}};Object.defineProperties(lle.prototype,{entity:{get:function(){return this._primitive},set:function(o){this._primitive=o}},positions:{get:function(){return this._primitive.Corridor.positions},set:function(o){this._primitive.Corridor.positions=o,this._parameter.positions=o}},width:{get:function(){return this._primitive.Corridor.width},set:function(o){this._primitive.Corridor.width=o,this._parameter.width=o}},height:{get:function(){return this._primitive.Corridor.height},set:function(o){this._primitive.Corridor.height=o,this._parameter.height=o}},fill:{get:function(){return this._primitive.Corridor.fill},set:function(o){this._primitive.Corridor.fill=o,this._parameter.fill=o}},material:{get:function(){return this._primitive.Corridor.material},set:function(o){this._primitive.Corridor.material=o,this._parameter.material=o}},outline:{get:function(){return this._parameter.outline},set:function(o){this._parameter.outline=o,this._primitive.Corridor.outline=o}},outlineColor:{get:function(){return this._parameter.outlineColor},set:function(o){this._parameter.outlineColor=o,this._primitive.Corridor.outlineColor=o}},outlineWidth:{get:function(){return this._primitive.Corridor.outlineWidth},set:function(o){this._primitive.Corridor.outlineWidth=o,this._parameter.outlineWidth=o}},shadows:{get:function(){return this._primitive.Corridor.shadows},set:function(o){this._primitive.Corridor.shadows=o,this._parameter.shadows=o}},show:{get:function(){return this._primitive!==null?this._primitive.show:!1},set:function(o){this._primitive!==null&&(this._primitive.show=o,this._parameter.show=o)}},name:{get:function(){return this._parameter!==null?this._parameter.name:!1},set:function(o){this._parameter!==null&&(this._parameter.name=o)}}});var vct=lle;var M4=null;function JO(o,f){M4=f,this._viewer=o,this._core=new Sr(o,f),this._tree=Ne}JO.prototype.createDivPoint=function(o,f,m={}){var v,y=m.id||"DivPoint"+this._core.getuid();Array.isArray(f)?f.length===2?v=M4.Cartesian3.fromDegrees(f[0],f[1]):f.length===3&&(v=M4.Cartesian3.fromDegrees(f[0],f[1],f[2])):f.x&&f.y?f instanceof M4.Cartesian3?v=f:v=M4.Cartesian3.fromDegrees(f.x,f.y,f.z):f.lon&&f.lat&&(v=M4.Cartesian3.fromDegrees(f.lon,f.lat,f.height)),this.item={id:y,show:!0,name:o,type:"default",offset:"l",position:v},Object.assign(this.item,m),this._viewer.clock.onTick.addEventListener(this.updateDivPointEvent,this);var x={id:this.item.id,name:o,pId:m.GroupID||0,type:"DivPoint",item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,x.pId),this};JO.prototype.updateDivPointEvent=function(){if(this.item){let o=this.item,f=document.getElementById(o.id),m=!1;if(o.show){let v=this._viewer.scene.mapProjection.ellipsoid,y=this._viewer.scene.camera.positionWC,x=new M4.EllipsoidalOccluder(v,y);if(!x.isPointVisible(o.position))f&&(f.style.display="none");else if(o.near!==void 0||o.far!==void 0){let C=this._core.getPointToCameraDistance(this._viewer,o.position),w=o.near||0,A=o.far||1/0;C>=w&&C<=A?(f&&(f.style.display="block"),m=!0):f&&(f.style.display="none")}else f&&(f.style.display="block"),m=!0;x=void 0}else f&&(f.style.display="none");if(m){let v=this._viewer.scene.cartesianToCanvasCoordinates(o.position);if(!v)return;if(!o.name&&(o.name="SmartEarth"),!f){let C;if(o.type==="default")if(o.description){let w=o.description,A=this._core.isDOM(w);A&&(w="");let E="";Array.isArray(w)?w.forEach(T=>{E+='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+T+"</div>"}):E='<div class="divpoint-data-li" style="padding: 4px 45px 4px 0;font-size: 14px;">'+w+"</div>",C=`<div id="${o.id}" style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;"> <div class="divpoint"> <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;"> <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;"> <div class="divpoint-arrow-lt"></div> <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div> <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div> <div class="divpoint-arrow-rb"></div> <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;"> <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#29baf1 25px); margin-top: 20px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">${o.name}</div> <div class="divpoint-label-content" style="padding: 15px 0;margin-top: 3px;border-top: 2px solid #29baf1;"> ${E} </div> </div> </div> <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div> <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div> </div> <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div> </div> </div>`,$(this._viewer.container).append(C),f=document.getElementById(o.id),A&&f.querySelector(".divpoint-data-li").append(o.description),o.onclick&&(f.onclick=()=>{o.onclick(o)})}else C=`<div id="${o.id}" style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 246.52, 299.197); transform-origin: left bottom 0px;"> <div class="divpoint"> <div class="divpoint-wrap" style="position: relative;padding: 30px;overflow: hidden;"> <div class="divpoint-area" style="background-image:linear-gradient(135deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50%,transparent 50%),linear-gradient(-45deg,transparent 30px,#28bbf06c 30px,#28bbf06c 50.1%,transparent 50%);position: relative;min-width: 180px;"> <div class="divpoint-arrow-lt"></div> <div class="divpoint-b-t" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 44px;right: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;right: 0;bottom: 44px;width: 1px;z-index: 10;"></div> <div class="divpoint-b-b" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;left: 0;right: 44px;bottom: 0;height: 1px;z-index: 10;"></div> <div class="divpoint-b-l" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 44px;left: 0;bottom: 0;width: 1px;z-index: 10;"></div> <div class="divpoint-arrow-rb"></div> <div class="divpoint-label-wrap" style="padding-left: 12px;color:#fff;font-size: 16px;white-space: nowrap;overflow: hidden;"> <div class="divpoint-title" style="background-image: linear-gradient(135deg,transparent 25px,#28bbf0 25px,#28bbf0 50%,transparent 50%),linear-gradient(-45deg,transparent 32px,#28bbf0 32px,#28bbf0 50%,transparent 50%);margin-top: 10px;margin-bottom: 10px;padding: 0 12px 0 30px;height: 36px;line-height: 36px;position: relative;">${o.name}</div> </div> </div> <div class="divpoint-b-t-l" style="background-color:#29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;top: 0;left: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(52px,-22px);z-index: 10;"></div> <div class="divpoint-b-b-r" style="background-color: #29baf1;box-shadow: 0 0 10px 2px #29baf1;position: absolute;bottom: 0;right: 0;width: 1px;height: 62px;transform: rotate(45deg) translate(-52px,22px);z-index: 10;"></div> </div> <div class="divpoint-arrow" style="background-color: #28bbf0;position: absolute;bottom: 0;left: 0;width: 45px;height: 2px;transform: rotate(-45deg) translate(5px,-15px);"></div> </div> </div>`,$(this._viewer.container).append(C),f=document.getElementById(o.id),o.onclick&&(f.onclick=()=>{o.onclick(o)});else{let w=o.description,A=this._core.isDOM(w);A&&(w=""),C=`<div id="${o.id}" style="${o.onclick?"cursor: pointer;":"pointer-events: none;"}position: absolute; left: 0px; top: 0px; transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;"> <div class="divpoint"> ${w} </div> </div>`,$(this._viewer.container).append(C),f=document.getElementById(o.id),A&&f.querySelector(".divpoint").append(o.description),o.onclick&&(f.onclick=()=>{o.onclick(o)})}}let y=v.x,x=v.y-f.offsetHeight;o.offset==="c"?y-=f.offsetWidth/2:o.offset==="r"?y-=f.offsetWidth:Array.isArray(o.offset)&&(o.offset[0]==="c"?y-=f.offsetWidth/2:o.offset[0]==="r"?y-=f.offsetWidth:typeof o.offset[0]=="number"&&(y-=o.offset[0]),typeof o.offset[1]=="number"&&(x-=o.offset[1])),f.style.transform=`matrix(1, 0, 0, 1, ${y}, ${x})`}o.update&&o.update()}};JO.prototype.updateDivPoint=function(o,f={}){if(this.item){Object.assign(this.item,f),this.item.name=o;let m=document.getElementById(this.item.id);m&&m.remove()}};JO.prototype.deleteObject=function(){this._viewer.clock.onTick.removeEventListener(this.updateDivPointEvent,this);let o=document.getElementById(this.item.id);o&&o.remove()};JO.prototype.setVisibility=function(o){this.item&&(this.item.show=o)};JO.prototype.getVisibility=function(){return this.item&&this.item.show};JO.prototype.setTreeobj=function(o){this.treeobj=o};var C8=JO;var b8;function ALe(o){this._earthCtrl=o,this.Viewer=o.coreMap,b8=o.coreMap}ALe.prototype.CreateTooltip=function(o={},f,m){let v,y,x,C,w;typeof o=="object"&&(v=o),v&&v.origin?(v.origin==="center"&&(y=15,x=-12),v.origin==="top"&&(y=15,x=-44),v.origin==="bottom"&&(y=15,x=20)):(y=15,x=20),v&&v.color?(v.color==="white"&&(C="background: rgba(255, 255, 255, 0.8);color: black;"),v.color==="black"&&(C="background: rgba(0, 0, 0, 0.5);color: white;"),v.color==="yellow"&&(C="color: black;background-color: #ffcc33;border: 1px solid white;")):C="background: rgba(0, 0, 0, 0.5);color: white;",v&&v.id?w=`toolTip${v.id}`:w="toolTip";let A=document.getElementById(w);if(!A){let E=document.createElement("div");rp(".map-widget",E);let T=`<div id="${w}" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${C}"></div>`;rp(".map-widget",T),A=document.getElementById(w)}return m?(A.innerHTML=o,A.style.left=`${f.x+y}px`,A.style.top=`${f.y+x}px`,A.style.display="block"):A.style.display="none",{tooltip:A,style:v,showAt:function(E,T){this.tooltip.innerHTML=T,this.style&&this.style.origin?(this.style.origin==="center"&&(y=15,x=-this.tooltip.offsetHeight/2),this.style.origin==="top"&&(y=15,x=-this.tooltip.offsetHeight-20),this.style.origin==="bottom"&&(y=15,x=20)):(y=15,x=-this.tooltip.offsetHeight/2),this.tooltip.style.left=`${E.x+y}px`,this.tooltip.style.top=`${E.y+x}px`,this.tooltip.style.display="block"},show:function(E){E?this.tooltip.style.display="block":this.tooltip.style.display="none"}}};ALe.prototype.CreateResultTooltip=function(o={}){let f,m,v,y=o.id?`resultToolTip${o.id}`:"resultToolTip",x=document.getElementById(y);if(o.color?(o.color==="white"&&(v="background: rgba(255, 255, 255, 0.8);color: black;"),o.color==="black"&&(v="background: rgba(0, 0, 0, 0.5);color: white;"),o.color==="blue"&&(v="background: rgba(48, 119, 221);color: white;"),o.color==="yellow"&&(v="color: black;background-color: #ffcc33;border: 1px solid white;")):v="color: black;background-color: #ffcc33;border: 1px solid white;",!x){let S=`<div id="${y}" class="resultToolTip" style="display: none;pointer-events: none;position: absolute;z-index: 1000;opacity: 0.8;border-radius: 4px;padding: 4px 8px;white-space: nowrap;font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px;${v}"></div>`;rp(".map-widget",S),x=document.getElementById(y)}let C=o.addX||0,w=o.addY||0,A,E=this;function T(){if(A){if(o.far!==void 0||o.near!==void 0){let M=E.getPointToCameraDistance(b8,A);if(M>o.far){x.style.display="none";return}else if(M<o.near){x.style.display="none";return}x.style.display="block"}let S=b8.scene.cartesianToCanvasCoordinates(A);if(!S)return;f=-x.offsetWidth/2+C,m=-x.offsetHeight+w,x.style.left=`${S.x+f}px`,x.style.top=`${S.y+m}px`}}return b8.clock.onTick.addEventListener(T),{tooltip:x,position:A,showAt:function(S,M){if(this.tooltip.innerHTML=M,this.tooltip.style.display="block",this.position=S,A=S,A){let I=b8.scene.cartesianToCanvasCoordinates(A);if(!I)return;f=-this.tooltip.offsetWidth/2+C,m=-this.tooltip.offsetHeight+w,this.tooltip.style.left=`${I.x+f}px`,this.tooltip.style.top=`${I.y+m}px`}},show:function(S){S?(this.tooltip.style.display="block",A=this.position):(this.tooltip.style.display="none",A=void 0)},destroy(){b8.clock.onTick.removeEventListener(T),x.remove()}}};var R_=ALe;function Om(o,f,m){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this._earthCtrl=m}Om.prototype.createCircleScan=function(o,f=1500,m="#ff0000",v=4e3,y=!0){var x=new this._cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height);this._position=o;var C=this._cesium.Color.fromCssColorString(m);this.item=this.AddCircleScanPostStage(x,f,C,v,y);var w={id:this._core.getuid(),name:"\u65B0\u5EFA\u6269\u6563\u5706\u626B\u63CF",pId:0,type:"scan",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,0),this};Om.prototype.createMultiCircleScan=function(o,f=1500,m="#ff0000",v=4e3,y=!0){var x=new this._cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height);this._position=o;var C,C=this._cesium.Color.fromCssColorString(m);this.item=this.AddCircleScanMultiPostStage(x,f,C,v,y);var w={id:this._core.getuid(),name:"\u65B0\u5EFA\u6269\u6563\u5706\u626B\u63CF",pId:0,type:"scan",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,0),this};Om.prototype.createRadarScan=function(o,f=1500,m="#ff0000",v=4e3,y=!0){var x=new this._cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height);this._position=o;var C=this._cesium.Color.fromCssColorString(m);this.item=this.AddRadarScanPostStage(x,f,C,v,y);var w={id:this._core.getuid(),name:"\u65B0\u5EFA\u96F7\u8FBE\u626B\u63CF",pId:0,type:"scan",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,0),this};Om.prototype.createSectorScan=function(o,f=1500,m="#ff0000",v=90,y=0,x=4e3,C=!0){var w=this._cesium;this._position=o;var A=w.Color.fromCssColorString(m);if(!o)this.drawScan({color:A,duration:x,clampToGround:C});else{var E=new w.Cartesian3.fromDegrees(o.lon,o.lat,o.height);this.item=this.AddSectorScanPostStage(E,f,A,v,y,x,C)}var T={id:this._core.getuid(),name:"\u65B0\u5EFA\u6247\u5F62\u6269\u6563\u626B\u63CF",pId:0,type:"scan",item:this};return this.setTreeobj(T),this._tree.insertGroupId(T,0),this};Om.prototype.AddSectorScanPostStage=function(o,f,m,v,y,x,C){var w=this._viewer,A=this._cesium,E=this._core.defaultValue(this._position.height,0),T={};if(!A.EllipsoidFadeMaterialProperty){let S=function(M,I,P){this._definitionChanged=new A.Event,this._color=void 0,this._colorSubscription=void 0,this.color=M,this.duration=P,this._angle=I,this._time=new Date().getTime()};Object.defineProperties(S.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:A.createPropertyDescriptor("color"),angle:A.createPropertyDescriptor("angle")}),S.prototype.getType=function(M){return"EllipsoidFade"},S.prototype.getValue=function(M,I){return A.defined(I)||(I={}),I.color=A.Property.getValueOrClonedDefault(this._color,M,A.Color.WHITE,I.color),I.angle=this._angle,I},S.prototype.setAngleValue=function(M){this._angle=M},S.prototype.equals=function(M){return this===M||M instanceof S&&Property.equals(this._color,M._color)},A.EllipsoidFadeMaterialProperty=S,A.Material.EllipsoidFadeType="EllipsoidFade",A.Material.EllipsoidFadeSource=`float getAngle(in vec2 dv) { if(dv.y == 0.0 && dv.x > 0.0) { return 90.0; } if(dv.y == 0.0 && dv.x < 0.0) { return 270.0; } float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926; if(dv.x > 0.0) { if(dv.y < 0.0) { rAngle = 180.0 + rAngle; } } if(dv.x <= 0.0) { if(dv.y < 0.0) { rAngle = 180.0 + rAngle; } if(dv.y > 0.0) { rAngle = 360.0 + rAngle; } } return rAngle; } float ripple(float dist, float rippleIntensity, float rippleScale) { return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity)); } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = 1.5 * color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); float nowAngle = getAngle(st.xy-vec2(0.5, 0.5)); if(nowAngle < angle) { material.alpha = 1.0 - dis/0.5; float intensity =step(0.001,ripple(dis, 100.0, 15.0)); if(intensity == 1.0) { material.alpha = material.alpha/2.0; } } else{ material.alpha = 0.0; discard; } return material; }`,A.Material._materialCache.addMaterial(A.Material.EllipsoidFadeType,{fabric:{type:A.Material.EllipsoidFadeType,uniforms:{color:new A.Color(1,0,0,1),angle:90},source:A.Material.EllipsoidFadeSource},translucent:function(M){return!0}})}return T={name:"EllipsoidFade",position:o,ellipse:{height:C?void 0:E,semiMinorAxis:f,semiMajorAxis:f,stRotation:y*Math.PI/180,material:new A.EllipsoidFadeMaterialProperty(m,v,x)}},w.entities.add(T)};Om.prototype.drawScan=function(o){let f=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),m=new ls(this._earthCtrl);this._Tooltip=new R_(this._earthCtrl);let v=this._Tooltip.CreateTooltip(),y=this,x=[],C=null,w=null,A=0,E=0,T=[];this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),f.setInputAction(function(S){if(S.position!==null){let M=m.pickVector(S.position);M&&(x.length===0?x.push(M):x.length===2?(C&&this._viewer.entities.remove(C),x.forEach((I,P)=>{let D=Cesium.Cartographic.fromCartesian(I),L=Cesium.Math.toDegrees(D.longitude),R=Cesium.Math.toDegrees(D.latitude);T[P]=Cesium.turf.point([L,R]),P===0&&(this._position={lon:L,lat:R,height:D.height})}),w=Cesium.turf.bearing(T[0],T[1]),A=Cesium.Cartesian3.distance(x[0],x[1]),x.push(M),this.item=this.AddSectorScanPostStage(x[0],A,o.color,0,w,o.duration,o.clampToGround)):x.length===3&&this.end&&this.end())}}.bind(this),Cesium.ScreenSpaceEventType.LEFT_CLICK),f.setInputAction(function(S){let M=S.endPosition;if(M!==null){let I=m.pickVector(M);if(x.length===0)v.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else if(x.length<3&&I)x[1]=I,I&&(C||(C=this._viewer.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new Cesium.CallbackProperty(function(){return x},!1),clampToGround:!0,material:Cesium.Color.RED,width:3}})),v.showAt(M,"\u70B9\u51FB\u7ED8\u5236\u957F\u5EA6"));else if(x.length===3&&I){v.showAt(M,"\u70B9\u51FB\u7ED8\u5236\u89D2\u5EA6");let P=Cesium.Cartographic.fromCartesian(I),D=Cesium.Math.toDegrees(P.longitude),L=Cesium.Math.toDegrees(P.latitude);T[2]=Cesium.turf.point([D,L]),E=Cesium.turf.bearing(T[0],T[2])-w,E<0&&(E=360+E),this.item&&this.item._ellipse._material.setAngleValue(E)}else v.showAt(M,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236")}}.bind(this),Cesium.ScreenSpaceEventType.MOUSE_MOVE),f.setInputAction(function(S){this.end&&this.end()}.bind(this),Cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=S=>{f!==void 0&&(f.destroy(),f=void 0),y._core.mouse(y._viewer.container,0,"0"),v.show(!1),y.end=void 0}};Om.prototype.AddCircleScanPostStage=function(o,f,m,v,y){var x=this._viewer,C=this._cesium,w=this._core.defaultValue(this._position.height,0);if(!C.CircleScanMaterialProperty){let E=function(T,S){this._definitionChanged=new C.Event,this._color=void 0,this._colorSubscription=void 0,this.color=T,this.duration=S,this._time=new Date().getTime()};Object.defineProperties(E.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:C.createPropertyDescriptor("color")}),E.prototype.getType=function(T){return"CircleScan"},E.prototype.getValue=function(T,S){return C.defined(S)||(S={}),S.color=C.Property.getValueOrClonedDefault(this._color,T,C.Color.WHITE,S.color),S.time=(new Date().getTime()-this._time)%this.duration/this.duration,S},E.prototype.equals=function(T){return this===T||T instanceof E&&C.Property.equals(this._color,T._color)},C.CircleScanMaterialProperty=E,C.Material.CircleScanType="CircleScan",C.Material.CircleScanSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); if(dis<time){ float f = dis / time; material.alpha = pow(f, 4.0); }else{ material.alpha = 0.0; } return material; }`,C.Material._materialCache.addMaterial(C.Material.CircleScanType,{fabric:{type:C.Material.CircleScanType,uniforms:{color:new C.Color(1,0,0,1),time:0},source:C.Material.CircleScanSource},translucent:function(T){return!0}})}var A={name:"CircleScan",position:o,ellipse:{height:y?void 0:w,semiMinorAxis:f,semiMajorAxis:f,material:new C.CircleScanMaterialProperty(m,v)}};return x.entities.add(A)};Om.prototype.AddCircleScanMultiPostStage=function(o,f,m,v,y){var x=this._viewer,C=this._cesium,w=this._core.defaultValue(this._position.height,0);if(!C.CircleScanMultiMaterialProperty){let E=function(T,S){this._definitionChanged=new C.Event,this._color=void 0,this._colorSubscription=void 0,this.color=T,this.u_radius1=0,this.u_radius2=0,this.u_radius3=0,this.duration=S,this._time=new Date().getTime()};Object.defineProperties(E.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:C.createPropertyDescriptor("color")}),E.prototype.getType=function(T){return"CircleScanMulti"},E.prototype.getValue=function(T,S){return C.defined(S)||(S={}),S.color=C.Property.getValueOrClonedDefault(this._color,T,C.Color.WHITE,S.color),S.time=(new Date().getTime()-this._time)%this.duration/this.duration,S.time<1/3&&this.u_radius2===0&&this.u_radius1===0?this.u_radius3=S.time:S.time>=1/3&&S.time<2/3&&this.u_radius1===0?(this.u_radius3=S.time,this.u_radius2=this.u_radius3-1/3):S.time>=2/3?(this.u_radius3=S.time,this.u_radius2=this.u_radius3-1/3,this.u_radius1=this.u_radius3-2/3):S.time<1/3&&this.u_radius2!==0&&this.u_radius1!==0?(this.u_radius1=S.time,this.u_radius2=S.time+1/3,this.u_radius3=S.time+2/3):S.time>=1/3&&S.time<2/3&&this.u_radius1!==0&&(this.u_radius1=S.time-1/3,this.u_radius2=S.time,this.u_radius3=S.time+1/3),S.u_radius1=this.u_radius1,S.u_radius2=this.u_radius2,S.u_radius3=this.u_radius3,S},E.prototype.equals=function(T){return this===T||T instanceof E&&C.Property.equals(this._color,T._color)},C.CircleScanMultiMaterialProperty=E,C.Material.CircleScanMultiType="CircleScanMulti",C.Material.CircleScanMultiSource=`czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); dis = dis * 2.0; if(dis < u_radius1) { float f = dis / u_radius1; material.alpha = pow(f, 9.0); }else if(dis < u_radius2){ float f = dis / u_radius2; material.alpha = pow(f, 9.0); }else if(dis < u_radius3){ float f = dis / u_radius3; material.alpha = pow(f, 9.0); }else{ material.alpha = 0.0; } return material; }`,C.Material._materialCache.addMaterial(C.Material.CircleScanMultiType,{fabric:{type:C.Material.CircleScanMultiType,uniforms:{color:new C.Color(1,0,0,1),time:0,u_radius1:0,u_radius2:0,u_radius3:0},source:C.Material.CircleScanMultiSource},translucent:function(T){return!0}})}var A={name:"CircleScanMulti",position:o,ellipse:{height:y?void 0:w,semiMinorAxis:f,semiMajorAxis:f,material:new C.CircleScanMultiMaterialProperty(m,v)}};return x.entities.add(A)};Om.prototype.AddRadarScanPostStage=function(o,f,m,v,y){var x=this._viewer,C=this._cesium,w=this._core.defaultValue(this._position.height,0);if(!C.RadarScanMaterialProperty){let E=function(T,S){this._definitionChanged=new C.Event,this._color=void 0,this._angle=60,this.range=360,this._colorSubscription=void 0,this.color=T,this.duration=S,this.isReturn=!1,this.isGradient=!0,this._time=new Date().getTime()};Object.defineProperties(E.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:C.createPropertyDescriptor("color")}),E.prototype.getType=function(T){return"RadarScan"},E.prototype.getValue=function(T,S){return C.defined(S)||(S={}),S.color=C.Property.getValueOrClonedDefault(this._color,T,C.Color.WHITE,S.color),S.time=(new Date().getTime()-this._time)%this.duration/this.duration,S._angle=this._angle,S.range=this.range,S.gradient=this.isGradient,this.isReturn?(this.old===void 0&&(this.old=S.time),this.old>.5&&S.time<.5&&(S.inverse=!S.inverse),this.old=S.time,S.gradient?S.inverse?(S.angle2=this.range*(1-S.time),S._angle=this.range-S.angle2,S._angle>this._angle&&(S._angle=this._angle),S.angle1=S.angle2-S._angle,S.angle1<0&&(S._angle=S.angle2,S.angle1=0)):(S.angle1=this.range*S.time,S._angle=S.angle1,S._angle>this._angle&&(S._angle=this._angle),S.angle2=S.angle1+S._angle,S.angle2>this.range&&(S.angle2=this.range)):(S.range=this.range-this._angle,S.angle1=S.range*(S.inverse?1-S.time:S.time),S.angle2=S.angle1+this._angle)):(S.inverse=!1,S.angle1=this.range*S.time,S.angle2=S.angle1+this._angle,S.angle2>this.range&&(S.angle2=S.angle2-this.range)),S},E.prototype.equals=function(T){return this===T||T instanceof E&&C.Property.equals(this._color,T._color)},C.RadarScanMaterialProperty=E,C.Material.RadarScanType="RadarScan",C.Material.RadarScanSource=`float getAngle(in vec2 dv) { if(dv.y == 0.0 && dv.x > 0.0) { return 90.0; } if(dv.y == 0.0 && dv.x < 0.0) { return 270.0; } float rAngle = atan(dv.x/dv.y) * 180.0 / 3.1415926; if(dv.x > 0.0) { if(dv.y < 0.0) { rAngle = 180.0 + rAngle; } } if(dv.x <= 0.0) { if(dv.y < 0.0) { rAngle = 180.0 + rAngle; } if(dv.y > 0.0) { rAngle = 360.0 + rAngle; } } return rAngle; } float ripple(float dist, float rippleIntensity, float rippleScale) { return rippleScale * ((sin(dist * rippleIntensity - czm_frameNumber/10.0)-0.9) / (dist * rippleIntensity)); } czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse = color.rgb; vec2 st = materialInput.st; float dis = distance(st, vec2(0.5, 0.5)); float f = 0.0; float nowAngle = getAngle(st.xy-vec2(0.5, 0.5)); if(nowAngle < angle2 && nowAngle > angle1) { if(gradient){ f = (nowAngle - angle1) / _angle; material.alpha = f; if(inverse){ material.alpha = 1.0 - material.alpha; } }else{ material.alpha = 1.0; } }else if(nowAngle < range && nowAngle > angle1 && angle2 < _angle){ if(gradient){ f = (nowAngle - angle1) / _angle; material.alpha = f; if(inverse){ material.alpha = 1.0 - material.alpha; } }else{ material.alpha = 1.0; } }else if(nowAngle < angle2 && nowAngle > 0.0 && angle2 < _angle){ if(gradient){ f = (nowAngle + range - angle1) / _angle; material.alpha = f; if(inverse){ material.alpha = 1.0 - material.alpha; } }else{ material.alpha = 1.0; } }else{ material.alpha = 0.0; discard; } return material; }`,C.Material._materialCache.addMaterial(C.Material.RadarScanType,{fabric:{type:C.Material.RadarScanType,uniforms:{color:new C.Color(1,0,0,1),time:0,angle2:0,angle1:0,_angle:60,range:360,inverse:!1,gradient:!0},source:C.Material.RadarScanSource},translucent:function(T){return!0}})}var A={name:"RadarScan",position:o,ellipse:{height:y?void 0:w,semiMinorAxis:f,semiMajorAxis:f,material:new C.RadarScanMaterialProperty(m,v)}};return x.entities.add(A)};Om.prototype.setRadius=function(o){this.item&&(this.item.ellipse.semiMinorAxis=parseFloat(o),this.item.ellipse.semiMajorAxis=parseFloat(o))};Om.prototype.setTime=function(o){this.item&&(this.item.ellipse.material.duration=parseFloat(o))};Om.prototype.setRadarAngle=function(o){if(this.item&&this.item.ellipse.material.getType()==="RadarScan"){let f=this.item.ellipse.material.range;this.item.ellipse.material._angle=o>f?f:parseFloat(o)}};Om.prototype.setRadarRange=function(o){this.item&&this.item.ellipse.material.getType()==="RadarScan"&&(this.item.ellipse.material.range=o>360?360:parseFloat(o))};Om.prototype.setRadarIsReturn=function(o){this.item&&this.item.ellipse.material.getType()==="RadarScan"&&(this.item.ellipse.material.isReturn=o)};Om.prototype.setRadarIsGradient=function(o){this.item&&this.item.ellipse.material.getType()==="RadarScan"&&(this.item.ellipse.material.isGradient=o)};Om.prototype.setPosition=function(o){this.item&&(this.item.position=new Cesium.Cartesian3.fromDegrees(o.lon,o.lat))};Om.prototype.remove=function(){this._viewer.entities.remove(this.item)};Om.prototype.setTreeobj=function(o){this.treeobj=o};Om.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)};Om.prototype.setVisibility=function(o){this.item&&(this.item.show=o)};var bb=Om;function OD(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}OD.prototype.createPopupMessage=function(o){var f=document.createElement("div");f.className="kz",f.id="kzmb",f.style.position="absolute",f.style.width="200px",f.style.height="500px",f.style.padding="15px",f.style.background="rgba(0, 0, 0, 0.5)",f.style.color="#fff",f.style.top="0px",f.style.right="0px",f.style.border="solid 2px #358ABA",document.body.appendChild(f);var m=document.createElement("div");f.id="bt",m.style.overflow="hidden",m.style.height="45px",m.style.height="100%",m.className="layui-form-item",m.style.borderBottom="solid 2px #358ABA";var v=document.createElement("span");v.textContent=o,m.appendChild(v),f.appendChild(m),this.getElement("bt","kzmb")};OD.prototype.createPlotting=function(o,f){var m=document.createElement("main");m.id="kzmb",m.style.position="absolute",m.style.cursor="auto",m.style.left="0px",m.style.top="0px;",m.className="mainView",document.body.appendChild(m);var v=document.createElement("button");v.id="closeScene",v.setAttribute("aria-label","Close"),v.innerHTML="<span aria-hidden='true'>\xD7</span>",v.onclick=closeScene,v.className="myModal-close",m.appendChild(v);var y=document.createElement("input");y.id="objectTab1",y.type="radio",y.setAttribute("checked",""),y.name="objectTab";var x=document.createElement("label");x.setAttribute("for","objectTab1"),x.id="objectLabel1",x.className="function-module-caption",x.innerHTML="\u4E8C\u7EF4",m.appendChild(y),m.appendChild(x);var C=document.createElement("input");C.id="objectTab2",C.type="radio",C.name="objectTab";var w=document.createElement("label");w.setAttribute("for","objectTab2"),w.id="objectLabel2",w.className="function-module-caption",w.innerHTML="\u4E09\u7EF4",m.appendChild(C),m.appendChild(w);var A=document.createElement("section");A.id="objectContent1",m.appendChild(A);var E=[{title:"\u70B9",src:"../../static/image/point/points.png",onclick:"labelDraw()"},{title:"\u7EBF",src:"../../static/image/point/polyline.png",onclick:"polylineDraw()"},{title:"\u591A\u8FB9\u5F62",src:"../../static/image/point/polygon_clampToGround.png",onclick:"polygonDraw()"},{title:"\u77E9\u5F62",src:"../../static/image/point/rectangle.png",onclick:"rectangleDraw()"},{title:"\u5706",src:"../../static/image/point/Cricle.png",onclick:"circleDraw()"}];this.getBh(A,E);var T=document.createElement("section");T.id="objectContent2",m.appendChild(T);var S=[{title:"\u7ACB\u65B9\u4F53",src:"../../static/image/point/extrudedRectangle.png",onclick:"boxDraw()"},{title:"\u5706\u67F1\u4F53",src:"../../static/image/point/extrudedCircle.png",onclick:"cylinderDraw()"},{title:"\u5706\u9525\u4F53",src:"../../static/image/point/Cone.png",onclick:"coneDraw()"},{title:"\u7403\u4F53",src:"../../static/image/point/ellipsoid.png",onclick:"circleDraw()"},{title:"\u591A\u8FB9\u4F53",src:"../../static/image/point/Multilateral.png",onclick:"multilateralDraw()"}];this.getBh(T,S),this.getElement("kzmb","kzmb")};OD.prototype.getBh=function(o,f){var m="";m="<div class='function-module-content' style(height:'500px')><div class='function-module-sub-section'> <label class='function-module-sub-section-caption'>\u7B26\u53F7\u5E93</label><div id='icons' class='mark-list'>";for(var v=0;v<f.length;v++)m=m+"<div class='mark-list-item'><img title="+f[v].title+" src="+f[v].src+" id="+f[v].title+" onclick="+f[v].onclick+"></div>";m=m+"</div></div></div>",o.innerHTML=m};OD.prototype.createMeasurement=function(o,f){var m="craateTree",v=document.createElement("div");v.className="kz",v.id="kzmb",v.style.position="absolute",v.style.width="330px",v.style.height="500px",v.style.padding="15px",v.style.background="rgba(0, 0, 0, 0.5)",v.style.color="#fff",v.style.top="0px",v.style.right="0px",v.style.border="solid 2px #358ABA",document.body.appendChild(v);var y=document.createElement("div");y.id="bt",y.style.height="100%",y.style.overflow="hidden",y.style.height="25px",y.className="layui-form-item",y.style.borderBottom="solid 2px #358ABA";var x=document.createElement("span");x.textContent=o,y.appendChild(x),v.appendChild(y);var C=document.createElement("div");C.className="layui-tab-content",v.appendChild(C);var w=document.createElement("div");w.className="layui-tab-item layui-show",C.appendChild(w);var A=document.createElement("div");A.className="kind",w.appendChild(A);var E=document.createElement("ul");A.appendChild(E);var T=[{img:"../../img/bh/labels.png",text:"\u5782\u76F4\u9AD8\u5EA6",onclick:MeasurementVd},{img:"../../img/bh/labels.png",text:"\u6D77\u62D4\u9AD8\u5EA6",onclick:MeasurementAltitude},{img:"../../img/bh/labels.png",text:"\u7A7A\u95F4\u8DDD\u79BB",onclick:MeasurementSpaceD},{img:"../../img/bh/labels.png",text:"\u6C34\u5E73\u8DDD\u79BB",onclick:MeasurementHD},{img:"../../img/bh/labels.png",text:"\u4E09\u7EF4\u9762\u79EF",onclick:MeasurementThreeDSurfaceArea},{img:"../../img/bh/labels.png",text:"\u5E73\u9762\u9762\u79EF",onclick:MeasurementPlaneArea},{img:"../../img/bh/labels.png",text:"\u89D2\u5EA6\u6D4B\u91CF",onclick:MeasurementAngle}];this.getLi(E,T),typeof f=="function"&&f(),this.getElement("bt","kzmb")};OD.prototype.getLi=function(o,f){for(var m="",v=0;v<f.length;v++){var y=document.createElement("li");y.innerHTML=`<img src="${f[v].img}" /><p>${f[v].text}</p>`,y.onclick=f[v].onclick,o.appendChild(y)}};OD.prototype.getElement=function(o,f){var m=0,v=0,y=document.getElementById(o);y.style.cursor="move";var x=document.getElementById(f),C=!1;y.onmousedown=function(A){var A=A||window.event;m=A.clientX-x.offsetLeft,v=A.clientY-x.offsetTop,C=!0},document.onmousemove=function(w){if(C){var w=w||window.event,A=w.clientX-m,E=w.clientY-v,T=document.documentElement.clientWidth-x.offsetWidth,S=document.documentElement.clientHeight-x.offsetHeight;A<0?A=0:A>T&&(A=T),E<0?E=0:E>S&&(E=S),x.style.left=A+"px",x.style.top=E+"px"}else return},document.onmouseup=function(){C=!1}};OD.prototype.createPopupProp=function(o,f){layuiLayer.close(SmartEarthPopupData.layerProp);var m=f.width,v=f.height,y=f.fn||{};SmartEarthPopupData.propType=f.type;var x=null,C=null,w=null;for(var A in y)x=A=="cancel"?y[A]:x,C=A=="success"?y[A]:C,w=A=="end"?y[A]:w;SmartEarthPopupData.layerProp=layuiLayer.open({title:o,type:2,skin:"other-class",shade:f.shade||0,shadeClose:!0,offset:f.offset||"r",resize:!1,area:[typeof m=="number"?m+"px":m,typeof v=="number"?v+"px":v],content:SmartEarthRootUrl+f.url,success:function(E,T){C&&typeof C=="function"&&C(E,T)},cancel:function(){x&&typeof x=="function"&&x()},end:function(){w&&typeof w=="function"&&w()}})};OD.prototype.createModelLibrary=function(o){layuiLayer.close(SmartEarthPopupData.ModelLibraryLayer),!o&&(o={});var f=o.width||342,m=o.height||"90%",v=o.offset||"r",y=o.fn||{},x=null,C=null,w=null;for(var A in y)x=A=="cancel"?y[A]:x,C=A=="success"?y[A]:C,w=A=="end"?y[A]:w;SmartEarthPopupData.ModelLibraryLayer=layuiLayer.open({title:"\u6A21\u578B\u5E93",type:2,skin:"other-class",shade:0,shadeClose:!0,offset:v,resize:!1,area:[f+"px",typeof m=="number"?m+"px":m],content:SmartEarthRootUrl+"Workers/Model/ModelLibrary.html",success:function(E,T){C&&typeof C=="function"&&C(E,T)},cancel:function(){x&&typeof x=="function"&&x()},end:function(){w&&typeof w=="function"&&w()}})};var wb=OD;function ND(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource(),this._core=new Sr(o,f)}ND.prototype.createGroup=function(o,f,m){if(m!=0){if(m==null||m==null||m==""){m=this._core.isnull(Ne.selectedItem)?0:Ne.selectedItem.id;var v=Ne.getSourceByName(this._tree,o);if(v)return v.id}}var y=Ne.getSourceById(this._tree,m);if(y){var v=Ne.getSourceByName(y.children,o);if(v)return v.id;var x={id:this._core.getuid(),name:o,pId:m,checked:f,type:"group",item:this};return this.item=x,Ne.insertGroupId(x,m)}else{var x={id:this._core.getuid(),name:o,pId:m,type:"group",checked:f,item:this};return this.item=x,Ne.insertGroupId(x,m)}};ND.prototype.getVisibility=function(){return this.item.checked};ND.prototype.changeGroup=function(o,f){Ne.changeGroup(o,f)};ND.prototype.starttemporaryItem=function(){return Ne.starttemporaryItem(this._viewer)};ND.prototype.pushtemporaryItem=function(o){Ne.temporaryItem.obj.push(o)};ND.prototype.pushStateItem=function(o){Ne.temporaryItem.operation=o};ND.prototype.endtemporaryItem=function(){Ne.endtemporaryItem()};ND.prototype.export=function(){return{type:"group",style:{name:this.item.name,pId:this.item.pId,id:this.item.id}}};var D4=ND;var FFi=function(){function o(f,m){var v=[],y=!0,x=!1,C=void 0;try{for(var w=f[Symbol.iterator](),A;!(y=(A=w.next()).done)&&(v.push(A.value),!(m&&v.length===m));y=!0);}catch(E){x=!0,C=E}finally{try{!y&&w.return&&w.return()}finally{if(x)throw C}}return v}return function(f,m){if(Array.isArray(f))return f;if(Symbol.iterator in Object(f))return o(f,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),BFi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function ule(o){if(Array.isArray(o)){for(var f=0,m=Array(o.length);f<o.length;f++)m[f]=o[f];return m}else return Array.from(o)}function ap(o,f,m){this._viewer=o,this._cesium=f,this._Cesium=m.Cesium,this._url=m.url,this._urlParams=m.urlParams,this._urlTemplate=this._url+"?"+this._serialize(this._urlParams),this._rectangle=m.rectangle,this._maximumLevel=m.maximumLevel||19,this._minimumLevel=m.minimumLevel||1,this._tilingScheme=m.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=m.lowerLevelLimit||1,this._upperLevelLimit=m.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var v=this._radianToDegree(this._rectangle.west),y=this._radianToDegree(this._rectangle.south),x=this._radianToDegree(this._rectangle.east),C=this._radianToDegree(this._rectangle.north),w=this._minimumLevel;w<=this._maximumLevel;w++){var A=this._lonLatToTileInWGS84([v,y],w),E=this._lonLatToTileInWGS84([x,C],w),T=Math.min(A[0],E[0]),S=Math.max(A[0],E[0]),M=Math.min(A[1],E[1]),I=Math.max(A[1],E[1]);this._tileRangeByLevel[w]={minCol:M,maxCol:I,minRow:T,maxRow:S}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1,this._core=new Sr(o,f),this.tooltip=this._core.CreateTooltip(),this._getPosition=new Ru(this._viewer,this._cesium)}ap.prototype._serialize=function(o){var f=[],m=window.encodeURIComponent;for(var v in o){var y=o[v];(typeof y>"u"?"undefined":BFi(y))==="object"?f.push(m(v)+"="+m(JSON.stringify(y))):f.push(m(v)+"="+m(o[v]))}return f.join("&")};ap.prototype._fetch=function(o){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=new Promise(function(v,y){var x=new XMLHttpRequest;if(x.open(f.method||"GET",o),f.headers)for(var C in f.headers)x.setRequestHeader(C,f.headers[C]);x.onload=function(){if(x.readyState===4&&x.status===200)try{var w=JSON.parse(x.responseText);v(w)}catch{y(new Error("INVALID RESPONSE"))}},x.onerror=function(w){y(w)},x.onloadend=function(w){w.target.status!==200&&y(new Error("["+w.target.status+"]request failed: "+o))},x.send(f.body||null)});return m};ap.prototype._lonLatToTileInWGS84=function(o,f){var m=FFi(o,2),v=m[0],y=m[1],x=Math.floor(Math.pow(2,f)*(90-y)/180),C=Math.floor(Math.pow(2,f)*(180+v)/180);return[x,C]};ap.prototype._radianToDegree=function(o){return o/Math.PI*180};ap.prototype._isTileInRange=function(o){try{var f=this._tileRangeByLevel[o.level],m=f.minCol,v=f.maxCol,y=f.minRow,x=f.maxRow;return o.x>=m&&o.x<=v&&o.y>=y&&o.y<=x}catch{return!1}};ap.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0};ap.prototype._loadTile=function(o){var f=[],m=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),v=this;o.features.forEach(function(x){if(v._propertyToBeFiltered&&Array.isArray(v._valuesToBeFiltered)){var C=x.properties[v._propertyToBeFiltered];if(v._valuesToBeFiltered.includes(C))return}var w=x.geometry.type;if(w==="Polygon"||w==="MultiPolygon"){var A=[];v.heightById[x.properties.house_id]=x.properties.height,x.geometry.coordinates.forEach(function(E,T){A.push([]),E.forEach(function(L){if(L.length>2)L.forEach(function(O){if(O.length>=2){var F;(F=A[T]).push.apply(F,ule(O))}});else{var R;(R=A[T]).push.apply(R,ule(L))}});var S=new v._Cesium.PolygonHierarchy(v._Cesium.Cartesian3.fromDegreesArray(A[T])),M=v._Cesium.BoundingSphere.fromPoints(S.positions).center,I=v._viewer.scene.globe.getHeight(v._Cesium.Cartographic.fromCartesian(M))||0,P=new v._Cesium.PolygonGeometry({polygonHierarchy:S,height:I,vertexFormat:v._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),D=new v._Cesium.GeometryInstance({geometry:P,attributes:{color:m}});f.push(D)})}else console.warn('GeoJSONVectorTileProvider: geometry type "'+x.geometry.type+'" detected, but is not going to be rendered')});var y=new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:f});return y};ap.prototype._cameraMoveEndHandler=function(){if(!this._stop){var o=this,f=Date.now(),m=this._viewer.scene.globe._surface._tilesToRender,v=m.map(function(E){return E.level}),y=Math.min.apply(Math,ule(v)),x=Math.max.apply(Math,ule(v));if(x<this._lowerLevelLimit){o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),m=[];return}if(this._upperLevelLimit&&y>this._upperLevelLimit){o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),m=[];return}x-y>2&&(m=m.filter(function(E){return E.level>=x-2})),m.sort(function(E,T){return-(E.level-T.level)}),m=m.filter(function(E){return o._isTileInRange(E)}),this._upperLevelLimit&&(m=this._refineTiles(m,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=f;var C=[],w=0,A=0;m.forEach(function(E){var T="z"+E.level+"x"+E.x+"y"+E.y;if(C.push(T),o._tileKeys.push(T),!o._primitiveByTile[T]){var S=o._urlTemplate.replace(window.encodeURIComponent("{x}"),E.x).replace(window.encodeURIComponent("{y}"),E.y).replace(window.encodeURIComponent("{z}"),E.level);w++,o._fetch(S).then(function(M){if(o._isRemoved)throw new Error("DISCARD");if(o._isCameraMoving)throw new Error("DISCARD");if(f!==o._moveEndTimestamp)throw new Error("DISCARD");var I=o._loadTile(M,E);o._primitiveCollection.add(I),o._primitiveByTile[T]=I,A++,A>=w&&(o._tileKeys=C,o._removeObsoletePrimitives(o._primitiveByTile,C))}).catch(function(M){A++,A>=w&&(o._tileKeys=C,o._removeObsoletePrimitives(o._primitiveByTile,C)),M.message})}})}};ap.prototype._refineTiles=function(o,f){var m=[],v=[];return o.forEach(function(y){var x="Z"+y.level+"X"+y.x+"Y"+y.y;if(y.level<f-1)v.includes(x)||(m.push(y),v.push(x));else if(y.level===f-1)for(var C=0;C<2;C++)for(var w=0;w<2;w++){var A="Z"+(y.level+1)+"X"+(y.x*2+C)+"Y"+(y.y*2+w);v.includes(A)||(m.push({x:y.x*2+C,y:y.y*2+w,level:y.level+1}),v.push(A))}else{var E=y.level-f;if(E===0)v.includes(x)||(m.push(y),v.push(x));else{var T=E*2,S=Math.floor(y.x/T),M=Math.floor(y.y/T),I="Z"+f+"X"+S+"Y"+M;v.includes(I)||(m.push({x:S,y:M,level:f}),v.push(I))}}}),m};ap.prototype._removeObsoletePrimitives=function(o,f){var m=[];f.length>0&&(m=f);for(var v in o)if(!m.includes(v)){var y=this._primitiveCollection.remove(o[v]);y&&delete o[v]}};ap.prototype.addTo=function(o){this._viewer=o,this._viewer.scene.primitives.add(this._primitiveCollection,this.availability),this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()};ap.prototype.remove=function(){if(this._viewer){for(var o in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[o]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}};ap.prototype.setStatus=function(o){this._stop=o,this._primitiveCollection._availability&&o?this._primitiveCollection._availability=void 0:this.availability&&!o&&(this._primitiveCollection._availability=this.availability)};ap.prototype.isRemoved=function(){return this._isRemoved};ap.prototype.filterBy=function(o,f,m){this._propertyToBeFiltered=o,this._valuesToBeFiltered=f};ap.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null};ap.prototype.edit=function(o,f){let m=this,v=this._viewer;if(!f&&(f={}),this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),o===void 0&&(o=!0),!o){E();return}this.editHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas);var y,x,C,w;this.isEditting=!1;let A;this.editHandler.setInputAction(T=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)){m.isEditting&&(E(),m.defaultEvent(!1));return}let S=T.position,M=v.scene.pick(S);if(!(M&&M.id&&M.id.treeID!==m.treeID)&&M&&M.id&&(M.id instanceof Cesium.Entity||M.id.VectorType)){let I=M.id;!m.isEditting&&Ne.states==0?(f.callBack&&f.callBack.start&&f.callBack.start(I),w=I.VectorType,y=m.createEditEntity(w,I.VectorStyle),y.feature=I,y.treeID=m.treeID,m.getSimpleGraphicData(w,y),w==="point"||w==="billboard"||w==="label"||w==="model"?(m.isEditting=!0,m.tooltip.showAt(T.position,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E")):(m.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(m.treeID)),m.setStatus(!0),Ne.editVector=!0,m._primitiveCollection.show=!1):(I==y&&(I.VectorType==="point"||I.VectorType==="billboard"||I.VectorType==="label"||I.VectorType==="model")||I.name=="_height_point"||I.name=="_edit_point"||I.name=="_move_point"||I.name=="_add_point"||I.name=="_size_point")&&(v.container.style.cursor="crosshair",m.defaultEvent(!1),I.name=="_height_point"?(C={windowPosition:S,originHeight:m._cesium.Cartographic.fromCartesian(I.position.getValue()).height},A="_height_point"):I.name=="_move_point"?A="_move_point":I.VectorType==="point"||I.VectorType==="billboard"||I.VectorType==="label"||I.VectorType==="model"?(m.tooltip.showAt(T.position,"\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539"),A="_move_point",I.VectorType==="model"&&(I.show=!1)):I.name=="_edit_point"?A="_edit_point":I.name=="_add_point"?A="_add_point":I.name=="_size_point"&&(A="_size_point"),x=I)}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(T=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)){m.isEditting&&(E(),m.defaultEvent(!1));return}let S=v.scene.pick(T.endPosition);if(!(S&&S.id&&S.id.treeID!==m.treeID)&&(m._cesium.defined(S)?m.isEditting&&!x?(w==="point"||w==="billboard"||w==="label"||w==="model")&&S.id==y?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E\uFF0C\u53F3\u952E\u5220\u9664"):S.id&&S.id.name==="_edit_point"&&y.pottingPoint?(w==="polyline"||w==="wall")&&y.pottingPoint.length>2||w==="polygon"&&y.pottingPoint.length>3?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E\uFF0C\u53F3\u952E\u5220\u9664\u70B9"):m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E"):S.id&&(S.id.name==="_move_point"||S.id.name==="_size_point")?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E"):S.id&&S.id.name==="_add_point"?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u589E\u52A0\u8282\u70B9"):S.id&&S.id.name==="_height_point"?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u9AD8\u5EA6"):S.id==y&&m.tooltip.show(!1):!m.isEditting&&Ne.states===0&&(S.id&&S.id.VectorType?m.tooltip.showAt(T.endPosition,"\u70B9\u51FB\u6FC0\u6D3B\u7F16\u8F91"):m.tooltip.show(!1)):Ne.states==0&&!x&&m.tooltip.show(!1),m.isEditting&&x)){m.tooltip.showAt(T.endPosition,"\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539");let M=m._getPosition.getMousePosition(T);if(!M&&A!=="_height_point")return;if(A==="_edit_point"){x.position=M;let I=Ne.editPointID.edit.indexOf(x.id);if(y[w].height!==void 0){let R=m.toDegrees(M);y.pottingPoint[I]=Cesium.Cartesian3.fromDegrees(R.lon,R.lat,y[w].height.getValue()),x.position=y.pottingPoint[I]}else y.pottingPoint[I]=M;if(Ne.editPointID.add.length>0){if(I>0){let R=v.entities.getById(Ne.editPointID.add[I-1]);if(R){let O=v.entities.getById(Ne.editPointID.edit[I-1]),F=v.entities.getById(Ne.editPointID.edit[I]);R.position=Cesium.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Cesium.Cartesian3)}}if(I<y.pottingPoint.length-1){let R=v.entities.getById(Ne.editPointID.add[I]);if(R){let O=v.entities.getById(Ne.editPointID.edit[I]),F=v.entities.getById(Ne.editPointID.edit[I+1]);R.position=Cesium.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Cesium.Cartesian3)}}if(w==="polygon"&&(I===0||I===y.pottingPoint.length-1)){let R=v.entities.getById(Ne.editPointID.add[Ne.editPointID.add.length-1]);if(R){let O=v.entities.getById(Ne.editPointID.edit[0]),F=v.entities.getById(Ne.editPointID.edit[y.pottingPoint.length-1]);R.position=Cesium.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Cesium.Cartesian3)}}}let P=y.pottingPoint.concat([]),D=new m._cesium.Cartesian3,L=P.length;P.forEach(R=>{D.x+=R.x,D.y+=R.y,D.z+=R.z}),D.x/=L,D.y/=L,D.z/=L,Ne.editPointID.move&&(Ne.editPointID.move.position=D),(w==="polyline"||w==="wall"||w==="polygon"||w==="rectangle")&&SmartEarthPopupData.editGraphic.setValue("positions",P)}else if(A==="_height_point"){let I=Ne.editPointID.height.indexOf(x.id),P=v.entities.getById(Ne.editPointID.edit[I]);(w==="ellipse"||w==="cylinder"||w==="box")&&(P=Ne.editPointID.move);let D=m.toDegrees(P.position.getValue()),L=C.originHeight-D.height,R=v.scene.cartesianToCanvasCoordinates(P.position.getValue()),O=(C.windowPosition.y-T.endPosition.y)*L/Math.abs(R.y-C.windowPosition.y),F=Math.abs(L+O);Ne.editPointID.height.forEach(k=>{let U=v.entities.getById(k);if(U){let G=U.position.getValue(),j=m.toDegrees(G);U.position=m._cesium.Cartesian3.fromDegrees(j.lon,j.lat,F+D.height)}}),y[w].extrudedHeight?y[w].extrudedHeight=F+D.height:w==="box"?SmartEarthPopupData.editGraphic.setValue("height",F):w==="cylinder"&&SmartEarthPopupData.editGraphic.setValue("length",F)}else if(A==="_add_point"){let I=Ne.editPointID.add.indexOf(x.id);v.entities.remove(x);let P=v.entities.add({name:"_edit_point",position:M,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.edit.splice(I+1,0,P.id),y.pottingPoint.splice(I+1,0,M.clone());let D=Cesium.Cartesian3.midpoint(y.pottingPoint[I],y.pottingPoint[I+1],new Cesium.Cartesian3),L=v.entities.add({name:"_add_point",position:D,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),R=Cesium.Cartesian3.midpoint(y.pottingPoint[I+1],y.pottingPoint[I+2===y.pottingPoint.length?0:I+2],new Cesium.Cartesian3),O=v.entities.add({name:"_add_point",position:R,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.add.splice(I,1,L.id,O.id),SmartEarthPopupData.editGraphic.setTreeID(m.treeID),x=P,A="_edit_point";let F=y.pottingPoint.concat([]);if(w==="polyline"||w==="polygon")SmartEarthPopupData.editGraphic.setValue("positions",F);else if(w==="wall"){SmartEarthPopupData.editGraphic.setValue("positions",F);let k=SmartEarthPopupData.editGraphic.getValue("minimumHeights"),U=SmartEarthPopupData.editGraphic.getValue("maximumHeights");k.push(k[0]),U.push(U[0]),SmartEarthPopupData.editGraphic.setValue("minimumHeights",k),SmartEarthPopupData.editGraphic.setValue("maximumHeights",U)}}else if(A==="_size_point"){let I=Ne.editPointID.move.position.getValue(),P=m._cesium.Cartesian3.distance(I,M);if(w==="ellipse"||w==="cylinder"||w==="ellipsoid"&&y.isSphere)SmartEarthPopupData.editGraphic.setValue("radius",P);else if(w==="box"){let D=x.angle===90?"long":"width";SmartEarthPopupData.editGraphic.setValue(D,P*2)}}else{if(w==="point"||w==="billboard"||w==="label"||w==="model"){x.position=M;return}let I=m.toDegrees(M);C=x.position.getValue();let P=m.toDegrees(C),D=I.lon-P.lon,L=I.lat-P.lat,R=I.height-P.height;if(x.position=M,y[w].height){let F=m.toDegrees(M).height;y[w].height=F,y.thisHeight=F}y.pottingPoint.forEach((F,k)=>{let U,G,j,q=v.entities.getById(Ne.editPointID.edit[k]);if(q||(q=v.entities.getById(Ne.editPointID.size[k])),q?U=m.toDegrees(q.position.getValue()):U=m.toDegrees(F),j=m._cesium.Cartesian3.fromDegrees(U.lon+D,U.lat+L,U.height+R),F.x=j.x,F.y=j.y,F.z=j.z,q&&(q.position=j),Ne.editPointID.add.length>0&&Ne.editPointID.add[k]){let J=v.entities.getById(Ne.editPointID.add[k]);J&&(U=m.toDegrees(J.position.getValue()),J.position=m._cesium.Cartesian3.fromDegrees(U.lon+D,U.lat+L,U.height+R))}});let O=y.pottingPoint.concat([]);if(w==="polyline"||w==="wall"||w==="polygon"||w==="rectangle")SmartEarthPopupData.editGraphic.setValue("positions",O);else if(w==="ellipse")y.pottingPoint[1]=M,y.position=M.clone();else if(w==="box"){y.pottingPoint[2]=M;let F=y.box.dimensions.getValue(),k=m.toDegrees(M);y.position=Cesium.Cartesian3.fromDegrees(k.lon,k.lat,k.height+F.z/2)}else if(w==="cylinder"){y.pottingPoint[1]=M;let F=y.cylinder.length.getValue(),k=m.toDegrees(y.pottingPoint[1]);y.position=Cesium.Cartesian3.fromDegrees(k.lon,k.lat,k.height+F/2)}else w==="ellipsoid"&&(y.pottingPoint[y.pottingPoint.length-1]=M,y.position=M.clone())}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(T=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)){m.isEditting&&(E(),m.defaultEvent(!1));return}x&&x.VectorType==="model"&&(x.show=!0),x&&f.callBack&&f.callBack.updata&&f.callBack.updata(x.name,y),v.container.style.cursor="default",x=void 0,m.defaultEvent(!0)},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(T=>{if(Cesium.ExpandBySmartEarth&&(Cesium.ExpandBySmartEarth.underEarth.enable||Cesium.ExpandBySmartEarth.isStreetView)){m.isEditting&&(E(),m.defaultEvent(!1));return}let S=v.scene.pick(T.position);if(!(S&&S.id&&S.id.treeID!==m.treeID)&&m._cesium.defined(S)&&Ne.states==0){let M=S.id;if(!M.VectorType){if(Ne.editPointID.edit.indexOf(M.id)>-1&&((w==="polyline"||w==="wall")&&Ne.editPointID.edit.length>2||w==="polygon"&&Ne.editPointID.edit.length>3)){let I=Ne.editPointID.edit.indexOf(M.id);if(v.entities.removeById(M.id),Ne.editPointID.edit.splice(I,1),y.pottingPoint.splice(I,1),Ne.editPointID.add.length>0)if(Ne.editPointID.add[I]){if(v.entities.removeById(Ne.editPointID.add[I]),Ne.editPointID.add.splice(I,1),I-1>=0){let R=v.entities.getById(Ne.editPointID.add[I-1]);R&&(R.position=Cesium.Cartesian3.midpoint(y.pottingPoint[I-1],y.pottingPoint[I===y.pottingPoint.length?0:I],new Cesium.Cartesian3))}else if(I-1===-1&&w==="polygon"){let R=v.entities.getById(Ne.editPointID.add[Ne.editPointID.add.length-1]);R&&(R.position=Cesium.Cartesian3.midpoint(y.pottingPoint[0],y.pottingPoint[y.pottingPoint.length-1],new Cesium.Cartesian3))}}else v.entities.removeById(Ne.editPointID.add[I-1]),Ne.editPointID.add.pop();let P=new m._cesium.Cartesian3,D=y.pottingPoint.length;y.pottingPoint.forEach(R=>{P.x+=R.x,P.y+=R.y,P.z+=R.z}),P.x/=D,P.y/=D,P.z/=D,Ne.editPointID.move&&(Ne.editPointID.move.position=P);let L=y.pottingPoint.concat([]);if(w==="polyline"||w==="polygon")SmartEarthPopupData.editGraphic.setValue("positions",L);else if(w==="wall"){SmartEarthPopupData.editGraphic.setValue("positions",L);let R=SmartEarthPopupData.editGraphic.getValue("minimumHeights"),O=SmartEarthPopupData.editGraphic.getValue("maximumHeights");R.pop(),O.pop(),SmartEarthPopupData.editGraphic.setValue("minimumHeights",R),SmartEarthPopupData.editGraphic.setValue("maximumHeights",O)}m.tooltip.show(!1),f.callBack&&f.callBack.updata&&f.callBack.updata(x&&x.name,y)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),E();function E(){m.defaultEvent(!0),Ne.editPointID.edit.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.edit=[],Ne.editPointID.height.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.height=[],Ne.editPointID.add.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.add=[],Ne.editPointID.size.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.size=[],Ne.editPointID.move&&v.entities.remove(Ne.editPointID.move),Ne.editPointID.move=void 0,y&&v.entities.remove(y),y=void 0,w=void 0,SmartEarthPopupData.editGraphic={},m.isEditting=!1,m.setStatus(!1),Ne.editVector=!1,m._primitiveCollection.show=!0,m.delButton(!1)}return{endThisEdit:E,getEditData:function(){return{entity:y}}}};ap.prototype.createEditEntity=function(o,f){let m,v=this,y=this._viewer;if(o==="polygon"){let x=f.positions,C=v._core.defaultValue(f.height,void 0),w;f.hierarchy?w=f.hierarchy:(x=f.haveZ?v._cesium.Cartesian3.fromDegreesArrayHeights(x):v._cesium.Cartesian3.fromDegreesArray(x),w=new v._cesium.PolygonHierarchy(x)),m=y.entities.add({polygon:{hierarchy:new v._cesium.CallbackProperty(function(){return w},!1),extrudedHeight:v._core.defaultValue(f.extrudedHeight,void 0),height:C,material:new v._cesium.ImageMaterialProperty({image:v._core.defaultValue(f.image,null),repeat:v._core.defaultValue(f.repeat,new v._cesium.Cartesian2(1,1)),color:f.material}),shadows:v._cesium.ShadowMode.ENABLED,fill:!0}}),m.VectorType="polygon"}else if(o==="polyline"){let x=f.positions;x=f.haveZ?v._cesium.Cartesian3.fromDegreesArrayHeights(x):v._cesium.Cartesian3.fromDegreesArray(x),m=y.entities.add({polyline:{positions:new v._cesium.CallbackProperty(function(){return x},!1),clampToGround:v._core.defaultValue(f.clampToGround,!1),material:new Cesium.PolylineOutlineMaterialProperty({color:f.material,outlineWidth:v._core.defaultValue(f.outlineWidth,0),outlineColor:v._cesium.Color.fromCssColorString(v._core.defaultValue(f.outlineColor,"rgba(255,255,255,0.6)"))}),width:v._core.defaultValue(f.width,3)}}),m.VectorType="polyline"}else if(o==="wall"){let x=f.positions;x=f.haveZ?v._cesium.Cartesian3.fromDegreesArrayHeights(x):v._cesium.Cartesian3.fromDegreesArray(x),m=y.entities.add({wall:{positions:new v._cesium.CallbackProperty(function(){return x},!1),minimumHeights:f.minimumHeights,maximumHeights:f.maximumHeights,material:f.material,outline:!0,outlineWidth:v._core.defaultValue(f.outlineWidth,0),outlineColor:f.outlineColor}}),m.VectorType="wall"}else o==="label"?(m=y.entities.add({position:f.position,label:{text:f.text,font:f.font,scale:f.scale,style:f.style,fillColor:f.fillColor,outlineColor:f.outlineColor,outlineWidth:f.outlineWidth,showBackground:f.showBackground,backgroundColor:f.backgroundColor,heightReference:f.heightReference,horizontalOrigin:f.horizontalOrigin,verticalOrigin:f.verticalOrigin,scaleByDistance:f.scaleByDistance,distanceDisplayCondition:f.distanceDisplayCondition}}),m.VectorType="label"):o==="billboard"&&(m=y.entities.add({position:f.position,billboard:{rotation:f.rotation,width:f.width,height:f.height,image:f.image,color:f.color,scale:f.scale,heightReference:f.heightReference,horizontalOrigin:f.horizontalOrigin,verticalOrigin:f.verticalOrigin,scaleByDistance:f.scaleByDistance,distanceDisplayCondition:f.distanceDisplayCondition}}),m.VectorType="billboard");return m};ap.prototype.delButton=function(o,f,m){if(o){let v=document.getElementById("DeleteMilitaryStandardDelete");v||(v=document.createElement("button"),v.id="DeleteMilitaryStandardDelete",v.innerText="\u5220\u9664\u5BF9\u8C61",v.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(v)),v.style.display="block",v.style.top=f.y+"px",v.style.left=f.x+"px",v.onclick=m}else{let v=document.getElementById("DeleteMilitaryStandardDelete");v&&(v.style.display="none",v.onclick=null)}};ap.prototype.defaultEvent=function(o){let f=this._viewer.scene;f.screenSpaceCameraController.enableRotate=o,f.screenSpaceCameraController.enableTranslate=o,f.screenSpaceCameraController.enableZoom=o,f.screenSpaceCameraController.enableTilt=o,f.screenSpaceCameraController.enableLook=o};ap.prototype.getEntityTypeAndObject=function(o){let f={type:"",object:null};return o&&(o.billboard?(f.type="billboard",f.object=o.billboard):o.box?(f.type="box",f.object=o.box):o.corridor?(f.type="corridor",f.object=o.corridor):o.cylinder?(f.type="cylinder",f.object=o.cylinder):o.ellipse?(f.type="ellipse",f.object=o.ellipse):o.ellipsoid?(f.type="ellipsoid",f.object=o.ellipsoid):o.label?(f.type="label",f.object=o.label):o.model?(f.type="model",f.object=o.model):o.path?(f.type="path",f.object=o.path):o.plane?(f.type="plane",f.object=o.plane):o.point?(f.type="point",f.object=o.point):o.polygon?(f.type="polygon",f.object=o.polygon):o.polyline?(f.type="polyline",f.object=o.polyline):o.polylineVolume?(f.type="polylineVolume",f.object=o.polylineVolume):o.rectangle?(f.type="rectangle",f.object=o.rectangle):o.wall&&(f.type="wall",f.object=o.wall)),f};ap.prototype.toDegrees=function(o){let f=this._cesium.Cartographic.fromCartesian(o);return{lon:this._cesium.Math.toDegrees(f.longitude),lat:this._cesium.Math.toDegrees(f.latitude),height:f.height}};ap.prototype.getSimpleGraphicData=function(o,f){let m=this,v=this._viewer;if(SmartEarthPopupData.editGraphic={entity:f,type:o,graphic:f[o],getValue:function(A){if(A==="position"||A==="name"||A==="id")return this.entity[A]&&(this.entity[A].getValue?this.entity[A].getValue():this.entity[A]);if(A==="radius"){if(this.type==="ellipse")return this.graphic.semiMajorAxis.getValue();if(this.type==="ellipsoid")return this.graphic.radii.getValue().x;if(this.type==="cylinder")return this.graphic.bottomRadius.getValue()}else if(A==="pHeight"){if(this.getValue("position")){let E=this.getValue("position");return Cesium.Cartographic.fromCartesian(E).height}}else return A==="repeat"?this.graphic.material[A]&&(this.graphic.material[A].getValue?this.graphic.material[A].getValue():this.graphic.material[A]):this.graphic[A]&&(this.graphic[A].getValue?this.graphic[A].getValue():this.graphic[A])},changeHeightPoint:function(A){Ne.editPointID.height.length>0&&Ne.editPointID.height.forEach(E=>{let T=v.entities.getById(E);if(T){let S=T.position.getValue(),M=m.toDegrees(S);T.position=Cesium.Cartesian3.fromDegrees(M.lon,M.lat,A)}})},changeEditPoint:function(A){Ne.editPointID.edit.length>0&&Ne.editPointID.edit.forEach(T=>{let S=v.entities.getById(T);if(S)if(A==="clampToGround")S.point.heightReference=1;else{S.point.heightReference=0;let M=S.position.getValue(),I=m.toDegrees(M);S.position=Cesium.Cartesian3.fromDegrees(I.lon,I.lat,A)}}),Ne.editPointID.size.length>0&&Ne.editPointID.size.forEach(T=>{let S=v.entities.getById(T);if(S)if(A==="clampToGround")S.point.heightReference=1;else{S.point.heightReference=0;let M=S.position.getValue(),I=m.toDegrees(M);S.position=Cesium.Cartesian3.fromDegrees(I.lon,I.lat,A)}}),Ne.editPointID.add.length>0&&Ne.editPointID.add.forEach(T=>{let S=v.entities.getById(T);if(S)if(A==="clampToGround")S.point.heightReference=1;else{S.point.heightReference=0;let M=S.position.getValue(),I=m.toDegrees(M);S.position=Cesium.Cartesian3.fromDegrees(I.lon,I.lat,A)}});let E=Ne.editPointID.move;if(E)if(A==="clampToGround")E.point.heightReference=1;else{E.point.heightReference=0;let T=E.position.getValue(),S=m.toDegrees(T);E.position=Cesium.Cartesian3.fromDegrees(S.lon,S.lat,A)}},clearAllEditPoint:function(){Ne.editPointID.edit.forEach(A=>{v.entities.removeById(A)}),Ne.editPointID.edit=[],Ne.editPointID.height.forEach(A=>{v.entities.removeById(A)}),Ne.editPointID.height=[],Ne.editPointID.add.forEach(A=>{v.entities.removeById(A)}),Ne.editPointID.add=[],Ne.editPointID.size.forEach(A=>{v.entities.removeById(A)}),Ne.editPointID.size=[],Ne.editPointID.move&&v.entities.remove(Ne.editPointID.move),Ne.editPointID.move=void 0},setTreeID:function(A){Ne.editPointID.edit.forEach(E=>{let T=v.entities.getById(E);T.treeID=A}),Ne.editPointID.height.forEach(E=>{let T=v.entities.getById(E);T.treeID=A}),Ne.editPointID.add.forEach(E=>{let T=v.entities.getById(E);T.treeID=A}),Ne.editPointID.size.forEach(E=>{let T=v.entities.getById(E);T.treeID=A}),Ne.editPointID.move&&(Ne.editPointID.move.treeID=A)}},o==="billboard"||o==="point"||o==="label"||o==="model"){let A=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor");A?y(A):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");if(E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),o==="label"){let T=SmartEarthPopupData.editGraphic.getValue("backgroundColor");T?C(T):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)}SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="position"||T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"||T==="backgroundColor"||T==="fillColor")S=Cesium.Color.fromCssColorString(S);else if(T==="fontSize"){let M=this.getValue("font");M=M.split(" "),M[0]=S,S=M.join(" ")}else if(T==="alpha"){this.type==="label"?this.graphic.fillColor._value.alpha=S:this.graphic.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="backgroundAlpha"){this.graphic.backgroundColor._value.alpha=S;return}else if(T==="pHeight"&&this.getValue("position")){let M=this.getValue("position"),I=Cesium.Cartographic.fromCartesian(M);I.height=S,this.entity.position=Cesium.Cartographic.toCartesian(I);return}this.graphic[T]=S}}}else if(o==="polyline"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),A.outlineColor?x(A.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(E,T){if(E==="name")this.entity[E]=T;else{if(E==="color"||E==="outlineColor"){T=Cesium.Color.fromCssColorString(T),this.graphic.material[E]=T;return}else if(E==="outlineWidth"){this.graphic.material[E]=T;return}else if(E==="alpha"){this.graphic.material.color._value.alpha=T;return}else if(E==="outlineAlpha"){this.graphic.material.outlineColor._value.alpha=T;return}else if(E==="positions"){this.graphic[E]=new Cesium.CallbackProperty(function(){return T},!1);return}this.graphic[E]=T}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let E=this.getValue("positions");return this.entity.pottingPoint=E,E},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let E=this.getPottingPoint();if(!E)return;let T=new Cesium.Cartesian3;E.forEach((S,M)=>{let I=v.entities.add({name:"_edit_point",position:S,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.edit.push(I.id),T.x+=S.x,T.y+=S.y,T.z+=S.z}),T.x/=E.length,T.y/=E.length,T.z/=E.length,Ne.editPointID.move=v.entities.add({name:"_move_point",position:T,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let S=0;S<E.length-1;S++){let M=Cesium.Cartesian3.midpoint(E[S],E[S+1],new Cesium.Cartesian3),I=v.entities.add({name:"_add_point",position:M,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.add.push(I.id)}}}else if(o==="polygon"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"){if(S=Cesium.Color.fromCssColorString(S),T==="color"){this.graphic.material.color=S;return}}else if(T==="image"||T==="repeat"){this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="positions"){this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(S)},!1);return}else if(T==="hierarchy"){this.graphic.hierarchy=new Cesium.CallbackProperty(function(){return S},!1);return}else if(T==="clampToGround"){let M=function(I,P,D){D?(I.perPositionHeight=!1,I.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(I.perPositionHeight=!0,I.heightReference=Cesium.HeightReference.NONE),Ne.editPointID.edit.length>0&&!D&&P.forEach((L,R)=>{let O=v.entities.getById(Ne.editPointID.edit[R]);if(O){let F=O.position.getValue();L.x=F.x,L.y=F.y,L.z=F.z}}),I.hierarchy=new Cesium.CallbackProperty(function(){return new Cesium.PolygonHierarchy(P)},!1)};this.graphic.hierarchy instanceof Cesium.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{M(this.graphic,this.entity.pottingPoint,S)},100)):M(this.graphic,this.entity.pottingPoint,S),Ne.editPointID.add.length>0&&Ne.editPointID.add.forEach(I=>{let P=v.entities.getById(I);P&&(S?P.point.heightReference=1:P.point.heightReference=0)});return}else T==="extrudedHeight"?this.changeHeightPoint(S):T==="height"&&this.changeEditPoint(S);this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let S=this.getValue("hierarchy").positions.concat([]);if(this.getValue("height")!==void 0){let M=this.getValue("height");S.forEach(I=>{let P=m.toDegrees(I),D=Cesium.Cartesian3.fromDegrees(P.lon,P.lat,M);I.x=D.x,I.y=D.y,I.z=D.z})}return this.entity.pottingPoint=S,S},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=new Cesium.Cartesian3;T.forEach((P,D)=>{let L=v.entities.add({name:"_edit_point",position:P,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.edit.push(L.id),S.x+=P.x,S.y+=P.y,S.z+=P.z}),S.x/=T.length,S.y/=T.length,S.z/=T.length,Ne.editPointID.move=v.entities.add({name:"_move_point",position:S,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let P=0;P<T.length-1;P++){let D=Cesium.Cartesian3.midpoint(T[P],T[P+1],new Cesium.Cartesian3),L=v.entities.add({name:"_add_point",position:D,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.add.push(L.id)}let M=Cesium.Cartesian3.midpoint(T[0],T[T.length-1],new Cesium.Cartesian3),I=v.entities.add({name:"_add_point",position:M,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.add.push(I.id)}}else if(o==="ellipse"||o==="cylinder"||f.isSphere){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"){if(S=Cesium.Color.fromCssColorString(S),T==="color"){this.graphic.material.color=S;return}}else if(T==="image"||T==="repeat"){this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="semiMajorAxis"){this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return S},!1);return}else if(T==="semiMinorAxis"){this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return S},!1);return}else if(T==="radii"){this.graphic.radii=new Cesium.CallbackProperty(function(){return S},!1);return}else if(T==="topRadius"){this.graphic.topRadius=new Cesium.CallbackProperty(function(){return S},!1);return}else if(T==="bottomRadius"){this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return S},!1);return}else if(T==="radius"){this.type==="ellipse"?(this.graphic.semiMajorAxis=new Cesium.CallbackProperty(function(){return S},!1),this.graphic.semiMinorAxis=new Cesium.CallbackProperty(function(){return S},!1)):this.type==="ellipsoid"?this.graphic.material.image.getValue()!==null?this.graphic.radii=new Cesium.Cartesian3(S,S,S):this.graphic.radii=new Cesium.CallbackProperty(function(){return new Cesium.Cartesian3(S,S,S)},!1):this.type==="cylinder"&&(this.graphic.bottomRadius=new Cesium.CallbackProperty(function(){return S},!1),this.entity.changeTop&&(this.graphic.topRadius=new Cesium.CallbackProperty(function(){return S},!1)));let M=Ne.editPointID.move.position.getValue(),I=m.GetPositionFromA_D(M,S,90),P=v.entities.getById(Ne.editPointID.size[0]);P.position=I,f.pottingPoint[0]=I,f.pottingPoint[f.pottingPoint.length-1]=M;let D=v.entities.getById(Ne.editPointID.height[0]);if(D){let L=m.toDegrees(I),R=m._cesium.Cartographic.fromCartesian(D.position.getValue());D.position=m._cesium.Cartesian3.fromDegrees(L.lon,L.lat,R.height)}return}else if(this.type==="cylinder"&&T==="length"){this.graphic.length=S;let M=m.toDegrees(this.entity.pottingPoint[1]);this.entity.position=Cesium.Cartesian3.fromDegrees(M.lon,M.lat,M.height+S/2),this.changeHeightPoint(M.height+S);return}else if(this.type==="ellipse"&&T==="clampToGround"){let M=function(I,P,D){D?(I.thisHeight===void 0&&(I.thisHeight=P.height&&P.height.getValue()),P.height=void 0,P.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(P.height=I.thisHeight,P.heightReference=Cesium.HeightReference.NONE);let L=P.semiMinorAxis.getValue();P.semiMinorAxis=new Cesium.CallbackProperty(function(){return L},!1),P.semiMajorAxis=new Cesium.CallbackProperty(function(){return L},!1)};this.graphic.semiMinorAxis instanceof Cesium.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{M(this.entity,this.graphic,S)},100)):M(this.entity,this.graphic,S),S?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight);return}else this.type==="ellipse"&&T==="extrudedHeight"?this.changeHeightPoint(S):this.type==="ellipse"&&T==="height"&&(this.changeEditPoint(S),this.entity.thisHeight=S);this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let T=this.getValue("radius"),S=this.getValue("position");if(this.type==="ellipse"||this.entity.isSphere){if(this.type==="ellipse"&&this.getValue("height")!==void 0){let I=this.getValue("height"),P=m.toDegrees(S);S=Cesium.Cartesian3.fromDegrees(P.lon,P.lat,I)}let M=m.GetPositionFromA_D(S,T,90);return this.entity.pottingPoint=[M,S],[M,S]}else{let M=m.toDegrees(S);S=Cesium.Cartesian3.fromDegrees(M.lon,M.lat,M.height-this.getValue("length")/2);let I=m.GetPositionFromA_D(S,T,90);return this.entity.pottingPoint=[I,S],[I,S]}},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=v.entities.add({name:"_size_point",position:T[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});S.angle=90,Ne.editPointID.size.push(S.id),Ne.editPointID.move=v.entities.add({name:"_move_point",position:T[1],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}else if(o==="rectangle"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"){if(S=Cesium.Color.fromCssColorString(S),T==="color"){this.graphic.material.color=S;return}}else if(T==="image"||T==="repeat"){this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="positions"){this.graphic.coordinates=new Cesium.CallbackProperty(function(){return Cesium.Rectangle.fromCartesianArray(S)},!1);return}else if(T==="coordinates"){this.graphic.coordinates=new Cesium.CallbackProperty(function(){return S},!1);return}else if(T==="clampToGround"){let M=function(I,P,D){D?(I.thisHeight===void 0&&(I.thisHeight=P.height&&P.height.getValue()),P.height=void 0,P.heightReference=Cesium.HeightReference.CLAMP_TO_GROUND):(P.height=I.thisHeight,P.heightReference=Cesium.HeightReference.NONE);let L=P.coordinates.getValue();P.coordinates=new Cesium.CallbackProperty(function(){return L},!1)};this.graphic.coordinates instanceof Cesium.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{M(this.entity,this.graphic,S)},100)):M(this.entity,this.graphic,S),S?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight);return}else T==="extrudedHeight"?this.changeHeightPoint(S):T==="height"&&(this.changeEditPoint(S),this.entity.thisHeight=S);this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let T=this.getValue("coordinates"),S,M,I=this.getValue("height");return I!==void 0?(S=Cesium.Cartesian3.fromRadians(T.west,T.north,I),M=Cesium.Cartesian3.fromRadians(T.east,T.south,I)):(I=v.scene.sampleHeight(new Cesium.Cartographic(T.west,T.north,0),[this.entity]),S=Cesium.Cartesian3.fromRadians(T.west,T.north,I),I=v.scene.sampleHeight(new Cesium.Cartographic(T.east,T.south,0),[this.entity]),M=Cesium.Cartesian3.fromRadians(T.east,T.south,I)),this.entity.pottingPoint=[S,M],[S,M]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=new Cesium.Cartesian3;T.forEach((M,I)=>{let P=v.entities.add({name:"_edit_point",position:M,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.edit.push(P.id),S.x+=M.x,S.y+=M.y,S.z+=M.z}),S.x/=T.length,S.y/=T.length,S.z/=T.length,Ne.editPointID.move=v.entities.add({name:"_move_point",position:S,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}else if(o==="box"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"){if(S=Cesium.Color.fromCssColorString(S),T==="color"){this.graphic.material.color=S;return}}else if(T==="image"||T==="repeat"){this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="long"||T==="width"||T==="height"){let M=this.getValue("dimensions");if(T==="long"?M.x=S:T==="width"?M.y=S:M.z=S,this.graphic.dimensions=new Cesium.CallbackProperty(function(){return M},!1),T==="long"||T==="width"){let I=T==="long"?90:180,P=T==="long"?0:1,D=Ne.editPointID.move.position.getValue(),L=m.GetPositionFromA_D(D,S/2,I),R=v.entities.getById(Ne.editPointID.size[P]);R.position=L,this.entity.pottingPoint[P]=L,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=D}else{let I=m.toDegrees(Ne.editPointID.move.position.getValue());this.entity.position=Cesium.Cartesian3.fromDegrees(I.lon,I.lat,I.height+S/2),this.changeHeightPoint(I.height+S)}return}else if(T==="dimensions"){this.graphic.dimensions=new Cesium.CallbackProperty(function(){return S},!1);return}this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let T=this.getValue("dimensions"),S=this.getValue("position"),M=m.toDegrees(S);S=Cesium.Cartesian3.fromDegrees(M.lon,M.lat,M.height-T.z/2);let I=m.GetPositionFromA_D(S,T.x/2,90),P=m.GetPositionFromA_D(S,T.y/2,180);return this.entity.pottingPoint=[I,P,S],[I,P,S]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=v.entities.add({name:"_size_point",position:T[0],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});S.angle=90;let M=v.entities.add({name:"_size_point",position:T[1],point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});M.angle=180,Ne.editPointID.size.push(S.id),Ne.editPointID.size.push(M.id),Ne.editPointID.move=v.entities.add({name:"_move_point",position:T[2],point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}else if(o!=="corridor"){if(!(o==="ellipsoid"&&!f.isSphere)){if(o!=="path"){if(o!=="plane"){if(o!=="polylineVolume"){if(o==="wall"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"){S=Cesium.Color.fromCssColorString(S),this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="positions"){this.graphic[T]=new Cesium.CallbackProperty(function(){return S},!1);return}this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let T=this.getValue("positions");return this.entity.pottingPoint=T,T},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=new Cesium.Cartesian3,M=this.getValue("minimumHeights");T.forEach((I,P)=>{let D=Cesium.Cartographic.fromCartesian(I),L=Cesium.Cartesian3.fromRadians(D.longitude,D.latitude,M[P]),R=v.entities.add({name:"_edit_point",position:L,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.edit.push(R.id),S.x+=L.x,S.y+=L.y,S.z+=L.z}),S.x/=T.length,S.y/=T.length,S.z/=T.length,Ne.editPointID.move=v.entities.add({name:"_move_point",position:S,point:{color:Cesium.Color.PURPLE,pixelSize:10,outlineColor:Cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let I=0;I<T.length-1;I++){let P=Cesium.Cartesian3.midpoint(T[I],T[I+1],new Cesium.Cartesian3),D=v.entities.add({name:"_add_point",position:P,point:{pixelSize:10,color:Cesium.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Cesium.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.add.push(D.id)}}}}}}}}function y(A){SmartEarthPopupData.editGraphic.fillColor=w("rgb("+A.red*255+","+A.green*255+","+A.blue*255+")"),SmartEarthPopupData.editGraphic.alpha=A.alpha*100}function x(A){SmartEarthPopupData.editGraphic.outlineColor=w("rgb("+A.red*255+","+A.green*255+","+A.blue*255+")"),SmartEarthPopupData.editGraphic.outlineAlpha=A.alpha*100}function C(A){SmartEarthPopupData.editGraphic.backgroundColor=w("rgb("+A.red*255+","+A.green*255+","+A.blue*255+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=A.alpha*100}function w(A){let E=A,T=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(E)){let S=E.replace(/(rgb|RGB)*/g,"");S=S.replace("(","").replace(")","");let M=S.split(","),I="#";for(let P=0;P<M.length;P++){let D=Number(M[P]).toString(16);D=D.length===1?0+""+D:D,D==="0"&&(D+=D),I+=D}return I.length!==7&&(I=E),I}else if(T.test(E)){let S=E.replace(/#/,"").split("");if(S.length===6)return E;if(S.length===3){let M="#";for(let I=0;I<S.length;I+=1)M+=S[I]+S[I];return M}}else return E}};var Ah=ap;function SP(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this._Provider=void 0,this._cache=!1,this._forceRefreshPrvimitive=null}SP.prototype.createBillboardPointGeoJsonFeatureLayer=function(o,f,m,v,y){f==null&&console.log("geojson is required");var x=this._cesium.GeoJsonDataSource.load(f),C=this;x.then(function(E){var T={show:!0,position:C._cesium.Cartesian3.ZERO,pixelOffset:C._cesium.Cartesian2.ZERO,eyeOffset:C._cesium.Cartesian3.ZERO,heightReference:C._cesium.HeightReference.NONE,horizontalOrigin:C._cesium.HorizontalOrigin.CENTER,verticalOrigin:C._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:C._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:C._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};!C._core.isnull(m)&&!C._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.charAt(0)=="["&&m.color.charAt(m.color.length-1)=="]"||(C._core.isHtmlColor(m.color)?m.color=C._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=C._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=C._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))));var S=C._core.extend(T,m,!0);C._core.isnull(m.near)&&(m.near=0),C._core.isnull(m.far)&&(m.far=999999999);for(var M=parseFloat(m.near),I=parseFloat(m.far),P=new C._cesium.DistanceDisplayCondition(M,I),D=new C._cesium.BillboardCollection,L=E.entities.values,R=0;R<L.length;R++){var O=L[R];S.position=O.position._value,D.add(S)}var F=C._viewer.scene.primitives.add(D);typeof y=="function"&&y(F)});var w=this._core.getuid();this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w);var A={id:w,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"billboardLayer",item:this,url:f,style:options};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(v)?0:v),this};SP.prototype.createBillboardGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=new Ah(this._viewer,this._cesium,C);this._Provider=w;var A=this;w._loadTile=function(T){var S={show:!0,position:A._cesium.Cartesian3.ZERO,pixelOffset:A._cesium.Cartesian2.ZERO,eyeOffset:A._cesium.Cartesian3.ZERO,heightReference:A._cesium.HeightReference.NONE,horizontalOrigin:A._cesium.HorizontalOrigin.CENTER,verticalOrigin:A._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:A._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:A._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};!A._core.isnull(m)&&!A._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.charAt(0)=="["&&m.color.charAt(m.color.length-1)=="]"||(A._core.isHtmlColor(m.color)?m.color=A._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=A._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=A._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))));var M=A._core.extend(S,m,!0);A._core.isnull(m.near)&&(m.near=0),A._core.isnull(m.far)&&(m.far=999999999);var I=parseFloat(m.near),P=parseFloat(m.far),D=new A._cesium.DistanceDisplayCondition(I,P),L=new A._cesium.BillboardCollection;return T.features.forEach(function(R){M.id=R;var O;if(/^\[/.test(M.pointHeight)&&/\]$/.test(M.pointHeight)){var F=M.pointHeight.replace(/\[/,"").replace(/\]/,"");O=parseFloat(R.properties[F]),R.geometry.coordinates.push(O),M.position=A._cesium.Cartesian3.fromDegreesArrayHeights(R.geometry.coordinates)[0]}else M.pointHeight?(O=parseFloat(M.pointHeight),R.geometry.coordinates.push(O),M.position=A._cesium.Cartesian3.fromDegreesArrayHeights(R.geometry.coordinates)[0]):M.position=A._cesium.Cartesian3.fromDegreesArray(R.geometry.coordinates)[0];M.id.treeID=m.id,M.id.VectorType="billboard",M.id.VectorStyle={position:M.position,pointHeight:O,rotation:M.rotation,width:M.width,height:M.height,image:M.image,color:M.color,scale:M.scale,heightReference:M.heightReference,horizontalOrigin:M.horizontalOrigin,verticalOrigin:M.verticalOrigin,scaleByDistance:M.scaleByDistance,distanceDisplayCondition:M.distanceDisplayCondition},L.add(M)}),L},m&&m.time&&(w.availability=new A._cesium.TimeIntervalCollection([new A._cesium.TimeInterval({start:m.time.start?A._cesium.JulianDate.fromDate(new Date(m.time.start)):A._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?A._cesium.JulianDate.fromDate(new Date(m.time.end)):A._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=w._primitiveCollection,w.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"imageLayer",item:this,url:C.url,style:m};return this._Provider.treeID=m.id,this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};SP.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};SP.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(o)}catch{}};SP.prototype.setVisibility=function(o){this.item.show=o,this._Provider&&this._Provider.setStatus(!o),!o&&this.item.removeAll()};SP.prototype.deleteObject=function(){if(this._Provider!=null&&this._Provider.setStatus(!1),this.items!=null&&this.items!=null&&this.items.length>0)for(var o=0;o<this.items.length;o++)this._viewer.scene.primitives.remove(this.items[o]);else this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch{}};SP.prototype.setTreeobj=function(o){this.treeobj=o};SP.prototype.edit=function(o,f){return this.isEditting=o,this.editoption=f,this._Provider&&this._Provider.edit&&this._Provider.edit(o,f)};SP.prototype.forceRefresh=function(){try{for(var o=0;o<this._Provider.quadtree._levelZeroTiles.length;o++)this._Provider.quadtree._levelZeroTiles[o].freeResources()}catch{}};var nJ=SP;var po=null;function Hu(o,f){po=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._getPosition=new Ru(this._viewer,this._cesium),this._tree=Ne,this._popupmessage=new wb(this._viewer,this._cesium),this._bufferAnalysis=new yP(this._viewer,this._cesium),this.Legend=[],this.tooltip=this._core.CreateTooltip(),this.enty=null}Hu.prototype.createGeojsonFeatureLayer=function(o,f,m,v,y,x){var C=f.url,w=f.maxLevel,A=f.minLevel,E=this._core.StyleContrastGeoJson(m,this._cesium);C==null&&console.log("geojson is required");var T=null;C.then?T=C:T=this._cesium.GeoJsonDataSource.load(C),this._viewer.dataSources.add(T);var S=this;!this.setNearAndFar&&w&&A&&(this.setNearAndFar=!0,this.Level=0,this._viewer.scene.preRender.addEventListener(function(){S.isShow&&S.item&&(S.Level=S.getLevel(),S.Level>=A&&S.Level<=w&&!S.item.show?S.item.show=!0:(S.Level<A||S.Level>w)&&(S.item.show=!1))})),T.then(function(I){S.item=I;for(var P=I.entities.values,D=0;D<P.length;D++){var L=P[D];if(E.point!=null){var R=E.point;R.color=S._color.VectorColorTransformation(R.color,L),R.outlineColor=S._color.VectorColorTransformation(R.outlineColor,L),R.pointHeight!=null&&(L.position._value=S._core.setheight(L.position._value,R.pointHeight,S._cesium,S._viewer),delete R.pointHeight),L.point=new S._cesium.PointGraphics(R)}if(E.label!=null){var O=E.label;O.fillColor=S._color.VectorColorTransformation(O.fillColor,L),O.outlineColor=S._color.VectorColorTransformation(O.outlineColor,L),O.pointHeight!=null&&(L.position._value=S._core.setheight(L.position._value,O.pointHeight,S._cesium,S._viewer),delete O.pointHeight),L.label=new S._cesium.LabelGraphics(O)}if(E.billboard!=null){var F=E.billboard;F.color=S._color.VectorColorTransformation(F.color,L),F.pointHeight!=null&&(L.position._value=S._core.setheight(L.position._value,F.pointHeight,S._cesium,S._viewer),delete F.pointHeight),L.billboard=new S._cesium.BillboardGraphics(F)}if(E.polyline!=null){var k=E.polyline;k.material=S._color.VectorColorTransformation(k.material,L),k.positions=L.polyline.positions,k.pointHeight!=null&&(L.position._value=S._core.setpolylineheight(L.position._value,k.pointHeight,S._cesium,S._viewer),delete k.pointHeight),L.polyline=new S._cesium.PolylineGraphics(k)}if(E.polygon!=null){var U=E.polygon;U.hierarchy=L.polygon.hierarchy,U.material=S._color.VectorColorTransformation(U.material,L),U.outlineColor=S._color.VectorColorTransformation(U.outlineColor,L),U.outlineColor&&(U.outline=!0),L.polygon=new S._cesium.PolygonGraphics(U)}}typeof x=="function"&&x(I)}),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),y?S.isShow=!0:S.setVisibility(!1);var M={id:E.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"datasource",item:this,url:C,style:E,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),this};Hu.prototype.createGeojsonKmlFeatureLayer=function(o,f,m,v,y){var x=f,C={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas};this._viewer.dataSources.add(this._cesium.KmlDataSource.load(f,C));var w=this;this._core.isnull(C.id)&&(C.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+C.id),v||w.setVisibility(!1);var A={id:C.id,name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"datasource",item:this,url:x,style:C,treeData:{name:o,geoOptions:f,styleOption:"",GroupID:m,checked:v,disFnc:y}};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(m)?0:m),this};Hu.prototype.createGeoJsonFeatureLayerAlawys=function(o,f,m,v,y){var x={id:this._core.getuid(),layertype:"",text:"",font:"16px",fillColor:this._cesium.WHITE,outlineColor:this._cesium.BLACK,outlineWidth:"1.0",scale:"1.0",maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,icon:""};!this._core.isnull(m)&&!this._core.isnull(m.fillColor)&&(m.fillColor.toString().charAt(0)=="["&&m.fillColor.toString().charAt(m.fillColor.length-1)=="]"||(this._core.isHtmlColor(m.fillColor)?m.fillColor=this._color.colorFromHtmlColor(m.fillColor):m.fillColor=this._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)));var C=this._core.extend(x,m,!0);f==null&&console.log("geojson is required");var w=null;f.then?w=f:w=this._cesium.GeoJsonDataSource.load(f),this._viewer.dataSources.add(w);var A=this,E;m&&m.time&&(E=new A._cesium.TimeIntervalCollection([new A._cesium.TimeInterval({start:m.time.start?A._cesium.JulianDate.fromDate(new Date(m.time.start)):A._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?A._cesium.JulianDate.fromDate(new Date(m.time.end)):A._cesium.Iso8601.MAXIMUM_VALUE})])),w.then(function(S){A.item=S;for(var M=S.entities.values,I=0;I<M.length;I++){var P=M[I];C.id=A._core.extendgl(P,m.id,C.id),C.text=A._core.extendgl(P,m.text,C.text),C.font=A._core.extendgl(P,m.font,C.font),C.fillColor=A._core.extendgl(P,m.fillColor,C.fillColor),C.outlineColor=A._core.extendgl(P,m.outlineColor,C.outlineColor),C.outlineWidth=parseInt(A._core.extendgl(P,m.outlineWidth,C.outlineWidth)),C.scale=parseFloat(A._core.extendgl(P,m.scale,C.scale)),C.image=A._core.extendgl(P,m.image,C.image),C.icon=A._core.extendgl(P,m.icon,C.icon);var D=parseFloat(A._core.extendgl(P,C.minDistanceDisplay||C.near)),L=parseFloat(A._core.extendgl(P,C.maxDistanceDisplay||C.far)),R=new A._cesium.DistanceDisplayCondition(D,L);if(P.billboard){if(C)if((A._core.isUrl(P.properties[C.icon])||A._core.isUrl(C.icon))&&!A._core.isnull(P.properties[C.text])||!A._core.isnull(C.text)){var O="fillColor:"+C.fillColor.red*255+","+C.fillColor.green*255+","+C.fillColor.blue*255+";outlineColor:"+C.outlineColor.red*255+","+C.outlineColor.green*255+","+C.outlineColor.blue*255;A.Legend.push(O),P.label={id:"my label",text:A._core.isnull(P.properties[C.text])?C.text:P.properties[C.text]+"",font:C.font+" sans-serif",fillColor:C.fillColor,outlineColor:C.outlineColor,outlineWidth:C.outlineWidth,scale:parseFloat(C.scale),distanceDisplayCondition:R},P.billboard={image:A._core.isUrl(P.properties[C.icon])?P.properties[C.icon]:C.icon,distanceDisplayCondition:R}}else if(!A._core.isnull(C.icon))P.billboard={image:A._core.isUrl(P.properties[C.icon])?P.properties[C.icon]:C.icon,distanceDisplayCondition:R};else if(!A._core.isnull(P.properties[C.text])||!A._core.isnull(C.text)){P.billboard=void 0;var O="fillColor:"+C.fillColor.red*255+","+C.fillColor.green*255+","+C.fillColor.blue*255+";outlineColor:"+C.outlineColor.red*255+","+C.outlineColor.green*255+","+C.outlineColor.blue*255;A.Legend.push(O),P.label={id:"my label",text:A._core.isnull(P.properties[C.text])?C.text:P.properties[C.text]+"",font:C.font+" sans-serif",fillColor:C.fillColor,outlineColor:C.outlineColor,outlineWidth:C.outlineWidth,scale:parseFloat(C.scale),distanceDisplayCondition:R}}else{var O="color:"+C.fillColor.red*255+","+C.fillColor.green*255+","+C.fillColor.blue*255;A.Legend.push(O),P.billboard=void 0,P.point=new A._cesium.PointGraphics({color:A._cesium.Color.RED,pixelSize:10,distanceDisplayCondition:R})}else P.polygon?P.polygon.distanceDisplayCondition=R:P.polyline&&(P.polyline.distanceDisplayCondition=R);E&&(P.availability=E)}}typeof y=="function"&&y(S)}),this._core.isnull(C.id)&&(C.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+C.id);var T={id:C.id,name:o,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f,style:C,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:!0,disFnc:y}};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};Hu.prototype.createGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=this._cesium.GeoJsonDataSource.load(f),w=this;return C.then(function(A){var E=A.entities.values[0];/^point.fid/.test(E._id)||E.point!=null?w.createPointGeojsonFeatureLayer(o,C,m,v,y,x):/^polygon.fid/.test(E._id)||E.polygon!=null?w.createPolygonGeoJsonFeatureLayer(o,C,m,v,y,x):/^line.fid/.test(E._id)||E.polyline!=null?w.createPolylineGeoJsonFeatureLayer(o,C,m,v,y,x):w.createGeoJsonFeatureLayerAlawys(o,C,m,v,x)}),this};Hu.prototype.createPointGeojsonFeatureLayer=function(o,f,m,v,y=!0,x){var C={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),height:0,pointHeight:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};!this._core.isnull(m)&&!this._core.isnull(m.color)&&(m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))));var w=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var A=null;f.then?A=f:A=this._cesium.GeoJsonDataSource.load(f),this._viewer.dataSources.add(A);var E=this,T;m&&m.time&&(T=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:m.time.start?this._cesium.JulianDate.fromDate(new Date(m.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?this._cesium.JulianDate.fromDate(new Date(m.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),A.then(function(M){E.item=M;for(var I=M.entities.values,P=0;P<I.length;P++){var D=I[P];w.color=E._core.extendgl(D,m.color,w.color),w.pixelSize=parseInt(E._core.extendgl(D,m.pixelSize,w.pixelSize)),w.outlineColor=E._core.extendgl(D,m.outlineColor,w.outlineColor),w.outlineWidth=parseFloat(E._core.extendgl(D,m.outlineWidth,w.outlineWidth)),w.show=E._core.extendgl(D,m.show,w.show),w.height=parseFloat(E._core.extendgl(D,m.height,w.height)),w.scaleByDistance=E._core.extendgl(D,m.scaleByDistance,w.scaleByDistance);var L=parseFloat(E._core.extendgl(D,w.minDistanceDisplay||w.near)),R=parseFloat(E._core.extendgl(D,w.maxDistanceDisplay||w.far)),O=new E._cesium.DistanceDisplayCondition(L,R),F="color:"+w.color.red*255+","+w.color.green*255+","+w.color.blue*255+";outlineColor:"+w.outlineColor.red*255+","+w.outlineColor.green*255+","+w.outlineColor.blue*255;E.Legend.push(F),w.distanceDisplayCondition=O,w.pointHeight=E._core.extendgl(D,m.pointHeight,w.pointHeight),w.pointHeight=parseFloat(w.pointHeight);var k=E._viewer.scene.globe.ellipsoid,U=E._cesium.Cartographic.fromCartesian(D.position._value),G=E._cesium.Math.toDegrees(U.longitude),j=E._cesium.Math.toDegrees(U.latitude),q=w.pointHeight||U.height,J=new E._cesium.Cartesian3.fromDegrees(G,j,q);D.position._value=J,D.point=new E._cesium.PointGraphics(w),D.billboard=void 0;var X={positions:J};D.description=X,T&&(D.availability=T)}y||E.setVisibility(!1),typeof x=="function"&&x(M)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w.id);var S={id:w.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f,style:w,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),this};Hu.prototype.createModelGeojsonFeatureLayer=function(o,f,m={},v,y,x){var C={color:m.color||"#ffffff",url:window.SmartEarthRootUrl+pn.testModel,scale:1,minimumPixelSize:0,height:0,far:5e3,near:0,type:"default"};f==null&&console.log("geojson is required");var w=null;f.then?w=f:w=this._cesium.GeoJsonDataSource.load(f);var A;m&&m.time&&(A=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:m.time.start?this._cesium.JulianDate.fromDate(new Date(m.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?this._cesium.JulianDate.fromDate(new Date(m.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.option=m,this.option.color=typeof C.color=="string"?po.Color.fromCssColorString(C.color):C.colorF,this.loadGeosjonData=()=>{m=this.option;let T=this.dataSourceItem.entities.values,S=this._core.extend(C,m,!0),M=parseFloat(S.near),I=parseFloat(S.far),P=new po.DistanceDisplayCondition(M,I);this.item.removeAll();let D=new Map,L,R,O,F=[];for(let k=0,U;k<T.length;k++)if(U=T[k],S.type==="polylineVolume"){let G=this._core.extendgl(U,"[flieName]");G="/"+G.replace("xpl2","gltf"),D.get(S.url+G)||D.set(S.url+G,[]),O=D.get(S.url+G);let j=new po.Cartesian3(this._core.extendgl(U,"[scaleY]",1),this._core.extendgl(U,"[scaleX]",1),this._core.extendgl(U,"[scaleZ]",1)),q=new po.HeadingPitchRoll(po.Math.toRadians(this._core.extendgl(U,"[Yaw]",0)),po.Math.toRadians(this._core.extendgl(U,"[Pitch]",0)),po.Math.toRadians(this._core.extendgl(U,"[Roll]",0))),J=po.Matrix3.fromHeadingPitchRoll(q),X=this._core.toDegrees(U.position.getValue());X.height=this._core.extendgl(U,"[Altitude]",0),R=new po.Cartesian3.fromDegrees(X.lon,X.lat,X.height),F.push(R),L=po.Transforms.eastNorthUpToFixedFrame(R),po.Matrix4.multiplyByMatrix3(L,J,L),po.Matrix4.multiplyByScale(L,j,L),po.ModelInstanceCollection?O.push({modelMatrix:L,modelId:this._core.getEntityProp(U)}):this.item.add(po.Model.fromGltf({id:this._core.getEntityProp(U),url:S.url+G,modelMatrix:L,color:S.color,distanceDisplayCondition:P}))}else{if(D.get(S.url)||(D.set(S.url,[]),O=D.get(S.url)),S.height!==void 0||S.pointHeight!==void 0){let q=this._core.toDegrees(U.position.getValue());q.height=S.height||S.pointHeight,R=new po.Cartesian3.fromDegrees(q.lon,q.lat,q.height),U.position=R}R=U.position.getValue(),F.push(R),L=po.Transforms.eastNorthUpToFixedFrame(R);let G=new po.HeadingPitchRoll(po.Math.toRadians(this._core.extendgl(U,S.heading,0)),po.Math.toRadians(this._core.extendgl(U,S.pitch,0)),po.Math.toRadians(this._core.extendgl(U,S.roll,0))),j=po.Matrix3.fromHeadingPitchRoll(G);po.Matrix4.multiplyByMatrix3(L,j,L),typeof S.scale=="object"?po.Matrix4.multiplyByScale(L,S.scale,L):po.Matrix4.multiplyByUniformScale(L,S.scale,L),po.ModelInstanceCollection?O.push({modelMatrix:L,modelId:this._core.getEntityProp(U)}):this.item.add(po.Model.fromGltf({id:this._core.getEntityProp(U),url:S.url,modelMatrix:L,color:S.color,distanceDisplayCondition:P}))}this.item.boundingSphere=po.BoundingSphere.fromPoints(F),po.ModelInstanceCollection&&D.forEach((k,U)=>{this.item.add(new po.ModelInstanceCollection({url:U,instances:k,color:S.color}))})},this.item=new po.PrimitiveCollection,this._viewer.scene.primitives.add(this.item),w.then(T=>{this.dataSourceItem=T,this.loadGeosjonData(),y||this.setVisibility(!1),typeof x=="function"&&x(T)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id);var E={id:m.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};Hu.prototype.createCirclePointGeoJsonFeatureLayer=function(o,f,m,v,y){var x={semiMajorAxis:1,semiMinorAxis:1,height:0,heightReference:this._cesium.HeightReference.NONE,extrudedHeight:0,extrudedHeightReference:this._cesium.HeightReference.NONE,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||m.material.toString().charAt(0)=="("&&m.material.toString().charAt(m.material.length-1)==")"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.radius)&&(x.semiMajorAxis=m.radius,x.semiMinorAxis=m.radius),A._core.isnull(m.near)&&(m.near=0),A._core.isnull(m.far)&&(m.far=999999999);var C=this._core.extend(x,m,!0);f==null&&console.log("geojson is required");var w=this._cesium.GeoJsonDataSource.load(f);this._viewer.dataSources.add(w);var A=this;w.then(function(T){A.item=T;for(var S=T.entities.values,M=0;M<S.length;M++){var I=S[M];C.semiMajorAxis=parseFloat(A._core.extendgl(I,m.semiMajorAxis,C.semiMajorAxis)),C.semiMinorAxis=parseFloat(A._core.extendgl(I,m.semiMinorAxis,C.semiMinorAxis)),C.height=parseFloat(A._core.extendgl(I,m.height,C.height)),C.heightReference=A._core.extendgl(I,m.heightReference,C.heightReference),C.extrudedHeight=parseFloat(A._core.extendgl(I,m.extrudedHeight,C.extrudedHeight)),C.extrudedHeightReference=A._core.extendgl(I,m.extrudedHeightReference,C.extrudedHeightReference),C.show=A._core.extendgl(I,m.show,C.show),C.fill=A._core.extendgl(I,m.fill,C.fill),C.material=A._core.extendgl(I,m.material,C.material),C.outline=A._core.extendgl(I,m.outline,C.outline),C.outlineColor=A._core.extendgl(I,m.outlineColor,C.outlineColor),C.outlineWidth=parseFloat(A._core.extendgl(I,m.outlineWidth,C.outlineWidth)),C.scaleByDistance=A._core.extendgl(I,m.scaleByDistance,C.scaleByDistance);var P="material:"+C.material.red*255+","+C.material.green*255+","+C.material.blue*255+";outlineColor:"+C.outlineColor.red*255+","+C.outlineColor.green*255+","+C.outlineColor.blue*255;A.Legend.push(P);var D=parseFloat(A._core.extendgl(I,C.near)),L=parseFloat(A._core.extendgl(I,C.far)),R=new A._cesium.DistanceDisplayCondition(D,L);C.distanceDisplayCondition=R,I.billboard=void 0,I.ellipse=new A._cesium.EllipseGraphics(C)}typeof y=="function"&&y(T)}),this._core.isnull(C.id)&&(C.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+C.id);var E={id:C.id,name:o,pId:this._core.isnull(v)?0:v,type:"layer",item:this,url:f,style:C,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:!0,disFnc:y}};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};Hu.prototype.createModelPointGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={uri:"",show:!0,scale:1,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,lightColor:void 0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),color:this._cesium.Color.WHITE,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},w=this;!this._core.isnull(m)&&!this._core.isnull(m.color)&&(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))),w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var A=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var E=this._cesium.GeoJsonDataSource.load(f);this._viewer.dataSources.add(E);var T;m&&m.time&&(T=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:m.time.start?w._cesium.JulianDate.fromDate(new Date(m.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?w._cesium.JulianDate.fromDate(new Date(m.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})])),E.then(function(M){w.item=M;for(var I=M.entities.values,P=0;P<I.length;P++){var D=I[P];A.uri=w._core.extendgl(D,m.uri,A.uri),A.scale=parseFloat(w._core.extendgl(D,m.scale,A.scale)),A.incrementallyLoadTextures=w._core.extendgl(D,m.incrementallyLoadTextures,A.incrementallyLoadTextures),A.runAnimations=w._core.extendgl(D,m.runAnimations,A.runAnimations),A.clampAnimations=w._core.extendgl(D,m.clampAnimations,A.clampAnimations),A.shadows=w._core.extendgl(D,m.shadows,A.shadows),A.heightReference=w._core.extendgl(D,m.heightReference,A.heightReference),A.lightColor=w._core.extendgl(D,m.lightColor,A.lightColor),A.scaleByDistance=w._core.extendgl(D,m.scaleByDistance,A.scaleByDistance),A.color=w._core.extendgl(D,m.color,A.color),A.height?A.height=parseFloat(w._core.extendgl(D,m.height,A.height)):A.height=void 0;var L=parseFloat(w._core.extendgl(D,m.near,A.near)),R=parseFloat(w._core.extendgl(D,m.far,A.far)),O="color:"+A.color.red*255+","+A.color.green*255+","+A.color.blue*255;w.Legend.push(O);var F=new w._cesium.DistanceDisplayCondition(L,R);if(A.distanceDisplayCondition=F,D.billboard=void 0,D.model=new w._cesium.ModelGraphics(A),A.height){var k=w._cesium.Cartographic.fromCartesian(D.position._value),U=w._cesium.Math.toDegrees(k.longitude),G=w._cesium.Math.toDegrees(k.latitude);D.position=w._cesium.Cartesian3.fromDegrees(U,G,A.height)}T&&(D.availability=T)}typeof x=="function"&&x(M),y||w.setVisibility(!1)}),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id);var S={id:A.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"modelLayer",item:this,url:f,style:A,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:!0,disFnc:x}};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),this};Hu.prototype.createLabelPointGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={Name:"",text:"test",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),pointHeight:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,addHeight:0},E=this;!this._core.isnull(m)&&!this._core.isnull(m.fillColor)&&(this._core.isHtmlColor(m.fillColor)?m.fillColor=this._color.colorFromHtmlColor(m.fillColor):(/^rgb/.test(m.fillColor)&&(m.fillColor=this._color.rgbaStringToRgbaObj(m.fillColor)),m.fillColor.r>1&&(m.fillColor.r=m.fillColor.r/255),m.fillColor.g>1&&(m.fillColor.g=m.fillColor.g/255),m.fillColor.b>1&&(m.fillColor.b=m.fillColor.b/255),m.fillColor.a>1&&(m.fillColor.a=m.fillColor.a/255),m.fillColor=this._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.color)&&(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.backgroundColor)&&(this._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=this._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=this._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=this._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))),E._core.isnull(m.near)&&(m.near=0),E._core.isnull(m.far)&&(m.far=999999999);var w;m&&m.time&&(w=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:m.time.start?this._cesium.JulianDate.fromDate(new Date(m.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?this._cesium.JulianDate.fromDate(new Date(m.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),f==null&&console.log("geojson is required");var A=this._cesium.GeoJsonDataSource.load(f);this._viewer.dataSources.add(A);var E=this;this.option=m,this.loadGeosjonData=()=>{m=this.option;let S=this.item.entities.values,M=this._core.extend(C,m,!0);E._core.isnull(M.font_size)&&(M.font_size="30px"),E._core.isnull(M.font_family)&&(M.font_family=" sans-serif"),M.font_size.toString().indexOf("px")==-1?M.font=M.font_size+"px "+M.font_family:M.font=M.font_size+" "+M.font_family,M.bold&&(M.font="bold "+M.font),M.italic&&(M.font="italic "+M.font),E.Legend=[];for(let I=0;I<S.length;I++){let P=S[I];M.font=E._core.extendgl(P,m.font,M.font),M.style=parseInt(E._core.extendgl(P,M.style,M.style)),M.fillColor=E._core.extendgl(P,m.fillColor,M.fillColor),M.outlineColor=E._core.extendgl(P,m.outlineColor,M.outlineColor),M.outlineWidth=parseFloat(E._core.extendgl(P,m.outlineWidth,M.outlineWidth)),M.show=E._core.extendgl(P,m.show,M.show),M.showBackground=E._core.extendgl(P,m.showBackground,M.showBackground),M.backgroundColor=E._core.extendgl(P,m.backgroundColor,M.backgroundColor),M.backgroundPadding=E._core.extendgl(P,m.backgroundPadding,M.backgroundPadding),M.scale=parseFloat(E._core.extendgl(P,m.scale,M.scale)),M.horizontalOrigin=E._core.extendgl(P,m.horizontalOrigin,M.horizontalOrigin),M.pointHeight=parseFloat(E._core.extendgl(P,m.pointHeight,M.pointHeight)),M.text=E._core.extendgl(P,m.text,M.text).toString();let D=parseFloat(E._core.extendgl(P,M.near)),L=parseFloat(E._core.extendgl(P,M.far)),R=new E._cesium.DistanceDisplayCondition(D,L);if(M.distanceDisplayCondition=R,M.image!=null&&M.image!=null&&M.image.length>0?(P.billboard={image:M.image},P.billboard.scale=M.scale,P.billboard.color=M.color,P.billboard.verticalOrigin=M.verticalOrigin,P.billboard.horizontalOrigin=M.horizontalOrigin,P.billboard.disableDepthTestDistance=M.disableDepthTestDistance,P.billboard.heightReference=M.heightReference,P.billboard.distanceDisplayCondition=M.distanceDisplayCondition):P.billboard=void 0,M.layertype=="ellipsoidlayer"){P.name=o;let k={show:!0,radii:new E._cesium.Cartesian3(M.long_axis,M.short_axis,M.long_axis),material:E._cesium.Color.fromRandom({alpha:1})};P.ellipsoid=new E._cesium.EllipsoidGraphics(k),P.ellipsoid.heightReference=M.heightReference,P.ellipsoid.material=url}let O={Name:M.Name,text:M.text,font:M.font,style:M.stylet,...M},F="fillColor:"+M.fillColor.red*255+","+M.fillColor.green*255+","+M.fillColor.blue*255+";outlineColor:"+M.outlineColor.red*255+","+M.outlineColor.green*255+","+M.outlineColor.blue*255;if(E.Legend.push(F),P.label=new E._cesium.LabelGraphics(O),w&&(P.availability=w),M.pointHeight||M.addHeight){let k=E._cesium.Cartographic.fromCartesian(P.position._value),U=E._cesium.Math.toDegrees(k.longitude),G=E._cesium.Math.toDegrees(k.latitude),j=(M.pointHeight||k.height)+M.addHeight,q=new po.Cartesian3.fromDegrees(U,G,j);P.position._value=q}P.label&&(M.labelData&&Object.assign(P.label,M.labelData),(M.offsetX||M.offsetY)&&(P.label.pixelOffset=new po.Cartesian2(M.offsetX||0,M.offsetY||0))),P.billboard&&M.imageData&&Object.assign(P.billboard,M.imageData)}},A.then(function(S){E.item=S,E.loadGeosjonData(),y||E.setVisibility(!1),typeof x=="function"&&x(S)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u8857\u666F"+m.id);var T={id:m.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"labelPointLayer",item:this,url:f,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};Hu.prototype.createStreetscapeGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:this._cesium.Color.RED,height:30,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},w=this;!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||m.material.toString().charAt(0)=="("&&m.material.toString().charAt(m.material.length-1)==")"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)),m.arcType=="1"||m.arcType==1?m.material=new po.PolylineDashMaterialProperty({color:m.material}):m.material=m.material)),w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var A=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var E=null;f.then?E=f:E=this._cesium.GeoJsonDataSource.load(f),this._viewer.dataSources.add(E,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas,clampToGround:!0});var T;m&&m.time&&(T=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:m.time.start?this._cesium.JulianDate.fromDate(new Date(m.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?this._cesium.JulianDate.fromDate(new Date(m.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),E.then(function(M){w.item=M;for(var I=M.entities.values,P=0;P<I.length;P++){var D=I[P];A.arcType=w._core.extendgl(D,m.arcType,A.arcType),A.clampToGround=w._core.extendgl(D,m.clampToGround,A.clampToGround),A.width=parseFloat(w._core.extendgl(D,m.width,A.width)),A.show=w._core.extendgl(D,m.show,A.show),A.material=w._core.extendgl(D,m.material,A.material),A.height=parseFloat(w._core.extendgl(D,m.height,A.height));var L=parseFloat(w._core.extendgl(D,A.near)),R=parseFloat(w._core.extendgl(D,A.far)),O=new w._cesium.DistanceDisplayCondition(L,R);A.distanceDisplayCondition=O,D.polyline.arcType=!0,A.heightReference==0?D.polyline.arcType=0:D.polyline.arcType=1,D.polyline.clampToGround=A.clampToGround,D.polyline.width=A.width,D.polyline.height=A.height,D.polyline.show=A.show,D.polyline.material=A.material,D.polyline.distanceDisplayCondition=O;var F=[],k,U,G;D.polyline.positions._value.forEach(function(q){A.height?(k=w._cesium.Cartographic.fromCartesian(q),U=w._cesium.Math.toDegrees(k.longitude),G=w._cesium.Math.toDegrees(k.latitude),F.push(w._cesium.Cartesian3.fromDegrees(U,G,A.height))):F.push(q)}),D.polyline.positions=F,T&&(D.availability=T);var j="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;w.Legend.push(j)}y||w.setVisibility(!1),typeof x=="function"&&x(M)}),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u8857\u666F"+A.id);var S={id:A.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"Streetscape",item:this,url:f,style:A,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),this};Hu.prototype.createEllipsoidlayerPointGeoJsonFeatureLayer=function(o,f,m,v,y){var x={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};!this._core.isnull(m)&&!this._core.isnull(m.fillColor)&&(m.fillColor.toString().charAt(0)=="["&&m.fillColor.toString().charAt(m.fillColor.length-1)=="]"||m.material.toString().charAt(0)=="("&&m.material.toString().charAt(m.material.length-1)==")"||(this._core.isHtmlColor(m.fillColor)?m.fillColor=this._color.colorFromHtmlColor(m.fillColor):(/^rgb/.test(m.fillColor)&&(m.fillColor=this._color.rgbaStringToRgbaObj(m.fillColor)),m.fillColor.r>1&&(m.fillColor.r=m.fillColor.r/255),m.fillColor.g>1&&(m.fillColor.g=m.fillColor.g/255),m.fillColor.b>1&&(m.fillColor.b=m.fillColor.b/255),m.fillColor.a>1&&(m.fillColor.a=m.fillColor.a/255),m.fillColor=this._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),!this._core.isnull(m)&&!this._core.isnull(m.backgroundColor)&&(m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(this._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=this._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=this._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=this._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a)))),A._core.isnull(m.near)&&(m.near=0),A._core.isnull(m.far)&&(m.far=999999999);var C=this._core.extend(x,m,!0);f==null&&console.log("geojson is required");var w=this._cesium.GeoJsonDataSource.load(f);this._viewer.dataSources.add(w);var A=this;w.then(function(T){A.item=T;var S=T.entities.values;A._core.isnull(m.font_size)&&(m.font_size="30px"),A._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),C.font=m.font_size+"px "+m.font_family;for(var M=0;M<S.length;M++){C.text=A._core.extendgl(entity,m.text,C.text),C.font=A._core.extendgl(entity,m.font,C.font),C.stylet=A._core.extendgl(entity,m.stylet,C.stylet),C.fillColor=A._core.extendgl(entity,m.fillColor,C.fillColor),C.outlineColor=A._core.extendgl(entity,m.outlineColor,C.outlineColor),C.outlineWidth=parseFloat(A._core.extendgl(entity,m.outlineWidth,C.outlineWidth)),C.show=A._core.extendgl(entity,m.show,C.show),C.showBackground=A._core.extendgl(entity,m.showBackground,C.showBackground),C.backgroundColor=A._core.extendgl(entity,m.backgroundColor,C.backgroundColor),C.backgroundPadding=A._core.extendgl(entity,m.backgroundPadding,C.backgroundPadding),C.scale=parseFloat(A._core.extendgl(entity,m.scale,C.scale)),C.horizontalOrigin=A._core.extendgl(entity,m.horizontalOrigin,C.horizontalOrigin),C.pointheight=parseFloat(A._core.extendgl(entity,m.pointheight,C.pointheight));var I=parseFloat(A._core.extendgl(entity,C.near)),P=parseFloat(A._core.extendgl(entity,C.far)),D="fillColor:"+C.fillColor.red*255+","+C.fillColor.green*255+","+C.fillColor.blue*255+";outlineColor:"+C.outlineColor.red*255+","+C.outlineColor.green*255+","+C.outlineColor.blue*255;A.Legend.push(D);var L=new A._cesium.DistanceDisplayCondition(I,P);if(C.distanceDisplayCondition=L,entity.ellipsoid.radii=new _this._cesium.Cartesian3(m.long_axis,m.short_axis,m.short_axis),entity.label=new A._cesium.LabelGraphics(C),entity.label.text=entity.properties[m.text]==null?m.text:entity.properties[m.text]._value,C.pointheight){var R=A._cesium.Cartographic.fromCartesian(entity.position._value),O=A._cesium.Math.toDegrees(R.longitude),F=A._cesium.Math.toDegrees(R.latitude);entity.position=A._cesium.Cartesian3.fromDegrees(O,F,C.pointheight)}}typeof y=="function"&&y(T)}),this._core.isnull(C.id)&&(C.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+C.id);var E={id:C.id,name:o,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f,style:C,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:!0,disFnc:y}};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};Hu.prototype.createBillboardGeoJsonFeature=function(o,f,m,v,y,x){var C={image:"",show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:2,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};!this._core.isnull(m)&&!this._core.isnull(m.color)&&(m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))));var w=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var A=this._cesium.GeoJsonDataSource.load(f);this._viewer.dataSources.add(A);var E=this;E._core.isnull(m.near)&&(m.near=0),E._core.isnull(m.far)&&(m.far=999999999);var T;m&&m.time&&(T=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:m.time.start?this._cesium.JulianDate.fromDate(new Date(m.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?this._cesium.JulianDate.fromDate(new Date(m.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),A.then(function(M){E.item=M;for(var I=M.entities.values,P=0;P<I.length;P++){var D=I[P];w.image=E._core.extendgl(D,m.image,w.image),w.show=E._core.extendgl(D,m.show,w.show),w.scale=parseFloat(E._core.extendgl(D,m.scale,w.scale)),w.horizontalOrigin=E._core.extendgl(D,m.horizontalOrigin,w.horizontalOrigin),w.verticalOrigin=E._core.extendgl(D,m.verticalOrigin,w.verticalOrigin),w.eyeOffset=E._core.extendgl(D,m.eyeOffset,w.eyeOffset),w.pixelOffset=E._core.extendgl(D,m.pixelOffset,w.pixelOffset),w.alignedAxis=E._core.extendgl(D,m.alignedAxis,w.alignedAxis),w.rotation=E._core.extendgl(D,m.rotation,w.rotation),w.width?w.width=parseFloat(E._core.extendgl(D,m.width,w.width)):w.width=void 0,w.height?w.height=parseFloat(E._core.extendgl(D,m.height,w.height)):w.height=void 0,w.color=E._core.extendgl(D,m.color,w.color);var L="color:"+w.color.red*255+","+w.color.green*255+","+w.color.blue*255+";image:"+w.image;E.Legend.push(L);var R=parseFloat(E._core.extendgl(D,w.near)),O=parseFloat(E._core.extendgl(D,w.far)),F=new E._cesium.DistanceDisplayCondition(R,O);w.distanceDisplayCondition=F,D.billboard=void 0,D.billboard=new E._cesium.BillboardGraphics(w);var k=E._viewer.scene.globe.ellipsoid,U=E._cesium.Cartographic.fromCartesian(D.position._value),G=E._cesium.Math.toDegrees(U.longitude),j=E._cesium.Math.toDegrees(U.latitude);if(m.pointHeight)var q=m.pointHeight;else var q=U.height;var J=new E._cesium.Cartesian3.fromDegrees(G,j,q);D.position._value=J;var X={positions:J};D.description=X,T&&(D.availability=T)}y||E.setVisibility(!1),typeof x=="function"&&x(M)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w.id);var S={id:w.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"imageLayer",item:this,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),this};Hu.prototype.createPolylineGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!0,width:1,show:!0,material:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.WHITE,gapColor:po.Color.TRANSPARENT,height:void 0,dashLength:16,outlineWidth:0,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},w=this;!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||m.material.toString().charAt(0)=="("&&m.material.toString().charAt(m.material.length-1)==")"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||m.outlineColor.toString().charAt(0)=="("&&m.outlineColor.toString().charAt(m.outlineColor.length-1)==")"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),m.gapColor&&typeof m.gapColor=="string"&&(m.gapColor=po.Color.fromCssColorString(m.gapColor)),w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999),f==null&&console.log("geojson is required");var A=null;f.then?A=f:A=this._cesium.GeoJsonDataSource.load(f),this._viewer.dataSources.add(A,{camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas,clampToGround:!0});var E;m&&m.time&&(E=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:m.time.start?w._cesium.JulianDate.fromDate(new Date(m.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?w._cesium.JulianDate.fromDate(new Date(m.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})])),this.option=m,this.loadGeosjonData=()=>{m=this.option;let S=this.item.entities.values,M=this._core.extend(C,m,!0);w.Legend=[];for(let I=0;I<S.length;I++){let P=S[I];M.arcType=w._core.extendgl(P,m.arcType,M.arcType),M.clampToGround=w._core.extendgl(P,m.clampToGround,M.clampToGround),M.width=parseFloat(w._core.extendgl(P,m.width,M.width)),M.show=w._core.extendgl(P,m.show,M.show),M.material=w._core.extendgl(P,m.material,M.material),M.height=parseFloat(w._core.extendgl(P,m.height,M.height));let D=parseFloat(w._core.extendgl(P,M.near)),L=parseFloat(w._core.extendgl(P,M.far)),R=new w._cesium.DistanceDisplayCondition(D,L);if(M.distanceDisplayCondition=R,M.height!==void 0){let k=P.polyline.positions.getValue();P.polyline.positions=w._core.setpolylineheight(k,M.height)}P.polyline.clampToGround=M.clampToGround,P.polyline.width=M.width,P.polyline.show=M.show,P.polyline.distanceDisplayCondition=R,P.polyline.classificationType=M.classificationType;let O;M.dash?O=new po.PolylineDashMaterialProperty({color:M.material,gapColor:M.gapColor,dashLength:m.dashLength}):O=new po.PolylineOutlineMaterialProperty({color:M.material,outlineColor:M.outlineColor,outlineWidth:m.outlineWidth}),P.polyline.material=O,E&&(P.availability=E);let F="material:"+M.material.red*255+","+M.material.green*255+","+M.material.blue*255;w.Legend.push(F)}},A.then(function(S){w.item=S,w.loadGeosjonData(),y||w.setVisibility(!1),typeof x=="function"&&x(S)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id);var T={id:m.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineLayer",item:this,url:f,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};Hu.prototype.createpolylineVolumeGeojsonFeatureLayer=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,radius:.5,radiusScale:1};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||m.material.toString().charAt(0)=="("&&m.material.toString().charAt(m.material.length-1)==")"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var w=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var A=null;f.then?A=f:A=this._cesium.GeoJsonDataSource.load(f),this._viewer.dataSources.add(A);var E=this;w.shape=this.computeCircle(m.radius);var T;m&&m.time&&(T=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})])),A.then(function(M){E.item=M;var I=M.entities.values;E._core.isnull(m.near)&&(m.near=0),E._core.isnull(m.far)&&(m.far=999999999);var P=parseFloat(m.near),D=parseFloat(m.far),L=new E._cesium.DistanceDisplayCondition(P,D);w.distanceDisplayCondition=L;var R=null;if(typeof w.radius=="string"&&w.radius.indexOf("[")>-1&&w.radius.indexOf("]")>-1){let Y;if(w.radius=w.radius.replace("[",""),w.radius=w.radius.replace("]",""),I[0]&&I[0].properties[w.radius])if(Y=I[0].properties[w.radius].getValue(),Y.indexOf&&(Y.indexOf("*")>-1||Y.indexOf("x")>-1||Y.indexOf("X")>-1)){Y.indexOf("*")>-1?Y=Y.split("*"):Y.indexOf("X")>-1?Y=Y.split("X"):Y.indexOf("x")>-1&&(Y=Y.split("x"));var O=parseFloat(Y[0])*w.radiusScale,F=parseFloat(Y[1])*w.radiusScale;w.shape=[new E._cesium.Cartesian2(-O,-F),new E._cesium.Cartesian2(O,-F),new E._cesium.Cartesian2(O,F),new E._cesium.Cartesian2(-O,F)]}else w.shape=E._core.computeCircle(Y*w.radiusScale);else w.shape=E._core.computeCircle(.5)}else if(w.slttype=="0"||w.slttype==0)w.shape=E._core.computeCircle(w.radius);else if(w.slttype=="1"||w.slttype==1)w.shape=E._core.starPositions(w.number,w.exradius,w.inradius);else if(w.slttype=="2"||w.slttype==2){var O=w.orth_width/2,F=w.orth_height/2;w.shape=[new E._cesium.Cartesian2(-O,-F),new E._cesium.Cartesian2(O,-F),new E._cesium.Cartesian2(O,F),new E._cesium.Cartesian2(-O,F)]}for(var k=0;k<I.length;k++){var U=I[k];w.show=E._core.extendgl(U,m.show,w.show),w.shape=E._core.extendgl(U,m.shape,w.shape),w.cornerType=E._core.extendgl(U,m.cornerType,w.cornerType),w.granularity=E._core.extendgl(U,m.granularity,w.granularity),w.fill=E._core.extendgl(U,m.fill,w.fill),w.material=E._core.extendgl(U,m.material,w.material),w.outline=E._core.extendgl(U,m.outline,w.outline),w.outlineColor=E._core.extendgl(U,m.outlineColor,w.outlineColor),w.outlineWidth=parseFloat(E._core.extendgl(U,m.outlineWidth,w.outlineWidth)),w.shadows=E._core.extendgl(U,m.shadows,w.shadows);var G=[],j,q,J;U.polyline.positions._value.forEach(function(Y){w.height?(j=E._cesium.Cartographic.fromCartesian(Y),q=E._cesium.Math.toDegrees(j.longitude),J=E._cesium.Math.toDegrees(j.latitude),G.push(E._cesium.Cartesian3.fromDegrees(q,J,w.height))):G.push(Y)}),U.polylineVolume=new E._cesium.PolylineVolumeGraphics({positions:G,show:w.show,shape:w.shape,cornerType:w.cornerType,fill:w.fill,outline:w.outline,outlineWidth:w.outlineWidth,material:w.material,distanceDisplayCondition:L});var X="material:"+w.material.red*255+","+w.material.green*255+","+w.material.blue*255;E.Legend.push(X),U.polyline=void 0,T&&(U.availability=T)}y||E.setVisibility(!1),typeof x=="function"&&x(M)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u7BA1\u72B6\u56FE\u5C42"+w.id);var S={id:w.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:f,style:w,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),this};Hu.prototype.createpolylineVolumeGeojsonPrimitiveLayer=function(o,f,m,v,y,x){let C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,radius:.5,height:0,radiusScale:1};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||m.material.toString().charAt(0)=="("&&m.material.toString().charAt(m.material.length-1)==")"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),f==null&&console.log("geojson is required");let w=null;f.then?w=f:w=this._cesium.GeoJsonDataSource.load(f);let A=this;var E;m&&m.time&&(E=new A._cesium.TimeIntervalCollection([new A._cesium.TimeInterval({start:m.time.start?A._cesium.JulianDate.fromDate(new Date(m.time.start)):A._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?A._cesium.JulianDate.fromDate(new Date(m.time.end)):A._cesium.Iso8601.MAXIMUM_VALUE})]));let T=new po.PrimitiveCollection,S={allowPicking:!0,appearance:new A._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:A._core.Shaders("vertexShaderSource"),fragmentShaderSource:A._core.Shaders("fragmentShaderSource")}),shadows:m.shadows,geometryInstances:void 0};this.option=m;let M={};function I(O){return M[O]||(M[O]=A._core.computeCircle(O)),M[O]}function P(O,F){if(typeof F.radius=="string"&&F.radius.indexOf("[")>-1&&F.radius.indexOf("]")>-1){let G=A._core.getEntityPropValue(O,F.radius);if(G)if(G.indexOf&&(G.indexOf("*")>-1||G.indexOf("x")>-1||G.indexOf("X")>-1)){G.indexOf("*")>-1?G=G.split("*"):G.indexOf("X")>-1?G=G.split("X"):G.indexOf("x")>-1&&(G=G.split("x"));let j=parseFloat(G[0])*F.radiusScale,q=parseFloat(G[1])*F.radiusScale;M[j+"*"+q]||(M[j+"*"+q]=[new A._cesium.Cartesian2(-j,-q),new A._cesium.Cartesian2(j,-q),new A._cesium.Cartesian2(j,q),new A._cesium.Cartesian2(-j,q)]),F.shape=M[j+"*"+q],F.radius=q}else F.radius=G*F.radiusScale,F.shape=I(F.radius),F.connect&&(F.connectRadius=G*F.radiusScale*1.1,F.connectRadius2=G*F.radiusScale*1.2,F.connectShape1=I(F.connectRadius),F.connectShape2=I(F.connectRadius2));else F.shape=I(.5),F.radius=.5,F.connect&&(F.connectRadius=F.radius*1.1,F.connectRadius2=F.radius*1.2,F.connectShape1=I(F.connectRadius),F.connectShape2=I(F.connectRadius2))}else if(F.slttype=="0"||F.slttype==0)F.shape=I(F.radius),F.connect&&(F.connectRadius=F.radius*1.1,F.connectRadius2=F.radius*1.2,F.connectShape1=I(F.connectRadius),F.connectShape2=I(F.connectRadius2));else if(F.slttype=="1"||F.slttype==1)F.shape=A._core.starPositions(F.number,F.exradius,F.inradius);else if(F.slttype=="2"||F.slttype==2){var k=F.orth_width/2,U=F.orth_height/2;F.shape=[new A._cesium.Cartesian2(-k,-U),new A._cesium.Cartesian2(k,-U),new A._cesium.Cartesian2(k,U),new A._cesium.Cartesian2(-k,U)],F.radius=U}}this.loadGeosjonData=()=>{m=this.option,A._core.isnull(m.near)&&(m.near=0),A._core.isnull(m.far)&&(m.far=999999999),m.near=parseFloat(m.near),m.far=parseFloat(m.far),T.removeAll();let O=this.dataSourceItem.entities.values;A.Legend=[];for(let F=0,k,U;F<O.length;F++)U=O[F],k=this._core.extend(C,m,!0),P(U,k),k.show=A._core.extendgl(U,m.show,k.show),k.shape=A._core.extendgl(U,m.shape,k.shape),k.cornerType=A._core.extendgl(U,m.cornerType,k.cornerType),k.granularity=A._core.extendgl(U,m.granularity,k.granularity),k.fill=A._core.extendgl(U,m.fill,k.fill),k.material=A._core.extendgl(U,m.material,k.material),k.outline=A._core.extendgl(U,m.outline,k.outline),k.outlineColor=A._core.extendgl(U,m.outlineColor,k.outlineColor),k.outlineWidth=parseFloat(A._core.extendgl(U,m.outlineWidth,k.outlineWidth)),k.shadows=A._core.extendgl(U,m.shadows,k.shadows),typeof k.material=="string"&&(k.material=po.Color.fromCssColorString(k.material)),L(U,k);A._viewer.scene.primitives.add(T)},A.item=T,w.then(function(O){A.dataSourceItem=O,A.loadGeosjonData(),y||A.setVisibility(!1),typeof x=="function"&&x(T)});async function D(O,F,k){let U=[],G=A._core.getPointFromTwoPointCenter([F[0],F[1]],k.connectRadius*2),j=A._core.getPointFromTwoPointCenter([F[0],F[1]],k.connectRadius2*2),q=A._core.getPointFromTwoPointCenter([F[F.length-1],F[F.length-2]],k.connectRadius*2),J=A._core.getPointFromTwoPointCenter([F[F.length-1],F[F.length-2]],k.connectRadius2*2);F[0].equals(F[1])&&F[2]&&(G=A._core.getPointFromTwoPointCenter([F[0],F[2]],k.connectRadius*2),j=A._core.getPointFromTwoPointCenter([F[0],F[2]],k.connectRadius2*2)),F[F.length-1].equals(F[F.length-2])&&F[F.length-3]&&(q=A._core.getPointFromTwoPointCenter([F[F.length-1],F[F.length-3]],k.connectRadius*2),J=A._core.getPointFromTwoPointCenter([F[F.length-1],F[F.length-3]],k.connectRadius2*2));let X=[],Y=new po.EllipsoidGeometry({vertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0},stackPartitions:16,slicePartitions:16,radii:new po.Cartesian3(k.connectRadius,k.connectRadius,k.connectRadius)}),Q;if(G&&j){if(!F[0].equals(G)){let z=[];Q=A._core.toDegrees(F[0]),Q.height-=k.radius*.1,z.push(A._core.fromDegrees(Q)),Q=A._core.toDegrees(G),Q.height-=k.radius*.1,z.push(A._core.fromDegrees(Q));let ie=new A._cesium.PolylineVolumeGeometry({polylinePositions:z,shapePositions:k.connectShape1,cornerType:k.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});U.push(ie)}if(!G.equals(j)){let z=[];Q=A._core.toDegrees(G),Q.height-=k.radius*.2,z.push(A._core.fromDegrees(Q)),Q=A._core.toDegrees(j),Q.height-=k.radius*.2,z.push(A._core.fromDegrees(Q));let ie=new A._cesium.PolylineVolumeGeometry({polylinePositions:z,shapePositions:k.connectShape2,cornerType:k.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});U.push(ie)}let ee=new po.GeometryInstance({geometry:Y,modelMatrix:po.Matrix4.multiplyByTranslation(po.Transforms.eastNorthUpToFixedFrame(F[0]),new po.Cartesian3(0,0,k.radius),new po.Matrix4),attributes:{color:po.ColorGeometryInstanceAttribute.fromColor(k.material),distanceDisplayCondition:new po.DistanceDisplayConditionGeometryInstanceAttribute(k.near,k.far)}});X.push(ee)}if(q&&J){if(!F[F.length-1].equals(q)){let ee=[];Q=A._core.toDegrees(F[F.length-1]),Q.height-=k.radius*.1,ee.push(A._core.fromDegrees(Q)),Q=A._core.toDegrees(q),Q.height-=k.radius*.1,ee.push(A._core.fromDegrees(Q));let z=new A._cesium.PolylineVolumeGeometry({polylinePositions:ee,shapePositions:k.connectShape1,cornerType:k.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});U.push(z);let ie=new po.GeometryInstance({geometry:Y,modelMatrix:po.Matrix4.multiplyByTranslation(po.Transforms.eastNorthUpToFixedFrame(F[F.length-1]),new po.Cartesian3(0,0,k.radius),new po.Matrix4),attributes:{color:po.ColorGeometryInstanceAttribute.fromColor(k.material),distanceDisplayCondition:new po.DistanceDisplayConditionGeometryInstanceAttribute(k.near,k.far)}});X.push(ie)}if(!J.equals(q)){let ee=[];Q=A._core.toDegrees(q),Q.height-=k.radius*.2,ee.push(A._core.fromDegrees(Q)),Q=A._core.toDegrees(J),Q.height-=k.radius*.2,ee.push(A._core.fromDegrees(Q));let z=new A._cesium.PolylineVolumeGeometry({polylinePositions:ee,shapePositions:k.connectShape2,cornerType:k.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}});U.push(z)}}U.forEach(ee=>{let z=new A._cesium.GeometryInstance({id:A._core.getEntityProp(O),geometry:ee,attributes:{color:new A._cesium.ColorGeometryInstanceAttribute.fromColor(k.material),distanceDisplayCondition:new po.DistanceDisplayConditionGeometryInstanceAttribute(k.near,k.far)}});X.push(z)}),S.geometryInstances=X,T.add(new po.Primitive(S))}async function L(O,F){let k=O.polyline&&O.polyline.positions.getValue();if(!k||k.length<2)return;let U;F.height=A._core.defaultValue(m.height,-2),F.height.start&&F.height.end?F.height={start:A._core.getEntityPropValue(O,m.height.start)||-2,end:A._core.getEntityPropValue(O,m.height.end)||-2}:(typeof F.height=="string"&&F.height.includes("[")&&F.height.includes("]")&&(F.height=A._core.getEntityPropValue(O,m.height)||-2),F.height={start:F.height,end:F.height}),F.height._height=(F.height.end-F.height.start)/(k.length-1),k.forEach(function(X,Y){U=po.Cartographic.fromCartesian(X),U.height=F.height.start+F.height._height*Y-F.radius,po.Cartesian3.clone(po.Cartographic.toCartesian(U),X)});let G={polylinePositions:k,shapePositions:F.shape,cornerType:F.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},j=new po.PolylineVolumeGeometry(G),q=new po.GeometryInstance({id:A._core.getEntityProp(O),geometry:j,attributes:{color:new po.ColorGeometryInstanceAttribute.fromColor(F.material),distanceDisplayCondition:new po.DistanceDisplayConditionGeometryInstanceAttribute(F.near,F.far)}});S.geometryInstances=q,T.add(new po.Primitive(S)),console.log(F.material.toCssColorString()),F.connect&&F.shape.length>10&&D(O,k,F);let J="material:"+F.material.red*255+","+F.material.green*255+","+F.material.blue*255;A.Legend.push(J)}this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u7BA1\u72B6\u56FE\u5C42"+m.id);var R={id:m.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:f,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(R),this._tree.insertGroupId(R,this._core.isnull(v)?0:v),this};Hu.prototype.computeCircle=function(o){this._core.isnull(o)&&(o=4);for(var f=[],m=0;m<360;m++){var v=po.Math.toRadians(m);f.push(new this._cesium.Cartesian2(o*Math.cos(v),o*Math.sin(v)))}return f};Hu.prototype.createWallGeoFeatureLayer=function(o,f,m,v,y,x){var C={positions:[],minimumHeights:[],maximumHeights:[],granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))));var w=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var A=null;f.then?A=f:A=this._cesium.GeoJsonDataSource.load(f),this._viewer.dataSources.add(A);var E=this,T;m&&m.time&&(T=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})])),A.then(function(M){E.item=M;var I=M.entities.values;E._core.isnull(m.near)&&(m.near=0),E._core.isnull(m.far)&&(m.far=999999999);var P=parseFloat(m.near),D=parseFloat(m.far),L=new E._cesium.DistanceDisplayCondition(P,D);w.distanceDisplayCondition=L;for(var R=0;R<I.length;R++){var O=I[R];w.granularity=E._core.extendgl(O,m.granularity,w.granularity),w.fill=E._core.extendgl(O,m.fill,w.fill),w.material=E._core.extendgl(O,m.material,w.material),w.outline=E._core.extendgl(O,m.outline,w.outline),w.outlineColor=E._core.extendgl(O,m.outlineColor,w.outlineColor),w.outlineWidth=parseFloat(E._core.extendgl(O,m.outlineWidth,w.outlineWidth)),w.shadows=E._core.extendgl(O,m.shadows,w.shadows);var F=O.polyline.positions._value.length,k=new Array(F),U=new Array(F);k.fill(w.minimumHeights),U.fill(w.maximumHeights),O.wall=new E._cesium.WallGraphics({positions:O.polyline.positions._value,maximumHeights:U,minimumHeights:k,outline:w.outline,fill:w.fill,material:w.material,outlineColor:w.outlineColor,outlineWidth:w.outlineWidth,shadows:w.shadows,distanceDisplayCondition:L});var G="material:"+w.material.red*255+","+w.material.green*255+","+w.material.blue*255+";outlineColor:"+w.outlineColor.red*255+","+w.outlineColor.green*255+","+w.outlineColor.blue*255;E.Legend.push(G),O.polyline=void 0,T&&(O.availability=T)}y||E.setVisibility(!1),typeof x=="function"&&x(M)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u5899\u56FE\u5C42"+w.id);var S={id:w.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineWallLayer",item:this,url:f,style:w,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),this};Hu.prototype.createterrainProvider=function(o,f,m,v){var y={url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},x=this._core.extend(y,f,!0),C=new this._cesium.CesiumTerrainProvider(x);return this._viewer.terrainProvider=C,this.item=C,typeof v=="function"&&v(dataSource),this._core.isnull(x.id)&&(x.id=this._core.getuid()),this._tree.insertGroupId({id:x.id,name:o,pId:this._core.isnull(m)?0:m,type:"terrainProvider",item:this},this._core.isnull(m)?0:m),this};Hu.prototype.createPolygonGeoJsonFeatureLayers=function(o,f,m,v,y,x){var C={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.NONE,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||m.material.toString().charAt(0)=="("&&m.material.toString().charAt(m.material.length-1)==")"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),m.checked=y;var w=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var A=null;f.then?A=f:A=this._cesium.GeoJsonDataSource.load(f),this._viewer.dataSources.add(A);var E=this;A.then(function(S){E.item=S;var M=S.entities.values;E._core.isnull(m.near)&&(m.near=0),E._core.isnull(m.far)&&(m.far=999999999);var I=parseFloat(m.near),P=parseFloat(m.far),D=new E._cesium.DistanceDisplayCondition(I,P);w.distanceDisplayCondition=D;for(var L=0;L<M.length;L++){var R=M[L];w.height=parseFloat(E._core.extendgl(R,m.height,w.height)),w.extrudedHeight=parseFloat(E._core.extendgl(R,m.extrudedHeight,w.extrudedHeight)),w.heightReference=E._core.extendgl(R,m.heightReference,w.heightReference),w.show=E._core.extendgl(R,m.show,w.show),w.fill=E._core.extendgl(R,m.fill,w.fill),w.material=E._core.extendgl(R,m.material,w.material),w.outline=E._core.extendgl(R,m.outline,w.outline),w.outlineColor=E._core.extendgl(R,m.outlineColor,w.outlineColor),w.outlineWidth=parseFloat(E._core.extendgl(R,m.outlineWidth,w.outlineWidth)),w.stRotation=parseInt(E._core.extendgl(R,m.stRotation,w.stRotation)),w.granularity=E._core.extendgl(R,m.granularity,w.granularity),w.shadows=E._core.extendgl(R,m.shadows,w.shadows),R.polygon.height=w.height,R.polygon.extrudedHeight=w.extrudedHeight,R.polygon.heightReference=w.heightReference,R.polygon.show=w.show,R.polygon.fill=w.fill,R.polygon.material=w.material,R.polygon.outline=w.outline,R.polygon.outlineColor=w.outlineColor,R.polygon.outlineWidth=w.outlineWidth,R.polygon.stRotation=w.stRotation,R.polygon.granularity=w.granularity,R.polygon.distanceDisplayCondition=D,R.polygon.perPositionHeight=w.perPositionHeight,R.polygon.closeTop=w.closeTop,R.polygon.closeBottom=w.closeBottom,R.polygon.shadows=w.shadows;var O="material:"+w.material.red*255+","+w.material.green*255+","+w.material.blue*255+";outlineColor:"+w.outlineColor.red*255+","+w.outlineColor.green*255+","+w.outlineColor.blue*255;E.Legend.push(O)}typeof x=="function"&&x(S),m.checked||E.setVisibility(!1)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w.id);var T={id:w.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f,style:w,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};Hu.prototype.createPrimitivePolygon=async function(o,f){let m,v=f.clampToGround?po.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT:po.VertexFormat.POSITION_AND_NORMAL;o==="bulidingWall"?m=new po.CorridorGeometry({positions:f.positions,width:f.bulidingWallWidth||.8,height:f.height,extrudedHeight:f.extrudedHeight,vertexFormat:v,cornerType:po.CornerType.MITERED}):m=new po.PolygonGeometry({polygonHierarchy:new po.PolygonHierarchy(f.positions,f.holes),height:f.height,extrudedHeight:f.extrudedHeight,vertexFormat:v,perPositionHeight:!1});let y=new po.GeometryInstance({id:f.prop,geometry:m,attributes:{color:new po.ColorGeometryInstanceAttribute.fromColor(f.material),distanceDisplayCondition:new po.DistanceDisplayConditionGeometryInstanceAttribute(f.near,f.far)}});if(o==="mask")this.primitivePolygon=new po.GroundPrimitive({geometryInstances:y,appearance:new po.PerInstanceColorAppearance({translucent:f.material.alpha<1}),classificationType:f.classificationType}),this._viewer.scene.primitives.add(this.primitivePolygon);else{this.primitivePolygon||(this.primitivePolygon=new po.PrimitiveCollection,this._viewer.scene.primitives.add(this.primitivePolygon));let x=f.clampToGround?po.GroundPrimitive:po.Primitive,C=new x({geometryInstances:y,appearance:new po.PerInstanceColorAppearance({translucent:f.material.alpha<1}),classificationType:f.classificationType});this.primitivePolygon.add(C)}};Hu.prototype.createPolygonGeoJsonFeatureLayer=function(o,f,m={},v,y,x){var C={height:0,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0,classificationType:this._cesium.ClassificationType.BOTH,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,disableDepthTestDistance:1/0,near:0,mask:!1};m.material&&typeof m.material=="string"&&m.material.indexOf("[")===-1&&(m.material=po.Color.fromCssColorString(m.material)),m.fillColor&&typeof m.fillColor=="string"&&m.fillColor.indexOf("[")===-1&&(m.fillColor=po.Color.fromCssColorString(m.fillColor)),m.outlineColor&&typeof m.outlineColor=="string"&&m.outlineColor.indexOf("[")===-1&&(m.outlineColor=po.Color.fromCssColorString(m.outlineColor)),m.labelOutlineColor&&typeof m.labelOutlineColor=="string"&&m.labelOutlineColor.indexOf("[")===-1&&(m.labelOutlineColor=po.Color.fromCssColorString(m.labelOutlineColor)),m.checked=y;var w={clampToGround:!0};f==null&&console.log("geojson is required");var A=null;let E=async I=>{try{let P={type:"FeatureCollection",features:[]},D=I.map(R=>fetch(R).then(O=>O.json())),L=await Promise.all(D);for(let R=0;R<L.length;R++)for(let O=0;O<L[R].features.length;O++)P.features.push(L[R].features[O]);return A=this._cesium.GeoJsonDataSource.load(P,w),A}catch(P){throw console.error("\u53D1\u751F\u9519\u8BEF\uFF1A",P),P}};var T=this,S;f.then?A=f:f instanceof Array?E(f).then(()=>{A.then(function(I){T.item=I,T.loadGeosjonData(),m.checked?T.isShow=!0:T.setVisibility(!1),typeof x=="function"&&x(I)}),this._viewer.dataSources.add(A)}):(A=this._cesium.GeoJsonDataSource.load(f,w),console.log(this._cesium.GeoJsonDataSource.load(f,w)),this._viewer.dataSources.add(A)),m&&m.time&&(S=new T._cesium.TimeIntervalCollection([new T._cesium.TimeInterval({start:m.time.start?T._cesium.JulianDate.fromDate(new Date(m.time.start)):T._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?T._cesium.JulianDate.fromDate(new Date(m.time.end)):T._cesium.Iso8601.MAXIMUM_VALUE})])),this.option=m,this.loadGeosjonData=()=>{m=this.option;let I=this.item.entities.values,P=this._core.extend(C,m,!0);T._core.isnull(m.near)&&(m.near=0),T._core.isnull(m.far)&&(m.far=999999999);let D=parseFloat(m.near),L=parseFloat(m.far),R=new T._cesium.DistanceDisplayCondition(D,L);P.distanceDisplayCondition=R,P.text&&(!P.font_family&&(P.font_family="\u5FAE\u8F6F\u96C5\u9ED1"),!P.font_size&&(P.font_size="18px"),P.font=P.font_size+" "+P.font_family,P.bold&&(P.font="bold "+P.font),P.italic&&(P.font="italic "+P.font),P.labelNearFar=new po.DistanceDisplayCondition(P.labelNear||D,P.labelFar||L)),T.Legend=[];let O=[];T.primitivePolygon&&T._viewer.scene.primitives.remove(T.primitivePolygon),T.primitivePolygon=null;for(let F=0;F<I.length;F++){let k=I[F];if(P.height=parseFloat(T._core.extendgl(k,m.height,P.height)),P.extrudedHeight=T._core.extendgl(k,m.extrudedHeight,P.extrudedHeight),P.extrudedHeight=P.height+P.extrudedHeight,P.heightReference=T._core.extendgl(k,m.heightReference,P.heightReference),P.show=T._core.extendgl(k,m.show,P.show),P.fill=T._core.extendgl(k,m.fill,P.fill),P.material=T._core.extendgl(k,m.material,P.material),P.extrudedHeight!==void 0&&(P.extrudedHeight=parseFloat(P.extrudedHeight)),P.outline=T._core.extendgl(k,m.outline,P.outline),P.outlineColor=T._core.extendgl(k,m.outlineColor,P.outlineColor),P.outlineWidth=parseFloat(T._core.extendgl(k,m.outlineWidth,P.outlineWidth)),P.stRotation=T._core.extendgl(k,m.stRotation,P.stRotation),P.granularity=T._core.extendgl(k,m.granularity,P.granularity),P.distanceDisplayCondition=T._core.extendgl(k,m.distanceDisplayCondition,P.distanceDisplayCondition),P.perPositionHeight=T._core.extendgl(k,m.perPositionHeight,P.perPositionHeight),P.closeTop=T._core.extendgl(k,m.closeTop,P.closeTop),P.closeBottom=T._core.extendgl(k,m.closeBottom,P.closeBottom),P.shadows=T._core.extendgl(k,m.shadows,P.shadows),P.classificationType=T._core.extendgl(k,m.classificationType,P.classificationType),P.text=T._core.extendgl(k,m.text,P.text),P.clampToGround&&P.mask)k.polygon.show=!1,O.push(k.polygon.hierarchy.getValue()),F===I.length-1&&T.createPrimitivePolygon("mask",{positions:po.Cartesian3.fromDegreesArray([30,0,30,80,179,80,179,0]),holes:O,...P});else if(k.polygon.defaultHierarchy&&(k.polygon.hierarchy=k.polygon.defaultHierarchy),k.polygon.show=!0,k.polygon.extrudedHeightReference=P.extrudedHeightReference,k.polygon.heightReference=P.heightReference,P.heightReference!=1&&(k.polygon.height=P.height,P.height&&(k.polygon.perPositionHeight=!1)),P.extrudedHeightReference!=1&&(k.polygon.extrudedHeight=P.extrudedHeight),P.clampToGround&&(k.polygon.height=void 0,k.polygon.heightReference=1,k.polygon.extrudedHeight=void 0,k.polygon.perPositionHeight=!1),k.polygon.show=P.show,k.polygon.fill=P.fill,k.polygon.material=P.material,k.polygon.outline=P.outline,k.polygon.outlineColor=P.outlineColor,k.polygon.outlineWidth=P.outlineWidth,k.polygon.stRotation=P.stRotation,k.polygon.granularity=P.granularity,k.polygon.distanceDisplayCondition=R,k.polygon.closeTop=P.closeTop,k.polygon.closeBottom=P.closeBottom,k.polygon.shadows=P.shadows,k.polygon.classificationType=P.classificationType,P.bulidingWall){k.polygon.show=!1;let G=k.polygon.hierarchy.getValue().positions;T.createPrimitivePolygon("bulidingWall",{positions:G,...P}),F===I.length-1?(T.item.boundingSphere=po.BoundingSphere.fromPoints(T.item.boundingPointsArr),T.item.boundingPointsArr=null):(!T.item.boundingPointsArr&&(T.item.boundingPointsArr=[]),T.item.boundingPointsArr.push(G[0]))}if(P.clampToGround&&P.outline?k.polyline={positions:k.polygon.hierarchy.getValue().positions,material:P.outlineColor,width:P.outlineWidth,classificationType:P.classificationType,clampToGround:!0,distanceDisplayCondition:R,zIndex:1}:k.polyline=void 0,P.text){let G=T._core.getCenterOfMass(k.polygon.hierarchy.getValue().positions);k.position=po.Cartesian3.fromDegrees(G[0],G[1],G[2]),P.pointHeight!==void 0&&(k.position=po.Cartesian3.fromDegrees(G[0],G[1],P.pointHeight)),k.label={text:P.text,font:P.font,style:po.LabelStyle.FILL_AND_OUTLINE,fillColor:P.fillColor||P.material,outlineColor:P.labelOutlineColor||P.outlineColor,outlineWidth:P.labelOutlineWidth||0,pixelOffset:P.pixelOffset,disableDepthTestDistance:T._core.defaultValue(P.disableDepthTestDistance,1/0),distanceDisplayCondition:P.labelNearFar}}else k.label=void 0;let U="material:"+P.material.red*255+","+P.material.green*255+","+P.material.blue*255+";outlineColor:"+P.outlineColor.red*255+","+P.outlineColor.green*255+","+P.outlineColor.blue*255;T.Legend.push(U),S&&(k.availability=S)}},f instanceof Array||A.then(function(I){T.item=I,T.loadGeosjonData(),m.checked?T.isShow=!0:T.setVisibility(!1),typeof x=="function"&&x(I)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id);var M={id:m.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),this};Hu.prototype.createGeoJsonDataSource=function(o,f,m,v,y){var x=this._cesium.GeoJsonDataSource.load(f,m);this._viewer.dataSources.add(x);var C=this;return x.then(function(w){C.item=w,typeof y=="function"&&y(w)}),this._tree.insertGroupId({id:this._core.getuid(),name:o,pId:this._core.isnull(v)?0:v,type:"layer",item:this},this._core.isnull(v)?0:v),this};Hu.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item),this._viewer.scene.primitives.remove(this.item),this.item=null,this.primitivePolygon&&this._viewer.scene.primitives.remove(this.primitivePolygon),this.primitivePolygon=null};Hu.prototype.getLevel=function(){var o=40487.57,f=7096758e-11,m=91610.74,v=-40467.74,y=this._viewer.camera,x,C;if(y&&y.positionCartographic&&y.positionCartographic.height){var w=this._viewer.scene.globe.getHeight(y.positionCartographic);!w&&(w=0),x=y.positionCartographic.height-w,C=Math.round(v+(o-v)/(1+Math.pow(x/m,f)))}else C=0;return C};Hu.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f},treeData:this.treeobj.treeData}};Hu.prototype.setVisibility=function(o){this.isShow=o,this.item!=null&&(this.item.show=o),this.primitivePolygon&&(this.primitivePolygon.show=o)};Hu.prototype.getVisibility=function(){return this.item.show};Hu.prototype.getProperties=function(){var o=[];if(this.item.entities.values){var f=this.item.entities.values[0];if(f.properties)for(var m=0;m<f.properties.propertyNames.length;m++)o.push({value:"["+f.properties.propertyNames[m]+"]",label:f.properties.propertyNames[m]})}return o};Hu.prototype.getTypes=function(){if(this.item.entities.values){var o=this.item.entities.values[0];if(/^point.fid/.test(o._id)||o.point!=null)return[{label:"\u6587\u672C\u6807\u7B7E",value:"labelLayer"},{label:"\u56FE\u7247\u6807\u7B7E",value:"billboardLayer"},{label:"\u70B9\u6807\u7B7E",value:"pointLayer"},{label:"\u6A21\u578B",value:"modelLayer"},{label:"\u5706",value:"circleLayer"}];if(/^polygon.fid/.test(o._id)||o.polygon!=null)return[{label:"\u9762",value:"polygonLayer"}];if(/^line.fid/.test(o._id)||o.polyline!=null)return[{label:"\u7EBF",value:"polylineLayer"}]}};Hu.prototype.saveDefaultGeosjonData=function(){this.defaultVectorData=this._core.extend({},this.option,!0)};Hu.prototype.restoreGeosjon=function(){this.defaultVectorData&&(this.option=this.defaultVectorData,this.loadGeosjonData()),this.defaultVectorData=void 0};Hu.prototype.updataGeosjon=function(o={}){(o.material||o.color||o.fillColor||o.labelOutlineColor||o.outlineColor||o.backgroundColor||o.gapColor)&&(o.color&&(o.color=po.Color.fromCssColorString(o.color)),o.material&&(o.material=po.Color.fromCssColorString(o.material)),o.fillColor&&(o.fillColor=po.Color.fromCssColorString(o.fillColor)),o.outlineColor&&(o.outlineColor=po.Color.fromCssColorString(o.outlineColor)),o.labelOutlineColor&&(o.labelOutlineColor=po.Color.fromCssColorString(o.labelOutlineColor)),o.backgroundColor&&(o.backgroundColor=po.Color.fromCssColorString(o.backgroundColor)),o.gapColor&&(o.gapColor=po.Color.fromCssColorString(o.gapColor))),this.option=this._core.extend(this.option,o,!0),this.item&&(clearTimeout(this.updataGeojsonTime),this.updataVectorTime=setTimeout(()=>{this.loadGeosjonData()},100))};Hu.prototype.getType=function(){if(this.item.entities.values){var o=this.item.entities.values[0];return o.label!=null&&o.label.show?{label:"\u6587\u672C\u6807\u7B7E",value:"labelLayer"}:o.model!=null&&o.model.show?{label:"\u6A21\u578B",value:"modelLayer"}:o.billboard!=null&&o.billboard.show?{label:"\u56FE\u7247\u6807\u7B7E",value:"billboardLayer"}:o.ellipse!=null&&o.ellipse.show?{label:"\u5706",value:"circleLayer"}:/^polygon.fid/.test(o._id)||o.polygon!=null?{label:"\u9762",value:"polygonLayer"}:/^line.fid/.test(o._id)||o.polyline!=null?{label:"\u7EBF",value:"polylineLayer"}:o.polylineVolume!=null&&o.polylineVolume.show?{label:"\u626B\u63A0\u4F53",value:"polylineVolume"}:o.wall!=null&&o.wall!=null?{label:"\u5899",value:"polylineWall"}:{label:"\u70B9\u6807\u7B7E",value:"pointLayer"}}};Hu.prototype.getLegend=function(){var o=[];return this.Legend!=null&&(o=this._core.unique(this.Legend)),o};Hu.prototype.getFirstDataSourceItem=function(){if(this.item.entities.values){var o=this.item.entities.values[0];return o}};Hu.prototype.setTreeobj=function(o){this.treeobj=o};Hu.prototype.setItem=function(o){this.item=o};Object.defineProperties(Hu.prototype,{labelText:{set:Ji.debounce(function(o){var f=o;if(!this._core.isnull(o)){var m=this.item.entities.values;if(m&&m.length>0)for(var v=0;v<m.length;v++)if(/^\[/.test(o)&&(f=o.replace(/\[/,"").replace(/\]/,""),f=m[v].properties[f]._value),m[v].label){m[v].label.text=f;try{m[v].point.show=!1}catch{}}else{try{m[v].point.show=!1}catch{}m[v].label=new this._cesium.LabelGraphics({text:f,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.style=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.style}},labelFont:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)){var m=f[0].label.font,v=16;if(m&&(m=m._value.trimLeft().trimRight(),v=m.split("px")[0]),f&&f.length>0&&f[0].label)for(var y=0;y<f.length;y++)f[y].label.font=v+"px "+o}}},500)},labelFontSize1:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)){var m=f[0].label.font,v="sans-serif";if(m&&(m=m._value.trimLeft().trimRight(),v=m.split("px")[1]),f&&f.length>0&&f[0].label)for(var y=0;y<f.length;y++)f[y].label.font=o+"px "+v}}},500)},labelFontSize:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.font=o+"px sans-serif"}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return parseFloat(o[0].label.font)}},labelFillColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.fillColor=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.fillColor;return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}}},labelOutlineColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.outlineColor=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},labelOutlineWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].label.outlineWidth=o}},200),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.outlineWidth;return f?f._value:void 0}}},labelBackgroundColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.backgroundColor=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}}},labelBackground:{set:Ji.debounce(function(o){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.showBackground=o},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.background}},labelScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].label.scale=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.scale;return f?f._value:void 0}}},labelHorizontalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.horizontalOrigin=parseInt(o)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.horizontalOrigin;return f?f._value:void 0}}},labelVerticalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.verticalOrigin=parseInt(o)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.verticalOrigin;return f?f._value:void 0}}},labelHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.heightReference=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.heightReference;return f?f._value:void 0}}},labelDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=f[0].label.distanceDisplayCondition?f[0].label.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,parseInt(o)),f[v].label.scaleByDistance=new this._cesium.NearFarScalar(m,1,parseInt(o),0)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.distanceDisplayCondition?o[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},labelDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=f[0].label.distanceDisplayCondition?f[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(o),m),f[v].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(o),1,m,0)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.distanceDisplayCondition?o[0].label.distanceDisplayCondition._value.near:0;return f}}},labelHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},labelShow:{set:Ji.debounce(function(o){var f=this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].label&&o?(f[m].point&&(f[m].point.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o),f[m].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(f[m].label&&(f[m].label.show=o),f[m].point&&(f[m].point.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.show}},pointColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.color=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},pointShow:{set:Ji.debounce(function(o){var f=this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].point&&o?(f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o),f[m].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(f[m].point&&(f[m].point.show=o),f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point)return o[0].point.show}},pointPixelSize:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].point.pixelSize=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.pixelSize;return f?f._value:void 0}}},pointOutlineColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.outlineColor=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},pointOutlineWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].point.outlineWidth=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.outlineWidth;return f?f._value:void 0}}},pointHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.heightReference=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.heightReference;return f?f._value:void 0}}},pointDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=f[0].point.distanceDisplayCondition?f[0].point.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o),f[v].point.scaleByDistance=new this._cesium.NearFarScalar(m,1,o,0)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.distanceDisplayCondition?o[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},pointDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=f[0].point.distanceDisplayCondition?f[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m),f[v].point.scaleByDistance=new this._cesium.NearFarScalar(o,1,m,0)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.distanceDisplayCondition?o[0].point.distanceDisplayCondition._value.near:0;return f}}},pointHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},modelShow:{set:Ji.debounce(function(o){var f=this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)f[m].label&&(f[m].label.show=!o),f[m].point&&(f[m].point.show=!o),f[m].billboard&&(f[m].billboard.show=!o),!f[m].model&&o?f[m].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(f[m].model&&(f[m].model.show=o),f[m].label&&(f[m].label.show=!o),f[m].point&&(f[m].point.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)return o[0].model.show}},modelUri:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0)for(var m=0;m<f.length;m++)if(f[m].model)f[m].model.uri=o;else{if(/^\[/.test(o)){var v=o.split("[");v.length>1?o=v[0]+v[1].replace(/\[/,"").replace(/\]/,""):(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o])}f[m].model=new this._cesium.ModelGraphics({uri:o,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE})}}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.uri;return f?f._value:void 0}}},modelScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){o=parseFloat(o);var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].model.scale=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.scale;return f?f._value:void 0}}},modelShadows:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.shadows=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)return o[0].model.shadows}},modelHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.heightReference=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.heightReference;return f?f._value:void 0}}},modelDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=f[0].model.distanceDisplayCondition?f[0].model.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)var f=o[0].model.distanceDisplayCondition?o[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE}},modelDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=f[0].model.distanceDisplayCondition?f[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.distanceDisplayCondition?o[0].model.distanceDisplayCondition._value.near:0;return f}}},modelColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.color=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},modelLightColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.lightColor=o}},100),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},modelHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},billboardShow:{set:Ji.debounce(function(o){var f=this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].billboard&&o?(f[m].point&&(f[m].point.show=!o),f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(f[m].billboard&&(f[m].billboard.show=o),f[m].point&&(f[m].point.show=!o),f[m].label&&(f[m].label.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.show}},billboardImage:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0)for(var m=0;m<f.length;m++){if(/^\[/.test(o)){var v=o.split("[");v.length>1?o=v[0]+v[1].replace(/\[/,"").replace(/\]/,""):(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o])}f[m].billboard?f[m].billboard.image=o:f[m].billboard=new this._cesium.BillboardGraphics({image:o,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.image;return f?f._value:void 0}}},billboardScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.scale=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.scale;return f?f._value:void 0}}},billboardHorizontalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.horizontalOrigin=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.horizontalOrigin}},billboardVerticalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.verticalOrigin=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.verticalOrigin}},billboardWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.width=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.width;return f?f._value:void 0}}},billboardHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.height=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.height;return f?f._value:void 0}}},billboardColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.color=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},billboardHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].billboard.heightReference=o}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].model){var f=o[0].billboard.heightReference;return f?f._value:void 0}}},billboardDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=f[0].billboard.distanceDisplayCondition?f[0].billboard.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o),f[v].billboard.scaleByDistance=new this._cesium.NearFarScalar(m,1,o,0)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.distanceDisplayCondition?o[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},billboardDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=f[0].billboard.distanceDisplayCondition?f[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m),f[v].billboard.scaleByDistance=new this._cesium.NearFarScalar(o,1,m,0)}},500),get:function(){var o=this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.distanceDisplayCondition?o[0].billboard.distanceDisplayCondition._value.near:0;return f}}},billboardPHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},polylineShow:{set:Ji.debounce(function(o){var f=this.item.entities.values;if(!!/^line.fid/.test(f[0]._id)&&f&&f.length>0&&f[0].polyline)for(var m=0;m<f.length;m++)f[m].polyline&&(f[m].polyline.show=o)},500),get:function(){var o=this.item.entities.values;if(!(!/^line.fid/.test(o[0]._id)&&o[0].polyline==null)&&o&&o.length>0&&o[0].polyline)return o[0].polyline.b}},polylineWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){o=parseFloat(o);var f=this.item.entities.values;if(!(!/^line.fid/.test(f[0]._id)&&f[0].polyline==null)&&f&&f.length>0&&f[0].polyline)for(var m=0;m<f.length;m++)f[m].polyline.width=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^line.fid/.test(o[0]._id)&&o[0].polyline==null)&&o&&o.length>0&&o[0].polyline){var f=o[0].polyline.width;return f?f._value:void 0}}},polylinemMterial:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(!/^line.fid/.test(f[0]._id)&&f[0].polyline==null)&&f&&f.length>0&&f[0].polyline)for(var m=0;m<f.length;m++)f[m].polyline.material=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^line.fid/.test(o[0]._id)&&o[0].polyline==null)&&o&&o.length>0&&o[0].polyline){var f=o[0].polyline.material;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},polylinemArcType:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^line.fid/.test(f[0]._id)&&f[0].polyline==null)&&f&&f.length>0&&f[0].polyline)for(var m=0;m<f.length;m++)f[m].polyline.arcType=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^line.fid/.test(o[0]._id)&&o[0].polyline==null)&&o&&o.length>0&&o[0].polyline){var f=o[0].polyline.arcType;return f?f._value:void 0}}},polylineDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^line.fid/.test(f[0]._id)&&f[0].polyline==null)&&f&&f.length>0&&f[0].polyline)for(var m=f[0].polyline.distanceDisplayCondition?f[0].polyline.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].polyline.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o)}},500),get:function(){var o=this.item.entities.values;if(!(!/^line.fid/.test(o[0]._id)&&o[0].polyline==null)&&o&&o.length>0&&o[0].polyline){var f=o[0].polyline.distanceDisplayCondition?o[0].polyline.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},polylineDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^line.fid/.test(f[0]._id)&&f[0].polyline==null)&&f&&f.length>0&&f[0].polyline)for(var m=f[0].polyline.distanceDisplayCondition?f[0].polyline.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].polyline.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m)}},500),get:function(){var o=this.item.entities.values;if(!(!/^line.fid/.test(o[0]._id)&&o[0].polyline==null)&&o&&o.length>0&&o[0].polyline){var f=o[0].polyline.distanceDisplayCondition?o[0].polyline.distanceDisplayCondition._value.near:0;return f}}},polygonShow:{set:Ji.debounce(function(o){var f=this.item.entities.values;if(!!/^polygon.fid/.test(f[0]._id)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)f[m].polygon&&(f[m].polygon.show=o)},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon)return o[0].polygon.b}},polygonHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].polygon.height=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.height;return f?f._value:void 0}}},polygonHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)f[m].polygon.heightReference=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.heightReference;return f?f._value:void 0}}},polygonExtrudedHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].polygon.extrudedHeight=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.extrudedHeight;return f?f._value:void 0}}},polygonExtrudedHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)f[m].polygon.extrudedHeightReference=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.extrudedHeightReference;return f?f._value:void 0}}},polygonFill:{set:Ji.debounce(function(o){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)f[m].polygon.fill=o},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.fill;return f?f._value:void 0}}},polygonMaterial:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)f[m].polygon.material=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.material;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},polygonOutline:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)f[m].polygon.outline=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.outline;return f?f._value:void 0}}},polygonOutlineColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)f[m].polygon.outlineColor=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.outlineColor;return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}}},polygonOutlineWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].polygon.outlineWidth=o}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.outlineWidth;return f?f._value:void 0}}},polygonDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=f[0].polygon.distanceDisplayCondition?f[0].polygon.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].polygon.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o)}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.distanceDisplayCondition?o[0].polygon.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},polygonDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities.values;if(!(!/^polygon.fid/.test(f[0]._id)&&f[0].polygon==null)&&f&&f.length>0&&f[0].polygon)for(var m=f[0].polygon.distanceDisplayCondition?f[0].polygon.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].polygon.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m)}},500),get:function(){var o=this.item.entities.values;if(!(!/^polygon.fid/.test(o[0]._id)&&o[0].polygon==null)&&o&&o.length>0&&o[0].polygon){var f=o[0].polygon.distanceDisplayCondition?o[0].polygon.distanceDisplayCondition._value.near:0;return f}}}});var vd=Hu;var Vr=null;function hf(o,f,m){this._viewer=o,this._cesium=f,Vr=f,this._quadtree=void 0,this._tilingScheme=m||new this._cesium.GeographicTilingScheme,this._errorEvent=new this._cesium.Event,this._reTilesKey=[],this._state=!0,this._client=!0,this._reTiles=[],this._normalTile=16,this._minimumHeight=0,this._maximumHeight=0,this._PrimitiveCollection=new Vr.PrimitiveCollection,this._levelZeroMaximumError=Vr.QuadtreeTileProvider.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Vr.Rectangle.clone(Vr.Rectangle.MAX_VALUE),hf.prototype.ready||Object.defineProperties(hf.prototype,{quadtree:{get:function(){return this._quadtree},set:function(v){this._quadtree=v}},ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}}}),this._core=new Sr(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this._getPosition=new Ru(this._viewer,this._cesium)}hf.prototype.update=function(o){if(this._quadtree.beginFrame(o),this._quadtree.render(o),this._quadtree.endFrame(o),this._availability&&(this._state=this.isAvailable(o.time)),this._state&&this._client&&this._quadtree._tilesToRender)for(let f=0,m=this._quadtree._tilesToRender.length,v;f<m;f++)v=this._quadtree._tilesToRender[f],v.data&&v.data.geometryPrimitive&&!(v.data.geometryPrimitive instanceof Vr.Cesium3DTileset)&&v.data.geometryPrimitive.update&&v.data.geometryPrimitive.update(o)};hf.prototype.static=function(o){this.cs=o};hf.prototype.initialize=function(o){};hf.prototype.beginUpdate=function(o){};hf.prototype.endUpdate=function(o){};hf.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumError/(1<<o)};hf.prototype.loadTile=function(o,f){};hf.prototype.updateForPick=function(o){};hf.prototype.computeTileVisibility=function(o,f,m){var v=this.computeDistanceToTile(o,f);if(o._distance=v,f.fog.enabled&&Vr.Math.fog(v,f.fog.density)>=1)return Vr.Visibility.NONE;var y=o.data,x=y.tileBoundingRegion;if(y.boundingVolumeSourceTile===void 0)return Vr.Visibility.PARTIAL;var C=f.cullingVolume,w=y.orientedBoundingBox;!w&&y.renderedMesh&&(w=y.renderedMesh.boundingSphere3D),y.clippedByBoundaries=!1;function A(R,O){if(O.west<O.east)return O;var F=Rectangle.clone(O,splitCartographicLimitRectangleScratch),k=Rectangle.center(R,rectangleCenterScratch);return k.longitude>0?F.east=CesiumMath.PI:F.west=-CesiumMath.PI,F}var E=A(o.rectangle,this.cartographicLimitRectangle),T=new Vr.Rectangle,S=Vr.Rectangle.simpleIntersection(E,o.rectangle,T);if(!S)return Visibility.NONE;if(Vr.Rectangle.equals(S,o.rectangle)||(y.clippedByBoundaries=!0),f.mode,Vr.SceneMode.SCENE3D,!w)return Vr.Intersect.INTERSECTING;var M=this._clippingPlanes;if(M&&M.enabled){var I=M.computeIntersectionWithBoundingVolume(w);if(o.isClipped=I!==Intersect.INSIDE,I===Vr.Intersect.OUTSIDE)return Vr.Visibility.NONE}var P=C.computeVisibility(w);if(P===Vr.Intersect.OUTSIDE)return Vr.Visibility.NONE;var D=f.mode===Vr.SceneMode.SCENE3D&&f.camera.frustum instanceof Vr.OrthographicFrustum;if(f.mode===Vr.SceneMode.SCENE3D&&!D&&m){var L=y.occludeePointInScaledSpace;return!L||m.ellipsoid.isScaledSpacePointVisible(L)?P:Vr.Visibility.NONE}return P};hf.prototype.canRefine=function(o,f,m){return o.level<=this._normalTile+1};hf.prototype.showTileThisFrame=function(o,f,m,v){this._availability&&(this._state=this.isAvailable(f.time))};hf.prototype.computeDistanceToTile=function(o,f){function m(P,D,L,R,O){var F=P.quadtree._occluders.ellipsoid,k=F.ellipsoid,U=[new Vr.Cartesian3,new Vr.Cartesian3,new Vr.Cartesian3,new Vr.Cartesian3],G=U;return Vr.Cartesian3.fromRadians(L.west,L.south,R,k,G[0]),Vr.Cartesian3.fromRadians(L.east,L.south,R,k,G[1]),Vr.Cartesian3.fromRadians(L.west,L.north,R,k,G[2]),Vr.Cartesian3.fromRadians(L.east,L.north,R,k,G[3]),F.computeHorizonCullingPoint(D,G,O)}function v(P,D,L,R,O){var F=L.data;return F===void 0&&(F=L.data=new Vr.GlobeSurfaceTile),L._minimumHeight&&(D=L._minimumHeight),L._maximumHeight&&(P=L._maximumHeight),F.tileBoundingRegion===void 0&&(F.tileBoundingRegion=new Vr.TileBoundingRegion({computeBoundingVolumes:!1,rectangle:L.rectangle,ellipsoid:L.tilingScheme.ellipsoid,minimumHeight:D||0,maximumHeight:P||0})),L}var y=v(this._maximumHeight,this._minimumHeight,o,this.terrainProvider,f),x=o.data,C=x.tileBoundingRegion;if(y===void 0)return 9999999999;if(x.boundingVolumeSourceTile!==y){x.boundingVolumeSourceTile=y;var w=o.rectangle;w&&w.width<Vr.Math.PI_OVER_TWO+Vr.Math.EPSILON5&&(x.orientedBoundingBox=Vr.OrientedBoundingBox.fromRectangle(o.rectangle,C.minimumHeight,C.maximumHeight,o.tilingScheme.ellipsoid,x.orientedBoundingBox),x.occludeePointInScaledSpace=m(this,x.orientedBoundingBox.center,o.rectangle,C.maximumHeight,x.occludeePointInScaledSpace))}var A=C.minimumHeight,E=C.maximumHeight;if(x.boundingVolumeSourceTile!==o){var T=f.camera.positionCartographic.height,S=Math.abs(T-A),M=Math.abs(T-E);S>M?(C.minimumHeight=A,C.maximumHeight=A):(C.minimumHeight=E,C.maximumHeight=E)}var I=C.distanceToCamera(f);return C.minimumHeight=A,C.maximumHeight=E,I};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){return Vr.destroyObject(this)};hf.prototype.remove=function(){this.destroy()};hf.prototype.setStatus=function(o){this._state=o,this._client=o};hf.prototype.edit=function(o,f){let m=this,v=this._viewer;if(!f&&(f={}),this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),o===void 0&&(o=!0),!o){E();return}this.editHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas);var y,x,C,w;this.isEditting=!1;let A;this.editHandler.setInputAction(T=>{if(Vr.ExpandBySmartEarth&&(Vr.ExpandBySmartEarth.underEarth.enable||Vr.ExpandBySmartEarth.isStreetView)){m.isEditting&&(E(),m.defaultEvent(!1));return}let S=T.position,M=v.scene.pick(S);if(!(M&&M&&M.id&&M.id.treeID!==m.treeID)&&M&&M.id&&(M.id instanceof Vr.Entity||M.id.VectorType)){let I=M.id;!m.isEditting&&Ne.states==0?(f.callBack&&f.callBack.start&&f.callBack.start(I),w=I.VectorType,y=m.createEditEntity(w,I.VectorStyle),y.feature=I,y.treeID=m.treeID,m.getSimpleGraphicData(w,y),w==="point"||w==="billboard"||w==="label"||w==="model"?(m.isEditting=!0,m.tooltip.showAt(T.position,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E")):(m.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint(),SmartEarthPopupData.editGraphic.setTreeID(m.treeID)),m.setStatus(!1),Ne.editVector=!0):(I==y&&(I.VectorType==="point"||I.VectorType==="billboard"||I.VectorType==="label"||I.VectorType==="model")||I.name=="_height_point"||I.name=="_edit_point"||I.name=="_move_point"||I.name=="_add_point"||I.name=="_size_point")&&(v.container.style.cursor="crosshair",m.defaultEvent(!1),I.name=="_height_point"?(C={windowPosition:S,originHeight:m._cesium.Cartographic.fromCartesian(I.position.getValue()).height},A="_height_point"):I.name=="_move_point"?A="_move_point":I.VectorType==="point"||I.VectorType==="billboard"||I.VectorType==="label"||I.VectorType==="model"?(m.tooltip.showAt(T.position,"\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539"),A="_move_point",I.VectorType==="model"&&(I.show=!1)):I.name=="_edit_point"?A="_edit_point":I.name=="_add_point"?A="_add_point":I.name=="_size_point"&&(A="_size_point"),x=I)}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(T=>{if(Vr.ExpandBySmartEarth&&(Vr.ExpandBySmartEarth.underEarth.enable||Vr.ExpandBySmartEarth.isStreetView)){m.isEditting&&(E(),m.defaultEvent(!1));return}let S=v.scene.pick(T.endPosition);if(!(S&&S&&S.id&&S.id.treeID!==m.treeID)&&(m._cesium.defined(S)?m.isEditting&&!x?(w==="point"||w==="billboard"||w==="label"||w==="model")&&S.id==y?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E\uFF0C\u53F3\u952E\u5220\u9664"):S.id&&S.id.name==="_edit_point"&&y.pottingPoint?w==="polyline"&&y.pottingPoint.length>2||w==="polygon"&&y.pottingPoint.length>3?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E\uFF0C\u53F3\u952E\u5220\u9664\u70B9"):m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E"):S.id&&(S.id.name==="_move_point"||S.id.name==="_size_point")?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E"):S.id&&S.id.name==="_add_point"?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u589E\u52A0\u8282\u70B9"):S.id&&S.id.name==="_height_point"?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u9AD8\u5EA6"):S.id==y&&m.tooltip.show(!1):!m.isEditting&&Ne.states===0&&(S.id&&S.id.VectorType?m.tooltip.showAt(T.endPosition,"\u70B9\u51FB\u6FC0\u6D3B\u7F16\u8F91"):m.tooltip.show(!1)):Ne.states==0&&!x&&m.tooltip.show(!1),m.isEditting&&x)){m.tooltip.showAt(T.endPosition,"\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539");let M=m._getPosition.getMousePosition(T);if(!M&&A!=="_height_point")return;if(A==="_edit_point"){x.position=M;let I=Ne.editPointID.edit.indexOf(x.id);if(y[w].height!==void 0){let R=m.toDegrees(M);y.pottingPoint[I]=Vr.Cartesian3.fromDegrees(R.lon,R.lat,y[w].height.getValue()),x.position=y.pottingPoint[I]}else y.pottingPoint[I]=M;if(Ne.editPointID.add.length>0){if(I>0){let R=v.entities.getById(Ne.editPointID.add[I-1]);if(R){let O=v.entities.getById(Ne.editPointID.edit[I-1]),F=v.entities.getById(Ne.editPointID.edit[I]);R.position=Vr.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Vr.Cartesian3)}}if(I<y.pottingPoint.length-1){let R=v.entities.getById(Ne.editPointID.add[I]);if(R){let O=v.entities.getById(Ne.editPointID.edit[I]),F=v.entities.getById(Ne.editPointID.edit[I+1]);R.position=Vr.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Vr.Cartesian3)}}if(w==="polygon"&&(I===0||I===y.pottingPoint.length-1)){let R=v.entities.getById(Ne.editPointID.add[Ne.editPointID.add.length-1]);if(R){let O=v.entities.getById(Ne.editPointID.edit[0]),F=v.entities.getById(Ne.editPointID.edit[y.pottingPoint.length-1]);R.position=Vr.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Vr.Cartesian3)}}}let P=y.pottingPoint.concat([]),D=new m._cesium.Cartesian3,L=P.length;P.forEach(R=>{D.x+=R.x,D.y+=R.y,D.z+=R.z}),D.x/=L,D.y/=L,D.z/=L,Ne.editPointID.move&&(Ne.editPointID.move.position=D),(w==="polyline"||w==="polygon"||w==="rectangle")&&SmartEarthPopupData.editGraphic.setValue("positions",P)}else if(A==="_height_point"){let I=Ne.editPointID.height.indexOf(x.id),P=v.entities.getById(Ne.editPointID.edit[I]);(w==="ellipse"||w==="cylinder"||w==="box")&&(P=Ne.editPointID.move);let D=m.toDegrees(P.position.getValue()),L=C.originHeight-D.height,R=v.scene.cartesianToCanvasCoordinates(P.position.getValue()),O=(C.windowPosition.y-T.endPosition.y)*L/Math.abs(R.y-C.windowPosition.y),F=Math.abs(L+O);Ne.editPointID.height.forEach(k=>{let U=v.entities.getById(k);if(U){let G=U.position.getValue(),j=m.toDegrees(G);U.position=m._cesium.Cartesian3.fromDegrees(j.lon,j.lat,F+D.height)}}),y[w].extrudedHeight?y[w].extrudedHeight=F+D.height:w==="box"?SmartEarthPopupData.editGraphic.setValue("height",F):w==="cylinder"&&SmartEarthPopupData.editGraphic.setValue("length",F)}else if(A==="_add_point"){let I=Ne.editPointID.add.indexOf(x.id);v.entities.remove(x);let P=v.entities.add({name:"_edit_point",position:M,point:{pixelSize:10,color:Vr.Color.ROYALBLUE,outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.edit.splice(I+1,0,P.id),y.pottingPoint.splice(I+1,0,M.clone());let D=Vr.Cartesian3.midpoint(y.pottingPoint[I],y.pottingPoint[I+1],new Vr.Cartesian3),L=v.entities.add({name:"_add_point",position:D,point:{pixelSize:10,color:Vr.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),R=Vr.Cartesian3.midpoint(y.pottingPoint[I+1],y.pottingPoint[I+2===y.pottingPoint.length?0:I+2],new Vr.Cartesian3),O=v.entities.add({name:"_add_point",position:R,point:{pixelSize:10,color:Vr.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.add.splice(I,1,L.id,O.id),SmartEarthPopupData.editGraphic.setTreeID(m.treeID),x=P,A="_edit_point";let F=y.pottingPoint.concat([]);(w==="polyline"||w==="polygon")&&SmartEarthPopupData.editGraphic.setValue("positions",F)}else if(A==="_size_point"){let I=Ne.editPointID.move.position.getValue(),P=m._cesium.Cartesian3.distance(I,M);if(w==="ellipse"||w==="cylinder"||w==="ellipsoid"&&y.isSphere)SmartEarthPopupData.editGraphic.setValue("radius",P);else if(w==="box"){let D=x.angle===90?"long":"width";SmartEarthPopupData.editGraphic.setValue(D,P*2)}}else{if(w==="point"||w==="billboard"||w==="label"||w==="model"){x.position=M;return}let I=m.toDegrees(M);C=x.position.getValue();let P=m.toDegrees(C),D=I.lon-P.lon,L=I.lat-P.lat,R=I.height-P.height;if(x.position=M,y[w].height){let F=m.toDegrees(M).height;y[w].height=F,y.thisHeight=F}y.pottingPoint.forEach((F,k)=>{let U,G,j,q=v.entities.getById(Ne.editPointID.edit[k]);if(q||(q=v.entities.getById(Ne.editPointID.size[k])),q?U=m.toDegrees(q.position.getValue()):U=m.toDegrees(F),j=m._cesium.Cartesian3.fromDegrees(U.lon+D,U.lat+L,U.height+R),F.x=j.x,F.y=j.y,F.z=j.z,q&&(q.position=j),Ne.editPointID.add.length>0&&Ne.editPointID.add[k]){let J=v.entities.getById(Ne.editPointID.add[k]);J&&(U=m.toDegrees(J.position.getValue()),J.position=m._cesium.Cartesian3.fromDegrees(U.lon+D,U.lat+L,U.height+R))}});let O=y.pottingPoint.concat([]);if(w==="polyline"||w==="polygon"||w==="rectangle")SmartEarthPopupData.editGraphic.setValue("positions",O);else if(w==="ellipse")y.pottingPoint[1]=M,y.position=M.clone();else if(w==="box"){y.pottingPoint[2]=M;let F=y.box.dimensions.getValue(),k=m.toDegrees(M);y.position=Vr.Cartesian3.fromDegrees(k.lon,k.lat,k.height+F.z/2)}else if(w==="cylinder"){y.pottingPoint[1]=M;let F=y.cylinder.length.getValue(),k=m.toDegrees(y.pottingPoint[1]);y.position=Vr.Cartesian3.fromDegrees(k.lon,k.lat,k.height+F/2)}else w==="ellipsoid"&&(y.pottingPoint[y.pottingPoint.length-1]=M,y.position=M.clone())}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(T=>{if(Vr.ExpandBySmartEarth&&(Vr.ExpandBySmartEarth.underEarth.enable||Vr.ExpandBySmartEarth.isStreetView)){m.isEditting&&(E(),m.defaultEvent(!1));return}x&&x.VectorType==="model"&&(x.show=!0),x&&f.callBack&&f.callBack.updata&&f.callBack.updata(x.name,y),v.container.style.cursor="default",x=void 0,m.defaultEvent(!0)},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(T=>{if(Vr.ExpandBySmartEarth&&(Vr.ExpandBySmartEarth.underEarth.enable||Vr.ExpandBySmartEarth.isStreetView)){m.isEditting&&(E(),m.defaultEvent(!1));return}let S=v.scene.pick(T.position);if(!(S&&S.id&&S.id.treeID!==m.treeID)&&m._cesium.defined(S)&&Ne.states==0){let M=S.id;if(!M.VectorType){if(Ne.editPointID.edit.indexOf(M.id)>-1&&(w==="polyline"&&Ne.editPointID.edit.length>2||w==="polygon"&&Ne.editPointID.edit.length>3)){let I=Ne.editPointID.edit.indexOf(M.id);if(v.entities.removeById(M.id),Ne.editPointID.edit.splice(I,1),y.pottingPoint.splice(I,1),Ne.editPointID.add.length>0)if(Ne.editPointID.add[I]){if(v.entities.removeById(Ne.editPointID.add[I]),Ne.editPointID.add.splice(I,1),I-1>=0){let R=v.entities.getById(Ne.editPointID.add[I-1]);R&&(R.position=Vr.Cartesian3.midpoint(y.pottingPoint[I-1],y.pottingPoint[I===y.pottingPoint.length?0:I],new Vr.Cartesian3))}else if(I-1===-1&&w==="polygon"){let R=v.entities.getById(Ne.editPointID.add[Ne.editPointID.add.length-1]);R&&(R.position=Vr.Cartesian3.midpoint(y.pottingPoint[0],y.pottingPoint[y.pottingPoint.length-1],new Vr.Cartesian3))}}else v.entities.removeById(Ne.editPointID.add[I-1]),Ne.editPointID.add.pop();let P=new m._cesium.Cartesian3,D=y.pottingPoint.length;y.pottingPoint.forEach(R=>{P.x+=R.x,P.y+=R.y,P.z+=R.z}),P.x/=D,P.y/=D,P.z/=D,Ne.editPointID.move&&(Ne.editPointID.move.position=P);let L=y.pottingPoint.concat([]);(w==="polyline"||w==="polygon")&&SmartEarthPopupData.editGraphic.setValue("positions",L),m.tooltip.show(!1),f.callBack&&f.callBack.updata&&f.callBack.updata(x&&x.name,y)}}}},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),E();function E(){m.defaultEvent(!0),Ne.editPointID.edit.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.edit=[],Ne.editPointID.height.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.height=[],Ne.editPointID.add.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.add=[],Ne.editPointID.size.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.size=[],Ne.editPointID.move&&v.entities.remove(Ne.editPointID.move),Ne.editPointID.move=void 0,y&&v.entities.remove(y),y=void 0,w=void 0,SmartEarthPopupData.editGraphic={},m.isEditting=!1,m.setStatus(!0),Ne.editVector=!1,m.delButton(!1)}return{endThisEdit:E,getEditData:function(){return{entity:y}}}};hf.prototype.createEditEntity=function(o,f){let m,v=this,y=this._viewer;if(o==="polygon"){let x=f.positions,C=v._core.defaultValue(f.height,void 0),w;f.hierarchy?w=f.hierarchy:(x=f.haveZ?v._cesium.Cartesian3.fromDegreesArrayHeights(x):v._cesium.Cartesian3.fromDegreesArray(x),w=new v._cesium.PolygonHierarchy(x)),m=y.entities.add({polygon:{hierarchy:new v._cesium.CallbackProperty(function(){return w},!1),extrudedHeight:v._core.defaultValue(f.extrudedHeight,void 0),height:C,material:new v._cesium.ImageMaterialProperty({image:v._core.defaultValue(f.image,null),repeat:v._core.defaultValue(f.repeat,new v._cesium.Cartesian2(1,1)),color:f.material}),shadows:v._cesium.ShadowMode.ENABLED,fill:!0}}),m.VectorType="polygon"}else if(o==="polyline"){let x=f.positions;x=f.haveZ?v._cesium.Cartesian3.fromDegreesArrayHeights(x):v._cesium.Cartesian3.fromDegreesArray(x),m=y.entities.add({polyline:{positions:new v._cesium.CallbackProperty(function(){return x},!1),clampToGround:v._core.defaultValue(f.clampToGround,!1),material:new Vr.PolylineOutlineMaterialProperty({color:f.material,outlineWidth:v._core.defaultValue(f.outlineWidth,0),outlineColor:v._cesium.Color.fromCssColorString(v._core.defaultValue(f.outlineColor,"rgba(255,255,255,0.6)"))}),width:v._core.defaultValue(f.width,3)}}),m.VectorType="polyline"}else if(o==="wall"){let x=f.positions;x=f.haveZ?v._cesium.Cartesian3.fromDegreesArrayHeights(x):v._cesium.Cartesian3.fromDegreesArray(x),m=y.entities.add({wall:{positions:new v._cesium.CallbackProperty(function(){return x},!1),minimumHeights:f.minimumHeights,maximumHeights:f.maximumHeights,material:f.material,outline:!0,outlineWidth:v._core.defaultValue(f.outlineWidth,0),outlineColor:f.outlineColor}}),m.VectorType="wall"}else o==="label"?(m=y.entities.add({position:f.position,label:{text:f.text,font:f.font,scale:f.scale,style:f.style,fillColor:f.fillColor,outlineColor:f.outlineColor,outlineWidth:f.outlineWidth,showBackground:f.showBackground,backgroundColor:f.backgroundColor,heightReference:f.heightReference,horizontalOrigin:f.horizontalOrigin,verticalOrigin:f.verticalOrigin,scaleByDistance:f.scaleByDistance,distanceDisplayCondition:f.distanceDisplayCondition}}),m.VectorType="label"):o==="billboard"?(m=y.entities.add({position:f.position,billboard:{rotation:f.rotation,width:f.width,height:f.height,image:f.image,color:f.color,scale:f.scale,heightReference:f.heightReference,horizontalOrigin:f.horizontalOrigin,verticalOrigin:f.verticalOrigin,scaleByDistance:f.scaleByDistance,distanceDisplayCondition:f.distanceDisplayCondition}}),m.VectorType="billboard"):o==="point"&&(m=y.entities.add({position:f.position,point:{pixelSize:f.pixelSize,color:f.color,outlineWidth:f.outlineWidth,outlineColor:f.outlineColor,heightReference:f.heightReference,scaleByDistance:f.scaleByDistance,distanceDisplayCondition:f.distanceDisplayCondition}}),m.VectorType="point");return m};hf.prototype.delButton=function(o,f,m){if(o){let v=document.getElementById("DeleteMilitaryStandardDelete");v||(v=document.createElement("button"),v.id="DeleteMilitaryStandardDelete",v.innerText="\u5220\u9664\u5BF9\u8C61",v.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(v)),v.style.display="block",v.style.top=f.y+"px",v.style.left=f.x+"px",v.onclick=m}else{let v=document.getElementById("DeleteMilitaryStandardDelete");v&&(v.style.display="none",v.onclick=null)}};hf.prototype.defaultEvent=function(o){let f=this._viewer.scene;f.screenSpaceCameraController.enableRotate=o,f.screenSpaceCameraController.enableTranslate=o,f.screenSpaceCameraController.enableZoom=o,f.screenSpaceCameraController.enableTilt=o,f.screenSpaceCameraController.enableLook=o};hf.prototype.getEntityTypeAndObject=function(o){let f={type:"",object:null};return o&&(o.billboard?(f.type="billboard",f.object=o.billboard):o.box?(f.type="box",f.object=o.box):o.corridor?(f.type="corridor",f.object=o.corridor):o.cylinder?(f.type="cylinder",f.object=o.cylinder):o.ellipse?(f.type="ellipse",f.object=o.ellipse):o.ellipsoid?(f.type="ellipsoid",f.object=o.ellipsoid):o.label?(f.type="label",f.object=o.label):o.model?(f.type="model",f.object=o.model):o.path?(f.type="path",f.object=o.path):o.plane?(f.type="plane",f.object=o.plane):o.point?(f.type="point",f.object=o.point):o.polygon?(f.type="polygon",f.object=o.polygon):o.polyline?(f.type="polyline",f.object=o.polyline):o.polylineVolume?(f.type="polylineVolume",f.object=o.polylineVolume):o.rectangle?(f.type="rectangle",f.object=o.rectangle):o.wall&&(f.type="wall",f.object=o.wall)),f};hf.prototype.toDegrees=function(o){let f=this._cesium.Cartographic.fromCartesian(o);return{lon:this._cesium.Math.toDegrees(f.longitude),lat:this._cesium.Math.toDegrees(f.latitude),height:f.height}};hf.prototype.getSimpleGraphicData=function(o,f){let m=this,v=this._viewer;if(SmartEarthPopupData.editGraphic={entity:f,type:o,graphic:f[o],getValue:function(A){if(A==="position"||A==="name"||A==="id")return this.entity[A]&&(this.entity[A].getValue?this.entity[A].getValue():this.entity[A]);if(A==="radius"){if(this.type==="ellipse")return this.graphic.semiMajorAxis.getValue();if(this.type==="ellipsoid")return this.graphic.radii.getValue().x;if(this.type==="cylinder")return this.graphic.bottomRadius.getValue()}else if(A==="pHeight"){if(this.getValue("position")){let E=this.getValue("position");return Vr.Cartographic.fromCartesian(E).height}}else return A==="repeat"?this.graphic.material[A]&&(this.graphic.material[A].getValue?this.graphic.material[A].getValue():this.graphic.material[A]):this.graphic[A]&&(this.graphic[A].getValue?this.graphic[A].getValue():this.graphic[A])},changeHeightPoint:function(A){Ne.editPointID.height.length>0&&Ne.editPointID.height.forEach(E=>{let T=v.entities.getById(E);if(T){let S=T.position.getValue(),M=m.toDegrees(S);T.position=Vr.Cartesian3.fromDegrees(M.lon,M.lat,A)}})},changeEditPoint:function(A){Ne.editPointID.edit.length>0&&Ne.editPointID.edit.forEach(T=>{let S=v.entities.getById(T);if(S)if(A==="clampToGround")S.point.heightReference=1;else{S.point.heightReference=0;let M=S.position.getValue(),I=m.toDegrees(M);S.position=Vr.Cartesian3.fromDegrees(I.lon,I.lat,A)}}),Ne.editPointID.size.length>0&&Ne.editPointID.size.forEach(T=>{let S=v.entities.getById(T);if(S)if(A==="clampToGround")S.point.heightReference=1;else{S.point.heightReference=0;let M=S.position.getValue(),I=m.toDegrees(M);S.position=Vr.Cartesian3.fromDegrees(I.lon,I.lat,A)}}),Ne.editPointID.add.length>0&&Ne.editPointID.add.forEach(T=>{let S=v.entities.getById(T);if(S)if(A==="clampToGround")S.point.heightReference=1;else{S.point.heightReference=0;let M=S.position.getValue(),I=m.toDegrees(M);S.position=Vr.Cartesian3.fromDegrees(I.lon,I.lat,A)}});let E=Ne.editPointID.move;if(E)if(A==="clampToGround")E.point.heightReference=1;else{E.point.heightReference=0;let T=E.position.getValue(),S=m.toDegrees(T);E.position=Vr.Cartesian3.fromDegrees(S.lon,S.lat,A)}},clearAllEditPoint:function(){Ne.editPointID.edit.forEach(A=>{v.entities.removeById(A)}),Ne.editPointID.edit=[],Ne.editPointID.height.forEach(A=>{v.entities.removeById(A)}),Ne.editPointID.height=[],Ne.editPointID.add.forEach(A=>{v.entities.removeById(A)}),Ne.editPointID.add=[],Ne.editPointID.size.forEach(A=>{v.entities.removeById(A)}),Ne.editPointID.size=[],Ne.editPointID.move&&v.entities.remove(Ne.editPointID.move),Ne.editPointID.move=void 0},setTreeID:function(A){Ne.editPointID.edit.forEach(E=>{let T=v.entities.getById(E);T.treeID=A}),Ne.editPointID.height.forEach(E=>{let T=v.entities.getById(E);T.treeID=A}),Ne.editPointID.add.forEach(E=>{let T=v.entities.getById(E);T.treeID=A}),Ne.editPointID.size.forEach(E=>{let T=v.entities.getById(E);T.treeID=A}),Ne.editPointID.move&&(Ne.editPointID.move.treeID=A)}},o==="billboard"||o==="point"||o==="label"||o==="model"){let A=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor");A?y(A):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");if(E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),o==="label"){let T=SmartEarthPopupData.editGraphic.getValue("backgroundColor");T?C(T):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)}SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="position"||T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"||T==="backgroundColor"||T==="fillColor")S=Vr.Color.fromCssColorString(S);else if(T==="fontSize"){let M=this.getValue("font");M=M.split(" "),M[0]=S,S=M.join(" ")}else if(T==="alpha"){this.type==="label"?this.graphic.fillColor._value.alpha=S:this.graphic.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="backgroundAlpha"){this.graphic.backgroundColor._value.alpha=S;return}else if(T==="pHeight"&&this.getValue("position")){let M=this.getValue("position"),I=Vr.Cartographic.fromCartesian(M);I.height=S,this.entity.position=Vr.Cartographic.toCartesian(I);return}this.graphic[T]=S}}}else if(o==="polyline"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),A.outlineColor?x(A.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(E,T){if(E==="name")this.entity[E]=T;else{if(E==="color"||E==="outlineColor"){T=Vr.Color.fromCssColorString(T),this.graphic.material[E]=T;return}else if(E==="outlineWidth"){this.graphic.material[E]=T;return}else if(E==="alpha"){this.graphic.material.color._value.alpha=T;return}else if(E==="outlineAlpha"){this.graphic.material.outlineColor._value.alpha=T;return}else if(E==="positions"){this.graphic[E]=new Vr.CallbackProperty(function(){return T},!1);return}this.graphic[E]=T}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let E=this.getValue("positions");return this.entity.pottingPoint=E,E},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let E=this.getPottingPoint();if(!E)return;let T=new Vr.Cartesian3;E.forEach((S,M)=>{let I=v.entities.add({name:"_edit_point",position:S,point:{pixelSize:10,color:Vr.Color.ROYALBLUE,outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.edit.push(I.id),T.x+=S.x,T.y+=S.y,T.z+=S.z}),T.x/=E.length,T.y/=E.length,T.z/=E.length,Ne.editPointID.move=v.entities.add({name:"_move_point",position:T,point:{color:Vr.Color.PURPLE,pixelSize:10,outlineColor:Vr.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let S=0;S<E.length-1;S++){let M=Vr.Cartesian3.midpoint(E[S],E[S+1],new Vr.Cartesian3),I=v.entities.add({name:"_add_point",position:M,point:{pixelSize:10,color:Vr.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.add.push(I.id)}}}else if(o==="polygon"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"){if(S=Vr.Color.fromCssColorString(S),T==="color"){this.graphic.material.color=S;return}}else if(T==="image"||T==="repeat"){this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="positions"){this.graphic.hierarchy=new Vr.CallbackProperty(function(){return new Vr.PolygonHierarchy(S)},!1);return}else if(T==="hierarchy"){this.graphic.hierarchy=new Vr.CallbackProperty(function(){return S},!1);return}else if(T==="clampToGround"){let M=function(I,P,D){D?(I.perPositionHeight=!1,I.heightReference=Vr.HeightReference.CLAMP_TO_GROUND):(I.perPositionHeight=!0,I.heightReference=Vr.HeightReference.NONE),Ne.editPointID.edit.length>0&&!D&&P.forEach((L,R)=>{let O=v.entities.getById(Ne.editPointID.edit[R]);if(O){let F=O.position.getValue();L.x=F.x,L.y=F.y,L.z=F.z}}),I.hierarchy=new Vr.CallbackProperty(function(){return new Vr.PolygonHierarchy(P)},!1)};this.graphic.hierarchy instanceof Vr.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{M(this.graphic,this.entity.pottingPoint,S)},100)):M(this.graphic,this.entity.pottingPoint,S),Ne.editPointID.add.length>0&&Ne.editPointID.add.forEach(I=>{let P=v.entities.getById(I);P&&(S?P.point.heightReference=1:P.point.heightReference=0)});return}else T==="extrudedHeight"?this.changeHeightPoint(S):T==="height"&&this.changeEditPoint(S);this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let S=this.getValue("hierarchy").positions.concat([]);if(this.getValue("height")!==void 0){let M=this.getValue("height");S.forEach(I=>{let P=m.toDegrees(I),D=Vr.Cartesian3.fromDegrees(P.lon,P.lat,M);I.x=D.x,I.y=D.y,I.z=D.z})}return this.entity.pottingPoint=S,S},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=new Vr.Cartesian3;T.forEach((P,D)=>{let L=v.entities.add({name:"_edit_point",position:P,point:{pixelSize:10,color:Vr.Color.ROYALBLUE,outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.edit.push(L.id),S.x+=P.x,S.y+=P.y,S.z+=P.z}),S.x/=T.length,S.y/=T.length,S.z/=T.length,Ne.editPointID.move=v.entities.add({name:"_move_point",position:S,point:{color:Vr.Color.PURPLE,pixelSize:10,outlineColor:Vr.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});for(let P=0;P<T.length-1;P++){let D=Vr.Cartesian3.midpoint(T[P],T[P+1],new Vr.Cartesian3),L=v.entities.add({name:"_add_point",position:D,point:{pixelSize:10,color:Vr.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.add.push(L.id)}let M=Vr.Cartesian3.midpoint(T[0],T[T.length-1],new Vr.Cartesian3),I=v.entities.add({name:"_add_point",position:M,point:{pixelSize:10,color:Vr.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.add.push(I.id)}}else if(o==="ellipse"||o==="cylinder"||f.isSphere){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"){if(S=Vr.Color.fromCssColorString(S),T==="color"){this.graphic.material.color=S;return}}else if(T==="image"||T==="repeat"){this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="semiMajorAxis"){this.graphic.semiMajorAxis=new Vr.CallbackProperty(function(){return S},!1);return}else if(T==="semiMinorAxis"){this.graphic.semiMinorAxis=new Vr.CallbackProperty(function(){return S},!1);return}else if(T==="radii"){this.graphic.radii=new Vr.CallbackProperty(function(){return S},!1);return}else if(T==="topRadius"){this.graphic.topRadius=new Vr.CallbackProperty(function(){return S},!1);return}else if(T==="bottomRadius"){this.graphic.bottomRadius=new Vr.CallbackProperty(function(){return S},!1);return}else if(T==="radius"){this.type==="ellipse"?(this.graphic.semiMajorAxis=new Vr.CallbackProperty(function(){return S},!1),this.graphic.semiMinorAxis=new Vr.CallbackProperty(function(){return S},!1)):this.type==="ellipsoid"?this.graphic.material.image.getValue()!==null?this.graphic.radii=new Vr.Cartesian3(S,S,S):this.graphic.radii=new Vr.CallbackProperty(function(){return new Vr.Cartesian3(S,S,S)},!1):this.type==="cylinder"&&(this.graphic.bottomRadius=new Vr.CallbackProperty(function(){return S},!1),this.entity.changeTop&&(this.graphic.topRadius=new Vr.CallbackProperty(function(){return S},!1)));let M=Ne.editPointID.move.position.getValue(),I=m.GetPositionFromA_D(M,S,90),P=v.entities.getById(Ne.editPointID.size[0]);P.position=I,f.pottingPoint[0]=I,f.pottingPoint[f.pottingPoint.length-1]=M;let D=v.entities.getById(Ne.editPointID.height[0]);if(D){let L=m.toDegrees(I),R=m._cesium.Cartographic.fromCartesian(D.position.getValue());D.position=m._cesium.Cartesian3.fromDegrees(L.lon,L.lat,R.height)}return}else if(this.type==="cylinder"&&T==="length"){this.graphic.length=S;let M=m.toDegrees(this.entity.pottingPoint[1]);this.entity.position=Vr.Cartesian3.fromDegrees(M.lon,M.lat,M.height+S/2),this.changeHeightPoint(M.height+S);return}else if(this.type==="ellipse"&&T==="clampToGround"){let M=function(I,P,D){D?(I.thisHeight===void 0&&(I.thisHeight=P.height&&P.height.getValue()),P.height=void 0,P.heightReference=Vr.HeightReference.CLAMP_TO_GROUND):(P.height=I.thisHeight,P.heightReference=Vr.HeightReference.NONE);let L=P.semiMinorAxis.getValue();P.semiMinorAxis=new Vr.CallbackProperty(function(){return L},!1),P.semiMajorAxis=new Vr.CallbackProperty(function(){return L},!1)};this.graphic.semiMinorAxis instanceof Vr.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{M(this.entity,this.graphic,S)},100)):M(this.entity,this.graphic,S),S?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight);return}else this.type==="ellipse"&&T==="extrudedHeight"?this.changeHeightPoint(S):this.type==="ellipse"&&T==="height"&&(this.changeEditPoint(S),this.entity.thisHeight=S);this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let T=this.getValue("radius"),S=this.getValue("position");if(this.type==="ellipse"||this.entity.isSphere){if(this.type==="ellipse"&&this.getValue("height")!==void 0){let I=this.getValue("height"),P=m.toDegrees(S);S=Vr.Cartesian3.fromDegrees(P.lon,P.lat,I)}let M=m.GetPositionFromA_D(S,T,90);return this.entity.pottingPoint=[M,S],[M,S]}else{let M=m.toDegrees(S);S=Vr.Cartesian3.fromDegrees(M.lon,M.lat,M.height-this.getValue("length")/2);let I=m.GetPositionFromA_D(S,T,90);return this.entity.pottingPoint=[I,S],[I,S]}},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=v.entities.add({name:"_size_point",position:T[0],point:{pixelSize:10,color:Vr.Color.ROYALBLUE,outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});S.angle=90,Ne.editPointID.size.push(S.id),Ne.editPointID.move=v.entities.add({name:"_move_point",position:T[1],point:{color:Vr.Color.PURPLE,pixelSize:10,outlineColor:Vr.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}else if(o==="rectangle"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"){if(S=Vr.Color.fromCssColorString(S),T==="color"){this.graphic.material.color=S;return}}else if(T==="image"||T==="repeat"){this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="positions"){this.graphic.coordinates=new Vr.CallbackProperty(function(){return Vr.Rectangle.fromCartesianArray(S)},!1);return}else if(T==="coordinates"){this.graphic.coordinates=new Vr.CallbackProperty(function(){return S},!1);return}else if(T==="clampToGround"){let M=function(I,P,D){D?(I.thisHeight===void 0&&(I.thisHeight=P.height&&P.height.getValue()),P.height=void 0,P.heightReference=Vr.HeightReference.CLAMP_TO_GROUND):(P.height=I.thisHeight,P.heightReference=Vr.HeightReference.NONE);let L=P.coordinates.getValue();P.coordinates=new Vr.CallbackProperty(function(){return L},!1)};this.graphic.coordinates instanceof Vr.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{M(this.entity,this.graphic,S)},100)):M(this.entity,this.graphic,S),S?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight);return}else T==="extrudedHeight"?this.changeHeightPoint(S):T==="height"&&(this.changeEditPoint(S),this.entity.thisHeight=S);this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let T=this.getValue("coordinates"),S,M,I=this.getValue("height");return I!==void 0?(S=Vr.Cartesian3.fromRadians(T.west,T.north,I),M=Vr.Cartesian3.fromRadians(T.east,T.south,I)):(I=v.scene.sampleHeight(new Vr.Cartographic(T.west,T.north,0),[this.entity]),S=Vr.Cartesian3.fromRadians(T.west,T.north,I),I=v.scene.sampleHeight(new Vr.Cartographic(T.east,T.south,0),[this.entity]),M=Vr.Cartesian3.fromRadians(T.east,T.south,I)),this.entity.pottingPoint=[S,M],[S,M]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=new Vr.Cartesian3;T.forEach((M,I)=>{let P=v.entities.add({name:"_edit_point",position:M,point:{pixelSize:10,color:Vr.Color.ROYALBLUE,outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}});Ne.editPointID.edit.push(P.id),S.x+=M.x,S.y+=M.y,S.z+=M.z}),S.x/=T.length,S.y/=T.length,S.z/=T.length,Ne.editPointID.move=v.entities.add({name:"_move_point",position:S,point:{color:Vr.Color.PURPLE,pixelSize:10,outlineColor:Vr.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}else if(o==="box"){let A=SmartEarthPopupData.editGraphic.getValue("material");A.color?y(A.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let E=SmartEarthPopupData.editGraphic.getValue("outlineColor");E?x(E):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(T,S){if(T==="name")this.entity[T]=S;else{if(T==="color"||T==="outlineColor"){if(S=Vr.Color.fromCssColorString(S),T==="color"){this.graphic.material.color=S;return}}else if(T==="image"||T==="repeat"){this.graphic.material[T]=S;return}else if(T==="alpha"){this.graphic.material.color._value.alpha=S;return}else if(T==="outlineAlpha"){this.graphic.outlineColor._value.alpha=S;return}else if(T==="long"||T==="width"||T==="height"){let M=this.getValue("dimensions");if(T==="long"?M.x=S:T==="width"?M.y=S:M.z=S,this.graphic.dimensions=new Vr.CallbackProperty(function(){return M},!1),T==="long"||T==="width"){let I=T==="long"?90:180,P=T==="long"?0:1,D=Ne.editPointID.move.position.getValue(),L=m.GetPositionFromA_D(D,S/2,I),R=v.entities.getById(Ne.editPointID.size[P]);R.position=L,this.entity.pottingPoint[P]=L,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=D}else{let I=m.toDegrees(Ne.editPointID.move.position.getValue());this.entity.position=Vr.Cartesian3.fromDegrees(I.lon,I.lat,I.height+S/2),this.changeHeightPoint(I.height+S)}return}else if(T==="dimensions"){this.graphic.dimensions=new Vr.CallbackProperty(function(){return S},!1);return}this.graphic[T]=S}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let T=this.getValue("dimensions"),S=this.getValue("position"),M=m.toDegrees(S);S=Vr.Cartesian3.fromDegrees(M.lon,M.lat,M.height-T.z/2);let I=m.GetPositionFromA_D(S,T.x/2,90),P=m.GetPositionFromA_D(S,T.y/2,180);return this.entity.pottingPoint=[I,P,S],[I,P,S]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let T=this.getPottingPoint();if(!T)return;let S=v.entities.add({name:"_size_point",position:T[0],point:{pixelSize:10,color:Vr.Color.ROYALBLUE,outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});S.angle=90;let M=v.entities.add({name:"_size_point",position:T[1],point:{pixelSize:10,color:Vr.Color.ROYALBLUE,outlineWidth:2,outlineColor:Vr.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});M.angle=180,Ne.editPointID.size.push(S.id),Ne.editPointID.size.push(M.id),Ne.editPointID.move=v.entities.add({name:"_move_point",position:T[2],point:{color:Vr.Color.PURPLE,pixelSize:10,outlineColor:Vr.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY,heightReference:this.graphic.heightReference&&this.graphic.heightReference.getValue()}})}}else o==="corridor"||o==="ellipsoid"&&f.isSphere;function y(A){SmartEarthPopupData.editGraphic.fillColor=w("rgb("+A.red*255+","+A.green*255+","+A.blue*255+")"),SmartEarthPopupData.editGraphic.alpha=A.alpha*100}function x(A){SmartEarthPopupData.editGraphic.outlineColor=w("rgb("+A.red*255+","+A.green*255+","+A.blue*255+")"),SmartEarthPopupData.editGraphic.outlineAlpha=A.alpha*100}function C(A){SmartEarthPopupData.editGraphic.backgroundColor=w("rgb("+A.red*255+","+A.green*255+","+A.blue*255+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=A.alpha*100}function w(A){let E=A,T=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(E)){let S=E.replace(/(rgb|RGB)*/g,"");S=S.replace("(","").replace(")","");let M=S.split(","),I="#";for(let P=0;P<M.length;P++){let D=Number(M[P]).toString(16);D=D.length===1?0+""+D:D,D==="0"&&(D+=D),I+=D}return I.length!==7&&(I=E),I}else if(T.test(E)){let S=E.replace(/#/,"").split("");if(S.length===6)return E;if(S.length===3){let M="#";for(let I=0;I<S.length;I+=1)M+=S[I]+S[I];return M}}else return E}};var ol=hf;var Dn=null;function Vf(o,f){Dn=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this._Provider=void 0,this.labelCollections1=[],this.labelCollections2=[],this.labelCollections=new this._cesium.PointPrimitiveCollection,this.gd=0,this.item={show:!0},this.model=[],this.Legend=[],this.sj=!0,this._cache=!1,this._forceRefreshPrvimitive=null}Vf.prototype.createLabelPointGeoJsonFeatureLayer=function(o,f,m,v,y){f==null&&console.log("geojson is required");var x=this._cesium.GeoJsonDataSource.load(f),C=this;x.then(function(E){var T={Name:"",text:"",font:" 30px sans-serif",stylet:C._cesium.LabelStyle.OUTLINE,fillColor:C._cesium.Color.WHITE,outlineColor:C._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new C._cesium.Color(.165,.165,.165,.8),backgroundPadding:new C._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:C._cesium.HorizontalOrigin.CENTER,verticalOrigin:C._cesium.VerticalOrigin.CENTER,eyeOffset:C._cesium.Cartesian3.ZERO,pixelOffset:C._cesium.Cartesian2.ZERO,heightReference:C._cesium.HeightReference.NONE,scaleByDistance:new C._cesium.NearFarScalar(0,0,1,1)},S=m.material;!C._core.isnull(m)&&!C._core.isnull(m.fillColor)&&(/^\[/.test(m.fillColor)&&m.fillColor.toString().charAt(0)=="["&&m.fillColor.toString().charAt(m.fillColor.length-1)=="]"||(C._core.isHtmlColor(m.fillColor)?m.fillColor=C._color.colorFromHtmlColor(m.fillColor):(/^rgb/.test(m.fillColor)&&(m.fillColor=C._color.rgbaStringToRgbaObj(m.fillColor)),m.fillColor.r>1&&(m.fillColor.r=m.fillColor.r/255),m.fillColor.g>1&&(m.fillColor.g=m.fillColor.g/255),m.fillColor.b>1&&(m.fillColor.b=m.fillColor.b/255),m.fillColor.a>1&&(m.fillColor.a=m.fillColor.a/255),m.fillColor=C._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a)))),!C._core.isnull(m)&&!C._core.isnull(m.material)&&(/^\[/.test(m.material)&&m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(C._core.isHtmlColor(m.material)?m.material=C._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=C._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.fillColor.r/255),m.material.g>1&&(m.material.g=m.fillColor.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=C._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!C._core.isnull(m)&&!C._core.isnull(m.outlineColor)&&(/^\[/.test(m.outlineColor)&&m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(C._core.isHtmlColor(m.outlineColor)?m.outlineColor=C._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=C._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=C._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),!C._core.isnull(m)&&!C._core.isnull(m.backgroundColor)&&(/^\[/.test(m.backgroundColor)&&m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(C._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=C._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=C._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=C._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))));var M=C._core.extend(T,m,!0);C.item=E;var I=E.entities.values;C._core.isnull(m.near)&&(m.near=0),C._core.isnull(m.far)&&(m.far=999999999);var P=parseFloat(m.near),D=parseFloat(m.far),L=new C._cesium.DistanceDisplayCondition(P,D);M.distanceDisplayCondition=L,C._core.isnull(m.font_size)&&(m.font_size="30px"),C._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),M.font=parseFloat(m.font_size)+"px "+m.font_family;for(var R=new C._cesium.LabelCollection,O=0;O<I.length;O++){var F=I[O];M.position=F.position._value,M.text="a label";var k="fillColor:"+M.fillColor.red*255+","+M.fillColor.green*255+","+M.fillColor.blue*255+";outlineColor:"+M.outlineColor.red*255+","+M.outlineColor.green*255+","+M.outlineColor.blue*255;C.Legend.push(k),R.add(M)}var U=C._viewer.scene.primitives.add(R);typeof y=="function"&&y(U)});var w=this._core.getuid();this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w);var A={id:w,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"labelPointLayer",item:this,url:f,style:options,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:!0,disFnc:y}};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(v)?0:v),this};Vf.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0,pointHeight:0},T=this;!this._core.isnull(m)&&!this._core.isnull(m.fillColor)&&(this._core.isHtmlColor(m.fillColor)?m.fillColor=this._color.colorFromHtmlColor(m.fillColor):(/^rgb/.test(m.fillColor)&&(m.fillColor=this._color.rgbaStringToRgbaObj(m.fillColor)),m.fillColor.r>1&&(m.fillColor.r=m.fillColor.r/255),m.fillColor.g>1&&(m.fillColor.g=m.fillColor.g/255),m.fillColor.b>1&&(m.fillColor.b=m.fillColor.b/255),m.fillColor.a>1&&(m.fillColor.a=m.fillColor.a/255),m.fillColor=this._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.backgroundColor)&&(this._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=this._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=this._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=this._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))),T._core.isnull(m.near)&&(m.near=0),T._core.isnull(m.far)&&(m.far=999999999);var w=this._core.extend(C,m,!0),A={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},E=this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(f)),T=this;E.then(function(I){T.item=I;var P=45,D=3,L=!0,R=I.entities.values;T._core.isnull(w.font_size)&&(w.font_size="30"),T._core.isnull(w.font_family)&&(w.font_family=" sans-serif"),w.font=w.font_size+"px "+w.font_family;for(var O=0;O<R.length;O++){var F=R[O];w.font=T._core.extendgl(F,m.font,w.font),w.style=parseInt(T._core.extendgl(F,w.stylet,w.style)),w.fillColor=T._core.extendgl(F,m.fillColor,w.fillColor),w.outlineColor=T._core.extendgl(F,m.outlineColor,w.outlineColor),w.outlineWidth=parseFloat(T._core.extendgl(F,m.outlineWidth,w.outlineWidth)),w.show=T._core.extendgl(F,m.show,w.show),w.showBackground=T._core.extendgl(F,m.showBackground,w.showBackground),w.backgroundColor=T._core.extendgl(F,m.backgroundColor,w.backgroundColor),w.backgroundPadding=T._core.extendgl(F,m.backgroundPadding,w.backgroundPadding),w.scale=parseFloat(T._core.extendgl(F,m.scale,w.scale)),w.horizontalOrigin=T._core.extendgl(F,m.horizontalOrigin,w.horizontalOrigin),w.pointHeight=parseFloat(T._core.extendgl(F,m.pointHeight,w.pointHeight)),w.text=T._core.extendgl(F,m.text,w.text);var k=parseFloat(T._core.extendgl(F,w.near)),U=parseFloat(T._core.extendgl(F,w.far)),G=new T._cesium.DistanceDisplayCondition(k,U);w.distanceDisplayCondition=G,w.text=F.properties[w.text]==null?w.text:F.properties[w.text]._value,F.billboard.color=T._cesium.Color.WHITE.withAlpha(0),F.label=new T._cesium.LabelGraphics(w);var j=T._viewer.scene.globe.ellipsoid,q=T._cesium.Cartographic.fromCartesian(F.position._value),J=T._cesium.Math.toDegrees(q.longitude),X=T._cesium.Math.toDegrees(q.latitude),Y=w.pointHeight||q.height,Q=new T._cesium.Cartesian3.fromDegrees(J,X,Y);F.position._value=Q}I.clustering.enabled=L,I.clustering.pixelRange=P,I.clustering.minimumClusterSize=D;for(var ee,z=new T._cesium.PinBuilder,ie=z.fromText("50+",T._cesium.Color.RED,48).toDataURL(),re=z.fromText("40+",T._cesium.Color.ORANGE,48).toDataURL(),ne=z.fromText("30+",T._cesium.Color.YELLOW,48).toDataURL(),oe=z.fromText("20+",T._cesium.Color.GREEN,48).toDataURL(),se=z.fromText("10+",T._cesium.Color.BLUE,48).toDataURL(),ae=new Array(8),O=0;O<ae.length;++O)ae[O]=z.fromText(""+(O+2),T._cesium.Color.VIOLET,48).toDataURL();function fe(){T._cesium.defined(ee)?(ee(),ee=void 0):ee=I.clustering.clusterEvent.addEventListener(function(pe,ce){ce.label.show=!1,ce.point.show=!1,ce.billboard.show=!0,ce.billboard.id=ce.label.id,ce.billboard.verticalOrigin=T._cesium.VerticalOrigin.BOTTOM,pe.length>=50?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.RED,48).toDataURL():pe.length>=40?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.ORANGE,48).toDataURL():pe.length>=30?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.YELLOW,48).toDataURL():pe.length>=20?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.GREEN,48).toDataURL():pe.length>=10?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.BLUE,48).toDataURL():ce.billboard.image=ae[pe.length-2]});var ve=I.clustering.pixelRange;I.clustering.pixelRange=0,I.clustering.pixelRange=ve,y||T.setVisibility(y)}fe();var de={pixelRange:P,minimumClusterSize:D};T._cesium.knockout.track(de),typeof x=="function"&&x(ps)});var S=this._core.getuid();this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+S);var M={id:S,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"labelPointLayer",item:this,url:f,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),this};Vf.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};!this._core.isnull(m)&&!this._core.isnull(m.color)&&(m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))));var w=this._core.extend(C,m,!0),A={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},E=this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(f)),T=this,S;m&&m.time&&(S=new T._cesium.TimeIntervalCollection([new T._cesium.TimeInterval({start:m.time.start?T._cesium.JulianDate.fromDate(new Date(m.time.start)):T._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?T._cesium.JulianDate.fromDate(new Date(m.time.end)):T._cesium.Iso8601.MAXIMUM_VALUE})])),E.then(function(P){T.item=P;for(var D=45,L=3,R=!0,O=P.entities.values,F=0;F<O.length;F++){var k=O[F];w.color=T._core.extendgl(k,m.color,w.color),w.pixelSize=parseInt(T._core.extendgl(k,m.pixelSize,w.pixelSize)),w.outlineColor=T._core.extendgl(k,m.outlineColor,w.outlineColor),w.outlineWidth=parseFloat(T._core.extendgl(k,m.outlineWidth,w.outlineWidth)),w.show=T._core.extendgl(k,m.show,w.show),w.height=parseFloat(T._core.extendgl(k,m.height,w.height)),w.scaleByDistance=T._core.extendgl(k,m.scaleByDistance,w.scaleByDistance);var U=parseFloat(T._core.extendgl(k,w.minDistanceDisplay)),G=parseFloat(T._core.extendgl(k,w.maxDistanceDisplay)),j=new T._cesium.DistanceDisplayCondition(U,G);k.billboard.image="",w.distanceDisplayCondition=j,k.point=new T._cesium.PointGraphics(w),w.pointHeight=T._core.extendgl(k,m.pointHeight,w.pointHeight),w.pointHeight=parseFloat(w.pointHeight);var q=T._viewer.scene.globe.ellipsoid,J=T._cesium.Cartographic.fromCartesian(k.position._value),X=T._cesium.Math.toDegrees(J.longitude),Y=T._cesium.Math.toDegrees(J.latitude),Q=w.pointHeight||J.height,ee=new T._cesium.Cartesian3.fromDegrees(X,Y,Q);k.position._value=ee,S&&(k.availability=S)}P.clustering.enabled=R,P.clustering.pixelRange=D,P.clustering.minimumClusterSize=L;for(var z,ie=new T._cesium.PinBuilder,re=ie.fromText("50+",T._cesium.Color.RED,48).toDataURL(),ne=ie.fromText("40+",T._cesium.Color.ORANGE,48).toDataURL(),oe=ie.fromText("30+",T._cesium.Color.YELLOW,48).toDataURL(),se=ie.fromText("20+",T._cesium.Color.GREEN,48).toDataURL(),ae=ie.fromText("10+",T._cesium.Color.BLUE,48).toDataURL(),fe=new Array(8),F=0;F<fe.length;++F)fe[F]=ie.fromText(""+(F+2),T._cesium.Color.VIOLET,48).toDataURL();function de(){T._cesium.defined(z)?(z(),z=void 0):z=P.clustering.clusterEvent.addEventListener(function(ce,he){he.label.show=!1,he.point.show=!1,he.billboard.show=!0,he.billboard.id=he.label.id,he.billboard.verticalOrigin=T._cesium.VerticalOrigin.BOTTOM,ce.length>=50?he.billboard.image=ie.fromText(ce.length,T._cesium.Color.RED,48).toDataURL():ce.length>=40?he.billboard.image=ie.fromText(ce.length,T._cesium.Color.ORANGE,48).toDataURL():ce.length>=30?he.billboard.image=ie.fromText(ce.length,T._cesium.Color.YELLOW,48).toDataURL():ce.length>=20?he.billboard.image=ie.fromText(ce.length,T._cesium.Color.GREEN,48).toDataURL():ce.length>=10?he.billboard.image=ie.fromText(ce.length,T._cesium.Color.BLUE,48).toDataURL():he.billboard.image=fe[ce.length-2]});var pe=P.clustering.pixelRange;P.clustering.pixelRange=0,P.clustering.pixelRange=pe,y||T.setVisibility(y)}de();var ve={pixelRange:D,minimumClusterSize:L};T._cesium.knockout.track(ve),typeof x=="function"&&x(ps)});var M=this._core.getuid();this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+M);var I={id:M,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),this};Vf.prototype._cameraMoveEndHandler=function(){var o=this._viewer.camera.getMagnitude();if(o<this.gd){if(this.sj){this._viewer.scene.primitives.remove(this.labelCollections),this.labelCollections=new this._cesium.LabelCollection;for(var f=0;f<this.labelCollections1.length;f++)this.labelCollections.add(this.labelCollections1[f]);this._viewer.scene.primitives.add(this.labelCollections),this.sj=!1}}else{this._viewer.scene.primitives.remove(this.labelCollections);for(var m=new this._cesium.BillboardCollection,f=0;f<this.labelCollections2.length;f++)this.BillboardCollections.add(this.labelCollections2[f]);this._viewer.scene.primitives.add(this.BillboardCollections),this.sj=!0}};Vf.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=f,w=this._viewer.scene.primitives;this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this.gd=m.height;for(var A=new this._cesium.BillboardCollection,E={},T=[],S=0;S<C.length;S++){var M=new this._cesium.Cartesian3.fromDegrees(C[S].lng,C[S].lat,100),I={position:M,text:C[S].name};this.labelCollections1.push(I);var P=C[S];if(!E[P[m.adminname]])T.push({adminname:P[m.adminname],name:P.name,showBackground:!0,lat:P.lat,lng:P.lng,data:[P]}),E[P[m.adminname]]=P;else for(var D=0;D<T.length;D++){var L=T[D];if(L.adminname==P[m.adminname]){L.data.push(P);break}}}for(var S=0;S<T.length;S++){var M=new this._cesium.Cartesian3.fromDegrees(T[S].lng,T[S].lat,100),I={position:M,image:pinBuilder.fromText(T[S].data.length+"",this._cesium.Color.BLACK,48).toDataURL()};this.labelCollections2.push(I),this.BillboardCollections.add(I)}var R;m&&m.time&&(R=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:m.time.start?this._cesium.JulianDate.fromDate(new Date(m.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?this._cesium.JulianDate.fromDate(new Date(m.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this._viewer.scene.primitives.add(this.BillboardCollections,R)};Vf.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(o,f,m,v,y,x){var C={height:0,material:this._cesium.Color.WHITE,size:50,fill:this._cesium.Color.RED,maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):/^http/.test(m.material)||(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.fill)&&(m.fill.toString().charAt(0)=="["&&m.fill.toString().charAt(m.fill.length-1)=="]"||(this._core.isHtmlColor(m.fill)?m.fill=this._color.colorFromHtmlColor(m.fill):/^http/.test(m.fill)||(/^rgb/.test(m.fill)&&(m.fill=this._color.rgbaStringToRgbaObj(m.fill)),m.fill.r>1&&(m.fill.r=m.fill.r/255),m.fill.g>1&&(m.fill.g=m.fill.g/255),m.fill.b>1&&(m.fill.b=m.fill.b/255),m.fill.a>1&&(m.fill.a=m.fill.a/255),m.fill=this._color.createColor(m.fill.r,m.fill.g,m.fill.b,m.fill.a))));var A=this._core.extend(C,m,!0),E=this;this._urlTemplate=f.url+"?"+this._core._serialize(w.urlParams);var T=f.url+"?"+this._core._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(A.height)||0,this._Provider.loadTile=function(P,D){if(D.state===Dn.QuadtreeTileLoadState.START){if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&E.item.show){var L=T.replace(window.encodeURIComponent("{x}"),D.x).replace(window.encodeURIComponent("{y}"),D.y).replace(window.encodeURIComponent("{z}"),D.level);E._cache&&(L+="&"+E._core.getuid()),E._core.xhr({url:L,type:"get",dataType:"json",success:function(R){cluster==""?E.labelCollections=new E._cesium.PointPrimitiveCollection:E.labelCollections=new E._cesium.BillboardCollection;var O=new E._cesium.PinBuilder;if(R==null){D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0;return}var F=[];R.features.forEach(function(k){A.id=k;var U=k.geometry.coordinates[2]||0;if(k.properties.height!=null&&(U=parseFloat(k.properties.height)),/^\[/.test(A.height)&&/\]$/.test(A.height)){var G=A.height.replace(/\[/,"").replace(/\]/,"");U+=parseFloat(k.properties[G])}else U+=parseFloat(A.height)||0;var j={},q=new E._cesium.Cartesian3.fromDegrees(k.geometry.coordinates[0],k.geometry.coordinates[1],U);cluster==""?j={id:k,color:A.material,position:q}:j={position:q,image:O.fromText(k.count+"",A.fill,A.size).toDataURL(),verticalOrigin:E._cesium.VerticalOrigin.BOTTOM},E.labelCollections.add(j)}),R.features.length==0&&(D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0),D.data.geometryPrimitive=E.labelCollections,D.state=Dn.QuadtreeTileLoadState.LOADING,D.state===Dn.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive.update(P,[]),D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0)},error:function(){D.count==null&&(D.count=0),D.count+=1,D.count>=2?(D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0):D.state=Dn.QuadtreeTileLoadState.START}})}else{D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0;return}D.state=Dn.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;m&&m.time&&(this._Provider._availability=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(P){if(!Dn.defined(P))throw new Dn.DeveloperError("time is required.");var D=this._availability;return!Dn.defined(D)||D.contains(P)}),M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Vf.prototype.createLabelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this,A=m.material;!w._core.isnull(m)&&!w._core.isnull(m.fillColor)&&(/^\[/.test(m.fillColor)&&m.fillColor.toString().charAt(0)=="["&&m.fillColor.toString().charAt(m.fillColor.length-1)=="]"||(w._core.isHtmlColor(m.fillColor)?m.fillColor=w._color.colorFromHtmlColor(m.fillColor):(/^rgb/.test(m.fillColor)&&(m.fillColor=w._color.rgbaStringToRgbaObj(m.fillColor)),m.fillColor.r>1&&(m.fillColor.r=m.fillColor.r/255),m.fillColor.g>1&&(m.fillColor.g=m.fillColor.g/255),m.fillColor.b>1&&(m.fillColor.b=m.fillColor.b/255),m.fillColor.a>1&&(m.fillColor.a=m.fillColor.a/255),m.fillColor=w._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a)))),!w._core.isnull(m)&&!w._core.isnull(m.material)&&(/^\[/.test(m.material)&&m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(w._core.isHtmlColor(m.material)?m.material=w._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=w._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=w._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!w._core.isnull(m)&&!w._core.isnull(m.outlineColor)&&(/^\[/.test(m.outlineColor)&&m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(w._core.isHtmlColor(m.outlineColor)?m.outlineColor=w._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=w._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=w._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),!w._core.isnull(m)&&!w._core.isnull(m.backgroundColor)&&(/^\[/.test(m.backgroundColor)&&m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(w._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=w._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=w._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=w._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a)))),this._urlTemplate=f.url+"?"+this._core._serialize(C.urlParams);var E=f.url+"?"+this._core._serialize(C.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height)||0,this._Provider.loadTile=function(I,P){if(P.state===Dn.QuadtreeTileLoadState.START){if(P.data={lines:[],geometryPrimitive:void 0},P.level>=m.level_min&&P.level<m.level_max&&w.item.show){var D=E.replace(window.encodeURIComponent("{x}"),P.x).replace(window.encodeURIComponent("{y}"),P.y).replace(window.encodeURIComponent("{z}"),P.level);w._cache&&(D+="&"+w._core.getuid()),w._core.xhr({url:D,type:"get",dataType:"json",success:function(L){if(L==null){P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0;return}var R={Name:"",text:"",font:" 30px sans-serif",style:w._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:w._cesium.Color.WHITE,outlineColor:w._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new w._cesium.Color(.165,.165,.165,.8),backgroundPadding:new w._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:w._cesium.HorizontalOrigin.CENTER,verticalOrigin:w._cesium.VerticalOrigin.CENTER,eyeOffset:w._cesium.Cartesian3.ZERO,pixelOffset:w._cesium.Cartesian2.ZERO,heightReference:w._cesium.HeightReference.NONE,scaleByDistance:new w._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},O=w._core.extend(R,m,!0);w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var F=parseFloat(m.near),k=parseFloat(m.far),U=new w._cesium.DistanceDisplayCondition(F,k);O.distanceDisplayCondition=U,w._core.isnull(m.font_size)&&(m.font_size="30px"),w._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),O.font=parseFloat(m.font_size)+"px "+m.font_family;var G;O.image!=null&&O.image!=null?G=new w._cesium.BillboardCollection:G=new w._cesium.LabelCollection,L.features.forEach(function(j){O.id=j;var q=O.pointHeight;if(/^\[/.test(q)&&/\]$/.test(q)){var J=q.replace(/\[/,"").replace(/\]/,"");q=parseFloat(j.properties[J])}else q!=null&&q!=""?q=parseFloat(q):j.properties.height!=null&&(q=parseFloat(j.properties.height));if(O.position=new w._cesium.Cartesian3.fromDegrees(j.geometry.coordinates[0],j.geometry.coordinates[1],q),/^\[/.test(m.fillColor)&&/\]$/.test(m.fillColor)){var X=m.fillColor.replace(/\[/,"").replace(/\]/,"");O.fillColor=j.properties[X],w._core.isHtmlColor(O.fillColor)?O.fillColor=w._color.colorFromHtmlColor(O.fillColor):(/^rgb/.test(O.fillColor)&&(O.fillColor=w._color.rgbaStringToRgbaObj(O.fillColor)),O.fillColor.r>1&&(O.fillColor.r=O.fillColor.r/255),O.fillColor.g>1&&(O.fillColor.g=O.fillColor.g/255),O.fillColor.b>1&&(O.fillColor.b=O.fillColor.b/255),O.fillColor.a>1&&(O.fillColor.a=O.fillColor.a/255),O.fillColor=w._color.createColor(O.fillColor.r,O.fillColor.g,O.fillColor.b,O.fillColor.a))}if(/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)){var X=m.outlineColor.replace(/\[/,"").replace(/\]/,"");O.outlineColor=j.properties[X],w._core.isHtmlColor(O.outlineColor)?O.outlineColor=w._color.colorFromHtmlColor(O.outlineColor):(/^rgb/.test(O.outlineColor)&&(O.outlineColor=w._color.rgbaStringToRgbaObj(O.outlineColor)),O.outlineColor.r>1&&(O.outlineColor.r=O.outlineColor.r/255),O.outlineColor.g>1&&(O.outlineColor.g=O.outlineColor.g/255),O.outlineColor.b>1&&(O.outlineColor.b=O.outlineColor.b/255),O.outlineColor.a>1&&(O.outlineColor.a=O.outlineColor.a/255),O.outlineColor=w._color.createColor(O.outlineColor.r,O.outlineColor.g,O.outlineColor.b,O.outlineColor.a))}var Y="fillColor:"+O.fillColor.red*255+","+O.fillColor.green*255+","+O.fillColor.blue*255+";outlineColor:"+O.outlineColor.red*255+","+O.outlineColor.green*255+","+O.outlineColor.blue*255;if(w.Legend.push(Y),/^\[/.test(m.text)&&/\]$/.test(m.text)){var X=m.text.replace(/\[/,"").replace(/\]/,"");O.text=j.properties[X]}O.id.treeID=m.id,O.id.VectorType="label",O.id.VectorStyle={position:O.position,pointHeight:q,text:O.text,font:O.font,scale:O.scale,style:O.style,fillColor:O.fillColor,outlineColor:O.outlineColor,outlineWidth:O.outlineWidth,showBackground:O.showBackground,backgroundColor:O.backgroundColor,heightReference:O.heightReference,horizontalOrigin:O.horizontalOrigin,verticalOrigin:O.verticalOrigin,scaleByDistance:O.scaleByDistance,distanceDisplayCondition:O.distanceDisplayCondition},G.add(O)}),L.features.length==0&&(P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0),P.data.geometryPrimitive=G,P.state=Dn.QuadtreeTileLoadState.LOADING,P.state===Dn.QuadtreeTileLoadState.LOADING&&(P.data.geometryPrimitive.update(I,[]),P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0)},error:function(){P.count==null&&(P.count=0),P.count+=1,P.count>=2?(P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0):P.state=Dn.QuadtreeTileLoadState.START}})}else{P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0;return}P.state=Dn.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var T=this._viewer.scene,S=T.primitives;m&&m.time&&(this._Provider._availability=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:m.time.start?w._cesium.JulianDate.fromDate(new Date(m.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?w._cesium.JulianDate.fromDate(new Date(m.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(I){if(!Dn.defined(I))throw new Dn.DeveloperError("time is required.");var P=this._availability;return!Dn.defined(P)||P.contains(I)}),S.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var M={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=m.id,this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Vf.prototype.createLabelImageGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium},w=this,A=m.material;!w._core.isnull(m)&&!w._core.isnull(m.fillColor)&&typeof m.fillColor=="string"&&(/^\[/.test(m.fillColor)&&/\]$/.test(m.fillColor)||(w._core.isHtmlColor(m.fillColor)||/^rgb/.test(m.fillColor))&&(m.fillColor=Dn.Color.fromCssColorString(m.fillColor))),!w._core.isnull(m)&&!w._core.isnull(m.outlineColor)&&typeof m.outlineColor=="string"&&(/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)||(w._core.isHtmlColor(m.outlineColor)||/^rgb/.test(m.outlineColor))&&(m.outlineColor=Dn.Color.fromCssColorString(m.outlineColor))),!w._core.isnull(m)&&!w._core.isnull(m.color)&&typeof m.color=="string"&&(/^\[/.test(m.color)&&/\]$/.test(m.color)||(w._core.isHtmlColor(m.color)||/^rgb/.test(m.color))&&(m.color=Dn.Color.fromCssColorString(m.color))),!w._core.isnull(m)&&!w._core.isnull(m.backgroundColor)&&typeof m.backgroundColor=="string"&&(/^\[/.test(m.backgroundColor)&&/\]$/.test(m.backgroundColor)||(w._core.isHtmlColor(m.backgroundColor)||/^rgb/.test(m.backgroundColor))&&(m.backgroundColor=Dn.Color.fromCssColorString(m.backgroundColor))),w._core.isnull(m.font)&&(w._core.isnull(m.font_size)&&(m.font_size="30px"),w._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),m.font=m.font_size+" "+m.font_family,m.bold&&(m.font="bold "+m.font),m.italic&&(m.font="italic "+m.font)),w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var E=parseFloat(m.near),T=parseFloat(m.far),S=new w._cesium.DistanceDisplayCondition(E,T);m.distanceDisplayCondition=S;let M=f.url.indexOf("/gisserver/")>-1;var I;M?I=f.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:I=f.url+"?"+this._core._serialize(C.urlParams),this._urlTemplate=I,this._Provider=new ol(this._viewer,this._cesium,M?new Dn.WebMercatorTilingScheme:void 0),this._Provider._normalTile=m.level_max,this._Provider._minimumHeight=parseFloat(m.height)||0;function P(J,X){let Y;if(typeof X.value=="string")/^\[/.test(X.value)&&/\]$/.test(X.value)?(Y=X.value.replace(/\[/,"").replace(/\]/,""),Y=J.properties[Y]):Y=X.value;else{let Q=X.value,ee=Q.Condition,z=J.properties[ee];Y=Q.Value[z]}return!Y&&(Y=X.defaultValue),w._core.isHtmlColor(Y)&&(Y=Dn.Color.fromCssColorString(Y)),Y}function D(){return{name:"",text:"",font:" 30px sans-serif",style:w._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:w._cesium.Color.WHITE,outlineColor:w._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new w._cesium.Color(.165,.165,.165,.8),backgroundPadding:new w._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:w._cesium.HorizontalOrigin.CENTER,verticalOrigin:w._cesium.VerticalOrigin.CENTER,eyeOffset:w._cesium.Cartesian3.ZERO,pixelOffset:w._cesium.Cartesian2.ZERO,heightReference:w._cesium.HeightReference.NONE,scaleByDistance:new w._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0}}this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(J,X){if(X.state===Dn.QuadtreeTileLoadState.START){if(X.data={lines:[],geometryPrimitive:void 0},X.level>=m.level_min&&X.level<=m.level_max&&w.item.show){if(M&&(X.reverseY=w._Provider.tilingScheme.getNumberOfYTilesAtLevel(X.level)-X.y-1),w.TileMatrixLimits){let Q=w.TileMatrixLimits[X.level];if(!Q||Q&&(X.x>Q.maxCol||X.x<Q.minCol||X.y>Q.maxRow||X.y<Q.minRow)){X.state=Dn.QuadtreeTileLoadState.DONE,X.renderable=!0,k();return}}if(w._Provider.EntityCollection.isShow&&(w._Provider.EntityCollection.show=!0),w._Provider.EntityCollection.childrenCollection[X.level+"-"+X.x+"-"+X.y]){let Q=w._Provider.EntityCollection.childrenCollection[X.level+"-"+X.x+"-"+X.y];Q.setVisibility(!0),X.data.geometryPrimitive=Q,X.state=Dn.QuadtreeTileLoadState.DONE,X.renderable=!0,k();return}var Y=I.replace(window.encodeURIComponent("{x}"),X.x).replace(window.encodeURIComponent("{y}"),X.reverseY||X.y).replace(window.encodeURIComponent("{z}"),X.level);w._cache&&(Y+="&"+w._core.getuid()),w._core.xhr({url:Y,type:"get",dataType:"json",success:function(Q){if(!Q||!Q.features||!Q.features.length){X.state=Dn.QuadtreeTileLoadState.DONE,X.renderable=!0;return}var ee=D(),z=w._core.extend(ee,m,!0),ie,re;z.image&&!z.text?re=!0:(!z.image&&z.text||z.image&&z.text&&(re=!0),ie=!0);let ne=new O(w._viewer,w._Provider.EntityCollection,X);oe(Q);async function oe(ae){ae.features.forEach(function(fe,de){ne.isDestroy||se(fe)})}async function se(ae){z.id=ae.id;var fe=z.pointHeight;if(typeof fe=="string"&&/^\[/.test(fe)&&/\]$/.test(fe)){var de=fe.replace(/\[/,"").replace(/\]/,"");fe=parseFloat(ae.properties[de])}else fe!=null&&fe!=""?fe=parseFloat(fe):ae.properties.height!=null&&(fe=parseFloat(ae.properties.height));if(z.position=new w._cesium.Cartesian3.fromDegrees(ae.geometry.coordinates[0],ae.geometry.coordinates[1],fe),typeof m.font=="object"&&(z.font=P(ae,m.font)),typeof m.fillColor=="string"&&/^\[/.test(m.fillColor)&&/\]$/.test(m.fillColor)){var ve=m.fillColor.replace(/\[/,"").replace(/\]/,"");z.fillColor=ae.properties[ve],(w._core.isHtmlColor(z.fillColor)||/^rgb/.test(z.fillColor))&&(z.fillColor=Dn.Color.fromCssColorString(z.fillColor))}else typeof m.fillColor=="object"&&m.fillColor.value&&(z.fillColor=P(ae,m.fillColor));if(typeof m.outlineColor=="string"&&/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)){var ve=m.outlineColor.replace(/\[/,"").replace(/\]/,"");z.outlineColor=ae.properties[ve],(w._core.isHtmlColor(z.outlineColor)||/^rgb/.test(z.outlineColor))&&(z.outlineColor=Dn.Color.fromCssColorString(z.outlineColor))}else typeof m.outlineColor=="object"&&m.outlineColor.value&&(z.outlineColor=P(ae,m.outlineColor));if(m.showBackground)if(typeof m.backgroundColor=="string"&&/^\[/.test(m.backgroundColor)&&/\]$/.test(m.backgroundColor)){var ve=m.backgroundColor.replace(/\[/,"").replace(/\]/,"");z.backgroundColor=ae.properties[ve],(w._core.isHtmlColor(z.backgroundColor)||/^rgb/.test(z.backgroundColor))&&(z.backgroundColor=Dn.Color.fromCssColorString(z.backgroundColor))}else typeof m.backgroundColor=="object"&&m.backgroundColor.value&&(z.backgroundColor=P(ae,m.backgroundColor));var pe="fillColor:"+z.fillColor.red*255+","+z.fillColor.green*255+","+z.fillColor.blue*255+";outlineColor:"+z.outlineColor.red*255+","+z.outlineColor.green*255+","+z.outlineColor.blue*255;if(w.Legend.push(pe),typeof m.text=="string"&&/^\[/.test(m.text)&&/\]$/.test(m.text)){var ve=m.text.replace(/\[/,"").replace(/\]/,"");z.text=ae.properties[ve]}else typeof m.text=="object"&&(z.text=P(ae,m.text));if(typeof m.image=="string"&&/^\[/.test(m.image)&&/\]$/.test(m.image)){var ve=m.image.replace(/\[/,"").replace(/\]/,"");z.image=ae.properties[ve]}else typeof m.image=="object"&&(z.image=P(ae,m.image));let ce={position:z.position};if(ie){let Ce=z;z.labelData&&(Ce=Object.assign({},z,z.labelData,!0)),(z.offsetX||z.offsetY)&&(Ce.pixelOffset=new Dn.Cartesian2(z.offsetX||0,z.offsetY||0)),ce.label=Ce}if(re){let Ce=z;z.imageData&&(Ce=Object.assign({},z,z.imageData,!0)),ce.billboard=Ce}let he=new Dn.Entity(ce);he.feature=ae,ne.add(he)}X.data.geometryPrimitive=ne,w._Provider.EntityCollection.childrenCollection[X.level+"-"+X.x+"-"+X.y]=ne,X.state=Dn.QuadtreeTileLoadState.LOADING,X.state===Dn.QuadtreeTileLoadState.LOADING&&(X.state=Dn.QuadtreeTileLoadState.DONE,X.renderable=!0),k()},error:function(){X.state=Dn.QuadtreeTileLoadState.DONE,X.renderable=!0,k()}})}else{X.state=Dn.QuadtreeTileLoadState.DONE,X.renderable=!0,w._Provider.EntityCollection.show=!1;return}X.state=Dn.QuadtreeTileLoadState.LOADING}k()},typeof x=="function"&&x(this.item)};let L,R;this.saveDefaultVectorData=()=>{R=w._core.extend({},m,!0)},this.restoreVector=()=>{if(R&&(m=R,w._Provider._normalTile=m.level_max,w._Provider&&w._Provider.EntityCollection)){let J=D(),X=w._core.extend(J,m,!0),Y,Q;X.image&&!X.text?Q=!0:(!X.image&&X.text||X.image&&X.text&&(Q=!0),Y=!0),w._Provider.EntityCollection.values.forEach(ee=>{let z=ee.feature;X.pointHeight!==void 0&&(ee.position=new Dn.Cartesian3.fromDegrees(z.geometry.coordinates[0],z.geometry.coordinates[1],X.pointHeight));let ie;typeof X.text=="string"&&/^\[/.test(X.text)&&/\]$/.test(X.text)?(ie=X.text.replace(/\[/,"").replace(/\]/,""),ie=z.properties[ie]):typeof X.text=="object"&&(ie=P(z,X.text));let re;if(typeof X.image=="string"&&/^\[/.test(X.image)&&/\]$/.test(X.image)?(re=X.image.replace(/\[/,"").replace(/\]/,""),re=z.properties[re]):typeof X.image=="object"&&(re=P(z,X.image)),Y){let ne=Object.assign({},X);ie&&(ne.text=ie),X.labelData&&(ne=Object.assign(ne,X.labelData)),(X.offsetX||X.offsetY)&&(ne.pixelOffset=new Dn.Cartesian2(X.offsetX||0,X.offsetY||0)),ee.label=ne}else ee.label=void 0;if(Q){let ne=Object.assign({},X);re&&(ne.image=re),X.imageData&&(ne=Object.assign(ne,X.imageData)),ee.billboard=ne}else ee.billboard=void 0})}R=void 0},this.updataVector=(J={})=>{if((J.color||J.fillColor||J.outlineColor||J.backgroundColor)&&(J.color&&(J.color=Dn.Color.fromCssColorString(J.color)),J.fillColor&&(J.fillColor=Dn.Color.fromCssColorString(J.fillColor)),J.outlineColor&&(J.outlineColor=Dn.Color.fromCssColorString(J.outlineColor)),J.backgroundColor&&(J.backgroundColor=Dn.Color.fromCssColorString(J.backgroundColor))),J.near!==void 0||J.far!==void 0){J.near!==void 0&&(E=parseFloat(J.near)),J.far!==void 0&&(T=parseFloat(J.far));let X=new Dn.DistanceDisplayCondition(E,T);J.distanceDisplayCondition=X}(J.minimumLevel!==void 0||J.maximumLevel!==void 0)&&(J.minimumLevel!==void 0&&(J.level_min=J.minimumLevel),J.maximumLevel!==void 0&&(J.level_max=J.maximumLevel)),m=w._core.extend(m,J,!0),w._Provider._normalTile=m.level_max,m.font=m.font_size+" "+m.font_family,m.bold&&(m.font="bold "+m.font),m.italic&&(m.font="italic "+m.font),J.font=m.font,w._Provider&&w._Provider.EntityCollection&&(clearTimeout(L),L=setTimeout(()=>{let X,Y,Q;w._Provider.EntityCollection.values.forEach(ee=>{X=ee.label,Y=ee.billboard,Q=ee.feature,J.height!==void 0&&(ee.position=new Dn.Cartesian3.fromDegrees(Q.geometry.coordinates[0],Q.geometry.coordinates[1],J.height));let z;typeof J.text=="string"&&/^\[/.test(J.text)&&/\]$/.test(J.text)?(z=J.text.replace(/\[/,"").replace(/\]/,""),z=Q.properties[z]):typeof J.text=="object"&&(z=P(Q,J.text));let ie;typeof J.image=="string"&&/^\[/.test(J.image)&&/\]$/.test(J.image)?(ie=J.image.replace(/\[/,"").replace(/\]/,""),ie=Q.properties[ie]):typeof J.image=="object"&&(ie=P(Q,J.image)),X?((J.offsetX||J.offsetY)&&(J.pixelOffset=new Dn.Cartesian2(m.offsetX||0,m.offsetY||0)),Object.assign(X,J),z&&(X.text=z),J.text!==void 0&&(X.show=!!J.text)):J.text&&(ee.label={...m},z&&(ee.label.text=z)),J.image!==void 0&&(Y?(Y.image=J.image,Y.show=!!J.image,ie&&(Y.image=ie)):J.image&&(ee.billboard={image:ie||J.image,disableDepthTestDistance:m.disableDepthTestDistance,horizontalOrigin:Dn.HorizontalOrigin.CENTER,pixelOffset:new Dn.Cartesian2(0,0)}))})},100))},this._Provider.EntityCollection=new Dn.EntityCollection,this._Provider.EntityCollection.isShow=!0,this._Provider.EntityCollection.childrenCollection={};function O(J,X,Y){this.viewer=J,this.collection=X,this.key=Y.level+"-"+Y.x+"-"+Y.y,this.isDestroy=!1,this.values=[],this._time=void 0,this.show=!0}O.prototype.update=function(){clearTimeout(this._time),this.setVisibility(!0),this._time=setTimeout(()=>{this.setVisibility(!1)},500)},O.prototype.add=function(J){this.isDestroy||(this.viewer&&this.viewer.entities.add(J),this.collection&&this.collection.add(J),this.values.push(J.id))},O.prototype.setVisibility=function(J){this.show=J,this.values.forEach(X=>{let Y=this.viewer.entities.getById(X);Y&&(Y.show=J)})},O.prototype.destroy=function(){this.isDestroy=!0,this.add=()=>{},this.update=()=>{},this.values.forEach(J=>{this.viewer&&this.viewer.entities.removeById(J),this.collection&&this.collection.removeById(J)}),delete this.collection.childrenCollection[this.key],this.collection=void 0,this.values=[],this.viewer=void 0,Dn.destroyObject(this)};let F;function k(){w._Provider.EntityCollection.show&&(clearTimeout(F),F=setTimeout(function(){U()},500))}function U(){if(w._Provider.quadtree&&w._Provider.quadtree._tilesToRender&&w._Provider.quadtree._tilesToRender.length){let J=[];w._Provider.quadtree._tilesToRender.forEach(X=>{J.push(X.level+"-"+X.x+"-"+X.y)});for(let X in w._Provider.EntityCollection.childrenCollection)J.indexOf(X)<0&&w._Provider.EntityCollection.childrenCollection[X].setVisibility(!1)}}this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var G=this._viewer.scene,j=G.primitives;m&&m.time&&(this._Provider._availability=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:m.time.start?w._cesium.JulianDate.fromDate(new Date(m.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?w._cesium.JulianDate.fromDate(new Date(m.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(J){if(!Dn.defined(J))throw new Dn.DeveloperError("time is required.");var X=this._availability;return!Dn.defined(X)||X.contains(J)}),j.add(this._primitive),this._core.getWMTSData({url:f.url,layer:f.layer,srs:f.srs||"EPSG:4490",gisserverTMS:M},J=>{w.item.boundingSphere=J.boundingSphere,w.TileMatrixLimits=J.TileMatrixLimits,w.initThisProvider()}),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var q={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=m.id,this.setTreeobj(q),this._tree.insertGroupId(q,this._core.isnull(v)?0:v),this};Vf.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this,A=m.material,E={Name:"",text:"",font:" 30px sans-serif",style:w._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:w._cesium.Color.WHITE,outlineColor:w._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new w._cesium.Color(.165,.165,.165,.8),backgroundPadding:new w._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:w._cesium.HorizontalOrigin.CENTER,verticalOrigin:w._cesium.VerticalOrigin.CENTER,eyeOffset:w._cesium.Cartesian3.ZERO,pixelOffset:w._cesium.Cartesian2.ZERO,heightReference:w._cesium.HeightReference.NONE,scaleByDistance:new w._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0};this._urlTemplate=f.url+"?"+this._core._serialize(C.urlParams);var T=f.url+"?"+this._core._serialize(C.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=21,this._Provider._minimumHeight=parseFloat(m.height)||0,this._Provider.loadTile=function(P,D){if(D.state===Dn.QuadtreeTileLoadState.START){if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&w.item.show){var L=T.replace(window.encodeURIComponent("{x}"),D.x).replace(window.encodeURIComponent("{y}"),D.y).replace(window.encodeURIComponent("{z}"),D.level);w._cache&&(L+="&"+w._core.getuid()),w._core.xhr({url:L,type:"get",dataType:"json",success:function(R){if(R==null){D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0;return}var O=w._core.extend(E,m,!0);O.font=m.font;var F,k,U;O.image&&!O.text?k=new w._cesium.BillboardCollection({scene:w._viewer.scene}):!O.image&&O.text?F=new w._cesium.LabelCollection({scene:w._viewer.scene}):O.image&&O.text?(F=new w._cesium.LabelCollection({scene:w._viewer.scene}),k=new w._cesium.BillboardCollection({scene:w._viewer.scene}),U=new w._cesium.PrimitiveCollection,U.add(F),U.add(k)):F=new w._cesium.LabelCollection({scene:w._viewer.scene}),R.features.forEach(function(G){O.id=G;var j=O.pointHeight;if(/^\[/.test(j)&&/\]$/.test(j)){var q=j.replace(/\[/,"").replace(/\]/,"");j=parseFloat(G.properties[q])}else j!=null&&j!=""?j=parseFloat(j):G.properties.height!=null&&(j=parseFloat(G.properties.height));if(O.position=new w._cesium.Cartesian3.fromDegrees(G.geometry.coordinates[0],G.geometry.coordinates[1],j),m.fillColor){if(/^\[/.test(m.fillColor)&&/\]$/.test(m.fillColor)){var J=m.fillColor.replace(/\[/,"").replace(/\]/,"");O.fillColor=G.properties[J]}w._core.isHtmlColor(O.fillColor)?O.fillColor=w._color.colorFromHtmlColor(O.fillColor):(/^rgb/.test(O.fillColor)&&(O.fillColor=w._color.rgbaStringToRgbaObj(O.fillColor)),O.fillColor.r>1&&(O.fillColor.r=O.fillColor.r/255),O.fillColor.g>1&&(O.fillColor.g=O.fillColor.g/255),O.fillColor.b>1&&(O.fillColor.b=O.fillColor.b/255),O.fillColor.a>1&&(O.fillColor.a=O.fillColor.a/255),O.fillColor=w._color.createColor(O.fillColor.r,O.fillColor.g,O.fillColor.b,O.fillColor.a))}else if(m.fillColor&&m.fillColor.Class instanceof Array)for(var X=0;X<m.fillColor.Class.length;X++){var Y=m.fillColor.Class[X],Q=Y.Condition.replace("<","").replace(">","").split("=");if(Q[0]=Q[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),Q[1]=Q[1].replace(/\"/,"").replace(/\"/,""),G.properties[Q[0]]==Q[1]){O.fillColor=Y.Value,w._core.isHtmlColor(O.fillColor)?O.fillColor=w._color.colorFromHtmlColor(O.fillColor):(/^rgb/.test(O.fillColor)&&(O.fillColor=w._color.rgbaStringToRgbaObj(O.fillColor)),O.fillColor.r>1&&(O.fillColor.r=O.fillColor.r/255),O.fillColor.g>1&&(O.fillColor.g=O.fillColor.g/255),O.fillColor.b>1&&(O.fillColor.b=O.fillColor.b/255),O.fillColor.a>1&&(O.fillColor.a=O.fillColor.a/255),O.fillColor=w._color.createColor(O.fillColor.r,O.fillColor.g,O.fillColor.b,O.fillColor.a));break}}else m.fillColor&&m.fillColor.Class.toString()!="{}"?(O.fillColor=m.fillColor.Value,w._core.isHtmlColor(O.fillColor)?O.fillColor=w._color.colorFromHtmlColor(O.fillColor):(/^rgb/.test(O.fillColor)&&(O.fillColor=w._color.rgbaStringToRgbaObj(O.fillColor)),O.fillColor.r>1&&(O.fillColor.r=O.fillColor.r/255),O.fillColor.g>1&&(O.fillColor.g=O.fillColor.g/255),O.fillColor.b>1&&(O.fillColor.b=O.fillColor.b/255),O.fillColor.a>1&&(O.fillColor.a=O.fillColor.a/255),O.fillColor=w._color.createColor(O.fillColor.r,O.fillColor.g,O.fillColor.b,O.fillColor.a))):style.fillColor&&style.fillColor.toString()!="{}"&&(O.fillColor=m.fillColor.Value,w._core.isHtmlColor(O.fillColor)?O.fillColor=w._color.colorFromHtmlColor(O.fillColor):(/^rgb/.test(O.fillColor)&&(O.fillColor=w._color.rgbaStringToRgbaObj(O.fillColor)),O.fillColor.r>1&&(O.fillColor.r=O.fillColor.r/255),O.fillColor.g>1&&(O.fillColor.g=O.fillColor.g/255),O.fillColor.b>1&&(O.fillColor.b=O.fillColor.b/255),O.fillColor.a>1&&(O.fillColor.a=O.fillColor.a/255),O.fillColor=w._color.createColor(O.fillColor.r,O.fillColor.g,O.fillColor.b,O.fillColor.a)));if(m.outlineColor){if(/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)){var J=m.outlineColor.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");O.outlineColor=G.properties[J],w._core.isHtmlColor(O.outlineColor)?O.outlineColor=w._color.colorFromHtmlColor(O.outlineColor):(/^rgb/.test(O.outlineColor)&&(O.outlineColor=w._color.rgbaStringToRgbaObj(O.outlineColor)),O.outlineColor.r>1&&(O.outlineColor.r=O.outlineColor.r/255),O.outlineColor.g>1&&(O.outlineColor.g=O.outlineColor.g/255),O.outlineColor.b>1&&(O.outlineColor.b=O.outlineColor.b/255),O.outlineColor.a>1&&(O.outlineColor.a=O.outlineColor.a/255),O.outlineColor=w._color.createColor(O.outlineColor.r,O.outlineColor.g,O.outlineColor.b,O.outlineColor.a))}}else if(m.outlineColor&&m.outlineColor.Class instanceof Array)for(var X=0;X<m.fillColor.Class.length;X++){var Y=m.fillColor.Class[X],Q=Y.Condition.replace("<","").replace(">","").split("=");if(Q[0]=Q[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),Q[1]=Q[1].replace(/\"/,"").replace(/\"/,""),G.properties[Q[0]]==Q[1]){O.outlineColor=Q.Value,w._core.isHtmlColor(O.outlineColor)?O.outlineColor=w._color.colorFromHtmlColor(O.outlineColor):(/^rgb/.test(O.outlineColor)&&(O.outlineColor=w._color.rgbaStringToRgbaObj(O.outlineColor)),O.outlineColor.r>1&&(O.outlineColor.r=O.outlineColor.r/255),O.outlineColor.g>1&&(O.outlineColor.g=O.outlineColor.g/255),O.outlineColor.b>1&&(O.outlineColor.b=O.outlineColor.b/255),O.outlineColor.a>1&&(O.outlineColor.a=O.outlineColor.a/255),O.outlineColor=w._color.createColor(O.outlineColor.r,O.outlineColor.g,O.outlineColor.b,O.outlineColor.a));break}}else m.outlineColor&&m.outlineColor.Class.toString()!="{}"?(O.outlineColor=m.outlineColor.Value,w._core.isHtmlColor(O.outlineColor)?O.outlineColor=w._color.colorFromHtmlColor(O.outlineColor):(/^rgb/.test(O.outlineColor)&&(O.outlineColor=w._color.rgbaStringToRgbaObj(O.outlineColor)),O.outlineColor.r>1&&(O.outlineColor.r=O.outlineColor.r/255),O.outlineColor.g>1&&(O.outlineColor.g=O.outlineColor.g/255),O.outlineColor.b>1&&(O.outlineColor.b=O.outlineColor.b/255),O.outlineColor.a>1&&(O.outlineColor.a=O.outlineColor.a/255),O.outlineColor=w._color.createColor(O.outlineColor.r,O.outlineColor.g,O.outlineColor.b,O.outlineColor.a))):m.outlineColorTe&&m.outlineColor.toString()!="{}"&&(O.outlineColor=m.outlineColor.Value,w._core.isHtmlColor(O.outlineColor)?O.outlineColor=w._color.colorFromHtmlColor(O.outlineColor):(/^rgb/.test(O.outlineColor)&&(O.outlineColor=w._color.rgbaStringToRgbaObj(O.outlineColor)),O.outlineColor.r>1&&(O.outlineColor.r=O.outlineColor.r/255),O.outlineColor.g>1&&(O.outlineColor.g=O.outlineColor.g/255),O.outlineColor.b>1&&(O.outlineColor.b=O.outlineColor.b/255),O.outlineColor.a>1&&(O.outlineColor.a=O.outlineColor.a/255),O.outlineColor=w._color.createColor(O.outlineColor.r,O.outlineColor.g,O.outlineColor.b,O.outlineColor.a)));if(m.backgroundColor){if(/^\[/.test(m.backgroundColor)&&/\]$/.test(m.backgroundColor)){var J=m.backgroundColor.replace(/\[/,"").replace(/\]/,"");O.backgroundColor=G.properties[J],w._core.isHtmlColor(O.backgroundColor)?O.backgroundColor=w._color.colorFromHtmlColor(O.backgroundColor):(/^rgb/.test(O.backgroundColor)&&(O.backgroundColor=w._color.rgbaStringToRgbaObj(O.backgroundColor)),O.backgroundColor.r>1&&(O.backgroundColor.r=O.backgroundColor.r/255),O.backgroundColor.g>1&&(O.backgroundColor.g=O.backgroundColor.g/255),O.backgroundColor.b>1&&(O.backgroundColor.b=O.backgroundColor.b/255),O.backgroundColor.a>1&&(O.backgroundColor.a=O.backgroundColor.a/255),O.backgroundColor=w._color.createColor(O.backgroundColor.r,O.backgroundColor.g,O.backgroundColor.b,O.backgroundColor.a))}}else if(m.backgroundColor&&m.backgroundColor.Class instanceof Array)for(var X=0;X<m.backgroundColor.Class.length;X++){var Y=m.backgroundColor.Class[X],Q=Y.Condition.replace("<","").replace(">","").split("=");if(Q[0]=Q[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),Q[1]=Q[1].replace(/\"/,"").replace(/\"/,""),G.properties[Q[0]]==Q[1]){O.backgroundColor=getSGColor(Q.Value),w._core.isHtmlColor(O.backgroundColor)?O.backgroundColor=w._color.colorFromHtmlColor(O.backgroundColor):(/^rgb/.test(O.backgroundColor)&&(O.backgroundColor=w._color.rgbaStringToRgbaObj(O.backgroundColor)),O.backgroundColor.r>1&&(O.backgroundColor.r=O.backgroundColor.r/255),O.backgroundColor.g>1&&(O.backgroundColor.g=O.backgroundColor.g/255),O.backgroundColor.b>1&&(O.backgroundColor.b=O.backgroundColor.b/255),O.backgroundColor.a>1&&(O.backgroundColor.a=O.backgroundColor.a/255),O.backgroundColor=w._color.createColor(O.backgroundColor.r,O.backgroundColor.g,O.backgroundColor.b,O.backgroundColor.a));break}}else m.backgroundColor&&m.backgroundColor.Class.toString()!="{}"?(O.backgroundColor=getSGColor(m.backgroundColor.Value),w._core.isHtmlColor(O.backgroundColor)?O.backgroundColor=w._color.colorFromHtmlColor(O.backgroundColor):(/^rgb/.test(O.backgroundColor)&&(O.backgroundColor=w._color.rgbaStringToRgbaObj(O.backgroundColor)),O.backgroundColor.r>1&&(O.backgroundColor.r=O.backgroundColor.r/255),O.backgroundColor.g>1&&(O.backgroundColor.g=O.backgroundColor.g/255),O.backgroundColor.b>1&&(O.backgroundColor.b=O.backgroundColor.b/255),O.backgroundColor.a>1&&(O.backgroundColor.a=O.backgroundColor.a/255),O.backgroundColor=w._color.createColor(O.backgroundColor.r,O.backgroundColor.g,O.backgroundColor.b,O.backgroundColor.a))):m.backgroundColor&&m.backgroundColor.toString()!="{}"&&(O.backgroundColor=m.backgroundColor.Value,w._core.isHtmlColor(O.backgroundColor)?O.backgroundColor=w._color.colorFromHtmlColor(O.backgroundColor):(/^rgb/.test(O.backgroundColor)&&(O.backgroundColor=w._color.rgbaStringToRgbaObj(O.backgroundColor)),O.backgroundColor.r>1&&(O.backgroundColor.r=O.backgroundColor.r/255),O.backgroundColor.g>1&&(O.backgroundColor.g=O.backgroundColor.g/255),O.backgroundColor.b>1&&(O.backgroundColor.b=O.backgroundColor.b/255),O.backgroundColor.a>1&&(O.backgroundColor.a=O.backgroundColor.a/255),O.backgroundColor=w._color.createColor(O.backgroundColor.r,O.backgroundColor.g,O.backgroundColor.b,O.backgroundColor.a)));if(m.scale){if(/^\[/.test(m.scale)&&/\]$/.test(m.scale)){var J=m.scale.replace(/\[/,"").replace(/\]/,"");O.scale=G.properties[J]}}else if(m.scale&&m.scale.Class instanceof Array)for(var X=0;X<m.scale.Class.length;X++){var Y=m.scale.Class[X],Q=Y.Condition.replace("<","").replace(">","").split("=");Q[0]=Q[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),Q[1]=Q[1].replace(/\"/,"").replace(/\"/,""),G.properties[Q[0]]==Q[1]&&(O.scale=Y.Value)}else m.scale&&m.scale.Class.toString()!="{}"?O.scale=m.scale.Value:m.scale&&m.scale.toString()!="[object Object]"&&m.scale.toString()!="{}"&&(O.scale=m.scale);if(/^\[/.test(m.text)&&/\]$/.test(m.text)||m.textTe)if(m.textTe)if(m.text.Class instanceof Object){var ee=m.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");O.text=G.properties[ee]}else if(m.text&&m.text.Class&&m.text.Class.toString()!="{}"){var J=m.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");O.text=G.properties[J]}else{var J=m.text.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");O.text=G.properties[J]}else if(m.text&&m.text.toString()!="[object Object]"&&m.text.toString()!="{}")O.text=m.text;else{var J=m.text.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");O.text=G.properties[J]}else m.text&&m.text.toString()!="[object Object]"&&m.text.toString()!="{}"&&(O.text=m.text);if(O.labelData&&(O=w._core.extend(O,O.labelData,!0)),O.verticalOrigin=Dn.VerticalOrigin.CENTER,O.horizontalOrigin=Dn.HorizontalOrigin.LEFT,F&&F.add(O),m.image&&m.image.Class instanceof Array)for(var X=0;X<m.image.Class.length;X++){var Y=m.image.Class[X],Q=Y.Condition.replace("<","").replace(">","").split("=");if(Q[0]=Q[0].replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,""),Q[1]=Q[1].replace(/\"/,"").replace(/\"/,""),G.properties[Q[0]]==Q[1]){O.image=Y.Value;break}}else if(m.image&&m.image.Class&&m.image.Class.toString()!="{}"){var J=m.image.Class.Value.replace(/\[/,"").replace(/\]/,"").replace(/\"/,"").replace(/\"/,"");O.image=G.properties[J]}else m.image&&m.image.toString()!="[object Object]"&&m.image.toString()!="{}"&&(O.image=m.image);var z=Ji.cloneDeep(O);z.verticalOrigin=Dn.VerticalOrigin.CENTER,z.horizontalOrigin=Dn.HorizontalOrigin.RIGHT,k&&k.add(z)}),R.features.length==0&&(D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0),U?D.data.geometryPrimitive=U:k?D.data.geometryPrimitive=k:D.data.geometryPrimitive=F,D.state===Dn.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive.update(P,[]),D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0)},error:function(){D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0}})}else{D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0;return}D.state=Dn.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;m&&m.time&&(this._Provider._availability=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:m.time.start?w._cesium.JulianDate.fromDate(new Date(m.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?w._cesium.JulianDate.fromDate(new Date(m.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(P){if(!Dn.defined(P))throw new Dn.DeveloperError("time is required.");var D=this._availability;return!Dn.defined(D)||D.contains(P)}),M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=m.id,this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Vf.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this,A=m.material,E={show:!0,position:w._cesium.Cartesian3.ZERO,pixelOffset:w._cesium.Cartesian2.ZERO,eyeOffset:w._cesium.Cartesian3.ZERO,heightReference:w._cesium.HeightReference.NONE,horizontalOrigin:w._cesium.HorizontalOrigin.CENTER,verticalOrigin:w._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:w._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:w._cesium.Cartesian3.ZERO,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};m.width&&(E.width=m.width),m.height&&(E.height=m.height),m.image&&(E.image=m.image),this._urlTemplate=f.url+"?"+this._core._serialize(C.urlParams);var T=f.url+"?"+this._core._serialize(C.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height)||0,this._Provider.loadTile=function(P,D){if(D.state===Dn.QuadtreeTileLoadState.START){if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<=m.level_max&&w.item.show){var L=T.replace(window.encodeURIComponent("{x}"),D.x).replace(window.encodeURIComponent("{y}"),D.y).replace(window.encodeURIComponent("{z}"),D.level);w._cache&&(L+="&"+w._core.getuid()),w._core.xhr({url:L,type:"get",dataType:"json",success:function(R){if(R==null){D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0;return}var O;if(D.level==parseInt(m.level_max)-1)typeof initSXTData=="function"&&(O=initSXTData(R));else{O=new Dn.BillboardCollection;for(var F of R.features){var k=F.geometry.coordinates[0],U=F.geometry.coordinates[1],G=m.pointHeight?parseFloat(m.pointHeight):0;E.position=Dn.Cartesian3.fromDegrees(k,U,G),O.add(E)}}R.features.length==0&&(D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0),D.data.geometryPrimitive=O,D.state=Dn.QuadtreeTileLoadState.LOADING,D.state===Dn.QuadtreeTileLoadState.LOADING&&typeof D.data.geometryPrimitive.update=="function"?(D.data.geometryPrimitive.update(P,[]),D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0):(D.data.geometryPrimitive.destroy=function(){},D.data.geometryPrimitive.update=function(){})},error:function(){D.count==null&&(D.count=0),D.count+=1,D.count>=2?(D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0):D.state=Dn.QuadtreeTileLoadState.START}})}else{D.state=Dn.QuadtreeTileLoadState.DONE,D.renderable=!0;return}D.state=Dn.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;m&&m.time&&(this._Provider._availability=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:m.time.start?w._cesium.JulianDate.fromDate(new Date(m.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?w._cesium.JulianDate.fromDate(new Date(m.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(P){if(!Dn.defined(P))throw new Dn.DeveloperError("time is required.");var D=this._availability;return!Dn.defined(D)||D.contains(P)}),M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Vf.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x,C){var w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},A=this,E=m.material,T={show:!0,position:A._cesium.Cartesian3.ZERO,pixelOffset:A._cesium.Cartesian2.ZERO,eyeOffset:A._cesium.Cartesian3.ZERO,heightReference:A._cesium.HeightReference.NONE,horizontalOrigin:A._cesium.HorizontalOrigin.CENTER,verticalOrigin:A._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:A._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:A._cesium.Cartesian3.ZERO,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0};m.width&&(T.width=m.width),m.height&&(T.height=m.height),m.image&&(T.image=m.image),this._urlTemplate=f.url+"?"+this._core._serialize(w.urlParams);var S=f.url+"?"+this._core._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height)||0,this._Provider.loadTile=function(D,L){if(L.state===Dn.QuadtreeTileLoadState.START){if(L.data={lines:[],geometryPrimitive:void 0},L.level>=m.level_min&&L.level<=m.level_max&&A.item.show){var R=S.replace(window.encodeURIComponent("{x}"),L.x).replace(window.encodeURIComponent("{y}"),L.y).replace(window.encodeURIComponent("{z}"),L.level);A._cache&&(R+="&"+A._core.getuid()),A._core.xhr({url:R,type:"get",dataType:"json",success:function(O){if(O==null){L.state=Dn.QuadtreeTileLoadState.DONE,L.renderable=!0;return}var F;typeof x=="function"&&(F=x(O)),O.features.length==0&&(L.state=Dn.QuadtreeTileLoadState.DONE,L.renderable=!0),L.data.geometryPrimitive=F,L.state=Dn.QuadtreeTileLoadState.LOADING,L.state===Dn.QuadtreeTileLoadState.LOADING&&typeof L.data.geometryPrimitive.update=="function"?(L.data.geometryPrimitive.update(D,[]),L.state=Dn.QuadtreeTileLoadState.DONE,L.renderable=!0):(L.data.geometryPrimitive.destroy=function(){},L.data.geometryPrimitive.update=function(){})},error:function(){L.count==null&&(L.count=0),L.count+=1,L.count>=2?(L.state=Dn.QuadtreeTileLoadState.DONE,L.renderable=!0):L.state=Dn.QuadtreeTileLoadState.START}})}else{L.state=Dn.QuadtreeTileLoadState.DONE,L.renderable=!0;return}L.state=Dn.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var M=this._viewer.scene,I=M.primitives;m&&m.time&&(this._Provider._availability=new A._cesium.TimeIntervalCollection([new A._cesium.TimeInterval({start:m.time.start?A._cesium.JulianDate.fromDate(new Date(m.time.start)):A._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?A._cesium.JulianDate.fromDate(new Date(m.time.end)):A._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(D){if(!Dn.defined(D))throw new Dn.DeveloperError("time is required.");var L=this._availability;return!Dn.defined(L)||L.contains(D)}),I.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var P={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:C}};return this.setTreeobj(P),this._tree.insertGroupId(P,this._core.isnull(v)?0:v),typeof C=="function"&&C(this.item),this};Vf.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){f==null&&console.log("geojson is required");var C=this._cesium.GeoJsonDataSource.load(f);this._viewer.dataSources.add(C);var w=this,A=new this._cesium.PointPrimitiveCollection;w.optiontext=[],C.then(function(T){w.item=T;for(var S=T.entities.values,M=0;M<S.length;M++){var I=S[M],P;if(/^\[/.test(m.text)&&/\]$/.test(m.text)){var D=m.text.replace(/\[/,"").replace(/\]/,"");P=I.properties[D]._value}else P=m.text;w.optiontext.push(P),I.billboard=void 0;var L=w._viewer.scene.globe.ellipsoid,R=w._cesium.Cartographic.fromCartesian(I.position._value),O=w._cesium.Math.toDegrees(R.longitude),F=w._cesium.Math.toDegrees(R.latitude),k=m.pointHeight||0||R.height,U=[O,F,k],G=w._core.getuid(),j;U instanceof Array?U.length===2?j=w._cesium.Cartesian3.fromDegrees(U[0],U[1]):U.length===3&&(j=w._cesium.Cartesian3.fromDegrees(U[0],U[1],U[2])):U.z?j=w._cesium.Cartesian3.fromDegrees(U.x,U.y,U.z):j=w._cesium.Cartesian3.fromDegrees(U.x,U.y);var q="DivPoint"+G;A.add({id:q,position:j,color:w._cesium.Color.YELLOW,description:m.text})}var J;m&&m.time&&(J=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:m.time.start?w._cesium.JulianDate.fromDate(new Date(m.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?w._cesium.JulianDate.fromDate(new Date(m.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})])),w.item=A,w.pointPrimitive=w._viewer.scene.primitives.add(A,J);var X=!0,Y,Q,ee,z;w.pointPrimitive.update=function(){for(var ie=0,re,ne;ie<w.pointPrimitive.length;ie++){if(re=w.pointPrimitive.get(ie),z=re.position,ee=w._viewer.scene.cartesianToCanvasCoordinates(z),!ee)return;Q=document.getElementById(re.id),Q||(ne='<div id="'+re.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+pn.divpoint1+`);transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;"> <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">`+w.optiontext[ie]+`</div> </div>`,$(".cesium-viewer").append(ne),Q=document.getElementById(re.id)),re.description?Q.style.transform="matrix(1, 0, 0, 1, "+ee.x+", "+(ee.y-157)+")":Q.style.transform="matrix(1, 0, 0, 1, "+ee.x+", "+(ee.y-134)+")",Q&&(Q.style.display=w.pointPrimitive.show?"block":"none")}X&&(y||w.setVisibility(!1),X=!1)},typeof x=="function"&&x(T)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u5BCC\u6587\u672C");var E={id:m.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"DivPoint",item:this,url:f,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};Vf.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this,A=new Ah(this._viewer,this._cesium,C);this._Provider=A,A._loadTile=function(T){var S=new w._cesium.PointPrimitiveCollection;w.optiontext=[],T.features.forEach(function(R){var O=options.pointHeight;if(R.properties.height!=null&&(O=parseFloat(R.properties.height)+O),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)){var F=options.pointHeight.replace(/\[/,"").replace(/\]/,"");O=parseFloat(R.properties[F])}if(m.position=new w._cesium.Cartesian3.fromDegrees(R.geometry.coordinates[0],R.geometry.coordinates[1],O),/^\[/.test(m.text)&&/\]$/.test(m.text)){var k=m.text.replace(/\[/,"").replace(/\]/,"");m.text=R.properties[k]}var U=w._core.getuid(),G="DivPoint"+U;S.add({id:G,position:Cartesian3,color:w._cesium.Color.YELLOW,description:m.text}),w.optiontext.push(option.text)}),w.pointPrimitive=w._viewer.scene.primitives.add(S);var M,I,P,D,L=!0;return w.pointPrimitive.update=function(){for(var R=0,O,F;R<w.pointPrimitive.length;R++){if(O=w.pointPrimitive.get(R),D=O.position,P=w._viewer.scene.cartesianToCanvasCoordinates(D),!P)return;I=document.getElementById(O.id),I||(F='<div id="'+O.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+pn.divpoint1+`);transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;"> <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">`+w.optiontext[R]+`</div> </div>`,$(".cesium-viewer").append(F),I=document.getElementById(O.id)),O.description?I.style.transform="matrix(1, 0, 0, 1, "+P.x+", "+(P.y-157)+")":I.style.transform="matrix(1, 0, 0, 1, "+P.x+", "+(P.y-134)+")"}L&&(y||w.setVisibility(!1),L=!1)},w.item=S,""},A.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u5BCC\u6587\u672C"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"DivPoint",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Vf.prototype.createModelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium},w=this,A=m.material;!w._core.isnull(m)&&!w._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(w._core.isHtmlColor(m.color)?m.color=w._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=w._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=w._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),this._urlTemplate=f.url+"?"+this._core._serialize(C.urlParams);var E=f.url+"?"+this._core._serialize(C.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height)||0,this._Provider.loadTile=function(I,P){if(P.state===Dn.QuadtreeTileLoadState.START){if(P.data={lines:[],geometryPrimitive:void 0},P.level>=m.level_min&&P.level<m.level_max&&w.item.show){var D=E.replace(window.encodeURIComponent("{x}"),P.x).replace(window.encodeURIComponent("{y}"),P.y).replace(window.encodeURIComponent("{z}"),P.level);w._cache&&(D+="&"+w._core.getuid()),w._core.xhr({url:D,type:"get",dataType:"json",success:function(L){if(L==null){P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0;return}var R={url:"",modelMatrix:w._cesium.Transforms.eastNorthUpToFixedFrame(origin),color:w._cesium.Color.DARKSALMON,scale:2},O=w._core.extend(R,m,!0);w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var F=parseFloat(m.near),k=parseFloat(m.far),U=new w._cesium.DistanceDisplayCondition(F,k);O.distanceDisplayCondition=U;var G=new w._cesium.PrimitiveCollection;L.features.forEach(function(j){O.id=j;var q=O.height;if(j.properties.height!=null&&(q=parseFloat(j.properties.height)),/^\[/.test(O.height)&&/\]$/.test(O.height)){var J=O.height.replace(/\[/,"").replace(/\]/,"");q=parseFloat(j.properties[J])}O.modelMatrix=w._cesium.Transforms.eastNorthUpToFixedFrame(w._cesium.Cartesian3.fromDegrees(j.geometry.coordinates[0],j.geometry.coordinates[1],q));var X=w._cesium.Model.fromGltf({id:j,url:O.uri,color:O.color,modelMatrix:O.modelMatrix,scale:O.scale,heightReference:parseInt(O.heightReference),distanceDisplayCondition:O.distanceDisplayCondition});G.add(X)}),L.features.length==0&&(P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0),P.data.geometryPrimitive=G,P.state=Dn.QuadtreeTileLoadState.LOADING,P.state===Dn.QuadtreeTileLoadState.LOADING&&(P.data.geometryPrimitive.update(I,[]),P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0)},error:function(){P.count==null&&(P.count=0),P.count+=1,P.count>=2?(P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0):P.state=Dn.QuadtreeTileLoadState.START}})}else{P.state=Dn.QuadtreeTileLoadState.DONE,P.renderable=!0;return}P.state=Dn.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var T=this._viewer.scene,S=T.primitives;S.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var M={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Vf.prototype.createPointGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this;!w._core.isnull(m)&&!w._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(w._core.isHtmlColor(m.color)?m.color=w._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=w._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=w._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),!w._core.isnull(m)&&!w._core.isnull(m.outlineColor)&&(/^\[/.test(m.outlineColor)&&m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(w._core.isHtmlColor(m.outlineColor)?m.outlineColor=w._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=w._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=w._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),this._urlTemplate=f.url+"?"+this._core._serialize(C.urlParams);var A=f.url+"?"+this._core._serialize(C.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height)||0,this._Provider.loadTile=function(M,I){if(I.state===Dn.QuadtreeTileLoadState.START){if(I.data={lines:[],geometryPrimitive:void 0},I.level>=m.level_min&&I.level<m.level_max&&w.item.show){var P=A.replace(window.encodeURIComponent("{x}"),I.x).replace(window.encodeURIComponent("{y}"),I.y).replace(window.encodeURIComponent("{z}"),I.level);w._cache&&(P+="&"+w._core.getuid()),w._core.xhr({url:P,type:"get",dataType:"json",success:function(D){if(D==null){I.state=Dn.QuadtreeTileLoadState.DONE,I.renderable=!0;return}var L={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:w._cesium.LabelStyle.OUTLINE,fillColor:w._cesium.Color.WHITE,outlineColor:w._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new w._cesium.Color(.165,.165,.165,.8),backgroundPadding:new w._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:w._cesium.HorizontalOrigin.CENTER,verticalOrigin:w._cesium.VerticalOrigin.CENTER,eyeOffset:w._cesium.Cartesian3.ZERO,pixelOffset:w._cesium.Cartesian2.ZERO,heightReference:w._cesium.HeightReference.NONE,scaleByDistance:new w._cesium.NearFarScalar(0,0,1,1)},R=m.material;!w._core.isnull(m)&&!w._core.isnull(m.backgroundColor)&&(/^\[/.test(m.backgroundColor)&&m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(w._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=w._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=w._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=w._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))));var O=w._core.extend(L,m,!0);w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var F=parseFloat(m.near),k=parseFloat(m.far),U=new w._cesium.DistanceDisplayCondition(F,k);O.distanceDisplayCondition=U,w._core.isnull(m.font_size)&&(m.font_size="30px"),w._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),O.font=parseFloat(m.font_size)+"px "+m.font_family;var G=new w._cesium.PointPrimitiveCollection;D.features.forEach(function(j){O.id=j;var q=0;if(/^\[/.test(O.pointHeight)&&/\]$/.test(O.pointHeight)){var J=O.pointHeight.replace(/\[/,"").replace(/\]/,"");q=parseFloat(j.properties[J])}else O.pointHeight!==void 0&&O.pointHeight!==""?q=parseFloat(O.pointHeight):j.properties.height!=null&&(q=parseFloat(j.properties.height));if(/^\[/.test(m.color)&&/\]$/.test(m.color)){var X=m.color.replace(/\[/,"").replace(/\]/,"");O.color=j.properties[X],w._core.isHtmlColor(O.color)?O.color=w._color.colorFromHtmlColor(O.color):(/^rgb/.test(O.color)&&(O.color=w._color.rgbaStringToRgbaObj(O.color)),O.color.r>1&&(O.color.r=O.color.r/255),O.color.g>1&&(O.color.g=O.color.g/255),O.color.b>1&&(O.color.b=O.color.b/255),O.color.a>1&&(O.color.a=O.color.a/255),O.color=w._color.createColor(O.color.r,O.color.g,O.color.b,O.color.a))}if(/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)){var X=m.outlineColor.replace(/\[/,"").replace(/\]/,"");O.outlineColor=j.properties[X],w._core.isHtmlColor(O.outlineColor)?O.outlineColor=w._color.colorFromHtmlColor(O.outlineColor):(/^rgb/.test(O.outlineColor)&&(O.outlineColor=w._color.rgbaStringToRgbaObj(O.outlineColor)),O.outlineColor.r>1&&(O.outlineColor.r=O.outlineColor.r/255),O.outlineColor.g>1&&(O.outlineColor.g=O.outlineColor.g/255),O.outlineColor.b>1&&(O.outlineColor.b=O.outlineColor.b/255),O.outlineColor.a>1&&(O.outlineColor.a=O.outlineColor.a/255),O.outlineColor=w._color.createColor(O.outlineColor.r,O.outlineColor.g,O.outlineColor.b,O.outlineColor.a))}O.position=new w._cesium.Cartesian3.fromDegrees(j.geometry.coordinates[0],j.geometry.coordinates[1],q),O.text=j.properties.name;var Y={show:O.show,position:O.position,pixelSize:O.pixelSize,color:O.color,outlineColor:O.outlineColor,outlineWidth:O.outlineWidth,id:j},Q="color:"+O.color.red*255+","+O.color.green*255+","+O.color.blue*255+";outlineColor:"+O.outlineColor.red*255+","+O.outlineColor.green*255+","+O.outlineColor.blue*255;w.Legend.push(Q),G.add(Y)}),D.features.length==0&&(I.state=Dn.QuadtreeTileLoadState.DONE,I.renderable=!0),I.data.geometryPrimitive=G,I.state=Dn.QuadtreeTileLoadState.LOADING,I.state===Dn.QuadtreeTileLoadState.LOADING&&(I.data.geometryPrimitive.update(M,[]),I.state=Dn.QuadtreeTileLoadState.DONE,I.renderable=!0)},error:function(){I.count==null&&(I.count=0),I.count+=1,I.count>=2?(I.state=Dn.QuadtreeTileLoadState.DONE,I.renderable=!0):I.state=Dn.QuadtreeTileLoadState.START}})}else{I.state=Dn.QuadtreeTileLoadState.DONE,I.renderable=!0;return}I.state=Dn.QuadtreeTileLoadState.LOADING}},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var E=this._viewer.scene,T=E.primitives;T.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Vf.prototype.setTreeobj=function(o){this.treeobj=o};Vf.prototype.getLegend=function(){var o=[];return this.Legend!=null&&(o=this._core.unique(this.Legend)),o};Vf.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.probj&&this.probj.length>0&&(this._viewer.scene.primitives.remove(this.probj[0]),this.probj.pop()),this.img!=null&&this._viewer.imageryLayers.remove(this.img),this.primitve&&this.primitve.length>0){for(var o=0;o<this.primitve.length;o++)this._viewer.scene.primitives.remove(this.primitve[o]);this.primitve=[]}this.loadAllKey&&this.loadAllKey.length>0&&(this.loadAllKey=[]);try{this._Provider.remove()}catch{}if(this._Provider!=null&&this._Provider.setStatus(!1),this.items!=null&&this.items!=null&&this.items.length>0)for(var o=0;o<this.items.length;o++)this._viewer.scene.primitives.remove(this.items[o]);else this._viewer.scene.primitives.remove(this.item);if(this.treeobj&&this.treeobj.type==="DivPoint"&&this.item&&this.item._pointPrimitives!=null&&this.item._pointPrimitives!=null)for(var o=0;o<this.item._pointPrimitives.length;o++){var f=document.getElementById(this.item._pointPrimitives[o].id);f&&f.remove()}try{this._Provider.remove()}catch{}};Vf.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f},treeData:this.treeobj.treeData}};Vf.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(!o)}catch{}};Vf.prototype.setVisibility=function(o){try{if(this.loadAllKey=[],this.item!=null&&this.item.show!=null&&(this.item.show=o),this.img!=null&&(this.img.show=o),this.primitve&&this.primitve.length>0)for(var f=0;f<this.primitve.length;f++)this.primitve[f].show=o;if(this._Provider&&this._Provider.setStatus&&this._Provider._state!==void 0&&this._Provider.setStatus(o),this._Provider&&this._Provider.EntityCollection&&(!o&&(this._Provider.EntityCollection.show=o),this._Provider.EntityCollection.isShow=o),this.probj&&this.probj.length>0)for(var f=0;f<this.probj.length;f++)this.probj[f].show=o}catch{}if(this.treeobj!=null&&this.treeobj.type==="DivPoint"&&this.item&&this.item._pointPrimitives!=null&&this.item._pointPrimitives!=null)for(var f=0;f<this.item._pointPrimitives.length;f++){var m=document.getElementById(this.item._pointPrimitives[f].id);m&&(m.style.display=o?"block":"none")}this.item!=null&&(this.item.show=o),this._Provider&&this._Provider._stop!==void 0&&this._Provider.setStatus(!o)};Vf.prototype.edit=function(o,f){return this.isEditting=o,this.editoption=f,this._Provider&&this._Provider.edit&&this._Provider.edit(o,f)};Vf.prototype.forceRefresh=function(){try{this._cache=!0,this._forceRefreshPrvimitive||(this._forceRefreshPrvimitive=Ji.cloneDeep(this._primitive));var o=Ji.cloneDeep(this._forceRefreshPrvimitive);this._viewer.scene.primitives.remove(this._primitive),this._viewer.scene.primitives.add(o),this.edit(this.isEditting,this.editoption)}catch{}};Object.defineProperties(Vf.prototype,{labelText:{set:Ji.debounce(function(o){var f=o;if(!this._core.isnull(o)){var m=this.item.entities&&this.item.entities.values;if(m&&m.length>0)for(var v=0;v<m.length;v++)if(/^\[/.test(o)&&(f=o.replace(/\[/,"").replace(/\]/,""),f=m[v].properties[f]._value),m[v].label){m[v].label.text=f;try{m[v].point.show=!1}catch{}}else{try{m[v].point.show=!1}catch{}m[v].label=new this._cesium.LabelGraphics({text:f,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.style=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.style}},labelFont:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)){var m=f[0].label.font,v=16;if(m&&(m=m._value.trimLeft().trimRight(),v=m.split("px")[0]),f&&f.length>0&&f[0].label)for(var y=0;y<f.length;y++)f[y].label.font=v+"px "+o}}},500)},labelFontSize1:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)){var m=f[0].label.font,v="sans-serif";if(m&&(m=m._value.trimLeft().trimRight(),v=m.split("px")[1]),f&&f.length>0&&f[0].label)for(var y=0;y<f.length;y++)f[y].label.font=o+"px "+v}}},500)},labelFontSize:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.font=o+"px sans-serif"}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return parseFloat(o[0].label.font)}},labelFillColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.fillColor=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.fillColor;return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}}},labelOutlineColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.outlineColor=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},labelOutlineWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].label.outlineWidth=o}},200),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.outlineWidth;return f?f._value:void 0}}},labelBackgroundColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.backgroundColor=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}}},labelBackground:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.showBackground=o},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.background}},labelScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].label.scale=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.scale;return f?f._value:void 0}}},labelHorizontalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.horizontalOrigin=parseInt(o)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.horizontalOrigin;return f?f._value:void 0}}},labelVerticalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.verticalOrigin=parseInt(o)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.verticalOrigin;return f?f._value:void 0}}},labelHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.heightReference=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.heightReference;return f?f._value:void 0}}},labelDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=f[0].label.distanceDisplayCondition?f[0].label.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,parseInt(o)),f[v].label.scaleByDistance=new this._cesium.NearFarScalar(m,1,parseInt(o),0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.distanceDisplayCondition?o[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},labelDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=f[0].label.distanceDisplayCondition?f[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(o),m),f[v].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(o),1,m,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.distanceDisplayCondition?o[0].label.distanceDisplayCondition._value.near:0;return f}}},labelHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},labelShow:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].label&&o?(f[m].point&&(f[m].point.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o),f[m].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(f[m].label&&(f[m].label.show=o),f[m].point&&(f[m].point.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.show}},modelShow:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)f[m].label&&(f[m].label.show=!o),f[m].point&&(f[m].point.show=!o),f[m].billboard&&(f[m].billboard.show=!o),!f[m].model&&o?f[m].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(f[m].model&&(f[m].model.show=o),f[m].label&&(f[m].label.show=!o),f[m].point&&(f[m].point.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)return o[0].model.show}},modelUri:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0)for(var m=0;m<f.length;m++)if(f[m].model)f[m].model.uri=o;else{if(/^\[/.test(o)){var v=o.split("[");v.length>1?o=v[0]+v[1].replace(/\[/,"").replace(/\]/,""):(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o])}f[m].model=new this._cesium.ModelGraphics({uri:o,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE})}}},500)},modelScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){o=parseFloat(o);var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].model.scale=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.scale;return f?f._value:void 0}}},modelShadows:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.shadows=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)return o[0].model.shadows}},modelHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.heightReference=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.heightReference;return f?f._value:void 0}}},modelDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=f[0].model.distanceDisplayCondition?f[0].model.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)var f=o[0].model.distanceDisplayCondition?o[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE}},modelDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=f[0].model.distanceDisplayCondition?f[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.distanceDisplayCondition?o[0].model.distanceDisplayCondition._value.near:0;return f}}},modelColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.color=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},modelLightColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.lightColor=o}},100),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},modelHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},pointColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.color=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},pointShow:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].point&&o?(f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o),f[m].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(f[m].point&&(f[m].point.show=o),f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point)return o[0].point.show}},pointPixelSize:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].point.pixelSize=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.pixelSize;return f?f._value:void 0}}},pointOutlineColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.outlineColor=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},pointOutlineWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].point.outlineWidth=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.outlineWidth;return f?f._value:void 0}}},pointHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.heightReference=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.heightReference;return f?f._value:void 0}}},pointDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=f[0].point.distanceDisplayCondition?f[0].point.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o),f[v].point.scaleByDistance=new this._cesium.NearFarScalar(m,1,o,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.distanceDisplayCondition?o[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},pointDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=f[0].point.distanceDisplayCondition?f[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m),f[v].point.scaleByDistance=new this._cesium.NearFarScalar(o,1,m,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.distanceDisplayCondition?o[0].point.distanceDisplayCondition._value.near:0;return f}}},pointHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},billboardShow:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].billboard&&o?(f[m].point&&(f[m].point.show=!o),f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(f[m].billboard&&(f[m].billboard.show=o),f[m].point&&(f[m].point.show=!o),f[m].label&&(f[m].label.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.show}},billboardImage:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0)for(var m=0;m<f.length;m++){if(/^\[/.test(o)){var v=o.split("[");v.length>1?o=v[0]+v[1].replace(/\[/,"").replace(/\]/,""):(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o])}f[m].billboard?f[m].billboard.image=o:f[m].billboard=new this._cesium.BillboardGraphics({image:o,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}}},500)},billboardScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.scale=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.scale;return f?f._value:void 0}}},billboardHorizontalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.horizontalOrigin=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.horizontalOrigin}},billboardVerticalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.verticalOrigin=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.verticalOrigin}},billboardWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.width=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.width;return f?f._value:void 0}}},billboardHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.height=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.height;return f?f._value:void 0}}},billboardColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.color=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},billboardHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].billboard.heightReference=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].model){var f=o[0].billboard.heightReference;return f?f._value:void 0}}},billboardDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=f[0].billboard.distanceDisplayCondition?f[0].billboard.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o),f[v].billboard.scaleByDistance=new this._cesium.NearFarScalar(m,1,o,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.distanceDisplayCondition?o[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},billboardDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=f[0].billboard.distanceDisplayCondition?f[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m),f[v].billboard.scaleByDistance=new this._cesium.NearFarScalar(o,1,m,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.distanceDisplayCondition?o[0].billboard.distanceDisplayCondition._value.near:0;return f}}},billboardPHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}}});var ty=Vf;function kFi(o,f,m,v){this.UrlTemplateGeojsonProvider=new f.UrlTemplateGeojsonProvider(m,1),this.UrlTemplateGeojsonProvider.loadtitle=v,this.ent=o.imageryLayers.addImageryProvider(this.UrlTemplateGeojsonProvider)}var cle=kFi;function VFi(o,f){var m={width:o,height:f};function v(C){for(var w=Number.MAX_VALUE,A,E,T={xMin:w,yMin:w,xMax:-w,yMax:-w},S=0,M=C.length;S<M;S++){var I=C[S].getBoundingRect();A={x:I.xMin,y:I.yMin},E={x:I.xMax,y:I.yMax},T.xMin=T.xMin<A.x?T.xMin:A.x,T.yMin=T.yMin<A.y?T.yMin:A.y,T.xMax=T.xMax>E.x?T.xMax:E.x,T.yMax=T.yMax>E.y?T.yMax:E.y}return T}function y(C,w){var A=w.xMax-w.xMin,E=w.yMin-w.yMax,T=Math.abs(C[0]-w.xMin),S=C[1]-w.yMax,M=T/A,I=S/E,P=M*m.width,D=I*m.height;return{x:P,y:D}}function x(C,w){var A=w.xMax-w.xMin,E=w.yMin-w.yMax,T=C.x/m.width*A,S=C.y/m.height*E;return[T,S]}this.project=y,this.unproject=x,this.getBoundingRect=v}var yct=VFi;var mt=null;function Ml(o,f){mt=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.models=0,this.entity=null,this.primitve=[],this.probj=[],this.PrimitiveData=[],this.loadFinishKey=[],this.loadAllKey=[],this.PrimitiveObj={key:"",data:{}},this.start=0,this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._primitiveByTile={},this._primitiveCollection=new this._cesium.PrimitiveCollection,this.img=null,this._defaultStyle=null,this._canvas=null,this._context=null,this._cache=!1,this._forceRefreshPrvimitive=null}function dle(o){if(Array.isArray(o)){for(var f=0,m=Array(o.length);f<o.length;f++)m[f]=o[f];return m}else return Array.from(o)}function xct(o,f){var m=[];return o.level>=f?zFi(o,f,m):Cct(o,f,m),m}function zFi(o,f,m){for(var v=o,y=0;y<30;y++){if(v.level==f)return m.push({x:v.x,y:v.y,level:v.level}),!0;v=v.parent}return!0}function Cct(o,f,m){if(o.level==f)return m.push({x:o.x,y:o.y,level:o.level}),!0;if(o.level>f)return!1;for(var v=0;v<o.children.length;v++)Cct(o.children[v],f,m);return!0}var HFi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};Ml.prototype._serialize=function(o){var f=[],m=window.encodeURIComponent;for(var v in o){var y=o[v];(typeof y>"u"?"undefined":HFi(y))==="object"?f.push(m(v)+"="+m(JSON.stringify(y))):f.push(m(v)+"="+m(o[v]))}return f.join("&")};Ml.prototype.createHistogramVectorGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={radius:50,height:100,scale:1,defaultColor:"#ffffff",showLabel:!0,label:{showBackground:!1,fillColor:"#ffffff",outlineColor:"#000000",backgroundColor:"rgba(0,0,0,0.5)",style:2,horizontalOrigin:mt.HorizontalOrigin.CENTER,verticalOrigin:mt.VerticalOrigin.BOTTOM,outlineWidth:1,font:"20px \u5FAE\u8F6F\u96C5\u9ED1"},alpha:.5,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit};m.label&&(C.label=this._core.extend(C.label,m.label,!0),delete m.label);let A=this._core.extend(C,m,!0);f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");let E;Array.isArray(A.color)&&(E={name:A.color[0].name,value:{">":{},"<":{}}},A.color.forEach(R=>{if(R.value.indexOf&&R.value.indexOf(">")>-1){let O=R.value.split(">");E.value[">"][O[1]]=mt.Color.fromCssColorString(R.color).withAlpha(A.alpha)}else if(R.value.indexOf&&R.value.indexOf("<")>-1){let O=R.value.split("<");E.value["<"][O[1]]=mt.Color.fromCssColorString(R.color).withAlpha(A.alpha)}else E.value[R.value]=mt.Color.fromCssColorString(R.color).withAlpha(A.alpha)}));let T=mt.Color.fromCssColorString(A.defaultColor).withAlpha(A.alpha);var S=this,M={text:"",...A.label,fillColor:mt.Color.fromCssColorString(A.label.fillColor),outlineColor:mt.Color.fromCssColorString(A.label.outlineColor),backgroundColor:mt.Color.fromCssColorString(A.label.backgroundColor)};this._urlTemplate=f.url+"?"+this._serialize(w.urlParams);var I=f.url+"?"+this._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(R,O){(function(F,k,U){if(k.state===mt.QuadtreeTileLoadState.START){if(k.data={lines:[],geometryPrimitive:void 0},k.level>=m.level_min&&k.level<m.level_max&&U.item.show){var G=I.replace(window.encodeURIComponent("{x}"),k.x).replace(window.encodeURIComponent("{y}"),k.y).replace(window.encodeURIComponent("{z}"),k.level);U._cache&&(G+="&"+U._core.getuid());let j=[],q=[],J=new mt.LabelCollection;mt.GeoJsonDataSource.load(G).then(Y=>{let Q=Y.entities.values;if(!Q||!Q.length){k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0;return}let ee=new mt.PrimitiveCollection;if(Q.forEach(z=>{let ie=z.properties.getValue(),re=A.height;if(ie&&typeof A.height=="string"&&/^\[/.test(A.height)&&/\]$/.test(A.height)){let ce=A.height.replace(/\[/,"").replace(/\]/,"");re=ie[ce]||100}let ne=re*A.scale,oe;if(ie&&typeof A.color=="string"&&/^\[/.test(A.color)&&/\]$/.test(A.color)){let ce=A.color.replace(/\[/,"").replace(/\]/,"");ce=ie[ce]||A.defaultColor,oe=mt.Color.fromCssColorString(ce).withAlpha(A.alpha)}else if(E&&ie[E.name]){let ce=ie[E.name];if(E.value[ce])oe=E.value[ce];else{for(let he in E.value[">"])if(ce>he){oe=E.value[">"][he];break}if(!oe){for(let he in E.value["<"])if(ce<he){oe=E.value["<"][he];break}}}}!oe&&(oe=T.clone());let se;if(z.polygon){let ce=z.polygon.hierarchy.getValue().positions;se=mt.BoundingSphere.fromPoints(ce).center;var ae=new mt.PolygonGeometry({polygonHierarchy:new mt.PolygonHierarchy(ce),height:0,extrudedHeight:0,vertexFormat:mt.VertexFormat.DEFAULT,perPositionHeight:!1}),fe=new mt.GeometryInstance({id:ie,geometry:ae,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(oe)}});j.push(fe)}else(z.point||z.billboard)&&(se=z.position.getValue());let de=new mt.GeometryInstance({geometry:new mt.EllipseGeometry({extrudedHeight:ne,center:se,semiMinorAxis:A.radius,semiMajorAxis:A.radius,vertexFormat:mt.VertexFormat.POSITION_AND_ST}),id:ie}),ve=mt.Material.fromType("Color");ve.uniforms.color=oe.withAlpha(1);let pe=new mt.Primitive({geometryInstances:de,appearance:new mt.EllipsoidSurfaceAppearance({material:ve}),shadows:A.shadows});if(ee.add(pe),A.showLabel){let ce=U._core.toDegrees(se);M.text=A.value?A.value(re,ie):re+"",M.position=mt.Cartesian3.fromDegrees(ce.lon,ce.lat,ne*1.1),M.useColorConfig&&(M.fillColor=oe),J.add(M)}}),j.length){let z=new mt.GroundPrimitive({geometryInstances:j,appearance:new mt.PerInstanceColorAppearance({translucent:A.alpha<1}),classificationType:mt.ClassificationType.BOTH,shadows:A.shadows});ee.add(z)}A.showLabel&&ee.add(J),U.probj.push(ee),k.data.geometryPrimitive=ee,k.state=mt.QuadtreeTileLoadState.LOADING,k.state===mt.QuadtreeTileLoadState.LOADING&&(k.data.geometryPrimitive.update(F,[]),k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0)},Y=>{k.count==null&&(k.count=0),k.count+=1,k.count>=2?(k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0):k.state=mt.QuadtreeTileLoadState.START})}else{k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0;return}k.state=mt.QuadtreeTileLoadState.LOADING}})(R,O,S)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var P=this._viewer.scene,D=P.primitives;D.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var L={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=L.id,this.setTreeobj(L),this._tree.insertGroupId(L,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createLaycolorVectorGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={type:"2D",height:100,scale:1,defaultColor:"#ffffff",alpha:.5,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit};let A=this._core.extend(C,m,!0);f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");let E;Array.isArray(A.color)&&(E={name:A.color[0].name,value:{">":{},"<":{}}},A.color.forEach(L=>{if(L.value.indexOf&&L.value.indexOf(">")>-1){let R=L.value.split(">");E.value[">"][R[1]]=mt.Color.fromCssColorString(L.color).withAlpha(A.alpha)}else if(L.value.indexOf&&L.value.indexOf("<")>-1){let R=L.value.split("<");E.value["<"][R[1]]=mt.Color.fromCssColorString(L.color).withAlpha(A.alpha)}else E.value[L.value]=mt.Color.fromCssColorString(L.color).withAlpha(A.alpha)}));let T=mt.Color.fromCssColorString(A.defaultColor).withAlpha(A.alpha);var S=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams);var M=f.url+"?"+this._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(L,R){(function(O,F,k){if(F.state===mt.QuadtreeTileLoadState.START){if(F.data={lines:[],geometryPrimitive:void 0},F.level>=m.level_min&&F.level<m.level_max&&k.item.show){var U=M.replace(window.encodeURIComponent("{x}"),F.x).replace(window.encodeURIComponent("{y}"),F.y).replace(window.encodeURIComponent("{z}"),F.level);k._cache&&(U+="&"+k._core.getuid());let G=[];mt.GeoJsonDataSource.load(U).then(q=>{let J=q.entities.values;if(!J||!J.length){F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0;return}J.forEach(Y=>{let Q=Y.properties.getValue(),ee,z;if(A.type==="3D"){if(ee=A.height,Q&&typeof A.height=="string"&&/^\[/.test(A.height)&&/\]$/.test(A.height)){let oe=A.height.replace(/\[/,"").replace(/\]/,"");ee=Q[oe]||100}z=ee*A.scale}let ie;if(Q&&typeof A.color=="string"&&/^\[/.test(A.color)&&/\]$/.test(A.color)){let oe=A.color.replace(/\[/,"").replace(/\]/,"");oe=Q[oe]||A.defaultColor,ie=mt.Color.fromCssColorString(oe).withAlpha(A.alpha)}else if(E&&Q[E.name]){let oe=Q[E.name];if(E.value[oe])ie=E.value[oe];else{for(let se in E.value[">"])if(oe>se){ie=E.value[">"][se];break}if(!ie){for(let se in E.value["<"])if(oe<se){ie=E.value["<"][se];break}}}}if(!ie&&(ie=T.clone()),Y.polygon){let oe=Y.polygon.hierarchy.getValue().positions;var re=new mt.PolygonGeometry({polygonHierarchy:new mt.PolygonHierarchy(oe),height:0,extrudedHeight:A.type==="3D"?z:0,vertexFormat:mt.VertexFormat.DEFAULT,perPositionHeight:!1}),ne=new mt.GeometryInstance({id:Q,geometry:re,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(ie)}});G.push(ne)}});let X;if(G.length){let Y=A.type==="3D"?mt.Primitive:mt.GroundPrimitive;X=new Y({geometryInstances:G,appearance:new mt.PerInstanceColorAppearance({translucent:A.alpha<1}),classificationType:mt.ClassificationType.BOTH,shadows:A.shadows})}k.probj.push(X),F.data.geometryPrimitive=X,F.state=mt.QuadtreeTileLoadState.LOADING,F.state===mt.QuadtreeTileLoadState.LOADING&&(F.data.geometryPrimitive.update(O,[]),F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0)},q=>{F.count==null&&(F.count=0),F.count+=1,F.count>=2?(F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0):F.state=mt.QuadtreeTileLoadState.START})}else{F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0;return}F.state=mt.QuadtreeTileLoadState.LOADING}})(L,R,S)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var I=this._viewer.scene,P=I.primitives;P.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var D={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=D.id,this.setTreeobj(D),this._tree.insertGroupId(D,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVector3DTilesFeatureLayer=function(o,f,m,v,y,x){var C={color:"#ffffff",level_max:20,level_min:10,tilingScheme:new mt.WebMercatorTilingScheme},w={url:f.url,_x:f._x||0,_y:f._y||0,upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit};let A=this._core.extend(C,m,!0);f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var E=this;this._urlTemplate=f.url;var T=f.url;this._Provider=new ol(this._viewer,this._cesium,A.tilingScheme),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(P,D){(function(L,R,O){if(R.state===mt.QuadtreeTileLoadState.START){if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&O.item.show){var F=T.replace("{x}",R.x-w._x).replace("{y}",R.y-w._y).replace("{z}",R.level);O._cache&&(F+="&"+O._core.getuid());let U=new mt.Cesium3DTileset({url:F,...A}).readyPromise.then(function(G){O.probj.push(G),R.data.geometryPrimitive=G,O._viewer.scene.primitives.add(G),R.state=mt.QuadtreeTileLoadState.LOADING,R.state===mt.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive.update(L,[]),R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0)});U.catch&&U.catch(function(G){R.count==null&&(R.count=0),R.count+=1,R.count>=2?(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0):R.state=mt.QuadtreeTileLoadState.START}),U.otherwise&&U.otherwise(function(G){R.count==null&&(R.count=0),R.count+=1,R.count>=2?(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0):R.state=mt.QuadtreeTileLoadState.START})}else{R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}R.state=mt.QuadtreeTileLoadState.LOADING}})(P,D,E)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id);var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"modelLayer",item:this,url:f.url,style:m};return this._Provider.treeID=I.id,this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVector3DTilesFeatureLayerRelease=function(o,f,m,v,y,x){var C={color:"#ffffff",level_max:20,level_min:10,tilingScheme:new mt.WebMercatorTilingScheme},w={url:f.url,_x:f._x||0,_y:f._y||0,upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit};let A=this._core.extend(C,m,!0);f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var E=this;E.models=0,this._urlTemplate=f.url;var T=f.url;this._Provider=new ol(this._viewer,this._cesium,A.tilingScheme),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=0,this._Provider.loadTile=function(P,D){(function(L,R,O){if(R.state===mt.QuadtreeTileLoadState.START){if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&O.item.show){var F=T.replace("{x}",R.x-w._x).replace("{y}",R.y-w._y).replace("{z}",18);O._cache&&(F+="&"+O._core.getuid());let U=new mt.Cesium3DTileset({url:F,...A}).readyPromise.then(function(G){R.freeResources=function(){R.state=0,R.renderable=!1,R.upsampledFromParent=!1,mt.defined(R.data)&&mt.defined(R.data.freeResources)&&R.data.freeResources(),mt.defined(this.data)&&mt.defined(this.data.geometryPrimitive)&&R._level>=18&&(this.data.geometryPrimitive.destroy(),this.data.geometryPrimitive=void 0),j(R._southwestChild),R._southwestChild=void 0,j(R._southeastChild),R._southeastChild=void 0,j(R._northwestChild),R._northwestChild=void 0,j(R._northeastChild),R._northeastChild=void 0};function j(q){mt.defined(q)&&q.freeResources()}O.probj.push(G),O._viewer.scene.primitives.add(G),R.state=mt.QuadtreeTileLoadState.LOADING,R.state===mt.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive.update(L,[]),R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0)});U.catch&&U.catch(function(G){R.count==null&&(R.count=0),R.count+=1,R.count>=2?(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0):R.state=mt.QuadtreeTileLoadState.START}),U.otherwise&&U.otherwise(function(G){R.count==null&&(R.count=0),R.count+=1,R.count>=2?(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0):R.state=mt.QuadtreeTileLoadState.START})}else{R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}R.state=mt.QuadtreeTileLoadState.LOADING}})(P,D,E)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id);var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"modelLayer",item:this,url:f.url,style:m};return this._Provider.treeID=I.id,this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.VectorGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=this._core.VectorSlice(f,this._cesium),w=new Ah(this._viewer,this._cesium,C),A=this;this._Provider=w,w._loadTile=function(T){var S=new mt.PrimitiveCollection,M=new mt.PointPrimitiveCollection,I=new mt.LabelCollection,P=new mt.BillboardCollection,D=[],L=[],R=-1;return T.features.forEach(function(O){var F=[];if(m.lable!=null&&O.geometry.coordinates[0][0]==null){var k=0;if(m.lable.height!=null&&/^\[/.test(m.lable.height)&&/\]$/.test(m.lable.height)){var U=m.lable.height.replace(/\[/,"").replace(/\]/,"");k=parseFloat(O.properties[U])}var G=A._core.StyleContrast("lable",m.lable,mt);G.fillColor=A._color.VectorColorTransformation(G.fillColor,O),G.outlineColor=A._color.VectorColorTransformation(G.outlineColor,O),G.backgroundColor=A._color.VectorColorTransformation(G.backgroundColor,O),G.text=A._core.Analysis(G.text,O),G.position=new mt.Cartesian3.fromDegrees(O.geometry.coordinates[0],O.geometry.coordinates[1],k),I.add(G)}if(m.billboard!=null&&O.geometry.coordinates[0][0]==null){var k=0,j=m.billboard;if(j.height!=null&&/^\[/.test(j.height)&&/\]$/.test(j.height)){var U=j.height.replace(/\[/,"").replace(/\]/,"");k=parseFloat(O.properties[U])}var q=A._core.StyleContrast("billboard",j,mt);q.position=new mt.Cartesian3.fromDegrees(O.geometry.coordinates[0],O.geometry.coordinates[1],k),P.add(q)}if(m.point!=null&&O.geometry.coordinates[0][0]==null){var k=0,j=m.point;if(j.height!=null&&/^\[/.test(j.height)&&/\]$/.test(j.height)){var U=j.height.replace(/\[/,"").replace(/\]/,"");k=parseFloat(O.properties[U])}var q=A._core.StyleContrast("point",j,mt);q.position=new mt.Cartesian3.fromDegrees(O.geometry.coordinates[0],O.geometry.coordinates[1],k),q.color=A._color.VectorColorTransformation(q.color,O),q.outlineColor=A._color.VectorColorTransformation(q.outlineColor,O),M.add(q)}if(m.polyline!=null){var k=0,j=m.polyline;if(j.height!=null&&/^\[/.test(j.height)&&/\]$/.test(j.height)){var U=j.height.replace(/\[/,"").replace(/\]/,"");k=parseFloat(O.properties[U])}var q=A._core.StyleContrast("polyline",j,mt);if(R=q.classificationType,delete q.classificationType,Array.isArray(O.geometry.coordinates)&&O.geometry.coordinates.length>0)if(Array.isArray(O.geometry.coordinates[0][0]))for(var J=0;J<O.geometry.coordinates.length;J++){F=[],F=A._core.coordinate(F,O.geometry.coordinates[J]),q.positions=mt.Cartesian3.fromDegreesArray(F);var X=A._core.createPolyline(q,R,O,mt);D.push(X)}else{F=A._core.coordinate(F,O.geometry.coordinates),q.positions=mt.Cartesian3.fromDegreesArray(F);var X=A._core.createPolyline(q,R,O,mt);D.push(X)}}if(m.polygon!=null){var k=0,j=m.polygon;if(j.height!=null&&/^\[/.test(j.height)&&/\]$/.test(j.height)){var U=j.height.replace(/\[/,"").replace(/\]/,"");k=parseFloat(O.properties[U])}var q=A._core.StyleContrast("polygon",j,mt);if(q.material=A._color.VectorColorTransformation(q.material,O),R=q.classificationType,delete q.classificationType,Array.isArray(O.geometry.coordinates)&&O.geometry.coordinates.length>0)if(Array.isArray(O.geometry.coordinates[0][0]))for(var J=0;J<O.geometry.coordinates.length;J++){F=[],O.geometry.coordinates[J].pop(),F=A._core.coordinate(F,O.geometry.coordinates[J]),q.polygonHierarchy=new mt.PolygonHierarchy(mt.Cartesian3.fromDegreesArray(F));var X=A._core.createPolygon(q,R,O,mt);L.push(X)}else{F=A._core.coordinate(F,O.geometry.coordinates),q.polygonHierarchy=new mt.PolygonHierarchy(mt.Cartesian3.fromDegreesArray(F));var X=A._core.createPolygon(q,R,O,mt);L.push(X)}}}),S.add(I),S.add(P),S.add(M),D.length>0&&(R!=-1?S.add(new mt.GroundPolylinePrimitive({geometryInstances:D,classificationType:R,appearance:new mt.PolylineMaterialAppearance})):S.add(new mt.Primitive({geometryInstances:D,appearance:new mt.PolylineMaterialAppearance}))),L.length>0&&(R!=-1?S.add(new mt.GroundPrimitive({geometryInstances:L,classificationType:R,appearance:new mt.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:A._core.Shaders("vertexShaderSource"),fragmentShaderSource:A._core.Shaders("fragmentShaderSource")})})):S.add(new mt.Primitive({geometryInstances:L,appearance:new mt.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:A._core.Shaders("vertexShaderSource"),fragmentShaderSource:A._core.Shaders("fragmentShaderSource")})}))),S},this.item=w._primitiveCollection,w.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"Vector",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},E=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams);var T=f.url+"?"+this._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){(function(L,R,O){if(R.state===mt.QuadtreeTileLoadState.START){if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&O.item.show){var F=T.replace(window.encodeURIComponent("{x}"),R.x).replace(window.encodeURIComponent("{y}"),R.y).replace(window.encodeURIComponent("{z}"),R.level);O._cache&&(F+="&"+O._core.getuid()),O._core.xhr({url:F,type:"get",dataType:"json",success:function(k){if(k==null){R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}var U=[],G=[];O.Legend=[];function j(z){for(var ie=0;ie<z.length;ie++)Array.isArray(z[ie])?j(z[ie]):X.push(z[ie])}function q(){if(/^\[/.test(O._option.extrudedHeight)&&/\]$/.test(O._option.extrudedHeight)){var z=O._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(Y.properties[z])}if(A.material=O._option.material,/^\[/.test(O._option.material)&&/\]$/.test(O._option.material)){var ie=O._option.material.replace(/\[/,"").replace(/\]/,"");A.material=Y.properties[ie],O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha))}else O._option.material&&(A.material=O._option.material),A.material&&(O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha)));if(X.length>=2){var re=mt.Cartesian3.fromDegreesArray(X);A.polygonHierarchy=new mt.PolygonHierarchy(re);var ne=new mt.PolygonGeometry(A),oe=new mt.GeometryInstance({id:Y,geometry:ne,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(A.material)}}),se="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;O.Legend.push(se),U.push(oe)}}for(var J=0;J<k.features.length;J++){var X=[],Y=k.features[J];if(Array.isArray(Y.geometry.coordinates)&&Y.geometry.coordinates.length>0)if(Array.isArray(Y.geometry.coordinates[0][0]))for(var Q=0;Q<Y.geometry.coordinates.length;Q++)X=[],Y.geometry.coordinates[Q].pop(),j(Y.geometry.coordinates[Q]),q(X);else j(Y.geometry.coordinates),q(X)}U.length==0&&(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0);var ee=new mt.Primitive({geometryInstances:U,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:O._core.Shaders("vertexShaderSource"),fragmentShaderSource:O._core.Shaders("fragmentShaderSource")}),shadows:O._option.shadows});R.data.geometryPrimitive=ee,R.state=mt.QuadtreeTileLoadState.LOADING,R.state===mt.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive.update(L,[]),R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0)},error:function(){R.count==null&&(R.count=0),R.count+=1,R.count>=2?(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0):R.state=mt.QuadtreeTileLoadState.START}})}else{R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}R.state=mt.QuadtreeTileLoadState.LOADING}})(P,D,E)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1ss=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){if(this.tile=null,this.tile=D,D.state===this._cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var R=Ji.filter(A,function(j){return j.x==D.x&&j.y==D.y&&j.level==D.level});if(R.length!=0&&R[0].data&&R[0].data.length>0){D.data.geometryPrimitive=new mt.Primitive({geometryInstances:R[0].data,appearance:new mt.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:mt.ShadowMode.ENABLED}),D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}if(T.PrimitiveData.length>0){for(var O=0;O<T.PrimitiveData.length;O++)if(T.PrimitiveData[O].key==L){T.Primitivekey.includes(L)||T.Primitivekey.push(L);return}}if(!T.Primitivekey.includes(L)){T.Primitivekey.push(L),A.push({level:D.level,x:D.x,y:D.y,data:void 0});for(var F=T._option.level_min+(T._option.level_max-T._option.level_min)/2,k=xct(D,F),O=0;O<k.length;O++){var U=k[O],G="z"+U.level+"x"+U.x+"y"+U.y;T.loadAllKey.includes(G)||(T.loadAllKey.push(G),function(q){var J=T._urlTemplate.replace(window.encodeURIComponent("{x}"),q.x).replace(window.encodeURIComponent("{y}"),q.y).replace(window.encodeURIComponent("{z}"),q.level);T.tilesLength++,T._cache&&(J+="&"+T._core.getuid());var X="z"+q.level+"x"+q.x+"y"+q.y;T._core.xhr({url:J,type:"get",dataType:"json",success:function(Y){var Q=[],ee=[];T.Legend=[];function z(de){for(var ve=0;ve<de.length;ve++)Array.isArray(de[ve])?z(de[ve]):ne.push(de[ve])}function ie(){if(/^\[/.test(T._option.extrudedHeight)&&/\]$/.test(T._option.extrudedHeight)){var de=T._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");E.extrudedHeight=parseFloat(oe.properties[de])}if(E.material=T._option.material,/^\[/.test(T._option.material)&&/\]$/.test(T._option.material)){var ve=T._option.material.replace(/\[/,"").replace(/\]/,"");E.material=oe.properties[ve],T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha))}else T._option.material&&(E.material=T._option.material),E.material&&(T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha)));if(ne.length>=2){var pe=mt.Cartesian3.fromDegreesArray(ne);E.polygonHierarchy=new mt.PolygonHierarchy(pe);var ce=new mt.PolygonGeometry(E),he=new mt.GeometryInstance({id:oe,geometry:ce,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(E.material)}}),Ce="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;T.Legend.push(Ce),Q.push(he)}}for(var re=0;re<Y.features.length;re++){var ne=[],oe=Y.features[re];if(Array.isArray(oe.geometry.coordinates)&&oe.geometry.coordinates.length>0)if(Array.isArray(oe.geometry.coordinates[0][0]))for(var se=0;se<oe.geometry.coordinates.length;se++)ne=[],oe.geometry.coordinates[se].pop(),z(oe.geometry.coordinates[se]),ie(ne);else z(oe.geometry.coordinates),ie(ne)}if(Q.length>0){var ae=new mt.Primitive({geometryInstances:Q,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:T._core.Shaders("vertexShaderSource"),fragmentShaderSource:T._core.Shaders("fragmentShaderSource")}),shadows:T._option.shadows}),fe={level:q.level,key:X,data:ae};T.probj.push(ae),T.loadFinishKey.push(X),T.PrimitiveData.push(fe),T._viewer.scene.primitives.add(ae),T.returnCount++}},error:function(){},complete:function(Y,Q){}})}(U))}}}else{D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item)};Ml.prototype.VolumeVectorGeoJsonFeatureLayerGis=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E=[],T={id:f.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},S=this;this._urlTemplate=f.url+"/"+window.encodeURIComponent("{z}")+"/"+window.encodeURIComponent("{x}")+"/"+window.encodeURIComponent("{reverseY}")+".json",this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(D,L){if(this.tile=null,this.tile=L,L.state===this._cesium.QuadtreeTileLoadState.START&&S.item.show){var R="z"+L.level+"x"+L.x+"y"+L.y;if(L.data={lines:[],geometryPrimitive:void 0},L.level>=m.level_min&&L.level<m.level_max&&S.item.show){var O=Ji.filter(A,function(k){return k.x==L.x&&k.y==L.y&&k.level==L.level});if(O.length!=0&&O[0].data&&O[0].data.length>0){L.data.geometryPrimitive=new mt.Primitive({geometryInstances:O[0].data,appearance:new mt.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:mt.ShadowMode.ENABLED}),L.state=mt.QuadtreeTileLoadState.LOADING,L.state===mt.QuadtreeTileLoadState.LOADING&&(L.data.geometryPrimitive&&(L.state=mt.QuadtreeTileLoadState.DONE),L.renderable=!0);return}if(S.PrimitiveData.length>0){for(var F=0;F<S.PrimitiveData.length;F++)if(S.PrimitiveData[F].key==R){S.Primitivekey.includes(R)||S.Primitivekey.push(R);return}}S.Primitivekey.includes(R)||(S.Primitivekey.push(R),A.push({level:L.level,x:L.x,y:L.y,data:void 0}),function(k){var U=k.tilingScheme.getNumberOfYTilesAtLevel(k.level)-k.y-1,G=S._urlTemplate.replace(window.encodeURIComponent("{x}"),k.x).replace(window.encodeURIComponent("{reverseY}"),U).replace(window.encodeURIComponent("{z}"),k.level);S.tilesLength++;var j="z"+k.level+"x"+k.x+"y"+k.y;S._cache&&(G+="&"+S._core.getuid());var q=Ji.filter(E,function(J){return J.url==G});q.length>0||(E.push({url:G}),S._core.xhr({url:G,type:"get",dataType:"json",success:function(J){var X=[],Y=[];S.Legend=[];function Q(ae){for(var fe=0;fe<ae.length;fe++)Array.isArray(ae[fe])?Q(ae[fe]):ie.push(ae[fe])}function ee(){if(T.extrudedHeight=parseFloat(S._option.extrudedHeight),/^\[/.test(S._option.extrudedHeight)&&/\]$/.test(S._option.extrudedHeight)){var ae=S._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");T.extrudedHeight=parseFloat(re.properties[ae])*3}if(T.material=S._option.material,/^\[/.test(S._option.material)&&/\]$/.test(S._option.material)){var fe=S._option.material.replace(/\[/,"").replace(/\]/,"");T.material=re.properties[fe],S._core.isHtmlColor(T.material)?T.material=S._color.colorFromHtmlColor(T.material):(/^rgb/.test(T.material)&&(T.material=S._color.rgbaStringToRgbaObj(T.material)),T.material.red>1&&(T.material.red=T.material.red/255),T.material.green>1&&(T.material.green=T.material.green/255),T.material.blue>1&&(T.material.blue=T.material.blue/255),T.material.alpha>1&&(T.material.a=T.material.alpha/255),T.material=S._color.createColor(T.material.red,T.material.green,T.material.blue,T.material.alpha))}else S._option.material&&(T.material=S._option.material),T.material&&(S._core.isHtmlColor(T.material)?T.material=S._color.colorFromHtmlColor(T.material):(/^rgb/.test(T.material)&&(T.material=S._color.rgbaStringToRgbaObj(T.material)),T.material.red>1&&(T.material.red=T.material.red/255),T.material.green>1&&(T.material.green=T.material.green/255),T.material.blue>1&&(T.material.blue=T.material.blue/255),T.material.alpha>1&&(T.material.a=T.material.alpha/255),T.material=S._color.createColor(T.material.red,T.material.green,T.material.blue,T.material.alpha)));var de=mt.Color.WHITE;if(ie.length>=2){var ve=mt.Cartesian3.fromDegreesArray(ie);T.polygonHierarchy=new mt.PolygonHierarchy(ve);var pe=new mt.PolygonGeometry(T),ce=new mt.GeometryInstance({id:re,geometry:pe,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(de)}}),he="material:"+T.material.red*255+","+T.material.green*255+","+T.material.blue*255;S.Legend.push(he),X.push(ce)}}for(var z=0;z<J.features.length;z++){var ie=[],re=J.features[z];if(Array.isArray(re.geometry.coordinates)&&re.geometry.coordinates.length>0)if(Array.isArray(re.geometry.coordinates[0][0]))for(var ne=0;ne<re.geometry.coordinates.length;ne++)ie=[],re.geometry.coordinates[ne].pop(),Q(re.geometry.coordinates[ne]),ee(ie);else Q(re.geometry.coordinates),ee(ie)}var oe=new mt.Primitive({geometryInstances:X,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:S._core.Shaders("vertexShaderSource"),fragmentShaderSource:S._core.Shaders("fragmentShaderSource")}),shadows:S._option.shadows});S.probj.push(oe);var se={level:k.level,key:j,data:oe};S.loadFinishKey.push(j),S.PrimitiveData.push(se),S._viewer.scene.primitives.add(oe),S.returnCount++;try{S.probj.length==2&&(S._viewer.scene.primitives.remove(S.probj[0]),S.probj.pop())}catch{}},error:function(){var J=S.Primitivekey.indexOf(j);J>-1&&S.Primitivekey.splice(J,1),A=Ji.remove(A,function(X){return X.x==k.x&&X.y==k.y&&X.level==k.level})},complete:function(J,X){J=null,k.state=mt.QuadtreeTileLoadState.LOADING,k.state===mt.QuadtreeTileLoadState.LOADING&&(k.data.geometryPrimitive&&(k.state=mt.QuadtreeTileLoadState.DONE),k.renderable=!0)}}))}(L))}else{L.state=mt.QuadtreeTileLoadState.LOADING,L.state===mt.QuadtreeTileLoadState.LOADING&&(L.data.geometryPrimitive&&(L.state=mt.QuadtreeTileLoadState.DONE),L.renderable=!0);return}}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var M=this._viewer.scene,I=M.primitives;I.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(T.id)&&(T.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+T.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var P={id:T.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(P),this._tree.insertGroupId(P,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.PointVectorGeoJsonFeatureLayerGis=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var w=[],A={id:f.id,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,arcType:this._cesium.ArcType.GEODESIC},E=this;this._urlTemplate=f.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new cle(this._viewer,this._cesium,{url:this._urlTemplate},function(S){if(E.Level=E.getLevel(),E.Level<E._option.level_min){if(E.primitve.length>0){for(var M=0;M<E.primitve.length;M++)E._viewer.scene.primitives.remove(E.primitve[M]);E.primitve=[]}if(E.probj.length>0){for(var M=0;M<E.probj.length;M++)E._viewer.scene.primitives.remove(E.probj[M]);E.probj=[]}w=[];return}var I=new mt.PrimitiveCollection,P=new mt.PointPrimitiveCollection,D=new mt.LabelCollection,L=new mt.BillboardCollection,R="z"+S.templateValues.z+"x"+S.templateValues.x+"y"+S.templateValues.reverseY;S.data={lines:[],geometryPrimitive:void 0};var O=S.url.replace("png","json"),F=Ji.filter(w,function(k){return k.url==O});F.length>0||E.start!=1&&(w.push({url:O}),E._core.xhr({url:O,type:"get",dataType:"json",success:function(k){if(k.features.length==0)return;E.Legend=[];function U(Y){for(var Q=0;Q<Y.length;Q++)Array.isArray(Y[Q])?U(Y[Q]):q.push(Y[Q])}function G(){if(m.lable!=null){var Y=0;if(m.lable.height!=null&&/^\[/.test(m.lable.height)&&/\]$/.test(m.lable.height)){var Q=m.lable.height.replace(/\[/,"").replace(/\]/,"");Y=parseFloat(J.properties[Q])}var ee=E._core.StyleContrast("lable",m.lable,mt);ee.fillColor=E._color.VectorColorTransformation(ee.fillColor,J),ee.outlineColor=E._color.VectorColorTransformation(ee.outlineColor,J),ee.backgroundColor=E._color.VectorColorTransformation(ee.backgroundColor,J),ee.text=E._core.Analysis(ee.text,J),ee.position=new mt.Cartesian3.fromDegrees(q[0],q[1],Y),D.add(ee)}if(m.billboard!=null){var Y=0,z=m.billboard;if(z.height!=null&&/^\[/.test(z.height)&&/\]$/.test(z.height)){var Q=z.height.replace(/\[/,"").replace(/\]/,"");Y=parseFloat(J.properties[Q])}var ie=E._core.StyleContrast("billboard",z,mt);ie.position=new mt.Cartesian3.fromDegrees(q[0],q[1],Y),L.add(ie)}if(m.point!=null){var Y=0,z=m.point;if(z.height!=null&&/^\[/.test(z.height)&&/\]$/.test(z.height)){var Q=z.height.replace(/\[/,"").replace(/\]/,"");Y=parseFloat(J.properties[Q])}var ie=E._core.StyleContrast("point",z,mt);ie.position=new mt.Cartesian3.fromDegrees(q[0],q[1],Y),ie.color=E._color.VectorColorTransformation(ie.color,J),ie.outlineColor=E._color.VectorColorTransformation(ie.outlineColor,J),P.add(ie)}}for(var j=0;j<k.features.length;j++){var q=[],J=k.features[j];if(Array.isArray(J.geometry.coordinates)&&J.geometry.coordinates.length>0)if(Array.isArray(J.geometry.coordinates[0][0]))for(var X=0;X<J.geometry.coordinates.length;X++)q=[],J.geometry.coordinates[X].pop(),U(J.geometry.coordinates[X]),G(q);else U(J.geometry.coordinates),G(q)}D.length>0&&I.add(D),L.length>0&&I.add(L),P.length>0&&I.add(P),E.primitve.push(I),E.probj.push(I),E._viewer.scene.primitives.add(I),E.returnCount++;try{E.probj.length==2&&(E._viewer.scene.primitives.remove(E.probj[0]),E.probj.pop())}catch{}}}))}),this.img=this._Provider1.ent,y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var T={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.PolylineVectorGeoJsonFeatureLayerGis=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10};this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var w=[],A={id:f.id,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,arcType:this._cesium.ArcType.GEODESIC},E=this;this._urlTemplate=f.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new cle(this._viewer,this._cesium,{url:this._urlTemplate},function(S){if(E.Level=E.getLevel(),E.Level<E._option.level_min){if(E.primitve.length>0){for(var M=0;M<E.primitve.length;M++)E._viewer.scene.primitives.remove(E.primitve[M]);E.primitve=[]}if(E.probj.length>0){for(var M=0;M<E.probj.length;M++)E._viewer.scene.primitives.remove(E.probj[M]);E.probj=[]}w=[];return}var I=-1,P="z"+S.templateValues.z+"x"+S.templateValues.x+"y"+S.templateValues.reverseY;S.data={lines:[],geometryPrimitive:void 0};var D=S.url.replace("png","json"),L=Ji.filter(w,function(R){return R.url==D});L.length>0||E.start!=1&&(w.push({url:D}),E._core.xhr({url:D,type:"get",dataType:"json",success:function(R){if(R.features.length==0)return;var O=[];E.Legend=[];function F(X){for(var Y=0;Y<X.length;Y++)Array.isArray(X[Y])?F(X[Y]):G.push(X[Y])}function k(){var X=0,Y=m;if(Y.height!=null&&/^\[/.test(Y.height)&&/\]$/.test(Y.height)){var Q=Y.height.replace(/\[/,"").replace(/\]/,"");X=parseFloat(j.properties[Q])}var ee=E._core.StyleContrast("polyline",Y,mt);if(I=ee.classificationType,delete ee.classificationType,ee.material=E._option.material,/^\[/.test(E._option.material)&&/\]$/.test(E._option.material)){var z=E._option.material.replace(/\[/,"").replace(/\]/,"");ee.material=j.properties[z],E._core.isHtmlColor(ee.material)?ee.material=E._color.colorFromHtmlColor(ee.material):(/^rgb/.test(ee.material)&&(ee.material=E._color.rgbaStringToRgbaObj(ee.material)),ee.material.red>1&&(ee.material.red=ee.material.red/255),ee.material.green>1&&(ee.material.green=ee.material.green/255),ee.material.blue>1&&(ee.material.blue=ee.material.blue/255),ee.material.alpha>1&&(ee.material.a=ee.material.alpha/255),ee.material=E._color.createColor(ee.material.red,ee.material.green,ee.material.blue,ee.material.alpha))}else E._option.material&&(ee.material=E._option.material),ee.material&&(E._core.isHtmlColor(ee.material)?ee.material=E._color.colorFromHtmlColor(ee.material):(/^rgb/.test(ee.material)&&(ee.material=E._color.rgbaStringToRgbaObj(ee.material)),ee.material.red>1&&(ee.material.red=ee.material.red/255),ee.material.green>1&&(ee.material.green=ee.material.green/255),ee.material.blue>1&&(ee.material.blue=ee.material.blue/255),ee.material.alpha>1&&(ee.material.a=ee.material.alpha/255),ee.material=E._color.createColor(ee.material.red,ee.material.green,ee.material.blue,ee.material.alpha)));if(G.length>=2){ee.positions=mt.Cartesian3.fromDegreesArray(G);var ie=new mt.GeometryInstance({id:j,geometry:new mt.PolylineGeometry(ee),attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(ee.material)}}),re="material:"+ee.material.red*255+","+ee.material.green*255+","+ee.material.blue*255;E.Legend.push(re),O.push(ie)}}for(var U=0;U<R.features.length;U++){var G=[],j=R.features[U];if(Array.isArray(j.geometry.coordinates)&&j.geometry.coordinates.length>0)if(Array.isArray(j.geometry.coordinates[0][0]))for(var q=0;q<j.geometry.coordinates.length;q++)G=[],j.geometry.coordinates[q].pop(),F(j.geometry.coordinates[q]),k(G);else F(j.geometry.coordinates),k(G)}var J=new mt.Primitive({geometryInstances:O,appearance:new mt.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:E._option.shadows,classificationType:I});E.probj.push(J),E.primitve.push(J),E._viewer.scene.primitives.add(J),E.returnCount++;try{E.probj.length==2&&(E._viewer.scene.primitives.remove(E.probj[0]),E.probj.pop())}catch{}}}))}),this.img=this._Provider1.ent,y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var T={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.VolumeVectorGeoJsonFeatureLayerGisOptimization=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E=[],T={id:f.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},S=this;this._urlTemplate=f.url+"/{z}/{x}/{reverseY}.json",this._Provider={},this._Provider1=new cle(this._viewer,this._cesium,{url:this._urlTemplate},function(I){if(S.Level=S.getLevel(),S.Level<S._option.level_min){if(S.primitve.length>0){for(var P=0;P<S.primitve.length;P++)S._viewer.scene.primitives.remove(S.primitve[P]);S.primitve=[]}if(S.probj.length>0){for(var P=0;P<S.probj.length;P++)S._viewer.scene.primitives.remove(S.probj[P]);S.probj=[]}A=[];return}var D="z"+I.templateValues.z+"x"+I.templateValues.x+"y"+I.templateValues.reverseY;I.data={lines:[],geometryPrimitive:void 0};var L=I.url.replace("png","json"),R=Ji.filter(A,function(O){return O.url==L});R.length>0||S.start!=1&&(A.push({url:L}),S._core.xhr({url:L,type:"get",dataType:"json",success:function(O){if(O.features.length==0)return;var F=[],k=[];S.Legend=[];function U(Q){for(var ee=0;ee<Q.length;ee++)Array.isArray(Q[ee])?U(Q[ee]):q.push(Q[ee])}function G(){if(T.extrudedHeight=S._option.extrudedHeight,/^\[/.test(S._option.extrudedHeight)&&/\]$/.test(S._option.extrudedHeight)){var Q=S._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");T.extrudedHeight=parseFloat(J.properties[Q])*3}if(T.material=S._option.material,/^\[/.test(S._option.material)&&/\]$/.test(S._option.material)){var ee=S._option.material.replace(/\[/,"").replace(/\]/,"");T.material=J.properties[ee],S._core.isHtmlColor(T.material)?T.material=S._color.colorFromHtmlColor(T.material):(/^rgb/.test(T.material)&&(T.material=S._color.rgbaStringToRgbaObj(T.material)),T.material.red>1&&(T.material.red=T.material.red/255),T.material.green>1&&(T.material.green=T.material.green/255),T.material.blue>1&&(T.material.blue=T.material.blue/255),T.material.alpha>1&&(T.material.a=T.material.alpha/255),T.material=S._color.createColor(T.material.red,T.material.green,T.material.blue,T.material.alpha))}else S._option.material&&(T.material=S._option.material),T.material&&(S._core.isHtmlColor(T.material)?T.material=S._color.colorFromHtmlColor(T.material):(/^rgb/.test(T.material)&&(T.material=S._color.rgbaStringToRgbaObj(T.material)),T.material.red>1&&(T.material.red=T.material.red/255),T.material.green>1&&(T.material.green=T.material.green/255),T.material.blue>1&&(T.material.blue=T.material.blue/255),T.material.alpha>1&&(T.material.a=T.material.alpha/255),T.material=S._color.createColor(T.material.red,T.material.green,T.material.blue,T.material.alpha)));if(q.length>=2){var z=mt.Cartesian3.fromDegreesArray(q);T.polygonHierarchy=new mt.PolygonHierarchy(z);var ie=new mt.PolygonGeometry(T),re=new mt.GeometryInstance({id:J,geometry:ie,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(T.material)}}),ne="material:"+T.material.red*255+","+T.material.green*255+","+T.material.blue*255;F.push(re)}}for(var j=0;j<O.features.length;j++){var q=[],J=O.features[j];if(Array.isArray(J.geometry.coordinates)&&J.geometry.coordinates.length>0)if(Array.isArray(J.geometry.coordinates[0][0]))for(var X=0;X<J.geometry.coordinates.length;X++)q=[],J.geometry.coordinates[X].pop(),U(J.geometry.coordinates[X]),G(q);else U(J.geometry.coordinates),G(q)}var Y=new mt.Primitive({geometryInstances:F,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:S._core.Shaders("vertexShaderSource"),fragmentShaderSource:S._core.Shaders("fragmentShaderSource")}),shadows:S._option.shadows});S.primitve.push(Y),S.probj.push(Y),S._viewer.scene.primitives.add(Y),S.returnCount++;try{S.probj.length==2&&(S._viewer.scene.primitives.remove(S.probj[0]),S.probj.pop())}catch{}}}))}),this.img=this._Provider1.ent,y||this.setVisibility(!1),this._core.isnull(T.id)&&(T.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+T.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var M={id:T.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.VolumeVectorGeoJsonFeatureLayerClassOptimization=function(o,f,m,v,y,x){var C={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(C,m,!0);f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var E=[],T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){if(this.tile=null,this.tile=D,D.state===this._cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var R=Ji.filter(E,function(F){return F.x==D.x&&F.y==D.y&&F.level==D.level});if(R.length!=0&&R[0].data&&R[0].data.length>0){D.data.geometryPrimitive=new mt.Primitive({geometryInstances:R[0].data,appearance:new mt.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:mt.ShadowMode.ENABLED}),D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}if(T.PrimitiveData.length>0){for(var O=0;O<T.PrimitiveData.length;O++)if(T.PrimitiveData[O].key==L){T.Primitivekey.push(L);return}}T.Primitivekey.includes(L)||(T.Primitivekey.push(L),E.push({level:D.level,x:D.x,y:D.y,data:void 0}),function(F){var k=T._urlTemplate.replace(window.encodeURIComponent("{x}"),F.x).replace(window.encodeURIComponent("{y}"),F.y).replace(window.encodeURIComponent("{z}"),F.level);T.tilesLength++,T._cache&&(k+="&"+T._core.getuid()),T._core.xhr({url:k,type:"get",dataType:"json",success:function(U){var G=[],j=[];T.Legend=[];function q(ne){for(var oe=0;oe<ne.length;oe++)Array.isArray(ne[oe])?q(ne[oe]):(Y.push(ne[oe]),oe===2&&!Q&&(Q=!0))}function J(){var ne=Q?mt.Cartesian3.fromDegreesArrayHeights(Y):mt.Cartesian3.fromDegreesArray(Y);if(/^\[/.test(m.extrudedHeight)&&/\]$/.test(m.extrudedHeight)){var oe=m.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(ee.properties[oe])}if(A.extrudedHeight=parseFloat(A.extrudedHeight),A.heightReference==1&&delete A.height,A.extrudedHeightReference==1&&delete A.extrudedHeight,/^\[/.test(m.material)&&/\]$/.test(m.material)){var se=m.material.replace(/\[/,"").replace(/\]/,"");A.material=ee.properties[se],T._core.isHtmlColor(A.material)?A.material=T._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=T._color.rgbaStringToRgbaObj(A.material)),A.material.r>1&&(A.material.r=A.material.r/255),A.material.g>1&&(A.material.g=A.material.g/255),A.material.b>1&&(A.material.b=A.material.b/255),A.material.a>1&&(A.material.a=A.material.a/255),A.material=T._color.createColor(A.material.r,A.material.g,A.material.b,A.material.a))}A.polygonHierarchy=new mt.PolygonHierarchy(ne);var ae=new mt.PolygonGeometry(A);ee.treeID=A.id,ee.VectorType="polygon",ee.VectorStyle={haveZ:Q,extrudedHeight:A.extrudedHeight,positions:Y,material:A.material};var fe=new mt.GeometryInstance({id:ee,geometry:ae,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(A.material)}}),de="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;T.Legend.push(de),G.push(fe)}for(var X=0;X<U.features.length;X++){var Y=[],Q=!1,ee=U.features[X];if(Array.isArray(ee.geometry.coordinates)&&ee.geometry.coordinates.length>0)if(Array.isArray(ee.geometry.coordinates[0][0]))for(var z=0;z<ee.geometry.coordinates.length;z++)Y=[],ee.geometry.coordinates[z].pop(),q(ee.geometry.coordinates[z]),J(Y);else q(ee.geometry.coordinates),J(Y)}var ie=new mt.ClassificationPrimitive({geometryInstances:G,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:T._core.Shaders("vertexShaderSource"),fragmentShaderSource:T._core.Shaders("fragmentShaderSource")}),classificationType:A.classificationType,shadows:mt.ShadowMode.ENABLED});T.PrimitiveObj.data=ie,T.PrimitiveObj.key=T.Primitivekey[T.returnCount];var re={level:F.level,key:T.Primitivekey[T.returnCount],data:ie};T.loadFinishKey.push(T.Primitivekey[T.returnCount]),T.PrimitiveData.push(re),T._viewer.scene.primitives.add(ie),T.returnCount++,T.returnCount>=T.tilesLength&&(T.returnCount=0,T.tilesLength=0,T.Primitivekey=[])},error:function(){E=Ji.remove(E,function(U){return U.x==F.x&&U.y==F.y&&U.level==F.level})},complete:function(U,G){U=null,F.state=mt.QuadtreeTileLoadState.LOADING,F.state===mt.QuadtreeTileLoadState.LOADING&&(F.data.geometryPrimitive&&(F.state=mt.QuadtreeTileLoadState.DONE),F.renderable=!0)}})}(D))}else{D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;m&&m.time&&(this._Provider._availability=new mt.TimeIntervalCollection([new mt.TimeInterval({start:m.time.start?mt.JulianDate.fromDate(new Date(m.time.start)):mt.Iso8601.MINIMUM_VALUE,stop:m.time.end?mt.JulianDate.fromDate(new Date(m.time.end)):mt.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(P){if(!mt.defined(P))throw new mt.DeveloperError("time is required.");var D=this._availability;return!mt.defined(D)||D.contains(P)}),M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=A.id,this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization2=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},E=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams);var T=f.url+"?"+this._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){(function(L,R,O){if(R.state===mt.QuadtreeTileLoadState.START){if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&O.item.show){var F=T.replace(window.encodeURIComponent("{x}"),R.x).replace(window.encodeURIComponent("{y}"),R.y).replace(window.encodeURIComponent("{z}"),R.level);O._cache&&(F+="&"+O._core.getuid()),O._core.xhr({url:F,type:"get",dataType:"json",success:function(k){if(k==null){R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}var U=new mt.PrimitiveCollection;O.Legend=[];function G(ee){for(var z=0;z<ee.length;z++)Array.isArray(ee[z])?G(ee[z]):J.push(ee[z])}function j(){if(O._option.extrudedHeight&&(A.extrudedHeight=O._option.extrudedHeight),/^\[/.test(O._option.extrudedHeight)&&/\]$/.test(O._option.extrudedHeight)){var ee=O._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(X.properties[ee])}if(A.material=O._option.material,/^\[/.test(O._option.material)&&/\]$/.test(O._option.material)){var z=O._option.material.replace(/\[/,"").replace(/\]/,"");A.material=X.properties[z],O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha))}else O._option.material&&(A.material=O._option.material),A.material&&(O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha)));if(J.length>=2){var ie=mt.Cartesian3.fromDegreesArray(J);A.polygonHierarchy=new mt.PolygonHierarchy(ie);var re=new mt.PolygonGeometry(A),ne=new mt.GeometryInstance({id:X,geometry:re,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(A.material)}}),oe=new mt.ClassificationPrimitive({geometryInstances:ne,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:O._core.Shaders("vertexShaderSource"),fragmentShaderSource:O._core.Shaders("fragmentShaderSource")}),classificationType:O._option.classificationType}),se="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;O.Legend.push(se),U.add(oe)}}for(var q=0;q<k.features.length;q++){var J=[],X=k.features[q];if(Array.isArray(X.geometry.coordinates)&&X.geometry.coordinates.length>0)if(Array.isArray(X.geometry.coordinates[0][0]))for(var Y=0;Y<X.geometry.coordinates.length;Y++)J=[],X.geometry.coordinates[Y].pop(),G(X.geometry.coordinates[Y]),j(J);else G(X.geometry.coordinates),j(J)}var Q=U;R.data.geometryPrimitive=Q,R.state=mt.QuadtreeTileLoadState.LOADING,R.state===mt.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive.update(L,[]),R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0)},error:function(){R.count==null&&(R.count=0),R.count+=1,R.count>=2?(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0):R.state=mt.QuadtreeTileLoadState.START}})}else{R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}R.state=mt.QuadtreeTileLoadState.LOADING}})(P,D,E)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization3=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},E=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams);var T=f.url+"?"+this._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){(function(L,R,O){if(R.state===mt.QuadtreeTileLoadState.START){if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&O.item.show){var F=T.replace(window.encodeURIComponent("{x}"),R.x).replace(window.encodeURIComponent("{y}"),R.y).replace(window.encodeURIComponent("{z}"),R.level);O._cache&&(F+="&"+O._core.getuid()),O._core.xhr({url:F,type:"get",dataType:"json",success:function(k){if(k==null){R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}var U=new mt.PrimitiveCollection;O.Legend=[];var G=[];function j(z){for(var ie=0;ie<z.length;ie++)Array.isArray(z[ie])?j(z[ie]):X.push(z[ie])}function q(){if(O._option.extrudedHeight&&(A.extrudedHeight=O._option.extrudedHeight),/^\[/.test(O._option.extrudedHeight)&&/\]$/.test(O._option.extrudedHeight)){var z=O._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(Y.properties[z])}if(A.material=O._option.material,/^\[/.test(O._option.material)&&/\]$/.test(O._option.material)){var ie=O._option.material.replace(/\[/,"").replace(/\]/,"");A.material=Y.properties[ie],O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha))}else O._option.material&&(A.material=O._option.material),A.material&&(O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha)));if(X.length>=2){var re=mt.Cartesian3.fromDegreesArray(X);A.polygonHierarchy=new mt.PolygonHierarchy(re);var ne=new mt.PolygonGeometry(A),oe=new mt.GeometryInstance({id:Y,geometry:ne,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(A.material)}});G.push(oe)}}for(var J=0;J<k.features.length;J++){var X=[],Y=k.features[J];if(Array.isArray(Y.geometry.coordinates)&&Y.geometry.coordinates.length>0)if(Array.isArray(Y.geometry.coordinates[0][0]))for(var Q=0;Q<Y.geometry.coordinates.length;Q++)X=[],Y.geometry.coordinates[Q].pop(),j(Y.geometry.coordinates[Q]),q(X);else j(Y.geometry.coordinates),q(X)}var ee=new mt.ClassificationPrimitive1({geometryInstances:G,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:O._core.Shaders("vertexShaderSource"),fragmentShaderSource:O._core.Shaders("fragmentShaderSource")}),classificationType:O._option.classificationType});R.data.geometryPrimitive=ee,R.state=mt.QuadtreeTileLoadState.LOADING,R.state===mt.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive.update(L,[]),R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0)},error:function(){R.count==null&&(R.count=0),R.count+=1,R.count>=2?(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0):R.state=mt.QuadtreeTileLoadState.START}})}else{R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}R.state=mt.QuadtreeTileLoadState.LOADING}})(P,D,E)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){if(this.tile=null,this.tile=D,D.state===this._cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var R=Ji.filter(A,function(F){return F.x==D.x&&F.y==D.y&&F.level==D.level});if(R.length!=0&&R[0].data&&R[0].data.length>0){D.data.geometryPrimitive=new mt.Primitive({geometryInstances:R[0].data,appearance:new mt.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:mt.ShadowMode.ENABLED}),D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}if(T.PrimitiveData.length>0){for(var O=0;O<T.PrimitiveData.length;O++)if(T.PrimitiveData[O].key==L){T.Primitivekey.includes(L)||T.Primitivekey.push(L);return}}T.Primitivekey.includes(L)||(T.Primitivekey.push(L),A.push({level:D.level,x:D.x,y:D.y,data:void 0}),function(F){var k=T._urlTemplate.replace(window.encodeURIComponent("{x}"),F.x).replace(window.encodeURIComponent("{y}"),F.y).replace(window.encodeURIComponent("{z}"),F.level);T.tilesLength++;var U="z"+F.level+"x"+F.x+"y"+F.y;T._cache&&(k+="&"+T._core.getuid()),T._core.xhr({url:k,type:"get",dataType:"json",success:function(G){var j=[],q=[],J=new mt.PrimitiveCollection;T.Legend=[];function X(oe){for(var se=0;se<oe.length;se++)Array.isArray(oe[se])?X(oe[se]):ee.push(oe[se])}function Y(){if(T._option.extrudedHeight&&(E.extrudedHeight=T._option.extrudedHeight),/^\[/.test(T._option.extrudedHeight)&&/\]$/.test(T._option.extrudedHeight)){var oe=T._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");E.extrudedHeight=parseFloat(z.properties[oe])}if(E.material=T._option.material,/^\[/.test(T._option.material)&&/\]$/.test(T._option.material)){var se=T._option.material.replace(/\[/,"").replace(/\]/,"");E.material=z.properties[se],T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha))}else T._option.material&&(E.material=T._option.material),E.material&&(T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha)));if(ee.length>=2){var ae=mt.Cartesian3.fromDegreesArray(ee);E.polygonHierarchy=new mt.PolygonHierarchy(ae);var fe=new mt.PolygonGeometry(E),de=new mt.GeometryInstance({id:z,geometry:fe,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(E.material)}}),ve=new mt.ClassificationPrimitive({geometryInstances:de,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:T._core.Shaders("vertexShaderSource"),fragmentShaderSource:T._core.Shaders("fragmentShaderSource")}),classificationType:T._option.classificationType}),pe="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;T.Legend.push(pe),J.add(ve)}}for(var Q=0;Q<G.features.length;Q++){var ee=[],z=G.features[Q];if(Array.isArray(z.geometry.coordinates)&&z.geometry.coordinates.length>0)if(Array.isArray(z.geometry.coordinates[0][0]))for(var ie=0;ie<z.geometry.coordinates.length;ie++)ee=[],z.geometry.coordinates[ie].pop(),X(z.geometry.coordinates[ie]),Y(ee);else X(z.geometry.coordinates),Y(ee)}var re=J;T.probj.push(re);var ne={level:F.level,key:U,data:re};T.loadFinishKey.push(U),T.PrimitiveData.push(ne),T._viewer.scene.primitives.add(re),T.returnCount++,T.removeObsoletePrimitives(F)},error:function(){var G=T.Primitivekey.indexOf(U);G>-1&&T.Primitivekey.splice(G,1),A=Ji.remove(A,function(j){return j.x==F.x&&j.y==F.y&&j.level==F.level})},complete:function(G,j){G=null,F.state=mt.QuadtreeTileLoadState.LOADING,F.state===mt.QuadtreeTileLoadState.LOADING&&(F.data.geometryPrimitive&&(F.state=mt.QuadtreeTileLoadState.DONE),F.renderable=!0)}})}(D))}else{D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization1=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){if(this.tile=null,this.tile=D,D.state===this._cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var R=Ji.filter(A,function(j){return j.x==D.x&&j.y==D.y&&j.level==D.level});if(R.length!=0&&R[0].data&&R[0].data.length>0){D.data.geometryPrimitive=new mt.Primitive({geometryInstances:R[0].data,appearance:new mt.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:mt.ShadowMode.ENABLED}),D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}if(T.PrimitiveData.length>0){for(var O=0;O<T.PrimitiveData.length;O++)if(T.PrimitiveData[O].key==L){T.Primitivekey.includes(L)||T.Primitivekey.push(L);return}}if(!T.Primitivekey.includes(L)){T.Primitivekey.push(L),A.push({level:D.level,x:D.x,y:D.y,data:void 0});for(var F=T._option.level_min+Math.floor((T._option.level_max-T._option.level_min)/2),k=xct(D,F),O=0;O<k.length;O++){var U=k[O],G="z"+U.level+"x"+U.x+"y"+U.y;T.loadAllKey.includes(G)||(T.loadAllKey.push(G),function(q){var J=T._urlTemplate.replace(window.encodeURIComponent("{x}"),q.x).replace(window.encodeURIComponent("{y}"),q.y).replace(window.encodeURIComponent("{z}"),q.level);T.tilesLength++;var X="z"+q.level+"x"+q.x+"y"+q.y;T._cache&&(J+="&"+T._core.getuid()),T._core.xhr({url:J,type:"get",dataType:"json",success:function(Y){var Q=[],ee=[];T.Legend=[];function z(de){for(var ve=0;ve<de.length;ve++)Array.isArray(de[ve])?z(de[ve]):ne.push(de[ve])}function ie(){if(T._option.extrudedHeight&&(E.extrudedHeight=T._option.extrudedHeight),/^\[/.test(T._option.extrudedHeight)&&/\]$/.test(T._option.extrudedHeight)){var de=T._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");E.extrudedHeight=parseFloat(oe.properties[de])}if(E.material=T._option.material,/^\[/.test(T._option.material)&&/\]$/.test(T._option.material)){var ve=T._option.material.replace(/\[/,"").replace(/\]/,"");E.material=oe.properties[ve],T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha))}else T._option.material&&(E.material=T._option.material),E.material&&(T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha)));if(ne.length>=2){var pe=mt.Cartesian3.fromDegreesArray(ne);E.polygonHierarchy=new mt.PolygonHierarchy(pe);var ce=new mt.PolygonGeometry(E),he=new mt.GeometryInstance({id:oe,geometry:ce,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(E.material)}}),Ce="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;T.Legend.push(Ce),Q.push(he)}}for(var re=0;re<Y.features.length;re++){var ne=[],oe=Y.features[re];if(Array.isArray(oe.geometry.coordinates)&&oe.geometry.coordinates.length>0)if(Array.isArray(oe.geometry.coordinates[0][0]))for(var se=0;se<oe.geometry.coordinates.length;se++)ne=[],oe.geometry.coordinates[se].pop(),z(oe.geometry.coordinates[se]),ie(ne);else z(oe.geometry.coordinates),ie(ne)}if(Q.length>0){var ae=new mt.GroundPrimitive({geometryInstances:Q,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:T._core.Shaders("vertexShaderSource"),fragmentShaderSource:T._core.Shaders("fragmentShaderSource")}),classificationType:T._option.classificationType,show:T.item.show});T.probj.push(ae);var fe={level:q.level,key:X,data:ae};T.loadFinishKey.push(X),T.PrimitiveData.push(fe),T._viewer.scene.primitives.add(ae),T.returnCount++}},error:function(){},complete:function(Y,Q){}})}(U))}}}else{D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization2=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},E=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams);var T=f.url+"?"+this._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){(function(L,R,O){if(R.state===mt.QuadtreeTileLoadState.START){if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&O.item.show){var F=T.replace(window.encodeURIComponent("{x}"),R.x).replace(window.encodeURIComponent("{y}"),R.y).replace(window.encodeURIComponent("{z}"),R.level);O._cache&&(F+="&"+O._core.getuid()),O._core.xhr({url:F,type:"get",dataType:"json",success:function(k){if(k==null){R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}var U=[],G=[];O.Legend=[];function j(z){for(var ie=0;ie<z.length;ie++)Array.isArray(z[ie])?j(z[ie]):X.push(z[ie])}function q(){if(O._option.extrudedHeight&&(A.extrudedHeight=O._option.extrudedHeight),/^\[/.test(O._option.extrudedHeight)&&/\]$/.test(O._option.extrudedHeight)){var z=O._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(Y.properties[z])}if(A.material=O._option.material,/^\[/.test(O._option.material)&&/\]$/.test(O._option.material)){var ie=O._option.material.replace(/\[/,"").replace(/\]/,"");A.material=Y.properties[ie],O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha))}else O._option.material&&(A.material=O._option.material),A.material&&(O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha)));if(X.length>=2){var re=mt.Cartesian3.fromDegreesArray(X);A.polygonHierarchy=new mt.PolygonHierarchy(re);var ne=new mt.PolygonGeometry(A),oe=new mt.GeometryInstance({id:Y,geometry:ne,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(A.material)}}),se="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;O.Legend.push(se),U.push(oe)}}for(var J=0;J<k.features.length;J++){var X=[],Y=k.features[J];if(Array.isArray(Y.geometry.coordinates)&&Y.geometry.coordinates.length>0)if(Array.isArray(Y.geometry.coordinates[0][0]))for(var Q=0;Q<Y.geometry.coordinates.length;Q++)X=[],Y.geometry.coordinates[Q].pop(),j(Y.geometry.coordinates[Q]),q(X);else j(Y.geometry.coordinates),q(X)}U.length==0&&(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0);var ee=new mt.GroundPrimitive1({geometryInstances:U,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:O._core.Shaders("vertexShaderSource"),fragmentShaderSource:O._core.Shaders("fragmentShaderSource")}),classificationType:O._option.classificationType});R.data.geometryPrimitive=ee,R.state=mt.QuadtreeTileLoadState.LOADING,R.state===mt.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive.update1(L,[]),R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0)},error:function(){R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0}})}else{R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}R.state=mt.QuadtreeTileLoadState.LOADING}})(P,D,E)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization3=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},E=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams);var T=f.url+"?"+this._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){(function(L,R,O){if(R.state===mt.QuadtreeTileLoadState.START){if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&O.item.show){var F=T.replace(window.encodeURIComponent("{x}"),R.x).replace(window.encodeURIComponent("{y}"),R.y).replace(window.encodeURIComponent("{z}"),R.level);O._cache&&(F+="&"+O._core.getuid()),O._core.xhr({url:F,type:"get",dataType:"json",success:function(k){var U=["#ffff00","#ffcc00","#ff3300","#ccff00","#cccc00","#99ff66","#999933","#66cc99","#6633ff","#33ffff","#3399cc","#009933","#ccccff","#ff99ff","#9966ff","#336699"];if(k==null){R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}var G=[],j=[];O.Legend=[];function q(ie){for(var re=0;re<ie.length;re++)Array.isArray(ie[re])?q(ie[re]):Y.push(ie[re])}function J(){if(O._option.extrudedHeight&&(A.extrudedHeight=O._option.extrudedHeight),/^\[/.test(O._option.extrudedHeight)&&/\]$/.test(O._option.extrudedHeight)){var ie=O._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(Q.properties[ie])}if(A.material=O._option.material,/^\[/.test(O._option.material)&&/\]$/.test(O._option.material)){var re=O._option.material.replace(/\[/,"").replace(/\]/,"");A.material=Q.properties[re],O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha))}else O._option.material&&(A.material=O._option.material),A.material&&(O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=O._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha)));if(Y.length>=2){var ne=mt.Cartesian3.fromDegreesArray(Y);A.polygonHierarchy=new mt.PolygonHierarchy(ne),(A.extrudedHeight==0||A.extrudedHeight=="0"||A.extrudedHeight==null||A.extrudedHeight==null)&&(A.extrudedHeight=1e4);var oe=new mt.PolygonGeometry(A),se=U[Math.floor(Math.random()*U.length)],ae=new mt.GeometryInstance({id:Q,geometry:oe,attributes:{color:mt.ColorGeometryInstanceAttribute.fromColor(mt.Color.fromCssColorString(se).withAlpha(.5))}}),fe="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;O.Legend.push(fe),G.push(ae)}}for(var X=0;X<k.features.length;X++){var Y=[],Q=k.features[X];if(Array.isArray(Q.geometry.coordinates)&&Q.geometry.coordinates.length>0)if(Array.isArray(Q.geometry.coordinates[0][0]))for(var ee=0;ee<Q.geometry.coordinates.length;ee++)Y=[],Q.geometry.coordinates[ee].pop(),q(Q.geometry.coordinates[ee]),J(Y);else q(Q.geometry.coordinates),J(Y)}G.length==0&&(R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0);var z=new mt.ClassificationPrimitive1({geometryInstances:G,classificationType:mt.ClassificationType.BOTH});R.data.geometryPrimitive=z,R.state=mt.QuadtreeTileLoadState.LOADING,R.state===mt.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive.update(L,[]),R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0)},error:function(){R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0}})}else{R.state=mt.QuadtreeTileLoadState.DONE,R.renderable=!0;return}R.state=mt.QuadtreeTileLoadState.LOADING}})(P,D,E)},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createPointGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this;!w._core.isnull(m)&&!w._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(w._core.isHtmlColor(m.color)?m.color=w._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=w._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=w._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),!w._core.isnull(m)&&!w._core.isnull(m.outlineColor)&&(/^\[/.test(m.outlineColor)&&m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(w._core.isHtmlColor(m.outlineColor)?m.outlineColor=w._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=w._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=w._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))));var w=this;this._urlTemplate=f.url+"?"+this._serialize(C.urlParams);var A=f.url+"?"+this._serialize(C.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1;var E={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:mt.LabelStyle.OUTLINE,fillColor:mt.Color.WHITE,outlineColor:mt.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new mt.Color(.165,.165,.165,.8),backgroundPadding:new mt.Cartesian2(7,5),scale:1,horizontalOrigin:mt.HorizontalOrigin.CENTER,verticalOrigin:mt.VerticalOrigin.CENTER,eyeOffset:mt.Cartesian3.ZERO,pixelOffset:mt.Cartesian2.ZERO,heightReference:mt.HeightReference.NONE,scaleByDistance:new mt.NearFarScalar(0,0,1,1)};!w._core.isnull(m)&&!w._core.isnull(m.backgroundColor)&&(/^\[/.test(m.backgroundColor)&&m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(w._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=w._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=w._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=w._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))));var T=w._core.extend(E,m,!0);w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var S=parseFloat(m.near),M=parseFloat(m.far),I=new mt.DistanceDisplayCondition(S,M);T.distanceDisplayCondition=I,w._core.isnull(m.font_size)&&(m.font_size="30px"),w._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),T.font=parseFloat(m.font_size)+"px "+m.font_family;var P=m.material;this._Provider.loadTile=function(O,F){(function(k,U,G){if(U.state===mt.QuadtreeTileLoadState.START){if(U.data={lines:[],geometryPrimitive:void 0},U.level>=m.level_min&&U.level<m.level_max&&G.item.show){var j=A.replace(window.encodeURIComponent("{x}"),U.x).replace(window.encodeURIComponent("{y}"),U.y).replace(window.encodeURIComponent("{z}"),U.level);G._cache&&(j+="&"+G._core.getuid()),G._core.xhr({url:j,type:"get",dataType:"json",success:function(q){if(q==null){U.state=mt.QuadtreeTileLoadState.DONE,U.renderable=!0;return}var J=new mt.PointPrimitiveCollection;q.features.forEach(function(X){T.id=X;var Y=0;if(/^\[/.test(T.pointHeight)&&/\]$/.test(T.pointHeight)){var Q=T.pointHeight.replace(/\[/,"").replace(/\]/,"");Y=parseFloat(X.properties[Q])}else T.pointHeight!==void 0&&T.pointHeight!==""?Y=parseFloat(T.pointHeight):X.properties.height!=null&&(Y=parseFloat(X.properties.height));if(/^\[/.test(m.color)&&/\]$/.test(m.color)){var ee=m.color.replace(/\[/,"").replace(/\]/,"");T.color=X.properties[ee],G._core.isHtmlColor(T.color)?T.color=G._color.colorFromHtmlColor(T.color):(/^rgb/.test(T.color)&&(T.color=G._color.rgbaStringToRgbaObj(T.color)),T.color.r>1&&(T.color.r=T.color.r/255),T.color.g>1&&(T.color.g=T.color.g/255),T.color.b>1&&(T.color.b=T.color.b/255),T.color.a>1&&(T.color.a=T.color.a/255),T.color=G._color.createColor(T.color.r,T.color.g,T.color.b,T.color.a))}if(/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)){var ee=m.outlineColor.replace(/\[/,"").replace(/\]/,"");T.outlineColor=X.properties[ee],G._core.isHtmlColor(T.outlineColor)?T.outlineColor=G._color.colorFromHtmlColor(T.outlineColor):(/^rgb/.test(T.outlineColor)&&(T.outlineColor=G._color.rgbaStringToRgbaObj(T.outlineColor)),T.outlineColor.r>1&&(T.outlineColor.r=T.outlineColor.r/255),T.outlineColor.g>1&&(T.outlineColor.g=T.outlineColor.g/255),T.outlineColor.b>1&&(T.outlineColor.b=T.outlineColor.b/255),T.outlineColor.a>1&&(T.outlineColor.a=T.outlineColor.a/255),T.outlineColor=G._color.createColor(T.outlineColor.r,T.outlineColor.g,T.outlineColor.b,T.outlineColor.a))}T.position=new mt.Cartesian3.fromDegrees(X.geometry.coordinates[0],X.geometry.coordinates[1],Y),T.text=X.properties.name;var z={show:T.show,position:T.position,pixelSize:T.pixelSize,color:T.color,outlineColor:T.outlineColor,outlineWidth:T.outlineWidth,id:X};if(T.color&&T.color.red){var ie="color:"+T.color.red*255+","+T.color.green*255+","+T.color.blue*255+";outlineColor:"+T.outlineColor.red*255+","+T.outlineColor.green*255+","+T.outlineColor.blue*255;G.Legend.push(ie)}z.id.treeID=m.id,z.id.VectorType="point",z.id.VectorStyle={show:z.show,pointHeight:Y,position:z.position,pixelSize:z.pixelSize,color:z.color,outlineColor:z.outlineColor,outlineWidth:z.outlineWidth},J.add(z)}),U.data.geometryPrimitive=J,U.state=mt.QuadtreeTileLoadState.LOADING,U.state===mt.QuadtreeTileLoadState.LOADING&&(U.data.geometryPrimitive.update(k,[]),U.state=mt.QuadtreeTileLoadState.DONE,U.renderable=!0)},error:function(){U.count==null&&(U.count=0),U.count+=1,U.count>=2?(U.state=mt.QuadtreeTileLoadState.DONE,U.renderable=!0):U.state=mt.QuadtreeTileLoadState.START}})}else{U.state=mt.QuadtreeTileLoadState.DONE,U.renderable=!0;return}U.state=mt.QuadtreeTileLoadState.LOADING}})(O,F,w)},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var D=this._viewer.scene,L=D.primitives;m&&m.time&&(this._Provider._availability=new mt.TimeIntervalCollection([new mt.TimeInterval({start:m.time.start?mt.JulianDate.fromDate(new Date(m.time.start)):mt.Iso8601.MINIMUM_VALUE,stop:m.time.end?mt.JulianDate.fromDate(new Date(m.time.end)):mt.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(O){if(!mt.defined(O))throw new mt.DeveloperError("time is required.");var F=this._availability;return!mt.defined(F)||F.contains(O)}),L.add(this._primitive),y?(this.item.show=!0,this.setVisibility(!0)):this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var R={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=m.id,this.setTreeobj(R),this._tree.insertGroupId(R,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.VolumeVectorGeoJsonFeatureLayerOptimization=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend({...C},m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A={id:this._option.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},E=this;let T=f.url.indexOf("/gisserver/")>-1;var S;T?S=f.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:S=f.url+"?"+this._serialize(w.urlParams),this._urlTemplate=S,this._Provider=new ol(this._viewer,this._cesium,T?new mt.WebMercatorTilingScheme:void 0),this._Provider._normalTile=m.level_max-1,this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(R,O){(function(F,k,U){if(k.state===mt.QuadtreeTileLoadState.START){if(k.data={lines:[],geometryPrimitive:void 0},k.level>=m.level_min&&k.level<m.level_max&&U.item.show){if(T&&(k.reverseY=U._Provider.tilingScheme.getNumberOfYTilesAtLevel(k.level)-k.y-1),U.TileMatrixLimits){let j=U.TileMatrixLimits[k.level];if(!j||j&&(k.x>j.maxCol||k.x<j.minCol||k.y>j.maxRow||k.y<j.minRow)){k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0;return}}var G=S.replace(window.encodeURIComponent("{x}"),k.x).replace(window.encodeURIComponent("{y}"),k.reverseY||k.y).replace(window.encodeURIComponent("{z}"),k.level);U._cache&&(G+="&"+U._core.getuid()),U._core.xhr({url:G,type:"get",dataType:"json",success:function(j){if(j==null){k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0;return}var q=[],J=[];U.Legend=[];function X(se){for(var ae=0;ae<se.length;ae++)Array.isArray(se[ae])?X(se[ae]):(ee.push(se[ae]),ae===2&&!z&&(z=!0))}function Y(){if(/^\[/.test(U._option.extrudedHeight)&&/\]$/.test(U._option.extrudedHeight)){let pe=U._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(ie.properties[pe])}else U._option.extrudedHeight&&(A.extrudedHeight=parseFloat(U._option.extrudedHeight));if(/^\[/.test(U._option.height)&&/\]$/.test(U._option.height)){let pe=U._option.height.replace(/\[/,"").replace(/\]/,"");A.height=parseFloat(ie.properties[pe])}else U._option.height&&(A.height=parseFloat(U._option.height));if(A.material=U._option.material,/^\[/.test(U._option.material)&&/\]$/.test(U._option.material)){var se=U._option.material.replace(/\[/,"").replace(/\]/,"");A.material=ie.properties[se],U._core.isHtmlColor(A.material)?A.material=U._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=U._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=U._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha))}else U._option.material&&(A.material=U._option.material),A.material&&(U._core.isHtmlColor(A.material)?A.material=U._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=U._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=U._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha)));if(m.preLoad&&m.preLoad(A,ie),ee.length>=2){var ae=z?mt.Cartesian3.fromDegreesArrayHeights(ee):mt.Cartesian3.fromDegreesArray(ee);A.polygonHierarchy=new mt.PolygonHierarchy(ae);var fe=new mt.PolygonGeometry(A);ie.treeID=A.id,ie.VectorType="polygon",ie.VectorStyle={haveZ:z,extrudedHeight:A.extrudedHeight,positions:ee,material:A.material};var de=new mt.GeometryInstance({id:ie,geometry:fe,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(A.material),distanceDisplayCondition:new mt.DistanceDisplayConditionGeometryInstanceAttribute(U._option.near,U._option.far)}}),ve="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;U.Legend.push(ve),q.push(de)}}for(var Q=0;Q<j.features.length;Q++){var ee=[],z=!1,ie=j.features[Q];if(Array.isArray(ie.geometry.coordinates)&&ie.geometry.coordinates.length>0)if(Array.isArray(ie.geometry.coordinates[0][0]))for(var re=0;re<ie.geometry.coordinates.length;re++)ee=[],ie.geometry.coordinates[re].pop(),X(ie.geometry.coordinates[re]),Y(ee);else X(ie.geometry.coordinates),Y(ee)}q.length==0&&(k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0);var ne,oe;A.material.alpha<1?oe=new mt.PerInstanceColorAppearance({translucent:!0}):oe=new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:U._core.Shaders("vertexShaderSource"),fragmentShaderSource:U._core.Shaders("fragmentShaderSource")}),U._option.clampToGround?ne=new mt.GroundPrimitive({geometryInstances:q,appearance:oe,classificationType:U._option.classificationType}):ne=new mt.Primitive({geometryInstances:q,appearance:oe,shadows:U._option.shadows}),k.data.geometryPrimitive=ne,k.state=mt.QuadtreeTileLoadState.LOADING,k.state===mt.QuadtreeTileLoadState.LOADING&&(k.data.geometryPrimitive.update(F,[]),k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0)},error:function(){k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0}})}else{k.state=mt.QuadtreeTileLoadState.DONE,k.renderable=!0;return}k.state=mt.QuadtreeTileLoadState.LOADING}})(R,O,E)},typeof x=="function"&&x(this.item)};let M,I;this.saveDefaultVectorData=()=>{I=E._core.extend({},m,!0)},this.restoreVector=()=>{I&&(m=I,E._option=E._core.extend({...C},m,!0),E._Provider._normalTile=m.level_max-1,E._primitive&&E._primitive._tilesToRender&&E._primitive._tilesToRender.length&&(E._primitive._tilesToRender.forEach(R=>{R.data.geomeitryPrimitive&&R.data.geomeitryPrimitive.destroy(),R.state=mt.QuadtreeTileLoadState.START}),E._primitive._tileToUpdateHeights.forEach(R=>{R.data.geomeitryPrimitive&&R.data.geomeitryPrimitive.destroy(),R.state=mt.QuadtreeTileLoadState.START}),E._primitive._tileToUpdateHeights=[],E._primitive._tilesToRender=[])),I=void 0},this.updataVector=(R={})=>{(R.material||R.outlineColor)&&(R.material&&(R.material=mt.Color.fromCssColorString(R.material)),R.outlineColor&&(R.outlineColor=mt.Color.fromCssColorString(R.outlineColor))),(R.minimumLevel!==void 0||R.maximumLevel!==void 0)&&(R.minimumLevel!==void 0&&(R.level_min=R.minimumLevel),R.maximumLevel!==void 0&&(R.level_max=R.maximumLevel)),m=E._core.extend(m,R,!0),E._option=E._core.extend(E._option,m,!0),E._Provider._normalTile=m.level_max-1,E._primitive&&E._primitive._tilesToRender&&E._primitive._tilesToRender.length&&(clearTimeout(M),M=setTimeout(()=>{E._primitive._tilesToRender.forEach(O=>{O.data.geomeitryPrimitive&&O.data.geomeitryPrimitive.destroy(),O.state=mt.QuadtreeTileLoadState.START}),E._primitive._tileToUpdateHeights.forEach(O=>{O.data.geomeitryPrimitive&&O.data.geomeitryPrimitive.destroy(),O.state=mt.QuadtreeTileLoadState.START}),E._primitive._tileToUpdateHeights=[],E._primitive._tilesToRender=[]},100))},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var P=this._viewer.scene,D=P.primitives;m&&m.time&&(this._Provider._availability=new mt.TimeIntervalCollection([new mt.TimeInterval({start:m.time.start?mt.JulianDate.fromDate(new Date(m.time.start)):mt.Iso8601.MINIMUM_VALUE,stop:m.time.end?mt.JulianDate.fromDate(new Date(m.time.end)):mt.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(R){if(!mt.defined(R))throw new mt.DeveloperError("time is required.");var O=this._availability;return!mt.defined(O)||O.contains(R)}),D.add(this._primitive),this._core.getWMTSData({url:f.url,layer:f.layer,srs:f.srs||"EPSG:4490",gisserverTMS:T},R=>{E.item.boundingSphere=R.boundingSphere,E.TileMatrixLimits=R.TileMatrixLimits,E.initThisProvider()}),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var L={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=L.id,this.setTreeobj(L),this._tree.insertGroupId(L,this._core.isnull(v)?0:v),this};Ml.prototype.createModelGeoJsonFeatureLayerProvider0825=function(o,f,m,v,y,x){var C=this,w={url:"",color:mt.Color.DARKSALMON,scale:2},A={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!C._core.isnull(m)&&!C._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(C._core.isHtmlColor(m.color)?m.color=C._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=C._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=C._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))));var E=C._core.extend(w,m,!0);C._core.isnull(m.near)&&(m.near=0),C._core.isnull(m.far)&&(m.far=999999999);var T=parseFloat(m.near),S=parseFloat(m.far),M=new mt.DistanceDisplayCondition(T,S);E.distanceDisplayCondition=M;var I=m.material;this._urlTemplate=f.url+"?"+this._serialize(A.urlParams);var P=f.url+"?"+this._serialize(A.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(E.height)||0,this._Provider.loadTile=function(O,F){if(F.state===mt.QuadtreeTileLoadState.START){if(F.data={lines:[],geometryPrimitive:void 0},F.level>=m.level_min&&F.level<m.level_max&&C.item.show){var k=P.replace(window.encodeURIComponent("{x}"),F.x).replace(window.encodeURIComponent("{y}"),F.y).replace(window.encodeURIComponent("{z}"),F.level);C._cache&&(k+="&"+C._core.getuid()),C._core.xhr({url:k,type:"get",dataType:"json",success:function(U){if(U==null){F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0;return}var G=new mt.PrimitiveCollection({isModel:!0});U.features.forEach(function(j){E.id=j;var q=j.geometry.coordinates[2]||0;if(j.properties.height!=null&&(q=parseFloat(j.properties.height)),/^\[/.test(E.height)&&/\]$/.test(E.height)){var J=E.height.replace(/\[/,"").replace(/\]/,"");q+=parseFloat(j.properties[J])}else q+=parseFloat(E.height)||0;E.modelMatrix=mt.Transforms.eastNorthUpToFixedFrame(mt.Cartesian3.fromDegrees(j.geometry.coordinates[0],j.geometry.coordinates[1],q));var X=mt.Model.fromGltf({id:j,url:E.uri,color:E.color,modelMatrix:E.modelMatrix,scale:E.scale,heightReference:parseInt(E.heightReference),distanceDisplayCondition:E.distanceDisplayCondition});G.add(X)}),U.features.length==0&&(F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0),F.data.geometryPrimitive=G,F.state=mt.QuadtreeTileLoadState.LOADING,F.state===mt.QuadtreeTileLoadState.LOADING&&(F.data.geometryPrimitive.update(O,[]),F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0)},error:function(){F.count==null&&(F.count=0),F.count+=1,F.count>=2?(F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0):F.state=mt.QuadtreeTileLoadState.START}})}else{F.state=mt.QuadtreeTileLoadState.DONE,F.renderable=!0;return}F.state=mt.QuadtreeTileLoadState.LOADING}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var D=this._viewer.scene,L=D.primitives;L.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var R={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(R),this._tree.insertGroupId(R,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createModelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=this,w={url:"",color:mt.Color.DARKSALMON,scale:2},A={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium};!C._core.isnull(m)&&!C._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(C._core.isHtmlColor(m.color)?m.color=C._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=C._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=C._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))));var E=C._core.extend(w,m,!0);C._core.isnull(m.near)&&(m.near=0),C._core.isnull(m.far)&&(m.far=999999999);var T=parseFloat(m.near),S=parseFloat(m.far),M=new mt.DistanceDisplayCondition(T,S);E.distanceDisplayCondition=M;var I=m.material;let P=f.url.indexOf("/gisserver/")>-1;var D;P?D=f.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:D=f.url+"?"+this._serialize(A.urlParams),this._urlTemplate=D,this._Provider=new ol(this._viewer,this._cesium,P?new mt.WebMercatorTilingScheme:void 0),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(E.height)||0,this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(U,G){if(G.state===mt.QuadtreeTileLoadState.START){if(G.data={lines:[],geometryPrimitive:void 0},G.level>=m.level_min&&G.level<m.level_max&&C.item.show){if(P&&(G.reverseY=C._Provider.tilingScheme.getNumberOfYTilesAtLevel(G.level)-G.y-1),C.TileMatrixLimits){let q=C.TileMatrixLimits[G.level];if(!q||q&&(G.x>q.maxCol||G.x<q.minCol||G.y>q.maxRow||G.y<q.minRow)){G.state=mt.QuadtreeTileLoadState.DONE,G.renderable=!0;return}}var j=D.replace(window.encodeURIComponent("{x}"),G.x).replace(window.encodeURIComponent("{y}"),G.reverseY||G.y).replace(window.encodeURIComponent("{z}"),G.level);C._cache&&(j+="&"+C._core.getuid()),C._core.xhr({url:j,type:"get",dataType:"json",success:function(q){if(q==null){G.state=mt.QuadtreeTileLoadState.DONE,G.renderable=!0;return}let J=[],X;mt.ModelInstanceCollection||(X=new mt.PrimitiveCollection),q.features.forEach(function(Y){E.id=Y;var Q=Y.geometry.coordinates[2]||0;if(Y.properties.height!=null&&(Q=parseFloat(Y.properties.height)),/^\[/.test(E.height)&&/\]$/.test(E.height)){var ee=E.height.replace(/\[/,"").replace(/\]/,"");Q+=parseFloat(Y.properties[ee])}else Q+=parseFloat(E.height)||0;let z=mt.Transforms.eastNorthUpToFixedFrame(mt.Cartesian3.fromDegrees(Y.geometry.coordinates[0],Y.geometry.coordinates[1],Q)),ie=E.heading||0,re=E.pitch||0,ne=E.roll||0;/^\[/.test(ie)&&/\]$/.test(ie)&&(ie=ie.replace(/\[/,"").replace(/\]/,""),ie=parseFloat(Y.properties[ie])),/^\[/.test(re)&&/\]$/.test(re)&&(re=re.replace(/\[/,"").replace(/\]/,""),re=parseFloat(Y.properties[re])),/^\[/.test(ne)&&/\]$/.test(ne)&&(ne=ne.replace(/\[/,"").replace(/\]/,""),ne=parseFloat(Y.properties[ne]));let oe=new mt.HeadingPitchRoll(mt.Math.toRadians(ie),mt.Math.toRadians(re),mt.Math.toRadians(ne)),se=mt.Matrix3.fromHeadingPitchRoll(oe);mt.Matrix4.multiplyByMatrix3(z,se,z),mt.Matrix4.multiplyByUniformScale(z,E.scale,z),X?X.add(mt.Model.fromGltf({id:Y,url:E.uri,modelMatrix:z,color:E.color})):J.push({modelMatrix:z,modelId:Y})}),X||(X=new mt.ModelInstanceCollection({url:E.uri,instances:J,color:E.color})),q.features.length==0&&(G.state=mt.QuadtreeTileLoadState.DONE,G.renderable=!0),G.data.geometryPrimitive=X,G.state=mt.QuadtreeTileLoadState.LOADING,G.state===mt.QuadtreeTileLoadState.LOADING&&(G.data.geometryPrimitive.update(U,[]),G.state=mt.QuadtreeTileLoadState.DONE,G.renderable=!0)},error:function(){G.count==null&&(G.count=0),G.count+=1,G.count>=2?(G.state=mt.QuadtreeTileLoadState.DONE,G.renderable=!0):G.state=mt.QuadtreeTileLoadState.START}})}else{G.state=mt.QuadtreeTileLoadState.DONE,G.renderable=!0;return}G.state=mt.QuadtreeTileLoadState.LOADING}},typeof x=="function"&&x(this.item)};let L,R;this.saveDefaultVectorData=()=>{R=C._core.extend({},m,!0)},this.restoreVector=()=>{R&&(m=R,E=C._core.extend({...w},m,!0),C._Provider._normalTile=m.level_max-1,C._primitive&&C._primitive._tilesToRender&&C._primitive._tilesToRender.length&&(C._primitive._tilesToRender.forEach(U=>{U.data.geomeitryPrimitive&&U.data.geomeitryPrimitive.destroy(),U.state=mt.QuadtreeTileLoadState.START}),C._primitive._tileToUpdateHeights.forEach(U=>{U.data.geomeitryPrimitive&&U.data.geomeitryPrimitive.destroy(),U.state=mt.QuadtreeTileLoadState.START}),C._primitive._tileToUpdateHeights=[],C._primitive._tilesToRender=[])),R=void 0},this.updataVector=(U={})=>{(U.color||U.material)&&(U.color=mt.Color.fromCssColorString(U.color||U.material)),(U.minimumLevel!==void 0||U.maximumLevel!==void 0)&&(U.minimumLevel!==void 0&&(U.level_min=U.minimumLevel),U.maximumLevel!==void 0&&(U.level_max=U.maximumLevel)),m=C._core.extend(m,U,!0),E=C._core.extend(E,m,!0),C._Provider._normalTile=m.level_max-1,C._primitive&&C._primitive._tilesToRender&&C._primitive._tilesToRender.length&&(clearTimeout(L),L=setTimeout(()=>{C._primitive._tilesToRender.forEach(G=>{G.data.geomeitryPrimitive&&G.data.geomeitryPrimitive.destroy(),G.state=mt.QuadtreeTileLoadState.START}),C._primitive._tileToUpdateHeights.forEach(G=>{G.data.geomeitryPrimitive&&G.data.geomeitryPrimitive.destroy(),G.state=mt.QuadtreeTileLoadState.START}),C._primitive._tileToUpdateHeights=[],C._primitive._tilesToRender=[]},100))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var O=this._viewer.scene,F=O.primitives;m&&m.time&&(this._Provider._availability=new mt.TimeIntervalCollection([new mt.TimeInterval({start:m.time.start?mt.JulianDate.fromDate(new Date(m.time.start)):mt.Iso8601.MINIMUM_VALUE,stop:m.time.end?mt.JulianDate.fromDate(new Date(m.time.end)):mt.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(U){if(!mt.defined(U))throw new mt.DeveloperError("time is required.");var G=this._availability;return!mt.defined(G)||G.contains(U)}),F.add(this._primitive),this._core.getWMTSData({url:f.url,layer:f.layer,srs:f.srs||"EPSG:4490",gisserverTMS:P},U=>{C.item.boundingSphere=U.boundingSphere,C.TileMatrixLimits=U.TileMatrixLimits,C.initThisProvider()}),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var k={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(k),this._tree.insertGroupId(k,this._core.isnull(v)?0:v),this};Ml.prototype.VolumeVectorGeoJsonFeatureLayerOptimization1=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,T._defaultStyle={outlineColor:mt.Color.fromCssColorString("rgba(209,204,226,0)"),lineWidth:0,outline:!0,fill:!0,fillColor:mt.Color.fromCssColorString("rgba(220,20,60,1)"),fillShow:"nod",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:mt.Color.fromCssColorString("rgba(255,0,0,1)"),labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"\u9ED1\u4F53",pointColor:mt.Color.fromCssColorString("rgba(255,0,0,0)"),centerLabelPropertyName:"NAME"},T._option.fill.indexOf("[")!=-1?T._defaultStyle.fillShow=T._option.fill:T._defaultStyle.fillColor=mt.Color.fromCssColorString(T._option.fill),this._Provider.loadTile=function(P,D){if(this.tile=null,this.tile=D,D.state===this._cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>m.level_max+2&&T.probj.length>0)for(var R=0;R<T.probj.length;k++){T._viewer.entities.remove(T.probj[R]);var O=T.probj.indexOf(T.probj[R]);T.probj.splice(O,1)}if(D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var F=Ji.filter(A,function(U){return U.x==D.x&&U.y==D.y&&U.level==D.level});if(F.length!=0&&F[0].data&&F[0].data.length>0){D.data.geometryPrimitive=new mt.Primitive({geometryInstances:F[0].data,appearance:new mt.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:mt.ShadowMode.ENABLED}),D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}if(T.PrimitiveData.length>0){for(var k=0;k<T.PrimitiveData.length;k++)if(T.PrimitiveData[k].key==L){T.Primitivekey.includes(L)||T.Primitivekey.push(L);return}}T.Primitivekey.includes(L)||(T.Primitivekey.push(L),A.push({level:D.level,x:D.x,y:D.y,data:void 0}),function(U){var G=T._urlTemplate.replace(window.encodeURIComponent("{x}"),U.x).replace(window.encodeURIComponent("{y}"),U.y).replace(window.encodeURIComponent("{z}"),U.level);T.tilesLength++;var j="z"+U.level+"x"+U.x+"y"+U.y;T._cache&&(G+="&"+T._core.getuid());var q={xMin:mt.Math.toDegrees(U._rectangle.west),yMin:mt.Math.toDegrees(U._rectangle.south),xMax:mt.Math.toDegrees(U._rectangle.east),yMax:mt.Math.toDegrees(U._rectangle.north)};T._core.xhr({url:G,type:"get",dataType:"json",success:function(J){var X=J;T._tileWidth=256,T._tileHeight=256,T.x=U._x,T.y=U._y,T.level=U._level,T._createCanvas(),T._drawGeojson(T._context,0,0,J,q,T._tileWidth,T._tileHeight,T._fill,T._outline,T.x,T.y,T.level);var Y=T._viewer.entities.add({ids:X,name:"Rotating rectangle with rotating texture coordinate",rectangle:{coordinates:U.rectangle,material:new mt.ImageMaterialProperty({image:T._canvas,transparent:!0}),zIndex:U.level,classificationType:mt.ClassificationType.BOTH}});T.probj.push(Y);var Q={level:U.level,key:j,data:Y};T.loadFinishKey.push(j),T.PrimitiveData.push(Q),T.returnCount++,T.removeObsoleteEntitiesxp(U.rectangle)},error:function(){U.state=mt.QuadtreeTileLoadState.DONE,U.renderable=!0}})}(D))}else{D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,T._defaultStyle={outlineColor:mt.Color.fromCssColorString("rgba(209,204,226,0)"),lineWidth:0,outline:!0,fill:!0,fillColor:mt.Color.fromCssColorString("rgba(220,20,60,1)"),fillShow:"nod",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:mt.Color.fromCssColorString("rgba(255,0,0,1)"),labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"\u9ED1\u4F53",pointColor:mt.Color.fromCssColorString("rgba(255,0,0,0)"),centerLabelPropertyName:"NAME"},T._option.fill.indexOf("[")!=-1?T._defaultStyle.fillShow=T._option.fill:T._defaultStyle.fillColor=mt.Color.fromCssColorString(T._option.fill),this._Provider.loadTile=function(P,D){if(this.tile=null,this.tile=D,D.state===this._cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>m.level_max+2&&T.probj.length>0)for(var R=0;R<T.probj.length;k++){T._viewer.entities.remove(T.probj[R]);var O=T.probj.indexOf(T.probj[R]);T.probj.splice(O,1)}if(D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var F=Ji.filter(A,function(U){return U.x==D.x&&U.y==D.y&&U.level==D.level});if(F.length!=0&&F[0].data&&F[0].data.length>0){D.data.geometryPrimitive=new mt.Primitive({geometryInstances:F[0].data,appearance:new mt.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:mt.ShadowMode.ENABLED}),D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}if(T.PrimitiveData.length>0){for(var k=0;k<T.PrimitiveData.length;k++)if(T.PrimitiveData[k].key==L){T.Primitivekey.includes(L)||T.Primitivekey.push(L);return}}T.Primitivekey.includes(L)||(T.Primitivekey.push(L),A.push({level:D.level,x:D.x,y:D.y,data:void 0}),function(U){var G=T._urlTemplate.replace(window.encodeURIComponent("{x}"),U.x).replace(window.encodeURIComponent("{y}"),U.y).replace(window.encodeURIComponent("{z}"),U.level);T.tilesLength++;var j="z"+U.level+"x"+U.x+"y"+U.y;T._cache&&(G+="&"+T._core.getuid());var q={xMin:mt.Math.toDegrees(U._rectangle.west),yMin:mt.Math.toDegrees(U._rectangle.south),xMax:mt.Math.toDegrees(U._rectangle.east),yMax:mt.Math.toDegrees(U._rectangle.north)};T._core.xhr({url:G,type:"get",dataType:"json",success:function(J){var X=J;T._tileWidth=256,T._tileHeight=256,T.x=U._x,T.y=U._y,T.level=U._level;var Y=T._viewer.entities.add({ids:X,name:"Rotating rectangle with rotating texture coordinate",rectangle:{coordinates:U.rectangle,material:new mt.ImageMaterialProperty({image:J,transparent:!0}),zIndex:U.level,classificationType:mt.ClassificationType.BOTH}});T.probj.push(Y);var Q={level:U.level,key:j,data:Y};T.loadFinishKey.push(j),T.PrimitiveData.push(Q),T.returnCount++,T.removeObsoleteEntitiesxp(U.rectangle)},error:function(){U.state=mt.QuadtreeTileLoadState.DONE,U.renderable=!0}})}(D))}else{D.state=mt.QuadtreeTileLoadState.LOADING,D.state===mt.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=mt.QuadtreeTileLoadState.DONE),D.renderable=!0);return}}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A={id:this._option.id,polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},E=this;let T=f.url.indexOf("/gisserver/")>-1;var S;T?S=f.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:S=f.url+"?"+this._serialize(w.urlParams),this._urlTemplate=S,this._Provider=new ol(this._viewer,this._cesium,T?new mt.WebMercatorTilingScheme:void 0),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height||0),this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(D,L){(function(R,O,F){if(O.state===mt.QuadtreeTileLoadState.START){if(O.data={lines:[],geometryPrimitive:void 0},O.level>=m.level_min&&O.level<m.level_max&&F.item.show){if(F.TileMatrixLimits){let U=F.TileMatrixLimits[O.level];if(!U||U&&(O.x>U.maxCol||O.x<U.minCol||O.y>U.maxRow||O.y<U.minRow)){O.state=mt.QuadtreeTileLoadState.DONE,O.renderable=!0;return}}var k=S.replace(window.encodeURIComponent("{x}"),O.x).replace(window.encodeURIComponent("{y}"),O.y).replace(window.encodeURIComponent("{z}"),O.level);F._cache&&(k+="&"+F._core.getuid()),F._core.xhr({url:k,type:"get",dataType:"json",success:function(U){var G=Ji.cloneDeep(U);if(G.features.length<=0){O.state=mt.QuadtreeTileLoadState.DONE,O.renderable=!0;return}if(G==null){O.state=mt.QuadtreeTileLoadState.DONE,O.renderable=!0;return}var j=[],q=[];F.Legend=[];function J(ne){for(var oe=0;oe<ne.length;oe++)Array.isArray(ne[oe])?J(ne[oe]):(Q.push(ne[oe]),oe===2&&!ee&&(ee=!0))}function X(){if(/^\[/.test(F._option.extrudedHeight)&&/\]$/.test(F._option.extrudedHeight)){var ne=F._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(z.properties[ne])}if(A.material=F._option.material,/^\[/.test(F._option.material)&&/\]$/.test(F._option.material)){var oe=F._option.material.replace(/\[/,"").replace(/\]/,"");A.material=z.properties[oe],F._core.isHtmlColor(A.material)?A.material=F._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=F._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=F._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha))}else F._option.material&&(A.material=F._option.material),A.material&&(F._core.isHtmlColor(A.material)?A.material=F._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=F._color.rgbaStringToRgbaObj(A.material)),A.material.red>1&&(A.material.red=A.material.red/255),A.material.green>1&&(A.material.green=A.material.green/255),A.material.blue>1&&(A.material.blue=A.material.blue/255),A.material.alpha>1&&(A.material.a=A.material.alpha/255),A.material=F._color.createColor(A.material.red,A.material.green,A.material.blue,A.material.alpha)));if(Q.length>=2){var se=ee?mt.Cartesian3.fromDegreesArrayHeights(Q):mt.Cartesian3.fromDegreesArray(Q);A.polygonHierarchy=new mt.PolygonHierarchy(se);var ae=new mt.PolygonGeometry(A);z.treeID=A.id,z.VectorType="polygon",z.VectorStyle={haveZ:ee,extrudedHeight:A.extrudedHeight,positions:Q,material:A.material};var fe=new mt.GeometryInstance({id:z,geometry:ae,attributes:{color:new mt.ColorGeometryInstanceAttribute.fromColor(A.material)}}),de="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;F.Legend.push(de),j.push(fe)}}for(var Y=0;Y<G.features.length;Y++){var Q=[],ee=!1,z=G.features[Y];if(Array.isArray(z.geometry.coordinates)&&z.geometry.coordinates.length>0)if(Array.isArray(z.geometry.coordinates[0][0]))for(var ie=0;ie<z.geometry.coordinates.length;ie++)Q=[],z.geometry.coordinates[ie].pop(),J(z.geometry.coordinates[ie]),X(Q);else J(z.geometry.coordinates),X(Q)}j.length==0&&(O.state=mt.QuadtreeTileLoadState.DONE,O.renderable=!0);var re=new mt.GroundPrimitive({geometryInstances:j,appearance:new mt.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:F._core.Shaders("vertexShaderSource"),fragmentShaderSource:F._core.Shaders("fragmentShaderSource")}),classificationType:F._option.classificationType,shadows:F._option.shadows});F.probj.push(re),O.data.geometryPrimitive=re,O.state=mt.QuadtreeTileLoadState.LOADING,O.state===mt.QuadtreeTileLoadState.LOADING&&(O.data.geometryPrimitive.update(R,[]),O.state=mt.QuadtreeTileLoadState.DONE,O.renderable=!0)},error:function(){O.count==null&&(O.count=0),O.count+=1,O.count>=2?(O.state=mt.QuadtreeTileLoadState.DONE,O.renderable=!0):O.state=mt.QuadtreeTileLoadState.START}})}else{O.state=mt.QuadtreeTileLoadState.DONE,O.renderable=!0;return}O.state=mt.QuadtreeTileLoadState.LOADING}})(D,L,E)}},this._primitive=new mt.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var M=this._viewer.scene,I=M.primitives;I.add(this._primitive),this._core.getWMTSData({url:f.url,layer:f.layer,srs:f.srs||"EPSG:4490",gisserverTMS:T},D=>{E.item.boundingSphere=D.boundingSphere,E.TileMatrixLimits=D.TileMatrixLimits,E.initThisProvider()}),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var P={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m,treeData:{name:o,geoOptions:f,styleOption:m,GroupID:v,checked:y,disFnc:x}};return this._Provider.treeID=P.id,this.setTreeobj(P),this._tree.insertGroupId(P,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};Ml.prototype.createGeojsonImage=function(o){let f=eval;mt.loadText("http://36.7.136.132:8090/geoserver/swagger/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=swagger%3A_20200410153959_JZ11&maxFeatures=50&outputFormat=application%2Fjson").then(function(m){m=f("("+m+")");for(var v=0;v<m.features.length;v++)v==0?m.features[v].properties.nod="rgba(255,255,0,1)":v==1?m.features[v].properties.nod="rgba(220,20,60,1)":v==2?m.features[v].properties.nod="rgba(75,0,130,1)":v==3?m.features[v].properties.nod="rgba(0,0,255,1)":v==4?m.features[v].properties.nod="rgba(30,144,255,1)":m.features[v].properties.nod="rgba(50,205,50,1)";var y=null;try{var x=new VectorTileImageryProvider({source:m,zIndex:99,removeDuplicate:!1,defaultStyle:{outlineColor:"rgba(209,204,226,1)",lineWidth:0,outline:!0,fill:!0,fillColor:"rgba(209,204,226,1)",fillShow:"[nod]",tileCacheSize:200,showMaker:!1,showCenterLabel:!0,fontColor:"rgba(255,0,0,1)",labelOffsetX:-10,labelOffsetY:-5,fontSize:13,fontFamily:"\u9ED1\u4F53",centerLabelPropertyName:"NAME"},maximumLevel:20,minimumLevel:15,simplify:!1}),C;x.readyPromise.then(function(){C=viewer.imageryLayers.addImageryProvider(x),mt.Camera.DEFAULT_VIEW_RECTANGLE=x.rectangle})}catch(w){console.log(w)}})};Ml.prototype._drawGeojson=function(o,f,m,v,y,x,C,w,A,E,T,S){var M=this;if(typeof w>"u"&&(w=!0),typeof A>"u"&&(A=!0),!w&&!A)return;typeof x>"u"&&(x=o.canvas.width-f),typeof C>"u"&&(C=o.canvas.height-m);var I=new yct(x,C),P=this._defaultStyle,D={labelStroke:P.labelStroke,labelStrokeWidth:P.labelStrokeWidth,labelStrokeColor:P.labelStrokeColor,pointSize:P.pointSize,fontSize:P.fontSize,fontFamily:P.fontFamily,color:P.fontColor.toCssColorString(),backgroundColor:P.pointColor.toCssColorString(),pointStyle:P.pointStyle,ringRadius:P.ringRadius,circleLineWidth:P.circleLineWidth,showMaker:P.showMaker,showLabel:P.showLabel,labelOffsetX:P.labelOffsetX,labelOffsetY:P.labelOffsetY,markerSymbol:P.makerImage instanceof Image?P.makerImage:P.makerImageEl},L=[];M._styleFilter&&(turf.featureEach(v,function(F,k){M._styleFilter&&(P=M._defaultStyle.clone(),M._styleFilter(F,P,E,T,S),F.style=P)}),v.features.sort(function(F,k){return F.style&&F.style.lineDash?1:k.style&&k.style.lineDash?-1:0}));function R(F,k){if(M._styleFilter){if(P=F.style,P.show==!1)return;D={labelStroke:P.labelStroke,labelStrokeWidth:P.labelStrokeWidth,labelStrokeColor:P.labelStrokeColor,pointSize:P.pointSize,fontSize:P.fontSize,fontFamily:P.fontFamily,color:P.fontColor.toCssColorString(),backgroundColor:P.pointColor.toCssColorString(),pointStyle:P.pointStyle,ringRadius:P.ringRadius,circleLineWidth:P.circleLineWidth,showMaker:P.showMaker,showLabel:P.showLabel,labelOffsetX:P.labelOffsetX,labelOffsetY:P.labelOffsetY,markerSymbol:P.makerImage instanceof Image?P.makerImage:P.makerImageEl}}else P=M._defaultStyle;if(o.lineWidth=P.lineWidth,o.strokeStyle=P.outlineColor.toCssColorString(),o.fillStyle=P.fillColor.toCssColorString(),P.fillShow.indexOf("[")!=-1){var U=P.fillShow.replace("[","").replace("]","");o.fillStyle=F.properties[U]}if(P.lineDash&&o.setLineDash(P.lineDash),o.lineCap=P.lineCap,P.shadowColor&&P.shadowColor instanceof mt.Color?o.shadowColor=P.shadowColor.toCssColorString():o.shadowColor=P.shadowColor,o.shadowBlur=P.shadowBlur,o.shadowOffsetX=P.shadowOffsetX,o.shadowOffsetY=P.shadowOffsetY,o.miterLimit=P.miterLimit,o.lineJoin=P.lineJoin,F.geometry.type=="Point")drawMarker(o,I,y,f,m,F,w,A,P.labelPropertyName,D);else if(F.geometry.type=="Polygon"&&P.fill){var G=turf.getCoords(F),j=hle(o,I,y,f,m,G,!0,!1,P);j&&j.map(function(X){X.style=P,L.push(X)})}else if(F.geometry.type=="MultiPolygon"&&P.fill){var q;try{q=turf.getCoords(F),q.map(function(X){var Y=hle(o,I,y,f,m,X,!0,!1,P);Y&&Y.map(function(Q){Q.style=P,L.push(Q)})})}catch{}}else if(F.geometry.type=="MultiLineString"){if(!(F.properties.isOutline&&!P.outline)){var G=turf.getCoords(F);hle(o,I,y,f,m,G,!1,!0,P),G=null}}else if(F.geometry.type=="LineString"&&!(F.properties.isOutline&&!P.outline)){var J=turf.getCoords(F),G=[J];hle(o,I,y,f,m,G,!1,!0,P),J=null,G=null}}function O(F,k,U,G,j,q){var J=F.canvas,X=F.getImageData(0,0,J.width,J.height),Y=document.createElement("canvas");Y.width=J.width,Y.height=J.height;var Q=Y.getContext("2d"),ee=[];q.map(function(z){Q.clearRect(0,0,Y.width,Y.height),Q.beginPath();var ie=0;z.map(function(ne){var oe=k.project(ne,U);ie==0?Q.moveTo(G+oe.x,j+oe.y):Q.lineTo(G+oe.x,j+oe.y),ie++}),Q.closePath(),Q.fillStyle="rgba(255,255,255,1)",Q.fill(),ee=Q.getImageData(0,0,Y.width,Y.height).data;for(var re=3;re<ee.length;re+=4)ee[re]>0&&(X.data[re]=0)}),F.putImageData(X,0,0)}turf.featureEach(v,function(F,k){(F.geometry.type=="Polygon"||F.geometry.type=="MultiPolygon")&&R(F,k)}),L&&L.length&&O(o,I,y,f,m,L),turf.featureEach(v,function(F,k){(F.geometry.type=="LineString"||F.geometry.type=="MultiLineString")&&R(F,k)}),turf.featureEach(v,function(F,k){(F.geometry.type=="Point"||F.geometry.type=="MultiPoint")&&R(F,k)})};Ml.prototype._createCanvas=function(){this._canvas=document.createElement("canvas"),this._canvas.width=this._tileWidth,this._canvas.height=this._tileHeight,this._context=this._canvas.getContext("2d"),this._context.lineWidth=this._defaultStyle.lineWidth,this._context.strokeStyle=this._defaultStyle.outlineColor.toCssColorString(),this._context.fillStyle=this._defaultStyle.fillColor.toCssColorString()};function hle(o,f,m,v,y,x,C,w,A){var E=0,T=[];if(x.map(function(S){if(!C||E<=0){var M=0;o.beginPath(),S.map(function(I){var P=f.project(I,m);M==0?o.moveTo(v+P.x,y+P.y):o.lineTo(v+P.x,y+P.y),M++}),C&&(o.closePath(),o.fill()),w&&o.stroke()}else T.push(S);E++}),C)return T;T=null}Ml.prototype.getLegend=function(){var o=[];return this.Legend!=null&&(o=this._core.unique(this.Legend)),o};Ml.prototype.removeObsoletePrimitives1=function(o){};Ml.prototype.removeObsoletePrimitives=function(o){for(var f=this._viewer.scene.globe._surface._tilesToRender,m=f.map(function(D){return D.level}),v=Math.min.apply(Math,dle(m)),y=Math.max.apply(Math,dle(m)),x=this.PrimitiveData.length-1;x>=0;x--){var C=this.PrimitiveData[x];if(C.level<v||C.level>y){var w=this._viewer.scene.primitives.remove(C.data);if(w){var A=this.Primitivekey.indexOf(this.loadFinishKey[x]);A>-1&&this.Primitivekey.splice(A,1),this.PrimitiveData.splice(x,1),this.loadFinishKey.splice(x,1)}}}var E=[],T=o.parent;if(T&&T.parent){var S=T.parent;E.push(S)}var M=o.children;E=E.concat(M);for(var x=0;x<M.length;x++){var I=M[x].children;E=E.concat(I)}for(var x=0;x<E.length;x++)if(E[x]){var P="z"+E[x].level+"x"+E[x].x+"y"+E[x].y,A=this.loadFinishKey.indexOf(P);if(A>-1){var w=this._viewer.scene.primitives.remove(this.PrimitiveData[A].data);if(w){var A=this.Primitivekey.indexOf(P);A>-1&&this.Primitivekey.splice(A,1),this.PrimitiveData.splice(A,1),this.loadFinishKey.splice(A,1)}}}};Ml.prototype.removeObsoleteEntities=function(o){for(var f=this._viewer.scene.globe._surface._tilesToRender,m=f.map(function(D){return D.level}),v=Math.min.apply(Math,dle(m))-1,y=Math.max.apply(Math,dle(m))+1,x=this.PrimitiveData.length-1;x>=0;x--){var C=this.PrimitiveData[x];if(C.level<v||C.level>y){var w=this._viewer.entities.remove(C.data);if(w){var A=this.Primitivekey.indexOf(this.loadFinishKey[x]);A>-1&&this.Primitivekey.splice(A,1),this.PrimitiveData.splice(x,1),this.loadFinishKey.splice(x,1)}}}var E=[],T=o.parent;if(T&&T.parent){var S=T.parent;E.push(S)}var M=o.children;E=E.concat(M);for(var x=0;x<M.length;x++){var I=M[x].children;E=E.concat(I)}for(var x=0;x<E.length;x++)if(E[x]){var P="z"+E[x].level+"x"+E[x].x+"y"+E[x].y,A=this.loadFinishKey.indexOf(P);if(A>-1){var w=this._viewer.entities.remove(this.PrimitiveData[A].data);if(w){var A=this.Primitivekey.indexOf(P);A>-1&&this.Primitivekey.splice(A,1),this.PrimitiveData.splice(A,1),this.loadFinishKey.splice(A,1)}}}};Ml.prototype.removeObsoleteEntitiesxp=function(o){for(var f=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(o.west),this._cesium.Math.toDegrees(o.south)),m=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(o.east),this._cesium.Math.toDegrees(o.north)),v=0;v<this.probj.length;v++)var y=this._cesium.Rectangle.contains(this.probj[v].rectangle.coordinates.getValue(),this._cesium.Cartographic.fromCartesian(f)),x=this._cesium.Rectangle.contains(this.probj[v].rectangle.coordinates.getValue(),this._cesium.Cartographic.fromCartesian(m));for(var C=this._viewer.camera.computeViewRectangle(),w=0;w<this.probj.length;w++){var A=this.probj[w].rectangle.coordinates.getValue(),E=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(A.west),this._cesium.Math.toDegrees(A.south)),T=this._cesium.Cartesian3.fromDegrees(this._cesium.Math.toDegrees(A.east),this._cesium.Math.toDegrees(A.north)),S=this._cesium.Rectangle.contains(C,this._cesium.Cartographic.fromCartesian(E)),M=this._cesium.Rectangle.contains(C,this._cesium.Cartographic.fromCartesian(T));S||M?this.probj[w].show=!0:this.probj[w].show=!1}};Ml.prototype.computeCircle=function(o){this._core.isnull(o)&&(o=4);for(var f=[],m=0;m<360;m++){var v=this._cesium.Math.toRadians(m);f.push(new this._cesium.Cartesian2(o*Math.cos(v),o*Math.sin(v)))}return f};Ml.prototype.setTreeobj=function(o){this.treeobj=o};Ml.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f,pId:this.treeobj.pId},treeData:this.treeobj.treeData}};Ml.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.probj&&this.probj.length>0&&(this._viewer.scene.primitives.remove(this.probj[0]),this.probj.pop()),this.img!=null&&this._viewer.imageryLayers.remove(this.img),this.primitve&&this.primitve.length>0){for(var o=0;o<this.primitve.length;o++)this._viewer.scene.primitives.remove(this.primitve[o]);this.primitve=[]}this.loadAllKey&&this.loadAllKey.length>0&&(this.loadAllKey=[]);try{this._Provider.remove()}catch{}};Ml.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(o)}catch{}};Ml.prototype.getLevel=function(){var o=40487.57,f=7096758e-11,m=91610.74,v=-40467.74,y=this._viewer.camera,x,C;if(y&&y.positionCartographic&&y.positionCartographic.height){var w=this._viewer.scene.globe.getHeight(y.positionCartographic);!w&&(w=0),x=y.positionCartographic.height-w,C=Math.round(v+(o-v)/(1+Math.pow(x/m,f)))}else C=0;return C};Ml.prototype.setVisibility=function(o){try{if(this.loadAllKey=[],this.item!=null&&this.item.show!=null&&(this.item.show=o),this.img!=null&&(this.img.show=o),this.primitve&&this.primitve.length>0)for(var f=0;f<this.primitve.length;f++)this.primitve[f].show=o;if(this._Provider&&this._Provider.setStatus&&this._Provider.setStatus(o),this.probj&&this.probj.length>0)for(var f=0;f<this.probj.length;f++)this.probj[f].show=o}catch{}};Ml.prototype.edit=function(o,f){return this.isEditting=o,this.editoption=f,this._Provider&&this._Provider.edit&&this._Provider.edit(o,f)};Ml.prototype.isCache=function(o){this._cache=o};Ml.prototype.forceRefresh=function(){try{for(var o=0;o<this._Provider.quadtree._levelZeroTiles.length;o++)this._Provider.quadtree._levelZeroTiles[o].freeResources()}catch{}};var od=Ml;var yA=null;function fle(o,f,m){yA=f,this._viewer=o,this._cesium=f,this._tree=m,this._core=new Sr(o,f)}fle.prototype.flyTo=function(o,f={}){return this._viewer.flyTo(o,{duration:f.time||3,maximumHeight:f.maxHeight,offset:new yA.HeadingPitchRange(yA.Math.toRadians(f.heading||0),yA.Math.toRadians(f.pitch||-45),f.range)})};fle.prototype.flyToPointsInterest=function(o,f){return this._viewer.camera.flyTo({destination:o.destination,orientation:o.orientation,duration:o.duration,complete:f})};fle.prototype.flyToPosition=function(o,f,m,v={}){let y={heading:this._core.defaultValue(v.heading,0),pitch:this._core.defaultValue(v.pitch,-90),roll:this._core.defaultValue(v.roll,0),time:this._core.defaultValue(v.time,3)};Math.abs(o)<=180&&Math.abs(f)<=90?this._viewer.camera.flyTo({destination:this._cesium.Cartesian3.fromDegrees(o,f,m),orientation:new yA.HeadingPitchRoll(yA.Math.toRadians(y.heading),yA.Math.toRadians(y.pitch),yA.Math.toRadians(y.roll)),duration:y.time}):this._viewer.camera.flyTo({destination:{x:o,y:f,z:m},orientation:new yA.HeadingPitchRoll(yA.Math.toRadians(y.heading),yA.Math.toRadians(y.pitch),yA.Math.toRadians(y.roll)),duration:y.time})};var bct=fle;var Nu=null;function O_(o,f){Nu=f,this._viewer=o,this._cesium=f,this.item={show:!0},this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this._flyTo=new bct(this._viewer,this._cesium,this._tree),this._Provider=void 0,this.Legend=[],this.model=[],this._cache=!1,this._forceRefreshPrvimitive=null,this._forceRefreshProvider=null}O_.prototype.createPolylineGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var w=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var A=null;f.then?A=f:A=this._cesium.GeoJsonDataSource.load(f);var E=this;A.then(function(S){for(var M=S.entities.values,I=[],P=new E._cesium.PrimitiveCollection,D=0;D<M.length;D++){var L=M[D],R=null;if(w.clampToGround){w.positions=L.polyline.positions._value;var O={positions:L.polyline.positions._value,width:w.width},O=new E._cesium.GroundPolylineGeometry(O);R=new E._cesium.GeometryInstance({id:L,geometry:O,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(w.material)}})}else{for(var F=[],D=0;D<L.polyline.positions._value.length;D++){var k=E._viewer.scene.globe.ellipsoid,U=E._cesium.Cartographic.fromCartesian(L.polyline.positions._value[D]),G=E._cesium.Math.toDegrees(U.longitude),j=E._cesium.Math.toDegrees(U.latitude),q=U.height+w.height,J=new E._cesium.Cartesian3.fromDegrees(G,j,q);F.push(J)}w.positions=F;var X=new E._cesium.PolylineGeometry(w),Y=E._cesium.PolylineGeometry.createGeometry(X);R=new E._cesium.GeometryInstance({id:L,geometry:Y,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(w.material)}})}L.positions=w.positions;var Q="material:"+w.material.red*255+","+w.material.green*255+","+w.material.blue*255;E.Legend.push(Q);var ee=null;w.clampToGround?ee=new E._cesium.GroundPolylinePrimitive({geometryInstances:R,appearance:new E._cesium.MaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:w.material}}}),faceForward:!0,flat:!1})}):ee=new E._cesium.Primitive({geometryInstances:R,appearance:new E._cesium.PolylineMaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:w.material}}})}),shadows:E._cesium.ShadowMode.ENABLED}),P.add(ee)}var z;m&&m.time&&(z=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})]));var ie=E._viewer.scene.primitives.add(P,z);ie.show=w.show,E.item=P,y||E.setVisibility(!1),typeof x=="function"&&x(E.item)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w.id);var T={id:w.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineLayer",item:this,url:f,style:w};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};O_.prototype.createGroundPolylineGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var w=this._core.extend(C,m,!0);f==null&&console.log("geojson is required");var A=null;f.then?A=f:A=this._cesium.GeoJsonDataSource.load(f);var E=this;A.then(function(S){for(var M=S.entities.values,I=[],P=new E._cesium.PrimitiveCollection,D=0;D<M.length;D++){var L=M[D],R=null;if(w.clampToGround){w.positions=L.polyline.positions._value;var O={positions:L.polyline.positions._value,width:w.width},O=new E._cesium.GroundPolylineGeometry(O);R=new E._cesium.GeometryInstance({id:L,geometry:O,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(w.material)}})}else{for(var F=[],D=0;D<L.polyline.positions._value.length;D++){var k=E._viewer.scene.globe.ellipsoid,U=E._cesium.Cartographic.fromCartesian(L.polyline.positions._value[D]),G=E._cesium.Math.toDegrees(U.longitude),j=E._cesium.Math.toDegrees(U.latitude),q=U.height+w.height,J=new E._cesium.Cartesian3.fromDegrees(G,j,q);F.push(J)}w.positions=F;var X=new E._cesium.PolylineGeometry(w),Y=E._cesium.PolylineGeometry.createGeometry(X);R=new E._cesium.GeometryInstance({id:L,geometry:Y,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(w.material)}})}L.positions=w.positions;var Q="material:"+w.material.red*255+","+w.material.green*255+","+w.material.blue*255;E.Legend.push(Q);var ee=null;w.clampToGround?ee=new E._cesium.GroundPolylinePrimitive({geometryInstances:R,appearance:new E._cesium.MaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:w.material}}}),faceForward:!0,flat:!1})}):ee=new E._cesium.Primitive({geometryInstances:R,appearance:new E._cesium.PolylineMaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:w.material}}})}),shadows:E._cesium.ShadowMode.ENABLED}),P.add(ee)}var z;m&&m.time&&(z=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})]));var ie=E._viewer.scene.primitives.add(P,z);ie.show=w.show,E.item=P,y||E.setVisibility(!1),typeof x=="function"&&x(E.item)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w.id);var T={id:w.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineLayer",item:this,url:f,style:w};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};O_.prototype.createPolylineVectorGeoJsonFeatureLayerProvider1=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(C,m,!0),E=this,T=new Ah(this._viewer,this._cesium,w);this._Provider=T,T._loadTile=function(M){var I=[];E.Legend=[];var P=new E._cesium.PrimitiveCollection;return M.features.forEach(function(D){var L=[],R=!1;if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var O=m.material.replace(/\[/,"").replace(/\]/,"");A.material=D.properties[O],E._core.isHtmlColor(A.material)?A.material=E._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=E._color.rgbaStringToRgbaObj(A.material)),A.material.r>1&&(A.material.r=A.material.r/255),A.material.g>1&&(A.material.g=A.material.g/255),A.material.b>1&&(A.material.b=A.material.b/255),A.material.a>1&&(A.material.a=A.material.a/255),A.material=E._color.createColor(A.material.r,A.material.g,A.material.b,A.material.a))}function F(G){for(var j=0;j<G.length;j++)Array.isArray(G[j])?F(G[j]):(L.push(G[j]),j===2&&!R&&(R=!0))}if(Array.isArray(D.geometry.coordinates)&&D.geometry.coordinates.length>0)if(Array.isArray(D.geometry.coordinates[0][0]))for(var k=0;k<D.geometry.coordinates.length;k++)L=[],F(D.geometry.coordinates[k]),U(L);else F(D.geometry.coordinates),U(L);function U(G){var j=R?E._cesium.Cartesian3.fromDegreesArrayHeights(G):E._cesium.Cartesian3.fromDegreesArray(G);A.positions=j;var q={positions:A.positions,width:A.width};D.positions=j,D.treeID=A.id,D.VectorType="polyline",D.VectorStyle={haveZ:R,width:A.width,positions:G,material:A.material,clampToGround:A.clampToGround};var J=null;if(A.clampToGround){var q=new E._cesium.GroundPolylineGeometry(q);J=new E._cesium.GeometryInstance({id:D,geometry:q,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}})}else{var X=G,Y=G.length/2+1+G.length;if(/^\[/.test(m.height)&&/\]$/.test(m.height)){var Q=m.height.replace(/\[/,"").replace(/\]/,"");A.height=D.properties[Q]}for(var ee=2;ee<Y;ee=ee+3)X.splice(ee,0,parseFloat(A.height));var z=E._cesium.Cartesian3.fromDegreesArrayHeights(X);A.positions=z,D.positions=z;var ie=new E._cesium.PolylineGeometry(A);J=new E._cesium.GeometryInstance({id:D,geometry:ie,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}})}var re="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;E.Legend.push(re);var ne=null;A.clampToGround?ne=new E._cesium.GroundPolylinePrimitive({geometryInstances:J,appearance:new E._cesium.MaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}}),faceForward:!0,flat:!1})}):ne=new E._cesium.Primitive({geometryInstances:J,appearance:new E._cesium.PolylineMaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}})}),shadows:E._cesium.ShadowMode.ENABLED}),P.add(ne)}}),P},m&&m.time&&(T.availability=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=T._primitiveCollection,T.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polylineLayer",item:this,url:f.url,style:m};return this._Provider.treeID=A.id,this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};O_.prototype.createPolylineVectorGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,outlineWidth:1,show:!0,material:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.WHITE,gapColor:this._cesium.Color.TRANSPARENT,height:30},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4326")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4326"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:m.level_min,lowerLevelLimit:m.level_max,Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(m.material=Nu.Color.fromCssColorString(m.material))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor=Nu.Color.fromCssColorString(m.outlineColor)),!this._core.isnull(m)&&!this._core.isnull(m.gapColor)&&(m.gapColor=Nu.Color.fromCssColorString(m.gapColor));var A=this._core.extend({...C},m,!0),E=this;let T=f.url.indexOf("/gisserver/")>-1;var S;T?S=f.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:S=f.url+"?"+this._core._serialize(w.urlParams),this._urlTemplate=S,this._Provider=new ol(this._viewer,this._cesium,T?new Nu.WebMercatorTilingScheme:void 0),this._Provider._normalTile=m.level_max-1,this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(R,O){(function(F,k,U){if(k.state===Nu.QuadtreeTileLoadState.START){if(k.data={lines:[],geometryPrimitive:void 0},k.level>=m.level_min&&k.level<m.level_max&&U.item.show){if(T&&(k.reverseY=U._Provider.tilingScheme.getNumberOfYTilesAtLevel(k.level)-k.y-1),U.TileMatrixLimits){let j=U.TileMatrixLimits[k.level];if(!j||j&&(k.x>j.maxCol||k.x<j.minCol||k.y>j.maxRow||k.y<j.minRow)){k.state=Nu.QuadtreeTileLoadState.DONE,k.renderable=!0;return}}var G=S.replace(window.encodeURIComponent("{x}"),k.x).replace(window.encodeURIComponent("{y}"),k.reverseY||k.y).replace(window.encodeURIComponent("{z}"),k.level);U._cache&&(G+="&"+U._core.getuid()),U._core.xhr({url:G,type:"get",dataType:"json",success:function(j){var q=[],J=[],X=!1;for(var Y of j.features){let oe=function(ae){for(var fe=0;fe<ae.length;fe++)Array.isArray(ae[fe])?oe(ae[fe]):(fe===2&&(ae[fe]=A.height||ae[fe],X=!0),J.push(ae[fe]),fe===1&&ae.length===2&&J.push(A.height||0))},se=function(ae){var fe=U._cesium.Cartesian3.fromDegreesArrayHeights(ae);A.positions=fe;var de={positions:A.positions,width:A.width};Y.positions=fe,m.preLoad&&m.preLoad(A,Y),Y.treeID=A.id,Y.VectorType="polyline",Y.VectorStyle={haveZ:X,width:A.width,positions:ae,material:A.material,clampToGround:A.clampToGround};var ve=null;if(A.clampToGround){var de=new U._cesium.GroundPolylineGeometry(de);ve=new U._cesium.GeometryInstance({id:Y,geometry:de,attributes:{color:new U._cesium.ColorGeometryInstanceAttribute.fromColor(A.material),distanceDisplayCondition:new Nu.DistanceDisplayConditionGeometryInstanceAttribute(A.near,A.far)}})}else{var pe=new U._cesium.PolylineGeometry(A);ve=new U._cesium.GeometryInstance({id:Y,geometry:pe,attributes:{color:new U._cesium.ColorGeometryInstanceAttribute.fromColor(A.material),distanceDisplayCondition:new Nu.DistanceDisplayConditionGeometryInstanceAttribute(A.near,A.far)}})}var ce="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;U.Legend.push(ce),q.push(ve)};var J=[];if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var Q=m.material.replace(/\[/,"").replace(/\]/,"");A.material=Y.properties[Q],A.material=Nu.Color.fromCssColorString(A.material)}if(/^\[/.test(m.height)&&/\]$/.test(m.height)){var ee=m.height.replace(/\[/,"").replace(/\]/,"");A.height=Y.properties[ee]}if(Array.isArray(Y.geometry.coordinates)&&Y.geometry.coordinates.length>0)if(Array.isArray(Y.geometry.coordinates[0][0]))for(var z=0;z<Y.geometry.coordinates.length;z++)J=[],oe(Y.geometry.coordinates[z]),se(J);else oe(Y.geometry.coordinates),se(J)}var ie=null;let re;A.dash?re=new Nu.PolylineMaterialAppearance({material:Nu.Material.fromType(Nu.Material.PolylineDashType,{color:A.material,gapColor:A.gapColor||Nu.Color.TRANSPARENT,dashLength:A.dashLength||20})}):re=new Nu.PolylineMaterialAppearance({material:new Nu.Material({fabric:{type:"PolylineOutline",uniforms:{color:A.material,outlineColor:A.outlineColor,outlineWidth:A.outlineWidth}}}),faceForward:!0,flat:!1}),A.clampToGround?ie=new U._cesium.GroundPolylinePrimitive({geometryInstances:q,appearance:re,classificationType:A.classificationType}):ie=new U._cesium.Primitive({geometryInstances:q,appearance:re,shadows:U._cesium.ShadowMode.ENABLED}),k.data.geometryPrimitive=ie,k.state=Nu.QuadtreeTileLoadState.LOADING,k.state===Nu.QuadtreeTileLoadState.LOADING&&(k.data.geometryPrimitive.update(F,[]),k.state=Nu.QuadtreeTileLoadState.DONE,k.renderable=!0)},error:function(){k.count==null&&(k.count=0),k.count+=1,k.count>=2?(k.state=Nu.QuadtreeTileLoadState.DONE,k.renderable=!0):k.state=Nu.QuadtreeTileLoadState.START}})}else{k.state=Nu.QuadtreeTileLoadState.DONE,k.renderable=!0;return}k.state=Nu.QuadtreeTileLoadState.LOADING}})(R,O,E)},typeof x=="function"&&x(this.item)};let M,I;this.saveDefaultVectorData=()=>{I=E._core.extend({},m,!0)},this.restoreVector=()=>{I&&(m=I,A=E._core.extend({...C},m,!0),E._Provider._normalTile=m.level_max-1,E._primitive&&E._primitive._tilesToRender&&E._primitive._tilesToRender.length&&(E._primitive._tilesToRender.forEach(R=>{R.data.geomeitryPrimitive&&R.data.geomeitryPrimitive.destroy(),R.state=Nu.QuadtreeTileLoadState.START}),E._primitive._tileToUpdateHeights.forEach(R=>{R.data.geomeitryPrimitive&&R.data.geomeitryPrimitive.destroy(),R.state=Nu.QuadtreeTileLoadState.START}),E._primitive._tileToUpdateHeights=[],E._primitive._tilesToRender=[])),I=void 0},this.updataVector=(R={})=>{(R.material||R.outlineColor||R.gapColor)&&(R.material&&(R.material=Nu.Color.fromCssColorString(R.material)),R.outlineColor&&(R.outlineColor=Nu.Color.fromCssColorString(R.outlineColor)),R.gapColor&&(R.gapColor=Nu.Color.fromCssColorString(R.gapColor))),(R.minimumLevel!==void 0||R.maximumLevel!==void 0)&&(R.minimumLevel!==void 0&&(R.level_min=R.minimumLevel),R.maximumLevel!==void 0&&(R.level_max=R.maximumLevel)),m=E._core.extend(m,R,!0),A=E._core.extend(A,m,!0),E._Provider._normalTile=m.level_max-1,E._primitive&&E._primitive._tilesToRender&&E._primitive._tilesToRender.length&&(clearTimeout(M),M=setTimeout(()=>{E._primitive._tilesToRender.forEach(O=>{O.data.geomeitryPrimitive&&O.data.geomeitryPrimitive.destroy(),O.state=Nu.QuadtreeTileLoadState.START}),E._primitive._tileToUpdateHeights.forEach(O=>{O.data.geomeitryPrimitive&&O.data.geomeitryPrimitive.destroy(),O.state=Nu.QuadtreeTileLoadState.START}),E._primitive._tileToUpdateHeights=[],E._primitive._tilesToRender=[]},100))},this._forceRefreshProvider=this._Provider,this._primitive=new E._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var P=this._viewer.scene,D=P.primitives;D.add(this._primitive),this._core.getWMTSData({url:f.url,layer:f.layer,srs:f.srs||"EPSG:4326",gisserverTMS:T},R=>{E.item.boundingSphere=R.boundingSphere,E.TileMatrixLimits=R.TileMatrixLimits,E.initThisProvider()}),m&&m.time&&(geoJSONVectorTileProvider.availability=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})])),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var L={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polylineLayer",item:this,url:f.url,style:m};return this._Provider.treeID=A.id,this.setTreeobj(L),this._tree.insertGroupId(L,this._core.isnull(v)?0:v),this};O_.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel_obsolete=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(C,m,!0),E=this,T=new Ah(this._viewer,this._cesium,w);this._Provider=T,T._loadTile=function(M,I){var P=[],D=new E._cesium.PrimitiveCollection,L=[];if(M.features.forEach(function(R){var O=[];if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var F=m.material.replace(/\[/,"").replace(/\]/,"");A.material=R.properties[F],E._core.isHtmlColor(A.material)?A.material=E._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=E._color.rgbaStringToRgbaObj(A.material)),A.material.r>1&&(A.material.r=A.material.r/255),A.material.g>1&&(A.material.g=A.material.g/255),A.material.b>1&&(A.material.b=A.material.b/255),A.material.a>1&&(A.material.a=A.material.a/255),A.material=E._color.createColor(A.material.r,A.material.g,A.material.b,A.material.a))}function k(q){for(var J=0;J<q.length;J++)Array.isArray(q[J])?k(q[J]):O.push(q[J])}if(Array.isArray(R.geometry.coordinates)&&R.geometry.coordinates.length>0)if(Array.isArray(R.geometry.coordinates[0][0]))for(var U=0;U<R.geometry.coordinates.length;U++)O=[],k(R.geometry.coordinates[U]),G(O),j(O);else k(R.geometry.coordinates),G(O),j(O);function G(q){var J=E._cesium.Cartesian3.fromDegreesArray(q);A.positions=J,R.positions=J;var X={positions:A.positions,width:A.width},Y=null;if(A.clampToGround){var X=new E._cesium.GroundPolylineGeometry(X);Y=new E._cesium.GeometryInstance({id:R,geometry:X,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}})}else{for(var Q=q,ee=q.length/2+1+q.length,z=2;z<ee;z=z+3)Q.splice(z,0,parseFloat(A.height));var ie=E._cesium.Cartesian3.fromDegreesArrayHeights(Q);A.positions=ie;var re=new E._cesium.PolylineGeometry(A),ne=E._cesium.PolylineGeometry.createGeometry(re);Y=new E._cesium.GeometryInstance({id:R,geometry:ne,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}})}var oe=null;A.clampToGround?oe=new E._cesium.GroundPolylinePrimitive({geometryInstances:Y,appearance:new E._cesium.MaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}}),faceForward:!0,flat:!1})}):oe=new E._cesium.Primitive({geometryInstances:Y,appearance:new E._cesium.PolylineMaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}})}),shadows:E._cesium.ShadowMode.ENABLED}),D.add(oe)}function j(q){var J;A.clampToGround?J=E._cesium.Cartesian3.fromDegreesArray(q):J=E._cesium.Cartesian3.fromDegreesArrayHeights(q);for(var X=1;X<J.length;X++){var Y=[];Y.push(J[X-1]),Y.push(J[X]);var Q=E._cesium.SceneTransforms.wgs84ToWindowCoordinates(E._viewer.scene,J[X-1]).x,ee=E._cesium.SceneTransforms.wgs84ToWindowCoordinates(E._viewer.scene,J[X-1]).y,z=E._cesium.SceneTransforms.wgs84ToWindowCoordinates(E._viewer.scene,J[X]).x,ie=E._cesium.SceneTransforms.wgs84ToWindowCoordinates(E._viewer.scene,J[X]).y;E.setPolylinemodels(Y,Q,ee,z,ie,A,function(re){L.push(re)})}}}),L.length){let R;Nu.ModelInstanceCollection?R=new E._cesium.ModelInstanceCollection({url:A.url,instances:L,color:A.color,lightColor:A.lightColor,scale:parseInt(A.scale),heightReference:parseInt(A.heightReference),distanceDisplayCondition:A.distanceDisplayCondition}):(R=new Nu.PrimitiveCollection,L.forEach(O=>{R.add({id:O.modelId,url:A.url,modelMatrix:O.modelMatrix,color:A.color,lightColor:A.lightColor,scale:parseInt(A.scale),heightReference:parseInt(A.heightReference),distanceDisplayCondition:A.distanceDisplayCondition})})),D.add(R)}return D},m&&m.time&&(T.availability=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=T._primitiveCollection,T.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polylineLayer",item:this,url:f.url,style:m};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};O_.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};this.item.show=y,!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(C,m,!0),E=this;this._urlTemplate=f.url+"?"+this._core._serialize(w.urlParams);var T=f.url+"?"+this._core._serialize(w.urlParams);this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){(function(L,R,O){if(R.state===Nu.QuadtreeTileLoadState.START){if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&O.item.show){var F=T.replace(window.encodeURIComponent("{x}"),R.x).replace(window.encodeURIComponent("{y}"),R.y).replace(window.encodeURIComponent("{z}"),R.level);O._cache&&(F+="&"+O._core.getuid()),O._core.xhr({url:F,type:"get",dataType:"json",success:function(k){var U=[],G=new O._cesium.PrimitiveCollection,j=k.features,q=[];if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var J=m.material.replace(/\[/,"").replace(/\]/,"");A.material=z.properties[J],O._core.isHtmlColor(A.material)?A.material=O._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=O._color.rgbaStringToRgbaObj(A.material)),A.material.r>1&&(A.material.r=A.material.r/255),A.material.g>1&&(A.material.g=A.material.g/255),A.material.b>1&&(A.material.b=A.material.b/255),A.material.a>1&&(A.material.a=A.material.a/255),A.material=O._color.createColor(A.material.r,A.material.g,A.material.b,A.material.a))}function X(re){for(var ne=0;ne<re.length;ne++)Array.isArray(re[ne])?X(re[ne]):q.push(re[ne])}function Y(re){var ne=O._cesium.Cartesian3.fromDegreesArray(re);A.positions=ne,z.positions=ne;var oe={positions:A.positions,width:A.width},se=null;if(A.clampToGround){var oe=new O._cesium.GroundPolylineGeometry(oe);se=new O._cesium.GeometryInstance({id:z,geometry:oe,attributes:{color:new O._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}})}else{for(var ae=re,fe=re.length/2+1+re.length,de=2;de<fe;de=de+3)ae.splice(de,0,parseFloat(A.height));var ve=O._cesium.Cartesian3.fromDegreesArrayHeights(ae);A.positions=ve;var pe=new O._cesium.PolylineGeometry(A),ce=O._cesium.PolylineGeometry.createGeometry(pe);se=new O._cesium.GeometryInstance({id:z,geometry:ce,attributes:{color:new O._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}})}var he=null;A.clampToGround?he=new O._cesium.GroundPolylinePrimitive({geometryInstances:se,appearance:new O._cesium.MaterialAppearance({material:new O._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}}),faceForward:!0,flat:!1})}):he=new O._cesium.Primitive({geometryInstances:se,appearance:new O._cesium.PolylineMaterialAppearance({material:new O._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}})}),shadows:O._cesium.ShadowMode.ENABLED}),G.add(he)}function Q(re){var ne;A.clampToGround?ne=O._cesium.Cartesian3.fromDegreesArray(re):ne=O._cesium.Cartesian3.fromDegreesArrayHeights(re);for(var oe=1;oe<ne.length;oe++)try{var se=[];se.push(ne[oe-1]),se.push(ne[oe]);var ae=O._cesium.SceneTransforms.wgs84ToWindowCoordinates(O._viewer.scene,ne[oe-1]).x,fe=O._cesium.SceneTransforms.wgs84ToWindowCoordinates(O._viewer.scene,ne[oe-1]).y,de=O._cesium.SceneTransforms.wgs84ToWindowCoordinates(O._viewer.scene,ne[oe]).x,ve=O._cesium.SceneTransforms.wgs84ToWindowCoordinates(O._viewer.scene,ne[oe]).y;O.setPolylinemodels(se,ae,fe,de,ve,A,function(pe){U.push(pe)})}catch{}}for(var ee=0;ee<j.length;ee++){var z=j[ee];if(Array.isArray(z.geometry.coordinates)&&z.geometry.coordinates.length>0)if(Array.isArray(z.geometry.coordinates[0][0]))for(var ie=0;ie<z.geometry.coordinates.length;ie++)q=[],X(z.geometry.coordinates[ie]),Y(q),Q(q);else X(z.geometry.coordinates),Y(q),Q(q)}if(U.length){let re;Nu.ModelInstanceCollection?re=new O._cesium.ModelInstanceCollection({url:A.url,instances:U,color:A.color,lightColor:A.lightColor,scale:parseInt(A.scale),heightReference:parseInt(A.heightReference),distanceDisplayCondition:A.distanceDisplayCondition}):(re=new Nu.PrimitiveCollection,U.forEach(ne=>{re.add({id:ne.modelId,url:A.url,modelMatrix:ne.modelMatrix,color:A.color,lightColor:A.lightColor,scale:parseInt(A.scale),heightReference:parseInt(A.heightReference),distanceDisplayCondition:A.distanceDisplayCondition})})),G.add(re)}R.data.geometryPrimitive=G},error:function(){R.count==null&&(R.count=0),R.count+=1,R.count>=2?(R.state=Nu.QuadtreeTileLoadState.DONE,R.renderable=!0):R.state=Nu.QuadtreeTileLoadState.START}})}else{R.state=Nu.QuadtreeTileLoadState.DONE,R.renderable=!0;return}R.state=Nu.QuadtreeTileLoadState.LOADING}})(P,D,E)},this._primitive=new E._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:5});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polylineLayer",item:this,url:f.url,style:m};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};O_.prototype.setPolylinemodels=function(o,f,m,v,y,x,C){var w=this._cesium,A=this._core.getSpaceDistancem(o,w),E=10,T=parseFloat(x.distance);T==0||(E=parseInt(A/T));for(var S=o[0],M=o[o.length-1],I=w.Cartographic.fromCartesian(S),P=w.Math.toDegrees(I.longitude),D=w.Math.toDegrees(I.latitude),L=w.Cartographic.fromCartesian(M),R=w.Math.toDegrees(L.longitude),O=w.Math.toDegrees(L.latitude),F=E,k=w.Math.lerp(P,R,1/F)-P,U=w.Math.lerp(D,O,1/F)-D,G=0;G<F;G++){var j=P+(G+1)*k,q=D+(G+1)*U,J=w.Transforms.eastNorthUpToFixedFrame(w.Cartesian3.fromDegrees(j,q,parseInt(x.height)));Nu.Matrix4.multiplyByUniformScale(J,parseInt(x.scale),J),C&&C({modelMatrix:J,modelId:x})}};O_.prototype.getType=function(){return{label:"\u7EBF",value:"polylineLayer"}};O_.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};O_.prototype.deleteObject=function(){if(this._viewer.scene.primitives.remove(this.item),this.model!=null&&this.model!=null&&this.model.length>0)for(var o=0;o<this.model.length;o++)this._viewer.scene.primitives.remove(this.model[o]);try{this._Provider.remove()}catch{}};O_.prototype.setTreeobj=function(o){this.treeobj=o};O_.prototype.getLegend=function(){var o=[];return this.Legend!=null&&(o=this._core.unique(this.Legend)),o};O_.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(!o)}catch{}};O_.prototype.setVisibility=function(o){if(this.item!=null&&(this.item.show=o),this._Provider&&this._Provider.setStatus(o),this.model!=null&&this.model!=null&&this.model.length>0)for(var f=0;f<this.model.length;f++)this.model[f].show=o};O_.prototype.edit=function(o,f){return this.editoption=f,this.isEditting=o,this._Provider&&this._Provider.edit&&this._Provider.edit(o,f)};O_.prototype.forceRefresh=function(){try{for(var o=0;o<this._Provider.quadtree._levelZeroTiles.length;o++)this._Provider.quadtree._levelZeroTiles[o].freeResources()}catch{}};var FD=O_;function ad(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this._createGroup=new D4,this.model=[],this.heading=this._cesium.Math.toRadians(0),this.pitch=this._cesium.Math.toRadians(0),this.roll=this._cesium.Math.toRadians(0),this.rotate=10,this.state=0,this.modelPointArr=[],this.modifyModel=null,this.modifyPoint=null,this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.objId=Number(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0)),this.position=null,this.tempPoints=[],this.scale=0,this.Radius=20}ad.prototype.exectPointModel=function(o,f,m,v,y,x){var C={positions:[],arcType:this._cesium.ArcType.GEODESIC,clampToGround:!1,width:1,show:!0,material:this._cesium.Color.WHITE,height:30};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.color)&&(m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),!this._core.isnull(m)&&!this._core.isnull(m.lightColor)&&(m.lightColor.toString().charAt(0)=="["&&m.lightColor.toString().charAt(m.lightColor.length-1)=="]"||(this._core.isHtmlColor(m.lightColor)?m.lightColor=this._color.colorFromHtmlColor(m.lightColor):(/^rgb/.test(m.lightColor)&&(m.lightColor=this._color.rgbaStringToRgbaObj(m.lightColor)),m.lightColor.r>1&&(m.lightColor.r=m.lightColor.r/255),m.lightColor.g>1&&(m.lightColor.g=m.lightColor.g/255),m.lightColor.b>1&&(m.lightColor.b=m.lightColor.b/255),m.lightColor.a>1&&(m.lightColor.a=m.lightColor.a/255),m.lightColor=this._color.createColor(m.lightColor.r,m.lightColor.g,m.lightColor.b,m.lightColor.a)))),!this._core.isnull(m)&&!this._core.isnull(m.linecolor)&&(m.linecolor.toString().charAt(0)=="["&&m.linecolor.toString().charAt(m.linecolor.length-1)=="]"||(this._core.isHtmlColor(m.linecolor)?m.linecolor=this._color.colorFromHtmlColor(m.linecolor):(/^rgb/.test(m.linecolor)&&(m.linecolor=this._color.rgbaStringToRgbaObj(m.linecolor)),m.linecolor.r>1&&(m.linecolor.r=m.linecolor.r/255),m.linecolor.g>1&&(m.linecolor.g=m.linecolor.g/255),m.linecolor.b>1&&(m.linecolor.b=m.linecolor.b/255),m.linecolor.a>1&&(m.linecolor.a=m.linecolor.a/255),m.linecolor=this._color.createColor(m.linecolor.r,m.linecolor.g,m.linecolor.b,m.linecolor.a))));var w=this._core.extend(C,m,!0);this._core.isnull(m.near)&&(m.near=0),this._core.isnull(m.far)&&(m.far=999999999);var A=parseFloat(m.near),E=parseFloat(m.far),T=new this._cesium.DistanceDisplayCondition(A,E);w.distanceDisplayCondition=T,f==null&&console.log("geojson is required");var S=null;f.then?S=f:S=this._cesium.GeoJsonDataSource.load(f);var M=this;S.then(function(P){for(var D=P.entities.values,L=[],D=P.entities.values,L=[],R=0;R<D.length;R++){var O=D[R],F=new M._cesium.GeometryInstance({id:O,geometry:new M._cesium.CorridorGeometry({positions:O.polyline.positions._value,width:w.width,height:w.height,arcType:w.arcType,vertexFormat:M._cesium.VertexFormat.POSITION_ONLY}),attributes:{color:new M._cesium.ColorGeometryInstanceAttribute.fromColor(w.linecolor)}});L.push(F)}var k;m&&m.time&&(k=new M._cesium.TimeIntervalCollection([new M._cesium.TimeInterval({start:m.time.start?M._cesium.JulianDate.fromDate(new Date(m.time.start)):M._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?M._cesium.JulianDate.fromDate(new Date(m.time.end)):M._cesium.Iso8601.MAXIMUM_VALUE})]));var U=M._viewer.scene.primitives.add(new M._cesium.GroundPrimitive({geometryInstances:L,classificationType:M._cesium.ClassificationType.BOTH}),k);U.show=w.show,M.item=U;for(var G=[],R=0;R<D.length;R++)for(var O=D[R],j=w,q=O.polyline.positions.getValue(),J=1;J<q.length;J++)try{var X=[];X.push(q[J-1]),X.push(q[J]);var Y=M._cesium.SceneTransforms.wgs84ToWindowCoordinates(M._viewer.scene,q[J-1]).x,Q=M._cesium.SceneTransforms.wgs84ToWindowCoordinates(M._viewer.scene,q[J-1]).y,ee=M._cesium.SceneTransforms.wgs84ToWindowCoordinates(M._viewer.scene,q[J]).x,z=M._cesium.SceneTransforms.wgs84ToWindowCoordinates(M._viewer.scene,q[J]).y;G=M.setPolylinemodels(X,Y,Q,ee,z,G,w,M._cesium,M._viewer,k)}catch{}let ie;Cesium.ModelInstanceCollection?ie=new M._cesium.ModelInstanceCollection({url:w.url,instances:G,color:w.color,lightColor:w.lightColor,scale:parseInt(w.scale),heightReference:parseInt(w.heightReference),distanceDisplayCondition:w.distanceDisplayCondition}):(ie=new Cesium.PrimitiveCollection,G.forEach(re=>{ie.add({id:re.modelId,url:w.url,modelMatrix:re.modelMatrix,color:w.color,lightColor:w.lightColor,scale:parseInt(w.scale),heightReference:parseInt(w.heightReference),distanceDisplayCondition:w.distanceDisplayCondition})})),M._viewer.scene.primitives.add(ie),M.model.push(ie),y||M.setVisibility(!1),typeof x=="function"&&x(U)}),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w.id);var I={id:w.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineLayer",item:this};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),this};ad.prototype.createPointModel=function(o,f){var m=this,v=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),y=[],x=null,C=0,w=null,A=[],E,T=o.parameterd,S=o.objid,M=o.cyjj,I=o.url;this.modelurl=I;var P=[],D={point:m._cesium.Color.RED,polyline:m._cesium.Color.YELLOW};Object.keys(o).length>0&&(o.point!=""&&o.point!=null&&(D.point=o.point),o.polyline!=""&&o.polyline!=null&&(D.polyline=o.polyline));var L=this._core.CreateTooltip(),R="",O={spot:[],distance:[],label:[],polyline:[],model:[]};v.setInputAction(function(k){y.length===0?L.showAt(k.endPosition,"\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01"):L.showAt(k.endPosition,"\u53F3\u952E\u7ED3\u675F\uFF01");var U=m._viewer.camera.getPickRay(k.endPosition);w=m._viewer.scene.globe.pick(U,m._viewer.scene),y.length>=2&&(m._cesium.defined(x)?(y.pop(),y.push(w)):x=new F(y),C=m._core.getHorizontalDistance(y,m._cesium))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),v.setInputAction(function(k){var U=m._viewer.camera.getPickRay(k.position);w=m._viewer.scene.globe.pick(U,m._viewer.scene),y.length==0&&y.push(w.clone());var G={px:k.position.x,py:k.position.y};y.push(w);var j={positionsxp:w,lxy:G};P.push(j);var q=C;R="\u603B\u957F\uFF1A"+C,O.spot.push(w),O.distance.push(C)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),v.setInputAction(function(k){v.destroy(),y.pop();for(var U=0;U<A.length;U++)m._viewer.entities.remove(A[U]);for(var G=[],j=1;j<P.length;j++){var q=[],J=P[j-1].lxy.px,X=P[j-1].lxy.py,Y=P[j].lxy.px,Q=P[j].lxy.py,ee=T;q.push(P[j-1].positionsxp),q.push(P[j].positionsxp),G=m.setPolylinemodel(q,J,X,Y,Q,ee,M,m.modelurl,G,m._cesium,m._viewer)}O.model=G,f!=""&&f!=null&&typeof f=="function"&&f(O),L.show(!1)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);var F=function(){function k(U){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:D.polyline,width:3,clampToGround:!0}},this.positions=U,this._init()}return k.prototype._init=function(){var U=this,G=function(){return U.positions};this.options.polyline.positions=new m._cesium.CallbackProperty(G,!1);var j=m._viewer.entities.add(this.options);m.item=j,A.push(j),O.polyline.push(j)},k}();return this};ad.prototype.setPolylinemodel=function(o,f,m,v,y,x,C,w,A,E,T){var S=this._core.getSpaceDistancem(o,E);C==0||(x=parseInt(S/C));for(var M=o[0],I=o[o.length-1],P=E.Cartographic.fromCartesian(M),D=E.Math.toDegrees(P.longitude),L=E.Math.toDegrees(P.latitude),R=P.height,O=E.Cartographic.fromCartesian(I),F=E.Math.toDegrees(O.longitude),k=E.Math.toDegrees(O.latitude),U=O.height,G=x,j=E.Math.lerp(D,F,1/G)-D,q=E.Math.lerp(L,k,1/G)-L,J=E.Math.lerp(f,v,1/G)-f,X=E.Math.lerp(m,y,1/G)-m,Y=[],Q,ee,z=0;z<G;z++){var ie=D+(z+1)*j,re=L+(z+1)*q;z==0?Q=new E.Cartesian3(ie,re,0):z==1&&(ee=new E.Cartesian3(ie,re,0));var ae=f+(z+1)*J,fe=m+(z+1)*X,ne={x:ae,y:fe},ne={x:ae,y:fe},oe=T.camera.pickEllipsoid(ne,T.scene.globe.ellipsoid),se=E.Cartographic.fromCartesian(oe),ae=E.Math.toDegrees(se.longitude),fe=E.Math.toDegrees(se.latitude),de=E.Transforms.eastNorthUpToFixedFrame(E.Cartesian3.fromDegrees(ae,fe,6)),ve=E.Model.fromGltf({url:w,modelMatrix:de,scale:100}),pe=T.scene.primitives.add(ve);A.push(ve)}return A};ad.prototype.setPolylinemodels_obsolete=function(o,f,m,v,y,x,C,w,A,E){var T=this._core.getSpaceDistancem(o,w),S=10,M=parseFloat(C.distance);M==0||(S=parseInt(T/M));for(var I=o[0],P=o[o.length-1],D=w.Cartographic.fromCartesian(I),L=w.Math.toDegrees(D.longitude),R=w.Math.toDegrees(D.latitude),O=D.height,F=w.Cartographic.fromCartesian(P),k=w.Math.toDegrees(F.longitude),U=w.Math.toDegrees(F.latitude),G=F.height,j=w.Math.toDegrees(D.height),q=S,J=w.Math.lerp(L,k,1/q)-L,X=w.Math.lerp(R,U,1/q)-R,Y=w.Math.lerp(f,v,1/q)-f,Q=w.Math.lerp(m,y,1/q)-m,ee=[],z,ie,re=0;re<q;re++){var ne=L+(re+1)*J,oe=R+(re+1)*X,se=w.Transforms.eastNorthUpToFixedFrame(w.Cartesian3.fromDegrees(ne,oe,C.height)),ae=parseInt(C.heightReference),fe=w.Model.fromGltf({url:C.url,modelMatrix:se,color:C.color,lightColor:C.lightColor,scale:parseInt(C.scale),heightReference:parseInt(C.heightReference),distanceDisplayCondition:C.distanceDisplayCondition}),de=A.scene.primitives.add(fe,E);x.push(fe)}return x};ad.prototype.setPolylinemodels=function(o,f,m,v,y,x,C,w,A,E){var T=this._core.getSpaceDistancem(o,w),S=10,M=parseFloat(C.distance);M==0||(S=parseInt(T/M));for(var I=o[0],P=o[o.length-1],D=w.Cartographic.fromCartesian(I),L=w.Math.toDegrees(D.longitude),R=w.Math.toDegrees(D.latitude),O=D.height,F=w.Cartographic.fromCartesian(P),k=w.Math.toDegrees(F.longitude),U=w.Math.toDegrees(F.latitude),G=F.height,j=w.Math.toDegrees(D.height),q=S,J=w.Math.lerp(L,k,1/q)-L,X=w.Math.lerp(R,U,1/q)-R,Y=w.Math.lerp(f,v,1/q)-f,Q=w.Math.lerp(m,y,1/q)-m,ee=[],z,ie,re=0;re<q;re++){var ne=L+(re+1)*J,oe=R+(re+1)*X,se=w.Transforms.eastNorthUpToFixedFrame(w.Cartesian3.fromDegrees(ne,oe,parseInt(C.height?C.height:0))),ae=parseInt(C.heightReference);Cesium.Matrix4.multiplyByUniformScale(se,parseInt(C.scale),se),x.push({modelMatrix:se,modelId:C})}return x};ad.prototype.createPolygonModel=function(o,f,m,v,y,x){var C={height:0,extrudedHeight:0,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,stRotation:0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,perPositionHeight:!1,closeTop:!0,closeBottom:!0,shadows:this._cesium.ShadowMode.ENABLED,clampToGround:!0,scale:1,classificationType:this._cesium.ClassificationType.BOTH},w=m.modelurl;!this._core.isnull(m)&&!this._core.isnull(m.fill)&&(this._core.isHtmlColor(m.fill)?m.material=this._color.colorFromHtmlColor(m.fill):(/^rgb/.test(m.fill)&&(m.material=this._color.rgbaStringToRgbaObj(m.fill)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.color)&&(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))),!this._core.isnull(m)&&!this._core.isnull(m.lightColor)&&(this._core.isHtmlColor(m.lightColor)?m.lightColor=this._color.colorFromHtmlColor(m.lightColor):(/^rgb/.test(m.lightColor)&&(m.lightColor=this._color.rgbaStringToRgbaObj(m.lightColor)),m.lightColor.r>1&&(m.lightColor.r=m.lightColor.r/255),m.lightColor.g>1&&(m.lightColor.g=m.lightColor.g/255),m.lightColor.b>1&&(m.lightColor.b=m.lightColor.b/255),m.lightColor.a>1&&(m.lightColor.a=m.lightColor.a/255),m.lightColor=this._color.createColor(m.lightColor.r,m.lightColor.g,m.lightColor.b,m.lightColor.a)));var A=this._core.extend(C,m,!0);m.checked=y,A.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND;var E={clampToGround:!0};f==null&&console.log("geojson is required");var T=null;f.then?T=f:T=this._cesium.GeoJsonDataSource.load(f,E),this._viewer.dataSources.add(T);var S=this,M;m&&m.time&&(M=new S._cesium.TimeIntervalCollection([new S._cesium.TimeInterval({start:m.time.start?S._cesium.JulianDate.fromDate(new Date(m.time.start)):S._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?S._cesium.JulianDate.fromDate(new Date(m.time.end)):S._cesium.Iso8601.MAXIMUM_VALUE})])),T.then(function(P){S.item=P,S.model=[];var D=P.entities.values;S._core.isnull(m.near)&&(m.near=0),S._core.isnull(m.far)&&(m.far=999999999);var L=parseFloat(m.near),R=parseFloat(m.far),O=new S._cesium.DistanceDisplayCondition(L,R);A.distanceDisplayCondition=O;for(var F=0;F<D.length;F++){var k=D[F];A.height=parseFloat(S._core.extendgl(k,m.height,A.height)),A.extrudedHeight=parseFloat(S._core.extendgl(k,m.extrudedHeight,A.extrudedHeight)),A.heightReference=S._core.extendgl(k,m.heightReference,A.heightReference),A.show=S._core.extendgl(k,m.show,A.show),A.material=S._core.extendgl(k,m.material,A.material),A.outline=S._core.extendgl(k,m.outline,A.outline),A.outlineColor=S._core.extendgl(k,m.outlineColor,A.outlineColor),A.outlineWidth=parseFloat(S._core.extendgl(k,m.outlineWidth,A.outlineWidth)),A.stRotation=S._core.extendgl(k,m.stRotation,A.stRotation),A.granularity=S._core.extendgl(k,m.granularity,A.granularity),A.distanceDisplayCondition=S._core.extendgl(k,m.distanceDisplayCondition,A.distanceDisplayCondition),A.perPositionHeight=S._core.extendgl(k,m.perPositionHeight,A.perPositionHeight),A.closeTop=S._core.extendgl(k,m.closeTop,A.closeTop),A.closeBottom=S._core.extendgl(k,m.closeBottom,A.closeBottom),A.shadows=S._core.extendgl(k,m.shadows,A.shadows),A.classificationType=S._core.extendgl(k,m.classificationType,A.classificationType);var U=k.polygon._hierarchy._value.positions;k.polygon.heightReference=1,k.polygon.show=A.show,k.polygon.material=A.material,k.polygon.outline=A.outline,k.polygon.outlineColor=A.outlineColor,k.polygon.outlineWidth=A.outlineWidth,k.polygon.stRotation=A.stRotation,k.polygon.granularity=A.granularity,k.polygon.distanceDisplayCondition=O,k.polygon.closeTop=A.closeTop,k.polygon.closeBottom=A.closeBottom,k.polygon.shadows=A.shadows,k.polygon.classificationType=A.classificationType,M&&(k.availability=M);for(var G=[],j=k.polygon.hierarchy.getValue().positions,q=0;q<j.length;q++){var J=S._cesium.Math.toDegrees(S._cesium.Cartographic.fromCartesian(j[q]).longitude),X=S._cesium.Math.toDegrees(S._cesium.Cartographic.fromCartesian(j[q]).latitude);G.push(J),G.push(X)}var Y=S.getTheBottomPoint(G),Q=S.scanningPolygon(Y,A.offset_x,A.offset_y,G),ee=[];Q.forEach(function(z){var ie=S._cesium.Transforms.eastNorthUpToFixedFrame(S._cesium.Cartesian3.fromDegrees(z.lon,z.lat,A.height)),re=S._cesium.Model.fromGltf({url:w,color:A.color,silhouetteColor:A.lightColor,silhouetteSize:A.lightWidth,modelMatrix:ie,scale:A.scale,heightReference:parseInt(A.heightReference),distanceDisplayCondition:O}),ne=S._viewer.scene.primitives.add(re,M);re.time=M,S.model.push(re)})}m.checked||S.setVisibility(!1),typeof x=="function"&&x(P)}),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id);var I={id:A.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f,style:A};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),this};ad.prototype.setItem=function(o){this.item=o};ad.prototype.modelMove=function(){this._tree.removeHandler(),this._tree.starttemporaryItem(this._viewer),this.yd=!1;var o=this;this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._tree.handler.setInputAction(function(f){var m=o._viewer.scene.pickPosition(f.position),v=o._viewer.scene.pick(f.position);if(o.yd!=null&&o.yd&&o._tree.handler.destroy(),o.yd=!0,v.tileset!=null){var y=v.tileset,x=o._cesium.Cartographic.fromCartesian(y.boundingSphere.center),C=o._cesium.Cartesian3.fromRadians(x.longitude,x.latitude,x.height);o._tree.handler.setInputAction(function(w){var A=o._viewer.scene.pickPosition(w.endPosition),E=o._cesium.Cartographic.fromCartesian(A),T=o._cesium.Cartesian3.fromRadians(E.longitude,E.latitude,x.height),S=o._cesium.Cartesian3.subtract(T,C,new o._cesium.Cartesian3);y.modelMatrix=o._cesium.Matrix4.fromTranslation(S)},o._cesium.ScreenSpaceEventType.MOUSE_MOVE)}},o._cesium.ScreenSpaceEventType.LEFT_CLICK)};ad.prototype.getTheBottomPoint=function(o){for(var f=90,m=0,v=1;v<o.length;v+=2)f=f<o[v]?f:(m=v)&&o[v];return{lon:o[m-1],lat:o[m]}};ad.prototype.scanningPolygon=function(o,f,m,v){for(var y=[],x=180,C=-180,w=-90,A,E,T,S,M,I=0;I<v.length;I+=2)w=w>v[I+1]?w:v[I+1],x=x<v[I]?x:v[I],C=C>v[I]?C:v[I];var P=this.GetPositionFromA_D(o.lat,o.lon,m,0),D=this.GetPositionFromA_D(o.lat,o.lon,f,90);for(A=D[0]-o.lon,E=P[1]-o.lat,y.push({lon:o.lon,lat:o.lat}),M={lon:o.lon,lat:o.lat},M.lat+=E;M.lat<=w;M.lat+=E){for(T={lon:M.lon-A,lat:M.lat},S={lon:M.lon+A,lat:M.lat},this.IsInPolygon(M.lon,M.lat,v)&&y.push({lon:M.lon,lat:M.lat});T.lon>=x;T.lon-=A)this.IsInPolygon(T.lon,T.lat,v)&&y.push({lon:T.lon,lat:T.lat});for(;S.lon<=C;S.lon+=A)this.IsInPolygon(S.lon,S.lat,v)&&y.push({lon:S.lon,lat:S.lat})}return y};ad.prototype.GetPositionFromA_D=function(o,f,m,v){var y=6378137,x=6356725,C=m*Math.sin(v*Math.PI/180),w=m*Math.cos(v*Math.PI/180),A=x+(y-x)*(90-o)/90,E=A*Math.cos(o*Math.PI/180),T=(C/E+f*Math.PI/180)*180/Math.PI,S=(w/A+o*Math.PI/180)*180/Math.PI;return[T,S]};ad.prototype.IsInPolygon=function(o,f,m){var v=0,y,x,C,w,A;if(m.length<6)return!1;m.push(m[0],m[1]);for(var E=0;E<m.length-2;E+=2)y=m[E],C=m[E+1],x=m[E+2],w=m[E+3],(f>=C&&f<w||f>=w&&f<C)&&Math.abs(C-w)>0&&(A=y-(y-x)*(C-f)/(C-w),A<=o&&v++);return v%2!==0};ad.prototype.createModel=function(o,f,m,v,y,x){var C={id:this._core.getuid(),uri:f,show:!0,heading:0,pitch:0,roll:0,scale:1},w=this._core.extend(C,m,!0);this._position=o;var A={id:w.id,position:this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),model:w};(w.heading||w.pitch||w.roll)&&(this.heading=w.heading,this.pitch=w.pitch,this.roll=w.roll,A.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(w.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(w.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(w.roll,0)))));var E=this;w.rotate&&(A.orientation=new this._cesium.CallbackProperty(T,!1),E.rotate=w.rotate,delete w.rotate);function T(){return E.heading=E.heading+E.rotate,E._cesium.Transforms.headingPitchRollQuaternion(E._cesium.Cartesian3.fromDegrees(E._position[0],E._position[1],E._position[2]),new E._cesium.HeadingPitchRoll(E._cesium.Math.toRadians(E._cesium.defaultValue(E.heading,0)),E._cesium.Math.toRadians(E._cesium.defaultValue(E.pitch,0)),E._cesium.Math.toRadians(E._cesium.defaultValue(E.roll,0))))}delete w.heading,delete w.pitch,delete w.roll,A.model=w,this.item=this._viewer.entities.add(A),typeof x=="function"&&x(this.item);var S={id:this.item.id,name:y||"\u65B0\u5EFA\u6A21\u578B"+C.id,pId:this._core.isnull(v)?0:v,type:"Point",item:this.item};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),this};ad.prototype.createModelEditable=function(o,f,m,v,y,x){var C={id:this._core.getuid(),uri:f,show:!0,heading:0,pitch:0,roll:0,scale:1},w=this._core.extend(C,m,!0);this._position=o;var A={position:this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),model:w},E=this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),T=this.createCylinder(E,new this._cesium.CallbackProperty(L,!1),new this._cesium.CallbackProperty(G,!1),new this._cesium.CallbackProperty(j,!1),this._cesium.Color.LIMEGREEN,!1);T.oid=1,this.modelPointArr.push(T);var S=this.createCylinder(E,new this._cesium.CallbackProperty(R,!1),new this._cesium.CallbackProperty(G,!1),new this._cesium.CallbackProperty(j,!1),this._cesium.Color.MEDIUMBLUE,!1);S.oid=2,this.modelPointArr.push(S);var M=this.createCylinder(E,new this._cesium.CallbackProperty(O,!1),new this._cesium.CallbackProperty(G,!1),new this._cesium.CallbackProperty(j,!1),this._cesium.Color.RED,!1);M.oid=3,this.modelPointArr.push(M);var I=this.creatBillboard(E,new this._cesium.CallbackProperty(q,!1),"../../img/j.png",!1);I.oid=4,this.modelPointArr.push(I);var P=this.creatBillboard(E,new this._cesium.CallbackProperty(J,!1),"../../img/s.png",!1);P.oid=5,this.modelPointArr.push(P),(w.heading||w.pitch||w.roll)&&(this.heading=w.heading,this.pitch=w.pitch,this.roll=w.roll,A.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(w.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(w.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(w.roll,0)))));var D=this;w.rotate&&(A.orientation=new this._cesium.CallbackProperty(k,!1),D.rotate=w.rotate,delete w.rotate),A.orientation=new this._cesium.CallbackProperty(F,!1),D.scale=w.scale,A.model.scale=new this._cesium.CallbackProperty(U,!1);function L(){var Y=D._cesium.Cartesian3.fromDegrees(D._position[0],D._position[1],D._position[2]),Q=D._cesium.Math.toRadians(D.heading),ee=new D._cesium.HeadingPitchRoll(Q,D._cesium.Math.toRadians(D.pitch),D._cesium.Math.toRadians(D.roll));return D._cesium.Transforms.headingPitchRollQuaternion(Y,ee)}function R(){var Y=D._cesium.Cartesian3.fromDegrees(D._position[0],D._position[1],D._position[2]),Q=D._cesium.Math.toRadians(D.heading),ee=new D._cesium.HeadingPitchRoll(Q,D._cesium.Math.toRadians(90+D.pitch),D._cesium.Math.toRadians(D.roll));return D._cesium.Transforms.headingPitchRollQuaternion(Y,ee)}function O(){var Y=D._cesium.Cartesian3.fromDegrees(D._position[0],D._position[1],D._position[2]),Q=D._cesium.Math.toRadians(D.heading),ee=new D._cesium.HeadingPitchRoll(Q,D._cesium.Math.toRadians(D.pitch),D._cesium.Math.toRadians(90+D.roll));return D._cesium.Transforms.headingPitchRollQuaternion(Y,ee)}function F(){return D._cesium.Transforms.headingPitchRollQuaternion(D._cesium.Cartesian3.fromDegrees(D._position[0],D._position[1],D._position[2]),new D._cesium.HeadingPitchRoll(D._cesium.Math.toRadians(D._cesium.defaultValue(D.heading,0)),D._cesium.Math.toRadians(D._cesium.defaultValue(D.pitch,0)),D._cesium.Math.toRadians(D._cesium.defaultValue(D.roll,0))))}function k(){return D.heading=D.heading+D.rotate,D._cesium.Transforms.headingPitchRollQuaternion(D._cesium.Cartesian3.fromDegrees(D._position[0],D._position[1],D._position[2]),new D._cesium.HeadingPitchRoll(D._cesium.Math.toRadians(D._cesium.defaultValue(D.heading,0)),D._cesium.Math.toRadians(D._cesium.defaultValue(D.pitch,0)),D._cesium.Math.toRadians(D._cesium.defaultValue(D.roll,0))))}function U(){return D.scale}function G(){return D.Radius*D.scale}function j(){return D.Radius*100}function q(){return new D._cesium.Cartesian2(0,-(D.Radius*D.scale))}function J(){return new D._cesium.Cartesian2(-(D.Radius*D.scale),0)}delete w.heading,delete w.pitch,delete w.roll,A.model=w,this.item=this._viewer.entities.add(A),this.item.objId=this.objId,this.state=1,typeof x=="function"&&x(this.item);var X={id:this.item.id,name:y||"\u65B0\u5EFA\u6A21\u578B"+C.id,pId:this._core.isnull(v)?0:v,type:"Point",item:this.item};return this.setTreeobj(X),this._tree.insertGroupId(X,this._core.isnull(v)?0:v),this};ad.prototype.createOrientation=function(o,f,m){var v=this._cesium.Math.toRadians(0),y=new this._cesium.HeadingPitchRoll(v,this._cesium.Math.toRadians(f),this._cesium.Math.toRadians(m));return this._cesium.Transforms.headingPitchRollQuaternion(o,y)};ad.prototype.createCylinder=function(o,f,m,v,y,x){if(!!o)return this._viewer.entities.add({position:o,orientation:f,cylinder:{length:10,topRadius:m,bottomRadius:m,fill:!1,material:y.withAlpha(.5),outline:!0,outlineWidth:10,outlineColor:y,numberOfVerticalLines:v,slices:v},show:x})};ad.prototype.startModify=function(){if(!(this.state!=2&&this.state!=1)){var o=this;this.modifyHandler||(this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var f=0;f<o.modelPointArr.length;f++){var m=o.modelPointArr[f];m&&(m.show=!0)}var v,y,x,C,w,A;this.modifyHandler.setInputAction(function(E){var T=o._viewer.scene.pick(E.position);o._cesium.defined(T)&&T.id&&(T.id.objId?o.modifyModel=T.id:o.modifyPoint&&(o.modifyPoint.oid==4||o.modifyPoint.oid==5)?(T.id.oid!=o.modifyPoint.oid&&(o.modifyPoint=T.id),o.modifyPoint.oid==4?o.scale=o.scale+1:o.scale=o.scale-1):o.modifyPoint=T.id,o.forbidDrawWorld(!0));var S=o._cesium.Cartesian3.fromDegrees(o._position[0],o._position[1],o._position[2]);v=o._cesium.SceneTransforms.wgs84ToWindowCoordinates(o._viewer.scene,S),y=E.position,C=o.heading+0,A=o.roll+0,w=o.pitch+0,o.state=2},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(E){var T=o._viewer.scene.pick(E.position);if(!(o._cesium.defined(T)&&T.id)){for(var S=0;S<o.modelPointArr.length;S++){var M=o.modelPointArr[S];M&&(M.show=!1)}o.modifyHandler&&(o.modifyHandler.destroy(),o.modifyHandler=null)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(E){var T=o._viewer.scene.pick(E.endPosition);if(!(!o.modifyModel&&!o.modifyPoint)){var S=o._viewer.scene.pickPosition(E.endPosition);if(S){if(o.modifyModel){o.item.position.setValue(S);for(var M=0;M<o.modelPointArr.length;M++){var I=o.modelPointArr[M];I&&I.position.setValue(S)}}else if(o.modifyPoint){x=E.endPosition;var P=o.arge(v,y,x);o.modifyPoint.oid==1?o.heading=C+P:o.modifyPoint.oid==2?o.roll=A+P:o.modifyPoint.oid==3&&(o.pitch=w+P)}}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(E){!o.modifyPoint&&!o.modifyModel||o.modifyPoint&&(o.modifyPoint.oid==4||o.modifyPoint.oid==5)||(o.modifyPoint=null,o.modifyModel=null,o.forbidDrawWorld(!1))},this._cesium.ScreenSpaceEventType.LEFT_UP)}};ad.prototype.creatBillboard=function(o,f,m,v){var y=this._viewer.entities.add({position:o,show:v,billboard:{image:m,pixelOffset:f,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM}});return y.attr="editPoint",y};ad.prototype.arge=function(o,f,m){var v=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),y=Math.sqrt(Math.pow(o.x-m.x,2)+Math.pow(o.y-m.y,2)),x=Math.sqrt(Math.pow(f.x-m.x,2)+Math.pow(f.y-m.y,2)),C=(Math.pow(v,2)+Math.pow(y,2)-Math.pow(x,2))/(2*v*y);return Math.round(Math.acos(C)*180/Math.PI)};ad.prototype.forbidDrawWorld=function(o){this._viewer.scene.screenSpaceCameraController.enableRotate=!o,this._viewer.scene.screenSpaceCameraController.enableTilt=!o,this._viewer.scene.screenSpaceCameraController.enableTranslate=!o,this._viewer.scene.screenSpaceCameraController.enableInputs=!o};ad.prototype.getCatesian3FromPX=function(o,f,m){var v=f.scene.pick(o),y,x=f.scene.drillPick(o),C=null;if(m){for(var w=0;w<x.length;w++)if(x[w].id._id!=m[0].id&&x[w].id._id!=m[1].id){C=x[w].id;break}}else C=v;if(f.scene.pickPositionSupported&&Cesium.defined(C))y=f.scene.pickPosition(o);else{var A=f.camera.getPickRay(o);if(!A)return;y=f.scene.globe.pick(A,f.scene)}return y};ad.prototype.setTreeobj=function(o){this.treeobj=o};ad.prototype.setVisibility=function(o){if(this.item.item?this.item.item.show=o:this.item.show=o,this.model.length>0)for(var f=0;f<this.model.length;f++)this.model[f].show=o,this.model[f]._availability&&!o?this.model[f]._availability=void 0:this.model[f].time&&o&&(this.model[f]._availability=this.model[f].time)};ad.prototype.setOrientation=function(o){(o.heading||o.pitch||o.roll)&&(this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._cesium.defaultValue(o.heading,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(o.pitch,0)),this._cesium.Math.toRadians(this._cesium.defaultValue(o.roll,0)))))};ad.prototype.setScale=function(o){this.item&&this.item.model&&(this.item.model.scale=o)};ad.prototype.setPosition=function(o){this.item&&this.item.model&&(this._position=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._position[0],this._position[1],this._position[2]))};ad.prototype.getVisibility=function(){return this.item.show};ad.prototype.deleteObject=function(){if(this.model&&this.model.length)for(var o=0;o<this.model.length;o++)this._viewer.scene.primitives.remove(this.model[o]);try{this._viewer.scene.primitives.remove(this.item)}catch{}try{this._viewer.entities.remove(this.item)}catch{}try{this._viewer.dataSources.remove(this.item)}catch{}try{this._Provider.remove()}catch{}};var VT=ad;function yg(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this._Provider=void 0,this._primitive=void 0,this._taskProcessor=new this._cesium.TaskProcessor("vectorTileProvider"),this.model=[],this.Legend=[],this._ajax=null,this.datas=null}yg.prototype.createPolygonGeoJsonFeatureLayer=function(o,f,m,v,y){var x={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var C=this._core.extend(x,m,!0);f==null&&console.log("geojson is required");var w=null;f.then?w=f:w=this._cesium.GeoJsonDataSource.load(f);var A=this,E=[];w.then(function(S){for(var M=S.entities.values,I=0;I<M.length;I++){var P=M[I];C.polygonHierarchy=new A._cesium.PolygonHierarchy(P.polygon.hierarchy._value.positions);var D=new A._cesium.PolygonGeometry(C),L=A._cesium.PolygonGeometry.createGeometry(D),R=new A._cesium.GeometryInstance({geometry:L});E.push(R)}var O=A._viewer.scene.primitives.add(new A._cesium.Primitive({geometryInstances:E,appearance:new A._cesium.MaterialAppearance({material:new A._cesium.Material({fabric:{type:"Color",uniforms:{color:C.material}}}),faceForward:!0,flat:!1})})),F="material:"+C.material.red*255+","+C.material.green*255+","+C.material.blue*255;A.Legend.push(F),A.item=O,C.show==!1&&(O.show=!1),typeof y=="function"&&y(O)}),this._core.isnull(C.id)&&(C.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+C.id);var T={id:C.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f,style:C};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};yg.prototype.deleteObject=function(){if(this.items!=null&&this.items!=null&&this.items.length>0)for(var o=0;o<this.items.length;o++)this._viewer.scene.primitives.remove(this.items[o]);else this._viewer.scene.primitives.remove(this.item);if(this.model!=null&&this.model!=null&&this.model.length>0)for(var o=0;o<this.model.length;o++)this._viewer.scene.primitives.remove(this.model[o]);try{this._Provider.remove()}catch{}};yg.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(!o)}catch{}};yg.prototype.setVisibility=function(o){if(this.items!=null&&this.items!=null&&this.items.length>0)for(var f=0;f<this.items.length;f++)this.items[f].show=o;else this.item.show=o;if(this.model!=null&&this.model!=null&&this.model.length>0)for(var f=0;f<this.model.length;f++)this.model[f].show=o;this._Provider&&this._Provider.setStatus(!o)};yg.prototype.createPolygonVectorGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(C,m,!0);A.extrudedHeight==0&&(A.extrudedHeight=999999),this.items=[];var E=this,T=new Ah(this._viewer,this._cesium,w);this._Provider=T,T._loadTile=function(M){var I=[],P=null,D=scene.primitives;E.Legend=[];var L=new E._cesium.PrimitiveCollection;if(M.features.forEach(function(R){if(T._isCameraMoving)return null;var O=[];function F(G){for(var j=0;j<G.length;j++)Array.isArray(G[j])?F(G[j]):O.push(G[j])}if(Array.isArray(R.geometry.coordinates)&&R.geometry.coordinates.length>0)if(Array.isArray(R.geometry.coordinates[0][0]))for(var k=0;k<R.geometry.coordinates.length;k++)O=[],F(R.geometry.coordinates[k]),U(O);else F(R.geometry.coordinates),U(O);function U(G){if(T._isCameraMoving)return null;var j=E._cesium.Cartesian3.fromDegreesArray(G);if(/^\[/.test(m.extrudedHeight)&&/\]$/.test(m.extrudedHeight)){var q=m.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(R.properties[q])}if(A.extrudedHeight=parseFloat(A.extrudedHeight),A.heightReference==1&&delete A.height,A.extrudedHeightReference==1&&delete A.extrudedHeight,/^\[/.test(m.material)&&/\]$/.test(m.material)){var J=m.material.replace(/\[/,"").replace(/\]/,"");A.material=R.properties[J],E._core.isHtmlColor(A.material)?A.material=E._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=E._color.rgbaStringToRgbaObj(A.material)),A.material.r>1&&(A.material.r=A.material.r/255),A.material.g>1&&(A.material.g=A.material.g/255),A.material.b>1&&(A.material.b=A.material.b/255),A.material.a>1&&(A.material.a=A.material.a/255),A.material=E._color.createColor(A.material.r,A.material.g,A.material.b,A.material.a))}A.polygonHierarchy=new E._cesium.PolygonHierarchy(j),R.positions=j;var X=new E._cesium.PolygonGeometry(A),Y=null;Y=new E._cesium.GeometryInstance({id:R,geometry:X,attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}});var Q="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;E.Legend.push(Q),I.push(Y)}}),I.length>0)return P=new E._cesium.GroundPrimitive({geometryInstances:I,appearance:new E._cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:A.classificationType}),P},this.item=T._primitiveCollection,T.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};yg.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel=function(o,f,m,v,y,x){var C={polygonHierarchy:void 0,height:0,extrudedHeight:999999,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},A=m.material,E=m.height;!this._core.isnull(m)&&!this._core.isnull(m.color)&&(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))),!this._core.isnull(m)&&!this._core.isnull(m.lightColor)&&(this._core.isHtmlColor(m.lightColor)?m.lightColor=this._color.colorFromHtmlColor(m.lightColor):(/^rgb/.test(m.lightColor)&&(m.lightColor=this._color.rgbaStringToRgbaObj(m.lightColor)),m.lightColor.r>1&&(m.lightColor.r=m.lightColor.r/255),m.lightColor.g>1&&(m.lightColor.g=m.lightColor.g/255),m.lightColor.b>1&&(m.lightColor.b=m.lightColor.b/255),m.lightColor.a>1&&(m.lightColor.a=m.lightColor.a/255),m.lightColor=this._color.createColor(m.lightColor.r,m.lightColor.g,m.lightColor.b,m.lightColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var T=this._core.extend(C,m,!0);T.extrudedHeight==0&&(T.extrudedHeight=999999),this.items=[];var S=this,M=new Ah(this._viewer,this._cesium,w);this._Provider=M,M._loadTile=function(P){var D=[],L=null,R=scene.primitives,O=new S._cesium.PrimitiveCollection;return S.Legend=[],P.features.forEach(function(F){if(M._isCameraMoving)return null;var k=[];function U(J){for(var X=0;X<J.length;X++)Array.isArray(J[X])?U(J[X]):k.push(J[X])}if(Array.isArray(F.geometry.coordinates)&&F.geometry.coordinates.length>0)if(Array.isArray(F.geometry.coordinates[0][0]))for(var G=0;G<F.geometry.coordinates.length;G++)k=[],U(F.geometry.coordinates[G]),j(k),q(k);else U(F.geometry.coordinates),j(k),q(k);function j(J){if(M._isCameraMoving)return null;var X=S._cesium.Cartesian3.fromDegreesArray(J);if(/^\[/.test(m.extrudedHeight)&&/\]$/.test(m.extrudedHeight)){var Y=m.extrudedHeight.replace(/\[/,"").replace(/\]/,"");T.extrudedHeight=parseFloat(F.properties[Y])}if(T.extrudedHeight=parseFloat(T.extrudedHeight),T.heightReference==1&&delete T.height,T.extrudedHeightReference==1&&delete T.extrudedHeight,/^\[/.test(m.material)&&/\]$/.test(m.material)){var Q=m.material.replace(/\[/,"").replace(/\]/,"");T.material=F.properties[Q],S._core.isHtmlColor(T.material)?T.material=S._color.colorFromHtmlColor(T.material):(/^rgb/.test(T.material)&&(T.material=S._color.rgbaStringToRgbaObj(T.material)),T.material.r>1&&(T.material.r=T.material.r/255),T.material.g>1&&(T.material.g=T.material.g/255),T.material.b>1&&(T.material.b=T.material.b/255),T.material.a>1&&(T.material.a=T.material.a/255),T.material=S._color.createColor(T.material.r,T.material.g,T.material.b,T.material.a))}T.polygonHierarchy=new S._cesium.PolygonHierarchy(X);var ee=new S._cesium.PolygonGeometry(T),z=null;F.positions=X,z=new S._cesium.GeometryInstance({id:F,geometry:ee,attributes:{color:new S._cesium.ColorGeometryInstanceAttribute.fromColor(T.material)}});var ie="material:"+T.material.red*255+","+T.material.green*255+","+T.material.blue*255;S.Legend.push(ie),L=new S._cesium.ClassificationPrimitive({geometryInstances:z,appearance:new S._cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:T.classificationType,shadows:S._cesium.ShadowMode.ENABLED}),O.add(L)}function q(J){for(var X=S._cesium.Cartesian3.fromDegreesArray(J),Y=new S._cesium.PolygonHierarchy(X),Q=[],ee=Y.positions,z=0;z<ee.length;z++){var ie=S._cesium.Math.toDegrees(S._cesium.Cartographic.fromCartesian(ee[z]).longitude),re=S._cesium.Math.toDegrees(S._cesium.Cartographic.fromCartesian(ee[z]).latitude);Q.push(ie),Q.push(re)}var ne=S.getTheBottomPoint(Q),oe=S.scanningPolygon(ne,T.offset_x,T.offset_y,Q),se=[];oe.forEach(function(ae){var fe=S._cesium.Transforms.eastNorthUpToFixedFrame(S._cesium.Cartesian3.fromDegrees(ae.lon,ae.lat,E)),de=S._cesium.Model.fromGltf({url:A,color:T.color,lightColor:T.lightColor,modelMatrix:fe,scale:T.scale});O.add(de)})}}),O},m&&m.time&&(M.availability=new S._cesium.TimeIntervalCollection([new S._cesium.TimeInterval({start:m.time.start?S._cesium.JulianDate.fromDate(new Date(m.time.start)):S._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?S._cesium.JulianDate.fromDate(new Date(m.time.end)):S._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=M._primitiveCollection,M.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(T.id)&&(T.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+T.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:T.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};yg.prototype.GetPositionFromA_D=function(o,f,m,v){var y=6378137,x=6356725,C=m*Math.sin(v*Math.PI/180),w=m*Math.cos(v*Math.PI/180),A=x+(y-x)*(90-o)/90,E=A*Math.cos(o*Math.PI/180),T=(C/E+f*Math.PI/180)*180/Math.PI,S=(w/A+o*Math.PI/180)*180/Math.PI;return[T,S]};yg.prototype.getTheBottomPoint=function(o){for(var f=90,m=0,v=1;v<o.length;v+=2)f=f<o[v]?f:(m=v)&&o[v];return{lon:o[m-1],lat:o[m]}};yg.prototype.scanningPolygon=function(o,f,m,v){for(var y=[],x=180,C=-180,w=-90,A,E,T,S,M,I=0;I<v.length;I+=2)w=w>v[I+1]?w:v[I+1],x=x<v[I]?x:v[I],C=C>v[I]?C:v[I];var P=this.GetPositionFromA_D(o.lat,o.lon,m,0),D=this.GetPositionFromA_D(o.lat,o.lon,f,90);for(A=D[0]-o.lon,E=P[1]-o.lat,y.push({lon:o.lon,lat:o.lat}),M={lon:o.lon,lat:o.lat},M.lat+=E;M.lat<=w;M.lat+=E){for(T={lon:M.lon-A,lat:M.lat},S={lon:M.lon+A,lat:M.lat},this.IsInPolygon(M.lon,M.lat,v)&&y.push({lon:M.lon,lat:M.lat});T.lon>=x;T.lon-=A)this.IsInPolygon(T.lon,T.lat,v)&&y.push({lon:T.lon,lat:T.lat});for(;S.lon<=C;S.lon+=A)this.IsInPolygon(S.lon,S.lat,v)&&y.push({lon:S.lon,lat:S.lat})}return y};yg.prototype.IsInPolygon=function(o,f,m){var v=0,y,x,C,w,A;if(m.length<6)return!1;m.push(m[0],m[1]);for(var E=0;E<m.length-2;E+=2)y=m[E],C=m[E+1],x=m[E+2],w=m[E+3],(f>=C&&f<w||f>=w&&f<C)&&Math.abs(C-w)>0&&(A=y-(y-x)*(C-f)/(C-w),A<=o&&v++);return v%2!==0};yg.prototype.setPolylinemodels=function(o,f,m,v,y,x,C,w,A){var E=this._core.getSpaceDistancem(o,w),T=10,S=parseFloat(C.distance);S==0||(T=parseInt(E/S));for(var M=o[0],I=o[o.length-1],P=w.Cartographic.fromCartesian(M),D=w.Math.toDegrees(P.longitude),L=w.Math.toDegrees(P.latitude),R=P.height,O=w.Cartographic.fromCartesian(I),F=w.Math.toDegrees(O.longitude),k=w.Math.toDegrees(O.latitude),U=O.height,G=w.Math.toDegrees(P.height),j=T,q=w.Math.lerp(D,F,1/j)-D,J=w.Math.lerp(L,k,1/j)-L,X=w.Math.lerp(f,v,1/j)-f,Y=w.Math.lerp(m,y,1/j)-m,Q=[],ee,z,ie=0;ie<j;ie++){var re=D+(ie+1)*q,ne=L+(ie+1)*J,oe=w.Transforms.eastNorthUpToFixedFrame(w.Cartesian3.fromDegrees(re,ne,C.height)),se=parseInt(C.heightReference),ae=w.Model.fromGltf({url:C.url,modelMatrix:oe,color:C.color,lightColor:C.lightColor,scale:C.scale,heightReference:parseInt(C.heightReference)}),fe=A.scene.primitives.add(ae);x.push(ae)}return x};yg.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsjl=function(o,f,m,v,y,x){var C={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(C,m,!0),E=this,T=new Ah(this._viewer,this._cesium,w);this._Provider=T,T._loadTile=function(M,I){var P=[],D=[],L=E._taskProcessor.scheduleTask({json:M,styleOption:m,options:A,tileKey:I});if(!!E._cesium.defined(L)){var R=E;E._cesium.when(L,function(O){if(!T._primitiveByTile[O.tileKey]){for(var F=new R._cesium.PrimitiveCollection,k=0;k<O.geomInstances.length;k++){var U=null,G=O.geomInstances[k],j=G.id.id;if(!T._primitiveByTile[j]){var q=new R._cesium.Material({fabric:{type:"Color",uniforms:{color:O.materials[k]}}}),J=new R._cesium.MaterialAppearance({material:q,faceForward:!0,flat:!1}),U=new R._cesium.Primitive({allowPicking:!0,appearance:new R._cesium.PerInstanceColorAppearance,geometryInstances:G,shadows:E._cesium.ShadowMode.ENABLED});F.add(U)}}T._primitiveCollection.add(F),T._primitiveByTile[O.tileKey]=F}})}},this.item=T._primitiveCollection,T.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};yg.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls=function(o,f,m,v,y,x){var C={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,shadows:this._cesium.ShadowMode.ENABLED,show:!0},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):/^http/.test(m.material)||(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.fill)&&(m.fill.toString().charAt(0)=="["&&m.fill.toString().charAt(m.fill.length-1)=="]"||(this._core.isHtmlColor(m.fill)?m.fill=this._color.colorFromHtmlColor(m.fill):/^http/.test(m.fill)||(/^rgb/.test(m.fill)&&(m.fill=this._color.rgbaStringToRgbaObj(m.fill)),m.fill.r>1&&(m.fill.r=m.fill.r/255),m.fill.g>1&&(m.fill.g=m.fill.g/255),m.fill.b>1&&(m.fill.b=m.fill.b/255),m.fill.a>1&&(m.fill.a=m.fill.a/255),m.fill=this._color.createColor(m.fill.r,m.fill.g,m.fill.b,m.fill.a))));var A=this._core.extend(C,m,!0),E=this,T=new Ah(this._viewer,this._cesium,w);this._Provider=T,T._loadTile=function(M){var I=[];E.Legend=[];var P=new E._cesium.PrimitiveCollection;return M.features.forEach(function(D){var L=[];function R(k){for(var U=0;U<k.length;U++)Array.isArray(k[U])?R(k[U]):L.push(k[U])}if(Array.isArray(D.geometry.coordinates)&&D.geometry.coordinates.length>0)if(Array.isArray(D.geometry.coordinates[0][0]))for(var O=0;O<D.geometry.coordinates.length;O++)L=[],R(D.geometry.coordinates[O]),F(L);else R(D.geometry.coordinates),F(L);function F(k){var U=E._cesium.Cartesian3.fromDegreesArray(k);if(/^\[/.test(m.extrudedHeight)&&/\]$/.test(m.extrudedHeight)){var G=m.extrudedHeight.replace(/\[/,"").replace(/\]/,"");A.extrudedHeight=parseFloat(D.properties[G])}if(A.extrudedHeight=parseFloat(A.extrudedHeight),A.heightReference==1&&delete A.height,A.extrudedHeightReference==1&&delete A.extrudedHeight,/^\[/.test(m.material)&&/\]$/.test(m.material)){var j=m.material.replace(/\[/,"").replace(/\]/,"");A.material=D.properties[j],E._core.isHtmlColor(A.material)?A.material=E._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=E._color.rgbaStringToRgbaObj(A.material)),A.material.r>1&&(A.material.r=A.material.r/255),A.material.g>1&&(A.material.g=A.material.g/255),A.material.b>1&&(A.material.b=A.material.b/255),A.material.a>1&&(A.material.a=A.material.a/255),A.material=E._color.createColor(A.material.r,A.material.g,A.material.b,A.material.a))}A.polygonHierarchy=new E._cesium.PolygonHierarchy(U),D.positions=U;var q=new E._cesium.PolygonGeometry(A),J=null,X=new E._cesium.ColorGeometryInstanceAttribute.fromColor(A.fill),Y={};if(/^http/.test(A.material))Y=new E._cesium.Material({fabric:{type:"Image",uniforms:{image:A.material}}});else{var Q="material:"+A.material.red*255+","+A.material.green*255+","+A.material.blue*255;E.Legend.push(Q),Y=new E._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}})}J=new E._cesium.GeometryInstance({id:D,geometry:q,attributes:{color:X}});var ee=null;ee=new E._cesium.Primitive({allowPicking:!0,appearance:new E._cesium.MaterialAppearance({material:Y}),geometryInstances:J,shadows:E._cesium.ShadowMode.ENABLED}),P.add(ee)}}),P},m&&m.time&&(T.availability=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=T._primitiveCollection,T.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};yg.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),this._option=this._core.extend(C,m,!0);var A=this,E=f.urlinit,T={polygonHierarchy:void 0,height:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!1,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED};$.ajax({url:E,type:"get",async:!1,dataType:"json",success:function(I){A.datas=I.features}});var S=new Ah(this._viewer,this._cesium,w);this._Provider=S,S._loadTile=function(I){var P=[];A.Legend=[];var D=new A._cesium.PrimitiveCollection,L=[],R=[],O=new Cesium.PrimitiveCollection;return I.features.forEach(function(F){var k=[];function U(X){for(var Y=0;Y<X.length;Y++)Array.isArray(X[Y])?(X[Y].length==3&&X[Y].splice(2,1),X[Y].push(A._option.height),U(X[Y])):k.push(X[Y])}var G=F.id,j=parseInt(G.split(".")[1])-1;if(F=A.datas[j],Array.isArray(F.geometry.coordinates)&&F.geometry.coordinates.length>0&&Array.isArray(F.geometry.coordinates[0][0][0]))for(var q=0;q<F.geometry.coordinates[0].length;q++)k=[],U(F.geometry.coordinates[0][q]),J(k);function J(X){if(/^\[/.test(A._option.extrudedHeight)&&/\]$/.test(A._option.extrudedHeight)){var Y=A._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");T.extrudedHeight=parseFloat(F.properties[Y])}if(T.material=A._option.material,/^\[/.test(A._option.material)&&/\]$/.test(A._option.material)){var Q=A._option.material.replace(/\[/,"").replace(/\]/,"");T.material=F.properties[Q],A._core.isHtmlColor(T.material)?T.material=A._color.colorFromHtmlColor(T.material):(/^rgb/.test(T.material)&&(T.material=A._color.rgbaStringToRgbaObj(T.material)),T.material.red>1&&(T.material.red=T.material.red/255),T.material.green>1&&(T.material.green=T.material.green/255),T.material.blue>1&&(T.material.blue=T.material.blue/255),T.material.alpha>1&&(T.material.a=T.material.alpha/255),T.material=A._color.createColor(T.material.red,T.material.green,T.material.blue,T.material.alpha))}else A._option.material&&(T.material=A._option.material),T.material&&(A._core.isHtmlColor(T.material)?T.material=A._color.colorFromHtmlColor(T.material):(/^rgb/.test(T.material)&&(T.material=A._color.rgbaStringToRgbaObj(T.material)),T.material.red>1&&(T.material.red=T.material.red/255),T.material.green>1&&(T.material.green=T.material.green/255),T.material.blue>1&&(T.material.blue=T.material.blue/255),T.material.alpha>1&&(T.material.a=T.material.alpha/255),T.material=A._color.createColor(T.material.red,T.material.green,T.material.blue,T.material.alpha)));var ee=A._cesium.Cartesian3.fromDegreesArrayHeights(X);T.polygonHierarchy=new A._cesium.PolygonHierarchy(ee);var z=new A._cesium.PolygonGeometry(T),ie=new Cesium.GeometryInstance({id:F,geometry:z,attributes:{color:new A._cesium.ColorGeometryInstanceAttribute.fromColor(A._option.randomColor?Cesium.Color.fromRandom().withAlpha(T.material.alpha):T.material)}});L.push(ie);var re={positions:ee,width:A._option.width},ne=new A._cesium.GroundPolylineGeometry(re),oe=new A._cesium.GeometryInstance({geometry:ne});R.push(oe);var se="material:"+T.material.red*255+","+T.material.green*255+","+T.material.blue*255;A.Legend.push(se)}}),L.length>0&&(T.extrudedHeight?O.add(new A._cesium.Primitive({geometryInstances:L,appearance:new A._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:A._core.Shaders("vertexShaderSource"),fragmentShaderSource:A._core.Shaders("fragmentShaderSource")})})):O.add(new A._cesium.GroundPrimitive({geometryInstances:L,appearance:new A._cesium.PerInstanceColorAppearance({translucent:!0,vertexShaderSource:A._core.Shaders("vertexShaderSource")})}))),R.length>0&&O.add(new A._cesium.GroundPolylinePrimitive({geometryInstances:R,appearance:new A._cesium.PolylineMaterialAppearance({material:new A._cesium.Material({fabric:{type:"Color",uniforms:{color:A._option.outlineColor}}})}),shadows:A._cesium.ShadowMode.ENABLED})),O},this.item=S._primitiveCollection,S.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(T.id)&&(T.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+T.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var M={id:T.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};return this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};yg.prototype.setTreeobj=function(o){this.treeobj=o};yg.prototype.createPolygonVectorFeatureLayerProvider=function(o,f,m,v,y){var x={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var w=this._core.extend(x,m,!0),A=this,E=new Ah(this._viewer,this._cesium,C);this._Provider=E,E._loadTile=function(S){var M=[];A.Legend=[],S.features.forEach(function(P){var D=[];function L(j){for(var q=0;q<j.length;q++)Array.isArray(j[q])?L(j[q]):D.push(j[q])}L(P.geometry.coordinates[0]);var R=A._cesium.Cartesian3.fromDegreesArray(D);if(/^\[/.test(m.extrudedHeight)&&/\]$/.test(m.extrudedHeight)){var O=m.extrudedHeight.replace(/\[/,"").replace(/\]/,"");w.extrudedHeight=parseFloat(P.properties[O])}w.polygonHierarchy=new A._cesium.PolygonHierarchy(R);var F=new A._cesium.PolygonGeometry(w),k=A._cesium.PolygonGeometry.createGeometry(F),U="material:"+w.material.red*255+","+w.material.green*255+","+w.material.blue*255;A.Legend.push(U);var G=new A._cesium.GeometryInstance({geometry:k,attributes:{color:new A._cesium.ColorGeometryInstanceAttribute.fromColor(w.material)},shadows:A._cesium.ShadowMode.ENABLED});M.push(G)});var I=new this._cesium.Primitive({allowPicking:!1,appearance:new this._cesium.PerInstanceColorAppearance({translucent:!1,flat:!0,faceForward:!0,closed:!0}),geometryInstances:M});return I},this.item=E._primitiveCollection,E.addTo(this._viewer),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w.id);var T={id:w.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),typeof y=="function"&&y(this.item)};yg.prototype.createPolygonVectorMonomerFeatureLayerProvider=function(o,f,m,v,y){var x={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.WHITE,show:!0},C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var w=this._core.extend(x,m,!0),A=new Ah(this._viewer,this._cesium,C);this._Provider=A;var E=this;A._loadTile=function(S){var M=[];S.features.forEach(function(P){var D=[];function L(U){for(var G=0;G<U.length;G++)Array.isArray(U[G])?L(U[G]):D.push(U[G])}L(P.geometry.coordinates[0]);var R=E._cesium.Cartesian3.fromDegreesArray(D);if(/^\[/.test(m.extrudedHeight)&&/\]$/.test(m.extrudedHeight)){var O=m.extrudedHeight.replace(/\[/,"").replace(/\]/,"");w.extrudedHeight=parseFloat(P.properties[O])}w.polygonHierarchy=new E._cesium.PolygonHierarchy(R);var F=new E._cesium.PolygonGeometry(w),k=new E._cesium.GeometryInstance({geometry:F,attributes:{color:E._cesium.ColorGeometryInstanceAttribute.fromColor(E._cesium.Color.fromCssColorString("#004FFF").withAlpha(.5)),show:new E._cesium.ShowGeometryInstanceAttribute(!0)}});M.push(k)});var I=new E._cesium.GroundPrimitive({classificationType:E._cesium.ClassificationType.BOTH,geometryInstances:M});return I},this.item=A._primitiveCollection,A.addTo(this._viewer),this._core.isnull(w.id)&&(w.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w.id);var T={id:w.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),typeof y=="function"&&y(this.item)};yg.prototype.getLegend=function(){var o=[];return this.Legend!=null&&(o=this._core.unique(this.Legend)),o};yg.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};var zT=yg;var E8={};E8.read=function(o,f,m,v,y){var x,C,w=y*8-v-1,A=(1<<w)-1,E=A>>1,T=-7,S=m?y-1:0,M=m?-1:1,I=o[f+S];for(S+=M,x=I&(1<<-T)-1,I>>=-T,T+=w;T>0;x=x*256+o[f+S],S+=M,T-=8);for(C=x&(1<<-T)-1,x>>=-T,T+=v;T>0;C=C*256+o[f+S],S+=M,T-=8);if(x===0)x=1-E;else{if(x===A)return C?NaN:(I?-1:1)*(1/0);C=C+Math.pow(2,v),x=x-E}return(I?-1:1)*C*Math.pow(2,x-v)};E8.write=function(o,f,m,v,y,x){var C,w,A,E=x*8-y-1,T=(1<<E)-1,S=T>>1,M=y===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=v?0:x-1,P=v?1:-1,D=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(w=isNaN(f)?1:0,C=T):(C=Math.floor(Math.log(f)/Math.LN2),f*(A=Math.pow(2,-C))<1&&(C--,A*=2),C+S>=1?f+=M/A:f+=M*Math.pow(2,1-S),f*A>=2&&(C++,A/=2),C+S>=T?(w=0,C=T):C+S>=1?(w=(f*A-1)*Math.pow(2,y),C=C+S):(w=f*Math.pow(2,S-1)*Math.pow(2,y),C=0));y>=8;o[m+I]=w&255,I+=P,w/=256,y-=8);for(C=C<<y|w,E+=y;E>0;o[m+I]=C&255,I+=P,C/=256,E-=8);o[m+I-P]|=D*128};function um(o){this.buf=ArrayBuffer.isView&&ArrayBuffer.isView(o)?o:new Uint8Array(o||0),this.pos=0,this.type=0,this.length=this.buf.length}um.Varint=0;um.Fixed64=1;um.Bytes=2;um.Fixed32=5;var ELe=(1<<16)*(1<<16),wct=1/ELe;um.prototype={destroy:function(){this.buf=null},readFields:function(o,f,m){for(m=m||this.length;this.pos<m;){var v=this.readVarint(),y=v>>3,x=this.pos;this.type=v&7,o(y,f,this),this.pos===x&&this.skip(v)}return f},readMessage:function(o,f){return this.readFields(o,f,this.readVarint()+this.pos)},readFixed32:function(){var o=ple(this.buf,this.pos);return this.pos+=4,o},readSFixed32:function(){var o=Ect(this.buf,this.pos);return this.pos+=4,o},readFixed64:function(){var o=ple(this.buf,this.pos)+ple(this.buf,this.pos+4)*ELe;return this.pos+=8,o},readSFixed64:function(){var o=ple(this.buf,this.pos)+Ect(this.buf,this.pos+4)*ELe;return this.pos+=8,o},readFloat:function(){var o=E8.read(this.buf,this.pos,!0,23,4);return this.pos+=4,o},readDouble:function(){var o=E8.read(this.buf,this.pos,!0,52,8);return this.pos+=8,o},readVarint:function(o){var f=this.buf,m,v;return v=f[this.pos++],m=v&127,v<128||(v=f[this.pos++],m|=(v&127)<<7,v<128)||(v=f[this.pos++],m|=(v&127)<<14,v<128)||(v=f[this.pos++],m|=(v&127)<<21,v<128)?m:(v=f[this.pos],m|=(v&15)<<28,UFi(m,o,this))},readVarint64:function(){return this.readVarint(!0)},readSVarint:function(){var o=this.readVarint();return o%2===1?(o+1)/-2:o/2},readBoolean:function(){return Boolean(this.readVarint())},readString:function(){var o=this.readVarint()+this.pos,f=t5i(this.buf,this.pos,o);return this.pos=o,f},readBytes:function(){var o=this.readVarint()+this.pos,f=this.buf.subarray(this.pos,o);return this.pos=o,f},readPackedVarint:function(o,f){var m=BD(this);for(o=o||[];this.pos<m;)o.push(this.readVarint(f));return o},readPackedSVarint:function(o){var f=BD(this);for(o=o||[];this.pos<f;)o.push(this.readSVarint());return o},readPackedBoolean:function(o){var f=BD(this);for(o=o||[];this.pos<f;)o.push(this.readBoolean());return o},readPackedFloat:function(o){var f=BD(this);for(o=o||[];this.pos<f;)o.push(this.readFloat());return o},readPackedDouble:function(o){var f=BD(this);for(o=o||[];this.pos<f;)o.push(this.readDouble());return o},readPackedFixed32:function(o){var f=BD(this);for(o=o||[];this.pos<f;)o.push(this.readFixed32());return o},readPackedSFixed32:function(o){var f=BD(this);for(o=o||[];this.pos<f;)o.push(this.readSFixed32());return o},readPackedFixed64:function(o){var f=BD(this);for(o=o||[];this.pos<f;)o.push(this.readFixed64());return o},readPackedSFixed64:function(o){var f=BD(this);for(o=o||[];this.pos<f;)o.push(this.readSFixed64());return o},skip:function(o){var f=o&7;if(f===um.Varint)for(;this.buf[this.pos++]>127;);else if(f===um.Bytes)this.pos=this.readVarint()+this.pos;else if(f===um.Fixed32)this.pos+=4;else if(f===um.Fixed64)this.pos+=8;else throw new Error("Unimplemented type: "+f)},writeTag:function(o,f){this.writeVarint(o<<3|f)},realloc:function(o){for(var f=this.length||16;f<this.pos+o;)f*=2;if(f!==this.length){var m=new Uint8Array(f);m.set(this.buf),this.buf=m,this.length=f}},finish:function(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)},writeFixed32:function(o){this.realloc(4),A8(this.buf,o,this.pos),this.pos+=4},writeSFixed32:function(o){this.realloc(4),A8(this.buf,o,this.pos),this.pos+=4},writeFixed64:function(o){this.realloc(8),A8(this.buf,o&-1,this.pos),A8(this.buf,Math.floor(o*wct),this.pos+4),this.pos+=8},writeSFixed64:function(o){this.realloc(8),A8(this.buf,o&-1,this.pos),A8(this.buf,Math.floor(o*wct),this.pos+4),this.pos+=8},writeVarint:function(o){if(o=+o||0,o>268435455||o<0){GFi(o,this);return}this.realloc(4),this.buf[this.pos++]=o&127|(o>127?128:0),!(o<=127)&&(this.buf[this.pos++]=(o>>>=7)&127|(o>127?128:0),!(o<=127)&&(this.buf[this.pos++]=(o>>>=7)&127|(o>127?128:0),!(o<=127)&&(this.buf[this.pos++]=o>>>7&127)))},writeSVarint:function(o){this.writeVarint(o<0?-o*2-1:o*2)},writeBoolean:function(o){this.writeVarint(Boolean(o))},writeString:function(o){o=String(o),this.realloc(o.length*4),this.pos++;var f=this.pos;this.pos=i5i(this.buf,o,this.pos);var m=this.pos-f;m>=128&&Act(f,m,this),this.pos=f-1,this.writeVarint(m),this.pos+=m},writeFloat:function(o){this.realloc(4),E8.write(this.buf,o,this.pos,!0,23,4),this.pos+=4},writeDouble:function(o){this.realloc(8),E8.write(this.buf,o,this.pos,!0,52,8),this.pos+=8},writeBytes:function(o){var f=o.length;this.writeVarint(f),this.realloc(f);for(var m=0;m<f;m++)this.buf[this.pos++]=o[m]},writeRawMessage:function(o,f){this.pos++;var m=this.pos;o(f,this);var v=this.pos-m;v>=128&&Act(m,v,this),this.pos=m-1,this.writeVarint(v),this.pos+=v},writeMessage:function(o,f,m){this.writeTag(o,um.Bytes),this.writeRawMessage(f,m)},writePackedVarint:function(o,f){this.writeMessage(o,YFi,f)},writePackedSVarint:function(o,f){this.writeMessage(o,qFi,f)},writePackedBoolean:function(o,f){this.writeMessage(o,KFi,f)},writePackedFloat:function(o,f){this.writeMessage(o,XFi,f)},writePackedDouble:function(o,f){this.writeMessage(o,JFi,f)},writePackedFixed32:function(o,f){this.writeMessage(o,QFi,f)},writePackedSFixed32:function(o,f){this.writeMessage(o,ZFi,f)},writePackedFixed64:function(o,f){this.writeMessage(o,$Fi,f)},writePackedSFixed64:function(o,f){this.writeMessage(o,e5i,f)},writeBytesField:function(o,f){this.writeTag(o,um.Bytes),this.writeBytes(f)},writeFixed32Field:function(o,f){this.writeTag(o,um.Fixed32),this.writeFixed32(f)},writeSFixed32Field:function(o,f){this.writeTag(o,um.Fixed32),this.writeSFixed32(f)},writeFixed64Field:function(o,f){this.writeTag(o,um.Fixed64),this.writeFixed64(f)},writeSFixed64Field:function(o,f){this.writeTag(o,um.Fixed64),this.writeSFixed64(f)},writeVarintField:function(o,f){this.writeTag(o,um.Varint),this.writeVarint(f)},writeSVarintField:function(o,f){this.writeTag(o,um.Varint),this.writeSVarint(f)},writeStringField:function(o,f){this.writeTag(o,um.Bytes),this.writeString(f)},writeFloatField:function(o,f){this.writeTag(o,um.Fixed32),this.writeFloat(f)},writeDoubleField:function(o,f){this.writeTag(o,um.Fixed64),this.writeDouble(f)},writeBooleanField:function(o,f){this.writeVarintField(o,Boolean(f))}};function UFi(o,f,m){var v=m.buf,y,x;if(x=v[m.pos++],y=(x&112)>>4,x<128||(x=v[m.pos++],y|=(x&127)<<3,x<128)||(x=v[m.pos++],y|=(x&127)<<10,x<128)||(x=v[m.pos++],y|=(x&127)<<17,x<128)||(x=v[m.pos++],y|=(x&127)<<24,x<128)||(x=v[m.pos++],y|=(x&1)<<31,x<128))return w8(o,y,f);throw new Error("Expected varint not more than 10 bytes")}function BD(o){return o.type===um.Bytes?o.readVarint()+o.pos:o.pos+1}function w8(o,f,m){return m?f*4294967296+(o>>>0):(f>>>0)*4294967296+(o>>>0)}function GFi(o,f){var m,v;if(o>=0?(m=o%4294967296|0,v=o/4294967296|0):(m=~(-o%4294967296),v=~(-o/4294967296),m^4294967295?m=m+1|0:(m=0,v=v+1|0)),o>=18446744073709552e3||o<-18446744073709552e3)throw new Error("Given varint doesn't fit into 10 bytes");f.realloc(10),WFi(m,v,f),jFi(v,f)}function WFi(o,f,m){m.buf[m.pos++]=o&127|128,o>>>=7,m.buf[m.pos++]=o&127|128,o>>>=7,m.buf[m.pos++]=o&127|128,o>>>=7,m.buf[m.pos++]=o&127|128,o>>>=7,m.buf[m.pos]=o&127}function jFi(o,f){var m=(o&7)<<4;f.buf[f.pos++]|=m|((o>>>=3)?128:0),o&&(f.buf[f.pos++]=o&127|((o>>>=7)?128:0),o&&(f.buf[f.pos++]=o&127|((o>>>=7)?128:0),o&&(f.buf[f.pos++]=o&127|((o>>>=7)?128:0),o&&(f.buf[f.pos++]=o&127|((o>>>=7)?128:0),o&&(f.buf[f.pos++]=o&127)))))}function Act(o,f,m){var v=f<=16383?1:f<=2097151?2:f<=268435455?3:Math.ceil(Math.log(f)/(Math.LN2*7));m.realloc(v);for(var y=m.pos-1;y>=o;y--)m.buf[y+v]=m.buf[y]}function YFi(o,f){for(var m=0;m<o.length;m++)f.writeVarint(o[m])}function qFi(o,f){for(var m=0;m<o.length;m++)f.writeSVarint(o[m])}function XFi(o,f){for(var m=0;m<o.length;m++)f.writeFloat(o[m])}function JFi(o,f){for(var m=0;m<o.length;m++)f.writeDouble(o[m])}function KFi(o,f){for(var m=0;m<o.length;m++)f.writeBoolean(o[m])}function QFi(o,f){for(var m=0;m<o.length;m++)f.writeFixed32(o[m])}function ZFi(o,f){for(var m=0;m<o.length;m++)f.writeSFixed32(o[m])}function $Fi(o,f){for(var m=0;m<o.length;m++)f.writeFixed64(o[m])}function e5i(o,f){for(var m=0;m<o.length;m++)f.writeSFixed64(o[m])}function ple(o,f){return(o[f]|o[f+1]<<8|o[f+2]<<16)+o[f+3]*16777216}function A8(o,f,m){o[m]=f,o[m+1]=f>>>8,o[m+2]=f>>>16,o[m+3]=f>>>24}function Ect(o,f){return(o[f]|o[f+1]<<8|o[f+2]<<16)+(o[f+3]<<24)}function t5i(o,f,m){for(var v="",y=f;y<m;){var x=o[y],C=null,w=x>239?4:x>223?3:x>191?2:1;if(y+w>m)break;var A,E,T;w===1?x<128&&(C=x):w===2?(A=o[y+1],(A&192)===128&&(C=(x&31)<<6|A&63,C<=127&&(C=null))):w===3?(A=o[y+1],E=o[y+2],(A&192)===128&&(E&192)===128&&(C=(x&15)<<12|(A&63)<<6|E&63,(C<=2047||C>=55296&&C<=57343)&&(C=null))):w===4&&(A=o[y+1],E=o[y+2],T=o[y+3],(A&192)===128&&(E&192)===128&&(T&192)===128&&(C=(x&15)<<18|(A&63)<<12|(E&63)<<6|T&63,(C<=65535||C>=1114112)&&(C=null))),C===null?(C=65533,w=1):C>65535&&(C-=65536,v+=String.fromCharCode(C>>>10&1023|55296),C=56320|C&1023),v+=String.fromCharCode(C),y+=w}return v}function i5i(o,f,m){for(var v=0,y,x;v<f.length;v++){if(y=f.charCodeAt(v),y>55295&&y<57344)if(x)if(y<56320){o[m++]=239,o[m++]=191,o[m++]=189,x=y;continue}else y=x-55296<<10|y-56320|65536,x=null;else{y>56319||v+1===f.length?(o[m++]=239,o[m++]=191,o[m++]=189):x=y;continue}else x&&(o[m++]=239,o[m++]=191,o[m++]=189,x=null);y<128?o[m++]=y:(y<2048?o[m++]=y>>6|192:(y<65536?o[m++]=y>>12|224:(o[m++]=y>>18|240,o[m++]=y>>12&63|128),o[m++]=y>>6&63|128),o[m++]=y&63|128)}return m}var TLe=um;function T8(o,f){this.x=o,this.y=f}T8.prototype={clone:function(){return new T8(this.x,this.y)},add:function(o){return this.clone()._add(o)},sub:function(o){return this.clone()._sub(o)},multByPoint:function(o){return this.clone()._multByPoint(o)},divByPoint:function(o){return this.clone()._divByPoint(o)},mult:function(o){return this.clone()._mult(o)},div:function(o){return this.clone()._div(o)},rotate:function(o){return this.clone()._rotate(o)},rotateAround:function(o,f){return this.clone()._rotateAround(o,f)},matMult:function(o){return this.clone()._matMult(o)},unit:function(){return this.clone()._unit()},perp:function(){return this.clone()._perp()},round:function(){return this.clone()._round()},mag:function(){return Math.sqrt(this.x*this.x+this.y*this.y)},equals:function(o){return this.x===o.x&&this.y===o.y},dist:function(o){return Math.sqrt(this.distSqr(o))},distSqr:function(o){var f=o.x-this.x,m=o.y-this.y;return f*f+m*m},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(o){return Math.atan2(this.y-o.y,this.x-o.x)},angleWith:function(o){return this.angleWithSep(o.x,o.y)},angleWithSep:function(o,f){return Math.atan2(this.x*f-this.y*o,this.x*o+this.y*f)},_matMult:function(o){var f=o[0]*this.x+o[1]*this.y,m=o[2]*this.x+o[3]*this.y;return this.x=f,this.y=m,this},_add:function(o){return this.x+=o.x,this.y+=o.y,this},_sub:function(o){return this.x-=o.x,this.y-=o.y,this},_mult:function(o){return this.x*=o,this.y*=o,this},_div:function(o){return this.x/=o,this.y/=o,this},_multByPoint:function(o){return this.x*=o.x,this.y*=o.y,this},_divByPoint:function(o){return this.x/=o.x,this.y/=o.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var o=this.y;return this.y=this.x,this.x=-o,this},_rotate:function(o){var f=Math.cos(o),m=Math.sin(o),v=f*this.x-m*this.y,y=m*this.x+f*this.y;return this.x=v,this.y=y,this},_rotateAround:function(o,f){var m=Math.cos(o),v=Math.sin(o),y=f.x+m*(this.x-f.x)-v*(this.y-f.y),x=f.y+v*(this.x-f.x)+m*(this.y-f.y);return this.x=y,this.y=x,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}};T8.convert=function(o){return o instanceof T8?o:Array.isArray(o)?new T8(o[0],o[1]):o};function S8(o,f,m,v,y){this.properties={},this.extent=m,this.type=0,this._pbf=o,this._geometry=-1,this._keys=v,this._values=y,o.readFields(r5i,this,f)}function r5i(o,f,m){o==1?f.id=m.readVarint():o==2?n5i(m,f):o==3?f.type=m.readVarint():o==4&&(f._geometry=m.pos)}function n5i(o,f){for(var m=o.readVarint()+o.pos;o.pos<m;){var v=f._keys[o.readVarint()],y=f._values[o.readVarint()];f.properties[v]=y}}S8.types=["Unknown","Point","LineString","Polygon"];S8.prototype.loadGeometry=function(){var o=this._pbf;o.pos=this._geometry;for(var f=o.readVarint()+o.pos,m=1,v=0,y=0,x=0,C=[],w;o.pos<f;){if(v<=0){var A=o.readVarint();m=A&7,v=A>>3}if(v--,m===1||m===2)y+=o.readSVarint(),x+=o.readSVarint(),m===1&&(w&&C.push(w),w=[]),w.push(new T8(y,x));else if(m===7)w&&w.push(w[0].clone());else throw new Error("unknown command "+m)}return w&&C.push(w),C};S8.prototype.bbox=function(){var o=this._pbf;o.pos=this._geometry;for(var f=o.readVarint()+o.pos,m=1,v=0,y=0,x=0,C=1/0,w=-1/0,A=1/0,E=-1/0;o.pos<f;){if(v<=0){var T=o.readVarint();m=T&7,v=T>>3}if(v--,m===1||m===2)y+=o.readSVarint(),x+=o.readSVarint(),y<C&&(C=y),y>w&&(w=y),x<A&&(A=x),x>E&&(E=x);else if(m!==7)throw new Error("unknown command "+m)}return[C,A,w,E]};S8.prototype.toGeoJSON=function(o,f,m,v){var y=this.extent*Math.pow(2,m),x=this.extent*o,C=this.extent*f/2,w=this.loadGeometry(),A=S8.types[this.type],E,T;function S(P){for(var D=0;D<P.length;D++){var L=P[D],R=90-(L.y+C)*180/(y/2);P[D]=[(L.x+x)*360/y-180,R]}}switch(this.type){case 1:var M=[];for(E=0;E<w.length;E++)M[E]=w[E][0];w=M,S(w);break;case 2:for(E=0;E<w.length;E++)S(w[E]);break;case 3:for(w=o5i(w),E=0;E<w.length;E++)for(T=0;T<w[E].length;T++)S(w[E][T]);break}w.length===1?w=w[0]:A="Multi"+A;var I={type:"Feature",geometry:{type:A,coordinates:w},properties:this.properties};return"id"in this&&(I.id=this.id),I};function o5i(o){var f=o.length;if(f<=1)return[o];for(var m=[],v,y,x=0;x<f;x++){var C=a5i(o[x]);C!==0&&(y===void 0&&(y=C<0),y===C<0?(v&&m.push(v),v=[o[x]]):v.push(o[x]))}return v&&m.push(v),m}function a5i(o){for(var f=0,m=0,v=o.length,y=v-1,x,C;m<v;y=m++)x=o[m],C=o[y],f+=(C.x-x.x)*(x.y+C.y);return f}function Tct(o,f){this.version=1,this.name=null,this.extent=4096,this.length=0,this._pbf=o,this._keys=[],this._values=[],this._features=[],o.readFields(s5i,this,f),this.length=this._features.length}function s5i(o,f,m){o===15?f.version=m.readVarint():o===1?f.name=m.readString():o===5?f.extent=m.readVarint():o===2?f._features.push(m.pos):o===3?f._keys.push(m.readString()):o===4&&f._values.push(l5i(m))}function l5i(o){for(var f=null,m=o.readVarint()+o.pos;o.pos<m;){var v=o.readVarint()>>3;f=v===1?o.readString():v===2?o.readFloat():v===3?o.readDouble():v===4?o.readVarint64():v===5?o.readVarint():v===6?o.readSVarint():v===7?o.readBoolean():null}return f}Tct.prototype.feature=function(o){if(o<0||o>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[o];var f=this._pbf.readVarint()+this._pbf.pos;return new S8(this._pbf,f,this.extent,this._keys,this._values)};function u5i(o,f){this.layers=o.readFields(c5i,{},f)}function c5i(o,f,m){if(o===3){var v=new Tct(m,m.readVarint()+m.pos);v.length&&(f[v.name]=v)}}var SLe=u5i;function xA(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.labelCollections=new this._cesium.PointPrimitiveCollection,this.geometries_line=[],this.geometries_polygon=[]}var h5i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};xA.prototype._serialize=function(o){var f=[],m=window.encodeURIComponent;for(var v in o){var y=o[v];(typeof y>"u"?"undefined":h5i(y))==="object"?f.push(m(v)+"="+m(JSON.stringify(y))):f.push(m(v)+"="+m(o[v]))}return f.join("&")};xA.prototype.createVolumeVectorGeoJsonFeatureLayer=function(o,f,m,v,y){var x={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};this.extent={XMin:f.minx||0,YMin:f.miny||0,XMax:f.maxx||0,YMax:f.maxy||0},!this._core.isnull(m)&&!this._core.isnull(m.fill)&&(m.fill.toString().charAt(0)=="["&&m.fill.toString().charAt(m.fill.length-1)=="]"||(this._core.isHtmlColor(m.fill)?m.fill=this._color.colorFromHtmlColor(m.fill):(/^rgb/.test(m.fill)&&(m.fill=this._color.rgbaStringToRgbaObj(m.fill)),m.fill.r>1&&(m.fill.r=m.fill.r/255),m.fill.g>1&&(m.fill.g=m.fill.g/255),m.fill.b>1&&(m.fill.b=m.fill.b/255),m.fill.a>1&&(m.fill.a=m.fill.a/255),m.fill=this._color.createColor(m.fill.r,m.fill.g,m.fill.b,m.fill.a)))),!this._core.isnull(m)&&!this._core.isnull(m.polylinefill)&&(m.polylinefill.toString().charAt(0)=="["&&m.polylinefill.toString().charAt(m.polylinefill.length-1)=="]"||(this._core.isHtmlColor(m.polylinefill)?m.polylinefill=this._color.colorFromHtmlColor(m.polylinefill):(/^rgb/.test(m.polylinefill)&&(m.polylinefill=this._color.rgbaStringToRgbaObj(m.polylinefill)),m.polylinefill.r>1&&(m.polylinefill.r=m.polylinefill.r/255),m.polylinefill.g>1&&(m.polylinefill.g=m.polylinefill.g/255),m.polylinefill.b>1&&(m.polylinefill.b=m.polylinefill.b/255),m.polylinefill.a>1&&(m.polylinefill.a=m.polylinefill.a/255),m.polylinefill=this._color.createColor(m.polylinefill.r,m.polylinefill.g,m.polylinefill.b,m.polylinefill.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),this._option=this._core.extend(x,m,!0),f==null&&console.log("url is required"),o==null&&console.log("layername is required");var w=this,A={polygonHierarchy:void 0,height:30,extrudedHeight:100,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.WHITE},E="http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/resources/styles/root.json";w._core.xhr({url:E,type:"get",dataType:"json",success:function(T){var S=[],M=T.layers,I="http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf";Cesium.Resource.createIfNeeded(I).fetchArrayBuffer().then(function(P){function D(pe){for(var ce=0;ce<pe.length;ce++)Array.isArray(pe[ce])?D(pe[ce]):S.push(pe[ce])}function L(pe){var ce=Cesium.Cartesian3.fromDegreesArray(pe),he={positions:ce,width:10,color:Cesium.ColorGeometryInstanceAttribute.fromColor(w._option.polylinefill)},Ce=new Cesium.PolylineGeometry(he),Se=new Cesium.GeometryInstance({geometry:Ce});U.push(Se)}function R(pe){var ce=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(pe))}),he=Cesium.PolygonGeometry.createGeometry(ce),Ce=new Cesium.GeometryInstance({geometry:he,attributes:{color:ve}});G.push(Ce)}var O=new TLe(P),F=0,k=new SLe(O),U=[],G=[];w.labelCollections=new w._cesium.LabelCollection;for(var j in k.layers)for(var q=k.layers[j],J=0;J<q.length;J++)for(var X=q.feature(J),Y=X.loadGeometry(),Q=0;Q<Y.length;Q++)for(var ee=Y[Q],z=0;z<ee.length;z++){var ie=ee[z],re=null;if(X.properties._symbol!=null)for(var ne=X.properties._symbol,oe=0;oe<M.length;oe++)M[oe].filter!=null&&M[oe].filter[0]=="=="&&M[oe].filter[1]=="_symbol"&&M[oe].filter[2]==ne&&(re=M[oe]);else if(q.name!=null)for(var se=q.name,oe=0;oe<M.length;oe++)M[oe]["source-layer"]!=null&&M[oe]["source-layer"]==se&&(re=M[oe]);if(X.type==1)try{var ae=X.toGeoJSON(0,0,0,w.extent);if(m.text!=null&&/^\[/.test(m.text)&&/\]$/.test(m.text)){var fe=m.text.replace(/\[/,"").replace(/\]/,"");w._option.text=X.properties[fe]}re.paint!=null&&re.paint["icon-color"]&&(w._option.fill=w._color.createColorTransformation(re.paint["icon-color"])),w._option.position=new w._cesium.Cartesian3.fromDegrees(ae.geometry.coordinates[0],ae.geometry.coordinates[1],w._option.height);var de={};ae.geometry.type=="point"?de={id:ae,color:w._option.fill,position:w._option.position}:de=w._option,w.labelCollections.add(de)}catch{}if(X.type==2){var ie=ee[0],ae=X.toGeoJSON(0,0,0,w.extent);if(!w._core.isnull(m.polylinefill)&&re.paint!=null&&re.paint["icon-color"]&&(w._option.polylinefill=w._color.createColorTransformation(re.paint["icon-color"])),Array.isArray(ae.geometry.coordinates)&&ae.geometry.coordinates.length>0)if(Array.isArray(ae.geometry.coordinates[0][0]))for(var Q=0;Q<ae.geometry.coordinates.length;Q++)S=[],D(ae.geometry.coordinates[Q]),L(S);else D(ae.geometry.coordinates),L(S)}if(X.type==3)try{var ie=ee[0],ae=X.toGeoJSON(0,0,0,w.extent),ve=Cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.AQUA);if(re.paint["fill-color"]!=null&&(ve=Cesium.ColorGeometryInstanceAttribute.fromColor(w._color.createColorTransformation(re.paint["fill-color"]))),Array.isArray(ae.geometry.coordinates)&&ae.geometry.coordinates.length>0)if(Array.isArray(ae.geometry.coordinates[0][0]))for(var Q=0;Q<ae.geometry.coordinates.length;Q++)S=[],D(ae.geometry.coordinates[Q]),R(S);else D(ae.geometry.coordinates),R(S)}catch{}}w.labelCollections.length>0&&w._viewer.scene.primitives.add(w.labelCollections),U.length>0&&w._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:U,appearance:new Cesium.PolylineColorAppearance})),G.length>0&&w._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:G,appearance:new w._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED}))})}})};xA.prototype.createVolumeVectorGeoJsonFeatureLayers=function(o,f,m,v,y){var x={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};this.extent={XMin:f.minx||0,YMin:f.miny||0,XMax:f.maxx||0,YMax:f.maxy||0},!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(x,m,!0),f==null&&console.log("url is required"),o==null&&console.log("layername is required");var w=[],A={polygonHierarchy:void 0,height:0,extrudedHeight:100,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.WHITE},E=this;this._urlTemplate=f.url+"?"+this._serialize(C.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=styleOption.level_max-1,this._Provider.loadTile=function(M,I){if(this.tile=I,I.state===Cesium.QuadtreeTileLoadState.START&&E.item.show)if(I.data={lines:[],geometryPrimitive:void 0},I.level>=m.level_min&&I.level<m.level_max){var P=Ji.filter(w,function(D){return D.x==I.x&&D.y==I.y&&D.level==I.level});if(P.length!=0&&P[0].data&&P[0].data.length>0){I.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:P[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),I.state=Cesium.QuadtreeTileLoadState.LOADING,I.state===Cesium.QuadtreeTileLoadState.LOADING&&(I.data.geometryPrimitive&&I.data.geometryPrimitive.update(M,[]),I.state=Cesium.QuadtreeTileLoadState.DONE,I.renderable=!0);return}(function(D){var L="http://124.128.48.210:81/arcgis/rest/services/Hosted/tdtsd0408/VectorTileServer/tile/0/0/0.pbf";Cesium.Resource.createIfNeeded(L).fetchArrayBuffer().then(function(R){var O=new TLe(R),F=new SLe(O);E.labelCollections=new E._cesium.PointPrimitiveCollection;var k=[],U=[];for(var G in F.layers)for(var j=F.layers[G],q=0;q<j.length;q++)for(var J=j.feature(q),X=J.loadGeometry(),Y=0;Y<X.length;Y++)for(var Q=X[Y],ee=0;ee<Q.length;ee++){var z=Q[ee];if(J.type==1)try{var ie=J.toGeoJSON(0,0,0,E.extent);if(E._option.text!=null&&/^\[/.test(E._option.text)&&/\]$/.test(E._option.text)){var re=E._option.text.replace(/\[/,"").replace(/\]/,"");A.text=J.properties[re]}A.position=new E._cesium.Cartesian3.fromDegrees(ie.geometry.coordinates[0],ie.geometry.coordinates[1],A.height);var ne={};ie.geometry.type=="point"?ne={id:ie,color:A.material,position:A.position}:ne=A,E.labelCollections.add(ne)}catch{}if(J.type==2)for(var z=Q[0],ie=J.toGeoJSON(D.x,D.y,D.level,E.extent),ee=0;ee<ie.geometry.coordinates.length;ee++)try{var oe=[];ie.geometry.coordinates[ee].forEach(function(he){oe.push(he[0],he[1])});var se=new Cesium.PolylineGeometry({positions:Cesium.Cartesian3.fromDegreesArray(oe),width:10}),ae=Cesium.PolylineGeometry.createGeometry(se),fe=new Cesium.GeometryInstance({geometry:ae});k.push(fe)}catch{}if(J.type==3)for(var z=Q[0],ie=J.toGeoJSON(D.x,D.y,D.level,E.extent),ee=0;ee<ie.geometry.coordinates.length;ee++)try{var oe=[];ie.geometry.coordinates[ee].forEach(function(De){oe.push(De[0],De[1])});var de=new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(Cesium.Cartesian3.fromDegreesArray(oe))}),ae=Cesium.PolygonGeometry.createGeometry(de),fe=new Cesium.GeometryInstance({geometry:ae});U.push(fe)}catch{}}E.labelCollections.length>0&&E._viewer.scene.primitives.add(E.labelCollections),k.length>0&&E._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:k,appearance:new E._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED})),U.length>0&&E._viewer.scene.primitives.add(new Cesium.Primitive({geometryInstances:U,appearance:new E._cesium.MaterialAppearance({material:new Cesium.Material({fabric:{type:"Color",uniforms:{color:Cesium.Color.fromRandom({alpha:1})}}}),faceForward:!0,flat:!1}),shadows:Cesium.ShadowMode.ENABLED}))})})(I)}else{I.state=Cesium.QuadtreeTileLoadState.LOADING,I.state===Cesium.QuadtreeTileLoadState.LOADING&&(I.data.geometryPrimitive&&(I.data.geometryPrimitive.update(M,[]),I._parent&&I._parent.data&&I._parent.data.geometryPrimitive&&(I._parent.data.geometryPrimitive.destroy(),I._parent.data.geometryPrimitive=null,I._parent.state=Cesium.QuadtreeTileLoadState.START),I._southwestChild&&I._southwestChild.data&&I._southwestChild.data.geometryPrimitive&&(I._southwestChild.data.geometryPrimitive.destroy(),I._southwestChild.data.geometryPrimitive=null,I._southwestChild.state=Cesium.QuadtreeTileLoadState.START),I._southeastChild&&I._southeastChild.data&&I._southeastChild.data.geometryPrimitive&&(I._southeastChild.data.geometryPrimitive.destroy(),I._southeastChild.data.geometryPrimitive=null,I._southeastChild.state=Cesium.QuadtreeTileLoadState.START),I._northwestChild&&I._northwestChild.data&&I._northwestChild.data.geometryPrimitive&&(I._northwestChild.data.geometryPrimitive.destroy(),I._northwestChild.data.geometryPrimitive=null,I._northwestChild.state=Cesium.QuadtreeTileLoadState.START),I._northeastChild&&I._northeastChild.data&&I._northeastChild.data.geometryPrimitive&&(I._northeastChild.data.geometryPrimitive.destroy(),I._northeastChild.data.geometryPrimitive=null,I._northeastChild.state=Cesium.QuadtreeTileLoadState.START)),I.state=Cesium.QuadtreeTileLoadState.DONE,I.renderable=!0);return}},this._primitive=new E._cesium.QuadtreePrimitive({tileProvider:this._Provider});var T=this._viewer.scene,S=T.primitives;S.add(this._primitive)};xA.prototype.createVolumeGeoJsonFeatureLayer=function(o,f,m,v,y){var x={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};f==null&&console.log("geojson is required");var C=null;f.then?C=f:C=this._cesium.GeoJsonDataSource.load(f);var w=this,A=[];x.shapePositions=this.computeCircle(m.radius),C.then(function(T){var S=w._cesium.Color.WHITE;!w._core.isnull(m)&&!w._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"?S=m.material.replace(/\[/,"").replace("/]/",""):S=Ji.clone(m.material),w._core.isHtmlColor(S)?S=w._color.colorFromHtmlColor(m.material):(/^rgb/.test(S)&&(S=w._color.rgbaStringToRgbaObj(S)),S.r>1&&(S.r=S.r/255),S.g>1&&(S.g=S.g/255),S.b>1&&(S.b=S.b/255),S.a>1&&(S.a=S.a/255),S=w._color.createColor(S.r,S.g,S.b,S.a)));for(var M=T.entities.values,I=0;I<M.length;I++){var P=M[I];x.polylinePositions=P.polyline.positions._value;var D=new w._cesium.PolylineVolumeGeometry(x),L=w._cesium.PolylineVolumeGeometry.createGeometry(D),R=new w._cesium.GeometryInstance({geometry:L});A.push(R)}var O=w._viewer.scene.primitives.add(new w._cesium.Primitive({geometryInstances:A,appearance:new w._cesium.MaterialAppearance({material:new w._cesium.Material({fabric:{type:"Color",uniforms:{color:S}}}),faceForward:!0,flat:!1})}));w.item=O,m.show==!1&&(O.show=!1),typeof y=="function"&&y(O)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u7BA1\u72B6\u56FE\u5C42"+m.id);var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:m};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};xA.prototype.computeCircle=function(o){this._core.isnull(o)&&(o=4);for(var f=[],m=0;m<360;m++){var v=this._cesium.Math.toRadians(m);f.push(new this._cesium.Cartesian2(o*Math.cos(v),o*Math.sin(v)))}return f};xA.prototype.createVolumeGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(C,m,!0),E=new Ah(this._viewer,this._cesium,w);this._Provider=E;var T=this;E._loadTile=function(M){var I=[],P=new T._cesium.PrimitiveCollection;return M.features.forEach(function(D){var L=[];function R(ne){for(var oe=0;oe<ne.length;oe++)Array.isArray(ne[oe])?R(ne[oe]):L.push(ne[oe])}var O=[];if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var F=m.material.replace(/\[/,"").replace(/\]/,"");A.material=D.properties[F],that._core.isHtmlColor(A.material)?A.material=that._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=that._color.rgbaStringToRgbaObj(A.material)),A.material.r>1&&(A.material.r=A.material.r/255),A.material.g>1&&(A.material.g=A.material.g/255),A.material.b>1&&(A.material.b=A.material.b/255),A.material.a>1&&(A.material.a=A.material.a/255),A.material=that._color.createColor(A.material.r,A.material.g,A.material.b,A.material.a))}for(var k=0;k<D.geometry.coordinates.length;k++){var U=D.geometry.coordinates[k];if(U.length>0)if(Array.isArray(U[0]))for(var G=0;G<U.length;G++){var j=U[G],q=T._cesium.Cartesian3.fromDegrees(j[0],j[1],A.height);O.push(q)}else{var J=T._cesium.Cartesian3.fromDegrees(U[0],U[1],A.height);O.push(J)}}if(A.position=O,A.slttype=="0"||A.slttype==0)A.shape=T._core.computeCircle(A.radius);else if(A.slttype=="1"||A.slttype==1)A.shape=T._core.starPositions(A.number,A.exradius,A.inradius);else if(A.slttype=="2"||A.slttype==2){var X=A.orth_width/2,Y=A.orth_height/2;A.shape=[new T._cesium.Cartesian2(-X,-Y),new T._cesium.Cartesian2(X,-Y),new T._cesium.Cartesian2(X,Y),new T._cesium.Cartesian2(-X,Y)]}D.positions=O;var Q={polylinePositions:A.position,shapePositions:A.shape,cornerType:A.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},ee=new T._cesium.PolylineVolumeGeometry(Q),z=T._cesium.PolylineVolumeGeometry.createGeometry(ee),ie=new T._cesium.GeometryInstance({id:D,geometry:z,attributes:{color:new T._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}}),re=new T._cesium.Primitive({allowPicking:!0,appearance:new T._cesium.MaterialAppearance({material:new T._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}}),faceForward:!0,flat:!1}),shadows:A.shadows,geometryInstances:ie});P.add(re)}),P},this.item=E._primitiveCollection,E.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:A.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:f.url,style:m};this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item)};xA.prototype.setTreeobj=function(o){this.treeobj=o};xA.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};xA.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch{}};xA.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(o)}catch{}};xA.prototype.setVisibility=function(o){this.item.show=o,this._Provider&&this._Provider.setStatus(o)};var mle=xA;function CA(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this._VectorTileProvider=new ol(this._viewer,this._cesium),this._primitive=void 0,this._Provider=void 0,this.Legend=[]}CA.prototype.createWallGeoFeatureLayer=function(o,f,m,v,y,x,C){var w={positions:[],minimumHeights:[],maximumHeights:[],granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(w,m,!0);this._core.isnull(v)&&(v=16),this._core.isnull(y)&&(y=14),f==null&&console.log("url is required"),o==null&&console.log("layername is required");var E=this,T=[];this._VectorTileProvider.loadTile=function(I,P){if(this.tile=P,P.state===E._cesium.QuadtreeTileLoadState.START)if(P.data={lines:[],geometryPrimitive:void 0},P.level>=y&&P.level<v){var D=Ji.filter(T,function(L){return L.x==P.x&&L.y==P.y&&L.level==P.level});if(D.length!=0&&D[0].data&&D[0].data.length>0){P.data.geometryPrimitive=new E._cesium.Primitive({geometryInstances:D[0].data,appearance:new E._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:E._cesium.ShadowMode.ENABLED}),P.state=E._cesium.QuadtreeTileLoadState.LOADING,P.state===E._cesium.QuadtreeTileLoadState.LOADING&&(P.data.geometryPrimitive&&P.data.geometryPrimitive.update(I,[]),P.state=E._cesium.QuadtreeTileLoadState.DONE,P.renderable=!0);return}T.push({level:P.level,x:P.x,y:P.y,data:void 0}),function(L){E._core.xhr({url:f+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+o+"&STYLE=&TILEMATRIX=EPSG:4490:"+L.level+"&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL="+L.x+"&TILEROW="+L.y,type:"get",dataType:"json",success:function(R){var O=[];function F(J){for(var X=0;X<J.length;X++)Array.isArray(J[X])?F(J[X]):U.push(J[X])}for(var k=0;k<R.features.length;k++){var U=[];F(R.features[k].geometry.coordinates[0]);var G=E._cesium.Cartesian3.fromDegreesArray(U);A.positions=G;var j=new E._cesium.GeometryInstance({geometry:new E._cesium.WallGeometry({positions:A.positions}),attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}});O.push(j)}var q=Ji.filter(T,function(J){return J.x==L.x&&J.y==L.y});q[0].data=O,L.data.geometryPrimitive=new E._cesium.Primitive({geometryInstances:O,appearance:new E._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:E._cesium.ShadowMode.ENABLED})},error:function(){T=Ji.remove(T,function(R){return R.x==L.x&&R.y==L.y&&R.level==L.level})},complete:function(){L.state=E._cesium.QuadtreeTileLoadState.LOADING,L.state===E._cesium.QuadtreeTileLoadState.LOADING&&(L.data.geometryPrimitive&&L.data.geometryPrimitive.update(I,[]),L.state=E._cesium.QuadtreeTileLoadState.DONE,L.renderable=!0)}})}(P)}else P.state=E._cesium.QuadtreeTileLoadState.LOADING,P.state===E._cesium.QuadtreeTileLoadState.LOADING&&(P.data.geometryPrimitive&&P.data.geometryPrimitive.update(I,[]),P.state=E._cesium.QuadtreeTileLoadState.DONE,P.renderable=!0)},this._primitive=new E._cesium.QuadtreePrimitive({tileProvider:this._VectorTileProvider});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive)};CA.prototype.createWallPrimitiveGeoFeatureLayer=function(o,f,m,v,y,x){var C={positions:void 0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,maximumHeights:0,minimumHeights:0,vertexFormat:this._cesium.VertexFormat.DEFAULT};f==null&&console.log("geojson is required");var w=null;f.then?w=f:w=this._cesium.GeoJsonDataSource.load(f);var A=this,E=[];w.then(function(S){for(var M=S.entities.values,I=0;I<M.length;I++){var P=M[I];C.positions=P.polyline.positions._value;var D=new Array(C.positions.length),L=new Array(C.positions.length),R=void 0,O=void 0;/^\[/.test(m.minimumHeights)?(R=m.minimumHeights.replace(/\[/,"").replace("/]/",""),R=P.properties[R]._value):R=m.minimumHeights,/^\[/.test(m.maximumHeights)?(O=m.maximumHeights.replace(/\[/,"").replace("/]/",""),O=P.properties[O]._value):O=m.maximumHeights,D.fill(R),L.fill(O),C.minimumHeights=D,C.maximumHeights=L;var F=A._cesium.Color.WHITE;!A._core.isnull(m)&&!A._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"?F=m.material.replace(/\[/,"").replace("/]/",""):F=Ji.clone(m.material),A._core.isHtmlColor(F)?F=A._color.colorFromHtmlColor(m.material):(/^rgb/.test(F)&&(F=A._color.rgbaStringToRgbaObj(F)),F.r>1&&(F.r=F.r/255),F.g>1&&(F.g=F.g/255),F.b>1&&(F.b=F.b/255),F.a>1&&(F.a=F.a/255),F=A._color.createColor(F.r,F.g,F.b,F.a)));var k="material:"+F.red*255+","+F.green*255+","+F.blue*255;A.Legend.push(k);var U=new A._cesium.GeometryInstance({id:P,geometry:new A._cesium.WallGeometry(C),attributes:{color:new A._cesium.ColorGeometryInstanceAttribute.fromColor(F)}});E.push(U)}var G;m&&m.time&&(G=new A._cesium.TimeIntervalCollection([new A._cesium.TimeInterval({start:m.time.start?A._cesium.JulianDate.fromDate(new Date(m.time.start)):A._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?A._cesium.JulianDate.fromDate(new Date(m.time.end)):A._cesium.Iso8601.MAXIMUM_VALUE})]));var j=A._viewer.scene.primitives.add(new A._cesium.Primitive({geometryInstances:E,appearance:new A._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0})}),G);A.item=j,y||_this.setVisibility(!1),typeof x=="function"&&x(j)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u5899\u56FE\u5C42"+options.id);var T={id:m.id,name:o,pId:this._core.isnull(v)?0:v,type:"polylineWallLayer",item:this,url:f,style:options};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};CA.prototype.createWallGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={positions:void 0,granularity:this._cesium.Math.RADIANS_PER_DEGREE,maximumHeights:0,minimumHeights:0,vertexFormat:this._cesium.VertexFormat.DEFAULT},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=new Ah(this._viewer,this._cesium,w);this._Provider=A;var E=this;A._loadTile=function(S){var M=[];E.Legend=[];var I=new E._cesium.PrimitiveCollection;return S.features.forEach(function(P){var D=[],L=!1;function R(k){for(var U=0;U<k.length;U++)Array.isArray(k[U])?R(k[U]):(D.push(k[U]),U===2&&!L&&(L=!0))}if(Array.isArray(P.geometry.coordinates)&&P.geometry.coordinates.length>0)if(Array.isArray(P.geometry.coordinates[0][0]))for(var O=0;O<P.geometry.coordinates.length;O++)D=[],R(P.geometry.coordinates[O]),F(D);else R(P.geometry.coordinates),F(D);function F(k){if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var U=m.material.replace(/\[/,"").replace(/\]/,"");options.material=P.properties[U],E._core.isHtmlColor(options.material)?options.material=E._color.colorFromHtmlColor(options.material):(/^rgb/.test(options.material)&&(options.material=E._color.rgbaStringToRgbaObj(options.material)),options.material.r>1&&(options.material.r=options.material.r/255),options.material.g>1&&(options.material.g=options.material.g/255),options.material.b>1&&(options.material.b=options.material.b/255),options.material.a>1&&(options.material.a=options.material.a/255),options.material=E._color.createColor(options.material.r,options.material.g,options.material.b,options.material.a))}var G=L?E._cesium.Cartesian3.fromDegreesArrayHeights(k):E._cesium.Cartesian3.fromDegreesArray(k);C.positions=G,P.positions=G;var j=new Array(C.positions.length),q=new Array(C.positions.length),J=void 0,X=void 0;/^\[/.test(m.minimumHeights)?(J=m.minimumHeights.replace(/\[/,"").replace("/]/",""),J=entity.properties[J]._value):J=m.minimumHeights,/^\[/.test(m.maximumHeights)?(X=m.maximumHeights.replace(/\[/,"").replace("/]/",""),X=entity.properties[X]._value):X=m.maximumHeights,j.fill(J),q.fill(X),C.minimumHeights=j,C.maximumHeights=q,P.treeID=m.id,P.VectorType="wall",P.VectorStyle={haveZ:L,minimumHeights:j,maximumHeights:q,positions:k,material:m.material};var Y=new E._cesium.GeometryInstance({id:P,geometry:new E._cesium.WallGeometry(C),attributes:{color:new E._cesium.ColorGeometryInstanceAttribute.fromColor(m.material)}}),Q="material:"+m.material.red*255+","+m.material.green*255+","+m.material.blue*255;E.Legend.push(Q);var ee=new E._cesium.Primitive({geometryInstances:Y,appearance:new E._cesium.MaterialAppearance({material:new E._cesium.Material({fabric:{type:"Color",uniforms:{color:m.material}}}),faceForward:!0,flat:!1}),vertexCacheOptimize:!0,interleave:!0,shadows:E._cesium.ShadowMode.ENABLED});I.add(ee)}}),I},m&&m.time&&(A.availability=new E._cesium.TimeIntervalCollection([new E._cesium.TimeInterval({start:m.time.start?E._cesium.JulianDate.fromDate(new Date(m.time.start)):E._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?E._cesium.JulianDate.fromDate(new Date(m.time.end)):E._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=A._primitiveCollection,A.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u5899\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var T={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polylineWallLayer",item:this,url:f.url,style:m};return this._Provider.treeID=m.id,this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};CA.prototype.setTreeobj=function(o){this.treeobj=o};CA.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch{}};CA.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};CA.prototype.getLegend=function(){var o=[];return this.Legend!=null&&(o=this._core.unique(this.Legend)),o};CA.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(!o)}catch{}};CA.prototype.setVisibility=function(o){this.item.show=o,this._Provider&&this._Provider.setStatus(!o)};CA.prototype.edit=function(o,f){return this.isEditting=o,this.editoption=f,this._Provider&&this._Provider.edit&&this._Provider.edit(o,f)};CA.prototype.forceRefresh=function(){try{for(var o=0;o<this._Provider.quadtree._levelZeroTiles.length;o++)this._Provider.quadtree._levelZeroTiles[o].freeResources()}catch{}};var oJ=CA;var Gi=null;function ua(o,f,m){this._viewer=o,this._cesium=f,this.earthCtrl=m,Gi=f,this._core=new Sr(o,f),this._tree=Ne,this._getPosition=new Ru(this._viewer,this._cesium),this._ModelEdit=new wX(this._viewer,this._cesium),this._popupmessage=new wb(this._viewer,this._cesium),this._createGroup=new D4(this._viewer,this._cesium),this._billboardGeoJsonFeatureLayer=new nJ(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new vd(this._viewer,this._cesium),this._LabelGeoJsonFeatureLayercopy=new ty(this._viewer,this._cesium),this._VectorGeoJsonFeatureLayer=new od(this._viewer,this._cesium),this._PolylineGeoJsonFeatureLayer=new FD(this._viewer,this._cesium),this._PointModel=new VT(this._viewer,this._cesium),this._PolygonGeoJsonFeatureLayer=new zT(this._viewer,this._cesium),this._PolygonVectorTileLayerArcgis=new mle(this._viewer,this._cesium),this._WallGeoFeatureLayer=new oJ(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.objectsToExclude=[],this.SimpleGraphicObj=[],!Ne.editPointID&&(Ne.editPointID={edit:[],size:[],move:void 0,height:[],add:[]}),this.editProp=!1,this.PrimitiveCollection=new Gi.PrimitiveCollection,o.scene.primitives.add(this.PrimitiveCollection),this.SizeData=[],this.featuresPlotting=[],this.openEdit=!0}ua.prototype.createSimpleGraphic=function(o,f={},m){let v=null,y=(x,C)=>{x&&f.removeEdit&&this.SimpleGraphicObj.pop(),f.propData&&this.setPropData(x,f.propData),x.deleteObject=()=>{this.remove(x.id),this._viewer.entities.removeById(x.id)},this.defaultEdit(),m&&m(x,C)};switch(this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),o){case"point":v=this.createPoint(f,y);break;case"billboard":v=this.createBillboard(f,y);break;case"label":v=this.createLabel(f,y);break;case"model":v=this.createModel(f,y);break;case"polyline":v=this.createPolyline(f,y);break;case"polygon":v=this.createPolygon(f,y);break;case"triangle":v=this.createTriangle(f,y);break;case"polygon-rectangle":v=this.createPolygonRectangle(f,y);break;case"rectangle":v=this.createRectangle(f,y);break;case"circle":v=this.createCircle(f,y);break;case"ellipse":v=this.createEllipse(f,y);break;case"box":v=this.createBox(f,y);break;case"cylinder":v=this.createCylinder(f,y);break;case"cone":v=this.createCone(f,y);break;case"sphere":v=this.createSphere(f,y);break;case"polyhedron":v=this.createPolyhedron(f,y);break}return v};ua.prototype.addSimpleGraphic=function(o,f={},m){let v=null;switch(o){case"point":v=this.addPoint(f);break;case"billboard":v=this.addBillboard(f);break;case"label":v=this.addLabel(f);break;case"model":v=this.addModel(f);break;case"polyline":v=this.addPolyline(f);break;case"polylinePrimitive":v=this.addPolylinePrimitive(f);break;case"polygon":v=this.addPolygon(f);break;case"polygonPrimitive":v=this.addPolygonPrimitive(f);break;case"rectangle":v=this.addRectangle(f);break;case"circle":v=this.addCircle(f);break;case"ellipse":v=this.addEllipse(f);break;case"box":v=this.addBox(f);break;case"cylinder":v=this.addCylinder(f);break;case"cone":v=this.addCone(f);break;case"sphere":v=this.addSphere(f);break;case"ellipsoid":v=this.addSphere(f);break;case"polyhedron":v=this.addPolyhedron(f);break}if(v&&f.removeEdit&&this.SimpleGraphicObj.pop(),f.propData&&this.setPropData(v,f.propData),this.defaultEdit(),v.deleteObject=()=>{this.remove(v.id),this._viewer.entities.removeById(v.id)},m&&(f.GroupID=m.pId,f.id=m.id,f.name=m.name),f.GroupID!==void 0){let y={id:v.id,name:v.name,pId:f.GroupID,type:o,item:{item:v,setVisibility:x=>{v.show=x}}};o.indexOf("Primitive")>-1&&(y.id=f.id,y.name=f.name),Ne.insertGroupId(y,f.GroupID)}return v};ua.prototype.getDefaultLabelStyle=function(o){return{show:this._core.defaultValue(o.showLabel,!1),text:this._core.defaultValue(o.label_text,"\u65B0\u5EFA\u6587\u672C"),font:this._core.defaultValue(o.label_font,"24px \u5B8B\u4F53"),scale:this._core.defaultValue(o.label_scale,1),style:this._core.defaultValue(o.label_style,2),fillColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(o.label_fillColor,"#ffffff")),outlineColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(o.label_outlineColor,"#000000")),outlineWidth:this._core.defaultValue(o.label_outlineWidth,0),showBackground:this._core.defaultValue(o.label_showBackground,!1),backgroundColor:this._cesium.Color.fromCssColorString(this._core.defaultValue(o.label_backgroundColor,"rgba(42,42,42,0.8)")),heightReference:this._core.defaultValue(o.label_heightReference,1),horizontalOrigin:this._core.defaultValue(o.label_horizontalOrigin,this._cesium.HorizontalOrigin.CENTER),verticalOrigin:this._core.defaultValue(o.label_verticalOrigin,this._cesium.VerticalOrigin.CENTER),scaleByDistance:this._core.defaultValue(o.label_scaleByDistance,void 0),pixelOffset:this._core.defaultValue(o.label_pixelOffset,void 0),disableDepthTestDistance:this._core.defaultValue(o.label_disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:this._core.defaultValue(o.label_distanceDisplayCondition,new this._cesium.DistanceDisplayCondition(0,1e8))}};ua.prototype.end=function(o){};ua.prototype.createPoint=function(o={},f){let m=this,v=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1,this.drawHandler.setInputAction(y=>{let x=m._getPosition.getMousePosition(y);if(x){let C=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u70B9",position:x,point:{pixelSize:16,heightReference:0,color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"#0000ff")),outlineWidth:m._core.defaultValue(o.outlineWidth,2),outlineColor:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),disableDepthTestDistance:m._core.defaultValue(o.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:m._core.defaultValue(o.distanceDisplayCondition,new m._cesium.DistanceDisplayCondition(0,1e8))}});m.SimpleGraphicObj.push(C.id),m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),f&&typeof f=="function"&&f(C)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(y=>{m.tooltip.showAt(y.endPosition,"\u70B9\u51FB\u7ED8\u5236\u70B9")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(y=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0")},this};ua.prototype.addPoint=function(o={}){let f=this,v=this._viewer.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u70B9"),position:o.position,point:{pixelSize:f._core.defaultValue(o.pixelSize,16),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"#0000ff")),outlineWidth:f._core.defaultValue(o.outlineWidth,2),outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),heightReference:f._core.defaultValue(o.heightReference,0),scaleByDistance:f._core.defaultValue(o.scaleByDistance,void 0),disableDepthTestDistance:f._core.defaultValue(o.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(v.id),v};ua.prototype.createBillboard=function(o={},f){let m=this,v=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1,o.image=this._core.getGifImageProperty(o.image),this.drawHandler.setInputAction(y=>{let x=m._getPosition.getMousePosition(y);if(x){let C=v.entities.add({id:m._core.getuid(),name:"Billboard",position:x,billboard:{horizontalOrigin:m._cesium.HorizontalOrigin.CENTER,verticalOrigin:m._cesium.VerticalOrigin.BOTTOM,heightReference:0,scale:m._core.defaultValue(o.scale,1),width:m._core.defaultValue(o.width,o.image?void 0:32),height:m._core.defaultValue(o.height,o.image?void 0:44),image:m._core.defaultValue(o.image,window.SmartEarthRootUrl+pn.mark),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"#ffffff")),disableDepthTestDistance:m._core.defaultValue(o.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:m._core.defaultValue(o.distanceDisplayCondition,new m._cesium.DistanceDisplayCondition(0,1e8))},label:this.getDefaultLabelStyle(o)});m.SimpleGraphicObj.push(C.id),m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),f&&typeof f=="function"&&f(C)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(y=>{m.tooltip.showAt(y.endPosition,"\u70B9\u51FB\u7ED8\u5236\u56FE\u6807")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(y=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0")},this};ua.prototype.addBillboard=function(o={}){let f=this,m=this._viewer;o.image=this._core.getGifImageProperty(o.image);let v=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"Billboard"),position:o.position,billboard:{horizontalOrigin:f._core.defaultValue(o.horizontalOrigin,f._cesium.HorizontalOrigin.CENTER),verticalOrigin:f._core.defaultValue(o.verticalOrigin,f._cesium.VerticalOrigin.BOTTOM),scale:f._core.defaultValue(o.scale,1),rotation:f._core.defaultValue(o.rotation,0),width:f._core.defaultValue(o.width,void 0),height:f._core.defaultValue(o.height,void 0),image:f._core.defaultValue(o.image,window.SmartEarthRootUrl+pn.mark),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"#ffffff")),heightReference:f._core.defaultValue(o.heightReference,0),scaleByDistance:f._core.defaultValue(o.scaleByDistance,void 0),disableDepthTestDistance:f._core.defaultValue(o.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))},label:this.getDefaultLabelStyle(o)});return f.SimpleGraphicObj.push(v.id),v};ua.prototype.createLabel=function(o={},f){let m=this,v=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1,this.drawHandler.setInputAction(y=>{let x=m._getPosition.getMousePosition(y);if(x){let C=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u6587\u672C",position:x,label:{text:"\u65B0\u5EFA\u6587\u672C",font:"24px \u5B8B\u4F53",fillColor:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.fillColor,"#ffffff")),heightReference:0,scale:1,style:2,outlineColor:m._cesium.Color.BLACK,outlineWidth:0,showBackground:!1,backgroundColor:new m._cesium.Color(.165,.165,.165,.8),horizontalOrigin:m._cesium.HorizontalOrigin.CENTER,verticalOrigin:m._cesium.VerticalOrigin.CENTER,distanceDisplayCondition:m._core.defaultValue(o.distanceDisplayCondition,new m._cesium.DistanceDisplayCondition(0,1e8)),disableDepthTestDistance:Number.POSITIVE_INFINITY}});m.SimpleGraphicObj.push(C.id),m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),f&&typeof f=="function"&&f(C)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(y=>{m.tooltip.showAt(y.endPosition,"\u70B9\u51FB\u7ED8\u5236\u6587\u672C")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(y=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0")},this};ua.prototype.addLabel=function(o={}){let f=this,v=this._viewer.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u6587\u672C"),position:o.position,label:{text:f._core.defaultValue(o.text,"\u65B0\u5EFA\u6587\u672C"),font:f._core.defaultValue(o.font,"24px \u5B8B\u4F53"),scale:f._core.defaultValue(o.scale,1),style:f._core.defaultValue(o.style,2),fillColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.fillColor,"#ffffff")),outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"#000000")),outlineWidth:f._core.defaultValue(o.outlineWidth,0),showBackground:f._core.defaultValue(o.showBackground,!1),backgroundColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.backgroundColor,"rgba(42,42,42,0.8)")),heightReference:f._core.defaultValue(o.heightReference,0),horizontalOrigin:f._core.defaultValue(o.horizontalOrigin,f._cesium.HorizontalOrigin.CENTER),verticalOrigin:f._core.defaultValue(o.verticalOrigin,f._cesium.VerticalOrigin.CENTER),scaleByDistance:f._core.defaultValue(o.scaleByDistance,void 0),pixelOffset:f._core.defaultValue(o.pixelOffset,void 0),disableDepthTestDistance:f._core.defaultValue(o.disableDepthTestDistance,Number.POSITIVE_INFINITY),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(v.id),v};ua.prototype.createModel=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y,x=Gi.Matrix3.fromRotationX(Gi.Math.toRadians(m._core.defaultValue(o.heading,0))),C=Gi.Matrix3.fromRotationY(Gi.Math.toRadians(m._core.defaultValue(o.pitch,0))),w=Gi.Matrix3.fromRotationZ(Gi.Math.toRadians(m._core.defaultValue(o.roll,0))),A=Gi.Matrix4.fromRotationTranslation(x),E=Gi.Matrix4.fromRotationTranslation(C),T=Gi.Matrix4.fromRotationTranslation(w);this.drawHandler.setInputAction(M=>{let I=m._getPosition.getMousePosition(M,y);I&&(y&&v.scene.primitives.remove(y),y=v.entities.add({id:m._core.getuid(),name:m._core.defaultValue(o.name,"Model"),position:I,orientation:Gi.Transforms.headingPitchRollQuaternion(I,new Gi.HeadingPitchRoll(Gi.Math.toRadians(m._core.defaultValue(o.heading,0)),Gi.Math.toRadians(m._core.defaultValue(o.pitch,0)),Gi.Math.toRadians(m._core.defaultValue(o.roll,0)))),model:{uri:m._core.defaultValue(o.url,window.SmartEarthRootUrl+pn.testModel),scale:m._core.defaultValue(o.scale,1),minimumPixelSize:0,runAnimations:!0,colorBlendMode:m._core.defaultValue(o.colorBlendMode,void 0),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"#ffffff")),distanceDisplayCondition:m._core.defaultValue(o.distanceDisplayCondition,new m._cesium.DistanceDisplayCondition(0,1e8))}}),y.heading=m._core.defaultValue(o.heading,0),y.pitch=m._core.defaultValue(o.pitch,0),y.roll=m._core.defaultValue(o.roll,0),m.SimpleGraphicObj.push(y.id),m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),f&&typeof f=="function"&&f(y))},this._cesium.ScreenSpaceEventType.LEFT_CLICK);let S=!1;return this.drawHandler.setInputAction(M=>{let I=m._getPosition.getMousePosition(M,y);if(y){let P=Gi.Transforms.eastNorthUpToFixedFrame(I);Gi.Matrix4.multiply(P,A,P),Gi.Matrix4.multiply(P,E,P),Gi.Matrix4.multiply(P,T,P),y.modelMatrix=P}else if(I){let P=Gi.Transforms.eastNorthUpToFixedFrame(I);Gi.Matrix4.multiply(P,A,P),Gi.Matrix4.multiply(P,E,P),Gi.Matrix4.multiply(P,T,P),y=v.scene.primitives.add(Gi.Model.fromGltf({modelMatrix:P,url:m._core.defaultValue(o.url,window.SmartEarthRootUrl+pn.testModel),scale:m._core.defaultValue(o.scale,1),minimumPixelSize:0,colorBlendMode:m._core.defaultValue(o.colorBlendMode,void 0),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"#ffffff")).withAlpha(.5),distanceDisplayCondition:m._core.defaultValue(o.distanceDisplayCondition,new m._cesium.DistanceDisplayCondition(0,1e8)),allowPicking:!1})),y.readyPromise.then(()=>{S=!0})}S?m.tooltip.showAt(M.endPosition,"\u70B9\u51FB\u7ED8\u5236\u6A21\u578B"):m.tooltip.showAt(M.endPosition,"\u52A0\u8F7D\u6A21\u578B\u4E2D...")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(M=>{this.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=()=>{this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),y&&v.scene.primitives.remove(y),m._core.mouse(m._viewer.container,0,"0")},this};ua.prototype.addModel=function(o={}){let f=this,v=this._viewer.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"Model"),position:o.position,orientation:Gi.Transforms.headingPitchRollQuaternion(o.position,new Gi.HeadingPitchRoll(Gi.Math.toRadians(f._core.defaultValue(o.heading,0)),Gi.Math.toRadians(f._core.defaultValue(o.pitch,0)),Gi.Math.toRadians(f._core.defaultValue(o.roll,0)))),model:{scale:f._core.defaultValue(o.scale,1),uri:f._core.defaultValue(o.url,window.SmartEarthRootUrl+pn.testModel),minimumPixelSize:f._core.defaultValue(o.minimumPixelSize,0),runAnimations:f._core.defaultValue(o.runAnimations,!0),colorBlendMode:f._core.defaultValue(o.colorBlendMode,void 0),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"#ffffff")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return v.heading=f._core.defaultValue(o.heading,0),v.pitch=f._core.defaultValue(o.pitch,0),v.roll=f._core.defaultValue(o.roll,0),f.SimpleGraphicObj.push(v.id),v};ua.prototype.createPolyline=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x;return this.drawHandler.setInputAction(C=>{let w=m._getPosition.getMousePosition(C,x);!w||(y.length===0&&y.push(w.clone()),y.push(w),o.toPoint&&y.length===3&&(y.pop(),m.end()),x||(x=v.entities.add({id:m._core.getuid(),name:m._core.defaultValue(o.name,"\u65B0\u5EFA\u7EBF"),polyline:{positions:new m._cesium.CallbackProperty(function(){return y},!1),clampToGround:m._core.defaultValue(o.clampToGround,!0),material:new Gi.PolylineOutlineMaterialProperty({color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)")),outlineWidth:0,outlineColor:m._cesium.Color.WHITE.withAlpha(.6)}),depthFailMaterial:o.depthFailColor&&new Gi.PolylineOutlineMaterialProperty({color:m._cesium.Color.fromCssColorString(o.depthFailColor),outlineWidth:0,outlineColor:m._cesium.Color.WHITE.withAlpha(.6)}),width:m._core.defaultValue(o.width,3),distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}}),m.SimpleGraphicObj.push(x.id)),o.showSize&&m.showSizeData("polyline",[y[y.length-2],y[y.length-1]]))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(C=>{if(y.length===0)m.tooltip.showAt(C.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");else{m.tooltip.showAt(C.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");let w=m._getPosition.getMousePosition(C,x);if(!w)return;y.pop(),y.push(w),o.showSize&&(m.clearLastSizeData(),m.showSizeData("polyline",[y[y.length-2],y[y.length-1]]))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(C){if(m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0),m.end=void 0,C==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}!x||f&&typeof f=="function"&&f(x,y)},this.drawHandler.setInputAction(C=>{m.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this};ua.prototype.addPolyline=function(o={}){let f=this,m=this._viewer,v=o.positions,y=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u7EBF"),polyline:{positions:v,clampToGround:f._core.defaultValue(o.clampToGround,!0),material:new Gi.PolylineOutlineMaterialProperty({color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)")),outlineWidth:f._core.defaultValue(o.outlineWidth,0),outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)"))}),depthFailMaterial:o.depthFailColor&&new Gi.PolylineOutlineMaterialProperty({color:f._cesium.Color.fromCssColorString(o.depthFailColor),outlineWidth:0,outlineColor:f._cesium.Color.WHITE.withAlpha(.6)}),width:f._core.defaultValue(o.width,3),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(y.id),y};ua.prototype.addPolylinePrimitive=function(o={}){let f=this,m=this._viewer,v=o.positions,y;if(o.clampToGround)y=new f._cesium.GroundPolylineGeometry({positions:v,width:f._core.defaultValue(o.width,3)});else{let E=new Gi.PolylineGeometry({positions:v,width:f._core.defaultValue(o.width,3)});y=Gi.PolylineGeometry.createGeometry(E)}let x=f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)")),C=new Gi.GeometryInstance({id:f._core.defaultValue(o.id,f._core.getuid()),geometry:y,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(x)}}),w,A=new f._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0});return o.clampToGround?w=new f._cesium.GroundPolylinePrimitive({geometryInstances:C,appearance:A}):w=new f._cesium.Primitive({geometryInstances:C,appearance:A}),this.PrimitiveCollection.add(w),w};ua.prototype.createPolygon=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C;return this.drawHandler.setInputAction(w=>{let A=m._getPosition.getMousePosition(w,[C,x]);!A||(y.length===0&&y.push(A.clone()),y.push(A),y.length===2&&!C&&(o.clampToGround=m._core.defaultValue(o.clampToGround,!0),C=v.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new m._cesium.CallbackProperty(function(){return y},!1),clampToGround:m._core.defaultValue(o.clampToGround,!0),material:new Gi.PolylineOutlineMaterialProperty({color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)")),outlineWidth:0,outlineColor:m._cesium.Color.WHITE.withAlpha(.6)}),width:3}})),y.length===3&&!x&&(C&&v.entities.remove(C),x=v.entities.add({id:m._core.getuid(),name:m._core.defaultValue(o.name,"\u65B0\u5EFA\u9762"),polygon:{hierarchy:new m._cesium.CallbackProperty(function(){return new m._cesium.PolygonHierarchy(y)},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!m._core.defaultValue(o.clampToGround,!1),heightReference:o.clampToGround?1:0,outline:m._core.defaultValue(o.outline,!1),outlineColor:m._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}}),m.SimpleGraphicObj.push(x.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(w=>{if(y.length===0)m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E00\u4E2A\u70B9");else if(y.length===1){m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9");let A=m._getPosition.getMousePosition(w,[C,x]);if(!A)return;y.pop(),y.push(A)}else{m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");let A=m._getPosition.getMousePosition(w,[C,x]);if(!A)return;if(y.pop(),y.push(A),o.showSize){m.clearLastSizeData();let E=m.showSizeData("polygon",y);x&&(x.sizeData=E)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(w){if(m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),C&&v.entities.remove(C),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),m.end=void 0,w==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}!x||f&&typeof f=="function"&&f(x,y)},this.drawHandler.setInputAction(w=>{m.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this};ua.prototype.createTriangle=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C;this.drawHandler.setInputAction(I=>{let P=m._getPosition.getMousePosition(I,C);!P||(x?(y=w(x,P),this.end()):(x=P,y=[P,P,P]),y.length&&!C&&(o.clampToGround=m._core.defaultValue(o.clampToGround,!0),C=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u4E09\u89D2\u5F62",polygon:{hierarchy:new m._cesium.CallbackProperty(function(){return new m._cesium.PolygonHierarchy(y)},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!m._core.defaultValue(o.clampToGround,!1),heightReference:o.clampToGround?1:0,outline:m._core.defaultValue(o.outline,!1),outlineColor:m._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}}),m.SimpleGraphicObj.push(C.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(I=>{if(!x)m.tooltip.showAt(I.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");else{m.tooltip.showAt(I.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");let P=m._getPosition.getMousePosition(I,C);if(!P)return;y=w(x,P)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(I){if(m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0),m.end=void 0,I==="cancel"){C&&(v.entities.remove(C),m.SimpleGraphicObj.pop());return}f&&typeof f=="function"&&f(C)},this.drawHandler.setInputAction(I=>{m.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK);function w(I,P){let D=[],L=m.toDegrees(I),R=m.toDegrees(P),O=S(L.lat,L.lon,R.lat,R.lon),F=O.angle,k=O.distance;D.push(R.lon,R.lat);let U=T(L.lat,L.lon,k,F+120);return D.push(U[0],U[1]),U=T(L.lat,L.lon,k,F-120),D.push(U[0],U[1]),Gi.Cartesian3.fromDegreesArray(D)}let A=6378137,E=6356725;function T(I,P,D,L){let R=D*Math.sin(L*Math.PI/180),O=D*Math.cos(L*Math.PI/180),F=E+(A-E)*(90-I)/90,k=F*Math.cos(I*Math.PI/180),U=(R/k+P*Math.PI/180)*180/Math.PI,G=(O/F+I*Math.PI/180)*180/Math.PI;return[U,G]}function S(I,P,D,L){let R=M(I),O=M(D),F=M(D)-M(I),k=M(L)-M(P),U=2*Math.asin(Math.sqrt(Math.pow(Math.sin(F/2),2)+Math.cos(R)*Math.cos(O)*Math.pow(Math.sin(k/2),2)));return U=U*A,U=Math.round(U*1e4)/1e4,{angle:m._core.TwoPointAzimuth(P,I,L,D),distance:U}}function M(I){return I*Math.PI/180}return this};ua.prototype.createPolygonRectangle=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C,w;return this.drawHandler.setInputAction(A=>{let E=m._getPosition.getMousePosition(A,x);!E||(y.length?m.end():(C=A.position,y.push(E.clone(),E.clone(),E.clone(),E.clone())),x||(o.clampToGround=m._core.defaultValue(o.clampToGround,!0),x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u9762",polygon:{hierarchy:new m._cesium.CallbackProperty(function(){return new m._cesium.PolygonHierarchy(y)},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),perPositionHeight:!m._core.defaultValue(o.clampToGround,!1),heightReference:o.clampToGround?1:0,outline:m._core.defaultValue(o.outline,!1),outlineColor:m._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}})))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(A=>{if(y.length===0)m.tooltip.showAt(A.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236");else{m.tooltip.showAt(A.endPosition,"\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236"),C=v.scene.cartesianToCanvasCoordinates(y[0]),w=A.endPosition;let E={x:C.x,y:w.y},T={x:w.x,y:C.y},S=m._getPosition.getMousePosition(E,x);S&&(y[1]=S),S=m._getPosition.getMousePosition(w,x),S&&(y[2]=S),S=m._getPosition.getMousePosition(T,x),S&&(y[3]=S)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(A){if(m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),m.end=void 0,A==="cancel"){x&&v.entities.remove(x);return}f&&typeof f=="function"&&f(x,C,w)},this};ua.prototype.addPolygon=function(o={}){let f=this,m=this._viewer,v=o.positions,y;o.hierarchy?y=o.hierarchy:y=new f._cesium.PolygonHierarchy(v),o.clampToGround=f._core.defaultValue(o.clampToGround,!0);let x=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u9762"),polygon:{hierarchy:new f._cesium.CallbackProperty(function(){return y},!1),material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),outline:f._core.defaultValue(o.outline,!1),outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),perPositionHeight:!f._core.defaultValue(o.clampToGround,!1),heightReference:o.clampToGround?1:0,distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(x.id),x};ua.prototype.addPolygonPrimitive=function(o={}){let f=this,m=this._viewer,v=o.positions,y;o.hierarchy?y=o.hierarchy:y=new f._cesium.PolygonHierarchy(v);let x,C=new f._cesium.PolygonGeometry({height:f._core.defaultValue(o.height,void 0),extrudedHeight:f._core.defaultValue(o.extrudedHeight,void 0),polygonHierarchy:y,vertexFormat:o.water?Gi.EllipsoidSurfaceAppearance.VERTEX_FORMAT:void 0}),w=f._cesium.PolygonGeometry.createGeometry(C),A=f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)")),E=new Gi.GeometryInstance({id:f._core.defaultValue(o.id,f._core.getuid()),geometry:w,attributes:o.water?void 0:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(A)}}),T;if(o.water)T=new Gi.Primitive({geometryInstances:E,appearance:new Gi.EllipsoidSurfaceAppearance({material:new Gi.Material({fabric:{type:"Water",uniforms:{baseWaterColor:o.watherColor||Gi.Color.SKYBLUE.withAlpha(.6),blendColor:o.watherColor||Gi.Color.SKYBLUE.withAlpha(.6),normalMap:o.url,frequency:o.frequency||1e3,animationSpeed:o.watherSpeed||.01,amplitude:o.amplitude||10}}})}),show:!0});else if(T=new f._cesium.Primitive({geometryInstances:E,appearance:new f._cesium.PerInstanceColorAppearance({translucent:!0}),shadows:o.shadows}),o.extrudedHeight){x=new Gi.PrimitiveCollection;let S=new Gi.PolygonOutlineGeometry({height:f._core.defaultValue(o.height,void 0),polygonHierarchy:y,extrudedHeight:o.extrudedHeight}),M=Gi.PolygonOutlineGeometry.createGeometry(S),I=f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),P=new Gi.GeometryInstance({id:f._core.defaultValue(o.id,f._core.getuid()),geometry:M,attributes:{color:new f._cesium.ColorGeometryInstanceAttribute.fromColor(I)}}),D=new f._cesium.Primitive({geometryInstances:P,appearance:new f._cesium.PolylineColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0})});x.add(T),x.add(D)}return!x&&(x=T),this.PrimitiveCollection.add(x),x};ua.prototype.createRectangle=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x;return this.drawHandler.setInputAction(C=>{let w=m._getPosition.getMousePosition(C,x);if(!!w&&(y.length===0?y.push(w,w):(y.pop(),y.push(w),m.end()),!x)){let A=m.toDegrees(y[0]);o.clampToGround=m._core.defaultValue(o.clampToGround,!0),x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u77E9\u5F62",rectangle:{coordinates:new m._cesium.CallbackProperty(function(){return m._cesium.Rectangle.fromCartesianArray(y)},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),height:o.clampToGround?void 0:A.height,heightReference:o.clampToGround?1:0,outline:!0,outlineColor:m._cesium.Color.WHITE.withAlpha(.6),outlineWidth:1,distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}}),x.thisHeight=A.height,m.SimpleGraphicObj.push(x.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(C=>{if(y.length>0){m.tooltip.showAt(C.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88");let w=m._getPosition.getMousePosition(C,x);w&&(y.pop(),y.push(w),o.showSize&&(m.clearLastSizeData(),m.showSizeData("rectangle",y)))}else m.tooltip.showAt(C.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(C=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=C=>{if(this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),C==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}f&&typeof f=="function"&&f(x)},this};ua.prototype.addRectangle=function(o={}){let f=this,m=this._viewer,v=o.positions,y;o.coordinates?y=o.coordinates:y=f._cesium.Rectangle.fromCartesianArray(v);let x=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u77E9\u5F62"),rectangle:{coordinates:new f._cesium.CallbackProperty(function(){return y},!1),material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),height:f._core.defaultValue(o.height,void 0),rotation:f._core.defaultValue(o.rotation,0),heightReference:f._core.defaultValue(o.heightReference,1),outline:f._core.defaultValue(o.outline,!1),outlineWidth:1,outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(x.id),x};ua.prototype.createCircle=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C=0;return this.drawHandler.setInputAction(w=>{let A=m._getPosition.getMousePosition(w,x);if(!!A&&(y.length===0?y.push(A,A):(y[0]=A,C=m._cesium.Cartesian3.distance(y[0],y[1]),m.end()),!x)){let E=m.toDegrees(y[1]);o.clampToGround=m._core.defaultValue(o.clampToGround,!0),x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u5706",position:y[1],ellipse:{semiMajorAxis:new m._cesium.CallbackProperty(function(){return C},!1),semiMinorAxis:new m._cesium.CallbackProperty(function(){return C},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),height:o.clampToGround?void 0:E.height,heightReference:o.clampToGround?1:0,outline:!0,outlineWidth:1,outlineColor:m._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}}),x.thisHeight=E.height,m.SimpleGraphicObj.push(x.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(w=>{if(y.length>0){m.tooltip.showAt(w.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88");let A=m._getPosition.getMousePosition(w,x);A&&(y[0]=A,C=m._cesium.Cartesian3.distance(y[0],y[1]),o.showSize&&(m.clearLastSizeData(),m.showSizeData("circle",y[1],C)))}else m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(w=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=w=>{if(this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),w==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}f&&typeof f=="function"&&f(x,{distance:C,positions:y})},this};ua.prototype.addCircle=function(o={}){let f=this,m=this._viewer,v=o.radius,y=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u5706"),position:o.position,ellipse:{semiMajorAxis:new f._cesium.CallbackProperty(function(){return v},!1),semiMinorAxis:new f._cesium.CallbackProperty(function(){return v},!1),material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),transparent:!0,color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,o.image?"#ffffff":"rgba(0,255,0,0.6)"))}),height:f._core.defaultValue(o.height,void 0),heightReference:f._core.defaultValue(o.heightReference,o.height?0:1),outline:f._core.defaultValue(o.outline,!1),outlineWidth:1,rotation:o.rotation,stRotation:o.outline,outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(y.id),y};ua.prototype.createEllipse=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C=0;return this.drawHandler.setInputAction(w=>{let A=m._getPosition.getMousePosition(w,x);if(!!A&&(y.length===0?y.push(A,A):(y[0]=A,C=m._cesium.Cartesian3.distance(y[0],y[1]),m.end()),!x)){let E=m.toDegrees(y[1]);o.clampToGround=m._core.defaultValue(o.clampToGround,!0),x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u692D\u5706",position:y[1],ellipse:{semiMajorAxis:new m._cesium.CallbackProperty(function(){return C},!1),semiMinorAxis:new m._cesium.CallbackProperty(function(){return C/2},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),height:o.clampToGround?void 0:E.height,heightReference:o.clampToGround?1:0,outline:!0,outlineWidth:1,outlineColor:m._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}}),x.thisHeight=E.height,m.SimpleGraphicObj.push(x.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(w=>{if(y.length>0){m.tooltip.showAt(w.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88");let A=m._getPosition.getMousePosition(w,x);A&&(y[0]=A,C=m._cesium.Cartesian3.distance(y[0],y[1]))}else m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(w=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=w=>{if(this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),w==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}f&&typeof f=="function"&&f(x)},this};ua.prototype.addEllipse=function(o={}){let f=this,m=this._viewer,v=o.semiMajorAxis,y=o.semiMinorAxis,x=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u5706"),position:o.position,ellipse:{semiMajorAxis:new f._cesium.CallbackProperty(function(){return v},!1),semiMinorAxis:new f._cesium.CallbackProperty(function(){return y},!1),material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),height:f._core.defaultValue(o.height,void 0),heightReference:f._core.defaultValue(o.heightReference,1),outline:f._core.defaultValue(o.outline,!1),outlineWidth:1,outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(x.id),x};ua.prototype.createBox=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C=[0,0,0],w=this._core.defaultValue(o.height,200);return this.drawHandler.setInputAction(A=>{let E=m._getPosition.getMouseDegrees(A,x);if(!!E){if(y.length===0)y.push(E,E);else{E.height=y[0].height,y[1]=E;let T=m.Cdcl(y[0].lat,y[0].lon,y[0].lat,y[1].lon),S=m.Cdcl(y[0].lat,y[0].lon,y[1].lat,y[0].lon),M={lon:(y[0].lon+y[1].lon)/2,lat:(y[0].lat+y[1].lat)/2};C&&(C[0]=T,C[1]=S,C[2]=w),x.position=Gi.Cartesian3.fromDegrees(M.lon,M.lat,y[0].height+C[2]/2),m.end()}x||(x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u7ACB\u65B9\u4F53",position:m._cesium.Cartesian3.fromDegrees(E.lon,E.lat,E.height),box:{dimensions:new m._cesium.CallbackProperty(function(){return m._cesium.Cartesian3.fromArray(C)},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:!0,outlineColor:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),shadows:m._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}}),m.SimpleGraphicObj.push(x.id))}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(A=>{if(y.length>0){m.tooltip.showAt(A.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88");let E=m._getPosition.getMouseDegrees(A,x);if(E){E.height=y[0].height,y[1]=E;let T=m.Cdcl(y[0].lat,y[0].lon,y[0].lat,y[1].lon),S=m.Cdcl(y[0].lat,y[0].lon,y[1].lat,y[0].lon),M={lon:(y[0].lon+y[1].lon)/2,lat:(y[0].lat+y[1].lat)/2};C&&(C[0]=T,C[1]=S,C[2]=w),x.position=Gi.Cartesian3.fromDegrees(M.lon,M.lat,y[0].height+C[2]/2),o.showSize&&(m.clearLastSizeData(),m.showSizeData("box",x.position,C))}}else m.tooltip.showAt(A.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(A=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=A=>{if(this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),A==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}f&&typeof f=="function"&&f(x)},this};ua.prototype.addBox=function(o={}){let f=this,m=this._viewer,v=o.dimensions,y=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u7ACB\u65B9\u4F53"),position:o.position,box:{dimensions:new f._cesium.CallbackProperty(function(){return v},!1),material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:f._core.defaultValue(o.outline,!0),shadows:f._cesium.ShadowMode.ENABLED,outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(y.id),y};ua.prototype.createCylinder=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C=0,w=this._core.defaultValue(o.height,200);return this.drawHandler.setInputAction(A=>{let E=m._getPosition.getMousePosition(A,x);if(!!E&&(y.length===0?y.push(E,E):(y[0]=E,C=m._cesium.Cartesian3.distance(y[0],y[1]),m.end()),!x)){let T=m.toDegrees(E);x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u5706\u67F1\u4F53",position:m._cesium.Cartesian3.fromDegrees(T.lon,T.lat,T.height+100),cylinder:{length:w,topRadius:new m._cesium.CallbackProperty(function(){return C},!1),bottomRadius:new m._cesium.CallbackProperty(function(){return C},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:m._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)"))}}),x.changeTop=!0,m.SimpleGraphicObj.push(x.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(A=>{if(y.length>0){m.tooltip.showAt(A.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88");let E=m._getPosition.getMousePosition(A,x);E&&(y[0]=E,C=m._cesium.Cartesian3.distance(y[0],y[1]),o.showSize&&(m.clearLastSizeData(),m.showSizeData("cylinder",y[1],C,200)))}else m.tooltip.showAt(A.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(A=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=A=>{if(this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),A==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}f&&typeof f=="function"&&f(x)},this};ua.prototype.addCylinder=function(o={}){let f=this,m=this._viewer,v=o.radius,y=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u5706\u67F1\u4F53"),position:o.position,cylinder:{length:f._core.defaultValue(o.length,200),topRadius:new f._cesium.CallbackProperty(function(){return v},!1),bottomRadius:new f._cesium.CallbackProperty(function(){return v},!1),material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:f._core.defaultValue(o.outline,!0),shadows:f._cesium.ShadowMode.ENABLED,outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return y.changeTop=!0,f.SimpleGraphicObj.push(y.id),y};ua.prototype.createCone=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C=0,w=this._core.defaultValue(o.height,200);return this.drawHandler.setInputAction(A=>{let E=m._getPosition.getMousePosition(A,x);if(!!E&&(y.length===0?y.push(E,E):(y[0]=E,C=m._cesium.Cartesian3.distance(y[0],y[1]),m.end()),!x)){let T=m.toDegrees(E);x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u5706\u9525\u4F53",position:m._cesium.Cartesian3.fromDegrees(T.lon,T.lat,T.height+100),cylinder:{length:w,topRadius:0,bottomRadius:new m._cesium.CallbackProperty(function(){return C},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:m._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)"))}}),x.changeTop=!1,m.SimpleGraphicObj.push(x.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(A=>{if(y.length>0){m.tooltip.showAt(A.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88");let E=m._getPosition.getMousePosition(A,x);E&&(y[0]=E,C=m._cesium.Cartesian3.distance(y[0],y[1]),o.showSize&&(m.clearLastSizeData(),m.showSizeData("cone",y[1],C,200)))}else m.tooltip.showAt(A.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(A=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=A=>{if(this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),A==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}f&&typeof f=="function"&&f(x)},this};ua.prototype.addCone=function(o={}){let f=this,m=this._viewer,v=o.bottomRadius,y=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u5706\u9525\u4F53"),position:o.position,cylinder:{length:f._core.defaultValue(o.length,200),topRadius:f._core.defaultValue(o.topRadius,0),bottomRadius:new f._cesium.CallbackProperty(function(){return v},!1),material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:f._core.defaultValue(o.outline,!0),shadows:f._cesium.ShadowMode.ENABLED,outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return y.changeTop=!1,f.SimpleGraphicObj.push(y.id),y};ua.prototype.createSphere=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x,C=0;return this.drawHandler.setInputAction(w=>{let A=m._getPosition.getMousePosition(w,x);!A||(y.length===0?y.push(A,A):(y[0]=A,C=m._cesium.Cartesian3.distance(y[0],y[1]),m.end()),x||(x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u7403\u4F53",position:A.clone(),ellipsoid:{radii:new m._cesium.CallbackProperty(function(){return new Gi.Cartesian3(C,C,C)},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:m._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)"))}}),x.isSphere=!0,m.SimpleGraphicObj.push(x.id)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(w=>{if(y.length>0){m.tooltip.showAt(w.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88");let A=m._getPosition.getMousePosition(w,x);A&&(y[0]=A,C=m._cesium.Cartesian3.distance(y[0],y[1]),o.showSize&&(m.clearLastSizeData(),m.showSizeData("sphere",y[1],C)))}else m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(w=>{this.end("cancel")},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=w=>{if(this.end=void 0,m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),w==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}let A=m.toDegrees(y[0]),E=m.toDegrees(y[1]);A.height=E.height,y[0]=Gi.Cartesian3.fromDegrees(A.lon,A.lat,A.height),f&&typeof f=="function"&&f(x)},this};ua.prototype.addSphere=function(o={}){let f=this,m=this._viewer,v=o.radius,y;o.radii?y=o.radii:y=new Gi.Cartesian3(v,v,v);let x=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u7403\u4F53"),position:o.position,ellipsoid:{radii:new f._cesium.CallbackProperty(function(){return y},!1),material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,outline:f._core.defaultValue(o.outline,!0),shadows:f._cesium.ShadowMode.ENABLED,outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return x.isSphere=!0,f.SimpleGraphicObj.push(x.id),x};ua.prototype.createPolyhedron=function(o={},f){let m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._straightArrow&&this.earthCtrl.factory._straightArrow.drawHandler&&(this.earthCtrl.factory._straightArrow.drawHandler.destroy(),this.earthCtrl.factory._straightArrow.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;let y=[],x;return this.drawHandler.setInputAction(C=>{let w=m._getPosition.getMousePosition(C,x);if(!!w&&(y.length===1&&y.push(w.clone()),y.push(w),y.length===3&&!x)){let A=m.toDegrees(y[0]),E=this._core.defaultValue(o.height,A.height+200);x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u591A\u8FB9\u4F53",polygon:{hierarchy:new m._cesium.CallbackProperty(function(){return new m._cesium.PolygonHierarchy(y)},!1),extrudedHeight:E,height:A.height,material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),fill:!0,shadows:m._cesium.ShadowMode.ENABLED,distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8),outline:!0,outlineColor:m._cesium.Color.fromCssColorString(m._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)"))}}),m.SimpleGraphicObj.push(x.id)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(C=>{if(y.length===0)m.tooltip.showAt(C.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E00\u4E2A\u70B9");else if(y.length===1)m.tooltip.showAt(C.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9");else{m.tooltip.showAt(C.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");let w=m._getPosition.getMousePosition(C,x);if(!w)return;y.pop(),y.push(w),o.showSize&&(m.clearLastSizeData(),m.showSizeData("polyhedron",y,0,200))}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(C){if(m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.clearAllSizeData(),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),m.end=void 0,C==="cancel"){x&&(v.entities.remove(x),m.SimpleGraphicObj.pop());return}!x||f&&typeof f=="function"&&f(x)},this.drawHandler.setInputAction(C=>{m.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this};ua.prototype.addPolyhedron=function(o={}){let f=this,m=this._viewer,v=o.positions,y=f._core.defaultValue(o.height,0),x;o.hierarchy?x=o.hierarchy:x=new f._cesium.PolygonHierarchy(v);let C=m.entities.add({id:f._core.defaultValue(o.id,f._core.getuid()),name:f._core.defaultValue(o.name,"\u65B0\u5EFA\u591A\u8FB9\u4F53"),polygon:{hierarchy:new f._cesium.CallbackProperty(function(){return x},!1),extrudedHeight:f._core.defaultValue(o.extrudedHeight,y+200),height:y,material:new f._cesium.ImageMaterialProperty({image:f._core.defaultValue(o.image,null),repeat:f._core.defaultValue(o.repeat,new f._cesium.Cartesian2(1,1)),color:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.color,"rgba(0,255,0,0.6)"))}),shadows:f._cesium.ShadowMode.ENABLED,fill:!0,outline:f._core.defaultValue(o.outline,!0),outlineColor:f._cesium.Color.fromCssColorString(f._core.defaultValue(o.outlineColor,"rgba(255,255,255,0.6)")),distanceDisplayCondition:f._core.defaultValue(o.distanceDisplayCondition,new f._cesium.DistanceDisplayCondition(0,1e8))}});return f.SimpleGraphicObj.push(C.id),C};ua.prototype.toDegrees=function(o){let f=this._cesium.Cartographic.fromCartesian(o);return{lon:this._cesium.Math.toDegrees(f.longitude),lat:this._cesium.Math.toDegrees(f.latitude),height:f.height}};ua.prototype.showSizeData=function(o,f,m,v){let y="",x,C=language?language.getStr("draw_tip_info_radius"):"\u534A\u5F84",w=language?language.getStr("unit_m"):"\u7C73",A=language?language.getStr("unit_km"):"\u5343\u7C73";switch(o){case"polyline":let M=Gi.Cartesian3.distance(f[0],f[1]);M>=1e3?(M/=1e3,y=M.toFixed(2)+A):y=M.toFixed(2)+w,x=Gi.Cartesian3.midpoint(f[0],f[1],new Gi.Cartesian3);break;case"polygon":var T=[];x=new Gi.Cartesian3,f.forEach(F=>{x=Gi.Cartesian3.add(F,x,new Gi.Cartesian3);let k=this.toDegrees(F);T.push([k.lon,k.lat])}),x=Gi.Cartesian3.divideByScalar(x,f.length,new Gi.Cartesian3),y=this._core.getArea(T,f);break;case"rectangle":let I=this.toDegrees(f[0]),P=this.toDegrees(f[1]),D=Gi.Cartesian3.distance(f[0],Gi.Cartesian3.fromDegrees(I.lon,P.lat,I.height)),L=Gi.Cartesian3.distance(f[1],Gi.Cartesian3.fromDegrees(I.lon,P.lat,I.height));var E=D*L;E>=1e6?(E/=1e6,y=E.toFixed(2)+"\u5E73\u65B9\u5343\u7C73"):y=E.toFixed(2)+"\u5E73\u65B9\u7C73",x=Gi.Cartesian3.midpoint(f[0],f[1],new Gi.Cartesian3);break;case"circle":x=f,m>=1e3?(m/=1e3,y=C+":"+m.toFixed(2)+A):y=C+":"+m.toFixed(2)+w;break;case"box":let R=[];m[0]<m[1]?(R.push(m[1]),R.push(m[0])):(R.push(m[0]),R.push(m[1])),R.push(m[2]);let O=["\u957F\uFF1A",` \u5BBD\uFF1A`,` \u9AD8\uFF1A`];R.forEach((F,k)=>{F>=1e3?(F/=1e3,y+=O[k]+F.toFixed(2)+A):y+=O[k]+F.toFixed(2)+w}),x=f;break;case"cylinder":x=f,m>=1e3?(m/=1e3,y=C+":"+m.toFixed(2)+A+` `):y=C+":"+m.toFixed(2)+w+` `,v>=1e3?(v/=1e3,y+="\u9AD8\u5EA6\uFF1A"+v.toFixed(2)+A):y+="\u9AD8\u5EA6\uFF1A"+v.toFixed(2)+w;break;case"cone":x=f,m>=1e3?(m/=1e3,y=C+":"+m.toFixed(2)+A+` `):y=C+":"+m.toFixed(2)+w+` `,v>=1e3?(v/=1e3,y+="\u9AD8\u5EA6\uFF1A"+v.toFixed(2)+A):y+="\u9AD8\u5EA6\uFF1A"+v.toFixed(2)+w;break;case"sphere":x=f,m>=1e3?(m/=1e3,y=C+":"+m.toFixed(2)+A):y=C+":"+m.toFixed(2)+w;break;case"polyhedron":var T=[];x=new Gi.Cartesian3,f.forEach(F=>{x=Gi.Cartesian3.add(F,x,new Gi.Cartesian3);let k=this.toDegrees(F);T.push([k.lon,k.lat])}),x=Gi.Cartesian3.divideByScalar(x,f.length,new Gi.Cartesian3),v>=1e3?(v/=1e3,y="\u9AD8\u5EA6\uFF1A"+v.toFixed(2)+A):y="\u9AD8\u5EA6\uFF1A"+v.toFixed(2)+w,y+=` \u9762\u79EF\uFF1A`+this._core.getArea(T,f);break}let S=this._viewer.entities.add({position:x,label:{text:y,font:"16px \u5B8B\u4F53",fillColor:Gi.Color.GOLD,verticalOrigin:Gi.VerticalOrigin.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return this.SizeData.push(S.id),y};ua.prototype.clearLastSizeData=function(){if(this.SizeData.length){let o=this.SizeData.pop();this._viewer.entities.removeById(o)}};ua.prototype.clearAllSizeData=function(){this.SizeData.forEach(o=>{this._viewer.entities.removeById(o)}),this.SizeData=[]};ua.prototype.Cdcl=function(o,f,m,v){let y=0,x=6378137,C=Math.PI;function w(j){return j*C/180}let A=w((o+m)/2),E=w((o-m)/2),T=w((f-v)/2),S=Math.sin(E),M=Math.sin(T),I=Math.sin(A),P,D,L,R,O,F,k,U=x,G=1/298.257;return S=S*S,M=M*M,I=I*I,P=S*(1-M)+(1-I)*M,D=(1-S)*(1-M)+I*M,L=Math.atan(Math.sqrt(P/D)),R=Math.sqrt(P*D)/L,O=2*L*U,F=(3*R-1)/2/D,k=(3*R+1)/2/P,y=O*(1+G*(F*I*(1-S)-k*(1-I)*S)),y};ua.prototype.setEdit=function(o,f){o===void 0&&(o=!0),this.openEdit=o,f&&(this.editOption=f),this.defaultEdit()};ua.prototype.openEditProp=function(o,f){if(f||(f=this.editOption||{editPropData:{}}),o.GeoType===void 0){let v=this.getEntityTypeAndObject(o);o.GeoType=v.type}let m=o.GeoType;(!SmartEarthPopupData.editGraphic||!SmartEarthPopupData.editGraphic.entity)&&(this.getSimpleGraphicData(m,o),m==="point"||m==="billboard"||m==="label"||m==="model"?(this.isEditting=!0,m==="model"&&this._ModelEdit.start(o)):(this.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint())),!f.editPropData&&(f.editPropData={}),this._popupmessage.createPopupProp("\u5C5E\u6027\u7F16\u8F91",{width:f.editPropData.width||360,height:f.editPropData.height||"90%",url:"Workers/prop/jdtx_prop.html",shade:f.editPropData.shade,offset:f.editPropData.offset,type:m,fn:{success:(v,y)=>{f.editPropData.success&&f.editPropData.success(v,y),SmartEarthPopupData.layerIndex=y,SmartEarthPopupData.window=v.find("iframe")[0].contentWindow},end:()=>{this.setPropData(o),f.callBack&&f.callBack.end&&f.callBack.end(o),SmartEarthPopupData.layerIndex=void 0,SmartEarthPopupData.window=void 0,this.endThisEdit&&this.endThisEdit()}}})};ua.prototype.setPropData=function(o,f){if(f&&(o.propData=f),Array.isArray(o.propData)){let m={};o.propData.forEach(v=>{v.key&&(m[v.key]=v.value)}),o.propData=m}if(o.propData){o.properties=new Gi.PropertyBag(o.propData),o.description='<table class="cesium-infoBox-defaultTable"><tbody>';for(let m=0;m<o.properties.propertyNames.length;m++){let v=o.properties.propertyNames[m],y=o.properties[v];o.description+=`<tr><th>${v}</th><td>${y}</td></tr>`}o.description+="</tbody></table>"}};ua.prototype.getPropData=function(o){let f=o.properties;!f&&(f=new Gi.PropertyBag);let m={};for(let v=0;v<f.propertyNames.length;v++){let y=f.propertyNames[v];m[y]=f[y]&&f[y].getValue?f[y].getValue():f[y]}return m};ua.prototype.defaultEdit=function(){this.openEdit?this.SimpleGraphicObj.length&&!this.editHandler?this.edit(this.openEdit,this.editOption):!this.SimpleGraphicObj.length&&this.editHandler&&this.edit(!1):this.editHandler&&this.edit(!1)};ua.prototype.edit=function(o,f){let m=this,v=this._viewer;!f&&(f=this.editOption||{}),f.editProp!==void 0&&(this.editProp=f.editProp);let y=this._core.defaultValue(f.enableDelete,!0);this.editHandler&&(this.editHandler.destroy(),this.editHandler=void 0),o===void 0&&(o=!0);var x,C,w,A;this.isEditting=!1;let E;this.endThisEdit=()=>{m.defaultEvent(!0),Ne.editPointID.edit.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.edit=[],Ne.editPointID.height.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.height=[],Ne.editPointID.add.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.add=[],Ne.editPointID.size.forEach(T=>{v.entities.removeById(T)}),Ne.editPointID.size=[],Ne.editPointID.move&&v.entities.remove(Ne.editPointID.move),Ne.editPointID.move=void 0,x=void 0,A=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},m.isEditting=!1,m.tooltip.show(!1),m.delButton(!1),m.copyButton(!1),m._ModelEdit.end()},this.endThisEdit(),o&&(this.editHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),this.editHandler.setInputAction(T=>{if(Gi.ExpandBySmartEarth&&(Gi.ExpandBySmartEarth.underEarth.enable||Gi.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}if(Ne.editVector)return;let S=T.position,M=v.scene.pick(S);if(m._cesium.defined(M)&&M.id instanceof Gi.Entity){let I=M.id;if(!m.isEditting&&Ne.states==0){if(m.SimpleGraphicObj.indexOf(I.id)===-1)return;if(x=I,x.GeoType===void 0){let P=m.getEntityTypeAndObject(x);x.GeoType=P.type}A=x.GeoType,m.getSimpleGraphicData(A,x),A==="point"||A==="billboard"||A==="label"||A==="model"?(m.isEditting=!0,A==="model"?m._ModelEdit.start(x):m.tooltip.showAt(T.position,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E")):(m.isEditting=!0,SmartEarthPopupData.editGraphic.updataEditPoint()),this.editProp&&m.openEditProp(x,f)}else if(I==x&&(I.GeoType==="point"||I.GeoType==="billboard"||I.GeoType==="label")||I.name=="height_point"||I.name=="edit_point"||I.name=="move_point"||I.name=="add_point"||I.name=="size_point")v.container.style.cursor="crosshair",m.defaultEvent(!1),I.name=="height_point"?(w={windowPosition:S,originHeight:m._cesium.Cartographic.fromCartesian(I.position.getValue()).height},E="height_point"):I.name=="move_point"?E="move_point":I.GeoType==="point"||I.GeoType==="billboard"||I.GeoType==="label"?(m.tooltip.showAt(T.position,"\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539"),E="move_point"):I.name=="edit_point"?E="edit_point":I.name=="add_point"?E="add_point":I.name=="size_point"&&(E="size_point"),C=I;else{if(x&&I.id===x.id)return;m.endThisEdit()}}else{if(M&&M.id==="modeEditAxis")return;x&&f.callBack&&f.callBack.end&&f.callBack.end(x),m.endThisEdit()}},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(T=>{if(Gi.ExpandBySmartEarth&&(Gi.ExpandBySmartEarth.underEarth.enable||Gi.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}if(Ne.editVector)return;let S=v.scene.pick(T.endPosition);if(m._cesium.defined(S)){if(m.isEditting&&!C){if(Gi.ExpandBySmartEarth&&(Gi.ExpandBySmartEarth.underEarth.enable||Gi.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}(A==="point"||A==="billboard"||A==="label"||A==="model")&&S.id==x?y?m.tooltip.showAt(T.endPosition,A==="model"?"\u53F3\u952E\u5220\u9664":"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E\uFF0C\u53F3\u952E\u5220\u9664"):A!=="model"&&m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E"):S.id&&S.id.name==="edit_point"&&x.pottingPoint?A==="polyline"&&x.pottingPoint.length>2||A==="polygon"&&x.pottingPoint.length>3?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E\uFF0C\u53F3\u952E\u5220\u9664\u70B9"):m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E"):S.id&&(S.id.name==="move_point"||S.id.name==="size_point")?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E"):S.id&&S.id.name==="add_point"?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u589E\u52A0\u8282\u70B9"):S.id&&S.id.name==="height_point"?m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u9AD8\u5EA6"):S.id==x||S.id==="modeEditAxis"?m.tooltip.show(!1):(!S.id||m.SimpleGraphicObj.indexOf(S.id.id)===-1)&&(!f.editProp&&m.isEditting&&(A==="point"||A==="billboard"||A==="label")&&m.endThisEdit(),m.tooltip.show(!1))}else if(!m.isEditting&&Ne.states===0)if(S.id&&m.SimpleGraphicObj.indexOf(S.id.id)>-1)if(f.editProp)m.tooltip.showAt(T.endPosition,`\u70B9\u51FB\u6FC0\u6D3B\u7F16\u8F91${y?"\uFF0C\u53F3\u952E\u5220\u9664":""}`);else{if(S.id.GeoType===void 0){let I=m.getEntityTypeAndObject(S.id);S.id.GeoType=I.type}let M=S.id.GeoType;M==="point"||M==="billboard"||M==="label"?(x=S.id,A=M,m.getSimpleGraphicData(A,x),m.isEditting=!0,m.tooltip.showAt(T.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E")):m.tooltip.showAt(T.endPosition,`\u70B9\u51FB\u6FC0\u6D3B\u7F16\u8F91${y?"\uFF0C\u53F3\u952E\u5220\u9664":""}`)}else m.tooltip.show(!1)}else Ne.states==0&&!C&&(!f.editProp&&m.isEditting&&(A==="point"||A==="billboard"||A==="label")&&m.endThisEdit(),m.tooltip.show(!1));if(m.isEditting&&C){m.tooltip.showAt(T.endPosition,"\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539");let M=m._getPosition.getMousePosition(T,[C,x]);if(!M&&E!=="height_point")return;if(E==="edit_point"){C.position=M;let I=Ne.editPointID.edit.indexOf(C.id);if(x[A].height!==void 0){let R=m.toDegrees(M);x.pottingPoint[I]=Gi.Cartesian3.fromDegrees(R.lon,R.lat,x[A].height.getValue()),C.position=x.pottingPoint[I]}else x.pottingPoint[I]=M;if(Ne.editPointID.height.length>0){let R=v.entities.getById(Ne.editPointID.height[I]);if(R){let O=m.toDegrees(M),F=m._cesium.Cartographic.fromCartesian(R.position.getValue());R.position=m._cesium.Cartesian3.fromDegrees(O.lon,O.lat,F.height)}}if(Ne.editPointID.add.length>0){if(I>0){let R=v.entities.getById(Ne.editPointID.add[I-1]);if(R){let O=v.entities.getById(Ne.editPointID.edit[I-1]),F=v.entities.getById(Ne.editPointID.edit[I]);R.position=Gi.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Gi.Cartesian3)}}if(I<x.pottingPoint.length-1){let R=v.entities.getById(Ne.editPointID.add[I]);if(R){let O=v.entities.getById(Ne.editPointID.edit[I]),F=v.entities.getById(Ne.editPointID.edit[I+1]);R.position=Gi.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Gi.Cartesian3)}}if(A==="polygon"&&(I===0||I===x.pottingPoint.length-1)){let R=v.entities.getById(Ne.editPointID.add[Ne.editPointID.add.length-1]);if(R){let O=v.entities.getById(Ne.editPointID.edit[0]),F=v.entities.getById(Ne.editPointID.edit[x.pottingPoint.length-1]);R.position=Gi.Cartesian3.midpoint(O.position.getValue(),F.position.getValue(),new Gi.Cartesian3)}}}let P=x.pottingPoint.concat([]),D=new m._cesium.Cartesian3,L=P.length;P.forEach(R=>{D.x+=R.x,D.y+=R.y,D.z+=R.z}),D.x/=L,D.y/=L,D.z/=L,Ne.editPointID.move&&(Ne.editPointID.move.position=D),(A==="polyline"||A==="polygon"||A==="rectangle")&&SmartEarthPopupData.editGraphic.setValue("positions",P)}else if(E==="height_point"){let I=Ne.editPointID.height.indexOf(C.id),P=v.entities.getById(Ne.editPointID.edit[I]);(A==="ellipse"||A==="cylinder"||A==="box")&&(P=Ne.editPointID.move);let D=m.toDegrees(P.position.getValue()),L=w.originHeight-D.height,R=v.scene.cartesianToCanvasCoordinates(P.position.getValue()),O=(w.windowPosition.y-T.endPosition.y)*L/Math.abs(R.y-w.windowPosition.y),F=Math.abs(L+O);Ne.editPointID.height.forEach(k=>{let U=v.entities.getById(k);if(U){let G=U.position.getValue(),j=m.toDegrees(G);U.position=m._cesium.Cartesian3.fromDegrees(j.lon,j.lat,F+D.height)}}),x[A].extrudedHeight?x[A].extrudedHeight=new m._cesium.CallbackProperty(function(){return F+D.height},!1):A==="box"?SmartEarthPopupData.editGraphic.setValue("height",F):A==="cylinder"&&SmartEarthPopupData.editGraphic.setValue("length",F),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="extrudedHeight"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="extrudedHeight"]').value=parseFloat(F).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.box input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.box input[name="height"]').value=parseFloat(F).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.cylinder input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.cylinder input[name="height"]').value=parseFloat(F).toFixed(2)),SmartEarthPopupData.window.document.querySelector('.cone input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.cone input[name="height"]').value=parseFloat(F).toFixed(2)))}else if(E==="add_point"){let I=Ne.editPointID.add.indexOf(C.id);v.entities.remove(C);let P=v.entities.add({name:"edit_point",position:M,point:{pixelSize:10,color:Gi.Color.ROYALBLUE,outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(Ne.editPointID.edit.splice(I+1,0,P.id),x.pottingPoint.splice(I+1,0,M.clone()),Ne.editPointID.height.length>0){let k=m.toDegrees(M);k.height=x[A].extrudedHeight.getValue();let U=v.entities.add({name:"height_point",position:m._cesium.Cartesian3.fromDegrees(k.lon,k.lat,k.height),point:{color:m._cesium.Color.YELLOW,pixelSize:12,outlineColor:m._cesium.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.height.splice(I+1,0,U.id)}let D=Gi.Cartesian3.midpoint(x.pottingPoint[I],x.pottingPoint[I+1],new Gi.Cartesian3),L=v.entities.add({name:"add_point",position:m.isClampToGround(x[A])?m.getClampToGroundPosition(D):D,point:{pixelSize:10,color:Gi.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}}),R=Gi.Cartesian3.midpoint(x.pottingPoint[I+1],x.pottingPoint[I+2===x.pottingPoint.length?0:I+2],new Gi.Cartesian3),O=v.entities.add({name:"add_point",position:m.isClampToGround(x[A])?m.getClampToGroundPosition(R):R,point:{pixelSize:10,color:Gi.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.add.splice(I,1,L.id,O.id),C=P,E="edit_point";let F=x.pottingPoint.concat([]);(A==="polyline"||A==="polygon")&&SmartEarthPopupData.editGraphic.setValue("positions",F)}else if(E==="size_point"){let I=Ne.editPointID.move.position.getValue(),P=m._cesium.Cartesian3.distance(I,M);if(A==="ellipse"||A==="cylinder"||A==="ellipsoid"&&x.isSphere)SmartEarthPopupData.editGraphic.setValue("radius",P),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector("."+A+' input[name="radius"]')&&(SmartEarthPopupData.window.document.querySelector("."+A+' input[name="radius"]').value=parseFloat(P).toFixed(2));else if(A==="box"){let D=C.angle===90?"long":"width";SmartEarthPopupData.editGraphic.setValue(D,P*2),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.box input[name="'+D+'"]')&&(SmartEarthPopupData.window.document.querySelector('.box input[name="'+D+'"]').value=parseFloat(P*2).toFixed(2))}}else{if(A==="model")return;if(A==="point"||A==="billboard"||A==="label"){C.position=M,SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector("."+A+' input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector("."+A+' input[name="height"]').value=SmartEarthPopupData.editGraphic.getValue("pHeight").toFixed(2));return}let I=m.toDegrees(M);w=C.position.getValue();let P=m.toDegrees(w),D=I.lon-P.lon,L=I.lat-P.lat,R=I.height-P.height;if(C.position=M,x[A].height){let F=m.toDegrees(M).height;x[A].height=F,x.thisHeight=F}x.pottingPoint.forEach((F,k)=>{let U,G,j,q=v.entities.getById(Ne.editPointID.edit[k]);if(q||(q=v.entities.getById(Ne.editPointID.size[k])),q?U=m.toDegrees(q.position.getValue()):U=m.toDegrees(F),j=m._cesium.Cartesian3.fromDegrees(U.lon+D,U.lat+L,U.height+R),F.x=j.x,F.y=j.y,F.z=j.z,q&&(q.position=j),Ne.editPointID.height.length>0){let J=v.entities.getById(Ne.editPointID.height[k]);J&&(U=J.position.getValue(),G=m._cesium.Cartographic.fromCartesian(U),U={lon:m._cesium.Math.toDegrees(G.longitude),lat:m._cesium.Math.toDegrees(G.latitude),height:G.height},J.position=m._cesium.Cartesian3.fromDegrees(U.lon+D,U.lat+L,U.height+R))}if(Ne.editPointID.add.length>0&&Ne.editPointID.add[k]){let J=v.entities.getById(Ne.editPointID.add[k]);J&&(U=m.toDegrees(J.position.getValue()),J.position=m._cesium.Cartesian3.fromDegrees(U.lon+D,U.lat+L,U.height+R))}});let O=x.pottingPoint.concat([]);if(A==="polyline"||A==="polygon"||A==="rectangle")SmartEarthPopupData.editGraphic.setValue("positions",O),Ne.editPointID.height.length>0&&(SmartEarthPopupData.editGraphic.setValue("extrudedHeight",SmartEarthPopupData.editGraphic.getValue("extrudedHeight")+R),SmartEarthPopupData.window&&x[A].height&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseFloat(x[A].height.getValue()).toFixed(2))),SmartEarthPopupData.window&&x[A].height&&SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]').value=parseFloat(x[A].height.getValue()).toFixed(2));else if(A==="ellipse")x.pottingPoint[1]=M,x.position=M.clone(),SmartEarthPopupData.window&&x[A].height&&SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]').value=parseFloat(x[A].height.getValue()).toFixed(2));else if(A==="box"){x.pottingPoint[2]=M;let F=x.box.dimensions.getValue(),k=m.toDegrees(M);x.position=Gi.Cartesian3.fromDegrees(k.lon,k.lat,k.height+F.z/2)}else if(A==="cylinder"){x.pottingPoint[1]=M;let F=x.cylinder.length.getValue(),k=m.toDegrees(x.pottingPoint[1]);x.position=Gi.Cartesian3.fromDegrees(k.lon,k.lat,k.height+F/2)}else A==="ellipsoid"&&(x.pottingPoint[x.pottingPoint.length-1]=M,x.position=M.clone())}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(T=>{if(Gi.ExpandBySmartEarth&&(Gi.ExpandBySmartEarth.underEarth.enable||Gi.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}Ne.editVector||(C&&f.callBack&&f.callBack.update&&f.callBack.update(C.name,x),v.container.style.cursor="default",C=void 0,m.defaultEvent(!0))},this._cesium.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(T=>{if(Gi.ExpandBySmartEarth&&(Gi.ExpandBySmartEarth.underEarth.enable||Gi.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}if(Ne.editVector)return;let S=v.scene.pick(T.position);if(m._cesium.defined(S)&&Ne.states==0){if(!m._cesium.defined(S.id))return;let M=S.id;if(m.SimpleGraphicObj.indexOf(M.id)>-1&&y)m.tooltip.show(!1),m.delButton(!0,T.position,function(){let I=""+M.id;M.treeobj&&Ne.delete(M.treeobj.id,v,m._cesium),v.entities.removeById(M.id);let P=m.SimpleGraphicObj.indexOf(M.id);m.SimpleGraphicObj.splice(P,1),m.delButton(!1),m.tooltip.show(!1),m.endThisEdit(),m.defaultEdit(),f.callBack&&f.callBack.delete&&f.callBack.delete(I)}),m.copyButton(!0,T.position,function(){m.copyButton(!1),m.delButton(!1),m.copyEntity=M,m.defaultEdit(),f.callBack&&f.callBack.copy&&f.callBack.copy(M)});else if(Ne.editPointID.edit.indexOf(M.id)>-1&&(A==="polyline"&&Ne.editPointID.edit.length>2||A==="polygon"&&Ne.editPointID.edit.length>3)){let I=Ne.editPointID.edit.indexOf(M.id);if(v.entities.removeById(M.id),Ne.editPointID.edit.splice(I,1),Ne.editPointID.height.length>0&&(v.entities.removeById(Ne.editPointID.height[I]),Ne.editPointID.height.splice(I,1)),x.pottingPoint.splice(I,1),Ne.editPointID.add.length>0)if(Ne.editPointID.add[I]){if(v.entities.removeById(Ne.editPointID.add[I]),Ne.editPointID.add.splice(I,1),I-1>=0){let R=v.entities.getById(Ne.editPointID.add[I-1]);R&&(R.position=Gi.Cartesian3.midpoint(x.pottingPoint[I-1],x.pottingPoint[I===x.pottingPoint.length?0:I],new Gi.Cartesian3))}else if(I-1===-1&&A==="polygon"){let R=v.entities.getById(Ne.editPointID.add[Ne.editPointID.add.length-1]);R&&(R.position=Gi.Cartesian3.midpoint(x.pottingPoint[0],x.pottingPoint[x.pottingPoint.length-1],new Gi.Cartesian3))}}else v.entities.removeById(Ne.editPointID.add[I-1]),Ne.editPointID.add.pop();let P=new m._cesium.Cartesian3,D=x.pottingPoint.length;x.pottingPoint.forEach(R=>{P.x+=R.x,P.y+=R.y,P.z+=R.z}),P.x/=D,P.y/=D,P.z/=D,Ne.editPointID.move&&(Ne.editPointID.move.position=P);let L=x.pottingPoint.concat([]);(A==="polyline"||A==="polygon")&&SmartEarthPopupData.editGraphic.setValue("positions",L),m.tooltip.show(!1),f.callBack&&f.callBack.update&&f.callBack.update(C&&C.name,x)}}else m.copyEntity&&m.ZTButton(!0,T.position,function(){let M=v.scene.pickPosition(T.position),I=m.getStyle(m.copyEntity);I.id=m._core.getuid();let P={id:I.id,name:I.name,type:I.type,style:I};m.entiyFeatureMove(P,M,m.copyEntity);let D=m.addFeature(P);m.defaultEdit(),m.ZTButton(!1),f.callBack&&f.callBack.paste&&f.callBack.paste(D)})},this._cesium.ScreenSpaceEventType.RIGHT_DOWN))};ua.prototype.delButton=function(o,f,m){if(o){let v=document.getElementById("DeleteMilitaryStandardDelete");v||(v=document.createElement("button"),v.id="DeleteMilitaryStandardDelete",v.innerText="\u5220\u9664\u5BF9\u8C61",v.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(v)),v.style.display="block",v.style.top=f.y+"px",v.style.left=f.x+"px",v.onclick=m}else{let v=document.getElementById("DeleteMilitaryStandardDelete");v&&(v.style.display="none",v.onclick=null)}};ua.prototype.defaultEvent=function(o){let f=this._viewer.scene;f.screenSpaceCameraController.enableRotate=o,f.screenSpaceCameraController.enableTranslate=o,f.screenSpaceCameraController.enableZoom=o,f.screenSpaceCameraController.enableTilt=o,f.screenSpaceCameraController.enableLook=o};ua.prototype.copyButton=function(o,f,m){if(o){let v=document.getElementById("CopyMilitaryStandardcopy");v||(v=document.createElement("button"),v.id="CopyMilitaryStandardcopy",v.innerText="\u590D\u5236",v.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(v)),v.style.display="block",v.style.top=f.y+40+"px",v.style.left=f.x+"px",v.onclick=m}else{let v=document.getElementById("CopyMilitaryStandardcopy");v&&(v.style.display="none",v.onclick=null)}};ua.prototype.entityMove=function(o,f){let m=o.GeoType,v=that.toDegrees(cartesian);currentPointpos=currentPoint.position.getValue();let y=that.toDegrees(currentPointpos),x=v.lon-y.lon,C=v.lat-y.lat,w=v.height-y.height;geo.pottingPoint.forEach((E,T)=>{let S,M,I,P=viewer.entities.getById(Ne.editPointID.edit[T]);if(P||(P=viewer.entities.getById(Ne.editPointID.size[T])),P?S=that.toDegrees(P.position.getValue()):S=that.toDegrees(E),I=that._cesium.Cartesian3.fromDegrees(S.lon+x,S.lat+C,S.height+w),E.x=I.x,E.y=I.y,E.z=I.z,P&&(P.position=I),Ne.editPointID.height.length>0){let D=viewer.entities.getById(Ne.editPointID.height[T]);D&&(S=D.position.getValue(),M=that._cesium.Cartographic.fromCartesian(S),S={lon:that._cesium.Math.toDegrees(M.longitude),lat:that._cesium.Math.toDegrees(M.latitude),height:M.height},D.position=that._cesium.Cartesian3.fromDegrees(S.lon+x,S.lat+C,S.height+w))}if(Ne.editPointID.add.length>0&&Ne.editPointID.add[T]){let D=viewer.entities.getById(Ne.editPointID.add[T]);D&&(S=that.toDegrees(D.position.getValue()),D.position=that._cesium.Cartesian3.fromDegrees(S.lon+x,S.lat+C,S.height+w))}});let A=geo.pottingPoint.concat([]);if(m==="polyline"||m==="polygon"||m==="rectangle")SmartEarthPopupData.editGraphic.setValue("positions",A),Ne.editPointID.height.length>0&&(SmartEarthPopupData.editGraphic.setValue("extrudedHeight",SmartEarthPopupData.editGraphic.getValue("extrudedHeight")+w),SmartEarthPopupData.window&&geo[m].height&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseFloat(geo[m].height.getValue()).toFixed(2))),SmartEarthPopupData.window&&geo[m].height&&SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.rectangle input[name="height"]').value=parseFloat(geo[m].height.getValue()).toFixed(2));else if(m==="ellipse")geo.pottingPoint[1]=cartesian,geo.position=cartesian.clone(),SmartEarthPopupData.window&&geo[m].height&&SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ellipse input[name="height"]').value=parseFloat(geo[m].height.getValue()).toFixed(2));else if(m==="box"){geo.pottingPoint[2]=cartesian;let E=geo.box.dimensions.getValue(),T=that.toDegrees(cartesian);geo.position=Gi.Cartesian3.fromDegrees(T.lon,T.lat,T.height+E.z/2)}else if(m==="cylinder"){geo.pottingPoint[1]=cartesian;let E=geo.cylinder.length.getValue(),T=that.toDegrees(geo.pottingPoint[1]);geo.position=Gi.Cartesian3.fromDegrees(T.lon,T.lat,T.height+E/2)}else m==="ellipsoid"&&(geo.pottingPoint[geo.pottingPoint.length-1]=cartesian,geo.position=cartesian.clone())};ua.prototype.ZTButton=function(o,f,m){if(o){let v=document.getElementById("ZTMilitaryStandard");v||(v=document.createElement("button"),v.id="ZTMilitaryStandard",v.innerText="\u7C98\u8D34",v.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(v)),v.style.display="block",v.style.top=f.y-40+"px",v.style.left=f.x+"px",v.onclick=m}else{let v=document.getElementById("ZTMilitaryStandard");v&&(v.style.display="none",v.onclick=null),this.copyEntity&&(this.copyEntity=void 0)}};ua.prototype.GetDegreesFromA_D=function(o,f,m,v){let y=6378137,x=6356725,C=m*Math.sin(v*Math.PI/180),w=m*Math.cos(v*Math.PI/180),A=x+(y-x)*(90-f)/90,E=A*Math.cos(f*Math.PI/180),T=(C/E+o*Math.PI/180)*180/Math.PI,S=(w/A+f*Math.PI/180)*180/Math.PI;return[T,S]};ua.prototype.isClampToGround=function(o){return o.heightReference&&o.heightReference.getValue()===1};ua.prototype.getClampToGroundPosition=function(o,f){let m=Gi.Cartographic.fromCartesian(o),v=this._viewer.scene.sampleHeight(m,f);return m.height=v,Gi.Cartographic.toCartesian(m)};ua.prototype.GetPositionFromA_D=function(o,f,m){let v=this.toDegrees(o),y=this.GetDegreesFromA_D(v.lon,v.lat,f,m);return this._cesium.Cartesian3.fromDegrees(y[0],y[1],v.height)};ua.prototype.getEntityTypeAndObject=function(o){let f={type:"",object:null};return o&&(o.billboard?(f.type="billboard",f.object=o.billboard):o.box?(f.type="box",f.object=o.box):o.corridor?(f.type="corridor",f.object=o.corridor):o.cylinder?(f.type="cylinder",f.object=o.cylinder):o.ellipse?(f.type="ellipse",f.object=o.ellipse):o.ellipsoid?(f.type="ellipsoid",f.object=o.ellipsoid):o.label?o.billboard?(f.type="billboard",f.object=o.billboard):(f.type="label",f.object=o.label):o.model?(f.type="model",f.object=o.model):o.path?(f.type="path",f.object=o.path):o.plane?(f.type="plane",f.object=o.plane):o.point?(f.type="point",f.object=o.point):o.polygon?(f.type="polygon",f.object=o.polygon):o.polyline?(f.type="polyline",f.object=o.polyline):o.polylineVolume?(f.type="polylineVolume",f.object=o.polylineVolume):o.rectangle?(f.type="rectangle",f.object=o.rectangle):o.wall&&(f.type="wall",f.object=o.wall)),f};ua.prototype.getSimpleGraphicData=function(o,f){let m=this,v=this._viewer;if(SmartEarthPopupData.editGraphic={entity:f,type:o,graphic:f[o],labelGraphic:f.label,getValue:function(S){if(S==="position"||S==="name"||S==="id"||S==="orientation"||S==="heading"||S==="pitch"||S==="roll")return this.entity[S]&&(this.entity[S].getValue?this.entity[S].getValue():this.entity[S]);if(S==="radius"){if(this.type==="ellipse")return this.graphic.semiMajorAxis.getValue();if(this.type==="ellipsoid")return this.graphic.radii.getValue().x;if(this.type==="cylinder")return this.graphic.bottomRadius.getValue()}else if(S==="pHeight"){if(this.getValue("position")){let M=this.getValue("position");return Gi.Cartographic.fromCartesian(M).height}}else return S==="repeat"?this.graphic.material[S]&&(this.graphic.material[S].getValue?this.graphic.material[S].getValue():this.graphic.material[S]):S.indexOf("label_")>-1?(S=S.replace("label_",""),this.labelGraphic&&this.labelGraphic[S]&&(this.labelGraphic[S].getValue?this.labelGraphic[S].getValue():this.labelGraphic[S])):this.graphic[S]&&(this.graphic[S].getValue?this.graphic[S].getValue():this.graphic[S])},changeHeightPoint:function(S){Ne.editPointID.height.length>0&&Ne.editPointID.height.forEach(M=>{let I=v.entities.getById(M);if(I){let P=I.position.getValue(),D=m.toDegrees(P);I.position=Gi.Cartesian3.fromDegrees(D.lon,D.lat,S)}})},changeEditPoint:function(S){Ne.editPointID.edit.length>0&&Ne.editPointID.edit.forEach(I=>{let P=v.entities.getById(I);if(P)if(S==="clampToGround")P.point.heightReference=1;else{P.point.heightReference=0;let D=P.position.getValue(),L=m.toDegrees(D);P.position=Gi.Cartesian3.fromDegrees(L.lon,L.lat,S)}}),Ne.editPointID.size.length>0&&Ne.editPointID.size.forEach(I=>{let P=v.entities.getById(I);if(P)if(S==="clampToGround")P.point.heightReference=1;else{P.point.heightReference=0;let D=P.position.getValue(),L=m.toDegrees(D);P.position=Gi.Cartesian3.fromDegrees(L.lon,L.lat,S)}}),Ne.editPointID.add.length>0&&Ne.editPointID.add.forEach(I=>{let P=v.entities.getById(I);if(P)if(S==="clampToGround")P.point.heightReference=1;else{P.point.heightReference=0;let D=P.position.getValue(),L=m.toDegrees(D);P.position=Gi.Cartesian3.fromDegrees(L.lon,L.lat,S)}});let M=Ne.editPointID.move;if(M)if(S==="clampToGround")M.point.heightReference=1;else{M.point.heightReference=0;let I=M.position.getValue(),P=m.toDegrees(I);M.position=Gi.Cartesian3.fromDegrees(P.lon,P.lat,S)}},clearAllEditPoint:function(){Ne.editPointID.edit.forEach(S=>{v.entities.removeById(S)}),Ne.editPointID.edit=[],Ne.editPointID.height.forEach(S=>{v.entities.removeById(S)}),Ne.editPointID.height=[],Ne.editPointID.add.forEach(S=>{v.entities.removeById(S)}),Ne.editPointID.add=[],Ne.editPointID.size.forEach(S=>{v.entities.removeById(S)}),Ne.editPointID.size=[],Ne.editPointID.move&&v.entities.remove(Ne.editPointID.move),Ne.editPointID.move=void 0}},o==="billboard"){let S=SmartEarthPopupData.editGraphic.getValue("label_fillColor");S?x(S):(SmartEarthPopupData.editGraphic.lable_fillColor="#00ff00",SmartEarthPopupData.editGraphic.label_alpha=60);let M=SmartEarthPopupData.editGraphic.getValue("label_outlineColor");M?w(M):(SmartEarthPopupData.editGraphic.label_outlineColor="#ffffff",SmartEarthPopupData.editGraphic.label_outlineAlpha=60);let I=SmartEarthPopupData.editGraphic.getValue("label_backgroundColor");I?E(I):(SmartEarthPopupData.editGraphic.label_backgroundColor="#000000",SmartEarthPopupData.editGraphic.label_backgroundAlpha=80)}if(o==="billboard"||o==="point"||o==="label"||o==="model"){let S=SmartEarthPopupData.editGraphic.getValue("color")||SmartEarthPopupData.editGraphic.getValue("fillColor");S?y(S):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let M=SmartEarthPopupData.editGraphic.getValue("outlineColor");if(M?C(M):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),o==="label"){let I=SmartEarthPopupData.editGraphic.getValue("backgroundColor");I?A(I):(SmartEarthPopupData.editGraphic.backgroundColor="#000000",SmartEarthPopupData.editGraphic.backgroundAlpha=80)}SmartEarthPopupData.editGraphic.setValue=function(I,P){if(I==="showLabel"){this.labelGraphic.show=P;return}else if(I==="position"&&this.entity.offset){this.entity.oP=P;let D=Gi.Transforms.eastNorthUpToFixedFrame(this.entity.oP),L=new Gi.Cartesian3(0,0,0);Gi.Matrix4.multiplyByPoint(D,this.entity.offset,L),P=L}else if(I==="offset"){!this.entity.oP&&(this.entity.oP=this.getValue("position")),this.entity.offset=P;let D=Gi.Transforms.eastNorthUpToFixedFrame(this.entity.oP),L=new Gi.Cartesian3(0,0,0);Gi.Matrix4.multiplyByPoint(D,this.entity.offset,L),P=L,I="position"}if(I==="position"||I==="name")this.entity[I]=P;else if(I==="autoRotate"&&this.type==="model")this.entity.heading===void 0&&(this.entity.heading=0,this.entity.pitch=0,this.entity.roll=0),typeof P=="number"?(this.entity.orientation=new Gi.CallbackProperty(()=>(this.entity.heading+=P,this.entity.heading>360&&(this.entity.heading-=360),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').value=this.entity.heading),Gi.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Gi.HeadingPitchRoll(Gi.Math.toRadians(this.entity.heading),Gi.Math.toRadians(this.entity.pitch),Gi.Math.toRadians(this.entity.roll)))),!1),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled=!0),SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled=!0),SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled=!0))):P===!1&&(this.entity.orientation=Gi.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Gi.HeadingPitchRoll(Gi.Math.toRadians(this.entity.heading),Gi.Math.toRadians(this.entity.pitch),Gi.Math.toRadians(this.entity.roll))),SmartEarthPopupData.window&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="heading"]').disabled=!1),SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="pitch"]').disabled=!1),SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]')&&(SmartEarthPopupData.window.document.querySelector('.model input[name="roll"]').disabled=!1)));else if((I==="heading"||I==="pitch"||I==="roll")&&this.type==="model")this.entity[I]=P,this.entity.orientation=Gi.Transforms.headingPitchRollQuaternion(this.getValue("position"),new Gi.HeadingPitchRoll(Gi.Math.toRadians(this.entity.heading),Gi.Math.toRadians(this.entity.pitch),Gi.Math.toRadians(this.entity.roll)));else if(I==="pHeight"){if(this.getValue("position")){let D=this.getValue("position"),L=Gi.Cartographic.fromCartesian(D);L.height=P,this.entity.position=Gi.Cartographic.toCartesian(L);return}}else if(I.indexOf("label_")>-1){if(I=I.replace("label_",""),I==="color"||I==="outlineColor"||I==="backgroundColor"||I==="fillColor")P=Gi.Color.fromCssColorString(P);else if(I==="fontSize"){let D=this.getValue("font");D=D.split(" "),D[0]=P,P=D.join(" ")}else if(I==="alpha"){this.labelGraphic.fillColor._value.alpha=P;return}else if(I==="outlineAlpha"){this.labelGraphic.outlineColor._value.alpha=P;return}else if(I==="backgroundAlpha"){this.labelGraphic.backgroundColor._value.alpha=P;return}this.labelGraphic[I]=P}else{if(I==="color"||I==="outlineColor"||I==="backgroundColor"||I==="fillColor")P=Gi.Color.fromCssColorString(P);else if(I==="fontSize"){let D=this.getValue("font");D=D.split(" "),D[0]=P,P=D.join(" ")}else if(I==="alpha"){this.type==="label"?this.graphic.fillColor._value.alpha=P:this.graphic.color._value.alpha=P;return}else if(I==="outlineAlpha"){this.graphic.outlineColor._value.alpha=P;return}else if(I==="backgroundAlpha"){this.graphic.backgroundColor._value.alpha=P;return}this.graphic[I]=P}}}else if(o==="polyline"){let S=SmartEarthPopupData.editGraphic.getValue("material");S.color?y(S.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60),S.outlineColor?C(S.outlineColor):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(M,I){if(M==="name")this.entity[M]=I;else{if(M==="color"||M==="outlineColor"){I=Gi.Color.fromCssColorString(I),this.graphic.material[M]=I;return}else if(M==="outlineWidth"){this.graphic.material[M]=I;return}else if(M==="alpha"){this.graphic.material.color._value.alpha=I;return}else if(M==="outlineAlpha"){this.graphic.material.outlineColor._value.alpha=I;return}else if(M==="positions"){this.graphic[M]=new Gi.CallbackProperty(function(){return I},!1);return}this.graphic[M]=I}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let M=this.getValue("positions");return this.entity.pottingPoint=M,M},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let M=this.getPottingPoint();if(!M)return;let I=new Gi.Cartesian3;M.forEach((P,D)=>{let L=v.entities.add({name:"edit_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(P):P,point:{pixelSize:10,color:Gi.Color.ROYALBLUE,outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(Ne.editPointID.edit.push(L.id),this.getValue("extrudedHeight")!==void 0){let R=Gi.Cartographic.fromCartesian(P),O={lon:Gi.Math.toDegrees(R.longitude),lat:Gi.Math.toDegrees(R.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let k=Gi.Cartesian3.fromDegrees(O.lon,O.lat,this.getValue("height"));P.x=k.x,P.y=k.y,P.z=k.z,L.position=k,this.entity.pottingPoint[D]=k.clone()}let F=v.entities.add({name:"height_point",position:Gi.Cartesian3.fromDegrees(O.lon,O.lat,O.height),point:{color:Gi.Color.YELLOW,pixelSize:12,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.height.push(F.id)}I.x+=P.x,I.y+=P.y,I.z+=P.z}),I.x/=M.length,I.y/=M.length,I.z/=M.length,Ne.editPointID.move=v.entities.add({name:"move_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(I):I,point:{color:Gi.Color.PURPLE,pixelSize:10,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});for(let P=0;P<M.length-1;P++){let D=Gi.Cartesian3.midpoint(M[P],M[P+1],new Gi.Cartesian3),L=v.entities.add({name:"add_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(D):D,point:{pixelSize:10,color:Gi.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.add.push(L.id)}}}else if(o==="polygon"){let S=SmartEarthPopupData.editGraphic.getValue("material");S.color?y(S.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let M=SmartEarthPopupData.editGraphic.getValue("outlineColor");M?C(M):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(I,P){if(I==="name")this.entity[I]=P;else{if(I==="color"||I==="outlineColor"){if(P=Gi.Color.fromCssColorString(P),I==="color"){this.graphic.material.color=P;return}}else if(I==="image"||I==="repeat"){this.graphic.material[I]=P;return}else if(I==="alpha"){this.graphic.material.color._value.alpha=P;return}else if(I==="outlineAlpha"){this.graphic.outlineColor._value.alpha=P;return}else if(I==="positions"){this.graphic.hierarchy=new Gi.CallbackProperty(function(){return new Gi.PolygonHierarchy(P)},!1);return}else if(I==="hierarchy"){this.graphic.hierarchy=new Gi.CallbackProperty(function(){return P},!1);return}else if(I==="clampToGround"){let D=function(L,R,O){O?(L.perPositionHeight=!1,L.heightReference=Gi.HeightReference.CLAMP_TO_GROUND):(L.perPositionHeight=!0,L.heightReference=Gi.HeightReference.NONE),Ne.editPointID.edit.length>0&&!O&&R.forEach((F,k)=>{let U=v.entities.getById(Ne.editPointID.edit[k]);if(U){let G=U.position.getValue();F.x=G.x,F.y=G.y,F.z=G.z}}),L.hierarchy=new Gi.CallbackProperty(function(){return new Gi.PolygonHierarchy(R)},!1)};this.graphic.hierarchy instanceof Gi.CallbackProperty?(this.graphic.hierarchy=this.graphic.hierarchy.getValue(),setTimeout(()=>{D(this.graphic,this.entity.pottingPoint,P)},100)):D(this.graphic,this.entity.pottingPoint,P);return}else I==="extrudedHeight"?this.changeHeightPoint(P):I==="height"&&this.changeEditPoint(P);this.graphic[I]=P}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let P=this.getValue("hierarchy").positions.concat([]);if(this.getValue("height")!==void 0){let D=this.getValue("height");P.forEach(L=>{let R=m.toDegrees(L),O=Gi.Cartesian3.fromDegrees(R.lon,R.lat,D);L.x=O.x,L.y=O.y,L.z=O.z})}return this.entity.pottingPoint=P,P},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let I=this.getPottingPoint();if(!I)return;let P=new Gi.Cartesian3;I.forEach((R,O)=>{let F=v.entities.add({name:"edit_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(R):R,point:{pixelSize:10,color:Gi.Color.ROYALBLUE,outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(Ne.editPointID.edit.push(F.id),this.getValue("extrudedHeight")!==void 0){let k=Gi.Cartographic.fromCartesian(R),U={lon:Gi.Math.toDegrees(k.longitude),lat:Gi.Math.toDegrees(k.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let j=Gi.Cartesian3.fromDegrees(U.lon,U.lat,this.getValue("height"));R.x=j.x,R.y=j.y,R.z=j.z,F.position=j,this.entity.pottingPoint[O]=j.clone()}let G=v.entities.add({name:"height_point",position:Gi.Cartesian3.fromDegrees(U.lon,U.lat,U.height),point:{color:Gi.Color.YELLOW,pixelSize:12,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.height.push(G.id)}P.x+=R.x,P.y+=R.y,P.z+=R.z}),P.x/=I.length,P.y/=I.length,P.z/=I.length,Ne.editPointID.move=v.entities.add({name:"move_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(P):P,point:{color:Gi.Color.PURPLE,pixelSize:10,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});for(let R=0;R<I.length-1;R++){let O=Gi.Cartesian3.midpoint(I[R],I[R+1],new Gi.Cartesian3),F=v.entities.add({name:"add_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(O):O,point:{pixelSize:10,color:Gi.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.add.push(F.id)}let D=Gi.Cartesian3.midpoint(I[0],I[I.length-1],new Gi.Cartesian3),L=v.entities.add({name:"add_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(D):D,point:{pixelSize:10,color:Gi.Color.ROYALBLUE.withAlpha(.4),outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.4),disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.add.push(L.id)}}else if(o==="ellipse"||o==="cylinder"||f.isSphere){let S=SmartEarthPopupData.editGraphic.getValue("material");S.color?y(S.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let M=SmartEarthPopupData.editGraphic.getValue("outlineColor");M?C(M):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(I,P){if(I==="name")this.entity[I]=P;else{if(I==="color"||I==="outlineColor"){if(P=Gi.Color.fromCssColorString(P),I==="color"){this.graphic.material.color=P;return}}else if(I==="image"||I==="repeat"){this.graphic.material[I]=P;return}else if(I==="alpha"){this.graphic.material.color._value.alpha=P;return}else if(I==="outlineAlpha"){this.graphic.outlineColor._value.alpha=P;return}else if(I==="semiMajorAxis"){this.graphic.semiMajorAxis=new Gi.CallbackProperty(function(){return P},!1);return}else if(I==="semiMinorAxis"){this.graphic.semiMinorAxis=new Gi.CallbackProperty(function(){return P},!1);return}else if(I==="radii"){this.graphic.radii=new Gi.CallbackProperty(function(){return P},!1);return}else if(I==="topRadius"){this.graphic.topRadius=new Gi.CallbackProperty(function(){return P},!1);return}else if(I==="bottomRadius"){this.graphic.bottomRadius=new Gi.CallbackProperty(function(){return P},!1);return}else if(I==="radius"){this.type==="ellipse"?(this.graphic.semiMajorAxis=new Gi.CallbackProperty(function(){return P},!1),this.graphic.semiMinorAxis=new Gi.CallbackProperty(function(){return P},!1)):this.type==="ellipsoid"?this.graphic.material.image.getValue()!==null?this.graphic.radii=new Gi.Cartesian3(P,P,P):this.graphic.radii=new Gi.CallbackProperty(function(){return new Gi.Cartesian3(P,P,P)},!1):this.type==="cylinder"&&(this.graphic.bottomRadius=new Gi.CallbackProperty(function(){return P},!1),this.entity.changeTop&&(this.graphic.topRadius=new Gi.CallbackProperty(function(){return P},!1)));let D=Ne.editPointID.move.position.getValue(),L=m.GetPositionFromA_D(D,P,90),R=v.entities.getById(Ne.editPointID.size[0]);R.position=L,f.pottingPoint[0]=L,f.pottingPoint[f.pottingPoint.length-1]=D;let O=v.entities.getById(Ne.editPointID.height[0]);if(O){let F=m.toDegrees(L),k=m._cesium.Cartographic.fromCartesian(O.position.getValue());O.position=m._cesium.Cartesian3.fromDegrees(F.lon,F.lat,k.height)}return}else if(this.type==="cylinder"&&I==="length"){this.graphic.length=P;let D=m.toDegrees(this.entity.pottingPoint[1]);this.entity.position=Gi.Cartesian3.fromDegrees(D.lon,D.lat,D.height+P/2),this.changeHeightPoint(D.height+P);return}else if(this.type==="ellipse"&&I==="clampToGround"){let D=function(L,R,O){O?(L.thisHeight===void 0&&(L.thisHeight=R.height&&R.height.getValue()),R.height=void 0,R.heightReference=Gi.HeightReference.CLAMP_TO_GROUND):(R.height=L.thisHeight,R.heightReference=Gi.HeightReference.NONE);let F=R.semiMinorAxis.getValue();R.semiMinorAxis=new Gi.CallbackProperty(function(){return F},!1),R.semiMajorAxis=new Gi.CallbackProperty(function(){return F},!1)};this.graphic.semiMinorAxis instanceof Gi.CallbackProperty?(this.graphic.semiMinorAxis=this.graphic.semiMinorAxis.getValue(),this.graphic.semiMajorAxis=this.graphic.semiMajorAxis.getValue(),setTimeout(()=>{D(this.entity,this.graphic,P)},100)):D(this.entity,this.graphic,P),P?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight);return}else this.type==="ellipse"&&I==="extrudedHeight"?this.changeHeightPoint(P):this.type==="ellipse"&&I==="height"&&(this.changeEditPoint(P),this.entity.thisHeight=P);this.graphic[I]=P}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let I=this.getValue("radius"),P=this.getValue("position");if(this.type==="ellipse"||this.entity.isSphere){if(this.type==="ellipse"&&this.getValue("height")!==void 0){let L=this.getValue("height"),R=m.toDegrees(P);P=Gi.Cartesian3.fromDegrees(R.lon,R.lat,L)}let D=m.GetPositionFromA_D(P,I,90);return this.entity.pottingPoint=[D,P],[D,P]}else{let D=m.toDegrees(P);P=Gi.Cartesian3.fromDegrees(D.lon,D.lat,D.height-this.getValue("length")/2);let L=m.GetPositionFromA_D(P,I,90);return this.entity.pottingPoint=[L,P],[L,P]}},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let I=this.getPottingPoint();if(!I)return;let P=v.entities.add({name:"size_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(I[0]):I[0],point:{pixelSize:10,color:Gi.Color.ROYALBLUE,outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(P.angle=90,Ne.editPointID.size.push(P.id),this.getValue("extrudedHeight")!==void 0){let D=m.toDegrees(I[1]);D.height=this.getValue("extrudedHeight");let L=v.entities.add({name:"height_point",position:Gi.Cartesian3.fromDegrees(D.lon,D.lat,D.height),point:{color:Gi.Color.YELLOW,pixelSize:12,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.height.push(L.id)}else if(o==="cylinder"){let D=m.toDegrees(I[1]),L=this.getValue("length"),R=v.entities.add({name:"height_point",position:Gi.Cartesian3.fromDegrees(D.lon,D.lat,D.height+L),point:{color:Gi.Color.YELLOW,pixelSize:12,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.height.push(void 0,R.id)}Ne.editPointID.move=v.entities.add({name:"move_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(I[1]):I[1],point:{color:Gi.Color.PURPLE,pixelSize:10,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}else if(o==="rectangle"){let S=SmartEarthPopupData.editGraphic.getValue("material");S.color?y(S.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let M=SmartEarthPopupData.editGraphic.getValue("outlineColor");M?C(M):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(I,P){if(I==="name")this.entity[I]=P;else{if(I==="color"||I==="outlineColor"){if(P=Gi.Color.fromCssColorString(P),I==="color"){this.graphic.material.color=P;return}}else if(I==="image"||I==="repeat"){this.graphic.material[I]=P;return}else if(I==="alpha"){this.graphic.material.color._value.alpha=P;return}else if(I==="outlineAlpha"){this.graphic.outlineColor._value.alpha=P;return}else if(I==="positions"){this.graphic.coordinates=new Gi.CallbackProperty(function(){return Gi.Rectangle.fromCartesianArray(P)},!1);return}else if(I==="coordinates"){this.graphic.coordinates=new Gi.CallbackProperty(function(){return P},!1);return}else if(I==="clampToGround"){let D=function(L,R,O){O?(L.thisHeight===void 0&&(L.thisHeight=R.height&&R.height.getValue()),R.height=void 0,R.heightReference=Gi.HeightReference.CLAMP_TO_GROUND):(R.height=L.thisHeight,R.heightReference=Gi.HeightReference.NONE);let F=R.coordinates.getValue();R.coordinates=new Gi.CallbackProperty(function(){return F},!1)};this.graphic.coordinates instanceof Gi.CallbackProperty?(this.graphic.coordinates=this.graphic.coordinates.getValue(),setTimeout(()=>{D(this.entity,this.graphic,P)},100)):D(this.entity,this.graphic,P),P?this.changeEditPoint("clampToGround"):this.changeEditPoint(this.entity.thisHeight);return}else I==="extrudedHeight"?this.changeHeightPoint(P):I==="height"&&(this.changeEditPoint(P),this.entity.thisHeight=P);this.graphic[I]=P}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let I=this.getValue("coordinates"),P,D,L=this.getValue("height");return L!==void 0?(P=Gi.Cartesian3.fromRadians(I.west,I.north,L),D=Gi.Cartesian3.fromRadians(I.east,I.south,L)):(L=v.scene.sampleHeight(new Gi.Cartographic(I.west,I.north,0),[this.entity]),P=Gi.Cartesian3.fromRadians(I.west,I.north,L),L=v.scene.sampleHeight(new Gi.Cartographic(I.east,I.south,0),[this.entity]),D=Gi.Cartesian3.fromRadians(I.east,I.south,L)),this.entity.pottingPoint=[P,D],[P,D]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let I=this.getPottingPoint();if(!I)return;let P=new Gi.Cartesian3;I.forEach((D,L)=>{let R=v.entities.add({name:"edit_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(D):D,point:{pixelSize:10,color:Gi.Color.ROYALBLUE,outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});if(Ne.editPointID.edit.push(R.id),this.getValue("extrudedHeight")!==void 0){let O=Gi.Cartographic.fromCartesian(D),F={lon:Gi.Math.toDegrees(O.longitude),lat:Gi.Math.toDegrees(O.latitude),height:this.getValue("extrudedHeight")};if(this.getValue("height")){let U=Gi.Cartesian3.fromDegrees(F.lon,F.lat,this.getValue("height"));D.x=U.x,D.y=U.y,D.z=U.z,R.position=U,this.entity.pottingPoint[L]=U.clone()}let k=v.entities.add({name:"height_point",position:Gi.Cartesian3.fromDegrees(F.lon,F.lat,F.height),point:{color:Gi.Color.YELLOW,pixelSize:12,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.height.push(k.id)}P.x+=D.x,P.y+=D.y,P.z+=D.z}),P.x/=I.length,P.y/=I.length,P.z/=I.length,Ne.editPointID.move=v.entities.add({name:"move_point",position:m.isClampToGround(this.graphic)?m.getClampToGroundPosition(P):P,point:{color:Gi.Color.PURPLE,pixelSize:10,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}else if(o==="box"){let S=SmartEarthPopupData.editGraphic.getValue("material");S.color?y(S.color):(SmartEarthPopupData.editGraphic.fillColor="#00ff00",SmartEarthPopupData.editGraphic.alpha=60);let M=SmartEarthPopupData.editGraphic.getValue("outlineColor");M?C(M):(SmartEarthPopupData.editGraphic.outlineColor="#ffffff",SmartEarthPopupData.editGraphic.outlineAlpha=60),SmartEarthPopupData.editGraphic.setValue=function(I,P){if(I==="name")this.entity[I]=P;else{if(I==="color"||I==="outlineColor"){if(P=Gi.Color.fromCssColorString(P),I==="color"){this.graphic.material.color=P;return}}else if(I==="image"||I==="repeat"){this.graphic.material[I]=P;return}else if(I==="alpha"){this.graphic.material.color._value.alpha=P;return}else if(I==="outlineAlpha"){this.graphic.outlineColor._value.alpha=P;return}else if(I==="long"||I==="width"||I==="height"){let D=this.getValue("dimensions");if(I==="long"?D.x=P:I==="width"?D.y=P:D.z=P,this.graphic.dimensions=new Gi.CallbackProperty(function(){return D},!1),I==="long"||I==="width"){let L=I==="long"?90:180,R=I==="long"?0:1,O=Ne.editPointID.move.position.getValue(),F=m.GetPositionFromA_D(O,P/2,L),k=v.entities.getById(Ne.editPointID.size[R]);k.position=F,this.entity.pottingPoint[R]=F,this.entity.pottingPoint[this.entity.pottingPoint.length-1]=O}else{let L=m.toDegrees(Ne.editPointID.move.position.getValue());this.entity.position=Gi.Cartesian3.fromDegrees(L.lon,L.lat,L.height+P/2),this.changeHeightPoint(L.height+P)}return}else if(I==="dimensions"){this.graphic.dimensions=new Gi.CallbackProperty(function(){return P},!1);return}this.graphic[I]=P}},SmartEarthPopupData.editGraphic.getPottingPoint=function(){let I=this.getValue("dimensions"),P=this.getValue("position"),D=m.toDegrees(P);P=Gi.Cartesian3.fromDegrees(D.lon,D.lat,D.height-I.z/2);let L=m.GetPositionFromA_D(P,I.x/2,90),R=m.GetPositionFromA_D(P,I.y/2,180);return this.entity.pottingPoint=[L,R,P],[L,R,P]},SmartEarthPopupData.editGraphic.updataEditPoint=function(){this.clearAllEditPoint();let I=this.getPottingPoint();if(!I)return;let P=v.entities.add({name:"size_point",position:I[0],point:{pixelSize:10,color:Gi.Color.ROYALBLUE,outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});P.angle=90;let D=v.entities.add({name:"size_point",position:I[1],point:{pixelSize:10,color:Gi.Color.ROYALBLUE,outlineWidth:2,outlineColor:Gi.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});D.angle=180,Ne.editPointID.size.push(P.id),Ne.editPointID.size.push(D.id);let L=m.toDegrees(I[2]),R=this.getValue("dimensions"),O=v.entities.add({name:"height_point",position:Gi.Cartesian3.fromDegrees(L.lon,L.lat,L.height+R.z),point:{color:Gi.Color.YELLOW,pixelSize:12,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}});Ne.editPointID.height.push(void 0,void 0,O.id),Ne.editPointID.move=v.entities.add({name:"move_point",position:I[2],point:{color:Gi.Color.PURPLE,pixelSize:10,outlineColor:Gi.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}else o==="corridor"||o==="ellipsoid"&&f.isSphere;function y(S){SmartEarthPopupData.editGraphic.fillColor=T("rgb("+S.red*255+","+S.green*255+","+S.blue*255+")"),SmartEarthPopupData.editGraphic.alpha=S.alpha*100}function x(S){SmartEarthPopupData.editGraphic.label_fillColor=T("rgb("+S.red*255+","+S.green*255+","+S.blue*255+")"),SmartEarthPopupData.editGraphic.label_alpha=S.alpha*100}function C(S){SmartEarthPopupData.editGraphic.outlineColor=T("rgb("+S.red*255+","+S.green*255+","+S.blue*255+")"),SmartEarthPopupData.editGraphic.outlineAlpha=S.alpha*100}function w(S){SmartEarthPopupData.editGraphic.label_outlineColor=T("rgb("+S.red*255+","+S.green*255+","+S.blue*255+")"),SmartEarthPopupData.editGraphic.label_outlineAlpha=S.alpha*100}function A(S){SmartEarthPopupData.editGraphic.backgroundColor=T("rgb("+S.red*255+","+S.green*255+","+S.blue*255+")"),SmartEarthPopupData.editGraphic.backgroundAlpha=S.alpha*100}function E(S){SmartEarthPopupData.editGraphic.label_backgroundColor=T("rgb("+S.red*255+","+S.green*255+","+S.blue*255+")"),SmartEarthPopupData.editGraphic.label_backgroundAlpha=S.alpha*100}function T(S){let M=S,I=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(M)){let P=M.replace(/(rgb|RGB)*/g,"");P=P.replace("(","").replace(")","");let D=P.split(","),L="#";for(let R=0;R<D.length;R++){let O=Number(D[R]).toString(16);O=O.length===1?0+""+O:O,O==="0"&&(O+=O),L+=O}return L.length!==7&&(L=M),L}else if(I.test(M)){let P=M.replace(/#/,"").split("");if(P.length===6)return M;if(P.length===3){let D="#";for(let L=0;L<P.length;L+=1)D+=P[L]+P[L];return D}}else return M}};ua.prototype.getStyle=function(o){let f,m;m=this.getEntityTypeAndObject(o).type;let v=x("distanceDisplayCondition"),y=x("label_distanceDisplayCondition");if(m==="point")f={id:x("id"),name:x("name"),position:x("position"),pixelSize:x("pixelSize"),scaleByDistance:x("scaleByDistance"),color:x("color")&&x("color").toCssColorString(),outlineWidth:x("outlineWidth"),outlineColor:x("outlineColor")&&x("outlineColor").toCssColorString(),heightReference:x("heightReference"),distanceDisplayCondition:v&&{near:v.near,far:v.far}};else if(m==="billboard"){let C={showLabel:x("label_show"),label_text:x("label_text"),label_font:x("label_font"),label_style:x("label_style"),label_scale:x("label_scale"),label_scaleByDistance:x("label_scaleByDistance"),label_fillColor:x("label_fillColor")&&x("label_fillColor").toCssColorString(),label_outlineColor:x("label_outlineColor")&&x("label_outlineColor").toCssColorString(),label_outlineWidth:x("label_outlineWidth"),label_showBackground:x("label_showBackground"),label_backgroundColor:x("label_backgroundColor")&&x("label_backgroundColor").toCssColorString(),label_horizontalOrigin:x("label_horizontalOrigin"),label_verticalOrigin:x("label_verticalOrigin"),label_heightReference:x("label_heightReference"),label_distanceDisplayCondition:y&&{near:y.near,far:y.far}};f={id:x("id"),name:x("name"),position:x("position"),image:x("image"),scale:x("scale"),scaleByDistance:x("scaleByDistance"),rotation:x("rotation"),width:x("width"),height:x("height"),color:x("color")&&x("color").toCssColorString(),horizontalOrigin:x("horizontalOrigin"),verticalOrigin:x("verticalOrigin"),heightReference:x("heightReference"),distanceDisplayCondition:v&&{near:v.near,far:v.far},...C}}else m==="label"?f={id:x("id"),name:x("name"),position:x("position"),text:x("text"),font:x("font"),style:x("style"),scale:x("scale"),scaleByDistance:x("scaleByDistance"),fillColor:x("fillColor")&&x("fillColor").toCssColorString(),outlineColor:x("outlineColor")&&x("outlineColor").toCssColorString(),outlineWidth:x("outlineWidth"),showBackground:x("showBackground"),backgroundColor:x("backgroundColor")&&x("backgroundColor").toCssColorString(),horizontalOrigin:x("horizontalOrigin"),verticalOrigin:x("verticalOrigin"),heightReference:x("heightReference"),distanceDisplayCondition:v&&{near:v.near,far:v.far}}:m==="model"?f={id:x("id"),name:x("name"),position:x("position"),url:x("uri"),minimumPixelSize:x("minimumPixelSize"),runAnimations:x("runAnimations"),scale:x("scale"),heading:o.heading,pitch:o.pitch,roll:o.roll,color:x("color")&&x("color").toCssColorString(),heightReference:x("heightReference"),distanceDisplayCondition:v&&{near:v.near,far:v.far}}:m==="polyline"?f={id:x("id"),name:x("name"),positions:x("positions"),clampToGround:x("clampToGround"),color:x("material")&&x("material").color.toCssColorString(),outlineWidth:x("material")&&x("material").outlineWidth,outlineColor:x("material")&&x("material").outlineColor.toCssColorString(),width:x("width"),distanceDisplayCondition:v&&{near:v.near,far:v.far}}:m==="polylineVolume"||m==="corridor"||m==="wall"||m==="path"||m==="plane"||(m==="polygon"?f={id:x("id"),name:x("name"),positions:x("hierarchy").positions,color:x("material")&&x("material").color.toCssColorString(),image:x("material")&&x("material").image,repeat:x("material")&&x("material").repeat,outlineColor:x("outlineColor")&&x("outlineColor").toCssColorString(),outline:x("outline"),perPositionHeight:x("perPositionHeight"),height:x("height"),extrudedHeight:x("extrudedHeight"),distanceDisplayCondition:v&&{near:v.near,far:v.far}}:m==="ellipse"?(f={id:x("id"),name:x("name"),position:x("position"),radius:x("radius"),semiMajorAxis:x("semiMajorAxis"),semiMinorAxis:x("semiMinorAxis"),color:x("material")&&x("material").color.toCssColorString(),image:x("material")&&x("material").image,repeat:x("material")&&x("material").repeat,outlineColor:x("outlineColor")&&x("outlineColor").toCssColorString(),outline:x("outline"),height:x("height"),heightReference:x("heightReference"),distanceDisplayCondition:v&&{near:v.near,far:v.far}},m="circle"):m==="rectangle"?f={id:x("id"),name:x("name"),coordinates:x("coordinates"),color:x("material")&&x("material").color.toCssColorString(),image:x("material")&&x("material").image,repeat:x("material")&&x("material").repeat,outlineColor:x("outlineColor")&&x("outlineColor").toCssColorString(),outline:x("outline"),height:x("height"),rotation:x("rotation"),heightReference:x("heightReference"),distanceDisplayCondition:v&&{near:v.near,far:v.far}}:m==="box"?f={id:x("id"),name:x("name"),position:x("position"),dimensions:x("dimensions"),color:x("material")&&x("material").color.toCssColorString(),image:x("material")&&x("material").image,repeat:x("material")&&x("material").repeat,outlineColor:x("outlineColor")&&x("outlineColor").toCssColorString(),outline:x("outline"),distanceDisplayCondition:v&&{near:v.near,far:v.far}}:m==="cylinder"?f={id:x("id"),name:x("name"),position:x("position"),radius:x("radius"),topRadius:x("topRadius"),bottomRadius:x("bottomRadius"),length:x("length"),color:x("material")&&x("material").color.toCssColorString(),image:x("material")&&x("material").image,repeat:x("material")&&x("material").repeat,outlineColor:x("outlineColor")&&x("outlineColor").toCssColorString(),outline:x("outline"),distanceDisplayCondition:v&&{near:v.near,far:v.far},changeTop:o.changeTop}:m==="ellipsoid"&&(f={id:x("id"),name:x("name"),position:x("position"),radius:x("radius"),radii:x("radii"),color:x("material")&&x("material").color.toCssColorString(),image:x("material")&&x("material").image,repeat:x("material")&&x("material").repeat,outlineColor:x("outlineColor")&&x("outlineColor").toCssColorString(),outline:x("outline"),distanceDisplayCondition:v&&{near:v.near,far:v.far},isSphere:o.isSphere}));function x(C){if(C==="position"||C==="name"||C==="id")return o[C]&&(o[C].getValue?o[C].getValue():o[C]);if(C==="radius"){if(m==="ellipse")return o[m].semiMajorAxis.getValue();if(m==="ellipsoid")return o[m].radii.getValue().x;if(m==="cylinder")return o[m].bottomRadius.getValue()}else return C==="repeat"?o[m].material[C]&&(o[m].material[C].getValue?o[m].material[C].getValue():o[m].material[C]):C.indexOf("label_")>-1?(C=C.replace("label_",""),o.label&&o.label[C]&&(o.label[C].getValue?o.label[C].getValue():o.label[C])):o[m][C]&&(o[m][C].getValue?o[m][C].getValue():o[m][C])}return f.type=m,f.propData=this.getPropData(o),f};ua.prototype.addPlotting=function(o){let f=this,m=new f._cesium.EntityCollection;if(o.type==="polygon"&&o.style.extrudedHeight!==void 0?o.type="polyhedron":o.type==="cylinder"&&!o.style.changeTop?o.type="cone":o.type==="ellipsoid"&&o.style.isSphere&&(o.type="sphere"),!(o.style&&o.style.id&&f.SimpleGraphicObj.indexOf(o.style.id)>-1)){let v=f.addSimpleGraphic(o.type,o.style,o.treeobj);!o.removeEdit&&f.SimpleGraphicObj.push(v.id),m.add(v)}};ua.prototype.addFeatures=function(o){let f=new this._cesium.EntityCollection;return o.forEach(m=>{if(m){let v=this.addFeature(m);v&&f.add(v)}}),f};ua.prototype.addFeature=function(o){if(o.type==="polygon"&&o.style.extrudedHeight!==void 0&&(o.type="polyhedron"),o.type==="cylinder"&&!o.style.changeTop?o.type="cone":o.type==="ellipsoid"&&o.style.isSphere&&(o.type="sphere"),!(o.style&&o.style.id&&this.SimpleGraphicObj.indexOf(o.style.id)>-1))return this.addSimpleGraphic(o.type,o.style)};ua.prototype.open=function(o,f=!1,m=!0,v){if(!o)return;let y=this,x=this._viewer;if(f){let w=o.features,A=y.addFeatures(w);return m&&x.flyTo(A),v&&typeof v=="function"&&v(A),A}let C=new FileReader;C.readAsText(o),C.onload=function(){let A=JSON.parse(this.result).features,E=y.addFeatures(A);m&&x.flyTo(E),v&&typeof v=="function"&&v(E)}};ua.prototype.ImportPlotting=function(o,f){let m=this,v=this._viewer,y=new FileReader;y.readAsText(o),y.onload=function(){let C=JSON.parse(this.result).features,w=m.addFeatures(C);v.flyTo(w),f&&typeof f=="function"&&f(w)}};ua.prototype.analysisJson=function(o,f){this.featuresPlotting=[];for(let v=0;v<o.length;v++)o[v]instanceof Array?this.analysisJson(o[v]):this.ScreenPlotting(o[v]);let m=that.addFeatures(featuresPlotting);viewer.flyTo(m),f&&typeof f=="function"&&f(m)};ua.prototype.ScreenPlotting=function(o){o.treeobj.type.indexOf("Plotting")!=-1&&this.featuresPlotting.push(o)};var gle=[];ua.prototype.createsj=function(o){let f=0,m="";if(o.style.pId!=0)for(let y=0;y<gle.length;y++)gle[y].id===o.style.pId&&(f=gle[y].real);o.type==="group"?m=this._createGroup.createGroup(o.style.name,!1,f):o.treeData?(o.treeData.GroupID=f,this.CreateLayer(o)):this.addPlotting(o);let v={pid:f,real:m,id:o.style.id};gle.push(v)};ua.prototype.CreateLayer=function(o){let f=o.treeData.geoOptions.styletype,m=o.treeData.geoOptions.servertype;f===void 0&&(f="polygonbase"),m===void 0&&(m="geojson"),o.treeobj.pId&&(o.treeData.GroupID=o.treeobj.pId);let v;f=="billboardlayer"?m=="vector"?v=this._billboardGeoJsonFeatureLayer.createBillboardGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._GeoJsonFeatureLayer.createBillboardGeoJsonFeature(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="labellayer"?m=="vector"?o.treeData.styleOption.textType=="rich"||(o.treeData.styleOption.heightReference==1&&(o.treeData.styleOption.heightReference=void 0),v=this._LabelGeoJsonFeatureLayercopy.createPrimitiveLabelGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc)):o.treeData.styleOption.collect?v=this._LabelGeoJsonFeatureLayercopy.createLabelPolymerizationGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):o.treeData.styleOption.textType=="rich"?v=this._LabelGeoJsonFeatureLayercopy.createLabelRichtextGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._LabelGeoJsonFeatureLayercopy.createLabelPointGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="SXTLabellayer"?m=="vector"&&(o.treeData.styleOption.textType=="rich"||(v=this._LabelGeoJsonFeatureLayercopy.createSXTLabelGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc))):f=="pointlayer"?m=="vector"?v=this._VectorGeoJsonFeatureLayer.createPointGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):o.treeData.styleOption.collect?v=this._LabelGeoJsonFeatureLayercopy.createPointPolymerizationGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._GeoJsonFeatureLayer.createPointGeojsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="Streetscape"?m=="vector"?v=this._PolylineGeoJsonFeatureLayer.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):(o.treeData.styleOption.opacity&&o.treeData.styleOption.material&&o.treeData.styleOption.material.indexOf("#")>-1&&!o.treeData.styleOption.opacity==1&&(o.treeData.styleOption.material+=o.treeData.styleOption.opacity*100),v=this._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc)):f=="polylinelayer"?m=="vector"?v=this._PolylineGeoJsonFeatureLayer.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._GeoJsonFeatureLayer.createStreetscapeGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="polylinemodellayer"?m=="vector"?v=this._PolylineGeoJsonFeatureLayer.createPolylineVectorGeoJsonFeatureLayerProviderModel(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._PointModel.exectPointModel(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="polygonmodellayer"?m=="vector"?v=this._PolygonGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayerProviderModel(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._PointModel.createPolygonModel(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="polygonbase"?m=="vector"?o.treeData.styleOption.ground=="1"?(o.treeData.styleOption.extrudedHeightReference=1,v=this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc)):v=this._VectorGeoJsonFeatureLayer.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):o.treeData.styleOption.material&&o.treeData.styleOption.material.indexOf(".jpg")!=-1?v=this._GeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="polygonlayer"?m=="vector"?(o.treeData.styleOption.classificationType=0,o.treeData.styleOption.classificationType==0?v=this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderOptimization(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):(o.treeData.styleOption.classificationType=2,o.treeData.styleOption.ground="1",v=this._VectorGeoJsonFeatureLayer.createGeoJsonFeatureLayerProviderClassOptimization(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc))):o.treeData.styleOption.material&&o.treeData.styleOption.material.indexOf(".jpg")!=-1?v=this._PolygonVectorTileLayerArcgis.createPolygonMapGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._GeoJsonFeatureLayer.createPolygonGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="modellayer"?m=="vector"?v=this._VectorGeoJsonFeatureLayer.createModelGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._GeoJsonFeatureLayer.createModelPointGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="polylinevolumelayer"?m=="vector"?v=this._VolumeGeoJsonFeatureLayer.createVolumeGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._GeoJsonFeatureLayer.createpolylineVolumeGeojsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="polylineWallLayer"?m=="vector"?v=this._WallGeoFeatureLayer.createWallGeoJsonFeatureLayerProvider(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):v=this._GeoJsonFeatureLayer.createWallGeoFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="primiviteModels"?v=this._PolygonVectorGeoJsonFeatureLayer.createPolygonVectorGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.styleOption.level_max,o.treeData.styleOption.level_min,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc):f=="primiviteWall"?m=="vector"||(v=this._WallGeoFeatureLayer.createWallPrimitiveGeoFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc)):f=="model"||f=="pointcloudmodel"||f=="rasterlayer"||(v=this._GeoJsonFeatureLayer.createGeoJsonFeatureLayer(o.treeData.name,o.treeData.geoOptions,o.treeData.styleOption,o.treeData.GroupID,o.treeData.checked,o.treeData.disFnc))};ua.prototype.remove=function(o){let f=this._viewer,m=this.SimpleGraphicObj.indexOf(o);m>-1&&(f.entities.removeById(o),this.SimpleGraphicObj.splice(m,1),SmartEarthPopupData&&SmartEarthPopupData.editGraphic&&SmartEarthPopupData.editGraphic.getValue&&SmartEarthPopupData.editGraphic.getValue("id")===o&&(Ne.editPointID.edit.forEach(v=>{f.entities.removeById(v)}),Ne.editPointID.edit=[],Ne.editPointID.height.forEach(v=>{f.entities.removeById(v)}),Ne.editPointID.height=[],Ne.editPointID.add.forEach(v=>{f.entities.removeById(v)}),Ne.editPointID.add=[],Ne.editPointID.size.forEach(v=>{f.entities.removeById(v)}),Ne.editPointID.size=[],Ne.editPointID.move&&f.entities.remove(Ne.editPointID.move),Ne.editPointID.move=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={})),this.defaultEdit()};ua.prototype.clear=function(){let o=this._viewer;this.SimpleGraphicObj.forEach(f=>{o.entities.removeById(f)}),this.SimpleGraphicObj=[],this.PrimitiveCollection.removeAll(),Ne.editPointID.edit.forEach(f=>{o.entities.removeById(f)}),Ne.editPointID.edit=[],Ne.editPointID.height.forEach(f=>{o.entities.removeById(f)}),Ne.editPointID.height=[],Ne.editPointID.add.forEach(f=>{o.entities.removeById(f)}),Ne.editPointID.add=[],Ne.editPointID.size.forEach(f=>{o.entities.removeById(f)}),Ne.editPointID.size=[],Ne.editPointID.move&&o.entities.remove(Ne.editPointID.move),Ne.editPointID.move=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},this.defaultEdit()};ua.prototype.save=function(o="\u6807\u7ED8",f=!1,m){let v=this._viewer,y={type:"FeatureCollection",features:[]},x,C=this;if(m){let E=C.getStyle(m);x={id:item.id,name:item.name,type:E.type,style:E},y.features.push(x)}else this.SimpleGraphicObj.forEach(E=>{let T=v.entities.getById(E);if(T){let S=C.getStyle(T);x={id:T.id,name:T.name,type:S.type,style:S}}y.features.push(x)});if(f)return y;let w=JSON.stringify(y),A=new Blob([w],{type:"text/plain;charset=utf-8"});this._core.saveAs(A,o+".json")};ua.prototype.entiyFeatureMove=function(o,f){if(o.style){if(o.style.position)o.style.position=f;else if(o.style.positions){let m=o.style.positions,v={x:0,y:0,z:0};for(let A in m){let E=m[A];v.x+=E.x,v.y+=E.y,v.z+=E.z}v.x/=m.length,v.y/=m.length,v.z/=m.length;let y=f.x-v.x,x=f.y-v.y,C=f.z-v.z,w=[];o.style.positions.forEach(A=>{let E={x:A.x+y,y:A.y+x,z:A.z+C};w.push(E)}),o.style.positions=w}else if(o.style.coordinates){let m=Gi.Cartographic.fromCartesian(f),v=Gi.Rectangle.center(o.style.coordinates),y=m.longitude-v.longitude,x=m.latitude-v.latitude;o.style.coordinates={west:o.style.coordinates.west+y,south:o.style.coordinates.south+x,east:o.style.coordinates.east+y,north:o.style.coordinates.north+x},o.style.height&&(o.style.height=m.height)}}this.copyButton(!1)};ua.prototype.setRichtext=function(o,f){let m=o.position.getValue();this._viewer.entities.removeById(o.id);let v="0";o.treeobj&&(Ne.delete(o.treeobj.id,this._viewer,this._cesium),v=o.treeobj.pId);let y=new C8(this._viewer);return y.createDivPoint(o.name,m,{id:o.id,description:f,GroupID:v}),y};ua.prototype.forceEndHanlder=function(){if(this.editHandler)try{this.editHandler.destroy(),this.editHandler=void 0}catch{}if(this.drawHandler)try{this.drawHandler.destroy(),this.drawHandler=void 0}catch{}};var P8=ua;var Sct=`// author: \u5F20\u4E39\u948A uniform vec4 u_moveColor; uniform vec4 u_lineColor; #define PI_OVER_TWO 1.5707963 czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput); float iTime = czm_frameNumber / 60.0 * {speed}; vec2 uv = materialInput.st; vec4 finalColor = u_lineColor; float dt = clamp(tan(uv.x * 5.0 - iTime * 1.0) * 0.3 - 0.1, 0.5, PI_OVER_TWO); finalColor = mix(finalColor, u_moveColor, dt); float alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0); material.diffuse = finalColor.xyz; material.alpha = alpha; return material; }`;var zf=null;function bA(o,f){zf=f,this._viewer=o,this.PrimitiveCollection=[],this.lineColor=zf.Color.fromCssColorString("#330066").withAlpha(.8),this.pointColor=zf.Color.fromCssColorString("#CCFFFF").withAlpha(1)}bA.prototype.create=function(o={}){this.position=o.position||void 0,this.positions=o.positions||void 0,this.linewidth=o.width||void 0,this.near=o.near,this.far=o.far,this._speed=o.speed,zf.defined(this._speed)||(this._speed=1),this._id=o.id,o.color&&(this.lineColor=zf.Color.fromCssColorString(o.color)),o.pointColor&&(this.pointColor=zf.Color.fromCssColorString(o.pointColor)),this.getShader(),this.collection=new zf.PrimitiveCollection,this.collection._guid=this._id,this._viewer.scene.primitives.add(this.collection),this.PrimitiveCollection.push(this.collection),this.addPathLayer()};bA.prototype.addPathLayer=async function(){this.position?this.getInstance():this.positions&&this.getInstances(),this.instances.forEach(o=>{this.addGroundLine(o)})};bA.prototype.getById=function(o){for(var f=null,m=this._viewer.scene.primitives,v=m.length,y=0;y<v;y++){var x=m.get(y);x._guid===o&&(f=x)}return f};bA.prototype.remove=function(o){var f=this.getById(o);f&&this._viewer.scene.primitives.remove(f)};bA.prototype.removeAll=function(){for(var o=0;o<this.PrimitiveCollection.length;o++){var f=this.PrimitiveCollection[o];this._viewer.scene.primitives.remove(f)}this.PrimitiveCollection=[]};bA.prototype.show=function(o){for(var f=0;f<this.PrimitiveCollection.length;f++){var m=this.PrimitiveCollection[f];m.show=o}};bA.prototype.getInstance=function(){let o;this.position[0]instanceof zf.Cartesian3?o=this.position:o=zf.Cartesian3.fromDegreesArray(this.position);let f=new zf.GroundPolylineGeometry({positions:o,width:this.linewidth,vertexFormat:zf.PolylineColorAppearance.VERTEX_FORMAT});this.instances=new zf.GeometryInstance({geometry:f,attributes:{distanceDisplayCondition:new zf.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}})};bA.prototype.getInstances=function(){this.instances=[];for(let o=0;o<this.positions.length;o++){let f;this.positions[o][0]instanceof zf.Cartesian3?f=this.positions[o]:f=zf.Cartesian3.fromDegreesArray(this.positions[o]);let m=new zf.GeometryInstance({geometry:new zf.GroundPolylineGeometry({positions:f,width:this.linewidth,vertexFormat:zf.PolylineColorAppearance.VERTEX_FORMAT}),attributes:{distanceDisplayCondition:new zf.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}});this.instances.push(m)}};bA.prototype.addGroundLine=async function(o){let f=new zf.GroundPolylinePrimitive({geometryInstances:o,appearance:new zf.MaterialAppearance({material:new zf.Material({fabric:{source:this.fs,uniforms:{u_moveColor:this.pointColor,u_lineColor:this.lineColor}}})})});this.collection.add(f)};bA.prototype.addLine=function(){var o=new zf.PolylineMaterialAppearance({material:new zf.Material({fabric:{source:this.fs,uniforms:{u_moveColor:this.pointColor,u_lineColor:this.lineColor}}})});let f=new zf.Primitive({geometryInstances:this.instances,appearance:o});this.collection.add(f)};bA.prototype.getShader=function(){this.fs=Sct.replace("{speed}",this._speed.toFixed(1))};var Pct=bA;var Ict=`// author: \u5F20\u4E39\u948A uniform vec4 u_moveColor; uniform vec4 u_wallColor; #define PI_OVER_TWO 1.5707963 czm_material czm_getMaterial(czm_materialInput materialInput){ czm_material material = czm_getDefaultMaterial(materialInput); float iTime = czm_frameNumber / 60.0 * {speed}; vec2 uv = materialInput.st; vec4 finalColor = u_wallColor; float dt = clamp(tan(uv.y * 5.0 - iTime) * 0.3 - 0.1, 0.5, PI_OVER_TWO); finalColor = mix(finalColor, u_moveColor, dt); float alpha = pow(finalColor.w * (1.0 - abs(uv.y - 0.5)), 2.0); if(uv.y < 0.5){ alpha = 1.0; finalColor = u_wallColor; if(uv.y > 0.4){ alpha = (0.5 - uv.y) * 5.0 + 0.5; } } material.diffuse = finalColor.xyz; material.alpha = alpha; return material; }`;var N_=null;function PP(o,f){N_=f,this._viewer=o,this.PrimitiveCollection=[],this.color=N_.Color.BLUE}PP.prototype.create=function(o={}){this.position=o.position||void 0,this.positions=o.positions||void 0,this.height=o.height||50,this.minHeight=o.minHeight,this.near=o.near,this.far=o.far,this._speed=o.speed||1,this._id=o.id,o.color&&(this.color=N_.Color.fromCssColorString(o.color)),this.getShader(),this.collection=new N_.PrimitiveCollection,this.collection._guid=this._id,this._viewer.scene.primitives.add(this.collection),this.position?this.getInstance():this.positions&&this.getInstances(),this.addWall(),this.PrimitiveCollection.push(this.collection)};PP.prototype.getById=function(o){for(var f=null,m=this._viewer.scene.primitives,v=m.length,y=0;y<v;y++){var x=m.get(y);x._guid===o&&(f=x)}return f};PP.prototype.remove=function(o){var f=this.getById(o);f!=null&&this._viewer.scene.primitives.remove(f)};PP.prototype.removeAll=function(){for(var o=0;o<this.PrimitiveCollection.length;o++){var f=this.PrimitiveCollection[o];this._viewer.scene.primitives.remove(f)}this.PrimitiveCollection=[]};PP.prototype.show=function(o){for(var f=0;f<this.PrimitiveCollection.length;f++){var m=this.PrimitiveCollection[f];m.show=o}};PP.prototype.getInstance=function(){let o;this.position[0]instanceof N_.Cartesian3?o=this.position:o=N_.Cartesian3.fromDegreesArray(this.position);let f=Array(o.length).fill(this.height),m=Array(o.length).fill(this.minHeight||0),v=new N_.WallGeometry({positions:o,maximumHeights:f,minimumHeights:m});this.instances=[new N_.GeometryInstance({geometry:v,attributes:{distanceDisplayCondition:new N_.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}})]};PP.prototype.getInstances=function(){this.instances=[];for(let o=0;o<this.positions.length;o++){let f;this.positions[o][0]instanceof N_.Cartesian3?f=this.positions[o]:f=N_.Cartesian3.fromDegreesArray(this.positions[o]);let m=Array(f.length).fill(this.height),v=Array(f.length).fill(this.minHeight||0),y=new N_.GeometryInstance({geometry:new N_.WallGeometry({positions:f,maximumHeights:m,minimumHeights:v}),attributes:{distanceDisplayCondition:new N_.DistanceDisplayConditionGeometryInstanceAttribute(this.near,this.far)}});this.instances.push(y)}};PP.prototype.addWall=async function(){this.instances.forEach(o=>{let f=new N_.Primitive({geometryInstances:o,appearance:new N_.MaterialAppearance({material:new N_.Material({fabric:{source:this.fs,uniforms:{u_wallColor:this.color.withAlpha(.5),u_moveColor:this.color}}})})});this.collection.add(f)})};PP.prototype.getShader=function(){this.fs=Ict.replace("{speed}",this._speed.toFixed(1))};var Mct=PP;var yd=null;function lx(o,f){yd=f,this._viewer=o,this._cesium=f,this._Color=new no(this._viewer,this._cesium),this._core=new Sr(o,f),this._getPosition=new Ru(this._viewer,this._cesium),this._tree=Ne,this._polylines=[],this.Streamerpath=new Pct(this._viewer,this._cesium),this.Streamerwall=new Mct(this._viewer,this._cesium)}lx.prototype.createPathLayer=function(o={}){var f={color:o.color||"#0033FF",width:o.width||5,pointColor:o.pointColor||"#FFFFFF",id:o.id||this._core.getuid(),near:o.near,far:o.far,speed:o.speed||1};let m=yd.GeoJsonDataSource.load(o.url),v=[],y=[];m.then(C=>{let w=C.entities.values;for(let A=0;A<w.length;A++){let E=w[A];E.polyline?(y.push(E.polyline.positions.getValue()),v=v.concat(y[y.length-1])):E.polygon&&(y.push(E.polygon.hierarchy.getValue().positions),v=v.concat(y[y.length-1]))}this.boundingSphere=yd.BoundingSphere.fromPoints(v),v=null,this.Streamerpath.create({positions:y,...f})}),this.updateLayer=(C={})=>{f=this._core.extend(f,C,!0,!0),this.Streamerpath.removeAll(),this.Streamerpath.create({positions:y,...f})};var x={id:f.id,name:"\u65B0\u5EFA\u6D41\u5149\u7EBF\u56FE\u5C42",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,0),this};lx.prototype.createWallLayer=function(o={}){var f={color:o.color||"#0000ff",id:o.id||this._core.getuid(),speed:o.speed,height:o.height,minHeight:o.minHeight,near:o.near,far:o.far};let m=yd.GeoJsonDataSource.load(o.url),v=[],y=[];m.then(C=>{let w=C.entities.values;for(let A=0;A<w.length;A++){let E=w[A];E.polyline?(y.push(E.polyline.positions.getValue()),v=v.concat(y[y.length-1])):E.polygon&&(y.push(E.polygon.hierarchy.getValue().positions),v=v.concat(y[y.length-1]))}this.boundingSphere=yd.BoundingSphere.fromPoints(v),v=null,this.Streamerwall.create({positions:y,...f})}),this.updateLayer=(C={})=>{f=this._core.extend(f,C,!0,!0),this.Streamerwall.removeAll(),this.Streamerwall.create({positions:y,...f})};var x={id:f.id,name:"\u65B0\u5EFA\u6D41\u52A8\u5899\u56FE\u5C42",pId:0,type:"TrailLineLayer",item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,0),this};lx.prototype.createPath=function(o,f,m){!m&&(m={}),typeof m=="number"&&(m={time:m});var v={time:3e3,LineColor:this._core.defaultValue(m.color,"#ff0000"),LinkImage:this._core.defaultValue(m.url,window.SmartEarthRootUrl+pn.TrailLine),height:5e4,num:100,width:2,LightSpot:!1,alpha:.3};v=this._core.extend(v,m,!0);var y=Gae({Cesium:yd,color:yd.Color.fromCssColorString(v.LineColor),image:v.LinkImage,time:v.time,alpha:v.alpha,lightSpot:v.LightSpot,lightSpotColor:yd.Color.fromCssColorString(v.lightSpotColor||v.LineColor),twoColor:!!v.twoColor,color1:v.twoColor&&v.twoColor.color1&&yd.Color.fromCssColorString(v.twoColor.color1),color2:v.twoColor&&v.twoColor.color2&&yd.Color.fromCssColorString(v.twoColor.color2)});let x=new yd.PrimitiveCollection;this._viewer.scene.primitives.add(x),this._polylines.push(x);let C=m.inflow,w,A;for(var E=0;E<f.length;E++){C?(w=f[E],A=o):(A=f[E],w=o);for(var T=this.parabolaEquation({pt1:w,pt2:A,height:v.height,num:v.num}),S=[],M=0;M<T.length;M++)S.push(T[M][0],T[M][1],T[M][2]);x.add(this.getPolylinePrimitive(S,y,v))}this.pathMaterial=y;var I={id:this._core.getuid(),name:"\u65B0\u5EFA\u6D41\u52A8\u8DEF\u5F84",pId:0,type:"TrailLinePrimitive",item:this};return this.setTreeobj(I),this._tree.insertGroupId(I,0),this};lx.prototype.getPolylinePrimitive=function(o,f,m={}){let v=m.clampToGround?yd.GroundPolylineGeometry:yd.PolylineGeometry,y=new v({positions:typeof o[0]=="object"?o:yd.Cartesian3.fromDegreesArrayHeights(o),width:m.width}),x=new yd.GeometryInstance({geometry:y,attributes:{distanceDisplayCondition:new yd.DistanceDisplayConditionGeometryInstanceAttribute(m.near,m.far)}}),C=m.clampToGround?yd.GroundPolylinePrimitive:yd.Primitive;return new C({geometryInstances:x,appearance:new yd.PolylineMaterialAppearance({material:f})})};lx.prototype.createFlyingLine=function(o,f={}){var m={time:3e3,color:"#ffffff",width:1,alpha:0};m=this._core.extend(m,f,!0);var v=Gae({Cesium:yd,lightSpotColor:yd.Color.fromCssColorString(m.color),time:m.time,alpha:m.alpha,lightSpot:!0});let y=new yd.PrimitiveCollection;this._viewer.scene.primitives.add(y),this._polylines.push(y);let x;o.forEach(w=>{x=[w.lon,w.lat,m.minHeight,w.lon,w.lat,w.height],y.add(this.getPolylinePrimitive(x,v,m))});var C={id:this._core.getuid(),name:"\u65B0\u5EFA\u5782\u76F4\u98DE\u7EBF",pId:0,type:"TrailLinePrimitive",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,0),this};lx.prototype.createLine=function(o,f){!f&&(f={}),typeof f=="number"&&(f={time:f});var m={time:3e3,LineColor:this._core.defaultValue(f.color,"#ff0000"),LinkImage:this._core.defaultValue(f.url,window.SmartEarthRootUrl+pn.TrailLine),height:5e4,width:10,LightSpot:!1,alpha:.3};m=this._core.extend(m,f,!0);var v=Gae({Cesium:yd,color:yd.Color.fromCssColorString(m.LineColor),image:m.LinkImage,time:m.time,alpha:m.alpha,lightSpot:m.LightSpot,lightSpotColor:yd.Color.fromCssColorString(m.lightSpotColor||m.LineColor),twoColor:!!m.twoColor,color1:m.twoColor&&m.twoColor.color1&&yd.Color.fromCssColorString(m.twoColor.color1),color2:m.twoColor&&m.twoColor.color2&&yd.Color.fromCssColorString(m.twoColor.color2)}),y=[];if(!o[0].x&&!o[0].y){if(o[0].length===2)for(var x=0;x<o.length;x++)y.push(this._cesium.Cartesian3.fromDegrees(o[x][0],o[x][1]));else if(o[0].length===3)for(var x=0;x<o.length;x++)y.push(this._cesium.Cartesian3.fromDegrees(o[x][0],o[x][1],o[x][2]))}else if(o[0].z!==void 0)if(o[0].x>=-180&&o[0].x<=180)for(var x=0;x<o.length;x++)y.push(this._cesium.Cartesian3.fromDegrees(o[x].x,o[x].y,o[x].z));else y=o;else for(var x=0;x<o.length;x++)y.push(this._cesium.Cartesian3.fromDegrees(o[x].x,o[x].y));let C=this._viewer.scene.primitives.add(this.getPolylinePrimitive(y,v,m));this._polylines.push(C);var w={id:this._core.getuid(),name:"\u65B0\u5EFA\u6D41\u52A8\u7EBF",pId:0,type:"TrailLinePrimitive",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,0),this};lx.prototype.createWall=function(o,f){var m=this;!f&&(f={}),typeof f=="number"&&(f={time:f});var v={time:9e3,LineColor:this._core.defaultValue(f.color,this._cesium.Color.ORANGE),LinkImage:this._core.defaultValue(f.url,window.SmartEarthRootUrl+pn.colors3)};v=this._core.extend(v,f,!0);var y=new bD(v.LineColor,v.LinkImage,v.time||9e3,m._cesium),x=[];if(!o[0].x&&!o[0].y){if(o[0].length===2)for(var C=0;C<o.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(o[C][0],o[C][1]));else if(o[0].length===3)for(var C=0;C<o.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(o[C][0],o[C][1],o[C][2]))}else if(o[0].z!==void 0)if(o[0].x>=-180&&o[0].x<=180)for(var C=0;C<o.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(o[C].x,o[C].y,o[C].z));else x=o;else for(var C=0;C<o.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(o[C].x,o[C].y));this._polylines.push(this._viewer.entities.add({name:"WallTrail",wall:{positions:x,material:y,maximumHeights:v.maximumHeights,minimumHeights:v.minimumHeights}}));var w={id:this._core.getuid(),name:"\u65B0\u5EFA\u6D41\u52A8\u5899",pId:0,type:"TrailLinePrimitive",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,0),this};lx.prototype.parabolaEquation=function(o,f){var m=this._core.defaultValue(o.height,5e3),v=Math.abs(o.pt1.lon-o.pt2.lon)>Math.abs(o.pt1.lat-o.pt2.lat)?Math.abs(o.pt1.lon-o.pt2.lon):Math.abs(o.pt1.lat-o.pt2.lat),y=o.num&&o.num>50?o.num:50,x=[],C=v/y,w=o.pt1.height||0,A=o.pt2.height||0;if(Math.abs(o.pt1.lon-o.pt2.lon)>Math.abs(o.pt1.lat-o.pt2.lat)){var E=(o.pt2.lat-o.pt1.lat)/y;o.pt1.lon-o.pt2.lon>0&&(C=-C);for(var T=0;T<=y;T++){var S=m-Math.pow(-.5*v+Math.abs(C)*T,2)*4*m/Math.pow(v,2)+w+(A-w)*T/y,M=o.pt1.lon+C*T,I=o.pt1.lat+E*T;x.push([M,I,S])}}else{var P=(o.pt2.lon-o.pt1.lon)/y;o.pt1.lat-o.pt2.lat>0&&(C=-C);for(var T=0;T<=y;T++){var S=m-Math.pow(-.5*v+Math.abs(C)*T,2)*4*m/Math.pow(v,2)+w+(A-w)*T/y,M=o.pt1.lon+P*T,I=o.pt1.lat+C*T;x.push([M,I,S])}}return f!=null&&(f=x),x};lx.prototype.setThisPosition=function(o,f){if(this.pathMaterial){var m=this._cesium.Cartesian3.fromDegrees(o[0].lon,o[0].lat),v=this._cesium.Cartesian3.fromDegrees(o[1].lon,o[1].lat),y=this._cesium.Cartesian3.fromDegrees(f.lon,f.lat),x=this._core.getSpaceDistancem([m,v],this._cesium),C=this._core.getSpaceDistancem([m,y],this._cesium);this.pathMaterial.setScale(C/x)}};lx.prototype.clear=function(){if(this._polylines.length>0)for(var o=0;o<this._polylines.length;o++)this._polylines[o]instanceof yd.Entity?this._viewer.entities.remove(this._polylines[o]):this._viewer.scene.primitives.remove(this._polylines[o]);this._polylines=[],this.Streamerpath.removeAll(),this.Streamerwall.removeAll()};lx.prototype.setTreeobj=function(o){this.treeobj=o};lx.prototype.deleteObject=function(){this.clear()};lx.prototype.setVisibility=function(o){if(this._polylines.length>0)for(var f=0;f<this._polylines.length;f++)this._polylines[f].show=o;this.Streamerpath.show(o),this.Streamerwall.show(o)};Object.defineProperties(lx.prototype,{show:{get:function(){return this._polylines.length>0?this._polylines[0].show:!1},set:function(o){if(this._polylines.length>0)for(var f=0;f<this._polylines.length;f++)this._polylines[f].show=o}}});var kD=lx;var d5i=`uniform sampler2D reflexImage; uniform sampler2D normalMap; uniform vec4 baseWaterColor; uniform vec4 blendColor; uniform float frequency; uniform float animationSpeed; uniform float amplitude; uniform float specularIntensity; uniform float fadeFactor; uniform vec4 sizeAndVelocity; czm_material czm_getMaterial(czm_materialInput materialInput) { float width = sizeAndVelocity.x; float height = sizeAndVelocity.y; float vx = sizeAndVelocity.z; float vy = sizeAndVelocity.w; czm_material material = czm_getDefaultMaterial(materialInput); float time = czm_frameNumber * animationSpeed; // fade is a function of the distance from the fragment and the frequency of the waves float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); // note: not using directional motion at this time, just set the angle to 0.0; vec2 st = materialInput.st * vec2(width, height) / 100.0 * frequency; st -= vec2(vx*time, vy*time); vec4 noise = czm_getWaterNoise(normalMap, st, time, 0.0); vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); // fade out the normal perturbation as we move further from the water surface normalTangentSpace.xy /= fade; normalTangentSpace = normalize(normalTangentSpace); // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); // base color is a blend of the water and non-water color based on the value from the specular map // may need a uniform blend factor to better control this vec2 v = gl_FragCoord.xy / czm_viewport.zw; v.y = 1.0 - v.y; material.diffuse = texture(reflexImage, v + noise.xy*0.03).rgb; // diffuse highlights are based on how perturbed the normal is material.diffuse += (0.1 * tsPerturbationRatio); material.diffuse = mix(baseWaterColor.rgb, material.diffuse, blendColor.rgb); material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); material.specular = specularIntensity; material.shininess = 10.0; material.alpha = baseWaterColor.a * blendColor.a; return material; }`,Dct=d5i;function Ab(o){this._viewer=o.viewer,this._scene=this._viewer.scene,this._context=this._scene.context,this._waterPositionWC=void 0,this.waterPositionWC=Z(o.waterCenter,void 0),this._fb=new $h({depthStencil:!0}),this._waterPosition=void 0,this._waterMatrix=void 0,this._show=Z(o.show,!0),this._debugShow=Z(o.debug,!1),this._frequency=Z(o.frequency,5e3),this._amplitude=Z(o.amplitude,2),this._animationSpeed=Z(o.animationSpeed,.05),this._baseWaterColor=Z(o.baseWaterColor,new Re(.2,.3,.6,1)),this._blendColor=Z(o.blendColor,new Re(.5,.5,.5,.7)),this._fadeFactor=Z(o.fadeFactor,1),this._specularIntensity=Z(o.specularIntensity,.5),this._near=Z(o.near,0),this._far=Z(o.far,5e3);let f=Xr.clone(this._scene.defaultView.viewport);f.x=0,f.y=0,f.width=this._context.drawingBufferWidth,f.height=this._context.drawingBufferHeight,this._reflexCamera=new Vl(this._scene),this._waterOffScreenView=new E6(this._scene,this._reflexCamera,f),this.addWaterMaterial(),this.clearCommand=new Gc({color:new Re(1,1,1,1),depth:1,owner:this}),this._scene.preRender.addEventListener(()=>{this.update()}),this.waterPrimitives=[],this._debugShow&&this.createDebugView()}var f5i=new ET({pass:ep.RENDER}),p5i=new Re(0,0,0,0),PLe=new H,ILe=new H,m5i=new H(0,0,1),NZi=new H;Ab.prototype.update=function(){if(!this.show)return;let o=this._scene.camera.positionWC;if(H.distance(o,this.waterPositionWC)>this._far)return;if(PLe=H.subtract(this.waterPositionWC,o,PLe),ILe=Ee.multiplyByPointAsVector(this.waterMatrix,m5i,ILe),H.dot(PLe,ILe)>0){this._fb.clear(this._scene.context,this.clearCommand);return}let m=this._waterOffScreenView;this._scene.view=m;let v=m.viewport;v.x=0,v.y=0,v.width=this._context.drawingBufferWidth,v.height=this._context.drawingBufferHeight;let y=this._scene.globe.depthTestAgainstTerrain;this._scene.globe.depthTestAgainstTerrain=!0,this._scene.jobScheduler.disableThisFrame(),this.updateReflexCamera(),this._scene.initializeOffScreenFrame();let x=this.begin(v);this._scene.updateFrameState(),this._scene.frameState.useLogDepth=!1,this._scene.frameState.passes.render=!0,this._scene.frameState.tilesetPassState=f5i,this._scene.frameState.passes.offscreen=!0,this._context.uniformState.update(this._scene.frameState),this._scene.updateEnvironment(),this._scene.updateAndExecuteCommands(x,p5i),this._scene.resolveFramebuffers(x),this.end(),this._context.endFrame(),this._scene.globe.depthTestAgainstTerrain=y};Ab.prototype.begin=function(o){return this._fb.update(this._context,o.width,o.height),this._scene.view.passState.framebuffer=this._fb.framebuffer,Xr.clone(o,this._scene.view.passState.viewport),this._scene.view.passState};Ab.prototype.end=function(){for(let o=0;o<this.waterPrimitives.length;o++){let f=this.waterPrimitives[o];f.appearance.material.uniforms.reflexImage=this._fb.getColorTexture(0)}this._debugShow&&this._debugViewportQuad&&(this._debugViewportQuad.material.uniforms.image=this._fb.getColorTexture(0))};Ab.prototype.updateReflexCamera=function(){Vl.clone(this._scene.defaultView.camera,this._reflexCamera);let o=this._reflexCamera.positionCartographic,f=this._reflexCamera.pitch,m=this._reflexCamera.heading,v=this._reflexCamera.roll;this._reflexCamera.setView({destination:H.fromRadians(o.longitude,o.latitude,2*this.waterHeight-o.height),orientation:{heading:m,pitch:-f,roll:v}}),g5i(this._reflexCamera,this.waterPositionWC)};var Lct=new Wt,KO=new $a(H.UNIT_Z,0),L4=new H;function g5i(o,f){let m=o.viewMatrix;H.fromElements(0,0,1,L4);let v=tn.eastNorthUpToFixedFrame(f);L4=Ee.multiplyByPointAsVector(v,L4,L4),H.normalize(L4,L4),KO=$a.fromPointNormal(f,L4,KO),$a.transform(KO,m,KO),Wt.fromElements(KO.normal.x,KO.normal.y,KO.normal.z,KO.distance,Lct),o.frustum.offCenterFrustum.clipPlane=Lct}Ab.prototype.addWaterMaterial=function(){if(zo.WaterReflectionType="WaterRefection",!N(zo._materialCache.getMaterial(zo.WaterReflectionType))){let o=this;zo._materialCache.addMaterial(zo.WaterReflectionType,{fabric:{type:zo.WaterReflectionType,uniforms:{baseWaterColor:o.baseWaterColor,blendColor:o.blendColor,reflexImage:zo.DefaultImageId,normalMap:zo.DefaultImageId,frequency:o.frequency,animationSpeed:o.animationSpeed,amplitude:o.amplitude,specularIntensity:o.specularIntensity,fadeFactor:o.fadeFactor,sizeAndVelocity:new Wt(100,100,10,0)},source:Dct},translucent:function(f){let m=f.uniforms;return m.baseWaterColor.alpha<1||m.blendColor.alpha<1}})}};Ab.prototype.createWaterMaterial=function(o){let f=this;return zo.fromType(zo.WaterReflectionType,{normalMap:Ms("Assets/Textures/waterNormals.jpg"),frequency:f.frequency,animationSpeed:f.animationSpeed,amplitude:f.amplitude})};Ab.prototype.createWaterPolygon=function(o,f,m,v){let y=new ho(o,f),x,C;m?(C=Ec,x=Zw):(C=Ec,x=Ia);let w=new C({vertexFormat:Nd.MaterialSupport.ALL.vertexFormat,polygonHierarchy:y,height:v}),A=new x({geometryInstances:new co({geometry:w,attributes:{distanceDisplayCondition:new th(this._near,this._far)}}),appearance:new Nd({materialSupport:Nd.MaterialSupport.ALL})});return A.appearance.material=this.createWaterMaterial(),this.waterPrimitives.push(A),A};Ab.prototype.showWaterPolygon=function(o){for(let f of this.waterPrimitives)f.show=o};Object.defineProperties(Ab.prototype,{waterHeight:{get:function(){return this.waterPosition.height}},baseWaterColor:{set:function(o){this._baseWaterColor=o},get:function(){return this._baseWaterColor}},blendColor:{set:function(o){this._blendColor=o},get:function(){return this._blendColor}},show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,this.showWaterPolygon(o))}},frequency:{set:function(o){this._frequency=o},get:function(){return this._frequency}},animationSpeed:{get:function(){return this._animationSpeed},set:function(o){this._animationSpeed=o}},amplitude:{get:function(){return this._amplitude},set:function(o){this._amplitude=o}},fadeFactor:{get:function(){return this._fadeFactor},set:function(o){this._fadeFactor=o}},specularIntensity:{get:function(){return this._specularIntensity},set:function(o){this._specularIntensity=o}},waterPosition:{get:function(){return N(this._waterPosition)||(this._waterPosition=Mt.fromCartesian(this.waterPositionWC)),this._waterPosition}},waterPositionWC:{set:function(o){this._waterPositionWC=o},get:function(){return this._waterPositionWC}},waterMatrix:{get:function(){return N(this._waterMatrix)||(this._waterMatrix=tn.eastNorthUpToFixedFrame(this.waterPositionWC)),this._waterMatrix}}});Ab.prototype.createDebugView=function(){let o=zo.fromType("Image");this._debugViewportQuad=new hae(new Xr(0,0,500,400)),this._debugViewportQuad.material=o,this._scene.primitives.add(this._debugViewportQuad)};Ab.prototype.isDestroyed=function(){return!1};Ab.prototype.destroy=function(){return this._fb.destroy(),kr(this)};var _le=Ab;var nh=null;function R4(o,f){nh=f,this._earthCtrl=o,this._viewer=o.viewer,this._core=new Sr(o.viewer,nh),this._tree=Ne}R4.prototype.createPolygonLayer=function(o={}){let f={color:o.color||"rgba(135,206,235,0.6)",image:o.image||window.SmartEarthRootUrl+pn.water,height:o.height,extrudedHeight:o.extrudedHeight,frequency:o.frequency||1e3,speed:o.speed||10,amplitude:o.amplitude||10,near:o.near,far:o.far,id:o.id||this._core.getuid()},m=nh.Color.fromCssColorString(f.color),v=nh.GeoJsonDataSource.load(o.url),y=new nh.PrimitiveCollection;v.then(C=>{let w=C.entities.values;for(let A=0;A<w.length;A++){let E=w[A];this.addPolygon(y,E,f)}}),this.item=this._viewer.scene.primitives.add(y);var x={id:f.id,name:"\u65B0\u5EFA\u6C34\u9762\u56FE\u5C42",pId:0,type:"polygonLayer",item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,0),this};R4.prototype.addPolygon=async function(o,f,m){let v=nh.EllipsoidSurfaceAppearance.VERTEX_FORMAT,y=nh.Color.fromCssColorString(m.color),x=new nh.PolygonGeometry({polygonHierarchy:f.polygon.hierarchy.getValue(),extrudedHeight:m.extrudedHeight,height:m.height,vertexFormat:v}),C=new nh.GeometryInstance({geometry:x,id:f,attributes:{color:nh.ColorGeometryInstanceAttribute.fromColor(y),distanceDisplayCondition:new nh.DistanceDisplayConditionGeometryInstanceAttribute(m.near,m.far)}}),w;!m.height&&!m.extrudedHeight?w=nh.GroundPrimitive:w=nh.Primitive;let A=new w({geometryInstances:C,appearance:new nh.EllipsoidSurfaceAppearance({material:new nh.Material({fabric:{type:"Water",uniforms:{baseWaterColor:y,blendColor:y,normalMap:m.image,frequency:m.frequency,animationSpeed:m.speed/1e3,amplitude:m.amplitude}}})}),classificationType:m.classificationType});o.add(A)};R4.prototype.createReflexPolygonLayer=function(o){let m={viewer:this._earthCtrl.viewer,baseWaterColor:nh.defaultValue(o.baseWaterColor,new nh.Color(.2,.3,.6,1)),blendColor:nh.defaultValue(o.blendColor,new nh.Color(.5,.5,.5,.7)),animationSpeed:nh.defaultValue(o.animationSpeed,.05),amplitude:nh.defaultValue(o.amplitude,2),frequency:nh.defaultValue(o.frequency,5e3),specularIntensity:nh.defaultValue(o.specularIntensity,.5),fadeFactor:nh.defaultValue(o.fadeFactor,1),sizeAndVelocity:o.sizeAndVelocity||new nh.Cartesian4(100,100,10,0),width:nh.defaultValue(o.width,100),height:nh.defaultValue(o.height,100),waterHeight:nh.defaultValue(o.waterHeight,0),near:o.near,far:o.far,id:nh.defaultValue(o.id,this._core.getuid()),waterCenter:o.waterCenter,clampToGround:nh.defaultValue(o.clampToGround,!1)},v=nh.GeoJsonDataSource.load(o.url),y=new nh.PrimitiveCollection;v.then(C=>{let w=new _le(m),A=C.entities.values;for(let E=0;E<A.length;E++){let T=A[E];if(!nh.defined(T.polygon))continue;let S=T.polygon.hierarchy.getValue().positions,M=T.polygon.hierarchy.getValue().holes;y.add(w.createWaterPolygon(S,M,m.clampToGround,m.waterHeight))}}),m.clampToGround?this.item=this._viewer.scene.groundPrimitives.add(y):this.item=this._viewer.scene.primitives.add(y);let x={id:m.id,name:"\u65B0\u5EFA\u6C34\u9762\u56FE\u5C42",pId:0,type:"polygonLayer",item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,0),this};R4.prototype.setTreeobj=function(o){this.treeobj=o};R4.prototype.deleteObject=function(){try{this._viewer.scene.primitives.remove(this.item)}catch(o){console.log(o)}};R4.prototype.setVisibility=function(o){this.item&&(this.item.show=o)};var vle=R4;var Rct=`// author: \u5F20\u4E39\u948A uniform vec4 color; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; material.diffuse = czm_gammaCorrect(color.rgb); material.alpha = color.a * pow(1.0 - st.t, 2.0); material.emission = vec3(0.2); return material; }`;var Oct=`// author: \u5F20\u4E39\u948A uniform vec4 color; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; float powerRatio = fract(czm_frameNumber / 30.0) + 1.0; float alpha = pow(1.0 - st.t, powerRatio); material.diffuse = czm_gammaCorrect(color.rgb); material.alpha = alpha * color.a; material.emission = vec3(0.2); return material; }`;var Nct=`// author: \u5F20\u4E39\u948A uniform sampler2D image; uniform vec4 color; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 v_st = materialInput.st; float dt = fract(czm_frameNumber / 90.0); vec2 st = fract(vec2(1.0) + v_st - vec2(dt, dt)); vec4 imageColor = texture(image, st); vec3 diffuse = imageColor.rgb; float alpha = imageColor.a; diffuse *= color.rgb; alpha *= color.a; diffuse *= color.rgb; alpha *= color.a; material.diffuse = diffuse; material.alpha = alpha * pow(1.0 - v_st.t, 2.0); material.emission = vec3(0.2); return material; }`;var xd=null;function HT(o,f){xd=f,this._viewer=o,this._core=new Sr(o,f),this.angle=0,this.multiple=1,this.destroyed=!1,this.type="cylinder",this.show=!0}HT.prototype.createCylinder=function(o={}){this.type="cylinder",this.radius=o.radius||500,this.length=o.length||100,this.number=o.number||30,this.multiple=o.multiple||1,this.near=o.near,this.far=o.far;let f=xd.Color.fromCssColorString(o.color||"#80ccff");this.scale=[this.radius,this.radius,this.length],this.color=[f.red,f.green,f.blue,f.alpha],this.geometryValue=this.getCylinderGeometryValue(1,1,1,this.number),this.modelMatrix=xd.Transforms.eastNorthUpToFixedFrame(xd.Cartesian3.fromDegrees(o.position.lon,o.position.lat,o.position.height));let m=new xd.GeometryInstance({geometry:this.getGeometry(this.geometryValue),modelMatrix:this.modelMatrix});return this.cylinder=new xd.Primitive({geometryInstances:m,appearance:this.getAppearance(),asynchronous:!1}),this._viewer.scene.primitives.add(this),this};HT.prototype.createCone=function(o={}){this.type="cone",this.radius=o.radius||500,this.length=o.length||100,this.near=o.near,this.far=o.far;let f=xd.Color.fromCssColorString(o.color||"#80ccff");this.scale=[this.radius,this.radius,this.length],this.color=[f.red,f.green,f.blue,f.alpha],this.geometryValue=this.getCylinderGeometryValue(2,.3,1,6),this.modelMatrix=xd.Transforms.eastNorthUpToFixedFrame(xd.Cartesian3.fromDegrees(o.position.lon,o.position.lat,o.position.height));let m=new xd.GeometryInstance({geometry:this.getGeometry(this.geometryValue),modelMatrix:this.modelMatrix});return this.cylinder=new xd.Primitive({geometryInstances:m,appearance:this.getAppearance(),asynchronous:!1}),xd.Resource.createIfNeeded(SmartEarthRootUrl+pn.particles).fetchImage().then(v=>{let y=this.getCylinderGeometryValue(4,4,1,6),x=new xd.GeometryInstance({geometry:this.getGeometry(y),modelMatrix:this.modelMatrix});this.cylinder1=new xd.Primitive({geometryInstances:x,appearance:new xd.EllipsoidSurfaceAppearance({material:new xd.Material({fabric:{uniforms:{image:v,color:new xd.Color(this.color[0],this.color[1],this.color[2],0)},source:Nct}}),renderState:{cull:{enabled:!1}}}),asynchronous:!1}),setTimeout(()=>{this.cylinder1.appearance.material.uniforms.color.alpha=2})}),this._viewer.scene.primitives.add(this),this};HT.prototype.getAppearance=function(){if(this.type==="cylinder")return new xd.EllipsoidSurfaceAppearance({material:new xd.Material({fabric:{uniforms:{color:new xd.Color(...this.color)},source:Rct}}),renderState:{cull:{enabled:!1}}});if(this.type==="cone")return new xd.EllipsoidSurfaceAppearance({material:new xd.Material({fabric:{uniforms:{color:new xd.Color(...this.color)},source:Oct}}),renderState:{cull:{enabled:!1}}})};HT.prototype.getGeometry=function(o){return this._core.customGeometry({scale:this.scale,boundingSphere:new xd.BoundingSphere(new xd.Cartesian3(0,0,0),1),...JSON.parse(JSON.stringify(o))})};HT.prototype.getCylinderGeometryValue=function(o=1,f=1,m=1,v=30){let y=[o,0],x=[f,0],C=xd.Math.toRadians(360/v),w=1/v,A=[],E=[0,1,v+1,1,v+2,v+1],T=[];A[0]=y[0],A[1]=y[1],A[2]=0,A[(v+1)*3]=x[0],A[(v+1)*3+1]=x[1],A[(v+1)*3+2]=m,T[0]=0,T[1]=0,T[(v+1)*2]=0,T[(v+1)*2+1]=1;for(let S=1,M=0,I=0,P,D;S<=v;S++)M=C*S,I=w*S,P=y[0]*Math.cos(M)-y[1]*Math.sin(M),D=y[1]*Math.cos(M)+y[0]*Math.sin(M),A[S*3]=P,A[S*3+1]=D,A[S*3+2]=0,P=x[0]*Math.cos(M)-x[1]*Math.sin(M),D=x[1]*Math.cos(M)+x[0]*Math.sin(M),A[(v+1)*3+S*3]=P,A[(v+1)*3+S*3+1]=D,A[(v+1)*3+S*3+2]=m,T[S*2]=I,T[S*2+1]=0,T[(v+1)*2+S*2]=I,T[(v+1)*2+S*2+1]=1,E.push(S,S+1,v+S+1,S+1,v+S+2,v+S+1);return{position:A,st:T,indices:E}};HT.prototype.update=function(o){if(this.cylinder&&this.show){if(this.type==="cylinder"){typeof this.dt>"u"&&(this.dt=0),this.dt+=.01*.3*this.multiple,this.dt>1&&(this.dt=0);let f=(1-Math.cos(this.dt*Math.PI*2))*.5;this.scale[0]=this.scale[1]=this.radius*(1-Math.cos(this.dt*Math.PI))*.5,this.scale[2]=this.length*f,this.color[3]=2*f;let m=new xd.GeometryInstance({geometry:this.getGeometry(this.geometryValue),modelMatrix:this.modelMatrix});this.cylinder.destroy(),this.cylinder=new xd.Primitive({geometryInstances:m,appearance:this.getAppearance(),asynchronous:!1}),m=null}this.cylinder.update(o),this.cylinder1&&this.cylinder1.update(o)}};HT.prototype.isDestroyed=function(){return this.destroyed};HT.prototype.destroy=function(){this.cylinder&&this.cylinder.destroy(),this.cylinder=null,this.cylinder1&&this.cylinder1.destroy(),this.cylinder1=null,this.destroyed=!0};HT.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this)};HT.prototype.setVisibility=function(o){this.show=o};var I8=HT;var Fct=`// author: \u5F20\u4E39\u948A uniform float angle; uniform sampler2D image; uniform vec4 color; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; // \u65CB\u8F6C st.x = st.x - 0.5; st.y = st.y - 0.5; if(st.x * st.x + st.y * st.y <= 0.25){ float x = st.x * cos(angle) - st.y * sin(angle); float y = st.y * cos(angle) + st.x * sin(angle); st.x = x + 0.5; st.y = y + 0.5; } else { st.x = st.x + 0.5; st.y = st.y + 0.5; } material.diffuse = czm_gammaCorrect(texture(image, st).rgb * color.rgb); material.alpha = texture(image, st).a * color.a; material.emission = vec3(0.2); return material; }`;var Nm=null;function UT(o,f){Nm=f,this._viewer=o,this._core=new Sr(o,f),this.angle=0,this.multiple=1,this.destroyed=!1,this.type="rotate",this.show=!0}UT.prototype.createRotateCircle=function(o={}){this.type="rotate",this.radius=this._core.defaultValue(o.radius,500),this.multiple=this._core.defaultValue(o.multiple,1),this.scale=[this.radius,this.radius,1];let f=Nm.Color.fromCssColorString(o.color||"#80ccff");return this.color=[f.red,f.green,f.blue],this.clampToGround=o.clampToGround,this.position=o.position,this.image=o.image,!o.image&&(this.image=o.scan?SmartEarthRootUrl+pn.scanCircle:SmartEarthRootUrl+pn.effectCircle),o.scan&&(this.multiple=-this.multiple),Nm.Resource.createIfNeeded(this.image).fetchImage().then(m=>{this.image=m;let v=this.clampToGround?Nm.GroundPrimitive:Nm.Primitive;this.circle=new v({geometryInstances:this.getInstances(),appearance:this.getAppearance(),asynchronous:!1}),setTimeout(()=>{this.circle.appearance.material.uniforms.color.alpha=2})}),this._viewer.scene.primitives.add(this),this};UT.prototype.createDRWCircle=function(o={}){this.type="DRW",this.radius=this._core.defaultValue(o.radius,50),this.multiple=this._core.defaultValue(o.multiple,5),this.scale=[this.radius,this.radius,1];let f=Nm.Color.fromCssColorString(o.color||"#80ccff");this.color=[f.red,f.green,f.blue],this.clampToGround=o.clampToGround,this.position=o.position;let m=document.createElement("canvas");m.width=512,m.height=512;let v=m.getContext("2d"),y=v.createRadialGradient(256,256,0,256,256,256);y.addColorStop(.1,"rgba(255, 255, 255, 1.0)"),y.addColorStop(.2,"rgba(255, 255, 255, 0.0)"),y.addColorStop(.3,"rgba(255, 255, 255, 0.9)"),y.addColorStop(.5,"rgba(255, 255, 255, 0.0)"),y.addColorStop(.9,"rgba(255, 255, 255, 0.2)"),y.addColorStop(1,"rgba(255, 255, 255, 1.0)"),v.clearRect(0,0,512,512),v.strokeStyle="rgb(255, 255, 255)",v.setLineDash([80,80]),v.lineWidth=30,v.arc(256,256,180,0,Math.PI*2,!0),v.stroke(),v.beginPath(),v.arc(256,256,256,0,Math.PI*2,!0),v.fillStyle=y,v.fill(),v.restore(),this.image=m;let x=this.clampToGround?Nm.GroundPrimitive:Nm.Primitive;return this.circle=new x({geometryInstances:this.getInstances(),appearance:this.getAppearance(),asynchronous:!1}),setTimeout(()=>{this.circle.appearance.material.uniforms.color.alpha=2}),this._viewer.scene.primitives.add(this),this};UT.prototype.getInstances=function(){if(this.clampToGround){let o=Nm.Cartesian3.fromDegrees(this.position.lon,this.position.lat,this.position.height),f=this._core.setPositionOffset(o,{x:-this.scale[0],y:-this.scale[1],z:0}),m=this._core.setPositionOffset(o,{x:this.scale[0],y:this.scale[1],z:0});return new Nm.GeometryInstance({geometry:new Nm.RectangleGeometry({rectangle:Nm.Rectangle.fromCartesianArray([f,m])}),modelMatrix:this.modelMatrix})}else return this.modelMatrix=Nm.Transforms.eastNorthUpToFixedFrame(Nm.Cartesian3.fromDegrees(this.position.lon,this.position.lat,this.position.height)),new Nm.GeometryInstance({geometry:this.getGeometry(),modelMatrix:this.modelMatrix})};UT.prototype.getGeometry=function(){return this._core.customGeometry({scale:this.scale,position:[-1,-1,0,1,-1,0,1,1,0,-1,1,0],st:[0,0,1,0,1,1,0,1],indices:[0,1,2,0,2,3],boundingSphere:new Nm.BoundingSphere(new Nm.Cartesian3(0,0,0),1)})};UT.prototype.getAppearance=function(){return new Nm.EllipsoidSurfaceAppearance({material:new Nm.Material({fabric:{uniforms:{image:this.image,angle:this.angle,color:new Nm.Color(...this.color,0)},source:Fct}})})};UT.prototype.update=function(o){this.circle&&this.show&&(this.circle.appearance.material.uniforms.angle=Nm.Math.toRadians(this.angle+=this.multiple),this.circle.update(o))};UT.prototype.isDestroyed=function(){return this.destroyed};UT.prototype.destroy=function(){this.circle&&this.circle.destroy(),this.circle=null,this.destroyed=!0};UT.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this)};UT.prototype.setVisibility=function(o){this.show=o};var M8=UT;var rc=null;function DC(o,f,m){rc=m,this.show=!0,this._position=rc.Cartesian3.fromDegrees(f.position.lon,f.position.lat,f.position.height),this._command=void 0,this._outlineCommand=void 0,this._angle=0,this._viewer=o,this._speed=sm(f.multiple,1),this._color=sm(f.color,"#80ccff"),this._color=rc.Color.fromCssColorString(this._color).withAlpha(.5),this._outlineColor=sm(f.outlineColor,"#ffff00"),this._outlineColor=rc.Color.fromCssColorString(this._outlineColor),this._scale=sm(f.scale,new rc.Cartesian3(1,1,1)),this._modelMatrix=this.computeModelMatrix(),this._height=0,this.animate=sm(f.animate,!0),o.scene.primitives.add(this)}DC.prototype.update=function(o){if(!!this.show&&(rc.defined(this._command)||(this._command=this.createCommand(o.context)),rc.defined(this._outlineCommand)||(this._outlineCommand=this.createCommand(o.context,!0)),o.commandList.push(this._command,this._outlineCommand),this.animate)){this._angle+=.01,this._angle>1&&(this._angle=0),this._height=Math.sin(this._angle*Math.PI*2)*.04;let f=new rc.Cartesian3(0,0,this._height);rc.Matrix4.multiplyByTranslation(this._modelMatrix,f,this._modelMatrix);let m=rc.Matrix4.fromRotationTranslation(rc.Matrix3.fromRotationZ(rc.Math.toRadians(this._speed*4)));rc.Matrix4.multiply(this._modelMatrix,m,this._modelMatrix)}};DC.prototype.isDestroyed=function(){return!1};DC.prototype.destroy=function(){return rc.defined(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),rc.defined(this._outlineCommand)&&(this._outlineCommand.shaderProgram=this._outlineCommand.shaderProgram&&this._outlineCommand.shaderProgram.destroy()),rc.destroyObject(this)};DC.prototype.startAnimate=function(){this.animate=!0};DC.prototype.closeAnimate=function(){this.animate=!1};DC.prototype.deleteObject=function(){this.destroy()};DC.prototype.setVisibility=function(o){this.show=o};DC.prototype.createCommand=function(o,f){let m=!0,v=!0;var y=rc.Appearance.getDefaultRenderState(m,v,void 0),x=new rc.RenderState(y);let C={position:0,textureCoordinates:1};var w=rc.ShaderProgram.fromCache({context:o,vertexShaderSource:this.createVertexShader(),fragmentShaderSource:this.createFragmentShader(),attributeLocations:C});let A=f?this._outlineColor:this._color;return new rc.DrawCommand({pickId:"Tetrahedron",vertexArray:this.createVertexArray(o,f),primitiveType:f?rc.PrimitiveType.LINES:rc.PrimitiveType.TRIANGLES,renderState:x,shaderProgram:w,uniformMap:{color:()=>A},owner:this,pass:rc.Pass.TRANSLUCENT,modelMatrix:this._modelMatrix,boundingVolume:new rc.BoundingSphere(this._position,1)})};DC.prototype.createVertexArray=function(o,f=!1){let m={position:0,textureCoordinates:1};var v=this.cereatePositionsAndIndice(f),y=new rc.Geometry({attributes:{position:new rc.GeometryAttribute({componentDatatype:rc.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:v.positions}),textureCoordinates:new rc.GeometryAttribute({componentDatatype:rc.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:v.sts})},indices:v.indices,primitiveType:rc.PrimitiveType.TRIANGLES,boundingSphere:rc.BoundingSphere.fromVertices(v.positions)}),x=rc.GeometryPipeline.computeNormal(y),C=rc.VertexArray.fromGeometry({context:o,geometry:x,attributeLocations:m,bufferUsage:rc.BufferUsage.STATIC_DRAW});return C};DC.prototype.cereatePositionsAndIndice=function(o=!1){return{indices:o?[0,1,0,1,2,1,2,3,2,3,0,3,0,4,0,1,4,1,2,4,2,3,4,3]:[0,1,4,1,2,4,2,3,4,3,0,4],positions:[1,0,1.5,0,1,1.5,-1,0,1.5,0,-1,1.5,0,0,0],sts:[]}};DC.prototype.createVertexShader=function(){var o=`in vec3 position; void main() { gl_Position = czm_modelViewProjection * vec4(position, 1.0); } `;return o};DC.prototype.createFragmentShader=function(){var o=`uniform vec4 color; void main() { out_FragColor = color; } `;return o};DC.prototype.computeModelMatrix=function(){let o=rc.Transforms.eastNorthUpToFixedFrame(this._position),f=rc.Matrix4.fromScale(this._scale);return rc.Matrix4.multiply(o,f,new rc.Matrix4)};var yle=DC;var $g=null;function Bct(o,f){$g=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),$g.GeoWTFS||new Y0(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/cesiumTdt.js")}Bct.prototype.GeoWTFS=function(o){!o&&(o={});var f=o.token||"c53eb074c3fcba5ac86103d4d711bbe8",m=o.url||"https://t{s}.tianditu.gov.cn/",v={viewer:this._viewer,subdomains:$g.defaultValue(o.subdomains,["0","1","2","3","4","5","6","7"]),metadata:{boundBox:{minX:-180,minY:-90,maxX:180,maxY:90},minLevel:1,maxLevel:20},aotuCollide:!0,collisionPadding:[5,10,8,5],serverFirstStyle:!0,labelGraphics:{font:"28px sans-serif",fontSize:28,fillColor:$g.Color.WHITE,scale:.5,outlineColor:$g.Color.BLACK,outlineWidth:5,style:$g.LabelStyle.FILL_AND_OUTLINE,showBackground:!1,backgroundColor:$g.Color.RED,backgroundPadding:new $g.Cartesian2(10,10),horizontalOrigin:$g.HorizontalOrigin.LEFT,verticalOrigin:$g.VerticalOrigin.BOTTOM,eyeOffset:$g.Cartesian3.ZERO,pixelOffset:new $g.Cartesian2(0,8),heightReference:1,disableDepthTestDistance:Number.POSITIVE_INFINITY},billboardGraphics:{horizontalOrigin:$g.HorizontalOrigin.RIGHT,verticalOrigin:$g.VerticalOrigin.BOTTOM,eyeOffset:$g.Cartesian3.ZERO,pixelOffset:$g.Cartesian2.ZERO,alignedAxis:$g.Cartesian3.ZERO,color:$g.Color.WHITE,rotation:0,scale:1,width:18,height:18,heightReference:1,disableDepthTestDistance:Number.POSITIVE_INFINITY}};o=this._core.extend(v,o,!0);var y=new $g.GeoWTFS(o);return y.getTileUrl=function(){return m+"mapservice/GetTiles?lxys={z},{x},{y}&tk="+f},y.getIcoUrl=function(){return m+"mapservice/GetIcon?id={id}&tk="+f},y.initTDT([{x:6,y:1,level:2,boundBox:{minX:90,minY:0,maxX:135,maxY:45}},{x:7,y:1,level:2,boundBox:{minX:135,minY:0,maxX:180,maxY:45}},{x:6,y:0,level:2,boundBox:{minX:90,minY:45,maxX:135,maxY:90}},{x:7,y:0,level:2,boundBox:{minX:135,minY:45,maxX:180,maxY:90}},{x:5,y:1,level:2,boundBox:{minX:45,minY:0,maxX:90,maxY:45}},{x:4,y:1,level:2,boundBox:{minX:0,minY:0,maxX:45,maxY:45}},{x:5,y:0,level:2,boundBox:{minX:45,minY:45,maxX:90,maxY:90}},{x:4,y:0,level:2,boundBox:{minX:0,minY:45,maxX:45,maxY:90}},{x:6,y:2,level:2,boundBox:{minX:90,minY:-45,maxX:135,maxY:0}},{x:6,y:3,level:2,boundBox:{minX:90,minY:-90,maxX:135,maxY:-45}},{x:7,y:2,level:2,boundBox:{minX:135,minY:-45,maxX:180,maxY:0}},{x:5,y:2,level:2,boundBox:{minX:45,minY:-45,maxX:90,maxY:0}},{x:4,y:2,level:2,boundBox:{minX:0,minY:-45,maxX:45,maxY:0}},{x:3,y:1,level:2,boundBox:{minX:-45,minY:0,maxX:0,maxY:45}},{x:3,y:0,level:2,boundBox:{minX:-45,minY:45,maxX:0,maxY:90}},{x:2,y:0,level:2,boundBox:{minX:-90,minY:45,maxX:-45,maxY:90}},{x:0,y:1,level:2,boundBox:{minX:-180,minY:0,maxX:-135,maxY:45}},{x:1,y:0,level:2,boundBox:{minX:-135,minY:45,maxX:-90,maxY:90}},{x:0,y:0,level:2,boundBox:{minX:-180,minY:45,maxX:-135,maxY:90}}]),y};var xle=Bct;var es=null;function Fu(o,f){es=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this.positions=[],this.objId=Number(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonCircleArr=[],this.gonPointStretchingArr=[],this.topRadius=0,this.bottomRadius=0,this.length=50}Fu.prototype.createCone=function(o,f,m,v){var y={length:4e5,topRadius:0,bottomRadius:2e5,material:this._cesium.Color.GREEN},x=this._core.extend(y,f,!0);this.item=this._viewer.entities.add({name:m,position:this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[1]),cylinder:x});var C={id:this.item.id,name:m,pId:this._core.isnull(v)?0:v,type:"cylinder",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(v)?0:v),this};Fu.prototype.getstyles=function(){var o={};return o.show=this.item.cylinder.show?this.item.cylinder.show._value:!0,o.length=this.item.cylinder.length?this.item.cylinder.length.getValue():void 0,o.topRadius=this.item.cylinder.topRadius?this.item.cylinder.topRadius.getValue():void 0,o.bottomRadius=this.item.cylinder.bottomRadius?this.item.cylinder.bottomRadius.getValue():void 0,o.heightReference=this.item.cylinder.heightReference&&this.item.cylinder.heightReference._value?this.item.cylinder.heightReference._value:void 0,o.fill=this.item.cylinder.fill&&this.item.cylinder.fill._value?this.item.cylinder.fill._value:void 0,o.material={},o.material.color=this.item.cylinder.material&&this.item.cylinder.material.color&&this.item.cylinder.material.color._value?"rgba"+this.item.cylinder.material.color.toString():void 0,o.material.image=this.item.cylinder.material&&this.item.cylinder.material.image&&this.item.cylinder.material.image._value?this.item.cylinder.material.image._value:void 0,o.material.repeat=this.item.cylinder.material&&this.item.cylinder.material.repeat&&this.item.cylinder.material.repeat._value?this.item.cylinder.material.repeat._value:void 0,o.outline=this.item.cylinder.outline?this.item.cylinder.outline._value:void 0,o.outlineWidth=this.item.cylinder.outlineWidth&&this.item.cylinder.outlineWidth._value?this.item.cylinder.outlineWidth._value:void 0,o.outlineColor=this.item.cylinder.outlineColor&&this.item.cylinder.outlineColor&&this.item.cylinder.outlineColor._value?"rgba"+this.item.cylinder.outlineColor.toString():void 0,o.near=this.item.cylinder.distanceDisplayCondition?this.item.cylinder.distanceDisplayCondition._value.near:void 0,o.far=this.item.cylinder.distanceDisplayCondition?this.item.cylinder.distanceDisplayCondition._value.far:void 0,o.position=this.item.position.getValue().toString(),o};Fu.prototype.createRectangularSensor=function(o,f,m,v){var y=this;!f&&(f={});var x=this._core.defaultValue(f.radius,100),C={radii:new this._cesium.Cartesian3(x,x,x),maximumCone:this._cesium.Math.toRadians(90),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!0,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},w=this._core.extend(C,f,!0);typeof f.color=="string"&&(w.material=this._cesium.Color.fromCssColorString(f.color)),typeof f.outlineColor=="string"&&(w.outlineColor=this._cesium.Color.fromCssColorString(f.outlineColor));var A=0,E=this.calcPoints(o[0],o[1],o[2],x,A);this.wall=[];var T=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.CallbackProperty(function(){return new y._cesium.PolygonHierarchy(y._cesium.Cartesian3.fromDegreesArrayHeights(E))},!1),perPositionHeight:!0,material:this._core.defaultValue(f.wallColor&&this._cesium.Color.fromCssColorString(f.wallColor),this._cesium.Color.AQUAMARINE.withAlpha(.5)),outline:!0,outlineColor:this._core.defaultValue(f.wallOutlineColor&&this._cesium.Color.fromCssColorString(f.wallOutlineColor),this._cesium.Color.RED.withAlpha(.5))}});if(this.wall.push(T),w.angle){var S=this.calcPoints(o[0],o[1],o[2],x,A+w.angle),M=this._viewer.entities.add({polygon:{hierarchy:new this._cesium.CallbackProperty(function(){return new y._cesium.PolygonHierarchy(y._cesium.Cartesian3.fromDegreesArrayHeights(S))},!1),perPositionHeight:!0,material:this._core.defaultValue(f.wallColor&&this._cesium.Color.fromCssColorString(f.wallColor),this._cesium.Color.AQUAMARINE.withAlpha(.5)),outline:!0,outlineColor:this._core.defaultValue(f.wallOutlineColor&&this._cesium.Color.fromCssColorString(f.wallOutlineColor),this._cesium.Color.RED.withAlpha(.5))}});this.wall.push(M);var I=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),ellipsoid:{radii:w.radii,minimumClock:this._cesium.Math.toRadians(0),maximumClock:this._cesium.Math.toRadians(w.angle),maximumCone:this._cesium.Math.toRadians(90),material:this._core.defaultValue(f.surfaceColor&&this._cesium.Color.fromCssColorString(f.surfaceColor),this._cesium.Color.RED.withAlpha(.5))},orientation:new y._cesium.CallbackProperty(function(){return y._cesium.Transforms.headingPitchRollQuaternion(y._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),new y._cesium.HeadingPitchRoll(y._cesium.Math.toRadians(-A),0,0))},!1)});this.wall.push(I)}this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),ellipsoid:w});var P=this._core.defaultValue(w.speed,1);this._viewer.clock.onTick.addEventListener(function(){A+=.1*P,E=y.calcPoints(o[0],o[1],o[2],x,A),S&&(S=y.calcPoints(o[0],o[1],o[2],x,A+w.angle))});var D={id:this.item.id,name:m,pId:this._core.isnull(v)?0:v,type:"cylinder",item:this};return this.setTreeobj(D),this._tree.insertGroupId(D,this._core.isnull(v)?0:v),this};Fu.prototype.computeCirclularFlight=function(o,f,m,v,y,x,C){var w=[];w.push(o),w.push(f),w.push(y);for(var A=this._cesium.Cartesian3.distance(this._cesium.Cartesian3.fromDegrees(o,f,y),this._cesium.Cartesian3.fromDegrees(m,v,y)),E=x;E<=x+C;E++){var T=A*Math.sin(E*Math.PI/180),S=Math.cos(E*Math.PI/180),M=(m-o)*S+o,I=(v-f)*S+f;w.push(M),w.push(I),w.push(T+y)}return w};Fu.prototype.calcPoints=function(o,f,m,v,y){var x=this._cesium.Transforms.eastNorthUpToFixedFrame(this._cesium.Cartesian3.fromDegrees(o,f,m)),C=v*Math.cos(y*Math.PI/180),w=v*Math.sin(y*Math.PI/180),A=this._cesium.Cartesian3.fromElements(C,w,0),E=this._cesium.Matrix4.multiplyByPoint(x,A,new this._cesium.Cartesian3),T=this._cesium.Cartographic.fromCartesian(E),S=this._cesium.Math.toDegrees(T.longitude),M=this._cesium.Math.toDegrees(T.latitude);return this.computeCirclularFlight(o,f,S,M,m,0,90)};Fu.prototype.createRadarMaskScan=function(o,f,m,v){var y=this;!m&&(m={});var x=this._core.defaultValue(m.radius,100),C=this._core.defaultValue(m.yaw,0),w=this._core.defaultValue(m.angle,60),A=m.innerOutline,E={subdivisions:6,stackPartitions:30,slicePartitions:30,innerRadii:new this._cesium.Cartesian3(.5,.5,.5),radii:new es.CallbackProperty(function(){return new es.Cartesian3(x,x,x)},!1),maximumCone:this._cesium.Math.toRadians(this._core.defaultValue(m.maxLat,105)),minimumCone:this._cesium.Math.toRadians(this._core.defaultValue(m.minLat,75)),minimumClock:new es.CallbackProperty(function(){return es.Math.toRadians(C)},!1),maximumClock:new es.CallbackProperty(function(){return es.Math.toRadians(C+w)},!1),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!A,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},T=this._core.extend(E,m,!0);typeof m.color=="string"&&(T.material=this._cesium.Color.fromCssColorString(m.color)),typeof m.outlineColor=="string"&&(T.outlineColor=this._cesium.Color.fromCssColorString(m.outlineColor));let S,M,I=f instanceof es.Entity?f:void 0;if(I?(S=new es.CallbackProperty(()=>{let F=I.position.getValue(this._viewer.clock.currentTime.clone());if(m.offset){let k=I.orientation.getValue(this._viewer.clock.currentTime.clone()),U;if(k){let G=es.Matrix3.fromQuaternion(k),j=es.Matrix4.fromRotationTranslation(G,F);U=es.Transforms.fixedFrameToHeadingPitchRoll(j)}F=y._core.setPositionOffset(F,m.offset,U)}return F},!1),M=new es.CallbackProperty(()=>I.orientation.getValue(this._viewer.clock.currentTime.clone()),!1)):S=es.Cartesian3.fromDegrees(f[0],f[1],f[2]),m.trackedEntity){let F,k,U,G,j,q=(T.maximumCone-T.minimumCone)/2;M=new es.CallbackProperty(()=>(k=m.trackedEntity.position.getValue(this._viewer.clock.currentTime.clone()),F=S.getValue?S.getValue():S,j=this._core.twoPointsHeadingPitchRoll(this._viewer,F,k),x=j.radius,U=j.heading-Math.PI/2,G=j.pitch-q,es.Transforms.headingPitchRollQuaternion(F,new es.HeadingPitchRoll(U,G,0))),!1)}var P=0,D=this._core.defaultValue(m.scanAngle,15);this._scan=this._viewer.entities.add({position:S,orientation:M,ellipsoid:{...T,minimumClock:new es.CallbackProperty(function(){return es.Math.toRadians(C+P)},!1),maximumClock:new es.CallbackProperty(function(){return es.Math.toRadians(C+P+D)},!1),outline:A,material:this._core.defaultValue(m.scanColor&&this._cesium.Color.fromCssColorString(m.scanColor),this._cesium.Color.RED.withAlpha(.5))}}),this.item=this._viewer.entities.add({position:S,orientation:M,ellipsoid:T});var L=this._core.defaultValue(T.speed,1);function R(){P+=.1*L,P<=0&&L<0?(P=0,L=-L):P>=w-D&&L>0&&(P=w-D,L=-L)}this._viewer.clock.onTick.addEventListener(R),this.setRadarMaskValue=(F,k)=>{F==="yaw"?C=k:F==="angle"?w=k>360?360:k:F==="radius"?x=k:F==="scanAngle"?D=k>w?w:k:F==="speed"&&(L=k)},this.deleteObject=()=>{let F=this._viewer;F.entities.remove(this.item),F.entities.remove(this._scan),this._viewer.clock.onTick.removeEventListener(R)};var O={id:this.item.id,name:o,pId:this._core.isnull(v)?0:v,type:"ellipsoid",item:this};return this.setTreeobj(O),this._tree.insertGroupId(O,this._core.isnull(v)?0:v),this};Fu.prototype.ConicSensor=function(o,f,m={}){var v=es.Cartesian3.distance(o,f),y=(m.angle||10)/2,x={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new es.CallbackProperty(function(){return new es.Cartesian3(v,v,v)},!1),outline:m.outline,material:es.Color.RED.withAlpha(.2),outlineColor:es.Color.WHITE.withAlpha(.2),maximumCone:es.Math.toRadians(-y),minimumCone:es.Math.toRadians(y)};m.color&&(x.material=es.Color.fromCssColorString(m.color)),m.outlineColor&&(x.outlineColor=es.Color.fromCssColorString(m.outlineColor));let C=this._core.toDegrees(o),w=this._core.toDegrees(f),A,E,T=0;this.item=this._viewer.entities.add({position:o,ellipsoid:x});let S=()=>{A=this._core.TwoPointAzimuth(C.lon,C.lat,w.lon,w.lat)+90,E=Math.acos((w.height-C.height)/v),E=es.Math.toDegrees(E),this.item.orientation=es.Transforms.headingPitchRollQuaternion(o,new es.HeadingPitchRoll(es.Math.toRadians(this._core.defaultValue(A,0)),es.Math.toRadians(this._core.defaultValue(E,0)),es.Math.toRadians(this._core.defaultValue(T,0))))};S();var M={id:this.item.id,name:"\u9525\u5F62\u4F20\u611F\u5668",pId:0,type:"ellipsoid",item:this};return this.setTreeobj(M),this._tree.insertGroupId(M,0),this.changeStart=I=>{o=I,C=this._core.toDegrees(o),this.item.position=o,v=es.Cartesian3.distance(o,f),S()},this.changeEnd=I=>{f=I,w=this._core.toDegrees(f),v=es.Cartesian3.distance(o,f),S()},this.changeAngle=I=>{y=I/2,this.item.ellipsoid.maximumCone=es.Math.toRadians(-y),this.item.ellipsoid.minimumCone=es.Math.toRadians(y)},this};Fu.prototype.createRadarMask=function(o,f,m,v){var y=this;!m&&(m={});var x=this._core.defaultValue(m.radius,100),C=this._core.defaultValue(m.yaw,0),w=this._core.defaultValue(m.angle,60),A={innerRadii:new this._cesium.Cartesian3(2,2,2),radii:new this._cesium.Cartesian3(x,x,x),maximumCone:this._cesium.Math.toRadians(this._core.defaultValue(m.maxLat,105)),minimumCone:this._cesium.Math.toRadians(this._core.defaultValue(m.minLat,75)),minimumClock:this._cesium.Math.toRadians(C),maximumClock:this._cesium.Math.toRadians(C+w),material:this._cesium.Color.AQUAMARINE.withAlpha(.3),outline:!1,outlineColor:this._cesium.Color.AQUAMARINE.withAlpha(.5),outlineWidth:1},E=this._core.extend(A,m,!0);typeof m.color=="string"&&(E.material=this._cesium.Color.fromCssColorString(m.color)),typeof m.outlineColor=="string"&&(E.outlineColor=this._cesium.Color.fromCssColorString(m.outlineColor)),this.item=this._viewer.entities.add({position:f,ellipsoid:E});var T={id:this.item.id,name:o,pId:this._core.isnull(v)?0:v,type:"ellipsoid",item:this};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),this};Fu.prototype.createConeRadar=function(o,f){!f&&(f={});var m=this;m.lon=o[0],m.lat=o[1],m.height=this._core.defaultValue(o[2],3e3),this.planePosition=null,this.halfLen=m.height/2,this.lengthl=m.height,this.geoD=new this._cesium.EllipsoidGeodesic,this.startPt=this._cesium.Cartographic.fromDegrees(m.lon,m.lat,0),this.changenum=0,this.curCanvas="a";var v=this._viewer.scene.globe.getHeight(this.startPt)||0,y=this._cesium.Color.fromCssColorString(m._core.defaultValue(f.color,"#0000ff"));function x(){return m.lon>o[0]+.01&&m.lat<o[1]+.005?m.lat+=1e-5:m.lat>o[1]+.005&&m.lon>o[0]?m.lon-=1e-5:m.lon<=o[0]&&m.lat>o[1]?m.lat-=1e-5:m.lon+=1e-5,m.planePosition=m._cesium.Cartesian3.fromDegrees(m.lon,m.lat,m.height/2),m.planePosition}function C(){var E=es.Cartographic.fromDegrees(m.lon,o[1],0);m.geoD.setEndPoints(m.startPt,E);var T=m.geoD.surfaceDistance,S=Math.atan(T/m.halfLen),M=es.Cartographic.fromDegrees(m.lon,m.lat,0);m.geoD.setEndPoints(m.startPt,M),T=m.geoD.surfaceDistance,m.lengthl=Math.sqrt(T*T+m.halfLen*m.halfLen);var I=es.Cartographic.fromDegrees(o[0],m.lat,0);m.geoD.setEndPoints(m.startPt,I),T=m.geoD.surfaceDistance;var P=Math.asin(T/m.lengthl),D=new es.HeadingPitchRoll(0,S,P),L=es.Transforms.headingPitchRollQuaternion(m.planePosition,D);return L}function w(){return 2*m.lengthl}this.item=this._viewer.entities.add({name:"Red cone",position:f.rotate?new this._cesium.CallbackProperty(x,!1):m._cesium.Cartesian3.fromDegrees(m.lon,m.lat,(m.height+v)/2),orientation:f.rotate?new this._cesium.CallbackProperty(C,!1):void 0,cylinder:{length:f.rotate?new m._cesium.CallbackProperty(w,!1):m.height-v,topRadius:0,bottomRadius:m._core.defaultValue(f.radius,300),bottomSurface:!1,material:m._core.getConeRadarMaterial(f.color)}});var A={id:this._core.getuid(),name:"\u65B0\u5EFA\u536B\u661F\u96F7\u8FBE",pId:0,type:"ConeRadar",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,0),this};Fu.prototype.setLength=function(o){try{this.item._cylinder.length=o}catch(f){console.log(f)}return this};Fu.prototype.createCylinderOptimization=function(o,f){this.style=o;var m=this;this.handler.setInputAction(function(v){var y=m.getCatesian3FromPX(v.position,m._viewer,[m.circle]);m.positions.length==0&&m.positions.push(y.clone()),m.positions.push(y);var x=m.createPoint(y,!1);m.gonCircleArr.length>0&&(m.positions.pop(),m.state=1,m.handler.destroy());var C=m.createPointStretching(y,!1);C.wq=m.gonCircleArr.length,m.gonPointStretchingArr.push(C),x.wz=m.gonCircleArr.length,m.gonCircleArr.push(x)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(v){if(!(m.positions.length<1)){var y=m.getCatesian3FromPX(v.endPosition,m._viewer,[m.circle]);if(m.positions.length==2&&!m._cesium.defined(m.circle)){var x=m._cesium.Cartographic.fromCartesian(m.positions[0]),C=m._cesium.Math.toDegrees(x.longitude),w=m._cesium.Math.toDegrees(x.latitude),A=m._cesium.Cartographic.fromCartesian(m.positions[1]),E=m._cesium.Math.toDegrees(A.longitude),T=m._cesium.Math.toDegrees(A.latitude);m.topRadius=op(w,C,T,E),m.bottomRadius=op(w,C,T,E),m.circle=m.createCylinder(m.style),m.circle.objId=m.objId}if(m.circle){m.positions.pop(),m.positions.push(y);var x=m._cesium.Cartographic.fromCartesian(m.positions[0]),C=m._cesium.Math.toDegrees(x.longitude),w=m._cesium.Math.toDegrees(x.latitude),A=m._cesium.Cartographic.fromCartesian(m.positions[1]),E=m._cesium.Math.toDegrees(A.longitude),T=m._cesium.Math.toDegrees(A.latitude);m.topRadius=op(w,C,T,E),m.bottomRadius=op(w,C,T,E)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)};Fu.prototype.startModify=function(){var o="\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";if(!(this.state!=2&&this.state!=1)){this.modifyHandler||(this.modifyHandler=new es.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var f=this,m=0;m<f.gonCircleArr.length;m++){var v=f.gonCircleArr[m];v&&(v.show=!0)}if(f.gonPointStretchingArr.length>0)for(var m=0;m<f.gonPointStretchingArr.length;m++){var v=f.gonPointStretchingArr[m];v&&(v.show=!0)}this.modifyHandler.setInputAction(function(y){var x=f._viewer.scene.pick(y.position);if(es.defined(x)&&x.id)x.id.objId||(f.modifyPoint=x.id,o="\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539"),f.forbidDrawWorld(!0);else{for(var C=0;C<f.gonCircleArr.length;C++){var w=f.gonCircleArr[C];w&&(w.show=!1)}if(f.gonPointStretchingArr.length>0)for(var C=0;C<f.gonPointStretchingArr.length;C++){var w=f.gonPointStretchingArr[C];w&&(w.show=!1)}f.modifyHandler&&(f.modifyHandler.destroy(),f.modifyHandler=null)}f.state=2},es.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(y){var x=f._viewer.scene.pick(y.endPosition);if(f._core.CreateTooltip(o,y.endPosition,!1),es.defined(x)&&x.id&&(x.id.objId||f._core.CreateTooltip(o,y.endPosition,!0)),!(f.positions.length<1||!f.modifyPoint)){var C=f.getCatesian3FromPX(y.endPosition,f._viewer,[f.circle,f.modifyPoint]);if(C)if(f.modifyPoint.wq!=null){var w={x:C.x,y:C.y,z:C.z+ +f.length};if(f.positions[f.modifyPoint.wq]=C,f.modifyPoint.wq==0)f.modifyPoint.position.setValue(w),f.gonCircleArr[f.modifyPoint.wq].position=C;else{var A=f._viewer.scene.pickPosition(y.endPosition),E=f._cesium.Cartographic.fromCartesian(A),T=f._cesium.Math.toDegrees(E.longitude),S=f._cesium.Math.toDegrees(E.latitude),M=f._cesium.Cartographic.fromCartesian(f.positions[1]),I=f._cesium.Math.toDegrees(M.longitude),P=f._cesium.Math.toDegrees(M.latitude);f.length=op(S,T,P,I);var D=f._cesium.Cartographic.fromCartesian(f.gonCircleArr[0].position.getValue()),L=f._cesium.Math.toDegrees(D.longitude),R=f._cesium.Math.toDegrees(D.latitude),O=D.height+f.length,F=f._cesium.Cartesian3.fromDegrees(L,R,O),k=f._cesium.Cartographic.fromCartesian(f.gonCircleArr[1].position.getValue()),U=f._cesium.Math.toDegrees(k.longitude),G=f._cesium.Math.toDegrees(k.latitude),j=k.height+f.length,q=f._cesium.Cartesian3.fromDegrees(U,G,j);f.gonPointStretchingArr[0].position.setValue(F),f.gonPointStretchingArr[1].position.setValue(q)}}else if(f.modifyPoint.position.setValue(C),f.positions[f.modifyPoint.wz]=C,f.gonPointStretchingArr[f.modifyPoint.wz].position={x:C.x,y:C.y,z:C.z+f.length},f.modifyPoint.wz&&f.modifyPoint.wz==0)f.gonCircleArr[1].position={x:f.positions[0].x+f.topRadius,y:f.positions[0].y,z:f.positions[0].z},f.gonPointStretchingArr[1].position={x:f.positions[0].x+f.topRadius,y:f.positions[0].y,z:f.positions[0].z+f.length};else{var E=f._cesium.Cartographic.fromCartesian(f.positions[0]),T=f._cesium.Math.toDegrees(E.longitude),S=f._cesium.Math.toDegrees(E.latitude),M=f._cesium.Cartographic.fromCartesian(f.positions[f.modifyPoint.wz]),I=f._cesium.Math.toDegrees(M.longitude),P=f._cesium.Math.toDegrees(M.latitude);f.topRadius=op(S,T,P,I),f.bottomRadius=op(S,T,P,I)}f._core.CreateTooltip(o,y.endPosition,!0)}},es.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(y){!f.modifyPoint||(f.modifyPoint=null,f.forbidDrawWorld(!1),o="\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E")},es.ScreenSpaceEventType.LEFT_UP)}};Fu.prototype.forbidDrawWorld=function(o){this._viewer.scene.screenSpaceCameraController.enableRotate=!o,this._viewer.scene.screenSpaceCameraController.enableTilt=!o,this._viewer.scene.screenSpaceCameraController.enableTranslate=!o,this._viewer.scene.screenSpaceCameraController.enableInputs=!o};Fu.prototype.getCatesian3FromPX=function(o,f,m){var v=f.scene.pick(o),y,x=f.scene.drillPick(o),C=null;if(m){for(var w=0;w<x.length;w++)if(x[w].id._id!=m[0].id&&x[w].id._id!=m[1].id){C=x[w].id;break}}else C=v;if(f.scene.pickPositionSupported&&es.defined(C))y=f.scene.pickPosition(o);else{var A=f.camera.getPickRay(o);if(!A)return;y=f.scene.globe.pick(A,f.scene)}return y};Fu.prototype.createCylinder=function(o){var f=this;return o.length&&(f.length=o.length),this._viewer.entities.add({position:new f._cesium.CallbackProperty(function(){return f.positions[0]},!1),cylinder:{topRadius:new f._cesium.CallbackProperty(function(){return f.topRadius},!1),bottomRadius:new f._cesium.CallbackProperty(function(){return f.bottomRadius},!1),length:new f._cesium.CallbackProperty(function(){return f.length},!1),material:o.material||es.Color.WHITE}})};Fu.prototype.createPoint=function(o,f){if(!!o)return this._viewer.entities.add({position:o,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:f})};Fu.prototype.createPointStretching=function(o,f){if(!!o){var m=es.Cartographic.fromCartesian(o),v=es.Math.toDegrees(m.longitude),y=es.Math.toDegrees(m.latitude),x=m.height+this.length;return o=es.Cartesian3.fromDegrees(v,y,x),this._viewer.entities.add({position:o,point:{pixelSize:10,color:es.Color.fromAlpha(es.Color.FUCHSIA,.5),outlineWidth:2,outlineColor:es.Color.fromAlpha(es.Color.WHITE,.5),heightReference:es.HeightReference.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:f})}},Fu.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.item.cylinder.length==null?void 0:this.item.cylinder.length.getValue(),m=this.item.cylinder.topRadius==null?void 0:this.item.cylinder.topRadius.getValue(),v=this.item.cylinder.bottomRadius==null?void 0:this.item.cylinder.bottomRadius.getValue(),y=this.item.cylinder.fill==null?void 0:this.item.cylinder.fill.getValue(),x=this.item.cylinder.material;x!=null&&(x={color:x.color==null?void 0:"rgba("+x.color._value.red+","+x.color._value.green+","+x.color._value.blue+","+x.color._value.alpha+")",image:x.image==null?void 0:x.image._value,diffusemap:x.diffusemap==null?void 0:x.diffusemap._value,alphamap:x.alphamap==null?void 0:x.alphamap._value});var C=this.item.cylinder.outline==null?void 0:this.item.cylinder.outline._value,w=this.item.cylinder.outlineColor==null?void 0:"rgba("+this.item.cylinder.outlineColor._value.red+","+this.item.cylinder.outlineColor._value.green+","+this.item.cylinder.outlineColor._value.blue+","+this.item.cylinder.outlineColor._value.alpha+")",A=this.item.cylinder.outlineWidth==null?void 0:this.item.cylinder.outlineWidth._value,E=this.item.cylinder.numberOfVerticalLines==null?void 0:this.item.cylinder.numberOfVerticalLines._value,T=this.item.cylinder.slices==null?void 0:this.item.cylinder.slices._value,S=this.item.cylinder.distanceDisplayCondition,M=S?._value.near,I=S?._value.far,P=this._cesium.Cartographic.fromCartesian(this.item.position._value),D=this._cesium.Math.toDegrees(P.longitude),L=this._cesium.Math.toDegrees(P.latitude),R=this._cesium.Math.toDegrees(P.height);return{type:"cylinder",position:{x:D,y:L,z:R},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:o,length:f,topRadius:m,bottomRadius:v,fill:y,material:x,outline:C,outlineColor:w,outlineWidth:A,numberOfVerticalLines:E,slices:T,near:M,far:I}}};Fu.prototype.setTreeobj=function(o){this.treeobj=o};Fu.prototype.setVisibility=function(o){this.item.show=o,this._scan&&(this._scan.show=o),this.wall&&this.wall.forEach(f=>{f.show=o})};Fu.prototype.getVolume=function(){try{var o=0,f=this.item._cylinder.bottomRadius,m=this.item._cylinder.topRadius,v=this.item._cylinder.length;f==0?o=3.14159*f*f*v/3:o=3.14159*f*f*v}catch(y){console.log(y)}return o};Fu.prototype.executeCone=function(o){var f=this;f.shape={tempPoints:[],button:0,position:{}};var m=new this._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas),v=[],y=void 0,x=[];return m.setInputAction(function(C){var w=f._viewer.scene.camera.pickEllipsoid(C.position,f._viewer.scene.globe.ellipsoid),A=f._cesium.Cartographic.fromCartesian(w),E=f._cesium.Math.toDegrees(A.longitude),T=f._cesium.Math.toDegrees(A.latitude);x.push({lon:E,lat:T});var S={polyline:{},positions:[],distance:[]};if(f.shape.button==0)v.push(w.clone()),v.push(w),f.shape.position=w,f.cylinder=f._viewer.entities.add({name:"",position:f._cesium.Cartesian3.fromDegrees(x[0].lon,x[0].lat),cylinder:{length:100,show:!0,fill:!0,topRadius:0,bottomRadius:100,material:f._cesium.Color.RED}}),f.item=f.cylinder;else if(f.shape.button==1){var M=op(x[0].lat,x[0].lon,x[1].lat,x[1].lon);f.item.cylinder.bottomRadius=M}else if(f.shape.button==2){m.destroy();var I=0;!f._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(I=Ne.selectedItem.id);var P=f._core.getuid(),D={id:P,name:"\u65B0\u5EFA\u5706\u9525"+P,pId:f._core.isnull(I)?0:I,type:"cylinder",item:f};this.setTreeobj(D),Ne.insertGroupId(D,f._core.isnull(I)?0:I),typeof o=="function"&&o(S)}f.shape.button=f.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(C){if(f.shape.button==2){var w=f._viewer.camera.getPickRay(C.endPosition),A=f._viewer.scene.globe.pick(w,f._viewer.scene);f.item.cylinder.length=A.z}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this};Fu.prototype.executeCylinder=function(o){var f=this;f.shape={tempPoints:[],button:0,position:{}};var m=new this._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas),v=[],y=void 0,x=[];return m.setInputAction(function(C){var w=f._viewer.scene.camera.pickEllipsoid(C.position,f._viewer.scene.globe.ellipsoid),A=f._cesium.Cartographic.fromCartesian(w),E=f._cesium.Math.toDegrees(A.longitude),T=f._cesium.Math.toDegrees(A.latitude);x.push({lon:E,lat:T});var S={polyline:{},positions:[],distance:[]};if(f.shape.button==0)v.push(w.clone()),v.push(w),f.shape.position=w,f.cylinder=f._viewer.entities.add({name:"",position:f._cesium.Cartesian3.fromDegrees(x[0].lon,x[0].lat),cylinder:{length:100,topRadius:0,bottomRadius:100,material:f._cesium.Color.RED}}),f.item=f.cylinder;else if(f.shape.button==1){var M=op(x[0].lat,x[0].lon,x[1].lat,x[1].lon);f.item.cylinder.bottomRadius=M,f.item.cylinder.topRadius=M}else if(f.shape.button==2){m.destroy();var I=0;!f._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(I=Ne.selectedItem.id);var P=f._core.getuid(),D={id:P,name:"\u65B0\u5EFA\u5706\u67F1"+P,pId:f._core.isnull(I)?0:I,type:"cylinder",item:f};f.setTreeobj(D),Ne.insertGroupId(D,f._core.isnull(I)?0:I),typeof o=="function"&&o(S)}f.shape.button=f.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(C){if(f.shape.button==2){var w=f._viewer.camera.getPickRay(C.endPosition),A=f._viewer.scene.globe.pick(w,f._viewer.scene);f.item.cylinder.length=A.z}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this};Fu.prototype.setTopRadius=function(o){try{this.item._cylinder.topRadius=o}catch(f){console.log(f)}return this};Fu.prototype.setHeight=function(o){try{var f=this._cesium.Cartesian3.fromDegrees(-94.74211811500844,37.34584317651723,o);this.item._position._value.z=f.z}catch(m){console.log(m)}return this};Fu.prototype.deleteObject=function(){let o=this._viewer;o.entities.remove(this.item),this.wall&&(this.wall.forEach(f=>{o.entities.remove(f)}),this.wall=[])};Fu.prototype.setHeightType=function(o){try{o==1?this.item._cylinder.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:o==2?this.item._cylinder.heightReference=this._cesium.HeightReference.NONE:o==3&&(this.item._cylinder.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(f){console.log(f)}return this};Fu.prototype.setCylinderImage=function(o){try{this.item._cylinder.material=new this._cesium.ImageMaterialProperty({image:o})}catch(f){console.log(f)}return this};Fu.prototype.setCylinderRepeat=function(o,f){try{this.item._cylinder.material.repeat=new this._cesium.Cartesian2(o,f)}catch(m){console.log(m)}return this};Fu.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._cylinder.distanceDisplayCondition=m}catch(v){console.log(v)}return this};Fu.prototype.setBottomRadius=function(o){try{this.item._cylinder.bottomRadius=o}catch(f){console.log(f)}return this};Fu.prototype.setShow=function(o){try{this.item._cylinder.show=o}catch(f){console.log(f)}return this};Fu.prototype.setMaterial=function(o){try{this.item._cylinder.material=o}catch(f){console.log(f)}return this};Fu.prototype.setMaterial=function(o){try{this.item._cylinder.material.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};Fu.prototype.setMaterialAlpha=function(o){try{this.item._cylinder.material.color._value.alpha=o,this.item._cylinder.show=!0}catch(f){console.log(f)}return this};Fu.prototype.setItem=function(o){this.item=o};Fu.prototype.CreateCone=function(o,f,m,v,y,x,C,w){this._postion=o;var A={topRadius:0,bottomRadius:this._cesium.defaultValue(f,2e4),length:this._cesium.defaultValue(m,4e4),slices:this._cesium.defaultValue(x,128),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};v&&v!==""&&(A.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(v),A.outline=!0),y&&y!==""&&(A.material=new no(this._viewer,this._cesium).colorFromHtmlColor(y));var E;(o.Yaw||o.Pitch||o.Roll)&&(E=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(o.Yaw),this._cesium.Math.toRadians(o.Pitch),this._cesium.Math.toRadians(o.Roll)))),this.item=this._viewer.entities.add({name:w,position:this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),cylinder:A,orientation:E});var T={id:this.item.id,name:w,pId:this._core.isnull(C)?0:C,type:"cylinder",item:this};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(C)?0:C),this};Fu.prototype.CreateCylinder=function(o,f,m,v,y,x,C,w){this._postion=o;var A={topRadius:this._cesium.defaultValue(f,2e4),bottomRadius:this._cesium.defaultValue(f,2e4),length:this._cesium.defaultValue(m,4e4),slices:this._cesium.defaultValue(x,128),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};v&&v!==""&&(A.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(v),A.outline=!0),y&&y!==""&&(A.material=new no(this._viewer,this._cesium).colorFromHtmlColor(y));var E;(o.Yaw||o.Pitch||o.Roll)&&(E=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(o.Yaw),this._cesium.Math.toRadians(o.Pitch),this._cesium.Math.toRadians(o.Roll)))),this.item=this._viewer.entities.add({name:w,position:this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),cylinder:A,orientation:E});var T={id:this.item.id,name:w,pId:this._core.isnull(C)?0:C,type:"cylinder",item:this};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(C)?0:C),this};Object.defineProperties(Fu.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(o){try{this._postion.Altitude=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(o){try{this._postion.AltitudeType=o}catch(f){console.log(f)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(o){try{this._postion.Cartesian=o}catch(f){console.log(f)}}},Distance:{get:function(){return this._postion.Distance},set:function(o){try{this._postion.Distance=o}catch(f){console.log(f)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(o){try{this._postion.Pitch=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},Roll:{get:function(){return this._postion.Roll},set:function(o){try{this._postion.Roll=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},X:{get:function(){return this._postion.X},set:function(o){try{this._postion.X=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Y:{get:function(){return this._postion.Y},set:function(o){try{this._postion.Y=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(o){try{this._postion.Yaw=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}}}});var X0=Fu;var Uu=null;function IP(o,f){this._viewer=o,Uu=f,this.item=null}IP.prototype.createRoad=function(o={}){let f={id:o.id||Uu.createGuid(),image:`${window.SmartEarthRootUrl}Workers/image/road.jpg`,height:.15,width:20,repeat:{x:1,y:1},...o};this.options=f,this.id=f.id,this._show=!1;let m=this.getRoadPosition(f.positions,f.width);if(!m)return;let v=this,y=this.splitPosition(m);return this.roadCartesianArray=y,this.roadEntites=[],y.forEach((x,C)=>{let w=v.getRoadTs(x);v.uv=w;let A=new Uu.Entity({polygon:{hierarchy:new Uu.PolygonHierarchy(x),height:f.height,textureCoordinates:new Uu.PolygonHierarchy(w[0].reverse()),material:new Uu.ImageMaterialProperty({image:f.image,repeat:new Uu.Cartesian2(1,w[1])}),...f.polygonGraphics}});v.roadEntites.push(A),v._viewer.entities.add(A),v._show=!0}),this};IP.prototype.getRoadPosition=function(o,f){if(o)if(o.length){if(o.length<2)return}else return;else return;let m=[],v=[];for(let A=0;A<o.length;A++){let E=this.toDegrees(o[A]),T=[E.lon,E.lat];m.push(T)}let y=Uu.turf.lineString(m),x=Uu.turf.lineOffset(y,-f/2,{units:"meters"}),C=Uu.turf.lineOffset(y,f/2,{units:"meters"});m=x.geometry.coordinates,m.map(A=>{v.push(A[0],A[1],10)});let w=C.geometry.coordinates;return w.reverse(),w.map(A=>{v.push(A[0],A[1],10)}),this.roadDegreesArray=v,Uu.Cartesian3.fromDegreesArrayHeights(this.roadDegreesArray)};IP.prototype.splitPosition=function(o){let f=[];this.roadSplitArray=[];let m=o.length,v=m/2-1;for(let y=0;y<m;y++)y<v?(f.push([o[y],o[y+1]]),this.roadSplitArray.push([this.roadDegreesArray[y],this.roadDegreesArray[y+1]])):y>v&&v>0&&(f[v-1].push(o[y],o[y+1]),this.roadSplitArray[v-1].push([this.roadDegreesArray[y],this.roadDegreesArray[y+1]]),v--);return this.roadDegreesArray=void 0,f};IP.prototype.getRoadTs=function(o){let f,m,v,y,x,C,w,A=this.options.width,E=Uu.Cartesian3.subtract(o[1],o[0],new Uu.Cartesian3(0,0,0)),T=Uu.Cartesian3.subtract(o[2],o[1],new Uu.Cartesian3(0,0,0)),S=Uu.Cartesian3.subtract(o[3],o[2],new Uu.Cartesian3(0,0,0)),M=Uu.Cartesian3.subtract(o[0],o[3],new Uu.Cartesian3(0,0,0)),I=Uu.Cartesian3.angleBetween(E,T),P=Uu.Cartesian3.angleBetween(S,M),D=Uu.Math.toDegrees(I),L=Uu.Math.toDegrees(P);if(D<90){let G=new Uu.Ray(o[1],E),j=A/Math.tan(I);f=Uu.Ray.getPoint(G,j),x=f,C=o[2]}else if(D>90){let G=new Uu.Ray(o[2],S),j=A/Math.tan(Math.PI-I);f=Uu.Ray.getPoint(G,-j),x=o[1],C=f}else f=o[1],x=o[1],C=o[2];if(L<90){let G=new Uu.Ray(o[3],S),j=A/Math.tan(P);m=Uu.Ray.getPoint(G,j),y=o[0],w=m}else if(L>90){let G=new Uu.Ray(o[0],E),j=A/Math.tan(Math.PI-P);m=Uu.Ray.getPoint(G,-j),y=m,w=o[3]}else m=o[3],y=o[0],w=o[3];v=Uu.Cartesian3.distance(y,x)/A;let R=Uu.Cartesian3.distance(y,o[0])/A/v,O=Uu.Cartesian3.distance(y,o[1])/A/v,F=Uu.Cartesian3.distance(w,o[2])/A/v,k=Uu.Cartesian3.distance(w,o[3])/A/v;return[[{x:1,y:R>1?1:R},{x:1,y:O>1?1:O},{x:0,y:F>1?1:F},{x:0,y:k>1?1:k}],v]};IP.prototype.toDegrees=function(o){let f=Uu.Cartographic.fromCartesian(o);return{lon:Uu.Math.toDegrees(f.longitude),lat:Uu.Math.toDegrees(f.latitude),hei:f.height}};IP.prototype.destroy=function(){let o=this;this.roadEntites.forEach(f=>{o._viewer.entities.remove(f)}),this._show=!1};IP.prototype.remove=function(){this.destroy()};IP.prototype.setVisibility=function(o){this.roadEntites.forEach(f=>{f.show=o}),this._show=o};Object.defineProperties(IP.prototype,{show:{get:function(){return this._show},set:function(o){this.setVisibility(o)}}});var kct=IP;var Rp=null;function MP(o,f){Rp=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this.TrailEntitys=[]}MP.prototype.createSatelliteTrail=function(o){!o&&(o={});let f=this._viewer,m=new Rp.JulianDate.fromDate(new Date),v=Rp.JulianDate.addSeconds(m,3600,new Rp.JulianDate);f.clock.startTime=o.start||m.clone(),f.clock.stopTime=o.stop||v.clone(),f.clock.currentTime=o.start||m.clone(),f.clock.clockRange=Rp.ClockRange.LOOP_STOP,f.clock.multiplier=o.speed||2,this.flyHeight=o.height||7e5;let y=[];return o.path?y=o.path:this.getRandState(y,2),y.forEach(x=>{this.getStatePath(x,o)}),this};MP.prototype.getStatePath=function(o,f){let m=this._viewer,v=m.clock.startTime.clone(),y=m.clock.stopTime.clone(),x=this.computeCirclularFlight(o,2),C=m.entities.add({availability:new Rp.TimeIntervalCollection([new Rp.TimeInterval({start:v,stop:y})]),position:x,orientation:new Rp.VelocityOrientationProperty(x),cylinder:{HeightReference:Rp.HeightReference.CLAMP_TO_GROUND,length:this.flyHeight,topRadius:0,bottomRadius:this.flyHeight/2,material:this._core.getConeRadarMaterial(f.radarColor||"#00ff00"),outline:!1,numberOfVerticalLines:0}});C.position.setInterpolationOptions({interpolationDegree:5,interpolationAlgorithm:Rp.LagrangePolynomialApproximation}),this.TrailEntitys.push(C);let w=this.computeCirclularFlight(o,1),A={availability:new Rp.TimeIntervalCollection([new Rp.TimeInterval({start:v,stop:y})]),position:w,orientation:new Rp.VelocityOrientationProperty(w),path:{resolution:1,material:new Rp.PolylineGlowMaterialProperty({color:Rp.Color.DEEPSKYBLUE}),width:f.width||5}};f.img?typeof f.img=="object"?A.billboard=f.img:typeof f.img=="string"&&(A.billboard={image:f.img,scale:f.scale}):A.model={uri:f.model||window.SmartEarthRootUrl+pn.flyModel,minimumPixelSize:32,scale:f.scale};let E=m.entities.add(A);E.position.setInterpolationOptions({interpolationDegree:5,interpolationAlgorithm:Rp.LagrangePolynomialApproximation}),this.TrailEntitys.push(E)};MP.prototype.clear=function(){this.TrailEntitys.forEach(o=>{this._viewer.entities.remove(o)}),this.TrailEntitys=[]};MP.prototype.faster=function(){this._viewer.animation.viewModel.faster()};MP.prototype.slower=function(){this._viewer.animation.viewModel.slower()};MP.prototype.setSpeed=function(o){this._viewer.clock.multiplier=parseFloat(o)};MP.prototype.isPause=function(o){var f=this._viewer.clockViewModel;f.shouldAnimate=!o};MP.prototype.computeCirclularFlight=function(o,f){let m=this._viewer.clock.startTime.clone(),v=new Rp.SampledPositionProperty;if(f==1)for(let y=0;y<o.length;y++){let x=Rp.JulianDate.addSeconds(m,o[y].time,new Rp.JulianDate),C=Rp.Cartesian3.fromDegrees(o[y].lon,o[y].lat,o[y].hei);v.addSample(x,C)}else if(f==2)for(let y=0;y<o.length;y++){let x=Rp.JulianDate.addSeconds(m,o[y].time,new Rp.JulianDate),C=Rp.Cartesian3.fromDegrees(o[y].lon,o[y].lat,o[y].phei);v.addSample(x,C)}return v};function Vct(o){this.lon=0,this.lat=0,this.hei=o,this.phei=o/2,this.time=0}MP.prototype.getRandState=function(o,f){let m=this.flyHeight;for(let v=0;v<f;v++){let y=[],x=Math.floor(Math.random()*180);for(let C=0;C<=360;C+=30){let w=new Vct(m);C<=180?(w.lon=x,w.lat=C-90,w.time=C*10,y.push(w)):(w.lon=x-180,w.lat=270-C,w.time=C*10,y.push(w))}o.push(y)}for(let v=0;v<f;v++){let y=[],x=Math.floor(Math.random()*180)-90;for(let C=-180;C<=180;C+=30){let w=new Vct(m);w.lon=C,w.lat=x,w.time=(C+180)*10,y.push(w)}o.push(y)}};var Cle=MP;var df=null;function DP(o,f){df=f,this._viewer=o,this._core=new Sr(o,f),this._tree=Ne}DP.prototype.create=function(o,f,m={}){this.angle=(m.angle||10)/2,this.heading=this.pitch=this.roll=0;let v={subdivisions:6,stackPartitions:30,slicePartitions:30,innerRadii:new df.Cartesian3(1,1,1),radii:new df.CallbackProperty(()=>new df.Cartesian3(this.radius,this.radius,this.radius),!1),outline:m.outline,material:df.Color.RED.withAlpha(.2),outlineColor:df.Color.WHITE.withAlpha(.2),maximumCone:new df.CallbackProperty(()=>df.Math.toRadians(-this.angle),!1),minimumCone:new df.CallbackProperty(()=>df.Math.toRadians(this.angle),!1)};m.color&&(v.material=df.Color.fromCssColorString(m.color)),m.outlineColor&&(v.outlineColor=df.Color.fromCssColorString(m.outlineColor));let y=o instanceof df.Entity?o:void 0,x=f instanceof df.Entity?f:void 0;y?this.startPosition=y.position.getValue(this._viewer.clock.currentTime.clone()):this.startPosition=o,this.degrees1=this._core.toDegrees(this.startPosition),x?this.endPosition=x.position.getValue(this._viewer.clock.currentTime.clone()):this.endPosition=f,this.degrees2=this._core.toDegrees(this.endPosition),this.item=this._viewer.entities.add({position:new df.CallbackProperty(()=>(y&&(this.startPosition=y.position.getValue(this._viewer.clock.currentTime.clone()),this.degrees1=this._core.toDegrees(this.startPosition)),x&&(this.endPosition=x.position.getValue(this._viewer.clock.currentTime.clone()),this.degrees2=this._core.toDegrees(this.endPosition)),(y||x)&&(this.radius=df.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation()),this.startPosition),!1),ellipsoid:v}),this.radius=df.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation();var C={id:this.item.id,name:"\u9525\u5F62\u4F20\u611F\u5668",pId:0,type:"ellipsoid",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,0),this};DP.prototype.getOrientation=function(){let o=this._core.twoPointsHeadingPitchRoll(this._viewer,this.startPosition,this.endPosition);this.heading=df.Math.toDegrees(o.heading)+90,this.pitch=90-df.Math.toDegrees(o.pitch)};DP.prototype.updateOrientation=function(){this.getOrientation(),this.item.orientation=df.Transforms.headingPitchRollQuaternion(this.startPosition,new df.HeadingPitchRoll(df.Math.toRadians(this._core.defaultValue(this.heading,0)),df.Math.toRadians(this._core.defaultValue(this.pitch,0)),df.Math.toRadians(this._core.defaultValue(this.roll,0))))};DP.prototype.changeStart=function(o){this.startPosition=o,this.degrees1=this._core.toDegrees(this.startPosition),this.radius=df.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation()};DP.prototype.changeEnd=function(o){this.endPosition=o,this.degrees2=this._core.toDegrees(this.endPosition),this.radius=df.Cartesian3.distance(this.startPosition,this.endPosition),this.updateOrientation()};DP.prototype.changeAngle=function(o){this.angle=o/2};DP.prototype.setTreeobj=function(o){this.treeobj=o};DP.prototype.setVisibility=function(o){this.item&&(this.item.show=o)};DP.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)};var ble=DP;function O4(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}O4.prototype.addCZML=function(o,f,m){var v=this;!f&&(f={});var y=new this._cesium.CzmlDataSource;let x=this._viewer.dataSources.add(y);this.item=y,this._option=f,this.item.process(o).then(function(w){v.Pretreatment(w,f),m&&typeof m=="function"&&m(w)});var C={id:this._core.getuid(),name:"\u65B0\u5EFACZML",pId:0,type:"CZML",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,0),this};O4.prototype.process=function(o,f){let m=this;this.item&&this.item.process(o).then(function(v){m.Pretreatment(v,m._option),f&&typeof f=="function"&&f(v)})};O4.prototype.Pretreatment=function(o,f){let m=this;o.entities.values.forEach(y=>{if(y.id.indexOf("Link_")===0)y.polyline.material=m._core.getLinkMaterial(f.linkColor,f.linkPointColor,f.linkTime);else if(y.id.indexOf("ConeRadar_")===0)y.cylinder.material=m._core.getConeRadarMaterial(f.coneRadarColor);else if(y.id.indexOf("MultiCircleScan_")===0)y.ellipse.material=m._core.getMultiCircleScanMaterial(f.multiCircleColor,f.multiCircleTime);else if(y.id.indexOf("SectorScan_")===0){let x=m._core.defaultValue(f.sectorScanAngle,45);y.ellipse.material=m._core.getSectorScanMaterial(f.sectorScanColor,x),y.ellipse.stRotation=new m._cesium.CallbackProperty(function(C,w){let A=y.orientation.getValue(C,w);return m._cesium.HeadingPitchRoll.fromQuaternion(A).heading-Math.PI/2},!1)}else y.id.indexOf("CircleScan_")===0?y.ellipse.material=m._core.getCircleScanMaterial(f.circleScanColor,f.circleScanTime):y.id.indexOf("RadarScan_")===0&&(y.ellipse.material=m._core.getRadarScanMaterial(f.radarScanColor,f.radarScanTime))})};O4.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)};O4.prototype.setTreeobj=function(o){this.treeobj=o};O4.prototype.setVisibility=function(o){this.item!=null&&(this.item.show=o)};var wle=O4;var ch={version:"1.0.0"},LP={type:"doublearrow",headHeightFactor:.25,headWidthFactor:.3,neckHeightFactor:.85,fixPointCount:4,neckWidthFactor:.15},Ale={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},aJ={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};ch.algorithm={};ch.algorithm.doubleArrow=function(o){this.connPoint=null,this.tempPoint4=null,this.points=o;var f={controlPoint:null,polygonalPoint:null},m=o.length;if(!(2>m)){if(m==2)return o;var v=this.points[0],y=this.points[1],x=this.points[2],m=o.length;m==3?this.tempPoint4=ch.algorithm.getTempPoint4(v,y,x):this.tempPoint4=this.points[3],m==3||m==4?this.connPoint=qr.PlotUtils.mid(v,y):this.connPoint=this.points[4];var C,w;qr.PlotUtils.isClockWise(v,y,x)?(C=ch.algorithm.getArrowPoints(v,this.connPoint,this.tempPoint4,!1),w=ch.algorithm.getArrowPoints(this.connPoint,y,x,!0)):(C=ch.algorithm.getArrowPoints(y,this.connPoint,x,!1),w=ch.algorithm.getArrowPoints(this.connPoint,v,this.tempPoint4,!0));var A=C.length,E=(A-5)/2,T=C.slice(0,E),S=C.slice(E,E+5),M=C.slice(E+5,A),I=w.slice(0,E),P=w.slice(E,E+5),D=w.slice(E+5,A);I=qr.PlotUtils.getBezierPoints(I);var L=qr.PlotUtils.getBezierPoints(D.concat(T.slice(1)));M=qr.PlotUtils.getBezierPoints(M);var R=I.concat(P,L,S,M),O=ch.algorithm.array2Dto1D(R);f.controlPoint=[v,y,x,this.tempPoint4,this.connPoint],f.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(O)}return f};ch.algorithm.threeArrow=function(o){this.connPoint=null,this.tempPoint4=null,this.tempPoint5=null,this.points=o;var f={controlPoint:null,polygonalPoint:null},m=o.length;if(m>=2){if(m==2)return o;var v=this.points[0],y=this.points[1],x=this.points[2],m=o.length;m==3?(this.tempPoint4=ch.algorithm.getTempPoint4(v,y,x),this.tempPoint5=qr.PlotUtils.mid(x,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),m<6?this.connPoint=qr.PlotUtils.mid(v,y):this.connPoint=this.points[5];var C,w;qr.PlotUtils.isClockWise(v,y,x)?(C=ch.algorithm.getArrowPoints(v,this.connPoint,this.tempPoint4,!1),w=ch.algorithm.getArrowPoints(this.connPoint,y,x,!0)):(C=ch.algorithm.getArrowPoints(y,this.connPoint,x,!1),w=ch.algorithm.getArrowPoints(this.connPoint,v,this.tempPoint4,!0));var A=C.length,E=(A-5)/2,T=C.slice(0,E),S=C.slice(E,E+5),M=C.slice(E+5,A),I=w.slice(0,E),P=w.slice(E,E+5),D=w.slice(E+5,A);I=qr.PlotUtils.getBezierPoints(I);var L=qr.PlotUtils.getBezierPoints(D.concat(T.slice(1)));M=qr.PlotUtils.getBezierPoints(M);var R=I.concat(P,L,S,M),O=ch.algorithm.array2Dto1D(R);f.controlPoint=[v,y,x,this.tempPoint4,this.tempPoint5,this.connPoint],f.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(O)}return f};ch.algorithm.array2Dto1D=function(o){var f=[];return o.forEach(function(m){f.push(m[0]),f.push(m[1])}),f};ch.algorithm.getArrowPoints=function(o,f,m,v){this.type=LP.type,this.headHeightFactor=LP.headHeightFactor,this.headWidthFactor=LP.headWidthFactor,this.neckHeightFactor=LP.neckHeightFactor,this.neckWidthFactor=LP.neckWidthFactor;var y=qr.PlotUtils.mid(o,f),x=qr.PlotUtils.distance(y,m),C=qr.PlotUtils.getThirdPoint(m,y,0,.3*x,!0),w=qr.PlotUtils.getThirdPoint(m,y,0,.5*x,!0);C=qr.PlotUtils.getThirdPoint(y,C,qr.Constants.HALF_PI,x/5,v),w=qr.PlotUtils.getThirdPoint(y,w,qr.Constants.HALF_PI,x/4,v);var A=[y,C,w,m],E=ch.algorithm.getArrowHeadPoints(A,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),T=E[0],S=E[4],M=qr.PlotUtils.distance(o,f)/qr.PlotUtils.getBaseLength(A)/2,I=ch.algorithm.getArrowBodyPoints(A,T,S,M),P=I.length,D=I.slice(0,P/2),L=I.slice(P/2,P);return D.push(T),L.push(S),D=D.reverse(),D.push(f),L=L.reverse(),L.push(o),D.reverse().concat(E,L)};ch.algorithm.getArrowHeadPoints=function(o,f,m){this.type=LP.type,this.headHeightFactor=LP.headHeightFactor,this.headWidthFactor=LP.headWidthFactor,this.neckHeightFactor=LP.neckHeightFactor,this.neckWidthFactor=LP.neckWidthFactor;var v=qr.PlotUtils.getBaseLength(o),y=v*this.headHeightFactor,x=o[o.length-1],C=(qr.PlotUtils.distance(f,m),y*this.headWidthFactor),w=y*this.neckWidthFactor,A=y*this.neckHeightFactor,E=qr.PlotUtils.getThirdPoint(o[o.length-2],x,0,y,!0),T=qr.PlotUtils.getThirdPoint(o[o.length-2],x,0,A,!0),S=qr.PlotUtils.getThirdPoint(x,E,qr.Constants.HALF_PI,C,!1),M=qr.PlotUtils.getThirdPoint(x,E,qr.Constants.HALF_PI,C,!0),I=qr.PlotUtils.getThirdPoint(x,T,qr.Constants.HALF_PI,w,!1),P=qr.PlotUtils.getThirdPoint(x,T,qr.Constants.HALF_PI,w,!0);return[I,S,x,M,P]};ch.algorithm.getArrowBodyPoints=function(o,f,m,v){for(var y=qr.PlotUtils.wholeDistance(o),x=qr.PlotUtils.getBaseLength(o),C=x*v,w=qr.PlotUtils.distance(f,m),A=(C-w)/2,E=0,T=[],S=[],M=1;M<o.length-1;M++){var I=qr.PlotUtils.getAngleOfThreePoints(o[M-1],o[M],o[M+1])/2;E+=qr.PlotUtils.distance(o[M-1],o[M]);var P=(C/2-E/y*A)/Math.sin(I),D=qr.PlotUtils.getThirdPoint(o[M-1],o[M],Math.PI-I,P,!0),L=qr.PlotUtils.getThirdPoint(o[M-1],o[M],I,P,!1);T.push(D),S.push(L)}return T.concat(S)};ch.algorithm.getTempPoint4=function(o,f,m){var v,y,x,C,w=qr.PlotUtils.mid(o,f),A=qr.PlotUtils.distance(w,m),E=qr.PlotUtils.getAngleOfThreePoints(o,w,m);return E<qr.Constants.HALF_PI?(y=A*Math.sin(E),x=A*Math.cos(E),C=qr.PlotUtils.getThirdPoint(o,w,qr.Constants.HALF_PI,y,!1),v=qr.PlotUtils.getThirdPoint(w,C,qr.Constants.HALF_PI,x,!0)):E>=qr.Constants.HALF_PI&&E<Math.PI?(y=A*Math.sin(Math.PI-E),x=A*Math.cos(Math.PI-E),C=qr.PlotUtils.getThirdPoint(o,w,qr.Constants.HALF_PI,y,!1),v=qr.PlotUtils.getThirdPoint(w,C,qr.Constants.HALF_PI,x,!1)):E>=Math.PI&&E<1.5*Math.PI?(y=A*Math.sin(E-Math.PI),x=A*Math.cos(E-Math.PI),C=qr.PlotUtils.getThirdPoint(o,w,qr.Constants.HALF_PI,y,!0),v=qr.PlotUtils.getThirdPoint(w,C,qr.Constants.HALF_PI,x,!0)):(y=A*Math.sin(2*Math.PI-E),x=A*Math.cos(2*Math.PI-E),C=qr.PlotUtils.getThirdPoint(o,w,qr.Constants.HALF_PI,y,!0),v=qr.PlotUtils.getThirdPoint(w,C,qr.Constants.HALF_PI,x,!1)),v};ch.algorithm.tailedAttackArrow=function(o){o=ch.algorithm.dereplication(o),this.tailWidthFactor=Ale.tailWidthFactor,this.swallowTailFactor=Ale.swallowTailFactor,this.swallowTailPnt=Ale.swallowTailPnt;var f={controlPoint:null,polygonalPoint:null};f.controlPoint=o;var m=o.length;if(!(2>m)){if(o.length==2)return f.polygonalPoint=o,f;var v=o,y=v[0],x=v[1];qr.PlotUtils.isClockWise(v[0],v[1],v[2])&&(y=v[1],x=v[0]);var C=qr.PlotUtils.mid(y,x),w=[C].concat(v.slice(2)),A=ch.algorithm.getAttackArrowHeadPoints(w,y,x,Ale),E=A[0],T=A[4],S=qr.PlotUtils.distance(y,x),M=qr.PlotUtils.getBaseLength(w),I=M*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=qr.PlotUtils.getThirdPoint(w[1],w[0],0,I,!0);var P=S/M,D=ch.algorithm.getAttackArrowBodyPoints(w,E,T,P),m=D.length,L=[y].concat(D.slice(0,m/2));L.push(E);var R=[x].concat(D.slice(m/2,m)),O=[];R.push(T),L=qr.PlotUtils.getQBSplinePoints(L),R=qr.PlotUtils.getQBSplinePoints(R),O=ch.algorithm.array2Dto1D(L.concat(A,R.reverse(),[this.swallowTailPnt,L[0]])),f.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(O)}return f};ch.algorithm.getAttackArrowHeadPoints=function(o,f,m,v){this.headHeightFactor=v.headHeightFactor,this.headTailFactor=v.headTailFactor,this.headWidthFactor=v.headWidthFactor,this.neckWidthFactor=v.neckWidthFactor,this.neckHeightFactor=v.neckHeightFactor;var y=qr.PlotUtils.getBaseLength(o),x=y*this.headHeightFactor,C=o[o.length-1];y=qr.PlotUtils.distance(C,o[o.length-2]);var w=qr.PlotUtils.distance(f,m);x>w*this.headTailFactor&&(x=w*this.headTailFactor);var A=x*this.headWidthFactor,E=x*this.neckWidthFactor;x=x>y?y:x;var T=x*this.neckHeightFactor,S=qr.PlotUtils.getThirdPoint(o[o.length-2],C,0,x,!0),M=qr.PlotUtils.getThirdPoint(o[o.length-2],C,0,T,!0),I=qr.PlotUtils.getThirdPoint(C,S,qr.Constants.HALF_PI,A,!1),P=qr.PlotUtils.getThirdPoint(C,S,qr.Constants.HALF_PI,A,!0),D=qr.PlotUtils.getThirdPoint(C,M,qr.Constants.HALF_PI,E,!1),L=qr.PlotUtils.getThirdPoint(C,M,qr.Constants.HALF_PI,E,!0);return[D,I,C,P,L]};ch.algorithm.getAttackArrowBodyPoints=function(o,f,m,v){for(var y=qr.PlotUtils.wholeDistance(o),x=qr.PlotUtils.getBaseLength(o),C=x*v,w=qr.PlotUtils.distance(f,m),A=(C-w)/2,E=0,T=[],S=[],M=1;M<o.length-1;M++){var I=qr.PlotUtils.getAngleOfThreePoints(o[M-1],o[M],o[M+1])/2;E+=qr.PlotUtils.distance(o[M-1],o[M]);var P=(C/2-E/y*A)/Math.sin(I),D=qr.PlotUtils.getThirdPoint(o[M-1],o[M],Math.PI-I,P,!0),L=qr.PlotUtils.getThirdPoint(o[M-1],o[M],I,P,!1);T.push(D),S.push(L)}return T.concat(S)};ch.algorithm.dereplication=function(o){var f=o[o.length-1],m=!1,v=[];return v=o.filter(function(y){if(y[0]!=f[0]&&y[1]!=f[1])return y;m=!0}),m&&v.push(f),v};ch.algorithm.fineArrow=function(o,f){if(!(o.length<2||f.length<2)){var m=aJ.tailWidthFactor,v=aJ.neckWidthFactor,y=aJ.headWidthFactor,x=aJ.headAngle,C=aJ.neckAngle,w=[];return w[0]=o,w[1]=f,e=w[0],r=w[1],n=qr.PlotUtils.getBaseLength(w),g=n*m,i=n*v,s=n*y,a=qr.PlotUtils.getThirdPoint(r,e,qr.Constants.HALF_PI,g,!0),l=qr.PlotUtils.getThirdPoint(r,e,qr.Constants.HALF_PI,g,!1),u=qr.PlotUtils.getThirdPoint(e,r,x,s,!1),c=qr.PlotUtils.getThirdPoint(e,r,x,s,!0),p=qr.PlotUtils.getThirdPoint(e,r,C,i,!1),h=qr.PlotUtils.getThirdPoint(e,r,C,i,!0),d=[],d.push(a[0],a[1],p[0],p[1],u[0],u[1],r[0],r[1],c[0],c[1],h[0],h[1],l[0],l[1],e[0],e[1]),Cesium.Cartesian3.fromDegreesArray(d)}};var qr={version:"1.0.0"};qr.PlotUtils={},qr.PlotUtils.distance=function(o,f){return Math.sqrt(Math.pow(o[0]-f[0],2)+Math.pow(o[1]-f[1],2))},qr.PlotUtils.wholeDistance=function(o){for(var f=0,m=0;m<o.length-1;m++)f+=qr.PlotUtils.distance(o[m],o[m+1]);return f},qr.PlotUtils.getBaseLength=function(o){return Math.pow(qr.PlotUtils.wholeDistance(o),.99)},qr.PlotUtils.mid=function(o,f){return[(o[0]+f[0])/2,(o[1]+f[1])/2]},qr.PlotUtils.getCircleCenterOfThreePoints=function(o,f,m){var v=[(o[0]+f[0])/2,(o[1]+f[1])/2],y=[v[0]-o[1]+f[1],v[1]+o[0]-f[0]],x=[(o[0]+m[0])/2,(o[1]+m[1])/2],C=[x[0]-o[1]+m[1],x[1]+o[0]-m[0]];return qr.PlotUtils.getIntersectPoint(v,y,x,C)},qr.PlotUtils.getIntersectPoint=function(o,f,m,v){if(o[1]==f[1]){var y=(v[0]-m[0])/(v[1]-m[1]),x=y*(o[1]-m[1])+m[0],C=o[1];return[x,C]}if(m[1]==v[1]){var w=(f[0]-o[0])/(f[1]-o[1]);return x=w*(m[1]-o[1])+o[0],C=m[1],[x,C]}return w=(f[0]-o[0])/(f[1]-o[1]),y=(v[0]-m[0])/(v[1]-m[1]),C=(w*o[1]-o[0]-y*m[1]+m[0])/(w-y),x=w*C-w*o[1]+o[0],[x,C]},qr.PlotUtils.getAzimuth=function(o,f){var m,v=Math.asin(Math.abs(f[1]-o[1])/qr.PlotUtils.distance(o,f));return f[1]>=o[1]&&f[0]>=o[0]?m=v+Math.PI:f[1]>=o[1]&&f[0]<o[0]?m=qr.Constants.TWO_PI-v:f[1]<o[1]&&f[0]<o[0]?m=v:f[1]<o[1]&&f[0]>=o[0]&&(m=Math.PI-v),m},qr.PlotUtils.getAngleOfThreePoints=function(o,f,m){var v=qr.PlotUtils.getAzimuth(f,o)-qr.PlotUtils.getAzimuth(f,m);return 0>v?v+qr.Constants.TWO_PI:v},qr.PlotUtils.isClockWise=function(o,f,m){return(m[1]-o[1])*(f[0]-o[0])>(f[1]-o[1])*(m[0]-o[0])},qr.PlotUtils.getPointOnLine=function(o,f,m){var v=f[0]+o*(m[0]-f[0]),y=f[1]+o*(m[1]-f[1]);return[v,y]},qr.PlotUtils.getCubicValue=function(o,f,m,v,y){o=Math.max(Math.min(o,1),0);var x=1-o,C=o*o,w=C*o,A=x*x,E=A*x,T=E*f[0]+3*A*o*m[0]+3*x*C*v[0]+w*y[0],S=E*f[1]+3*A*o*m[1]+3*x*C*v[1]+w*y[1];return[T,S]},qr.PlotUtils.getThirdPoint=function(o,f,m,v,y){var x=qr.PlotUtils.getAzimuth(o,f),C=y?x+m:x-m,w=v*Math.cos(C),A=v*Math.sin(C);return[f[0]+w,f[1]+A]},qr.PlotUtils.getArcPoints=function(o,f,m,v){var y,x,C=[],w=v-m;w=0>w?w+qr.Constants.TWO_PI:w;for(var A=0;A<=qr.Constants.FITTING_COUNT;A++){var E=m+w*A/qr.Constants.FITTING_COUNT;y=o[0]+f*Math.cos(E),x=o[1]+f*Math.sin(E),C.push([y,x])}return C},qr.PlotUtils.getBisectorNormals=function(o,f,m,v){var y=qr.PlotUtils.getNormal(f,m,v),x=Math.sqrt(y[0]*y[0]+y[1]*y[1]),C=y[0]/x,w=y[1]/x,A=qr.PlotUtils.distance(f,m),E=qr.PlotUtils.distance(m,v);if(x>qr.Constants.ZERO_TOLERANCE)if(qr.PlotUtils.isClockWise(f,m,v)){var T=o*A,S=m[0]-T*w,M=m[1]+T*C,I=[S,M];T=o*E,S=m[0]+T*w,M=m[1]-T*C;var P=[S,M]}else T=o*A,S=m[0]+T*w,M=m[1]-T*C,I=[S,M],T=o*E,S=m[0]-T*w,M=m[1]+T*C,P=[S,M];else S=m[0]+o*(f[0]-m[0]),M=m[1]+o*(f[1]-m[1]),I=[S,M],S=m[0]+o*(v[0]-m[0]),M=m[1]+o*(v[1]-m[1]),P=[S,M];return[I,P]},qr.PlotUtils.getNormal=function(o,f,m){var v=o[0]-f[0],y=o[1]-f[1],x=Math.sqrt(v*v+y*y);v/=x,y/=x;var C=m[0]-f[0],w=m[1]-f[1],A=Math.sqrt(C*C+w*w);C/=A,w/=A;var E=v+C,T=y+w;return[E,T]},qr.PlotUtils.getCurvePoints=function(o,f){for(var m=qr.PlotUtils.getLeftMostControlPoint(f),v=[m],y=0;y<f.length-2;y++){var x=f[y],C=f[y+1],w=f[y+2],A=qr.PlotUtils.getBisectorNormals(o,x,C,w);v=v.concat(A)}var E=qr.PlotUtils.getRightMostControlPoint(f);v.push(E);var T=[];for(y=0;y<f.length-1;y++){x=f[y],C=f[y+1],T.push(x);for(var o=0;o<qr.Constants.FITTING_COUNT;o++){var S=qr.PlotUtils.getCubicValue(o/qr.Constants.FITTING_COUNT,x,v[2*y],v[2*y+1],C);T.push(S)}T.push(C)}return T},qr.PlotUtils.getLeftMostControlPoint=function(o){var f=o[0],m=o[1],v=o[2],y=qr.PlotUtils.getBisectorNormals(0,f,m,v),x=y[0],C=qr.PlotUtils.getNormal(f,m,v),w=Math.sqrt(C[0]*C[0]+C[1]*C[1]);if(w>qr.Constants.ZERO_TOLERANCE)var A=qr.PlotUtils.mid(f,m),E=f[0]-A[0],T=f[1]-A[1],S=qr.PlotUtils.distance(f,m),M=2/S,I=-M*T,P=M*E,D=I*I-P*P,L=2*I*P,R=P*P-I*I,O=x[0]-A[0],F=x[1]-A[1],k=A[0]+D*O+L*F,U=A[1]+L*O+R*F;else k=f[0]+t*(m[0]-f[0]),U=f[1]+t*(m[1]-f[1]);return[k,U]},qr.PlotUtils.getRightMostControlPoint=function(o){var f=o.length,m=o[f-3],v=o[f-2],y=o[f-1],x=qr.PlotUtils.getBisectorNormals(0,m,v,y),C=x[1],w=qr.PlotUtils.getNormal(m,v,y),A=Math.sqrt(w[0]*w[0]+w[1]*w[1]);if(A>qr.Constants.ZERO_TOLERANCE)var E=qr.PlotUtils.mid(v,y),T=y[0]-E[0],S=y[1]-E[1],M=qr.PlotUtils.distance(v,y),I=2/M,P=-I*S,D=I*T,L=P*P-D*D,R=2*P*D,O=D*D-P*P,F=C[0]-E[0],k=C[1]-E[1],U=E[0]+L*F+R*k,G=E[1]+R*F+O*k;else U=y[0]+t*(v[0]-y[0]),G=y[1]+t*(v[1]-y[1]);return[U,G]},qr.PlotUtils.getBezierPoints=function(o){if(o.length<=2)return o;for(var f=[],m=o.length-1,v=0;1>=v;v+=.01){for(var y=0,x=0,C=0;m>=C;C++){var w=qr.PlotUtils.getBinomialFactor(m,C),A=Math.pow(v,C),E=Math.pow(1-v,m-C);y+=w*A*E*o[C][0],x+=w*A*E*o[C][1]}f.push([y,x])}return f.push(o[m]),f},qr.PlotUtils.getBinomialFactor=function(o,f){return qr.PlotUtils.getFactorial(o)/(qr.PlotUtils.getFactorial(f)*qr.PlotUtils.getFactorial(o-f))},qr.PlotUtils.getFactorial=function(o){if(1>=o)return 1;if(o==2)return 2;if(o==3)return 6;if(o==4)return 24;if(o==5)return 120;for(var f=1,m=1;o>=m;m++)f*=m;return f},qr.PlotUtils.getQBSplinePoints=function(o){if(o.length<=2)return o;var f=2,m=[],v=o.length-f-1;m.push(o[0]);for(var y=0;v>=y;y++)for(var x=0;1>=x;x+=.05){for(var C=0,w=0,A=0;f>=A;A++){var E=qr.PlotUtils.getQuadricBSplineFactor(A,x);C+=E*o[y+A][0],w+=E*o[y+A][1]}m.push([C,w])}return m.push(o[o.length-1]),m},qr.PlotUtils.getQuadricBSplineFactor=function(o,f){return o==0?Math.pow(f-1,2)/2:o==1?(-2*Math.pow(f,2)+2*f+1)/2:o==2?Math.pow(f,2)/2:0},qr.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4};var VD=ch;var Gu=null,Uct=null,_5i=null,N4=null,zct=null,Hct=null;function GT(o,f){Gu=f,GT.prototype.findTimeInterval=Gu.Spline.prototype.findTimeInterval,GT.prototype.wrapTime=Gu.Spline.prototype.wrapTime,GT.prototype.clampTime=Gu.Spline.prototype.clampTime,GT.catmullRomCoefficientMatrix=new Gu.Matrix4(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0),Uct=new Gu.Cartesian4,_5i=new Gu.Cartesian3,N4=new Gu.Cartesian3,zct=new Gu.Cartesian3,Hct=new Gu.Cartesian3,o=Gu.defaultValue(o,Gu.defaultValue.EMPTY_OBJECT);let m=o.points,v=o.times,y=o.firstTangent,x=o.lastTangent;if(m.length>2&&(Gu.defined(y)||(y=zct,Gu.Cartesian3.multiplyByScalar(m[1],2,y),Gu.Cartesian3.subtract(y,m[2],y),Gu.Cartesian3.subtract(y,m[0],y),Gu.Cartesian3.multiplyByScalar(y,.5,y)),!Gu.defined(x))){let C=m.length-1;x=Hct,Gu.Cartesian3.multiplyByScalar(m[C-1],2,x),Gu.Cartesian3.subtract(m[C],x,x),Gu.Cartesian3.add(x,m[C-2],x),Gu.Cartesian3.multiplyByScalar(x,.5,x)}this._times=v,this._points=m,this._firstTangent=Gu.Cartesian3.clone(y),this._lastTangent=Gu.Cartesian3.clone(x),this._evaluateFunction=this.createEvaluateFunction(this),this._lastTimeIndex=0}Object.defineProperties(GT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});GT.prototype.createEvaluateFunction=function(o){let f=o.points,m=o.times;if(f.length<3){let v=m[0],y=1/(m[1]-v),x=f[0],C=f[1];return function(w,A){Gu.defined(A)||(A=new Gu.Cartesian3);let E=(w-v)*y;return Gu.Cartesian3.lerp(x,C,E,A)}}return function(v,y){Gu.defined(y)||(y=new Gu.Cartesian3);let x=o._lastTimeIndex=o.findTimeInterval(v,o._lastTimeIndex),C=(v-m[x])/(m[x+1]-m[x]),w=Uct;w.z=C,w.y=C*C,w.x=w.y*C,w.w=1;let A,E,T,S,M;return x===0?(A=o.firstTangent,E=f[0],T=f[1],S=f[2],M=Gu.Matrix4.multiplyByVector(GT.catmullRomCoefficientMatrix,w,w)):x===f.length-2?(A=f[x-1],E=f[x],T=f[x+1],S=o.lastTangent,M=Gu.Matrix4.multiplyByVector(GT.catmullRomCoefficientMatrix,w,w)):(A=f[x-1],E=f[x],T=f[x+1],S=f[x+2],M=Gu.Matrix4.multiplyByVector(GT.catmullRomCoefficientMatrix,w,w)),y=Gu.Cartesian3.multiplyByScalar(A,M.x,y),Gu.Cartesian3.multiplyByScalar(E,M.y,N4),Gu.Cartesian3.add(y,N4,y),Gu.Cartesian3.multiplyByScalar(T,M.z,N4),Gu.Cartesian3.add(y,N4,y),Gu.Cartesian3.multiplyByScalar(S,M.w,N4),Gu.Cartesian3.add(y,N4,y)}};GT.prototype.evaluate=function(o,f){return this._evaluateFunction(o,f)};var Gct=GT;var je=null;function vo(o,f,m){je=f,this._viewer=o,this.earthCtrl=m,this._core=new Sr(o,f),this._tree=Ne,this._getPosition=new Ru(this._viewer,f),this._popupmessage=new wb(this._viewer,f),this.tooltip=this._core.CreateTooltip({id:"_jb"}),this.objectsToExclude=[],this.MilitaryStandardObj=[],this.drawHandler=void 0,this.editHandler=null,this.heightpointsId=[],this.state=0,this.isEditting=!1,this.editProp=!1,this.openEdit=!0}vo.prototype.createBezierline=function(o,f){var m=this,v=this._viewer,y=[],x=[],C=void 0,w="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;var A;return this.drawHandler.setInputAction(function(E){w="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);y.length==0&&(y.push({x:S[0],y:S[1],z:S[2]}),x.push(S)),x.push(S),y.push({x:S[0],y:S[1],z:S[2]})},je.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(E){m._core.CreateTooltip(w,E.endPosition,!0);var T=E.endPosition;if(y.length>0)if(je.defined(C)){y.pop(),x.pop();let I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);y.push({x:I[0],y:I[1],z:I[2]}),x.push(I);let P=m._createBezierPoints(y);I=[],P.forEach(D=>{I.push(D.x,D.y,y[0].z)}),A=je.Cartesian3.fromDegreesArrayHeights(I)}else{var S=m._createBezierPoints(y),M=[];S.forEach(I=>{M.push(I.x,I.y,y[0].z)}),A=je.Cartesian3.fromDegreesArrayHeights(M),C=v.entities.add({name:"Bezierline",polyline:{positions:new je.CallbackProperty(function(){return A},!1),clampToGround:!0,width:m._core.defaultValue(o.width,2),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),C.GeoType="Bezierline",m.MilitaryStandardObj.push(C.id)}},je.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,C&&(C.pottingPoint=x),m.drawHandler.destroy(),m._core.CreateTooltip(w,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){C&&(v.entities.remove(C),m.MilitaryStandardObj.pop());return}f&&f(C)},this};vo.prototype.createBezierArrow=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=void 0;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A;return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(je.defined(w)){x.pop(),C.pop();var M=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:M[0],y:M[1],z:M[2]}),C.push(M);var S=m._createBezierPoints(x),M=[];S.forEach(D=>{M.push(D.x,D.y,x[0].z)}),A=je.Cartesian3.fromDegreesArrayHeights(M)}else{var S=m._createBezierPoints(x),M=[];S.forEach(I=>{M.push(I.x,I.y,x[0].z)}),A=je.Cartesian3.fromDegreesArrayHeights(M),w=v.entities.add({name:"BezierArrow",polyline:{positions:new je.CallbackProperty(function(){return A},!1),clampToGround:!0,width:m._core.defaultValue(o.width,5),material:new je.PolylineArrowMaterialProperty(je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000")))}}),w.GeoType="BezierArrow",m.MilitaryStandardObj.push(w.id)}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w&&(w.pottingPoint=C),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w&&(v.entities.remove(w),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype._createDemarcationLinePoints=function(o,f){let m=[],v=o[0],y=o[1],x=new je.Cartesian2(v.x,v.y),C=new je.Cartesian2(y.x,y.y),w=je.Cartesian2.subtract(C,x,new je.Cartesian2(0,0)),A=je.Cartesian2.magnitude(w);if(A<1e-5)return m.push(o[0],o[1]),m;let E=je.Cartesian2.normalize(w,new je.Cartesian2(0,0)),T=new je.Cartesian2(-E.y*1e-4,E.x*1e-4),S=Math.floor(A<f?2:A/f);for(let M=0;M<S;M++)if(M===0){let I=je.Cartesian2.add(x,T,new je.Cartesian2(0,0));m.push(I,x)}else if(M===S-1){let I=je.Cartesian2.add(C,T,new je.Cartesian2(0,0));m.push(C,I)}else{let I=je.Cartesian2.multiplyByScalar(E,M*f,new je.Cartesian2(0,0)),P=je.Cartesian2.add(x,I,new je.Cartesian2(0,0)),D=je.Cartesian2.add(P,T,new je.Cartesian2(0,0));m.push(P,D,P)}return m};function v5i(o,f,m){let v=[],y=o[0],x=o[1],C=new je.Cartesian2(y.x,y.y),w=new je.Cartesian2(x.x,x.y),A=je.Cartesian2.subtract(w,C,new je.Cartesian2(0,0)),E=je.Cartesian2.magnitude(A),T=je.Cartesian2.normalize(A,new je.Cartesian2(0,0)),S=new je.Cartesian2(T.y*m,-T.x*m),M=je.Cartesian2.multiplyByScalar(T,f*-.5,new je.Cartesian2(0,0)),I=je.Cartesian2.add(M,S,new je.Cartesian2(0,0)),P=je.Cartesian2.multiplyByScalar(T,f*.5,new je.Cartesian2(0,0)),D=je.Cartesian2.add(P,S,new je.Cartesian2(0,0));return v.push(y),v.push(je.Cartesian2.add(y,M,new je.Cartesian2(0,0))),v.push(je.Cartesian2.add(y,I,new je.Cartesian2(0,0))),v.push(je.Cartesian2.add(y,D,new je.Cartesian2(0,0))),v.push(je.Cartesian2.add(y,P,new je.Cartesian2(0,0))),v.push(y),v}function y5i(o,f,m,v){let y=je.Cartographic.fromCartesian(o),x=je.Cartographic.fromCartesian(f),C=v5i([{x:y.longitude,y:y.latitude},{x:x.longitude,y:x.latitude}],m,v),w=[];for(let A=0;A<C.length;A++)w.push({x:C[A].x,y:C[A].y});return w}function Wct(o,f,m){let v=je.Cartographic.fromCartesian(o),y=je.Cartographic.fromCartesian(f),x=[],C=new je.Cartesian2(v.longitude,v.latitude),w=new je.Cartesian2(y.longitude,y.latitude),A=je.Cartesian2.subtract(w,C,new je.Cartesian2(0,0)),E=je.Cartesian2.magnitude(A),T=je.Cartesian2.normalize(A,new je.Cartesian2(0,0)),S=new je.Cartesian2(T.y*m,-T.x*m),M=je.Cartesian2.add(C,S,new je.Cartesian2(0,0)),I=je.Cartesian2.subtract(C,S,new je.Cartesian2(0,0));return x.push({x:M.x,y:M.y},{x:I.x,y:I.y}),x}vo.prototype._createType_10_35000=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o}],f;let m=6,v=0,y,x,C;for(let P=0;P<o.length-1;P++)x=o[P],C=o[P+1],v+=Math.sqrt((C.y-x.y)*(C.y-x.y)+(C.x-x.x)*(C.x-x.x));y=v/m;let w=[];o.forEach(function(P){w.push(P.x,P.y,0)});let A=je.Cartesian3.fromDegreesArrayHeights(w),E=[],T=A.length;for(let P=0;P<T;P++)E.push(P*.5);let S=new je.CatmullRomSpline({times:E,points:A}),M=[];for(let P=0;P<E.length;P++){let D=E[P],L=E[P+1];for(let R=D;R<L;R+=.01){let O=S.evaluate(R);M.push(O)}}let I=Math.floor(M.length/T);for(let P=0;P<M.length;P++){let D=je.Cartographic.fromCartesian(M[P]);f.push({x:D.longitude,y:D.latitude})}for(let P=M.length-I;I<P;P-=I){let D=M[P],L=M[P+1],R=y5i(D,L,y*.002,y*.002);f.splice.apply(f,[P+1,0].concat(R))}{let P=M[0],D=M[1];f=Wct(P,D,y*.001).concat(f)}{let P=M.length,D=M[P-2],L=M[P-1],R=Wct(L,D,y*.001);f=f.concat(R)}return[{fillType:0,positions:f}]};function MLe(o,f,m,v){let y=[];y.push(o[0]);{let x=je.Cartesian3.multiplyByScalar(m,f*-.2,new je.Cartesian3(0,0,0)),C=je.Cartesian3.multiplyByScalar(m,f*.5,new je.Cartesian3(0,0,0)),w=je.Cartesian3.multiplyByScalar(m,f*1.2,new je.Cartesian3(0,0,0)),A=je.Cartesian3.multiplyByScalar(v,f*.3,new je.Cartesian3(0,0,0)),E=je.Cartesian3.multiplyByScalar(v,f*.5,new je.Cartesian3(0,0,0)),T=je.Cartesian3.add(x,A,new je.Cartesian3(0,0,0)),S=je.Cartesian3.add(C,E,new je.Cartesian3(0,0,0)),M=je.Cartesian3.add(w,A,new je.Cartesian3(0,0,0)),I=je.Cartesian3.add(o[0],T,new je.Cartesian3(0,0,0)),P=je.Cartesian3.add(o[0],S,new je.Cartesian3(0,0,0)),D=je.Cartesian3.add(o[0],M,new je.Cartesian3(0,0,0));if(o.length===2)y.push(I,P,D);else{let L=je.Cartesian3.add(o[0],C,new je.Cartesian3(0,0,0)),R=je.Cartesian3.subtract(o[2],L,new je.Cartesian3(0,0,0)),O=je.Cartesian3.dot(R,v,new je.Cartesian3(0,0,0)),F=je.Cartesian3.dot(R,m,new je.Cartesian3(0,0,0));O=je.Math.clamp(O,f*.5,f),F=je.Math.clamp(F,-f*.5,f*.5);let k=je.Cartesian3.multiplyByScalar(v,O,new je.Cartesian3(0,0,0)),U=je.Cartesian3.multiplyByScalar(m,F,new je.Cartesian3(0,0,0)),G=je.Cartesian3.add(L,k,new je.Cartesian3(0,0,0)),j=je.Cartesian3.add(G,U,new je.Cartesian3(0,0,0));y.push(I,j,D)}}y.push(o[1]);{let x=je.Cartesian3.multiplyByScalar(m,f*.5,new je.Cartesian3(0,0,0)),C=je.Cartesian3.multiplyByScalar(v,f*.1,new je.Cartesian3(0,0,0)),w=je.Cartesian3.add(x,C,new je.Cartesian3(0,0,0)),A=je.Cartesian3.add(o[0],w,new je.Cartesian3(0,0,0));y.push(A)}return y.unshift(y[y.length-1]),y}vo.prototype._createType_10_29100=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o}],f;let m=[];o.forEach(function(L){m.push(new je.Cartesian3(L.x,L.y,0))});let v=je.Cartesian3.subtract(m[1],m[0],new je.Cartesian3(0,0,0)),y=je.Cartesian3.magnitude(v),x=je.Cartesian3.normalize(v,new je.Cartesian3(0,0,0)),C=new je.Cartesian3(x.y,-x.x,0),w,A,E;if(m.length===2)w=MLe(m,y,x,C),A=w[5],E=w[1];else{let L=je.Cartesian3.subtract(m[2],m[1],new je.Cartesian3(0,0,0));je.Cartesian3.dot(L,C)>0?(w=MLe(m,y,x,C),A=w[5],E=w[1]):(w=MLe(m,y,x,new je.Cartesian3(-x.y,x.x,0)),A=w[5],E=w[1])}let T=[];w.forEach(L=>{T.push(L.x,L.y,L.z)});let S=je.Cartesian3.fromDegreesArrayHeights(T),M=je.Cartesian3.fromDegreesArrayHeights([A.x,A.y,A.z,E.x,E.y,E.z]),I=[];for(let L=0;L<S.length;L++)I.push(L);let P=new Gct({times:I,points:S,firstTangent:M[0],lastTangent:M[1]},je),D=[];for(let L=0;L<S.length-1;L++){let R=I[L],O=I[L+1];if(L===1||L===2||L===4||L===5){let F=je.Cartographic.fromCartesian(P.evaluate(R)),k=je.Cartographic.fromCartesian(P.evaluate(R+.01)),U=new je.Cartesian3(F.longitude,F.latitude,0),G=new je.Cartesian3(k.longitude,k.latitude,0),j=je.Cartesian3.subtract(G,U,new je.Cartesian3(0,0,0)),q=je.Cartesian3.normalize(j,new je.Cartesian3(0,0,0)),J=null;if(m.length===2)J=new je.Cartesian3(q.y*y*.002,-q.x*y*.002,0);else{let Q=je.Cartesian3.subtract(m[2],m[1],new je.Cartesian3(0,0,0));je.Cartesian3.dot(Q,C)>0?J=new je.Cartesian3(q.y*y*.002,-q.x*y*.002,0):J=new je.Cartesian3(-q.y*y*.002,q.x*y*.002,0)}let X=je.Cartesian3.subtract(U,J,new je.Cartesian3(0,0,0)),Y=je.Cartesian3.fromRadiansArrayHeights([U.x,U.y,U.z,X.x,X.y,X.z]);D.push(Y[0]),D.push(Y[1])}for(let F=R;F<O;F+=.01)D.push(P.evaluate(F))}for(let L=0;L<D.length;L++){let R=je.Cartographic.fromCartesian(D[L]);f.push({x:R.longitude,y:R.latitude})}return[{fillType:0,positions:f}]};function cn(o,f,m,v){let y=new je.Matrix2,x=new je.Cartesian2,C=new je.Cartesian2,w=new je.Cartesian2,A=je.Matrix2.fromRotation(je.Math.toRadians(o),y),E=je.Matrix2.multiplyByVector(A,v,x);return E=je.Cartesian2.multiplyByScalar(E,f,C),je.Cartesian2.add(E,m,new je.Cartesian2)}function Ele(o,f,m,v){var y=(o.x-m.x)*(f.y-m.y)-(o.y-m.y)*(f.x-m.x),x=(o.x-v.x)*(f.y-v.y)-(o.y-v.y)*(f.x-v.x);if(y*x>=0)return!1;var C=(m.x-o.x)*(v.y-o.y)-(m.y-o.y)*(v.x-o.x),w=C+y-x;if(C*w>=0)return!1;var A=C/(x-y),E=A*(f.x-o.x),T=A*(f.y-o.y);return new je.Cartesian2(o.x+E,o.y+T)}vo.prototype._createType_10_33400=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(P){m.push(P.x,P.y,0)});let v=je.Cartesian3.fromDegreesArrayHeights(m),y=[],x=v.length;for(let P=0;P<x;P++)y.push(P*.5);let C=new je.CatmullRomSpline({times:y,points:v}),w=[];for(let P=0;P<y.length;P++){let D=y[P],L=y[P+1];for(let R=D;R<L;R+=.01){let O=C.evaluate(R),F=je.Cartographic.fromCartesian(O);w.push(new je.Cartesian2(F.longitude,F.latitude))}}let A=[],E=10,T=0,S=0,M=[];for(let P=0;P<w.length-1;P++){let D=w[P],L=w[P+1],R=je.Cartesian2.subtract(L,D,new je.Cartesian2(0,0));T+=je.Cartesian2.magnitude(R),M.push(T)}S=T/E;for(let P=0;P<M.length;P++)if(M[P]>S){A.push(P);break}for(let P=M.length-1;P>0;P--){let D=M[P];if(T-D>S){A.push(P);break}}let I=w.length;{let P=w[0],D=w[A[0]],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=je.Cartesian2.multiplyByScalar(O,R*.72,new je.Cartesian2(0,0)),k=je.Cartesian2.add(P,F,new je.Cartesian2(0,0)),U=cn(90,R*.2,P,O),G=cn(-90,R*.2,P,O),j=cn(145,R*.4,D,O),q=cn(-145,R*.4,D,O),J=cn(90,R*.5,k,O),X=cn(-90,R*.5,k,O),Y=Ele(D,j,k,J),Q=Ele(D,q,k,X);f.push({fillType:0,positions:[D,j,Y,U,G,Q,q,D]})}{let P=[];for(let D=A[0];D<A[1]+1;D++){let L=w[D];P.push(L)}f.push({fillType:0,positions:P})}{let P=w[A[1]],D=w[I-1],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=cn(90,R*.2,P,O),k=cn(-90,R*.2,P,O);f.push({fillType:0,positions:[D,F,k,D]})}return f};vo.prototype._createType_10_33401=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(P){m.push(P.x,P.y,0)});let v=je.Cartesian3.fromDegreesArrayHeights(m),y=[],x=v.length;for(let P=0;P<x;P++)y.push(P*.5);let C=new je.CatmullRomSpline({times:y,points:v}),w=[];for(let P=0;P<y.length;P++){let D=y[P],L=y[P+1];for(let R=D;R<L;R+=.01){let O=C.evaluate(R),F=je.Cartographic.fromCartesian(O);w.push(new je.Cartesian2(F.longitude,F.latitude))}}let A=[],E=6,T=0,S=0,M=[];for(let P=0;P<w.length-1;P++){let D=w[P],L=w[P+1],R=je.Cartesian2.subtract(L,D,new je.Cartesian2(0,0));T+=je.Cartesian2.magnitude(R),M.push(T)}S=T/E;for(let P=0;P<M.length;P++)if(M[P]>S){A.push(P);break}for(let P=M.length-1;P>0;P--){let D=M[P];if(T-D>S){A.push(P);break}}let I=w.length;{let P=w[0],D=w[A[0]],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=je.Cartesian2.multiplyByScalar(O,R*.2,new je.Cartesian2(0,0)),k=je.Cartesian2.add(P,F,new je.Cartesian2(0,0)),U=cn(90,R*.2,D,O),G=cn(-90,R*.2,D,O),j=cn(0,-R*.2,P,O),q=cn(45,R*.5,k,O),J=cn(-45,R*.5,k,O),X=cn(90,R*.5,k,O),Y=cn(-90,R*.5,k,O),Q=Ele(j,q,k,X),ee=Ele(j,J,k,Y);f.push({fillType:0,positions:[D,U,Q,k,Q,j,ee,k,ee,G,D]})}{let P=[];for(let D=A[0];D<A[1]+1;D++){let L=w[D];P.push(L)}f.push({fillType:0,positions:P})}{let P=w[A[1]],D=w[I-1],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=cn(90,R*.2,P,O),k=cn(-90,R*.2,P,O);f.push({fillType:0,positions:[D,F,k,D]})}return f};vo.prototype._createType_10_33402=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(A){m.push(new je.Cartesian2(A.x*3.14159/180,A.y*3.14159/180))});let v=m[0],y=m[1],x=je.Cartesian2.subtract(y,v,new je.Cartesian2(0,0)),C=je.Cartesian2.magnitude(x),w=je.Cartesian2.normalize(x,new je.Cartesian2(0,0));{let A=[],E=C*.25,T=cn(-90,E,v,w);for(let k=0;k<17;k++){let U=cn(90-k*10,E,T,w);A.push(U)}f.push({fillType:0,positions:A});let S=A.length,M=A[S-2],I=A[S-1],P=je.Cartesian2.subtract(I,M,new je.Cartesian2(0,0)),D=je.Cartesian2.magnitude(P),L=je.Cartesian2.normalize(P,new je.Cartesian2(0,0)),R=cn(90,C*.01,I,L),O=cn(-90,C*.01,I,L),F=cn(0,C*.015,I,L);f.push({fillType:0,positions:[I,R,F,O,I]})}{let A=cn(0,C*.95,v,w),E=cn(90,C*.02,A,w),T=cn(-90,C*.02,A,w),S=[v,A,E,y,T,A];f.push({fillType:0,positions:S})}return f};vo.prototype._createType_10_33403=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(A){m.push(new je.Cartesian2(A.x*3.14159/180,A.y*3.14159/180))});let v=m[0],y=m[1],x=je.Cartesian2.subtract(y,v,new je.Cartesian2(0,0)),C=je.Cartesian2.magnitude(x),w=je.Cartesian2.normalize(x,new je.Cartesian2(0,0));{let A=cn(90,C*.04,v,w),E=cn(-90,C*.04,v,w),T=cn(0,C*.4,v,w);f.push({fillType:0,positions:[T,A,E,T]}),f.push({fillType:0,positions:[v,T]})}{let A=[],E=cn(0,C*.6,v,w),T=cn(0,C*.96,v,w);A.push(E);let S=cn(90,C*.04,new je.Cartesian2(0,0),w);for(let M=0;M<18;M++){let I=cn(-M*10,1,T,S);A.push(I)}A.push(E),f.push({fillType:0,positions:A})}return f};vo.prototype._createType_10_33404=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(A){m.push(new je.Cartesian2(A.x*3.14159/180,A.y*3.14159/180))});let v=m[0],y=m[1],x=je.Cartesian2.subtract(y,v,new je.Cartesian2(0,0)),C=je.Cartesian2.magnitude(x),w=je.Cartesian2.normalize(x,new je.Cartesian2(0,0));{let A=cn(0,C*.95,v,w),E=cn(90,C*.02,A,w),T=cn(-90,C*.02,A,w);f.push({fillType:0,positions:[v,A]}),f.push({fillType:0,positions:[A,E,y,T,A]})}return f};vo.prototype._createType_10_34300=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(E){m.push(new je.Cartesian2(E.x*3.14159/180,E.y*3.14159/180))});let v=m[0],y=m[1],x=je.Cartesian2.subtract(y,v,new je.Cartesian2(0,0)),C=je.Cartesian2.magnitude(x),w=je.Cartesian2.normalize(x,new je.Cartesian2(0,0)),A=C/5;for(let E=0;E<5;E++){if(E===3)continue;let T=A*E,S=cn(0,T,v,w),M=[];for(let I=0;I<=36;I++){let P=cn(-I*10,A*.1,S,w);M.push(P)}f.push({fillType:0,positions:M})}{let E=A*3,T=cn(0,E,v,w),S=cn(90,C*.1,T,w),M=cn(-90,C*.1,T,w),I=cn(90,C*.1,y,w),P=cn(-90,C*.1,y,w),D=cn(0,C*.1,y,w);f.push({fillType:0,positions:[S,M,P,D,I,S]})}return f};vo.prototype._createType_10_33700=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(P){m.push(P.x,P.y,0)});let v=je.Cartesian3.fromDegreesArrayHeights(m),y=[],x=v.length;for(let P=0;P<x;P++)y.push(P*.5);let C=new je.CatmullRomSpline({times:y,points:v}),w=[];for(let P=0;P<y.length;P++){let D=y[P],L=y[P+1];for(let R=D;R<L;R+=.01){let O=C.evaluate(R),F=je.Cartographic.fromCartesian(O);w.push(new je.Cartesian2(F.longitude,F.latitude))}}let A=[],E=6,T=0,S=0,M=[];for(let P=0;P<w.length-1;P++){let D=w[P],L=w[P+1],R=je.Cartesian2.subtract(L,D,new je.Cartesian2(0,0));T+=je.Cartesian2.magnitude(R),M.push(T)}S=T/E;for(let P=0;P<M.length;P++)if(M[P]>S){A.push(P);break}for(let P=M.length-1;P>0;P--){let D=M[P];if(T-D>S){A.push(P);break}}let I=w.length;{let P=w[0],D=w[1],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=cn(90,T*.02,P,O),k=cn(-90,T*.02,P,O),U=cn(0,T*.04,P,O),G=cn(90,T*.02,U,O),j=cn(-90,T*.02,U,O),q=cn(0,T*.08,P,O);f.push({fillType:0,positions:[F,k,P,U,G,q,j,U]})}{let P=w[0],D=w[A[0]],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=cn(90,R*.2,D,O),k=cn(-90,R*.2,D,O),U=je.Cartesian2.multiplyByScalar(O,R*.4,new je.Cartesian2(0,0)),G=je.Cartesian2.subtract(P,U,new je.Cartesian2(0,0)),j=cn(90,R*.2,G,O);U=je.Cartesian2.multiplyByScalar(O,R*.2,new je.Cartesian2(0,0)),G=je.Cartesian2.subtract(P,U,new je.Cartesian2(0,0));let q=cn(-90,R*.2,G,O);f.push({fillType:0,positions:[D,F,j,q,k,D]})}{let P=[];for(let D=0;D<A[1]+1;D++){let L=w[D];P.push(L)}f.push({fillType:0,positions:P})}{let P=w[A[1]],D=w[I-1],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=cn(90,R*.2,P,O),k=cn(-90,R*.2,P,O);f.push({fillType:0,positions:[D,F,k,D]})}return f};vo.prototype._createType_10_34700=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(P){m.push(P.x,P.y,0)});let v=je.Cartesian3.fromDegreesArrayHeights(m),y=[],x=v.length;for(let P=0;P<x;P++)y.push(P*.5);let C=new je.CatmullRomSpline({times:y,points:v}),w=[];for(let P=0;P<y.length;P++){let D=y[P],L=y[P+1];for(let R=D;R<L;R+=.01){let O=C.evaluate(R),F=je.Cartographic.fromCartesian(O);w.push(new je.Cartesian2(F.longitude,F.latitude))}}let A=[],E=2,T=0,S=0,M=[];for(let P=0;P<w.length-1;P++){let D=w[P],L=w[P+1],R=je.Cartesian2.subtract(L,D,new je.Cartesian2(0,0));T+=je.Cartesian2.magnitude(R),M.push(T)}S=T/E;for(let P=0;P<M.length;P++)if(M[P]>T*.48){A.push(P);break}for(let P=0;P<M.length;P++)if(M[P]>T*.52){A.push(P);break}let I=w.length;{let P=w[0],D=w[1],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),O=cn(90,T*.02,P,R),F=cn(-90,T*.02,P,R);f.push({fillType:0,positions:[O,F]})}{let P=w[I-2],D=w[I-1],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),O=cn(90,T*.02,D,R),F=cn(-90,T*.02,D,R);f.push({fillType:0,positions:[O,F]})}{let P=[];for(let D=0;D<A[0];D++){let L=w[D];P.push(L)}f.push({fillType:0,positions:P})}{let P=[];for(let D=A[1];D<I;D++){let L=w[D];P.push(L)}f.push({fillType:0,positions:P})}{let P=w[A[0]],D=w[A[1]],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=cn(90,R*.2,P,O),k=cn(-90,R*.2,P,O),U=cn(0,R*.9,P,O);f.push({fillType:0,positions:[F,k,U,F]})}return f};vo.prototype._createType_10_34400=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6){for(let A=0;A<15;A++)f.push({fillType:0,positions:o});return f}let m=[];o.forEach(function(A){m.push(new je.Cartesian2(A.x*3.14159/180,A.y*3.14159/180))});let v=m[0],y=m[1],x=je.Cartesian2.subtract(y,v,new je.Cartesian2(0,0)),C=je.Cartesian2.magnitude(x),w=je.Cartesian2.normalize(x,new je.Cartesian2(0,0));{let A=cn(0,C*.8,v,w),E=cn(90,C*.5,v,w),T=cn(-90,C*.5,v,w),S=cn(90,C*.5,A,w),M=cn(-90,C*.5,A,w);f.push({fillType:0,positions:[E,S]}),f.push({fillType:0,positions:[T,M]});for(let I=0;I<=10;I++){let P=cn(0,C*.3+I*C*.04,E,w),D=cn(0,C*.1+I*C*.04,T,w);f.push({fillType:0,positions:[P,D]})}}{let A=cn(0,C*.9,v,w),E=cn(90,C*.02,A,w),T=cn(-90,C*.02,A,w),S=cn(90,C*.02,y,w),M=cn(-90,C*.02,y,w),I=cn(0,C*1.02,v,w);f.push({fillType:0,positions:[E,T,M,I,S,E]});let P=cn(0,C*.05,E,w),D=cn(0,C*.05,T,w),L=cn(0,-C*.02,y,w);f.push({fillType:0,positions:[P,L,D]})}return f};vo.prototype._createType_10_34500=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6){for(let A=0;A<8;A++)f.push({fillType:0,positions:o});return f}let m=[];o.forEach(function(A){m.push(new je.Cartesian2(A.x*3.14159/180,A.y*3.14159/180))});let v=m[0],y=m[1],x=je.Cartesian2.subtract(y,v,new je.Cartesian2(0,0)),C=je.Cartesian2.magnitude(x),w=je.Cartesian2.normalize(x,new je.Cartesian2(0,0));{let A=cn(0,C*.35,v,w);f.push({fillType:0,positions:[v,A]})}{let A=cn(0,C*.4,v,w),E=cn(0,C*.58,v,w);f.push({fillType:0,positions:[A,E]})}{let A=cn(0,C*.6,v,w),E=cn(0,C*.78,v,w);f.push({fillType:0,positions:[A,E]})}{let A=cn(0,C*.8,v,w);f.push({fillType:0,positions:[A,y]})}{let A=[],E=C*.02,T=cn(0,C*.78,v,w);for(let S=0;S<=36;S++){let M=cn(S*10,E,T,w);A.push(M)}f.push({fillType:0,positions:A})}{let A=cn(0,C*.85,v,w),E=cn(90,C*.02,A,w),T=cn(-90,C*.02,A,w);f.push({fillType:0,positions:[E,T]})}{let A=cn(0,C*.9,v,w),E=cn(145,C*.02,A,w),T=cn(-145,C*.02,A,w);f.push({fillType:0,positions:[E,A,T]});let S=cn(45,C*.02,y,w),M=cn(-45,C*.02,y,w);f.push({fillType:0,positions:[S,y,M]})}return f};vo.prototype._createType_10_34501=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6){for(let A=0;A<10;A++)f.push({fillType:0,positions:o});return f}let m=[];o.forEach(function(A){m.push(new je.Cartesian2(A.x*3.14159/180,A.y*3.14159/180))});let v=m[0],y=m[1],x=je.Cartesian2.subtract(y,v,new je.Cartesian2(0,0)),C=je.Cartesian2.magnitude(x),w=je.Cartesian2.normalize(x,new je.Cartesian2(0,0));{let A=cn(0,C*.27,v,w);f.push({fillType:0,positions:[v,A]})}{let A=cn(0,C*.3,v,w),E=cn(0,C*.57,v,w);f.push({fillType:0,positions:[A,E]})}{let A=cn(0,C*.6,v,w),E=cn(0,C*.87,v,w);f.push({fillType:0,positions:[A,E]})}{let A=cn(145,C*.02,y,w),E=cn(-145,C*.02,y,w);f.push({fillType:0,positions:[A,y,E]});let T=cn(45,C*.02,y,w),S=cn(-45,C*.02,y,w);f.push({fillType:0,positions:[T,y,S]})}{let A=cn(90,C*.3,y,w);f.push({fillType:0,positions:[y,A]})}{let A=[],E=C*.02,T=cn(90,C*.32,y,w);for(let S=0;S<=36;S++){let M=cn(S*10,E,T,w);A.push(M)}f.push({fillType:0,positions:A})}{let A=cn(90,C*.28,y,w),E=cn(0,C*.02,A,w),T=cn(0,-C*.02,A,w);f.push({fillType:0,positions:[E,T]})}{let A=cn(90,C*.3,y,w),E=je.Cartesian2.subtract(y,A,new je.Cartesian2(0,0)),T=je.Cartesian2.normalize(E,new je.Cartesian2(0,0)),S=cn(-35,C*.06,A,T);f.push({fillType:0,positions:[A,S]})}return f};vo.prototype._createType_10_35200=function(o){let f=o.length,m=[];if(f===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6){for(let J=0;J<4;J++)m.push({fillType:0,positions:o});return m}let v=[];o.forEach(function(J){v.push(new je.Cartesian2(J.x*3.14159/180,J.y*3.14159/180))});let y=-Number.MAX_VALUE,x=Number.MAX_VALUE,C=new je.Cartesian2;v.forEach(function(J){C.x+=J.x,C.y+=J.y,J.y>y&&(y=J.y),x>J.y&&(x=J.y)}),C.x/=f,C.y/=f;let w=v.concat([v[0]]);m.push({fillType:0,positions:w});let A=(y-x)*.05,E=new je.Cartesian2(1,0),T=cn(0,A*2,C,E),S=cn(-180,A*2,C,E),M=cn(90,A,T,E),I=cn(-90,A,T,E),P=cn(90,A,C,E),D=cn(-90,A,C,E),L=cn(90,A,S,E),R=cn(-90,A,S,E);m.push({fillType:0,positions:[C,P,M,I,D,C]}),m.push({fillType:0,positions:[C,P,L,R,D,C]});let O=je.Cartesian2.subtract(M,C,new je.Cartesian2(0,0)),F=je.Cartesian2.magnitude(O),k=cn(90,A*1.2,T,E),U=cn(-90,A*1.2,T,E),G=cn(90,A*1.2,S,E),j=cn(-90,A*1.2,S,E),q=[];{let J=cn(0,F*2.2,C,E),X=cn(180,F*2.2,C,E),Y=[J,k,G,X],Q=[];Y.forEach(function(oe){Q.push(oe.x,oe.y,0)});let ee=je.Cartesian3.fromRadiansArrayHeights(Q),z=[],ie=ee.length;for(let oe=0;oe<ie;oe++)z.push(oe*.5);let re=new je.CatmullRomSpline({times:z,points:ee}),ne=[];for(let oe=0;oe<z.length;oe++){let se=z[oe],ae=z[oe+1];for(let fe=se;fe<ae;fe+=.05){let de=re.evaluate(fe),ve=je.Cartographic.fromCartesian(de);ne.push(new je.Cartesian2(ve.longitude,ve.latitude))}}q=q.concat(ne)}{let J=cn(-180,F*2.2,C,E),X=cn(0,F*2.2,C,E),Y=[J,j,U,X],Q=[];Y.forEach(function(oe){Q.push(oe.x,oe.y,0)});let ee=je.Cartesian3.fromRadiansArrayHeights(Q),z=[],ie=ee.length;for(let oe=0;oe<ie;oe++)z.push(oe*.5);let re=new je.CatmullRomSpline({times:z,points:ee}),ne=[];for(let oe=0;oe<z.length;oe++){let se=z[oe],ae=z[oe+1];for(let fe=se;fe<ae;fe+=.05){let de=re.evaluate(fe),ve=je.Cartographic.fromCartesian(de);ne.push(new je.Cartesian2(ve.longitude,ve.latitude))}}q=q.concat(ne),q.push(q[0])}return m.push({fillType:0,positions:q}),m};vo.prototype._createType_10_34900=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(P){m.push(P.x,P.y,0)});let v=je.Cartesian3.fromDegreesArrayHeights(m),y=[],x=v.length;for(let P=0;P<x;P++)y.push(P*.5);let C=new je.CatmullRomSpline({times:y,points:v}),w=[];for(let P=0;P<y.length;P++){let D=y[P],L=y[P+1];for(let R=D;R<L;R+=.01){let O=C.evaluate(R),F=je.Cartographic.fromCartesian(O);w.push(new je.Cartesian2(F.longitude,F.latitude))}}let A=[],E=6,T=0,S=0,M=[];for(let P=0;P<w.length-1;P++){let D=w[P],L=w[P+1],R=je.Cartesian2.subtract(L,D,new je.Cartesian2(0,0));T+=je.Cartesian2.magnitude(R),M.push(T)}S=T/E;for(let P=0;P<M.length;P++)if(M[P]>S){A.push(P);break}for(let P=M.length-1;P>0;P--){let D=M[P];if(T-D>S){A.push(P);break}}let I=w.length;{let P=w[0],D=w[A[0]],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=cn(90,R*.2,D,O),k=cn(-90,R*.2,D,O),U=je.Cartesian2.multiplyByScalar(O,R*.4,new je.Cartesian2(0,0)),G=je.Cartesian2.subtract(P,U,new je.Cartesian2(0,0)),j=cn(90,R*.2,G,O);U=je.Cartesian2.multiplyByScalar(O,R*.2,new je.Cartesian2(0,0)),G=je.Cartesian2.subtract(P,U,new je.Cartesian2(0,0));let q=cn(-90,R*.2,G,O);f.push({fillType:0,positions:[D,F,j,q,k,D]})}{let P=[];for(let D=0;D<A[1]+1;D++){let L=w[D];P.push(L)}f.push({fillType:0,positions:P})}{let P=w[A[1]],D=w[I-1],L=je.Cartesian2.subtract(D,P,new je.Cartesian2(0,0)),R=je.Cartesian2.magnitude(L),O=je.Cartesian2.normalize(L,new je.Cartesian2(0,0)),F=cn(90,R*.2,P,O),k=cn(-90,R*.2,P,O);f.push({fillType:0,positions:[D,F,k,D]})}return f};vo.prototype._createType_10_34901=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(R){m.push(R.x,R.y,0)});let v=je.Cartesian3.fromDegreesArrayHeights(m),y=[],x=v.length;for(let R=0;R<x;R++)y.push(R*.5);let C=new je.CatmullRomSpline({times:y,points:v}),w=[];for(let R=0;R<y.length;R++){let O=y[R],F=y[R+1];for(let k=O;k<F;k+=.01){let U=C.evaluate(k),G=je.Cartographic.fromCartesian(U);w.push(new je.Cartesian2(G.longitude,G.latitude))}}let A=[],E=6,T=0,S=0,M=[];for(let R=0;R<w.length-1;R++){let O=w[R],F=w[R+1],k=je.Cartesian2.subtract(F,O,new je.Cartesian2(0,0));T+=je.Cartesian2.magnitude(k),M.push(T)}S=T/E;for(let R=0;R<M.length;R++)if(M[R]>S){A.push(R);break}for(let R=M.length-1;R>0;R--){let O=M[R];if(T-O>S){A.push(R);break}}let I=T*.45;for(let R=0;R<M.length;R++)if(M[R]>I){A.push(R);break}let P=T*.5;for(let R=0;R<M.length;R++)if(M[R]>P){A.push(R);break}let D=T*.55;for(let R=0;R<M.length;R++)if(M[R]>D){A.push(R);break}let L=w.length;{let R=w[0],O=w[A[0]],F=je.Cartesian2.subtract(O,R,new je.Cartesian2(0,0)),k=je.Cartesian2.magnitude(F),U=je.Cartesian2.normalize(F,new je.Cartesian2(0,0)),G=cn(90,k*.2,O,U),j=cn(-90,k*.2,O,U),q=je.Cartesian2.multiplyByScalar(U,k*.4,new je.Cartesian2(0,0)),J=je.Cartesian2.subtract(R,q,new je.Cartesian2(0,0)),X=cn(90,k*.2,J,U);q=je.Cartesian2.multiplyByScalar(U,k*.2,new je.Cartesian2(0,0)),J=je.Cartesian2.subtract(R,q,new je.Cartesian2(0,0));let Y=cn(-90,k*.2,J,U);f.push({fillType:0,positions:[O,G,X,Y,j,O]})}{let R=[];for(let O=0;O<A[2];O++){let F=w[O];R.push(F)}f.push({fillType:0,positions:R})}{let R=w[A[3]],O=w[A[4]],F=je.Cartesian2.subtract(O,R,new je.Cartesian2(0,0)),k=je.Cartesian2.magnitude(F),U=je.Cartesian2.normalize(F,new je.Cartesian2(0,0)),G=[];for(let j=0;j<=36;j++){let q=cn(-j*10,k,R,U);G.push(q)}f.push({fillType:0,positions:G})}{let R=[];for(let O=A[4];O<A[1]+1;O++){let F=w[O];R.push(F)}f.push({fillType:0,positions:R})}{let R=w[A[1]],O=w[L-1],F=je.Cartesian2.subtract(O,R,new je.Cartesian2(0,0)),k=je.Cartesian2.magnitude(F),U=je.Cartesian2.normalize(F,new je.Cartesian2(0,0)),G=cn(90,k*.2,R,U),j=cn(-90,k*.2,R,U);f.push({fillType:0,positions:[O,G,j,O]})}return f};vo.prototype._createType_10_34902=function(o){let f=[];if(o.length===2&&Math.abs(o[0].x-o[1].x)<1e-6&&Math.abs(o[0].y-o[1].y)<1e-6)return f=[{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o},{fillType:0,positions:o}],f;let m=[];o.forEach(function(O){m.push(O.x,O.y,0)});let v=je.Cartesian3.fromDegreesArrayHeights(m),y=[],x=v.length;for(let O=0;O<x;O++)y.push(O*.5);let C=new je.CatmullRomSpline({times:y,points:v}),w=[];for(let O=0;O<y.length;O++){let F=y[O],k=y[O+1];for(let U=F;U<k;U+=.01){let G=C.evaluate(U),j=je.Cartographic.fromCartesian(G);w.push(new je.Cartesian2(j.longitude,j.latitude))}}let A=[],E=6,T=0,S=0,M=[];for(let O=0;O<w.length-1;O++){let F=w[O],k=w[O+1],U=je.Cartesian2.subtract(k,F,new je.Cartesian2(0,0));T+=je.Cartesian2.magnitude(U),M.push(T)}S=T/E;for(let O=0;O<M.length;O++)if(M[O]>S){A.push(O);break}for(let O=M.length-1;O>0;O--){let F=M[O];if(T-F>S){A.push(O);break}}let I=T*.45;for(let O=0;O<M.length;O++)if(M[O]>I){A.push(O);break}let P=T*.5;for(let O=0;O<M.length;O++)if(M[O]>P){A.push(O);break}let D=T*.55;for(let O=0;O<M.length;O++)if(M[O]>D){A.push(O);break}let L=T*.6;for(let O=0;O<M.length;O++)if(M[O]>L){A.push(O);break}let R=w.length;{let O=w[0],F=w[A[0]],k=je.Cartesian2.subtract(F,O,new je.Cartesian2(0,0)),U=je.Cartesian2.magnitude(k),G=je.Cartesian2.normalize(k,new je.Cartesian2(0,0)),j=cn(90,U*.2,F,G),q=cn(-90,U*.2,F,G),J=je.Cartesian2.multiplyByScalar(G,U*.4,new je.Cartesian2(0,0)),X=je.Cartesian2.subtract(O,J,new je.Cartesian2(0,0)),Y=cn(90,U*.2,X,G);J=je.Cartesian2.multiplyByScalar(G,U*.2,new je.Cartesian2(0,0)),X=je.Cartesian2.subtract(O,J,new je.Cartesian2(0,0));let Q=cn(-90,U*.2,X,G);f.push({fillType:0,positions:[F,j,Y,Q,q,F]})}{let O=[];for(let F=0;F<A[2];F++){let k=w[F];O.push(k)}f.push({fillType:0,positions:O})}{let O=w[A[3]],F=w[A[4]],k=je.Cartesian2.subtract(F,O,new je.Cartesian2(0,0)),U=je.Cartesian2.normalize(k,new je.Cartesian2(0,0)),G=[];for(let j=0;j<=36;j++){let q=cn(-j*10,T*.05,O,U);G.push(q)}f.push({fillType:0,positions:G})}{let O=w[A[4]],F=w[A[5]],k=je.Cartesian2.subtract(F,O,new je.Cartesian2(0,0)),U=je.Cartesian2.normalize(k,new je.Cartesian2(0,0)),G=[];for(let j=0;j<=36;j++){let q=cn(-j*10,T*.05,O,U);G.push(q)}f.push({fillType:0,positions:G})}{let O=[];for(let F=A[5];F<A[1]+1;F++){let k=w[F];O.push(k)}f.push({fillType:0,positions:O})}{let O=w[A[1]],F=w[R-1],k=je.Cartesian2.subtract(F,O,new je.Cartesian2(0,0)),U=je.Cartesian2.magnitude(k),G=je.Cartesian2.normalize(k,new je.Cartesian2(0,0)),j=cn(90,U*.2,O,G),q=cn(-90,U*.2,O,G);f.push({fillType:0,positions:[F,j,q,F]})}return f};vo.prototype.createDemarcationLine=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=.001,C=[],w=[],A=void 0;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var E;return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(T){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var S=T.position,M=m._createGeoPoints(v,[{x:S.x,y:S.y}]);C.length==0&&(C.push({x:M[0],y:M[1],z:M[2]}),w.push(M)),C.push({x:M[0],y:M[1],z:M[2]}),w.push(M)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(T){m._core.CreateTooltip(y,T.endPosition,!0);var S=T.endPosition;if(C.length>0)if(je.defined(A)){C.pop(),w.pop();var I=m._createGeoPoints(v,[{x:S.x,y:S.y}]);C.push({x:I[0],y:I[1],z:I[2]}),w.push(I);var M=m._createDemarcationLinePoints(C,x),I=[];M.forEach(L=>{I.push(L.x,L.y,C[0].z)}),E=je.Cartesian3.fromDegreesArrayHeights(I)}else{var M=m._createDemarcationLinePoints(C,x),I=[];M.forEach(P=>{I.push(P.x,P.y,C[0].z)}),E=je.Cartesian3.fromDegreesArrayHeights(I),A=v.entities.add({name:"DemarcationLine",polyline:{positions:new je.CallbackProperty(function(){return E},!1),clampToGround:!0,width:m._core.defaultValue(o.width,1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),A.GeoType="DemarcationLine",m.MilitaryStandardObj.push(A.id)}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(T){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=T=>{if(this.end=void 0,A&&(A.pottingPoint=w),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),T==="cancel"){A&&(v.entities.remove(A),m.MilitaryStandardObj.pop());return}f&&f(A)},this};vo.prototype.Type_10_35000=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[],A=[];return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1,m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){let I=[];var S=m._createType_10_35000(x),M=[];S[0].positions.forEach(L=>{M.push(L.x,L.y,x[0].z)});let P=je.Cartesian3.fromRadiansArrayHeights(M);A.push(P);let D=v.entities.add({name:"10_35000",polyline:{positions:new je.CallbackProperty(function(){return A[0]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}});D.GeoType="10_35000",D.polyline.customData=w,w.push(D),I.push(D.id),m.MilitaryStandardObj.push(I)}else{x.pop(),C.pop();var M=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:M[0],y:M[1],z:M[2]}),C.push(M);var S=m._createType_10_35000(x),M=[];S[0].positions.forEach(D=>{M.push(D.x,D.y,x[0].z)}),A[0]=je.Cartesian3.fromRadiansArrayHeights(M)}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_29100=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[],A=[];return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1,m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S),x.length==4&&m.end&&m.end()},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){let P=[];var S=m._createType_10_29100(x),M=[];S[0].positions.forEach(L=>{M.push(L.x,L.y,x[0].z)});var I=je.Cartesian3.fromRadiansArrayHeights(M);A.push(I);let D=v.entities.add({name:"10_29100",polyline:{positions:new je.CallbackProperty(function(){return A[0]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}});D.GeoType="10_29100",D.polyline.customData=w,w.push(D),P.push(D.id),m.MilitaryStandardObj.push(P)}else{x.pop(),C.pop();var M=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:M[0],y:M[1],z:M[2]}),C.push(M);var S=m._createType_10_29100(x),M=[];S[0].positions.forEach(L=>{M.push(L.x,L.y,x[0].z)}),A[0]=je.Cartesian3.fromRadiansArrayHeights(M)}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_33400=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_33400(x),M=[];for(let L=0;L<S.length;L++){let R=S[L];var I=[];R.positions.forEach(O=>{I.push(O.x,O.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);var D=v.entities.add({name:"10_33400",polyline:{positions:new je.CallbackProperty(function(){return A[L]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}});D.GeoType="10_33400",D.polyline.customData=w,w.push(D),M.push(D.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_33400(x);for(let O=0;O<S.length;O++){let F=S[O];var I=[];F.positions.forEach(U=>{I.push(U.x,U.y,x[0].z)}),A[O]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_33401=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_33401(x),M=[];for(let L=0;L<S.length;L++){let R=S[L];var I=[];R.positions.forEach(O=>{I.push(O.x,O.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);var D=v.entities.add({name:"10_33401",polyline:{positions:new je.CallbackProperty(function(){return A[L]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}});D.GeoType="10_33401",D.polyline.customData=w,w.push(D),M.push(D.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_33401(x);for(let O=0;O<S.length;O++){let F=S[O];var I=[];F.positions.forEach(U=>{I.push(U.x,U.y,x[0].z)}),A[O]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_33402=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S),x.length==4&&m.end&&m.end()},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_33402(x),M=[];for(let L=0;L<S.length;L++){let R=S[L];var I=[];R.positions.forEach(O=>{I.push(O.x,O.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);var D=v.entities.add({name:"10_33402",polyline:{positions:new je.CallbackProperty(function(){return A[L]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}});D.GeoType="10_33402",D.polyline.customData=w,w.push(D),M.push(D.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_33402(x);for(let O=0;O<S.length;O++){let F=S[O];var I=[];F.positions.forEach(U=>{I.push(U.x,U.y,x[0].z)}),A[O]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_33403=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S),x.length==3&&m.end&&m.end()},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_33403(x),M=[];for(let D=0;D<S.length;D++){let L=S[D];var I=[];L.positions.forEach(O=>{I.push(O.x,O.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let R=null;R=v.entities.add({name:"10_33403",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),R.polyline.customData=w,R.GeoType="10_33403",w.push(R),M.push(R.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_33403(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_33404=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S),x.length==3&&m.end&&m.end()},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_33404(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_33404",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_33404",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_33404",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_33404(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_34300=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S),x.length==3&&m.end&&m.end()},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_34300(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_34300",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_34300",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_34300",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_34300(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_34900=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_34900(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_34900",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_34900",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_34900",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_34900(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_33700=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_33700(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_33700",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_33700",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_33700",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_33700(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_34700=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_34700(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_34700",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_34700",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_34700",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_34700(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_34400=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_34400(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_34400",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_34400",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_34400",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_34400(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_34500=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S),x.length==3&&m.end&&m.end()},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_34500(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_34500",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_34500",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_34500",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_34500(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_34501=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S),x.length==3&&m.end&&m.end()},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_34501(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_34501",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_34501",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_34501",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_34501(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_35200=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_35200(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_35200",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_35200",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_35200",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_35200(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_34901=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_34901(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_34901",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_34901",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_34901",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_34901(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype.Type_10_34902=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=[],C=[],w=[];this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var A=[];return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(E){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var T=E.position,S=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.length==0&&(x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)),x.push({x:S[0],y:S[1],z:S[2]}),C.push(S)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(E){m._core.CreateTooltip(y,E.endPosition,!0);var T=E.endPosition;if(x.length>0)if(w.length===0){var S=m._createType_10_34902(x),M=[];for(let D=0;D<S.length;D++){let L=S[D],R=L.fillType;var I=[];L.positions.forEach(F=>{I.push(F.x,F.y,x[0].z)});var P=je.Cartesian3.fromRadiansArrayHeights(I);A.push(P);let O=null;R===0?(O=v.entities.add({name:"10_34902",polyline:{positions:new je.CallbackProperty(function(){return A[D]},!1),clampToGround:!0,width:m._core.defaultValue(o.width,3),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),O.polyline.customData=w):(O=v.entities.add({name:"10_34902",polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(A[D])},!1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"rgba(255,0,0,0.6)"))}}),O.polygon.customData=w),O.GeoType="10_34902",w.push(O),M.push(O.id)}m.MilitaryStandardObj.push(M)}else{x.pop(),C.pop();var I=m._createGeoPoints(v,[{x:T.x,y:T.y}]);x.push({x:I[0],y:I[1],z:I[2]}),C.push(I);var S=m._createType_10_34902(x);for(let R=0;R<S.length;R++){let O=S[R];var I=[];O.positions.forEach(k=>{I.push(k.x,k.y,x[0].z)}),A[R]=je.Cartesian3.fromRadiansArrayHeights(I)}}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(E){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=E=>{if(this.end=void 0,w.forEach(function(T){T.pottingPoint=C}),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),E==="cancel"){w.length>0&&(w.forEach(function(T){v.entities.remove(T)}),m.MilitaryStandardObj.pop());return}f&&f(w)},this};vo.prototype._createOperationalCurve=function(o,f){var m=[],v=o[0],y=o[1],x=new je.Cartesian2(v.x,v.y),C=new je.Cartesian2(y.x,y.y),w=je.Cartesian2.subtract(C,x,new je.Cartesian2(0,0)),A=je.Cartesian2.magnitude(w);if(A<1e-5)return m.push(o[0],o[1]),m;var E=je.Cartesian2.normalize(w,new je.Cartesian2(0,0)),T=new je.Cartesian2(E.y*3e-4,-E.x*3e-4);let S=Math.floor(A<f?2:A/f);for(let D=0;D<S;D++)if(D===0){let L=je.Cartesian2.add(x,T,new je.Cartesian2(0,0));m.push(L,x)}else if(D===S-1){let L=je.Cartesian2.add(C,T,new je.Cartesian2(0,0));m.push(C,L)}else{var M=je.Cartesian2.multiplyByScalar(E,D*f,new je.Cartesian2(0,0)),I=je.Cartesian2.add(x,M,new je.Cartesian2(0,0)),P=je.Cartesian2.add(I,T,new je.Cartesian2(0,0));m.push(I,P,I)}return m.push(m[0]),m};vo.prototype.createOperationalCurve=function(o,f){var m=this,v=this._viewer,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=.001,C=[],w=[],A=void 0;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),m._core.mouse(m._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var E;return m.drawHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),m.drawHandler.setInputAction(function(T){y="\u5DE6\u952E\u6DFB\u52A0\u70B9 \u53F3\u952E\u7ED3\u675F";var S=T.position,M=m._createGeoPoints(v,[{x:S.x,y:S.y}]);C.length==0&&(C.push({x:M[0],y:M[1],z:M[2]}),w.push(M)),C.push({x:M[0],y:M[1],z:M[2]}),w.push(M)},je.ScreenSpaceEventType.LEFT_CLICK),m.drawHandler.setInputAction(function(T){m._core.CreateTooltip(y,T.endPosition,!0);var S=T.endPosition;if(C.length>0)if(je.defined(A)){C.pop(),w.pop();var I=m._createGeoPoints(v,[{x:S.x,y:S.y}]);C.push({x:I[0],y:I[1],z:I[2]}),w.push(I);var M=m._createOperationalCurve(C,x),I=[];M.forEach(L=>{I.push(L.x,L.y,C[0].z)}),E=je.Cartesian3.fromDegreesArrayHeights(I)}else{var M=m._createOperationalCurve(C,x),I=[];M.forEach(P=>{I.push(P.x,P.y,C[0].z)}),E=je.Cartesian3.fromDegreesArrayHeights(I),A=v.entities.add({name:"OperationalCurve",polyline:{positions:new je.CallbackProperty(function(){return E},!1),clampToGround:!0,width:m._core.defaultValue(o.width,1),material:je.Color.fromCssColorString(m._core.defaultValue(o.color,"#ff0000"))}}),A.GeoType="OperationalCurve",m.MilitaryStandardObj.push(A.id)}},je.ScreenSpaceEventType.MOUSE_MOVE),m.drawHandler.setInputAction(function(T){m.end&&m.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=T=>{if(this.end=void 0,A&&(A.pottingPoint=w),m.drawHandler.destroy(),m._core.CreateTooltip(y,void 0,!1),m._core.mouse(m._viewer.container,0),setTimeout(function(){Ne.states=0},100),T==="cancel"){A&&(v.entities.remove(A),m.MilitaryStandardObj.pop());return}f&&f(A)},this};vo.prototype.createSwallowtailArrow=function(o,f,m){var v=o,y=this,x=this._viewer,C=void 0,w=[],A=[],E="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),y._core.mouse(y._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var T;return y.drawHandler=new je.ScreenSpaceEventHandler(x.scene.canvas),y.drawHandler.setInputAction(function(S){var M=S.position;if(E="\u5355\u51FB\u5B8C\u6210\u7ED8\u5236",A.length==0){var I=y._createGeoPoints(x,[{x:M.x,y:M.y}]);A.push({x:I[0],y:I[1],z:I[2]},{x:I[0]+1e-7,y:I[1]+1e-7,z:I[2]}),w.push(I,I)}else A.length==2&&y.end&&y.end()},je.ScreenSpaceEventType.LEFT_CLICK),y.drawHandler.setInputAction(function(S){y._core.CreateTooltip(E,S.endPosition,!0);var M=S.endPosition;if(A.length>1)if(je.defined(C)){A.pop(),w.pop();var P=y._createGeoPoints(x,[{x:M.x,y:M.y}]);A.push({x:P[0],y:P[1],z:P[2]}),w.push(P);var I=y._computeSwallowtailArrow(A),P=[];I.forEach(R=>{P.push(R.x,R.y,A[0].z)}),T=je.Cartesian3.fromDegreesArrayHeights(P)}else{C=y.plotingSwallowtailArrow(x,A,v,f);var I=y._computeSwallowtailArrow(A),P=[];I.forEach(D=>{P.push(D.x,D.y,A[0].z)}),T=je.Cartesian3.fromDegreesArrayHeights(P),C.polygon.hierarchy=new je.CallbackProperty(function(){return new je.PolygonHierarchy(T)},!1),C.GeoType="SwallowtailArrow",y.MilitaryStandardObj.push(C.id)}else return},je.ScreenSpaceEventType.MOUSE_MOVE),y.drawHandler.setInputAction(function(S){y.end&&y.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=S=>{if(this.end=void 0,C&&(C.pottingPoint=w),y._core.CreateTooltip(E,void 0,!1),y.drawHandler.destroy(),y._core.mouse(y._viewer.container,0),setTimeout(function(){Ne.states=0},100),S==="cancel"){C&&(x.entities.remove(C),y.MilitaryStandardObj.pop());return}m&&m(C)},this};vo.prototype.createStraightArrow=function(o,f,m){var v=o,y=this,x=this._viewer,C=[],w=void 0,A=[],E="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236";Ne.states=1;var T;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),y._core.mouse(y._viewer.container,1,window.SmartEarthRootUrl+pn.draw),y.drawHandler=new je.ScreenSpaceEventHandler(x.scene.canvas),y.drawHandler.setInputAction(function(S){var M=S.position;if(E="\u5355\u51FB\u5B8C\u6210\u7ED8\u5236",C.length==0){var I=y._createGeoPoints(x,[{x:M.x,y:M.y}]);C.push({x:I[0],y:I[1],z:I[2]},{x:I[0]+1e-7,y:I[1]+1e-7,z:I[2]}),A.push(I,I)}else C.length==2&&y.end&&y.end()},je.ScreenSpaceEventType.LEFT_CLICK),y.drawHandler.setInputAction(function(S){var M=S.endPosition;if(y._core.CreateTooltip(E,M,!0),C.length>1)if(je.defined(w)){C.pop(),A.pop();var P=y._createGeoPoints(x,[{x:M.x,y:M.y}]);C.push({x:P[0],y:P[1],z:P[2]}),A.push(P);var I=y.calculateMorePoints(C),P=[];I.forEach(R=>{P.push(R.x,R.y,C[0].z)}),T=je.Cartesian3.fromDegreesArrayHeights(P)}else{var I=y.calculateMorePoints(C),P=[];I.forEach(D=>{P.push(D.x,D.y,C[0].z)}),T=je.Cartesian3.fromDegreesArrayHeights(P),v=="polygon"?w=x.entities.add({name:"StraightArrow",polygon:{hierarchy:T,material:je.Color.fromCssColorString(y._core.defaultValue(f.color,"rgba(255,0,0,0.6)"))}}):v=="box"&&(w=x.entities.add({name:"StraightArrow",polygon:{hierarchy:T,material:je.Color.fromCssColorString(y._core.defaultValue(f.color,"rgba(255,0,0,0.6)")),extrudedHeight:P[2]+y._core.defaultValue(f.extrudedHeight,200),height:P[2],outline:y._core.defaultValue(f.outline,!0),outlineColor:je.Color.fromCssColorString(y._core.defaultValue(f.outlineColor,"rgba(255,0,0,0.6)"))}})),w.polygon.hierarchy=new je.CallbackProperty(function(){return new je.PolygonHierarchy(T)},!1),w.GeoType="StraightArrow",y.MilitaryStandardObj.push(w.id)}else return},je.ScreenSpaceEventType.MOUSE_MOVE),y.drawHandler.setInputAction(function(S){y.end&&y.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=S=>{if(this.end=void 0,w&&(w.pottingPoint=A),y._core.CreateTooltip(E,void 0,!1),y.drawHandler.destroy(),y._core.mouse(y._viewer.container,0),setTimeout(function(){Ne.states=0},100),S==="cancel"){w&&(x.entities.remove(w),y.MilitaryStandardObj.pop());return}m&&m(w)},this};vo.prototype.createRoundedRectangle=function(o,f,m){var v=o,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=this,C=this._viewer,w=[],A=[],E=void 0;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),x._core.mouse(x._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var T;return x.drawHandler=new je.ScreenSpaceEventHandler(C.scene.canvas),x.drawHandler.setInputAction(function(S){var M=S.position;if(y="\u5355\u51FB\u5B8C\u6210\u7ED8\u5236",w.length==0){var I=x._createGeoPoints(C,[{x:M.x,y:M.y}]);w.push({x:I[0],y:I[1],z:I[2]},{x:I[0]+1e-7,y:I[1]+1e-7,z:I[2]}),A.push(I,I)}else w.length==2&&x.end&&x.end()},je.ScreenSpaceEventType.LEFT_CLICK),x.drawHandler.setInputAction(function(S){x._core.CreateTooltip(y,S.endPosition,!0);var M=S.endPosition;if(w.length>1)if(je.defined(E)){w.pop(),A.pop();var P=x._createGeoPoints(C,[{x:M.x,y:M.y}]);w.push({x:P[0],y:P[1],z:P[2]}),A.push(P);var I=x._computeRoundedRectanglePoints(w),P=[];I.forEach(R=>{P.push(R.x,R.y,w[0].z)}),T=je.Cartesian3.fromDegreesArrayHeights(P)}else{var I=x._computeRoundedRectanglePoints(w),P=[];I.forEach(D=>{P.push(D.x,D.y,w[0].z)}),T=je.Cartesian3.fromDegreesArrayHeights(P),v=="polygon"?E=C.entities.add({name:"RoundedRectangle",polygon:{hierarchy:T,material:je.Color.fromCssColorString(x._core.defaultValue(f.color,"rgba(255,0,0,0.6)")),outline:x._core.defaultValue(f.outline,!0),outlineColor:je.Color.fromCssColorString(x._core.defaultValue(f.outlineColor,"rgba(255,0,0,0.6)"))}}):v=="box"&&(E=C.entities.add({name:"RoundedRectangle",polygon:{hierarchy:T,material:je.Color.fromCssColorString(x._core.defaultValue(f.color,"rgba(255,0,0,0.6)")),outline:x._core.defaultValue(f.outline,!0),outlineColor:je.Color.fromCssColorString(x._core.defaultValue(f.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:P[2]+x._core.defaultValue(f.extrudedHeight,200),height:P[2]}})),E.polygon.hierarchy=new je.CallbackProperty(function(){return new je.PolygonHierarchy(T)},!1),E.GeoType="RoundedRectangle",x.MilitaryStandardObj.push(E.id)}},je.ScreenSpaceEventType.MOUSE_MOVE),x.drawHandler.setInputAction(function(S){x.end&&x.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=S=>{if(this.end=void 0,E&&(E.pottingPoint=A),x._core.CreateTooltip(y,void 0,!1),x.drawHandler.destroy(),x._core.mouse(x._viewer.container,0),setTimeout(function(){Ne.states=0},100),S==="cancel"){E&&(C.entities.remove(E),x.MilitaryStandardObj.pop());return}m&&m(E)},this};vo.prototype.createSector=function(o,f,m){var v=o,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=this._viewer,C=this,w=[],A=[],E,T;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),C._core.mouse(C._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var S;return C.drawHandler=new je.ScreenSpaceEventHandler(x.scene.canvas),C.drawHandler.setInputAction(function(M){y="\u5355\u51FB\u6DFB\u52A0\u70B9";var I=M.position,P=C._createGeoPoints(x,[{x:I.x,y:I.y}]);w.length==0?(w.push({x:P[0],y:P[1],z:P[2]},{x:P[0],y:P[1],z:P[2]}),A.push(P,P)):w.length==2?(w.push({x:P[0],y:P[1],z:P[2]}),A.push(P)):w.length==3&&C.end&&C.end(),A.length===2&&!T&&(T=x.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new je.CallbackProperty(function(){return[je.Cartesian3.fromDegrees(A[0][0],A[0][1]),je.Cartesian3.fromDegrees(A[1][0],A[1][1])]},!1),clampToGround:!0,material:je.Color.fromCssColorString(C._core.defaultValue(f.color,"rgba(255,0,0,0.6)")),width:3}}))},je.ScreenSpaceEventType.LEFT_CLICK),C.drawHandler.setInputAction(function(M){C._core.CreateTooltip(y,M.endPosition,!0);var I=M.endPosition;if(w.length===2){w.pop(),A.pop();var P=C._createGeoPoints(x,[{x:I.x,y:I.y}]);w.push({x:P[0],y:P[1],z:P[2]}),A.push(P)}if(w.length>2)if(T&&x.entities.remove(T),je.defined(E)){w.pop(),A.pop();var P=C._createGeoPoints(x,[{x:I.x,y:I.y}]);w.push({x:P[0],y:P[1],z:P[2]}),A.push(P);var D=C._computeSectorPoints(w),P=[];D.forEach(O=>{P.push(O.x,O.y,w[0].z)}),S=je.Cartesian3.fromDegreesArrayHeights(P)}else{var D=C._computeSectorPoints(w),P=[];D.forEach(R=>{P.push(R.x,R.y,w[0].z)}),S=je.Cartesian3.fromDegreesArrayHeights(P),v=="polygon"?E=x.entities.add({name:"Sector",polygon:{hierarchy:S,material:je.Color.fromCssColorString(C._core.defaultValue(f.color,"rgba(255,0,0,0.6)")),outline:C._core.defaultValue(f.outline,!0),outlineColor:je.Color.fromCssColorString(C._core.defaultValue(f.outlineColor,"rgba(255,0,0,0.6)"))}}):v=="box"&&(E=x.entities.add({name:"Sector",polygon:{hierarchy:S,material:je.Color.fromCssColorString(C._core.defaultValue(f.color,"rgba(255,0,0,0.6)")),outline:C._core.defaultValue(f.outline,!0),outlineColor:je.Color.fromCssColorString(C._core.defaultValue(f.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:P[2]+C._core.defaultValue(f.extrudedHeight,200),height:P[2]}})),E.polygon.hierarchy=new je.CallbackProperty(function(){return new je.PolygonHierarchy(S)},!1),E.GeoType="Sector",C.MilitaryStandardObj.push(E.id)}},je.ScreenSpaceEventType.MOUSE_MOVE),C.drawHandler.setInputAction(function(M){C.end&&C.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=M=>{if(this.end=void 0,E&&(E.pottingPoint=A),C._core.CreateTooltip(y,void 0,!1),C.drawHandler.destroy(),C._core.mouse(C._viewer.container,0),T&&x.entities.remove(T),setTimeout(function(){Ne.states=0},100),M==="cancel"){E&&(x.entities.remove(E),C.MilitaryStandardObj.pop());return}m&&m(E)},this};vo.prototype.createBow=function(o,f,m){var v=o,y=this,x=this._viewer,C="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",w=[],A=[],E=void 0;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),y._core.mouse(y._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var T;return y.drawHandler=new je.ScreenSpaceEventHandler(x.scene.canvas),y.drawHandler.setInputAction(function(S){C="\u5355\u51FB\u6DFB\u52A0\u70B9";var M=S.position,I=y._createGeoPoints(x,[{x:M.x,y:M.y}]);w.length==0?(w.push({x:I[0],y:I[1],z:I[2]}),A.push(I)):w.length==1?(w.push({x:I[0],y:I[1],z:I[2]},{x:I[0]+1e-7,y:I[1]+1e-7,z:I[2]}),A.push(I,I)):w.length==3&&y.end&&y.end()},je.ScreenSpaceEventType.LEFT_CLICK),y.drawHandler.setInputAction(function(S){var M=S.endPosition;if(y._core.CreateTooltip(C,S.endPosition,!0),w.length>2)if(je.defined(E)){w.pop(),A.pop();var P=y._createGeoPoints(x,[{x:M.x,y:M.y}]);w.push({x:P[0],y:P[1],z:P[2]}),A.push(P);var I=y._computeBowPoints(w),P=[];I.forEach(R=>{P.push(R.x,R.y,w[0].z)}),T=je.Cartesian3.fromDegreesArrayHeights(P)}else{var I=y._computeBowPoints(w),P=[];I.forEach(D=>{P.push(D.x,D.y,w[0].z)}),T=je.Cartesian3.fromDegreesArrayHeights(P),v=="polygon"?E=x.entities.add({name:"Bow",polygon:{hierarchy:T,material:je.Color.fromCssColorString(y._core.defaultValue(f.color,"rgba(255,0,0,0.6)")),outline:y._core.defaultValue(f.outline,!0),outlineColor:je.Color.fromCssColorString(y._core.defaultValue(f.outlineColor,"rgba(255,0,0,0.6)"))}}):v=="box"&&(E=x.entities.add({name:"Bow",polygon:{hierarchy:T,material:je.Color.fromCssColorString(y._core.defaultValue(f.color,"rgba(255,0,0,0.6)")),outline:y._core.defaultValue(f.outline,!0),outlineColor:je.Color.fromCssColorString(y._core.defaultValue(f.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:P[2]+y._core.defaultValue(f.extrudedHeight,200),height:P[2]}})),E.polygon.hierarchy=new je.CallbackProperty(function(){return new je.PolygonHierarchy(T)},!1),E.GeoType="Bow",y.MilitaryStandardObj.push(E.id)}},je.ScreenSpaceEventType.MOUSE_MOVE),y.drawHandler.setInputAction(function(S){y.end&&y.end()},je.ScreenSpaceEventType.RIGHT_DOWN),this.end=S=>{if(this.end=void 0,E&&(E.pottingPoint=A),y._core.CreateTooltip(C,void 0,!1),y.drawHandler.destroy(),y._core.mouse(y._viewer.container,0),setTimeout(function(){Ne.states=0},100),S==="cancel"){E&&(x.entities.remove(E),y.MilitaryStandardObj.pop());return}m&&m(E)},this};vo.prototype.createPincerArrow=function(o,f,m){var v=o,y=this,x=this._viewer,C=[],w=[],A=[],E=void 0,T=null,S=[],M="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),y._core.mouse(y._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1,y.drawHandler=new je.ScreenSpaceEventHandler(x.scene.canvas),y.drawHandler.setInputAction(function(I){var P,D=I.position;if(M="\u5355\u51FB\u589E\u52A0\u70B9",P=y._getPosition.getMousePosition(I),!!P)if(C.length>4){y._core.CreateTooltip(M,I.position,!1),E.pottingPoint=A,y.drawHandler.destroy(),y._core.mouse(y._viewer.container,0),setTimeout(function(){Ne.states=0},100),m&&m(E);return}else{C.push(P);var L=y._createGeoPoints(x,[{x:D.x,y:D.y}]);A.push(L)}},je.ScreenSpaceEventType.LEFT_CLICK),y.drawHandler.setInputAction(function(I){if(!(C.length<2)){y._core.CreateTooltip(M,I.endPosition,!0);var P;if(P=y._getPosition.getMousePosition(I),!!P&&C.length>=2)if(je.defined(E)){C.pop(),A.pop(),C.push(P);var D=y._createGeoPoints(x,[I.endPosition]);A.push(D)}else{C.push(P);var D=y._createGeoPoints(x,[I.endPosition]);A.push(D),E=y.showArrowOnMap(C,v,f),E.GeoType="PincerArrow",y.MilitaryStandardObj.push(E.id)}}},je.ScreenSpaceEventType.MOUSE_MOVE)};vo.prototype.createAttackArrow=function(o,f,m){var v=o,y=this,x=this._viewer,C=[],w=[],A=[],E=void 0,T=null,S=[],M="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236";this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),y._core.mouse(y._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1,y.drawHandler=new je.ScreenSpaceEventHandler(x.scene.canvas),y.drawHandler.setInputAction(function(I){var P;if(M="\u5355\u51FB\u589E\u52A0\u70B9",P=y._getPosition.getMousePosition(I),!!P){C.push(P);var D=y._createGeoPoints(x,[I.position]);A.push(D)}},je.ScreenSpaceEventType.LEFT_CLICK),y.drawHandler.setInputAction(function(I){C.length>1&&(C.pop(),A.pop())},je.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),y.drawHandler.setInputAction(function(I){if(!(C.length<2)){y._core.CreateTooltip(M,I.endPosition,!0);var P;if(P=y._getPosition.getMousePosition(I),!!P&&C.length>=2)if(je.defined(E)){C.pop(),A.pop(),C.push(P);var D=y._createGeoPoints(x,[I.endPosition]);A.push(D)}else{C.push(P);var D=y._createGeoPoints(x,[I.endPosition]);A.push(D),E=y.showAttackArrowOnMap(C,v,f),E.GeoType="AttackArrow",y.MilitaryStandardObj.push(E.id)}}},je.ScreenSpaceEventType.MOUSE_MOVE),y.drawHandler.setInputAction(function(I){y._core.CreateTooltip(M,I.position,!1),E.pottingPoint=A,y.drawHandler.destroy(),y._core.mouse(y._viewer.container,0),setTimeout(function(){Ne.states=0},100),m&&m(E)},je.ScreenSpaceEventType.RIGHT_DOWN)};vo.prototype.createHandlerPolygon=function(o,f,m){var v=o,y="\u5355\u51FB\u5F00\u59CB\u7ED8\u5236",x=this,C=this._viewer,w=[],A=[],E=void 0;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.earthCtrl&&this.earthCtrl.factory&&this.earthCtrl.factory._SimpleGraphic&&this.earthCtrl.factory._SimpleGraphic.drawHandler&&(this.earthCtrl.factory._SimpleGraphic.drawHandler.destroy(),this.earthCtrl.factory._SimpleGraphic.drawHandler=void 0),x._core.mouse(x._viewer.container,1,window.SmartEarthRootUrl+pn.draw),Ne.states=1;var T;return x.drawHandler=new je.ScreenSpaceEventHandler(C.scene.canvas),x.drawHandler.setInputAction(function(S){var M=S.position;if(y="\u5355\u51FB\u5B8C\u6210\u7ED8\u5236",w.length==0){var I=x._createGeoPoints(C,[{x:M.x,y:M.y}]);w.push({x:I[0],y:I[1],z:I[2]},{x:I[0]+1e-7,y:I[1]+1e-7,z:I[2]}),A.push(I,I)}else w.length==2&&(x._core.CreateTooltip(y,M,!1),E.pottingPoint=A,setTimeout(function(){Ne.states=0},100),x.drawHandler.destroy(),x._core.mouse(x._viewer.container,0),m&&m(E))},je.ScreenSpaceEventType.LEFT_CLICK),x.drawHandler.setInputAction(function(S){var M=S.endPosition;if(x._core.CreateTooltip(y,S.endPosition,!0),w.length>1){var I,P,D,L;if(!je.defined(E))D=x._computeGatheringPlacePoints(w),L=x.createCloseCardinal(D),I=x.calculatePointsFBZ3(L,100),P=[],I.forEach(R=>{P.push(R.x,R.y,w[0].z)}),T=P,E=x.plotingGatheringPlace(C,w,v,f),E.polygon.hierarchy=new je.CallbackProperty(function(){return new je.PolygonHierarchy(je.Cartesian3.fromDegreesArrayHeights(T))},!1),E.GeoType="GatheringPlace",x.MilitaryStandardObj.push(E.id);else{w.pop(),A.pop();var P=x._createGeoPoints(C,[{x:M.x,y:M.y}]);w.push({x:P[0],y:P[1],z:P[2]}),A.push(P),D=x._computeGatheringPlacePoints(w),L=x.createCloseCardinal(D),I=x.calculatePointsFBZ3(L,100);var P=[];I.forEach(O=>{P.push(O.x,O.y,w[0].z)}),T=P}}},je.ScreenSpaceEventType.MOUSE_MOVE),w};vo.prototype.plotingGatheringPlace=function(o,f,m,v){var y=this._computeGatheringPlacePoints(f),x=this.createCloseCardinal(y),C=this.calculatePointsFBZ3(x,100),w=this._createGeoPoints(o,C),A;return m=="polygon"?A=o.entities.add({name:"GatheringPlace",polygon:{hierarchy:je.Cartesian3.fromDegreesArrayHeights(w),material:je.Color.fromCssColorString(this._core.defaultValue(v.color,"rgba(255,0,0,0.6)")),outline:this._core.defaultValue(v.outline,!0),outlineColor:je.Color.fromCssColorString(this._core.defaultValue(v.outlineColor,"rgba(255,0,0,0.6)"))}}):A=o.entities.add({name:"GatheringPlace",polygon:{hierarchy:je.Cartesian3.fromDegreesArrayHeights(w),extrudedHeight:this._core.defaultValue(v.extrudedHeight,200)+w[2],height:w[2],material:je.Color.fromCssColorString(this._core.defaultValue(v.color,"rgba(255,0,0,0.6)")),outline:this._core.defaultValue(v.outline,!0),outlineColor:je.Color.fromCssColorString(this._core.defaultValue(v.outlineColor,"rgba(255,0,0,0.6)"))}}),A};function D8(o){return["10_29100","10_33400","10_33401","10_33402","10_33403","10_33404","10_35000","10_34700","10_34400","10_34500","10_34501","10_34900","10_34901"].indexOf(o)!==-1}vo.prototype.addFeature=function(o){let f,m=o.geometry.coordinates,v=[];if(o.type=="PincerArrow"){let C=VD.algorithm.doubleArrow(m),w=[];JSON.stringify(C.polygonalPoint).indexOf("null")==-1&&(w=C.polygonalPoint),f=w}else if(o.type=="AttackArrow"){let C=VD.algorithm.tailedAttackArrow(m),w=JSON.stringify(C.polygonalPoint).indexOf("null"),A=[];w==-1&&(A=C.polygonalPoint),f=A}else if(m.forEach(C=>{v.push({x:C[0],y:C[1],z:C[2]})}),o.type=="StraightArrow")f=this.calculateMorePoints(v);else if(o.type=="RoundedRectangle")f=this._computeRoundedRectanglePoints(v);else if(o.type=="Sector")f=this._computeSectorPoints(v);else if(o.type=="Bow")f=this._computeBowPoints(v);else if(o.type=="GatheringPlace"){let C=this._computeGatheringPlacePoints(v),w=this.createCloseCardinal(C);f=this.calculatePointsFBZ3(w,100)}else if(o.type=="SwallowtailArrow")f=this._computeSwallowtailArrow(v);else if(o.type=="Bezierline")f=this._createBezierPoints(v);else if(o.type=="BezierArrow")f=this._createBezierPoints(v);else if(D8(o.type)){let C=`_createType_${o.type}`;f=this[C](v)}let y;if(o.type!=="AttackArrow"&&o.type!=="PincerArrow")if(D8(o.type)){y=[];for(let C=0;C<f.length;C++){let w=f[C].fillType,A=f[C].positions,E=[];A.forEach(T=>{E.push(T.x,T.y,v[0].z)}),y.push(je.Cartesian3.fromRadiansArrayHeights(E))}}else y=[],f.forEach(C=>{y.push(C.x,C.y,v[0].z)}),y=je.Cartesian3.fromDegreesArrayHeights(y);else y=f;let x;if(o.type.indexOf("Bezier")>=0)x=this._viewer.entities.add({id:o.id,name:o.name,polyline:{positions:new je.CallbackProperty(function(){return y},!1),width:o.style.width,clampToGround:!0,material:o.type==="BezierArrow"?new je.PolylineArrowMaterialProperty(new je.Color.fromCssColorString(o.style.fillColor.color).withAlpha(o.style.fillColor.alpha)):new je.Color.fromCssColorString(o.style.fillColor.color).withAlpha(o.style.fillColor.alpha)}});else if(D8(o.type)){let C=[],w=null,A=o.id.split(",");for(let E=0;E<y.length;E++){let T=y[E],S=this._viewer.entities.add({id:A[E],name:o.name,polyline:{positions:new je.CallbackProperty(function(){return T},!1),width:o.style.width,clampToGround:!0,material:new je.Color.fromCssColorString(o.style.fillColor.color).withAlpha(o.style.fillColor.alpha)}});C.push(S),S.polyline.customData=C,w=S,S.GeoType=o.type,S.pottingPoint=m}return!o.removeEdit&&this.MilitaryStandardObj.push(A),this.defaultEdit(),w}else x=this._viewer.entities.add({id:o.id,name:o.name,polygon:{hierarchy:new je.CallbackProperty(function(){return new je.PolygonHierarchy(y)},!1),fill:!0,extrudedHeight:o.style.extrudedHeight!==void 0?o.style.extrudedHeight+o.style.height:void 0,height:o.style.height,material:new je.Color.fromCssColorString(o.style.fillColor.color).withAlpha(o.style.fillColor.alpha),outline:o.style.outline,outlineColor:o.style.outlineColor?new je.Color.fromCssColorString(o.style.outlineColor.color).withAlpha(o.style.outlineColor.alpha):void 0}});return x.GeoType=o.type,x.pottingPoint=m,!o.removeEdit&&this.MilitaryStandardObj.push(x.id),this.defaultEdit(),x};vo.prototype.open=function(o,f=!1,m=!0,v,y){if(!o)return;var x=this,C=this._viewer;let w=y,A=function(T){let S=T.features,M=[];return S.forEach(I=>{let P=x.addFeature(I);if(w&&P)P._polyline&&P._polyline.customData?M.push(P._polyline.customData):M.push(P);else if(P){let D=new je.EntityCollection;P._polyline&&P._polyline.customData?P._polyline.customData.forEach(L=>{D.add(L)}):D.add(P),M.push(D)}}),m&&M[0]&&C.flyTo(M[0]),v&&typeof v=="function"&&v(M),M};if(f)return A(o);var E=new FileReader;E.readAsText(o),E.onload=function(){let T=JSON.parse(this.result);return A(T)}};vo.prototype.clear=function(){var o=this._viewer;this.MilitaryStandardObj.forEach(f=>{f instanceof Array?f.forEach(function(m){o.entities.removeById(m)}):o.entities.removeById(f)}),this.MilitaryStandardObj=[],window.layuiLayer.close(SmartEarthPopupData.layerIndex),!this.MilitaryStandardObj.length&&this.editHandler&&this.edit(!1)};vo.prototype.removeCollection=function(o){if(!o)return;let f=this._viewer,m=this,v=[],y=function(w){let A=[];return w.values&&Array.isArray(w.values)&&w.values.forEach(E=>{for(let T=0;T<m.MilitaryStandardObj.length;T++){let S=m.MilitaryStandardObj[T];if(S instanceof Array&&S.indexOf(E._id)!==-1){m.MilitaryStandardObj.splice(T,1);break}}A.push(E._id),f.entities.removeById(E._id)}),A},x=function(w){let A=""+w.id,E=m.MilitaryStandardObj.indexOf(w.id);if(E!==-1)m.MilitaryStandardObj.splice(E,1);else for(let T=0;T<m.MilitaryStandardObj.length;T++){let S=m.MilitaryStandardObj[T];if(S instanceof Array&&S.indexOf(w.id)!==-1){m.MilitaryStandardObj.splice(T,1);break}}return f.entities.removeById(w.id),A},C=function(w){return w.values&&w._entities?y(w):x(w)};return Array.isArray(o)?o.forEach(w=>{if(Array.isArray(w)){let A=[];w.forEach(E=>{let T=C(E);A.push(T)}),v.push(A)}else{let A=C(w);v.push(A)}}):v=C(o),v};vo.prototype.getColor=function(o){return{color:this.colorHex("rgb("+o.red*255+","+o.green*255+","+o.blue*255+")"),alpha:o.alpha}};vo.prototype.getFeature=function(o){let f=o.id;if(D8(o.GeoType))for(let y=0;y<this.MilitaryStandardObj.length;y++){let x=this.MilitaryStandardObj[y];if(x instanceof Array&&x.indexOf(f)!==-1){f=x.join(",");break}}let m={id:f,type:o.GeoType,name:o.name,editType:""},v=o.pottingPoint;return o.polyline?(m.editType="GroundPolyline",m.geometry={type:"polyline",coordinates:v},m.style={fillColor:this.getColor(o.polyline.material.color._value),width:o.polyline.width.getValue()}):(m.editType="GroundPolygon",m.geometry={type:"polygon",coordinates:v},m.style={fillColor:this.getColor(o.polygon.material.color._value)},o.polygon.extrudedHeight&&(m.editType="ExtrudedPolygon",m.style.height=o.polygon.height.getValue(),m.style.extrudedHeight=o.polygon.extrudedHeight.getValue()-o.polygon.height.getValue(),o.polygon.outline&&(m.style.outline=o.polygon.outline.getValue()),o.polygon.outlineColor&&(m.style.outlineColor=this.getColor(o.polygon.outlineColor._value)))),m};vo.prototype.save=function(o="\u519B\u6807",f=!1,m){var v=this._viewer,y={type:"FeatureCollection",features:[]},x;if(m?Array.isArray(m)?m.forEach(A=>{x=this.getFeature(A),y.features.push(x)}):(x=this.getFeature(m),y.features.push(x)):this.MilitaryStandardObj.forEach(A=>{let E=null;if(A instanceof Array)for(let T=0;T<A.length;T++){let S=A[T];E=v.entities.getById(S);break}else E=v.entities.getById(A);Array.isArray(A)?(E=v.entities.getById(A[0]),x=this.getFeature(E),y.features.push(x)):E&&(x=this.getFeature(E),y.features.push(x))}),f)return y;var C=JSON.stringify(y),w=new Blob([C],{type:"text/plain;charset=utf-8"});this._core.saveAs(w,o+".json")};vo.prototype.colorHex=function(o){var f=o,m=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/;if(/^(rgb|RGB)/.test(f)){var v=f.replace(/(rgb|RGB)*/g,"");v=v.replace("(","").replace(")","");for(var y=v.split(","),x="#",C=0;C<y.length;C++){var w=Number(y[C]).toString(16);w=w.length===1?0+""+w:w,w==="0"&&(w+=w),x+=w}return x.length!==7&&(x=f),x}else if(m.test(f)){var A=f.replace(/#/,"").split("");if(A.length===6)return f;if(A.length===3){for(var E="#",C=0;C<A.length;C+=1)E+=A[C]+A[C];return E}}else return f};vo.prototype.copyJb=function(o){var f;if(o.type=="StraightArrow"||o.type=="SwallowtailArrow"||o.type=="PincerArrow"){var m={holes:[],positions:this.szposis(o.pos)};f=this._viewer.entities.add({name:"StraightArrow",polygon:{hierarchy:m,material:je.Color.RED.withAlpha(.5)}})}else o.type=="BezierArrow"?f=this._viewer.entities.add({name:"BezierArrow",polyline:{positions:this.szposis(o.pos),width:5,clampToGround:!0,material:new je.PolylineArrowMaterialProperty(je.Color.RED)}}):o.img?f=this._viewer.entities.add({position:this.zfsz(o.pos),billboard:{image:o.img,show:!0}}):o.text&&(f=this._viewer.entities.add({position:this.zfsz(o.pos),label:{text:o.text,horizontalOrigin:je.HorizontalOrigin.CENTER,verticalOrigin:je.VerticalOrigin.CENTER,show:!0,showBackground:!1}}));return f._id=o.id,that.objectsToExclude.push(f),f};vo.prototype.getEntityById=function(o){var f=this._viewer.entities.getById(o),m;return f.polyline!=null&&f.polyline?m={obj:f.polyline,type:f.name,posion:f.polyline.positions.getValue()}:f.polygon!=null&&f.polygon?m={obj:f.polygon,type:f.name,posion:f.polygon.hierarchy.getValue().positions}:f.label!=null&&f.label?m={obj:f.label,type:"lable",text:f.label.text.getValue(),posion:f.position.getValue()}:f.billboard!=null&&f.billboard&&(m={obj:f.billboard,type:"img",img:f.billboard.image.getValue(),posion:f.position.getValue()}),m};vo.prototype.szposis=function(o){for(var f=[],m=o.split(",("),v=0;v<m.length;v++){var y=this.zfsz(m[v]);f.push(y)}return f};vo.prototype.zfsz=function(o){for(var f,m=o.split(","),v=0;v<m.length;v++)(m[v].indexOf("(")!=-1||m[v].indexOf(")")!=-1)&&(m[v]=m[v].replace("(",""));return f={x:parseFloat(m[0]),y:parseFloat(m[1]),z:parseFloat(m[2])},f};vo.prototype.showArrowOnMap=function(o,f,m){var v=this,y=v._viewer.scene.globe.ellipsoid.cartesianToCartographic(o[0]),x=y.height,C=function(){if(o.length<3)return null;for(var A=[],E=0;E<o.length;E++){var T=v._viewer.scene.globe.ellipsoid.cartesianToCartographic(o[E]),S=je.Math.toDegrees(T.latitude),M=je.Math.toDegrees(T.longitude);A.push([M,S])}var I=VD.algorithm.doubleArrow(A),P=[],D=JSON.stringify(I.polygonalPoint).indexOf("null");return D==-1&&(P=I.polygonalPoint),new je.PolygonHierarchy(P)},w;return f=="polygon"?w=v._viewer.entities.add({name:"PincerArrow",polygon:new je.PolygonGraphics({hierarchy:new je.CallbackProperty(C,!1),show:!0,fill:!0,material:je.Color.fromCssColorString(v._core.defaultValue(m.color,"rgba(255,0,0,0.6)")),outline:v._core.defaultValue(m.outline,!0),outlineColor:je.Color.fromCssColorString(v._core.defaultValue(m.outlineColor,"rgba(255,0,0,0.6)"))})}):f=="box"&&(w=v._viewer.entities.add({name:"PincerArrow",polygon:new je.PolygonGraphics({hierarchy:new je.CallbackProperty(C,!1),show:!0,fill:!0,material:je.Color.fromCssColorString(v._core.defaultValue(m.color,"rgba(255,0,0,0.6)")),outline:v._core.defaultValue(m.outline,!0),outlineColor:je.Color.fromCssColorString(v._core.defaultValue(m.outlineColor,"rgba(255,0,0,0.6)")),extrudedHeight:x+v._core.defaultValue(m.extrudedHeight,200),height:x})})),w};vo.prototype.showAttackArrowOnMap=function(o,f,m){var v=this,y=v._viewer.scene.globe.ellipsoid.cartesianToCartographic(o[0]),x=y.height,C=function(){if(o.length<3)return null;for(var w=[],A=0;A<o.length;A++){var E=v.cartesianToLatlng(o[A]);w.push(E)}var T=VD.algorithm.tailedAttackArrow(w),S=JSON.stringify(T.polygonalPoint).indexOf("null"),M=[];return S==-1&&(M=T.polygonalPoint),new je.PolygonHierarchy(M)};return this._viewer.entities.add({name:"AttackArrow",polygon:new je.PolygonGraphics({hierarchy:new je.CallbackProperty(C,!1),show:!0,fill:!0,classificationType:je.ClassificationType.TERRAIN,extrudedHeight:f==="box"?v._core.defaultValue(m.extrudedHeight,200)+x:void 0,height:f==="box"?x:void 0,material:je.Color.fromCssColorString(v._core.defaultValue(m.color,"rgba(255,0,0,0.6)")),outline:v._core.defaultValue(m.outline,!0),outlineColor:je.Color.fromCssColorString(v._core.defaultValue(m.outlineColor,"rgba(255,0,0,0.6)"))})})};vo.prototype.cartesianToLatlng=function(o){var f=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=je.Math.toDegrees(f.latitude),v=je.Math.toDegrees(f.longitude);return[v,m]};vo.prototype.getCatesian3FromPX=function(o,f){var m=this._viewer.scene.drillPick(o);this._viewer.render();for(var v,y=!0,x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof je.Cesium3DTileFeature)&&(y=!0);if(y)v=this._viewer.scene.pickPosition(o);else{var C=this._viewer.camera.getPickRay(o);if(!C)return null;v=this._viewer.scene.globe.pick(C,this._viewer.scene)}return v};vo.prototype._createGeoPoints=function(o,f){for(var m=[],v,y,x,C,w,A,E,T,S=0;S<f.length;S++)v=o.camera.getPickRay(f[S]),v&&(y=o.scene.globe.pick(v,o.scene)),y&&(C=je.Cartographic.fromCartesian(y),w=je.Math.toDegrees(C.longitude),A=je.Math.toDegrees(C.latitude),E=C.height,m.push(w,A,E));return m};vo.prototype._createScreenPoints=function(o,f){for(var m=[],v,y=0;y<f.length;y++)v=o.scene.cartesianToCanvasCoordinates(f[y]),m.push(v);return m};vo.prototype._createBezierPoints=function(o){for(var f=100,m=[],v=0;v<=f;v++){var y=this._computeBezierPoints(o,v/f);m.push(y)}return m};vo.prototype._computeBezierPoints=function(o,f){for(var m=0,v=0,y=0,x=this._computeBinomial(o),C=0;C<o.length;C++){var w=o[C];m+=w.x*Math.pow(1-f,o.length-1-C)*Math.pow(f,C)*x[C],v+=w.y*Math.pow(1-f,o.length-1-C)*Math.pow(f,C)*x[C]}return{x:m,y:v}};vo.prototype._computeBinomial=function(o){var f=o.length,m=[];m.push(1);for(var v=1;v<f-1;v++){for(var y=1,x=1,C=0;C<v;C++)y=y*(f-1-C),x=x*(v-C);m.push(y/x)}return m.push(1),m};vo.prototype._computeGatheringPlacePoints=function(o){var f=[];if(o.length==2){var m=o[0],v=o[o.length-1],y={x:v.x-m.x,y:v.y-m.y},x=Math.sqrt(y.x*y.x+y.y*y.y),C=this.calculateVector(y,Math.PI/3,Math.sqrt(3)/12*x),w=C[1],A={x:m.x+w.x,y:m.y+w.y},E={x:(m.x+v.x)/2,y:(m.y+v.y)/2},T=this.calculateVector(y,Math.PI*2/3,Math.sqrt(3)/12*x),S=T[1],M={x:v.x+S.x,y:v.y+S.y},I=this.calculateVector(y,Math.PI/2,1/2*x),P=I[0],D={x:P.x+E.x,y:P.y+E.y},L=m,R=v;f.push(L,A,E,M,R,D)}return f};vo.prototype.createCloseCardinal=function(o){if(o==null||o.length<3)return o;var f=o[0];o.push(f);for(var m=o,v=[],y=.4,x=.5,C=.005,w=m.length-1,A=0;A<=w-1;A++){if(A==w-1)var E=m[w-1],T=m[0],S=m[1];else var E=m[A],T=m[A+1],S=m[A+2];var M={x:void 0,y:void 0},I={x:void 0,y:void 0},P={x:T.x-E.x,y:T.y-E.y},D={x:S.x-T.x,y:S.y-T.y},L=Math.sqrt(P.x*P.x+P.y*P.y),R=Math.sqrt(D.x*D.x+D.y*D.y),O={x:P.x/L,y:P.y/L},F={x:D.x/R,y:D.y/R},k={x:O.x+F.x,y:O.y+F.y},U=Math.sqrt(k.x*k.x+k.y*k.y),G={x:k.x/U,y:k.y/U},j=(O.x*F.x+O.y*F.y)/1;Math.abs(1-j)<C?(M.x=T.x-F.x*L*y,M.y=T.y-F.y*L*y,I.x=T.x+O.x*R*y,I.y=T.y+O.y*R*y):(M.x=T.x-G.x*L*y,M.y=T.y-G.y*L*y,I.x=T.x+G.x*R*y,I.y=T.y+G.y*R*y),A==w-1?(v[0]=T,v[1]=I,v[(w-2)*3+2+3]=M,v[(w-2)*3+2+4]=m[w]):(v[A*3+2+0]=M,v[A*3+2+1]=T,v[A*3+2+2]=I)}return v};vo.prototype.calculatePointsFBZ3=function(o,f){f||(f=20);var m=[],v=.05;f>0&&(v=1/f);for(var y=0;y<o.length-3;){var x=o[y],C=o[y+1],w=o[y+2],A=o[y+3];m.push(x);for(var E=0;E<1;){var T=(1-E)*(1-E)*(1-E)*x.x+3*E*(1-E)*(1-E)*C.x+3*E*E*(1-E)*w.x+E*E*E*A.x,S=(1-E)*(1-E)*(1-E)*x.y+3*E*(1-E)*(1-E)*C.y+3*E*E*(1-E)*w.y+E*E*E*A.y,M={x:T,y:S};m.push(M),E+=v}y+=3,y>=o.length&&m.push(x)}var I=m[m.length-1],P=o[o.length-1];return m};vo.prototype.calculateVector=function(o,f,m){f||(f=Math.PI/2),m||(m=1);var v,y,x,C,w,A,E=Math.sqrt(o.x*o.x+o.y*o.y);if(o.y==0)v=y=E*m*Math.cos(f)/o.x,o.x>0?(x=Math.sqrt(m*m-v*v),C=-x):o.x<0&&(C=Math.sqrt(m*m-v*v),x=-C),w={x:v,y:x},A={x:y,y:C};else{var T=-o.x/o.y,S=m*E*Math.cos(f)/o.y,M=1+T*T,I=2*T*S,P=S*S-m*m;v=(-I-Math.sqrt(I*I-4*M*P))/(2*M),y=(-I+Math.sqrt(I*I-4*M*P))/(2*M),x=T*v+S,C=T*y+S,o.y>=0?(w={x:v,y:x},A={x:y,y:C}):o.y<0&&(w={x:y,y:C},A={x:v,y:x})}return[w,A]};vo.prototype.plotingSwallowtailArrow=function(o,f,m,v){var y=this._computeSwallowtailArrow(f),x=[];y.forEach(w=>{x.push(w.x,w.y,f[0].z)});var C;return m=="polygon"?C=o.entities.add({name:"SwallowtailArrow",polygon:{hierarchy:je.Cartesian3.fromDegreesArrayHeights(x),material:je.Color.fromCssColorString(this._core.defaultValue(v.color,"rgba(255,0,0,0.6)"))}}):m=="box"&&(C=o.entities.add({name:"SwallowtailArrow",polygon:{hierarchy:je.Cartesian3.fromDegreesArrayHeights(x),material:je.Color.fromCssColorString(this._core.defaultValue(v.color,"rgba(255,0,0,0.6)")),extrudedHeight:x[2]+this._core.defaultValue(v.extrudedHeight,200),height:x[2],outline:this._core.defaultValue(v.outline,!0),outlineColor:je.Color.fromCssColorString(this._core.defaultValue(v.outlineColor,"rgba(255,0,0,0.6)"))}})),C};vo.prototype._computeSwallowtailArrow=function(o){var f=o[0].x,m=o[0].y,v=o[1].x,y=o[1].y,x=(15.8*v+3.2*f)/19,C=(15.8*y+3.2*m)/19,w=new Array(7);return w[0]={x:v,y},w[1]={x:x+.85/3.2*(y-C),y:C-.85/3.2*(v-x)},w[2]={x:x+.25/3.2*(y-C),y:C-.25/3.2*(v-x)},w[3]={x:f+1.6/19*(y-m),y:m-1.6/19*(v-f)},w[4]={x:(3.2*v+15.8*f)/19,y:(3.2*y+15.8*m)/19},w[5]={x:f-1.6/19*(y-m),y:m+1.6/19*(v-f)},w[6]={x:x-.25/3.2*(y-C),y:C+.25/3.2*(v-x)},w[7]={x:x-.85/3.2*(y-C),y:C+.85/3.2*(v-x)},w};vo.prototype.calculateMorePoints=function(o){var f=6,m;if(o.length>2){for(var v=0,y,x,C,w=0;w<o.length-1;w++)x=o[w],C=o[w+1],v+=Math.sqrt((C.y-x.y)*(C.y-x.y)+(C.x-x.x)*(C.x-x.x));y=v/f;for(var A=[],E=[],T={x:void 0,y:void 0},S={x:void 0,y:void 0},M=0;M<o.length-2;M++){var I=o[M],P=o[M+1],D=o[M+2],L={x:P.x-I.x,y:P.y-I.y},R={x:D.x-P.x,y:D.y-P.y},O=this.calculateVector(L,Math.PI/2,y/2),F=O[0],k=O[1],U=this.calculateVector(R,Math.PI/2,y/2),G=U[0],j=U[1],q={x:I.x+F.x,y:I.y+F.y},J={x:I.x+k.x,y:I.y+k.y},X={x:P.x+G.x,y:P.y+G.y},Y={x:P.x+j.x,y:P.y+j.y},Q=this.calculateIntersection(L,R,q,X),ee=this.calculateIntersection(L,R,J,Y),z,ie;if(M==0)T=q,S=J,z={x:(T.x+Q.x)/2,y:(T.y+Q.y)/2},ie={x:(S.x+ee.x)/2,y:(S.y+ee.y)/2},A.push(z),E.push(ie);else{var re=A[A.length-1],ne=E[E.length-1];z={x:(re.x+Q.x)/2,y:(re.y+Q.y)/2},ie={x:(ne.x+ee.x)/2,y:(ne.y+ee.y)/2},A.push(z),E.push(ie)}A.push(Q),E.push(ee)}var oe=o[o.length-2],se=o[o.length-1],ae={x:se.x-oe.x,y:se.y-oe.y},fe=Math.sqrt(ae.x*ae.x+ae.y*ae.y),de,ve,pe=[],ce={x:void 0,y:void 0},he={x:void 0,y:void 0},Ce={x:void 0,y:void 0},Se={x:void 0,y:void 0},De={x:void 0,y:void 0},Oe={x:void 0,y:void 0},Ue=A[A.length-1],Xe=E[E.length-1];if(fe<=y)pe=this.calculateVector(ae,Math.PI/2,y/2),ce=pe[0],he=pe[1],de={x:oe.x+ce.x,y:oe.y+ce.y},ve={x:oe.x+he.x,y:oe.y+he.y},Ce={x:(Ue.x+de.x)/2,y:(Ue.y+de.y)/2},Se={x:(Xe.x+ve.x)/2,y:(Xe.y+ve.y)/2},A.push(Ce),E.push(Se),De={x:2*de.x-oe.x,y:2*de.y-oe.y},Oe={x:2*ve.x-oe.x,y:2*ve.y-oe.y};else{var it={x:se.x-oe.x,y:se.y-oe.y},ut=Math.sqrt(it.x*it.x+it.y*it.y),at={x:se.x-it.x*y/ut,y:se.y-it.y*y/ut};pe=this.calculateVector(ae,Math.PI/2,y/2),ce=pe[0],he=pe[1],de={x:at.x+ce.x,y:at.y+ce.y},ve={x:at.x+he.x,y:at.y+he.y},Ce={x:(Ue.x+de.x)/2,y:(Ue.y+de.y)/2},Se={x:(Xe.x+ve.x)/2,y:(Xe.y+ve.y)/2},A.push(Ce),E.push(Se),De={x:2*de.x-at.x,y:2*de.y-at.y},Oe={x:2*ve.x-at.x,y:2*ve.y-at.y}}for(var Pt=[],Qe=[],w=0;w<A.length-2;w++){var ft=[],Ot=[],Xt=A[w],At=A[w+1],bt=A[w+2],gt=E[w],It=E[w+1],Jt=E[w+2];ft.push(Xt,At,bt),Ot.push(gt,It,Jt);var bi=this._createBezierPoints(ft),Yi=this._createBezierPoints(Ot);Pt=Pt.concat(bi),Qe=Qe.concat(Yi)}m=[T],m=m.concat(Pt),m.push(de),m.push(De),m.push(se),m.push(Oe),m.push(ve),m=m.concat(Qe.reverse()),m.push(S)}else m=this.calculateTwoPoints(o);return m};vo.prototype.calculateIntersection=function(o,f,m,v){var y,x;return o.y*f.x-o.x*f.y==0?o.x*f.x>0||o.y*f.y>0?(y=(m.x+v.x)/2,x=(m.y+v.y)/2):(y=v.x,x=v.y):(y=(o.x*f.x*(v.y-m.y)+m.x*o.y*f.x-v.x*f.y*o.x)/(o.y*f.x-o.x*f.y),o.x!=0?x=(y-m.x)*o.y/o.x+m.y:x=(y-v.x)*f.y/f.x+v.y),{x:y,y:x}};vo.prototype.calculateTwoPoints=function(o){var f=6,m=o[0],v=o[1],y=[],x={x:v.x-m.x,y:v.y-m.y},C=Math.sqrt((v.x-m.x)*(v.x-m.x)+(v.y-m.y)*(v.y-m.y)),w=C/f,A=m.x+5*(v.x-m.x)/f,E=m.y+5*(v.y-m.y)/f,T=this.calculateVector(x,Math.PI/2,w/2),S=T[0],M=T[1],I={x:m.x+S.x,y:m.y+S.y},P={x:A+S.x,y:E+S.y},D={x:A+2*S.x,y:E+2*S.y},L={x:v.x,y:v.y},R={x:A+2*M.x,y:E+2*M.y},O={x:A+M.x,y:E+M.y},F={x:m.x+M.x,y:m.y+M.y};return y.push(I,P,D,L,R,O,F),y};vo.prototype._computeRoundedRectanglePoints=function(o){for(var f=(o[0].x+o[1].x)/2,m=(o[0].y+o[1].y)/2,v={x:f,y:m},y=Math.abs(o[0].x-o[1].x),x=Math.abs(o[0].y-o[1].y),C=1/10*Math.min(y,x),w=f-y/2+C,A=m-x/2+C,E={x:w,y:A},T={x:f+y/2-C,y:m-x/2+C},S={x:f+y/2-C,y:m+x/2-C},M={x:f-y/2+C,y:m+x/2-C},I=Math.PI/180,P=[],D=Math.PI,L=3/2*Math.PI,R=D,O=0;O<Math.abs(D-L);O+=I){var F=E.x+C*Math.cos(R),k=E.y+C*Math.sin(R);R=R+I,R=R<0?2*Math.PI+R:R,R=R>2*Math.PI?2*Math.PI-R:R,P.push({x:F,y:k})}for(var U=P,G=Math.PI*3/2,j=2*Math.PI,q=G,O=0;O<Math.abs(G-j);O+=I){var F=T.x+C*Math.cos(q),k=T.y+C*Math.sin(q);q=q+I,q=q<0?2*Math.PI+q:q,q=q>2*Math.PI?2*Math.PI-q:q,U.push({x:F,y:k})}for(var J=U,X=0,Y=1/2*Math.PI,Q=X,O=0;O<Math.abs(X-Y);O+=I){var F=S.x+C*Math.cos(Q),k=S.y+C*Math.sin(Q);Q=Q+I,Q=Q<0?2*Math.PI+Q:Q,Q=Q>2*Math.PI?2*Math.PI-Q:Q,J.push({x:F,y:k})}for(var ee=J,z=1/2*Math.PI,ie=Math.PI,re=z,O=0;O<Math.abs(z-ie);O+=I){var F=M.x+C*Math.cos(re),k=M.y+C*Math.sin(re);re=re+I,re=re<0?2*Math.PI+re:re,re=re>2*Math.PI?2*Math.PI-re:re,ee.push({x:F,y:k})}return ee};vo.prototype._computeSectorPoints=function(o){var f=this.calculateAngle(o[0],o[1]),m=this.calculateAngle(o[0],o[2]);f>m&&(m=2*Math.PI+m);for(var v=Math.PI/180,y=f,x=[o[0]],C=Math.sqrt((o[1].x-o[0].x)*(o[1].x-o[0].x)+(o[1].y-o[0].y)*(o[1].y-o[0].y)),w=0;w<Math.abs(f-m);w+=v){var A=o[0].x+C*Math.cos(y),E=o[0].y+C*Math.sin(y);y=y+v,y=y<0?2*Math.PI+y:y,y=y>2*Math.PI?y-2*Math.PI:y,x.push({x:A,y:E})}return x};vo.prototype.calculateAngle=function(o,f){var m={x:f.x-o.x,y:f.y-o.y},v=Math.atan2(m.y,m.x);return v<0&&(v=v+2*Math.PI),v};vo.prototype._computeBowPoints=function(o){var f=2*(o[1].x-o[0].x),m=2*(o[1].y-o[0].y),v=o[1].x*o[1].x+o[1].y*o[1].y-o[0].x*o[0].x-o[0].y*o[0].y,y=2*(o[2].x-o[1].x),x=2*(o[2].y-o[1].y),C=o[2].x*o[2].x+o[2].y*o[2].y-o[1].x*o[1].x-o[1].y*o[1].y,w=(v*x-C*m)/(f*x-y*m),A=(f*C-y*v)/(f*x-y*m),E={x:w,y:A},T=Math.sqrt((o[0].x-w)*(o[0].x-w)+(o[0].y-A)*(o[0].y-A)),S=this.calculateAngle(E,o[0]),M=this.calculateAngle(E,o[1]),I=this.calculateAngle(E,o[2]),P=Math.PI/180,D=void 0,L=[];if(S<I&&I<M||M<I&&I<S){D=S<M?S:M;for(var R=0;R<Math.abs(S-M);R+=P){var O=w+T*Math.cos(D),F=A+T*Math.sin(D);D=D+P,D=D<0?2*Math.PI+D:D,D=D>2*Math.PI?2*Math.PI-D:D,L.push({x:O,y:F})}}else{D=S>M?S:M;for(var R=0;R<2*Math.PI-Math.abs(S-M);R+=P){var O=w+T*Math.cos(D),F=A+T*Math.sin(D);D=D+P,D=D<0?2*Math.PI+D:D,D=D>2*Math.PI?D-2*Math.PI:D,L.push({x:O,y:F})}}return L};vo.prototype.Cdcl=function(o,f,m,v){var y=0,x=6378137,C=Math.PI;function w(j){return j*C/180}var A=w((o+m)/2),E=w((o-m)/2),T=w((f-v)/2),S=Math.sin(E),M=Math.sin(T),I=Math.sin(A),P,D,L,R,O,F,k,U=x,G=1/298.257;return S=S*S,M=M*M,I=I*I,P=S*(1-M)+(1-I)*M,D=(1-S)*(1-M)+I*M,L=Math.atan(Math.sqrt(P/D)),R=Math.sqrt(P*D)/L,O=2*L*U,F=(3*R-1)/2/D,k=(3*R+1)/2/P,y=O*(1+G*(F*I*(1-S)-k*(1-I)*S)),y};vo.prototype.createPoint=function(o,f){if(!!o)return this._viewer.entities.add({position:o,point:{pixelSize:10,color:je.Color.ROYALBLUE,outlineWidth:2,outlineColor:je.Color.WHITE,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:f})};vo.prototype.setEdit=function(o,f){o===void 0&&(o=!0),this.openEdit=o,f&&(this.editOption=f),this.defaultEdit()};vo.prototype.openEditProp=function(o,f){var m=this;f||(f=this.editOption||{editPropData:{}}),!((!SmartEarthPopupData.editGraphic||!SmartEarthPopupData.editGraphic.entity)&&!this.startEdit(o))&&(!f.editPropData&&(f.editPropData={}),this._popupmessage.createPopupProp("\u5C5E\u6027\u7F16\u8F91",{width:f.editPropData.width||360,height:f.editPropData.height||"90%",url:"Workers/prop/jb_prop.html",shade:f.editPropData.shade,offset:f.editPropData.offset,type:o.polyline?"GroundPolyline":m.heightpoints.length>0?"ExtrudedPolygon":"GroundPolygon",fn:{success:function(v,y){f.editPropData.success&&f.editPropData.success(v,y),SmartEarthPopupData.layerIndex=y,SmartEarthPopupData.window=v.find("iframe")[0].contentWindow},end:function(){f.callBack&&f.callBack.end&&f.callBack.end(o),m.endThisEdit&&m.endThisEdit(),SmartEarthPopupData.layerIndex=void 0,SmartEarthPopupData.window=void 0}}}))};vo.prototype.defaultEdit=function(){this.openEdit?this.MilitaryStandardObj.length&&!this.editHandler?this.edit(this.openEdit,this.editOption):!this.MilitaryStandardObj.length&&this.editHandler&&this.edit(!1):this.editHandler&&this.edit(!1)};vo.prototype.startEdit=function(o){var f=this,m=this._viewer;if(f.MilitaryStandardObj.indexOf(o.id)===-1){var v=!1;for(let O=0;O<f.MilitaryStandardObj.length;O++){let F=f.MilitaryStandardObj[O];if(F instanceof Array&&F.indexOf(o.id)!==-1){v=!0;break}}if(!v)return}let y=o;var x=y.pottingPoint;if(!!x){this.isEditting=!0;var C=x,w={x:0,y:0,z:0};for(var A in C){var E=C[A];w.x+=E[0],w.y+=E[1],w.z+=E[2];var T=je.Cartesian3.fromDegreesArrayHeights(E),S=m.entities.add({name:"polygon_point",position:T[0],point:{pixelSize:10,color:je.Color.ROYALBLUE,outlineWidth:2,outlineColor:je.Color.WHITE.withAlpha(.6),disableDepthTestDistance:Number.POSITIVE_INFINITY}});S.pottingPoint=E,Ne.pointsId.push(S.id),f.objectsToExclude.push(S);var M;if(y.polygon&&y.polygon.extrudedHeight){if(T.x)var I=je.Cartographic.fromCartesian(T);else var I=je.Cartographic.fromCartesian(T[0]);var P=je.Math.toDegrees(I.longitude),D=je.Math.toDegrees(I.latitude),L=y.polygon.extrudedHeight.getValue(),R=je.Cartesian3.fromDegrees(P,D,L);M=m.entities.add({name:"box_point",position:R,point:{color:je.Color.YELLOW,pixelSize:12,outlineColor:je.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),M.pottingPoint=E,M.pointid=S.id,f.objectsToExclude.push(M),f.heightpoints.push(M),f.heightpointsId.push(M.id)}}return w.x/=C.length,w.y/=C.length,w.z/=C.length,f.movePoint=m.entities.add({name:"move_point",position:je.Cartesian3.fromDegrees(w.x,w.y,w.z),point:{color:je.Color.PURPLE,pixelSize:10,outlineColor:je.Color.WHITE.withAlpha(.6),outlineWidth:2,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),SmartEarthPopupData.editGraphic={entity:y,graphic:y.polygon||y.polyline,heightpoints:f.heightpoints},!0}};vo.prototype.edit=function(o,f){var m=this,v=this._viewer;if(!f&&(f=this.editOption||{}),f.editProp!==void 0&&(this.editProp=f.editProp),this.editHandler){this.editHandler.destroy(),this.editHandler=void 0;for(var y in Ne.pointsId)this._viewer.entities.removeById(Ne.pointsId[y]);Ne.pointsId=[]}if(o===void 0&&(o=!0),!!o){var x=void 0;this.isEditting=!1;var C=void 0,w,A=void 0;this.editHandler=new je.ScreenSpaceEventHandler(v.scene.canvas),this.editHandler.setInputAction(E=>{if(je.ExpandBySmartEarth&&(je.ExpandBySmartEarth.underEarth.enable||je.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}if(!Ne.editVector){var T=E.position,S=v.scene.pick(T);if(S&&S.id instanceof je.Entity){var M=S.id;if(!m.isEditting&&Ne.states==0){if(!this.startEdit(M))return;x=M,this.editProp&&this.openEditProp(x,f)}else if(M.name=="box_point"||M.name=="polygon_point"||M.name=="move_point"){if(m.defaultEvent(!1),M.name=="box_point"){A=M.position.getValue();let I=je.Cartographic.fromCartesian(A);A={lon:je.Math.toDegrees(I.longitude),lat:je.Math.toDegrees(I.latitude),height:I.height},w="box_point"}else M.name=="move_point"?w="move_point":w="polygon_point";C=M}else{if(x&&M.id===x.id)return;m.endThisEdit()}}else m.endThisEdit()}},je.ScreenSpaceEventType.LEFT_DOWN),this.editHandler.setInputAction(function(E){if(je.ExpandBySmartEarth&&(je.ExpandBySmartEarth.underEarth.enable||je.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}if(Ne.editVector)return;let T=v.scene.pick(E.endPosition);if(je.defined(T)){if(m.isEditting&&!C){if(je.ExpandBySmartEarth&&(je.ExpandBySmartEarth.underEarth.enable||je.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}T.id&&(T.id.name==="move_point"||T.id.name==="polygon_point")?m.tooltip.showAt(E.endPosition,"\u62D6\u62FD\u4FEE\u6539\u4F4D\u7F6E"):T.id&&T.id.name==="box_point"?m.tooltip.showAt(E.endPosition,"\u62D6\u62FD\u4FEE\u6539\u9AD8\u5EA6"):T.id==x&&m.tooltip.show(!1)}else if(!m.isEditting&&Ne.states===0)if(T.id)if(m.MilitaryStandardObj.indexOf(T.id.id)>-1)m.tooltip.showAt(E.endPosition,"\u70B9\u51FB\u6FC0\u6D3B\u7F16\u8F91\uFF0C\u53F3\u952E\u5220\u9664");else{let pe=!1;for(let ce=0;ce<m.MilitaryStandardObj.length;ce++){let he=m.MilitaryStandardObj[ce];if(he instanceof Array&&he.indexOf(T.id.id)!==-1){pe=!0;break}}pe?m.tooltip.showAt(E.endPosition,"\u70B9\u51FB\u6FC0\u6D3B\u7F16\u8F91\uFF0C\u53F3\u952E\u5220\u9664"):m.tooltip.show(!1)}else m.tooltip.show(!1)}else Ne.states==0&&!C&&m.tooltip.show(!1);if(m.isEditting&&C){m.tooltip.showAt(E.endPosition,"\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539");var S=E.startPosition,M,I=v.camera.getPickRay(S);if(I&&(M=v.scene.globe.pick(I,v.scene)),!M)return;var P=void 0;if(w=="polygon_point"){C.position=M;for(var D in Ne.pointsId)if(Ne.pointsId[D]==C.id){var L=v.entities.getById(m.heightpointsId[D]);if(!L)break;var R=je.Cartographic.fromCartesian(M),O=je.Math.toDegrees(R.longitude),F=je.Math.toDegrees(R.latitude),k=je.Cartographic.fromCartesian(L.position._value),U=R.height+k.height;L.position=je.Cartesian3.fromDegrees(O,F,U)}var G=[],j=[],q=new je.Cartesian3;for(var D in Ne.pointsId){let ce=v.entities.getById(Ne.pointsId[D]).position._value,he=je.Cartographic.fromCartesian(ce),Ce={x:je.Math.toDegrees(he.longitude),y:je.Math.toDegrees(he.latitude),z:he.height};G.push(Ce),j.push([Ce.x,Ce.y,Ce.z]),q.x+=ce.x,q.y+=ce.y,q.z+=ce.z}q.x/=G.length,q.y/=G.length,q.z/=G.length,m.movePoint&&(m.movePoint.position=q);var J;if(x.GeoType=="StraightArrow")J=m.calculateMorePoints(G);else if(x.GeoType=="RoundedRectangle")J=m._computeRoundedRectanglePoints(G);else if(x.GeoType=="Sector")J=m._computeSectorPoints(G);else if(x.GeoType=="Bow")J=m._computeBowPoints(G);else if(x.GeoType=="GatheringPlace"){let pe=m._computeGatheringPlacePoints(G),ce=m.createCloseCardinal(pe);J=m.calculatePointsFBZ3(ce,100)}else if(x.GeoType=="SwallowtailArrow")J=m._computeSwallowtailArrow(G);else if(x.GeoType=="Bezierline")J=m._createBezierPoints(G);else if(x.GeoType=="BezierArrow")J=m._createBezierPoints(G);else if(x.GeoType=="PincerArrow"){let pe=VD.algorithm.doubleArrow(j),ce=[];JSON.stringify(pe.polygonalPoint).indexOf("null")==-1&&(ce=pe.polygonalPoint),J=ce}else if(x.GeoType=="AttackArrow"){let pe=VD.algorithm.tailedAttackArrow(j),ce=JSON.stringify(pe.polygonalPoint).indexOf("null"),he=[];ce==-1&&(he=pe.polygonalPoint),J=he}else x.GeoType=="DemarcationLine"&&(J=G);if(D8(x.GeoType))return;let ve;x.GeoType!=="AttackArrow"&&x.GeoType!=="PincerArrow"?(ve=[],J.forEach(pe=>{ve.push(pe.x,pe.y,G[0].z)}),ve=je.Cartesian3.fromDegreesArrayHeights(ve)):ve=J,x.pottingPoint=j,x.GeoType.indexOf("Bezier")>=0?x.polyline.positions=new je.CallbackProperty(function(){return ve},!1):x.polygon.hierarchy=new je.CallbackProperty(function(){return new je.PolygonHierarchy(ve)},!1)}else if(w=="box_point"){var I=v.camera.getPickRay(E.endPosition),M=v.scene.globe.pick(I,v.scene),X=je.Cartographic.fromCartesian(M),Y=je.Math.toDegrees(X.longitude),Q=je.Math.toDegrees(X.latitude),ee=A.lon,z=A.lat,U=m.Cdcl(Q,Y,z,ee);P=U;for(let he in m.heightpointsId){var ie=v.entities.getById(m.heightpointsId[he]),re=ie.position._value,ne=je.Cartographic.fromCartesian(re),oe=je.Math.toDegrees(ne.longitude),se=je.Math.toDegrees(ne.latitude),ae=je.Cartesian3.fromDegrees(oe,se,P);ie.position=ae}x.polygon.extrudedHeight=new je.CallbackProperty(function(){return P},!1),SmartEarthPopupData.window&&SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]')&&(SmartEarthPopupData.window.document.querySelector('.ExtrudedPolygon input[name="height"]').value=parseInt(P))}else{var X=je.Cartographic.fromCartesian(M),Y=je.Math.toDegrees(X.longitude),Q=je.Math.toDegrees(X.latitude);A=C.position.getValue();let he=je.Cartographic.fromCartesian(A);A={lon:je.Math.toDegrees(he.longitude),lat:je.Math.toDegrees(he.latitude),height:he.height};var ee=A.lon,z=A.lat,fe=Y-ee,de=Q-z;C.position=M;var G=[],j=[];for(var D in Ne.pointsId){let ut,at,Pt,Qe=v.entities.getById(Ne.pointsId[D]);Qe&&(ut=Qe.position.getValue(),at=je.Cartographic.fromCartesian(ut),ut={lon:je.Math.toDegrees(at.longitude),lat:je.Math.toDegrees(at.latitude),height:at.height},Qe.position=je.Cartesian3.fromDegrees(ut.lon+fe,ut.lat+de,ut.height),G.push({x:ut.lon+fe,y:ut.lat+de,z:ut.height}),j.push([ut.lon+fe,ut.lat+de,ut.height]));let ft=v.entities.getById(m.heightpointsId[D]);ft&&(ut=ft.position.getValue(),at=je.Cartographic.fromCartesian(ut),ut={lon:je.Math.toDegrees(at.longitude),lat:je.Math.toDegrees(at.latitude),height:at.height},ft.position=je.Cartesian3.fromDegrees(ut.lon+fe,ut.lat+de,ut.height))}var J;if(x.GeoType=="StraightArrow")J=m.calculateMorePoints(G);else if(x.GeoType=="RoundedRectangle")J=m._computeRoundedRectanglePoints(G);else if(x.GeoType=="Sector")J=m._computeSectorPoints(G);else if(x.GeoType=="Bow")J=m._computeBowPoints(G);else if(x.GeoType=="GatheringPlace"){let it=m._computeGatheringPlacePoints(G),ut=m.createCloseCardinal(it);J=m.calculatePointsFBZ3(ut,100)}else if(x.GeoType=="SwallowtailArrow")J=m._computeSwallowtailArrow(G);else if(x.GeoType=="Bezierline")J=m._createBezierPoints(G);else if(x.GeoType=="BezierArrow")J=m._createBezierPoints(G);else if(x.GeoType=="PincerArrow"){let it=VD.algorithm.doubleArrow(j),ut=[];JSON.stringify(it.polygonalPoint).indexOf("null")==-1&&(ut=it.polygonalPoint),J=ut}else if(x.GeoType=="AttackArrow"){let it=VD.algorithm.tailedAttackArrow(j),ut=JSON.stringify(it.polygonalPoint).indexOf("null"),at=[];ut==-1&&(at=it.polygonalPoint),J=at}if(D8(x.GeoType))return;let Xe;x.GeoType!=="AttackArrow"&&x.GeoType!=="PincerArrow"?(Xe=[],J.forEach(it=>{Xe.push(it.x,it.y,G[0].z)}),Xe=je.Cartesian3.fromDegreesArrayHeights(Xe)):Xe=J,x.pottingPoint=j,x.GeoType.indexOf("Bezier")>=0?x.polyline.positions=new je.CallbackProperty(function(){return Xe},!1):x.polygon.hierarchy=new je.CallbackProperty(function(){return new je.PolygonHierarchy(Xe)},!1)}}},je.ScreenSpaceEventType.MOUSE_MOVE),this.editHandler.setInputAction(function(E){if(je.ExpandBySmartEarth&&(je.ExpandBySmartEarth.underEarth.enable||je.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}Ne.editVector||(C&&f.callBack&&f.callBack.update&&f.callBack.update(C.name,x),C=void 0,m.defaultEvent(!0))},je.ScreenSpaceEventType.LEFT_UP),this.editHandler.setInputAction(function(E){if(je.ExpandBySmartEarth&&(je.ExpandBySmartEarth.underEarth.enable||je.ExpandBySmartEarth.isStreetView)){m.isEditting&&(m.endThisEdit(),m.defaultEvent(!1));return}if(!Ne.editVector){var T=v.scene.pick(E.position);if(je.defined(T)&&Ne.states==0){var S=T.id;if(m.MilitaryStandardObj.indexOf(S.id)===-1){var M=!1;for(let I=0;I<m.MilitaryStandardObj.length;I++){let P=m.MilitaryStandardObj[I];if(P instanceof Array&&P.indexOf(S.id)!==-1){M=!0;break}}if(!M)return}m.delButton(!0,E.position,function(){let I="",P=m.MilitaryStandardObj.indexOf(S.id);if(P!==-1)I=""+S.id,v.entities.removeById(S.id),m.MilitaryStandardObj.splice(P,1);else{let D=[];for(let L=0;L<m.MilitaryStandardObj.length;L++)if(D=m.MilitaryStandardObj[L],D instanceof Array&&(P=D.indexOf(S.id),P!==-1)){m.MilitaryStandardObj.splice(L,1);break}D.forEach(function(L){v.entities.removeById(L)}),I=D}m.delButton(!1),m.tooltip.show(!1),m.endThisEdit(),f.callBack&&f.callBack.delete&&f.callBack.delete(I)}),m.copyButton(!0,E.position,function(){m.copyButton(!1),m.delButton(!1),m.copyEntity=S,S&&S._polyline&&S._polyline.customData?f.callBack&&f.callBack.copy&&f.callBack.copy(S._polyline.customData):f.callBack&&f.callBack.copy&&f.callBack.copy(S)})}else m.copyEntity&&m.ZTButton(!0,E.position,function(){let I=v.scene.pickPosition(E.position),P=m.getFeature(m.copyEntity);m.entiyFeatureMove(P,I,m.copyEntity);let D=function(R,O){let F=R.indexOf(",");return F!==-1?(O=O+m._core.getuid()+",",D(R.slice(F+1),O)):O+m._core.getuid()};P.id.indexOf(",")?P.id=D(P.id,""):P.id=m._core.getuid();let L=m.addFeature(P);m.ZTButton(!1),L&&L._polyline&&L._polyline.customData&&(L=L._polyline.customData),f.callBack&&f.callBack.paste&&f.callBack.paste(L)})}},je.ScreenSpaceEventType.RIGHT_DOWN),m.defaultEvent(!0);for(var y in Ne.pointsId)v.entities.removeById(Ne.pointsId[y]);for(var y in m.heightpointsId)v.entities.removeById(m.heightpointsId[y]);m.heightpointsId=[],m.heightpoints=[],Ne.pointsId=[],this.endThisEdit=()=>{m.defaultEvent(!0);for(var E in Ne.pointsId)v.entities.removeById(Ne.pointsId[E]);for(var E in m.heightpointsId)v.entities.removeById(m.heightpointsId[E]);m.movePoint&&v.entities.remove(m.movePoint),m.movePoint=void 0,x=void 0,window.layuiLayer.close(SmartEarthPopupData.layerIndex),SmartEarthPopupData.editGraphic={},m.isEditting=!1,Ne.pointsId=[],m.heightpointsId=[],m.heightpoints=[],m.delButton(!1),m.copyButton(!1)}}};vo.prototype.spArray=function(o,f){var m=[],v;for(v=0;v<f.length;)m.push(f.slice(v,v+=o));return m};vo.prototype.delButton=function(o,f,m){if(o){let v=document.getElementById("DeleteMilitaryStandardDelete");v||(v=document.createElement("button"),v.id="DeleteMilitaryStandardDelete",v.innerText="\u5220\u9664\u5BF9\u8C61",v.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(v)),v.style.display="block",v.style.top=f.y+"px",v.style.left=f.x+"px",v.onclick=m}else{let v=document.getElementById("DeleteMilitaryStandardDelete");v&&(v.style.display="none",v.onclick=null)}};vo.prototype.copyButton=function(o,f,m){if(o){let v=document.getElementById("CopyMilitaryStandardcopy");v||(v=document.createElement("button"),v.id="CopyMilitaryStandardcopy",v.innerText="\u590D\u5236",v.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(v)),v.style.display="block",v.style.top=f.y+40+"px",v.style.left=f.x+"px",v.onclick=m}else{let v=document.getElementById("CopyMilitaryStandardcopy");v&&(v.style.display="none",v.onclick=null)}};vo.prototype.ZTButton=function(o,f,m){if(o){let v=document.getElementById("ZTMilitaryStandard");v||(v=document.createElement("button"),v.id="ZTMilitaryStandard",v.innerText="\u7C98\u8D34",v.style.cssText=`height: 38px; line-height: 38px; padding: 0 18px; background-color: #052355; color: #fff; white-space: nowrap; text-align: center; font-size: 14px; border: none; border-radius: 2px; cursor: pointer; position: absolute;`,this._viewer.container.appendChild(v)),v.style.display="block",v.style.top=f.y-40+"px",v.style.left=f.x+"px",v.onclick=m}else{let v=document.getElementById("ZTMilitaryStandard");v&&(v.style.display="none",v.onclick=null),this.copyEntity&&(this.copyEntity=void 0)}};vo.prototype.entiyFeatureMove=function(o,f,m){let v=je.Cartographic.fromCartesian(f),y={lon:je.Math.toDegrees(v.longitude),lat:je.Math.toDegrees(v.latitude),height:v.height};var x=m.pottingPoint,C={lon:0,lat:0,height:0};for(var w in x){var A=x[w];C.lon+=A[0],C.lat+=A[1],C.height+=A[2]}C.lon/=x.length,C.lat/=x.length,C.height/=x.length;let E=y.lon-C.lon,T=y.lat-C.lat,S=y.height-C.height,M=[];o.geometry.coordinates.forEach(I=>{let P=[I[0]+E,I[1]+T,I[2]+S];M.push(P)}),o.geometry.coordinates=M,this.copyButton(!1)};vo.prototype.defaultEvent=function(o){var f=this._viewer.scene;f.screenSpaceCameraController.enableRotate=o,f.screenSpaceCameraController.enableTranslate=o,f.screenSpaceCameraController.enableZoom=o,f.screenSpaceCameraController.enableTilt=o,f.screenSpaceCameraController.enableLook=o};var Tle=vo;function sp(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}sp.prototype.createBox=function(o,f,m,v){var y={id:this._core.getuid(),dimensions:new this._cesium.Cartesian3(4e5,3e5,5e5),material:this._cesium.Color.RED.withAlpha(.5),fill:!0,outline:!0,outlineColor:this._cesium.Color.BLACK},x=this._core.extend(y,f,!0);this.item=this._viewer.entities.add({name:m,position:this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),box:x});var C={id:this.item.id,name:m,pId:this._core.isnull(v)?0:v,type:"box",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(v)?0:v),this};sp.prototype.getstyles=function(){var o={};return o.show=this.item.box.show?this.item.box.show._value:!0,o.heightReference=this.item.box.heightReference?this.item.box.heightReference:void 0,o.fill=this.item.box.fill&&this.item.box.fill._value?this.item.box.fill._value:void 0,o.dimensions=this.item.box.dimensions?this.item.box.dimensions.getValue():void 0,o.shadows=this.item.box.shadows&&this.item.box.shadows._value?this.item.box.shadows._value:void 0,o.material={},o.material.color=this.item.box.material&&this.item.box.material.color._value?"rgba"+this.item.box.material.color.toString():void 0,o.material.image=this.item.box.material&&this.item.box.material.image._value?this.item.box.material.image._value:void 0,o.material.repeat=this.item.box.material&&this.item.box.material.repeat?this.item.box.material.repeat._value:void 0,o.outline=this.item.box.outline&&this.item.box.outline._value?this.item.box.outline._value:void 0,o.outlineColor=this.item.box.outlineColor&&this.item.box.outlineColor._value?"rgba"+this.item.box.outlineColor.toString():void 0,o.outlineWidth=this.item.box.outlineWidth&&this.item.box.outlineWidth._value?this.item.box.outlineWidth._value:void 0,o.near=this.item.box.distanceDisplayCondition?this.item.box.distanceDisplayCondition._value.near:void 0,o.far=this.item.box.distanceDisplayCondition?this.item.box.distanceDisplayCondition._value.far:void 0,o.position=this.item.position.getValue().toString(),o};sp.prototype.executeBox=function(o){var f=this;f.shape={tempPoints:[],button:0,position:{}};var m=new this._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas),v=[],y=void 0,x=[];return m.setInputAction(function(C){var w=f._viewer.scene.camera.pickEllipsoid(C.position,f._viewer.scene.globe.ellipsoid),A=f._cesium.Cartographic.fromCartesian(w),E=f._cesium.Math.toDegrees(A.longitude),T=f._cesium.Math.toDegrees(A.latitude);x.push({lon:E,lat:T}),f.shape.button==0&&(f.box=f._viewer.entities.add({name:"",position:f._cesium.Cartesian3.fromDegrees(x[0].lon,x[0].lat),box:{id:f._core.getuid(),dimensions:new f._cesium.Cartesian3(4e5,3e5,5e5),material:f._cesium.Color.RED.withAlpha(.5),fill:!0,outline:!0,outlineColor:f._cesium.Color.RED}}),f.item=f.box);var S={polyline:{},positions:[],distance:[]},M=0;!f._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(M=Ne.selectedItem.id);var I=f._core.getuid(),P={id:I,name:"\u65B0\u5EFA\u7ACB\u65B9\u4F53"+I,pId:f._core.isnull(M)?0:M,type:"box",item:f};f.setTreeobj(P),f._tree.insertGroupId(P,f._core.isnull(M)?0:M),typeof o=="function"&&o(S),m.destroy()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this};sp.prototype.executeExcavation=function(o,f){var m=this;m.shape={tempPoints:[],button:0,position:{}};var v=new this._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas),y=[],x=void 0,C=[];return v.setInputAction(function(w){var A=m._viewer.scene.camera.pickEllipsoid(w.position,m._viewer.scene.globe.ellipsoid),E=m._cesium.Cartographic.fromCartesian(A),T=m._cesium.Math.toDegrees(E.longitude),S=m._cesium.Math.toDegrees(E.latitude);C.push({lon:T,lat:S});var M=-(o.z/2);if(m.shape.button==0){m.box=m._viewer.entities.add({name:"",position:m._cesium.Cartesian3.fromDegrees(C[0].lon,C[0].lat,M),box:{id:m._core.getuid(),dimensions:new m._cesium.Cartesian3(o.x,o.y,o.z),material:m._cesium.Color.WHITE.withAlpha(.5),outline:!0,outlineColor:m._cesium.Color.WHITE}}),m.item=m.box;var I=m._viewer.scene.globe,P=-(o.x/2),D=-(o.y/2);I.depthTestAgainstTerrain=!0,I.clippingPlanes=new m._cesium.ClippingPlaneCollection({modelMatrix:m.box.computeModelMatrix(m._cesium.JulianDate.now()),planes:[new m._cesium.Plane(new m._cesium.Cartesian3(1,0,0),P),new m._cesium.Plane(new m._cesium.Cartesian3(-1,0,0),P),new m._cesium.Plane(new m._cesium.Cartesian3(0,1,0),D),new m._cesium.Plane(new m._cesium.Cartesian3(0,-1,0),D)],edgeWidth:1,edgeColor:m._cesium.Color.WHITE})}var L={polyline:{},positions:[],distance:[]},R=0;!m._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(R=Ne.selectedItem.id);var O=m._core.getuid(),F={id:O,name:"\u65B0\u5EFA\u7ACB\u65B9\u4F53"+O,pId:m._core.isnull(R)?0:R,type:"box",item:m};m.setTreeobj(F),Ne.insertGroupId(F,m._core.isnull(R)?0:R),typeof f=="function"&&f(L),v.destroy()},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this};sp.prototype.executeBox1=function(o){var f=this,m=this,v=[];f.shape={points:[],button:0,rect:null,entity:null};var y,x=new this._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas);return x.setInputAction(function(C){y=m._core.getPointFromWindowPoint(C.position,m._viewer),f.shape.button>=2&&(x.removeInputAction(m._cesium.ScreenSpaceEventType.MOUSE_MOVE),x.removeInputAction(m._cesium.ScreenSpaceEventType.LEFT_CLICK)),f.shape.button=f.shape.button+1,y&&(f.shape.points.length==0?(v.push(y),f.shape.points.push(m._viewer.scene.globe.ellipsoid.cartesianToCartographic(y)),f.shape.rect=m._cesium.Rectangle.fromCartographicArray(f.shape.points),f.shape.rect.east+=1e-6,f.shape.rect.north+=1e-6,f.shape.entity=m._viewer.entities.add({rectangle:{coordinates:f.shape.rect,material:m._cesium.Color.BLACK.withAlpha(.4),outline:!0,outlineWidth:2,outlineColor:m._cesium.Color.RED,height:0}}),f.bufferEntity=f.shape.entity):f.shape.points.length==2||(x.removeInputAction(m._cesium.ScreenSpaceEventType.MOUSE_MOVE),x.removeInputAction(m._cesium.ScreenSpaceEventType.LEFT_CLICK)))},this._cesium.ScreenSpaceEventType.LEFT_CLICK),x.setInputAction(function(C){if(f.shape.points.length!=0){var w=m._core.getPointFromWindowPoint(C.endPosition,m._viewer);if(w){var A=m._viewer.camera.getPickRay(C.endPosition),E=m._viewer.scene.globe.pick(A,m._viewer.scene);v[1]=w,f.shape.points[1]=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(w),f.shape.rect=m._cesium.Rectangle.fromCartographicArray(f.shape.points),f.shape.button==2?f.shape.entity.rectangle.extrudedHeight=E.z:(f.shape.rect.west==f.shape.rect.east&&(f.shape.rect.east+=1e-6),f.shape.rect.south==f.shape.rect.north&&(f.shape.rect.north+=1e-6),f.shape.entity.rectangle.coordinates=f.shape.rect)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this};sp.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show._value,f=this.item.box.dimensions==null?void 0:this.item.box.dimensions.getValue(),m=this.item.box.fill==null?void 0:this.item.box.fill._value,v=this.item.box.material;v!=null&&(v={color:v.color._value==null?void 0:"rgba("+v.color._value.red+","+v.color._value.green+","+v.color._value.blue+","+v.color._value.alpha+")",image:v.image==null?void 0:v.image._value,diffusemap:v.diffusemap==null?void 0:v.diffusemap._value,alphamap:v.alphamap==null?void 0:v.alphamap._value});var y=this.item.box.outline==null?void 0:this.item.box.outline._value,x=this.item.box.outlineColor==null?void 0:"rgba("+this.item.box.outlineColor._value.red+","+this.item.box.outlineColor._value.green+","+this.item.box.outlineColor._value.blue+","+this.item.box.outlineColor._value.alpha+")",C=this.item.box.outlineWidth==null?void 0:this.item.box.outlineWidth._value,w=this.item.box.distanceDisplayCondition,A=w?._value.near,E=w?._value.far,T=this._cesium.Cartographic.fromCartesian(this.item.position._value),S=this._cesium.Math.toDegrees(T.longitude),M=this._cesium.Math.toDegrees(T.latitude),I=this._cesium.Math.toDegrees(T.height);return{type:"box",position:{x:S,y:M,z:I},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:o,dimensions:f,fill:m,material:v,outline:y,outlineColor:x,outlineWidth:C,near:A,far:E}}};sp.prototype.setTreeobj=function(o){this.treeobj=o};sp.prototype.setVisibility=function(o){this.item.show=o};sp.prototype.setShow=function(o){try{this.item._box.show=o}catch(f){console.log(f)}return this};sp.prototype.getVolume=function(){try{var o=this.item._box.dimensions._value,f=o.x*o.y*o.z}catch(m){console.log(m)}return f};sp.prototype.setBoxImage=function(o){try{this.item._box.material=new this._cesium.ImageMaterialProperty({image:o})}catch(f){console.log(f)}return this};sp.prototype.setBoxRepeat=function(o,f){try{this.item._box.material.repeat=new this._cesium.Cartesian2(o,f)}catch(m){console.log(m)}return this};sp.prototype.setHeightType=function(o){try{o==1?this.item._box.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:o==2?this.item._box.heightReference=this._cesium.HeightReference.NONE:o==3&&(this.item._box.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(f){console.log(f)}return this};sp.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._box.distanceDisplayCondition=m}catch(v){console.log(v)}return this};sp.prototype.setFill=function(o){try{this.item._box.fill=o}catch(f){console.log(f)}return this};sp.prototype.setMaterialAlpha=function(o){try{this.item._box.material.color._value.alpha=o,this.item._box.show=!0}catch(f){console.log(f)}return this};sp.prototype.setOutlineColor=function(o){try{this.item._box.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};sp.prototype.setMaterial=function(o){try{this.item._box.material.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};sp.prototype.setItem=function(o){this.item=o};sp.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)};Object.defineProperties(sp.prototype,{ColorAlpha:{get:function(){return this.item._box.color._value.alpha}},Scale:{get:function(){return this.item._box.scale}},Rotation:{get:function(){return this.item._box.rotation}},Width:{get:function(){return this.item._box.width}},Height:{get:function(){return this.item._box.heightReference}},Color:{get:function(){return this._color.toHtmlColor("rgb("+this.item._box.backgroundColor._value.red*255+","+this.item._box.backgroundColor._value.green*255+","+this.item._box.backgroundColor._value.blue*255+","+this.item._box.backgroundColor._value.alpha*255+")")}}});sp.prototype.CreateBox=function(o,f,m,v,y,x,C,w){this._postion=o;var A={dimensions:new this._cesium.Cartesian3(v,f,m),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.RED};y&&y!==""&&(A.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(y)),x&&x!==""&&(A.material=new no(this._viewer,this._cesium).colorFromHtmlColor(x));var E;(o.Yaw||o.Pitch||o.Roll)&&(E=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(o.Yaw),this._cesium.Math.toRadians(o.Pitch),this._cesium.Math.toRadians(o.Roll)))),this.item=this._viewer.entities.add({name:w,position:this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),box:A,orientation:E});var T={id:this.item.id,name:w,pId:this._core.isnull(C)?0:C,type:"box",item:this};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(C)?0:C),this};Object.defineProperties(sp.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(o){try{this._postion.Altitude=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(o){try{this._postion.AltitudeType=o}catch(f){console.log(f)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(o){try{this._postion.Cartesian=o}catch(f){console.log(f)}}},Distance:{get:function(){return this._postion.Distance},set:function(o){try{this._postion.Distance=o}catch(f){console.log(f)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(o){try{this._postion.Pitch=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},Roll:{get:function(){return this._postion.Roll},set:function(o){try{this._postion.Roll=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},X:{get:function(){return this._postion.X},set:function(o){try{this._postion.X=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Y:{get:function(){return this._postion.Y},set:function(o){try{this._postion.Y=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(o){try{this._postion.Yaw=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}}}});var zD=sp;function e0(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}e0.prototype.createEllipsoid=function(o,f,m,v){var y={radii:new this._cesium.Cartesian3(60,60,60),material:this._cesium.Color.YELLOW},x=this._core.extend(y,f,!0);this.item=this._viewer.entities.add({name:m,position:this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[1]),ellipsoid:x});var C={id:this.item.id,name:m,pId:this._core.isnull(v)?0:v,type:"ellipsoid",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(v)?0:v),this};e0.prototype.getstyles=function(){var o={};return o.show=this.item.ellipsoid.show?this.item.ellipsoid.show._value:!0,o.radii=this.item.ellipsoid.radii?this.item.ellipsoid.radii.getValue():void 0,o.innerRadii=this.item.ellipsoid.innerRadii?this.item.ellipsoid.innerRadii.getValue():void 0,o.minimumClock=this.item.ellipsoid.minimumClock?this.item.ellipsoid.minimumClock._value:void 0,o.maximumClock=this.item.ellipsoid.maximumClock?this.item.ellipsoid.maximumClock._value:void 0,o.minimumCone=this.item.ellipsoid.minimumCone?this.item.ellipsoid.minimumCone._value:void 0,o.maximumCone=this.item.ellipsoid.maximumCone?this.item.ellipsoid.maximumCone._value:void 0,o.heightReference=this.item.ellipsoid.heightReference&&this.item.ellipsoid.heightReference._value?this.item.ellipsoid.heightReference._value:null,o.fill=this.item.ellipsoid.fill?this.item.ellipsoid.fill._value:void 0,o.material={},o.material.color=this.item.ellipsoid.material&&this.item.ellipsoid.material.color&&this.item.ellipsoid.material.color._value?"rgba"+this.item.ellipsoid.material.color.toString():null,o.material.image=this.item.ellipsoid.material&&this.item.ellipsoid.material.image?this.item.ellipsoid.material.image._value:void 0,o.material.repeat=this.item.ellipsoid.material&&this.item.ellipsoid.material.repeat&&this.item.ellipsoid.material.repeat._value?this.item.ellipsoid.material.repeat._value:null,o.outline=this.item.ellipsoid.outline?this.item.ellipsoid.outline._value:void 0,o.outlineWidth=this.item.ellipsoid.outlineWidth&&this.item.ellipsoid.outlineWidth._value?this.item.ellipsoid.outlineWidth._value:void 0,o.outlineColor=this.item.ellipsoid.outlineColor&&this.item.ellipsoid.outlineColor._value?"rgba"+this.item.ellipsoid.outlineColor.toString():null,o.stackPartitions=this.item.ellipsoid.stackPartitions&&this.item.ellipsoid.stackPartitions._value?this.item.ellipsoid.stackPartitions._value:void 0,o.slicePartitions=this.item.ellipsoid.slicePartitions&&this.item.ellipsoid.slicePartitions._value?this.item.ellipsoid.slicePartitions._value:void 0,o.subdivisions=this.item.ellipsoid.subdivisions&&this.item.ellipsoid.subdivisions._value?this.item.ellipsoid.subdivisions._value:void 0,o.near=this.item.ellipsoid.distanceDisplayCondition?this.item.ellipsoid.distanceDisplayCondition._value.near:void 0,o.far=this.item.ellipsoid.distanceDisplayCondition?this.item.ellipsoid.distanceDisplayCondition._value.far:void 0,o.position=this.item.position.getValue().toString(),o};e0.prototype.executeEllipsoid=function(o){var f=this;f.shape={tempPoints:[],button:0,position:{}};var m=new this._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas),v=[],y=void 0,x=[];return m.setInputAction(function(C){var w=f._viewer.scene.camera.pickEllipsoid(C.position,f._viewer.scene.globe.ellipsoid),A=f._cesium.Cartographic.fromCartesian(w),E=f._cesium.Math.toDegrees(A.longitude),T=f._cesium.Math.toDegrees(A.latitude);x.push({lon:E,lat:T});var S={polyline:{},positions:[],distance:[]};if(f.shape.button==0)v.push(w.clone()),v.push(w),f.shape.position=w,f.ellipsoid=f._viewer.entities.add({name:"",position:f._cesium.Cartesian3.fromDegrees(x[0].lon,x[0].lat),ellipsoid:{radii:new f._cesium.Cartesian3(67500,67500,67500),material:f._cesium.Color.fromRandom({alpha:1})}}),f.item=f.ellipsoid;else if(f.shape.button==1){var M=op(x[0].lat,x[0].lon,x[1].lat,x[1].lon);f.item.ellipsoid.radii=new f._cesium.Cartesian3(M,M,M),m.destroy()}var I=0;!f._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(I=Ne.selectedItem.id);var P=f._core.getuid(),D={id:P,name:"\u65B0\u5EFA\u7403"+P,pId:f._core.isnull(I)?0:I,type:"ellipsoid",item:f};f.setTreeobj(D),Ne.insertGroupId(D,f._core.isnull(I)?0:I),typeof o=="function"&&o(S),f.shape.button=f.shape.button+1},this._cesium.ScreenSpaceEventType.LEFT_CLICK),m.setInputAction(function(C){if(f.shape.button==1){var w=f._viewer.camera.pickEllipsoid(C.endPosition,f._viewer.scene.globe.ellipsoid);if(w){var A=f._cesium.Cartographic.fromCartesian(w),E=f._cesium.Math.toDegrees(A.longitude),T=f._cesium.Math.toDegrees(A.latitude),S=Math.ceil(f._viewer.camera.positionCartographic.height);x.push({lon:E,lat:T});var M=op(x[0].lat,x[0].lon,x[x.length-1].lat,x[x.length-1].lon);f.item.ellipsoid.radii=new f._cesium.Cartesian3(M,M,M)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this};e0.prototype.setMaterialColor=function(o){try{this.item._ellipsoid.material.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};e0.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.item.ellipsoid.radii==null?void 0:this.item.ellipsoid.radii.getValue(),m=this.item.ellipsoid.fill==null?void 0:this.item.ellipsoid.fill.getValue(),v=this.item.ellipsoid.material;v!=null&&(v={color:v.color._value==null?void 0:"rgba("+v.color._value.red+","+v.color._value.green+","+v.color._value.blue+","+v.color._value.alpha+")",image:v.image==null?void 0:v.image._value,diffusemap:v.diffusemap==null?void 0:v.diffusemap._value,alphamap:v.alphamap==null?void 0:v.alphamap._value});var y=this.item.ellipsoid.outline==null?void 0:this.item.ellipsoid.outline._value,x=this.item.ellipsoid.outlineColor==null?void 0:"rgba("+this.item.ellipsoid.outlineColor._value.red+","+this.item.ellipsoid.outlineColor._value.green+","+this.item.ellipsoid.outlineColor._value.blue+","+this.item.ellipsoid.outlineColor._value.alpha+")",C=this.item.ellipsoid.outlineWidth==null?void 0:this.item.ellipsoid.outlineWidth.getValue(),w=this.item.ellipsoid.distanceDisplayCondition,A=w?._value.near,E=w?._value.far,T=this._cesium.Cartographic.fromCartesian(this.item.position._value),S=this._cesium.Math.toDegrees(T.longitude),M=this._cesium.Math.toDegrees(T.latitude),I=this._cesium.Math.toDegrees(T.height);return{type:"ellipsoid",position:{x:S,y:M,z:I},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:o,radii:f,fill:m,material:v,outline:y,outlineColor:x,outlineWidth:C,near:A,far:E}}};e0.prototype.setTreeobj=function(o){this.treeobj=o};e0.prototype.setVisibility=function(o){this.item.show=o};e0.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)};e0.prototype.setHeightType=function(o){try{o==1?this.item._ellipsoid.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:o==2?this.item._ellipsoid.heightReference=this._cesium.HeightReference.NONE:o==3&&(this.item._ellipsoid.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(f){console.log(f)}return this};e0.prototype.setEllipsoidAlpha=function(o){try{this.item._ellipsoid.material.color._value.alpha=o,this.item._ellipsoid.show=!0}catch(f){console.log(f)}return this};e0.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._ellipsoid.distanceDisplayCondition=m}catch(v){console.log(v)}return this};e0.prototype.setEllipsoidImage=function(o){try{this.item._ellipsoid.material=new this._cesium.ImageMaterialProperty({image:o})}catch(f){console.log(f)}return this};e0.prototype.setEllipsoidRepeat=function(o,f){try{this.item._ellipsoid.material.repeat=new this._cesium.Cartesian2(o,f)}catch(m){console.log(m)}return this};e0.prototype.setMaterial=function(o){try{this.item._ellipsoid.show=o}catch(f){console.log(f)}return this};e0.prototype.setRadii=function(o){try{this.item._ellipsoid.radii=new this._cesium.Cartesian3(o,o,o)}catch(f){console.log(f)}return this};e0.prototype.setItem=function(o){this.item=o};e0.prototype.CreateSphere=function(o,f,m,v,y,x,C,w){this._postion=o;var A={radii:this._cesium.defaultValue(new this._cesium.Cartesian3(f,f,f),new this._cesium.Cartesian3(60,60,60)),material:this._cesium.Color.RED,outline:!1,outlineColor:void 0};v&&v!==""&&(A.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(v),A.outline=!0),y&&y!==""&&(A.material=new no(this._viewer,this._cesium).colorFromHtmlColor(y));var E;(o.Yaw||o.Pitch||o.Roll)&&(E=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(o.Yaw),this._cesium.Math.toRadians(o.Pitch),this._cesium.Math.toRadians(o.Roll)))),this.item=this._viewer.entities.add({name:w,position:this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),ellipsoid:A,orientation:E});var T={id:this.item.id,name,pId:this._core.isnull(C)?0:C,type:"ellipsoid",item:this};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(C)?0:C),this};Object.defineProperties(e0.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(o){try{this._postion.Altitude=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(o){try{this._postion.AltitudeType=o}catch(f){console.log(f)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(o){try{this._postion.Cartesian=o}catch(f){console.log(f)}}},Distance:{get:function(){return this._postion.Distance},set:function(o){try{this._postion.Distance=o}catch(f){console.log(f)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(o){try{this._postion.Pitch=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},Roll:{get:function(){return this._postion.Roll},set:function(o){try{this._postion.Roll=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},X:{get:function(){return this._postion.X},set:function(o){try{this._postion.X=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Y:{get:function(){return this._postion.Y},set:function(o){try{this._postion.Y=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(o){try{this._postion.Yaw=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}}}});var QO=e0;function Cd(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._getPosition=new Ru(this._viewer,this._cesium),this._tree=Ne,this._postion={Altitude:0,AltitudeType:0,Cartesian:!0,Distance:0,Pitch:0,Roll:0,X:0,Y:0,Yaw:0},this.positions=[],this.objId=Number(new Date().getTime()+""+Number(Math.random()*1e3).toFixed(0)),this.handler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.modifyHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.style=null,this.state=0,this.gonCircleArr=[],this.radius=0}Cd.prototype.createCircle=function(o,f,m,v){var y={id:this._core.getuid(),semiMinorAxis:3e5,semiMajorAxis:3e5,height:2e5,material:this._cesium.Color.GREEN,outline:!0},x=this._Core.extend(y,f,!0);this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),name:m,ellipse:x});var C={id:this.item.id,name:m,pId:this._core.isnull(v)?0:v,type:"circle",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(v)?0:v),greenCircle};Cd.prototype.getstyles=function(){var o={};return o.show=this.item.ellipse.show?this.item.ellipse.show._value:!0,o.height=this.item.ellipse.height&&this.item.ellipse.height._value?this.item.ellipse.height._value:void 0,o.semiMajorAxis=this.item.ellipse.semiMajorAxis&&this.item.ellipse.semiMajorAxis.getValue()?this.item.ellipse.semiMajorAxis.getValue():void 0,o.semiMinorAxis=this.item.ellipse.semiMinorAxis&&this.item.ellipse.semiMinorAxis.getValue()?this.item.ellipse.semiMinorAxis.getValue():void 0,o.heightReference=this.item.ellipse.heightReference&&this.item.ellipse.heightReference._value?this.item.ellipse.heightReference._value:void 0,o.extrudedHeight=this.item.ellipse.extrudedHeight&&this.item.ellipse.extrudedHeight.getValue()?this.item.ellipse.extrudedHeight.getValue():void 0,o.extrudedHeightReference=this.item.ellipse.extrudedHeightReference&&this.item.ellipse.extrudedHeightReference._value?this.item.ellipse.extrudedHeightReference._value:void 0,o.rotation=this.item.ellipse.rotation&&this.item.ellipse.rotation._value?this.item.ellipse.rotation._value:void 0,o.stRotation=this.item.ellipse.stRotation&&this.item.ellipse.stRotation._value?this.item.ellipse.stRotation._value:void 0,o.granularity=this.item.ellipse.granularity&&this.item.ellipse.granularity._value?this.item.ellipse.granularity._value:void 0,o.fill=this.item.ellipse.fill?this.item.ellipse.fill._value:void 0,o.material={},o.material.color=this.item.ellipse.material&&this.item.ellipse.material.color&&this.item.ellipse.material.color._value?"rgba"+this.item.ellipse.material.color.toString():void 0,o.material.image=this.item.ellipse.material&&this.item.ellipse.material.image?this.item.ellipse.material.image._value:void 0,o.material.repeat=this.item.ellipse.material&&this.item.ellipse.material.repeat._value?this.item.ellipse.material.repeat._value:void 0,o.outline=this.item.ellipse.outline?this.item.ellipse.outline._value:void 0,o.outlineWidth=this.item.ellipse.outlineWidth&&this.item.ellipse.outlineWidth._value?this.item.ellipse.outlineWidth._value:void 0,o.outlineColor=this.item.ellipse.outlineColor&&this.item.ellipse.outlineColor._value?"rgba"+this.item.ellipse.outlineColor.toString():void 0,o.numberOfVerticalLines=this.item.ellipse.numberOfVerticalLines&&this.item.ellipse.numberOfVerticalLines._value?this.item.ellipse.numberOfVerticalLines._value:void 0,o.classificationType=this.item.ellipse.classificationType&&this.item.ellipse.classificationType._value?this.item.ellipse.classificationType._value:void 0,o.near=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.near:void 0,o.far=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.far:void 0,o.position=this.item.position.getValue().toString(),o};Cd.prototype.createCircleOptimization=function(o,f){this.style=o;var m=this;this.handler.setInputAction(function(v){var y=m.getCatesian3FromPX(v.position,m._viewer,[m.circle]);m.positions.length==0&&m.positions.push(y.clone()),m.positions.push(y);var x=m.createPoint(y,!1);m.gonCircleArr.length>0&&(m.positions.pop(),m.state=1,m.handler.destroy()),x.wz=m.gonCircleArr.length,m.gonCircleArr.push(x)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(v){if(!(m.positions.length<1)){var y=m.getCatesian3FromPX(v.endPosition,m._viewer,[m.circle]);if(m.positions.length==2&&!m._cesium.defined(m.circle)){var x=m._cesium.Cartographic.fromCartesian(m.positions[0]),C=m._cesium.Math.toDegrees(x.longitude),w=m._cesium.Math.toDegrees(x.latitude),A=m._cesium.Cartographic.fromCartesian(m.positions[1]),E=m._cesium.Math.toDegrees(A.longitude),T=m._cesium.Math.toDegrees(A.latitude);m.radius=op(w,C,T,E),m.circle=m.createCircle(m.style),m.circle.objId=m.objId}if(m.circle){m.positions.pop(),m.positions.push(y);var x=m._cesium.Cartographic.fromCartesian(m.positions[0]),C=m._cesium.Math.toDegrees(x.longitude),w=m._cesium.Math.toDegrees(x.latitude),A=m._cesium.Cartographic.fromCartesian(m.positions[1]),E=m._cesium.Math.toDegrees(A.longitude),T=m._cesium.Math.toDegrees(A.latitude);m.radius=op(w,C,T,E)}}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)};Cd.prototype.startModify=function(){var o="\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E";if(!(this.state!=2&&this.state!=1)){this.modifyHandler||(this.modifyHandler=new Cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas));for(var f=this,m=0;m<f.gonCircleArr.length;m++){var v=f.gonCircleArr[m];v&&(v.show=!0)}this.modifyHandler.setInputAction(function(y){var x=f._viewer.scene.pick(y.position);if(Cesium.defined(x)&&x.id)x.id.objId||(f.modifyPoint=x.id,o="\u91CA\u653E\u540E\u5B8C\u6210\u4FEE\u6539"),f.forbidDrawWorld(!0);else{for(var C=0;C<f.gonCircleArr.length;C++){var w=f.gonCircleArr[C];w&&(w.show=!1)}f.modifyHandler&&(f.modifyHandler.destroy(),f.modifyHandler=null)}f.state=2},Cesium.ScreenSpaceEventType.LEFT_DOWN),this.modifyHandler.setInputAction(function(y){var x=f._viewer.scene.pick(y.endPosition);if(f._core.CreateTooltip(o,y.endPosition,!1),Cesium.defined(x)&&x.id&&(x.id.objId||f._core.CreateTooltip(o,y.endPosition,!0)),!(f.positions.length<1||!f.modifyPoint)){var C=f.getCatesian3FromPX(y.endPosition,f._viewer,[f.circle,f.modifyPoint]);if(C)if(f.modifyPoint.position.setValue(C),f.positions[f.modifyPoint.wz]=C,f.modifyPoint.wz==0)f.gonCircleArr[1].position={x:f.positions[0].x+f.radius,y:f.positions[0].y,z:f.positions[0].z};else{var w=f._cesium.Cartographic.fromCartesian(f.positions[0]),A=f._cesium.Math.toDegrees(w.longitude),E=f._cesium.Math.toDegrees(w.latitude),T=f._cesium.Cartographic.fromCartesian(f.positions[f.modifyPoint.wz]),S=f._cesium.Math.toDegrees(T.longitude),M=f._cesium.Math.toDegrees(T.latitude);f.radius=op(E,A,M,S)}f._core.CreateTooltip(o,y.endPosition,!0)}},Cesium.ScreenSpaceEventType.MOUSE_MOVE),this.modifyHandler.setInputAction(function(y){if(!!f.modifyPoint){var x=f.getCatesian3FromPX(y.position,f._viewer,[f.circle,f.modifyPoint]);if(f.modifyPoint.position.setValue(x),f.positions[f.modifyPoint.wz]=x,f.modifyPoint.wz==0)f.gonCircleArr[1].position={x:f.positions[0].x+f.radius,y:f.positions[0].y,z:f.positions[0].z};else{var C=f._cesium.Cartographic.fromCartesian(f.positions[0]),w=f._cesium.Math.toDegrees(C.longitude),A=f._cesium.Math.toDegrees(C.latitude),E=f._cesium.Cartographic.fromCartesian(f.positions[f.modifyPoint.wz]),T=f._cesium.Math.toDegrees(E.longitude),S=f._cesium.Math.toDegrees(E.latitude);f.radius=op(A,w,S,T)}f.modifyPoint=null,f.forbidDrawWorld(!1),o="\u62D6\u52A8\u4FEE\u6539\u4F4D\u7F6E"}},Cesium.ScreenSpaceEventType.LEFT_UP)}};Cd.prototype.forbidDrawWorld=function(o){this._viewer.scene.screenSpaceCameraController.enableRotate=!o,this._viewer.scene.screenSpaceCameraController.enableTilt=!o,this._viewer.scene.screenSpaceCameraController.enableTranslate=!o,this._viewer.scene.screenSpaceCameraController.enableInputs=!o};Cd.prototype.getCatesian3FromPX=function(o,f,m){var v=f.scene.pick(o),y,x=f.scene.drillPick(o),C=null;if(m){for(var w=0;w<x.length;w++)if(x[w].id._id!=m[0].id&&x[w].id._id!=m[1].id){C=x[w].id;break}}else C=v;if(f.scene.pickPositionSupported&&Cesium.defined(C))y=f.scene.pickPosition(o);else{var A=f.camera.getPickRay(o);if(!A)return;y=f.scene.globe.pick(A,f.scene)}return y};Cd.prototype.createCircle=function(o){var f=this;return this._viewer.entities.add({position:new f._cesium.CallbackProperty(function(){return f.positions[0]},!1),ellipse:{semiMinorAxis:new f._cesium.CallbackProperty(function(){return f.radius},!1),semiMajorAxis:new f._cesium.CallbackProperty(function(){return f.radius},!1),material:f._cesium.Color.BLUE.withAlpha(.5),outline:o.outline||!0}})};Cd.prototype.createPoint=function(o,f){if(!!o)return this._viewer.entities.add({position:o,point:{pixelSize:10,color:this._cesium.Color.ROYALBLUE,outlineWidth:2,outlineColor:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY},show:f})};Cd.prototype.executeClircle=function(o){var f=[],m=this;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var v=new this._cesium.ScreenSpaceEventHandler(m._viewer.scene.canvas);v.setInputAction(function(x){var C=m._getPosition.getMousePosition(x,[m.item]);if(C){var w=m._cesium.Cartographic.fromCartesian(C),A=m._cesium.Math.toDegrees(w.longitude),E=m._cesium.Math.toDegrees(w.latitude);f.push({lon:A,lat:E});var T=f.length;if(T==1){f.push({lon:A,lat:E});var S=m._viewer.entities.add({position:m._cesium.Cartesian3.fromDegrees(f[0].lon,f[0].lat),ellipse:{semiMinorAxis:0,semiMajorAxis:0,material:m._cesium.Color.fromRandom({alpha:.8})}});S.ellipse.semiMinorAxis=new m._cesium.CallbackProperty(y,!1),S.ellipse.semiMajorAxis=new m._cesium.CallbackProperty(y,!1),m.item=S}else{var M=y();m._core.mouse(m._viewer.container,0,"0"),m.item.ellipse.semiMinorAxis=M,m.item.ellipse.semiMajorAxis=M,v.destroy(),v=void 0,f=[]}}},m._cesium.ScreenSpaceEventType.LEFT_CLICK),v.setInputAction(function(x){if(!!f.length){var C=m._getPosition.getMousePosition(x,[m.item]);if(C){var w=m._cesium.Cartographic.fromCartesian(C),A=m._cesium.Math.toDegrees(w.longitude),E=m._cesium.Math.toDegrees(w.latitude);f[1]={lon:A,lat:E}}}},m._cesium.ScreenSpaceEventType.MOUSE_MOVE);function y(){return op(f[0].lat,f[0].lon,f[1].lat,f[1].lon)}return this};Cd.prototype.executeClirclews=function(o){var f=this,m=this._cesium.Material.fromType(this._cesium.Material.ColorType);m.uniforms.color=new this._cesium.Color(1,1,0,.5);var v=this._cesium.Ellipsoid.WGS84,y=this,x=this._viewer.scene,C=this._viewer.scene.primitives,w=null,A=null,E=new this._cesium.ScreenSpaceEventHandler(x.canvas);E.setInputAction(function(M){if(M.position!=null){var I=x.camera.pickEllipsoid(M.position,v);I&&(w==null?(w=new T({center:I,radius:0,asynchronous:!1,material:f._cesium.Color.RED}),C.add(w)):y.stopDrawing())}},f._cesium.ScreenSpaceEventType.LEFT_DOWN),E.setInputAction(function(M){var I=M.endPosition;if(I!=null&&w!=null){var P=x.camera.pickEllipsoid(I,v);P&&w.setRadius(f._cesium.Cartesian3.distance(w.getCenter(),P))}},f._cesium.ScreenSpaceEventType.MOUSE_MOVE);var T=function(){function M(I){if(!(f._cesium.defined(I.center)&&f._cesium.defined(I.radius)))throw new f._cesium.DeveloperError("Center and radius are required");I=copyOptions(I,defaultSurfaceOptions),this.initialiseOptions(I),this.setRadius(I.radius)}return M.prototype=new S,M.prototype.setCenter=function(I){this.setAttribute("center",I)},M.prototype.setRadius=function(I){this.setAttribute("radius",Math.max(.1,I))},M.prototype.getCenter=function(){return this.getAttribute("center")},M.prototype.getRadius=function(){return this.getAttribute("radius")},M.prototype.getGeometry=function(){if(!!(f._cesium.defined(this.center)&&f._cesium.defined(this.radius)))return new f._cesium.CircleGeometry({center:this.center,radius:this.radius,height:this.height,vertexFormat:f._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,stRotation:this.textureRotationAngle,ellipsoid:this.ellipsoid,granularity:this.granularity})},M.prototype.getOutlineGeometry=function(){return new f._cesium.CircleOutlineGeometry({center:this.getCenter(),radius:this.getRadius()})},M},S=function(){function M(){}return M.prototype.initialiseOptions=function(I){fillOptions(this,I),this._ellipsoid=void 0,this._granularity=void 0,this._height=void 0,this._textureRotationAngle=void 0,this._id=void 0,this._createPrimitive=!0,this._primitive=void 0,this._outlinePolygon=void 0},M.prototype.setAttribute=function(I,P){this[I]=P,this._createPrimitive=!0},M.prototype.getAttribute=function(I){return this[I]},M.prototype.update=function(I,P,D){if(!f._cesium.defined(this.ellipsoid))throw new f._cesium.DeveloperError("this.ellipsoid must be defined.");if(!f._cesium.defined(this.appearance))throw new f._cesium.DeveloperError("this.material must be defined.");if(this.granularity<0)throw new f._cesium.DeveloperError("this.granularity and scene2D/scene3D overrides must be greater than zero.");if(!!this.show&&!(!this._createPrimitive&&!f._cesium.defined(this._primitive))){if(this._createPrimitive||this._ellipsoid!==this.ellipsoid||this._granularity!==this.granularity||this._height!==this.height||this._textureRotationAngle!==this.textureRotationAngle||this._id!==this.id){var L=this.getGeometry();if(!L)return;this._createPrimitive=!1,this._ellipsoid=this.ellipsoid,this._granularity=this.granularity,this._height=this.height,this._textureRotationAngle=this.textureRotationAngle,this._id=this.id,this._primitive=this._primitive&&this._primitive.destroy(),this._primitive=new f._cesium.Primitive({geometryInstances:new f._cesium.GeometryInstance({geometry:L,id:this.id,pickPrimitive:this}),appearance:this.appearance,asynchronous:this.asynchronous}),this._outlinePolygon=this._outlinePolygon&&this._outlinePolygon.destroy(),this.strokeColor&&this.getOutlineGeometry&&(this._outlinePolygon=new f._cesium.Primitive({geometryInstances:new f._cesium.GeometryInstance({geometry:this.getOutlineGeometry(),attributes:{color:f._cesium.ColorGeometryInstanceAttribute.fromColor(this.strokeColor)}}),appearance:new f._cesium.PerInstanceColorAppearance({flat:!0,renderState:{depthTest:{enabled:!0},lineWidth:Math.min(this.strokeWidth)}})}))}var R=this._primitive;R.appearance.material=this.material,R.debugShowBoundingVolume=this.debugShowBoundingVolume,R.update(I,P,D),this._outlinePolygon&&this._outlinePolygon.update(I,P,D)}},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),f._cesium.destroyObject(this)},M.prototype.setStrokeStyle=function(I,P){(!this.strokeColor||!this.strokeColor.equals(I)||this.strokeWidth!=P)&&(this._createPrimitive=!0,this.strokeColor=I,this.strokeWidth=P)},M}()};Cd.prototype.setSemiMajorAxis=function(o){try{this.item._ellipse.semiMajorAxis=o}catch(f){console.log(f)}return this};Cd.prototype.setSemiMinorAxis=function(o){try{this.item._ellipse.semiMinorAxis=o}catch(f){console.log(f)}return this};Cd.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show._value,f=this.item.ellipse.semiMajorAxis==null?void 0:this.item.ellipse.semiMajorAxis._value,m=this.item.ellipse.semiMinorAxis==null?void 0:this.item.ellipse.semiMinorAxis._value,O=this.item.ellipse.height==null?void 0:this.item.ellipse.height._value,v=this.item.ellipse.extrudedHeight==null?void 0:this.item.ellipse.extrudedHeight._value,y=this.item.ellipse.rotation==null?void 0:this.item.ellipse.rotation._value,x=this.item.ellipse.stRotation==null?void 0:this.item.ellipse.stRotation._value,C=this.item.ellipse.fill==null?void 0:this.item.ellipse.fill._value,w=this.item.ellipse.material;w!=null&&(w={color:w.color==null?void 0:"rgba("+w.color._value.red+","+w.color._value.green+","+w.color._value.blue+","+w.color._value.alpha+")",image:w.image==null?void 0:w.image._value,diffusemap:w.diffusemap==null?void 0:w.diffusemap._value,alphamap:w.alphamap==null?void 0:w.alphamap._value});var A=this.item.ellipse.outline==null?void 0:this.item.ellipse.outline._value,E=this.item.ellipse.outlineColor==null?void 0:"rgba("+this.item.ellipse.outlineColor._value.red+","+this.item.ellipse.outlineColor._value.green+","+this.item.ellipse.outlineColor._value.blue+","+this.item.ellipse.outlineColor._value.alpha+")",T=this.item.ellipse.outlineWidth==null?void 0:this.item.ellipse.outlineWidth._value,S=this.item.ellipse.numberOfVerticalLines==null?void 0:this.item.ellipse.numberOfVerticalLines._value,M=this.item.ellipse.distanceDisplayCondition,I=M?._value.near,P=M?._value.far,D=this._cesium.Cartographic.fromCartesian(this.item.position._value),L=this._cesium.Math.toDegrees(D.longitude),R=this._cesium.Math.toDegrees(D.latitude),O=this._cesium.Math.toDegrees(D.height);return{type:"circle",position:{x:L,y:R,z:O},treeobj:{name:this.treeobj.name},style:{show:o,semiMajorAxis:f,semiMinorAxis:m,height:O,extrudedHeight:v,rotation:y,stRotation:x,fill:C,material:w,outline:A,outlineColor:E,outlineWidth:T,numberOfVerticalLines:S,near:I,far:P}}};Cd.prototype.setTreeobj=function(o){this.treeobj=o};Cd.prototype.setHeight=function(o){try{this.item._ellipse.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND,this.item._ellipse.height=o}catch(f){console.log(f)}return this};Cd.prototype.setHeightType=function(o){try{o==1?this.item._ellipse.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:o==2?this.item._ellipse.heightReference=this._cesium.HeightReference.NONE:o==3&&(this.item._ellipse.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(f){console.log(f)}return this};Cd.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._ellipse.distanceDisplayCondition=m}catch(v){console.log(v)}return this};Cd.prototype.setEllipseImage=function(o){try{this.item._ellipse.material.uniforms.image=o}catch(f){console.log(f)}return this};Cd.prototype.setOutlineColor=function(o){try{this.item._ellipse.outlineWidth=5,this.item._ellipse.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};Cd.prototype.setMaterial=function(o){try{this.item._ellipse.material.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};Cd.prototype.setMaterialAlpha=function(o){try{this.item._ellipse.material.color._value.alpha=o,this.item._ellipse.show=!0}catch(f){console.log(f)}return this};Cd.prototype.setItem=function(o){this.item=o};Cd.prototype.setExtrudedHeight=function(o){try{this.item._ellipse.extrudedHeight=o}catch(f){console.log(f)}return this};Cd.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)};Cd.prototype.CreateCircle=function(o,f,m,v,y,x){this._postion=o;var C={semiMinorAxis:this._cesium.defaultValue(f,3e5),semiMajorAxis:this._cesium.defaultValue(f,3e5),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.WHITE};m&&m!==""&&(C.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(m)),v&&v!==""&&(C.material=new no(this._viewer,this._cesium).colorFromHtmlColor(v));var w;(o.Yaw||o.Pitch||o.Roll)&&(w=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(o.Yaw),this._cesium.Math.toRadians(o.Pitch),this._cesium.Math.toRadians(o.Roll)))),this.item=this._viewer.entities.add({name:x,position:this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),ellipse:C,orientation:w});var A={id:this.item.id,name:x,pId:this._core.isnull(y)?0:y,type:"circle",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(y)?0:y),this};Cd.prototype.CreateEllipse=function(o,f,m,v,y,x,C,w){this._postion=o;var A={semiMinorAxis:this._cesium.defaultValue(f,3e5),semiMajorAxis:this._cesium.defaultValue(m,1e5),numberOfVerticalLines:this._cesium.defaultValue(x,16),material:this._cesium.Color.YELLOW,outline:!0,outlineColor:this._cesium.Color.WHITE};v&&v!==""&&(A.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(v)),y&&y!==""&&(A.material=new no(this._viewer,this._cesium).colorFromHtmlColor(y));var E;(o.Yaw||o.Pitch||o.Roll)&&(E=this._cesium.Transforms.headingPitchRollQuaternion(this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(o.Yaw),this._cesium.Math.toRadians(o.Pitch),this._cesium.Math.toRadians(o.Roll)))),this.item=this._viewer.entities.add({name:w,position:this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),ellipse:A,orientation:E});var T={id:this.item.id,name:w,pId:this._core.isnull(C)?0:C,type:"ellipse",item:this};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(C)?0:C),this};Object.defineProperties(Cd.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(o){try{this._postion.Altitude=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(o){try{this._postion.AltitudeType=o}catch(f){console.log(f)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(o){try{this._postion.Cartesian=o}catch(f){console.log(f)}}},Distance:{get:function(){return this._postion.Distance},set:function(o){try{this._postion.Distance=o}catch(f){console.log(f)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(o){try{this._postion.Pitch=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},Roll:{get:function(){return this._postion.Roll},set:function(o){try{this._postion.Roll=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},X:{get:function(){return this._postion.X},set:function(o){try{this._postion.X=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Y:{get:function(){return this._postion.Y},set:function(o){try{this._postion.Y=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(o){try{this._postion.Yaw=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}}}});var RP=Cd;function jc(o,f){this._viewer=o,this._cesium=f,this._tree=Ne,this._core=new Sr(o,f),this._Color=new no(this._viewer,this._cesium),this._postion={Altitude:0,AltitudeType:0,Cartesian:!0,Distance:0,Pitch:0,Roll:0,X:0,Y:0,Yaw:0}}jc.prototype.createLabel=function(o,f,m,v,y){var x={id:this._core.getuid(),text:"default text",backgroundColor:new no(this._viewer,this._cesium).createColor(.165,.165,.165,1),fillColor:new no(this._viewer,this._cesium).createColor(.9411764705882353,.9725490196078431,1,1),font:"30px sans-serif",horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,show:!0,scale:1,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(0,Number.MAX_VALUE)},C=this._core.extend(x,m,!0);this._core.isnull(f)||(C.text=f),C.fillColor&&!this._core.isnull(C)&&!this._core.isnull(C.fillColor)&&(C.fillColor.toString().charAt(0)=="["&&C.fillColor.toString().charAt(C.fillColor.length-1)=="]"||(this._core.isHtmlColor(C.fillColor)&&/^#/.test(C.fillColor.toString())?C.fillColor=this._Color.colorFromHtmlColor(C.fillColor):(/^rgb/.test(C.fillColor)&&(C.fillColor=this._Color.rgbaStringToRgbaObj(C.fillColor)),C.fillColor.r>1&&(C.fillColor.r=C.fillColor.r/255),C.fillColor.g>1&&(C.fillColor.g=C.fillColor.g/255),C.fillColor.b>1&&(C.fillColor.b=C.fillColor.b/255),C.fillColor.a>1&&(C.fillColor.a=C.fillColor.a/255),C.fillColor.r&&(C.fillColor=this._Color.createColor(C.fillColor.r,C.fillColor.g,C.fillColor.b,C.fillColor.a))))),C.backgroundColor&&!this._core.isnull(C)&&!this._core.isnull(C.backgroundColor)&&(C.backgroundColor.toString().charAt(0)=="["&&C.backgroundColor.toString().charAt(C.backgroundColor.length-1)=="]"||(this._core.isHtmlColor(C.backgroundColor)&&/^#/.test(C.backgroundColor.toString())?C.backgroundColor=this._Color.colorFromHtmlColor(C.backgroundColor):(/^rgb/.test(C.backgroundColor)&&(C.backgroundColor=this._Color.rgbaStringToRgbaObj(C.backgroundColor)),C.backgroundColor.r>1&&(C.backgroundColor.r=C.backgroundColor.r/255),C.backgroundColor.g>1&&(C.backgroundColor.g=C.backgroundColor.g/255),C.backgroundColor.b>1&&(C.backgroundColor.b=C.backgroundColor.b/255),C.backgroundColor.a>1&&(C.backgroundColor.a=C.backgroundColor.a/255),C.backgroundColor.r&&(C.backgroundColor=this._Color.createColor(C.backgroundColor.r,C.backgroundColor.g,C.backgroundColor.b,C.backgroundColor.a))))),C.outlineColor&&!this._core.isnull(C)&&!this._core.isnull(C.outlineColor)&&(C.outlineColor.toString().charAt(0)=="["&&C.outlineColor.toString().charAt(C.outlineColor.length-1)=="]"||(this._core.isHtmlColor(C.outlineColor)&&/^#/.test(C.outlineColor.toString())?C.outlineColor=this._Color.colorFromHtmlColor(C.outlineColor):(/^rgb/.test(C.outlineColor)&&(C.outlineColor=this._Color.rgbaStringToRgbaObj(C.outlineColor)),C.outlineColor.r>1&&(C.outlineColor.r=C.outlineColor.r/255),C.outlineColor.g>1&&(C.outlineColor.g=C.outlineColor.g/255),C.outlineColor.b>1&&(C.outlineColor.b=C.outlineColor.b/255),C.outlineColor.a>1&&(C.outlineColor.a=C.outlineColor.a/255),C.outlineColor.r&&(C.outlineColor=this._Color.createColor(C.outlineColor.r,C.outlineColor.g,C.outlineColor.b,C.outlineColor.a))))),C.near&&C.far&&(C.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(C.near,C.far)),this.item=this._viewer.entities.add({position:this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),label:C});var w={id:this.item.id,name:C.text,pId:this._core.isnull(v)?0:v,type:"label",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,this._core.isnull(v)?0:v),this};jc.prototype.getstyles=function(){var o={};return o.backgroundColor="rgba"+this.item.label._backgroundColor.toString(),o.fillColor="rgba"+this.item.label._fillColor.toString(),o.text=this.item.label.text.toString(),o.show=this.item.label.show?this.item.label.show._value:!0,o.font=this.item.label.font?this.item.label.font.toString():null,o.style=this.item.label.style?this.item.label.style.toString()=="null"?null:this.item.label.style.toString():null,o.scale=this.item.label.scale?this.item.label.scale.toString():null,o.showBackground=this.item.label.showBackground?this.item.label.showBackground._value:null,o.horizontalOrigin=this.item.label.horizontalOrigin?this.item.label.horizontalOrigin.toString():null,o.verticalOrigin=this.item.label.verticalOrigin?this.item.label.verticalOrigin.toString():null,o.heightReference=this.item.label.heightReference?this.item.label.heightReference.toString():null,o.outlineColor=this.item.label.outlineColor?"rgba"+this.item.label.outlineColor.toString():null,o.outlineWidth=this.item.label.outlineWidth?this.item.label.outlineWidth._value:null,o.near=this.item.label.distanceDisplayCondition?this.item.label.distanceDisplayCondition._value.near:null,o.far=this.item.label.distanceDisplayCondition?this.item.label.distanceDisplayCondition._value.far:null,o.position=this.item.position.getValue().toString(),o};jc.prototype.executeLabel=function(o){var f=this,m=[],v=new f._cesium.ScreenSpaceEventHandler(f._viewer.scene.canvas);return v.setInputAction(function(y){var x=f._viewer.scene.camera.pickEllipsoid(y.position,f._viewer.scene.globe.ellipsoid);m.push(x);var C=f._viewer.entities.add({position:x,label:{id:f._core.getuid(),text:"",font:"30px sans-serif",horizontalOrigin:f._cesium.HorizontalOrigin.CENTER,verticalOrigin:f._cesium.VerticalOrigin.CENTER,show:!0,showBackground:!0}});f.item=C;var w=0;!f._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(w=Ne.selectedItem.id);var A=f._core.getuid(),E={id:A,name:"",pId:f._core.isnull(w)?0:w,type:"Point",item:f};f.setTreeobj(E),f._tree.insertGroupId(E,f._core.isnull(w)?0:w)},f._cesium.ScreenSpaceEventType.LEFT_CLICK),v.setInputAction(function(y){v.destroy()},f._cesium.ScreenSpaceEventType.RIGHT_CLICK),this};jc.prototype.deleteObject=function(){try{if(this.item.type==="DivPoint"){this.pointPrimitive.remove(this.item);var o=document.getElementById(this.item.id);o&&o.remove();return}this._viewer.entities.remove(this.item)}catch{}};jc.prototype.setVisibility=function(o){this.item.show=o};jc.prototype.setRichtext=function(o){var f=this._core.getuid();this.item.position._value!=null?this._position=this.item.position._value:this._position=this.item.position;var m=this.treeobj.pId;if(this.deleteObject(),!this.pointPrimitive){this.pointPrimitive=this._viewer.scene.primitives.add(new this._cesium.PointPrimitiveCollection);var v,y,x,C,w=this;this.pointPrimitive.update=function(){for(var E=0,T,S;E<w.pointPrimitive.length;E++){if(T=w.pointPrimitive.get(E),C=T.position,x=w._viewer.scene.cartesianToCanvasCoordinates(C),!x)return;y=document.getElementById(T.id),T.name||(T.name="\u6CF0\u745E"),y||(T.description?(S='<div id="'+T.id+'" style="position: absolute; width: 200px; height: 157px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+pn.divpoint+`);transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;"> <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)"></div> <div class="content" style="position: inherit;font-size: 14px;top: 50px;left: 50px;width: 140px;text-align: left;color: rgba(255,255,255,1);">`+T.description+`</div> </div>`,$(".cesium-viewer").append(S),y=document.getElementById(T.id)):(S='<div id="'+T.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+pn.divpoint1+`);transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;"> <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">`+T.name+`</div> </div>`,$(".cesium-viewer").append(S),y=document.getElementById(T.id))),T.description?y.style.transform="matrix(1, 0, 0, 1, "+x.x+", "+(x.y-157)+")":y.style.transform="matrix(1, 0, 0, 1, "+x.x+", "+(x.y-134)+")"}}}this.item=this.pointPrimitive.add({id:"DivPoint"+f,position:this._position,color:this._cesium.Color.YELLOW}),this.item.type="DivPoint",this.item.name=name,this.item.description=o;var A={id:this.item.id,name,pId:this._core.isnull(m)?0:m,type:"Point",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(m)?0:m),this.item};jc.prototype.getVisibility=function(){return this.item.show};jc.prototype.setRadius=function(o){try{this.item._label.outlineWidth=o,this.item._label.outlineColor=this._cesium.Color.RED.withAlpha(.4)}catch(f){console.log(f)}return this};jc.prototype.setText=function(o){try{this.item._label.text=o}catch(f){console.log(f)}return this};jc.prototype.setHeightType=function(o){try{o==1?this.item._label.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:o==2?this.item._label.heightReference=this._cesium.HeightReference.NONE:o==3&&(this.item._label.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(f){console.log(f)}return this};jc.prototype.setUrl=function(o){try{this.item.billboard=new this._cesium.BillboardGraphics({id:this._core.getuid(),image:o,show:!0})}catch(f){console.log(f)}return this};jc.prototype.setFillColorRgba=function(o,f,m,v){try{this.item._label.fillColor=new no(this._viewer,this._cesium).createColor(o,f,m,v)}catch(y){console.log(y)}};jc.prototype.setFillColorHtml=function(o){try{this.item._label.fillColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o),this.item.fillColor=this.item._label.fillColor}catch(f){console.log(f)}};jc.prototype.setFillColorAlpha=function(o){try{this.item._label.fillColor._value.alpha=o}catch(f){console.log(f)}};jc.prototype.setBackgroundColorRgba=function(o,f,m,v){try{this.item._label.backgroundColor=new no(this._viewer,this._cesium).createColor(o,f,m,v)}catch(y){console.log(y)}};jc.prototype.setBackgroundColorHtml=function(o){try{this.item._label.backgroundColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}};jc.prototype.setBackgroundColorAlpha=function(o){try{this.item._label.backgroundColor._value.alpha=o}catch(f){console.log(f)}};jc.prototype.setFontSize=function(o){try{this.item._label.font=parseFloat(o)+"px sans-serif"}catch(f){console.log(f)}};jc.prototype.setFillColorAlpha=function(o){try{this.item._label.fillColor._value.alpha=o}catch(f){console.log(f)}};jc.prototype.showBackground=function(o){try{this.item._label.showBackground=o}catch(f){console.log(f)}};jc.prototype.setOutlineWidth=function(o){try{this.item._label.outlineWidth=o}catch(f){console.log(f)}};jc.prototype.setOutlineColorRgba=function(o,f,m,v){try{this.item._label.outlineColor=new this._cesium.Color(o,f,m,v)}catch(y){console.log(y)}};jc.prototype.setOutlineColorHtml=function(o){try{this.item._label.outlineColor=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}};jc.prototype.setOutlineColorAlpha=function(o){try{this.item._label.outlineColor._value.alpha=o}catch(f){console.log(f)}};jc.prototype.setStyle_LabelStyle_FILL=function(o){try{this.item._label.style=this.LabelStyle_FILL}catch(f){console.log(f)}};jc.prototype.setStyle_LabelStyle_FILL_AND_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_FILL_AND_OUTLINE}catch(o){console.log(o)}};jc.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._label.distanceDisplayCondition=m}catch(v){console.log(v)}return this};jc.prototype.setStyle_LabelStyle_OUTLINE=function(){try{this.item._label.style=this.LabelStyle_OUTLINE}catch(o){console.log(o)}};jc.prototype.setItem=function(o){this.item=o};jc.prototype.CreateLabel=function(o,f,m,v,y,x){this._postion=o;var C={id:this._core.getuid(),text:f,backgroundColor:v.BackgroundColor,font:v.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,show:!0,scale:v.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(v.MinViewingHeight,v.MaxViewingHeight)};v.Italic&&(C.font="italic "+C.font),v.Bold&&(C.font="Bold "+C.font),!this._core.isnull(v)&&!this._core.isnull(v.IconColor)&&(v.IconColor.toString().charAt(0)=="["&&v.IconColor.toString().charAt(v.IconColor.length-1)=="]"||(this._core.isHtmlColor(v.IconColor)?C.fillColor=this._Color.colorFromHtmlColor(v.IconColor):(/^rgb/.test(v.IconColor)&&(C.fillColor=this._Color.rgbaStringToRgbaObj(v.IconColor)),C.fillColor.r>1&&(C.fillColor.r=C.fillColor.r/255),C.fillColor.g>1&&(C.fillColor.g=C.fillColor.g/255),C.fillColor.b>1&&(C.fillColor.b=C.fillColor.b/255),C.fillColor.a>1&&(C.fillColor.a=C.fillColor.a/255),C.fillColor=this._Color.createColor(C.fillColor.r,C.fillColor.g,C.fillColor.b,C.fillColor.a)))),!this._core.isnull(v)&&!this._core.isnull(v.LineColor)&&(v.LineColor.toString().charAt(0)=="["&&v.LineColor.toString().charAt(v.LineColor.length-1)=="]"||(this._core.isHtmlColor(v.LineColor)?C.outlineColor=this._Color.colorFromHtmlColor(v.LineColor):(/^rgb/.test(v.LineColor)&&(C.outlineColor=this._Color.rgbaStringToRgbaObj(v.LineColor)),C.outlineColor.r>1&&(C.outlineColor.r=C.outlineColor.r/255),C.outlineColor.g>1&&(C.outlineColor.g=C.outlineColor.g/255),C.outlineColor.b>1&&(C.outlineColor.b=C.outlineColor.b/255),C.outlineColor.a>1&&(C.outlineColor.a=C.outlineColor.a/255),C.outlineColor=this._Color.createColor(C.outlineColor.r,C.outlineColor.g,C.outlineColor.b,C.outlineColor.a)))),C=this._core.extend(C,v,!0);var w={position:this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),label:C};if(m&&m!==""){w.label.pixelOffset=this._cesium.defaultValue(v.pixelOffset,{x:30*(f.length/2+1),y:-30});var A={image:m,horizontalOrigin:this._cesium.defaultValue(v.ImageHorizontal,this._cesium.HorizontalOrigin.CENTER),verticalOrigin:this._cesium.defaultValue(v.ImageVertical,this._cesium.VerticalOrigin.BOTTOM),show:!0,scale:v.ImageScale||1,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(v.ImageMinViewingHeight||0,v.ImageMaxViewingHeight||99999999999999)};v.pixelOffset={x:0,y:0},A=this._core.extend(A,v,!1),w.billboard=A}this.item=this._viewer.entities.add(w);var E={id:this.item.id,name:C.text,pId:this._core.isnull(y)?0:y,type:"label",item:this};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(y)?0:y),this};jc.prototype.export=function(){var o=this.item.label.show==null?void 0:this.item.label.show._value,f=this.item.label.text==null?void 0:this.item.label.text._value,m=this.item.label.font==null?void 0:this.item.label.font._value,v=this.item.label.style==null?void 0:this.item.label.style._value,y=this.item.label.scale==null?void 0:this.item.label.scale._value,x=this.item.label.showBackground==null?void 0:this.item.label.showBackground._value,C=this.item.label.backgroundColor==null?void 0:"rgba("+this.item.label.backgroundColor._value.red+","+this.item.label.backgroundColor._value.green+","+this.item.label.backgroundColor._value.blue+","+this.item.label.backgroundColor._value.alpha+")",w=this.item.label.horizontalOrigin==null?void 0:this.item.label.horizontalOrigin._value,A=this.item.label.verticalOrigin==null?void 0:this.item.label.verticalOrigin._value,E=this.item.label.heightReference==null?void 0:this.item.label.heightReference._value,T=this.item.label.fillColor==null?void 0:"rgba("+this.item.label.fillColor._value.red+","+this.item.label.fillColor._value.green+","+this.item.label.fillColor._value.blue+","+this.item.label.fillColor._value.alpha+")",S=this.item.label.outlineColor==null?void 0:"rgba("+this.item.label.outlineColor._value.red+","+this.item.label.outlineColor._value.green+","+this.item.label.outlineColor._value.blue+","+this.item.label.outlineColor._value.alpha+")",M=this.item.label.outlineWidth==null?void 0:this.item.label.outlineWidth._value,I=this.item.label.distanceDisplayCondition,P=I?._value.near,D=I?._value.far,L=this._cesium.Cartographic.fromCartesian(this.item.position._value),R=this._cesium.Math.toDegrees(L.longitude),O=this._cesium.Math.toDegrees(L.latitude),F=this._cesium.Math.toDegrees(L.height);return{type:"label",position:{x:R,y:O,z:F},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:o,text:f,font:m,style:v,scale:y,showBackground:x,backgroundColor:C,horizontalOrigin:w,verticalOrigin:A,heightReference:E,fillColor:T,outlineColor:S,outlineWidth:M,near:P,far:D}}};jc.prototype.setTreeobj=function(o){this.treeobj=o};Object.defineProperties(jc.prototype,{position:{Altitude:{get:function(){return this._postion.Altitude},set:function(o){try{var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Math.toDegrees(f.height),x=this._cesium.Cartesian3.fromDegrees(m,v,o);this.item.position.position=x,this._postion.Altitude=o}catch(C){console.log(C)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(o){try{this._postion.AltitudeType=o}catch(f){console.log(f)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(o){try{this._postion.Cartesian=o}catch(f){console.log(f)}}},Distance:{get:function(){return this._postion.Distance},set:function(o){try{this._postion.Distance=o}catch(f){console.log(f)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(o){try{this._postion.Pitch=o}catch(f){console.log(f)}}},Roll:{get:function(){return this._postion.Roll},set:function(o){try{this._postion.Roll=o}catch(f){console.log(f)}}},X:{get:function(){return this._postion.X},set:function(o){try{this._postion.X=o;var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Math.toDegrees(f.height),x=this._cesium.Cartesian3.fromDegrees(o,v,y);this.item.position.position=x}catch(C){console.log(C)}}},Y:{get:function(){return this._postion.Y},set:function(o){try{this._postion.Y=o;var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Math.toDegrees(f.height),x=this._cesium.Cartesian3.fromDegrees(m,o,y);this.item.position.position=x}catch(C){console.log(C)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(o){try{this._postion.Yaw=o}catch(f){console.log(f)}}}},LabelStyle:{BackgroundColor:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.label.backgroundColor=o,this.item.backgroundColor=o)},500),get:function(){var o=this.item.label.backgroundColor;return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}},Bold:{get:function(){var o=this.item._label.font.getValue();return o.indexOf("bold")!=-1},set:function(){var o="bold "+this.item._label.font.getValue(),f=this.item._label.font.setValue(o)}},FontName:{get:function(){for(var o=this.item._label.font.getValue(),f=o.split(" "),m=0;m<f.length;m++)if(f[m]!="bold"&&f[m].indexOf("px")==-1&&f[m].indexOf("PX")==-1)return f[m]},set:function(o){for(var f=this.item._label.font.getValue(),m=f.split(" "),v=o,y=0;y<m.length;y++)m[y]!="bold"&&m[y].indexOf("px")==-1&&m[y].indexOf("PX")==-1||(v=v+" "+m[y]);var x=this.item._label.font.setValue(v)}},FontSize:{get:function(){for(var o=this.item._label.font.getValue(),f=o.split(" "),m=0;m<f.length;m++)if(f[m].indexOf("px")!=-1)return f[m]},set:function(o){for(var f=this.item._label.font.getValue(),m=f.split(" "),v=o,y=0;y<m.length;y++)m[y].indexOf("px")==-1||(v=v+" "+m[y]);var x=this.item._label.font.setValue(v)}},FrameFileName:{get:function(){return""},set:function(o){}},IconColor:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.label.fillColor=o)},500),get:function(){var o=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}},Italic:{get:function(){for(var o=this.item._label.font.getValue(),f=o.split(" "),m=0;m<f.length;m++)if(f[m].indexOf("italic")!=-1)return f[m]},set:function(o){for(var f=this.item._label.font.getValue(),m=f.split(" "),v=o,y=0;y<m.length;y++)m[y].indexOf("italic")==-1||(v=v+" "+m[y]);var x=this.item._label.font.setValue(v)}},LimitScreenSize:{get:function(){return""},set:function(o){}},LineColor:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.label.outlineColor=o)},500),get:function(){var o=this.item.label.outlineColor;return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}},LineToGround:{get:function(){return""},set:function(o){}},LockMode:{get:function(){return""},set:function(o){}},MaxImageSize:{get:function(){return""},set:function(o){}},MaxViewingHeight:{get:function(){if(this.item._label.distanceDisplayCondition!=null)return this.item._label.distanceDisplayCondition._value.far},set:function(o){var f=0;this.item._label.distanceDisplayCondition!=null&&(f=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(f,o)}},MinViewingHeight:{get:function(){if(this.item._label.distanceDisplayCondition!=null)return this.item._label.distanceDisplayCondition._value.near},set:function(o){var f=0;this.item._label.distanceDisplayCondition!=null&&(f=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,f)}},MultilineJustification:{get:function(){return""},set:function(o){}},PivotAlignment:{get:function(){return""},set:function(o){}},Scale:{get:function(){if(this.item._label.scale!=null)return this.item.label.scale.getValue()},set:function(o){this.item.label.scale.setValue(o)}},TextAlignment:{get:function(){return""},set:function(o){}},TextColor:{get:function(){return""},set:function(o){}},TextOnImage:{get:function(){return""},set:function(o){}},Underline:{get:function(){return""},set:function(o){}}}});var HD=jc;function ZO(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f)}ZO.prototype.createElevationContour=function(A,f,m){var v=this,y={};v.item=y;var x=this._core.defaultValue(m.min,-414),C=v._core.defaultValue(m.max,8844),w=(C-x)*.05;v.item.selectedShading=f;var A=A,E=v._viewer.scene.globe,T;return A?(f==="elevation"?(T=new v._cesium.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1}),v.item.shadingUniforms=T.materials.elevationRampMaterial.uniforms,v.item.shadingUniforms.minimumHeight=x,v.item.shadingUniforms.maximumHeight=C,v.item.contourUniforms=T.materials.contourMaterial.uniforms):f==="slope"?(T=new v._cesium.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1}),v.item.shadingUniforms=T.materials.slopeRampMaterial.uniforms,v.item.contourUniforms=T.materials.contourMaterial.uniforms):f==="aspect"?(T=new v._cesium.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1}),v.item.shadingUniforms=T.materials.aspectRampMaterial.uniforms,v.item.contourUniforms=T.materials.contourMaterial.uniforms):(T=v._cesium.Material.fromType("ElevationContour"),v.item.contourUniforms=T.uniforms),v.item.contourUniforms.width=v._core.defaultValue(m.width,2),v.item.contourUniforms.spacing=v._core.defaultValue(m.spacing,150),v.item.contourUniforms.color=v._cesium.Color.fromCssColorString(v._core.defaultValue(m.lineColor,"#ff0000"))):f==="elevation"?(T=v._cesium.Material.fromType("ElevationRamp"),v.item.shadingUniforms=T.uniforms,v.item.shadingUniforms.minimumHeight=x,v.item.shadingUniforms.maximumHeight=C):f==="slope"?(T=v._cesium.Material.fromType("SlopeRamp"),v.item.shadingUniforms=T.uniforms):f==="aspect"&&(T=v._cesium.Material.fromType("AspectRamp"),v.item.shadingUniforms=T.uniforms),f!=="none"&&(m?v.item.shadingUniforms.image=v._core.getColorRamp(f,m.colorArr,m.min,m.max):v.item.shadingUniforms.image=v._core.getColorRamp(f)),E.material=void 0,v._viewer.render(),E.material=T,v.item.material=E.material,this};ZO.prototype.executeMaterial=function(o){var f=this,m={};f.item=m;var v=-414,y=8777;f.item.selectedShading=o,f.item.shadingUniforms={};var x=this._viewer.scene.globe,C;return f.item.selectedShading==="elevation"?(C=this._cesium.Material.fromType("ElevationRamp"),f.item.shadingUniforms=C.uniforms,f.item.shadingUniforms.minHeight=v,f.item.shadingUniforms.maxHeight=y):f.item.selectedShading==="slope"?(C=this._cesium.Material.fromType("SlopeRamp"),f.item.shadingUniforms=C.uniforms):f.item.selectedShading==="aspect"&&(C=this._cesium.Material.fromType("AspectRamp"),f.item.shadingUniforms=C.uniforms),f.item.selectedShading!=="none"&&(f.item.shadingUniforms.image=this._core.getColorRamp(f.item.selectedShading)),x.material=C,f.item.material=x.material,this};ZO.prototype.setSpacing=function(o){try{this.item.contourUniforms.spacing=parseFloat(o)}catch(f){console.log(f)}return this};ZO.prototype.setMaterialColor=function(o){try{this.item.contourUniforms.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o)}catch(f){console.log(f)}return this};ZO.prototype.setWidth=function(o){try{this.item.contourUniforms.width=parseFloat(o)}catch(f){console.log(f)}return this};ZO.prototype.executeContourMaterial=function(o){var f=this,m={};f.item=m;var v=-414,y=8777;f.item.selectedShading=o;var x=f._viewer.scene.globe,C;return f.item.selectedShading==="elevation"?(C=new this._cesium.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1}),f.item.shadingUniforms=C.materials.elevationRampMaterial.uniforms,f.item.shadingUniforms.minHeight=v,f.item.shadingUniforms.maxHeight=y,f.item.contourUniforms=C.materials.contourMaterial.uniforms):f.item.selectedShading==="slope"?(C=getSlopeContourMaterial(),f.item.shadingUniforms=C.materials.slopeRampMaterial.uniforms,f.item.contourUniforms=C.materials.contourMaterial.uniforms):f.item.selectedShading==="aspect"?(C=getAspectContourMaterial(),f.item.shadingUniforms=C.materials.aspectRampMaterial.uniforms,f.item.contourUniforms=C.materials.contourMaterial.uniforms):(C=this._cesium.Material.fromType("ElevationContour"),f.item.contourUniforms=C.uniforms),f.item.selectedShading!=="none"&&(f.item.shadingUniforms.image=this._core.getColorRamp(f.item.selectedShading)),f.item.contourUniforms.width=2,f.item.contourUniforms.spacing=150,f.item.contourUniforms.color=this._cesium.Color.fromRandom({alpha:1},this._cesium.Color.RED.clone()),x.material=C,f.item.material=x.material,this};Object.defineProperties(ZO.prototype,{elevation:{get:function(){return this.item},set:function(o){this.item=o}}});var L8=ZO;var x5i=null;function jct(o,f){x5i=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._polyline=void 0,this._polygon=void 0,this._box=new zD(o,f),this._ellipsoid=new QO(o,f),this._rectangle=new NT(o,f),this._circle=new RP(o,f),this._point=void 0,this._label=new HD(o,f),this._dynamicObject=new WO(o,f),this._elevationContour=new L8(o,f),this._cone=new X0(o,f)}jct.prototype.execute=function(o,f,m={},v){var y=this._viewer,x=this._cesium;this._point=new yb(y,x),this._polyline=new _g(y,x),this._polygon=new gg(y,x);var C=this._core,w={polyline:{},positions:[],distance:[]};if(w.setDistance=function(){alert("qq")},o==0&&f==0)return this._polyline.executePolyline(m,v);if(o==4&&f==1)return this._elevationContour.executeContourMaterial(v);if(o==0&&f==1)return this._polygon.executePolygon(m,v);if(o==0&&f==11)return this._polygon.executePolygonvideo(v,m);if(o==1&&f==1)return this._box.executeBox(v);if(o==1&&f==2)return this._cone.executeCone(v);if(o==1&&f==3)return this._cone.executeCylinder(v);if(o==1&&f==4)return this._ellipsoid.executeEllipsoid(v);if(o==1&&f==5)return this._rectangle.createRectangle(m,v);if(o==1&&f==6)return this._circle.executeClircle(v);if(o==1&&f==7)return this._polygon.executeSector(v,m);if(o==1&&f==8)return this._box.executeExcavation(m,v);if(o==1&&f==9)return this._box.executeExcavation(m,v);if(o==1&&f==10)return this._circle.executeClirclews(v);if(o==1&&f==11)return this._point.executePoint(v,m);if(o==1&&f==12)return this._rectangle.createRectangledxkz(v);if(o==0&&f==2)return this._polyline.executeHorizontals(v,m);if(o==0&&f==3)return this._polygon.executePolygoncl(v,m);if(o==0&&f==4)return this._polyline.executeHorizontal(v,m);if(o==0&&f==10)return this._polyline.executePolyline1(v,m);if(o==0&&f==5)return this._polyline.executeHeightTe(v,m);if(o==0&&f==6)return this._polyline.executeAnge(v,m);if(o==0&&f==9)return this._polyline.executeAngeSd(v,m);if(!(o==0&&f==7)){if(o==0&&f==8)return this._polygon.surfaceArea(m,v);if(o==0&&f==12)return this._polyline.executeAngle(v,m);if(o==0&&f==13)this._point.executePointp(v,m);else{if(o==2&&f==0)return this._polyline.executeProfile(m,v);if(o==2&&f==1)return this._polygon.executePolygonym(v);if(o==2&&f==2)return new gg(y,x).executePolygonymsd(m,v);if(o==2&&f==3)return this._dynamicObject.executeFlycesium(v);if(o==2&&f==4)return this._polygon.executePolygonymsdtt(m,v);if(o==2&&f==5)return this._rectangle.createRectanglelbj(m,v);if(o==2&&f==6)return this._polyline.executeProfilePro(m,v);if(o==3&&f==0){if(m!=""&&m!=null){var A=new Date(m),E=x.JulianDate.fromDate(A);y.clock.currentTime=E.clone()}}else if(o==3&&f==1)this._viewer.animation.viewModel.faster();else if(o==3&&f==2)this._viewer.animation.viewModel.slower();else if(o==3&&f==3)this._viewer.animation.viewModel.playForwardViewModel.command();else if(o==3&&f==4)this._viewer.animation.viewModel.playReverseViewModel.command();else if(o==3&&f==5)this._viewer.animation.viewModel.pauseViewModel.command();else if(o==3&&f==6){var T=x.Cartographic.fromCartesian(m),S=x.Math.toDegrees(T.longitude),M=x.Math.toDegrees(T.latitude),I=T.height,P={lon:S,lat:M,hei:I};return P}}}};var Yct=jct;function qct(o,f){this._viewer=o,this._cesium=f,this._execute=new Yct(this._viewer,this._cesium)}qct.prototype.execute=function(o,f,m,v){return this._execute.execute(o,f,m,v)};var Xct=qct;var Jct=`// author: \u5F20\u4E39\u948A vec4 toEye(in vec2 uv, in float depth){ vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0)); vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0); posInCamera =posInCamera / posInCamera.w; return posInCamera; } float getDepth(in vec4 depth){ float z_window = czm_unpackDepth(depth); z_window = czm_reverseLogDepth(z_window); float n_range = czm_depthRange.near; float f_range = czm_depthRange.far; return (2.0 * z_window - n_range - f_range) / (f_range - n_range); } mat4 inverse_mat4(mat4 m) { float Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; float Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; float Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; float Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; float Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; float Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; float Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; float Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; float Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; float Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; float Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; float Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; float Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; float Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; float Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; float Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; float Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; float Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; const vec4 SignA = vec4( 1.0, -1.0, 1.0, -1.0); const vec4 SignB = vec4(-1.0, 1.0, -1.0, 1.0); vec4 Fac0 = vec4(Coef00, Coef00, Coef02, Coef03); vec4 Fac1 = vec4(Coef04, Coef04, Coef06, Coef07); vec4 Fac2 = vec4(Coef08, Coef08, Coef10, Coef11); vec4 Fac3 = vec4(Coef12, Coef12, Coef14, Coef15); vec4 Fac4 = vec4(Coef16, Coef16, Coef18, Coef19); vec4 Fac5 = vec4(Coef20, Coef20, Coef22, Coef23); vec4 Vec0 = vec4(m[1][0], m[0][0], m[0][0], m[0][0]); vec4 Vec1 = vec4(m[1][1], m[0][1], m[0][1], m[0][1]); vec4 Vec2 = vec4(m[1][2], m[0][2], m[0][2], m[0][2]); vec4 Vec3 = vec4(m[1][3], m[0][3], m[0][3], m[0][3]); vec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); vec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); vec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); vec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); mat4 Inverse = mat4(Inv0, Inv1, Inv2, Inv3); vec4 Row0 = vec4(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); float Determinant = dot(m[0], Row0); Inverse /= Determinant; return Inverse; } uniform sampler2D colorTexture; uniform sampler2D depthTexture; in vec2 v_textureCoordinates; uniform vec3 cen; uniform vec3 position; uniform vec3 eupp; uniform vec3 angle; uniform vec4 nearAndFar; uniform sampler2D video; uniform vec4 visible; uniform vec4 unvisible; uniform float type; uniform sampler2D stcshadow; uniform mat4 _shadowMap_matrix; uniform vec4 shadowMap_lightPositionEC; uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; mat4 computeMat(){ vec3 dir = normalize( position - cen ); vec3 up = normalize( eupp - cen);//vec3( 0. ,0. , 1.); vec3 right = cross(dir , up); right = normalize(right); up = cross(right , dir); up = normalize(up); return mat4( right.x,right.y,right.z,0., up.x,up.y,up.z,0., dir.x,dir.y,dir.z,0., cen.x,cen.y,cen.z,1. ); // return mat4( // right.x ,up.x ,dir.x , cen.x, // right.y ,up.y ,dir.y , cen.y, // right.z ,up.z ,dir.z , cen.z, // 0. ,0.,0.,1. // ); } mat3 computeMat3(float an){ float sa = sin(an); float ca = cos(an); return mat3( ca , -sa ,0., sa , ca , 0., 0.,0.,1. ); } void main(){ vec2 uv = v_textureCoordinates; float depth = getDepth(texture( depthTexture , uv)); vec4 oc = texture(colorTexture , uv); vec4 ec = toEye( uv , depth); ec /= ec.w; vec3 snor = normalize(position - cen); vec3 pd = ec.xyz - cen; float dd = length(pd); vec3 n = normalize(ec.xyz - cen); float d = dot(n , snor); mat4 localMat = computeMat(); vec4 p = inverse_mat4(localMat) * ec; p /= p.w; if( p.z < nearAndFar.x || p.z > nearAndFar.y){ out_FragColor = oc; return; } vec3 pp = p.xyz; mat3 rm = computeMat3( radians( angle.z ) ); pp = rm * pp; vec3 nn = pp.xyz; vec3 zn = vec3(0.,0.,1.); float dist = dot( nn , zn); float dx = pp.x ; float xangle = tan(radians( angle.x )); float yangle = tan(radians( angle.y )); float tanx = pp.x / dist; float tany = pp.y / dist; if( (tanx > -xangle && tanx< xangle) &&(tany > -yangle && tany < yangle)){ czm_shadowParameters shadowParameters; shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; shadowParameters.depthBias *= max(depth * 0.01, 1.0); vec3 directionEC = normalize(ec.xyz - shadowMap_lightPositionEC.xyz); vec3 normalEC = vec3(1.0); float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0); vec4 shadowPosition = _shadowMap_matrix * ec; shadowPosition /= shadowPosition.w; shadowParameters.texCoords = shadowPosition.xy; shadowParameters.depth = shadowPosition.z; shadowParameters.nDotL = nDotL; float visibility = czm_shadowVisibility(stcshadow, shadowParameters); if(type == 0.0){ if(visibility == 1.0){ out_FragColor = mix(oc , visible , nearAndFar.z); }else{ out_FragColor = mix(oc , unvisible , nearAndFar.z); } }else{ if(visibility == 1.0){ float r = (tanx + xangle) / (2. * xangle); float g = (tany + yangle) / (2. * yangle); vec4 col = texture( video , vec2( r , g)); float f1 = 1.; float v1 = nearAndFar.w ;//\u7FBD\u5316\u8DDD\u79BB float v2 = 1. - v1; if(r < v1){ f1 = r / v1; } if(r > v2){ f1 = (1. - r) / v1; } float f2 = 1.; if(g < v1){ f2 = g / v1; } if(g > v2){ f2 = (1. - g) / v1; } float f12 = f1 * f2; float ff = smoothstep( 0. , 1. , f12 ); ff *= nearAndFar.z; out_FragColor = mix(oc , col , ff); }else{ out_FragColor = oc; } } }else{ out_FragColor = oc; } } `;var Sle=null,cs=null;function LC(o,f,m){cs=m,Sle=new Sr(o,m),this._viewer=o,this.video=f.video,this.viewshed=f.viewshed||{},this.cameraPosition=f.cameraPosition.x&&f.cameraPosition.y&&f.cameraPosition.z?f.cameraPosition:cs.Cartesian3.fromDegrees(f.cameraPosition.lon,f.cameraPosition.lat,f.cameraPosition.height),this.position=f.position&&(f.position instanceof cs.Cartesian3?f.position:cs.Cartesian3.fromDegrees(f.position.lon,f.position.lat,f.position.height)),this.heading=f.heading||0,this.pitch=f.pitch||0,this.alpha=f.alpha||.9,this.horizonAngle=f.horizonAngle||60,this.verticalAngle=f.verticalAngle||40,this.angle=new cs.Cartesian3(this.horizonAngle/2,this.verticalAngle/2,0),this.near=Sle.defaultValue(f.near,1),this.far=f.far||30,this.showFarScale=f.showFarScale||5,this.offset=0,this.show=!0,this.video&&(this.offset=Sle.defaultValue(f.video.offset,.1)),this.viewshed.visible=cs.Color.fromCssColorString(this.viewshed.visible||"#00ff00"),this.viewshed.unvisible=cs.Color.fromCssColorString(this.viewshed.unvisible||"#ff0000"),this.nearAndFar=new cs.Cartesian4(this.near,this.far,this.alpha,this.offset),this.center=new cs.Cartesian3,this.eupp=new cs.Cartesian3,this.epp=new cs.Cartesian3,this.upp=this.setSpHeight(this.cameraPosition),this.useLine=cs.defaultValue(f.useLine,!0),this._viewer.scene.primitives.add(this),this.init()}LC.prototype.createViewCone=function(){if(this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),!this.useLine)return;let o=this.viewShadowMap._lightCamera;this.line=new cs.Primitive({geometryInstances:new cs.GeometryInstance({geometry:new cs.FrustumOutlineGeometry({origin:o.positionWC,orientation:this.orientationData,frustum:o.frustum}),attributes:{color:cs.ColorGeometryInstanceAttribute.fromColor(cs.Color.fromCssColorString("#fff"))}}),appearance:new cs.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._viewer.scene.primitives.add(this.line)};LC.prototype.isShow=function(){return this.show&&Sle.getPointToCameraDistance(this._viewer,this.cameraPosition)<this.far*this.showFarScale};LC.prototype.init=function(){if(this.post&&this.texture)return;if(!(this.upp instanceof cs.Cartesian3))throw new Error("\u8BA1\u7B97\u4E0A\u65B9\u5411\u9519\u8BEF");this._createShadowMap(),this.createViewCone();let o=this.video&&this.video.container,f=this,m=this._viewer.scene.context.uniformState,v=this.viewShadowMap._isPointLight?this.viewShadowMap._pointBias:this.viewShadowMap._primitiveBias,y=0;o&&(this.texture=new cs.Texture({context:this._viewer.scene.context,source:o,width:1,height:1}),y=1),this.post=new cs.PostProcessStage({uniforms:{type:function(){return y},cen:function(){return cs.Matrix4.multiplyByPoint(m.view3D,f.cameraPosition,f.center)},position:function(){return cs.Matrix4.multiplyByPoint(m.view3D,f.videoCenter,f.epp)},eupp:function(){return cs.Matrix4.multiplyByPoint(m.view3D,f.upp,f.eupp)},video:function(){return o&&o.readyState>=2&&!f.isPause&&f.texture.copyFrom({source:o}),f.texture||f._viewer.scene.context.defaultTexture},visible:function(){return f.viewshed.visible},unvisible:function(){return f.viewshed.unvisible},angle:function(){return f.angle},nearAndFar:function(){return f.nearAndFar},_shadowMap_matrix:function(){return f.viewShadowMap._shadowMapMatrix},shadowMap_lightPositionEC:function(){return f.viewShadowMap._lightPositionEC},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let x=new cs.Cartesian2;return x.x=1/f.viewShadowMap._textureSize.x,x.y=1/f.viewShadowMap._textureSize.y,cs.Cartesian4.fromElements(x.x,x.y,v.depthBias,v.normalShadingSmooth)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return cs.Cartesian4.fromElements(v.normalOffsetScale,f.viewShadowMap._distance,f.viewShadowMap.maximumDistance,f.viewShadowMap._darkness)},stcshadow:function(){return f.viewShadowMap._shadowMapTexture}},fragmentShader:Jct}),this._viewer.scene.postProcessStages.add(this.post)};LC.prototype._createShadowMap=function(){let o=new cs.Camera(this._viewer.scene);if(o.frustum.fov=cs.Math.toRadians(this.horizonAngle),o.frustum.aspectRatio=this.horizonAngle/this.verticalAngle,o.frustum.near=this.near,o.frustum.far=this.far,this.position){o.position=this.cameraPosition,o.direction=cs.Cartesian3.subtract(this.position,this.cameraPosition,new cs.Cartesian3(0,0,0)),o.up=cs.Cartesian3.normalize(this.cameraPosition,new cs.Cartesian3(0,0,0));let w=cs.Cartesian3.normalize(cs.Cartesian3.subtract(this.position,this.cameraPosition,new cs.Cartesian3),new cs.Cartesian3);o.direction=w,this.heading=cs.Math.toDegrees(o.heading),this.pitch=cs.Math.toDegrees(o.pitch)}else o.setView({destination:this.cameraPosition,orientation:{heading:cs.Math.toRadians(this.heading),pitch:cs.Math.toRadians(this.pitch),roll:0}});let f=new cs.Cartesian3,m=new cs.Matrix3,v=new cs.Quaternion,y=o.upWC,x=o.rightWC;x=cs.Cartesian3.negate(x,f);let C=m;if(cs.Matrix3.setColumn(C,0,x,C),cs.Matrix3.setColumn(C,1,y,C),cs.Matrix3.setColumn(C,2,o.direction,C),this.orientationData=cs.Quaternion.fromRotationMatrix(C,v),!this.position){let w=new Float64Array(24);cs.FrustumGeometry._computeNearFarPlanes(o.positionWC,this.orientationData,0,o.frustum,w);let A=new cs.Cartesian3;for(let E=12;E<w.length;E+=3)A.x+=w[E],A.y+=w[E+1],A.z+=w[E+2];cs.Cartesian3.multiplyByScalar(A,1/4,A),this.position=A}this.videoCenter=this.position,this.position=null,this.viewShadowMap=new cs.ShadowMap({lightCamera:o,enabled:!1,isPointLight:!1,isSpotLight:!0,cascadesEnabled:!1,context:this._viewer.scene.context,pointLightRadius:this.far}),this.viewShadowMap.guid=cs.createGuid()};LC.prototype.flyTo=function(){if(this.viewShadowMap&&this.viewShadowMap._lightCamera){let o=this.viewShadowMap._lightCamera;this._viewer.camera.flyTo({destination:o.position,orientation:{heading:o.heading,pitch:o.pitch,roll:0}})}};LC.prototype.updatePost=function(o){o.cameraPosition&&(this.cameraPosition=o.cameraPosition instanceof cs.Cartesian3?o.cameraPosition:cs.Cartesian3.fromDegrees(o.cameraPosition.lon,o.cameraPosition.lat,o.cameraPosition.height)),o.position&&(this.position=o.position instanceof cs.Cartesian3?o.position:cs.Cartesian3.fromDegrees(o.position.lon,o.position.lat,o.position.height)),!isNaN(o.heading)&&typeof o.heading=="number"&&(this.heading=o.heading),!isNaN(o.pitch)&&typeof o.pitch=="number"&&(this.pitch=o.pitch),!isNaN(o.alpha)&&typeof o.alpha=="number"&&(this.alpha=o.alpha),!isNaN(o.horizonAngle)&&typeof o.horizonAngle=="number"&&(this.horizonAngle=o.horizonAngle,this.angle.x=this.horizonAngle/2),!isNaN(o.verticalAngle)&&typeof o.verticalAngle=="number"&&(this.verticalAngle=o.verticalAngle,this.angle.y=this.verticalAngle/2),!isNaN(o.near)&&typeof o.near=="number"&&(this.near=o.near,this.nearAndFar.x=this.near),!isNaN(o.far)&&typeof o.far=="number"&&(this.far=o.far,this.nearAndFar.y=this.far),!isNaN(o.offset)&&typeof o.offset=="number"&&(this.nearAndFar.w=o.offset,this.offset=o.offset),!isNaN(o.alpha)&&typeof o.alpha=="number"&&(this.nearAndFar.z=o.alpha,this.alpha=o.alpha),!isNaN(o.showFarScale)&&typeof o.showFarScale=="number"&&(this.showFarScale=o.showFarScale),o.useLine!==void 0&&(this.useLine=o.useLine),this._createShadowMap(),this.createViewCone()};LC.prototype.update=function(o){if(this.viewShadowMap&&this.show){let f=this.isShow();this.post&&(this.post.enabled=f),this.line&&(this.line.show=f),f&&this._viewer.scene.frameState.shadowMaps.push(this.viewShadowMap)}};LC.prototype.setVisibility=function(o){this.show=o,this.post&&(this.post.enabled=o),this.line&&(this.line.show=o)};LC.prototype.destroy=function(){if(this.post){this._viewer.scene.postProcessStages.remove(this.post);try{this.post.destroy()}catch{}this.post=void 0}return this.texture&&(this.texture.destroy(),this.texture=void 0),this._viewer.scene.primitives.remove(this),this.shadowMaps&&this.shadowMaps.destroy(),this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),cs.destroyObject(this)};LC.prototype.setSpHeight=function(o,f=5e3){let m=cs.Cartographic.fromCartesian(o);return m.height+=f,cs.Cartographic.toCartesian(m)};LC.prototype.changeHorizonAngle=function(o){this.updatePost({horizonAngle:parseFloat(o)})};LC.prototype.changeVerticalAngle=function(o){this.updatePost({verticalAngle:parseFloat(o)})};LC.prototype.changeRotateAngle=function(o){this.updatePost({angleZ:parseFloat(o)})};var sJ=LC;var Kct=null,al=null;function WT(o,f,m){al=m,Kct=new Sr(o,m),this._viewer=o,this.type=f.type,this.videoContainer=f.videoContainer||f.video&&f.video.container,this.prop=f.prop,this.cameraPosition=f.cameraPosition.x&&f.cameraPosition.y&&f.cameraPosition.z?f.cameraPosition:al.Cartesian3.fromDegrees(f.cameraPosition.lon,f.cameraPosition.lat,f.cameraPosition.height),this.position=f.position&&(f.position instanceof al.Cartesian3?f.position:al.Cartesian3.fromDegrees(f.position.lon,f.position.lat,f.position.height)),this.heading=f.heading||0,this.pitch=f.pitch||0,this.alpha=f.alpha||.9,this.horizonAngle=f.horizonAngle||60,this.verticalAngle=f.verticalAngle||40,this.far=f.far||30,this.showFarScale=f.showFarScale||5,this.show=!0,this.useLine=al.defaultValue(f.useLine,!0),this._viewer.scene.primitives.add(this),this.init()}WT.prototype.createViewCone=function(){this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),this.useLine&&(this.line=new al.Primitive({geometryInstances:new al.GeometryInstance({geometry:new al.FrustumOutlineGeometry(this.cameraData),attributes:{color:al.ColorGeometryInstanceAttribute.fromColor(al.Color.WHITE)}}),appearance:new al.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._viewer.scene.primitives.add(this.line))};WT.prototype.createVideoPlane=function(){let o=new Float64Array(24);al.FrustumGeometry._computeNearFarPlanes(this.cameraData.origin,this.cameraData.orientation,0,this.cameraData.frustum,o);let f=[];for(let v=12;v<o.length;v+=3)f.push(o[v],o[v+1],o[v+2]);this.plan&&this.plan.destroy();let m=al.Material.fromType("Image");m.uniforms.image=this.videoContainer,m.uniforms.color.alpha=this.alpha,this.plan=new al.Primitive({geometryInstances:new al.GeometryInstance({geometry:new al.Geometry({attributes:{position:new al.GeometryAttribute({componentDatatype:al.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f}),st:new al.GeometryAttribute({componentDatatype:al.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:[0,1,2,0,2,3],primitiveType:al.PrimitiveType.TRIANGLES,boundingSphere:al.BoundingSphere.fromVertices(f)}),id:this.prop}),appearance:new al.MaterialAppearance({flat:!0,material:m})})};WT.prototype.isShow=function(){return this.show&&Kct.getPointToCameraDistance(this._viewer,this.cameraPosition)<this.far*this.showFarScale};WT.prototype.init=function(){this.plan||(this.createCamera(),this.createVideoPlane(),this.createViewCone())};WT.prototype.createCamera=function(){let o=this.videoCamera||new al.Camera(this._viewer.scene);if(o.frustum.fov=al.Math.toRadians(this.horizonAngle),o.frustum.aspectRatio=this.horizonAngle/this.verticalAngle,o.frustum.near=1,o.frustum.far=this.far,this.position){o.position=this.cameraPosition,o.direction=al.Cartesian3.subtract(this.position,this.cameraPosition,new al.Cartesian3(0,0,0)),o.up=al.Cartesian3.normalize(this.cameraPosition,new al.Cartesian3(0,0,0));let E=al.Cartesian3.normalize(al.Cartesian3.subtract(this.position,this.cameraPosition,new al.Cartesian3),new al.Cartesian3);o.direction=E,this.heading=al.Math.toDegrees(o.heading),this.pitch=al.Math.toDegrees(o.pitch),this.position=null}else o.setView({destination:this.cameraPosition,orientation:{heading:al.Math.toRadians(this.heading),pitch:al.Math.toRadians(this.pitch),roll:0}});let f=new al.Cartesian3,m=new al.Matrix3,v=new al.Quaternion,y=o.positionWC,x=o.upWC,C=o.rightWC;C=al.Cartesian3.negate(C,f);let w=m;al.Matrix3.setColumn(w,0,C,w),al.Matrix3.setColumn(w,1,x,w),al.Matrix3.setColumn(w,2,o.direction,w);let A=al.Quaternion.fromRotationMatrix(w,v);this.videoCamera=o,this.cameraData={orientation:A,origin:y,frustum:o.frustum}};WT.prototype.flyTo=function(){this.videoCamera&&this._viewer.camera.flyTo({destination:this.videoCamera.position,orientation:{heading:this.videoCamera.heading,pitch:this.videoCamera.pitch,roll:0}})};WT.prototype.updatePost=function(o){o.cameraPosition&&(this.cameraPosition=o.cameraPosition instanceof al.Cartesian3?o.cameraPosition:al.Cartesian3.fromDegrees(o.cameraPosition.lon,o.cameraPosition.lat,o.cameraPosition.height)),o.position&&(this.position=o.position instanceof al.Cartesian3?o.position:al.Cartesian3.fromDegrees(o.position.lon,o.position.lat,o.position.height)),!isNaN(o.heading)&&typeof o.heading=="number"&&(this.heading=o.heading),!isNaN(o.pitch)&&typeof o.pitch=="number"&&(this.pitch=o.pitch),!isNaN(o.alpha)&&typeof o.alpha=="number"&&(this.alpha=o.alpha),!isNaN(o.horizonAngle)&&typeof o.horizonAngle=="number"&&(this.horizonAngle=o.horizonAngle),!isNaN(o.verticalAngle)&&typeof o.verticalAngle=="number"&&(this.verticalAngle=o.verticalAngle),!isNaN(o.far)&&typeof o.far=="number"&&(this.far=o.far),!isNaN(o.showFarScale)&&typeof o.showFarScale=="number"&&(this.showFarScale=o.showFarScale),o.useLine!==void 0&&(this.useLine=o.useLine),o.prop&&(this.prop=o.prop),this.createCamera(),o.type.indexOf("h265")>=0?this.createCanvasPlane():this.createVideoPlane(),this.createViewCone()};WT.prototype.update=function(o){if(this.plan&&this.show){let f=this.isShow();this.plan&&(this.plan.show=f),this.line&&(this.line.show=f),this.plan.update(o)}};WT.prototype.setVisibility=function(o){this.show=o,this.plan&&(this.plan.show=o),this.line&&(this.line.show=o)};WT.prototype.destroy=function(){return this.plan&&(this.plan.destroy(),this.plan=void 0),this._viewer.scene.primitives.remove(this),this.line&&(this._viewer.scene.primitives.remove(this.line),this.line=null),al.destroyObject(this)};var Qct=WT;var C5i=null;function wA(o,f){C5i=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this.isPause=!1,this.isLoad=!1}wA.prototype.Video3D=function(o){return this.url=o.url,this.options=o,this.videoContainer=o.video||void 0,this.videoType=o.type||"mp4",this.video2D=o.video2D,this.options.video={container:this.videoContainer,offset:o.offset},o.type&&o.type.indexOf("h265")>=0?this.addDiv(o.success):this.addVideo(o.success),this};wA.prototype.addDiv=function(o){let f="Video3D"+this._core.getuid(),m=`<div id="${f}" style="display: none"></div>`;$(this._viewer.container).append(m),this.divContainer=document.getElementById(f),this.load(),o(this)};wA.prototype.addVideo=function(o){if(this.videoContainer){this.videoContainer.oncanplay=()=>{this.init&&this.init()};return}let f="Video3D"+this._core.getuid(),m=`<video id="${f}" autoplay muted loop crossorigin style="display: none"></video>`;$(this._viewer.container).append(m),this.videoContainer=document.getElementById(f),this.options.video.container=this.videoContainer,this.load(),this.videoContainer.oncanplay=()=>{this.thisVideo||(this.init&&this.init(),o&&o(this))}};wA.prototype.load=function(){let o=this.url;if(this.videoType==="hls"){if(window.Hls||new Y0(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/hls.js"),this.videoContainer.canPlayType("application/vnd.apple.mpegurl"))this.videoContainer.src=o;else if(Hls.isSupported()){var f=new Hls;f.loadSource(o),f.attachMedia(this.videoContainer),this.player=f}}else if(this.videoType==="flv"){if(window.flvjs||new Y0(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/flv.js"),flvjs.isSupported()){var m=flvjs.createPlayer({type:"flv",url:o});m.attachMediaElement(this.videoContainer),m.load(),this.player=m}}else if(this.videoType==="flv-h265"){if(window.WasmPlayer||new Y0(!1).addJs(document.body,window.SmartEarthRootUrl+"Workers/EasyWasmPlayer.js"),window.WasmPlayer){let v=this;this.player=new WasmPlayer(null,this.divContainer.id,function(){v.thisVideo||v.init&&v.init()},{Height:!0}),this.videoContainer=this.player.canvas,this.options.video.container=this.videoContainer,this.player.play(o,1)}}else this.videoContainer.src=o,this.thisVideo&&(this.videoContainer.load(),this.videoContainer.play());this.isLoad=!0};wA.prototype.pause=function(){this.videoType!=="mp4"&&(this.isLoad=!1),this.player&&this.player.destroy(),this.videoContainer.pause()};wA.prototype.flyTo=function(){this.thisVideo&&this.thisVideo.flyTo()};wA.prototype.play=function(){this.isLoad||this.load(),this.videoContainer.play()};wA.prototype.init=function(){this.thisVideo||(!this.isPause&&this.videoContainer&&this.videoContainer.readyState===this.videoContainer.HAVE_ENOUGH_DATA&&this.play(),this.video2D?this.thisVideo=new Qct(this._viewer,this.options,this._cesium):this.thisVideo=new sJ(this._viewer,this.options,this._cesium))};wA.prototype.updateVideo=function(o){(o.url||o.type)&&(o.type&&(this.videoType=o.type),o.url&&(this.url=o.url),o.url&&(this.pause(),this.load(),this.videoContainer.oncanplay=()=>{this.play()})),this.thisVideo&&this.thisVideo.updatePost(o)};wA.prototype.setVisibility=function(o){this.thisVideo&&this.thisVideo.setVisibility(o)};wA.prototype.destroy=function(){this.thisVideo&&this.thisVideo.destroy(),this.thisVideo=null,this.player&&this.player.destroy&&this.player.destroy(),this.videoContainer&&this.videoContainer.remove()};var Ple=wA;function AA(o,f,m){this._viewer=f,this._cesium=m,this._core=new Sr(f,m),this.particleType=o||"",this.particlePrimitives={}}AA.prototype.createParticleEffect=function(o,f,m){switch(this._viewer.clockViewModel.shouldAnimate||(this._viewer.clockViewModel.shouldAnimate=!0),this.particleType){case"fireworks":this.createFireworks(o,f,m);break;case"smog":this.createSmog(o,f,m);break;case"fountain":this.createFountain(o,f,m);break;case"flame":this.createFlame(o,f,m);break;case"blast":this.createBlast(o,f,m);break}return this};AA.prototype.deleteObject=function(){let o=this._viewer.scene,f=this.particleType,m=this.particlePrimitives[f];m&&m.length&&(m.forEach(v=>{o.primitives.remove(v)}),this.particlePrimitives[f]=[])};AA.prototype.remove=function(){let o=this._viewer.scene,f=this.particleType,m=this.particlePrimitives[f];m&&m.length&&(m.forEach(v=>{o.primitives.remove(v)}),this.particlePrimitives[f]=[])};AA.prototype.createFireworks=function(o,f,m){var v=this._viewer.scene,y=this._viewer,x=this._cesium;let C=this.particleType;f||(f={}),x.Math.setRandomNumberSeed(315);var w=this.computeModelMatrix(o),A=new x.Cartesian3(0,0,100),E;function T(){if(!x.defined(E)){E=document.createElement("canvas"),E.width=20,E.height=20;var ve=E.getContext("2d");ve.beginPath(),ve.arc(8,8,8,0,x.Math.TWO_PI,!0),ve.closePath(),ve.fillStyle="rgb(255, 255, 255)",ve.fill()}return E}var S=x.defaultValue(f.minSize,30),M=x.defaultValue(f.maxSize,100),I=x.defaultValue(f.size,7),P=new x.Cartesian2(I,I),D=400,L=10,R=x.defaultValue(f.num,20),O=new x.Matrix4;function F(ve,pe,ce){var he=x.Cartesian3.add(A,ve,new x.Cartesian3),Ce=x.Matrix4.fromTranslation(he,O),Se=x.Matrix4.multiply(w,Ce,new x.Matrix4),De=x.Matrix4.inverseTransformation(Se,Se),Oe=x.Math.randomBetween(S,M),Ue=new x.Cartesian3,Xe=function(Qe){var ft=x.Matrix4.multiplyByPoint(De,Qe.position,Ue);x.Cartesian3.magnitudeSquared(ft)>=Oe*Oe&&x.Cartesian3.clone(x.Cartesian3.ZERO,Qe.velocity)},it=(Oe-S)/(M-S),ut=.3,at=1,Pt=it*(at-ut)+ut;return v.primitives.add(new x.ParticleSystem({image:T(),startColor:pe,endColor:pe.withAlpha(0),particleLife:Pt,speed:100,imageSize:P,emissionRate:0,emitter:new x.SphereEmitter(.1),bursts:ce,lifetime:L,updateCallback:Xe,modelMatrix:w,emitterModelMatrix:Ce}))}for(var k=-100,U=100,G=-80,j=100,q=-50,J=50,X=[{minimumRed:.75,green:0,minimumBlue:.8,alpha:1},{red:0,minimumGreen:.75,minimumBlue:.8,alpha:1},{red:0,green:0,minimumBlue:.8,alpha:1},{minimumRed:.75,minimumGreen:.75,blue:0,alpha:1}],Y=0;Y<R;++Y){for(var Q=x.Math.randomBetween(k,U),ee=x.Math.randomBetween(G,j),z=x.Math.randomBetween(q,J),ie=new x.Cartesian3(Q,ee,z),re=x.Color.fromRandom(X[Y%X.length]),ne=[],oe=0;oe<3;++oe)ne.push(new x.ParticleBurst({time:x.Math.nextRandomNumber()*L,minimum:D,maximum:D}));this.particlePrimitives[C]||(this.particlePrimitives[C]=[]),this.particlePrimitives[C].push(F(ie,re,ne))}if(m&&typeof m=="function")m(this.particlePrimitives[C]);else{var se=y.scene.camera,ae=new x.Cartesian3(-300,0,0);se.lookAtTransform(w,ae),se.lookAtTransform(x.Matrix4.IDENTITY);var fe=x.Cartesian3.subtract(A,ae,new x.Cartesian3);x.Cartesian3.normalize(fe,fe);var de=x.Math.PI_OVER_TWO-Math.acos(x.Cartesian3.dot(fe,x.Cartesian3.UNIT_Z));se.lookUp(de)}};AA.prototype.createSmog=function(o,f,m){var v=this._viewer.scene,y=this._viewer,x=this._cesium,C=this;let w=this.particleType;(!f||f==="")&&(f={}),x.Math.setRandomNumberSeed(3);var A={image:window.SmartEarthRootUrl+pn.smog,emissionRate:50,gravity:0,minimumParticleLife:1,maximumParticleLife:1.2,minimumSpeed:1,maximumSpeed:4,startScale:1,endScale:5,particleSize:1,lifetime:6};this._core.extend(A,f,!0);var E,T=new x.Cartesian3,S=M(o);this.particlePrimitives[w]||(this.particlePrimitives[w]=[]),this.particlePrimitives[w].push(S),m&&typeof m=="function"&&m(this.particlePrimitives[w]);function M(L){var R=y.scene;return E=R.primitives.add(new x.ParticleSystem({image:A.image,startColor:x.Color.LIGHTSEAGREEN.withAlpha(.7),endColor:x.Color.WHITE.withAlpha(0),startScale:A.startScale,endScale:A.endScale,sizeInMeters:!0,minimumParticleLife:A.minimumParticleLife,maximumParticleLife:A.maximumParticleLife,minimumSpeed:A.minimumSpeed,maximumSpeed:A.maximumSpeed,imageSize:new x.Cartesian2(A.particleSize,A.particleSize),emissionRate:A.emissionRate,lifetime:A.lifetime,emitter:new x.CircleEmitter(2),emitterModelMatrix:C.computeEmitterModelMatrix(f.translation,f.rotation),updateCallback:I})),A.type&&D(A.type),y.scene.preUpdate.addEventListener(function(O,F){E&&(E.modelMatrix=C.computeModelMatrix(L,F),E.emitterModelMatrix=C.computeEmitterModelMatrix(f.translation,f.rotation))}),E}function I(L,R){var O=L.position;x.Cartesian3.normalize(O,T),x.Cartesian3.multiplyByScalar(T,A.gravity*R,T),L.velocity=x.Cartesian3.add(L.velocity,T,L.velocity)}function P(L){L.startScale&&(E.startScale=L.startScale),L.endScale&&(E.endScale=L.endScale),L.minimumParticleLife&&(E.minimumParticleLife=L.minimumParticleLife),L.maximumParticleLife&&(E.maximumParticleLife=L.maximumParticleLife),L.minimumSpeed&&(E.minimumSpeed=L.minimumSpeed),L.maximumSpeed&&(E.maximumSpeed=L.maximumSpeed),L.particleSize&&(E.minimumImageSize.x=L.particleSize,E.minimumImageSize.y=L.particleSize,E.maximumImageSize.x=L.particleSize,E.maximumImageSize.y=L.particleSize),L.emissionRate&&(E.emissionRate=L.emissionRate)}function D(L){L==="\u5706\u5F62\u653E\u5C04"?E.emitter=new x.CircleEmitter(2):L==="\u7403\u4F53\u653E\u5C04"?E.emitter=new x.SphereEmitter(2.5):L==="\u5706\u9525\u4F53\u653E\u5C04"?E.emitter=new x.ConeEmitter(x.Math.toRadians(45)):L==="\u76D2\u72B6\u653E\u5C04"&&(E.emitter=new x.BoxEmitter(new x.Cartesian3(10,10,10)))}};AA.prototype.createFountain=function(o,f,m){var v=this._viewer.scene,y=this._viewer,x=this._cesium,C=this;let w=this.particleType;(!f||f==="")&&(f={});var A={image:window.SmartEarthRootUrl+pn.penquan,emissionRate:50,minimumParticleLife:3,maximumParticleLife:4,minimumSpeed:9,maximumSpeed:9.5,startScale:1,endScale:15,particleSize:1,lifetime:6,gravity:-3.5};this._core.extend(A,f,!0);var E=new x.Cartesian3,T,S=M();this.particlePrimitives[w]||(this.particlePrimitives[w]=[]),this.particlePrimitives[w].push(S),m&&typeof m=="function"&&m(this.particlePrimitives[w]);function M(){return T=y.scene.primitives.add(new x.ParticleSystem({image:A.image,startColor:new x.Color(1,1,1,.3),endColor:new x.Color(.8,.86,1,.4),startScale:A.startScale,endScale:A.endScale,minimumParticleLife:A.minimumParticleLife,maximumParticleLife:A.maximumParticleLife,minimumSpeed:A.minimumSpeed,maximumSpeed:A.maximumSpeed,imageSize:new x.Cartesian2(A.particleSize,A.particleSize*2),emissionRate:A.emissionRate,lifetime:A.lifetime,loop:!0,emitter:new x.ConeEmitter(x.Math.toRadians(x.defaultValue(A.angle,7))),updateCallback:I,sizeInMeters:!0})),y.scene.preUpdate.addEventListener(function(D,L){T&&(T.modelMatrix=C.computeModelMatrix(o,L),T.emitterModelMatrix=C.computeEmitterModelMatrix(f.translation,f.rotation))}),T}function I(D,L){var R=D.position;x.Cartesian3.normalize(R,E),x.Cartesian3.multiplyByScalar(E,A.gravity*L,E),D.velocity=x.Cartesian3.add(D.velocity,E,D.velocity)}function P(D){T.startScale=D.startScale,T.endScale=D.endScale,T.minimumParticleLife=D.minimumParticleLife,T.maximumParticleLife=D.maximumParticleLife,T.minimumSpeed=D.minimumSpeed,T.maximumSpeed=D.maximumSpeed,T.minimumImageSize.x=D.particleSize,T.minimumImageSize.y=D.particleSize*2,T.maximumImageSize.x=D.particleSize,T.maximumImageSize.y=D.particleSize*2,T.emissionRate=D.emissionRate}};AA.prototype.createFlame=function(o,f,m){var v=this._viewer.scene,y=this._viewer,x=this._cesium,C=this;let w=this.particleType;(!f||f==="")&&(f={});var A={image:window.SmartEarthRootUrl+pn.fire,emissionRate:50,gravity:0,minimumParticleLife:1,maximumParticleLife:3,minimumSpeed:1,maximumSpeed:4,startScale:1,endScale:6,particleSize:1,lifetime:16};this._core.extend(A,f,!0);var E=T(o);this.particlePrimitives[w]||(this.particlePrimitives[w]=[]),this.particlePrimitives[w].push(E),m&&typeof m=="function"&&m(this.particlePrimitives[w]);function T(S){return y.scene.primitives.add(new x.ParticleSystem({image:A.image,startColor:x.Color.RED.withAlpha(.7),endColor:x.Color.YELLOW.withAlpha(.3),startScale:A.startScale,endScale:A.endScale,minimumParticleLife:A.minimumParticleLife,maximumParticleLife:A.maximumParticleLife,minimumSpeed:A.minimumSpeed,maximumSpeed:A.maximumSpeed,imageSize:new x.Cartesian2(A.particleSize,A.particleSize),emissionRate:A.emissionRate,sizeInMeters:!0,lifetime:A.lifetime,emitter:new x.ConeEmitter(x.Math.toRadians(30)),modelMatrix:C.computeModelMatrix(S),emitterModelMatrix:C.computeEmitterModelMatrix(A.translation,A.rotation)}))}};AA.prototype.createBlast=function(o,f,m){var v=this._viewer.scene,y=this._viewer,x=this._cesium,C=this;let w=this.particleType;(!f||f==="")&&(f={});var A={image:window.SmartEarthRootUrl+pn.fire2,emissionRate:10,gravity:0,minimumParticleLife:1,maximumParticleLife:3,minimumSpeed:5,maximumSpeed:20,startScale:1,endScale:10,particleSize:5,lifetime:3};this._core.extend(A,f,!0);var E=T(o);this.particlePrimitives[w]||(this.particlePrimitives[w]=[]),this.particlePrimitives[w].push(E),m&&typeof m=="function"&&m(this.particlePrimitives[w]);function T(S){let M=new x.ParticleSystem({image:A.image,startColor:A.startColor,endColor:A.endColor,startScale:A.startScale,endScale:A.endScale,minimumParticleLife:A.minimumParticleLife,maximumParticleLife:A.maximumParticleLife,minimumSpeed:A.minimumSpeed,maximumSpeed:A.maximumSpeed,imageSize:new x.Cartesian2(A.particleSize,A.particleSize),emissionRate:A.emissionRate,sizeInMeters:!0,lifetime:A.lifetime,emitter:new x.ConeEmitter(x.Math.toRadians(30)),emitterModelMatrix:C.computeEmitterModelMatrix(A.translation,A.rotation),bursts:A.bursts,updateCallback:()=>{M.modelMatrix=C.computeModelMatrix(S,C._viewer.clock.currentTime)}});return y.scene.primitives.add(M)}};AA.prototype.computeModelMatrix=function(o,f){var m=this._cesium;if(o instanceof m.Entity)return o.computeModelMatrix(f,new m.Matrix4);if(o.x&&o.y){var v;return o.x<=180&&o.x>=-180&&o.y<=90&&o.y>=-90?v=m.Cartesian3.fromDegrees(o.x,o.y,o.z||0):v=o,m.Transforms.eastNorthUpToFixedFrame(v)}};AA.prototype.computeEmitterModelMatrix=function(o,f){var m=this._cesium,v=new m.TranslationRotationScale,y=m.HeadingPitchRoll.fromDegrees(0,0,0);return v.translation=m.defaultValue(o,m.Cartesian3.fromElements(0,0,0)),v.rotation=m.Quaternion.fromHeadingPitchRoll(m.defaultValue(f,y)),m.Matrix4.fromTranslationRotationScale(v)};Object.defineProperties(AA.prototype,{show:{get:function(){let o=this.particleType,f=this.particlePrimitives[o];return f&&f.length?f[0].show:!1},set:function(o){let f=this.particleType,m=this.particlePrimitives[f];m&&m.length&&m.forEach(v=>{v.show=o})}}});var R8=AA;var Lo=null;function lJ(o,f){Lo=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this._getPosition=new Ru(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip()}lJ.prototype.createViewCone=function(o,f){let m={roll:0,fov:60,near:1,height:1.6,fillColor:"rgba(0,255,0,0.1)",outlineColor:"rgba(0,255,0,1)"};!o&&(o={}),o=this._core.extend(m,o,!0),this._option=o,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);let v=this,y=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(y.scene.canvas),Ne.states=1;let x=[];return this.drawHandler.setInputAction(C=>{let w=v._getPosition.getMousePosition(C);if(!!w){if(x.length===0){if(o.height){let A=v._core.toDegrees(w);A.height+=o.height,x.push(Lo.Cartesian3.fromDegrees(A.lon,A.lat,A.height))}else x.push(w);x.push(w)}else v.drawHandler.destroy(),v.drawHandler=void 0,v.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),v._core.mouse(v._viewer.container,0,"0"),f&&typeof f=="function"&&f(v.item,x);if(!v.item){v.viewConeCamera=new Lo.Camera(y.scene);let A=Lo.Cartesian3.normalize(Lo.Cartesian3.subtract(x[1],x[0],new Lo.Cartesian3),new Lo.Cartesian3);v.viewConeCamera.position=x[0],v.viewConeCamera.direction=A,v.viewConeCamera.frustum.fov=Lo.Math.toRadians(o.fov),v.viewConeCamera.frustum.near=o.near,v.viewConeCamera.frustum.far=1;let E=new Lo.Cartesian3,T=new Lo.Matrix3,S=new Lo.Quaternion,M=v.viewConeCamera.positionWC,I=v.viewConeCamera.upWC,P=v.viewConeCamera.rightWC;P=Lo.Cartesian3.negate(P,E);let D=T;Lo.Matrix3.setColumn(D,0,P,D),Lo.Matrix3.setColumn(D,1,I,D),Lo.Matrix3.setColumn(D,2,A,D);let L=Lo.Quaternion.fromRotationMatrix(D,S);o.fill&&(v._planesPrimitive=new Lo.Primitive({geometryInstances:new Lo.GeometryInstance({geometry:new Lo.FrustumGeometry({origin:M,orientation:L,frustum:v.viewConeCamera.frustum}),attributes:{color:Lo.ColorGeometryInstanceAttribute.fromColor(Lo.Color.fromCssColorString(o.fillColor))},id:o.id}),appearance:new Lo.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),v._outlinePrimitive=new Lo.Primitive({geometryInstances:new Lo.GeometryInstance({geometry:new Lo.FrustumOutlineGeometry({origin:M,orientation:L,frustum:v.viewConeCamera.frustum}),attributes:{color:Lo.ColorGeometryInstanceAttribute.fromColor(Lo.Color.fromCssColorString(o.outlineColor))},id:o.id}),appearance:new Lo.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),v.item=new Lo.PrimitiveCollection,v._viewer.scene.primitives.add(v.item),v._outlinePrimitive&&v.item.add(v._outlinePrimitive),v._planesPrimitive&&v.item.add(v._planesPrimitive)}}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(C=>{if(x.length>0){v.tooltip.showAt(C.endPosition,"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236");let w=v._getPosition.getMousePosition(C);w&&(x[1]=w,v.viewConeCamera.direction=Lo.Cartesian3.normalize(Lo.Cartesian3.subtract(x[1],x[0],new Lo.Cartesian3),new Lo.Cartesian3),v.updata({heading:Lo.Math.toDegrees(v.viewConeCamera.heading),pitch:Lo.Math.toDegrees(v.viewConeCamera.pitch),far:v._core.getSpaceDistancem(x,Lo)}))}else v.tooltip.showAt(C.endPosition,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this};lJ.prototype.addViewCone=function(o){let f={position:this._viewer.camera.position.clone(),heading:0,pitch:0,roll:0,fov:60,near:1,far:60,fillColor:"rgba(0,255,0,0.1)",outlineColor:"rgba(0,255,0,1)"};!o&&(o={}),o.position&&o.position.lon&&(o.position=Lo.Cartesian3.fromDegrees(o.position.lon,o.position.lat,o.position.height)),o=this._core.extend(f,o,!0),this.viewConeCamera=new Lo.Camera(this._viewer.scene),this.viewConeCamera.setView({destination:o.position,orientation:{heading:Lo.Math.toRadians(o.heading),pitch:Lo.Math.toRadians(o.pitch),roll:Lo.Math.toRadians(o.roll)}}),this.viewConeCamera.frustum.fov=Lo.Math.toRadians(o.fov),this.viewConeCamera.frustum.near=o.near,this.viewConeCamera.frustum.far=o.far;let m=new Lo.Cartesian3,v=new Lo.Matrix3,y=new Lo.Quaternion,x=this.viewConeCamera.positionWC,C=this.viewConeCamera.directionWC,w=this.viewConeCamera.upWC,A=this.viewConeCamera.rightWC;A=Lo.Cartesian3.negate(A,m);let E=v;Lo.Matrix3.setColumn(E,0,A,E),Lo.Matrix3.setColumn(E,1,w,E),Lo.Matrix3.setColumn(E,2,C,E);let T=Lo.Quaternion.fromRotationMatrix(E,y);return o.fill&&(this._planesPrimitive=new Lo.Primitive({geometryInstances:new Lo.GeometryInstance({geometry:new Lo.FrustumGeometry({origin:x,orientation:T,frustum:this.viewConeCamera.frustum}),attributes:{color:Lo.ColorGeometryInstanceAttribute.fromColor(Lo.Color.fromCssColorString(o.fillColor))},id:o.id}),appearance:new Lo.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),this._outlinePrimitive=new Lo.Primitive({geometryInstances:new Lo.GeometryInstance({geometry:new Lo.FrustumOutlineGeometry({origin:x,orientation:T,frustum:this.viewConeCamera.frustum}),attributes:{color:Lo.ColorGeometryInstanceAttribute.fromColor(Lo.Color.fromCssColorString(o.outlineColor))},id:o.id}),appearance:new Lo.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._option=o,this.item=new Lo.PrimitiveCollection,this._viewer.scene.primitives.add(this.item),this._outlinePrimitive&&this.item.add(this._outlinePrimitive),this._planesPrimitive&&this.item.add(this._planesPrimitive),this};lJ.prototype.updata=function(o){!o&&(o={}),o.position&&o.position.lon&&(o.position=Lo.Cartesian3.fromDegrees(o.position.lon,o.position.lat,o.position.height)),o=this._core.extend(this._option,o,!0),this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive&&this._planesPrimitive.destroy(),this.item.removeAll(),this.viewConeCamera.setView({destination:o.position,orientation:{heading:Lo.Math.toRadians(o.heading),pitch:Lo.Math.toRadians(o.pitch),roll:Lo.Math.toRadians(o.roll)}}),this.viewConeCamera.frustum.fov=Lo.Math.toRadians(o.fov),this.viewConeCamera.frustum.near=o.near,this.viewConeCamera.frustum.far=o.far;let f=new Lo.Cartesian3,m=new Lo.Matrix3,v=new Lo.Quaternion,y=this.viewConeCamera.positionWC,x=this.viewConeCamera.directionWC,C=this.viewConeCamera.upWC,w=this.viewConeCamera.rightWC;w=Lo.Cartesian3.negate(w,f);let A=m;Lo.Matrix3.setColumn(A,0,w,A),Lo.Matrix3.setColumn(A,1,C,A),Lo.Matrix3.setColumn(A,2,x,A);let E=Lo.Quaternion.fromRotationMatrix(A,v);o.fill&&(this._planesPrimitive=new Lo.Primitive({geometryInstances:new Lo.GeometryInstance({geometry:new Lo.FrustumGeometry({origin:y,orientation:E,frustum:this.viewConeCamera.frustum}),attributes:{color:Lo.ColorGeometryInstanceAttribute.fromColor(Lo.Color.fromCssColorString(o.fillColor))},id:o.id}),appearance:new Lo.PerInstanceColorAppearance({translucent:!0,flat:!0}),asynchronous:!1,allowPicking:!1})),this._outlinePrimitive=new Lo.Primitive({geometryInstances:new Lo.GeometryInstance({geometry:new Lo.FrustumOutlineGeometry({origin:y,orientation:E,frustum:this.viewConeCamera.frustum}),attributes:{color:Lo.ColorGeometryInstanceAttribute.fromColor(Lo.Color.fromCssColorString(o.outlineColor))},id:o.id}),appearance:new Lo.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1,allowPicking:!1}),this._option=o,this.item.add(this._outlinePrimitive),this._planesPrimitive&&this.item.add(this._planesPrimitive)};lJ.prototype.destroy=function(){return this._outlinePrimitive&&this._outlinePrimitive.destroy(),this._planesPrimitive&&this._planesPrimitive.destroy(),this.item&&this._viewer.scene.primitives.removeAndDestroy(this.item),Lo.destroyObject(this)};var $O=lJ;function Fm(o,f={},m){this._viewer=o,this._cesium=m,this.radius=this.defaultValue(f.radius,50),this.minRadius=this.defaultValue(f.minRadius,1),this.maxRadius=this.defaultValue(f.maxRadius,50),this.blur=this.defaultValue(f.blur,.85),this.alpha=this.defaultValue(f.alpha,1),this.minNum=this.defaultValue(f.min,0),this.maxNum=this.defaultValue(f.max,0),this.rectangleHeight=f.height,this.is3D=f.type&&f.type.indexOf("3D")>-1,this.is3D&&(this._3DOption={width:f.TIN_X||200,height:f.TIN_Y||200,grid:this.defaultValue(f.showTIN,!1),scale:this.defaultValue(f.colorScale,1),z:this.defaultValue(f.minHeight,100)}),this.minOpacity=this.defaultValue(f.minOpacity,.1),this.maxOpacity=this.defaultValue(f.maxOpacity,.8),this.gradient=this.defaultValue(f.gradient,{".3":"blue",".5":"green",".7":"yellow",".95":"red"}),this.flyTo=this.defaultValue(f.flyTo,!0),f.dynamic&&!this.is3D&&this.dynamicAdjust(!0),this._core=new Sr(o,m),this.tooltip=this._core.CreateTooltip(),f.tooltip&&this.showTooltip(!0)}Fm.prototype.defaultValue=function(o,f){return this._cesium.defaultValue(o,f)};Fm.prototype.create=function(o){this.setData(o),this.flyTo&&this.flyToBounding()};Fm.prototype.setData=function(o){let f=1e3,m=-1e3,v=1e3,y=-1e3,x=-1/0,C=1/0;o.forEach(function(P){let D=P.x,L=P.y;f=Math.min(D,f),v=Math.min(L,v),m=Math.max(D,m),y=Math.max(L,y),x=Math.max(P.value,x),C=Math.min(P.value,C)});let w=m-f,A=y-v,E={xMin:f-w/10,yMin:v-A/10,xMax:m+w/10,yMax:y+A/10},T=1e3,S=parseInt(1e3/(E.xMax-E.xMin)*(E.yMax-E.yMin));if(this.heatmapInstance)this.heatmapInstance._renderer.canvas.setAttribute("style","width:"+T+"px;height:"+S+"px;");else{let P=document.createElement("div");P.setAttribute("style","width:"+T+"px;height:"+S+"px;display:none;"),document.body.appendChild(P),this.heatmapInstance=h337.create({container:P,maxOpacity:this.maxOpacity,minOpacity:this.minOpacity,blur:this.blur,radius:this.radius,gradient:this.gradient})}let M=[];o.forEach(function(P){let D=(P.x-E.xMin)/(E.xMax-E.xMin)*T,L=(-(P.y-E.yMin)/(E.yMax-E.yMin)+1)*S,R={x:Math.round(D),y:Math.round(L),value:P.value};M.push(R)}),this.datas={max:this.maxNum?this.maxNum:x,min:this.minNum?this.minNum:C,data:M},this.heatmapInstance.setData(this.datas),this.heatmapcanvas=this.heatmapInstance._renderer.canvas,this.drawHeatmapRect(this.heatmapcanvas,E),this.rectangle=this._cesium.Rectangle.fromDegrees(E.xMin,E.yMin,E.xMax,E.yMax);let I=this._cesium.BoundingSphere.fromRectangle3D(this.rectangle);this.boundingRadius=I.radius,this.extent=E};Fm.prototype.flyToBounding=function(){this._viewer.camera.flyTo({destination:this.rectangle})};Fm.prototype.destroy=function(){this.dynamicAdjust(!1),this._viewer.scene.primitives.remove(this._worldRectangle),this.heatmapcanvas.remove(),this.showTooltip(!1)};Fm.prototype.dynamicAdjust=function(o){o?this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent,this):this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent,this)};Fm.prototype.dynamicAdjustEvent=function(){if(this.heatmapInstance&&this._viewer){let o=this._viewer.camera.positionCartographic,f=o.height,m=this._viewer.scene.globe.getHeight(o),y=(f-m)/this.boundingRadius*this.maxRadius;y=y.toFixed(1),y>this.maxRadius&&(y=this.maxRadius),y<this.minRadius&&(y=this.minRadius),y!==this.radius&&y<=this.maxRadius&&y>=this.minRadius&&this.changeRadius(y)}};Fm.prototype.changeRadius=async function(o){this.radius=o;for(let f in this.heatmapInstance._store._radi)for(let m in this.heatmapInstance._store._radi[f])this.heatmapInstance._store._radi[f][m]=o;this.heatmapInstance._coordinator.emit("renderall",this.heatmapInstance._store._getInternalData()),this.updateHeatmap()};Fm.prototype.drawHeatmapRect=function(o,f){this._worldRectangle&&this._viewer.scene.primitives.remove(this._worldRectangle);let m=this.convertCanvasToImage(o);if(this.is3D)Object.assign(this._3DOption,f),this.create3DHeatmap(m);else{let v=this.rectangleHeight===void 0?this._cesium.GroundPrimitive:this._cesium.Primitive;this._worldRectangle=this._viewer.scene.primitives.add(new v({geometryInstances:new this._cesium.GeometryInstance({geometry:new this._cesium.RectangleGeometry({rectangle:this._cesium.Rectangle.fromDegrees(f.xMin,f.yMin,f.xMax,f.yMax),vertexFormat:this._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:this.rectangleHeight})}),appearance:new this._cesium.EllipsoidSurfaceAppearance({aboveGround:!0,material:new this._cesium.Material({fabric:{type:"Image",uniforms:{image:m.src}}})})})),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)}};Fm.prototype.create3DHeatmap=function(o){let f=document.createElement("canvas"),m=this._3DOption,v=m.width+1,y=m.height+1;f.width=v,f.height=y,o.onload=()=>{let x=new this._cesium.GeometryInstance({geometry:this.create3DGeometry(m)}),C=new this._cesium.Primitive({geometryInstances:x,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:new this._cesium.Material({fabric:{type:"Image",uniforms:{image:o.src}}})}),asynchronous:!1});this._worldRectangle=this._viewer.scene.primitives.add(C),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)}};Fm.prototype.create3DGeometry=function(o){let f=this.construct3DRectangle(o);return new this._cesium.Geometry({attributes:{position:new this._cesium.GeometryAttribute({componentDatatype:this._cesium.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:f.positions}),st:new this._cesium.GeometryAttribute({componentDatatype:this._cesium.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:f.st})},indices:f.indexs,primitiveType:o.grid?this._cesium.PrimitiveType.LINES:this._cesium.PrimitiveType.TRIANGLES,boundingSphere:this._cesium.BoundingSphere.fromVertices(f.positions)})};Fm.prototype.construct3DRectangle=function(o){let f=o.xMax-o.xMin,m=o.yMax-o.yMin,v=o.width,y=o.height,x=f/v,C=m/y,w=v,A=y+1,E=[],T=[],S=[];for(let M=0;M<A;M++)for(let I=0;I<w;I++){let P=o.xMin+x*I,D=o.yMin+C*M,L=this._cesium.Cartesian3.fromDegrees(P,D,(this.getValueFromDegrees({lon:P,lat:D})||0)*o.scale+o.z);E.push(L.x,L.y,L.z),T.push(x*I/f,C*M/m),M!=0&&I!=0&&(S.push((M-1)*w+(I-1),(M-1)*w+I,M*w+I-1),S.push((M-1)*w+I,M*w+I,M*w+I-1))}return{positions:E,st:T,indexs:S}};Fm.prototype.get3DShader=function(){return`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { vec2 repeat = vec2(1.0,1.0); czm_material material = czm_getDefaultMaterial(materialInput); vec4 j_color = texture(image, fract(repeat * materialInput.st)).rgba; material.diffuse = j_color.rgb; material.alpha = j_color.a; return material; } `};Fm.prototype.getValueFromDegrees=function(o){if(this.heatmapInstance&&this.extent&&o){let f=(o.lon-this.extent.xMin)/(this.extent.xMax-this.extent.xMin)*this.heatmapcanvas.width,m=(-(o.lat-this.extent.yMin)/(this.extent.yMax-this.extent.yMin)+1)*this.heatmapcanvas.height;if(f<=this.heatmapcanvas.width&&f>=0&m<=this.heatmapcanvas.height&&m>=0)return this.heatmapInstance.getValueAt({x:Math.round(f),y:Math.round(m)})}};Fm.prototype.showTooltip=function(o){o?(this.tooltipHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas),this.tooltipHandler.setInputAction(f=>{let m=this._viewer.scene.pickPosition(f.endPosition);if(m){let v=this._core.toDegrees(m),y=this.getValueFromDegrees(v);y!==void 0?this.tooltip.showAt(f.endPosition,y):this.tooltip.show(!1)}else this.tooltip.show(!1)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)):(this.tooltip.show(!1),this.tooltipHandler&&this.tooltipHandler.destroy(),this.tooltipHandler=void 0)};Fm.prototype.updateHeatmap=function(){this.heatmapcanvas=this.heatmapInstance._renderer.canvas;let o=this.convertCanvasToImage(this.heatmapcanvas);this._worldRectangle.appearance.material.uniforms.image=o.src};Fm.prototype.show=function(o){this._worldRectangle&&(this._worldRectangle.show=o)};Fm.prototype.setAlpha=function(o){this._worldRectangle&&(this._worldRectangle.appearance.material.uniforms.color.alpha=o)};Fm.prototype.config=function(o){this.heatmapInstance.configure(o),this.updateHeatmap()};Fm.prototype.convertCanvasToImage=function(o){let f=new Image;return f.src=o.toDataURL("image/png"),f};var Zct=Fm;function F_(o,f={},m){this._viewer=o,this._cesium=m,this.radius=this.defaultValue(f.radius,50),this.alpha=this.defaultValue(f.alpha,1),this.rectangleHeight=f.height,this.minRadius=this.defaultValue(f.minRadius,1),this.maxRadius=this.defaultValue(f.maxRadius,50),this.flyTo=this.defaultValue(f.flyTo,!0),this.datas=[],f.dynamic&&this.dynamicAdjust(!0)}F_.prototype.defaultValue=function(o,f){return this._cesium.defaultValue(o,f)};F_.prototype.create=function(o){this.setData(o),this.flyTo&&this.flyToBounding()};F_.prototype.setData=function(o){let f=1e3,m=-1e3,v=1e3,y=-1e3,x=-1/0,C=1/0;o.forEach(I=>{let P=I.x,D=I.y;f=Math.min(P,f),v=Math.min(D,v),m=Math.max(P,m),y=Math.max(D,y),x=Math.max(I.value,x),C=Math.min(I.value,C)});let w=m-f,A=y-v,E={xMin:f-w/10,yMin:v-A/10,xMax:m+w/10,yMax:y+A/10},T;if(this._heatmap)T=this._heatmap.canvas,this._heatmap.clear();else{T=document.createElement("canvas"),document.body.appendChild(T),T.width=1e3,T.height=parseInt(1e3/(E.xMax-E.xMin)*(E.yMax-E.yMin));try{this._heatmap=createWebGLHeatmap({canvas:T,intensityToAlpha:!0})}catch(I){console.error(I)}}this.datas=[];let S=x-C;o.forEach(I=>{var P=(I.x-E.xMin)/(E.xMax-E.xMin)*T.clientWidth,D=(-(I.y-E.yMin)/(E.yMax-E.yMin)+1)*T.clientHeight;this.datas.push({x:P,y:D,size:this.radius,intensity:(I.value-C)/S})}),this._heatmap.addPoints(this.datas),this._heatmap.adjustSize(),this._heatmap.update(),this._heatmap.display(),this.drawHeatmapRect(T,E),this.rectangle=this._cesium.Rectangle.fromDegrees(E.xMin,E.yMin,E.xMax,E.yMax);let M=this._cesium.BoundingSphere.fromRectangle3D(this.rectangle);this.boundingRadius=M.radius};F_.prototype.flyToBounding=function(){this._viewer.camera.flyTo({destination:this.rectangle})};F_.prototype.drawHeatmapRect=function(o,f){this._worldRectangle&&this._viewer.scene.primitives.remove(this._worldRectangle);var m=this.convertCanvasToImage(o);let v=this.rectangleHeight===void 0?this._cesium.GroundPrimitive:this._cesium.Primitive;this._worldRectangle=this._viewer.scene.primitives.add(new v({geometryInstances:new this._cesium.GeometryInstance({geometry:new this._cesium.RectangleGeometry({rectangle:this._cesium.Rectangle.fromDegrees(f.xMin,f.yMin,f.xMax,f.yMax),vertexFormat:this._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,height:this.rectangleHeight})}),appearance:new this._cesium.EllipsoidSurfaceAppearance({aboveGround:!1,material:new this._cesium.Material({fabric:{type:"Image",uniforms:{image:m.src}}})})})),this.setAlpha(0),setTimeout(()=>{this.setAlpha(this.alpha)},100)};F_.prototype.destroy=function(){this.dynamicAdjust(!1),this._viewer.scene.primitives.remove(this._worldRectangle),this._heatmap.clear(),this._heatmap.canvas.remove()};F_.prototype.dynamicAdjust=function(o){o?this._viewer.clock.onTick.addEventListener(this.dynamicAdjustEvent,this):this._viewer.clock.onTick.removeEventListener(this.dynamicAdjustEvent,this)};F_.prototype.dynamicAdjustEvent=function(){if(this._heatmap&&this._viewer){let o=this._viewer.camera.positionCartographic,f=o.height,m=this._viewer.scene.globe.getHeight(o),y=(f-m)/this.boundingRadius*this.maxRadius;y=y.toFixed(1),y>this.maxRadius&&(y=this.maxRadius),y<this.minRadius&&(y=this.minRadius),y!==this.radius&&y<=this.maxRadius&&y>=this.minRadius&&this.changeRadius(y)}};F_.prototype.updateHeatmap=function(){this._heatmap.adjustSize(),this._heatmap.update(),this._heatmap.display();var o=this.convertCanvasToImage(this._heatmap.canvas);this._worldRectangle.appearance.material.uniforms.image=o.src};F_.prototype.multiply=function(o){this._heatmap.multiply(o),this.updateHeatmap()};F_.prototype.changeRadius=function(o){this.radius=o,this.datas.forEach(f=>{f.size=o}),this._heatmap.clear(),this._heatmap.addPoints(this.datas),this.updateHeatmap()};F_.prototype.clamp=function(o,f){this._heatmap.clamp(o,f),this.updateHeatmap()};F_.prototype.blur=function(){this._heatmap.blur(),this.updateHeatmap()};F_.prototype.show=function(o){this._worldRectangle&&(this._worldRectangle.show=o)};F_.prototype.setAlpha=function(o){this._worldRectangle&&(this._worldRectangle.appearance.material.uniforms.color.alpha=o)};F_.prototype.convertCanvasToImage=function(o){var f=new Image;return f.src=o.toDataURL("image/png"),f};var $ct=F_;function F4(o,f){if(this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,!window.h337){let m=new Y0(!1);m.addJs(document.body,window.SmartEarthRootUrl+"Workers/heatmap/heatmap.min.js"),m.addJs(document.body,window.SmartEarthRootUrl+"Workers/heatmap/webgl-heatmap.js")}}F4.prototype.addHeatMap=function(o,f={}){f.type==="HeatmapGL"?this.item=new $ct(this._viewer,f,this._cesium):this.item=new Zct(this._viewer,f,this._cesium),f.sourceData&&this.item.create(f.sourceData);var m={id:this._core.getuid(),name:o,pId:0,type:"Heatmap",item:this};return this.setTreeobj(m),this._tree.insertGroupId(m,0),this};F4.prototype.setData=function(o){this.item&&this.item.setData(o)};F4.prototype.flyToBounding=function(){this.item&&this.item.flyToBounding()};F4.prototype.deleteObject=function(){this.item&&this.item.destroy()};F4.prototype.setTreeobj=function(o){this.treeobj=o};F4.prototype.setVisibility=function(o){this.item!=null&&this.item.show(o)};var Ile=F4;function Mle(o,f){this._viewer=o,this._cesium=f,this.SkyBoxFS=`uniform samplerCube u_cubeMap; in vec3 v_texCoord; void main() { vec4 color = texture(u_cubeMap, normalize(v_texCoord)); out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); } `,this.SkyBoxVS=`in vec3 position; uniform mat3 u_rotateMatrix; out vec3 v_texCoord; void main() { vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position)); gl_Position = czm_projection * vec4(p, 1.0); v_texCoord = position.xyz; } `}Mle.prototype.setSpaceBackground=function(o){return this.clear&&this.clear(),this._viewer.container.style.backgroundImage="url("+o+")",this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,0),this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=!1),this.clear=()=>{this._viewer.container.style.backgroundImage="unset",this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=!0),this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,1),this._viewer.scene.skyAtmosphere.show=!0},this};Mle.prototype.SkyBox=function(o,f){this.defaultSky||(this.defaultSky=this._viewer.scene.skyBox,this.defaultSky&&!this.defaultSky.show&&(this.defaultSky.show=!0)),this.NearGround=o;var m=this,v=this._viewer,y=this.getSkyBox(f);this._SkyBox=y,v.scene.skyBox=y,o&&this._viewer.scene.postRender.addEventListener(x);function x(){var C=v.camera.position;m._cesium.Cartographic.fromCartesian(C).height<23e4?(y&&(v.scene.skyBox=y),v.scene.skyAtmosphere.show=!1):(m.defaultSky&&(v.scene.skyBox=m.defaultSky),v.scene.skyAtmosphere.show=!0)}return this.clear=function(){m.defaultSky&&(m._viewer.scene.skyBox=m.defaultSky),m.defaultSky=void 0,m._viewer.scene.skyAtmosphere.show=!0,m.NearGround&&m._viewer.scene.postRender.removeEventListener(x),m.clear=void 0},this};Mle.prototype.getSkyBox=function(o){var f=this,m=new this._cesium.SkyBox({sources:o});return this.NearGround&&(m.update=function(v,y){var x=this;if(this.show&&(v.mode===f._cesium.SceneMode.SCENE3D||v.mode===f._cesium.SceneMode.MORPHING)&&v.passes.render){var C=v.context;if(this._sources!==this.sources){this._sources=this.sources;var w=this.sources;typeof w.positiveX=="string"?f._cesium.loadCubeMap(C,this._sources).then(function(M){x._cubeMap=x._cubeMap&&x._cubeMap.destroy(),x._cubeMap=M}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new f._cesium.CubeMap({context:C,source:w}))}var A=this._command;if(!f._cesium.defined(A.vertexArray)){A.uniformMap={u_cubeMap:function(){return x._cubeMap},u_rotateMatrix:function(){return f.NearGround?(A.modelMatrix=f._cesium.Transforms.eastNorthUpToFixedFrame(v.camera._positionWC),f._cesium.Matrix4.getMatrix3(A.modelMatrix,new f._cesium.Matrix3)):f._cesium.Matrix3.IDENTITY}};var E=f._cesium.BoxGeometry.createGeometry(f._cesium.BoxGeometry.fromDimensions({dimensions:new f._cesium.Cartesian3(2,2,2),vertexFormat:f._cesium.VertexFormat.POSITION_ONLY})),T=this._attributeLocations=f._cesium.GeometryPipeline.createAttributeLocations(E);A.vertexArray=f._cesium.VertexArray.fromGeometry({context:C,geometry:E,attributeLocations:T,bufferUsage:f._cesium.BufferUsage.STATIC_DRAW}),A.renderState=f._cesium.RenderState.fromCache({blending:f._cesium.BlendingState.ALPHA_BLEND})}if(!f._cesium.defined(A.shaderProgram)||this._useHdr!==y){var S=new f._cesium.ShaderSource({defines:[y?"HDR":""],sources:[f.SkyBoxFS]});A.shaderProgram=f._cesium.ShaderProgram.fromCache({context:C,vertexShaderSource:f.SkyBoxVS,fragmentShaderSource:S,attributeLocations:this._attributeLocations}),this._useHdr=y}if(f._cesium.defined(this._cubeMap))return A}}),m};var Dle=Mle;var oh=null;function ux(o,f){oh=f,this._viewer=o,this._core=new Sr(o,f),this.destroyed=!1,this.show=!0,this._values=new Map,this._viewer.scene.primitives.add(this),this.img={}}ux.prototype.add=function(o={}){o.id=o.id||this._core.uuid(),o.name=o.name||"\u7EA2\u7EFF\u706F";let f=document.createElement("canvas"),m=f.getContext("2d");return this._values.set(o.id,{id:o.id,name:o.name,canvas:f,context:m,far:o.far||800,state:{left:-1,center:1,right:1,time:30},show:!0,deleteObject:()=>{this.removeById(o.id)},setVisibility:v=>{this.showById(o.id,v)},update:v=>{this.updateById(o.id,v)}}),this.loadImage||(this.loadImage=[oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.l_go).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.l_wait).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.l_stop).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.l_null).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.go).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.wait).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.stop).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.null).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.r_go).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.r_wait).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.r_stop).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.r_null).fetchImage(),oh.Resource.createIfNeeded(window.SmartEarthRootUrl+pn.trafficLight.bg).fetchImage()]),this.imageData?this.addGeometry(o):Promise.all(this.loadImage).then(v=>{this.imageData={left:{go:v[0],wait:v[1],stop:v[2],null:v[3]},center:{go:v[4],wait:v[5],stop:v[6],null:v[7]},right:{go:v[8],wait:v[9],stop:v[10],null:v[11]},bg:v[12]},this.addGeometry(o)}),this._values.get(o.id)};ux.prototype.addGeometry=function(o={}){let f=this._values.get(o.id);this.drawImage(f,o);let m=o.scale||1,v=f.canvas.width*.02*m,y=f.canvas.height*.02*m,x=new oh.Cartesian3(v,y,1),C=oh.Cartesian3.fromDegrees(o.position.lon,o.position.lat,o.position.height+y);f.position=C;let w=oh.Transforms.eastNorthUpToFixedFrame(C),A=new oh.HeadingPitchRoll(oh.Math.toRadians(o.heading||0),oh.Math.toRadians(0),oh.Math.toRadians(90)),E=oh.Matrix3.fromHeadingPitchRoll(A);oh.Matrix4.multiplyByMatrix3(w,E,w);let T=oh.Matrix4.fromScale(x);oh.Matrix4.multiply(w,T,w);let S=new oh.PlaneGeometry,M=new oh.GeometryInstance({geometry:S,modelMatrix:w,attributes:{color:oh.ColorGeometryInstanceAttribute.fromColor(oh.Color.WHITE)}}),I=oh.Material.fromType("Image");I.uniforms.image=f.canvas.toDataURL("image/png"),f.geometry=new oh.Primitive({id:o,geometryInstances:M,appearance:new oh.MaterialAppearance({flat:!0,material:I})})};ux.prototype.getImage=function(o,f){let m="null";return f===0?m="wait":f===-1?m="stop":f===1&&(m="go"),this.imageData[o][m]};ux.prototype.drawImage=function(o,f){let m=this._core.defaultValue(f.left,o.state.left),v=this._core.defaultValue(f.center,o.state.center),y=this._core.defaultValue(f.right,o.state.right),x=this._core.defaultValue(f.time,o.state.time);o.state={left:m,center:v,right:y,time:x};let C=this.imageData.bg,w=this.getImage("left",m),A=this.getImage("left"),E=this.getImage("center",v),T=this.getImage("center"),S=this.getImage("right",y),M=this.getImage("right");o.canvas.height=C.height,o.canvas.width=C.width,o.context.drawImage(C,0,0,C.width,C.height,0,0,C.width,C.height);let I=10,P=303,D=485,L=15,R=w.height+25,O=w.height*2+35;o.context.drawImage(m===-1?w:A,0,0,w.width,w.height,I,L,w.width,w.height),o.context.drawImage(m===0?w:A,0,0,w.width,w.height,I,R,w.width,w.height),o.context.drawImage(m===1?w:A,0,0,w.width,w.height,I,O,w.width,w.height),o.context.drawImage(v===-1?E:T,0,0,E.width,E.height,P,L,E.width,E.height),o.context.drawImage(v===0?E:T,0,0,E.width,E.height,P,R,E.width,E.height),o.context.drawImage(v===1?E:T,0,0,E.width,E.height,P,O,E.width,E.height),o.context.drawImage(y===-1?S:M,0,0,S.width,S.height,D,L,S.width,S.height),o.context.drawImage(y===0?S:M,0,0,S.width,S.height,D,R,S.width,S.height),o.context.drawImage(y===1?S:M,0,0,S.width,S.height,D,O,S.width,S.height),this.drawTime(o.context,{left:m,center:v,x:153,y:143,time:x})};ux.prototype.drawTime=function(o,f={}){let m=1;f.left===0||f.center===0?m=0:f.left===1||f.center===1?m=1:f.left===-1&&f.center===-1&&(m=-1);let v="#31fb09";m===0?v="#ffd511":m===-1&&(v="#f81838");let y=f.time||0;y<0&&(y=0),y>99&&(y=99),y===0?y="00":y<10?y="0"+y:y+="",o.font="bold 60px Arial",o.fillStyle=v,o.fillText(y,f.x,f.y)};ux.prototype.updateById=function(o,f={}){let m=this._values.get(o);m&&(m.context.clearRect(0,0,m.canvas.width,m.canvas.height),this.drawImage(m,f),m.context.isUpdate=!0)};ux.prototype.update=function(o){if(this.show)for(let f of this._values.values())f.show&&f.geometry&&this.isShow(f)&&(f.context.isUpdate&&(f.geometry.appearance.material.uniforms.image=f.canvas.toDataURL("image/png"),f.context.isUpdate=null),f.geometry.update(o))};ux.prototype.isShow=function(o){return oh.Cartesian3.distance(this._viewer.camera.position,o.position)<o.far};ux.prototype.removeById=function(o){let f=this._values.get(o);f&&f.geometry&&f.geometry.destroy(),this._values.delete(o)};ux.prototype.showById=function(o,f){let m=this._values.get(o);m&&(m.show=f)};ux.prototype.isDestroyed=function(){return this.destroyed};ux.prototype.destroy=function(){for(let o of this._values.values())o.geometry&&o.geometry.destroy();this._values=new Map,this.img=null,this.imageData=null,this.destroyed=!0};ux.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this),this.destroy()};ux.prototype.setVisibility=function(o){this.show=o};var Lle=ux;var B_=null;function O8(o,f){B_=f,this._viewer=o,this._core=new Sr(o,B_)}O8.prototype.create=function(o,f={}){this.grid=this._core.defaultValue(f.grid,!0);let m=f.center,v=f.scale||1;return this._core.getJSON(o,y=>{var x=Math.max(...y.mData)*v,C=y.mHorPointsNum,w=y.mVerPointsNum;if(y.mCenterPoint&&y.mCenterPoint.length&&(m=y.mCenterPoint),!m){console.log("\u7F3A\u5C11\u573A\u5F3A\u4E2D\u5FC3\u5750\u6807");return}var A=new Float64Array(y.mData.length*3),E=0,T=new Float32Array(y.mData.length*2),S=0,M=new Uint16Array(C*(w-1)*2*3),I=0;let P=0;for(let D=y.mHStartAngle,L=0;D<y.mHEndAngle;D+=y.mHStep,L++)for(let R=y.mVStartAngle,O=0;R<=y.mVEndAngle;R+=y.mVStep,O++){let F=y.mData[P++]*v,k=this._core.getPositionFromHPR(m,F,D,R),U=B_.Cartesian3.fromDegrees(k.lon,k.lat,k.height);A[E++]=U.x,A[E++]=U.y,A[E++]=U.z,T[S++]=(L+1)/C,T[S++]=Math.pow(F/x,3),L!==0&&O!==0&&(M[I++]=(L-1)*w+(O-1),M[I++]=(L-1)*w+O,M[I++]=L*w+O-1,M[I++]=(L-1)*w+O,M[I++]=L*w+O,M[I++]=L*w+O-1,L===C-1&&(M[I++]=O-1,M[I++]=O,M[I++]=L*w+O-1,M[I++]=O,M[I++]=L*w+O,M[I++]=L*w+O-1))}this.addGeometry({positions:A,st:T,indexs:M,minColor:f.minColor,maxColor:f.maxColor},f.flyTo)}),this};O8.prototype.addGeometry=function(o,f){let m=new B_.Geometry({attributes:{position:new B_.GeometryAttribute({componentDatatype:B_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o.positions}),st:new B_.GeometryAttribute({componentDatatype:B_.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:o.st})},indices:o.indexs,primitiveType:this.grid?B_.PrimitiveType.LINES:B_.PrimitiveType.TRIANGLES,boundingSphere:B_.BoundingSphere.fromVertices(o.positions)}),v=new B_.GeometryInstance({geometry:m});this.item=new B_.Primitive({geometryInstances:v,appearance:new B_.EllipsoidSurfaceAppearance({material:new B_.Material({fabric:{uniforms:{color1:B_.Color.fromCssColorString(o.minColor||"#ff0000"),color2:B_.Color.fromCssColorString(o.maxColor||"#00ff00")},source:this.getShader()}})}),asynchronous:!1}),this._viewer.scene.primitives.add(this.item),f&&this._viewer.camera.flyToBoundingSphere(m.boundingSphere)};O8.prototype.setVisibility=function(o){this.item&&(this.item.show=o)};O8.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item)};O8.prototype.getShader=function(){return`uniform vec4 color1; uniform vec4 color2; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); vec2 st = materialInput.st; material.diffuse = color1.rgb * (1.0 - st.y) + color2.rgb * st.y; material.alpha = color1.a * (1.0 - st.y) + color2.a * st.y; return material; } `};var Rle=O8;function DLe(o,f){this._viewer=o,this._cesium=f}DLe.prototype.createScreenshot=function(o="png"){var f=this._viewer.scene.canvas,m=f.toDataURL("image/"+o),v=document.createElement("a");v.download="\u622A\u56FE."+o,v.href=m,v.click()};DLe.prototype.createScreenshotCompared=function(o,f){var m=this._viewer.scene.canvas,v=m.toDataURL("image/png");(f||layuiLayer).open({title:o||"\u622A\u56FE\u5BF9\u6BD4",type:1,skin:"other-class",shade:0,shadeClose:!0,resize:!1,moveOut:!0,area:[m.width*.7+"px",m.height*.7+42+"px"],content:'<img src="'+v+'" style="height:100%;width:100%;">'})};var Ole=DLe;function UD(o,f){return this._tool=new ls(o),this._earthCtrl=o,this._viewer=o.coreMap,this.width=f.width?f.width:10,this.height=f.height?f.height:10,this.length=f.width?f.length:10,this.edgeColor=f.edgeColor||Re.WHITE,this.edgeWidth=f.edgeWidth||1,this.boxMaterial=f.boxMaterial||Re.WHITE.withAlpha(.3),this.showOutline=Z(f.showOutline,!0),this.modelUp=!1,this.clippingBoxs=[],this.opposite=f.opposite||!1,this.orientation={heading:f.heading||0,pitch:f.pitch||0,roll:f.roll||0},this.clickEvent=Z(f.clickEvent,!1),this.positions=f.positions,this.clickCallBack=f.clickCallBack,this.models=[...f.models],!this.positions||this.positions.length<2?this.selectPoint():this.addClippingBox(),this}UD.prototype.selectPoint=function(){let o=this;this.editHandler=new Ur(o._viewer.scene.canvas),o._earthCtrl._core.mouse(this._viewer.container,1,`${window.SmartEarthRootUrl}Assets/image/cursor/draw.cur`),this.editHandler.setInputAction(function(f){let m=o._tool.pickVector(f.position);if(m){let v=Mt.fromCartesian(m),y=xe.toDegrees(v.longitude),x=xe.toDegrees(v.latitude);o.positions=[y,x,v.height],o.endDraw(),o.addClippingBox()}},Ei.LEFT_CLICK),this.editHandler.setInputAction(function(f){o.endDraw()},Ei.RIGHT_CLICK),this.endDraw=f=>{o.editHandler!==void 0&&(o.editHandler.destroy(),o.editHandler=void 0),o._earthCtrl._core.mouse(o._viewer.container,0,"0"),o.endDraw=void 0}};UD.prototype.addClippingBox=function(o={}){if(!(this.models.length===0||this.positions.length===0))if(this.newCar3=H.fromDegrees(this.positions[0],this.positions[1],this.positions[2]),this.modelUp&&this.clippingBoxs.map(f=>{f.removeAll()}),this.clippingBoxs=[],this.models.map(f=>{let m=new Uv({planes:[],edgeWidth:1});m=this.modelClipping(f,m),this.createClippingBox(m),this.clippingBoxs.push(m)}),!this.outlineBox&&this.showOutline){this.outlineBox=this._viewer.entities.add({name:"modelClippingBox",position:this.newCar3,orientation:tn.headingPitchRollQuaternion(this.newCar3,new dl(xe.toRadians(this.orientation.heading),xe.toRadians(this.orientation.pitch),xe.toRadians(this.orientation.roll))),box:{dimensions:new H(this.width,this.length,this.height),material:this.boxMaterial,outline:!0,outlineColor:this.edgeColor,outlineWidth:2},headingPitchRoll:this.orientation}),this.box_id=this.outlineBox._id;let f=this;this.clickCallBack&&(this.editHandler||(this.editHandler=new Ur(f._viewer.scene.canvas),this.editHandler.setInputAction(m=>{if(f.clickEvent){let v=f._viewer.scene.pick(m.position);v&&v.id&&v.id._id===f.box_id&&f.clickCallBack(m,v)}},Ei.LEFT_DOWN)))}else{let f=this;if(!f.showOutline&&this.outlineBox&&(this._viewer.entities.remove(this.outlineBox),this.outlineBox=null),this.outlineBox){this.outlineBox.position=f.newCar3,this.outlineBox.headingPitchRoll=this.orientation;let m=tn.headingPitchRollQuaternion(f.newCar3,new dl(xe.toRadians(f.orientation.heading),xe.toRadians(f.orientation.pitch),xe.toRadians(f.orientation.roll)));this.outlineBox.orientation=m,this.outlineBox._box.dimensions=new xn(function(){return new H(f.width,f.length,f.height)},!1)}}};UD.prototype.modelClipping=function(o,f={}){let m=f;if(!!o){if(o.boundingSphereCenter&&o.item&&o.modelEditData){o.item.clippingPlanes?m=o.item.clippingPlanes:o.item.clippingPlanes=m;let v=Ee.getTranslation(o.item._clippingPlanesOriginMatrix,new H),y=Mt.fromCartesian(v);return m.modelCeter=[xe.toDegrees(y.longitude),xe.toDegrees(y.latitude),y.height],o.modelEditData?m.OriginRotation={heading:o.modelEditData.heading||0,pitch:o.modelEditData.pitch||0,roll:o.modelEditData.roll||0}:(m.addHeight=0,m.OriginRotation={heading:0,pitch:0,roll:0}),m.unionClippingRegions=this.opposite,m.edgeColor=this.edgeColor,m.edgeWidth=this.edgeWidth,m}if(o._primitive&&o._primitive.type&&o._primitive.type==="GLTF"){o._primitive.clippingPlanes?m=o._primitive.clippingPlanes:o._primitive.clippingPlanes=m;let v=Ee.getTranslation(o._primitive.modelMatrix,new H),y=Mt.fromCartesian(v);return m.modelCeter=[xe.toDegrees(y.longitude),xe.toDegrees(y.latitude),y.height],m.addHeight=0,m.OriginRotation=this.matrixGetRotation(o._primitive.modelMatrix),m.OriginRotation={heading:m.OriginRotation.heading,pitch:m.OriginRotation.pitch,roll:m.OriginRotation.roll},m.unionClippingRegions=this.opposite,m.edgeColor=this.edgeColor,m.edgeWidth=this.edgeWidth,m.modeType="GLTF",o._primitive.clippingPlanes}if(o.boundingSphere&&o.modelMatrix&&o._root&&o._root._tileset){o.clippingPlanes?m=o.clippingPlanes:o.clippingPlanes=m;let v=Ee.getTranslation(o._clippingPlanesOriginMatrix,new H),y=Mt.fromCartesian(v);return m.modelCeter=[xe.toDegrees(y.longitude),xe.toDegrees(y.latitude),y.height],m.addHeight=0,m.OriginRotation={heading:0,pitch:0,roll:0},m.unionClippingRegions=this.opposite,m.edgeColor=this.edgeColor,m.edgeWidth=this.edgeWidth,m.modeType="3DTiles",o.clippingPlanes}if(o.SetClipPlane)return m.OriginRotation={roll:0,pitch:0,heading:0},m.addHeight=0,m.modelCeter=this.positions,m.unionClippingRegions=this.opposite,m.edgeColor=this.edgeColor,m.edgeWidth=this.edgeWidth,m.modeType="bim",m.bim=o,m}};UD.prototype.calDistance=function(o,f,m){let v=H.fromDegrees(o[0],f[1],f[2]),y=H.fromDegrees(f[0],f[1],f[2]),x=H.distanceSquared(v,y);x=Math.sqrt(x.toFixed(6)),o[0]<f[0]&&(x=-x);let C=H.fromDegrees(f[0],o[1],f[2]),w=H.fromDegrees(f[0],f[1],f[2]),A=H.distanceSquared(C,w);A=Math.sqrt(A.toFixed(6)),o[1]<f[1]&&(A=-A);let E=o[2]-f[2];return new H(x,A,E)};UD.prototype.createClippingBox=function(o){let f=this,m;o.modeType==="bim"?m=this.newCar3:m=this.calDistance(this.positions,o.modelCeter,o);let v=new dl(xe.toRadians(f.orientation.heading),xe.toRadians(f.orientation.pitch),xe.toRadians(f.orientation.roll)),y=f.opposite?f.length/2:-f.length/2,x=f.opposite?f.width/2:-f.width/2,C=f.opposite?f.height/2:-f.height/2;if(o.modeType==="bim"){let P=tn.headingPitchRollToFixedFrame(m,v),D=Ee.toArray(P);return o.bim.SetClipPlane(D,f.opposite,[0,0,1,Math.abs(C)],[0,0,-1,Math.abs(C)],[0,1,0,Math.abs(y)],[0,-1,0,Math.abs(y)],[1,0,0,Math.abs(x)],[-1,0,0,Math.abs(x)]),o}let w=new Gr(0,0,0,1),A=Gr.fromAxisAngle(new H(1,0,0),xe.toRadians(-o.OriginRotation.roll)),E=Gr.fromAxisAngle(new H(0,1,0),xe.toRadians(o.OriginRotation.pitch)),T=Gr.fromAxisAngle(new H(0,0,1),xe.toRadians(o.OriginRotation.heading));w=Gr.multiply(w,A,new Gr),w=Gr.multiply(w,E,new Gr),w=Gr.multiply(w,T,new Gr);let S=Ee.fromRotationTranslation(Ut.fromQuaternion(w)),M=Ee.multiplyByPoint(S,m,new H),I=Gr.fromHeadingPitchRoll(v);return w=Gr.multiply(w,I,new Gr),o.modelMatrix=Ee.fromTranslationQuaternionRotationScale(M,w,new H(1,1,1)),o.removeAll(),o.add(new zv(new H(0,0,1),C)),o.add(new zv(new H(0,0,-1),C)),o.add(new zv(new H(0,1,0),y)),o.add(new zv(new H(0,-1,0),y)),o.add(new zv(new H(1,0,0),x)),o.add(new zv(new H(-1,0,0),x)),o};UD.prototype.updateClipping=function(o={}){!this.clippingBoxs||this.clippingBoxs.length===0||(o.models&&o.models!==this.models?(this.modelUp=!0,this.models=[...o.models]):this.modelUp=!1,this.positions=o.positions||this.positions,this.opposite=Z(o.opposite,this.opposite),this.width=o.width||this.width,this.height=o.height||this.height,this.length=o.length||this.length,this.showOutline=Z(o.showOutline,this.showOutline),this.edgeWidth=o.edgeWidth||this.edgeWidth,this.orientation={heading:o.heading||this.orientation.heading,pitch:o.pitch||this.orientation.pitch,roll:o.roll||this.orientation.roll},o.changePosition?this.selectPoint():this.addClippingBox())};UD.prototype.delateAll=function(){this.clippingBoxs.map(o=>{o.modeType==="bim"&&o.bim.SetClipPlane(),o.removeAll()}),this.clippingBoxs=[],this.outlineBox&&(this._viewer.entities.remove(this.outlineBox),this.outlineBox=null),this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0};UD.prototype.matrixGetRotation=function(o){let f=tn.eastNorthUpToFixedFrame(Ee.getTranslation(o,new H),ki.WGS84,new Ee),m=Ee.multiply(Ee.inverse(f,new Ee),o,new Ee),v=Ee.getRotation(m,new Ut),y=Gr.fromRotationMatrix(v),x=dl.fromQuaternion(y),C=xe.toDegrees(x.heading),w=xe.toDegrees(x.pitch),A=xe.toDegrees(x.roll);return{heading:C,pitch:w,roll:A}};var eht=UD;function b5i(o,f={}){if(this._earthCtrl=o,!f.url&&!f.originPosition)return;f.viewer=o.viewer;let m=new gae(this._earthCtrl,f);return this._earthCtrl.viewer.scene.primitives.add(m)}var tht=b5i;function w5i(o,f={}){if(this._earthCtrl=o,!f.url&&!f.originPosition)return;f.viewer=o.viewer;let m=new mae(this._earthCtrl,f);return this._earthCtrl.viewer.scene.primitives.add(m)}var iht=w5i;function rht(o){o("EPSG:4326","+title=WGS 84 (long/lat) +proj=longlat +ellps=WGS84 +datum=WGS84 +units=degrees"),o("EPSG:4269","+title=NAD83 (long/lat) +proj=longlat +a=6378137.0 +b=6356752.31414036 +ellps=GRS80 +datum=NAD83 +units=degrees"),o("EPSG:3857","+title=WGS 84 / Pseudo-Mercator +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +no_defs"),o.WGS84=o["EPSG:4326"],o["EPSG:3785"]=o["EPSG:3857"],o.GOOGLE=o["EPSG:3857"],o["EPSG:900913"]=o["EPSG:3857"],o["EPSG:102113"]=o["EPSG:3857"]}var jT=1,YT=2,GD=3,nht=4,uJ=5,LLe=6378137,oht=6356752314e-3,RLe=.0066943799901413165,B4=484813681109536e-20,Yn=Math.PI/2,aht=.16666666666666666,sht=.04722222222222222,lht=.022156084656084655,xo=1e-10,Op=.017453292519943295,RC=57.29577951308232,Fc=Math.PI/4,eN=Math.PI*2,Np=3.14159265359;var cx={};cx.greenwich=0;cx.lisbon=-9.131906111111;cx.paris=2.337229166667;cx.bogota=-74.080916666667;cx.madrid=-3.687938888889;cx.rome=12.452333333333;cx.bern=7.439583333333;cx.jakarta=106.807719444444;cx.ferro=-17.666666666667;cx.brussels=4.367975;cx.stockholm=18.058277777778;cx.athens=23.7163375;cx.oslo=10.722916666667;var uht={ft:{to_meter:.3048},"us-ft":{to_meter:1200/3937}};var cht=/[\s_\-\/\(\)]/g;function Eb(o,f){if(o[f])return o[f];for(var m=Object.keys(o),v=f.toLowerCase().replace(cht,""),y=-1,x,C;++y<m.length;)if(x=m[y],C=x.toLowerCase().replace(cht,""),C===v)return o[x]}function cJ(o){var f={},m=o.split("+").map(function(w){return w.trim()}).filter(function(w){return w}).reduce(function(w,A){var E=A.split("=");return E.push(!0),w[E[0].toLowerCase()]=E[1],w},{}),v,y,x,C={proj:"projName",datum:"datumCode",rf:function(w){f.rf=parseFloat(w)},lat_0:function(w){f.lat0=w*Op},lat_1:function(w){f.lat1=w*Op},lat_2:function(w){f.lat2=w*Op},lat_ts:function(w){f.lat_ts=w*Op},lon_0:function(w){f.long0=w*Op},lon_1:function(w){f.long1=w*Op},lon_2:function(w){f.long2=w*Op},alpha:function(w){f.alpha=parseFloat(w)*Op},gamma:function(w){f.rectified_grid_angle=parseFloat(w)},lonc:function(w){f.longc=w*Op},x_0:function(w){f.x0=parseFloat(w)},y_0:function(w){f.y0=parseFloat(w)},k_0:function(w){f.k0=parseFloat(w)},k:function(w){f.k0=parseFloat(w)},a:function(w){f.a=parseFloat(w)},b:function(w){f.b=parseFloat(w)},r_a:function(){f.R_A=!0},zone:function(w){f.zone=parseInt(w,10)},south:function(){f.utmSouth=!0},towgs84:function(w){f.datum_params=w.split(",").map(function(A){return parseFloat(A)})},to_meter:function(w){f.to_meter=parseFloat(w)},units:function(w){f.units=w;var A=Eb(uht,w);A&&(f.to_meter=A.to_meter)},from_greenwich:function(w){f.from_greenwich=w*Op},pm:function(w){var A=Eb(cx,w);f.from_greenwich=(A||parseFloat(w))*Op},nadgrids:function(w){w==="@null"?f.datumCode="none":f.nadgrids=w},axis:function(w){var A="ewnsud";w.length===3&&A.indexOf(w.substr(0,1))!==-1&&A.indexOf(w.substr(1,1))!==-1&&A.indexOf(w.substr(2,1))!==-1&&(f.axis=w)},approx:function(){f.approx=!0}};for(v in m)y=m[v],v in C?(x=C[v],typeof x=="function"?x(y):f[x]=y):f[v]=y;return typeof f.datumCode=="string"&&f.datumCode!=="WGS84"&&(f.datumCode=f.datumCode.toLowerCase()),f}var hht=S5i,hJ=1,dht=2,fht=3,Nle=4,pht=5,OLe=-1,A5i=/\s/,E5i=/[A-Za-z]/,T5i=/[A-Za-z84_]/,Fle=/[,\]]/,mht=/[\d\.E\-\+]/;function WD(o){if(typeof o!="string")throw new Error("not a string");this.text=o.trim(),this.level=0,this.place=0,this.root=null,this.stack=[],this.currentObject=null,this.state=hJ}WD.prototype.readCharicter=function(){var o=this.text[this.place++];if(this.state!==Nle)for(;A5i.test(o);){if(this.place>=this.text.length)return;o=this.text[this.place++]}switch(this.state){case hJ:return this.neutral(o);case dht:return this.keyword(o);case Nle:return this.quoted(o);case pht:return this.afterquote(o);case fht:return this.number(o);case OLe:return}};WD.prototype.afterquote=function(o){if(o==='"'){this.word+='"',this.state=Nle;return}if(Fle.test(o)){this.word=this.word.trim(),this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in afterquote yet, index '+this.place)};WD.prototype.afterItem=function(o){if(o===","){this.word!==null&&this.currentObject.push(this.word),this.word=null,this.state=hJ;return}if(o==="]"){this.level--,this.word!==null&&(this.currentObject.push(this.word),this.word=null),this.state=hJ,this.currentObject=this.stack.pop(),this.currentObject||(this.state=OLe);return}};WD.prototype.number=function(o){if(mht.test(o)){this.word+=o;return}if(Fle.test(o)){this.word=parseFloat(this.word),this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in number yet, index '+this.place)};WD.prototype.quoted=function(o){if(o==='"'){this.state=pht;return}this.word+=o};WD.prototype.keyword=function(o){if(T5i.test(o)){this.word+=o;return}if(o==="["){var f=[];f.push(this.word),this.level++,this.root===null?this.root=f:this.currentObject.push(f),this.stack.push(this.currentObject),this.currentObject=f,this.state=hJ;return}if(Fle.test(o)){this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in keyword yet, index '+this.place)};WD.prototype.neutral=function(o){if(E5i.test(o)){this.word=o,this.state=dht;return}if(o==='"'){this.word="",this.state=Nle;return}if(mht.test(o)){this.word=o,this.state=fht;return}if(Fle.test(o)){this.afterItem(o);return}throw new Error(`havn't handled "`+o+'" in neutral yet, index '+this.place)};WD.prototype.output=function(){for(;this.place<this.text.length;)this.readCharicter();if(this.state===OLe)return this.root;throw new Error('unable to parse string "'+this.text+'". State is '+this.state)};function S5i(o){var f=new WD(o);return f.output()}function ght(o,f,m){Array.isArray(f)&&(m.unshift(f),f=null);var v=f?{}:o,y=m.reduce(function(x,C){return k4(C,x),x},v);f&&(o[f]=y)}function k4(o,f){if(!Array.isArray(o)){f[o]=!0;return}var m=o.shift();if(m==="PARAMETER"&&(m=o.shift()),o.length===1){if(Array.isArray(o[0])){f[m]={},k4(o[0],f[m]);return}f[m]=o[0];return}if(!o.length){f[m]=!0;return}if(m==="TOWGS84"){f[m]=o;return}if(m==="AXIS"){m in f||(f[m]=[]),f[m].push(o);return}Array.isArray(m)||(f[m]={});var v;switch(m){case"UNIT":case"PRIMEM":case"VERT_DATUM":f[m]={name:o[0].toLowerCase(),convert:o[1]},o.length===3&&k4(o[2],f[m]);return;case"SPHEROID":case"ELLIPSOID":f[m]={name:o[0],a:o[1],rf:o[2]},o.length===4&&k4(o[3],f[m]);return;case"PROJECTEDCRS":case"PROJCRS":case"GEOGCS":case"GEOCCS":case"PROJCS":case"LOCAL_CS":case"GEODCRS":case"GEODETICCRS":case"GEODETICDATUM":case"EDATUM":case"ENGINEERINGDATUM":case"VERT_CS":case"VERTCRS":case"VERTICALCRS":case"COMPD_CS":case"COMPOUNDCRS":case"ENGINEERINGCRS":case"ENGCRS":case"FITTED_CS":case"LOCAL_DATUM":case"DATUM":o[0]=["name",o[0]],ght(f,m,o);return;default:for(v=-1;++v<o.length;)if(!Array.isArray(o[v]))return k4(o,f[m]);return ght(f,m,o)}}var P5i=.017453292519943295;function I5i(o,f){var m=f[0],v=f[1];!(m in o)&&v in o&&(o[m]=o[v],f.length===3&&(o[m]=f[2](o[m])))}function OP(o){return o*P5i}function M5i(o){if(o.type==="GEOGCS"?o.projName="longlat":o.type==="LOCAL_CS"?(o.projName="identity",o.local=!0):typeof o.PROJECTION=="object"?o.projName=Object.keys(o.PROJECTION)[0]:o.projName=o.PROJECTION,o.AXIS){for(var f="",m=0,v=o.AXIS.length;m<v;++m){var y=[o.AXIS[m][0].toLowerCase(),o.AXIS[m][1].toLowerCase()];y[0].indexOf("north")!==-1||(y[0]==="y"||y[0]==="lat")&&y[1]==="north"?f+="n":y[0].indexOf("south")!==-1||(y[0]==="y"||y[0]==="lat")&&y[1]==="south"?f+="s":y[0].indexOf("east")!==-1||(y[0]==="x"||y[0]==="lon")&&y[1]==="east"?f+="e":(y[0].indexOf("west")!==-1||(y[0]==="x"||y[0]==="lon")&&y[1]==="west")&&(f+="w")}f.length===2&&(f+="u"),f.length===3&&(o.axis=f)}o.UNIT&&(o.units=o.UNIT.name.toLowerCase(),o.units==="metre"&&(o.units="meter"),o.UNIT.convert&&(o.type==="GEOGCS"?o.DATUM&&o.DATUM.SPHEROID&&(o.to_meter=o.UNIT.convert*o.DATUM.SPHEROID.a):o.to_meter=o.UNIT.convert));var x=o.GEOGCS;o.type==="GEOGCS"&&(x=o),x&&(x.DATUM?o.datumCode=x.DATUM.name.toLowerCase():o.datumCode=x.name.toLowerCase(),o.datumCode.slice(0,2)==="d_"&&(o.datumCode=o.datumCode.slice(2)),(o.datumCode==="new_zealand_geodetic_datum_1949"||o.datumCode==="new_zealand_1949")&&(o.datumCode="nzgd49"),(o.datumCode==="wgs_1984"||o.datumCode==="world_geodetic_system_1984")&&(o.PROJECTION==="Mercator_Auxiliary_Sphere"&&(o.sphere=!0),o.datumCode="wgs84"),o.datumCode.slice(-6)==="_ferro"&&(o.datumCode=o.datumCode.slice(0,-6)),o.datumCode.slice(-8)==="_jakarta"&&(o.datumCode=o.datumCode.slice(0,-8)),~o.datumCode.indexOf("belge")&&(o.datumCode="rnb72"),x.DATUM&&x.DATUM.SPHEROID&&(o.ellps=x.DATUM.SPHEROID.name.replace("_19","").replace(/[Cc]larke\_18/,"clrk"),o.ellps.toLowerCase().slice(0,13)==="international"&&(o.ellps="intl"),o.a=x.DATUM.SPHEROID.a,o.rf=parseFloat(x.DATUM.SPHEROID.rf,10)),x.DATUM&&x.DATUM.TOWGS84&&(o.datum_params=x.DATUM.TOWGS84),~o.datumCode.indexOf("osgb_1936")&&(o.datumCode="osgb36"),~o.datumCode.indexOf("osni_1952")&&(o.datumCode="osni52"),(~o.datumCode.indexOf("tm65")||~o.datumCode.indexOf("geodetic_datum_of_1965"))&&(o.datumCode="ire65"),o.datumCode==="ch1903+"&&(o.datumCode="ch1903"),~o.datumCode.indexOf("israel")&&(o.datumCode="isr93")),o.b&&!isFinite(o.b)&&(o.b=o.a);function C(E){var T=o.to_meter||1;return E*T}var w=function(E){return I5i(o,E)},A=[["standard_parallel_1","Standard_Parallel_1"],["standard_parallel_1","Latitude of 1st standard parallel"],["standard_parallel_2","Standard_Parallel_2"],["standard_parallel_2","Latitude of 2nd standard parallel"],["false_easting","False_Easting"],["false_easting","False easting"],["false-easting","Easting at false origin"],["false_northing","False_Northing"],["false_northing","False northing"],["false_northing","Northing at false origin"],["central_meridian","Central_Meridian"],["central_meridian","Longitude of natural origin"],["central_meridian","Longitude of false origin"],["latitude_of_origin","Latitude_Of_Origin"],["latitude_of_origin","Central_Parallel"],["latitude_of_origin","Latitude of natural origin"],["latitude_of_origin","Latitude of false origin"],["scale_factor","Scale_Factor"],["k0","scale_factor"],["latitude_of_center","Latitude_Of_Center"],["latitude_of_center","Latitude_of_center"],["lat0","latitude_of_center",OP],["longitude_of_center","Longitude_Of_Center"],["longitude_of_center","Longitude_of_center"],["longc","longitude_of_center",OP],["x0","false_easting",C],["y0","false_northing",C],["long0","central_meridian",OP],["lat0","latitude_of_origin",OP],["lat0","standard_parallel_1",OP],["lat1","standard_parallel_1",OP],["lat2","standard_parallel_2",OP],["azimuth","Azimuth"],["alpha","azimuth",OP],["srsCode","name"]];A.forEach(w),!o.long0&&o.longc&&(o.projName==="Albers_Conic_Equal_Area"||o.projName==="Lambert_Azimuthal_Equal_Area")&&(o.long0=o.longc),!o.lat_ts&&o.lat1&&(o.projName==="Stereographic_South_Pole"||o.projName==="Polar Stereographic (variant B)")?(o.lat0=OP(o.lat1>0?90:-90),o.lat_ts=o.lat1):!o.lat_ts&&o.lat0&&o.projName==="Polar_Stereographic"&&(o.lat_ts=o.lat0,o.lat0=OP(o.lat0>0?90:-90))}function Ble(o){var f=hht(o),m=f.shift(),v=f.shift();f.unshift(["name",v]),f.unshift(["type",m]);var y={};return k4(f,y),M5i(y),y}function EA(o){var f=this;if(arguments.length===2){var m=arguments[1];typeof m=="string"?m.charAt(0)==="+"?EA[o]=cJ(arguments[1]):EA[o]=Ble(arguments[1]):EA[o]=m}else if(arguments.length===1){if(Array.isArray(o))return o.map(function(v){Array.isArray(v)?EA.apply(f,v):EA(v)});if(typeof o=="string"){if(o in EA)return EA[o]}else"EPSG"in o?EA["EPSG:"+o.EPSG]=o:"ESRI"in o?EA["ESRI:"+o.ESRI]=o:"IAU2000"in o?EA["IAU2000:"+o.IAU2000]=o:console.log(o);return}}rht(EA);var N8=EA;function D5i(o){return typeof o=="string"}function L5i(o){return o in N8}var R5i=["PROJECTEDCRS","PROJCRS","GEOGCS","GEOCCS","PROJCS","LOCAL_CS","GEODCRS","GEODETICCRS","GEODETICDATUM","ENGCRS","ENGINEERINGCRS"];function O5i(o){return R5i.some(function(f){return o.indexOf(f)>-1})}var N5i=["3857","900913","3785","102113"];function F5i(o){var f=Eb(o,"authority");if(!!f){var m=Eb(f,"epsg");return m&&N5i.indexOf(m)>-1}}function B5i(o){var f=Eb(o,"extension");if(!!f)return Eb(f,"proj4")}function k5i(o){return o[0]==="+"}function V5i(o){if(D5i(o)){if(L5i(o))return N8[o];if(O5i(o)){var f=Ble(o);if(F5i(f))return N8["EPSG:3857"];var m=B5i(f);return m?cJ(m):f}if(k5i(o))return cJ(o)}else return o}var _ht=V5i;function NLe(o,f){o=o||{};var m,v;if(!f)return o;for(v in f)m=f[v],m!==void 0&&(o[v]=m);return o}function iy(o,f,m){var v=o*f;return m/Math.sqrt(1-v*v)}function NP(o){return o<0?-1:1}function To(o){return Math.abs(o)<=Np?o:o-NP(o)*eN}function hx(o,f,m){var v=o*m,y=.5*o;return v=Math.pow((1-v)/(1+v),y),Math.tan(.5*(Yn-f))/v}function jD(o,f){for(var m=.5*o,v,y,x=Yn-2*Math.atan(f),C=0;C<=15;C++)if(v=o*Math.sin(x),y=Yn-2*Math.atan(f*Math.pow((1-v)/(1+v),m))-x,x+=y,Math.abs(y)<=1e-10)return x;return-9999}function z5i(){var o=this.b/this.a;this.es=1-o*o,"x0"in this||(this.x0=0),"y0"in this||(this.y0=0),this.e=Math.sqrt(this.es),this.lat_ts?this.sphere?this.k0=Math.cos(this.lat_ts):this.k0=iy(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)):this.k0||(this.k?this.k0=this.k:this.k0=1)}function H5i(o){var f=o.x,m=o.y;if(m*RC>90&&m*RC<-90&&f*RC>180&&f*RC<-180)return null;var v,y;if(Math.abs(Math.abs(m)-Yn)<=xo)return null;if(this.sphere)v=this.x0+this.a*this.k0*To(f-this.long0),y=this.y0+this.a*this.k0*Math.log(Math.tan(Fc+.5*m));else{var x=Math.sin(m),C=hx(this.e,m,x);v=this.x0+this.a*this.k0*To(f-this.long0),y=this.y0-this.a*this.k0*Math.log(C)}return o.x=v,o.y=y,o}function U5i(o){var f=o.x-this.x0,m=o.y-this.y0,v,y;if(this.sphere)y=Yn-2*Math.atan(Math.exp(-m/(this.a*this.k0)));else{var x=Math.exp(-m/(this.a*this.k0));if(y=jD(this.e,x),y===-9999)return null}return v=To(this.long0+f/(this.a*this.k0)),o.x=v,o.y=y,o}var G5i=["Mercator","Popular Visualisation Pseudo Mercator","Mercator_1SP","Mercator_Auxiliary_Sphere","merc"],vht={init:z5i,forward:H5i,inverse:U5i,names:G5i};function W5i(){}function yht(o){return o}var j5i=["longlat","identity"],xht={init:W5i,forward:yht,inverse:yht,names:j5i};var Y5i=[vht,xht],kle={},Vle=[];function Cht(o,f){var m=Vle.length;return o.names?(Vle[m]=o,o.names.forEach(function(v){kle[v.toLowerCase()]=m}),this):(console.log(f),!0)}function q5i(o){if(!o)return!1;var f=o.toLowerCase();if(typeof kle[f]<"u"&&Vle[kle[f]])return Vle[kle[f]]}function X5i(){Y5i.forEach(Cht)}var bht={start:X5i,add:Cht,get:q5i};var wl={};wl.MERIT={a:6378137,rf:298.257,ellipseName:"MERIT 1983"};wl.SGS85={a:6378136,rf:298.257,ellipseName:"Soviet Geodetic System 85"};wl.GRS80={a:6378137,rf:298.257222101,ellipseName:"GRS 1980(IUGG, 1980)"};wl.IAU76={a:6378140,rf:298.257,ellipseName:"IAU 1976"};wl.airy={a:6377563396e-3,b:635625691e-2,ellipseName:"Airy 1830"};wl.APL4={a:6378137,rf:298.25,ellipseName:"Appl. Physics. 1965"};wl.NWL9D={a:6378145,rf:298.25,ellipseName:"Naval Weapons Lab., 1965"};wl.mod_airy={a:6377340189e-3,b:6356034446e-3,ellipseName:"Modified Airy"};wl.andrae={a:637710443e-2,rf:300,ellipseName:"Andrae 1876 (Den., Iclnd.)"};wl.aust_SA={a:6378160,rf:298.25,ellipseName:"Australian Natl & S. Amer. 1969"};wl.GRS67={a:6378160,rf:298.247167427,ellipseName:"GRS 67(IUGG 1967)"};wl.bessel={a:6377397155e-3,rf:299.1528128,ellipseName:"Bessel 1841"};wl.bess_nam={a:6377483865e-3,rf:299.1528128,ellipseName:"Bessel 1841 (Namibia)"};wl.clrk66={a:63782064e-1,b:63565838e-1,ellipseName:"Clarke 1866"};wl.clrk80={a:6378249145e-3,rf:293.4663,ellipseName:"Clarke 1880 mod."};wl.clrk80ign={a:63782492e-1,b:6356515,rf:293.4660213,ellipseName:"Clarke 1880 (IGN)"};wl.clrk58={a:6378293645208759e-9,rf:294.2606763692654,ellipseName:"Clarke 1858"};wl.CPM={a:63757387e-1,rf:334.29,ellipseName:"Comm. des Poids et Mesures 1799"};wl.delmbr={a:6376428,rf:311.5,ellipseName:"Delambre 1810 (Belgium)"};wl.engelis={a:637813605e-2,rf:298.2566,ellipseName:"Engelis 1985"};wl.evrst30={a:6377276345e-3,rf:300.8017,ellipseName:"Everest 1830"};wl.evrst48={a:6377304063e-3,rf:300.8017,ellipseName:"Everest 1948"};wl.evrst56={a:6377301243e-3,rf:300.8017,ellipseName:"Everest 1956"};wl.evrst69={a:6377295664e-3,rf:300.8017,ellipseName:"Everest 1969"};wl.evrstSS={a:6377298556e-3,rf:300.8017,ellipseName:"Everest (Sabah & Sarawak)"};wl.fschr60={a:6378166,rf:298.3,ellipseName:"Fischer (Mercury Datum) 1960"};wl.fschr60m={a:6378155,rf:298.3,ellipseName:"Fischer 1960"};wl.fschr68={a:6378150,rf:298.3,ellipseName:"Fischer 1968"};wl.helmert={a:6378200,rf:298.3,ellipseName:"Helmert 1906"};wl.hough={a:6378270,rf:297,ellipseName:"Hough"};wl.intl={a:6378388,rf:297,ellipseName:"International 1909 (Hayford)"};wl.kaula={a:6378163,rf:298.24,ellipseName:"Kaula 1961"};wl.lerch={a:6378139,rf:298.257,ellipseName:"Lerch 1979"};wl.mprts={a:6397300,rf:191,ellipseName:"Maupertius 1738"};wl.new_intl={a:63781575e-1,b:63567722e-1,ellipseName:"New International 1967"};wl.plessis={a:6376523,rf:6355863,ellipseName:"Plessis 1817 (France)"};wl.krass={a:6378245,rf:298.3,ellipseName:"Krassovsky, 1942"};wl.SEasia={a:6378155,b:63567733205e-4,ellipseName:"Southeast Asia"};wl.walbeck={a:6376896,b:63558348467e-4,ellipseName:"Walbeck"};wl.WGS60={a:6378165,rf:298.3,ellipseName:"WGS 60"};wl.WGS66={a:6378145,rf:298.25,ellipseName:"WGS 66"};wl.WGS7={a:6378135,rf:298.26,ellipseName:"WGS 72"};var wht=wl.WGS84={a:6378137,rf:298.257223563,ellipseName:"WGS 84"};wl.sphere={a:6370997,b:6370997,ellipseName:"Normal Sphere (r=6370997)"};function Aht(o,f,m,v){var y=o*o,x=f*f,C=(y-x)/y,w=0;v?(o*=1-C*(aht+C*(sht+C*lht)),y=o*o,C=0):w=Math.sqrt(C);var A=(y-x)/x;return{es:C,e:w,ep2:A}}function Eht(o,f,m,v,y){if(!o){var x=Eb(wl,v);x||(x=wht),o=x.a,f=x.b,m=x.rf}return m&&!f&&(f=(1-1/m)*o),(m===0||Math.abs(o-f)<xo)&&(y=!0,f=o),{a:o,b:f,rf:m,sphere:y}}var t0={};t0.wgs84={towgs84:"0,0,0",ellipse:"WGS84",datumName:"WGS84"};t0.ch1903={towgs84:"674.374,15.056,405.346",ellipse:"bessel",datumName:"swiss"};t0.ggrs87={towgs84:"-199.87,74.79,246.62",ellipse:"GRS80",datumName:"Greek_Geodetic_Reference_System_1987"};t0.nad83={towgs84:"0,0,0",ellipse:"GRS80",datumName:"North_American_Datum_1983"};t0.nad27={nadgrids:"@conus,@alaska,@ntv2_0.gsb,@ntv1_can.dat",ellipse:"clrk66",datumName:"North_American_Datum_1927"};t0.potsdam={towgs84:"598.1,73.7,418.2,0.202,0.045,-2.455,6.7",ellipse:"bessel",datumName:"Potsdam Rauenberg 1950 DHDN"};t0.carthage={towgs84:"-263.0,6.0,431.0",ellipse:"clark80",datumName:"Carthage 1934 Tunisia"};t0.hermannskogel={towgs84:"577.326,90.129,463.919,5.137,1.474,5.297,2.4232",ellipse:"bessel",datumName:"Hermannskogel"};t0.osni52={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"airy",datumName:"Irish National"};t0.ire65={towgs84:"482.530,-130.596,564.557,-1.042,-0.214,-0.631,8.15",ellipse:"mod_airy",datumName:"Ireland 1965"};t0.rassadiran={towgs84:"-133.63,-157.5,-158.62",ellipse:"intl",datumName:"Rassadiran"};t0.nzgd49={towgs84:"59.47,-5.04,187.44,0.47,-0.1,1.024,-4.5993",ellipse:"intl",datumName:"New Zealand Geodetic Datum 1949"};t0.osgb36={towgs84:"446.448,-125.157,542.060,0.1502,0.2470,0.8421,-20.4894",ellipse:"airy",datumName:"Airy 1830"};t0.s_jtsk={towgs84:"589,76,480",ellipse:"bessel",datumName:"S-JTSK (Ferro)"};t0.beduaram={towgs84:"-106,-87,188",ellipse:"clrk80",datumName:"Beduaram"};t0.gunung_segara={towgs84:"-403,684,41",ellipse:"bessel",datumName:"Gunung Segara Jakarta"};t0.rnb72={towgs84:"106.869,-52.2978,103.724,-0.33657,0.456955,-1.84218,1",ellipse:"intl",datumName:"Reseau National Belge 1972"};function J5i(o,f,m,v,y,x,C){var w={};return o===void 0||o==="none"?w.datum_type=uJ:w.datum_type=nht,f&&(w.datum_params=f.map(parseFloat),(w.datum_params[0]!==0||w.datum_params[1]!==0||w.datum_params[2]!==0)&&(w.datum_type=jT),w.datum_params.length>3&&(w.datum_params[3]!==0||w.datum_params[4]!==0||w.datum_params[5]!==0||w.datum_params[6]!==0)&&(w.datum_type=YT,w.datum_params[3]*=B4,w.datum_params[4]*=B4,w.datum_params[5]*=B4,w.datum_params[6]=w.datum_params[6]/1e6+1)),C&&(w.datum_type=GD,w.grids=C),w.a=m,w.b=v,w.es=y,w.ep2=x,w}var Tht=J5i;var Sht={};function BLe(o,f){var m=new DataView(f),v=Q5i(m),y=Z5i(m,v),x=$5i(m,y,v),C={header:y,subgrids:x};return Sht[o]=C,C}function Pht(o){if(o===void 0)return null;var f=o.split(",");return f.map(K5i)}function K5i(o){if(o.length===0)return null;var f=o[0]==="@";return f&&(o=o.slice(1)),o==="null"?{name:"null",mandatory:!f,grid:null,isNull:!0}:{name:o,mandatory:!f,grid:Sht[o]||null,isNull:!1}}function F8(o){return o/3600*Math.PI/180}function Q5i(o){var f=o.getInt32(8,!1);return f===11?!1:(f=o.getInt32(8,!0),f!==11&&console.warn("Failed to detect nadgrid endian-ness, defaulting to little-endian"),!0)}function Z5i(o,f){return{nFields:o.getInt32(8,f),nSubgridFields:o.getInt32(24,f),nSubgrids:o.getInt32(40,f),shiftType:FLe(o,56,56+8).trim(),fromSemiMajorAxis:o.getFloat64(120,f),fromSemiMinorAxis:o.getFloat64(136,f),toSemiMajorAxis:o.getFloat64(152,f),toSemiMinorAxis:o.getFloat64(168,f)}}function FLe(o,f,m){return String.fromCharCode.apply(null,new Uint8Array(o.buffer.slice(f,m)))}function $5i(o,f,m){for(var v=176,y=[],x=0;x<f.nSubgrids;x++){var C=tBi(o,v,m),w=iBi(o,v,C,m),A=Math.round(1+(C.upperLongitude-C.lowerLongitude)/C.longitudeInterval),E=Math.round(1+(C.upperLatitude-C.lowerLatitude)/C.latitudeInterval);y.push({ll:[F8(C.lowerLongitude),F8(C.lowerLatitude)],del:[F8(C.longitudeInterval),F8(C.latitudeInterval)],lim:[A,E],count:C.gridNodeCount,cvs:eBi(w)}),v+=176+C.gridNodeCount*16}return y}function eBi(o){return o.map(function(f){return[F8(f.longitudeShift),F8(f.latitudeShift)]})}function tBi(o,f,m){return{name:FLe(o,f+8,f+16).trim(),parent:FLe(o,f+24,f+24+8).trim(),lowerLatitude:o.getFloat64(f+72,m),upperLatitude:o.getFloat64(f+88,m),lowerLongitude:o.getFloat64(f+104,m),upperLongitude:o.getFloat64(f+120,m),latitudeInterval:o.getFloat64(f+136,m),longitudeInterval:o.getFloat64(f+152,m),gridNodeCount:o.getInt32(f+168,m)}}function iBi(o,f,m,v){for(var y=f+176,x=16,C=[],w=0;w<m.gridNodeCount;w++){var A={latitudeShift:o.getFloat32(y+w*x,v),longitudeShift:o.getFloat32(y+w*x+4,v),latitudeAccuracy:o.getFloat32(y+w*x+8,v),longitudeAccuracy:o.getFloat32(y+w*x+12,v)};C.push(A)}return C}function B8(o,f){if(!(this instanceof B8))return new B8(o);f=f||function(E){if(E)throw E};var m=_ht(o);if(typeof m!="object"){f(o);return}var v=B8.projections.get(m.projName);if(!v){f(o);return}if(m.datumCode&&m.datumCode!=="none"){var y=Eb(t0,m.datumCode);y&&(m.datum_params=m.datum_params||(y.towgs84?y.towgs84.split(","):null),m.ellps=y.ellipse,m.datumName=y.datumName?y.datumName:m.datumCode)}m.k0=m.k0||1,m.axis=m.axis||"enu",m.ellps=m.ellps||"wgs84",m.lat1=m.lat1||m.lat0;var x=Eht(m.a,m.b,m.rf,m.ellps,m.sphere),C=Aht(x.a,x.b,x.rf,m.R_A),w=Pht(m.nadgrids),A=m.datum||Tht(m.datumCode,m.datum_params,x.a,x.b,C.es,C.ep2,w);NLe(this,m),NLe(this,v),this.a=x.a,this.b=x.b,this.rf=x.rf,this.sphere=x.sphere,this.es=C.es,this.e=C.e,this.ep2=C.ep2,this.datum=A,this.init(),f(null,this)}B8.projections=bht;B8.projections.start();var tN=B8;function Iht(o,f){return o.datum_type!==f.datum_type||o.a!==f.a||Math.abs(o.es-f.es)>5e-11?!1:o.datum_type===jT?o.datum_params[0]===f.datum_params[0]&&o.datum_params[1]===f.datum_params[1]&&o.datum_params[2]===f.datum_params[2]:o.datum_type===YT?o.datum_params[0]===f.datum_params[0]&&o.datum_params[1]===f.datum_params[1]&&o.datum_params[2]===f.datum_params[2]&&o.datum_params[3]===f.datum_params[3]&&o.datum_params[4]===f.datum_params[4]&&o.datum_params[5]===f.datum_params[5]&&o.datum_params[6]===f.datum_params[6]:!0}function zle(o,f,m){var v=o.x,y=o.y,x=o.z?o.z:0,C,w,A,E;if(y<-Yn&&y>-1.001*Yn)y=-Yn;else if(y>Yn&&y<1.001*Yn)y=Yn;else{if(y<-Yn)return{x:-1/0,y:-1/0,z:o.z};if(y>Yn)return{x:1/0,y:1/0,z:o.z}}return v>Math.PI&&(v-=2*Math.PI),w=Math.sin(y),E=Math.cos(y),A=w*w,C=m/Math.sqrt(1-f*A),{x:(C+x)*E*Math.cos(v),y:(C+x)*E*Math.sin(v),z:(C*(1-f)+x)*w}}function Hle(o,f,m,v){var y=1e-12,x=y*y,C=30,w,A,E,T,S,M,I,P,D,L,R,O,F,k=o.x,U=o.y,G=o.z?o.z:0,j,q,J;if(w=Math.sqrt(k*k+U*U),A=Math.sqrt(k*k+U*U+G*G),w/m<y){if(j=0,A/m<y)return q=Yn,J=-v,{x:o.x,y:o.y,z:o.z}}else j=Math.atan2(U,k);E=G/A,T=w/A,S=1/Math.sqrt(1-f*(2-f)*T*T),P=T*(1-f)*S,D=E*S,F=0;do F++,I=m/Math.sqrt(1-f*D*D),J=w*P+G*D-I*(1-f*D*D),M=f*I/(I+J),S=1/Math.sqrt(1-M*(2-M)*T*T),L=T*(1-M)*S,R=E*S,O=R*P-L*D,P=L,D=R;while(O*O>x&&F<C);return q=Math.atan(R/Math.abs(L)),{x:j,y:q,z:J}}function Mht(o,f,m){if(f===jT)return{x:o.x+m[0],y:o.y+m[1],z:o.z+m[2]};if(f===YT){var v=m[0],y=m[1],x=m[2],C=m[3],w=m[4],A=m[5],E=m[6];return{x:E*(o.x-A*o.y+w*o.z)+v,y:E*(A*o.x+o.y-C*o.z)+y,z:E*(-w*o.x+C*o.y+o.z)+x}}}function Dht(o,f,m){if(f===jT)return{x:o.x-m[0],y:o.y-m[1],z:o.z-m[2]};if(f===YT){var v=m[0],y=m[1],x=m[2],C=m[3],w=m[4],A=m[5],E=m[6],T=(o.x-v)/E,S=(o.y-y)/E,M=(o.z-x)/E;return{x:T+A*S-w*M,y:-A*T+S+C*M,z:w*T-C*S+M}}}function Ule(o){return o===jT||o===YT}function Oht(o,f,m){if(Iht(o,f)||o.datum_type===uJ||f.datum_type===uJ)return m;var v=o.a,y=o.es;if(o.datum_type===GD){var x=Lht(o,!1,m);if(x!==0)return;v=LLe,y=RLe}var C=f.a,w=f.b,A=f.es;if(f.datum_type===GD&&(C=LLe,w=oht,A=RLe),y===A&&v===C&&!Ule(o.datum_type)&&!Ule(f.datum_type))return m;if(m=zle(m,y,v),Ule(o.datum_type)&&(m=Mht(m,o.datum_type,o.datum_params)),Ule(f.datum_type)&&(m=Dht(m,f.datum_type,f.datum_params)),m=Hle(m,A,C,w),f.datum_type===GD){var E=Lht(f,!0,m);if(E!==0)return}return m}function Lht(o,f,m){if(o.grids===null||o.grids.length===0)return console.log("Grid shift grids not found"),-1;var v={x:-m.x,y:m.y},y={x:Number.NaN,y:Number.NaN},x=!1,C=[];e:for(var w=0;w<o.grids.length;w++){var A=o.grids[w];if(C.push(A.name),A.isNull){y=v;break}if(x=A.mandatory,A.grid===null){if(A.mandatory)return console.log("Unable to find mandatory grid '"+A.name+"'"),-1;continue}for(var E=A.grid.subgrids,T=0,S=E.length;T<S;T++){var M=E[T],I=(Math.abs(M.del[1])+Math.abs(M.del[0]))/1e4,P=M.ll[0]-I,D=M.ll[1]-I,L=M.ll[0]+(M.lim[0]-1)*M.del[0]+I,R=M.ll[1]+(M.lim[1]-1)*M.del[1]+I;if(!(D>v.y||P>v.x||R<v.y||L<v.x)&&(y=rBi(v,f,M),!isNaN(y.x)))break e}}return isNaN(y.x)?(console.log("Failed to find a grid shift table for location '"+-v.x*RC+" "+v.y*RC+" tried: '"+C+"'"),-1):(m.x=-y.x,m.y=y.y,0)}function rBi(o,f,m){var v={x:Number.NaN,y:Number.NaN};if(isNaN(o.x))return v;var y={x:o.x,y:o.y};y.x-=m.ll[0],y.y-=m.ll[1],y.x=To(y.x-Math.PI)+Math.PI;var x=Rht(y,m);if(f){if(isNaN(x.x))return v;x.x=y.x-x.x,x.y=y.y-x.y;var C=9,w=1e-12,A,E;do{if(E=Rht(x,m),isNaN(E.x)){console.log("Inverse grid shift iteration failed, presumably at grid edge. Using first approximation.");break}A={x:y.x-(E.x+x.x),y:y.y-(E.y+x.y)},x.x+=A.x,x.y+=A.y}while(C--&&Math.abs(A.x)>w&&Math.abs(A.y)>w);if(C<0)return console.log("Inverse grid shift iterator failed to converge."),v;v.x=To(x.x+m.ll[0]),v.y=x.y+m.ll[1]}else isNaN(x.x)||(v.x=o.x+x.x,v.y=o.y+x.y);return v}function Rht(o,f){var m={x:o.x/f.del[0],y:o.y/f.del[1]},v={x:Math.floor(m.x),y:Math.floor(m.y)},y={x:m.x-1*v.x,y:m.y-1*v.y},x={x:Number.NaN,y:Number.NaN},C;if(v.x<0||v.x>=f.lim[0]||v.y<0||v.y>=f.lim[1])return x;C=v.y*f.lim[0]+v.x;var w={x:f.cvs[C][0],y:f.cvs[C][1]};C++;var A={x:f.cvs[C][0],y:f.cvs[C][1]};C+=f.lim[0];var E={x:f.cvs[C][0],y:f.cvs[C][1]};C--;var T={x:f.cvs[C][0],y:f.cvs[C][1]},S=y.x*y.y,M=y.x*(1-y.y),I=(1-y.x)*(1-y.y),P=(1-y.x)*y.y;return x.x=I*w.x+M*A.x+P*T.x+S*E.x,x.y=I*w.y+M*A.y+P*T.y+S*E.y,x}function kLe(o,f,m){var v=m.x,y=m.y,x=m.z||0,C,w,A,E={};for(A=0;A<3;A++)if(!(f&&A===2&&m.z===void 0))switch(A===0?(C=v,"ew".indexOf(o.axis[A])!==-1?w="x":w="y"):A===1?(C=y,"ns".indexOf(o.axis[A])!==-1?w="y":w="x"):(C=x,w="z"),o.axis[A]){case"e":E[w]=C;break;case"w":E[w]=-C;break;case"n":E[w]=C;break;case"s":E[w]=-C;break;case"u":m[w]!==void 0&&(E.z=C);break;case"d":m[w]!==void 0&&(E.z=-C);break;default:return null}return E}function Gle(o){var f={x:o[0],y:o[1]};return o.length>2&&(f.z=o[2]),o.length>3&&(f.m=o[3]),f}function Fht(o){Nht(o.x),Nht(o.y)}function Nht(o){if(typeof Number.isFinite=="function"){if(Number.isFinite(o))return;throw new TypeError("coordinates must be finite numbers")}if(typeof o!="number"||o!==o||!isFinite(o))throw new TypeError("coordinates must be finite numbers")}function nBi(o,f){return(o.datum.datum_type===jT||o.datum.datum_type===YT||o.datum.datum_type===GD)&&f.datumCode!=="WGS84"||(f.datum.datum_type===jT||f.datum.datum_type===YT||f.datum.datum_type===GD)&&o.datumCode!=="WGS84"}function V4(o,f,m,v){var y;Array.isArray(m)?m=Gle(m):m={x:m.x,y:m.y,z:m.z,m:m.m};var x=m.z!==void 0;if(Fht(m),o.datum&&f.datum&&nBi(o,f)&&(y=new tN("WGS84"),m=V4(o,y,m,v),o=y),v&&o.axis!=="enu"&&(m=kLe(o,!1,m)),o.projName==="longlat")m={x:m.x*Op,y:m.y*Op,z:m.z||0};else if(o.to_meter&&(m={x:m.x*o.to_meter,y:m.y*o.to_meter,z:m.z||0}),m=o.inverse(m),!m)return;if(o.from_greenwich&&(m.x+=o.from_greenwich),m=Oht(o.datum,f.datum,m),!!m)return f.from_greenwich&&(m={x:m.x-f.from_greenwich,y:m.y,z:m.z||0}),f.projName==="longlat"?m={x:m.x*RC,y:m.y*RC,z:m.z||0}:(m=f.forward(m),f.to_meter&&(m={x:m.x/f.to_meter,y:m.y/f.to_meter,z:m.z||0})),v&&f.axis!=="enu"?kLe(f,!0,m):(m&&!x&&delete m.z,m)}var Bht=tN("WGS84");function VLe(o,f,m,v){var y,x,C;return Array.isArray(m)?(y=V4(o,f,m,v)||{x:NaN,y:NaN},m.length>2?typeof o.name<"u"&&o.name==="geocent"||typeof f.name<"u"&&f.name==="geocent"?typeof y.z=="number"?[y.x,y.y,y.z].concat(m.splice(3)):[y.x,y.y,m[2]].concat(m.splice(3)):[y.x,y.y].concat(m.splice(2)):[y.x,y.y]):(x=V4(o,f,m,v),C=Object.keys(m),C.length===2||C.forEach(function(w){if(typeof o.name<"u"&&o.name==="geocent"||typeof f.name<"u"&&f.name==="geocent"){if(w==="x"||w==="y"||w==="z")return}else if(w==="x"||w==="y")return;x[w]=m[w]}),x)}function kht(o){return o instanceof tN?o:o.oProj?o.oProj:tN(o)}function oBi(o,f,m){o=kht(o);var v=!1,y;return typeof f>"u"?(f=o,o=Bht,v=!0):(typeof f.x<"u"||Array.isArray(f))&&(m=f,f=o,o=Bht,v=!0),f=kht(f),m?VLe(o,f,m):(y={forward:function(x,C){return VLe(o,f,x,C)},inverse:function(x,C){return VLe(f,o,x,C)}},v&&(y.oProj=f),y)}var OC=oBi;var Vht=6,Hht="AJSAJS",Uht="AFAFAF",k8=65,NC=73,TA=79,dJ=86,fJ=90,Ght={forward:HLe,inverse:aBi,toPoint:ULe};function HLe(o,f){return f=f||5,uBi(sBi({lat:o[1],lon:o[0]}),f)}function aBi(o){var f=GLe(jht(o.toUpperCase()));return f.lat&&f.lon?[f.lon,f.lat,f.lon,f.lat]:[f.left,f.bottom,f.right,f.top]}function ULe(o){var f=GLe(jht(o.toUpperCase()));return f.lat&&f.lon?[f.lon,f.lat]:[(f.left+f.right)/2,(f.top+f.bottom)/2]}function zLe(o){return o*(Math.PI/180)}function zht(o){return 180*(o/Math.PI)}function sBi(o){var f=o.lat,m=o.lon,v=6378137,y=.00669438,x=.9996,C,w,A,E,T,S,M,I=zLe(f),P=zLe(m),D,L;L=Math.floor((m+180)/6)+1,m===180&&(L=60),f>=56&&f<64&&m>=3&&m<12&&(L=32),f>=72&&f<84&&(m>=0&&m<9?L=31:m>=9&&m<21?L=33:m>=21&&m<33?L=35:m>=33&&m<42&&(L=37)),C=(L-1)*6-180+3,D=zLe(C),w=y/(1-y),A=v/Math.sqrt(1-y*Math.sin(I)*Math.sin(I)),E=Math.tan(I)*Math.tan(I),T=w*Math.cos(I)*Math.cos(I),S=Math.cos(I)*(P-D),M=v*((1-y/4-3*y*y/64-5*y*y*y/256)*I-(3*y/8+3*y*y/32+45*y*y*y/1024)*Math.sin(2*I)+(15*y*y/256+45*y*y*y/1024)*Math.sin(4*I)-35*y*y*y/3072*Math.sin(6*I));var R=x*A*(S+(1-E+T)*S*S*S/6+(5-18*E+E*E+72*T-58*w)*S*S*S*S*S/120)+5e5,O=x*(M+A*Math.tan(I)*(S*S/2+(5-E+9*T+4*T*T)*S*S*S*S/24+(61-58*E+E*E+600*T-330*w)*S*S*S*S*S*S/720));return f<0&&(O+=1e7),{northing:Math.round(O),easting:Math.round(R),zoneNumber:L,zoneLetter:lBi(f)}}function GLe(o){var f=o.northing,m=o.easting,v=o.zoneLetter,y=o.zoneNumber;if(y<0||y>60)return null;var x=.9996,C=6378137,w=.00669438,A,E=(1-Math.sqrt(1-w))/(1+Math.sqrt(1-w)),T,S,M,I,P,D,L,R,O,F=m-5e5,k=f;v<"N"&&(k-=1e7),L=(y-1)*6-180+3,A=w/(1-w),D=k/x,R=D/(C*(1-w/4-3*w*w/64-5*w*w*w/256)),O=R+(3*E/2-27*E*E*E/32)*Math.sin(2*R)+(21*E*E/16-55*E*E*E*E/32)*Math.sin(4*R)+151*E*E*E/96*Math.sin(6*R),T=C/Math.sqrt(1-w*Math.sin(O)*Math.sin(O)),S=Math.tan(O)*Math.tan(O),M=A*Math.cos(O)*Math.cos(O),I=C*(1-w)/Math.pow(1-w*Math.sin(O)*Math.sin(O),1.5),P=F/(T*x);var U=O-T*Math.tan(O)/I*(P*P/2-(5+3*S+10*M-4*M*M-9*A)*P*P*P*P/24+(61+90*S+298*M+45*S*S-252*A-3*M*M)*P*P*P*P*P*P/720);U=zht(U);var G=(P-(1+2*S+M)*P*P*P/6+(5-2*M+28*S-3*M*M+8*A+24*S*S)*P*P*P*P*P/120)/Math.cos(O);G=L+zht(G);var j;if(o.accuracy){var q=GLe({northing:o.northing+o.accuracy,easting:o.easting+o.accuracy,zoneLetter:o.zoneLetter,zoneNumber:o.zoneNumber});j={top:q.lat,right:q.lon,bottom:U,left:G}}else j={lat:U,lon:G};return j}function lBi(o){var f="Z";return 84>=o&&o>=72?f="X":72>o&&o>=64?f="W":64>o&&o>=56?f="V":56>o&&o>=48?f="U":48>o&&o>=40?f="T":40>o&&o>=32?f="S":32>o&&o>=24?f="R":24>o&&o>=16?f="Q":16>o&&o>=8?f="P":8>o&&o>=0?f="N":0>o&&o>=-8?f="M":-8>o&&o>=-16?f="L":-16>o&&o>=-24?f="K":-24>o&&o>=-32?f="J":-32>o&&o>=-40?f="H":-40>o&&o>=-48?f="G":-48>o&&o>=-56?f="F":-56>o&&o>=-64?f="E":-64>o&&o>=-72?f="D":-72>o&&o>=-80&&(f="C"),f}function uBi(o,f){var m="00000"+o.easting,v="00000"+o.northing;return o.zoneNumber+o.zoneLetter+cBi(o.easting,o.northing,o.zoneNumber)+m.substr(m.length-5,f)+v.substr(v.length-5,f)}function cBi(o,f,m){var v=Wht(m),y=Math.floor(o/1e5),x=Math.floor(f/1e5)%20;return hBi(y,x,v)}function Wht(o){var f=o%Vht;return f===0&&(f=Vht),f}function hBi(o,f,m){var v=m-1,y=Hht.charCodeAt(v),x=Uht.charCodeAt(v),C=y+o-1,w=x+f,A=!1;C>fJ&&(C=C-fJ+k8-1,A=!0),(C===NC||y<NC&&C>NC||(C>NC||y<NC)&&A)&&C++,(C===TA||y<TA&&C>TA||(C>TA||y<TA)&&A)&&(C++,C===NC&&C++),C>fJ&&(C=C-fJ+k8-1),w>dJ?(w=w-dJ+k8-1,A=!0):A=!1,(w===NC||x<NC&&w>NC||(w>NC||x<NC)&&A)&&w++,(w===TA||x<TA&&w>TA||(w>TA||x<TA)&&A)&&(w++,w===NC&&w++),w>dJ&&(w=w-dJ+k8-1);var E=String.fromCharCode(C)+String.fromCharCode(w);return E}function jht(o){if(o&&o.length===0)throw"MGRSPoint coverting from nothing";for(var f=o.length,m=null,v="",y,x=0;!/[A-Z]/.test(y=o.charAt(x));){if(x>=2)throw"MGRSPoint bad conversion from: "+o;v+=y,x++}var C=parseInt(v,10);if(x===0||x+3>f)throw"MGRSPoint bad conversion from: "+o;var w=o.charAt(x++);if(w<="A"||w==="B"||w==="Y"||w>="Z"||w==="I"||w==="O")throw"MGRSPoint zone letter "+w+" not handled: "+o;m=o.substring(x,x+=2);for(var A=Wht(C),E=dBi(m.charAt(0),A),T=fBi(m.charAt(1),A);T<pBi(w);)T+=2e6;var S=f-x;if(S%2!==0)throw`MGRSPoint has to have an even number of digits after the zone letter and two 100km letters - front half for easting meters, second half for northing meters`+o;var M=S/2,I=0,P=0,D,L,R,O,F;return M>0&&(D=1e5/Math.pow(10,M),L=o.substring(x,x+M),I=parseFloat(L)*D,R=o.substring(x+M),P=parseFloat(R)*D),O=I+E,F=P+T,{easting:O,northing:F,zoneLetter:w,zoneNumber:C,accuracy:D}}function dBi(o,f){for(var m=Hht.charCodeAt(f-1),v=1e5,y=!1;m!==o.charCodeAt(0);){if(m++,m===NC&&m++,m===TA&&m++,m>fJ){if(y)throw"Bad character: "+o;m=k8,y=!0}v+=1e5}return v}function fBi(o,f){if(o>"V")throw"MGRSPoint given invalid Northing "+o;for(var m=Uht.charCodeAt(f-1),v=0,y=!1;m!==o.charCodeAt(0);){if(m++,m===NC&&m++,m===TA&&m++,m>dJ){if(y)throw"Bad character: "+o;m=k8,y=!0}v+=1e5}return v}function pBi(o){var f;switch(o){case"C":f=11e5;break;case"D":f=2e6;break;case"E":f=28e5;break;case"F":f=37e5;break;case"G":f=46e5;break;case"H":f=55e5;break;case"J":f=64e5;break;case"K":f=73e5;break;case"L":f=82e5;break;case"M":f=91e5;break;case"N":f=0;break;case"P":f=8e5;break;case"Q":f=17e5;break;case"R":f=26e5;break;case"S":f=35e5;break;case"T":f=44e5;break;case"U":f=53e5;break;case"V":f=62e5;break;case"W":f=7e6;break;case"X":f=79e5;break;default:f=-1}if(f>=0)return f;throw"Invalid zone letter: "+o}function V8(o,f,m){if(!(this instanceof V8))return new V8(o,f,m);if(Array.isArray(o))this.x=o[0],this.y=o[1],this.z=o[2]||0;else if(typeof o=="object")this.x=o.x,this.y=o.y,this.z=o.z||0;else if(typeof o=="string"&&typeof f>"u"){var v=o.split(",");this.x=parseFloat(v[0],10),this.y=parseFloat(v[1],10),this.z=parseFloat(v[2],10)||0}else this.x=o,this.y=f,this.z=m||0;console.warn("proj4.Point will be removed in version 3, use proj4.toPoint")}V8.fromMGRS=function(o){return new V8(ULe(o))};V8.prototype.toMGRS=function(o){return HLe([this.x,this.y],o)};var Yht=V8;var mBi=1,gBi=.25,qht=.046875,Xht=.01953125,Jht=.01068115234375,_Bi=.75,vBi=.46875,yBi=.013020833333333334,xBi=.007120768229166667,CBi=.3645833333333333,bBi=.005696614583333333,wBi=.3076171875;function Wle(o){var f=[];f[0]=mBi-o*(gBi+o*(qht+o*(Xht+o*Jht))),f[1]=o*(_Bi-o*(qht+o*(Xht+o*Jht)));var m=o*o;return f[2]=m*(vBi-o*(yBi+o*xBi)),m*=o,f[3]=m*(CBi-o*bBi),f[4]=m*o*wBi,f}function z4(o,f,m,v){return m*=f,f*=f,v[0]*o-m*(v[1]+f*(v[2]+f*(v[3]+f*v[4])))}var ABi=20;function jle(o,f,m){for(var v=1/(1-f),y=o,x=ABi;x;--x){var C=Math.sin(y),w=1-f*C*C;if(w=(z4(y,C,Math.cos(y),m)-o)*(w*Math.sqrt(w))*v,y-=w,Math.abs(w)<xo)return y}return y}function EBi(){this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.es&&(this.en=Wle(this.es),this.ml0=z4(this.lat0,Math.sin(this.lat0),Math.cos(this.lat0),this.en))}function TBi(o){var f=o.x,m=o.y,v=To(f-this.long0),y,x,C,w=Math.sin(m),A=Math.cos(m);if(this.es){var T=A*v,S=Math.pow(T,2),M=this.ep2*Math.pow(A,2),I=Math.pow(M,2),P=Math.abs(A)>xo?Math.tan(m):0,D=Math.pow(P,2),L=Math.pow(D,2);y=1-this.es*Math.pow(w,2),T=T/Math.sqrt(y);var R=z4(m,w,A,this.en);x=this.a*(this.k0*T*(1+S/6*(1-D+M+S/20*(5-18*D+L+14*M-58*D*M+S/42*(61+179*L-L*D-479*D)))))+this.x0,C=this.a*(this.k0*(R-this.ml0+w*v*T/2*(1+S/12*(5-D+9*M+4*I+S/30*(61+L-58*D+270*M-330*D*M+S/56*(1385+543*L-L*D-3111*D))))))+this.y0}else{var E=A*Math.sin(v);if(Math.abs(Math.abs(E)-1)<xo)return 93;if(x=.5*this.a*this.k0*Math.log((1+E)/(1-E))+this.x0,C=A*Math.cos(v)/Math.sqrt(1-Math.pow(E,2)),E=Math.abs(C),E>=1){if(E-1>xo)return 93;C=0}else C=Math.acos(C);m<0&&(C=-C),C=this.a*this.k0*(C-this.lat0)+this.y0}return o.x=x,o.y=C,o}function SBi(o){var f,m,v,y,x=(o.x-this.x0)*(1/this.a),C=(o.y-this.y0)*(1/this.a);if(this.es)if(f=this.ml0+C/this.k0,m=jle(f,this.es,this.en),Math.abs(m)<Yn){var S=Math.sin(m),M=Math.cos(m),I=Math.abs(M)>xo?Math.tan(m):0,P=this.ep2*Math.pow(M,2),D=Math.pow(P,2),L=Math.pow(I,2),R=Math.pow(L,2);f=1-this.es*Math.pow(S,2);var O=x*Math.sqrt(f)/this.k0,F=Math.pow(O,2);f=f*I,v=m-f*F/(1-this.es)*.5*(1-F/12*(5+3*L-9*P*L+P-4*D-F/30*(61+90*L-252*P*L+45*R+46*P-F/56*(1385+3633*L+4095*R+1574*R*L)))),y=To(this.long0+O*(1-F/6*(1+2*L+P-F/20*(5+28*L+24*R+8*P*L+6*P-F/42*(61+662*L+1320*R+720*R*L))))/M)}else v=Yn*NP(C),y=0;else{var w=Math.exp(x/this.k0),A=.5*(w-1/w),E=this.lat0+C/this.k0,T=Math.cos(E);f=Math.sqrt((1-Math.pow(T,2))/(1+Math.pow(A,2))),v=Math.asin(f),C<0&&(v=-v),A===0&&T===0?y=0:y=To(Math.atan2(A,T)+this.long0)}return o.x=y,o.y=v,o}var PBi=["Fast_Transverse_Mercator","Fast Transverse Mercator"],z8={init:EBi,forward:TBi,inverse:SBi,names:PBi};function Yle(o){var f=Math.exp(o);return f=(f-1/f)/2,f}function dx(o,f){o=Math.abs(o),f=Math.abs(f);var m=Math.max(o,f),v=Math.min(o,f)/(m||1);return m*Math.sqrt(1+Math.pow(v,2))}function Kht(o){var f=1+o,m=f-1;return m===0?o:o*Math.log(f)/m}function Qht(o){var f=Math.abs(o);return f=Kht(f*(1+f/(dx(1,f)+1))),o<0?-f:f}function qle(o,f){for(var m=2*Math.cos(2*f),v=o.length-1,y=o[v],x=0,C;--v>=0;)C=-x+m*y+o[v],x=y,y=C;return f+C*Math.sin(2*f)}function Zht(o,f){for(var m=2*Math.cos(f),v=o.length-1,y=o[v],x=0,C;--v>=0;)C=-x+m*y+o[v],x=y,y=C;return Math.sin(f)*C}function $ht(o){var f=Math.exp(o);return f=(f+1/f)/2,f}function WLe(o,f,m){for(var v=Math.sin(f),y=Math.cos(f),x=Yle(m),C=$ht(m),w=2*y*C,A=-2*v*x,E=o.length-1,T=o[E],S=0,M=0,I=0,P,D;--E>=0;)P=M,D=S,M=T,S=I,T=-P+w*M-A*S+o[E],I=-D+A*M+w*S;return w=v*C,A=y*x,[w*T-A*I,w*I+A*T]}function IBi(){if(!this.approx&&(isNaN(this.es)||this.es<=0))throw new Error('Incorrect elliptical usage. Try using the +approx option in the proj string, or PROJECTION["Fast_Transverse_Mercator"] in the WKT.');this.approx&&(z8.init.apply(this),this.forward=z8.forward,this.inverse=z8.inverse),this.x0=this.x0!==void 0?this.x0:0,this.y0=this.y0!==void 0?this.y0:0,this.long0=this.long0!==void 0?this.long0:0,this.lat0=this.lat0!==void 0?this.lat0:0,this.cgb=[],this.cbg=[],this.utg=[],this.gtu=[];var o=this.es/(1+Math.sqrt(1-this.es)),f=o/(2-o),m=f;this.cgb[0]=f*(2+f*(-2/3+f*(-2+f*(116/45+f*(26/45+f*(-2854/675)))))),this.cbg[0]=f*(-2+f*(2/3+f*(4/3+f*(-82/45+f*(32/45+f*(4642/4725)))))),m=m*f,this.cgb[1]=m*(7/3+f*(-8/5+f*(-227/45+f*(2704/315+f*(2323/945))))),this.cbg[1]=m*(5/3+f*(-16/15+f*(-13/9+f*(904/315+f*(-1522/945))))),m=m*f,this.cgb[2]=m*(56/15+f*(-136/35+f*(-1262/105+f*(73814/2835)))),this.cbg[2]=m*(-26/15+f*(34/21+f*(8/5+f*(-12686/2835)))),m=m*f,this.cgb[3]=m*(4279/630+f*(-332/35+f*(-399572/14175))),this.cbg[3]=m*(1237/630+f*(-12/5+f*(-24832/14175))),m=m*f,this.cgb[4]=m*(4174/315+f*(-144838/6237)),this.cbg[4]=m*(-734/315+f*(109598/31185)),m=m*f,this.cgb[5]=m*(601676/22275),this.cbg[5]=m*(444337/155925),m=Math.pow(f,2),this.Qn=this.k0/(1+f)*(1+m*(1/4+m*(1/64+m/256))),this.utg[0]=f*(-.5+f*(2/3+f*(-37/96+f*(1/360+f*(81/512+f*(-96199/604800)))))),this.gtu[0]=f*(.5+f*(-2/3+f*(5/16+f*(41/180+f*(-127/288+f*(7891/37800)))))),this.utg[1]=m*(-1/48+f*(-1/15+f*(437/1440+f*(-46/105+f*(1118711/3870720))))),this.gtu[1]=m*(13/48+f*(-3/5+f*(557/1440+f*(281/630+f*(-1983433/1935360))))),m=m*f,this.utg[2]=m*(-17/480+f*(37/840+f*(209/4480+f*(-5569/90720)))),this.gtu[2]=m*(61/240+f*(-103/140+f*(15061/26880+f*(167603/181440)))),m=m*f,this.utg[3]=m*(-4397/161280+f*(11/504+f*(830251/7257600))),this.gtu[3]=m*(49561/161280+f*(-179/168+f*(6601661/7257600))),m=m*f,this.utg[4]=m*(-4583/161280+f*(108847/3991680)),this.gtu[4]=m*(34729/80640+f*(-3418889/1995840)),m=m*f,this.utg[5]=m*(-20648693/638668800),this.gtu[5]=m*(212378941/319334400);var v=qle(this.cbg,this.lat0);this.Zb=-this.Qn*(v+Zht(this.gtu,2*v))}function MBi(o){var f=To(o.x-this.long0),m=o.y;m=qle(this.cbg,m);var v=Math.sin(m),y=Math.cos(m),x=Math.sin(f),C=Math.cos(f);m=Math.atan2(v,C*y),f=Math.atan2(x*y,dx(v,y*C)),f=Qht(Math.tan(f));var w=WLe(this.gtu,2*m,2*f);m=m+w[0],f=f+w[1];var A,E;return Math.abs(f)<=2.623395162778?(A=this.a*(this.Qn*f)+this.x0,E=this.a*(this.Qn*m+this.Zb)+this.y0):(A=1/0,E=1/0),o.x=A,o.y=E,o}function DBi(o){var f=(o.x-this.x0)*(1/this.a),m=(o.y-this.y0)*(1/this.a);m=(m-this.Zb)/this.Qn,f=f/this.Qn;var v,y;if(Math.abs(f)<=2.623395162778){var x=WLe(this.utg,2*m,2*f);m=m+x[0],f=f+x[1],f=Math.atan(Yle(f));var C=Math.sin(m),w=Math.cos(m),A=Math.sin(f),E=Math.cos(f);m=Math.atan2(C*E,dx(A,E*w)),f=Math.atan2(A,E*w),v=To(f+this.long0),y=qle(this.cgb,m)}else v=1/0,y=1/0;return o.x=v,o.y=y,o}var LBi=["Extended_Transverse_Mercator","Extended Transverse Mercator","etmerc","Transverse_Mercator","Transverse Mercator","tmerc"],H8={init:IBi,forward:MBi,inverse:DBi,names:LBi};function edt(o,f){if(o===void 0){if(o=Math.floor((To(f)+Math.PI)*30/Math.PI)+1,o<0)return 0;if(o>60)return 60}return o}var RBi="etmerc";function OBi(){var o=edt(this.zone,this.long0);if(o===void 0)throw new Error("unknown utm zone");this.lat0=0,this.long0=(6*Math.abs(o)-183)*Op,this.x0=5e5,this.y0=this.utmSouth?1e7:0,this.k0=.9996,H8.init.apply(this),this.forward=H8.forward,this.inverse=H8.inverse}var NBi=["Universal Transverse Mercator System","utm"],tdt={init:OBi,names:NBi,dependsOn:RBi};function Xle(o,f){return Math.pow((1-o)/(1+o),f)}var FBi=20;function BBi(){var o=Math.sin(this.lat0),f=Math.cos(this.lat0);f*=f,this.rc=Math.sqrt(1-this.es)/(1-this.es*o*o),this.C=Math.sqrt(1+this.es*f*f/(1-this.es)),this.phic0=Math.asin(o/this.C),this.ratexp=.5*this.C*this.e,this.K=Math.tan(.5*this.phic0+Fc)/(Math.pow(Math.tan(.5*this.lat0+Fc),this.C)*Xle(this.e*o,this.ratexp))}function kBi(o){var f=o.x,m=o.y;return o.y=2*Math.atan(this.K*Math.pow(Math.tan(.5*m+Fc),this.C)*Xle(this.e*Math.sin(m),this.ratexp))-Yn,o.x=this.C*f,o}function VBi(o){for(var f=1e-14,m=o.x/this.C,v=o.y,y=Math.pow(Math.tan(.5*v+Fc)/this.K,1/this.C),x=FBi;x>0&&(v=2*Math.atan(y*Xle(this.e*Math.sin(o.y),-.5*this.e))-Yn,!(Math.abs(v-o.y)<f));--x)o.y=v;return x?(o.x=m,o.y=v,o):null}var zBi=["gauss"],Jle={init:BBi,forward:kBi,inverse:VBi,names:zBi};function HBi(){Jle.init.apply(this),this.rc&&(this.sinc0=Math.sin(this.phic0),this.cosc0=Math.cos(this.phic0),this.R2=2*this.rc,this.title||(this.title="Oblique Stereographic Alternative"))}function UBi(o){var f,m,v,y;return o.x=To(o.x-this.long0),Jle.forward.apply(this,[o]),f=Math.sin(o.y),m=Math.cos(o.y),v=Math.cos(o.x),y=this.k0*this.R2/(1+this.sinc0*f+this.cosc0*m*v),o.x=y*m*Math.sin(o.x),o.y=y*(this.cosc0*f-this.sinc0*m*v),o.x=this.a*o.x+this.x0,o.y=this.a*o.y+this.y0,o}function GBi(o){var f,m,v,y,x;if(o.x=(o.x-this.x0)/this.a,o.y=(o.y-this.y0)/this.a,o.x/=this.k0,o.y/=this.k0,x=Math.sqrt(o.x*o.x+o.y*o.y)){var C=2*Math.atan2(x,this.R2);f=Math.sin(C),m=Math.cos(C),y=Math.asin(m*this.sinc0+o.y*f*this.cosc0/x),v=Math.atan2(o.x*f,x*this.cosc0*m-o.y*this.sinc0*f)}else y=this.phic0,v=0;return o.x=v,o.y=y,Jle.inverse.apply(this,[o]),o.x=To(o.x+this.long0),o}var WBi=["Stereographic_North_Pole","Oblique_Stereographic","sterea","Oblique Stereographic Alternative","Double_Stereographic"],idt={init:HBi,forward:UBi,inverse:GBi,names:WBi};function jBi(o,f,m){return f*=m,Math.tan(.5*(Yn+o))*Math.pow((1-f)/(1+f),.5*m)}function YBi(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.coslat0=Math.cos(this.lat0),this.sinlat0=Math.sin(this.lat0),this.sphere?this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=xo&&(this.k0=.5*(1+NP(this.lat0)*Math.sin(this.lat_ts))):(Math.abs(this.coslat0)<=xo&&(this.lat0>0?this.con=1:this.con=-1),this.cons=Math.sqrt(Math.pow(1+this.e,1+this.e)*Math.pow(1-this.e,1-this.e)),this.k0===1&&!isNaN(this.lat_ts)&&Math.abs(this.coslat0)<=xo&&Math.abs(Math.cos(this.lat_ts))>xo&&(this.k0=.5*this.cons*iy(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts))/hx(this.e,this.con*this.lat_ts,this.con*Math.sin(this.lat_ts))),this.ms1=iy(this.e,this.sinlat0,this.coslat0),this.X0=2*Math.atan(this.ssfn_(this.lat0,this.sinlat0,this.e))-Yn,this.cosX0=Math.cos(this.X0),this.sinX0=Math.sin(this.X0))}function qBi(o){var f=o.x,m=o.y,v=Math.sin(m),y=Math.cos(m),x,C,w,A,E,T,S=To(f-this.long0);return Math.abs(Math.abs(f-this.long0)-Math.PI)<=xo&&Math.abs(m+this.lat0)<=xo?(o.x=NaN,o.y=NaN,o):this.sphere?(x=2*this.k0/(1+this.sinlat0*v+this.coslat0*y*Math.cos(S)),o.x=this.a*x*y*Math.sin(S)+this.x0,o.y=this.a*x*(this.coslat0*v-this.sinlat0*y*Math.cos(S))+this.y0,o):(C=2*Math.atan(this.ssfn_(m,v,this.e))-Yn,A=Math.cos(C),w=Math.sin(C),Math.abs(this.coslat0)<=xo?(E=hx(this.e,m*this.con,this.con*v),T=2*this.a*this.k0*E/this.cons,o.x=this.x0+T*Math.sin(f-this.long0),o.y=this.y0-this.con*T*Math.cos(f-this.long0),o):(Math.abs(this.sinlat0)<xo?(x=2*this.a*this.k0/(1+A*Math.cos(S)),o.y=x*w):(x=2*this.a*this.k0*this.ms1/(this.cosX0*(1+this.sinX0*w+this.cosX0*A*Math.cos(S))),o.y=x*(this.cosX0*w-this.sinX0*A*Math.cos(S))+this.y0),o.x=x*A*Math.sin(S)+this.x0,o))}function XBi(o){o.x-=this.x0,o.y-=this.y0;var f,m,v,y,x,C=Math.sqrt(o.x*o.x+o.y*o.y);if(this.sphere){var w=2*Math.atan(C/(2*this.a*this.k0));return f=this.long0,m=this.lat0,C<=xo?(o.x=f,o.y=m,o):(m=Math.asin(Math.cos(w)*this.sinlat0+o.y*Math.sin(w)*this.coslat0/C),Math.abs(this.coslat0)<xo?this.lat0>0?f=To(this.long0+Math.atan2(o.x,-1*o.y)):f=To(this.long0+Math.atan2(o.x,o.y)):f=To(this.long0+Math.atan2(o.x*Math.sin(w),C*this.coslat0*Math.cos(w)-o.y*this.sinlat0*Math.sin(w))),o.x=f,o.y=m,o)}else if(Math.abs(this.coslat0)<=xo){if(C<=xo)return m=this.lat0,f=this.long0,o.x=f,o.y=m,o;o.x*=this.con,o.y*=this.con,v=C*this.cons/(2*this.a*this.k0),m=this.con*jD(this.e,v),f=this.con*To(this.con*this.long0+Math.atan2(o.x,-1*o.y))}else y=2*Math.atan(C*this.cosX0/(2*this.a*this.k0*this.ms1)),f=this.long0,C<=xo?x=this.X0:(x=Math.asin(Math.cos(y)*this.sinX0+o.y*Math.sin(y)*this.cosX0/C),f=To(this.long0+Math.atan2(o.x*Math.sin(y),C*this.cosX0*Math.cos(y)-o.y*this.sinX0*Math.sin(y)))),m=-1*jD(this.e,Math.tan(.5*(Yn+x)));return o.x=f,o.y=m,o}var JBi=["stere","Stereographic_South_Pole","Polar Stereographic (variant B)","Polar_Stereographic"],rdt={init:YBi,forward:qBi,inverse:XBi,names:JBi,ssfn_:jBi};function KBi(){var o=this.lat0;this.lambda0=this.long0;var f=Math.sin(o),m=this.a,v=this.rf,y=1/v,x=2*y-Math.pow(y,2),C=this.e=Math.sqrt(x);this.R=this.k0*m*Math.sqrt(1-x)/(1-x*Math.pow(f,2)),this.alpha=Math.sqrt(1+x/(1-x)*Math.pow(Math.cos(o),4)),this.b0=Math.asin(f/this.alpha);var w=Math.log(Math.tan(Math.PI/4+this.b0/2)),A=Math.log(Math.tan(Math.PI/4+o/2)),E=Math.log((1+C*f)/(1-C*f));this.K=w-this.alpha*A+this.alpha*C/2*E}function QBi(o){var f=Math.log(Math.tan(Math.PI/4-o.y/2)),m=this.e/2*Math.log((1+this.e*Math.sin(o.y))/(1-this.e*Math.sin(o.y))),v=-this.alpha*(f+m)+this.K,y=2*(Math.atan(Math.exp(v))-Math.PI/4),x=this.alpha*(o.x-this.lambda0),C=Math.atan(Math.sin(x)/(Math.sin(this.b0)*Math.tan(y)+Math.cos(this.b0)*Math.cos(x))),w=Math.asin(Math.cos(this.b0)*Math.sin(y)-Math.sin(this.b0)*Math.cos(y)*Math.cos(x));return o.y=this.R/2*Math.log((1+Math.sin(w))/(1-Math.sin(w)))+this.y0,o.x=this.R*C+this.x0,o}function ZBi(o){for(var f=o.x-this.x0,m=o.y-this.y0,v=f/this.R,y=2*(Math.atan(Math.exp(m/this.R))-Math.PI/4),x=Math.asin(Math.cos(this.b0)*Math.sin(y)+Math.sin(this.b0)*Math.cos(y)*Math.cos(v)),C=Math.atan(Math.sin(v)/(Math.cos(this.b0)*Math.cos(v)-Math.sin(this.b0)*Math.tan(y))),w=this.lambda0+C/this.alpha,A=0,E=x,T=-1e3,S=0;Math.abs(E-T)>1e-7;){if(++S>20)return;A=1/this.alpha*(Math.log(Math.tan(Math.PI/4+x/2))-this.K)+this.e*Math.log(Math.tan(Math.PI/4+Math.asin(this.e*Math.sin(E))/2)),T=E,E=2*Math.atan(Math.exp(A))-Math.PI/2}return o.x=w,o.y=E,o}var $Bi=["somerc"],ndt={init:KBi,forward:QBi,inverse:ZBi,names:$Bi};var U8=1e-7;function e4i(o){var f=["Hotine_Oblique_Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin"],m=typeof o.PROJECTION=="object"?Object.keys(o.PROJECTION)[0]:o.PROJECTION;return"no_uoff"in o||"no_off"in o||f.indexOf(m)!==-1}function t4i(){var o,f,m,v,y,x,C,w,A,E,T=0,S,M=0,I=0,P=0,D=0,L=0,R=0,O;this.no_off=e4i(this),this.no_rot="no_rot"in this;var F=!1;"alpha"in this&&(F=!0);var k=!1;if("rectified_grid_angle"in this&&(k=!0),F&&(R=this.alpha),k&&(T=this.rectified_grid_angle*Op),F||k)M=this.longc;else if(I=this.long1,D=this.lat1,P=this.long2,L=this.lat2,Math.abs(D-L)<=U8||(o=Math.abs(D))<=U8||Math.abs(o-Yn)<=U8||Math.abs(Math.abs(this.lat0)-Yn)<=U8||Math.abs(Math.abs(L)-Yn)<=U8)throw new Error;var U=1-this.es;f=Math.sqrt(U),Math.abs(this.lat0)>xo?(w=Math.sin(this.lat0),m=Math.cos(this.lat0),o=1-this.es*w*w,this.B=m*m,this.B=Math.sqrt(1+this.es*this.B*this.B/U),this.A=this.B*this.k0*f/o,v=this.B*f/(m*Math.sqrt(o)),y=v*v-1,y<=0?y=0:(y=Math.sqrt(y),this.lat0<0&&(y=-y)),this.E=y+=v,this.E*=Math.pow(hx(this.e,this.lat0,w),this.B)):(this.B=1/f,this.A=this.k0,this.E=v=y=1),F||k?(F?(S=Math.asin(Math.sin(R)/v),k||(T=R)):(S=T,R=Math.asin(v*Math.sin(S))),this.lam0=M-Math.asin(.5*(y-1/y)*Math.tan(S))/this.B):(x=Math.pow(hx(this.e,D,Math.sin(D)),this.B),C=Math.pow(hx(this.e,L,Math.sin(L)),this.B),y=this.E/x,A=(C-x)/(C+x),E=this.E*this.E,E=(E-C*x)/(E+C*x),o=I-P,o<-Math.pi?P-=eN:o>Math.pi&&(P+=eN),this.lam0=To(.5*(I+P)-Math.atan(E*Math.tan(.5*this.B*(I-P))/A)/this.B),S=Math.atan(2*Math.sin(this.B*To(I-this.lam0))/(y-1/y)),T=R=Math.asin(v*Math.sin(S))),this.singam=Math.sin(S),this.cosgam=Math.cos(S),this.sinrot=Math.sin(T),this.cosrot=Math.cos(T),this.rB=1/this.B,this.ArB=this.A*this.rB,this.BrA=1/this.ArB,O=this.A*this.B,this.no_off?this.u_0=0:(this.u_0=Math.abs(this.ArB*Math.atan(Math.sqrt(v*v-1)/Math.cos(R))),this.lat0<0&&(this.u_0=-this.u_0)),y=.5*S,this.v_pole_n=this.ArB*Math.log(Math.tan(Fc-y)),this.v_pole_s=this.ArB*Math.log(Math.tan(Fc+y))}function i4i(o){var f={},m,v,y,x,C,w,A,E;if(o.x=o.x-this.lam0,Math.abs(Math.abs(o.y)-Yn)>xo){if(C=this.E/Math.pow(hx(this.e,o.y,Math.sin(o.y)),this.B),w=1/C,m=.5*(C-w),v=.5*(C+w),x=Math.sin(this.B*o.x),y=(m*this.singam-x*this.cosgam)/v,Math.abs(Math.abs(y)-1)<xo)throw new Error;E=.5*this.ArB*Math.log((1-y)/(1+y)),w=Math.cos(this.B*o.x),Math.abs(w)<U8?A=this.A*o.x:A=this.ArB*Math.atan2(m*this.cosgam+x*this.singam,w)}else E=o.y>0?this.v_pole_n:this.v_pole_s,A=this.ArB*o.y;return this.no_rot?(f.x=A,f.y=E):(A-=this.u_0,f.x=E*this.cosrot+A*this.sinrot,f.y=A*this.cosrot-E*this.sinrot),f.x=this.a*f.x+this.x0,f.y=this.a*f.y+this.y0,f}function r4i(o){var f,m,v,y,x,C,w,A={};if(o.x=(o.x-this.x0)*(1/this.a),o.y=(o.y-this.y0)*(1/this.a),this.no_rot?(m=o.y,f=o.x):(m=o.x*this.cosrot-o.y*this.sinrot,f=o.y*this.cosrot+o.x*this.sinrot+this.u_0),v=Math.exp(-this.BrA*m),y=.5*(v-1/v),x=.5*(v+1/v),C=Math.sin(this.BrA*f),w=(C*this.cosgam+y*this.singam)/x,Math.abs(Math.abs(w)-1)<xo)A.x=0,A.y=w<0?-Yn:Yn;else{if(A.y=this.E/Math.sqrt((1+w)/(1-w)),A.y=jD(this.e,Math.pow(A.y,1/this.B)),A.y===1/0)throw new Error;A.x=-this.rB*Math.atan2(y*this.cosgam-C*this.singam,Math.cos(this.BrA*f))}return A.x+=this.lam0,A}var n4i=["Hotine_Oblique_Mercator","Hotine Oblique Mercator","Hotine_Oblique_Mercator_Azimuth_Natural_Origin","Hotine_Oblique_Mercator_Two_Point_Natural_Origin","Hotine_Oblique_Mercator_Azimuth_Center","Oblique_Mercator","omerc"],odt={init:t4i,forward:i4i,inverse:r4i,names:n4i};function o4i(){if(this.lat2||(this.lat2=this.lat1),this.k0||(this.k0=1),this.x0=this.x0||0,this.y0=this.y0||0,!(Math.abs(this.lat1+this.lat2)<xo)){var o=this.b/this.a;this.e=Math.sqrt(1-o*o);var f=Math.sin(this.lat1),m=Math.cos(this.lat1),v=iy(this.e,f,m),y=hx(this.e,this.lat1,f),x=Math.sin(this.lat2),C=Math.cos(this.lat2),w=iy(this.e,x,C),A=hx(this.e,this.lat2,x),E=hx(this.e,this.lat0,Math.sin(this.lat0));Math.abs(this.lat1-this.lat2)>xo?this.ns=Math.log(v/w)/Math.log(y/A):this.ns=f,isNaN(this.ns)&&(this.ns=f),this.f0=v/(this.ns*Math.pow(y,this.ns)),this.rh=this.a*this.f0*Math.pow(E,this.ns),this.title||(this.title="Lambert Conformal Conic")}}function a4i(o){var f=o.x,m=o.y;Math.abs(2*Math.abs(m)-Math.PI)<=xo&&(m=NP(m)*(Yn-2*xo));var v=Math.abs(Math.abs(m)-Yn),y,x;if(v>xo)y=hx(this.e,m,Math.sin(m)),x=this.a*this.f0*Math.pow(y,this.ns);else{if(v=m*this.ns,v<=0)return null;x=0}var C=this.ns*To(f-this.long0);return o.x=this.k0*(x*Math.sin(C))+this.x0,o.y=this.k0*(this.rh-x*Math.cos(C))+this.y0,o}function s4i(o){var f,m,v,y,x,C=(o.x-this.x0)/this.k0,w=this.rh-(o.y-this.y0)/this.k0;this.ns>0?(f=Math.sqrt(C*C+w*w),m=1):(f=-Math.sqrt(C*C+w*w),m=-1);var A=0;if(f!==0&&(A=Math.atan2(m*C,m*w)),f!==0||this.ns>0){if(m=1/this.ns,v=Math.pow(f/(this.a*this.f0),m),y=jD(this.e,v),y===-9999)return null}else y=-Yn;return x=To(A/this.ns+this.long0),o.x=x,o.y=y,o}var l4i=["Lambert Tangential Conformal Conic Projection","Lambert_Conformal_Conic","Lambert_Conformal_Conic_1SP","Lambert_Conformal_Conic_2SP","lcc","Lambert Conic Conformal (1SP)","Lambert Conic Conformal (2SP)"],adt={init:o4i,forward:a4i,inverse:s4i,names:l4i};function u4i(){this.a=6377397155e-3,this.es=.006674372230614,this.e=Math.sqrt(this.es),this.lat0||(this.lat0=.863937979737193),this.long0||(this.long0=.7417649320975901-.308341501185665),this.k0||(this.k0=.9999),this.s45=.785398163397448,this.s90=2*this.s45,this.fi0=this.lat0,this.e2=this.es,this.e=Math.sqrt(this.e2),this.alfa=Math.sqrt(1+this.e2*Math.pow(Math.cos(this.fi0),4)/(1-this.e2)),this.uq=1.04216856380474,this.u0=Math.asin(Math.sin(this.fi0)/this.alfa),this.g=Math.pow((1+this.e*Math.sin(this.fi0))/(1-this.e*Math.sin(this.fi0)),this.alfa*this.e/2),this.k=Math.tan(this.u0/2+this.s45)/Math.pow(Math.tan(this.fi0/2+this.s45),this.alfa)*this.g,this.k1=this.k0,this.n0=this.a*Math.sqrt(1-this.e2)/(1-this.e2*Math.pow(Math.sin(this.fi0),2)),this.s0=1.37008346281555,this.n=Math.sin(this.s0),this.ro0=this.k1*this.n0/Math.tan(this.s0),this.ad=this.s90-this.uq}function c4i(o){var f,m,v,y,x,C,w,A=o.x,E=o.y,T=To(A-this.long0);return f=Math.pow((1+this.e*Math.sin(E))/(1-this.e*Math.sin(E)),this.alfa*this.e/2),m=2*(Math.atan(this.k*Math.pow(Math.tan(E/2+this.s45),this.alfa)/f)-this.s45),v=-T*this.alfa,y=Math.asin(Math.cos(this.ad)*Math.sin(m)+Math.sin(this.ad)*Math.cos(m)*Math.cos(v)),x=Math.asin(Math.cos(m)*Math.sin(v)/Math.cos(y)),C=this.n*x,w=this.ro0*Math.pow(Math.tan(this.s0/2+this.s45),this.n)/Math.pow(Math.tan(y/2+this.s45),this.n),o.y=w*Math.cos(C)/1,o.x=w*Math.sin(C)/1,this.czech||(o.y*=-1,o.x*=-1),o}function h4i(o){var f,m,v,y,x,C,w,A,E=o.x;o.x=o.y,o.y=E,this.czech||(o.y*=-1,o.x*=-1),C=Math.sqrt(o.x*o.x+o.y*o.y),x=Math.atan2(o.y,o.x),y=x/Math.sin(this.s0),v=2*(Math.atan(Math.pow(this.ro0/C,1/this.n)*Math.tan(this.s0/2+this.s45))-this.s45),f=Math.asin(Math.cos(this.ad)*Math.sin(v)-Math.sin(this.ad)*Math.cos(v)*Math.cos(y)),m=Math.asin(Math.cos(v)*Math.sin(y)/Math.cos(f)),o.x=this.long0-m/this.alfa,w=f,A=0;var T=0;do o.y=2*(Math.atan(Math.pow(this.k,-1/this.alfa)*Math.pow(Math.tan(f/2+this.s45),1/this.alfa)*Math.pow((1+this.e*Math.sin(w))/(1-this.e*Math.sin(w)),this.e/2))-this.s45),Math.abs(w-o.y)<1e-10&&(A=1),w=o.y,T+=1;while(A===0&&T<15);return T>=15?null:o}var d4i=["Krovak","krovak"],sdt={init:u4i,forward:c4i,inverse:h4i,names:d4i};function i0(o,f,m,v,y){return o*y-f*Math.sin(2*y)+m*Math.sin(4*y)-v*Math.sin(6*y)}function YD(o){return 1-.25*o*(1+o/16*(3+1.25*o))}function qD(o){return .375*o*(1+.25*o*(1+.46875*o))}function XD(o){return .05859375*o*o*(1+.75*o)}function JD(o){return o*o*o*(35/3072)}function KD(o,f,m){var v=f*m;return o/Math.sqrt(1-v*v)}function qT(o){return Math.abs(o)<Yn?o:o-NP(o)*Math.PI}function H4(o,f,m,v,y){var x,C;x=o/f;for(var w=0;w<15;w++)if(C=(o-(f*x-m*Math.sin(2*x)+v*Math.sin(4*x)-y*Math.sin(6*x)))/(f-2*m*Math.cos(2*x)+4*v*Math.cos(4*x)-6*y*Math.cos(6*x)),x+=C,Math.abs(C)<=1e-10)return x;return NaN}function f4i(){this.sphere||(this.e0=YD(this.es),this.e1=qD(this.es),this.e2=XD(this.es),this.e3=JD(this.es),this.ml0=this.a*i0(this.e0,this.e1,this.e2,this.e3,this.lat0))}function p4i(o){var f,m,v=o.x,y=o.y;if(v=To(v-this.long0),this.sphere)f=this.a*Math.asin(Math.cos(y)*Math.sin(v)),m=this.a*(Math.atan2(Math.tan(y),Math.cos(v))-this.lat0);else{var x=Math.sin(y),C=Math.cos(y),w=KD(this.a,this.e,x),A=Math.tan(y)*Math.tan(y),E=v*Math.cos(y),T=E*E,S=this.es*C*C/(1-this.es),M=this.a*i0(this.e0,this.e1,this.e2,this.e3,y);f=w*E*(1-T*A*(1/6-(8-A+8*S)*T/120)),m=M-this.ml0+w*x/C*T*(.5+(5-A+6*S)*T/24)}return o.x=f+this.x0,o.y=m+this.y0,o}function m4i(o){o.x-=this.x0,o.y-=this.y0;var f=o.x/this.a,m=o.y/this.a,v,y;if(this.sphere){var x=m+this.lat0;v=Math.asin(Math.sin(x)*Math.cos(f)),y=Math.atan2(Math.tan(f),Math.cos(x))}else{var C=this.ml0/this.a+m,w=H4(C,this.e0,this.e1,this.e2,this.e3);if(Math.abs(Math.abs(w)-Yn)<=xo)return o.x=this.long0,o.y=Yn,m<0&&(o.y*=-1),o;var A=KD(this.a,this.e,Math.sin(w)),E=A*A*A/this.a/this.a*(1-this.es),T=Math.pow(Math.tan(w),2),S=f*this.a/A,M=S*S;v=w-A*Math.tan(w)/E*S*S*(.5-(1+3*T)*S*S/24),y=S*(1-M*(T/3+(1+3*T)*T*M/15))/Math.cos(w)}return o.x=To(y+this.long0),o.y=qT(v),o}var g4i=["Cassini","Cassini_Soldner","cass"],ldt={init:f4i,forward:p4i,inverse:m4i,names:g4i};function XT(o,f){var m;return o>1e-7?(m=o*f,(1-o*o)*(f/(1-m*m)-.5/o*Math.log((1-m)/(1+m)))):2*f}var _4i=1,v4i=2,y4i=3,x4i=4;function C4i(){var o=Math.abs(this.lat0);if(Math.abs(o-Yn)<xo?this.mode=this.lat0<0?this.S_POLE:this.N_POLE:Math.abs(o)<xo?this.mode=this.EQUIT:this.mode=this.OBLIQ,this.es>0){var f;switch(this.qp=XT(this.e,1),this.mmf=.5/(1-this.es),this.apa=M4i(this.es),this.mode){case this.N_POLE:this.dd=1;break;case this.S_POLE:this.dd=1;break;case this.EQUIT:this.rq=Math.sqrt(.5*this.qp),this.dd=1/this.rq,this.xmf=1,this.ymf=.5*this.qp;break;case this.OBLIQ:this.rq=Math.sqrt(.5*this.qp),f=Math.sin(this.lat0),this.sinb1=XT(this.e,f)/this.qp,this.cosb1=Math.sqrt(1-this.sinb1*this.sinb1),this.dd=Math.cos(this.lat0)/(Math.sqrt(1-this.es*f*f)*this.rq*this.cosb1),this.ymf=(this.xmf=this.rq)/this.dd,this.xmf*=this.dd;break}}else this.mode===this.OBLIQ&&(this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0))}function b4i(o){var f,m,v,y,x,C,w,A,E,T,S=o.x,M=o.y;if(S=To(S-this.long0),this.sphere){if(x=Math.sin(M),T=Math.cos(M),v=Math.cos(S),this.mode===this.OBLIQ||this.mode===this.EQUIT){if(m=this.mode===this.EQUIT?1+T*v:1+this.sinph0*x+this.cosph0*T*v,m<=xo)return null;m=Math.sqrt(2/m),f=m*T*Math.sin(S),m*=this.mode===this.EQUIT?x:this.cosph0*x-this.sinph0*T*v}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(v=-v),Math.abs(M+this.lat0)<xo)return null;m=Fc-M*.5,m=2*(this.mode===this.S_POLE?Math.cos(m):Math.sin(m)),f=m*Math.sin(S),m*=v}}else{switch(w=0,A=0,E=0,v=Math.cos(S),y=Math.sin(S),x=Math.sin(M),C=XT(this.e,x),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(w=C/this.qp,A=Math.sqrt(1-w*w)),this.mode){case this.OBLIQ:E=1+this.sinb1*w+this.cosb1*A*v;break;case this.EQUIT:E=1+A*v;break;case this.N_POLE:E=Yn+M,C=this.qp-C;break;case this.S_POLE:E=M-Yn,C=this.qp+C;break}if(Math.abs(E)<xo)return null;switch(this.mode){case this.OBLIQ:case this.EQUIT:E=Math.sqrt(2/E),this.mode===this.OBLIQ?m=this.ymf*E*(this.cosb1*w-this.sinb1*A*v):m=(E=Math.sqrt(2/(1+A*v)))*w*this.ymf,f=this.xmf*E*A*y;break;case this.N_POLE:case this.S_POLE:C>=0?(f=(E=Math.sqrt(C))*y,m=v*(this.mode===this.S_POLE?E:-E)):f=m=0;break}}return o.x=this.a*f+this.x0,o.y=this.a*m+this.y0,o}function w4i(o){o.x-=this.x0,o.y-=this.y0;var f=o.x/this.a,m=o.y/this.a,v,y,x,C,w,A,E;if(this.sphere){var T=0,S,M=0;if(S=Math.sqrt(f*f+m*m),y=S*.5,y>1)return null;switch(y=2*Math.asin(y),(this.mode===this.OBLIQ||this.mode===this.EQUIT)&&(M=Math.sin(y),T=Math.cos(y)),this.mode){case this.EQUIT:y=Math.abs(S)<=xo?0:Math.asin(m*M/S),f*=M,m=T*S;break;case this.OBLIQ:y=Math.abs(S)<=xo?this.lat0:Math.asin(T*this.sinph0+m*M*this.cosph0/S),f*=M*this.cosph0,m=(T-Math.sin(y)*this.sinph0)*S;break;case this.N_POLE:m=-m,y=Yn-y;break;case this.S_POLE:y-=Yn;break}v=m===0&&(this.mode===this.EQUIT||this.mode===this.OBLIQ)?0:Math.atan2(f,m)}else{if(E=0,this.mode===this.OBLIQ||this.mode===this.EQUIT){if(f/=this.dd,m*=this.dd,A=Math.sqrt(f*f+m*m),A<xo)return o.x=this.long0,o.y=this.lat0,o;C=2*Math.asin(.5*A/this.rq),x=Math.cos(C),f*=C=Math.sin(C),this.mode===this.OBLIQ?(E=x*this.sinb1+m*C*this.cosb1/A,w=this.qp*E,m=A*this.cosb1*x-m*this.sinb1*C):(E=m*C/A,w=this.qp*E,m=A*x)}else if(this.mode===this.N_POLE||this.mode===this.S_POLE){if(this.mode===this.N_POLE&&(m=-m),w=f*f+m*m,!w)return o.x=this.long0,o.y=this.lat0,o;E=1-w/this.qp,this.mode===this.S_POLE&&(E=-E)}v=Math.atan2(f,m),y=D4i(Math.asin(E),this.apa)}return o.x=To(this.long0+v),o.y=y,o}var A4i=.3333333333333333,E4i=.17222222222222222,T4i=.10257936507936508,S4i=.06388888888888888,P4i=.0664021164021164,I4i=.016415012942191543;function M4i(o){var f,m=[];return m[0]=o*A4i,f=o*o,m[0]+=f*E4i,m[1]=f*S4i,f*=o,m[0]+=f*T4i,m[1]+=f*P4i,m[2]=f*I4i,m}function D4i(o,f){var m=o+o;return o+f[0]*Math.sin(m)+f[1]*Math.sin(m+m)+f[2]*Math.sin(m+m+m)}var L4i=["Lambert Azimuthal Equal Area","Lambert_Azimuthal_Equal_Area","laea"],udt={init:C4i,forward:b4i,inverse:w4i,names:L4i,S_POLE:_4i,N_POLE:v4i,EQUIT:y4i,OBLIQ:x4i};function FC(o){return Math.abs(o)>1&&(o=o>1?1:-1),Math.asin(o)}function R4i(){Math.abs(this.lat1+this.lat2)<xo||(this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e3=Math.sqrt(this.es),this.sin_po=Math.sin(this.lat1),this.cos_po=Math.cos(this.lat1),this.t1=this.sin_po,this.con=this.sin_po,this.ms1=iy(this.e3,this.sin_po,this.cos_po),this.qs1=XT(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat2),this.cos_po=Math.cos(this.lat2),this.t2=this.sin_po,this.ms2=iy(this.e3,this.sin_po,this.cos_po),this.qs2=XT(this.e3,this.sin_po),this.sin_po=Math.sin(this.lat0),this.cos_po=Math.cos(this.lat0),this.t3=this.sin_po,this.qs0=XT(this.e3,this.sin_po),Math.abs(this.lat1-this.lat2)>xo?this.ns0=(this.ms1*this.ms1-this.ms2*this.ms2)/(this.qs2-this.qs1):this.ns0=this.con,this.c=this.ms1*this.ms1+this.ns0*this.qs1,this.rh=this.a*Math.sqrt(this.c-this.ns0*this.qs0)/this.ns0)}function O4i(o){var f=o.x,m=o.y;this.sin_phi=Math.sin(m),this.cos_phi=Math.cos(m);var v=XT(this.e3,this.sin_phi),y=this.a*Math.sqrt(this.c-this.ns0*v)/this.ns0,x=this.ns0*To(f-this.long0),C=y*Math.sin(x)+this.x0,w=this.rh-y*Math.cos(x)+this.y0;return o.x=C,o.y=w,o}function N4i(o){var f,m,v,y,x,C;return o.x-=this.x0,o.y=this.rh-o.y+this.y0,this.ns0>=0?(f=Math.sqrt(o.x*o.x+o.y*o.y),v=1):(f=-Math.sqrt(o.x*o.x+o.y*o.y),v=-1),y=0,f!==0&&(y=Math.atan2(v*o.x,v*o.y)),v=f*this.ns0/this.a,this.sphere?C=Math.asin((this.c-v*v)/(2*this.ns0)):(m=(this.c-v*v)/this.ns0,C=this.phi1z(this.e3,m)),x=To(y/this.ns0+this.long0),o.x=x,o.y=C,o}function F4i(o,f){var m,v,y,x,C,w=FC(.5*f);if(o<xo)return w;for(var A=o*o,E=1;E<=25;E++)if(m=Math.sin(w),v=Math.cos(w),y=o*m,x=1-y*y,C=.5*x*x/v*(f/(1-A)-m/x+.5/o*Math.log((1-y)/(1+y))),w=w+C,Math.abs(C)<=1e-7)return w;return null}var B4i=["Albers_Conic_Equal_Area","Albers","aea"],cdt={init:R4i,forward:O4i,inverse:N4i,names:B4i,phi1z:F4i};function k4i(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0),this.infinity_dist=1e3*this.a,this.rc=1}function V4i(o){var f,m,v,y,x,C,w,A,E=o.x,T=o.y;return v=To(E-this.long0),f=Math.sin(T),m=Math.cos(T),y=Math.cos(v),C=this.sin_p14*f+this.cos_p14*m*y,x=1,C>0||Math.abs(C)<=xo?(w=this.x0+this.a*x*m*Math.sin(v)/C,A=this.y0+this.a*x*(this.cos_p14*f-this.sin_p14*m*y)/C):(w=this.x0+this.infinity_dist*m*Math.sin(v),A=this.y0+this.infinity_dist*(this.cos_p14*f-this.sin_p14*m*y)),o.x=w,o.y=A,o}function z4i(o){var f,m,v,y,x,C;return o.x=(o.x-this.x0)/this.a,o.y=(o.y-this.y0)/this.a,o.x/=this.k0,o.y/=this.k0,(f=Math.sqrt(o.x*o.x+o.y*o.y))?(y=Math.atan2(f,this.rc),m=Math.sin(y),v=Math.cos(y),C=FC(v*this.sin_p14+o.y*m*this.cos_p14/f),x=Math.atan2(o.x*m,f*this.cos_p14*v-o.y*this.sin_p14*m),x=To(this.long0+x)):(C=this.phic0,x=0),o.x=x,o.y=C,o}var H4i=["gnom"],hdt={init:k4i,forward:V4i,inverse:z4i,names:H4i};function ddt(o,f){var m=1-(1-o*o)/(2*o)*Math.log((1-o)/(1+o));if(Math.abs(Math.abs(f)-m)<1e-6)return f<0?-1*Yn:Yn;for(var v=Math.asin(.5*f),y,x,C,w,A=0;A<30;A++)if(x=Math.sin(v),C=Math.cos(v),w=o*x,y=Math.pow(1-w*w,2)/(2*C)*(f/(1-o*o)-x/(1-w*w)+.5/o*Math.log((1-w)/(1+w))),v+=y,Math.abs(y)<=1e-10)return v;return NaN}function U4i(){this.sphere||(this.k0=iy(this.e,Math.sin(this.lat_ts),Math.cos(this.lat_ts)))}function G4i(o){var f=o.x,m=o.y,v,y,x=To(f-this.long0);if(this.sphere)v=this.x0+this.a*x*Math.cos(this.lat_ts),y=this.y0+this.a*Math.sin(m)/Math.cos(this.lat_ts);else{var C=XT(this.e,Math.sin(m));v=this.x0+this.a*this.k0*x,y=this.y0+this.a*C*.5/this.k0}return o.x=v,o.y=y,o}function W4i(o){o.x-=this.x0,o.y-=this.y0;var f,m;return this.sphere?(f=To(this.long0+o.x/this.a/Math.cos(this.lat_ts)),m=Math.asin(o.y/this.a*Math.cos(this.lat_ts))):(m=ddt(this.e,2*o.y*this.k0/this.a),f=To(this.long0+o.x/(this.a*this.k0))),o.x=f,o.y=m,o}var j4i=["cea"],fdt={init:U4i,forward:G4i,inverse:W4i,names:j4i};function Y4i(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Equidistant Cylindrical (Plate Carre)",this.rc=Math.cos(this.lat_ts)}function q4i(o){var f=o.x,m=o.y,v=To(f-this.long0),y=qT(m-this.lat0);return o.x=this.x0+this.a*v*this.rc,o.y=this.y0+this.a*y,o}function X4i(o){var f=o.x,m=o.y;return o.x=To(this.long0+(f-this.x0)/(this.a*this.rc)),o.y=qT(this.lat0+(m-this.y0)/this.a),o}var J4i=["Equirectangular","Equidistant_Cylindrical","eqc"],pdt={init:Y4i,forward:q4i,inverse:X4i,names:J4i};var mdt=20;function K4i(){this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=YD(this.es),this.e1=qD(this.es),this.e2=XD(this.es),this.e3=JD(this.es),this.ml0=this.a*i0(this.e0,this.e1,this.e2,this.e3,this.lat0)}function Q4i(o){var f=o.x,m=o.y,v,y,x,C=To(f-this.long0);if(x=C*Math.sin(m),this.sphere)Math.abs(m)<=xo?(v=this.a*C,y=-1*this.a*this.lat0):(v=this.a*Math.sin(x)/Math.tan(m),y=this.a*(qT(m-this.lat0)+(1-Math.cos(x))/Math.tan(m)));else if(Math.abs(m)<=xo)v=this.a*C,y=-1*this.ml0;else{var w=KD(this.a,this.e,Math.sin(m))/Math.tan(m);v=w*Math.sin(x),y=this.a*i0(this.e0,this.e1,this.e2,this.e3,m)-this.ml0+w*(1-Math.cos(x))}return o.x=v+this.x0,o.y=y+this.y0,o}function Z4i(o){var f,m,v,y,x,C,w,A,E;if(v=o.x-this.x0,y=o.y-this.y0,this.sphere)if(Math.abs(y+this.a*this.lat0)<=xo)f=To(v/this.a+this.long0),m=0;else{C=this.lat0+y/this.a,w=v*v/this.a/this.a+C*C,A=C;var T;for(x=mdt;x;--x)if(T=Math.tan(A),E=-1*(C*(A*T+1)-A-.5*(A*A+w)*T)/((A-C)/T-1),A+=E,Math.abs(E)<=xo){m=A;break}f=To(this.long0+Math.asin(v*Math.tan(A)/this.a)/Math.sin(m))}else if(Math.abs(y+this.ml0)<=xo)m=0,f=To(this.long0+v/this.a);else{C=(this.ml0+y)/this.a,w=v*v/this.a/this.a+C*C,A=C;var S,M,I,P,D;for(x=mdt;x;--x)if(D=this.e*Math.sin(A),S=Math.sqrt(1-D*D)*Math.tan(A),M=this.a*i0(this.e0,this.e1,this.e2,this.e3,A),I=this.e0-2*this.e1*Math.cos(2*A)+4*this.e2*Math.cos(4*A)-6*this.e3*Math.cos(6*A),P=M/this.a,E=(C*(S*P+1)-P-.5*S*(P*P+w))/(this.es*Math.sin(2*A)*(P*P+w-2*C*P)/(4*S)+(C-P)*(S*I-2/Math.sin(2*A))-I),A-=E,Math.abs(E)<=xo){m=A;break}S=Math.sqrt(1-this.es*Math.pow(Math.sin(m),2))*Math.tan(m),f=To(this.long0+Math.asin(v*S/this.a)/Math.sin(m))}return o.x=f,o.y=m,o}var $4i=["Polyconic","poly"],gdt={init:K4i,forward:Q4i,inverse:Z4i,names:$4i};function eki(){this.A=[],this.A[1]=.6399175073,this.A[2]=-.1358797613,this.A[3]=.063294409,this.A[4]=-.02526853,this.A[5]=.0117879,this.A[6]=-.0055161,this.A[7]=.0026906,this.A[8]=-.001333,this.A[9]=67e-5,this.A[10]=-34e-5,this.B_re=[],this.B_im=[],this.B_re[1]=.7557853228,this.B_im[1]=0,this.B_re[2]=.249204646,this.B_im[2]=.003371507,this.B_re[3]=-.001541739,this.B_im[3]=.04105856,this.B_re[4]=-.10162907,this.B_im[4]=.01727609,this.B_re[5]=-.26623489,this.B_im[5]=-.36249218,this.B_re[6]=-.6870983,this.B_im[6]=-1.1651967,this.C_re=[],this.C_im=[],this.C_re[1]=1.3231270439,this.C_im[1]=0,this.C_re[2]=-.577245789,this.C_im[2]=-.007809598,this.C_re[3]=.508307513,this.C_im[3]=-.112208952,this.C_re[4]=-.15094762,this.C_im[4]=.18200602,this.C_re[5]=1.01418179,this.C_im[5]=1.64497696,this.C_re[6]=1.9660549,this.C_im[6]=2.5127645,this.D=[],this.D[1]=1.5627014243,this.D[2]=.5185406398,this.D[3]=-.03333098,this.D[4]=-.1052906,this.D[5]=-.0368594,this.D[6]=.007317,this.D[7]=.0122,this.D[8]=.00394,this.D[9]=-.0013}function tki(o){var f,m=o.x,v=o.y,y=v-this.lat0,x=m-this.long0,C=y/B4*1e-5,w=x,A=1,E=0;for(f=1;f<=10;f++)A=A*C,E=E+this.A[f]*A;var T=E,S=w,M=1,I=0,P,D,L=0,R=0;for(f=1;f<=6;f++)P=M*T-I*S,D=I*T+M*S,M=P,I=D,L=L+this.B_re[f]*M-this.B_im[f]*I,R=R+this.B_im[f]*M+this.B_re[f]*I;return o.x=R*this.a+this.x0,o.y=L*this.a+this.y0,o}function iki(o){var f,m=o.x,v=o.y,y=m-this.x0,x=v-this.y0,C=x/this.a,w=y/this.a,A=1,E=0,T,S,M=0,I=0;for(f=1;f<=6;f++)T=A*C-E*w,S=E*C+A*w,A=T,E=S,M=M+this.C_re[f]*A-this.C_im[f]*E,I=I+this.C_im[f]*A+this.C_re[f]*E;for(var P=0;P<this.iterations;P++){var D=M,L=I,R,O,F=C,k=w;for(f=2;f<=6;f++)R=D*M-L*I,O=L*M+D*I,D=R,L=O,F=F+(f-1)*(this.B_re[f]*D-this.B_im[f]*L),k=k+(f-1)*(this.B_im[f]*D+this.B_re[f]*L);D=1,L=0;var U=this.B_re[1],G=this.B_im[1];for(f=2;f<=6;f++)R=D*M-L*I,O=L*M+D*I,D=R,L=O,U=U+f*(this.B_re[f]*D-this.B_im[f]*L),G=G+f*(this.B_im[f]*D+this.B_re[f]*L);var j=U*U+G*G;M=(F*U+k*G)/j,I=(k*U-F*G)/j}var q=M,J=I,X=1,Y=0;for(f=1;f<=9;f++)X=X*q,Y=Y+this.D[f]*X;var Q=this.lat0+Y*B4*1e5,ee=this.long0+J;return o.x=ee,o.y=Q,o}var rki=["New_Zealand_Map_Grid","nzmg"],_dt={init:eki,forward:tki,inverse:iki,names:rki};function nki(){}function oki(o){var f=o.x,m=o.y,v=To(f-this.long0),y=this.x0+this.a*v,x=this.y0+this.a*Math.log(Math.tan(Math.PI/4+m/2.5))*1.25;return o.x=y,o.y=x,o}function aki(o){o.x-=this.x0,o.y-=this.y0;var f=To(this.long0+o.x/this.a),m=2.5*(Math.atan(Math.exp(.8*o.y/this.a))-Math.PI/4);return o.x=f,o.y=m,o}var ski=["Miller_Cylindrical","mill"],vdt={init:nki,forward:oki,inverse:aki,names:ski};var lki=20;function uki(){this.sphere?(this.n=1,this.m=0,this.es=0,this.C_y=Math.sqrt((this.m+1)/this.n),this.C_x=this.C_y/(this.m+1)):this.en=Wle(this.es)}function cki(o){var f,m,v=o.x,y=o.y;if(v=To(v-this.long0),this.sphere){if(!this.m)y=this.n!==1?Math.asin(this.n*Math.sin(y)):y;else for(var x=this.n*Math.sin(y),C=lki;C;--C){var w=(this.m*y+Math.sin(y)-x)/(this.m+Math.cos(y));if(y-=w,Math.abs(w)<xo)break}f=this.a*this.C_x*v*(this.m+Math.cos(y)),m=this.a*this.C_y*y}else{var A=Math.sin(y),E=Math.cos(y);m=this.a*z4(y,A,E,this.en),f=this.a*v*E/Math.sqrt(1-this.es*A*A)}return o.x=f,o.y=m,o}function hki(o){var f,m,v,y;return o.x-=this.x0,v=o.x/this.a,o.y-=this.y0,f=o.y/this.a,this.sphere?(f/=this.C_y,v=v/(this.C_x*(this.m+Math.cos(f))),this.m?f=FC((this.m*f+Math.sin(f))/this.n):this.n!==1&&(f=FC(Math.sin(f)/this.n)),v=To(v+this.long0),f=qT(f)):(f=jle(o.y/this.a,this.es,this.en),y=Math.abs(f),y<Yn?(y=Math.sin(f),m=this.long0+o.x*Math.sqrt(1-this.es*y*y)/(this.a*Math.cos(f)),v=To(m)):y-xo<Yn&&(v=this.long0)),o.x=v,o.y=f,o}var dki=["Sinusoidal","sinu"],ydt={init:uki,forward:cki,inverse:hki,names:dki};function fki(){}function pki(o){for(var f=o.x,m=o.y,v=To(f-this.long0),y=m,x=Math.PI*Math.sin(m);;){var C=-(y+Math.sin(y)-x)/(1+Math.cos(y));if(y+=C,Math.abs(C)<xo)break}y/=2,Math.PI/2-Math.abs(m)<xo&&(v=0);var w=.900316316158*this.a*v*Math.cos(y)+this.x0,A=1.4142135623731*this.a*Math.sin(y)+this.y0;return o.x=w,o.y=A,o}function mki(o){var f,m;o.x-=this.x0,o.y-=this.y0,m=o.y/(1.4142135623731*this.a),Math.abs(m)>.999999999999&&(m=.999999999999),f=Math.asin(m);var v=To(this.long0+o.x/(.900316316158*this.a*Math.cos(f)));v<-Math.PI&&(v=-Math.PI),v>Math.PI&&(v=Math.PI),m=(2*f+Math.sin(2*f))/Math.PI,Math.abs(m)>1&&(m=1);var y=Math.asin(m);return o.x=v,o.y=y,o}var gki=["Mollweide","moll"],xdt={init:fki,forward:pki,inverse:mki,names:gki};function _ki(){Math.abs(this.lat1+this.lat2)<xo||(this.lat2=this.lat2||this.lat1,this.temp=this.b/this.a,this.es=1-Math.pow(this.temp,2),this.e=Math.sqrt(this.es),this.e0=YD(this.es),this.e1=qD(this.es),this.e2=XD(this.es),this.e3=JD(this.es),this.sinphi=Math.sin(this.lat1),this.cosphi=Math.cos(this.lat1),this.ms1=iy(this.e,this.sinphi,this.cosphi),this.ml1=i0(this.e0,this.e1,this.e2,this.e3,this.lat1),Math.abs(this.lat1-this.lat2)<xo?this.ns=this.sinphi:(this.sinphi=Math.sin(this.lat2),this.cosphi=Math.cos(this.lat2),this.ms2=iy(this.e,this.sinphi,this.cosphi),this.ml2=i0(this.e0,this.e1,this.e2,this.e3,this.lat2),this.ns=(this.ms1-this.ms2)/(this.ml2-this.ml1)),this.g=this.ml1+this.ms1/this.ns,this.ml0=i0(this.e0,this.e1,this.e2,this.e3,this.lat0),this.rh=this.a*(this.g-this.ml0))}function vki(o){var f=o.x,m=o.y,v;if(this.sphere)v=this.a*(this.g-m);else{var y=i0(this.e0,this.e1,this.e2,this.e3,m);v=this.a*(this.g-y)}var x=this.ns*To(f-this.long0),C=this.x0+v*Math.sin(x),w=this.y0+this.rh-v*Math.cos(x);return o.x=C,o.y=w,o}function yki(o){o.x-=this.x0,o.y=this.rh-o.y+this.y0;var f,m,v,y;this.ns>=0?(m=Math.sqrt(o.x*o.x+o.y*o.y),f=1):(m=-Math.sqrt(o.x*o.x+o.y*o.y),f=-1);var x=0;if(m!==0&&(x=Math.atan2(f*o.x,f*o.y)),this.sphere)return y=To(this.long0+x/this.ns),v=qT(this.g-m/this.a),o.x=y,o.y=v,o;var C=this.g-m/this.a;return v=H4(C,this.e0,this.e1,this.e2,this.e3),y=To(this.long0+x/this.ns),o.x=y,o.y=v,o}var xki=["Equidistant_Conic","eqdc"],Cdt={init:_ki,forward:vki,inverse:yki,names:xki};function Cki(){this.R=this.a}function bki(o){var f=o.x,m=o.y,v=To(f-this.long0),y,x;Math.abs(m)<=xo&&(y=this.x0+this.R*v,x=this.y0);var C=FC(2*Math.abs(m/Math.PI));(Math.abs(v)<=xo||Math.abs(Math.abs(m)-Yn)<=xo)&&(y=this.x0,m>=0?x=this.y0+Math.PI*this.R*Math.tan(.5*C):x=this.y0+Math.PI*this.R*-Math.tan(.5*C));var w=.5*Math.abs(Math.PI/v-v/Math.PI),A=w*w,E=Math.sin(C),T=Math.cos(C),S=T/(E+T-1),M=S*S,I=S*(2/E-1),P=I*I,D=Math.PI*this.R*(w*(S-P)+Math.sqrt(A*(S-P)*(S-P)-(P+A)*(M-P)))/(P+A);v<0&&(D=-D),y=this.x0+D;var L=A+S;return D=Math.PI*this.R*(I*L-w*Math.sqrt((P+A)*(A+1)-L*L))/(P+A),m>=0?x=this.y0+D:x=this.y0-D,o.x=y,o.y=x,o}function wki(o){var f,m,v,y,x,C,w,A,E,T,S,M,I;return o.x-=this.x0,o.y-=this.y0,S=Math.PI*this.R,v=o.x/S,y=o.y/S,x=v*v+y*y,C=-Math.abs(y)*(1+x),w=C-2*y*y+v*v,A=-2*C+1+2*y*y+x*x,I=y*y/A+(2*w*w*w/A/A/A-9*C*w/A/A)/27,E=(C-w*w/3/A)/A,T=2*Math.sqrt(-E/3),S=3*I/E/T,Math.abs(S)>1&&(S>=0?S=1:S=-1),M=Math.acos(S)/3,o.y>=0?m=(-T*Math.cos(M+Math.PI/3)-w/3/A)*Math.PI:m=-(-T*Math.cos(M+Math.PI/3)-w/3/A)*Math.PI,Math.abs(v)<xo?f=this.long0:f=To(this.long0+Math.PI*(x-1+Math.sqrt(1+2*(v*v-y*y)+x*x))/2/v),o.x=f,o.y=m,o}var Aki=["Van_der_Grinten_I","VanDerGrinten","vandg"],bdt={init:Cki,forward:bki,inverse:wki,names:Aki};function Eki(){this.sin_p12=Math.sin(this.lat0),this.cos_p12=Math.cos(this.lat0)}function Tki(o){var f=o.x,m=o.y,v=Math.sin(o.y),y=Math.cos(o.y),x=To(f-this.long0),C,w,A,E,T,S,M,I,P,D,L,R,O,F,k,U,G,j,q,J,X,Y,Q;return this.sphere?Math.abs(this.sin_p12-1)<=xo?(o.x=this.x0+this.a*(Yn-m)*Math.sin(x),o.y=this.y0-this.a*(Yn-m)*Math.cos(x),o):Math.abs(this.sin_p12+1)<=xo?(o.x=this.x0+this.a*(Yn+m)*Math.sin(x),o.y=this.y0+this.a*(Yn+m)*Math.cos(x),o):(j=this.sin_p12*v+this.cos_p12*y*Math.cos(x),U=Math.acos(j),G=U?U/Math.sin(U):1,o.x=this.x0+this.a*G*y*Math.sin(x),o.y=this.y0+this.a*G*(this.cos_p12*v-this.sin_p12*y*Math.cos(x)),o):(C=YD(this.es),w=qD(this.es),A=XD(this.es),E=JD(this.es),Math.abs(this.sin_p12-1)<=xo?(T=this.a*i0(C,w,A,E,Yn),S=this.a*i0(C,w,A,E,m),o.x=this.x0+(T-S)*Math.sin(x),o.y=this.y0-(T-S)*Math.cos(x),o):Math.abs(this.sin_p12+1)<=xo?(T=this.a*i0(C,w,A,E,Yn),S=this.a*i0(C,w,A,E,m),o.x=this.x0+(T+S)*Math.sin(x),o.y=this.y0+(T+S)*Math.cos(x),o):(M=v/y,I=KD(this.a,this.e,this.sin_p12),P=KD(this.a,this.e,v),D=Math.atan((1-this.es)*M+this.es*I*this.sin_p12/(P*y)),L=Math.atan2(Math.sin(x),this.cos_p12*Math.tan(D)-this.sin_p12*Math.cos(x)),L===0?q=Math.asin(this.cos_p12*Math.sin(D)-this.sin_p12*Math.cos(D)):Math.abs(Math.abs(L)-Math.PI)<=xo?q=-Math.asin(this.cos_p12*Math.sin(D)-this.sin_p12*Math.cos(D)):q=Math.asin(Math.sin(x)*Math.cos(D)/Math.sin(L)),R=this.e*this.sin_p12/Math.sqrt(1-this.es),O=this.e*this.cos_p12*Math.cos(L)/Math.sqrt(1-this.es),F=R*O,k=O*O,J=q*q,X=J*q,Y=X*q,Q=Y*q,U=I*q*(1-J*k*(1-k)/6+X/8*F*(1-2*k)+Y/120*(k*(4-7*k)-3*R*R*(1-7*k))-Q/48*F),o.x=this.x0+U*Math.sin(L),o.y=this.y0+U*Math.cos(L),o))}function Ski(o){o.x-=this.x0,o.y-=this.y0;var f,m,v,y,x,C,w,A,E,T,S,M,I,P,D,L,R,O,F,k,U,G,j,q;return this.sphere?(f=Math.sqrt(o.x*o.x+o.y*o.y),f>2*Yn*this.a?void 0:(m=f/this.a,v=Math.sin(m),y=Math.cos(m),x=this.long0,Math.abs(f)<=xo?C=this.lat0:(C=FC(y*this.sin_p12+o.y*v*this.cos_p12/f),w=Math.abs(this.lat0)-Yn,Math.abs(w)<=xo?this.lat0>=0?x=To(this.long0+Math.atan2(o.x,-o.y)):x=To(this.long0-Math.atan2(-o.x,o.y)):x=To(this.long0+Math.atan2(o.x*v,f*this.cos_p12*y-o.y*this.sin_p12*v))),o.x=x,o.y=C,o)):(A=YD(this.es),E=qD(this.es),T=XD(this.es),S=JD(this.es),Math.abs(this.sin_p12-1)<=xo?(M=this.a*i0(A,E,T,S,Yn),f=Math.sqrt(o.x*o.x+o.y*o.y),I=M-f,C=H4(I/this.a,A,E,T,S),x=To(this.long0+Math.atan2(o.x,-1*o.y)),o.x=x,o.y=C,o):Math.abs(this.sin_p12+1)<=xo?(M=this.a*i0(A,E,T,S,Yn),f=Math.sqrt(o.x*o.x+o.y*o.y),I=f-M,C=H4(I/this.a,A,E,T,S),x=To(this.long0+Math.atan2(o.x,o.y)),o.x=x,o.y=C,o):(f=Math.sqrt(o.x*o.x+o.y*o.y),L=Math.atan2(o.x,o.y),P=KD(this.a,this.e,this.sin_p12),R=Math.cos(L),O=this.e*this.cos_p12*R,F=-O*O/(1-this.es),k=3*this.es*(1-F)*this.sin_p12*this.cos_p12*R/(1-this.es),U=f/P,G=U-F*(1+F)*Math.pow(U,3)/6-k*(1+3*F)*Math.pow(U,4)/24,j=1-F*G*G/2-U*G*G*G/6,D=Math.asin(this.sin_p12*Math.cos(G)+this.cos_p12*Math.sin(G)*R),x=To(this.long0+Math.asin(Math.sin(L)*Math.sin(G)/Math.cos(D))),q=Math.sin(D),C=Math.atan2((q-this.es*j*this.sin_p12)*Math.tan(D),q*(1-this.es)),o.x=x,o.y=C,o))}var Pki=["Azimuthal_Equidistant","aeqd"],wdt={init:Eki,forward:Tki,inverse:Ski,names:Pki};function Iki(){this.sin_p14=Math.sin(this.lat0),this.cos_p14=Math.cos(this.lat0)}function Mki(o){var f,m,v,y,x,C,w,A,E=o.x,T=o.y;return v=To(E-this.long0),f=Math.sin(T),m=Math.cos(T),y=Math.cos(v),C=this.sin_p14*f+this.cos_p14*m*y,x=1,(C>0||Math.abs(C)<=xo)&&(w=this.a*x*m*Math.sin(v),A=this.y0+this.a*x*(this.cos_p14*f-this.sin_p14*m*y)),o.x=w,o.y=A,o}function Dki(o){var f,m,v,y,x,C,w;return o.x-=this.x0,o.y-=this.y0,f=Math.sqrt(o.x*o.x+o.y*o.y),m=FC(f/this.a),v=Math.sin(m),y=Math.cos(m),C=this.long0,Math.abs(f)<=xo?(w=this.lat0,o.x=C,o.y=w,o):(w=FC(y*this.sin_p14+o.y*v*this.cos_p14/f),x=Math.abs(this.lat0)-Yn,Math.abs(x)<=xo?(this.lat0>=0?C=To(this.long0+Math.atan2(o.x,-o.y)):C=To(this.long0-Math.atan2(-o.x,o.y)),o.x=C,o.y=w,o):(C=To(this.long0+Math.atan2(o.x*v,f*this.cos_p14*y-o.y*this.sin_p14*v)),o.x=C,o.y=w,o))}var Lki=["ortho"],Adt={init:Iki,forward:Mki,inverse:Dki,names:Lki};var Fp={FRONT:1,RIGHT:2,BACK:3,LEFT:4,TOP:5,BOTTOM:6},Xh={AREA_0:1,AREA_1:2,AREA_2:3,AREA_3:4};function Rki(){this.x0=this.x0||0,this.y0=this.y0||0,this.lat0=this.lat0||0,this.long0=this.long0||0,this.lat_ts=this.lat_ts||0,this.title=this.title||"Quadrilateralized Spherical Cube",this.lat0>=Yn-Fc/2?this.face=Fp.TOP:this.lat0<=-(Yn-Fc/2)?this.face=Fp.BOTTOM:Math.abs(this.long0)<=Fc?this.face=Fp.FRONT:Math.abs(this.long0)<=Yn+Fc?this.face=this.long0>0?Fp.RIGHT:Fp.LEFT:this.face=Fp.BACK,this.es!==0&&(this.one_minus_f=1-(this.a-this.b)/this.a,this.one_minus_f_squared=this.one_minus_f*this.one_minus_f)}function Oki(o){var f={x:0,y:0},m,v,y,x,C,w,A={value:0};if(o.x-=this.long0,this.es!==0?m=Math.atan(this.one_minus_f_squared*Math.tan(o.y)):m=o.y,v=o.x,this.face===Fp.TOP)x=Yn-m,v>=Fc&&v<=Yn+Fc?(A.value=Xh.AREA_0,y=v-Yn):v>Yn+Fc||v<=-(Yn+Fc)?(A.value=Xh.AREA_1,y=v>0?v-Np:v+Np):v>-(Yn+Fc)&&v<=-Fc?(A.value=Xh.AREA_2,y=v+Yn):(A.value=Xh.AREA_3,y=v);else if(this.face===Fp.BOTTOM)x=Yn+m,v>=Fc&&v<=Yn+Fc?(A.value=Xh.AREA_0,y=-v+Yn):v<Fc&&v>=-Fc?(A.value=Xh.AREA_1,y=-v):v<-Fc&&v>=-(Yn+Fc)?(A.value=Xh.AREA_2,y=-v-Yn):(A.value=Xh.AREA_3,y=v>0?-v+Np:-v-Np);else{var E,T,S,M,I,P,D;this.face===Fp.RIGHT?v=G8(v,+Yn):this.face===Fp.BACK?v=G8(v,+Np):this.face===Fp.LEFT&&(v=G8(v,-Yn)),M=Math.sin(m),I=Math.cos(m),P=Math.sin(v),D=Math.cos(v),E=I*D,T=I*P,S=M,this.face===Fp.FRONT?(x=Math.acos(E),y=Kle(x,S,T,A)):this.face===Fp.RIGHT?(x=Math.acos(T),y=Kle(x,S,-E,A)):this.face===Fp.BACK?(x=Math.acos(-E),y=Kle(x,S,-T,A)):this.face===Fp.LEFT?(x=Math.acos(-T),y=Kle(x,S,E,A)):(x=y=0,A.value=Xh.AREA_0)}return w=Math.atan(12/Np*(y+Math.acos(Math.sin(y)*Math.cos(Fc))-Yn)),C=Math.sqrt((1-Math.cos(x))/(Math.cos(w)*Math.cos(w))/(1-Math.cos(Math.atan(1/Math.cos(y))))),A.value===Xh.AREA_1?w+=Yn:A.value===Xh.AREA_2?w+=Np:A.value===Xh.AREA_3&&(w+=1.5*Np),f.x=C*Math.cos(w),f.y=C*Math.sin(w),f.x=f.x*this.a+this.x0,f.y=f.y*this.a+this.y0,o.x=f.x,o.y=f.y,o}function Nki(o){var f={lam:0,phi:0},m,v,y,x,C,w,A,E,T,S={value:0};if(o.x=(o.x-this.x0)/this.a,o.y=(o.y-this.y0)/this.a,v=Math.atan(Math.sqrt(o.x*o.x+o.y*o.y)),m=Math.atan2(o.y,o.x),o.x>=0&&o.x>=Math.abs(o.y)?S.value=Xh.AREA_0:o.y>=0&&o.y>=Math.abs(o.x)?(S.value=Xh.AREA_1,m-=Yn):o.x<0&&-o.x>=Math.abs(o.y)?(S.value=Xh.AREA_2,m=m<0?m+Np:m-Np):(S.value=Xh.AREA_3,m+=Yn),T=Np/12*Math.tan(m),C=Math.sin(T)/(Math.cos(T)-1/Math.sqrt(2)),w=Math.atan(C),y=Math.cos(m),x=Math.tan(v),A=1-y*y*x*x*(1-Math.cos(Math.atan(1/Math.cos(w)))),A<-1?A=-1:A>1&&(A=1),this.face===Fp.TOP)E=Math.acos(A),f.phi=Yn-E,S.value===Xh.AREA_0?f.lam=w+Yn:S.value===Xh.AREA_1?f.lam=w<0?w+Np:w-Np:S.value===Xh.AREA_2?f.lam=w-Yn:f.lam=w;else if(this.face===Fp.BOTTOM)E=Math.acos(A),f.phi=E-Yn,S.value===Xh.AREA_0?f.lam=-w+Yn:S.value===Xh.AREA_1?f.lam=-w:S.value===Xh.AREA_2?f.lam=-w-Yn:f.lam=w<0?-w-Np:-w+Np;else{var M,I,P;M=A,T=M*M,T>=1?P=0:P=Math.sqrt(1-T)*Math.sin(w),T+=P*P,T>=1?I=0:I=Math.sqrt(1-T),S.value===Xh.AREA_1?(T=I,I=-P,P=T):S.value===Xh.AREA_2?(I=-I,P=-P):S.value===Xh.AREA_3&&(T=I,I=P,P=-T),this.face===Fp.RIGHT?(T=M,M=-I,I=T):this.face===Fp.BACK?(M=-M,I=-I):this.face===Fp.LEFT&&(T=M,M=I,I=-T),f.phi=Math.acos(-P)-Yn,f.lam=Math.atan2(I,M),this.face===Fp.RIGHT?f.lam=G8(f.lam,-Yn):this.face===Fp.BACK?f.lam=G8(f.lam,-Np):this.face===Fp.LEFT&&(f.lam=G8(f.lam,+Yn))}if(this.es!==0){var D,L,R;D=f.phi<0?1:0,L=Math.tan(f.phi),R=this.b/Math.sqrt(L*L+this.one_minus_f_squared),f.phi=Math.atan(Math.sqrt(this.a*this.a-R*R)/(this.one_minus_f*R)),D&&(f.phi=-f.phi)}return f.lam+=this.long0,o.x=f.lam,o.y=f.phi,o}function Kle(o,f,m,v){var y;return o<xo?(v.value=Xh.AREA_0,y=0):(y=Math.atan2(f,m),Math.abs(y)<=Fc?v.value=Xh.AREA_0:y>Fc&&y<=Yn+Fc?(v.value=Xh.AREA_1,y-=Yn):y>Yn+Fc||y<=-(Yn+Fc)?(v.value=Xh.AREA_2,y=y>=0?y-Np:y+Np):(v.value=Xh.AREA_3,y+=Yn)),y}function G8(o,f){var m=o+f;return m<-Np?m+=eN:m>+Np&&(m-=eN),m}var Fki=["Quadrilateralized Spherical Cube","Quadrilateralized_Spherical_Cube","qsc"],Edt={init:Rki,forward:Oki,inverse:Nki,names:Fki};var jLe=[[1,22199e-21,-715515e-10,31103e-10],[.9986,-482243e-9,-24897e-9,-13309e-10],[.9954,-83103e-8,-448605e-10,-986701e-12],[.99,-.00135364,-59661e-9,36777e-10],[.9822,-.00167442,-449547e-11,-572411e-11],[.973,-.00214868,-903571e-10,18736e-12],[.96,-.00305085,-900761e-10,164917e-11],[.9427,-.00382792,-653386e-10,-26154e-10],[.9216,-.00467746,-10457e-8,481243e-11],[.8962,-.00536223,-323831e-10,-543432e-11],[.8679,-.00609363,-113898e-9,332484e-11],[.835,-.00698325,-640253e-10,934959e-12],[.7986,-.00755338,-500009e-10,935324e-12],[.7597,-.00798324,-35971e-9,-227626e-11],[.7186,-.00851367,-701149e-10,-86303e-10],[.6732,-.00986209,-199569e-9,191974e-10],[.6213,-.010418,883923e-10,624051e-11],[.5722,-.00906601,182e-6,624051e-11],[.5322,-.00677797,275608e-9,624051e-11]],pJ=[[-520417e-23,.0124,121431e-23,-845284e-16],[.062,.0124,-126793e-14,422642e-15],[.124,.0124,507171e-14,-160604e-14],[.186,.0123999,-190189e-13,600152e-14],[.248,.0124002,710039e-13,-224e-10],[.31,.0123992,-264997e-12,835986e-13],[.372,.0124029,988983e-12,-311994e-12],[.434,.0123893,-369093e-11,-435621e-12],[.4958,.0123198,-102252e-10,-345523e-12],[.5571,.0121916,-154081e-10,-582288e-12],[.6176,.0119938,-241424e-10,-525327e-12],[.6769,.011713,-320223e-10,-516405e-12],[.7346,.0113541,-397684e-10,-609052e-12],[.7903,.0109107,-489042e-10,-104739e-11],[.8435,.0103431,-64615e-9,-140374e-14],[.8936,.00969686,-64636e-9,-8547e-9],[.9394,.00840947,-192841e-9,-42106e-10],[.9761,.00616527,-256e-6,-42106e-10],[1,.00328947,-319159e-9,-42106e-10]],Tdt=.8487,Sdt=1.3523,Pdt=RC/5,Bki=1/Pdt,W8=18,Qle=function(o,f){return o[0]+f*(o[1]+f*(o[2]+f*o[3]))},kki=function(o,f){return o[1]+f*(2*o[2]+f*3*o[3])};function Vki(o,f,m,v){for(var y=f;v;--v){var x=o(y);if(y-=x,Math.abs(x)<m)break}return y}function zki(){this.x0=this.x0||0,this.y0=this.y0||0,this.long0=this.long0||0,this.es=0,this.title=this.title||"Robinson"}function Hki(o){var f=To(o.x-this.long0),m=Math.abs(o.y),v=Math.floor(m*Pdt);v<0?v=0:v>=W8&&(v=W8-1),m=RC*(m-Bki*v);var y={x:Qle(jLe[v],m)*f,y:Qle(pJ[v],m)};return o.y<0&&(y.y=-y.y),y.x=y.x*this.a*Tdt+this.x0,y.y=y.y*this.a*Sdt+this.y0,y}function Uki(o){var f={x:(o.x-this.x0)/(this.a*Tdt),y:Math.abs(o.y-this.y0)/(this.a*Sdt)};if(f.y>=1)f.x/=jLe[W8][0],f.y=o.y<0?-Yn:Yn;else{var m=Math.floor(f.y*W8);for(m<0?m=0:m>=W8&&(m=W8-1);;)if(pJ[m][0]>f.y)--m;else if(pJ[m+1][0]<=f.y)++m;else break;var v=pJ[m],y=5*(f.y-v[0])/(pJ[m+1][0]-v[0]);y=Vki(function(x){return(Qle(v,x)-f.y)/kki(v,x)},y,xo,100),f.x/=Qle(jLe[m],y),f.y=(5*m+y)*Op,o.y<0&&(f.y=-f.y)}return f.x=To(f.x+this.long0),f}var Gki=["Robinson","robin"],Idt={init:zki,forward:Hki,inverse:Uki,names:Gki};function Wki(){this.name="geocent"}function jki(o){var f=zle(o,this.es,this.a);return f}function Yki(o){var f=Hle(o,this.es,this.a,this.b);return f}var qki=["Geocentric","geocentric","geocent","Geocent"],Mdt={init:Wki,forward:jki,inverse:Yki,names:qki};var ry={N_POLE:0,S_POLE:1,EQUIT:2,OBLIQ:3},mJ={h:{def:1e5,num:!0},azi:{def:0,num:!0,degrees:!0},tilt:{def:0,num:!0,degrees:!0},long0:{def:0,num:!0},lat0:{def:0,num:!0}};function Xki(){if(Object.keys(mJ).forEach(function(m){if(typeof this[m]>"u")this[m]=mJ[m].def;else{if(mJ[m].num&&isNaN(this[m]))throw new Error("Invalid parameter value, must be numeric "+m+" = "+this[m]);mJ[m].num&&(this[m]=parseFloat(this[m]))}mJ[m].degrees&&(this[m]=this[m]*Op)}.bind(this)),Math.abs(Math.abs(this.lat0)-Yn)<xo?this.mode=this.lat0<0?ry.S_POLE:ry.N_POLE:Math.abs(this.lat0)<xo?this.mode=ry.EQUIT:(this.mode=ry.OBLIQ,this.sinph0=Math.sin(this.lat0),this.cosph0=Math.cos(this.lat0)),this.pn1=this.h/this.a,this.pn1<=0||this.pn1>1e10)throw new Error("Invalid height");this.p=1+this.pn1,this.rp=1/this.p,this.h1=1/this.pn1,this.pfact=(this.p+1)*this.h1,this.es=0;var o=this.tilt,f=this.azi;this.cg=Math.cos(f),this.sg=Math.sin(f),this.cw=Math.cos(o),this.sw=Math.sin(o)}function Jki(o){o.x-=this.long0;var f=Math.sin(o.y),m=Math.cos(o.y),v=Math.cos(o.x),y,x;switch(this.mode){case ry.OBLIQ:x=this.sinph0*f+this.cosph0*m*v;break;case ry.EQUIT:x=m*v;break;case ry.S_POLE:x=-f;break;case ry.N_POLE:x=f;break}switch(x=this.pn1/(this.p-x),y=x*m*Math.sin(o.x),this.mode){case ry.OBLIQ:x*=this.cosph0*f-this.sinph0*m*v;break;case ry.EQUIT:x*=f;break;case ry.N_POLE:x*=-(m*v);break;case ry.S_POLE:x*=m*v;break}var C,w;return C=x*this.cg+y*this.sg,w=1/(C*this.sw*this.h1+this.cw),y=(y*this.cg-x*this.sg)*this.cw*w,x=C*w,o.x=y*this.a,o.y=x*this.a,o}function Kki(o){o.x/=this.a,o.y/=this.a;var f={x:o.x,y:o.y},m,v,y;y=1/(this.pn1-o.y*this.sw),m=this.pn1*o.x*y,v=this.pn1*o.y*this.cw*y,o.x=m*this.cg+v*this.sg,o.y=v*this.cg-m*this.sg;var x=dx(o.x,o.y);if(Math.abs(x)<xo)f.x=0,f.y=o.y;else{var C,w;switch(w=1-x*x*this.pfact,w=(this.p-Math.sqrt(w))/(this.pn1/x+x/this.pn1),C=Math.sqrt(1-w*w),this.mode){case ry.OBLIQ:f.y=Math.asin(C*this.sinph0+o.y*w*this.cosph0/x),o.y=(C-this.sinph0*Math.sin(f.y))*x,o.x*=w*this.cosph0;break;case ry.EQUIT:f.y=Math.asin(o.y*w/x),o.y=C*x,o.x*=w;break;case ry.N_POLE:f.y=Math.asin(C),o.y=-o.y;break;case ry.S_POLE:f.y=-Math.asin(C);break}f.x=Math.atan2(o.x,o.y)}return o.x=f.x+this.long0,o.y=f.y,o}var Qki=["Tilted_Perspective","tpers"],Ddt={init:Xki,forward:Jki,inverse:Kki,names:Qki};function Zki(){if(this.flip_axis=this.sweep==="x"?1:0,this.h=Number(this.h),this.radius_g_1=this.h/this.a,this.radius_g_1<=0||this.radius_g_1>1e10)throw new Error;if(this.radius_g=1+this.radius_g_1,this.C=this.radius_g*this.radius_g-1,this.es!==0){var o=1-this.es,f=1/o;this.radius_p=Math.sqrt(o),this.radius_p2=o,this.radius_p_inv2=f,this.shape="ellipse"}else this.radius_p=1,this.radius_p2=1,this.radius_p_inv2=1,this.shape="sphere";this.title||(this.title="Geostationary Satellite View")}function $ki(o){var f=o.x,m=o.y,v,y,x,C;if(f=f-this.long0,this.shape==="ellipse"){m=Math.atan(this.radius_p2*Math.tan(m));var w=this.radius_p/dx(this.radius_p*Math.cos(m),Math.sin(m));if(y=w*Math.cos(f)*Math.cos(m),x=w*Math.sin(f)*Math.cos(m),C=w*Math.sin(m),(this.radius_g-y)*y-x*x-C*C*this.radius_p_inv2<0)return o.x=Number.NaN,o.y=Number.NaN,o;v=this.radius_g-y,this.flip_axis?(o.x=this.radius_g_1*Math.atan(x/dx(C,v)),o.y=this.radius_g_1*Math.atan(C/v)):(o.x=this.radius_g_1*Math.atan(x/v),o.y=this.radius_g_1*Math.atan(C/dx(x,v)))}else this.shape==="sphere"&&(v=Math.cos(m),y=Math.cos(f)*v,x=Math.sin(f)*v,C=Math.sin(m),v=this.radius_g-y,this.flip_axis?(o.x=this.radius_g_1*Math.atan(x/dx(C,v)),o.y=this.radius_g_1*Math.atan(C/v)):(o.x=this.radius_g_1*Math.atan(x/v),o.y=this.radius_g_1*Math.atan(C/dx(x,v))));return o.x=o.x*this.a,o.y=o.y*this.a,o}function eVi(o){var f=-1,m=0,v=0,y,x,C,w;if(o.x=o.x/this.a,o.y=o.y/this.a,this.shape==="ellipse"){this.flip_axis?(v=Math.tan(o.y/this.radius_g_1),m=Math.tan(o.x/this.radius_g_1)*dx(1,v)):(m=Math.tan(o.x/this.radius_g_1),v=Math.tan(o.y/this.radius_g_1)*dx(1,m));var A=v/this.radius_p;if(y=m*m+A*A+f*f,x=2*this.radius_g*f,C=x*x-4*y*this.C,C<0)return o.x=Number.NaN,o.y=Number.NaN,o;w=(-x-Math.sqrt(C))/(2*y),f=this.radius_g+w*f,m*=w,v*=w,o.x=Math.atan2(m,f),o.y=Math.atan(v*Math.cos(o.x)/f),o.y=Math.atan(this.radius_p_inv2*Math.tan(o.y))}else if(this.shape==="sphere"){if(this.flip_axis?(v=Math.tan(o.y/this.radius_g_1),m=Math.tan(o.x/this.radius_g_1)*Math.sqrt(1+v*v)):(m=Math.tan(o.x/this.radius_g_1),v=Math.tan(o.y/this.radius_g_1)*Math.sqrt(1+m*m)),y=m*m+v*v+f*f,x=2*this.radius_g*f,C=x*x-4*y*this.C,C<0)return o.x=Number.NaN,o.y=Number.NaN,o;w=(-x-Math.sqrt(C))/(2*y),f=this.radius_g+w*f,m*=w,v*=w,o.x=Math.atan2(m,f),o.y=Math.atan(v*Math.cos(o.x)/f)}return o.x=o.x+this.long0,o}var tVi=["Geostationary Satellite View","Geostationary_Satellite","geos"],Ldt={init:Zki,forward:$ki,inverse:eVi,names:tVi};function Rdt(o){o.Proj.projections.add(z8),o.Proj.projections.add(H8),o.Proj.projections.add(tdt),o.Proj.projections.add(idt),o.Proj.projections.add(rdt),o.Proj.projections.add(ndt),o.Proj.projections.add(odt),o.Proj.projections.add(adt),o.Proj.projections.add(sdt),o.Proj.projections.add(ldt),o.Proj.projections.add(udt),o.Proj.projections.add(cdt),o.Proj.projections.add(hdt),o.Proj.projections.add(fdt),o.Proj.projections.add(pdt),o.Proj.projections.add(gdt),o.Proj.projections.add(_dt),o.Proj.projections.add(vdt),o.Proj.projections.add(ydt),o.Proj.projections.add(xdt),o.Proj.projections.add(Cdt),o.Proj.projections.add(bdt),o.Proj.projections.add(wdt),o.Proj.projections.add(Adt),o.Proj.projections.add(Edt),o.Proj.projections.add(Idt),o.Proj.projections.add(Mdt),o.Proj.projections.add(Ddt),o.Proj.projections.add(Ldt)}OC.defaultDatum="WGS84";OC.Proj=tN;OC.WGS84=new OC.Proj("WGS84");OC.Point=Yht;OC.toPoint=Gle;OC.defs=N8;OC.nadgrid=BLe;OC.transform=V4;OC.mgrs=Ght;OC.version="__VERSION__";Rdt(OC);var U4=OC;var YLe={GroundSurface:2576980479,WallSurface:4294967295,RoofSurface:4278190335,TrafficArea:1852731135,AuxiliaryTrafficArea:746717439,Window:5898239,Door:1677721855};var Zle={LOD_FOR_POINTS:.1,LOD_FOR_LINES:.2,LOD_FOR_FACES:.3,LOD_FOR_Model:3},SA={RENDER_WHITE:"white",RENDER_MODEL:"model",RENDER_LINE:"line",RENDER_WHITELINE:"white_line",RENDER_MODELLINE:"model_line"};var qLe=class extends Ia{constructor(f){super(f),this.type="cityPrimitive",this.geometryNormal=Ju.computeNormal(f.geometry),this.verticesNumer=ga.computeNumberOfVertices(f.geometry),this.vertices=f.vertices,this.vertexIds=f.vertexIds,this.worldBoundingSphere=f.worldBoundingSphere,this.lod=f.lod,this.rtcCenter=f.rtcCenter,this.show=iVi(f.show,!0);let m=H.fromDegrees(this.rtcCenter[0],this.rtcCenter[1],this.rtcCenter[2]);this.modelMatrix=tn.eastNorthUpToFixedFrame(m),this.renderType=f.renderType,this.lineColor=Z(f.lineColor,Re.WHITE),this.whiteColor=Re.WHITE,this._viewer=f.earthCtrl.coreMap,this._texture=void 0,this.imageData=f.imageData,this.textureSize=f.textureSize,this.textureUVs=f.textureUVs,this.attributes=f.attributes,this._surfaceColor=Re.fromRgba(f.surfaceColor),this.pickId=null,this.command=null,this.createTexture(this.imageData)}createCommand(f,m){let v=f.context,y={position:0,st:1},x=Du.fromGeometry({context:v,geometry:m,attributeLocations:y,bufferUsage:gn.STATIC_DRAW}),C=this.pickId;C||(C=v.createPickId({primitive:this,id:this.attributes}),this.pickId=C);let w="czm_pickColor",A=` precision highp float; in vec3 position; in vec2 st; out vec2 v_st; void main() { v_st = st; gl_Position = czm_projection * czm_modelView * vec4(position, 1.0); } `,E=` in vec2 v_st; uniform sampler2D image; uniform vec4 color; uniform vec4 surfaceColor; uniform int useTextureColor; uniform vec4 ${w}; void main() { czm_materialInput materialInput; materialInput.st = v_st; vec2 st = materialInput.st; czm_material material = czm_getDefaultMaterial(materialInput); material.specular = 1.0; material.shininess = 0.0; material.alpha = 0.3; vec4 colorImage = texture(image,v_st); if(useTextureColor != 0){ material.diffuse = colorImage.rgb; }else { material.diffuse = color.rgb; } out_FragColor = vec4(material.diffuse, material.alpha); } `,T={color:()=>this.renderType===SA.RENDER_LINE?this.lineColor:this.whiteColor,image:()=>N(this._texture)?this._texture:this._viewer.scene.context.defaultTexture,surfaceColor:()=>this._surfaceColor,[w]:()=>this.pickId.color?this.pickId.color:Re.RED,useTextureColor:()=>{let P=1;return this.renderType===SA.RENDER_MODEL||this.renderType===SA.RENDER_MODELLINE?P=1:P=0,P}},S=Rs.fromCache({context:v,vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:y}),M=Mn.fromCache({depthTest:{enabled:!0}}),I=null;return this.renderType===SA.RENDER_WHITE||this.renderType===SA.RENDER_MODEL?I=Fn.TRIANGLES:I=Fn.LINE_LOOP,this.command=new Jn({receiveShadows:!1,castShadows:!0,boundingVolume:this.worldBoundingSphere,modelMatrix:this.modelMatrix,vertexArray:x,shaderProgram:S,uniformMap:T,renderState:M,primitiveType:I,pass:vr.OPAQUE,pickId:w}),this.command}createTexture(f){let m=this._viewer.scene.context,v=new _o({context:m,width:this.textureSize.width,height:this.textureSize.height});!f.length||(f.forEach(y=>{v.copyFrom({source:y.image,xOffset:y.xOffset,yOffset:y.yOffset})}),v.generateMipmap(),this._texture=v)}destroy(){let f=this.command;if(f){let m=f.vertexArray,v=f.shaderProgram;m.isDestroyed()||m.destroy(),(!v.isDestroyed||!v.isDestroyed())&&v.destroy(),f.isDestroyed=function(){return!0},f.uniformMap=void 0,f.renderState=Mn.removeFromCache(f.renderState)}this._texture&&!this._texture.isDestroyed()&&this._texture.destroy(),this.pickId&&(this.pickId.destroy(),this.pickId=null),this.geometryNormal=void 0,this.worldBoundingSphere=void 0,this.modelMatrix=void 0,this._color=void 0,this.vertices=void 0,this.vertexIds=void 0,this.imageData=void 0,this.textureSize=void 0,this.textureUVs=void 0,this.attributes=void 0,this._surfaceColor=void 0,this.command=void 0,this.pickId=void 0}update(f){!this.show||(this.command||this.createCommand(f,this.geometryNormal),f.commandList.push(this.command))}setRenderType(f){this.renderType=f,this.command=null}};function iVi(o,f){return o??f}var Odt=qLe;/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: Apache-2.0 */var Fdt=Symbol("Comlink.proxy"),rVi=Symbol("Comlink.endpoint"),nVi=Symbol("Comlink.releaseProxy"),XLe=Symbol("Comlink.finalizer"),eue=Symbol("Comlink.thrown"),Bdt=o=>typeof o=="object"&&o!==null||typeof o=="function",oVi={canHandle:o=>Bdt(o)&&o[Fdt],serialize(o){let{port1:f,port2:m}=new MessageChannel;return Vdt(o,f),[m,[m]]},deserialize(o){return o.start(),KLe(o)}},aVi={canHandle:o=>Bdt(o)&&eue in o,serialize({value:o}){let f;return o instanceof Error?f={isError:!0,value:{message:o.message,name:o.name,stack:o.stack}}:f={isError:!1,value:o},[f,[]]},deserialize(o){throw o.isError?Object.assign(new Error(o.value.message),o.value):o.value}},kdt=new Map([["proxy",oVi],["throw",aVi]]);function sVi(o,f){for(let m of o)if(f===m||m==="*"||m instanceof RegExp&&m.test(f))return!0;return!1}function Vdt(o,f=globalThis,m=["*"]){f.addEventListener("message",function v(y){if(!y||!y.data)return;if(!sVi(m,y.origin)){console.warn(`Invalid origin '${y.origin}' for comlink proxy`);return}let{id:x,type:C,path:w}=Object.assign({path:[]},y.data),A=(y.data.argumentList||[]).map(G4),E;try{let T=w.slice(0,-1).reduce((M,I)=>M[I],o),S=w.reduce((M,I)=>M[I],o);switch(C){case"GET":E=S;break;case"SET":T[w.slice(-1)[0]]=G4(y.data.value),E=!0;break;case"APPLY":E=S.apply(T,A);break;case"CONSTRUCT":{let M=new S(...A);E=QLe(M)}break;case"ENDPOINT":{let{port1:M,port2:I}=new MessageChannel;Vdt(o,I),E=dVi(M,[M])}break;case"RELEASE":E=void 0;break;default:return}}catch(T){E={value:T,[eue]:0}}Promise.resolve(E).catch(T=>({value:T,[eue]:0})).then(T=>{let[S,M]=rue(T);f.postMessage(Object.assign(Object.assign({},S),{id:x}),M),C==="RELEASE"&&(f.removeEventListener("message",v),zdt(f),XLe in o&&typeof o[XLe]=="function"&&o[XLe]())}).catch(T=>{let[S,M]=rue({value:new TypeError("Unserializable return value"),[eue]:0});f.postMessage(Object.assign(Object.assign({},S),{id:x}),M)})}),f.start&&f.start()}function lVi(o){return o.constructor.name==="MessagePort"}function zdt(o){lVi(o)&&o.close()}function KLe(o,f){return JLe(o,[],f)}function $le(o){if(o)throw new Error("Proxy has been released and is not useable")}function Hdt(o){return j8(o,{type:"RELEASE"}).then(()=>{zdt(o)})}var tue=new WeakMap,iue="FinalizationRegistry"in globalThis&&new FinalizationRegistry(o=>{let f=(tue.get(o)||0)-1;tue.set(o,f),f===0&&Hdt(o)});function uVi(o,f){let m=(tue.get(f)||0)+1;tue.set(f,m),iue&&iue.register(o,f,o)}function cVi(o){iue&&iue.unregister(o)}function JLe(o,f=[],m=function(){}){let v=!1,y=new Proxy(m,{get(x,C){if($le(v),C===nVi)return()=>{cVi(y),Hdt(o),v=!0};if(C==="then"){if(f.length===0)return{then:()=>y};let w=j8(o,{type:"GET",path:f.map(A=>A.toString())}).then(G4);return w.then.bind(w)}return JLe(o,[...f,C])},set(x,C,w){$le(v);let[A,E]=rue(w);return j8(o,{type:"SET",path:[...f,C].map(T=>T.toString()),value:A},E).then(G4)},apply(x,C,w){$le(v);let A=f[f.length-1];if(A===rVi)return j8(o,{type:"ENDPOINT"}).then(G4);if(A==="bind")return JLe(o,f.slice(0,-1));let[E,T]=Ndt(w);return j8(o,{type:"APPLY",path:f.map(S=>S.toString()),argumentList:E},T).then(G4)},construct(x,C){$le(v);let[w,A]=Ndt(C);return j8(o,{type:"CONSTRUCT",path:f.map(E=>E.toString()),argumentList:w},A).then(G4)}});return uVi(y,o),y}function hVi(o){return Array.prototype.concat.apply([],o)}function Ndt(o){let f=o.map(rue);return[f.map(m=>m[0]),hVi(f.map(m=>m[1]))]}var Udt=new WeakMap;function dVi(o,f){return Udt.set(o,f),o}function QLe(o){return Object.assign(o,{[Fdt]:!0})}function rue(o){for(let[f,m]of kdt)if(m.canHandle(o)){let[v,y]=m.serialize(o);return[{type:"HANDLER",name:f,value:v},y]}return[{type:"RAW",value:o},Udt.get(o)||[]]}function G4(o){switch(o.type){case"HANDLER":return kdt.get(o.name).deserialize(o.value);case"RAW":return o.value}}function j8(o,f,m){return new Promise(v=>{let y=fVi();o.addEventListener("message",function x(C){!C.data||!C.data.id||C.data.id!==y||(o.removeEventListener("message",x),v(C.data))}),o.start&&o.start(),o.postMessage(Object.assign({id:y},f),m)})}function fVi(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}U4.defs([["EPSG:4549","+proj=tmerc +lat_0=0 +lon_0=120 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"]]);U4.defs([["EPSG:4545","+proj=tmerc +lat_0=0 +lon_0=108 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs"]]);function gc(o,f){this.earthCtrl=o,this._viewer=o.coreMap,this.url=f.url,this.primitives=new w_,this.success=f.success?f.success:null,this.color=f.color?f.color:"#485f8f",this.lineColor=f.lineColor?f.lineColor:"#ffffff",this.renderType=f.renderType?f.renderType:SA.RENDER_MODEL,this.lodList=[],this.num=0,this.coordSystem="",this.previousOutlinePrimitive=null,this._viewer.scene.primitives.add(this.primitives)}gc.prototype.loadCityJson=async function(){let o=this.url,f=`${window.SmartEarthRootUrl}/Workers/worker/ParserWorker.js`,m=new Worker(f),v=KLe(m),y=QLe(x=>this.getWorkerMessage(x));await v.processData(o,y),this.edgedStage=D0.createEdgeDetectionStage({width:1}),this.edgedStage.uniforms.color=Re.fromCssColorString("#ff0"),this.edgedStage.uniforms.length=.01,this.edgedStage.selected=[],this._viewer.postProcessStages.add(D0.createSilhouetteStage([this.edgedStage])),this.initClickEvent()};gc.prototype.getWorkerMessage=async function(o){let{type:f,rtcCenter:m,newVertices:v,newFaceIds:y,imgList:x,imageIds:C,textures:w,attributes:A,surfaceType:E,modelCenter:T,metaData:S,lod:M}=o;f==="parse"?await this.parseModel(m,v,y,x,C,w,A,E,S,M):f==="done"?this.handleModelDone(T):f==="success"&&this.success&&typeof this.success=="function"&&this.success(this.primitives)};gc.prototype.parseModel=async function(o,f,m,v,y,x,C,w,A,E){let T=A.referenceSystem.replace(/.*EPSG::(\d+)/,"EPSG:$1");if(this.coordSystem=T,E<1?this.renderLessDetialModel(f,E,C,T):await this.renderMoreDetialModel(o,f,m,v,y,x,C,w,T,E),!~this.lodList.findIndex(M=>M.label===E)){let M=zl(),I=E<1;this.lodList.push({id:M,label:E,checked:I})}};gc.prototype.getLodList=function(){return this.lodList};gc.prototype.handleModelDone=function(o){o&&this.num===0&&this.flyToCity(o),this.num++};gc.prototype.getDetails=function(){let o=this.primitives;if(!o._primitives.length)return;let f=o._primitives.filter(E=>E.lod>1);if(!f.length)return;let m=f[0]._primitives,v=0,y=0,x=0;for(let E=0;E<m.length;E++){let T=m[E];v+=this.getGeometryMemory(T.verticesNumer,T.vertexIds,T.textureUVs),(this.renderType===SA.RENDER_MODELLINE||this.renderType===SA.RENDER_MODEL)&&(y+=this.getTextureMemory(T.imageData)),x+=this.getTriangleNumber(T.vertexIds)}let C=this.formatMemoryString(v),w=this.formatMemoryString(y),A=this.coordSystem;return x=`${x}`,{coordSystem:A,geometryMemory:C,textureMemory:w,triangleNumber:x}};gc.prototype.getTriangleNumber=function(o){return o.length/3};gc.prototype.getGeometryMemory=function(o,f,m){let v=o*3*4,y=f.length*2,x=m.length*2*4;return v+y+x};gc.prototype.getTextureMemory=function(o){let f=0;for(let m=0;m<o.length;m++){let v=o[m];f+=v.width*v.height*4}return f};gc.prototype.formatMemoryString=function(o){let f=o/1048576;if(f<1){let v=o/1024;return`${Math.round(v)}KB`}return f>=1024?`${(f/1024).toFixed(2)}GB`:`${Math.round(f)}MB`};gc.prototype.renderLessDetialModel=function(o,f,m,v){f===Zle.LOD_FOR_FACES?this.createPolygonPrimitive(o,f,v,m):f===Zle.LOD_FOR_LINES?this.createPolylinePrimitive(o,f,v,m):f===Zle.LOD_FOR_POINTS&&this.createPointPrimitive(o,f,v,m)};gc.prototype.renderMoreDetialModel=async function(o,f,m,v,y,x,C,w,A,E){let{imageSizes:T,imageData:S}=await this.calculateImageData(y,v),M=this.calculateTextureSize(T,3);this.calculateImageOffset(T,S);let I=this.updateTextureUvs(x,M,S);this.createCityPrimitive(m,f,I,S,M,C,w,o,A,E)};gc.prototype.createPointPrimitive=function(o,f,m,v){let y=Re.fromCssColorString(this.color),x=this.getPointPrimitiveCollection(f);o.forEach(C=>{let w=U4(m,"EPSG:4326",[C[0],C[1],C[2]]);x.add({position:H.fromDegrees(w[0],w[1]),color:y,pixelSize:8,id:v,disableDepthTestDistance:Number.POSITIVE_INFINITY})})};gc.prototype.createPolylinePrimitive=function(o,f,m,v){let y=Re.fromCssColorString(this.color),x=[];o.forEach(S=>{let M=U4(m,"EPSG:4326",[S[0],S[1],S[2]]),I=H.fromDegrees(M[0],M[1],M[2]);x.push(I)});let C=new b_({positions:x,width:4}),w=b_.createGeometry(C),A=new co({geometry:w,id:v,attributes:{color:ea.fromColor(y)}}),E=new Ia({geometryInstances:[A],asynchronous:!1,appearance:new tm({translucent:!1,flat:!0,renderState:{depthTest:{enabled:!1}}}),show:!0});this.getPrimitiveCollection(f).add(E)};gc.prototype.createPolygonPrimitive=function(o,f,m,v){let y=Re.fromCssColorString(this.color),x=[];o.forEach(I=>{let P=U4(m,"EPSG:4326",[I[0],I[1],I[2]]);x.push(P[0],P[1])});let C=new Ec({polygonHierarchy:new ho(H.fromDegreesArray(x))}),w=Ec.createGeometry(C),A={lod:f,...v,vertices:x},E=new co({geometry:w,attributes:{color:ea.fromColor(y)},id:A}),T=new Ia({geometryInstances:[E],asynchronous:!1,appearance:new ms({translucent:!1,flat:!0,renderState:{depthTest:{enabled:!1}}}),show:!0}),S=zl();T.id=S,T.lod=f,T.vertices=x,this.getPrimitiveCollection(f).add(T)};gc.prototype.createOutlinePrimitive=function(o,f,m){let v=Re.fromCssColorString("#ff0"),y=new co({geometry:new b_({positions:H.fromDegreesArray(o),width:m}),attributes:{color:ea.fromColor(v)}}),x=new Ia({geometryInstances:[y],appearance:new tm({translucent:!1})});return x.type="outline",x.id=f,x};gc.prototype.getPrimitiveCollection=function(o){let f=null,m=this.primitives._primitives.findIndex(v=>v.lod===o);return~m?f=this.primitives._primitives[m]:(f=new w_,f.lod=o,this.primitives.add(f)),f};gc.prototype.getPointPrimitiveCollection=function(o){let f=null,m=this.primitives._primitives.findIndex(v=>v.lod===o);return~m?f=this.primitives._primitives[m]:(f=new _B,f.lod=o,this.primitives.add(f)),f};gc.prototype.setSingeLodVisible=function(o,f){let m=this.primitives._primitives.findIndex(v=>v.lod===o);if(~m){let y=this.primitives._primitives[m]._primitives;for(let x=0;x<y.length;++x){let C=y[x];C.show=f}}else console.error("lod\u4E0D\u5B58\u5728")};gc.prototype.setAllLodVisible=function(o){if(this.primitives&&this.primitives._primitives.length){let f=this.primitives._primitives;for(let m=0;m<f.length;m++){let v=f[m]._primitives;for(let y=0;y<v.length;y++){let x=v[y];x.show=o}}}};gc.prototype.setRenderType=function(o){let f=this.primitives._primitives.findIndex(v=>v.lod>1);if(!~f)return;let m=this.primitives._primitives[f];m._primitives.length&&m._primitives.forEach(v=>{v.setRenderType(o)})};gc.prototype.createCityPrimitive=function(o,f,m,v,y,x,C,w,A,E){let T=YLe[Object.keys(YLe)[C]],S=H.fromDegrees(w[0],w[1],w[2]),M=tn.eastNorthUpToFixedFrame(S),I=Ee.inverse(M,new Ee),P=this.createCityGeometry(A,f,o,m,I),D=this.calculateWorldBoundingSphere(P,M),L=Re.fromCssColorString(this.lineColor),R={earthCtrl:this.earthCtrl,geometry:P,vertices:f,vertexIds:o,imageData:v,textureSize:y,textureUVs:m,attributes:x,rtcCenter:w,surfaceColor:T,lineColor:L,renderType:this.renderType,worldBoundingSphere:D,lod:E,show:!1},O=new Odt(R);this.getPrimitiveCollection(E).add(O)};gc.prototype.createCityGeometry=function(o,f,m,v,y){let x=[];f.forEach(T=>{let S=U4(o,"EPSG:4326",[T[0],T[1],T[2]]),M=H.fromDegrees(S[0],S[1],S[2]);this.worldToLocal(M,M,y),x.push(M.x,M.y,M.z)});let C=new Float32Array(x),w=new Uint16Array(m),A=null;return this.renderType===SA.RENDER_WHITE||this.renderType===SA.RENDER_MODEL?A=Fn.TRIANGLES:A=Fn.LINE_LOOP,new ga({attributes:{position:new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:3,values:C}),st:new en({componentDatatype:Rt.FLOAT,componentsPerAttribute:2,values:v})},indices:w,primitiveType:A,boundingSphere:Pi.fromVertices(C)})};gc.prototype.calculateWorldBoundingSphere=function(o,f){let m=[];for(let v=0;v<o.attributes.position.values.length;v+=3){let y=new H(o.attributes.position.values[v],o.attributes.position.values[v+1],o.attributes.position.values[v+2]),x=Ee.multiplyByPoint(f,y,new H);m.push(x.x,x.y,x.z)}return Pi.fromVertices(m)};gc.prototype.worldToLocal=function(o,f,m){return N(f)||(f=new Ee),Ee.multiplyByPoint(m,o,f),f};gc.prototype.calculateImageData=async function(o,f){let m=[],v=[];for(let y=0;y<o.length;y++){let x=o[y],C=f[x],w=await this.getImage(C,o);m.push({width:w.width,height:w.height}),v.push({id:x,image:w,buffer:C,width:w.width,height:w.height,xOffset:0,yOffset:0})}return{imageSizes:m,imageData:v}};gc.prototype.updateTextureUvs=function(o,f,m){let v=o.data,y=[],{width:x,height:C}=f;for(let w=0;w<v.length;w++){let A=v[w],E=A.index,T=A.uvs,S=m.findIndex(O=>O.id===E);if(!~S)continue;let M=m[S],{width:I,height:P,xOffset:D,yOffset:L}=M,R=[T[0]*(I/x)+D/x,T[1]*(P/C)+L/C];y.push(R[0],R[1])}return y};gc.prototype.calculateImageOffset=function(o,f){let m=0,v=0,y=0,x=0;o.forEach((C,w)=>{f[w].xOffset=m,f[w].yOffset=v,y+=C.width,m+=C.width,x=Math.max(x,C.height),((w+1)%3===0||w===o.length-1)&&(v+=x,m=0,y=0,x=0)})};gc.prototype.calculateTextureSize=function(o,f){let m=0,v=0,y=0,x=0;return o.forEach((C,w)=>{y+=C.width,x=Math.max(x,C.height),((w+1)%f===0||w===o.length-1)&&(m=Math.max(m,y),v+=x,y=0,x=0)}),{width:m,height:v}};gc.prototype.getImage=async function(o){return new Promise((f,m)=>{let v=new Blob([o]),y=new Image;y.onload=()=>{f(y)},y.onerror=m;let x=URL.createObjectURL(v);y.src=x})};gc.prototype.initClickEvent=function(){this.earthCtrl.coreMap.screenSpaceEventHandler.setInputAction(o=>{let f=this.earthCtrl.coreMap.scene.pick(o.position);if(this.earthCtrl.coreMap.selectedEntity=void 0,this.edgedStage.selected=[],f&&f.primitive&&f.primitive.type==="cityPrimitive"&&(this.earthCtrl.coreMap.selectedEntity=new Wh({name:`${this.earthCtrl.language.SEM_MODEL_PICK_RESULT}`,description:f.description}),this.edgedStage.selected=[f.primitive]),f&&f.primitive){let m=f.id.vertices,v=f.id.lod,y=f.primitive.id;if(!m.length)return;let x=this.getPrimitiveCollection(v);this.previousOutlinePrimitive&&(x.remove(this.previousOutlinePrimitive),this.previousOutlinePrimitive=null);let C=this.createOutlinePrimitive(m,y,3);x.add(C),this.previousOutlinePrimitive=C,console.log("pick",f)}},Ei.LEFT_CLICK)};gc.prototype.setModelHighLight=function(o){let f=o.slice();if(!!f.length)if(f[0].lod>1)this.edgedStage.selected=f;else for(let m=0;m<f.length;m++){let v=f[m],y=this.getPrimitiveCollection(v.lod),x=this.createOutlinePrimitive(v.vertices,v.id,3);y.add(x)}};gc.prototype.clearModelHighlight=function(o,f){if(!o&&!f){let m=this.primitives._primitives;for(let v=0;v<m.length;v++){let y=m[v];if(y._primitives.length){let x=y._primitives.slice();this.cancelHighlight(x)}}}else if(o&&!f){let v=this.getPrimitiveCollection(o)._primitives.slice();this.cancelHighlight(v)}else if(o&&f&&f.length){let m=f.slice();this.cancelHighlight(m)}};gc.prototype.cancelHighlight=function(o){let f=this.edgedStage.selected.slice();for(let m=0;m<o.length;m++){let v=o[m];if(v.lod>1){let y=f.indexOf(v);~y&&f.splice(y,1)}else{let y=this.getPrimitiveCollection(v.lod),x=y._primitives,C=x.findIndex(w=>w.id===v.id&&w.type==="outline");~C&&y.remove(x[C])}}this.edgedStage.selected=f};gc.prototype.removeFromMap=function(){this.primitives&&this.primitives._primitives.length>0&&this.primitives.removeAll(),this.primitives=null,this.success=null};gc.prototype.flyToCity=function(o){this.earthCtrl.camera.flyTo(o[0],o[1],80)};var Gdt=gc;function iN(o){return iN=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},iN(o)}function ZLe(o,f){if(iN(o)!=="object"||o===null)return o;var m=o[Symbol.toPrimitive];if(m!==void 0){var v=m.call(o,f||"default");if(iN(v)!=="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(o)}function $Le(o){var f=ZLe(o,"string");return iN(f)==="symbol"?f:String(f)}function ta(o,f,m){return f=$Le(f),f in o?Object.defineProperty(o,f,{value:m,enumerable:!0,configurable:!0,writable:!0}):o[f]=m,o}function W4(o,f={}){let{start:m=0,end:v=o.length}=f,y=f.size||2,x=0;for(let C=m,w=v-y;C<v;C+=y)x+=(o[C]-o[w])*(o[C+1]+o[w+1]),w=C;return x/2}function iRe(o,f,m=2,v){let y=f&&f.length,x=y?f[0]*m:o.length,C=jdt(o,0,x,m,!0,v&&v[0]),w=[];if(!C||C.next===C.prev)return w;let A,E,T,S,M,I,P;if(y&&(C=CVi(o,f,C,m,v)),o.length>80*m){S=E=o[0],M=T=o[1];for(let D=m;D<x;D+=m)I=o[D],P=o[D+1],I<S&&(S=I),P<M&&(M=P),I>E&&(E=I),P>T&&(T=P);A=Math.max(E-S,T-M),A=A!==0?1/A:0}return gJ(C,w,m,S,M,A),w}function jdt(o,f,m,v,y,x){let C,w;if(x===void 0&&(x=W4(o,{start:f,end:m,size:v})),y===x<0)for(C=f;C<m;C+=v)w=Wdt(C,o[C],o[C+1],w);else for(C=m-v;C>=f;C-=v)w=Wdt(C,o[C],o[C+1],w);return w&&aue(w,w.next)&&(vJ(w),w=w.next),w}function rN(o,f){if(!o)return o;f||(f=o);let m=o,v;do if(v=!1,!m.steiner&&(aue(m,m.next)||Bp(m.prev,m,m.next)===0)){if(vJ(m),m=f=m.prev,m===m.next)break;v=!0}else m=m.next;while(v||m!==f);return f}function gJ(o,f,m,v,y,x,C){if(!o)return;!C&&x&&TVi(o,v,y,x);let w=o,A,E;for(;o.prev!==o.next;){if(A=o.prev,E=o.next,x?vVi(o,v,y,x):_Vi(o)){f.push(A.i/m),f.push(o.i/m),f.push(E.i/m),vJ(o),o=E.next,w=E.next;continue}if(o=E,o===w){C?C===1?(o=yVi(rN(o),f,m),gJ(o,f,m,v,y,x,2)):C===2&&xVi(o,f,m,v,y,x):gJ(rN(o),f,m,v,y,x,1);break}}}function _Vi(o){let f=o.prev,m=o,v=o.next;if(Bp(f,m,v)>=0)return!1;let y=o.next.next;for(;y!==o.prev;){if(Y8(f.x,f.y,m.x,m.y,v.x,v.y,y.x,y.y)&&Bp(y.prev,y,y.next)>=0)return!1;y=y.next}return!0}function vVi(o,f,m,v){let y=o.prev,x=o,C=o.next;if(Bp(y,x,C)>=0)return!1;let w=y.x<x.x?y.x<C.x?y.x:C.x:x.x<C.x?x.x:C.x,A=y.y<x.y?y.y<C.y?y.y:C.y:x.y<C.y?x.y:C.y,E=y.x>x.x?y.x>C.x?y.x:C.x:x.x>C.x?x.x:C.x,T=y.y>x.y?y.y>C.y?y.y:C.y:x.y>C.y?x.y:C.y,S=eRe(w,A,f,m,v),M=eRe(E,T,f,m,v),I=o.prevZ,P=o.nextZ;for(;I&&I.z>=S&&P&&P.z<=M;){if(I!==o.prev&&I!==o.next&&Y8(y.x,y.y,x.x,x.y,C.x,C.y,I.x,I.y)&&Bp(I.prev,I,I.next)>=0||(I=I.prevZ,P!==o.prev&&P!==o.next&&Y8(y.x,y.y,x.x,x.y,C.x,C.y,P.x,P.y)&&Bp(P.prev,P,P.next)>=0))return!1;P=P.nextZ}for(;I&&I.z>=S;){if(I!==o.prev&&I!==o.next&&Y8(y.x,y.y,x.x,x.y,C.x,C.y,I.x,I.y)&&Bp(I.prev,I,I.next)>=0)return!1;I=I.prevZ}for(;P&&P.z<=M;){if(P!==o.prev&&P!==o.next&&Y8(y.x,y.y,x.x,x.y,C.x,C.y,P.x,P.y)&&Bp(P.prev,P,P.next)>=0)return!1;P=P.nextZ}return!0}function yVi(o,f,m){let v=o;do{let y=v.prev,x=v.next.next;!aue(y,x)&&Ydt(y,v,v.next,x)&&_J(y,x)&&_J(x,y)&&(f.push(y.i/m),f.push(v.i/m),f.push(x.i/m),vJ(v),vJ(v.next),v=o=x),v=v.next}while(v!==o);return rN(v)}function xVi(o,f,m,v,y,x){let C=o;do{let w=C.next.next;for(;w!==C.prev;){if(C.i!==w.i&&IVi(C,w)){let A=qdt(C,w);C=rN(C,C.next),A=rN(A,A.next),gJ(C,f,m,v,y,x),gJ(A,f,m,v,y,x);return}w=w.next}C=C.next}while(C!==o)}function CVi(o,f,m,v,y){let x=[],C,w,A,E,T;for(C=0,w=f.length;C<w;C++)A=f[C]*v,E=C<w-1?f[C+1]*v:o.length,T=jdt(o,A,E,v,!1,y&&y[C+1]),T===T.next&&(T.steiner=!0),x.push(PVi(T));for(x.sort(bVi),C=0;C<x.length;C++)wVi(x[C],m),m=rN(m,m.next);return m}function bVi(o,f){return o.x-f.x}function wVi(o,f){if(f=AVi(o,f),f){let m=qdt(f,o);rN(f,f.next),rN(m,m.next)}}function AVi(o,f){let m=f,v=o.x,y=o.y,x=-1/0,C;do{if(y<=m.y&&y>=m.next.y&&m.next.y!==m.y){let M=m.x+(y-m.y)*(m.next.x-m.x)/(m.next.y-m.y);if(M<=v&&M>x){if(x=M,M===v){if(y===m.y)return m;if(y===m.next.y)return m.next}C=m.x<m.next.x?m:m.next}}m=m.next}while(m!==f);if(!C)return null;if(v===x)return C;let w=C,A=C.x,E=C.y,T=1/0,S;m=C;do v>=m.x&&m.x>=A&&v!==m.x&&Y8(y<E?v:x,y,A,E,y<E?x:v,y,m.x,m.y)&&(S=Math.abs(y-m.y)/(v-m.x),_J(m,o)&&(S<T||S===T&&(m.x>C.x||m.x===C.x&&EVi(C,m)))&&(C=m,T=S)),m=m.next;while(m!==w);return C}function EVi(o,f){return Bp(o.prev,o,f.prev)<0&&Bp(f.next,o,o.next)<0}function TVi(o,f,m,v){let y=o;do y.z===null&&(y.z=eRe(y.x,y.y,f,m,v)),y.prevZ=y.prev,y.nextZ=y.next,y=y.next;while(y!==o);y.prevZ.nextZ=null,y.prevZ=null,SVi(y)}function SVi(o){let f,m,v=1,y,x,C,w,A,E;do{for(x=o,o=null,E=null,y=0;x;){for(y++,w=x,C=0,m=0;m<v&&(C++,w=w.nextZ,!!w);m++);for(A=v;C>0||A>0&&w;)C!==0&&(A===0||!w||x.z<=w.z)?(f=x,x=x.nextZ,C--):(f=w,w=w.nextZ,A--),E?E.nextZ=f:o=f,f.prevZ=E,E=f;x=w}E.nextZ=null,v*=2}while(y>1);return o}function eRe(o,f,m,v,y){return o=32767*(o-m)*y,f=32767*(f-v)*y,o=(o|o<<8)&16711935,o=(o|o<<4)&252645135,o=(o|o<<2)&858993459,o=(o|o<<1)&1431655765,f=(f|f<<8)&16711935,f=(f|f<<4)&252645135,f=(f|f<<2)&858993459,f=(f|f<<1)&1431655765,o|f<<1}function PVi(o){let f=o,m=o;do(f.x<m.x||f.x===m.x&&f.y<m.y)&&(m=f),f=f.next;while(f!==o);return m}function Y8(o,f,m,v,y,x,C,w){return(y-C)*(f-w)-(o-C)*(x-w)>=0&&(o-C)*(v-w)-(m-C)*(f-w)>=0&&(m-C)*(x-w)-(y-C)*(v-w)>=0}function IVi(o,f){return o.next.i!==f.i&&o.prev.i!==f.i&&!MVi(o,f)&&(_J(o,f)&&_J(f,o)&&DVi(o,f)&&(Bp(o.prev,o,f.prev)||Bp(o,f.prev,f))||aue(o,f)&&Bp(o.prev,o,o.next)>0&&Bp(f.prev,f,f.next)>0)}function Bp(o,f,m){return(f.y-o.y)*(m.x-f.x)-(f.x-o.x)*(m.y-f.y)}function aue(o,f){return o.x===f.x&&o.y===f.y}function Ydt(o,f,m,v){let y=oue(Bp(o,f,m)),x=oue(Bp(o,f,v)),C=oue(Bp(m,v,o)),w=oue(Bp(m,v,f));return!!(y!==x&&C!==w||y===0&&nue(o,m,f)||x===0&&nue(o,v,f)||C===0&&nue(m,o,v)||w===0&&nue(m,f,v))}function nue(o,f,m){return f.x<=Math.max(o.x,m.x)&&f.x>=Math.min(o.x,m.x)&&f.y<=Math.max(o.y,m.y)&&f.y>=Math.min(o.y,m.y)}function oue(o){return o>0?1:o<0?-1:0}function MVi(o,f){let m=o;do{if(m.i!==o.i&&m.next.i!==o.i&&m.i!==f.i&&m.next.i!==f.i&&Ydt(m,m.next,o,f))return!0;m=m.next}while(m!==o);return!1}function _J(o,f){return Bp(o.prev,o,o.next)<0?Bp(o,f,o.next)>=0&&Bp(o,o.prev,f)>=0:Bp(o,f,o.prev)<0||Bp(o,o.next,f)<0}function DVi(o,f){let m=o,v=!1,y=(o.x+f.x)/2,x=(o.y+f.y)/2;do m.y>x!=m.next.y>x&&m.next.y!==m.y&&y<(m.next.x-m.x)*(x-m.y)/(m.next.y-m.y)+m.x&&(v=!v),m=m.next;while(m!==o);return v}function qdt(o,f){let m=new tRe(o.i,o.x,o.y),v=new tRe(f.i,f.x,f.y),y=o.next,x=f.prev;return o.next=f,f.prev=o,m.next=y,y.prev=m,v.next=m,m.prev=v,x.next=v,v.prev=x,v}function Wdt(o,f,m,v){let y=new tRe(o,f,m);return v?(y.next=v.next,y.prev=v,v.next.prev=y,v.next=y):(y.prev=y,y.next=y),y}function vJ(o){o.next.prev=o.prev,o.prev.next=o.next,o.prevZ&&(o.prevZ.nextZ=o.nextZ),o.nextZ&&(o.nextZ.prevZ=o.prevZ)}function tRe(o,f,m){this.i=o,this.x=f,this.y=m,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function oRe(o,f,m){let v=FVi(o),y=Object.keys(v).filter(x=>v[x]!==Array);return BVi(o,{propArrayTypes:v,...f},{numericPropKeys:m&&m.numericPropKeys||y,PositionDataType:m?m.PositionDataType:Float32Array,triangulate:m?m.triangulate:!0})}function FVi(o){let f={};for(let m of o)if(m.properties)for(let v in m.properties){let y=m.properties[v];f[v]=GVi(y,f[v])}return f}function BVi(o,f,m){let{pointPositionsCount:v,pointFeaturesCount:y,linePositionsCount:x,linePathsCount:C,lineFeaturesCount:w,polygonPositionsCount:A,polygonObjectsCount:E,polygonRingsCount:T,polygonFeaturesCount:S,propArrayTypes:M,coordLength:I}=f,{numericPropKeys:P=[],PositionDataType:D=Float32Array,triangulate:L=!0}=m,R=o[0]&&"id"in o[0],O=o.length>65535?Uint32Array:Uint16Array,F={type:"Point",positions:new D(v*I),globalFeatureIds:new O(v),featureIds:y>65535?new Uint32Array(v):new Uint16Array(v),numericProps:{},properties:[],fields:[]},k={type:"LineString",pathIndices:x>65535?new Uint32Array(C+1):new Uint16Array(C+1),positions:new D(x*I),globalFeatureIds:new O(x),featureIds:w>65535?new Uint32Array(x):new Uint16Array(x),numericProps:{},properties:[],fields:[]},U={type:"Polygon",polygonIndices:A>65535?new Uint32Array(E+1):new Uint16Array(E+1),primitivePolygonIndices:A>65535?new Uint32Array(T+1):new Uint16Array(T+1),positions:new D(A*I),globalFeatureIds:new O(A),featureIds:S>65535?new Uint32Array(A):new Uint16Array(A),numericProps:{},properties:[],fields:[]};L&&(U.triangles=[]);for(let j of[F,k,U])for(let q of P){let J=M[q];j.numericProps[q]=new J(j.positions.length/I)}k.pathIndices[C]=x,U.polygonIndices[E]=A,U.primitivePolygonIndices[T]=A;let G={pointPosition:0,pointFeature:0,linePosition:0,linePath:0,lineFeature:0,polygonPosition:0,polygonObject:0,polygonRing:0,polygonFeature:0,feature:0};for(let j of o){let q=j.geometry,J=j.properties||{};switch(q.type){case"Point":kVi(q,F,G,I,J),F.properties.push(nRe(J,P)),R&&F.fields.push({id:j.id}),G.pointFeature++;break;case"LineString":VVi(q,k,G,I,J),k.properties.push(nRe(J,P)),R&&k.fields.push({id:j.id}),G.lineFeature++;break;case"Polygon":zVi(q,U,G,I,J),U.properties.push(nRe(J,P)),R&&U.fields.push({id:j.id}),G.polygonFeature++;break;default:throw new Error("Invalid geometry type")}G.feature++}return UVi(F,k,U,I)}function kVi(o,f,m,v,y){f.positions.set(o.data,m.pointPosition*v);let x=o.data.length/v;aRe(f,y,m.pointPosition,x),f.globalFeatureIds.fill(m.feature,m.pointPosition,m.pointPosition+x),f.featureIds.fill(m.pointFeature,m.pointPosition,m.pointPosition+x),m.pointPosition+=x}function VVi(o,f,m,v,y){f.positions.set(o.data,m.linePosition*v);let x=o.data.length/v;aRe(f,y,m.linePosition,x),f.globalFeatureIds.fill(m.feature,m.linePosition,m.linePosition+x),f.featureIds.fill(m.lineFeature,m.linePosition,m.linePosition+x);for(let C=0,w=o.indices.length;C<w;++C){let A=o.indices[C],E=C===w-1?o.data.length:o.indices[C+1];f.pathIndices[m.linePath++]=m.linePosition,m.linePosition+=(E-A)/v}}function zVi(o,f,m,v,y){f.positions.set(o.data,m.polygonPosition*v);let x=o.data.length/v;aRe(f,y,m.polygonPosition,x),f.globalFeatureIds.fill(m.feature,m.polygonPosition,m.polygonPosition+x),f.featureIds.fill(m.polygonFeature,m.polygonPosition,m.polygonPosition+x);for(let C=0,w=o.indices.length;C<w;++C){let A=m.polygonPosition;f.polygonIndices[m.polygonObject++]=A;let E=o.areas[C],T=o.indices[C],S=o.indices[C+1];for(let I=0,P=T.length;I<P;++I){let D=T[I],L=I===P-1?S===void 0?o.data.length:S[0]:T[I+1];f.primitivePolygonIndices[m.polygonRing++]=m.polygonPosition,m.polygonPosition+=(L-D)/v}let M=m.polygonPosition;HVi(f,E,T,{startPosition:A,endPosition:M,coordLength:v})}}function HVi(o,f,m,v){let{startPosition:y,endPosition:x,coordLength:C}=v;if(!o.triangles)return;let w=y*C,A=x*C,E=o.positions.subarray(w,A),T=m[0],S=m.slice(1).map(I=>(I-T)/C),M=iRe(E,S,C,f);for(let I=0,P=M.length;I<P;++I)o.triangles.push(y+M[I])}function rRe(o,f){let m={};for(let v in o)m[v]={value:o[v],size:f};return m}function UVi(o,f,m,v){let y={points:{...o,positions:{value:o.positions,size:v},globalFeatureIds:{value:o.globalFeatureIds,size:1},featureIds:{value:o.featureIds,size:1},numericProps:rRe(o.numericProps,1)},lines:{...f,positions:{value:f.positions,size:v},pathIndices:{value:f.pathIndices,size:1},globalFeatureIds:{value:f.globalFeatureIds,size:1},featureIds:{value:f.featureIds,size:1},numericProps:rRe(f.numericProps,1)},polygons:{...m,positions:{value:m.positions,size:v},polygonIndices:{value:m.polygonIndices,size:1},primitivePolygonIndices:{value:m.primitivePolygonIndices,size:1},globalFeatureIds:{value:m.globalFeatureIds,size:1},featureIds:{value:m.featureIds,size:1},numericProps:rRe(m.numericProps,1)}};return m.triangles&&(y.polygons.triangles={value:new Uint32Array(m.triangles),size:1}),y}function aRe(o,f,m,v){for(let y in o.numericProps)if(y in f){let x=f[y];o.numericProps[y].fill(x,m,m+v)}}function nRe(o,f){let m={};for(let v in o)f.includes(v)||(m[v]=o[v]);return m}function GVi(o,f){return f===Array||!Number.isFinite(o)?Array:f===Float64Array||Math.fround(o)!==o?Float64Array:Float32Array}var fRe=qK(ift());function rft(o){let f=o.length;if(f<=1)return[o];let m=[],v,y;for(let x=0;x<f;x++){let C=szi(o[x]);C!==0&&(y===void 0&&(y=C<0),y===C<0?(v&&m.push(v),v=[o[x]]):v&&v.push(o[x]))}return v&&m.push(v),m}function szi(o){let f=0;for(let m=0,v=o.length-1,y,x;m<o.length;v=m++)y=o[m],x=o[v],f+=(x[0]-y[0])*(y[1]+x[1]);return f}function nft(o,f,m){f&&m&&(o===1?f.id=m.readVarint():o===2?lzi(m,f):o===3?f.type=m.readVarint():o===4&&(f._geometry=m.pos))}function lzi(o,f){let m=o.readVarint()+o.pos;for(;o.pos<m;){let v=f._keys[o.readVarint()],y=f._values[o.readVarint()];f.properties[v]=y}}var j4=class{static get types(){return["Unknown","Point","LineString","Polygon"]}constructor(f,m,v,y,x){ta(this,"properties",void 0),ta(this,"extent",void 0),ta(this,"type",void 0),ta(this,"id",void 0),ta(this,"_pbf",void 0),ta(this,"_geometry",void 0),ta(this,"_keys",void 0),ta(this,"_values",void 0),this.properties={},this.extent=v,this.type=0,this.id=null,this._pbf=f,this._geometry=-1,this._keys=y,this._values=x,f.readFields(nft,this,m)}loadGeometry(){let f=this._pbf;f.pos=this._geometry;let m=f.readVarint()+f.pos,v=1,y=0,x=0,C=0,w=[],A;for(;f.pos<m;){if(y<=0){let E=f.readVarint();v=E&7,y=E>>3}if(y--,v===1||v===2)x+=f.readSVarint(),C+=f.readSVarint(),v===1&&(A&&w.push(A),A=[]),A&&A.push([x,C]);else if(v===7)A&&A.push(A[0].slice());else throw new Error("unknown command ".concat(v))}return A&&w.push(A),w}bbox(){let f=this._pbf;f.pos=this._geometry;let m=f.readVarint()+f.pos,v=1,y=0,x=0,C=0,w=1/0,A=-1/0,E=1/0,T=-1/0;for(;f.pos<m;){if(y<=0){let S=f.readVarint();v=S&7,y=S>>3}if(y--,v===1||v===2)x+=f.readSVarint(),C+=f.readSVarint(),x<w&&(w=x),x>A&&(A=x),C<E&&(E=C),C>T&&(T=C);else if(v!==7)throw new Error("unknown command ".concat(v))}return[w,E,A,T]}_toGeoJSON(f){let m=this.loadGeometry(),v=j4.types[this.type],y,x;switch(this.type){case 1:let w=[];for(y=0;y<m.length;y++)w[y]=m[y][0];m=w,f(m,this);break;case 2:for(y=0;y<m.length;y++)f(m[y],this);break;case 3:for(m=rft(m),y=0;y<m.length;y++)for(x=0;x<m[y].length;x++)f(m[y][x],this);break}m.length===1?m=m[0]:v="Multi".concat(v);let C={type:"Feature",geometry:{type:v,coordinates:m},properties:this.properties};return this.id!==null&&(C.id=this.id),C}toGeoJSON(f){if(typeof f=="function")return this._toGeoJSON(f);let{x:m,y:v,z:y}=f,x=this.extent*Math.pow(2,y),C=this.extent*m,w=this.extent*v;function A(E){for(let T=0;T<E.length;T++){let S=E[T];S[0]=(S[0]+C)*360/x-180;let M=180-(S[1]+w)*360/x;S[1]=360/Math.PI*Math.atan(Math.exp(M*Math.PI/180))-90}}return this._toGeoJSON(A)}};var yJ=class{constructor(f,m){ta(this,"version",void 0),ta(this,"name",void 0),ta(this,"extent",void 0),ta(this,"length",void 0),ta(this,"_pbf",void 0),ta(this,"_keys",void 0),ta(this,"_values",void 0),ta(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=f,this._keys=[],this._values=[],this._features=[],f.readFields(uzi,this,m),this.length=this._features.length}feature(f){if(f<0||f>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[f];let m=this._pbf.readVarint()+this._pbf.pos;return new j4(this._pbf,m,this.extent,this._keys,this._values)}};function uzi(o,f,m){f&&m&&(o===15?f.version=m.readVarint():o===1?f.name=m.readString():o===5?f.extent=m.readVarint():o===2?f._features.push(m.pos):o===3?f._keys.push(m.readString()):o===4&&f._values.push(czi(m)))}function czi(o){let f=null,m=o.readVarint()+o.pos;for(;o.pos<m;){let v=o.readVarint()>>3;f=v===1?o.readString():v===2?o.readFloat():v===3?o.readDouble():v===4?o.readVarint64():v===5?o.readVarint():v===6?o.readSVarint():v===7?o.readBoolean():null}return f}var xJ=class{constructor(f,m){ta(this,"layers",void 0),this.layers=f.readFields(hzi,{},m)}};function hzi(o,f,m){if(o===3&&m){let v=new yJ(m,m.readVarint()+m.pos);v.length&&f&&(f[v.name]=v)}}function oft(o){let f=o.indices.length,m="Polygon";if(f<=1)return{type:m,data:o.data,areas:[[W4(o.data)]],indices:[o.indices]};let v=[],y=[],x=[],C=[],w,A=0;for(let E,T=0,S;T<f;T++){S=o.indices[T]-A,E=o.indices[T+1]-A||o.data.length;let M=o.data.slice(S,E),I=W4(M);if(I===0){let P=o.data.slice(0,S),D=o.data.slice(E);o.data=P.concat(D),A+=E-S;continue}w===void 0&&(w=I<0),w===I<0?(C.length&&(v.push(x),y.push(C)),C=[S],x=[I]):(x.push(I),C.push(S))}return x&&v.push(x),C.length&&y.push(C),{type:m,areas:v,indices:y,data:o.data}}function aft(o,f,m,v){for(let y=0,x=o.length;y<x;y+=2){o[y]=(o[y]+f)*360/v-180;let C=180-(o[y+1]+m)*360/v;o[y+1]=360/Math.PI*Math.atan(Math.exp(C*Math.PI/180))-90}}function sft(o,f,m){f&&m&&(o===1?f.id=m.readVarint():o===2?dzi(m,f):o===3?f.type=m.readVarint():o===4&&(f._geometry=m.pos))}function dzi(o,f){let m=o.readVarint()+o.pos;for(;o.pos<m;){let v=f._keys[o.readVarint()],y=f._values[o.readVarint()];f.properties[v]=y}}var lft,Y4,uRe,uue,cRe,hRe,CJ;var bJ=class{constructor(f,m,v,y,x,C){ta(this,"properties",void 0),ta(this,"extent",void 0),ta(this,"type",void 0),ta(this,"id",void 0),ta(this,"_pbf",void 0),ta(this,"_geometry",void 0),ta(this,"_keys",void 0),ta(this,"_values",void 0),ta(this,"_geometryInfo",void 0),this.properties={},this.extent=v,this.type=0,this.id=null,this._pbf=f,this._geometry=-1,this._keys=y,this._values=x,this._geometryInfo=C,f.readFields(sft,this,m)}loadGeometry(){let f=this._pbf;f.pos=this._geometry,lft=f.readVarint()+f.pos,Y4=1,uue=0,cRe=0,hRe=0,CJ=0;let m=[],v=[];for(;f.pos<lft;)if(uue<=0&&(uRe=f.readVarint(),Y4=uRe&7,uue=uRe>>3),uue--,Y4===1||Y4===2)cRe+=f.readSVarint(),hRe+=f.readSVarint(),Y4===1&&m.push(CJ),v.push(cRe,hRe),CJ+=2;else if(Y4===7){if(CJ>0){let y=m[m.length-1];v.push(v[y],v[y+1]),CJ+=2}}else throw new Error("unknown command ".concat(Y4));return{data:v,indices:m}}_toBinaryCoordinates(f){let m=this.loadGeometry(),v;f(m.data,this);let y=2;switch(this.type){case 1:this._geometryInfo.pointFeaturesCount++,this._geometryInfo.pointPositionsCount+=m.indices.length,v={type:"Point",...m};break;case 2:this._geometryInfo.lineFeaturesCount++,this._geometryInfo.linePathsCount+=m.indices.length,this._geometryInfo.linePositionsCount+=m.data.length/y,v={type:"LineString",...m};break;case 3:v=oft(m),this._geometryInfo.polygonFeaturesCount++,this._geometryInfo.polygonObjectsCount+=v.indices.length;for(let C of v.indices)this._geometryInfo.polygonRingsCount+=C.length;this._geometryInfo.polygonPositionsCount+=v.data.length/y;break;default:throw new Error("Invalid geometry type: ".concat(this.type))}let x={type:"Feature",geometry:v,properties:this.properties};return this.id!==null&&(x.id=this.id),x}toBinaryCoordinates(f){if(typeof f=="function")return this._toBinaryCoordinates(f);let{x:m,y:v,z:y}=f,x=this.extent*Math.pow(2,y),C=this.extent*m,w=this.extent*v;return this._toBinaryCoordinates(A=>aft(A,C,w,x))}};var wJ=class{constructor(f,m){ta(this,"version",void 0),ta(this,"name",void 0),ta(this,"extent",void 0),ta(this,"length",void 0),ta(this,"_pbf",void 0),ta(this,"_keys",void 0),ta(this,"_values",void 0),ta(this,"_features",void 0),this.version=1,this.name="",this.extent=4096,this.length=0,this._pbf=f,this._keys=[],this._values=[],this._features=[],f.readFields(fzi,this,m),this.length=this._features.length}feature(f,m){if(f<0||f>=this._features.length)throw new Error("feature index out of bounds");this._pbf.pos=this._features[f];let v=this._pbf.readVarint()+this._pbf.pos;return new bJ(this._pbf,v,this.extent,this._keys,this._values,m)}};function fzi(o,f,m){f&&m&&(o===15?f.version=m.readVarint():o===1?f.name=m.readString():o===5?f.extent=m.readVarint():o===2?f._features.push(m.pos):o===3?f._keys.push(m.readString()):o===4&&f._values.push(pzi(m)))}function pzi(o){let f=null,m=o.readVarint()+o.pos;for(;o.pos<m;){let v=o.readVarint()>>3;f=v===1?o.readString():v===2?o.readFloat():v===3?o.readDouble():v===4?o.readVarint64():v===5?o.readVarint():v===6?o.readSVarint():v===7?o.readBoolean():null}return f}var AJ=class{constructor(f,m){ta(this,"layers",void 0),this.layers=f.readFields(mzi,{},m)}};function mzi(o,f,m){if(o===3&&m){let v=new wJ(m,m.readVarint()+m.pos);v.length&&f&&(f[v.name]=v)}}function cue(o,f){var m,v;let y=_zi(f),x=(f==null||(m=f.gis)===null||m===void 0?void 0:m.format)||(f==null||(v=f.mvt)===null||v===void 0?void 0:v.shape);switch(x){case"columnar-table":return{shape:"columnar-table",data:dRe(o,y)};case"geojson-row-table":return{shape:"geojson-row-table",data:uft(o,y)};case"geojson":return uft(o,y);case"binary-geometry":return dRe(o,y);case"binary":return dRe(o,y);default:throw new Error(x)}}function dRe(o,f){let[m,v]=gzi(o,f),y=oRe(m,v);return y.byteLength=o.byteLength,y}function gzi(o,f){let m=[],v={coordLength:2,pointPositionsCount:0,pointFeaturesCount:0,linePositionsCount:0,linePathsCount:0,lineFeaturesCount:0,polygonPositionsCount:0,polygonObjectsCount:0,polygonRingsCount:0,polygonFeaturesCount:0};if(o.byteLength<=0)return[m,v];let y=new AJ(new fRe.default(o));return(f&&Array.isArray(f.layers)?f.layers:Object.keys(y.layers)).forEach(C=>{let w=y.layers[C];if(!!w)for(let A=0;A<w.length;A++){let E=w.feature(A,v),T=yzi(E,f,C);m.push(T)}}),[m,v]}function uft(o,f){if(o.byteLength<=0)return[];let m=[],v=new xJ(new fRe.default(o));return(Array.isArray(f.layers)?f.layers:Object.keys(v.layers)).forEach(x=>{let C=v.layers[x];if(!!C)for(let w=0;w<C.length;w++){let A=C.feature(w),E=vzi(A,f,x);m.push(E)}}),m}function _zi(o){var f;if(!(o!=null&&o.mvt))throw new Error("mvt options required");let m=((f=o.mvt)===null||f===void 0?void 0:f.coordinates)==="wgs84",{tileIndex:v}=o.mvt,y=v&&Number.isFinite(v.x)&&Number.isFinite(v.y)&&Number.isFinite(v.z);if(m&&!y)throw new Error("MVT Loader: WGS84 coordinates need tileIndex property");return o.mvt}function vzi(o,f,m){let v=o.toGeoJSON(f.coordinates==="wgs84"?f.tileIndex:xzi);return f.layerProperty&&(v.properties[f.layerProperty]=m),v}function yzi(o,f,m){let v=o.toBinaryCoordinates(f.coordinates==="wgs84"?f.tileIndex:Czi);return f.layerProperty&&v.properties&&(v.properties[f.layerProperty]=m),v}function xzi(o,f){let{extent:m}=f;for(let v=0;v<o.length;v++){let y=o[v];y[0]/=m,y[1]/=m}}function Czi(o,f){let{extent:m}=f;for(let v=0,y=o.length;v<y;++v)o[v]/=m}var bzi="3.4.11",wzi={mvt:{shape:"geojson",coordinates:"local",layerProperty:"layerName",layers:void 0,tileIndex:null}},cft={name:"Mapbox Vector Tile",id:"mvt",module:"mvt",version:bzi,extensions:["mvt","pbf"],mimeTypes:["application/vnd.mapbox-vector-tile","application/x-protobuf"],worker:!0,category:"geometry",options:wzi},pRe={...cft,parse:async(o,f)=>cue(o,f),parseSync:cue,binary:!0};function hue(o,f){if(!o)throw new Error(f||"loader assertion failed.")}var FP={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Azi=FP.self||FP.window||FP.global||{},Ezi=FP.window||FP.self||FP.global||{},Tzi=FP.global||FP.self||FP.window||{},Szi=FP.document||{};var EJ=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var hft=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Pzi=hft&&parseFloat(hft[1])||0;var dft="3.4.11";function ny(o,f){if(!o)throw new Error(f||"loaders.gl assertion failed.")}var BP={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},wlr=BP.self||BP.window||BP.global||{},Alr=BP.window||BP.self||BP.global||{},Elr=BP.global||BP.self||BP.window||{},Tlr=BP.document||{};var q4=typeof process!="object"||String(process)!=="[object process]"||process.browser;var pft=typeof window<"u"&&typeof window.orientation<"u",fft=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Slr=fft&&parseFloat(fft[1])||0;var TJ=class{constructor(f,m){ta(this,"name",void 0),ta(this,"workerThread",void 0),ta(this,"isRunning",!0),ta(this,"result",void 0),ta(this,"_resolve",()=>{}),ta(this,"_reject",()=>{}),this.name=f,this.workerThread=m,this.result=new Promise((v,y)=>{this._resolve=v,this._reject=y})}postMessage(f,m){this.workerThread.postMessage({source:"loaders.gl",type:f,payload:m})}done(f){ny(this.isRunning),this.isRunning=!1,this._resolve(f)}error(f){ny(this.isRunning),this.isRunning=!1,this._reject(f)}};var J8=class{terminate(){}};var mRe=new Map;function mft(o){ny(o.source&&!o.url||!o.source&&o.url);let f=mRe.get(o.source||o.url);return f||(o.url&&(f=Izi(o.url),mRe.set(o.url,f)),o.source&&(f=gft(o.source),mRe.set(o.source,f))),ny(f),f}function Izi(o){if(!o.startsWith("http"))return o;let f=Mzi(o);return gft(f)}function gft(o){let f=new Blob([o],{type:"application/javascript"});return URL.createObjectURL(f)}function Mzi(o){return`try { importScripts('`.concat(o,`'); } catch (error) { console.error(error); throw error; }`)}function gRe(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,m=arguments.length>2?arguments[2]:void 0,v=m||new Set;if(o){if(_ft(o))v.add(o);else if(_ft(o.buffer))v.add(o.buffer);else if(!ArrayBuffer.isView(o)){if(f&&typeof o=="object")for(let y in o)gRe(o[y],f,v)}}return m===void 0?Array.from(v):[]}function _ft(o){return o?o instanceof ArrayBuffer||typeof MessagePort<"u"&&o instanceof MessagePort||typeof ImageBitmap<"u"&&o instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&o instanceof OffscreenCanvas:!1}var _Re=()=>{},nN=class{static isSupported(){return typeof Worker<"u"&&q4||typeof J8<"u"&&!q4}constructor(f){ta(this,"name",void 0),ta(this,"source",void 0),ta(this,"url",void 0),ta(this,"terminated",!1),ta(this,"worker",void 0),ta(this,"onMessage",void 0),ta(this,"onError",void 0),ta(this,"_loadableURL","");let{name:m,source:v,url:y}=f;ny(v||y),this.name=m,this.source=v,this.url=y,this.onMessage=_Re,this.onError=x=>console.log(x),this.worker=q4?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=_Re,this.onError=_Re,this.worker.terminate(),this.terminated=!0}get isRunning(){return Boolean(this.onMessage)}postMessage(f,m){m=m||gRe(f),this.worker.postMessage(f,m)}_getErrorFromErrorEvent(f){let m="Failed to load ";return m+="worker ".concat(this.name," from ").concat(this.url,". "),f.message&&(m+="".concat(f.message," in ")),f.lineno&&(m+=":".concat(f.lineno,":").concat(f.colno)),new Error(m)}_createBrowserWorker(){this._loadableURL=mft({source:this.source,url:this.url});let f=new Worker(this._loadableURL,{name:this.name});return f.onmessage=m=>{m.data?this.onMessage(m.data):this.onError(new Error("No data received"))},f.onerror=m=>{this.onError(this._getErrorFromErrorEvent(m)),this.terminated=!0},f.onmessageerror=m=>console.error(m),f}_createNodeWorker(){let f;if(this.url){let v=this.url.includes(":/")||this.url.startsWith("/")?this.url:"./".concat(this.url);f=new J8(v,{eval:!1})}else if(this.source)f=new J8(this.source,{eval:!0});else throw new Error("no worker");return f.on("message",m=>{this.onMessage(m)}),f.on("error",m=>{this.onError(m)}),f.on("exit",m=>{}),f}};var SJ=class{static isSupported(){return nN.isSupported()}constructor(f){ta(this,"name","unnamed"),ta(this,"source",void 0),ta(this,"url",void 0),ta(this,"maxConcurrency",1),ta(this,"maxMobileConcurrency",1),ta(this,"onDebug",()=>{}),ta(this,"reuseWorkers",!0),ta(this,"props",{}),ta(this,"jobQueue",[]),ta(this,"idleQueue",[]),ta(this,"count",0),ta(this,"isDestroyed",!1),this.source=f.source,this.url=f.url,this.setProps(f)}destroy(){this.idleQueue.forEach(f=>f.destroy()),this.isDestroyed=!0}setProps(f){this.props={...this.props,...f},f.name!==void 0&&(this.name=f.name),f.maxConcurrency!==void 0&&(this.maxConcurrency=f.maxConcurrency),f.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=f.maxMobileConcurrency),f.reuseWorkers!==void 0&&(this.reuseWorkers=f.reuseWorkers),f.onDebug!==void 0&&(this.onDebug=f.onDebug)}async startJob(f){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:(x,C,w)=>x.done(w),v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:(x,C)=>x.error(C),y=new Promise(x=>(this.jobQueue.push({name:f,onMessage:m,onError:v,onStart:x}),this));return this._startQueuedJob(),await y}async _startQueuedJob(){if(!this.jobQueue.length)return;let f=this._getAvailableWorker();if(!f)return;let m=this.jobQueue.shift();if(m){this.onDebug({message:"Starting job",name:m.name,workerThread:f,backlog:this.jobQueue.length});let v=new TJ(m.name,f);f.onMessage=y=>m.onMessage(v,y.type,y.payload),f.onError=y=>m.onError(v,y),m.onStart(v);try{await v.result}finally{this.returnWorkerToQueue(f)}}}returnWorkerToQueue(f){this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(f.destroy(),this.count--):this.idleQueue.push(f),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;let f="".concat(this.name.toLowerCase()," (#").concat(this.count," of ").concat(this.maxConcurrency,")");return new nN({name:f,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return pft?this.maxMobileConcurrency:this.maxConcurrency}};var Dzi={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}},BC=class{static isSupported(){return nN.isSupported()}static getWorkerFarm(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return BC._workerFarm=BC._workerFarm||new BC({}),BC._workerFarm.setProps(f),BC._workerFarm}constructor(f){ta(this,"props",void 0),ta(this,"workerPools",new Map),this.props={...Dzi},this.setProps(f),this.workerPools=new Map}destroy(){for(let f of this.workerPools.values())f.destroy();this.workerPools=new Map}setProps(f){this.props={...this.props,...f};for(let m of this.workerPools.values())m.setProps(this._getWorkerPoolProps())}getWorkerPool(f){let{name:m,source:v,url:y}=f,x=this.workerPools.get(m);return x||(x=new SJ({name:m,source:v,url:y}),x.setProps(this._getWorkerPoolProps()),this.workerPools.set(m,x)),x}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}};ta(BC,"_workerFarm",void 0);var Lzi="latest";function vRe(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=f[o.id]||{},v="".concat(o.id,"-worker.js"),y=m.workerUrl;if(!y&&o.id==="compression"&&(y=f.workerUrl),f._workerType==="test"&&(y="modules/".concat(o.module,"/dist/").concat(v)),!y){let x=o.version;x==="latest"&&(x=Lzi);let C=x?"@".concat(x):"";y="https://unpkg.com/@loaders.gl/".concat(o.module).concat(C,"/dist/").concat(v)}return ny(y),y}function yRe(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:dft;ny(o,"no worker provided");let m=o.version;return!(!f||!m)}function xRe(o,f){return!BC.isSupported()||!q4&&!(f!=null&&f._nodeWorkers)?!1:o.worker&&f?.worker}async function CRe(o,f,m,v,y){let x=o.id,C=vRe(o,m),A=BC.getWorkerFarm(m).getWorkerPool({name:x,url:C});m=JSON.parse(JSON.stringify(m)),v=JSON.parse(JSON.stringify(v||{}));let E=await A.startJob("process-on-worker",Rzi.bind(null,y));return E.postMessage("process",{input:f,options:m,context:v}),await(await E.result).result}async function Rzi(o,f,m,v){switch(m){case"done":f.done(v);break;case"error":f.error(new Error(v.error));break;case"process":let{id:y,input:x,options:C}=v;try{let w=await o(x,C);f.postMessage("done",{id:y,result:w})}catch(w){let A=w instanceof Error?w.message:"unknown error";f.postMessage("error",{id:y,error:A})}break;default:console.warn("parse-with-worker unknown message ".concat(m))}}function bRe(o,f,m){if(m=m||o.byteLength,o.byteLength<m||f.byteLength<m)return!1;let v=new Uint8Array(o),y=new Uint8Array(f);for(let x=0;x<v.length;++x)if(v[x]!==y[x])return!1;return!0}function wRe(){for(var o=arguments.length,f=new Array(o),m=0;m<o;m++)f[m]=arguments[m];let v=f.map(w=>w instanceof ArrayBuffer?new Uint8Array(w):w),y=v.reduce((w,A)=>w+A.byteLength,0),x=new Uint8Array(y),C=0;for(let w of v)x.set(w,C),C+=w.byteLength;return x.buffer}async function ARe(o){let f=[];for await(let m of o)f.push(m);return wRe(...f)}var Ozi="",vft={};function ERe(o){for(let f in vft)if(o.startsWith(f)){let m=vft[f];o=o.replace(f,m)}return!o.startsWith("http://")&&!o.startsWith("https://")&&(o="".concat(Ozi).concat(o)),o}function yft(o){return o&&typeof o=="object"&&o.isBuffer}function due(o){if(yft(o))return o;if(o instanceof ArrayBuffer)return o;if(ArrayBuffer.isView(o))return o.byteOffset===0&&o.byteLength===o.buffer.byteLength?o.buffer:o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength);if(typeof o=="string"){let f=o;return new TextEncoder().encode(f).buffer}if(o&&typeof o=="object"&&o._toArrayBuffer)return o._toArrayBuffer();throw new Error("toArrayBuffer")}var X4={};Ice(X4,{dirname:()=>Fzi,filename:()=>Nzi,join:()=>Bzi,resolve:()=>kzi});function xft(){var o;if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let f=(o=window.location)===null||o===void 0?void 0:o.pathname;return f?.slice(0,f.lastIndexOf("/")+1)||""}function Nzi(o){let f=o?o.lastIndexOf("/"):-1;return f>=0?o.substr(f+1):""}function Fzi(o){let f=o?o.lastIndexOf("/"):-1;return f>=0?o.substr(0,f):""}function Bzi(){for(var o=arguments.length,f=new Array(o),m=0;m<o;m++)f[m]=arguments[m];let v="/";return f=f.map((y,x)=>(x&&(y=y.replace(new RegExp("^".concat(v)),"")),x!==f.length-1&&(y=y.replace(new RegExp("".concat(v,"$")),"")),y)),f.join(v)}function kzi(){let o=[];for(let y=0;y<arguments.length;y++)o[y]=y<0||arguments.length<=y?void 0:arguments[y];let f="",m=!1,v;for(let y=o.length-1;y>=-1&&!m;y--){let x;y>=0?x=o[y]:(v===void 0&&(v=xft()),x=v),x.length!==0&&(f="".concat(x,"/").concat(f),m=x.charCodeAt(0)===PJ)}return f=Vzi(f,!m),m?"/".concat(f):f.length>0?f:"."}var PJ=47,TRe=46;function Vzi(o,f){let m="",v=-1,y=0,x,C=!1;for(let w=0;w<=o.length;++w){if(w<o.length)x=o.charCodeAt(w);else{if(x===PJ)break;x=PJ}if(x===PJ){if(!(v===w-1||y===1))if(v!==w-1&&y===2){if(m.length<2||!C||m.charCodeAt(m.length-1)!==TRe||m.charCodeAt(m.length-2)!==TRe){if(m.length>2){let A=m.length-1,E=A;for(;E>=0&&m.charCodeAt(E)!==PJ;--E);if(E!==A){m=E===-1?"":m.slice(0,E),v=w,y=0,C=!1;continue}}else if(m.length===2||m.length===1){m="",v=w,y=0,C=!1;continue}}f&&(m.length>0?m+="/..":m="..",C=!0)}else{let A=o.slice(v+1,w);m.length>0?m+="/".concat(A):m=A,C=!1}v=w,y=0}else x===TRe&&y!==-1?++y:y=-1}return m}var zzi=o=>typeof o=="boolean",IJ=o=>typeof o=="function",J4=o=>o!==null&&typeof o=="object",SRe=o=>J4(o)&&o.constructor==={}.constructor;var Cft=o=>o&&typeof o[Symbol.iterator]=="function",bft=o=>o&&typeof o[Symbol.asyncIterator]=="function";var PA=o=>typeof Response<"u"&&o instanceof Response||o&&o.arrayBuffer&&o.text&&o.json;var IA=o=>typeof Blob<"u"&&o instanceof Blob,wft=o=>o&&typeof o=="object"&&o.isBuffer;var Hzi=o=>typeof ReadableStream<"u"&&o instanceof ReadableStream||J4(o)&&IJ(o.tee)&&IJ(o.cancel)&&IJ(o.getReader);var Uzi=o=>J4(o)&&IJ(o.read)&&IJ(o.pipe)&&zzi(o.readable),fue=o=>Hzi(o)||Uzi(o);var Gzi=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,Wzi=/^([-\w.]+\/[-\w.+]+)/;function Aft(o){let f=Wzi.exec(o);return f?f[1]:o}function PRe(o){let f=Gzi.exec(o);return f?f[1]:""}var Eft=/\?.*/;function Tft(o){let f=o.match(Eft);return f&&f[0]}function K8(o){return o.replace(Eft,"")}function K4(o){return PA(o)?o.url:IA(o)?o.name||"":typeof o=="string"?o:""}function MJ(o){if(PA(o)){let f=o,m=f.headers.get("content-type")||"",v=K8(f.url);return Aft(m)||PRe(v)}return IA(o)?o.type||"":typeof o=="string"?PRe(o):""}function Sft(o){return PA(o)?o.headers["content-length"]||-1:IA(o)?o.size:typeof o=="string"?o.length:o instanceof ArrayBuffer||ArrayBuffer.isView(o)?o.byteLength:-1}async function pue(o){if(PA(o))return o;let f={},m=Sft(o);m>=0&&(f["content-length"]=String(m));let v=K4(o),y=MJ(o);y&&(f["content-type"]=y);let x=await Yzi(o);x&&(f["x-first-bytes"]=x),typeof o=="string"&&(o=new TextEncoder().encode(o));let C=new Response(o,{headers:f});return Object.defineProperty(C,"url",{value:v}),C}async function Pft(o){if(!o.ok){let f=await jzi(o);throw new Error(f)}}async function jzi(o){let f="Failed to fetch resource ".concat(o.url," (").concat(o.status,"): ");try{let m=o.headers.get("Content-Type"),v=o.statusText;m.includes("application/json")&&(v+=" ".concat(await o.text())),f+=v,f=f.length>60?"".concat(f.slice(0,60),"..."):f}catch{}return f}async function Yzi(o){if(typeof o=="string")return"data:,".concat(o.slice(0,5));if(o instanceof Blob){let m=o.slice(0,5);return await new Promise(v=>{let y=new FileReader;y.onload=x=>{var C;return v(x==null||(C=x.target)===null||C===void 0?void 0:C.result)},y.readAsDataURL(m)})}if(o instanceof ArrayBuffer){let m=o.slice(0,5),v=qzi(m);return"data:base64,".concat(v)}return null}function qzi(o){let f="",m=new Uint8Array(o);for(let v=0;v<m.byteLength;v++)f+=String.fromCharCode(m[v]);return btoa(f)}async function IRe(o,f){if(typeof o=="string"){o=ERe(o);let m=f;return f!=null&&f.fetch&&typeof f?.fetch!="function"&&(m=f.fetch),await fetch(o,m)}return await pue(o)}function MRe(o){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let f=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,m=o||f;return!!(m&&m.indexOf("Electron")>=0)}function JT(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||MRe()}var Xzi=globalThis.self||globalThis.window||globalThis.global,Q8=globalThis.window||globalThis.self||globalThis.global,Jzi=globalThis.document||{},Q4=globalThis.process||{},Kzi=globalThis.console,Qur=globalThis.navigator||{};var mue=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",ecr=JT();function Qzi(o){try{let f=window[o],m="__storage_test__";return f.setItem(m,m),f.removeItem(m),f}catch{return null}}var gue=class{constructor(f,m){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=Qzi(v),this.id=f,this.config=m,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(f){if(Object.assign(this.config,f),this.storage){let m=JSON.stringify(this.config);this.storage.setItem(this.id,m)}}_loadConfiguration(){let f={};if(this.storage){let m=this.storage.getItem(this.id);f=m?JSON.parse(m):{}}return Object.assign(this.config,f),this}};function Ift(o){let f;return o<10?f="".concat(o.toFixed(2),"ms"):o<100?f="".concat(o.toFixed(1),"ms"):o<1e3?f="".concat(o.toFixed(0),"ms"):f="".concat((o/1e3).toFixed(2),"s"),f}function Mft(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,m=Math.max(f-o.length,0);return"".concat(" ".repeat(m)).concat(o)}function _ue(o,f,m){let v=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,y=o.src.replace(/\(/g,"%28").replace(/\)/g,"%29");o.width>v&&(m=Math.min(m,v/o.width));let x=o.width*m,C=o.height*m,w=["font-size:1px;","padding:".concat(Math.floor(C/2),"px ").concat(Math.floor(x/2),"px;"),"line-height:".concat(C,"px;"),"background:url(".concat(y,");"),"background-size:".concat(x,"px ").concat(C,"px;"),"color:transparent;"].join("");return["".concat(f," %c+"),w]}var vue;(function(o){o[o.BLACK=30]="BLACK",o[o.RED=31]="RED",o[o.GREEN=32]="GREEN",o[o.YELLOW=33]="YELLOW",o[o.BLUE=34]="BLUE",o[o.MAGENTA=35]="MAGENTA",o[o.CYAN=36]="CYAN",o[o.WHITE=37]="WHITE",o[o.BRIGHT_BLACK=90]="BRIGHT_BLACK",o[o.BRIGHT_RED=91]="BRIGHT_RED",o[o.BRIGHT_GREEN=92]="BRIGHT_GREEN",o[o.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",o[o.BRIGHT_BLUE=94]="BRIGHT_BLUE",o[o.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",o[o.BRIGHT_CYAN=96]="BRIGHT_CYAN",o[o.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(vue||(vue={}));var Zzi=10;function Dft(o){return typeof o!="string"?o:(o=o.toUpperCase(),vue[o]||vue.WHITE)}function Lft(o,f,m){if(!JT&&typeof o=="string"){if(f){let v=Dft(f);o="\x1B[".concat(v,"m").concat(o,"\x1B[39m")}if(m){let v=Dft(m);o="\x1B[".concat(v+Zzi,"m").concat(o,"\x1B[49m")}}return o}function Rft(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],m=Object.getPrototypeOf(o),v=Object.getOwnPropertyNames(m),y=o;for(let x of v){let C=y[x];typeof C=="function"&&(f.find(w=>x===w)||(y[x]=C.bind(o)))}}function Z8(o,f){if(!o)throw new Error(f||"Assertion failed")}function Z4(){let o;if(JT()&&Q8.performance){var f,m;o=Q8===null||Q8===void 0||(f=Q8.performance)===null||f===void 0||(m=f.now)===null||m===void 0?void 0:m.call(f)}else if("hrtime"in Q4){var v;let y=Q4===null||Q4===void 0||(v=Q4.hrtime)===null||v===void 0?void 0:v.call(Q4);o=y[0]*1e3+y[1]/1e6}else o=Date.now();return o}var $8={debug:JT()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},$zi={enabled:!0,level:0};function MA(){}var Oft={},Nft={once:!0},kP=class{constructor(){let{id:f}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=mue,this._startTs=Z4(),this._deltaTs=Z4(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=f,this.userData={},this._storage=new gue("__probe-".concat(this.id,"__"),$zi),this.timeStamp("".concat(this.id," started")),Rft(this),Object.seal(this)}set level(f){this.setLevel(f)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((Z4()-this._startTs).toPrecision(10))}getDelta(){return Number((Z4()-this._deltaTs).toPrecision(10))}set priority(f){this.level=f}get priority(){return this.level}getPriority(){return this.level}enable(){let f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:f}),this}setLevel(f){return this._storage.setConfiguration({level:f}),this}get(f){return this._storage.config[f]}set(f,m){this._storage.setConfiguration({[f]:m})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(f,m){Z8(f,m)}warn(f){return this._getLogFunction(0,f,$8.warn,arguments,Nft)}error(f){return this._getLogFunction(0,f,$8.error,arguments)}deprecated(f,m){return this.warn("`".concat(f,"` is deprecated and will be removed in a later version. Use `").concat(m,"` instead"))}removed(f,m){return this.error("`".concat(f,"` has been removed. Use `").concat(m,"` instead"))}probe(f,m){return this._getLogFunction(f,m,$8.log,arguments,{time:!0,once:!0})}log(f,m){return this._getLogFunction(f,m,$8.debug,arguments)}info(f,m){return this._getLogFunction(f,m,console.info,arguments)}once(f,m){return this._getLogFunction(f,m,$8.debug||$8.info,arguments,Nft)}table(f,m,v){return m?this._getLogFunction(f,m,console.table||MA,v&&[v],{tag:rHi(m)}):MA}image(f){let{logLevel:m,priority:v,image:y,message:x="",scale:C=1}=f;return this._shouldLog(m||v)?JT()?iHi({image:y,message:x,scale:C}):tHi({image:y,message:x,scale:C}):MA}time(f,m){return this._getLogFunction(f,m,console.time?console.time:console.info)}timeEnd(f,m){return this._getLogFunction(f,m,console.timeEnd?console.timeEnd:console.info)}timeStamp(f,m){return this._getLogFunction(f,m,console.timeStamp||MA)}group(f,m){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},y=Fft({logLevel:f,message:m,opts:v}),{collapsed:x}=v;return y.method=(x?console.groupCollapsed:console.group)||console.info,this._getLogFunction(y)}groupCollapsed(f,m){let v=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(f,m,Object.assign({},v,{collapsed:!0}))}groupEnd(f){return this._getLogFunction(f,"",console.groupEnd||MA)}withGroup(f,m,v){this.group(f,m)();try{v()}finally{this.groupEnd(f)()}}trace(){console.trace&&console.trace()}_shouldLog(f){return this.isEnabled()&&this.getLevel()>=Bft(f)}_getLogFunction(f,m,v,y,x){if(this._shouldLog(f)){x=Fft({logLevel:f,message:m,args:y,opts:x}),v=v||x.method,Z8(v),x.total=this.getTotal(),x.delta=this.getDelta(),this._deltaTs=Z4();let C=x.tag||x.message;if(x.once&&C)if(!Oft[C])Oft[C]=Z4();else return MA;return m=eHi(this.id,x.message,x),v.bind(console,m,...x.args)}return MA}};kP.VERSION=mue;function Bft(o){if(!o)return 0;let f;switch(typeof o){case"number":f=o;break;case"object":f=o.logLevel||o.priority||0;break;default:return 0}return Z8(Number.isFinite(f)&&f>=0),f}function Fft(o){let{logLevel:f,message:m}=o;o.logLevel=Bft(f);let v=o.args?Array.from(o.args):[];for(;v.length&&v.shift()!==m;);switch(typeof f){case"string":case"function":m!==void 0&&v.unshift(m),o.message=f;break;case"object":Object.assign(o,f);break;default:}typeof o.message=="function"&&(o.message=o.message());let y=typeof o.message;return Z8(y==="string"||y==="object"),Object.assign(o,{args:v},o.opts)}function eHi(o,f,m){if(typeof f=="string"){let v=m.time?Mft(Ift(m.total)):"";f=m.time?"".concat(o,": ").concat(v," ").concat(f):"".concat(o,": ").concat(f),f=Lft(f,m.color,m.background)}return f}function tHi(o){let{image:f,message:m="",scale:v=1}=o;return console.warn("removed"),MA}function iHi(o){let{image:f,message:m="",scale:v=1}=o;if(typeof f=="string"){let x=new Image;return x.onload=()=>{let C=_ue(x,m,v);console.log(...C)},x.src=f,MA}let y=f.nodeName||"";if(y.toLowerCase()==="img")return console.log(..._ue(f,m,v)),MA;if(y.toLowerCase()==="canvas"){let x=new Image;return x.onload=()=>console.log(..._ue(x,m,v)),x.src=f.toDataURL(),MA}return MA}function rHi(o){for(let f in o)for(let m in o[f])return m||"untitled";return"empty"}var Ecr=new kP({id:"@probe.gl/log"});var DRe=new kP({id:"loaders.gl"}),yue=class{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}},xue=class{constructor(){ta(this,"console",void 0),this.console=console}log(){for(var f=arguments.length,m=new Array(f),v=0;v<f;v++)m[v]=arguments[v];return this.console.log.bind(this.console,...m)}info(){for(var f=arguments.length,m=new Array(f),v=0;v<f;v++)m[v]=arguments[v];return this.console.info.bind(this.console,...m)}warn(){for(var f=arguments.length,m=new Array(f),v=0;v<f;v++)m[v]=arguments[v];return this.console.warn.bind(this.console,...m)}error(){for(var f=arguments.length,m=new Array(f),v=0;v<f;v++)m[v]=arguments[v];return this.console.error.bind(this.console,...m)}};var LRe={fetch:null,mimeType:void 0,nothrow:!1,log:new xue,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:EJ,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},kft={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function RRe(){globalThis.loaders=globalThis.loaders||{};let{loaders:o}=globalThis;return o._state=o._state||{},o._state}var ORe=()=>{let o=RRe();return o.globalOptions=o.globalOptions||{...LRe},o.globalOptions};function Hft(o,f,m,v){return m=m||[],m=Array.isArray(m)?m:[m],nHi(o,m),aHi(f,o,v)}function nHi(o,f){Vft(o,null,LRe,kft,f);for(let m of f){let v=o&&o[m.id]||{},y=m.options&&m.options[m.id]||{},x=m.deprecatedOptions&&m.deprecatedOptions[m.id]||{};Vft(v,m.id,y,x,f)}}function Vft(o,f,m,v,y){let x=f||"Top level",C=f?"".concat(f,"."):"";for(let w in o){let A=!f&&J4(o[w]),E=w==="baseUri"&&!f,T=w==="workerUrl"&&f;if(!(w in m)&&!E&&!T){if(w in v)DRe.warn("".concat(x," loader option '").concat(C).concat(w,"' no longer supported, use '").concat(v[w],"'"))();else if(!A){let S=oHi(w,y);DRe.warn("".concat(x," loader option '").concat(C).concat(w,"' not recognized. ").concat(S))()}}}}function oHi(o,f){let m=o.toLowerCase(),v="";for(let y of f)for(let x in y.options){if(o===x)return"Did you mean '".concat(y.id,".").concat(x,"'?");let C=x.toLowerCase();(m.startsWith(C)||C.startsWith(m))&&(v=v||"Did you mean '".concat(y.id,".").concat(x,"'?"))}return v}function aHi(o,f,m){let y={...o.options||{}};return sHi(y,m),y.log===null&&(y.log=new yue),zft(y,ORe()),zft(y,f),y}function zft(o,f){for(let m in f)if(m in f){let v=f[m];SRe(v)&&SRe(o[m])?o[m]={...o[m],...f[m]}:o[m]=f[m]}}function sHi(o,f){f&&!("baseUri"in o)&&(o.baseUri=f)}function DJ(o){var f;return o?(Array.isArray(o)&&(o=o[0]),Array.isArray((f=o)===null||f===void 0?void 0:f.extensions)):!1}function NRe(o){var f,m;hue(o,"null loader"),hue(DJ(o),"invalid loader");let v;return Array.isArray(o)&&(v=o[1],o=o[0],o={...o,options:{...o.options,...v}}),((f=o)!==null&&f!==void 0&&f.parseTextSync||(m=o)!==null&&m!==void 0&&m.parseText)&&(o.text=!0),o.text||(o.binary=!0),o}var lHi=()=>{let o=RRe();return o.loaderRegistry=o.loaderRegistry||[],o.loaderRegistry};function Uft(){return lHi()}var Gft=new kP({id:"loaders.gl"});var uHi=/\.([^.]+)$/;async function Yft(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=arguments.length>2?arguments[2]:void 0,v=arguments.length>3?arguments[3]:void 0;if(!qft(o))return null;let y=Wft(o,f,{...m,nothrow:!0},v);if(y)return y;if(IA(o)&&(o=await o.slice(0,10).arrayBuffer(),y=Wft(o,f,m,v)),!y&&!(m!=null&&m.nothrow))throw new Error(Xft(o));return y}function Wft(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],m=arguments.length>2?arguments[2]:void 0,v=arguments.length>3?arguments[3]:void 0;if(!qft(o))return null;if(f&&!Array.isArray(f))return NRe(f);let y=[];f&&(y=y.concat(f)),m!=null&&m.ignoreRegisteredLoaders||y.push(...Uft()),hHi(y);let x=cHi(o,y,m,v);if(!x&&!(m!=null&&m.nothrow))throw new Error(Xft(o));return x}function cHi(o,f,m,v){let y=K4(o),x=MJ(o),C=K8(y)||v?.url,w=null,A="";if(m!=null&&m.mimeType&&(w=FRe(f,m?.mimeType),A="match forced by supplied MIME type ".concat(m?.mimeType)),w=w||dHi(f,C),A=A||(w?"matched url ".concat(C):""),w=w||FRe(f,x),A=A||(w?"matched MIME type ".concat(x):""),w=w||pHi(f,o),A=A||(w?"matched initial data ".concat(Jft(o)):""),w=w||FRe(f,m?.fallbackMimeType),A=A||(w?"matched fallback MIME type ".concat(x):""),A){var E;Gft.log(1,"selectLoader selected ".concat((E=w)===null||E===void 0?void 0:E.name,": ").concat(A,"."))}return w}function qft(o){return!(o instanceof Response&&o.status===204)}function Xft(o){let f=K4(o),m=MJ(o),v="No valid loader found (";v+=f?"".concat(X4.filename(f),", "):"no url provided, ",v+="MIME type: ".concat(m?'"'.concat(m,'"'):"not provided",", ");let y=o?Jft(o):"";return v+=y?' first bytes: "'.concat(y,'"'):"first bytes: not available",v+=")",v}function hHi(o){for(let f of o)NRe(f)}function dHi(o,f){let m=f&&uHi.exec(f),v=m&&m[1];return v?fHi(o,v):null}function fHi(o,f){f=f.toLowerCase();for(let m of o)for(let v of m.extensions)if(v.toLowerCase()===f)return m;return null}function FRe(o,f){for(let m of o)if(m.mimeTypes&&m.mimeTypes.includes(f)||f==="application/x.".concat(m.id))return m;return null}function pHi(o,f){if(!f)return null;for(let m of o)if(typeof f=="string"){if(mHi(f,m))return m}else if(ArrayBuffer.isView(f)){if(jft(f.buffer,f.byteOffset,m))return m}else if(f instanceof ArrayBuffer&&jft(f,0,m))return m;return null}function mHi(o,f){return f.testText?f.testText(o):(Array.isArray(f.tests)?f.tests:[f.tests]).some(v=>o.startsWith(v))}function jft(o,f,m){return(Array.isArray(m.tests)?m.tests:[m.tests]).some(y=>gHi(o,f,m,y))}function gHi(o,f,m,v){if(v instanceof ArrayBuffer)return bRe(v,o,v.byteLength);switch(typeof v){case"function":return v(o,m);case"string":let y=BRe(o,f,v.length);return v===y;default:return!1}}function Jft(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:5;return typeof o=="string"?o.slice(0,f):ArrayBuffer.isView(o)?BRe(o.buffer,o.byteOffset,f):o instanceof ArrayBuffer?BRe(o,0,f):""}function BRe(o,f,m){if(o.byteLength<f+m)return"";let v=new DataView(o),y="";for(let x=0;x<m;x++)y+=String.fromCharCode(v.getUint8(f+x));return y}function*Kft(o,f){let m=f?.chunkSize||262144,v=0,y=new TextEncoder;for(;v<o.length;){let x=Math.min(o.length-v,m),C=o.slice(v,v+x);v+=x,yield y.encode(C)}}function Qft(o){let f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return function*(){let{chunkSize:m=262144}=f,v=0;for(;v<o.byteLength;){let y=Math.min(o.byteLength-v,m),x=new ArrayBuffer(y),C=new Uint8Array(o,v,y);new Uint8Array(x).set(C),v+=y,yield x}}()}async function*Zft(o,f){let m=f?.chunkSize||1048576,v=0;for(;v<o.size;){let y=v+m,x=await o.slice(v,y).arrayBuffer();v=y,yield x}}function kRe(o,f){return EJ?_Hi(o,f):vHi(o,f)}async function*_Hi(o,f){let m=o.getReader(),v;try{for(;;){let y=v||m.read();f!=null&&f._streamReadAhead&&(v=m.read());let{done:x,value:C}=await y;if(x)return;yield due(C)}}catch{m.releaseLock()}}async function*vHi(o,f){for await(let m of o)yield due(m)}function $ft(o,f){if(typeof o=="string")return Kft(o,f);if(o instanceof ArrayBuffer)return Qft(o,f);if(IA(o))return Zft(o,f);if(fue(o))return kRe(o,f);if(PA(o))return kRe(o.body,f);throw new Error("makeIterator")}var ept="Cannot convert supplied data type";function yHi(o,f,m){if(f.text&&typeof o=="string")return o;if(wft(o)&&(o=o.buffer),o instanceof ArrayBuffer){let v=o;return f.text&&!f.binary?new TextDecoder("utf8").decode(v):v}if(ArrayBuffer.isView(o)){if(f.text&&!f.binary)return new TextDecoder("utf8").decode(o);let v=o.buffer,y=o.byteLength||o.length;return(o.byteOffset!==0||y!==v.byteLength)&&(v=v.slice(o.byteOffset,o.byteOffset+y)),v}throw new Error(ept)}async function tpt(o,f,m){let v=o instanceof ArrayBuffer||ArrayBuffer.isView(o);if(typeof o=="string"||v)return yHi(o,f,m);if(IA(o)&&(o=await pue(o)),PA(o)){let y=o;return await Pft(y),f.binary?await y.arrayBuffer():await y.text()}if(fue(o)&&(o=$ft(o,m)),Cft(o)||bft(o))return ARe(o);throw new Error(ept)}function Cue(o,f){let m=ORe(),v=o||m;return typeof v.fetch=="function"?v.fetch:J4(v.fetch)?y=>IRe(y,v):f!=null&&f.fetch?f?.fetch:IRe}function ipt(o,f,m){if(m)return m;let v={fetch:Cue(f,o),...o};if(v.url){let y=K8(v.url);v.baseUrl=y,v.queryString=Tft(v.url),v.filename=X4.filename(y),v.baseUrl=X4.dirname(y)}return Array.isArray(v.loaders)||(v.loaders=null),v}function rpt(o,f){if(!f&&o&&!Array.isArray(o))return o;let m;if(o&&(m=Array.isArray(o)?o:[o]),f&&f.loaders){let v=Array.isArray(f.loaders)?f.loaders:[f.loaders];m=m?[...m,...v]:v}return m&&m.length?m:null}async function bue(o,f,m,v){ny(!v||typeof v=="object"),f&&!Array.isArray(f)&&!DJ(f)&&(v=void 0,m=f,f=void 0),o=await o,m=m||{};let y=K4(o),C=rpt(f,v),w=await Yft(o,C,m);return w?(m=Hft(m,w,C,y),v=ipt({url:y,parse:bue,loaders:C},m,v||null),await xHi(w,o,m,v)):null}async function xHi(o,f,m,v){if(yRe(o),PA(f)){let y=f,{ok:x,redirected:C,status:w,statusText:A,type:E,url:T}=y,S=Object.fromEntries(y.headers.entries());v.response={headers:S,ok:x,redirected:C,status:w,statusText:A,type:E,url:T}}if(f=await tpt(f,o,m),o.parseTextSync&&typeof f=="string")return m.dataType="text",o.parseTextSync(f,m,v,o);if(xRe(o,m))return await CRe(o,f,m,v,bue);if(o.parseText&&typeof f=="string")return await o.parseText(f,m,v,o);if(o.parse)return await o.parse(f,m,v,o);throw ny(!o.parseSync),new Error("".concat(o.id," loader - no parser found and worker is disabled"))}async function VRe(o,f,m,v){!Array.isArray(f)&&!DJ(f)&&(v=void 0,m=f,f=void 0);let y=Cue(m),x=o;return typeof o=="string"&&(x=await y(o)),IA(o)&&(x=await y(o)),await bue(x,f,m)}var Ghr=window.encodeURIComponent("{x}"),Whr=window.encodeURIComponent("{y}"),jhr=window.encodeURIComponent("{z}"),CHi="{x}",bHi="{y}",npt="{-y}",wHi="{z}",opt=`in vec3 position3DHigh;\r in vec3 position3DLow;\r in vec3 normal;\r in vec2 st;\r in vec4 color;\r in float batchId;\r out vec3 v_positionEC;\r out vec3 v_normalEC;\r out vec2 v_st;\r out vec4 v_color;\r void main()\r {\r vec4 p = czm_computePosition();\r v_positionEC = (czm_modelViewRelativeToEye * p).xyz;\r v_normalEC = czm_normal * normal;\r v_st = st;\r v_color = color;\r gl_Position = czm_modelViewProjectionRelativeToEye * p;\r }\r `,AHi=`in vec3 v_positionEC;\r in vec3 v_normalEC;\r in vec2 v_st;\r in vec4 v_color;\r \r vec4 czm_phong(vec3 toEye, czm_material material)\r {\r float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);\r if (czm_sceneMode == czm_sceneMode3D) {\r diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\r }\r float specular = czm_private_getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + czm_private_getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\r vec3 materialDiffuse = material.diffuse * 0.5;\r vec3 ambient = materialDiffuse;\r vec3 color = ambient + material.emission;\r color += materialDiffuse * diffuse;\r color += material.specular * specular;\r return vec4(color, material.alpha);\r }void main()\r {\r vec3 positionToEyeEC = -v_positionEC;\r vec3 normalEC = normalize(v_normalEC);\r #ifdef FACE_FORWARD\r normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\r #endif\r vec4 color = czm_gammaCorrect(v_color);\r czm_materialInput materialInput;\r materialInput.normalEC = normalEC;\r materialInput.positionToEyeEC = positionToEyeEC;\r materialInput.st = v_st;\r czm_material material = czm_getDefaultMaterial(materialInput);\r material.diffuse = color.rgb;\r material.alpha = color.a;\r #ifdef FLAT\r out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\r #else\r out_FragColor = czm_phong(normalize(positionToEyeEC), material);\r #endif\r }\r `;function VP(){this._spatialTransfrom=new RX,this._primitiveCollection=new w_({})}Object.defineProperties(VP.prototype,{primitiveCollection:{get:function(){return this._primitiveCollection}}});VP.prototype.update=function(o){this.primitiveCollection.update(o)};VP.prototype.processMVT=async function(o,f,m,v){if(o.level>=m.minimumLevel&&o.level<m.maximumLevel&&m.show){let y=m.url.replace(CHi,o.x).replace(bHi,o.reverseY||o.y).replace(wHi,o.level),x=o.y;y.indexOf(npt)!==-1&&(x=m._tilingScheme.getNumberOfYTilesAtLevel(o.level)-o.y-1,y=y.replace(npt,x));let C={CDN:!1,mvt:{workerUrl:Ms("ThirdParty/Workers/mvt-worker.js"),layers:m.layers,coordinates:"wgs84",tileIndex:{x:o.x,y:o.y,z:o.level}}};try{let A=await VRe(y,pRe,C);for(let E of A){if(m.layerType==="point"){if(E.geometry.type!=="Point")continue;await EHi(o.data,m,E)}else if(m.layerType==="polyline"){if(E.geometry.type!=="LineString"&&E.geometry.type!=="MultiLineString")continue;THi(o.data,m,E)}else if(m.layerType==="polygon"){if(E.geometry.type!=="Polygon"&&E.geometry.type!=="MultiPolygon")continue;SHi(o.data,m,E)}else continue;N(E.properties)?N(m._layerNameKey)&&N(E.properties[m._layerNameKey])&&m._loadLayerNames.add(E.properties[m._layerNameKey]):console.log(`${E}\u6CA1\u6709\u5C5E\u6027`)}}catch(A){console.log(A)}v.find(A=>A._guid===o.data.primitiveCollection._guid)||v.push(o.data.primitiveCollection),o.state=Ch.DONE,o.renderable=!0}else o.state=Ch.DONE,o.renderable=!0};VP.prototype.freeResources=function(){this.primitiveCollection.removeAll()};VP.freePrimitives=function(o){N(o)&&N(o.removeAll)&&o.removeAll()};async function EHi(o,f,m){if(N(m.properties)&&N(f._modelKey)&&N(m.properties[f._modelKey])){let v=f._constructorOptions;v.url=m.properties[f._modelKey],v.id=`[${m.properties[f._layerNameKey]}]-[${m.id}]`;let y=f._heightKey?m.properties[f._heightKey]:0,x=f._headingKey?m.properties[f._headingKey]:0,C=f._pitchKey?m.properties[f._pitchKey]:0,w=f._rollKey?m.properties[f._rollKey]:0,A=m.geometry.coordinates[0],E=m.geometry.coordinates[1];f._coordinates==="radians"&&(A=xe.toDegrees(A),E=xe.toDegrees(E)),o._spatialTransfrom.createFromWgs84(A,E,y,x,C,w);try{v.modelMatrix=Ee.clone(o._spatialTransfrom.modelMatrix);let T=await S_.fromGltfAsync(v);o.primitiveCollection.add(T)}catch(T){console.log(`failed to load model ${v.url} ,${T}`)}}}function THi(o,f,m,v){if(N(m.properties)){let y=f._constructorOptions,x=Z(y.lineHeight,0),C=f._colorKey?m.properties[f._colorKey]:"#ffffff";N(C)?y.material=Re.fromCssColorString(C):y.material=Re.WHITE;let w=f._clampKey?m.properties[f._clampKey]:y.clampToGround,A=w&&f._heightKey?m.properties[f._heightKey]:x,E=f._lineTypeKey?m.properties[f._lineTypeKey]:"polyline",T=f._lineWidthKey?m.properties[f._lineWidthKey]:1,S=[],M=[];zRe(m.geometry.coordinates,f._unit==="radians",S);for(let D=0;D<S.length;D+=2){let L=S[D],R=S[D+1];M.push(H.fromDegrees(L,R,A))}y.width=T,E==="polylineDash"&&(y.dash=!0),y.positions=M;let I=`[${m.properties[f._layerNameKey]}]-[${m.id}]`,P;if(y.dash?P=new M0({material:zo.fromType(zo.PolylineDashType,{color:y.material,gapColor:y.gapColor||Re.TRANSPARENT,dashLength:y.dashLength||20})}):P=new M0({material:zo.fromType(zo.PolylineOutlineType,{color:y.material,outlineColor:y.outlineColor,outlineWidth:y.outlineWidth})}),w){let D=new bU(y),L=new co({id:I,geometry:D,attributes:{color:new ea.fromColor(y.material)}}),R=new aO({id:I,geometryInstances:L,appearance:P});o.primitiveCollection.add(R)}else try{let D=new b_(y),L=new co({id:I,geometry:D,attributes:{color:new ea.fromColor(y.material)}}),R=new Ia({geometryInstances:L,appearance:P});o.primitiveCollection.add(R)}catch(D){console.log(D)}}}function SHi(o,f,m){if(N(m.properties)){let v=f._constructorOptions,y=f._colorKey?m.properties[f._colorKey]:void 0;N(y)?v.material=Re.fromCssColorString(y):v.material=Re.WHITE;let x=`[${m.properties[f._layerNameKey]}]-[${m.id}]`,C=f._extrudedHeightKey?m.properties[f._extrudedHeightKey]:void 0;N(C)&&(v.extrudedHeight=C);let w=[];zRe(m.geometry.coordinates,f._coordinates==="radians",w),v.polygonHierarchy=new ho(H.fromDegreesArray(w));let A=new Ec(v),E=new co({id:x,geometry:A,attributes:{color:new ea.fromColor(v.material)}}),T;N(v.extrudedHeight)?T=new ms({translucent:!1,vertexShaderSource:opt,fragmentShaderSource:AHi}):T=new ms({translucent:!0,vertexShaderSource:opt});let S=new Ia({geometryInstances:E,appearance:T});o.primitiveCollection.add(S)}}function zRe(o,f,m){for(let v=0;v<o.length;v++)Array.isArray(o[v])?zRe(o[v],f,m):m.push(f?xe.toDegrees(o[v]):o[v]);return m}VP.processStateMachine=function(o,f,m,v){VP.initialize(o,f,m),o.data.processMVT(o,f,m,v)};VP.initialize=function(o,f,m){let v=o.data;N(v)||(v=o.data=new VP),o.state===Ch.START&&(o.state=Ch.LOADING)};var HRe=VP;var PHi=new Di;function k_(o){o=Z(o,Z.EMPTY_OBJECT),this._tilingScheme=Z(o.tilingScheme,new Bd),this._quadtree=void 0,this._mvtLayer=void 0,this._normalTile=16,this._levelZeroMaximumError=s4.computeDefaultLevelZeroMaximumGeometricError(this._tilingScheme),this.cartographicLimitRectangle=Di.clone(Di.MAX_VALUE),this._clippingPlanes=void 0,this._primitivesToDestroy=[]}Object.setPrototypeOf(k_.prototype,s4.prototype);Object.defineProperties(k_.prototype,{ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._tilingScheme}},quadtree:{get:function(){return this._quadtree},set:function(o){this._quadtree=o}}});k_.prototype.initialize=function(o){};k_.prototype.canRefine=function(o,f){return o.level<=this._normalTile+1};k_.prototype.update=function(o){if(!(!N(this._mvtLayer)||!this._mvtLayer.show)&&(this._quadtree.beginFrame(o),this._quadtree.render(o),this._quadtree.endFrame(o),this._quadtree._tilesToRender))for(let f=0,m=this._quadtree._tilesToRender.length,v;f<m;f++)v=this._quadtree._tilesToRender[f],v.data&&v.data.update(o)};k_.prototype.updateForPick=function(o){};k_.prototype.loadTile=function(o,f){f.state===Ch.START&&HRe.processStateMachine(f,o,this._mvtLayer,this._primitivesToDestroy)};k_.prototype.beginUpdate=function(o){};k_.prototype.endUpdate=function(o){};k_.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumError/(1<<o)};k_.prototype.computeTileVisibility=function(o,f,m){let v=this.computeDistanceToTile(o,f);if(o._distance=v,f.fog.enabled&&xe.fog(v,f.fog.density)>=1)return Bl.NONE;let y=o.data,x=y.tileBoundingRegion;if(y.boundingVolumeSourceTile===void 0)return Bl.PARTIAL;let C=f.cullingVolume,w=y.orientedBoundingBox;w||(w=x.boundingSphere),y.clippedByBoundaries=!1;let A=LHi(o.rectangle,this.cartographicLimitRectangle),E=Di.simpleIntersection(A,o.rectangle,PHi);if(!E)return Bl.NONE;if(Di.equals(E,o.rectangle)||(y.clippedByBoundaries=!0),!w)return Bl.PARTIAL;let T=this._clippingPlanes;T&&T.enabled;let S,M=C.computeVisibility(w);if(M===La.OUTSIDE?S=Bl.NONE:M===La.INTERSECTING?S=Bl.PARTIAL:M===La.INSIDE&&(S=Bl.FULL),S===Bl.NONE)return S;let I=f.mode===_i.SCENE3D&&f.camera.frustum instanceof Gs;if(f.mode===_i.SCENE3D&&!I&&N(m)){let P=y.occludeePointInScaledSpace;return!P||m.ellipsoid.isScaledSpacePointVisible(P)?S:Bl.NONE}return S};k_.prototype.computeTileLoadPriority=function(o,f){return 0};k_.prototype.showTileThisFrame=function(o,f){};k_.prototype.computeDistanceToTile=function(o,f){let m=OHi(this._mvtLayer,o,this._maximumHeight,this._minimumHeight),v=o.data,y=v.tileBoundingRegion;if(N(m)){if(v.boundingVolumeSourceTile!==m){v.boundingVolumeSourceTile=m;let A=o.rectangle;A&&A.width<xe.PI_OVER_TWO+xe.EPSILON5&&(v.orientedBoundingBox=fc.fromRectangle(o.rectangle,y.minimumHeight,y.maximumHeight,o.tilingScheme.ellipsoid,v.orientedBoundingBox),v.occludeePointInScaledSpace=RHi(this,v.orientedBoundingBox.center,o.rectangle,y.maximumHeight,v.occludeePointInScaledSpace))}}else return 9999999999;let x=y.minimumHeight,C=y.maximumHeight;if(v.boundingVolumeSourceTile!==o){let A=f.camera.positionCartographic.height,E=xe.abs(A-x),T=xe.abs(A-C);E>T?(y.minimumHeight=x,y.maximumHeight=x):(y.minimumHeight=C,y.maximumHeight=C)}let w=y.distanceToCamera(f);return y.minimumHeight=x,y.maximumHeight=C,w};k_.prototype.isDestroyed=function(){console.log("MVTTileProvider isDestroyed!!!")};k_.prototype.destroy=function(){console.log("MVTTileProvider destroy!!!")};var IHi=new Di,MHi=new Di,DHi=[new H,new H,new H,new H];function LHi(o,f){if(f.west<f.east)return f;let m=Di.clone(f,IHi);return Di.center(o,MHi).longitude>0?m.east=xe.PI:m.west=-xe.PI,m}function RHi(o,f,m,v,y){let x=o.quadtree._occluders.ellipsoid,C=x.ellipsoid,w=DHi;return H.fromRadians(m.west,m.south,v,C,w[0]),H.fromRadians(m.east,m.south,v,C,w[1]),H.fromRadians(m.west,m.north,v,C,w[2]),H.fromRadians(m.east,m.north,v,C,w[3]),x.computeHorizonCullingPoint(f,w,y)}function OHi(o,f,m,v){let y=f.data;N(y)||(y=f.data=new HRe),f._minimumHeight&&(v=f._minimumHeight),f._maximumHeight&&(m=f._maximumHeight);let x=f.tilingScheme.ellipsoid;return N(y.tileBoundingRegion)||(y.tileBoundingRegion=new rT({computeBoundingVolumes:!1,rectangle:f.rectangle,ellipsoid:x,minimumHeight:v||0,maximumHeight:m||0})),f}var apt=k_;function eG(o,f){if(!N(o))throw new li("viewer \u5FC5\u9700\u4F20\u503C");if(this._viewer=o,f=Z(f,Z.EMPTY_OBJECT),!N(f.url))throw new li("options.url \u5FC5\u9700\u4F20\u503C");this._tilingScheme=Z(f.tilingScheme,new Mm),this._url=f.url,this._minimumLevel=Z(f.minimumLevel,0),this._maximumLevel=Z(f.maximumLevel,Number.POSITIVE_INFINITY),this._layers=Z(f.layers,void 0),this._layerType=Z(f.type,"point"),this._unit=Z(f.unit,"degrees"),this._layerNameKey=Z(f.layerNameKey,void 0),this._modelKey=Z(f.modelKey,void 0),this._extrudedHeightKey=Z(f.extrudedHeightKey,void 0),this._clampKey=Z(f.clampKey,void 0),this._colorKey=Z(f.colorKey,void 0),this._heightKey=Z(f.heightKey,void 0),this._headingKey=Z(f.headingKey,void 0),this._pitchKey=Z(f.pitchKey,void 0),this._rollKey=Z(f.rollKey,void 0),this._lineWidthKey=Z(f.lineWidthKey,void 0),this._lineTypeKey=Z(f.lineTypeKey,void 0),this._tileProvider=new apt({tilingScheme:this._tilingScheme,minimumLevel:this._minimumLevel,maximumLevel:this._maximumLevel}),this._tileProvider._mvtLayer=this,this._quadtreePrimitive=new hb({tileProvider:this._tileProvider}),this._show=Z(f.show,!0),this._loadLayerNames=new Set,this._constructorOptions=Z(f.constructorOptions,Z.EMPTY_OBJECT)}Object.defineProperties(eG.prototype,{show:{get:function(){return this._show},set:function(o){this._show=o}},quadtreePrimitive:{get:function(){return this._quadtreePrimitive}},minimumLevel:{get:function(){return this._minimumLevel},set:function(o){this._minimumLevel=o}},maximumLevel:{get:function(){return this._maximumLevel},set:function(o){this._maximumLevel=o}},url:{get:function(){return this._url}},layers:{get:function(){return this._layers}},layerType:{get:function(){return this._layerType}}});eG.prototype.addToMap=function(){this._viewer.scene.primitives.add(this._quadtreePrimitive)};eG.prototype.addSurfaceTile=function(o){};eG.prototype.removeFromMap=function(){this._viewer.scene.primitives.remove(this._quadtreePrimitive)};eG.prototype.getLoadLayerNames=function(){return Array.from(this._loadLayerNames)};var spt=eG;function wue(o,f,m){return this.earthCtrl=o,this.Viewer=f,this}wue.prototype.showGraticules=function(o){this.graticules&&(this.graticules.enabled=o)};wue.prototype.update=function(){let o=this;this.Viewer.scene.preUpdate.addEventListener(function(){o.graticules.update()})};wue.prototype.createGraticules=function(o){return this.graticules=new Gre(this.Viewer,{lineColor:Re.PALEGREEN,fontColor:Re.PALEGREEN}),this.update(),this};var lpt=wue;function URe(o,f,m){return this.earthCtrl=o,this.Viewer=f,this.material=null,this.clipPlane=null,this}URe.prototype.showContourLabel=function(o){this.material&&this.clipPlane&&(o?(this.Viewer.scene.globe.clipPlanes=this.clipPlane,this.Viewer.scene.globe.material=this.material):(this.Viewer.scene.globe.clipPlanes=[],this.Viewer.scene.globe.material=null))};URe.prototype.createContourLabel=function(o){o||(o={});let f=o.contourSpacing||500,m=o.contourWidth||1,v=o.contourColor||new Re(0,1,0,1),y=o.minHeight||-1e3,x=o.maxHeight||8848,C=o.font||"Arial",w=o.fontSize||20,A=o.fontColor||"#5151F1",E=o.minShowLevel||10,T=zo.fromType("ElevationContour"),S=T.uniforms;S.width=m,S.spacing=f,S.color=v,this.material=T;let M=[];for(let I=y;I<x;I+=f)M.push({plane:new $a(new H(0,0,-1),I),font:C,fontSize:w,fontColor:A,minShowLevel:E});return this.clipPlane=M,this};var upt=URe;function GRe(o,f,m){return this.earthCtrl=o,this.Viewer=f,this}GRe.prototype.createRegionWeather=function(o){if(!o||!o.position||!o.radius)return this;let f=o.position,m=o.radius,v=o.primitive;return this.regionWeather=new _ae(this.Viewer.scene,v,f,m),this};Object.defineProperties(GRe.prototype,{enableWeatherType:{set:function(o){N(this.regionWeather)&&(this.regionWeather.enableWeatherType=o)}},fogHeight:{set:function(o){N(this.regionWeather)&&(this.regionWeather.fogHeight=o)}},regionAlpha:{set:function(o){N(this.regionWeather)&&(this.regionWeather.regionAlpha=o)}},regionGradientDistance:{set:function(o){N(this.regionWeather)&&(this.regionWeather.regionGradientDistance=o)}}});var cpt=GRe;function tG(o){return this.scene=o,this.slopeArrow=null,this}tG.prototype.setPositions=function(o){this.slopeArrow&&this.slopeArrow.setPositions(o)};tG.prototype.setColorsAndAngles=function(o,f){this.slopeArrow&&this.slopeArrow.setColorsAndAngles(o,f)};tG.prototype.setSlopeType=function(o){this.slopeArrow&&(this.slopeArrow.slopeType=o)};tG.prototype.setRegionEnabled=function(o){this.slopeArrow&&(this.slopeArrow.regionEnabled=o)};tG.prototype.createSlopeArrow=function(o){return this.slopeArrow||(this.slopeArrow=new Cae(this.scene)),this};var hpt=tG;function NHi(){return new zo({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1})}function FHi(){return new zo({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1})}function BHi(){return new zo({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1})}var kHi=[0,.1,.15,.2,.25,.3,.35,.4,.45,.5,.55,.6,.65,.7,.75,.8,.85,.9,1],VHi=["#0F3C72","#1F65A1","#2F9655","#3C8EB9","#345C35","#4AC9B4","#5C7B25","#6FBE3D","#8C6AC3","#823B3E","#961862","#C436BE","#CAB84F","#D82B2A","#DB7FB1","#E8B7D9","#F0AD56","#F2CC45"];function zHi(o,f){let m=o||VHi,v=f||kHi,y=document.createElement("canvas");y.width=100,y.height=1;let x=y.getContext("2d"),C=x.createLinearGradient(0,0,100,0);for(let w=0;w<m.length;w++){let A=m[w],E=v[w];C.addColorStop(E,A)}return x.fillStyle=C,x.fillRect(0,0,100,1),y}var $4={},KT={};function HHi(o,f,m,v,y){let x=o,C=f||!1,w=m.minHeight,A=m.maxHeight,E=m.contourColor,T=m.contourSpacing,S=m.contourWidth,M;return C?(x==="elevation"?(M=NHi(),KT=M.materials.elevationRampMaterial.uniforms,KT.minimumHeight=w,KT.maximumHeight=A,$4=M.materials.contourMaterial.uniforms):x==="slope"?(M=FHi(),KT=M.materials.slopeRampMaterial.uniforms,$4=M.materials.contourMaterial.uniforms):x==="aspect"?(M=BHi(),KT=M.materials.aspectRampMaterial.uniforms,$4=M.materials.contourMaterial.uniforms):(M=zo.fromType("ElevationContour"),$4=M.uniforms),$4.width=S,$4.spacing=T,$4.color=E):x==="elevation"?(M=zo.fromType("ElevationRamp"),KT=M.uniforms,KT.minimumHeight=w,KT.maximumHeight=A):x==="slope"?(M=zo.fromType("SlopeRamp"),KT=M.uniforms):x==="aspect"&&(M=zo.fromType("AspectRamp"),KT=M.uniforms),x!=="none"&&(KT.image=zHi(v,y)),M}function ZD(o){return this.scene=o,this._type="elevation",this._colors=null,this._angles=null,this._contourInfo={minHeight:0,maxHeight:1e4,contourColor:Re.RED.clone(),contourSpacing:150,contourWidth:2},this}ZD.prototype.setAngleColors=function(o,f){if(!o||!(o instanceof Array)){console.error('colors \u5FC5\u987B\u662F\u4E00\u4E2AHEX\u989C\u8272\u6570\u7EC4["#123456", "#123456", ...]');return}if(!f||!(f instanceof Array)){console.error("anlges \u5FC5\u987B\u662F\u4E00\u4E2A\u5F27\u5EA6\u6570\u7EC4[1/PI, 2/PI, ...]");return}if(o.length!==f.length){console.error("colors\u6570\u91CF\u5FC5\u987B\u4E0Eanlges\u6570\u91CF\u76F8\u540C");return}this._colors=o,this._angles=f};ZD.prototype.setContourInfo=function(o){this._contourInfo.minHeight=o.minHeight||0,this._contourInfo.maxHeight=o.maxHeight||1e4,this._contourInfo.contourColor=o.contourColor||Re.RED.clone(),this._contourInfo.contourSpacing=o.contourSpacing||150,this._contourInfo.contourWidth=o.contourWidth||2};ZD.prototype.setType=function(o){this._type!==o&&(this._type=o)};ZD.prototype.update=function(o){let f=this.scene.globe,m=HHi(this._type,o,this._contourInfo,this._colors,this._angles);f.material=m};ZD.prototype.setPositions=function(o){if(o&&o instanceof Array){let f=this.scene.globe;f.regionPositions=o;return}console.error("position \u5FC5\u987B\u662F\u4E00\u4E2A\u7ECF\u7EAC\u5EA6\u6570\u7EC4[longitude0, latitude0, longitude1, latitude1,...]")};ZD.prototype.setRegionEnabled=function(o){let f=this.scene.globe;f.slopeRegionTextureEnable=o};ZD.prototype.createRegionTerrain=function(o){return this};ZD.prototype.closeRegionTerrain=function(o){let f=this.scene.globe;f.material=null,f.regionEnabled=!1};var dpt=ZD;function ff(){this.imagery=[],this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new H,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Ls.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new Pi,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1,this._primitiveCollection=new w_}Object.defineProperties(ff.prototype,{eligibleForUnloading:{get:function(){let o=this.terrainState,m=!(o===Ls.RECEIVING||o===Ls.TRANSFORMING),v=this.imagery;for(let y=0,x=v.length;m&&y<x;++y){let C=v[y];m=!N(C.loadingImagery)||C.loadingImagery.state!==kl.TRANSITIONING}return m}},renderedMesh:{get:function(){if(N(this.vertexArray))return this.mesh;if(N(this.fill))return this.fill.mesh}},primitiveCollection:{get:function(){return this._primitiveCollection}}});var UHi=new Mt;function WRe(o,f,m,v,y,x){let C=o.getExaggeratedPosition(v,y,x);if(N(f)&&f!==_i.SCENE3D){let A=m.ellipsoid.cartesianToCartographic(C,UHi);C=m.project(A,x),C=H.fromElements(C.z,C.x,C.y,x)}return C}var GHi=new H,WHi=new H,jHi=new H;ff.prototype.pick=function(o,f,m,v,y){let x=this.renderedMesh;if(!N(x))return;let C=x.vertices,w=x.indices,A=x.encoding,E=w.length,T=Number.MAX_VALUE;for(let S=0;S<E;S+=3){let M=w[S],I=w[S+1],P=w[S+2],D=WRe(A,f,m,C,M,GHi),L=WRe(A,f,m,C,I,WHi),R=WRe(A,f,m,C,P,jHi),O=Hh.rayTriangleParametric(o,D,L,R,v);N(O)&&O<T&&O>=0&&(T=O)}return T!==Number.MAX_VALUE?_s.getPoint(o,T,y):void 0};ff.prototype.freeResources=function(){this.terrainData=void 0,this.terrainState=Ls.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let o=this.imagery;for(let f=0,m=o.length;f<m;++f)o[f].freeResources();this.imagery.length=0,this.freeVertexArray(),this.primitiveCollection.removeAll()};ff.prototype.freeVertexArray=function(){ff._freeVertexArray(this.vertexArray),this.vertexArray=void 0,ff._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};ff.initialize=function(o,f,m){let v=o.data;N(v)||(v=o.data=new ff),o.state===Ch.START&&(YHi(o,f,m),o.state=Ch.LOADING)};ff.processStateMachine=function(o,f,m,v,y,x,C){ff.initialize(o,m,v);let w=o.data;if(o.state===Ch.LOADING&&qHi(o,f,m,v,y,x),C)return;let A=o.renderable;o.renderable=!0;let E=w.terrainState===Ls.READY;o.upsampledFromParent=N(w.terrainData)&&w.terrainData.wasCreatedByUpsampling();let T=w.processImagery(o,m,f);if(E&&T){let S=o._loadedCallbacks,M={};for(let I in S)S.hasOwnProperty(I)&&(S[I](o)||(M[I]=S[I]));o._loadedCallbacks=M,o.state=Ch.DONE}if(A){if(o.data&&o.data.imagery)for(let S=0;S<o.data.imagery.length;S++){let M=o.data.imagery[S];if(M.readyImagery&&o.data.primitiveCollection._primitives.length===0){let I=M.useWebMercatorT?M.readyImagery.textureWebMercator:M.readyImagery.texture;if(I){let P=new co({geometry:new GB({rectangle:M.readyImagery.rectangle})}),D=new md({material:new zo({fabric:{type:"myMaterial",uniforms:{image:"czm_defaultImage"},source:` czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); // \u83B7\u53D6\u7EB9\u7406\u5750\u6807 vec2 st = materialInput.st; vec4 colorImage = texture(image, st); material.alpha = colorImage.a; material.diffuse = colorImage.rgb; return material; }`}})});D.material._uniforms.image_0=function(){return I};let L=new Zw({geometryInstances:P,appearance:D});o.data.primitiveCollection.add(L)}}}o.renderable=!0}};ff.prototype.processImagery=function(o,f,m,v){let y=o.data,x=o.upsampledFromParent,C=!1,w=!0,A=y.imagery,E,T;for(E=0,T=A.length;E<T;++E){let S=A[E];if(!N(S.loadingImagery)){x=!1;continue}if(S.loadingImagery.state===kl.PLACEHOLDER){let I=S.loadingImagery.imageryLayer;if(I.ready){S.freeResources(),A.splice(E,1),I._createTileImagerySkeletons(o,f,E),--E,T=A.length;continue}else x=!1}let M=S.processStateMachine(o,m,v);w=w&&M,C=C||M||N(S.readyImagery),x=x&&defined(S.loadingImagery)&&(S.loadingImagery.state===ImageryState.FAILED||S.loadingImagery.state===ImageryState.INVALID)}return o.upsampledFromParent=x,o.renderable=o.renderable&&(C||w),w};ff.prototype.update=function(o){this.primitiveCollection.update(o)};function fpt(o,f,m,v){let y=o.renderedMesh,x=y.vertices,C=y.encoding,w=x.length/C.stride,A=Hw.clone(C);A.hasGeodeticSurfaceNormals=f,A=Hw.clone(A);let E=A.stride,T=new Float32Array(w*E);f?C.addGeodeticSurfaceNormals(x,T,m):C.removeGeodeticSurfaceNormals(x,T),y.vertices=T,y.stride=E,y!==o.mesh?(ff._freeVertexArray(o.fill.vertexArray),o.fill.vertexArray=ff._createVertexArrayForMesh(v.context,y)):(ff._freeVertexArray(o.vertexArray),o.vertexArray=ff._createVertexArrayForMesh(v.context,y)),ff._freeVertexArray(o.wireframeVertexArray),o.wireframeVertexArray=void 0}ff.prototype.addGeodeticSurfaceNormals=function(o,f){fpt(this,!0,o,f)};ff.prototype.removeGeodeticSurfaceNormals=function(o){fpt(this,!1,void 0,o)};ff.prototype.updateExaggeration=function(o,f,m){let v=this,y=v.renderedMesh;if(y===void 0)return;let x=f.terrainExaggeration,C=f.terrainExaggerationRelativeHeight,w=x!==1,A=y.encoding,E=A.exaggeration!==x,T=A.exaggerationRelativeHeight!==C;if(E||T){if(E)if(w&&!A.hasGeodeticSurfaceNormals){let S=o.tilingScheme.ellipsoid;v.addGeodeticSurfaceNormals(S,f)}else!w&&A.hasGeodeticSurfaceNormals&&v.removeGeodeticSurfaceNormals(f);if(A.exaggeration=x,A.exaggerationRelativeHeight=C,m!==void 0){m._tileToUpdateHeights.push(o);let S=o.customData,M=S.length;for(let I=0;I<M;I++){let P=S[I];P.level=-1}}}};function YHi(o,f,m){let v=f.getTileDataAvailable(o.x,o.y,o.level);if(!N(v)&&N(o.parent)){let x=o.parent,C=x.data;N(C)&&N(C.terrainData)&&(v=C.terrainData.isChildAvailable(x.x,x.y,o.x,o.y))}v===!1&&(o.data.terrainState=Ls.FAILED);let y=m;y.show&&y._createTileImagerySkeletons(o,f)}function qHi(o,f,m,v,y,x){let C=o.data,w=o.parent;C.terrainState===Ls.FAILED&&w!==void 0&&(w.data!==void 0&&w.data.terrainData!==void 0&&w.data.terrainData.canUpsample!==!1||ff.processStateMachine(w,f,m,v,y,x,!0)),C.terrainState===Ls.FAILED&&XHi(C,o,f,m,o.x,o.y,o.level),C.terrainState===Ls.UNLOADED&&JHi(C,m,o.x,o.y,o.level),C.terrainState===Ls.RECEIVED&&QHi(C,f,m,o.x,o.y,o.level),C.terrainState===Ls.TRANSFORMED&&(ZHi(C,f.context,m,o.x,o.y,o.level,x),C.updateExaggeration(o,f,y))}function XHi(o,f,m,v,y,x,C){let w=f.parent;if(!w){f.state=Ch.FAILED;return}let A=w.data.terrainData,E=w.x,T=w.y,S=w.level;if(!N(A))return;let M=A.upsample(v.tilingScheme,E,T,S,y,x,C);!N(M)||(o.terrainState=Ls.RECEIVING,Promise.resolve(M).then(function(I){!N(I)||(o.terrainData=I,o.terrainState=Ls.RECEIVED)}).catch(function(){o.terrainState=Ls.FAILED}))}function JHi(o,f,m,v,y){function x(A){if(!N(A)){o.terrainState=Ls.UNLOADED,o.request=void 0;return}o.terrainData=A,o.terrainState=Ls.RECEIVED,o.request=void 0}function C(A){if(o.request.state===bc.CANCELLED){o.terrainData=void 0,o.terrainState=Ls.UNLOADED,o.request=void 0;return}o.terrainState=Ls.FAILED,o.request=void 0;let E=`Failed to obtain terrain tile X: ${m} Y: ${v} Level: ${y}. Error message: "${A}"`;f._requestError=ld.reportError(f._requestError,f,f.errorEvent,E,m,v,y),f._requestError.retry&&w()}function w(){let A=new cg({throttle:!1,throttleByServer:!0,type:Qy.TERRAIN});o.request=A;let E=f.requestTileGeometry(m,v,y,A);N(E)?(o.terrainState=Ls.RECEIVING,Promise.resolve(E).then(function(T){x(T)}).catch(function(T){C(T)})):(o.terrainState=Ls.UNLOADED,o.request=void 0)}w()}var KHi={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function QHi(o,f,m,v,y,x){let C=m.tilingScheme,w=KHi;w.tilingScheme=C,w.x=v,w.y=y,w.level=x,w.exaggeration=f.terrainExaggeration,w.exaggerationRelativeHeight=f.terrainExaggerationRelativeHeight,w.throttle=!0;let E=o.terrainData.createMesh(w);!N(E)||(o.terrainState=Ls.TRANSFORMING,Promise.resolve(E).then(function(T){o.mesh=T,o.terrainState=Ls.TRANSFORMED}).catch(function(){o.terrainState=Ls.FAILED}))}ff._createVertexArrayForMesh=function(o,f){let m=f.vertices,v=Ao.createVertexBuffer({context:o,typedArray:m,usage:gn.STATIC_DRAW}),y=f.encoding.getAttributes(v),x=f.indices.indexBuffers||{},C=x[o.id];if(!N(C)||C.isDestroyed()){let w=f.indices;C=Ao.createIndexBuffer({context:o,typedArray:w,usage:gn.STATIC_DRAW,indexDatatype:ro.fromSizeInBytes(w.BYTES_PER_ELEMENT)}),C.vertexArrayDestroyable=!1,C.referenceCount=1,x[o.id]=C,f.indices.indexBuffers=x}else++C.referenceCount;return new Du({context:o,attributes:y,indexBuffer:C})};ff._freeVertexArray=function(o){if(N(o)){let f=o.indexBuffer;o.isDestroyed()||o.destroy(),N(f)&&!f.isDestroyed()&&N(f.referenceCount)&&(--f.referenceCount,f.referenceCount===0&&f.destroy())}};function ZHi(o,f,m,v,y,x,C){o.vertexArray=ff._createVertexArrayForMesh(f,o.mesh),o.terrainState=Ls.READY,o.fill=o.fill&&o.fill.destroy(C)}ff.prototype._findAncestorTileWithTerrainData=function(o){let f=o.parent;for(;N(f)&&(!N(f.data)||!N(f.data.terrainData)||f.data.terrainData.wasCreatedByUpsampling());)f=f.parent;return f};var LJ=ff;var $Hi=new Di;function J0(o={}){this._imageryLayer=o.imageryProvider,this._ellipsoid=Z(o.ellipsoid,ki.WGS84),this._terrainProvider=new AT({ellipsoid:this._ellipsoid,tilingScheme:o.tilingScheme}),this._quadtree=void 0,this.cartographicLimitRectangle=Di.clone(Di.MAX_VALUE),this._tilesToRenderByTextureCount=[],this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._vertexArraysToDestroy=[],this._levelArray=[],this._show=Z(o.show,!0)}Object.setPrototypeOf(J0.prototype,s4.prototype);Object.defineProperties(J0.prototype,{ready:{get:function(){return!0}},tilingScheme:{get:function(){return this._terrainProvider.tilingScheme}},quadtree:{get:function(){return this._quadtree},set:function(o){this._quadtree=o}},terrainProvider:{get:function(){return this._terrainProvider}},imageryLayer:{get:function(){return this._imageryLayer}}});J0.prototype.initialize=function(o){let f=this._vertexArraysToDestroy,m=f.length;for(let v=0;v<m;++v)LJ._freeVertexArray(f[v]);f.length=0};J0.prototype.canRefine=function(o,f){return N(o.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(o.x*2,o.y*2,o.level+1)!==void 0};J0.prototype.update=function(o){this._show&&(this._quadtree.beginFrame(o),this._quadtree.render(o),this._quadtree.endFrame(o))};J0.prototype.updateForPick=function(o){};J0.prototype.loadTile=function(o,f){let m=f.data,v=!0,y;N(m)&&(v=m.boundingVolumeSourceTile!==f||f._lastSelectionResult===ba.CULLED_BUT_NEEDED,y=m.terrainState),LJ.processStateMachine(f,o,this.terrainProvider,this._imageryLayer,this.quadtree,this._vertexArraysToDestroy,v),m=f.data,v&&y!==f.data.terrainState&&this.computeTileVisibility(f,o,this.quadtree.occluders)!==Bl.NONE&&m.boundingVolumeSourceTile===f&&(v=!1,LJ.processStateMachine(f,o,this.terrainProvider,this._imageryLayer,this.quadtree,this._vertexArraysToDestroy,v))};J0.prototype.beginUpdate=function(o){let f=this._tilesToRenderByTextureCount;for(let m=0,v=f.length;m<v;++m){let y=f[m];N(y)&&(y.length=0)}this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};J0.prototype.endUpdate=function(o){let f=this._tilesToRenderByTextureCount;for(let m=0,v=f.length;m<v;++m){let y=f[m];if(!!N(y))for(let x=0;x<y.length;++x){let C=y[x],w=C.data.tileBoundingRegion;lUi(this,C,o),o.minimumTerrainHeight=Math.min(o.minimumTerrainHeight,w.minimumHeight)}}};J0.prototype.getLevelMaximumGeometricError=function(o){return N(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(o):0};J0.prototype.computeTileVisibility=function(o,f,m){let v=this.computeDistanceToTile(o,f);if(o._distance=v,f.fog.enabled&&xe.fog(v,f.fog.density)>=1)return Bl.NONE;let y=o.data,x=y.tileBoundingRegion;if(y.boundingVolumeSourceTile===void 0)return Bl.PARTIAL;let C=f.cullingVolume,w=y.orientedBoundingBox;w||(w=x.boundingSphere),y.clippedByBoundaries=!1;let A=oUi(o.rectangle,this.cartographicLimitRectangle),E=Di.simpleIntersection(A,o.rectangle,$Hi);if(!E)return Bl.NONE;if(Di.equals(E,o.rectangle)||(y.clippedByBoundaries=!0),!w)return Bl.PARTIAL;let T,S=C.computeVisibility(w);if(S===La.OUTSIDE?T=Bl.NONE:S===La.INTERSECTING?T=Bl.PARTIAL:S===La.INSIDE&&(T=Bl.FULL),T===Bl.NONE)return T;let M=f.mode===_i.SCENE3D&&f.camera.frustum instanceof Gs;if(f.mode===_i.SCENE3D&&!M&&N(m)){let I=y.occludeePointInScaledSpace;return!N(I)||m.ellipsoid.isScaledSpacePointVisible(I)?T:Bl.NONE}return T};var eUi=new H;J0.prototype.computeTileLoadPriority=function(o,f){let m=o.data;if(m===void 0)return 0;let v=m.tileBoundingRegion.boundingVolume;if(v===void 0)return 0;let y=f.camera.positionWC,x=f.camera.directionWC,C=H.subtract(v.center,y,eUi),w=H.magnitude(C);return w<xe.EPSILON5?0:(H.divideByScalar(C,w,C),(1-H.dot(C,x))*o._distance)};var tUi=[],iUi=[];J0.prototype.canRenderWithoutLosingDetail=function(o,f){let m=o.data,v=tUi;v.length=1;let y=!1,x=!1,C;N(m)&&(y=m.terrainState===Ls.READY,x=!0,C=m.imagery);let w,A;if(v[0]=x,N(C))for(w=0,A=C.length;w<A;++w){let S=C[w],M=S.loadingImagery,I=!N(M)||M.state===kl.FAILED||M.state===kl.INVALID,P=(S.loadingImagery||S.readyImagery).imageryLayer._layerIndex;v[P]=I&&v[P]}let E=this.quadtree._lastSelectionFrameNumber,T=iUi;for(T.length=0,T.push(o.southwestChild,o.southeastChild,o.northwestChild,o.northeastChild);T.length>0;){let S=T.pop(),M=S._lastSelectionResultFrame===E?S._lastSelectionResult:ba.NONE;if(M===ba.RENDERED){let I=S.data;if(!N(I))continue;if(!y&&S.data.terrainState===Ls.READY)return!1;let P=S.data.imagery;for(w=0,A=P.length;w<A;++w){let D=P[w],L=D.loadingImagery,R=!N(L)||L.state===kl.FAILED||L.state===kl.INVALID,O=(D.loadingImagery||D.readyImagery).imageryLayer._layerIndex;if(R&&!v[O])return!1}}else M===ba.REFINED&&T.push(S.southwestChild,S.southeastChild,S.northwestChild,S.northeastChild)}return!0};J0.prototype.showTileThisFrame=function(o,f){let m=0,v=o.data.imagery;for(let C=0,w=v.length;C<w;++C){let A=v[C];N(A.readyImagery)&&A.readyImagery.imageryLayer.alpha!==0&&++m}let y=this._tilesToRenderByTextureCount[m];N(y)||(y=[],this._tilesToRenderByTextureCount[m]=y),y.push(o);let x=o.data;N(x.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0};J0.prototype.computeDistanceToTile=function(o,f){sUi(o,this,f);let m=o.data;if(m.boundingVolumeSourceTile===void 0)return 9999999999;let y=m.tileBoundingRegion,x=y.minimumHeight,C=y.maximumHeight;if(m.boundingVolumeSourceTile!==o){let A=f.camera.positionCartographic.height,E=Math.abs(A-x),T=Math.abs(A-C);E>T,y.minimumHeight=x,y.maximumHeight=C}let w=y.distanceToCamera(f);return y.minimumHeight=x,y.maximumHeight=C,w};J0.prototype.isDestroyed=function(){};J0.prototype.destroy=function(){};var rUi=new Di,nUi=new Di;function oUi(o,f){if(f.west<f.east)return f;let m=Di.clone(f,rUi);return Di.center(o,nUi).longitude>0?m.east=xe.PI:m.west=-xe.PI,m}var aUi=[new H,new H,new H,new H];function ppt(o,f,m,v,y,x){let C=o.quadtree._occluders.ellipsoid,w=C.ellipsoid,A=aUi;return H.fromRadians(m.west,m.south,y,w,A[0]),H.fromRadians(m.east,m.south,y,w,A[1]),H.fromRadians(m.west,m.north,y,w,A[2]),H.fromRadians(m.east,m.north,y,w,A[3]),C.computeHorizonCullingPointPossiblyUnderEllipsoid(f,A,v,x)}function sUi(o,f,m){let v=o.data;v===void 0&&(v=o.data=new LJ);let y=o.tilingScheme.ellipsoid;v.tileBoundingRegion===void 0&&(v.tileBoundingRegion=new rT({computeBoundingVolumes:!1,rectangle:o.rectangle,ellipsoid:y,minimumHeight:0,maximumHeight:0}));let x=v.tileBoundingRegion,C=x.minimumHeight,w=x.maximumHeight,A=!1,E=o,T=v.mesh,S=v.terrainData;if(T!==void 0&&T.minimumHeight!==void 0&&T.maximumHeight!==void 0)x.minimumHeight=T.minimumHeight,x.maximumHeight=T.maximumHeight,A=!0;else if(S!==void 0&&S._minimumHeight!==void 0&&S._maximumHeight!==void 0)x.minimumHeight=S._minimumHeight,x.maximumHeight=S._maximumHeight;else{x.minimumHeight=Number.NaN,x.maximumHeight=Number.NaN;let M=o.parent;for(;M!==void 0;){let I=M.data;if(I!==void 0){let P=I.mesh,D=I.terrainData;if(P!==void 0&&P.minimumHeight!==void 0&&P.maximumHeight!==void 0){x.minimumHeight=P.minimumHeight,x.maximumHeight=P.maximumHeight;break}else if(D!==void 0&&D._minimumHeight!==void 0&&D._maximumHeight!==void 0){x.minimumHeight=D._minimumHeight,x.maximumHeight=D._maximumHeight;break}}M=M.parent}E=M}if(E!==void 0){let M=m.terrainExaggeration,I=m.terrainExaggerationRelativeHeight;if(M!==1&&(A=!1,x.minimumHeight=V1.getHeight(x.minimumHeight,M,I),x.maximumHeight=V1.getHeight(x.maximumHeight,M,I)),A)v.boundingVolumeIsFromMesh||(x._orientedBoundingBox=fc.clone(T.orientedBoundingBox,x._orientedBoundingBox),x._boundingSphere=Pi.clone(T.boundingSphere3D,x._boundingSphere),v.occludeePointInScaledSpace=H.clone(T.occludeePointInScaledSpace,v.occludeePointInScaledSpace),N(v.occludeePointInScaledSpace)||(v.occludeePointInScaledSpace=ppt(f,x._orientedBoundingBox.center,o.rectangle,x.minimumHeight,x.maximumHeight,v.occludeePointInScaledSpace)));else{let D=x._orientedBoundingBox===void 0||x._boundingSphere===void 0;(x.minimumHeight!==C||x.maximumHeight!==w||D)&&(x.computeBoundingVolumes(y),v.occludeePointInScaledSpace=ppt(f,x._orientedBoundingBox.center,o.rectangle,x.minimumHeight,x.maximumHeight,v.occludeePointInScaledSpace))}v.boundingVolumeSourceTile=E,v.boundingVolumeIsFromMesh=A}else v.boundingVolumeSourceTile=void 0,v.boundingVolumeIsFromMesh=!1}function lUi(o,f,m){f.data.primitiveCollection.update(m)}var mpt=J0;function RJ(o,f={}){if(!N(o))throw new li("viewer \u5FC5\u9700\u4F20\u503C");this._viewer=o,this._sourceType=f.sourceType,this._imageryOpitions=f.imagery,this._url=f.imagery?f.imagery.url:null,this._imageryProvider=new oX,this._sourceType&&this._url&&this.selectImagery(),this._show=Z(f.show,!0),this._tilingScheme=f.tilingScheme,this._classificationType=f.classificationType}Object.defineProperties(RJ.prototype,{show:{get:function(){return this._show},set:function(o){this._show=o,this._imageryTileProvider._show=o}},url:{get:function(){return this._url}},sourceType:{get:function(){return this._sourceType}},tilingScheme:{get:function(){return this._tilingScheme}},imageryProvider:{get:function(){return this._imageryProvider}},imageryLayer:{get:function(){return this._imageryLayer}},imageryTileProvider:{get:function(){return this._imageryTileProvider}},quadtreePrimitive:{get:function(){return this._quadtreePrimitive}}});RJ.prototype.selectImagery=function(){let o=this._sourceType,f=null,m=this._imageryOpitions;if(o==="wmts")f=new hP(m);else if(o==="mapbox")f=new CO(m);else if(o==="arcgis")f=new hC(m);else if(o==="wms")f=new bO(m);else if(o==="multi")f=new BU(m);else if(o==="single")f=new EC(m);else if(o==="tms"){let v=Z(m.west,void 0),y=Z(m.south,void 0),x=Z(m.east,void 0),C=Z(m.north,void 0);N(v)&&N(y)&&N(x)&&N(C)&&(m.rectangle=new Di(xe.toRadians(v),xe.toRadians(y),xe.toRadians(x),xe.toRadians(C))),N(m.fileExtension)&&m.fileExtension==="json"&&(m.callback=this.processGeoJson()),f=new cb(m)}else o==="baidu"?f=new FU(m):o==="gaode"||o==="geovis"||o==="qqmap"?f=new Xv(m):o==="mapworld"?f=new hP(m):o==="osm"?f=new pM(m):o==="bingmap"?f=new xO(m):o==="mvt"&&(N(m.coreMap)||(m.coreMap=this._earthCtrl.coreMap),f=new kU(m,m.ol));this._imageryProvider=f};RJ.prototype.addToMap=function(){this._imageryLayer=new x_(this._imageryProvider),this._imageryTileProvider=new mpt({imageryProvider:this.imageryLayer,tilingScheme:this._tilingScheme,classificationType:this._classificationType}),this._quadtreePrimitive=new hb({tileProvider:this._imageryTileProvider}),this._viewer.scene.primitives.add(this._quadtreePrimitive)};RJ.prototype.removeFromMap=function(){this._viewer.scene.primitives.remove(this._quadtreePrimitive)};var gpt=RJ;var Yc=null;function DA(o,f){Yc=f,this._viewer=o,this._cesium=f,this._scene=o.scene,this._core=new Sr(o,f),this.tooltip=this._core.CreateTooltip(),this._getPosition=new Ru(o,f),this.FlattenIsDraw=!1,this.wallArr=[],this.heightsort=[],this.FlattenPolygon=[],this.showWall=!0,this.deepth=100,this.bottomImg=window.SmartEarthRootUrl+pn.bottomplane,this.wallImg=window.SmartEarthRootUrl+pn.wall}DA.prototype.draw=function(o=100,f={},m){if(this.FlattenIsDraw)return;if(this.deepth=o||this.deepth,this.showWall=this._core.defaultValue(f.showWall,!0),this.showBottom=this._core.defaultValue(f.showBottom,!0),f.positions)return this.create(f.positions),typeof m=="function"&&m(),this;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.FlattenIsDraw=!0;var v=this._viewer,y=this._cesium;this.clear();var x=[],C=[],w,A,E=0;this.drawHandler=new y.ScreenSpaceEventHandler(v.scene.canvas);var T=this.tooltip;let S;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this.drawHandler.setInputAction(M=>{A=this._getPosition.getMousePosition(M.position);var I=this._core.toDegrees(A);x.push(A),C.push(I.lon,I.lat,I.height),E===0?(x.push(A),C.push(I.lon,I.lat,I.height),S=v.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new y.CallbackProperty(()=>x,!1),clampToGround:!0,material:new y.ColorMaterialProperty(y.Color.YELLOW.withAlpha(.3)),width:3}})):E===1&&(S&&v.entities.remove(S),w=v.entities.add({name:null,polygon:{hierarchy:new y.CallbackProperty(function(){return new y.PolygonHierarchy(y.Cartesian3.fromDegreesArrayHeights(C))},!1),material:y.Color.YELLOW.withAlpha(.3)}})),E++},y.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(M=>{if(E===0){T.showAt(M.endPosition,"\u5DE6\u952E\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u70B9");return}else E===1?T.showAt(M.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9"):T.showAt(M.endPosition,"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");A=this._getPosition.getMousePosition(M.endPosition);var I=this._core.toDegrees(A);C.splice(C.length-3,3),x.splice(x.length-1,1),x.push(A),C.push(I.lon,I.lat,I.height)},y.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(M){this.end&&this.end()}.bind(this),y.ScreenSpaceEventType.RIGHT_CLICK),this.end=M=>{if(T.show(!1),this._core.mouse(this._viewer.container,0),this.drawHandler.destroy(),this.drawHandler=null,S&&v.entities.remove(S),w&&v.entities.remove(w),this.FlattenIsDraw=!1,this.end=void 0,!(M==="cancel"||x.length<3)){if(E<2){E=0;return}E=0,this.create(C),typeof m=="function"&&m(C)}},this};DA.prototype.create=function(o){let f=Yc.Cartesian3.fromDegreesArrayHeights(o);if(this.boundingSphere=Yc.BoundingSphere.fromPoints(f),f.push(f[0]),this.showWall||this.showBottom){this.originHeight=1e5;for(let m=2;m<o.length;m=m+3)this.originHeight>o[m]&&(this.originHeight=o[m]);if(this.showBottom){let m=this._viewer.entities.add({name:"\u5730\u5F62\u5F00\u6316\u5E95\u9762",polygon:{hierarchy:new Yc.PolygonHierarchy(f),material:new Yc.ImageMaterialProperty({image:this._core.defaultValue(this.bottomImg),repeat:new Yc.Cartesian2(1,1)}),height:this.originHeight-this.deepth}});this.FlattenPolygon.push(m)}if(this.showWall){let m,v;for(let y=0;y<f.length-1;y++)m=this._core.toDegrees(f[y]),v=this._core.toDegrees(f[y+1]),this.calculateWall(m.lon,m.lat,v.lon,v.lat)}}this.groundClipping(f)};DA.prototype.groundClipping=function(o){var f=this._viewer.scene.globe,m=o.concat();m.splice(m.length-1,1);for(var v=0;v<m.length-1;v++)m[v].x===m[v+1].x&&m[v].y===m[v+1].y&&(m.splice(v,1),v--);var y=m.length;this.PolygonIsClockwise(m)&&m.reverse();for(var x=[],v=0;v<y;++v){var C=(v+1)%y,w=Yc.Cartesian3.add(m[v],m[C],new Yc.Cartesian3);w=Yc.Cartesian3.multiplyByScalar(w,.5,w);var A=Yc.Cartesian3.normalize(w,new Yc.Cartesian3),E=Yc.Cartesian3.subtract(m[C],w,new Yc.Cartesian3);E=Yc.Cartesian3.normalize(E,E);var T=Yc.Cartesian3.cross(E,A,new Yc.Cartesian3);T=Yc.Cartesian3.normalize(T,T);var S=new Yc.Plane(T,0),M=Yc.Plane.getPointDistance(S,w);x.push(new Yc.ClippingPlane(T,M))}this.clippingPlane=new Yc.ClippingPlaneCollection({planes:x}),f.multiClippingPlanes?f.multiClippingPlanes.add(this.clippingPlane):f.multiClippingPlanes=new Yc.MultiClippingPlaneCollection({collections:[this.clippingPlane],edgeWidth:1,edgeColor:Yc.Color.WHITE})};DA.prototype.PolygonIsClockwise=function(o){if(o.length>=3){var f=(o[1].x-o[0].x)*(o[2].y-o[1].y)-(o[1].y-o[0].y)*(o[2].x-o[1].x);return!(f>0)}};DA.prototype.calculateWall=function(o,f,m,v){var y=100,x=Yc.Math.lerp(o,m,1/y)-o,C=Yc.Math.lerp(f,v,1/y)-f,w=[],A=[],E=[],T;w.push(o,f),T=Yc.Cartesian3.fromDegrees(o,f),A.push(Yc.Cartographic.fromCartesian(T));for(var S=0;S<y;S++){var M=o+(S+1)*x,I=f+(S+1)*C;w.push(M,I),T=Yc.Cartesian3.fromDegrees(M,I),A.push(Yc.Cartographic.fromCartesian(T))}w.push(m,v),T=Yc.Cartesian3.fromDegrees(m,v),A.push(Yc.Cartographic.fromCartesian(T));var P=[];this._core.getHeightsFromLonLat(this._viewer,A).then(D=>{if(D){for(E=D,S=0;S<E.length;S++)P.push(this.originHeight-this.deepth);this.createWall(w,E,P)}})};DA.prototype.createWall=function(o,f,m){let v=this._viewer.entities.add({name:"\u5730\u5F62\u5F00\u6316\u5CA9\u5899",wall:{positions:Yc.Cartesian3.fromDegreesArray(o),maximumHeights:f,minimumHeights:m,material:new Yc.ImageMaterialProperty({image:this.wallImg,repeat:new Yc.Cartesian2(1,1)})}});this.wallArr.push(v)};DA.prototype.setDeepth=function(o){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-o),this.wallArr.forEach(f=>{let m=f.wall.minimumHeights.getValue();m=Array(m.length),m.fill(this.originHeight-o),f.wall.minimumHeights.setValue(m)})};DA.prototype.setVisibility=function(o){var f=this._viewer;if(this.wallArr.forEach(m=>{m.show=o}),f.scene.globe.multiClippingPlanes&&this.clippingPlane){let m=f.scene.globe.multiClippingPlanes;o&&!m.contains(this.clippingPlane)?m.add(this.clippingPlane):!o&&m.contains(this.clippingPlane)&&m.remove(this.clippingPlane,!1)}this.FlattenPolygon.forEach(m=>{m.show=o})};DA.prototype.clear=function(){var o=this._viewer;this.wallArr.forEach(f=>{o.entities.remove(f)}),this.wallArr=[],o.scene.globe.multiClippingPlanes&&this.clippingPlane&&(o.scene.globe.multiClippingPlanes.remove(this.clippingPlane),this.clippingPlane=void 0),this.FlattenPolygon.forEach(f=>{o.entities.remove(f)}),this.FlattenPolygon=[],this.FlattenIsDraw=!1};DA.prototype.deleteObject=DA.prototype.clear;var _pt=DA;function oN(o,f){this._earthCtrl=o,this._coreMap=o.coreMap,this._creator=o.Creator,this._defaultValue=f.defaultValue,this.Cesium=f,this.SimpleGraphic=this._creator._SimpleGraphic,this.SimpleGraphic.edit(!0,{editProp:!0}),this.MilitaryPlotting=this._creator._straightArrow,this.MilitaryPlotting.setEdit(!0,{editProp:!0}),this.treeData=new Map,this.sgwfs=new LX(this._coreMap,f),this.cacheModelFlatten=new Map}oN.prototype.checkNode=function(o,f){f!==void 0?o.checked=f:o.checked=!o.checked,o.children?o.children.forEach(m=>{this.checkNode(m,o.checked)}):o._children?o._children.forEach(m=>{this.checkNode(m,o.checked)}):this.treeData.has(o.id)?this.show(o.id,f):this.addData(o)};oN.prototype.addData=async function(o){let f,m={},{...v}=o;switch(v.sourceType){case"local-map":v.tms?f=this._creator.createImageryProvider(v.name,"tms",{id:v.id,url:v.urls,fileExtension:v.img||"png",enablePickFeatures:!1,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,tilingScheme:v.tileType==="Geo"?new Cesium.GeographicTilingScheme:new Cesium.WebMercatorTilingScheme,alpha:v.alpha},"0",v.zIndex,!0,""):f=this._creator.createUrlTemplateImageryProvider(v.name,{id:v.id,url:`${v.urls}/${v.tile||"{z}/{x}/{y}"}.${v.img||"png"}`,enablePickFeatures:!1,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,tilingScheme:v.tileType==="Geo"?new Cesium.GeographicTilingScheme:new Cesium.WebMercatorTilingScheme,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"kml":f=this._creator.addKmlLayer(v.name,{id:v.id,url:v.urls},!0);break;case"google":f=this._creator.createUrlTemplateImageryProvider(v.name,{id:v.id,url:v.urls,enablePickFeatures:!1,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"arcgis":f=this._creator.createArcGisImageryLayer(v.name,{id:v.id,url:v.urls,enablePickFeatures:!1,level:v.Level,usePreCachedTilesIfAvailable:!v.GCJ02,tilingScheme:v.GCJ02?this._earthCtrl.core.getOffsetTilingScheme():void 0,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"mapbox":f=this._creator.createImageryProvider(v.name,"MapBox",{id:v.id,name:v.name,level:v.Level,enablePickFeatures:!1,mapId:v.mapId,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,alpha:v.alpha,accessToken:v.token||"pk.eyJ1IjoibWFyc2dpcyIsImEiOiJja2Fod2xlanIwNjJzMnhvMXBkMnNqcjVpIn0.WnxikCaN2KV_zn9tLZO77A"},"0",v.zIndex,!0,"");break;case"tdmap":f=this._creator.createWebMapTileServerImageLayer(v.name,{id:v.id,url:v.urls,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel||18,style:v.style,layer:v.layer,format:v.format,enablePickFeatures:!1,tileMatrixSetID:"tiff",show:!0,subdomains:["t0","t1","t2","t3","t4","t5","t6","t7"],alpha:v.alpha},"0",v.zIndex,!0,"");break;case"tdt_label":f=this._creator.GeoWTFS({token:v.token||"c53eb074c3fcba5ac86103d4d711bbe8",url:v.urls,subdomains:["0","1","2","3","4","5","6","7"]});break;case"txmap":f=this._creator.createUrlTemplateImageryProvider(v.name,{id:v.id,url:v.urls,level:v.Level,enablePickFeatures:!1,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel||18,alpha:v.alpha,tilingScheme:this._earthCtrl.core.getOffsetTilingScheme(),customTags:{sx:(P,D)=>D>>4,sy:(P,D,L,R)=>(1<<R)-L>>4}},"0",v.zIndex,!0,"");break;case"gdmap":f=this._creator.createUrlTemplateImageryProvider(v.name,{id:v.id,url:v.urls,enablePickFeatures:!1,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel||18,tilingScheme:this._earthCtrl.core.getOffsetTilingScheme(),alpha:v.alpha},"0",v.zIndex,!0,"");break;case"bdmap":f=this._creator.createImageryProvider(v.name,"BaiduMap",{id:v.id,level:v.Level,enablePickFeatures:!1,style:v.style,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"cesiumblack":f=this._creator.createImageryProvider(v.name,"cesiumBlack",{id:v.id,url:v.urls,flipXY:!0,enablePickFeatures:!1,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"osm":f=this._creator.createImageryProvider(v.name,"OpenStreetMap",{id:v.id,url:v.urls,enablePickFeatures:!1,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"wmts":f=this._creator.createWebMapTileServerImageLayer(v.name,{id:v.id,url:v.urls,level:v.Level,style:v.style,layer:v.layer,enablePickFeatures:!1,format:v.format,tileMatrixSetID:v.srs,tilingScheme:v.tileType==="Geo"?new Cesium.GeographicTilingScheme:new Cesium.WebMercatorTilingScheme,show:!0,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"gis_wmts":f=this._creator.createUrlTemplateImageryProvider(v.name,{id:v.id,url:Cesium.buildModuleUrl(v.urls+"/{z}/{x}/{reverseY}.png"),enablePickFeatures:!1,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"wmts_zj":var y=new Cesium.GeographicTilingScheme({rectangle:Cesium.Rectangle.MAX_VALUE});v.addLevel&&v.addLevel===2&&(y.positionToTileXY=function(P,D,L){D>0&&D++;var R=this._rectangle;if(!!Cesium.Rectangle.contains(R,P)){var O=this.getNumberOfXTilesAtLevel(D),F=this.getNumberOfYTilesAtLevel(D),k=R.width/O,U=R.height/F,G=P.longitude;R.east<R.west&&(G+=Cesium.Math.TWO_PI);var j=(G-R.west)/k|0;j>=O&&(j=O-1);var q=(R.north-P.latitude)/U|0;return q>=F&&(q=F-1),Cesium.defined(L)?(L.x=j,L.y=q,L):new Cesium.Cartesian2(j,q)}},y.tileXYToRectangle=function(P,D,L,R){L>0&&L++;var O=this._rectangle,F=this.getNumberOfXTilesAtLevel(L),k=this.getNumberOfYTilesAtLevel(L),U=O.width/F,G=P*U+O.west,j=(P+1)*U+O.west,q=O.height/k,J=O.north-D*q,X=O.north-(D+1)*q;return Cesium.defined(R)||(R=new Cesium.Rectangle(G,X,j,J)),R.west=G,R.south=X,R.east=j,R.north=J,R}),f=this._creator.createWebMapTileServerImageLayer(v.name,{id:v.id,url:v.urls,layer:v.layer,level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,style:"default",tileMatrixSetID:"esritilematirx",format:"image/png",tilingScheme:y,addLevel:v.addLevel||1,enablePickFeatures:!1,show:!0,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"wms":case"wmsc":var x={service:"WMS",format:"image/png",transparent:!0};v.removeNullValue&&(v.nullvalue&&(v.nullvalue=v.nullvalue.replace("rgb(",""),v.nullvalue=v.nullvalue.replace(")","")),x.nullvalue=this._defaultValue(v.nullvalue,"0,0,0"),x.nulltolerance=this._defaultValue(v.nulltolerance,0)),v.token&&(v.urls+="?token="+v.token),v.sourceType==="wmsc"?f=this._creator.createCacheImageryProvider(v.name,{id:v.id,url:v.urls||"",layers:v.layer||"",level:v.Level,enablePickFeatures:!1,cacheUrl:v.cacheUrl||v.urls,fileExtension:v.fileExtension,cacheMaxLevel:v.cacheMaxLevel||16,alpha:v.alpha},"0",v.zIndex,v.checked,""):f=this._creator.createImageryProvider(v.name,"wms",{id:v.id,url:v.urls,layers:v.layer||"",level:v.Level,minimumLevel:v.minimumLevel,maximumLevel:v.maximumLevel,enablePickFeatures:!1,parameters:x,alpha:v.alpha},"0",v.zIndex,!0,"");break;case"wfs":f=this.sgwfs.CreateWfs(v.class,v);break;case"geojson":v.class==="point"?(v.disableDepthTestDistance==="Infinity"&&(v.disableDepthTestDistance=Number.POSITIVE_INFINITY),m={id:v.id,fillColor:this._defaultValue(v.color,"#ffffff"),color:this._defaultValue(v.imageColor,void 0),outlineColor:this._defaultValue(v.outlineColor,"#ffffff"),backgroundColor:this._defaultValue(v.backgroundColor,"#ffffff"),heightReference:this._defaultValue(v.heightReference,0),pointHeight:this._defaultValue(v.pointHeight,void 0),near:this._defaultValue(v.near,0),far:this._defaultValue(v.far,99999999999),bold:v.bold,italic:v.italic,showBackground:v.showBackground,outlineWidth:this._defaultValue(v.outlineWidth,1),text:v.text,image:v.image,font_size:v.size,font_family:this._defaultValue(v.font_family,"\u5FAE\u8F6F\u96C5\u9ED1"),disableDepthTestDistance:this._defaultValue(v.disableDepthTestDistance,void 0),labelData:v.labelData,imageData:v.imageData},v.text&&v.image&&!v.labelData&&!v.imageData&&(m.labelData={horizontalOrigin:Cesium.HorizontalOrigin.LEFT,pixelOffset:new Cesium.Cartesian2(20,0)},m.imageData={horizontalOrigin:Cesium.HorizontalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0)}),f=this._creator.createLabelPointGeoJsonFeatureLayer(v.name,v.urls,m,"0",v.checked)):v.class==="polyline"?v.effect?f=this._creator.createPathLayer({id:v.id,url:v.urls,color:v.color||"#0033FF",width:v.width||4,pointColor:v.pointColor||"#FFFFFF",speed:v.speed,near:v.near,far:v.far}):v.effectWall?f=this._creator.createTrailWallLayer({id:v.id,url:v.urls,color:v.color||"#0033FF",height:v.height||100,minHeight:v.minHeight||0,speed:v.speed,near:v.near,far:v.far}):(m={id:v.id,layertype:"polylinelayer",material:this._defaultValue(v.color,"#ffffff"),outlineColor:this._defaultValue(v.outlineColor,"#ffffff"),outlineWidth:this._defaultValue(v.outlineWidth,0),height:this._defaultValue(v.height,void 0),width:this._defaultValue(v.width,2),clampToGround:this._defaultValue(v.clampToGround,!0),classificationType:v.classificationType,dash:this._defaultValue(v.dash,!1),dashLength:this._defaultValue(v.dashLength,20),gapColor:this._defaultValue(v.gapColor,"rgba(0,0,0,0)"),near:this._defaultValue(v.near,0),far:this._defaultValue(v.far,1/0)},f=this._creator.createPolylineGeoJsonFeatureLayer(v.name,v.urls,m,"0",v.checked)):v.class==="polylineVolume"?(m={id:v.id,material:this._defaultValue(v.color,"#ff0000"),slttype:"0",number:"4",exradius:"1",inradius:"1",orth_width:"2",orth_height:"2",radius:this._defaultValue(v.radius,5),cornerType:"0",heightReference:"0",height:this._defaultValue(v.lineHeight||v.height,0),near:this._defaultValue(v.near,0),far:this._defaultValue(v.far,1/0),radiusScale:v.radiusScale||1,connect:v.connect},m.radiusScale/=2,f=this._creator.createpolylineVolumeGeojsonPrimitiveLayer(v.name,v.urls,m,"0",!0,function(P){v.flow&&P.entities.values.forEach(L=>{L.polylineVolume.material=new this._creator._core.getTrailLinkMaterial(this._defaultValue(v.color,"#ff0000"),"../static/images/smoke.png",9e3)})})):v.class==="model"?(m={id:v.id,url:this._defaultValue(v.url,""),color:this._defaultValue(v.color,"#ffffff"),scale:this._defaultValue(v.scale,1),height:this._defaultValue(v.pointHeight||v.height,0),heading:v.heading,pitch:v.pitch,roll:v.roll},f=this._creator.createModelGeojsonFeatureLayer(v.name,v.urls,m,"0",!0)):v.class==="polygon"&&(v.disableDepthTestDistance==="Infinity"&&(v.disableDepthTestDistance=Number.POSITIVE_INFINITY),m={id:v.id,material:this._defaultValue(v.color,"#ff0000"),height:this._defaultValue(v.height,0),outlineColor:this._defaultValue(v.outlineColor,"#ff0000"),extrudedHeight:this._defaultValue(v.extrudedHeight,0),outlineWidth:this._defaultValue(v.outlineWidth,0),outline:this._defaultValue(v.outline,!0),clampToGround:this._defaultValue(v.clampToGround,v.extrudedHeight===void 0&&v.height===void 0),classificationType:v.classificationType,near:this._defaultValue(v.near,0),far:this._defaultValue(v.far,1/0),text:v.text,fillColor:v.labelColor||v.color,labelOutlineColor:v.labelOutlineColor||v.outlineColor||"#ff0000",font:this._defaultValue(v.font,"\u5FAE\u8F6F\u96C5\u9ED1"),labelNear:v.labelNear,labelFar:v.labelFar,font_size:this._defaultValue(v.size,"18px"),italic:v.italic,bold:v.bold,pixelOffset:new Cesium.Cartesian2(this._defaultValue(v.offsetX,0),this._defaultValue(v.offsetY,0)),labelOutlineWidth:2,disableDepthTestDistance:v.disableDepthTestDistance,water:v.water,mask:v.mask,bulidingWall:v.bulidingWall,bulidingWallWidth:v.bulidingWallWidth},f=this._creator.createPolygonGeoJsonFeatureLayer(v.name,v.urls,m,"0",v.checked));break;case"pathLayer":f=this._creator.createPathLayer({id:v.id,url:v.url,color:v.color||"#0033FF",width:v.width||4,pointColor:v.pointColor||"#FFFFFF",speed:v.speed||5,far:v.far||5e3});break;case"vector":{let P={url:v.urls,layer:v.layer,srs:v.srs};v.class==="point"||v.class==="label"||v.class==="image"?(v.disableDepthTestDistance==="Infinity"&&(v.disableDepthTestDistance=Number.POSITIVE_INFINITY),v.style||(m={id:v.id,level_min:this._defaultValue(v.minimumLevel,10),level_max:this._defaultValue(v.maximumLevel,22),fillColor:this._defaultValue(v.color,"#ffffff"),color:this._defaultValue(v.imageColor,void 0),outlineColor:this._defaultValue(v.outlineColor,"#ffffff"),backgroundColor:this._defaultValue(v.backgroundColor,"#ffffff"),heightReference:this._defaultValue(v.heightReference,0),pointHeight:this._defaultValue(v.pointHeight,void 0),near:this._defaultValue(v.near,0),far:this._defaultValue(v.far,99999999999),bold:v.bold,italic:v.italic,showBackground:v.showBackground,outlineWidth:this._defaultValue(v.outlineWidth,1),text:v.text,image:v.image,font_size:v.size,font_family:this._defaultValue(v.font_family,"\u5FAE\u8F6F\u96C5\u9ED1"),disableDepthTestDistance:this._defaultValue(v.disableDepthTestDistance,void 0),labelData:v.labelData,imageData:v.imageData}),v.text&&v.image&&!v.labelData&&!v.imageData&&(m.labelData={horizontalOrigin:Cesium.HorizontalOrigin.LEFT,pixelOffset:new Cesium.Cartesian2(20,0)},m.imageData={horizontalOrigin:Cesium.HorizontalOrigin.CENTER,pixelOffset:new Cesium.Cartesian2(0,0)}),P.upperLevelLimit=m.level_max,P.lowerLevelLimit=m.level_min,f=this._creator.createLabelImageGeoJsonFeatureLayerProvider(v.name,P,m,"0",v.checked,function(){})):v.class==="polylineVolume"?(m={id:v.id,level_min:this._defaultValue(v.minimumLevel,10),level_max:this._defaultValue(v.maximumLevel,22),material:this._defaultValue(v.color,"#ff0000"),slttype:"0",number:"4",exradius:"1",inradius:"1",orth_width:"2",orth_height:"2",radius:this._defaultValue(v.radius,.5),cornerType:"0",heightReference:"0",height:this._defaultValue(v.height,0),near:this._defaultValue(v.near,0),far:this._defaultValue(v.far,99999999999),radiusScale:v.radiusScale},P.upperLevelLimit=m.level_max,P.lowerLevelLimit=m.level_min,f=this._creator.createVolumeGeoJsonFeatureLayerProvider(v.name,P,m,"0",v.checked,function(){})):v.class==="polyline"?(m={id:v.id,layertype:"polylinelayer",level_min:this._defaultValue(v.minimumLevel,10),level_max:this._defaultValue(v.maximumLevel,22),material:this._defaultValue(v.color,"#ffffff"),outlineColor:this._defaultValue(v.outlineColor,"#ffffff"),outlineWidth:this._defaultValue(v.outlineWidth,0),height:this._defaultValue(v.height,void 0),width:this._defaultValue(v.width,2),clampToGround:this._defaultValue(v.clampToGround,!0),classificationType:v.classificationType,dash:this._defaultValue(v.dash,!1),dashLength:this._defaultValue(v.dashLength,20),gapColor:this._defaultValue(v.gapColor,"rgba(0,0,0,0)"),near:this._defaultValue(v.near,0),far:this._defaultValue(v.far,1/0)},P.upperLevelLimit=m.level_max,P.lowerLevelLimit=m.level_min,f=this._creator.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider(v.name,P,m,"0",v.checked,function(){})):v.class==="polygon"?(m={id:v.id,layertype:"polygonlayer",level_min:this._defaultValue(v.minimumLevel,10),level_max:this._defaultValue(v.maximumLevel,22),material:this._defaultValue(v.color,"#ff0000"),heightReference:"1",height:this._defaultValue(v.height,0),extrudedHeight:this._defaultValue(v.extrudedHeight,0),extrudedHeightReference:"1",clampToGround:this._defaultValue(v.clampToGround,!1),classificationType:v.classificationType,near:this._defaultValue(v.near,0),far:this._defaultValue(v.far,1/0)},P.upperLevelLimit=m.level_max,P.lowerLevelLimit=m.level_min,f=this._creator.createGeoJsonFeatureLayerProviderOptimization(v.name,P,m,"0",v.checked,function(){})):v.class==="model"&&(m={id:v.id,level_min:this._defaultValue(v.minimumLevel,10),level_max:this._defaultValue(v.maximumLevel,22),uri:this._defaultValue(v.model||v.uri,""),file:"",color:this._defaultValue(v.color,"#ffffff"),scale:this._defaultValue(v.scale,1),heightReference:0,height:this._defaultValue(v.height,0),heading:v.heading,pitch:v.pitch,roll:v.roll},P.upperLevelLimit=m.level_max,P.lowerLevelLimit=m.level_min,f=this._creator.createModelGeoJsonFeatureLayerProvider(v.name,P,m,"0",v.checked,function(){})),f&&(v.id=f.treeobj.id);break}case"terrain":f=this._creator.createTerrain(v.name,{id:v.id,requestVertexNormals:!0,url:v.urls},"0",!0,"");break;case"sgsterrain":f=this._creator.sfsterrainprovider(v.name,{id:v.id,layerName:v.layer,requestVertexNormals:!0,url:v.urls||"",token:v.token,cacheUrl:v.cacheUrl,cacheLevel:v.cacheLevel},"0",!0,"");break;case"sgsterrain7.1":f=this._creator.sfsterrainprovider71(v.name,{id:v.id,layerName:v.layer,requestVertexNormals:!0,url:v.urls,token:v.token,cacheUrl:v.cacheUrl,cacheLevel:v.cacheLevel},"0",!0,"");break;case"arcgisterrain":f=this._creator.createArcGISTerrain(v.name,{id:v.id,requestVertexNormals:!0,url:v.urls},"0",!0,"");break;case"CesiumGlobeTerrain":f=this._creator.createCesiumTerrain(v.name,{id:v.id,requestVertexNormals:!0},"0",!0,"");break;case"modelFlatten":let w=this.getData(v.modelId);if(w)f=w.setFlatten(!0,{fid:v.id,show:v.checked,name:v.name,positions:v.positions}),w.flattenHeight=v.height||0;else{let P=this.cacheModelFlatten.get(v.modelId);P||(this.cacheModelFlatten.set(v.modelId,[]),P=this.cacheModelFlatten.get(v.modelId)),P.push(v)}break;case"b3dm":f=this._creator.create3DTilesets(v.name,v.urls,{id:v.id,Level:v.Level,maximumScreenSpaceError:v.maximumScreenSpaceError&&parseInt(v.maximumScreenSpaceError),maximumMemoryUsage:v.maximumMemoryUsage&&parseInt(v.maximumMemoryUsage),geometricError:v.geometricError&&parseInt(v.geometricError),backFaceCulling:v.backFaceCulling},{groundCenter:v.Center,groundheight:v.modelHeight,heading:v.heading,pitch:v.pitch,roll:v.roll,effects:v.effects||!1,effectsMaxHeight:v.effectsMaxHeight||150,colors:v.alpha?"rgba(255,255,255,"+v.alpha+")":v.color||void 0},"0",!0),this.cacheModelFlatten.get(v.id)&&this.cacheModelFlatten.get(v.id).forEach(D=>{let L=f.setFlatten(!0,{fid:D.id,show:D.checked,name:D.name,positions:D.positions});f.flattenHeight=D.height||0,this.setData(D.id,L)});break;case"s3m":f=this._creator.createS3MLayer(v.urls,{scene:this._coreMap.scene,near:v.near,far:v.far,lodRangeScale:v.lodRangeScale},function(){});break;case"gltf":var C=[v.lon,v.lat,v.height];f=this._creator.createModel(C,v.urls,{id:v.id,scale:v.scale||1,heading:v.heading,pitch:v.pitch,roll:v.roll},"0",v.name,"");break;case"SimpleGraphic":v.type=v.class,f=this._creator.SimpleGraphic.addFeature(v);break;case"videoPolygon":f=this._creator.addVideoPolygon(v.positions,{url:v.url,angle:v.angle});break;case"videoBox":f=this._creator.addVideoBox(v.position,v);break;case"video3D":f=this._creator.Video3D(v);break;case"MilitaryPlotting":v.feature.id||(v.feature.id=v.id),v.feature.name||(v.feature.name=v.name),f=this._creator.MilitaryPlotting.addFeature(v.feature);break;case"ParticleEffect":let A=new R8(v.name,this._earthCtrl.viewer,this.Cesium);!this._Particle&&(this._Particle={}),!this._Particle[v.name]&&(this._Particle[v.name]=[]),this._Particle[v.name].push(A),f=A.createParticleEffect(v.name,v.position,{translation:Cesium.Cartesian3.fromElements(0,0,0)}),f.name=v.name;break;case"FlowField":f=this._creator.createTrailLine(v.positions,v.style),f.boundingSphere=Cesium.BoundingSphere.fromPoints(v.positions);break;case"MobileWall":f=this._creator.createTrailLineWall(v.LineInterpolation.positions,v.style),f.boundingSphere=Cesium.BoundingSphere.fromPoints(v.LineInterpolation.positions);break;case"link":f=this._creator.createLinkPro(this._earthCtrl.core.toDegrees(v.positions[0]),this._earthCtrl.core.toDegrees(v.positions[1]),{clampToGround:!0});break;case"effectCone":let E=v.radius/50,T=this._creator.addDRWEffectCircle({position:v.position,radius:v.radius,color:v.color});f=[this._creator.addEffectCone({position:v.position,color:v.color,radius:3*E,length:v.length}),T];break;case"effectCylinder":f=this._creator.addEffectCylinder({position:v.position,color:v.color,radius:v.radius,length:v.length,multiple:v.multiple,number:v.number});break;case"rotateEffectCircle":f=this._creator.addRotateEffectCircle({position:v.position,radius:v.radius});break;case"tetrahedrod":f=this._creator.addTetrahedron({position:v.position,multiple:v.multiple,scale:new Cesium.Cartesian3(v.scale,v.scale,v.scale)});break;case"flyingLine":f=this._creator.createFlyingLine(v.positions,{time:v.time,color:v.color});break;case"DiffusionSource":this.scan||(this.scan=new bb(this._earthCtrl.viewer,this.Cesium)),f=this.scan.createMultiCircleScan(v.position,v.maxRadius,v.maxRadius.color,3e3,!0);break;case"RiskDiffusion":case"CircularDiffusion":this.scan||(this.scan=new bb(this._earthCtrl.viewer,this.Cesium)),f=this.scan.createCircleScan(v.position,v.maxRadius,v.maxRadius.color,3e3,!0);break;case"FanDiffusion":this.scan||(this.scan=new bb(this._earthCtrl.viewer,this.Cesium)),f=this.scan.createSectorScan(v.position,v.maxRadius,v.scanColor,v.angle,v.yaw,v.duration,v.clampToGround);break;case"RadarMask":f=this._creator.createRectangularSensor(v.position,v.cylinder);break;case"DynamicSatellite":let M=this._creator.createConeRadar(v.position,{color:"#7b9ef7",radius:2e5}),I=this._creator.createModel(v.position,window.SmartEarthRootUrl+"Workers/Model/weixin.gltf",{scale:15},"0","\u536B\u661F");f={dtwxzsData:M,weixin:I},f.sourceType="DynamicSatellite";break;case"Point":f=this._earthCtrl.factory.createPoint(o.feature),f.sourceType="Point";break;case"Label":f=this._earthCtrl.factory.createLabel(o.feature),f.sourceType="Label";break;case"Billboard":f=this._earthCtrl.factory.createBillboard(o.feature),f.sourceType="Billboard";break;case"Polyline":f=this._earthCtrl.factory.createPolyline(o.feature),f.sourceType="Polyline";break;case"Wall":f=this._earthCtrl.factory.createWall(o.feature),f.sourceType="Wall";break;case"Corridor":f=this._earthCtrl.factory.createCorridor(o.feature),f.sourceType="Corridor";break;case"PolylineVolume":f=this._earthCtrl.factory.createPolylineVolume(o.feature),f.sourceType="PolylineVolume";break;case"Rectangle":f=this._earthCtrl.factory.createRectangle(o.feature),f.sourceType="Rectangle";break;case"Polygon":f=this._earthCtrl.factory.createPolygon(o.feature),f.sourceType="Polygon";break;case"Ellipse":f=this._earthCtrl.factory.createEllipse(o.feature),f.sourceType="Ellipse";break;case"Box":f=this._earthCtrl.factory.createBox(o.feature),f.sourceType="Box";break;case"Cylinder":f=this._earthCtrl.factory.createCylinder(o.feature),f.sourceType="Cylinder";break;case"Ellipsoid":f=this._earthCtrl.factory.createEllipsoid(o.feature),f.sourceType="Ellipsoid";break;case"ImageryProvider":f=earthCtrl.factory.createImageryLayer(o.feature);break;case"TerrainProvider":f=earthCtrl.factory.createTerrainLayer(o.feature);break;case"WorldTerrain":f=SmartEarth.Cesium.createWorldTerrain(),earthCtrl.viewer.terrainProvider=f;break;case"FeatureDataProvider":f=earthCtrl.factory.createFeatureLayer(o.feature);break;case"DivPoint":f=earthCtrl.factory.createDivPoint(o.content,o.secondContent,o.feature);break;case"ScreenDialog":f=earthCtrl.view.createScreenDialog(o.feature);break;case"RichTextPoint":f=earthCtrl.factory.createRichTextPoint(o.content,o.secondContent,o.feature);break;case"CircleScan":f=earthCtrl.factory.createCircleScan(o.feature);break;case"TrailLine":f=earthCtrl.factory.createTrailLine(o.content,o.feature);break;case"TrailLineWall":f=earthCtrl.factory.createTrailLineWall(o.content,o.feature);break;case"TrailWallLayer":f=earthCtrl.factory.createTrailWallLayer(o.feature);break;case"TrailLinePath":f=earthCtrl.factory.createTrailLinePath(o.content,o.secondContent,o.feature);break;case"WaterPolygonLayer":f=earthCtrl.factory.createWaterPolygonLayer(o.feature);break;case"DRWEffectCircle":f=earthCtrl.factory.addDRWEffectCircle(o.feature);break;case"EffectCone":f=earthCtrl.factory.addEffectCone(o.feature);break;case"RotateEffectCircle":f=earthCtrl.factory.addRotateEffectCircle(o.feature);break;case"EffectCylinder":f=earthCtrl.factory.addEffectCylinder(o.feature);break;case"FlyingLine":f=earthCtrl.factory.createFlyingLine(o.content,o.feature);break;case"Tetrahedron":f=earthCtrl.factory.addTetrahedron(o.feature);break;case"RectangularSensor":f=earthCtrl.factory.createRectangularSensor(o.content,o.feature);break;case"RadarMaskScan":f=earthCtrl.factory.createRadarMaskScan(o.content,o.secondContent,o.feature);break;case"Link":f=earthCtrl.factory.createLink(o.content,o.secondContent,o.feature);break;case"SatelliteTrail":f=earthCtrl.factory.createSatelliteTrail(o.feature);break;case"Obj":f=earthCtrl.factory.createObj(o.feature);break;case"Sem":f=earthCtrl.factory.createSem(o.feature);break;case"Model":f=earthCtrl.factory.createModel(o.feature);break;case"3DTilesets":f=earthCtrl.factory.create3DTilesets(o.feature);break}return v.sourceType!=="gltf"&&(v.lon||v.lat)&&(v.flyTo=[v.lon,v.lat,this._defaultValue(v.height,1e3)]),v.minx&&v.miny&&v.maxx&&v.maxy&&(v.flyTo=[v.minx,v.miny,v.maxx,v.maxy]),v.sourceType==="ParticleEffect"&&v.location&&(v.flyTo=[v.location.x,v.location.y,this._defaultValue(v.location.z,200)]),this.setData(v.id,f),f};oN.prototype.getData=function(o){return this.treeData.get(o)};oN.prototype.setData=function(o,f){this.treeData.set(o,f)};oN.prototype.deleteData=function(o){let f;if((f=window.Viewer.entities.getById(o))?window.Viewer.entities.remove(f):f=this.getData(o),f){if(f.deleteObject&&f.deleteObject(),f.destroy&&f.destroy(),f.item&&f.item.deleteObject&&f.item.deleteObject(),f.item&&f.item.destroy&&f.item.destroy(),f.sourceType==="DynamicSatellite"){let m=f.item||f;m.dtwxzsData.deleteObject(),m.weixin.deleteObject()}Array.isArray(f)&&f.forEach(m=>{m.deleteObject&&m.deleteObject()})}this.treeData.delete(o)};oN.prototype.show=function(o,f){let m;if(m=window.Viewer.entities.getById(o)){m.show=f;return}else m=this.getData(o);if(!!m){if(m&&m.sourceType==="DynamicSatellite"){let v=m.item||m;v.dtwxzsData.setVisibility(f),v.weixin.setVisibility(f);return}if(m.item||m){let v=m.item||m;m.name==="smog"?v.Smog[0].show=f:m.name==="flame"?v.Flame[0].show=f:m.name==="fountain"?v.Fountain[0].show=f:m.name==="fireworks"&&v.Fireworks.forEach(y=>{y.show=f}),v.show!==void 0&&(v.show=f),v.setVisibility&&v.setVisibility(f),m.setVisibility&&m.setVisibility(f)}Array.isArray(m)&&m.forEach(v=>{v.setVisibility&&v.setVisibility(f)})}};oN.prototype.flyTo=function(o){if(o.children)return;if(o._children&&o._children[0])this.flyTo(o._children[0]);else if(o&&o.flyTo){o&&(o.flyTo.length===3||o.flyTo.length===2)?this._earthCtrl.camera.flyTo(o.flyTo[0],o.flyTo[1],o.flyTo[2]||0):o&&o.flyTo.length===4?this._earthCtrl.camera.flyToPointsInterest({destination:Cesium.Rectangle.fromDegrees(o.flyTo[0],o.flyTo[1],o.flyTo[2],o.flyTo[3])}):this._earthCtrl.camera.flyToPointsInterest({destination:Cesium.Cartesian3.fromDegrees(o.flyTo[0],o.flyTo[1],o.flyTo[2]||0),orientation:{heading:Cesium.Math.toRadians(o.flyTo[3]||0),pitch:Cesium.Math.toRadians(o.flyTo[4]||-90),roll:Cesium.Math.toRadians(o.flyTo[5]||0)}});return}let f=this.getData(o.id);f&&f.item?this._earthCtrl.camera.flyToObj(f.item):this._earthCtrl.camera.flyToObj(f)};var vpt=oN;function oy(o,f){this.name="SmartEarth",this.id=1,this.open=!0,this.mapStatus={},this.treeData=[],this._earthCtrl=o,this._coreMap=o.coreMap,this._cesium=f}oy.prototype.setTreeData=function(o=[]){this.ergodicNode(o),this.treeData=o};oy.prototype.ergodicNode=function(o){o&&o.length&&o.forEach(f=>{f.rename=!1,f.children&&this.ergodicNode(f.children)})};oy.prototype.addTreeData=function(o,f={},m=this.treeData){let v=m.findIndex(x=>x.name===o),y=m[v];if(f.checked=!0,y)this.addData(y,{...f,item:void 0}),this.treeTool.treeData&&this.treeTool.treeData.set(f.id,f.item);else{y={id:this._earthCtrl.factory.createUUID(),name:o,children:[],checked:!1},this.addData(void 0,y);let x=setTimeout(()=>{this.addData(y,{...f,item:void 0}),this.treeTool.treeData&&this.treeTool.treeData.set(f.id,f.item),clearTimeout(x)},0)}};oy.prototype.addData=function(o,f){!f.rename&&(f.rename=!1),this.addTreeChildren({pid:o&&o.id,item:f})};oy.prototype.addTreeChildren=function({parentNode:o,pid:f,item:m}){if(!f){this.treeData.push(m);return}(o||this.treeData).forEach(v=>{v.id===f?v.children?v.children.push(m):(o||this.treeData).push(m):v.children&&this.addTreeChildren({parentNode:v.children,pid:f,item:m})})};oy.prototype.expandedNode=function(o){};oy.prototype.openFile=function(o,f){let m=this,v=new FileReader;v.readAsText(o),v.onload=function(){let y=JSON.parse(this.result);y&&y.children&&y.children.forEach(x=>{m.addFlieTree(x)}),f&&typeof f=="function"&&f(this)}};oy.prototype.addFlieTree=function(o,f=this.treeData){let m=this;if(o&&o.children&&o.children.length){let v=f.findIndex(x=>x.name===o.name),y=f[v];if(y)o.children.forEach(x=>{m.addFlieTree(x,y.children)});else{let x={id:o.id,name:o.name,children:[],rename:!1,checked:!0};f.push(x),o.children.forEach(C=>{m.addFlieTree(C,f[f.length-1].children,o.name)})}}else if(o&&o.sourceType){let v=!1;f.forEach(y=>{y.id===o.id&&(v=!0)}),v||(console.log(o),new Promise((y,x)=>{m.customParse(o),y()}).then(y=>{o._children?o._children.forEach(x=>{m.treeTool.addData(x)}):this.treeTool.addData(o),f.push(o)}))}else if(o&&(!o.children||o.children&&!o.children.length)&&!o.sourceType){let v={id:o.id,name:o.name,children:[],rename:!1,checked:!0};f.push(v)}};oy.prototype.openFileFromUrl=function(o,f){if(!!o)try{this._cesium.Resource.fetchJson(o).then(m=>{this.treeData=m.children,this.ergodicNode2({children:this.treeData}),f&&typeof f=="function"&&f(this)})}catch{console.error("Fail to open file from url!")}};oy.prototype.ergodicNode2=function(o){o.rename=!1,(!o.children||o.children&&!o.children.length)&&(o._children?o._children.forEach(f=>{this.treeTool.addData(f)}):this.treeTool.addData(o)),o.children&&o.children.length&&o.children.forEach(f=>{this.ergodicNode2(f)})};oy.prototype.save=function(o){let f={name:this.name,id:this.id,open:this.open,children:this.treeData,flyTo:this.viewCenter,mapStatus:this.mapStatus},m=this;new Promise((v,y)=>{this.customStringify(f,m),v()}).then(v=>{let y=JSON.stringify(f),x=new Blob([y],{type:"text/plain;charset=utf-8"});m._earthCtrl.Creator._core.saveAs(x,o?`${o}.json`:"tree.json")})};oy.prototype.customStringify=function(o,f){typeof o=="object"&&o!==null?Object.getOwnPropertyNames(o).forEach(function(m){if(typeof o[m]=="object"||Array.isArray(o[m]))if(o[m]&&o[m].getValue&&typeof o[m].getValue=="function"){let v=f._earthCtrl.clock.currentTime.clone(),y="";o[m].getType&&typeof o[m].getType=="function"?y=o[m].getType(v):o[m].alpha&&o[m].blue&&o[m].green&&o[m].red&&(y="Color");let x=o[m].getValue(v);console.log(y,x),o[m]=null,o.JSonTransformType={type:y,value:x,changeKey:"material"},console.log(o[m])}else if(m==="material"&&o[m]){let v=f._earthCtrl.clock.currentTime.clone();console.log(o[m]);let y=o[m].clone(),x="";o[m].getType&&typeof o[m].getType=="function"&&(x=o[m].getType(v)),typeof o[m].alpha=="number"&&typeof o[m].blue=="number"&&typeof o[m].green=="number"&&typeof o[m].red=="number"&&(x="Color"),o[m]=null,o.JSonTransformType={type:x,value:y,changeKey:"material"}}else f.customStringify(o[m],f)}):Array.isArray(o)&&o.forEach(m=>{(typeof m=="object"||Array.isArray(m))&&f.customStringify(m,f)})};oy.prototype.customParse=function(o,f=this){typeof o=="object"&&o!==null?Object.getOwnPropertyNames(o).forEach(function(m){if(typeof o[m]=="object"||Array.isArray(o[m]))if(m==="JSonTransformType"){let v=o[m];if(v.type==="Color"){let{red:y,green:x,blue:C,alpha:w}=v.value;o[v.changeKey]=new f.treeTool.Cesium.Color(y,x,C,w)}}else f.customParse(o[m],f)}):Array.isArray(o)&&o.forEach(m=>{(typeof m=="object"||Array.isArray(m))&&f.customParse(m,f)})};oy.prototype.createTreeTool=function(){this._treeTool=new vpt(this._earthCtrl,this._cesium)};Object.defineProperties(oy.prototype,{treeTool:{get:function(){return this._treeTool||this.createTreeTool(),this._treeTool},set:function(o){return this._treeTool=o,this._treeTool}}});var ypt=oy;function In(o){this._earthCtrl=o,this._coreMap=o.coreMap,this._SimpleGraphic=new P8(this._coreMap,qi,o),this._straightArrow=new Tle(this._coreMap,qi,o),this._popupmessage=new wb(this._coreMap,qi),this._createdynamicObject=new WO(this._coreMap,qi),this._skyBox=new Dle(this._coreMap,qi),this._screenshot=new Ole(this._earthCtrl.viewer,qi),this._layerTree=new ypt(this._earthCtrl,qi)}function ay(){return((1+xe.nextRandomNumber())*65536|0).toString(16).substring(1)}In.createUUID=function(){return`${ay()+ay()}-${ay()}-${ay()}-${ay()}-${ay()}${ay()}${ay()}`};In.createUUIDWithoutDash=function(){return ay()+ay()+ay()+ay()+ay()+ay()+ay()+ay()};In.prototype.createUUID=function(){return In.createUUID()};In.prototype.createGroup=function(o){let f=new $6;return f.id=o.id||In.createUUID(),f.name=o.name||"\u672A\u547D\u540D\u7EC4",f};In.prototype.createImageryLayer=function(o,f){let m=new sLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.IMAGERYPROVIDERS),m),m};In.prototype.updateImageryLayer=function(o={}){let f=this._earthCtrl.imageryLayers,m=Z(o.layerIndex,-1);if(o.layerIndex&&f.get(m)){let v=f.get(m);typeof o.show=="boolean"&&(v.show=o.show),typeof o.removeFromMap=="boolean"&&o.removeFromMap&&(f.remove(v),v=void 0),v&&o.newIndex&&Number(o.newIndex)>=0&&Number(o.newIndex)<=f.length?(f.remove(v,!1),f.add(v,o.newIndex)):(typeof o.newIndex!="number"||Number(o.newIndex)<0||Number(o.newIndex)>f.length)&&console.log("\u6307\u5B9A\u4F4D\u7F6E\u4E0D\u5728\u8303\u56F4\u5185\uFF01")}return f};In.prototype.createTerrainLayer=function(o,f){let m=new lLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.TERRAINPROVIDERS),m),m};In.prototype.createCustomMVTLayer=function(o){let f=new spt(this._earthCtrl.coreMap,o);return f.addToMap(),f};In.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new AT({})};In.prototype.createImageryGroundPrimitive=function(o){let f=new gpt(this._earthCtrl.coreMap,o);return f.addToMap(),f};In.prototype.createFeatureLayer=function(o,f){let m=new cLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.FEATURELAYERS),m),m};In.prototype.createVectorTileLayer=function(o){return{point:(E,T,S,M,I)=>new od(this._coreMap,qi).createPointGeoJsonFeatureLayerProvider(E,T,S,M,I),label:(E,T,S,M,I)=>new ty(this._coreMap,qi).createLabelImageGeoJsonFeatureLayerProvider(E,T,S,M,I),model:(E,T,S,M,I)=>new od(this._coreMap,qi).createModelGeoJsonFeatureLayerProvider(E,T,S,M,I),polyline:(E,T,S,M,I)=>new FD(this._coreMap,qi).createPolylineVectorGeoJsonFeatureLayerProvider(E,T,S,M,I),polygon:(E,T,S,M,I)=>new od(this._coreMap,qi).VolumeVectorGeoJsonFeatureLayerOptimization(E,T,S,M,I),histogram:(E,T,S,M,I)=>new od(this._coreMap,qi).createHistogramVectorGeoJsonFeatureLayer(E,T,S,M,I)}[o.type](o.name,o.geoOptions,o.styleOption,o.checked,o.disFnc)};In.prototype.createWfsLayer=function(o,f){return new LX(this._coreMap,qi).CreateWfs(o,f)};In.prototype.createGeoWTFS=function(o,f){return this._TdtLabel||(this._TdtLabel=new xle(this._coreMap,o)),this._TdtLabel.GeoWTFS(f)};In.prototype.createCzml=function(o,f,m){return new wle(this._coreMap,qi).addCZML(o,f,m)};In.prototype.createPolygonVideo=function(o,f,m,v){this.commandExecute(o,f,m,v)};In.prototype.commandExecute=function(o,f,m,v){this._Command||(this._Command=new Xct(this._coreMap,qi)),this._Command.execute(o,f,m,v)};In.prototype.createVideo3D=function(o){return new Ple(this._coreMap,qi).Video3D(o)};In.prototype.createParticleEffect=function(o,f,m,v){let y=new R8(o,this._coreMap,qi);return!this._Particle&&(this._Particle={}),!this._Particle[o]&&(this._Particle[o]=[]),this._Particle[o].push(y),y.createParticleEffect(f,m,v)};In.prototype.addViewCone=function(o){return new $O(this._coreMap,qi).addViewCone(o)};In.prototype.createViewCone=function(o,f){return new $O(this._coreMap,qi).createViewCone(o,f)};In.prototype.createConeRadar=function(o,f){return new X0(this._coreMap,qi).createConeRadar(o,f)};In.prototype.createCloudMap=function(o,f,m,v){return new gg(this._coreMap,qi).createCloudMap(o,f,m,v)};In.prototype.createTrafficLight=function(o){return this._TrafficLight||(this._TrafficLight=new Lle(this._coreMap,qi)),this._TrafficLight.add(o)};In.prototype.createFieldIntensity=function(o,f){return new Rle(this._coreMap,qi).create(o,f)};In.prototype.createPolylineVolumeLayer=function(o,f,m,v,y,x){return new vd(this._coreMap,qi).createpolylineVolumeGeojsonPrimitiveLayer(o,f,m,v,y,x)};In.prototype.createModelLayer=function(o,f){let m=new uLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.MODELLAYERS),m),m};In.prototype.create3DTilesets=function(o,f){let v=new kT(this._coreMap,qi).create3DTilesets(o.name,o.url,o.option||{},o.style||{},o.GroupID,Z(o.checked,!0),o.success);return v.item.readyPromise&&v.item.readyPromise.catch(function(y){o.fail&&typeof o.fail=="function"&&o.fail(y)}),v.id=Z(o.id,this._earthCtrl.factory.createUUID()),f?this._earthCtrl.userScene.addChild(f,v):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.MODELLAYERS),v),v};In.prototype.createWfsModel=function(o,f){let m=new RU(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.MODELLAYERS),m),m};In.prototype.createModel=function(o,f){let m=new JDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createInstanceModel=async function(o,f){let m=new Hut(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&await m.addToMap(),m};In.prototype.removeModel=function(o){N(o)&&o.removeFromMap()};In.prototype.createCZMLObject=function(o,f){let m=this,v=Z(o.addToMap,!0),y=new bq(o.name);return y.load(o.url),v&&m._earthCtrl.dataSources.add(y),y.id=Z(o.id,this._earthCtrl.factory.createUUID()),f?this._earthCtrl.userScene.addChild(f,y):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),y),y};In.prototype.createObj=function(o={}){let f=new tht(this._earthCtrl,o);return f.name=o.name,f.id=Z(o.id,this._earthCtrl.factory.createUUID()),o.parentNode?this._earthCtrl.userScene.addChild(o.parentNode,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),f),f};In.prototype.createFBX=function(o={}){let f=new iht(this._earthCtrl,o);return f.name=o.name,f.id=Z(o.id,this._earthCtrl.factory.createUUID()),o.parentNode?this._earthCtrl.userScene.addChild(o.parentNode,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),f),f};In.prototype.createClippingBox=function(o){let f=new eht(this._earthCtrl,o);return f.name=o.name,f.id=Z(o.id,this._earthCtrl.factory.createUUID()),f};In.prototype.createElement=function(o){let f={};return f[o.type]=o.parameters,N(o.name)&&(f.name=o.name),N(o.position)&&(f.position=o.position),this._earthCtrl.entities.add(f)};In.prototype.removeElement=function(o){N(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};In.prototype.createVideoProjection=function(o,f){o.addToMap=Z(o.addToMap,!0);let m=Z(o.sourceType,"perspective"),v=null;return m==="perspective"?(v=new zDe(this._earthCtrl,o),v.initialize(o),v.name=o.name,f?this._earthCtrl.userScene.addChild(f,v):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),v)):m==="panorama"?(v=new Tut(this._earthCtrl,o),v.initialize(o),v.name=o.name,v.id=Z(o.id,this._earthCtrl.factory.createUUID()),f?this._earthCtrl.userScene.addChild(f,v):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),v)):m==="fisheye"&&(v=new HDe(this._earthCtrl,o),v.initialize(o),v.name=o.name,v.id=Z(o.id,this._earthCtrl.factory.createUUID()),f?this._earthCtrl.userScene.addChild(f,v):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),v)),v};In.prototype.createTrack=function(o,f){let m=new Sut(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),m.initialize(o),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createSceneNode=function(o,f,m){let v=new $6(this._earthCtrl);return v.id=o,v.name=f,v.label=m,v};In.prototype.createFire=function(o,f){let m=new UDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createSmoke=function(o,f){let m=new GDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createExplosion=function(o,f){let m=new WDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createFireworks=function(o,f){let m=new jDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createRadarScan=function(o,f){let m=new YDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),m.show=!0,f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createCircleScan=function(o,f){let m=new Nut(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),m.show=!0,f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createUpDownScan=function(o){let f=new But(this._earthCtrl,o);return f.show=!0,f};In.prototype.createWaters=function(o,f){let m=new dLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),m.show=!0,f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createHeatMap=function(o,f){return new Ile(this._coreMap,qi).addHeatMap(o,f)};In.prototype.createWindField=function(o,f){let m=new Qut(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createOceanField=function(o,f){let m=new fct(this._coreMap);return m.createField(o,function(){}),m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createLabel=function(o,f){let m=new QDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createBillboard=function(o,f){let m=new XDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createPolyline=function(o,f){let m=new ZDe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createWall=function(o,f){let m=new _ct(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createCorridor=function(o,f){let m=new vct(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createPolygon=function(o,f){let m=new $De(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createPoint=function(o,f){let m=new eLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createBox=function(o,f){let m=new tLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createEllipsoid=function(o,f){let m=new rLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createCylinder=function(o,f){let m=new iLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createRectangle=function(o,f){let m=new nLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createEllipse=function(o,f){let m=new oLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createPolylineVolume=function(o,f){let m=new aLe(this._earthCtrl,o);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createEChartLayer=function(o,f){let m=new hLe(this._earthCtrl);return m.name=o.name,m.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&m.addToMap(o),f?this._earthCtrl.userScene.addChild(f,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(js.USERSCENE),m),m};In.prototype.createPointLight=function(o){let f=new kut(this._earthCtrl,o);return f.name=o.name,f.id=Z(o.id,this._earthCtrl.factory.createUUID()),f};In.prototype.createHawkeye=function(o){let f=new pLe(this._earthCtrl,o);return f.name=o.name,f.id=Z(o.id,this._earthCtrl.factory.createUUID()),Z(o.addToMap,!0)&&f.addToMap(o),f};In.prototype.createSpotLight=function(o){let f=new mLe(this._coreMap,o.entities,o.lights);return f.name=o.name,f.id=Z(o.id,this._earthCtrl.factory.createUUID()),f};In.prototype.createCustomShaderManager=function(o){let f=new qut;return f.name=Z(o.name,null),f.id=Z(o.id,this._earthCtrl.factory.createUUID()),f};In.prototype.createCustomShaderStage=function(o){let f=new Xut(this._earthCtrl,o);return f.name=Z(o.name,null),f.id=Z(o.id,this._earthCtrl.factory.createUUID()),f};In.prototype.createModelOutline=function(o={}){let f=new Jut(this._earthCtrl,o);return f.name=Z(o.name,null),f.id=Z(o.id,this._earthCtrl.factory.createUUID()),f};In.prototype.modelClick=function(o={}){let f=new Kut(this._earthCtrl,o);return f.name=Z(o.name,null),f.id=Z(o.id,this._earthCtrl.factory.createUUID()),f};In.prototype.createDivPoint=function(o,f,m={}){let v=new C8(this._coreMap,qi);return v.id=Z(m.id,this._earthCtrl.factory.createUUID()),v.createDivPoint(o,f,m)};In.prototype.createRichTextPoint=function(o,f,m,v){return new yb(this._coreMap,qi).createRichTextPoint(o,f,m,v)};In.prototype.createSectorScan=function(o,f,m,v,y,x,C){return new bb(this._coreMap,qi,this._earthCtrl).createSectorScan(o,f,m,v,y,x,C)};In.prototype.createSimpleGraphic=function(o,f,m){return this._SimpleGraphic.createSimpleGraphic(o,f,m)};In.prototype.createTrailLineWall=function(o,f){return new kD(this._coreMap,qi).createWall(o,f)};In.prototype.createTrailWallLayer=function(o){return new kD(this._coreMap,qi).createWallLayer(o)};In.prototype.createTrailLine=function(o,f){return new kD(this._coreMap,qi).createLine(o,f)};In.prototype.createTrailLinePath=function(o,f,m){return new kD(this._coreMap,qi).createPath(o,f,m)};In.prototype.createWaterPolygonLayer=function(o={}){let f=Z(o.reflection,!0),m=new vle(this._earthCtrl,qi);return f?m.createReflexPolygonLayer(o):m.createPolygonLayer(o)};In.prototype.createPathLayer=function(o){return new kD(this._coreMap,qi).createPathLayer(o)};In.prototype.createWaterPolygon=function(o){o.viewer=Z(o.viewer,this._earthCtrl.viewer),o.clampToGround=Z(o.clampToGround,!1),o.waterHeight=Z(o.waterHeight,0);let f=new _le(o);f.name=Z(o.name,null),f.id=Z(o.id,this._earthCtrl.factory.createUUID());let m=f.createWaterPolygon(o.positions,o.holes,o.clampToGround,o.waterHeight);return this._earthCtrl.viewer.scene.primitives.add(m),f};In.prototype.addEffectCone=function(o){return new I8(this._coreMap,qi).createCone(o)};In.prototype.addDRWEffectCircle=function(o){return new M8(this._coreMap,qi).createDRWCircle(o)};In.prototype.addRotateEffectCircle=function(o){return new M8(this._coreMap,qi).createRotateCircle(o)};In.prototype.addEffectCylinder=function(o){return new I8(this._coreMap,qi).createCylinder(o)};In.prototype.createFlyingLine=function(o,f){return new kD(this._coreMap,qi).createFlyingLine(o,f)};In.prototype.addTetrahedron=function(o){return new yle(this._coreMap,o,qi)};In.prototype.createPolygonGeoJsonFeatureLayer=function(o,f,m,v,y,x){let C=new vd(this._coreMap,qi);return v&&Ne.selectedItem&&Ne.selectedItem.type==="group"&&(v=Ne.selectedItem.id),v=v&&0,C.createPolygonGeoJsonFeatureLayer(o,f,m,v,y,x)};In.prototype.addSimpleGraphic=function(o,f,m){return this._SimpleGraphic.addSimpleGraphic(o,f,m)};In.prototype.createRectangularSensor=function(o,f,m,v){return new X0(this._coreMap,qi).createRectangularSensor(o,f,m,v)};In.prototype.createRadarMaskScan=function(o,f,m,v){return new X0(this._coreMap,qi).createRadarMaskScan(o,f,m,v)};In.prototype.createLink=function(o,f,m){return new _g(this._coreMap,qi).createLink(o,f,m)};In.prototype.createLinkPro=function(o,f,m){return new _g(this._coreMap,qi).createLinkPro(o,f,m)};In.prototype.createMultiCircleScan=function(o,f,m,v,y){return new bb(this._coreMap,qi).createMultiCircleScan(o,f,m,v,y)};In.prototype.createRadarScansss=function(o,f,m,v,y){return new bb(this._coreMap,qi).createRadarScan(o,f,m,v,y)};In.prototype.createRoad=function(o={}){return new kct(this._coreMap,qi).createRoad(o)};In.prototype.createSatelliteTrail=function(o){return new Cle(this._coreMap,qi).createSatelliteTrail(o)};In.prototype.ConicSensor=function(o,f,m){return new ble(this._coreMap,qi).create(o,f,m)};In.prototype.militaryPlotting=function(o,f,m,v){let y=this._straightArrow,x=null,C,w;m?typeof m=="function"?(C={},w=m):(C=m,w=v):C={};let A=E=>{C.removeEdit&&y.MilitaryStandardObj.pop(),y.defaultEdit(),w&&w(E)};switch(o){case"StraightArrow":x=y.createStraightArrow(f,C,A);break;case"SwallowtailArrow":x=y.createSwallowtailArrow(f,C,A);break;case"PincerArrow":x=y.createPincerArrow(f,C,A);break;case"AttackArrow":x=y.createAttackArrow(f,C,A);break;case"GatheringPlace":x=y.createHandlerPolygon(f,C,A);break;case"RoundedRectangle":x=y.createRoundedRectangle(f,C,A);break;case"Sector":x=y.createSector(f,C,A);break;case"Bow":x=y.createBow(f,C,A);break;case"Bezierline":x=y.createBezierline(C,A);break;case"BezierArrow":x=y.createBezierArrow(C,A);break;case"DemarcationLine":x=y.createDemarcationLine(C,A);break;case"Type_10_35000":x=y.Type_10_35000(C,A);break;case"Type_10_29100":x=y.Type_10_29100(C,A);break;case"Type_10_33400":x=y.Type_10_33400(C,A);break;case"Type_10_33401":x=y.Type_10_33401(C,A);break;case"Type_10_33402":x=y.Type_10_33402(C,A);break;case"Type_10_33403":x=y.Type_10_33403(C,A);break;case"Type_10_33404":x=y.Type_10_33404(C,A);break;case"Type_10_34300":x=y.Type_10_34300(C,A);break;case"Type_10_34900":x=y.Type_10_34900(C,A);break;case"Type_10_34901":x=y.Type_10_34901(C,A);break;case"Type_10_34902":x=y.Type_10_34902(C,A);break;case"Type_10_33700":x=y.Type_10_33700(C,A);break;case"Type_10_34700":x=y.Type_10_34700(C,A);break;case"Type_10_34400":x=y.Type_10_34400(C,A);break;case"Type_10_34500":x=y.Type_10_34500(C,A);break;case"Type_10_34501":x=y.Type_10_34501(C,A);break;case"Type_10_35200":x=y.Type_10_35200(C,A);break;default:break}return x};In.prototype.MilitaryCopy=function(o){return this._straightArrow.copyJb(o)};In.prototype.SaveMilitaryStandard=function(o,f,m){return this._straightArrow.save(o,f,m)};In.prototype.OpenMilitaryStandard=function(o,f,m,v,y){return this._straightArrow.open(o,f,m,v,y)};In.prototype.ClearMilitaryStandard=function(){this._straightArrow.clear()};In.prototype.getEntityById=function(o){return this._straightArrow.getEntityById(o)};In.prototype.startModify=function(o){this._straightArrow.edit(o)};In.prototype.createModelLibrary=function(o){return this._popupmessage.createModelLibrary(o)};In.prototype.getFlyData=function(o,f){this._createdynamicObject.getFlyData(o,f)};In.prototype.createDynamicObject=function(o,f,m){return this._createdynamicObject.Start(o,f,m)};In.prototype.addmodle=function(o){return this._createdynamicObject.addmodle(o)};In.prototype.executePauseFly3DPaths=function(){return this._createdynamicObject.executePauseFly3DPaths()};In.prototype.executePlayForwardFly3DPaths=function(){return this._createdynamicObject.executePlayForwardFly3DPaths()};In.prototype.executePlayReverseFly3DPaths=function(){return this._createdynamicObject.executePlayReverseFly3DPaths()};In.prototype.executeSignout=function(){return this._createdynamicObject.executeSignout()};In.prototype.SkyBox=function(o,f){return this._skyBox.SkyBox(o,f)};In.prototype.setSpaceBackground=function(o){return this._skyBox.setSpaceBackground(o)};In.prototype.createScreenshot=function(o){return this._screenshot.createScreenshot(o)};In.prototype.createVolumetricCloud=function(o){return new pct(this._earthCtrl,this._coreMap).createCloud(o)};In.prototype.createGraticules=function(o){let f=new lpt(this._earthCtrl,this._coreMap);return f.createGraticules(o),f};In.prototype.createContourLabel=function(o){let f=new upt(this._earthCtrl,this._coreMap);return f.createContourLabel(o),f};In.prototype.createRegionWeather=function(o){let f=new cpt(this._earthCtrl,this._coreMap);return f.createRegionWeather(o),f};In.prototype.createSem=function(o){let f=new Gdt(this._earthCtrl,o);return f.loadCityJson(),f};In.prototype.createSlopeArrow=function(o){let f=new hpt(this._coreMap.scene,o);return f.createSlopeArrow(),f};In.prototype.createRegionTerrain=function(o){let f=new dpt(this._coreMap.scene,o);return f.createRegionTerrain(),f};Object.defineProperties(In.prototype,{SimpleGraphic:{get:function(){return this._SimpleGraphic}},MilitaryPlotting:{get:function(){return this._straightArrow}},layerTree:{get:function(){return this._layerTree}}});var $D=In;var Aue=class extends Dm{constructor(f,m){super(f),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new kDe(f);let v=new $6(f);v.id=$D.createUUID(),v.name=Z(m.ProjectName,"root"),v.version=Z(m.version,null),v.desc=Z(m.desc,null),v.createTime=Z(m.createTime,new Date().toISOString()),v.lastUpdate=Z(m.lastUpdate,null),v.show=!0,this._rootNode=v,this._editNode=v,this._objectMap[v.id]=v,this._EventDocumentChanged=new C4("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(f){return this._objectMap.hasOwnProperty(f)?this._objectMap[f]:null}addChild(f,m){f.addChild(m),this._objectMap[m.id]=m,this._isBenchUpdate||this.commitChanged()}removeChildById(f){let m=this._objectMap[f];N(m)&&this.removeChild(m)}removeChild(f){N(f)&&N(f.parentNode)&&(f.removeFromMap(),f.parentNode.removeChild(f)),delete this._objectMap[f.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(f,m){N(f)&&N(f._primitive)&&(f=f._primitive),this._earthCtrl.coreMap.flyTo(f,m)}findLocationByID(f,m){if(!f)return;let v=this.getChildById(f);N(v)&&N(v._primitive)&&(v=v._primitive),this._earthCtrl.coreMap.flyTo(v,m)}moveLayer(f,m){let v=this.getChildById(f),y=null;for(let x=0;x<v.parentNode.childNodes.length;x++)v.parentNode.childNodes[x].id===v.id&&(y=x);m==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(v._primitive),this.changeLayer(v.parentNode.childNodes,y,y+1)):m==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(v._primitive),this.changeLayer(v.parentNode.childNodes,y,y-1))}changeLayer(f,m,v){if(m=xe.clamp(m,0,f.length-1),v=xe.clamp(v,0,f.length-1),m===v)return;let y=f[m];f[m]=f[v],f[v]=y}outputJson(f){let m=this;new Promise(function(y,x){let C={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},w=0,A=[];for(let E in C){let T=C[E],S=m.rootNode.getChildByName(T);if(!S)continue;let M=[];if(S.childNodes.length===0)M=[];else for(let I=0;I<S.childNodes.length;I++){let P=S.childNodes[I].toJSON();M.push(P)}Promise.all(M).then(function(I){let P=[];if(I.length!==0){for(let R=0;R<I.length;R++)P.push(I[R]);let D=P[0].class;D!=="IMAGERY_LAYER"&&D!=="TERRAIN_LAYER"&&D!=="MODEL_LAYER"&&D!=="FEATURE_LAYER"&&(D="USER_SCENE");let L={item:D,objJson:P};A.push(L)}w++,w===5&&(y(A),w=0)})}}).then(function(y){let x={version:m.rootNode.version,projectName:m.rootNode.name,desc:m.rootNode.desc,createTime:m.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let T=0;T<y.length;T++)y[T].item==="IMAGERY_LAYER"&&(x.imageryProviders=y[T].objJson),y[T].item==="TERRAIN_LAYER"&&(x.terrainProviders=y[T].objJson),y[T].item==="MODEL_LAYER"&&(x.modelLayers=y[T].objJson),y[T].item==="FEATURE_LAYER"&&(x.featureLayers=y[T].objJson),y[T].item==="USER_SCENE"&&(x.userScene=y[T].objJson);let C={class:"ENVIRONMENT",underGround:Z(m._earthCtrl.camera.undergroundMode,null),shadow:Z(m._earthCtrl.shadows,null),depthTest:Z(m._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:Z(m._earthCtrl.environment.rain.show,null),snow:Z(m._earthCtrl.environment.snow.show,null),fog:Z(m._earthCtrl.environment.fog.show,null),bwMode:Z(m._earthCtrl.environment.bwMode.show,null),nightMode:Z(m._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:Z(m._earthCtrl.environment.colorAdjustment.show,null),contrast:Z(m._earthCtrl.environment.colorAdjustment.contrast,null),saturation:Z(m._earthCtrl.environment.colorAdjustment.saturation,null),brightness:Z(m._earthCtrl.environment.colorAdjustment.brightness,null)}},w={class:"SKYBOX",positiveX:Z(m._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:Z(m._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:Z(m._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:Z(m._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:Z(m._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:Z(m._earthCtrl.environment.SkyBoxSource.negativeZ,null)},A={class:"VIEWPOINT",lon:m._earthCtrl.camera.viewPoint.lon,lat:m._earthCtrl.camera.viewPoint.lat,alt:m._earthCtrl.camera.viewPoint.alt,heading:m._earthCtrl.camera.viewPoint.heading,pitch:m._earthCtrl.camera.viewPoint.pitch,roll:m._earthCtrl.camera.viewPoint.roll,duration:m._earthCtrl.camera.viewPoint.duration};x.userScene.push(C),x.userScene.push(w),x.userScene.push(A);let E=JSON.stringify(x);f&&f(E)})}};Object.defineProperties(Aue.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var jRe=Aue;function xpt(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var fpr=new _s,ppr=new H,mpr=new H;xpt.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let f=this._coreMap;f.container.appendChild(o);let m="float: right; min-width: 100px;margin-right: 20px;",v=document.createElement("div");v.style=m,o.appendChild(v);let y=document.createElement("div");y.style=m,o.appendChild(y);let x=document.createElement("div");x.style=m,o.appendChild(x);let C=f.scene.canvas,w=f.scene.globe.ellipsoid,A=new Ur(C),E=this._earthCtrl;A.setInputAction(function(T){let S=f.camera.pickEllipsoid(T.endPosition,w);if(S){let M=f.scene.globe.ellipsoid.cartesianToCartographic(S),I=xe.toDegrees(M.latitude).toFixed(6),P=xe.toDegrees(M.longitude).toFixed(6),D=f.camera.positionCartographic.height.toFixed(1);x.innerHTML=`${E.language.INFORMATION_BAR_LON}${P}`,y.innerHTML=`${E.language.INFORMATION_BAR_LAT}${I}`,v.innerHTML=`${E.language.INFORMATION_BAR_VIEW_HEIGHT}${D}${E.language.UNIT_METER}`}},Ei.MOUSE_MOVE)};var Cpt=xpt;function Iu(){}Iu.parseBaseData=function(o,f){let m=[];if(N(f)&&N(f.imageryProviders))for(let y=0;y<f.imageryProviders.length;y++){let x=f.imageryProviders[y];if(x.enable===!1||x.show===!1)continue;if(N(x.tilingScheme)){let w=x.tilingScheme;w.type==="GeographicTilingScheme"&&(x.tilingScheme=new Bd(w))}let C=$D.createImageryLayer(x);m.push(C)}let v=[];if(N(f)&&N(f.terrainProviders))for(let y=0;y<f.terrainProviders.length;y++){let x=f.terrainProviders[y];if(x.enable===!1||x.show===!1)continue;let C=$D.createTerrainLayer(x);v.push(C)}return{imageryProvider:m,terrainProvider:v}};Iu.parse=function(o,f){if(!N(f))return;let m=[js.IMAGERYPROVIDERS,js.TERRAINPROVIDERS,js.MODELLAYERS,js.FEATURELAYERS,js.USERSCENE];for(let v=0;v<m.length;v++){let y=o.factory.createSceneNode($D.createUUID(),m[v]);y.show=!0,o.userScene.addChild(o.userScene.rootNode,y)}N(f[js.IMAGERYPROVIDERS])&&iG(o,f[js.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),N(f[js.TERRAINPROVIDERS])&&iG(o,f[js.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),N(f[js.MODELLAYERS])&&iG(o,f[js.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),N(f[js.FEATURELAYERS])&&iG(o,f[js.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),N(f[js.USERSCENE])&&iG(o,f[js.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function iG(o,f,m,v){for(let y=0;y<f.length;y++){let x=f[y],C=null;if(x.enable===!1)continue;N(x.class)?(x.class==="IMAGERY"&&(x.class=Ko.IMAGERY_LAYER),x.class==="TERRAIN"&&(x.class=Ko.TERRAIN_LAYER),C=x.class):(v===0?x.class=Ko.IMAGERY_LAYER:v===1&&(x.class=Ko.TERRAIN_LAYER),C=x.class);let w=Iu.parserMap[C];w!==void 0&&w(o,x,m)}}function uUi(o,f,m){let v=o.factory.createSceneNode(f.id,f.name);v.show=Z(f.show,!0),o.userScene.addChild(m,v),N(f.childNodes)&&iG(o,f.childNodes,v)}function cUi(o,f,m){let v=f;if(N(v.tilingScheme)){let y=v.tilingScheme;y.type==="GeographicTilingScheme"&&(v.tilingScheme=new Bd(y))}o.factory.createImageryLayer(v,m)}function hUi(o,f,m){let v=f;o.factory.createTerrainLayer(v,m)}function dUi(o,f,m){let v=f;v.addToMap=!0;let y=v.sourceType;y==="3DTiles"||y==="b3dm"||y==="osgb"||y==="s3m"||y==="ude_block"||y==="ude_model"?o.factory.createModelLayer(v,m):y==="czml"?o.factory.createCZMLObject(v,m):y==="wfsModel"&&o.factory.createWfsModel(v,m)}function fUi(o,f,m){let v=o.factory.createFeatureLayer(f,m)}function pUi(o,f,m){o.coreMap.scene.skyBox=new r4({sources:{positiveX:f.positiveX,negativeX:f.negativeX,positiveY:f.positiveY,negativeY:f.negativeY,positiveZ:f.positiveZ,negativeZ:f.negativeZ}})}function mUi(o,f,m){o.camera.undergroundMode=Z(f.underGround,!1),o.shadows=Z(f.shadow,!1),f.rain===!0&&o.environment.showEffect("rain"),f.snow===!0&&o.environment.showEffect("snow"),f.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=Z(f.depthTest,!1),f.bwMode===!0&&o.environment.showEffect("bwMode"),f.nightMode===!0&&o.environment.showEffect("nightMode"),f.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=f.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=f.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=f.colorAdjustment.brightness)}function gUi(o,f,m){o.camera.viewPoint=f,o.camera.flyTo(f.lon,f.lat,f.alt,f.heading,f.pitch,f.roll,f.duration)}function _Ui(o,f,m){o.factory.createModel(f,m)}function vUi(o,f,m){o.factory.createWaters(f,m)}function yUi(o,f,m){o.factory.createExplosion(f,m)}function xUi(o,f,m){o.factory.createFireworks(f,m)}function CUi(o,f,m){o.factory.createSmoke(f,m)}function bUi(o,f,m){o.factory.createFire(f,m)}function wUi(o,f,m){f.color&&(f.color=new Re(f.color.red,f.color.green,f.color.blue,f.color.alpha)),o.factory.createRadarScan(f,m)}function AUi(o,f,m){f.color&&(f.color=new Re(f.color.red,f.color.green,f.color.blue,f.color.alpha)),o.factory.createCircleScan(f,m)}function EUi(o,f,m){f.color&&(f.color=new Re(f.color.red,f.color.green,f.color.blue,f.color.alpha)),f.outlineColor&&(f.outlineColor=new Re(f.color.red,f.color.green,f.color.blue,f.color.alpha)),o.factory.createPoint(f,m)}function TUi(o,f,m){f.fillColor&&(f.fillColor=new Re(f.fillColor.red,f.fillColor.green,f.fillColor.blue,f.fillColor.alpha)),o.factory.createLabel(f,m)}function SUi(o,f,m){o.factory.createBillboard(f,m)}function PUi(o,f,m){f.positions&&(f.positions=Iu.array2DtoMercator(f.positions)),f.lineColor&&(f.lineColor=new Re(f.lineColor.red,f.lineColor.green,f.lineColor.blue,f.lineColor.alpha)),f.outlineColor&&(f.outlineColor=new Re(f.outlineColor.red,f.outlineColor.green,f.outlineColor.blue,f.outlineColor.alpha)),o.factory.createPolyline(f,m)}function IUi(o,f,m){f.material&&(f.material=new Re(f.material.red,f.material.green,f.material.blue,f.material.alpha)),f.outlineColor&&(f.outlineColor=new Re(f.outlineColor.red,f.outlineColor.green,f.outlineColor.blue,f.outlineColor.alpha)),f.positions&&(f.positions=Iu.array2DtoMercator(f.positions)),o.factory.createPolygon(f,m)}function MUi(o,f,m){f.coordinates&&(f.coordinates=Di.fromDegrees(f.coordinates[0],f.coordinates[1],f.coordinates[2],f.coordinates[3])),f.fillColor&&(f.fillColor=new Re(f.fillColor.red,f.fillColor.green,f.fillColor.blue,f.fillColor.alpha)),f.outlineColor&&(f.outlineColor=new Re(f.outlineColor.red,f.outlineColor.green,f.outlineColor.blue,f.outlineColor.alpha)),o.factory.createRectangle(f,m)}function DUi(o,f,m){o.factory.createEllipse(f,m)}function LUi(o,f,m){f.material&&(f.material=new Re(f.material.red,f.material.green,f.material.blue,f.material.alpha)),f.outlineColor&&(f.outlineColor=new Re(f.outlineColor.red,f.outlineColor.green,f.outlineColor.blue,f.outlineColor.alpha)),f.position&&(f.position=H.fromDegrees(f.position[0],f.position[1],f.position[2])),f.dimensions&&(f.dimensions=new H(f.dimensions.x,f.dimensions.y,f.dimensions.z)),o.factory.createBox(f,m)}function RUi(o,f,m){f.material&&(f.material=new Re(f.material.red,f.material.green,f.material.blue,f.material.alpha)),f.outlineColor&&(f.outlineColor=new Re(f.outlineColor.red,f.outlineColor.green,f.outlineColor.blue,f.outlineColor.alpha)),f.position&&(f.position=H.fromDegrees(f.position[0],f.position[1],f.position[2])),f.radii&&(f.radii=new H(f.radii[0],f.radii[1],f.radii[2])),o.factory.createEllipsoid(f,m)}function OUi(o,f,m){f.material&&(f.material=new Re(f.material.red,f.material.green,f.material.blue,f.material.alpha)),f.outlineColor&&(f.outlineColor=new Re(f.outlineColor.red,f.outlineColor.green,f.outlineColor.blue,f.outlineColor.alpha)),f.position&&(f.position=H.fromDegrees(f.position[0],f.position[1],f.position[2])),o.factory.createCylinder(f,m)}function NUi(o,f,m){o.factory.createPolylineVolume(f,m)}function FUi(o,f,m){o.factory.createVideoProjection(f,m)}function BUi(o,f,m){o.factory.createVideoProjection(f,m)}function kUi(o,f,m){o.factory.createTrack(f,m)}function VUi(o,f,m){o.factory.createHeatmap(f,m)}function zUi(o,f,m){o.factory.createEChartLayer(f,m)}function HUi(o,f,m){let v=o.factory.createElement(f);o.userScene.addChild(m,v)}Iu.array2DtoMercator=function(o){let f=[];return o.forEach(function(m){let v=H.fromDegrees(m[0],m[1],m[2]);f.push(v)}),f};Iu.parserMap={};Iu.parserMap[Ko.NODE]=uUi;Iu.parserMap[Ko.IMAGERY_LAYER]=cUi;Iu.parserMap[Ko.TERRAIN_LAYER]=hUi;Iu.parserMap[Ko.MODEL_LAYER]=dUi;Iu.parserMap[Ko.FEATURE_LAYER]=fUi;Iu.parserMap[Ko.SKYBOX]=pUi;Iu.parserMap[Ko.ENVIRONMENT]=mUi;Iu.parserMap[Ko.VIEWPOINT]=gUi;Iu.parserMap[Ko.MODEL]=_Ui;Iu.parserMap[Ko.WATERS]=vUi;Iu.parserMap[Ko.EXPLOSION]=yUi;Iu.parserMap[Ko.FIREWORK]=xUi;Iu.parserMap[Ko.SMOKE]=CUi;Iu.parserMap[Ko.FIRE]=bUi;Iu.parserMap[Ko.RADARSCAN]=wUi;Iu.parserMap[Ko.CIRCLESCAN]=AUi;Iu.parserMap[Ko.POINT]=EUi;Iu.parserMap[Ko.LABEL]=TUi;Iu.parserMap[Ko.BILLBOARD]=SUi;Iu.parserMap[Ko.POLYLINE]=PUi;Iu.parserMap[Ko.POLYGON]=IUi;Iu.parserMap[Ko.RECTANGLE]=MUi;Iu.parserMap[Ko.ELLIPSE]=DUi;Iu.parserMap[Ko.BOX]=LUi;Iu.parserMap[Ko.ELLIPSOID]=RUi;Iu.parserMap[Ko.CYLINDER]=OUi;Iu.parserMap[Ko.POLYLINEVOLUME]=NUi;Iu.parserMap[Ko.PERSPECTIVE_VIDEO_PROJECTION]=FUi;Iu.parserMap[Ko.FISHEYE_VIDEO_PROJECTION]=BUi;Iu.parserMap[Ko.TRACK]=kUi;Iu.parserMap[Ko.HEATMAP]=VUi;Iu.parserMap[Ko.ECHARTLAYER]=zUi;Iu.parserMap.ELEMENT=HUi;var bpt=Iu;var YRe=null;function rG(o,f){YRe=f,this._viewer=o,this._cesium=YRe,this._core=new Sr(o,YRe),this.points=[],this._SimpleGraphic=new P8(this._viewer,this._cesium),this._SimpleGraphic.setEdit(!1)}rG.prototype.createSightLine=function(o={}){return o.type==="circle"?this._SimpleGraphic.createCircle({},(f,m)=>{let{distance:v,positions:y}=m;this._SimpleGraphic.remove(f.id);let x=this._core.toDegrees(y[1]);y[1]=this._cesium.Cartesian3.fromDegrees(x.lon,x.lat,x.height+(o.height||1.8)),this.createPoint(y[1],"\u89C2\u5BDF\u70B9");let C=[x.lon,x.lat];this._cesium.turf.circle(C,v,{steps:o.steps||64,units:"meters"}).geometry.coordinates[0].forEach(A=>{let E=this._viewer.scene.globe.getHeight(this._cesium.Cartographic.fromDegrees(A[0],A[1])),T=this._cesium.Cartesian3.fromDegrees(A[0],A[1],E),S=this._viewer.scene.clampToHeight(T);this.createLine([y[1],S||T])})}):this._SimpleGraphic.createPolyline({toPoint:!0,clampToGround:!1},(f,m)=>{this._SimpleGraphic.remove(f.id);let v=this._core.toDegrees(m[0]);m[0]=this._cesium.Cartesian3.fromDegrees(v.lon,v.lat,v.height+(o.height||1.8)),this.createLine(m),this.createPoint(m[0],"\u89C2\u5BDF\u70B9"),this.createPoint(m[1],"\u76EE\u6807\u70B9")}),this};rG.prototype.createLine=async function(o,f){let m=this._core.pickFromRay(this._viewer,o[0],o[1],f);m&&m.position?(this._SimpleGraphic.addPolyline({positions:[o[0],m.position],color:"#00ff00",clampToGround:!1}),this._SimpleGraphic.addPolyline({positions:[m.position,o[1]],color:"#ff0000",depthFailColor:"#ff00c6",clampToGround:!1})):this._SimpleGraphic.addPolyline({positions:o,color:"#00ff00",clampToGround:!1})};rG.prototype.createPoint=function(o,f){this._SimpleGraphic.addPoint({position:o,pixelSize:8,heightReference:0}),f&&this._SimpleGraphic.addLabel({text:f,position:o,font:"bold 18px \u5B8B\u4F53",outlineWidth:2,verticalOrigin:1,pixelOffset:new this._cesium.Cartesian2(0,-18),heightReference:0})};rG.prototype.setVisibility=function(o){};rG.prototype.deleteObject=function(){this._SimpleGraphic.clear()};var wpt=rG;var aN;function OJ(o,f){this._viewer=o,this._cesium=f,this.left=[],this.right=[]}OJ.prototype.createSlider=function(){this.close();let o=document.createElement("div");o.id="slider",o.style.position="absolute",o.style.cursor="e-resize",o.style.top=0,o.style.backgroundColor="#D3D3D3",o.style.width="8px",o.style.height="100%",o.style.zIndex="1000",o.style.left="50%",this._viewer.container.appendChild(o),this._viewer.scene.splitPosition=o.offsetLeft/o.parentElement.offsetWidth,o.addEventListener("mousedown",Apt,!1),this.slider=o,aN={dragStartX:0,slider:o,scene:this._viewer.scene}};OJ.prototype.curtainContrast=function(o,f){this.createSlider();let m=this._viewer.imageryLayers.get(o),v=this._viewer.imageryLayers.get(f);this.left.push(m),this.right.push(v),m.splitDirection=-1,v.splitDirection=1};OJ.prototype.curtainContrastPro=function(o){this.createSlider(),o.left.forEach(f=>{f.splitDirection=-1,f.item&&(f.item.splitDirection=-1)}),o.right.forEach(f=>{f.splitDirection=1,f.item&&(f.item.splitDirection=1)}),this.left.push(...o.left),this.right.push(...o.right)};function qRe(){window.removeEventListener("mousemove",XRe,!1),window.removeEventListener("mouseup",qRe,!1)}function Apt(o){aN.dragStartX=o.clientX-aN.slider.offsetLeft,window.addEventListener("mousemove",XRe,!1),window.addEventListener("mouseup",qRe,!1)}function XRe(o){let f=(o.clientX-aN.dragStartX)/aN.slider.parentElement.offsetWidth;aN.slider.style.left=100*f+"%",aN.scene.splitPosition=f}OJ.prototype.close=function(){this.slider&&(this._viewer.scene.splitPosition=0,this.slider.removeEventListener("mousedown",Apt,!1),window.removeEventListener("mouseup",qRe,!1),window.removeEventListener("mousemove",XRe,!1),this.slider.remove(),this.slider=null,this.left.forEach(o=>{o.splitDirection=0,o.item&&(o.item.splitDirection=0)}),this.right.forEach(o=>{o.splitDirection=0,o.item&&(o.item.splitDirection=0)}),this.left=[],this.right=[],aN=null)};var Ept=OJ;var UUi=null;function LA(o,f){UUi=f,this._core=new Sr(o,f),this._viewer=o,this._cesium=f,this.camera=this._viewer.scene.camera,this.collision=!1,this.indoor_data={X_speedScale:1,Y_speedScale:.8,moveRate:.2,movementX:0,movementY:0,moveFactor:0,enable_looking:!1},this.flags={looking:!1,moveForward:!1,moveBackward:!1,moveUp:!1,moveDown:!1,moveLeft:!1,moveRight:!1}}LA.prototype.createIndoormode=function(o={}){let f=this._viewer.scene,m=this._viewer.canvas;if(m.setAttribute("tabindex","0"),m.focus(),m.onclick=function(){m.focus()},f.screenSpaceCameraController.enableRotate=!1,f.screenSpaceCameraController.enableTranslate=!1,f.screenSpaceCameraController.enableZoom=!1,f.screenSpaceCameraController.enableTilt=!1,f.screenSpaceCameraController.enableLook=!1,this.bindEvent={pointerlockchange:this.pointerlockchange.bind(this),mousemove:this.mousemove.bind(this),keydown:this.keydown.bind(this),keyup:this.keyup.bind(this),mousewheel:this.mousewheel.bind(this),dblclick:this.dblclick.bind(this)},document.addEventListener("pointerlockchange",this.bindEvent.pointerlockchange,!1),document.addEventListener("mousemove",this.bindEvent.mousemove,!1),document.addEventListener("keydown",this.bindEvent.keydown,!1),document.addEventListener("keyup",this.bindEvent.keyup,!1),document.addEventListener("mousewheel",this.bindEvent.mousewheel,!1),document.addEventListener("dblclick",this.bindEvent.dblclick,!1),this._viewer.clock.onTick.addEventListener(this.onTick,this),this._viewer.container.requestPointerLock(),o.showHelp){let v=o.helpPosition||{left:"20px",bottom:"20px"};this.explainContainer=document.createElement("div"),this.explainContainer.id="IndoormodeExplainContainer",this.explainContainer.style.cssText=` position: absolute; padding: 10px; background-color: rgba(0, 0, 0, 0.6); border: 1px solid rgba(32, 160, 255, 0.6); color: rgb(255, 255, 255); font-size: 16px; font-family: \u5FAE\u8F6F\u96C5\u9ED1; border-radius: 5px; z-index: 999; `;for(let y in v)this.explainContainer.style[y]=v[y];this.explainContainer.innerHTML="W\uFF1A\u524D\uFF1BS\uFF1A\u540E\uFF1BA\uFF1A\u5DE6\uFF1BD\uFF1A\u53F3<br>Q\uFF1A\u4E0A\uFF1BE\uFF1A\u4E0B<br>\u53CC\u51FB\uFF1A\u78B0\u649E\u68C0\u6D4B\uFF1B\u6EDA\u8F6E\uFF1A\u79FB\u52A8\u901F\u5EA6<br>\u9F20\u6807\u79FB\u52A8\uFF1A\u65B9\u5411\u63A7\u5236\uFF1BEsc\uFF1A\u9000\u51FA",this._viewer.container.append(this.explainContainer)}return this};LA.prototype.dblclick=function(o){o.button===0&&(this.collision=!this.collision,layuiLayer.msg(this.collision?"\u5F00\u542F\u78B0\u649E\u68C0\u6D4B":"\u5173\u95ED\u78B0\u649E\u68C0\u6D4B"))};LA.prototype.mousemove=function(o){if(this.indoor_data.enable_looking){this.indoor_data.movementX=o.movementX,this.indoor_data.movementY=o.movementY;let f=this._viewer.canvas.clientWidth,m=this._viewer.canvas.clientHeight,v=this.indoor_data.movementX/f,y=-this.indoor_data.movementY/m;(!this.camera.roll&&this.camera.pitch<0&&y<0||!this.camera.roll&&this.camera.pitch>0&&y>0)&&(y=0),this.camera.rotate(this.camera.position,v*this.indoor_data.X_speedScale),this.camera.lookUp(y*this.indoor_data.Y_speedScale)}};LA.prototype.mousewheel=function(o){o.wheelDelta>0?this.indoor_data.moveRate+=.02:this.indoor_data.moveRate-=.02,this.indoor_data.moveRate>1&&(this.indoor_data.moveRate=1),this.indoor_data.moveRate<.1&&(this.indoor_data.moveRate=.1)};LA.prototype.pointerlockchange=function(){document.pointerLockElement?this.indoor_data.enable_looking=!0:this.indoor_data.enable_looking&&this.close()};LA.prototype.keydown=function(o){let f=this.getFlagForKeyCode(o.keyCode);typeof f<"u"&&(this.flags[f]=!0)};LA.prototype.keyup=function(o){let f=this.getFlagForKeyCode(o.keyCode);typeof f<"u"&&(this.flags[f]=!1)};LA.prototype.getFlagForKeyCode=function(o){switch(o){case"W".charCodeAt(0):return"moveForward";case"S".charCodeAt(0):return"moveBackward";case"Q".charCodeAt(0):return"moveUp";case"E".charCodeAt(0):return"moveDown";case"D".charCodeAt(0):return"moveRight";case"A".charCodeAt(0):return"moveLeft";default:return}};LA.prototype.onTick=function(){let o=this.camera,f=this._viewer.scene.globe.getHeight(o.positionCartographic),m=o.positionCartographic.height;this.indoor_data.moveFactor=m-f;let v=this.indoor_data.moveFactor>100?this.indoor_data.moveFactor/100:this.indoor_data.moveRate;this.oldCameraPosition={position:o.position.clone(),heading:o.heading,pitch:o.pitch,roll:o.roll},this.flags.moveForward&&o.moveForward(v),this.flags.moveBackward&&o.moveBackward(v),this.flags.moveUp&&o.moveUp(v),this.flags.moveDown&&o.moveDown(v),this.flags.moveLeft&&o.moveLeft(v),this.flags.moveRight&&o.moveRight(v),this.collision&&this.checkCollision()};LA.prototype.checkCollision=function(){let o=this._core.pickFromRay(this._viewer,this.oldCameraPosition.position,this.camera.position);o&&o.position&&this._cesium.Cartesian3.distance(this.oldCameraPosition.position,o.position)<1&&this.camera.setView({destination:this.oldCameraPosition.position,orientation:{heading:this.oldCameraPosition.heading,pitch:this.oldCameraPosition.pitch,roll:this.oldCameraPosition.roll}});let f=this.camera.positionCartographic.clone();if(f.height-=1,f=this._cesium.Cartographic.toCartesian(f),o=this._core.pickFromRay(this._viewer,this.camera.position,f),o&&o.position&&this._cesium.Cartesian3.distance(this.camera.position,o.position)!==1.65){let m=1.65-this._cesium.Cartesian3.distance(this.camera.position,o.position);f=this.camera.positionCartographic.clone(),f.height+=m,f=this._cesium.Cartographic.toCartesian(f),this.camera.setView({destination:f,orientation:{heading:this.oldCameraPosition.heading,pitch:this.oldCameraPosition.pitch,roll:this.oldCameraPosition.roll}})}};LA.prototype.close=function(){this._handler&&this._handler.destroy(),this._handler=null,this.bindEvent&&(document.removeEventListener("pointerlockchange",this.bindEvent.pointerlockchange,!1),document.removeEventListener("mousemove",this.bindEvent.mousemove,!1),document.removeEventListener("keydown",this.bindEvent.keydown,!1),document.removeEventListener("keyup",this.bindEvent.keyup,!1),document.removeEventListener("mousewheel",this.bindEvent.mousewheel,!1),document.removeEventListener("dblclick",this.bindEvent.dblclick,!1),this.bindEvent=null),this.collision=!1,this._viewer.clock.onTick.removeEventListener(this.onTick,this),this.explainContainer&&this.explainContainer.remove(),this.explainContainer=null,document.exitPointerLock(),this.indoor_data.enable_looking=!1,document.body.style.cursor="default",this._viewer.scene.screenSpaceCameraController.enableRotate=!0,this._viewer.scene.screenSpaceCameraController.enableTranslate=!0,this._viewer.scene.screenSpaceCameraController.enableZoom=!0,this._viewer.scene.screenSpaceCameraController.enableTilt=!0,this._viewer.scene.screenSpaceCameraController.enableLook=!0};var ek=LA;var NJ=null;function JRe(o,f){NJ=f,this._viewer=o,this._cesium=f}JRe.prototype.createWeather=function(o,f,m){var v=this._viewer.scene.postProcessStages,y=null,x=null,C=null,w=null,A={test1:{min:10,max:160},test2:{min:.5,max:3},test3:{min:-1,max:1},test4:{min:0,max:1}},E={test1:{min:10,max:160},test2:{min:0,max:1},test3:{min:0,max:.7},test4:{min:.1,max:.9}};if(o==="sun"){this.createWeather("rain",!1),this.createWeather("snow",!1),this.createWeather("fog",!1);return}switch(o){case"rain":if(y=m,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(M){M&&M.name==="rain"&&v.remove(M)}),f){if(y?x={test1:m.test1,test2:m.test2,test3:m.test3,test4:m.test4}:(x={test1:7,test2:.3,test3:-.4,test4:1},y={test1:7,test2:.3,test3:-.4,test4:1}),x.test1=(10-parseFloat(x.test1))*15+10,x.test2=parseFloat(x.test2)*2.5+.5,x.test1>A.test1.max||x.test1<A.test1.min||x.test2>A.test2.max||x.test2<A.test2.min||x.test3>A.test3.max||x.test3<A.test3.min||x.test4>A.test4.max||x.test4<A.test4.min)return;x.test1=this.getValue(x.test1+""),x.test2=this.getValue(x.test2+""),x.test3=this.getValue(x.test3+""),x.test4=this.getValue(x.test4+"");var T=new this._cesium.PostProcessStage({name:"rain",fragmentShader:`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float hash(float x){ return fract(sin(x*133.3)*13.13); } void main(void){ float time = czm_frameNumber / `+x.test1+`; vec2 resolution = czm_viewport.zw; vec2 uv=(gl_FragCoord.xy*`+x.test2+`-resolution.xy)/min(resolution.x,resolution.y); vec3 c=vec3(.6,.7,.8); float a=`+x.test3+`; float si=sin(a),co=cos(a); uv*=mat2(co,-si,si,co); uv*=length(uv+vec2(0,4.9))*.3+`+x.test4+`; float v=1.-sin(hash(floor(uv.x*100.))*2.); float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.; c*=v*b; //\u5C4F\u5E55\u4E0A\u96E8\u7684\u989C\u8272 out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5); }`});v.add(T)}break;case"snow":if(C=m,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(M){M&&M.name==="snow"&&v.remove(M)}),f){if(C?x={test1:m.test1,test2:m.test2,test3:m.test3,test4:m.test4}:(x={test1:7,test2:.1,test3:.5,test4:.5},C={test1:7,test2:.1,test3:.5,test4:.5}),x.test1=(10-parseFloat(x.test1))*15+10,x.test2=parseFloat(x.test2)/10,x.test3=parseFloat(x.test3)*.7,x.test4=(1-parseFloat(x.test4))*.8+.1,parseFloat(x.test1)>E.test1.max||parseFloat(x.test1)<E.test1.min||parseFloat(x.test2)>E.test2.max||parseFloat(x.test2)<E.test2.min||parseFloat(x.test3)>E.test3.max||parseFloat(x.test3)<E.test3.min||parseFloat(x.test4)>E.test4.max||parseFloat(x.test4)<E.test4.min)return;x.test1=this.getValue(x.test1+""),x.test2=this.getValue(x.test2+""),x.test3=this.getValue(x.test3+""),x.test4=this.getValue(x.test4+"");var S=new this._cesium.PostProcessStage({name:"snow",fragmentShader:`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float snow(vec2 uv,float scale){ float time = czm_frameNumber / `+x.test1+`; float w=smoothstep(1.0,0.,-uv.y*(scale/10.0));if(w<`+x.test2+`)return 0.; uv+=time/scale;uv.y+=time*2./scale;uv.x+=sin(uv.y+time*.5)/scale; uv*=scale;vec2 s=floor(uv),f=fract(uv),p;float k=3.,d; p=`+x.test3+`+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;d=length(p);k=min(d,k); k=smoothstep(0.,k,sin(f.x+f.y)*0.01); return k*w; } void main(void){ vec2 resolution = czm_viewport.zw; vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y); vec3 finalColor=vec3(0); float c = 0.0; c+=snow(uv,30.)*.0; c+=snow(uv,20.)*.0; c+=snow(uv,15.)*.0; c+=snow(uv,10.); c+=snow(uv,8.); c+=snow(uv,6.); c+=snow(uv,5.); finalColor=(vec3(c)); //\u5C4F\u5E55\u4E0A\u96EA\u7684\u989C\u8272 out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), `+x.test4+`); //\u5C06\u96EA\u548C\u4E09\u7EF4\u573A\u666F\u878D\u5408 }`});v.add(S)}break;case"fog":if(w=m,this._viewer.scene.postProcessStages._stages.length&&this._viewer.scene.postProcessStages._stages.forEach(function(M){M&&M.name==="fog"&&v.remove(M)}),f){if(w?x={distance:m.distance,color:m.color&&NJ.Color.fromCssColorString(m.color)}:(x={distance:200,color:"#ffffff"},w={distance:200,color:"#ffffff"}),x.distance<10)return;let M=new NJ.PostProcessStage({name:"fog",fragmentShader:`float getDistance(sampler2D depthTexture, vec2 texCoords) { float depth = czm_unpackDepth(texture(depthTexture, texCoords)); if (depth == 0.0) { return czm_infinity; } vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); return -eyeCoordinate.z / eyeCoordinate.w; } float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; float endDistance = nearFarScalar.z; float endValue = nearFarScalar.w; float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); return mix(startValue, endValue, t); } vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) { return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); } uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform vec4 fogByDistance; uniform vec4 fogColor; in vec2 v_textureCoordinates; void main(void) { float distance = getDistance(depthTexture, v_textureCoordinates); vec4 sceneColor = texture(colorTexture, v_textureCoordinates); float blendAmount = interpolateByDistance(fogByDistance, distance); vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); out_FragColor = alphaBlend(finalFogColor, sceneColor); } `,uniforms:{fogByDistance:new NJ.Cartesian4(10,0,x.distance||200,1),fogColor:x.color||NJ.Color.WHITE}});v.add(M)}break}};JRe.prototype.getValue=function(o){if(o===""||o==="-"||o==="."||o===void 0||(o[o.length-1]==="-"&&(o=o.substr(0,o.length-1)),o.split(".").length>2))return"0.0";var f=o.split(".")[1]&&o.split(".")[1].length;return f?o:parseFloat(o).toFixed(1)};var Tpt=JRe;function tk(o){this._viewer=o,this._depth=100,this.show=!1}tk.prototype.refreshGridLines=function(){let o=this._relativeHeight<0&&this.show,f=this._viewer.camera,m=new Cesium.Cartographic(f.positionCartographic.longitude,f.positionCartographic.latitude,f.positionCartographic.height-this._depth);this.item=this.UndergroundGridLines(m,o)};tk.prototype.add=function(o){if(this.show=!0,this._depth=o||100,!this.item)return this._viewer.scene.primitives.add(this),this.refreshGridLines(),this};tk.prototype.update=function(o){this.item&&this.show&&(this.getRelativeHeight(),this.item.show&&this.item.update(o))};tk.prototype.destroy=function(){this.item&&(this._viewer.scene.primitives.remove(this),this.item=null)};tk.prototype.UndergroundGridLines=function(o,f){let m=o;o instanceof Cesium.Cartesian3&&(m=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(o));let v=new Cesium.GeometryInstance({geometry:new Cesium.EllipseGeometry({center:Cesium.Cartesian3.fromRadians(m.longitude,m.latitude),height:m.height,semiMinorAxis:2e4,semiMajorAxis:2e4,vertexFormat:Cesium.VertexFormat.POSITION_AND_ST}),id:"undergroundSurface"}),y=Cesium.Material.fromType("Grid");y.uniforms.color=Cesium.Color.WHITE.withAlpha(.8),y.uniforms.cellAlpha=.01,y.uniforms.lineCount=new Cesium.Cartesian2(200,200),y.uniforms.lineThickness=new Cesium.Cartesian2(1,1);let x=Cesium.Material.fromType("Color");return x.uniforms.color=Cesium.Color.BLACK.withAlpha(.8),this.grid1&&this.grid1.destroy(),this.grid1=new Cesium.Primitive({geometryInstances:v,appearance:new Cesium.EllipsoidSurfaceAppearance({material:y}),asynchronous:!1}),this.grid2&&this.grid2.destroy(),this.grid2=new Cesium.Primitive({geometryInstances:v,appearance:new Cesium.EllipsoidSurfaceAppearance({material:x}),asynchronous:!1}),this.grid1.appearance.renderState.depthTest.enabled=!0,this.grid2.appearance.renderState.depthTest.enabled=!0,{show:f,destroy:()=>{this.grid1&&this.grid1.destroy(),this.grid2&&this.grid2.destroy(),this.grid1=this.grid2=null},update:C=>{this.grid1&&this.grid1.update(C),this.grid2&&this.grid2.update(C)}}};tk.prototype.getRelativeHeight=function(){let o=this._viewer.camera,f=this._viewer.scene.globe.getHeight(o.positionCartographic);if(this._groundHeightAtCameraPosition=f||this._groundHeightAtCameraPosition,this._relativeHeight=o.positionCartographic.height-this._groundHeightAtCameraPosition,!this.oldCameraPosition&&(this.oldCameraPosition=o.position.clone()),!this.oldCameraHeight&&(this.oldCameraHeight=o.positionCartographic.height),this._relativeHeight>0){this.item&&(this.item.show=!1);return}this.item&&(this.item.show=!0),(Math.abs(this.oldCameraHeight-o.positionCartographic.height)>this._depth/10||Cesium.Cartesian3.distance(this.oldCameraPosition,o.position)>1e4)&&(this.oldCameraPosition=o.position.clone(),this.oldCameraHeight=o.positionCartographic.height,this.refreshGridLines())};var Spt=tk;var tL=null;function cm(o,f){tL=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this.isStreetView=!1,this.StreetViewType=void 0,tL.ExpandBySmartEarth&&(tL.ExpandBySmartEarth.isStreetView=!1),this.defaultSkyAtmosphere=!0,this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null],this.StreetViewNavigation=[],this.StreetViewSphereIndex=0,this.URL={getInitImageByPosition:"",getInitImageInfoById:"",getInitImageById:"",getSecondImageById:"",getThirdImageById:"",getImageInfo:""},this.CallBack={getInitImageByPositionCallBack:void 0,getImageInfoByIdCallBack:void 0,getInitImageByIdCallBack:void 0,getSecondImageByIdCallBack:void 0,getThirdImageByIdCallBack:void 0,selectJoinsCallBack:void 0,setImageDataCallback:void 0},this.StreetViewData={name:"",radius:5,defaultFov:60,fov:110,alpha:1,speedScale:1.5,lon:void 0,lat:void 0,height:0,HeadingPitchRoll:null,getImageTileID:"",linkImagesData:[],isTwoTextures:!1,isThreeTextures:!1,_handler:null,navigation_handler:null},this.FirstImage=void 0}cm.prototype.StreetViewOpen=function(o,f,m){var v=this,y=this._viewer;if(!this.isStreetView){this.StreetViewSphere.length>0&&(this.StreetViewSphere.forEach(function(C){C&&y.entities.remove(C)}),this.StreetViewSphere=[null,null]),this.StreetViewType=f.type,this.StreetViewData.linkImagesData=[],this.URL=this.extend(this.URL,f,!1),this.CallBack=this.extend(this.CallBack,f,!1),this.defaultSkyAtmosphere=!!y.scene.skyAtmosphere.show,y.scene.skyAtmosphere.show||(y.scene.skyAtmosphere.show=!0);var x=y.camera;this.getInitImageByPosition(o,function(C){v.isStreetView=!0,tL.ExpandBySmartEarth&&(tL.ExpandBySmartEarth.isStreetView=!0),x.flyTo({destination:new v._cesium.Cartesian3.fromDegrees(v.StreetViewData.lon,v.StreetViewData.lat,v.StreetViewData.height),orientation:{heading:x.heading,pitch:x.pitch>v._cesium.Math.toRadians(45)||x.pitch<v._cesium.Math.toRadians(-45)?0:x.pitch,roll:0},duration:f.flyTime,complete:function(){m&&typeof m=="function"&&m()}}),v.attachMouseEvent(),v.createNavigation(),v.StreetViewSphereIndex=0,v.StreetViewSphere_Canvas[v.StreetViewSphereIndex]=C,v.StreetViewSphere[v.StreetViewSphereIndex]=v.createScene(v.StreetViewData.lon,v.StreetViewData.lat,v.StreetViewData.height),v.StreetViewSphere[v.StreetViewSphereIndex].show=!0,v.StreetViewSphere[v.StreetViewSphereIndex].orientation=v._cesium.Transforms.headingPitchRollQuaternion(v._cesium.Cartesian3.fromDegrees(v.StreetViewData.lon,v.StreetViewData.lat,v.StreetViewData.height),new v._cesium.HeadingPitchRoll(v._cesium.Math.toRadians(v.StreetViewData.HeadingPitchRoll.heading+(v.StreetViewType==="lide"?90:0)),v._cesium.Math.toRadians(-v.StreetViewData.HeadingPitchRoll.roll),v._cesium.Math.toRadians(v.StreetViewData.HeadingPitchRoll.pitch))),v.StreetViewType==="lide"?v._core.xhr({url:v.URL.getImageInfo+v.StreetViewData.getImageTileID,type:"get",dataType:"json",success:function(w){v.CallBack&&v.CallBack.setImageDataCallback&&typeof v.CallBack.setImageDataCallback=="function"&&v.CallBack.setImageDataCallback(v.StreetViewData,w),v.getSecondTexturesFromAtlasFile(v.StreetViewData.getImageTileID,function(A){A.index===v.StreetViewSphereIndex&&v.StreetViewData.isTwoTextures===!1&&(v.StreetViewSphere_Canvas[v.StreetViewSphereIndex]=A.canvas),v.StreetViewData.isTwoTextures=!0,v.StreetViewData.isThreeTextures=!1})}}):v.getSecondTexturesFromAtlasFile(v.StreetViewData.getImageTileID,function(w){w.index===v.StreetViewSphereIndex&&v.StreetViewData.isTwoTextures===!1&&(v.StreetViewSphere_Canvas[v.StreetViewSphereIndex]=w.canvas),v.StreetViewData.isTwoTextures=!0,v.StreetViewData.isThreeTextures=!1})})}return this};cm.prototype.exit=function(){if(this.isStreetView){var o=this,f=this._viewer;this.StreetViewSphere.length>0&&(this.StreetViewSphere.forEach(function(v){v&&f.entities.remove(v)}),this.StreetViewSphere=[null,null],this.StreetViewSphere_Canvas=[null,null]),this.StreetViewNavigation.length>0&&(this.StreetViewNavigation.forEach(function(v){f.entities.remove(v)}),this.StreetViewNavigation=[]),this.setCesiumFov(this.StreetViewData.defaultFov),this.detachMouseEvent(),f.scene.skyAtmosphere.show=this.defaultSkyAtmosphere,this.isStreetView=!1,tL.ExpandBySmartEarth&&(tL.ExpandBySmartEarth.isStreetView=!1);var m=f.camera.positionCartographic;f.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(m.longitude,m.latitude,m.height+3e3),orientation:{heading:f.camera.heading,pitch:this._cesium.Math.toRadians(-90),roll:0},complete:function(){o.isStreetView=!1,tL.ExpandBySmartEarth&&(tL.ExpandBySmartEarth.isStreetView=!1)}})}};cm.prototype.extend=function(o,f,m){for(var v in f)f.hasOwnProperty(v)&&(o.hasOwnProperty(v)||m)&&(o[v]=f[v]);return o};cm.prototype.getInitImageByPositionURL=function(o){var f;if(this.URL&&this.URL.getInitImageByPosition){var m,v=this.URL.getInitImageByPosition.split("{lon}");v[0].split("{lat}").length>1?(m=v[0].split("{lat}"),f=m[0]+o.lat+m[1]+o.lon+v[1]):(m=v[1].split("{lat}"),f=v[0]+o.lon+m[0]+o.lat+m[1])}return f};cm.prototype.getImageByIdURL=function(o,f){var m,v;switch(o){case"one":v=this.URL.getInitImageById;break;case"two":v=this.URL.getSecondImageById;break;case"three":v=this.URL.getThirdImageById;break;case"init":v=this.URL.getInitImageInfoById;break}if(this.StreetViewType==="lide"&&(f=f.replace("-0-","-X-"),o==="one"&&(v+="&row=0&col=0")),v){var y=v.split("{id}");m=y[0]+f+y[1]}return m};cm.prototype.getInitImageByPosition=function(o,f){var m=this,v=this.getInitImageByPositionURL(o);this.StreetViewData.linkImagesData=[],this._core.xhr({url:v,type:"get",dataType:"json",success:y=>{if(m.CallBack&&m.CallBack.getInitImageByPositionCallBack)typeof m.CallBack.getInitImageByPositionCallBack=="function"&&m.CallBack.getInitImageByPositionCallBack(m.StreetViewData,y);else{console.log("the getInitImageByPositionCallBack is undefined\uFF01");return}var x=m.getImageByIdURL("one",m.StreetViewData.getImageTileID),C=new Image;C.onload=function(){var w=C.width,A=C.height,E=w,T=A;m.StreetViewType==="lide"&&(E=512,T=256);var S=document.createElement("canvas"),M=S.getContext("2d");S.height=T,S.width=E,M.translate(E,0),M.scale(-1,1),M.drawImage(C,0,0,E,T,0,0,E,T),typeof f=="function"&&f(S)},C.setAttribute("crossOrigin","Anonymous");try{C.src=x}catch{C.src=""}m.FirstImage=C},error:function(y,x,C){}})};cm.prototype.getInitImage=function(o,f){var m=this.getImageByIdURL("one",o),v=new Image,y=this;v.onload=function(){var x=v.width,C=v.height,w=x,A=C;y.StreetViewType==="lide"&&(w=512,A=256);var E=document.createElement("canvas"),T=E.getContext("2d");E.height=A,E.width=w,T.translate(w,0),T.scale(-1,1),T.drawImage(v,0,0,w,A,0,0,w,A),typeof f=="function"&&f(E)},v.setAttribute("crossOrigin","Anonymous");try{v.src=m}catch{v.src=""}y.FirstImage=v};cm.prototype.getSecondTexturesFromAtlasFile=function(o,f){var m=this.StreetViewSphereIndex,v=this.getImageByIdURL("two",o),y=null,x=null,C=0,w=[];let A=4,E=8,T="{row}-{col}",S=1/0,M=1/0;this.StreetViewType==="lide"&&(T="&row={row}&col={col}",A=this.StreetViewData.row,E=this.StreetViewData.col,S=this.StreetViewData.maxWidth,M=this.StreetViewData.maxHeight);for(var I,P,D,L,R=()=>{if(C++,C==A*E){y==null&&(y=document.createElement("canvas"),x=y.getContext("2d"),y.height=L>M?M:L,y.width=D>S?S:D,x.translate(y.width,0),x.scale(-1,1));var G=I,j=P;this.StreetViewType==="lide"&&(G=512,j=256),x.drawImage(this.FirstImage,0,0,G,j,0,0,y.width,y.height);for(var q=0,J=0;q<w.length;q++)w[q].src&&x.drawImage(w[q],0,0,I,P,I*(q%E),P*Math.floor(q/E),I,P);f({index:m,canvas:y})}},O=0;O<A;O++)for(var F=0;F<E;F++){var k=v+T;k=k.replace("{row}",O).replace("{col}",F);var U=new Image;U.onload=function(){I=this.width,P=this.height,D=I*E,L=P*A,R()},U.onerror=function(){this.src="",this.onerror=void 0,R()},U.setAttribute("crossOrigin","Anonymous");try{U.src=k}catch{U.src=""}w.push(U)}};cm.prototype.getThreeTexturesFromAtlasFile=function(o,f){for(var m=this.StreetViewSphereIndex,v=this.getImageByIdURL("three",o),y=null,x=null,C=0,w=[],A=0;A<8;A++)for(var E=0;E<16;E++){var T=v+A+"-"+E,S=new Image;(function(M,I,P){P.onload=function(){var D=P.width,L=P.height,R=8192,O=4096;if(C++,C==128){y==null&&(y=document.createElement("canvas"),x=y.getContext("2d"),y.height=O,y.width=R,x.translate(8192,0),x.scale(-1,1));for(var F=0,k=0;F<w.length;F++)x.drawImage(w[F],0,0,D,L,D*(F%16),L*Math.floor(F/16),D,L);f({index:m,canvas:y})}}})(A,E,S),S.setAttribute("crossOrigin","Anonymous");try{S.src=T}catch{S.src=""}w.push(S)}};cm.prototype.InitSceneByID=function(o){var f=this,m=this._viewer;this.updateStreetSphereIndex(),this.StreetViewSphere[this.StreetViewSphereIndex]=this.createScene(this.StreetViewData.lon,this.StreetViewData.lat,this.StreetViewData.height),this.getInitImage(this.StreetViewData.getImageTileID,function(v){f.StreetViewSphere_Canvas[f.StreetViewSphereIndex]=v,f.StreetViewSphere[f.StreetViewSphereIndex].show=!0,f.StreetViewSphere[f.StreetViewSphereIndex]._ellipsoid._material._color._value.alpha=0,setTimeout(()=>{let y=0,x=setInterval(()=>{y+.2<=1&&(y=y+.2,f.StreetViewSphere[f.StreetViewSphereIndex]._ellipsoid._material._color._value.alpha=y)},50);setTimeout(()=>{clearInterval(x)},1010)},600)}),this.StreetViewData.isTwoTextures=!1,this.StreetViewType!=="lide"?this.getImageInfoById(this.StreetViewData.getImageTileID,function(v){if(f.StreetViewData.linkImagesData=[],f.CallBack&&f.CallBack.getImageInfoByIdCallBack)typeof f.CallBack.getImageInfoByIdCallBack=="function"&&f.CallBack.getImageInfoByIdCallBack(f.StreetViewData,v);else{console.log("the getImageInfoByIdCallBack is undefined\uFF01");return}f.StreetViewSphere[f.StreetViewSphereIndex].position=f._cesium.Cartesian3.fromDegrees(f.StreetViewData.lon,f.StreetViewData.lat,f.StreetViewData.height),m.camera.cancelFlight(),m.camera.flyTo({destination:f._cesium.Cartesian3.fromDegrees(f.StreetViewData.lon,f.StreetViewData.lat,f.StreetViewData.height),orientation:{heading:m.camera.heading,pitch:m.camera.pitch,roll:0},duration:1.5}),setTimeout(()=>{let y=1,x=setInterval(()=>{y-.25>=0&&(y=y-.25,o._ellipsoid._material._color._value.alpha=y)},40);setTimeout(()=>{m.entities.remove(o),o=null,clearInterval(x)},1210)},700),f.StreetViewSphere[f.StreetViewSphereIndex].orientation=f._cesium.Transforms.headingPitchRollQuaternion(f._cesium.Cartesian3.fromDegrees(f.StreetViewData.lon,f.StreetViewData.lat,f.StreetViewData.height),new f._cesium.HeadingPitchRoll(f._cesium.Math.toRadians(f.StreetViewData.HeadingPitchRoll.heading),f._cesium.Math.toRadians(-f.StreetViewData.HeadingPitchRoll.roll),f._cesium.Math.toRadians(f.StreetViewData.HeadingPitchRoll.pitch))),f.getInitImage(f.StreetViewData.getImageTileID,function(y){f.StreetViewData.isTwoTextures||(f.StreetViewSphere_Canvas[f.StreetViewSphereIndex]=y)}),f.getSecondTexturesFromAtlasFile(f.StreetViewData.getImageTileID,function(y){y.index===f.StreetViewSphereIndex&&f.StreetViewData.isTwoTextures===!1&&(f.StreetViewSphere_Canvas[f.StreetViewSphereIndex]=y.canvas),f.StreetViewData.isTwoTextures=!0,f.StreetViewData.isThreeTextures=!1}),f.createNavigation()}):this.getInitImageByPosition(f.StreetViewData,function(v){f.StreetViewSphere[f.StreetViewSphereIndex].position=f._cesium.Cartesian3.fromDegrees(f.StreetViewData.lon,f.StreetViewData.lat,f.StreetViewData.height),f.StreetViewSphere_Canvas[f.StreetViewSphereIndex]=v,m.camera.cancelFlight(),m.camera.flyTo({destination:f._cesium.Cartesian3.fromDegrees(f.StreetViewData.lon,f.StreetViewData.lat,f.StreetViewData.height),orientation:{heading:m.camera.heading,pitch:m.camera.pitch,roll:0},duration:1.5}),setTimeout(function(){m.entities.remove(o),o=null},1300),f.StreetViewSphere[f.StreetViewSphereIndex].orientation=f._cesium.Transforms.headingPitchRollQuaternion(f._cesium.Cartesian3.fromDegrees(f.StreetViewData.lon,f.StreetViewData.lat,f.StreetViewData.height),new f._cesium.HeadingPitchRoll(f._cesium.Math.toRadians(f.StreetViewData.HeadingPitchRoll.heading+90),f._cesium.Math.toRadians(-f.StreetViewData.HeadingPitchRoll.roll),f._cesium.Math.toRadians(f.StreetViewData.HeadingPitchRoll.pitch))),f.getSecondTexturesFromAtlasFile(f.StreetViewData.getImageTileID,function(y){y.index===f.StreetViewSphereIndex&&f.StreetViewData.isTwoTextures===!1&&(f.StreetViewSphere_Canvas[f.StreetViewSphereIndex]=y.canvas),f.StreetViewData.isTwoTextures=!0,f.StreetViewData.isThreeTextures=!1})})};cm.prototype.getImageInfoById=function(o,f){var m=this.getImageByIdURL("init",o);this._core.xhr({url:m,type:"get",dataType:"json",success:function(v){typeof f=="function"&&f(v)}})};cm.prototype.createScene=function(o,f,m){var v=this,y=this._viewer,x=this.StreetViewSphereIndex,C=new this._cesium.ImageMaterialProperty({image:new this._cesium.CallbackProperty(function(){return v.StreetViewSphere_Canvas[x]},!1),transparent:!0,color:this._cesium.Color.WHITE.withAlpha(this.StreetViewData.alpha)}),w={show:!1,position:this._cesium.Cartesian3.fromDegrees(o,f,m),ellipsoid:{radii:new this._cesium.Cartesian3(this.StreetViewData.radius,this.StreetViewData.radius,this.StreetViewData.radius),material:C}},A=y.entities.add(w);return A.geometryName="\u8857\u666F",A};cm.prototype.detachMouseEvent=function(){var o=this,f=this._viewer.scene,m=this._viewer.canvas;this.StreetViewData._handler&&(this.StreetViewData._handler.destroy(),this.StreetViewData._handler=void 0),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=void 0),this.StreetViewType!=="lide"&&this._viewer.clock.onTick.removeEventListener(this.StreetView_onTick,this),f.screenSpaceCameraController.enableRotate=!0,f.screenSpaceCameraController.enableTranslate=!0,f.screenSpaceCameraController.enableZoom=!0,f.screenSpaceCameraController.enableTilt=!0,f.screenSpaceCameraController.enableLook=!0};var KRe,QRe,nG=null,eL=null,Eue={looking:!1};cm.prototype.attachMouseEvent=function(){var o=this;nG=this._viewer.scene,eL=this._viewer.canvas,this.StreetViewData._handler=new this._cesium.ScreenSpaceEventHandler(eL),eL.setAttribute("tabindex","0"),eL.focus(),eL.onclick=function(){eL.focus()},setTimeout(function(){o.setCesiumFov(o.StreetViewData.fov)},4e3),nG.screenSpaceCameraController.enableRotate=!1,nG.screenSpaceCameraController.enableTranslate=!1,nG.screenSpaceCameraController.enableZoom=!1,nG.screenSpaceCameraController.enableTilt=!1,nG.screenSpaceCameraController.enableLook=!1,this.StreetViewData._handler.setInputAction(function(f){Eue.looking=!0},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this.StreetViewData._handler.setInputAction(function(f){Eue.looking&&(KRe=f.startPosition,QRe=f.endPosition,o.StreetView_mouseMove())},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.StreetViewData._handler.setInputAction(function(f){Eue.looking=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this.StreetViewData._handler.setInputAction(function(f){var m=o.StreetViewData.fov+f/-10;m>30&&m<120&&(o.StreetViewData.fov=m,o.setCesiumFov(o.StreetViewData.fov))},this._cesium.ScreenSpaceEventType.WHEEL),this.StreetViewType!=="lide"&&this._viewer.clock.onTick.addEventListener(o.StreetView_onTick,this)};cm.prototype.StreetView_onTick=function(){var o=this;!this.StreetViewData.isThreeTextures&&this.StreetViewData.fov<50&&(this.StreetViewData.isThreeTextures=!0,this.getThreeTexturesFromAtlasFile(this.StreetViewData.getImageTileID,function(f){f.index===o.StreetViewSphereIndex&&(o.StreetViewSphere_Canvas[o.StreetViewSphereIndex]=f.canvas)}))};cm.prototype.StreetView_mouseMove=function(){var o=this._viewer.camera;if(Eue.looking){var f=eL.clientWidth,m=eL.clientHeight,v=-(QRe.x-KRe.x)/f,y=(QRe.y-KRe.y)/m;(!o.roll&&o.pitch<0&&y<0||!o.roll&&o.pitch>0&&y>0)&&(y=0),o.rotate(o.position,v*this.StreetViewData.speedScale),o.lookUp(y*this.StreetViewData.speedScale)}};cm.prototype.setOpacity=function(o){var f=this;this.StreetViewSphere.forEach(function(m){m&&(m.ellipsoid.material.color._value=f._cesium.Color.WHITE.withAlpha(o))}),this.StreetViewData.alpha=o};cm.prototype.setCesiumFov=function(o){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(o)};cm.prototype.MoveToLinkImage=function(o){if(o){if(this.StreetViewType==="lide"&&!o.ImageID){this.CallBack&&this.CallBack.selectJoinsCallBack&&typeof this.CallBack.selectJoinsCallBack=="function"&&this.CallBack.selectJoinsCallBack();return}}else{alert("\u6682\u65E0\u8857\u666F\u6570\u636E");return}this.StreetViewData.name=o.name,this.StreetViewData.lon=o.Position[0],this.StreetViewData.lat=o.Position[1],this.StreetViewData.height=o.Position[2],this.StreetViewData.getImageTileID=o.ImageID,this.InitSceneByID(this.StreetViewSphere[this.StreetViewSphereIndex])};cm.prototype.updateStreetSphereIndex=function(){this.StreetViewSphereIndex=this.StreetViewSphereIndex===0?1:0};cm.prototype.createNavigation=function(){var o=this,f=this._viewer;this.StreetViewNavigation.length>0&&(this.StreetViewNavigation.forEach(function(S){f.entities.remove(S)}),this.StreetViewNavigation=[]),this.StreetViewData.navigation_handler&&(this.StreetViewData.navigation_handler.destroy(),this.StreetViewData.navigation_handler=null);var m=6378137,v=6356725,y={lon:this.StreetViewData.lon,lat:this.StreetViewData.lat,height:this.StreetViewData.height-1};this.StreetViewData.linkImagesData.forEach(function(S){var M=f.entities.add({polygon:{hierarchy:new o._cesium.CallbackProperty(function(){var I=T(y,S.NavigationAngle);return new o._cesium.PolygonHierarchy(o._cesium.Cartesian3.fromDegreesArray(I))},!1),fill:!0,outline:!0,outlineColor:o._cesium.Color.BLACK.withAlpha(.2),height:y.height}});M.geometryName="\u8857\u666F",M.isNavigation=!0,M.linkImageData=S,o.StreetViewNavigation.push(M)});var x;o.StreetViewData.navigation_handler=new o._cesium.ScreenSpaceEventHandler(eL),o.StreetViewData.navigation_handler.setInputAction(function(S){var M=f.scene.pick(S.position);o._cesium.defined(M)&&(M&&M.id&&M.id.isNavigation?(x&&(x.polygon.outlineColor=o._cesium.Color.BLACK.withAlpha(.5),x.polygon.material=o._cesium.Color.WHITE),x=M.id,x.polygon.outlineColor=o._cesium.Color.BLUE,x.polygon.material=o._cesium.Color.WHITE.withAlpha(.9)):x&&(x.polygon.outlineColor=o._cesium.Color.BLACK.withAlpha(.5),x.polygon.material=o._cesium.Color.WHITE,x=void 0)),x&&o.MoveToLinkImage(x.linkImageData)},o._cesium.ScreenSpaceEventType.LEFT_CLICK);function C(S,M,I,P){var D=I*Math.sin(P*Math.PI/180),L=I*Math.cos(P*Math.PI/180),R=v+(m-v)*(90-M)/90,O=R*Math.cos(M*Math.PI/180),F=(D/O+S*Math.PI/180)*180/Math.PI,k=(L/R+M*Math.PI/180)*180/Math.PI;return[F,k]}function w(S){return S*Math.PI/180}function A(S,M,I,P){var D=w(M),L=w(P),R=w(P)-w(M),O=w(I)-w(S),F=2*Math.asin(Math.sqrt(Math.pow(Math.sin(R/2),2)+Math.cos(D)*Math.cos(L)*Math.pow(Math.sin(O/2),2)));F=F*m,F=Math.round(F*1e4)/1e4;var k;return R===0&&O>0?k=90:R===0&&O<0?k=270:R<0&&O===0?k=180:R>=0&&O===0?k=0:R<0&&O>0?k=180-Math.atan(O/-R)*180/Math.PI:R<0&&O<0?k=180+Math.atan(O/R)*180/Math.PI:R>0&&O<0?k=360-Math.atan(-O/R)*180/Math.PI:k=Math.atan(O/R)*180/Math.PI,{angle:k,distance:F}}function E(S,M,I){var P=A(S.lon,S.lat,M.lon,M.lat);return C(S.lon,S.lat,P.distance,I-P.angle)}function T(S,M){var I=[],P=C(S.lon,S.lat,3.5,f.camera.heading*180/Math.PI),D={lon:P[0],lat:P[1]};P=C(P[0],P[1],1.1,0),I.push(P[0],P[1]),P=C(P[0],P[1],.5758,135),I.push(P[0],P[1]),P=C(P[0],P[1],.2,270),I.push(P[0],P[1]),P=C(P[0],P[1],.5,180),I.push(P[0],P[1]),P=C(P[0],P[1],.4,270),I.push(P[0],P[1]),P=C(P[0],P[1],.5,0),I.push(P[0],P[1]),P=C(P[0],P[1],.2,270),I.push(P[0],P[1]);for(var L=0,R;L<I.length-1;L+=2)R=E(D,{lon:I[L],lat:I[L+1]},M),I[L]=R[0],I[L+1]=R[1];return I}};var FJ=cm;function ZRe(o,f){this._viewer=o,this._cesium=f}ZRe.prototype.depthTestAgainstTerrain=function(o){this._viewer.scene.globe.depthTestAgainstTerrain=o};ZRe.prototype.show=function(){return this._viewer.scene.globe.depthTestAgainstTerrain};var Ppt=ZRe;var Ipt,Mpt,BJ,aG,GUi,Dpt,ik,Tue,Lpt,ik,oG,WUi=[1,1e5],ts;function jUi(o,f){if(!(ts.canvas.width<=0||ts.canvas.height<=0)){var m,v=ts.camera.getPickRay(o);v&&(m=ts.scene.globe.pick(v,ts.scene));var y=ts.scene.pick(o);if(y&&y.id instanceof En.Entity&&(y=void 0),y){var x=ts.scene.pickPosition(o);x&&(m=x)}return m}}var En=null;function Bm(o,f){En=f,this._normalShadowMap=o.scene.shadowMap,ts=o,En.Scene.prototype.screenToWorld=jUi,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._getPosition=new Ru(o,f),this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._prevRadius=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._viewshedDirection=null,this._scratchCartesian3=new En.Cartesian3,this._texture=null,this._canEnlarge=!1,this._viewshedPrimitive=null,this._eventListener=null,this._viewshedMap=void 0,this._firstTime=!0,this._editingMode=!1,this._isSliderClicked=!1,this._currentObject=void 0,this._setNewPosition=!1,this._setNewPositionCanDrag=!1,this._setNewName=!1,this._listControl=void 0,this._addingViewshedMode=!1,this._initialCameraParams={},this._isCancelledTerrain=!1,this._isCancelledPrimitives=!1,this._isSpherical=!1,this._occluder=void 0,this._horizonCullingDistanceFromPoint=void 0,this._mousePositionX=void 0,this._mousePositionY=void 0,this._zAxisNewPosition=void 0,this._startingRepoZHeight=void 0,this._viewshedCartoPos=void 0,this._propertiesChanged=!1,this._calculations=[],this._exposures=[],this._calculating=!1,this._calculatingExposure=!1,this.viewshedCalculateNormals=!1,this._txtUnit="meters_short",this.isLoadingScreenOn=!1,this._primitiveColor=En.Color.WHITE,this._predefinedPrimitiveColors={BEYOND_THE_HORIZON:En.Color.WHITE,DEFAULT:En.Color.WHITE},this._layersStorage=null,this.getId=function(){return"Viewshed"},this.maxNumViewshed=8,Ipt=53*En.Math.RADIANS_PER_DEGREE,Mpt=53*En.Math.RADIANS_PER_DEGREE,BJ=6371010,aG={ABOVE_SEA_LEVEL:0,ABOVE_GROUND_LEVEL:1,ABOVE_MODEL:2},GUi=void 0,Dpt=new En.Cartesian3,ik=new En.Matrix4,Tue=new En.Cartesian4,Lpt=new En.Cartesian3,ik=new En.Matrix4,oG=new Array(4),oG[0]=new En.Cartesian4(-1,-1,1,1),oG[1]=new En.Cartesian4(1,-1,1,1),oG[2]=new En.Cartesian4(1,1,1,1),oG[3]=new En.Cartesian4(-1,1,1,1)}Bm.prototype.setOptions=function(o){this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:o||{}}};Bm.prototype.startDraw=function(o){this._viewshedPrimitive&&(ts.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null),this._core.setDepthTest("open",this._viewer),this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this._eventListener&&this._eventListener.destroy(),this._eventListener=new En.ScreenSpaceEventHandler(ts.scene.canvas),this._viewshedDefaultNamingArray===void 0&&(this._viewshedDefaultNamingArray=new Array(this.maxNumViewshed)),this._addingViewshedMode=!0,this._editingMode=!1,this._currentObject={viewshedPrimitive:this._viewshedPrimitive,viewshedMap:this._viewshedMap,viewshedObjOptions:o||{}},this._isSpherical=o.isSpherical,this._setNewPosition=!1,this._core.getBrowser().pc!="pc"?(this._eventListener.setInputAction($.proxy(this.setViewshedPositionMobile,this),En.ScreenSpaceEventType.LEFT_CLICK),ts.scene.preRender.addEventListener(this.onPreFrameMobile,this)):(this._eventListener.setInputAction($.proxy(this.setViewshedPosition,this),En.ScreenSpaceEventType.LEFT_CLICK),ts.scene.preRender.addEventListener(this.onPreFrame,this)),this.end=f=>{this.end=void 0,ts.scene.preRender.removeEventListener(this.onPreFrame,this);try{ts.scene.preRender.removeEventListener(this.onPreFrameMobile,this)}catch{}this._eventListener&&this._eventListener.destroy(),this._core.setDepthTest("close",this._viewer),this._core.mouse(this._viewer.container,0)}};Bm.prototype.close=function(){ts.scene.preRender.removeEventListener(this.onPreFrame,this);try{ts.scene.preRender.removeEventListener(this.onPreFrameMobile,this)}catch{}this._eventListener&&this._eventListener.destroy(),this._viewshedPrimitive&&(ts.scene.primitives.remove(this._viewshedPrimitive),this._viewshedPrimitive=null);var o=ts.scene,f=ts.scene.context,m={context:f,lightCamera:o._sunCamera};o.shadowMap.destroy(),o.shadowMap=new En.ShadowMap(m);var v=o.shadowMap;if(this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default){var y=this._currentObject.viewshedObjOptions.color.default;v._color=new En.Cartesian3(y.r,y.g,y.b)}v.enabled=!0,v.debugShow=!1,v.guid=void 0,v.show=!0,v.maximumDistance=1e4,v.debugCreateRenderStates(),v.dirty=!0,ts.scene.globe.shadows=En.ShadowMode.fromCastReceive(!0,!0),ts.scene.globe.show=!0,o.skyAtmosphere.show=!0,ts.scene.shadowMap=this._normalShadowMap,this._startPositionCartesian=null,this.resetAllVariables(),this._core.setDepthTest("close",this._viewer),this._core.mouse(this._viewer.container,0)};Bm.prototype.setVisibility=function(o){this._viewshedPrimitive.show=o,ts.shadowMap.enabled=o};Bm.prototype.reset=function(){var o=ts.scene,f=ts.scene.context,m={context:f,lightCamera:o._sunCamera};o.shadowMap.destroy(),o.shadowMap=new En.ShadowMap(m);var v=o.shadowMap;if(this._currentObject&&this._currentObject.viewshedObjOptions&&this._currentObject.viewshedObjOptions.color&&this._currentObject.viewshedObjOptions.color.default){var y=this._currentObject.viewshedObjOptions.color.default;v._color=new En.Cartesian3(y.r,y.g,y.b)}v.enabled=!0,v.debugShow=!1,v.guid=void 0,v.show=!0,v.maximumDistance=1e4,v.debugCreateRenderStates(),v.dirty=!0,ts.scene.globe.shadows=En.ShadowMode.fromCastReceive(!0,!0),ts.scene.globe.show=!0,o.skyAtmosphere.show=!0,ts.scene.shadowMap=this._normalShadowMap};Bm.prototype.addViewshed=function(o={}){this._viewshedPrimitive&&this.close();let f=new En.HeadingPitchRange(o.heading,o.pitch,.01),m=En.Cartesian3.fromDegrees(o.lon,o.lat,o.height);this._currentRadius=o.distance||1e3,this._isSpherical=o.isSpherical,this._currentObject=this.CreateViewshed(m,this._currentRadius,f,o),this._isSpherical?this.createViewshedSpherePrimitive(m):this.createViewshedCameraPrimitive(m,this._currentObject.viewshedMap._lightCamera)};Bm.prototype.CreateViewshed=function(o,f,m,v){var y=ts.scene,x=new En.Camera(y),C=ts.scene.context;x.frustum.fov=53*Math.PI/180,x.frustum.aspectRatio=1,x.frustum.near=1,x.frustum.far=f,x.lookAt(o,m);var w={context:C,lightCamera:x,cascadesEnabled:!1,isPointLight:this._isSpherical,pointLightRadius:f};y.shadowMap=new En.ShadowMap(w);var A=y.shadowMap;v.color&&(A._viewshed_Back=new En.Cartesian3(v.color.Back.r,v.color.Back.g,v.color.Back.b),A._viewshed_Fore=new En.Cartesian3(v.color.Fore.r,v.color.Fore.g,v.color.Fore.b)),A.enabled=!0,A.debugShow=!1,A.guid=En.createGuid(),A.show=!0,A.maximumDistance=1e4,A._pointLightRadius=f,A.debugCreateRenderStates(),A._distance=f,A.dirty=!0,ts.scene.globe.shadows=En.ShadowMode.fromCastReceive(!0,!0),ts.scene.globe.show=!0,y.skyAtmosphere.show=!0;var E={};return E.position=o,E.distance=f,E.direction=m,E.viewshedObjOptions=v,E.guid=this._cesium.createGuid(),E.viewshedObjOptions.originalDirection=m,E.type="viewshed",E.viewshedMap=A,E};Bm.prototype.resetAllVariables=function(){this._startPositionCartesian=null,this._startPositionCartographic=null,this._currentPosition=null,this._currentRadius=null,this._currentFovHorizontal=null,this._currentFovVertical=null,this._setNewPosition=!1,this._currentObject=void 0,this._viewshedMap=void 0,this._canEnlarge=!1,this._zAxisNewPosition=void 0,this._viewshedDirection=null};Bm.prototype.setViewshedPosition=function(o){if(!this._setNewPosition){if(this._canEnlarge&&this._viewshedPrimitive!=null){if(this._canEnlarge=!1,this._eventListener.removeInputAction(En.ScreenSpaceEventType.MOUSE_MOVE),this._eventListener.removeInputAction(En.ScreenSpaceEventType.LEFT_CLICK),this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),this._viewshedMap!=null&&this._viewshedPrimitive!=null){var f=this._viewshedPrimitive._camera;this._currentObject.viewshedObjOptions.initialHeading=f.heading,this._currentObject.viewshedObjOptions.initialPitch=f.pitch,this._currentObject.viewshedObjOptions.initialRoll=f.roll,this._currentObject.viewshedObjOptions.altitudeMethod=En.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2);var m={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:f.frustum.fov,vFOV:f.frustum.fovy,aspectRatio:f.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},v=this.CreateViewshed(f.position,En.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new En.HeadingPitchRange(f.heading,f.pitch,.01),m);if(this._eventListener.removeInputAction(En.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(En.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(En.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(En.ScreenSpaceEventType.MOUSE_MOVE),v==-1)return;this.resetAllVariables(),this._currentObject=v;var y=ts.scene.primitives._primitives,x=$.grep(y,function(D){return D.isViewshed===!0}),C=[];if(y.forEach(function(D,L){D.isViewshed&&C.push(L)}),C.length>1){var w=C[C.length-2],A=ts.scene.primitives._primitives[w];ts.scene.primitives.remove(A)}}}else if(En.defined(o)&&this._currentObject!==void 0){var E=this._getPosition.getMousePosition(o);if(E!==void 0){var T=0,S=0;this._startPositionCartographic=ts.scene.globe.ellipsoid.cartesianToCartographic(E),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,this._currentObject.viewshedObjOptions.height!==void 0&&(S=this._currentObject.viewshedObjOptions.height);var M=new En.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+T+S);this._startPositionCartesian=M;var I=this._startPositionCartesian,P=new En.BoundingSphere(new En.Cartesian3(0,0,0),BJ);this._occluder=new En.Occluder(P,I),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),En.ScreenSpaceEventType.MOUSE_MOVE)}}}};Bm.prototype.update=function(o={}){if(this._currentObject&&this._currentObject.viewshedMap){let f=this._currentObject.direction;Object.assign(f,o);let m=this._currentObject.position;if(o.lon!==void 0||o.lat!==void 0||o.height!==void 0){let v=this._core.toDegrees(m);Object.assign(v,o),m=En.Cartesian3.fromDegrees(v.lon,v.lat,v.height),this._currentObject.position=m}o.distance!==void 0&&(this._currentRadius=o.distance),this._currentRadius?this._currentObject.viewshedMap._lightCamera.frustum.far=this._currentRadius:this._currentRadius=this._currentObject.viewshedMap._lightCamera.frustum.far,this._currentObject.viewshedMap._lightCamera.lookAt(m,f),this._isSpherical?this.createViewshedSpherePrimitive(m):this.createViewshedCameraPrimitive(m,this._currentObject.viewshedMap._lightCamera)}};Bm.prototype.setViewshedPositionMobile=function(o){if(!this._setNewPosition){if(this.onMouseMove(o),this.createViewshedCameraPrimitive(),this._canEnlarge&&this._viewshedPrimitive!=null){if(this._currentObject.viewshedObjOptions.end&&this._currentObject.viewshedObjOptions.end(),this._core.mouse(this._viewer.container,0),this.createViewshedMap(),this._viewshedMap!=null&&this._viewshedPrimitive!=null){var f=this._viewshedPrimitive._camera;this._currentObject.viewshedObjOptions.initialHeading=f.heading,this._currentObject.viewshedObjOptions.initialPitch=f.pitch,this._currentObject.viewshedObjOptions.initialRoll=f.roll,this._currentObject.viewshedObjOptions.altitudeMethod=En.defaultValue(this._currentObject.viewshedObjOptions.altitudeMethod,2);var m={displayName:this._currentObject.viewshedObjOptions.name,color:this._currentObject.viewshedObjOptions.color,hFOV:f.frustum.fov,vFOV:f.frustum.fovy,aspectRatio:f.frustum.aspectRatio,height:this._currentObject.viewshedObjOptions.height,distance:this._currentObject.viewshedObjOptions.distance,xPos:this._currentObject.viewshedObjOptions.xPos,yPos:this._currentObject.viewshedObjOptions.yPos,altitudeMethod:this._currentObject.viewshedObjOptions.altitudeMethod,pickHeight:this._currentObject.viewshedObjOptions.pickHeight,horizonCullingDistanceFromViewshed:this._horizonCullingDistanceFromPoint,initialHeading:this._currentObject.viewshedObjOptions.initialHeading,initialPitch:this._currentObject.viewshedObjOptions.initialPitch,initialRoll:this._currentObject.viewshedObjOptions.initialRoll},v=this.CreateViewshed(f.position,En.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),new En.HeadingPitchRange(f.heading,f.pitch,.01),m);if(this._eventListener.removeInputAction(En.ScreenSpaceEventType.LEFT_CLICK),this._eventListener.removeInputAction(En.ScreenSpaceEventType.LEFT_DOWN),this._eventListener.removeInputAction(En.ScreenSpaceEventType.LEFT_UP),this._eventListener.removeInputAction(En.ScreenSpaceEventType.MOUSE_MOVE),v==-1)return;this._currentObject=v;var y=ts.scene.primitives._primitives,x=$.grep(y,function(D){return D.isViewshed===!0}),C=[];if(y.forEach(function(D,L){D.isViewshed&&C.push(L)}),C.length>1){var w=C[C.length-2],A=ts.scene.primitives._primitives[w];ts.scene.primitives.remove(A)}}}else if(En.defined(o)&&this._currentObject!==void 0){var E=this._getPosition.getMousePosition(o);if(E!==void 0){var T=0,S=0;this._startPositionCartographic=ts.scene.globe.ellipsoid.cartesianToCartographic(E),this._currentObject.viewshedObjOptions.pickHeight=this._startPositionCartographic.height,this._currentObject.viewshedObjOptions.height!==void 0&&(S=this._currentObject.viewshedObjOptions.height);var M=new En.Cartesian3.fromRadians(this._startPositionCartographic.longitude,this._startPositionCartographic.latitude,this._startPositionCartographic.height+T+S);this._startPositionCartesian||(this._startPositionCartesian=M);var I=this._startPositionCartesian,P=new En.BoundingSphere(new En.Cartesian3(0,0,0),BJ);this._occluder=new En.Occluder(P,I),this._canEnlarge=!0,this._eventListener.setInputAction($.proxy(this.onMouseMove,this),En.ScreenSpaceEventType.MOUSE_MOVE)}}}};Bm.prototype.onMouseMove=function(o){if(En.defined(o)){var f={},m=this._getPosition.getMousePosition(o);if(m!=null){if(f.pickPrimitive!=null&&f.pickPrimitive._camera!=null)return;var v={};if(this._setNewPosition)if(this._setNewPositionCanDrag){var T=void 0,S=ts.scene.globe.ellipsoid.cartesianToCartographic(m);if(this._currentObject.viewshedObjOptions.pickHeight=S.height,this._currentObject.viewshedObjOptions.terrainHeight=ts.scene.globe.getHeight(S),this._zAxisNewPosition){var M=o.endPosition.y-this._startingRepoZ.y,I=En.Cartesian3.magnitude(En.Cartesian3.subtract(this._currentObject.position,ts.camera.position,this._scratchCartesian3),this._scratchCartesian3),P=M/ts.canvas.height,D=-1*I*P;this._viewshedCartoPos==null&&(this._viewshedCartoPos=new En.Cartographic.fromCartesian(this._currentObject.position)),T=new En.Cartesian3.fromRadians(this._viewshedCartoPos.longitude,this._viewshedCartoPos.latitude,this._viewshedCartoPos.height+D)}else this._currentObject.viewshedObjOptions.altitudeMethod==aG.ABOVE_SEA_LEVEL?T=new En.Cartesian3.fromRadians(S.longitude,S.latitude,this._startingRepoZHeight):T=m;this._newPosition=T}else{var y=m,x=En.Matrix4.multiplyByVector(ts.camera._viewMatrix,En.Cartesian4.fromElements(y.x,y.y,y.z,1,Tue),Tue),C=En.Matrix4.multiplyByVector(ts.camera.frustum.projectionMatrix,x,Tue),w=En.Cartesian3.divideByScalar(C,C.w,Lpt),A=Math.floor((w.x*.5+.5)*ts.canvas.width),E=Math.floor((w.y*.5+.5)*ts.canvas.height);this._mousePositionX=A,this._mousePositionY=E}else{if(this._startPositionCartesian==null||(En.Cartesian3.subtract(m,this._startPositionCartesian,v),!(!isNaN(v.x)&&!isNaN(v.y)&&!isNaN(v.z))))return;this._viewshedDirection=En.Cartesian3.normalize(v,this._scratchCartesian3),this._currentRadius=En.Cartesian3.magnitude(v)}}else this._mousePositionX=void 0,this._mousePositionY=void 0}};Bm.prototype.createViewshedSpherePrimitive=function(o,f){try{var m=o??this._startPositionCartesian,v=f??this._currentRadius;if(v<=1)return!1;this._viewshedPrimitive!=null&&ts.scene.primitives.remove(this._viewshedPrimitive);var y=En.Matrix4.multiplyByTranslation(En.Transforms.eastNorthUpToFixedFrame(m),new En.Cartesian3(0,0,0),ik),x=new En.GeometryInstance({geometry:new En.SphereOutlineGeometry({radius:v,stackPartitions:12,slicePartitions:12}),modelMatrix:y,attributes:{color:En.ColorGeometryInstanceAttribute.fromColor(new En.Color(1,1,1,.5))}});this._viewshedPrimitive=ts.scene.primitives.add(new En.Primitive({geometryInstances:x,appearance:new En.PerInstanceColorAppearance({flat:!0,renderState:{lineWidth:1}}),allowPicking:!1,asynchronous:!1}));var C=new En.Camera(ts.scene);C.position=m,C.direction=En.Cartesian3.negate(En.Cartesian3.UNIT_Z,this._scratchCartesian3),this._viewshedPrimitive._camera=C}catch{return!1}return this._viewshedPrimitive};Bm.prototype.createViewshedCameraPrimitive=function(o,f){this._viewshedPrimitive!=null&&ts.scene.primitives.remove(this._viewshedPrimitive);var m=new En.Camera(ts.scene);if(!(!this._startPositionCartesian&&!o))return o!=null?m.position=o:m.position=this._startPositionCartesian,this._viewshedDirection!=null&&!isNaN(this._viewshedDirection.x)&&!isNaN(this._viewshedDirection.y)&&(m.direction=this._viewshedDirection.clone(),m.up=ts.scene.globe.ellipsoid.geodeticSurfaceNormal(m.position,Dpt)),m.frustum.isViewshed=!0,m.frustum.fov=En.defaultValue(this._currentObject.viewshedObjOptions.fov,Ipt),m.frustum._fovy=En.defaultValue(this._currentObject.viewshedObjOptions.fovy,Mpt),m.frustum.aspectRatio=Math.tan(m.frustum.fov/2)/Math.tan(m.frustum._fovy/2),m.frustum.near=1,this._currentRadius<=1?!1:(m.frustum.far=En.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius),this._viewshedPrimitive=ts.scene.primitives.add(new En.DebugCameraPrimitive({camera:f||m,color:this._primitiveColor})),this._viewshedPrimitive._numFrustrums=0,this._viewshedPrimitive._outlineOnlyFrustum=!0,this._viewshedPrimitive.update=this.updateViewshedPrimitive,this._viewshedPrimitive)};Bm.prototype.createViewshedMap=function(){ts.scene.viewsheds==null&&ts.scene.viewsheds,this._viewshedPrimitive._camera!=null&&this._canEnlarge&&(this._viewshedMap==null?(this._viewshedMap=new En.ShadowMap({context:ts.scene.context,lightCamera:this._viewshedPrimitive._camera,enabled:1,isSpotLight:!0,fromLightSource:!0,softShadows:!1,isPointLight:this._isSpherical,pointLightRadius:En.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius)}),this._viewshedMap.show=!0,this._viewshedMap.isPreviewMode=!0,this._viewshedMap.guid="SamplerViewshed",this._viewshedMap!=null):(this._viewshedMap._lightCamera.direction=this._viewshedPrimitive._camera.direction,this._viewshedMap._lightCamera.frustum.far=En.defaultValue(this._currentObject.viewshedObjOptions.distance,this._currentRadius)))};Bm.prototype.updateViewshedPrimitive=function(o){if(!!this.show){if(this._updateOnChange&&(this._outlinePrimitive=this._outlinePrimitive&&this._outlinePrimitive.destroy()),!En.defined(this._outlinePrimitive)){var f=this._camera,m=f.frustum,v=o.frustumSplits,y=v.length-1;y=this._numFrustrums,y<=0&&(v=WUi,v[0]=this._camera.frustum.near,v[1]=this._camera.frustum.far,y=1);var x=this._camera.viewMatrix,C,w;if(En.defined(f.frustum.fovy)){var A=this._camera.frustum.projectionMatrix,E=En.Matrix4.multiply(A,x,ik);w=En.Matrix4.inverse(E,ik)}else C=En.Matrix4.inverseTransformation(x,ik);var T=new Float64Array(12*(y+1)+3),S;for(S=0;S<y+1;++S)for(var M=0;M<4;++M){var I=En.Cartesian4.clone(oG[M],Bm[M]);if(En.defined(w)){I=En.Matrix4.multiplyByVector(w,I,I);var L=1/I.w;En.Cartesian3.multiplyByScalar(I,L,I),En.Cartesian3.subtract(I,this._camera.positionWC,I),En.Cartesian3.normalize(I,I);var R=En.Cartesian3.dot(this._camera.directionWC,I);En.Cartesian3.multiplyByScalar(I,v[S]/R,I),En.Cartesian3.add(I,this._camera.positionWC,I)}else{En.defined(m._offCenterFrustum)&&(m=m._offCenterFrustum);var P,D;S===y?(P=v[S-1],D=v[S]):(P=v[S],D=v[S+1]),I.x=(I.x*(m.right-m.left)+m.left+m.right)*.5,I.y=(I.y*(m.top-m.bottom)+m.bottom+m.top)*.5,I.z=(I.z*(P-D)-P-D)*.5,I.w=1,En.Matrix4.multiplyByVector(C,I,I)}T[12*S+M*3]=I.x,T[12*S+M*3+1]=I.y,T[12*S+M*3+2]=I.z}T[12*y+12]=this._camera.positionWC.x,T[12*y+12+1]=this._camera.positionWC.y,T[12*y+12+2]=this._camera.positionWC.z;var O=new En.BoundingSphere.fromVertices(T),F=new En.GeometryAttributes;F.position=new En.GeometryAttribute({componentDatatype:En.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:T});var k,U,G=new Uint16Array(8*(2*y+1+1));for(S=0;S<y+1;++S)k=S*8,U=S*4,G[k]=U,G[k+1]=U+1,G[k+2]=U+1,G[k+3]=U+2,G[k+4]=U+2,G[k+5]=U+3,G[k+6]=U+3,G[k+7]=U;for(S=0;S<y;++S)k=(y+1+S)*8,U=S*4,G[k]=U,G[k+1]=U+4,G[k+2]=U+1,G[k+3]=U+5,G[k+4]=U+2,G[k+5]=U+6,G[k+6]=U+3,G[k+7]=U+7;k+=8,G[k]=U+8,G[k+1]=U+1,G[k+2]=U+8,G[k+3]=U+2,G[k+4]=U+8,G[k+5]=U+3,G[k+6]=U+8,G[k+7]=U+4,this._outlinePrimitive=new En.Primitive({geometryInstances:new En.GeometryInstance({geometry:{attributes:F,indices:G,primitiveType:En.PrimitiveType.LINES,boundingSphere:O},attributes:{color:En.ColorGeometryInstanceAttribute.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new En.PerInstanceColorAppearance({translucent:!1,flat:!0}),asynchronous:!1})}this._outlinePrimitive.isViewshedPart=!0,this._outlinePrimitive.update(o)}};Bm.prototype.getHorizonDistance=function(o){return Math.sqrt(Math.pow(BJ+o,2)-Math.pow(BJ,2))};Bm.prototype.onPreFrame=function(o){var f,m;if(this._currentObject!=null&&this._currentObject.viewshedPrimitive!=null&&this._currentObject.viewshedMap!=null){f=new En.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position);var v=this.getHorizonDistance(f.height);this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=v,m=ts.scene.globe.getHeight(f),this._currentObject.viewshedMap.isBelowGround=f.height<m+.5}if(this._currentObject!=null&&this._currentObject.viewshedMap!=null,this._newPosition!=null&&this.toPreviewMode(this._currentObject),this._canEnlarge&&this._currentRadius!=null&&this._prevRadius!=this._currentRadius){this._prevRadius=this._currentRadius;var y=this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive();y&&this.createViewshedMap()}else if(this._currentObject!=null&&this._setNewPosition&&this._mousePositionX!=null&&this._mousePositionY!=null){if(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical)this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance);else if(this.checkIfMouseOnPosition(),this._newPosition!=null){if(this._currentObject.viewshedObjOptions.altitudeMethod==aG.ABOVE_GROUND_LEVEL&&this._zAxisNewPosition==null){var x=En.Cartographic.fromCartesian(this._newPosition.clone()),C=En.Cartesian3.fromRadians(x.longitude,x.latitude,ts.scene.globe.getHeight(x)+this._currentObject.startingAltitudeAboveGround);this._currentObject.viewshedPrimitive._camera.position=C}else if(this._currentObject.viewshedObjOptions.altitudeMethod==aG.ABOVE_MODEL&&this._zAxisNewPosition==null){var x=En.Cartographic.fromCartesian(this._newPosition.clone()),C=En.Cartesian3.fromRadians(x.longitude,x.latitude,x.height+this._currentObject.startingAltitudeAboveModel);this._currentObject.viewshedPrimitive._camera.position=C}else this._currentObject.viewshedPrimitive._camera.position=this._newPosition;this.adjustDirections()}}};Bm.prototype.onPreFrameMobile=function(o){var f,m;if(this._currentObject!=null&&this._currentObject.viewshedPrimitive!=null&&this._currentObject.viewshedMap!=null){f=new En.Cartographic.fromCartesian(this._currentObject.viewshedPrimitive._camera.position);var v=this.getHorizonDistance(f.height);this._currentObject.viewshedMap.horizonCullingDistanceFromViewshed=v,m=ts.scene.globe.getHeight(f),this._currentObject.viewshedMap.isBelowGround=f.height<m+.5}if(this._currentObject!=null&&this._currentObject.viewshedMap!=null,this._newPosition!=null&&this.toPreviewMode(this._currentObject),this._canEnlarge&&this._currentRadius!=null){this._prevRadius=this._currentRadius;var y=this._isSpherical?this.createViewshedSpherePrimitive():this.createViewshedCameraPrimitive();y&&this.createViewshedMap()}else if(this._currentObject!=null&&this._setNewPosition&&this._mousePositionX!=null&&this._mousePositionY!=null){if(this.getPosXAndY(),this._currentObject.viewshedObjOptions.isSpherical)this._currentObject.viewshedMap._lightCamera.position=this._newPosition,this._currentObject.viewshedPrimitive=this.createViewshedSpherePrimitive(this._newPosition,this._currentObject.distance);else if(this.checkIfMouseOnPosition(),this._newPosition!=null){if(this._currentObject.viewshedObjOptions.altitudeMethod==aG.ABOVE_GROUND_LEVEL&&this._zAxisNewPosition==null){var x=En.Cartographic.fromCartesian(this._newPosition.clone()),C=En.Cartesian3.fromRadians(x.longitude,x.latitude,ts.scene.globe.getHeight(x)+this._currentObject.startingAltitudeAboveGround);this._currentObject.viewshedPrimitive._camera.position=C}else if(this._currentObject.viewshedObjOptions.altitudeMethod==aG.ABOVE_MODEL&&this._zAxisNewPosition==null){var x=En.Cartographic.fromCartesian(this._newPosition.clone()),C=En.Cartesian3.fromRadians(x.longitude,x.latitude,x.height+this._currentObject.startingAltitudeAboveModel);this._currentObject.viewshedPrimitive._camera.position=C}else this._currentObject.viewshedPrimitive._camera.position=this._newPosition;this.adjustDirections()}}};var Sue=Bm;var kJ=null;function rk(o,f){kJ=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this.isPause=!1,this.isLoad=!1}rk.prototype.createViewshed=function(o={}){o.alpha=this._core.defaultValue(o.alpha,.5),o.horizonAngle=this._core.defaultValue(o.horizonAngle,60),o.verticalAngle=this._core.defaultValue(o.verticalAngle,60);let f=new $O(this._viewer,kJ);return f.createViewCone({height:this._core.defaultValue(o.height,1.7)},(m,v)=>{this.ShadowPostProcess=new sJ(this._viewer,{cameraPosition:v[0],position:v[1],far:kJ.Cartesian3.distance(v[0],v[1]),showFarScale:6,viewshed:{visible:o.visible,unvisible:o.unvisible},...o},kJ),f.destroy(),f=null}),this};rk.prototype.addViewshed=function(o={}){return o.alpha=this._core.defaultValue(o.alpha,.5),o.horizonAngle=this._core.defaultValue(o.horizonAngle,60),o.verticalAngle=this._core.defaultValue(o.verticalAngle,60),this.ShadowPostProcess=new sJ(this._viewer,{showFarScale:6,viewshed:{visible:o.visible,unvisible:o.unvisible},...o},kJ),this};rk.prototype.updateViewshed=function(o){this.ShadowPostProcess.updatePost(o)};rk.prototype.destroy=function(){this.ShadowPostProcess&&this.ShadowPostProcess.destroy(),this.ShadowPostProcess=null};rk.prototype.changeHorizonAngle=function(o){this.ShadowPostProcess&&this.ShadowPostProcess.changeHorizonAngle(o)};rk.prototype.changeVerticalAngle=function(o){this.ShadowPostProcess&&this.ShadowPostProcess.changeVerticalAngle(o)};var $Re=rk;var zP=null;function e3e(o,f){zP=f,this._viewer=o,this._cesium=f}e3e.prototype.createSkylineAnalysis=function(o={}){this.clear();let f;typeof o=="string"?f={color:o,scale:2}:f={color:o.color||"#ff0000",scale:o.scale||2};let m=zP.Color.fromCssColorString(f.color),v=Viewer.scene.postProcessStages;var y=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; void main(void) { float directions[3]; directions[0] = -1.0; directions[1] = 0.0; directions[2] = 1.0; float scalars[3]; scalars[0] = 3.0; scalars[1] = 10.0; scalars[2] = 3.0; float padx = czm_pixelRatio / czm_viewport.z; float pady = czm_pixelRatio / czm_viewport.w; float horizEdge = 0.0; float vertEdge = 0.0; for (int i = 0; i < 3; ++i) { float dir = directions[i]; float scale = scalars[i]; horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale; horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale; vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale; vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale; } float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } `,x=zP.createGuid();let C=new zP.PostProcessStage({name:"czm_edge_detection_"+x,fragmentShader:y,uniforms:{length:.25,color:zP.Color.clone(zP.Color.BLACK)}}),w=new zP.PostProcessStage({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;in vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){out_FragColor = color;}else{out_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),A=new zP.PostProcessStage({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;in vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);vec4 color = texture(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0&&silhouetteColor.a>0.0){out_FragColor = vec4(1.0,0.0,0.0,1.0);}else{out_FragColor = vec4(0.0,0.0,0.0,1.0);;}}",uniforms:{redTexture:w.name,silhouetteTexture:C.name,length:.25}}),E=new zP.PostProcessStage({name:"czm_skylinebold",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform float scale;uniform vec4 skylineColor;in vec2 v_textureCoordinates;void main(void){float padx = czm_pixelRatio / czm_viewport.z;float pady = czm_pixelRatio / czm_viewport.w;vec4 color = texture(colorTexture, v_textureCoordinates);out_FragColor = color;float scaleB = 3.0;int search = 0;for(float i=0.0;i<10.0;i++){for(float j=0.0;j<10.0;j++){vec2 redCoordi = v_textureCoordinates + vec2(i*padx,j*pady);vec4 redcolor=texture(redTexture, redCoordi);if(redcolor.r == 1.0){out_FragColor = skylineColor;search = 1;break;}if(j>=scale)break;}if(i>=scale||search>0)break;}}",uniforms:{redTexture:A.name,skylineColor:m,scale:f.scale}});this.postProccessStage=new zP.PostProcessStageComposite({name:"czm_skyline",stages:[C,w,A,E],inputPreviousStageTexture:!1,uniforms:C.uniforms}),v.add(this.postProccessStage)};e3e.prototype.clear=function(){this.postProccessStage&&this._viewer.scene.postProcessStages.remove(this.postProccessStage)};var Rpt=e3e;function YUi(o,f,m,v,y,x){let C=Cesium.defined;var w=v._frameState,A=o.derivedCommands;!C(A)||(w.useLogDepth&&C(A.logDepth)&&(o=A.logDepth.command),A=o.derivedCommands,C(A[f])&&(o=A[f][m],o.execute(y,x)))}var t3e,i3e,r3e,n3e;function Opt(o,f,m,v,y,x){let{Pass:C,defined:w,PerspectiveFrustum:A,PerspectiveOffCenterFrustum:E,OrthographicFrustum:T,OrthographicOffCenterFrustum:S}=Cesium;t3e=t3e||new A,i3e=i3e||new E,r3e=r3e||new T,n3e=n3e||new S;let M=o._us,I=M._frameState,P=I.camera,D=P._scene,L=D._view,R=L.frustumCommandsList,O=R.length;var F=D._globeTranslucencyState,k=F.translucent,U;w(P.frustum.fov)?U=P.frustum.clone(t3e):w(P.frustum.infiniteProjectionMatrix)?U=P.frustum.clone(i3e):w(P.frustum.width)?U=P.frustum.clone(r3e):U=P.frustum.clone(n3e);function G(z,ie,re,ne){(x?x(z,ie):!0)&&(v&&y?YUi(z,v,y,ie,re,ne):z.execute(re,ne))}for(var j,q,J,X=0;X<O;++X){var Y=O-X-1,Q=R[Y],ee=m.framebuffer;if(m.framebuffer=f,U.near=Y!==0?Q.near*D.opaqueFrustumNearOffset:Q.near,U.far=Q.far,M.updateFrustum(U),M.updatePass(C.GLOBE),J=Q.commands[C.GLOBE],q=Q.indices[C.GLOBE],k)F.executeGlobeCommands(Q,G,globeTranslucencyFramebuffer,D,m);else for(j=0;j<q;++j)G(J[j],D,o,m);for(M.updatePass(C.CESIUM_3D_TILE),J=Q.commands[C.CESIUM_3D_TILE],q=Q.indices[C.CESIUM_3D_TILE],j=0;j<q;++j)G(J[j],D,o,m);for(M.updatePass(C.OPAQUE),J=Q.commands[C.OPAQUE],q=Q.indices[C.OPAQUE],j=0;j<q;++j)G(J[j],D,o,m);for(M.updatePass(C.TRANSLUCENT),J=Q.commands[C.TRANSLUCENT],q=Q.indices[C.TRANSLUCENT],j=0;j<q;++j)G(J[j],D,o,m);m.framebuffer=ee}}var Npt=` vec3 packNormalToRGB( const in vec3 normal ) { return normalize( normal ) * 0.5 + 0.5; } vec3 unpackRGBToNormal( const in vec3 rgb ) { return 2.0 * rgb.xyz - 1.0; } const float PackUpscale = 256. / 255.; // fraction -> 0..1 (including 1) const float UnpackDownscale = 255. / 256.; // 0..1 -> fraction (excluding 1) const vec3 PackFactors = vec3( 256. * 256. * 256., 256. * 256., 256. ); const vec4 UnpackFactors = UnpackDownscale / vec4( PackFactors, 1. ); const float ShiftRight8 = 1. / 256.; vec4 packDepthToRGBA( const in float v ) { vec4 r = vec4( fract( v * PackFactors ), v ); r.yzw -= r.xyz * ShiftRight8; // tidy overflow return r * PackUpscale; } float unpackRGBAToDepth( const in vec4 v ) { return dot( v, UnpackFactors ); } vec4 pack2HalfToRGBA( vec2 v ) { vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 )); return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w); } vec2 unpackRGBATo2Half( vec4 v ) { return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) ); } // NOTE: viewZ/eyeZ is < 0 when in front of the camera per OpenGL conventions float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) { return ( viewZ + near ) / ( near - far ); } float orthographicDepthToViewZ( const in float linearClipZ, const in float near, const in float far ) { return linearClipZ * ( near - far ) - near; } // NOTE: https://twitter.com/gonnavis/status/1377183786949959682 float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) { return (( near + viewZ ) * far ) / (( far - near ) * viewZ ); } float perspectiveDepthToViewZ( const in float invClipZ, const in float near, const in float far ) { return ( near * far ) / ( ( far - near ) * invClipZ - far ); } `,Fpt=`uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; uniform float czm_selectedIdTextureWidth; bool czm_selected(vec4 id) { bool selected = false; for (int i = 0; i < 1024000; i++) { vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5)); if (all(equal(id, selectedId))) { return true; } if(float(i)>czm_selectedIdTextureWidth)break; } return false; } `;function o3e(o){let{defaultValue:f,BoundingRectangle:m,Pass:v,Sampler:y,DrawCommand:x,Color:C,ShaderSource:w,defined:A,ClearCommand:E,RenderState:T,Texture:S,PixelDatatype:M,PixelFormat:I,Framebuffer:P}=Cesium;this._selectedIdTexture=null;let{name:D,vertexShader:L,fragmentShader:R,uniforms:O,renderStateProcess:F,beforeUpdate:k,renderType:U,textureScale:G,pixelFormat:j,pixelDatatype:q,sampler:J,viewportScale:X,shaderRedefine:Y,overrideViewport:Q}=o,ee="renderPass_"+D.replace(/[\.\\\/\-]/g,"_"),z=`czm_non_${ee}_main`,ie=`czm_${ee}_main`,re=`_cache_${ee}`,ne=ee+"Command",oe=null,se=null,ae=null,fe=null,de,ve=new E({color:C.TRANSPARENT,depth:1}),pe=new m,ce=this;if(Q&&m.clone(Q,pe),Y=Y||"add",U=U||"all",G=G||1,G<0||G>8)throw new Cesium.DeveloperError("CesiumRenderPass\uFF1AtextureScale\u5FC5\u987B\u5927\u4E8E0\u5C0F\u4E8E\u7B49\u4E8E8");function he(At,bt,gt,It){var Jt=At.shaderCache.getDerivedShaderProgram(bt,ee);if(!A(Jt)){var bi=bt._attributeLocations,Yi=bt.fragmentShaderSource,ii=bt.vertexShaderSource,ei=bt._vertexShaderText,Li=Yi.sources,Je=Li.length;let pt=!!fe&&Qe();var Nt=Fpt,yi=/texture\s?\(\s?tile_pickTexture\s?,\s?tile_featureSt\s?\)/.test(gt);It=="in"||It=="out"&&!yi?Nt+=` in float me_isSelected; bool czm_selected(){ bool isSelected= me_isSelected>0.0000001; if(!isSelected){ isSelected= czm_selected(${gt}); } return isSelected; } `:Nt+=` bool czm_selected(){ return czm_selected(${gt}); }`;let wr=Fpt+` out float me_isSelected; bool czm_selected(){ return czm_selected(${gt}); } `;var ai=!1,wi=!1;if(/in\s?vec3\s?normal\s?;/.test(ei)||/\n\s?vec3\s?normal\s?;/.test(ei)?ai=!0:/in\s?out\s?vec3\s?v_normal\s?;/.test(ei)&&(wi=!0),R){var ji=!1;for(Ri=0;Ri<Je;++Ri)if(/vec4\s?packDepthToRGBA\s?\(/.test(Li[Ri])){ji=!0;break}let zi=(ji?"":Npt)+(pt?Nt:"")+w.replaceMain(R,ie)+`void main() { `+(Y!="replace"?` ${z}(); `:"")+` ${ie}(); } `;for(var hi=new Array(Je+1),Ri=0;Ri<Je;++Ri)hi[Ri]=w.replaceMain(Li[Ri],z);hi[Je]=zi,ai?Yi.defines.push("HAS_NORMAL"):wi&&Yi.defines.push("HAS_V_NORMAL"),Yi=new w({sources:hi,defines:Yi.defines})}if(L||R){Li=ii.sources,Je=Li.length;var ji=!1;for(Ri=0;Ri<Je;++Ri)if(/vec4\s?packDepthToRGBA\s?\(/.test(Li[Ri])){ji=!0;break}pt=pt&&It=="in"||It=="out"&&!yi,ai?ii.defines.push("HAS_NORMAL"):wi&&ii.defines.push("HAS_V_NORMAL");let Ui=(ji?"":Npt)+(pt?wr:"")+w.replaceMain(L||"void main(){}",ie)+`void main() { `+(Y!="replace"?` ${z}(); `:"")+(pt?` me_isSelected=czm_selected()?1.:0.; `:"")+` ${ie}(); } `;for(var hi=new Array(Je+1),Ri=0;Ri<Je;++Ri)hi[Ri]=w.replaceMain(Li[Ri],z);hi[Je]=Ui,ii=new w({sources:hi,defines:ii.defines})}Jt=At.shaderCache.createDerivedShaderProgram(bt,ee,{vertexShaderSource:ii,fragmentShaderSource:Yi,attributeLocations:bi})}return Jt}function Ce(At,bt){At._renderPassCache=At._renderPassCache||{},At._renderPassCache[re]=At._renderPassCache[re]||{};var gt=At._renderPassCache[re],It=gt[bt.id];if(!A(It)){var Jt=T.getState(bt);typeof F=="function"&&F.call(ce,Jt),It=T.fromCache(Jt),gt[bt.id]=It}return It}function Se(At,bt,gt){let It=At;var Jt=bt._frameState,bi=At.derivedCommands;if(!A(bi))return;Jt.useLogDepth&&A(bi.logDepth)&&(At=bi.logDepth.command),bi=At.derivedCommands;let Yi=bi.renderPass;A(bi.renderPass)||(Yi=bi.renderPass={});var ii,ei;if(A(Yi[ne])&&(ii=Yi[ne].shaderProgram,ei=Yi[ne].renderState),Yi[ne]=x.shallowClone(At,Yi[ne]),!A(ii)||Yi.shaderProgramId!==At.shaderProgram.id){let Je=At.shaderProgram,Nt=It._pickIdQualifier=new RegExp(`uniform\\s?vec4\\s?${At.pickId}`,"g").test(Je._fragmentShaderText)?"uniform":"in";Yi[ne].shaderProgram=he(gt,Je,At.pickId,Nt),Yi[ne].renderState=Ce(bt,At.renderState),Yi.shaderProgramId=At.shaderProgram.id}else Yi[ne].shaderProgram=ii,Yi[ne].renderState=ei;var Li=Yi[ne].uniformMap;Ue(Li)}function De(At){return function(){var bt=O[At];return typeof bt=="function"?bt():bt}}function Oe(At,bt){return function(){var gt=At[bt]();if(A(gt))return gt.dimensions}}function Ue(At){if(!At.__created&&(At.czm_selectedIdTexture=function(){return fe._selectedIdTexture},At.czm_selectedIdTextureWidth=function(){return fe._selectedIdTexture?fe._selectedIdTexture.width:0},At.czm_selectedIdTextureStep=function(){return fe._selectedIdTexture?1/fe._selectedIdTexture.width:-1},!!O)){At.__created=!0;for(var bt in O)if(O.hasOwnProperty(bt)){typeof O[bt]!="function"?At[bt]=De(bt):At[bt]=O[bt];var gt=At[bt]();(typeof gt=="string"||gt instanceof S||gt instanceof HTMLImageElement||gt instanceof HTMLCanvasElement||gt instanceof HTMLVideoElement)&&(At[bt+"Dimensions"]=Oe(At,bt))}}}function Xe(At){let bt=At._view,gt=bt.frustumCommandsList,It=gt.length;for(var Jt,bi,Yi,ii=0;ii<It;++ii){var ei=It-ii-1,Li=gt[ei];for(bi=0;bi<Li.commands.length;bi++){var Je=Li.commands[bi];if(Yi=Li.indices[bi],!(fe&&bi==v.GLOBE))for(Jt=0;Jt<Yi;++Jt){var Nt=Je[Jt];Se(Nt,At,At._context)}}}}function it(){se&&(se.destroy(),oe.destroy(),oe=void 0,se=void 0),ae&&(ae.destroy(),ae=void 0)}function ut(At,bt,gt,It){var Jt=bt.width,bi=bt.height;se&&se.width===Jt&&se.height===bi&>===de||(de=gt,it(),se=new S({context:At,width:Jt,height:bi,pixelFormat:f(j,I.RGBA),pixelDatatype:f(q,M.FLOAT),sampler:f(J,y.NEAREST)}),ae=new S({context:At,width:Jt,height:bi,pixelFormat:I.DEPTH_COMPONENT,pixelDatatype:M.UNSIGNED_SHORT,sampler:y.NEAREST}),oe=new P({colorTextures:[se],context:At,destroyAttachments:!1,depthTexture:ae}))}function at(At){Q||(pe=m.clone(At.viewport,pe),X?(pe.x=pe.width*X.x,pe.y=pe.height*X.y,pe.width*=X.width,pe.height*=X.height):(pe.width*=G,pe.height*=G));let bt=Object.assign({},At.passState);return bt.viewport=pe,bt}function Pt(At,bt){let gt=At._us._frameState,It=gt.camera,Jt=It._scene,bi=Jt._view;try{if(!L&&!R){let Yi=at(bi);typeof k=="function"&&k.call(ce,Jt,bt),ut(At,pe,Jt.hdr,bi.sceneFramebuffer),Opt(At,oe,Yi)}else{let Yi=at(bi);typeof k=="function"&&k.call(ce,Jt,bt),ut(At,pe,Jt.hdr,bi.sceneFramebuffer),Xe(Jt),Opt(At,oe,Yi,"renderPass",ne,U=="all"||!fe||!fe._selectedIdTexture?null:ft)}}catch(Yi){console.error(Yi)}}function Qe(){if(!fe)return;let At=fe.selected||fe.parentSelected;if(At.length)return At}function ft(At,bt){let gt=fe&&(fe.selected||fe.parentSelected);if(!fe||!gt||!gt.length)return!1;if(!At.pickId||At._pickIdQualifier!="uniform")return!0;let It=!0,Jt=At.owner,bi=U=="selected";if(Jt&&Jt.isObject3D){for(let ii=0;ii<gt.length;ii++)if(gt[ii]==Jt)return bi;return!bi}let Yi=At.uniformMap;if(Yi[At.pickId]){let ii=Yi[At.pickId]();It=!bi;for(let ei=0;ei<gt.length;ei++){let Li=gt[ei],Je=Li.pickId?[Li.pickId]:Li.pickIds||Li._pickIds;for(let Nt=0;Nt<Je.length;Nt++){let yi=Je[Nt];if(yi.color==ii||C.equals(yi.color,ii))return bi}}}return It}function Ot(At){if(oe){var bt=At._us._frameState.camera._scene._view;ve.framebuffer=oe,ve.execute(At,bt.passState),ve.framebuffer=void 0}}function Xt(At){if(fe&&ce.prevStageUpdate&&(fe.update=ce.prevStageUpdate,ce.prevStageUpdate=null,ce.prevStageExecute=null),fe=At,!fe)return;let bt=fe.update;ce.prevStageUpdate=bt,fe.update=function(gt,It){if(Ot(gt),bt.call(fe,gt,It),!!fe.enabled)if(!L&&!R)Pt(gt,It);else{let Jt=fe.selected||fe.parentSelected;Jt&&Jt.length&&Pt(gt,It)}}}this.update=Pt,this.clear=Ot,Object.defineProperties(this,{texture:{get(){return se}},depthTexture:{get(){return ae}},stage:{get(){return fe},set(At){fe!=At&&Xt(At)}}})}var qUi=` in vec2 v_textureCoordinates; uniform sampler2D colorTexture; uniform vec2 colorTextureDimensions; uniform vec2 direction; uniform float kernelRadius; float gaussianPdf(in float x, in float sigma) { return 0.39894 * exp( -0.5 * x * x/( sigma * sigma))/sigma; } void main() { vec2 vUv=v_textureCoordinates; vec2 invSize = 1.0 / colorTextureDimensions; float weightSum = gaussianPdf(0.0, kernelRadius); vec4 diffuseSum = texture( colorTexture, vUv) * weightSum; vec2 delta = direction * invSize * kernelRadius/float(MAX_RADIUS); vec2 uvOffset = delta; for( int i = 1; i <= MAX_RADIUS; i ++ ) { float w = gaussianPdf(uvOffset.x, kernelRadius); vec4 sample1 = texture( colorTexture, vUv + uvOffset); vec4 sample2 = texture( colorTexture, vUv - uvOffset); diffuseSum += ((sample1 + sample2) * w); weightSum += (2.0 * w); uvOffset += delta; } out_FragColor = diffuseSum/weightSum; }`,sG=null;function VJ(o,f){sG=f,this._viewer=o,this._core=new Sr(o,sG)}VJ.prototype.createEdgeStage=function(o={}){this.clear();let f="OutlineEffect",{PostProcessStage:m,PostProcessStageComposite:v,Sampler:y,TextureMagnificationFilter:x,TextureMinificationFilter:C}=sG,w=this._core.defaultValue(o.width,2),A=this._core.defaultValue(o.thresholdAngle,10)*Math.PI/180,E=!1,T=!1,S=sG.Color.fromCssColorString(o.visibleColor||"#00a8e0"),M=sG.Color.fromCssColorString(o.hiddenColor||"#4d4d4d"),I=this._core.defaultValue(o.showGlow,!0),P=this._core.defaultValue(o.edgeGlow,1),D=3,L=!1,R=new o3e({name:f+"Pass",vertexShader:` out vec3 vOutlineNormal; void main(){ #ifdef HAS_NORMAL vOutlineNormal = normal; #else #ifdef HAS_V_NORMAL vOutlineNormal = v_normal; #else vOutlineNormal=vec3(0.); #endif #endif } `,fragmentShader:` in vec3 vOutlineNormal; void main(){ // if(!czm_selected())discard; if(length(vOutlineNormal)>0.)out_FragColor=vec4( vOutlineNormal ,out_FragColor.a); } `,sampler:new y({minificationFilter:C.LINEAR,magnificationFilter:x.LINEAR}),renderType:"all"}),O=new m({name:f+"Mask",uniforms:{outlineWidth(){return w},devicePixelRatio,thresholdAngle:function(){return A},useSingleColor:function(){return E},showOutlineOnly:function(){return T},visibleEdgeColor:function(){return S},hiddenEdgeColor:function(){return M},maskTexture(){return R.texture},maskDepthTexture(){return R.depthTexture}},fragmentShader:` uniform sampler2D colorTexture; uniform vec2 colorTextureDimensions; uniform sampler2D depthTexture; uniform sampler2D maskTexture; uniform sampler2D maskDepthTexture; uniform float thresholdAngle; uniform bool showOutlineOnly; uniform float outlineWidth; uniform float devicePixelRatio; uniform vec3 visibleEdgeColor; uniform vec3 hiddenEdgeColor; uniform bool useSingleColor; in vec2 v_textureCoordinates; float lengthSq(vec3 v){ return v.x * v.x + v.y * v.y + v.z * v.z; } float normal_angleTo(vec3 a,vec3 b){ float denominator = sqrt( lengthSq(a) * lengthSq(b) ); if ( denominator == 0. ) return czm_pi / 2.; float theta = dot(a, b ) / denominator; // clamp, to handle numerical problems return acos( clamp( theta, - 1., 1. ) ); } float compareNormal(vec4 n1,vec4 n2){ if( abs ( normal_angleTo( n1.xyz , n2.xyz ) ) < thresholdAngle ){ return 0.; }else{ return 1.; } } float compareDepth(const in vec2 uv){ float maskDepth = czm_readDepth( maskDepthTexture, uv); float nonDepth = czm_readDepth( depthTexture, uv); return maskDepth>nonDepth?1.:0.; } void main(){ vec2 vUv=v_textureCoordinates; // vec4 color = texture( colorTexture, vUv); vec4 maskColor = texture( maskTexture, vUv); if( maskColor.a < 0.0001){ // out_FragColor =color; discard; return; } vec2 invSize = outlineWidth / colorTextureDimensions; vec4 uvOffset = vec4(1.0, 0.0, 0.0, 1.0) * vec4(invSize, invSize); vec4 c1 = texture( maskTexture, vUv + uvOffset.xy); vec4 c2 = texture( maskTexture, vUv - uvOffset.xy); vec4 c3 = texture( maskTexture, vUv + uvOffset.yw); vec4 c4 = texture( maskTexture, vUv - uvOffset.yw); float d; if(showOutlineOnly){ float diff1 = (c1.a - c2.a)*0.5; float diff2 = (c3.a - c4.a)*0.5; d = length( vec2(diff1, diff2) ); } else{ float diff1 = compareNormal(c1,c2)*0.5; float diff2 = compareNormal(c3,c4)*0.5; d = length( vec2(diff1, diff2) ); } if(useSingleColor==false){ float dp1 = compareDepth( vUv + uvOffset.xy); float dp2 = compareDepth( vUv - uvOffset.xy); float dp3 = compareDepth( vUv + uvOffset.yw); float dp4 = compareDepth( vUv - uvOffset.yw); float a1 = min(dp1, dp2); float a2 = min(dp3, dp4); float visibilityFactor = min(a1, a2); vec3 edgeColor = 1.0 - visibilityFactor > 0.001 ? visibleEdgeColor : hiddenEdgeColor; // out_FragColor =color+ vec4( edgeColor , 1. ) * vec4(d); out_FragColor = vec4( edgeColor , 1. ) * vec4(d); //out_FragColor = vec4( 0.06, 0.9, 1.0 , 1. ) * vec4(d); }else{ // out_FragColor =color+ vec4( visibleEdgeColor , 1. ) * vec4(d); out_FragColor = vec4( visibleEdgeColor , 1. ) * vec4(d); //out_FragColor = vec4( 0.06, 0.9, 1.0 , 1. ) * vec4(d); } } `});R.stage=O;let F=this.createBlurStage(f+"Blur1",4,1,.75),k=this.createBlurStage(f+"Blur2",4,4,.5),U=new v({name:f+"BlurComposite",stages:[O,F,k],inputPreviousStageTexture:!0}),G=new m({name:f+"Additive",uniforms:{showGlow:function(){return I},edgeGlow:function(){return P},edgeStrength:function(){return D},edgeOnly(){return L},maskTexture(){return R.texture},lineTexture:O.name,edgeTexture1:F.name,edgeTexture2:U.name},fragmentShader:` uniform sampler2D colorTexture; uniform sampler2D edgeTexture1; uniform sampler2D edgeTexture2; uniform sampler2D lineTexture; uniform sampler2D maskTexture; uniform bool showGlow; uniform float edgeGlow; uniform bool edgeOnly; uniform float edgeStrength; in vec2 v_textureCoordinates; void main(){ vec2 vUv =v_textureCoordinates; vec4 edgeColor=texture( lineTexture, vUv); vec4 color=texture( colorTexture, vUv); float opacity=1.; if(edgeOnly){ vec4 maskColor=texture( maskTexture, vUv); opacity=1.-maskColor.a; out_FragColor = maskColor; return; } if(showGlow){ float visFactor= 1.;//czm_selected()?1.:0.; vec4 edgeValue1 = texture(edgeTexture1, vUv); vec4 edgeValue2 = texture(edgeTexture2, vUv); vec4 glowColor = edgeValue1 + edgeValue2 * edgeGlow; out_FragColor = opacity * color + edgeColor + edgeStrength * (1. - edgeColor.r) * glowColor; } else{ out_FragColor = opacity * color + edgeColor; } } `}),j=new v({name:f+"Composite",stages:[U,G],inputPreviousStageTexture:!1});function q(J){Object.defineProperties(J,{showGlow:{get(){return I},set(X){I=X}},edgeGlow:{get(){return P},set(X){P=X}},edgeStrength:{get(){return D},set(X){D=X}},thresholdAngle:{get(){return A},set(X){A=X}},showOutlineOnly:{get(){return T},set(X){T=X}},edgeOnly:{get(){return L},set(X){L=X}},useSingleColor:{get(){return E},set(X){E=X}},outlineWidth:{get(){return w},set(X){w=X}},visibleEdgeColor:{get(){return S},set(X){S=X}},hiddenEdgeColor:{get(){return M},set(X){M=X}}})}return q(j),j._uniforms=j._uniforms||{},q(j._uniforms),j.selected=[1],j.enabled=!0,this._viewer.postProcessStages.add(j),this.postProccessStage=j,this};VJ.prototype.createBlurStage=function(o,f,m,v){let{Cartesian2:y,PostProcessStage:x,PostProcessStageComposite:C,PostProcessStageSampleMode:w}=sG,A=new y(1,0),E=new y(0,1),T={defines:{MAX_RADIUS:f},fragmentShader:qUi};this.parseDefines(T);let S=new x({name:o+"_x_direction",fragmentShader:T.fragmentShader,textureScale:v,forcePowerOfTwo:!0,uniforms:{kernelRadius:m,direction:A},sampleMode:w.LINEAR}),M=new x({name:o+"_y_direction",fragmentShader:T.fragmentShader,textureScale:v,forcePowerOfTwo:!0,uniforms:{kernelRadius:m,direction:E},sampleMode:w.LINEAR});return new C({name:o,stages:[S,M],inputPreviousStageTexture:!0})};VJ.prototype.parseDefines=function(o){let f=[];for(let m in o.defines)if(o.defines.hasOwnProperty(m)){let v=o.defines[m];f.push("#define "+m+" "+v)}return f=f.join(` `)+` `,o.fragmentShader&&(o.fragmentShader=f+o.fragmentShader),o.vertexShader&&(o.vertexShader=f+o.vertexShader),o};VJ.prototype.clear=function(){this.postProccessStage&&this._viewer.scene.postProcessStages.remove(this.postProccessStage),this.postProccessStage=void 0};var Bpt=VJ;function HP(o,f){this._viewer=o,this._cesium=f,this._scene=o.scene,this._core=new Sr(o,f),this.currentSpeed="1x",this.currentTime=null,this.currentPlayMode="1",this.timer=null}HP.prototype.createAnalysis=function(){return this.shadows=!0,this.currentSpeed=1,this.currentPlayMode="1",this.Forword(),this};HP.prototype.setCurrentTime=function(o){var f=new Date(o),m=this._cesium.JulianDate.fromDate(f);this._viewer.clock.currentTime=m.clone()};HP.prototype.getCurrentTime=function(o){this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),clearInterval(this.timer),timer=null,timer=setInterval(function(){this.currentTime=XUi(this._viewer.animation.viewModel.dateLabel,this._viewer.animation.viewModel.timeLabel),o&&typeof o=="function"&&o(this.currentTime)},1e3)};HP.prototype.SpeedIncress=function(o){this._viewer.animation.viewModel.faster(),this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),o&&typeof o=="function"&&o(this.currentSpeed)};HP.prototype.SpeedDecress=function(o){this._viewer.animation.viewModel.slower(),this.currentSpeed=$(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html(),o&&typeof o=="function"&&o(this.currentSpeed)};HP.prototype.Forword=function(o){this._viewer.animation.viewModel.playForwardViewModel.command(),this.currentPlayMode="1",this.currentSpeed[0]=="-"&&(this.currentSpeed=this.currentSpeed.slice(1)),o&&typeof o=="function"&&o(this.currentSpeed)};HP.prototype.Bacword=function(o){this._viewer.animation.viewModel.playReverseViewModel.command(),this.currentPlayMode="2",this.currentSpeed[0]!=="-"&&(this.currentSpeed="-"+this.currentSpeed),o&&typeof o=="function"&&o(this.currentSpeed)};HP.prototype.Pause=function(){this._viewer.animation.viewModel.pauseViewModel.command()};function XUi(o,f){o=o.replace(/January|Jan/,"01").replace(/February|Feb/,"02").replace(/March|Mar/,"03").replace(/April|Apr/,"04").replace(/May/,"05").replace(/June|Jun/,"06").replace(/July|Jul/,"07").replace(/August|Aug/,"08").replace(/September|Sept/,"09").replace(/October|Oct/,"10").replace(/November|Nov/,"11").replace(/December|Dec/,"12");var m=o.split(" ");o=m[2]+"-"+m[0]+"-"+m[1];var v=f.split(" ");f=v[0];var y=new Date(Date.parse(o+" "+f));y=y.getTime(),y=y/1e3,y=y+8*60*60;var x=new Date(parseInt(y)*1e3).toLocaleString("chinese",{hour12:!1}).replace(/年|月|\//g,"-").replace(/日/g," ");return x}Object.defineProperties(HP.prototype,{shadows:{get:function(){return this._viewer.shadows},set:function(o){this._viewer.shadows=o}},currentSpeed:{get:function(){return $(this._viewer.container).find(".cesium-viewer-animationContainer .cesium-animation-svgText tspan").eq(2).html()},set:function(o){o=o.toString().replace("x",""),this._viewer.clock.multiplier=parseFloat(o)}}});var kpt=HP;var QT=null;function xg(o,f){QT=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this._getPosition=new Ru(this._viewer,this._cesium),this.tooltip=this._core.CreateTooltip(),this.sunshineOption={},this.loadingImg=window.SmartEarthRootUrl+pn.loading}xg.prototype.PointSunshineAnalysis=function(o,f){if(this._viewer.entities.remove(this._viewer.entities.getById("1")),this._viewer.entities.remove(this._viewer.entities.getById("point")),o!=null){if(o.constructor.name!="Cartesian3")throw"\u4F20\u5165\u53C2\u6570\u5FC5\u987B\u662F\u4E09\u7EF4\u5750\u6807"}else throw"\u65E0\u6548\u53C2\u6570";this._viewer.scene.sun.show||(this._viewer.scene.sun.show=!0);var m=this._viewer.scene.context.uniformState.sunPositionWC,v=new QT.Cartesian3(m.x-o.x,m.y-o.y,m.z-o.z),y=Math.sqrt(v.x*v.x+v.y*v.y+v.z*v.z),x=new QT.Cartesian3(v.x/y,v.y/y,v.z/y),C=200,w=new QT.Cartesian3(o.x+C*x.x,o.y+C*x.y,o.z+C*x.z);this.pickFromRay(o,w,f)};xg.prototype.sunshineAnalysisPoint=function(o,f){!o&&(o={}),this.sunshineOption=o;var m=this,v=this._viewer;return this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1,this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this.drawHandler.setInputAction(function(y){var x=m._getPosition.getMousePosition(y);if(m.PointSunshineAnalysis(x),x){var C=v.entities.add({id:m._core.getuid(),name:"Point",position:x,point:{pixelSize:16,color:m._cesium.Color.BLUE,outlineWidth:m._core.defaultValue(o.outlineWidth,2),outlineColor:m._cesium.Color.WHITE.withAlpha(.6),heightReference:m._cesium.HeightReference.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}});m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),f&&typeof f=="function"&&f(C)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(y){m.tooltip.showAt(y.endPosition,"\u70B9\u51FB\u7ED8\u5236\u70B9")},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this};xg.prototype.sunshineAnalysisPolygon=function(o,f){!o&&(o={}),this.sunshineOption=o;var m=this,v=this._viewer;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=void 0),this.loading||this.addLoading(),this.remove(),this.drawHandler=new this._cesium.ScreenSpaceEventHandler(v.scene.canvas),Ne.states=1;var y=[],x,C;return this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw),this.drawHandler.setInputAction(function(w){var A=m._getPosition.getMousePosition(w);if(!!A){if(!y.length){let E=QT.Cartographic.fromCartesian(A);m.sunshineOption.defaultHeight=E.height,y.push(A)}y.push(A),y.length===2&&!C&&(C=v.entities.add({name:"\u4E34\u65F6\u7EBF",polyline:{positions:new m._cesium.CallbackProperty(function(){return y},!1),clampToGround:!0,material:m._cesium.Color.LIME.withAlpha(.6),width:3}})),y.length===3&&!x&&(C&&v.entities.remove(C),o.clampToGround=m._core.defaultValue(o.clampToGround,!0),x=v.entities.add({id:m._core.getuid(),name:"\u65B0\u5EFA\u9762",polygon:{hierarchy:new m._cesium.CallbackProperty(function(){return new m._cesium.PolygonHierarchy(y)},!1),material:new m._cesium.ImageMaterialProperty({image:null,repeat:new m._cesium.Cartesian2(1,1),color:m._cesium.Color.LIME.withAlpha(.6)}),perPositionHeight:!m._core.defaultValue(o.clampToGround,!1),heightReference:o.clampToGround?1:0,outline:m._core.defaultValue(o.outline,!1),outlineColor:m._cesium.Color.WHITE.withAlpha(.6),distanceDisplayCondition:new m._cesium.DistanceDisplayCondition(0,1e8)}}))}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(w){if(y.length===0)m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E00\u4E2A\u70B9");else if(y.length===1)m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9");else{m.tooltip.showAt(w.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u7ED8\u5236");var A=m._getPosition.getMousePosition(w);if(!A)return;y.pop(),y.push(A)}},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.end=function(w){m.drawHandler.destroy(),m.drawHandler=void 0,m.tooltip.show(!1),m.end=void 0,setTimeout(function(){Ne.states=0},100),m._core.mouse(m._viewer.container,0,"0"),C&&v.entities.remove(C),x&&v.entities.remove(x),!(w==="cancel"||y.length<3)&&setTimeout(()=>{m.analysis(x,o.start||"2019-09-17 13:00",o.end||"2019-09-17 15:00",o.interval||60,f)},100)},this.drawHandler.setInputAction(function(w){m.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this};xg.prototype.analysis=function(o,f,m,v,y){var x=new Date(f),C=new Date(m),w=0,A=this;let E=this.sunshineOption.startHeight||this.sunshineOption.defaultHeight;var T=A.getPoint(o,this.sunshineOption.spacing||10,E,E+A._core.defaultValue(this.sunshineOption.addHeight,30));this._viewer.scene.sun.show||(this._viewer.scene.sun.show=!0);let S=this._viewer.clock.currentTime.clone();function M(R){for(let O=0;O<T.length;O++)A.Sunshine(T[O],R)?T[O].through++:T[O].out++}function I(R,O){A.SetTimeNow(R),setTimeout(()=>{let F=A._viewer.scene.context.uniformState.sunPositionWC;O(F)},100)}function P(){var R=x.getTime()+6e4*v*w,O=new Date(R);O>C?(A.createPoint(T),A._viewer.clock.currentTime=S,A.isLoading(!1),y&&typeof y=="function"&&y(T)):I(O,function(F){M(F),w++,P()})}(C-x)/(1e3*60*v)*T.length>1500?window.layuiLayer&&window.layuiLayer.msg("\u5F53\u524D\u5206\u6790\u65F6\u95F4\u8FC7\u957F\uFF0C\u662F\u5426\u7EE7\u7EED\u5206\u6790\uFF1F",{time:0,btn:["\u7EE7\u7EED","\u53D6\u6D88"],btnAlign:"c",yes:R=>{layuiLayer.close(R),A.isLoading(!0),P()},btn2:()=>{y&&typeof y=="function"&&y(T)}}):(A.isLoading(!0),P())};xg.prototype.createPoint=function(o){var f=this;this.ResultPoint=f._viewer.scene.primitives.add(new f._cesium.PointPrimitiveCollection);for(var m=0;m<o.length;m++){var v=o[m],y=o[m].through+o[m].out,x=o[m].out/y,C="";x>=.7?C=f._cesium.Color.BLUE:x<.7&&x>=.3?C=f._cesium.Color.YELLOW:x<.3&&(C=f._cesium.Color.RED);var w={id:{isshowderData:!0,data:"\u9634\u5F71\u7387:"+(1-x)*100+"%"},position:f._cesium.Cartesian3.fromDegrees(v.lon,v.lat,v.height),color:C};f.ResultPoint.add(w)}this.showResultTooltip(!0)};xg.prototype.showResultTooltip=function(o){if(this.ResultTooltipHandler&&(this.ResultTooltipHandler.destroy(),this.ResultTooltipHandler=void 0,this.tooltip.show(!1)),o){let f=this;this.ResultTooltipHandler=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);let m;this.ResultTooltipHandler.setInputAction(function(v){clearTimeout(m),m=setTimeout(()=>{let y=f._viewer.scene.pick(v.endPosition);y&&y.id&&y.id.isshowderData?f.tooltip.showAt(v.endPosition,y.id.data):f.tooltip.show(!1)},50)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE)}};xg.prototype.getPoint=function(o,f,m,v){for(var y=this,x=[],C=o.polygon.hierarchy.getValue().positions,w=0;w<C.length;w++){var A=y._cesium.Math.toDegrees(y._cesium.Cartographic.fromCartesian(C[w]).longitude),E=y._cesium.Math.toDegrees(y._cesium.Cartographic.fromCartesian(C[w]).latitude);x.push(A),x.push(E)}for(var T=y.getTheBottomPoint(x),S=y.scanningPolygon(T,f,f,x),M=[],I=(v-m)/f,P=0;P<I;P++)for(var D=0;D<S.length;D++){var L=S[D],R={lon:L.lon,lat:L.lat,height:m+f*P,through:0,out:0,color:""};M.push(R)}return M};xg.prototype.getTheBottomPoint=function(o){for(var f=90,m=0,v=1;v<o.length;v+=2)f=f<o[v]?f:(m=v)&&o[v];return{lon:o[m-1],lat:o[m]}};xg.prototype.scanningPolygon=function(o,f,m,v){for(var y=[],x=180,C=-180,w=-90,A,E,T,S,M,I=0;I<v.length;I+=2)w=w>v[I+1]?w:v[I+1],x=x<v[I]?x:v[I],C=C>v[I]?C:v[I];var P=this.GetPositionFromA_D(o.lat,o.lon,m,0),D=this.GetPositionFromA_D(o.lat,o.lon,f,90);for(A=D[0]-o.lon,E=P[1]-o.lat,y.push({lon:o.lon,lat:o.lat}),M={lon:o.lon,lat:o.lat},M.lat+=E;M.lat<=w;M.lat+=E){for(T={lon:M.lon-A,lat:M.lat},S={lon:M.lon+A,lat:M.lat},this.IsInPolygon(M.lon,M.lat,v)&&y.push({lon:M.lon,lat:M.lat});T.lon>=x;T.lon-=A)this.IsInPolygon(T.lon,T.lat,v)&&y.push({lon:T.lon,lat:T.lat});for(;S.lon<=C;S.lon+=A)this.IsInPolygon(S.lon,S.lat,v)&&y.push({lon:S.lon,lat:S.lat})}return y};xg.prototype.GetPositionFromA_D=function(o,f,m,v){var y=6378137,x=6356725,C=m*Math.sin(v*Math.PI/180),w=m*Math.cos(v*Math.PI/180),A=x+(y-x)*(90-o)/90,E=A*Math.cos(o*Math.PI/180),T=(C/E+f*Math.PI/180)*180/Math.PI,S=(w/A+o*Math.PI/180)*180/Math.PI;return[T,S]};xg.prototype.IsInPolygon=function(o,f,m){var v=0,y,x,C,w,A;if(m.length<6)return!1;m.push(m[0],m[1]);for(var E=0;E<m.length-2;E+=2)y=m[E],C=m[E+1],x=m[E+2],w=m[E+3],(f>=C&&f<w||f>=w&&f<C)&&Math.abs(C-w)>0&&(A=y-(y-x)*(C-f)/(C-w),A<=o&&v++);return v%2!==0};xg.prototype.SetTimeNow=function(o){var f=new this._cesium.JulianDate.fromDate(o);this._viewer.clock.currentTime=f};xg.prototype.Sunshine=function(o,f){let m=QT.Cartesian3.fromDegrees(o.lon,o.lat,o.height);return this.pickFromRay(m,f)};xg.prototype.jiance=function(o,f){var m=20,v=!1,y=this._cesium.Cartographic.fromCartesian(o),x=this._cesium.Cartographic.fromCartesian(f),C=[],w={};w.longitude=y.longitude/Math.PI*180,w.latitude=y.latitude/Math.PI*180,w.czheight=y.height;var A={};A.longitude=x.longitude/Math.PI*180,A.latitude=x.latitude/Math.PI*180,A.czheight=x.height;for(var E=0;E<m;E++){var T={};T.longitude=this._cesium.Math.lerp(w.longitude,A.longitude,.01*(E+1)),T.latitude=this._cesium.Math.lerp(w.latitude,A.latitude,.01*(E+1)),T.czheight=w.czheight-(w.czheight-A.czheight)*.01*(E+1);var S=new this._cesium.Cartographic(this._cesium.Math.toRadians(T.longitude),this._cesium.Math.toRadians(T.latitude),0),M=this._viewer.scene.sampleHeight(S),I=this._cesium.Cartesian3.fromDegrees(T.longitude,T.latitude,M);T.zsheight=M,T.zsheight>T.czheight&&(v=!0),C.push(T)}return v};xg.prototype.pickFromRay=function(o,f){let m=QT.Cartesian3.normalize(QT.Cartesian3.subtract(f,o,new QT.Cartesian3),new QT.Cartesian3),v=new QT.Ray(o,m),y=this._viewer.scene.pickFromRay(v,[]),x=!1;return y&&y.object&&(x=!0),x};xg.prototype.remove=function(){this.ResultPoint&&this._viewer.scene.primitives.remove(this.ResultPoint),this.ResultPoint=void 0,this.ResultTooltipHandler&&(this.ResultTooltipHandler.destroy(),this.ResultTooltipHandler=void 0,this.tooltip.show(!1)),this.showResultTooltip(!1)};xg.prototype.addLoading=function(){var o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";var f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=this.loadingImg,o.appendChild(f),this.loading=o,this._viewer.container.appendChild(o)};xg.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};xg.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var Pue=xg;function Tb(o,f){this._viewer=o,this._cesium=f,this.tiltModel={start:void 0,end:[]}}Tb.prototype.play=function(o,f={}){this.start=f.start,this.end=f.end,this.attr=f.attr,this.attrType=f.attrType,this.palyType=f.type||"progress",this.startPosition=f.startPosition,this.endPosition=f.endPosition,this.colors=f.colors||["rgb(255,0,0)","rgb(255,152,0)","rgb(0,255,0)","rgb(0,0,255)"];let m;if(this._useColor=f.useColor,this.getCurrentProgressStyle(0),typeof o=="string"){m=new kT(this._viewer,this._cesium),this.tiltModel.start=m.create3DTilesets("\u62C6\u8FC1\u6A21\u578B",o,{},{groundCenter:this.startPosition},"0",!0,y=>{this.getModelMinMaxTime(y),this.setModelStyle("start",y)}),m=new kT(this._viewer,this._cesium);let v=m.create3DTilesets("\u91CD\u5EFA\u6A21\u578B",o,{},{groundCenter:this.endPosition},"0",!0,y=>{this.getModelMinMaxTime(y),this.setModelStyle("end",y)});this.tiltModel.end.push(v)}else{let v=o.start;m=new kT(this._viewer,this._cesium),v&&(this.tiltModel.start=m.create3DTilesets("\u62C6\u8FC1\u6A21\u578B",v.urls,{},{groundCenter:v.Center,heading:v.heading,pitch:v.pitch,roll:v.roll},"0",!0,x=>{this.getModelMinMaxTime(x),this.setModelStyle("start",x)}));let y=o.end;if(y){let x;y.forEach(C=>{m=new kT(this._viewer,this._cesium),x=m.create3DTilesets("\u91CD\u5EFA\u6A21\u578B",C.urls,{id:C.id},{groundCenter:C.Center,heading:C.heading,pitch:C.pitch,roll:C.roll},"0",!0,w=>{this.getModelMinMaxTime(w),this.setModelStyle("end",w)}),this.tiltModel.end.push(x)})}}return this};Tb.prototype.getModelMinMaxTime=function(o){let f=o.item.properties;o.startTime=f[this.attr[0]].minimum-1,o.endTime=f[this.attr[1]].maximum,o.allTime=o.endTime-o.startTime};Tb.prototype.useColor=function(o=!1){this._useColor=o,this.currentProgress(this.progress)};Tb.prototype.getCurrentProgressStyle=function(o){if(this.progress=o,this.palyType==="time"){let f=parseInt(o*this.time+this.start);this.setTime(f)}};Tb.prototype.setModelProgressStyle=function(o,f){let m,v;this.progress>.5?o==="start"?m=this._useColor?[["true",this.colors[3]]]:[["true","rgba(255, 255, 255, 0)"]]:(v=parseInt((this.progress-.5)*2*f.allTime+f.startTime),m=this._useColor?[["${"+this.attr[0]+"} > "+v,this.colors[0]],["${"+this.attr[1]+"} <= "+v,this.colors[2]],["true",this.colors[1]]]:[["${"+this.attr[1]+"} <= "+v,"rgba(255, 255, 255, 1)"],["true","rgba(255, 255, 255, 0)"]]):o==="end"?m=this._useColor?[["true",this.colors[0]]]:[["true","rgba(255, 255, 255, 0)"]]:(v=parseInt(this.progress*2*f.allTime+f.startTime),m=this._useColor?[["${"+this.attr[0]+"} > "+v,this.colors[0]],["${"+this.attr[1]+"} <= "+v,this.colors[3]],["true",this.colors[1]]]:[["${"+this.attr[1]+"} <= "+v,"rgba(255, 255, 255, 0)"],["true","rgba(255, 255, 255, 1)"]]),f.item.style=new Cesium.Cesium3DTileStyle({color:{conditions:m}})};Tb.prototype.setTime=function(o){let f=[],m=[];this._useColor?(f=[["${"+this.attr[0]+"} > "+o,this.colors[0]],["${"+this.attr[1]+"} <= "+o,this.colors[3]],["true",this.colors[1]]],m=[["${"+this.attr[0]+"} > "+o,this.colors[0]],["${"+this.attr[1]+"} <= "+o,this.colors[2]],["true",this.colors[1]]]):(f=[["${"+this.attr[1]+"} <= "+o,"rgba(255, 255, 255, 0)"],["true","rgba(255, 255, 255, 1)"]],m=[["${"+this.attr[1]+"} <= "+o,"rgba(255, 255, 255, 1)"],["true","rgba(255, 255, 255, 0)"]]),this.startStyle=new Cesium.Cesium3DTileStyle({color:{conditions:f}}),this.endStyle=new Cesium.Cesium3DTileStyle({color:{conditions:m}})};Tb.prototype.currentProgress=function(o){this.getCurrentProgressStyle(o),this.setModelStyle("start",this.tiltModel.start),this.tiltModel.end.forEach(f=>{this.setModelStyle("end",f)})};Tb.prototype.currentTime=function(o){this.setTime(o),this.setModelStyle("start",this.tiltModel.start),this.tiltModel.end.forEach(f=>{this.setModelStyle("end",f)})};Tb.prototype.setModelStyle=function(o,f){f&&(this.palyType==="time"?f.item.style=o==="start"?this.startStyle:this.endStyle:this.setModelProgressStyle(o,f))};Tb.prototype.setVisibility=function(o){this.tiltModel.start&&this.tiltModel.start.setVisibility(o),this.tiltModel.end.forEach(f=>{f.setVisibility(o)})};Tb.prototype.deleteObject=function(){this.tiltModel.start&&this.tiltModel.start.deleteObject(),this.tiltModel.end.forEach(o=>{o.deleteObject()})};Object.defineProperties(Tb.prototype,{time:{get(){return this.end-this.start}}});var Vpt=Tb;function JUi(o,f){var m=Math.PI/180,v=180/Math.PI,y=o.y*m,x=o.x*m,C=f.y*m,w=f.x*m,A=-Math.atan2(Math.sin(x-w)*Math.cos(C),Math.cos(y)*Math.sin(C)-Math.sin(y)*Math.cos(C)*Math.cos(x-w));return A<0&&(A+=Math.PI*2),A=A*v,A}var a3e=JUi;function KUi(o,f,m){var v=a3e(f,o),y=a3e(f,m),x=v-y;return x<0&&(x+=360),x}var zpt=KUi;function QUi(o){if(!o||o.length<3)return 0;for(var f=6371e3,m=Math.PI/180,v=180/Math.PI,y=0,x=0;x<o.length;x++){var C=(x+1)%o.length,w=(x+2)%o.length;y+=zpt(o[x],o[C],o[w])}var A=(o.length-2)*180,E=y-A;return E>420?(y=o.length*360-y,E=y-A):E>300&&E<420&&(E=Math.abs(360-E)),E*m*f*f}var Hpt=QUi;function lG(o,f){this._viewer=o,this._cesium=f}lG.prototype.createTerrainProfile=function(o){for(var f=[],m=0;m<o.length;m++){var v=this._cesium.Ellipsoid.WGS84.cartesianToCartographic(o[m]);f.push(v.height)}return f};lG.prototype.measureTerrainArea=function(o){var f=Hpt(o).toFixed(1);return f};lG.prototype.measureTerrainHeight=function(o){var f=o[o.length-2],m=o[o.length-1],v=Math.abs(f.x-m.x),y=Math.abs(f.y-m.y),x=v>=y?5e-4:0,C=v<y?.001:0;f.hit>=m.hit;var w=Math.abs(f.z-m.z);return w};lG.prototype.measureTerrainkPerimeter=function(o){var f=o[o.length-2],m=o[o.length-1],v=Math.abs(f.x-m.x),y=Math.abs(f.y-m.y),x=v>=y?5e-4:0,C=v<y?.001:0,w=Math.abs(f.z-m.z),A=op(f.y,f.z,m.y,m.z),E=Math.sqrt(w*w+A*A);return E};lG.prototype.measureTerrainPerimeter=function(o){var f=o[o.length-2],m=o[o.length-1],v=Math.abs(f.x-m.x),y=Math.abs(f.y-m.y),x=v>=y?5e-4:0,C=v<y?.001:0,w=op(f.y,f.x,m.y,m.x);return w};var Upt=lG;var hm,Iue=1e-5*Math.PI/180;var ZUi=11;function kC(o,f){o=o,hm=f,this._cesium=f,this._viewer=o,this._core=new Sr(o,f),this._polylines=[],this._points=[],this._tree=Ne,this._interval=20}kC.prototype.createlineOfSight=function(o,f){var m=[],v=[],y=this;this._tree.starttemporaryItem(this._viewer);var x=0,C=[],w=[],A="0",E={polyline:[]};this._tree.removeHandler();var T=this._core.CreateTooltip();y.objectsToExclude=null;var S=void 0;this._core.mouse(this._viewer.container,1,window.SmartEarthRootUrl+pn.draw);var M=function(){function G(j){this.options={polyline:{show:!0,positions:[],material:y._cesium.Color.YELLOW,width:3,clampToGround:!1}},this.positionsp=j,this._init()}return G.prototype._init=function(){var j=this,q=function(){return j.positionsp};this.options.polyline.positions=new y._cesium.CallbackProperty(q,!1),this.polyline=y._viewer.entities.add(this.options),y.item=this.polyline,y._tree.temporaryItem.obj.push(this.polyline),w.push(this.polyline)},G}();this._tree.handler=new y._cesium.ScreenSpaceEventHandler(y._viewer.scene.canvas);var I=[],P=void 0;if(this._points.length>0)for(var D=0;D<this._points.length;D++)this._viewer.entities.remove(this._points[D]);var L,R=5e-5*Math.PI/180,O=[];this._tree.handler.setInputAction(function(G){var j,q=y._viewer.camera.getPickRay(G.position);j=y._viewer.scene.globe.pick(q,y._viewer.scene);var J=y._viewer.scene.pick(G.position);if(J){var X=y._viewer.scene.pickPosition(G.position);X&&(j=X)}if(!!j)if(I.length===0){I.push(j.clone(),j.clone());var Y={leftX:G.position.x,leftY:G.position.y};O.push(Y),S=j.clone()}else{var Y={rightX:G.position.x,rightY:G.position.y};O.push(Y);var Q={postion:I,entity:w,cartesian:O};C.push(Q),O=[],P=void 0,I=[];var ee=S.clone();if(o.height!=null){var ne=ellipsoid.cartesianToCartographic(S.clone()),z=hm.Math.toDegrees(cartograhphic.latitude),ie=hm.Math.toDegrees(cartograhpinc.longitude),re=o.height,ne=hm.Cartographic.fromDegrees(ie,z,re),oe=ellipsoid.cartographicToCartesian(ne);ee=oe}I.push(ee),I.push(ee),P=new M(I),m.push(P)}},this._cesium.ScreenSpaceEventType.LEFT_CLICK),this._tree.handler.setInputAction(function(G){var j,q=y._viewer.camera.getPickRay(G.endPosition);j=y._viewer.scene.globe.pick(q,y._viewer.scene);var J=y._viewer.scene.pick(G.endPosition);if(J){var X=y._viewer.scene.pickPosition(G.endPosition);X&&(j=X)}!j||(I.length===0?T.showAt(G.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u89C6\u70B9"):T.showAt(G.endPosition,"\u70B9\u51FB\u6DFB\u52A0\u76EE\u6807\u89C6\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F"),I.length>=2&&(y._cesium.defined(P)?j!=null&&(I.pop(),I.push(j)):(P=new M(I),m.push(P))))},this._cesium.ScreenSpaceEventType.MOUSE_MOVE);var F=0,k=0,U=0;return this._tree.handler.setInputAction(function(G){y.end&&y.end()},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=G=>{if(T.show(!1),this.end=void 0,y._core.mouse(y._viewer.container,0),y._tree.endtemporaryItem(),y._tree.handler.destroy(),G==="cancel"){for(var j=0;j<w.length;j++)y._viewer.entities.remove(w[j]);return}for(var q=[],J=!0,X=0;X<C.length;X++)if(X==0?(k=C[X].cartesian[0].leftX,U=C[X].cartesian[0].leftY,J=y.tsjx(C[X].postion,k,U,C[X].cartesian[1].rightX,C[X].cartesian[1].rightY,50,w,y._cesium,y._viewer)):J=y.tsjx(C[X].postion,k,U,C[X].cartesian[0].rightX,C[X].cartesian[0].rightY,50,w,y._cesium,y._viewer),J){var Y=y._viewer.entities.add({name:"polyline1",polyline:{positions:C[X].postion,width:3,material:y._cesium.Color.GREEN}});E.polyline.push(Y)}else{var Y=y._viewer.entities.add({name:"polyline1",polyline:{positions:C[X].postion,width:3,material:y._cesium.Color.RED}});E.polyline.push(Y)}I.pop(),y._polylines=E.polyline,y._tree.handler.destroy();for(var j=0;j<w.length;j++)y._viewer.entities.remove(w[j]);f!=""&&f!=null&&typeof f=="function"&&f(E)},this};kC.prototype.tsjx=function(o,f,m,v,y,x,C,w,A){var E={gcs:[],min:0,max:0,juli:0,cys:x},T=this._core.getSpaceDistancem(o,w);T<=100&&T>=10?x=parseInt(T/2):T<10&&T>0?x=parseInt(T/1):T>100&&(x=parseInt(T/10)),E.cys=x;for(var S=[],M=o[0],I=o[o.length-1],P=w.Cartographic.fromCartesian(M),D=w.Math.toDegrees(P.longitude),L=w.Math.toDegrees(P.latitude),R=P.height,O=P.height,F=w.Cartographic.fromCartesian(I),k=w.Math.toDegrees(F.longitude),U=w.Math.toDegrees(F.latitude),G=F.height,j=F.height,q=x,J=w.Math.lerp(D,k,1/q)-D,X=w.Math.lerp(L,U,1/q)-L,Y=w.Math.lerp(O,j,1/q)-O,Q=w.Math.lerp(f,v,1/q)-f,ee=w.Math.lerp(m,y,1/q)-m,z=[],ie=!0,re,ne,oe=0;oe<q-2;oe++){var se=D+(oe+1)*J,ae=L+(oe+1)*X,fe=O+(oe+1)*Y;re=w.Cartesian3.fromDegrees(se,ae,fe),ne=w.Cartographic.fromCartesian(re);var de=A.scene.globe.getHeight(ne),ve=A.scene.sampleHeight(ne,C);if(ve&&(de=ve),de=parseFloat(de.toFixed(1)),fe=parseFloat(fe.toFixed(1)),de>fe)return ie=!1,ie}return ie};kC.prototype.deleteObject=function(){if(this._points.length>0){this.objectsToExclude=null;for(var o=0;o<this._points.length;o++)this._viewer.entities.remove(this._points[o])}};kC.prototype.InterpolateLineCartographic=function(o,f,m){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;var v=[];v.push(new hm.Cartographic(o.longitude,o.latitude));var y=Math.sqrt(Math.pow(f.longitude-o.longitude,2)+Math.pow(f.latitude-o.latitude,2)),x=m&&typeof m=="number"?m:Iue;if(y<=x)return v.push(new hm.Cartographic(f.longitude,f.latitude)),v;for(var C=y/x,w=(f.longitude-o.longitude)/C,A=(f.latitude-o.latitude)/C,E=0;E<C;E++){var T=o.longitude+(E+1)*w,S=o.latitude+(E+1)*A;v.push(new hm.Cartographic(T,S))}return v.push(new hm.Cartographic(f.longitude,f.latitude,f.height)),v};kC.prototype.InterpolateLineCartographicxp=function(o,f,m){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;var v=[];v.push(new hm.Cartographic(o.longitude,o.latitude));var y=Math.sqrt(Math.pow(f.longitude-o.longitude,2)+Math.pow(f.latitude-o.latitude,2)),x=m&&typeof m=="number"?m:Iue;if(y<=x)return v.push(new hm.Cartographic(f.longitude,f.latitude)),v;for(var C=y/x,w=(f.longitude-o.longitude)/C,A=(f.latitude-o.latitude)/C,E=(f.height-o.height)/C,T=!0,S=0;S<C;S++){var M=o.longitude+(S+1)*w,I=o.latitude+(S+1)*A,P=o.height+E*(S+1);v.push(new hm.Cartographic(M,I,P))}return v.push(new hm.Cartographic(f.longitude,f.latitude,f.height)),v};kC.prototype.InterpolateLineHeightCartographic=function(o,f){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;var m=[];m.push(new hm.Cartographic(o.longitude,o.latitude,o.height));var v=Math.sqrt(Math.pow(f.longitude-o.longitude,2)+Math.pow(f.latitude-o.latitude,2));if(v<=Iue)return m.push(new hm.Cartographic(f.longitude,f.latitude,f.height)),m;for(var y=v/Iue,x=(f.longitude-o.longitude)/y,C=(f.latitude-o.latitude)/y,w=(f.height-o.height)/y,A=0;A<y;A++){var E=o.longitude+(A+1)*x,T=o.latitude+(A+1)*C,S=o.height+(A+1)*w;m.push(new hm.Cartographic(E,T,S))}return m.push(new hm.Cartographic(f.longitude,f.latitude,f.height)),m};kC.prototype.InterpolateIndexLineHeightCartographic=function(o,f,m,v){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;var y=(f.longitude-o.longitude)/m,x=(f.latitude-o.latitude)/m,C=(f.height-o.height)/m,w=o.longitude+v*y,A=o.latitude+v*x,E=o.height+v*C,T=new hm.Cartographic(w,A,E);return T};kC.prototype.InterpolateIndexLineHeightCartographicxp=function(o,f,m,v){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;var y=(f.longitude-o.longitude)/m,x=(f.latitude-o.latitude)/m,C=(f.height-o.height)/m,w=o.longitude+v*y,A=o.latitude+v*x,E=o.height+v*C,T=new hm.Cartographic(w,A,E);return T};kC.prototype.Interpolate2IndexLineHeightCartographic=function(o,f,m,v){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;var y=[];y.push(new hm.Cartographic(o.longitude,o.latitude,o.height));for(var x=(f.longitude-o.longitude)/m,C=(f.latitude-o.latitude)/m,w=(f.height-o.height)/m,A=0;A<v;A++){var E=o.longitude+(A+1)*x,T=o.latitude+(A+1)*C,S=o.height+(A+1)*w;y.push(new hm.Cartographic(E,T,S))}return y};kC.prototype.CartographicPointsTerrainData=function(o,f){if(!!(o.length&&o.length>0)){var m=hm.sampleTerrain(this._viewer.terrainProvider,ZUi,o);hm.when(m,function(v){f(v)})}};kC.prototype.setVisibility=function(o){if(this._polylines.length>0)for(var f=0;f<this._polylines.length;f++)this._polylines[f].show=o};kC.prototype.deleteObject=function(){if(this._polylines.length>0)for(var o=0;o<this._polylines.length;o++)this._viewer.entities.remove(this._polylines[o])};Object.defineProperties(kC.prototype,{sight:{get:function(){return this.item.sight},set:function(o){this.item.sight=sight}}});var Gpt=kC;function VC(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this._indoormode=new ek(o,f),this._model=null,this._relativeHeight=-100,this._groundHeightAtCameraPosition=0,this._startMousePosition,this._mousePosition,this._cameraHeight,this._originalOption,this._alpha=.5,this._brightness=.3,this._depth=300,this._canvas=null,this.isIndoor=!1,this.isUndergroundMode=!1,this._flags={move:!1,vertical:!1,horizontally:!1,rotate:!1},this.moveSpeed=1}VC.prototype.refreshGridLines=function(){var o=this._relativeHeight<0,f=this._viewer.camera,m=new this._cesium.Cartographic(f.positionCartographic.longitude,f.positionCartographic.latitude,-this._depth);if(!this._model)this._model=this.UndergroundGridLines(m,o);else{var v=this.UndergroundGridLines(m,o);this._viewer.scene.primitives.remove(this._model),this._model=v}};VC.prototype.UndergroundModelOpen=function(o,f){if(!this._model){this._getOriginalOption();var m=this._viewer.camera,C=new this._cesium.Cartographic(m.positionCartographic.longitude,m.positionCartographic.latitude,-this._depth),v=new this._cesium.Cartographic(m.positionCartographic.longitude,m.positionCartographic.latitude,m.positionCartographic.height);this.destination=v,this.orientation={heading:m.heading,pitch:m.pitch,roll:0},this._cesium.ExpandBySmartEarth&&(this._cesium.ExpandBySmartEarth.underEarth.cullFace=!1,this._cesium.ExpandBySmartEarth.underEarth.enable=!0,this._cesium.ExpandBySmartEarth.underEarth.enableDepth=this._depth,this._cesium.ExpandBySmartEarth.underEarth.enableSkirt=!0),this._viewer.scene.globe.baseColor=this._cesium.Color.WHITE.withAlpha(0);var y;o?(this._depth=this._cesium.defaultValue(o.depth,300),this._alpha=this._cesium.defaultValue(o.alpha,.5),this._brightness=this._cesium.defaultValue(o.brightness,.3),this.isEnterUnderground=this._cesium.defaultValue(o.isEnterUnderground,!0),this.isFlyToSky=this._cesium.defaultValue(o.isFlyToSky,!0),y=this._cesium.defaultValue(o.height,-100)):(this._depth=300,this._alpha=.5,this._brightness=.3,this.isEnterUnderground=!0,this.isFlyToSky=!0,y=-100),this.setLayerAlpha(this._alpha,this._brightness),this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.highDynamicRange=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.skyBox.show=!1,this._viewer.scene.fog.enabled=!1,this._viewer.scene.backgroundColor=new this._cesium.Color(0,0,0,1),this._viewer.container.style.backgroundImage="unset",this.isUndergroundMode=!0,f?(this.isIndoor=!0,this._indoormode.createIndoormode({undergroundMode:this})):this.isIndoor=!1;var x=this._viewer.camera,C=new this._cesium.Cartographic(x.positionCartographic.longitude,x.positionCartographic.latitude,-this._depth);this._model=this.UndergroundGridLines(C,!0);var w=this;return this._viewer.scene.preRender.addEventListener(this.getRelativeHeight,this),this.getRelativeHeight(),this._relativeHeight>0&&this.isEnterUnderground&&this.enterUnderground(y),this}};VC.prototype.close=function(){if(this._model){this._viewer.scene.preRender.removeEventListener(this.getRelativeHeight,this),this.setLayerAlpha(this._originalOption.alpha,this._originalOption.brightness),this._viewer.scene.primitives.remove(this._model),this._cesium.ExpandBySmartEarth&&(this._cesium.ExpandBySmartEarth.underEarth.cullFace=void 0,this._cesium.ExpandBySmartEarth.underEarth.enable=!1,this._cesium.ExpandBySmartEarth.underEarth.enableDepth=0,this._cesium.ExpandBySmartEarth.underEarth.enableSkirt=!1),this._viewer.scene.globe.baseColor=this._cesium.Color.WHITE.withAlpha(1),this._viewer.scene.globe.depthTestAgainstTerrain=this._originalOption.depthTest,this._viewer.scene.skyBox&&(this._viewer.scene.skyBox.show=this._originalOption.skyBoxShow),this._viewer.scene.highDynamicRange=this._originalOption.highDynamicRange,this._viewer.scene.skyAtmosphere.show=this._originalOption.skyShow,this._viewer.scene.backgroundColor=this._originalOption.backgroundColor,this._viewer.container.style.backgroundImage=this._originalOption.backgroundImage,this._viewer.scene.fog.enabled=this._originalOption.fog,this.isUndergroundMode=!1,this._model=null,zJ=void 0;var o=this._viewer.camera.positionCartographic;if(Wpt(this),this.isFlyToSky){if(this._relativeHeight>500)return;this.flyToSky()}}};VC.prototype._getOriginalOption=function(){var o={alpha:this._cesium.clone(this._viewer.imageryLayers._layers[0]&&this._viewer.imageryLayers._layers[0].alpha),brightness:this._cesium.clone(this._viewer.imageryLayers._layers[0]&&this._viewer.imageryLayers._layers[0].brightness),highDynamicRange:this._cesium.clone(this._viewer.scene.highDynamicRange),skyShow:this._cesium.clone(this._viewer.scene.skyAtmosphere.show),skyBoxShow:this._cesium.clone(this._viewer.scene.skyBox&&this._viewer.scene.skyBox.show),depthTest:this._cesium.clone(this._viewer.scene.globe.depthTestAgainstTerrain),backgroundColor:this._viewer.scene.backgroundColor.clone(),backgroundImage:this._viewer.container.style.backgroundImage,fog:this._viewer.scene.fog.enabled};this._viewer.scene.globe._surface&&this._viewer.scene.globe._surface._tileProvider&&this._viewer.scene.globe._surface._tileProvider._renderState&&(o.blending=this._cesium.clone(this._viewer.scene.globe._surface._tileProvider._renderState.blending)),this._originalOption=o};VC.prototype.enterUnderground=function(o){var f=this._viewer.camera,m=new this._cesium.Cartographic(f.positionCartographic.longitude,f.positionCartographic.latitude,-this._depth);f.positionCartographic.height<=10||f.flyTo({destination:new this._cesium.Cartesian3.fromRadians(m.longitude,m.latitude,o||-this._depth/3),orientation:{heading:this._cesium.Math.toRadians(0),pitch:this._cesium.Math.toRadians(0),roll:0},complete:function(){}})};VC.prototype.flyToSky=function(){var o=this._viewer.camera,f=this._viewer.camera.positionCartographic;o.positionCartographic.height>=10||this._viewer.camera.flyTo({destination:new this._cesium.Cartesian3.fromRadians(this.destination.longitude,this.destination.latitude,this.destination.height),orientation:{heading:this.orientation.heading,pitch:this.orientation.pitch,roll:0}})};VC.prototype.setLayerAlpha=function(o,f){for(var m=this._viewer.imageryLayers.length,v=0;v<m;v++)this._viewer.imageryLayers.get(v).alpha=o,f!==void 0&&(this._viewer.imageryLayers.get(v).brightness=f);this._alpha=o,f!==void 0&&(this._brightness=f)};VC.prototype.UndergroundGridLines=function(o,f){var m=o;o instanceof this._cesium.Cartesian3&&(m=this._viewer.scene.globe.ellipsoid.cartesianToCartographic(o));var v=new this._cesium.GeometryInstance({geometry:new this._cesium.EllipseGeometry({center:this._cesium.Cartesian3.fromRadians(m.longitude,m.latitude),height:m.height,semiMinorAxis:2e4,semiMajorAxis:2e4,vertexFormat:this._cesium.VertexFormat.POSITION_AND_ST}),id:"undergroundSurface"}),y=this._cesium.Material.fromType("Grid");y.uniforms.color=this._cesium.Color.WHITE.withAlpha(.3),y.uniforms.cellAlpha=.01,y.uniforms.lineCount=new this._cesium.Cartesian2(200,200),y.uniforms.lineThickness=new this._cesium.Cartesian2(1,1);var x=this._viewer.scene.primitives.add(new this._cesium.Primitive({geometryInstances:v,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:y})}));return x.appearance.renderState.depthTest.enabled=!0,x.show=f,x};function Wpt(o){var f=o._viewer.scene,m=o._viewer.canvas;o._tree&&o._tree.handler&&(o._tree.handler.destroy(),o._tree.handler=null),f.screenSpaceCameraController.enableRotate=!0,f.screenSpaceCameraController.enableTranslate=!0,f.screenSpaceCameraController.enableZoom=!0,f.screenSpaceCameraController.enableTilt=!0,f.screenSpaceCameraController.enableLook=!0}VC.prototype.attachMouseEvent=function(){var o,f=this,m=this._viewer.scene;this._canvas=this._viewer.canvas,this._tree.handler=new this._cesium.ScreenSpaceEventHandler(this._canvas),this._canvas.setAttribute("tabindex","0"),this._canvas.onclick=function(){f._canvas.focus()},m.screenSpaceCameraController.enableRotate=!1,m.screenSpaceCameraController.enableTranslate=!1,m.screenSpaceCameraController.enableZoom=!1,m.screenSpaceCameraController.enableTilt=!1,m.screenSpaceCameraController.enableLook=!1,this._tree.handler.setInputAction(function(y){f._flags.move=!0,f._viewer.camera.pitch>f._cesium.Math.toRadians(5)?(f._flags.vertical=!0,f._startMousePosition=y.position):f._flags.horizontally=!0,o=f._viewer.camera.positionCartographic,f._cameraHeight=f._viewer.camera.positionCartographic.height},this._cesium.ScreenSpaceEventType.LEFT_DOWN),this._tree.handler.setInputAction(function(y){f._flags.move=!0,f._flags.rotate=!0},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),this._tree.handler.setInputAction(function(y){f._flags.vertical||(f._startMousePosition=y.startPosition),f._mousePosition=y.endPosition,f.mouseMoveEvent()},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),this._tree.handler.setInputAction(function(y){f._flags.move=!1,f._flags.horizontally=!1,f._flags.vertical=!1},this._cesium.ScreenSpaceEventType.LEFT_UP),this._tree.handler.setInputAction(function(y){f._flags.move=!1,f._flags.rotate=!1},this._cesium.ScreenSpaceEventType.MIDDLE_UP);var v=1e3;this._tree.handler.setInputAction(function(y){var x=f._viewer.camera,C=x.positionCartographic.height>500?x.positionCartographic.height/v:.1;x.pitch<0&&x.positionCartographic.height<-200&&y>0||x.pitch>0&&x.positionCartographic.height<-200&&y<0||x.zoomIn(y*C)},this._cesium.ScreenSpaceEventType.WHEEL)};VC.prototype.mouseMoveEvent=function(){var o=200*this.moveSpeed,f=2,m=.001,v=this._viewer.camera;if(this._flags.move){var y=this._canvas.clientWidth,x=this._canvas.clientHeight,C=this._mousePosition.x-this._startMousePosition.x,w=-(this._mousePosition.y-this._startMousePosition.y);this._flags.horizontally&&(v.moveLeft(C*f),v.moveBackward(w*f),v.setView({destination:this._cesium.Cartesian3.fromRadians(v.positionCartographic.longitude,v.positionCartographic.latitude,this._cameraHeight),orientation:{heading:v.heading,pitch:v.pitch,roll:v.roll}})),this._flags.vertical&&(w=w/x,v.setView({destination:this._cesium.Cartesian3.fromRadians(v.positionCartographic.longitude,v.positionCartographic.latitude,this._cameraHeight-w*o),orientation:{heading:v.heading,pitch:v.pitch,roll:v.roll}})),this._flags.rotate&&((!v.roll&&v.pitch<0&&w<0||!v.roll&&v.pitch>0&&w>0)&&(w=0),v.rotate(v.position,C*m),v.lookUp(w*m))}};var zJ;VC.prototype.getRelativeHeight=function(){var o=this._viewer.camera,f=this._viewer.scene.globe.getHeight(o.positionCartographic);if(this._groundHeightAtCameraPosition=f||this._groundHeightAtCameraPosition,this._relativeHeight=o.positionCartographic.height-this._groundHeightAtCameraPosition,this._relativeHeight<1){!this._tree.handler&&!this.isIndoor&&this.attachMouseEvent();let m=Math.abs(this._relativeHeight);m<50?this.moveSpeed=.25:m<100?this.moveSpeed=.5:m<150?this.moveSpeed=.75:this.moveSpeed=1}else this._tree.handler&&!this.isIndoor&&Wpt(this);!zJ&&(zJ=o.position.clone()),this._core.getSpaceDistancem([zJ,o.position],this._cesium)>1e4&&(zJ=o.position.clone(),this.refreshGridLines()),this._relativeHeight<0?this._model&&(this._model.show=!0):this._model&&(this._model.show=!1)};VC.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};VC.prototype.setCesiumFov=function(o){this._viewer.camera.frustum.fov=this._cesium.Math.toRadians(o)};var jpt=VC;function is(o,f){this._viewer=o,this._cesium=f,this._elevationContour=new L8(this._viewer,this._cesium),this._createcurtaincontrast=new Ept(this._viewer,this._cesium),this._createindoormode=new ek(this._viewer,this._cesium),this._createWeather=new Tpt(this._viewer,this._cesium),this._UndergroundGrid=new Spt(this._viewer),this._StreetView=new FJ(this._viewer,this._cesium),this._depthTestAgainstTerrain=new Ppt(this._viewer,this._cesium),this._create3DViewshed=new Sue(this._viewer,this._cesium),this._skylineAnalysis=new Rpt(this._viewer,this._cesium),this._EdgeStage=new Bpt(this._viewer,this._cesium),this._bufferAnalysis=new yP(this._viewer,this._cesium),this._shadowsAnalysis=new kpt(this._viewer,this._cesium),this._screenshot=new Ole(this._viewer,this._cesium),this._PointFly=new c8(this._viewer,this._cesium),this._SunshineAnalysis=new Pue(this._viewer,this._cesium),this._measure=new Ase(this._viewer,this._cesium),this._Deprecated=new Upt(this._viewer,this._cesium),this._UndergroundMode=new jpt(this._viewer,this._cesium)}is.prototype.clearMeasure=function(o){this._measure.clearMeasure(o)};is.prototype.horizontalDistance=function(o,f){this._measure.horizontalDistance(o,f)};is.prototype.spaceDistance=function(o,f){this._measure.spaceDistance(o,f)};is.prototype.altitude=function(o,f){this._measure.altitude(o,f)};is.prototype.verticalHeight=function(o,f){this._measure.verticalHeight(o,f)};is.prototype.surfaceArea=function(o,f){this._measure.surfaceArea(o,f)};is.prototype.planeArea=function(o,f){this._measure.planeArea(o,f)};is.prototype.measureAngle=function(o,f){this._measure.measureAngle(o,f)};is.prototype.analysisVolume=function(o,f){this._measure.analysisVolume(o,f)};is.prototype.measureTerrainPerimeter=function(o){return this._Deprecated.measureTerrainPerimeter(o)};is.prototype.depthTestAgainstTerrain=function(o){return this._depthTestAgainstTerrain.depthTestAgainstTerrain(o)};is.prototype.DrawPointBuffer=function(o,f,m){return this._bufferAnalysis.DrawPoint(o,f,m)};is.prototype.DrawPolylineBuffer=function(o,f,m){return this._bufferAnalysis.DrawPolyline(o,f,m)};is.prototype.DrawPolygonBuffer=function(o,f,m){return this._bufferAnalysis.DrawPolygon(o,f,m)};is.prototype.TerrainExcavation=function(o=100,f,m){return new _pt(this._viewer,this._cesium).draw(o,f,m)};is.prototype.ShadowsAnalysis=function(){return this._shadowsAnalysis.createAnalysis()};is.prototype.createSkylineAnalysis=function(o){return this._skylineAnalysis.createSkylineAnalysis(o)};is.prototype.createEdgeStage=function(o){return this._EdgeStage.createEdgeStage(o)};is.prototype.clearSkylineAnalysis=function(){return this._skylineAnalysis.clear()};is.prototype.createScreenshot=function(o){return this._screenshot.createScreenshot(o)};is.prototype.ScreenshotCompared=function(o){return this._screenshot.createScreenshotCompared(o)};is.prototype.setPointFly=function(o){return this._PointFly.setPointFly(o)};is.prototype.createCircleScan=function(o,f,m,v,y){var x=new bb(this._viewer,this._cesium);return x.createCircleScan(o,f,m,v,y)};is.prototype.createMultiCircleScan=function(o,f,m,v,y){var x=new bb(this._viewer,this._cesium);return x.createMultiCircleScan(o,f,m,v,y)};is.prototype.createSectorScan=function(o,f,m,v,y,x,C){var w=new bb(this._viewer,this._cesium);return w.createSectorScan(o,f,m,v,y,x,C)};is.prototype.createRadarScan=function(o,f,m,v,y){var x=new bb(this._viewer,this._cesium);return x.createRadarScan(o,f,m,v,y)};is.prototype.UndergroundModelOpen=function(o,f){return this._UndergroundMode.UndergroundModelOpen(o,f)};is.prototype.UndergroundModelClose=function(){return this._UndergroundMode.close()};is.prototype.UndergroundMode=function(o,f){if(o){this._viewer.scene.globe.translucency.enabled||(this._viewer.scene.globe.translucency.enabled=!0,this._viewer.scene.screenSpaceCameraController.enableCollisionDetection=!1,this._viewer.scene.globe.translucency.backFaceAlpha=0,this.undergroundValue("set")),f!==void 0?this._viewer.scene.globe.translucency.frontFaceAlpha=f:this._viewer.scene.globe.translucency.frontFaceAlpha=.5;let m=this._viewer,v=this._UndergroundGrid;return v.show&&v.add(),{get alpha(){return m.scene.globe.translucency.frontFaceAlpha},set alpha(y){m.scene.globe.translucency.frontFaceAlpha=y},get grid(){return v.show},set grid(y){v.show=y,y?v.add():v.destroy()},get depth(){return v._depth},set depth(y){v._depth=y,v.show&&v.refreshGridLines()}}}else this._viewer.scene.globe.translucency.enabled&&(this._viewer.scene.globe.translucency.enabled=!1,this._viewer.scene.screenSpaceCameraController.enableCollisionDetection=!0,this._viewer.scene.globe.translucency.backFaceAlpha=1,this._UndergroundGrid.destroy(),this.undergroundValue("get"))};is.prototype.undergroundValue=function(o){o==="set"?(this.defaultUnderground={highDynamicRange:this._viewer.scene.highDynamicRange,skyBox:this._viewer.scene.skyBox.show,fog:this._viewer.scene.fog.enabled,undergroundColor:this._viewer.scene.globe.undergroundColor},this._viewer.scene.highDynamicRange=!1,this._viewer.scene.skyBox.show=!1,this._viewer.scene.fog.enabled=!1,this._viewer.scene.globe.undergroundColor=void 0):(this._viewer.scene.highDynamicRange=this.defaultUnderground.highDynamicRange,this._viewer.scene.skyBox.show=this.defaultUnderground.skyBox,this._viewer.scene.fog.enabled=this.defaultUnderground.fog,this._viewer.scene.globe.undergroundColor=this.defaultUnderground.undergroundColor)};is.prototype.StreetViewOpen=function(o,f,m){return this._StreetView.StreetViewOpen(o,f,m)};is.prototype.ExitStreetView=function(){return this._StreetView.exit()};is.prototype.createWeather=function(o,f,m){return this._createWeather.createWeather(o,f,m)};is.prototype.createParticleEffect=function(o,f,m,v){let y=new R8(this._viewer,this._cesium);return!this._Particle&&(this._Particle={}),!this._Particle[o]&&(this._Particle[o]=[]),this._Particle[o].push(y),y.createParticleEffect(o,f,m,v)};is.prototype.removeParticleEffect=function(o){this._Particle&&(this._Particle[o]&&this._Particle[o].forEach(f=>{f.deleteObject()}),this._Particle[o]=[])};is.prototype.demolition=function(o,f){return new Vpt(this._viewer,this._cesium).play(o,f)};is.prototype.measureTerrainHeight=function(o){return this._Deprecated.measureTerrainHeight(o)};is.prototype.createindoormode=function(o){return this._createindoormode.createIndoormode(o)};is.prototype.Indoormodeclose=function(){return this._createindoormode.Indoormodeclose()};is.prototype.createIndoormode=function(){return this._createindoormode.createIndoormode()};is.prototype.closeIndoormode=function(){return this._createindoormode.close()};is.prototype.setTime=function(o=9){let f=new Date().setHours(o);this._viewer.clock.currentTime=Cesium.JulianDate.fromDate(new Date(f))};is.prototype.terrainExaggeration=function(o){return this._viewer.scene.globe.terrainExaggeration=o};is.prototype.createCurtainContrast=function(o,f){return this._createcurtaincontrast.curtainContrast(o,f)};is.prototype.curtainContrast=function(o){return this._createcurtaincontrast.curtainContrastPro(o)};is.prototype.clearCurtainContrast=function(){return this._createcurtaincontrast.close()};is.prototype.measureTerrainArea=function(o){return this._Deprecated.measureTerrainArea(o)};is.prototype.measureTerrainkPerimeter=function(o){return this._Deprecated.measureTerrainkPerimeter(o)};is.prototype.createElevationContour=function(o,f,m){return this._elevationContour.createElevationContour(o,f,m)};is.prototype.createTerrainProfile=function(o){return this._Deprecated.createTerrainProfile(o)};is.prototype.create3DViewshed=function(o){return this._create3DViewshed.startDraw(o),this._create3DViewshed};is.prototype.set3DViewshedOptions=function(o){return this._create3DViewshed.setOptions(o),this._create3DViewshed};is.prototype.create3DViewshedPoss=function(o){return new $Re(this._viewer,this._cesium).createViewshed(o)};is.prototype.add3DViewshedPoss=function(o){return new $Re(this._viewer,this._cesium).addViewshed(o)};is.prototype.add3DViewshed=function(o){return this._create3DViewshed.addViewshed(o),this._create3DViewshed};is.prototype.close3DViewshed=function(){return this._create3DViewshed.close()};is.prototype.createlineOfSight=function(o,f){var m=new Gpt(this._viewer,this._cesium);return m.createlineOfSight(o,f)};is.prototype.createSightLine=function(o){return new wpt(this._viewer,this._cesium).createSightLine(o)};is.prototype.floodAnalysis=function(o,f){return new gg(this._viewer,this._cesium).executePolygonymsd(o,f)};is.prototype.SunshineAnalysisPoint=function(o,f){return this._SunshineAnalysis.sunshineAnalysisPoint(o,f)};is.prototype.SunshineAnalysisPolygon=function(o,f){return this._SunshineAnalysis.sunshineAnalysisPolygon(o,f)};var Ypt=is;var s3e=class extends ls{constructor(f,m,v,y){super(f,v,y),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=m,N(this.editBillboard)&&N(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=m),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editBillboard.entity)||this.pickObject(f,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;this.currentPoint.position=v,this.editBillboard.entity.position=v}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(f){if(N(f)&&N(this.editBillboard)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editBillboard.entity.position=f[y]:N(f[y])&&(this.editBillboard.entity.billboard[y]=f[y])}}}endEditEntity(){}},qpt=s3e;var l3e=class extends ls{constructor(f,m,v,y){super(f,v,y),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=m,N(this.editPoint)&&N(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=m),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editPoint.entity)||this.pickObject(f,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;this.currentPoint.position=v,this.editPoint.entity.position=v}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(f){if(N(f)&&N(this.editPoint)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editPoint.entity.position=f[y]:N(f[y])&&(this.editPoint.entity.point[y]=f[y])}}}endEditEntity(){}},Xpt=l3e;var u3e=class extends ls{constructor(f,m,v,y){if(super(f,v,y),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=m,N(this.editBox)&&N(this.editBox.entity.box)){let x=this.editBox.entity.position._value,C=Mt.fromCartesian(x);this.height=C.height;let w=new H,A=new H;this.getNorthPointByDistance(w,A),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:w,point:{heightReference:this.editBox.entity.box.heightReference,color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:A,point:{heightReference:this.editBox.entity.box.heightReference,color:Re.RED,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(f){let m=this.editBox.entity.position._value,v=Mt.fromCartesian(m);return this.height=v.height+f,H.fromRadians(v.longitude,v.latitude,this.height)}getNorthPointByDistance(f,m,v){let y;console.info(this.editBox.entity.position),N(v)?y=this.editBox.entity.position.getValue(v):y=this.editBox.entity.position._value;let x=tn.eastNorthUpToFixedFrame(y),C=new H,w=this.editBox.entity.box.dimensions._value;w||(w=this.editBox.entity.box.dimensions.getValue(v)),H.divideByScalar(w,2,C),H.clone(C,f),H.clone(C,m),f.y*=-1,Ee.multiplyByPoint(x,f,f),m.y*=-1,m.z*=-1,Ee.multiplyByPoint(x,m,m)}destory(){}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=m,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):m.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=m,this.pickEditWHPoint=void 0):m.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=m),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editBox)||this.pickObject(f,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;let m=new Date,v=ci.fromDate(m);if(N(this.currentPoint)||N(this.pickEditHeightPoint)||N(this.pickEditWHPoint)){let y=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,x=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,y);if(!x)return;let C=Mt.fromCartesian(x),w=H.fromRadians(C.longitude,C.latitude,C.height+this.height);if(N(this.currentPoint))this.currentPoint.position=w,this.editBox.entity.position=new xn(function(){return w},!1);else if(N(this.dragPosition)){if(N(this.pickEditWHPoint)){let T=H.subtract(x,this.dragPosition,new H),S=H.normalize(T,new H);H.dot(T,S,T);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(v));let I=H.clone(M);I.x-=T.x,I.y+=T.y,H.abs(I,I),this.editBox.entity.box.dimensions=new xn(function(){return I},!1)}else if(N(this.pickEditHeightPoint)){let T=H.subtract(x,this.dragPosition,new H),S=this.editBox.entity.box.dimensions._value;S||(S=this.editBox.entity.box.dimensions.getValue(v));let M=H.clone(S);M.z+=T.z,H.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(T.z/2)}}this.dragPosition=x;let A=new H,E=new H;this.getNorthPointByDistance(A,E,v),this.editHeightPoint.position=A,this.editWHPoint.position=E}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(f){if(N(f)&&N(this.editBox)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editBox.entity.position=f[y]:N(f[y])&&(this.editBox.entity.box[y]=f[y])}}}endEditEntity(){for(let f=0;f<this.pointsId.length;f++){let m=this.pointsId[f];this.mEarthCtrl.entities.removeById(m)}this.pointsId=[]}},Jpt=u3e;var c3e=class extends ls{constructor(f,m,v,y){if(super(f,v,y),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=m,N(this.editCylinder)&&N(this.editCylinder.entity.cylinder)){let x=this.editCylinder.entity.position._value,C=Mt.fromCartesian(x);this.height=C.height;let w=this.editCylinder.entity.cylinder.topRadius._value,A=this.editCylinder.entity.cylinder.bottomRadius._value,E=new H,T=new H,S=new H;this.getNorthPointByDistance(E,T,S),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:S,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),w>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:E,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:Re.RED,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),A>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:T,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:Re.RED,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(f){let m=this.editCylinder.entity.position._value,v=Mt.fromCartesian(m);return this.height=v.height+f,H.fromRadians(v.longitude,v.latitude,this.height)}getNorthPointByDistance(f,m,v){let y=this.editCylinder.entity.position._value,x=tn.eastNorthUpToFixedFrame(y),C=this.editCylinder.entity.cylinder.length._value,w=this.editCylinder.entity.cylinder.topRadius._value,A=this.editCylinder.entity.cylinder.bottomRadius._value;w>0&&(f.z+=C/2,f.x+=w,Ee.multiplyByPoint(x,f,f)),A>0&&(m.x+=A,m.z-=C/2,Ee.multiplyByPoint(x,m,m)),v.z+=C/2,Ee.multiplyByPoint(x,v,v)}destory(){}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=m,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):m.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=m,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):m.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=m,this.pickBottomRadiusPoint=void 0):m.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=m),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editCylinder)||this.pickObject(f,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)||N(this.heightPoint)||N(this.topRadiusPoint)||N(this.bottomRadiusPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;let y=Mt.fromCartesian(v),x=H.fromRadians(y.longitude,y.latitude,y.height+this.height);if(N(this.currentPoint))this.currentPoint.position=x,this.editCylinder.entity.position=x;else if(N(this.dragPosition)){if(N(this.pickHeightPoint)){let S=H.subtract(v,this.dragPosition,new H),M=this.editCylinder.entity.cylinder.length._value;M+=S.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(S.z/2),this.editCylinder.entity.cylinder.length=M}else if(N(this.pickTopRadiusPoint)){let S=H.subtract(v,this.dragPosition,new H),M=this.editCylinder.entity.cylinder.topRadius._value;M-=S.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(N(this.pickBottomRadiusPoint)){let S=H.subtract(v,this.dragPosition,new H),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=S.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=v;let C=this.editCylinder.entity.cylinder.topRadius._value,w=this.editCylinder.entity.cylinder.bottomRadius._value,A=new H,E=new H,T=new H;this.getNorthPointByDistance(A,E,T),C>0&&(this.topRadiusPoint.position=A),w>0&&(this.bottomRadiusPoint.position=E),this.heightPoint.position=T}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(f){if(N(f)&&N(this.editCylinder)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editCylinder.entity.position=f[y]:N(f[y])&&(this.editCylinder.entity.cylinder[y]=f[y])}}}endEditEntity(){for(let f=0;f<this.pointsId.length;f++){let m=this.pointsId[f];this.mEarthCtrl.entities.removeById(m)}this.pointsId=[]}},Kpt=c3e;var h3e=class extends ls{constructor(f,m,v,y){if(super(f,v,y),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=m,N(this.editEllipse)&&N(this.editEllipse.entity.ellipse)){let x=xe.PI_OVER_TWO,C=this.updatePoint(x);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:C,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(f){let m=new H,v=new H,y=new H,x=this.editEllipse.entity.ellipse;this.semiMinorAxis=x.semiMinorAxis._value,this.semiMajorAxis=x.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let C=Z(x.rotation,0);this.center=this.editEllipse.entity.position._value;let w=this.semiMinorAxis*this.semiMinorAxis,A=this.semiMajorAxis*this.semiMajorAxis,E=this.semiMajorAxis*this.semiMinorAxis,T=H.magnitude(this.center),S=H.normalize(this.center,m),M=H.cross(H.UNIT_Z,this.center,v);M=H.normalize(M,M);let I=H.cross(S,M,y),P=new H;return tb.pointOnEllipsoid(f,C,I,M,w,E,A,T,S,P)}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=m,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):m.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=m):m.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=m,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editEllipse)||this.pickObject(f,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)||N(this.pickSemiMajorAxisPoint)||N(this.pickSemiMinorAxisPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;if(N(this.currentPoint))this.currentPoint.position=v,this.editEllipse.entity.position=v;else if(N(this.pickSemiMajorAxisPoint)){let y=H.distance(this.center,v);this.editEllipse.entity.ellipse.semiMajorAxis=y;let x=y*this.semiMinorAxis/this.semiMajorAxis;x>y&&(x=y),this.editEllipse.entity.ellipse.semiMinorAxis=x}else if(N(this.pickSemiMinorAxisPoint)){let y=H.distance(this.center,v);this.editEllipse.entity.ellipse.semiMinorAxis=y}this.semiMajorAxisPoint.position=this.updatePoint(xe.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(f){if(N(f)&&N(this.editEllipse)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editEllipse.entity.position=f[y]:N(f[y])&&(this.editEllipse.entity.ellipse[y]=f[y])}}}endEditEntity(){for(let f=0;f<this.pointsId.length;f++){let m=this.pointsId[f];this.mEarthCtrl.entities.removeById(m)}this.pointsId=[]}},Qpt=h3e;var d3e=class extends ls{constructor(f,m,v,y){if(super(f,v,y),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=m,N(this.editEllipsoid)&&N(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let x=this.editEllipsoid.entity.position._value,C=Mt.fromCartesian(x);this.height=C.height;let w=new H,A=new H,E=new H;this.getNorthPointByDistance(w,A,E),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:w,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:A,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:E,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(f){let m=this.editEllipsoid.entity.position._value,v=Mt.fromCartesian(m);return this.height=v.height+f,H.fromRadians(v.longitude,v.latitude,this.height)}getNorthPointByDistance(f,m,v){let y=this.editEllipsoid.entity.position._value,x=tn.eastNorthUpToFixedFrame(y),C=this.editEllipsoid.entity.ellipsoid.radii._value;f.x=C.x,Ee.multiplyByPoint(x,f,f),m.y=-C.y,Ee.multiplyByPoint(x,m,m),v.z=C.z,Ee.multiplyByPoint(x,v,v)}destory(){}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=m,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):m.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=m,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):m.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=m,this.pickRadiiZPoint=void 0):m.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=m),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editEllipsoid)||this.pickObject(f,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)||N(this.pickRadiiXPoint)||N(this.pickRadiiYPoint)||N(this.pickRadiiZPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;let y=Mt.fromCartesian(v),x=H.fromRadians(y.longitude,y.latitude,y.height+this.height);if(N(this.currentPoint))this.currentPoint.position=x,this.editEllipsoid.entity.position=x;else{if(N(this.dragPosition)){let E=H.subtract(v,this.dragPosition,new H),T=H.normalize(E,new H);H.dot(E,T,E);let S=this.editEllipsoid.entity.ellipsoid.radii._value,M=H.clone(S);N(this.pickRadiiXPoint)?M.x-=E.x:N(this.pickRadiiYPoint)?M.y+=E.y:N(this.pickRadiiZPoint)&&(M.z+=E.z,this.editEllipsoid.entity.position=this.addHeight(E.z)),H.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=v}let C=new H,w=new H,A=new H;this.getNorthPointByDistance(C,w,A),this.radiiXPoint.position=C,this.radiiYPoint.position=w,this.radiiZPoint.position=A}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(f){if(N(f)&&N(this.editEllipsoid)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editEllipsoid.entity.position=f[y]:N(f[y])&&(this.editEllipsoid.entity.ellipsoid[y]=f[y])}}}endEditEntity(){for(let f=0;f<this.pointsId.length;f++){let m=this.pointsId[f];this.mEarthCtrl.entities.removeById(m)}this.pointsId=[]}},Zpt=d3e;var f3e=class extends ls{constructor(f,m,v,y){if(super(f,v,y),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=m,N(this.editPolygon)&&N(this.editPolygon.entity.polygon))for(let x=0;x<this.editPolygon.entity.polygon.hierarchy._value.positions.length;x++){let C=this.editPolygon.entity.polygon.hierarchy._value.positions[x],w=this.mEarthCtrl.entities.add({name:"polygon_point",position:C,point:{color:Re.WHITE,pixelSize:8,outlineColor:Re.BLACK,outlineWidth:1}});this.pointsId.push(w.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):m.name==="polygon_point"&&(this.currentPoint=m,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editPolygon)||this.pickObject(f,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;this.currentPoint.position=v;let y=[];for(let x=0;x<this.pointsId.length;x++){let C=this.pointsId[x];y.push(this.mEarthCtrl.entities.getById(C).position._value)}this.editPolygon.entity.polygon.hierarchy=y}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(f){if(N(f)&&N(this.editPolygon)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];N(f[y])&&(this.editPolygon.entity.polygon[y]=f[y])}}}endEditEntity(){for(let f=0;f<this.pointsId.length;f++){let m=this.pointsId[f];this.mEarthCtrl.entities.removeById(m)}this.pointsId=[]}},$pt=f3e;var p3e=class extends ls{constructor(f,m,v,y){super(f,v,y),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=Re.RED.withAlpha(.8),this.isEditing=!1,this.editModel=m,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,N(this.editModel)&&N(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=m),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editModel)||this.pickObject(f,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;let y=Mt.fromCartesian(v),x=Mt.clone(y);x.longitude=xe.toDegrees(x.longitude),x.latitude=xe.toDegrees(x.latitude),this.editModel.lon=x.longitude,this.editModel.lat=x.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(f){if(N(f)&&N(this.editModel)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];if(N(f[y]))switch(y){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[y]=f[y];break;default:this.editModel.entity[y]=f[y];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},emt=p3e;var m3e=class extends ls{constructor(f,m,v,y){super(f,v,y),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=m,N(this.editLabel)&&N(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=m),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editLabel.entity)||this.pickObject(f,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;this.currentPoint.position=v,this.editLabel.entity.position=v}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(f){if(N(f)&&N(this.editLabel)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editLabel.entity.position=f[y]:N(f[y])&&(this.editLabel.entity.label[y]=f[y])}}}endEditEntity(){}},tmt=m3e;var g3e=class extends ls{constructor(f,m,v,y){if(super(f,v,y),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=m,N(this.editPolyline)&&N(this.editPolyline.polyline))for(let x=0;x<this.editPolyline.polyline.positions._value.length;x++){let C=this.editPolyline.polyline.positions._value[x],w=this.mEarthCtrl.entities.add({name:"polyline_point",position:C,point:{color:Re.WHITE,pixelSize:8,outlineColor:Re.BLACK,outlineWidth:1}});this.pointsId.push(w.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):m.name==="polyline_point"&&(this.currentPoint=m,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editPolyline)||this.pickObject(f,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;this.currentPoint.position=v;let y=[];for(let x=0;x<this.pointsId.length;x++){let C=this.pointsId[x];y.push(this.mEarthCtrl.entities.getById(C).position._value)}this.editPolyline.polyline.positions=y}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(f){if(N(f)&&N(this.editPolyline)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];N(f[y])&&(this.editPolyline.polyline[y]=f[y])}}}endEditEntity(){for(let f=0;f<this.pointsId.length;f++){let m=this.pointsId[f];this.mEarthCtrl.entities.removeById(m)}this.pointsId=[]}},imt=g3e;var _3e=class extends ls{constructor(f,m,v,y){if(super(f,v,y),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=m,N(this.editPolylineVolume)&&N(this.editPolylineVolume.entity.polylineVolume))for(let x=0;x<this.editPolylineVolume.entity.polylineVolume.positions._value.length;x++){let C=this.editPolylineVolume.entity.polylineVolume.positions._value[x],w=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:C,point:{color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}});this.pointsId.push(w.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):m.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=m),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editPolylineVolume)||this.pickObject(f,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.currentPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;this.currentPoint.position=v;let y=[];for(let x=0;x<this.pointsId.length;x++){let C=this.pointsId[x];y.push(this.mEarthCtrl.entities.getById(C).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=y}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(f){if(N(f)&&N(this.editPolylineVolume)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editPolylineVolume.entity.position=f[y]:N(f[y])&&(this.editPolylineVolume.entity.polylineVolume[y]=f[y])}}}endEditEntity(){for(let f=0;f<this.pointsId.length;f++){let m=this.pointsId[f];this.mEarthCtrl.entities.removeById(m)}this.pointsId=[]}},rmt=_3e;var v3e=class extends ls{constructor(f,m,v,y){if(super(f,v,y),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=m,N(this.editRectangle)&&N(this.editRectangle.entity.rectangle)){let x=this.editRectangle.entity.rectangle.coordinates._value,C=this.editRectangle.entity.rectangle.height._value,w=Di.northwest(x),A=H.fromRadians(w.longitude,w.latitude,C),E=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:A,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:Re.WHITE,pixelSize:8,outlineColor:Re.BLACK,outlineWidth:1}});this.pointsId.push(E.id),w=Di.southeast(x);let T=H.fromRadians(w.longitude,w.latitude,C),S=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:T,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:Re.WHITE,pixelSize:8,outlineColor:Re.BLACK,outlineWidth:1}});this.pointsId.push(S.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(f){if(super.onLButtonDown(f),this.pickedEntity={},this.pickObject(f,this.pickedEntity)){let m=this.pickedEntity.pickedObject.id;m.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):m.name==="rect_left_top_point"?(this.leftTopPoint=m,this.rightBottomPoint=void 0,this.isEditing=!0):m.name==="rect_right_bottom_point"&&(this.rightBottomPoint=m,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(f){return super.onLButtonUp(f)===!1||!this.isEditing?!1:((N(this.editRectangle)||this.pickObject(f,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(f){if(!this.isEditing)return!1;if(N(this.leftTopPoint)||N(this.rightBottomPoint)){let m=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,v=this.mEarthCtrl.coreMap.camera.pickEllipsoid(f,m);if(!v)return;let y=Mt.fromCartesian(v),x=this.editRectangle.entity.rectangle.coordinates._value;N(this.leftTopPoint)?(this.leftTopPoint.position=v,x.west=y.longitude,x.north=y.latitude):N(this.rightBottomPoint)&&(this.rightBottomPoint.position=v,x.south=y.latitude,x.east=y.longitude),this.editRectangle.entity.rectangle.coordinates=x}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(f){if(N(f)&&N(this.editRectangle)){let m=Object.keys(f);for(let v=0;v<m.length;v++){let y=m[v];y==="position"?this.editRectangle.entity.position=f[y]:N(f[y])&&(this.editRectangle.entity.rectangle[y]=f[y])}}}endEditEntity(){for(let f=0;f<this.pointsId.length;f++){let m=this.pointsId[f];this.mEarthCtrl.entities.removeById(m)}this.pointsId=[]}},nmt=v3e;function r0(o,f={}){this._earthCtrl=o,this._scene=o.coreMap.scene,this.hpRoll={heading:0,pitch:0,roll:0,select:"",angle:0}}r0.prototype.start=function(o,f={}){if(this.end(),!!o){if(console.log(o),this.model=o,this.entityCallback=f.entityCallback,this.isAloft=Z(f.isAloft,!1),this.measuringScale=.1,this.isShowHoloaxis=Z(f.isShowHoloaxis,!1),o._parameter)if(o._parameter.sourceType&&o._parameter.sourceType==="b3dm"||o._parameter.sourceType==="3DTiles")this.modeltype="b3dm",this.originPosition=Ee.getTranslation(this.model._primitive._root.transform,new H),this.model._parameter.transform||(this.model._parameter.transform={}),this.hpRoll={heading:this.model._parameter.transform.heading||0,pitch:this.model._parameter.transform.pitch||0,roll:this.model._parameter.transform.roll||0,select:"",angle:0};else if(o._parameter.sourceType&&o._parameter.sourceType==="I3S")this.modeltype="I3S",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Ee.getTranslation(this.model._layers[0]._tileset._root.transform,new H);else if(o._parameter.sourceType&&o._parameter.sourceType==="s3m")this.modeltype="s3m",this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0},this.originPosition=Ee.getTranslation(this.model.modelMatrix,new H);else if(o._parameter.sourceType&&o._parameter.sourceType==="entity"){this.modeltype="entity",this.originPosition=o.position._value;let m=o.headingPitchRoll;this.hpRoll={heading:m.heading||0,pitch:m.roll||0,roll:-m.pitch||0,select:"",angle:0},this.model._parameter={heading:m.heading||0,pitch:m.roll||0,roll:-m.pitch||0,sourceType:"entity"}}else this.modeltype="GLTF",this.originPosition=Ee.getTranslation(this.model._primitive.modelMatrix,new H),this.hpRoll={heading:this.model._parameter.heading||0,pitch:this.model._parameter.pitch||0,roll:this.model._parameter.roll||0,select:"",angle:0};else if(o._layers&&o._layers[0]&&o._layers[0]._tileset){this.modeltype="I3S";let m=this.matrixGetRotation(this.model._layers[0]._tileset._root.transform);this.model._parameter={heading:m.heading||0,pitch:m.pitch||0,roll:m.roll||0,sourceType:"I3S"},this.hpRoll={heading:m.heading||0,pitch:m.pitch||0,roll:m.roll||0,select:"",angle:0},this.originPosition=Ee.getTranslation(this.model._layers[0]._tileset._root.transform,new H)}else if(o.fileType&&o.fileType==="OSGBCacheFile"||o.modelMatrix&&o._rectangle){this.modeltype="s3m";let m=this.matrixGetRotation(o.modelMatrix);this.model._parameter={heading:m.heading||0,pitch:m.pitch||0,roll:m.roll||0,sourceType:"s3m"},this.hpRoll={heading:m.heading||0,pitch:m.pitch||0,roll:m.roll||0,select:"",angle:0},this.originPosition=Ee.getTranslation(this.model.modelMatrix,new H)}else if(o.boundingSphereRadius&&o.modelEditData)this.modeltype="old3Dtiles",this.hpRoll={heading:o.modelEditData.heading||0,pitch:o.modelEditData.roll||0,roll:o.modelEditData.pitch||0,select:"",angle:0},this.originPosition=H.fromDegrees(o.modelEditData.lon,o.modelEditData.lat,o.modelEditData.height);else if(o.entityCollection&&o.position){this.modeltype="entity",this.originPosition=o.position._value;let m=o.headingPitchRoll;this.hpRoll={heading:m.heading||0,pitch:m.roll||0,roll:-m.pitch||0,select:"",angle:0},this.model._parameter={heading:m.heading||0,pitch:m.roll||0,roll:-m.pitch||0,sourceType:"entity"}}else{console.log("\u6682\u4E0D\u652F\u6301\u8BE5\u6A21\u578B\u683C\u5F0F");return}return this.centerPoint=this.toDegrees(this.originPosition),this.initEvent(f),this}};r0.prototype.initEvent=function(o){this.editHandler=new Ur(this._scene.canvas),this.modeltype==="b3dm"?this.radius=this.model._primitive.boundingSphere.radius:this.modeltype==="I3S"?this.radius=this.model._layers[0]._tileset.boundingSphere.radius:this.modeltype==="s3m"?this.radius=this.model._rootTiles[0].boundingVolume._boundingSphere.radius:this.modeltype==="old3Dtiles"?this.radius=this.model.boundingSphereRadius:this.modeltype==="entity"?this.radius=o.modelRadius||10:this.radius=this.model._primitive._boundingSphere.radius;let f,m;this.createAxios(o.select),this.editHandler.setInputAction(v=>{f?(m=v.position,this.modeltype==="b3dm"?this.originPosition=Ee.getTranslation(this.model._primitive._root.transform,new H):this.modeltype==="I3S"?this.originPosition=Ee.getTranslation(this.model._layers[0]._tileset._root.transform,new H):this.modeltype==="s3m"?this.originPosition=Ee.getTranslation(this.model.modelMatrix,new H):this.modeltype==="old3Dtiles"?this.originPosition=H.fromDegrees(this.model.modelEditData.lon,this.model.modelEditData.lat,this.model.modelEditData.height):this.modeltype==="entity"?this.originPosition=this.model.position._value:this.originPosition=Ee.getTranslation(this.model._primitive.modelMatrix,new H),this.startPosition=this._scene.pickPosition(m)):m=void 0},Ei.LEFT_DOWN),this._scene.pickPointInterval=500,this.editHandler.setInputAction(v=>{if(m){this._scene.screenSpaceCameraController.enableRotate=!1,this.edit(f,m,v),o.callback&&o.callback(this);return}let y=this._scene.pick(v.endPosition);if(y&&y.id)if(y.id._name&&y.id._name==="modeEditAxis"){let x=y.id._id;x==="entityPolylineY"?(f="y",this.selectAxis="y",this.setAxisStyle(!0,"y")):x==="entityPolylineX"?(f="x",this.selectAxis="x",this.setAxisStyle(!0,"x")):x==="entityPolylineZ"&&(f="z",this.selectAxis="z",this.setAxisStyle(!0,"z"))}else y.id==="axisSphereX"?f="pitch":y.id==="axisSphereY"?f="roll":y.id==="axisSphereZ"?f="heading":(f=void 0,this.setAxisStyle(!1));else f=void 0,this.setAxisStyle(!1)},Ei.MOUSE_MOVE),this.editHandler.setInputAction(v=>{this.upDateHpRoll(),m=void 0,this._scene.screenSpaceCameraController.enableRotate=!0,this.rotateSector1&&this._earthCtrl.entities.remove(this.rotateSector1),this.rotateSector1=void 0,this.rotateSector2&&this._earthCtrl.entities.remove(this.rotateSector2),this.rotateSector2=void 0},Ei.LEFT_UP),this.editHandler.setInputAction(v=>{this.isAloft?this.measuringScale=.1:this.measuringScale=this.calPixelDistance()},Ei.WHEEL)};r0.prototype.createAxios=function(o){let f=this.centerPoint,m=2e-5*Number(this.radius),v=18e-6*Number(this.radius),y=1.7*Number(this.radius),x=0,C=0,w=0;if(this.isShowHoloaxis&&(x=m,C=v,w=y),(o===1||o===3)&&(this.arrowx=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineX",position:this.originPosition,polyline:{positions:new H.fromDegreesArrayHeights([f.lon-x,f.lat,f.hei,f.lon+m,f.lat,f.hei]),material:new _C(Re.RED),followSurface:!1,width:25}}),this.arrowy=this._earthCtrl.entities.add({id:"entityPolylineY",name:"modeEditAxis",position:this.originPosition,polyline:{positions:new H.fromDegreesArrayHeights([f.lon,f.lat-C,f.hei,f.lon,f.lat+v,f.hei]),material:new _C(Re.GREEN),followSurface:!1,width:25}}),this.arrowz=this._earthCtrl.entities.add({name:"modeEditAxis",id:"entityPolylineZ",position:this.originPosition,polyline:{positions:new H.fromDegreesArrayHeights([f.lon,f.lat,f.hei-w,f.lon,f.lat,f.hei+y]),material:new _C(Re.BLUE),followSurface:!1,width:25}})),o===2||o===3){this.AxisX=this.createAxisSphere("axisSphereX",this.radius,this.originPosition,Re.RED),this.AxisY=this.createAxisSphere("axisSphereY",this.radius,this.originPosition,Re.GREEN),this.AxisZ=this.createAxisSphere("axisSphereZ",this.radius,this.originPosition,Re.BLUE);let A=Ut.fromRotationY(xe.toRadians(90)),E=Ee.fromRotationTranslation(A);Ee.multiply(this.AxisX.modelMatrix,E,this.AxisX.modelMatrix);let T=Ut.fromRotationX(xe.toRadians(90)),S=Ee.fromRotationTranslation(T);Ee.multiply(this.AxisY.modelMatrix,S,this.AxisY.modelMatrix)}};r0.prototype.createAxisSphere=function(o,f,m,v){let y={position:[],radius:f};for(let E=0;E<=360;E+=2){let T=Math.sin(xe.toRadians(E)),S=Math.cos(xe.toRadians(E)),M=y.radius*S,I=y.radius*T;y.position.push(new H(M,I,0))}let x=tn.eastNorthUpToFixedFrame(m),C=new b_({positions:y.position,width:8}),w=new co({geometry:C,id:o}),A=new Ia({geometryInstances:w,appearance:new M0({material:zo.fromType("Color")}),modelMatrix:x});return A.appearance.material.uniforms.color=v,this._scene.primitives.add(A)};r0.prototype.edit=function(o,f,m){if(o){let v=this.originPosition,y=this.startPosition,x=this._scene.pickPosition(m.endPosition),C=this.toDegrees(v),w=this.toDegrees(y),A=this.toDegrees(x),E=this._scene.cartesianToCanvasCoordinates(v),T=this._earthCtrl.coreMap.camera.heading;if(o==="x"){let M=this.calTwoLineDistance(T-2*Math.PI,f,m.endPosition)*this.radius*1e-6*this.measuringScale;C.lon+=M,this.setAxisPosition(C),this.setPosition(C)}else if(o==="y"){let M=this.calTwoLineDistance(T,f,m.endPosition)*this.radius*1e-6*this.measuringScale;C.lat-=M,this.setAxisPosition(C),this.setPosition(C)}else if(o==="z"){let S=m.endPosition.y-f.y;C.hei-=S*this.radius*.125*this.measuringScale,this.setAxisPosition(C),this.setPosition(C)}else if(o==="heading"){let S=this.arge(E,f,m.endPosition,"+-",!0),M=this.hpRoll.heading-S;this.hpRoll.select="heading",this.hpRoll.angle=M,this.setRotate("heading",M);let I=this.arge({x:C.lon,y:C.lat},{x:C.lon+this.radius,y:C.lat},{x:w.lon,y:w.lat},"360");this.setRotateLine("z",v,I,S)}else if(o==="pitch"){let S=this.hpRoll.pitch,M=this.arge(E,f,m.endPosition,"+-",!0),P=this.toDegrees(this._scene.camera.position).lon-C.lon,D=H.subtract(y,v,new H),L=H.normalize(v,new H),O=H.angleBetween(D,L)*180/Math.PI;P>0?(S+=M,w.lat-C.lat>0?this.setRotateLine("x",v,O,-M):this.setRotateLine("x",v,-O,-M)):(S-=M,w.lat-C.lat>0?this.setRotateLine("x",v,O,M):this.setRotateLine("x",v,-O,M)),this.hpRoll.select="pitch",this.hpRoll.angle=S,this.setRotate("pitch",S)}else if(o==="roll"){let M=this.toDegrees(this._scene.camera.position).lat-C.lat,I=this.hpRoll.roll,P=this.arge(E,f,m.endPosition,"+-",!0),D=H.subtract(y,v,new H),L=H.normalize(v,new H),O=H.angleBetween(D,L)*180/Math.PI;M>0?(I+=P,w.lon-C.lon>0?this.setRotateLine("y",v,O,P):this.setRotateLine("y",v,-O,P)):(I-=P,w.lon-C.lon>0?this.setRotateLine("y",v,O,-P):this.setRotateLine("y",v,-O,-P)),this.hpRoll.select="roll",this.hpRoll.angle=I,this.setRotate("roll",I)}}};r0.prototype.setPosition=function(o,f){let m=H.fromDegrees(o.lon,o.lat,o.hei);if(this.modeltype==="b3dm"){let v=new dl(xe.toRadians(this.hpRoll.heading),xe.toRadians(-this.hpRoll.roll),xe.toRadians(this.hpRoll.pitch));this.model._primitive._root.transform=tn.headingPitchRollToFixedFrame(m,v)}else if(this.modeltype==="I3S"){let v=new dl(xe.toRadians(this.hpRoll.heading),xe.toRadians(this.hpRoll.pitch),xe.toRadians(this.hpRoll.roll));this.model._layers[0]._tileset._root.transform=tn.headingPitchRollToFixedFrame(m,v)}else if(this.modeltype==="s3m"){let v=new dl(xe.toRadians(this.hpRoll.heading),xe.toRadians(this.hpRoll.pitch),xe.toRadians(this.hpRoll.roll));this.model.modelMatrix=new tn.headingPitchRollToFixedFrame(m,v)}else if(this.modeltype==="old3Dtiles")this.model.setEditData({lon:o.lon,lat:o.lat,height:o.hei});else if(this.modeltype==="entity")this.entityCallback?this.entityCallback({changeDegrees:o}):this.model.position=m;else{let v=new dl(xe.toRadians(this.hpRoll.heading),xe.toRadians(this.hpRoll.pitch),xe.toRadians(this.hpRoll.roll)),y=tn.localFrameToFixedFrameGenerator("north","west");this.model._primitive.modelMatrix=tn.headingPitchRollToFixedFrame(m,v,ki.WGS84,y)}};r0.prototype.upDateHpRoll=function(){this.hpRoll.select==="heading"?(this.hpRoll.heading=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="pitch"?(this.hpRoll.pitch=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""):this.hpRoll.select==="roll"&&(this.hpRoll.roll=this.hpRoll.angle,this.hpRoll.angle=0,this.hpRoll.select=""),this.modeltype==="b3dm"?(this.model._parameter.transform.heading=this.hpRoll.heading,this.model._parameter.transform.roll=this.hpRoll.roll,this.model._parameter.transform.pitch=this.hpRoll.pitch):this.modeltype==="old3Dtiles"||(this.model._parameter.heading=this.hpRoll.heading,this.model._parameter.roll=this.hpRoll.roll,this.model._parameter.pitch=this.hpRoll.pitch)};r0.prototype.setAxisPosition=function(o){let f=2e-5*Number(this.radius),m=18e-6*Number(this.radius),v=1.7*Number(this.radius),y=0,x=0,C=0;this.isShowHoloaxis&&(y=f,x=m,C=v);let w=H.fromDegrees(o.lon-y,o.lat,o.hei),A=H.fromDegrees(o.lon,o.lat-x,o.hei),E=H.fromDegrees(o.lon,o.lat,o.hei-C),T=H.fromDegrees(o.lon+f,o.lat,o.hei),S=H.fromDegrees(o.lon,o.lat+m,o.hei),M=H.fromDegrees(o.lon,o.lat,o.hei+v);this.arrowx._polyline.positions=new xn(function(){return[w,T]},!1),this.arrowy._polyline.positions=new xn(function(){return[A,S]},!1),this.arrowz._polyline.positions=new xn(function(){return[E,M]},!1)};r0.prototype.setAxisStyle=function(o,f){o?f==="x"?(this.arrowx._polyline._material._color._value=Re.YELLOW,this.arrowy._polyline._material._color._value=Re.GREEN,this.arrowz._polyline._material._color._value=Re.BLUE):f==="y"?(this.arrowy._polyline._material._color._value=Re.YELLOW,this.arrowx._polyline._material._color._value=Re.RED,this.arrowz._polyline._material._color._value=Re.BLUE):f==="z"&&(this.arrowz._polyline._material._color._value=Re.YELLOW,this.arrowx._polyline._material._color._value=Re.RED,this.arrowy._polyline._material._color._value=Re.GREEN):o||this.selectAxis&&(this.selectAxis=void 0,this.arrowx._polyline._material._color._value=Re.RED,this.arrowy._polyline._material._color._value=Re.GREEN,this.arrowz._polyline._material._color._value=Re.BLUE)};r0.prototype.setRotate=function(o,f){let m=this.hpRoll.heading,v=this.hpRoll.pitch,y=this.hpRoll.roll;if(o==="heading"?m=f:o==="pitch"?v=f:o==="roll"&&(y=f),this.modeltype==="b3dm"){let x=new dl(xe.toRadians(m),xe.toRadians(-y),xe.toRadians(v));this.model._primitive._root.transform=tn.headingPitchRollToFixedFrame(Ee.getTranslation(this.model._primitive._root.transform,new H),x)}else if(this.modeltype==="I3S"){let x=new dl(xe.toRadians(m),xe.toRadians(v),xe.toRadians(y));this.model._layers[0]._tileset._root.transform=tn.headingPitchRollToFixedFrame(Ee.getTranslation(this.model._layers[0]._tileset._root.transform,new H),x)}else if(this.modeltype==="s3m"){let x=new dl(xe.toRadians(m),xe.toRadians(v),xe.toRadians(y));this.model.modelMatrix=tn.headingPitchRollToFixedFrame(Ee.getTranslation(this.model.modelMatrix,new H),x)}else if(this.modeltype==="old3Dtiles")this.model.setEditData({heading:m,pitch:-y,roll:v});else if(this.modeltype==="entity")this.entityCallback?this.entityCallback({heading:m,pitch:-y,roll:v}):this.model.orientation=tn.headingPitchRollQuaternion(this.model.position._value,new dl(xe.toRadians(m),xe.toRadians(-y),xe.toRadians(v)));else{let x=tn.localFrameToFixedFrameGenerator("north","west"),C=new dl(xe.toRadians(m),xe.toRadians(v),xe.toRadians(y));this.model._primitive.modelMatrix=tn.headingPitchRollToFixedFrame(Ee.getTranslation(this.model._primitive.modelMatrix,new H),C,ki.WGS84,x)}};r0.prototype.setRotateLine=function(o,f,m,v){o==="z"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumClock=new xn(function(){return xe.toRadians(v)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:f,orientation:tn.headingPitchRollQuaternion(f,new dl(xe.toRadians(360-m),0,0)),ellipsoid:{radii:new H(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new H(.1,.1,.1),minimumClock:xe.toRadians(0),maximumClock:xe.toRadians(0),minimumCone:xe.toRadians(90),maximumCone:xe.toRadians(90),material:Re.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumClock=new xn(function(){return xe.toRadians(v)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:f,orientation:tn.headingPitchRollQuaternion(f,new dl(xe.toRadians(360-m),0,0)),ellipsoid:{radii:new H(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new H(.1,.1,.1),minimumClock:xe.toRadians(0),maximumClock:xe.toRadians(0),minimumCone:xe.toRadians(90),maximumCone:xe.toRadians(90),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:Re.YELLOW}})):o==="x"?(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new xn(function(){return xe.toRadians(v+m)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:f,orientation:tn.headingPitchRollQuaternion(f,new dl(0,0,0)),ellipsoid:{radii:new H(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new H(.1,.1,.1),minimumClock:xe.toRadians(90.1),maximumClock:xe.toRadians(90),minimumCone:xe.toRadians(m),maximumCone:xe.toRadians(0),material:Re.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new xn(function(){return xe.toRadians(v+m)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:f,orientation:tn.headingPitchRollQuaternion(f,new dl(0,0,0)),ellipsoid:{radii:new H(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new H(.1,.1,.1),minimumClock:xe.toRadians(90.1),maximumClock:xe.toRadians(90),minimumCone:xe.toRadians(m),maximumCone:xe.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:Re.YELLOW}})):o==="y"&&(this.rotateSector1?this.rotateSector1.ellipsoid.maximumCone=new xn(function(){return xe.toRadians(v+m)},!1):this.rotateSector1=this._earthCtrl.entities.add({name:"rotateSector1",position:f,orientation:tn.headingPitchRollQuaternion(f,new dl(0,0,0)),ellipsoid:{radii:new H(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new H(.1,.1,.1),minimumClock:xe.toRadians(.1),maximumClock:xe.toRadians(0),minimumCone:xe.toRadians(m),maximumCone:xe.toRadians(0),material:Re.ALICEBLUE.withAlpha(.3)}}),this.rotateSector2?this.rotateSector2.ellipsoid.maximumCone=new xn(function(){return xe.toRadians(v+m)},!1):this.rotateSector2=this._earthCtrl.entities.add({name:"rotateSector2",position:f,orientation:tn.headingPitchRollQuaternion(f,new dl(0,0,0)),ellipsoid:{radii:new H(this.radius-.11,this.radius-.11,this.radius-.11),innerRadii:new H(.1,.1,.1),minimumClock:xe.toRadians(.1),maximumClock:xe.toRadians(0),minimumCone:xe.toRadians(m),maximumCone:xe.toRadians(0),fill:!1,outline:!0,slicePartitions:2,outlineWidth:5,outlineColor:Re.YELLOW}}))};r0.prototype.end=function(){this.AxisX&&this._scene.primitives.remove(this.AxisX),this.AxisX=void 0,this.AxisY&&this._scene.primitives.remove(this.AxisY),this.AxisY=void 0,this.AxisZ&&this._scene.primitives.remove(this.AxisZ),this.AxisZ=void 0,this.arrowx&&this._earthCtrl.entities.remove(this.arrowx),this.arrowx=void 0,this.arrowy&&this._earthCtrl.entities.remove(this.arrowy),this.arrowy=void 0,this.arrowz&&this._earthCtrl.entities.remove(this.arrowz),this.arrowz=void 0,this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0};r0.prototype.toDegrees=function(o){let f=Mt.fromCartesian(o);return{lon:xe.toDegrees(f.longitude),lat:xe.toDegrees(f.latitude),hei:f.height}};r0.prototype.arge=function(o,f,m,v="180",y=!1){let x=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),C=Math.sqrt(Math.pow(o.x-m.x,2)+Math.pow(o.y-m.y,2)),w=Math.sqrt(Math.pow(f.x-m.x,2)+Math.pow(f.y-m.y,2)),A=(Math.pow(x,2)+Math.pow(C,2)-Math.pow(w,2))/(2*x*C),E=Math.acos(A)*180/Math.PI;if(v==="360"||v==="+-"){let T=y?-1:1;this.isClockwise([[f.x,T*f.y],[o.x,T*o.y],[m.x,T*m.y],[f.x,T*f.y]])||(v==="+-"?E=-E:E=360-E)}return Number(E.toFixed(2))};r0.prototype.isClockwise=function(o){let f=ra.lineString(o);return ra.booleanClockwise(f)};r0.prototype.matrixGetRotation=function(o){let f=tn.eastNorthUpToFixedFrame(Ee.getTranslation(o,new H),ki.WGS84,new Ee),m=Ee.multiply(Ee.inverse(f,new Ee),o,new Ee),v=Ee.getRotation(m,new Ut),y=Gr.fromRotationMatrix(v),x=dl.fromQuaternion(y),C=xe.toDegrees(x.heading),w=xe.toDegrees(x.pitch),A=xe.toDegrees(x.roll);return{heading:C,pitch:w,roll:A}};r0.prototype.calPixelDistance=function(){let o=new Im,f=this._scene,m=f.canvas.clientWidth,v=f.canvas.clientHeight,y=f.camera.getPickRay(new Ye(m/2|0,v-1)),x=f.camera.getPickRay(new Ye(1+m/2|0,v-1)),C=f.globe,w=C.pick(y,f),A=C.pick(x,f);if(!N(w)||!N(A))return;let E=C.ellipsoid.cartesianToCartographic(w),T=C.ellipsoid.cartesianToCartographic(A);return o.setEndPoints(E,T),o.surfaceDistance};r0.prototype.calTwoLineDistance=function(o,f,m){let v=m.x-f.x,y=m.y-f.y,x=Math.atan2(y,v),C=Math.sqrt(v**2+y**2),w=Math.cos(x+o)*C,A=Math.sin(x+o)*C;return w+A};var omt=r0;function Hd(o){this._earthCtrl=o,this._coreMap=o.coreMap}Hd.prototype.editPoint=function(o,f){this._earthCtrl.tools.clearTool();let m=new Xpt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("point_edit_tool",m),m};Hd.prototype.updatePoint=function(o,f){o.updatePoint(f)};Hd.prototype.editPolyline=function(o,f){this._earthCtrl.tools.clearTool();let m=new imt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",m),m};Hd.prototype.updatePolyline=function(o,f){o.updatePolyline(f)};Hd.prototype.editPolygon=function(o,f){this._earthCtrl.tools.clearTool();let m=new $pt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",m),m};Hd.prototype.updatePolygon=function(o,f){o.updatePolygon(f)};Hd.prototype.editBox=function(o,f){this._earthCtrl.tools.clearTool();let m=new Jpt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("box_edit_tool",m),m};Hd.prototype.updateBox=function(o,f){o.updateBox(f)};Hd.prototype.editEllipsoid=function(o,f){this._earthCtrl.tools.clearTool();let m=new Zpt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",m),m};Hd.prototype.updateEllipsoid=function(o,f){o.updateEllipsoid(f)};Hd.prototype.editCylinder=function(o,f){this._earthCtrl.tools.clearTool();let m=new Kpt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",m),m};Hd.prototype.updateCylinder=function(o,f){o.updateCylinder(f)};Hd.prototype.editModel=function(o,f){this._earthCtrl.tools.clearTool();let m=new emt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("model_edit_tool",m),m};Hd.prototype.updateModel=function(o,f){o.updateModel(f)};Hd.prototype.createTransformEdit=function(o){return new omt(this._earthCtrl,{model:o})};Hd.prototype.editBillboard=function(o,f){this._earthCtrl.tools.clearTool();let m=new qpt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",m),m};Hd.prototype.updateBillboard=function(o,f){o.updateBillboard(f)};Hd.prototype.editLabel=function(o,f){this._earthCtrl.tools.clearTool();let m=new tmt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("label_edit_tool",m),m};Hd.prototype.updateLabel=function(o,f){o.updateLabel(f)};Hd.prototype.editRectangle=function(o,f){this._earthCtrl.tools.clearTool();let m=new nmt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",m),m};Hd.prototype.updateRectangle=function(o,f){o.updateRectangle(f)};Hd.prototype.editEllipse=function(o,f){this._earthCtrl.tools.clearTool();let m=new Qpt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",m),m};Hd.prototype.updateEllipse=function(o,f){o.updateEllipse(f)};Hd.prototype.editPolylineVolume=function(o,f){this._earthCtrl.tools.clearTool();let m=new rmt(this._earthCtrl,o,function(v){f&&f(v)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",m),m};Hd.prototype.updatePolylineVolume=function(o,f){o.updatePolylineVolume(f)};Hd.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var y3e=Hd;var Dgr=qK(amt(),1);var lmt=qK(smt(),1);function ly(o,f){this._earthCtrl=o,this._coreMap=o.coreMap,this._show=Z(f.show,!0),this._isMouseCreate=Z(f.isMouseCreate,!0),this._horizontalViewAngle=Z(f.horizontalViewAngle,90),this._verticalViewAngle=Z(f.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=Z(f.visibleAreaColor,Re.GREEN.withAlpha(.4)),this._invisibleAreaColor=Z(f.invisibleAreaColor,Re.RED.withAlpha(.4)),this._size=Z(f.size,2048),this._softShadows=Z(f.softShadows,!0),this._colorStyle=Z(f.colorStyle,Re.YELLOW),this._parameter=f,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this._pitch=Z(f.pitch,0),this._heading=Z(f.heading,0),this._distance=Z(f.distance,300),this._isMouseCreate||(this._lon=Z(f.lon,121),this._lat=Z(f.lat,31),this._height=Z(f.height,10),this._position=H.fromDegrees(f.lon,f.lat,f.height),this.updateViewShed())}Object.defineProperties(ly.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});ly.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};ly.prototype.removeFromMap=function(){let o=this;N(o.viewShedMap)&&(o.viewShedMap.enabled=!1),N(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let f=0;f<o._lineArray.length;f++){let m=o._lineArray[f];o._earthCtrl.entities.remove(m)}this._lineArray=[]};ly.prototype.visualConeShow=function(o){let f=this;N(f.pyramid)&&(f.pyramid.show=o);for(let m=0;m<f._lineArray.length;m++){let v=f._lineArray[m];v.show=o}};ly.prototype.addVisualPyramid=function(){let o=this;if(this.pyramid)return;let f=new TU({radii:new xn(function(){return new H(o._distance,o._distance,o._distance)},!1),minimumClock:new xn(function(){return xe.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new xn(function(){return xe.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new xn(function(){return xe.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new xn(function(){return xe.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new xn(function(){return o._colorStyle},!1)}),m=new Wh({position:new xn(function(){return o._position},!1),ellipsoid:f});this.pyramid=o._earthCtrl.entities.add(m)};ly.prototype.createLightCamera=function(){if(N(this.viewShedMap)){this._lightCamera=this.viewShedMap._lightCamera;return}this._lightCamera=new Vl(this._coreMap.scene),this._lightCamera.position=this._position};ly.prototype.updateParameters=function(o){if(!!N(o)&&(o.lon&&o.lat&&o.height&&this._lightCamera&&(this._position=H.fromDegrees(o.lon,o.lat,o.height),this._lightCamera.setView({destination:this._position,orientation:{heading:xe.toRadians(this._heading),pitch:0,roll:0}})),o.heading&&this._lightCamera&&(this._heading=o.heading,this._lightCamera.setView({destination:this._position,orientation:{heading:xe.toRadians(this._heading),pitch:0,roll:0}})),o.distance&&this.viewShedMap&&(this._distance=o.distance,this.viewShedMap._pointLightRadius=o.distance,this._lightCamera.frustum.far=o.distance),(o.verticalViewAngle||o.horizontalViewAngle)&&(this._verticalViewAngle=this.adjustViewRange(o.verticalViewAngle||this._verticalViewAngle),this._horizontalViewAngle=this.adjustViewRange(o.horizontalViewAngle||this._horizontalViewAngle),this._lightCamera))){let f=xe.toRadians(this._horizontalViewAngle),m=xe.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(f/2)/Math.tan(m/2),f>m?this._lightCamera.frustum.fov=f:this._lightCamera.frustum.fov=m}};ly.prototype.createShadowMap=function(){if(N(this.viewShedMap)){this.viewShedMap.enabled=!0;return}let o=this._lightCamera;this.viewShedMap=new s6({context:this._coreMap.scene.context,lightCamera:o,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,maximumDistance:500,darkness:.2,size:this._size,softShadows:!0,normalOffset:!0,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var sy=new H;ly.prototype.drawViewCentrum=function(){let o=this;function f(){let E=o.pyramid._ellipsoid._minimumClock.getValue(),T=o.pyramid._ellipsoid._minimumCone.getValue(),S=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,I=Math.cos,P=M(T),D=I(T),L=M(E),R=I(E);sy.x=S.x*P*R,sy.y=S.y*P*L,sy.z=S.z*D;let O=new fT.changeCartesian3ByScalar(o._position,sy);return[o._position,O]}let m=this._earthCtrl.entities.add({polyline:{positions:new xn(f,!1),material:this._colorStyle}});this._lineArray.push(m);function v(){let E=o.pyramid._ellipsoid._maximumClock.getValue(),T=o.pyramid._ellipsoid._minimumCone.getValue(),S=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,I=Math.cos,P=M(T),D=I(T),L=M(E),R=I(E);sy.x=S.x*P*R,sy.y=S.y*P*L,sy.z=S.z*D;let O=new fT.changeCartesian3ByScalar(o._position,sy);return[o._position,O]}let y=this._earthCtrl.entities.add({polyline:{positions:new xn(v,!1),material:this._colorStyle}});this._lineArray.push(y);function x(){let E=o.pyramid._ellipsoid._minimumClock.getValue(),T=o.pyramid._ellipsoid._maximumCone.getValue(),S=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,I=Math.cos,P=M(T),D=I(T),L=M(E),R=I(E);sy.x=S.x*P*R,sy.y=S.y*P*L,sy.z=S.z*D;let O=new fT.changeCartesian3ByScalar(o._position,sy);return[o._position,O]}let C=this._earthCtrl.entities.add({polyline:{positions:new xn(x,!1),material:this._colorStyle}});this._lineArray.push(C);function w(){let E=o.pyramid._ellipsoid._maximumClock.getValue(),T=o.pyramid._ellipsoid._maximumCone.getValue(),S=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,I=Math.cos,P=M(T),D=I(T),L=M(E),R=I(E);sy.x=S.x*P*R,sy.y=S.y*P*L,sy.z=S.z*D;let O=fT.changeCartesian3ByScalar(o._position,sy);return[o._position,O]}let A=this._earthCtrl.entities.add({polyline:{positions:new xn(w,!1),material:this._colorStyle}});this._lineArray.push(A)};ly.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};ly.prototype.mouseCreate=function(){let o=this;return new lmt.Promise((f,m)=>{let v=new Ur(o._coreMap.scene.canvas),y=!1;v.setInputAction(function(x){let C,w=o._coreMap.scene.pickPosition(x.position);if(w)C=w;else return;if(y){y=!1,v.destroy(),v=void 0;let E={position:o.toDegrees(o._position),heading:o._heading,distance:o._distance};f(E)}else{let A=o.toDegrees(C),E=H.fromDegrees(A.lon,A.lat,A.hei+1.8);o._position=E,y=!0}},Ei.LEFT_CLICK),v.setInputAction(function(x){if(!y)return;let C,w=o._coreMap.scene.pickPosition(x.endPosition);if(w&&(C=w),!(!C&&!o._position))if(!o.pyramid)o.updateViewShed();else{let A=o._lightCamera,E=o.toDegrees(o._position),T=o.toDegrees(C),S=H.fromDegrees(E.lon,E.lat+1e-4,E.hei),M=H.fromDegrees(T.lon,T.lat,E.hei);o._heading=o.arge(o._position,S,M,"360",!0),o._distance=H.distance(o._position,C),o.viewShedMap._pointLightRadius=o._distance,A.setView({destination:o._position,orientation:{heading:xe.toRadians(o._heading),pitch:xe.toRadians(o._pitch),roll:0}}),A.frustum.far=o._distance||1e4;let I=xe.toRadians(o._horizontalViewAngle),P=xe.toRadians(o._verticalViewAngle);A.frustum.aspectRatio=Math.tan(I/2)/Math.tan(P/2),I>P?A.frustum.fov=I:A.frustum.fov=P}},Ei.MOUSE_MOVE)})};ly.prototype.setCameraParams=function(){let o=this._lightCamera;o.frustum.near=.1,o.frustum.far=this._distance;let f=xe.toRadians(this._horizontalViewAngle),m=xe.toRadians(this._verticalViewAngle);o.frustum.aspectRatio=Math.tan(f/2)/Math.tan(m/2),f>m?o.frustum.fov=f:o.frustum.fov=m,o.setView({destination:this._position,orientation:{heading:xe.toRadians(this._heading),pitch:xe.toRadians(this._pitch),roll:0}})};ly.prototype.toDegrees=function(o){let f=Mt.fromCartesian(o);return{lon:xe.toDegrees(f.longitude),lat:xe.toDegrees(f.latitude),hei:f.height}};ly.prototype.arge=function(o,f,m,v="180",y=!1){let x=Math.sqrt(Math.pow(o.x-f.x,2)+Math.pow(o.y-f.y,2)),C=Math.sqrt(Math.pow(o.x-m.x,2)+Math.pow(o.y-m.y,2)),w=Math.sqrt(Math.pow(f.x-m.x,2)+Math.pow(f.y-m.y,2)),A=(Math.pow(x,2)+Math.pow(C,2)-Math.pow(w,2))/(2*x*C),E=Math.acos(A)*180/Math.PI;if(v==="360"||v==="+-"){let T=y?-1:1;this.isClockwise([[f.x,T*f.y],[o.x,T*o.y],[m.x,T*m.y],[f.x,T*f.y]])||(v==="+-"?E=-E:E=360-E)}return Number(E.toFixed(2))};ly.prototype.isClockwise=function(o){let f=ra.lineString(o);return ra.booleanClockwise(f)};var x3e=ly;function zC(o,f={type:"default"}){return this.earthCtrl=o,this.scene=o.coreMap.scene,this.camera=o.coreMap.camera,this.updateIntersection=Z(f.updateIntersection,!1),this.startPoint=void 0,this.timeOutId=void 0,this.endPoints=[],f.type==="circle"?this.createLineOfSightfromCircle(f):this.createLineOfSight(f),this}function $Ui(o,f){function m(v){if(N(v.startPoint)&&v.endPoints.length>0){let y=v.earthCtrl.entities,x=[];y.values.forEach(C=>{C._name==="viewThroughLine"&&x.push(C)}),x.forEach(C=>{y.remove(C)});for(let C=0;C<v.endPoints.length;C++){let w=v.endPoints[C],A=v.judgeLineView(v.startPoint,w);v.judgeLineAdd(v.startPoint,w,A)}}}return function(...v){o.timeOutId&&(clearTimeout(o.timeOutId),o.timeOutId=null),o.timeOutId=setTimeout(()=>{m(o),clearTimeout(o.timeOutId),o.timeOutId=null},f)}}zC.prototype.startCameraListener=function(){if(this.updateIntersection){let o=$Ui(this,1e3);this.removeCameraListener=this.scene.camera.changed.addEventListener(o)}};zC.prototype.stopCameraListener=function(){N(this.removeCameraListener)&&(this.removeCameraListener(),this.removeCameraListener=void 0)};zC.prototype.createLineOfSight=function(o={}){let f=this,m=new Ur(this.scene.canvas),v,y,x=null,C=new R_(this.earthCtrl),w=C.CreateTooltip(),A=!1,E;m.setInputAction(function(T){let S=f.getMousePosition(T,x);if(!!S){if(w.show(!0),!v)E=[],A=!0,v=f.toDegrees(S),v=H.fromDegrees(v.lon,v.lat,v.hei+(o.height||1.8)),E.push(f.createPoint(v)),E.push(f.createLabel(v,`${f.earthCtrl.language.TOOLS_VIEW_THROUGH_WATCH_POINT}`)),N(f.startPoint)||(f.startPoint=H.clone(v));else if(y){A=!1,f.createLabel(y,`${f.earthCtrl.language.TOOLS_VIEW_THROUGH_TARGET_POINT}`);let M=f.judgeLineView(v,y);f.judgeLineAdd(v,y,M),f.createPoint(y,M,y),f.endPoints.push(y)}}},Ei.LEFT_CLICK),m.setInputAction(function(T){if(v){w.showAt(T.endPosition,`${f.earthCtrl.language.TOOLS_VIEW_THROUGH_CLICK_TO_START_RIGHT_END}`);let S=f.getMousePosition(T,x);S&&(y=S,x||(x=f.earthCtrl.entities.add({name:"viewThrough",polyline:{positions:new xn(function(){return[v,y]},!1),material:Re.YELLOW,followSurface:!1,width:3}})))}else w.showAt(T.endPosition,`${f.earthCtrl.language.TOOLS_LEFT_CLICK_TO_START_DRAW}`)},Ei.MOUSE_MOVE),m.setInputAction(function(T){A&&E.forEach(S=>{f.earthCtrl.entities.remove(S)}),x&&(f.earthCtrl.entities.remove(x),x=void 0),w.show(!1),f.startCameraListener(),w=void 0,C=void 0,v=void 0,y=void 0,f=void 0,m.destroy(),m=void 0},Ei.RIGHT_CLICK)};zC.prototype.createLineOfSightfromCircle=function(o={}){let f=this,m=new Ur(this.scene.canvas),v,y,x,C=0,w=new R_(this.earthCtrl),A=w.CreateTooltip(),E=[];m.setInputAction(function(T){let S=f.getMousePosition(T,x);if(!!S){if(A.show(!0),!v)v=f.toDegrees(S),v=H.fromDegrees(v.lon,v.lat,v.hei+(o.height||1.8)),E.push(f.createPoint(v)),E.push(f.createLabel(v,`${f.earthCtrl.language.TOOLS_VIEW_THROUGH_WATCH_POINT}`)),N(f.startPoint)||(f.startPoint=H.clone(v));else if(y){let M=f.toDegrees(v),I=ra.circle([M.lon,M.lat],C,{steps:o.steps||64,units:"meters"});I.geometry.coordinates[0].forEach(P=>{let D=f.scene.globe.getHeight(Mt.fromDegrees(P[0],P[1])),L=H.fromDegrees(P[0],P[1],D),R=f.scene.clampToHeight(L),O=f.judgeLineView(v,R||L);f.judgeLineAdd(v,R||L,O),f.endPoints.push(R||L)}),I=void 0,f.end()}}},Ei.LEFT_CLICK),m.setInputAction(function(T){if(v){A.showAt(T.endPosition,`${f.earthCtrl.language.TOOLS_CLICK_STOP_DRAW_RIGHT_CANCEL}`);let S=f.getMousePosition(T,x);S&&(y=S,C=H.distance(v,y),x||(x=f.earthCtrl.entities.add({id:0x970396774b8f5,name:"viewThrough",position:v,ellipse:{semiMajorAxis:new xn(function(){return C},!1),semiMinorAxis:new xn(function(){return C},!1),material:Re.fromCssColorString("rgba(0,255,0,0.6)"),heightReference:1,outline:!0,outlineWidth:1,outlineColor:Re.WHITE.withAlpha(.6)}})))}else A.showAt(T.endPosition,`${f.earthCtrl.language.TOOLS_LEFT_CLICK_TO_START_DRAW}`)},Ei.MOUSE_MOVE),m.setInputAction(function(T){f.end("deletePoint"),f.startCameraListener()},Ei.RIGHT_CLICK),this.end=T=>{this.end=void 0,m.destroy(),m=void 0,A.show(!1),A=void 0,w=void 0,x&&(f.earthCtrl.entities.remove(x),x=void 0),T==="deletePoint"&&E.forEach(S=>{this.earthCtrl.entities.remove(S)}),v=void 0,y=void 0,f=void 0}};zC.prototype.judgeLineView=function(o,f){if(o.equals(f))return;let m=H.normalize(H.subtract(f,o,new H),new H),v=new _s(o,m),y=this.scene.drillPickFromRay(v);function x(w,A,E){let T=H.distance(A,w),S=H.distance(w,E);return T>S?E:A}let C;if(y.forEach(w=>{w.object?w.object.id&&w.object.id._name?w.object.id._name.indexOf("viewThrough")===-1&&(C||(C=w.position)):C||(C=w.position):w.position&&(C?C=x(o,C,w.position):C=w.position)}),C||(C=this.scene.globe.pick(v,this.scene)),y=void 0,m=void 0,v=void 0,!!C)return this.judgeOverLine(o,f,C)};zC.prototype.judgeOverLine=function(o,f,m){let v=H.distance(o,f),y=H.distance(o,m);if(v>y)return m};zC.prototype.judgeLineAdd=function(o,f,m){!o||!f||(m?(this.addJudgeLine([f,m],!0),this.addJudgeLine([o,m],!1)):this.addJudgeLine([o,f],!1))};zC.prototype.addJudgeLine=function(o,f){f?this.earthCtrl.entities.add({name:"viewThroughLine",polyline:{positions:o,material:Re.RED,followSurface:!1,width:3,depthFailMaterial:Re.fromCssColorString("#ff00c6")}}):this.earthCtrl.entities.add({name:"viewThroughLine",polyline:{positions:o,material:Re.GREEN,followSurface:!1,width:3}})};zC.prototype.createPoint=function(o,f,m){let v=null;return f?H.distance(m,f)<2?v=this.earthCtrl.entities.add({name:"viewThroughPoint",position:o,point:{pixelSize:10,color:Re.BLUE,outlineWidth:2,outlineColor:new Re(1,1,1,.7),disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new ia(0,1e7)}}):v=this.earthCtrl.entities.add({name:"viewThroughPoint",position:o,point:{pixelSize:10,color:Re.RED,outlineWidth:2,outlineColor:new Re(1,1,1,.7),disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new ia(0,1e7)}}):v=this.earthCtrl.entities.add({name:"viewThroughPoint",position:o,point:{pixelSize:10,color:Re.BLUE,outlineWidth:2,outlineColor:new Re(1,1,1,.7),disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new ia(0,1e7)}}),v};zC.prototype.createLabel=function(o,f){return this.earthCtrl.entities.add({name:"viewThroughLabel",position:o,label:{text:f,font:"18px \u5B8B\u4F53",fillColor:Re.WHITE,horizontalOrigin:Zc.CENTER,verticalOrigin:Zc.CENTER,pixelOffset:new Ye(0,-18),disableDepthTestDistance:Number.POSITIVE_INFINITY,distanceDisplayCondition:new ia(0,1e5)}})};zC.prototype.deleteAll=function(){let o=this.earthCtrl.entities,f=[];o.values.forEach(m=>{(m._name==="viewThroughLine"||m._name==="viewThroughPoint"||m._name==="viewThroughLabel")&&f.push(m._id)}),f.forEach(m=>{o.removeById(m)}),this.startPoint=void 0,this.endPoints=[],this.stopCameraListener(),this.timeOutId&&(clearTimeout(this.timeOutId),this.timeOutId=null)};zC.prototype.toDegrees=function(o){let f=Mt.fromCartesian(o);return{lon:xe.toDegrees(f.longitude),lat:xe.toDegrees(f.latitude),hei:f.height}};zC.prototype.getMousePosition=function(o,f){let m=o.endPosition||o.position||o;this.defaultDepthTest===void 0&&(this.defaultDepthTest=!!this.scene.globe.depthTestAgainstTerrain);let v=this.camera.getPickRay(m);f&&!Array.isArray(f)&&(f=[f]);let y=this.scene.pickPosition(m);y?y={position:y}:(this.scene.globe.depthTestAgainstTerrain=!0,y=this.scene.pickFromRay(v,f));let x;if(!y||!y.position||!this.scene.globe.depthTestAgainstTerrain?x=this.scene.globe.pick(v,this.scene):x=y.position,this.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,!x){console.log("\u672A\u62FE\u53D6\u5230\u5750\u6807\uFF01");return}return x};var C3e=zC;var b3e=ki.WGS84;function lp(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=e6i(this.coreMap.container)}function w3e(o,f){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);f=f||new o.constructor;for(let m in o)f[m]=typeof f[m]>"u"?w3e(o[m],null):f[m];return f}function umt(o,f){let m=w3e(o),v;for(v in f)m[v]===void 0&&(m[v]=w3e(f[v]));return m}function e6i(o){let f=function(m){let v=document.createElement("DIV");v.className="twipsy right";let y=document.createElement("DIV");y.className="twipsy-arrow",v.appendChild(y);let x=document.createElement("DIV");x.className="twipsy-inner",v.appendChild(x),this._div=v,this._title=x,m.appendChild(v)};return f.prototype.setVisible=function(m){this._div.style.display=m?"block":"none"},f.prototype.showAt=function(m,v){m&&v&&(this.setVisible(!0),this._title.innerHTML=v,this._div.style.left=`${m.x+30}px`,this._div.style.top=`${m.y-this._div.clientHeight/2-15}px`)},new f(o)}lp.prototype.addToolbar=function(o,f){return f=umt(f,{container:o}),new lp.Toolbar(this,f)};var cmt={shiftX:0,shiftY:0};lp.prototype.createBillboardGroup=function(o,f,m){let v=new lp.BillboardGroup(this,f);return v.addBillboards(o,m),v};lp.BillboardGroup=function(o,f){this._drawHelper=o,this._scene=o._scene,this._options=umt(f,cmt);let m=new XE;this._scene.primitives.add(m),this._billboards=m,this._orderedBillboards=[]};lp.BillboardGroup.prototype.createBillboard=function(o,f){let m=this._billboards.add({show:!0,position:o,pixelOffset:new Ye(this._options.shiftX,this._options.shiftY),eyeOffset:new H(0,0,-1e3),horizontalOrigin:Zc.CENTER,verticalOrigin:so.CENTER,scale:.3,image:Z(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new Re(1,1,1,1)});if(f){let x=function(w){y.enableRotate=w},C=function(){let w=0;for(let A=v._orderedBillboards.length;w<A&&v._orderedBillboards[w]!==m;++w);return w},v=this,y=this._scene.screenSpaceCameraController;if(f.dragHandlers){let w=this,A=new Ur(w._scene.canvas);setListener(m,"leftDown",function(E){function T(M){m.position=M;for(let I=0,P=w._orderedBillboards.length;I<P&&w._orderedBillboards[I]!==m;++I);f.dragHandlers.onDrag&&f.dragHandlers.onDrag(C(),M)}function S(M){A.destroy(),x(!0),f.dragHandlers.onDragEnd&&f.dragHandlers.onDragEnd(C(),M)}A.setInputAction(function(M){let I=w._scene.camera.pickEllipsoid(M.endPosition,b3e);I?T(I):S(I)},Ei.MOUSE_MOVE),A.setInputAction(function(M){S(w._scene.camera.pickEllipsoid(M.position,b3e))},Ei.LEFT_UP),x(!1),f.dragHandlers.onDragStart&&f.dragHandlers.onDragStart(C(),w._scene.camera.pickEllipsoid(E,b3e))})}f.onDoubleClick&&setListener(m,"leftDoubleClick",function(w){f.onDoubleClick(C())}),f.onClick&&setListener(m,"leftClick",function(w){f.onClick(C())}),f.tooltip&&(setListener(m,"mouseMove",function(w){v._drawHelper._tooltip.showAt(w,f.tooltip())}),setListener(m,"mouseOut",function(w){v._drawHelper._tooltip.setVisible(!1)}))}return m};lp.BillboardGroup.prototype.insertBillboard=function(o,f,m){this._orderedBillboards.splice(o,0,this.createBillboard(f,m))};lp.BillboardGroup.prototype.addBillboard=function(o,f){this._orderedBillboards.push(this.createBillboard(o,f))};lp.BillboardGroup.prototype.addBillboards=function(o,f){let m=0;for(;m<o.length;m++)this.addBillboard(o[m],f)};lp.BillboardGroup.prototype.updateBillboardsPositions=function(o){let f=0;for(;f<o.length;f++)this.getBillboard(f).position=o[f]};lp.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};lp.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};lp.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};lp.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};lp.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};lp.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};lp.prototype.startDrawing=function(o){let f=this,m=this._scene;m.globe.depthTestAgainstTerrain=!0;let v=this._tooltip,y=3,x=[],C=[],w;this._positions=C;let A=new Ur(m.canvas);this._mouseHandler=A;let E=new lp.BillboardGroup(this,cmt);this._markers=E,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),A.setInputAction(function(S){if(S.position!==null){let M=m.camera.getPickRay(S.position),I=m.globe.pick(M,m),P=Mt.fromCartesian(I),D=xe.toDegrees(P.longitude),L=xe.toDegrees(P.latitude);if(I){if(x.length===0&&(x.push(D,L),C.push(I),w=I,E.addBillboard(w)),C.length>=4){let R=nl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,w);if(R!==void 0){let O=R.x-S.position.x,F=R.y-S.position.y;if(O*O+F*F<16){x.splice(x.length-2,2),C.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}x.push(D,L),C.push(I),E.addBillboard(I),C.length===y&&(f._prevEntity=f._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:H.fromDegreesArray(x),material:Re.RED.withAlpha(.6),fill:!0}}),f._prevEntity.polygon.hierarchy=T())}}}.bind(this),Ei.LEFT_CLICK),A.setInputAction(function(S){let M=S.endPosition;if(M!==null)if(C.length===0)v.showAt(M,`${f._cesiumViewer.language.TOOLS_VOLUMETRIC_CLICK_TO_DRAW}`);else{let I=m.camera.getPickRay(M),P=m.globe.pick(I,m),D=Mt.fromCartesian(P),L=xe.toDegrees(D.longitude),R=xe.toDegrees(D.latitude);if(P&&(x.splice(x.length-2,2),C.pop(),x.push(L,R),C.push(P),E.getBillboard(C.length-1).position=P,v.showAt(M,`${f._cesiumViewer.language.TOOLS_VOLUMETRIC_DOUBLE_CLICK_TO_STOP_DRAW}`),C.length>=3&&C.length>=4)){let O=nl.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,w);if(O!==void 0){let F=O.x-M.x,k=O.y-M.y;F*F+k*k<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),Ei.MOUSE_MOVE),A.setInputAction(function(S){C.length<y+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),Ei.LEFT_DOUBLE_CLICK);function T(){return H.fromDegreesArray(x)}};lp.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let f=this.computeCutVolume(),m=f.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(f.volume);let v={polygon:{hierarchy:{positions:this._positions},extrudedHeight:m,closeTop:!1,closeBottom:!1,material:Re.RED.withAlpha(.5),outline:!0,outlineColor:Re.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(v),this.isLoading(!1)};lp.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(f),this.loading=o,this.coreMap.container.appendChild(o)};lp.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};lp.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function t6i(o){let f=[],m=[];for(let S=0;S<o.length;S++){let M=Mt.fromCartesian(o[S]);f.push(M.longitude),m.push(M.latitude)}let v=0,y=0,x=0,C=0,w=0,A=0,E=0,T=0;for(let S=0;S<o.length;S++)v=f[S],y=m[S],S===o.length-1?(x=f[0],C=m[0]):(x=f[S+1],C=m[S+1]),A=v*C-x*y,w+=A,E+=(v+x)*A,T+=(y+C)*A;return w*=.5,E/=6*w,T/=6*w,new Mt(E,T)}function i6i(o,f,m){let v=H.distance(o,f),y=H.distance(f,m),x=H.distance(m,o),C=(v+y+x)/2;return Math.sqrt(C*(C-v)*(C-y)*(C-x))}lp.prototype.computeCutVolume=function(){let o=15e3;for(let F=0;F<this._positions.length;F++){let k=Mt.fromCartesian(this._positions[F]),U=this._scene.globe.getHeight(k);o>U&&(o=U)}let f=Math.PI/Math.pow(2,11);f=f/64;let m=new Ec.fromPositions({positions:this._positions,vertexFormat:ms.FLAT_VERTEX_FORMAT,granularity:f}),v=new Ec.createGeometry(m),y=0,x=0,C,w,A,E,T,S,M,I,P,D,L,R;for(let F=0;F<v.indices.length;F+=3)C=v.indices[F],w=v.indices[F+1],A=v.indices[F+2],D=new H(v.attributes.position.values[C*3],v.attributes.position.values[C*3+1],v.attributes.position.values[C*3+2]),L=Mt.fromCartesian(D),E=this._scene.globe.getHeight(L),M=H.fromRadians(L.longitude,L.latitude,0),x<E&&(x=E),D=new H(v.attributes.position.values[w*3],v.attributes.position.values[w*3+1],v.attributes.position.values[w*3+2]),L=Mt.fromCartesian(D),T=this._scene.globe.getHeight(L),I=H.fromRadians(L.longitude,L.latitude,0),x<T&&(x=T),D=new H(v.attributes.position.values[A*3],v.attributes.position.values[A*3+1],v.attributes.position.values[A*3+2]),L=Mt.fromCartesian(D),S=this._scene.globe.getHeight(L),P=H.fromRadians(L.longitude,L.latitude,0),x<S&&(x=S),R=i6i(M,I,P),y=y+R*(E-o+T-o+S-o)/3;let O=t6i(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:H.fromRadians(O.longitude,O.latitude,x+1e3),label:{text:`${y.toFixed(4)}${this._cesiumViewer.language.UNIT_CUBIC_METER}`}}),{maxHeight:x,volume:y}};var A3e=lp;function nk(o){this._earthCtrl=o,this._viewer=o.coreMap,this._cesium=qi,this._core=new PC(o),this._points=[],this._lable=null,this._entity=null,this.id="0",this.curCanvas="a",this._lang={draw_tip_left:`${this._earthCtrl.language.TOOLS_LEFT_CLICK_TO_START_DRAW}`,draw_tip_right:`${this._earthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`,draw_tip_click:`${this._earthCtrl.language.TOOLS_CLICK_TO_CONTINUE_DRAW}`,draw_tip_cancel:`${this._earthCtrl.language.TOOLS_CLICK_STOP_DRAW_RIGHT_CANCEL}`,unit_m:`${this._earthCtrl.language.UNIT_METER}`,unit_km:`${this._earthCtrl.language.UNIT_KILOMETER}`},this.floodOptions={spood:10,clampToGround:!1,waterHeight:0,targetHeight:1e3,positions:[],parameter:{}}}nk.prototype.executePolygonymsd=function(o={},f){let m=this,v=function(){function L(R){this.options={name:`${m._earthCtrl.language.TOOLS_SUBMERGENCE_POLYGON_NAME}`,polygon:{hierarchy:[],material:Re.SKYBLUE.withAlpha(.5),heightReference:qn.NONE,extrudedHeight:0}},this.hierarchy=R,this._init()}return L.prototype._init=function(){let R=this,O=function(){return R.hierarchy};this.options.polygon.hierarchy=new xn(O,!1);let F=m._viewer.entities.add(this.options);m.item=F},L}();this.handler&&(this.handler.destroy(),this.handler=null),this.handler=new m._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);let y=this._core.createTooltip(),x={},C=[],w=null,A=null,E=null;this.floodOptions.callBackFun=f;for(let L in o)this.floodOptions[L]=o[L];this.floodOptions.parameter=o;let T=!1,S={mj:0,label:[],ployline:[]},M=[],I,P;y.showFun(!1);let D=`<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">${m._earthCtrl.language.TOOLS_SUBMERGENCE_INTERSECT_POLYGON_NOT_ALLOWED}</span>`;return this.handler.setInputAction(function(L){if(y.show||(y.show=!0),T){m.floodOptions.waterHeight===void 0?y.showAts({text:`${m._earthCtrl.language.TOOLS_SUBMERGENCE_PICK_WATER_START_HEIGHT}`,position:L.endPosition}):m.floodOptions.targetHeight===void 0&&y.showAts({text:`${m._earthCtrl.language.TOOLS_SUBMERGENCE_PICK_WATER_MAX_HEIGHT}`,position:L.endPosition});return}if(m.floodOptions.positions.length>=4?y.showAts({text:`${m._earthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`,position:L.endPosition}):y.showAts({text:`${m._earthCtrl.language.TOOLS_SUBMERGENCE_LEFT_CLICK_TO_DRAW_WATER_AREA}`,position:L.endPosition}),E=m.getMousePosition(L),!!E&&m.floodOptions.positions.length>=2){if(!m._cesium.defined(w))x=new m._cesium.PolygonHierarchy(m.floodOptions.positions),w=new v(x);else if(o.rectangle)P=m.toDegrees(E),m.floodOptions.positions=[H.fromDegrees(I.lon,I.lat),H.fromDegrees(I.lon,P.lat),H.fromDegrees(P.lon,P.lat),H.fromDegrees(P.lon,I.lat)],x=new m._cesium.PolygonHierarchy(m.floodOptions.positions),w.hierarchy=x;else{let R=m.floodOptions.positions[0],O=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(R),F=xe.toDegrees(O.latitude),k=xe.toDegrees(O.longitude),U=m.floodOptions.positions[m.floodOptions.positions.length-2],G=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(U),j=xe.toDegrees(G.latitude),q=xe.toDegrees(G.longitude),J=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(E),X=xe.toDegrees(J.latitude),Y=xe.toDegrees(J.longitude),Q=ra.lineString([[k,F],[Y,X]]),ee=ra.lineString([[q,j],[Y,X]]),z=!0;for(let ie=0;ie<M.length&&M.length>=2;ie++){let re=M[ie];if(ie===0){if(ra.lineIntersect(ee,re).features.length){z=!1,y.innerHTML=D;break}continue}if(ie===M.length-1){if(ra.lineIntersect(Q,re).features.length){z=!1,y.innerHTML=D;break}continue}if(ra.lineIntersect(Q,re).features.length){z=!1,y.innerHTML=D;return}if(ra.lineIntersect(ee,re).features.length){z=!1,y.innerHTML=D;break}}if(!z)return;m.floodOptions.positions.pop(),m.floodOptions.positions.push(E),x=new m._cesium.PolygonHierarchy(m.floodOptions.positions)}A||(A=m._viewer.entities.add({polyline:{positions:new xn(function(){return m.floodOptions.positions.concat([m.floodOptions.positions[0]])},!1),clampToGround:!0,width:3}}),m._points.push(A))}},m._cesium.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(L){let R,O,F,k,U,G,j,q,J,X=m.getMousePosition(L);if(!X)return;if(T){let re=m._cesium.Cartographic.fromCartesian(X);if(m.floodOptions.waterHeight===void 0)m.floodOptions.waterHeight=re.height;else if(m.floodOptions.targetHeight===void 0){if(m.floodOptions.targetHeight=re.height,m.floodOptions.targetHeight<m.floodOptions.waterHeight){window.layuiLayer&&window.layuiLayer.msg(`${m._earthCtrl.language.TOOLS_SUBMERGENCE_RE_PICK_MSG}`),m.floodOptions.targetHeight=void 0,m.floodOptions.waterHeight=void 0;return}m.end(),m.startFlood()}return}if(m.floodOptions.positions.length===0&&(m.floodOptions.positions.push(X.clone()),x=new m._cesium.PolygonHierarchy(m.floodOptions.positions)),m.floodOptions.positions.length>=2)if(M.length===0)J=m.floodOptions.positions[0],q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(J),j=xe.toDegrees(q.latitude),G=xe.toDegrees(q.longitude),U=m.floodOptions.positions[1],k=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(U),F=xe.toDegrees(k.latitude),O=xe.toDegrees(k.longitude),R=ra.lineString([[G,j],[O,F]]),M.push(R);else{if(M.length>=2){J=m.floodOptions.positions[0],q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(J),j=xe.toDegrees(q.latitude),G=xe.toDegrees(q.longitude),U=m.floodOptions.positions[m.floodOptions.positions.length-2],k=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(U),F=xe.toDegrees(k.latitude),O=xe.toDegrees(k.longitude);let re=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(X),ne=xe.toDegrees(re.latitude),oe=xe.toDegrees(re.longitude),se=ra.lineString([[G,j],[oe,ne]]),ae=ra.lineString([[O,F],[oe,ne]]),fe=!0;for(let de=0;de<M.length&&M.length>=2;de++){let ve=M[de];if(de===0){if(ra.lineIntersect(ae,ve).features.length){fe=!1,y.innerHTML=D;break}continue}if(de===M.length-1){if(ra.lineIntersect(se,ve).features.length){fe=!1,y.innerHTML=D;break}continue}if(ra.lineIntersect(se,ve).features.length){fe=!1,y.innerHTML=D;return}if(ra.lineIntersect(ae,ve).features.length){fe=!1,y.innerHTML=D;break}}if(!fe)return}J=m.floodOptions.positions[m.floodOptions.positions.length-2],q=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(J),j=xe.toDegrees(q.latitude),G=xe.toDegrees(q.longitude),k=m._viewer.scene.globe.ellipsoid.cartesianToCartographic(X),F=xe.toDegrees(k.latitude),O=xe.toDegrees(k.longitude),R=ra.lineString([[G,j],[O,F]]),M.push(R)}m.floodOptions.positions.push(X),x=new m._cesium.PolygonHierarchy(m.floodOptions.positions),o.rectangle&&(I?(P=m.toDegrees(X),m.floodOptions.positions=[H.fromDegrees(I.lon,I.lat),H.fromDegrees(I.lon,P.lat),H.fromDegrees(P.lon,P.lat),H.fromDegrees(P.lon,I.lat)],x=new m._cesium.PolygonHierarchy(m.floodOptions.positions),w.hierarchy=x,o.pointSelect?(m.floodOptions.waterHeight=void 0,m.floodOptions.targetHeight=void 0,T=!0):(m.end(),m.startFlood())):I=m.toDegrees(X));let Y=m._cesium.Cartographic.fromCartesian(m.floodOptions.positions[m.floodOptions.positions.length-1]),Q=m._cesium.Math.toDegrees(Y.longitude),ee=m._cesium.Math.toDegrees(Y.latitude),z=Y.height;C.push({lon:Q,lat:ee,hei:z});let ie=m._viewer.entities.add({name:`${m._earthCtrl.language.TOOLS_SUBMERGENCE_POLYGON_NAME}`,position:X,point:{pixelSize:5,color:m._cesium.Color.RED.withAlpha(.5),outlineColor:m._cesium.Color.WHITE.withAlpha(.5),outlineWidth:1,heightReference:m._cesium.HeightReference.CLAMP_TO_GROUND}});S.label.push(ie),m._points.push(ie)},m._cesium.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(L){T||m.floodOptions.positions.length<=3||(y.showFun(!1),m.floodOptions.positions.pop(),x=new m._cesium.PolygonHierarchy(m.floodOptions.positions),o.pointSelect?(m.floodOptions.waterHeight=void 0,m.floodOptions.targetHeight=void 0,T=!0):(m.end(),m.startFlood()))},m._cesium.ScreenSpaceEventType.RIGHT_CLICK),this.end=L=>{if(y.showFun(!1),m.handler.destroy(),m.end=void 0,L==="cancel"&&!this.waterTimer&&(m.item&&m._viewer.entities.remove(m.item),this._points.length>0)){for(let R=0;R<this._points.length;R++)this._viewer.entities.remove(this._points[R]);this._points=[]}},this};nk.prototype.startFlood=function(o={},f){let m=this;for(let L in o)this.floodOptions[L]=o[L];f&&(this.floodOptions.callBackFun=f),console.log(this.floodOptions);let{spood:v,clampToGround:y,waterHeight:x,targetHeight:C,positions:w,watherColor:A,url:E,frequency:T,watherSpeed:S,amplitude:M,callBackFun:I}=this.floodOptions,P=v/20,D=y?0:x+P;return this.waterTimer=setInterval(function(){if(x<C){if(x+=P,!m.item){let L=new m._cesium.PolygonHierarchy(m.floodOptions.positions);m.item=m._viewer.entities.add({name:`${m._earthCtrl.language.TOOLS_SUBMERGENCE_POLYGON_NAME}`,polygon:{hierarchy:new xn(function(){return L},!1),material:Re.SKYBLUE.withAlpha(.5),heightReference:qn.NONE,extrudedHeight:0}})}if(m.item._polygon.height=D,m.item._polygon.extrudedHeight.setValue(x),x>=C){clearInterval(m.waterTimer),m.waterTimer=void 0,x=C,m._viewer.entities.remove(m.item),m.polygon1=new m._cesium.PolygonGeometry({polygonHierarchy:new m._cesium.PolygonHierarchy(w),extrudedHeight:C,height:D,vertexFormat:m._cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT});let L=new m._cesium.Primitive({geometryInstances:new m._cesium.GeometryInstance({geometry:m.polygon1}),appearance:new MY({material:new zo({fabric:{type:"Water",uniforms:{baseWaterColor:A||Re.SKYBLUE.withAlpha(.6),blendColor:A||Re.SKYBLUE.withAlpha(.6),normalMap:E,frequency:T||1e3,animationSpeed:S||.01,amplitude:M||10}}})}),show:!0}),O=m._viewer.scene.primitives.add(L);m.item=L,I!==""&&I!==null&&typeof I=="function"&&I(this)}}},50),this};nk.prototype.endWater=function(){this.end&&this.end(),this.waterTimer&&clearInterval(this.waterTimer),this.deleteObject()};nk.prototype.deleteObject=function(){if(this._viewer.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this._viewer.entities.remove(this._points[o]);this._points=[]}try{this._viewer.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};nk.prototype.toDegrees=function(o){let f=Mt.fromCartesian(o);return{lon:xe.toDegrees(f.longitude),lat:xe.toDegrees(f.latitude),height:f.height}};nk.prototype.getMousePosition=function(o,f){let m=o.endPosition||o.position||o;this.defaultDepthTest===void 0&&(this.defaultDepthTest=!!this._viewer.scene.globe.depthTestAgainstTerrain);let v=this._viewer.camera.getPickRay(m);f&&!Array.isArray(f)&&(f=[f]);let y=this._viewer.scene.pickPosition(m);y?y={position:y}:(this._viewer.scene.globe.depthTestAgainstTerrain=!0,y=this._viewer.scene.pickFromRay(v,f));let x;if(!y||!y.position||!this._viewer.scene.globe.depthTestAgainstTerrain?x=this._viewer.scene.globe.pick(v,this._viewer.scene):x=y.position,this._viewer.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,!x){console.log("\u672A\u62FE\u53D6\u5230\u5750\u6807\uFF01");return}return x};var E3e=nk;function ok(o,f){this._earthCtrl=o,this._coreMap=o.coreMap,this.shapeTool=void 0,this.positions=void 0,this.echarts=void 0,this.mCallback=Z(f.callback,void 0),this.defaultChart=Z(f.defaultChart,!0),this.step=Z(f.step,20),this.image=f.image,this.echarstView=f.echartsView,this.echartsParentView=f.echartsParentView,this.billboard=void 0,this.minHeight=0,this.maxHeight=0,this.profile={arrHB:[],arrPoint:[],arrLX:[],points:[],distance:0}}ok.prototype.drawPolyLine=function(o={}){let f=this;this.shapeTool=f._earthCtrl.shapeTool.createDrawShapeTool(function(m){f.setPolyline({positions:m.result,skipClick:o.skipClick})},"polyline")};ok.prototype.setPolyline=function(o){this.positions=o.positions,o.skipClick&&this.startAnalysis()};ok.prototype.startAnalysis=function(){if(!this.positions)return console.info("\u8BF7\u5148\u7ED8\u5236\u5256\u9762\u7EBF\uFF01");if(this.positions.length>1){this.profile.arrLX.push(0);for(let f=0;f<this.positions.length-1;f++){let m=this.positions[f],v=this.positions[f+1];this.profile2PointAnalysis(m,v)}this.processHeight();let o=this.profile;this.defaultChart&&n6i(this,o),N(this.mCallback)&&this.mCallback(o),this.positions=void 0}};ok.prototype.processHeight=function(){let o=this;if(!(o.profile.arrHB.length<=0)){o.minHeight=o.maxHeight=o.profile.arrHB[0];for(let f=1;f<o.profile.arrHB.length;f++){let m=o.profile.arrHB[f];m>o.maxHeight?o.maxHeight=m:m<o.minHeight&&(o.minHeight=m)}o.minHeight=parseInt(o.minHeight/100)*100;for(let f=0;f<o.profile.arrHB.length;f++){let m=o.profile.arrHB[f];o.profile.arrHB[f]=m-o.minHeight}}};var r6i=new H;ok.prototype.profile2PointAnalysis=function(o,f){let m=this,v=H.distance(o,f),y=parseInt(v/m.step),x=Mt.fromCartesian(o),C=Mt.fromCartesian(f);m.positions.length>2&&m.profile.arrLX.length>1&&m.profile.arrLX.push(m.profile.arrLX[m.profile.arrLX.length-1]+S3e(m.profile.points[m.profile.points.length-1],x)),m.profile.points.push(x),m.profile.arrPoint.push(T3e(o)),m.profile.arrHB.push(x.height);let w=m.profile.arrLX.length-1;console.info(w);for(let A=1;A<y;A++){let E=H.lerp(o,f,A/y,r6i),T=Mt.fromCartesian(E),S=m._coreMap.scene.globe.getHeight(T);T.height=S;let M=S3e(m.profile.points[w+A-1],T);m.profile.distance=m.profile.distance+M,m.profile.points.push(T),m.profile.arrLX.push(m.profile.arrLX[w+A-1]+M),m.profile.arrPoint.push(T3e(E)),m.profile.arrHB.push(S)}return m.profile.points.push(C),m.profile.arrLX.push(m.profile.arrLX[m.profile.arrLX.length-1]+S3e(m.profile.points[m.profile.points.length-1],C)),m.profile.arrPoint.push(T3e(f)),m.profile.arrHB.push(C.height),m.profile};function pmt(o,f){let m=document.getElementById(o);m.style.display=f?"block":"none"}var hmt;function n6i(o,f){if(f!==null&&f.arrPoint!==null){pmt(o.echartsParentView,!0),N(o.echarts)||(o.echarts=fY.init(document.getElementById(o.echarstView),"dark"));let m=f.arrPoint,v={grid:{left:10,right:10,bottom:10,containLabel:!0},dataZoom:[{type:"inside",throttle:50}],tooltip:{trigger:"axis",formatter:function(y){let x="";if(y.length===0)return x;let C=m[y[0].dataIndex],w=y[0].value+o.minHeight;return hmt=new H.fromDegrees(C.x,C.y,w),N(o.billboard)||(o.billboard=o._earthCtrl.entities.add({name:"profile_billboard",position:new xn(function(){return hmt},!1),billboard:{verticalOrigin:so.BOTTOM,image:o.image,iconWidth:8,iconHeight:8,scale:.5}})),o.billboard.show||(o.billboard.show=!0),`${o._earthCtrl.language.TOOLS_PROFILE_POSITION} ${fmt(C.x)},${fmt(C.y)}<br />${o._earthCtrl.language.TOOLS_PROFILE_DISTANCE} <label>${dmt(o,y[0].axisValue)}</label><br />${y[0].seriesName} <label style="color:${y[0].color};">${dmt(o,w)}</label><br />`}},xAxis:[{name:`${o._earthCtrl.language.TOOLS_PROFILE_XAXIS_NAME}`,type:"category",boundaryGap:!1,axisLine:{show:!1},axisLabel:{show:!1},data:f.arrLX}],yAxis:[{type:"value",axisLabel:{formatter:function(y){return`${y+o.minHeight}${o._earthCtrl.language.UNIT_METER}`}}}],series:[{name:`${o._earthCtrl.language.TOOLS_PROFILE_SERIES_NAME}`,type:"line",smooth:!0,symbol:"none",sampling:"average",itemStyle:{normal:{color:"rgb(255, 70, 131)"}},areaStyle:{normal:{color:new fY.graphic.LinearGradient(0,0,0,1,[{offset:0,color:"rgb(255, 158, 68)"},{offset:1,color:"rgb(255, 70, 131)"}])}},data:f.arrHB}]};o.echarts.setOption(v)}}function dmt(o,f,m){if(f===null)return"";f=Number(f),(m===null||m==="auto")&&(f<1e3?m="m":m="km");let v="";switch(m){default:case"m":v=`${f.toFixed(2)}${o._earthCtrl.language.UNIT_METER}`;break;case"km":v=`${(f*.001).toFixed(2)}${o._earthCtrl.language.UNIT_KILOMETER}`;break}return v}function fmt(o){let f=o.toString();return f.slice(0,f.indexOf(".")+3)}function T3e(o){let f=Mt.fromCartesian(o),m=xe.toDegrees(f.longitude),v=xe.toDegrees(f.latitude),y=f.height;return{x:m,y:v,z:y}}function S3e(o,f){let m=new Im;m.setEndPoints(o,f);let v=m.surfaceDistance;return v=Math.sqrt(Math.pow(v,2)+Math.pow(f.height-o.height,2)),v}ok.prototype.removeFromMap=function(){let o=this;N(o.shapeTool)&&(o.shapeTool.removeFromMap(),o.shapeTool=void 0),N(o.billboard)&&(o._earthCtrl.entities.remove(o.billboard),o.billboard=void 0),pmt(o.echartsParentView,!1)};var P3e=ok;function Mue(o,f){this._earthCtrl=o,this._coreMap=o.coreMap,this._skylineColor=Z(f.color,Re.RED.withAlpha(1)),this._postProccessStage=null,this._postProcessStages=this._coreMap.scene.postProcessStages,this._width=Z(f.width,1),this._edgeDetection=D0.createEdgeDetectionStage({width:this._width||1}),this.addToMap()}Mue.prototype.addToMap=function(){this.removeFromMap();let o=new as({name:"czm_skylinetemp",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D depthTexture;in vec2 v_textureCoordinates;void main(void){float depth = czm_readDepth(depthTexture, v_textureCoordinates);vec4 color = texture(colorTexture, v_textureCoordinates);if(depth<1.0 - 0.000001){out_FragColor = color;}else{out_FragColor = vec4(1.0,0.0,0.0,1.0);}}"}),f=new as({name:"czm_skylinetemp1",fragmentShader:"uniform sampler2D colorTexture;uniform sampler2D redTexture;uniform sampler2D silhouetteTexture;uniform vec4 skylineColor;in vec2 v_textureCoordinates;void main(void){vec4 redcolor=texture(redTexture, v_textureCoordinates);vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);vec4 color = texture(colorTexture, v_textureCoordinates);if(redcolor.r == 1.0){out_FragColor = mix(color, skylineColor, silhouetteColor.a);}else{out_FragColor = color;}}",uniforms:{redTexture:o.name,silhouetteTexture:this._edgeDetection.name,skylineColor:this._skylineColor}});this._postProccessStage=new z0({name:"czm_skyline",stages:[this._edgeDetection,o,f],inputPreviousStageTexture:!1,uniforms:this._edgeDetection.uniforms}),this._postProcessStages.add(this._postProccessStage)};Mue.prototype.removeFromMap=function(){this._postProccessStage&&(this._earthCtrl.coreMap.scene.postProcessStages.remove(this._postProccessStage),this._postProccessStage=null)};Object.defineProperties(Mue.prototype,{});var I3e=Mue;function Due(o,f){this._earthCtrl=o,this._coreMap=o.coreMap,this.left=[],this.right=[],f.left.forEach(m=>{m.splitDirection=-1,m.item&&(m.item.splitDirection=-1)}),f.right.forEach(m=>{m.splitDirection=1,m.item&&(m.item.splitDirection=1)}),this.left.push(...f.left),this.right.push(...f.right),this.addToMap()}var ak={dragStartX:0,_scene:void 0};Due.prototype.addToMap=function(){document.getElementById("slider")&&this.clear();let f=this._coreMap.scene;ak._scene=f;let m=this._coreMap.container,v=document.createElement("div");v.id="slider",v.style.position="absolute",v.style.cursor="e-resize",v.style.top=0,v.style.backgroundColor="#D3D3D3",v.style.width="8px",v.style.height="100%",v.style.zIndex="1000",m.appendChild(v);let y=document.getElementById("slider");f.splitPosition=y.offsetLeft/y.parentElement.offsetWidth,y.addEventListener("mousedown",gmt,!1),window.addEventListener("mouseup",mmt,!1),y.style.left="50%",ak._scene.splitPosition=.5};function mmt(){window.removeEventListener("mousemove",M3e,!1)}function gmt(o){let f=document.getElementById("slider");ak.dragStartX=o.clientX-f.offsetLeft,window.addEventListener("mousemove",M3e,!1)}function M3e(o){let f=document.getElementById("slider"),m=(o.clientX-ak.dragStartX)/f.parentElement.offsetWidth;f.style.left=`${100*m}%`,ak._scene.splitPosition=m}Due.prototype.removeFromMap=function(){let o=document.getElementById("slider");o&&(ak._scene.splitPosition="0%",o.removeEventListener("mousedown",gmt,!1),window.removeEventListener("mouseup",mmt,!1),window.removeEventListener("mousemove",M3e,!1),o.remove(),this.left.forEach(f=>{f.splitDirection=0,f.item&&(f.item.splitDirection=0)}),this.right.forEach(f=>{f.splitDirection=0,f.item&&(f.item.splitDirection=0)}),this.left=[],this.right=[],ak._scene=void 0)};Object.defineProperties(Due.prototype,{});var _mt=Due;function UJ(o,f){this._earthCtrl=o,this._coreMap=o.coreMap,this.color=Z(f.color,Re.RED.withAlpha(.5)),this.positions=f.positions,this.baseHeight=Z(f.baseHeight,0),this._height=Z(f.height,0),this.extrudedHeight=Z(f.extrudedHeight,1e4),this.limitHeightPrimitive=null,this.addToMap()}UJ.prototype.addToMap=function(){if(this.removeFromMap(),!this.positions)return;let o=H.fromDegreesArray(this.positions),f=new co({geometry:new Ec({polygonHierarchy:new ho(o),height:this.baseHeight,extrudedHeight:this.baseHeight+this.extrudedHeight}),attributes:{color:ea.fromColor(this.color)}});this.limitHeightPrimitive=this._coreMap.scene.primitives.add(new AU({geometryInstances:f,releaseGeometryInstances:!1,classificationType:uc.CESIUM_3D_TILE}))};UJ.prototype.changeHeight=function(o){!this.limitHeightPrimitive||(console.log("?!?!?!",this.limitHeightPrimitive),this.limitHeightPrimitive.readyPromise.then(f=>{let m=Mt.fromCartesian(this.limitHeightPrimitive._primitive._boundingSpheres[0].center);console.log("???",m);let v=H.fromRadians(m.longitude,m.latitude,this.baseHeight),y=H.fromRadians(m.longitude,m.latitude,this.baseHeight+o),x=H.subtract(y,v,new H);console.log("!!!!",this.limitHeightPrimitive._primitive.modelMatrix),this.limitHeightPrimitive._primitive.modelMatrix=Ee.setTranslation(Ee.IDENTITY,x,new Ee),this.baseHeight=this.baseHeight+o}))};UJ.prototype.removeFromMap=function(){this.limitHeightPrimitive&&(this._coreMap.scene.primitives.remove(this.limitHeightPrimitive),this.limitHeightPrimitive=void 0)};Object.defineProperties(UJ.prototype,{});var D3e=UJ;function vmt(o){this._earthCtrl=o}vmt.prototype.toDegrees=function(o){let f=Mt.fromCartesian(o);return{lon:xe.toDegrees(f.longitude),lat:xe.toDegrees(f.latitude),height:f.height}};var ymt=vmt;function sk(o){this._viewer=o.coreMap,this._trans=new ymt}sk.prototype.addClipping=function(o,f={}){if(this.remove(),f.type==="polygon"){let m=f.positions,v=[];m.forEach(w=>{v.push(this._trans.toDegrees(w))}),v.push(v[0]);let y;f.isInner?y=this.isClockWise(v):y=!this.isClockWise(v),y&&v.reverse();let x=[],C=this.getInverseTransform(o);for(let w=0;w<v.length-1;w++){let A=this.createPlane(v[w],v[w+1],C);x.push(A)}o.clippingPlanes=new Uv({planes:x,unionClippingRegions:!f.isInner})}return this.item=o,this};sk.prototype.getInverseTransform=function(o){let f,m=o.root.transform;return m&&m.equals(Ee.IDENTITY)||!m?f=tn.eastNorthUpToFixedFrame(o.boundingSphere.center):f=Ee.fromArray(o.root.transform),Ee.inverseTransformation(f,new Ee)};sk.prototype.getOriginCoordinateSystemPoint=function(o,f){let m=H.fromDegrees(o.lon,o.lat);return Ee.multiplyByPoint(f,m,new H(0,0,0))};sk.prototype.createPlane=function(o,f,m){let v=this.getOriginCoordinateSystemPoint(o,m),y=this.getOriginCoordinateSystemPoint(f,m),x=new H(0,0,1),C=H.subtract(y,v,new H),w=H.cross(C,x,new H);w=H.normalize(w,w);let A=$a.fromPointNormal(v,w);return zv.fromPlane(A)};sk.prototype.isClockWise=function(o){if(o.length<3)return null;o[0]===o[o.length-1]&&(o=o.slice(0,o.length-1));let f={i:-1,val:90};for(let A=0;A<o.length;A++){let{lat:E}=o[A];E<f.val&&(f.val=E,f.i=A)}let m=(f.i+o.length-1)%o.length,v=f.i,y=(f.i+1)%o.length,x={lat:o[v].lat-o[m].lat,lon:o[v].lon-o[m].lon},C={lat:o[y].lat-o[v].lat,lon:o[y].lon-o[v].lon},w=C.lon*x.lat-x.lon*C.lat;return w===0?o[y].lon<o[m].lon:w>0};sk.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)};var L3e=sk;var R3e;function O3e(o,f){this._viewer=o.coreMap,R3e=o.coreMap,this.createTerrainModifier(f.name,f.polygon,f.altitude)}O3e.prototype.findDirectParent=function(o){try{let f=[];if(o.width===Math.PI)return null;for(let m=0;m<R3e.scene.globe._surface._tilesToRender.length;m++){let v=R3e.scene.globe._surface._tilesToRender[m],y=v._rectangle;Di.intersection(y,o)&&f.push(v)}return f}catch(f){console.log(f)}return null};O3e.prototype.createTerrainModifier=function(o,f,m){let v=f.length,y=new Array(v);y.fill(m);let x=zl(),C=Date.now(),w=Di.fromCartesianArray(f),A=this.findDirectParent(w);this._viewer.terrainProvider&&this._viewer.terrainProvider._modifyTerrainObjects===void 0&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);let E=this._viewer,T={id:x,name:o,show:!0,rectangle:w,vertices:f,heights:y,timeStamp:C,remove:function(){if(E.terrainProvider&&E.terrainProvider._modifyTerrainObjects)for(let S=E.terrainProvider._modifyTerrainObjects.length-1;S>=0;S--)E.terrainProvider._modifyTerrainObjects[S].id===x&&E.terrainProvider._modifyTerrainObjects.splice(S,1);if(A)try{for(let S=0;S<A.length;S++)try{A[S]._parent.freeResources()}catch(M){console.log(M)}}catch(S){console.log(S)}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(T),A)try{for(let S=0;S<A.length;S++)try{A[S]._parent.freeResources()}catch(M){console.log(M)}}catch(S){console.log(S)}return T};var N3e=O3e;var F3e=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.cutVolume=0,this.fillVolume=0,this.baseArea=0}},B3e=class{constructor(){this.minHeight=Number.MAX_VALUE,this.maxHeight=Number.MIN_VALUE,this.avgHeight=0,this.baseArea=0}};function Lue(o,f){this._earthCtrl=o,this._viewer=o.coreMap,this.baseHeight=Z(f.baseHeight,0),this.options=f}Lue.prototype.start=function(){let o=this.options.positions,f=this.options.countBase,m=this.options.basePositions,v=this.options.baseHeight,y=new F3e,x=[];o.forEach(S=>{let M=Mt.fromCartesian(S);this.baseHeight=Math.min(M.height,Z(v,this.baseHeight)),x.push(nl.wgs84ToWindowCoordinates(this._viewer.scene,S))});let C=o6i(x),w=ra.randomPoint(100,{bbox:[C[0],C[1],C[2],C[3]]}),A=a6i(x);ra.voronoi(w,{bbox:[C[0],C[1],C[2],C[3]]}).features.forEach(S=>{let M=s6i(A,S.geometry);if(M.length>0){let I=this.computeCubeInfo(M);this.baseHeight>I.avgHeight?y.fillVolume+=(this.baseHeight-I.avgHeight)*y.baseArea:y.cutVolume+=(I.avgHeight-this.baseHeight)*y.baseArea,y.maxHeight=Math.max(y.maxHeight,I.maxHeight),y.minHeight=Math.min(y.minHeight,I.minHeight),y.baseArea+=I.baseArea}});let T=this.countBaseVolume(f,m,v);return T!==0&&(y.cutVolume+=T,y.fillVolume+=T),y};Lue.prototype.countBaseVolume=function(o,f,m){let v=this;if(o){let y=[],x=[];for(let S=0;S<f.length;S=S+3){x.push(f[S+2]);let M=H.fromDegrees(f[S],f[S+1],m),I=Mt.fromCartesian(M);y.push(I)}y.push(y[0]);let C=xmt(y);x.sort(function(S,M){return S-M});let w=x[0],A=x[x.length-1];return Number(A-w)*C/2}return 0};Lue.prototype.computeCubeInfo=function(o){let f=this,m=[],v=Number.MAX_VALUE,y=Number.MIN_VALUE,x=0;o.forEach(function(A){let E=f._earthCtrl.coreMap.scene.camera.getPickRay(A),T=f._earthCtrl.coreMap.scene.globe.pick(E,f._earthCtrl.coreMap.scene),S=Mt.fromCartesian(T);m.push(S),v=Math.min(v,S.height),y=Math.max(y,S.height),x+=S.height});let C=x/o.length,w=new B3e;return w.minHeight=v,w.maxHeight=y,w.avgHeight=C,w.baseArea=xmt(m),w};function xmt(o){let f=[0],m=[0],v=new Im,y=Math.PI/180;for(let C=0;C<o.length-1;C++){let w=o[C],A=o[C+1];v.setEndPoints(w,A);let E=Math.sqrt(Math.pow(v.surfaceDistance,2)),T=A.latitude*y,S=A.longitude*y,M=w.latitude*y,I=w.longitude*y,P=-Math.atan2(Math.sin(S-I)*Math.cos(M),Math.cos(T)*Math.sin(M)-Math.sin(T)*Math.cos(M)*Math.cos(S-I));P<0&&(P+=Math.PI*2),m.push(Math.sin(P)*E+m[C]),f.push(Math.cos(P)*E+f[C])}let x=0;for(let C=0;C<f.length-1;C++)x+=f[C]*m[C+1]-f[C+1]*m[C];return Math.abs(x+f[f.length-1]*m[0]-f[0]*m[m.length-1])/2}function o6i(o){let f=[],m=Number.MAX_VALUE,v=Number.MIN_VALUE,y=Number.MAX_VALUE,x=Number.MIN_VALUE;return o.forEach(C=>{m=Math.min(m,C.x),v=Math.max(v,C.x),y=Math.min(y,C.y),x=Math.max(x,C.y)}),f.push(m),f.push(y),f.push(v),f.push(x),f}function a6i(o){let f=[[]];return o.forEach(v=>{f[0].push([v.x,v.y])}),f[0].push([o[0].x,o[0].y]),ra.polygon(f).geometry}function s6i(o,f){let m=ra.intersect(o,f);return m?.geometry!==void 0?l6i(m?.geometry):[]}function l6i(o){let f=[];return o.coordinates.forEach(function(m){m.forEach(function(v){f.push(new Ye(v[0],v[1]))})}),f.push(new Ye(o.coordinates[0][0][0],o.coordinates[0][0][1])),f}var Rue=Lue;function uy(o,f){this._earthCtrl=o,this._viewer=o.coreMap,this._cesium=qi,this._scene=o.coreMap.scene,this._Tooltip=new R_(o),this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.tooltip=this._Tooltip.CreateTooltip(),this.FlattenIsDraw=!1,this.wallArr=[],this.hierarchy=[],this.tophierarchy=[],this.heightsort=[],this.FlattenPolygon=[],this.deepth=100,this.polygon=null,this.editPoint=[],this.nowPoint=null,this.editPosition=[],this.topPositions=null,this._volumeLabel=void 0,this._volumeLabel1=void 0,this._option=Z(f.option,{}),this._irregularCut=Z(f.irregularCut,!1),this.terrainFlatten=new xD(o.coreMap.scene),this.CreatePolygon(f.height,f.option,f.callback)}uy.prototype.CreatePolygon=function(o,f,m){if(this.FlattenIsDraw)return;this.drawHandler&&(this.drawHandler.destroy(),this.drawHandler=null),this.removeLabel(),this.addLoading(),this.FlattenIsDraw=!0;let v=this._viewer,y=this._cesium;this.deepth=o||this.deepth,this.removeFromMap(),!f&&(f={});let x=[],C=this.hierarchy,w=this.polygon,A,E=null,T=0,S=this.heightsort,M=this.deepth,I=this.wallArr,P=this;this.drawHandler=new y.ScreenSpaceEventHandler(v.scene.canvas),v.scene.globe.depthTestAgainstTerrain=!0;let D=this.tooltip,L;this._viewer.container.style.cursor=`url(${window.SmartEarthRootUrl} 'Assets/image/cursor/draw.cur')`,this.drawHandler.setInputAction(function(U){if(A=O(U.position),!A)return;let G=y.Cartographic.fromCartesian(A),j=y.Math.toDegrees(G.longitude),q=y.Math.toDegrees(G.latitude),J=G.height;x.push(A),C.push(j,q,G.height),P.tophierarchy.push(j,q,J),T===0?(x.push(A),C.push(j,q,G.height),L=v.entities.add({name:`${P._earthCtrl.language.TOOLS_VOLUMETRIC_TEMP_LINE_NAME}`,polyline:{positions:new y.CallbackProperty(()=>x,!1),clampToGround:!0,material:new y.ColorMaterialProperty(y.Color.YELLOW.withAlpha(.3)),width:3}})):T===1&&(L&&v.entities.remove(L),w=v.entities.add({name:null,id:P._earthCtrl.factory.createUUID(),polygon:{hierarchy:new y.PolygonHierarchy(y.Cartesian3.fromDegreesArrayHeights(C)),material:y.Color.YELLOW.withAlpha(.3)}}),w.polygon.hierarchy=new y.CallbackProperty(R,!1)),T++},y.ScreenSpaceEventType.LEFT_CLICK),this.drawHandler.setInputAction(function(U){if(T===0){D.showAt(U.endPosition,`${P._earthCtrl.language.TOOLS_LEFT_CLICK_TO_START_DRAW}`);return}else T===1?D.showAt(U.endPosition,`${P._earthCtrl.language.TOOLS_TERRAIN_EXCAVATION_CLICK_ADD_SECOND_POINT}`):D.showAt(U.endPosition,`${P._earthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`);if(A=O(U.endPosition),!A)return;let G=y.Cartographic.fromCartesian(A),j=y.Math.toDegrees(G.longitude),q=y.Math.toDegrees(G.latitude);C.splice(C.length-3,3),x.splice(x.length-1,1),x.push(A),C.push(j,q,G.height)},y.ScreenSpaceEventType.MOUSE_MOVE),this.drawHandler.setInputAction(function(U){this.end&&this.end()}.bind(this),y.ScreenSpaceEventType.RIGHT_CLICK),this.end=U=>{if(D.show(!1),P._viewer.container.style.cursor="default",P.drawHandler.destroy(),L&&v.entities.remove(L),w&&v.entities.remove(w),this.FlattenIsDraw=!1,this.end=void 0,U==="cancel"||x.length<3)return;if(T<2){T=0;return}T=0;for(let Q=2;Q<C.length;Q=Q+3)S.push(C[Q]);S.sort(function(Q,ee){return Q-ee}),w=v.entities.add({name:null,id:P._earthCtrl.factory.createUUID(),polygon:{hierarchy:new y.CallbackProperty(function(){return new y.PolygonHierarchy(y.Cartesian3.fromDegreesArrayHeights(C))},!1),material:new y.ImageMaterialProperty({image:y.defaultValue(f.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new y.Cartesian2(1,1)})}}),x.push(x[0]);let G,j,q,J,X,Y;for(let Q=0;Q<x.length-1;Q++){G=y.Cartographic.fromCartesian(x[Q]),j=y.Cartographic.fromCartesian(x[Q+1]),q=y.Math.toDegrees(G.longitude),X=y.Math.toDegrees(G.latitude),J=y.Math.toDegrees(j.longitude),Y=y.Math.toDegrees(j.latitude),E?E=E>j.height?j.height:E:E=G.height>j.height?j.height:G.height;let ee=P.getPoint(q,X,J,Y,G.height,j.height),z=[],ie=[];P.getHeightsFromLonLat(ee.positions,function(re){if(re){z=re;for(let ne=0;ne<z.length;ne++)ie.push(P.heightsort[0]-P.deepth);P.drawwall(ee.wallJwd,z,ie)}})}w.polygon.height=S[0]-M,this.FlattenPolygon.push(w),this.originHeight=S[0],F(x),this.topPositions=x,typeof m=="function"&&m(x)};function R(){return new y.PolygonHierarchy(y.Cartesian3.fromDegreesArrayHeights(C))}function O(U){let G;if(v.scene.terrainProvider.constructor.name==="EllipsoidTerrainProvider")G=v.camera.pickEllipsoid(U,v.scene.globe.ellipsoid);else{let q=v.scene.camera.getPickRay(U);G=v.scene.globe.pick(q,v.scene)}if(v.scene.pick(U)){let q=v.scene.pickPosition(U);if(q){G=q;let J=y.Cartographic.fromCartesian(G),X=v.scene.globe.getHeight(J);J.height=X,G=y.Cartographic.toCartesian(J)}}return G}function F(U){let G=v.scene.globe,j=U.concat();j.splice(j.length-1,1);for(let J=0;J<j.length-1;J++)j[J].x===j[J+1].x&&j[J].y===j[J+1].y&&(j.splice(J,1),J--);let q=j.length;if(k(j)&&j.reverse(),P._irregularCut){P.terrainFlatten.clearPolygon();let J=[],X=v.scene.globe.ellipsoid;for(let Y=0;Y<j.length;Y++){let Q=X.cartesianToCartographic(j[Y]),ee=y.Math.toDegrees(Q.longitude),z=y.Math.toDegrees(Q.latitude),ie=Q.height;J.push(ee,z,ie)}P.terrainFlatten.addPolygon(J),P.terrainFlatten.update(),P.terrainFlatten.clipPlaneOfFlatten=!0}else{let J=[];for(let X=0;X<q;++X){let Y=(X+1)%q,Q=y.Cartesian3.add(j[X],j[Y],new y.Cartesian3);Q=y.Cartesian3.multiplyByScalar(Q,.5,Q);let ee=y.Cartesian3.normalize(Q,new y.Cartesian3),z=y.Cartesian3.subtract(j[Y],Q,new y.Cartesian3);z=y.Cartesian3.normalize(z,z);let ie=y.Cartesian3.cross(z,ee,new y.Cartesian3);ie=y.Cartesian3.normalize(ie,ie);let re=new y.Plane(ie,0),ne=y.Plane.getPointDistance(re,Q);J.push(new y.ClippingPlane(ie,ne))}G.clippingPlanes=new y.ClippingPlaneCollection({planes:J})}}function k(U){if(U.length>=3)return!((U[1].x-U[0].x)*(U[2].y-U[1].y)-(U[1].y-U[0].y)*(U[2].x-U[1].x)>0)}return this};uy.prototype.getPoint=function(o,f,m,v,y,x){let C=this,w=160,A=xe.lerp(o,m,1/w)-o,E=xe.lerp(f,v,1/w)-f,T=[],S=[],M=[],I;T.push(o,f),I=H.fromDegrees(o,f),S.push(Mt.fromCartesian(I));for(let P=0;P<w;P++){let D=o+(P+1)*A,L=f+(P+1)*E;T.push(D,L),I=H.fromDegrees(D,L),S.push(Mt.fromCartesian(I))}return T.push(m,v),I=H.fromDegrees(m,v),S.push(Mt.fromCartesian(I)),{wallJwd:T,positions:S}};uy.prototype.getHeightsFromLonLat=function(o,f){let m=this._viewer,v=m.camera,y=[];if(this.isHaveTerrain(m))if(N(m.terrainProvider.availability)){let x=xT(m.terrainProvider,o);Promise.resolve(x).then(function(C){C.forEach(function(w){y.push(w.height)}),typeof f=="function"&&f(y)})}else o.forEach(function(x){let C=m.scene.globe.getHeight(x);y.push(C)}),typeof f=="function"&&f(y);else o.forEach(function(x){y.push(m.scene.globe.getHeight(x))}),typeof f=="function"&&f(y)};uy.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};uy.prototype.drawwall=function(o,f,m){let v=this,y=v._viewer.entities.add({wall:{positions:new xn(function(){return H.fromDegreesArray(o)},!1),maximumHeights:f,minimumHeights:m}}),x=y.wall;x.material=new Pp({image:Z(v._option.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new Ye(1,1)}),v.wallArr.push(y)};uy.prototype.setDeepth=function(o){this.FlattenPolygon[0]&&this.FlattenPolygon[0].polygon.height.setValue(this.originHeight-o),this.wallArr.forEach(f=>{let m=f.wall.minimumHeights.getValue();m=Array(m.length),m.fill(this.originHeight-o),f.wall.minimumHeights.setValue(m)})};uy.prototype.edit=function(o){let f=this,m=f.editPoint,v=f.nowPoint;if(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,v){for(let C of f.editPoint)C&&(C.show=!0);f.update(v,m,o);return}for(let C=2;C<f.hierarchy.length;C=C+3)f.hierarchy[C]=f.originHeight-f.deepth;f.FlattenPolygon[0]&&f._viewer.entities.remove(f.FlattenPolygon[0]),f.FlattenPolygon=[];let y=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new ho(H.fromDegreesArrayHeights(f.hierarchy)),material:new Pp({image:Z(f._option.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new Ye(1,1)}),perPositionHeight:!0}});f.FlattenPolygon.push(y);let x=f.FlattenPolygon[0].polygon.hierarchy.getValue();for(let C of x.positions){let w=this._viewer.entities.add({id:f._earthCtrl.factory.createUUID(),position:C,point:{color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}});m.push(w)}f._earthCtrl.measure.pickObject(null,function(C){let w=C.pickedObject.id;for(let A of m)if(w.id===A.id){f.nowPoint=A,f.update(A,m,o);return}})};uy.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let f of o.editPoint)f&&(f.show=!1)};uy.prototype.excavationAndFill=function(){this.removeLabel();let o=this;this.endEdit(),o.topPositions&&(this.isLoading(!0),setTimeout(()=>{let f=null,m=null,v=!1;if(o.editPosition.length>0){let w=[];m=[];for(let A=0;A<o.editPosition.length-1;A++){let E=Mt.fromCartesian(o.editPosition[A]),T=xe.toDegrees(E.longitude),S=xe.toDegrees(E.latitude),M=E.height;w.push(M),m.push(T,S,M)}w.sort(function(A,E){return E-A}),f=w[0],v=!0}else f=o.heightsort[0]-o.deepth;let x=new Rue(o._earthCtrl,{positions:o.topPositions,baseHeight:f,basePositions:m,countBase:v}).start(),C=o.computeCentroidOfPolygon(o.topPositions);this._volumeLabel=this._viewer.entities.add({position:H.fromRadians(C.longitude,C.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`${o._earthCtrl.language.TOOLS_VOLUMETRIC_CUT_VOLUMETRIC}${x.cutVolume}${o._earthCtrl.language.UNIT_CUBIC_METER}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:Re.GOLD,verticalOrigin:so.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:H.fromRadians(C.longitude,C.latitude,o.heightsort[o.heightsort.length-1]),label:{text:`${o._earthCtrl.language.TOOLS_VOLUMETRIC_FILL_VOLUMETRIC}${x.fillVolume}${o._earthCtrl.language.UNIT_CUBIC_METER}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:Re.GOLD,verticalOrigin:so.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),console.log(x.result)},100))};uy.prototype.computeCentroidOfPolygon=function(o){let f=[],m=[],v=0,y=0;for(let w=0;w<o.length;w++){let A=Mt.fromCartesian(o[w]);v+=A.longitude,y+=A.latitude,f.push(A.longitude),m.push(A.latitude)}let x=0,C=0;return x=v/o.length,C=y/o.length,new Mt(x,C)};uy.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=this.loadingImg,o.appendChild(f),this.loading=o,this._viewer.container.appendChild(o)};uy.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};uy.prototype.update=function(o,f,m){let v=this,y=o.position.getValue(),C=v._scene.globe.ellipsoid.cartesianToCartographic(y),w=xe.toDegrees(C.longitude),A=xe.toDegrees(C.latitude),E=C.height;o.position.setValue(H.fromDegrees(w,A,E+m)),v.editPoint=f,v.editPosition=[];let T=[];for(let M of f){let I=M.position.getValue();T.push(I),v.editPosition.push(I)}v.FlattenPolygon[0].polygon.hierarchy=new xn(function(){return new ho(T)},!0);let S=v.editPosition;S.push(S[0]);for(let M=0;M<S.length-1;M++){let P=[];for(let D=0;D<=160;D++){let L=H.lerp(S[M],S[M+1],D/160,new H),R=Mt.fromCartesian(L);P.push(R.height)}v.wallArr[M].wall.minimumHeights.setValue(P)}};uy.prototype.removeFromMap=function(){this.endEdit(),this._earthCtrl.tools.clearTool(),this.editPoint=[],this.nowPoint=null;let o=this._viewer;if(this.wallArr.length>0){for(let f=0;f<this.wallArr.length;f++)o.entities.remove(this.wallArr[f]);this.wallArr=[]}o.scene.globe.clippingPlanes&&o.scene.globe.clippingPlanes.removeAll(),this.FlattenPolygon&&this.FlattenPolygon.length>0&&(this.FlattenPolygon.forEach(function(f){o.entities.remove(f)}),this.FlattenPolygon=[]),this.FlattenIsDraw=!1,this.removeLabel(),this.terrainFlatten&&this.terrainFlatten.clearPolygon()};uy.prototype.removeLabel=function(){this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0)};var k3e=uy;function K0(o,f){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Z(f,{}),this._Tooltip=new R_(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Z(this.options.drawColor?.point,Re.BLUE),polyline:Z(this.options.drawColor?.polyline,Re.YELLOW),polygon:Z(this.options.drawColor?.point,Re.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`}K0.prototype.removeFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};K0.prototype.deleteObject=K0.prototype.removeFromMap;K0.prototype.startDrawing=function(o={},f="auto",m){let v=this._scene,y=this._tooltip,x=3,C=[],w=[],A=[],E;this._positions=w,this._degreesArr=A,this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Z(o.tin,!0),this.onlyTerrain=Z(o.onlyTerrain,!1),this.selectDatum=Z(o.selectDatum,!0);let T=this;this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading();let S=new Ur(v.canvas);this._mouseHandler=S,this.removeFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let M;S.setInputAction(function(P){if(P.position!==null){let D=v.camera.getPickRay(P.position),L=v.globe.pick(D,v);if(this._viewer.scene.pick(P.position)){let O=this._viewer.scene.pickPosition(P.position);O&&(L=O)}if(L){let O=Mt.fromCartesian(L),F=xe.toDegrees(O.longitude),k=xe.toDegrees(O.latitude);if(C.length===0&&(C.push(F,k),A.push([F,k]),w.push(L),E=L),w.length>=4){let U=nl.wgs84ToWindowCoordinates(this._viewer.scene,E);if(U!==void 0){let G=U.x-P.position.x,j=U.y-P.position.y;if(G*G+j*j<16){C.splice(C.length-2,2),w.pop(),this.stopDrawing(m);return}}}C.push(F,k),A.push([F,k]),w.push(L),w.length===2&&!M&&(M=this._viewer.entities.add({name:`${T._earthCtrl.language.TOOLS_VOLUMETRIC_TEMP_LINE_NAME}`,polyline:{positions:new xn(function(){return w},!1),clampToGround:!0,material:T._drawColor.polygon,width:3}})),w.length===x&&(M&&this._viewer.entities.remove(M),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new ho(H.fromDegreesArray(C)),material:T._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new xn(I,!1))}}}.bind(this),Ei.LEFT_CLICK),S.setInputAction(function(P){let D=P.endPosition;if(D!==null)if(w.length===0)y.showAt(D,`${this._earthCtrl.language.TOOLS_VOLUMETRIC_CLICK_TO_DRAW}`);else{let L=v.camera.getPickRay(D),R=v.globe.pick(L,v),O=this._viewer.scene.pick(D),F=!1;if(O){let k=this._viewer.scene.pickPosition(D);k&&(R=k),F=!0}if(R){let k=Mt.fromCartesian(R),U=xe.toDegrees(k.longitude),G=xe.toDegrees(k.latitude);if(C.splice(C.length-2,2),A.pop(),w.pop(),C.push(U,G),A.push([U,G]),w.push(R),y.showAt(D,`${this._earthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`),w.length>=3&&w.length>=4){let j=nl.wgs84ToWindowCoordinates(this._viewer.scene,E);if(j!==void 0){let q=j.x-D.x,J=j.y-D.y;q*q+J*J<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ei.MOUSE_MOVE),S.setInputAction(function(P){this.end&&this.end()}.bind(this),Ei.RIGHT_CLICK);function I(){return new ho(H.fromDegreesArray(C))}return this.end=P=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),T._viewer.container.style.cursor="default",this._tooltip.show(!1),M&&this._viewer.entities.remove(M),this.end=void 0,!(w.length<x)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=H.fromDegreesArray(C)),P==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}this.stopDrawing(f,m)}},this};K0.prototype.stopDrawing=function(o,f){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(m=>{this._viewer.entities.remove(m)}),this._volumeTin=[],this.isLoading(!0),setTimeout(()=>{let m=this.computeCutVolume(o,this.onlyTerrain),v=y=>{let x=y.maxHeight,C=y.minHeight;this._prevEntity.polygon.height=y.minHeight,this._prevEntity.polygon.heightReference=0;let w={id:this._earthCtrl.factory.createUUID(),polygon:{hierarchy:{positions:this._positions},height:C,extrudedHeight:x,closeTop:!1,closeBottom:!1,material:Re.CYAN.withAlpha(.2),outline:!0,outlineColor:Re.RED,outlineWidth:2}};if(this._prevEntity1=this._viewer.entities.add(w),typeof f=="function"&&f(y),this.selectDatum){let A=()=>{this.addPoint(E=>{this.setDatum(E,T=>{typeof f=="function"&&f({...y,...T}),A()})})};A()}};this.onlyTerrain?m.then(y=>{v(y)}):v(m)},100)};K0.prototype.computeCentroidOfPolygon=function(o){let f=[],m=[],v=0,y=0;for(let w=0;w<o.length;w++){let A=Mt.fromCartesian(o[w]);v+=A.longitude,y+=A.latitude,f.push(A.longitude),m.push(A.latitude)}let x=0,C=0;return x=v/o.length,C=y/o.length,new Mt(x,C)};K0.prototype.computeCutVolume=function(o,f){let m=this,v=15e3,y=-15e3;o==="auto"&&(o=Pi.fromPoints(this._positions).radius/20);let x=this.getPointsInPolygon(this._degreesArr,o,!0),C=ra.polygon([this._degreesArr]),w=()=>{let{tin:A}=this.tinFromPoints(x,{getArea:!0,polygon:C});this.tinData=A;let E={fill:0,dig:0},T={fill:`${m._earthCtrl.language.UNIT_CUBIC_METER}`,dig:`${m._earthCtrl.language.UNIT_CUBIC_METER}`},S,M,I,P,D,L={fill:1,dig:1};this.Triangulation=[],A.features.forEach(O=>{if(O.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new ho(O.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:Re.YELLOW}});this._volumeTin.push(k)}let F=O.geometry.coordinates[0];S=F[0][2],M=F[1][2],I=F[2][2],D=O.area,this.Triangulation.push({bottomArea:D,height:[S,M,I]}),P=(S-v+M-v+I-v)/3,P>0?E.dig=E.dig+D*P*L.dig:E.fill=E.fill-D*P*L.fill,E.dig>1e10&&T.dig===`${m._earthCtrl.language.UNIT_CUBIC_METER}`&&(E.dig=E.dig/1e9,T.dig=`${m._earthCtrl.language.UNIT_CUBIC_KILOMETER}`,L.dig=1e-9),E.fill>1e10&&T.fill===`${m._earthCtrl.language.UNIT_CUBIC_METER}`&&(E.fill=E.fill/1e9,T.fill=`${m._earthCtrl.language.UNIT_CUBIC_KILOMETER}`,L.fill=1e-9)}});let R=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:H.fromRadians(R.longitude,R.latitude,y),label:{text:`${this._earthCtrl.language.TOOLS_VOLUMETRIC_CUT_VOLUMETRIC}${E.dig.toFixed(4)}${T.dig}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:Re.GOLD,verticalOrigin:so.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:H.fromRadians(R.longitude,R.latitude,y),label:{text:`${this._earthCtrl.language.TOOLS_VOLUMETRIC_FILL_VOLUMETRIC}${E.fill.toFixed(4)}${T.fill}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:Re.GOLD,verticalOrigin:so.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this.isLoading(!1),{maxHeight:y,minHeight:v,volume:E,unit:T,spacing:o}};if(f){let A=[];return x.features.forEach(T=>{let S=T.geometry.coordinates;A.push(Mt.fromDegrees(S[0],S[1]))}),xT(this._viewer.scene.globe.terrainProvider,A).then(T=>(x.features.forEach((S,M)=>{let I=S.geometry.coordinates;I[2]=T[M]&&T[M].height?T[M].height:0,y<I[2]&&(y=I[2]),v>I[2]&&(v=I[2])}),w()))}return x.features.forEach(A=>{let E=A.geometry.coordinates,T=new Mt(xe.toRadians(E[0]),xe.toRadians(E[1]));E[2]=this._viewer.scene.sampleHeight(T)||0,y<E[2]&&(y=E[2]),v>E[2]&&(v=E[2])}),w()};K0.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=this.loadingImg,o.appendChild(f),this.loading=o,this._viewer.container.appendChild(o)};K0.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};K0.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};K0.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(f){let m=this._viewer.scene.pick(f.position);if(m&&m.id&&m.id.id===this._prevEntity1.id){let v=this._viewer.scene.pickPosition(f.position);if(v){let y=Mt.fromCartesian(v);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(y.height.toFixed(1))}}}.bind(this),Ei.LEFT_CLICK),this.addPointHandle.setInputAction(function(f){let m=this._viewer.scene.pick(f.endPosition);m&&m.id&&m.id.id===this._prevEntity1.id?this._tooltip.showAt(f.endPosition,`${this._earthCtrl.language.TOOLS_VOLUMETRIC_CLICK_TO_MODIFY_BASE_PLANE}`):this._tooltip.show(!1)}.bind(this),Ei.MOUSE_MOVE))};K0.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(f=>{if(f.positions){let m=this._viewer.entities.add({polygon:{hierarchy:new ho(f.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:Re.YELLOW}});this._volumeTin.push(m)}})};K0.prototype.setDatum=function(o,f){if(this.Triangulation&&this.Triangulation.length>0){let m=this,v,y,x,C={fill:0,dig:0},w={fill:`${this._earthCtrl.language.UNIT_CUBIC_METER}`,dig:`${this._earthCtrl.language.UNIT_CUBIC_METER}`},A={fill:1,dig:1};this.Triangulation.forEach(function(E){v=E.bottomArea,y=E.height,x=(y[0]-o+y[1]-o+y[2]-o)/3,x>0?C.dig=C.dig+v*x*A.dig:C.fill=C.fill-v*x*A.fill,C.dig>1e10&&w.dig===`${m._earthCtrl.language.UNIT_CUBIC_METER}`&&(C.dig=C.dig/1e9,w.dig=`${m._earthCtrl.language.UNIT_CUBIC_KILOMETER}`,A.dig=1e-9),C.fill>1e10&&w.fill===`${m._earthCtrl.language.UNIT_CUBIC_METER}`&&(C.fill=C.fill/1e9,w.fill=`${m._earthCtrl.language.UNIT_CUBIC_KILOMETER}`,A.fill=1e-9)}),this._volumeLabel.label.text=`${this._earthCtrl.language.TOOLS_VOLUMETRIC_CUT_VOLUMETRIC}${C.dig.toFixed(4)}${w.dig}`,this._volumeLabel1.label.text=`${this._earthCtrl.language.TOOLS_VOLUMETRIC_FILL_VOLUMETRIC}${C.fill.toFixed(4)}${w.fill}`,this._prevEntity.polygon.height=o,f&&typeof f=="function"&&f({volume:C,unit:w})}};K0.prototype.getPointsInPolygon=function(o,f=50,m=!0){if(o.length<3)return;o.push(o[0]);let v=ra.lineString(o),y=ra.bbox(v),x=ra.pointGrid(y,f,{units:"meters"}),C=ra.polygon([o]),w=ra.pointsWithinPolygon(x,C);if(m)for(let A=0;A<o.length-1;A++){let E=ra.lineString([o[A],o[A+1]]),T={units:"meters"},S=ra.length(E,T),M;for(let I=f;;I+=f)if(I<=S)M=ra.along(E,I,T),w.features.push(M);else{M=ra.along(E,S,T),w.features.push(M);break}}return w};K0.prototype.tinFromPoints=function(o,f={}){let{polygon:m,getArea:v}=f,y=ra.tin(o),x=0;return y&&y.features&&y.features.forEach(C=>{let w=!0;if(m){let A=ra.centerOfMass(C);w=ra.booleanPointInPolygon(A,m)}if(w){let A=C.geometry.coordinates[0],E=[],T=[];for(let S=0;S<3;S++)E.push([A[S][0],A[S][1]]),T.push(H.fromDegrees(A[S][0],A[S][1],A[S][2]));C.positions=T,v&&(C.area=this.getArea(E,T,!0),x+=C.area)}}),{tin:y,area:x}};K0.prototype.getArea=function(o,f,m){if(o.length<3)return;o.push(o[0]);let v=o,y=0,x=ra.polygon([v]),C;v.length===4?C=[x]:C=ra.tesselate(x).features;let w,A,E,T;return C.forEach(S=>{w=S.geometry.coordinates[0],A=v.findIndex(L=>L.toString()===w[0].toString()),E=v.findIndex(L=>L.toString()===w[1].toString()),T=v.findIndex(L=>L.toString()===w[2].toString());let M=this.getdistance(f[A],f[E]),I=this.getdistance(f[E],f[T]),P=this.getdistance(f[A],f[T]),D=(M+I+P)/2;y+=Math.sqrt(D*((D-M)*(D-I)*(D-P)))}),m||(y<1e6?y=`${y.toFixed(2)}${this._earthCtrl.language.UNIT_SQUARE_METER}`:y=`${(y/1e6).toFixed(2)}${this._earthCtrl.language.UNIT_SQUARE_KILOMETER}`),y};K0.prototype.getdistance=function(o,f){let m=Mt.fromCartesian(o),v=Mt.fromCartesian(f),y=new Im;y.setEndPoints(m,v);let x=y.surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(v.height-m.height,2)),x};var Cmt=K0;function bd(o,f={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Z(f,{}),this._Tooltip=new R_(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Z(this.options.drawColor?.point,Re.BLUE),polyline:Z(this.options.drawColor?.polyline,Re.YELLOW),polygon:Z(this.options.drawColor?.polygon,Re.YELLOW.withAlpha(.5))},this.selectDatum=!0,this.onlyTerrain=!0,this.tin=!1,this._volumeTin=[],this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Z(f.modelArr,[]),this._isFlattening=Z(f.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Z(f.wallImgUrl,null),this.bottomImgUrl=Z(f.bottomImgUrl,null),this.calculate=Z(f.calculate,!0),this._Loading=Z(f.loading,!0),this.editPoint=[],this.nowPoint=null,this.hierarchy=[],this._originHeight=null}bd.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._prevEntity1!==void 0&&(this._viewer.entities.remove(this._prevEntity1),this._prevEntity1=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(o=>{this._viewer.entities.remove(o)}),this._volumeTin=[],this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};bd.prototype.removeFromMap=function(){if(this.endEdit(),this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};bd.prototype.deleteObject=bd.prototype.removeFromMap;bd.prototype.startDrawing=function(o={},f){let m=Z(o.spacing,"auto"),v=this._scene,y=this._tooltip,x=3,C=[],w=[],A=[],E=[],T=[],S;this._Apositions=o.positions,this._positions=w,this._hierarchy=A,this._heightsort=E,this._degreesArr=T,this._deepth=Z(o.deepth,100),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg,this.tin=Z(o.tin,!1),this.onlyTerrain=Z(o.onlyTerrain,!1),this.selectDatum=Z(o.selectDatum,!1);let M=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let I=H.fromDegreesArray(o.positions);for(let P of I)w.push(P);if(!(w.length<x)){for(let P=0;P<o.positions.length;P+=2)T.push([o.positions[P],o.positions[P+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:H.fromDegreesArray(o.positions),material:M._drawColor.polygon,fill:!0}});for(let P=0;P<o.positions.length;P+=2){let D=M._viewer.scene.sampleHeight(new Mt(xe.toRadians(o.positions[P]),xe.toRadians(o.positions[P+1])));E.push(D),A.push(o.positions[P],o.positions[P+1],D)}this.stopDrawing(m,P=>{f&&f(P)})}}else{let I=new Ur(v.canvas);this._mouseHandler=I,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let P;I.setInputAction(function(L){if(L.position!==null){let R=v.camera.getPickRay(L.position),O=v.globe.pick(R,v);if(this._viewer.scene.pick(L.position)){let k=this._viewer.scene.pickPosition(L.position);k&&(O=k)}if(O){let k=Mt.fromCartesian(O),U=xe.toDegrees(k.longitude),G=xe.toDegrees(k.latitude);if(C.length===0&&(C.push(U,G),T.push([U,G]),w.push(O),S=O),w.length>=4){let j=nl.wgs84ToWindowCoordinates(this._viewer.scene,S);if(j!==void 0){let q=j.x-L.position.x,J=j.y-L.position.y;if(q*q+J*J<16){C.splice(C.length-2,2),w.pop(),this.stopDrawing(f);return}}}C.push(U,G),T.push([U,G]),w.push(O),w.length===2&&!P&&(P=this._viewer.entities.add({name:`${this._earthCtrl.language.TOOLS_VOLUMETRIC_TEMP_LINE_NAME}`,polyline:{positions:new xn(function(){return w},!1),clampToGround:!0,material:M._drawColor.polygon,width:3}})),w.length===x&&(P&&this._viewer.entities.remove(P),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new ho(H.fromDegreesArray(C)),material:M._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new xn(()=>new ho(H.fromDegreesArray(C)),!1))}}}.bind(this),Ei.LEFT_CLICK),I.setInputAction(function(L){let R=L.endPosition;if(R!==null)if(w.length===0)y.showAt(R,`${M._earthCtrl.language.TOOLS_VOLUMETRIC_CLICK_TO_DRAW}`);else{let O=v.camera.getPickRay(R),F=v.globe.pick(O,v),k=this._viewer.scene.pick(R),U=!1;if(k){let G=this._viewer.scene.pickPosition(R);G&&(F=G),U=!0}if(F){let G=Mt.fromCartesian(F),j=xe.toDegrees(G.longitude),q=xe.toDegrees(G.latitude);if(C.splice(C.length-2,2),T.pop(),w.pop(),C.push(j,q),T.push([j,q]),w.push(F),y.showAt(R,`${M._earthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`),w.length>=3&&w.length>=4){let J=nl.wgs84ToWindowCoordinates(this._viewer.scene,S);if(J!==void 0){let X=J.x-R.x,Y=J.y-R.y;X*X+Y*Y<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ei.MOUSE_MOVE);let D=null;I.setInputAction(function(L){D=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ei.RIGHT_CLICK),I.setInputAction(function(L){console.log("\u53CC\u51FB......"),clearTimeout(D)},Ei.LEFT_DOUBLE_CLICK),this.end=L=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),M._viewer.container.style.cursor="default",this._tooltip.show(!1),P&&this._viewer.entities.remove(P),this.end=void 0,console.log(T,"?????????"),!(w.length<x)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=H.fromDegreesArray(C)),L==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let R=0;R<C.length;R+=2){let O=M._viewer.scene.sampleHeight(new Mt(xe.toRadians(C[R]),xe.toRadians(C[R+1])));E.push(O),A.push(C[R],C[R+1],O)}this._Apositions=C,this.stopDrawing(m,f)}}}return this};bd.prototype.stopDrawing=function(o,f){let m=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._volumeTin.forEach(v=>{this._viewer.entities.remove(v)}),this._volumeTin=[],this._Loading&&this.isLoading(!0),setTimeout(()=>{m._heightsort.sort(function(P,D){return P-D});let v=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new xn(function(){return new ho(H.fromDegreesArrayHeights(m._hierarchy))},!1),material:new Pp({image:Z(m.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new Ye(1,1)})}});m.FlattenPolygon.push(v),m.originHeight=m._heightsort[0];let y=H.fromDegreesArrayHeights(m._hierarchy);y.push(y[0]),m._positionsB=y;let x=null,C,w,A,E,T,S;for(let P=0;P<y.length-1;P++){C=Mt.fromCartesian(y[P]),w=Mt.fromCartesian(y[P+1]),A=xe.toDegrees(C.longitude),T=xe.toDegrees(C.latitude),E=xe.toDegrees(w.longitude),S=xe.toDegrees(w.latitude),x?x=x>w.height?w.height:x:x=C.height>w.height?w.height:C.height;let D=m.getPoint(A,T,E,S,C.height,w.height),L=[],R=[];m.getHeightsFromLonLat(D.positions,function(O){if(O){L=O;for(let F=0;F<L.length;F++)R.push(m._heightsort[0]-m._deepth);m.drawwall(D.wallJwd,L,R)}})}if(m._baseHeight=m._heightsort[0]-m._deepth,v.polygon.height=m._baseHeight,!this.calculate)return m._isFlattening&&m.modelCutting(),f&&f(!0),this.isLoading(!1);let M=this.computeCutVolume(o,this.onlyTerrain),I=P=>{let D=P.maxHeight,L=P.minHeight;if(this._prevEntity.polygon.height=P.minHeight,this._prevEntity.polygon.heightReference=0,this.selectDatum){let R=()=>{this.addPoint(O=>{this.setDatum(O,F=>{typeof f=="function"&&f({...P,...F}),R()})})};R()}};this.onlyTerrain?M.then(P=>{I(P)}):I(M),m.setDatum(m._baseHeight,P=>{m._isFlattening&&m.modelCutting(),f&&f(P),this._Loading&&this.isLoading(!1)})},100)};bd.prototype.modelCutting=function(){let o=this;if(o._modelCuttingPolygon=Ec.fromPositions({positions:H.fromDegreesArray(o._Apositions),height:o._baseHeight}),o._modelArr.length>0)for(let f of o._modelArr)f.addFlattenPolygon(o._modelCuttingPolygon),f.needUpdateFlatten=!0,f.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};bd.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let f of o._modelArr)f.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[]}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};bd.prototype.computeCentroidOfPolygon=function(o){let f=[],m=[],v=0,y=0;for(let w=0;w<o.length;w++){let A=Mt.fromCartesian(o[w]);v+=A.longitude,y+=A.latitude,f.push(A.longitude),m.push(A.latitude)}let x=0,C=0;return x=v/o.length,C=y/o.length,new Mt(x,C)};bd.prototype.edit=function(o,f,m){let v=this,y=v.editPoint,x=v.nowPoint;if(v._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!1,x){for(let A of v.editPoint)A&&(A.show=!0);v.update(x,y,o);return}for(let A=2;A<v._hierarchy.length;A=A+3)v._hierarchy[A]=v.originHeight-v._deepth;v.FlattenPolygon[0]&&v._viewer.entities.remove(v.FlattenPolygon[0]),v.FlattenPolygon=[];let C=this._viewer.entities.add({name:null,id:v._earthCtrl.factory.createUUID(),polygon:{hierarchy:new ho(H.fromDegreesArrayHeights(v._hierarchy)),material:new Pp({image:Z(v.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new Ye(1,1)}),perPositionHeight:!0}});v.FlattenPolygon.push(C);let w=v.FlattenPolygon[0].polygon.hierarchy.getValue();for(let A of w.positions){let E=this._viewer.entities.add({id:v._earthCtrl.factory.createUUID(),position:A,point:{color:Re.WHITE,pixelSize:12,outlineColor:Re.BLACK,outlineWidth:1}});y.push(E)}if(o)if(f){for(let A of y)if(f===A.id){v.nowPoint=A,v.update(A,y,o);return}}else v._earthCtrl.measure.pickObject(null,function(A){let E=A.pickedObject.id;for(let T of y)if(E.id===T.id){v.nowPoint=T,v.update(T,y,o);return}});else m&&m(y)};bd.prototype.update=function(o,f,m){let v=this,y=o.position.getValue(),C=v._scene.globe.ellipsoid.cartesianToCartographic(y),w=xe.toDegrees(C.longitude),A=xe.toDegrees(C.latitude),E=C.height;o.position.setValue(H.fromDegrees(w,A,E+m)),v.editPoint=f,v.editPosition=[];let T=[];for(let M of f){let I=M.position.getValue();T.push(I),v.editPosition.push(I)}v.FlattenPolygon[0].polygon.hierarchy=new xn(function(){return new ho(T)},!0);let S=v.editPosition;S.push(S[0]);for(let M=0;M<S.length-1;M++){let P=[];for(let D=0;D<=160;D++){let L=H.lerp(S[M],S[M+1],D/160,new H),R=Mt.fromCartesian(L);P.push(R.height)}v.wallArr[M].wall.minimumHeights.setValue(P)}};bd.prototype.endEdit=function(){let o=this;if(o._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain=!0,o.editPoint.length>0)for(let f of o.editPoint)f&&(f.show=!1)};bd.prototype.computeCutVolume=function(o,f){let m=this,v=15e3,y=-15e3;o==="auto"&&(o=Pi.fromPoints(this._positions).radius/20);let x=this.getPointsInPolygon(this._degreesArr,o,!0),C=ra.polygon([this._degreesArr]),w=()=>{let{tin:A}=this.tinFromPoints(x,{getArea:!0,polygon:C});this.tinData=A;let E={fill:0,dig:0},T={fill:`${m._earthCtrl.language.UNIT_CUBIC_METER}`,dig:`${m._earthCtrl.language.UNIT_CUBIC_METER}`},S,M,I,P,D,L={fill:1,dig:1};this.Triangulation=[],A.features.forEach(O=>{if(O.positions){if(this.tin){let k=this._viewer.entities.add({polygon:{hierarchy:new ho(O.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:Re.YELLOW}});this._volumeTin.push(k)}let F=O.geometry.coordinates[0];S=F[0][2],M=F[1][2],I=F[2][2],D=O.area,this.Triangulation.push({bottomArea:D,height:[S,M,I]}),P=(S-v+M-v+I-v)/3,P>0?E.dig=E.dig+D*P*L.dig:E.fill=E.fill-D*P*L.fill,E.dig>1e10&&T.dig===`${m._earthCtrl.language.UNIT_CUBIC_METER}`&&(E.dig=E.dig/1e9,T.dig=`${m._earthCtrl.language.UNIT_CUBIC_KILOMETER}`,L.dig=1e-9),E.fill>1e10&&T.fill===`${m._earthCtrl.language.UNIT_CUBIC_METER}`&&(E.fill=E.fill/1e9,T.fill=`${m._earthCtrl.language.UNIT_CUBIC_KILOMETER}`,L.fill=1e-9)}});let R=this.computeCentroidOfPolygon(this._positions);return this._volumeLabel=this._viewer.entities.add({position:H.fromRadians(R.longitude,R.latitude,y),label:{text:`${m._earthCtrl.language.TOOLS_VOLUMETRIC_CUT_VOLUMETRIC}${E.dig.toFixed(4)}${T.dig}`,pixelOffset:{x:0,y:-30},font:"16px \u5B8B\u4F53",fillColor:Re.GOLD,verticalOrigin:so.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),this._volumeLabel1=this._viewer.entities.add({position:H.fromRadians(R.longitude,R.latitude,y),label:{text:`${m._earthCtrl.language.TOOLS_VOLUMETRIC_FILL_VOLUMETRIC}${E.fill.toFixed(4)}${T.fill}`,pixelOffset:{x:0,y:-70},font:"16px \u5B8B\u4F53",fillColor:Re.GOLD,verticalOrigin:so.BOTTOM,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),{maxHeight:y,minHeight:v,volume:E,unit:T,spacing:o}};if(f){let A=[];return x.features.forEach(T=>{let S=T.geometry.coordinates;A.push(Mt.fromDegrees(S[0],S[1]))}),xT(this._viewer.scene.globe.terrainProvider,A).then(T=>(x.features.forEach((S,M)=>{let I=S.geometry.coordinates;I[2]=T[M]&&T[M].height?T[M].height:0,y<I[2]&&(y=I[2]),v>I[2]&&(v=I[2])}),w()))}return x.features.forEach(A=>{let E=A.geometry.coordinates,T=new Mt(xe.toRadians(E[0]),xe.toRadians(E[1]));E[2]=this._viewer.scene.sampleHeight(T)||0,y<E[2]&&(y=E[2]),v>E[2]&&(v=E[2])}),w()};bd.prototype.getPoint=function(o,f,m,v,y,x){let C=this,w=160,A=xe.lerp(o,m,1/w)-o,E=xe.lerp(f,v,1/w)-f,T=[],S=[],M=[],I;T.push(o,f),I=H.fromDegrees(o,f),S.push(Mt.fromCartesian(I));for(let P=0;P<w;P++){let D=o+(P+1)*A,L=f+(P+1)*E;T.push(D,L),I=H.fromDegrees(D,L),S.push(Mt.fromCartesian(I))}return T.push(m,v),I=H.fromDegrees(m,v),S.push(Mt.fromCartesian(I)),{wallJwd:T,positions:S}};bd.prototype.getHeightsFromLonLat=function(o,f){let m=this._viewer,v=[];o.forEach(function(y){v.push(m.scene.sampleHeight(new Mt(y.longitude,y.latitude)))}),typeof f=="function"&&f(v)};bd.prototype.isHaveTerrain=function(){return!!(this._viewer.scene&&this._viewer.scene.terrainProvider&&this._viewer.scene.terrainProvider._layers)};bd.prototype.drawwall=function(o,f,m){let v=this,y=v._viewer.entities.add({wall:{positions:new xn(function(){return H.fromDegreesArray(o)},!1),maximumHeights:f,minimumHeights:m}}),x=y.wall;x.material=new Pp({image:Z(v.wallImgUrl,`${window.SmartEarthRootUrl}Workers/image/dzmc.jpg`),repeat:new Ye(1,1)}),v.wallArr.push(y)};bd.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=this.loadingImg,o.appendChild(f),this.loading=o,this._viewer.container.appendChild(o)};bd.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};bd.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};bd.prototype.addPoint=function(o){this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=null),this._prevEntity1&&(this.addPointHandle=new Ur(this._viewer.scene.canvas),this.addPointHandle.setInputAction(function(f){let m=this._viewer.scene.pick(f.position);if(m&&m.id&&m.id.id===this._prevEntity1.id){let v=this._viewer.scene.pickPosition(f.position);if(v){let y=Mt.fromCartesian(v);this.addPointHandle.destroy(),this.addPointHandle=null,o&&typeof o=="function"&&o(y.height.toFixed(1))}}}.bind(this),Ei.LEFT_CLICK),this.addPointHandle.setInputAction(function(f){let m=this._viewer.scene.pick(f.endPosition);m&&m.id&&m.id.id===this._prevEntity1.id?this._tooltip.showAt(f.endPosition,`${this._earthCtrl.language.TOOLS_VOLUMETRIC_CLICK_TO_MODIFY_BASE_PLANE}`):this._tooltip.show(!1)}.bind(this),Ei.MOUSE_MOVE))};bd.prototype.showTin=function(o){this.tin=o,this._volumeTin.forEach(f=>{this._viewer.entities.remove(f)}),this._volumeTin=[],o&&this.tinData&&this.tinData.features.forEach(f=>{if(f.positions){let m=this._viewer.entities.add({polygon:{hierarchy:new ho(f.positions),material:this._drawColor.polygon,perPositionHeight:!0,outline:!0,outlineColor:Re.YELLOW}});this._volumeTin.push(m)}})};bd.prototype.setDatum=function(o,f){if(this.Triangulation&&this.Triangulation.length>0){let m=this,v,y,x,C={fill:0,dig:0},w={fill:`${this._earthCtrl.language.UNIT_CUBIC_METER}`,dig:`${this._earthCtrl.language.UNIT_CUBIC_METER}`},A={fill:1,dig:1};this.Triangulation.forEach(function(E){v=E.bottomArea,y=E.height,x=(y[0]-o+y[1]-o+y[2]-o)/3,x>0?C.dig=C.dig+v*x*A.dig:C.fill=C.fill-v*x*A.fill,C.dig>1e10&&w.dig===`${m._earthCtrl.language.UNIT_CUBIC_METER}`&&(C.dig=C.dig/1e9,w.dig=`${m._earthCtrl.language.UNIT_CUBIC_KILOMETER}`,A.dig=1e-9),C.fill>1e10&&w.fill===`${m._earthCtrl.language.UNIT_CUBIC_METER}`&&(C.fill=C.fill/1e9,w.fill=`${m._earthCtrl.language.UNIT_CUBIC_KILOMETER}`,A.fill=1e-9)}),this._volumeLabel.label.text=`${m._earthCtrl.language.TOOLS_VOLUMETRIC_CUT_VOLUMETRIC}${C.dig.toFixed(4)}${w.dig}`,this._volumeLabel1.label.text=`${m._earthCtrl.language.TOOLS_VOLUMETRIC_FILL_VOLUMETRIC}${C.fill.toFixed(4)}${w.fill}`,this._prevEntity.polygon.height=o,f&&typeof f=="function"&&f({volume:C,unit:w})}};bd.prototype.getPointsInPolygon=function(o,f=50,m=!0){if(o.length<3)return;o.push(o[0]);let v=ra.lineString(o),y=ra.bbox(v),x=ra.pointGrid(y,f,{units:"meters"}),C=ra.polygon([o]),w=ra.pointsWithinPolygon(x,C);if(m)for(let A=0;A<o.length-1;A++){let E=ra.lineString([o[A],o[A+1]]),T={units:"meters"},S=ra.length(E,T),M;for(let I=f;;I+=f)if(I<=S)M=ra.along(E,I,T),w.features.push(M);else{M=ra.along(E,S,T),w.features.push(M);break}}return w};bd.prototype.tinFromPoints=function(o,f={}){let{polygon:m,getArea:v}=f,y=ra.tin(o),x=0;return y&&y.features&&y.features.forEach(C=>{let w=!0;if(m){let A=ra.centerOfMass(C);w=ra.booleanPointInPolygon(A,m)}if(w){let A=C.geometry.coordinates[0],E=[],T=[];for(let S=0;S<3;S++)E.push([A[S][0],A[S][1]]),T.push(H.fromDegrees(A[S][0],A[S][1],A[S][2]));C.positions=T,v&&(C.area=this.getArea(E,T,!0),x+=C.area)}}),{tin:y,area:x}};bd.prototype.getArea=function(o,f,m){if(o.length<3)return;o.push(o[0]);let v=o,y=0,x=ra.polygon([v]),C;v.length===4?C=[x]:C=ra.tesselate(x).features;let w,A,E,T;return C.forEach(S=>{w=S.geometry.coordinates[0],A=v.findIndex(L=>L.toString()===w[0].toString()),E=v.findIndex(L=>L.toString()===w[1].toString()),T=v.findIndex(L=>L.toString()===w[2].toString());let M=this.getdistance(f[A],f[E]),I=this.getdistance(f[E],f[T]),P=this.getdistance(f[A],f[T]),D=(M+I+P)/2;y+=Math.sqrt(D*((D-M)*(D-I)*(D-P)))}),m||(y<1e6?y=`${y.toFixed(2)}${this._earthCtrl.language.UNIT_SQUARE_METER}`:y=`${(y/1e6).toFixed(2)}${this._earthCtrl.language.UNIT_SQUARE_KILOMETER}`),y};bd.prototype.getdistance=function(o,f){let m=Mt.fromCartesian(o),v=Mt.fromCartesian(f),y=new Im;y.setEndPoints(m,v);let x=y.surfaceDistance;return x=Math.sqrt(Math.pow(x,2)+Math.pow(v.height-m.height,2)),x};var bmt=bd;function Sb(o,f={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Z(f,{}),this._modelArr=[],this._Apositions=[],this.FlattenPolygon=[],this._Loading=Z(f.loading,!1),this.modelCuttingPolygons=[],this._bottom=Z(f.bottom,!1),this.loadingImg=Z(f.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new R_(o),this._tool=new ls(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=100,this._drawColor={point:Z(this.options.drawColor?.point,Re.BLUE),polyline:Z(this.options.drawColor?.polyline,Re.YELLOW),polygon:Z(this.options.drawColor?.polygon,Re.YELLOW.withAlpha(.5))}}Sb.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};Sb.prototype.startDrawing=function(o={},f){let m=this._scene,v=this._tooltip,y=this._tool,x=3,C,w=[],A=[],E=[],T=[],S=[];this._positions=A,this._hierarchy=E,this._heightsort=T,this._degreesArr=S,this._deepth=Z(o.deepth,100),this._modelArr=Z(o.modelArr,[]);let M=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let I=P=>{let D=H.fromDegreesArray(P);for(let L of D)A.push(L);if(!(A.length<x)){for(let L=0;L<P.length;L+=2)S.push([P[L],P[L+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:H.fromDegreesArray(P),material:M._drawColor.polygon,fill:!0}});for(let L=0;L<P.length;L+=2){let R=M._viewer.scene.sampleHeight(new Mt(xe.toRadians(P[L]),xe.toRadians(P[L+1])));T.push(R),E.push(P[L],P[L+1],R)}this._Apositions=P,this.stopDrawing(this._Apositions,L=>{f&&f(L)})}};o.positions[0]instanceof Array?o.positions.forEach(P=>{I(P)}):I(o.positions)}else{let I=new Ur(m.canvas);this._mouseHandler=I,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let P;I.setInputAction(function(D){if(D.position!==null){let L=y.pickVector(D.position);if(L){let R=Mt.fromCartesian(L),O=xe.toDegrees(R.longitude),F=xe.toDegrees(R.latitude);if(w.length===0&&(w.push(O,F),S.push([O,F]),A.push(L),C=L),A.length>=4){let k=nl.wgs84ToWindowCoordinates(this._viewer.scene,C);if(k!==void 0){let U=k.x-D.position.x,G=k.y-D.position.y;if(U*U+G*G<16){w.splice(w.length-2,2),A.pop(),this.stopDrawing(this._Apositions,f);return}}}w.push(O,F),S.push([O,F]),A.push(L),A.length===2&&!P&&(P=this._viewer.entities.add({name:`${M._earthCtrl.language.TOOLS_VOLUMETRIC_TEMP_LINE_NAME}`,polyline:{positions:new xn(function(){return A},!1),clampToGround:!0,material:M._drawColor.polygon,width:3}})),A.length===x&&(P&&this._viewer.entities.remove(P),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new ho(H.fromDegreesArray(w)),material:M._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new xn(()=>new ho(H.fromDegreesArray(w)),!1))}}}.bind(this),Ei.LEFT_CLICK),I.setInputAction(function(D){let L=D.endPosition;if(L!==null)if(A.length===0)v.showAt(L,`${M._earthCtrl.language.TOOLS_VOLUMETRIC_CLICK_TO_DRAW}`);else{let R=y.pickVector(L);if(R){let O=Mt.fromCartesian(R),F=xe.toDegrees(O.longitude),k=xe.toDegrees(O.latitude);if(w.splice(w.length-2,2),S.pop(),A.pop(),w.push(F,k),S.push([F,k]),A.push(R),v.showAt(L,`${M._earthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`),A.length>=3&&A.length>=4){let U=nl.wgs84ToWindowCoordinates(this._viewer.scene,C);if(U!==void 0){let G=U.x-L.x,j=U.y-L.y;G*G+j*j<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ei.MOUSE_MOVE),I.setInputAction(function(D){this.end&&this.end()}.bind(this),Ei.RIGHT_CLICK),this.end=D=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),M._viewer.container.style.cursor="default",this._tooltip.show(!1),P&&this._viewer.entities.remove(P),this.end=void 0,!(A.length<x)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=H.fromDegreesArray(w)),D==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let L=0;L<w.length;L+=2){let R=M._viewer.scene.sampleHeight(new Mt(xe.toRadians(w[L]),xe.toRadians(w[L+1])));T.push(R),E.push(w[L],w[L+1],R)}this._Apositions=w,this.stopDrawing(this._Apositions,f)}}}};Sb.prototype.stopDrawing=function(o,f){let m=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{m._heightsort.sort(function(y,x){return y-x});let v=null;m._bottom?(v=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new xn(function(){return new ho(H.fromDegreesArrayHeights(m._hierarchy))},!1),material:new Pp({image:Z(m.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new Ye(1,1)})}}),m._baseHeight=m._heightsort[0]-m._deepth,v.polygon.height=m._baseHeight):v=this._viewer.entities.add({name:null,id:m._earthCtrl.factory.createUUID(),polygon:{hierarchy:new xn(function(){return new ho(H.fromDegreesArrayHeights(m._hierarchy))},!1),material:Re.YELLOW.withAlpha(0)}}),m.FlattenPolygon.push(v),m.modelCutting(o)})};Sb.prototype.modelCutting=function(o){for(let m=0;m<o.length-2;m+=2){let v=`${o[m]}_${o[m+1]}`,y=`${o[m+2]}_${o[m+3]}`;v===y&&(o.splice(m,2),m-=2)}let f=this;if(f._modelCuttingPolygon=Ec.fromPositions({positions:H.fromDegreesArray(o),height:f._baseHeight}),this.modelCuttingPolygons.push(f._modelCuttingPolygon),f._modelArr.length>0)for(let m of f._modelArr)m.SetClipPlane?f.cuttingBim(m,o):(m.addFlattenPolygon(f._modelCuttingPolygon),m.needUpdateFlatten=!0,m.clipPlaneOfFlatten=!0);else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};Sb.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let f of o._modelArr)for(let m of this.modelCuttingPolygons)f.SetClipPlane?(f.clipedPlanes=[],console.log("bimCutting is delete"),f.SetClipPlane([],!1)):f.removeFlattenPolygon(m);o._modelCuttingPolygon=null,o._modelArr=[]}};Sb.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};Sb.prototype.cuttingBim=function(o,f){o.clipedPlanes=[];let m=[],v=new H(o.modelBoxCenter[0],o.modelBoxCenter[1],o.modelBoxCenter[2]),y=Mt.fromCartesian(v),x={lon:xe.toDegrees(y.longitude),lat:xe.toDegrees(y.latitude),hei:y.height};v=H.fromDegrees(x.lon,x.lat,x.hei);let C=[];for(let E=0;E<f.length;E+=2)C.push([f[E],f[E+1]]);if(C.push([f[0],f[1]]),!ra.booleanClockwise(C)&&C.reverse(),C.length>20){console.warn("\u62B1\u6B49,BIM\u6682\u4E0D\u652F\u6301\u8D85\u8FC720\u4E2A\u70B9\u4EE5\u4E0A\u7684\u5256\u5207");return}for(let E=0;E<C.length-1;E++)this.createBimPlane(C[E][0],C[E][1],C[E+1][0],C[E+1][1],v,x,m);o.clipedPlanes.push(...m);let A=tn.eastNorthUpToFixedFrame(v);A=Ee.toArray(A),this.setclipPlaneArray(o,A,!1,o.clipedPlanes)};Sb.prototype.createBimPlane=function(o,f,m,v,y,x,C){let w=m-o,A=v-f,E=new H(w,A,x.hei);E=H.cross(E,H.UNIT_Z,new H);let T=H.fromDegrees(o,f,x.hei),S=H.fromDegrees(m,v,x.hei),M=H.cross(H.subtract(T,S,new H(0,0,0)),H.UNIT_Z,new H);H.normalize(E,E),M=H.normalize(M,M);let I=ra.point([x.lon,x.lat]),P=ra.lineString([[o,f],[m,v]]),D=ra.pointToLineDistance(I,P,{units:"meters"}),L=new _s(y,M),R=_s.getPoint(L,D-1),O=Mt.fromCartesian(R),F={lon:xe.toDegrees(O.longitude),lat:xe.toDegrees(O.latitude),hei:10},k=ra.point([F.lon,F.lat]);ra.pointToLineDistance(k,P,{units:"meters"})>D&&(D=-D),C.push([E.x,E.y,E.z,D])};Sb.prototype.setclipPlaneArray=function(o,f,m,v){if(f&&Array.isArray(f)&&v&&Array.isArray(v)&&v.length>0){o.clipPlaneTransform=f,o.clipPlane[0]=0;let y=0;for(let x=0;x<v.length;x++)o.clipPlane.set(v[x],y*4+1),y++;o.clipPlane[0]=y*(m?-1:1)}else o.clipPlane[0]=0;o.render.ClipPlaneTransformToVisibleModelBoxCenter()};Sb.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=this.loadingImg,o.appendChild(f),this.loading=o,this._viewer.container.appendChild(o)};Sb.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Sb.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var wmt=Sb;function cG(o,f,m){if(this._earthCtrl=o,this._viewer=o.coreMap,this.scene=o.coreMap.scene,this.camera=o.coreMap.camera,this.positions=[],f)f instanceof Array?this._tileset=f:this._tileset=[f];else{this._tileset=[];let v=this._viewer.scene.primitives._primitives;for(let y=1;y<v.length;y++)v[y]instanceof pg&&this._tileset.push(v[y])}this.polygonArr=[],this._tileset.length>0&&(this.isNoneModel=!1,m.polygon&&m.polygon.length?m.polygon[0]instanceof Array?m.polygon.forEach(v=>{this.addFlatten(m,v)}):this.addFlatten(m,m.polygon):this.drawFlatten(m)),this.editHandler=null}cG.prototype.drawFlatten=function(o={}){let f=null,m=!0;this.editHandler||(this.editHandler=new Ur(this.scene.canvas)),this._earthCtrl.factory.SimpleGraphic.edit(!1,{editProp:!1});let v=this._earthCtrl.factory.createSimpleGraphic("polygon",{clampToGround:!0},x=>{let C=x.polygon.hierarchy.getValue().positions,w=[];m=!1;for(let T of C){let M=this.scene.globe.ellipsoid.cartesianToCartographic(T),I=xe.toDegrees(M.longitude),P=xe.toDegrees(M.latitude);w.push(I,P)}this.positions=w;let A=Ec.fromPositions({positions:H.fromDegreesArray(w),height:f+o.height}),E=this._earthCtrl.factory.createUUID();A.id=E,this.polygonArr.push({id:E,polygon:A});for(let T=0;T<this._tileset.length;T++)this._tileset[T]._primitive?(this._tileset[T]._primitive.addFlattenPolygon(A),this._tileset[T]._primitive.needUpdateFlatten=!0,this._tileset[T]._primitive.clipPlaneOfFlatten=!1):this._tileset[T]&&(this._tileset[T].addFlattenPolygon(A),this._tileset[T].needUpdateFlatten=!0,this._tileset[T].clipPlaneOfFlatten=!1);this._earthCtrl.factory.SimpleGraphic.clear()}),y=this;this.editHandler.setInputAction(x=>{if(m){let C=y.getMousePosition(x);if(C){let w=Mt.fromCartesian(C);f?w.height<f&&(f=w.height):f=w.height}}},Ei.LEFT_DOWN)};cG.prototype.addFlatten=function(o={},f){let m=null,v=!0;this.editHandler||(this.editHandler=new Ur(this.scene.canvas));let y=Ec.fromPositions({positions:H.fromDegreesArray(f),height:m+o.height}),x=this._earthCtrl.factory.createUUID();y.id=x,this.polygonArr.push({id:x,polygon:y});for(let w=0;w<this._tileset.length;w++)this._tileset[w]._primitive?(this._tileset[w]._primitive.addFlattenPolygon(y),this._tileset[w]._primitive.needUpdateFlatten=!0,this._tileset[w]._primitive.clipPlaneOfFlatten=!1):this._tileset[w]&&(this._tileset[w].addFlattenPolygon(y),this._tileset[w].needUpdateFlatten=!0,this._tileset[w].clipPlaneOfFlatten=!1);let C=this;this.editHandler.setInputAction(w=>{if(v){let A=C.getMousePosition(w);if(A){let E=Mt.fromCartesian(A);m?E.height<m&&(m=E.height):m=E.height}}},Ei.LEFT_DOWN)};cG.prototype.allFlatten=function(o={}){let f=null,m=this._viewer.scene.primitives._primitives;for(let v=1;v<m.length;v++){let y=[],x=null;if(m[v].boundingSphere&&(x=m[v].boundingSphere.center),x){let C=Mt.fromCartesian(x);C={longitude:xe.toDegrees(C.longitude),latitude:xe.toDegrees(C.latitude),height:C.height};let w=m[v].boundingSphere.radius/111e3;y.push(C.longitude-w),y.push(C.latitude-w),y.push(C.longitude+w),y.push(C.latitude-w),y.push(C.longitude+w),y.push(C.latitude+w),y.push(C.longitude-w),y.push(C.latitude+w),f=C.height;let A=Ec.fromPositions({positions:H.fromDegreesArray(y),height:f+o.height}),E=this._earthCtrl.factory.createUUID();A.id=E,this.polygonArr.push({id:E,polygon:A}),m[v].addFlattenPolygon(A),m[v]._needUpdateFlatten=!0}}};cG.prototype.remove=function(){let o=this.polygonArr;if(o.length!==0){if(this.isNoneModel){let f=this._viewer.scene.primitives._primitives;for(let m=1;m<f.length;m++)if(f[m].addFlattenPolygon)for(let v of o)f[m].removeFlattenPolygon(v)}else for(let f=0;f<this._tileset.length;f++)for(let m of o)this._tileset[f]._primitive?this._tileset[f]._primitive.removeFlattenPolygon(m):this._tileset[f].item&&this._tileset[f].item.removeFlattenPolygon(m);this.editHandler=void 0}};cG.prototype.getMousePosition=function(o,f){let m=o.endPosition||o.position||o;this.defaultDepthTest===void 0&&(this.defaultDepthTest=!!this.scene.globe.depthTestAgainstTerrain);let v=this.camera.getPickRay(m);f&&!Array.isArray(f)&&(f=[f]);let y=this.scene.pickPosition(m);y?y={position:y}:(this.scene.globe.depthTestAgainstTerrain=!0,y=this.scene.pickFromRay(v,f));let x;if(!y||!y.position||!this.scene.globe.depthTestAgainstTerrain?x=this.scene.globe.pick(v,this.scene):x=y.position,this.scene.globe.depthTestAgainstTerrain=!!this.defaultDepthTest,this.defaultDepthTest=void 0,!x){console.log("\u672A\u62FE\u53D6\u5230\u5750\u6807\uFF01");return}return x};var Amt=cG;function UP(o,f={}){this._earthCtrl=o,this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Z(f,{}),this._Apositions=[],this.FlattenPolygon=[],this._terrainFlatten=new xD(o.coreMap.scene),this._Loading=Z(f.loading,!1),this._bottom=Z(f.bottom,!1),this.loadingImg=Z(f.loadingImg,`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`),this._Tooltip=new R_(o),this._tooltip=this._Tooltip.CreateTooltip(),this._positions=[],this._deepth=10,this._drawColor={point:Z(this.options.drawColor?.point,Re.BLUE),polyline:Z(this.options.drawColor?.polyline,Re.YELLOW),polygon:Z(this.options.drawColor?.polygon,Re.YELLOW.withAlpha(.5))}}UP.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};UP.prototype.startDrawing=function(o={},f){let m=this._scene,v=this._tooltip,y=3,x,C=[],w=[],A=[],E=[],T=[];this._positions=w,this._hierarchy=A,this._heightsort=E,this._degreesArr=T,this._deepth=Z(o.deepth,100);let S=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),o.positions){let M=H.fromDegreesArray(o.positions);for(let I of M)w.push(I);if(!(w.length<y)){for(let I=0;I<o.positions.length;I+=2)T.push([o.positions[I],o.positions[I+1]]);this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:H.fromDegreesArray(o.positions),material:S._drawColor.polygon,fill:!0}});for(let I=0;I<o.positions.length;I+=2){let P=S._viewer.scene.sampleHeight(new Mt(xe.toRadians(o.positions[I]),xe.toRadians(o.positions[I+1])));E.push(P),A.push(o.positions[I],o.positions[I+1],P)}this._Apositions=o.positions,this.stopDrawing(I=>{f&&f(I)})}}else{let M=new Ur(m.canvas);this._mouseHandler=M,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let I;M.setInputAction(function(P){if(P.position!==null){let D=m.camera.getPickRay(P.position),L=m.globe.pick(D,m);if(this._viewer.scene.pick(P.position)){let O=this._viewer.scene.pickPosition(P.position);O&&(L=O)}if(L){let O=Mt.fromCartesian(L),F=xe.toDegrees(O.longitude),k=xe.toDegrees(O.latitude);if(C.length===0&&(C.push(F,k),T.push([F,k]),w.push(L),x=L),w.length>=4){let U=nl.wgs84ToWindowCoordinates(this._viewer.scene,x);if(U!==void 0){let G=U.x-P.position.x,j=U.y-P.position.y;if(G*G+j*j<16){C.splice(C.length-2,2),w.pop(),this.stopDrawing(f);return}}}C.push(F,k),T.push([F,k]),w.push(L),w.length===2&&!I&&(I=this._viewer.entities.add({name:`${S._earthCtrl.language.TOOLS_VOLUMETRIC_TEMP_LINE_NAME}`,polyline:{positions:new xn(function(){return w},!1),clampToGround:!0,material:S._drawColor.polygon,width:3}})),w.length===y&&(I&&this._viewer.entities.remove(I),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new ho(H.fromDegreesArray(C)),material:S._drawColor.polygon,fill:!0}}),this._prevEntity.polygon.hierarchy=new xn(()=>new ho(H.fromDegreesArray(C)),!1))}}}.bind(this),Ei.LEFT_CLICK),M.setInputAction(function(P){let D=P.endPosition;if(D!==null)if(w.length===0)v.showAt(D,`${S._earthCtrl.language.TOOLS_VOLUMETRIC_CLICK_TO_DRAW}`);else{let L=m.camera.getPickRay(D),R=m.globe.pick(L,m),O=this._viewer.scene.pick(D),F=!1;if(O){let k=this._viewer.scene.pickPosition(D);k&&(R=k),F=!0}if(R){let k=Mt.fromCartesian(R),U=xe.toDegrees(k.longitude),G=xe.toDegrees(k.latitude);if(C.splice(C.length-2,2),T.pop(),w.pop(),C.push(U,G),T.push([U,G]),w.push(R),v.showAt(D,`${S._earthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`),w.length>=3&&w.length>=4){let j=nl.wgs84ToWindowCoordinates(this._viewer.scene,x);if(j!==void 0){let q=j.x-D.x,J=j.y-D.y;q*q+J*J<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ei.MOUSE_MOVE),M.setInputAction(function(P){this.end&&this.end()}.bind(this),Ei.RIGHT_CLICK),this.end=P=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),S._viewer.container.style.cursor="default",this._tooltip.show(!1),I&&this._viewer.entities.remove(I),this.end=void 0,console.log(T,"?????????"),!(w.length<y)){if(this._prevEntity&&(this._prevEntity.polygon.hierarchy=H.fromDegreesArray(C)),P==="cancel"){this._prevEntity&&this._viewer.entities.remove(this._prevEntity);return}for(let D=0;D<C.length;D+=2){let L=S._viewer.scene.sampleHeight(new Mt(xe.toRadians(C[D]),xe.toRadians(C[D+1])));E.push(L),A.push(C[D],C[D+1],L)}this._Apositions=C,this.stopDrawing(f)}}}};UP.prototype.stopDrawing=function(o){let f=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._Loading&&this.isLoading(!0),setTimeout(()=>{f._heightsort.sort(function(y,x){return y-x});let m=null;f._bottom?(m=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new xn(function(){return new ho(H.fromDegreesArrayHeights(f._hierarchy))},!1),material:new Pp({image:Z(f.bottomImgUrl,`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`),repeat:new Ye(1,1)})}}),f._baseHeight=f._heightsort[0]-f._deepth,m.polygon.height=f._baseHeight):m=this._viewer.entities.add({name:null,id:f._earthCtrl.factory.createUUID(),polygon:{hierarchy:new xn(function(){return new ho(H.fromDegreesArrayHeights(f._hierarchy))},!1),material:Re.YELLOW.withAlpha(0)}}),f.FlattenPolygon.push(m);let v=[];f._baseHeight=f._heightsort[0]-f._deepth;for(let y=0;y<f._hierarchy.length;y+=3)v.push(f._hierarchy[y],f._hierarchy[y+1],f._baseHeight);console.log(v,"\u4F4D\u7F6E\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A\uFF1A"),f.terrainCutting(v)})};UP.prototype.terrainCutting=function(o){let f=this;f._terrainFlatten.addPolygon(o),f._terrainFlatten.update(),f._terrainFlatten.clipPlaneOfFlatten=!0};UP.prototype.removeTerrainCutting=function(){this._terrainFlatten.clearPolygon()};UP.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeTerrainCutting()};UP.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=this.loadingImg,o.appendChild(f),this.loading=o,this._viewer.container.appendChild(o)};UP.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};UP.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var Emt=UP;function iL(o,f={}){if(this._earthCtrl=o,this._scene=o.coreMap.scene,this.selectLevelColor=f.selectLevelColor,this.notSelectColor=f.notSelectColor||null,this.highlightColor=f.highlightColor||new Re.fromCssColorString("rgba(255,215,0,0.9)"),this.distance=f.distance||{x:10,y:0,z:0},console.log(f),f.model)if(f.model._root&&f.model._root.transform)this.model=f.model;else{console.log("\u6682\u4E0D\u652F\u6301\u8BE5\u6A21\u578B\u683C\u5F0F");return}else{console.log("\u6CA1\u6709\u4F20\u5165\u6A21\u578B");return}this.clonedTileset=this.cloneTileset(f.model._primitive),this._scene.primitives.add(this.clonedTileset),this.clonedTileset.style=new G2({show:!1}),this.originPosition=Ee.getTranslation(this.model._root.transform,new H)}iL.prototype.updataModel=function(o,f=[]){let m=new G2;m.color={evaluateColor:v=>{if(o!=="")return this.notSelectColor}},m.show={evaluate:function(v){return f.indexOf(v.getProperty(o))===-1}},this.model.style=m,this.selectModelShow(o,f),this.modelShowAnimation(),this.editHandler&&this.editHandler.destroy(),this.editHandler=void 0,this.editHandler=new Ur(this._scene.canvas),this.editHandler.setInputAction(v=>{let y=this._scene.pick(v.endPosition);y instanceof Qs?(this.selectFeature=!0,this.selectModelShow(o,f,y)):this.selectFeature&&(this.selectFeature=!1,this.selectModelShow(o,f))},Ei.MOUSE_MOVE)};iL.prototype.changeStyleOptions=function(o){let{selectLevelColor:f,notSelectColor:m,highlightColor:v,distance:y}=o;this.selectLevelColor=f||this.selectLevelColor,this.notSelectColor=m||this.notSelectColor,this.highlightColor=v||this.highlightColor,this.distance=y||this.distance};iL.prototype.cloneTileset=function(){let o=new pg({url:this.model._url});return o.maximumScreenSpaceError=0,o};iL.prototype.selectModelShow=function(o,f,m){let v=new G2;v.color={evaluateColor:y=>y===m?this.highlightColor:this.selectLevelColor},v.show={evaluate:function(y){return f.indexOf(y.getProperty(o))!==-1}},this.clonedTileset.style=v};iL.prototype.modelShowAnimation=function(){if(this.preUpdateListener&&this._scene.preUpdate.removeEventListener(this.preUpdateListener),this.originPosition.x===0||this.originPosition.y===0||this.originPosition.z===0){let o=this.model.boundingSphere.center,f=this.toDegrees(o),m;m=H.fromDegrees(f.lon+1e-5*this.distance.x,f.lat+1e-5*this.distance.y,f.hei+this.distance.z);let v=new H(o.x-m.x,o.y-m.y,o.z-m.z),y=this.clonedTileset,x=this.model,C=1;this.preUpdateListener=this._scene.preUpdate.addEventListener(function(){if(C<30){C++;let w=H.lerp(new H,v,C/30,new H);y._modelMatrix=Ee.multiplyByTranslation(x.modelMatrix,w,new Ee)}})}else{let o=this.originPosition,f=this.matrixGetRotation(this.model._root.transform),m=this.toDegrees(o),v;v=H.fromDegrees(m.lon+1e-5*this.distance.x,m.lat+1e-5*this.distance.y,m.hei+this.distance.z);let y=this.clonedTileset,x=this.model,C=1;this.preUpdateListener=this._scene.preUpdate.addEventListener(function(){if(C<30){C++;let w=H.lerp(o,v,C/30,new H),A=new dl(xe.toRadians(f.heading),xe.toRadians(f.pitch),xe.toRadians(f.roll));y._root.transform=new tn.headingPitchRollToFixedFrame(w,A)}})}};iL.prototype.clickCheckInfo=function(o){let f=this._scene.pick(o);if(f instanceof Qs){let m=f.getPropertyIds(),v=m.length,y={};for(let x=0;x<v;++x)y[m[x]]=f.getProperty(m[x]);return y}};iL.prototype.toDegrees=function(o){let f=Mt.fromCartesian(o);return{lon:xe.toDegrees(f.longitude),lat:xe.toDegrees(f.latitude),hei:f.height}};iL.prototype.matrixGetRotation=function(o){let f=tn.eastNorthUpToFixedFrame(Ee.getTranslation(o,new H),ki.WGS84,new Ee),m=Ee.multiply(Ee.inverse(f,new Ee),o,new Ee),v=Ee.getRotation(m,new Ut),y=Gr.fromRotationMatrix(v),x=dl.fromQuaternion(y),C=xe.toDegrees(x.heading),w=xe.toDegrees(x.pitch),A=xe.toDegrees(x.roll);return{heading:C,pitch:w,roll:A}};var Tmt=iL;function RA(o,f={}){this._earthCtrl=o,this._terrainFlatten=new xD(this._earthCtrl.coreMap.scene),this._viewer=o.coreMap,this._scene=o.coreMap.scene,this.options=Z(f,{}),this._Tooltip=new R_(o),this._tooltip=this._Tooltip.CreateTooltip(),this._drawColor={point:Z(this.options.drawColor?.point,Re.BLUE),polyline:Z(this.options.drawColor?.polyline,Re.YELLOW),polygon:Z(this.options.drawColor?.polygon,Re.YELLOW.withAlpha(.5))},this.loadingImg=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,this.wallArr=[],this.FlattenPolygon=[],this._Apositions=[],this._heightsort=null,this._deepth=100,this._positions=[],this._modelArr=Z(f.modelArr,[]),this._isFlattening=Z(f.isFlattening,!0),this.modelCuttingPolygon=null,this.wallImgUrl=Z(f.wallImgUrl,null),this.bottomImgUrl=Z(f.bottomImgUrl,null),this._Loading=Z(f.loading,!0)}RA.prototype.removeMeasureFromMap=function(){this._prevEntity!==void 0&&(this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this.addPointHandle&&(this.addPointHandle.destroy(),this.addPointHandle=void 0),this.Triangulation=[],this.tinData=void 0,this._tooltip.show(!1)};RA.prototype.removeFromMap=function(){if(this.removeMeasureFromMap(),this.wallArr.length>0){for(let o=0;o<this.wallArr.length;o++)this._viewer.entities.remove(this.wallArr[o]);this.wallArr=[]}if(this.FlattenPolygon&&this.FlattenPolygon.length>0){for(let o=0;o<this.FlattenPolygon.length;o++)this._viewer.entities.remove(this.FlattenPolygon[o]);this.FlattenPolygon=[]}this.removeModelCutting()};RA.prototype.deleteObject=RA.prototype.removeFromMap;RA.prototype.startDrawing=function(o={},f){let m=Z(o.spacing,"auto"),v=this._scene,y=this._tooltip,x=3,C=this._positions,w=[],A;this._Apositions=o.positions,this._heightsort=w,this._deepth=Z(o.deepth,100),this._sampleStep=Z(o.sampleStep,100),this._maxSampleCount=Z(o.maxSampleCount,200),this._drawColor.point=o.point||this._drawColor.point,this._drawColor.polyline=o.polyline||this._drawColor.polyline,this._drawColor.polygon=o.polygon||this._drawColor.polygon,this.loadingImg=o.loading||this.loadingImg;let E=this;if(this._mouseHandler&&this._mouseHandler.destroy(),this.loading||this.addLoading(),!o.positions){let T=new Ur(v.canvas);this._mouseHandler=T,this.removeMeasureFromMap(),this._viewer.container.style.cursor=`url(${globalThis.GEOWORLD_BASE_URL} 'Assets/image/cursor/draw.cur')`;let S;T.setInputAction(function(I){if(I.position!==null){let P=this._viewer.scene.pickPosition(I.position);if(P){let D=Mt.fromCartesian(P);if(C.length===0&&(C.push(D),A=P),C.length>=4){let L=nl.wgs84ToWindowCoordinates(this._viewer.scene,A);if(L!==void 0){let R=L.x-I.position.x,O=L.y-I.position.y;if(R*R+O*O<16){C.splice(C.length-2,2),this.stopDrawing(f);return}}}C.push(D),C.length===2&&!S&&(S=this._viewer.entities.add({name:`${E._earthCtrl.language.TOOLS_VOLUMETRIC_TEMP_LINE_NAME}`,polyline:{positions:new xn(function(){let L=[];for(let R=0;R<C.length;R++){let O=C[R];L.push(O.longitude,O.latitude,O.height)}return H.fromRadiansArrayHeights(L)},!1),clampToGround:!1,material:E._drawColor.polygon,width:3}})),C.length===x&&(S&&this._viewer.entities.remove(S),this._prevEntity=this._viewer.entities.add({polygon:{hierarchy:new xn(()=>{let L=[];for(let R=0;R<C.length;R++){let O=C[R];L.push(O.longitude,O.latitude,O.height)}return new ho(H.fromRadiansArrayHeights(L))},!1),material:E._drawColor.polygon,fill:!0}}))}}}.bind(this),Ei.LEFT_CLICK),T.setInputAction(function(I){let P=I.endPosition;if(P!==null)if(C.length===0)y.showAt(P,`${E._earthCtrl.language.TOOLS_VOLUMETRIC_CLICK_TO_DRAW}`);else{let D=this._viewer.scene.pickPosition(P);if(D){let L=Mt.fromCartesian(D);if(C.splice(C.length-1,1),C.push(L),y.showAt(P,`${E._earthCtrl.language.TOOLS_RIGHT_CLICK_TO_END_DRAW}`),C.length>=3&&C.length>=4){let R=nl.wgs84ToWindowCoordinates(this._viewer.scene,A);if(R!==void 0){let O=R.x-P.x,F=R.y-P.y;O*O+F*F<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}}.bind(this),Ei.MOUSE_MOVE);let M=null;T.setInputAction(function(I){M=window.setTimeout(()=>{console.log("\u5355\u51FB"),this.end&&this.end()},200)}.bind(this),Ei.RIGHT_CLICK),T.setInputAction(function(I){console.log("\u53CC\u51FB......"),clearTimeout(M)},Ei.LEFT_DOUBLE_CLICK),this.end=I=>{if(this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),E._viewer.container.style.cursor="default",this._tooltip.show(!1),S&&this._viewer.entities.remove(S),this.end=void 0,!(C.length<x)){if(this._prevEntity&&this._viewer.entities.remove(this._prevEntity),this._prevEntity=void 0,I==="cancel")return;for(let P=0;P<C.length;P+=2){let D=C[P].height;w.push(D)}this._Apositions=C,this.stopDrawing(m,f)}}}return this};function u6i(o,f,m){let v=xe.lerp(o.longitude,f.longitude,1/m)-o.longitude,y=xe.lerp(o.latitude,f.latitude,1/m)-o.latitude,x=[];x.push(o);for(let C=0;C<m;C++){let w=o.longitude+(C+1)*v,A=o.latitude+(C+1)*y;x.push(new Mt(w,A))}return x.push(f),x}function c6i(o,f,m,v,y){let x=[];f.forEach(function(C){let w=Mt.toCartesian(new Mt(C.longitude,C.latitude,v)),A=Mt.toCartesian(new Mt(C.longitude,C.latitude,m)),E=H.normalize(H.subtract(A,w,new H),new H),T=new _s(w,E),S=null,M=[],I=o.scene.drillPickFromRay(T,1,M);o.scene.globe.show=!1,I.length>0&&!I[0].object&&I[0].position?(S=o.scene.drillPickFromRay(T,100,M),S.unshift(I[0])):S=o.scene.drillPickFromRay(T,100,M),o.scene.globe.show=!0,console.log("drillPickFromRay",S.length),x.push(S)}),typeof y=="function"&&y(x)}function h6i(o,f,m){for(let x=0;x<o.length;x++){let C=o[x];for(let w=0;w<C.length;w++){let A=C[w].position,E=Mt.fromCartesian(A);if(E.height<f){C.splice(w,C.length-w);let T=H.fromRadians(E.latitude,E.longitude,f);C.push({object:null,position:T});break}}{let w=C[C.length-1].position,A=Mt.fromCartesian(w);if(Math.abs(A.height-f)>.01){let E=H.fromRadians(A.latitude,A.longitude,f);C.push({object:null,position:E})}}}for(let x=0;x<o.length;x++){let C=o[x],w=C[C.length-1];m.push(w.position)}let v=0;o.forEach(function(x){v=v<x.length?x.length:v}),o.forEach(function(x){if(v-x.length>0){let w=x.length;x.length=v,x.fill(null,w,x.length)}});let y=[];for(let x=0;x<v-1;x++){let C=[],w=[];for(let A=0;A<o.length;A++){let E=o[A][x],T=o[A][x+1];E&&T&&(C.push(E),w.push(T))}y.push({ups:C,bottoms:w})}return y}RA.prototype.stopDrawing=function(o,f){let m=this;this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._volumeLabel!==void 0&&(this._viewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._volumeLabel1!==void 0&&(this._viewer.entities.remove(this._volumeLabel1),this._volumeLabel1=void 0),this._Loading&&this.isLoading(!0);let v=this._positions,y=this._viewer,x=this.wallArr,C=this._deepth,w=this._sampleStep,A=this._maxSampleCount;v.push(v[0]);let E=0;for(let T=0;T<v.length-1;T++){let S=H.fromRadians(v[T]),M=H.fromRadians(v[T+1]),P=H.distance(M,S)/w;E=E<P?P:E}E=A<E?A:E,setTimeout(()=>{m._heightsort.sort(function(D,L){return D-L});let T=m._heightsort[0]+2e3,S=m._heightsort[0]-2e3,M=[];for(let D=0;D<v.length-1;D++){let L=v[D],R=v[D+1],O=u6i(L,R,E);c6i(y,O,S,T,function(F){let k=h6i(F,C,M);for(let U=0;U<k.length;U++){let G=k[U];x.push(d6i(y,G,U))}})}let I=[];for(let D=0;D<v.length;D++){let L=v[D];I.push(L.longitude,L.latitude,C)}let P=y.entities.add({polygon:{hierarchy:{positions:H.fromRadiansArrayHeights(I)},perPositionHeight:!0,granularity:xe.RADIANS_PER_DEGREE*100,material:new Pp({image:`${window.SmartEarthRootUrl}Workers/image/bottomplane.jpg`,repeat:new Ye(1,1)}),fill:!0}});return x.push(P),m._isFlattening&&m.modelCutting(),f&&f(!0),this.isLoading(!1)},20)};RA.prototype.modelCutting=function(){let o=this,f=this._deepth,m=this._positions,v=[],y=[];for(let x=0;x<m.length;x++){let C=m[x];v.push(C.longitude,C.latitude,C.height-10),y.push(xe.toDegrees(C.longitude),xe.toDegrees(C.latitude),C.height-10)}if(o._modelCuttingPolygon=Ec.fromPositions({positions:H.fromRadiansArrayHeights(v),height:f-10}),o._terrainFlatten.addPolygon(y),o._terrainFlatten.update(),o._terrainFlatten.clipPlaneOfFlatten=!0,o._modelArr.length>0)for(let x of o._modelArr)x.addFlattenPolygon(o._modelCuttingPolygon),x.needUpdateFlatten=!0,x.clipPlaneOfFlatten=!0;else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};RA.prototype.removeModelCutting=function(){let o=this;if(o._modelArr.length>0){for(let f of o._modelArr)f.removeFlattenPolygon(o._modelCuttingPolygon);o._modelCuttingPolygon=null,o._modelArr=[],o._terrainFlatten.clearPolygon(),o._terrainFlatten.clipPlaneOfFlatten=!1}else console.info("\u8BF7\u6DFB\u52A0\u6A21\u578B\uFF01")};function d6i(o,f,m){let v=[],y=[];for(let E=0;E<f.ups.length;E++){let T=f.ups[E];v.push(T.position);let S=Mt.fromCartesian(T.position);y.push(S.height)}let x=[];for(let E=0;E<f.bottoms.length;E++){let T=f.bottoms[E],S=Mt.fromCartesian(T.position);x.push(S.height)}let C=`${window.SmartEarthRootUrl}Workers/image/MTY0001.jpg`,w=`${window.SmartEarthRootUrl}Workers/image/MTY0002.jpg`,A=o.entities.add({wall:{positions:v,material:new Pp({image:m%2?C:w,repeat:new Ye(.01,.01)}),maximumHeights:y,minimumHeights:x,granularity:xe.RADIANS_PER_DEGREE*100}});return A.show=!0,A}RA.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let f=document.createElement("img");f.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",f.src=this.loadingImg,o.appendChild(f),this.loading=o,this._viewer.container.appendChild(o)};RA.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};RA.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};var Smt=RA;function Sc(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.tools=[],this.vols=[],this.saveResult=!1,this._elevationContour=new L8(this._coreMap,qi),this._SunshineAnalysis=new Pue(this._coreMap,qi),this._create3DViewshed=new Sue(this._coreMap,qi),this._bufferAnalysis=new yP(this._coreMap,qi)}Sc.prototype.deleteObject=function(){N(this._tool)&&this._tool.deleteObject(),this.saveResult===!1&&this.tools.pop()};Sc.prototype.deleteAll=function(){this.tools.forEach(function(o){o.deleteObject()}),this.vols.forEach(function(o){o.cleanUp()}),this._earthCtrl.measure.tools.forEach(function(o){o.clearResult()}),this.tools=[],this.vols=[],this._earthCtrl.measure.tools=[]};Sc.prototype.volumetric=function(o){this.saveResult===!1&&this.removeVolumetric(),this._vol=new A3e(this._earthCtrl),this._vol.startDrawing(o),this.vols.push(this._vol)};Sc.prototype.removeVolumetric=function(o){N(this._vol)&&this.vols.forEach(function(f){f.cleanUp()})};Sc.prototype.createViewThrough=function(o={}){return new C3e(this._earthCtrl,o)};Sc.prototype.createViewThroughCircle=function(o={}){return o.type="circle",new C3e(this._earthCtrl,o)};Sc.prototype.createViewShed=function(o){return new x3e(this._earthCtrl,o)};Sc.prototype.createViewShedCircle=function(o){return o.isSpherical=!0,this._create3DViewshed.addViewshed(o),this._create3DViewshed};Sc.prototype.createSubmergence=function(o,f){let m=new E3e(this._earthCtrl);return o.isInput?m.startFlood(o,f):m.executePolygonymsd(o,f)};Sc.prototype.createProfile=function(o){return new P3e(this._earthCtrl,o)};Sc.prototype.createBufferAnalysis=function(o){return new Wre(this._earthCtrl,o)};Sc.prototype.createPointBuffer=function(o,f,m){return this._bufferAnalysis.DrawPoint(o,f,m)};Sc.prototype.createPolylineBuffer=function(o,f,m){return this._bufferAnalysis.DrawPolyline(o,f,m)};Sc.prototype.createPolygonBuffer=function(o,f,m){return this._bufferAnalysis.DrawPolygon(o,f,m)};Sc.prototype.createSkyline=function(o){return new I3e(this._earthCtrl,o)};Sc.prototype.createCurtainContrast=function(o){return new _mt(this._earthCtrl,o)};Sc.prototype.createRestrictTheHeight=function(o){return new D3e(this._earthCtrl,o)};Sc.prototype.createElevationContour=function(o,f,m){return this._elevationContour.createElevationContour(o,f,m)};Sc.prototype.createModifyMesh=function(o,f){return new L3e(this._earthCtrl).addClipping(o,f)};Sc.prototype.createModelFlatten=function(o,f){return new Amt(this._earthCtrl,o,f)};Sc.prototype.createTerrainModifier=function(o){return new N3e(this._earthCtrl,o)};Sc.prototype.createTerrainExcavation=function(o){return new k3e(this._earthCtrl,o)};Sc.prototype.createExcavationAndFillAnalysis=function(o){return new Rue(this._earthCtrl,o)};Sc.prototype.createVolumetricMeasure=function(o){return new Cmt(this._earthCtrl,o)};Sc.prototype.createModelVolumetric=function(o){return new bmt(this._earthCtrl,o)};Sc.prototype.createModelCutting=function(o){return new wmt(this._earthCtrl,o)};Sc.prototype.createTerrainCutting=function(o){return new Emt(this._earthCtrl,o)};Sc.prototype.createSpreadModel=function(o){return new Tmt(this._earthCtrl,o)};Sc.prototype.StreetViewOpen=function(o,f,m){return this._StreetView||(this._StreetView=new FJ(this._coreMap,qi)),this._StreetView.StreetViewOpen(o,f,m)};Sc.prototype.ExitStreetView=function(){return this._StreetView||(this._StreetView=new FJ(this._coreMap,qi)),this._StreetView.exit()};Sc.prototype.createIndoormode=function(o){return this._createindoormode||(this._createindoormode=new ek(this._coreMap,qi)),this._createindoormode.createIndoormode(o)};Sc.prototype.closeIndoormode=function(){return this._createindoormode||(this._createindoormode=new ek(this._coreMap,qi)),this._createindoormode.close()};Sc.prototype.SunshineAnalysisPoint=function(o,f){return this._SunshineAnalysis.sunshineAnalysisPoint(o,f)};Sc.prototype.SunshineAnalysisPolygon=function(o,f){return this._SunshineAnalysis.sunshineAnalysisPolygon(o,f)};Sc.prototype.createModelSection=function(o){return new Smt(this._earthCtrl,o)};var V3e=Sc;function GJ(o,f){if(this._earthCtrl=o,!N(f.flagHtml))throw new li("flagDiv is required.");this._flagHtml=f.flagHtml,this._options=Z(f,Z.EMAIL),this._circleRadius=Z(f.circleRadius,10),this._lon=Z(f.lon,121),this._lat=Z(f.lat,31),this._height=Z(f.height,0),this._show=Z(f.show,!0),this._flagScale=Z(f.flagScale,4),this._circleColor=Z(f.circleColor,Re.RED),this._cylinderColor=Z(f.cylinderColor,Re.YELLOWGREEN),this._duration=Z(f.duration,2e3),this._gradient=Z(f.gradient,2),this._count=Z(f.count,2),this._canvasZoom=Z(f.canvasZoom,10),this._circleEntity=void 0,this._cylinderEntity=void 0,this._lineEntity=void 0,this._htmlPlaneEntity=void 0,this._linePlaneEntity=void 0,this._flagDiv=document.createElement("div"),this._flagDiv.style.opacity="0.7",this._flagDiv.style.margin="0",this._flagDiv.style.padding="0",this._flagDiv.id=Z(f.id,zl()),this._flagDiv.innerHTML=this._flagHtml,this._show&&this.addToMap()}GJ.prototype.removeFromMap=function(){N(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),N(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),N(this._lineEntity)&&(this._earthCtrl.entities.remove(this._lineEntity),this._lineEntity=void 0),N(this._linePlaneEntity)&&(this._earthCtrl.entities.remove(this._linePlaneEntity),this._linePlaneEntity=void 0),N(this._htmlPlaneEntity)&&(this._earthCtrl.entities.remove(this._htmlPlaneEntity),this._htmlPlaneEntity=void 0)};GJ.prototype.addToMap=function(){let o=this,f=0,m=2,v,y=H.fromDegrees(o._lon,o._lat,o._height);if(N(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:y,ellipse:{height:o._height,semiMinorAxis:o._circleRadius,semiMajorAxis:o._circleRadius,material:new mU({duration:o._duration,gradient:o._gradient,color:o._circleColor,count:o._count})}})),!N(o._cylinderEntity)){let w=o._circleRadius*2/5,A=o._circleRadius*3/4;v=fT.changeCartesian3Height(y,A/2),o._cylinderEntity=o._earthCtrl.entities.add({position:v,cylinder:{length:A,topRadius:w,bottomRadius:w,fill:!0,outline:!1,material:o._cylinderColor}})}if(N(o._lineEntity)||(f=o._circleRadius*o._flagScale+o._height,o._lineEntity=o._earthCtrl.entities.add({polyline:{width:m,positions:H.fromDegreesArrayHeights([o._lon,o._lat,o._height,o._lon,o._lat,f]),material:o._cylinderColor}})),!N(o._htmlPlaneEntity)){f=o._circleRadius*o._flagScale;let w=f/5,A=w*3,E=f-w/2,T=4*m,S=new H(T/2,0,E),M=fT.changeCartesian3ByScalar(y,S);this._linePlaneEntity=o._earthCtrl.entities.add({position:M,plane:{plane:new $a(H.UNIT_Y,0),dimensions:new Ye(T,w),material:o._cylinderColor}});let I=new H(A/2+T,0,E);v=fT.changeCartesian3ByScalar(y,I);let P=o._flagDiv,D=o._canvasZoom,L=document.createElement("canvas");L.width=10*w/A*D,L.height=10*D,VU.drawDocument(P,L,{zoom:D}).then(function(R){o._htmlPlaneEntity=o._earthCtrl.entities.add({position:new xn(x,!1),plane:{plane:new xn(C,!0),dimensions:new Ye(A,w),material:new Pp({image:R.image,transparent:!0})}})},function(R){console.info(R)})}function x(){return v}function C(){let w=new H;return w=H.negate(H.UNIT_Y,w),new $a(w,0)}};GJ.prototype.updateMap=function(){N(this._circleEntity)&&(this._circleEntity.show=this.show),N(this._cylinderEntity)&&(this._cylinderEntity.show=this.show),N(this._lineEntity)&&(this._lineEntity.show=this.show),N(this._linePlaneEntity)&&(this._linePlaneEntity.show=this.show),N(this._htmlPlaneEntity)&&(this._htmlPlaneEntity.show=this.show)};Object.defineProperties(GJ.prototype,{show:{get:function(){return this._show},set:function(o){this._show=o,this.updateMap()}}});var Pmt=GJ;function Oue(o,f){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=N(f,Z.EMPTY_OBJECT),this._color=Z(f.color,Re.RED),this._lon=Z(f.lon,121),this._lat=Z(f.lat,31),this._height=Z(f.height,0),this._statistics=Z(f.statisticData,1e3),this._radius=Z(f.radius,100),this._duration=Z(f.duration,2e3),this._gradient=Z(f.gradient,2),this._count=Z(f.count,2),this._scale=Z(f.dataScale,1),this._show=Z(f.show,!0),this._billboardWidthRatio=Z(f.billboardWidthRatio,1.2),this._billboardHeightRatio=Z(f.billboardHeightRatio,2.4),this._prefix=Z(f.prefix,""),this._scaleByDistance=Z(f.scaleByDistance,new sa(1500,3,15e3,.1)),this._topFillColor=Z(f.topFillColor,Re.fromCssColorString("#323232")),this._circleEntity=void 0,this._cylinderEntity=void 0,this._billboardEntity=void 0,this._position=H.fromDegrees(this._lon,this._lat,this._height),this._show&&this.addToMap()}var sN=new H;Oue.prototype.addToMap=function(){let o=this;if(N(o._circleEntity)||(o._circleEntity=o._earthCtrl.entities.add({position:o._position,ellipse:{height:o._height,semiMinorAxis:o._radius,semiMajorAxis:o._radius,material:new mU({duration:o._duration,gradient:o._gradient,color:o._color,count:o._count})}})),!N(o._cylinderEntity)){sN=H.clone(o._position,sN);let f=o._statistics*o._scale,m=tn.eastNorthUpToFixedFrame(sN),v=new H(0,0,f/2);Ee.multiplyByPoint(m,v,sN),o._cylinderEntity=o._earthCtrl.entities.add({position:sN,cylinder:{length:f,topRadius:o._radius/10,bottomRadius:o._radius/10,fill:!0,outline:!1,material:o._color}})}if(!N(o._billboardEntity)){sN=H.clone(o._position,sN);let f=o._cylinderEntity.cylinder.length._value,m=Mt.fromCartesian(sN),v=H.fromRadians(m.longitude,m.latitude,m.height+f);o._billboardEntity=o._earthCtrl.entities.add({position:v,billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:so.BOTTOM,width:o._radius/o._billboardWidthRatio,height:o._radius/o._billboardHeightRatio,image:m6i(o._color,o._topFillColor,o._prefix+o._statistics,o._radius).toDataURL()}})}};Oue.prototype.removeFromMap=function(){N(this._cylinderEntity)&&(this._earthCtrl.entities.remove(this._cylinderEntity),this._cylinderEntity=void 0),N(this._circleEntity)&&(this._earthCtrl.entities.remove(this._circleEntity),this._circleEntity=void 0),N(this._billboardEntity)&&(this._earthCtrl.entities.remove(this._billboardEntity),this._billboardEntity=void 0)};function f6i(o,f,m,v){o.save(),o.strokeStyle="rgba(0,0,0,0)",o.scale(v/150,v/100),o.save(),o.fillStyle=f.toCssColorString(),o.lineWidth=4,o.beginPath(),o.moveTo(77.8,82.1),o.lineTo(64.6,69),o.lineTo(23.8,69),o.bezierCurveTo(20.8,69,18.3,66.5,18.3,63.5),o.lineTo(18.3,22.5),o.bezierCurveTo(18.3,19.5,20.8,17,23.8,17),o.lineTo(131.8,17),o.bezierCurveTo(134.8,17,137.3,19.5,137.3,22.5),o.lineTo(137.3,63.5),o.bezierCurveTo(137.3,66.5,134.8,69,131.8,69),o.lineTo(90.9,69),o.lineTo(77.8,82.1),o.closePath(),o.moveTo(23.8,18),o.bezierCurveTo(21.3,18,19.3,20,19.3,22.5),o.lineTo(19.3,63.5),o.bezierCurveTo(19.3,66,21.3,68,23.8,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.3,18,131.8,18),o.lineTo(23.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.save(),o.fillStyle=m.toCssColorString(),o.beginPath(),o.moveTo(131.8,18),o.lineTo(23.80000000000001,18),o.bezierCurveTo(21.30000000000001,18,19.30000000000001,20,19.30000000000001,22.5),o.lineTo(19.30000000000001,63.5),o.bezierCurveTo(19.30000000000001,66,21.30000000000001,68,23.80000000000001,68),o.lineTo(65,68),o.lineTo(77.7,80.7),o.lineTo(90.5,68),o.lineTo(131.8,68),o.bezierCurveTo(134.3,68,136.3,66,136.3,63.5),o.lineTo(136.3,22.5),o.bezierCurveTo(136.3,20,134.2,18,131.8,18),o.closePath(),o.fill(),o.stroke(),o.restore(),o.restore()}function p6i(o,f,m){let v=m/1.4,y=v,x=v;f.width>f.height?x=v*(f.height/f.width):f.width<f.height&&(y=v*(f.width/f.height));let C=m/150*8,w=Math.round((m-y+C)/2),A=Math.round((5/6*m-x)/2);o.drawImage(f,w,A,y,x)}function m6i(o,f,m,v){let y=document.createElement("canvas");y.width=v,y.height=v;let x=y.getContext("2d");f6i(x,o,f,v);let C=v,w=gB(m,{font:`bold ${C}pt Microsoft YaHei`,fillColor:o});return p6i(x,w,C),y}Object.defineProperties(Oue.prototype,{billboard:{get:function(){return this._billboardEntity}},cylinder:{get:function(){return this._cylinderEntity}},circle:{get:function(){return this._circleEntity}},show:{get:function(){return this._show},set:function(o){N(this._billboardEntity)&&(this._billboardEntity.show=o),N(this._cylinderEntity)&&(this._cylinderEntity.show=o),N(this._circleEntity)&&(this._circleEntity.show=o)}}});var Imt=Oue;function z3e(o,f){if(this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Z(f,Z.EMPTY_OBJECT),this._color=Z(f.color,Re.RED),this._lon=Z(f.lon,121),this._lat=Z(f.lat,31),this._height=Z(f.height,0),this._show=Z(f.show,!0),this._containerWidth=Z(f.containerWidth,200),this._containerHeight=Z(f.containerHeight,200),this._containerColor=Z(f.cylinderColor,Re.YELLOWGREEN),this._canvasZoom=Z(f.canvasZoom,10),this._scaleByDistance=Z(f.scaleByDistance,new sa(1500,3,15e3,.1)),this._tipsHtml=f.tipsHtml,this._tipsEntity=void 0,this._tipsDiv=document.createElement("div"),this._tipsDiv.style.opacity="0.7",this._tipsDiv.style.margin="0",this._tipsDiv.style.padding="0",this._tipsDiv.id=Z(f.id,zl()),this._tipsDiv.innerHTML=this._tipsHtml,!N(f.tipsHtml))throw new li("tipsHtml is required.");this.addToMap()}z3e.prototype.removeFromMap=function(){N(this._tipsEntity)&&(this._earthCtrl.entities.remove(this._tipsEntity),this._tipsEntity=void 0),N(this._tipsDiv)&&(this._earthCtrl.entities.remove(this._tipsDiv),this._tipsDiv=void 0)};z3e.prototype.addToMap=function(){let o=this,f=H.fromDegrees(o._lon,o._lat,o._height);if(!N(o._tipsEntity)){let v=o._containerHeight,y=o._containerWidth,x=o._canvasZoom,C=o._tipsDiv,w=document.createElement("canvas");w.width=y,w.height=v,VU.drawDocument(C,w,{zoom:x}).then(function(A){o._tipsEntity=o._earthCtrl.entities.add({position:new xn(m,!1),billboard:{scaleByDistance:o._scaleByDistance,verticalOrigin:so.BOTTOM,width:y,height:v,image:A.image.src}})},function(A){console.info(A)})}function m(){return f}};var Mmt=z3e;function lk(o,f){this._earthCtrl=o,this._scene=o.coreMap.scene,this._options=Z(f,Z.EMPTY_OBJECT),this.element=document.createElement("div"),this._html=Z(f.html,""),this._lon=Z(f.lon,121),this._lat=Z(f.lat,31),this._height=Z(f.height,10),this._show=Z(f.show,!0),this._removeHandler=void 0,this._pos=void 0,this._position=void 0,this._c=void 0,this._changedC=void 0,this._point=void 0,this._parameter=f,this._rtti="ScreenDialog",this.isInit=!1,this.isInit===!1&&this.addToMap()}lk.prototype.setHtml=function(o){this.element.innerHTML=o};lk.prototype.setShow=function(o){if(!this.isInit)return 0;this.element.style.display=o?"block":"none"};lk.prototype.showAt=function(){if(!this.isInit)return 0;this._position&&(this._pos=nl.wgs84ToWindowCoordinates(this._scene,this._position),this._pos&&(this.element.style.left=`${this._pos.x}px`,this.element.style.top=`${this._pos.y}px`))};lk.prototype.removeFromMap=function(){this.element.remove(),this.isInit=!1};lk.prototype.addToMap=function(){if(this.isInit)return 0;rp(".map-widget",this.element),this.element.innerHTML=this._html,this.element.style.position="absolute",this.isInit=!0,this._position=H.fromDegrees(this._lon,this._lat,this._height),this.showAt(),this._c=new Ye(this._pos.x,this._pos.y);let o=this;this._scene.camera.moveStart.addEventListener(function(){o._removeHandler=o._scene.postRender.addEventListener(function(){if(o._c){let f=new pB(ki.WGS84,o._earthCtrl.camera._camera.position);f&&o._position&&(f.isPointVisible(o._position)===!1?o.setShow(!1):(o._show===!0&&o.setShow(!0),o._changedC=nl.wgs84ToWindowCoordinates(o._scene,o._position),o._changedC?(o._c=o._changedC,o.showAt()):o.setShow(!1)))}})}),this._scene.camera.moveEnd.addEventListener(function(){o._removeHandler&&o._removeHandler.call()})};Object.defineProperties(lk.prototype,{show:{get:function(){return this._show},set:function(o){this._show!==o&&(this._show=o,this.setShow(o))}},html:{get:function(){return this._html},set:function(o){this._html!==o&&(this._html=o,this.setHtml(o))}},lon:{get:function(){return this._lon},set:function(o){this._lon!==o&&(this._lon=o,this._position=H.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},lat:{get:function(){return this._lat},set:function(o){this._lat!==o&&(this._lat=o,this._position=H.fromDegrees(this._lon,this._lat,this._height),this.showAt())}},height:{get:function(){return this._height},set:function(o){this._height!==o&&(this._height=o,this._position=H.fromDegrees(this._lon,this._lat,this._height),this.showAt())}}});var Dmt=lk;function WJ(o){this._earthCtrl=o,this._coreMap=o.coreMap}WJ.prototype.createStatisticFlag=function(o){return new Pmt(this._earthCtrl,o)};WJ.prototype.createStatisticCylinder=function(o){return new Imt(this._earthCtrl,o)};WJ.prototype.createTipsContainer=function(o){return new Mmt(this._earthCtrl,o)};WJ.prototype.createScreenDialog=function(o){return new Dmt(this._earthCtrl,o)};var Lmt=WJ;function Ar(o,f){var m=Nue();return Ar=function(v,y){v=v-250;var x=m[v];return x},Ar(o,f)}(function(o,f){for(var m=Ar,v=o();[];)try{var y=parseInt(m(1545))/1+-parseInt(m(1084))/2*(parseInt(m(1300))/3)+-parseInt(m(1104))/4*(-parseInt(m(1260))/5)+parseInt(m(270))/6+parseInt(m(639))/7+parseInt(m(1529))/8+-parseInt(m(927))/9;if(y===f)break;v.push(v.shift())}catch{v.push(v.shift())}})(Nue,893503),function(o,f){var m=Ar,v=function(){var x=!![];return function(C,w){var A=x?function(){var E=Ar;if(w){var T=w[E(306)](C,arguments);return w=null,T}}:function(){};return x=![],A}}(),y=v(this,function(){var x=Ar;return y.toString().search(x(722)).toString().constructor(y)[x(1019)](x(722))});y(),m(1206)==typeof exports&&typeof module=="object"?module[m(533)]=f():m(647)==typeof define&&define[m(282)]?define([],f):m(1206)==typeof exports?exports[m(1306)]=f():o[m(1306)]=f()}(self||void 0,()=>{var o=Ar,f={9282:(Ii,jt,ct)=>{var Pe=Ar,Ht=ct(4155),si=ct(5108);function _t(Ci){var Ni=Ar;return(_t=Ni(647)==typeof Symbol&&Ni(1245)==typeof Symbol[Ni(397)]?function(cr){return typeof cr}:function(cr){var Bi=Ni;return cr&&Bi(647)==typeof Symbol&&cr.constructor===Symbol&&cr!==Symbol[Bi(1033)]?Bi(1245):typeof cr})(Ci)}var Yt,Fi,ir=ct(2136).codes,Dt=ir[Pe(258)],Lt=ir[Pe(1145)],Si=ir[Pe(598)],nt=ir[Pe(896)],wt=ir.ERR_MISSING_ARGS,yt=ct(5961),Tt=ct(9539)[Pe(1183)],ir=ct(9539)[Pe(901)],Et=ir.isPromise,ti=ir[Pe(1406)],ir=Object[Pe(1369)]||ct(8091)[Pe(1369)],or=Object.is||ct(609);function xr(){var Ci=Pe,Ni=ct(9158);Yt=Ni.isDeepEqual,Fi=Ni[Ci(1486)]}var Tn=!1,Ii=Ii[Pe(533)]=fn,pr={};function yn(Ci){var Ni=Pe;throw Ci[Ni(317)]instanceof Error?Ci[Ni(317)]:new yt(Ci)}function dn(Ci,Ni,cr,Bi){var Ct=Pe;if(!cr){var Mi=!1;if(Ni===0)Mi=!0,Bi="No value argument passed to `assert.ok()`";else if(Bi instanceof Error)throw Bi;var $i={};throw $i[Ct(288)]=cr,$i[Ct(1547)]=!0,$i[Ct(317)]=Bi,$i[Ct(667)]="==",$i.stackStartFn=Ci,Ni=new yt($i),Ni[Ct(1092)]=Mi,Ni}}function fn(){for(var Ci=Pe,Ni=arguments[Ci(293)],cr=new Array(Ni),Bi=0;Bi<Ni;Bi++)cr[Bi]=arguments[Bi];dn.apply(void 0,[fn,cr.length].concat(cr))}function Or(Ci,Ni,cr){var Bi=Pe,Ct=this;if(!(this instanceof Or))throw new TypeError("Cannot call a class as a function");Ni[Bi(538)](function(Mi){var $i=Bi;Mi in Ci&&(cr!==void 0&&$i(665)==typeof cr[Mi]&&ti(Ci[Mi])&&Ci[Mi][$i(1347)](cr[Mi])?Ct[Mi]=cr[Mi]:Ct[Mi]=Ci[Mi])})}function On(Ci,Ni,cr,Bi){var Ct=Pe;if(Ct(647)==typeof Ni)return Ni[Ct(1033)]!==void 0&&Ci instanceof Ni||!Error[Ct(381)](Ni)&&Ni[Ct(511)]({},Ci)===!0;if(ti(Ni))return Ni[Ct(1347)](Ci);if(arguments[Ct(293)]===2)throw new Lt(Ct(1547),["Function","RegExp"],Ni);var Mi;if(Ct(1206)!==_t(Ci)||Ci===null)throw(Mi=new yt({actual:Ci,expected:Ni,message:cr,operator:Ct(831),stackStartFn:Bi})).operator=Bi.name,Mi;var $i=Object[Ct(1288)](Ni);if(Ni instanceof Error)$i[Ct(622)](Ct(1193),"message");else if($i.length===0)throw new Si(Ct(941),Ni,Ct(1243));return Yt===void 0&&xr(),$i[Ct(538)](function(ur){var Nr=Ct;if(Nr(665)!=typeof Ci[ur]||!ti(Ni[ur])||!Ni[ur][Nr(1347)](Ci[ur])){var qe=Ci,tt=Ni,$e=cr,St=$i,Zt=Bi;if(!(ur in qe&&Fi(qe[ur],tt[ur]))){if(!$e)throw ur=new Or(qe,St),St=new Or(tt,St,qe),(ur=new yt({actual:ur,expected:St,operator:"deepStrictEqual",stackStartFn:Zt})).actual=qe,ur[Nr(1547)]=tt,ur.operator=Zt.name,ur;var ui={};ui[Nr(288)]=qe,ui[Nr(1547)]=tt,ui[Nr(317)]=$e,ui[Nr(667)]=Zt.name,ui.stackStartFn=Zt,yn(ui)}}}),1}function eo(Ci){var Ni=Pe;if(typeof Ci!="function")throw new Lt("fn",Ni(454),Ci);try{Ci()}catch(cr){return cr}return pr}function Cn(Ci){var Ni=Pe;return Et(Ci)||Ci!==null&&_t(Ci)==="object"&&typeof Ci[Ni(283)]=="function"&&Ni(647)==typeof Ci[Ni(487)]}function Sa(Ci){var Ni=Pe;return Promise[Ni(1437)]()[Ni(283)](function(){var cr=Ni,Bi;if(cr(647)==typeof Ci){if(!Cn(Bi=Ci()))throw new nt("instance of Promise","promiseFn",Bi)}else{if(!Cn(Ci))throw new Lt("promiseFn",[cr(454),"Promise"],Ci);Bi=Ci}return Promise[cr(1437)]()[cr(283)](function(){return Bi}).then(function(){return pr}).catch(function(Ct){return Ct})})}function Va(Ci,Ni,cr,Bi){var Ct=Pe;if(Ct(665)==typeof cr){if(arguments[Ct(293)]===4)throw new Lt(Ct(941),[Ct(974),Ct(853),Ct(454),"RegExp"],cr);if(Ct(1206)===_t(Ni)&&Ni!==null){if(Ni[Ct(317)]===cr)throw new Dt(Ct(374),Ct(1146).concat(Ni[Ct(317)],Ct(298)))}else if(Ni===cr)throw new Dt("error/message",'The error "'[Ct(960)](Ni,Ct(298)));Bi=cr,cr=void 0}else if(cr!=null&&Ct(1206)!==_t(cr)&&Ct(647)!=typeof cr)throw new Lt(Ct(941),[Ct(974),Ct(853),"Function",Ct(677)],cr);var Mi,$i;if(Ni===pr&&(Mi="",cr&&cr[Ct(1193)]&&(Mi+=" ("[Ct(960)](cr[Ct(1193)],")")),Mi+=Bi?": "[Ct(960)](Bi):".",$i=Ct(609)===Ci[Ct(1193)]?Ct(256):Ct(526),yn({actual:void 0,expected:cr,operator:Ci[Ct(1193)],message:"Missing expected ".concat($i).concat(Mi),stackStartFn:Ci})),cr&&!On(Ni,cr,Bi,Ci))throw Ni}function za(Ci,Ni,cr,Bi){var Ct=Pe,Mi;if(Ni!==pr)throw typeof cr=="string"&&(Bi=cr,cr=void 0),cr&&!On(Ni,cr)||(Bi=Bi?": "[Ct(960)](Bi):".",Mi=Ci[Ct(1193)]==="doesNotReject"?"rejection":Ct(526),yn({actual:Ni,expected:cr,operator:Ci[Ct(1193)],message:"Got unwanted "[Ct(960)](Mi).concat(Bi,` `)+'Actual message: "'.concat(Ni&&Ni[Ct(317)],'"'),stackStartFn:Ci})),Ni}function zr(){for(var Ci=Pe,Ni=arguments[Ci(293)],cr=new Array(Ni),Bi=0;Bi<Ni;Bi++)cr[Bi]=arguments[Bi];dn[Ci(306)](void 0,[zr,cr[Ci(293)]][Ci(960)](cr))}Ii[Pe(324)]=function Ci(Ni,cr,Bi,Ct,Mi){var $i=Pe,ur,Nr=arguments[$i(293)];if(Nr===0?ur=$i(1210):Nr===1?(Bi=Ni,Ni=void 0):(Tn===!1&&(Tn=!0,(Ht[$i(925)]||si[$i(549)][$i(633)](si))($i(433),"DeprecationWarning",$i(793))),Nr===2&&(Ct="!=")),Bi instanceof Error)throw Bi;var qe={};throw qe[$i(288)]=Ni,qe[$i(1547)]=cr,qe[$i(667)]=Ct===void 0?$i(324):Ct,qe.stackStartFn=Mi||Ci,Nr=qe,Bi!==void 0&&(Nr.message=Bi),Nr=new yt(Nr),ur&&(Nr[$i(317)]=ur,Nr[$i(1092)]=!0),Nr},Ii[Pe(527)]=yt,Ii.ok=fn,Ii[Pe(1188)]=function Ci(Ni,cr,Bi){var Ct=Pe;if(arguments[Ct(293)]<2)throw new wt("actual",Ct(1547));Ni!=cr&&yn({actual:Ni,expected:cr,message:Bi,operator:"==",stackStartFn:Ci})},Ii.notEqual=function Ci(Ni,cr,Bi){var Ct=Pe;if(arguments[Ct(293)]<2)throw new wt(Ct(288),Ct(1547));Ni==cr&&yn({actual:Ni,expected:cr,message:Bi,operator:"!=",stackStartFn:Ci})},Ii[Pe(1416)]=function Ci(Ni,cr,Bi){var Ct=Pe;if(arguments[Ct(293)]<2)throw new wt(Ct(288),Ct(1547));Yt===void 0&&xr(),Yt(Ni,cr)||yn({actual:Ni,expected:cr,message:Bi,operator:Ct(1416),stackStartFn:Ci})},Ii[Pe(585)]=function Ci(Ni,cr,Bi){var Ct=Pe;if(arguments.length<2)throw new wt(Ct(288),"expected");Yt===void 0&&xr(),Yt(Ni,cr)&&yn({actual:Ni,expected:cr,message:Bi,operator:Ct(585),stackStartFn:Ci})},Ii[Pe(831)]=function Ci(Ni,cr,Bi){var Ct=Pe;if(arguments.length<2)throw new wt(Ct(288),Ct(1547));Yt===void 0&&xr(),Fi(Ni,cr)||yn({actual:Ni,expected:cr,message:Bi,operator:Ct(831),stackStartFn:Ci})},Ii[Pe(449)]=function Ci(Ni,cr,Bi){var Ct=Pe;if(arguments[Ct(293)]<2)throw new wt("actual",Ct(1547));Yt===void 0&&xr(),Fi(Ni,cr)&&yn({actual:Ni,expected:cr,message:Bi,operator:Ct(449),stackStartFn:Ci})},Ii[Pe(791)]=function Ci(Ni,cr,Bi){var Ct=Pe;if(arguments[Ct(293)]<2)throw new wt(Ct(288),Ct(1547));or(Ni,cr)||yn({actual:Ni,expected:cr,message:Bi,operator:"strictEqual",stackStartFn:Ci})},Ii[Pe(1255)]=function Ci(Ni,cr,Bi){var Ct=Pe;if(arguments[Ct(293)]<2)throw new wt("actual",Ct(1547));or(Ni,cr)&&yn({actual:Ni,expected:cr,message:Bi,operator:Ct(1255),stackStartFn:Ci})},Ii[Pe(782)]=function Ci(Ni){for(var cr=Pe,Bi=arguments[cr(293)],Ct=new Array(1<Bi?Bi-1:0),Mi=1;Mi<Bi;Mi++)Ct[Mi-1]=arguments[Mi];Va.apply(void 0,[Ci,eo(Ni)].concat(Ct))},Ii[Pe(609)]=function Ci(Ni){for(var cr=Pe,Bi=arguments.length,Ct=new Array(1<Bi?Bi-1:0),Mi=1;Mi<Bi;Mi++)Ct[Mi-1]=arguments[Mi];return Sa(Ni)[cr(283)](function($i){var ur=cr;return Va[ur(306)](void 0,[Ci,$i][ur(960)](Ct))})},Ii[Pe(729)]=function Ci(Ni){for(var cr=Pe,Bi=arguments[cr(293)],Ct=new Array(1<Bi?Bi-1:0),Mi=1;Mi<Bi;Mi++)Ct[Mi-1]=arguments[Mi];za[cr(306)](void 0,[Ci,eo(Ni)][cr(960)](Ct))},Ii[Pe(1130)]=function Ci(Ni){for(var cr=Pe,Bi=arguments[cr(293)],Ct=new Array(1<Bi?Bi-1:0),Mi=1;Mi<Bi;Mi++)Ct[Mi-1]=arguments[Mi];return Sa(Ni)[cr(283)](function($i){var ur=cr;return za[ur(306)](void 0,[Ci,$i].concat(Ct))})},Ii[Pe(1299)]=function Ci(Ni){var cr=Pe;if(Ni!=null){var Bi="ifError got unwanted exception: ",Bi=(cr(1206)===_t(Ni)&&cr(665)==typeof Ni[cr(317)]?Ni.message[cr(293)]===0&&Ni[cr(376)]?Bi+=Ni[cr(376)][cr(1193)]:Bi+=Ni.message:Bi+=Tt(Ni),new yt({actual:Ni,expected:null,operator:cr(1299),message:Bi,stackStartFn:Ci})),Ni=Ni[cr(1025)];if(cr(665)==typeof Ni){for(var Ct=Ni.split(` `),Mi=(Ct.shift(),Bi[cr(1025)][cr(277)](` `)),$i=0;$i<Ct[cr(293)];$i++){var ur=Mi[cr(835)](Ct[$i]);if(ur!==-1){Mi=Mi[cr(1185)](0,ur);break}}Bi[cr(1025)]=""[cr(960)](Mi[cr(1222)](` `),` `)[cr(960)](Ct[cr(1222)](` `))}throw Bi}},Ii.strict=ir(zr,Ii,{equal:Ii[Pe(791)],deepEqual:Ii[Pe(831)],notEqual:Ii[Pe(1255)],notDeepEqual:Ii[Pe(449)]}),Ii.strict[Pe(1350)]=Ii.strict},5961:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4155);function si(dn,fn){for(var Or=Ar,On=0;On<fn[Or(293)];On++){var eo=fn[On];eo[Or(378)]=eo[Or(378)]||!1,eo[Or(532)]=!0,Or(1438)in eo&&(eo[Or(705)]=!0),Object[Or(1208)](dn,eo.key,eo)}}function _t(dn,fn){var Or=Ar;return!fn||Or(1206)!==nt(fn)&&Or(647)!=typeof fn?Yt(dn):fn}function Yt(dn){var fn=Ar;if(dn===void 0)throw new ReferenceError(fn(876));return dn}function Fi(dn){var fn=Ar,Or=fn(647)==typeof Map?new Map:void 0,On=dn;if(On===null||Function[fn(627)][fn(511)](On).indexOf(fn(658))===-1)return On;if(fn(647)!=typeof On)throw new TypeError(fn(1198));if(Or!==void 0){if(Or[fn(659)](On))return Or[fn(1363)](On);Or[fn(1024)](On,eo)}function eo(){var Cn=fn;return Dt(On,arguments,Si(this)[Cn(376)])}return eo.prototype=Object[fn(939)](On[fn(1033)],{constructor:{value:eo,enumerable:!1,writable:!0,configurable:!0}}),Lt(eo,On)}function Dt(dn,fn,Or){var On=Ar;return(Dt=function(){var eo=Ar;if(typeof Reflect<"u"&&Reflect[eo(1144)]&&!Reflect[eo(1144)][eo(1555)]){if(typeof Proxy=="function")return 1;try{return Date[eo(1033)][eo(627)][eo(511)](Reflect[eo(1144)](Date,[],function(){})),1}catch{return}}}()?Reflect[On(1144)]:function(eo,zr,Sa){var Va=On,za=[null],zr=(za[Va(622)][Va(306)](za,zr),new(Function[Va(633)].apply(eo,za)));return Sa&&Lt(zr,Sa[Va(1033)]),zr})[On(306)](null,arguments)}function Lt(dn,fn){return(Lt=Object.setPrototypeOf||function(Or,On){var eo=Ar;return Or[eo(534)]=On,Or})(dn,fn)}function Si(dn){var fn=Ar;return(Si=Object[fn(1403)]?Object[fn(1216)]:function(Or){var On=fn;return Or[On(534)]||Object[On(1216)](Or)})(dn)}function nt(dn){var fn=Ar;return(nt=fn(647)==typeof Symbol&&fn(1245)==typeof Symbol.iterator?function(Or){return typeof Or}:function(Or){var On=fn;return Or&&On(647)==typeof Symbol&&Or.constructor===Symbol&&Or!==Symbol[On(1033)]?"symbol":typeof Or})(dn)}var wt=ct(9539)[Pe(1183)],yt=ct(2136)[Pe(1103)][Pe(1145)];function Tt(dn,fn,Or){var On=Pe;return(Or===void 0||Or>dn[On(293)])&&(Or=dn[On(293)]),dn[On(874)](Or-fn.length,Or)===fn}var Et={};Et[Pe(831)]=Pe(1415),Et.strictEqual="Expected values to be strictly equal:",Et[Pe(1483)]=Pe(1259),Et.deepEqual=Pe(431),Et[Pe(1188)]=Pe(994),Et.notDeepStrictEqual='Expected "actual" not to be strictly deep-equal to:',Et[Pe(1255)]=Pe(819),Et[Pe(1079)]=Pe(1192),Et[Pe(585)]='Expected "actual" not to be loosely deep-equal to:',Et[Pe(1477)]=Pe(1207),Et[Pe(566)]=Pe(437);var ti="",ir="",or="",xr="",Tn=Et,Ii=10;function pr(dn){var fn=Pe,Or=Object[fn(1288)](dn),On=Object.create(Object[fn(1216)](dn));return Or.forEach(function(eo){On[eo]=dn[eo]}),Object[fn(1208)](On,fn(317),{value:dn.message}),On}function yn(dn){var fn=Pe,Or={};return Or[fn(1263)]=!1,Or.customInspect=!1,Or[fn(1187)]=1e3,Or[fn(1428)]=1/0,Or[fn(358)]=!1,Or[fn(747)]=1/0,Or[fn(886)]=!1,Or[fn(529)]=!0,Or.getters=!0,wt(dn,Or)}ct=function(){var dn=Pe,fn=On,Or=Fi(Error);if(dn(647)!=typeof Or&&Or!==null)throw new TypeError(dn(1198));function On(Ni){var Cn=dn,Sa;if(!(this instanceof On))throw new TypeError(Cn(460));if(Cn(1206)!==nt(Ni)||Ni===null)throw new yt(Cn(1157),Cn(974),Ni);var Va=Ni.message,za=Ni.operator,zr=Ni[Cn(1381)],Ci=Ni.actual,Ni=Ni[Cn(1547)],cr=Error[Cn(1474)];if(Error[Cn(1474)]=0,Va!=null)Sa=_t(this,Si(On)[Cn(511)](this,String(Va)));else if(Ht[Cn(773)]&&Ht[Cn(773)][Cn(355)]&&(or=Ht.stderr&&Ht[Cn(773)].getColorDepth&&Ht[Cn(773)][Cn(356)]()!==1?(ti="\x1B[34m",ir=Cn(1164),xr=Cn(1050),Cn(1517)):xr=ir=ti=""),Cn(1206)===nt(Ci)&&Ci!==null&&Cn(1206)===nt(Ni)&&Ni!==null&&Cn(1025)in Ci&&Ci instanceof Error&&"stack"in Ni&&Ni instanceof Error&&(Ci=pr(Ci),Ni=pr(Ni)),za==="deepStrictEqual"||Cn(791)===za)Sa=_t(this,Si(On)[Cn(511)](this,function(Nr,qe,tt){var $e=Cn,St="",Zt="",ui=0,hr="",Yr=!1,ln=yn(Nr),Kn=ln.split(` `),Un=yn(qe)[$e(277)](` `),Qn=0,Pa="";if(tt==="strictEqual"&&$e(1206)===nt(Nr)&&nt(qe)==="object"&&Nr!==null&&qe!==null&&(tt=$e(1483)),Kn[$e(293)]===1&&Un[$e(293)]===1&&Kn[0]!==Un[0]){var Gn=Kn[0][$e(293)]+Un[0].length;if(Gn<=Ii){if(!($e(1206)===nt(Nr)&&Nr!==null||$e(1206)===nt(qe)&&qe!==null||Nr===0&&qe===0))return""[$e(960)](Tn[tt],` `)+"".concat(Kn[0]," !== ")[$e(960)](Un[0],` `)}else if($e(1483)!==tt&&Gn<(Ht[$e(773)]&&Ht[$e(773)][$e(355)]?Ht[$e(773)].columns:80)){for(;Kn[0][Qn]===Un[0][Qn];)Qn++;2<Qn&&(Pa=` `[$e(960)](function(Wl,Th){var rr=$e;if(Th=Math.floor(Th),Wl[rr(293)]==0||Th==0)return"";var mo=Wl[rr(293)]*Th;for(Th=Math[rr(550)](Math[rr(826)](Th)/Math.log(2));Th;)Wl+=Wl,Th--;return Wl+Wl.substring(0,mo-Wl[rr(293)])}(" ",Qn),"^"),Qn=0)}}for(var Ja=Kn[Kn.length-1],fl=Un[Un[$e(293)]-1];Ja===fl&&(Qn++<2?hr=$e(399)[$e(960)](Ja)[$e(960)](hr):St=Ja,Kn[$e(465)](),Un[$e(465)](),Kn.length!==0&&Un[$e(293)]!==0);)Ja=Kn[Kn.length-1],fl=Un[Un[$e(293)]-1];var Ul=Math[$e(488)](Kn.length,Un[$e(293)]);if(Ul===0){var hu=ln[$e(277)](` `);if(30<hu.length)for(hu[26]="".concat(ti,$e(736))[$e(960)](xr);27<hu[$e(293)];)hu[$e(465)]();return"".concat(Tn[$e(566)],` `)[$e(960)](hu[$e(1222)](` `),` `)}3<Qn&&(hr=` `.concat(ti,"...").concat(xr)[$e(960)](hr),Yr=!0),St!==""&&(hr=` `[$e(960)](St)[$e(960)](hr),St="");for(var Ys=0,Wd=Tn[tt]+` `[$e(960)](ir,"+ actual")[$e(960)](xr," ")[$e(960)](or,$e(1062))[$e(960)](xr),Pc=" "[$e(960)](ti,$e(736))[$e(960)](xr,$e(767)),Qn=0;Qn<Ul;Qn++){var So,Kh,mf,Gl=Qn-ui;if(Kn[$e(293)]<Qn+1?(1<Gl&&2<Qn&&(4<Gl?(Zt+=` `[$e(960)](ti,$e(736))[$e(960)](xr),Yr=!0):3<Gl&&(Zt+=` `[$e(960)](Un[Qn-2]),Ys++),Zt+=$e(399)[$e(960)](Un[Qn-1]),Ys++),ui=Qn,St+=` `[$e(960)](or,"-")[$e(960)](xr," ")[$e(960)](Un[Qn]),Ys++):Un[$e(293)]<Qn+1?(1<Gl&&2<Qn&&(4<Gl?(Zt+=` `.concat(ti,$e(736))[$e(960)](xr),Yr=!0):3<Gl&&(Zt+=$e(399)[$e(960)](Kn[Qn-2]),Ys++),Zt+=$e(399)[$e(960)](Kn[Qn-1]),Ys++),ui=Qn,Zt+=` `.concat(ir,"+")[$e(960)](xr," ")[$e(960)](Kn[Qn]),Ys++):(So=Un[Qn],(mf=(Kh=Kn[Qn])!==So&&(!Tt(Kh,",")||Kh[$e(1185)](0,-1)!==So))&&Tt(So,",")&&So[$e(1185)](0,-1)===Kh&&(mf=!1,Kh+=","),mf?(1<Gl&&2<Qn&&(4<Gl?(Zt+=` `[$e(960)](ti,"...")[$e(960)](xr),Yr=!0):3<Gl&&(Zt+=$e(399).concat(Kn[Qn-2]),Ys++),Zt+=$e(399)[$e(960)](Kn[Qn-1]),Ys++),ui=Qn,Zt+=` `[$e(960)](ir,"+").concat(xr," ")[$e(960)](Kh),St+=` `.concat(or,"-")[$e(960)](xr," ")[$e(960)](So),Ys+=2):(Zt+=St,St="",Gl!=1&&Qn!==0||(Zt+=$e(399)[$e(960)](Kh),Ys++))),20<Ys&&Qn<Ul-2)return""[$e(960)](Wd)[$e(960)](Pc,` `)[$e(960)](Zt,` `)[$e(960)](ti,"...")[$e(960)](xr)[$e(960)](St,` `)+""[$e(960)](ti,$e(736))[$e(960)](xr)}return""[$e(960)](Wd)[$e(960)](Yr?Pc:"",` `).concat(Zt)[$e(960)](St)[$e(960)](hr)[$e(960)](Pa)}(Ci,Ni,za)));else if(Cn(449)===za||Cn(1255)===za){var Bi=Tn[za],Ct=yn(Ci)[Cn(277)](` `);if(za==="notStrictEqual"&&Cn(1206)===nt(Ci)&&Ci!==null&&(Bi=Tn.notStrictEqualObject),30<Ct[Cn(293)])for(Ct[26]=""[Cn(960)](ti,Cn(736))[Cn(960)](xr);27<Ct[Cn(293)];)Ct.pop();Sa=Ct[Cn(293)]===1?_t(this,Si(On)[Cn(511)](this,"".concat(Bi," ")[Cn(960)](Ct[0]))):_t(this,Si(On)[Cn(511)](this,""[Cn(960)](Bi,` `)[Cn(960)](Ct[Cn(1222)](` `),` `)))}else{var Bi=yn(Ci),Mi="",$i=Tn[za];za==="notDeepEqual"||Cn(1477)===za?1024<(Bi="".concat(Tn[za],` `)[Cn(960)](Bi))[Cn(293)]&&(Bi=""[Cn(960)](Bi.slice(0,1021),Cn(736))):(Mi=""[Cn(960)](yn(Ni)),512<Bi[Cn(293)]&&(Bi="".concat(Bi[Cn(1185)](0,509),Cn(736))),512<Mi[Cn(293)]&&(Mi=""[Cn(960)](Mi[Cn(1185)](0,509),Cn(736))),Cn(1416)===za||Cn(1188)===za?Bi=""[Cn(960)]($i,` `)[Cn(960)](Bi,` should equal `):Mi=" "[Cn(960)](za," ")[Cn(960)](Mi)),Sa=_t(this,Si(On)[Cn(511)](this,"".concat(Bi)[Cn(960)](Mi)))}var ur={};return ur[Cn(1438)]="AssertionError [ERR_ASSERTION]",ur[Cn(378)]=!1,ur.writable=!0,ur.configurable=!0,Error[Cn(1474)]=cr,Sa[Cn(1092)]=!Va,Object.defineProperty(Yt(Sa),"name",ur),Sa[Cn(1140)]="ERR_ASSERTION",Sa[Cn(288)]=Ci,Sa.expected=Ni,Sa[Cn(667)]=za,Error.captureStackTrace&&Error[Cn(694)](Yt(Sa),zr),Sa[Cn(1025)],Sa[Cn(1193)]="AssertionError",_t(Sa)}return fn[dn(1033)]=Object[dn(939)](Or&&Or.prototype,{constructor:{value:fn,writable:!0,configurable:!0}}),Or&&Lt(fn,Or),fn=[{key:dn(627),value:function(){var eo=dn;return""[eo(960)](this[eo(1193)]," [")[eo(960)](this[eo(1140)],eo(653)).concat(this[eo(317)])}},{key:wt[dn(1498)],value:function(eo,Cn){var Sa=dn,Va={};return Va.customInspect=!1,Va[Sa(1187)]=0,wt(this,function(za){for(var zr=Sa,Ci=1;Ci<arguments[zr(293)];Ci++){var Ni=arguments[Ci]!=null?arguments[Ci]:{},cr=Object[zr(1288)](Ni);(cr=zr(647)==typeof Object[zr(1471)]?cr[zr(960)](Object[zr(1471)](Ni)[zr(753)](function(Bi){var Ct=zr;return Object[Ct(287)](Ni,Bi)[Ct(378)]})):cr)[zr(538)](function(Bi){var Ct=zr,Mi=za,$i=Ni[Bi=Bi],ur={};ur[Ct(1438)]=$i,ur[Ct(378)]=!0,ur[Ct(532)]=!0,ur[Ct(705)]=!0,Bi in Mi?Object[Ct(1208)](Mi,Bi,ur):Mi[Bi]=$i})}return za}({},Cn,Va))}}],si(On[dn(1033)],fn),On}(),$t[Pe(533)]=ct},2136:($t,jt,ct)=>{var Pe=Ar;function Ht(nt){var wt=Ar;return(Ht=typeof Symbol=="function"&&wt(1245)==typeof Symbol[wt(397)]?function(yt){return typeof yt}:function(yt){var Tt=wt;return yt&&Tt(647)==typeof Symbol&&yt[Tt(376)]===Symbol&&yt!==Symbol[Tt(1033)]?"symbol":typeof yt})(nt)}function si(nt){var wt=Ar;return(si=Object[wt(1403)]?Object.getPrototypeOf:function(yt){var Tt=wt;return yt[Tt(534)]||Object[Tt(1216)](yt)})(nt)}function _t(nt,wt){var yt=Ar;return(_t=Object[yt(1403)]||function(Tt,Et){var ti=yt;return Tt[ti(534)]=Et,Tt})(nt,wt)}var Yt,Fi,Dt={};function Lt(nt,wt,yt){yt=yt||Error;var Tt=function(){var Et=Ar,ti=or,ir=yt;if(Et(647)!=typeof ir&&ir!==null)throw new TypeError(Et(1198));function or(xr,Tn,Ii){var pr=Et;if(this instanceof or)return(xr=function(yn,dn){var fn=Ar;if(!dn||Ht(dn)!=="object"&&fn(647)!=typeof dn){if(yn!==void 0)return yn;throw new ReferenceError(fn(876))}return dn}(this,si(or)[pr(511)](this,pr(665)==typeof wt?wt:wt(xr,Tn,Ii)))).code=nt,xr;throw new TypeError(pr(460))}return ti[Et(1033)]=Object[Et(939)](ir&&ir[Et(1033)],{constructor:{value:ti,writable:!0,configurable:!0}}),ir&&_t(ti,ir),or}();Dt[nt]=Tt}function Si(nt,wt){var yt=Ar,Tt;return Array[yt(1241)](nt)?(Tt=nt[yt(293)],nt=nt[yt(272)](function(Et){return String(Et)}),2<Tt?yt(1560)[yt(960)](wt," ")[yt(960)](nt[yt(1185)](0,Tt-1).join(", "),", or ")+nt[Tt-1]:Tt===2?yt(1560)[yt(960)](wt," ")[yt(960)](nt[0],yt(1408))[yt(960)](nt[1]):yt(1078)[yt(960)](wt," ")[yt(960)](nt[0])):yt(1078)[yt(960)](wt," ").concat(String(nt))}Lt(Pe(258),Pe(689),TypeError),Lt("ERR_INVALID_ARG_TYPE",function(nt,wt,yt){var Tt=Pe,Et,ti,ir,or;return(Yt=Yt===void 0?ct(9282):Yt)(typeof nt=="string","'name' must be a string"),Tt(665)==typeof wt&&wt[Tt(841)](0,Tt(1195)[Tt(293)])==="not "?(Et=Tt(418),wt=wt[Tt(1475)](/^not /,"")):Et=Tt(1087),(or===void 0||or>nt[Tt(293)])&&(or=nt[Tt(293)]),(nt.substring(or-(ir=" argument")[Tt(293)],or)===ir?Tt(931)[Tt(960)](nt," ")[Tt(960)](Et," ")[Tt(960)](Si(wt,"type")):(or=(ti=Tt(668)!=typeof ti?0:ti)+1>nt[Tt(293)]||nt.indexOf(".",ti)===-1?Tt(1308):Tt(838),Tt(652)[Tt(960)](nt,'" ')[Tt(960)](or," ")[Tt(960)](Et," ")[Tt(960)](Si(wt,Tt(1490)))))+Tt(861)[Tt(960)](Ht(yt))},TypeError),Lt(Pe(598),function(nt,wt){var yt=Pe,Tt=2<arguments[yt(293)]&&arguments[2]!==void 0?arguments[2]:yt(1199),Et=(Fi=Fi===void 0?ct(9539):Fi)[yt(1183)](wt);return 128<Et[yt(293)]&&(Et="".concat(Et[yt(1185)](0,128),yt(736))),yt(313)[yt(960)](nt,"' ")[yt(960)](Tt,yt(333))[yt(960)](Et)},TypeError,RangeError),Lt(Pe(896),function(nt,wt,yt){var Tt=Pe;return yt=yt&&yt[Tt(376)]&&yt[Tt(376)][Tt(1193)]?Tt(904)[Tt(960)](yt[Tt(376)][Tt(1193)]):Tt(1034)[Tt(960)](Ht(yt)),Tt(862)[Tt(960)](nt,Tt(1348))[Tt(960)](wt,'"')+" function but got ".concat(yt,".")},TypeError),Lt(Pe(618),function(){for(var nt=Pe,wt=arguments[nt(293)],ti=new Array(wt),yt=0;yt<wt;yt++)ti[yt]=arguments[yt];(Yt=Yt===void 0?ct(9282):Yt)(0<ti[nt(293)],"At least one arg needs to be specified");var Tt=nt(931),Et=ti[nt(293)],ti=ti[nt(272)](function(ir){var or=nt;return'"'[or(960)](ir,'"')});switch(Et){case 1:Tt+=""[nt(960)](ti[0],nt(1280));break;case 2:Tt+=""[nt(960)](ti[0]," and ")[nt(960)](ti[1],nt(1377));break;default:Tt=(Tt+=ti[nt(1185)](0,Et-1)[nt(1222)](", "))+nt(300).concat(ti[Et-1],nt(1377))}return""[nt(960)](Tt,nt(459))},TypeError),$t[Pe(533)][Pe(1103)]=Dt},9158:($t,jt,Et)=>{var Pe=Ar;function Ht(tt,$e){return function(St){if(Array.isArray(St))return St}(tt)||function(St,Zt){var ui=Ar,hr=[],Yr=!0,ln=!1,Kn=void 0;try{for(var Un,Qn=St[Symbol[ui(397)]]();!(Yr=(Un=Qn[ui(510)]())[ui(1449)])&&(hr[ui(622)](Un[ui(1438)]),!Zt||hr.length!==Zt);Yr=!0);}catch(Pa){ln=!0,Kn=Pa}finally{try{Yr||Qn.return==null||Qn[ui(1028)]()}finally{if(ln)throw Kn}}return hr}(tt,$e)||function(){var St=Ar;throw new TypeError(St(751))}()}function si(tt){var $e=Ar;return(si=$e(647)==typeof Symbol&&$e(1245)==typeof Symbol.iterator?function(St){return typeof St}:function(St){var Zt=$e;return St&&Zt(647)==typeof Symbol&&St[Zt(376)]===Symbol&&St!==Symbol[Zt(1033)]?"symbol":typeof St})(tt)}function _t(tt){var $e=Ar,St=[];return tt[$e(538)](function(Zt){var ui=$e;return St[ui(622)](Zt)}),St}function Yt(tt){var $e=[];return tt.forEach(function(St,Zt){var ui=Ar;return $e[ui(622)]([Zt,St])}),$e}var Fi=/a/g.flags!==void 0,Dt=Object.is||Et(609),Lt=Object[Pe(1471)]||function(){return[]},Si=Number[Pe(1173)]||Et(360);function nt(tt){var $e=Pe;return tt[$e(511)][$e(633)](tt)}var wt=nt(Object[Pe(1033)].hasOwnProperty),yt=nt(Object[Pe(1033)][Pe(948)]),Tt=nt(Object[Pe(1033)].toString),Et=Et(9539).types,ti=Et[Pe(1535)],ir=Et.isArrayBufferView,or=Et[Pe(1472)],xr=Et[Pe(690)],Tn=Et[Pe(1406)],Ii=Et[Pe(1118)],pr=Et.isNativeError,yn=Et.isBoxedPrimitive,dn=Et[Pe(407)],fn=Et[Pe(1075)],Or=Et[Pe(798)],On=Et.isBigIntObject,eo=Et[Pe(865)],Cn=Et[Pe(1037)],Sa=Et[Pe(958)];function Va(tt){var $e=Pe;if(tt.length===0||10<tt[$e(293)])return!0;for(var St=0;St<tt[$e(293)];St++){var Zt=tt.charCodeAt(St);if(Zt<48||57<Zt)return!0}return tt[$e(293)]===10&&tt>=Math[$e(1307)](2,32)}function za(tt){var $e=Pe;return Object[$e(1288)](tt).filter(Va).concat(Lt(tt)[$e(753)](Object[$e(1033)].propertyIsEnumerable.bind(tt)))}function zr(tt,$e){var St=Pe;if(tt===$e)return 0;for(var Zt=tt[St(293)],ui=$e[St(293)],hr=0,Yr=Math[St(1305)](Zt,ui);hr<Yr;++hr)if(tt[hr]!==$e[hr]){Zt=tt[hr],ui=$e[hr];break}return Zt<ui?-1:ui<Zt?1:0}var Ci=0,Ni=1,cr=2,Bi=3;function Ct(tt,$e,St,Zt){var ui=Pe;if(tt===$e)return tt!==0||!St||Dt(tt,$e);if(St){if(si(tt)!=="object")return typeof tt=="number"&&Si(tt)&&Si($e);if(ui(1206)!==si($e)||tt===null||$e===null||Object.getPrototypeOf(tt)!==Object[ui(1216)]($e))return!1}else{if(tt===null||si(tt)!=="object")return($e===null||si($e)!=="object")&&tt==$e;if($e===null||ui(1206)!==si($e))return!1}var hr=Tt(tt);if(hr!==Tt($e))return!1;if(Array[ui(1241)](tt)){if(tt[ui(293)]!==$e.length)return!1;var Yr=za(tt),ln=za($e);return Yr.length===ln[ui(293)]&&$i(tt,$e,St,Zt,Ni,Yr)}if(ui(1070)===hr&&(!xr(tt)&&xr($e)||!Ii(tt)&&Ii($e)))return!1;if(or(tt)){if(!or($e)||Date[ui(1033)].getTime[ui(511)](tt)!==Date[ui(1033)][ui(1096)][ui(511)]($e))return!1}else if(Tn(tt)){if(!Tn($e)||(ln=$e,Fi?tt[ui(679)]!==ln.source||tt.flags!==ln[ui(1252)]:RegExp[ui(1033)].toString.call(tt)!==RegExp[ui(1033)].toString[ui(511)](ln)))return!1}else if(pr(tt)||tt instanceof Error){if(tt.message!==$e[ui(317)]||tt.name!==$e.name)return!1}else{if(ir(tt)){if(St||!Cn(tt)&&!Sa(tt)){if(tt[ui(1505)]!==(Yr=$e)[ui(1505)]||zr(new Uint8Array(tt.buffer,tt[ui(723)],tt[ui(1505)]),new Uint8Array(Yr[ui(990)],Yr[ui(723)],Yr[ui(1505)]))!==0)return!1}else if(!function(Qn,Pa){var Gn=ui;if(Qn[Gn(1505)]===Pa.byteLength){for(var Ja=0;Ja<Qn[Gn(1505)];Ja++)if(Qn[Ja]!==Pa[Ja])return;return 1}}(tt,$e))return!1;var hr=za(tt),ln=za($e);return hr.length===ln[ui(293)]&&$i(tt,$e,St,Zt,Ci,hr)}if(Ii(tt))return!(!Ii($e)||tt[ui(800)]!==$e[ui(800)])&&$i(tt,$e,St,Zt,cr);if(xr(tt))return!(!xr($e)||tt[ui(800)]!==$e[ui(800)])&&$i(tt,$e,St,Zt,Bi);if(ti(tt)){if(tt[ui(1505)]!==(Yr=$e).byteLength||zr(new Uint8Array(tt),new Uint8Array(Yr))!==0)return!1}else if(yn(tt)&&(ln=$e,!(dn(hr=tt)?dn(ln)&&Dt(Number[ui(1033)][ui(539)].call(hr),Number[ui(1033)].valueOf[ui(511)](ln)):fn(hr)?fn(ln)&&String.prototype[ui(539)].call(hr)===String[ui(1033)][ui(539)].call(ln):Or(hr)?Or(ln)&&Boolean[ui(1033)][ui(539)][ui(511)](hr)===Boolean[ui(1033)].valueOf[ui(511)](ln):On(hr)?On(ln)&&BigInt[ui(1033)][ui(539)][ui(511)](hr)===BigInt[ui(1033)][ui(539)][ui(511)](ln):eo(ln)&&Symbol.prototype.valueOf.call(hr)===Symbol[ui(1033)][ui(539)][ui(511)](ln))))return!1}return $i(tt,$e,St,Zt,Ci)}function Mi(tt,$e){var St=Pe;return $e[St(753)](function(Zt){return yt(tt,Zt)})}function $i(tt,$e,St,Zt,ui,hr){var Yr=Pe;if(arguments[Yr(293)]===5){hr=Object[Yr(1288)](tt);var ln=Object.keys($e);if(hr[Yr(293)]!==ln.length)return!1}for(var Kn=0;Kn<hr[Yr(293)];Kn++)if(!wt($e,hr[Kn]))return!1;if(St&&arguments[Yr(293)]===5){var Un=Lt(tt);if(Un.length!==0){for(var Qn=0,Kn=0;Kn<Un[Yr(293)];Kn++){var Pa=Un[Kn];if(yt(tt,Pa)){if(!yt($e,Pa))return!1;hr[Yr(622)](Pa),Qn++}else if(yt($e,Pa))return!1}if(ln=Lt($e),Un.length!==ln[Yr(293)]&&Mi($e,ln)[Yr(293)]!==Qn)return!1}else if(ln=Lt($e),ln.length!==0&&Mi($e,ln).length!==0)return!1}if(hr.length===0&&(ui===Ci||ui===Ni&&tt[Yr(293)]===0||tt[Yr(800)]===0))return!0;if(Zt===void 0)Zt={val1:new Map,val2:new Map,position:0};else{if(ln=Zt.val1[Yr(1363)](tt),ln!==void 0){var Gn=Zt.val2[Yr(1363)]($e);if(Gn!==void 0)return ln===Gn}Zt.position++}return Zt[Yr(1107)][Yr(1024)](tt,Zt[Yr(1404)]),Zt[Yr(251)][Yr(1024)]($e,Zt[Yr(1404)]),ln=function(Ja,fl,Ul,hu,Ys,Wd){var Pc=Yr,So=0;if(Wd===cr){if(!function(Wl,Th,rr,mo){for(var Wn=Ar,yo,Ga,xu,qs=null,Cu=_t(Wl),na=0;na<Cu.length;na++){var gf=Cu[na];if(si(gf)==="object"&&gf!==null)(qs=qs===null?new Set:qs)[Wn(1170)](gf);else if(!Th[Wn(659)](gf)){if(rr||(yo=Wl,Ga=Th,xu=void 0,!((xu=Nr(gf))!=null?xu:Ga[Wn(659)](xu)&&!yo.has(xu))))return;(qs=qs===null?new Set:qs)[Wn(1170)](gf)}}if(qs===null)return 1;for(var Xi=_t(Th),ke=0;ke<Xi.length;ke++){var Ie=Xi[ke];if(Wn(1206)===si(Ie)&&Ie!==null){if(!ur(qs,Ie,rr,mo))return}else if(!rr&&!Wl.has(Ie)&&!ur(qs,Ie,rr,mo))return}return qs.size===0}(Ja,fl,Ul,Ys))return!1}else if(Wd===Bi){if(!function(Wl,Th,rr,mo){for(var Wn=Ar,yo=null,Ga=Yt(Wl),xu=0;xu<Ga[Wn(293)];xu++){var Cu=Ht(Ga[xu],2),qs=Cu[0],Cu=Cu[1];if(Wn(1206)===si(qs)&&qs!==null)(yo=yo===null?new Set:yo).add(qs);else{var na=Th.get(qs);if(na===void 0&&!Th[Wn(659)](qs)||!Ct(Cu,na,rr,mo)){if(rr||!function(Ie,He,dt,Vt){var ni=Wn,_r=Nr(qs);if(_r!=null)return _r;var Ir=He[ni(1363)](_r);return(Ir!==void 0||He[ni(659)](_r))&&Ct(dt,Ir,!1,Vt)&&!Ie[ni(659)](_r)&&Ct(dt,Ir,!1,Vt)}(Wl,Th,Cu,mo))return;(yo=yo===null?new Set:yo).add(qs)}}}if(yo===null)return 1;for(var gf=Yt(Th),Xi=0;Xi<gf[Wn(293)];Xi++){var ke=Ht(gf[Xi],2),qs=ke[0],ke=ke[1];if(Wn(1206)===si(qs)&&qs!==null){if(!qe(yo,Wl,qs,ke,rr,mo))return}else if(!(rr||Wl[Wn(659)](qs)&&Ct(Wl.get(qs),ke,!1,mo)||qe(yo,Wl,qs,ke,!1,mo)))return}return yo[Wn(800)]===0}(Ja,fl,Ul,Ys))return!1}else if(Wd===Ni)for(;So<Ja[Pc(293)];So++){if(!wt(Ja,So)){if(wt(fl,So))return!1;for(var Kh=Object[Pc(1288)](Ja);So<Kh[Pc(293)];So++){var mf=Kh[So];if(!wt(fl,mf)||!Ct(Ja[mf],fl[mf],Ul,Ys))return!1}return Kh[Pc(293)]===Object[Pc(1288)](fl)[Pc(293)]}if(!wt(fl,So)||!Ct(Ja[So],fl[So],Ul,Ys))return!1}for(So=0;So<hu.length;So++){var Gl=hu[So];if(!Ct(Ja[Gl],fl[Gl],Ul,Ys))return!1}return!0}(tt,$e,St,hr,Zt,ui),Zt[Yr(1107)][Yr(661)](tt),Zt.val2.delete($e),ln}function ur(tt,$e,St,Zt){for(var ui=Pe,hr=_t(tt),Yr=0;Yr<hr[ui(293)];Yr++){var ln=hr[Yr];if(Ct($e,ln,St,Zt))return tt.delete(ln),1}}function Nr(tt){var $e=Pe;switch(si(tt)){case $e(669):return null;case"object":return;case $e(1245):return!1;case"string":tt=+tt;case $e(668):if(Si(tt))return!1}return!0}function qe(tt,$e,St,Zt,ui,hr){for(var Yr=Pe,ln=_t(tt),Kn=0;Kn<ln[Yr(293)];Kn++){var Un=ln[Kn];if(Ct(St,Un,ui,hr)&&Ct(Zt,$e[Yr(1363)](Un),ui,hr))return tt[Yr(661)](Un),1}}$t[Pe(533)]={isDeepEqual:function(tt,$e){return Ct(tt,$e,!1)},isDeepStrictEqual:function(tt,$e){return Ct(tt,$e,!0)}}},6314:($t,jt,ct)=>{var Pe=Ar,Ht=[Pe(772),Pe(1119),"Float32Array",Pe(1317),Pe(1443),Pe(595),"Int8Array",Pe(603),Pe(746),Pe(880),"Uint8ClampedArray"],si=Pe(669)==typeof globalThis?ct.g:globalThis;$t[Pe(533)]=function(){for(var _t=Pe,Yt=[],Fi=0;Fi<Ht.length;Fi++)typeof si[Ht[Fi]]=="function"&&(Yt[Yt[_t(293)]]=Ht[Fi]);return Yt}},9669:($t,jt,ct)=>{var Pe=Ar;$t[Pe(533)]=ct(1609)},5448:($t,jt,ct)=>{var Pe=ct(4867),Ht=ct(6026),si=ct(4372),_t=ct(5327),Yt=ct(4097),Fi=ct(4109),Dt=ct(7985),Lt=ct(7874),Si=ct(2648),nt=ct(644),wt=ct(205);$t.exports=function(yt){return new Promise(function(Tt,Et){var ti=Ar,ir,dn=yt.data,or=yt[ti(553)],xr=yt[ti(1480)];function Tn(){var Or=ti;yt[Or(468)]&&yt[Or(468)][Or(320)](ir),yt[Or(601)]&&yt[Or(601)].removeEventListener(Or(768),ir)}Pe[ti(878)](dn)&&Pe.isStandardBrowserEnv()&&delete or[ti(1553)];var Ii=new XMLHttpRequest,pr=(yt[ti(881)]&&(pr=yt.auth[ti(1294)]||"",fn=yt[ti(881)][ti(680)]?unescape(encodeURIComponent(yt[ti(881)][ti(680)])):"",or[ti(858)]="Basic "+btoa(pr+":"+fn)),Yt(yt[ti(420)],yt.url));function yn(){var Or=ti,On;Ii&&(On="getAllResponseHeaders"in Ii?Fi(Ii[Or(660)]()):null,On={data:xr&&Or(365)!==xr&&Or(1272)!==xr?Ii[Or(818)]:Ii[Or(777)],status:Ii[Or(698)],statusText:Ii.statusText,headers:On,config:yt,request:Ii},Ht(function(eo){Tt(eo),Tn()},function(eo){Et(eo),Tn()},On),Ii=null)}Ii[ti(1223)](yt[ti(363)][ti(1388)](),_t(pr,yt[ti(279)],yt[ti(1398)]),!0),Ii.timeout=yt.timeout,ti(472)in Ii?Ii.onloadend=yn:Ii[ti(380)]=function(){var Or=ti;Ii&&Ii.readyState===4&&(Ii[Or(698)]!==0||Ii[Or(1291)]&&Ii.responseURL.indexOf(Or(357))===0)&&setTimeout(yn)},Ii[ti(792)]=function(){var Or=ti;Ii&&(Et(new Si(Or(995),Si[Or(1014)],yt,Ii)),Ii=null)},Ii.onerror=function(){var Or=ti;Et(new Si(Or(1459),Si.ERR_NETWORK,yt,Ii,Ii)),Ii=null},Ii.ontimeout=function(){var Or=ti,On=yt.timeout?Or(738)+yt.timeout+"ms exceeded":Or(806),eo=yt[Or(1120)]||Lt;yt[Or(1069)]&&(On=yt[Or(1069)]),Et(new Si(On,eo[Or(1056)]?Si.ETIMEDOUT:Si.ECONNABORTED,yt,Ii)),Ii=null},Pe[ti(1298)]()&&(fn=(yt[ti(924)]||Dt(pr))&&yt.xsrfCookieName?si[ti(846)](yt[ti(937)]):void 0)&&(or[yt[ti(319)]]=fn),ti(864)in Ii&&Pe[ti(538)](or,function(Or,On){var eo=ti;dn===void 0&&eo(448)===On[eo(1191)]()?delete or[On]:Ii[eo(864)](On,Or)}),Pe[ti(1359)](yt[ti(924)])||(Ii[ti(924)]=!!yt[ti(924)]),xr&&ti(1272)!==xr&&(Ii[ti(1480)]=yt[ti(1480)]),ti(647)==typeof yt[ti(1068)]&&Ii[ti(444)]("progress",yt[ti(1068)]),ti(647)==typeof yt[ti(1203)]&&Ii.upload&&Ii[ti(329)][ti(444)](ti(1155),yt.onUploadProgress),(yt[ti(468)]||yt[ti(601)])&&(ir=function(Or){var On=ti;Ii&&(Et(!Or||Or.type?new nt:Or),Ii[On(768)](),Ii=null)},yt[ti(468)]&&yt.cancelToken[ti(441)](ir),yt[ti(601)]&&(yt.signal[ti(1077)]?ir():yt[ti(601)][ti(444)](ti(768),ir)));var dn=dn||null,fn=wt(pr);fn&&[ti(504),ti(343),ti(1076)][ti(835)](fn)===-1?Et(new Si(ti(1493)+fn+":",Si[ti(620)],yt)):Ii[ti(1149)](dn)})}},1609:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867),si=ct(1849),_t=ct(321),Yt=ct(7185),Fi=function Dt(Lt){var Si=Ar,nt=new _t(Lt),wt=si(_t[Si(1033)][Si(766)],nt);return Ht[Si(477)](wt,_t.prototype,nt),Ht[Si(477)](wt,nt),wt[Si(939)]=function(yt){return Dt(Yt(Lt,yt))},wt}(ct(5546));Fi[Pe(868)]=_t,Fi[Pe(1053)]=ct(644),Fi[Pe(350)]=ct(4972),Fi[Pe(1002)]=ct(6502),Fi[Pe(401)]=ct(7288).version,Fi[Pe(1094)]=ct(7675),Fi.AxiosError=ct(2648),Fi[Pe(1373)]=Fi[Pe(1053)],Fi.all=function(Dt){var Lt=Pe;return Promise[Lt(1367)](Dt)},Fi[Pe(750)]=ct(8713),Fi[Pe(621)]=ct(6268),$t[Pe(533)]=Fi,$t[Pe(533)].default=Fi},4972:($t,jt,ct)=>{var Pe=Ar,Ht=ct(644);function si(_t){var Yt=Ar;if(Yt(647)!=typeof _t)throw new TypeError("executor must be a function.");this[Yt(1276)]=new Promise(function(Lt){Fi=Lt});var Fi,Dt=this;this[Yt(1276)][Yt(283)](function(Lt){var Si=Yt;if(Dt[Si(959)]){for(var nt=Dt[Si(959)][Si(293)],wt=0;wt<nt;wt++)Dt[Si(959)][wt](Lt);Dt[Si(959)]=null}}),this[Yt(1276)][Yt(283)]=function(nt){var Si,nt=new Promise(function(wt){Dt.subscribe(wt),Si=wt}).then(nt);return nt.cancel=function(){var wt=Ar;Dt[wt(320)](Si)},nt},_t(function(Lt){var Si=Yt;Dt[Si(1413)]||(Dt[Si(1413)]=new Ht(Lt),Fi(Dt[Si(1413)]))})}si[Pe(1033)][Pe(596)]=function(){var _t=Pe;if(this[_t(1413)])throw this.reason},si[Pe(1033)][Pe(441)]=function(_t){var Yt=Pe;this[Yt(1413)]?_t(this[Yt(1413)]):this._listeners?this._listeners[Yt(622)](_t):this._listeners=[_t]},si[Pe(1033)].unsubscribe=function(_t){var Yt=Pe;this[Yt(959)]&&(_t=this[Yt(959)][Yt(835)](_t))!==-1&&this[Yt(959)][Yt(1334)](_t,1)},si[Pe(679)]=function(){var _t;return{token:new si(function(Yt){_t=Yt}),cancel:_t}},$t[Pe(533)]=si},644:($t,jt,ct)=>{var Pe=Ar,Ht=ct(2648);function si(Yt){var Fi=Ar;Ht[Fi(511)](this,Yt??Fi(985),Ht[Fi(744)]),this.name=Fi(1053)}var _t={};_t[Pe(1431)]=!0,ct(4867)[Pe(895)](si,Ht,_t),$t[Pe(533)]=si},6502:$t=>{var jt=Ar;$t[jt(533)]=function(ct){var Pe=jt;return!(!ct||!ct[Pe(1431)])}},321:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867),si=ct(5327),_t=ct(782),Yt=ct(3572),Fi=ct(7185),Dt=ct(4097),Lt=ct(4875),Si=Lt[Pe(1466)];function nt(wt){var yt=Pe;this[yt(312)]=wt,this.interceptors={request:new _t,response:new _t}}nt.prototype[Pe(766)]=function(ti,yt){var Tt=Pe;typeof ti=="string"?(yt=yt||{}).url=ti:yt=ti||{},(yt=Fi(this.defaults,yt))[Tt(363)]?yt[Tt(363)]=yt[Tt(363)].toLowerCase():this[Tt(312)][Tt(363)]?yt[Tt(363)]=this.defaults[Tt(363)][Tt(1191)]():yt[Tt(363)]=Tt(1363);var Et,ti=yt[Tt(1120)],ir=(ti!==void 0&&Lt[Tt(1086)](ti,{silentJSONParsing:Si[Tt(1120)](Si[Tt(987)]),forcedJSONParsing:Si.transitional(Si[Tt(987)]),clarifyTimeoutError:Si[Tt(1120)](Si[Tt(987)])},!1),[]),or=!0,xr=(this.interceptors.request[Tt(538)](function(dn){var fn=Tt;typeof dn[fn(1225)]=="function"&&dn[fn(1225)](yt)===!1||(or=or&&dn[fn(1047)],ir.unshift(dn[fn(943)],dn[fn(349)]))}),[]);if(this[Tt(513)].response.forEach(function(dn){xr.push(dn.fulfilled,dn.rejected)}),!or){var Tn=[Yt,void 0];for(Array[Tt(1033)][Tt(1269)][Tt(306)](Tn,ir),Tn=Tn.concat(xr),Et=Promise.resolve(yt);Tn[Tt(293)];)Et=Et.then(Tn[Tt(1513)](),Tn[Tt(1513)]());return Et}for(var Ii=yt;ir.length;){var pr=ir[Tt(1513)](),yn=ir.shift();try{Ii=pr(Ii)}catch(dn){yn(dn);break}}try{Et=Yt(Ii)}catch(dn){return Promise[Tt(489)](dn)}for(;xr.length;)Et=Et[Tt(283)](xr.shift(),xr[Tt(1513)]());return Et},nt[Pe(1033)][Pe(514)]=function(wt){var yt=Pe;wt=Fi(this[yt(312)],wt);var Tt=Dt(wt[yt(420)],wt[yt(285)]);return si(Tt,wt.params,wt[yt(1398)])},Ht.forEach([Pe(661),Pe(1363),"head",Pe(1157)],function(wt){nt.prototype[wt]=function(yt,Tt){return this.request(Fi(Tt||{},{method:wt,url:yt,data:(Tt||{}).data}))}}),Ht[Pe(538)]([Pe(909),Pe(910),Pe(267)],function(wt){var yt=Pe;function Tt(Et){return function(ti,ir,or){var xr=Ar,Tn={};Tn[xr(1553)]="multipart/form-data";var Ii={};return Ii[xr(363)]=wt,Ii[xr(553)]=Et?Tn:{},Ii[xr(285)]=ti,Ii[xr(1242)]=ir,this[xr(766)](Fi(or||{},Ii))}}nt.prototype[wt]=Tt(),nt[yt(1033)][wt+yt(1327)]=Tt(!0)}),$t[Pe(533)]=nt},2648:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867);function si(Lt,Si,nt,wt,yt){var Tt=Ar;Error[Tt(511)](this),this.message=Lt,this[Tt(1193)]=Tt(612),Si&&(this[Tt(1140)]=Si),nt&&(this[Tt(1424)]=nt),wt&&(this.request=wt),yt&&(this[Tt(818)]=yt)}var _t={};_t[Pe(1106)]=function(){var Lt=Pe,Si={};return Si[Lt(317)]=this[Lt(317)],Si.name=this[Lt(1193)],Si[Lt(1551)]=this.description,Si.number=this[Lt(668)],Si.fileName=this[Lt(586)],Si.lineNumber=this[Lt(1001)],Si[Lt(1339)]=this[Lt(1339)],Si[Lt(1025)]=this.stack,Si.config=this.config,Si.code=this[Lt(1140)],Si[Lt(698)]=this[Lt(818)]&&this[Lt(818)][Lt(698)]?this[Lt(818)][Lt(698)]:null,Si},Ht[Pe(895)](si,Error,_t);var Yt=si.prototype,Fi={},Dt={};Dt[Pe(1438)]=!0,[Pe(1114),Pe(978),"ECONNABORTED",Pe(1540),"ERR_NETWORK",Pe(1510),Pe(599),Pe(1461),"ERR_BAD_REQUEST",Pe(744)][Pe(538)](function(Lt){Fi[Lt]={value:Lt}}),Object[Pe(1341)](si,Fi),Object[Pe(1208)](Yt,Pe(621),Dt),si[Pe(301)]=function(Lt,Si,nt,wt,yt,Tt){var Et=Pe,ti=Object[Et(939)](Yt);return Ht[Et(508)](Lt,ti,function(ir){return ir!==Error.prototype}),si[Et(511)](ti,Lt.message,Si,nt,wt,yt),ti.name=Lt[Et(1193)],Tt&&Object[Et(1369)](ti,Tt),ti},$t[Pe(533)]=si},782:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867);function si(){var _t=Ar;this[_t(1046)]=[]}si.prototype.use=function(_t,Yt,Fi){var Dt=Ar,Lt={};return Lt[Dt(943)]=_t,Lt[Dt(349)]=Yt,Lt[Dt(1047)]=!!Fi&&Fi.synchronous,Lt[Dt(1225)]=Fi?Fi[Dt(1225)]:null,this[Dt(1046)][Dt(622)](Lt),this.handlers[Dt(293)]-1},si[Pe(1033)][Pe(410)]=function(_t){var Yt=Pe;this[Yt(1046)][_t]&&(this.handlers[_t]=null)},si[Pe(1033)][Pe(538)]=function(_t){Ht.forEach(this.handlers,function(Yt){Yt!==null&&_t(Yt)})},$t[Pe(533)]=si},4097:($t,jt,ct)=>{var Pe=Ar,Ht=ct(1793),si=ct(7303);$t[Pe(533)]=function(_t,Yt){return _t&&!Ht(Yt)?si(_t,Yt):Yt}},3572:($t,jt,ct)=>{var Pe=ct(4867),Ht=ct(8527),si=ct(6502),_t=ct(5546),Yt=ct(644);function Fi(Dt){var Lt=Ar;if(Dt.cancelToken&&Dt[Lt(468)][Lt(596)](),Dt[Lt(601)]&&Dt.signal[Lt(1077)])throw new Yt}$t.exports=function(Dt){var Lt=Ar;return Fi(Dt),Dt[Lt(553)]=Dt[Lt(553)]||{},Dt[Lt(1242)]=Ht[Lt(511)](Dt,Dt[Lt(1242)],Dt.headers,Dt[Lt(535)]),Dt[Lt(553)]=Pe[Lt(1344)](Dt[Lt(553)][Lt(642)]||{},Dt.headers[Dt.method]||{},Dt.headers),Pe[Lt(538)]([Lt(661),Lt(1363),Lt(1129),"post",Lt(910),Lt(267),"common"],function(Si){delete Dt.headers[Si]}),(Dt[Lt(554)]||_t[Lt(554)])(Dt)[Lt(283)](function(Si){var nt=Lt;return Fi(Dt),Si[nt(1242)]=Ht[nt(511)](Dt,Si[nt(1242)],Si[nt(553)],Dt[nt(536)]),Si},function(Si){var nt=Lt;return si(Si)||(Fi(Dt),Si&&Si[nt(818)]&&(Si[nt(818)][nt(1242)]=Ht[nt(511)](Dt,Si.response[nt(1242)],Si[nt(818)][nt(553)],Dt.transformResponse))),Promise[nt(489)](Si)})}},7185:($t,jt,ct)=>{var Pe=ct(4867);$t.exports=function(Ht,si){var _t=Ar;si=si||{};var Yt={};function Fi(Tt,Et){var ti=Ar;return Pe[ti(295)](Tt)&&Pe[ti(295)](Et)?Pe[ti(1344)](Tt,Et):Pe.isPlainObject(Et)?Pe[ti(1344)]({},Et):Pe[ti(1241)](Et)?Et[ti(1185)]():Et}function Dt(Tt){var Et=Ar;return Pe[Et(1359)](si[Tt])?Pe[Et(1359)](Ht[Tt])?void 0:Fi(void 0,Ht[Tt]):Fi(Ht[Tt],si[Tt])}function Lt(Tt){var Et=Ar;if(!Pe[Et(1359)](si[Tt]))return Fi(void 0,si[Tt])}function Si(Tt){var Et=Ar;return Pe[Et(1359)](si[Tt])?Pe[Et(1359)](Ht[Tt])?void 0:Fi(void 0,Ht[Tt]):Fi(void 0,si[Tt])}function nt(Tt){return Tt in si?Fi(Ht[Tt],si[Tt]):Tt in Ht?Fi(void 0,Ht[Tt]):void 0}var wt={};wt.url=Lt,wt[_t(363)]=Lt,wt[_t(1242)]=Lt,wt.baseURL=Si,wt[_t(535)]=Si,wt[_t(536)]=Si,wt[_t(1398)]=Si,wt.timeout=Si,wt[_t(848)]=Si,wt.withCredentials=Si,wt[_t(554)]=Si,wt[_t(1480)]=Si,wt[_t(937)]=Si,wt[_t(319)]=Si,wt[_t(1203)]=Si,wt[_t(1068)]=Si,wt[_t(1161)]=Si,wt[_t(522)]=Si,wt[_t(367)]=Si,wt[_t(1064)]=Si,wt[_t(481)]=Si,wt.httpAgent=Si,wt.httpsAgent=Si,wt.cancelToken=Si,wt.socketPath=Si,wt[_t(715)]=Si,wt[_t(590)]=nt;var yt=wt;return Pe.forEach(Object[_t(1288)](Ht)[_t(960)](Object[_t(1288)](si)),function(Tt){var Et=_t,ti=yt[Tt]||Dt,ir=ti(Tt);Pe[Et(1359)](ir)&&ti!==nt||(Yt[Tt]=ir)}),Yt}},6026:($t,jt,ct)=>{var Pe=Ar,Ht=ct(2648);$t[Pe(533)]=function(si,_t,Yt){var Fi=Pe,Dt=Yt[Fi(1424)].validateStatus;Yt[Fi(698)]&&Dt&&!Dt(Yt[Fi(698)])?_t(new Ht("Request failed with status code "+Yt[Fi(698)],[Ht[Fi(620)],Ht[Fi(1461)]][Math.floor(Yt[Fi(698)]/100)-4],Yt[Fi(1424)],Yt[Fi(766)],Yt)):si(Yt)}},8527:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867),si=ct(5546);$t[Pe(533)]=function(_t,Yt,Fi){var Dt=Pe,Lt=this||si;return Ht[Dt(538)](Fi,function(Si){var nt=Dt;_t=Si[nt(511)](Lt,_t,Yt)}),_t}},5546:($t,jt,ct)=>{var Pe=Ar,Ht={};Ht[Pe(1553)]=Pe(666);var si=ct(4155),_t=ct(4867),Yt=ct(6016),Fi=ct(2648),Dt=ct(7874),Lt=ct(7675),Si=Ht;function nt(ti,ir){var or=Pe;!_t[or(1359)](ti)&&_t.isUndefined(ti["Content-Type"])&&(ti[or(1553)]=ir)}var wt={};wt[Pe(1200)]="application/json, text/plain, */*";var yt={};yt[Pe(642)]=wt;var Tt,Et={transitional:Dt,adapter:Tt=typeof XMLHttpRequest<"u"||si!==void 0&&Object[Pe(1033)][Pe(627)][Pe(511)](si)==="[object process]"?ct(5448):Tt,transformRequest:[function(ti,ir){var or=Pe;if(Yt(ir,or(1200)),Yt(ir,or(1553)),_t[or(878)](ti)||_t[or(1221)](ti)||_t[or(953)](ti)||_t[or(814)](ti)||_t[or(1297)](ti)||_t[or(762)](ti))return ti;if(_t[or(1387)](ti))return ti[or(990)];if(_t[or(434)](ti))return nt(ir,or(1162)),ti[or(627)]();var xr,Tn=_t[or(371)](ti),Ii=ir&&ir[or(1553)];if((pr=_t[or(1539)](ti))||Tn&&Ii==="multipart/form-data")return xr=this[or(559)]&&this[or(559)][or(1371)],Lt(pr?{"files[]":ti}:ti,xr&&new xr);if(Tn||or(1274)===Ii){nt(ir,"application/json");var pr=ti;if(_t[or(1352)](pr))try{return(0,JSON.parse)(pr),_t.trim(pr)}catch(yn){if(or(888)!==yn.name)throw yn}return(0,JSON[or(1414)])(pr)}return ti}],transformResponse:[function(ti){var ir=Pe,or=this[ir(1120)]||Et[ir(1120)],xr=or&&or[ir(913)],or=or&&or.forcedJSONParsing,xr=!xr&&ir(1272)===this[ir(1480)];if(xr||or&&_t[ir(1352)](ti)&&ti.length)try{return JSON.parse(ti)}catch(Tn){if(xr)throw ir(888)===Tn[ir(1193)]?Fi[ir(301)](Tn,Fi[ir(1461)],this,null,this[ir(818)]):Tn}return ti}],timeout:0,xsrfCookieName:Pe(743),xsrfHeaderName:Pe(368),maxContentLength:-1,maxBodyLength:-1,env:{FormData:ct(1623)},validateStatus:function(ti){return 200<=ti&&ti<300},headers:yt};_t[Pe(538)]([Pe(661),Pe(1363),Pe(1129)],function(ti){var ir=Pe;Et[ir(553)][ti]={}}),_t.forEach(["post",Pe(910),Pe(267)],function(ti){var ir=Pe;Et.headers[ti]=_t[ir(1344)](Si)}),$t[Pe(533)]=Et},7874:$t=>{var jt=Ar,ct={};ct[jt(913)]=!0,ct.forcedJSONParsing=!0,ct.clarifyTimeoutError=!1,$t[jt(533)]=ct},7288:$t=>{var jt=Ar,ct={};ct.version=jt(1380),$t[jt(533)]=ct},1849:$t=>{var jt=Ar;$t[jt(533)]=function(ct,Pe){return function(){for(var Ht=Ar,si=new Array(arguments[Ht(293)]),_t=0;_t<si[Ht(293)];_t++)si[_t]=arguments[_t];return ct[Ht(306)](Pe,si)}}},5327:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867);function si(_t){var Yt=Ar;return encodeURIComponent(_t)[Yt(1475)](/%3A/gi,":")[Yt(1475)](/%24/g,"$")[Yt(1475)](/%2C/gi,",")[Yt(1475)](/%20/g,"+")[Yt(1475)](/%5B/gi,"[").replace(/%5D/gi,"]")}$t[Pe(533)]=function(_t,Yt,Si){var Dt=Pe;if(!Yt)return _t;var Lt,Si=Si?Si(Yt):Ht[Dt(434)](Yt)?Yt.toString():(Lt=[],Ht.forEach(Yt,function(nt,wt){var yt=Dt;nt!=null&&(Ht[yt(1241)](nt)?wt+="[]":nt=[nt],Ht[yt(538)](nt,function(Tt){var Et=yt;Ht[Et(1472)](Tt)?Tt=Tt[Et(890)]():Ht.isObject(Tt)&&(Tt=JSON[Et(1414)](Tt)),Lt[Et(622)](si(wt)+"="+si(Tt))}))}),Lt[Dt(1222)]("&"));return Si&&((Yt=_t[Dt(835)]("#"))!==-1&&(_t=_t[Dt(1185)](0,Yt)),_t+=(_t[Dt(835)]("?")===-1?"?":"&")+Si),_t}},7303:$t=>{var jt=Ar;$t[jt(533)]=function(ct,Pe){var Ht=jt;return Pe?ct[Ht(1475)](/\/+$/,"")+"/"+Pe[Ht(1475)](/^\/+/,""):ct}},4372:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867),si={};si[Pe(713)]=function(){},si.read=function(){return null},si[Pe(1041)]=function(){},$t.exports=Ht[Pe(1298)]()?{write:function(_t,Yt,Fi,Dt,Lt,Si){var nt=Pe,wt=[];wt[nt(622)](_t+"="+encodeURIComponent(Yt)),Ht[nt(540)](Fi)&&wt[nt(622)]("expires="+new Date(Fi)[nt(404)]()),Ht[nt(1352)](Dt)&&wt[nt(622)]("path="+Dt),Ht[nt(1352)](Lt)&&wt[nt(622)](nt(1160)+Lt),Si===!0&&wt.push(nt(1548)),document[nt(1520)]=wt[nt(1222)]("; ")},read:function(_t){var Yt=Pe;return _t=document[Yt(1520)][Yt(1239)](new RegExp(Yt(899)+_t+Yt(377))),_t?decodeURIComponent(_t[3]):null},remove:function(_t){var Yt=Pe;this.write(_t,"",Date[Yt(856)]()-864e5)}}:si},1793:$t=>{$t.exports=function(jt){var ct=Ar;return/^([a-z][a-z\d+\-.]*:)?\/\//i[ct(1347)](jt)}},6268:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867);$t[Pe(533)]=function(si){var _t=Pe;return Ht[_t(371)](si)&&si[_t(621)]===!0}},7985:($t,jt,ct)=>{var Pe=Ar,Ht,si,_t,Yt=ct(4867);function Fi(Dt){var Lt=Ar;return si&&(_t[Lt(1563)]("href",Dt),Dt=_t[Lt(1100)]),_t[Lt(1563)]("href",Dt),{href:_t[Lt(1100)],protocol:_t[Lt(479)]?_t[Lt(479)].replace(/:$/,""):"",host:_t.host,search:_t.search?_t.search[Lt(1475)](/^\?/,""):"",hash:_t[Lt(894)]?_t[Lt(894)][Lt(1475)](/^#/,""):"",hostname:_t[Lt(327)],port:_t[Lt(1295)],pathname:_t[Lt(832)][Lt(1514)](0)==="/"?_t[Lt(832)]:"/"+_t[Lt(832)]}}$t.exports=Yt[Pe(1298)]()?(si=/(msie|trident)/i[Pe(1347)](navigator[Pe(625)]),_t=document[Pe(1525)]("a"),Ht=Fi(window[Pe(709)][Pe(1100)]),function(Dt){var Lt=Pe;return Dt=Yt[Lt(1352)](Dt)?Fi(Dt):Dt,Dt[Lt(479)]===Ht[Lt(479)]&&Dt.host===Ht.host}):function(){return!0}},6016:($t,jt,ct)=>{var Pe=ct(4867);$t.exports=function(Ht,si){Pe.forEach(Ht,function(_t,Yt){var Fi=Ar;Yt!==si&&Yt[Fi(1388)]()===si[Fi(1388)]()&&(Ht[si]=_t,delete Ht[Yt])})}},1623:$t=>{var jt=Ar;$t[jt(533)]=null},4109:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4867),si=["age",Pe(852),Pe(342),Pe(448),"etag",Pe(733),Pe(301),Pe(795),"if-modified-since","if-unmodified-since","last-modified",Pe(709),Pe(1562),"proxy-authorization",Pe(650),"retry-after","user-agent"];$t[Pe(533)]=function(_t){var Yt=Pe,Fi,Dt,Lt={};return _t&&Ht[Yt(538)](_t[Yt(277)](` `),function(Si){var nt=Yt;Dt=Si.indexOf(":"),Fi=Ht[nt(1546)](Si[nt(841)](0,Dt))[nt(1191)](),Dt=Ht[nt(1546)](Si[nt(841)](Dt+1)),!Fi||Lt[Fi]&&0<=si[nt(835)](Fi)||(Lt[Fi]=nt(616)===Fi?(Lt[Fi]||[])[nt(960)]([Dt]):Lt[Fi]?Lt[Fi]+", "+Dt:Dt)}),Lt}},205:$t=>{var jt=Ar;$t[jt(533)]=function(ct){return ct=/^([-+\w]{1,25})(:?\/\/|:)/.exec(ct),ct&&ct[1]||""}},8713:$t=>{var jt=Ar;$t[jt(533)]=function(ct){return function(Pe){var Ht=Ar;return ct[Ht(306)](null,Pe)}}},7675:($t,jt,ct)=>{var Pe=Ar,Ht=ct(8764)[Pe(1500)],si=ct(4867);$t[Pe(533)]=function(_t,Yt){Yt=Yt||new FormData;var Fi=[];function Dt(Lt){var Si=Ar;return Lt===null?"":si[Si(1472)](Lt)?Lt[Si(890)]():si[Si(1221)](Lt)||si[Si(1224)](Lt)?Si(647)==typeof Blob?new Blob([Lt]):Ht[Si(301)](Lt):Lt}return function Lt(Si,nt){var wt=Ar;if(si[wt(295)](Si)||si[wt(1241)](Si)){if(Fi[wt(835)](Si)!==-1)throw Error(wt(615)+nt);Fi[wt(622)](Si),si[wt(538)](Si,function(yt,Tt){var Et=wt;if(!si[Et(1359)](yt)){var ti=nt?nt+"."+Tt:Tt;if(yt&&!nt&&typeof yt=="object"){if(si[Et(486)](Tt,"{}"))yt=JSON[Et(1414)](yt);else if(si.endsWith(Tt,"[]")&&(Tt=si[Et(579)](yt)))return void Tt[Et(538)](function(ir){var or=Et;si[or(1359)](ir)||Yt[or(556)](ti,Dt(ir))})}Lt(yt,ti)}}),Fi.pop()}else Yt.append(nt,Dt(Si))}(_t),Yt}},4875:($t,jt,ct)=>{var Pe=Ar,Ht=ct(5108),si=ct(7288)[Pe(923)],_t=ct(2648),Yt={},Fi=([Pe(1206),Pe(987),Pe(668),Pe(647),Pe(665),Pe(1245)].forEach(function(Dt,Lt){Yt[Dt]=function(Si){return typeof Si===Dt||"a"+(Lt<1?"n ":" ")+Dt}}),{});Yt[Pe(1120)]=function(Dt,Lt,Si){function nt(wt,yt){var Tt=Ar;return"[Axios v"+si+Tt(877)+wt+"'"+yt+(Si?". "+Si:"")}return function(wt,yt,Tt){var Et=Ar;if(Dt===!1)throw new _t(nt(yt,Et(1220)+(Lt?Et(707)+Lt:"")),_t[Et(599)]);return Lt&&!Fi[yt]&&(Fi[yt]=!0,Ht.warn(nt(yt,Et(936)+Lt+Et(1320)))),!Dt||Dt(wt,yt,Tt)}},$t[Pe(533)]={assertOptions:function(Dt,Lt,Si){var nt=Pe;if(typeof Dt!="object")throw new _t(nt(1110),_t[nt(1114)]);for(var wt=Object[nt(1288)](Dt),yt=wt[nt(293)];0<yt--;){var Tt=wt[yt],Et=Lt[Tt];if(Et){var ti=Dt[Tt],Et=ti===void 0||Et(ti,Tt,Dt);if(Et!==!0)throw new _t("option "+Tt+nt(1101)+Et,_t[nt(1114)])}else if(Si!==!0)throw new _t("Unknown option "+Tt,_t[nt(978)])}},validators:Yt}},4867:($t,jt,yt)=>{var Pe=Ar;function Ht(Ii){var pr=Ar;return Ii=Yt[pr(511)](Ii),si[Ii]||(si[Ii]=Ii[pr(1185)](8,-1)[pr(1191)]())}var si,_t=yt(1849),Yt=Object.prototype[Pe(627)];si=Object.create(null);function Fi(Ii){var pr=Pe;return Ii=Ii[pr(1191)](),function(yn){return Ht(yn)===Ii}}function Dt(Ii){var pr=Pe;return Array[pr(1241)](Ii)}function Lt(Ii){return Ii===void 0}var Si=Fi(Pe(866));function nt(Ii){return Ii!==null&&typeof Ii=="object"}function wt(Ii){var pr=Pe;return pr(1206)!==Ht(Ii)?!1:(Ii=Object[pr(1216)](Ii),Ii===null||Ii===Object.prototype)}var yt=Fi(Pe(567)),Tt=Fi(Pe(1391)),Et=Fi("Blob"),ti=Fi(Pe(1527));function ir(Ii){return Yt.call(Ii)==="[object Function]"}var or,xr=Fi(Pe(425));function Tn(Ii,pr){var yn=Pe;if(Ii!=null)if(Dt(Ii=typeof Ii!="object"?[Ii]:Ii))for(var dn=0,fn=Ii[yn(293)];dn<fn;dn++)pr[yn(511)](null,Ii[dn],dn,Ii);else for(var Or in Ii)Object[yn(1033)].hasOwnProperty[yn(511)](Ii,Or)&&pr[yn(511)](null,Ii[Or],Or,Ii)}or=Pe(669)!=typeof Uint8Array&&Object[Pe(1216)](Uint8Array),$t[Pe(533)]={isArray:Dt,isArrayBuffer:Si,isBuffer:function(Ii){var pr=Pe;return Ii!==null&&!Lt(Ii)&&Ii[pr(376)]!==null&&!Lt(Ii[pr(376)])&&pr(647)==typeof Ii[pr(376)][pr(953)]&&Ii[pr(376)][pr(953)](Ii)},isFormData:function(Ii){var pr=Pe,yn=pr(1228);return Ii&&(pr(647)==typeof FormData&&Ii instanceof FormData||Yt[pr(511)](Ii)===yn||ir(Ii[pr(627)])&&Ii[pr(627)]()===yn)},isArrayBufferView:function(Ii){var pr=Pe;return pr(669)!=typeof ArrayBuffer&&ArrayBuffer[pr(1236)]?ArrayBuffer[pr(1236)](Ii):Ii&&Ii[pr(990)]&&Si(Ii[pr(990)])},isString:function(Ii){var pr=Pe;return pr(665)==typeof Ii},isNumber:function(Ii){return typeof Ii=="number"},isObject:nt,isPlainObject:wt,isUndefined:Lt,isDate:yt,isFile:Tt,isBlob:Et,isFunction:ir,isStream:function(Ii){var pr=Pe;return nt(Ii)&&ir(Ii[pr(1270)])},isURLSearchParams:xr,isStandardBrowserEnv:function(){var Ii=Pe;return(Ii(669)==typeof navigator||navigator[Ii(1126)]!=="ReactNative"&&navigator[Ii(1126)]!=="NativeScript"&&navigator[Ii(1126)]!=="NS")&&Ii(669)!=typeof window&&Ii(669)!=typeof document},forEach:Tn,merge:function Ii(){var pr={};function yn(Or,On){wt(pr[On])&&wt(Or)?pr[On]=Ii(pr[On],Or):wt(Or)?pr[On]=Ii({},Or):Dt(Or)?pr[On]=Or.slice():pr[On]=Or}for(var dn=0,fn=arguments.length;dn<fn;dn++)Tn(arguments[dn],yn);return pr},extend:function(Ii,pr,yn){return Tn(pr,function(dn,fn){var Or=Ar;Ii[fn]=yn&&Or(647)==typeof dn?_t(dn,yn):dn}),Ii},trim:function(Ii){var pr=Pe;return Ii[pr(1546)]?Ii[pr(1546)]():Ii[pr(1475)](/^\s+|\s+$/g,"")},stripBOM:function(Ii){var pr=Pe;return Ii[pr(968)](0)===65279?Ii[pr(1185)](1):Ii},inherits:function(Ii,pr,yn,dn){var fn=Pe;Ii[fn(1033)]=Object.create(pr[fn(1033)],dn),Ii[fn(1033)][fn(376)]=Ii,yn&&Object[fn(1369)](Ii[fn(1033)],yn)},toFlatObject:function(Ii,pr,yn){var dn=Pe,fn,Or,On,eo={};pr=pr||{};do for(Or=(fn=Object[dn(602)](Ii))[dn(293)];0<Or--;)eo[On=fn[Or]]||(pr[On]=Ii[On],eo[On]=!0);while((Ii=Object[dn(1216)](Ii))&&(!yn||yn(Ii,pr))&&Ii!==Object[dn(1033)]);return pr},kindOf:Ht,kindOfTest:Fi,endsWith:function(Ii,pr,yn){var dn=Pe;return Ii=String(Ii),(yn===void 0||yn>Ii[dn(293)])&&(yn=Ii[dn(293)]),yn-=pr[dn(293)],Ii=Ii[dn(835)](pr,yn),Ii!==-1&&Ii===yn},toArray:function(Ii){if(!Ii)return null;var pr=Ii.length;if(Lt(pr))return null;for(var yn=new Array(pr);0<pr--;)yn[pr]=Ii[pr];return yn},isTypedArray:function(Ii){return or&&Ii instanceof or},isFileList:ti}},9742:($t,jt)=>{var ct=Ar;jt.byteLength=function(nt){var nt=Dt(nt),Si=nt[0],nt=nt[1];return 3*(Si+nt)/4-nt},jt[ct(758)]=function(Lt){for(var Si=ct,nt,yt=Dt(Lt),wt=yt[0],yt=yt[1],Tt=new si(3*(wt+yt)/4-yt),Et=0,ti=0<yt?wt-4:wt,ir=0;ir<ti;ir+=4)nt=Ht[Lt[Si(968)](ir)]<<18|Ht[Lt.charCodeAt(ir+1)]<<12|Ht[Lt[Si(968)](ir+2)]<<6|Ht[Lt[Si(968)](ir+3)],Tt[Et++]=nt>>16&255,Tt[Et++]=nt>>8&255,Tt[Et++]=255&nt;return yt===2&&(nt=Ht[Lt[Si(968)](ir)]<<2|Ht[Lt[Si(968)](ir+1)]>>4,Tt[Et++]=255&nt),yt===1&&(nt=Ht[Lt[Si(968)](ir)]<<10|Ht[Lt[Si(968)](ir+1)]<<4|Ht[Lt[Si(968)](ir+2)]>>2,Tt[Et++]=nt>>8&255,Tt[Et++]=255&nt),Tt},jt[ct(1168)]=function(Lt){for(var Si=ct,nt,wt=Lt.length,yt=wt%3,Tt=[],Et=0,ti=wt-yt;Et<ti;Et+=16383)Tt[Si(622)](function(ir,or){for(var xr=Si,Tn,Ii=[],pr=Et;pr<or;pr+=3)Tn=(ir[pr]<<16&16711680)+(ir[pr+1]<<8&65280)+(255&ir[pr+2]),Ii[xr(622)](Pe[Tn>>18&63]+Pe[Tn>>12&63]+Pe[Tn>>6&63]+Pe[63&Tn]);return Ii[xr(1222)]("")}(Lt,ti<Et+16383?ti:Et+16383));return yt==1?(nt=Lt[wt-1],Tt[Si(622)](Pe[nt>>2]+Pe[nt<<4&63]+"==")):yt==2&&(nt=(Lt[wt-2]<<8)+Lt[wt-1],Tt[Si(622)](Pe[nt>>10]+Pe[nt>>4&63]+Pe[nt<<2&63]+"=")),Tt.join("")};for(var Pe=[],Ht=[],si=ct(669)!=typeof Uint8Array?Uint8Array:Array,_t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Yt=0,Fi=_t[ct(293)];Yt<Fi;++Yt)Pe[Yt]=_t[Yt],Ht[_t[ct(968)](Yt)]=Yt;function Dt(Lt){var Si=ct,nt=Lt[Si(293)];if(0<nt%4)throw new Error(Si(1213));return Lt=Lt.indexOf("="),nt=(Lt=Lt===-1?nt:Lt)===nt?0:4-Lt%4,[Lt,nt]}Ht["-"[ct(968)](0)]=62,Ht["_"[ct(968)](0)]=63},8764:($t,jt,ct)=>{var Pe=Ar,Ht=ct(5108);let si=ct(9742),_t=ct(645);ct=Pe(647)==typeof Symbol&&Pe(647)==typeof Symbol[Pe(1309)]?Symbol[Pe(1309)](Pe(728)):null,jt[Pe(1500)]=Dt,jt[Pe(390)]=function(qe){return Dt.alloc(+(qe=+qe!=qe?0:qe))},jt[Pe(808)]=50;let Yt=2147483647;function Fi(qe){var tt=Pe;if(qe>Yt)throw new RangeError('The value "'+qe+tt(1039));return qe=new Uint8Array(qe),Object.setPrototypeOf(qe,Dt.prototype),qe}function Dt(qe,tt,$e){var St=Pe;if(St(668)!=typeof qe)return Lt(qe,tt,$e);if(typeof tt=="string")throw new TypeError(St(391));return nt(qe)}function Lt(qe,tt,$e){var St=Pe;if(St(665)==typeof qe){var Zt=qe,ui=tt;if(!Dt.isEncoding(ui=St(665)==typeof ui&&ui!==""?ui:St(1261)))throw new TypeError(St(763)+ui);var hr=0|Et(Zt,ui);let ln=Fi(hr);return Zt=ln[St(713)](Zt,ui),ln=Zt!==hr?ln[St(1185)](0,Zt):ln}if(ArrayBuffer.isView(qe))return Ct(ui=qe,Uint8Array)?yt((hr=new Uint8Array(ui))[St(990)],hr[St(723)],hr[St(1505)]):wt(ui);if(qe==null)throw new TypeError(St(796)+typeof qe);if(Ct(qe,ArrayBuffer)||qe&&Ct(qe[St(990)],ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ct(qe,SharedArrayBuffer)||qe&&Ct(qe[St(990)],SharedArrayBuffer)))return yt(qe,tt,$e);if(St(668)==typeof qe)throw new TypeError(St(696));if(Zt=qe[St(539)]&&qe.valueOf(),Zt!=null&&Zt!==qe)return Dt[St(301)](Zt,tt,$e);var Yr=Dt[St(953)](hr=qe)?((Zt=Fi(ui=0|Tt(hr[St(293)])))[St(293)]!==0&&hr[St(419)](Zt,0,0,ui),Zt):hr[St(293)]!==void 0?St(668)!=typeof hr[St(293)]||Mi(hr.length)?Fi(0):wt(hr):hr[St(1490)]==="Buffer"&&Array[St(1241)](hr[St(1242)])?wt(hr[St(1242)]):void 0;if(Yr)return Yr;if(typeof Symbol<"u"&&Symbol[St(1293)]!=null&&St(647)==typeof qe[Symbol.toPrimitive])return Dt[St(301)](qe[Symbol[St(1293)]](St(665)),tt,$e);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof qe)}function Si(qe){var tt=Pe;if(tt(668)!=typeof qe)throw new TypeError('"size" argument must be of type number');if(qe<0)throw new RangeError(tt(1524)+qe+tt(1039))}function nt(qe){return Si(qe),Fi(qe<0?0:0|Tt(qe))}function wt(qe){var tt=Pe,$e=qe[tt(293)]<0?0:0|Tt(qe[tt(293)]);let St=Fi($e);for(let Zt=0;Zt<$e;Zt+=1)St[Zt]=255&qe[Zt];return St}function yt(qe,tt,$e){var St=Pe;if(tt<0||qe[St(1505)]<tt)throw new RangeError(St(260));if(qe[St(1505)]<tt+($e||0))throw new RangeError(St(712));return qe=tt===void 0&&$e===void 0?new Uint8Array(qe):$e===void 0?new Uint8Array(qe,tt):new Uint8Array(qe,tt,$e),Object.setPrototypeOf(qe,Dt[St(1033)]),qe}function Tt(qe){var tt=Pe;if(qe>=Yt)throw new RangeError(tt(265)+Yt.toString(16)+tt(656));return 0|qe}function Et(qe,tt){var $e=Pe;if(Dt[$e(953)](qe))return qe[$e(293)];if(ArrayBuffer[$e(1236)](qe)||Ct(qe,ArrayBuffer))return qe[$e(1505)];if($e(665)!=typeof qe)throw new TypeError($e(314)+typeof qe);var St=qe[$e(293)],Zt=2<arguments[$e(293)]&&arguments[2]===!0;if(!Zt&&St===0)return 0;let ui=!1;for(;;)switch(tt){case $e(497):case"latin1":case"binary":return St;case $e(1261):case $e(447):return Ni(qe).length;case $e(588):case $e(557):case"utf16le":case $e(1328):return 2*St;case"hex":return St>>>1;case $e(1202):return cr(qe)[$e(293)];default:if(ui)return Zt?-1:Ni(qe).length;tt=(""+tt)[$e(1191)](),ui=!0}}function ti(qe,tt,$e){var St=qe[tt];qe[tt]=qe[$e],qe[$e]=St}function ir(qe,tt,$e,St,Zt){var ui=Pe;if(qe[ui(293)]===0)return-1;if(ui(665)==typeof $e?(St=$e,$e=0):2147483647<$e?$e=2147483647:$e<-2147483648&&($e=-2147483648),($e=($e=Mi($e=+$e)?Zt?0:qe.length-1:$e)<0?qe.length+$e:$e)>=qe.length){if(Zt)return-1;$e=qe.length-1}else if($e<0){if(!Zt)return-1;$e=0}if(ui(665)==typeof tt&&(tt=Dt[ui(301)](tt,St)),Dt[ui(953)](tt))return tt[ui(293)]===0?-1:or(qe,tt,$e,St,Zt);if(ui(668)==typeof tt)return tt&=255,typeof Uint8Array[ui(1033)][ui(835)]=="function"?(Zt?Uint8Array[ui(1033)][ui(835)]:Uint8Array[ui(1033)][ui(1457)])[ui(511)](qe,tt,$e):or(qe,[tt],$e,St,Zt);throw new TypeError(ui(644))}function or(qe,tt,$e,St,Zt){var ui=Pe;let hr=1,Yr=qe[ui(293)],ln=tt.length;if(St!==void 0&&(ui(588)===(St=String(St)[ui(1191)]())||ui(557)===St||ui(593)===St||ui(1328)===St)){if(qe[ui(293)]<2||tt[ui(293)]<2)return-1;hr=2,Yr/=2,ln/=2,$e/=2}function Kn(Qn,Pa){var Gn=ui;return hr===1?Qn[Pa]:Qn[Gn(1230)](Pa*hr)}let Un;if(Zt){let Qn=-1;for(Un=$e;Un<Yr;Un++)if(Kn(qe,Un)===Kn(tt,Qn===-1?0:Un-Qn)){if(Qn===-1&&(Qn=Un),Un-Qn+1===ln)return Qn*hr}else Qn!==-1&&(Un-=Un-Qn),Qn=-1}else for($e+ln>Yr&&($e=Yr-ln),Un=$e;0<=Un;Un--){let Qn=!0;for(let Pa=0;Pa<ln;Pa++)if(Kn(qe,Un+Pa)!==Kn(tt,Pa)){Qn=!1;break}if(Qn)return Un}return-1}function xr(qe,tt,$e){var St=Pe;$e=Math[St(1305)](qe[St(293)],$e);let Zt=[],ui=tt;for(;ui<$e;){var hr=qe[ui];let Kn=null,Un=239<hr?4:223<hr?3:191<hr?2:1;if(ui+Un<=$e){let Qn,Pa,Gn,Ja;switch(Un){case 1:hr<128&&(Kn=hr);break;case 2:(192&(Qn=qe[ui+1]))==128&&127<(Ja=(31&hr)<<6|63&Qn)&&(Kn=Ja);break;case 3:Qn=qe[ui+1],Pa=qe[ui+2],(192&Qn)==128&&(192&Pa)==128&&2047<(Ja=(15&hr)<<12|(63&Qn)<<6|63&Pa)&&(Ja<55296||57343<Ja)&&(Kn=Ja);break;case 4:Qn=qe[ui+1],Pa=qe[ui+2],Gn=qe[ui+3],(192&Qn)==128&&(192&Pa)==128&&(192&Gn)==128&&65535<(Ja=(15&hr)<<18|(63&Qn)<<12|(63&Pa)<<6|63&Gn)&&Ja<1114112&&(Kn=Ja)}}Kn===null?(Kn=65533,Un=1):65535<Kn&&(Kn-=65536,Zt[St(622)](Kn>>>10&1023|55296),Kn=56320|1023&Kn),Zt[St(622)](Kn),ui+=Un}{var Yr=Zt,ln=Yr[St(293)];if(ln<=Tn)return String[St(870)][St(306)](String,Yr);let Kn="",Un=0;for(;Un<ln;)Kn+=String[St(870)][St(306)](String,Yr[St(1185)](Un,Un+=Tn));return Kn}}jt.kMaxLength=Yt,(Dt[Pe(1549)]=function(){var qe=Pe;try{let St=new Uint8Array(1);var tt={};tt[qe(464)]=function(){return 42};var $e=tt;return Object[qe(1403)]($e,Uint8Array[qe(1033)]),Object[qe(1403)](St,$e),St[qe(464)]()===42}catch{return!1}}())||Ht===void 0||typeof Ht[Pe(941)]!="function"||Ht[Pe(941)](Pe(545)),Object.defineProperty(Dt.prototype,Pe(764),{enumerable:!0,get:function(){var qe=Pe;if(Dt.isBuffer(this))return this[qe(990)]}}),Object[Pe(1208)](Dt.prototype,Pe(573),{enumerable:!0,get:function(){var qe=Pe;if(Dt[qe(953)](this))return this[qe(723)]}}),Dt[Pe(261)]=8192,Dt[Pe(301)]=Lt,Object.setPrototypeOf(Dt.prototype,Uint8Array[Pe(1033)]),Object[Pe(1403)](Dt,Uint8Array),Dt[Pe(544)]=function(qe,tt,$e){var St=Pe;return tt=tt,$e=$e,Si(qe=qe),qe<=0||tt===void 0?Fi(qe):St(665)==typeof $e?Fi(qe)[St(654)](tt,$e):Fi(qe)[St(654)](tt)},Dt.allocUnsafe=nt,Dt[Pe(903)]=nt,Dt[Pe(953)]=function(qe){var tt=Pe;return qe!=null&&qe._isBuffer===!0&&qe!==Dt[tt(1033)]},Dt[Pe(748)]=function(qe,tt){var $e=Pe;if(Ct(qe,Uint8Array)&&(qe=Dt[$e(301)](qe,qe.offset,qe.byteLength)),Ct(tt,Uint8Array)&&(tt=Dt[$e(301)](tt,tt.offset,tt[$e(1505)])),!Dt.isBuffer(qe)||!Dt[$e(953)](tt))throw new TypeError($e(883));if(qe===tt)return 0;let St=qe[$e(293)],Zt=tt[$e(293)];for(let ui=0,hr=Math[$e(1305)](St,Zt);ui<hr;++ui)if(qe[ui]!==tt[ui]){St=qe[ui],Zt=tt[ui];break}return St<Zt?-1:Zt<St?1:0},Dt.isEncoding=function(qe){var tt=Pe;switch(String(qe)[tt(1191)]()){case tt(1478):case tt(1261):case"utf-8":case tt(497):case"latin1":case tt(951):case"base64":case tt(588):case"ucs-2":case tt(593):case"utf-16le":return!0;default:return!1}},Dt.concat=function(qe,tt){var $e=Pe;if(!Array[$e(1241)](qe))throw new TypeError($e(1006));if(qe[$e(293)]===0)return Dt[$e(544)](0);let St;if(tt===void 0)for(tt=0,St=0;St<qe[$e(293)];++St)tt+=qe[St].length;var Zt=Dt[$e(1004)](tt);let ui=0;for(St=0;St<qe[$e(293)];++St){let hr=qe[St];if(Ct(hr,Uint8Array))ui+hr[$e(293)]>Zt[$e(293)]?(hr=Dt[$e(953)](hr)?hr:Dt[$e(301)](hr))[$e(419)](Zt,ui):Uint8Array.prototype.set[$e(511)](Zt,hr,ui);else{if(!Dt[$e(953)](hr))throw new TypeError($e(1006));hr.copy(Zt,ui)}ui+=hr[$e(293)]}return Zt},Dt[Pe(1505)]=Et,Dt[Pe(1033)][Pe(1401)]=!0,Dt[Pe(1033)][Pe(703)]=function(){var qe=this.length;if(qe%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let tt=0;tt<qe;tt+=2)ti(this,tt,tt+1);return this},Dt[Pe(1033)][Pe(1095)]=function(){var qe=Pe,tt=this.length;if(tt%4!=0)throw new RangeError(qe(788));for(let $e=0;$e<tt;$e+=4)ti(this,$e,$e+3),ti(this,$e+1,$e+2);return this},Dt[Pe(1033)][Pe(408)]=function(){var qe=Pe,tt=this.length;if(tt%8!=0)throw new RangeError(qe(911));for(let $e=0;$e<tt;$e+=8)ti(this,$e,$e+7),ti(this,$e+1,$e+6),ti(this,$e+2,$e+5),ti(this,$e+3,$e+4);return this},Dt[Pe(1033)][Pe(1450)]=Dt[Pe(1033)][Pe(627)]=function(){var qe=Pe,tt=this[qe(293)];return tt===0?"":arguments[qe(293)]===0?xr(this,0,tt):function($e,St,Zt){var ui=qe;let hr=!1;if((St=St===void 0||St<0?0:St)>this[ui(293)]||(Zt=Zt===void 0||Zt>this[ui(293)]?this[ui(293)]:Zt)<=0||(Zt>>>=0)<=(St>>>=0))return"";for($e=$e||ui(1261);;)switch($e){case ui(1478):{var Yr=St,ln=Zt,Kn=this.length;(!ln||ln<0||Kn<ln)&&(ln=Kn);let fl="";for(let Ul=Yr=!Yr||Yr<0?0:Yr;Ul<ln;++Ul)fl+=$i[this[Ul]];return fl}case"utf8":case"utf-8":return xr(this,St,Zt);case ui(497):{var Kn=St,Un=Zt;let Ul="";Un=Math[ui(1305)](this[ui(293)],Un);for(let hu=Kn;hu<Un;++hu)Ul+=String[ui(870)](127&this[hu]);return Ul}case ui(740):case ui(951):{var Yr=St,Qn=Zt;let Ul="";Qn=Math[ui(1305)](this[ui(293)],Qn);for(let hu=Yr;hu<Qn;++hu)Ul+=String[ui(870)](this[hu]);return Ul}case ui(1202):return Ja=Zt,(Gn=St)===0&&Ja===this.length?si[ui(1168)](this):si[ui(1168)](this[ui(1185)](Gn,Ja));case ui(588):case ui(557):case ui(593):case"utf-16le":{var Gn=St,Ja=Zt,Pa=this[ui(1185)](Gn,Ja);let hu="";for(let Ys=0;Ys<Pa.length-1;Ys+=2)hu+=String[ui(870)](Pa[Ys]+256*Pa[Ys+1]);return hu}default:if(hr)throw new TypeError(ui(763)+$e);$e=($e+"")[ui(1191)](),hr=!0}var Gn,Ja}.apply(this,arguments)},Dt[Pe(1033)][Pe(492)]=function(qe){var tt=Pe;if(Dt[tt(953)](qe))return this===qe||Dt.compare(this,qe)===0;throw new TypeError(tt(940))},Dt.prototype[Pe(1183)]=function(){var qe=Pe;let tt="";var $e=jt[qe(808)];return tt=this[qe(627)]("hex",0,$e)[qe(1475)](/(.{2})/g,qe(942)).trim(),this[qe(293)]>$e&&(tt+=qe(830)),qe(717)+tt+">"},ct&&(Dt[Pe(1033)][ct]=Dt[Pe(1033)][Pe(1183)]),Dt[Pe(1033)][Pe(748)]=function(qe,tt,$e,St,Zt){var ui=Pe;if(Ct(qe,Uint8Array)&&(qe=Dt.from(qe,qe[ui(573)],qe[ui(1505)])),!Dt[ui(953)](qe))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof qe);if($e===void 0&&($e=qe?qe.length:0),St===void 0&&(St=0),Zt===void 0&&(Zt=this[ui(293)]),(tt=tt===void 0?0:tt)<0||$e>qe[ui(293)]||St<0||Zt>this[ui(293)])throw new RangeError(ui(682));if(Zt<=St&&$e<=tt)return 0;if(Zt<=St)return-1;if($e<=tt)return 1;if(this===qe)return 0;let hr=(Zt>>>=0)-(St>>>=0),Yr=($e>>>=0)-(tt>>>=0);var ln=Math[ui(1305)](hr,Yr),Kn=this[ui(1185)](St,Zt),Un=qe.slice(tt,$e);for(let Qn=0;Qn<ln;++Qn)if(Kn[Qn]!==Un[Qn]){hr=Kn[Qn],Yr=Un[Qn];break}return hr<Yr?-1:Yr<hr?1:0},Dt.prototype[Pe(292)]=function(qe,tt,$e){var St=Pe;return this[St(835)](qe,tt,$e)!==-1},Dt.prototype[Pe(835)]=function(qe,tt,$e){return ir(this,qe,tt,$e,!0)},Dt[Pe(1033)].lastIndexOf=function(qe,tt,$e){return ir(this,qe,tt,$e,!1)},Dt[Pe(1033)][Pe(713)]=function(qe,tt,$e,St){var Zt=Pe;if(tt===void 0)St=Zt(1261),$e=this[Zt(293)],tt=0;else if($e===void 0&&Zt(665)==typeof tt)St=tt,$e=this[Zt(293)],tt=0;else{if(!isFinite(tt))throw new Error(Zt(483));tt>>>=0,isFinite($e)?($e>>>=0,St===void 0&&(St=Zt(1261))):(St=$e,$e=void 0)}var ui,hr,Yr,ln,Kn,Un,Qn=this[Zt(293)]-tt;if(($e===void 0||Qn<$e)&&($e=Qn),0<qe[Zt(293)]&&($e<0||tt<0)||tt>this.length)throw new RangeError("Attempt to write outside buffer bounds");St=St||"utf8";let Pa=!1;for(;;)switch(St){case Zt(1478):{var Gn=qe,Ja=$e,fl=Number(tt)||0,Ul=this[Zt(293)]-fl,Ul=((!Ja||Ul<(Ja=Number(Ja)))&&(Ja=Ul),Gn[Zt(293)]);Ul/2<Ja&&(Ja=Ul/2);let Ys;for(Ys=0;Ys<Ja;++Ys){var hu=parseInt(Gn[Zt(841)](2*Ys,2),16);if(Mi(hu))return Ys;this[fl+Ys]=hu}return Ys}case Zt(1261):case Zt(447):return Ul=tt,ln=$e,Bi(Ni(qe,this[Zt(293)]-Ul),this,Ul,ln);case"ascii":case Zt(740):case Zt(951):return ln=this,Kn=tt,Un=$e,Bi(function(Ys){var Wd=Zt;let Pc=[];for(let So=0;So<Ys.length;++So)Pc.push(255&Ys[Wd(968)](So));return Pc}(qe),ln,Kn,Un);case Zt(1202):return Kn=tt,Un=$e,Bi(cr(qe),this,Kn,Un);case Zt(588):case Zt(557):case Zt(593):case"utf-16le":return hr=tt,Yr=$e,Bi(function(Ys,Wd){var Pc=Zt,So,Kh;let mf=[];for(let Gl=0;Gl<Ys[Pc(293)]&&!((Wd-=2)<0);++Gl)Kh=(So=Ys[Pc(968)](Gl))>>8,mf[Pc(622)](So%256),mf[Pc(622)](Kh);return mf}(qe,(ui=this)[Zt(293)]-hr),ui,hr,Yr);default:if(Pa)throw new TypeError(Zt(763)+St);St=(""+St)[Zt(1191)](),Pa=!0}},Dt[Pe(1033)][Pe(1106)]=function(){var qe=Pe;return{type:qe(1500),data:Array[qe(1033)].slice.call(this[qe(1518)]||this,0)}};let Tn=4096;function Ii(qe,tt,$e){var St=Pe;if(qe%1!=0||qe<0)throw new RangeError(St(1097));if($e<qe+tt)throw new RangeError(St(986))}function pr(qe,tt,$e,St,Zt,ui){var hr=Pe;if(!Dt[hr(953)](qe))throw new TypeError(hr(1324));if(Zt<tt||tt<ui)throw new RangeError('"value" argument is out of bounds');if($e+St>qe[hr(293)])throw new RangeError(hr(1405))}function yn(qe,tt,$e,St,Zt){return Va(tt,St,Zt,qe,$e,7),St=Number(tt&BigInt(4294967295)),qe[$e++]=St,qe[$e++]=St>>=8,qe[$e++]=St>>=8,qe[$e++]=St>>=8,Zt=Number(tt>>BigInt(32)&BigInt(4294967295)),qe[$e++]=Zt,qe[$e++]=Zt>>=8,qe[$e++]=Zt>>=8,qe[$e++]=Zt>>=8,$e}function dn(qe,tt,$e,St,Zt){return Va(tt,St,Zt,qe,$e,7),St=Number(tt&BigInt(4294967295)),qe[$e+7]=St,qe[$e+6]=St>>=8,qe[$e+5]=St>>=8,qe[$e+4]=St>>=8,Zt=Number(tt>>BigInt(32)&BigInt(4294967295)),qe[$e+3]=Zt,qe[$e+2]=Zt>>=8,qe[$e+1]=Zt>>=8,qe[$e]=Zt>>=8,$e+8}function fn(qe,tt,$e,St){var Zt=Pe;if($e+St>qe[Zt(293)])throw new RangeError(Zt(1405));if($e<0)throw new RangeError("Index out of range")}function Or(qe,tt,$e,St,Zt){var ui=Pe;return tt=+tt,$e>>>=0,Zt||fn(qe,0,$e,4),_t[ui(713)](qe,tt,$e,St,23,4),$e+4}function On(qe,tt,$e,St,Zt){var ui=Pe;return tt=+tt,$e>>>=0,Zt||fn(qe,0,$e,8),_t[ui(713)](qe,tt,$e,St,52,8),$e+8}Dt[Pe(1033)][Pe(1185)]=function(qe,tt){var $e=Pe,St=this[$e(293)],St=((qe=~~qe)<0?(qe+=St)<0&&(qe=0):St<qe&&(qe=St),(tt=tt===void 0?St:~~tt)<0?(tt+=St)<0&&(tt=0):St<tt&&(tt=St),tt<qe&&(tt=qe),this.subarray(qe,tt));return Object[$e(1403)](St,Dt[$e(1033)]),St},Dt[Pe(1033)][Pe(1357)]=Dt.prototype[Pe(1175)]=function(qe,tt,$e){qe>>>=0,tt>>>=0,$e||Ii(qe,tt,this.length);let St=this[qe],Zt=1,ui=0;for(;++ui<tt&&(Zt*=256);)St+=this[qe+ui]*Zt;return St},Dt[Pe(1033)][Pe(476)]=Dt.prototype[Pe(334)]=function(qe,tt,$e){var St=Pe;qe>>>=0,tt>>>=0,$e||Ii(qe,tt,this[St(293)]);let Zt=this[qe+--tt],ui=1;for(;0<tt&&(ui*=256);)Zt+=this[qe+--tt]*ui;return Zt},Dt[Pe(1033)][Pe(898)]=Dt[Pe(1033)][Pe(394)]=function(qe,tt){var $e=Pe;return qe>>>=0,tt||Ii(qe,1,this[$e(293)]),this[qe]},Dt.prototype[Pe(268)]=Dt[Pe(1033)].readUInt16LE=function(qe,tt){return qe>>>=0,tt||Ii(qe,2,this.length),this[qe]|this[qe+1]<<8},Dt[Pe(1033)][Pe(849)]=Dt[Pe(1033)].readUInt16BE=function(qe,tt){return qe>>>=0,tt||Ii(qe,2,this.length),this[qe]<<8|this[qe+1]},Dt[Pe(1033)][Pe(307)]=Dt[Pe(1033)].readUInt32LE=function(qe,tt){var $e=Pe;return qe>>>=0,tt||Ii(qe,4,this[$e(293)]),(this[qe]|this[qe+1]<<8|this[qe+2]<<16)+16777216*this[qe+3]},Dt[Pe(1033)].readUint32BE=Dt[Pe(1033)][Pe(1418)]=function(qe,tt){var $e=Pe;return qe>>>=0,tt||Ii(qe,4,this[$e(293)]),16777216*this[qe]+(this[qe+1]<<16|this[qe+2]<<8|this[qe+3])},Dt.prototype[Pe(369)]=ur(function(Zt){var tt=Pe;za(Zt>>>=0,tt(573));var St=this[Zt],$e=this[Zt+7],St=(St!==void 0&&$e!==void 0||zr(Zt,this[tt(293)]-8),St+256*this[++Zt]+65536*this[++Zt]+this[++Zt]*2**24),Zt=this[++Zt]+256*this[++Zt]+65536*this[++Zt]+$e*2**24;return BigInt(St)+(BigInt(Zt)<<BigInt(32))}),Dt[Pe(1033)].readBigUInt64BE=ur(function(Zt){var tt=Pe;za(Zt>>>=0,tt(573));var St=this[Zt],$e=this[Zt+7],St=(St!==void 0&&$e!==void 0||zr(Zt,this[tt(293)]-8),St*2**24+65536*this[++Zt]+256*this[++Zt]+this[++Zt]),Zt=this[++Zt]*2**24+65536*this[++Zt]+256*this[++Zt]+$e;return(BigInt(St)<<BigInt(32))+BigInt(Zt)}),Dt.prototype.readIntLE=function(qe,tt,$e){qe>>>=0,tt>>>=0,$e||Ii(qe,tt,this.length);let St=this[qe],Zt=1,ui=0;for(;++ui<tt&&(Zt*=256);)St+=this[qe+ui]*Zt;return Zt*=128,St>=Zt&&(St-=Math.pow(2,8*tt)),St},Dt[Pe(1033)].readIntBE=function(qe,tt,$e){var St=Pe;qe>>>=0,tt>>>=0,$e||Ii(qe,tt,this[St(293)]);let Zt=tt,ui=1,hr=this[qe+--Zt];for(;0<Zt&&(ui*=256);)hr+=this[qe+--Zt]*ui;return ui*=128,hr>=ui&&(hr-=Math[St(1307)](2,8*tt)),hr},Dt[Pe(1033)][Pe(1389)]=function(qe,tt){return qe>>>=0,tt||Ii(qe,1,this.length),128&this[qe]?-1*(255-this[qe]+1):this[qe]},Dt[Pe(1033)][Pe(684)]=function(qe,tt){var $e=Pe;return qe>>>=0,tt||Ii(qe,2,this[$e(293)]),tt=this[qe]|this[qe+1]<<8,32768&tt?4294901760|tt:tt},Dt[Pe(1033)][Pe(761)]=function(qe,tt){var $e=Pe;return qe>>>=0,tt||Ii(qe,2,this[$e(293)]),tt=this[qe+1]|this[qe]<<8,32768&tt?4294901760|tt:tt},Dt[Pe(1033)][Pe(664)]=function(qe,tt){return qe>>>=0,tt||Ii(qe,4,this.length),this[qe]|this[qe+1]<<8|this[qe+2]<<16|this[qe+3]<<24},Dt[Pe(1033)][Pe(1141)]=function(qe,tt){var $e=Pe;return qe>>>=0,tt||Ii(qe,4,this[$e(293)]),this[qe]<<24|this[qe+1]<<16|this[qe+2]<<8|this[qe+3]},Dt.prototype[Pe(980)]=ur(function(qe){var tt=Pe;za(qe>>>=0,"offset");var $e=this[qe],St=this[qe+7],St=($e!==void 0&&St!==void 0||zr(qe,this[tt(293)]-8),this[qe+4]+256*this[qe+5]+65536*this[qe+6]+(St<<24));return(BigInt(St)<<BigInt(32))+BigInt($e+256*this[++qe]+65536*this[++qe]+this[++qe]*2**24)}),Dt[Pe(1033)][Pe(801)]=ur(function(qe){var tt=Pe;za(qe>>>=0,tt(573));var St=this[qe],$e=this[qe+7],St=(St!==void 0&&$e!==void 0||zr(qe,this[tt(293)]-8),(St<<24)+65536*this[++qe]+256*this[++qe]+this[++qe]);return(BigInt(St)<<BigInt(32))+BigInt(this[++qe]*2**24+65536*this[++qe]+256*this[++qe]+$e)}),Dt[Pe(1033)][Pe(859)]=function(qe,tt){return qe>>>=0,tt||Ii(qe,4,this.length),_t.read(this,qe,!0,23,4)},Dt[Pe(1033)].readFloatBE=function(qe,tt){return qe>>>=0,tt||Ii(qe,4,this.length),_t.read(this,qe,!1,23,4)},Dt[Pe(1033)][Pe(1090)]=function(qe,tt){var $e=Pe;return qe>>>=0,tt||Ii(qe,8,this[$e(293)]),_t[$e(846)](this,qe,!0,52,8)},Dt.prototype[Pe(1311)]=function(qe,tt){var $e=Pe;return qe>>>=0,tt||Ii(qe,8,this[$e(293)]),_t[$e(846)](this,qe,!1,52,8)},Dt.prototype[Pe(1321)]=Dt[Pe(1033)].writeUIntLE=function(qe,tt,$e,St){qe=+qe,tt>>>=0,$e>>>=0,St||pr(this,qe,tt,$e,Math.pow(2,8*$e)-1,0);let Zt=1,ui=0;for(this[tt]=255&qe;++ui<$e&&(Zt*=256);)this[tt+ui]=qe/Zt&255;return tt+$e},Dt[Pe(1033)].writeUintBE=Dt[Pe(1033)][Pe(406)]=function(qe,tt,$e,St){qe=+qe,tt>>>=0,$e>>>=0,St||pr(this,qe,tt,$e,Math.pow(2,8*$e)-1,0);let Zt=$e-1,ui=1;for(this[tt+Zt]=255&qe;0<=--Zt&&(ui*=256);)this[tt+Zt]=qe/ui&255;return tt+$e},Dt[Pe(1033)].writeUint8=Dt[Pe(1033)][Pe(760)]=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,1,255,0),this[tt]=255&qe,tt+1},Dt[Pe(1033)][Pe(1085)]=Dt[Pe(1033)][Pe(413)]=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,2,65535,0),this[tt]=255&qe,this[tt+1]=qe>>>8,tt+2},Dt[Pe(1033)][Pe(695)]=Dt.prototype.writeUInt16BE=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,2,65535,0),this[tt]=qe>>>8,this[tt+1]=255&qe,tt+2},Dt[Pe(1033)].writeUint32LE=Dt[Pe(1033)][Pe(851)]=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,4,4294967295,0),this[tt+3]=qe>>>24,this[tt+2]=qe>>>16,this[tt+1]=qe>>>8,this[tt]=255&qe,tt+4},Dt[Pe(1033)][Pe(547)]=Dt.prototype[Pe(1029)]=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,4,4294967295,0),this[tt]=qe>>>24,this[tt+1]=qe>>>16,this[tt+2]=qe>>>8,this[tt+3]=255&qe,tt+4},Dt[Pe(1033)][Pe(735)]=ur(function(qe,tt=0){var $e=Pe;return yn(this,qe,tt,BigInt(0),BigInt($e(1169)))}),Dt[Pe(1033)][Pe(361)]=ur(function(qe,tt=0){return dn(this,qe,tt,BigInt(0),BigInt("0xffffffffffffffff"))}),Dt[Pe(1033)].writeIntLE=function(qe,tt,$e,St){qe=+qe,tt>>>=0,St||pr(this,qe,tt,$e,(St=Math.pow(2,8*$e-1))-1,-St);let Zt=0,ui=1,hr=0;for(this[tt]=255&qe;++Zt<$e&&(ui*=256);)qe<0&&hr===0&&this[tt+Zt-1]!==0&&(hr=1),this[tt+Zt]=(qe/ui>>0)-hr&255;return tt+$e},Dt[Pe(1033)].writeIntBE=function(qe,tt,$e,St){qe=+qe,tt>>>=0,St||pr(this,qe,tt,$e,(St=Math.pow(2,8*$e-1))-1,-St);let Zt=$e-1,ui=1,hr=0;for(this[tt+Zt]=255&qe;0<=--Zt&&(ui*=256);)qe<0&&hr===0&&this[tt+Zt+1]!==0&&(hr=1),this[tt+Zt]=(qe/ui>>0)-hr&255;return tt+$e},Dt[Pe(1033)][Pe(1494)]=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,1,127,-128),this[tt]=255&(qe=qe<0?255+qe+1:qe),tt+1},Dt[Pe(1033)][Pe(1528)]=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,2,32767,-32768),this[tt]=255&qe,this[tt+1]=qe>>>8,tt+2},Dt.prototype[Pe(1303)]=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,2,32767,-32768),this[tt]=qe>>>8,this[tt+1]=255&qe,tt+2},Dt.prototype[Pe(1451)]=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,4,2147483647,-2147483648),this[tt]=255&qe,this[tt+1]=qe>>>8,this[tt+2]=qe>>>16,this[tt+3]=qe>>>24,tt+4},Dt[Pe(1033)].writeInt32BE=function(qe,tt,$e){return qe=+qe,tt>>>=0,$e||pr(this,qe,tt,4,2147483647,-2147483648),this[tt]=(qe=qe<0?4294967295+qe+1:qe)>>>24,this[tt+1]=qe>>>16,this[tt+2]=qe>>>8,this[tt+3]=255&qe,tt+4},Dt.prototype[Pe(255)]=ur(function(qe,tt=0){var $e=Pe;return yn(this,qe,tt,-BigInt($e(688)),BigInt($e(1256)))}),Dt[Pe(1033)][Pe(1128)]=ur(function(qe,tt=0){var $e=Pe;return dn(this,qe,tt,-BigInt($e(688)),BigInt($e(1256)))}),Dt[Pe(1033)][Pe(737)]=function(qe,tt,$e){return Or(this,qe,tt,!0,$e)},Dt.prototype[Pe(1410)]=function(qe,tt,$e){return Or(this,qe,tt,!1,$e)},Dt.prototype[Pe(812)]=function(qe,tt,$e){return On(this,qe,tt,!0,$e)},Dt[Pe(1033)].writeDoubleBE=function(qe,tt,$e){return On(this,qe,tt,!1,$e)},Dt[Pe(1033)][Pe(419)]=function(qe,tt,$e,St){var Zt=Pe;if(!Dt[Zt(953)](qe))throw new TypeError(Zt(1113));if($e=$e||0,St||St===0||(St=this[Zt(293)]),tt>=qe[Zt(293)]&&(tt=qe.length),(St=0<St&&St<$e?$e:St)===$e||qe[Zt(293)]===0||this[Zt(293)]===0)return 0;if((tt=tt||0)<0)throw new RangeError("targetStart out of bounds");if($e<0||$e>=this[Zt(293)])throw new RangeError("Index out of range");if(St<0)throw new RangeError(Zt(402));St>this.length&&(St=this.length);var ui=(St=qe[Zt(293)]-tt<St-$e?qe[Zt(293)]-tt+$e:St)-$e;return this===qe&&typeof Uint8Array.prototype[Zt(1484)]=="function"?this[Zt(1484)](tt,$e,St):Uint8Array[Zt(1033)][Zt(1024)][Zt(511)](qe,this[Zt(724)]($e,St),tt),ui},Dt[Pe(1033)][Pe(654)]=function(qe,tt,$e,St){var Zt=Pe;if(Zt(665)==typeof qe){if(Zt(665)==typeof tt?(St=tt,tt=0,$e=this.length):typeof $e=="string"&&(St=$e,$e=this[Zt(293)]),St!==void 0&&Zt(665)!=typeof St)throw new TypeError(Zt(463));if(typeof St=="string"&&!Dt[Zt(1541)](St))throw new TypeError(Zt(763)+St);var ui;qe.length===1&&(ui=qe[Zt(968)](0),(Zt(1261)===St&&ui<128||Zt(740)===St)&&(qe=ui))}else Zt(668)==typeof qe?qe&=255:Zt(987)==typeof qe&&(qe=Number(qe));if(tt<0||this[Zt(293)]<tt||this[Zt(293)]<$e)throw new RangeError(Zt(1112));if($e<=tt)return this;tt>>>=0,$e=$e===void 0?this[Zt(293)]:$e>>>0;let hr;if(typeof(qe=qe||0)=="number")for(hr=tt;hr<$e;++hr)this[hr]=qe;else{var Yr=Dt[Zt(953)](qe)?qe:Dt[Zt(301)](qe,St),ln=Yr.length;if(ln===0)throw new TypeError(Zt(1524)+qe+Zt(1316));for(hr=0;hr<$e-tt;++hr)this[hr+tt]=Yr[hr%ln]}return this};let eo={};function Cn(qe,tt,$e){var St=Pe;eo[qe]=class extends $e{constructor(){var Zt=Ar;super(),Object.defineProperty(this,"message",{value:tt[Zt(306)](this,arguments),writable:!0,configurable:!0}),this.name=this[Zt(1193)]+(" ["+qe+"]"),this[Zt(1025)],delete this.name}get code(){return qe}set[St(1140)](Zt){var ui=St,hr={};hr[ui(532)]=!0,hr[ui(378)]=!0,hr.value=Zt,hr[ui(705)]=!0,Object.defineProperty(this,ui(1140),hr)}[St(627)](){var Zt=St;return this[Zt(1193)]+(" ["+qe+Zt(653))+this[Zt(317)]}}}function Sa(qe){var tt=Pe;let $e="",St=qe.length;for(var Zt=qe[0]==="-"?1:0;St>=4+Zt;St-=3)$e="_"+qe[tt(1185)](St-3,St)+$e;return""+qe[tt(1185)](0,St)+$e}function Va(qe,tt,$e,St,Zt,ui){var hr=Pe,Yr;if($e<qe||qe<tt)throw Yr=typeof tt=="bigint"?"n":"",tt=3<ui?tt===0||tt===BigInt(0)?hr(421)+Yr+hr(769)+Yr+hr(697)+8*(ui+1)+Yr:hr(657)+Yr+hr(697)+(8*(ui+1)-1)+Yr+hr(546)+(8*(ui+1)-1)+Yr:">= "+tt+Yr+hr(580)+$e+Yr,new eo[hr(946)]("value",tt,qe);$e=St,Yr=ui,za(tt=Zt,hr(573)),$e[tt]!==void 0&&$e[tt+Yr]!==void 0||zr(tt,$e[hr(293)]-(Yr+1))}function za(qe,tt){var $e=Pe;if($e(668)!=typeof qe)throw new eo[$e(1145)](tt,"number",qe)}function zr(qe,tt,$e){var St=Pe;throw Math.floor(qe)!==qe?(za(qe,$e),new eo[St(946)]($e||St(573),St(575),qe)):tt<0?new eo[St(253)]:new eo[St(946)]($e||"offset",St(1495)+($e?1:0)+St(580)+tt,qe)}Cn("ERR_BUFFER_OUT_OF_BOUNDS",function(qe){var tt=Pe;return qe?qe+tt(608):"Attempt to access memory outside buffer bounds"},RangeError),Cn(Pe(1145),function(qe,tt){var $e=Pe;return $e(652)+qe+$e(564)+typeof tt},TypeError),Cn("ERR_OUT_OF_RANGE",function(qe,tt,$e){var St=Pe;qe=St(1554)+qe+St(1487);let Zt=$e;return Number[St(440)]($e)&&Math[St(455)]($e)>2**32?Zt=Sa(String($e)):St(364)==typeof $e&&(Zt=String($e),($e>BigInt(2)**BigInt(32)||$e<-(BigInt(2)**BigInt(32)))&&(Zt=Sa(Zt)),Zt+="n"),qe+(St(983)+tt+St(333)+Zt)},RangeError);let Ci=/[^+/0-9A-Za-z-_]/g;function Ni(qe,tt){var $e=Pe;tt=tt||1/0;let St;var Zt=qe[$e(293)];let ui=null,hr=[];for(let Yr=0;Yr<Zt;++Yr){if(55295<(St=qe[$e(968)](Yr))&&St<57344){if(!ui){if(56319<St){-1<(tt-=3)&&hr.push(239,191,189);continue}if(Yr+1===Zt){-1<(tt-=3)&&hr[$e(622)](239,191,189);continue}ui=St;continue}if(St<56320){-1<(tt-=3)&&hr.push(239,191,189),ui=St;continue}St=65536+(ui-55296<<10|St-56320)}else ui&&-1<(tt-=3)&&hr[$e(622)](239,191,189);if(ui=null,St<128){if(--tt<0)break;hr[$e(622)](St)}else if(St<2048){if((tt-=2)<0)break;hr[$e(622)](St>>6|192,63&St|128)}else if(St<65536){if((tt-=3)<0)break;hr.push(St>>12|224,St>>6&63|128,63&St|128)}else{if(!(St<1114112))throw new Error($e(446));if((tt-=4)<0)break;hr[$e(622)](St>>18|240,St>>12&63|128,St>>6&63|128,63&St|128)}}return hr}function cr(qe){return si.toByteArray(function(tt){var $e=Ar;if((tt=(tt=tt[$e(277)]("=")[0])[$e(1546)]().replace(Ci,""))[$e(293)]<2)return"";for(;tt.length%4!=0;)tt+="=";return tt}(qe))}function Bi(qe,tt,$e,St){var Zt=Pe;let ui;for(ui=0;ui<St&&!(ui+$e>=tt[Zt(293)]||ui>=qe[Zt(293)]);++ui)tt[ui+$e]=qe[ui];return ui}function Ct(qe,tt){var $e=Pe;return qe instanceof tt||qe!=null&&qe[$e(376)]!=null&&qe[$e(376)].name!=null&&qe[$e(376)][$e(1193)]===tt.name}function Mi(qe){return qe!=qe}let $i=function(){var qe=Pe,tt=qe(926);let $e=new Array(256);for(let Zt=0;Zt<16;++Zt){var St=16*Zt;for(let ui=0;ui<16;++ui)$e[St+ui]=tt[Zt]+tt[ui]}return $e}();function ur(qe){var tt=Pe;return tt(669)==typeof BigInt?Nr:qe}function Nr(){var qe=Pe;throw new Error(qe(884))}},1924:($t,jt,ct)=>{var Pe=Ar,Ht=ct(210),si=ct(5559),_t=si(Ht("String.prototype.indexOf"));$t[Pe(533)]=function(Yt,Fi){var Dt=Pe;return Fi=Ht(Yt,!!Fi),Dt(647)==typeof Fi&&-1<_t(Yt,Dt(954))?si(Fi):Fi}},5559:($t,jt,si)=>{var Pe=Ar,Ht=si(8612),si=si(210),_t=si("%Function.prototype.apply%"),Yt=si(Pe(952)),Fi=si("%Reflect.apply%",!0)||Ht[Pe(511)](Yt,_t),Dt=si(Pe(930),!0),Lt=si(Pe(1268),!0),Si=si(Pe(1249));if(Lt)try{var nt={};nt[Pe(1438)]=1,Lt({},"a",nt)}catch{Lt=null}function wt(){return Fi(Ht,_t,arguments)}var yt={};yt[Pe(1438)]=wt,$t[Pe(533)]=function(Tt){var Et=Pe,ti=Fi(Ht,Yt,arguments);return Dt&&Lt&&Dt(ti,Et(293))[Et(532)]&&Lt(ti,"length",{value:1+Si(0,Tt.length-(arguments[Et(293)]-1))}),ti},Lt?Lt($t[Pe(533)],Pe(306),yt):$t[Pe(533)][Pe(306)]=wt},5108:($t,jt,ct)=>{var Pe=Ar,Ht=ct(9539),si=ct(9282);function _t(){var yt=Ar;return new Date()[yt(1096)]()}for(var Yt=Array.prototype[Pe(1185)],Fi={},Dt=ct.g!==void 0&&ct.g[Pe(855)]?ct.g[Pe(855)]:Pe(669)!=typeof window&&window.console?window[Pe(855)]:{},Lt=[[function(){},"log"],[function(){var yt=Pe;Dt[yt(826)][yt(306)](Dt,arguments)},Pe(325)],[function(){Dt.log.apply(Dt,arguments)},Pe(549)],[function(){var yt=Pe;Dt[yt(549)].apply(Dt,arguments)},"error"],[function(yt){Fi[yt]=_t()},Pe(512)],[function(yt){var Tt=Pe,Et=Fi[yt];if(!Et)throw new Error(Tt(1422)+yt);delete Fi[yt],Et=_t()-Et,Dt.log(yt+": "+Et+"ms")},"timeEnd"],[function(){var yt=Pe,Tt=new Error;Tt[yt(1193)]=yt(1235),Tt[yt(317)]=Ht[yt(741)].apply(null,arguments),Dt[yt(941)](Tt[yt(1025)])},Pe(308)],[function(yt){var Tt=Pe;Dt[Tt(826)](Ht.inspect(yt)+` `)},Pe(897)],[function(yt){var Tt=Pe,Et;yt||(Et=Yt.call(arguments,1),si.ok(!1,Ht[Tt(741)][Tt(306)](null,Et)))},"assert"]],Si=0;Si<Lt[Pe(293)];Si++){var wt=Lt[Si],nt=wt[0],wt=wt[1];Dt[wt]||(Dt[wt]=nt)}$t[Pe(533)]=Dt},4289:($t,jt,Lt)=>{var Pe=Ar;function Ht(nt,wt){var yt=Ar,Tt=2<arguments[yt(293)]?arguments[2]:{},Et=si(wt);_t&&(Et=Fi[yt(511)](Et,Object[yt(1471)](wt)));for(var ti=0;ti<Et[yt(293)];ti+=1)(function(ir,or,xr,Tn){var Ii=yt;if(or in ir){if(Tn===!0){if(ir[or]===xr)return}else if(Ii(647)!=typeof(pr=Tn)||Yt[Ii(511)](pr)!=="[object Function]"||!Tn())return}var pr,yn={};yn[Ii(532)]=!0,yn.enumerable=!1,yn.value=xr,yn.writable=!0,Si?Dt(ir,or,yn):ir[or]=xr})(nt,Et[ti],wt[Et[ti]],Tt[Et[ti]])}var si=Lt(2215),_t=typeof Symbol=="function"&&Pe(1245)==typeof Symbol(Pe(464)),Yt=Object[Pe(1033)][Pe(627)],Fi=Array[Pe(1033)][Pe(960)],Dt=Object[Pe(1208)],Lt=Lt(1044)(),Si=Dt&≪Ht[Pe(982)]=!!Si,$t[Pe(533)]=Ht},8091:$t=>{var jt=Ar;function ct(Pe,Ht){var si=Ar;if(Pe==null)throw new TypeError(si(645));for(var _t=Object(Pe),Yt=1;Yt<arguments.length;Yt++){var Fi=arguments[Yt];if(Fi!=null)for(var Dt=Object[si(1288)](Object(Fi)),Lt=0,Si=Dt[si(293)];Lt<Si;Lt++){var nt=Dt[Lt],wt=Object[si(287)](Fi,nt);wt!==void 0&&wt[si(378)]&&(_t[nt]=Fi[nt])}}return _t}$t[jt(533)]={assign:ct,polyfill:function(){var Pe=jt,Ht={};Ht[Pe(378)]=!1,Ht[Pe(532)]=!0,Ht[Pe(705)]=!0,Ht[Pe(1438)]=ct,Object[Pe(1369)]||Object[Pe(1208)](Object,Pe(1369),Ht)}}},4029:($t,jt,ct)=>{var Pe=Ar,Ht=ct(5320),si=Object.prototype[Pe(627)],_t=Object[Pe(1033)][Pe(678)];$t[Pe(533)]=function(Yt,Fi,Dt){var Lt=Pe;if(!Ht(Fi))throw new TypeError(Lt(1133));var Si;if(3<=arguments.length&&(Si=Dt),Lt(1427)===si[Lt(511)](Yt))for(var nt=Yt,wt=Fi,yt=Si,Tt=0,Et=nt[Lt(293)];Tt<Et;Tt++)_t[Lt(511)](nt,Tt)&&(yt==null?wt(nt[Tt],Tt,nt):wt[Lt(511)](yt,nt[Tt],Tt,nt));else if(Lt(665)==typeof Yt)for(var ti=Yt,ir=Fi,or=Si,xr=0,Tn=ti[Lt(293)];xr<Tn;xr++)or==null?ir(ti[Lt(1514)](xr),xr,ti):ir[Lt(511)](or,ti[Lt(1514)](xr),xr,ti);else{var Ii,pr=Yt,yn=Fi,dn=Si;for(Ii in pr)_t[Lt(511)](pr,Ii)&&(dn==null?yn(pr[Ii],Ii,pr):yn.call(dn,pr[Ii],Ii,pr))}}},7648:$t=>{var jt=Ar,ct=Array.prototype.slice,Pe=Object[jt(1033)][jt(627)];$t.exports=function(Ht){var si=jt,_t=this;if(typeof _t!="function"||Pe[si(511)](_t)!=="[object Function]")throw new TypeError(si(432)+_t);for(var Yt,Fi,Dt=ct[si(511)](arguments,1),Lt=Math[si(488)](0,_t[si(293)]-Dt.length),Si=[],nt=0;nt<Lt;nt++)Si[si(622)]("$"+nt);return Yt=Function(si(1558),si(1012)+Si[si(1222)](",")+si(1544))(function(){var wt=si,yt;return this instanceof Yt?(yt=_t[wt(306)](this,Dt[wt(960)](ct.call(arguments))),Object(yt)===yt?yt:this):_t[wt(306)](Ht,Dt[wt(960)](ct[wt(511)](arguments)))}),_t[si(1033)]&&((Fi=function(){})[si(1033)]=_t[si(1033)],Yt[si(1033)]=new Fi,Fi.prototype=null),Yt}},8612:($t,jt,ct)=>{var Pe=Ar;ct=ct(7648),$t[Pe(533)]=Function[Pe(1033)][Pe(633)]||ct},210:($t,jt,ct)=>{var Pe=Ar;function Ht(Or){var On=Ar;try{return Yt('"use strict"; return ('+Or+On(683))()}catch{}}var si,_t=SyntaxError,Yt=Function,Fi=TypeError,Dt=Object[Pe(287)];if(Dt)try{Dt({},"")}catch{Dt=null}function Lt(){throw new Fi}var ir=Dt?function(){var Or=Pe;try{return Lt}catch{try{return Dt(arguments,Or(1372)).get}catch{return Lt}}}():Lt,Si=ct(1405)(),yt=ct(8185)(),nt=Object[Pe(1216)]||(yt?function(Or){var On=Pe;return Or[On(534)]}:null),wt={},yt=typeof Uint8Array<"u"&&nt?nt(Uint8Array):si,Tt={"%AggregateError%":typeof AggregateError>"u"?si:AggregateError,"%Array%":Array,"%ArrayBuffer%":Pe(669)==typeof ArrayBuffer?si:ArrayBuffer,"%ArrayIteratorPrototype%":Si&&nt?nt([][Symbol[Pe(397)]]()):si,"%AsyncFromSyncIteratorPrototype%":si,"%AsyncFunction%":wt,"%AsyncGenerator%":wt,"%AsyncGeneratorFunction%":wt,"%AsyncIteratorPrototype%":wt,"%Atomics%":Pe(669)==typeof Atomics?si:Atomics,"%BigInt%":typeof BigInt>"u"?si:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?si:BigInt64Array,"%BigUint64Array%":Pe(669)==typeof BigUint64Array?si:BigUint64Array,"%Boolean%":Boolean,"%DataView%":Pe(669)==typeof DataView?si:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":Pe(669)==typeof Float32Array?si:Float32Array,"%Float64Array%":Pe(669)==typeof Float64Array?si:Float64Array,"%FinalizationRegistry%":Pe(669)==typeof FinalizationRegistry?si:FinalizationRegistry,"%Function%":Yt,"%GeneratorFunction%":wt,"%Int8Array%":Pe(669)==typeof Int8Array?si:Int8Array,"%Int16Array%":Pe(669)==typeof Int16Array?si:Int16Array,"%Int32Array%":Pe(669)==typeof Int32Array?si:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Si&&nt?nt(nt([][Symbol[Pe(397)]]())):si,"%JSON%":typeof JSON=="object"?JSON:si,"%Map%":Pe(669)==typeof Map?si:Map,"%MapIteratorPrototype%":typeof Map<"u"&&Si&&nt?nt(new Map()[Symbol[Pe(397)]]()):si,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":Pe(669)==typeof Promise?si:Promise,"%Proxy%":Pe(669)==typeof Proxy?si:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?si:Reflect,"%RegExp%":RegExp,"%Set%":Pe(669)==typeof Set?si:Set,"%SetIteratorPrototype%":Pe(669)!=typeof Set&&Si&&nt?nt(new Set()[Symbol[Pe(397)]]()):si,"%SharedArrayBuffer%":Pe(669)==typeof SharedArrayBuffer?si:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Si&&nt?nt(""[Symbol.iterator]()):si,"%Symbol%":Si?Symbol:si,"%SyntaxError%":_t,"%ThrowTypeError%":ir,"%TypedArray%":yt,"%TypeError%":Fi,"%Uint8Array%":Pe(669)==typeof Uint8Array?si:Uint8Array,"%Uint8ClampedArray%":Pe(669)==typeof Uint8ClampedArray?si:Uint8ClampedArray,"%Uint16Array%":Pe(669)==typeof Uint16Array?si:Uint16Array,"%Uint32Array%":Pe(669)==typeof Uint32Array?si:Uint32Array,"%URIError%":URIError,"%WeakMap%":Pe(669)==typeof WeakMap?si:WeakMap,"%WeakRef%":typeof WeakRef>"u"?si:WeakRef,"%WeakSet%":Pe(669)==typeof WeakSet?si:WeakSet};if(nt)try{null.error}catch(Or){Si=nt(nt(Or)),Tt[Pe(347)]=Si}var Et={};Et["%ArrayBufferPrototype%"]=[Pe(866),Pe(1033)],Et[Pe(1258)]=[Pe(516),Pe(1033)],Et[Pe(900)]=[Pe(516),Pe(1033),Pe(1537)],Et[Pe(1370)]=[Pe(516),Pe(1033),"forEach"],Et[Pe(1217)]=[Pe(516),Pe(1033),Pe(1288)],Et[Pe(929)]=[Pe(516),Pe(1033),Pe(1137)],Et["%AsyncFunctionPrototype%"]=[Pe(691),Pe(1033)],Et[Pe(1329)]=[Pe(984),Pe(1033)],Et["%AsyncGeneratorPrototype%"]=[Pe(984),Pe(1033),Pe(1033)],Et[Pe(1519)]=["Boolean",Pe(1033)],Et[Pe(1040)]=[Pe(1559),Pe(1033)],Et[Pe(1543)]=[Pe(567),Pe(1033)],Et["%ErrorPrototype%"]=[Pe(853),"prototype"],Et[Pe(1354)]=[Pe(1421),"prototype"],Et["%Float32ArrayPrototype%"]=[Pe(752),Pe(1033)],Et[Pe(1043)]=[Pe(1317),Pe(1033)],Et[Pe(1093)]=[Pe(454),"prototype"],Et[Pe(811)]=["GeneratorFunction","prototype"],Et["%GeneratorPrototype%"]=[Pe(1055),"prototype",Pe(1033)],Et[Pe(1469)]=[Pe(1134),Pe(1033)],Et[Pe(591)]=["Int16Array",Pe(1033)],Et[Pe(1386)]=[Pe(595),Pe(1033)],Et[Pe(649)]=[Pe(1209),Pe(1492)],Et[Pe(1468)]=[Pe(1209),"stringify"],Et["%MapPrototype%"]=[Pe(902),Pe(1033)],Et["%NumberPrototype%"]=["Number",Pe(1033)],Et[Pe(561)]=[Pe(974),Pe(1033)],Et[Pe(756)]=[Pe(974),"prototype",Pe(627)],Et[Pe(1444)]=["Object",Pe(1033),Pe(539)],Et[Pe(310)]=[Pe(416),Pe(1033)],Et[Pe(685)]=[Pe(416),Pe(1033),Pe(283)],Et[Pe(944)]=["Promise",Pe(1367)],Et[Pe(704)]=[Pe(416),Pe(489)],Et["%Promise_resolve%"]=[Pe(416),Pe(1437)],Et[Pe(528)]=[Pe(587),Pe(1033)],Et[Pe(303)]=[Pe(1181),Pe(1033)],Et[Pe(326)]=["RegExp",Pe(1033)],Et[Pe(484)]=["Set",Pe(1033)],Et[Pe(1063)]=[Pe(1442),Pe(1033)],Et[Pe(906)]=[Pe(1454),"prototype"],Et["%SymbolPrototype%"]=[Pe(1396),Pe(1033)],Et[Pe(1265)]=[Pe(888),"prototype"],Et[Pe(254)]=[Pe(965),Pe(1033)],Et["%TypeErrorPrototype%"]=[Pe(836),Pe(1033)],Et[Pe(1226)]=[Pe(880),Pe(1033)],Et[Pe(1446)]=[Pe(1426),Pe(1033)],Et[Pe(1131)]=[Pe(603),Pe(1033)],Et[Pe(1109)]=[Pe(746),Pe(1033)],Et[Pe(388)]=["URIError",Pe(1033)],Et[Pe(541)]=["WeakMap",Pe(1033)],Et[Pe(991)]=[Pe(1186),Pe(1033)];var ti=Et,ir=ct(8612),or=ct(7642),xr=ir[Pe(511)](Function[Pe(511)],Array[Pe(1033)][Pe(960)]),Tn=ir[Pe(511)](Function[Pe(306)],Array.prototype[Pe(1334)]),Ii=ir[Pe(511)](Function[Pe(511)],String.prototype[Pe(1475)]),pr=ir[Pe(511)](Function.call,String[Pe(1033)][Pe(1185)]),yn=ir[Pe(511)](Function[Pe(511)],RegExp.prototype[Pe(879)]),dn=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,fn=/\\(\\)?/g;$t[Pe(533)]=function(Or,On){var eo=Pe;if(typeof Or!="string"||Or.length===0)throw new Fi(eo(506));if(1<arguments[eo(293)]&&eo(987)!=typeof On)throw new Fi(eo(392));if(yn(/^%?[^%]*%?$/,Or)===null)throw new _t("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var Cn=function(Mi){var $i=pr(Mi,0,1),ur=pr(Mi,-1);if($i==="%"&&ur!=="%")throw new _t("invalid intrinsic syntax, expected closing `%`");if(ur==="%"&&$i!=="%")throw new _t("invalid intrinsic syntax, expected opening `%`");var Nr=[];return Ii(Mi,dn,function(qe,tt,$e,St){var Zt=Ar;Nr[Nr[Zt(293)]]=$e?Ii(St,fn,"$1"):tt||qe}),Nr}(Or),Sa=0<Cn.length?Cn[0]:"",zr=function(Mi,$i){var ur=eo,Nr,qe=Mi;if(or(ti,qe)&&(qe="%"+(Nr=ti[qe])[0]+"%"),or(Tt,qe)){var tt=Tt[qe];if((tt=tt===wt?function $e(St){var Zt=Ar,ui,hr;return Zt(681)===St?ui=Ht(Zt(509)):Zt(389)===St?ui=Ht(Zt(570)):Zt(1088)===St?ui=Ht(Zt(1267)):St==="%AsyncGenerator%"?(hr=$e(Zt(1088)))&&(ui=hr.prototype):St==="%AsyncIteratorPrototype%"&&(hr=$e("%AsyncGenerator%"))&&nt&&(ui=nt(hr[Zt(1033)])),Tt[St]=ui}(qe):tt)!==void 0||$i)return{alias:Nr,name:qe,value:tt};throw new Fi(ur(1282)+Mi+" exists, but is not available. Please file an issue!")}throw new _t(ur(1282)+Mi+ur(1227))}("%"+Sa+"%",On),Va=(zr[eo(1193)],zr[eo(1438)]),za=!1,zr=zr.alias;zr&&(Sa=zr[0],Tn(Cn,xr([0,1],zr)));for(var Ci=1,Ni=!0;Ci<Cn.length;Ci+=1){var cr=Cn[Ci],Bi=pr(cr,0,1),Ct=pr(cr,-1);if((Bi==='"'||Bi==="'"||Bi==="`"||Ct==='"'||Ct==="'"||Ct==="`")&&Bi!==Ct)throw new _t(eo(284));if(eo(376)!==cr&&Ni||(za=!0),or(Tt,Bi="%"+(Sa+="."+cr)+"%"))Va=Tt[Bi];else if(Va!=null){if(!(cr in Va)){if(On)return;throw new Fi(eo(641)+Or+eo(623))}Va=Dt&&Ci+1>=Cn[eo(293)]?(Ni=!!(Ct=Dt(Va,cr)))&&"get"in Ct&&!("originalValue"in Ct.get)?Ct.get:Va[cr]:(Ni=or(Va,cr),Va[cr]),Ni&&!za&&(Tt[Bi]=Va)}}return Va}},7296:($t,jt,ct)=>{var Pe=Ar;if(ct=ct(210)("%Object.getOwnPropertyDescriptor%",!0),ct)try{ct([],Pe(293))}catch{ct=null}$t[Pe(533)]=ct},1044:($t,jt,ct)=>{var Pe=Ar;function Ht(){var _t=Ar;if(si)try{var Yt={};return Yt[_t(1438)]=1,si({},"a",Yt),!0}catch{return!1}return!1}var si=ct(210)(Pe(1268),!0);Ht[Pe(1501)]=function(){var _t=Pe;if(!Ht())return null;try{var Yt={};return Yt.value=1,si([],_t(293),Yt).length!==1}catch{return!0}},$t[Pe(533)]=Ht},8185:$t=>{var jt=Ar,ct={};ct[jt(464)]={};var Pe=ct,Ht=Object;$t.exports=function(){var si=jt,_t={};_t[si(534)]=Pe;var Yt={};return Yt[si(534)]=null,_t.foo===Pe.foo&&!(Yt instanceof Ht)}},1405:($t,jt,ct)=>{var Pe=Ar,Ht=Pe(669)!=typeof Symbol&&Symbol,si=ct(5419);$t.exports=function(){var _t=Pe;return _t(647)==typeof Ht&&_t(647)==typeof Symbol&&_t(1245)==typeof Ht(_t(464))&&_t(1245)==typeof Symbol(_t(850))&&si()}},5419:$t=>{var jt=Ar;$t[jt(533)]=function(){var ct=jt;if(ct(647)!=typeof Symbol||ct(647)!=typeof Object[ct(1471)])return!1;if(ct(1245)==typeof Symbol[ct(397)])return!0;var Pe={},Ht=Symbol("test"),si=Object(Ht);if(ct(665)==typeof Ht||ct(1361)!==Object.prototype[ct(627)][ct(511)](Ht)||ct(1361)!==Object[ct(1033)][ct(627)].call(si))return!1;for(Ht in Pe[Ht]=42,Pe)return!1;return!(ct(647)==typeof Object[ct(1288)]&&Object[ct(1288)](Pe)[ct(293)]!==0||typeof Object[ct(602)]=="function"&&Object[ct(602)](Pe)[ct(293)]!==0||(si=Object[ct(1471)](Pe),si.length!==1||si[0]!==Ht)||!Object[ct(1033)].propertyIsEnumerable.call(Pe,Ht)||typeof Object[ct(287)]=="function"&&(si=Object[ct(287)](Pe,Ht),si.value!==42||si.enumerable!==!0))}},6410:($t,jt,ct)=>{var Pe=Ar,Ht=ct(5419);$t[Pe(533)]=function(){return Ht()&&!!Symbol.toStringTag}},7642:($t,jt,ct)=>{var Pe=Ar;ct=ct(8612),$t[Pe(533)]=ct[Pe(511)](Function[Pe(511)],Object[Pe(1033)].hasOwnProperty)},645:($t,jt)=>{var ct=Ar;jt[ct(846)]=function(Pe,Ht,si,_t,ti){var Fi=ct,Dt,Lt,Si=8*ti-_t-1,nt=(1<<Si)-1,wt=nt>>1,yt=-7,Tt=si?ti-1:0,Et=si?-1:1,ti=Pe[Ht+Tt];for(Tt+=Et,Dt=ti&(1<<-yt)-1,ti>>=-yt,yt+=Si;0<yt;Dt=256*Dt+Pe[Ht+Tt],Tt+=Et,yt-=8);for(Lt=Dt&(1<<-yt)-1,Dt>>=-yt,yt+=_t;0<yt;Lt=256*Lt+Pe[Ht+Tt],Tt+=Et,yt-=8);if(Dt===0)Dt=1-wt;else{if(Dt===nt)return Lt?NaN:1/0*(ti?-1:1);Lt+=Math[Fi(1307)](2,_t),Dt-=wt}return(ti?-1:1)*Lt*Math[Fi(1307)](2,Dt-_t)},jt[ct(713)]=function(Pe,Ht,si,_t,Yt,ir){var Dt=ct,Lt,Si,nt=8*ir-Yt-1,wt=(1<<nt)-1,yt=wt>>1,Tt=Yt===23?Math[Dt(1307)](2,-24)-Math[Dt(1307)](2,-77):0,Et=_t?0:ir-1,ti=_t?1:-1,ir=Ht<0||Ht===0&&1/Ht<0?1:0;for(Ht=Math[Dt(455)](Ht),isNaN(Ht)||Ht===1/0?(Si=isNaN(Ht)?1:0,Lt=wt):(Lt=Math[Dt(550)](Math[Dt(826)](Ht)/Math[Dt(719)]),Ht*(_t=Math[Dt(1307)](2,-Lt))<1&&(Lt--,_t*=2),2<=(Ht+=1<=Lt+yt?Tt/_t:Tt*Math[Dt(1307)](2,1-yt))*_t&&(Lt++,_t/=2),wt<=Lt+yt?(Si=0,Lt=wt):1<=Lt+yt?(Si=(Ht*_t-1)*Math[Dt(1307)](2,Yt),Lt+=yt):(Si=Ht*Math.pow(2,yt-1)*Math.pow(2,Yt),Lt=0));8<=Yt;Pe[si+Et]=255&Si,Et+=ti,Si/=256,Yt-=8);for(Lt=Lt<<Yt|Si,nt+=Yt;0<nt;Pe[si+Et]=255&Lt,Et+=ti,Lt/=256,nt-=8);Pe[si+Et-ti]|=128*ir}},5717:$t=>{var jt=Ar;jt(647)==typeof Object[jt(939)]?$t.exports=function(ct,Pe){var Ht=jt;Pe&&(ct.super_=Pe,ct[Ht(1033)]=Object[Ht(939)](Pe[Ht(1033)],{constructor:{value:ct,enumerable:!1,writable:!0,configurable:!0}}))}:$t[jt(533)]=function(ct,Pe){var Ht=jt,si;Pe&&(ct[Ht(443)]=Pe,(si=function(){})[Ht(1033)]=Pe[Ht(1033)],ct[Ht(1033)]=new si,ct[Ht(1033)][Ht(376)]=ct)}},2584:($t,jt,Fi)=>{var Pe=Ar;function Ht(Dt){var Lt=Ar;return!(_t&&Dt&&Lt(1206)==typeof Dt&&Symbol[Lt(252)]in Dt)&&Lt(520)===Yt(Dt)}function si(Dt){var Lt=Ar;return!!Ht(Dt)||Dt!==null&&Lt(1206)==typeof Dt&&typeof Dt.length=="number"&&0<=Dt[Lt(293)]&&Yt(Dt)!=="[object Array]"&&Yt(Dt[Lt(1372)])==="[object Function]"}var _t=Fi(6410)(),Yt=Fi(1924)(Pe(323)),Fi=function(){return Ht(arguments)}();Ht[Pe(458)]=si,$t[Pe(533)]=Fi?Ht:si},5320:$t=>{var jt=Ar,ct,Pe,Ht=Function[jt(1033)][jt(627)],si=jt(1206)==typeof Reflect&&Reflect!==null&&Reflect[jt(306)];if(jt(647)==typeof si&&jt(647)==typeof Object[jt(1208)])try{var _t={};_t[jt(1363)]=function(){throw Pe},ct=Object[jt(1208)]({},jt(293),_t),Pe={},si(function(){throw 42},null,ct)}catch(yt){yt!==Pe&&(si=null)}else si=null;function Yt(yt){var Tt=jt;try{var Et=Ht[Tt(511)](yt);return Dt[Tt(1347)](Et)}catch{return}}function Fi(yt){var Tt=jt;try{return!Yt(yt)&&(Ht[Tt(511)](yt),!0)}catch{return!1}}var Dt=/^\s*class\b/,Lt=Object[jt(1033)].toString,Si=jt(647)==typeof Symbol&&!!Symbol.toStringTag,nt=!(0 in[,]),wt=function(){return!1};typeof document=="object"&&Lt[jt(511)](document.all)===Lt[jt(511)](document[jt(1367)])&&(wt=function(yt){var Tt=jt;if(!(!nt&&yt||yt!==void 0&&Tt(1206)!=typeof yt))try{var Et=Lt[Tt(511)](yt);return(Tt(330)===Et||Tt(328)===Et||Tt(1488)===Et||Tt(1070)===Et)&&yt("")==null}catch{}return!1}),$t.exports=si?function(yt){var Tt=jt;if(wt(yt))return!0;if(!yt||Tt(647)!=typeof yt&&Tt(1206)!=typeof yt)return!1;try{si(yt,null,ct)}catch(Et){if(Et!==Pe)return!1}return!Yt(yt)&&Fi(yt)}:function(yt){var Tt=jt;if(wt(yt))return!0;if(!yt||Tt(647)!=typeof yt&&Tt(1206)!=typeof yt)return!1;if(Si)return Fi(yt);if(Yt(yt))return!1;var Et=Lt[Tt(511)](yt);return!(Tt(500)!==Et&&Tt(560)!==Et&&!/^\[object HTML/[Tt(1347)](Et))&&Fi(yt)}},8662:($t,jt,ct)=>{var Pe=Ar,Ht,si=Object[Pe(1033)][Pe(627)],_t=Function.prototype[Pe(627)],Yt=/^\s*(?:function)?\*/,Fi=ct(6410)(),Dt=Object[Pe(1216)];$t.exports=function(Lt){var Si=Pe;return!(Si(647)!=typeof Lt||!Yt[Si(1347)](_t.call(Lt))&&(Fi?!Dt||(Ht===void 0&&(nt=function(){var wt=Si;if(!Fi)return!1;try{return Function(wt(274))()}catch{}}(),Ht=!!nt&&Dt(nt)),Dt(Lt)!==Ht):Si(560)!==si[Si(511)](Lt)));var nt}},8611:$t=>{var jt=Ar;$t[jt(533)]=function(ct){return ct!=ct}},360:($t,jt,Yt)=>{var Pe=Ar,Fi=Yt(5559),Ht=Yt(4289),si=Yt(8611),_t=Yt(9415),Yt=Yt(3194),Fi=Fi(_t(),Number),Dt={};Dt[Pe(297)]=_t,Dt.implementation=si,Dt[Pe(1165)]=Yt,Ht(Fi,Dt),$t[Pe(533)]=Fi},9415:($t,jt,ct)=>{var Pe=Ar,Ht=ct(8611);$t[Pe(533)]=function(){var si=Pe;return Number[si(1173)]&&Number.isNaN(NaN)&&!Number[si(1173)]("a")?Number[si(1173)]:Ht}},3194:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4289),si=ct(9415);$t[Pe(533)]=function(){var _t=si(),Yt={};return Yt.isNaN=_t,Ht(Number,Yt,{isNaN:function(){var Fi=Ar;return Number[Fi(1173)]!==_t}}),_t}},5692:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4029),si=ct(6314),_t=ct(1924),Yt=_t(Pe(323)),Fi=ct(6410)(),Dt=ct(7296),Lt=typeof globalThis>"u"?ct.g:globalThis,Si=si(),nt=_t("Array.prototype.indexOf",!0)||function(Et,ti){for(var ir=0;ir<Et.length;ir+=1)if(Et[ir]===ti)return ir;return-1},wt=_t(Pe(552)),yt={},Tt=Object[Pe(1216)];Fi&&Dt&&Tt&&Ht(Si,function(Et){var ti=Pe,ir,or=new Lt[Et];Symbol.toStringTag in or&&(or=Tt(or),(ir=Dt(or,Symbol[ti(252)]))||(or=Tt(or),ir=Dt(or,Symbol[ti(252)])),yt[Et]=ir.get)}),$t[Pe(533)]=function(Et){var ti=Pe;return!(!Et||ti(1206)!=typeof Et)&&(Fi&&Symbol[ti(252)]in Et?!!Dt&&(ir=Et,or=!1,Ht(yt,function(xr,Tn){var Ii=ti;if(!or)try{or=xr[Ii(511)](ir)===Tn}catch{}}),or):(Et=wt(Yt(Et),8,-1),-1<nt(Si,Et)));var ir,or}},4244:$t=>{var jt=Ar;function ct(Pe){return Pe!=Pe}$t[jt(533)]=function(Pe,Ht){return Pe===0&&Ht===0?1/Pe==1/Ht:Pe===Ht||!(!ct(Pe)||!ct(Ht))}},609:($t,jt,Yt)=>{var Pe=Ar,Ht=Yt(4289),Fi=Yt(5559),si=Yt(4244),_t=Yt(5624),Yt=Yt(2281),Fi=Fi(_t(),Object),Dt={};Dt[Pe(297)]=_t,Dt.implementation=si,Dt[Pe(1165)]=Yt,Ht(Fi,Dt),$t[Pe(533)]=Fi},5624:($t,jt,ct)=>{var Pe=Ar,Ht=ct(4244);$t[Pe(533)]=function(){var si=Pe;return si(647)==typeof Object.is?Object.is:Ht}},2281:($t,jt,ct)=>{var Pe=Ar,Ht=ct(5624),si=ct(4289);$t[Pe(533)]=function(){var _t=Ht(),Yt={};return Yt.is=_t,si(Object,Yt,{is:function(){return Object.is!==_t}}),_t}},8987:($t,jt,ct)=>{var Pe=Ar,Ht,si,_t,Yt,Fi,Dt,Lt,Si,nt,wt,yt={};yt[Pe(627)]=null;var Tt={};Tt.$applicationCache=!0,Tt[Pe(721)]=!0,Tt[Pe(581)]=!0,Tt.$frame=!0,Tt[Pe(1102)]=!0,Tt[Pe(1506)]=!0,Tt[Pe(1180)]=!0,Tt[Pe(716)]=!0,Tt.$onmozfullscreenchange=!0,Tt[Pe(950)]=!0,Tt.$outerHeight=!0,Tt[Pe(1073)]=!0,Tt.$pageXOffset=!0,Tt[Pe(1007)]=!0,Tt[Pe(638)]=!0,Tt[Pe(928)]=!0,Tt[Pe(1172)]=!0,Tt[Pe(519)]=!0,Tt[Pe(916)]=!0,Tt[Pe(1065)]=!0,Tt.$webkitIndexedDB=!0,Tt.$webkitStorageInfo=!0,Tt[Pe(971)]=!0,Object[Pe(1288)]||(Ht=Object[Pe(1033)][Pe(678)],si=Object[Pe(1033)].toString,_t=ct(1414),ct=Object[Pe(1033)][Pe(948)],Yt=!ct[Pe(511)](yt,Pe(627)),Fi=ct[Pe(511)](function(){},Pe(1033)),Dt=[Pe(627),Pe(1450),Pe(539),Pe(678),"isPrototypeOf",Pe(948),"constructor"],Lt=function(Et){var ti=Pe,ir=Et[ti(376)];return ir&&ir[ti(1033)]===Et},Si=Tt,nt=function(){var Et=Pe;if(typeof window>"u")return!1;for(var ti in window)try{if(!Si["$"+ti]&&Ht[Et(511)](window,ti)&&window[ti]!==null&&Et(1206)==typeof window[ti])try{Lt(window[ti])}catch{return!0}}catch{return!0}return!1}(),wt=function(Et){var ti=Pe,ir=Et!==null&&ti(1206)==typeof Et,or=si[ti(511)](Et)==="[object Function]",xr=_t(Et),Tn=ir&&ti(1456)===si[ti(511)](Et),Ii=[];if(!ir&&!or&&!xr)throw new TypeError(ti(1365));var pr=Fi&∨if(Tn&&0<Et[ti(293)]&&!Ht.call(Et,0))for(var yn=0;yn<Et.length;++yn)Ii[ti(622)](String(yn));if(xr&&0<Et[ti(293)])for(var dn=0;dn<Et[ti(293)];++dn)Ii[ti(622)](String(dn));else for(var fn in Et)pr&&ti(1033)===fn||!Ht.call(Et,fn)||Ii.push(String(fn));if(Yt)for(var Or=function(eo){var Cn=ti;if(Cn(669)==typeof window||!nt)return Lt(eo);try{return Lt(eo)}catch{return!1}}(Et),On=0;On<Dt[ti(293)];++On)Or&&ti(376)===Dt[On]||!Ht.call(Et,Dt[On])||Ii[ti(622)](Dt[On]);return Ii}),$t[Pe(533)]=wt},2215:($t,jt,ct)=>{var Pe=Ar,Ht=Array[Pe(1033)][Pe(1185)],si=ct(1414),_t=Object[Pe(1288)],Yt=_t?function(Dt){return _t(Dt)}:ct(8987),Fi=Object[Pe(1288)];Yt[Pe(1165)]=function(){var Dt=Pe;return Object.keys?function(){var Lt=Ar,Si=Object[Lt(1288)](arguments);return Si&&Si[Lt(293)]===arguments.length}(1,2)||(Object[Dt(1288)]=function(Lt){return si(Lt)?Fi(Ht.call(Lt)):Fi(Lt)}):Object[Dt(1288)]=Yt,Object[Dt(1288)]||Yt},$t[Pe(533)]=Yt},1414:$t=>{var jt=Ar,ct=Object[jt(1033)].toString;$t.exports=function(Pe){var Ht=jt,si=ct[Ht(511)](Pe);return si==="[object Arguments]"||Ht(1427)!==si&&Pe!==null&&Ht(1206)==typeof Pe&&typeof Pe[Ht(293)]=="number"&&0<=Pe.length&&ct[Ht(511)](Pe[Ht(1372)])==="[object Function]"}},4155:Ht=>{var jt=Ar,ct,Pe,Ht=Ht[jt(533)]={};function si(){var Et=jt;throw new Error(Et(1184))}function _t(){throw new Error("clearTimeout has not been defined")}try{ct=jt(647)==typeof setTimeout?setTimeout:si}catch{ct=si}try{Pe=jt(647)==typeof clearTimeout?clearTimeout:_t}catch{Pe=_t}function Yt(Et){var ti=jt;if(ct===setTimeout)return setTimeout(Et,0);if((ct===si||!ct)&&setTimeout)return(ct=setTimeout)(Et,0);try{return ct(Et,0)}catch{try{return ct[ti(511)](null,Et,0)}catch{return ct[ti(511)](this,Et,0)}}}var Fi,Dt=[],Lt=!1,Si=-1;function nt(){var Et=jt;Lt&&Fi&&(Lt=!1,Fi[Et(293)]?Dt=Fi.concat(Dt):Si=-1,Dt[Et(293)]&&wt())}function wt(){var Et=jt;if(!Lt){for(var ti=Yt(nt),ir=(Lt=!0,Dt.length);ir;){for(Fi=Dt,Dt=[];++Si<ir;)Fi&&Fi[Si][Et(1099)]();Si=-1,ir=Dt[Et(293)]}Fi=null,Lt=!1,function(or){var xr=Et;if(Pe===clearTimeout)return clearTimeout(or);if((Pe===_t||!Pe)&&clearTimeout)return(Pe=clearTimeout)(or);try{Pe(or)}catch{try{return Pe[xr(511)](null,or)}catch{return Pe[xr(511)](this,or)}}}(ti)}}function yt(Et,ti){var ir=jt;this[ir(714)]=Et,this[ir(1176)]=ti}function Tt(){}Ht[jt(344)]=function(Et){var ti=jt,ir=new Array(arguments[ti(293)]-1);if(1<arguments.length)for(var or=1;or<arguments[ti(293)];or++)ir[or-1]=arguments[or];Dt[ti(622)](new yt(Et,ir)),Dt[ti(293)]!==1||Lt||Yt(wt)},yt.prototype[jt(1099)]=function(){var Et=jt;this[Et(714)].apply(null,this[Et(1176)])},Ht[jt(957)]="browser",Ht[jt(1385)]=!0,Ht[jt(559)]={},Ht[jt(503)]=[],Ht[jt(923)]="",Ht[jt(807)]={},Ht.on=Tt,Ht[jt(1052)]=Tt,Ht[jt(1015)]=Tt,Ht[jt(1531)]=Tt,Ht[jt(1237)]=Tt,Ht.removeAllListeners=Tt,Ht[jt(524)]=Tt,Ht[jt(362)]=Tt,Ht[jt(250)]=Tt,Ht[jt(907)]=function(Et){return[]},Ht.binding=function(Et){throw new Error("process.binding is not supported")},Ht[jt(348)]=function(){return"/"},Ht.chdir=function(Et){var ti=jt;throw new Error(ti(730))},Ht[jt(932)]=function(){return 0}},384:$t=>{var jt=Ar;$t[jt(533)]=function(ct){var Pe=jt;return ct&&Pe(1206)==typeof ct&&Pe(647)==typeof ct[Pe(419)]&&Pe(647)==typeof ct[Pe(654)]&&typeof ct.readUInt8=="function"}},5955:($t,jt,ct)=>{var Pe=Ar,Ht=ct(2584),si=ct(8662),_t=ct(6430),Yt=ct(5692);function Fi(zr){var Ci=Ar;return zr[Ci(511)].bind(zr)}var Dt,Lt,Si=Pe(669)!=typeof BigInt,nt=Pe(669)!=typeof Symbol,wt=Fi(Object.prototype[Pe(627)]),yt=Fi(Number[Pe(1033)][Pe(539)]),Tt=Fi(String[Pe(1033)][Pe(539)]),Et=Fi(Boolean[Pe(1033)][Pe(539)]);function ti(zr,Ci){var Ni=Pe;if(Ni(1206)!=typeof zr)return!1;try{return Ci(zr),!0}catch{return!1}}function ir(zr){return wt(zr)==="[object Map]"}function or(zr){var Ci=Pe;return Ci(759)===wt(zr)}function xr(zr){var Ci=Pe;return Ci(977)===wt(zr)}function Tn(zr){var Ci=Pe;return Ci(1333)===wt(zr)}function Ii(zr){var Ci=Pe;return Ci(993)===wt(zr)}function pr(zr){var Ci=Pe;return Ci(669)!=typeof ArrayBuffer&&(Ii[Ci(809)]?Ii(zr):zr instanceof ArrayBuffer)}function yn(zr){var Ci=Pe;return Ci(1179)===wt(zr)}function dn(zr){var Ci=Pe;return Ci(669)!=typeof DataView&&(yn.working?yn(zr):zr instanceof DataView)}Si&&(Dt=Fi(BigInt[Pe(1033)][Pe(539)])),nt&&(Lt=Fi(Symbol[Pe(1033)].valueOf)),jt[Pe(341)]=Ht,jt.isGeneratorFunction=si,jt[Pe(1224)]=Yt,jt.isPromise=function(zr){var Ci=Pe;return Ci(669)!=typeof Promise&&zr instanceof Promise||zr!==null&&Ci(1206)==typeof zr&&Ci(647)==typeof zr.then&&typeof zr[Ci(487)]=="function"},jt[Pe(1387)]=function(zr){var Ci=Pe;return Ci(669)!=typeof ArrayBuffer&&ArrayBuffer[Ci(1236)]?ArrayBuffer.isView(zr):Yt(zr)||dn(zr)},jt[Pe(521)]=function(zr){var Ci=Pe;return Ci(880)===_t(zr)},jt[Pe(382)]=function(zr){var Ci=Pe;return Ci(1426)===_t(zr)},jt.isUint16Array=function(zr){return _t(zr)==="Uint16Array"},jt[Pe(551)]=function(zr){var Ci=Pe;return Ci(746)===_t(zr)},jt[Pe(1512)]=function(zr){var Ci=Pe;return Ci(1134)===_t(zr)},jt[Pe(1158)]=function(zr){var Ci=Pe;return Ci(1443)===_t(zr)},jt[Pe(1523)]=function(zr){var Ci=Pe;return Ci(595)===_t(zr)},jt[Pe(1037)]=function(zr){var Ci=Pe;return Ci(752)===_t(zr)},jt[Pe(958)]=function(zr){var Ci=Pe;return Ci(1317)===_t(zr)},jt[Pe(779)]=function(zr){var Ci=Pe;return Ci(772)===_t(zr)},jt[Pe(872)]=function(zr){var Ci=Pe;return Ci(1119)===_t(zr)},ir[Pe(809)]=Pe(669)!=typeof Map&&ir(new Map),jt[Pe(690)]=function(zr){var Ci=Pe;return Ci(669)!=typeof Map&&(ir.working?ir(zr):zr instanceof Map)},or.working=typeof Set<"u"&&or(new Set),jt.isSet=function(zr){var Ci=Pe;return typeof Set<"u"&&(or[Ci(809)]?or(zr):zr instanceof Set)},xr.working=Pe(669)!=typeof WeakMap&&xr(new WeakMap),jt.isWeakMap=function(zr){return typeof WeakMap<"u"&&(xr.working?xr(zr):zr instanceof WeakMap)},Tn.working=Pe(669)!=typeof WeakSet&&Tn(new WeakSet),jt.isWeakSet=Tn,Ii[Pe(809)]=Pe(669)!=typeof ArrayBuffer&&Ii(new ArrayBuffer),jt[Pe(1221)]=pr,yn.working=Pe(669)!=typeof ArrayBuffer&&Pe(669)!=typeof DataView&&yn(new DataView(new ArrayBuffer(1),0,1)),jt[Pe(663)]=dn;var fn=Pe(669)!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function Or(zr){var Ci=Pe;return Ci(493)===wt(zr)}function On(zr){var Ci=Pe;return fn!==void 0&&((Or[Ci(809)]=Or[Ci(809)]===void 0?Or(new fn):Or.working)?Or(zr):zr instanceof fn)}function eo(zr){return ti(zr,yt)}function Cn(zr){return ti(zr,Tt)}function Sa(zr){return ti(zr,Et)}function Va(zr){return Si&&ti(zr,Dt)}function za(zr){return nt&&ti(zr,Lt)}jt[Pe(966)]=On,jt[Pe(1407)]=function(zr){var Ci=Pe;return Ci(820)===wt(zr)},jt[Pe(400)]=function(zr){var Ci=Pe;return Ci(935)===wt(zr)},jt[Pe(299)]=function(zr){var Ci=Pe;return Ci(370)===wt(zr)},jt[Pe(636)]=function(zr){var Ci=Pe;return Ci(823)===wt(zr)},jt[Pe(1030)]=function(zr){var Ci=Pe;return Ci(973)===wt(zr)},jt[Pe(407)]=eo,jt[Pe(1075)]=Cn,jt[Pe(798)]=Sa,jt[Pe(1439)]=Va,jt[Pe(865)]=za,jt[Pe(264)]=function(zr){return eo(zr)||Cn(zr)||Sa(zr)||Va(zr)||za(zr)},jt[Pe(1535)]=function(zr){var Ci=Pe;return Ci(669)!=typeof Uint8Array&&(pr(zr)||On(zr))},[Pe(1083),"isExternal","isModuleNamespaceObject"][Pe(538)](function(zr){var Ci=Pe;Object[Ci(1208)](jt,zr,{enumerable:!1,value:function(){var Ni=Ci;throw new Error(zr+Ni(1250))}})})},9539:($t,jt,ct)=>{var Pe=Ar,Ht,si=ct(4155),_t=ct(5108),Yt=Object.getOwnPropertyDescriptors||function(Ci){for(var Ni=Ar,cr=Object[Ni(1288)](Ci),Bi={},Ct=0;Ct<cr.length;Ct++)Bi[cr[Ct]]=Object[Ni(287)](Ci,cr[Ct]);return Bi},Fi=/%[sdj%]/g,Dt=(jt[Pe(741)]=function(Ci){var Ni=Pe;if(!Tn(Ci)){for(var cr=[],Bi=0;Bi<arguments[Ni(293)];Bi++)cr[Ni(622)](Si(arguments[Bi]));return cr[Ni(1222)](" ")}for(var Bi=1,Ct=arguments,Mi=Ct[Ni(293)],$i=String(Ci)[Ni(1475)](Fi,function(qe){var tt=Ni;if(qe==="%%")return"%";if(Mi<=Bi)return qe;switch(qe){case"%s":return String(Ct[Bi++]);case"%d":return Number(Ct[Bi++]);case"%j":try{return JSON[tt(1414)](Ct[Bi++])}catch{return tt(617)}default:return qe}}),ur=Ct[Bi];Bi<Mi;ur=Ct[++Bi])or(ur)||!yn(ur)?$i+=" "+ur:$i+=" "+Si(ur);return $i},jt.deprecate=function(Ci,Ni){if(si!==void 0&&si.noDeprecation===!0)return Ci;if(si===void 0)return function(){var Bi=Ar;return jt[Bi(398)](Ci,Ni)[Bi(306)](this,arguments)};var cr=!1;return function(){var Bi=Ar;if(!cr){if(si[Bi(693)])throw new Error(Ni);si.traceDeprecation?_t.trace(Ni):_t[Bi(941)](Ni),cr=!0}return Ci[Bi(306)](this,arguments)}},{}),Lt=/^$/;function Si(Ci,Ni){var cr=Pe,Bi={};Bi[cr(589)]=[],Bi.stylize=wt;var Ct=Bi;return 3<=arguments[cr(293)]&&(Ct[cr(1187)]=arguments[2]),4<=arguments.length&&(Ct[cr(629)]=arguments[3]),ir(Ni)?Ct.showHidden=Ni:Ni&&jt[cr(1159)](Ct,Ni),Ii(Ct[cr(358)])&&(Ct[cr(358)]=!1),Ii(Ct[cr(1187)])&&(Ct[cr(1187)]=2),Ii(Ct[cr(629)])&&(Ct.colors=!1),Ii(Ct[cr(891)])&&(Ct[cr(891)]=!0),Ct[cr(629)]&&(Ct[cr(1507)]=nt),yt(Ct,Ci,Ct[cr(1187)])}function nt(Ci,Ni){var cr=Pe;return Ni=Si[cr(482)][Ni],Ni?"\x1B["+Si[cr(629)][Ni][0]+"m"+Ci+"\x1B["+Si[cr(629)][Ni][1]+"m":Ci}function wt(Ci,Ni){return Ci}function yt(Ci,Ni,cr){var Bi=Pe;if(Ci.customInspect&&Ni&&Or(Ni[Bi(1183)])&&Ni[Bi(1183)]!==jt[Bi(1183)]&&(!Ni[Bi(376)]||Ni[Bi(376)][Bi(1033)]!==Ni))return Tn(Ct=Ni[Bi(1183)](cr,Ci))?Ct:yt(Ci,Ct,cr);Ct=Ci;var Ct,Mi=Ii(ur=Ni)?Ct[Bi(1507)](Bi(669),Bi(669)):Tn(ur)?(Mi="'"+JSON.stringify(ur)[Bi(1475)](/^"|"$/g,"")[Bi(1475)](/'/g,"\\'")[Bi(1475)](/\\"/g,'"')+"'",Ct[Bi(1507)](Mi,Bi(665))):xr(ur)?Ct[Bi(1507)](""+ur,Bi(668)):ir(ur)?Ct[Bi(1507)](""+ur,"boolean"):or(ur)?Ct[Bi(1507)](Bi(354),"null"):void 0;if(Mi)return Mi;var $i,ur=Object.keys(Ni),Nr=($i={},ur[Bi(538)](function(St,Zt){$i[St]=!0}),$i);if(Ci[Bi(358)]&&(ur=Object[Bi(602)](Ni)),fn(Ni)&&(0<=ur[Bi(835)](Bi(317))||0<=ur[Bi(835)]("description")))return Tt(Ni);if(ur[Bi(293)]===0){if(Or(Ni))return qe=Ni[Bi(1193)]?": "+Ni.name:"",Ci.stylize("[Function"+qe+"]",Bi(785));if(pr(Ni))return Ci[Bi(1507)](RegExp.prototype[Bi(627)][Bi(511)](Ni),Bi(467));if(dn(Ni))return Ci[Bi(1507)](Date[Bi(1033)][Bi(627)].call(Ni),"date");if(fn(Ni))return Tt(Ni)}var qe="",tt=!1,$e=["{","}"];return ti(Ni)&&(tt=!0,$e=["[","]"]),Or(Ni)&&(qe=Bi(1091)+(Ni.name?": "+Ni.name:"")+"]"),pr(Ni)&&(qe=" "+RegExp.prototype.toString[Bi(511)](Ni)),dn(Ni)&&(qe=" "+Date[Bi(1033)][Bi(1027)].call(Ni)),fn(Ni)&&(qe=" "+Tt(Ni)),ur[Bi(293)]===0&&(!tt||Ni[Bi(293)]==0)?$e[0]+qe+$e[1]:cr<0?pr(Ni)?Ci[Bi(1507)](RegExp[Bi(1033)].toString.call(Ni),Bi(467)):Ci[Bi(1507)](Bi(804),"special"):(Ci[Bi(589)][Bi(622)](Ni),ur=tt?function(St,Zt,ui,hr,Yr){for(var ln=Bi,Kn=[],Un=0,Qn=Zt[ln(293)];Un<Qn;++Un)za(Zt,String(Un))?Kn[ln(622)](Et(St,Zt,ui,hr,String(Un),!0)):Kn[ln(622)]("");return Yr[ln(538)](function(Pa){var Gn=ln;Pa[Gn(1239)](/^\d+$/)||Kn[Gn(622)](Et(St,Zt,ui,hr,Pa,!0))}),Kn}(Ci,Ni,cr,Nr,ur):ur[Bi(272)](function(St){return Et(Ci,Ni,cr,Nr,St,tt)}),Ci[Bi(589)][Bi(465)](),60<ur.reduce(function(St,Zt){var ui=Bi;return Zt.indexOf(` `),St+Zt[ui(1475)](/\u001b\[\d\d?m/g,"")[ui(293)]+1},0)?$e[0]+(qe===""?"":qe+` `)+" "+ur[Bi(1222)](`, `)+" "+$e[1]:$e[0]+qe+" "+ur[Bi(1222)](", ")+" "+$e[1])}function Tt(Ci){var Ni=Pe;return"["+Error[Ni(1033)][Ni(627)][Ni(511)](Ci)+"]"}function Et(Ci,qe,cr,Bi,Ct,Mi){var $i=Pe,ur,Nr,qe=Object.getOwnPropertyDescriptor(qe,Ct)||{value:qe[Ct]};if(qe.get?Nr=qe.set?Ci.stylize("[Getter/Setter]",$i(785)):Ci[$i(1507)]($i(1122),$i(785)):qe.set&&(Nr=Ci[$i(1507)]("[Setter]",$i(785))),za(Bi,Ct)||(ur="["+Ct+"]"),Nr||(Ci.seen[$i(835)](qe[$i(1438)])<0?-1<(Nr=or(cr)?yt(Ci,qe[$i(1438)],null):yt(Ci,qe[$i(1438)],cr-1)).indexOf(` `)&&(Nr=Mi?Nr[$i(277)](` `)[$i(272)](function(tt){return" "+tt})[$i(1222)](` `)[$i(1185)](2):` `+Nr[$i(277)](` `)[$i(272)](function(tt){return" "+tt})[$i(1222)](` `)):Nr=Ci[$i(1507)]($i(617),$i(785))),Ii(ur)){if(Mi&&Ct[$i(1239)](/^\d+$/))return Nr;ur=(ur=JSON.stringify(""+Ct)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(ur=ur[$i(1185)](1,-1),Ci.stylize(ur,$i(1193))):(ur=ur[$i(1475)](/'/g,"\\'")[$i(1475)](/\\"/g,'"')[$i(1475)](/(^"|"$)/g,"'"),Ci.stylize(ur,$i(665)))}return ur+": "+Nr}function ti(Ci){var Ni=Pe;return Array[Ni(1241)](Ci)}function ir(Ci){var Ni=Pe;return Ni(987)==typeof Ci}function or(Ci){return Ci===null}function xr(Ci){var Ni=Pe;return Ni(668)==typeof Ci}function Tn(Ci){return typeof Ci=="string"}function Ii(Ci){return Ci===void 0}function pr(Ci){return yn(Ci)&&On(Ci)==="[object RegExp]"}function yn(Ci){var Ni=Pe;return Ni(1206)==typeof Ci&&Ci!==null}function dn(Ci){return yn(Ci)&&On(Ci)==="[object Date]"}function fn(Ci){var Ni=Pe;return yn(Ci)&&(Ni(630)===On(Ci)||Ci instanceof Error)}function Or(Ci){var Ni=Pe;return Ni(647)==typeof Ci}function On(Ci){var Ni=Pe;return Object.prototype[Ni(627)][Ni(511)](Ci)}function eo(Ci){var Ni=Pe;return Ci<10?"0"+Ci[Ni(627)](10):Ci[Ni(627)](10)}var Cn={};Cn.bold=[1,22],Cn[Pe(1322)]=[3,23],Cn.underline=[4,24],Cn[Pe(1453)]=[7,27],Cn[Pe(1194)]=[37,39],Cn.grey=[90,39],Cn[Pe(857)]=[30,39],Cn[Pe(1177)]=[34,39],Cn[Pe(422)]=[36,39],Cn.green=[32,39],Cn[Pe(815)]=[35,39],Cn.red=[31,39],Cn.yellow=[33,39];var Sa={};Sa[Pe(785)]=Pe(422),Sa[Pe(668)]=Pe(938),Sa[Pe(987)]="yellow",Sa[Pe(669)]=Pe(840),Sa[Pe(354)]=Pe(543),Sa[Pe(665)]="green",Sa[Pe(1248)]=Pe(815),Sa.regexp=Pe(393),si[Pe(559)][Pe(813)]&&(Ht=(Ht=si.env[Pe(813)])[Pe(1475)](/[|\\{}()[\]^$+?.]/g,Pe(805))[Pe(1475)](/\*/g,".*").replace(/,/g,Pe(1419))[Pe(1388)](),Lt=new RegExp("^"+Ht+"$","i")),jt[Pe(565)]=function(Ci){var Ni=Pe,cr;return Ci=Ci[Ni(1388)](),Dt[Ci]||(Lt[Ni(1347)](Ci)?(cr=si.pid,Dt[Ci]=function(){var Bi=Ni,Ct=jt.format[Bi(306)](jt,arguments);_t.error(Bi(1345),Ci,cr,Ct)}):Dt[Ci]=function(){}),Dt[Ci]},(jt[Pe(1183)]=Si)[Pe(629)]=Cn,Si.styles=Sa,jt[Pe(901)]=ct(5955),jt.isArray=ti,jt[Pe(1502)]=ir,jt[Pe(919)]=or,jt[Pe(273)]=function(Ci){return Ci==null},jt[Pe(540)]=xr,jt[Pe(1352)]=Tn,jt[Pe(438)]=function(Ci){return typeof Ci=="symbol"},jt[Pe(1359)]=Ii,jt[Pe(1406)]=pr,jt[Pe(901)].isRegExp=pr,jt.isObject=yn,jt[Pe(1472)]=dn,jt[Pe(901)][Pe(1472)]=dn,jt[Pe(322)]=fn,jt.types[Pe(1108)]=fn,jt[Pe(501)]=Or,jt.isPrimitive=function(Ci){var Ni=Pe;return Ci===null||Ni(987)==typeof Ci||Ni(668)==typeof Ci||typeof Ci=="string"||Ni(1245)==typeof Ci||Ci===void 0},jt[Pe(953)]=ct(384);var Va=["Jan","Feb","Mar","Apr",Pe(1286),Pe(781),Pe(442),Pe(692),"Sep","Oct",Pe(456),"Dec"];function za(Ci,Ni){var cr=Pe;return Object[cr(1033)].hasOwnProperty[cr(511)](Ci,Ni)}jt[Pe(826)]=function(){var Ci=Pe,Ni,cr;_t[Ci(826)](Ci(892),(cr=[eo((Ni=new Date)[Ci(1499)]()),eo(Ni[Ci(318)]()),eo(Ni.getSeconds())][Ci(1222)](":"),[Ni.getDate(),Va[Ni[Ci(867)]()],cr].join(" ")),jt[Ci(741)][Ci(306)](jt,arguments))},jt[Pe(895)]=ct(5717),jt._extend=function(Ci,Ni){var cr=Pe;if(!Ni||!yn(Ni))return Ci;for(var Bi=Object.keys(Ni),Ct=Bi[cr(293)];Ct--;)Ci[Bi[Ct]]=Ni[Bi[Ct]];return Ci};var zr=Pe(669)!=typeof Symbol?Symbol("util.promisify.custom"):void 0;jt[Pe(825)]=function(Ci){var Ni=Pe;if(Ni(647)!=typeof Ci)throw new TypeError(Ni(530));if(zr&&Ci[zr]){var cr;if(Ni(647)!=typeof(cr=Ci[zr]))throw new TypeError(Ni(803));return Object[Ni(1208)](cr,zr,{value:cr,enumerable:!1,writable:!1,configurable:!0}),cr}function cr(){for(var Bi=Ni,Ct,Mi,$i=new Promise(function(qe,tt){Ct=qe,Mi=tt}),ur=[],Nr=0;Nr<arguments[Bi(293)];Nr++)ur[Bi(622)](arguments[Nr]);ur[Bi(622)](function(qe,tt){qe?Mi(qe):Ct(tt)});try{Ci[Bi(306)](this,ur)}catch(qe){Mi(qe)}return $i}return Object.setPrototypeOf(cr,Object[Ni(1216)](Ci)),zr&&Object[Ni(1208)](cr,zr,{value:cr,enumerable:!1,writable:!1,configurable:!0}),Object[Ni(1341)](cr,Yt(Ci))},jt[Pe(825)][Pe(1498)]=zr,jt.callbackify=function(Ci){var Ni=Pe;if(Ni(647)!=typeof Ci)throw new TypeError(Ni(530));function cr(){for(var Bi=Ni,Ct=[],Mi=0;Mi<arguments[Bi(293)];Mi++)Ct[Bi(622)](arguments[Mi]);var $i=Ct.pop();if(Bi(647)!=typeof $i)throw new TypeError("The last argument must be of type Function");function ur(){var qe=Bi;return $i[qe(306)](Nr,arguments)}var Nr=this;Ci[Bi(306)](this,Ct)[Bi(283)](function(qe){var tt=Bi;si.nextTick(ur[tt(633)](null,null,qe))},function(qe){var tt=Bi;si.nextTick(function($e,St){var Zt=Ar,ui;return $e||((ui=new Error(Zt(847)))[Zt(1413)]=$e,$e=ui),St($e)}[tt(633)](null,qe,ur))})}return Object[Ni(1403)](cr,Object[Ni(1216)](Ci)),Object[Ni(1341)](cr,Yt(Ci)),cr}},4005:$t=>{var jt=Ar;$t[jt(533)]=jt(1395)},9594:$t=>{var jt=Ar;$t[jt(533)]=jt(824)},9117:$t=>{var jt=Ar;$t[jt(533)]=jt(1534)},5960:$t=>{var jt=Ar;$t[jt(533)]=jt(1031)},3272:$t=>{$t.exports=`#version 300 es\r \r precision highp float;\r precision highp int;\r precision highp usampler2D;\r \r uniform usampler2D uRenderInstancesTextureSampler;\r // \u6E32\u67D3\u5BBD\u5EA6\r // \u5B9E\u4F8B\u7D22\u5F15\u6700\u5927\u6570\u91CF\r // \u9876\u70B9\u6700\u5927\u6570\u91CF\r uniform uvec3 parData;\r \r layout(location=0) out uvec4 outFrag1;\r void main(void) {\r uint vid = uint(gl_FragCoord.x) + uint(gl_FragCoord.y) * parData[0];\r // \u5C0F\u4E8E\u6700\u5927\u9876\u70B9\u6570\u91CF\r if(parData[2] > vid){\r uvec2 texSizeRenderIndex = uvec2(textureSize(uRenderInstancesTextureSampler,0));\r uvec2 range = uvec2(0,parData[1]);\r while(true)\r {\r uint offset = (range.y - range.x) / 2u + range.x;\r uint h = offset / texSizeRenderIndex.x;\r uint w = offset - h * texSizeRenderIndex.x;\r uvec4 data = texelFetch(uRenderInstancesTextureSampler,ivec2(w,h) ,0);\r if(vid < data.z){\r range = uvec2(range.x,offset);\r }else{\r if(vid >= data.z && vid < data.w){\r // \u5B9E\u4F8B\u504F\u79FB,\u9876\u70B9\u8D77\u59CB\u504F\u79FB,\u9876\u70B9\u4E2A\u6570\r outFrag1 = uvec4(data.xy,vid - data.z,1u);\r break;\r }\r range = uvec2(offset,range.y);\r }\r }\r }else{\r outFrag1 = uvec4(0u,0u,0u,0u);\r }\r }`},5773:$t=>{var jt=Ar;$t.exports=jt(1458)},769:$t=>{var jt=Ar;$t[jt(533)]=jt(571)},6792:$t=>{var jt=Ar;$t[jt(533)]=jt(1031)},7511:$t=>{var jt=Ar;$t[jt(533)]=jt(290)},2225:$t=>{var jt=Ar;$t[jt(533)]=jt(626)},108:$t=>{var jt=Ar;$t.exports=jt(988)},8242:$t=>{var jt=Ar;$t[jt(533)]=jt(499)},7688:$t=>{$t.exports=`#version 300 es\r \r \r precision highp float;\r precision highp int;\r precision highp usampler2D;\r \r uniform sampler2D uMixTextureSampler;\r uniform sampler2D uPositionTextureSampler;\r uniform sampler2D uInstancesIndexTextureSampler;\r uniform usampler2D uRenderIndexTextureSampler;\r \r uniform mat4 viewProjection;\r uniform float clipPlane[81];\r uniform float near;\r uniform bool useLogDepth;\r \r out float v_depthFromNearPlusOne;\r out mediump float vDiscard;\r out float clipReset[6];\r \r ivec2 getTextureCoordinates(uint index, uint width)\r {\r uint y = index / width;\r uint x = index - width * y;\r if(x >= width){\r x = x - width;\r y += 1u;\r }\r return ivec2(x,y);\r }\r \r ivec2 getTextureCoordinates2(ivec2 coor, uint width)\r {\r if(coor.x >= int(width)){\r coor.x = coor.x - int(width);\r coor.y += 1;\r }\r return coor;\r }\r \r void main(void) {\r int texRenderIndexWidth = int(textureSize(uRenderIndexTextureSampler,0).x);\r int h = gl_VertexID / texRenderIndexWidth;\r int w = gl_VertexID - h * texRenderIndexWidth;\r uvec4 renderIndex = texelFetch(uRenderIndexTextureSampler,ivec2(w,h) ,0);\r // \u5982\u679CrenderIndex.w\u7B49\u4E8E0\u5219\u53EF\u4EE5\u653E\u5F03\u6267\u884C\r if(renderIndex.w == 0u){\r vDiscard = 0.0;\r }\r \r uint texPositionWidth = uint(textureSize(uPositionTextureSampler,0).x);\r ivec4 posIndex_Normal_Uv_Tangent = ivec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y + renderIndex.z,texPositionWidth),0));\r vec4 posMaterial = texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y - 1u,texPositionWidth),0);\r uint texInstancesIndexWidth = uint(textureSize(uInstancesIndexTextureSampler,0).x);\r ivec2 textureCoordinatesInstances = getTextureCoordinates(renderIndex.x,texInstancesIndexWidth);\r vec4 vI1 = texelFetch(uInstancesIndexTextureSampler, textureCoordinatesInstances,0);\r vec4 vI2 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+1,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI3 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+2,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI4 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+3,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI5 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+4,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r mat4 instanceMatrix = mat4(vec4(vI1.x,vI1.y,vI1.z,0.0),vec4(vI1.w,vI2.x,vI2.y,0.0),vec4(vI2.z,vI2.w,vI3.x,0.0),vec4(vI3.y,vI3.z,vI3.w,1.0));\r float vInstancesId = vI4.x;\r uint texMixWidth = uint(textureSize(uMixTextureSampler,0).x);\r \r ivec2 textureCoordinatesModelMatrixIndex = getTextureCoordinates(uint(vI4.z),texMixWidth);\r vec4 vM1 = texelFetch(uMixTextureSampler, textureCoordinatesModelMatrixIndex,0);\r vec4 vM2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+1,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vM3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+2,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vM4 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+3,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r mat4 modelMatrix = mat4(vM1,vM2,vM3,vM4);\r \r vec4 vM5 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vDiscard = min(vM5.x,vI4.w);\r float vModelId = vM5.y;\r \r if(vI5.y != 0.0 && vI5.z != 0.0){\r vec4 vMStorey = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+5+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+5+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r \r if(vI4.w != 3.0){\r if(vMStorey.x == 1.0 || vMExpressType.x == 1.0){\r vDiscard = 0.0;\r }\r }\r if(vMStorey.y == 1.0){\r vec4 vMStorey1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+6+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMStorey2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+7+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMStorey3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+8+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r instanceMatrix = mat4(vec4(vMStorey1.x,vMStorey1.y,vMStorey1.z,0.0),\r vec4(vMStorey1.w,vMStorey2.x,vMStorey2.y,0.0),\r vec4(vMStorey2.z,vMStorey2.w,vMStorey3.x,0.0),\r vec4(vMStorey3.y,vMStorey3.z,vMStorey3.w,1.0)) * instanceMatrix;\r }\r if(vMExpressType.y == 1.0){\r vec4 vMExpressType1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+6+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+7+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+8+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r instanceMatrix = mat4(vec4(vMExpressType1.x,vMExpressType1.y,vMExpressType1.z,0.0),\r vec4(vMExpressType1.w,vMExpressType2.x,vMExpressType2.y,0.0),\r vec4(vMExpressType2.z,vMExpressType2.w,vMExpressType3.x,0.0),\r vec4(vMExpressType3.y,vMExpressType3.z,vMExpressType3.w,1.0)) * instanceMatrix;\r }\r }\r \r \r vec3 posT = (instanceMatrix * vec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(uint(int(renderIndex.y) + posIndex_Normal_Uv_Tangent.x),texPositionWidth),0).xyz,1.)).xyz;\r vec3 vPositionW = vec3(modelMatrix * vec4(posT, 1.0));\r gl_Position = viewProjection * vec4(vPositionW.xyz, 1.0);\r \r int planeCount = int(abs(clipPlane[0]));\r for (int i = 1,j = 0; i < planeCount * 4; i+=4,j++){\r clipReset[j] = dot(vec3(clipPlane[i],clipPlane[i+1],clipPlane[i+2]),vPositionW.xyz) + clipPlane[i+3];\r }\r if (useLogDepth) {\r v_depthFromNearPlusOne = (gl_Position.w - near) + 1.0;\r gl_Position.z = clamp(gl_Position.z / gl_Position.w, -1.0, 1.0) * gl_Position.w;\r }\r }`},4040:$t=>{var jt=Ar;$t[jt(533)]=jt(1441)},6238:$t=>{var jt=Ar;$t[jt(533)]=jt(604)},6430:($t,jt,ct)=>{var Pe=Ar,Ht={};Ht[Pe(534)]=null;var si=ct(4029),nt=ct(6314),_t=ct(5559),Yt=ct(1924),Fi=ct(7296),Dt=Yt(Pe(323)),Lt=ct(6410)(),Si=Pe(669)==typeof globalThis?ct.g:globalThis,nt=nt(),wt=Yt(Pe(552)),yt=Ht,Tt=Object[Pe(1216)],Et=(Lt&&Fi&&Tt&&si(nt,function(ti){var ir=Pe,or,xr;ir(647)==typeof Si[ti]&&(or=new Si[ti],Symbol[ir(252)]in or&&(or=Tt(or),(xr=Fi(or,Symbol[ir(252)]))||(or=Tt(or),xr=Fi(or,Symbol[ir(252)])),yt[ti]=_t(xr[ir(1363)])))}),ct(5692));$t.exports=function(ti){var ir=Pe;return!!Et(ti)&&(Lt&&Symbol[ir(252)]in ti?(or=ti,xr=!1,si(yt,function(Tn,Ii){if(!xr)try{var pr=Tn(or);pr===Ii&&(xr=pr)}catch{}}),xr):wt(Dt(ti),8,-1));var or,xr}}},m={};function v($t){var jt=Ar,ct=m[$t];if(ct!==void 0)return ct[jt(533)];var Pe={};return Pe[jt(533)]={},ct=m[$t]=Pe,f[$t](ct,ct.exports,v),ct[jt(533)]}v.m=f,v.n=$t=>{var jt=Ar,ct=$t&&$t[jt(643)]?()=>$t[jt(754)]:()=>$t;return v.d(ct,{a:ct}),ct},v.d=($t,jt)=>{for(var ct in jt)v.o(jt,ct)&&!v.o($t,ct)&&Object.defineProperty($t,ct,{enumerable:!0,get:jt[ct]})},v.u=$t=>o(610),v.g=function(){var $t=o;if($t(1206)==typeof globalThis)return globalThis;try{return this||new Function($t(525))()}catch{if(typeof window=="object")return window}}(),v.o=($t,jt)=>Object.prototype[o(678)].call($t,jt),v.r=$t=>{var jt=o,ct={};ct[jt(1438)]=jt(360);var Pe={};Pe[jt(1438)]=!0,jt(669)!=typeof Symbol&&Symbol[jt(252)]&&Object[jt(1208)]($t,Symbol[jt(252)],ct),Object[jt(1208)]($t,jt(643),Pe)},v.p="./",v.b=document.baseURI||self.location.href;var y={};{let jt=function(Xi){$t=Xi},Pe=function(Xi){ct=Xi},Ht=function(){var Xi=o;return new ct(16)[Xi(654)](0)},si=function(Zo,ke){ke=ke||new ct(16);var Ie=Zo[0],jd=Zo[1],He=Zo[2],dt=Zo[3],Vt=Zo[4],ju=Zo[5],ni=Zo[6],_r=Zo[7],Ir=Zo[8],Pn=Zo[9],An=Zo[10],Wr=Zo[11],Ho=Zo[12],hp=Zo[13],ma=Zo[14],Zo=Zo[15],$o=An*Zo,du=ma*Wr,rs=ni*Zo,Wa=ma*_r,fu=ni*Wr,Hs=An*_r,Wu=He*Zo,Ic=ma*dt,Os=He*Wr,Ns=An*dt,_c=He*_r,_f=ni*dt,wd=Ir*hp,Bc=Ho*Pn,vf=Vt*hp,cp=Ho*ju,yf=Vt*Pn,Vp=Ir*ju,Hf=Ie*hp,bu=Ho*jd,hy=Ie*Pn,zp=Ir*jd,km=Ie*ju,bg=Vt*jd,Qh=$o*ju+Wa*Pn+fu*hp-(du*ju+rs*Pn+Hs*hp),s0=du*jd+Wu*Pn+Ns*hp-($o*jd+Ic*Pn+Os*hp),hp=rs*jd+Ic*ju+_c*hp-(Wa*jd+Wu*ju+_f*hp),jd=Hs*jd+Os*ju+_f*Pn-(fu*jd+Ns*ju+_c*Pn),ju=1/(Ie*Qh+Vt*s0+Ir*hp+Ho*jd);return ke[0]=ju*Qh,ke[1]=ju*s0,ke[2]=ju*hp,ke[3]=ju*jd,ke[4]=ju*(du*Vt+rs*Ir+Hs*Ho-($o*Vt+Wa*Ir+fu*Ho)),ke[5]=ju*($o*Ie+Ic*Ir+Os*Ho-(du*Ie+Wu*Ir+Ns*Ho)),ke[6]=ju*(Wa*Ie+Wu*Vt+_f*Ho-(rs*Ie+Ic*Vt+_c*Ho)),ke[7]=ju*(fu*Ie+Ns*Vt+_c*Ir-(Hs*Ie+Os*Vt+_f*Ir)),ke[8]=ju*(wd*_r+cp*Wr+yf*Zo-(Bc*_r+vf*Wr+Vp*Zo)),ke[9]=ju*(Bc*dt+Hf*Wr+zp*Zo-(wd*dt+bu*Wr+hy*Zo)),ke[10]=ju*(vf*dt+bu*_r+km*Zo-(cp*dt+Hf*_r+bg*Zo)),ke[11]=ju*(Vp*dt+hy*_r+bg*Wr-(yf*dt+zp*_r+km*Wr)),ke[12]=ju*(vf*An+Vp*ma+Bc*ni-(yf*ma+wd*ni+cp*An)),ke[13]=ju*(hy*ma+wd*He+bu*An-(Hf*An+zp*ma+Bc*He)),ke[14]=ju*(Hf*ni+bg*ma+cp*He-(km*ma+vf*He+bu*ni)),ke[15]=ju*(km*An+yf*He+zp*ni-(hy*ni+bg*An+Vp*He)),ke},_t=function(Wa,bu,Ie){Ie=Ie||new ct(16);var He=Wa[0],dt=Wa[1],Vt=Wa[2],ni=Wa[3],_r=Wa[4],Ir=Wa[5],Pn=Wa[6],An=Wa[7],Wr=Wa[8],Ho=Wa[9],ma=Wa[10],Zo=Wa[11],$o=Wa[12],du=Wa[13],rs=Wa[14],Wa=Wa[15],fu=bu[0],Hs=bu[1],Wu=bu[2],Ic=bu[3],Os=bu[4],Ns=bu[5],_c=bu[6],_f=bu[7],wd=bu[8],Bc=bu[9],vf=bu[10],cp=bu[11],yf=bu[12],Vp=bu[13],Hf=bu[14],bu=bu[15];return Ie[0]=He*fu+_r*Hs+Wr*Wu+$o*Ic,Ie[1]=dt*fu+Ir*Hs+Ho*Wu+du*Ic,Ie[2]=Vt*fu+Pn*Hs+ma*Wu+rs*Ic,Ie[3]=ni*fu+An*Hs+Zo*Wu+Wa*Ic,Ie[4]=He*Os+_r*Ns+Wr*_c+$o*_f,Ie[5]=dt*Os+Ir*Ns+Ho*_c+du*_f,Ie[6]=Vt*Os+Pn*Ns+ma*_c+rs*_f,Ie[7]=ni*Os+An*Ns+Zo*_c+Wa*_f,Ie[8]=He*wd+_r*Bc+Wr*vf+$o*cp,Ie[9]=dt*wd+Ir*Bc+Ho*vf+du*cp,Ie[10]=Vt*wd+Pn*Bc+ma*vf+rs*cp,Ie[11]=ni*wd+An*Bc+Zo*vf+Wa*cp,Ie[12]=He*yf+_r*Vp+Wr*Hf+$o*bu,Ie[13]=dt*yf+Ir*Vp+Ho*Hf+du*bu,Ie[14]=Vt*yf+Pn*Vp+ma*Hf+rs*bu,Ie[15]=ni*yf+An*Vp+Zo*Hf+Wa*bu,Ie},ti=function(Xi,ke){var Ie=o;if(Xi&&Ie(1206)==typeof Xi){let He=Et.get(ke),dt=(He||(He=new WeakMap,Et[Ie(1024)](ke,He)),He[Ie(1363)](Xi));if(dt===void 0){let Vt=Object[Ie(1033)].toString[Ie(511)](Xi);dt=Vt[Ie(874)](8,Vt[Ie(293)]-1)===ke,He[Ie(1024)](Xi,dt)}return dt}},ir=function(Xi,ke){var Ie=o;return Ie(669)!=typeof WebGLTexture&&ti(ke,Ie(670))},or=function(Xi){return Xi.texStorage2D},Ii=function(Xi){var ke=o;return ke(669)!=typeof document&&document.getElementById?document.getElementById(Xi):null},Ct=function(Xi,ke){return Bi[ke].bindPoint},Mi=function(Xi,ke){return function(Ie){var He=Ar;Xi[He(1071)](ke,Ie)}},$i=function(Xi,ke){return function(Ie){Xi.uniform1iv(ke,Ie)}},ur=function(Xi,ke){return function(Ie){var He=Ar;Xi[He(1556)](ke,Ie)}},Nr=function(Xi,ke){return function(Ie){var He=Ar;Xi[He(1032)](ke,Ie)}},qe=function(Xi,ke){return function(Ie){Xi.uniform4iv(ke,Ie)}},tt=function(Xi,ke,Ie,He){let dt=Ct(0,ke);return or(Xi)?function(Vt){var ni=Ar;let _r,Ir;Ir=!Vt||ir(0,Vt)?(_r=Vt,null):(_r=Vt.texture,Vt.sampler),Xi[ni(1071)](He,Ie),Xi.activeTexture(pr+Ie),Xi[ni(600)](dt,_r),Xi[ni(794)](Ie,Ir)}:function(Vt){var ni=Ar;Xi[ni(1071)](He,Ie),Xi[ni(1397)](pr+Ie),Xi[ni(600)](dt,Vt)}},$e=function(Xi,ke,Ie,He,dt){let Vt=Ct(0,ke),ni=new Int32Array(dt);for(let _r=0;_r<dt;++_r)ni[_r]=Ie+_r;return or(Xi)?function(_r){var Ir=Ar;Xi[Ir(1552)](He,ni),_r[Ir(538)](function(Pn,An){var Wr=Ir;Xi[Wr(1397)](pr+ni[An]);let Ho,ma;ma=!Pn||ir(0,Pn)?(Ho=Pn,null):(Ho=Pn[Wr(829)],Pn[Wr(474)]),Xi[Wr(794)](Ie,ma),Xi[Wr(600)](Vt,Ho)})}:function(_r){Xi.uniform1iv(He,ni),_r.forEach(function(Ir,Pn){Xi.activeTexture(pr+ni[Pn]),Xi.bindTexture(Vt,Ir)})}},St=function(Xi,ke){return function(Ie){var He=Ar;if(Ie.value)switch(Xi[He(1182)](ke),Ie[He(1438)][He(293)]){case 4:Xi.vertexAttrib4fv(ke,Ie[He(1438)]);break;case 3:Xi[He(1081)](ke,Ie[He(1438)]);break;case 2:Xi[He(1021)](ke,Ie[He(1438)]);break;case 1:Xi.vertexAttrib1fv(ke,Ie.value);break;default:throw new Error("the length of a float constant value must be between 1 and 4!")}else Xi[He(784)](yn,Ie[He(990)]),Xi[He(1452)](ke),Xi[He(351)](ke,Ie.numComponents||Ie[He(800)],Ie[He(1490)]||5126,Ie[He(947)]||!1,Ie[He(435)]||0,Ie[He(573)]||0),Xi[He(286)]&&Xi[He(286)](ke,Ie[He(651)]||0)}},Zt=function(Xi,ke){return function(Ie){var He=Ar;if(Ie[He(1438)]){if(Xi[He(1182)](ke),Ie.value[He(293)]!==4)throw new Error(He(1023));Xi[He(372)](ke,Ie[He(1438)])}else Xi[He(784)](yn,Ie[He(990)]),Xi[He(1452)](ke),Xi[He(1516)](ke,Ie.numComponents||Ie.size,Ie[He(1490)]||5124,Ie.stride||0,Ie[He(573)]||0),Xi.vertexAttribDivisor&&Xi.vertexAttribDivisor(ke,Ie.divisor||0)}},ui=function(Xi,ke){return function(Ie){var He=Ar;if(Ie[He(1438)]){if(Xi[He(1182)](ke),Ie.value[He(293)]!==4)throw new Error(He(783));Xi[He(1366)](ke,Ie[He(1438)])}else Xi[He(784)](yn,Ie[He(990)]),Xi.enableVertexAttribArray(ke),Xi[He(1516)](ke,Ie[He(1277)]||Ie.size,Ie[He(1490)]||5125,Ie[He(435)]||0,Ie[He(573)]||0),Xi[He(286)]&&Xi[He(286)](ke,Ie[He(651)]||0)}},hr=function(Xi,ke,Ie){var He=o;let dt=Ie[He(800)],Vt=Ie[He(582)];return function(ni){var _r=He;Xi.bindBuffer(yn,ni.buffer);var Ir=ni.size||ni[_r(1277)]||dt,Pn=Ir/Vt,An=ni.type||5126,Wr=Bi[An][_r(800)]*Ir,Ho=ni.normalize||!1,ma=ni.offset||0,Zo=Wr/Vt;for(let $o=0;$o<Vt;++$o)Xi[_r(1452)](ke+$o),Xi.vertexAttribPointer(ke+$o,Pn,An,Ho,Wr,ma+Zo*$o),Xi[_r(286)]&&Xi[_r(286)](ke+$o,ni.divisor||0)}},Un=function(Xi){var ke=o;let Ie=0;return Kn[ke(1347)](Xi)&&(Ie=1,Xi=Xi[ke(1475)](Kn,"")),{lineOffset:Ie,shaderSource:Xi}},Qn=function(Xi,ke,Ie){var He=o;let dt,Vt,ni;var _r;He(647)==typeof ke&&(Ie=ke,ke=void 0),He(647)==typeof Xi?(Ie=Xi,Xi=void 0):Xi&&!Array[He(1241)](Xi)&&(Ie=(_r=Xi)[He(1204)],Xi=_r[He(1264)],dt=_r[He(1124)],Vt=_r[He(502)],ni=_r[He(918)]);let Ir=Ie||Tn,Pn=[],An={errorCallback(Wr,...Ho){Pn.push(Wr),Ir(Wr,...Ho)},transformFeedbackVaryings:dt,transformFeedbackMode:Vt,callback:ni,errors:Pn};{let Wr={};Array.isArray(Xi)?Xi.forEach(function(Ho,ma){Wr[Ho]=ke?ke[ma]:ma}):Wr=Xi||{},An[He(1264)]=Wr}return An},Ja=function(Xi,ke,Vt){var He=o;let dt=Xi[He(1412)]();var{attribLocations:Vt,transformFeedbackVaryings:ni,transformFeedbackMode:_r}=Qn(Vt);for(let An=0;An<ke[He(293)];++An){let Wr=ke[An];if(He(665)==typeof Wr){var Ir=Ii(Wr),Pn=Ir?Ir[He(365)]:Wr;let Ho=Xi[Pa[An]];Ir&&Ir[He(1490)]&&(Ho=(0<=(Ir=Ir.type)[He(835)]("frag")?Or:0<=Ir.indexOf(He(498))?On:void 0)||Ho),Wr=Xi[He(837)](Ho),Xi[He(340)](Wr,Un(Pn)[He(340)]),Xi.compileShader(Wr),Xi[He(1296)](dt,Wr)}}Object[He(1537)](Vt)[He(538)](([An,Wr])=>Xi[He(905)](dt,Wr,An));{let An=ni;An&&(An[He(387)]&&(An=An[He(387)]),Array[He(1241)](An)||(An=Object[He(1288)](An)),Xi.transformFeedbackVaryings(dt,An,_r||eo))}return Xi[He(1251)](dt),dt},fl=function(Xi,ke,Ie,He,dt){var Vt=o;let ni=Qn(Ie,He,dt),_r=new Set(ke),Ir=Ja(Xi,ke,ni);function Pn(An,Wr){var Ho=Ar,ma=hu(An,Wr,ni.errorCallback);if(ma){var Zo=An,An=Wr,$o=_r;for(let rs of Zo[Ho(671)](An))$o.has(rs)&&Zo[Ho(1440)](rs);Zo[Ho(827)](An)}return ma}if(!ni.callback)return Pn(Xi,Ir)?void 0:Ir;Ul(Xi,Ir)[Vt(283)](()=>{var An=Vt,Wr=Pn(Xi,Ir);ni[An(918)](Wr,Wr?void 0:Ir)})},hu=function(Xi,ke,Ie){var He=o;if(Ie=Ie||Tn,!Xi[He(797)](ke,fn)){var dt=Xi[He(821)](ke);Ie(He(1526)+dt);let Vt=Xi[He(671)](ke),ni=Vt[He(272)](_r=>{var Ir=He,Pn,An,Wr=Xi,Ho=Xi.getShaderParameter(_r,Xi.SHADER_TYPE),ma=Ie;return ma=ma||Tn,Wr[Ir(1342)](_r,dn)?"":(Pn=Wr[Ir(1166)](_r),{lineOffset:_r,shaderSource:An}=Un(Wr.getShaderSource(_r)),ma(ma=function(Zo,$o="",du=0){var rs=Ir;let Wa=[...$o.matchAll(ln)],fu=new Map(Wa[rs(272)]((Hs,Ns)=>{var Ic=rs,Os=parseInt(Hs[1]),Ns=Wa[Ns+1],Ns=Ns?Ns.index:$o[Ic(293)];return[Os-1,$o[Ic(874)](Hs[Ic(1279)],Ns)]}));return Zo[rs(277)](` `)[rs(272)]((Hs,Wu)=>{var Ic=rs,Os=fu[Ic(1363)](Wu);return Wu+1+du+": "+Hs+(Os?Ic(1035)+Os:"")})[rs(1222)](` `)}(An,Pn,_r)+Ir(674)+xr(Wr,Ho)+": "+Pn),ma)});return dt+` `+ni[He(753)](_r=>_r)[He(1222)](` `)}},Ys=function(Xi){var ke=o;let Ie=Xi[ke(1193)];return Ie.startsWith(ke(955))||Ie[ke(574)]("webgl_")},Pc=function(Xi,ke){var Ie=o;let He=0,dt={};var Vt={},ni=Xi[Ie(797)](ke,Cn);for(let du=0;du<ni;++du){var _r=Xi[Ie(1212)](ke,du);if(!Ys(_r)){let rs=_r[Ie(1193)];rs[Ie(486)](Ie(787))&&(rs=rs[Ie(841)](0,rs.length-3));var Ir=Xi[Ie(1489)](ke,_r[Ie(1193)]);if(Ir){_r=function(Wa,fu){var Hs=Ie,Wu,Ic=Wa[Hs(1193)].endsWith("[0]");let Os=Wa[Hs(1490)],Ns=Bi[Os];if(!Ns)throw new Error(Hs(373)+Os[Hs(627)](16));let _c;return(_c=Ns[Hs(450)]?(Wu=He,He+=Wa[Hs(800)],Ic?Ns[Hs(1349)](Xi,Os,Wu,fu,Wa[Hs(800)]):Ns[Hs(949)](Xi,Os,Wu,fu,Wa.size)):Ns.arraySetter&&Ic?Ns[Hs(1349)](Xi,fu):Ns[Hs(949)](Xi,fu)).location=fu,_c}(_r,Ir),dt[rs]=_r;{Ir=void 0,Pn=void 0,An=void 0,Wr=void 0,Zo=void 0,Ho=void 0,ma=void 0,Zo=void 0,ma=void 0,Zo=void 0,$o=void 0,Ir=rs;var Pn=_r,An=Vt,Wr=dt,Ho=Ir.split(Wd).filter(Hs=>Hs!=="");let Wa=0,fu="";for(;;){var ma=Ho[Wa++],Zo=(fu+=ma,"0"<=(Zo=ma[0])&&Zo<="9"),ma=Zo?parseInt(ma):ma;if(Zo&&(fu+=Ho[Wa++]),Wa===Ho.length){An[ma]=Pn;break}var Zo=Ho[Wa++],$o=An[ma]||(Zo==="["?[]:{});An[ma]=$o,An=$o,Wr[fu]=Wr[fu]||function(Hs){return function(Wu){(function Ic(Os,Ns){var _c=Ar;for(let _f in Ns){let wd=Os[_f];_c(647)==typeof wd?wd(Ns[_f]):Ic(Os[_f],Ns[_f])}})(Hs,Wu)}}($o),fu+=Zo}}}}}return dt},So=function(Xi,...ke){var Ie=o,He=Xi.uniformSetters||Xi,dt=ke[Ie(293)];for(let _r=0;_r<dt;++_r){var Vt=ke[_r];if(Array[Ie(1241)](Vt)){var ni=Vt[Ie(293)];for(let Ir=0;Ir<ni;++Ir)So(He,Vt[Ir])}else for(let Ir in Vt){let Pn=He[Ir];Pn&&Pn(Vt[Ir])}}},Kh=function(Xi,ke){var Ie=o;let He={program:ke,uniformSetters:Pc(Xi,ke),attribSetters:function(dt,Vt){var ni=Ar;let _r={};var Ir=dt.getProgramParameter(Vt,Sa);for(let Wr=0;Wr<Ir;++Wr){var Pn=dt[ni(1445)](Vt,Wr);if(!Ys(Pn)){var An=dt[ni(975)](Vt,Pn[ni(1193)]);let Ho=Yr[Pn.type],ma=Ho[ni(949)](dt,An,Ho);ma.location=An,_r[Pn[ni(1193)]]=ma}}return _r}(Xi,ke)};return or(Xi)&&(He[Ie(1511)]=function(dt,Vt){var ni=Ie,_r=dt[ni(797)](Vt,Cn);let Ir=[],Pn=[];for(let $o=0;$o<_r;++$o){Pn[ni(622)]($o),Ir.push({});var An=dt[ni(1212)](Vt,$o);Ir[$o][ni(1193)]=An[ni(1193)]}[[ni(755),"type"],[ni(1254),ni(800)],[ni(889),ni(655)],[ni(429),ni(573)]][ni(538)](function($o){var du=ni,rs=$o[0];let Wa=$o[1];dt[du(1082)](Vt,Pn,dt[rs])[du(538)](function(fu,Hs){Ir[Hs][Wa]=fu})});let Wr={};var Ho=dt.getProgramParameter(Vt,za);for(let $o=0;$o<Ho;++$o){var ma=dt[ni(1360)](Vt,$o);let du={index:dt[ni(992)](Vt,ma),usedByVertexShader:dt[ni(428)](Vt,$o,zr),usedByFragmentShader:dt[ni(428)](Vt,$o,Ci),size:dt[ni(428)](Vt,$o,Ni),uniformIndices:dt[ni(428)](Vt,$o,cr)};du[ni(1402)]=du[ni(494)]||du[ni(732)],Wr[ma]=du}var Zo={};return Zo[ni(1376)]=Wr,Zo.uniformData=Ir,Zo}(Xi,ke),He[Ie(1302)]=function(dt,Vt){var ni=Ie;let _r={};var Ir=dt[ni(797)](Vt,Va);for(let An=0;An<Ir;++An){var Pn=dt[ni(933)](Vt,An);_r[Pn[ni(1193)]]={index:An,type:Pn[ni(1490)],size:Pn[ni(800)]}}return _r}(Xi,ke)),He},Gl=function(Xi,ke,Ie,He,dt){var Vt=o;let ni=Qn(Ie,He,dt),_r=[];if(ke=ke[Vt(272)](function(Wr){var Ho=Vt,ma;return mf[Ho(1347)](Wr)||((ma=Ii(Wr))?Wr=ma.text:(ma="no element with id: "+Wr,ni[Ho(1204)](ma),_r.push(ma))),Wr}),_r[Vt(293)])return Ir=ni,Pn="",Ir[Vt(1204)](Pn),Ir.callback&&setTimeout(()=>{Ir.callback(Pn+` `+Ir.errors.join(` `))}),null;var Ir,Pn;let An=ni.callback;return An&&(ni[Vt(918)]=(Wr,Ho)=>{An(Wr,Wr?void 0:Kh(Xi,Ho))}),Ie=fl(Xi,ke,ni),Ie?Kh(Xi,Ie):null};var x={};x[o(1306)]=()=>gf,x[o(771)]=()=>Cu,x[o(754)]=()=>na,v.r(y),v.d(y,x);let $t=Float32Array,ct=Float32Array,Yt=5120,Fi=5121,Dt=5122,Lt=5123,Si=5124,nt=5125,wt=5126,yt={};{let Xi=yt;Xi[Yt]=Int8Array,Xi[Fi]=Uint8Array,Xi[Dt]=Int16Array,Xi[Lt]=Uint16Array,Xi[Si]=Int32Array,Xi[nt]=Uint32Array,Xi[wt]=Float32Array,Xi[32819]=Uint16Array,Xi[32820]=Uint16Array,Xi[33635]=Uint16Array,Xi[5131]=Uint16Array,Xi[33640]=Uint32Array,Xi[35899]=Uint32Array,Xi[35902]=Uint32Array,Xi[36269]=Uint32Array,Xi[34042]=Uint32Array}let Tt=o(669)!=typeof SharedArrayBuffer?function(Xi){var ke=o;return Xi&&Xi[ke(990)]&&(Xi[ke(990)]instanceof ArrayBuffer||Xi[ke(990)]instanceof SharedArrayBuffer)}:function(Xi){var ke=o;return Xi&&Xi.buffer&&Xi[ke(990)]instanceof ArrayBuffer};var C=v(5108);let Et=new Map,xr=function(){let Xi={},ke={};return function(_r,He){var dt=Ar,Vt,ni=_r,_r=ni[dt(376)][dt(1193)];if(!Xi[_r]){for(let Ir in ni)typeof ni[Ir]=="number"&&(Vt=ke[ni[Ir]],ke[ni[Ir]]=Vt?Vt+dt(269)+Ir:Ir);Xi[_r]=!0}return ke[He]||(dt(668)==typeof He?"0x"+He.toString(16):He)}}();new Uint8Array([128,192,255,255]);{let Xi={};var w={};w.numColorComponents=1;var A={};A[o(1005)]=1;var E={};E[o(1005)]=2;var T={};T[o(1005)]=3;var S={};S[o(1005)]=4;var M={};M[o(1005)]=1;var I={};I[o(1005)]=1;var P={};P[o(1005)]=2;var D={};D[o(1005)]=2;var L={};L[o(1005)]=3;var R={};R[o(1005)]=3;var O={};O[o(1005)]=4;var F={};F[o(1005)]=4;var k={};k[o(1005)]=1;var U={};U[o(1005)]=2,Xi[6406]=w,Xi[6409]=A,Xi[6410]=E,Xi[6407]=T,Xi[6408]=S,Xi[6403]=M,Xi[36244]=I,Xi[33319]=P,Xi[33320]=D,Xi[6407]=L,Xi[36248]=R,Xi[6408]=O,Xi[36249]=F,Xi[6402]=k,Xi[34041]=U}let Tn=function(...Xi){C.error(...Xi)},pr=33984,yn=34962,dn=35713,fn=35714,Or=35632,On=35633,eo=35981,Cn=35718,Sa=35721,Va=35971,za=35382,zr=35396,Ci=35398,Ni=35392,cr=35395;var zi=34067,pt=35866;let Bi={};var G={};G[o(485)]=Int32Array,G.size=4,G[o(949)]=Mi,G.arraySetter=$i;var j={};j[o(485)]=Int32Array,j[o(800)]=8,j[o(949)]=ur,j[o(412)]=2;var q={};q[o(485)]=Int32Array,q[o(800)]=12,q[o(949)]=Nr,q.cols=3;var J={};J[o(485)]=Int32Array,J[o(800)]=16,J.setter=qe,J.cols=4;var X={};X.Type=null,X[o(800)]=0,X[o(949)]=tt,X[o(1349)]=$e,X[o(450)]=3553;var Y={};Y[o(485)]=null,Y.size=0,Y[o(949)]=tt,Y[o(1349)]=$e,Y[o(450)]=zi;var Q={};Q[o(485)]=null,Q[o(800)]=0,Q.setter=tt,Q.arraySetter=$e,Q[o(450)]=32879;var ee={};ee[o(485)]=null,ee[o(800)]=0,ee[o(949)]=tt,ee[o(1349)]=$e,ee[o(450)]=3553;var z={};z.Type=null,z[o(800)]=0,z.setter=tt,z[o(1349)]=$e,z[o(450)]=pt;var ie={};ie.Type=null,ie[o(800)]=0,ie[o(949)]=tt,ie[o(1349)]=$e,ie[o(450)]=pt;var re={};re.Type=null,re[o(800)]=0,re.setter=tt,re.arraySetter=$e,re[o(450)]=zi;var ne={};ne.Type=null,ne[o(800)]=0,ne[o(949)]=tt,ne[o(1349)]=$e,ne[o(450)]=3553;var oe={};oe[o(485)]=null,oe.size=0,oe[o(949)]=tt,oe.arraySetter=$e,oe.bindPoint=32879;var se={};se.Type=null,se[o(800)]=0,se[o(949)]=tt,se[o(1349)]=$e,se[o(450)]=zi;var ae={};ae[o(485)]=null,ae[o(800)]=0,ae[o(949)]=tt,ae[o(1349)]=$e,ae[o(450)]=pt;var fe={};fe[o(485)]=null,fe.size=0,fe.setter=tt,fe.arraySetter=$e,fe[o(450)]=3553;var de={};de[o(485)]=null,de[o(800)]=0,de[o(949)]=tt,de[o(1349)]=$e,de[o(450)]=32879;var ve={};ve[o(485)]=null,ve[o(800)]=0,ve[o(949)]=tt,ve[o(1349)]=$e,ve.bindPoint=zi;var pe={};pe[o(485)]=null,pe[o(800)]=0,pe[o(949)]=tt,pe[o(1349)]=$e,pe[o(450)]=pt,Bi[5126]={Type:Float32Array,size:4,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(1429)](ke,Ie)}},arraySetter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(1432)](ke,Ie)}}},Bi[35664]={Type:Float32Array,size:8,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(1331)](ke,Ie)}},cols:2},Bi[35665]={Type:Float32Array,size:12,setter:function(Xi,ke){return function(Ie){Xi.uniform3fv(ke,Ie)}},cols:3},Bi[35666]={Type:Float32Array,size:16,setter:function(Xi,ke){return function(Ie){Xi.uniform4fv(ke,Ie)}},cols:4},Bi[5124]=G,Bi[35667]=j,Bi[35668]=q,Bi[35669]=J,Bi[5125]={Type:Uint32Array,size:4,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(726)](ke,Ie)}},arraySetter:function(Xi,ke){return function(Ie){Xi.uniform1uiv(ke,Ie)}}},Bi[36294]={Type:Uint32Array,size:8,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(332)](ke,Ie)}},cols:2},Bi[36295]={Type:Uint32Array,size:12,setter:function(Xi,ke){return function(Ie){Xi.uniform3uiv(ke,Ie)}},cols:3},Bi[36296]={Type:Uint32Array,size:16,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(275)](ke,Ie)}},cols:4},Bi[35670]={Type:Uint32Array,size:4,setter:Mi,arraySetter:$i},Bi[35671]={Type:Uint32Array,size:8,setter:ur,cols:2},Bi[35672]={Type:Uint32Array,size:12,setter:Nr,cols:3},Bi[35673]={Type:Uint32Array,size:16,setter:qe,cols:4},Bi[35674]={Type:Float32Array,size:32,setter:function(Xi,ke){return function(Ie){Xi.uniformMatrix2fv(ke,!1,Ie)}},rows:2,cols:2},Bi[35675]={Type:Float32Array,size:48,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(594)](ke,!1,Ie)}},rows:3,cols:3},Bi[35676]={Type:Float32Array,size:64,setter:function(Xi,ke){return function(Ie){Xi.uniformMatrix4fv(ke,!1,Ie)}},rows:4,cols:4},Bi[35685]={Type:Float32Array,size:32,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(720)](ke,!1,Ie)}},rows:2,cols:3},Bi[35686]={Type:Float32Array,size:32,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(640)](ke,!1,Ie)}},rows:2,cols:4},Bi[35687]={Type:Float32Array,size:48,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(1049)](ke,!1,Ie)}},rows:3,cols:2},Bi[35688]={Type:Float32Array,size:48,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(1018)](ke,!1,Ie)}},rows:3,cols:4},Bi[35689]={Type:Float32Array,size:64,setter:function(Xi,ke){return function(Ie){Xi.uniformMatrix4x2fv(ke,!1,Ie)}},rows:4,cols:2},Bi[35690]={Type:Float32Array,size:64,setter:function(Xi,ke){return function(Ie){var He=Ar;Xi[He(304)](ke,!1,Ie)}},rows:4,cols:3},Bi[35678]=X,Bi[35680]=Y,Bi[35679]=Q,Bi[35682]=ee,Bi[36289]=z,Bi[36292]=ie,Bi[36293]=re,Bi[36298]=ne,Bi[36299]=oe,Bi[36300]=se,Bi[36303]=ae,Bi[36306]=fe,Bi[36307]=de,Bi[36308]=ve,Bi[36311]=pe;var ce={};ce[o(800)]=4,ce[o(949)]=St;var he={};he[o(800)]=8,he[o(949)]=St;var Ce={};Ce.size=12,Ce.setter=St;var Se={};Se.size=16,Se.setter=St;var De={};De[o(800)]=4,De.setter=Zt;var Oe={};Oe[o(800)]=8,Oe.setter=Zt;var Ue={};Ue.size=12,Ue[o(949)]=Zt;var Xe={};Xe[o(800)]=16,Xe[o(949)]=Zt;var it={};it[o(800)]=4,it[o(949)]=ui;var ut={};ut[o(800)]=8,ut[o(949)]=ui;var at={};at[o(800)]=12,at.setter=ui;var Pt={};Pt[o(800)]=16,Pt.setter=ui;var Qe={};Qe.size=4,Qe[o(949)]=Zt;var ft={};ft[o(800)]=8,ft.setter=Zt;var Ot={};Ot.size=12,Ot.setter=Zt;var Xt={};Xt[o(800)]=16,Xt[o(949)]=Zt;var At={};At.size=4,At[o(949)]=hr,At[o(582)]=2;var bt={};bt[o(800)]=9,bt[o(949)]=hr,bt[o(582)]=3;var gt={};gt[o(800)]=16,gt[o(949)]=hr,gt[o(582)]=4;let Yr={},ln=(Yr[5126]=ce,Yr[35664]=he,Yr[35665]=Ce,Yr[35666]=Se,Yr[5124]=De,Yr[35667]=Oe,Yr[35668]=Ue,Yr[35669]=Xe,Yr[5125]=it,Yr[36294]=ut,Yr[36295]=at,Yr[36296]=Pt,Yr[35670]=Qe,Yr[35671]=ft,Yr[35672]=Ot,Yr[35673]=Xt,Yr[35674]=At,Yr[35675]=bt,Yr[35676]=gt,/ERROR:\s*\d+:(\d+)/gi),Kn=/^[ \t]*\n/,Pa=[o(734),o(718)],Gn=(Xi=0)=>new Promise(ke=>setTimeout(ke,Xi));async function Ul(Xi,ke){var Ie=o;let He=Xi[Ie(1e3)](Ie(451)),dt=He?(ni,_r)=>ni[Ie(797)](_r,He[Ie(1379)]):()=>!0,Vt=0;for(;await Gn(Vt),Vt=1e3/60,!dt(Xi,ke););}let Wd=/(\.|\[|]|\w+)/g,mf=/\s|{|}|;/;zi=36096;var It={};It[34041]=33306,It[o(997)]=36128,It[o(1136)]=36128;let Wl=It;Wl[6402]=zi,Wl[33189]=zi,Wl[33190]=zi,Wl[36012]=zi,Wl[35056]=33306,Wl[36013]=33306;var pt=v(9117),Jt=v.n(pt),zi=v(5960),bi=v.n(zi);class Th{constructor(ke){var Ie=o;this[Ie(1020)]=ke,this.width=this.fine[Ie(558)][5],this.height=this[Ie(1020)].sharedMemoryDataView[6];let He=this[Ie(1020)].gl;var dt={};dt.x=0,dt.y=0,dt.width=0,dt[Ie(699)]=0;var Vt={};Vt[Ie(1346)]=!0,Vt[Ie(415)]=He.BACK;var ni={};ni[Ie(1346)]=!0,ni.func=He[Ie(386)];var _r={};_r[Ie(1346)]=!1;var Ir={};Ir[Ie(1362)]=dt,Ir.cull=Vt,Ir[Ie(817)]=ni,Ir[Ie(967)]=_r,this[Ie(887)]=Ir,He.bindFramebuffer(He[Ie(1448)],null),this[Ie(1417)]=Gl(He,[bi(),Jt()]),this[Ie(1417)].uniformValue={},this.colorAttachment0=this[Ie(1433)](this.width,this[Ie(699)]),this[Ie(1074)]=He[Ie(999)](),He[Ie(257)](He[Ie(1448)],this[Ie(1074)]),this[Ie(379)]=He[Ie(505)](),He.bindRenderbuffer(He[Ie(1151)],this[Ie(379)]),He[Ie(921)](He[Ie(1151)],He[Ie(316)],this[Ie(1530)],this.height),He[Ie(701)](He[Ie(1448)],He[Ie(673)],He[Ie(1151)],this[Ie(379)]),He[Ie(917)](He[Ie(1151)],null),He[Ie(1244)](He[Ie(1448)],He.COLOR_ATTACHMENT0,He[Ie(1310)],this[Ie(1115)],0),He[Ie(1190)]([He[Ie(893)]]),He[Ie(600)](He[Ie(1310)],null),He[Ie(257)](He[Ie(1448)],null)}[o(1433)](ke,Ie){var He=o;let dt=this[He(1020)].gl;dt[He(1397)](dt.TEXTURE15);var Vt=dt[He(321)]();return dt[He(600)](dt[He(1310)],Vt),dt.texImage2D(dt[He(1310)],0,dt[He(417)],ke,Ie,0,dt.RG,dt[He(1058)],null),dt[He(839)](dt[He(1310)],dt.TEXTURE_MAG_FILTER,dt[He(1290)]),dt[He(839)](dt[He(1310)],dt[He(1219)],dt[He(1290)]),dt[He(839)](dt[He(1310)],dt[He(1399)],dt[He(1364)]),dt[He(839)](dt[He(1310)],dt.TEXTURE_WRAP_T,dt[He(1364)]),Vt}[o(972)](ke,Ie){var He=o;let dt=this[He(1020)].gl;this.width=ke,this[He(699)]=Ie,dt.bindRenderbuffer(dt[He(1151)],this[He(379)]),dt[He(921)](dt[He(1151)],dt.DEPTH_COMPONENT32F,this.width,this.height),dt[He(917)](dt.RENDERBUFFER,null),dt[He(1397)](dt.TEXTURE15),dt[He(600)](dt[He(1310)],this[He(1115)]),dt[He(1338)](dt[He(1310)],0,dt[He(417)],ke,Ie,0,dt.RG,dt.FLOAT,null),dt[He(600)](dt.TEXTURE_2D,null)}}var pt=v(769),Yi=v.n(pt),zi=v(6792),ii=v.n(zi);class rr{constructor(ke){var Ie=o;this[Ie(1020)]=ke,this.width=this[Ie(1020)][Ie(558)][5],this.height=this[Ie(1020)][Ie(558)][6];let He=this[Ie(1020)].gl;var dt={};dt.x=0,dt.y=0,dt[Ie(1530)]=0,dt.height=0;var Vt={};Vt[Ie(1346)]=!0,Vt[Ie(415)]=He[Ie(259)];var ni={};ni.enabled=!0,ni[Ie(1283)]=He[Ie(386)];var _r={};_r[Ie(1346)]=!1;var Ir={};Ir[Ie(1362)]=dt,Ir[Ie(1138)]=Vt,Ir[Ie(817)]=ni,Ir[Ie(967)]=_r,this[Ie(887)]=Ir,He[Ie(257)](He[Ie(1448)],null),this[Ie(1417)]=Gl(He,[ii(),Yi()]),this[Ie(1417)][Ie(583)]={},this[Ie(1115)]=this[Ie(1433)](this.width,this[Ie(699)]),this.framebuffer=He[Ie(999)](),He[Ie(257)](He[Ie(1448)],this[Ie(1074)]),this[Ie(379)]=He[Ie(505)](),He[Ie(917)](He[Ie(1151)],this[Ie(379)]),He[Ie(921)](He.RENDERBUFFER,He.DEPTH_COMPONENT32F,this[Ie(1530)],this[Ie(699)]),He.framebufferRenderbuffer(He[Ie(1448)],He[Ie(673)],He[Ie(1151)],this[Ie(379)]),He[Ie(917)](He[Ie(1151)],null),He[Ie(1244)](He[Ie(1448)],He[Ie(893)],He[Ie(1310)],this[Ie(1115)],0),He[Ie(1190)]([He[Ie(893)]]),He[Ie(600)](He.TEXTURE_2D,null),He[Ie(257)](He.FRAMEBUFFER,null)}[o(1433)](ke,Ie){var He=o;let dt=this[He(1020)].gl;dt.activeTexture(dt.TEXTURE15);var Vt=dt[He(321)]();return dt[He(600)](dt[He(1310)],Vt),dt[He(1338)](dt[He(1310)],0,dt[He(770)],ke,Ie,0,dt.RGBA,dt[He(1058)],null),dt.texParameteri(dt.TEXTURE_2D,dt.TEXTURE_MAG_FILTER,dt[He(1290)]),dt[He(839)](dt.TEXTURE_2D,dt.TEXTURE_MIN_FILTER,dt[He(1290)]),dt[He(839)](dt[He(1310)],dt[He(1399)],dt[He(1364)]),dt[He(839)](dt.TEXTURE_2D,dt[He(1281)],dt.CLAMP_TO_EDGE),Vt}[o(972)](ke,Ie){var He=o;let dt=this[He(1020)].gl;this[He(1530)]=ke,this[He(699)]=Ie,dt[He(917)](dt.RENDERBUFFER,this.depthAttachment),dt.renderbufferStorage(dt.RENDERBUFFER,dt[He(316)],this[He(1530)],this[He(699)]),dt[He(917)](dt[He(1151)],null),dt[He(1397)](dt.TEXTURE15),dt[He(600)](dt[He(1310)],this[He(1115)]),dt[He(1338)](dt[He(1310)],0,dt.RGBA32F,ke,Ie,0,dt[He(1135)],dt[He(1058)],null),dt[He(600)](dt[He(1310)],null)}}var pt=v(7511),ei=v.n(pt),zi=v(108),Li=v.n(zi),pt=v(2225),Je=v.n(pt);class mo{constructor(ke){var Ie=o;this[Ie(1020)]=ke,this[Ie(584)]=1,this[Ie(981)]=[.3,.8,.3,.5],this.outlineColor=[1,1,1,.8],this[Ie(1530)]=this.fine[Ie(558)][5],this[Ie(699)]=this[Ie(1020)][Ie(558)][6];let He=this[Ie(1020)].gl;var dt={};dt.x=0,dt.y=0,dt[Ie(1530)]=0,dt.height=0;var Vt={};Vt[Ie(1346)]=!0,Vt[Ie(415)]=He[Ie(259)];var ni={};ni[Ie(1346)]=!0,ni.func=He.LESS;var _r={};_r[Ie(1346)]=!1;var Ir={};Ir.viewport=dt,Ir[Ie(1138)]=Vt,Ir.depthTest=ni,Ir[Ie(967)]=_r,this[Ie(887)]=Ir,He[Ie(257)](He[Ie(1448)],null),this.programInfo=Gl(He,[Li(),ei()]),this.programInfo[Ie(583)]={},this.colorAttachment0=this[Ie(1433)](this[Ie(1530)],this[Ie(699)]),this[Ie(1074)]=He[Ie(999)](),He[Ie(257)](He[Ie(1448)],this[Ie(1074)]),this[Ie(379)]=He.createRenderbuffer(),He[Ie(917)](He.RENDERBUFFER,this[Ie(379)]),He[Ie(921)](He[Ie(1151)],He[Ie(316)],this[Ie(1530)],this[Ie(699)]),He[Ie(701)](He.FRAMEBUFFER,He[Ie(673)],He[Ie(1151)],this[Ie(379)]),He.bindRenderbuffer(He.RENDERBUFFER,null),He[Ie(1244)](He[Ie(1448)],He[Ie(893)],He[Ie(1310)],this[Ie(1115)],0),He[Ie(1190)]([He[Ie(893)]]),He[Ie(600)](He.TEXTURE_2D,null),He.bindFramebuffer(He[Ie(1448)],null),this[Ie(1271)]=new this[Ie(1020)][Ie(915)][Ie(352)]({name:Ie(624),fragmentShader:Je(),uniforms:{selectTexture:{_target:He.TEXTURE_2D,_texture:this[Ie(1115)]},outlineWidth:()=>this[Ie(584)],outlineColor:()=>({x:this[Ie(478)][0],y:this[Ie(478)][1],z:this.outlineColor[2],w:this[Ie(478)][3]}),overlayColor:()=>({x:this[Ie(981)][0],y:this.overlayColor[1],z:this[Ie(981)][2],w:this[Ie(981)][3]})}})}[o(496)](){var ke=o;this[ke(1417)][ke(583)][ke(981)]!==this.overlayColor.toString()&&(this[ke(1417)][ke(583)][ke(981)]=this[ke(981)][ke(627)](),So(this[ke(1417)],{overlayColor:this[ke(981)]}))}[o(1433)](ke,Ie){var He=o;let dt=this[He(1020)].gl;dt[He(1397)](dt[He(934)]);var Vt=dt[He(321)]();return dt[He(600)](dt[He(1310)],Vt),dt.texImage2D(dt[He(1310)],0,dt[He(1135)],ke,Ie,0,dt[He(1135)],dt[He(961)],null),dt.texParameteri(dt.TEXTURE_2D,dt[He(1214)],dt[He(1290)]),dt[He(839)](dt[He(1310)],dt.TEXTURE_MIN_FILTER,dt[He(1290)]),dt.texParameteri(dt[He(1310)],dt.TEXTURE_WRAP_S,dt.CLAMP_TO_EDGE),dt.texParameteri(dt[He(1310)],dt.TEXTURE_WRAP_T,dt[He(1364)]),Vt}[o(972)](ke,Ie){var He=o;let dt=this[He(1020)].gl;this[He(1530)]=ke,this.height=Ie,dt[He(917)](dt.RENDERBUFFER,this.depthAttachment),dt[He(921)](dt[He(1151)],dt[He(316)],this[He(1530)],this[He(699)]),dt.bindRenderbuffer(dt.RENDERBUFFER,null),dt[He(1397)](dt.TEXTURE15),dt.bindTexture(dt.TEXTURE_2D,this.colorAttachment0),dt.texImage2D(dt[He(1310)],0,dt[He(1135)],ke,Ie,0,dt[He(1135)],dt.UNSIGNED_BYTE,null),dt.bindTexture(dt[He(1310)],null)}}var zi=v(4005),Nt=v.n(zi),pt=v(9594),yi=v.n(pt);class Wn{constructor(ke){var Ie=o;this[Ie(1020)]=ke;let He=this.fine.gl;var dt={};dt.x=0,dt.y=0,dt.width=0,dt[Ie(699)]=0;var Vt={};Vt.enabled=!0,Vt[Ie(415)]=He[Ie(259)];var ni={};ni.enabled=!0,ni[Ie(1283)]=He[Ie(386)];var _r={};_r.red=0,_r[Ie(338)]=0,_r[Ie(1177)]=0,_r[Ie(1273)]=0;var Ir={};Ir.enabled=!0,Ir[Ie(854)]=_r,Ir.equationRgb=He.FUNC_ADD,Ir[Ie(569)]=He[Ie(1337)],Ir.functionSourceRgb=He.SRC_ALPHA,Ir.functionSourceAlpha=He[Ie(1229)],Ir[Ie(1561)]=He[Ie(1051)],Ir[Ie(822)]=He[Ie(1051)];var Pn={};Pn[Ie(1362)]=dt,Pn[Ie(1138)]=Vt,Pn[Ie(817)]=ni,Pn[Ie(967)]=Ir,this.renderState=Pn,this[Ie(1319)]=He[Ie(1e3)]("EXT_texture_compression_bptc"),this[Ie(1171)]=He[Ie(597)](He[Ie(262)]),this.emptyTexture=He[Ie(321)](),this[Ie(359)]=He[Ie(321)](),this.programInfo=Gl(He,[yi(),Nt()]),this[Ie(1417)][Ie(583)]={camera_view_matrix:Ht()},He[Ie(600)](He[Ie(1310)],null)}[o(1400)](){var ke=o;let Ie=this[ke(1020)].gl;Ie[ke(1397)](Ie.TEXTURE15);var He=Ie.createTexture(),He=(Ie[ke(600)](Ie[ke(1310)],He),{texture:He,dataLength:length,width:this[ke(1171)],height:this[ke(1171)],internalformat:this[ke(1319)].COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT});return Ie[ke(1304)](Ie[ke(1310)],0,He[ke(1174)],this.maxTextureSize,this[ke(1171)],0,new Uint8Array(this[ke(1171)]*this[ke(1171)])),Ie[ke(839)](Ie[ke(1310)],Ie.TEXTURE_MIN_FILTER,Ie[ke(1290)]),Ie[ke(839)](Ie[ke(1310)],Ie[ke(1214)],Ie[ke(1290)]),Ie[ke(839)](Ie[ke(1310)],Ie[ke(1399)],Ie[ke(1364)]),Ie[ke(839)](Ie[ke(1310)],Ie[ke(1281)],Ie[ke(1364)]),Ie[ke(600)](Ie[ke(1310)],null),He}resize(ke,Ie){}[o(496)](ke){var Ie=o,He={};if(He[Ie(914)]=!1,this[Ie(276)]&&So(this[Ie(1417)],{diffuseSampler:this.fineAlbedoTexture}),this[Ie(296)]&&So(this[Ie(1417)],{bumpSampler:this[Ie(296)]}),ke&&ke[Ie(775)]){this[Ie(1417)].uniformValue[Ie(914)]!==ke[Ie(775)]&&(this[Ie(1417)].uniformValue.shadowMapEnable=ke[Ie(775)],So(this[Ie(1417)],{shadowMapEnable:!!ke[Ie(775)]}));let Vt=[ke[Ie(592)]?1:ke[Ie(1152)]?2:3,ke[Ie(834)]?1:0],ni=(this[Ie(1417)][Ie(583)].shadowMap_lightType!==Vt[Ie(627)]()&&(this[Ie(1417)].uniformValue[Ie(1017)]=Vt[Ie(627)](),So(this[Ie(1417)],{shadowMap_lightType:Vt})),this[Ie(1417)].uniformSetters[Ie(1343)]&&(So(this[Ie(1417)],{shadowMap_texture:Vt[0]===1?this.emptyTexture:ke[Ie(672)][Ie(828)]}),So(this.programInfo,{shadowMap_textureCube:Vt[0]===1&&ke._shadowMapTexture?ke[Ie(672)][Ie(828)]:this.emptyTextureCube})),[ke._lightDirectionEC.x,ke[Ie(1139)].y,ke._lightDirectionEC.z]),_r=(this.programInfo[Ie(583)][Ie(471)]!==ni[Ie(627)]()&&(this[Ie(1417)][Ie(583)][Ie(471)]=ni.toString(),So(this.programInfo,{shadowMap_lightDirectionEC:ni})),[(ke[Ie(592)]?ke[Ie(1067)]:ke[Ie(280)])[Ie(439)],ke[Ie(542)],ke[Ie(1287)],ke[Ie(375)]]),Ir=(this[Ie(1417)][Ie(583)][Ie(1061)]!==_r[Ie(627)]()&&(this.programInfo[Ie(583)][Ie(1061)]=_r[Ie(627)](),So(this[Ie(1417)],{shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:_r})),[1/ke._textureSize.x,1/ke[Ie(1266)].y,(ke[Ie(592)],ke[Ie(1067)].depthBias),(ke._isPointLight?ke[Ie(1067)]:ke[Ie(280)])[Ie(548)]]);this[Ie(1417)].uniformValue[Ie(473)]!==Ir.toString()&&(this[Ie(1417)][Ie(583)][Ie(473)]=Ir[Ie(627)](),So(this[Ie(1417)],{shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:Ir})),this[Ie(1417)].uniformValue.shadowMap_cascadeMatrices!==ke[Ie(469)][Ie(627)]()&&(this[Ie(1417)][Ie(583)][Ie(309)]=ke[Ie(469)][Ie(627)](),So(this[Ie(1417)],{shadowMap_cascadeMatrices:[...Array[Ie(301)](ke[Ie(469)][0]),...Array[Ie(301)](ke[Ie(469)][1]),...Array.from(ke[Ie(469)][2]),...Array[Ie(301)](ke[Ie(469)][3])]})),this[Ie(1417)].uniformValue[Ie(1542)]!==ke._cascadeSplits[Ie(627)]()&&(this[Ie(1417)][Ie(583)][Ie(1542)]=ke[Ie(614)][Ie(627)](),So(this[Ie(1417)],{shadowMap_cascadeSplits:[ke[Ie(614)][0].x,ke[Ie(614)][0].y,ke[Ie(614)][0].z,ke[Ie(614)][0].w,ke._cascadeSplits[1].x,ke[Ie(614)][1].y,ke._cascadeSplits[1].z,ke[Ie(614)][1].w]})),this.programInfo[Ie(583)][Ie(1479)]!==ke._shadowMapCamera.positionWC[Ie(627)]()&&(this.programInfo.uniformValue[Ie(1479)]=ke[Ie(708)].positionWC[Ie(627)](),So(this[Ie(1417)],{shadowMap_lightPositionWC:[ke[Ie(708)].positionWC.x,ke[Ie(708)][Ie(395)].y,ke[Ie(708)].positionWC.z]})),this.programInfo.uniformValue[Ie(742)]!==ke[Ie(1003)][Ie(627)]()&&(this[Ie(1417)][Ie(583)].shadowMap_lightPositionEC=ke[Ie(1003)][Ie(627)](),So(this[Ie(1417)],{shadowMap_lightPositionEC:[ke._lightPositionEC.x,ke._lightPositionEC.y,ke[Ie(1003)].z,ke[Ie(1003)].w]})),this[Ie(1417)][Ie(583)][Ie(860)]!==ke[Ie(1425)][Ie(627)]()&&(this[Ie(1417)][Ie(583)].shadowMap_matrix=ke[Ie(1425)][Ie(627)](),So(this[Ie(1417)],{shadowMap_matrix:Array[Ie(301)](ke[Ie(1425)])})),this.programInfo[Ie(583)][Ie(1117)]!==this[Ie(1020)][Ie(1374)].worldMatrix.toString()&&(this[Ie(1417)][Ie(583)][Ie(1117)]=this[Ie(1020)].camera[Ie(1117)].toString(),So(this[Ie(1417)],{worldMatrix:this[Ie(1020)][Ie(1374)][Ie(1117)]}));var dt=ke[Ie(289)][Ie(1482)][Ie(799)][Ie(627)]()+ke[Ie(289)][Ie(1132)].toString();if(this[Ie(1417)][Ie(583)][Ie(1340)]!==dt){this[Ie(1417)].uniformValue[Ie(1340)]=dt;let Pn=Array[Ie(301)](ke._lightCamera[Ie(1132)]);Pn[12]-=this.fine[Ie(1163)][0],Pn[13]-=this[Ie(1020)][Ie(1163)][1],Pn[14]-=this.fine[Ie(1163)][2],dt=si(Pn,this.programInfo.uniformValue[Ie(1238)]),So(this.programInfo,{viewShed:ke[Ie(396)],viewShed_visibleColor:[ke[Ie(396)]?ke.visibleColor[Ie(393)]:1,ke.viewShed?ke.visibleColor[Ie(338)]:1,ke[Ie(396)]?ke[Ie(1201)][Ie(1177)]:1,ke[Ie(396)]?ke.visibleColor[Ie(1273)]:1],viewShed_invisibleColor:[ke[Ie(396)]?ke[Ie(335)].red:1,ke[Ie(396)]?ke[Ie(335)][Ie(338)]:1,ke[Ie(396)]?ke[Ie(335)].blue:1,ke[Ie(396)]?ke.invisibleColor.alpha:1],camera_projection_matrix:Array.from(ke._lightCamera[Ie(1482)][Ie(799)]),camera_view_matrix:Array.from(dt)})}}else this[Ie(1417)].uniformValue.shadowMapEnable&&(this[Ie(1417)][Ie(583)].shadowMapEnable=!1,So(this[Ie(1417)],He)),this.programInfo[Ie(648)][Ie(1343)]&&So(this.programInfo,{shadowMap_texture:this[Ie(384)],shadowMap_textureCube:this[Ie(359)]})}}var zi=v(3272),ai=v.n(zi),pt=v(5773),wi=v.n(pt);class yo{constructor(ke,Ie,He,dt){var Vt=o;this.fine=ke;let ni=this.fine.gl;var _r={};_r.x=0,_r.y=0,_r[Vt(1530)]=0,_r[Vt(699)]=0;var Ir={};Ir[Vt(1346)]=!0,Ir[Vt(415)]=ni.BACK;var Pn={};Pn[Vt(1346)]=!0,Pn[Vt(1283)]=ni[Vt(386)];var An={};An.enabled=!1;var Wr={};Wr[Vt(1362)]=_r,Wr[Vt(1138)]=Ir,Wr[Vt(817)]=Pn,Wr[Vt(967)]=An,this[Vt(887)]=Wr,this[Vt(1530)]=Ie,this.height=He,this[Vt(1171)]=ni.getParameter(ni[Vt(262)]),this[Vt(1417)]=Gl(ni,[wi(),ai()]),this[Vt(1417)][Vt(583)]={},this[Vt(1384)]={texture:null,width:this[Vt(1171)],height:Math[Vt(613)](dt/4/this[Vt(1171)]),format:ni[Vt(1105)],type:ni[Vt(339)]},ni.activeTexture(ni[Vt(934)]),this.renderInstancesTexture.texture=ni.createTexture(),ni[Vt(600)](ni.TEXTURE_2D,this[Vt(1384)].texture),ni[Vt(1338)](ni[Vt(1310)],0,ni[Vt(1044)],this.renderInstancesTexture.width,this[Vt(1384)][Vt(699)],0,ni[Vt(1105)],ni.UNSIGNED_INT,null),ni[Vt(839)](ni[Vt(1310)],ni[Vt(1219)],ni[Vt(1290)]),ni[Vt(839)](ni[Vt(1310)],ni[Vt(1214)],ni[Vt(1290)]),ni.texParameteri(ni.TEXTURE_2D,ni[Vt(1399)],ni[Vt(1364)]),ni.texParameteri(ni[Vt(1310)],ni[Vt(1281)],ni[Vt(1364)]),this[Vt(1115)]=this.CreateColorTexture(this[Vt(1530)],this[Vt(699)]),this[Vt(1074)]=ni.createFramebuffer(),ni[Vt(257)](ni[Vt(1448)],this[Vt(1074)]),ni[Vt(1244)](ni[Vt(1448)],ni.COLOR_ATTACHMENT0,ni[Vt(1310)],this[Vt(1115)],0),ni[Vt(1190)]([ni.COLOR_ATTACHMENT0]),ni[Vt(917)](ni[Vt(1151)],null),ni.bindTexture(ni[Vt(1310)],null),ni.bindFramebuffer(ni.FRAMEBUFFER,null)}[o(1433)](ke,Ie){var He=o;let dt=this.fine.gl;dt[He(1397)](dt[He(934)]);var Vt=dt.createTexture();return dt[He(600)](dt[He(1310)],Vt),dt[He(1338)](dt.TEXTURE_2D,0,dt[He(1044)],ke,Ie,0,dt.RGBA_INTEGER,dt[He(339)],null),dt[He(839)](dt[He(1310)],dt[He(1214)],dt.NEAREST),dt[He(839)](dt[He(1310)],dt[He(1219)],dt[He(1290)]),dt[He(839)](dt[He(1310)],dt[He(1399)],dt[He(1364)]),dt.texParameteri(dt[He(1310)],dt[He(1281)],dt.CLAMP_TO_EDGE),Vt}resize(ke,Ie){var He=o;let dt=this[He(1020)].gl;this[He(1530)]=ke,this[He(699)]=Ie,dt.activeTexture(dt.TEXTURE15),dt[He(600)](dt[He(1310)],this.colorAttachment0),dt[He(1338)](dt[He(1310)],0,dt[He(1044)],ke,Ie,0,dt[He(1105)],dt[He(339)],null),dt.bindTexture(dt[He(1310)],null)}}var zi=v(4040),ji=v.n(zi),pt=v(6238),hi=v.n(pt),zi=v(8242),Ri=v.n(zi),pt=v(7688),wr=v.n(pt);class Ga{constructor(ke,Ie){var He=o;this[He(1020)]=ke,this[He(337)]=Ie,ke=this.fine.gl;var dt={};dt.x=0,dt.y=0,dt[He(1530)]=0,dt.height=0;var Vt={};Vt[He(1346)]=!0,Vt.face=1029;var ni={};ni[He(1346)]=!0,ni[He(1283)]=513;var _r={};_r.enabled=!1,_r[He(475)]=1.1,_r.units=4;var Ir={};Ir[He(393)]=!0,Ir[He(338)]=!0,Ir[He(1177)]=!0,Ir[He(1273)]=!0;var Pn={};Pn[He(1362)]=dt,Pn.cull=Vt,Pn.depthTest=ni,Pn[He(780)]=_r,Pn[He(634)]=Ir;var An={};An.x=0,An.y=0,An[He(1530)]=0,An.height=0;var Wr={};Wr.enabled=!0,Wr[He(415)]=1029;var Ho={};Ho[He(1346)]=!0,Ho[He(1283)]=513;var ma={};ma.enabled=!0,ma[He(475)]=1.1,ma.units=4;var Zo={};Zo[He(393)]=!1,Zo[He(338)]=!1,Zo.blue=!1,Zo[He(1273)]=!1;var $o={};$o[He(1362)]=An,$o.cull=Wr,$o[He(817)]=Ho,$o[He(780)]=ma,$o[He(634)]=Zo,Ie._isPointLight||Ie[He(1152)]?(this[He(1417)]=Gl(ke,[hi(),ji()]),this[He(887)]=Pn):(this[He(1417)]=Gl(ke,[wr(),Ri()]),this.renderState=$o),this[He(1417)][He(583)]={}}SetUniforms(){var ke=o;this[ke(1417)][ke(583)][ke(742)]!==this[ke(337)][ke(1003)][ke(627)]()&&(this[ke(1417)][ke(583)][ke(742)]=this.shadowMap[ke(1003)][ke(627)](),So(this.programInfo,{shadowMap_lightPositionEC:[this[ke(337)][ke(1003)].x,this[ke(337)][ke(1003)].y,this[ke(337)]._lightPositionEC.z,this[ke(337)][ke(1003)].w]}))}}class xu{constructor(ke){var Ie=o,He={};He[Ie(1411)]=1,He[Ie(1312)]=[0,1,0],He[Ie(725)]=[1,1,1],He[Ie(1392)]=[.5,.5,.5],this.fine=ke,this[Ie(517)]=new Float32Array(4),this[Ie(480)]=new Float32Array(81),this[Ie(366)]=2e7,this[Ie(1197)]=2e6,this[Ie(1382)]=1280,this[Ie(345)]=640,this[Ie(1147)]=0,this[Ie(1098)]=0,this.all_vertices_num=0,this[Ie(1009)]=He;let dt=this[Ie(1020)].gl;this[Ie(558)]=this[Ie(1020)][Ie(558)],this[Ie(345)]=Math[Ie(550)](this[Ie(1382)]*(this[Ie(558)][6]/this[Ie(558)][5])),this[Ie(1036)]=new Float32Array(this[Ie(1382)]*this[Ie(345)]*2),this[Ie(1508)]=[],this[Ie(1171)]=dt[Ie(597)](dt[Ie(262)]),dt.getParameter(dt[Ie(1323)]),dt[Ie(597)](dt[Ie(842)]),dt[Ie(597)](dt[Ie(1467)]),this[Ie(1292)]={context:this[Ie(1020)][Ie(1550)]},this.renderMemoryIdBuffer=new SharedArrayBuffer(200),this[Ie(1532)]=new Uint32Array(this[Ie(294)]),this[Ie(1218)]=4*Math[Ie(550)](4194304/this.maxTextureSize)*4*this[Ie(1171)]/4,this[Ie(281)]=4*Math[Ie(550)](16777216/this[Ie(1171)])*4*this[Ie(1171)]/4,this[Ie(945)]=4*Math[Ie(550)](4194304/this[Ie(1171)])*4*this[Ie(1171)]/4,this.mixTexture=this[Ie(970)](this.mixTexture,4,this[Ie(1218)]),this[Ie(1455)]=this[Ie(970)](this.positionTexture,4,this[Ie(281)]),this[Ie(1048)]=this[Ie(970)](this[Ie(1048)],4,this[Ie(945)]),this[Ie(1351)]=4*Math.floor(6553600/this[Ie(1171)])*4*this.maxTextureSize/4,this[Ie(875)]=new SharedArrayBuffer(this[Ie(1351)]),this.renderInstancesDataView=new Uint32Array(this[Ie(875)]),this[Ie(1335)]=new SharedArrayBuffer(134217728),this[Ie(1378)]=new Float32Array(this[Ie(1335)]),this[Ie(843)]=new Wn(this.fine),this[Ie(637)]=new yo(this[Ie(1020)],this[Ie(1171)],Math[Ie(613)](3*this.logMaxRenderTriangleCount/this[Ie(1171)]),this[Ie(1351)]),this[Ie(745)]=new Th(this[Ie(1020)]),this[Ie(461)]=new mo(this[Ie(1020)]),this[Ie(1353)]=new rr(this[Ie(1020)])}RenderColor(ke){var Ie=o;let He=this[Ie(1020)].gl;ke.context[Ie(606)][Ie(1504)]!==ke[Ie(1074)][Ie(1504)]&&He[Ie(257)](He[Ie(1448)],ke[Ie(1074)]._framebuffer),He.useProgram(this.renderColorProgram.programInfo[Ie(409)]),this.renderColorProgram.renderState[Ie(1362)].x=0,this.renderColorProgram[Ie(887)][Ie(1362)].y=0,this[Ie(843)][Ie(887)].viewport.width=this[Ie(1020)][Ie(558)][5],this[Ie(843)].renderState.viewport[Ie(699)]=this.fine[Ie(558)][6],this[Ie(263)](this[Ie(843)][Ie(887)],!1),this[Ie(496)](this[Ie(843)][Ie(1417)]),ke=this[Ie(1020)][Ie(1470)].scene[Ie(1465)][Ie(1515)].lightShadowMaps;let dt=[];if(this[Ie(1020)][Ie(1470)].scene[Ie(1465)][Ie(776)]&&(dt=this.fine[Ie(1470)][Ie(885)][Ie(1465)].viewShedState[Ie(676)]),0<ke[Ie(293)])for(var Vt of ke)this[Ie(843)].SetUniforms(Vt),He[Ie(675)](He[Ie(278)],0,this[Ie(757)]);else if(0<dt[Ie(293)])for(var ni of dt)ni[Ie(396)]=!0,this.renderColorProgram[Ie(496)](ni),He[Ie(675)](He.TRIANGLES,0,this[Ie(757)]);else this[Ie(843)][Ie(496)](),He[Ie(555)](He[Ie(1008)]),He[Ie(675)](He[Ie(278)],0,this[Ie(1098)]),He.enable(He[Ie(1008)]),He[Ie(675)](He[Ie(278)],this[Ie(1098)],this[Ie(1147)]);this[Ie(263)](this.renderColorProgram[Ie(887)],!0),this.SubmitAnUpdateMeshData()}[o(496)](ke){var Ie=o,He={};He.uMixTextureSampler=this.mixTexture,He[Ie(572)]=this[Ie(1455)],He[Ie(778)]=this.instancesIndexTexture,He[Ie(873)]=this[Ie(637)][Ie(1115)],So(ke,He),ke[Ie(648)][Ie(710)]&&ke[Ie(583)][Ie(710)]!==this[Ie(1020)][Ie(1374)][Ie(1231)].toString()&&(ke.uniformValue.view=this[Ie(1020)][Ie(1374)][Ie(1231)][Ie(627)](),So(ke,{view:this[Ie(1020)][Ie(1374)][Ie(1231)]})),ke[Ie(648)][Ie(1013)]&&ke.uniformValue.viewProjection!==this.fine[Ie(1374)][Ie(632)][Ie(627)]()&&(ke.uniformValue.viewProjection=this.fine[Ie(1374)][Ie(632)][Ie(627)](),So(ke,{viewProjection:this[Ie(1020)][Ie(1374)].viewProjectionMatrix})),ke[Ie(648)].uEyePosition&&ke.uniformValue[Ie(1496)]!==this[Ie(1020)].camera[Ie(1404)][Ie(627)]()&&(ke[Ie(583)].uEyePosition=this[Ie(1020)][Ie(1374)].position[Ie(627)](),So(ke,{uEyePosition:this.fine[Ie(1374)][Ie(1404)]})),ke[Ie(648)][Ie(1045)]&&ke[Ie(583)][Ie(1045)]!==this.fine[Ie(1045)]&&(ke[Ie(583)][Ie(1045)]=this[Ie(1020)][Ie(1045)],So(ke,{oneOverLog2FarDepthFromNearPlusOne:ke[Ie(583)].oneOverLog2FarDepthFromNearPlusOne})),ke[Ie(648)][Ie(1447)]&&ke.uniformValue[Ie(1447)]!==this[Ie(1020)][Ie(558)][12]&&(ke[Ie(583)][Ie(1447)]=this[Ie(1020)][Ie(558)][12],So(ke,{near:ke[Ie(583)][Ie(1447)]})),ke[Ie(648)].useLogDepth&&ke[Ie(583)].useLogDepth!==this[Ie(1020)][Ie(727)]&&(ke.uniformValue[Ie(727)]=this[Ie(1020)].useLogDepth,So(ke,{useLogDepth:ke[Ie(583)].useLogDepth})),(ke[Ie(648)].clipPlane&&this[Ie(480)][0]||ke[Ie(583)][Ie(1318)])&&(ke.uniformValue[Ie(1318)]=this[Ie(480)][0],So(ke,{clipPlane:this.clipPlaneByVisibleModelBoxCenter})),(ke.uniformSetters[Ie(436)]&&ke.uniformValue[Ie(436)]!==this.sunHemisphericLight[Ie(1411)]||ke.uniformSetters.uLightGround&&ke[Ie(583)][Ie(490)]!==this[Ie(1009)][Ie(1392)][Ie(627)]())&&(ke[Ie(583)].uLightIntensity=this[Ie(1009)][Ie(1411)],ke[Ie(583)][Ie(490)]=this[Ie(1009)][Ie(1392)][Ie(627)](),So(ke,{uLightIntensity:this[Ie(1009)][Ie(1411)],uLightGround:[this[Ie(1009)][Ie(1392)][0]*this.sunHemisphericLight.intensity,this[Ie(1009)].groundColor[1]*this.sunHemisphericLight[Ie(1411)],this[Ie(1009)][Ie(1392)][2]*this[Ie(1009)][Ie(1411)]]})),ke[Ie(648)].uLightDirection&&ke[Ie(583)][Ie(989)]!==this.sunHemisphericLight[Ie(1312)][Ie(627)]()&&(ke.uniformValue.uLightDirection=this.sunHemisphericLight.direction[Ie(627)](),So(ke,{uLightDirection:this.sunHemisphericLight.direction})),ke[Ie(648)][Ie(291)]&&ke.uniformValue[Ie(291)]!==this[Ie(1009)][Ie(725)][Ie(627)]()&&(ke.uniformValue[Ie(291)]=this[Ie(1009)][Ie(725)].toString(),So(ke,{uLightDiffuse:this[Ie(1009)][Ie(725)]}))}[o(562)](ke,Ie){var He=o;let dt=this.fine.gl,Vt;Ie[He(1435)]?Vt=Ie[He(1435)]:(Vt=new Ga(this.fine,Ie),this[He(1508)].push(Ie.bimShadowProgram),Ie[He(1435)]=Vt),dt.useProgram(Vt[He(1417)][He(409)]),Vt.renderState.viewport.x=ke.viewport.x,Vt[He(887)][He(1362)].y=ke[He(1362)].y,Vt[He(887)].viewport[He(1530)]=ke[He(1362)][He(1530)],Vt[He(887)][He(1362)][He(699)]=ke[He(1362)].height,this[He(263)](Vt[He(887)],!1),this.SetUniforms(Vt.programInfo),Vt[He(496)](),dt[He(675)](dt[He(278)],0,this[He(757)]),this[He(263)](Vt[He(887)],!0)}[o(1080)](){var ke=o;if(this[ke(558)][0]===1){let Ie=this[ke(1020)].gl;Ie[ke(257)](Ie.FRAMEBUFFER,this.renderSelectProgram.framebuffer),Ie[ke(383)](this[ke(461)][ke(1417)][ke(409)]),this[ke(461)][ke(887)][ke(1362)].x=0,this[ke(461)][ke(887)][ke(1362)].y=0,this[ke(461)][ke(887)][ke(1362)].width=this[ke(461)][ke(1530)],this[ke(461)][ke(887)][ke(1362)].height=this[ke(461)][ke(699)],this[ke(263)](this[ke(461)][ke(887)],!1),Ie[ke(470)](0,0,0,0),Ie[ke(1247)](Ie[ke(1038)]|Ie.COLOR_BUFFER_BIT),this[ke(496)](this[ke(461)][ke(1417)]),this[ke(461)][ke(496)](),Ie[ke(675)](Ie[ke(278)],0,this.all_vertices_num),this[ke(263)](this[ke(461)].renderState,!0),Ie[ke(257)](Ie[ke(1448)],null),Ie.clearColor(0,0,0,1),this[ke(461)].mustClear=!0,this[ke(1020)][ke(1470)][ke(885)][ke(1497)]()}else if(this[ke(461)][ke(1275)]){let Ie=this.fine.gl;Ie[ke(257)](Ie[ke(1448)],this[ke(461)][ke(1074)]),Ie.clearColor(0,0,0,0),Ie[ke(1247)](Ie[ke(1038)]|Ie[ke(845)]),Ie[ke(257)](Ie[ke(1448)],null),Ie[ke(470)](0,0,0,1),this[ke(461)].mustClear=!1}}[o(515)](ke,Ie){var He=o;this[He(345)]=Math[He(550)](this[He(1382)]*(Ie/ke)),this[He(1036)]=new Float32Array(this[He(1382)]*this[He(345)]*2)}[o(963)](ke,Ie){var He=o;let dt=this[He(1020)].gl;dt[He(257)](dt[He(1448)],this[He(745)][He(1074)]),dt[He(383)](this[He(745)][He(1417)][He(409)]),this.renderIdProgram[He(887)][He(1362)].x=0,this.renderIdProgram.renderState[He(1362)].y=0,this[He(745)][He(887)].viewport[He(1530)]=ke,this.renderIdProgram.renderState[He(1362)][He(699)]=Ie,this[He(263)](this[He(745)].renderState,!1),dt[He(1247)](dt[He(1038)]|dt[He(845)]),this[He(496)](this.renderIdProgram.programInfo),dt.drawArrays(dt.TRIANGLES,0,this[He(757)]),this[He(263)](this[He(745)].renderState,!0)}[o(1150)](){var ke=o;let Ie=this[ke(1020)].gl;return this[ke(963)](this[ke(1382)],this.AllIdHeight),Ie[ke(1336)](),Ie[ke(786)](),Ie[ke(1326)](0,0,this.AllIdWidth,this.AllIdHeight,Ie.RG,Ie[ke(1058)],this[ke(1036)]),Ie[ke(257)](Ie[ke(1448)],null),this[ke(1036)]}[o(1059)](ke,Ie){var He=o;let dt=this[He(1020)].gl;return this.RenderId(this[He(745)][He(1530)],this[He(745)][He(699)]),dt[He(1336)](),dt[He(786)](),dt[He(1326)](ke,this[He(745)][He(699)]-Ie,1,1,dt.RG,dt[He(1058)],this[He(517)]),dt[He(257)](dt[He(1448)],null),this.pickData[0]=Math[He(550)](this[He(517)][0]+.5),this[He(517)][1]=Math[He(550)](this[He(517)][1]+.5),this[He(517)]}[o(305)](){var ke=o;let Ie=this.fine.gl;Ie.bindFramebuffer(Ie[ke(1448)],this[ke(1353)][ke(1074)]),Ie[ke(383)](this[ke(1353)][ke(1417)][ke(409)]),this[ke(1353)].renderState[ke(1362)].x=0,this[ke(1353)][ke(887)][ke(1362)].y=0,this[ke(1353)].renderState[ke(1362)][ke(1530)]=this.renderPositionProgram[ke(1530)],this[ke(1353)][ke(887)][ke(1362)][ke(699)]=this[ke(1353)].height,this.ApplyRenderStatus(this[ke(1353)][ke(887)],!1),Ie[ke(1247)](Ie.DEPTH_BUFFER_BIT|Ie[ke(845)]),this[ke(496)](this[ke(1353)][ke(1417)]),Ie[ke(675)](Ie[ke(278)],0,this.all_vertices_num),this[ke(263)](this[ke(1353)][ke(887)],!0)}[o(263)](ke,ni){var He=o;let dt=this.fine.gl;var Vt=this[He(1020)][He(1550)],ni=(Vt[He(1215)][He(1362)]?ke[He(1362)].x===Vt[He(1215)].viewport.x&&ke[He(1362)].y===Vt[He(1215)][He(1362)].y&&ke[He(1362)][He(1530)]===Vt._currentPassState[He(1362)][He(1530)]&&ke[He(1362)].height===Vt[He(1215)][He(1362)].height||(ni?dt[He(1362)](Vt[He(1215)].viewport.x,Vt._currentPassState[He(1362)].y,Vt._currentPassState.viewport.width,Vt._currentPassState.viewport[He(699)]):dt[He(1362)](ke[He(1362)].x,ke.viewport.y,ke.viewport[He(1530)],ke.viewport[He(699)])):dt.viewport(ke[He(1362)].x,ke.viewport.y,ke.viewport[He(1530)],ke[He(1362)].height),ni?Vt[He(445)]:ke);ke[He(1138)][He(1346)]!==Vt[He(445)][He(1138)][He(1346)]&&(ni.cull[He(1346)]?dt.enable(dt[He(1246)]):dt.disable(dt[He(1246)]),ni.cull.enabled&&dt[He(466)](ni.cull[He(415)])),ke[He(817)].enabled!==Vt._currentRenderState.depthTest.enabled&&(ni[He(817)][He(1346)]?dt.enable(dt[He(1485)]):dt[He(555)](dt[He(1485)]),ni[He(817)][He(1346)]&&dt[He(1066)](ni[He(817)][He(1283)])),ke[He(780)]&&ke[He(780)][He(1346)]!==Vt[He(445)][He(780)][He(1346)]&&(ni[He(780)][He(1346)]?dt[He(844)](dt.POLYGON_OFFSET_FILL):dt[He(555)](dt[He(706)]),ni[He(780)].enabled&&dt.polygonOffset(ni[He(780)][He(475)],ni[He(780)][He(1394)])),!ke[He(634)]||ke.colorMask[He(393)]===Vt[He(445)][He(634)][He(393)]&&ke[He(634)][He(338)]===Vt[He(445)][He(634)][He(338)]&&ke[He(634)][He(1177)]===Vt[He(445)][He(634)][He(1177)]&&ke.colorMask.alpha===Vt._currentRenderState.colorMask[He(1273)]||dt[He(634)](ni.colorMask[He(393)],ni.colorMask.green,ni[He(634)][He(1177)],ni.colorMask[He(1273)]),ke[He(967)]&&ke.blending[He(1346)]!==Vt[He(445)][He(967)].enabled&&(ni[He(967)][He(1346)]?dt[He(844)](dt[He(1008)]):dt[He(555)](dt[He(1008)]),ni[He(967)][He(1346)]&&(dt[He(686)](ni.blending[He(854)].red,ni.blending[He(854)][He(338)],ni[He(967)][He(854)][He(1177)],ni[He(967)][He(854)][He(1273)]),dt[He(1356)](ni[He(967)][He(424)],ni.blending[He(569)]),dt[He(607)](ni[He(967)][He(1301)],ni[He(967)].functionDestinationRgb,ni.blending[He(1473)],ni[He(967)][He(822)])))}PickPosition(ke,Ie){var He=o;let dt=this[He(1020)].gl;return this[He(305)](),dt[He(1336)](),dt[He(786)](),dt.readPixels(ke,this.renderPositionProgram[He(699)]-Ie,1,1,dt[He(1135)],dt[He(1058)],this[He(517)]),dt[He(257)](dt[He(1448)],null),this[He(517)]}[o(1464)](ke){var Ie=o;this.modifyMemoryMixBuffer=ke[Ie(1142)],this[Ie(912)]=new Int32Array(this.modifyMemoryMixBuffer),this[Ie(302)]=ke.modifyMemoryTextureBuffer,this[Ie(1463)]=new Int32Array(this[Ie(302)]),this[Ie(414)]=ke[Ie(414)],this[Ie(1089)]=new Int32Array(this[Ie(414)]),this[Ie(271)]=ke[Ie(271)],this.modifyMemoryInstancesDataView=new Int32Array(this.modifyMemoryInstancesBuffer)}[o(970)](ke,Ie,He){var dt=o;let Vt=this.maxTextureSize;Ie=Math[dt(613)](He/Ie/this[dt(1171)]),He<this[dt(1171)]&&(Vt=He);let ni=this[dt(1020)].gl;var _r=ni[dt(321)](),_r=(ni[dt(600)](ni[dt(1310)],_r),ni.texImage2D(ni[dt(1310)],0,ni[dt(770)],Vt,Ie,0,ni.RGBA,ni[dt(1058)],null),ni[dt(839)](ni.TEXTURE_2D,ni[dt(1219)],ni[dt(1290)]),ni[dt(839)](ni.TEXTURE_2D,ni[dt(1214)],ni[dt(1290)]),ni[dt(839)](ni[dt(1310)],ni[dt(1399)],ni[dt(1364)]),ni.texParameteri(ni[dt(1310)],ni[dt(1281)],ni[dt(1364)]),{texture:_r,dataLength:He,width:Vt,height:Ie,format:ni[dt(1135)],type:ni.FLOAT});return ke&&(He=ni[dt(999)](),ni[dt(257)](ni.READ_FRAMEBUFFER,He),ni[dt(1244)](ni[dt(869)],ni[dt(893)],ni.TEXTURE_2D,ke[dt(829)],0),Ie=ni[dt(999)](),ni[dt(257)](ni[dt(452)],Ie),ni[dt(1244)](ni.DRAW_FRAMEBUFFER,ni[dt(893)],ni[dt(1310)],_r[dt(829)],0),ni.readBuffer(ni[dt(893)]),ni[dt(1190)]([ni[dt(893)]]),ni.blitFramebuffer(0,0,ke[dt(1530)],ke[dt(699)],0,0,ke[dt(1530)],ke[dt(699)],ni[dt(845)],ni[dt(1290)]),ni[dt(257)](ni[dt(452)],null),ni[dt(257)](ni[dt(869)],null),ni.deleteFramebuffer(He),ni.deleteFramebuffer(Ie),ni[dt(1522)](ke[dt(829)])),_r}[o(1313)](){var ke=o;this[ke(558)][30]===2&&(this[ke(558)][30]=0,this[ke(423)](),this.fine.modelBoxCenter[0]=this[ke(558)][27],this[ke(1020)][ke(1163)][1]=this[ke(558)][28],this[ke(1020)][ke(1163)][2]=this.sharedMemoryDataView[29],this[ke(1355)]()),this[ke(1532)][6]===1&&(this[ke(1355)](),this[ke(979)](),this[ke(646)](),this[ke(1420)](),this.UpdateRenderIndexTexture(),this[ke(1532)][5]=0,this[ke(1532)][6]=0)}[o(1284)](){var ke=o;this.sharedMemoryDataView[4]!==this.logMaxRenderTriangleCount&&(this[ke(558)][4]=Math[ke(1305)](this.setMaxTriangleCount,this[ke(558)][4]),this[ke(558)][4]>this[ke(1197)]&&(this[ke(1197)]=this.sharedMemoryDataView[4],this[ke(637)][ke(972)](this.maxTextureSize,Math[ke(613)](3*this[ke(1197)]/this[ke(1171)]))))}[o(1355)](){var ke=o;this[ke(912)][0],this[ke(912)].length;for(let ni=1;ni<this[ke(912)][0];ni+=4){var Ie=this[ke(912)][ni+2],He=this[ke(912)][ni],dt=this.modifyMemoryMixDataView[ni+1],Vt=this.modifyMemoryMixDataView[ni+3];Vt>this[ke(578)][ke(687)]&&(this.mixTexture=this[ke(970)](this[ke(578)],4,this.mixTexture.dataLength+this[ke(1218)])),this.UpdateTextureData(this[ke(578)],this[ke(1378)][ke(724)](He,dt),Ie,Vt,4)}this[ke(912)][0]=1}UpdateTextureTexture(){var ke=o;this[ke(1463)][0],this.modifyMemoryTextureDataView.length;for(let An=1;An<this[ke(1463)][0];An+=8){var Ie=this[ke(1463)][An],He=this[ke(1463)][An+1],dt=this[ke(1463)][An+2],Vt=this[ke(1463)][An+3],ni=this.modifyMemoryTextureDataView[An+4],_r=this[ke(1463)][An+5],Ir=this[ke(1463)][An+6],Pn=this.modifyMemoryTextureDataView[An+7];let Wr=new Uint8Array(this[ke(1335)]);this[ke(843)][ke(276)]||(this[ke(843)][ke(276)]=this.renderColorProgram.CreateTextureTexture());let Ho=this[ke(1020)].gl;Ho[ke(1397)](Ho[ke(934)]),Ho[ke(600)](Ho[ke(1310)],this.renderColorProgram[ke(276)][ke(829)]),Ho[ke(871)](Ho[ke(1310)],0,dt,Vt,ni,_r,this[ke(843)][ke(276)][ke(1174)],Wr[ke(724)](Ie,Ie+He)),Ir!==0&&(this[ke(843)][ke(523)]||(this.renderColorProgram[ke(523)]=this.renderColorProgram[ke(1400)]()),Ho.bindTexture(Ho.TEXTURE_2D,this[ke(843)][ke(523)][ke(829)]),Ho[ke(871)](Ho[ke(1310)],0,dt,Vt,ni,_r,this[ke(843)][ke(523)][ke(1174)],Wr[ke(724)](Ie+He,Ie+He+Ir))),Pn!==0&&(this[ke(843)][ke(296)]||(this[ke(843)].fineNormalTexture=this.renderColorProgram.CreateTextureTexture()),Ho[ke(600)](Ho[ke(1310)],this[ke(843)][ke(296)][ke(829)]),Ho[ke(871)](Ho.TEXTURE_2D,0,dt,Vt,ni,_r,this[ke(843)][ke(296)][ke(1174)],Wr[ke(724)](Ie+He+Ir,Ie+He+Ir+Pn))),Ho[ke(600)](Ho.TEXTURE_2D,null)}this[ke(1463)][0]=1}UpdatePositionTexture(){var ke=o;this[ke(1089)][0],this.modifyMemoryPositionDataView[ke(293)];for(let ni=1;ni<this.modifyMemoryPositionDataView[0];ni+=4){var Ie=this[ke(1089)][ni+2],He=this[ke(1089)][ni],dt=this[ke(1089)][ni+1],Vt=this[ke(1089)][ni+3];Vt>this[ke(1455)].dataLength&&(this[ke(1455)]=this.ResetTexture(this[ke(1455)],4,this.positionTexture[ke(687)]+this[ke(281)])),this[ke(315)](this.positionTexture,this[ke(1378)].subarray(He,dt),Ie,Vt,4)}this[ke(1089)][0]=1}[o(1420)](){var ke=o;this[ke(457)][0],this.modifyMemoryInstancesDataView[ke(293)];for(let ni=1;ni<this[ke(457)][0];ni+=4){var Ie=this[ke(457)][ni+2],He=this[ke(457)][ni],dt=this.modifyMemoryInstancesDataView[ni+1],Vt=this[ke(457)][ni+3];Vt>this[ke(1048)].dataLength&&(this.instancesIndexTexture=this.ResetTexture(this.instancesIndexTexture,4,this.instancesIndexTexture[ke(687)]+this[ke(945)])),this[ke(315)](this[ke(1048)],this[ke(1378)].subarray(He,dt),Ie,Vt,4)}this.modifyMemoryInstancesDataView[0]=1}[o(969)](){var ke=o;if(this.renderMemoryIdDataView[7]===1){this[ke(1532)][7]=0,this.UpdateTextureData(this[ke(637)].renderInstancesTexture,this.renderInstancesDataView[ke(724)](0,this.renderMemoryIdDataView[22]),0,this[ke(1532)][22],4);let Ie=this[ke(1020)].gl;Ie[ke(257)](Ie[ke(1448)],this[ke(637)][ke(1074)]),this[ke(637)][ke(887)][ke(1362)].x=0,this[ke(637)][ke(887)][ke(1362)].y=0,this[ke(637)][ke(887)][ke(1362)][ke(1530)]=this[ke(637)][ke(1530)],this[ke(637)][ke(887)][ke(1362)][ke(699)]=this[ke(637)][ke(699)],this[ke(263)](this[ke(637)][ke(887)],!1),Ie.useProgram(this[ke(637)][ke(1417)].program),Ie[ke(1116)](null),So(this.renderIndexProgram.programInfo,{uRenderInstancesTextureSampler:this[ke(637)].renderInstancesTexture,parData:[this[ke(637)][ke(1530)],this[ke(1532)][22]/4,this[ke(1532)][21]]}),Ie[ke(675)](Ie[ke(278)],0,6),Ie.bindFramebuffer(Ie[ke(1448)],null),this.ApplyRenderStatus(this.renderIndexProgram[ke(887)],!0),this[ke(1098)]=this[ke(1532)][33],this[ke(1147)]=this[ke(1532)][34],this[ke(757)]=this[ke(1532)][21]}}[o(315)](ke,Ie,Ir,An,Vt){var ni=o,_r=Math.floor(Ir/Vt/this[ni(1171)]),Ir=Ir/Vt%this.maxTextureSize,Pn=Math[ni(550)](An/Vt/this.maxTextureSize),An=An/Vt%this.maxTextureSize;let Wr=this[ni(1020)].gl;Wr[ni(1397)](Wr.TEXTURE15),Wr.bindTexture(Wr[ni(1310)],ke[ni(829)]);var Ho,ma,Zo,$o,du,rs=Wr[ni(597)](Wr[ni(802)]);rs&&Wr[ni(700)](Wr[ni(802)],!1),_r===Pn?Wr[ni(702)](Wr.TEXTURE_2D,0,Ir,_r,An-Ir,1,ke[ni(741)],ke[ni(1490)],Ie):(Vt=(Zo=ma=(Ho=$o=0+(du=this[ni(1171)]-Ir)*Vt)+this[ni(1171)]*(Pn-_r-1)*Vt)+An*Vt,$o=Ie.subarray(0,$o),Wr[ni(702)](Wr.TEXTURE_2D,0,Ir,_r,du,1,ke.format,ke[ni(1490)],$o),1<Pn-_r&&(Ir=Ie[ni(724)](Ho,ma),Wr[ni(702)](Wr[ni(1310)],0,0,_r+1,this[ni(1171)],Pn-_r-1,ke[ni(741)],ke[ni(1490)],Ir)),du=Ie[ni(724)](Zo,Vt),Wr.texSubImage2D(Wr[ni(1310)],0,0,Pn,An,1,ke[ni(741)],ke.type,du)),rs&&Wr[ni(700)](Wr[ni(802)],rs),Wr[ni(600)](Wr.TEXTURE_2D,null)}[o(423)](){var ke=o;if(this.fine[ke(863)][0]!==0){let An=Array[ke(301)](this[ke(1020)].clipPlaneTransform);An[12]-=this[ke(558)][27],An[13]-=this[ke(558)][28],An[14]-=this[ke(558)][29];var Ie=si(An,An);for(let Wr=0;Wr<Math[ke(455)](this.fine[ke(863)][0]);Wr++){var Pn=this.fine[ke(863)][4*Wr+1],He=this[ke(1020)].clipPlane[4*Wr+2],dt=this.fine[ke(863)][4*Wr+3],Vt=this[ke(1020)][ke(863)][4*Wr+4],ni=Pn*Ie[0]+He*Ie[1]+dt*Ie[2]+Vt*Ie[3],_r=Pn*Ie[4]+He*Ie[5]+dt*Ie[6]+Vt*Ie[7],Ir=Pn*Ie[8]+He*Ie[9]+dt*Ie[10]+Vt*Ie[11],Pn=Pn*Ie[12]+He*Ie[13]+dt*Ie[14]+Vt*Ie[15];this.clipPlaneByVisibleModelBoxCenter[4*Wr+1]=ni,this[ke(480)][4*Wr+2]=_r,this[ke(480)][4*Wr+3]=Ir,this[ke(480)][4*Wr+4]=Pn}this[ke(480)][0]=this.fine[ke(863)][0]}else this[ke(480)][0]=0}[o(810)](){}}v(5108);var zi=v(9669),Ui=v.n(zi);class qs{constructor(ke){var Ie=o;ke=ke[Ie(832)][Ie(277)]("/");let He=CESIUM_BASE_URL+"/"+ke[ke[Ie(293)]-1];He=He[Ie(1475)](/\/\//g,"/").replace(/\/\//g,"/"),this.worker=new Worker(He)}[o(1278)](){var ke=o;return this[ke(611)]}}var Gt=v(5108);class Cu{constructor(ke){var Ie=o;if(this[Ie(635)]=[0,0,0,0,0,0,0,0,0],this[Ie(1390)]={},this[Ie(1045)]=1,this[Ie(727)]=!0,this.modelMeshInstancesIndexArrayBuff={},this.modelMeshInstancesIndexDataView={},this[Ie(882)]={},this[Ie(1314)]={},this[Ie(495)]={},this[Ie(518)]={},this[Ie(863)]=new Float64Array(81),this[Ie(1325)]={},this.modelBoxCenter=[0,0,0],this.modelTriangleCount=0,this[Ie(1315)]=0,this[Ie(1010)]=He=>{},this[Ie(1491)]=He=>{},Gt[Ie(826)](Ie(1393)),Pe(Float64Array),jt(Float64Array),ke[Ie(1470)]&&ke.Cesium&&ke.viewer.scene.bim)Gt[Ie(941)](Ie(1375));else{this.camera={},this[Ie(996)]=new SharedArrayBuffer(704),this[Ie(558)]=new Float64Array(this[Ie(996)]),this[Ie(1289)]=ke.serverAddress,this._texturesAddress=ke[Ie(311)],this[Ie(1072)]=this[Ie(1289)]+"saveShell",this[Ie(956)]=this[Ie(1289)]+Ie(1462),this[Ie(915)]=ke[Ie(915)],this[Ie(1470)]=ke[Ie(1470)],(this[Ie(1470)][Ie(885)][Ie(1564)]=this)[Ie(1550)]=this[Ie(1470)][Ie(885)][Ie(1125)],this.gl=this[Ie(1470)].scene._context[Ie(1460)],this.sharedMemoryDataView[3]=3e3,this[Ie(558)][4]=2e6,this.sharedMemoryDataView[5]=this.viewer[Ie(885)][Ie(1125)][Ie(920)],this[Ie(558)][6]=this[Ie(1470)][Ie(885)][Ie(1125)][Ie(1332)],this[Ie(1285)]=new xu(this),this.sharedMemoryDataView[7]=this[Ie(1285)][Ie(1171)];let He=new qs(new URL(v.p+v.u(755),v.b));this.directWorker=He[Ie(1278)](),this[Ie(1521)].postMessage({msgType:Ie(998),sharedMemoryDataBuffer:this.sharedMemoryDataBuffer,serverAddress:this[Ie(1289)],texturesAddress:this._texturesAddress,renderInstancesDataBuffer:this.render[Ie(875)],renderUpdateTempDataBuffer:this[Ie(1285)][Ie(1335)],renderMemoryIdBuffer:this[Ie(1285)].renderMemoryIdBuffer}),this.directWorker[Ie(563)]=dt=>{var Vt=Ie;switch(dt[Vt(1242)][Vt(1016)]){case"Initialized":for(var ni in this[Vt(430)]=dt[Vt(1242)].meshInstancesArrayBuff,this.meshInstancesDataView=new Float32Array(this[Vt(430)]),this[Vt(1509)]=dt[Vt(1242)][Vt(1509)],this[Vt(1022)]=new Float32Array(this[Vt(1509)]),this[Vt(1232)]=dt[Vt(1242)].expressTypeWeightsArrayBuff,this[Vt(619)]=new Float32Array(this[Vt(1232)]),this.expressTypeVisibleDistanceArrayBuff=dt.data[Vt(789)],this.expressTypeVisibleDistanceDataView=new Uint32Array(this[Vt(789)]),this[Vt(1390)]=dt[Vt(1242)].modelData,this[Vt(1285)][Vt(1464)](dt[Vt(1242)]),this.modelData)ni=this.modelData[ni],this[Vt(1233)]+=ni[Vt(426)];this[Vt(1010)](this.modelData);break;case Vt(1325):this[Vt(1325)][dt.data[Vt(1153)]]&&(dt[Vt(1242)].hasOwnProperty(Vt(1437))?this.dataCallBack[dt[Vt(1242)][Vt(1153)]][Vt(1437)](dt[Vt(1242)][Vt(1437)]):dt.data.hasOwnProperty(Vt(489))&&this[Vt(1325)][dt[Vt(1242)][Vt(1153)]][Vt(489)](dt[Vt(1242)][Vt(489)]),delete this[Vt(1325)][dt.data[Vt(1153)]]);break;case Vt(577):for(var _r in this[Vt(507)]=dt.data.modelMeshInstancesIndexArrayBuff,this.modelMeshInstancesIndexArrayBuff)this[Vt(537)][_r]=new Uint32Array(this[Vt(507)][_r]);for(var Ir in this[Vt(882)]=dt[Vt(1242)][Vt(882)],this.modelComponentAttributeArrayBuff)this.modelComponentAttributeDataView[Ir]=new Uint16Array(this[Vt(882)][Ir]);for(var Pn in this[Vt(495)]=dt[Vt(1242)][Vt(495)],this[Vt(495)])this[Vt(518)][Pn]=new Uint32Array(this.modelMeshIndexArrayBuff[Pn]);this.OnInitModel(dt[Vt(1242)].modelId)}},this[Ie(1423)]()}}get modelList(){var ke=o;return this[ke(1390)]}CesiumContext(){var ke=o,Ie={};Ie[ke(765)]=!0,Ie[ke(962)]=[ke(1530)],Ie[ke(790)]=!0;let He=this.viewer,dt=new window.MutationObserver(ni=>{var _r=ke;this.ResizeRenderSize(He[_r(885)]._context[_r(920)],He[_r(885)][_r(1125)][_r(1332)])}),Vt=(dt.observe(He[ke(922)],Ie),He[ke(885)][ke(531)][ke(1127)]);He.scene._view[ke(1127)]=function(ni){var _r=ke,Ir;Vt[_r(511)](this,ni),ni[_r(1409)].length&&(Ir=ni.frustumCommandsList[_r(293)]-1,ni[_r(1409)][0][_r(1447)]=.1,ni[_r(1409)][Ir].far=ni[_r(1409)][Ir][_r(631)]<1e3?1e3:ni[_r(1409)][Ir].far)},He[ke(885)][ke(1436)][ke(1170)](this.render[ke(461)][ke(1271)]),this[ke(491)](this[ke(1470)].scene[ke(1550)][ke(568)])}[o(266)](ke,Ie,He){var dt=o;this[dt(331)](He)}[o(331)](ke){var Ie=o;if(this[Ie(558)][2]===0){var He=ke[Ie(1550)];let dt=He[Ie(1460)];this[Ie(491)](He.uniformState),this.render.RenderColor(ke),this[Ie(1285)][Ie(1080)](),dt[Ie(257)](dt.FRAMEBUFFER,ke[Ie(1550)][Ie(606)]._framebuffer),this[Ie(731)](He.uniformState)}}[o(562)](ke,Ie){var He=o;if(this[He(558)][2]===0){var dt=ke.context;let Vt=dt[He(1460)];this.SetUniformState(dt.uniformState),this[He(727)]=!1,this[He(1285)][He(562)](ke,Ie),Vt[He(257)](Vt[He(1448)],ke.framebuffer[He(1504)])}}[o(491)](ke){var Ie=o;this[Ie(1374)][Ie(1117)]=Array[Ie(301)](ke._inverseView),this[Ie(1374)].worldMatrix[12]-=this[Ie(1163)][0],this[Ie(1374)][Ie(1117)][13]-=this.modelBoxCenter[1],this[Ie(1374)][Ie(1117)][14]-=this[Ie(1163)][2],this[Ie(1374)][Ie(1231)]=si(this.camera.worldMatrix,this[Ie(1374)][Ie(1231)]),this.camera[Ie(799)]=ke[Ie(833)],this[Ie(1374)].viewProjectionMatrix=_t(this[Ie(1374)][Ie(799)],this[Ie(1374)].viewMatrix,this[Ie(1374)][Ie(632)]),this.camera[Ie(1404)]=[ke._cameraPosition.x,ke[Ie(1253)].y,ke[Ie(1253)].z],this.camera[Ie(1404)][0]-=this[Ie(1163)][0],this[Ie(1374)].position[1]-=this[Ie(1163)][1],this[Ie(1374)][Ie(1404)][2]-=this[Ie(1163)][2],this.oneOverLog2FarDepthFromNearPlusOne=ke.oneOverLog2FarDepthFromNearPlusOne,ke.frameState?this[Ie(727)]=ke[Ie(1465)][Ie(727)]:this[Ie(727)]=!0}[o(1178)](ke){var Ie=o;this[Ie(558)][2]=ke?1:0}[o(731)](ke){var Ie=o;this[Ie(558)][Ie(1024)]([ke[Ie(1253)].x,ke[Ie(1253)].y,ke._cameraPosition.z],8),this[Ie(558)][Ie(1024)]([ke._frameState[Ie(1374)][Ie(1482)][Ie(1156)],ke[Ie(816)].x,ke[Ie(816)].y],11),this[Ie(558)].set([ke[Ie(976)].x,ke[Ie(976)].y,ke._cameraDirection.z],15),this.sharedMemoryDataView[Ie(1024)]([ke[Ie(662)].x,ke[Ie(662)].y,ke[Ie(662)].z],18),this[Ie(558)].set(ke[Ie(531)],32),this.sharedMemoryDataView[Ie(1024)](ke[Ie(405)],48),this.sharedMemoryDataView.set(ke._projection,64),this[Ie(558)].set([ke._sunDirectionWC.x,ke[Ie(1257)].y,ke._sunDirectionWC.z],80),ke=[this.sharedMemoryDataView[8]-this[Ie(635)][0],this[Ie(558)][9]-this[Ie(635)][1],this[Ie(558)][10]-this.cacheCamera[2],this[Ie(558)][15]-this[Ie(635)][3],this.sharedMemoryDataView[16]-this[Ie(635)][4],this[Ie(558)][17]-this[Ie(635)][5],this.sharedMemoryDataView[18]-this[Ie(635)][6],this[Ie(558)][19]-this[Ie(635)][7],this.sharedMemoryDataView[20]-this[Ie(635)][8]],(.01<Math[Ie(455)](ke[0])||.01<Math.abs(ke[1])||.01<Math.abs(ke[2])||1e-5<Math[Ie(455)](ke[3])||1e-5<Math[Ie(455)](ke[4])||1e-5<Math[Ie(455)](ke[5])||1e-5<Math[Ie(455)](ke[6])||1e-5<Math[Ie(455)](ke[7])||1e-5<Math.abs(ke[8]))&&(this[Ie(635)][0]=this[Ie(558)][8],this[Ie(635)][1]=this[Ie(558)][9],this[Ie(635)][2]=this[Ie(558)][10],this[Ie(635)][3]=this[Ie(558)][15],this[Ie(635)][4]=this.sharedMemoryDataView[16],this.cacheCamera[5]=this[Ie(558)][17],this[Ie(635)][6]=this[Ie(558)][18],this[Ie(635)][7]=this[Ie(558)][19],this[Ie(635)][8]=this[Ie(558)][20],clearTimeout(this[Ie(1315)]),this.getAllIdLastTimeHandle=setTimeout(()=>{var He=Ie;this[He(411)]()},400))}[o(515)](ke,Ie){var He=o;this[He(558)][5]=ke,this[He(558)][6]=Ie,this.render[He(515)](ke,Ie),this[He(1285)][He(745)].resize(ke,Ie),this[He(1285)][He(1353)][He(972)](ke,Ie),this[He(1285)][He(461)][He(972)](ke,Ie)}[o(1167)](_r,ni){var He=o,dt,Vt,_r=this[He(1285)][He(1059)](_r*this[He(1470)][He(885)][He(1358)],ni*this[He(1470)].scene[He(1358)]),ni=_r[0],_r=_r[1];return ni!==0&&_r!==0?(Vt=this.modelMeshInstancesIndexDataView[ni][_r],dt=this[He(908)][Vt+21],Vt=this[He(908)][Vt+23],Vt=this[He(518)][ni][Vt],[ni,_r,dt,this[He(1022)][Vt+6]]):[0,0,0,0]}[o(1059)](ke,Ie){return new Promise((He,dt)=>{var Vt=Ar;He(this[Vt(1167)](ke,Ie))})}[o(411)](){var ke=o,Ie=this[ke(1285)].GetAllId();this.sharedMemoryDataView[14]++;for(let Vt=0;Vt<Ie.length;Vt+=2){var He=Math[ke(550)](Ie[Vt]+.5),dt=Math[ke(550)](Ie[Vt+1]+.5);He!==0&&dt!==0&&this.modelMeshInstancesIndexDataView[ke(678)](He)&&(He=this[ke(537)][He][dt])!==0&&(this[ke(908)][He+27]=this.sharedMemoryDataView[14])}}[o(711)](){var ke=o;let Ie={},He=0;var dt=this[ke(1285)].GetAllId();for(let Ir=0;Ir<dt.length;Ir+=2){var Vt,ni=Math[ke(550)](dt[Ir]+.5),_r=Math[ke(550)](dt[Ir+1]+.5);ni!==0&&_r!==0&&(Vt=this[ke(537)][ni][_r])!==0&&this[ke(908)][Vt+29]===0&&(Ie.hasOwnProperty(ni)||(Ie[ni]={}),Ie[ni][ke(678)](_r)||(Ie[ni][_r]=0),Ie[ni][_r]++,40<Ie[ni][_r]&&(He++,this[ke(908)][Vt+29]=1))}return He}[o(1189)](ke){var Ie=o;let He={};var dt={};return dt[Ie(1480)]=Ie(1272),He[ke]=[],Ui()[Ie(909)](this[Ie(956)],{ids:He},dt)}[o(1430)](){var ke=o;let Ie={};for(let Vt=1;Vt<this[ke(908)][ke(293)];Vt+=30)this[ke(908)][Vt+29]!==0&&(Ie[ke(678)](this[ke(908)][Vt])||(Ie[this[ke(908)][Vt]]=[]),Ie[this[ke(908)][Vt]][ke(622)](this[ke(908)][Vt+1]));var He={};He[ke(1042)]=Ie;var dt={};return dt[ke(1480)]=ke(1272),Ui().post(this[ke(1072)],He,dt)}[o(1503)](ke,Ie){var He=o;return ke=this[He(1285)][He(1262)](ke*this[He(1470)][He(885)][He(1358)],Ie*this.viewer.scene[He(1358)]),ke[0]!==0||ke[1]!==0||ke[2]!==0?[ke[0]+this.sharedMemoryDataView[27],ke[1]+this[He(558)][28],ke[2]+this.sharedMemoryDataView[29]]:[0,0,0]}[o(774)](ke,Ie){return new Promise((He,dt)=>{He(this.PickWorldPositionSync(ke,Ie))})}[o(964)](ke,Ie){var He=o;return ke!==0&&Ie!==0&&this[He(537)][ke][Ie]!==0?(ke=this[He(537)][ke][Ie],[this.meshInstancesDataView[ke+15],this[He(908)][ke+16],this.meshInstancesDataView[ke+17],this[He(908)][ke+18],this.meshInstancesDataView[ke+19],this.meshInstancesDataView[ke+20]]):[0,0,0,0,0,0]}[o(1557)](ke,Ie,He,dt){return new Promise((Vt,ni)=>{var _r=Ar,Ir=Date[_r(856)](),Pn={};Pn[_r(1437)]=Vt,Pn[_r(489)]=ni,this[_r(1325)][Ir]=Pn,this.directWorker[_r(336)]({msgType:"FrameSelection",x1:ke,y1:Ie,x2:He,y2:dt,cbId:Ir})})}[o(628)](ke,Ie){var He=o,dt={};dt.status=ke;var Vt={};Vt[He(1016)]=He(628),Vt[He(1368)]=dt,Vt[He(1123)]=Ie[He(990)],this[He(1521)][He(336)](Vt,[Ie[He(990)]])}[o(1196)](ke,Ie){var He=o,dt={};dt[He(1121)]=ke;var Vt={};Vt[He(1016)]=He(1196),Vt.operating=dt,Vt.idBuffer=Ie.buffer,this[He(1521)][He(336)](Vt,[Ie[He(990)]])}[o(1054)](ke,Ie,He){var dt=o,Vt={};Vt[dt(1121)]=ke,Vt[dt(1481)]=He;var ni={};ni.msgType=dt(1054),ni[dt(1368)]=Vt,ni[dt(1123)]=Ie[dt(990)],this[dt(1521)][dt(336)](ni,[Ie.buffer])}[o(1536)](ke,Ie,He){var dt=o,Vt={};Vt[dt(698)]=ke,Vt[dt(1481)]=He;var ni={};ni.msgType=dt(1536),ni[dt(1368)]=Vt,ni.idBuffer=Ie[dt(990)],this[dt(1521)][dt(336)](ni,[Ie.buffer])}CancelOperatingTransform(){var ke=o,Ie={};Ie[ke(1016)]="CancelOperatingTransform",this[ke(1521)][ke(336)](Ie)}[o(346)](){var ke=o,Ie={};Ie[ke(1016)]=ke(346),this.directWorker[ke(336)](Ie)}[o(1205)](ke){var Ie=o;this[Ie(1390)][ke]&&this[Ie(1521)].postMessage({msgType:Ie(1205),modelId:ke})}HideModel(ke){var Ie=o;this.modelData[ke]&&this[Ie(1521)].postMessage({msgType:"HideModel",modelId:ke})}[o(749)](ke,Ie){var He=o;this.modelData[ke]&&(this.directWorker[He(336)]({msgType:He(749),modelId:ke,modelMatrixArr:Ie}),this[He(1390)][ke][He(1121)]=Ie)}[o(1211)](ke){var Ie=o;if(this.modelData[ke])return this.modelData[ke][Ie(1121)]}[o(605)](ke,Ie,He){var dt=o,Vt={};Vt.msgType=dt(605),Vt[dt(1533)]=ke,Vt.materialId=Ie,Vt[dt(854)]=He,this[dt(1521)][dt(336)](Vt)}SetMaterialTexture(ke,Ie,He){var dt=o,Vt={};Vt[dt(1016)]=dt(353),Vt[dt(1533)]=ke,Vt[dt(1234)]=Ie,Vt[dt(453)]=He,this.directWorker[dt(336)](Vt)}[o(1057)](ke,Ie,He){var dt=o,Vt={};Vt[dt(1533)]=ke,Vt[dt(1234)]=Ie;var ni={};ni.msgType="SetComponentMaterialId",ni[dt(1368)]=Vt,ni.idBuffer=He[dt(990)],this.directWorker[dt(336)](ni,[He[dt(990)]])}[o(1434)](ke,Ie){return new Promise((He,dt)=>{var Vt=Ar,ni=Date[Vt(856)](),_r={};_r[Vt(1437)]=He,_r[Vt(489)]=dt,this.dataCallBack[ni]=_r,this[Vt(1521)][Vt(336)]({msgType:Vt(1434),modelId:ke,componentId:Ie,cbId:ni})})}[o(427)](ke,Ie){return new Promise((He,dt)=>{var Vt=Ar,ni=Date[Vt(856)](),_r={};_r[Vt(1437)]=He,_r[Vt(489)]=dt,this[Vt(1325)][ni]=_r,this[Vt(1521)].postMessage({msgType:Vt(427),modelId:ke,materialId:Ie,cbId:ni})})}[o(1330)](ke){var Ie=o,He={};He[Ie(1016)]=Ie(1330),He[Ie(1533)]=ke,this.directWorker[Ie(336)](He)}[o(403)](ke,Ie){return new Promise((He,dt)=>{var Vt=Ar,ni=Date[Vt(856)](),_r={};_r[Vt(1437)]=He,_r[Vt(489)]=dt,this[Vt(1325)][ni]=_r,this[Vt(1521)][Vt(336)]({msgType:Vt(403),modelId:ke,color:Ie,cbId:ni})})}[o(1060)](ke,Ie,He){var dt=o;this[dt(1285)][dt(461)][dt(478)]=Ie,this[dt(1285)].renderSelectProgram[dt(981)]=He,this[dt(1285)].renderSelectProgram[dt(584)]=ke}[o(1476)](){return new Promise((ke,Ie)=>{var He=Ar,dt={};dt.outlineColor=this.render[He(461)].outlineColor,dt[He(981)]=this[He(1285)][He(461)][He(981)],dt.outlineWidth=this[He(1285)].renderSelectProgram[He(584)],ke(dt)})}[o(739)](ke,Ie,He,dt){var Vt=o;ke!==void 0&&(this[Vt(1285)][Vt(1009)][Vt(1411)]=ke),Ie!==void 0&&Array.isArray(Ie)&&(this[Vt(1285)][Vt(1009)][Vt(1312)]=Ie),He!==void 0&&Array[Vt(1241)](He)&&(this.render[Vt(1009)][Vt(725)]=He),dt!==void 0&&Array[Vt(1241)](dt)&&(this[Vt(1285)][Vt(1009)][Vt(1392)]=dt)}[o(1383)](ke,Ie,He,dt,Vt,ni,_r,Ir){var Pn=o;if(ke&&Array[Pn(1241)](ke)){this[Pn(1026)]=ke;let An=this[Pn(863)][0]=0;He&&(this[Pn(863)][Pn(1024)](He,4*An+1),An++,dt&&(this[Pn(863)][Pn(1024)](dt,4*An+1),An++,Vt&&(this[Pn(863)][Pn(1024)](Vt,4*An+1),An++,ni&&(this[Pn(863)][Pn(1024)](ni,4*An+1),An++,_r&&(this[Pn(863)].set(_r,4*An+1),An++,Ir&&(this[Pn(863)][Pn(1024)](Ir,4*An+1),An++)))))),this.clipPlane[0]=An*(Ie?-1:1)}else this[Pn(863)][0]=0;this[Pn(1285)].ClipPlaneTransformToVisibleModelBoxCenter()}SetClipPlaneArray(ke,Ie,He){var dt=o;ke&&Array[dt(1241)](ke)?(this[dt(1026)]=ke,this[dt(863)][0]=He.length*(Ie?-1:1),this[dt(863)][dt(1024)](He,1)):this[dt(863)][0]=0,this[dt(1285)].ClipPlaneTransformToVisibleModelBoxCenter()}[o(1011)](ke,Ie,He){var dt=o,Vt={};Vt.msgType=dt(1011),Vt.modelId=ke,Vt[dt(462)]=Ie,Vt.matrixArr=He,this.directWorker[dt(336)](Vt)}[o(1111)](ke,Ie,He){var dt=o,Vt={};Vt.msgType=dt(1111),Vt.modelId=ke,Vt[dt(462)]=Ie,Vt[dt(698)]=He,this.directWorker.postMessage(Vt)}[o(576)](ke,Ie,He){var dt=o,Vt={};Vt[dt(1016)]=dt(576),Vt[dt(1533)]=ke,Vt[dt(1538)]=Ie,Vt.matrixArr=He,this[dt(1521)][dt(336)](Vt)}SetModelExpressTypeStatus(ke,Ie,He){var dt=o,Vt={};Vt.msgType="SetModelExpressTypeStatus",Vt[dt(1533)]=ke,Vt[dt(1538)]=Ie,Vt[dt(698)]=He,this.directWorker[dt(336)](Vt)}SetMaxRenderTriangleCount(ke){var Ie=o;this[Ie(558)][4]=ke,this[Ie(1285)][Ie(1284)](),setTimeout(()=>{var He=Ie;this[He(558)][14]++},1e3)}[o(1148)](ke){var Ie=o;this[Ie(558)][3]=ke}[o(1240)](ke){var Ie=o,He={};He[Ie(1016)]=Ie(1240),He[Ie(844)]=!!ke,this[Ie(1521)].postMessage(He)}[o(1154)](ke,Ie){var He=o;Array[He(1241)](ke)?this[He(1143)][He(1024)](ke):this[He(1143)][ke]=Ie}[o(385)](ke,Ie){var He=o;Array[He(1241)](ke)?this[He(619)][He(1024)](ke):this[He(619)][ke]=Ie}}let na=Cu,gf=Cu}return y});function Nue(){var o=["$frameElement","codes","412WRchNY","RGBA_INTEGER","toJSON","val1","isNativeError","%Uint32ArrayPrototype%","options must be an object","SetModelStoreyStatus","Out of range index","argument should be a Buffer","ERR_BAD_OPTION_VALUE","colorAttachment0","bindVertexArray","worldMatrix","isSet","BigUint64Array","transitional","transform","[Getter]","idBuffer","transformFeedbackVaryings","_context","product","createPotentiallyVisibleSet","writeBigInt64BE","head","doesNotReject","%Uint16ArrayPrototype%","inverseViewMatrix","iterator must be a function","Int8Array","RGBA","36168","values","cull","_lightDirectionEC","code","readInt32BE","modifyMemoryMixBuffer","expressTypeVisibleDistanceDataView","construct","ERR_INVALID_ARG_TYPE",'The error message "',"transparent_vertices_num","SetAllowSingleMeshMaxTriangleFaceQuantity","send","GetAllId","RENDERBUFFER","_isSpotLight","cbId","SetExpressTypeVisibleDistance","progress","fov","options","isInt16Array","_extend","domain=","decompress","application/x-www-form-urlencoded;charset=utf-8","modelBoxCenter","\x1B[32m","shim","getShaderInfoLog","PickIdSync","fromByteArray","0xffffffffffffffff","add","maxTextureSize","$scrollTop","isNaN","internalformat","readUIntLE","array","blue","SetPauseRender","[object DataView]","$innerHeight","ReferenceError","disableVertexAttribArray","inspect","setTimeout has not been defined","slice","WeakSet","depth","equal","ClearShell","drawBuffers","toLowerCase",'Expected "actual" not to be reference-equal to "expected":',"name","white","not ","SetInstancesTransform","logMaxRenderTriangleCount","Super expression must either be null or a function","is invalid","Accept","visibleColor","base64","onUploadProgress","errorCallback","ShowModel","object",'Expected "actual" to be loosely unequal to:',"defineProperty","JSON","Failed","GetModelTransform","getActiveUniform","Invalid string. Length must be a multiple of 4","TEXTURE_MAG_FILTER","_currentPassState","getPrototypeOf","%ArrayProto_keys%","mixTextureDefaultLength","TEXTURE_MIN_FILTER"," has been removed","isArrayBuffer","join","open","isTypedArray","runWhen","%Uint8ArrayPrototype%"," does not exist!","[object FormData]","SRC_ALPHA","readUInt16BE","viewMatrix","expressTypeWeightsArrayBuff","modelTriangleCount","materialId","Trace","isView","removeListener","camera_view_matrix","match","SetOnlyShowShells","isArray","data","may not be an empty object","framebufferTexture2D","symbol","CULL_FACE","clear","date","%Math.max%"," is not supported in userland","linkProgram","flags","_cameraPosition","UNIFORM_SIZE","notStrictEqual","0x7fffffffffffffff","_sunDirectionWC","%ArrayPrototype%",'Expected "actual" to be reference-equal to "expected":',"13405krUxWT","utf8","PickPosition","compact","attribLocations","%SyntaxErrorPrototype%","_textureSize","async function* () {}","%Object.defineProperty%","unshift","pipe","postProcessStage","json","alpha","application/json","mustClear","promise","numComponents","getWorker","index"," argument","TEXTURE_WRAP_T","intrinsic ","func","ChangeMaxRenderTriangleCount","render","May","maximumDistance","keys","_serverAddress","NEAREST","responseURL","passState","toPrimitive","username","port","attachShader","isFile","isStandardBrowserEnv","ifError","426dEeQNP","functionSourceRgb","transformFeedbackInfo","writeInt16BE","compressedTexImage2D","min","Bim","pow","argument","for","TEXTURE_2D","readDoubleBE","direction","SubmitAnUpdateMeshData","modelComponentAttributeDataView","getAllIdLastTimeHandle",'" is invalid for argument "value"',"Float64Array","clipPlaneCount","ext_texture_compression_bptc"," and will be removed in the near future","writeUintLE","italic","MAX_COMBINED_TEXTURE_IMAGE_UNITS",'"buffer" argument must be a Buffer instance',"dataCallBack","readPixels","Form","utf-16le","%AsyncGenerator%","CancelMaterialEdit","uniform2fv","drawingBufferHeight","[object WeakSet]","splice","renderUpdateTempDataBuffer","flush","FUNC_ADD","texImage2D","columnNumber","lightCamera_projection_matrix","defineProperties","getShaderParameter","shadowMap_texture","merge","%s %d: %s","enabled","test",' to be returned from the "',"arraySetter","strict","renderInstancesTextureDefaultLength","isString","renderPositionProgram","%EvalErrorPrototype%","UpdateMixTexture","blendEquationSeparate","readUintLE","pixelRatio","isUndefined","getActiveUniformBlockName","[object Symbol]","viewport","get","CLAMP_TO_EDGE","Object.keys called on a non-object","vertexAttrib4uiv","all","operating","assign","%ArrayProto_forEach%","FormData","callee","Cancel","camera","bim\u5BF9\u8C61\u53EA\u80FD\u521B\u5EFA\u4E00\u6B21","blockSpecs"," arguments","renderUpdateTempDataView","COMPLETION_STATUS_KHR","0.27.2","stackStartFn","AllIdWidth","SetClipPlane","renderInstancesTexture","browser","%Int32ArrayPrototype%","isArrayBufferView","toUpperCase","readInt8","modelData","File","groundColor","V20240410","units",`#version 300 es precision highp float; precision highp int; layout (std140, column_major) uniform; uniform float uLightIntensity; uniform vec3 uLightDirection; uniform vec3 uLightDiffuse; uniform vec3 uLightGround; uniform sampler2D diffuseSampler; uniform sampler2D bumpSampler; uniform float clipPlane[81]; uniform sampler2D uMixTextureSampler; uniform bool useLogDepth; uniform float oneOverLog2FarDepthFromNearPlusOne; uniform vec3 uEyePosition; uniform bool shadowMapEnable; uniform samplerCube shadowMap_textureCube; uniform sampler2D shadowMap_texture; uniform vec3 shadowMap_lightDirectionEC; uniform vec4 shadowMap_lightPositionEC; uniform vec3 shadowMap_lightPositionWC; uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness; uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth; uniform mat4 shadowMap_cascadeMatrices[4]; uniform vec4 shadowMap_cascadeSplits[2]; uniform mat4 shadowMap_matrix; uniform mat4 worldMatrix; uniform bool viewShed; uniform vec4 viewShed_visibleColor; uniform vec4 viewShed_invisibleColor; uniform mat4 camera_projection_matrix; uniform mat4 camera_view_matrix; // x 1:isPointLight,2:isSpotLight,3hasCascades // y use_soft_shadows uniform vec2 shadowMap_lightType; mat4 czm_cascadeMatrix(vec4 weights) { return shadowMap_cascadeMatrices[0] * weights.x + shadowMap_cascadeMatrices[1] * weights.y + shadowMap_cascadeMatrices[2] * weights.z + shadowMap_cascadeMatrices[3] * weights.w; } vec4 czm_cascadeWeights(float depthEye) { vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye)); vec4 far = step(depthEye, shadowMap_cascadeSplits[1]); return near * far; } float czm_unpackDepth(vec4 packedDepth) { return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d) { return czm_unpackDepth(texture(shadowMap, d)); } #define USE_SHADOW_DEPTH_TEXTURE float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv) { #ifdef USE_SHADOW_DEPTH_TEXTURE return texture(shadowMap, uv).r; #else return czm_unpackDepth(texture(shadowMap, uv)); #endif } float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth) { return step(depth, czm_sampleShadowMap(shadowMap, uv)); } float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth) { return step(depth, czm_sampleShadowMap(shadowMap, uv)); } float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness) { visibility = max(visibility, darkness); return visibility; } in float v_depthFromNearPlusOne; in float vBlur; in vec4 vColorBase; in float clipReset[6]; in vec2 vMainUV1; in vec3 vPositionW; in vec3 vPositionEye; in vec3 vNormalEye; in vec3 vNormalW; in mat3 vTBN; in mediump vec4 vTexIndex; in mediump float vDiscard; vec3 computeHemisphericLighting(vec3 viewDirectionW, vec3 vNormal, vec3 vLightDirection, vec3 diffuseColor, vec3 groundColor) { float ndl = dot(vNormal, vLightDirection) * 0.5 + 0.5; return mix(groundColor, diffuseColor, ndl); } vec3 perturbNormalBase(mat3 cotangentFrame, vec3 normal, float scale) { return normalize(cotangentFrame * normal); } vec3 perturbNormal(mat3 cotangentFrame, vec3 textureSample, float scale) { return perturbNormalBase(cotangentFrame, textureSample * 2.0 - 1.0, scale); } ivec2 getTextureCoordinates(uint index, uint width) { uint y = index / width; uint x = index - width * y; if (x >= width) { x = x - width; y += 1u; } return ivec2(x, y); } ivec2 getTextureCoordinates2(ivec2 coor, uint width) { if (coor.x >= int(width)) { coor.x = coor.x - int(width); coor.y += 1; } return coor; } layout (location = 0) out vec4 outFrag1; void main(void) { if (vDiscard < 0.5) { discard; return; }; int planeCount = int(abs(clipPlane[0])); if (planeCount != 0) { int hitCount = 0; for (int i = 0; i < planeCount; i++) { if (clipReset[i] > 0.) { hitCount++; } } if (clipPlane[0] > 0.) { if (hitCount == planeCount) { discard; return; } } else { if (hitCount != planeCount) { discard; return; } } } vec3 viewDirectionW = normalize(uEyePosition - vPositionW); vec4 baseColor = vec4(1., 1., 1., 1.); float alpha = 1.0; vec3 normalW = normalize(vNormalW); vec2 uvOffset = vec2(0.0, 0.0); if (vTexIndex.x > 0.5) { vec2 uvT = vMainUV1; uint texMixWidth = uint(textureSize(uMixTextureSampler, 0).x); ivec2 textureCoordinatesMaterial = getTextureCoordinates(uint(floor(vTexIndex.x + 0.5)), texMixWidth); vec4 texBaseImgUv = texelFetch(uMixTextureSampler, textureCoordinatesMaterial, 0); // \u8D34\u56FE\u6240\u4EE3\u8868\u7684\u5B9E\u9645\u5BBD\u5EA6x vec4 texBaseImgParam = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesMaterial.x + 1, textureCoordinatesMaterial.y), texMixWidth), 0); uvT = fract(uvT / texBaseImgParam.x); uvT.x = uvT.x < 0.0 ? 1.0 + uvT.x : uvT.x; uvT.y = uvT.y < 0.0 ? 1.0 + uvT.y : uvT.y; uvT.y = 1.0 - uvT.y; uvT.xy = texBaseImgUv.xy + (texBaseImgUv.zw * uvT.xy); normalW = perturbNormal(vTBN, texture(bumpSampler, uvT + uvOffset).xyz, 1.0); baseColor = texture(diffuseSampler, uvT + uvOffset); if (vColorBase.a > 0.001) { float gray = baseColor.r * 0.299 + baseColor.g * 0.587 + baseColor.b * 0.114; baseColor.rgb = vec3(gray, gray, gray) + vColorBase.rgb; } alpha *= baseColor.a; } else { baseColor = vColorBase; } baseColor.rgb *= uLightIntensity; alpha *= baseColor.a; vec3 diffuse = computeHemisphericLighting(viewDirectionW, normalW, uLightDirection, uLightDiffuse.rgb, uLightGround); vec3 finalDiffuse = clamp(diffuse, 0.0, 1.0) * baseColor.rgb; vec4 color = vec4(finalDiffuse, alpha); color.rgb = max(color.rgb, 0.); outFrag1 = color; if (vBlur > 0.5) { outFrag1 = vec4(1,1,1,0.5); } if (useLogDepth) { gl_FragDepth = log2(v_depthFromNearPlusOne) * oneOverLog2FarDepthFromNearPlusOne; } else { gl_FragDepth = gl_FragCoord.z; } if (shadowMapEnable) { vec4 positionEC = vec4(vPositionEye, 1.0); vec3 normalEC = vNormalEye; float depth = -positionEC.z; vec2 texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy; float depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z; float normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w; float darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w; float visibility; if (shadowMap_lightType.x == 1.0) { if(viewShed) { vec4 vcPos = camera_view_matrix * vec4(vPositionW, 1.0); vec4 posInEye = camera_projection_matrix * vcPos; posInEye /= posInEye.w; if (any(lessThan(posInEye.xyz, vec3(-1.0))) || any(greaterThan(posInEye.xyz, vec3(1.0)))) { return; } } vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz; float distance = length(directionEC); directionEC = normalize(directionEC); float radius = shadowMap_lightPositionEC.w; if (distance > radius) { return; } vec3 directionWC = mat3(worldMatrix) * directionEC; float depth = distance / radius; depth -= depthBias; visibility = czm_shadowDepthCompare(shadowMap_textureCube, directionWC, depth); visibility = max(visibility, darkness); } else if (shadowMap_lightType.x == 2.0) { vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz); vec4 shadowPosition = shadowMap_matrix * positionEC; // Spot light uses a perspective projection, so perform the perspective divide shadowPosition /= shadowPosition.w; // Stop early if the fragment is not in the shadow bounds if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0)))) { return; } float depth = shadowPosition.z; depth -= depthBias; visibility = czm_shadowDepthCompare(shadowMap_texture, shadowPosition.xy, depth); visibility = max(visibility, darkness); } else if (shadowMap_lightType.x == 3.0) { float maxDepth = shadowMap_cascadeSplits[1].w; // Stop early if the eye depth exceeds the last cascade if (depth > maxDepth) { return; } // Get the cascade based on the eye-space depth vec4 weights = czm_cascadeWeights(depth); // Transform position into the cascade vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC; // Get visibility vec2 uv = shadowPosition.xy; float depth = shadowPosition.z; // depthBias *= mix(1.0, 100.0, depth * 0.0015); // depthBias *= max(depth * 0.01, 1.0); depth -= depthBias; if (shadowMap_lightType.y == 1.0) { float radius = 1.0; float dx0 = -texelStepSize.x * radius; float dy0 = -texelStepSize.y * radius; float dx1 = texelStepSize.x * radius; float dy1 = texelStepSize.y * radius; visibility = ( czm_shadowDepthCompare(shadowMap_texture, uv, depth) + czm_shadowDepthCompare(shadowMap_texture, uv + vec2(dx0, dy0), depth) + czm_shadowDepthCompare(shadowMap_texture, uv + vec2(0.0, dy0), depth) + czm_shadowDepthCompare(shadowMap_texture, uv + vec2(dx1, dy0), depth) + czm_shadowDepthCompare(shadowMap_texture, uv + vec2(dx0, 0.0), depth) + czm_shadowDepthCompare(shadowMap_texture, uv + vec2(dx1, 0.0), depth) + czm_shadowDepthCompare(shadowMap_texture, uv + vec2(dx0, dy1), depth) + czm_shadowDepthCompare(shadowMap_texture, uv + vec2(0.0, dy1), depth) + czm_shadowDepthCompare(shadowMap_texture, uv + vec2(dx1, dy1), depth) ) * (1.0 / 9.0); } else { visibility = czm_shadowDepthCompare(shadowMap_texture, uv, depth); } visibility = max(visibility, darkness); // Fade out shadows that are far away float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z; float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0); visibility = mix(visibility, 1.0, fade); } if(viewShed){ if(visibility > 0.3) { outFrag1 = mix(outFrag1, viewShed_visibleColor, 0.5); }else { outFrag1 = mix(outFrag1, viewShed_invisibleColor, 0.5); } }else { outFrag1.rgb *= visibility; } } } `,"Symbol","activeTexture","paramsSerializer","TEXTURE_WRAP_S","CreateTextureTexture","_isBuffer","used","setPrototypeOf","position","Index out of range","isRegExp","isAsyncFunction"," or ","frustumCommandsList","writeFloatBE","intensity","createProgram","reason","stringify","Expected values to be strictly deep-equal:","deepEqual","programInfo","readUInt32BE","$|^","UpdateInstancesTexture","EvalError","No such label: ","CesiumContext","config","_shadowMapMatrix","Uint8ClampedArray","[object Array]","maxArrayLength","uniform1f","SaveShell","__CANCEL__","uniform1fv","CreateColorTexture","GetComponentMaterialId","bimShadowProgram","postProcessStages","resolve","value","isBigIntObject","deleteShader",`#version 300 es\r \r precision highp float;\r precision highp int;\r \r uniform float clipPlane[81];\r uniform bool useLogDepth;\r uniform float oneOverLog2FarDepthFromNearPlusOne;\r uniform vec4 shadowMap_lightPositionEC;\r \r in float v_depthFromNearPlusOne;\r in float clipReset[6];\r in mediump float vDiscard;\r in vec3 vPositionEye;\r \r vec4 czm_packDepth(float depth) {\r vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;\r enc = fract(enc);\r enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);\r return enc;\r }\r \r layout(location=0) out vec4 outFrag1;\r void main(void) {\r if (vDiscard < 0.5) {\r discard;\r return;\r };\r int planeCount = int(abs(clipPlane[0]));\r if (planeCount != 0) {\r int hitCount = 0;\r for (int i = 0;\r i < planeCount;\r i++) {\r if (clipReset[i] > 0.) {\r hitCount++;\r }\r \r }\r if (clipPlane[0] > 0.) {\r if (hitCount == planeCount) {\r discard;\r return;\r }\r \r }\r else {\r if (hitCount != planeCount) {\r discard;\r return;\r }\r \r }\r \r }\r if (useLogDepth) {\r gl_FragDepth = log2(v_depthFromNearPlusOne) * oneOverLog2FarDepthFromNearPlusOne;\r }\r else {\r gl_FragDepth = gl_FragCoord.z;\r }\r \r float distance = length(vPositionEye);\r if (distance >= shadowMap_lightPositionEC.w) {\r discard;\r }\r distance /= shadowMap_lightPositionEC.w;\r outFrag1 = czm_packDepth(distance);\r }\r `,"SharedArrayBuffer","Int16Array","%ObjProto_valueOf%","getActiveAttrib","%Uint8ClampedArrayPrototype%","near","FRAMEBUFFER","done","toLocaleString","writeInt32LE","enableVertexAttribArray","inverse","String","positionTexture","[object String]","lastIndexOf",`#version 300 es\r \r // out highp vec4 gl_Position;\r void main(void) {\r vec4 position[6] = vec4[6](\r vec4(-1.0, 1.0, 0.0, 1.0),\r vec4(-1.0, -1.0, 0.0, 1.0),\r vec4(1.0, -1.0, 0.0, 1.0),\r vec4(1.0, -1.0, 0.0, 1.0),\r vec4(1.0, 1.0, 0.0, 1.0),\r vec4(-1.0, 1.0, 0.0, 1.0)\r );\r gl_Position = position[gl_VertexID];\r }`,"Network Error","_gl","ERR_BAD_RESPONSE","clearShell","modifyMemoryTextureDataView","InitBuffer","frameState","validators","MAX_TEXTURE_IMAGE_UNITS","%JSONStringify%","%Int8ArrayPrototype%","viewer","getOwnPropertySymbols","isDate","functionSourceAlpha","stackTraceLimit","replace","GetSelectColor","notEqual","hex","shadowMap_lightPositionWC","responseType","reverseElection","frustum","strictEqualObject","copyWithin","DEPTH_TEST","isDeepStrictEqual",'" is out of range.',"[object HTMLCollection]","getUniformLocation","type","OnInitModel","parse","Unsupported protocol ","writeInt8",">= ","uEyePosition","requestRender","custom","getHours","Buffer","hasArrayLengthDefineBug","isBoolean","PickWorldPositionSync","_framebuffer","byteLength","$frames","stylize","renderShadowPrograms","meshArrayBuff","ERR_FR_TOO_MANY_REDIRECTS","uniformBlockSpec","isInt8Array","shift","charAt","shadowState","vertexAttribIPointer","\x1B[31m","_arr","%BooleanPrototype%","cookie","directWorker","deleteTexture","isInt32Array",'The value "',"createElement","Error in program linking: ","FileList","writeInt16LE","10162808UGVPvN","width","off","renderMemoryIdDataView","modelId",`#version 300 es\r precision highp float;\r \r uniform float clipPlane[81];\r \r in mediump float vDiscard;\r in float vModelId;\r in float vInstancesId;\r in vec3 vPositionW;\r in float clipReset[6];\r \r layout(location=0) out vec2 outFrag1;\r void main(void) {\r if ( vDiscard < 0.5){\r outFrag1 = vec2(0,0);\r discard;\r return;\r }else{\r int planeCount = int(abs(clipPlane[0]));\r if(planeCount != 0){\r int hitCount = 0;\r for (int i = 0; i < planeCount; i++){\r if(clipReset[i] > 0.){\r hitCount++;\r }\r }\r if(clipPlane[0] > 0.){\r if(hitCount == planeCount){\r discard;\r return;\r }\r }else{\r if(hitCount != planeCount){\r discard;\r return;\r }\r }\r }\r \r outFrag1 = vec2(vModelId,vInstancesId);\r }\r }`,"isAnyArrayBuffer","SetComponentStatus","entries","expressType","isFileList","ETIMEDOUT","isEncoding","shadowMap_cascadeSplits","%DatePrototype%","){ return binder.apply(this,arguments); }","1283544xtwGbz","trim","expected","secure","TYPED_ARRAY_SUPPORT","context","description","uniform1iv","Content-Type",'The value of "',"sham","uniform2iv","FrameSelection","binder","DataView","one of ","functionDestinationRgb","max-forwards","setAttribute","bim","prependOnceListener","val2","toStringTag","ERR_BUFFER_OUT_OF_BOUNDS","%TypedArrayPrototype%","writeBigInt64LE","rejection","bindFramebuffer","ERR_AMBIGUOUS_ARGUMENT","BACK",'"offset" is outside of buffer bounds',"poolSize","MAX_TEXTURE_SIZE","ApplyRenderStatus","isBoxedPrimitive","Attempt to allocate Buffer larger than maximum size: 0x","Render","patch","readUint16LE"," | ","5762634Ppujuq","modifyMemoryInstancesBuffer","map","isNullOrUndefined","return function*() {}","uniform4uiv","fineAlbedoTexture","split","TRIANGLES","params","_primitiveBias","positionIndexTextureDefaultLength","amd","then","property names with quotes must have matching quotes","url","vertexAttribDivisor","getOwnPropertyDescriptor","actual","_lightCamera",`#version 300 es\r precision highp float;\r \r uniform float clipPlane[81];\r \r in float clipReset[6];\r in vec4 vColorBase;\r in mediump float vDiscard;\r \r layout(location=0) out vec4 outFrag1;\r void main(void) {\r if ( vDiscard < 0.5){\r outFrag1 = vec4(0.0,0.0,0.0,0.0);\r discard;\r }else{\r int planeCount = int(abs(clipPlane[0]));\r if(planeCount != 0){\r int hitCount = 0;\r for (int i = 0; i < planeCount; i++){\r if(clipReset[i] > 0.){\r hitCount++;\r }\r }\r if(clipPlane[0] > 0.){\r if(hitCount == planeCount){\r discard;\r return;\r }\r }else{\r if(hitCount != planeCount){\r discard;\r return;\r }\r }\r }\r \r outFrag1 = vec4(vColorBase.rgb,1.0);\r }\r }`,"uLightDiffuse","includes","length","renderMemoryIdBuffer","isPlainObject","fineNormalTexture","getPolyfill",'" is identical to the message.',"isSetIterator",", and ","from","modifyMemoryTextureBuffer","%ReferenceErrorPrototype%","uniformMatrix4x3fv","RenderPosition","apply","readUint32LE","trace","shadowMap_cascadeMatrices","%PromisePrototype%","texturesAddress","defaults","The argument '",'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ',"UpdateTextureData","DEPTH_COMPONENT32F","message","getMinutes","xsrfHeaderName","unsubscribe","createTexture","isError","Object.prototype.toString","fail","info","%RegExpPrototype%","hostname","[object HTML document.all class]","upload","[object HTMLAllCollection]","RenderColor","uniform2uiv",". Received ","readUIntBE","invisibleColor","postMessage","shadowMap","green","UNSIGNED_INT","shaderSource","isArgumentsObject","content-length","https","nextTick","AllIdHeight","CancelOperatingStatus","%Error.prototype%","cwd","rejected","CancelToken","vertexAttribPointer","PostProcessStage","SetMaterialTexture","null","isTTY","getColorDepth","file:","showHidden","emptyTextureCube","Module","writeBigUInt64BE","prependListener","method","bigint","text","setMaxTriangleCount","maxBodyLength","X-XSRF-TOKEN","readBigUInt64LE","[object Set Iterator]","isObject","vertexAttrib4iv","unknown type: 0x","error/message","_darkness","constructor",")=([^;]*)","enumerable","depthAttachment","onreadystatechange","isPrototypeOf","isUint8ClampedArray","useProgram","emptyTexture","SetExpressTypeWeights","LESS","attribs","%URIErrorPrototype%","%GeneratorFunction%","SlowBuffer",'The "string" argument must be of type string. Received type number','"allowMissing" argument must be a boolean',"red","readUInt8","positionWC","viewShed","iterator","deprecate",` `,"isMapIterator","VERSION","sourceEnd out of bounds","CreateMaterial","toGMTString","_inverseView","writeUIntBE","isNumberObject","swap64","program","eject","MarkVisibleInstances","cols","writeUInt16LE","modifyMemoryPositionBuffer","face","Promise","RG32F","must not be","copy","baseURL",">= 0","cyan","ClipPlaneTransformToVisibleModelBoxCenter","equationRgb","URLSearchParams","triangleCount","GetMaterial","getActiveUniformBlockParameter","UNIFORM_OFFSET","meshInstancesArrayBuff","Expected values to be loosely deep-equal:","Function.prototype.bind called on incompatible ","assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","isURLSearchParams","stride","uLightIntensity","Values identical but not reference-equal:","isSymbol","normalOffsetScale","isInteger","subscribe","Jul","super_","addEventListener","_currentRenderState","Invalid code point","utf-8","content-type","notDeepStrictEqual","bindPoint","KHR_parallel_shader_compile","DRAW_FRAMEBUFFER","textureId","Function","abs","Nov","modifyMemoryInstancesDataView","isLegacyArguments"," must be specified","Cannot call a class as a function","renderSelectProgram","storey","encoding must be a string","foo","pop","cullFace","regexp","cancelToken","_cascadeMatrices","clearColor","shadowMap_lightDirectionEC","onloadend","shadowMap_texelSizeDepthBiasAndNormalShadingSmooth","sampler","factor","readUintBE","extend","outlineColor","protocol","clipPlaneByVisibleModelBoxCenter","transport","styles","Buffer.write(string, encoding, offset[, length]) is no longer supported","%SetPrototype%","Type","endsWith","catch","max","reject","uLightGround","SetUniformState","equals","[object SharedArrayBuffer]","usedByVertexShader","modelMeshIndexArrayBuff","SetUniforms","ascii","vert",`#version 300 es\r \r precision highp float;\r precision highp int;\r \r uniform float clipPlane[81];\r uniform bool useLogDepth;\r uniform float oneOverLog2FarDepthFromNearPlusOne;\r \r in float v_depthFromNearPlusOne;\r in float clipReset[6];\r in mediump float vDiscard;\r \r void main(void) {\r if (vDiscard < 0.5) {\r discard;\r return;\r };\r int planeCount = int(abs(clipPlane[0]));\r if (planeCount != 0) {\r int hitCount = 0;\r for (int i = 0;\r i < planeCount;\r i++) {\r if (clipReset[i] > 0.) {\r hitCount++;\r }\r \r }\r if (clipPlane[0] > 0.) {\r if (hitCount == planeCount) {\r discard;\r return;\r }\r \r }\r else {\r if (hitCount != planeCount) {\r discard;\r return;\r }\r \r }\r \r }\r if (useLogDepth) {\r gl_FragDepth = log2(v_depthFromNearPlusOne) * oneOverLog2FarDepthFromNearPlusOne;\r }\r else {\r gl_FragDepth = gl_FragCoord.z;\r }\r }\r `,"[object Function]","isFunction","transformFeedbackMode","argv","http","createRenderbuffer","intrinsic name must be a non-empty string","modelMeshInstancesIndexArrayBuff","toFlatObject","async function () {}","next","call","time","interceptors","getUri","ResizeRenderSize","Array","pickData","modelMeshIndexDataView","$scrollX","[object Arguments]","isUint8Array","maxContentLength","fineOrmTexture","emit","return this","exception","AssertionError","%RangeErrorPrototype%","sorted",'The "original" argument must be of type Function',"_view","configurable","exports","__proto__","transformRequest","transformResponse","modelMeshInstancesIndexDataView","forEach","valueOf","isNumber","%WeakMapPrototype%","_distance","bold","alloc","This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.",") and < 2 ** ","writeUint32BE","normalShadingSmooth","warn","floor","isUint32Array","String.prototype.slice","headers","adapter","disable","append","ucs-2","sharedMemoryDataView","env","[object GeneratorFunction]","%ObjectPrototype%","RenderShadow","onmessage",'" argument must be of type number. Received type ',"debuglog","notIdentical","Date","uniformState","equationAlpha","function* () {}",`#version 300 es\r precision highp float;\r \r uniform float clipPlane[81];\r \r in mediump float vDiscard;\r in float vModelId;\r in float vInstancesId;\r in vec3 vPositionW;\r in float clipReset[6];\r \r layout(location=0) out vec4 outFrag1;\r void main(void) {\r if ( vDiscard < 0.5){\r outFrag1 = vec4(0,0,0,1.0);\r discard;\r return;\r }else{\r int planeCount = int(abs(clipPlane[0]));\r if(planeCount != 0){\r int hitCount = 0;\r for (int i = 0; i < planeCount; i++){\r if(clipReset[i] > 0.){\r hitCount++;\r }\r }\r if(clipPlane[0] > 0.){\r if(hitCount == planeCount){\r discard;\r return;\r }\r }else{\r if(hitCount != planeCount){\r discard;\r return;\r }\r }\r }\r \r outFrag1 = vec4(vPositionW,1.0);\r }\r }`,"uPositionTextureSampler","offset","startsWith","an integer","SetModelExpressTypeTransform","InitModel","mixTexture","toArray"," and <= ","$external","count","uniformValue","outlineWidth","notDeepEqual","fileName","RangeError","ucs2","seen","validateStatus","%Int16ArrayPrototype%","_isPointLight","utf16le","uniformMatrix3fv","Int32Array","throwIfRequested","getParameter","ERR_INVALID_ARG_VALUE","ERR_DEPRECATED","bindTexture","signal","getOwnPropertyNames","Uint16Array",`#version 300 es\r \r \r precision highp float;\r precision highp int;\r precision highp usampler2D;\r \r uniform sampler2D uMixTextureSampler;\r uniform sampler2D uPositionTextureSampler;\r uniform sampler2D uInstancesIndexTextureSampler;\r uniform usampler2D uRenderIndexTextureSampler;\r \r uniform mat4 viewProjection;\r uniform mat4 view;\r uniform float clipPlane[81];\r uniform float near;\r uniform bool useLogDepth;\r \r out float v_depthFromNearPlusOne;\r out mediump float vDiscard;\r out float clipReset[6];\r out vec3 vPositionEye;\r \r ivec2 getTextureCoordinates(uint index, uint width)\r {\r uint y = index / width;\r uint x = index - width * y;\r if(x >= width){\r x = x - width;\r y += 1u;\r }\r return ivec2(x,y);\r }\r \r ivec2 getTextureCoordinates2(ivec2 coor, uint width)\r {\r if(coor.x >= int(width)){\r coor.x = coor.x - int(width);\r coor.y += 1;\r }\r return coor;\r }\r \r void main(void) {\r int texRenderIndexWidth = int(textureSize(uRenderIndexTextureSampler,0).x);\r int h = gl_VertexID / texRenderIndexWidth;\r int w = gl_VertexID - h * texRenderIndexWidth;\r uvec4 renderIndex = texelFetch(uRenderIndexTextureSampler,ivec2(w,h) ,0);\r // \u5982\u679CrenderIndex.w\u7B49\u4E8E0\u5219\u53EF\u4EE5\u653E\u5F03\u6267\u884C\r if(renderIndex.w == 0u){\r vDiscard = 0.0;\r }\r \r uint texPositionWidth = uint(textureSize(uPositionTextureSampler,0).x);\r ivec4 posIndex_Normal_Uv_Tangent = ivec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y + renderIndex.z,texPositionWidth),0));\r vec4 posMaterial = texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y - 1u,texPositionWidth),0);\r uint texInstancesIndexWidth = uint(textureSize(uInstancesIndexTextureSampler,0).x);\r ivec2 textureCoordinatesInstances = getTextureCoordinates(renderIndex.x,texInstancesIndexWidth);\r vec4 vI1 = texelFetch(uInstancesIndexTextureSampler, textureCoordinatesInstances,0);\r vec4 vI2 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+1,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI3 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+2,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI4 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+3,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI5 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+4,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r mat4 instanceMatrix = mat4(vec4(vI1.x,vI1.y,vI1.z,0.0),vec4(vI1.w,vI2.x,vI2.y,0.0),vec4(vI2.z,vI2.w,vI3.x,0.0),vec4(vI3.y,vI3.z,vI3.w,1.0));\r float vInstancesId = vI4.x;\r uint texMixWidth = uint(textureSize(uMixTextureSampler,0).x);\r \r ivec2 textureCoordinatesModelMatrixIndex = getTextureCoordinates(uint(vI4.z),texMixWidth);\r vec4 vM1 = texelFetch(uMixTextureSampler, textureCoordinatesModelMatrixIndex,0);\r vec4 vM2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+1,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vM3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+2,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vM4 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+3,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r mat4 modelMatrix = mat4(vM1,vM2,vM3,vM4);\r \r vec4 vM5 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vDiscard = min(vM5.x,vI4.w);\r float vModelId = vM5.y;\r \r if(vI5.y != 0.0 && vI5.z != 0.0){\r vec4 vMStorey = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+5+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+5+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r \r if(vI4.w != 3.0){\r if(vMStorey.x == 1.0 || vMExpressType.x == 1.0){\r vDiscard = 0.0;\r }\r }\r if(vMStorey.y == 1.0){\r vec4 vMStorey1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+6+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMStorey2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+7+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMStorey3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+8+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r instanceMatrix = mat4(vec4(vMStorey1.x,vMStorey1.y,vMStorey1.z,0.0),\r vec4(vMStorey1.w,vMStorey2.x,vMStorey2.y,0.0),\r vec4(vMStorey2.z,vMStorey2.w,vMStorey3.x,0.0),\r vec4(vMStorey3.y,vMStorey3.z,vMStorey3.w,1.0)) * instanceMatrix;\r }\r if(vMExpressType.y == 1.0){\r vec4 vMExpressType1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+6+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+7+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+8+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r instanceMatrix = mat4(vec4(vMExpressType1.x,vMExpressType1.y,vMExpressType1.z,0.0),\r vec4(vMExpressType1.w,vMExpressType2.x,vMExpressType2.y,0.0),\r vec4(vMExpressType2.z,vMExpressType2.w,vMExpressType3.x,0.0),\r vec4(vMExpressType3.y,vMExpressType3.z,vMExpressType3.w,1.0)) * instanceMatrix;\r }\r }\r \r \r vec3 posT = (instanceMatrix * vec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(uint(int(renderIndex.y) + posIndex_Normal_Uv_Tangent.x),texPositionWidth),0).xyz,1.)).xyz;\r vec4 worldPos = modelMatrix * vec4(posT, 1.0);\r vec3 vPositionW = worldPos.xyz;\r vPositionEye = (view * worldPos).xyz;\r gl_Position = viewProjection * worldPos;\r \r int planeCount = int(abs(clipPlane[0]));\r for (int i = 1,j = 0; i < planeCount * 4; i+=4,j++){\r clipReset[j] = dot(vec3(clipPlane[i],clipPlane[i+1],clipPlane[i+2]),vPositionW.xyz) + clipPlane[i+3];\r }\r if (useLogDepth) {\r v_depthFromNearPlusOne = (gl_Position.w - near) + 1.0;\r gl_Position.z = clamp(gl_Position.z / gl_Position.w, -1.0, 1.0) * gl_Position.w;\r }\r }`,"SetMaterialColor","_currentFramebuffer","blendFuncSeparate"," is outside of buffer bounds","rejects","./CimSDK/0b793bab624daa6d935e.js","worker","AxiosError","ceil","_cascadeSplits","Circular reference detected in ","set-cookie","[Circular]","ERR_MISSING_ARGS","expressTypeWeightsDataView","ERR_BAD_REQUEST","isAxiosError","push"," exists, but the property is not available.","bimSelect","userAgent",`\r precision highp float;\r \r uniform sampler2D colorTexture;\r uniform sampler2D selectTexture;\r uniform float outlineWidth;\r uniform vec4 outlineColor;\r uniform vec4 overlayColor;\r \r in vec2 v_textureCoordinates;\r \r \r layout(location=0) out vec4 outFrag1;\r void main(void)\r {\r vec4 orig_color = texture(colorTexture, v_textureCoordinates);\r vec4 select_color = texture(selectTexture, v_textureCoordinates);\r \r vec2 size = vec2(textureSize(selectTexture, 0));\r float dx = (1.0 / size.x) * outlineWidth;\r float dy = (1.0 / size.y) * outlineWidth;\r \r vec2 uvCenter = v_textureCoordinates;\r vec2 uvTop = vec2(uvCenter.x, uvCenter.y - dx);\r vec2 uvDown = vec2(uvCenter.x, uvCenter.y + dx);\r vec2 uvLeft = vec2(uvCenter.x - dx, uvCenter.y);\r vec2 uvRight = vec2(uvCenter.x + dx, uvCenter.y);\r // vec2 uvTopRight = vec2(uvCenter.x + dx, uvCenter.y - dx);\r // vec2 uvTopLeft = vec2(uvCenter.x - dx, uvCenter.y - dx);\r // vec2 uvDownRight = vec2(uvCenter.x + dx, uvCenter.y + dx);\r // vec2 uvDownLeft = vec2(uvCenter.x - dx, uvCenter.y + dx);\r \r float mCenter = texture(selectTexture, uvCenter).a;\r float mTop = texture(selectTexture, uvTop).a;\r float mDown = texture(selectTexture, uvDown).a;\r float mLeft = texture(selectTexture, uvLeft).a;\r float mRight = texture(selectTexture, uvRight).a;\r // float mTopRight = texture(selectTexture, uvTopRight).a;\r // float mTopLeft = texture(selectTexture, uvTopLeft).a;\r // float mDownRight = texture(selectTexture, uvDownRight).a;\r // float mDownLeft = texture(selectTexture, uvDownLeft).a;\r \r // float delta = (mTop + mDown + mLeft + mRight + mTopRight + mTopLeft + mDownRight + mDownLeft) / 8.0;\r float delta = (mTop + mDown + mLeft + mRight) / 4.0;\r \r if(mCenter > 0.5){\r float overlay_alpha = overlayColor.a;\r float orig_alpha = 1.0 - overlay_alpha;\r outFrag1 = vec4(select_color.r * overlay_alpha + orig_color.r * orig_alpha,\r select_color.g * overlay_alpha + orig_color.g * orig_alpha,\r select_color.b * overlay_alpha + orig_color.b * orig_alpha,\r orig_color.a);\r }else if(delta > 0.001){\r // vec4 outlineColor = vec4(1.0,1.0,1.0,0.8);\r float outline_alpha = outlineColor.a;\r float orig_alpha = 1.0 - outline_alpha;\r outFrag1 = vec4(outlineColor.r * outline_alpha + orig_color.r * orig_alpha,\r outlineColor.g * outline_alpha + orig_color.g * orig_alpha,\r outlineColor.b * outline_alpha + orig_color.b * orig_alpha,\r orig_color.a);\r }else{\r outFrag1 = orig_color;\r }\r }`,"toString","SetInstancesStatus","colors","[object Error]","far","viewProjectionMatrix","bind","colorMask","cacheCamera","isGeneratorObject","renderIndexProgram","$parent","1734943KrTeCO","uniformMatrix2x4fv","base intrinsic for ","common","__esModule","val must be string, number or Buffer","Cannot convert first argument to object","UpdatePositionTexture","function","uniformSetters","%JSONParse%","referer","divisor",'The "',"]: ","fill","blockNdx"," bytes",">= -(2","[native code]","has","getAllResponseHeaders","delete","_cameraUp","isDataView","readInt32LE","string","application/x-www-form-urlencoded","operator","number","undefined","WebGLTexture","getAttachedShaders","_shadowMapTexture","DEPTH_ATTACHMENT",` Error compiling `,"drawArrays","shadowMaps","RegExp","hasOwnProperty","source","password","%AsyncFunction%","out of range index",").constructor;","readInt16LE","%PromiseProto_then%","blendColor","dataLength","0x8000000000000000",'The "%s" argument is ambiguous. %s',"isMap","AsyncFunction","Aug","throwDeprecation","captureStackTrace","writeUint16BE",'The "value" argument must not be of type number. Received type number'," ** ","status","height","pixelStorei","framebufferRenderbuffer","texSubImage2D","swap16","%Promise_reject%","writable","POLYGON_OFFSET_FILL"," in ","_shadowMapCamera","location","view","MarkShell",'"length" is outside of buffer bounds',"write","fun","responseEncoding","$innerWidth","<Buffer ","FRAGMENT_SHADER","LN2","uniformMatrix2x3fv","$console","(((.+)+)+)+$","byteOffset","subarray","diffuse","uniform1ui","useLogDepth","nodejs.util.inspect.custom","doesNotThrow","process.chdir is not supported","DetectVisibleInstances","usedByFragmentShader","expires","VERTEX_SHADER","writeBigUInt64LE","...","writeFloatLE","timeout of ","SetLightData","latin1","format","shadowMap_lightPositionEC","XSRF-TOKEN","ERR_CANCELED","renderIdProgram","Uint32Array","breakLength","compare","SetModelTransform","spread","Invalid attempt to destructure non-iterable instance","Float32Array","filter","default","UNIFORM_TYPE","%ObjProto_toString%","all_vertices_num","toByteArray","[object Set]","writeUInt8","readInt16BE","isBlob","Unknown encoding: ","parent","attributes","request"," Lines skipped","abort"," and < 2","RGBA32F","Fine","BigInt64Array","stderr","PickWorldPosition","_enabled","viewShedState","responseText","uInstancesIndexTextureSampler","isBigInt64Array","polygonOffset","Jun","throws","The length of an unsigned integer constant value must be 4!","bindBuffer","special","finish","[0]","Buffer size must be a multiple of 32-bits","expressTypeVisibleDistanceArrayBuff","attributeOldValue","strictEqual","onabort","DEP0094","bindSampler","host","The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ","getProgramParameter","isBooleanObject","projectionMatrix","size","readBigInt64BE","UNPACK_FLIP_Y_WEBGL",'The "util.promisify.custom" argument must be of type Function',"[Object]","\\$&","timeout exceeded","versions","INSPECT_MAX_BYTES","working","AngularLinesProcess","%Generator%","writeDoubleLE","NODE_DEBUG","isStream","magenta","_entireFrustum","depthTest","response",'Expected "actual" to be strictly unequal to:',"[object AsyncFunction]","getProgramInfoLog","functionDestinationAlpha","[object Generator]",`#version 300 es\r \r precision highp float;\r precision highp int;\r precision highp usampler2D;\r layout (std140, column_major) uniform;\r uniform sampler2D uMixTextureSampler;\r uniform sampler2D uPositionTextureSampler;\r uniform sampler2D uInstancesIndexTextureSampler;\r uniform usampler2D uRenderIndexTextureSampler;\r \r uniform mat4 viewProjection;\r uniform mat4 view;\r uniform float clipPlane[81];\r uniform float near;\r uniform bool useLogDepth;\r \r out float v_depthFromNearPlusOne;\r out float vBlur;\r out vec4 vColorBase;\r out float clipReset[6];\r out vec2 vMainUV1;\r out vec3 vPositionW;\r out vec3 vPositionEye;\r out vec3 vNormalEye;\r out vec3 vNormalW;\r out mat3 vTBN;\r out mediump vec4 vTexIndex;\r out mediump float vDiscard;\r \r ivec2 getTextureCoordinates(uint index, uint width) {\r uint y = index / width;\r uint x = index - width * y;\r if (x >= width) {\r x = x - width;\r y += 1u;\r }\r return ivec2(x, y);\r }\r ivec2 getTextureCoordinates2(ivec2 coor, uint width) {\r if (coor.x >= int(width)) {\r coor.x = coor.x - int(width);\r coor.y += 1;\r }\r return coor;\r }\r void main(void) {\r int texRenderIndexWidth = int(textureSize(uRenderIndexTextureSampler, 0).x);\r int h = gl_VertexID / texRenderIndexWidth;\r int w = gl_VertexID - h * texRenderIndexWidth;\r uvec4 renderIndex = texelFetch(uRenderIndexTextureSampler, ivec2(w, h), 0);\r // \u5982\u679CrenderIndex.w\u7B49\u4E8E0\u5219\u53EF\u4EE5\u653E\u5F03\u6267\u884C\r \r if (renderIndex.w == 0u) {\r vDiscard = 0.0;\r }\r uint texPositionWidth = uint(textureSize(uPositionTextureSampler, 0).x);\r ivec4 posIndex_Normal_Uv_Tangent = ivec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y + renderIndex.z, texPositionWidth), 0));\r vec4 posMaterial = texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y - 1u, texPositionWidth), 0);\r uint texInstancesIndexWidth = uint(textureSize(uInstancesIndexTextureSampler, 0).x);\r ivec2 textureCoordinatesInstances = getTextureCoordinates(renderIndex.x, texInstancesIndexWidth);\r vec4 vI1 = texelFetch(uInstancesIndexTextureSampler, textureCoordinatesInstances, 0);\r vec4 vI2 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x + 1, textureCoordinatesInstances.y), texInstancesIndexWidth), 0);\r vec4 vI3 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x + 2, textureCoordinatesInstances.y), texInstancesIndexWidth), 0);\r vec4 vI4 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x + 3, textureCoordinatesInstances.y), texInstancesIndexWidth), 0);\r vec4 vI5 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x + 4, textureCoordinatesInstances.y), texInstancesIndexWidth), 0);\r mat4 instanceMatrix = mat4(vec4(vI1.x, vI1.y, vI1.z, 0.0), vec4(vI1.w, vI2.x, vI2.y, 0.0), vec4(vI2.z, vI2.w, vI3.x, 0.0), vec4(vI3.y, vI3.z, vI3.w, 1.0));\r uint texMixWidth = uint(textureSize(uMixTextureSampler, 0).x);\r ivec2 materialCoordinatesMaterial = getTextureCoordinates(uint(posMaterial.x), texMixWidth);\r vColorBase = texelFetch(uMixTextureSampler, materialCoordinatesMaterial, 0);\r vTexIndex = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(materialCoordinatesMaterial.x + 1, materialCoordinatesMaterial.y), texMixWidth), 0);\r ivec2 textureCoordinatesModelMatrixIndex = getTextureCoordinates(uint(vI4.z), texMixWidth);\r vec4 vM1 = texelFetch(uMixTextureSampler, textureCoordinatesModelMatrixIndex, 0);\r vec4 vM2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 1, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r vec4 vM3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 2, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r vec4 vM4 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 3, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r mat4 modelMatrix = mat4(vM1, vM2, vM3, vM4);\r vec4 vM5 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 4, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r vDiscard = min(vM5.x, vI4.w);\r if (vI5.y != 0.0 && vI5.z != 0.0) {\r vec4 vMStorey = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 5 + int(vI5.y) * 4, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r vec4 vMExpressType = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 5 + int(vI5.z) * 4 + 400, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r if (vI4.w != 3.0) {\r if (vMStorey.x == 1.0 || vMExpressType.x == 1.0) {\r vDiscard = 0.0;\r }\r else if (vMStorey.x == 2.0 || vMExpressType.x == 2.0) {\r vBlur = 1.0;\r }\r \r }\r if (vMStorey.y == 1.0) {\r vec4 vMStorey1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 6 + int(vI5.y) * 4, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r vec4 vMStorey2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 7 + int(vI5.y) * 4, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r vec4 vMStorey3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 8 + int(vI5.y) * 4, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r instanceMatrix = mat4(vec4(vMStorey1.x, vMStorey1.y, vMStorey1.z, 0.0), vec4(vMStorey1.w, vMStorey2.x, vMStorey2.y, 0.0), vec4(vMStorey2.z, vMStorey2.w, vMStorey3.x, 0.0), vec4(vMStorey3.y, vMStorey3.z, vMStorey3.w, 1.0)) * instanceMatrix;\r }\r if (vMExpressType.y == 1.0) {\r vec4 vMExpressType1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 6 + int(vI5.z) * 4 + 400, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r vec4 vMExpressType2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 7 + int(vI5.z) * 4 + 400, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r vec4 vMExpressType3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x + 8 + int(vI5.z) * 4 + 400, textureCoordinatesModelMatrixIndex.y), texMixWidth), 0);\r instanceMatrix = mat4(vec4(vMExpressType1.x, vMExpressType1.y, vMExpressType1.z, 0.0), vec4(vMExpressType1.w, vMExpressType2.x, vMExpressType2.y, 0.0), vec4(vMExpressType2.z, vMExpressType2.w, vMExpressType3.x, 0.0), vec4(vMExpressType3.y, vMExpressType3.z, vMExpressType3.w, 1.0)) * instanceMatrix;\r }\r \r }\r vec3 positionUpdated = vec3(0.0, 0.0, 0.0);\r vec3 normalUpdated = vec3(0.0, 0.0, 0.0);\r vec4 tangentUpdated = vec4(0.0, 0.0, 0.0, 0.0);\r vec3 posT = (instanceMatrix * vec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(uint(int(renderIndex.y) + posIndex_Normal_Uv_Tangent.x), texPositionWidth), 0).xyz, 1.)).xyz;\r positionUpdated = posT;\r vec3 normalT = (mat3(instanceMatrix) * texelFetch(uPositionTextureSampler, getTextureCoordinates(uint(int(renderIndex.y) + posIndex_Normal_Uv_Tangent.y), texPositionWidth), 0).xyz);\r normalUpdated = normalT;\r vec3 tangentT = (mat3(instanceMatrix) * texelFetch(uPositionTextureSampler, getTextureCoordinates(uint(int(renderIndex.y) + posIndex_Normal_Uv_Tangent.w), texPositionWidth), 0).xyz);\r tangentUpdated = vec4(tangentT, 1.0);\r mat4 finalWorld = modelMatrix;\r vec4 worldPos = finalWorld * vec4(positionUpdated, 1.0);\r mat3 normalWorld = mat3(finalWorld);\r vNormalW = normalize(normalWorld * normalUpdated);\r vPositionW = vec3(worldPos);\r vPositionEye = (view * worldPos).xyz;\r vNormalEye = mat3(view) * vNormalW;\r vec3 tbnNormal = normalize(normalUpdated);\r vec3 tbnTangent = normalize(tangentUpdated.xyz);\r vec3 tbnBitangent = cross(tbnNormal, tbnTangent) * tangentUpdated.w;\r vTBN = mat3(finalWorld) * mat3(tbnTangent, tbnBitangent, tbnNormal);\r vMainUV1 = texelFetch(uPositionTextureSampler, getTextureCoordinates(uint(int(renderIndex.y) + posIndex_Normal_Uv_Tangent.z), texPositionWidth), 0).xy;\r int planeCount = int(abs(clipPlane[0]));\r for (int i = 1, j = 0; i < planeCount * 4; i += 4, j++) {\r clipReset[j] = dot(vec3(clipPlane[i], clipPlane[i + 1], clipPlane[i + 2]), vPositionW.xyz) + clipPlane[i + 3];\r }\r gl_Position = viewProjection * worldPos;\r if (useLogDepth) {\r v_depthFromNearPlusOne = (gl_Position.w - near) + 1.0;\r gl_Position.z = clamp(gl_Position.z / gl_Position.w, -1.0, 1.0) * gl_Position.w;\r }\r }\r `,"promisify","log","deleteProgram","_texture","texture"," ... ","deepStrictEqual","pathname","_projection","softShadows","indexOf","TypeError","createShader","property","texParameteri","grey","substr","MAX_VERTEX_TEXTURE_IMAGE_UNITS","renderColorProgram","enable","COLOR_BUFFER_BIT","read","Promise was rejected with a falsy value","timeoutMessage","readUint16BE","bar","writeUInt32LE","authorization","Error","color","console","now","black","Authorization","readFloatLE","shadowMap_matrix",". Received type ","Expected ","clipPlane","setRequestHeader","isSymbolObject","ArrayBuffer","getMonth","Axios","READ_FRAMEBUFFER","fromCharCode","compressedTexSubImage2D","isBigUint64Array","uRenderIndexTextureSampler","substring","renderInstancesDataBuffer","this hasn't been initialised - super() hasn't been called","] Transitional option '","isFormData","exec","Uint8Array","auth","modelComponentAttributeArrayBuff",'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array',"BigInt not supported","scene","showProxy","renderState","SyntaxError","UNIFORM_BLOCK_INDEX","toISOString","customInspect","%s - %s","COLOR_ATTACHMENT0","hash","inherits","ERR_INVALID_RETURN_VALUE","dir","readUint8","(^|;\\s*)(","%ArrayProto_entries%","types","Map","allocUnsafeSlow","instance of ","bindAttribLocation","%StringPrototype%","listeners","meshInstancesDataView","post","put","Buffer size must be a multiple of 64-bits","modifyMemoryMixDataView","silentJSONParsing","shadowMapEnable","Cesium","$scrollY","bindRenderbuffer","callback","isNull","drawingBufferWidth","renderbufferStorage","canvas","version","withCredentials","emitWarning","0123456789abcdef","27197937hYzYfx","$scrollLeft","%ArrayProto_values%","%Object.getOwnPropertyDescriptor%","The ","umask","getTransformFeedbackVarying","TEXTURE15","[object Map Iterator]"," has been deprecated since v","xsrfCookieName","yellow","create","Argument must be a Buffer","error","$1 ","fulfilled","%Promise_all%","instancesIndexTextureDefaultLength","ERR_OUT_OF_RANGE","normalize","propertyIsEnumerable","setter","$onmozfullscreenerror","binary","%Function.prototype.call%","isBuffer",".prototype.","gl_","clearShellUrl","title","isFloat64Array","_listeners","concat","UNSIGNED_BYTE","attributeFilter","RenderId","GetInstancesBox","TypedArray","isSharedArrayBuffer","blending","charCodeAt","UpdateRenderIndexTexture","ResetTexture","$window","resize","[object WebAssembly.Module]","Object","getAttribLocation","_cameraDirection","[object WeakMap]","ERR_BAD_OPTION","UpdateTextureTexture","readBigInt64LE","overlayColor","supportsDescriptors"," It must be ","AsyncGeneratorFunction","canceled","Trying to access beyond buffer length","boolean",`#version 300 es\r \r precision highp float;\r precision highp int;\r precision highp usampler2D;\r \r uniform sampler2D uMixTextureSampler;\r uniform sampler2D uPositionTextureSampler;\r uniform sampler2D uInstancesIndexTextureSampler;\r uniform usampler2D uRenderIndexTextureSampler;\r uniform mat4 viewProjection;\r uniform vec4 overlayColor;\r uniform float clipPlane[81];\r \r \r out float clipReset[6];\r out vec4 vColorBase;\r out mediump float vDiscard;\r \r ivec2 getTextureCoordinates(uint index, uint width)\r {\r uint y = index / width;\r uint x = index - width * y;\r if(x >= width){\r x = x - width;\r y += 1u;\r }\r return ivec2(x,y);\r }\r \r ivec2 getTextureCoordinates2(ivec2 coor, uint width)\r {\r if(coor.x >= int(width)){\r coor.x = coor.x - int(width);\r coor.y += 1;\r }\r return coor;\r }\r \r \r void main(void) {\r \r int texRenderIndexWidth = int(textureSize(uRenderIndexTextureSampler,0).x);\r int h = gl_VertexID / texRenderIndexWidth;\r int w = gl_VertexID - h * texRenderIndexWidth;\r uvec4 renderIndex = texelFetch(uRenderIndexTextureSampler,ivec2(w,h) ,0);\r // \u5982\u679CrenderIndex.w\u7B49\u4E8E0\u5219\u53EF\u4EE5\u653E\u5F03\u6267\u884C\r if(renderIndex.w == 0u){\r vDiscard = 0.0;\r }\r \r uint texPositionWidth = uint(textureSize(uPositionTextureSampler,0).x);\r ivec4 posIndex_Normal_Uv_Tangent = ivec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y + renderIndex.z,texPositionWidth),0));\r vec4 posMaterial = texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y - 1u,texPositionWidth),0);\r uint texInstancesIndexWidth = uint(textureSize(uInstancesIndexTextureSampler,0).x);\r ivec2 textureCoordinatesInstances = getTextureCoordinates(renderIndex.x,texInstancesIndexWidth);\r vec4 vI1 = texelFetch(uInstancesIndexTextureSampler, textureCoordinatesInstances,0);\r vec4 vI2 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+1,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI3 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+2,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI4 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+3,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r if(vI4.w != 2.0 && vI4.w != 4.0){\r vDiscard = 0.0;\r return;\r }\r \r vec4 vI5 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+4,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r mat4 instanceMatrix = mat4(vec4(vI1.x,vI1.y,vI1.z,0.0),vec4(vI1.w,vI2.x,vI2.y,0.0),vec4(vI2.z,vI2.w,vI3.x,0.0),vec4(vI3.y,vI3.z,vI3.w,1.0));\r \r uint texMixWidth = uint(textureSize(uMixTextureSampler,0).x);\r if(vI4.w == 2.0){\r vColorBase = vec4(overlayColor.rgb,1.0);\r }else{\r ivec2 materialCoordinatesMaterial = getTextureCoordinates(uint(posMaterial.x),texMixWidth);\r vColorBase = texelFetch(uMixTextureSampler, materialCoordinatesMaterial,0);\r }\r \r ivec2 textureCoordinatesModelMatrixIndex = getTextureCoordinates(uint(vI4.z),texMixWidth);\r vec4 vM1 = texelFetch(uMixTextureSampler, textureCoordinatesModelMatrixIndex,0);\r vec4 vM2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+1,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vM3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+2,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vM4 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+3,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r mat4 modelMatrix = mat4(vM1,vM2,vM3,vM4);\r \r vec4 vM5 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vDiscard = min(vM5.x,vI4.w);\r \r \r if(vI5.y != 0.0 && vI5.z != 0.0){\r vec4 vMStorey = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+5+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+5+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r \r if(vI4.w != 3.0){\r if(vMStorey.x == 1.0 || vMExpressType.x == 1.0){\r vDiscard = 0.0;\r }\r }\r if(vMStorey.y == 1.0){\r vec4 vMStorey1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+6+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMStorey2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+7+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMStorey3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+8+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r instanceMatrix = mat4(vec4(vMStorey1.x,vMStorey1.y,vMStorey1.z,0.0),\r vec4(vMStorey1.w,vMStorey2.x,vMStorey2.y,0.0),\r vec4(vMStorey2.z,vMStorey2.w,vMStorey3.x,0.0),\r vec4(vMStorey3.y,vMStorey3.z,vMStorey3.w,1.0)) * instanceMatrix;\r }\r if(vMExpressType.y == 1.0){\r vec4 vMExpressType1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+6+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+7+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+8+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r instanceMatrix = mat4(vec4(vMExpressType1.x,vMExpressType1.y,vMExpressType1.z,0.0),\r vec4(vMExpressType1.w,vMExpressType2.x,vMExpressType2.y,0.0),\r vec4(vMExpressType2.z,vMExpressType2.w,vMExpressType3.x,0.0),\r vec4(vMExpressType3.y,vMExpressType3.z,vMExpressType3.w,1.0)) * instanceMatrix;\r }\r }\r \r \r vec3 posT = (instanceMatrix * vec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(uint(int(renderIndex.y) + posIndex_Normal_Uv_Tangent.x),texPositionWidth),0).xyz,1.)).xyz;\r \r vec3 vPositionW = vec3(modelMatrix * vec4(posT, 1.0));\r gl_Position = viewProjection * vec4(vPositionW.xyz, 1.0);\r \r int planeCount = int(abs(clipPlane[0]));\r for (int i = 1,j = 0; i < planeCount * 4; i+=4,j++){\r clipReset[j] = dot(vec3(clipPlane[i],clipPlane[i+1],clipPlane[i+2]),vPositionW.xyz) + clipPlane[i+3];\r }\r \r }\r `,"uLightDirection","buffer","%WeakSetPrototype%","getUniformBlockIndex","[object ArrayBuffer]","Expected values to be loosely equal:","Request aborted","sharedMemoryDataBuffer","6401","Init","createFramebuffer","getExtension","lineNumber","isCancel","_lightPositionEC","allocUnsafe","numColorComponents",'"list" argument must be an Array of Buffers',"$pageYOffset","BLEND","sunHemisphericLight","OnInitialized","SetModelStoreyTransform","return function (","viewProjection","ECONNABORTED","once","msgType","shadowMap_lightType","uniformMatrix3x4fv","search","fine","vertexAttrib2fv","meshDataView","The length of an integer constant value must be 4!","set","stack","clipPlaneTransform","toUTCString","return","writeUInt32BE","isWebAssemblyCompiledModule",`#version 300 es\r \r \r precision highp float;\r precision highp int;\r precision highp usampler2D;\r \r uniform sampler2D uMixTextureSampler;\r uniform sampler2D uPositionTextureSampler;\r uniform sampler2D uInstancesIndexTextureSampler;\r uniform usampler2D uRenderIndexTextureSampler;\r uniform mat4 viewProjection;\r uniform float clipPlane[81];\r \r out mediump float vDiscard;\r out float vModelId;\r out float vInstancesId;\r out vec3 vPositionW;\r out float clipReset[6];\r \r \r ivec2 getTextureCoordinates(uint index, uint width)\r {\r uint y = index / width;\r uint x = index - width * y;\r if(x >= width){\r x = x - width;\r y += 1u;\r }\r return ivec2(x,y);\r }\r \r ivec2 getTextureCoordinates2(ivec2 coor, uint width)\r {\r if(coor.x >= int(width)){\r coor.x = coor.x - int(width);\r coor.y += 1;\r }\r return coor;\r }\r \r void main(void) {\r int texRenderIndexWidth = int(textureSize(uRenderIndexTextureSampler,0).x);\r int h = gl_VertexID / texRenderIndexWidth;\r int w = gl_VertexID - h * texRenderIndexWidth;\r uvec4 renderIndex = texelFetch(uRenderIndexTextureSampler,ivec2(w,h) ,0);\r // \u5982\u679CrenderIndex.w\u7B49\u4E8E0\u5219\u53EF\u4EE5\u653E\u5F03\u6267\u884C\r if(renderIndex.w == 0u){\r vDiscard = 0.0;\r }\r \r uint texPositionWidth = uint(textureSize(uPositionTextureSampler,0).x);\r ivec4 posIndex_Normal_Uv_Tangent = ivec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y + renderIndex.z,texPositionWidth),0));\r vec4 posMaterial = texelFetch(uPositionTextureSampler, getTextureCoordinates(renderIndex.y - 1u,texPositionWidth),0);\r uint texInstancesIndexWidth = uint(textureSize(uInstancesIndexTextureSampler,0).x);\r ivec2 textureCoordinatesInstances = getTextureCoordinates(renderIndex.x,texInstancesIndexWidth);\r vec4 vI1 = texelFetch(uInstancesIndexTextureSampler, textureCoordinatesInstances,0);\r vec4 vI2 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+1,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI3 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+2,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI4 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+3,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r vec4 vI5 = texelFetch(uInstancesIndexTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesInstances.x+4,textureCoordinatesInstances.y),texInstancesIndexWidth),0);\r mat4 instanceMatrix = mat4(vec4(vI1.x,vI1.y,vI1.z,0.0),vec4(vI1.w,vI2.x,vI2.y,0.0),vec4(vI2.z,vI2.w,vI3.x,0.0),vec4(vI3.y,vI3.z,vI3.w,1.0));\r vInstancesId = vI4.x;\r uint texMixWidth = uint(textureSize(uMixTextureSampler,0).x);\r \r ivec2 textureCoordinatesModelMatrixIndex = getTextureCoordinates(uint(vI4.z),texMixWidth);\r vec4 vM1 = texelFetch(uMixTextureSampler, textureCoordinatesModelMatrixIndex,0);\r vec4 vM2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+1,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vM3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+2,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vM4 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+3,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r mat4 modelMatrix = mat4(vM1,vM2,vM3,vM4);\r \r vec4 vM5 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vDiscard = min(vM5.x,vI4.w);\r vModelId = vM5.y;\r \r if(vI5.y != 0.0 && vI5.z != 0.0){\r vec4 vMStorey = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+5+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+5+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r \r if(vI4.w != 3.0){\r if(vMStorey.x == 1.0 || vMExpressType.x == 1.0){\r vDiscard = 0.0;\r }\r }\r if(vMStorey.y == 1.0){\r vec4 vMStorey1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+6+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMStorey2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+7+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMStorey3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+8+int(vI5.y)*4,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r instanceMatrix = mat4(vec4(vMStorey1.x,vMStorey1.y,vMStorey1.z,0.0),\r vec4(vMStorey1.w,vMStorey2.x,vMStorey2.y,0.0),\r vec4(vMStorey2.z,vMStorey2.w,vMStorey3.x,0.0),\r vec4(vMStorey3.y,vMStorey3.z,vMStorey3.w,1.0)) * instanceMatrix;\r }\r if(vMExpressType.y == 1.0){\r vec4 vMExpressType1 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+6+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType2 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+7+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r vec4 vMExpressType3 = texelFetch(uMixTextureSampler, getTextureCoordinates2(ivec2(textureCoordinatesModelMatrixIndex.x+8+int(vI5.z)*4+400,textureCoordinatesModelMatrixIndex.y),texMixWidth),0);\r instanceMatrix = mat4(vec4(vMExpressType1.x,vMExpressType1.y,vMExpressType1.z,0.0),\r vec4(vMExpressType1.w,vMExpressType2.x,vMExpressType2.y,0.0),\r vec4(vMExpressType2.z,vMExpressType2.w,vMExpressType3.x,0.0),\r vec4(vMExpressType3.y,vMExpressType3.z,vMExpressType3.w,1.0)) * instanceMatrix;\r }\r }\r \r \r vec3 posT = (instanceMatrix * vec4(texelFetch(uPositionTextureSampler, getTextureCoordinates(uint(int(renderIndex.y) + posIndex_Normal_Uv_Tangent.x),texPositionWidth),0).xyz,1.)).xyz;\r vPositionW = vec3(modelMatrix * vec4(posT, 1.0));\r gl_Position = viewProjection * vec4(vPositionW.xyz, 1.0);\r \r int planeCount = int(abs(clipPlane[0]));\r for (int i = 1,j = 0; i < planeCount * 4; i+=4,j++){\r clipReset[j] = dot(vec3(clipPlane[i],clipPlane[i+1],clipPlane[i+2]),vPositionW.xyz) + clipPlane[i+3];\r }\r }`,"uniform3iv","prototype","type ",` ^^^ `,"getAllIdData","isFloat32Array","DEPTH_BUFFER_BIT",'" is invalid for option "size"',"%DataViewPrototype%","remove","ids","%Float64ArrayPrototype%","RGBA32UI","oneOverLog2FarDepthFromNearPlusOne","handlers","synchronous","instancesIndexTexture","uniformMatrix3x2fv","\x1B[39m","ONE_MINUS_SRC_ALPHA","addListener","CanceledError","SetComponentTransform","GeneratorFunction","clarifyTimeoutError","SetComponentMaterialId","FLOAT","PickId","SetSelectColor","shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness","- expected","%SharedArrayBufferPrototype%","beforeRedirect","$self","depthFunc","_pointBias","onDownloadProgress","timeoutErrorMessage","[object Object]","uniform1i","saveShellUrl","$outerWidth","framebuffer","isStringObject","file","aborted","of ","notStrictEqualObject","RenderSelect","vertexAttrib3fv","getActiveUniforms","isProxy","1730ilDdKp","writeUint16LE","assertOptions","must be","%AsyncGeneratorFunction%","modifyMemoryPositionDataView","readDoubleLE"," [Function","generatedMessage","%FunctionPrototype%","toFormData","swap32","getTime","offset is not uint","opaque_vertices_num","run","href"," must be "];return Nue=function(){return o},Nue()}function H3e(o,f,m){this._earthCtrl=o,this._coreMap=o.coreMap,this.bimModel=f,this.plane1Entity=null,this.position=Z(m.position,null),this.clippingBox=Z(m.clippingBox,{x:120,y:120}),this.clipPlan1=null,this.createClipping()}H3e.prototype.createClipping=function(){let o=this;o.plane1Entity&&o._earthCtrl.entities.remove(o.plane1Entity);let f=H.fromDegrees(o.position.lon,o.position.lat,o.position.height),m=tn.eastNorthUpToFixedFrame(f);m=Ee.toArray(m);let v=20;function y(E){return function(){return E.distance=v,E}}o.clipPlan1=new zv(new H(0,0,-1),0),o.plane1Entity=o._earthCtrl.entities.add({position:f,plane:{dimensions:new Ye(o.clippingBox.x,o.clippingBox.y),material:Re.WHITE.withAlpha(.3),plane:new xn(function(){return o.clipPlan1.distance=v,o.clipPlan1},!1),outline:!1,outlineColor:Re.WHITE}}),o.bimModel.SetClipPlane(m,!1,[0,0,1,-v]);let x=null;new Ur(o._coreMap.scene.canvas).setInputAction(function(E){let T=o._coreMap.scene.pick(E.position);N(T)&&N(T.id)&&N(T.id.plane)&&(x=T.id.plane,x.material=Re.WHITE.withAlpha(.2),x.outlineColor=Re.WHITE,o._coreMap.scene.screenSpaceCameraController.enableInputs=!1)},Ei.LEFT_DOWN),new Ur(o._coreMap.scene.canvas).setInputAction(function(){N(x)&&(x.material=Re.WHITE.withAlpha(.1),x.outlineColor=Re.WHITE,x=void 0),o._coreMap.scene.screenSpaceCameraController.enableInputs=!0},Ei.LEFT_UP),new Ur(o._coreMap.scene.canvas).setInputAction(function(E){if(N(x)){let T=E.startPosition.y-E.endPosition.y;v+=T*.1,v<0&&(v=1),o.bimModel.SetClipPlane(m,!1,[0,0,1,-v])}},Ei.MOUSE_MOVE)};H3e.prototype.removeFromMap=function(){let o=this;o.plane1Entity&&(o._earthCtrl.entities.remove(o.plane1Entity),o.clipPlan1=null),o.bimModel&&o.bimModel.SetClipPlane()};var Rmt=H3e;function hG(o={},f,m){this._earthCtrl=f||window.earthCtrl,this._Geoworld=m||window.SmartEarth,this._coreMap=this._earthCtrl.coreMap,this.bimModel=o.bim||this._earthCtrl.coreMap.scene.bim,this.leftHandler=void 0,this.rightHandler=void 0,this.componentIdArr=[],this.showComponentArr=[],this.selectPosition=null,this.leftClick(),this.rightClick()}hG.prototype.start=function(){};hG.prototype.leftClick=function(){let o=this,f=this._Geoworld,m=this._coreMap;o.leftHandler=new f.ScreenSpaceEventHandler(m.canvas),o.leftHandler.setInputAction(function(y){o.bimModel.PickId(y.position.x,y.position.y).then(x=>{let C=x[0],w=x[1],A=x[2],E=new Int32Array([C,A]);o.bimModel.SetComponentStatus(2,E,!1),o.componentIdArr.push(A),o.showComponentArr.push(C,A)})},f.ScreenSpaceEventType.LEFT_CLICK)};hG.prototype.rightClick=function(){let o=this,f=this._Geoworld,m=this._coreMap;m.scene.screenSpaceCameraController.zoomEventTypes=[f.ScreenSpaceEventType.LEFT_DOUBLE_CLICK],m.scene.screenSpaceCameraController.lookEventTypes={eventType:f.CameraEventType.LEFT_DRAG,modifier:f.KeyboardEventModifier.SHIFT};let v=!1,y=null,x=null,C=null,w=null,A=document.createElement("div");o.rightHandler=new f.ScreenSpaceEventHandler(m.canvas),o.rightHandler.setInputAction(function(E){v=!0,y=E.position.x,x=E.position.y,A.style.cssText="position:absolute;width:0px;height:0px;font-size:0px;margin:0px;padding:0px;border:1px dashed #0099FF;background-color:#C3D5ED;z-index:1000;filter:alpha(opacity:30);opacity:0.3;",A.id="selectDiv",A.style.left=`${y}px`,A.style.top=`${x}px`,m.container.appendChild(A)},f.ScreenSpaceEventType.RIGHT_DOWN),o.rightHandler.setInputAction(function(E){v=!1,o.rightSelect(o.selectPosition),document.getElementById("selectDiv").parentNode.removeChild(document.getElementById("selectDiv"))},f.ScreenSpaceEventType.RIGHT_UP),o.rightHandler.setInputAction(function(E){v&&(C=E.endPosition.x,w=E.endPosition.y,A.style.left=`${Math.min(C,y)}px`,A.style.top=`${Math.min(w,x)}px`,A.style.width=`${Math.abs(C-y)}px`,A.style.height=`${Math.abs(w-x)}px`,o.selectPosition={sx:y,sy:x,ex:C,ey:w})},f.ScreenSpaceEventType.MOUSE_MOVE)};hG.prototype.rightSelect=function(o){if(!o)return;let f=this;f.bimModel.FrameSelection(o.sx,o.sy,o.ex,o.ey).then(m=>{let v=[];for(let x=0;x<m.length;x+=3)v.push(m[x],m[x+1]),f.componentIdArr.push(m[x+1]);f.componentIdArr=[...new Set(f.componentIdArr)],f.showComponentArr=[...f.showComponentArr,...v];let y=new Int32Array(v);f.bimModel.SetComponentStatus(2,y,!1)})};hG.prototype.removeFromMap=function(){if(this.componentIdArr=[],this.showComponentArr.length>0){let o=new Int32Array(this.showComponentArr);this.bimModel.SetComponentStatus(1,o,!1)}this.leftHandler&&(this.leftHandler.destroy(),this.leftHandler=void 0),this.rightHandler&&(this.rightHandler.destroy(),this.rightHandler=void 0)};var Omt=hG;function U3e(o,f){this._earthCtrl=f||window.earthCtrl,this._Geoworld=qi||window.Cesium,this._coreMap=this._earthCtrl.coreMap,this.bimModel=o.bim||this._earthCtrl.coreMap.scene.bim,this.modelId=o.modelId||1,this.storeyId=o.storeyId||1,this.direction=o.direction||"y",this.distance=o.distance||22,this.start()}U3e.prototype.start=function(){let o=this,f=this._Geoworld,m=this.bimModel,v=(y,x,C)=>{m.SetModelStoreyTransform(this.modelId,this.storeyId,f.Matrix4.toArray(f.Matrix4.fromTranslation(new f.Cartesian3(y,x,C)))),x<o.distance&&setTimeout(()=>{o.direction==="x"?v(y+1,x,C):o.direction==="y"?v(y,x+1,C):o.direction==="z"&&v(y,x,C+1)},30)};v(0,0,0)};U3e.prototype.removeFromMap=function(){let o=this._Geoworld;this.bimModel.SetModelStoreyTransform(this.modelId,this.storeyId,o.Matrix4.toArray(o.Matrix4.fromTranslation(new o.Cartesian3(0,0,0))))};var Nmt=U3e;function HC(o,f,m){this._earthCtrl=f||window.earthCtrl,this._Cesium=m||window.SmartEarth,this._coreMap=this._earthCtrl.coreMap,this.bimModel=o?.bim||this._earthCtrl.coreMap.scene.bim}HC.prototype.getMaterial=function(o,f,m){this.bimModel.GetMaterial(o,f).then(v=>{m&&m(v)})};HC.prototype.getTextureList=async function(o){let f=[],m=`${globalThis.GEOWORLD_BASE_URL}/Assets/Textures/PBRRepo/texture.json`,y=await(await fetch(m)).json();if(Object.keys(y).length)for(let x of y)x.preview=encodeURI(x.preview),x.imgSrc=`${globalThis.GEOWORLD_BASE_URL}./Assets/Textures/PBRRepo/${x.preview}`,f.push(x);o&&o(f)};HC.prototype.createMaterial=function(o,f){let m=[];o.color?m.push(o.color.red,o.color.green,o.color.blue,o.color.alpha):m=[1,1,1,1],this.bimModel.CreateMaterial(o.modelId,m).then(v=>{f&&f(v)})};HC.prototype.cancelMaterialEdit=function(o){this.bimModel.CancelMaterialEdit(o.modelId)};HC.prototype.setMaterialTexture=function(o){this.bimModel.SetMaterialTexture(o.modelId,o.materialId,o.textureId)};HC.prototype.setMaterialColor=function(o){let f=[];o.color?f.push(o.color.red,o.color.green,o.color.blue,o.color.alpha):f=[1,1,1,1],this.bimModel.SetMaterialColor(o.modelId,o.materialId,f)};HC.prototype.setComponentMaterial=function(o){this.bimModel.SetComponentMaterialId(o.modelId,o.materialId,new Int32Array(o.idArr))};HC.prototype.getComponentMaterialId=function(o,f){this.bimModel.GetComponentMaterialId(o.modelId,o.componentId).then(m=>{f&&f(m)})};HC.prototype.cancelComponentEditMaterial=function(o){this.bimModel.CancelComponentEditMaterial(o.modelId,o.componentId)};HC.prototype.setInstancesMaterialId=function(o){this.bimModel.SetInstancesMaterialId(o.modelId,o.instancesId,o.materialId)};HC.prototype.removeMaterial=function(o){this.bimModel.SetComponentMaterialId(o.modelId,o.materialId,null)};HC.prototype.removeMaterialColor=function(o){this.bimModel.SetMaterialColor(o.modelId,o.materialId,null)};HC.prototype.removeFromMap=function(){};var Fmt=HC;function Al(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.Bim=Z(window.Bim,null),this.bimModel=null,this.modelList=null,this.modelListInitEd={},this.modelTransformArr=null,this.serverAddress=""}Al.prototype.create=function(o){let f=this;return this.serverAddress=o.serverAddres,this.bimModel=new Bim.Bim({serverAddress:Z(o.serverAddress,"https://localhost:8085/"),maxRenderTriangleCount:Z(o.maxRenderTriangleCount,5e6),Cesium:qi,viewer:f._coreMap,useCache:Z(o.useCache,!1)}),new Promise(m=>{f.bimModel.OnInitialized=v=>{f.modelList=v,this.bimModel.SetExpressTypeVisibleDistance(0,0),m(f.bimModel)}})};Al.prototype.setModelTransform=function(o,f){let m=Ee.toArray(tn.eastNorthUpToFixedFrame(H.fromDegrees(f.lon,f.lat,f.height)));if(f.roll){let v=xe.toRadians(f.roll||0),y=Ee.fromRotationTranslation(Ut.fromRotationZ(v));Ee.multiply(m,y,m)}this.bimModel.SetModelTransform(o,m)};Al.prototype.showModel=function(o){this.bimModel.ShowModel(o)};Al.prototype.SetExpressTypeVisibleDistance=function(o,f){this.bimModel.SetExpressTypeVisibleDistance(o,f)};Al.prototype.refresh=function(){this.bimModel.Refresh()};Al.prototype.resizeRenderSize=function(){this.bimModel.ResizeRenderSize()};Al.prototype.getModelTransform=function(o){return this.bimModel.GetModelTransform(o)};Al.prototype.getModelBoundingSphere=function(o){let f=this.modelList[o],m=Ee.multiplyByPoint(f.transform,H.fromArray(f.box),{}),v=Ee.multiplyByPoint(f.transform,H.fromArray(f.box,3),{});return Pi.fromPoints([m,v],new Pi)};Al.prototype.setInstancesStatus=function(o,f){this.bimModel.SetInstancesStatus(o,f)};Al.prototype.setComponentStatus=function(o,f,m){this.bimModel.SetComponentStatus(o,f,m)};Al.prototype.setSelectColor=function(o,f,m){let v=[],y=[];f?v.push(f.red,f.green,f.blue,f.alpha):v=[1,1,1,.8],m?y.push(m.red,m.green,m.blue,m.alpha):y=[.3,.8,.3,.5],this.bimModel.SetSelectColor(o||1,v,y)};Al.prototype.setComponentTransform=function(o,f,m){this.bimModel.SetComponentTransform(o,f,m)};Al.prototype.setInstancesTransform=function(o,f){this.bimModel.SetInstancesTransform(o,f)};Al.prototype.showComponent=function(o){if(o.showComponentArr.length>0){let f=new Int32Array(o.showComponentArr);this.bimModel.SetComponentStatus(o.status,f,o.reverseElection||!1)}};Al.prototype.frameSelection=function(o,f,m,v,y){this.bimModel.FrameSelection(o,f,m,v).then(x=>{y&&y(x)})};Al.prototype.pickId=function(o,f,m){this.bimModel.PickId(o,f).then(v=>{m&&m(v)})};Al.prototype.pickIdSync=function(o,f){return this.bimModel.PickIdSync(o,f)};Al.prototype.pickWorldPosition=function(o,f,m){this.bimModel.PickWorldPosition(o,f).then(v=>{m&&m(v)})};Al.prototype.pickWorldPositionSync=function(o,f){return this.bimModel.PickWorldPositionSync(o,f)};Al.prototype.choice=function(o){return new Omt(o,this._earthCtrl,qi)};Al.prototype.clickBim=function(o){let f=this;f._coreMap.screenSpaceEventHandler.setInputAction(function(v){f.bimModel.PickId(v.position.x,v.position.y).then(y=>{let x=y[0],C=y[1],w=y[2],A=new Int32Array([x,w]);f.bimModel.SetComponentStatus(2,A,!1),o&&o({modelId:x,instancesId:C,componentId:w})})},Ei.LEFT_CLICK)};Al.prototype.clickBimInstances=function(o){let f=this,m=[];f._coreMap.screenSpaceEventHandler.setInputAction(function(y){let x=f.bimModel.PickId(y.position.x,y.position.y),C=x[0],w=x[1],A=x[2];f.bimModel.GetModelSqlDb(C).then(E=>{E.each("select * from component where id = ?",[A],T=>{T.instancesIds=new Uint32Array(T.instancesIds.buffer);for(let S of T.instancesIds){let M=S.toString();m.filter(P=>P===M).length>0?(Array.prototype.push.apply(m,[C,S,1]),m=m.filter(P=>P!==M)):(Array.prototype.push.apply(m,[C,S,2]),m.push(M))}f.bimModel.SetInstancesStatus(new Int32Array(m))})})},Ei.LEFT_CLICK)};Al.prototype.cancelOperatingStatus=function(){this.bimModel.CancelOperatingStatus()};Al.prototype.cancelOperatingTransform=function(){this.bimModel.CancelOperatingTransform()};Al.prototype.getInstancesBox=function(o,f,m){this.bimModel.GetInstancesBox(o,f).then(v=>{m&&m(v)})};Al.prototype.getBIMBoundingSphere=function(o,f,m){let v=this;v.bimModel.GetInstancesBox(o,f).then(y=>{let x=H.fromArray(y,0),C=H.fromArray(y,3);x=Ee.multiplyByPoint(v.modelList[o].transform,x,{}),C=Ee.multiplyByPoint(v.modelList[o].transform,C,{}),m&&m(Pi.fromPoints([x,C],new Pi))})};Al.prototype.getModelSqlDb=function(){return this.bimModel.GetModelSqlDb()};Al.prototype.getBIMComponentBoundingSphere=function(o,f,m){let v=this;v.bimModel.GetModelSqlDb(o).then(y=>{y.each("select * from component where id = ?",[f],x=>{x.instancesIds=new Uint32Array(x.instancesIds.buffer),x.box=new Float32Array(x.box.buffer);let C=H.fromArray(x.box,0),w=H.fromArray(x.box,3);C=Ee.multiplyByPoint(v.modelList[o].transform,C,{}),w=Ee.multiplyByPoint(v.modelList[o].transform,w,{});let A=Pi.fromPoints([C,w],new Pi);m&&m(A)})})};Al.prototype.flyToComponent=function(){let o=this;o._coreMap.screenSpaceEventHandler.setInputAction(function(m){o.bimModel.PickId(m.position.x,m.position.y).then(v=>{let y=v[0],x=v[2];o.getBIMComponentBoundingSphere(y,x,function(C){o._coreMap.camera.flyToBoundingSphere(C)})})},Ei.LEFT_CLICK)};Al.prototype.flyToInstances=function(){let o=this;o._coreMap.screenSpaceEventHandler.setInputAction(function(m){o.bimModel.PickId(m.position.x,m.position.y).then(v=>{let y=v[0],x=v[1];o.getBIMBoundingSphere(y,x,C=>{o._coreMap.camera.flyToBoundingSphere(C)})})},Ei.LEFT_CLICK)};Al.prototype.materialTool=function(o){let f=this;return new Fmt(o,f._earthCtrl,qi)};Al.prototype.disableClip=function(){this.bimModel.SetClipPlane()};Al.prototype.setClipPlane=function(o){this.bimModel.SetClipPlane(o.clipTransform,o.isTurn,o?.plane1,o.plane2,o.plane3,o.plane4,o.plane5,o.plane6)};Al.prototype.bimModeClipping=function(o){let f=this;return new Rmt(f._earthCtrl,f.bimModel,o)};Al.prototype.differentiateLevels=function(o){let f=this;return new Nmt(o,f._earthCtrl)};Al.prototype.setExpressTypeWeights=function(o,f){this.bimModel.SetExpressTypeWeights(o,f)};Al.prototype.setExpressTypeVisibleDistance=function(o,f){this.bimModel.SetExpressTypeVisibleDistance(o,f)};Al.prototype.setModelStoreyTransform=function(o,f,m){this.bimModel.SetModelStoreyTransform(o,f,m)};Al.prototype.setModelStoreyStatus=async function(o,f,m){this.bimModel.SetModelStoreyStatus(o,f,m)};Al.prototype.setModelExpressTypeTransform=function(o,f,m){this.bimModel.SetModelExpressTypeTransform(o,f,m)};Al.prototype.setModelExpressTypeStatus=function(o,f,m){this.bimModel.SetModelExpressTypeStatus(o,f,m)};Al.prototype.markShell=function(o){this.bimModel.MarkShell().then(f=>{o&&o(f)})};Al.prototype.clearShell=function(o,f){this.bimModel.ClearShell(o).then(m=>{f&&f(m)})};Al.prototype.saveShell=function(o){this.bimModel.SaveShell().then(f=>{o&&o(f)})};Al.prototype.setOnlyShowShells=function(o){this.bimModel.SetOnlyShowShells(o)};var Bmt=Al;var ja={version:"1.0.0"};ja.PlotUtils={},ja.PlotUtils.distance=function(o,f){return Math.sqrt(Math.pow(o[0]-f[0],2)+Math.pow(o[1]-f[1],2))},ja.PlotUtils.wholeDistance=function(o){for(var f=0,m=0;m<o.length-1;m++)f+=ja.PlotUtils.distance(o[m],o[m+1]);return f},ja.PlotUtils.getBaseLength=function(o){return Math.pow(ja.PlotUtils.wholeDistance(o),.99)},ja.PlotUtils.mid=function(o,f){return[(o[0]+f[0])/2,(o[1]+f[1])/2]},ja.PlotUtils.getCircleCenterOfThreePoints=function(o,f,m){var v=[(o[0]+f[0])/2,(o[1]+f[1])/2],y=[v[0]-o[1]+f[1],v[1]+o[0]-f[0]],x=[(o[0]+m[0])/2,(o[1]+m[1])/2],C=[x[0]-o[1]+m[1],x[1]+o[0]-m[0]];return ja.PlotUtils.getIntersectPoint(v,y,x,C)},ja.PlotUtils.getIntersectPoint=function(o,f,m,v){if(o[1]==f[1]){var y=(v[0]-m[0])/(v[1]-m[1]),x=y*(o[1]-m[1])+m[0],C=o[1];return[x,C]}if(m[1]==v[1]){var w=(f[0]-o[0])/(f[1]-o[1]);return x=w*(m[1]-o[1])+o[0],C=m[1],[x,C]}return w=(f[0]-o[0])/(f[1]-o[1]),y=(v[0]-m[0])/(v[1]-m[1]),C=(w*o[1]-o[0]-y*m[1]+m[0])/(w-y),x=w*C-w*o[1]+o[0],[x,C]},ja.PlotUtils.getAzimuth=function(o,f){var m,v=Math.asin(Math.abs(f[1]-o[1])/ja.PlotUtils.distance(o,f));return f[1]>=o[1]&&f[0]>=o[0]?m=v+Math.PI:f[1]>=o[1]&&f[0]<o[0]?m=ja.Constants.TWO_PI-v:f[1]<o[1]&&f[0]<o[0]?m=v:f[1]<o[1]&&f[0]>=o[0]&&(m=Math.PI-v),m},ja.PlotUtils.getAngleOfThreePoints=function(o,f,m){var v=ja.PlotUtils.getAzimuth(f,o)-ja.PlotUtils.getAzimuth(f,m);return 0>v?v+ja.Constants.TWO_PI:v},ja.PlotUtils.isClockWise=function(o,f,m){return(m[1]-o[1])*(f[0]-o[0])>(f[1]-o[1])*(m[0]-o[0])},ja.PlotUtils.getPointOnLine=function(o,f,m){var v=f[0]+o*(m[0]-f[0]),y=f[1]+o*(m[1]-f[1]);return[v,y]},ja.PlotUtils.getCubicValue=function(o,f,m,v,y){o=Math.max(Math.min(o,1),0);var x=1-o,C=o*o,w=C*o,A=x*x,E=A*x,T=E*f[0]+3*A*o*m[0]+3*x*C*v[0]+w*y[0],S=E*f[1]+3*A*o*m[1]+3*x*C*v[1]+w*y[1];return[T,S]},ja.PlotUtils.getThirdPoint=function(o,f,m,v,y){var x=ja.PlotUtils.getAzimuth(o,f),C=y?x+m:x-m,w=v*Math.cos(C),A=v*Math.sin(C);return[f[0]+w,f[1]+A]},ja.PlotUtils.getArcPoints=function(o,f,m,v){var y,x,C=[],w=v-m;w=0>w?w+ja.Constants.TWO_PI:w;for(var A=0;A<=ja.Constants.FITTING_COUNT;A++){var E=m+w*A/ja.Constants.FITTING_COUNT;y=o[0]+f*Math.cos(E),x=o[1]+f*Math.sin(E),C.push([y,x])}return C},ja.PlotUtils.getBisectorNormals=function(o,f,m,v){var y=ja.PlotUtils.getNormal(f,m,v),x=Math.sqrt(y[0]*y[0]+y[1]*y[1]),C=y[0]/x,w=y[1]/x,A=ja.PlotUtils.distance(f,m),E=ja.PlotUtils.distance(m,v);if(x>ja.Constants.ZERO_TOLERANCE)if(ja.PlotUtils.isClockWise(f,m,v)){var T=o*A,S=m[0]-T*w,M=m[1]+T*C,I=[S,M];T=o*E,S=m[0]+T*w,M=m[1]-T*C;var P=[S,M]}else T=o*A,S=m[0]+T*w,M=m[1]-T*C,I=[S,M],T=o*E,S=m[0]-T*w,M=m[1]+T*C,P=[S,M];else S=m[0]+o*(f[0]-m[0]),M=m[1]+o*(f[1]-m[1]),I=[S,M],S=m[0]+o*(v[0]-m[0]),M=m[1]+o*(v[1]-m[1]),P=[S,M];return[I,P]},ja.PlotUtils.getNormal=function(o,f,m){var v=o[0]-f[0],y=o[1]-f[1],x=Math.sqrt(v*v+y*y);v/=x,y/=x;var C=m[0]-f[0],w=m[1]-f[1],A=Math.sqrt(C*C+w*w);C/=A,w/=A;var E=v+C,T=y+w;return[E,T]},ja.PlotUtils.getCurvePoints=function(o,f){for(var m=ja.PlotUtils.getLeftMostControlPoint(f,o),v=[m],y=0;y<f.length-2;y++){var x=f[y],C=f[y+1],w=f[y+2],A=ja.PlotUtils.getBisectorNormals(o,x,C,w);v=v.concat(A)}var E=ja.PlotUtils.getRightMostControlPoint(f,o);v.push(E);var T=[];for(y=0;y<f.length-1;y++){x=f[y],C=f[y+1],T.push(x);for(var o=0;o<ja.Constants.FITTING_COUNT;o++){var S=ja.PlotUtils.getCubicValue(o/ja.Constants.FITTING_COUNT,x,v[2*y],v[2*y+1],C);T.push(S)}T.push(C)}return T},ja.PlotUtils.getLeftMostControlPoint=function(o,f){var m=o[0],v=o[1],y=o[2],x=ja.PlotUtils.getBisectorNormals(0,m,v,y),C=x[0],w=ja.PlotUtils.getNormal(m,v,y),A=Math.sqrt(w[0]*w[0]+w[1]*w[1]);if(A>ja.Constants.ZERO_TOLERANCE)var E=ja.PlotUtils.mid(m,v),T=m[0]-E[0],S=m[1]-E[1],M=ja.PlotUtils.distance(m,v),I=2/M,P=-I*S,D=I*T,L=P*P-D*D,R=2*P*D,O=D*D-P*P,F=C[0]-E[0],k=C[1]-E[1],U=E[0]+L*F+R*k,G=E[1]+R*F+O*k;else U=m[0]+f*(v[0]-m[0]),G=m[1]+f*(v[1]-m[1]);return[U,G]},ja.PlotUtils.getRightMostControlPoint=function(o,f){var m=o.length,v=o[m-3],y=o[m-2],x=o[m-1],C=ja.PlotUtils.getBisectorNormals(0,v,y,x),w=C[1],A=ja.PlotUtils.getNormal(v,y,x),E=Math.sqrt(A[0]*A[0]+A[1]*A[1]);if(E>ja.Constants.ZERO_TOLERANCE)var T=ja.PlotUtils.mid(y,x),S=x[0]-T[0],M=x[1]-T[1],I=ja.PlotUtils.distance(y,x),P=2/I,D=-P*M,L=P*S,R=D*D-L*L,O=2*D*L,F=L*L-D*D,k=w[0]-T[0],U=w[1]-T[1],G=T[0]+R*k+O*U,j=T[1]+O*k+F*U;else G=x[0]+f*(y[0]-x[0]),j=x[1]+f*(y[1]-x[1]);return[G,j]},ja.PlotUtils.getBezierPoints=function(o){if(o.length<=2)return o;for(var f=[],m=o.length-1,v=0;1>=v;v+=.01){for(var y=0,x=0,C=0;m>=C;C++){var w=ja.PlotUtils.getBinomialFactor(m,C),A=Math.pow(v,C),E=Math.pow(1-v,m-C);y+=w*A*E*o[C][0],x+=w*A*E*o[C][1]}f.push([y,x])}return f.push(o[m]),f},ja.PlotUtils.getBinomialFactor=function(o,f){return ja.PlotUtils.getFactorial(o)/(ja.PlotUtils.getFactorial(f)*ja.PlotUtils.getFactorial(o-f))},ja.PlotUtils.getFactorial=function(o){if(1>=o)return 1;if(o==2)return 2;if(o==3)return 6;if(o==4)return 24;if(o==5)return 120;for(var f=1,m=1;o>=m;m++)f*=m;return f},ja.PlotUtils.getQBSplinePoints=function(o){if(o.length<=2)return o;var f=2,m=[],v=o.length-f-1;m.push(o[0]);for(var y=0;v>=y;y++)for(var x=0;1>=x;x+=.05){for(var C=0,w=0,A=0;f>=A;A++){var E=ja.PlotUtils.getQuadricBSplineFactor(A,x);C+=E*o[y+A][0],w+=E*o[y+A][1]}m.push([C,w])}return m.push(o[o.length-1]),m},ja.PlotUtils.getQuadricBSplineFactor=function(o,f){return o==0?Math.pow(f-1,2)/2:o==1?(-2*Math.pow(f,2)+2*f+1)/2:o==2?Math.pow(f,2)/2:0},ja.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4};var sn=ja;var Dl={version:"1.2.0",createTime:"2021.04.01",author:"sss"},GP={type:"doublearrow",headHeightFactor:.25,headWidthFactor:.3,neckHeightFactor:.85,fixPointCount:4,neckWidthFactor:.15},Fue={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},dG={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13,swallowTailFactor:.15},Bue={widthFactor:.15,neckWidthFactor:.25,neckLengthFactor:.3,swallowTailFactor:.15},OA={headFactor:.4,headWidthFactor:1.3,neckWidthFactor:.02,head:.1};Dl.algorithm={},Dl.algorithm.doubleArrow=function(o){this.connPoint=null,this.tempPoint4=null,this.points=o;let f={controlPoint:null,polygonalPoint:null};if(!(2>o.length)){if(C===2)return o;let v=this.points[0],y=this.points[1],x=this.points[2],C=o.length;C===3?this.tempPoint4=Dl.algorithm.getTempPoint4(v,y,x):this.tempPoint4=this.points[3],C===3||C===4?this.connPoint=sn.PlotUtils.mid(v,y):this.connPoint=this.points[4];let w,A;sn.PlotUtils.isClockWise(v,y,x)?(w=Dl.algorithm.getArrowPoints(v,this.connPoint,this.tempPoint4,!1),A=Dl.algorithm.getArrowPoints(this.connPoint,y,x,!0)):(w=Dl.algorithm.getArrowPoints(y,this.connPoint,x,!1),A=Dl.algorithm.getArrowPoints(this.connPoint,v,this.tempPoint4,!0));let E=w.length,T=(E-5)/2,S=w.slice(0,T),M=w.slice(T,T+5),I=w.slice(T+5,E),P=A.slice(0,T),D=A.slice(T,T+5),L=A.slice(T+5,E);P=sn.PlotUtils.getBezierPoints(P);let R=sn.PlotUtils.getBezierPoints(L.concat(S.slice(1)));I=sn.PlotUtils.getBezierPoints(I);let O=P.concat(D,R,M,I),F=Dl.algorithm.array2Dto1D(O);f.controlPoint=[v,y,x,this.tempPoint4,this.connPoint],f.polygonalPoint=H.fromDegreesArray(F)}return f},Dl.algorithm.threeArrow=function(o){this.connPoint=null,this.tempPoint4=null,this.tempPoint5=null,this.points=o;let f={controlPoint:null,polygonalPoint:null},m=o.length;if(!(2>o.length)){if(o.length===2)return o;let v=this.points[0],y=this.points[1],x=this.points[2],C=o.length;C===3?(this.tempPoint4=Dl.algorithm.getTempPoint4(v,y,x),this.tempPoint5=sn.PlotUtils.mid(x,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),C<6?this.connPoint=sn.PlotUtils.mid(v,y):this.connPoint=this.points[5];let w,A;sn.PlotUtils.isClockWise(v,y,x)?(w=Dl.algorithm.getArrowPoints(v,this.connPoint,this.tempPoint4,!1),A=Dl.algorithm.getArrowPoints(this.connPoint,y,x,!0)):(w=Dl.algorithm.getArrowPoints(y,this.connPoint,x,!1),A=Dl.algorithm.getArrowPoints(this.connPoint,v,this.tempPoint4,!0));let E=w.length,T=(E-5)/2,S=w.slice(0,T),M=w.slice(T,T+5),I=w.slice(T+5,E),P=A.slice(0,T),D=A.slice(T,T+5),L=A.slice(T+5,E);P=sn.PlotUtils.getBezierPoints(P);let R=sn.PlotUtils.getBezierPoints(L.concat(S.slice(1)));I=sn.PlotUtils.getBezierPoints(I);let O=P.concat(D,R,M,I),F=Dl.algorithm.array2Dto1D(O);f.controlPoint=[v,y,x,this.tempPoint4,this.tempPoint5,this.connPoint],f.polygonalPoint=H.fromDegreesArray(F)}return f},Dl.algorithm.array2Dto1D=function(o){let f=[];return o.forEach(function(m){f.push(m[0]),f.push(m[1])}),f},Dl.algorithm.getArrowPoints=function(o,f,m,v){this.type=GP.type,this.headHeightFactor=GP.headHeightFactor,this.headWidthFactor=GP.headWidthFactor,this.neckHeightFactor=GP.neckHeightFactor,this.neckWidthFactor=GP.neckWidthFactor;let y=sn.PlotUtils.mid(o,f),x=sn.PlotUtils.distance(y,m),C=sn.PlotUtils.getThirdPoint(m,y,0,.3*x,!0),w=sn.PlotUtils.getThirdPoint(m,y,0,.5*x,!0);C=sn.PlotUtils.getThirdPoint(y,C,sn.Constants.HALF_PI,x/5,v),w=sn.PlotUtils.getThirdPoint(y,w,sn.Constants.HALF_PI,x/4,v);let A=[y,C,w,m],E=Dl.algorithm.getArrowHeadPoints(A,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),T=E[0],S=E[4],M=sn.PlotUtils.distance(o,f)/sn.PlotUtils.getBaseLength(A)/2,I=Dl.algorithm.getArrowBodyPoints(A,T,S,M),P=I.length,D=I.slice(0,P/2),L=I.slice(P/2,P);return D.push(T),L.push(S),D=D.reverse(),D.push(f),L=L.reverse(),L.push(o),D.reverse().concat(E,L)},Dl.algorithm.getArrowHeadPoints=function(o,f,m){this.type=GP.type,this.headHeightFactor=GP.headHeightFactor,this.headWidthFactor=GP.headWidthFactor,this.neckHeightFactor=GP.neckHeightFactor,this.neckWidthFactor=GP.neckWidthFactor;let v=sn.PlotUtils.getBaseLength(o),y=v*this.headHeightFactor,x=o[o.length-1],C=(sn.PlotUtils.distance(f,m),y*this.headWidthFactor),w=y*this.neckWidthFactor,A=y*this.neckHeightFactor,E=sn.PlotUtils.getThirdPoint(o[o.length-2],x,0,y,!0),T=sn.PlotUtils.getThirdPoint(o[o.length-2],x,0,A,!0),S=sn.PlotUtils.getThirdPoint(x,E,sn.Constants.HALF_PI,C,!1),M=sn.PlotUtils.getThirdPoint(x,E,sn.Constants.HALF_PI,C,!0),I=sn.PlotUtils.getThirdPoint(x,T,sn.Constants.HALF_PI,w,!1),P=sn.PlotUtils.getThirdPoint(x,T,sn.Constants.HALF_PI,w,!0);return[I,S,x,M,P]},Dl.algorithm.getArrowBodyPoints=function(o,f,m,v){let y=[],x=[];for(let C=sn.PlotUtils.wholeDistance(o),w=sn.PlotUtils.getBaseLength(o),A=w*v,E=sn.PlotUtils.distance(f,m),T=(A-E)/2,S=0,M=1;M<o.length-1;M++){let I=sn.PlotUtils.getAngleOfThreePoints(o[M-1],o[M],o[M+1])/2;S+=sn.PlotUtils.distance(o[M-1],o[M]);let P=(A/2-S/C*T)/Math.sin(I),D=sn.PlotUtils.getThirdPoint(o[M-1],o[M],Math.PI-I,P,!0),L=sn.PlotUtils.getThirdPoint(o[M-1],o[M],I,P,!1);y.push(D),x.push(L)}return y.concat(x)},Dl.algorithm.getTempPoint4=function(o,f,m){let v,y,x,C,w=sn.PlotUtils.mid(o,f),A=sn.PlotUtils.distance(w,m),E=sn.PlotUtils.getAngleOfThreePoints(o,w,m);return E<sn.Constants.HALF_PI?(y=A*Math.sin(E),x=A*Math.cos(E),C=sn.PlotUtils.getThirdPoint(o,w,sn.Constants.HALF_PI,y,!1),v=sn.PlotUtils.getThirdPoint(w,C,sn.Constants.HALF_PI,x,!0)):E>=sn.Constants.HALF_PI&&E<Math.PI?(y=A*Math.sin(Math.PI-E),x=A*Math.cos(Math.PI-E),C=sn.PlotUtils.getThirdPoint(o,w,sn.Constants.HALF_PI,y,!1),v=sn.PlotUtils.getThirdPoint(w,C,sn.Constants.HALF_PI,x,!1)):E>=Math.PI&&E<1.5*Math.PI?(y=A*Math.sin(E-Math.PI),x=A*Math.cos(E-Math.PI),C=sn.PlotUtils.getThirdPoint(o,w,sn.Constants.HALF_PI,y,!0),v=sn.PlotUtils.getThirdPoint(w,C,sn.Constants.HALF_PI,x,!0)):(y=A*Math.sin(2*Math.PI-E),x=A*Math.cos(2*Math.PI-E),C=sn.PlotUtils.getThirdPoint(o,w,sn.Constants.HALF_PI,y,!0),v=sn.PlotUtils.getThirdPoint(w,C,sn.Constants.HALF_PI,x,!1)),v},Dl.algorithm.tailedAttackArrow=function(o){o=Dl.algorithm.dereplication(o),this.tailWidthFactor=Fue.tailWidthFactor,this.swallowTailFactor=Fue.swallowTailFactor,this.swallowTailPnt=Fue.swallowTailPnt;let f={controlPoint:null,polygonalPoint:null};if(f.controlPoint=o,!(2>o.length)){if(o.length===2)return f.polygonalPoint=o,f;let v=o,y=v[0],x=v[1];sn.PlotUtils.isClockWise(v[0],v[1],v[2])&&(y=v[1],x=v[0]);let C=sn.PlotUtils.mid(y,x),w=[C].concat(v.slice(2)),A=Dl.algorithm.getAttackArrowHeadPoints(w,y,x,Fue),E=A[0],T=A[4],S=sn.PlotUtils.distance(y,x),M=sn.PlotUtils.getBaseLength(w),I=M*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=sn.PlotUtils.getThirdPoint(w[1],w[0],0,I,!0);let P=S/M,D=Dl.algorithm.getAttackArrowBodyPoints(w,E,T,P),L=D.length,R=[y].concat(D.slice(0,L/2));R.push(E);let O=[x].concat(D.slice(L/2,L)),F=[];O.push(T),R=sn.PlotUtils.getQBSplinePoints(R),O=sn.PlotUtils.getQBSplinePoints(O),F=Dl.algorithm.array2Dto1D(R.concat(A,O.reverse(),[this.swallowTailPnt,R[0]])),f.polygonalPoint=H.fromDegreesArray(F)}return f},Dl.algorithm.getAttackArrowHeadPoints=function(o,f,m,v){this.headHeightFactor=v.headHeightFactor,this.headTailFactor=v.headTailFactor,this.headWidthFactor=v.headWidthFactor,this.neckWidthFactor=v.neckWidthFactor,this.neckHeightFactor=v.neckHeightFactor;let y=sn.PlotUtils.getBaseLength(o),x=y*this.headHeightFactor,C=o[o.length-1];y=sn.PlotUtils.distance(C,o[o.length-2]);let w=sn.PlotUtils.distance(f,m);x>w*this.headTailFactor&&(x=w*this.headTailFactor);let A=x*this.headWidthFactor,E=x*this.neckWidthFactor;x=x>y?y:x;let T=x*this.neckHeightFactor,S=sn.PlotUtils.getThirdPoint(o[o.length-2],C,0,x,!0),M=sn.PlotUtils.getThirdPoint(o[o.length-2],C,0,T,!0),I=sn.PlotUtils.getThirdPoint(C,S,sn.Constants.HALF_PI,A,!1),P=sn.PlotUtils.getThirdPoint(C,S,sn.Constants.HALF_PI,A,!0),D=sn.PlotUtils.getThirdPoint(C,M,sn.Constants.HALF_PI,E,!1),L=sn.PlotUtils.getThirdPoint(C,M,sn.Constants.HALF_PI,E,!0);return[D,I,C,P,L]},Dl.algorithm.getAttackArrowBodyPoints=function(o,f,m,v){let y=[],x=[];for(let C=sn.PlotUtils.wholeDistance(o),w=sn.PlotUtils.getBaseLength(o),A=w*v,E=sn.PlotUtils.distance(f,m),T=(A-E)/2,S=0,M=1;M<o.length-1;M++){let I=sn.PlotUtils.getAngleOfThreePoints(o[M-1],o[M],o[M+1])/2;S+=sn.PlotUtils.distance(o[M-1],o[M]);let P=(A/2-S/C*T)/Math.sin(I),D=sn.PlotUtils.getThirdPoint(o[M-1],o[M],Math.PI-I,P,!0),L=sn.PlotUtils.getThirdPoint(o[M-1],o[M],I,P,!1);y.push(D),x.push(L)}return y.concat(x)},Dl.algorithm.dereplication=function(o){let f=o[o.length-1],m=!1,v=[];return v=o.filter(function(y){if(y[0]!==f[0]&&y[1]!==f[1])return y;m=!0}),m&&v.push(f),v},Dl.algorithm.fineArrow=function(o,f){if(o.length<2||f.length<2)return;let m=dG.tailWidthFactor,v=dG.neckWidthFactor,y=dG.headWidthFactor,x=dG.headAngle,C=dG.neckAngle,w=dG.swallowTailFactor,A=[];A[0]=o,A[1]=f;let E=A[0],T=A[1],S=sn.PlotUtils.getBaseLength(A),M=S*m,I=S*v,P=S*y,D=sn.PlotUtils.getThirdPoint(T,E,sn.Constants.HALF_PI,M,!0),L=sn.PlotUtils.getThirdPoint(T,E,sn.Constants.HALF_PI,M,!1),R=sn.PlotUtils.getThirdPoint(E,T,x,P,!1),O=sn.PlotUtils.getThirdPoint(E,T,x,P,!0),F=sn.PlotUtils.getThirdPoint(E,T,C,I,!1),k=sn.PlotUtils.getThirdPoint(E,T,C,I,!0),U=[],G=sn.PlotUtils.mid(D,L);return S=sn.PlotUtils.getThirdPoint(D,G,sn.Constants.HALF_PI,I*w,!1),U.push(D[0],D[1],F[0],F[1],R[0],R[1],T[0],T[1],O[0],O[1],k[0],k[1],L[0],L[1],S[0],S[1]),H.fromDegreesArray(U)},Dl.algorithm.Arrow=function(o,f){if(o.length<2||f.length<2)return;let m=Bue.widthFactor,v=Bue.neckWidthFactor,y=Bue.neckLengthFactor,x=Bue.swallowTailFactor,C=[];C[0]=o,C[1]=f;let w=C[0],A=C[1],E=sn.PlotUtils.getBaseLength(C),T=E*m,S=E*v,M=E*y,I=sn.PlotUtils.getThirdPoint(A,w,sn.Constants.HALF_PI,T,!0),P=sn.PlotUtils.getThirdPoint(A,w,sn.Constants.HALF_PI,T,!1),D=sn.PlotUtils.getThirdPoint(w,A,0,M,!1),L=sn.PlotUtils.getThirdPoint(I,D,sn.Constants.HALF_PI,T,!1),R=sn.PlotUtils.getThirdPoint(P,D,sn.Constants.HALF_PI,T,!0),O=sn.PlotUtils.getThirdPoint(I,L,sn.Constants.HALF_PI,S,!1),F=sn.PlotUtils.getThirdPoint(P,R,sn.Constants.HALF_PI,S,!0),k=[],U=sn.PlotUtils.mid(I,P);return E=sn.PlotUtils.getThirdPoint(I,U,sn.Constants.HALF_PI,S*x,!1),k.push(I[0],I[1],L[0],L[1],O[0],O[1],A[0],A[1],F[0],F[1],R[0],R[1],P[0],P[1],E[0],E[1]),H.fromDegreesArray(k)},Dl.algorithm.Surface=function(o){o.push(o[0]);let f=sn.PlotUtils.getCurvePoints(.4,o);return f=Dl.algorithm.array2Dto1D(f),H.fromDegreesArray(f)},Dl.algorithm.Assembly=function(o){let f,m;if(o.length===2){f=sn.PlotUtils.mid(o[0],o[1]);let E=sn.PlotUtils.getBaseLength([o[0],f])/.9;m=sn.PlotUtils.getThirdPoint(o[0],f,Math.PI,E,!0),o=[o[0],m,o[1]]}f=sn.PlotUtils.mid(o[0],o[2]),o.push(f,o[0],o[1]);let v=[],y,x,C,w=[];for(let E=0;E<o.length-2;E++){y=o[E],x=o[E+1],C=o[E+2];let T=sn.PlotUtils.getBisectorNormals(.4,y,x,C);v=v.concat(T)}let A=v.length;v=[v[A-1]].concat(v.slice(0,A-1));for(let E=0;E<o.length-2;E++){y=o[E],x=o[E+1],w=w.concat(y);for(let T=0;T<=100;T++)m=sn.PlotUtils.getCubicValue(T/100,y,v[E*2],v[E*2+1],x),w=w.concat(m);w=w.concat(x)}return H.fromDegreesArray(w)},Dl.algorithm.Sector=function(o){let f,m,v;f=o[0],m=o[1],v=o[2];let y=sn.PlotUtils.getBaseLength([f,m]),x=sn.PlotUtils.getAzimuth(m,f),C=sn.PlotUtils.getAzimuth(v,f),w=[];return w.push(f),w=w.concat(sn.PlotUtils.getArcPoints(f,y,x,C)),w.push(f),w=Dl.algorithm.array2Dto1D(w),H.fromDegreesArray(w)},Dl.algorithm.Recflag=function(o){let f=OA.headFactor,m=OA.headWidthFactor,v=OA.neckWidthFactor,y=OA.head,x=o;x[1][0]=x[0][0];let C=x[0],w=x[1],A=sn.PlotUtils.getBaseLength(x),E=A*f,T=A*v,S=sn.PlotUtils.getThirdPoint(C,w,Math.PI,-E,!0);x[0]=S;let I=sn.PlotUtils.getBaseLength(x)*m,P=sn.PlotUtils.getThirdPoint(w,S,-Math.PI/2,I,!0),D=sn.PlotUtils.getThirdPoint(S,w,Math.PI/2,I,!0),L=sn.PlotUtils.getThirdPoint(w,C,Math.PI/2,T,!1),R=sn.PlotUtils.getThirdPoint(w,S,Math.PI/2,T,!1),O=[];return O.push(C[0],C[1],w[0],w[1],D[0],D[1],P[0],P[1],R[0],R[1],L[0],L[1],C[0],C[1]),H.fromDegreesArray(O)},Dl.algorithm.Pennant=function(o){let f=OA.headFactor,m=OA.headWidthFactor,v=OA.neckWidthFactor,y=OA.head,x=o;x[1][0]=x[0][0];let C=x[0],w=x[1],A=sn.PlotUtils.getBaseLength(x),E=A*f,T=A*v,S=sn.PlotUtils.getThirdPoint(C,w,Math.PI,-E,!0);x[0]=S;let I=sn.PlotUtils.getBaseLength(x)*m,P=sn.PlotUtils.getThirdPoint(S,w,Math.PI/2,I,!0),D=sn.PlotUtils.getThirdPoint(w,C,Math.PI/2,T,!1),L=sn.PlotUtils.getThirdPoint(w,S,Math.PI/2,T,!1),R=[];return R.push(C[0],C[1],w[0],w[1],P[0],P[1],L[0],L[1],D[0],D[1],C[0],C[1]),H.fromDegreesArray(R)},Dl.algorithm.Mflag=function(o){let f=OA.headFactor,m=OA.headWidthFactor,v=OA.neckWidthFactor,y=OA.head,x=o;x[1][0]=x[0][0];let C=x[0],w=x[1],A=sn.PlotUtils.getBaseLength(x),E=A*f,T=A*v,S=sn.PlotUtils.getThirdPoint(C,w,Math.PI,-E,!0);x[0]=S;let M=sn.PlotUtils.getBaseLength(x),I=M*m,P=M*y,D=sn.PlotUtils.getThirdPoint(w,S,-Math.PI/2,I,!0),L=sn.PlotUtils.getThirdPoint(S,w,Math.PI/2,I,!0),R=sn.PlotUtils.getThirdPoint(S,w,Math.PI/2,T,!0),O=sn.PlotUtils.getThirdPoint(w,C,Math.PI/2,T,!1),F=sn.PlotUtils.getThirdPoint(w,S,Math.PI/2,T,!1),k=[];k.push(R),k.push(L);let U=Dl.algorithm.calculatePonits(k,P),G=[];G.push(F),G.push(D);let j=Dl.algorithm.calculatePonits(G,P,!0),q=[];return q.push(C[0],C[1],S[0],S[1],w[0],w[1]),q=q.concat(U),q=q.concat(j),q.push(F[0],F[1],O[0],O[1],C[0],C[1]),H.fromDegreesArray(q)},Dl.algorithm.calculatePonits=function(o,f,m){let v=[];if(o.length>1){let x=o[0],C=o[o.length-1],w=x,A=[(C[0]-x[0])/4+x[0],(C[1]-x[1])/4+x[1]+f],E=[(x[0]+C[0])/2,(C[1]+x[1])/2],T=[(C[0]-x[0])*3/4+x[0],(C[1]-x[1])*3/4+x[1]-f];v=sn.PlotUtils.getBezierPoints([w,A,E,T,C])}return m&&(v=v.reverse()),Dl.algorithm.array2Dto1D(v)};var Bu=Dl;function NA(o,f){this.type="StraightArrow",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0,this.modifyHandler=null}NA.prototype.disable=function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0};NA.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};NA.prototype.startDraw=function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;m=kue(f.position,o.viewer),m&&(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m;m=kue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)};NA.prototype.startModify=function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v;if(v=kue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m;if(m=kue(f.endPosition,o.viewer),!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}else return},Ei.MOUSE_MOVE)};NA.prototype.createByData=function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId};NA.prototype.clear=function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1};NA.prototype.getLnglats=function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o};NA.prototype.getPositions=function(){return this.positions};NA.prototype.creatPoint=function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f};NA.prototype.showArrowOnMap=function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.fineArrow([x[0],x[1]],[C[0],C[1]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})};NA.prototype.cartesianToLatlng=function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]};function kue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var G3e=NA;var kmt=function(o,f){this.type="StraightArrow",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.extrudedHeight=100};kmt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;m=Vue(f.position,o.viewer),m&&(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m;m=Vue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v;if(v=Vue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m;if(m=Vue(f.endPosition,o.viewer),!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}else return},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.fineArrow([x[0],x[1]],[C[0],C[1]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Vue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var Vmt=kmt;var zmt=function(o){this.type="AttackArrow",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.handler=new Ur(this.viewer.scene.canvas),this.fillMaterial=Re.RED.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null};zmt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m=jJ(f.position,o.viewer);if(!m)return;o.positions.length===0&&(o.floatPoint=o.creatPoint(m),o.floatPoint.wz=-1),o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m=jJ(f.endPosition,o.viewer);!m||(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE),this.handler.setInputAction(function(f){let m=jJ(f.position,o.viewer);if(!m)return;for(let y=0;y<o.pointArr.length;y++)o.pointArr[y].show=!1;o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null;let v=o.creatPoint(m);v.show=!1,v.wz=o.positions.length,o.pointArr.push(v),o.handler.destroy()},Ei.RIGHT_CLICK)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.floatPoint&&(o.floatPoint.show=!1),o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v=jJ(f.position,o.viewer);if(!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m=jJ(f.endPosition,o.viewer);!m||o.selectPoint&&(o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m)},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.tailedAttackArrow(v),x=JSON.stringify(y.polygonalPoint).indexOf("null"),C=[];return x===-1&&(C=y.polygonalPoint),new ho(C)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function jJ(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var W3e=zmt;var Hmt=function(o){this.type="AttackArrow",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.handler=new Ur(this.viewer.scene.canvas),this.fillMaterial=Re.RED.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.extrudedHeight=100};Hmt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m=YJ(f.position,o.viewer);if(!m)return;o.positions.length===0&&(o.floatPoint=o.creatPoint(m),o.floatPoint.wz=-1),o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m=YJ(f.endPosition,o.viewer);!m||(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE),this.handler.setInputAction(function(f){let m=YJ(f.position,o.viewer);if(!m)return;for(let y=0;y<o.pointArr.length;y++)o.pointArr[y].show=!1;o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null;let v=o.creatPoint(m);v.show=!1,v.wz=o.positions.length,o.pointArr.push(v),o.handler.destroy()},Ei.RIGHT_CLICK)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.floatPoint&&(o.floatPoint.show=!1),o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v=YJ(f.position,o.viewer);if(!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m=YJ(f.endPosition,o.viewer);if(!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.tailedAttackArrow(v),x=JSON.stringify(y.polygonalPoint).indexOf("null"),C=[];return x===-1&&(C=y.polygonalPoint),new ho(C)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function YJ(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var Umt=Hmt;var Gmt=function(o){this.type="PincerArrow",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.YELLOW.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null};Gmt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;if(m=zue(f.position,o.viewer),!m)return;if(o.positions.length===0&&(o.floatPoint=o.creatPoint(m)),o.positions.length>=4){let y=o.creatPoint(m);y.wz=o.positions.length,o.pointArr.push(y);for(let x=0;x<o.pointArr.length;x++)o.pointArr[x].show=!1;o.floatPoint&&(o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null),o.handler.destroy();return}o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m;m=zue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v;if(v=zue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m;if(m=zue(f.endPosition,o.viewer),!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){return this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}})},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.threeArrow(v),x=[];return JSON.stringify(y.polygonalPoint).indexOf("null")===-1&&(x=y.polygonalPoint),new ho(x)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function zue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var j3e=Gmt;var Wmt=function(o){this.type="PincerArrow",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.YELLOW.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.extrudedHeight=100};Wmt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;if(m=Hue(f.position,o.viewer),!m)return;if(o.positions.length===0&&(o.floatPoint=o.creatPoint(m)),o.positions.length>=4){let y=o.creatPoint(m);y.wz=o.positions.length,o.pointArr.push(y);for(let x=0;x<o.pointArr.length;x++)o.pointArr[x].show=!1;o.floatPoint&&(o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null),o.handler.destroy();return}o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m;m=Hue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v;if(v=Hue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m;if(m=Hue(f.endPosition,o.viewer),!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){return this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}})},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.threeArrow(v),x=[];return JSON.stringify(y.polygonalPoint).indexOf("null")===-1&&(x=y.polygonalPoint),new ho(x)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Hue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var jmt=Wmt;var Ymt=function(o){this.type="Arrow",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0};Ymt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m=Uue(f.position,o.viewer);!m||(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m=Uue(f.endPosition,o.viewer);!m||(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v=Uue(f.position,o.viewer);if(!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m=Uue(f.endPosition,o.viewer);if(!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.Arrow([x[0],x[1]],[C[0],C[1]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Uue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var qmt=Ymt;var Xmt=function(o){this.type="Arrow",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.extrudedHeight=100};Xmt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m=Gue(f.position,o.viewer);!m||(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m=Gue(f.endPosition,o.viewer);!m||(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v=Gue(f.position,o.viewer);if(!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m=Gue(f.endPosition,o.viewer);if(!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.Arrow([x[0],x[1]],[C[0],C[1]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Gue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var Jmt=Xmt;var Kmt=function(o){this.type="surface",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.handler=new Ur(this.viewer.scene.canvas),this.fillMaterial=Re.RED.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null};Kmt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;if(m=qJ(f.position,o.viewer),!m)return;o.positions.length===0&&(o.floatPoint=o.creatPoint(m),o.floatPoint.wz=-1),o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m;m=qJ(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE),this.handler.setInputAction(function(f){let m;if(m=qJ(f.position,o.viewer),!m)return;for(let y=0;y<o.pointArr.length;y++)o.pointArr[y].show=!1;o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null;let v=o.creatPoint(m);v.show=!1,v.wz=o.positions.length,o.pointArr.push(v),o.handler.destroy()},Ei.RIGHT_CLICK)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.floatPoint&&(o.floatPoint.show=!1),o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v;if(v=qJ(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m;if(m=qJ(f.endPosition,o.viewer),!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.Surface(v);if(JSON.stringify(y).indexOf("null")!==-1)return[];let C=[];for(let w=0;w<y.length;w++){let A=new H(y[w].x,y[w].y,y[w].z);C.push(A)}return new ho(C)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function qJ(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var Qmt=Kmt;var Zmt=function(o){this.type="surface",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.handler=new Ur(this.viewer.scene.canvas),this.fillMaterial=Re.RED.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.extrudedHeight=100};Zmt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;if(m=XJ(f.position,o.viewer),!m)return;o.positions.length===0&&(o.floatPoint=o.creatPoint(m),o.floatPoint.wz=-1),o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m;m=XJ(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE),this.handler.setInputAction(function(f){let m;if(m=XJ(f.position,o.viewer),!m)return;for(let y=0;y<o.pointArr.length;y++)o.pointArr[y].show=!1;o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null;let v=o.creatPoint(m);v.show=!1,v.wz=o.positions.length,o.pointArr.push(v),o.handler.destroy()},Ei.RIGHT_CLICK)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.floatPoint&&(o.floatPoint.show=!1),o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v;if(v=XJ(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m;if(m=XJ(f.endPosition,o.viewer),!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.Surface(v);if(JSON.stringify(y).indexOf("null")!==-1)return[];let C=[];for(let w=0;w<y.length;w++){let A=new H(y[w].x,y[w].y,y[w].z);C.push(A)}return new ho(C)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function XJ(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var $mt=Zmt;var egt=function(o){this.type="assmbly",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.handler=new Ur(this.viewer.scene.canvas),this.fillMaterial=Re.RED.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null};egt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m=Wue(f.position,o.viewer);if(!m)return;if(o.positions.length===0&&(o.floatPoint=o.creatPoint(m)),o.positions.length>=3){let y=o.creatPoint(m);y.wz=o.positions.length,o.pointArr.push(y);for(let x=0;x<o.pointArr.length;x++)o.pointArr[x].show=!1;o.floatPoint&&(o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null),o.handler.destroy();return}o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m=Wue(f.endPosition,o.viewer);!m||(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.floatPoint&&(o.floatPoint.show=!1),o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v=Wue(f.position,o.viewer);if(!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m=Wue(f.endPosition,o.viewer);if(!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.Assmbly(v);if(JSON.stringify(y).indexOf("null")!==-1)return[];let C=[];for(let w=0;w<y.length;w++){let A=new H(y[w].x,y[w].y,y[w].z);C.push(A)}return new ho(C)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Wue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var tgt=egt;var igt=function(o){this.type="assmbly",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.handler=new Ur(this.viewer.scene.canvas),this.fillMaterial=Re.RED.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.extrudedHeight=100};igt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m=jue(f.position,o.viewer);if(!m)return;if(o.positions.length===0&&(o.floatPoint=o.creatPoint(m)),o.positions.length>=3){let y=o.creatPoint(m);y.wz=o.positions.length,o.pointArr.push(y);for(let x=0;x<o.pointArr.length;x++)o.pointArr[x].show=!1;o.floatPoint&&(o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null),o.handler.destroy();return}o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m=jue(f.endPosition,o.viewer);!m||(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.floatPoint&&(o.floatPoint.show=!1),o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v=jue(f.position,o.viewer);if(!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m=jue(f.endPosition,o.viewer);if(!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.Assmbly(v);if(JSON.stringify(y).indexOf("null")!==-1)return[];let C=[];for(let w=0;w<y.length;w++){let A=new H(y[w].x,y[w].y,y[w].z);C.push(A)}return new ho(C)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function jue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var rgt=igt;var ngt=function(o){this.type="sector",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.handler=new Ur(this.viewer.scene.canvas),this.fillMaterial=Re.RED.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null};ngt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;if(m=Yue(f.position,o.viewer),!m)return;if(o.positions.length===0&&(o.floatPoint=o.creatPoint(m)),o.positions.length>=3){let y=o.creatPoint(m);y.wz=o.positions.length,o.pointArr.push(y);for(let x=0;x<o.pointArr.length;x++)o.pointArr[x].show=!1;o.floatPoint&&(o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null),o.handler.destroy();return}o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m;m=Yue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.floatPoint&&(o.floatPoint.show=!1),o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v;if(v=Yue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m;if(m=Yue(f.endPosition,o.viewer),!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.Sector(v);if(JSON.stringify(y).indexOf("null")!==-1)return[];let C=[];for(let w=0;w<y.length;w++){let A=new H(y[w].x,y[w].y,y[w].z);C.push(A)}return new ho(C)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Yue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var ogt=ngt;var agt=function(o){this.type="sector",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.handler=new Ur(this.viewer.scene.canvas),this.fillMaterial=Re.RED.withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.extrudedHeight=100};agt.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null);for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;if(m=que(f.position,o.viewer),!m)return;if(o.positions.length===0&&(o.floatPoint=o.creatPoint(m)),o.positions.length>=3){let y=o.creatPoint(m);y.wz=o.positions.length,o.pointArr.push(y);for(let x=0;x<o.pointArr.length;x++)o.pointArr[x].show=!1;o.floatPoint&&(o.floatPoint.show=!1,o.earthCtrl.entities.remove(o.floatPoint),o.floatPoint=null),o.handler.destroy();return}o.positions.push(m);let v=o.creatPoint(m);o.positions.length>2?v.wz=o.positions.length-1:v.wz=o.positions.length,o.pointArr.push(v)},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<2)return;let m;m=que(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions),o.arrowEntity.objId=o.objId)))},Ei.MOUSE_MOVE)},createByData:function(o){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f;for(let m=0;m<this.positions.length;m++){let v=this.creatPoint(this.positions[m]);v.show=!1,v.wz=m+1,this.pointArr.push(v)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;let o=this;for(let f=0;f<o.pointArr.length;f++)o.pointArr[f].show=!0;this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id)o.clickStep++,m.id.objId||(o.selectPoint=m.id);else{for(let v=0;v<o.pointArr.length;v++)o.pointArr[v].show=!1;o.floatPoint&&(o.floatPoint.show=!1),o.state=-1,o.modifyHandler.destroy(),o.modifyHandler=null}if(o.clickStep===2){o.clickStep=0;let v;if(v=que(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){let m;if(m=que(f.endPosition,o.viewer),!!m)if(o.selectPoint)o.selectPoint.position.setValue(m),o.positions[o.selectPoint.wz-1]=m;else return},Ei.MOUSE_MOVE)},clear:function(){this.state=0;for(let o=0;o<this.pointArr.length;o++)this.pointArr[o]&&this.earthCtrl.entities.remove(this.pointArr[o]);this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<3)return null;let v=[];for(let w=0;w<o.length;w++){let A=f.cartesianToLatlng(o[w]);v.push(A)}let y=Bu.algorithm.Sector(v);if(JSON.stringify(y).indexOf("null")!==-1)return[];let C=[];for(let w=0;w<y.length;w++){let A=new H(y[w].x,y[w].y,y[w].z);C.push(A)}return new ho(C)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function que(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var sgt=agt;var lgt=function(o){this.type="recflag",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0};lgt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;m=Xue(f.position,o.viewer),m&&(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m;m=Xue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v;if(v=Xue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m;if(m=Xue(f.endPosition,o.viewer),!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}else return},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.Recflag([[x[0],x[1]],[C[0],C[1]]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Xue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var ugt=lgt;var cgt=function(o){this.type="recflag",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0,this.extrudedHeight=100};cgt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;m=Jue(f.position,o.viewer),m&&(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m;m=Jue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v;if(v=Jue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m;if(m=Jue(f.endPosition,o.viewer),!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}else return},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.Recflag([[x[0],x[1]],[C[0],C[1]]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Jue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var hgt=cgt;var dgt=function(o){this.type="recflag",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0};dgt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;m=Kue(f.position,o.viewer),m&&(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m;m=Kue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v;if(v=Kue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m;if(m=Kue(f.endPosition,o.viewer),!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}else return},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.Pennant([[x[0],x[1]],[C[0],C[1]]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Kue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var fgt=dgt;var pgt=function(o){this.type="recflag",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0,this.extrudedHeight=100};pgt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;m=Que(f.position,o.viewer),m&&(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m;m=Que(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v;if(v=Que(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m;if(m=Que(f.endPosition,o.viewer),!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}else return},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.Pennant([[x[0],x[1]],[C[0],C[1]]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Que(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var mgt=pgt;var ggt=function(o){this.type="recflag",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0};ggt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;m=Zue(f.position,o.viewer),m&&(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m;m=Zue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v;if(v=Zue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m;if(m=Zue(f.endPosition,o.viewer),!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}else return},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.Mflag([[x[0],x[1]],[C[0],C[1]]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function Zue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var _gt=ggt;var vgt=function(o){this.type="recflag",this.objId=Number(`${new Date().getTime()}${Number(Math.random()*1e3).toFixed(0)}`),this.earthCtrl=o,this.viewer=o.coreMap,this.handler=new Ur(this.viewer.scene.canvas),this.pointImageUrl=`${globalThis.GEOWORLD_BASE_URL}./Assets/Images/point1.png`,this.fillMaterial=Re.fromCssColorString("#0000FF").withAlpha(.8),this.outlineMaterial=new Hl({dashLength:16,color:Re.fromCssColorString("#f00").withAlpha(.7)}),this.positions=[],this.firstPoint=null,this.floatPoint=null,this.arrowEntity=null,this.state=-1,this.selectPoint=null,this.clickStep=0,this.extrudedHeight=100};vgt.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.earthCtrl.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.earthCtrl.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.earthCtrl.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.selectPoint&&(this.earthCtrl.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},disableHandler:function(){this.handler&&(this.handler.destroy(),this.handler=new Ur(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)},startDraw:function(){let o=this;this.state=1,this.handler.setInputAction(function(f){let m;m=$ue(f.position,o.viewer),m&&(o.positions.length===0&&(o.firstPoint=o.creatPoint(m),o.firstPoint.type="firstPoint",o.floatPoint=o.creatPoint(m),o.floatPoint.type="floatPoint",o.positions.push(m)),o.positions.length===3&&(o.firstPoint.show=!1,o.floatPoint.show=!1,o.handler.destroy(),o.arrowEntity.objId=o.objId,o.state=-1),o.positions.push(m.clone()))},Ei.LEFT_CLICK),this.handler.setInputAction(function(f){if(o.positions.length<1)return;let m;m=$ue(f.endPosition,o.viewer),m&&(o.floatPoint.position.setValue(m),o.positions.length>=2&&(N(o.arrowEntity)?(o.positions.pop(),o.positions.push(m)):(o.positions.push(m),o.arrowEntity=o.showArrowOnMap(o.positions))))},Ei.MOUSE_MOVE)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;let o=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new Ur(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id?(o.clickStep++,m.id.objId||(o.selectPoint=m.id)):(o.modifyHandler.destroy(),o.modifyHandler=null,o.firstPoint.show=!1,o.floatPoint.show=!1,o.state=-1),o.clickStep===2){o.clickStep=0;let v;if(v=$ue(f.position,o.viewer),!v)return;o.selectPoint&&(o.selectPoint.position.setValue(v),o.selectPoint=null)}},Ei.LEFT_CLICK),this.modifyHandler.setInputAction(function(f){if(o.selectPoint){let m;if(m=$ue(f.endPosition,o.viewer),!m)return;o.selectPoint.position.setValue(m),o.selectPoint.type==="firstPoint"&&(o.positions[1]=m),o.selectPoint.type==="floatPoint"&&(o.positions[2]=m)}else return},Ei.MOUSE_MOVE)},createByData:function(o){this.state=-1,this.positions=[];let f=[];for(let m=0;m<o.length;m++){let v=H.fromDegrees(o[m][0],o[m][1]);f.push(v)}this.positions=f,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},clear:function(){this.state=0,this.firstPoint&&this.earthCtrl.entities.remove(this.firstPoint),this.floatPoint&&this.earthCtrl.entities.remove(this.floatPoint),this.arrowEntity&&this.earthCtrl.entities.remove(this.arrowEntity),this.state=-1},getLnglats:function(){let o=[];for(let f=0;f<this.positions.length;f++){let m=this.cartesianToLatlng(this.positions[f]);o.push(m)}return o},getPositions:function(){return this.positions},creatPoint:function(o){let f=this.earthCtrl.entities.add({position:o,billboard:{image:this.pointImageUrl,verticalOrigin:so.BOTTOM,disableDepthTestDistance:Number.POSITIVE_INFINITY}});return f.attr="editPoint",f},showArrowOnMap:function(o){let f=this,m=function(){if(o.length<2)return null;let v=o[1],y=o[2],x=f.cartesianToLatlng(v),C=f.cartesianToLatlng(y),w=[],A=Bu.algorithm.Mflag([[x[0],x[1]],[C[0],C[1]]]);if(JSON.stringify(A).indexOf("null")!==-1)return[];for(let T=0;T<A.length;T++){let S=new H(A[T].x,A[T].y,A[T].z);w.push(S)}return new ho(w)};return this.earthCtrl.entities.add({polygon:new bl({hierarchy:new xn(m,!1),extrudedHeight:this.extrudedHeight,show:!0,fill:!0,material:f.fillMaterial})})},cartesianToLatlng:function(o){let f=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(o),m=xe.toDegrees(f.latitude);return[xe.toDegrees(f.longitude),m]}};function $ue(o,f){let m=f.scene.drillPick(o);f.render();let v,y=!0;for(let x=0;x<m.length;x++)(m[x]&&m[x].primitive||m[x]instanceof Qs)&&(y=!0);if(y)v=f.scene.pickPosition(o);else{let x=f.camera.getPickRay(o);if(!x)return null;v=f.scene.globe.pick(x,f.scene)}return v}var ygt=vgt;function WP(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.isActivate=!1,this.drawArr=[],this.handler=null,this.viewer=null,this.earthCtrl=null,this.options=null}WP.prototype.initialize=function(o){this.isActivate||(this.isActivate=!0,this.earthCtrl=o,this.viewer=o.coreMap,this.bindEdit())};WP.prototype.disable=function(){if(this.isActivate){this.isActivate=!1;for(let o=0;o<this.drawArr.length;o++)this.drawArr[o].disable();this.drawArr=[],this.handler&&(this.handler.destroy(),this.handler=null),this.viewer=null}};WP.prototype.addToMap=function(o,f){switch(o){case"straightArrow":let m=new G3e(this.earthCtrl,f);m.startDraw(),this.drawArr.push(m);break;case"straightArrow3D":let v=new Vmt(this.earthCtrl);v.startDraw(),this.drawArr.push(v);break;case"arrow3D":let y=new Jmt(this.earthCtrl);y.startDraw(),this.drawArr.push(y);break;case"arrow":let x=new qmt(this.earthCtrl);x.startDraw(),this.drawArr.push(x);break;case"recFlag":let C=new ugt(this.earthCtrl);C.startDraw(),this.drawArr.push(C);break;case"recFlag3D":let w=new hgt(this.earthCtrl);w.startDraw(),this.drawArr.push(w);break;case"mFlag":let A=new _gt(this.earthCtrl);A.startDraw(),this.drawArr.push(A);break;case"mFlag3D":let E=new ygt(this.earthCtrl);E.startDraw(),this.drawArr.push(E);break;case"pennant":let T=new fgt(this.earthCtrl);T.startDraw(),this.drawArr.push(T);break;case"pennant3D":let S=new mgt(this.earthCtrl);S.startDraw(),this.drawArr.push(S);break;case"sector":let M=new ogt(this.earthCtrl);M.startDraw(),this.drawArr.push(M);break;case"sector3D":let I=new sgt(this.earthCtrl);I.startDraw(),this.drawArr.push(I);break;case"assmbly":let P=new tgt(this.earthCtrl);P.startDraw(),this.drawArr.push(P);break;case"assmbly3D":let D=new rgt(this.earthCtrl);D.startDraw(),this.drawArr.push(D);break;case"surface":let L=new Qmt(this.earthCtrl);L.startDraw(),this.drawArr.push(L);break;case"surface3D":let R=new $mt(this.earthCtrl);R.startDraw(),this.drawArr.push(R);break;case"attackArrow":let O=new W3e(this.earthCtrl);O.startDraw(),this.drawArr.push(O);break;case"attackArrow3D":let F=new Umt(this.earthCtrl);F.startDraw(),this.drawArr.push(F);break;case"pincerArrow":let k=new j3e(this.earthCtrl);k.startDraw(),this.drawArr.push(k);break;case"pincerArrow3D":let U=new jmt(this.earthCtrl);U.startDraw(),this.drawArr.push(U);break;default:break}};WP.prototype.saveData=function(){let o={straightArrowData:[],attackArrowData:[],pincerArrowData:[]};for(let f=0;f<this.drawArr.length;f++){let m=this.drawArr[f],v=m.getLnglats();m.type==="StraightArrow"?o.straightArrowData.push(v):m.type==="AttackArrow"?o.attackArrowData.push(v):o.pincerArrowData.push(v)}console.log(`\u4FDD\u5B58\u7684\u6570\u636E\uFF1A${JSON.stringify(o)}`)};WP.prototype.showData=function(o){if(!o)return;let f=o.straightArrowData,m=o.attackArrowData,v=o.pincerArrowData;for(let y=0;y<f.length;y++){let x=f[y],C=new G3e(this.viewer);C.createByData(x),this.drawArr.push(C)}for(let y=0;y<m.length;y++){let x=m[y],C=new W3e(this.viewer);C.createByData(x),this.drawArr.push(C)}for(let y=0;y<v.length;y++){let x=v[y],C=new j3e(this.viewer);C.createByData(x),this.drawArr.push(C)}};WP.prototype.nowArrowObj=null;WP.prototype.bindEdit=function(){let o=this;this.handler=new Ur(this.viewer.scene.canvas),this.handler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id){if(o.nowArrowObj&&o.nowArrowObj.state!==-1){console.log("\u4E0A\u4E00\u6B65\u64CD\u4F5C\u672A\u7ED3\u675F\uFF0C\u8BF7\u7EE7\u7EED\u5B8C\u6210\u4E0A\u4E00\u6B65\uFF01");return}for(let v=0;v<o.drawArr.length;v++)if(m.id.objId===o.drawArr[v].objId){o.nowArrowObj=o.drawArr[v],o.drawArr[v].startModify();break}}},Ei.LEFT_CLICK)};WP.prototype.clearOne=function(){let o=this;this.handler.setInputAction(function(f){let m=o.viewer.scene.pick(f.position);if(N(m)&&m.id){for(let v=0;v<o.drawArr.length;v++)if(m.id.objId===o.drawArr[v].objId){o.drawArr[v].clear(),o.drawArr.splice(v,1);break}o.handler.destroy(),o.bindEdit()}},Ei.LEFT_CLICK)};WP.prototype.clearAll=function(){for(let o=0;o<this.drawArr.length;o++)this.drawArr[o].clear()};var Y3e=WP;function n0(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}n0.prototype.createPolylineVolume=function(o,f,m,v,y){var x={positions:[],shape:this.starPositions(7,3e4,2e4),material:this._cesium.Color.fromRandom({alpha:1})};if(this._core.isnull(v)){console.log("options is required");return}v=this._core.extend(x,v,!0);var C=[];if(!f[0].x&&!f[0].y){if(f[0].length===2)for(var w=0;w<f.length;w++)C.push(this._cesium.Cartesian3.fromDegrees(f[w][0],f[w][1]));else if(f[0].length===3)for(var w=0;w<f.length;w++)C.push(this._cesium.Cartesian3.fromDegrees(f[w][0],f[w][1],f[w][2]))}else if(f[0].z)for(var w=0;w<f.length;w++)C.push(this._cesium.Cartesian3.fromDegrees(f[w].x,f[w].y,f[w].z));else for(var w=0;w<f.length;w++)C.push(this._cesium.Cartesian3.fromDegrees(f[w].x,f[w].y));v.positions=C,m==="circle"?v.shape=this.computeCircle(v.radius||10):m==="star"?(v.shape=this.starPositions(v.arms||7,v.rOuter||30,v.rInner||20),v.cornerType=this._cesium.CornerType.MITERED):m==="box"&&(v.radius=v.radius||10,v.shape=[new this._cesium.Cartesian2(-v.radius,-v.radius),new this._cesium.Cartesian2(v.radius,-v.radius),new this._cesium.Cartesian2(v.radius,v.radius),new this._cesium.Cartesian2(-v.radius,v.radius)],v.cornerType=this._cesium.CornerType.BEVELED);var A=this._viewer.entities.add({id:this._core.getuid(),name:o,polylineVolume:v});return this.item=A,this._tree.insertGroupId({id:A.id,name:o,pId:this._core.isnull(y)?0:y,type:"polylinevolume",item:this},this._core.isnull(y)?0:y),this};n0.prototype.getstyles=function(){var o={};return o.show=this.item.polylineVolume.show?this.item.polylineVolume.show._value:!0,o.positions=this.item.polylineVolume.positions.getValue().toString(),o.shape=this.item.polylineVolume.shape.toString(),o.cornerType=this.item.polylineVolume.cornerType?this.item.polylineVolume.cornerType.toString():null,o.granularity=this.item.polylineVolume.granularity?this.item.polylineVolume.granularity.toString():null,o.fill=this.item.polylineVolume.fill?this.item.polylineVolume.fill._value:null,o.material=this.item.polylineVolume.material?this.item.polylineVolume.material.toString():null,o.outline=this.item.polylineVolume.outline?this.item.polylineVolume.outline._value:null,o.outlineWidth=this.item.polylineVolume.outlineWidth?this.item.polylineVolume.outlineWidth.toString():null,o.outlineColor=this.item.polylineVolume.outlineColor&&this.item.polylineVolume.outlineColor._value?"rgba"+this.item.polylineVolume.outlineColor.toString():null,o.near=this.item.polylineVolume.distanceDisplayCondition?this.item.polylineVolume.distanceDisplayCondition._value.near:null,o.far=this.item.polylineVolume.distanceDisplayCondition?this.item.polylineVolume.distanceDisplayCondition._value.far:null,o};n0.prototype.executeWall=function(o,f){var m=[],v=void 0,y=this,x=function(){function w(A){this.options={id:y._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:y._cesium.Color.AQUA.withAlpha(1)}},this.positions=A,this._init()}return w.prototype._init=function(){var A=this,E=function(){for(var I=[],P=0;P<A.positions.length;P++){if(!m[P])return;var D=y._viewer.scene.globe.ellipsoid,L=new y._cesium.Cartesian3(m[P].x,m[P].y,m[P].z),R=D.cartesianToCartographic(L),O=y._cesium.Math.toDegrees(R.latitude),F=y._cesium.Math.toDegrees(R.longitude),k=R.height;I.push(F),I.push(O)}return y._cesium.Cartesian3.fromDegreesArray(I)},T=function(){for(var I=[],P=0;P<A.positions.length;P++)I.push(2e3);return I},S=function(){for(var I=[],P=0;P<A.positions.length;P++)I.push(1e3);return I};this.options.wall.maximumHeights=new y._cesium.CallbackProperty(T,!1),this.options.wall.minimumHeights=new y._cesium.CallbackProperty(S,!1),this.options.wall.positions=new y._cesium.CallbackProperty(E,!1);var M=y._viewer.entities.add(this.options);y.item=M,y._tree.insertGroupId({id:this.options.id,name:o,pId:y._core.isnull(f)?0:f,type:"wall",item:y},y._core.isnull(f)?0:f)},w}(),C=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);C.setInputAction(function(w){var A=y._viewer.scene.camera.pickEllipsoid(w.position,y._viewer.scene.globe.ellipsoid);m.length==0&&m.push(Ji.clone(A)),m.push(Ji.clone(A))},y._cesium.ScreenSpaceEventType.LEFT_CLICK),C.setInputAction(function(w){var A=y._viewer.scene.camera.pickEllipsoid(w.endPosition,y._viewer.scene.globe.ellipsoid);m.length>=1&&(y._cesium.defined(v)?(m.pop(),m.push(A)):v=new x(m))},y._cesium.ScreenSpaceEventType.MOUSE_MOVE),C.setInputAction(function(w){C.destroy(),m.pop()},y._cesium.ScreenSpaceEventType.RIGHT_CLICK)};n0.prototype.starPositions=function(o,f,m){for(var v=Math.PI/o,y=[],x=0;x<2*o;x++){var C=x%2===0?f:m,w=new this._cesium.Cartesian2(Math.cos(x*v)*C,Math.sin(x*v)*C);y.push(w)}return y};n0.prototype.computeCircle=function(o){for(var f=[],m=0;m<360;m++){var v=this._cesium.Math.toRadians(m);f.push(new this._cesium.Cartesian2(o*Math.cos(v),o*Math.sin(v)))}return f};n0.prototype.setVisibility=function(o){this.item.polylineVolume.show=o};n0.prototype.getVisibility=function(){return this.item.polylineVolume.show};n0.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)};Object.defineProperties(n0.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(o){this.item.rectangle=o}}});Object.defineProperties(n0.prototype,{polyline:{get:function(){return this.item.polyline},set:function(o){this.item.polyline=o}}});n0.prototype.setItem=function(o){this.item=o};n0.prototype.setTreeobj=function(o){this.treeobj=o};Object.defineProperties(n0.prototype,{polygon:{get:function(){return this.item.polygon},set:function(o){this.item.polygon=o}}});Object.defineProperties(n0.prototype,{point:{get:function(){return this.item.point},set:function(o){this.item.point=o}}});Object.defineProperties(n0.prototype,{label:{get:function(){return this.item.label},set:function(o){this.item.label=o}}});Object.defineProperties(n0.prototype,{model:{get:function(){return this.item.model},set:function(o){this.item.model=o}}});Object.defineProperties(n0.prototype,{wall:{get:function(){return this.item.wall},set:function(o){this.item.wall=o}}});Object.defineProperties(n0.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}});var ece=n0;function lN(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}lN.prototype.createCorridor=function(o,f,m,v){var y={show:!0,material:this._cesium.Color.RED.withAlpha(.5),width:1e3};if(this._core.isnull(m)){console.log("options is required");return}m=this._core.extend(y,m,!0);var x=[];if(!f[0].x&&!f[0].y){if(f[0].length===2)for(var C=0;C<f.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(f[C][0],f[C][1]));else if(f[0].length===3)for(var C=0;C<f.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(f[C][0],f[C][1],f[C][2]))}else if(f[0].z!==void 0)for(var C=0;C<f.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(f[C].x,f[C].y,f[C].z));else for(var C=0;C<f.length;C++)x.push(this._cesium.Cartesian3.fromDegrees(f[C].x,f[C].y));m.positions=x;var w=this._viewer.entities.add({name:o,id:this._core.getuid(),corridor:m});return this.item=w,this._tree.insertGroupId({id:w.id,name:o,pId:this._core.isnull(v)?0:v,type:"corridor",item:this},this._core.isnull(v)?0:v),this};lN.prototype.getstyles=function(){var o={};return o.show=this.item.ellipse.show?this.item.ellipse.show._value:!0,o.positions=this.item.ellipse.positions?this.item.ellipse.positions.getValue().toString():void 0,o.width=this.item.ellipse.width&&this.item.ellipse.width._value?this.item.ellipse.width.toString():void 0,o.height=this.item.ellipse.height&&this.item.ellipse.height._value?this.item.ellipse.height.toString():void 0,o.heightReference=this.item.ellipse.heightReference&&this.item.ellipse.heightReference._value?this.item.ellipse.heightReference._value:void 0,o.extrudedHeight=this.item.ellipse.extrudedHeight&&this.item.ellipse.extrudedHeight.getValue()?this.item.ellipse.extrudedHeight.getValue():void 0,o.extrudedHeightReference=this.item.ellipse.extrudedHeightReference&&this.item.ellipse.extrudedHeightReference._value?this.item.ellipse.extrudedHeightReference._value:void 0,o.cornerType=this.item.ellipse.cornerType?this.item.ellipse.cornerType._value:void 0,o.material={},tyles.material.color=this.item.ellipse.material&&this.item.ellipse.material.color&&this.item.ellipse.material.color._value?this.item.ellipse.material.color.toString():void 0,o.material.image=this.item.ellipse.material&&this.item.ellipse.material.image&&this.item.ellipse.material.image._value?this.item.ellipse.material.image._value:void 0,o.material.repeat=this.item.ellipse.material&&this.item.ellipse.material.repeat&&this.item.ellipse.material.repeat._value?this.item.ellipse.material.repeat._value:void 0,o.fill=this.item.ellipse.fill?this.item.ellipse.fill._value:void 0,o.outline=this.item.ellipse.outline?this.item.ellipse.outline._value:void 0,o.outlineWidth=this.item.ellipse.outlineWidth&&this.item.ellipse.outlineWidth._value?this.item.ellipse.outlineWidth._value:void 0,o.outlineColor=this.item.ellipse.outlineColor&&this.item.ellipse.outlineColor._value?"rgba"+this.item.ellipse.outlineColor.toString():void 0,o.near=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.near:void 0,o.far=this.item.ellipse.distanceDisplayCondition?this.item.ellipse.distanceDisplayCondition._value.far:void 0,o.position=this.item.position.getValue().toString(),o};lN.prototype.setVisibility=function(o){this.item.show=o};lN.prototype.getVisibility=function(){return this.item.show};lN.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)};lN.prototype.setItem=function(o){this.item=o};lN.prototype.setTreeobj=function(o){this.treeobj=o};var xgt=lN;function q3e(o,f){this._viewer=o,this._cesium=f}q3e.prototype.createPosition=function(o,f,m){var v=new this.Cartesian3.fromDegrees(o,f,m);return v};q3e.prototype.CreatePosition=function(o,f,m,v,y,x,C,w){var A={X:o,Y:f,Altitude:m,AltitudeType:v,Yaw:y,Pitch:x,Roll:C,Distance:w};return A};var X3e=q3e;function kp(o,f){this._viewer=o,this._cesium=f,this._tree=Ne,this._core=new Sr(o,f),this._Color=new no(this._viewer,this._cesium)}kp.prototype.createImageLabel=function(o,f,m,v){var y={id:this._core.getuid(),image:"../images/Cesium_Logo_overlay.png",show:!0,color:this._cesium.Color.IVORY},x=this._core.extend(y,f,!0);x.color&&!this._core.isnull(x)&&!this._core.isnull(x.color)&&(x.color.toString().charAt(0)=="["&&x.color.toString().charAt(x.color.length-1)=="]"||(this._core.isHtmlColor(x.color)&&/^#/.test(x.color.toString())?x.color=this._Color.colorFromHtmlColor(x.color):(/^rgb/.test(x.color)&&(x.color=this._Color.rgbaStringToRgbaObj(x.color)),x.color.r>1&&(x.color.r=x.color.r/255),x.color.g>1&&(x.color.g=x.color.g/255),x.color.b>1&&(x.color.b=x.color.b/255),x.color.a>1&&(x.color.a=x.color.a/255),x.color.r&&(x.color=this._Color.createColor(x.color.r,x.color.g,x.color.b,x.color.a))))),x.near&&x.far&&(x.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(x.near,x.far)),this.item=this._viewer.entities.add({name:v,position:this._cesium.Cartesian3.fromDegrees(o[0],o[1],o[2]),billboard:x});var C={id:this.item.id,name:v,pId:this._core.isnull(m)?0:m,type:"Imagelabel",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(m)?0:m),this};kp.prototype.getstyles=function(){var o={};return o.show=this.item.billboard.show?this.item.billboard.show._value:!0,o.image=this.item.billboard.image&&this.item.billboard.image._value?this.item.billboard.image._value:void 0,o.scale=this.item.billboard.scale&&this.item.billboard.scale._value?this.item.billboard.scale._value:void 0,o.pixelOffset=this.item.billboard.pixelOffset?this.item.billboard.pixelOffset._value:void 0,o.horizontalOrigin=this.item.billboard.horizontalOrigin&&this.item.billboard.horizontalOrigin._value?this.item.billboard.horizontalOrigin._value:void 0,o.verticalOrigin=this.item.billboard.verticalOrigin&&this.item.billboard.verticalOrigin._value?this.item.billboard.verticalOrigin._value:void 0,o.heightReference=this.item.billboard.heightReference&&this.item.billboard.heightReference._value&&this.item.billboard.heightReference._value?this.item.billboard.heightReference._value:null,o.color=this.item.billboard.color&&this.item.billboard.color._value?"rgba"+this.item.billboard.color.toString():void 0,o.width=this.item.billboard.width&&this.item.billboard.width._value?this.item.billboard.width._value:void 0,o.height=this.item.billboard.height&&this.item.billboard.height._value?this.item.billboard.height._value:void 0,o.near=this.item.billboard.distanceDisplayCondition?this.item.billboard.distanceDisplayCondition._value.near:void 0,o.far=this.item.billboard.distanceDisplayCondition?this.item.billboard.distanceDisplayCondition._value.far:void 0,o.position=this.item.position.getValue().toString(),o};kp.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)};kp.prototype.setDistanceDisplayCondition=function(o,f){var m=new this._cesium.DistanceDisplayCondition(o,f);try{this.item._billboard.distanceDisplayCondition=m}catch(v){console.log(v)}return this};kp.prototype.setUrl=function(o){this.item._billboard.image=o};kp.prototype.setVisibility=function(o){this.item.show=o};kp.prototype.getVisibility=function(){return this.item.show};kp.prototype.setColor=function(o){try{this.item._billboard.color=new no(this._viewer,this._cesium).colorFromHtmlColor(o),this.item.color=this.item._billboard.color}catch(f){console.log(f)}return this};kp.prototype.setWidth=function(o){try{this.item._billboard.width=o}catch(f){console.log(f)}return this};kp.prototype.setColorAlpha=function(o){try{this.item._billboard.color._value.alpha=o}catch(f){console.log(f)}return this};kp.prototype.setHeight=function(o){try{this.item._billboard.height=o}catch(f){console.log(f)}return this};kp.prototype.setHeightType=function(o){try{o==1?this.item._billboard.heightReference=this._cesium.HeightReference.CLAMP_TO_GROUND:o==2?this.item._billboard.heightReference=this._cesium.HeightReference.NONE:o==3&&(this.item._billboard.heightReference=this._cesium.HeightReference.RELATIVE_TO_GROUND)}catch(f){console.log(f)}return this};kp.prototype.setRotation=function(o){try{this.item._billboard.rotation=this._cesium.Math.toRadians(o)}catch(f){console.log(f)}return this};kp.prototype.setItem=function(o){this.item=o};kp.prototype.setScale=function(o){try{this.item._billboard.scale=o}catch(f){console.log(f)}return this};kp.prototype.CreateImageLabel=function(o,f,m,v,y){var x={id:this._core.getuid(),image:kp,show:!0,scale:m.Scale,color:m.IconColor,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(m.MinViewingHeight,m.MaxViewingHeight)};this.item=this._viewer.entities.add({name:y,position:this._cesium.Cartesian3.fromDegrees(positions.X,positions.X,positions.Altitude),billboard:x});var C=this.item.id;y==""&&(C=y);var w={id:this.item.id,name:C,pId:this._core.isnull(v)?0:v,type:"Imagelabel",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,this._core.isnull(v)?0:v),this};kp.prototype.export=function(){var o=this.item.billboard.image==null?void 0:this.item.billboard.image._value,f=this.item.billboard.show==null?void 0:this.item.billboard.show._value,m=this.item.billboard.scale==null?void 0:this.item.billboard.scale._value,v=this.item.billboard.horizontalOrigin==null?void 0:this.item.billboard.horizontalOrigin._value,y=this.item.billboard.verticalOrigin==null?void 0:this.item.billboard.verticalOrigin._value,x=this.item.billboard.rotation==null?void 0:this.item.billboard.rotation._value,C=this.item.billboard.width==null?void 0:this.item.billboard.width._value,w=this.item.billboard.height==null?void 0:this.item.billboard.height._value,A=this.item.billboard.color==null?void 0:"rgba("+this.item.billboard.color._value.red+","+this.item.billboard.color._value.green+","+this.item.billboard.color._value.blue+","+this.item.billboard.color._value.alpha+")",E=this.item.billboard.heightReference==null?void 0:this.item.billboard.heightReference._value,T=this.item.billboard.distanceDisplayCondition,S=T?._value.near,M=T?._value.far,I=this._cesium.Cartographic.fromCartesian(this.item.position._value),P=this._cesium.Math.toDegrees(I.longitude),D=this._cesium.Math.toDegrees(I.latitude),L=this._cesium.Math.toDegrees(I.height);return{type:"image",position:{x:P,y:D,z:L},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{image:o,show:f,scale:m,horizontalOrigin:v,verticalOrigin:y,rotation:x,width:C,height:w,color:A,heightReference:E,near:S,far:M}}};kp.prototype.setTreeobj=function(o){this.treeobj=o};Object.defineProperties(kp.prototype,{position:{Altitude:{get:function(){return this._postion.Altitude},set:function(o){try{var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Math.toDegrees(f.height),x=this._cesium.Cartesian3.fromDegrees(m,v,o);this.item.position.position=x,this._postion.Altitude=o}catch(C){console.log(C)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(o){try{this._postion.AltitudeType=o}catch(f){console.log(f)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(o){try{this._postion.Cartesian=o}catch(f){console.log(f)}}},Distance:{get:function(){return this._postion.Distance},set:function(o){try{this._postion.Distance=o}catch(f){console.log(f)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(o){try{this._postion.Pitch=o}catch(f){console.log(f)}}},Roll:{get:function(){return this._postion.Roll},set:function(o){try{this._postion.Roll=o}catch(f){console.log(f)}}},X:{get:function(){return this._postion.X},set:function(o){try{this._postion.X=o;var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Math.toDegrees(f.height),x=this._cesium.Cartesian3.fromDegrees(o,v,y);this.item.position.position=x}catch(C){console.log(C)}}},Y:{get:function(){return this._postion.Y},set:function(o){try{this._postion.Y=o;var f=this._cesium.Cartographic.fromCartesian(this.item.position._value),m=this._cesium.Math.toDegrees(f.longitude),v=this._cesium.Math.toDegrees(f.latitude),y=this._cesium.Math.toDegrees(f.height),x=this._cesium.Cartesian3.fromDegrees(m,o,y);this.item.position.position=x}catch(C){console.log(C)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(o){try{this._postion.Yaw=o}catch(f){console.log(f)}}}},LabelStyle:{BackgroundColor:{get:function(){return""},set:function(o){}},Bold:{get:function(){return""},set:function(o){}},FontName:{get:function(){return""},set:function(o){}},FontSize:{get:function(){return""},set:function(o){}},FrameFileName:{get:function(){return""},set:function(o){}},IconColor:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.label.fillColor=o)},500),get:function(){var o=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}},Italic:{get:function(){return""},set:function(o){}},LimitScreenSize:{get:function(){return""},set:function(o){}},LineColor:{get:function(){return""},set:function(o){}},LineToGround:{get:function(){return""},set:function(o){}},LockMode:{get:function(){return""},set:function(o){}},MaxImageSize:{get:function(){return""},set:function(o){}},MaxViewingHeight:{get:function(){if(this.item._label.distanceDisplayCondition!=null)return this.item._label.distanceDisplayCondition._value.far},set:function(o){var f=0;this.item._label.distanceDisplayCondition!=null&&(f=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(f,o)}},MinViewingHeight:{get:function(){if(this.item._label.distanceDisplayCondition!=null)return this.item._label.distanceDisplayCondition._value.near},set:function(o){var f=0;this.item._label.distanceDisplayCondition!=null&&(f=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,f)}},MultilineJustification:{get:function(){return""},set:function(o){}},PivotAlignment:{get:function(){return""},set:function(o){}},Scale:{get:function(){if(this.item._label.scale!=null)return this.item.label.scale.getValue()},set:function(o){this.item.label.scale.setValue(o)}},TextAlignment:{get:function(){return""},set:function(o){}},TextColor:{get:function(){return""},set:function(o){}},TextOnImage:{get:function(){return""},set:function(o){}},Underline:{get:function(){return""},set:function(o){}}}});kp.prototype.CreateImageLabel=function(o,f,m,v,y){this._postion=o;var x={id:this._core.getuid(),image:f,backgroundColor:m.BackgroundColor,fillColor:m.IconColor,font:m.FontName,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,outlineColor:m.LineColor,show:!0,scale:m.Scale,showBackground:!1,distanceDisplayCondition:new this._cesium.DistanceDisplayCondition(m.MinViewingHeight,m.MaxViewingHeight)};m.Italic&&(x.font="italic "+x.font),m.Italic&&(x.font="Bold "+x.font);var C=this._core.extend(x,m,!0);this.item=this._viewer.entities.add({name:y,position:this._cesium.Cartesian3.fromDegrees(o.X,o.Y,o.Altitude),billboard:C});var w={id:this.item.id,name:y,pId:this._core.isnull(v)?0:v,type:"ImageLabel",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,this._core.isnull(v)?0:v),this};Object.defineProperties(kp.prototype,{Position:{Altitude:{get:function(){return this._postion.Altitude},set:function(o){try{this._postion.Altitude=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},AltitudeType:{get:function(){return this._postion.AltitudeType},set:function(o){try{this._postion.AltitudeType=o}catch(f){console.log(f)}}},Cartesian:{get:function(){return this._postion.Cartesian},set:function(o){try{this._postion.Cartesian=o}catch(f){console.log(f)}}},Distance:{get:function(){return this._postion.Distance},set:function(o){try{this._postion.Distance=o}catch(f){console.log(f)}}},Pitch:{get:function(){return this._postion.Pitch},set:function(o){try{this._postion.Pitch=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},Roll:{get:function(){return this._postion.Roll},set:function(o){try{this._postion.Roll=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}},X:{get:function(){return this._postion.X},set:function(o){try{this._postion.X=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Y:{get:function(){return this._postion.Y},set:function(o){try{this._postion.Y=o,this.item.position=this._cesium.Cartesian3.fromDegrees(this._postion.X,this._postion.Y,this._postion.Altitude)}catch(f){console.log(f)}}},Yaw:{get:function(){return this._postion.Yaw},set:function(o){try{this._postion.Yaw=o,this.item.orientation=this._cesium.Transforms.headingPitchRollQuaternion(this.item.position._value,new this._cesium.HeadingPitchRoll(this._cesium.Math.toRadians(this._postion.Yaw),this._cesium.Math.toRadians(this._postion.Pitch),this._cesium.Math.toRadians(this._postion.Roll)))}catch(f){console.log(f)}}}},LabelStyle:{BackgroundColor:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.label.backgroundColor=o,this.item.backgroundColor=o)},500),get:function(){var o=this.item.label.backgroundColor;return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}},Bold:{get:function(){var o=this.item._label.font.getValue();return o.indexOf("bold")!=-1},set:function(){var o="bold "+this.item._label.font.getValue(),f=this.item._label.font.setValue(o)}},FontName:{get:function(){for(var o=this.item._label.font.getValue(),f=o.split(" "),m=0;m<f.length;m++)if(f[m]!="bold"&&f[m].indexOf("px")==-1&&f[m].indexOf("PX")==-1)return f[m]},set:function(o){for(var f=this.item._label.font.getValue(),m=f.split(" "),v=o,y=0;y<m.length;y++)m[y]!="bold"&&m[y].indexOf("px")==-1&&m[y].indexOf("PX")==-1||(v=v+" "+m[y]);var x=this.item._label.font.setValue(v)}},FontSize:{get:function(){for(var o=this.item._label.font.getValue(),f=o.split(" "),m=0;m<f.length;m++)if(f[m].indexOf("px")!=-1)return f[m]},set:function(o){for(var f=this.item._label.font.getValue(),m=f.split(" "),v=o,y=0;y<m.length;y++)m[y].indexOf("px")==-1||(v=v+" "+m[y]);var x=this.item._label.font.setValue(v)}},FrameFileName:{get:function(){return""},set:function(o){}},IconColor:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.label.fillColor=o)},500),get:function(){var o=this.item.label.fillColor;return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}},Italic:{get:function(){for(var o=this.item._label.font.getValue(),f=o.split(" "),m=0;m<f.length;m++)if(f[m].indexOf("italic")!=-1)return f[m]},set:function(o){for(var f=this.item._label.font.getValue(),m=f.split(" "),v=o,y=0;y<m.length;y++)m[y].indexOf("italic")==-1||(v=v+" "+m[y]);var x=this.item._label.font.setValue(v)}},LimitScreenSize:{get:function(){return""},set:function(o){}},LineColor:{set:Ji.debounce(function(o){this._core.isnull(o)||(this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._Color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._Color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._Color.createColor(o.r,o.g,o.b,o.a))),this.item.label.outlineColor=o)},500),get:function(){var o=this.item.label.outlineColor;return this._Color.toHtmlColor("rgb("+o._value.red*255+","+o._value.green*255+","+o._value.blue*255+","+o._value.alpha*255+")")}},LineToGround:{get:function(){return""},set:function(o){}},LockMode:{get:function(){return""},set:function(o){}},MaxImageSize:{get:function(){return""},set:function(o){}},MaxViewingHeight:{get:function(){if(this.item._label.distanceDisplayCondition!=null)return this.item._label.distanceDisplayCondition._value.far},set:function(o){var f=0;this.item._label.distanceDisplayCondition!=null&&(f=this.item._label.distanceDisplayCondition._value.near),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(f,o)}},MinViewingHeight:{get:function(){if(this.item._label.distanceDisplayCondition!=null)return this.item._label.distanceDisplayCondition._value.near},set:function(o){var f=0;this.item._label.distanceDisplayCondition!=null&&(f=this.item._label.distanceDisplayCondition._value.far),this.item._label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,f)}},MultilineJustification:{get:function(){return""},set:function(o){}},PivotAlignment:{get:function(){return""},set:function(o){}},Scale:{get:function(){if(this.item._label.scale!=null)return this.item.label.scale.getValue()},set:function(o){this.item.label.scale.setValue(o)}},TextAlignment:{get:function(){return""},set:function(o){}},TextColor:{get:function(){return""},set:function(o){}},TextOnImage:{get:function(){return""},set:function(o){}},Underline:{get:function(){return""},set:function(o){}}}});var uN=kp;function V_(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}V_.prototype.createWall=function(o,f,m,v){var y=[];if(typeof o=="object"){let A=o,E=this._core.defaultValue(A.alpha,.6);A.points.forEach(T=>{y.push(Cesium.Cartesian3.fromDegrees(T.x,T.y))}),this.item=this._viewer.entities.add({name:A.name,id:A.id||this._core.getuid(),wall:{positions:y,material:Cesium.Color.fromCssColorString(A.color||"#f00").withAlpha(E),minimumHeights:new Array(y.length).fill(A.bottomHeight),maximumHeights:new Array(y.length).fill(A.topHeight)}}),this.item.objectType="wall"}else{var x={show:!0,minimumHeights:[100,100,100,100,100,100,100],maximumHeights:[2e3,2e3,2e3,2e3,2e3,2e3,2e3],material:this._cesium.Color.AQUA.withAlpha(1)};if(this._core.isnull(m)){console.log("options is required");return}m=this._core.extend(x,m,!0);var C=new Sr(this._viewer,this._cesium);if(m&&m.material=="ImageMaterialProperty"?m.material=C.setImageMaterialProperty("../../img/arrow.png",this._cesium,0,m.id):m&&m.material=="DrawCanvasColorUpdown"&&(m.material=C.setImageMaterialProperty("../../img/arrow.png",this._cesium,1,m.id)),!f[0].x&&!f[0].y){if(f[0].length===2)for(var w=0;w<f.length;w++)y.push(this._cesium.Cartesian3.fromDegrees(f[w][0],f[w][1]));else if(f[0].length===3)for(var w=0;w<f.length;w++)y.push(this._cesium.Cartesian3.fromDegrees(f[w][0],f[w][1],f[w][2]))}else if(f[0].z!==void 0)for(var w=0;w<f.length;w++)y.push(this._cesium.Cartesian3.fromDegrees(f[w].x,f[w].y,f[w].z));else for(var w=0;w<f.length;w++)y.push(this._cesium.Cartesian3.fromDegrees(f[w].x,f[w].y));m.positions=y,m.minHeight!==void 0&&(m.minimumHeights=new Array(m.positions.length).fill(m.minHeight)),m.maxHeight!==void 0&&(m.maximumHeights=new Array(m.positions.length).fill(m.maxHeight)),this.item=this._viewer.entities.add({name:o,id:this._core.getuid(),wall:m}),this.item.positions=m.positions}return this._tree.insertGroupId({id:this.item.id,name:o,pId:this._core.isnull(v)?0:v,type:"wall",item:this},this._core.isnull(v)?0:v),this};V_.prototype.executeWall=function(o,f){var m=[],v=void 0,y=this,x=function(){function w(A){this.options={id:y._core.getuid(),type:"wall",wall:{positions:[],minimumHeights:[2e3,2e3],maximumHeights:[1e3,1e3],material:y._core.setImageMaterialProperty("img/arrow.png",y._cesium,1)}},this.positions=A,this._init()}return w.prototype._init=function(){var A=this,E=function(){for(var I=[],P=0;P<A.positions.length;P++){if(!m[P])return;var D=y._viewer.scene.globe.ellipsoid,L=new y._cesium.Cartesian3(m[P].x,m[P].y,m[P].z),R=D.cartesianToCartographic(L),O=y._cesium.Math.toDegrees(R.latitude),F=y._cesium.Math.toDegrees(R.longitude),k=R.height;I.push(F),I.push(O)}return y._cesium.Cartesian3.fromDegreesArray(I)},T=function(){for(var I=[],P=0;P<A.positions.length;P++)I.push(2e3);return I},S=function(){for(var I=[],P=0;P<A.positions.length;P++)I.push(1e3);return I};this.options.wall.maximumHeights=new y._cesium.CallbackProperty(T,!1),this.options.wall.minimumHeights=new y._cesium.CallbackProperty(S,!1),this.options.wall.positions=new y._cesium.CallbackProperty(E,!1);var M=y._viewer.entities.add(this.options);y.item=M,y._tree.insertGroupId({id:this.options.id,name:o,pId:y._core.isnull(f)?0:f,type:"wall",item:y},y._core.isnull(f)?0:f)},w}(),C=new this._cesium.ScreenSpaceEventHandler(this._viewer.scene.canvas);C.setInputAction(function(w){var A=y._viewer.scene.camera.pickEllipsoid(w.position,y._viewer.scene.globe.ellipsoid);m.length==0&&m.push(Ji.clone(A)),m.push(Ji.clone(A))},y._cesium.ScreenSpaceEventType.LEFT_CLICK),C.setInputAction(function(w){var A=y._viewer.scene.camera.pickEllipsoid(w.endPosition,y._viewer.scene.globe.ellipsoid);m.length>=1&&(y._cesium.defined(v)?(m.pop(),m.push(A)):v=new x(m))},y._cesium.ScreenSpaceEventType.MOUSE_MOVE),C.setInputAction(function(w){C.destroy(),m.pop()},y._cesium.ScreenSpaceEventType.RIGHT_CLICK)};var J3e="a",JJ=0;V_.prototype.drawCanvasImage=function(o,f){var m=document.getElementById("canvas-"+J3e),v=700,y=100,x=m.getContext("2d"),C=new Image;return C.src="img/arrow.png",x.clearRect(0,0,v,y),C.onload=function(){JJ<=v?(x.drawImage(C,JJ,0),x.drawImage(C,JJ+100,0)):JJ=0,JJ+=5},J3e=J3e==="a"?"b":"a",m};V_.prototype.setVisibility=function(o){this.item.wall.show=o};V_.prototype.getVisibility=function(){return this.item.wall.show};V_.prototype.deleteObject=function(){this._viewer.entities.remove(this.item)};Object.defineProperties(V_.prototype,{rectangle:{get:function(){return this.item.rectangle},set:function(o){this.item.rectangle=o}}});Object.defineProperties(V_.prototype,{polyline:{get:function(){return this.item.polyline},set:function(o){this.item.polyline=o}}});V_.prototype.setItem=function(o){this.item=o};V_.prototype.setTreeobj=function(o){this.treeobj=o};Object.defineProperties(V_.prototype,{polygon:{get:function(){return this.item.polygon},set:function(o){this.item.polygon=o}}});Object.defineProperties(V_.prototype,{point:{get:function(){return this.item.point},set:function(o){this.item.point=o}}});Object.defineProperties(V_.prototype,{label:{get:function(){return this.item.label},set:function(o){this.item.label=o}}});Object.defineProperties(V_.prototype,{model:{get:function(){return this.item.model},set:function(o){this.item.model=o}}});Object.defineProperties(V_.prototype,{wall:{get:function(){return this.item.wall},set:function(o){this.item.wall=o}}});Object.defineProperties(V_.prototype,{wallTempOptions:{get:function(){return{positions:[],maximumHeights:[],minimumHeights:[],show:!0,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,granularity:this._cesium.Math.RADIANS_PER_DEGREE,shadows:ShadowMode.DISABLED,distanceDisplayCondition:null}}}});var uk=V_;function K3e(o,f,m,v,y,x,C){var w=new Cesium.Credit("WMTS");y=Cesium.defaultValue(y,{}),this._7=new Cesium.GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1}),this._3=256,this._4=256,this._10=Cesium.defaultValue(y.fileExtension,"jpg"),this._9=y.proxy,this._12=y.tileDiscardPolicy,this._2=m,this._1=v,this._8=new Cesium.Rectangle(0-Math.PI,0-Math.PI/2,Math.PI,Math.PI/2),this._5=new Cesium.Rectangle(0-Math.PI,0-Math.PI/2,Math.PI,Math.PI/2),this._6=!0,this.baseurl=o,this.needaddone=f,x&&(this._0=x,this.baseurl2=C);var A=Cesium.defaultValue(y.credit,w);typeof A=="string"&&(A=new Cesium.Credit(A)),this._11=A}Object.defineProperties(K3e.prototype,{tileWidth:{get:function(){return this._3}},tileHeight:{get:function(){return this._4}},defaultAlpha:{get:function(){return 1}},hasAlphaChannel:{get:function(){return!0}},maximumLevel:{get:function(){return this._1}},minimumLevel:{get:function(){return this._2}},tilingScheme:{get:function(){return this._7}},extent:{get:function(){return this._8}},rectangle:{get:function(){return this._5}},ready:{get:function(){return this._6}},minimumTerrainLevel:{get:function(){return 0}},maximumTerrainLevel:{get:function(){return 17}}});K3e.prototype.requestImage=function(o,f,m){this.needaddone&&(o+=1,f+=1,m+=1);var v=this.baseurl;this._0&&m>this._0&&(v=this.baseurl2);var y=v.replace("{x}",o);return y=y.replace("{l}",f%8),y=y.replace("{y}",f),y=y.replace("{z}",m+1),Cesium.ImageryProvider.loadImage(this,y)};var Cgt=K3e;var FA=null;function bgt(o,f){this._viewer=o,this._cesium=f,FA=f}var g6i=function(){function o(f,m){for(var v=0;v<m.length;v++){var y=m[v];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(f,y.key,y)}}return function(f,m,v){return m&&o(f.prototype,m),v&&o(f,v),f}}();function _6i(o,f){if(!(o instanceof f))throw new TypeError("Cannot call a class as a function")}var v6i="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";bgt.prototype.BaiduImageryProvider=function(){function o(){var f=arguments.length<=0||arguments[0]===void 0?{}:arguments[0];_6i(this,o),this._url=v6i,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new FA.WebMercatorTilingScheme({rectangleSouthwestInMeters:new FA.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new FA.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=f.style||"normal"}return g6i(o,[{key:"getTileCredits",value:function(m,v,y){}},{key:"requestImage",value:function(m,v,y){if(!this.ready)throw new FA.DeveloperError("requestImage must not be called before the imagery provider is ready.");var x=this._tilingScheme.getNumberOfXTilesAtLevel(y),C=this._tilingScheme.getNumberOfYTilesAtLevel(y),w=this._url.replace("{x}",m-x/2).replace("{y}",C/2-v-1).replace("{z}",y).replace("{s}",1).replace("{style}",this._style);return FA.ImageryProvider.loadImage(this,w)}},{key:"url",get:function(){return this._url}},{key:"token",get:function(){return this._token}},{key:"tileWidth",get:function(){if(!this.ready)throw new FA.DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},{key:"tileHeight",get:function(){if(!this.ready)throw new FA.DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},{key:"maximumLevel",get:function(){if(!this.ready)throw new FA.DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},{key:"minimumLevel",get:function(){if(!this.ready)throw new FA.DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 0}},{key:"tilingScheme",get:function(){if(!this.ready)throw new FA.DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},{key:"rectangle",get:function(){if(!this.ready)throw new FA.DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},{key:"ready",get:function(){return!!this._url}},{key:"credit",get:function(){return this._credit}}]),o}();var wgt=bgt;function Cg(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this._BaiduImageryProvider=new wgt(o,f)}Cg.prototype.createArcGisImageryLayer=function(o,f,m,v,y,x){var C={url:""},w=null;this._core.isUrl(f)?(w=C,w.url=f):w=this._core.extend(C,f,!0),this._core.isnull(o)&&(o="\u65B0\u5EFA\u5F71\u50CF\u56FE\u5C42");var A=new this._cesium.ArcGisMapServerImageryProvider(w);let E={alpha:w.alpha,brightness:w.brightness,availability:w.availability};if(w.Level!==void 0||w.level!==void 0){let M=this._core.defaultValue(w.Level,w.level);M.indexOf&&M.indexOf(",")>-1||Array.isArray(M)?(M.split&&(M=M.split(",")),E.maximumTerrainLevel=M[1],E.minimumTerrainLevel=M[0]):E.minimumTerrainLevel=M}w.time&&(E.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:w.time.start?this._cesium.JulianDate.fromDate(new Date(w.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:w.time.end?this._cesium.JulianDate.fromDate(new Date(w.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=E.availability,this.item=new this._cesium.ImageryLayer(A,E),this._viewer.imageryLayers.add(this.item,v),!y&&this.setVisibility(!1),x&&typeof x=="function"&&x(this.item);var T=this._core.getuid(),S={id:w.id||T,name:o,checked:y,pId:this._core.isnull(m)?0:m,type:"ImageryProvider",smtype:"arcgis",item:this};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(m)?0:m),this};Cg.prototype.createImageryLayerGrid=function(o){var f=this._viewer.imageryLayers,m=f.addImageryProvider(new this._cesium.GridImageryProvider(o));return this.item=m,this};Cg.prototype.createWebMapServerImageLayer=function(o,f,m,v,y,x){var C={url:"",layers:"",parameters:{service:"WMS",format:"image/png",transparent:!0}},w=null;this._core.isUrl(f)?(w=C,w.url=f):w=this._core.extend(C,f,!0),this._core.isnull(o)&&(o="\u65B0\u5EFA\u5F71\u50CF\u56FE\u5C42");var A=new this._cesium.WebMapServiceImageryProvider(w);let E={alpha:w.alpha,brightness:w.brightness,availability:w.availability};if(w.Level!==void 0||w.level!==void 0){let M=this._core.defaultValue(w.Level,w.level);M.indexOf&&M.indexOf(",")>-1||Array.isArray(M)?(M.split&&(M=M.split(",")),E.maximumTerrainLevel=M[1],E.minimumTerrainLevel=M[0]):E.minimumTerrainLevel=M}w.time&&(E.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:w.time.start?this._cesium.JulianDate.fromDate(new Date(w.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:w.time.end?this._cesium.JulianDate.fromDate(new Date(w.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=E.availability,this.item=new this._cesium.ImageryLayer(A,E),this._viewer.imageryLayers.add(this.item,v),!y&&this.setVisibility(!1),x&&typeof x=="function"&&x(this.item);var T=this._core.getuid(),S={id:w.id||T,name:o,checked:y,pId:this._core.isnull(m)?0:m,type:"ImageryProvider",smtype:"wms",item:this};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(m)?0:m),this};Cg.prototype.createMVTWithStyle=function(o,f,m,v){m=0,this.item=this._viewer.imageryLayers.addImageryProvider(f),checked||this.setVisibility(!1),f.show=!1;var y=this._core.getuid(),x={id:options.id||y,name:o,checked,pId:this._core.isnull(m)?0:m,type:"ImageryProvider",show:!1,item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,this._core.isnull(m)?0:m),this};Cg.prototype.createWebMapTileServerImageLayer=function(o,f,m,v,y,x){var C={url:""},w=null;this._core.isUrl(f)?(w=C,w.url=f):w=this._core.extend(C,f,!0),this._core.isnull(o)&&(o="\u65B0\u5EFA\u5F71\u50CF\u56FE\u5C42");let A={alpha:w.alpha,brightness:w.brightness,availability:w.availability};if(w.Level!==void 0||w.level!==void 0){let M=this._core.defaultValue(w.Level,w.level);M.indexOf&&M.indexOf(",")>-1||Array.isArray(M)?(M.split&&(M=M.split(",")),A.maximumTerrainLevel=M[1],A.minimumTerrainLevel=M[0]):A.minimumTerrainLevel=M}var E;w.TD_SD?E=new Cgt(w.url,!1,A.minimumTerrainLevel||0,A.maximumTerrainLevel||21):E=new this._cesium.WebMapTileServiceImageryProvider(w),w.addLevel&&(E.addLevel=w.addLevel),w.time&&(A.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:w.time.start?this._cesium.JulianDate.fromDate(new Date(w.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:w.time.end?this._cesium.JulianDate.fromDate(new Date(w.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=A.availability,this.item=new this._cesium.ImageryLayer(E,A),this._viewer.imageryLayers.add(this.item,v),!y&&this.setVisibility(!1),x&&typeof x=="function"&&x(this.item);var T=this._core.getuid(),S={id:w.id||T,name:o,checked:y,pId:this._core.isnull(m)?0:m,type:"ImageryProvider",smtype:"skymap",item:this};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(m)?0:m),this};Cg.prototype.createUrlTemplateImageryProvider=function(o,f,m,v,y,x){var C={url:""},w=null;this._core.isUrl(f)?(w=C,w.url=f):w=this._core.extend(C,f,!0),this._core.isnull(o)&&(o="\u65B0\u5EFA\u5F71\u50CF\u56FE\u5C42");var A=new this._cesium.UrlTemplateImageryProvider(w);let E={alpha:w.alpha,brightness:w.brightness,availability:w.availability};if(w.Level!==void 0||w.level!==void 0){let M=this._core.defaultValue(w.Level,w.level);M.indexOf&&M.indexOf(",")>-1||Array.isArray(M)?(M.split&&(M=M.split(",")),E.maximumTerrainLevel=M[1],E.minimumTerrainLevel=M[0]):E.minimumTerrainLevel=M}w.time&&(E.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:w.time.start?this._cesium.JulianDate.fromDate(new Date(w.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:w.time.end?this._cesium.JulianDate.fromDate(new Date(w.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=E.availability,this.item=new this._cesium.ImageryLayer(A,E),this._viewer.imageryLayers.add(this.item,v),!y&&this.setVisibility(!1),x&&typeof x=="function"&&x(this.item);var T=this._core.getuid(),S={id:w.id||T,name:o,checked:y,pId:this._core.isnull(m)?0:m,type:"ImageryProvider",smtype:"goglemap",item:this};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(m)?0:m),this};Cg.prototype.createImageryProvider=function(o,f,m,v,y,x,C){var w={},A=this._core.extend(w,m,!0),E;f=="arcgis"?E=new this._cesium.ArcGisMapServerImageryProvider(A):f=="geoserver"?E=new this._cesium.WebMapServiceImageryProvider(A):f=="wms"?E=new this._cesium.WebMapServiceImageryProvider(A):f=="cesiumBlack"?E=new this._cesium.TileMapServiceImageryProvider(A):f=="tms"?E=new this._cesium.TileMapServiceImageryProvider(A):f=="skymap"?E=new this._cesium.WebMapTileServiceImageryProvider(A):f=="goglemap"?E=new this._cesium.UrlTemplateImageryProvider(A):f=="BingMap"?E=new this._cesium.BingMapsImageryProvider(A):f=="OpenStreetMap"?E=new this._cesium.OpenStreetMapImageryProvider(A):f=="MapBox"?E=new this._cesium.MapboxImageryProvider(A):f=="BaiduMap"&&(E=new this._BaiduImageryProvider.BaiduImageryProvider(A));let T={alpha:A.alpha,brightness:A.brightness,availability:A.availability};if(A.Level!==void 0||A.level!==void 0){let M=this._core.defaultValue(A.Level,A.level);M.indexOf&&M.indexOf(",")>-1||Array.isArray(M)?(M.split&&(M=M.split(",")),T.maximumTerrainLevel=M[1],T.minimumTerrainLevel=M[0]):T.minimumTerrainLevel=M}A.time&&(T.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:A.time.start?this._cesium.JulianDate.fromDate(new Date(A.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:A.time.end?this._cesium.JulianDate.fromDate(new Date(A.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),this.availability=T.availability,this.item=new this._cesium.ImageryLayer(E,T),this._viewer.imageryLayers.add(this.item,y),!x&&this.setVisibility(!1),C&&typeof C=="function"&&C(this.item),this._core.isnull(A.id)&&(A.id=this._core.getuid());var S={id:A.id,name:o,pId:this._core.isnull(v)?0:v,type:"ImageryProvider",checked:x,item:this};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),this};Cg.prototype.createCacheImageryProvider=function(o,f,m,v,y,x){var C={fileExtension:"jpg",cacheMaxLevel:16};v=v|1;var w=this._core.extend(C,f,!0);let A={alpha:w.alpha,brightness:w.brightness,availability:w.availability,show:!0},E={alpha:w.alpha,brightness:w.brightness,availability:w.availability,show:!0};if(w.time&&(A.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:w.time.start?this._cesium.JulianDate.fromDate(new Date(w.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:w.time.end?this._cesium.JulianDate.fromDate(new Date(w.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})]),E.availability=new this._cesium.TimeIntervalCollection([new this._cesium.TimeInterval({start:w.time.start?this._cesium.JulianDate.fromDate(new Date(w.time.start)):this._cesium.Iso8601.MINIMUM_VALUE,stop:w.time.end?this._cesium.JulianDate.fromDate(new Date(w.time.end)):this._cesium.Iso8601.MAXIMUM_VALUE})])),w.Level!==void 0||w.level!==void 0){let P=this._core.defaultValue(w.Level,w.level);P.indexOf&&P.indexOf(",")>-1||Array.isArray(P)?(P.split&&(P=P.split(",")),P[1]>w.cacheMaxLevel?(A.show=!0,E.maximumTerrainLevel=P[1],E.show=!0):(A.show=!0,E.show=!1),P[0]>w.cacheMaxLevel?(A.show=!1,E.minimumTerrainLevel=P[0],E.show=!0):(A.show=!0,E.minimumTerrainLevel=w.cacheMaxLevel)):P>w.cacheMaxLevel?(A.show=!1,E.minimumTerrainLevel=P,E.show=!0):(A.show=!0,E.minimumTerrainLevel=w.cacheMaxLevel,E.show=!0)}else A.show=!0,E.minimumTerrainLevel=w.cacheMaxLevel,E.show=!0;this.availability=A.availability;var T=null;A.show&&(T=new this._cesium.TileMapServiceImageryProvider({url:Cesium.buildModuleUrl(w.cacheUrl),fileExtension:w.fileExtension}),this.item=new this._cesium.ImageryLayer(T,A),this._viewer.imageryLayers.add(this.item,v)),this.items||(this.items=[]);var S=null;if(E.show)if(w.minimumLevel=E.minimumTerrainLevel|w.cacheMaxLevel,E.maximumTerrainLevel&&(w.maximumLevel=E.maximumTerrainLevel),S=new this._cesium.WebMapServiceImageryProvider(w),this.item){var M=this.items.push(new this._cesium.ImageryLayer(S,E));this._viewer.imageryLayers.add(this.items[M-1],v+1)}else this.item=new this._cesium.ImageryLayer(S,E),this._viewer.imageryLayers.add(this.item,v+1);!y&&this.setVisibility(!1),x&&typeof x=="function"&&x(this.item),this._core.isnull(w.id)&&(w.id=this._core.getuid());var I={id:w.id,name:o,pId:this._core.isnull(m)?0:m,type:"ImageryProvider",checked:y,item:this};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(m)?0:m),this};Cg.prototype.createPolylineImageryProviderer=function(o,f,m,v){var y={url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"},x=this._core.extend(y,f,!0),C=new this._cesium.WebMapTileServiceImageryProvider(x);this.item=this._viewer.imageryLayers.addImageryProvider(C),typeof v=="function"&&v(this.item),this._core.isnull(x.id)&&(x.id=this._core.getuid());var w={id:x.id,name:o,pId:this._core.isnull(m)?0:m,type:"ImageryProvider",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,this._core.isnull(m)?0:m),this};Cg.prototype.createterrainProvider=function(o,f,m,v){var y={url:""},x=this._core.extend(y,f,!0),C=new this._cesium.CesiumTerrainProvider(x);this._viewer.terrainProvider=C,this.item=this._viewer.terrainProvider,typeof v=="function"&&v(dataSource),this._core.isnull(x.id)&&(x.id=this._core.getuid());var w={id:x.id,name:o,pId:this._core.isnull(m)?0:m,type:"terrainProvider",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,this._core.isnull(m)?0:m),this};Cg.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.item.imageryProvider.url;return{type:"ImageryLayer",treeobj:{name:this.treeobj.name,type:this.treeobj.smtype},style:{show:o,url:f}}};Cg.prototype.setTreeobj=function(o){this.treeobj=o};Cg.prototype.getLevel=function(){var o=40487.57,f=7096758e-11,m=91610.74,v=-40467.74,y=this._viewer.camera,x,C;try{if(y&&y.positionCartographic&&y.positionCartographic.height){var w=this._viewer.scene.globe.getHeight(y.positionCartographic);!w&&(w=0),x=y.positionCartographic.height-w,C=Math.round(v+(o-v)/(1+Math.pow(x/m,f)))}else C=0}catch{}return C};Cg.prototype.setVisibility=function(o){if(this.isShow=o,this.item.show=o,this.item._availability&&!o?this.item._availability=void 0:this.availability&&o&&(this.item._availability=this.availability),this.items)for(var f=0;f<this.items.length;f++)this.items[f].show=o,this.items[f]._availability&&!o?this.items[f]._availability=void 0:this.availability&&o&&(this.items[f]._availability=this.availability)};Cg.prototype.getVisibility=function(){return this.item.show};Cg.prototype.getType=function(){return{label:"\u5F71\u50CF",value:"ImageryProvider"}};Cg.prototype.deleteObject=function(){return this._viewer.imageryLayers.remove(this.item)};Object.defineProperties(Cg.prototype,{url:{set:function(o){},get:function(){}}});Cg.prototype.setItem=function(o){this.item=o};var rL=Cg;var y6i=function(){function o(f,m){var v=[],y=!0,x=!1,C=void 0;try{for(var w=f[Symbol.iterator](),A;!(y=(A=w.next()).done)&&(v.push(A.value),!(m&&v.length===m));y=!0);}catch(E){x=!0,C=E}finally{try{!y&&w.return&&w.return()}finally{if(x)throw C}}return v}return function(f,m){if(Array.isArray(f))return f;if(Symbol.iterator in Object(f))return o(f,m);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),x6i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};function tce(o){if(Array.isArray(o)){for(var f=0,m=Array(o.length);f<o.length;f++)m[f]=o[f];return m}else return Array.from(o)}function z_(o,f,m){this._viewer=o,this._cesium=f,this._viewer=null,this._Cesium=m.Cesium,this.UrlData={output:m.output,resultmode:m.resultmode,uid:m.uid,st:m.st,words:m.words,area:m.area,callback:m.callback},this.minLevel1=m.minLevel1,this.minLevel3=m.minLevel3,this._url=m.url,this._urlTemplate=m.url,this._rectangle=m.rectangle,this._maximumLevel=m.maximumLevel||19,this._minimumLevel=m.minimumLevel||1,this.dx={},this._tilingScheme=m.tilingScheme||new this._Cesium.GeographicTilingScheme,this._tileRangeByLevel={},this._moveEndTimestamp=null,this._isRemoved=!1,this.cluster="city",this.primitivecount=null,this._isCameraMoving=!1,this._propertyToBeFiltered=null,this._valuesToBeFiltered=null,this._primitiveByTile={},this._tileKeys=[],this._lowerLevelLimit=m.lowerLevelLimit||1,this._upperLevelLimit=m.upperLevelLimit||null,this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._cameraMoveStartHandler=this._cameraMoveStartHandler.bind(this),this.heightById={};for(var v=this._radianToDegree(this._rectangle.west),y=this._radianToDegree(this._rectangle.south),x=this._radianToDegree(this._rectangle.east),C=this._radianToDegree(this._rectangle.north),w=this._minimumLevel;w<=this._maximumLevel;w++){var A=this._lonLatToTileInWGS84([v,y],w),E=this._lonLatToTileInWGS84([x,C],w),T=Math.min(A[0],E[0]),S=Math.max(A[0],E[0]),M=Math.min(A[1],E[1]),I=Math.max(A[1],E[1]);this._tileRangeByLevel[w]={minCol:M,maxCol:I,minRow:T,maxRow:S}}this._tileRangeByLevel[0]={minCol:0,maxCol:0,minRow:0,maxRow:0},this._primitiveCollection=new this._Cesium.PrimitiveCollection,this._stop=!1}z_.prototype._serialize=function(o){var f=[],m=window.encodeURIComponent;for(var v in o){var y=o[v];(typeof y>"u"?"undefined":x6i(y))==="object"?f.push(m(v)+"="+m(JSON.stringify(y))):f.push(m(v)+"="+m(o[v]))}return f.join("&")};z_.prototype._fetch=function(o){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},m=new Promise(function(v,y){var x=new XMLHttpRequest;if(x.open(f.method||"GET",o),f.headers)for(var C in f.headers)x.setRequestHeader(C,f.headers[C]);x.onload=function(){if(x.readyState===4&&x.status===200)try{var w=JSON.parse(x.responseText);v(w)}catch{y(new Error("INVALID RESPONSE"))}},x.onerror=function(w){y(w)},x.onloadend=function(w){w.target.status!==200&&y(new Error("["+w.target.status+"]request failed: "+o))},x.send(f.body||null)});return m};z_.prototype._lonLatToTileInWGS84=function(o,f){var m=y6i(o,2),v=m[0],y=m[1],x=Math.floor(Math.pow(2,f)*(90-y)/180),C=Math.floor(Math.pow(2,f)*(180+v)/180);return[x,C]};z_.prototype._radianToDegree=function(o){return o/Math.PI*180};z_.prototype._isTileInRange=function(o){try{var f=this._tileRangeByLevel[o.level],m=f.minCol,v=f.maxCol,y=f.minRow,x=f.maxRow;return o.x>=m&&o.x<=v&&o.y>=y&&o.y<=x}catch{return!1}};z_.prototype._cameraMoveStartHandler=function(){this._isCameraMoving=!0};z_.prototype._loadTile=function(o,f){var m=[],v=new this._Cesium.ColorGeometryInstanceAttribute(.75,.75,.75,1),y=this;o.features.forEach(function(C){if(y._propertyToBeFiltered&&Array.isArray(y._valuesToBeFiltered)){var w=C.properties[y._propertyToBeFiltered];if(y._valuesToBeFiltered.includes(w))return}var A=C.geometry.type;if(A==="Polygon"||A==="MultiPolygon"){var E=[];y.heightById[C.properties.house_id]=C.properties.height,C.geometry.coordinates.forEach(function(T,S){E.push([]),T.forEach(function(R){if(R.length>2)R.forEach(function(F){if(F.length>=2){var k;(k=E[S]).push.apply(k,tce(F))}});else{var O;(O=E[S]).push.apply(O,tce(R))}});var M=new y._Cesium.PolygonHierarchy(y._Cesium.Cartesian3.fromDegreesArray(E[S])),I=y._Cesium.BoundingSphere.fromPoints(M.positions).center,P=y._viewer.scene.globe.getHeight(y._Cesium.Cartographic.fromCartesian(I))||0,D=new y._Cesium.PolygonGeometry({polygonHierarchy:M,height:P,vertexFormat:y._Cesium.PerInstanceColorAppearance.VERTEX_FORMAT,extrudedHeight:1e3}),L=new y._Cesium.GeometryInstance({geometry:D,attributes:{color:v}});m.push(L)})}else console.warn('GeoJSONVectorTileProviderPolymerization: geometry type "'+C.geometry.type+'" detected, but is not going to be rendered')});var x=new this._Cesium.Primitive({allowPicking:!1,appearance:new this._Cesium.PerInstanceColorAppearance({translucent:!1}),geometryInstances:m});return x};z_.prototype._cameraMoveEndHandler=function(){if(!this._stop){var o=this,f=Date.now(),m=this._viewer.scene.globe._surface._tilesToRender,v=m.map(function(D){return D.level}),y=Math.min.apply(Math,tce(v)),x=Math.max.apply(Math,tce(v));o._removeObsoletePrimitives(o._primitiveByTile,[]),x<this._lowerLevelLimit&&(o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),m=[]),this._upperLevelLimit&&y>this._upperLevelLimit&&(o._tileKeys=[],o._removeObsoletePrimitives(o._primitiveByTile,[]),m=[]),x-y>2&&(m=m.filter(function(D){return D.level>=x-2})),m.sort(function(D,L){return-(D.level-L.level)}),m=m.filter(function(D){return o._isTileInRange(D)}),this._upperLevelLimit&&(m=this._refineTiles(m,this._upperLevelLimit)),this._isCameraMoving=!1,this._moveEndTimestamp=f,this._viewer.scene.primitives.remove(this.dx),this.dx={},this._primitiveByTile={};var C=[],w=0,A=0,E=this._viewer.camera.computeViewRectangle(),T=this._radianToDegree(E.west),S=this._radianToDegree(E.south),M=this._radianToDegree(E.east),I=this._radianToDegree(E.north);this.UrlData.area="RECT("+T+" "+S+","+M+" "+I+")";var P="";y<=this.minLevel1||y=="Infinity"?(this.cluster="city",this.UrlData.cluster=this.cluster,P=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&cluster="+this.UrlData.cluster+"&callback="+this.UrlData.callback):y>this.minLevel1&&this.minLevel3>y?(this.cluster="county",this.UrlData.cluster=this.cluster,P=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&cluster="+this.UrlData.cluster+"&callback="+this.UrlData.callback):y>=this.minLevel3&&(this.cluster="",P=this._urlTemplate+"?output="+this.UrlData.output+"&resultmode="+this.UrlData.resultmode+"&uid="+this.UrlData.uid+"&st="+this.UrlData.st+"&words="+this.UrlData.words+"&area="+this.UrlData.area+"&callback="+this.UrlData.callback),o._fetch(P).then(function(D){var L=o._loadTile(D,o.cluster);o._primitiveCollection=L,A++,A>=w&&(o._tileKeys=C,o._removeObsoletePrimitives(o._primitiveByTile,C))}).catch(function(D){A++,A>=w&&(o._tileKeys=C,o._removeObsoletePrimitives(o._primitiveByTile,C)),D.message})}};z_.prototype._refineTiles=function(o,f){var m=[],v=[];return o.forEach(function(y){var x="Z"+y.level+"X"+y.x+"Y"+y.y;if(y.level<f-1)v.includes(x)||(m.push(y),v.push(x));else if(y.level===f-1)for(var C=0;C<2;C++)for(var w=0;w<2;w++){var A="Z"+(y.level+1)+"X"+(y.x*2+C)+"Y"+(y.y*2+w);v.includes(A)||(m.push({x:y.x*2+C,y:y.y*2+w,level:y.level+1}),v.push(A))}else{var E=y.level-f;if(E===0)v.includes(x)||(m.push(y),v.push(x));else{var T=E*2,S=Math.floor(y.x/T),M=Math.floor(y.y/T),I="Z"+f+"X"+S+"Y"+M;v.includes(I)||(m.push({x:S,y:M,level:f}),v.push(I))}}}),m};z_.prototype._removeObsoletePrimitives=function(o,f){var m=[];f.length>0&&(m=f);for(var v in o)m.includes(v)||removed&&delete o[v]};z_.prototype.addTo=function(o){this._viewer=o,this._isRemoved=!1,this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.addEventListener(this._cameraMoveStartHandler),this._cameraMoveEndHandler()};z_.prototype.remove=function(){if(this._viewer){for(var o in this._primitiveByTile)this._viewer.scene.primitives.remove(this._primitiveByTile[o]);this._primitiveByTile={},this._viewer.camera.moveEnd.removeEventListener(this._cameraMoveEndHandler),this._viewer.camera.moveStart.removeEventListener(this._cameraMoveStartHandler),this._viewer=null,this._isRemoved=!0}};z_.prototype.setStatus=function(o){this._stop=o};z_.prototype.isRemoved=function(){return this._isRemoved};z_.prototype.filterBy=function(o,f,m){this._propertyToBeFiltered=o,this._valuesToBeFiltered=f};z_.prototype.removeFilter=function(){this._propertyToBeFiltered=null,this._valuesToBeFiltered=null};var Agt=z_;function o0(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this._Provider=void 0,this.labelCollections1=[],this.labelCollections2=[],this.labelCollections=new this._cesium.PointPrimitiveCollection,this.gd=0,this.model=[],this.Legend=[],this.sj=!0}o0.prototype.createLabelPointGeoJsonFeatureLayer=function(o,f,m,v,y){f==null&&console.log("geojson is required");var x=this._cesium.GeoJsonDataSource.load(f),C=this;x.then(function(E){var T={Name:"",text:"",font:" 30px sans-serif",stylet:C._cesium.LabelStyle.OUTLINE,fillColor:C._cesium.Color.WHITE,outlineColor:C._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new C._cesium.Color(.165,.165,.165,.8),backgroundPadding:new C._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:C._cesium.HorizontalOrigin.CENTER,verticalOrigin:C._cesium.VerticalOrigin.CENTER,eyeOffset:C._cesium.Cartesian3.ZERO,pixelOffset:C._cesium.Cartesian2.ZERO,heightReference:C._cesium.HeightReference.NONE,scaleByDistance:new C._cesium.NearFarScalar(0,0,1,1)},S=m.material;!C._core.isnull(m)&&!C._core.isnull(m.fillColor)&&(/^\[/.test(m.fillColor)&&m.fillColor.toString().charAt(0)=="["&&m.fillColor.toString().charAt(m.fillColor.length-1)=="]"||(C._core.isHtmlColor(m.fillColor)?m.fillColor=C._color.colorFromHtmlColor(m.fillColor):(/^rgb/.test(m.fillColor)&&(m.fillColor=C._color.rgbaStringToRgbaObj(m.fillColor)),m.fillColor.r>1&&(m.fillColor.r=m.fillColor.r/255),m.fillColor.g>1&&(m.fillColor.g=m.fillColor.g/255),m.fillColor.b>1&&(m.fillColor.b=m.fillColor.b/255),m.fillColor.a>1&&(m.fillColor.a=m.fillColor.a/255),m.fillColor=C._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a)))),!C._core.isnull(m)&&!C._core.isnull(m.material)&&(/^\[/.test(m.material)&&m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(C._core.isHtmlColor(m.material)?m.material=C._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=C._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.fillColor.r/255),m.material.g>1&&(m.material.g=m.fillColor.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=C._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!C._core.isnull(m)&&!C._core.isnull(m.outlineColor)&&(/^\[/.test(m.outlineColor)&&m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(C._core.isHtmlColor(m.outlineColor)?m.outlineColor=C._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=C._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=C._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),!C._core.isnull(m)&&!C._core.isnull(m.backgroundColor)&&(/^\[/.test(m.backgroundColor)&&m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(C._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=C._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=C._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=C._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))));var M=C._core.extend(T,m,!0);C.item=E;var I=E.entities.values;C._core.isnull(m.near)&&(m.near=0),C._core.isnull(m.far)&&(m.far=999999999);var P=parseFloat(m.near),D=parseFloat(m.far),L=new C._cesium.DistanceDisplayCondition(P,D);M.distanceDisplayCondition=L,C._core.isnull(m.font_size)&&(m.font_size="30px"),C._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),M.font=parseFloat(m.font_size)+"px "+m.font_family;for(var R=new C._cesium.LabelCollection,O=0;O<I.length;O++){var F=I[O];M.position=F.position._value,M.text="a label";var k="fillColor:"+M.fillColor.red*255+","+M.fillColor.green*255+","+M.fillColor.blue*255+";outlineColor:"+M.outlineColor.red*255+","+M.outlineColor.green*255+","+M.outlineColor.blue*255;C.Legend.push(k),R.add(M)}var U=C._viewer.scene.primitives.add(R);typeof y=="function"&&y(U)});var w=this._core.getuid();this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+w);var A={id:w,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"labelPointLayer",item:this,url:f,style:options};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(v)?0:v),this};o0.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={Name:"",text:"",font:" 30px sans-serif",style:this._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.RELATIVE_TO_GROUND,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)},T=this;!this._core.isnull(m)&&!this._core.isnull(m.fillColor)&&(this._core.isHtmlColor(m.fillColor)?m.fillColor=this._color.colorFromHtmlColor(m.fillColor):(/^rgb/.test(m.fillColor)&&(m.fillColor=this._color.rgbaStringToRgbaObj(m.fillColor)),m.fillColor.r>1&&(m.fillColor.r=m.fillColor.r/255),m.fillColor.g>1&&(m.fillColor.g=m.fillColor.g/255),m.fillColor.b>1&&(m.fillColor.b=m.fillColor.b/255),m.fillColor.a>1&&(m.fillColor.a=m.fillColor.a/255),m.fillColor=this._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))),!this._core.isnull(m)&&!this._core.isnull(m.backgroundColor)&&(this._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=this._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=this._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=this._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))),T._core.isnull(m.near)&&(m.near=0),T._core.isnull(m.far)&&(m.far=999999999);var w=this._core.extend(C,m,!0),A={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},E=this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(f)),T=this;E.then(function(I){T.item=I;var P=45,D=3,L=!0,R=I.entities.values;T._core.isnull(w.font_size)&&(w.font_size="30"),T._core.isnull(w.font_family)&&(w.font_family=" sans-serif"),w.font=w.font_size+"px "+w.font_family;for(var O=0;O<R.length;O++){var F=R[O];w.font=T._core.extendgl(F,m.font,w.font),w.style=parseInt(T._core.extendgl(F,m.stylet,w.stylet)),w.fillColor=T._core.extendgl(F,m.fillColor,w.fillColor),w.outlineColor=T._core.extendgl(F,m.outlineColor,w.outlineColor),w.outlineWidth=parseFloat(T._core.extendgl(F,m.outlineWidth,w.outlineWidth)),w.show=T._core.extendgl(F,m.show,w.show),w.showBackground=T._core.extendgl(F,m.showBackground,w.showBackground),w.backgroundColor=T._core.extendgl(F,m.backgroundColor,w.backgroundColor),w.backgroundPadding=T._core.extendgl(F,m.backgroundPadding,w.backgroundPadding),w.scale=parseFloat(T._core.extendgl(F,m.scale,w.scale)),w.horizontalOrigin=T._core.extendgl(F,m.horizontalOrigin,w.horizontalOrigin),w.pointHeight=parseFloat(T._core.extendgl(F,m.pointHeight,w.pointHeight)),w.text=T._core.extendgl(F,m.text,w.text);var k=parseFloat(T._core.extendgl(F,w.near)),U=parseFloat(T._core.extendgl(F,w.far)),G=new T._cesium.DistanceDisplayCondition(k,U);w.distanceDisplayCondition=G,w.text=F.properties[w.text]==null?w.text:F.properties[w.text]._value,F.billboard.color=T._cesium.Color.WHITE.withAlpha(0),F.label=new T._cesium.LabelGraphics(w);var j=T._viewer.scene.globe.ellipsoid,q=T._cesium.Cartographic.fromCartesian(F.position._value),J=T._cesium.Math.toDegrees(q.longitude),X=T._cesium.Math.toDegrees(q.latitude),Y=w.pointHeight||q.height,Q=new T._cesium.Cartesian3.fromDegrees(J,X,Y);F.position._value=Q}I.clustering.enabled=L,I.clustering.pixelRange=P,I.clustering.minimumClusterSize=D;for(var ee,z=new T._cesium.PinBuilder,ie=z.fromText("50+",T._cesium.Color.RED,48).toDataURL(),re=z.fromText("40+",T._cesium.Color.ORANGE,48).toDataURL(),ne=z.fromText("30+",T._cesium.Color.YELLOW,48).toDataURL(),oe=z.fromText("20+",T._cesium.Color.GREEN,48).toDataURL(),se=z.fromText("10+",T._cesium.Color.BLUE,48).toDataURL(),ae=new Array(8),O=0;O<ae.length;++O)ae[O]=z.fromText(""+(O+2),T._cesium.Color.VIOLET,48).toDataURL();function fe(){T._cesium.defined(ee)?(ee(),ee=void 0):ee=I.clustering.clusterEvent.addEventListener(function(pe,ce){ce.label.show=!1,ce.point.show=!1,ce.billboard.show=!0,ce.billboard.id=ce.label.id,ce.billboard.verticalOrigin=T._cesium.VerticalOrigin.BOTTOM,pe.length>=50?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.RED,48).toDataURL():pe.length>=40?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.ORANGE,48).toDataURL():pe.length>=30?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.YELLOW,48).toDataURL():pe.length>=20?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.GREEN,48).toDataURL():pe.length>=10?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.BLUE,48).toDataURL():ce.billboard.image=ae[pe.length-2]});var ve=I.clustering.pixelRange;I.clustering.pixelRange=0,I.clustering.pixelRange=ve,y||T.setVisibility(y)}fe();var de={pixelRange:P,minimumClusterSize:D};T._cesium.knockout.track(de),typeof x=="function"&&x(ps)});var S=this._core.getuid();this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+S);var M={id:S,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"labelPointLayer",item:this,url:f};return this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),this};o0.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0,scaleByDistance:new this._cesium.NearFarScalar(0,0,1,1)};!this._core.isnull(m)&&!this._core.isnull(m.color)&&(m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(this._core.isHtmlColor(m.color)?m.color=this._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=this._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=this._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))));var w=this._core.extend(C,m,!0),A={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},E=this._viewer.dataSources.add(this._cesium.GeoJsonDataSource.load(f)),T=this;E.then(function(I){T.item=I;for(var P=45,D=3,L=!0,R=I.entities.values,O=0;O<R.length;O++){var F=R[O];w.color=T._core.extendgl(F,m.color,w.color),w.pixelSize=parseInt(T._core.extendgl(F,m.pixelSize,w.pixelSize)),w.outlineColor=T._core.extendgl(F,m.outlineColor,w.outlineColor),w.outlineWidth=parseFloat(T._core.extendgl(F,m.outlineWidth,w.outlineWidth)),w.show=T._core.extendgl(F,m.show,w.show),w.height=parseFloat(T._core.extendgl(F,m.height,w.height)),w.scaleByDistance=T._core.extendgl(F,m.scaleByDistance,w.scaleByDistance);var k=parseFloat(T._core.extendgl(F,w.minDistanceDisplay)),U=parseFloat(T._core.extendgl(F,w.maxDistanceDisplay)),G=new T._cesium.DistanceDisplayCondition(k,U);F.billboard.image="",w.distanceDisplayCondition=G,F.point=new T._cesium.PointGraphics(w),w.pointHeight=T._core.extendgl(F,m.pointHeight,w.pointHeight),w.pointHeight=parseFloat(w.pointHeight);var j=T._viewer.scene.globe.ellipsoid,q=T._cesium.Cartographic.fromCartesian(F.position._value),J=T._cesium.Math.toDegrees(q.longitude),X=T._cesium.Math.toDegrees(q.latitude),Y=w.pointHeight||q.height,Q=new T._cesium.Cartesian3.fromDegrees(J,X,Y);F.position._value=Q}I.clustering.enabled=L,I.clustering.pixelRange=P,I.clustering.minimumClusterSize=D;for(var ee,z=new T._cesium.PinBuilder,ie=z.fromText("50+",T._cesium.Color.RED,48).toDataURL(),re=z.fromText("40+",T._cesium.Color.ORANGE,48).toDataURL(),ne=z.fromText("30+",T._cesium.Color.YELLOW,48).toDataURL(),oe=z.fromText("20+",T._cesium.Color.GREEN,48).toDataURL(),se=z.fromText("10+",T._cesium.Color.BLUE,48).toDataURL(),ae=new Array(8),O=0;O<ae.length;++O)ae[O]=z.fromText(""+(O+2),T._cesium.Color.VIOLET,48).toDataURL();function fe(){T._cesium.defined(ee)?(ee(),ee=void 0):ee=I.clustering.clusterEvent.addEventListener(function(pe,ce){ce.label.show=!1,ce.point.show=!1,ce.billboard.show=!0,ce.billboard.id=ce.label.id,ce.billboard.verticalOrigin=T._cesium.VerticalOrigin.BOTTOM,pe.length>=50?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.RED,48).toDataURL():pe.length>=40?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.ORANGE,48).toDataURL():pe.length>=30?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.YELLOW,48).toDataURL():pe.length>=20?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.GREEN,48).toDataURL():pe.length>=10?ce.billboard.image=z.fromText(pe.length,T._cesium.Color.BLUE,48).toDataURL():ce.billboard.image=ae[pe.length-2]});var ve=I.clustering.pixelRange;I.clustering.pixelRange=0,I.clustering.pixelRange=ve,y||T.setVisibility(y)}fe();var de={pixelRange:P,minimumClusterSize:D};T._cesium.knockout.track(de),typeof x=="function"&&x(ps)});var S=this._core.getuid();this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+S);var M={id:S,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f};return this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),this};o0.prototype._cameraMoveEndHandler=function(){var o=this._viewer.camera.getMagnitude();if(o<this.gd){if(this.sj){this._viewer.scene.primitives.remove(this.labelCollections),this.labelCollections=new this._cesium.LabelCollection;for(var f=0;f<this.labelCollections1.length;f++)this.labelCollections.add(this.labelCollections1[f]);this._viewer.scene.primitives.add(this.labelCollections),this.sj=!1}}else{this._viewer.scene.primitives.remove(this.labelCollections);for(var m=new this._cesium.BillboardCollection,f=0;f<this.labelCollections2.length;f++)this.BillboardCollections.add(this.labelCollections2[f]);this._viewer.scene.primitives.add(this.BillboardCollections),this.sj=!0}};o0.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=f,w=this._viewer.scene.primitives;this._cameraMoveEndHandler=this._cameraMoveEndHandler.bind(this),this._viewer.camera.moveEnd.addEventListener(this._cameraMoveEndHandler),this.gd=m.height;for(var A=new this._cesium.BillboardCollection,E={},T=[],S=0;S<C.length;S++){var M=new this._cesium.Cartesian3.fromDegrees(C[S].lng,C[S].lat,100),I={position:M,text:C[S].name};this.labelCollections1.push(I);var P=C[S];if(!E[P[m.adminname]])T.push({adminname:P[m.adminname],name:P.name,showBackground:!0,lat:P.lat,lng:P.lng,data:[P]}),E[P[m.adminname]]=P;else for(var D=0;D<T.length;D++){var L=T[D];if(L.adminname==P[m.adminname]){L.data.push(P);break}}}for(var S=0;S<T.length;S++){var M=new this._cesium.Cartesian3.fromDegrees(T[S].lng,T[S].lat,100),I={position:M,image:pinBuilder.fromText(T[S].data.length+"",this._cesium.Color.BLACK,48).toDataURL()};this.labelCollections2.push(I),this.BillboardCollections.add(I)}this._viewer.scene.primitives.add(this.BillboardCollections)};o0.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(o,f,m,v,y,x){var C={height:0,material:this._cesium.Color.WHITE,size:50,fill:this._cesium.Color.RED},w={url:f.url,upperLevelLimit:21,lowerLevelLimit:0,minLevel1:f.minLevel1,minLevel3:f.minLevel3,rectangle:this._cesium.Rectangle.fromDegrees(118.74324788700017,32.036708147800084,118.7994917630001,32.07298490959994),Cesium:this._cesium,output:f.output,resultmode:f.resultmode,uid:f.uid,st:f.st,words:f.words,area:f.area,callback:f.callback};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):/^http/.test(m.material)||(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.fill)&&(m.fill.toString().charAt(0)=="["&&m.fill.toString().charAt(m.fill.length-1)=="]"||(this._core.isHtmlColor(m.fill)?m.fill=this._color.colorFromHtmlColor(m.fill):/^http/.test(m.fill)||(/^rgb/.test(m.fill)&&(m.fill=this._color.rgbaStringToRgbaObj(m.fill)),m.fill.r>1&&(m.fill.r=m.fill.r/255),m.fill.g>1&&(m.fill.g=m.fill.g/255),m.fill.b>1&&(m.fill.b=m.fill.b/255),m.fill.a>1&&(m.fill.a=m.fill.a/255),m.fill=this._color.createColor(m.fill.r,m.fill.g,m.fill.b,m.fill.a))));var A=this._core.extend(C,m,!0),E=this,T=new Agt(this._viewer,this._cesium,w);this._Provider=T,T._loadTile=function(M,I){E._viewer.scene.primitives.remove(E.labelCollections);var P=[];I==""?E.labelCollections=new E._cesium.PointPrimitiveCollection:E.labelCollections=new E._cesium.BillboardCollection;var D=new E._cesium.PinBuilder;return M.result.features.forEach(function(L){var R={};if(L.lng!=null){var O=new E._cesium.Cartesian3.fromDegrees(L.lng,L.lat,A.height);I==""?R={id:L,color:A.material,position:O}:R={position:O,image:D.fromText(L.count+"",A.fill,A.size).toDataURL(),verticalOrigin:E._cesium.VerticalOrigin.BOTTOM},E.labelCollections.add(R)}}),E._viewer.scene.primitives.add(E.labelCollections),E.item=E.labelCollections,E.labelCollections},T.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:A.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};return this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};o0.prototype.createLabelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this,A=m.material;!w._core.isnull(m)&&!w._core.isnull(m.fillColor)&&(/^\[/.test(m.fillColor)&&m.fillColor.toString().charAt(0)=="["&&m.fillColor.toString().charAt(m.fillColor.length-1)=="]"||(w._core.isHtmlColor(m.fillColor)?m.fillColor=w._color.colorFromHtmlColor(m.fillColor):(/^rgb/.test(m.fillColor)&&(m.fillColor=w._color.rgbaStringToRgbaObj(m.fillColor)),m.fillColor.r>1&&(m.fillColor.r=m.fillColor.r/255),m.fillColor.g>1&&(m.fillColor.g=m.fillColor.g/255),m.fillColor.b>1&&(m.fillColor.b=m.fillColor.b/255),m.fillColor.a>1&&(m.fillColor.a=m.fillColor.a/255),m.fillColor=w._color.createColor(m.fillColor.r,m.fillColor.g,m.fillColor.b,m.fillColor.a)))),!w._core.isnull(m)&&!w._core.isnull(m.material)&&(/^\[/.test(m.material)&&m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(w._core.isHtmlColor(m.material)?m.material=w._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=w._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=w._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!w._core.isnull(m)&&!w._core.isnull(m.outlineColor)&&(/^\[/.test(m.outlineColor)&&m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(w._core.isHtmlColor(m.outlineColor)?m.outlineColor=w._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=w._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=w._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),!w._core.isnull(m)&&!w._core.isnull(m.backgroundColor)&&(/^\[/.test(m.backgroundColor)&&m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(w._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=w._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=w._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=w._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))));var E=new Ah(this._viewer,this._cesium,C);this._Provider=E,E._loadTile=function(S){var M={Name:"",text:"",font:" 30px sans-serif",style:w._cesium.LabelStyle.FILL_AND_OUTLINE,fillColor:w._cesium.Color.WHITE,outlineColor:w._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new w._cesium.Color(.165,.165,.165,.8),backgroundPadding:new w._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:w._cesium.HorizontalOrigin.CENTER,verticalOrigin:w._cesium.VerticalOrigin.CENTER,eyeOffset:w._cesium.Cartesian3.ZERO,pixelOffset:w._cesium.Cartesian2.ZERO,heightReference:w._cesium.HeightReference.NONE,scaleByDistance:new w._cesium.NearFarScalar(0,0,1,1),maxDistanceDisplay:99999999,minDistanceDisplay:0,far:99999999,near:0},I=w._core.extend(M,m,!0);w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var P=parseFloat(m.near),D=parseFloat(m.far),L=new w._cesium.DistanceDisplayCondition(P,D);I.distanceDisplayCondition=L,w._core.isnull(m.font_size)&&(m.font_size="30px"),w._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),I.font=parseFloat(m.font_size)+"px "+m.font_family;var R;return I.image!=null&&I.image!=null?R=new w._cesium.BillboardCollection:R=new w._cesium.LabelCollection,S.features.forEach(function(O){I.id=O;var F=I.pointHeight;if(/^\[/.test(F)&&/\]$/.test(F)){var k=F.replace(/\[/,"").replace(/\]/,"");F=parseFloat(O.properties[k])}else F!=null&&F!=""?F=parseFloat(F):O.properties.height!=null&&(F=parseFloat(O.properties.height));if(I.position=new w._cesium.Cartesian3.fromDegrees(O.geometry.coordinates[0],O.geometry.coordinates[1],F),/^\[/.test(m.fillColor)&&/\]$/.test(m.fillColor)){var U=m.fillColor.replace(/\[/,"").replace(/\]/,"");I.fillColor=O.properties[U],w._core.isHtmlColor(I.fillColor)?I.fillColor=w._color.colorFromHtmlColor(I.fillColor):(/^rgb/.test(I.fillColor)&&(I.fillColor=w._color.rgbaStringToRgbaObj(I.fillColor)),I.fillColor.r>1&&(I.fillColor.r=I.fillColor.r/255),I.fillColor.g>1&&(I.fillColor.g=I.fillColor.g/255),I.fillColor.b>1&&(I.fillColor.b=I.fillColor.b/255),I.fillColor.a>1&&(I.fillColor.a=I.fillColor.a/255),I.fillColor=w._color.createColor(I.fillColor.r,I.fillColor.g,I.fillColor.b,I.fillColor.a))}if(/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)){var U=m.outlineColor.replace(/\[/,"").replace(/\]/,"");I.outlineColor=O.properties[U],w._core.isHtmlColor(I.outlineColor)?I.outlineColor=w._color.colorFromHtmlColor(I.outlineColor):(/^rgb/.test(I.outlineColor)&&(I.outlineColor=w._color.rgbaStringToRgbaObj(I.outlineColor)),I.outlineColor.r>1&&(I.outlineColor.r=I.outlineColor.r/255),I.outlineColor.g>1&&(I.outlineColor.g=I.outlineColor.g/255),I.outlineColor.b>1&&(I.outlineColor.b=I.outlineColor.b/255),I.outlineColor.a>1&&(I.outlineColor.a=I.outlineColor.a/255),I.outlineColor=w._color.createColor(I.outlineColor.r,I.outlineColor.g,I.outlineColor.b,I.outlineColor.a))}var G="fillColor:"+I.fillColor.red*255+","+I.fillColor.green*255+","+I.fillColor.blue*255+";outlineColor:"+I.outlineColor.red*255+","+I.outlineColor.green*255+","+I.outlineColor.blue*255;if(w.Legend.push(G),/^\[/.test(m.text)&&/\]$/.test(m.text)){var U=m.text.replace(/\[/,"").replace(/\]/,"");I.text=O.properties[U]}R.add(I)}),R},m&&m.time&&(E.availability=new w._cesium.TimeIntervalCollection([new w._cesium.TimeInterval({start:m.time.start?w._cesium.JulianDate.fromDate(new Date(m.time.start)):w._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?w._cesium.JulianDate.fromDate(new Date(m.time.end)):w._cesium.Iso8601.MAXIMUM_VALUE})])),this.item=E._primitiveCollection,E.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var T={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"labelPointLayer",item:this,url:f.url,style:m};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};o0.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){f==null&&console.log("geojson is required");var C=this._cesium.GeoJsonDataSource.load(f);this._viewer.dataSources.add(C);var w=this,A=new this._cesium.PointPrimitiveCollection;w.optiontext=[],C.then(function(T){w.item=T;for(var S=T.entities.values,M=0;M<S.length;M++){var I=S[M],P;if(/^\[/.test(m.text)&&/\]$/.test(m.text)){var D=m.text.replace(/\[/,"").replace(/\]/,"");P=I.properties[D]._value}else P=m.text;w.optiontext.push(P),I.billboard=void 0;var L=w._viewer.scene.globe.ellipsoid,R=w._cesium.Cartographic.fromCartesian(I.position._value),O=w._cesium.Math.toDegrees(R.longitude),F=w._cesium.Math.toDegrees(R.latitude),k=m.pointHeight||R.height,U=[O,F,k],G=w._core.getuid(),j;U instanceof Array?U.length===2?j=w._cesium.Cartesian3.fromDegrees(U[0],U[1]):U.length===3&&(j=w._cesium.Cartesian3.fromDegrees(U[0],U[1],U[2])):U.z?j=w._cesium.Cartesian3.fromDegrees(U.x,U.y,U.z):j=w._cesium.Cartesian3.fromDegrees(U.x,U.y);var q="DivPoint"+G;A.add({id:q,position:j,color:w._cesium.Color.YELLOW,description:m.text})}w.item=A,w.pointPrimitive=w._viewer.scene.primitives.add(A);var J=!0,X,Y,Q,ee;w.pointPrimitive.update=function(){for(var z=0,ie,re;z<w.pointPrimitive.length;z++){if(ie=w.pointPrimitive.get(z),ee=ie.position,Q=w._viewer.scene.cartesianToCanvasCoordinates(ee),!Q)return;Y=document.getElementById(ie.id),Y||(re='<div id="'+ie.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+pn.divpoint1+`);transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;"> <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">`+w.optiontext[z]+`</div> </div>`,$(".cesium-viewer").append(re),Y=document.getElementById(ie.id)),ie.description?Y.style.transform="matrix(1, 0, 0, 1, "+Q.x+", "+(Q.y-157)+")":Y.style.transform="matrix(1, 0, 0, 1, "+Q.x+", "+(Q.y-134)+")"}J&&(y||w.setVisibility(!1),J=!1)},typeof x=="function"&&x(T)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u5BCC\u6587\u672C");var E={id:m.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"DivPoint",item:this,url:f,style:m};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};o0.prototype.createLabelRichtextGeoJsonFeatureLayerProviderLayer=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this,A=new Ah(this._viewer,this._cesium,C);this._Provider=A,A._loadTile=function(T){var S=new w._cesium.PointPrimitiveCollection;w.optiontext=[],T.features.forEach(function(R){var O=options.pointHeight;if(R.properties.height!=null&&(O=parseFloat(R.properties.height)+O),/^\[/.test(options.pointHeight)&&/\]$/.test(options.pointHeight)){var F=options.pointHeight.replace(/\[/,"").replace(/\]/,"");O=parseFloat(R.properties[F])}if(m.position=new w._cesium.Cartesian3.fromDegrees(R.geometry.coordinates[0],R.geometry.coordinates[1],O),/^\[/.test(m.text)&&/\]$/.test(m.text)){var k=m.text.replace(/\[/,"").replace(/\]/,"");m.text=R.properties[k]}var U=w._core.getuid(),G="DivPoint"+U;S.add({id:G,position:Cartesian3,color:w._cesium.Color.YELLOW,description:m.text}),w.optiontext.push(option.text)}),w.pointPrimitive=w._viewer.scene.primitives.add(S);var M,I,P,D,L=!0;return w.pointPrimitive.update=function(){for(var R=0,O,F;R<w.pointPrimitive.length;R++){if(O=w.pointPrimitive.get(R),D=O.position,P=w._viewer.scene.cartesianToCanvasCoordinates(D),!P)return;I=document.getElementById(O.id),I||(F='<div id="'+O.id+'" style="position: absolute; width: 200px; height: 134px;left: 0px; top: 0px; pointer-events:none; background: url('+window.SmartEarthRootUrl+pn.divpoint1+`);transform: matrix(1, 0, 0, 1, 0, 0); transform-origin: left bottom 0px;"> <div class="title" style="position: inherit;top: 22px;left: 70px;font-size: 14px;text-align: left;color: rgba(255,255,255,1);text-shadow: 0 0 9px rgba(0,0,0,.75)">`+w.optiontext[R]+`</div> </div>`,$(".cesium-viewer").append(F),I=document.getElementById(O.id)),O.description?I.style.transform="matrix(1, 0, 0, 1, "+P.x+", "+(P.y-157)+")":I.style.transform="matrix(1, 0, 0, 1, "+P.x+", "+(P.y-134)+")"}L&&(y||w.setVisibility(!1),L=!1)},w.item=S,""},A.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u5BCC\u6587\u672C"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"DivPoint",item:this,url:f.url,style:m};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};o0.prototype.createModelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium},w=this,A=m.material;!w._core.isnull(m)&&!w._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(w._core.isHtmlColor(m.color)?m.color=w._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=w._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=w._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a))));var E=new Ah(this._viewer,this._cesium,C);this._Provider=E,E._loadTile=function(S){var M={url:"",modelMatrix:w._cesium.Transforms.eastNorthUpToFixedFrame(origin),color:w._cesium.Color.DARKSALMON,scale:2},I=w._core.extend(M,m,!0);w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var P=parseFloat(m.near),D=parseFloat(m.far),L=new w._cesium.DistanceDisplayCondition(P,D);I.distanceDisplayCondition=L;var R=new w._cesium.PrimitiveCollection;return S.features.forEach(function(O){I.id=O;var F=I.height;if(O.properties.height!=null&&(F=parseFloat(O.properties.height)),/^\[/.test(I.height)&&/\]$/.test(I.height)){var k=I.height.replace(/\[/,"").replace(/\]/,"");F=parseFloat(O.properties[k])}I.modelMatrix=w._cesium.Transforms.eastNorthUpToFixedFrame(w._cesium.Cartesian3.fromDegrees(O.geometry.coordinates[0],O.geometry.coordinates[1],F));var U=w._cesium.Model.fromGltf({id:O,url:I.uri,color:I.color,modelMatrix:I.modelMatrix,scale:I.scale,heightReference:parseInt(I.heightReference),distanceDisplayCondition:I.distanceDisplayCondition});R.add(U)}),R},this.item=E._primitiveCollection,E.addTo(this._viewer),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy,y||this.setVisibility(!1);var T={id:m.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"modelLayer",item:this,url:f.url,style:m};return this.setTreeobj(T),this._tree.insertGroupId(T,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};o0.prototype.createPointGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this;!w._core.isnull(m)&&!w._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(w._core.isHtmlColor(m.color)?m.color=w._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=w._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=w._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),!w._core.isnull(m)&&!w._core.isnull(m.outlineColor)&&(/^\[/.test(m.outlineColor)&&m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(w._core.isHtmlColor(m.outlineColor)?m.outlineColor=w._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=w._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=w._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))));var A=new Ah(this._viewer,this._cesium,C);this._Provider=A,A._loadTile=function(T){var S={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:w._cesium.LabelStyle.OUTLINE,fillColor:w._cesium.Color.WHITE,outlineColor:w._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new w._cesium.Color(.165,.165,.165,.8),backgroundPadding:new w._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:w._cesium.HorizontalOrigin.CENTER,verticalOrigin:w._cesium.VerticalOrigin.CENTER,eyeOffset:w._cesium.Cartesian3.ZERO,pixelOffset:w._cesium.Cartesian2.ZERO,heightReference:w._cesium.HeightReference.NONE,scaleByDistance:new w._cesium.NearFarScalar(0,0,1,1)},M=m.material;!w._core.isnull(m)&&!w._core.isnull(m.backgroundColor)&&(/^\[/.test(m.backgroundColor)&&m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(w._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=w._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=w._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=w._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))));var I=w._core.extend(S,m,!0);w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var P=parseFloat(m.near),D=parseFloat(m.far),L=new w._cesium.DistanceDisplayCondition(P,D);I.distanceDisplayCondition=L,w._core.isnull(m.font_size)&&(m.font_size="30px"),w._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),I.font=parseFloat(m.font_size)+"px "+m.font_family;var R=new w._cesium.PointPrimitiveCollection;return T.features.forEach(function(O){I.id=O;var F=0;if(/^\[/.test(I.pointHeight)&&/\]$/.test(I.pointHeight)){var k=I.pointHeight.replace(/\[/,"").replace(/\]/,"");F=parseFloat(O.properties[k])}else I.pointHeight!==void 0&&I.pointHeight!==""?F=parseFloat(I.pointHeight):O.properties.height!=null&&(F=parseFloat(O.properties.height));if(/^\[/.test(m.color)&&/\]$/.test(m.color)){var U=m.color.replace(/\[/,"").replace(/\]/,"");I.color=O.properties[U],w._core.isHtmlColor(I.color)?I.color=w._color.colorFromHtmlColor(I.color):(/^rgb/.test(I.color)&&(I.color=w._color.rgbaStringToRgbaObj(I.color)),I.color.r>1&&(I.color.r=I.color.r/255),I.color.g>1&&(I.color.g=I.color.g/255),I.color.b>1&&(I.color.b=I.color.b/255),I.color.a>1&&(I.color.a=I.color.a/255),I.color=w._color.createColor(I.color.r,I.color.g,I.color.b,I.color.a))}if(/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)){var U=m.outlineColor.replace(/\[/,"").replace(/\]/,"");I.outlineColor=O.properties[U],w._core.isHtmlColor(I.outlineColor)?I.outlineColor=w._color.colorFromHtmlColor(I.outlineColor):(/^rgb/.test(I.outlineColor)&&(I.outlineColor=w._color.rgbaStringToRgbaObj(I.outlineColor)),I.outlineColor.r>1&&(I.outlineColor.r=I.outlineColor.r/255),I.outlineColor.g>1&&(I.outlineColor.g=I.outlineColor.g/255),I.outlineColor.b>1&&(I.outlineColor.b=I.outlineColor.b/255),I.outlineColor.a>1&&(I.outlineColor.a=I.outlineColor.a/255),I.outlineColor=w._color.createColor(I.outlineColor.r,I.outlineColor.g,I.outlineColor.b,I.outlineColor.a))}I.position=new w._cesium.Cartesian3.fromDegrees(O.geometry.coordinates[0],O.geometry.coordinates[1],F),I.text=O.properties.name;var G={show:I.show,position:I.position,pixelSize:I.pixelSize,color:I.color,outlineColor:I.outlineColor,outlineWidth:I.outlineWidth,id:O},j="color:"+I.color.red*255+","+I.color.green*255+","+I.color.blue*255+";outlineColor:"+I.outlineColor.red*255+","+I.outlineColor.green*255+","+I.outlineColor.blue*255;w.Legend.push(j),R.add(G)}),R},this.item=A._primitiveCollection,A.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f.url,style:m};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};o0.prototype.createPointGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium},w=this;!w._core.isnull(m)&&!w._core.isnull(m.color)&&(/^\[/.test(m.color)&&m.color.toString().charAt(0)=="["&&m.color.toString().charAt(m.color.length-1)=="]"||(w._core.isHtmlColor(m.color)?m.color=w._color.colorFromHtmlColor(m.color):(/^rgb/.test(m.color)&&(m.color=w._color.rgbaStringToRgbaObj(m.color)),m.color.r>1&&(m.color.r=m.color.r/255),m.color.g>1&&(m.color.g=m.color.g/255),m.color.b>1&&(m.color.b=m.color.b/255),m.color.a>1&&(m.color.a=m.color.a/255),m.color=w._color.createColor(m.color.r,m.color.g,m.color.b,m.color.a)))),!w._core.isnull(m)&&!w._core.isnull(m.outlineColor)&&(/^\[/.test(m.outlineColor)&&m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(w._core.isHtmlColor(m.outlineColor)?m.outlineColor=w._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=w._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=w._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a))));var A=new Ah(this._viewer,this._cesium,C);this._Provider=A,A._loadTile=function(T){var S={Name:"",text:"",font:" 30px sans-serif",pixelSize:10,style:w._cesium.LabelStyle.OUTLINE,fillColor:w._cesium.Color.WHITE,outlineColor:w._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new w._cesium.Color(.165,.165,.165,.8),backgroundPadding:new w._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:w._cesium.HorizontalOrigin.CENTER,verticalOrigin:w._cesium.VerticalOrigin.CENTER,eyeOffset:w._cesium.Cartesian3.ZERO,pixelOffset:w._cesium.Cartesian2.ZERO,heightReference:w._cesium.HeightReference.NONE,scaleByDistance:new w._cesium.NearFarScalar(0,0,1,1)},M=m.material;!w._core.isnull(m)&&!w._core.isnull(m.backgroundColor)&&(/^\[/.test(m.backgroundColor)&&m.backgroundColor.toString().charAt(0)=="["&&m.backgroundColor.toString().charAt(m.backgroundColor.length-1)=="]"||(w._core.isHtmlColor(m.backgroundColor)?m.backgroundColor=w._color.colorFromHtmlColor(m.backgroundColor):(/^rgb/.test(m.backgroundColor)&&(m.backgroundColor=w._color.rgbaStringToRgbaObj(m.backgroundColor)),m.backgroundColor.r>1&&(m.backgroundColor.r=m.backgroundColor.r/255),m.backgroundColor.g>1&&(m.backgroundColor.g=m.backgroundColor.g/255),m.backgroundColor.b>1&&(m.backgroundColor.b=m.backgroundColor.b/255),m.backgroundColor.a>1&&(m.backgroundColor.a=m.backgroundColor.a/255),m.backgroundColor=w._color.createColor(m.backgroundColor.r,m.backgroundColor.g,m.backgroundColor.b,m.backgroundColor.a))));var I=w._core.extend(S,m,!0);w._core.isnull(m.near)&&(m.near=0),w._core.isnull(m.far)&&(m.far=999999999);var P=parseFloat(m.near),D=parseFloat(m.far),L=new w._cesium.DistanceDisplayCondition(P,D);I.distanceDisplayCondition=L,w._core.isnull(m.font_size)&&(m.font_size="30px"),w._core.isnull(m.font_family)&&(m.font_family=" sans-serif"),I.font=parseFloat(m.font_size)+"px "+m.font_family;var R=new w._cesium.PointPrimitiveCollection;return T.features.forEach(function(O){I.id=O;var F=0;if(/^\[/.test(I.pointHeight)&&/\]$/.test(I.pointHeight)){var k=I.pointHeight.replace(/\[/,"").replace(/\]/,"");F=parseFloat(O.properties[k])}else I.pointHeight!==void 0&&I.pointHeight!==""?F=parseFloat(I.pointHeight):O.properties.height!=null&&(F=parseFloat(O.properties.height));if(/^\[/.test(m.color)&&/\]$/.test(m.color)){var U=m.color.replace(/\[/,"").replace(/\]/,"");I.color=O.properties[U],w._core.isHtmlColor(I.color)?I.color=w._color.colorFromHtmlColor(I.color):(/^rgb/.test(I.color)&&(I.color=w._color.rgbaStringToRgbaObj(I.color)),I.color.r>1&&(I.color.r=I.color.r/255),I.color.g>1&&(I.color.g=I.color.g/255),I.color.b>1&&(I.color.b=I.color.b/255),I.color.a>1&&(I.color.a=I.color.a/255),I.color=w._color.createColor(I.color.r,I.color.g,I.color.b,I.color.a))}if(/^\[/.test(m.outlineColor)&&/\]$/.test(m.outlineColor)){var U=m.outlineColor.replace(/\[/,"").replace(/\]/,"");I.outlineColor=O.properties[U],w._core.isHtmlColor(I.outlineColor)?I.outlineColor=w._color.colorFromHtmlColor(I.outlineColor):(/^rgb/.test(I.outlineColor)&&(I.outlineColor=w._color.rgbaStringToRgbaObj(I.outlineColor)),I.outlineColor.r>1&&(I.outlineColor.r=I.outlineColor.r/255),I.outlineColor.g>1&&(I.outlineColor.g=I.outlineColor.g/255),I.outlineColor.b>1&&(I.outlineColor.b=I.outlineColor.b/255),I.outlineColor.a>1&&(I.outlineColor.a=I.outlineColor.a/255),I.outlineColor=w._color.createColor(I.outlineColor.r,I.outlineColor.g,I.outlineColor.b,I.outlineColor.a))}I.position=new w._cesium.Cartesian3.fromDegrees(O.geometry.coordinates[0],O.geometry.coordinates[1],F),I.text=O.properties.name;var G={show:I.show,position:I.position,pixelSize:I.pixelSize,color:I.color,outlineColor:I.outlineColor,outlineWidth:I.outlineWidth,id:O},j="color:"+I.color.red*255+","+I.color.green*255+","+I.color.blue*255+";outlineColor:"+I.outlineColor.red*255+","+I.outlineColor.green*255+","+I.outlineColor.blue*255;w.Legend.push(j),R.add(G)}),R},this.item=A._primitiveCollection,A.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+m.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"pointLayer",item:this,url:f.url,style:m};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};o0.prototype.setTreeobj=function(o){this.treeobj=o};o0.prototype.getLegend=function(){var o=[];return this.Legend!=null&&(o=this._core.unique(this.Legend)),o};o0.prototype.deleteObject=function(){if(this._Provider!=null&&this._Provider.setStatus(!1),this.items!=null&&this.items!=null&&this.items.length>0)for(var o=0;o<this.items.length;o++)this._viewer.scene.primitives.remove(this.items[o]);else this._viewer.scene.primitives.remove(this.item);if(this.treeobj.type==="DivPoint"&&this.item&&this.item._pointPrimitives!=null&&this.item._pointPrimitives!=null)for(var o=0;o<this.item._pointPrimitives.length;o++){var f=document.getElementById(this.item._pointPrimitives[o].id);f&&f.remove()}try{this._Provider.remove()}catch{}};o0.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};o0.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(!o)}catch{}};o0.prototype.setVisibility=function(o){if(this.treeobj!=null&&this.treeobj.type==="DivPoint"&&this.item&&this.item._pointPrimitives!=null&&this.item._pointPrimitives!=null)for(var f=0;f<this.item._pointPrimitives.length;f++){var m=document.getElementById(this.item._pointPrimitives[f].id);m&&(m.style.display=o?"block":"none")}this.item!=null&&(this.item.show=o),this._Provider&&this._Provider.setStatus(!o)};Object.defineProperties(o0.prototype,{labelText:{set:Ji.debounce(function(o){var f=o;if(!this._core.isnull(o)){var m=this.item.entities&&this.item.entities.values;if(m&&m.length>0)for(var v=0;v<m.length;v++)if(/^\[/.test(o)&&(f=o.replace(/\[/,"").replace(/\]/,""),f=m[v].properties[f]._value),m[v].label){m[v].label.text=f;try{m[v].point.show=!1}catch{}}else{try{m[v].point.show=!1}catch{}m[v].label=new this._cesium.LabelGraphics({text:f,font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})}}},500)},labelStyles:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.style=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.style}},labelFont:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)){var m=f[0].label.font,v=16;if(m&&(m=m._value.trimLeft().trimRight(),v=m.split("px")[0]),f&&f.length>0&&f[0].label)for(var y=0;y<f.length;y++)f[y].label.font=v+"px "+o}}},500)},labelFontSize1:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)){var m=f[0].label.font,v="sans-serif";if(m&&(m=m._value.trimLeft().trimRight(),v=m.split("px")[1]),f&&f.length>0&&f[0].label)for(var y=0;y<f.length;y++)f[y].label.font=o+"px "+v}}},500)},labelFontSize:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(o=o.toString().replace(/px/g,""),!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.font=o+"px sans-serif"}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return parseFloat(o[0].label.font)}},labelFillColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.fillColor=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.fillColor;return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}}},labelOutlineColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.outlineColor=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.outlineColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},labelOutlineWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].label.outlineWidth=o}},200),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.outlineWidth;return f?f._value:void 0}}},labelBackgroundColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.backgroundColor=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.backgroundColor;return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}}},labelBackground:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.showBackground=o},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.background}},labelScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].label.scale=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.scale;return f?f._value:void 0}}},labelHorizontalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.horizontalOrigin=parseInt(o)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.horizontalOrigin;return f?f._value:void 0}}},labelVerticalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.verticalOrigin=parseInt(o)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.verticalOrigin;return f?f._value:void 0}}},labelHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=0;m<f.length;m++)f[m].label.heightReference=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.heightReference;return f?f._value:void 0}}},labelDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=f[0].label.distanceDisplayCondition?f[0].label.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,parseInt(o)),f[v].label.scaleByDistance=new this._cesium.NearFarScalar(m,1,parseInt(o),0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.distanceDisplayCondition?o[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},labelDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].label==null)&&f&&f.length>0&&f[0].label)for(var m=f[0].label.distanceDisplayCondition?f[0].label.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].label.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(parseInt(o),m),f[v].label.scaleByDistance=new this._cesium.NearFarScalar(parseInt(o),1,m,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label){var f=o[0].label.distanceDisplayCondition?o[0].label.distanceDisplayCondition._value.near:0;return f}}},labelHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},labelShow:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].label&&o?(f[m].point&&(f[m].point.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o),f[m].label=new this._cesium.LabelGraphics({text:"label",font:"30px sans-serif",style:this._cesium.LabelStyle.FILL,fillColor:this._cesium.Color.WHITE,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,show:!0,showBackground:!1,backgroundColor:new this._cesium.Color(.165,.165,.165,.8),backgroundPadding:new this._cesium.Cartesian2(7,5),scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,heightReference:this._cesium.HeightReference.NONE})):(f[m].label&&(f[m].label.show=o),f[m].point&&(f[m].point.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].label==null)&&o&&o.length>0&&o[0].label)return o[0].label.show}},modelShow:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)f[m].label&&(f[m].label.show=!o),f[m].point&&(f[m].point.show=!o),f[m].billboard&&(f[m].billboard.show=!o),!f[m].model&&o?f[m].model=new this._cesium.ModelGraphics({show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE}):(f[m].model&&(f[m].model.show=o),f[m].label&&(f[m].label.show=!o),f[m].point&&(f[m].point.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)return o[0].model.show}},modelUri:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0)for(var m=0;m<f.length;m++)if(f[m].model)f[m].model.uri=o;else{if(/^\[/.test(o)){var v=o.split("[");v.length>1?o=v[0]+v[1].replace(/\[/,"").replace(/\]/,""):(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o])}f[m].model=new this._cesium.ModelGraphics({uri:o,show:!0,scale:1,minimumPixelSize:0,incrementallyLoadTextures:!0,runAnimations:!0,clampAnimations:!0,shadows:this._cesium.ShadowMode.ENABLED,heightReference:this._cesium.HeightReference.NONE,color:this._cesium.Color.WHITE})}}},500)},modelScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){o=parseFloat(o);var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].model.scale=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.scale;return f?f._value:void 0}}},modelShadows:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.shadows=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)return o[0].model.shadows}},modelHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.heightReference=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.heightReference;return f?f._value:void 0}}},modelDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=f[0].model.distanceDisplayCondition?f[0].model.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model)var f=o[0].model.distanceDisplayCondition?o[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE}},modelDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=f[0].model.distanceDisplayCondition?f[0].model.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].model.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.distanceDisplayCondition?o[0].model.distanceDisplayCondition._value.near:0;return f}}},modelColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.color=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},modelLightColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].model==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].model.lightColor=o}},100),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].model==null)&&o&&o.length>0&&o[0].model){var f=o[0].model.lightColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},modelHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},pointColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.color=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},pointShow:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].point&&o?(f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o),f[m].point=new this._cesium.PointGraphics({color:this._cesium.Color.WHITE,pixelSize:1,outlineColor:this._cesium.Color.BLACK,outlineWidth:0,show:!0})):(f[m].point&&(f[m].point.show=o),f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point)return o[0].point.show}},pointPixelSize:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].point.pixelSize=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.pixelSize;return f?f._value:void 0}}},pointOutlineColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.outlineColor=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.outlineColor;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},pointOutlineWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)/^\[/.test(o)&&(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o]),f[m].point.outlineWidth=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.outlineWidth;return f?f._value:void 0}}},pointHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=0;m<f.length;m++)f[m].point.heightReference=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.heightReference;return f?f._value:void 0}}},pointDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=f[0].point.distanceDisplayCondition?f[0].point.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o),f[v].point.scaleByDistance=new this._cesium.NearFarScalar(m,1,o,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.distanceDisplayCondition?o[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},pointDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].point==null)&&f&&f.length>0&&f[0].point)for(var m=f[0].point.distanceDisplayCondition?f[0].point.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].point.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m),f[v].point.scaleByDistance=new this._cesium.NearFarScalar(o,1,m,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].point==null)&&o&&o.length>0&&o[0].point){var f=o[0].point.distanceDisplayCondition?o[0].point.distanceDisplayCondition._value.near:0;return f}}},pointHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}},billboardShow:{set:Ji.debounce(function(o){var f=this.item.entities&&this.item.entities.values;if(f&&f.length>0)for(var m=0;m<f.length;m++)!f[m].billboard&&o?(f[m].point&&(f[m].point.show=!o),f[m].label&&(f[m].label.show=!o),f[m].model&&(f[m].model.show=!o),f[m].billboard=new this._cesium.BillboardGraphics({show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})):(f[m].billboard&&(f[m].billboard.show=o),f[m].point&&(f[m].point.show=!o),f[m].label&&(f[m].label.show=!o),f[m].billboard&&(f[m].billboard.show=!o))},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.show}},billboardImage:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0)for(var m=0;m<f.length;m++){if(/^\[/.test(o)){var v=o.split("[");v.length>1?o=v[0]+v[1].replace(/\[/,"").replace(/\]/,""):(o=o.replace(/\[/,"").replace(/\]/,""),o=f[m].properties[o])}f[m].billboard?f[m].billboard.image=o:f[m].billboard=new this._cesium.BillboardGraphics({image:o,show:!0,scale:1,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,eyeOffset:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,color:this._cesium.Color.WHITE,heightReference:this._cesium.HeightReference.NONE})}}},500)},billboardScale:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.scale=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.scale;return f?f._value:void 0}}},billboardHorizontalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.horizontalOrigin=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.horizontalOrigin}},billboardVerticalOrigin:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.verticalOrigin=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard)return o[0].billboard.verticalOrigin}},billboardWidth:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.width=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.width;return f?f._value:void 0}}},billboardHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.height=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.height;return f?f._value:void 0}}},billboardColor:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){this._core.isnull(o)||(this._core.isHtmlColor(o)?o=this._color.colorFromHtmlColor(o):(/^rgb/.test(o)&&(o=this._color.rgbaStringToRgbaObj(o)),o.r>1&&(o.r=o.r/255),o.g>1&&(o.g=o.g/255),o.b>1&&(o.b=o.b/255),o.a>1&&(o.a=o.a/255),o=this._color.createColor(o.r,o.g,o.b,o.a)));var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=0;m<f.length;m++)f[m].billboard.color=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.color;try{return this._color.toHtmlColor("rgb("+f._value.red*255+","+f._value.green*255+","+f._value.blue*255+","+f._value.alpha*255+")")}catch{}}}},billboardHeightReference:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].model)for(var m=0;m<f.length;m++)f[m].billboard.heightReference=o}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].model){var f=o[0].billboard.heightReference;return f?f._value:void 0}}},billboardDistanceDisplayMaxCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=f[0].billboard.distanceDisplayCondition?f[0].billboard.distanceDisplayCondition._value.near:0,v=0;v<f.length;v++)f[v].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(m,o),f[v].billboard.scaleByDistance=new this._cesium.NearFarScalar(m,1,o,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.distanceDisplayCondition?o[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE;return f}}},billboardDistanceDisplayMinCondition:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].billboard==null)&&f&&f.length>0&&f[0].billboard)for(var m=f[0].billboard.distanceDisplayCondition?f[0].billboard.distanceDisplayCondition._value.far:Number.MAX_VALUE,v=0;v<f.length;v++)f[v].billboard.distanceDisplayCondition=new this._cesium.DistanceDisplayCondition(o,m),f[v].billboard.scaleByDistance=new this._cesium.NearFarScalar(o,1,m,0)}},500),get:function(){var o=this.item.entities&&this.item.entities.values;if(!(o&&!/^point.fid/.test(o[0]._id)&&o[0].billboard==null)&&o&&o.length>0&&o[0].billboard){var f=o[0].billboard.distanceDisplayCondition?o[0].billboard.distanceDisplayCondition._value.near:0;return f}}},billboardPHeight:{set:Ji.debounce(function(o){if(!this._core.isnull(o)){var f=this.item.entities&&this.item.entities.values;if(!(f&&!/^point.fid/.test(f[0]._id)&&f[0].position==null)&&f&&f.length>0&&f[0].position)for(var m=0;m<f.length;m++){var v=this._cesium.Cartographic.fromCartesian(f[m].position._value),y=this._cesium.Math.toDegrees(v.longitude),x=this._cesium.Math.toDegrees(v.latitude),C=this._cesium.Cartesian3.fromDegrees(y,x,o);f[m].position=C}}},500),get:function(){return 0}}});var bs=null,C6i=function(o,f,m,v){let y=m,x=v;var C=f.west,w=f.east,A=f.south,E=f.north,T=w-C,S=E-A,M=o.longitude*180/Math.PI,I=o.latitude*180/Math.PI;return o.normalizedLongitude=(M-C)/T*m,o.normalizedLatitude=(I-A)/S*v,o},b6i=function(o,f,m,v){var y=[],x=o[0].longitude!==void 0;return o.forEach(function(C){var w=[],A=x?C:cN.scene.globe.ellipsoid.cartesianToCartographic(C);A=C6i(A,f,m,v),w.push(A.normalizedLongitude),w.push(A.normalizedLatitude),y.push(w)}),y},w6i=function(o,f,m){var v=32,y=f.west*bs.Math.DEGREES_PER_RADIAN,x=f.east*bs.Math.DEGREES_PER_RADIAN,C=f.south*bs.Math.DEGREES_PER_RADIAN,w=f.north*bs.Math.DEGREES_PER_RADIAN,A=new bs.Rectangle(y,C,x,w),E=b6i(o,A,v,v),T=A6i(E,"#FF0000",v,v);return T},A6i=function(o,f,m,v,y){if(y===void 0){var y=document.createElement("canvas");y.width=m,y.height=v}var x=y.getContext("2d");if(!(o.length<=0)){x.moveTo(o[0][0],o[0][1]);for(var C=0;C<o.length;C++)x.lineTo(o[C][0],o[C][1]);return f!=null&&f!=null&&(x.fillStyle=f,x.fill()),y}};function jP(o,f){return Math.floor(Math.random()*(f-o+1))+o}function E6i(){return globalThis.GEOWORLD_BASE_URL+"Workers/ParseElevationWorker.js"}function T6i(o,f){var m=bs.defer();return jP=w6i(o.vertices,f,o.heights[0]),jP.timeStamp=o.timeStamp,jP.mtHeight=o.heights,jP.mtType=o.mtType,jP.fromKML=o.fromKML,jP.rect=o.rectangle,jP.level=o.level,m.resolve(jP),m.promise}function S6i(o,f){return Math.floor(Math.random()*(f-o+1))+o}function P6i(o,f){var m=bs.defer(),v=[];return o.forEach(function(y){v.push(T6i(y,f))}),Promise.all(v).then(function(y){var x=y[0].lenght,C=function(E,T){return T.timeStamp-E.timeStamp};if(y.length===1)m.resolve(y[0]);else{var w=y.sort(C),A=w.shift();w.forEach(function(E){A.forEach(function(T,S){T===jP&&E[S]!==jP&&(A[S]=E[S])})}),m.resolve(A)}}),m.promise}var cN,Egt=!1;function Ud(o,f,m){if(bs=m,cN=o,!bs.defined(f))throw new bs.DeveloperError("options is required.");this._errorEvent=new bs.Event,this._modelFloorMasks={},this._credit=f.credit,typeof this._credit=="string"&&(this._credit=new bs.Credit(this._credit)),f.heightMapWidth=bs.defaultValue(f.heightMapWidth,32),f.heightMapHeight=bs.defaultValue(f.heightMapHeight,32),this._options=f,this.readyPromise=Promise.resolve(!0),this._subdomains=f.subdomains,f.firstRequestUrl=f.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=f.firstRequestUrl+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&v=1&layers="+f.layerName+"&Styles=&Format=image/mpt";var v=this,y=f.pngOnly;f.maxTerrainLevel!==void 0&&isNaN(f.maxTerrainLevel)&&(f.maxTerrainLevel=void 0),this._maxTerrainLevel=bs.defaultValue(f.maxTerrainLevel,30),y?v.setFormatMPT(!1):$.ajax({url:f.cacheUrl?`${f.cacheUrl}/0/0/0.${f.cacheFormat||"mpt"}`:this._firstRequest,success:function(C){var w=!!(bs.defined(C.childNodes)&&C.childNodes.length>0);if(!!w)return v.setFormatMPT(!1),null;v.setFormatMPT(!0)},error:function(){return v.setFormatMPT(!1),null},async:!1}),f.cacheUrl&&(this.isCache=!0,this.cacheLevel=f.cacheLevel||16,this._cacheUrl=`${f.cacheUrl}/{z}/{x}/{reverseY}.${f.cacheFormat||"mpt"}`);let x=this._maxTerrainLevel;this._availability={computeMaximumLevelAtPosition:function(C){return Math.min(x,16)}},this._urlTemplate=f.url+"?request=GetMap&Version=1.3.0&Service=WMS&v=1&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+f.layerName+"&Styles=&Format=image/"+this._format,this._allElevationLayers=null,this._tilingScheme=new bs.GeographicTilingScheme,this._levelZeroMaximumGeometricError=bs.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,f.heightMapWidth*4,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new cA({workerPath:E6i()},bs),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(C){},this)}Ud._geometricErrorFactor=2;Object.defineProperties(Ud.prototype,{errorEvent:{get:function(){return this._errorEvent}},availability:{get:function(){return this._availability}},credit:{get:function(){return this._credit}},hasVertexNormals:{get:function(){return!1}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}});Ud.prototype.setFormatMPT=function(o){if(!(o&&this.pngOnly)){var f=this._format;this._format=o?"mpt":"png",f!==this._format&&(this._isMPT=o,this._urlTemplate!==void 0&&(this._urlTemplate=this._urlTemplate.replace("image/"+f,"image/"+this._format)))}};Ud.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)*Ud._geometricErrorFactor};Ud.prototype.createKeyFromTile=function(o,f,m){return o+"_"+f+"_"+m};Ud.prototype.getTileDataAvailable=function(o,f,m){var v=Math.min(this._maxTerrainLevel,25);return this._isMPT?!0:m<v};Ud.prototype.requestFactorForLevel=function(o){var f=Math.log(this._requestGridSize)/Math.log(2);return f=Math.min(f,o),Math.pow(2,f)};Ud.prototype.getRequestBaseTerrainUrl=function(o,f,m,v){return this.getRequestUrl(o,f,m,v)};Ud.prototype.getRequestElevationLayer=function(o,f,m){return this.getRequestUrl(o,f,m,!1,!0)};Ud.prototype.getRequestUrl=function(w,A,E,v,y){var x=E,C=v!=null?this.requestFactorForLevel(E):1,w=v!=null?(w-w%C)/C:w,A=v!=null?(A-A%C)/C:A,E=v!=null?E-Math.log(C)/Math.log(2):E;if(this.isCache&&E!==0&&E<=this.cacheLevel){let I=this.tilingScheme.getNumberOfYTilesAtLevel(E)-A-1;return this._cacheUrl.replace("{x}",w).replace("{reverseY}",I).replace("{z}",E)}var T=this.tilingScheme.tileXYToNativeRectangle(w,A,E),S=this.heightMapWidth*C===256&&v?1:0;y&&(S=0);var M=this._urlTemplate.replace("{south}",T.south).replace("{north}",T.north).replace("{west}",T.west).replace("{east}",T.east).replace("{optimizedOnly}",S).replace("{width}",this.heightMapWidth*C).replace("{height}",this.heightMapHeight*C).replace("{s}",this.sTag(w,A,E));return M+"&level="+E+"&origLevel="+x};Ud.prototype.isT_Inside_E=function(o,f){return o.west>=f.west*bs.Math.DEGREES_PER_RADIAN&&o.east<=f.east*bs.Math.DEGREES_PER_RADIAN&&o.south>=f.south*bs.Math.DEGREES_PER_RADIAN&&o.north<=f.north*bs.Math.DEGREES_PER_RADIAN};Ud.prototype.isT_Intersects_E=function(o,f){var m=o.west*bs.Math.RADIANS_PER_DEGREE,v=o.east*bs.Math.RADIANS_PER_DEGREE,y=o.south*bs.Math.RADIANS_PER_DEGREE,x=o.north*bs.Math.RADIANS_PER_DEGREE,C=new bs.Rectangle(m,y,v,x),w=bs.Rectangle.intersection(C,f,new bs.Rectangle);return w};Ud.prototype.sTag=function(o,f,m){if(this._subdomains==null)return"";var v=(o+f+m)%this._subdomains.length;return this._subdomains[v]};Ud.prototype.refreshElevationLayer=function(o){if(o.rectangle&&cN.scene.globe._surface._levelZeroTiles!==void 0){var f=this.findDirectParent(o.rectangle,!0);f.freeResources()}};Ud.prototype.findDirectParent=function(o,f){var m=function(x,C,w){var A=w?4.1:2.1;if(x._rectangle.width<=C.width*A&&bs.Rectangle.contains(x._rectangle,bs.Rectangle.center(C)))return x;for(var E=x.children.length,T=0;T<E;T++){var S=x.children[T];if(bs.Rectangle.contains(S._rectangle,bs.Rectangle.center(C)))return m(S,C,w)}return null};if(o.width==Math.PI)return null;for(var v=0;v<cN.scene.globe._surface._levelZeroTiles.length;v++){var y=m(cN.scene.globe._surface._levelZeroTiles[v],o,f);if(y)return y}return null};Ud.prototype.isTileAvailable=function(o,f,m){var v=this._tilingScheme.tileXYToRectangle(o,f,m,new bs.Rectangle),y=this.findDirectParent(v);if(y&&y.data&&y.data.terrainData){if(!(y.data.terrainData._childTileMask>0))return!1;for(var x=y.children.length,C=0;C<x;C++){var w=y.children[C];if(bs.Rectangle.equals(w._rectangle,v))return y.data.terrainData._childTileMask&1<<C}}return!0};Ud.prototype.markTileAsUnavailable=function(o,f,m){var v=this._tilingScheme.tileXYToRectangle(o,f,m,new bs.Rectangle),y=this.findDirectParent(v);y&&y.data&&y.data.terrainData&&y.data.terrainData._childTileMask>0&&$.each(y.children,function(x,C){if(bs.Rectangle.equals(C._rectangle,v)){switch(x){case 0:y.data.terrainData._childTileMask&=-5;break;case 1:y.data.terrainData._childTileMask&=-9;break;case 2:y.data.terrainData._childTileMask&=-2;break;case 3:y.data.terrainData._childTileMask&=-3;break;default:}return!1}return!0})};Ud.prototype.requestBaseTerrainTileGeometry=function(o,f,m,v){return this.requestTileGeometryBuffers(o,f,m,v)};Ud.prototype.requestElevationLayerTileGeometry=function(o,f,m,v,y){return this.requestTileGeometryBuffers(o,f,m,v,y)};Ud.prototype.requestTileGeometryBuffers=function(o,f,m,v,y){var x=this,C=15,w={};w.requestedRectangle=this.tilingScheme.tileXYToNativeRectangle(o,f,m),w.layer=y;var M,A,E,T,S=bs.defer(),M=this.requestTileHeightBuffer(o,f,m,v,void 0,y);return M===void 0?void 0:(A=this.requestTileHeightBuffer(o+1,f,m,v,!0,y),E=this.requestTileHeightBuffer(o,f+1,m,v,!0,y),T=this.requestTileHeightBuffer(o+1,f+1,m,v,!0,y),Promise.all([M,A,E,T]).then(function(I){if(Egt==0){if(I[0].myReject!=null&&I[0].myReject){S.reject();return}for(var P=x.heightMapWidth+1,D=x.heightMapHeight+1,L=new Float32Array(P*D),R=I[0].isFloor,O=0;O<P;O++)for(var F=0;F<D;F++){var k=O,U=F,G=0;F===P-1&&(U=0,G=1,R&&(G=0,U=P-2)),O===D-1&&(k=0,G=2);var j=O*P+F,q=k*x.heightMapWidth+U;I[G]!==null&&(I[G].myReject==null||!I[G].myReject)&&(L[j]=I[G][q])}(I[3].myReject==null||!I[3].myReject)&&(L[P*D-1]=I[3][0]);var J=x.arrayToHeightmapTerrainData(L,P,D,C);w.buffer=J,S.resolve(w)}else{var J=x.arrayToHeightmapTerrainData(I[0],x.heightMapWidth,x.heightMapHeight);w.buffer=J,S.resolve(w)}}).catch(function(){S.reject()}),S.promise)};Ud.prototype.requestTileGeometry=function(o,f,m,v){var y=this,x=[],C=y.tilingScheme.tileXYToNativeRectangle(o,f,m);this._allElevationLayers!=null&&this._allElevationLayers.length>0&&m>7?$(this._allElevationLayers).each(function(A,E){var T=E.show;if(T){var S=E.rectangle;y.isT_Inside_E(C,S)?(y.setFormatMPT(!1),x.push(y.requestElevationLayerTileGeometry(o,f,m,v,E))):y.isT_Intersects_E(C,S)!=null?(y.setFormatMPT(!1),x.push(y.requestElevationLayerTileGeometry(o,f,m,v,E)),x.push(y.requestBaseTerrainTileGeometry(o,f,m,v))):(y.setFormatMPT(!0),x.push(y.requestBaseTerrainTileGeometry(o,f,m,v)))}else y.setFormatMPT(!0),x.push(y.requestBaseTerrainTileGeometry(o,f,m,v))}):(y.setFormatMPT(!0),x.push(y.requestBaseTerrainTileGeometry(o,f,m,v)));var w=bs.defer();return Promise.all(x).then(function(A){if(A.length===1)A.layer!==void 0&&console.log("missing scale and offset"),w.resolve(A[0].buffer);else if(A.length>1){var E=$.grep(A,function(P){return P.layer!==void 0}),T=$.grep(A,function(P){return P.layer===void 0});if(E.length===0)w.resolve(A[0].buffer);else{var S=E[E.length-1],M=T[T.length-1],I={tolerance:S.layer.nullTolerance,nullValueNumber:S.layer.nullValueNumber,verticesX:S.layer.polygonVerticesX,verticesY:S.layer.polygonVerticesY,scale:bs.defaultValue(S.layer.scale,1),offset:bs.defaultValue(S.layer.offset,0)};w.resolve(y.mergeBuffers(M.buffer,S.buffer,I,M.requestedRectangle))}}else w.reject()}).catch(function(){w.reject()}),w.promise};Ud.prototype.mergeBuffers=function(o,f,m,v){var y,x,C,w,A,E=33,T=33,S=v.west,M=v.north,I=v.east,P=v.south,D=v.width/E,L=v.height/T,R=m.scale,O=m.offset,F=m.nullValueNumber,k=m.tolerance,U=F!==void 0&&k!==void 0;if(U)var G=bs.defaultValue(m.nullValueNumber,0),j=bs.defaultValue(Number(m.tolerance),0);var q=new Float32Array(E*T);for(y=0,A=M;y<T;y++,A+=L)for(x=0,w=S;x<E;x++,w+=D)C=y*E+x,U?q[C]=!f._buffer[C]||f._buffer[C]>=G-j&&f._buffer[C]<=G+j?o._buffer[C]:f._buffer[C]*R+O:q[C]=f._buffer[C]?f._buffer[C]*R+O:o._buffer[C];return this.arrayToHeightmapTerrainData(q,E,T,15)};Ud.prototype.requestTileHeightBuffer=function(o,f,m,v,y,x){var C=this;if(!isNaN(o+f+m)){(!bs.defined(v)||v===!1)&&(v=new bs.Request({defer:!0}));var w=v.defer==0;y=bs.defaultValue(w,!1);var A=bs.defer();if(Egt==0){var E;if(x!==void 0)x.getUrlFromSTag=function(Q,ee,z){return x.subdomains===void 0?x.url:x.subdomains[0]+"/SG"},E=this.getRequestElevationLayer(o,f,m).replace(this._options.url,x.getUrlFromSTag(o,f,m)+"/Elevation").replace(this._options.layerName,x.name),x.format==="mpt"&&(E=E.replace("image/png","image/mpt"));else{E=this.getRequestBaseTerrainUrl(o,f,m,w||y);var T=cN.terrainProvider.tilingScheme.tileXYToRectangle(o,f,m),S=cN.terrainProvider._modifyTerrainObjects,M=bs.defer();if(S!==void 0){var I=[];if(S.forEach(function(Q){Q.show&&bs.Rectangle.intersection(T,Q.rectangle,new bs.Rectangle)!=null&&I.push(Q)}),I.length>0)if(I.length===1&&I[0].modelFloorBestLevel&&m>I[0].modelFloorBestLevel)M.resolve("NoMerge");else{var P=P6i(I,T,m);Promise.resolve(P).then(function(Q){M.resolve(Q)}).catch(function(Q){console.log(Q)})}else M.resolve("NoMerge")}else M.resolve("NoMerge");var D=bs.defer(),L=$.grep([],function(Q){return Q._selectedTiles.length>0});if(L.length===1&&L[0].level&&m>L[0].level)D.resolve("NoFloor");else{var R=!1,O=32,F=65535;L.forEach(function(Q){if(Q.ready&&Q.show&&Q.rootFloorRectangle!==void 0&&bs.Rectangle.intersection(T,Q.rootFloorRectangle)!==void 0){for(var ee=new Uint16Array(O*O),z=T.west,ie=T.south,re=(T.east-T.west)/32,ne=(T.north-T.south)/32,oe,se=0;se<O;se++)for(var ae=0;ae<O;ae++){var fe=z+re*ae+re/2,de=T.north-ne*se-ne/2,ve=new bs.Cartographic(fe,de);oe=F;var pe=Q.getHRMTFP(Q,ve,!0);pe!=null&&pe.content&&pe.content._model&&pe.content._model.floor&&(oe=pe.content._model.floor.getHeight(ve.longitude,ve.latitude)),oe!==F&&(oe+=1.5),ee[se*O+ae]=oe}R=!0,D.resolve(ee)}}),R||D.resolve("NoFloor")}var k=cN.scene.globe.ellipsoid}if(this._requestsCache.hasOwnProperty(E)===!1){if(this._requestsCache[E]={},this._requestsCacheKeys.push(E),this._requestsCacheKeys.length>100){for(var U=0;U<50;U++)delete this._requestsCache[this._requestsCacheKeys[U]];this._requestsCacheKeys.splice(0,50)}}else{var G=this._requestsCacheKeys.indexOf(E);this._requestsCacheKeys.splice(G,1),this._requestsCacheKeys.push(E)}var j=this._requestsCache[E];if(j.dataLoaded===void 0&&(j.dataLoaded=bs.Resource.fetchArrayBuffer(E),!bs.defined(j.dataLoaded)))return;var q=this;this._pendingRequests++,Promise.resolve(j.dataLoaded).then(function(Q){j.workerFinished===void 0&&(j.workerFinished=q._workerPool.queueWorkItem({buffer:Q,isElevation:x!==void 0,level:m})),Promise.all([j.workerFinished,M.promise,D.promise]).then(function(ee){var z=ee[1]!==void 0&&ee[1]!=="NoMerge",ie=ee[2]!==void 0&&ee[2]!=="NoFloor";if(ee[0].rejected){for(var re=q.heightMapWidth*q.heightMapHeight,ne=new Int16Array(re),oe=0,se=0;se<re;se++)ne[se]=300;return m>2&&(ne.myReject=!0),A.resolve(ne),A.promise}var ae=q.extractTileHeightBuffer(ee[0].buffer,o,f,m);if(q._pendingRequests--,z)for(var se=0;se<32;se++)for(var fe=0;fe<32;fe++){var de=se*32+fe;ae[de]=ee[1].mtHeight[0]}if(ie){for(var se=0;se<32;se++)for(var fe=0;fe<32;fe++){var de=se*32+fe;ae[de]=ee[2][de]===65535||ee[2][de]>10500?ae[de]:ee[2][de]}ae.isFloor=!0}A.resolve(ae)}).catch(function(){for(var ee=q.heightMapWidth*q.heightMapHeight,z=new Int16Array(ee),ie=0,re=0;re<ee;re++)z[re]=300;return m>2&&(z.myReject=!0),A.resolve(z),A.promise})}).catch(function(){q._pendingRequests--,A.reject()})}else{for(var J=this.heightMapWidth*this.heightMapHeight,X=new Int16Array(J),Y=S6i(0,1500),U=0;U<J;U++)X[U]=Y;A.resolve(X)}return A.promise}};Ud.prototype.extractTileHeightBuffer=function(o,f,m,v){try{for(var y=this.requestFactorForLevel(v),x=f%y,C=m%y,w=new Float32Array(this.heightMapWidth*this.heightMapHeight),A=1e6,E=-1e5,T=0;T<this.heightMapHeight;T++)for(var S=0;S<this.heightMapWidth;S++){var M=T+C*this.heightMapHeight,I=S+x*this.heightMapWidth,P=T*this.heightMapWidth+S,D=M*this.heightMapWidth*y+I;o[D]>E&&(E=o[D]),o[D]<A&&(A=o[D]),w[P]=o[D]}}catch(L){console.log(L.message)}return w};Ud.prototype.arrayToHeightmapTerrainData=function(o,f,m,v){bs.defined(o)===!1&&(o=new Int16Array(f*m));var y={buffer:o,width:f,height:m,childTileMask:v};return new bs.HeightmapTerrainData(y)};var Q3e=Ud;var I6i=function(o,f,m,v){let y=m,x=v;var C=f.west,w=f.east,A=f.south,E=f.north,T=w-C,S=E-A,M=o.longitude*180/Math.PI,I=o.latitude*180/Math.PI;return o.normalizedLongitude=(M-C)/T*m,o.normalizedLatitude=(I-A)/S*v,o},M6i=function(o,f,m,v){var y=[],x=o[0].longitude!==void 0;return o.forEach(function(C){var w=[],A=x?C:fG.scene.globe.ellipsoid.cartesianToCartographic(C);A=I6i(A,f,m,v),w.push(A.normalizedLongitude),w.push(A.normalizedLatitude),y.push(w)}),y},D6i=function(o,f,m){var v=32,y=f.west*Cesium.Math.DEGREES_PER_RADIAN,x=f.east*Cesium.Math.DEGREES_PER_RADIAN,C=f.south*Cesium.Math.DEGREES_PER_RADIAN,w=f.north*Cesium.Math.DEGREES_PER_RADIAN,A=new Cesium.Rectangle(y,C,x,w),E=M6i(o,A,v,v),T=L6i(E,"#FF0000",v,v);return T},L6i=function(o,f,m,v,y){if(y===void 0){var y=document.createElement("canvas");y.width=m,y.height=v}var x=y.getContext("2d");if(!(o.length<=0)){x.moveTo(o[0][0],o[0][1]);for(var C=0;C<o.length;C++)x.lineTo(o[C][0],o[C][1]);return f!=null&&f!=null&&(x.fillStyle=f,x.fill()),y}};function R6i(o,f){return Math.floor(Math.random()*(f-o+1))+o}function O6i(){return SmartEarthRootUrl+"Workers/ParseElevationWorker.js"}var fG,Tgt=!1;function H_(o,f){if(fG=o,!Cesium.defined(f))throw new Cesium.DeveloperError("options is required.");this._errorEvent=new Cesium.Event,this._credit=f.credit,typeof this._credit=="string"&&(this._credit=new Cesium.Credit(this._credit)),f.heightMapWidth=Cesium.defaultValue(f.heightMapWidth,32),f.heightMapHeight=Cesium.defaultValue(f.heightMapHeight,32),this._options=f,this._subdomains=f.subdomains,f.url=f.url.replace("{s}",this.sTag(0,0,0)),this._firstRequest=f.url+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox=-90,-180,90,180&height=32&width=32&optimizedOnly=0&layers="+f.layerName+"&Styles=&Format=image/mpt",f.token&&(this._firstRequest+="&token="+f.token),this._requestVertexNormals=Cesium.defaultValue(f.requestVertexNormals,!1);var m=this;$.ajax({url:f.cacheUrl?`${f.cacheUrl}/0/0/0.${f.cacheFormat||"mpt"}`:this._firstRequest,success:function(y){var x=!!(Cesium.defined(y.childNodes)&&y.childNodes.length>0);if(x)return m._isMPT=!1,m._format="png",null;m._isMPT=!0,m._format="mpt"},error:function(){return m._isMPT=!1,m._format="png",null},async:!1}),f.cacheUrl&&(this.isCache=!0,this.cacheLevel=f.cacheLevel||16,this._cacheUrl=`${f.cacheUrl}/{z}/{x}/{reverseY}.${f.cacheFormat||"mpt"}`);let v=16;this._availability={computeMaximumLevelAtPosition:function(y){return Math.min(v,16)}},this._urlTemplate=f.url+"?request=GetMap&Version=1.3.0&Service=WMS&CRS=EPSG:4326&bbox={south},{west},{north},{east}&height={height}&width={width}&optimizedOnly={optimizedOnly}&layers="+f.layerName+"&Styles=&Format=image/"+this._format,f.token&&(this._urlTemplate+="&token="+f.token),this._tilingScheme=new Cesium.GeographicTilingScheme,this._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,f.heightMapWidth*4,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._workerPool=new cA({workerPath:O6i()}),this._pendingRequests=0,this._requestGridSize=8,this._requestsCache={},this._requestsCacheKeys=[],this.errorEvent.addEventListener(function(y){},this)}H_._geometricErrorFactor=2;Object.defineProperties(H_.prototype,{errorEvent:{get:function(){return this._errorEvent}},availability:{get:function(){return this._availability}},credit:{get:function(){return this._credit}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return!0}},hasWaterMask:{get:function(){return!1}},heightMapHeight:{get:function(){return this._options.heightMapHeight}},heightMapWidth:{get:function(){return this._options.heightMapWidth}},pendingRequests:{get:function(){return this._pendingRequests}}});H_.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)*H_._geometricErrorFactor};H_.prototype.createKeyFromTile=function(o,f,m){return o+"_"+f+"_"+m};H_.prototype.getTileDataAvailable=function(o,f,m){return this._isMPT?void 0:m<16};H_.prototype.requestFactorForLevel=function(o){var f=Math.log(this._requestGridSize)/Math.log(2);return f=Math.min(f,o),Math.pow(2,f)};H_.prototype.getRequestUrl=function(o,f,m,v){var y=this.requestFactorForLevel(m);if(o=(o-o%y)/y,f=(f-f%y)/y,m-=Math.log(y)/Math.log(2),this.isCache&&m!==0&&m<=this.cacheLevel){let A=this.tilingScheme.getNumberOfYTilesAtLevel(m)-f-1;return this._cacheUrl.replace("{x}",o).replace("{reverseY}",A).replace("{z}",m)}var x=this.tilingScheme.tileXYToNativeRectangle(o,f,m),C=this.heightMapWidth*y===256&&v?1:0,w=this._urlTemplate.replace("{south}",x.south).replace("{north}",x.north).replace("{west}",x.west).replace("{east}",x.east).replace("{optimizedOnly}",C).replace("{width}",this.heightMapWidth*y).replace("{height}",this.heightMapHeight*y).replace("{s}",this.sTag(o,f,m));return w};H_.prototype.sTag=function(o,f,m){if(this._subdomains==null)return"";var v=(o+f+m)%this._subdomains.length;return this._subdomains[v]};H_.prototype.findDirectParent=function(o){var f=function(y,x){if(y._rectangle.width<=x.width*2.1&&Cesium.Rectangle.contains(y._rectangle,Cesium.Rectangle.center(x)))return y;for(var C=y.children.length,w=0;w<C;w++){var A=y.children[w];if(Cesium.Rectangle.contains(A._rectangle,Cesium.Rectangle.center(x)))return f(A,x)}return null};if(o.width==Math.PI)return null;for(var m=0;m<fG.scene.globe._surface._levelZeroTiles.length;m++){var v=f(fG.scene.globe._surface._levelZeroTiles[m],o);if(v)return v}return null};H_.prototype.isTileAvailable=function(o,f,m){var v=this._tilingScheme.tileXYToRectangle(o,f,m,new Cesium.Rectangle),y=this.findDirectParent(v);if(y&&y.data&&y.data.terrainData){if(!(y.data.terrainData._childTileMask>0))return!1;for(var x=y.children.length,C=0;C<x;C++){var w=y.children[C];if(Cesium.Rectangle.equals(w._rectangle,v))return y.data.terrainData._childTileMask&1<<C}}return!0};H_.prototype.markTileAsUnavailable=function(o,f,m){var v=this._tilingScheme.tileXYToRectangle(o,f,m,new Cesium.Rectangle),y=this.findDirectParent(v);y&&y.data&&y.data.terrainData&&y.data.terrainData._childTileMask>0&&$.each(y.children,function(x,C){if(Cesium.Rectangle.equals(C._rectangle,v)){switch(x){case 0:y.data.terrainData._childTileMask&=-5;break;case 1:y.data.terrainData._childTileMask&=-9;break;case 2:y.data.terrainData._childTileMask&=-2;break;case 3:y.data.terrainData._childTileMask&=-3;break;default:}return!1}return!0})};H_.prototype.requestTileGeometry=function(o,f,m,v){var y=this,x=this.requestTileHeightBuffer(o,f,m,v);if(x!==void 0){var C=this,w=15,A=this.requestTileHeightBuffer(o+1,f,m,v,!0),E=this.requestTileHeightBuffer(o,f+1,m,v,!0),T=this.requestTileHeightBuffer(o+1,f+1,m,v,!0),S=Cesium.when.defer();return Cesium.when.all([x,A,E,T],function(M){if(Tgt==0){if(M[0].myReject!=null&&M[0].myReject){C.markTileAsUnavailable(o,f,m),S.reject();return}for(var I=C.heightMapWidth+1,P=C.heightMapHeight+1,D=new Float32Array(I*P),L=0;L<I;L++)for(var R=0;R<P;R++){var O=L,F=R,k=0;R===I-1&&(F=0,k=1),L===P-1&&(O=0,k=2);var U=L*I+R,G=O*C.heightMapWidth+F;M[k]!==null&&(M[k].myReject==null||!M[k].myReject)&&(D[U]=M[k][G])}(M[3].myReject==null||!M[3].myReject)&&(D[I*P-1]=M[3][0]);var j=C.arrayToHeightmapTerrainData(D,I,P,w);S.resolve(j)}else{var j=C.arrayToHeightmapTerrainData(M[0],C.heightMapWidth,C.heightMapHeight);S.resolve(j)}}).otherwise(function(){S.reject()}),S}};H_.prototype.requestTileHeightBuffer=function(o,f,m,v,y,x){if(!isNaN(o+f+m)){(!Cesium.defined(v)||v===!1)&&(v=new Cesium.Request({defer:!0}));var C=v.defer==0;y=Cesium.defaultValue(C,!1);var w=Cesium.when.defer();if(Tgt==0){var A=this.getRequestUrl(o,f,m,C||y);if(this._requestsCache.hasOwnProperty(A)===!1){if(this._requestsCache[A]={},this._requestsCacheKeys.push(A),this._requestsCacheKeys.length>100){for(var E=0;E<50;E++)delete this._requestsCache[this._requestsCacheKeys[E]];this._requestsCacheKeys.splice(0,50)}}else{var T=this._requestsCacheKeys.indexOf(A);this._requestsCacheKeys.splice(T,1),this._requestsCacheKeys.push(A)}var S={headers:{withCredentials:!0}},M=this._requestsCache[A];if(M.dataLoaded===void 0&&(C?M.dataLoaded=Cesium.RequestScheduler.request(A,Cesium.loadArrayBuffer):M.dataLoaded=Cesium.loadArrayBuffer(A),!Cesium.defined(M.dataLoaded)))return;var I=fG.terrainProvider.tilingScheme.tileXYToRectangle(o,f,m),P=fG.terrainProvider._modifyTerrainObjects,D=null,L=null;P!=null&&P.length>0&&P.forEach(function(U){if(U.show){var G=Cesium.Rectangle.intersection(I,U.rectangle,new Cesium.Rectangle);G&&(L=U,D=D6i(L.vertices,I,L.heights[0]))}});var R=this;this._pendingRequests++,Cesium.when(M.dataLoaded,function(U){M.workerFinished===void 0&&(M.workerFinished=R._workerPool.queueWorkItem({buffer:U,isElevation:x!==void 0,level:m})),Cesium.when(M.workerFinished,function(G){if(G.rejected){for(var j=R.heightMapWidth*R.heightMapHeight,q=new Int16Array(j),J=0,X=0;X<j;X++)q[X]=300;return m>2&&(R.markTileAsUnavailable(o,f,m),q.myReject=!0),w.resolve(q),w}var Y=R.extractTileHeightBuffer(G.buffer,o,f,m);if(D!=null)for(var Q=D.getContext("2d"),ee=Q.getImageData(0,0,32,32).data,z=0;z<32;z++)for(var ie=0;ie<32;ie++){var re=z*32+ie,ne=(32-1-z)*32+ie;ee[re*4]!==0&&(Y[ne]=L.heights[0])}R._pendingRequests--,w.resolve(Y)})}).otherwise(function(){R._pendingRequests--,w.reject()})}else{for(var O=this.heightMapWidth*this.heightMapHeight,F=new Int16Array(O),k=R6i(0,1500),E=0;E<O;E++)F[E]=k;w.resolve(F)}return w}};H_.prototype.extractTileHeightBuffer=function(o,f,m,v){try{for(var y=this.requestFactorForLevel(v),x=f%y,C=m%y,w=new Float32Array(this.heightMapWidth*this.heightMapHeight),A=1e6,E=-1e5,T=0;T<this.heightMapHeight;T++)for(var S=0;S<this.heightMapWidth;S++){var M=T+C*this.heightMapHeight,I=S+x*this.heightMapWidth,P=T*this.heightMapWidth+S,D=M*this.heightMapWidth*y+I;o[D]>E&&(E=o[D]),o[D]<A&&(A=o[D]),w[P]=o[D]}}catch(L){console.log(L.message)}return w};H_.prototype.arrayToHeightmapTerrainData=function(o,f,m,v){Cesium.defined(o)===!1&&(o=new Int16Array(f*m));var y={buffer:o,width:f,height:m,childTileMask:v};return new Cesium.HeightmapTerrainData(y)};var Z3e=H_;function N6i(o){this.resource=o.resource,this.version=o.version,this.isHeightmap=o.isHeightmap,this.tileUrlTemplates=o.tileUrlTemplates,this.availability=o.availability,this.hasVertexNormals=o.hasVertexNormals,this.hasWaterMask=o.hasWaterMask,this.hasMetadata=o.hasMetadata,this.availabilityLevels=o.availabilityLevels,this.availabilityTilesLoaded=o.availabilityTilesLoaded,this.littleEndianExtensionSize=o.littleEndianExtensionSize,this.availabilityPromiseCache={}}function ck(o){this._heightmapWidth=65,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._ellipsoid=o.ellipsoid,this._requestVertexNormals=Cesium.defaultValue(o.requestVertexNormals,!1),this._requestWaterMask=Cesium.defaultValue(o.requestWaterMask,!1),this._requestMetadata=Cesium.defaultValue(o.requestMetadata,!0),this._errorEvent=new Cesium.Event;var f=o.credit;typeof f=="string"&&(f=new Cesium.Credit(f)),this._credit=f,this._availability=void 0;var m=Cesium.when.defer();this._ready=!1,this._readyPromise=m,this._tileCredits=void 0;var v=this,y,x,C,w=this._layers=[],A="",E=[],T=0;Cesium.when(o.url).then(function(L){var R=Cesium.Resource.createIfNeeded(L);R.appendForwardSlash(),y=R,x=y.getDerivedResource({url:"layer.json"}),v._tileCredits=R.credits,D()}).otherwise(function(L){m.reject(L)});function S(L){var R;if(!L.format){R="The tile format is not specified in the layer.json file.",C=Cesium.TileProviderError.handleError(C,v,v._errorEvent,R,void 0,void 0,void 0,D);return}if(!L.tiles||L.tiles.length===0){R="The layer.json file does not specify any tile URL templates.",C=Cesium.TileProviderError.handleError(C,v,v._errorEvent,R,void 0,void 0,void 0,D);return}var O=!1,F=!1,k=!1,U=!0,G=!1;if(L.format==="heightmap-1.0")G=!0,Cesium.defined(v._heightmapStructure)||(v._heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),F=!0,v._requestWaterMask=!0;else if(L.format.indexOf("quantized-mesh-1.")!==0){R='The tile format "'+L.format+'" is invalid or not supported.',C=Cesium.TileProviderError.handleError(C,v,v._errorEvent,R,void 0,void 0,void 0,D);return}var j=L.tiles,q=L.maxzoom;if(T=Math.max(T,q),!L.projection||L.projection==="EPSG:4326")v._tilingScheme=new Cesium.GeographicTilingScheme({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:v._ellipsoid});else if(L.projection==="EPSG:3857")v._tilingScheme=new Cesium.WebMercatorTilingScheme({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:v._ellipsoid});else{R='The projection "'+L.projection+'" is invalid or not supported.',C=Cesium.TileProviderError.handleError(C,v,v._errorEvent,R,void 0,void 0,void 0,D);return}if(v._levelZeroMaximumGeometricError=Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(v._tilingScheme.ellipsoid,v._heightmapWidth,v._tilingScheme.getNumberOfXTilesAtLevel(0)),!L.scheme||L.scheme==="tms"||L.scheme==="slippyMap")v._scheme=L.scheme;else{R='The scheme "'+L.scheme+'" is invalid or not supported.',C=Cesium.TileProviderError.handleError(C,v,v._errorEvent,R,void 0,void 0,void 0,D);return}var J;Cesium.defined(L.extensions)&&L.extensions.indexOf("octvertexnormals")!==-1?O=!0:Cesium.defined(L.extensions)&&L.extensions.indexOf("vertexnormals")!==-1&&(O=!0,U=!1),Cesium.defined(L.extensions)&&L.extensions.indexOf("watermask")!==-1&&(F=!0),Cesium.defined(L.extensions)&&L.extensions.indexOf("metadata")!==-1&&(k=!0);var X=L.metadataAvailability,Y=L.available,Q;if(Cesium.defined(Y)&&!Cesium.defined(X)){Q=new Cesium.TileAvailability(v._tilingScheme,Y.length);for(var ee=0;ee<Y.length;++ee){var z=Y[ee],ie=v._tilingScheme.getNumberOfYTilesAtLevel(ee);Cesium.defined(E[ee])||(E[ee]=[]);for(var re=0;re<z.length;++re){var ne=z[re],oe=ie-ne.endY-1,se=ie-ne.startY-1;E[ee].push([ne.startX,oe,ne.endX,se]),Q.addAvailableTileRange(ee,ne.startX,oe,ne.endX,se)}}}else Cesium.defined(X)&&(J=new Cesium.TileAvailability(v._tilingScheme,q),Q=new Cesium.TileAvailability(v._tilingScheme,q),E[0]=[[0,0,1,0]],Q.addAvailableTileRange(0,0,0,1,0));v._hasWaterMask=v._hasWaterMask||F,v._hasVertexNormals=v._hasVertexNormals||O,v._hasMetadata=v._hasMetadata||k,Cesium.defined(L.attribution)&&(A.length>0&&(A+=" "),A+=L.attribution),w.push(new N6i({resource:y,version:L.version,isHeightmap:G,tileUrlTemplates:j,availability:Q,hasVertexNormals:O,hasWaterMask:F,hasMetadata:k,availabilityLevels:X,availabilityTilesLoaded:J,littleEndianExtensionSize:U}));var ae=L.parentUrl;if(Cesium.defined(ae)){if(!Cesium.defined(Q))return console.log("A layer.json can't have a parentUrl if it does't have an available array."),Cesium.when.resolve();y=y.getDerivedResource({url:ae}),y.appendForwardSlash(),x=y.getDerivedResource({url:"layer.json"});var fe=x.fetchJson();return Cesium.when(fe,S,M)}return Cesium.when.resolve()}function M(L){var R="An error occurred while accessing "+x.url+".";C=Cesium.TileProviderError.handleError(C,v,v._errorEvent,R,void 0,void 0,void 0,D)}function I(L){S(L).then(function(){if(!Cesium.defined(C)){var R=E.length;if(R>0)for(var O=v._availability=new Cesium.TileAvailability(v._tilingScheme,T),F=0;F<R;++F)for(var k=E[F],U=0;U<k.length;++U){var G=k[U];O.addAvailableTileRange(F,G[0],G[1],G[2],G[3])}if(A.length>0){var j=new Cesium.Credit(A);Cesium.defined(v._tileCredits)?v._tileCredits.push(j):v._tileCredits=[j]}v._ready=!0,v._readyPromise.resolve(!0)}})}function P(L){I({extensions:["octvertexnormals"],format:"quantized-mesh-1.0",maxzoom:18,minzoom:0,name:"world",projection:"EPSG:3857",scheme:"slippyMap",tilejson:"1.0",tiles:["{z}/{x}/{y}.terrain"],version:"1.0.0"})}function D(){Cesium.when(x.fetchJson()).then(I).otherwise(P)}}var $3e={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function Sgt(o){if(!Cesium.defined(o)||o.length===0)return{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"};var f=o.join("-");return{Accept:"application/vnd.quantized-mesh;extensions="+f+",application/octet-stream;q=0.9,*/*;q=0.01"}}function F6i(o,f,m,v,y){var x=new Uint16Array(f,0,o._heightmapWidth*o._heightmapWidth);return new Cesium.HeightmapTerrainData({buffer:x,childTileMask:new Uint8Array(f,x.byteLength,1)[0],waterMask:new Uint8Array(f,x.byteLength+1,f.byteLength-x.byteLength-1),width:o._heightmapWidth,height:o._heightmapWidth,structure:o._heightmapStructure,credits:o._tileCredits})}function B6i(o,f,m,v,y,x){var C=x.littleEndianExtensionSize,w=0,A=3,E=A+1,T=Float64Array.BYTES_PER_ELEMENT*A,S=Float64Array.BYTES_PER_ELEMENT*E,M=3,I=Uint16Array.BYTES_PER_ELEMENT*M,P=3,D=Uint16Array.BYTES_PER_ELEMENT,L=D*P,R=new DataView(f),O=new Cesium.Cartesian3(R.getFloat64(w,!0),R.getFloat64(w+8,!0),R.getFloat64(w+16,!0));w+=T;var F=R.getFloat32(w,!0);w+=Float32Array.BYTES_PER_ELEMENT;var k=R.getFloat32(w,!0);w+=Float32Array.BYTES_PER_ELEMENT;var U=new Cesium.BoundingSphere(new Cesium.Cartesian3(R.getFloat64(w,!0),R.getFloat64(w+8,!0),R.getFloat64(w+16,!0)),R.getFloat64(w+T,!0));w+=S;var G=new Cesium.Cartesian3(R.getFloat64(w,!0),R.getFloat64(w+8,!0),R.getFloat64(w+16,!0));w+=T;var j=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;var q=new Uint16Array(f,w,j*3);w+=j*I,j>64*1024&&(D=Uint32Array.BYTES_PER_ELEMENT,L=D*P);var J=q.subarray(0,j),X=q.subarray(j,2*j),Y=q.subarray(j*2,3*j);Cesium.AttributeCompression.zigZagDeltaDecode(J,X,Y),w%D!==0&&(w+=D-w%D);var Q=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;var ee=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(j,f,w,Q*P);w+=Q*L;for(var z=0,ie=ee.length,re=0;re<ie;++re){var ne=ee[re];ee[re]=z-ne,ne===0&&++z}var oe=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;var se=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(j,f,w,oe);w+=oe*D;var ae=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;var fe=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(j,f,w,ae);w+=ae*D;var de=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;var ve=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(j,f,w,de);w+=de*D;var pe=R.getUint32(w,!0);w+=Uint32Array.BYTES_PER_ELEMENT;var ce=Cesium.IndexDatatype.createTypedArrayFromArrayBuffer(j,f,w,pe);w+=pe*D;for(var he,Ce;w<R.byteLength;){var Se=R.getUint8(w,!0);w+=Uint8Array.BYTES_PER_ELEMENT;var De=R.getUint32(w,C);if(w+=Uint32Array.BYTES_PER_ELEMENT,Se===$3e.OCT_VERTEX_NORMALS&&o._requestVertexNormals)he=new Uint8Array(f,w,j*2);else if(Se===$3e.WATER_MASK&&o._requestWaterMask)Ce=new Uint8Array(f,w,De);else if(Se===$3e.METADATA&&o._requestMetadata){var Oe=R.getUint32(w,!0);if(Oe>0){var Ue=Cesium.getJsonFromTypedArray(new Uint8Array(f),w+Uint32Array.BYTES_PER_ELEMENT,Oe),Xe=Ue.available;if(Cesium.defined(Xe))for(var it=0;it<Xe.length;++it)for(var ut=m+it+1,at=Xe[it],Pt=o._tilingScheme.getNumberOfYTilesAtLevel(ut),Qe=0;Qe<at.length;++Qe){var ft=at[Qe],Ot=Pt-ft.endY-1,Xt=Pt-ft.startY-1;o.availability.addAvailableTileRange(ut,ft.startX,Ot,ft.endX,Xt),x.availability.addAvailableTileRange(ut,ft.startX,Ot,ft.endX,Xt)}}x.availabilityTilesLoaded.addAvailableTileRange(m,v,y,v,y)}w+=De}var At=o.getLevelMaximumGeometricError(m)*5,bt=o._tilingScheme.tileXYToRectangle(v,y,m),gt=Cesium.OrientedBoundingBox.fromRectangle(bt,F,k,o._tilingScheme.ellipsoid);return new Cesium.QuantizedMeshTerrainData({center:O,minimumHeight:F,maximumHeight:k,boundingSphere:U,orientedBoundingBox:gt,horizonOcclusionPoint:G,quantizedVertices:q,encodedNormals:he,indices:ee,westIndices:se,southIndices:fe,eastIndices:ve,northIndices:ce,westSkirtHeight:At,southSkirtHeight:At,eastSkirtHeight:At,northSkirtHeight:At,childTileMask:o.availability.computeChildMaskForTile(m,v,y),waterMask:Ce,credits:o._tileCredits})}ck.prototype.requestTileGeometry=function(o,f,m,v){var y=this._layers,x,C=y.length;if(C===1)x=y[0];else for(var w=0;w<C;++w){var A=y[w];if(!Cesium.defined(A.availability)||A.availability.isTileAvailable(m,o,f)){x=A;break}}return Pgt(this,o,f,m,x,v)};function Pgt(o,f,m,v,y,x){if(!Cesium.defined(y))return Cesium.when.reject(new Cesium.RuntimeError("Terrain tile doesn't exist"));var C=y.tileUrlTemplates;if(C.length!==0){var w;if(!o._scheme||o._scheme==="tms"){var A=o._tilingScheme.getNumberOfYTilesAtLevel(v);w=A-m-1}else w=m;var E=[];o._requestVertexNormals&&y.hasVertexNormals&&E.push(y.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),o._requestWaterMask&&y.hasWaterMask&&E.push("watermask"),o._requestMetadata&&y.hasMetadata&&E.push("metadata");var T,S,M=C[(f+w+v)%C.length],I=y.resource;Cesium.defined(I._ionEndpoint)&&!Cesium.defined(I._ionEndpoint.externalType)?(E.length!==0&&(S={extensions:E.join("-")}),T=Sgt(void 0)):T=Sgt(E);var P=I.getDerivedResource({url:M,templateValues:{version:y.version,z:v,x:f,y:w},queryParameters:S,headers:T,request:x}).fetchArrayBuffer();if(!!Cesium.defined(P))return P.then(function(D){return Cesium.defined(o._heightmapStructure)?F6i(o,D,v,f,m):B6i(o,D,v,f,m,y)}).otherwise(function(D){var L=16,R=16;return Cesium.when.resolve(new Cesium.HeightmapTerrainData({buffer:new Uint8Array(L*R),width:L,height:R}))})}}Object.defineProperties(ck.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});ck.prototype.getLevelMaximumGeometricError=function(o){return this._levelZeroMaximumGeometricError/(1<<o)};ck.prototype.getTileDataAvailable=function(o,f,m){if(!!Cesium.defined(this._availability)){if(m>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(m,o,f))return!0;if(!this._hasMetadata)return!1;for(var v=this._layers,y=v.length,x=0;x<y;++x){var C=Igt(this,o,f,m,v[x],x===0);if(C.result)return}return!1}};ck.prototype.loadTileDataAvailability=function(o,f,m){if(!(!Cesium.defined(this._availability)||m>this._availability._maximumLevel||this._availability.isTileAvailable(m,o,f)||!this._hasMetadata))for(var v=this._layers,y=v.length,x=0;x<y;++x){var C=Igt(this,o,f,m,v[x],x===0);if(Cesium.defined(C.promise))return C.promise}};function eOe(o,f,m,v){if(v!==0){var y=o.availabilityLevels,x=v%y===0?v-y:(v/y|0)*y,C=1<<v-x,w=f/C|0,A=m/C|0;return{level:x,x:w,y:A}}}function Igt(o,f,m,v,y,x){if(!Cesium.defined(y.availabilityLevels))return{result:!1};for(var C,w=function(){delete y.availabilityPromiseCache[C]},A=y.availabilityTilesLoaded,E=y.availability,T=eOe(y,f,m,v);Cesium.defined(T);){if(E.isTileAvailable(T.level,T.x,T.y)&&!A.isTileAvailable(T.level,T.x,T.y)){var S;if(!x&&(C=T.level+"-"+T.x+"-"+T.y,S=y.availabilityPromiseCache[C],!Cesium.defined(S))){var M=new Cesium.Request({throttle:!1,throttleByServer:!0,type:Cesium.RequestType.TERRAIN});S=Pgt(o,T.x,T.y,T.level,y,M),Cesium.defined(S)&&(y.availabilityPromiseCache[C]=S,S.then(w))}return{result:!0,promise:S}}T=eOe(y,T.x,T.y,T.level)}return{result:!1}}ck._getAvailabilityTile=eOe;var Mgt=ck;var k6i=new Map([["centerX",Float64Array.BYTES_PER_ELEMENT],["centerY",Float64Array.BYTES_PER_ELEMENT],["centerZ",Float64Array.BYTES_PER_ELEMENT],["minHeight",Float32Array.BYTES_PER_ELEMENT],["maxHeight",Float32Array.BYTES_PER_ELEMENT],["boundingSphereCenterX",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterY",Float64Array.BYTES_PER_ELEMENT],["boundingSphereCenterZ",Float64Array.BYTES_PER_ELEMENT],["boundingSphereRadius",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointX",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointY",Float64Array.BYTES_PER_ELEMENT],["horizonOcclusionPointZ",Float64Array.BYTES_PER_ELEMENT]]);function tOe(o){return o>>1^-(o&1)}function V6i(o){let f=0,m={};for(let[v,y]of k6i){let x=y===8?o.getFloat64:o.getFloat32;m[v]=x.call(o,f,!0),f+=y}return{header:m,headerEndPosition:f}}function z6i(o,f){let m=f,v=3,y=o.getUint32(m,!0),x=new Uint16Array(y*v);m+=Uint32Array.BYTES_PER_ELEMENT;let C=Uint16Array.BYTES_PER_ELEMENT,w=y*C,A=m,E=A+w,T=E+w,S=0,M=0,I=0;for(let P=0;P<y;P++)S+=tOe(o.getUint16(A+C*P,!0)),M+=tOe(o.getUint16(E+C*P,!0)),I+=tOe(o.getUint16(T+C*P,!0)),x[P]=S,x[P+y]=M,x[P+y*2]=I;return m+=w*3,{vertexData:x,vertexDataEndPosition:m}}function KJ(o,f,m,v,y=!0){let x;if(v===2?x=new Uint16Array(o,f,m):x=new Uint32Array(o,f,m),!y)return x;let C=0;for(let w=0;w<x.length;++w){let A=x[w];x[w]=C-A,A===0&&++C}return x}function H6i(o,f,m){let v=m,y=3,C=f.length/y>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT;v%C!==0&&(v+=C-v%C);let w=o.getUint32(v,!0);v+=Uint32Array.BYTES_PER_ELEMENT;let A=w*3,E=KJ(o.buffer,v,A,C);return v+=A*C,{triangleIndicesEndPosition:v,triangleIndices:E}}function U6i(o,f,m){let v=m,y=3,C=f.length/y>65536?Uint32Array.BYTES_PER_ELEMENT:Uint16Array.BYTES_PER_ELEMENT,w=o.getUint32(v,!0);v+=Uint32Array.BYTES_PER_ELEMENT;let A=KJ(o.buffer,v,w,C,!1);v+=w*C;let E=o.getUint32(v,!0);v+=Uint32Array.BYTES_PER_ELEMENT;let T=KJ(o.buffer,v,E,C,!1);v+=E*C;let S=o.getUint32(v,!0);v+=Uint32Array.BYTES_PER_ELEMENT;let M=KJ(o.buffer,v,S,C,!1);v+=S*C;let I=o.getUint32(v,!0);v+=Uint32Array.BYTES_PER_ELEMENT;let P=KJ(o.buffer,v,I,C,!1);return v+=I*C,{edgeIndicesEndPosition:v,westIndices:A,southIndices:T,eastIndices:M,northIndices:P}}function G6i(o){return new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}function W6i(o){return o.buffer.slice(o.byteOffset,o.byteOffset+o.byteLength)}function j6i(o,f){let m={};if(o.byteLength<=f)return{extensions:m,extensionsEndPosition:f};let v=f;for(;v<o.byteLength;){let y=o.getUint8(v,!0);v+=Uint8Array.BYTES_PER_ELEMENT;let x=o.getUint32(v,!0);v+=Uint32Array.BYTES_PER_ELEMENT;let C=new DataView(o.buffer,v,x);switch(y){case 1:{m.vertexNormals=G6i(C);break}case 2:{m.waterMask=W6i(C);break}default:console.warn(`Unknown extension with id ${y}`)}v+=x}return{extensions:m,extensionsEndPosition:v}}var QJ={header:0,vertices:1,triangleIndices:2,edgeIndices:3,extensions:4},Y6i={maxDecodingStep:QJ.extensions};function ice(o,f){let m=Object.assign({},Y6i,f),v=new DataView(o),{header:y,headerEndPosition:x}=V6i(v);if(m.maxDecodingStep<QJ.vertices)return{header:y};let{vertexData:C,vertexDataEndPosition:w}=z6i(v,x);if(m.maxDecodingStep<QJ.triangleIndices)return{header:y,vertexData:C};let{triangleIndices:A,triangleIndicesEndPosition:E}=H6i(v,C,w);if(m.maxDecodingStep<QJ.edgeIndices)return{header:y,vertexData:C,triangleIndices:A};let{westIndices:T,southIndices:S,eastIndices:M,northIndices:I,edgeIndicesEndPosition:P}=U6i(v,C,E);if(m.maxDecodingStep<QJ.extensions)return{header:y,vertexData:C,triangleIndices:A,westIndices:T,northIndices:I,eastIndices:M,southIndices:S};let{extensions:D}=j6i(v,P);return{header:y,vertexData:C,triangleIndices:A,westIndices:T,northIndices:I,eastIndices:M,southIndices:S,extensions:D}}var q6i=new Uint8Array([172,223,96,7,210,166,80,193,62,133,0,92,97,125,81,193,175,204,114,156,24,171,39,65,215,131,189,193,92,143,98,193,172,223,224,55,148,164,80,193,62,133,128,115,254,122,81,193,175,204,114,40,74,169,39,65,199,225,33,1,165,221,10,65,165,248,77,38,221,233,229,191,118,168,124,106,57,4,231,191,208,126,103,119,149,64,191,63,9,0,0,0,254,127,253,127,254,127,253,127,0,0,254,255,255,127,0,128,0,0,254,127,253,127,0,0,254,127,0,128,0,0,0,0,253,255,254,127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,2,0,3,0,0,0,4,0,0,0,2,0,5,0,0,0,0,0,7,0,0,0,0,0,2,0,9,0,7,0,4,0,9,0,1,0,5,0,9,0,3,0,3,0,0,0,0,0,0,0,3,0,3,0,0,0,1,0,7,0,2,0,3,0,0,0,7,0,5,0,8,0,3,0,0,0,4,0,5,0,6,0]),ZJ=class{constructor(f={}){if(this.ready=!1,this.dummyTile=ice(q6i.buffer),this.tilingScheme=f.tilingScheme||new Cesium.WebMercatorTilingScheme,f.url===void 0)throw new Error("url option is missing");f.credit!==void 0&&(this.credits=[new Cesium.Credit(f.credit)]),this.urlTemplates=f.url,(this.urlTemplates.length===0||this.urlTemplates[this.urlTemplates.length-1]!=="/")&&(this.urlTemplates=this.urlTemplates+"/"),this.readyPromise=Promise.resolve(!0),this.ready=!0}getUrl(f,m,v){let y=f,x=m;return this.urlTemplates+`${v}/${y}/${x}.terrain`}generateDummyTileHeader(f,m,v){let y=this.tilingScheme.tileXYToRectangle(f,m,v),x=this.tilingScheme.tileXYToNativeRectangle(f,m,v),C=Cesium.Cartographic.toCartesian(Cesium.Rectangle.center(y)),w=Cesium.Ellipsoid.WGS84.transformPositionToScaledSpace(C);return{centerX:C.x,centerY:C.y,centerZ:C.z,minHeight:0,maxHeight:0,boundingSphereCenterX:C.x,boundingSphereCenterY:C.y,boundingSphereCenterZ:C.z,boundingSphereRadius:x.height,horizonOcclusionPointX:w.x,horizonOcclusionPointY:w.y,horizonOcclusionPointZ:w.z}}createQuantizedMeshData(f,m,v,y){let x=this.tilingScheme.tileXYToRectangle(m,v,y),C=new Cesium.Cartesian3(f.header.boundingSphereCenterX,f.header.boundingSphereCenterY,f.header.boundingSphereCenterZ),w=new Cesium.BoundingSphere(C,f.header.boundingSphereRadius),A=new Cesium.Cartesian3(f.header.horizonOcclusionPointX,f.header.horizonOcclusionPointY,f.header.horizonOcclusionPointZ),E;return x.width<Cesium.Math.PI_OVER_TWO+Cesium.Math.EPSILON5&&(E=Cesium.OrientedBoundingBox.fromRectangle(x,f.header.minHeight,f.header.maxHeight)),new Cesium.QuantizedMeshTerrainData({minimumHeight:f.header.minHeight,maximumHeight:f.header.maxHeight,quantizedVertices:f.vertexData,indices:f.triangleIndices,boundingSphere:w,orientedBoundingBox:E,horizonOcclusionPoint:A,westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:100,southSkirtHeight:100,eastSkirtHeight:100,northSkirtHeight:100,childTileMask:15,credits:this.credits})}generateDummyTile(f,m,v){return Object.assign({},this.dummyTile,this.generateDummyTileHeader(f,m,v))}decodeResponse(f,m,v,y){return f.arrayBuffer().then(x=>ice(x)).catch(x=>(console.error(`Decoding failed on tile ${this.getUrl(m,v,y)}`),console.error(x),this.generateDummyTile(m,v,y)))}requestTileGeometry(f,m,v){let y=this.getUrl(f,m,v);return window.fetch(y).then(x=>x.status!==200?this.generateDummyTile(f,m,v):this.decodeResponse(x,f,m,v)).then(x=>this.createQuantizedMeshData(x,f,m,v)).catch(x=>{console.error(x)})}getTileDataAvailable(f,m,v){return!0}getLevelMaximumGeometricError(f){return Cesium.TerrainProvider.getEstimatedLevelZeroGeometricErrorForAHeightmap(this.tilingScheme.ellipsoid,65,this.tilingScheme.getNumberOfXTilesAtLevel(0))/(1<<f)}};var $J=null;function fx(o,f){$J=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this._url="",this._show=!0}fx.prototype.createTerrainLayer=function(o,f,m,v,y,x){x=="Topography"?this.createTerrain(o,f,m,v,y):x=="sgs"?this.createSFSTerrain(o,f,m,v,y):x=="Arcgis"?this.createArcGISTerrain(o,f,m,v,y):y=="Cesium"&&this.createCesiumTerrain(o,f,m,v)};fx.prototype.createTerrain=function(o,f,m,v,y){var x={type:"default",url:"",requestVertexNormals:!1,requestWaterMask:!1,requestMetadata:!0,credit:""};this.name=o,this.option=f,this.GroupID=m,this.checked=v,this.Description=y,this.type="createTerrain";var C=null;if(this._core.isUrl(f)?(C=x,C.url=f):C=this._core.extend(x,f,!0),this._options=C,this._url=C.url,v)Ne.setVisibility(m,!1,this._viewer,this._cesium);else{var A={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(m)?0:m),this}var w=C.type==="vector"?new Mgt(C):new $J.CesiumTerrainProvider(C);this._viewer.scene.terrainProvider=w,this.item=w,this._show=!0;var A={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(m)?0:m),this};fx.prototype.createCesiumTerrain=function(o,f,m,v){this.name=o,this.option=f,this.GroupID=m,this.checked=v,this.type="createCesiumTerrain";var y={requestVertexNormals:!0},x=this._core.extend(y,f,!0);this._options=x;var C=$J.createWorldTerrain(x);if(this.type="Cesium",this.item=C,v)Ne.setVisibility(m,!1,this._viewer,this._cesium);else{var w={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,this._core.isnull(m)?0:m),this}this._viewer.scene.terrainProvider=C,this._show=!0;var w={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(w),this._tree.insertGroupId(w,this._core.isnull(m)?0:m),this};fx.prototype.createSFSTerrain=function(o,f,m,v,y){var x=new Q3e(this._viewer,f,this._cesium);if(this.name=o,this.option=f,this.GroupID=m,this.checked=v,this.Description=y,this.type="createSFSTerrain",this.type="SGS",this._url=f.url,this.layerName=f.layerName,this.requestVertexNormals=f.requestVertexNormals,v)Ne.setVisibility(m,!1,this._viewer,this._cesium);else{this._show=!0;var C={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(m)?0:m),this}this._viewer.terrainProvider=x,this.item=x,this._show=!0;var C={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(m)?0:m),this};fx.prototype.createSFSTerrain71=function(o,f,m,v,y){var x=new Z3e(this._viewer,f);if(this.name=o,this.option=f,this.GroupID=m,this.checked=v,this.Description=y,this.type="createSFSTerrain",this.type="SGS71",this._url=f.url,this.layerName=f.layerName,this.requestVertexNormals=f.requestVertexNormals,v)Ne.setVisibility(m,!1,this._viewer,this._cesium);else{this._show=!0;var C={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(m)?0:m),this}this._viewer.terrainProvider=x,this.item=x,this._show=!0;var C={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(m)?0:m),this};fx.prototype.createWMTSTerrain=function(o,f,m,v,y){var x=new ZJ({url:f.url});if(this._viewer.scene.mode=this._cesium.SceneMode.COLUMBUS_VIEW,this.name=o,this.option=f,this.GroupID=m,this.checked=v===void 0?!0:v,this.Description=y,this.type="createWMTSTerrain",this.type="WMTSTerrain",this._url=f.url,this.layerName=f.layerName,this.requestVertexNormals=f.requestVertexNormals,this.checked)Ne.setVisibility(m,!1,this._viewer,this._cesium);else{this._show=!0;var C={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(m)?0:m),this}this._viewer.terrainProvider=x,this.item=x,this._show=!0;var C={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(C),this._tree.insertGroupId(C,this._core.isnull(m)?0:m),this};fx.prototype.createArcGISTerrain=function(o,f,m,v,y){var x={url:""};this.name=o,this.option=f,this.GroupID=m,this.checked=v,this.Description=y,this.type="createArcGISTerrain";var C=null;this._core.isUrl(f)?(C=x,C.url=f):C=this._core.extend(x,f,!0),this.type="ArcGIS",this._url=C.url;var w=new this._cesium.ArcGISTiledElevationTerrainProvider(C);if(v)Ne.setVisibility(m,!1,this._viewer,this._cesium);else{this._show=!0;var A={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(m)?0:m),this}this._viewer.terrainProvider=w,this.item=w,this._show=!0;var A={id:f.id||this._core.getuid(),name:o,checked:v,pId:this._core.isnull(m)?0:m,type:"terrain",item:this};return this.setTreeobj(A),this._tree.insertGroupId(A,this._core.isnull(m)?0:m),this};fx.prototype.getType=function(){return{label:"\u5F71\u50CF",value:"TerrainProvider"}};fx.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.item._layers[0].resource.url;return{type:"TerrainLayer",treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:o,url:f}}};fx.prototype.setVisibility=function(o){var f;if(o){Ne.setVisibility(this.GroupID,!1,this._viewer,this._cesium);var m;if(this.type==="SGS")m=this.option,f=new Q3e(this._viewer,m,this._cesium);else if(this.type==="SGS71")m=this.option,f=new Z3e(this._viewer,m);else if(this.type==="ArcGIS")m=this.option,f=new $J.ArcGISTiledElevationTerrainProvider(m);else if(this.type==="Cesium")f=$J.createWorldTerrain(this._options);else{var v=this._options,y={url:"",requestVertexNormals:!1,requestWaterMask:!1,requestMetadata:!0,credit:""};this._core.isUrl(v)?(m=y,m.url=v):m=this._core.extend(y,v,!0),f=new this._cesium.CesiumTerrainProvider(m)}this._show=!0,this.item=f,this._viewer.scene.terrainProvider=f}else f=new this._cesium.EllipsoidTerrainProvider({}),this.item=f,this._show=!1,this._viewer.scene.terrainProvider=f};fx.prototype.getVisibility=function(){return this._show};fx.prototype.setTreeobj=function(o){this.treeobj=o};fx.prototype.deleteObject=function(){try{this.item=new this._cesium.EllipsoidTerrainProvider({}),this._viewer.scene.terrainProvider=this.item}catch(o){console.log(o.message)}};Object.defineProperties(fx.prototype,{});var nL=fx;function Q0(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this.item={show:!0},this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.PrimitiveData=[],this.PrimitiveObj={key:"",data:{}},this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._primitiveByTile={},this._tileKeys=[],this._primitiveCollection=new this._cesium.PrimitiveCollection,this._cache=!1,this._forceRefreshPrvimitive=null}Q0.prototype.createVolumeVectorGeoJsonFeatureLayer=function(o,f,m,v,y,x,C){var w={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(w,m,!0);this._core.isnull(v)&&(v=16),this._core.isnull(y)&&(y=14),f==null&&console.log("url is required"),o==null&&console.log("layername is required");var E=[],T=this;this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=styleOption.level_max-1,this._Provider.loadTile=function(I,P){if(this.tile=P,P.state===T._cesium.QuadtreeTileLoadState.START)if(P.data={lines:[],geometryPrimitive:void 0},P.level>=y&&P.level<v){var D=Ji.filter(E,function(L){return L.x==P.x&&L.y==P.y&&L.level==P.level});if(D.length!=0&&D[0].data&&D[0].data.length>0){P.data.geometryPrimitive=new T._cesium.Primitive({geometryInstances:D[0].data,appearance:new T._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:T._cesium.ShadowMode.ENABLED}),P.state=T._cesium.QuadtreeTileLoadState.LOADING,P.state===T._cesium.QuadtreeTileLoadState.LOADING&&(P.data.geometryPrimitive&&P.data.geometryPrimitive.update(I,[]),P.state=T._cesium.QuadtreeTileLoadState.DONE,P.renderable=!0);return}E.push({level:P.level,x:P.x,y:P.y,data:void 0}),function(L){T._core.xhr({url:f+"?REQUEST=GetTile&SERVICE=WMTS&VERSION=1.0.0&LAYER="+o+"&STYLE=&TILEMATRIX=EPSG:4490:"+L.level+"&TILEMATRIXSET=EPSG:4490&FORMAT=application/json;type=geojson&TILECOL="+L.x+"&TILEROW="+L.y,type:"get",dataType:"json",success:function(R){var O=[];function F(J){for(var X=0;X<J.length;X++)Array.isArray(J[X])?F(J[X]):U.push(J[X])}for(var k=0;k<R.features.length;k++){var U=[];F(R.features[k].geometry.coordinates[0]);var G=T._cesium.Cartesian3.fromDegreesArray(U);A.positions=G;var j=new T._cesium.GeometryInstance({geometry:new T._cesium.PolylineVolumeGeometry({polylinePositions:A.positions}),attributes:{color:new T._cesium.ColorGeometryInstanceAttribute.fromColor(Cesium.Color.WHITE)}});O.push(j)}var q=Ji.filter(E,function(J){return J.x==L.x&&J.y==L.y});q[0].data=O,L.data.geometryPrimitive=new T._cesium.Primitive({geometryInstances:O,appearance:new T._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:T._cesium.ShadowMode.ENABLED})},error:function(){E=Ji.remove(E,function(R){return R.x==L.x&&R.y==L.y&&R.level==L.level})},complete:function(){L.state=T._cesium.QuadtreeTileLoadState.LOADING,L.state===T._cesium.QuadtreeTileLoadState.LOADING&&(L.data.geometryPrimitive&&L.data.geometryPrimitive.update(I,[]),L.state=T._cesium.QuadtreeTileLoadState.DONE,L.renderable=!0)}})}(P)}else P.state=T._cesium.QuadtreeTileLoadState.LOADING,P.state===T._cesium.QuadtreeTileLoadState.LOADING&&(P.data.geometryPrimitive&&P.data.geometryPrimitive.update(I,[]),P.state=T._cesium.QuadtreeTileLoadState.DONE,P.renderable=!0)},this._primitive=new T._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive)};Q0.prototype.createVolumeGeoJsonFeatureLayer1=function(o,f,m,v,y){var x={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};f==null&&console.log("geojson is required");var C=null;f.then?C=f:C=this._cesium.GeoJsonDataSource.load(f);var w=this,A=[];x.shapePositions=this.computeCircle(m.radius),C.then(function(T){var S=w._cesium.Color.WHITE;!w._core.isnull(m)&&!w._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"?S=m.material.replace(/\[/,"").replace("/]/",""):S=Ji.clone(m.material),w._core.isHtmlColor(S)?S=w._color.colorFromHtmlColor(m.material):(/^rgb/.test(S)&&(S=w._color.rgbaStringToRgbaObj(S)),S.r>1&&(S.r=S.r/255),S.g>1&&(S.g=S.g/255),S.b>1&&(S.b=S.b/255),S.a>1&&(S.a=S.a/255),S=w._color.createColor(S.r,S.g,S.b,S.a)));for(var M=T.entities.values,I=0;I<M.length;I++){var P=M[I];x.polylinePositions=P.polyline.positions._value;var D=new w._cesium.PolylineVolumeGeometry(x),L=w._cesium.PolylineVolumeGeometry.createGeometry(D),R=new w._cesium.GeometryInstance({geometry:L});A.push(R)}var O="material:"+S.red*255+","+S.green*255+","+S.blue*255;w.Legend.push(O);var F=w._viewer.scene.primitives.add(new w._cesium.Primitive({geometryInstances:A,appearance:new w._cesium.MaterialAppearance({material:new w._cesium.Material({fabric:{type:"Color",uniforms:{color:S}}}),faceForward:!0,flat:!1})}));w.item=F,m.show==!1&&(F.show=!1),typeof y=="function"&&y(F)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u7BA1\u72B6\u56FE\u5C42"+m.id);var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:m};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};Q0.prototype.computeCircle=function(o){this._core.isnull(o)&&(o=4);for(var f=[],m=0;m<360;m++){var v=this._cesium.Math.toRadians(m);f.push(new this._cesium.Cartesian2(o*Math.cos(v),o*Math.sin(v)))}return f};Q0.prototype.createVolumeGeoJsonFeatureLayerProvider1=function(o,f,m,v,y,x){var C=this,w={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},A={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var E=this._core.extend(w,m,!0),T=new Ah(this._viewer,this._cesium,A);this._Provider=T;var S=this;T._loadTile=function(I){var P=[],D=new S._cesium.PrimitiveCollection;return S.Legend=[],I.features.forEach(function(L){var R=[];function O(oe){for(var se=0;se<oe.length;se++)Array.isArray(oe[se])?O(oe[se]):R.push(oe[se])}var F=[];if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var k=m.material.replace(/\[/,"").replace(/\]/,"");E.material=L.properties[k],C._core.isHtmlColor(E.material)?E.material=C._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=C._color.rgbaStringToRgbaObj(E.material)),E.material.r>1&&(E.material.r=E.material.r/255),E.material.g>1&&(E.material.g=E.material.g/255),E.material.b>1&&(E.material.b=E.material.b/255),E.material.a>1&&(E.material.a=E.material.a/255),E.material=C._color.createColor(E.material.r,E.material.g,E.material.b,E.material.a))}for(var U=0;U<L.geometry.coordinates.length;U++){var G=L.geometry.coordinates[U];if(G.length>0)if(Array.isArray(G[0]))for(var j=0;j<G.length;j++){var q=G[j],J=S._cesium.Cartesian3.fromDegrees(q[0],q[1],E.height);F.push(J)}else{var X=S._cesium.Cartesian3.fromDegrees(G[0],G[1],E.height);F.push(X)}}if(E.position=F,L.positions=F,E.slttype=="0"||E.slttype==0)E.shape=S._core.computeCircle(E.radius);else if(E.slttype=="1"||E.slttype==1)E.shape=S._core.starPositions(E.number,E.exradius,E.inradius);else if(E.slttype=="2"||E.slttype==2){var Y=E.orth_width/2,Q=E.orth_height/2;E.shape=[new S._cesium.Cartesian2(-Y,-Q),new S._cesium.Cartesian2(Y,-Q),new S._cesium.Cartesian2(Y,Q),new S._cesium.Cartesian2(-Y,Q)]}var ee={polylinePositions:E.position,shapePositions:E.shape,cornerType:E.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},z=new S._cesium.PolylineVolumeGeometry(ee),ie=new S._cesium.GeometryInstance({id:L,geometry:z,attributes:{color:new S._cesium.ColorGeometryInstanceAttribute.fromColor(E.material)}}),re="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;S.Legend.push(re);var ne=new S._cesium.Primitive({allowPicking:!0,appearance:new S._cesium.MaterialAppearance({material:new S._cesium.Material({fabric:{type:"Color",uniforms:{color:E.material}}}),faceForward:!0,flat:!1}),shadows:E.shadows,geometryInstances:ie});D.add(ne)}),D},this.item=T._primitiveCollection,T.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var M={id:E.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:f.url,style:m};this.setTreeobj(M),this._tree.insertGroupId(M,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item)};Q0.prototype.createVolumeGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=this,w={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY,radiusScale:1},A={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:this._core.defaultValue(f.srs,"EPSG:4490")+":{z}",TILEMATRIXSET:this._core.defaultValue(f.srs,"EPSG:4490"),FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var E=this._core.extend({...w},m,!0);if(typeof E.radius=="string"&&E.radius.indexOf("[")>-1&&E.radius.indexOf("]")>-1)E.radius=E.radius.replace("[",""),E.radius=E.radius.replace("]",""),E.shape=void 0;else if(E.slttype=="0"||E.slttype==0){E.shape=this._core.computeCircle(E.radius);var T=E.radius/2,S=E.radius/2;E.shape1=[new this._cesium.Cartesian2(-T,-S),new this._cesium.Cartesian2(T,-S),new this._cesium.Cartesian2(T,S),new this._cesium.Cartesian2(-T,S)]}else if(E.slttype=="1"||E.slttype==1)E.shape=this._core.starPositions(E.number,E.exradius,E.inradius);else if(E.slttype=="2"||E.slttype==2){var T=E.orth_width/2,S=E.orth_height/2;E.shape=[new this._cesium.Cartesian2(-T,-S),new this._cesium.Cartesian2(T,-S),new this._cesium.Cartesian2(T,S),new this._cesium.Cartesian2(-T,S)]}let M=f.url.indexOf("/gisserver/")>-1;var I;M?I=f.url+`/${window.encodeURIComponent("{z}")}/${window.encodeURIComponent("{x}")}/${window.encodeURIComponent("{y}")}.json`:I=f.url+"?"+this._serialize(A.urlParams),this._urlTemplate=I,this._Provider=new ol(this._viewer,this._cesium,M?new Cesium.WebMercatorTilingScheme:void 0),this._Provider._normalTile=m.level_max-1,this._Provider._minimumHeight=parseFloat(m.height||0),this.item.show=y,this.initThisProvider=()=>{this.initThisProvider=void 0,this._Provider.loadTile=function(F,k){(function(U,G,j){if(G.state===Cesium.QuadtreeTileLoadState.START){if(G.data={lines:[],geometryPrimitive:void 0},G.level>=m.level_min&&G.level<m.level_max&&j.item.show){if(M&&(G.reverseY=j._Provider.tilingScheme.getNumberOfYTilesAtLevel(G.level)-G.y-1),j.TileMatrixLimits){let J=j.TileMatrixLimits[G.level];if(!J||J&&(G.x>J.maxCol||G.x<J.minCol||G.y>J.maxRow||G.y<J.minRow)){G.state=Cesium.QuadtreeTileLoadState.DONE,G.renderable=!0;return}}var q=I.replace(window.encodeURIComponent("{x}"),G.x).replace(window.encodeURIComponent("{y}"),G.reverseY||G.y).replace(window.encodeURIComponent("{z}"),G.level);j._cache&&(q+="&"+j._core.getuid()),j._core.xhr({url:q,type:"get",dataType:"json",success:function(J){if(J==null){G.state=Cesium.QuadtreeTileLoadState.DONE,G.renderable=!0;return}if(!E.shape&&typeof E.radius=="string"&&J.features.length>0){let Xe;if(J.features[0]&&J.features[0].properties[E.radius])if(Xe=J.features[0].properties[E.radius],Xe.indexOf&&(Xe.indexOf("*")>-1||Xe.indexOf("x")>-1||Xe.indexOf("X")>-1)){Xe.indexOf("*")>-1?Xe=Xe.split("*"):Xe.indexOf("X")>-1?Xe=Xe.split("X"):Xe.indexOf("x")>-1&&(Xe=Xe.split("x"));let it=parseFloat(Xe[0])*E.radiusScale,ut=parseFloat(Xe[1])*E.radiusScale;E.shape=[new j._cesium.Cartesian2(-it,-ut),new j._cesium.Cartesian2(it,-ut),new j._cesium.Cartesian2(it,ut),new j._cesium.Cartesian2(-it,ut)]}else E.shape=j._core.computeCircle(Xe*E.radiusScale);else E.shape=j._core.computeCircle(.5)}j.Legend=[];for(var X=[],Y=[],Q=0;Q<J.features.length;Q++){var ee=J.features[Q];if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var z=m.material.replace(/\[/,"").replace(/\]/,"");E.material=ee.properties[z],j._core.isHtmlColor(E.material)?E.material=j._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=j._color.rgbaStringToRgbaObj(E.material)),E.material.r>1&&(E.material.r=E.material.r/255),E.material.g>1&&(E.material.g=E.material.g/255),E.material.b>1&&(E.material.b=E.material.b/255),E.material.a>1&&(E.material.a=E.material.a/255),E.material=j._color.createColor(E.material.r,E.material.g,E.material.b,E.material.a))}for(var ie=[],re=[],ne=parseFloat(m.height||0),oe=0;oe<ee.geometry.coordinates.length;oe++){var se=ee.geometry.coordinates[oe];if(se.length>0)if(Array.isArray(se[0]))for(var ae=0;ae<se.length;ae++){var fe=se[ae];ne=ne<(fe[2]||0)?fe[2]||0:ne;var de=j._cesium.Cartesian3.fromDegrees(fe[0],fe[1],E.height);ie.push(de),re.push(E.material)}else{ne=ne<(se[2]||0)?se[2]||0:ne;var ve=j._cesium.Cartesian3.fromDegrees(se[0],se[1],E.height);ie.push(ve),re.push(E.material)}}G._minimumHeight=ne,E.position=ie,ee.positions=ie;var pe="",ce="",he=!0;if(E.slttype=="0"||E.slttype==0)if(G.level>=parseFloat(m.level_max)-8&&parseFloat(m.level_max)>19){pe=E.shape;var Ce={polylinePositions:E.position,shapePositions:pe,cornerType:E.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};ce=new j._cesium.PolylineVolumeGeometry(Ce)}else if(G.level>=parseFloat(m.level_max)-4&&parseFloat(m.level_max)>16){pe=E.shape;var Ce={polylinePositions:E.position,shapePositions:pe,cornerType:E.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};ce=new j._cesium.PolylineVolumeGeometry(Ce)}else if(G.level>=parseFloat(m.level_max)-4){pe=E.shape;var Ce={polylinePositions:E.position,shapePositions:pe,cornerType:E.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};ce=new j._cesium.PolylineVolumeGeometry(Ce)}else{pe="";var Se={positions:E.position,width:1,vertexFormat:j._cesium.PolylineColorAppearance.VERTEX_FORMAT,colors:re};ce=new j._cesium.PolylineGeometry(Se),he=!1}else{pe=E.shape;var Ce={polylinePositions:E.position,shapePositions:pe,cornerType:E.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}};ce=new j._cesium.PolylineVolumeGeometry(Ce)}var De=new j._cesium.GeometryInstance({id:ee,geometry:ce,attributes:{color:new j._cesium.ColorGeometryInstanceAttribute.fromColor(E.material)}});pe==""&&(De=new j._cesium.GeometryInstance({id:ee,geometry:ce})),Y.push(De)}var Oe="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;j.Legend.push(Oe),Y.length==0&&(G.state=Cesium.QuadtreeTileLoadState.DONE,G.renderable=!0);var Ue=null;pe==""?Ue=new j._cesium.Primitive({appearance:new j._cesium.PolylineColorAppearance,geometryInstances:Y}):Ue=new j._cesium.Primitive({allowPicking:!0,appearance:new j._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:j._core.Shaders("vertexShaderSource"),fragmentShaderSource:j._core.Shaders("fragmentShaderSource")}),shadows:E.shadows,geometryInstances:Y}),G.data.geometryPrimitive=Ue,G.state=Cesium.QuadtreeTileLoadState.LOADING,G.state===Cesium.QuadtreeTileLoadState.LOADING&&(G.data.geometryPrimitive.update(U,[]),G.state=Cesium.QuadtreeTileLoadState.DONE,G.renderable=!0)},error:function(){G.state=Cesium.QuadtreeTileLoadState.DONE,G.renderable=!0}})}else{G.state=Cesium.QuadtreeTileLoadState.DONE,G.renderable=!0;return}G.state=Cesium.QuadtreeTileLoadState.LOADING}})(F,k,C)},typeof x=="function"&&x(this.item)};let P,D;this.saveDefaultVectorData=()=>{D=C._core.extend({},m,!0)},this.restoreVector=()=>{D&&(m=D,E=C._core.extend({...w},m,!0),C._Provider._normalTile=m.level_max-1,C._primitive&&C._primitive._tilesToRender&&C._primitive._tilesToRender.length&&(C._primitive._tilesToRender.forEach(F=>{F.data.geomeitryPrimitive&&F.data.geomeitryPrimitive.destroy(),F.state=Cesium.QuadtreeTileLoadState.START}),C._primitive._tileToUpdateHeights.forEach(F=>{F.data.geomeitryPrimitive&&F.data.geomeitryPrimitive.destroy(),F.state=Cesium.QuadtreeTileLoadState.START}),C._primitive._tileToUpdateHeights=[],C._primitive._tilesToRender=[])),D=void 0},this.updataVector=(F={})=>{if(F.material&&F.material&&(F.material=Cesium.Color.fromCssColorString(F.material)),(F.minimumLevel!==void 0||F.maximumLevel!==void 0)&&(F.minimumLevel!==void 0&&(F.level_min=F.minimumLevel),F.maximumLevel!==void 0&&(F.level_max=F.maximumLevel)),typeof F.radius=="string"&&F.radius.indexOf("[")>-1&&F.radius.indexOf("]")>-1)E.radius=E.radius.replace("[",""),E.radius=E.radius.replace("]",""),E.shape=void 0;else if(F.radius){if(E.slttype=="0"||E.slttype==0){E.shape=this._core.computeCircle(E.radius);var k=E.radius/2,U=E.radius/2;E.shape1=[new this._cesium.Cartesian2(-k,-U),new this._cesium.Cartesian2(k,-U),new this._cesium.Cartesian2(k,U),new this._cesium.Cartesian2(-k,U)]}else if(E.slttype=="1"||E.slttype==1)E.shape=this._core.starPositions(E.number,E.exradius,E.inradius);else if(E.slttype=="2"||E.slttype==2){var k=E.orth_width/2,U=E.orth_height/2;E.shape=[new this._cesium.Cartesian2(-k,-U),new this._cesium.Cartesian2(k,-U),new this._cesium.Cartesian2(k,U),new this._cesium.Cartesian2(-k,U)]}}m=C._core.extend(m,F,!0),E=C._core.extend(E,m,!0),C._Provider._normalTile=m.level_max-1,C._primitive&&C._primitive._tilesToRender&&C._primitive._tilesToRender.length&&(clearTimeout(P),P=setTimeout(()=>{C._primitive._tilesToRender.forEach(G=>{G.data.geomeitryPrimitive&&G.data.geomeitryPrimitive.destroy(),G.state=Cesium.QuadtreeTileLoadState.START}),C._primitive._tileToUpdateHeights.forEach(G=>{G.data.geomeitryPrimitive&&G.data.geomeitryPrimitive.destroy(),G.state=Cesium.QuadtreeTileLoadState.START}),C._primitive._tileToUpdateHeights=[],C._primitive._tilesToRender=[]},100))},this._primitive=new this._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var L=this._viewer.scene,R=L.primitives;m&&m.time&&(this._Provider._availability=new C._cesium.TimeIntervalCollection([new C._cesium.TimeInterval({start:m.time.start?C._cesium.JulianDate.fromDate(new Date(m.time.start)):C._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?C._cesium.JulianDate.fromDate(new Date(m.time.end)):C._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(F){if(!Cesium.defined(F))throw new Cesium.DeveloperError("time is required.");var k=this._availability;return!Cesium.defined(k)||k.contains(F)}),R.add(this._primitive),this._core.getWMTSData({url:f.url,layer:f.layer,srs:f.srs||"EPSG:4490",gisserverTMS:M},F=>{C.item.boundingSphere=F.boundingSphere,C.TileMatrixLimits=F.TileMatrixLimits,C.initThisProvider()}),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id);var O={id:E.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:f.url,style:m};return this.setTreeobj(O),this._tree.insertGroupId(O,this._core.isnull(v)?0:v),this};var X6i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};Q0.prototype._serialize=function(o){var f=[],m=window.encodeURIComponent;for(var v in o){var y=o[v];(typeof y>"u"?"undefined":X6i(y))==="object"?f.push(m(v)+"="+m(JSON.stringify(y))):f.push(m(v)+"="+m(o[v]))}return f.join("&")};Q0.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this,E=this._core.extend(C,m,!0);if(E.slttype=="0"||E.slttype==0)E.shape=A._core.computeCircle(E.radius);else if(E.slttype=="1"||E.slttype==1)E.shape=A._core.starPositions(E.number,E.exradius,E.inradius);else if(E.slttype=="2"||E.slttype==2){var T=E.orth_width/2,S=E.orth_height/2;E.shape=[new A._cesium.Cartesian2(-T,-S),new A._cesium.Cartesian2(T,-S),new A._cesium.Cartesian2(T,S),new A._cesium.Cartesian2(-T,S)]}f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var M=[];this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(L,R){this.tile=null,this.tile=R;var O=[];if(R.state===this._cesium.QuadtreeTileLoadState.START&&A.item.show){var F="z"+R.level+"x"+R.x+"y"+R.y;if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&A.item.show)A.Primitivekey.includes(F)||function(k){var U=A._urlTemplate.replace(window.encodeURIComponent("{x}"),k.x).replace(window.encodeURIComponent("{y}"),k.y).replace(window.encodeURIComponent("{z}"),k.level);A.tilesLength++,A._cache&&(U+="&"+A._core.getuid()),A._core.xhr({url:U,type:"get",dataType:"json",success:function(G){var j=[],q=[],J=new A._cesium.PrimitiveCollection;A.Legend=[];function X(ne){for(var oe=0;oe<ne.length;oe++)Array.isArray(ne[oe])?X(ne[oe]):ee.push(ne[oe])}function Y(){if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var ne=m.material.replace(/\[/,"").replace(/\]/,"");E.material=z.properties[ne],A._core.isHtmlColor(E.material)?E.material=A._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=A._color.rgbaStringToRgbaObj(E.material)),E.material.r>1&&(E.material.r=E.material.r/255),E.material.g>1&&(E.material.g=E.material.g/255),E.material.b>1&&(E.material.b=E.material.b/255),E.material.a>1&&(E.material.a=E.material.a/255),E.material=A._color.createColor(E.material.r,E.material.g,E.material.b,E.material.a))}var oe=A._cesium.Cartesian3.fromDegreesArray(ee);E.position=oe,z.positions=oe;var se={polylinePositions:E.position,shapePositions:E.shape,cornerType:E.cornerType},ae=new A._cesium.PolylineVolumeGeometry(se),fe=new A._cesium.GeometryInstance({id:z,geometry:ae,attributes:{color:new A._cesium.ColorGeometryInstanceAttribute.fromColor(E.material)}}),de="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;A.Legend.push(de),j.push(fe);var ve=new A._cesium.Primitive({allowPicking:!0,appearance:new A._cesium.MaterialAppearance({material:new A._cesium.Material({fabric:{type:"Color",uniforms:{color:E.material}}}),faceForward:!0,flat:!1}),shadows:E.shadows,geometryInstances:fe});J.add(ve)}for(var Q=0;Q<G.features.length;Q++){var ee=[],z=G.features[Q];if(Array.isArray(z.geometry.coordinates)&&z.geometry.coordinates.length>0)if(Array.isArray(z.geometry.coordinates[0][0]))for(var ie=0;ie<z.geometry.coordinates.length;ie++)ee=[],z.geometry.coordinates[ie].pop(),X(z.geometry.coordinates[ie]),ee.length>2&&Y(ee);else X(z.geometry.coordinates),ee.length>2&&Y(ee)}if(j.length>0){A.PrimitiveObj.data=J,A.PrimitiveObj.key=A.Primitivekey[A.returnCount];var re={key:A.Primitivekey[A.returnCount],data:J};A.PrimitiveData.push(re),A._primitiveCollection.add(J),A._viewer.scene.primitives.add(J),A.datas.push(J),A.returnCount++,A._primitiveByTile[F]=J}},error:function(){M=Ji.remove(M,function(G){return G.x==k.x&&G.y==k.y&&G.level==k.level})},complete:function(G,j){G=null,k.state=A._cesium.QuadtreeTileLoadState.LOADING,k.state===A._cesium.QuadtreeTileLoadState.LOADING&&(k.data.geometryPrimitive&&(k.state=A._cesium.QuadtreeTileLoadState.DONE),k.renderable=!0)}})}(R);else{R.state=A._cesium.QuadtreeTileLoadState.LOADING,R.state===A._cesium.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive&&(R.state=A._cesium.QuadtreeTileLoadState.DONE),R.renderable=!0);return}}},this._primitive=new A._cesium.QuadtreePrimitivezh({tileProvider:this._Provider,tileCacheSize:1,maximumScreenSpaceError:3});var I=this._viewer.scene,P=I.primitives;P.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var D={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};this.setTreeobj(D),this._tree.insertGroupId(D,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item)};Q0.prototype.setTreeobj=function(o){this.treeobj=o};Q0.prototype._removeObsoletePrimitives=function(o,f){var m=[];f.length>0&&(m=f);for(var v in o)if(!m.includes(v)){var y=this._primitiveCollection.remove(o[v]);y&&delete o[v]}};Q0.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};Q0.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch{}};Q0.prototype.getLegend=function(){var o=[];return this.Legend!=null&&(o=this._core.unique(this.Legend)),o};Q0.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(!o)}catch{}};Q0.prototype.setVisibility=function(o){this.item.show=o,this._Provider&&this._Provider.setStatus(o)};Q0.prototype.isCache=function(o){this._cache=o};Q0.prototype.edit=function(o,f){return this.isEditting=o,this.editoption=f,this._Provider&&this._Provider.edit&&this._Provider.edit(o,f)};Q0.prototype.forceRefresh=function(){try{for(var o=0;o<this._Provider.quadtree._levelZeroTiles.length;o++)this._Provider.quadtree._levelZeroTiles[o].freeResources()}catch{}};var eK=Q0;function U_(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0,this.Legend=[],this.datas=[],this.PrimitiveData=[],this.PrimitiveObj={key:"",data:{}},this.Primitivekey=[],this.tilesLength=0,this.returnCount=0,this._cache=!1,this._forceRefreshPrvimitive=null}var J6i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(o){return typeof o}:function(o){return o&&typeof Symbol=="function"&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o};U_.prototype._serialize=function(o){var f=[],m=window.encodeURIComponent;for(var v in o){var y=o[v];(typeof y>"u"?"undefined":J6i(y))==="object"?f.push(m(v)+"="+m(JSON.stringify(y))):f.push(m(v)+"="+m(o[v]))}return f.join("&")};U_.prototype.createVolumeVectorGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},T=this;this._urlTemplate=f.url+"?"+this._core._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){if(this.tile=D,D.state===this._cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var R=Ji.filter(A,function(O){return O.x==D.x&&O.y==D.y&&O.level==D.level});if(R.length!=0&&R[0].data&&R[0].data.length>0){D.data.geometryPrimitive=new T._cesium.Primitive({geometryInstances:R[0].data,appearance:new T._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:T._cesium.ShadowMode.ENABLED}),D.state=T._cesium.QuadtreeTileLoadState.LOADING,D.state===T._cesium.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&D.data.geometryPrimitive.update(),D.state=T._cesium.QuadtreeTileLoadState.DONE,D.renderable=!0);return}A.push({level:D.level,x:D.x,y:D.y,data:void 0}),function(O){var F=T._urlTemplate.replace(window.encodeURIComponent("{x}"),O.x).replace(window.encodeURIComponent("{y}"),O.y).replace(window.encodeURIComponent("{z}"),O.level);T._cache&&(F+="&"+T._core.getuid()),T._core.xhr({url:F,type:"get",dataType:"json",success:function(k){var U=[],G=[];T.Legend=[];function j(ee){for(var z=0;z<ee.length;z++)Array.isArray(ee[z])?j(ee[z]):X.push(ee[z])}function q(){if(/^\[/.test(T._option.extrudedHeight)&&/\]$/.test(T._option.extrudedHeight)){var ee=T._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");E.extrudedHeight=parseFloat(Y.properties[ee])}else E.extrudedHeight=parseFloat(T._option.extrudedHeight);if(E.material=T._option.material,/^\[/.test(T._option.material)&&/\]$/.test(T._option.material)){var z=T._option.material.replace(/\[/,"").replace(/\]/,"");E.material=Y.properties[z],T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha))}else T._option.material&&(E.material=T._option.material),E.material&&(T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha)));var ie=T._cesium.Cartesian3.fromDegreesArray(X);E.polygonHierarchy=new T._cesium.PolygonHierarchy(ie);var re=new T._cesium.PolygonGeometry(E),ne=T._cesium.PolygonGeometry.createGeometry(re),oe=new T._cesium.GeometryInstance({id:Y,geometry:ne,attributes:{color:new T._cesium.ColorGeometryInstanceAttribute.fromColor(E.material)}}),se="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;T.Legend.push(se),U.push(oe)}for(var J=0;J<k.features.length;J++){var X=[],Y=k.features[J];if(Array.isArray(Y.geometry.coordinates)&&Y.geometry.coordinates.length>0)if(Array.isArray(Y.geometry.coordinates[0][0]))for(var Q=0;Q<Y.geometry.coordinates.length;Q++)X=[],Y.geometry.coordinates[Q].pop(),j(Y.geometry.coordinates[Q]),q(X);else j(Y.geometry.coordinates),q(X)}O.data.geometryPrimitive=new T._cesium.Primitive({geometryInstances:U,appearance:new T._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:T._core.Shaders("vertexShaderSource"),fragmentShaderSource:T._core.Shaders("fragmentShaderSource")}),shadows:T._option.shadows})},error:function(){A=Ji.remove(A,function(k){return k.x==O.x&&k.y==O.y&&k.level==O.level})},complete:function(k,U){k=null,O.state=T._cesium.QuadtreeTileLoadState.LOADING,O.state===T._cesium.QuadtreeTileLoadState.LOADING&&(O.data.geometryPrimitive&&O.data.geometryPrimitive.update(P),O.state=T._cesium.QuadtreeTileLoadState.DONE,O.renderable=!0)}})}(D)}else{D.state=T._cesium.QuadtreeTileLoadState.LOADING,D.state===T._cesium.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&D.data.geometryPrimitive.update(P,[]),D.state=T._cesium.QuadtreeTileLoadState.DONE,D.renderable=!0);return}}},this._primitive=new T._cesium.QuadtreePrimitive({tileProvider:this._Provider});var S=this._viewer.scene,M=S.primitives;m&&m.time&&(this._Provider._availability=new T._cesium.TimeIntervalCollection([new T._cesium.TimeInterval({start:m.time.start?T._cesium.JulianDate.fromDate(new Date(m.time.start)):T._cesium.Iso8601.MINIMUM_VALUE,stop:m.time.end?T._cesium.JulianDate.fromDate(new Date(m.time.end)):T._cesium.Iso8601.MAXIMUM_VALUE})]),this._Provider.isAvailable=function(P){if(!Cesium.defined(P))throw new Cesium.DeveloperError("time is required.");var D=this._availability;return!Cesium.defined(D)||D.contains(P)}),M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item)};U_.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:this._cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:this._cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:this._cesium.ArcType.GEODESIC,material:this._cesium.Color.RED},T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){if(this.tile=null,this.tile=D,D.state===this._cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var R=Ji.filter(A,function(F){return F.x==D.x&&F.y==D.y&&F.level==D.level});if(R.length!=0&&R[0].data&&R[0].data.length>0){D.data.geometryPrimitive=new T._cesium.Primitive({geometryInstances:R[0].data,appearance:new T._cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:T._cesium.ShadowMode.ENABLED}),D.state=T._cesium.QuadtreeTileLoadState.LOADING,D.state===T._cesium.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=T._cesium.QuadtreeTileLoadState.DONE),D.renderable=!0);return}if(T.PrimitiveData.length>0){for(var O=0;O<T.PrimitiveData.length;O++)if(T.PrimitiveData[O].key==L){T.Primitivekey.push(L);return}}T.Primitivekey.includes(L)||(T.Primitivekey.push(L),A.push({level:D.level,x:D.x,y:D.y,data:void 0}),function(F){var k=T._urlTemplate.replace(window.encodeURIComponent("{x}"),F.x).replace(window.encodeURIComponent("{y}"),F.y).replace(window.encodeURIComponent("{z}"),F.level);T._cache&&(k+="&"+T._core.getuid()),T.tilesLength++,T._core.xhr({url:k,type:"get",dataType:"json",success:function(U){var G=[],j=[];T.Legend=[];function q(re){for(var ne=0;ne<re.length;ne++)Array.isArray(re[ne])?q(re[ne]):Y.push(re[ne])}function J(){if(/^\[/.test(T._option.extrudedHeight)&&/\]$/.test(T._option.extrudedHeight)){var re=T._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");E.extrudedHeight=parseFloat(Q.properties[re])}if(E.extrudedHeight=parseFloat(T._option.extrudedHeight),E.material=T._option.material,/^\[/.test(T._option.material)&&/\]$/.test(T._option.material)){var ne=T._option.material.replace(/\[/,"").replace(/\]/,"");E.material=Q.properties[ne],T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha))}else T._option.material&&(E.material=T._option.material),E.material&&(T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha)));var oe=T._cesium.Cartesian3.fromDegreesArray(Y);E.polygonHierarchy=new T._cesium.PolygonHierarchy(oe);var se=new T._cesium.PolygonGeometry(E),ae=new T._cesium.GeometryInstance({id:Q,geometry:se,attributes:{color:new T._cesium.ColorGeometryInstanceAttribute.fromColor(E.material)}}),fe="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;T.Legend.push(fe),G.push(ae)}for(var X=0;X<U.features.length;X++){var Y=[],Q=U.features[X];if(Array.isArray(Q.geometry.coordinates)&&Q.geometry.coordinates.length>0)if(Array.isArray(Q.geometry.coordinates[0][0]))for(var ee=0;ee<Q.geometry.coordinates.length;ee++)Y=[],Q.geometry.coordinates[ee].pop(),q(Q.geometry.coordinates[ee]),J(Y);else q(Q.geometry.coordinates),J(Y)}var z=new T._cesium.Primitive({geometryInstances:G,appearance:new T._cesium.PerInstanceColorAppearance({translucent:!1,vertexShaderSource:T._core.Shaders("vertexShaderSource"),fragmentShaderSource:T._core.Shaders("fragmentShaderSource")}),shadows:T._option.shadows});T.PrimitiveObj.data=z,T.PrimitiveObj.key=T.Primitivekey[T.returnCount];var ie={key:T.Primitivekey[T.returnCount],data:z};T.PrimitiveData.push(ie),T._viewer.scene.primitives.add(z),T.datas.push(z),T.returnCount++,T.returnCount>=T.tilesLength&&(T.returnCount=0,T.tilesLength=0,T.Primitivekey=[])},error:function(){A=Ji.remove(A,function(U){return U.x==F.x&&U.y==F.y&&U.level==F.level})},complete:function(U,G){U=null,F.state=T._cesium.QuadtreeTileLoadState.LOADING,F.state===T._cesium.QuadtreeTileLoadState.LOADING&&(F.data.geometryPrimitive&&(F.state=T._cesium.QuadtreeTileLoadState.DONE),F.renderable=!0)}})}(D))}else{D.state=T._cesium.QuadtreeTileLoadState.LOADING,D.state===T._cesium.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&(D.state=T._cesium.QuadtreeTileLoadState.DONE),D.renderable=!0);return}}},this._primitive=new T._cesium.QuadtreePrimitive({tileProvider:this._Provider});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item)};U_.prototype.createVolumeVectorGeoJsonFeatureLayersd=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a)))),!this._core.isnull(m)&&!this._core.isnull(m.outlineColor)&&(m.outlineColor.toString().charAt(0)=="["&&m.outlineColor.toString().charAt(m.outlineColor.length-1)=="]"||(this._core.isHtmlColor(m.outlineColor)?m.outlineColor=this._color.colorFromHtmlColor(m.outlineColor):(/^rgb/.test(m.outlineColor)&&(m.outlineColor=this._color.rgbaStringToRgbaObj(m.outlineColor)),m.outlineColor.r>1&&(m.outlineColor.r=m.outlineColor.r/255),m.outlineColor.g>1&&(m.outlineColor.g=m.outlineColor.g/255),m.outlineColor.b>1&&(m.outlineColor.b=m.outlineColor.b/255),m.outlineColor.a>1&&(m.outlineColor.a=m.outlineColor.a/255),m.outlineColor=this._color.createColor(m.outlineColor.r,m.outlineColor.g,m.outlineColor.b,m.outlineColor.a)))),this._option=this._core.extend(C,m,!0),f==null&&console.log("geoOptions is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:0,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.RED},T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams);var S=f.url.split("geoserver")[0]+"geoserver/polygon/ows?service=WFS&version=1.0.0&request=GetFeature&typeName="+w.urlParams.LAYER+"&outputFormat=application%2Fjson",M=S;T._core.xhr({url:M,type:"get",async:!1,dataType:"json",success:function(L){T.datas=L.features}}),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(L,R){if(this.tile=R,R.state===Cesium.QuadtreeTileLoadState.START&&T.item.show){var O="z"+R.level+"x"+R.x+"y"+R.y;if(R.data={lines:[],geometryPrimitive:void 0},R.level>=m.level_min&&R.level<m.level_max&&T.item.show){var F=Ji.filter(A,function(k){return k.x==R.x&&k.y==R.y&&k.level==R.level});if(F.length!=0&&F[0].data&&F[0].data.length>0){R.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:F[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),R.state=Cesium.QuadtreeTileLoadState.LOADING,R.state===Cesium.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive&&R.data.geometryPrimitive.update(),R.state=Cesium.QuadtreeTileLoadState.DONE,R.renderable=!0);return}A.push({level:R.level,x:R.x,y:R.y,data:void 0}),function(k){var U=T._urlTemplate.replace(window.encodeURIComponent("{x}"),k.x).replace(window.encodeURIComponent("{y}"),k.y).replace(window.encodeURIComponent("{z}"),k.level);T._cache&&(U+="&"+T._core.getuid()),T._core.xhr({url:U,type:"get",dataType:"json",success:function(G){var j=[],q=[];T.Legend=[];function J(oe){for(var se=0;se<oe.length;se++)Array.isArray(oe[se])?(oe[se].length==3&&(oe[se].splice(2,1),oe[se].push(this._option.height)),J(oe[se])):Q.push(oe[se])}function X(){if(/^\[/.test(T._option.extrudedHeight)&&/\]$/.test(T._option.extrudedHeight)){var oe=T._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");E.extrudedHeight=parseFloat(ie.properties[oe])}else E.extrudedHeight=parseFloat(T._option.extrudedHeight);if(E.material=T._option.material,/^\[/.test(T._option.material)&&/\]$/.test(T._option.material)){var se=T._option.material.replace(/\[/,"").replace(/\]/,"");E.material=ie.properties[se],T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha))}else T._option.material&&(E.material=T._option.material),E.material&&(T._core.isHtmlColor(E.material)?E.material=T._color.colorFromHtmlColor(E.material):(/^rgb/.test(E.material)&&(E.material=T._color.rgbaStringToRgbaObj(E.material)),E.material.red>1&&(E.material.red=E.material.red/255),E.material.green>1&&(E.material.green=E.material.green/255),E.material.blue>1&&(E.material.blue=E.material.blue/255),E.material.alpha>1&&(E.material.a=E.material.alpha/255),E.material=T._color.createColor(E.material.red,E.material.green,E.material.blue,E.material.alpha)));var ae=Cesium.Cartesian3.fromDegreesArrayHeights(Q);E.polygonHierarchy=new Cesium.PolygonHierarchy(ae);var ae=Cesium.Cartesian3.fromDegreesArrayHeights(Q),fe={positions:ae,width:T._option.outlineWidth,color:Cesium.ColorGeometryInstanceAttribute.fromColor(T._option.outlineColor)},de=new Cesium.PolylineGeometry(fe),ve=new Cesium.GeometryInstance({geometry:de}),pe="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;T.Legend.push(pe),q.push(ve)}for(var Y=0;Y<G.features.length;Y++){var Q=[],ee=G.features[Y].id,z=parseInt(ee.split(".")[1])+1,ie=T.datas[z];if(Array.isArray(ie.geometry.coordinates)&&ie.geometry.coordinates.length>0&&Array.isArray(ie.geometry.coordinates[0][0][0]))for(var re=0;re<ie.geometry.coordinates[0].length;re++)Q=[],J(ie.geometry.coordinates[0][re]),X(Q)}var ne=new Cesium.PrimitiveCollection;ne.add(new Cesium.Primitive({geometryInstances:q,appearance:new Cesium.PolylineColorAppearance})),k.data.geometryPrimitive=ne},error:function(){A=Ji.remove(A,function(G){return G.x==k.x&&G.y==k.y&&G.level==k.level})},complete:function(G,j){G=null,k.state=Cesium.QuadtreeTileLoadState.LOADING,k.state===Cesium.QuadtreeTileLoadState.LOADING&&(k.data.geometryPrimitive&&k.data.geometryPrimitive.update(L),k.state=Cesium.QuadtreeTileLoadState.DONE,k.renderable=!0)}})}(R)}else{R.state=Cesium.QuadtreeTileLoadState.LOADING,R.state===Cesium.QuadtreeTileLoadState.LOADING&&(R.data.geometryPrimitive&&R.data.geometryPrimitive.update(L,[]),R.state=Cesium.QuadtreeTileLoadState.DONE,R.renderable=!0);return}}},this._primitive=new T._cesium.QuadtreePrimitive({tileProvider:this._Provider});var I=this._viewer.scene,P=I.primitives;P.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(E.id)&&(E.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+E.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var D={id:E.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};return this.setTreeobj(D),this._tree.insertGroupId(D,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item),this};U_.prototype.createVolumeVectorGeoJsonFeatureLayerDth=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.DISABLED,level_max:20,level_min:10},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,rectangle:this._cesium.Rectangle.fromDegrees(f.minx,f.miny,f.maxx,f.maxy),Cesium:this._cesium};this._option=this._core.extend(C,m,!0),f==null&&console.log("url is required"),o==null&&console.log("layername is required");var A=[],E={polygonHierarchy:void 0,height:0,extrudedHeight:100,vertexFormat:Cesium.VertexFormat.DEFAULT,stRotation:0,ellipsoid:Cesium.Ellipsoid.WGS84,perPositionHeight:!0,closeTop:!0,closeBottom:!0,arcType:Cesium.ArcType.GEODESIC,material:Cesium.Color.WHITE},T=this;this._urlTemplate=f.url+"?"+this._serialize(w.urlParams),this._Provider=new ol(this._viewer,this._cesium),this._Provider._normalTile=m.level_max-1,this._Provider.loadTile=function(P,D){if(this.tile=D,_serialize,D.state===Cesium.QuadtreeTileLoadState.START&&T.item.show){var L="z"+D.level+"x"+D.x+"y"+D.y;if(D.data={lines:[],geometryPrimitive:void 0},D.level>=m.level_min&&D.level<m.level_max&&T.item.show){var R=Ji.filter(A,function(O){return O.x==D.x&&O.y==D.y&&O.level==D.level});if(R.length!=0&&R[0].data&&R[0].data.length>0){D.data.geometryPrimitive=new Cesium.Primitive({geometryInstances:R[0].data,appearance:new Cesium.PerInstanceColorAppearance({flat:!0,translucent:!0,faceForward:!0,closed:!0}),shadows:Cesium.ShadowMode.ENABLED}),D.state=Cesium.QuadtreeTileLoadState.LOADING,D.state===Cesium.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&D.data.geometryPrimitive.update(P,[]),D.state=Cesium.QuadtreeTileLoadState.DONE,D.renderable=!0);return}A.push({level:D.level,x:D.x,y:D.y,data:void 0}),function(O){var F=T._urlTemplate.replace(window.encodeURIComponent("{x}"),O.x).replace(window.encodeURIComponent("{y}"),O.y).replace(window.encodeURIComponent("{z}"),O.level);T._cache&&(F+="&"+T._core.getuid()),T._core.xhr({url:F,type:"get",dataType:"json",success:function(k){var U=[];T.Legend=[];var G=new T._cesium.PrimitiveCollection;function j(se){for(var ae=0;ae<se.length;ae++)Array.isArray(se[ae])?j(se[ae]):J.push(se[ae])}for(var q=0;q<k.features.length;q++){var J=[],X=k.features[q];if(j(k.features[q].geometry.coordinates[0]),/^\[/.test(T._option.extrudedHeight)&&/\]$/.test(T._option.extrudedHeight)){var Y=T._option.extrudedHeight.replace(/\[/,"").replace(/\]/,"");T._option.extrudedHeight=parseFloat(X.properties[Y])}else T._option.extrudedHeight=parseFloat(T._option.extrudedHeight);if(T._option.heightReference==1&&delete T._option.height,T._option.extrudedHeightReference==1&&delete T._option.extrudedHeight,/^\[/.test(T._option.material)&&/\]$/.test(T._option.material)){var Q=T._option.material.replace(/\[/,"").replace(/\]/,"");T._option.material=X.properties[Q],T._core.isHtmlColor(T._option.material)?T._option.material=T._color.colorFromHtmlColor(T._option.material):(/^rgb/.test(T._option.material)&&(T._option.material=T._color.rgbaStringToRgbaObj(T._option.material)),T._option.material.red>1&&(T._option.material.red=T._option.material.red/255),T._option.material.green>1&&(T._option.material.green=T._option.material.green/255),T._option.material.blue>1&&(T._option.material.blue=T._option.material.blue/255),T._option.material.alpha>1&&(T._option.material.a=T._option.material.alpha/255),T._option.material=T._color.createColor(T._option.material.red,T._option.material.green,T._option.material.blue,T._option.material.alpha))}else T._option.material&&(T._option.material=T._option.material),T._option.material&&(T._core.isHtmlColor(T._option.material)?T._option.material=T._color.colorFromHtmlColor(T._option.material):(/^rgb/.test(T._option.material)&&(T._option.material=T._color.rgbaStringToRgbaObj(T._option.material)),T._option.material.red>1&&(T._option.material.red=T._option.material.red/255),T._option.material.green>1&&(T._option.material.green=T._option.material.green/255),T._option.material.blue>1&&(T._option.material.blue=T._option.material.blue/255),T._option.material.alpha>1&&(T._option.material.a=T._option.material.alpha/255),T._option.material=T._color.createColor(T._option.material.red,T._option.material.green,T._option.material.blue,T._option.material.alpha)));var ee=Cesium.Cartesian3.fromDegreesArray(J);X.positions=ee,T._option.polygonHierarchy=new Cesium.PolygonHierarchy(ee);var z=new Cesium.PolygonGeometry(T._option),ie=Cesium.PolygonGeometry.createGeometry(z),re="material:"+E.material.red*255+","+E.material.green*255+","+E.material.blue*255;T.Legend.push(re);var ne=new Cesium.GeometryInstance({id:X,geometry:ie,attributes:{color:new T._cesium.ColorGeometryInstanceAttribute.fromColor(T._option.material)}}),oe=new Cesium.ClassificationPrimitive({geometryInstances:U,appearance:new Cesium.PerInstanceColorAppearance({closed:!0,flat:!1}),classificationType:T._option.classificationType,shadows:Cesium.ShadowMode.ENABLED});G.add(oe)}O.data.geometryPrimitive=G},error:function(){A=Ji.remove(A,function(k){return k.x==O.x&&k.y==O.y&&k.level==O.level})},complete:function(){O.state=Cesium.QuadtreeTileLoadState.LOADING,O.state===Cesium.QuadtreeTileLoadState.LOADING&&(O.data.geometryPrimitive&&O.data.geometryPrimitive.update(P,[]),O.state=Cesium.QuadtreeTileLoadState.DONE,O.renderable=!0)}})}(D)}else{D.state=Cesium.QuadtreeTileLoadState.LOADING,D.state===Cesium.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive&&D.data.geometryPrimitive.update(P,[]),D.state=Cesium.QuadtreeTileLoadState.DONE,D.renderable=!0);return}}},this._primitive=new T._cesium.QuadtreePrimitive({tileProvider:this._Provider});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),y||this.setVisibility(!1),this._core.isnull(T._option.id)&&(T._option.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+T._option.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var I={id:T._option.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polygonLayer",item:this,url:f.url,style:m};this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item)};U_.prototype.createVolumeGeoJsonFeatureLayer=function(o,f,m,v,y){var x={polylinePositions:void 0,shapePositions:void 0,ellipsoid:this._cesium.Ellipsoid.WGS84,granularity:this._cesium.Math.RADIANS_PER_DEGREE,vertexFormat:this._cesium.VertexFormat.DEFAULT,cornerType:this._cesium.CornerType.ROUNDED};f==null&&console.log("geojson is required");var C=null;f.then?C=f:C=this._cesium.GeoJsonDataSource.load(f);var w=this,A=[];x.shapePositions=this.computeCircle(m.radius),C.then(function(T){var S=w._cesium.Color.WHITE;!w._core.isnull(m)&&!w._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"?S=m.material.replace(/\[/,"").replace("/]/",""):S=Ji.clone(m.material),w._core.isHtmlColor(S)?S=w._color.colorFromHtmlColor(m.material):(/^rgb/.test(S)&&(S=w._color.rgbaStringToRgbaObj(S)),S.r>1&&(S.r=S.r/255),S.g>1&&(S.g=S.g/255),S.b>1&&(S.b=S.b/255),S.a>1&&(S.a=S.a/255),S=w._color.createColor(S.r,S.g,S.b,S.a)));for(var M=T.entities.values,I=0;I<M.length;I++){var P=M[I];x.polylinePositions=P.polyline.positions._value;var D=new w._cesium.PolylineVolumeGeometry(x),L=w._cesium.PolylineVolumeGeometry.createGeometry(D),R=new w._cesium.GeometryInstance({geometry:L});A.push(R)}var O=w._viewer.scene.primitives.add(new w._cesium.Primitive({geometryInstances:A,appearance:new w._cesium.MaterialAppearance({material:new w._cesium.Material({fabric:{type:"Color",uniforms:{color:S}}}),faceForward:!0,flat:!1})}));w.item=O,m.show==!1&&(O.show=!1),typeof y=="function"&&y(O)}),this._core.isnull(m.id)&&(m.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u7BA1\u72B6\u56FE\u5C42"+m.id);var E={id:m.id,name:o,checked:!0,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:geoOptions.url,style:m};return this.setTreeobj(E),this._tree.insertGroupId(E,this._core.isnull(v)?0:v),this};U_.prototype.computeCircle=function(o){this._core.isnull(o)&&(o=4);for(var f=[],m=0;m<360;m++){var v=this._cesium.Math.toRadians(m);f.push(new this._cesium.Cartesian2(o*Math.cos(v),o*Math.sin(v)))}return f};U_.prototype.createVolumeGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C={show:!0,positions:[],shape:void 0,cornerType:this._cesium.CornerType.ROUNDED,granularity:this._cesium.Math.RADIANS_PER_DEGREE,fill:!0,material:this._cesium.Color.WHITE,outline:!1,outlineColor:this._cesium.Color.BLACK,outlineWidth:1,shadows:this._cesium.ShadowMode.RECEIVE_ONLY},w={url:f.url,urlParams:{REQUEST:"GetTile",SERVICE:"WMTS",VERSION:"1.0.0",LAYER:f.layer,STYLE:"",TILEMATRIX:"EPSG:4490:{z}",TILEMATRIXSET:"EPSG:4490",FORMAT:"application/json;type=geojson",TILECOL:"{x}",TILEROW:"{y}"},upperLevelLimit:f.upperLevelLimit,lowerLevelLimit:f.lowerLevelLimit,Cesium:this._cesium};!this._core.isnull(m)&&!this._core.isnull(m.material)&&(m.material.toString().charAt(0)=="["&&m.material.toString().charAt(m.material.length-1)=="]"||(this._core.isHtmlColor(m.material)?m.material=this._color.colorFromHtmlColor(m.material):(/^rgb/.test(m.material)&&(m.material=this._color.rgbaStringToRgbaObj(m.material)),m.material.r>1&&(m.material.r=m.material.r/255),m.material.g>1&&(m.material.g=m.material.g/255),m.material.b>1&&(m.material.b=m.material.b/255),m.material.a>1&&(m.material.a=m.material.a/255),m.material=this._color.createColor(m.material.r,m.material.g,m.material.b,m.material.a))));var A=this._core.extend(C,m,!0),E=new Ah(this._viewer,this._cesium,w);this._Provider=E;var T=this;E._loadTile=function(M){var I=[],P=new T._cesium.PrimitiveCollection;return M.features.forEach(function(D){var L=[];function R(ne){for(var oe=0;oe<ne.length;oe++)Array.isArray(ne[oe])?R(ne[oe]):L.push(ne[oe])}var O=[];if(/^\[/.test(m.material)&&/\]$/.test(m.material)){var F=m.material.replace(/\[/,"").replace(/\]/,"");A.material=D.properties[F],that._core.isHtmlColor(A.material)?A.material=that._color.colorFromHtmlColor(A.material):(/^rgb/.test(A.material)&&(A.material=that._color.rgbaStringToRgbaObj(A.material)),A.material.r>1&&(A.material.r=A.material.r/255),A.material.g>1&&(A.material.g=A.material.g/255),A.material.b>1&&(A.material.b=A.material.b/255),A.material.a>1&&(A.material.a=A.material.a/255),A.material=that._color.createColor(A.material.r,A.material.g,A.material.b,A.material.a))}for(var k=0;k<D.geometry.coordinates.length;k++){var U=D.geometry.coordinates[k];if(U.length>0)if(Array.isArray(U[0]))for(var G=0;G<U.length;G++){var j=U[G],q=T._cesium.Cartesian3.fromDegrees(j[0],j[1],A.height);O.push(q)}else{var J=T._cesium.Cartesian3.fromDegrees(U[0],U[1],A.height);O.push(J)}}if(A.position=O,D.positions=O,A.slttype=="0"||A.slttype==0)A.shape=T._core.computeCircle(A.radius);else if(A.slttype=="1"||A.slttype==1)A.shape=T._core.starPositions(A.number,A.exradius,A.inradius);else if(A.slttype=="2"||A.slttype==2){var X=A.orth_width/2,Y=A.orth_height/2;A.shape=[new T._cesium.Cartesian2(-X,-Y),new T._cesium.Cartesian2(X,-Y),new T._cesium.Cartesian2(X,Y),new T._cesium.Cartesian2(-X,Y)]}var Q={polylinePositions:A.position,shapePositions:A.shape,cornerType:A.cornerType,VertexFormat:{bitangent:!0,color:!0,position:!0,st:!0,normal:!0,tangent:!0}},ee=new T._cesium.PolylineVolumeGeometry(Q),z=T._cesium.PolylineVolumeGeometry.createGeometry(ee),ie=new T._cesium.GeometryInstance({id:D,geometry:z,attributes:{color:new T._cesium.ColorGeometryInstanceAttribute.fromColor(A.material)}}),re=new T._cesium.Primitive({allowPicking:!0,appearance:new T._cesium.MaterialAppearance({material:new T._cesium.Material({fabric:{type:"Color",uniforms:{color:A.material}}}),faceForward:!0,flat:!1}),shadows:A.shadows,geometryInstances:ie});P.add(re)}),P},this.item=E._primitiveCollection,E.addTo(this._viewer),y||this.setVisibility(!1),this._core.isnull(A.id)&&(A.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+A.id),this.west=f.minx,this.south=f.miny,this.east=f.maxx,this.north=f.maxy;var S={id:A.id,name:o,checked:y,pId:this._core.isnull(v)?0:v,type:"polylineVolumeLayer",item:this,url:f.url,style:m};this.setTreeobj(S),this._tree.insertGroupId(S,this._core.isnull(v)?0:v),typeof x=="function"&&x(this.item)};U_.prototype.setTreeobj=function(o){this.treeobj=o};U_.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};U_.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch{}};U_.prototype.setRefresh=function(o){try{this._Provider&&this._Provider.setStatus(o)}catch{}};U_.prototype.setVisibility=function(o){try{this.item!=null&&this.item.show!=null&&(this.item.show=o),this._Provider&&this._Provider.setStatus(o)}catch{}};U_.prototype.isCache=function(o){this._cache=o};U_.prototype.edit=function(o,f){return this.isEditting=o,this.editoption=f,this._Provider&&this._Provider.edit&&this._Provider.edit(o,f)};U_.prototype.forceRefresh=function(){try{for(var o=0;o<this._Provider.quadtree._levelZeroTiles.length;o++)this._Provider.quadtree._levelZeroTiles[o].freeResources()}catch{}};var tK=U_;function cy(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f)}cy.prototype.createWindField=function(o,f){var m,v=this;return this.WindFieldOption={color:this._cesium.Color.WHITE,speed:.15,num:2e3,maxAge:10,brighten:1.5},f||(f={}),f.color&&(f.color=this._cesium.Color.fromCssColorString(f.color)),this.WindFieldOption=this._core.extend(this.WindFieldOption,f,!1),this.destroy(),this.windData=void 0,this.windField=void 0,this.particles=[],this.lines=void 0,this.timer=void 0,this.primitives=this._viewer.scene.primitives,$.ajax({type:"get",async:!1,url:o,dataType:"json",success:function(y){v.windData=y,v._init(),v.timer=setInterval(function(){v.animate()},200)},error:function(y){console.log("\u8BF7\u6C42\u98CE\u573A\u6570\u636E\u5931\u8D25!")}}),this};cy.prototype._init=function(){this.windField=this.createField();for(var o=0;o<this.WindFieldOption.num;o++)this.particles.push(this.randomParticle(new K6i))};cy.prototype.createField=function(){var o=this._parseWindJson();return new iOe(o)};cy.prototype.animate=function(){var o=this,f=o.windField,m=o.particles,v=[],y=null,x=null,C=null,w=null;m.forEach(function(A){if(A.age<=0&&o.randomParticle(A),A.age>0){var E=A.x,T=A.y;f.isInBound(E,T)?(w=f.getIn(E,T),y=E+o.WindFieldOption.speed*w[0],x=T+o.WindFieldOption.speed*w[1],A.path.push(y,x),A.x=y,A.y=x,v.push(o._createLineInstance(o._map(A.path),A.age/A.birthAge)),A.age--):A.age=0}}),v.length<=0&&this.removeLines(),o._drawLines(v)};cy.prototype._parseWindJson=function(){var o=null,f=null,m=null;return this.windData.forEach(function(v){var y=v.header.parameterCategory+","+v.header.parameterNumber;switch(y){case"2,2":o=v.data,m=v.header;break;case"2,3":f=v.data;break;default:break}}),{header:m,uComponent:o,vComponent:f}};cy.prototype.removeLines=function(){this.lines&&(this.primitives.remove(this.lines),this.lines.destroy())};cy.prototype._map=function(o){for(var f=o.length,m=this.windField,v=m.dx,y=m.dy,x=m.west,C=m.north,w=[],A=0;A<=f-2;A+=2)w.push(x+o[A]*v,C-o[A+1]*y);return w};cy.prototype._createLineInstance=function(o,f){for(var m=[],v=o.length,y=v/2,x=0;x<v;x++)m.push(this.WindFieldOption.color==="random"?this._cesium.Color.fromRandom({alpha:x/y*f*this.WindFieldOption.brighten}):this.WindFieldOption.color.withAlpha(x/y*f*this.WindFieldOption.brighten));return new this._cesium.GeometryInstance({geometry:new this._cesium.PolylineGeometry({positions:this._cesium.Cartesian3.fromDegreesArray(o),colors:m,width:1.5,colorsPerVertex:!0})})};cy.prototype._drawLines=function(o){this.removeLines();var f=new this._cesium.Primitive({appearance:new this._cesium.PolylineColorAppearance({translucent:!0}),geometryInstances:o,asynchronous:!1});this.lines=this.primitives.add(f)};cy.prototype.randomParticle=function(o){var f=30,m,v;do m=Math.floor(Math.random()*(this.windField.cols-2)),v=Math.floor(Math.random()*(this.windField.rows-2));while(this.windField.getIn(m,v)[2]<=0&&f++<30);return o.x=m,o.y=v,o.age=Math.round(Math.random()*this.WindFieldOption.maxAge),o.birthAge=o.age,o.path=[m,v],o};cy.prototype.changeColor=function(o){o==="random"?this.WindFieldOption.color=o:this.WindFieldOption.color=this._cesium.Color.fromCssColorString(o)};cy.prototype.setSpeed=function(o){this.WindFieldOption.speed=o};cy.prototype.setMaxAge=function(o){this.WindFieldOption.maxAge=o};cy.prototype.setBrighten=function(o){this.WindFieldOption.brighten=o};cy.prototype.destroy=function(){this.timer&&clearInterval(this.timer),this.timer=void 0,this.removeLines()};var K6i=function(){this.x=null,this.dx=null,this.dx=null,this.y=null,this.age=null,this.birthAge=null,this.path=null},iOe=function(o){this.west=null,this.east=null,this.south=null,this.north=null,this.rows=null,this.cols=null,this.dx=null,this.dy=null,this.unit=null,this.date=null,this.grid=null,this._init(o)};iOe.prototype={constructor:iOe,_init:function(o){var f=o.header,m=o.uComponent,v=o.vComponent;this.west=+f.lo1,this.east=+f.lo2,this.south=+f.la2,this.north=+f.la1,this.rows=+f.ny,this.cols=+f.nx,this.dx=+f.dx,this.dy=+f.dy,this.unit=f.parameterUnit,this.date=f.refTime,this.grid=[];for(var y=0,x=null,C=null,w=0;w<this.rows;w++){x=[];for(var A=0;A<this.cols;A++,y++)C=this._calcUV(m[y],v[y]),x.push(C);this.grid.push(x)}},_calcUV:function(o,f){return[+o,+f,Math.sqrt(o*o+f*f)]},_bilinearInterpolation:function(o,f,m,v,y,x){var C=1-o,w=1-f,A=C*w,E=o*w,T=C*f,S=o*f,M=m[0]*A+v[0]*E+y[0]*T+x[0]*S,I=m[1]*A+v[1]*E+y[1]*T+x[1]*S;return this._calcUV(M,I)},getIn:function(o,f){var m=Math.floor(o),v=Math.floor(f),y,x;if(m===o&&v===f)return this.grid[f][o];y=m+1,x=v+1;var C=this.getIn(m,v),w=this.getIn(y,v),A=this.getIn(m,x),E=this.getIn(y,x);return this._bilinearInterpolation(o-m,f-v,C,w,A,E)},isInBound:function(o,f){return o>=0&&o<this.cols-2&&f>=0&&f<this.rows-2}};var Dgt=cy;var Xo={opacity:1,poolSize:16,canvas:null,layers:new Array,showid:null,width:0,height:0,cesium:null,viewer:null,workers:new Array,oceanCanvas:null,oceanCtx:null,oceanWorker:null},Lgt=!1,oce=!1,rOe=100,Q6i=7,Z6i=1,$6i="rgba(0, 0, 0, 0.97)";var Rgt=Math.floor(.8*255),e8i=[NaN,NaN,null],iK=null,t8i=30,hk=null,pG,oOe=[],Bgt=null,kgt=null,i8i=!0;var r8i=[[30,[10,25,68]],[33,[10,25,250]],[33.5,[24,255,255]],[34,[105,233,252]],[34.5,[255,233,65]],[34.5,[255,233,15]],[34.5,[255,233,15]],[34.5,[255,233,15]],[34.5,[255,233,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,225,15]],[35,[255,255,15]],[35,[255,235,15]],[35,[255,215,15]],[35,[255,195,15]],[35,[255,175,15]],[35,[255,155,15]],[35,[255,135,15]],[35,[255,115,15]],[35,[255,95,15]],[35,[255,75,15]],[35,[255,55,15]],[35,[255,35,15]],[35,[255,15,15]]];function n8i(){for(var o={},f=Math.round(pG.width*Q6i),m=[],v=0;v<f;v++)m.push(Fgt({age:nOe(0,rOe)}));if(i8i){var y=pG.valMax-pG.valMin;y=y/(iK.length-1);for(var v=0;v<iK.length;v++)iK[v][0]=pG.valMin+v*y}var x=p8i(iK);function C(){o=[],m.forEach(function(E){E.age>rOe&&(E.xt=void 0,E.yt=void 0,Fgt(E).age=0),E.xt&&E.yt&&(E.x=E.xt,E.y=E.yt);var T=E.x,S=E.y,M=Vgt(T,S),I=M[2];if(I===null)E.age=rOe;else{var P=T+M[0],D=S+M[1];if(zgt(P,D)){E.xt=P,E.yt=D;var L=x(I,Rgt),R="rgba("+L[0]+", "+L[1]+", "+L[2]+", "+Rgt+")";o[R]==null&&(o[R]=[]),o[R].push(E)}else E.x=P,E.y=D}E.age+=1})}function w(){if(!oce){var E=Xo.oceanCtx;E.lineWidth=Z6i,E.fillStyle=$6i;var T=E.globalCompositeOperation;E.globalCompositeOperation="destination-in",E.fillRect(0,0,Xo.oceanCanvas.width,Xo.oceanCanvas.height),E.globalCompositeOperation=T;for(var S in o){var M=o[S];if(M.length>0){E.beginPath(),E.strokeStyle=S;for(var I in M){var P=M[I];E.moveTo(P.x,P.y),E.lineTo(P.xt,P.yt),P.x=P.xt,P.y=P.yt}E.stroke(),E.strokeStyle="#fff"}}}}Lgt=!1;var A=Xo.oceanCtx;A.clearRect(0,0,Xo.oceanCanvas.width,Xo.oceanCanvas.height),function E(){try{!Lgt&&!oce&&(C(),w(),hk=setTimeout(E,t8i))}catch{}}()}function o8i(o){switch(o.type){case"success":break;case"draw":pG=o.data,oOe=pG.drawData,n8i();break;case"error":break;default:break}}function Ogt(o){iK=o.color||r8i,Xo.oceanWorker=new Worker(SmartEarthRootUrl+"Workers/field/oceanWorker.js"),Xo.oceanWorker.onmessage=function(f){o8i(f.data)},Xo.oceanWorker.postMessage(o.message)}function a8i(o){var f=new Worker(SmartEarthRootUrl+"Workers/field/rendermapWorker.js");f.onmessage=function(m){o.callback(m.data),f.terminate()},f.postMessage(o.message)}function s8i(o,f){Xo.canvas!=null&&(Xo.canvas.remove(),Xo.canvas=null),Xo.canvas=document.createElement("canvas"),Xo.canvas.width=o,Xo.canvas.height=f}function rce(o,f){a8i({message:{id:o.id,ncpath:o.ncpath,variable:o.variable,depth:o.depth},callback:function(m){s8i(m.width,m.height);for(var v=Xo.canvas.getContext("2d"),y=v.getImageData(0,0,m.width,m.height),x=0;x<m.arrayBufferView.length;x++)y.data[x]=m.arrayBufferView[x];v.putImageData(y,0,0),c8i(m,o.id),typeof f=="function"&&f(o.id)}})}function nce(o){var f={x:0,y:0,z:0};return f.x=o.x,f.y=o.y,f.z=o.z,f}function Ngt(){for(var o=Xo.viewer.scene,f=o.camera,m=[],v=[],y=nce(f.positionWC),x=nce(f.directionWC),C=nce(f.rightWC),w=nce(f.upWC),A=0;A<16;A++)m[A]=f.viewMatrix[A],v[A]=f.frustum.projectionMatrix[A];var E={width:o.canvas.clientWidth,height:o.canvas.clientHeight,viewMatrix:m,projectionMatrix:v,frustum:{fovy:f.frustum.fovy,aspectRatio:f.frustum.aspectRatio,near:f.frustum.near},positionWC:y,directionWC:x,rightWC:C,upWC:w};return E}function l8i(o,f){var m=Ngt();if(Xo.oceanCanvas==null){Xo.oceanCanvas=document.createElement("canvas"),Xo.oceanCanvas.width=m.width,Xo.oceanCanvas.height=m.height,Xo.oceanCanvas.id="animation",Xo.oceanCanvas.style="position: absolute;left: 0px;top: 0px;pointer-events: none;",document.getElementsByClassName("map-widget")[0].appendChild(Xo.oceanCanvas),Xo.oceanCtx=Xo.oceanCanvas.getContext("2d");let v={childList:!0,attributes:!0,subtree:!0},y=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;new y(function(){Xo.oceanCanvas.width=Xo.viewer.cesiumWidget.canvas.width,Xo.oceanCanvas.height=Xo.viewer.cesiumWidget.canvas.height}).observe(Xo.viewer.cesiumWidget.canvas,v),Ogt({message:{id:o.id,type:"init",upath:o.upath,vpath:o.vpath,scene:m},callback:function(C){}}),Bgt=Xo.viewer.scene.camera.moveStart.addEventListener(function(){if(hk&&clearTimeout(hk),hk=null,Xo.oceanWorker!=null){Xo.oceanWorker.postMessage({type:"stop"}),oce=!0,oOe=[];var C=Xo.oceanCtx;C.clearRect(0,0,Xo.oceanCanvas.width,Xo.oceanCanvas.height)}}),kgt=Xo.viewer.scene.camera.moveEnd.addEventListener(function(){Xo.oceanWorker!=null&&(oce=!1,Xo.oceanWorker.postMessage({type:"update",scene:Ngt()}))})}else Ogt({message:{id:o.id,type:"init",upath:o.upath,vpath:o.vpath,scene:m},callback:function(v){}})}function u8i(o,f){switch(o.type){case"single":rce({id:0,ncpath:o.ncpath,variable:o.variable,depth:o.depth},f);break;case"mfile":rce({id:0,ncpath:o.ncpath.format(o.params[0]),variable:o.variable,depth:o.depth},function(){typeof f=="function"&&f(0);for(var m=1;m<o.params.length;m++)rce({id:m,ncpath:o.ncpath.format(o.params[m]),variable:o.variable,depth:o.depth})});break;case"mdepth":break;case"ocean":l8i({id:0,upath:o.upath,vpath:o.vpath},f);break;default:rce({id:0,ncpath:o.ncpath,variable:o.variable,depth:o.depth});break}}Xo.hide=function(){(Xo.showid||Xo.showid==0)&&Xo.layers[Xo.showid]&&(Xo.layers[Xo.showid].show=!1)};Xo.show=function(o){(Xo.showid||Xo.showid==0)&&Xo.layers[Xo.showid]&&(Xo.layers[Xo.showid].show=!1),(o||o==0)&&Xo.layers[o]&&(Xo.layers[o].show=!0,Xo.showid=o)};Xo.draw=function(o,f){u8i(o,f)};Xo.destroy=function(){try{for(var o=0;o<Xo.layers.length;o++)Xo.viewer.entities.remove(Xo.layers[o]);Xo.layers=[]}catch{}try{for(var o=0;o<Xo.workers.length;o++)try{Xo.workers[o].terminate()}catch{}Xo.workers=[]}catch{}try{hk&&clearTimeout(hk),hk=null}catch{}try{Xo.oceanWorker.terminate(),Xo.oceanWorker=null;var f=Xo.oceanCtx;f.clearRect(0,0,Xo.oceanCanvas.width,Xo.oceanCanvas.height)}catch{}};function c8i(o,f){var m=o.minx,v=o.miny,y=o.maxx,x=o.maxy,C=Xo.cesium.Rectangle.fromDegrees(m,v,y,x),w=new Xo.cesium.ImageMaterialProperty({image:Xo.canvas,transparent:!0});mlayer=Xo.viewer.entities.add({show:!0,rectangle:{coordinates:C,material:w}}),Xo.layers[f]=mlayer}String.prototype.format=function(o){var f=this;if(arguments.length>0){if(arguments.length==1&&typeof o=="object"){for(var m in o)if(o[m]!==void 0){var v=new RegExp("({"+m+"})","g");f=f.replace(v,o[m])}}else for(var y=0;y<arguments.length;y++)if(arguments[y]!==void 0){var x=new RegExp("({)"+y+"(})","g");f=f.replace(x,arguments[y])}}return f};function h8i(o,f,m){return Math.max(f,Math.min(o,m))}function d8i(o,f,m){return(h8i(o,f,m)-f)/(m-f)}function f8i(o,f){var m=o[0],v=o[1],y=o[2],x=f[0]-m,C=f[1]-v,w=f[2]-y;return function(A,E){return[Math.floor(m+A*x),Math.floor(v+A*C),Math.floor(y+A*w),E]}}function p8i(o){for(var f=[],m=[],v=[],y=0;y<o.length-1;y++)f.push(o[y+1][0]),m.push(f8i(o[y][1],o[y+1][1])),v.push([o[y][0],o[y+1][0]]);return function(x,C){var w;for(w=0;w<f.length-1&&!(x<=f[w]);w++);var A=v[w];return m[w](d8i(x,A[0],A[1]),C)}}function Vgt(o,f){var m=oOe[Math.round(o)];return m&&m[Math.round(f)]||e8i}function zgt(o,f){return Vgt(o,f)[2]!==null}function nOe(o,f){return f==null&&(f=o,o=0),o+Math.floor(Math.random()*(f-o+1))}function Fgt(o){var f,m,v=0;do f=Math.round(nOe(0,Xo.viewer.scene.canvas.clientWidth)),m=Math.round(nOe(0,Xo.viewer.scene.canvas.clientHeight));while(!zgt(f,m)&&v++<30);return o.x=f,o.y=m,o}function ace(o,f){Xo.viewer=o,Xo.cesium=f}ace.prototype.createField=function(o,f){return Xo.draw(o,f),this};ace.prototype.destroy=function(){Xo.destroy()};ace.prototype.remove=function(){Xo.destroy()};var Hgt=ace;function rK(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._Buffer=new yP(o,f),this._tree=Ne}rK.prototype.createRoad=function(o={}){var f={id:o.id||this._core.getuid(),image:window.SmartEarthRootUrl+pn.road,height:1,width:20,alpha:1};f=this._core.extend(f,o,!0);let m=[];o.positions.forEach(C=>{let w=this._core.toDegrees(C);m.push([w.lon,w.lat])});let v=this._cesium.turf.lineString(m),y=this._Buffer.getBuff(v,f.width,{steps:0});this.item=this._Buffer.addBufferPolyogn(y,{material:new this._cesium.ImageMaterialProperty({image:f.image,repeat:new Cesium.Cartesian2(30,30)}),height:o.height,perPositionHeight:!1,heightReference:0,outline:!1});var x={id:f.id,name:"\u65B0\u5EFA\u9053\u8DEF\u56FE\u5C42",pId:0,type:"RoadLayer",item:this};return this.setTreeobj(x),this._tree.insertGroupId(x,0),this};rK.prototype.setTreeobj=function(o){this.treeobj=o};rK.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item)};rK.prototype.setVisibility=function(o){this.item&&(this.item.show=o)};var Ugt=rK;var aOe=null;function Ggt(o,f){aOe=f,this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}Ggt.prototype.createHawkeye=function(o,f){var m=document.createElement("div");m.id="Hawkeye",m.style.position="absolute",m.style.width="15%",m.style.height="20%",m.style.bottom="0",m.style.right="0",m.style.pointerEvents="none",f&&(f.width&&(m.style.width=f.width),f.height&&(m.style.height=f.height),f.bottom&&(m.style.bottom=f.bottom),f.right&&(m.style.right=f.right),f.top&&(m.style.top=f.top,m.style.bottom="unset"),f.left&&(m.style.left=f.left,m.style.right="unset")),this._viewer.container.appendChild(m);let v;o.url?v=new this._cesium.SingleTileImageryProvider({url:o.url}):v=o.imageryProvider;var y=new this._cesium.Viewer("Hawkeye",{imageryProvider:v,baseLayerPicker:!1,shadows:!1,shouldAnimate:!0,animation:!0,scene3DOnly:!0,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1});y._cesiumWidget._creditContainer.style.display="none";var x=this;let C=this._core.defaultValue(f&&f.height,1e4);function w(){let A=x._viewer.camera.position,E=aOe.Cartographic.fromCartesian(A);E.height+=C,y.camera.setView({destination:aOe.Cartographic.toCartesian(E),orientation:{heading:x._viewer.camera.heading,pitch:x._viewer.camera.pitch,roll:x._viewer.camera.roll}})}return x._viewer.scene.preRender.addEventListener(w),this.close=function(){x._viewer.scene.preRender.removeEventListener(w),y.destroy(),m.remove(),x.close=void 0},this};var Wgt=Ggt;function dk(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne}dk.prototype.createBillboard=function(o={}){let f=this._core.defaultValue(o.id,this._core.getuid()),m={horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.BOTTOM,scale:o.scale||1,image:o.image,color:this._cesium.Color.WHITE,disableDepthTestDistance:1/0,distanceDisplayCondition:o.distanceDisplayCondition},v;if(o.text)switch(v={text:o.text,font:`${o.fontSize||12}px \u5FAE\u8F6F\u96C5\u9ED1`,pixelOffset:o.fontOffset,fillColor:Cesium.Color.fromCssColorString(o.fontColor||"#fff"),horizontalOrigin:Cesium.HorizontalOrigin.CENTER,verticalOrigin:Cesium.VerticalOrigin.CENTER,disableDepthTestDistance:1/0,distanceDisplayCondition:o.distanceDisplayCondition},o.textLocation){case"left":v.horizontalOrigin=Cesium.HorizontalOrigin.LEFT;break;case"right":v.horizontalOrigin=Cesium.HorizontalOrigin.RIGHGT;break;case"up":v.verticalOrigin=Cesium.VerticalOrigin.TOP;break;case"down":v.verticalOrigin=Cesium.VerticalOrigin.BOTTOM;break}return this.item=this._viewer.entities.add({id:f,show:o.visibility,position:Cesium.Cartesian3.fromDegrees(o.lon,o.lat,o.height),label:v,billboard:m}),this.item.objectType="Billboard",o.data&&(this.item.data=o.data),this};dk.prototype.createBillboardbatch=function(o){for(var f={show:!0,position:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,eyeOffset:this._cesium.Cartesian3.ZERO,heightReference:this._cesium.HeightReference.NONE,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,scale:1,image:"",imageSubRegion:void 0,color:this._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},m=0;m<o.length;m++){var v=o[m];f.image=v.image;var y=this._viewer.entities.add({name:"",position:this._cesium.Cartesian3.fromDegrees(v.log,v.lat,v.height),billboard:f})}return this};dk.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show._value,f=this.item.box.dimensions==null?void 0:this.item.box.dimensions.getValue(),m=this.item.box.fill==null?void 0:this.item.box.fill._value,v=this.item.box.material;v!=null&&(v={color:v.color._value==null?void 0:"rgba("+v.color._value.red+","+v.color._value.green+","+v.color._value.blue+","+v.color._value.alpha+")",image:v.image==null?void 0:v.image._value,diffusemap:v.diffusemap==null?void 0:v.diffusemap._value,alphamap:v.alphamap==null?void 0:v.alphamap._value});var y=this.item.box.outline==null?void 0:this.item.box.outline._value,x=this.item.box.outlineColor==null?void 0:"rgba("+this.item.box.outlineColor._value.red+","+this.item.box.outlineColor._value.green+","+this.item.box.outlineColor._value.blue+","+this.item.box.outlineColor._value.alpha+")",C=this.item.box.outlineWidth==null?void 0:this.item.box.outlineWidth._value,w=this.item.box.distanceDisplayCondition,A=w?._value.near,E=w?._value.far,T=this._cesium.Cartographic.fromCartesian(this.item.position._value),S=this._cesium.Math.toDegrees(T.longitude),M=this._cesium.Math.toDegrees(T.latitude),I=this._cesium.Math.toDegrees(T.height);return{type:"box",position:{x:S,y:M,z:I},treeobj:{id:this.treeobj.id,name:this.treeobj.name,pId:this.treeobj.pId,type:this.treeobj.type},style:{show:o,dimensions:f,fill:m,material:v,outline:y,outlineColor:x,outlineWidth:C,near:A,far:E}}};dk.prototype.setTreeobj=function(o){this.treeobj=o};dk.prototype.setVisibility=function(o){this.item&&(this.item.show=b)};dk.prototype.deleteObject=function(){this.item&&this._viewer.entities.remove(this.item),this.item=void 0};var sOe=dk;function fk(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this._Provider=void 0}fk.prototype.createKmlLayer=function(o,f,m){var v={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},y=f,x={uri:y,heightReference:this._cesium.HeightReference.CLAMP_TO_GROUND,minimumPixelSize:128,maximumScale:20,scale:1,runAnimations:!1},C={show:!0,position:this._cesium.Cartesian3.ZERO,pixelOffset:this._cesium.Cartesian2.ZERO,eyeOffset:this._cesium.Cartesian3.ZERO,heightReference:this._cesium.HeightReference.NONE,horizontalOrigin:this._cesium.HorizontalOrigin.CENTER,verticalOrigin:this._cesium.VerticalOrigin.CENTER,scale:1,image:y,imageSubRegion:void 0,color:this._cesium.Color.WHITE,id:void 0,rotation:0,alignedAxis:this._cesium.Cartesian3.ZERO,width:void 0,height:void 0,scaleByDistance:void 0,translucencyByDistance:void 0,pixelOffsetScaleByDistance:void 0,sizeInMeters:!1,distanceDisplayCondition:void 0},w=this;this._cesium.KmlDataSource.load(o,v).then(function(A){var E=A.entities;if(m=="model")for(var T=0;T<A.entities.values.length;T++)var S=A.entities.values[T],M=w._viewer.entities.add({name:"",position:S.position,model:{uri:y,heightReference:w._cesium.HeightReference.CLAMP_TO_GROUND,minimumPixelSize:128,maximumScale:20,scale:1,runAnimations:!1}});else if(m=="billboard"){for(var I=w._core.extend(C,option,!0),T=0;T<A.entities.values.length;T++){var S=A.entities.values[T];I.position=S.position._value,billboardCollections.add(I)}var P=w._viewer.scene.primitives.add(billboardCollections)}})};fk.prototype.addKmlLayer=function(o,f,m,v){var y={camera:this._viewer.scene.camera,canvas:this._viewer.scene.canvas},x=this;let C=f,w;C.id&&(w=C.id,C=C.url);var A=this._cesium.KmlDataSource.load(C,y);this._viewer.dataSources.add(A),A.then(function(T){x.item=T,m||x.setVisibility(!1),v&&typeof v=="function"&&v(T)});var E={id:w||this._core.getuid(),name:o,pId:0,type:"KML",item:this};return this.setTreeobj(E),this._tree.insertGroupId(E,0),this};fk.prototype.export=function(){var o=this.item.show==null?void 0:this.item.show,f=this.treeobj.url;return{type:this.treeobj.type,treeobj:{name:this.treeobj.name,pId:this.treeobj.pId},style:{show:o,url:f}}};fk.prototype.deleteObject=function(){this._viewer.dataSources.remove(this.item)};fk.prototype.setTreeobj=function(o){this.treeobj=o};fk.prototype.setVisibility=function(o){this.item!=null&&(this.item.show=o)};var lOe=fk;function nK(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._tree=Ne,this.texturePixel=1024}nK.prototype.createModifyMesh=function(o,f,m,v,y){var x=f.length,C=new Array(x);C.fill(m);var w=v.id||Cesium.createGuid(),A=Date.now(),E=Cesium.Rectangle.fromCartesianArray(f);v.modifyMeshObject===void 0&&(v.modifyMeshObject=[]);var T={id:w,show:!0,name:o,rectangle:E,vertices:f,polygon:f,heights:C,meshObject:v,timeStamp:A,polygonGeometry:new Cesium.PolygonGeometry({polygonHierarchy:new Cesium.PolygonHierarchy(f)}),image:this.createTexture(f),texture:null};return v.modifyMeshObject=T,this.item=v,this};nK.prototype.createTexture=function(o){var f=Cesium.Rectangle.fromCartesianArray(o),m=f.west*180/Math.PI,v=f.south*180/Math.PI,y=f.east*180/Math.PI,x=f.north*180/Math.PI,C=new Cesium.Rectangle(m,v,y,x),w=[],A=this;o.forEach(function(S){var M=S.longitude?S:Cesium.Ellipsoid.WGS84.cartesianToCartographic(S);M=A.getPointRelativePosition(M,C,A.texturePixel,A.texturePixel),w.push([M.normalizedLongitude,M.normalizedLatitude])});var E=this.createCanvas(w,"#FF0000",A.texturePixel,A.texturePixel),T=new Image;return T.width=A.texturePixel,T.height=A.texturePixel,T.src=E.toDataURL("image/png"),T};nK.prototype.getPointRelativePosition=function(o,f,m,v){var y=f.east-f.west,x=f.north-f.south,C=o.longitude*180/Math.PI,w=o.latitude*180/Math.PI;return o.normalizedLongitude=(C-f.west)/y*m,o.normalizedLatitude=(w-f.south)/x*v,o};nK.prototype.createCanvas=function(o,f,m,v){var y=document.createElement("canvas");y.width=m,y.height=v;var x=y.getContext("2d");if(x.fillStyle="#000",x.fillRect(0,0,m,m),!(o.length<=0)){x.moveTo(o[0][0],o[0][1]);for(var C=0;C<o.length;C++)x.lineTo(o[C][0],o[C][1]);return x.fillStyle=f,x.fill(),y}};nK.prototype.remove=function(){this.item.modifyMeshObject=void 0};var a0=null;function pk(o,f){a0=f,this._viewer=o,this._core=new Sr(o,a0)}pk.prototype.addClipping=function(o,f={}){if(this.remove(),f.type==="polygon"){let m=f.positions,v=[];m.forEach(w=>{v.push(this._core.toDegrees(w))}),v.push(v[0]);let y;f.isInner?y=this.isClockWise(v):y=!this.isClockWise(v),y&&v.reverse();let x=[],C=this.getInverseTransform(o);for(let w=0;w<v.length-1;w++){let A=this.createPlane(v[w],v[w+1],C);x.push(A)}o.clippingPlanes=new a0.ClippingPlaneCollection({planes:x,unionClippingRegions:!f.isInner})}return this.item=o,this};pk.prototype.getInverseTransform=function(o){let f,m=o.root.transform;return m&&m.equals(a0.Matrix4.IDENTITY)||!m?f=a0.Transforms.eastNorthUpToFixedFrame(o.boundingSphere.center):f=a0.Matrix4.fromArray(o.root.transform),a0.Matrix4.inverseTransformation(f,new a0.Matrix4)};pk.prototype.getOriginCoordinateSystemPoint=function(o,f){let m=a0.Cartesian3.fromDegrees(o.lon,o.lat);return a0.Matrix4.multiplyByPoint(f,m,new a0.Cartesian3(0,0,0))};pk.prototype.createPlane=function(o,f,m){let v=this.getOriginCoordinateSystemPoint(o,m),y=this.getOriginCoordinateSystemPoint(f,m),x=new a0.Cartesian3(0,0,1),C=a0.Cartesian3.subtract(y,v,new a0.Cartesian3),w=a0.Cartesian3.cross(C,x,new a0.Cartesian3);w=a0.Cartesian3.normalize(w,w);let A=a0.Plane.fromPointNormal(v,w);return a0.ClippingPlane.fromPlane(A)};pk.prototype.isClockWise=function(o){if(o.length<3)return null;o[0]===o[o.length-1]&&(o=o.slice(0,o.length-1));let f={i:-1,val:90};for(let A=0;A<o.length;A++){let{lat:E}=o[A];E<f.val&&(f.val=E,f.i=A)}let m=(f.i+o.length-1)%o.length,v=f.i,y=(f.i+1)%o.length,x={lat:o[v].lat-o[m].lat,lon:o[v].lon-o[m].lon},C={lat:o[y].lat-o[v].lat,lon:o[y].lon-o[v].lon},w=C.lon*x.lat-x.lon*C.lat;return w===0?o[y].lon<o[m].lon:w>0};pk.prototype.remove=function(){this.item&&this.item.clippingPlanes&&this.item.clippingPlanes.removeAll(),this.item&&(this.item.clippingPlanes=void 0)};var jgt=pk;function mG(o,f){this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._color=new no(this._viewer,this._cesium),this._tree=Ne,this.item={show:!0},this._option=void 0,this._primitive=void 0,this._Provider=void 0}mG.prototype.CreateWMSImageFeatureLayer=function(o,f,m,v,y,x,C){var w={url:"",queryParameters:{layers:"",style:"",transparent:!0,srs:"EPSG:4326",service:"WMS",request:"GetMap",version:"1.1.1",format:"image/png",bbox:"{westProjected},{southProjected},{eastProjected},{northProjected}",width:"256",height:"256"}},A=w;A.url=f.url,A.queryParameters=this._core.extend(A.queryParameters,f.queryParameters,!0);var E=m;f==null&&console.log("options is required");var T=this;this._Provider=new ol(this._viewer,this._cesium),this._Provider.loadTile=function(P,D){(function(L,R,O,F,k){if(D.state===Cesium.QuadtreeTileLoadState.START){if(D.data={lines:[],geometryPrimitive:void 0},D.level>=(v.level_min||1)&&D.level<(v.level_max||22)&&F.item.show){var U=new Cesium.Rectangle(0,0,0,0),G=k._tilingScheme.tileXYToRectangle(L.x,L.y,L.level,U);A.queryParameters.bbox=U.west*180/Math.PI+","+U.south*180/Math.PI+","+U.east*180/Math.PI+","+U.north*180/Math.PI;var j=new Cesium.Resource(A);j.fetchImage().then(function(q){var J=new Cesium.GroundPrimitive({geometryInstances:[{geometry:new Cesium.RectangleGeometry({rectangle:U})}],appearance:new Cesium.Appearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:q}}})})});J.cusResource=O,D.data.geometryPrimitive=J,D.state=Cesium.QuadtreeTileLoadState.LOADING,D.state===Cesium.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive.update(R,[]),D.state=Cesium.QuadtreeTileLoadState.DONE,D.renderable=!0)},function(q){console.log(q)}),D.state=Cesium.QuadtreeTileLoadState.LOADING}else{D.state=Cesium.QuadtreeTileLoadState.DONE,D.renderable=!0;return}D.state=Cesium.QuadtreeTileLoadState.LOADING}})(D,P,E,T,this)},this._primitive=new T._cesium.QuadtreePrimitivezh({tileProvider:this._Provider});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),this._primitive.show=this.item.show,this.item=this._primitive,x||this.setVisibility(!1),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+f.id);var I={id:f.id,name:o,checked:!0,pId:this._core.isnull(y)?0:y,type:"rasterLayer",item:this,options:this._option,queryOptions:this._queryOption};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(y)?0:y),typeof C=="function"&&C(this.item),this};mG.prototype.CreateVectorImageFeatureLayer=function(o,f,m,v,y,x,C){var w={url:"",queryParameters:{layer:"",style:"",tilematrixset:"EPSG:4326",Service:"WMTS",Request:"GetTile",Version:"1.0.0",Format:"image/png",TileMatrix:"EPSG:4326:",TileCol:"",TileRow:""}};this._option=this._core.extend(w,f,!0),this._queryOption=m;var A=this._core.extend(w,f,!0),E=m;f==null&&console.log("options is required");var T=this;this._Provider=new ol(this._viewer,this._cesium),this._Provider.loadTile=function(P,D){(function(L,R,O,F,k){if(D.state===Cesium.QuadtreeTileLoadState.START){if(D.data={lines:[],geometryPrimitive:void 0},D.level>=v.level_min&&D.level<v.level_max&&F.item.show){A.queryParameters.TileMatrix=A.queryParameters.tilematrixset+":"+L.level,A.queryParameters.TileCol=L.x,A.queryParameters.TileRow=L.y;var U=new Cesium.Resource(A);U.fetchImage().then(function(G){var j=new Cesium.Rectangle(0,0,0,0),q=k._tilingScheme.tileXYToRectangle(L.x,L.y,L.level,j),J=new Cesium.GroundPrimitive({geometryInstances:[{geometry:new Cesium.RectangleGeometry({rectangle:j})}],appearance:new Cesium.Appearance({material:new Cesium.Material({fabric:{type:"Image",uniforms:{image:G}}})})});J.cusResource=O,D.data.geometryPrimitive=J,D.state=Cesium.QuadtreeTileLoadState.LOADING,D.state===Cesium.QuadtreeTileLoadState.LOADING&&(D.data.geometryPrimitive.update(R,[]),D.state=Cesium.QuadtreeTileLoadState.DONE,D.renderable=!0)},function(G){console.log(G)}),D.state=Cesium.QuadtreeTileLoadState.LOADING}else{D.state=Cesium.QuadtreeTileLoadState.DONE,D.renderable=!0;return}D.state=Cesium.QuadtreeTileLoadState.LOADING}})(D,P,E,T,this)},this._primitive=new T._cesium.QuadtreePrimitivezh({tileProvider:this._Provider});var S=this._viewer.scene,M=S.primitives;M.add(this._primitive),this._primitive.show=this.item.show,this.item=this._primitive,x||this.setVisibility(!1),this._core.isnull(f.id)&&(f.id=this._core.getuid()),this._core.isnull(o)&&(o="\u65B0\u5EFA\u56FE\u5C42"+f.id);var I={id:f.id,name:o,checked:!0,pId:this._core.isnull(y)?0:y,type:"rasterLayer",item:this,options:this._option,queryOptions:this._queryOption};return this.setTreeobj(I),this._tree.insertGroupId(I,this._core.isnull(y)?0:y),typeof C=="function"&&C(this.item),this};mG.prototype.setTreeobj=function(o){this.treeobj=o};mG.prototype.setVisibility=function(o){try{this.item!=null&&this.item.show!=null&&(this.item.show=o),this._Provider&&this._Provider.setStatus&&this._Provider.setStatus(o)}catch{}};mG.prototype.deleteObject=function(){this._viewer.scene.primitives.remove(this.item);try{this._Provider.remove()}catch{}};var Ygt=mG;var uOe,sce=null;function cOe(o,f){sce=f,this._viewer=o,uOe=o}cOe.prototype.findDirectParent=function(o){try{var f=[];if(o.width==Math.PI)return null;for(var m=0;m<uOe.scene.globe._surface._tilesToRender.length;m++){var v=uOe.scene.globe._surface._tilesToRender[m],y=v._rectangle;sce.Rectangle.intersection(y,o)&&f.push(v)}return f}catch{}return null};cOe.prototype.createTerrainModifier=function(o,f,m){var v=f.length,y=new Array(v);y.fill(m);var x=sce.createGuid(),C=Date.now(),w=sce.Rectangle.fromCartesianArray(f),A=this.findDirectParent(w);this._viewer.terrainProvider&&this._viewer.terrainProvider._modifyTerrainObjects===void 0&&(this._viewer.terrainProvider._modifyTerrainObjects=[]);var E=this._viewer,T={id:x,name:o,show:!0,rectangle:w,vertices:f,heights:y,timeStamp:C,remove:function(){if(E.terrainProvider&&E.terrainProvider._modifyTerrainObjects)for(var M=E.terrainProvider._modifyTerrainObjects.length-1;M>=0;M--){var I=E.terrainProvider._modifyTerrainObjects[M];I.id==x&&E.terrainProvider._modifyTerrainObjects.splice(M,1)}if(A)try{for(var M=0;M<A.length;M++)try{A[M]._parent.freeResources()}catch{}}catch{}}};if(this._viewer.terrainProvider._modifyTerrainObjects.push(T),A)try{for(var S=0;S<A.length;S++)try{A[S]._parent.freeResources()}catch{}}catch{}return T};var qgt=cOe;var m8i=`uniform sampler2D specularMap; uniform sampler2D normalMap; uniform vec4 baseWaterColor; uniform vec4 blendColor; uniform float frequency; uniform float animationSpeed; uniform float amplitude; uniform float specularIntensity; uniform float fadeFactor; uniform vec4 sizeAndVelocity; czm_material czm_getMaterial(czm_materialInput materialInput) { float width = sizeAndVelocity.x; float height = sizeAndVelocity.y; float vx = sizeAndVelocity.z; float vy = sizeAndVelocity.w; czm_material material = czm_getDefaultMaterial(materialInput); float time = czm_frameNumber * animationSpeed; // fade is a function of the distance from the fragment and the frequency of the waves float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor); // note: not using directional motion at this time, just set the angle to 0.0; vec2 st = materialInput.st * vec2(width, height) / 100.0 * frequency; st -= vec2(vx*time, vy*time); vec4 noise = czm_getWaterNoise(normalMap, st, time, 0.0); vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude)); // fade out the normal perturbation as we move further from the water surface normalTangentSpace.xy /= fade; normalTangentSpace = normalize(normalTangentSpace); // get ratios for alignment of the new normal vector with a vector perpendicular to the tangent plane float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0); // base color is a blend of the water and non-water color based on the value from the specular map // may need a uniform blend factor to better control this vec2 v = gl_FragCoord.xy / czm_viewport.zw; v.y = 1.0 - v.y; material.diffuse = texture(specularMap, v + noise.xy*0.03).rgb; // diffuse highlights are based on how perturbed the normal is material.diffuse += (0.1 * tsPerturbationRatio); material.diffuse = mix(baseWaterColor.rgb, material.diffuse, blendColor.rgb); material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace); material.specular = specularIntensity; material.shininess = 10.0; material.alpha = baseWaterColor.a * blendColor.a; return material; }`,Xgt=m8i;var ZT=null;function Jgt(o){o._colorTexture&&!o._colorTexture.isDestroyed()?o._colorTexture.destroy():o._colorTexture&&(o._colorTexture.destroy=function(){console.log("destroy")},o._colorTexture=null),o._depthStencilTexture&&!o._depthStencilTexture.isDestroyed()&&(o._depthStencilTexture.destroy(),o._depthStencilTexture=null)}function Kgt(o){o._framebuffer&&!o._framebuffer.isDestroyed()&&(o._framebuffer.destroy(),o._framebuffer=null)}function g8i(o,f,m,v){Jgt(o),Kgt(o),o._colorTexture=new ZT.Texture({context:f,width:m,height:v,pixelFormat:ZT.PixelFormat.RGBA,pixelDatatype:ZT.PixelDatatype.UNSIGNED_BYTE}),o._depthStencilTexture=new ZT.Texture({context:f,width:m,height:v,pixelFormat:ZT.PixelFormat.DEPTH_STENCIL,pixelDatatype:ZT.PixelDatatype.UNSIGNED_INT_24_8}),o._framebuffer=new ZT.Framebuffer({context:f,colorTextures:[o._colorTexture],depthStencilTexture:o._depthStencilTexture,destroyAttachments:null})}function oK(o){ZT=o,this._framebuffer=null,this._colorTexture=null,this._textureChangedEvent=new ZT.Event}oK.prototype.getTextureChangedEvent=function(){return this._textureChangedEvent};oK.prototype.update=function(o,f,m){var v=this._colorTexture;let y=!1;(!ZT.defined(v)||v.width!==f||v.height!==m)&&(y=!0),!ZT.defined(this._framebuffer)&&y&&(g8i(this,o,f,m),this._textureChangedEvent.raiseEvent(this._colorTexture))};oK.prototype.isDestroyed=function(){return!1};oK.prototype.destroy=function(){Jgt(this),Kgt(this)};var Qgt=oK;var Gd=null,Zgt,$gt,e0t,t0t,_8i=null,i0t,r0t;function v8i(o,f,m,v,y){let x=f._frameState;if(!Gd.defined(f.debugCommandFilter)||f.debugCommandFilter(o))if(o instanceof Gd.ClearCommand)o.execute(m,v);else{x.useLogDepth&&Gd.defined(o.derivedCommands.logDepth)&&(o=o.derivedCommands.logDepth.command);let C=x.passes;!C.pick&&f._hdr&&Gd.defined(o.derivedCommands)&&Gd.defined(o.derivedCommands.hdr)&&(o=o.derivedCommands.hdr.command),!C.pick&&!C.depth&&!f.debugShowCommands&&!f.debugShowFrustums&&o.execute(m,v)}}function y8i(o,f,m,v){Gd=v,Zgt=new Gd.PerspectiveFrustum,$gt=new Gd.PerspectiveOffCenterFrustum,e0t=new Gd.OrthographicFrustum,t0t=new Gd.OrthographicOffCenterFrustum,_8i=null,i0t=Gd.Cesium3DTilePassState&&new Gd.Cesium3DTilePassState({pass:Gd.Cesium3DTilePass.RENDER}),r0t=Gd.OctahedralProjectedCubeMap.prototype.update;let y=new Gd.Camera(o),x=o.context,C=o._view.passState;y=Gd.Camera.clone(o.camera,y);let w=y.positionCartographic,A=y.pitch,E=y.heading,T=y.roll;y.setView({destination:Gd.Cartesian3.fromRadians(w.longitude,w.latitude,f+f-w.height),orientation:{heading:E,pitch:-A,roll:T}});let S=.5*o.context.drawingBufferWidth,M=.5*o.context.drawingBufferHeight;C.viewport.x=0,C.viewport.y=0,C.viewport.width=S,C.viewport.height=M,m.update(x,S,M),C.framebuffer=m._framebuffer;let I=o._clearColorCommand;Gd.Color.multiplyByScalar(Gd.Color.DEEPSKYBLUE,.1,I.color),I.color.alpha=1,I.execute(x,C);let P=o._depthClearCommand,D=x.uniformState;D.updateCamera(y),D.seWaterHeight=f;let L;Gd.defined(y.frustum.fov)?L=y.frustum.clone(Zgt):Gd.defined(y.frustum.infiniteProjectionMatrix)?L=y.frustum.clone($gt):Gd.defined(y.frustum.width)?L=y.frustum.clone(e0t):L=y.frustum.clone(t0t),L.near=y.frustum.near,L.far=y.frustum.far,D.updateFrustum(L);let R=o._frameState;R.passes.render=!0,R.tilesetPassState=i0t,o.frameState.commandList.length=0,Gd.OctahedralProjectedCubeMap.prototype.update=function(){},o._primitives.update(R),Gd.OctahedralProjectedCubeMap.prototype.update=r0t,o._view.createPotentiallyVisibleSet(o);let O,F,k=o._view.frustumCommandsList;for(let U=0;U<k.length;U++){let G=k.length-U-1,j=k[G];G!==0?L.near=j.near*o.opaqueFrustumNearOffset:L.near=j.near,L.far=j.far,D.updateFrustum(L),P.execute(x,C),D.updatePass(Gd.Pass.CESIUM_3D_TILE),O=j.commands[Gd.Pass.CESIUM_3D_TILE],F=j.indices[Gd.Pass.CESIUM_3D_TILE];for(let q=0;q<F;q++)v8i(O[q],o,x,C)}C.framebuffer=0,D.seWaterHeight=-5e3}var n0t=y8i;function Pb(o,f,m){this._cesium=m,this._option={baseWaterColor:o.baseWaterColor||new m.Color(.2,.3,.6,1),blendColor:o.blendColor||new m.Color(.5,.5,.5,.7),animationSpeed:o.animationSpeed||.05,amplitude:o.amplitude||2,frequency:o.frequency||5e3,specularIntensity:o.specularIntensity||.5,fadeFactor:o.fadeFactor||1,sizeAndVelocity:o.sizeAndVelocity||new m.Cartesian4(100,100,10,0),width:o.width||100,height:o.height||100},S8i(this._option,this._cesium),this._scene=f,this._wTexture=new Qgt(this._cesium),this._trackedPrimitives=[];let v=this;this._disposeListener=this._scene.preRender.addEventListener(function(){let y=v._scene.camera,x=y.frustum.computeCullingVolume(y.positionWC,y.directionWC,y.upWC);if(v._trackedPrimitives.some(function(w){if(!w.show)return null;let A=w._boundingSphereWC||w._boundingVolumes,E=null;return A&&(E=A.some(function(T){return x.computeVisibility(T)!==m.Intersect.OUTSIDE})),E})){let w=Number.MAX_VALUE,A=null;v._trackedPrimitives.forEach(function(E){if(E.show){let T=E._boundingSphereWC||E._boundingVolumes,S;if(T&&(S=T.some(function(M){return x.computeVisibility(M)!==m.Intersect.OUTSIDE})),S){let M=m.Cartesian3.distanceSquared(E.centerPos,y.positionWC)-E.radius;w>M&&(w=M,A=E)}}}),A&&n0t(v._scene,A.waterHeight,v._wTexture,v._cesium)}}),console.log(window.nowView=this),this._createDebugView(),this.debugShow(!1)}function x8i(o,f){let m=f.ModelUtility.getAttributeOrUniformBySemantic(o,"_BATCHID");return f.defined(m)||(m=f.ModelUtility.getAttributeOrUniformBySemantic(o,"BATCHID"),f.defined(m)&&f.Batched3DModel3DTileContent._deprecationWarning("b3dm-legacy-batchid","The glTF in this b3dm uses the semantic `BATCHID`. Application-specific semantics should be prefixed with an underscore: `_BATCHID`.")),m}function C8i(o,f){return function(m,v){let y=o._batchTable,x=!f.defined(o._classificationType),C=o._model.gltf;f.defined(C)&&(o._batchIdAttributeName=x8i(C,f),o._diffuseAttributeOrUniformName[v]=f.ModelUtility.getDiffuseAttributeOrUniform(C,v)),m=f.ShaderSource.replaceMain(m,"gltf_seWater_main"),m+=`uniform mat4 u_inverseElevationMatrix; out vec3 v_elevationPos; void main() { gltf_seWater_main(); v_elevationPos = (u_inverseElevationMatrix * vec4(a_position, 1.0)).xyz; } `;let w=y.getVertexShaderCallback(x,o._batchIdAttributeName,o._diffuseAttributeOrUniformName[v]);return f.defined(w)?w(m):m}}function b8i(o,f){return function(m,v){let y=o._batchTable,x=!f.defined(o._classificationType),C=o._model.gltf;f.defined(C)&&(o._diffuseAttributeOrUniformName[v]=f.ModelUtility.getDiffuseAttributeOrUniform(C,v)),m=f.ShaderSource.replaceMain(m,"gltf_seWater_main"),m+=`in vec3 v_elevationPos; void main() { if (czm_seWaterHeight > -5000.0 && v_elevationPos.z < czm_seWaterHeight) { discard; } gltf_seWater_main(); } `;let w=y.getFragmentShaderCallback(x,o._diffuseAttributeOrUniformName[v],!1);return f.defined(w)?w(m):m}}function w8i(o,f){let m=o._batchTable;return o._batchTable.featuresLength===0?function(v){let y={u_inverseElevationMatrix:function(x){let C=o._model,w=typeof C._elevationMatrix;if(w==="undefined")return f.Matrix4.IDENTITY;if(w==="function"?C._uniformInverseElevationMatrix=C._elevationMatrix(C._uniformInverseElevationMatrix):f.Matrix4.clone(C._elevationMatrix,C._uniformInverseElevationMatrix),f.Matrix4.inverse(C._uniformInverseElevationMatrix,C._uniformInverseElevationMatrix),C._rtcCenter){let A=new f.Matrix4,E=f.Matrix4.fromTranslation(C._rtcCenter,A);f.Matrix4.multiply(C._uniformInverseElevationMatrix,E,C._uniformInverseElevationMatrix)}return C._uniformInverseElevationModelMatrix||(C._uniformInverseElevationModelMatrix=new f.Matrix4),x&&x.model?(C._uniformInverseElevationModelMatrix=f.Matrix4.multiply(C._uniformInverseElevationMatrix,x.model,C._uniformInverseElevationModelMatrix),C._uniformInverseElevationModelMatrix):f.Matrix4.IDENTITY}};return f.combine(v,y)}:function(v){let y={tile_batchTexture:function(){return defaultValue(m._batchTexture.batchTexture,m._batchTexture.defaultTexture)},tile_textureDimensions:function(){return m._batchTexture.textureDimensions},tile_textureStep:function(){return m._batchTexture.textureStep},tile_colorBlend:function(){return getColorBlend(m)},tile_pickTexture:function(){return m._batchTexture.pickTexture},u_inverseElevationMatrix:function(x){let C=o._model,w=typeof C._elevationMatrix;if(w==="undefined")return f.Matrix4.IDENTITY;if(w==="function"?C._uniformInverseElevationMatrix=C._elevationMatrix(C._uniformInverseElevationMatrix):f.Matrix4.clone(C._elevationMatrix,C._uniformInverseElevationMatrix),f.Matrix4.inverse(C._uniformInverseElevationMatrix,C._uniformInverseElevationMatrix),C._rtcCenter){let A=new f.Matrix4,E=f.Matrix4.fromTranslation(C._rtcCenter,A);f.Matrix4.multiply(C._uniformInverseElevationMatrix,E,C._uniformInverseElevationMatrix)}return C._uniformInverseElevationModelMatrix||(C._uniformInverseElevationModelMatrix=new f.Matrix4),C._uniformInverseElevationModelMatrix=f.Matrix4.multiply(C._uniformInverseElevationMatrix,x.model,C._uniformInverseElevationModelMatrix),C._uniformInverseElevationModelMatrix}};return f.combine(v,y)}}function A8i(o){this._size=o.size,this._datatype=o.datatype,this.getValue=o.getValue}function E8i(o,f,m){try{let v=m.Ellipsoid.WGS84,y=v.scaleToGeodeticSurface(o);return f=m.Transforms.eastNorthUpToFixedFrame(y,v,f),f}catch{return m.Matrix4.clone(m.Matrix4.IDENTITY,f)}}function T8i(o){o.AutomaticUniforms.czm_seWaterHeight||(o.AutomaticUniforms.czm_seWaterHeight=new A8i({size:1,datatype:o.WebGLConstants.FLOAT,getValue:function(m){return m.seWaterHeight?m.seWaterHeight:-5e3}}),o.ShaderSource._czmBuiltinsAndUniforms.czm_seWaterHeight="uniform float czm_seWaterHeight;");var f=o.Cesium3DTileset.prototype.update;o.Cesium3DTileset.prototype.update=function(m){f.call(this,m),this.show&&this.ready&&(this._autoElevationMatrix=E8i(this.boundingSphere.center,this._autoElevationMatrix,o))},o.Cesium3DTileContentFactory.b3dm=function(m,v,y,x,C){if(m.enableModelExperimental)return o.ModelExperimental3DTileContent.fromB3dm(m,v,y,x,C);let w=new o.Batched3DModel3DTileContent(m,v,y,x,C);return w._model instanceof o.ClassificationModel||(w._model._elevationMatrix=function(A){let E=m._elevationMatrix||m._autoElevationMatrix||o.Matrix4.IDENTITY;return A=o.Matrix4.clone(E,A),A},w._model._uniformMapLoaded=w8i(w,o),w._model._vertexShaderLoaded=C8i(w,o),w._model._fragmentShaderLoaded=b8i(w,o)),w},o.ShaderProgram.prototype._setUniforms=function(m,v,y){let x,C;if(o.defined(m)){let E=this._manualUniforms;for(x=E.length,C=0;C<x;++C){let T=E[C];T.value=m[T.name](v)}}let w=this._automaticUniforms;for(x=w.length,C=0;C<x;++C){let E=w[C];E.uniform.value=E.automaticUniform.getValue(v)}let A=this._uniforms;for(x=A.length,C=0;C<x;++C)A[C].set();if(y){let E=this._gl,T=this._program;E.validateProgram(T)}}}function S8i(o,f){let m=o.baseWaterColor||new f.Color(.2,.3,.6,1),v=o.blendColor||new f.Color(.5,.5,.5,.7),y=o.animationSpeed||.05,x=o.amplitude||2,C=o.frequency||5e3,w=o.specularIntensity||.5,A=o.fadeFactor||1,E=o.sizeAndVelocity||new f.Cartesian4(100,100,10,0),T=o.width||316,S=o.height||316;T8i(f),f.Material._materialCache.addMaterial("SEWater",{fabric:{type:"SEWater",uniforms:{baseWaterColor:m,blendColor:v,specularMap:f.Material.DefaultImageId,normalMap:f.Material.DefaultImageId,frequency:C,animationSpeed:y,amplitude:x,specularIntensity:w,fadeFactor:A,sizeAndVelocity:E},source:Xgt},translucent:function(M){var I=M.uniforms;return I.baseWaterColor.alpha<1||I.blendColor.alpha<1}})}Pb.prototype._createDebugView=function(){let o=this._cesium.Material.fromType("Image"),f=new this._cesium.ViewportQuad(new this._cesium.BoundingRectangle(0,100,300,300));f.material=o,this._debugViewportQuad=this._scene.primitives.add(f);let m=this._getWaterReflectTexture();m&&(o.uniforms.image=m)};Pb.prototype.debugShow=function(o){this._debugViewportQuad.show=o};Pb.prototype.isDebugShow=function(){return this._debugViewportQuad.show};Pb.prototype._getWaterReflectTexture=function(){return this._wTexture._colorTexture};Pb.prototype._getWaterReflectTextureChangedEvent=function(){return this._wTexture._textureChangedEvent};Pb.prototype._createWaterMaterial=function(){var o=new this._cesium.Material({fabric:{type:"SEWater",uniforms:{specularMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),normalMap:this._cesium.buildModuleUrl("Assets/Textures/waterNormals.jpg"),frequency:this._option.frequency,animationSpeed:this._option.animationSpeed,amplitude:this._option.amplitude,width:this._option.width,height:this._option.height}}});let f=this;return o._uniforms.specularMap_0=function(){return f._wTexture._colorTexture||f._scene.context.defaultTexture},o};Pb.prototype.createWaterPolygonPrimitive=function(o){let f=this,m=this._scene,v=null,y=null;if(o.type==0)v=this._cesium.PolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),y=m.groundPrimitives.add(new this._cesium.GroundPrimitive({geometryInstances:new this._cesium.GeometryInstance({geometry:v}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL}),classificationType:this._cesium.ClassificationType.BOTH})),y.appearance.material=this._createWaterMaterial();else if(o.type==1)v=this._cesium.CoplanarPolygonGeometry.fromPositions({vertexFormat:this._cesium.MaterialAppearance.MaterialSupport.ALL.vertexFormat,positions:o.positions}),y=m.primitives.add(new this._cesium.Primitive({geometryInstances:new this._cesium.GeometryInstance({geometry:v}),appearance:new this._cesium.MaterialAppearance({materialSupport:this._cesium.MaterialAppearance.MaterialSupport.ALL})})),y.appearance.material=this._createWaterMaterial();else if(o.type==2){let C=new this._cesium.GeometryInstance({geometry:o.geometry});y=m.primitives.add(new this._cesium.Primitive({geometryInstances:C,appearance:new this._cesium.EllipsoidSurfaceAppearance({material:this._createWaterMaterial()}),asynchronous:!1}))}y.appearance.material.uniforms.sizeAndVelocity.x=o.width,y.appearance.material.uniforms.sizeAndVelocity.y=o.height,y.radius=.5*Math.max(o.width,o.height),y.centerPos=o.center;let x=this._cesium.Cartographic.fromCartesian(o.center);return y.waterHeight=x.height,this._trackPrimitive(y),y};Pb.prototype._trackPrimitive=function(o){this._trackedPrimitives.indexOf(o)<0&&this._trackedPrimitives.push(o)};Pb.prototype.destroyWaterPolygonPrimitive=function(o){this._trackedPrimitives.indexOf(o)>=0&&(this._untrackPrimitive(o),this._scene.primitives.contains(o)&&this._scene.primitives.remove(o),this._scene.groundPrimitives.contains(o)&&this._scene.groundPrimitives.remove(o))};Pb.prototype._untrackPrimitive=function(o){let f=this._trackedPrimitives.indexOf(o);f!=-1&&this._trackedPrimitives.splice(f,1)};Pb.prototype.isDestroyed=function(){return!1};Pb.prototype.destroy=function(){return this._disposeListener&&(this._disposeListener(),this._disposeListener=null),this._wTexture&&(this._wTexture.destroy(),this._wTexture=null),this._trackedPrimitives=[],this._cesium.destroyObject(this)};var o0t=Pb;function fr(o,f){if(this._viewer=o,this._cesium=f,this._core=new Sr(o,f),this._Label=new HD(this._viewer,this._cesium),this._Circle=new RP(this._viewer,this._cesium),this._Box=new zD(this._viewer,this._cesium),this._Cone=new X0(this._viewer,this._cesium),this._Color=new no(this._viewer,this._cesium),this._Polyline=new _g(this._viewer,this._cesium),this._Rectangle=new NT(this._viewer,this._cesium),this._Polygon=new gg(this._viewer,this._cesium),this._ImageLabel=new uN(this._viewer,this._cesium),this._GeoJsonFeatureLayer=new vd(this._viewer,this._cesium,this._ImageryProvidererid),this._Ellipsoid=new QO(this._viewer,this._cesium),this._PointModel=new VT(this._viewer,this._cesium),this._wall=new uk(this._viewer,this._cesium),this._Terrain=new nL(this._viewer,this._cesium),this._createdynamicObject=new WO(this._viewer,this._cesium),this._GeometryCreator,this._ImageryLayer=new rL(this._viewer,this._cesium),this._VolumeGeoJsonFeatureLayer=void 0,this._PolygonVectorGeoJsonFeatureLayer=void 0,this._skyBox=new Dle(this._viewer,this._cesium),this._flowField=new Dgt(this._viewer,this._cesium),this._canvasField=new Hgt(this._viewer,this._cesium),this.VectorGeoJsonFeatureLayer=new od(this._viewer,this._cesium),this._straightArrow=new Tle(this._viewer,this._cesium),this._SimpleGraphic=new P8(this._viewer,this._cesium),this._popupmessage=new wb(this._viewer,this._cesium),this._VectorImgFeatureLayer=Ygt,this._TerrainModifier=new qgt(this._viewer,this._cesium),!f.Resource._Implementations.createImageSGS){var m=new cA({workerPath:window.SmartEarthRootUrl+"/Workers/nullValueRemoveWorker.js"},this._cesium);f.Resource._Implementations.createImageSGS=function(v,y,x){var C=8,w={r:0,g:0,b:0,a:255};if(v.indexOf("nullvalue=")>-1){var A=v.split("nullvalue=")[1].split("&")[0],E=A.split("%2C");w.r=E[0],w.g=E[1],w.b=E[2]}if(v.indexOf("nulltolerance=")>-1)var T=v.split("nulltolerance=")[1].split("&")[0];var S=new Image,M=document.createElement("canvas"),I=M.getContext("2d");S.url=v,S.onload=function(){if(S.url!=null&&S.url.indexOf("nullvalue")!=-1){delete S.url,M.width=S.width,M.height=S.height,I.drawImage(S,0,0),S.imageProcesses=[];for(var P=S.width/C,D=S.height,L=0,R=0;R<C;R++){var O=R*P,F=I.getImageData(O,L,P,D).data;S.imageProcesses[R]=m.queueWorkItem({nullValue:w,nullTolerance:T,canvasData:F,width:P,height:D,startX:O})}Cesium.when.all(S.imageProcesses,function(k){for(var U=0;U<k.length;U++){for(var G=I.createImageData(k[U].width,k[U].height),j=0;j<k[U].canvasData.length;j++)G.data[j]=k[U].canvasData[j];I.putImageData(G,k[U].startX,0)}S.src=M.toDataURL(),x.resolve(S)}).otherwise(function(k){console.log(k)})}else x.resolve(S)},S.onerror=function(P){x.reject(P)},y&&(Cesium.TrustedServers.contains(v)?S.crossOrigin="use-credentials":S.crossOrigin=""),S.src=v}}}fr.prototype.create3DTilesets=function(o,f,m,v,y,x,C){var w=this._D3Tileset.create3DTilesets(o,f,m,v,y,x,C);return this._D3Tilesets||(this._D3Tilesets=[],this._SE3DTilesets=new Map),this._SE3DTilesets.set(w.treeobj.id,w),this._D3Tilesets.push(w.item),w};fr.prototype.set3DTilesetsAlpha=function(o){this._D3Tilesets&&this._D3Tilesets.forEach(f=>{o==0?f.style=new this._cesium.Cesium3DTileStyle({show:!1}):o==1?f.style=new this._cesium.Cesium3DTileStyle({show:!0}):f.style=new this._cesium.Cesium3DTileStyle({color:`color('rgba(255,255,255,${o})')`})})};fr.prototype.createTerrainModifier=function(o,f,m){return this._TerrainModifier.createTerrainModifier(o,f,m)};fr.prototype.createS3MLayer=function(o,f={},m){return f instanceof this._cesium.Scene&&(f={scene:f}),new Kae({url:o,...f},m,this._cesium)};fr.prototype.createWaterPolygonLayer=function(o={}){return new vle(this._viewer,this._cesium).createPolygonLayer(o)};fr.prototype.createWaterPolygon=function(o={}){return new o0t(o,this._viewer.scene,this._cesium).createWaterPolygonPrimitive(o)};fr.prototype.createCloudMap=function(o,f,m,v){var y=new gg(this._viewer,this._cesium);return y.createCloudMap(o,f,m,v)};fr.prototype.addVideoPolygon=function(o,f){var m=new gg(this._viewer,this._cesium);return m.addVideoPolygon(o,f)};fr.prototype.addVideoBox=function(o,f){var m=new gg(this._viewer,this._cesium);return m.addVideoPlane(o,f)};fr.prototype.CZML=function(o,f,m){return new wle(this._viewer,this._cesium).addCZML(o,f,m)};fr.prototype.addHeatMap=function(o,f){return new Ile(this._viewer,this._cesium).addHeatMap(o,f)};fr.prototype.militaryPlotting=function(o,f,m,v){var y=this._straightArrow,x=null;let C,w;m?typeof m=="function"?(C={},w=m):(C=m,w=v):C={};let A=E=>{C.removeEdit&&y.MilitaryStandardObj.pop(),y.defaultEdit(),w&&w(E)};switch(o){case"StraightArrow":var x=y.createStraightArrow(f,C,A);break;case"SwallowtailArrow":var x=y.createSwallowtailArrow(f,C,A);break;case"PincerArrow":var x=y.createPincerArrow(f,C,A);break;case"AttackArrow":var x=y.createAttackArrow(f,C,A);break;case"GatheringPlace":var x=y.createHandlerPolygon(f,C,A);break;case"RoundedRectangle":var x=y.createRoundedRectangle(f,C,A);break;case"Sector":var x=y.createSector(f,C,A);break;case"Bow":var x=y.createBow(f,C,A);break;case"Bezierline":var x=y.createBezierline(C,A);break;case"BezierArrow":var x=y.createBezierArrow(C,A);break;case"DemarcationLine":var x=y.createDemarcationLine(C,A);break;default:break}return x};fr.prototype.MilitaryCopy=function(o){var f=this._straightArrow,m=f.copyJb(o);return m};fr.prototype.NightMode=function(o){let f=this._viewer,m=f.imageryLayers.length,v,y;o?(v=.15,y=.15):(v=1,y=1);for(let x=0;x<m;x++)f.imageryLayers.get(x).brightness=v;this._D3Tilesets&&this._D3Tilesets.forEach(x=>{x.imageBasedLightingFactor.x=y,x.imageBasedLightingFactor.y=y}),f.scene.skyAtmosphere.show=!o};fr.prototype.SaveMilitaryStandard=function(){var o=this._straightArrow;o.save()};fr.prototype.OpenMilitaryStandard=function(o){var f=this._straightArrow;f.open(o)};fr.prototype.ClearMilitaryStandard=function(){var o=this._straightArrow;o.clear()};fr.prototype.getEntityById=function(o){var f=this._straightArrow,m=f.getEntityById(o);return m};fr.prototype.startModify=function(o){var f=this._straightArrow;f.edit(o)};fr.prototype.createSimpleGraphic=function(o,f,m){return this._SimpleGraphic.createSimpleGraphic(o,f,m)};fr.prototype.addSimpleGraphic=function(o,f,m){return this._SimpleGraphic.addSimpleGraphic(o,f,m)};fr.prototype.GeoWTFS=function(o){return this._TdtLabel||(this._TdtLabel=new xle(this._viewer,this._cesium)),this._TdtLabel.GeoWTFS(o)};fr.prototype.Video3D=function(o){return new Ple(this._viewer,this._cesium).Video3D(o)};fr.prototype.addRotateEffectCircle=function(o){return new M8(this._viewer,this._cesium).createRotateCircle(o)};fr.prototype.addTetrahedron=function(o){return new yle(this._viewer,o,this._cesium)};fr.prototype.addTrafficLight=function(o){return this._TrafficLight||(this._TrafficLight=new Lle(this._viewer,this._cesium)),this._TrafficLight.add(o)};fr.prototype.addDRWEffectCircle=function(o){return new M8(this._viewer,this._cesium).createDRWCircle(o)};fr.prototype.addEffectCylinder=function(o){return new I8(this._viewer,this._cesium).createCylinder(o)};fr.prototype.addEffectCone=function(o){return new I8(this._viewer,this._cesium).createCone(o)};fr.prototype.createGeoJsonFeatureLayerProviderOptimization=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.VolumeVectorGeoJsonFeatureLayerOptimization(o,f,m,v,y,x)};fr.prototype.createGeoJsonFeatureLayerProviderGisOptimization=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.VolumeVectorGeoJsonFeatureLayerGisOptimization(o,f,m,v,y,x)};fr.prototype.VolumeVectorGeoJsonFeatureLayerGis=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.VolumeVectorGeoJsonFeatureLayerGis(o,f,m,v,y,x)};fr.prototype.PointVectorGeoJsonFeatureLayerGis=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.PointVectorGeoJsonFeatureLayerGis(o,f,m,v,y,x)};fr.prototype.PolylineVectorGeoJsonFeatureLayerGis=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.PolylineVectorGeoJsonFeatureLayerGis(o,f,m,v,y,x)};fr.prototype.createGeoJsonFeatureLayerProviderClassOptimization=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.VolumeVectorGeoJsonFeatureLayerClassOptimization(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimization=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.VolumeVectorGeoJsonFeatureLayerOptimization1(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayerDthOptimizationtest=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayerDthOptimization(o,f,m,v,y,x)};fr.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.VolumeVectorGeoJsonFeatureLayerOptimizationGroundtest(o,f,m,v,y,x)};fr.prototype.VolumeVectorGeoJsonFeatureLayerOptimizationtest=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.VolumeVectorGeoJsonFeatureLayerOptimizationtest(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayerJCDthOptimization(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayerJCDthOptimizationxp(o,f,m,v,y,x)};fr.prototype.createHistogramVectorGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createHistogramVectorGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createLaycolorVectorGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createLaycolorVectorGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createVector3DTilesFeatureLayer=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVector3DTilesFeatureLayer(o,f,m,v,y,x)};fr.prototype.createVector3DTilesFeatureLayerRelease=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVector3DTilesFeatureLayerRelease(o,f,m,v,y,x)};fr.prototype.createGeojsonImage=function(o){var f=new od(this._viewer,this._cesium);return f.createGeojsonImage(o)};fr.prototype.createGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.VectorGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createGeojsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createGeojsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createGeojsonKmlFeatureLayer=function(o,f,m,v,y){var x=new vd(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,x.createGeojsonKmlFeatureLayer(o,f,m,v,y)};fr.prototype.sfsterrainprovider=function(o,f,m,v,y){var x=new nL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,x.createSFSTerrain(o,f,m,v,y)};fr.prototype.createWMTSTerrain=function(o,f,m,v,y){var x=new nL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,x.createWMTSTerrain(o,f,m,v,y)};fr.prototype.sfsterrainprovider71=function(o,f,m,v,y){var x=new nL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,x.createSFSTerrain71(o,f,m,v,y)};fr.prototype.createTerrain=function(o,f,m,v,y){var x=new nL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,x.createTerrain(o,f,m,v,y)};fr.prototype.createTerrainLayer=function(o,f,m,v,y,x){var C=new nL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,C.createTerrainLayer(o,f,m,v,y,x)};fr.prototype.createArcGISTerrain=function(o,f,m,v,y){var x=new nL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,x.createArcGISTerrain(o,f,m,v,y)};fr.prototype.createCesiumTerrain=function(o,f,m,v){var y=new nL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,y.createCesiumTerrain(o,f,m,v)};fr.prototype.getFlyData=function(o,f){this._createdynamicObject.getFlyData(o,f)};fr.prototype.createDynamicObject=function(o,f,m){return this._createdynamicObject.Start(o,f,m)};fr.prototype.addmodle=function(o){return this._createdynamicObject.addmodle(o)};fr.prototype.createSatelliteTrail=function(o){return new Cle(this._viewer,this._cesium).createSatelliteTrail(o)};fr.prototype.executePauseFly3DPaths=function(){return this._createdynamicObject.executePauseFly3DPaths()};fr.prototype.executePlayForwardFly3DPaths=function(){return this._createdynamicObject.executePlayForwardFly3DPaths()};fr.prototype.executePlayReverseFly3DPaths=function(){return this._createdynamicObject.executePlayReverseFly3DPaths()};fr.prototype.executeSignout=function(){return this._createdynamicObject.executeSignout()};fr.prototype.createLabel=function(o,f,m,v,y){var x=new HD(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createLabel(o,f,m,v,y)};fr.prototype.createPosition=function(o,f,m){var v=new X3e(this._viewer,this._cesium);return v.createPosition(o,f,m)};fr.prototype.createLocation=function(o,f,m){return this._Point.createLocation(o,f,m)};fr.prototype.createPoint=function(o,f,m,v,y,x){return this._Point.createPoint(o,f,m,v,y,x)};fr.prototype.createLonlat=function(o){return this._Point.createLonlat(o)};fr.prototype.createDivPoint=function(o,f,m){return new C8(this._viewer,this._cesium).createDivPoint(o,f,m)};fr.prototype.createRichTextPoint=function(o,f,m,v){return this._Point.createRichTextPoint(o,f,m,v)};fr.prototype.SkyBox=function(o,f){return this._skyBox.SkyBox(o,f)};fr.prototype.setSpaceBackground=function(o){return this._skyBox.setSpaceBackground(o)};fr.prototype.createWindField=function(o,f){return this._flowField.createWindField(o,f)};fr.prototype.createField=function(o,f){return this._canvasField.createField(o,f)};fr.prototype.createRoad=function(o={}){return new Ugt(this._viewer,this._cesium).createRoad(o)};fr.prototype.createTrailLinePath=function(o,f,m){return this._trailLine.createPath(o,f,m)};fr.prototype.createFlyingLine=function(o,f){return this._trailLine.createFlyingLine(o,f)};fr.prototype.createTrailLineWall=function(o,f){return this._trailLine.createWall(o,f)};fr.prototype.createTrailLine=function(o,f){return this._trailLine.createLine(o,f)};fr.prototype.createModel=function(o,f,m,v,y,x){var C=new VT(this._viewer,this._cesium);return C.createModel(o,f,m,v,y,x)};fr.prototype.createModelEditable=function(o,f,m,v,y,x){var C=new VT(this._viewer,this._cesium);return C.createModelEditable(o,f,m,v,y,x)};fr.prototype.createPointModel=function(o,f){return this._PointModel.createPointModel(o,f)};fr.prototype.executePolyline=function(o){var f=new _g(this._viewer,this._cesium);return f.executePolyline(o)};fr.prototype.executePolygon=function(o){var f=new gg(this._viewer,this._cesium);return f.executePolygon(o)};fr.prototype.executeWall=function(o,f){var m=new uk(this._viewer,this._cesium);return m.executeWall(o,f)};fr.prototype.createWall=function(o,f,m,v){var y=new uk(this._viewer,this._cesium);return y.createWall(o,f,m,v)};fr.prototype.executePolyline1=function(o){var f=new _g(this._viewer,this._cesium);return f.executePolyline1(method)};fr.prototype.createPolylineVolume=function(o,f,m,v,y){var x=new ece(this._viewer,this._cesium);return x.createPolylineVolume(o,f,m,v,y)};fr.prototype.createCorridor=function(o,f,m,v){var y=new xgt(this._viewer,this._cesium);return y.createCorridor(o,f,m,v)};fr.prototype.addViewCone=function(o){return new $O(this._viewer,this._cesium).addViewCone(o)};fr.prototype.createViewCone=function(o,f){return new $O(this._viewer,this._cesium).createViewCone(o,f)};fr.prototype.createModifyMesh=function(o,f,m,v,y){return this.createModelClipping(v,{type:"polygon",isInner:!0,positions:f})};fr.prototype.createModelClipping=function(o,f){var m=new jgt(this._viewer,this._cesium);return m.addClipping(o,f)};fr.prototype.createModelModifier=function(o,f,m,v){let y=[];return this._D3Tilesets&&this._D3Tilesets.forEach((x,C)=>{let w=this.createModifyMesh(o,f,m,x,v);y.push(w)}),{remove:()=>{y.forEach((x,C)=>{x.remove()}),y=[]}}};fr.prototype.createPopupMessage=function(o){var f=new wb(this._viewer,this._cesium);return f.createPopupMessage(o)};fr.prototype.createMeasurement=function(o){var f=new wb(this._viewer,this._cesium);return f.createMeasurement(o)};fr.prototype.createPlotting=function(o){var f=new wb(this._viewer,this._cesium);return f.createPlotting(o)};fr.prototype.createPopupProp=function(o,f){return this._popupmessage.createPopupProp(o,f)};fr.prototype.createModelLibrary=function(o){return this._popupmessage.createModelLibrary(o)};fr.prototype.createHawkeye=function(o,f){var m=new Wgt(this._viewer,this._cesium);return m.createHawkeye(o,f)};fr.prototype.createGeoJsonFeatureLayer=function(o,f,m,v,y){var x=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createBillboardGeoJsonFeature=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createBillboardGeoJsonFeature(o,f,m,v,y,x)};fr.prototype.createBillboardPointGeoJsonFeatureLayer=function(o,f,m,v,y){var x=new nJ(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createBillboardPointGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createKmlLayer=function(o,f,m){var v=new lOe(this._viewer,this._cesium);return v.createKmlLayer(o,f,m)};fr.prototype.addKmlLayer=function(o,f,m,v){var y=new lOe(this._viewer,this._cesium);return y.addKmlLayer(o,f,m,v)};fr.prototype.createVolumeVectorGeoJsonFeatureLayerArcgis=function(o,f,m,v,y){var x=new mle(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createVolumeVectorGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createBillboardGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new nJ(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createBillboardGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createPointGeojsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPointGeojsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createModelGeojsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createModelGeojsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createCirclePointGeoJsonFeatureLayer=function(o,f,m,v,y){var x=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createCirclePointGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createModelPointGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createModelPointGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createPrimitivLabelPointGeoJsonFeatureLayer=function(o,f,m,v,y){var x=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createLabelPointGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createLabelPointGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createLabelPointGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createSXTLabelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createSXTLabelGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createCustomCallbackGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x,C){var w=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,w.createCustomCallbackGeoJsonFeatureLayerProvider(o,f,m,v,y,C,x)};fr.prototype.createLabelPolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y){var x=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createLabelPolymerizationGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createPointPolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPointPolymerizationGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createLabelpolymerizationGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createLabelpolymerizationGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createLabelpolymerizationGeoJsonFeatureLayers=function(o,f,m,v,y,x){var C=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createLabelpolymerizationGeoJsonFeatureLayers(o,f,m,v,y,x)};fr.prototype.createStreetscapeGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createStreetscapeGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createPrimitiveLabelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createLabelGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createLabelImageGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createLabelImageGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createLabelImageGeoJsonFeatureLayerProvider1=function(o,f,m,v,y,x){var C=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createLabelImageGeoJsonFeatureLayerProvider1(o,f,m,v,y,x)};fr.prototype.createLabelRichtextGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new ty(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createLabelRichtextGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createModelGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createModelGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createPointGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new od(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPointGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createArcGisImageryLayer=function(o,f,m,v,y,x){var C=new rL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,C.createArcGisImageryLayer(o,f,m,v,y,x)};fr.prototype.createImageryLayerGrid=function(o){var f=new rL(this._viewer,this._cesium);return f.createImageryLayerGrid(o)};fr.prototype.createWebMapServerImageLayer=function(o,f,m,v,y,x){var C=new rL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,C.createWebMapServerImageLayer(o,f,m,v,y,x)};fr.prototype.createWebMapTileServerImageLayer=function(o,f,m,v,y,x){var C=new rL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,C.createWebMapTileServerImageLayer(o,f,m,v,y,x)};fr.prototype.createUrlTemplateImageryProvider=function(o,f,m,v,y,x){var C=new rL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,C.createUrlTemplateImageryProvider(o,f,m,v,y,x)};fr.prototype.createCirclePointGeoJsonFeatureLayer=function(o,f,m,v,y){var x=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createCirclePointGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createPolylineGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolylineGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createPrimitivePolylineGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new FD(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolylineGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createPrimitiveGroundPolylineGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new FD(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createGroundPolylineGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.exectPointModel=function(o,f,m,v,y,x){var C=new VT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.exectPointModel(o,f,m,v,y,x)};fr.prototype.createPolygonModel=function(o,f,m,v,y,x){var C=new VT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolygonModel(o,f,m,v,y,x)};fr.prototype.modelMove=function(){var o=new VT(this._viewer,this._cesium);return o.modelMove()};fr.prototype.createPrimitivePolylineVectorGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new FD(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolylineVectorGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createPolylineVectorGeoJsonFeatureLayerProviderModel=function(o,f,m,v,y,x){var C=new FD(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolylineVectorGeoJsonFeatureLayerProviderModel(o,f,m,v,y,x)};fr.prototype.createpolylineVolumeGeojsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createpolylineVolumeGeojsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createpolylineVolumeGeojsonPrimitiveLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createpolylineVolumeGeojsonPrimitiveLayer(o,f,m,v,y,x)};fr.prototype.createVolumeGeoJsonFeatureLayer=function(o,f,m,v,y){var x=new eK(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createVolumeGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createVolumeGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new eK(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayerOptimizations=function(o,f,m,v,y,x){var C=new eK(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayerOptimization(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new eK(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createPolygonVectorGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new tK(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayerOptimization=function(o,f,m,v,y,x){var C=new tK(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayerOptimization(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayersd=function(o,f,m,v,y,x){var C=new tK(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayersd(o,f,m,v,y,x)};fr.prototype.createWallGeoFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createWallGeoFeatureLayer(o,f,m,v,y,x)};fr.prototype.createWallPrimitiveGeoFeatureLayer=function(o,f,m,v,y,x){var C=new oJ(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createWallPrimitiveGeoFeatureLayer(o,f,m,v,y,x)};fr.prototype.createWallGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new oJ(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createWallGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createImageryProvider=function(o,f,m,v,y,x,C){var w=new rL(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,w.createImageryProvider(o,f,m,v,y,x,C)};fr.prototype.createCacheImageryProvider=function(o,f,m,v,y,x){var C=new rL(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,C.createCacheImageryProvider(o,f,m,v,y,x)};fr.prototype.createterrainProvider=function(o,f,m,v){return this._TerrainProvider.createterrainProvider(o,f,m,v)};fr.prototype.createPolylineImageryProviderer=function(o,f,m,v){return this._ImageryLayer.createPolylineImageryProviderer(o,f,m,v)};fr.prototype.createMVTWithStyle=function(o,f,m,v){return this._ImageryLayer.createMVTWithStyle(o,f,m,v)};fr.prototype.createPolygonGeoJsonFeatureLayer=function(o,f,m,v,y,x){var C=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolygonGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createPolygonGeoJsonFeatureLayer1=function(o,f,m,v,y){var x=new zT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createPolygonGeoJsonFeatureLayer(o,f,m,v,y)};fr.prototype.createPolygonVectorGeoJsonFeatureLayerProvider=function(o,f,m,v,y,x){var C=new zT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolygonVectorGeoJsonFeatureLayerProvider(o,f,m,v,y,x)};fr.prototype.createVolumeVectorGeoJsonFeatureLayerDth=function(o,f,m,v,y,x){var C=new tK(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createVolumeVectorGeoJsonFeatureLayerDth(o,f,m,v,y,x)};fr.prototype.createPolygonVectorGeoJsonFeatureLayerProviderModel=function(o,f,m,v,y,x){var C=new zT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolygonVectorGeoJsonFeatureLayerProviderModel(o,f,m,v,y,x)};fr.prototype.createPolygonVectorGeoJsonFeatureLayerProviderls=function(o,f,m,v,y,x){var C=new zT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolygonVectorGeoJsonFeatureLayerProviderls(o,f,m,v,y,x)};fr.prototype.createPolygonVectorGeoJsonFeatureLayerProviderlsd=function(o,f,m,v,y,x){var C=new zT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createPolygonVectorGeoJsonFeatureLayerProviderlsd(o,f,m,v,y,x)};fr.prototype.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls=function(o,f,m,v,y,x){var C=new zT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,C.createArcgisPolygonVectorGeoJsonFeatureLayerProviderls(o,f,m,v,y,x)};fr.prototype.createPolygonVectorFeatureLayerProvider=function(o,f,m,v,y){var x=new zT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createPolygonVectorFeatureLayerProvider(o,f,m,v,y)};fr.prototype.createPolygonVectorMonomerFeatureLayerProvider=function(o,f,m,v,y){var x=new zT(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createPolygonVectorMonomerFeatureLayerProvider(o,f,m,v,y)};fr.prototype.createPolygonMapGeoJsonFeatureLayer=function(o,f,m,v,y,x){return this._MapGeoJsonFeatureLayer.createPolygonMapGeoJsonFeatureLayer(o,f,m,v,y,x)};fr.prototype.createGeoJsonDataSource=function(o,f,m,v,y){var x=new vd(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createGeoJsonDataSource(o,f,m,v,y)};fr.prototype.DeleteObject=function(o){if(this._core.isnull(o._viewer)){console.log("obj is null");return}o.deleteObject();for(var f in o)delete o[f];o=void 0};fr.prototype.createCircle=function(o,f,m,v){var y=new RP(this._viewer,this._cesium);return y.createCircle(o,f,m,v)};fr.prototype.CreateRectangle=function(o,f,m,v,y){var x=new NT(this._viewer,this._cesium);return x.CreateRectangle(o,f,m,v,y)};fr.prototype.createBox=function(o,y,m,v){var y=new zD(this._viewer,this._cesium);return y.createBox(o,y,m,v)};fr.prototype.createBillboardbatch=function(o){var f=new sOe(this._viewer,this._cesium);return f.createBillboardbatch(o)};fr.prototype.createBillboard=function(o){var f=new sOe(this._viewer,this._cesium);return f.createBillboard(o)};fr.prototype.createCone=function(o,f,m,v){var y=new X0(this._viewer,this._cesium);return y.createCone(o,f,m,v)};fr.prototype.createRectangularSensor=function(o,f,m,v){var y=new X0(this._viewer,this._cesium);return y.createRectangularSensor(o,f,m,v)};fr.prototype.createRadarMaskScan=function(o,f,m,v){var y=new X0(this._viewer,this._cesium);return y.createRadarMaskScan(o,f,m,v)};fr.prototype.ConicSensor=function(o,f,m){var v=new ble(this._viewer,this._cesium);return v.create(o,f,m)};fr.prototype.FieldIntensity=function(o,f){var m=new Rle(this._viewer,this._cesium);return m.create(o,f)};fr.prototype.createRadarMask=function(o,f,m,v){var y=new X0(this._viewer,this._cesium);return y.createRadarMask(o,f,m,v)};fr.prototype.createConeRadar=function(o,f){var m=new X0(this._viewer,this._cesium);return m.createConeRadar(o,f)};fr.prototype.createColor=function(o,f,m,v){var y=new no(this._viewer,this._cesium);return y.createColor(o,f,m,v)};fr.prototype.createPolyline=function(o,f,m,v,y){var x=new _g(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createPolyline(o,f,m,this._core.isnull(v)?0:v,y)};fr.prototype.createLink=function(o,f,m){var v=new _g(this._viewer,this._cesium);return v.createLink(o,f,m)};fr.prototype.createLinkPro=function(o,f,m){var v=new _g(this._viewer,this._cesium);return v.createLinkPro(o,f,m)};fr.prototype.createLandingLine=function(o,f={}){var m=new _g(this._viewer,this._cesium);return m.createLandingLine(o,f)};fr.prototype.createLinkPros=function(o){var f=new _g(this._viewer,this._cesium);return f.createLinkPros(o)};fr.prototype.createPathLayer=function(o){return this._trailLine.createPathLayer(o)};fr.prototype.createTrailWallLayer=function(o){return this._trailLine.createWallLayer(o)};fr.prototype.createPolygon=function(o,f,m,v,y){var x=new gg(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.createPolygon(o,f,m,v,y)};fr.prototype.createSector=function(o,f,m,v,y){var x=new gg(this._viewer,this._cesium);return x.createSector(o,f,m,v,y)};fr.prototype.executeEllipsoid=function(o,y,m,v){var y=new QO(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,y.createEllipsoid(o,y,m,v)};fr.prototype.createImageLabel=function(o,f,m,v){var y=new uN(this._viewer,this._cesium);return this._core.isnull(m)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(m=Ne.selectedItem.id),m=this._core.isnull(m)?0:m,y.createImageLabel(o,f,m,v)};fr.prototype.toHtmlColor=function(o){return this._Color.toHtmlColor(o)};fr.prototype.CreateLabel=function(o,f,m,v,y,x){var C=new HD(this._viewer,this._cesium);return this._core.isnull(y)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(y=Ne.selectedItem.id),y=this._core.isnull(y)?0:y,C.CreateLabel(o,f,m,v,y,x)};fr.prototype.CreateImageLabel=function(o,f,m,v,y){var x=new uN(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.CreateImageLabel(o,f,m,v,y)};fr.prototype.createImage=function(o,f,m,v,y){var x=new uN(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.CreateImageLabel(o,f,m,v,y)};fr.prototype.CreatePolyline=function(o,f,m,v,y){var x=new _g(this._viewer,this._cesium);return this._core.isnull(v)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(v=Ne.selectedItem.id),v=this._core.isnull(v)?0:v,x.CreatePolyline(o,f,m,v,y)};fr.prototype.CreateCircle=function(o,f,m,v,y,x){var C=new RP(this._viewer,this._cesium);return this._core.isnull(y)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(y=Ne.selectedItem.id),y=this._core.isnull(y)?0:y,C.CreateCircle(o,f,m,v,y,x)};fr.prototype.CreateEllipse=function(o,f,m,v,y,x,C,w){var A=new RP(this._viewer,this._cesium);return this._core.isnull(C)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(C=Ne.selectedItem.id),C=this._core.isnull(C)?0:C,A.CreateEllipse(o,f,m,v,y,x,C,w)};fr.prototype.CreateBox=function(o,f,m,v,y,x,C,w){var A=new zD(this._viewer,this._cesium);return this._core.isnull(C)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(C=Ne.selectedItem.id),C=this._core.isnull(C)?0:C,A.CreateBox(o,f,m,v,y,x,C,w)};fr.prototype.CreatePosition=function(o,f,m,v,y,x,C,w){var A=new X3e(this._viewer,this._cesium);return A.CreatePosition(o,f,m,v,y,x,C,w)};fr.prototype.createColor=function(o,f,m,v){var y=new no(this._viewer,this._cesium);return y.CreateColor(o,f,m,v)};fr.prototype.CreateCone=function(o,f,m,v,y,x,C,w){var A=new X0(this._viewer,this._cesium);return this._core.isnull(C)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(C=Ne.selectedItem.id),C=this._core.isnull(C)?0:C,A.CreateCone(o,f,m,v,y,x,C,w)};fr.prototype.CreateCylinder=function(o,f,m,v,y,x,C,w){var A=new X0(this._viewer,this._cesium);return this._core.isnull(C)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(C=Ne.selectedItem.id),C=this._core.isnull(C)?0:C,A.CreateCylinder(o,f,m,v,y,x,C,w)};fr.prototype.CreateSphere=function(o,f,m,v,y,x,C,w){var A=new QO(this._viewer,this._cesium);return this._core.isnull(C)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(C=Ne.selectedItem.id),C=this._core.isnull(C)?0:C,A.CreateSphere(o,f,m,v,y,x,C,w)};fr.prototype.createPointOptimization=function(o,f){var m=new yb(this._viewer,this._cesium);return m.createPointOptimization(o,f)};fr.prototype.createRectangleOptimization=function(o,f){var m=new NT(this._viewer,this._cesium);return m.createRectangleOptimization(o,f)};fr.prototype.createCircleOptimization=function(o,f){var m=new RP(this._viewer,this._cesium);return m.createCircleOptimization(o,f)};fr.prototype.createCylinderOptimization=function(o,f){var m=new X0(this._viewer,this._cesium);return m.createCylinderOptimization(o,f)};fr.prototype.createPointOptimization=function(o,f){var m=new yb(this._viewer,this._cesium);return m.createPointOptimization(o,f)};fr.prototype.CreatePolygonEdit=function(){return this._core.EntityEdit(this._viewer,this._cesium)};fr.prototype.CreateVectorImageFeatureLayer=function(o,f,m,v,y,x,C){var w=new this._VectorImgFeatureLayer(this._viewer,this._cesium);return this._core.isnull(y)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(y=Ne.selectedItem.id),y=this._core.isnull(y)?0:y,w.CreateVectorImageFeatureLayer(o,f,m,v,y,x,C)};fr.prototype.CreateWMSImageFeatureLayer=function(o,f,m,v,y,x,C){var w=new this._VectorImgFeatureLayer(this._viewer,this._cesium);return this._core.isnull(y)&&!this._core.isnull(Ne.selectedItem)&&Ne.selectedItem.type=="group"&&(y=Ne.selectedItem.id),y=this._core.isnull(y)?0:y,w.CreateWMSImageFeatureLayer(o,f,m,v,y,x,C)};fr.prototype.createVolumetricMeasureTool=function(){var o=new wse(this._viewer,this._cesium);return o};Object.defineProperties(fr.prototype,{SimpleGraphic:{get:function(){return this._SimpleGraphic}},GeoJsonFeatureLayer:{get:function(){return this._GeoJsonFeatureLayer}},MilitaryPlotting:{get:function(){return this._straightArrow}},_D3Tileset:{get:function(){return new kT(this._viewer,this._cesium)}}});Object.defineProperties(fr.prototype,{_trailLine:{get:function(){return new kD(this._viewer,this._cesium)}}});Object.defineProperties(fr.prototype,{_Point:{get:function(){return new yb(this._viewer,this._cesium)}},GeometryCreator:{CreateLinearRingGeometry:function(o){return{}}}});var lce=fr;function hOe(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}hOe.prototype.deleteItem=function(o){Ne.delete(o,this._viewer,this._cesium)};hOe.prototype.testTreeSource=function(){console.log(this._tree)};var a0t=hOe;function s0t(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}s0t.prototype.findItem=function(o){var f=[],m="",v=Ji.clone(this._tree);f=o.split("\\");for(var y=0;y<f.length;y++)if(v=Ne.getSourceByName(v,f[y]),y==f.length-1)if(v){m=v.id;break}else m="";else if(v)v=v.children;else{m="",v=null;break}return m};var l0t=s0t;function u0t(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}u0t.prototype.getItemName=function(o){var f=Ne.getSourceById(this._tree,o);return f?f.name:""};var c0t=u0t;function h0t(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}h0t.prototype.getVisibility=function(o){var f=f=Ne.getSourceById(this._tree,o);if(f)return f.item.getVisibility()};var d0t=h0t;function f0t(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}f0t.prototype.setVisibility=function(o,f){Ne.setVisibility(o,f,this._viewer,this._cesium)};var p0t=f0t;function m0t(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}m0t.prototype.rename=function(o,f){var m=Ne.getSourceById(this._tree,o);m&&(m.name=f);var v=Ne.getTempSourceById(o);v&&(v.name=f)};var g0t=m0t;function _0t(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}_0t.prototype.getNextItem=function(o,f){};var v0t=_0t;var P8i={none:-1,point:0,polyline:1,polygon:2,label:3,imageLabel:4,position:5,imageLayer:6,dynamicObject:7,D3titles:8,box:9,circle:10,cone:11,pointfeaturelayer:12,polylinefeaturelayer:13,polygonfeaturelayer:14,pointmodel:15,rectangle:16,ellipsoid:17,wall:18,polylinevolume:19},up=Object.freeze(P8i);function gG(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource(),this._treeSource=Ne.Source,this._treeTemp=Ne.getTempSource(),this._tree1=Ne,this._core=new Sr(o,f)}gG.prototype.getObject=function(o){var f=Ji.clone(this._tree),m=Ne.getSourceById(f,o);if(m)return m.item;var v=Ji.clone(Ne.PointSelectSource),y=Ne.getPointSelectSourceById(v,o);return y?y.item:void 0};gG.prototype.getTreeItem=function(o){var f=Ji.clone(this._tree),m=Ne.getSourceById(f,o);if(m)return m;for(var v=this._viewer.dataSources,y=0;y<v.length;y++){var x=v.get(y).entities.getById(o);if(x){if(x.point&&(x.point.show==null||x.point.show._value)){var C=new yb(this._viewer,this._cesium);C.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"point",item:C};return Ne.pusPointSelectSource(w),w}else if(x.label&&(x.label.show==null||x.label.show._value)){var C=new HD(this._viewer,this._cesium);C.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"label",item:C};return Ne.pusPointSelectSource(w),w}else if(x.box&&(x.box.show==null||x.box.show._value)){var A=new zD(this._viewer,this._cesium);A.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"box",item:A};return Ne.pusPointSelectSource(w),w}else if(x.model&&(x.model.show==null||x.model.show._value)){var C=new model(this._viewer,this._cesium);C.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"model",item:C};return Ne.pusPointSelectSource(w),w}else if(x.wall&&(x.wall.show==null||x.wall.show._value)){var E=new uk(this._viewer,this._cesium);E.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"wall",item:E};return Ne.pusPointSelectSource(w),w}else if(x.polyline){var T=new _g(this._viewer,this._cesium);T.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"polyline",item:T};return Ne.pusPointSelectSource(w),w}else if(x.polygon){var S=new gg(this._viewer,this._cesium);S.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"polygon",item:S};return Ne.pusPointSelectSource(w),w}else if(x.rectangle){var M=new NT(this._viewer,this._cesium);M.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"rectangle",item:M};return Ne.pusPointSelectSource(w),w}else if(x.billboard&&(x.billboard.show==null||x.billboard.show._value)){var C=new uN(this._viewer,this._cesium);C.setItem(x);var w={id:this._core.getuid(),name:"",pId:0,type:"billboard",item:C};return Ne.pusPointSelectSource(w),w}}}};gG.prototype.updateItemId=function(o,f){var v=this._treeSource,y=Ne.getSourceById(v,o);if(y&&(y.id=f,y.type=="group"&&y.children&&y.children.length>0))for(var m=0;m<y.children.length;m++)y.children[m].pId=f;var v=this._treeTemp,y=Ne.getSourceById(v,o);if(y&&(y.id=f,y.type=="group"&&y.children&&y.children.length>0))for(var m=0;m<y.children.length;m++)y.children[m].pId=f};gG.prototype.unifiedProject=function(o,f){for(var m=0;m<f.length;m++)f[m].id=o[m].id,f[m].pId=f[m].pId,f[m].children&&f[m].children.length>0&&this.unifiedProject(o[m].children,f[m].children)};gG.prototype.insertProjectTree=function(o,f,m,v,y){var x=!0;if(this._core.isnull(f)&&(f=this._core.getuid()),y==!1?x=!1:x=!0,up.none==m){var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"unknown",item:null};Ne.insertGroupId(C,o)}else if(up.position==m){var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"unknown",item:null};Ne.insertGroupId(C,o)}else if(up.imageLayer==m){var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,checked:x,type:"unknown",item:null};Ne.insertGroupId(C,o)}else if(up.dynamicObject==m){var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"unknown",item:null};Ne.insertGroupId(C,o)}else if(up.point==m){var w=new yb(this._viewer,this._cesium);w.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"point",item:w};w.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.polyline==m){var A=new _g(this._viewer,this._cesium);A.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"polyline",item:A};A.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.rectangle==m){var E=new NT(this._viewer,this._cesium);E.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"rectangle",item:E};E.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.ellipsoid==m){var T=new QO(this._viewer,this._cesium);T.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"ellipsoid",item:T};T.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.polygon==m){var S=new gg(this._viewer,this._cesium);v._entity?(S.setItem(v._entity),S._points=v._points):S.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"polygon",item:S};S.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.wall==m){var M=new uk(this._viewer,this._cesium);M.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"wall",item:M};M.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.polylinevolume==m){var I=new ece(this._viewer,this._cesium);I.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"polylinevolume",item:I};I.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.pointmodel==m){var P=new VT(this._viewer,this._cesium);P.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"pointmodel",item:P};P.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.label==m){var w=new HD(this._viewer,this._cesium);w.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"label",item:w};w.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.imageLabel==m){var w=new uN(this._viewer,this._cesium);w.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,checked:x,type:"billboard",item:w};w.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.D3titles==m){var D=new kT(this._viewer,this._cesium);D.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"3DTilesets",item:D};D.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.box==m){var L=new zD(this._viewer,this._cesium);L.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"box",item:L};L.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.circle==m){var R=new RP(this._viewer,this._cesium);R.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"circle",item:R};R.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.cone==m){var O=new X0(this._viewer,this._cesium);O.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"cylinder",item:O};O.setTreeobj(C),Ne.insertGroupId(C,o)}else if(up.pointfeaturelayer==m){var F=new vd(this._viewer,this._cesium);F.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"pointLayer",item:F};Ne.insertGroupId(C,o)}else if(up.pointfeaturelayer==m){var F=new vd(this._viewer,this._cesium);F.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"polylineLayer",item:F};Ne.insertGroupId(C,o)}else if(up.polygonfeaturelayer==m){var F=new vd(this._viewer,this._cesium);F.setItem(v);var C={id:v&&v.id?v.id:this._core.getuid(),name:f,pId:o,type:"polygonLayer",item:F};Ne.insertGroupId(C,o)}return C};var y0t=gG;function x0t(o,f){this._viewer=o,this._cesium=f,this._tree=Ne.getSource()}x0t.prototype.isGroup=function(o){var f=Ji.clone(this._tree),m=Ne.getSourceById(f,o);return!!(m&&m.type=="group")};var C0t=x0t;function dOe(o,f){this._viewer=o,this._cesium=f}dOe.prototype.exportMethod=function(o){for(var f=[],m=0;m<o.length;m++)if(typeof o[m].item.export=="function"){var v=o[m].item.export();if(f.push(v),o[m].children&&o[m].children.length){var y=this.exportMethod(o[m].children);f.push(y)}}return f};dOe.prototype.export=function(){var o=this.exportMethod(Ne.Source);return o};var b0t=dOe;function hh(o,f,m){this._viewer=o,this._cesium=f,this._tree=Ne.Source,this._createGroup=new D4(this._viewer,this._cesium,this._tree),this._deleteItem=new a0t(this._viewer,this._cesium,this._tree),this._findItem=new l0t(this._viewer,this._cesium,this._tree),this._getItemName=new c0t(this._viewer,this._cesium,this._tree),this._getVisibility=new d0t(this._viewer,this._cesium,this._tree),this._setVisibility=new p0t(this._viewer,this._cesium,this._tree),this._renameGroup=new g0t(this._viewer,this._cesium,this._tree),this._getNextItem=new v0t(this._viewer,this._cesium,this._tree),this._isGroup=new C0t(this._viewer,this._cesium,this._tree),this._creator=new lce(this._viewer,this._cesium),this._getObject=new y0t(this._viewer,this._cesium),this._exportTree=new b0t(this._viewer,this._cesium),this._core=new Sr(o,f),this.InitTree(m,0),this.InitRootImageLayerAndTerrainlayer()}hh.prototype.export=function(){var o=this._exportTree.export(),f=new Blob([JSON.stringify(o)],{type:""});return this._core.saveAs(f,"tree.json"),o};hh.prototype.createGroup=function(o,f,m){return this._createGroup=new D4(this._viewer,this._cesium),this._createGroup.createGroup(o,f,m)};hh.prototype.changeGroup=function(o,f){this._createGroup.changeGroup(o,f)};hh.prototype.starttemporaryItem=function(){return this._createGroup.starttemporaryItem()};hh.prototype.pushtemporaryItem=function(o){this._createGroup.pushtemporaryItem(o)};hh.prototype.pushStateItem=function(o){this._createGroup.pushStateItem(o)};hh.prototype.endtemporaryItem=function(){this._createGroup.endtemporaryItem()};hh.prototype.deleteItem=function(o){return this._deleteItem.deleteItem(o)};hh.prototype.findItem=function(o){return this._findItem.findItem(o)};hh.prototype.getItemName=function(o){return this._getItemName.getItemName(o)};hh.prototype.getObject=function(o){return this._getObject.getObject(o)};hh.prototype.getTreeItem=function(o){return this._getObject.getTreeItem(o)};hh.prototype.updateItemId=function(o,f){return this._getObject.updateItemId(o,f)};hh.prototype.getVisibility=function(o){return this._getVisibility.getVisibility(o)};hh.prototype.setVisibility=function(o,f){return this._setVisibility.setVisibility(o,f)};hh.prototype.removeAll=function(o){let f=[];this._viewer.entities.values.forEach(m=>{m.objectType===o&&f.push(m)}),f.forEach(m=>{this._viewer.entities.remove(m)}),f=null};hh.prototype.setVisibilityAll=function(o,f){this._viewer.entities.values.forEach(m=>{m.objectType===o&&(m.show=f)})};hh.prototype.rename=function(o,f){return this._renameGroup.rename(o,f)};hh.prototype.getNextItem=function(o,f){return this._getNextItem.getNextItem(o)};hh.prototype.isGroup=function(o){return this._isGroup.isGroup(o)};Object.defineProperties(hh.prototype,{exitsObjectType:{get:function(){return up}}});hh.prototype.insertProjectTree=function(o,f,m,v,y,x){return this._core.isnull(o)&&!this._core.isnull(this._tree.selectedItem)&&this._tree.selectedItem.type=="group"&&(o=this._tree.selectedItem.id),o=this._core.isnull(o)?0:o,this._core.isnull(f)||(o=this.createGroup(f,!0,o)),this._getObject.insertProjectTree(o,m,v,y,x)};hh.prototype.exitsGroup=function(o,f){return Ne.exitsGroup(o,f)};hh.prototype.getTreeSource=function(){var o=Ji.cloneDeep(Ne.getSource());return Ne.removeItem(o)};hh.prototype.unifiedProject=function(o,f){this._getObject.unifiedProject(o,f)};hh.prototype.clearn=function(){Ne.clearn()};Object.defineProperties(hh.prototype,{Source:{get:function(){return Ne.TempSource}}});Object.defineProperties(hh.prototype,{currentObj:{get:function(){return Ne.currentObj}}});hh.prototype.InitTree=function(o,f){if(o&&o.length)for(var m=0;m<o.length;m++){var v=o[m];switch(v.type){case"group":var y=this.createGroup(v.name,f);v.children&&v.children.length&&this.InitTree(v.children,y);break;case"label":this._creator.createLabel(v.position,v.text,v.option,f,v.description);break;case"imgLabel":this._creator.createImageLabel(v.position,v.imageLabel,f,v.description);break;case"polygon":this._creator.createPolygon(v.geometry,v.lineColor,v.altitudeType,f,v.description);break;case"polyline":this._creator.createPolyline(v.geometry,v.lineColor,v.altitudeType,f,v.description);break;case"box":this._creator.createBox(v.position,v.box,v.name,f,v.description);break;case"circle":this._creator.createCircle(v.position,v.circle,v.name,f,v.description);break;case"cone":this._creator.createCone(v.position,v.cylinder,v.name,v.description);break;default:break}}};hh.prototype.InitRootImageLayerAndTerrainlayer=function(){};Object.defineProperties(hh.prototype,{selectedItem:{get:function(){return Ne.selectedItem},set:function(o){Ne.selectedItem=o}}});var w0t=hh;var I8i={L_Click:"OnLButtonClk",L_DBL_Click:"OnLButtonDblClk",L_Down:"OnLButtonDown",L_Up:"OnLButtonUp",M_Click:"OnMButtonClk",M_Down:"OnMButtonDown",M_Up:"OnMButtonUp",R_Click:"OnRButtonClk",R_Down:"OnRButtonDown",R_Up:"OnRButtonUp",Move:"OnFrame",Wheel:"OnMouseWheel"},pf=Object.freeze(I8i);function UC(o,f){this._viewer=o,this._cesium=f,this._Core=new Sr(o,f)}UC.prototype.AttachEvent=function(o,f){var m=this._viewer,v=this._Core,v=this._Core;if(o===pf.L_Click){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(C){let w=m.scene.pickPosition(C.position),A;w&&(A=v.toDegrees(w)),typeof f=="function"&&f(C,A)},this._cesium.ScreenSpaceEventType.LEFT_CLICK),x}else if(o===pf.L_DBL_Click){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),x}else if(o===pf.L_Down){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),x}else if(o===pf.L_Up){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.LEFT_UP),x}else if(o===pf.M_Click){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),x}else if(o===pf.M_Down){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),x}else if(o===pf.M_Up){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.MIDDLE_UP),x}else if(o===pf.R_Click){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.RIGHT_CLICK),x}else if(o===pf.R_Down){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),x}else if(o===pf.R_Up){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){let E=m.scene.pickPosition(A.position),T;E&&(T=v.toDegrees(E)),typeof f=="function"&&f(A,T)},this._cesium.ScreenSpaceEventType.RIGHT_UP),x}else if(o===pf.Wheel){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){typeof f=="function"&&f(A)},this._cesium.ScreenSpaceEventType.WHEEL),x}else if(o===pf.Move){var y=this._viewer.scene,x=new this._cesium.ScreenSpaceEventHandler(y.canvas);return x.setInputAction(function(A){typeof f=="function"&&f(A)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),x}};UC.prototype.AttachOnLButtonDblClkEvent=function(o){var f=this._viewer.scene,m=this._viewer,v=this._Core,y=new this._cesium.ScreenSpaceEventHandler(f.canvas);return y.setInputAction(function(x){let C=m.scene.pickPosition(x.position),w;C&&(w=v.toDegrees(C)),typeof o=="function"&&o(click,w)},this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),y};UC.prototype.AttachOnLButtonDownEvent=function(o){var f=this._viewer,m=this._Core,v=this._viewer.scene,y=new this._cesium.ScreenSpaceEventHandler(v.canvas);return y.setInputAction(function(x){let C=f.scene.pickPosition(x.position),w;C&&(w=m.toDegrees(C)),typeof o=="function"&&o(click,w)},this._cesium.ScreenSpaceEventType.LEFT_DOWN),y};UC.prototype.AttachOnLButtonUpEvent=function(o){var f=this._viewer,m=this._Core,v=this._viewer.scene,y=new this._cesium.ScreenSpaceEventHandler(v.canvas);return y.setInputAction(function(x){let C=f.scene.pickPosition(x.position),w;C&&(w=m.toDegrees(C)),typeof o=="function"&&o(click,w)},this._cesium.ScreenSpaceEventType.LEFT_UP),y};UC.prototype.AttachOnMButtonDblClkEvent=function(o){var f=this._viewer,m=this._Core,v=this._viewer.scene,y=new this._cesium.ScreenSpaceEventHandler(v.canvas);return y.setInputAction(function(x){let C=f.scene.pickPosition(x.position),w;C&&(w=m.toDegrees(C)),typeof o=="function"&&o(click,w)},this._cesium.ScreenSpaceEventType.MIDDLE_CLICK),y};UC.prototype.AttachOnMButtonDownEvent=function(o){var f=this._viewer,m=this._Core,v=this._viewer.scene,y=new this._cesium.ScreenSpaceEventHandler(v.canvas);return y.setInputAction(function(x){let C=f.scene.pickPosition(x.position),w;C&&(w=m.toDegrees(C)),typeof o=="function"&&o(click,w)},this._cesium.ScreenSpaceEventType.MIDDLE_DOWN),y};UC.prototype.AttachOnMButtonUpEvent=function(o){var f=this._viewer,m=this._Core,v=this._viewer.scene,y=new this._cesium.ScreenSpaceEventHandler(v.canvas);return y.setInputAction(function(x){let C=f.scene.pickPosition(x.position),w;C&&(w=m.toDegrees(C)),typeof o=="function"&&o(click,w)},this._cesium.ScreenSpaceEventType.MIDDLE_UP),y};UC.prototype.AttachOnMouseWheelEvent=function(o){var f=this._viewer.scene,m=new this._cesium.ScreenSpaceEventHandler(f.canvas);return m.setInputAction(function(v){typeof o=="function"&&o(v)},this._cesium.ScreenSpaceEventType.WHEEL),m};UC.prototype.AttachOnFrameEvent=function(o){var f=this._viewer.scene,m=new this._cesium.ScreenSpaceEventHandler(f.canvas);return m.setInputAction(function(v){typeof o=="function"&&o(v)},this._cesium.ScreenSpaceEventType.MOUSE_MOVE),m};UC.prototype.AttachOnRButtonDownEvent=function(o){var f=this._viewer,m=this._Core,v=this._viewer.scene,y=new this._cesium.ScreenSpaceEventHandler(v.canvas);return y.setInputAction(function(x){let C=f.scene.pickPosition(x.position),w;C&&(w=m.toDegrees(C)),typeof o=="function"&&o(click,w)},this._cesium.ScreenSpaceEventType.RIGHT_DOWN),y};UC.prototype.AttachOnRButtonUpEvent=function(o){var f=this._viewer,m=this._Core,v=this._viewer.scene,y=new this._cesium.ScreenSpaceEventHandler(v.canvas);return y.setInputAction(function(x){let C=f.scene.pickPosition(x.position),w;C&&(w=m.toDegrees(C)),typeof o=="function"&&o(click,w)},this._cesium.ScreenSpaceEventType.RIGHT_UP),y};UC.prototype.AttachCameraChangeEvent=function(o){return this._viewer.scene.camera.percentageChanged=1e-6,this._viewer.scene.camera.changed.addEventListener(o),o};UC.prototype.CameraMoveEndEvent=function(o){var f=this._viewer,m=!1;function v(){m=!0}function y(){m&&(o&&o(),f.scene.camera.moveStart.removeEventListener(v),f.scene.camera.moveEnd.removeEventListener(y))}setTimeout(function(){f.scene.camera.moveStart.addEventListener(v),f.scene.camera.moveEnd.addEventListener(y)},0)};var GC=UC;function aK(o,f){this._viewer=o,this._cesium=f}aK.prototype.DetachEvent=function(o,f){f===pf.L_Click?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_CLICK):f===pf.L_DBL_Click?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK):f===pf.L_Down?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOWN):f===pf.L_Up?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_UP):f===pf.M_Click?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_CLICK):f===pf.M_Down?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_DOWN):f===pf.M_Up?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.MIDDLE_UP):f===pf.R_Click?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_CLICK):f===pf.R_Down?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_DOWN):f===pf.R_Up?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.RIGHT_UP):f===pf.Wheel?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.WHEEL):f===pf.Move?o&&o.removeInputAction(this._cesium.ScreenSpaceEventType.MOUSE_MOVE):o&&o.destroy()};aK.prototype.DetachEventAll=function(o){o&&(o.destroy(),o=null)};aK.prototype.RemoNormalCesiumLeftDoubleClick=function(){this._viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK)};aK.prototype.DetachCameraChangeEvent=function(o){this._viewer.scene.camera.percentageChanged=.5,this._viewer.scene.camera.changed.removeEventListener(o)};var sK=aK;var M8i={ZH_CN:"zh-CN",EN_US:"en-US"},_G=Object.freeze(M8i);function A0t(){}Object.defineProperties(A0t.prototype,{INFORMATION_BAR_LON:{get:li.throwInstantiationError},INFORMATION_BAR_LAT:{get:li.throwInstantiationError},INFORMATION_BAR_VIEW_HEIGHT:{get:li.throwInstantiationError},UNI_METER:{get:li.throwInstantiationError},UNIT_KILOMETER:{get:li.throwInstantiationError},UNIT_SQUARE_METER:{get:li.throwInstantiationError},UNIT_SQUARE_KILOMETER:{get:li.throwInstantiationError},UNIT_CUBIC_METER:{get:li.throwInstantiationError},UNIT_CUBIC_KILOMETER:{get:li.throwInstantiationError},UNIT_DEGREE:{get:li.throwInstantiationError},BIM_UNSUPPORTED_MSG:{get:li.throwInstantiationError},EARTH_CTRL_ARCGIS_IMAGERY:{get:li.throwInstantiationError},EARTH_CTRL_BLUE_IMAGERY:{get:li.throwInstantiationError},EARTH_CTRL_POSITION_INFO:{get:li.throwInstantiationError},EARTH_CTRL_POSITION_LON:{get:li.throwInstantiationError},EARTH_CTRL_POSITION_LAT:{get:li.throwInstantiationError},EARTH_CTRL_POSITION_HEIGHT:{get:li.throwInstantiationError},EARTH_CTRL_POSITION_MODEL:{get:li.throwInstantiationError},SEM_MODEL_PICK_RESULT:{get:li.throwInstantiationError},TOOLTIP_DEFAULT_TEXT:{get:li.throwInstantiationError},TOOLS_LEFT_CLICK_TO_START_DRAW:{get:li.throwInstantiationError},TOOLS_RIGHT_CLICK_TO_END_DRAW:{get:li.throwInstantiationError},TOOLS_CLICK_TO_CONTINUE_DRAW:{get:li.throwInstantiationError},TOOLS_CLICK_STOP_DRAW_RIGHT_CANCEL:{get:li.throwInstantiationError},TOOLS_SUBMERGENCE_POLYGON_NAME:{get:li.throwInstantiationError},TOOLS_SUBMERGENCE_PICK_WATER_START_HEIGHT:{get:li.throwInstantiationError},TOOLS_SUBMERGENCE_PICK_WATER_MAX_HEIGHT:{get:li.throwInstantiationError},TOOLS_SUBMERGENCE_LEFT_CLICK_TO_DRAW_WATER_AREA:{get:li.throwInstantiationError},TOOLS_SUBMERGENCE_INTERSECT_POLYGON_NOT_ALLOWED:{get:li.throwInstantiationError},TOOLS_SUBMERGENCE_RE_PICK_MSG:{get:li.throwInstantiationError},TOOLS_PROFILE_POSITION:{get:li.throwInstantiationError},TOOLS_PROFILE_DISTANCE:{get:li.throwInstantiationError},TOOLS_PROFILE_XAXIS_NAME:{get:li.throwInstantiationError},TOOLS_PROFILE_SERIES_NAME:{get:li.throwInstantiationError},TOOLS_VOLUMETRIC_CLICK_TO_DRAW:{get:li.throwInstantiationError},TOOLS_VOLUMETRIC_DOUBLE_CLICK_TO_STOP_DRAW:{get:li.throwInstantiationError},TOOLS_VOLUMETRIC_CUT_VOLUMETRIC:{get:li.throwInstantiationError},TOOLS_VOLUMETRIC_FILL_VOLUMETRIC:{get:li.throwInstantiationError},TOOLS_VOLUMETRIC_CLICK_TO_MODIFY_BASE_PLANE:{get:li.throwInstantiationError},TOOLS_VOLUMETRIC_TEMP_LINE_NAME:{get:li.throwInstantiationError},TOOLS_VIEW_THROUGH_WATCH_POINT:{get:li.throwInstantiationError},TOOLS_VIEW_THROUGH_TARGET_POINT:{get:li.throwInstantiationError},TOOLS_VIEW_THROUGH_CLICK_TO_START_RIGHT_END:{get:li.throwInstantiationError},TOOLS_TERRAIN_EXCAVATION_CLICK_ADD_SECOND_POINT:{get:li.throwInstantiationError},TOOLS_MEASURE_SLOPE_LEFT_CLICK_START_LEFT_STOP:{get:li.throwInstantiationError},TOOLS_MEASURE_SLOPE_LEFT_CLICK_STOP:{get:li.throwInstantiationError},TOOLS_MEASURE_SLOPE_SLOPE:{get:li.throwInstantiationError},TOOLS_MEASURE_LINE_LENGTH_LENGTH:{get:li.throwInstantiationError},TOOLS_MEASURE_AREA_PROJECTION_AREA:{get:li.throwInstantiationError},TOOLS_MEASURE_HEIGHT_HEIGHT:{get:li.throwInstantiationError},TOOLS_MEASURE_LEFT_START_RIGHT_END:{get:li.throwInstantiationError},TOOLS_MEASURE_AZIMUTH_LEFT_TO_START:{get:li.throwInstantiationError},TOOLS_MEASURE_AZIMUTH_LEFT_TO_STOP:{get:li.throwInstantiationError},TOOLS_DRAW_POLYGON_AREA_NAME:{get:li.throwInstantiationError}});var uce=A0t;var fOe=class extends uce{constructor(){super()}get INFORMATION_BAR_LON(){return"Lon: "}get INFORMATION_BAR_LAT(){return"Lat: "}get INFORMATION_BAR_VIEW_HEIGHT(){return"View Height: "}get UNIT_METER(){return"M"}get UNIT_KILOMETER(){return"KM"}get UNIT_SQUARE_METER(){return"\u33A1"}get UNIT_SQUARE_KILOMETER(){return"k\u33A1"}get UNIT_CUBIC_METER(){return"m\xB3"}get UNIT_CUBIC_KILOMETER(){return"km\xB3"}get UNIT_DEGREE(){return"\xB0"}get BIM_UNSUPPORTED_MSG(){return"Your version DON NOT support BIM, please contact developer!!!"}get EARTH_CTRL_ARCGIS_IMAGERY(){return"ArcGisImagery"}get EARTH_CTRL_BLUE_IMAGERY(){return"BlueImagery"}get EARTH_CTRL_POSITION_INFO(){return"Position Info"}get EARTH_CTRL_POSITION_LON(){return"Lon"}get EARTH_CTRL_POSITION_LAT(){return"Lat"}get EARTH_CTRL_POSITION_HEIGHT(){return"Height"}get EARTH_CTRL_POSITION_MODEL(){return"Model"}get SEM_MODEL_PICK_RESULT(){return"pickResult"}get TOOLTIP_DEFAULT_TEXT(){return"please create hint content"}get TOOLS_LEFT_CLICK_TO_START_DRAW(){return"left click to start drawing"}get TOOLS_RIGHT_CLICK_TO_END_DRAW(){return"right click to end drawing"}get TOOLS_CLICK_TO_CONTINUE_DRAW(){return"click to continue drawing"}get TOOLS_CLICK_STOP_DRAW_RIGHT_CANCEL(){return"click again to stop drawing, right click cancel"}get TOOLS_SUBMERGENCE_POLYGON_NAME(){return"polygon"}get TOOLS_SUBMERGENCE_PICK_WATER_START_HEIGHT(){return"click to pick water start height"}get TOOLS_SUBMERGENCE_PICK_WATER_MAX_HEIGHT(){return"click to pick water max height"}get TOOLS_SUBMERGENCE_LEFT_CLICK_TO_DRAW_WATER_AREA(){return"left click to drawing flood area"}get TOOLS_SUBMERGENCE_INTERSECT_POLYGON_NOT_ALLOWED(){return"intersecting polygon not allowed"}get TOOLS_SUBMERGENCE_RE_PICK_MSG(){return"water max height less than start height, please pick again"}get TOOLS_PROFILE_POSITION(){return"Position"}get TOOLS_PROFILE_DISTANCE(){return"Distance"}get TOOLS_PROFILE_XAXIS_NAME(){return"route"}get TOOLS_PROFILE_SERIES_NAME(){return"Elevation"}get TOOLS_VOLUMETRIC_CLICK_TO_DRAW(){return"click to start drawing first point"}get TOOLS_VOLUMETRIC_DOUBLE_CLICK_TO_STOP_DRAW(){return"double click to stop drawing "}get TOOLS_VOLUMETRIC_CUT_VOLUMETRIC(){return"Cut Volume:"}get TOOLS_VOLUMETRIC_FILL_VOLUMETRIC(){return"Fill Volume:"}get TOOLS_VOLUMETRIC_CLICK_TO_MODIFY_BASE_PLANE(){return"click to modify the height of base plane"}get TOOLS_VOLUMETRIC_TEMP_LINE_NAME(){return"TemporaryLine"}get TOOLS_VIEW_THROUGH_WATCH_POINT(){return"Watch Point"}get TOOLS_VIEW_THROUGH_TARGET_POINT(){return"Target Point"}get TOOLS_VIEW_THROUGH_CLICK_TO_START_RIGHT_END(){return"click to add watch point, right click to end"}get TOOLS_TERRAIN_EXCAVATION_CLICK_ADD_SECOND_POINT(){return"click to add second point"}get TOOLS_MEASURE_SLOPE_LEFT_CLICK_START_LEFT_STOP(){return"left click to start, click again to stop"}get TOOLS_MEASURE_SLOPE_LEFT_CLICK_STOP(){return"left click to stop"}get TOOLS_MEASURE_SLOPE_SLOPE(){return"Slope: "}get TOOLS_MEASURE_LINE_LENGTH_LENGTH(){return"Length: "}get TOOLS_MEASURE_AREA_PROJECTION_AREA(){return"Area: "}get TOOLS_MEASURE_HEIGHT_HEIGHT(){return"Height: "}get TOOLS_MEASURE_LEFT_START_RIGHT_END(){return"Left click to start, right click to end"}get TOOLS_MEASURE_AZIMUTH_LEFT_TO_START(){return"Left click to start azimuth"}get TOOLS_MEASURE_AZIMUTH_LEFT_TO_STOP(){return"click to end azimuth"}get TOOLS_DRAW_POLYGON_AREA_NAME(){return"PolygonArea"}},E0t=fOe;var pOe=class extends uce{constructor(){super()}get INFORMATION_BAR_LON(){return"\u7ECF\u5EA6\uFF1A"}get INFORMATION_BAR_LAT(){return"\u7EAC\u5EA6\uFF1A"}get INFORMATION_BAR_VIEW_HEIGHT(){return"\u89C6\u70B9\u9AD8\uFF1A"}get UNIT_METER(){return"\u7C73"}get UNIT_KILOMETER(){return"\u5343\u7C73"}get UNIT_SQUARE_METER(){return"\u5E73\u65B9\u7C73"}get UNIT_SQUARE_KILOMETER(){return"\u5E73\u65B9\u5343\u7C73"}get UNIT_CUBIC_METER(){return"\u7ACB\u65B9\u7C73"}get UNIT_CUBIC_KILOMETER(){return"\u7ACB\u65B9\u5343\u7C73"}get UNIT_DEGREE(){return"\u5EA6"}get BIM_UNSUPPORTED_MSG(){return"\u5F53\u524D\u7248\u672C\u4E0D\u652F\u6301Bim\u6A21\u5757\u529F\u80FD\uFF0C\u8BF7\u4F7F\u7528CimSDK!!!"}get EARTH_CTRL_ARCGIS_IMAGERY(){return"ArcGis\u5F71\u50CF"}get EARTH_CTRL_BLUE_IMAGERY(){return"\u84DD\u8272\u5E95\u56FE"}get EARTH_CTRL_POSITION_INFO(){return"\u5750\u6807\u4FE1\u606F"}get EARTH_CTRL_POSITION_LON(){return"\u7ECF\u5EA6"}get EARTH_CTRL_POSITION_LAT(){return"\u7EAC\u5EA6"}get EARTH_CTRL_POSITION_HEIGHT(){return"\u9AD8\u5EA6"}get EARTH_CTRL_POSITION_MODEL(){return"\u6A21\u578B"}get SEM_MODEL_PICK_RESULT(){return"\u62FE\u53D6\u7ED3\u679C"}get TOOLTIP_DEFAULT_TEXT(){return"\u8BF7\u521B\u5EFA\u63D0\u793A\u5185\u5BB9"}get TOOLS_LEFT_CLICK_TO_START_DRAW(){return"\u5DE6\u952E\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236"}get TOOLS_RIGHT_CLICK_TO_END_DRAW(){return"\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"}get TOOLS_CLICK_TO_CONTINUE_DRAW(){return"\u70B9\u51FB\u7EE7\u7EED\u7ED8\u5236"}get TOOLS_CLICK_STOP_DRAW_RIGHT_CANCEL(){return"\u518D\u6B21\u70B9\u51FB\u7ED3\u675F\u7ED8\u5236\uFF0C\u53F3\u952E\u53D6\u6D88"}get TOOLS_SUBMERGENCE_POLYGON_NAME(){return"\u591A\u8FB9\u5F62"}get TOOLS_SUBMERGENCE_PICK_WATER_START_HEIGHT(){return"\u70B9\u51FB\u62FE\u53D6\u521D\u59CB\u6C34\u9762\u9AD8\u5EA6"}get TOOLS_SUBMERGENCE_PICK_WATER_MAX_HEIGHT(){return"\u70B9\u51FB\u62FE\u53D6\u6700\u5927\u6DF9\u6CA1\u9AD8\u5EA6"}get TOOLS_SUBMERGENCE_LEFT_CLICK_TO_DRAW_WATER_AREA(){return"\u70B9\u51FB\u5DE6\u952E\u7ED8\u5236\u6DF9\u6CA1\u533A\u57DF"}get TOOLS_SUBMERGENCE_INTERSECT_POLYGON_NOT_ALLOWED(){return"\u4E0D\u5141\u8BB8\u51FA\u73B0\u4EA4\u53C9\u9762"}get TOOLS_SUBMERGENCE_RE_PICK_MSG(){return"\u6700\u5927\u6DF9\u6CA1\u9AD8\u5EA6\u5C0F\u4E8E\u521D\u59CB\u6C34\u9762\u9AD8\u5EA6\uFF0C\u8BF7\u91CD\u65B0\u62FE\u53D6"}get TOOLS_PROFILE_POSITION(){return"\u6240\u5728\u4F4D\u7F6E"}get TOOLS_PROFILE_DISTANCE(){return"\u8DDD\u8D77\u70B9"}get TOOLS_PROFILE_XAXIS_NAME(){return"\u884C\u7A0B"}get TOOLS_PROFILE_SERIES_NAME(){return"\u9AD8\u7A0B\u503C"}get TOOLS_VOLUMETRIC_CLICK_TO_DRAW(){return"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9"}get TOOLS_VOLUMETRIC_DOUBLE_CLICK_TO_STOP_DRAW(){return"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"}get TOOLS_VOLUMETRIC_CUT_VOLUMETRIC(){return"\u6316\u65B9\u4F53\u79EF\uFF1A"}get TOOLS_VOLUMETRIC_FILL_VOLUMETRIC(){return"\u586B\u65B9\u4F53\u79EF\uFF1A"}get TOOLS_VOLUMETRIC_CLICK_TO_MODIFY_BASE_PLANE(){return"\u70B9\u51FB\u4FEE\u6539\u57FA\u51C6\u9762\u9AD8\u5EA6"}get TOOLS_VOLUMETRIC_TEMP_LINE_NAME(){return"\u4E34\u65F6\u7EBF"}get TOOLS_VIEW_THROUGH_WATCH_POINT(){return"\u89C2\u5BDF\u70B9"}get TOOLS_VIEW_THROUGH_TARGET_POINT(){return"\u76EE\u6807\u70B9"}get TOOLS_VIEW_THROUGH_CLICK_TO_START_RIGHT_END(){return"\u70B9\u51FB\u6DFB\u52A0\u70B9\uFF0C\u53F3\u952E\u7ED3\u675F\u7ED8\u5236"}get TOOLS_TERRAIN_EXCAVATION_CLICK_ADD_SECOND_POINT(){return"\u70B9\u51FB\u6DFB\u52A0\u7B2C\u4E8C\u4E2A\u70B9"}get TOOLS_MEASURE_SLOPE_LEFT_CLICK_START_LEFT_STOP(){return"\u5DE6\u952E\u5F00\u59CB,\u518D\u6B21\u70B9\u51FB\u5DE6\u952E\u7ED3\u675F"}get TOOLS_MEASURE_SLOPE_LEFT_CLICK_STOP(){return"\u70B9\u51FB\u5DE6\u952E\u7ED3\u675F"}get TOOLS_MEASURE_SLOPE_SLOPE(){return"\u659C\u7387\uFF1A"}get TOOLS_MEASURE_LINE_LENGTH_LENGTH(){return"\u957F\u5EA6\uFF1A"}get TOOLS_MEASURE_AREA_PROJECTION_AREA(){return"\u6295\u5F71\u9762\u79EF\uFF1A"}get TOOLS_MEASURE_HEIGHT_HEIGHT(){return"\u9AD8\u5EA6\uFF1A"}get TOOLS_MEASURE_LEFT_START_RIGHT_END(){return"\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01"}get TOOLS_MEASURE_AZIMUTH_LEFT_TO_START(){return"\u70B9\u51FB\u5F00\u59CB\u8BA1\u7B97\u65B9\u4F4D\u89D2"}get TOOLS_MEASURE_AZIMUTH_LEFT_TO_STOP(){return"\u70B9\u51FB\u7ED3\u675F\u8BA1\u7B97\u65B9\u4F4D\u89D2"}get TOOLS_DRAW_POLYGON_AREA_NAME(){return"\u591A\u8FB9\u5F62\u9762\u79EF"}},mOe=pOe;var gOe=class{constructor(f){f=Z(f,_G.ZH_CN),this._local=new mOe,this.language=f}set language(f){switch(f){case _G.EN_US:this._local=new E0t;break;case _G.ZH_CN:this._local=new mOe;break;default:console.log(`\u4E0D\u652F\u6301\u7684\u8BED\u8A00\uFF1A[${f}]`);break}}get language(){return this._local}},T0t=gOe;var D8i=function(o){if(!o.extensionsUsed||!o.extensionsRequired)return;let f=o.extensionsUsed.indexOf("KHR_technique_webgl"),m=o.extensionsRequired.indexOf("KHR_technique_webgl");if(f!==-1){o.extensionsRequired.splice(m,1,"KHR_techniques_webgl"),o.extensionsUsed.splice(f,1,"KHR_techniques_webgl"),o.extensions=o.extensions||{},o.extensions.KHR_techniques_webgl={},o.extensions.KHR_techniques_webgl.programs=o.programs,o.extensions.KHR_techniques_webgl.shaders=o.shaders,o.extensions.KHR_techniques_webgl.techniques=o.techniques;let v=o.extensions.KHR_techniques_webgl.techniques;o.materials.forEach(function(y,x){o.materials[x].extensions.KHR_technique_webgl.values=o.materials[x].values,o.materials[x].extensions.KHR_techniques_webgl=o.materials[x].extensions.KHR_technique_webgl;let C=o.materials[x].extensions.KHR_techniques_webgl;for(let w in C.values){let A=v[C.technique].uniforms;for(let E in A)if(A[E]===w){C.values[E]=C.values[w],delete C.values[w];break}}}),v.forEach(function(y){for(let x in y.attributes){let C=y.attributes[x];y.attributes[x]=y.parameters[C]}for(let x in y.uniforms){let C=y.uniforms[x];y.uniforms[x]=y.parameters[C]}})}},hce=typeof window<"u"?window:typeof self<"u"?self:{},cce=setTimeout(()=>{cce=void 0,hce.logSmartEarth&&hce.logSmartEarth()},1e4);function S0t(o,f){pa.supportsImageRenderingPixelated()&&(o.viewer.resolutionScale=f?window.devicePixelRatio:1),o.viewer.scene.fxaa=f,o.viewer.scene.postProcessStages.fxaa.enabled=f}function Jh(o,f={},m,v,y){this._core=new PC(this),this._cesium=qi,cce&&(clearTimeout(cce),cce=void 0,f.VERSION!==!1&&hce.logSmartEarth&&hce.logSmartEarth()),this.G=65535,m=Z(m,Z.EMPTY_OBJECT),N(f.StaticFileBaseUrl)?globalThis.GEOWORLD_BASE_URL=f.StaticFileBaseUrl:globalThis.GEOWORLD_BASE_URL="./CimSDK/",globalThis.CESIUM_BASE_URL=globalThis.GEOWORLD_BASE_URL,globalThis.SmartEarthRootUrl=globalThis.GEOWORLD_BASE_URL,tlt();let x=Z(f.language,_G.ZH_CN);this.i18n=new T0t(x),f.toolbar=Z(f.toolbar,!1),f.baseLayerPicker=Z(f.baseLayerPicker,!1),f.shadows=!1,f.skyAtmosphere=new Yq,f.terrainShadows=Cl.ENABLED,f.animation=!0,f.shouldAnimate=!0,f.fullscreenButton=!1,f.geocoder=Z(f.geocoder,!1),f.homeButton=!1,f.infoBox=!1,f.selectionIndicator=!1,f.timeline=Z(f.timeline,!1),f.defaultImagery=Z(f.defaultImagery,!0),f.printLog=Z(f.printLog,!0),f.navigationHelpButton=!1,f.imageryProviderViewModels=[],f.terrainProviderViewModels=[];let{webgl:C={}}=f.contextOptions||{},{alpha:w=!1}=C;if(f.contextOptions={requestWebgl2:!0,webgl:{alpha:w,preserveDrawingBuffer:!0},failIfMajorPerformanceCaveat:!1,ellipsoidCoordinates:f.ellipsoidCoordinates},f.navigation=!0,f.disableRightClickMenu=!0,typeof f=="string"?f.imageryProvider=new EC({url:f}):(f.url&&(f.imageryProvider=new EC({url:f.url})),this._core.extend(f,f,!0)),f.baseLayerPicker){let S=this.getAllImageryView();if(f.basemaps)f.basemaps.forEach(M=>{f.imageryProviderViewModels.push(S[M])});else for(let M in S)f.imageryProviderViewModels.push(S[M])}else f.imageryProvider||(f.imageryProvider=new EC({url:`${globalThis.GEOWORLD_BASE_URL}Workers/image/earth.jpg`}));let A={destination:H.fromDegrees(f.x?f.x:93.53987,f.y?f.y:24.77445,f.z?f.z:257935006e-1),orientation:{heading:xe.toRadians(Z(f.heading,0)),pitch:xe.toRadians(Z(f.pitch,-90)),roll:xe.toRadians(Z(f.roll,0))},duration:f.duration||1};if(f.removeGlobe&&(f.skyBox=!1,f.skyAtmosphere=!1,f.contextOptions={requestWebgl2:!0,failIfMajorPerformanceCaveat:!1,webgl:{alpha:!0,preserveDrawingBuffer:!0}}),this._Viewer=new Uae(o,f),this._tree=v,this._Viewer.scene.globe.baseColor=Re.WHITE,this._Viewer.shadowMap.size=2048,this._Viewer._cesiumWidget._creditContainer.style.display="none",this._Viewer.terrainShadows=Cl.ENABLED,this._AttachEvent=void 0,this._DetachEvent=void 0,this._Analysis=void 0,this._Navigate=void 0,this._Creator=void 0,this._Command=void 0,this._ProjectTree=void 0,this._Coordinate=void 0,this._VectorTileProvider=void 0,this.toolbar=f.toolbar,f.removeGlobe){this._Viewer.imageryLayers.removeAll(),this._Viewer.shadows=!1,this._Viewer.scene.fog.enabled=!1,this._Viewer.scene.globe.show=!1;let S="rgba(0,0,0,0)";this._Viewer.scene.backgroundColor=Re.fromCssColorString(S),this._Viewer.scene.light=new rae({direction:new H(1,-.9,-.9)}),f.backgroundImage&&(this._Viewer.container.style.backgroundImage=`url(${f.backgroundImage})`)}else this._Viewer.scene.globe.depthTestAgainstTerrain=!0;if(f.defaultImagery&&window.navigator.onLine&&this.judgeOnline().then(S=>{this._factory.createImageryLayer({sourceType:"arcgis",url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",zIndex:1})}).catch(S=>{console.warn("The current network cannot be connected, so we will not load the arcgis imagerylayer")}),this.coreMap=this._Viewer,this._environment=new BDe(this),this._infoBar=new Cpt(this),this._camera=new eDe(this),this._measure=new TDe(this),this._shapeTool=new vut(this),this._editTool=new MDe(this),this._factory=new $D(this),this._tools=new xMe(this),this._edit=new y3e(this),this._analysis=new V3e(this),this._userScene=new jRe(this,m),this._view=new Lmt(this),this._bim=new Bmt(this),this._MilitaryPlotting=new Y3e(this),f.maxViewHeight&&(this._Viewer.scene.screenSpaceCameraController.maximumZoomDistance=f.maxViewHeight),f.minViewHeight||f.maxViewPitch){this.minViewHeight=f.minViewHeight,this.maxViewPitch=f.maxViewPitch&&xe.toRadians(f.maxViewPitch);let S=0,M=this._Viewer.scene,I=!1;if(this.maxViewPitch){let P=new Ur(this._Viewer.scene.canvas);P.setInputAction(()=>{I=!0},Ei.MIDDLE_DOWN),P.setInputAction(()=>{I=!1},Ei.MIDDLE_UP),P.setInputAction(()=>{I=!0},Ei.RIGHT_DOWN),P.setInputAction(()=>{I=!1},Ei.RIGHT_UP)}this._Viewer.scene.preRender.addEventListener(()=>{let P=this._Viewer.camera;if(!(!P||!P.positionCartographic)){if(this.maxViewPitch){let D=P.pitch;I&&D>this.maxViewPitch?(D=this.maxViewPitch,P.setView({destination:this.oldPosition||P.position.clone(),orientation:{heading:P.heading,pitch:D,roll:0}})):this.oldPosition=P.position.clone()}if(this.minViewHeight){S=M.globe.getHeight(P.positionCartographic)||S;let L,R,O=P.positionCartographic.height-S;this._Viewer.scene.globe.translucency.enabled||this._Analysis&&(this._Analysis._UndergroundMode&&this._Analysis._UndergroundMode.isUndergroundMode||this._Analysis._StreetView&&this._Analysis._StreetView.isStreetView)?(L=P.positionCartographic.height<-200,R=-200):(L=O<this.minViewHeight,R=S+this.minViewHeight);let F=P.pitch<0?P.pitch:0;L?P.setView({destination:this.oldPosition||H.fromRadians(P.positionCartographic.longitude,P.positionCartographic.latitude,R),orientation:{heading:P.heading,pitch:F,roll:0}}):this.oldPosition=P.position.clone()}}})}let E={};Vl.DEFAULT_VIEW_RECTANGLE=Di.fromDegrees(79,0,130,60),f.navigationOption=Z(f.navigationOption,Z.EMPTY_OBJECT),E.defaultResetView=Z(f.navigationOption.defaultResetView,Mt.fromCartesian(A.destination)),E.enableCompass=Z(f.navigationOption.enableCompass,!0),E.enableZoomControls=Z(f.navigationOption.enableZoomControls,!0),E.enableDistanceLegend=Z(f.navigationOption.enableDistanceLegend,!0),E.enableCompassOuterRing=Z(f.navigationOption.enableCompassOuterRing,!0),this._Viewer.cesiumWidget.screenSpaceEventHandler.removeInputAction(this._cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),this._Viewer.extend(this._cesium.viewerCesiumNavigationMixin,E),this.camera.setView(A),y&&typeof y=="function"&&y(),bpt.parse(this,m),f.mouseDownView&&this.mouseDownView(!0),f.printLog&&this.addLogo(),Object.defineProperties(S_.prototype,{_cachedGltf:{configurable:!0,set:function(S){this._vtxf_cachedGltf=S,this._vtxf_cachedGltf&&this._vtxf_cachedGltf._gltf&&D8i(this._vtxf_cachedGltf._gltf)},get:function(){return this._vtxf_cachedGltf}}}),f.disableRightClickMenu&&(document.oncontextmenu=function(){return!1});let T=function(S){if(S.cesiumWidget._supportsImageRenderingPixelated&&window&&window.devicePixelRatio){let I=window.devicePixelRatio;for(;I>=2;)I/=2;S.resolutionScale=I}};hb.prototype.getRenderedBestLevelInfo=function(){let S=this.getRenderedLevelInfo(),M=0;for(let I in S)M<Number(I)&&(M=Number(I));return{bestLevel:M,count:S[M]}},hb.prototype.getRenderedLevelInfo=function(){let S=[];return this._tilesToRender.forEach(function(M){S[M.level]===void 0&&(S[M.level]=0,S[M.level]++)}),S},S0t(this,!0)}Object.defineProperties(Jh.prototype,{environment:{get:function(){return this._environment}},entities:{get:function(){return this._Viewer.dataSourceDisplay.defaultDataSource.entities}},enableAA:{set:function(o){S0t(this,o)}},primitives:{get:function(){return this.coreMap.scene.primitives}},imageryLayers:{get:function(){return this.coreMap.imageryLayers}},view:{get:function(){return this._view}},terrainProvider:{get:function(){return this.coreMap.terrainProvider}},dataSources:{get:function(){return this._Viewer.dataSources}},camera:{get:function(){return this._camera}},showFPS:{get:function(){return this.viewer.scene.debugShowFramesPerSecond},set:function(o){this.viewer.scene.debugShowFramesPerSecond=o}},depthTerrain:{get:function(){return this.viewer.scene.globe.depthTestAgainstTerrain},set:function(o){this.viewer.scene.globe.depthTestAgainstTerrain=o}},measure:{get:function(){return this._measure}},shapeTool:{get:function(){return this._shapeTool}},editTool:{get:function(){return this._editTool}},edit:{get:function(){return this._edit}},analysis:{get:function(){return this._analysis}},factory:{get:function(){return this._factory}},userScene:{get:function(){return this._userScene}},tools:{get:function(){return this._tools}},hdr:{get:function(){return this.coreMap.scene.highDynamicRange},set:function(o){this.coreMap.scene.highDynamicRange=o}},sunGlowFactor:{set:function(o){this.coreMap.scene.sun.glowFactor=o},get:function(){return this.coreMap.scene.sun.glowFactor}},shadows:{get:function(){return this.coreMap.scene.shadowMap.enabled},set:function(o){this.coreMap.scene.shadowMap.enabled=o}},terrainShadows:{get:function(){return this.coreMap.scene.globe.shadows},set:function(o){this.coreMap.scene.globe.shadows=o}},shadowMap:{get:function(){return this.coreMap.scene.shadowMap}},shadowMapList:{get:function(){return this.coreMap.scene.shadowMapList}},textureProjectionMapList:{get:function(){return this.coreMap.scene.textureProjectionMapList}},viewShedMapList:{get:function(){return this.coreMap.scene.viewShedMapList}},clock:{get:function(){return this._Viewer.clock}},clockViewModel:{get:function(){return this._Viewer.clockViewModel}},sunShaftEnabled:{get:function(){return this.coreMap.scene.sunShaftEnabled},set:function(o){this.coreMap.scene.sunShaftEnabled=o}},MilitaryPlotting:{get:function(){return this._MilitaryPlotting}},core:{get:function(){return this._Core||(this._Core=new PC(this)),this._Core}},Analysis:{get:function(){return this._Analysis||(this._Analysis=new Ypt(this._Viewer,qi)),this._Analysis}},Creator:{get:function(){return this._Creator||(this._Creator=new lce(this._Viewer,qi)),this._Creator}},projectTree:{get:function(){return this._ProjectTree||(this._ProjectTree=new w0t(this._Viewer,qi,this._tree)),this._ProjectTree}},tree:{get:function(){return this._tree}},viewer:{get:function(){return this._Viewer}},toolbar:{get:function(){return this._Viewer._toolbar.style.display==="block"},set:function(o){this._Viewer._toolbar.style.display=o?"block":"none"}},wireframe:{get:function(){return this._Viewer.scene.globe._surface.tileProvider._debug.wireframe},set:function(o){this._Viewer.scene.globe._surface.tileProvider._debug.wireframe=o}},tileCoordinates:{get:function(){return this._Viewer.cesiumInspector.viewModel.tileCoordinates},set:function(o){this._Viewer.cesiumInspector.viewModel.tileCoordinates=o}},bim:{get:function(){if(!this._bim)throw new li(`${this.language.BIM_UNSUPPORTED_MSG}`);return this._bim}},maxProjectionCount:{get:function(){return this.coreMap.scene.maxProjectionCount},set:function(o){this.coreMap.scene.maxProjectionCount=o}},language:{get:function(){return this.i18n.language}}});Jh.prototype.brightness=function(o){let f=Z(o.enable,!0),m=Z(o.brightness,1),v=this.coreMap.scene.postProcessStages;this.coreMap.scene.brightness=this.coreMap.scene.brightness||v.add(D0.createBrightnessStage()),this.coreMap.scene.brightness.enabled=f,this.coreMap.scene.brightness.uniforms.brightness=Number(m)};Jh.prototype.judgeOnline=function(){let o=document.createElement("img"),f=new Promise((v,y)=>{let x=setTimeout(()=>{o&&(o.src="",o.remove(),o=null),clearTimeout(x),y("Timeout")},5e3)}),m=new Promise((v,y)=>{o.src="https://cim.smartearth.cn/dist_websdk/CimSDK/Workers/image/mark.png?time="+new Date().getTime(),o.onload=()=>(o&&(o.src="",o.remove(),o=null),v(!0),!0),o.onerror=()=>(o&&(o.src="",o.remove(),o=null),v(!1),!0)});return Promise.race([m,f])};Jh.prototype.addLogo=function(){let o=this;queueMicrotask(()=>{let f=` uniform sampler2D colorTexture; uniform sampler2D logoTexture; uniform vec2 logoSize; uniform vec2 offeset; uniform vec2 changeXY; uniform vec2 scale; in vec2 v_textureCoordinates; void main(void) { vec4 originalColor = texture(colorTexture, v_textureCoordinates); vec2 invPixelSize = czm_viewport.zw; vec2 logoCoords = logoSize * scale; vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / logoCoords; vec2 screenOffeset = ( czm_viewport.zw * offeset - logoCoords * changeXY) / logoCoords; if(dirtTexCoords.x > screenOffeset.x){ dirtTexCoords.x = dirtTexCoords.x - screenOffeset.x; }else{ dirtTexCoords.x = 0.0; } if(dirtTexCoords.y > screenOffeset.y){ dirtTexCoords.y = dirtTexCoords.y - screenOffeset.y; }else{ dirtTexCoords.y = 0.0; } originalColor += texture(logoTexture, dirtTexCoords); out_FragColor = originalColor; }`;o.logoProcessStages=o._Viewer.scene.postProcessStages.add(new as({name:"logo_mark",fragmentShader:f,uniforms:{logoTexture:`${globalThis.GEOWORLD_BASE_URL}Assets/image/logo2.png`,logoSize:new Ye(795,170),scale:new Ye(.3,.3),offeset:new Ye(0,0),changeXY:new Ye(0,-1)}}))})};Jh.prototype.getAllImageryView=function(){return{arcgis_img:new $m({name:`${this.language.EARTH_CTRL_ARCGIS_IMAGERY}`,tooltip:`${this.language.EARTH_CTRL_ARCGIS_IMAGERY}`,iconUrl:`${globalThis.GEOWORLD_BASE_URL}Workers/image/baseLayer/arcgis_img.png`,creationFunction:()=>new hC({url:"https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"})}),arcgis_dark:new $m({name:`${this.language.EARTH_CTRL_BLUE_IMAGERY}`,tooltip:`${this.language.EARTH_CTRL_BLUE_IMAGERY}`,iconUrl:`${globalThis.GEOWORLD_BASE_URL}Workers/image/baseLayer/arcgis_dark.png`,creationFunction:()=>new hC({url:"http://map.geoq.cn/arcgis/rest/services/ChinaOnlineStreetPurplishBlue/MapServer",enablePickFeatures:!1,usePreCachedTilesIfAvailable:!1,tilingScheme:this.core.getOffsetTilingScheme(this._Viewer,qi)})})}};Jh.prototype.navControl=function(o,f){let m=f?"":"none";this._Viewer.cesiumNavigation&&(o==="all"?this._Viewer.cesiumNavigation.container.style.display=m:o==="nav"?this._Viewer.cesiumNavigation.navigationDiv.style.display=m:this._Viewer.cesiumNavigation.distanceLegendDiv.style.display=m)};Jh.prototype.CreateWfs=function(o,f,m,v,y,x,C,w,A){return new ese(o,f,m,v,y,x,C,w,A,qi)};Jh.prototype.AttachEvent=function(o,f){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachEvent(o,f)};Jh.prototype.RemoNormalCesiumLeftDoubleClick=function(){return this._DetachEvent===void 0&&(this._DetachEvent=new sK(this._Viewer,this._cesium)),this._DetachEvent.RemoNormalCesiumLeftDoubleClick()};Jh.prototype.AttachOnLButtonDblClkEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonDblClkEvent(o)};Jh.prototype.AttachOnLButtonDownEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonDownEvent(o)};Jh.prototype.AttachOnLButtonUpEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnLButtonUpEvent(o)};Jh.prototype.AttachOnMButtonDblClkEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonDblClkEvent(o)};Jh.prototype.AttachOnMButtonDownEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonDownEvent(o)};Jh.prototype.AttachOnMButtonUpEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMButtonUpEvent(o)};Jh.prototype.AttachOnMouseWheelEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnMouseWheelEvent(o)};Jh.prototype.AttachOnFrameEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnFrameEvent(o)};Jh.prototype.AttachOnRButtonDownEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnRButtonDownEvent(o)};Jh.prototype.AttachOnRButtonUpEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachOnRButtonUpEvent(o)};Jh.prototype.AttachCameraChangeEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.AttachCameraChangeEvent(o)};Jh.prototype.CameraMoveEndEvent=function(o){return this._AttachEvent===void 0&&(this._AttachEvent=new GC(this._Viewer,this._cesium)),this._AttachEvent.CameraMoveEndEvent(o)};Jh.prototype.DetachEvent=function(o,f){return this._DetachEvent===void 0&&(this._DetachEvent=new sK(this._Viewer,this._cesium)),this._DetachEvent.DetachEvent(o,f)};Jh.prototype.DetachEventAll=function(o){return this._DetachEvent===void 0&&(this._DetachEvent=new sK(this._Viewer,this._cesium)),this._DetachEvent.DetachEventAll(o)};Jh.prototype.DetachCameraChangeEvent=function(o){return this._DetachEvent===void 0&&(this._DetachEvent=new sK(this._Viewer,this._cesium)),this._DetachEvent.DetachCameraChangeEvent(o)};Jh.prototype.extend=function(o,f){if(!N(o))throw new li("mixin is required.");o(this,f)};Jh.prototype.pick=function(o,f=!0,m=!0,v=!1){this.endPick(),this.pick_callBcak=o,this._Viewer._enableInfoOrSelection=!0,m&&(this.pick_stage=this.core.addPickStage(this._Viewer)),this.pick_handel=new Ur(this._Viewer.scene.canvas);let y,x,C,w;this.pick_handel.setInputAction(A=>{m&&this.pick_stage.remove(),y=this._Viewer.scene.pick(A.position),x=void 0;let E=this.language.EARTH_CTRL_POSITION_LON,T=this.language.EARTH_CTRL_POSITION_LAT,S=this.language.EARTH_CTRL_POSITION_HEIGHT;if(!y||v){let M=this._Viewer.scene.pickPosition(A.position);if(!M)return;let I=this.core.toDegrees(M);w=`${this.language.EARTH_CTRL_POSITION_INFO}`,x={[E]:I.lon.toFixed(6),[T]:I.lat.toFixed(6),[S]:I.height.toFixed(2)}}else if(y){if(m&&this.pick_stage.select(y),y.id)y.id.fid&&y.id.attributes?(w=y.id.fid,x=y.id.attributes):y.id.id&&y.id.properties?(w=y.id.name||y.id.id,x=y.id.properties.getValue?y.id.properties.getValue():y.id.properties):y.id.feature&&(w=y.id.feature.id,x=y.id.feature.properties);else if(y._modelId)y._modelId.id&&y._modelId.properties&&(w=y._modelId.id,x=y._modelId.properties);else if(!y.color&&y.content){w=`${this.language.EARTH_CTRL_POSITION_MODEL}${y.content.tile._priority}`;let M=this._Viewer.scene.pickPosition(A.position);if(M){let I=this.core.toDegrees(M);x={[E]:I.lon.toFixed(6),[T]:I.lat.toFixed(6),[S]:I.height.toFixed(2)}}}}if(f&&x){C='<table class="cesium-infoBox-defaultTable"><tbody>';for(let M in x)C+=`<tr><th>${M}</th><td>${x[M]}</td></tr>`;C+="</tbody></table>",this._Viewer.selectedEntity=new Wh({name:w,description:C})}else if(y&&y.getPropertyIds&&y.getProperty){let M=y.getPropertyIds();x={},M.forEach(I=>{x[I]=y.getProperty(I)})}this.pick_callBcak&&(y||x)&&this.pick_callBcak(x,y,A)},Ei.LEFT_CLICK)};Jh.prototype.pickPosition=function(o,f=!0){this.endPick(),this.pick(o,f,!1,!0)};Jh.prototype.endPick=function(){this._Viewer.infoBox&&this._Viewer.infoBox.viewModel.closeClicked.raiseEvent(),this._Viewer._enableInfoOrSelection=!1,this.pick_callBcak=void 0,this.pick_handel&&this.pick_handel.destroy(),this.pick_handel=void 0,this.pick_stage&&(this.pick_stage.remove(),this.pick_stage.destroy(),this.pick_stage=void 0)};Jh.prototype.mouseDownView=function(o){if(o&&!this.cursorHandel){this.cursorHandel=new Ur(this._Viewer.scene.canvas);let f,m;this.cursorPoint=document.createElement("div"),this.cursorPoint.className="mouseDownViewPoint",this.cursorPoint.style.cssText="visibility: hidden;opacity: 0;pointer-events: none;position: absolute;z-index: 999;transition: visibility 0.2s ease 0s, opacity 0.2s ease-in;",this.cursorPoint.innerHTML=`<img src="${window.SmartEarthRootUrl}Workers/image/cursor.png" style="width: 36px;height: 36px;">`,this._Viewer.container.appendChild(this.cursorPoint);let v=w=>{w=w||m;let A=w.position||w.endPosition;this.cursorPoint.style.top=`${A.y-18}px`,this.cursorPoint.style.left=`${A.x-18}px`,this.cursorPoint.style.visibility="unset",this.cursorPoint.style.opacity=1},y=w=>{let A=w.position||w.endPosition;this.cursorPoint.style.top=`${A.y-18}px`,this.cursorPoint.style.left=`${A.x-18}px`};this.cursorHandel.setInputAction(w=>{m=w,clearTimeout(f),f=void 0,this._Viewer.camera.positionCartographic.height<1e4?v(w):(this.cursorPoint.style.visibility="hidden",this.cursorPoint.style.opacity=0)},this.rightRotate?Ei.RIGHT_DOWN:Ei.MIDDLE_DOWN),this.cursorHandel.setInputAction(w=>{this.cursorPoint.style.visibility="hidden"},this.rightRotate?Ei.RIGHT_UP:Ei.MIDDLE_UP),this.cursorHandel.setInputAction(w=>{m=w,f&&y(w)},Ei.MOUSE_MOVE),this.cursorHandel.setInputAction(w=>{clearTimeout(f),v(),f=setTimeout(()=>{this.cursorPoint.style.visibility="hidden",this.cursorPoint.style.opacity=0,f=void 0},500)},Ei.WHEEL);let x=0,C;this.cursorHandel.setInputAction(w=>{this._PointFly&&this._PointFly.end&&this._PointFly.end()},Ei.LEFT_CLICK),this.cursorHandel.setInputAction(w=>{x++,clearInterval(C),C=setTimeout(()=>{x=0},500),x>=2&&(x=0,!this._PointFly&&(this._PointFly=new c8(this._Viewer,qi)),this._PointFly&&this._PointFly.end&&this._PointFly.end(),this._PointFly.setPointFly({position:this.camera.getMousePosition(w),hideImage:!0,time:this._rotateFlyTime,pitch:xe.toDegrees(this._Viewer.camera.pitch)}))},Ei.RIGHT_CLICK)}else this.cursorHandel&&this.cursorHandel.destroy(),this.cursorHandel=void 0,this.cursorPoint&&this.cursorPoint.remove(),this.cursorPoint=void 0};var L8i=Jh;function lK(o){this.mEarthCtrl=o,this.coreMap=o.coreMap,this.trackInfos=[],this.timer=null,this.animationController=new Ise,this.currIndex=-1,this.startTime=0,this.currentTrackInfo=null}function R8i(o,f){if(o.length===0)return null;let m=null;for(let v=0;v<o.length&&o[v].timeStamp<f;v++)m=o[v];return m}function O8i(o,f){f.type==="lookat"&&(console.log(f),f.duration===void 0&&(f.duration=4e3),o.coreMap.camera.flyTo({destination:f.position,orientation:f.orientation,duration:f.duration/1e3}))}lK.prototype.initialize=function(o){let f=0,m=this;for(let v=0;v<o.length;v++){let y=o[v];y.type==="lookat"&&(y.timeStamp=f,f+=y.stopTime,m.trackInfos.push(y))}m.animationController.addListener(function(v){let y=new Date().getTime()-m.startTime,x=R8i(m.trackInfos,y);x!==m.currentTrackInfo&&(O8i(m.mEarthCtrl,x),m.currentTrackInfo=x)})};lK.prototype.finalize=function(){this.animationController.finalize(),this.currentTrackInfo=null};lK.prototype.play=function(){let o=this;o.currentTrackInfo=null,o.startTime=new Date().getTime(),o.animationController.start()};lK.prototype.stop=function(){this.animationController.stop(),this.currentTrackInfo=null};var N8i=lK;var dce=1e-5*Math.PI/180,F8i=11;function px(o){this.mEarthCtrl=o,this._polylines=[],this._points=[],this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this.scene=this.mEarthCtrl.coreMap.scene,this._interval=20}px.prototype.createlineOfSight=function(o){let f=[],m=this,v=[],y=[],x={polyline:[]};m.objectsToExclude=null;let C,w=function(){function P(D){this.options={polyline:{show:!0,positions:[],material:Re.YELLOW,width:3,clampToGround:!1}},this.positionsp=D,this._init()}return P.prototype._init=function(){let D=this,L=function(){return D.positionsp};this.options.polyline.positions=new xn(L,!1),this.polyline=m.entities.add(this.options),m.item=this.polyline,y.push(this.polyline)},P}(),A=new Ur(m.scene.canvas),E=[],T;if(this._points.length>0)for(let P=0;P<this._points.length;P++)this.entities.remove(this._points[P]);let S=[];A.setInputAction(function(P){let D,L=m.camera.getPickRay(P.position);if(D=m.scene.globe.pick(L,m.scene),m.scene.pick(P.position)){let O=m.scene.pickPosition(P.position);O&&(D=O)}if(!!D)if(E.length===0){E.push(D.clone(),D.clone());let O={leftX:P.position.x,leftY:P.position.y};S.push(O),C=D.clone()}else{let O={rightX:P.position.x,rightY:P.position.y};S.push(O);let F={postion:E,entity:y,cartesian:S};v.push(F),S=[],T=void 0,E=[],E.push(C.clone()),E.push(C.clone()),T=new w(E),f.push(T)}},Ei.LEFT_CLICK),A.setInputAction(function(P){let D,L=m.camera.getPickRay(P.endPosition);if(D=m.scene.globe.pick(L,m.scene),m.scene.pick(P.endPosition)){let O=m.scene.pickPosition(P.endPosition);O&&(D=O)}!D||E.length>=2&&(N(T)?D!==void 0&&(E.pop(),E.push(D)):(T=new w(E),f.push(T)))},Ei.MOUSE_MOVE);let M=0,I=0;return A.setInputAction(function(P){let D=m.entities.add(new Wh);m.objectsToExclude=[D];let L=!0;for(let R=0;R<v.length;R++)if(R===0?(M=v[R].cartesian[0].leftX,I=v[R].cartesian[0].leftY,L=m.tsjx(v[R].postion,M,I,v[R].cartesian[1].rightX,v[R].cartesian[1].rightY,50,y)):L=m.tsjx(v[R].postion,M,I,v[R].cartesian[0].rightX,v[R].cartesian[0].rightY,50,y),L){let O=m.entities.add({name:"polyline1",polyline:{positions:v[R].postion,width:3,material:Re.BLUE}});x.polyline.push(O)}else{let O=m.entities.add({name:"polyline1",polyline:{positions:v[R].postion,width:3,material:Re.RED}});x.polyline.push(O)}E.pop(),m._polylines=x.polyline,A.destroy();for(let R=0;R<y.length;R++)m.entities.remove(y[R]);N(o)&&typeof o=="function"&&o(x)},Ei.RIGHT_CLICK),this};px.prototype.tsjx=function(o,f,m,v,y,x,C){let w={gcs:[],min:0,max:0,juli:0,cys:x},A=this.getSpaceDistancem(o);A<=100&&A>=10?x=parseInt(A/2):A<10&&A>0?x=parseInt(A/1):A>100&&(x=parseInt(A/10)),w.cys=x;let E=o[0],T=o[o.length-1],S=Mt.fromCartesian(E),M=xe.toDegrees(S.longitude),I=xe.toDegrees(S.latitude),P=S.height,D=Mt.fromCartesian(T),L=xe.toDegrees(D.longitude),R=xe.toDegrees(D.latitude),O=D.height,F=x,k=xe.lerp(M,L,1/F)-M,U=xe.lerp(I,R,1/F)-I,G=xe.lerp(P,O,1/F)-P,j=!0,q,J;for(let X=0;X<F-2;X++){let Y=M+(X+1)*k,Q=I+(X+1)*U,ee=P+(X+1)*G;q=H.fromDegrees(Y,Q,ee),J=Mt.fromCartesian(q);let z=this.scene.globe.getHeight(J),ie=this.scene.sampleHeight(J,C);if(ie&&(z=ie),z=parseFloat(z.toFixed(1)),ee=parseFloat(ee.toFixed(1)),z>ee)return j=!1,j}return j};px.prototype.getSpaceDistancem=function(o){let f=0;for(let m=0;m<o.length-1;m++){let v=Mt.fromCartesian(o[m]),y=Mt.fromCartesian(o[m+1]),x=new Im;x.setEndPoints(v,y);let C=x.surfaceDistance;C=Math.sqrt(Math.pow(C,2)+Math.pow(y.height-v.height,2)),f=f+C}return f.toFixed(2)};px.prototype.deleteObject=function(){if(this._points.length>0){this.objectsToExclude=null;for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o])}};px.prototype.InterpolateLineCartographic=function(o,f,m){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;let v=[];v.push(new Mt(o.longitude,o.latitude));let y=Math.sqrt(Math.pow(f.longitude-o.longitude,2)+Math.pow(f.latitude-o.latitude,2)),x=m&&typeof m=="number"?m:dce;if(y<=x)return v.push(new Mt(f.longitude,f.latitude)),v;let C=y/x,w=(f.longitude-o.longitude)/C,A=(f.latitude-o.latitude)/C;for(let E=0;E<C;E++){let T=o.longitude+(E+1)*w,S=o.latitude+(E+1)*A;v.push(new Mt(T,S))}return v.push(new Mt(f.longitude,f.latitude,f.height)),v};px.prototype.InterpolateLineCartographicxp=function(o,f,m){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;let v=[];v.push(new Mt(o.longitude,o.latitude));let y=Math.sqrt(Math.pow(f.longitude-o.longitude,2)+Math.pow(f.latitude-o.latitude,2)),x=m&&typeof m=="number"?m:dce;if(y<=x)return v.push(new Mt(f.longitude,f.latitude)),v;let C=y/x,w=(f.longitude-o.longitude)/C,A=(f.latitude-o.latitude)/C,E=(f.height-o.height)/C;for(let T=0;T<C;T++){let S=o.longitude+(T+1)*w,M=o.latitude+(T+1)*A,I=o.height+E*(T+1);v.push(new Mt(S,M,I))}return v.push(new Mt(f.longitude,f.latitude,f.height)),v};px.prototype.InterpolateLineHeightCartographic=function(o,f){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;let m=[];m.push(new Mt(o.longitude,o.latitude,o.height));let v=Math.sqrt(Math.pow(f.longitude-o.longitude,2)+Math.pow(f.latitude-o.latitude,2));if(v<=dce)return m.push(new Mt(f.longitude,f.latitude,f.height)),m;let y=v/dce,x=(f.longitude-o.longitude)/y,C=(f.latitude-o.latitude)/y,w=(f.height-o.height)/y;for(let A=0;A<y;A++){let E=o.longitude+(A+1)*x,T=o.latitude+(A+1)*C,S=o.height+(A+1)*w;m.push(new Mt(E,T,S))}return m.push(new Mt(f.longitude,f.latitude,f.height)),m};px.prototype.InterpolateIndexLineHeightCartographic=function(o,f,m,v){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;let y=(f.longitude-o.longitude)/m,x=(f.latitude-o.latitude)/m,C=(f.height-o.height)/m,w=o.longitude+v*y,A=o.latitude+v*x,E=o.height+v*C;return new Mt(w,A,E)};px.prototype.InterpolateIndexLineHeightCartographicxp=function(o,f,m,v){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;let y=(f.longitude-o.longitude)/m,x=(f.latitude-o.latitude)/m,C=(f.height-o.height)/m,w=o.longitude+v*y,A=o.latitude+v*x,E=o.height+v*C;return new Mt(w,A,E)};px.prototype.Interpolate2IndexLineHeightCartographic=function(o,f,m,v){if(!(o&&f)||!(o.longitude&&o.latitude&&f.longitude&&f.latitude))return null;let y=[];y.push(new Mt(o.longitude,o.latitude,o.height));let x=(f.longitude-o.longitude)/m,C=(f.latitude-o.latitude)/m,w=(f.height-o.height)/m;for(let A=0;A<v;A++){let E=o.longitude+(A+1)*x,T=o.latitude+(A+1)*C,S=o.height+(A+1)*w;y.push(new Mt(E,T,S))}return y};px.prototype.CartographicPointsTerrainData=function(o,f){if(o.length&&o.length>0){let m=Aq(this.scene.terrainProvider,F8i,o);(void 0)(m,function(v){f(v)})}};px.prototype.setVisibility=function(o){if(this._polylines.length>0)for(let f=0;f<this._polylines.length;f++)this._polylines[f].show=o};px.prototype.deleteObject=function(){if(this._polylines.length>0)for(let o=0;o<this._polylines.length;o++)this.entities.remove(this._polylines[o])};Object.defineProperties(px.prototype,{sight:{get:function(){return this.item.sight},set:function(o){this.item.sight=o}}});var B8i=px;var P0t=`#version 300 es precision mediump float;\r \r uniform float uAlpha;\r uniform sampler2D uTexture;\r uniform mediump float uColorCoding;\r uniform float uHighlighting;\r \r in vec2 vTexCoord;\r out vec4 out_FragColor;\r in vec4 vIdColor;\r \r \r void main(void) {\r if (uColorCoding > 0.0)\r {\r out_FragColor = vIdColor;\r }\r else\r {\r vec4 pixel = texture(uTexture, vTexCoord);\r if (vIdColor.x < 0.0)\r {\r \r out_FragColor = vec4(pixel.rgb * uHighlighting, uAlpha);\r }\r else\r {\r \r out_FragColor = vec4(pixel.rgb, uAlpha);\r }\r }\r }`;var I0t=`#version 300 es in highp vec3 aVertex;\r in highp vec2 aTexCoord;\r in highp float aId;\r \r \r uniform mat3 uRotation;\r uniform mat4 uPMatrix;\r \r \r \r uniform mediump float uColorCoding; \r uniform float uSelection;\r \r \r out vec2 vTexCoord;\r out vec4 vIdColor;\r \r vec4 getIdColor(float id){\r float product = floor(id + 0.5);\r float B = floor(product / (256.0*256.0));\r float G = floor((product - B * 256.0*256.0) / 256.0);\r float R = mod(product, 256.0);\r return vec4(R / 255.0, G / 255.0, B / 255.0, 1.0);\r }\r \r void main(void) {\r vec4 point = vec4(uRotation * aVertex, 1.0);\r gl_Position = uPMatrix * point;\r vTexCoord = aTexCoord;\r \r if (uColorCoding == 1.0)\r {\r vIdColor = getIdColor(aId);\r return;\r }\r \r if (uColorCoding > 1.0)\r {\r vIdColor = getIdColor(float(uColorCoding));\r return;\r }\r \r bool isSelected = abs(uSelection - aId) < 0.1;\r if (isSelected){\r vIdColor = vec4(-1.0, -1.0, -1.0, -1.0);\r }\r else{\r vIdColor = vec4(1.0, 1.0, 1.0, 1.0);\r }\r }`;var M0t={en:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAYAAAD0eNT6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAACAASURBVHic7Z3bc1VHdv/XuUniKgRGeISxbIMBg40NzviC+U2VPc6kKpeaqknykFRe5iGPec7/koepSl48qZSfUqmZTCZhjI0N+IbjASwbjM1NgMACdEHSkY5+D87WtFq9ulfvyzm9d38/Vaqzd+/evftor7PWt1f32ad26le/WiYAAAAAREW91x0AAAAAQPeBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAhpLhGd6nUnABDQIQhWUAKWlpY6y8vLsFUQPM3vFhdf6XUnABBwiohgqyB4JiYmTrXbbdgqCB6oVAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCmr3uQLdZXl7u2rVqtVrXrgUAAN2gmz6011Tdh1dWAIRgpFwfqm5UAIDyE4IP7TVV9+GVEgBlMVhTP6tiUCAffG0Z9gPyoCw+tNfo/6eyfv5KLwCqYrDq+yirMYH0ZLXjqjgk0H2q4kN7SfI/LNvnrrQCoMpGCzFQfYq2X9gQcFFlH9oryva5K50AKMJo82qziBteVmUJzPTC6ZbNKYFiKcoGyywoivLdoX/eSiMA8jCutG1Ig7Ct/ayGACFQbkJxjmVwSqAY8rLBUGw5T4pa7Be63y6FAMhicNy5adrMsjArrzna0A0KrCU0hwkbio8ifGgM5Om3Q/y8BS0Aso7YJW0VZdy1Ws262j9rWhZOPHxCd5yhOiWQL3n60SKuEwqSz0IWvx2izw5WAOQxQnftFwkX/E0GlNWoQjIo8D3dnLLKcv9DdEogP4rIdNqOl1UEuAZsJqrw2QlSAGRVnup+FmNOC2cQeqC3iQEfo6qCIVaJbo24uPPSZpRgP9UizxF8EYOpIsVC2tG53oZkcObrf0Py18EJAB+jSBP4u5EVMDlTfZ8TA1mFQAhGFTN5jbjyWG+CbFK8ZPGj3LFeDKbSkseDtFw+2lS/bJ+foARAWqN1GanUiLMYsC3Au+rbVqCmUZdlM8KqkGfmylXuEpRqGUQk4JDYXJb1UyGJggRXsDfVk04P+Hx+QvisBSUApJiM0xb4s4gC3z5xI3/bNbjRm2ogPs48pBQTWEsea1UkC0zVfdhCPEj9WRq/2MvMal7Y0vpc0Pf5Rpevr+7lZzMYAeBrtGkCv+0cnz6Y4AK9foNtgkBiZGVTmLGQxukWLUKzCEjYTTnJI/hLgnlZpwaI7H7W5a/1c/WBmq0tjl5+3oIRAC4ko35TucSos6pX22IR/Zh6szkxwBmZ3l7oxgVW4xv8pXZoG4EgGxAPRQd/aUY1bd+yCgWXXbuysZLBmenz5NOH0AhCAPgYj81QXfUk2QNJf1RMXx+xOWC1TBcDtlG/WsfXmcPpF0fazBV3btasgHQ6yWUPsJlqIg3+voMo23lZ+pYnrtS/yf9KM7FZswC9oucCwOemS0f4JjEgNXJfpArQlC5Ka3ScY3f1M2RDrDKS4O8SpZL2ueyQyfZgD9Ui7Qhb95V6PW5gpe+nyQr41isS/fPAZV2TfdM5XGY2ZMHdcwHgwjZqtwV6dd9WR2/TtG/DdtNcBpG8SoSALRsAERAukqyTySZNdTl7cmWKkmMQAfEiDdCS4N+tjIAvtvbT2rlLCOifSS7LEOpnracCwGUQruCv11XrScWBb59M9SUrR0111TKTELAZle7QQzWwqpJmxCUZPUkyAdwxqRPyEYx6G6AaSGzP9eo633Q9ab+kpLVN3bZNgzD9OurnR79+Wf1v8BmABJehcsGf2+baSQM3ItOvY3LGiUGZhIBehxvB6YbpykqU0VDLjGTU7zOqSnAtRIJwBES8DXH25yp32W03MwHSUb/LzlXfyYkBLhsg/WyF+FnrmQDwHf1z5bphdjodY7nLkPV9V/9sN9akLrljEiGQ1Jc4dAkhGmLVcI2aXPv6Oeq+adRhm0aSCEfYQzlJE0w5e+PaNvlMVxv6cWmf88wAcH6ZO8818OLKTe1xnynbZ00ygMuboDMAEhFgC/6mwG9zvHr7kr7ZRmEmI+GEg25cejuma8Ghh0nW4M/Zvd5+sq3ec85+XHYBm4kDV/B1DbC4Mr2cu5bPIEuvxwVUE9LUvOm4HvD1cnWbK7O1HxJBCgDOSEwBnYio0+kYA71NCJjatPXFpdoSXOl/kxgwCQF12yYS0oqA0A2ziriCPedU9W09s2SzQc4eIBbjQBqEbYHeVcf0ypXZ+mUr545JBK0uiG3t+wZ8G2X4bAUnADijkTpO159+DndNmyGaFCP3PqTpf3Vfbdc0mjNtq+dDBPQOzm5N5TZHazrH1KZtCkAtt9mL2i7sobrY7IkL/tI6tkGV9DMh6WsCJ37VYzZMtm4a+dtEQBWyAMEJABWbCEj2ubS/esy2LoBTp41GgxqNBhER9fX1Ub1eX1Nvfn6elpaWaGlpaVW5bjwu56sLAbUfnJGatk3nhGx8VcZkWy7RajrPtO0K+qo9mexBbUOtD6oFZxu240m5yz65AZRtMOXy57Y+cfVs8+z64In7vOhIpmH163C+23YsBIIWAAmcAXJljUaDHnnkEWq1WiuBvNVqUbPZXNlOjrVaLerr66Nms0nNZpP6+vqo1WoZAz5Hu92mubk5evjwIU1NTdH9+/fpwYMHNDk5SXfv3rUGZX07ua7NSCQiQN0H+SEZtZgcnU/w37ZtGz377LPiPi0sLNAHH3ywsq+PZKTO0uaw1LZB+ZEE6GeeeYb27t1rPMfVlm8f8sbHTvWsq6vO9PQ0/fd//7dIXIdOVwWA64Zzhsi1YRr1Ly8v07p16+jNN9/Mp9MCEkGxadMmGh4eXnWs3W7TxMQEjY+P05UrV+ju3bvWLECn0zFmA3RcIkBt0yYmQlKjoZO3w+LEQH9/P42MjIjbefjwoTHYS7ZBHEiCd7KflA0NDdGTTz5ZeN/KxuTkpMi3qoTqZ4PNANjSSrayJN0fCq1Wi0ZGRmhkZIRefPFFmp6epkuXLtGFCxdoZmaGiNIbh80AbVkHUDy+KVJTajXN9WxrAWznwjaASpGj8yri+xkK5TMXnADwmQMyiQCfNnrBxo0b6fnnn6dDhw7RlStX6NNPP6W7d++uqpNMBahTAhyudQbqPkcoxlgFTCMqUx3ujzvH57q2xUnJdnIORGI8SDOrQI7Ex4b8uQpGAEimB7g5U86RhkytVqPR0VEaHR2lS5cu0Ycffkizs7OrpgLq9frKq62dPKYCQDZc86Amu1Xrmo6lvT7R2uyQK9jb6oJ4cNkxsFO2z5F8pVsXcTnDso7+OXbv3k0/+9nPaO/evatEjPotBpsA0rdVfDIqIF9M94SbGkhe005hccKYO6b3BQDgB/f5KdPnKigBYPuH2pyW7vBCWwcgoa+vj44dO0bHjh1btYrbJAKSfSI+yEhS0SBfJClWTrzmEZhVezG1JWkXdgJAPAQlAFzoziyv9GlI7Nu3j958801qNBprRAAX/F3TH0jr9RZbMOZEQJZr2K7DnQcAEb4Z4oPkK4OhE5wAkMylqtu2dGdZ2bVrF73xxhur5vRNYkCSFdHLbJT9/xYCUvu1vaa5D5JpMYgB4EOZAlkv4Z4jUIb/X3ACIMHmSLkRTpUc2K5du+jll19eCfrcSN80gkQWIEzSBmZp25IphTyuBcqJLSCZnjgK3Ej+TyH/L4MVADpcatNWp+wcOHCARkdHicg9dxzD/6NMSARX3tMAXJvSfoD4QOBPR9b/Wyj/5yC+BmhzQNJpAG5fyuXLl+nBgwcrj/OdnZ2l+fl5arfbtLi4uPLo4L6+Pmo0GtTf30/r16+nzZs30+DgIA0ODtLmzZtXfj8gL1599VUaHx+ndru9ZkqAiP+6n35MrwPyQWprXCDOa0Suni955K9eztUH1cD1fHvdPpaXl+ncuXN07do18XSVuvjaVIc7L9nu6+ujv/3bv/V6X//2b/+28kA1Pf2e7EtefeouLi6uOU+9rolQP0s9FwBpHZ8t0Kdp81e/+hW1220i4tWd6yY2Gg3avn077dy5k5588knasWNH5hu/YcMGOnToEH300UcrzwQwPeglweTgk76rx+Dgu4Mr8CfbeU5l2USiXg82EBfckyL1OkRE9+/fp3v37jmnl7h9ro5pETMR0bp167zfzzfffEP37t1b6bce1NWy5HkqpjqS8/V97v+mXyNkei4AEiROT5Lqzuo8fYK/HmiXlpbo5s2bdPPmTfr4449p8+bNdPDgQTp06BC1Wq3UfTpw4AB9/vnntLCwYHyveOhP70mTCdD3s9iwb7C32Qdspxq4gj03KOCySS4bMtmNKbNgylKmtTku6JqCN1cny77eB98+95pSrQFwleU9l2lSfDbD0us+ePCAPvjgA/rnf/5nunDhQup+tFot2rdvnzgV5wokmPMtBp//q0nM5nFfJO3argPbqC4+AYvze+q2ZF+Sbs8DLtCb+pdkUbl9ic/3eV8hBXydoARAFueTx8ifM3h13+cvYW5ujn7729/Sb37zm9QPKdqzZ4841ZYFBIBisIkxbmogS/u2bBmIB1fwkQQ1LqDXarVVaXXTPucTbb42zXuUZAJc/SdaLQZsA0DX/07fDpWgBIBK2pRqHvgEf/14sq++JttjY2P061//OlWfh4aGaOvWrUTkH+i5KRIEg2JwjbCLCswuu8DIH9hG35LgZqpjCqJ6m1Ifmvb9uK7FHVfLbWsEJD7e1T9J/W4TpACwBak8Rrk2TDfMpAT1Y1yZfs6lS5fok08+SdW3nTt3WtP93BQB6D7SNS1pzvO5nuTzAjspL2kCp2ugIhUBarktrS4JwFmwjcBNIkUiSGzTAq7XtO8prQjKQpACQEc6l52XI+MUr1rmkyrS2z1z5gxNTU1592t4eHjVflEjOgSEfOhVFkufGgJxIwkqeYgA2yhZD8AJXHkapNdQ/0yBnssE6GWmV67MtB8CQQsAVyZAcp4PLmPmMgGm+lwZEdHi4iJ99tln3v0bHh5mMyLc/wpBoLf4iICsQdv3XNhGPHDBiBu1phEBXIBNME0NcH3xeV9ScWIK9uo5yXH1mKmMEzq29xJi8CcKXAB0Ey6om17V475lyevY2Jh3Hzds2EDN5vff3Mw6lwzn3z3SrNnwbb/I+qCa+IoALlC6BkrSgVXW9+ASJ+oxUwbX9D659rj/l14WOpUQAEWl/k3HTMdt+5wxzMzM0J07d7z7uHHjRjjwktLL+4YpgWojCTqSQU6y7RrtSoOqKxibrumLS8BIr+vbR2nwT3tvukHpBUBRTo0TA3kZdK1Wo7t373r3a+PGjd7nEGHUFxLdnKPHfQcqUhGgl0tEgF7X5y/L+5EIDZNI8REsEiGQNvj3ktILAJ0s8/+mbb2O7Rh3LvcBun//vnc/1SmABHzfu7wUtQAQxIc0mLp8lGtErdc3LZrjzk/TXykmH6uvO9C3bWJGLefESh7Bv5cioXICICvcDU5zrouFhQWv+kR/EACgemRdAIjAD6RIBjKubbW+a+U8l00wtZnmvfgEdy5DwJ1juyZXL/SRfwKiiZAibmiapwLm/WuDAIBqUau5f/AnqUe0Vniq5WpbybbqC9U69Xpd/PwL3Z+ayiRIgjyXgeXO09s1Xc90zFWetW4RIAPQQ9IE86WlJSJyG06vDQsA0DvyCEKulLcrYEqmFWzXStN/12jc1n/biN6nTpp+94pKZQCKSIGqCjfvG9bX1+d9TvKTxSqSfoVgbACAMOGyAeqx5LieFdDLXZkF0/WyBH+b6HCl/k2v3LZrSsC33yGADMD/kccP6viel2ZF/8zMTDDGAwAIlywpdUmZZBRc5Mjf1o5PJsC3z7brSvsaCqXMAHTr61OmeaoE7hi3It8kLDZv3uzdr+npabYPPoRkhACAYpCuB9DPSeBG6CZfyGUBXBmBrFkAtT3TlIUkE+BaH2C6Vto+hkQlMwBpBILtF/NsP74jPU+/Vq1Wo+3bt3v1cXp6mubm5oiIX5wSmoEBAHpLkQMFLoiattX9Iv2UK5hLy03tZul7iL65lBkAouJ+CEhvj5vvcp3rmlIYHh72XgNw+/ZtVuFyZSEaHQCgu0h9l7SdhCzPXclj5G8KylkFRt4CJWQfXFoBUASmoM/t287nMgIqTz31lHf/rl+/vmqfywJkJWSDBQCkJy8hoLdpSvVzQb5bz6vgxIHpWFEDptB9aSUEQB6/fqcHbZsIcK0PSPY5IdBoNOiZZ57x7t/Vq1etBi0pUwndOAEAxeAjBIoM3qa1AmnbKcKfVSndb6ISAiAvuAdfqMdcHxxb6j/Zf+6552jDhg1efbt69SrNzs6u+UlLCS4hAACIk7QZAV0U6FkAE6YHChUlKPQybvGf/prVP5bNv5ZKABSZOlIDNicCknquKQBue3l5mQYHB+mVV17x7t+FCxfYxTS+BmyrUzYDBgBkpxcp+ipQdn9ZKgFQJPqIPQn86sjfNE2g7pvaVF/XrVtHf/EXf0GtVsurb3fu3KGrV6+u+h1u9fqSaQEAAJCQ10K/KlI1nwoBoGFK+atCgMge+LnnAWzZsoX+/M//nLZu3erdp48++kg8ykfwBwAUhWmhX7JvSu1zCwFN7aTxWdw3AEwLAE3vw9aO65wqAAGgYJuXMmUA9HITzWaTXnjhBXrppZdS/ZLft99+uzL6V68pTf+b5rz0bQAAqDqxBHUfIAD+D9cUgCkDkJynt0NEtG3bNtq3bx8999xzNDAwkKpP8/PzdPLkSaOaTZv+j93gAQAAfE9lBEDWeaqhoSGanJykhYWFVeWmEb4uFNavX09DQ0M0NDREO3bsoF27dtHg4GCm/hARnThxgmZmZlb91rZtxI+RPgAAACmVEQBZ+bu/+zsi+v7X9qampmhmZoY6nQ7Nz89Tp9OhdrtNrVaLms0m9fX1UbPZpFarRYODg6l+1c/FmTNn6PLly2u+9scFfpsgsG0DAACIEwgAjVarRVu3bk21WC8vzp07R59++qlx3j/ZlpTpuAI/hAEAAMRDpX4MqApfV7l48SK99957bDqfe5iFTh4PtQAAAFBdkAEIiPPnz9O7775LROZgn5Srx03bOpL0P8QCAADEBQRAACwtLdEHH3xAn3/+uXWOn0Py3X8EeAAAACoQAD3m2rVr9M4779C9e/dWrfZXX5PtrN/9BwAAABIgAHrEzZs36cMPP6RvvvmGarXamuCfbLsCvHoOFvkBAACQAgHQRSYnJ+mbb76hCxcu0MTERC4BPo/0P4QBAADEBwRAl+h0OvSrX/2Kbt26lXoBn7qPxXwAAACyUKmvAYYc/Or1Ov3xH//xqu/2q7ge4uN60I+pHA//AQAAwIEMwP/x1ltvUb1ep76+Purv76eBgQHq7++nvr4+6uvrW3mef6vVokajQfV6nXbu3MkGdBPbt2+nw4cP0yeffIKADAAAoKeUVgCYntGfhYmJCePvANh4/fXX6ciRI17XOXr0KF26dImmpqZy+XUqCAngg/5z17afb02w/fgV7A+A8lKZKYC8HBGXbjdd6+TJkzQ1NeXVfrPZpNdff93YXpb3AEcMiFYHeP2vqOu5/gAAYVIZAZAHth/ZSb6qp/44T7vdpuPHj3tf54knnqCnn346r24TUTUegwzSE/L9hyAAIEwgAP4PfVW+6U+vX6vV6NKlS/T11197X+9HP/oR9ff3Z+43HCrICzVAFxm0IQYACINSCYAi09y2gG8TBbVajY4fP07tdtvrehs2bKCjR4/m/TZWoTpYONt40YO6ui0NxEUFbAgBAHpHqQRA0ZiCvpry58qmp6fp1KlT3td79tlnaWRkxFmPc5CmcjjUeMl7/r2bdgS7BaD7VEIA5JkZUAO8KfhzUwVnz56l27dve1/v9ddfp0ajQUR2J6g79TydJRxv9eFG/9wx/bxuLfaDEACge1RCAKikFQOmgK8es2UAkq9OHT9+3Nt5DQ0N0eHDh9eUSwO9pF4RogGEiymAc/XSigBbe2XLPgAQK6UUAK7vz6cRAdwI3xTs9frJ3+3bt+ncuXPe137xxRdpaGiIPa4HcJODNr3q26AcpLlnXNB12Q7Xhm+wN9XNKgZguwAUSykFQBHYHr1r+iogNz3w/vvv08zMjNe1G40G/ehHP1pVZnOeUmfuA5xtGORxH0y2w00h+dqQK/C7ytO+FwBA/lRKAGRdC6CO+PV9U9A3lbXbbTp58qT3tUdGRmjfvn1E5Ha8pmNqHe5crm0QBnkFf32bC/qmYC0N6KbrSgI/AjoA4VApAUCUbQ2AKfC70v5q/eScr776ir799lvvPhw9enTlNweI+K9vmcq49KsPcMzlxRXs1XoSQdDpdFihIBEFUmHh+/4AAPlRegHgWg/g2w73XX8u5a+WJ+fX63U6ceKE97MB+vv76ejRo+J516TM9Mqd76oDyotEMNrK1aCvH/P5M/XLJgR83x8AIB9KLwCIivsdAJ8MgD59MD09TZ988ol3H55++ml6/PHHrU7V5UxtgcAFnGx5cdmJJHDb0vg2e0wjBEzlvu8RAJCe0gqAPL/7n7RnCurJti0DwK0b+Oyzz2hyctK7L8eOHaNWq0VEfqu3kQWIF1ewt9UxlXU6nZU//Tp6tkAiCGx91ctBfOQxdQv8KY0AkNzkLIYgGenbjpkWEHY6HXrnnXe8+7Jp06ZVzwawOeqkTK2rvyILUH1cKf8kkJuCs2m+X62rigEuM6BPH6jH1X7p/bVtu94rKD95BXAIgXSURgB0C0mA11f/cxmAWq1Gt27dorGxMe9+HDp0iLZt2+Z0qGlGU3Cg1cSVXucCv+0YJxhMGQBTu6a2ub4BkBcQAzJKLQDyvMnSFf62bIAuBJLtDz74gObm5rz6U6/X6f/9v/9HtVrNmWI1HUu2dZByrSZcICYiNpgnx1wZAJsQsAV3kxBQX7lyaRYA9lseejVCR2bATukEgCkIq+Vpb7ge9PU29Xq2v3q9vqru/Px8qh8L2r59Ox04cICI+K/66ce4oG9LwZqAcy0fkgyRHsCTY7oQ4EQD902BpNw2+jftq/VMr6D8hBCAQ+hDiJRCAHTj5rmCv20hICcC1O0vv/ySrl+/7t2vH/7wh7Rhw4aVfR/nKRklwdF2h6LXsCRIUv62aQBTRkCf/3eJAVO7aUQoKC9pBmLd8vMQA38gaAGQZTSf5Xqm4G9bIGg7R90/efIkLS0tefWp1WrRsWPHrNMAaplpW61vOgaKwSQq1VfbOT5I0/ZE/HQAF/RtYsAlLkz2aRMFyALEQ5ZsbR5tQgR8T7ACwOcmmtL3aa5nC/jqts/oXz3//v379Nlnn3n3CJ+cKAAAIABJREFUbdeuXfTEE0+IR/9Sx4nsQPFw9mhzVHmJAHVbFwG2dD+37xP4k2tz2QO976Zt6fsG4eCy3W6OwCV9iZ0gBUAvb4xpvp+IVi3wU4/ZRvwmEXD27Fm6d++ed7+OHj1KfX19RCSb03cJgixOF9jxsd+8bd0lAvR5f0kWwCYG9Pb1trnjrlG+TxYA9ltusooCpPXTE6QAMGEb4ZtG62na54J2sqgvqWf6USB9rYDeZlJnaWmJ3nvvPe/+rV+/nl588cVVZVmmAUB4ZHVitvttmgZQt23pe5sY4ASC6fqmPur1uPcBwsZ3Wktalua6vm3HLB6CEgA+KRvbfE9e0wD6qzT1T0RrRIJaNj4+ThcvXvTu3zPPPEPDw8Ps8TSjekwD5Idun1ydIh0ON/I3HTNlA2xZAb2uvm/LPiTbpn7a3gsIH5/gatrP4/Ogt2NqFyJgLUEJAClc0M8rjcQFfX0awHS+bRqA6A8i4NSpU7SwsODdx6NHj67pg3Q6ABRHmvnGPDJXJiQiwJYBcC30S9rxTfO76sBOq40tIGfN3kquAdbS7HUHEmq1tQ+8kZSbXtNeP3nlArleVye5fq1WW3GOpmBdr9dpbm6Ozpw5Q8eOHfPq59atW+m5556jzz//3Fk3y/8DdB9bVstGo9Gg0dFRY3vqq2nbR0zbRlWceE62JycnaWFhQWyTsN1yo/ttdZ/z6Wmv41sHdvUHei4AkpvhMgiuXuJodGNL0w9bFkAv49pIRjL1en1llMSJgLGxMXr66adpx44dXn194YUX6JtvvqHp6WnxOZwYUf+v+GD447JfzhGabCrtPRgYGKCf/vSn3ud1k3fffZdu3LhBRLQqEOjo/wPYZZjY7F4S4PO6p/qALY9McEwEOwUgma+xpeyzXJML/qZMAFeWbHMPD0qOnzx5cs0vrrloNBr02muviepiOiAM8k7zlxHXAkCbbcJuy4ct81Tla5eJYAWAiuQG5uVgOUXJBX7XlIGr7r179+j3v/+9dz8fffRR2r17d6r3CGfaXUwpSC49X1UHlWaBKigXNt+cvLr8aNrrcj5YkrWNmVIIgASJ8aQ1JFcQN12TOz/5M30d0HT87NmzNDU15d3nH/7whzQwMBC9EYeEzQ4lNmOqVxWko321PigHvgHWVJ7Wb6e5JrIC3xOcADDdGJ8MQFYVSURrvtdv64tN1aptcc6+Xq/T0tISffDBB9597u/vX/NsABA2NvHIHa8qCPDVhhPAtgxp2uvYsmq2PsVOUALAdnNcKXW9Ttpr24zT1QdbBsGVIbhx4wZ988033v3evXs3Pfroo873ZQOOOB9cIw+TUNSPw0GBMuP7GXCdJ7keN2h0xQN81gITACYkKZ48HKgpKHPXlgR3vQ1bBiDZPn36tPezAYiIXn75ZWo0GmIBBFXcHTjHxL1mEbAAhATnk23Z0jwGbq5rpb1OVQlSALhGTOq+GkiTV/XRvT7XNAV/SRDnjnGiIilTy5NnA3z66afefd+0aRM9++yzK23p/dbLQf5IRzY2eyJa+5sTVcNHrFf5/1AVfEbxLp+apQ82n51X/6tIMALA55/vUnZ5KElum8sK6PucY9fb1NcbjI2N0cTEhHf/Dx48SFu2bLG+N1A83P/alQ1QhWJVgR3GgU30qsfzsH8ui2AbPII/EJzH4YxDsp3lRrtUpCsDYds3lamCIMkGJPVOnz7tPS9fq9XopZdewggrMDjnxJVV1VlJRlq2913F/0kVcd1nLlBn9dvSNn38Ywz0/EmAvphumv4o4LQZAJdj1sttmJ52xj15T+338vIy3bt3j8bGxmj//v1e72Hbtm20Z88eunTpktd5QEZyf9LWNd17FfUx0devX2cfnCMp80X6mfERler23NwcOwq0BQ046d7jY/fcuZztq7670+nQ5cuXvdpfXFxcuU7yyo3+s9hSVe2w9u///u89WQLOGRT34yCuHxFR92u1Gq1fv975nWPVOGZmZlbK9GNp1Krph1Ak7yOhXq+veg8mx2jqV6fTWeVsuawG915NBGL8p4jolV53IiGt/er3PHkKpOlV/cEevc28f0THFng5m1HLuEyGtFzfNh3z6X8vmZiYONVut4Ox1Txx2b26b/K/th+EUuuaytLaIXdO1qxUFQg6A6ArTx81aXpOvu0Z5BLjsaWUbNeQPodffb+dTsf4HrgMhXrcZy6t6gbeSyRZgKROvV6nTqez6jURCMm2qU1930cMSOxZL7N9JkzBnaunl2PkX11MNku09jPAZcYkNukK5rAvM8EJADXIc8Ffd4amYKvWs42i9XJJ8JeMlqVCQH0fpnZsSPrpcsIgX2z2S+SeBkrEQHIuF/xN56nlWfov2XcFfte25NqgPNjsXT1us2G9foLPwM2nXO9rjAQnAHRMAT/ZTnCNsG3GpV7HNHLR63MjFu7aUoFias80mpMau8vZut4DyAebkJXUV8tMjlOto+P63Ej7bzrP9lmxbXPHJG2D8mEbsJnKswzc1G1XHfA9QQoAbhSVHCNaaxy6AelOU62r70sDvdQhSUZnukCxBXvXdfRgL9n3uQ7wg7NfyX3WxQEngDnnyNm79B5LRuiSkZU0+Pv2z7fPoHvYxK4ka6tvSwdu+raP747ddoIUACq20Q43IuIcn0tRqttpAj/Xd/X6PiLAFSx8HbGtb6A4TCLQZzrIVK7bvM/cv62ftjLuuMT+fMSq6dWnz6B3pBUBROapgKS+6Tr6NmerCP48wQoA1+jJpQ5NBuYzunGV29rjUrj6hyDZN5VJ+2vrp2SkBQdbDPo99xEBrnaTc03lCb6CwDdDYLIjWwZAco5vX0CY+IiAZDvBd6rK5ePSDt5ioWcCgHNkXF3bwqqkHdNNtrVvG92kCfz6cZuK5YK+b1Dwca74MOSHxH6lIkDfV++TawrBJgh8RICP2NTLOYcrGenbrgM7DQ8fv62fJ/kMmOxWkrm17Wfx4VUn2AwA0VqnaJtX5cSBzRFKU0vS/QSfxVouxesa6UmN3uasQfHYHCCRXfipmSL9PkoFbta+u9rlAr+pTCJOYZvlhhOrNl8tDfSma3FlyDDZCVoA6EgyAQmu46a2bfV9Aifn2NMIgbyyAXq57/8EpMPmCNVt9TWBywaYskWuz4BPf33quQRzUZkp2Gb4uEQAkX1tl6R9WxmCv5tSCABu1EQkC/SSFfauNKe0jsvZS/qcNnUrVcL4EOSHdCRuWunsmgPVg74uBnwdpg9pPw8+IpQrh32Gj9T2OBGQnCv1idL+2M7HoGctPRcAPoZkqucqd7UnPZ5GMNjmunz7K+2nqTyNc43tg1A0tlG/WidBtx1ODHDn6eVZ+y497jO6R/CPA5O/S8qJeCEgbdu0basH/kDPBYAv3OjHZkBZUot5pORdq7/zEgOm8+FcuwPn5Lg6LjtWsYkBrk5R5JE5gzitDhK7T+oR2f1zmm/FqOf7HstStyoEIwCkhqTXtTnQvOaSuDpSXGIlj1RuEcIF5A9nu7ZsgIprrUg3pwNs9VzCIK19wjbLjc3P6/fWZ/F2lnoxE4wAIPIXAUT+z46WtOkqS4urz7bRn7RfWYULPjTpSTsa4rIBen0TeWePpPh+VqQZAd9rgt7j47eT+kTyad80/enGOVUgKAFAlI8x5aEkizQIV5+zfINBUu7bDpCTRybLZ3rI9/OSF2nsMs+sGgiLNHaYd9aqm4KhKgQnAIiyGRNR+lFRtw0hS9CXtAl6Q56ZLMmUVkj3vKjptJDeIzCTVoxKB2yu89IQu10FKQCIso1sfOdPQyDth8B0bh7XB9lIm8kiymeKqBv4ZtAwQqs+RaxnKgrYVcACgCj/9GaZbng3+1qm/0uZyDoiSvPgqF7g6gMyWvHRq6kpCbCpPxC0ACAK25ASQhuZScEHoXiyjIhsWSHpvcs7i1b0uXm2AXpLkd9MSQNsai3BCwAi+/x+L/BdABVCn3XwYegueQhZ19SWzzl5UFTbsM1qEcIgDjZlphQCQKWXqjKPOUx8EOKlKNutyj2tyvsAa+mFD4Q9uSmdAEjolhDI24jwQQChpUZ7DewzLor0gbAlP0orABKyrJ6XtFck+CDETUiZoW4D+wRE2f037CgbpRcAOmU1iDTzu65zQXnIW8iGCOwUuICNdJfKCYCqgQ9EnGQRhL0GNgtAOYAAAKBEILgCAPKi3usOAAAAAKD7QAAAAAAAEQIBAAAAAEQIBAAAAAAQIRAAAAAAQIRAAAAAAAARAgEAAAAARAgEAAAAABAhEAAAAABAhEAAAAAAABECAQAAAABECAQAAAAAECEQAAAAAECENCcmJk71uhMAuNi8efOdXbt2wVZB8GzZsuVOvV6HrYLgabbb7Vd63QkAXDSbzVONRgO2CoJn3bp1p4gItgqCB1MAAAAAQIRAAAAAAAARAgEAAAAARAgEAAAAABAhEAAAAABAhEAAAAAAABECAQAAAABECAQAAAAAECEQAAAAAECEQAAAAAAAEQIBAAAAAEQIBAAAAAAQIRAAAAAAQIQ0e90BAADP8vJyr7uQiVqt1usuAAAYIAAACISyB3sTpvcEUQBAGEAAANBDuhn0fa5VZJBW+wExAEDvgAAAoMtkCfrdEgxpr+Mb0CEGAOgdEAAAdAnfoFrGKYEsKf/kXAgBALoDBAAABeMTyMsY9F34jvIhBADoDhAAABSIJKDnFfS7JR6yBGYfMbC8vAwRAECBQAAAUABFBP5eZhLUQGxr2ydgS0b6EAEAFAcEgEaRjhPEgcuGpDbG1eumEEjsV9JOrVZbUy+PlD9EAADFELUA6EbKlLsGHFo1ySP463VM53RzasEFJxJ0QZAl5Y91AQDkT1QCIKQFVmlGSiBsbPblKwzU/bQCIA+yfB1QD/55pPyRDQAgPyovAEIK+jbwfejqIhUGtqAfwojfNTq3nacGf6T8y0+3Fq7maQewqbVUVgCUJfCbQLqzfKSZr0+OmQK/tL2s6wlUJCl6rp5exgV8fTtNyh8CoTek8alZ/XCeAgF+dS2VEwBlDvw6MNjwSZP2twV8W7o/r7UBHNLV/Sa71IOyvi6AC/6w8XIQ6rMssiw6ldavMpUSACF+nzoPA4OTLB+u4O8K/LbjRU8HcKNuU5lNBKhtccFfPe4z2sdnojvkmWHqBr7BPfZsUiUEQNFpprzbTmtwcHph4Zv2lwR/X4Fgu56kT9Jgb6pr+tofh+vrhLYpgdiddC8oWmT6npvm/kvFQMx+tfQCIK0R9lKxZk1BxWywoZM1+KvlrrUBadcD+J5jGsUn+3raX+2nba2AngUwZQVAb8g7+Ofha30ErO18CIHVlFoAFLkoJQ+jLXo+KkaDDRmf4O8T+CXrBGzlWTCN8k02qwfvZN81LSAVAcgOdAeXDWURB0VMrfquAZAKgVhsqrQCwNeY0hh21nlU3/R/2oAek8GWDWnwt5Wr55va1Lf162dZdMcF72RbH/HbsgKmdnxG/rDzYrH5uzSBP2+fmmB74mReaf9YBlelFAB5pZ/ySKH6XFf6ZLQ0xgfn2D18s0g+wZ8L/D6ZAP0YJxjSZKj0fX3Eb2rfRwSo9THi7x5Zgr9NiBbpYxM4v5rHaL/q9lY6AZBH8JeMnHyvpeNaXCURA77GV3VjDRmXrfkGf1uZqW1JXzhsNiN1jqoY4Oq5Rm5psgIgO2l9IOdHpf41LT5tSrJekuNVtcPSCQAJaQN/NzIApuM2I/XNBlTZWMuEa1SkB/VOpyMSA+oxU9tZ+6qjp/P1MrUNW0ZAbcOVvsUUWBhIgr8r0+Rqz2W/3H2V+lJum+tfbCKgNALAN+3KlUlHS2lGVbZVz3obpnKXEIAICI80aXjbH5FMDNiukQaf6QCTENAX/dkyAjYRoF4LWYDi8QnWerlJmHL102apbD7TJE5dotNlU7GJgNIIAAlZDDAPR8pd32WophGQydh8RkhVNNayoNuSa1Qv/TO1p18vLdxiP1PQV6+rpvZtaX7OketIHTUojqzBP012QNovmwhI4MSAalM2X+o6ViWbrIwAkAZ/LvCnVag2TIaoGhDnZKWjIxdVM9YyYArU+nGf4N/pdIx1Tdfk9l3B1BS0TW3o7eijflt7qm3rTliv4wJ2nQ8+Po4L+BJRYPPNUmwj/KTcJWJNbaYZ8VfJ/iohANIEf4kj5cqSctfiKZsTtJVLFkNVyQirDCcIkuCuHu90OlSv11edX6/X14yeOUGpX1M/RzKfKjmmCgA91Z/sJ+9Dr6P+H1yZAP1zAIpH4ks532oTv2kHWrb1Idw6E1sbehYg9kxTJQSAjo86ddWTXIc7ZjNWl0CwTRVw15D0A6TDVxxKR/pEtEoI7N+/n3bu3FnQu+gt4+Pj9MUXXxCRLE0LikNqz67gbwr60lffftrm8k1TUzqcD7bZXNWzAKUXABKlaRuFqdu+6tS3nyZjdc2ZuoQAREA4uOzFZIfqgr8k3R8DkixAUg+2my95Bn+XAEg78tcxZb6S8uTVNTWl1pf4XPVaVRUBpRYAaYO/LfDbDNVmtCZDs40Q9QVT3EIpPRtgUqtVMMSqwDlSzjlyWYEqI7VX2HU42OyXK+f8sF4mQc+mJq/6qF/1j5wPNvlTU7n+/qtoi6UWACakwd8mCPQyU9sqtkVUtlG/SwjkKQKqasAh4hr5uEZQVcUmiIn8vv8Pe84P1+hfEuSl29z1pH3k0va2UT+H3lZSZutD1YRBaQWAzbGqx6XB35UJcJWbkMxLqcdMBqm241oUBREQJpyzTPY7nc6qdQBVhhOwoDv42JjNn3L27MoQ2LZN2HymelxdbKoPrpLjXDbAJAJisc/SCgAVbvTtUq9cHb2+7/Wl85o249MxiQDJtUD3MIlIl23GlgWwEYvTDQnb6D/ZlmQIJILA1J6PAJDM0+tCQIKPCKhaFqCUAsBlkMlrmuBvc9oS9FF/UmaqYzMmqVG69nXKbKwhY7MRH2cZswCAXYYD5wddtuuTCTDtu/pEZJ4GMI389Yypzb64LGvVAr5OKQWAistpcoaoPmBFbyeLkbr6alO0toBvM/4qGWQZcNmDaYTDnRPb6F9NyYLwkGasfP9M7XHXbLVaRPS9jbTb7ZVyUyBOym0jf67M9v59/WpZfXDpBYAK50xNKnR4eJi2bNlCjUaDGo0G9ff3U7PZpFarRa1Wi5rNJvX19VGr1aJGo7HySkTUbDap2fz+X5c88KTT6dDS0hLNzs7S7OwsPXjwgO7evUt37tyhmzdv0tLSkmjkT5T92dVlNcaqIXGmXN0qwtmka3Tm0xaQ42OftjrJX6PRoJ07d1K9Xqd6vU6tVotqtRo1Gg1qNptUr9dX/G1SRvT9vUy2TXQ6HVpYWKD5+XmanZ2l6elpevDgAd27d48WFhZEI3/9gVomuOnVKvvT0gkAU2Dn6nCOdnl5mY4dO0ZPPvlk7v3btm3bmrLFxUW6fv06ffXVVzQ2NkYzMzNrhAC38C/ZVt+XZCrARpUNukxw6dKqI7U92Gi+pLUtk53qr8vLy9RsNunpp5/Op7MK9XqdBgYGaGBggAYHB1cde/DgAd28eZPGx8dpdnbWKASIvhcR3FSsXqbC+cqqDLxKJwA4OONUj9uUbZE0m00aHR2l0dFReuONN+jLL7+kM2fO0M2bN619cYkC2xRAGY2xCricpMn+sthkknnq9b2WXF990JF01N/r9xUbtqkqk1DtpV8lItq8eTNt3ryZ9u7dS7dv36aLFy/S/fv3Reeq/lOFG3xV0RZLKwBshqpuhzbCqtfrtH//ftq/fz+dP3+ejh8/TjMzM0RkfyqgJOAn9UEY2GyNEwK+XLp0ic6cOWOcW9dHQuqraVs9z/Yqadv1Z2oH6wO6h832bD7TlPoPwa8SEQ0PD9Pw8DDduHGDzp8/T4uLi8Z66lRssm/DJwtQNuruKmFgMzLbqJ/bDsFgDxw4QD//+c/pqaeesn7Qkn3bq4kQ3mNM+IhS037e90sPtPqrLRjX6/VVr6ZjpsBtK9Ov49t3UCzS0b/pnJB8zcjICB07doy2bNmy6lHb3IDQdTxB8h5D+j9IKI0AMOGTrgpNrSasX7+e/vIv/5KOHDliDfoSYwztvcWA9H/uSvvncd+4gG8bnSflXMBX27Odb/pT29L7YjrP9n4k5SBfOBsNOQuQMDAwQC+99BI9+uij1v5KP4MScV9GSi0AdMqq0Gq1Gr355ptWEaDikwUA3SHtPSg6A2AK0upPDksCtlpuGv0n5dwx/Tq2AC7JDoB8cWVHbSJA3Q7ND9XrdXr++efpkUceYUf2tqyAXjfZrxKlFACcQeqv0psaCj/+8Y9p165d4g+ZNOUMwqGI+2Gaw5fMs9vm5fWMQPKqn8uJhjRlpvcEMRAOJv9TpIDNg3q9Ti+88AINDAxYU/0JIb6HIqncIsC09ThOnjxJMzMzNDc3R3NzczQ/P7/S7tzcHBF9/+CKvr4+GhgYoKGhIdqxYwft3LmTtmzZ4nWtWq1Gf/qnf0q/+MUvaHFxccX5LS/LnwNgqwu6h02k6tumfV9MAZObdzcFY/2Va487R283TfBPO/qHvfthyyrqZZztStswMTk5SV999RW1221aWFigdrtNS0tLRPT9N0WSxXvJM1n6+vpo8+bNNDg4SMPDw7Rx40bRdRKazSY999xzdObMmRX/mLwHdZtI9rjhKlFaAWCDc7RpUlUnTpxYCfombAbx2GOP0fPPP09HjhxZlXa1MTg4SEeOHKHTp0+vMUa939LAX0XDLQO9Gln4zru7xEBCYsNcxoETErb+qG3o27DZ7uKy17zS/zMzM/Ttt9866y0sLKxs3759m4i+t4mhoSHas2cPjY6Oiq+5bds22r59O925c4cVAVzA5wRBFSjlFICOywCLTPnbPgDXrl2j//iP/6B/+qd/ohs3bojbfOmll6jRaHin+0EY+NyTou6fK9VvEwWmPz3Vn5zn+40A/ZqmPkveFygGHz+TNf1vSsdLzvnuu+/oww8/pOPHj9Ps7Kz4ety3rfRtV1/yzt71kkoIgASpKi3KQXPXvHXrFv3Lv/wLXb16VdTOunXraPfu3U5DtfWxzEYJ0uFK7av1TOfYRINEMHDHbOXqMVufuTJQHFywzOpbbFMIPkLg7t279M4774hFwNatW2ndunXW9VR5vMcy+d5KCQAi91cDu3FzTNeZn5+nX/7yl/Tw4UNRG3v27DG2JRECZTLAmMlrisAWGLnAbdrXy6TCIE22geuf6/34vHeQD5Ip1TS+NauvXl5epunpaTp9+rT4mo888ojxWqb+mPpQNd9aOQGQN1mMXK8/OztL77zzjujcXbt2GdszbYNy0S0haguuXPC3ne+bFZBeD6n/7hFKQMuyhkDnzp07dO3aNVHdrVu3phYrVfS5pRQAPmki0wi6qBSWrX7CZ599trLi1cbg4CC1Wi3RdapomFXFNV3T63vpEgY+c/0+wT/N6B90D1vAziu7yo24JW1fuXJFdA31GwSSqYCqUzoBUNablfRxbm5OrFb1rxGW4X2CcHFNFdjm3U1B3HRuEcHfdU2QjbRriLrtj2xC4NatW6t+bIpj/fr1K22Z2o+N0gkAF0XcxDwWE6r179y5I6rf39+/cp5kPizLcVA8RY3+fTJieSKZQnAF9TTBH+RPUQviXNdME4hNxxcXF1eey2Kj2TR/8913YOmaSimLvy29APBRqllXdualGqWrVlutlrMvPkYKqk1RTsgVhF2BX7Ltc12IgmJIM60p9UW2a+UlAiQCgIhWvmJdpgxyUZReAEjJ6yZnFQHLy8uiNQBEZHwAUczGCtxwIsDl7HzncLkFg5IV/7bFhqA85OmL0ooA3z6oTxqU9KPq/raSAiCPlLlv+z4LYTZs2CC6zvT0dKr+Jf0B5SFL+t9li6bgz9lr0XOjmPcvJ0WMlqW2J73mwMCAs440SxALlRQANtLO2/ueYztPIgDm5+dpamrK2hYWsoAEU0pWLVf3OWHgk9a12VnWII0gHyau6UaftSicfbkyVDaf19fX57z21NSUqI+xEJUAyFvFuoyeO75z505n219//bV4qgCEi6+Ay3INbiGT6Y/rHycQfPvqeqaAqQ4oD645/LRtJfu+a5uGhobYBX4qt27dMl7L53pVGmRVRgD08qb4TDfs2LGDBgcHnW2OjY1l7hcoF0UJAtO2a21A1nSsCQT86pGnzfq0rdvio48+6rxGp9NZJQDSZIOrFPyJKiQAiIpLiUvakKZM/+iP/sjZ1sTEBH3xxRcePQRlJo8RlG/Q5/a5bIGv80v7niASwqKbAc9kY5LReaPRoKeeesrZ/uXLl2lubs5rwFZ1KvlzwEWQGIXNQanO0lRv+/bt9OKLLzqvdfz4cbYNrhzEje60ajXZb56bUI8n24nN2dpQ6+Rto7D53hFCCly9pm4Le/fuXXnAD0e73aavvvrK+5pVt7tKZQB0iph7lZ6rK9f169fTX//1X6/8pjrHxx9/TBcvXiysX6D3FHWvuNGTZD2AZNTPrSOw9SEPqu6EwWp85uR37NhBBw8edLb56aef0sLCgujaMYEMQAp8lOHy8jJt2bKF/uZv/oaGh4etdW/cuEH/9V//xbZDBGcI1mIaoROZR/KmY2qWQG3DdI7t2kUAey8HaQKny3Zcx3ft2kUvv/yyc1A1NjZG4+PjsCUDEAAObCMdl0E1m016+eWX6fXXX3d+RWV8fJzeeustWlxcpHq9joAPRPT396/6iVPux3mylhHRiqNV95OvqqrleQHbry4+mVTdDjZu3EgvvPACPfbYY87zL168SBcuXCAitz3pQlqf/krT19CprADoVSpnw4YNNDIyQgcOHKCDBw+KHk5x9epVeuutt2h+ft7LgHQjLaMBgmyMjo7S6Ohoz67/zjvvONe+gOqQt1+ViMdarUaDg4O0bds2euKJJ2j79u2itr/44gs6f/48+wApfY2Mr+0V6FbKAAAWpUlEQVRWwd4rKwBUshjtP/zDP9DDhw9pbm6O5ubmVr6b3263aWlpiQYGBqi/v5/6+/tpaGiINm3a5NWvkydP0u9+97s1c62SxYYS4zOpWhAmZZx/zDKSA3Hy2GOP0U9/+lNqt9u0sLBAnU6H2u32KltqNpvUarWor6+PNm3a5EzzqywsLNCHH35IN2/edAZ+CVW23SgEQBa2bNmy5md58+Dy5cv0P//zP3Tt2rVMjzg1GScyAqCb6HYGuys/RYrRer0ufhy6D51Oh77++mu6cOGCMZsqtUtJvarYOARAF5menqZz587R73//e7p69SoRrf2alY5rERYAIZCHCIB9l48QslaTk5N05coVunLlyqpn/eeZ0q9KwNeBAOgi69evpx/84Ac0NTVFDx8+pDt37vS6SwAAUGo2bdpE27dvp8XFRbpx44bXD/7oz8dQy02Ds6otzoYA6CL1ep0ef/xxevzxx+nNN9+kGzdu0KlTp+j8+fPU6XTE6Smi3nwlCwAp+MnfOHA9VKobNJtNGhkZoZGRETpy5AiNj4/Tl19+SXfu3DGuf7KtAbCJAQll88EQAD1kZGSEfvazn9GPf/xjOn36NH344YdrjNO1iE/yTQAsBARFoq9hgX2BXlGr1VbEwOTk5MozABJ80vwxrAWo9JMAE0K/QYODg/STn/yE/v7v/37Vj1q4noYleVpWr9U5kBO6nZpI2+cyvldQLoaGhuiVV16h1157jdavX+98UqZ+zFS3aiAD4ODChQs0OztLy8vLtLCwQEtLS7S4uLjyV6/Xqa+vj1qtFg0MDNC6detoeHiYtm7dSo1Gw+taw8PD9POf/5xOnDhB77//vngVa9lVKKgGEhuEnZaDIlP7s7OzNDExQe12m4ho1evy8jItLS1Rs9mkZrNJjUaDms0mbdiwgTZv3ux85r+J4eFheuONN+ijjz6iiYkJIuKzqT7fFCAqvz1XVgDkZcBvv/228RnSrpRno9GgrVu30ujoKO3du5f27Nkj+i5ro9Gg119/nbZs2UK//vWviSj99/4B6AZZvsYKygXnV33u/507d+j99983nuvyq61WiwYHB2nHjh20c+dO8Ve0W60Wvfzyy3T27Fm6fv36qmNc4LctBKyKvVdWANjIcvOkc51LS0s0MTFBExMT9NFHH9GmTZvo6NGj9NJLL4kyA4cPH6a5uTn63e9+t6rc9LVAiYFiHUA1uXz5Mv3v//6v89G9pj/TsaRMf+yvXpb86bbEtacC2wNEssCv28ri4iLdvXuX7t69S+fPn6etW7fSwYMHV02dctTrdTp8+DAtLi7SrVu3rFmA5NqSZ6qUWSBEKQB8MBkjd3NtN316epp+85vf0NmzZ+mv/uqvRI+zfPXVV2l8fJzGxsZExscZYpkMMgbyvBftdpsePHiw0q7pTw3c9Xp9TVDXxYBe39a2HuzTvmfYZzxw4tDlX01899139O6779Lo6CgdOXKEmk17SKvVanT48GE6ceLEytcFXRkAbr8KRLEIMCuu0YxPCvT27dv0i1/8gm7cuCGq/yd/8ierfk9Af2SwaRvEh210n2yrwb5er6/sJ8dMYsAV7F3ZBL2PABDx3xyxDa5stvXtt9/SiRMnaHFx0XntVqtFhw4dEi8ANB2ryiLrSguAPB2OyfDStj83N0e//OUvaXp62ll3w4YN9Oqrr3qtQi27UcZGmpGPfr4rta8He1tdVRC42ufei9437jgoH0X4Vc6/2uxM//vuu+/o9OnToutu37591c+zc98IsAX6KvjZSgsAG1IjthmmqUyaHp2amqL//M//FPXh8OHD1N/fv6qsql9LiYm8HKluZ6bRPWeXel09U2CyY72+Wi/N+5J8vkC1kGZVff3q+Pg4XblyRdSH3bt3i0b73H7auiFReQGQdyrS5qx81ey5c+dWvpZio7+/n/bu3buyb/uOalVSU1Wh6GDmM/Ln9tXzTMdtYsJ0TdN7R0CvJlnur8RPugK/qY1z586J/N+2bdtW/SiR6jtjmV6tlABwGWFaI+W2XWrUJQaIiM6ePSvqx759+4zlPtMCVTbkspOHKHWN3vXFfcl+su2TCZAEf1P/QPmQ+lWf+ysN/LbzOSEwMzMjGlgRET366KNW31jWkb2USgmAIsnq0Li6X375pej8nTt3OutUdZ4KuNEdqD6Hrwd7tZ4puNumDbhrquXqq6vfIFy4+5OHYNX3Ta8SG9TbqtVq4kXWefzUe5l9bHQCIK8sQF4pr7t379LDhw+d565bt462bNmCkXzFsDkz6fn6CN+02l8ttwV50+I/06JB07nqe+BeufcO4sTHXkzncXW/++470fWHhoZW7ZsWA9qmV8vui6MTAHngSve70lc69+/fF9WTPOwChItkNJVVWHIpfNvcvj4FYKrvMxrzdeYAEPnbi+1zMzMzI2qjv79/5WvWvsG87MGfCALAC990GCcE0hrrpk2bRPWIqmGcQAYXlCWB27QvXeiXJfgXkVoG3SXrvcpDIHIiYGFhQewD1ees6FTdj0IAeGKac8qKZAqAiNZ8FZCo+gYaC2ntyBSkiVaP4E0P/EnqSL8umOfIH0EedMNmkh8ZctFqtbzbrgqVfBRwrbb2BytMZdK2ikDtTx5KFZSDtHYoaVeaBSDiU/zJOeq5+rZ6TfWVK/N5DyBcXNnMIu6fqX2pb+90OqJrxCwAKpsBkKTeu4XrutKfuDRlAED54KaG8mrTJgT046b6XDaAuxZXxvUTlJeQ/KqLvr4+UT3fn22vEpXMABRBkUYuFQCm51yH+uEDbvK6d5JAL8kQcO3p/eVGfa73A2FQXorKXBVFX1+f6OfXieKeRq1sBkAlD+eSxUi4c5N+qU+jsiGd01LbBtXGNZo3ldkyAaYFgLbrqMdd/UxzDIRJt+6Z74N4kn5JR/9E3/90u6u9qlKZDEDZFGrChg0baPPmzaK6U1NTlTfI2MjDbm1BWZIR0M+1BXbXvq1/vscAIEo3+BocHBTXTX4WOEZbrIwA8CHPG531N6JHR0fFdZOHW8RoqFUnj3UBtrl5W7lpxG/qk2SOXz8/y3EQNqp4zcN+86JWq9H27dvF9dWvYXPZL/VVr1tmSj8FkGZEkoW0vx/NcfDgQfG1b926tabMJw0Lqolt5M85Msm0gas9V5+yHAfdh/Ol3bhXWX7EzHTOyMiI6Ny5uTlqt9te77FKtltqAZDGQIu6eWl+kW9wcJD9kR+dO3fu0PT0NBH5iZ5ufohBb+GmAtQy1zoAU13fPiD4lw/pQIKzrbQUMW27c+dOWrdunajunTt3VrZN7yPrFFfolE4A+I5CikjTSEb8EsN+8803xStVv/rqK6OTVvdNryplNlRgRxL0uXquNl3nSD9nVUiZVhGJr+hGpjWPnzKv1+teWdXkVwMlvlXfrgLRrAFQ56tC4Pnnn6cDBw6I63/++edEVH1FCvywzUtKA7JJPOY5ioc9VhNb0MxK2rVVzz33HG3cuFFUd2FhgW7fvr2ybxPLEhFcRkqXAXDhm77yIa9fgdq/fz/92Z/9mbj+l19+SZOTk0TEf+jKaoCxYpt/T9OWK/Nj+3P10dSOT99AuGS9P0UEftO2pA/79u2j3bt3i6915coV6nQ6hWSmymL3lcoAJKN89Z9vMqIsjjYLjUaDfvSjH9Frr70mbqvT6dCJEyesapRz/hAH4aDei6IzUWlERdppAq4tECZp7E/3q6Y2irrnkkxAo9GgQ4cO0RNPPCFud2FhgS5fvuw16jcdK7utV0IASIy6l1MArVaLnn32WTp27Bht2bLF69xTp04Zv/7HGR5nlFWexwoV1XEWaXuugJ9XYHf1AVSL5J5yNpzYU6/8ar1ep8cff5z2798vXvSXcP78eVpcXBQF/ypnvSohAGyoRqyXSc93BVSdZrNJ27dvp+HhYdq9ezft2bMn1XP8b9y4Qe+///6q63EqtExGFwM+jtGUucrj+q7jJvvxyRiA6iERrabAn4dPlbB+/XoaGhqiHTt20MjISKof8rlx4waNj49bp8R8p8bKSmUEgGqQnPGaxICLf/zHf6TZ2dmVv5mZGVpcXKR2u03tdpuazSb19fWt/A0ODtLQ0FBmo5icnKS333571RyVj3Ei/d87pBmpNPbItaW3qV9HYgcmm0HmKB5cdptXFuAHP/gB/eQnP6GFhQWan5+n+fl5WlhYoKWlJep0OrS0tESNRoP6+vqo2WxSs9mkjRs30ubNm6nZzBayJicnVy2odg2sTPt6/TJTWgEgdbJEq+eRVJEgZf369eIf7MmD7777jv71X/+VHj58aDS85FUqDODEw4FzmGkFmy3om+qmuQaoFpz9cTapZgQ4keiTwarX67Rp06YsbyEV9+/fp48//pg6nQ77c9icv60qpRQAptE+92qqHzI3btygt99+mx4+fEhE8oBvKg/9vVYNV9o0zTGfa0uFgOsYACoSnxq6PU1MTNCnn35KS0tLbPAnMk+NcZmCZF8l5P+BiVIKAA6bgbqmB3rN8vIynT59mt577z3qdDpERCsPCbIFf5fBlc0gy4pvgNczAVnt0pWedIkBEC+mAZLEllVhEKoAWF5eposXL9LFixeJiFYFfyLZwMmWTSs7pRYAnNPUU1Km7ZBu4M2bN+m3v/0t3bhxg4js81GmMqkwCOk9x4Juo6bAT5R+HYAt8HNCgGsH9hE3JltNkKT/Q7Ofe/fu0fnz5+n+/fvGQZQ0E5Bgy8CWldIIAN1RckpUraOfn/dK66zcvHmTTp8+TWNjYytlNiO0GWWyrRLSe60qEpuT7GdxoL5pSdgF8MU28g+NqakpunTpEo2PjxORPa0v+UvacBHi/8JFaQSAL/rN6Mb3sSXMzs7S2NgYnTt3jq5fv+4cxdvEAIfPyA8UgyvYJ6+6M01zn1zZIH3btA/iQmKfpoeqqbbFZVl7wdLSEt26dYuuXbtGd+/eXemjbRDFBXu1nkrVRv9EFRIAXBaglyP/drtNk5OTNDExQbdu3aJvv/2WJiYmjA6fC/4+AkF9BeFhG0VlsVGf4C8VAiGIZdB9bPfdJBLUY930PQsLC/TgwQO6f/8+3b17lyYnJ1fWTtn8pmSk73pvpvdZVr9bOgHAKVVbXZODfe+99+ijjz6yPnta+lzqpN3FxcWVv+npaZqfn19TJ9l2Bf40ZaZrmfZBcdhGUjbnmTalagv60myArW1QHWyjfn1fkgVQ9+v1OrXbbbpw4QItLy+zvtT3Wf/JtdrtNi0tLdHc3NzKcwNcI3Qu8KcpU/sioSyfndIJABNcoLcZbzIST8qTV18DtfWJC8QmZ5xVELiuCXqHZLSfdcRtcl7qMfXVdC4ACZIsgGpTyf7S0hJdv359jT+1CQKfPun7Et+p1k0T/PXrV2n0T1QBAcCpWFM5ES8KdAedV99M2+q+JPBz5WlGdSA7qi3p5S7bMdlnmpG/3qZ01AKbATZs/lRFz1gtLy9TvV5fE/CT83VRkMb2JAMnvcwV5LlyaQag7IKglALA5GhtZbbMgETtpumfq8xlwL7ltmuA7mKyN1M5Z49pridxXL4jGxAvJpFrEgH1en1l7t0lFEwDM8nUqmmf87G2AZRLKEs+J1WjlAJAx6VabSJAN9C8FgzaRABnWJJRP3c+gn9v4RxccozI/DyKPK5r+lOPqX0AQMU1mDKJWBXJyJ/7PKjt2vrnOiYZTNkEgastrg9lH/0TlVgAmII+ET/acqX6TeV5rMzWt7l9X1GgbiP4hwcnCEzOlSgfW+McnboNQRA3poDvquvKBkhG/tzoX2KHnH+T+EVXYLf5U4n4KDulFQBEMvXKjbokxuejVPX6rmNpswHccUkffOqA9HDilMicEjWd43MtIvcjTqswWgHFYPOjnD+1LbDWR/+q/aVdZC0ZRNlek21OBHOfFZ/PTRk/T6UWADouo03gjFg95iqz9cF1zGbMPurW59o+dUA6pEFcd4i1Wm0ljZrm/nDBX5IZ4sQBANwAirNTvVwVAtzxLH3Tt23+1SaGbZkC23Ul5aFTegFgGm35iAB9W28vzxWr3HF13zXql7bn6hMoBs5pqthsMc31bMHfJAZ8gj5spnrYRvxcXZMISI7rdTkhYMoCmPbV81xlrkGVKyPgquPqj628DJReABD5iYBkmzNWm0r1WbEqqSMJ9vp+2uAPsmFyXi6nqW677lFSZ3x8nO7fv7/qWpyzJSKamZkxBnvTH9cG915BdfERAepxIvmDrfSBlXpusm0633Ztbl8vk2QFJPWqTiUEgAlOBBCRUQgk5abRmtqm9NqSYz5GndVZx2bYReFykj51Tbb24MEDevDgwZrgbzrPNKqXjO5hC4DDJQw4/8j5LomIzdpffVsyWMpLEJf9s1QZAcAZropNCOj4qFNXv7j+2MrzCvy+dUE2bNknkz2q91lfOKWWJ9um65lG+NLRP2wjXnzFLBG/DsDlL03X8r22rczlZ9ME/izHykJlBACROU2blJu+hmITAj4fDltffI/nnaKtgpGWDVPwV4+puKYHTMe5kb+pTJJlAkDF5vt0X+oaZPl8Fnz6Z9s3lUu2XdeRHisTpREAXHDn6tpEgN6OScnq5VmRGlOeRlcVIw0Zm11yNsdlnJKAra6ctmUATIFfLTeJAr2e6b2AeOCCvVQEEPEPWlPrS9qV9tfneJrA7zpepc9JaQRAgtSAOBFAZF6FrdfRyZKuktRD4K8W3EhJOu1kC/ymMj3A+wZ/AHRcIoBI9g0W19RsVnymAxD4V1M6AeCDbUogwSYGuHOy9MWnzTTXrKKRlgFX1kkiAkyjf8l1bcHdZ9QD4kQy2redS5TuMde+mQBJql+y79O2TxtlpJQCwDeNJFGyRHbDzSMDkDY7IKWqRlpm0mQCfLJcplfTcdfIH7YTN9LRvu38pI7Ep0pFguka0mN5+dsqfzZKKQCI0okAIv/v8qf9NkA3R+9VNtAQsWWWXGsBpKunJfZtC+qSoK+3A+LG5SN9bFKy3iVLH32Ppakfw+eitAKAKN2CEkm6n6tfBEVMLYDwMIkA2zdTJO3Zyl3TAWnbB9UnazZArZdQxOLqIgdMsdh/qQUAUToRoJ6bkGVlatprhtAOyBfJfKopE0CUbbGULeDDVoAvPnP/0vZ6SdHTr2Wl9AKAyN8YbW2oFPl1ldDaBf64Uv62cyQLpnymq9Is/IMtARtpUv4hgYyXm0oIgIS8jTEkowipL8CNRAQk20TpfyDIFuzTBn/YGkjII+XfTbqxVqtKVEoAJISsSn2I3TjLgM3WfOZS0wR/vS1u31UfABdZU/5F+GIsms5OJQVAQhmFAIyzWkjnUomy/f5EHnOcsD3gIq1PDcG2QuhDaFRaACT0YrGfDzDM8pP3yukivqGC4A/yInSfSgSblhCFAFAJYa4KhllNJKP9XqyaxpQAKJIQfKqpH8BNdAJAx2Y0eXy9EMRF3l+fytoXALpNmm+1ZG0bpCN6AWADxgbSIAnyRaZQ8Z1nECKwt/CAAACgIKQp/6xioMhFgwCA6gIBAECBhPbENAR+AEACBAAAXQCBFwAQGvVedwAAAAAA3QcCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBCIAAAAACACIEAAAAAACIEAgAAAACIEAgAAAAAIEIgAAAAAIAIgQAAAAAAIgQCAAAAAIgQCAAAAAAgQiAAAAAAgAiBAAAAAAAiBAIAAAAAiBAIAAAAACBC/j+6q7DZjXWKDQAAAABJRU5ErkJggg==",cn:"data:image/jpeg;base64,/9j/4gxYSUNDX1BST0ZJTEUAAQEAAAxITGlubwIQAABtbnRyUkdCIFhZWiAHzgACAAkABgAxAABhY3NwTVNGVAAAAABJRUMgc1JHQgAAAAAAAAAAAAAAAAAA9tYAAQAAAADTLUhQICAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABFjcHJ0AAABUAAAADNkZXNjAAABhAAAAGx3dHB0AAAB8AAAABRia3B0AAACBAAAABRyWFlaAAACGAAAABRnWFlaAAACLAAAABRiWFlaAAACQAAAABRkbW5kAAACVAAAAHBkbWRkAAACxAAAAIh2dWVkAAADTAAAAIZ2aWV3AAAD1AAAACRsdW1pAAAD+AAAABRtZWFzAAAEDAAAACR0ZWNoAAAEMAAAAAxyVFJDAAAEPAAACAxnVFJDAAAEPAAACAxiVFJDAAAEPAAACAx0ZXh0AAAAAENvcHlyaWdodCAoYykgMTk5OCBIZXdsZXR0LVBhY2thcmQgQ29tcGFueQAAZGVzYwAAAAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAABJzUkdCIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWFlaIAAAAAAAAPNRAAEAAAABFsxYWVogAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAABvogAAOPUAAAOQWFlaIAAAAAAAAGKZAAC3hQAAGNpYWVogAAAAAAAAJKAAAA+EAAC2z2Rlc2MAAAAAAAAAFklFQyBodHRwOi8vd3d3LmllYy5jaAAAAAAAAAAAAAAAFklFQyBodHRwOi8vd3d3LmllYy5jaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABkZXNjAAAAAAAAAC5JRUMgNjE5NjYtMi4xIERlZmF1bHQgUkdCIGNvbG91ciBzcGFjZSAtIHNSR0IAAAAAAAAAAAAAAC5JRUMgNjE5NjYtMi4xIERlZmF1bHQgUkdCIGNvbG91ciBzcGFjZSAtIHNSR0IAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZGVzYwAAAAAAAAAsUmVmZXJlbmNlIFZpZXdpbmcgQ29uZGl0aW9uIGluIElFQzYxOTY2LTIuMQAAAAAAAAAAAAAALFJlZmVyZW5jZSBWaWV3aW5nIENvbmRpdGlvbiBpbiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHZpZXcAAAAAABOk/gAUXy4AEM8UAAPtzAAEEwsAA1yeAAAAAVhZWiAAAAAAAEwJVgBQAAAAVx/nbWVhcwAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAo8AAAACc2lnIAAAAABDUlQgY3VydgAAAAAAAAQAAAAABQAKAA8AFAAZAB4AIwAoAC0AMgA3ADsAQABFAEoATwBUAFkAXgBjAGgAbQByAHcAfACBAIYAiwCQAJUAmgCfAKQAqQCuALIAtwC8AMEAxgDLANAA1QDbAOAA5QDrAPAA9gD7AQEBBwENARMBGQEfASUBKwEyATgBPgFFAUwBUgFZAWABZwFuAXUBfAGDAYsBkgGaAaEBqQGxAbkBwQHJAdEB2QHhAekB8gH6AgMCDAIUAh0CJgIvAjgCQQJLAlQCXQJnAnECegKEAo4CmAKiAqwCtgLBAssC1QLgAusC9QMAAwsDFgMhAy0DOANDA08DWgNmA3IDfgOKA5YDogOuA7oDxwPTA+AD7AP5BAYEEwQgBC0EOwRIBFUEYwRxBH4EjASaBKgEtgTEBNME4QTwBP4FDQUcBSsFOgVJBVgFZwV3BYYFlgWmBbUFxQXVBeUF9gYGBhYGJwY3BkgGWQZqBnsGjAadBq8GwAbRBuMG9QcHBxkHKwc9B08HYQd0B4YHmQesB78H0gflB/gICwgfCDIIRghaCG4IggiWCKoIvgjSCOcI+wkQCSUJOglPCWQJeQmPCaQJugnPCeUJ+woRCicKPQpUCmoKgQqYCq4KxQrcCvMLCwsiCzkLUQtpC4ALmAuwC8gL4Qv5DBIMKgxDDFwMdQyODKcMwAzZDPMNDQ0mDUANWg10DY4NqQ3DDd4N+A4TDi4OSQ5kDn8Omw62DtIO7g8JDyUPQQ9eD3oPlg+zD88P7BAJECYQQxBhEH4QmxC5ENcQ9RETETERTxFtEYwRqhHJEegSBxImEkUSZBKEEqMSwxLjEwMTIxNDE2MTgxOkE8UT5RQGFCcUSRRqFIsUrRTOFPAVEhU0FVYVeBWbFb0V4BYDFiYWSRZsFo8WshbWFvoXHRdBF2UXiReuF9IX9xgbGEAYZRiKGK8Y1Rj6GSAZRRlrGZEZtxndGgQaKhpRGncanhrFGuwbFBs7G2MbihuyG9ocAhwqHFIcexyjHMwc9R0eHUcdcB2ZHcMd7B4WHkAeah6UHr4e6R8THz4faR+UH78f6iAVIEEgbCCYIMQg8CEcIUghdSGhIc4h+yInIlUigiKvIt0jCiM4I2YjlCPCI/AkHyRNJHwkqyTaJQklOCVoJZclxyX3JicmVyaHJrcm6CcYJ0kneierJ9woDSg/KHEooijUKQYpOClrKZ0p0CoCKjUqaCqbKs8rAis2K2krnSvRLAUsOSxuLKIs1y0MLUEtdi2rLeEuFi5MLoIuty7uLyQvWi+RL8cv/jA1MGwwpDDbMRIxSjGCMbox8jIqMmMymzLUMw0zRjN/M7gz8TQrNGU0njTYNRM1TTWHNcI1/TY3NnI2rjbpNyQ3YDecN9c4FDhQOIw4yDkFOUI5fzm8Ofk6Njp0OrI67zstO2s7qjvoPCc8ZTykPOM9Ij1hPaE94D4gPmA+oD7gPyE/YT+iP+JAI0BkQKZA50EpQWpBrEHuQjBCckK1QvdDOkN9Q8BEA0RHRIpEzkUSRVVFmkXeRiJGZ0arRvBHNUd7R8BIBUhLSJFI10kdSWNJqUnwSjdKfUrESwxLU0uaS+JMKkxyTLpNAk1KTZNN3E4lTm5Ot08AT0lPk0/dUCdQcVC7UQZRUFGbUeZSMVJ8UsdTE1NfU6pT9lRCVI9U21UoVXVVwlYPVlxWqVb3V0RXklfgWC9YfVjLWRpZaVm4WgdaVlqmWvVbRVuVW+VcNVyGXNZdJ114XcleGl5sXr1fD19hX7NgBWBXYKpg/GFPYaJh9WJJYpxi8GNDY5dj62RAZJRk6WU9ZZJl52Y9ZpJm6Gc9Z5Nn6Wg/aJZo7GlDaZpp8WpIap9q92tPa6dr/2xXbK9tCG1gbbluEm5rbsRvHm94b9FwK3CGcOBxOnGVcfByS3KmcwFzXXO4dBR0cHTMdSh1hXXhdj52m3b4d1Z3s3gReG54zHkqeYl553pGeqV7BHtje8J8IXyBfOF9QX2hfgF+Yn7CfyN/hH/lgEeAqIEKgWuBzYIwgpKC9INXg7qEHYSAhOOFR4Wrhg6GcobXhzuHn4gEiGmIzokziZmJ/opkisqLMIuWi/yMY4zKjTGNmI3/jmaOzo82j56QBpBukNaRP5GokhGSepLjk02TtpQglIqU9JVflcmWNJaflwqXdZfgmEyYuJkkmZCZ/JpomtWbQpuvnByciZz3nWSd0p5Anq6fHZ+Ln/qgaaDYoUehtqImopajBqN2o+akVqTHpTilqaYapoum/adup+CoUqjEqTepqaocqo+rAqt1q+msXKzQrUStuK4trqGvFq+LsACwdbDqsWCx1rJLssKzOLOutCW0nLUTtYq2AbZ5tvC3aLfguFm40blKucK6O7q1uy67p7whvJu9Fb2Pvgq+hL7/v3q/9cBwwOzBZ8Hjwl/C28NYw9TEUcTOxUvFyMZGxsPHQce/yD3IvMk6ybnKOMq3yzbLtsw1zLXNNc21zjbOts83z7jQOdC60TzRvtI/0sHTRNPG1EnUy9VO1dHWVdbY11zX4Nhk2OjZbNnx2nba+9uA3AXcit0Q3ZbeHN6i3ynfr+A24L3hROHM4lPi2+Nj4+vkc+T85YTmDeaW5x/nqegy6LzpRunQ6lvq5etw6/vshu0R7ZzuKO6070DvzPBY8OXxcvH/8ozzGfOn9DT0wvVQ9d72bfb794r4Gfio+Tj5x/pX+uf7d/wH/Jj9Kf26/kv+3P9t////7gAhQWRvYmUAZEAAAAABAwAQAwIDBgAAAAAAAAAAAAAAAP/bAIQAAgICAgICAgICAgMCAgIDBAMCAgMEBQQEBAQEBQYFBQUFBQUGBgcHCAcHBgkJCgoJCQwMDAwMDAwMDAwMDAwMDAEDAwMFBAUJBgYJDQoJCg0PDg4ODg8PDAwMDAwPDwwMDAwMDA8MDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM/8IAEQgCAAIAAwERAAIRAQMRAf/EANYAAQABBQEBAQAAAAAAAAAAAAADAQIEBwgGBQkBAQEBAAMAAAAAAAAAAAAAAAABBAIDBRAAAQIEAwUHBAICAgIDAAAAAAECAwUGBxESBBAxFBYIIDATFTU2F0AyMxhQIaAmYIBwNyQ0JREAAQMBAgULDgkIBwcFAAAAAQIDBAARBSExEtMGECAwQRNzk6OzNDVAUWFxkSKSstIUdNR1NrHRMoOElLQVlYHBUnKCI6SlUKFCwyQWN2LCM1PE5GWgZCWFBxIBAAAAAAAAAAAAAAAAAAAAwP/aAAwDAQECEQMRAAAA7wz+uAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDtwAAAAAAAAAASkQAAAAAAAAAPnHjQAAAAAAAAAD13POAAAAAAAAABkmMAAAAAAAAAD4prEAAAAAAAAAA3QAAAAAAAAAAZJjAAAAAAAAAA+KaxAAAAAAAAAAN0AAAAtKAFxUAAAGSYwAABaUALioAAAPimsQAAAWlAVLgAAADdAABQoWlhYULy8uKgqVABkmMAChQtLCwoXl5cVBUqAD4prEAAAtLC0FxeXAAAA3QACMoRERCfcOmjkcmJC4kLy4uAMkxgC0tIyEgPbm4DmcmLypeSFxeAfFNYgAAEZEbfM40iTEgAAAN0AFCMhMcxjFOojJOVjIJCQmJyQvAMkxgCMjIDEMQ6cJDmAyCQuJSYmJCoPimsQAACExzsM+4cOmSSlQXAAG6AC0jNmnVZYZJ6w8SVLgVPEnHRKSAGSYwBGQncJ9ktPdHhyhcAXHJJrwkLgfFNYgAAEJiHYR9s4YMknLy8uLwAboAKEZjmAfPjqys05DlyrJVvJUyTIJC8AyTGALCMxD559SP0Fr81oyierlkSYySckKg+KaxAAAITCOwj2hxgs6TlTyhISAA3QAULDGPmnqD9AT82VwJMmri5ZkyjIJC4AyTGALSwxT5x0uSxymuQktXrMk5kkxIAfFNYgAAEJhHYR1qeDLi4+Wfm6TEgAN0AFpGYRGfoQfRNekhcVBrQ50MkmABkmMAUIzEIT9ITxx8cqXFS81YaBJS8A+KaxAAAITCOwz7RwmuUk5KSl5IADdABYQGIduG0DlQ0mZZcRHv43xXFhmE5UAyTGALCAwjo49QcwxQ6vrXJp0yyA+cXl4B8U1iAAAQGIdhn2zhoyicuLi4uABugAsMY6gPSnjTxhoYyy4xzYsdM1xWZpkFQDJMYFCMxD7x3sfnefJI47ErV5pEzTIWZLi8A+KaxABaUKEJiHYp904cMsmBUuLgAboALCI++eLOpTxpoYySpjmxTpk4rM4yCoBkmMChCQneRzbGi6uWJOwjV5pAzScmLyQA+KaxALS0jIyExDso+8cLmUSlxeSF5cAboALS0xjBOpz1RrgkKkZ6g9McVmaZBUAyTGBQhPrnSpzUZ5QjOnzXpqQnJzzZiEhUHxTWIBYRmwD75EQHTR9c5OWZLy8+YayJCQA3QAChCYp1EfbNYF4LT1p7U4tMsmKgGSYwKEZCY506eqKFCgKlxec6Hji8uB8U1iAWER1SbWKFpQFSpUqeKONCUkAN0AAEZCejPnnwS8Fh9E9QeQJyQAGSYwBaWEZERlpaUBcXEpKSl5UHxTWIBaWERGWFpQoXFSpcSEpeXgG6AAC0tLCgKgoCpcXlwAMkxgAULS0tKFACoLi4uLgD4prEAFhaUKAoCoALi4uKgG6AAAUKFQVBQFCpUAAyTGAAABQAAFQAAfFNYgAAFAAACoAABugAAAAAAAAAAyTGAAAKAAAqAAAfFNYgAAAAAAAAAG6AAAAAAAAAADJMYAAAAAAAAAHxTWIAAAAAAAAABs4AAAAAAAAAA9sZwAAAAAAAAAMA8YAAAAAAAAAAavAAAAAAAAAAOlD3AAAAAAAAAAJiEAAAAAAAAAA4zAAAAAAAAAAOlD3AAAKFAAAVKgAAmIQAAAAAAAAADjMAAAAAAAAAA6UPcAAAAAAAAAAmIQAAAAAAAAADjMAFCgAAAABUqADpQ9wAAULSgKgFCpUuAAJiEAAFCgKAoUBUqXFQAcZgFCwsLS0oACoKl5eXFwB0oe4AKFpYRERUvBaWkhKSFxUAmIQAULCwjLChQoUKkhMXkgAOMwCwsISEsLC0FS4uLyUmJC8A6UPcAEZYYxinR5pE80DNOjjm8qZRISAExCACwhMUgLAZ59M+mfbPuGpyQkKgHGYBYRHd5vsFD7BOefKlQarPzoJSQA6UPcAoRlx6IxT2Jtk5xKm8j4ZqwyT4ZjkhcCYhABEYZt426RlD558s+Qvyk+Wa7LCQuAOMwCwsISIhMVevk9scDrkJOSkpMXl4B0oe4BQhM422QEYLi4AvJDWJ8MmLgTEIAID55u88jGnlmsliqqlScyzMJS8A4zAKFhaWERhnXJ7Q4FMoyiYlJC8qAdKHuAUITBPqH2iFal6a8JCw9LHua1uZpOVBMQgFCA+cbvPsniYkq+K2i5LzBNeE5IAcZgAFChEYZ1obwPvHCJqgyCcvJAAdKHuAUIT55uo9AeQKruFOQDehraBtatBGaTlQTEIBQxz55u8+ieDWRLoArbKmKeHJyQA4zAAAITDOtD2RqM76Oejh4+QTkgAOlD3ABjnzzdRlHhVqb6Tkc3qa2iptatBGaTlQTEIBQxz55vM8cuoCZJIAqs9mcZhOXgHGYAABCYh1oezOBV9On6Am5D8mCEkKgHSh7gFCA+cbqMo8LFV31ZyLLvatapU2waCM0yCoJiEAoYxgG/jW6+pNrJUAHwjmczjILgDjMAAAhMQ61PaHBpMXnvTxRKSAA6UPcAoQHzjdZlnhVqb5TkY3sa1iptatBGaZBUExCAWmKYB02aCl2/Zq88DLJZZLMnZdcfH0DJLgDjMAAAhMQ61PbHCJkkgLi4vAB0oe4BQgPnm6zNPDlTepyUbaPBRlm1q0EZxOVBMQgFhhmCdmHE0vRlmrTwUS1HLfZ2ecdn0jKLgDjMAAAhMU62PanCZlEpUFQADpQ9wAQGEbqPHGqQddHMx8gtXZxsFNCmaTgExCARmGe1NwnJR0mUPOFxaXG5Dj0+gZRcAcZgAAERAdantThQnJgAAAdKHuACIxTdJ5IlNwGCcwHrjo8gNAHlTJJQCYhAIzGN7muDXR0YYR5guKF5u05CM0yCoBxmAAAWEZ9MmPikhIAAADpQ9wAWERkGMYgKl5QtKEpkEpcATEIBYRlhCWmcYhjlxQoZ5GTkhUA4zAAAKFhQFS4uAAAB0oe4AKFhQtKAqVBaC8uLwATEIBQtKFChaAVKAqXF5cADjMAAAAoCoAAAAOlD3AABQoCoAABUAAmIQAAUAAKgoCoAAOMwAAAAAAAAADpQ9wAAAAAAAAACYhAAAAAAAAAAOMwAAAAAAAAADpQ9wAAAAAAAAACYhAAAAAAAAAAP/9oACAECAAEFAP8AFAyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRDIhkQyIZEMiGRP83bD/gOP/ixRPpcP4tP+7v/2gAIAQMAAQUA/wAUDiXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS84l5xLziXnEvOJecS/8A7moL/wAVT/DVw/5/iY/w2Bh/wDH6RP49foU/i8TH/wACY/8AZ7//2gAIAQEAAQUA/wAUDzVx5q481ceauPNXHmrjzVx5q481ceauPNXHmrjzVx5q481ceauPNXHmrjzVx5q481cRJirGeauPNXHmrjzVx5q481ceauPNXHmrjzVx5q481ceauPNXHmrjzVx5q481ceauPNXE1n8fRaDn+aHP80Of5oc/zQ5/mhz/ADQ5/mhz/NDn+aHP80Of5oc/zQ5/mhz/ADQ5/mhz/NDn+aHP80Of5oc/zQ5/mn00f8X0lQ+j/wAVH/F9JUPo/wBarjFTFTFRFx7mP+Ltq4xUxUxURce5qH0fuMxipipm7/MhmFcK9BYgkQR4jkMxmMxinZj/AIuxihmFcK9BYgkQR4jkMxmMxmTs1D6P23KKuArhHCLiNXvd4q4CvHPHRSkpPFqepa8tBb+R082INiCPEeI7Yi9iP+Laqm4Vw546KWzp/T1ZWl2ba0VR9LtiDYhnM4j1EXERcOxUPo/bVRVLQ2m+VtTd2zPxVpWuxEXvHblXBHKOfgPiD4p030u6LG6j6sa1rXjXiPEeNcNUTftj/i2qOUc4iRB8Q6aZO6LrupWeIura8a8R4jxrsRqiLiJu2VD6P23bnqdIC4zHq+XCVNeNcI4zGbuXDt1np1K5DWK3St8gt1rdoaC5NCzTW6/X6KV6JLr25U+VbdqfKdvD5Tt6fKNvlLkV9Rs3ohu/sR/xdhxTNyKG0VNrdS3iC3XtyhpNVp9dpX3Ut3DiJdW3anypbxT5Tt6fKVvT5Rt+XYm8tnlbt3N21D6P237nqdHy4zLrDXCVMeMeI4Rwi4iL3C7l3PIu6Kp050KrU6j6zbp9CxBqCCCINQYgm/bH/FtXe5CIhEQpWQRaoqav57Co+hmIME3DRiDUE3Ju2VD6P237oh0eepdV1OVFUUsbbO5Iy2tyEEtvcYiW8uDAhNXuV3ERSKpQFFayvKkmkwklB0vUE+11UTxiDdiKN/saN3N7Ef8AFtVBd0TdFOnClXRdb1LVOjnNGqIuAijRif01OzUPo/bfuiHR56lWVw6Pt/C/Y+zCidRlmlP2Ks4pPr/Wk10iaIJu7Thy4JFcaGX66czG3FCaKgafq+ipNXGiTp7tyglgLdofAVvUPgK3p8B29Lr2upSjqWYuI3cm7bH/ABbV3KuCRFNLo9TMtbSFN6WkqcqGzVGVPOE6fbdIfr/bs+AbeIJYK3qCWFt8hdy21MUZIGCb9tQ+j9t+6IdHif8A6XWKmMpa0YwRojRqdyu96iQo+pj2jtbCorRaGfyuZTXqDqapZNWrK6rlRlcVwotcVugtdVwhaqrqrmNwOoL2FDUYJu2x/wAW1VxHuIjjp+oddXrb93B1skg8810LXdcnT3OZxOpBfep6llFbtrquFGVvWymvqGoJxBag3ftqH0ftv3POj31LrDTGVMaMYIwRuxEw7hd7zp+pym42lvHdZlH6PpjfEiw+pJMa7hoN3OHFn/8A2V1B+woakMTdtj/i2LucuCRHFHUrrq0qHXauR28pKezrXVJOVaLu6afbfUP/AOwGEMQTcm/bUPo/YzGZRXD3D3HR4uMy6wvSmKgxTFDFNmbuF3vQpWsZ1RWv10fU67U9MaYafqRT/emDdzlHKWe/9l9QnsGEQxN22P8Ai2O3PIWm1Gs1FsKAgULIr43B5lnDU2OOmr251D+/2DFEUavZqH0fa5RVwFcK4e4e46OlxmXWIuEpY4Y8R4jhHCLiNXtqhvIjSIw6Z0wgXStBMq/qBOmqeoJ03TxBem6eKL01z1SiLFTalKq6g/YUJCGJu2x/xbHbnoUxUGopWoLo3d0EKlpdbytJvoviy4QtrbhjrV3ELC03PaakV76Hq2oazbay4iDLX3CQbbG4BM5VMpJrUXFG7tlQ+j7V3uUpe01wa1li9O94x3TreVR3TledTpqtnW9v9b1K29rCv5enTledBvTreZD9dryidO95CeWVubTMpaom/tqg9MR7TprTCBdm7FR0JUadRlcCdRVcKL1FVwh+xlcFB3uqyqKt6gUxoOG0Ygm7bH/FsXcqYjmjmFDXrpWmKU/Yqij9i6JQ/Y2iD9jqIP2Nog/YyiROoqiVE6iKKUuJU2gq+qm7m7ah9H2rvchZm+tI26o9erO3KH7a25Q/be3B+3FuD9uLcH7b24P22tyftrbk/bO3JcjqLomsaIandKg5pTlZ1PSDajqOeVbrvDEhiwzwyTzOYyGZT64VZVToGtETsx/xbVQVMRWCsFhisFhnhHhCQxGCNGt2Ju2VD6PtcKmIqCtFYZDw0PDQyGQyCNEaIgm/uFQwxFYZDIZEMiGQyCMEREETsx/xdhUxMFFaimQyHhnhnhnhmQyoIgidiofR9qpiYKKiKZTIZDIZDIZDII0REMFETDusEMplQwTbghlQymCdqP8Ai7eCGCGCGCGCGCGCGCdqofR+1ghghghghghghghghgn1kf8AF28TExMTEx7iofR/4qP+L6SofR/peYZOcwyc5hk5zDJzmGTnMMnOYZOcwyc5hk5zDJzmGTnMMnOYZOcwyc5hk5zDJzmGTnMMnOYZOcwyc5hk5LJW6fS7lLXHKWuOUtccpa45S1xylrjlLXHKWuOUtccpa45S1xylrjlLXHKWuOUtccpa45S1xylrjlLXHKWuJpQs018v+J6gPieoD4nqA+J6gPieoD4nqA+J6gPieoD4nqA+J6gPieoD4nqA+J6gPieoD4nqA+J6gPieoD4nqA+J6gPieoD4nqD6a3PtP6SH9n8Vbn2n2sTFTFTEzGKmKmPbh/Z/FW59p/SQ/s+pxQzGYzGZTMpmUzKZlMxmMxinZtz7T7KrgYrsxMVMymK7MVEXtQ/s7WKGYzGYzGYzoZkMxioi49wq4bFcK4zmczmczmcziOEdsRexbn2ntVcBXCuRBYosUSKeKeKLFEijYoj0URRFx7EP7Owq4GIr0QWIeIeIeIeIh4iCPQRw12Pcrvco5wrhXixEFiniiREPEEeI4a4aom/bbn2n2HOwHvwHRERaTo6h5pIqspzWUpNUinikt0OtnGvjW4pDRyPUxNKmqY/EY7HYm2H9nYXe9w+JgOininiDJdNIiwqUqqO+Db2tY7IFpqriug2emWR8OJAipuTd2l3uOnCsaRkVvPkq3J8mW4Pk225J6spaoos4qKn6dhfJttj5MtufJduD5LtyXurmipta5vZtz7T2LuVcE0ei1Uz1b7b1uo62ddKUNIbiUnNa1kcGfSJLY14fGNdlvKISl9FciXVxUURtsq6QZbat0JlK5hJdW1cUbu2Q/s7Dl/qI4tJLJXNIayuk5bEj6qjdM2NWdJadse5FE6dYt2qNhvj3pp5rI17GYxLyT15r5hGmmuav9N7a73IOaK0ewe3A6PPcnWJ7ZaMQRojRrRqCb9tufaex25+6QzWHJZ069MsaLfCVofOkqEvpKhL5SpRL4StT5wlZ84SsS9srUbemWOKrn8GpZ1DG7Yf2dh+6KpZNcYd7V/2pFGbE2NGL/cNRiib+0qY7FaK0ewiNOj5MKl6xfbLCGN3tQRNiJ2Lc+09i7n7oqkhpOc1UrrQVootna2USztbCWfrVDVaWLoNZB0Wr1SRIEWA+jZLpahqSvqElFJaGGQxu7ZD+zau6JujFkvx19bjXVhOEsdNhtkZqh8JzU+FJqfCk1EsrNUEsxNEJzbLXyOVsUTucEMo9CIh0ge5b70fpq6mFZWFt5V8puLZOtLbxGuGqNUTf2Lc+09i7om6KWS+6s7o8ozn57Ev1iUjUXNUiqX3NZH025/vq2Hvm83pEMhibtkP7Nq7om6KWS/HcS4k7pKdpeyqlG3pqlT5oqk+aKpPmiqBLz1QNvJU6k1uXPZ3LmIJv7p+6IdIPuXrExSmrWdTFSUktNVXTNcyi5fTFIZ8lR0tUNHzNqif2nYtz7T2xN0ZSyK4uuBbSfVXP1sdVoljqtQoWQa2mabqV3+zWPXGW3PX/AHq2C/71eb0iHvhibtkP7Nq7om6KWUbhAvW7Gq0GL2EUYpD3wxu/un7oh0g+5esJMaaRpStV1FRk1tZ1G0/WSV1JaQnNOTB0vdMW7k3bbc+09i7om6KWQ+64Fy59Sk/+cqtEvjVpQtQa2p6bqb3NY3026Hvu13vq83pEMh7k3bIf2bV3RCKWWhqkpvFEz1jaWmZDPJKlAUahyDRxyDRxyDRxyDRxVFGUvoachEMb3b90Q6QvcvV+mNNtYNYZDVXJrXXUi1BP6RN223PtPYu6JujbrI/dX9tJ7VU/Wx1WYpY+rEKFkGspim6lT/ZrH+m3P992w99Xn9Ih74e5N2yH9m1xEX+4q/1aXS8PSFy9XxdbWQ9v3TXCukXYpo3f/MrP2pCUhqN3d0/c86QvcnV77cYg1plMoiYCJj2bc+09i7om6KhZJMFr65E9pafLe2rBL21YUPPtZUtOVI3GpbTVDJJHobga/RzSr7YJ/vV5/SIe+HuTdsh/ZtcRFHo57pLo4cgp2Z6t8xmNkPb91PfTdjjSf/crT2nCIQ3d3Ttz0OkNMKk6vExpxiDEEQyoYJ2rc+09r90RCyiYLd9uNXqwRhayBFgUTUSI+olYZS00q1eqqq8zm+WQ0GJ/W2H9m1xE/stxT6zqpLozrymlVYWSTCQVfa7X1LUCWTmqHwrNBbJzVSDZWaQo1Z+04SENBu7unIOQ6RkwqPq6TGnGoN7m3PtPa5P6e0swmC3bZmq21mrk2l1zPjOG6d3LpuV6J/iRolB6+HKariTaiYr9RXVHS+FW9VrVk0Y0ROxD+zao9C1M2kkPQXKnvntQLCLMNyyKs7kz6nqh+ZKpPmKqBbx1SQLwVRFj1imNKw2ENBu7ul3qhKZ9PqfiTap6nqCGiCJ3Nufae1d7m4mkmMylpq9Tq9fFWGeGeGIxBWILDPDGsGtwGp2If2bV3ubiMWJCiKzFVhoaOZzeXM1UbVa6P4R4YsMSGqKusmD2tYImAm7ulTHZghgmxE7m3PtPaqY7FRFMiHhnhmRDKgrUMgkNBGogiY9mH9m1UxMFMDBDKgsNDwzw0PDQ8NDw0EYiCJgInfYIZUMO6tz7T7OCGVDKhlQwQwQwQwQwQwTtQ/s7WCGCGCGCGCbcEMEMPq7c+0/pIf2fxVufaf0kP7Ppf//aAAgBAgIGPwAAB//aAAgBAwIGPwAAB//aAAgBAQEGPwD/ANKBzOPxucrmcfjc5XM4/G5yuZx+Nzlczj8bnK5nH43OVzOPxucrmcfjc5XM4/G5yuZx+Nzlczj8bnK5nH43OVzOPxucrmcfjc5XM4/G5yuZx+Nzlczj8bnK5nH43OVzOPxucrmcfjc5XM4/G5ymFCGxa62VKt3THlqTg/edYVzOPxucrmcfjc5XM4/G5yuZx+Nzlczj8bnK5nH43OVzOPxucrmcfjc5XM4/G5yuZx+Nzlczj8bnK5nH43OVzOPxucrmcfjc5XM4/G5yuZx+Nzlczj8bnK5nH43OVzOPxucrmcfjc5T8pmFFLjWTkhW6kd8oJNtjg69dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz1dHwPBfz3U0PeTyi+pZnzfKJ/ouHvJ5RfUsz5vlE9XYKx1j2OHvJ5RewYKx1j2OZ83yidkw9QYqwnUx11tZi18PeTyi9dirDqY9XAdXFrpnzfKJ2CzU61dfqLHqXLcTdpF4SkIfUMaWU986rB+igE1fOkDS591fd0dx1hlqQFtrdVYlls7ulxVhWQMCrcNY6x6mPXw95PKL1lmrj1Louia0X7uUXHrxbylItaaQpVmUgpUMpQCcB26dvi7GpUW8HpjTEFoyCtslZUpSClYUSAhKiMNtoGHHbsUz5vlE7ATqX6x/mD7h+5W47mX5p51uu7lwWWbszk2ZHZtq45P+ZPv775dfayPM/Ndz3FKFW27u9lW5XY1AeoMdY6vbTCU2chkG77qKhgKlWKfWO0MlIPZUKujQ+K6CpR+8L1SDhAFqGEHt98oj9U6uOsOqNZD3k8ovYdI9InEd5HZbu+M4dtTqt1ds7QQju1o3o624LWW3bwlt9lw7k1b4K+7qfnrHsEz5vlE7Fp36NA8d+tB/S5vJtbMNQT74nNXfDEF9vzh02JylFFgwW47Kw6VwR+0ryaw6WwR+0ryajXdd2ksSZOmLDcaM2VFa1HEAMmpN43jJbhwYbZdkyXTYhCBjJNYNLoHhK8msGlkHwleTXvZB8JXk171wfCV5Ne9cHwleTWkF3XbpDFmTZTKEx4zZOUsh1CiBaBtDXQ95PKL12j8SVpNDYkxbsiNSGVKVahaGUpUk4MYIsrDpZBH7SvJrDpdAH7SvJqNNiOh+LMaQ9GeTbYttwBSVC2zAQbaW0vS2AFtqKVjKUbCDYcITWDS2D4SvJr3sg+Erya964PhK8mveuD4SvJr3qg+EryavG8bpmNz4LrMZLclokpJQ0lKgLbMRGtmfN8onYtPOxGu/wAd+tBvS53Js1j1fzbGdQ0ak6d3i0QVhcS4EKH9n5Lz47eFA/a7FQtCYToL88pmXyEnCllBtZbP66xlfsjr6g1QNfD3k8ovXmrkuBoH/wCTlIbdUnGlod86v9lAUfyVfd5RymOuHD82utCcSXnQGWAAMPeqUD2hqjWjWTPm+UTsJrTz0a7/AB360Mb0fuC8r9ciypipSLuivSi2FIaCSsNJVkg2Gy2v9PdJfwmZmqw//n+kv4TMzVe4Gkn4VMzVOPv6C6QssspK3XnLslpShKRapSlFqwADCSat7uwnWRboYy2oLdj17zUjAzHSe+sNlmUr5KR1+wDT81xCYNzXBECWIzeDvUAIaaRbjUtViRbjJw1ed/3kvKl3m+p1adpCcSG09hCQEjsChrBr4e8nlF6y3UNGr20wkt/uoqDd92Eg4XF2KeWP1U2J/aNXHojHcByLbyvJIO2bW2EmzsZZsPYOyTPm+UTsJrT30a7/AB36gP6XXv8AdLV5rW3BV5vIkZamwCsWR23CLAoY7K98v5dePqtYNMf5dePq1e+H8vvH1ar6hxdLN1ky4ElmO35hPTlLcaUlItVHAFpO2dUbFEuq7I65c+e6lqNHRhKlK+ADGScAGE4Kau5opfvOVkvXzPSP+K9Z8lJIByEW2JH5cZNR7uvxUowozu7CPHeLSVrssBXYO+yQTZ26wRp/1pXxVgjTvrSvirm8760r4q5vO+tK+KubzvrSvipF7XK1JRMM5li154uJyFpWTgI/2RqjWQ95PKL1xqJd8JovzJzyGIrKcanHFBKR+UmrquCLYoQWQJDwFm6vK751z9pRJHWGCpl+Xuic/eE4pLy0ySlICEhCQlIGABKQK5tP+tK+Kubz/rSvirm8760r4q5vO+tK+KsEed9aV8VXfeFyNSESZN4ojuqeeLg3MtOrIAIG2kag1kz5vlE7Fp56Nd/jv1oL6XO5NnWfnrtbEaajRmlvyH1pbYYbSVLWtRsSlKRhJJOACvva9m0PaUXg3Y8cCkxGjh3FB21H+2odoYBab4ueDIEiZcIYF55GFDa5AWUt5X6QCLVDatG3bZdkW5tIbzumK5crLrkaFLeYbU4ZMlJWUtrSCSEgW9isOml+n/7GVnK98r8/EZOcr3yvz8Qk5yvfK/PxGTnK0bhXhpPe06G+86H4kia+60sBhwgKQtZBwi3CKb9qRvEc1RrIe8nlF697Ta8Wf8NBKo9yJUMC3yLHXR2EA5I7JO2moGjFwXg9BvOVZKvKZFcU08yyk/u0JWggpKzaT2B1lV7537+Iys5Xvnfv4jKzlX89fN7TL2eZvBKGXZr7j6kJ3JJyUlxSiBbtCmYl06RXndcU3Yw4Y0SW8w3llboKsltaRaQBhrDplfn4jJzlYdMb8/EJOcpEe9r9vC9GG17o2xLlOvoSsAjKCXFKANhIt10z5vlE7Fp56Pd/jv1oN6XO5NnZjRqbpGVibpFDeMctOJFkNtQ71TYw2lwW992Ckbdrlw3E8lzSea337o74Qmlj/iK2t0I+SDi+UcFgVpw884p115+Ct11ZKlKUoSCVKJwkk4zV0+wWPtUqhqGjWiu/vfZ3ab9qRvEdoa6HvJ5RetNQ7jhApS6d0nSrLQxHSRujh7VtgG2SBS3skRro0fiBEdgEZSykWIQDtrcUbLdsm01eF93k5uku8Xi67ZiSMSUJ7CUgAdgaukXtJPIppj2TG5R3U+HXzPm+UTr8erp56Nd/jv1oN6XO5NnWY6wVh2KVeFzOIDsuM5GdQ6MpHfDvF5OIlCrFC3tYjT8yY+uTKkrU5IkOqKlrWo2kqJwkmtM+y5A+CRV1ewmPtUrVJ1NFt/e+zu037UjeI5Q7VDWw95PKL1rESKyuRJkuBthhsFSlrUbEpAGMk0lt5KHb9vEJdveUnDYf7LKD+ii38ptPWs/y7db+VcdxukPLSe9kSxalS+ylu0pT2co4QRqmtIvaSeRTTHsmNyjuwzPm+UTrLNTD3NZp76Nd/jv1oL6XO5NnW9bUs2I1plvkH4H6h3zDviNd7Ua724SmXkLUoqQ665lApwWWOAV7zQeBdr3lg8E7XvLB4J2veaDwTtXPpDIv6JLZu1xa1x223EqVltrRgJwf2qb9qRvEdoa6HvJ5Retu2/orSH3LvdylMuAELQoFDiQSDkkpJAIxVDi6LTd1vHSaMFmQ2bFxIy8C8qzClxRtSBjGE7QqPeN2aOy5kGUkqjyW0gpWASkkWnrg17pzvBT5VYNE53gp8qsGiU7wU+VV+Rr+ux6635E9LrDTwAKkBpKbRYTtimrwuS4ZV5Q03aw0ZDIBTlpW6SnCRhAIr3Tn+Cnyq91J3gp8qsOis7wU+VTl3XtDcgTWglTkZ2wKAWMpJwW4wdbM+b5ROt7VG+dGdH/vO7Q8uOZPncRn94gAqTkvPIVgChhssr3P/mF3+s1g0O/mF3es17m/zG7vWa0ue0uuT7pbvRiGiCrzmNIy1NKdKxZHdcssyhjsrRNjRG6PvZ27JEpycnziOxkJcQ2EG2Q42DaUnFbXub/Mbu9Zr3O/mN3es17nfzC7vWa9z/5hd/rNTb8vvRnzK6ruQFzJXnsJzISVBIOQ2+tRwqAwChsVupphvkH4H6hXRc8K7ZMaTdrcxa5jby1hxbzzZALbzYssbG1XRVx8BJ9Zroq4+Ak+s10VcfASfWa6KuPgJPrNXLcN4XddLMO8XFofdjtPpdAS0tYySt9YxpGMU37Uj+I5qjWQ95PKL19zXDPu+9nZd3NLQ84w0wpslTiljJKn0HErbFdFX5wEb1muir84CN6zXRV+cBG9Zroq/eAjes10VfvARvWa6KvzgI3rNdFX5wEb1mui774CN6zU2/btZkMRJLTCENyUoS4C22EG0IWsYxgw62Z83yidYaNK0fvu7r3lTFT35Qdgsx1tZDiUAC1yQ0q3vTbgroXST6tD9croTST6tD9croTSX6tD9croTSX6tD9croTSX6tD9croTSX6tD9croTSX6tD9croXST6tD9croXST6tD9crSDRq7LrvxidezCG47spiMllJS6hZyyiStQwJOJJrt7ERqTE6O3n93JnlBl/uWXsst5WR/xm12WZRxU1eOkE77wmsMJjNPbk01Y0lSlhOS0lAxrJtst1sW97pkeaXhCUVRpGQhzJKklJ71wKScBOMULsv6+PP4IdS8GPN47XfoBCTlNNIVgtO3qWa2HvJ5ReswazFq4qxanX18z5vlE7Li/q1OtqW7Fbsduth7yeUXsW1W1W1W1q4Kw6yZ83yier8Wri2GHvJ5RewYtdirFrpnzfKJ1+LYMXUmLYIe8nlF7BiNYjWI1iNYjWI7BM+b5RP9Fw95PKL6lmfN8onqbnnFueTXPOLc8muecW55Nc84tzya55xbnk1zzi3PJrnnFueTXPOLc8muecW55Nc84tzya55xbnk1zzi3PJrnnFueTXPOLc8muecW55Nc84tzya55xbnk1zzi3PJrnnFueTXPOLc8muecW55NQ58GWwI+StsF3dEklLi7TYEHBhrnkTuu5queRO67mq55E7ruarnkTuu5queRO67mq55E7ruarnkTuu5queRO67mq55E7ruarnkTuu5queRO67mq55E7ruarnkTuu5queRO67mq55E7ruarnkTuu5queRO67mq55E7ruarnkTuu5queRO67mqkxmJsILUEG1SnQAAtJw/ujXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mK6RuzhH8xXSN2cI/mOpoG+P8AKq6lkb2PHT/RcDfH+VVr8RrFWKsRrEaxVirEdfI3seOn+i4G+P8AKq6lkb2PHT1Zi2DFr4G+P8qrX49bj1Mevkb2PHTsOLU2qx1jrHWPZOtsXX10DfH+VVsGOsdY6x1jrHq9fWyN7Hjp12HVx1jrHWOsdY9ksr4NfjrHq9uhrIG+P8qrXjKtI2wMHx0iXEYVeQmtlt+RJXa80sjvkgJsShSScBAtxG00uE/a7FdtXd8siwOt29zKTiUPzEasa7YDe6ypS8hpG0NslR2gBhJ61ITeYUyqCyVS75S4W1k2WqWQbU2W4gQbMXbfEFTiogWRGW9YHCgHAVBOAE9jXyN7Hjp2DHqpS3dspalkBCUsrJJOKywYbayEaO3iDZba5HcbHdWlIorRcbiUg2WOOstnuLcSaIcVBjAC0KceUQewMhCjRL98x0L3MkJbbWsFdnybVFGC3b/qpxh5BbdZWUOtnGlSTYQe0dhNGlwr70pui55pvWS4Ik6dHju5CkNAKyHFpVYbDYbK9/8ARv8AFYedr/UDRv8AFYedr/UHRr8Wh52nmdH9Jbqv16MkLkNXfMYlKbSTYFLDS1EAnbNMvaQX7d9xMyVFEd28JTUVLigLSlJdUkEgYbBX+oOjX4tDztf6g6Nfi0PO1/qBo3+Kw87Xv/o3+Kw87Wld33Vphcl5z5LcYR4MS8IzzzhTLZUchtDhUbACTYMVfBrYG+P8qrWsQILW7y5KslhrKSnKNhNlqiAMW2awXJb9JjZ2sFx/xMXO0FruJTt0yyEXjFEqKcG04gbt8pP9YwVJhqu92fJHfQdwLSXG3bDkrBeW2mzaULcIroL+Ki56ugv4qLnaMuehKr8mpskkEKDLdtoaSRg7KiMZ7ApF03Nc6jcjJC3n/OI6DJcwEWpU6CEo2gRjw9asNx/xMXO1huT+JjZ2jBvOP5tLSlK1NZaF4FYjagqH9etkb2PHTrTqX+bxu2LeG4qjBkyWUO5OUHbcnLBstsFtAm7rou91xOAllhpSk29oEi0UFyZFzR0KOSlbi46AT1rSRSSvSO7lAmwBqQh09xsqIpIcv5pRULRubTzvdKG1WflpaUSpL4TicRHWArtZeSe6KBjXXeLq7cKXEtNizr2hxeH8lOJi6OqUmz9247KANtm2hLRxH/apPm91wGrLcvdA65b1rLFosqTeMlLaX5ay48Gk5Kco4yB2ThPZ2K3W6ZezY/LGtDvab/I6z81fDXa1sDfH+VVrbvvV1pTzcJwrW0ggKV3pFgJ7ddCSj84iugpXCIroGXwqPiroGXwrfxV0FL4VHxV0FK4RFdBSuFRXQUvhEV0HK4RFdCSh84inL0YjrjNrZbb3JZBNqBZbaNbI3seOnXGtJP14vwO1d/slrl3+o8FYtXTL2bH5Y1od7Tf5Ghq9urNdA3x/lVa6YLoQ055hufnG6uBFm65WTZbj+QawR4n1hPxVzeJ9YT8VYY8T6wn4q5vE+sJ+KpUGQBu8N5xh8JNoy21FKrDti0UpUeK9ICDYotIUuw9nJBpTTzS2XEWZTawUqFotFoOHFV23PNcdaiy923RbBSlwbmytwWFSVDGkbVQJV3SJj7kqQWnBJW2oABBVgyG0YcGukb2PHTrDqGtJf14nwO1GvOLeTENtiGiKWnUqUSUuOLttTtd/XTkTg3K6cicG5XTcTg1103E4NddNxODXXTUXg1101F4NdTL1evOO+3DSFKaQhQJtUE4Ce3s+mXs2Pyxr/wDM9G5t5s3VCmXy+qZJdcQ2pTaGbVNM5ZGU458lIFuE22EA1Fu8XSi4Zl2x0Rrrve7kpbebbbTkoQ4CLHkizDl4cdigTbTkmZG+99HwbGtIYSSpoA4g8jCpo/rd7tBR1e3Q1sDfH+VVqnUParSj6F/f0bp+4/vCxht7zjzncvl24Mncl4rOvXup/H/9vXup/Hf9vUa+vM/MPOFuI823TdbNzWUW5WSi22y3FWkPtOXyy6v30lrxDV+fRvszVXH9J+yu1c/piuTOukb2PHTrDqKrSX9eL8DtRbtu2LBfYfgokrXJQ4peWpxxBAKHUCyxA2q6Pungn8/WGBdXBP5+uYXVwT+frmF1cE/n65hdXBP5+uYXXwT+frmN18E9n6lXXLiQG48xIS6tpt0LACgrAVOqG11tn0y9mx+WNaGkYCL0fII3mo9z6Y7tpRo8nJbblKUDPioGDvFqs3ZI/RWbesoDBQvTR68o98Xa+C2+lPykFQwtvNKAUg2HClQxdin710FU1o1e5yluXSQRAfNmJCU4WCT+iCn/AGRjp26NJLrfuuc0TYh0d44kf22nBalaeykka+Bvj/Kq1prSj6F/1FG9bulwGY5jNs5Elx1K8pFtuBDSxZh69dI3Rwz/AKvXSF0cM/6vUO557rL0mO48pa46lKbIccUoWFaUHEetWkXYvOXyy6v70lnxDV+D0b7K1Vx/SfsrtXP6arkzqjVkb2PHTrDqHt1pEv8AScjJs7SXPjqEP0brZHHPH8+vHUGmPs1jljWh3tN/kdRm+dGr0euyc1YFls2tuo/QdbNqVpPWUD18dRrn0o3HRrSVeS2halZMKW4cH7paiS2on+ws9YJUo4KvEabQ40m44LLkiRIkCxUdKEkqcacFikKsxFJtOKpyrobfZupUhw3a1JUlbyWMo7mHFJABVk2W2DHroG+P8qrVOoqtKfoX/UUbqu6JAejiM29lyW3VLyl5VotQ6gWYOtXR10cC/wCsV0ddHAv+sVDvie0yzKkOPJW3HSpLYDbikiwLUs4h160j9qTOWXV/+ks+Iqr9+i/ZWquP6T9ldq5/TFcmdUasjex46dcavp7aXMSgdtDYP+9Sk/8AKhMI7uUr/eq8pF7XWzOeZmlttxwG0J3NBswEbZrBo9F7ivjr3fi9xXx17vxe4r46934vcV8de78XuK+Or7lxLkjsSY8N1xh5INqVBJIIw7VDZjWmPs2PyxrQ/wBpv8jq4qToROvt6XcCXkOpZe793Jbwpa3U98WwbCEk2AgWYBZr4G+P8qrVOoa0o+hf9RRvW75cBmOYzbORIcdSvKRbabENLFmHr10hdHCv+r10hdPCv5iolzz3WXpMdx5S1x1KU2Q44VCwqSg4j1q0i9qTOWXV/eks+Iav36L9laq4vpP2V2rn9MVyZodrUGrI3seOnXtPZNnn8t9/t2ENW8XV+rBtS042wkdbcmkIP9YNXt7QPJN1e/6kb7O3rIu/N+MK0h9Af8Q0Nn0w9mscsa0P9pv8jq7WwQN8f5VWqdQ1pR9C/v6N13fEgPR/N23suQ26peUu20WodQLMHWro+6eCfz9dH3TwT+fqJe89tlqTIW6laI6VJbAbcUkWBSlnEOvWkJ/8nL5ZdXw3e15NQVvvtqZS4TaoBJBIsBq9593yEyoj/m+5SEfJVkx20my3rEEVcZ9J+yu1c/pquTNDUGrI3seOnWdqjSUJSVKUbEpAtJJxACrviPENouyEnzpe0FIRlOqwdm01PvBduXOkOyFW4Ta4sq/PV7+0TyTdXv8AqRuQb1TUTfm/GFaRegP+IdQbNph7NY5Y1of7Sf5HY4G+P8qrXaT/AEL+/pXoTH+9q3UHUFBcU+4gHASlTq7D+XGKv5aTalV4yiD1wXlasa8kMr8zutt5T8izvMpxpTaUZWK05dtnWFXK3b36pa1JHYSiw/CNdI3seOnWGjUd91GVCugplSCcRWD+6R+VQt7QNSmG1WSb3PmbI28hWF0+ACPy6l7D/wAh/dIqbfLF6R4zUpLQSy4hZUNzbSg2kYMOTXTcTg1103F4NddNxODXTLpvqKQ0tKyA2vDkm2tIvQH/ABDsx7Gppf7NY5Y1oh7Sf5HY4G+P8qrW2VpL9D/v6Jst/wAGz8KqviNfi4TUaTHQttU4thBUhRBSC7gtIXi2/wAlJcb/AMsIWghSFp8yBBGIginBdklF5zQiyJFZSrcwcQyl2BIA6wNtOPOqy3HVFbizjKlG0nu1dUt95EeMVLakuuKCUBLiFJtUokAAEg4aU47edxuOLNq1rejFRPXJJpSfvmMpDAyUsxgXcWIIDYIs7WCmnWWlMXfCQW4LS7Mo5RtW4oC0AqsGC3EBQFAayRvY8dOsOo5c6P8ADXw44p57dCP8QNrczg+SkfJ7Z69OMsLyoN0hUaNZiUu396sdtQs7QFYqvUf+/wD7pFTbpgxIDsaMlotrfbdUs7o2lZtKXUjGetXMLr4J/P1zC6+Cfz9cwuvgn8/TLSoN1hLjiUqsaetsJs/59aQDrwHvFNDsbN2KeeuG+59yPSEhEh275LsZS0g2hKi0pJIB2jTLN/aR3pfbMdRXHavCY9JShRFhUlLq1AEjbFfnoDYYG+P8qrXOfd94SoG7Wbt5s6trLybcnKyCLbLTZbXnE6W/NfsCd2fcU4uwYhlKJNg1mKsWri1LdZI3seOnXIdaWpt1tQU24gkKSoG0EEYQRWHHt6i2ruvSXBaWrKW3HfcaSVWWWkIUATYKXJmyHZklyzLkPrU4tVgsFqlEk2AWVi1MVAgWEYjSkOTpC0LFi0KdWQQcYIJw9R27DA3x/lVdSyN7Hjp6hw9VQN8f5VXUsjex46dfi1mLVxdWwN8f5VXUsjex46f6Lgb4/wAqrqWRvY8dPU3/2Q=="};var fce=class{constructor(f,m,v,y,x){if(this.gl=f,this.width=m=Math.floor(m),this.height=v=Math.floor(v),this.isReady=!0,m===0||v===0){this.isReady=!1;return}if(this._disposed=!1,this._glVersion=Z(x,1),this.framebuffer=f.createFramebuffer(),f.bindFramebuffer(f.FRAMEBUFFER,this.framebuffer),this.renderbuffer=f.createRenderbuffer(),f.bindRenderbuffer(f.RENDERBUFFER,this.renderbuffer),f.renderbufferStorage(f.RENDERBUFFER,f.DEPTH_COMPONENT16,m,v),this.texture=f.createTexture(),f.activeTexture(f.TEXTURE0),f.bindTexture(f.TEXTURE_2D,this.texture),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,m,v,0,f.RGBA,f.UNSIGNED_BYTE,null),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,1),y&&(this.depthTexture=f.createTexture(),f.bindTexture(f.TEXTURE_2D,this.depthTexture),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.NEAREST),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_S,f.CLAMP_TO_EDGE),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_WRAP_T,f.CLAMP_TO_EDGE),this._glVersion===1?f.texImage2D(f.TEXTURE_2D,0,f.DEPTH_COMPONENT,m,v,0,f.DEPTH_COMPONENT,f.UNSIGNED_SHORT,null):f.texImage2D(f.TEXTURE_2D,0,f.DEPTH_COMPONENT16,m,v,0,f.DEPTH_COMPONENT,f.UNSIGNED_SHORT,null)),f.framebufferTexture2D(f.FRAMEBUFFER,f.COLOR_ATTACHMENT0,f.TEXTURE_2D,this.texture,0),y?f.framebufferTexture2D(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.TEXTURE_2D,this.depthTexture,0):f.framebufferRenderbuffer(f.FRAMEBUFFER,f.DEPTH_ATTACHMENT,f.RENDERBUFFER,this.renderbuffer),f.checkFramebufferStatus(f.FRAMEBUFFER)!==f.FRAMEBUFFER_COMPLETE)throw new Error("this combination of attachments does not work")}bind(){if(!this.isReady)return;let f=this.gl;f.bindFramebuffer(f.FRAMEBUFFER,this.framebuffer),f.bindRenderbuffer(f.RENDERBUFFER,this.renderbuffer)}getPixel(f,m){if(!this.isReady)return null;let v=new Uint8Array(4);return this.gl.readPixels(f,m,1,1,this.gl.RGBA,this.gl.UNSIGNED_BYTE,v),v}getId(f,m){if(!this.isReady)return null;let v=this.getPixel(f,m);return v[3]!==0?v[0]+v[1]*256+v[2]*256*256:null}delete(){if(this._disposed||!this.isReady)return;let f=this.gl;typeof WebGL2RenderingContext<"u"&&f instanceof WebGL2RenderingContext&&f.invalidateFramebuffer(f.FRAMEBUFFER,[f.COLOR_ATTACHMENT0,f.DEPTH_ATTACHMENT]),f.deleteFramebuffer(this.framebuffer),f.deleteRenderbuffer(this.renderbuffer),f.deleteTexture(this.texture),f.deleteTexture(this.depthTexture),this._disposed=!0}};var er={TOP:1,BOTTOM:2,LEFT:3,RIGHT:4,FRONT:5,BACK:6,TOP_LEFT_FRONT:7,TOP_RIGHT_FRONT:8,TOP_LEFT_BACK:9,TOP_RIGHT_BACK:10,BOTTOM_LEFT_FRONT:11,BOTTOM_RIGHT_FRONT:12,BOTTOM_LEFT_BACK:13,BOTTOM_RIGHT_BACK:14,TOP_LEFT:15,TOP_RIGHT:16,TOP_FRONT:17,TOP_BACK:18,BOTTOM_LEFT:19,BOTTOM_RIGHT:20,BOTTOM_FRONT:21,BOTTOM_BACK:22,FRONT_RIGHT:23,FRONT_LEFT:24,BACK_RIGHT:25,BACK_LEFT:26},k8i=new Float32Array(16),V8i=new Float32Array(9),_Oe=new Ye,uK=class{constructor(f,m){m=Z(m,Z.EMPTY_OBJECT),this._earthCtrl=f,this._viewer=f.coreMap,this._options=m,this._zoomDuration=Z(m.zoomDuration,1),this._image=Z(m.image,void 0),this._eventHanler=new Ur(this._viewer.scene.canvas),this._initialized=!1,this._modelId=1000001,this._region=[],this.ratio=.05,this.minSize=50,this.maxSize=200,this.highlighting=1.2,this.activeAlpha=1,this.passiveAlpha=.7,this.position=er.BOTTOM_RIGHT,this.trueNorth=0,this._stopped=!0,this._shader=void 0,this.vertices=new Float32Array([-.3,-.5,-.3,.3,-.5,-.3,.3,-.5,.3,-.3,-.5,.3,-.3,.5,-.3,-.3,.5,.3,.3,.5,.3,.3,.5,-.3,-.3,-.3,.5,.3,-.3,.5,.3,.3,.5,-.3,.3,.5,-.3,-.3,-.5,-.3,.3,-.5,.3,.3,-.5,.3,-.3,-.5,.5,-.3,-.3,.5,.3,-.3,.5,.3,.3,.5,-.3,.3,-.5,-.3,-.3,-.5,-.3,.3,-.5,.3,.3,-.5,.3,-.3,-.5,-.5,.5,-.3,-.5,.5,-.3,-.3,.5,-.5,-.3,.5,-.5,-.5,.3,-.5,-.5,.5,-.5,-.3,.5,-.5,-.3,.3,-.5,-.5,.3,-.3,-.5,.3,-.3,-.5,.5,-.5,-.5,.5,.3,-.5,.5,.5,-.5,.5,.5,-.3,.5,.3,-.3,.5,.5,-.5,.3,.5,-.3,.3,.5,-.3,.5,.5,-.5,.5,.3,-.5,.3,.5,-.5,.3,.5,-.5,.5,.3,-.5,.5,-.5,.3,.5,-.3,.3,.5,-.3,.5,.5,-.5,.5,.5,-.5,.3,.3,-.5,.3,.5,-.5,.5,.5,-.5,.5,.3,-.5,.5,.3,-.5,.5,.5,-.3,.5,.5,-.3,.5,.3,.3,.3,.5,.5,.3,.5,.5,.5,.5,.3,.5,.5,.5,.3,.3,.5,.5,.3,.5,.5,.5,.5,.3,.5,.3,.5,.3,.3,.5,.5,.5,.5,.5,.5,.5,.3,-.5,-.5,-.5,-.3,-.5,-.5,-.3,-.3,-.5,-.5,-.3,-.5,-.5,-.5,-.5,-.5,-.5,-.3,-.5,-.3,-.3,-.5,-.3,-.5,-.5,-.5,-.5,-.3,-.5,-.5,-.3,-.5,-.3,-.5,-.5,-.3,.3,-.5,-.5,.5,-.5,-.5,.5,-.3,-.5,.3,-.3,-.5,.5,-.5,-.5,.5,-.3,-.5,.5,-.3,-.3,.5,-.5,-.3,.3,-.5,-.5,.5,-.5,-.5,.5,-.5,-.3,.3,-.5,-.3,-.5,.3,-.5,-.3,.3,-.5,-.3,.5,-.5,-.5,.5,-.5,-.5,.3,-.5,-.5,.3,-.3,-.5,.5,-.3,-.5,.5,-.5,-.5,.5,-.5,-.5,.5,-.3,-.3,.5,-.3,-.3,.5,-.5,.3,.3,-.5,.5,.3,-.5,.5,.5,-.5,.3,.5,-.5,.5,.3,-.5,.5,.5,-.5,.5,.5,-.3,.5,.3,-.3,.3,.5,-.5,.3,.5,-.3,.5,.5,-.3,.5,.5,-.5,.3,-.3,.5,.5,-.3,.5,.5,.3,.5,.3,.3,.5,.5,-.3,.3,.5,.3,.3,.5,.3,.5,.5,-.3,.5,-.5,-.3,.5,-.3,-.3,.5,-.3,.3,.5,-.5,.3,.5,-.5,-.3,.3,-.5,-.3,.5,-.5,.3,.5,-.5,.3,.3,-.3,-.5,.5,.3,-.5,.5,.3,-.3,.5,-.3,-.3,.5,-.3,-.5,.3,.3,-.5,.3,.3,-.5,.5,-.3,-.5,.5,-.3,.3,.5,.3,.3,.5,.3,.5,.5,-.3,.5,.5,-.3,.5,.3,-.3,.5,.5,.3,.5,.5,.3,.5,.3,.3,-.3,-.5,.5,-.3,-.5,.5,.3,-.5,.3,.3,-.5,.5,-.3,-.5,.5,.3,-.5,.5,.3,-.3,.5,-.3,-.3,-.5,-.3,-.5,-.5,.3,-.5,-.3,.3,-.5,-.3,-.3,-.5,-.5,-.3,-.5,-.5,-.3,-.3,-.5,.3,-.3,-.5,.3,-.5,-.3,-.5,-.5,.3,-.5,-.5,.3,-.3,-.5,-.3,-.3,-.5,-.3,-.5,-.5,.3,-.5,-.5,.3,-.5,-.3,-.3,-.5,-.3,-.3,.3,-.5,.3,.3,-.5,.3,.5,-.5,-.3,.5,-.5,-.3,.5,-.5,-.3,.5,-.3,.3,.5,-.3,.3,.5,-.5,.3,-.5,-.3,.5,-.5,-.3,.5,-.5,.3,.3,-.5,.3,.5,-.5,-.3,.5,-.3,-.3,.5,-.3,.3,.5,-.5,.3,-.5,-.5,-.3,-.3,-.5,-.3,-.3,-.5,.3,-.5,-.5,.3,-.5,-.5,-.3,-.5,-.5,.3,-.5,-.3,.3,-.5,-.3,-.3,.3,.5,-.3,.3,.5,.3,.5,.5,.3,.5,.5,-.3,.5,.3,-.3,.5,.5,-.3,.5,.5,.3,.5,.3,.3,-.5,.5,-.3,-.5,.5,.3,-.3,.5,.3,-.3,.5,-.3,-.5,.3,-.3,-.5,.3,.3,-.5,.5,.3,-.5,.5,-.3]),this.indices=new Uint16Array([0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23,0+24,1+24,2+24,0+24,2+24,3+24,4+24,5+24,6+24,4+24,6+24,7+24,8+24,9+24,10+24,8+24,10+24,11+24,0+36,1+36,2+36,0+36,2+36,3+36,4+36,5+36,6+36,4+36,6+36,7+36,8+36,9+36,10+36,8+36,10+36,11+36,0+48,1+48,2+48,0+48,2+48,3+48,4+48,5+48,6+48,4+48,6+48,7+48,8+48,9+48,10+48,8+48,10+48,11+48,0+60,1+60,2+60,0+60,2+60,3+60,4+60,5+60,6+60,4+60,6+60,7+60,8+60,9+60,10+60,8+60,10+60,11+60,0+72,2+72,1+72,0+72,3+72,2+72,4+72,5+72,6+72,4+72,6+72,7+72,8+72,9+72,10+72,8+72,10+72,11+72,0+84,2+84,1+84,0+84,3+84,2+84,4+84,5+84,6+84,4+84,6+84,7+84,8+84,9+84,10+84,8+84,10+84,11+84,0+96,2+96,1+96,0+96,3+96,2+96,4+96,5+96,6+96,4+96,6+96,7+96,8+96,9+96,10+96,8+96,10+96,11+96,0+108,2+108,1+108,0+108,3+108,2+108,4+108,5+108,6+108,4+108,6+108,7+108,8+108,9+108,10+108,8+108,10+108,11+108,0+120,1+120,2+120,0+120,2+120,3+120,4+120,5+120,6+120,4+120,6+120,7+120,0+128,1+128,2+128,0+128,2+128,3+128,4+128,5+128,6+128,4+128,6+128,7+128,0+136,1+136,2+136,0+136,2+136,3+136,4+136,5+136,6+136,4+136,6+136,7+136,0+144,1+144,2+144,0+144,2+144,3+144,4+144,5+144,6+144,4+144,6+144,7+144,0+152,2+152,1+152,0+152,3+152,2+152,4+152,5+152,6+152,4+152,6+152,7+152,0+160,1+160,2+160,0+160,2+160,3+160,4+160,5+160,6+160,4+160,6+160,7+160,0+168,2+168,1+168,0+168,3+168,2+168,4+168,5+168,6+168,4+168,6+168,7+168,0+176,2+176,1+176,0+176,3+176,2+176,4+176,5+176,6+176,4+176,6+176,7+176,0+184,1+184,2+184,0+184,2+184,3+184,4+184,5+184,6+184,4+184,6+184,7+184,0+192,1+192,2+192,0+192,2+192,3+192,4+192,5+192,6+192,4+192,6+192,7+192,0+200,1+200,2+200,0+200,2+200,3+200,4+200,5+200,6+200,4+200,6+200,7+200,0+208,1+208,2+208,0+208,2+208,3+208,4+208,5+208,6+208,4+208,6+208,7+208]),this.txtCoords=new Float32Array([1/3+1/15,0/3+1/15,2/3-1/15,0/3+1/15,2/3-1/15,1/3-1/15,1/3+1/15,1/3-1/15,1-1/15,0/3+1/15,1-1/15,1/3-1/15,2/3+1/15,1/3-1/15,2/3+1/15,0/3+1/15,2/3+1/15,1/3+1/15,1-1/15,1/3+1/15,1-1/15,2/3-1/15,2/3+1/15,2/3-1/15,0+1/15,1/3-1/15,0+1/15,0/3+1/15,1/3-1/15,0/3+1/15,1/3-1/15,1/3-1/15,0+1/15,1/3+1/15,1/3-1/15,1/3+1/15,1/3-1/15,2/3-1/15,0+1/15,2/3-1/15,2/3-1/15,1/3+1/15,2/3-1/15,2/3-1/15,1/3+1/15,2/3-1/15,1/3+1/15,1/3+1/15,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,2/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,1/3+1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,1/30,1/3+1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+1/30,1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/3+1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/30,1/3+1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,2/3+2/30,1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30,1/3+2/30,1/3+1/30]),this.ids=new Float32Array([er.FRONT,er.FRONT,er.FRONT,er.FRONT,er.BACK,er.BACK,er.BACK,er.BACK,er.TOP,er.TOP,er.TOP,er.TOP,er.BOTTOM,er.BOTTOM,er.BOTTOM,er.BOTTOM,er.RIGHT,er.RIGHT,er.RIGHT,er.RIGHT,er.LEFT,er.LEFT,er.LEFT,er.LEFT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_LEFT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_RIGHT_FRONT,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_LEFT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.TOP_RIGHT_BACK,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_LEFT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_RIGHT_FRONT,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_LEFT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.BOTTOM_RIGHT_BACK,er.TOP_RIGHT,er.TOP_RIGHT,er.TOP_RIGHT,er.TOP_RIGHT,er.TOP_RIGHT,er.TOP_RIGHT,er.TOP_RIGHT,er.TOP_RIGHT,er.TOP_LEFT,er.TOP_LEFT,er.TOP_LEFT,er.TOP_LEFT,er.TOP_LEFT,er.TOP_LEFT,er.TOP_LEFT,er.TOP_LEFT,er.TOP_FRONT,er.TOP_FRONT,er.TOP_FRONT,er.TOP_FRONT,er.TOP_FRONT,er.TOP_FRONT,er.TOP_FRONT,er.TOP_FRONT,er.TOP_BACK,er.TOP_BACK,er.TOP_BACK,er.TOP_BACK,er.TOP_BACK,er.TOP_BACK,er.TOP_BACK,er.TOP_BACK,er.BOTTOM_RIGHT,er.BOTTOM_RIGHT,er.BOTTOM_RIGHT,er.BOTTOM_RIGHT,er.BOTTOM_RIGHT,er.BOTTOM_RIGHT,er.BOTTOM_RIGHT,er.BOTTOM_RIGHT,er.BOTTOM_LEFT,er.BOTTOM_LEFT,er.BOTTOM_LEFT,er.BOTTOM_LEFT,er.BOTTOM_LEFT,er.BOTTOM_LEFT,er.BOTTOM_LEFT,er.BOTTOM_LEFT,er.BOTTOM_FRONT,er.BOTTOM_FRONT,er.BOTTOM_FRONT,er.BOTTOM_FRONT,er.BOTTOM_FRONT,er.BOTTOM_FRONT,er.BOTTOM_FRONT,er.BOTTOM_FRONT,er.BOTTOM_BACK,er.BOTTOM_BACK,er.BOTTOM_BACK,er.BOTTOM_BACK,er.BOTTOM_BACK,er.BOTTOM_BACK,er.BOTTOM_BACK,er.BOTTOM_BACK,er.FRONT_RIGHT,er.FRONT_RIGHT,er.FRONT_RIGHT,er.FRONT_RIGHT,er.FRONT_RIGHT,er.FRONT_RIGHT,er.FRONT_RIGHT,er.FRONT_RIGHT,er.FRONT_LEFT,er.FRONT_LEFT,er.FRONT_LEFT,er.FRONT_LEFT,er.FRONT_LEFT,er.FRONT_LEFT,er.FRONT_LEFT,er.FRONT_LEFT,er.BACK_RIGHT,er.BACK_RIGHT,er.BACK_RIGHT,er.BACK_RIGHT,er.BACK_RIGHT,er.BACK_RIGHT,er.BACK_RIGHT,er.BACK_RIGHT,er.BACK_LEFT,er.BACK_LEFT,er.BACK_LEFT,er.BACK_LEFT,er.BACK_LEFT,er.BACK_LEFT,er.BACK_LEFT,er.BACK_LEFT]),this.init()}init(){let f=this,m=this._viewer,v=this._viewer.scene.context._gl;if(this.leftDownPos=void 0,this._shader=null,this._initShader(),this._alpha=this.passiveAlpha,this._selection=0,v.useProgram(this._shader),this._pMatrixUniformPointer=v.getUniformLocation(this._shader,"uPMatrix"),this._rotationUniformPointer=v.getUniformLocation(this._shader,"uRotation"),this._colourCodingUniformPointer=v.getUniformLocation(this._shader,"uColorCoding"),this._alphaUniformPointer=v.getUniformLocation(this._shader,"uAlpha"),this._selectionUniformPointer=v.getUniformLocation(this._shader,"uSelection"),this._textureUniformPointer=v.getUniformLocation(this._shader,"uTexture"),this._highlightingUniformPointer=v.getUniformLocation(this._shader,"uHighlighting"),this._vertexAttrPointer=v.getAttribLocation(this._shader,"aVertex"),this._texCoordAttrPointer=v.getAttribLocation(this._shader,"aTexCoord"),this._idAttrPointer=v.getAttribLocation(this._shader,"aId"),v.enableVertexAttribArray(this._vertexAttrPointer),v.enableVertexAttribArray(this._texCoordAttrPointer),v.enableVertexAttribArray(this._idAttrPointer),this._indexBuffer=v.createBuffer(),this._vertexBuffer=v.createBuffer(),this._texCoordBuffer=v.createBuffer(),this._idBuffer=v.createBuffer(),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,this._indexBuffer),v.bufferData(v.ELEMENT_ARRAY_BUFFER,this.indices,v.STATIC_DRAW),v.bindBuffer(v.ARRAY_BUFFER,this._vertexBuffer),v.bufferData(v.ARRAY_BUFFER,this.vertices,v.STATIC_DRAW),v.bindBuffer(v.ARRAY_BUFFER,this._texCoordBuffer),v.bufferData(v.ARRAY_BUFFER,this.txtCoords,v.STATIC_DRAW),v.bindBuffer(v.ARRAY_BUFFER,this._idBuffer),v.bufferData(v.ARRAY_BUFFER,this.ids,v.STATIC_DRAW),this._texture=v.createTexture(),typeof this._image>"u"){let y=M0t.cn,x=new Image;f._image=x,x.addEventListener("load",()=>{this.loadImage2GPU(v,f)}),x.src=y}else this.loadImage2GPU(v,f);this._eventHanler.setInputAction(y=>{if(this.stopped)return;let x=nl.transformWindowToDrawingBuffer(this._viewer.scene,y.endPosition,_Oe),C=x.x,w=x.y,A=C,E=m.scene.drawingBufferHeight-w;if(!f._region)return;if(!f.isInRegion(A,E)){f._alpha=f.passiveAlpha,f._selection=0;return}let T=this.getId(C,w);T?T>=er.TOP&&T<=er.BACK_LEFT&&(f._alpha=f.activeAlpha,f._selection=T):(f._alpha=f.passiveAlpha,f._selection=0)},Ei.MOUSE_MOVE),f._drag=!1,this._eventHanler.setInputAction(y=>{if(this.stopped)return;f.leftDownPos=y.position;let x=nl.transformWindowToDrawingBuffer(this._viewer.scene,y.position,_Oe),C=x.x,w=x.y,A=C,E=m.scene.drawingBufferHeight-w;if(!this._region||!f.isInRegion(A,E))return;let T=this.getId(C,w);!T||T>=er.TOP&&T<=er.BACK_LEFT&&(f._drag=!0)},Ei.LEFT_DOWN),this._eventHanler.setInputAction(y=>{if(this.stopped){f._drag=!1;return}f._drag=!1,f.leftDownPos&&Ye.distance(f.leftDownPos,y.position)<3&&f.pick(y)},Ei.LEFT_UP),this._viewer.scene.postRender.addEventListener(()=>{f.onAfterDraw(this._viewer.scene.drawingBufferWidth,this._viewer.scene.drawingBufferHeight)})}setNaviTarget(f){let m=this;if(m._initialized=!0,m._targetCenter=Z(f.targetCenter,void 0),m._offsetDistance=Z(f.offsetDistance,100),m._modelMatrix=Z(f.modelMatrix,Ee.IDENTITY),m._zoomDuration=Z(f.zoomDuration,1),m._heading=Z(f.heading,0),m._pitch=Z(f.pitch,0),!this._targetCenter)throw new li("\u5BFC\u822A\u76D2\u63A7\u4EF6\u5FC5\u9700\u8BBE\u7F6E targetCenter \u53C2\u6570");m._stopped=!1,m._viewer.camera.viewBoundingSphere(new Pi(m._targetCenter,m._offsetDistance),new gC(m._heading,m._pitch,m._offsetDistance)),m._viewer.scene.screenSpaceCameraController.enableZoom=!1}pick(f){let m=nl.transformWindowToDrawingBuffer(this._viewer.scene,f.position,_Oe),v=m.x,y=m.y,x=v,C=this._viewer.scene.drawingBufferHeight-y;if(!this._region||!this.isInRegion(x,C))return;let w=this.getId(v,y);if(!w)return;let A=this,E=new H,T=0,S=0;switch(w){case er.TOP:E=H.fromElements(0,0,1),T=0,S=-90;break;case er.BOTTOM:E=H.fromElements(0,0,-1),S=90;break;case er.FRONT:E=H.fromElements(0,-1,0);break;case er.BACK:E=H.fromElements(0,1,0),T=180;break;case er.LEFT:E=H.fromElements(-1,0,0),T=90;break;case er.RIGHT:E=H.fromElements(1,0,0),T=-90;break;case er.TOP_LEFT_FRONT:E=H.fromElements(-1,-1,1),T=45,S=-45;break;case er.TOP_RIGHT_FRONT:E=H.fromElements(1,-1,1),T=-45,S=-45;break;case er.TOP_LEFT_BACK:E=H.fromElements(-1,1,1),T=135,S=-45;break;case er.TOP_RIGHT_BACK:E=H.fromElements(1,1,1),T=-135,S=-45;break;case er.BOTTOM_LEFT_FRONT:E=H.fromElements(-1,-1,-1),T=45,S=45;break;case er.BOTTOM_RIGHT_FRONT:E=H.fromElements(1,-1,-1),T=-45,S=45;break;case er.BOTTOM_LEFT_BACK:E=H.fromElements(-1,1,-1),T=135,S=45;break;case er.BOTTOM_RIGHT_BACK:E=H.fromElements(1,1,-1),T=-135,S=45;break;case er.TOP_LEFT:E=H.fromElements(-1,0,1),T=90,S=-45;break;case er.TOP_RIGHT:E=H.fromElements(1,0,1),T=-90,S=-45;break;case er.TOP_FRONT:E=H.fromElements(0,-1,1),S=-45;break;case er.TOP_BACK:E=H.fromElements(0,1,1),T=180,S=-45;break;case er.BOTTOM_LEFT:E=H.fromElements(-1,0,-1),T=90,S=45;break;case er.BOTTOM_RIGHT:E=H.fromElements(1,0,-1),T=-90,S=45;break;case er.BOTTOM_FRONT:E=H.fromElements(0,-1,-1),S=45;break;case er.BOTTOM_BACK:E=H.fromElements(0,1,-1),T=180,S=45;break;case er.FRONT_RIGHT:E=H.fromElements(1,-1,0),T=-45;break;case er.FRONT_LEFT:E=H.fromElements(-1,-1,0),T=45;break;case er.BACK_RIGHT:E=H.fromElements(1,1,0),T=-135;break;case er.BACK_LEFT:E=H.fromElements(-1,1,0),T=135;break;default:return!1}let M=tn.eastNorthUpToFixedFrame(A._targetCenter),I=A.offsetFromHeadingPitchRange(xe.toRadians(T),xe.toRadians(S),A._offsetDistance),P=Ee.multiplyByPoint(M,I,new H);A._viewer.camera.flyTo({duration:A._zoomDuration,orientation:{heading:xe.toRadians(T),pitch:xe.toRadians(S),roll:0},destination:P,maximumHeight:A._offsetDistance})}loadImage2GPU(f,m){f.bindTexture(f.TEXTURE_2D,m._texture),f.pixelStorei(f.UNPACK_FLIP_Y_WEBGL,1),f.texImage2D(f.TEXTURE_2D,0,f.RGBA,f.RGBA,f.UNSIGNED_BYTE,m._image),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MAG_FILTER,f.LINEAR),f.texParameteri(f.TEXTURE_2D,f.TEXTURE_MIN_FILTER,f.LINEAR_MIPMAP_NEAREST),f.generateMipmap(f.TEXTURE_2D)}onAfterDraw(f,m){if(this.stopped)return;let v=this.setActive();v.disable(v.BLEND),v.disable(v.DEPTH_TEST),v.uniform1f(this._colourCodingUniformPointer,0),this.draw(f,m)}offsetFromHeadingPitchRange(f,m,v){m=xe.clamp(m,-xe.PI_OVER_TWO,xe.PI_OVER_TWO),f=xe.zeroToTwoPi(f)-xe.PI_OVER_TWO;let y=Gr.fromAxisAngle(H.UNIT_Y,-m),x=Gr.fromAxisAngle(H.UNIT_Z,-f),C=Gr.multiply(x,y,x),w=Ut.fromQuaternion(C),A=H.clone(H.UNIT_X);return Ut.multiplyByVector(w,A,A),H.negate(A,A),H.multiplyByScalar(A,v,A),A}onAfterDrawId(){if(this.stopped)return;this.setActive().uniform1f(this._colourCodingUniformPointer,1),this.draw(this._viewer.scene.drawingBufferWidth,this._viewer.scene.drawingBufferHeight)}onAfterDrawModelId(){if(this.stopped)return;this.setActive().uniform1f(this._colourCodingUniformPointer,this._modelId),this.draw(this._viewer.scene.drawingBufferWidth,this._viewer.scene.drawingBufferHeight)}getId(f,m){let v=Math.floor(f),y=Math.floor(m),x=v,C=this._viewer.scene.drawingBufferHeight-y,w=this._viewer.scene.context._gl,A=new fce(w,this._viewer.scene.drawingBufferWidth,this._viewer.scene.drawingBufferHeight,this._viewer.scene.context.depthTexture,this._viewer.scene.context.webgl2?2:1);w.viewport(0,0,this._viewer.scene.drawingBufferWidth,this._viewer.scene.drawingBufferHeight),w.enable(w.DEPTH_TEST),w.disable(w.BLEND),w.clear(w.COLOR_BUFFER_BIT|w.DEPTH_BUFFER_BIT),this.onAfterDrawId();let E=A.getId(x,C);return A.delete(),this._viewer.scene.requestRender(),E}setActive(){let f=this._viewer.scene.context._gl;return f.useProgram(this._shader),f}isInRegion(f,m){let v=this._region[0]*this._viewer.scene.drawingBufferWidth,y=this._region[2]*this._viewer.scene.drawingBufferWidth,x=this._region[1]*this._viewer.scene.drawingBufferHeight,C=this._region[3]*this._viewer.scene.drawingBufferHeight;return!(f<v||f>y||m<x||m>C)}draw(f,m){if(this.stopped||!this._initialized)return;let v=this._viewer.scene.context._gl,y=this._viewer.scene.pixelRatio,x=Math.min(f,m),C=this.minSize*y/x,w=this.maxSize*y/x,A=this.ratio;A<C?A=C:A>w&&(A=w);let E=new Ee,T=1/A,S=T/m*f;m>f&&(S=1/A,T=S/f*m);let M=A*m/f*2,I=A*2;switch(this.position){case er.BOTTOM_RIGHT:Ee.computeOrthographicOffCenter(1-S,1,-1,T-1,-1,1,E),this._region=[1-M,0,1,I];break;case er.BOTTOM_LEFT:Ee.computeOrthographicOffCenter(-1,S-1,-1,T-1,-1,1,E),this._region=[0,0,M,I];break;case er.TOP_LEFT:Ee.computeOrthographicOffCenter(-1,S-1,1-T,1,-1,1,E),this._region=[0,1-I,M,1];break;case er.TOP_RIGHT:Ee.computeOrthographicOffCenter(1-S,1,1-T,1,-1,1,E),this._region=[1-M,1-I,1,1];break;default:}let P=Ee.multiply(this._viewer.camera.viewMatrix,this._modelMatrix,new Ee),D=Ee.getMatrix3(P,new Ut);if(this.trueNorth!==0){let F=-this.trueNorth*Math.PI/180,k=Ut.fromRotationZ(F,new Ut);D=Ut.multiply(D,k,new Ut)}v.useProgram(this._shader);let L=Ee.toArray(E,k8i),R=Ut.toArray(D,V8i);v.uniformMatrix4fv(this._pMatrixUniformPointer,!1,L),v.uniformMatrix3fv(this._rotationUniformPointer,!1,R),v.uniform1f(this._alphaUniformPointer,this._alpha),v.uniform1f(this._highlightingUniformPointer,this.highlighting),v.uniform1f(this._selectionUniformPointer,this._selection),v.bindBuffer(v.ARRAY_BUFFER,this._vertexBuffer),v.vertexAttribPointer(this._vertexAttrPointer,3,v.FLOAT,!1,0,0),v.bindBuffer(v.ARRAY_BUFFER,this._idBuffer),v.vertexAttribPointer(this._idAttrPointer,1,v.FLOAT,!1,0,0),v.bindBuffer(v.ARRAY_BUFFER,this._texCoordBuffer),v.vertexAttribPointer(this._texCoordAttrPointer,2,v.FLOAT,!1,0,0),v.activeTexture(v.TEXTURE1),v.bindTexture(v.TEXTURE_2D,this._texture),v.uniform1i(this._textureUniformPointer,1);let O=v.getParameter(v.CULL_FACE);O||v.enable(v.CULL_FACE),v.disable(v.BLEND),v.bindBuffer(v.ELEMENT_ARRAY_BUFFER,this._indexBuffer),v.drawElements(v.TRIANGLES,this.indices.length,v.UNSIGNED_SHORT,0),O||v.disable(v.CULL_FACE)}_initShader(){let f=this._viewer.scene.context._gl,m=this._viewer,v=(C,w)=>{if(f.shaderSource(C,w),f.compileShader(C),!f.getShaderParameter(C,f.COMPILE_STATUS)){let A=f.getShaderInfoLog(C);throw console.log(A),li(A)}},y=f.createShader(f.FRAGMENT_SHADER);v(y,P0t);let x=f.createShader(f.VERTEX_SHADER);if(v(x,I0t),this._shader=f.createProgram(),f.attachShader(this._shader,x),f.attachShader(this._shader,y),f.linkProgram(this._shader),!f.getProgramParameter(this._shader,f.LINK_STATUS))throw li("Could not initialise shaders for a navigation cube plugin")}};Object.defineProperties(uK.prototype,{stopped:{get:function(){return this._stopped},set:function(o){this._stopped=o,o?this._viewer.camera.lookAtTransform(Ee.IDENTITY):(this._targetCenter&&this._viewer.camera.viewBoundingSphere(new Pi(this._targetCenter,this._offsetDistance),new gC(this._heading,this._pitch,this._offsetDistance)),this._viewer.scene.requestRender()),this._viewer.scene.screenSpaceCameraController.enableZoom=o}},zoomDuration:{get:function(){return this._zoomDuration},set:function(o){this._zoomDuration=o}}});function z8i(o,f){if(!N(o))throw new li("earthCtrl is required.");let m=new uK(o,f);return Object.defineProperties(o,{navigationCube:{get:function(){return m}}}),m}var H8i=z8i;export{V3e as Analysis,Dm as BaseObject,XDe as Billboard,tLe as Box,NDe as BwMode,eDe as Camera,Iat as Cesium,YRi as ClusterLayer,ODe as ColorAdjustment,PC as Core,iLe as Cylinder,XRi as Degrees,wDe as DoubleClickObjectTool,JRi as DoubleScreen,Yst as DynamicEyeOffset,L8i as EarthCtrl,y3e as Edit,MDe as EditTool,KRi as ElevationTool,oLe as Ellipse,rLe as Ellipsoid,BDe as Environment,C4 as EventHandler,WDe as Explosion,cLe as FeatureLayer,UDe as Fire,jDe as Fireworks,HDe as FisheyeVideoProjection,DDe as Fog,pLe as Hawkeye,cDe as HorizontalDistanceTool,CDe as HoverObjectTool,sLe as ImageryLayer,QDe as Label,B8i as LineOfSightTool,TDe as Measure,KX as MeasureAreaTool,aDe as MeasureHeightTool,rDe as MeasureLineLengthTool,bse as MeasurePathLengthTool,lDe as MeasureSlopeTool,fDe as MeasureSurfaceAreaTool,Y3e as MilitaryPlotting,JDe as Model,L3e as ModelClipping,wX as ModelEdit,uLe as ModelLayer,FDe as NightMode,$6 as Node,$D as ObjectFactory,zDe as PerspectiveVideoProjection,_De as PickObjectTool,yDe as PickPositionTool,eLe as Point,$De as Polygon,ZDe as Polyline,aLe as PolylineVolume,P3e as Profile,EDe as RClickObjectTool,YDe as RadarScan,LDe as Rain,nLe as Rectangle,D3e as RestrictHeight,IX as SampleRenderedDataFlags,jRe as Scene,N8i as SceneManager,kDe as SelectSet,I3e as Skyline,GDe as Smoke,RDe as Snow,mc as SpatialObject,RX as SpatialTransform,mLe as SpotLight,E3e as Submergence,k3e as TerrainExcavation,lLe as TerrainLayer,N3e as TerrainModifier,ls as Tool,xMe as ToolManager,$0t as VERSIONINFO,x3e as ViewShed,A3e as Volumetric,LX as WFSTool,dLe as Waters,hLe as WorkChart,FWi as ZBiasGeometryInstanceAttribute,Zst as czmlPathAnimation,UWi as loadArrayBuffer,HWi as loadBlob,GWi as loadImage,zWi as loadJson,tlt as loadLayui,VWi as loadText,dMe as sampleRenderedData,BWi as sampleRenderedMesh,kWi as sampleRenderedTerrain,H8i as viewerNavigationCubeMixin};